summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.clang-format24
-rw-r--r--.cmake.conf5
-rw-r--r--.qmake.conf8
-rw-r--r--CHROMIUM_VERSION3
-rw-r--r--CMakeLists.txt42
-rw-r--r--LICENSE.FDL450
-rw-r--r--LICENSE.GPL3-EXCEPT704
-rw-r--r--LICENSE.GPLv3686
-rw-r--r--LICENSE.LGPL3177
-rw-r--r--LICENSE.LGPLv3174
-rw-r--r--LICENSES/BSD-3-Clause.txt9
-rw-r--r--LICENSES/GFDL-1.3-no-invariants-only.txt451
-rw-r--r--LICENSES/GPL-2.0-only.txt (renamed from LICENSE.GPL2)0
-rw-r--r--LICENSES/GPL-3.0-only.txt (renamed from LICENSE.GPL3)0
-rw-r--r--LICENSES/LGPL-3.0-only.txt165
-rw-r--r--LICENSES/LicenseRef-Qt-Commercial.txt8
-rw-r--r--LICENSES/Qt-GPL-exception-1.0.txt22
-rw-r--r--cmake/FindGPerf.cmake23
-rw-r--r--cmake/FindGn.cmake50
-rw-r--r--cmake/FindNinja.cmake34
-rw-r--r--cmake/FindNodejs.cmake40
-rw-r--r--cmake/FindPkgConfigHost.cmake43
-rw-r--r--cmake/FindSnappy.cmake38
-rw-r--r--cmake/Functions.cmake1405
-rw-r--r--cmake/Gn.cmake84
-rw-r--r--cmake/License.cmake51
-rw-r--r--cmake/SubmoduleUpdate.cmake70
-rw-r--r--coin-bug-7070
-rw-r--r--coin/module_config.yaml38
-rw-r--r--coin/qt-installer-package-config.json22
-rw-r--r--conanfile.py89
-rw-r--r--config.tests/hostcompiler/hostcompiler.pro9
-rw-r--r--config.tests/hostcompiler/main.cpp34
-rw-r--r--configure.cmake718
-rw-r--r--configure.json10
-rw-r--r--configure.pri541
-rw-r--r--dependencies.yaml13
-rw-r--r--dist/changes-5.12.1091
-rw-r--r--dist/changes-5.15.1138
-rw-r--r--dist/changes-5.15.286
-rw-r--r--examples/CMakeLists.txt21
-rw-r--r--examples/examples.pro25
-rw-r--r--examples/pdf/CMakeLists.txt8
-rw-r--r--examples/pdf/multipage/CMakeLists.txt75
-rw-r--r--examples/pdf/multipage/doc/src/multipage.qdoc59
-rw-r--r--examples/pdf/multipage/main.cpp68
-rw-r--r--examples/pdf/multipage/multipage.pro6
-rw-r--r--examples/pdf/multipage/pdfapplication.cpp16
-rw-r--r--examples/pdf/multipage/pdfapplication.h24
-rw-r--r--examples/pdf/multipage/resources/macos/Info.plist29
-rw-r--r--examples/pdf/multipage/resources/multipage.icnsbin0 -> 117648 bytes
-rw-r--r--examples/pdf/multipage/resources/sidebar-collapse-left.svg13
-rw-r--r--examples/pdf/multipage/resources/sidebar-expand-left.svg13
-rw-r--r--examples/pdf/multipage/resources/test.pdfbin80045 -> 76633 bytes
-rw-r--r--examples/pdf/multipage/viewer.qml370
-rw-r--r--examples/pdf/multipage/viewer.qrc4
-rw-r--r--examples/pdf/pdf.pro2
-rw-r--r--examples/pdf/pdfviewer/main.cpp72
-rw-r--r--examples/pdf/pdfviewer/pdfviewer.pro14
-rw-r--r--examples/pdf/pdfviewer/resources/test.pdfbin80045 -> 0 bytes
-rw-r--r--examples/pdf/pdfviewer/viewer.qml335
-rw-r--r--examples/pdf/pdfviewer/viewer.qrc21
-rw-r--r--examples/pdf/singlepage/CMakeLists.txt62
-rw-r--r--examples/pdf/singlepage/doc/src/singlepage.qdoc62
-rw-r--r--examples/pdf/singlepage/main.cpp37
-rw-r--r--examples/pdf/singlepage/resources/document-open.svg (renamed from examples/pdf/pdfviewer/resources/document-open.svg)0
-rw-r--r--examples/pdf/singlepage/resources/edit-clear.svg (renamed from examples/pdf/pdfviewer/resources/edit-clear.svg)0
-rw-r--r--examples/pdf/singlepage/resources/edit-copy.svg (renamed from examples/pdf/pdfviewer/resources/edit-copy.svg)0
-rw-r--r--examples/pdf/singlepage/resources/edit-select-all.svg (renamed from examples/pdf/pdfviewer/resources/edit-select-all.svg)0
-rw-r--r--examples/pdf/singlepage/resources/go-down-search.svg (renamed from examples/pdf/pdfviewer/resources/go-down-search.svg)0
-rw-r--r--examples/pdf/singlepage/resources/go-next-view-page.svg (renamed from examples/pdf/pdfviewer/resources/go-next-view-page.svg)0
-rw-r--r--examples/pdf/singlepage/resources/go-previous-view-page.svg (renamed from examples/pdf/pdfviewer/resources/go-previous-view-page.svg)0
-rw-r--r--examples/pdf/singlepage/resources/go-up-search.svg (renamed from examples/pdf/pdfviewer/resources/go-up-search.svg)0
-rw-r--r--examples/pdf/singlepage/resources/rotate-left.svg (renamed from examples/pdf/pdfviewer/resources/rotate-left.svg)0
-rw-r--r--examples/pdf/singlepage/resources/rotate-right.svg (renamed from examples/pdf/pdfviewer/resources/rotate-right.svg)0
-rw-r--r--examples/pdf/singlepage/resources/test.pdfbin0 -> 76633 bytes
-rw-r--r--examples/pdf/singlepage/resources/zoom-fit-best.svg (renamed from examples/pdf/pdfviewer/resources/zoom-fit-best.svg)0
-rw-r--r--examples/pdf/singlepage/resources/zoom-fit-width.svg (renamed from examples/pdf/pdfviewer/resources/zoom-fit-width.svg)0
-rw-r--r--examples/pdf/singlepage/resources/zoom-in.svg (renamed from examples/pdf/pdfviewer/resources/zoom-in.svg)0
-rw-r--r--examples/pdf/singlepage/resources/zoom-original.svg (renamed from examples/pdf/pdfviewer/resources/zoom-original.svg)0
-rw-r--r--examples/pdf/singlepage/resources/zoom-out.svg (renamed from examples/pdf/pdfviewer/resources/zoom-out.svg)0
-rw-r--r--examples/pdf/singlepage/singlepage.pro14
-rw-r--r--examples/pdf/singlepage/viewer.qml312
-rw-r--r--examples/pdf/singlepage/viewer.qrc21
-rw-r--r--examples/pdfwidgets/CMakeLists.txt1
-rw-r--r--examples/pdfwidgets/pdfviewer/CMakeLists.txt65
-rw-r--r--examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc59
-rw-r--r--examples/pdfwidgets/pdfviewer/images/busy.pngbin172 -> 0 bytes
-rw-r--r--examples/pdfwidgets/pdfviewer/images/document-open.svgzbin0 -> 4276 bytes
-rw-r--r--examples/pdfwidgets/pdfviewer/images/fileopen.pngbin1771 -> 0 bytes
-rw-r--r--examples/pdfwidgets/pdfviewer/images/go-down-search.svgzbin0 -> 330 bytes
-rw-r--r--examples/pdfwidgets/pdfviewer/images/go-next-24.pngbin782 -> 0 bytes
-rw-r--r--examples/pdfwidgets/pdfviewer/images/go-next-view-page.svgzbin0 -> 12615 bytes
-rw-r--r--examples/pdfwidgets/pdfviewer/images/go-next-view.svgzbin0 -> 6360 bytes
-rw-r--r--examples/pdfwidgets/pdfviewer/images/go-previous-24.pngbin797 -> 0 bytes
-rw-r--r--examples/pdfwidgets/pdfviewer/images/go-previous-view-page.svgzbin0 -> 12602 bytes
-rw-r--r--examples/pdfwidgets/pdfviewer/images/go-previous-view.svgzbin0 -> 6545 bytes
-rw-r--r--examples/pdfwidgets/pdfviewer/images/go-up-search.svgzbin0 -> 241 bytes
-rw-r--r--examples/pdfwidgets/pdfviewer/images/zoom-fit-best.svgzbin0 -> 6121 bytes
-rw-r--r--examples/pdfwidgets/pdfviewer/images/zoom-fit-width.svgzbin0 -> 6109 bytes
-rw-r--r--examples/pdfwidgets/pdfviewer/images/zoom-in-24.pngbin1302 -> 0 bytes
-rw-r--r--examples/pdfwidgets/pdfviewer/images/zoom-in-32.pngbin1873 -> 0 bytes
-rw-r--r--examples/pdfwidgets/pdfviewer/images/zoom-in.svgzbin0 -> 6033 bytes
-rw-r--r--examples/pdfwidgets/pdfviewer/images/zoom-original.svgzbin0 -> 5541 bytes
-rw-r--r--examples/pdfwidgets/pdfviewer/images/zoom-out-24.pngbin1247 -> 0 bytes
-rw-r--r--examples/pdfwidgets/pdfviewer/images/zoom-out-32.pngbin1749 -> 0 bytes
-rw-r--r--examples/pdfwidgets/pdfviewer/images/zoom-out.svgzbin0 -> 5420 bytes
-rw-r--r--examples/pdfwidgets/pdfviewer/images/zoom-previous.svgzbin0 -> 5665 bytes
-rw-r--r--examples/pdfwidgets/pdfviewer/main.cpp54
-rw-r--r--examples/pdfwidgets/pdfviewer/mainwindow.cpp177
-rw-r--r--examples/pdfwidgets/pdfviewer/mainwindow.h55
-rw-r--r--examples/pdfwidgets/pdfviewer/mainwindow.ui171
-rw-r--r--examples/pdfwidgets/pdfviewer/pageselector.cpp111
-rw-r--r--examples/pdfwidgets/pdfviewer/pageselector.h72
-rw-r--r--examples/pdfwidgets/pdfviewer/pdfviewer.pro4
-rw-r--r--examples/pdfwidgets/pdfviewer/resources.qrc17
-rw-r--r--examples/pdfwidgets/pdfviewer/searchresultdelegate.cpp46
-rw-r--r--examples/pdfwidgets/pdfviewer/searchresultdelegate.h20
-rw-r--r--examples/pdfwidgets/pdfviewer/zoomselector.cpp45
-rw-r--r--examples/pdfwidgets/pdfviewer/zoomselector.h37
-rw-r--r--examples/webengine/customdialogs/MessageRectangle.qml65
-rw-r--r--examples/webengine/customdialogs/SwitchButton.qml70
-rw-r--r--examples/webengine/customdialogs/WebView.qml153
-rw-r--r--examples/webengine/customdialogs/customdialogs.pro18
-rw-r--r--examples/webengine/customdialogs/customdialogs.qrc24
-rw-r--r--examples/webengine/customdialogs/doc/images/customdialogs-auth1.pngbin4923 -> 0 bytes
-rw-r--r--examples/webengine/customdialogs/doc/images/customdialogs-auth2.pngbin5064 -> 0 bytes
-rw-r--r--examples/webengine/customdialogs/doc/images/customdialogs-color1.pngbin22018 -> 0 bytes
-rw-r--r--examples/webengine/customdialogs/doc/images/customdialogs-color2.pngbin3952 -> 0 bytes
-rw-r--r--examples/webengine/customdialogs/doc/images/customdialogs-file1.pngbin10101 -> 0 bytes
-rw-r--r--examples/webengine/customdialogs/doc/images/customdialogs-file2.pngbin6773 -> 0 bytes
-rw-r--r--examples/webengine/customdialogs/doc/images/customdialogs-menu.pngbin5484 -> 0 bytes
-rw-r--r--examples/webengine/customdialogs/doc/images/customdialogs-prompt1.pngbin2597 -> 0 bytes
-rw-r--r--examples/webengine/customdialogs/doc/images/customdialogs-prompt2.pngbin4764 -> 0 bytes
-rw-r--r--examples/webengine/customdialogs/doc/images/customdialogs-tooltip.pngbin1617 -> 0 bytes
-rw-r--r--examples/webengine/customdialogs/doc/images/customdialogs.pngbin9093 -> 0 bytes
-rw-r--r--examples/webengine/customdialogs/doc/src/customdialogs.qdoc333
-rw-r--r--examples/webengine/customdialogs/forms/Authentication.qml78
-rw-r--r--examples/webengine/customdialogs/forms/AuthenticationForm.ui.qml171
-rw-r--r--examples/webengine/customdialogs/forms/Button.qml108
-rw-r--r--examples/webengine/customdialogs/forms/ColorCell.qml63
-rw-r--r--examples/webengine/customdialogs/forms/ColorPicker.qml78
-rw-r--r--examples/webengine/customdialogs/forms/ColorPickerForm.ui.qml235
-rw-r--r--examples/webengine/customdialogs/forms/FilePicker.qml91
-rw-r--r--examples/webengine/customdialogs/forms/FilePickerForm.ui.qml177
-rw-r--r--examples/webengine/customdialogs/forms/FileRow.qml92
-rw-r--r--examples/webengine/customdialogs/forms/JavaScript.qml91
-rw-r--r--examples/webengine/customdialogs/forms/JavaScriptForm.ui.qml159
-rw-r--r--examples/webengine/customdialogs/forms/Menu.qml69
-rw-r--r--examples/webengine/customdialogs/forms/MenuForm.ui.qml113
-rw-r--r--examples/webengine/customdialogs/index.html48
-rw-r--r--examples/webengine/customdialogs/main.cpp88
-rw-r--r--examples/webengine/customdialogs/main.qml100
-rw-r--r--examples/webengine/customdialogs/server.cpp85
-rw-r--r--examples/webengine/customdialogs/server.h75
-rw-r--r--examples/webengine/lifecycle/WebBrowser.qml172
-rw-r--r--examples/webengine/lifecycle/WebTab.qml212
-rw-r--r--examples/webengine/lifecycle/WebTabBar.qml100
-rw-r--r--examples/webengine/lifecycle/WebTabButton.qml158
-rw-r--r--examples/webengine/lifecycle/WebTabStack.qml98
-rw-r--r--examples/webengine/lifecycle/WebToolButton.qml63
-rw-r--r--examples/webengine/lifecycle/doc/src/lifecycle.qdoc104
-rw-r--r--examples/webengine/lifecycle/lifecycle.pro10
-rw-r--r--examples/webengine/lifecycle/main.cpp66
-rw-r--r--examples/webengine/minimal/doc/src/minimal.qdoc91
-rw-r--r--examples/webengine/minimal/main.cpp68
-rw-r--r--examples/webengine/minimal/main.qml63
-rw-r--r--examples/webengine/minimal/minimal.pro10
-rw-r--r--examples/webengine/quicknanobrowser/ApplicationRoot.qml89
-rw-r--r--examples/webengine/quicknanobrowser/BrowserDialog.qml74
-rw-r--r--examples/webengine/quicknanobrowser/BrowserWindow.qml724
-rw-r--r--examples/webengine/quicknanobrowser/DownloadView.qml175
-rw-r--r--examples/webengine/quicknanobrowser/FindBar.qml146
-rw-r--r--examples/webengine/quicknanobrowser/FullScreenNotification.qml109
-rw-r--r--examples/webengine/quicknanobrowser/doc/src/quicknanobrowser.qdoc149
-rw-r--r--examples/webengine/quicknanobrowser/icons/3rdparty/qt_attribution.json24
-rw-r--r--examples/webengine/quicknanobrowser/main.cpp97
-rw-r--r--examples/webengine/quicknanobrowser/quicknanobrowser.pro25
-rw-r--r--examples/webengine/quicknanobrowser/resources.qrc16
-rw-r--r--examples/webengine/quicknanobrowser/utils.h70
-rw-r--r--examples/webengine/recipebrowser/doc/images/recipebrowser-demo.jpgbin33398 -> 0 bytes
-rw-r--r--examples/webengine/recipebrowser/doc/src/recipebrowser.qdoc234
-rw-r--r--examples/webengine/recipebrowser/main.cpp78
-rw-r--r--examples/webengine/recipebrowser/recipebrowser.pro21
-rw-r--r--examples/webengine/recipebrowser/resources/pages/assets/3rdparty/qt_attribution.json35
-rw-r--r--examples/webengine/recipebrowser/resources/pages/assets/custom.css75
-rw-r--r--examples/webengine/recipebrowser/resources/pages/assets/custom.js67
-rw-r--r--examples/webengine/recipebrowser/resources/pages/burger.html77
-rw-r--r--examples/webengine/recipebrowser/resources/pages/cupcakes.html55
-rw-r--r--examples/webengine/recipebrowser/resources/pages/pasta.html58
-rw-r--r--examples/webengine/recipebrowser/resources/pages/pizza.html49
-rw-r--r--examples/webengine/recipebrowser/resources/pages/skewers.html55
-rw-r--r--examples/webengine/recipebrowser/resources/pages/soup.html43
-rw-r--r--examples/webengine/recipebrowser/resources/pages/steak.html69
-rw-r--r--examples/webengine/recipebrowser/resources/qml/RecipeList.qml172
-rw-r--r--examples/webengine/recipebrowser/resources/qml/main.qml168
-rw-r--r--examples/webengine/recipebrowser/resources/resources.qrc27
-rw-r--r--examples/webengine/webengine.pro13
-rw-r--r--examples/webengine/webengineaction/doc/images/webengineaction-example.pngbin100266 -> 0 bytes
-rw-r--r--examples/webengine/webengineaction/doc/src/webengineaction.qdoc68
-rw-r--r--examples/webengine/webengineaction/main.cpp67
-rw-r--r--examples/webengine/webengineaction/main.qml166
-rw-r--r--examples/webengine/webengineaction/webengineaction.pro10
-rw-r--r--examples/webenginequick/CMakeLists.txt5
-rw-r--r--examples/webenginequick/lifecycle/CMakeLists.txt55
-rw-r--r--examples/webenginequick/lifecycle/WebBrowser.qml125
-rw-r--r--examples/webenginequick/lifecycle/WebTab.qml165
-rw-r--r--examples/webenginequick/lifecycle/WebTabBar.qml53
-rw-r--r--examples/webenginequick/lifecycle/WebTabButton.qml111
-rw-r--r--examples/webenginequick/lifecycle/WebTabStack.qml51
-rw-r--r--examples/webenginequick/lifecycle/WebToolButton.qml16
-rw-r--r--examples/webenginequick/lifecycle/doc/images/lifecycle-automatic.png (renamed from examples/webengine/lifecycle/doc/images/lifecycle-automatic.png)bin8148 -> 8148 bytes
-rw-r--r--examples/webenginequick/lifecycle/doc/images/lifecycle-manual.png (renamed from examples/webengine/lifecycle/doc/images/lifecycle-manual.png)bin5855 -> 5855 bytes
-rw-r--r--examples/webenginequick/lifecycle/doc/images/lifecycle.png (renamed from examples/webengine/lifecycle/doc/images/lifecycle.png)bin24494 -> 24494 bytes
-rw-r--r--examples/webenginequick/lifecycle/doc/src/lifecycle.qdoc84
-rw-r--r--examples/webenginequick/lifecycle/lifecycle.pro11
-rw-r--r--examples/webenginequick/lifecycle/main.cpp21
-rw-r--r--examples/webenginequick/lifecycle/qtquickcontrols2.conf (renamed from examples/webengine/lifecycle/qtquickcontrols2.conf)0
-rw-r--r--examples/webenginequick/lifecycle/resources.qrc (renamed from examples/webengine/lifecycle/resources.qrc)0
-rw-r--r--examples/webenginequick/lifecycle/utils.h25
-rw-r--r--examples/webenginequick/quicknanobrowser/ApplicationRoot.qml40
-rw-r--r--examples/webenginequick/quicknanobrowser/BrowserDialog.qml27
-rw-r--r--examples/webenginequick/quicknanobrowser/BrowserWindow.qml871
-rw-r--r--examples/webenginequick/quicknanobrowser/CMakeLists.txt111
-rw-r--r--examples/webenginequick/quicknanobrowser/DownloadView.qml127
-rw-r--r--examples/webenginequick/quicknanobrowser/FindBar.qml109
-rw-r--r--examples/webenginequick/quicknanobrowser/FullScreenNotification.qml62
-rw-r--r--examples/webenginequick/quicknanobrowser/Info.cmake.macos.plist36
-rw-r--r--examples/webenginequick/quicknanobrowser/WebAuthDialog.qml281
-rw-r--r--examples/webenginequick/quicknanobrowser/doc/images/quicknanobrowser-demo.jpg (renamed from examples/webengine/quicknanobrowser/doc/images/quicknanobrowser-demo.jpg)bin30156 -> 30156 bytes
-rw-r--r--examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc187
-rw-r--r--examples/webenginequick/quicknanobrowser/icons/3rdparty/COPYING (renamed from examples/webengine/quicknanobrowser/icons/3rdparty/COPYING)0
-rw-r--r--examples/webenginequick/quicknanobrowser/icons/3rdparty/go-next.png (renamed from examples/webengine/quicknanobrowser/icons/3rdparty/go-next.png)bin930 -> 930 bytes
-rw-r--r--examples/webenginequick/quicknanobrowser/icons/3rdparty/go-previous.png (renamed from examples/webengine/quicknanobrowser/icons/3rdparty/go-previous.png)bin955 -> 955 bytes
-rw-r--r--examples/webenginequick/quicknanobrowser/icons/3rdparty/process-stop.png (renamed from examples/webengine/quicknanobrowser/icons/3rdparty/process-stop.png)bin1272 -> 1272 bytes
-rw-r--r--examples/webenginequick/quicknanobrowser/icons/3rdparty/qt_attribution.json24
-rw-r--r--examples/webenginequick/quicknanobrowser/icons/3rdparty/view-refresh.png (renamed from examples/webengine/quicknanobrowser/icons/3rdparty/view-refresh.png)bin1364 -> 1364 bytes
-rw-r--r--examples/webenginequick/quicknanobrowser/main.cpp53
-rw-r--r--examples/webenginequick/quicknanobrowser/quicknanobrowser.exe.manifest17
-rw-r--r--examples/webenginequick/quicknanobrowser/quicknanobrowser.pro27
-rw-r--r--examples/webenginequick/quicknanobrowser/resources.qrc17
-rw-r--r--examples/webenginequick/quicknanobrowser/utils.h29
-rw-r--r--examples/webenginequick/webenginequick.pro9
-rw-r--r--examples/webenginewidgets/CMakeLists.txt26
-rw-r--r--examples/webenginewidgets/clientcertificate/CMakeLists.txt60
-rw-r--r--examples/webenginewidgets/clientcertificate/client.cpp67
-rw-r--r--examples/webenginewidgets/clientcertificate/client.pro10
-rw-r--r--examples/webenginewidgets/clientcertificate/clientcertificate.pro7
-rw-r--r--examples/webenginewidgets/clientcertificate/doc/images/granted.pngbin0 -> 5031 bytes
-rw-r--r--examples/webenginewidgets/clientcertificate/doc/images/selection.pngbin0 -> 6300 bytes
-rw-r--r--examples/webenginewidgets/clientcertificate/doc/src/clientcertificate.qdoc160
-rw-r--r--examples/webenginewidgets/clientcertificate/resources/ca.pem24
-rw-r--r--examples/webenginewidgets/clientcertificate/resources/client.key27
-rw-r--r--examples/webenginewidgets/clientcertificate/resources/client.pem22
-rw-r--r--examples/webenginewidgets/clientcertificate/resources/client.qrc6
-rw-r--r--examples/webenginewidgets/clientcertificate/resources/server.key27
-rw-r--r--examples/webenginewidgets/clientcertificate/resources/server.pem22
-rw-r--r--examples/webenginewidgets/clientcertificate/resources/server.qrc7
-rw-r--r--examples/webenginewidgets/clientcertificate/server.cpp99
-rw-r--r--examples/webenginewidgets/clientcertificate/server.pro11
-rw-r--r--examples/webenginewidgets/contentmanipulation/CMakeLists.txt49
-rw-r--r--examples/webenginewidgets/contentmanipulation/doc/src/contentmanipulation.qdoc29
-rw-r--r--examples/webenginewidgets/contentmanipulation/main.cpp52
-rw-r--r--examples/webenginewidgets/contentmanipulation/mainwindow.cpp51
-rw-r--r--examples/webenginewidgets/contentmanipulation/mainwindow.h51
-rw-r--r--examples/webenginewidgets/cookiebrowser/3rdparty/qt_attribution.json20
-rw-r--r--examples/webenginewidgets/cookiebrowser/CMakeLists.txt54
-rw-r--r--examples/webenginewidgets/cookiebrowser/doc/src/cookiebrowser.qdoc29
-rw-r--r--examples/webenginewidgets/cookiebrowser/main.cpp52
-rw-r--r--examples/webenginewidgets/cookiebrowser/mainwindow.cpp69
-rw-r--r--examples/webenginewidgets/cookiebrowser/mainwindow.h57
-rw-r--r--examples/webenginewidgets/html2pdf/CMakeLists.txt36
-rw-r--r--examples/webenginewidgets/html2pdf/doc/src/html2pdf.qdoc39
-rw-r--r--examples/webenginewidgets/html2pdf/html2pdf.cpp73
-rw-r--r--examples/webenginewidgets/maps/CMakeLists.txt56
-rw-r--r--examples/webenginewidgets/maps/Info.cmake.macos.plist33
-rw-r--r--examples/webenginewidgets/maps/doc/src/maps.qdoc43
-rw-r--r--examples/webenginewidgets/maps/main.cpp52
-rw-r--r--examples/webenginewidgets/maps/mainwindow.cpp51
-rw-r--r--examples/webenginewidgets/maps/mainwindow.h51
-rw-r--r--examples/webenginewidgets/markdowneditor/doc/images/markdowneditor-example.pngbin41883 -> 0 bytes
-rw-r--r--examples/webenginewidgets/markdowneditor/doc/src/markdowneditor.qdoc183
-rw-r--r--examples/webenginewidgets/markdowneditor/document.cpp59
-rw-r--r--examples/webenginewidgets/markdowneditor/document.h73
-rw-r--r--examples/webenginewidgets/markdowneditor/main.cpp67
-rw-r--r--examples/webenginewidgets/markdowneditor/mainwindow.cpp189
-rw-r--r--examples/webenginewidgets/markdowneditor/mainwindow.h90
-rw-r--r--examples/webenginewidgets/markdowneditor/mainwindow.ui115
-rw-r--r--examples/webenginewidgets/markdowneditor/markdowneditor.pro32
-rw-r--r--examples/webenginewidgets/markdowneditor/previewpage.cpp64
-rw-r--r--examples/webenginewidgets/markdowneditor/previewpage.h66
-rw-r--r--examples/webenginewidgets/markdowneditor/resources/3rdparty/MARKDOWN-LICENSE.txt16
-rw-r--r--examples/webenginewidgets/markdowneditor/resources/3rdparty/MARKED-LICENSE.txt19
-rw-r--r--examples/webenginewidgets/markdowneditor/resources/3rdparty/markdown.css260
-rw-r--r--examples/webenginewidgets/markdowneditor/resources/3rdparty/marked.js1514
-rw-r--r--examples/webenginewidgets/markdowneditor/resources/3rdparty/qt_attribution.json35
-rw-r--r--examples/webenginewidgets/markdowneditor/resources/default.md12
-rw-r--r--examples/webenginewidgets/markdowneditor/resources/index.html32
-rw-r--r--examples/webenginewidgets/markdowneditor/resources/markdowneditor.qrc8
-rw-r--r--examples/webenginewidgets/minimal/doc/images/minimal-example.pngbin89294 -> 0 bytes
-rw-r--r--examples/webenginewidgets/minimal/doc/src/minimal.qdoc82
-rw-r--r--examples/webenginewidgets/minimal/main.cpp76
-rw-r--r--examples/webenginewidgets/notifications/CMakeLists.txt52
-rw-r--r--examples/webenginewidgets/notifications/doc/src/notifications.qdoc29
-rw-r--r--examples/webenginewidgets/notifications/main.cpp52
-rw-r--r--examples/webenginewidgets/notifications/notificationpopup.h51
-rw-r--r--examples/webenginewidgets/printme/CMakeLists.txt53
-rw-r--r--examples/webenginewidgets/printme/data/data.qrc1
-rw-r--r--examples/webenginewidgets/printme/data/icon.svg24
-rw-r--r--examples/webenginewidgets/printme/data/index.html2
-rw-r--r--examples/webenginewidgets/printme/data/style.css104
-rw-r--r--examples/webenginewidgets/printme/doc/images/printme-example.pngbin42074 -> 29055 bytes
-rw-r--r--examples/webenginewidgets/printme/doc/src/printme.qdoc55
-rw-r--r--examples/webenginewidgets/printme/main.cpp58
-rw-r--r--examples/webenginewidgets/printme/printhandler.cpp95
-rw-r--r--examples/webenginewidgets/printme/printhandler.h62
-rw-r--r--examples/webenginewidgets/push-notifications/CMakeLists.txt46
-rw-r--r--examples/webenginewidgets/push-notifications/content/index.html26
-rw-r--r--examples/webenginewidgets/push-notifications/content/ping.js84
-rw-r--r--examples/webenginewidgets/push-notifications/content/style.css29
-rw-r--r--examples/webenginewidgets/push-notifications/content/worker.js7
-rw-r--r--examples/webenginewidgets/push-notifications/data/data.qrc5
-rw-r--r--examples/webenginewidgets/push-notifications/data/icon.pngbin0 -> 2252 bytes
-rw-r--r--examples/webenginewidgets/push-notifications/doc/images/notification.pngbin0 -> 1279 bytes
-rw-r--r--examples/webenginewidgets/push-notifications/doc/images/permissions.pngbin0 -> 4749 bytes
-rw-r--r--examples/webenginewidgets/push-notifications/doc/images/push-notifications.pngbin0 -> 10573 bytes
-rw-r--r--examples/webenginewidgets/push-notifications/doc/images/website.pngbin0 -> 7539 bytes
-rw-r--r--examples/webenginewidgets/push-notifications/doc/src/push-notifications.qdoc203
-rw-r--r--examples/webenginewidgets/push-notifications/doc/src/push-notifications.qmodel837
-rw-r--r--examples/webenginewidgets/push-notifications/main.cpp41
-rw-r--r--examples/webenginewidgets/push-notifications/notificationpopup.h91
-rw-r--r--examples/webenginewidgets/push-notifications/push-notifications.pro10
-rw-r--r--examples/webenginewidgets/push-notifications/server.js65
-rw-r--r--examples/webenginewidgets/recipebrowser/CMakeLists.txt76
-rw-r--r--examples/webenginewidgets/recipebrowser/assets/3rdparty/MARKDOWN-LICENSE.txt (renamed from examples/webengine/recipebrowser/resources/pages/assets/3rdparty/MARKDOWN-LICENSE.txt)0
-rw-r--r--examples/webenginewidgets/recipebrowser/assets/3rdparty/MARKED-LICENSE.txt (renamed from examples/webengine/recipebrowser/resources/pages/assets/3rdparty/MARKED-LICENSE.txt)0
-rw-r--r--examples/webenginewidgets/recipebrowser/assets/3rdparty/markdown.css (renamed from examples/webengine/recipebrowser/resources/pages/assets/3rdparty/markdown.css)0
-rw-r--r--examples/webenginewidgets/recipebrowser/assets/3rdparty/marked.js (renamed from examples/webengine/recipebrowser/resources/pages/assets/3rdparty/marked.js)0
-rw-r--r--examples/webenginewidgets/recipebrowser/assets/3rdparty/qt_attribution.json34
-rw-r--r--examples/webenginewidgets/recipebrowser/assets/custom.css28
-rw-r--r--examples/webenginewidgets/recipebrowser/assets/custom.js13
-rw-r--r--examples/webenginewidgets/recipebrowser/assets/icons/add.svg4
-rw-r--r--examples/webenginewidgets/recipebrowser/assets/icons/edit.svg4
-rw-r--r--examples/webenginewidgets/recipebrowser/assets/icons/remove.svg4
-rw-r--r--examples/webenginewidgets/recipebrowser/assets/icons/stylesheets.svg4
-rw-r--r--examples/webenginewidgets/recipebrowser/assets/icons/view.svg4
-rw-r--r--examples/webenginewidgets/recipebrowser/assets/pages/burger.html96
-rw-r--r--examples/webenginewidgets/recipebrowser/assets/pages/cupcakes.html75
-rw-r--r--examples/webenginewidgets/recipebrowser/assets/pages/images/burger.jpg (renamed from examples/webengine/recipebrowser/resources/pages/images/burger.jpg)bin48882 -> 48882 bytes
-rw-r--r--examples/webenginewidgets/recipebrowser/assets/pages/images/cupcakes.jpg (renamed from examples/webengine/recipebrowser/resources/pages/images/cupcakes.jpg)bin38653 -> 38653 bytes
-rw-r--r--examples/webenginewidgets/recipebrowser/assets/pages/images/pasta.jpg (renamed from examples/webengine/recipebrowser/resources/pages/images/pasta.jpg)bin42411 -> 42411 bytes
-rw-r--r--examples/webenginewidgets/recipebrowser/assets/pages/images/pizza.jpg (renamed from examples/webengine/recipebrowser/resources/pages/images/pizza.jpg)bin49068 -> 49068 bytes
-rw-r--r--examples/webenginewidgets/recipebrowser/assets/pages/images/skewers.jpg (renamed from examples/webengine/recipebrowser/resources/pages/images/skewers.jpg)bin49246 -> 49246 bytes
-rw-r--r--examples/webenginewidgets/recipebrowser/assets/pages/images/soup.jpg (renamed from examples/webengine/recipebrowser/resources/pages/images/soup.jpg)bin49028 -> 49028 bytes
-rw-r--r--examples/webenginewidgets/recipebrowser/assets/pages/images/steak.jpg (renamed from examples/webengine/recipebrowser/resources/pages/images/steak.jpg)bin49202 -> 49202 bytes
-rw-r--r--examples/webenginewidgets/recipebrowser/assets/pages/pasta.html78
-rw-r--r--examples/webenginewidgets/recipebrowser/assets/pages/pizza.html69
-rw-r--r--examples/webenginewidgets/recipebrowser/assets/pages/skewers.html74
-rw-r--r--examples/webenginewidgets/recipebrowser/assets/pages/soup.html63
-rw-r--r--examples/webenginewidgets/recipebrowser/assets/pages/steak.html88
-rw-r--r--examples/webenginewidgets/recipebrowser/doc/images/recipebrowser.webpbin0 -> 31140 bytes
-rw-r--r--examples/webenginewidgets/recipebrowser/doc/src/recipebrowser.qdoc197
-rw-r--r--examples/webenginewidgets/recipebrowser/document.cpp48
-rw-r--r--examples/webenginewidgets/recipebrowser/document.h36
-rw-r--r--examples/webenginewidgets/recipebrowser/main.cpp18
-rw-r--r--examples/webenginewidgets/recipebrowser/mainwindow.cpp154
-rw-r--r--examples/webenginewidgets/recipebrowser/mainwindow.h44
-rw-r--r--examples/webenginewidgets/recipebrowser/mainwindow.ui116
-rw-r--r--examples/webenginewidgets/recipebrowser/recipebrowser.pro24
-rw-r--r--examples/webenginewidgets/recipebrowser/recipebrowser.qrc27
-rw-r--r--examples/webenginewidgets/recipebrowser/stylesheetdialog.cpp129
-rw-r--r--examples/webenginewidgets/recipebrowser/stylesheetdialog.h39
-rw-r--r--examples/webenginewidgets/recipebrowser/stylesheetdialog.ui132
-rw-r--r--examples/webenginewidgets/simplebrowser/CMakeLists.txt109
-rw-r--r--examples/webenginewidgets/simplebrowser/Info.cmake.macos.plist36
-rw-r--r--examples/webenginewidgets/simplebrowser/browser.cpp82
-rw-r--r--examples/webenginewidgets/simplebrowser/browser.h60
-rw-r--r--examples/webenginewidgets/simplebrowser/browserwindow.cpp149
-rw-r--r--examples/webenginewidgets/simplebrowser/browserwindow.h72
-rw-r--r--examples/webenginewidgets/simplebrowser/data/3rdparty/qt_attribution.json20
-rw-r--r--examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc101
-rw-r--r--examples/webenginewidgets/simplebrowser/downloadmanagerwidget.cpp66
-rw-r--r--examples/webenginewidgets/simplebrowser/downloadmanagerwidget.h59
-rw-r--r--examples/webenginewidgets/simplebrowser/downloadwidget.cpp108
-rw-r--r--examples/webenginewidgets/simplebrowser/downloadwidget.h61
-rw-r--r--examples/webenginewidgets/simplebrowser/main.cpp76
-rw-r--r--examples/webenginewidgets/simplebrowser/simplebrowser.exe.manifest17
-rw-r--r--examples/webenginewidgets/simplebrowser/simplebrowser.pro14
-rw-r--r--examples/webenginewidgets/simplebrowser/tabwidget.cpp69
-rw-r--r--examples/webenginewidgets/simplebrowser/tabwidget.h56
-rw-r--r--examples/webenginewidgets/simplebrowser/webauthdialog.cpp294
-rw-r--r--examples/webenginewidgets/simplebrowser/webauthdialog.h41
-rw-r--r--examples/webenginewidgets/simplebrowser/webauthdialog.ui151
-rw-r--r--examples/webenginewidgets/simplebrowser/webpage.cpp225
-rw-r--r--examples/webenginewidgets/simplebrowser/webpage.h67
-rw-r--r--examples/webenginewidgets/simplebrowser/webpopupwindow.cpp51
-rw-r--r--examples/webenginewidgets/simplebrowser/webpopupwindow.h53
-rw-r--r--examples/webenginewidgets/simplebrowser/webview.cpp358
-rw-r--r--examples/webenginewidgets/simplebrowser/webview.h82
-rw-r--r--examples/webenginewidgets/spellchecker/CMakeLists.txt65
-rw-r--r--examples/webenginewidgets/spellchecker/data/icon.svg24
-rw-r--r--examples/webenginewidgets/spellchecker/data/index.html47
-rw-r--r--examples/webenginewidgets/spellchecker/data/spellchecker.qrc1
-rw-r--r--examples/webenginewidgets/spellchecker/data/style.css145
-rw-r--r--examples/webenginewidgets/spellchecker/doc/images/spellchecker-example.pngbin15978 -> 28507 bytes
-rw-r--r--examples/webenginewidgets/spellchecker/doc/src/spellchecker.qdoc29
-rw-r--r--examples/webenginewidgets/spellchecker/main.cpp54
-rw-r--r--examples/webenginewidgets/spellchecker/spellchecker.pro5
-rw-r--r--examples/webenginewidgets/spellchecker/webview.cpp61
-rw-r--r--examples/webenginewidgets/spellchecker/webview.h51
-rw-r--r--examples/webenginewidgets/stylesheetbrowser/3rdparty/COPYING1
-rw-r--r--examples/webenginewidgets/stylesheetbrowser/3rdparty/qt_attribution.json24
-rw-r--r--examples/webenginewidgets/stylesheetbrowser/3rdparty/view-refresh.pngbin1364 -> 0 bytes
-rw-r--r--examples/webenginewidgets/stylesheetbrowser/doc/images/stylesheetbrowser.pngbin45161 -> 0 bytes
-rw-r--r--examples/webenginewidgets/stylesheetbrowser/doc/src/stylesheetbrowser.qdoc68
-rw-r--r--examples/webenginewidgets/stylesheetbrowser/main.cpp66
-rw-r--r--examples/webenginewidgets/stylesheetbrowser/mainwindow.cpp168
-rw-r--r--examples/webenginewidgets/stylesheetbrowser/mainwindow.h87
-rw-r--r--examples/webenginewidgets/stylesheetbrowser/mainwindow.ui133
-rw-r--r--examples/webenginewidgets/stylesheetbrowser/stylesheetbrowser.pro22
-rw-r--r--examples/webenginewidgets/stylesheetbrowser/stylesheetbrowser.qrc5
-rw-r--r--examples/webenginewidgets/stylesheetbrowser/stylesheetdialog.cpp177
-rw-r--r--examples/webenginewidgets/stylesheetbrowser/stylesheetdialog.h86
-rw-r--r--examples/webenginewidgets/stylesheetbrowser/stylesheetdialog.ui122
-rw-r--r--examples/webenginewidgets/videoplayer/CMakeLists.txt53
-rw-r--r--examples/webenginewidgets/videoplayer/doc/src/videoplayer.qdoc29
-rw-r--r--examples/webenginewidgets/videoplayer/fullscreennotification.cpp51
-rw-r--r--examples/webenginewidgets/videoplayer/fullscreennotification.h51
-rw-r--r--examples/webenginewidgets/videoplayer/fullscreenwindow.cpp51
-rw-r--r--examples/webenginewidgets/videoplayer/fullscreenwindow.h51
-rw-r--r--examples/webenginewidgets/videoplayer/main.cpp52
-rw-r--r--examples/webenginewidgets/videoplayer/mainwindow.cpp51
-rw-r--r--examples/webenginewidgets/videoplayer/mainwindow.h51
-rw-r--r--examples/webenginewidgets/webenginewidgets.pro14
-rw-r--r--examples/webenginewidgets/webui/about.html129
-rw-r--r--examples/webenginewidgets/webui/doc/images/webui-example.pngbin28862 -> 0 bytes
-rw-r--r--examples/webenginewidgets/webui/doc/src/webui.qdoc165
-rw-r--r--examples/webenginewidgets/webui/main.cpp82
-rw-r--r--examples/webenginewidgets/webui/webui.pro16
-rw-r--r--examples/webenginewidgets/webui/webui.qrc5
-rw-r--r--examples/webenginewidgets/webui/webuihandler.cpp98
-rw-r--r--examples/webenginewidgets/webui/webuihandler.h70
-rw-r--r--mkspecs/features/default_pre.prf20
-rw-r--r--mkspecs/features/functions.prf134
-rw-r--r--mkspecs/features/gn_generator.prf271
-rw-r--r--qt_cmdline.cmake7
-rw-r--r--qtwebengine.pro15
m---------src/3rdparty0
-rw-r--r--src/CMakeLists.txt223
-rw-r--r--src/buildtools/buildtools.pro20
-rw-r--r--src/buildtools/config/common.pri98
-rw-r--r--src/buildtools/config/functions.pri8
-rw-r--r--src/buildtools/config/linux.pri178
-rw-r--r--src/buildtools/config/mac_osx.pri38
-rw-r--r--src/buildtools/config/support.pri250
-rw-r--r--src/buildtools/config/windows.pri95
-rw-r--r--src/buildtools/configure.json780
-rw-r--r--src/buildtools/configure_host.pro65
-rw-r--r--src/buildtools/configure_target.pro33
-rw-r--r--src/buildtools/gn.pro41
-rw-r--r--src/buildtools/ninja.pro23
-rw-r--r--src/core/CMakeLists.txt673
-rw-r--r--src/core/accessibility_activation_observer.cpp53
-rw-r--r--src/core/accessibility_activation_observer.h46
-rw-r--r--src/core/accessibility_tree_formatter_qt.cpp272
-rw-r--r--src/core/api/CMakeLists.txt221
-rw-r--r--src/core/api/Qt6WebEngineCoreDeploySupport.cmake173
-rw-r--r--src/core/api/Qt6WebEngineCoreMacros.cmake74
-rw-r--r--src/core/api/configure.cmake255
-rw-r--r--src/core/api/core_api.pro86
-rw-r--r--src/core/api/qt_cmdline.cmake34
-rw-r--r--src/core/api/qtbug-60565.cpp138
-rw-r--r--src/core/api/qtbug-61521.cpp120
-rw-r--r--src/core/api/qtwebenginecoreglobal.cpp189
-rw-r--r--src/core/api/qtwebenginecoreglobal.h49
-rw-r--r--src/core/api/qtwebenginecoreglobal_p.h55
-rw-r--r--src/core/api/qwebenginecallback.h101
-rw-r--r--src/core/api/qwebenginecallback_p.h253
-rw-r--r--src/core/api/qwebenginecertificateerror.cpp162
-rw-r--r--src/core/api/qwebenginecertificateerror.h78
-rw-r--r--src/core/api/qwebengineclientcertificateselection.cpp88
-rw-r--r--src/core/api/qwebengineclientcertificateselection.h44
-rw-r--r--src/core/api/qwebengineclientcertificatestore.cpp63
-rw-r--r--src/core/api/qwebengineclientcertificatestore.h54
-rw-r--r--src/core/api/qwebengineclienthints.cpp211
-rw-r--r--src/core/api/qwebengineclienthints.h72
-rw-r--r--src/core/api/qwebenginecontextmenurequest.cpp260
-rw-r--r--src/core/api/qwebenginecontextmenurequest.h136
-rw-r--r--src/core/api/qwebenginecontextmenurequest_p.h57
-rw-r--r--src/core/api/qwebenginecookiestore.cpp109
-rw-r--r--src/core/api/qwebenginecookiestore.h47
-rw-r--r--src/core/api/qwebenginecookiestore_p.h59
-rw-r--r--src/core/api/qwebenginedesktopmediarequest.cpp206
-rw-r--r--src/core/api/qwebenginedesktopmediarequest.h59
-rw-r--r--src/core/api/qwebenginedesktopmediarequest_p.h49
-rw-r--r--src/core/api/qwebenginedownloadrequest.cpp637
-rw-r--r--src/core/api/qwebenginedownloadrequest.h139
-rw-r--r--src/core/api/qwebenginedownloadrequest_p.h68
-rw-r--r--src/core/api/qwebenginefilesystemaccessrequest.cpp126
-rw-r--r--src/core/api/qwebenginefilesystemaccessrequest.h70
-rw-r--r--src/core/api/qwebenginefindtextresult.cpp40
-rw-r--r--src/core/api/qwebenginefindtextresult.h47
-rw-r--r--src/core/api/qwebenginefullscreenrequest.cpp113
-rw-r--r--src/core/api/qwebenginefullscreenrequest.h46
-rw-r--r--src/core/api/qwebengineglobalsettings.cpp125
-rw-r--r--src/core/api/qwebengineglobalsettings.h30
-rw-r--r--src/core/api/qwebengineglobalsettings_p.h44
-rw-r--r--src/core/api/qwebenginehistory.cpp389
-rw-r--r--src/core/api/qwebenginehistory.h136
-rw-r--r--src/core/api/qwebenginehistory_p.h99
-rw-r--r--src/core/api/qwebenginehttprequest.cpp60
-rw-r--r--src/core/api/qwebenginehttprequest.h52
-rw-r--r--src/core/api/qwebengineloadinginfo.cpp180
-rw-r--r--src/core/api/qwebengineloadinginfo.h82
-rw-r--r--src/core/api/qwebenginemessagepumpscheduler.cpp51
-rw-r--r--src/core/api/qwebenginemessagepumpscheduler_p.h46
-rw-r--r--src/core/api/qwebenginenavigationrequest.cpp185
-rw-r--r--src/core/api/qwebenginenavigationrequest.h76
-rw-r--r--src/core/api/qwebenginenewwindowrequest.cpp157
-rw-r--r--src/core/api/qwebenginenewwindowrequest.h62
-rw-r--r--src/core/api/qwebenginenewwindowrequest_p.h48
-rw-r--r--src/core/api/qwebenginenotification.cpp42
-rw-r--r--src/core/api/qwebenginenotification.h51
-rw-r--r--src/core/api/qwebenginepage.cpp2521
-rw-r--r--src/core/api/qwebenginepage.h400
-rw-r--r--src/core/api/qwebenginepage_p.h225
-rw-r--r--src/core/api/qwebengineprofile.cpp947
-rw-r--r--src/core/api/qwebengineprofile.h133
-rw-r--r--src/core/api/qwebengineprofile_p.h75
-rw-r--r--src/core/api/qwebenginequotarequest.cpp83
-rw-r--r--src/core/api/qwebenginequotarequest.h64
-rw-r--r--src/core/api/qwebengineregisterprotocolhandlerrequest.cpp46
-rw-r--r--src/core/api/qwebengineregisterprotocolhandlerrequest.h46
-rw-r--r--src/core/api/qwebenginescript.cpp283
-rw-r--r--src/core/api/qwebenginescript.h91
-rw-r--r--src/core/api/qwebenginescriptcollection.cpp179
-rw-r--r--src/core/api/qwebenginescriptcollection.h44
-rw-r--r--src/core/api/qwebenginescriptcollection_p.h51
-rw-r--r--src/core/api/qwebenginesettings.cpp121
-rw-r--r--src/core/api/qwebenginesettings.h127
-rw-r--r--src/core/api/qwebengineurlrequestinfo.cpp135
-rw-r--r--src/core/api/qwebengineurlrequestinfo.h61
-rw-r--r--src/core/api/qwebengineurlrequestinfo_p.h57
-rw-r--r--src/core/api/qwebengineurlrequestinterceptor.cpp11
-rw-r--r--src/core/api/qwebengineurlrequestinterceptor.h49
-rw-r--r--src/core/api/qwebengineurlrequestjob.cpp73
-rw-r--r--src/core/api/qwebengineurlrequestjob.h46
-rw-r--r--src/core/api/qwebengineurlscheme.cpp61
-rw-r--r--src/core/api/qwebengineurlscheme.h44
-rw-r--r--src/core/api/qwebengineurlschemehandler.cpp75
-rw-r--r--src/core/api/qwebengineurlschemehandler.h49
-rw-r--r--src/core/api/qwebenginewebauthuxrequest.cpp427
-rw-r--r--src/core/api/qwebenginewebauthuxrequest.h117
-rw-r--r--src/core/api/qwebenginewebauthuxrequest_p.h43
-rw-r--r--src/core/authentication_dialog_controller.cpp43
-rw-r--r--src/core/authentication_dialog_controller.h45
-rw-r--r--src/core/authentication_dialog_controller_p.h40
-rw-r--r--src/core/authenticator_request_client_delegate_qt.cpp247
-rw-r--r--src/core/authenticator_request_client_delegate_qt.h96
-rw-r--r--src/core/authenticator_request_dialog_controller.cpp302
-rw-r--r--src/core/authenticator_request_dialog_controller.h53
-rw-r--r--src/core/authenticator_request_dialog_controller_p.h78
-rw-r--r--src/core/autofill_client_qt.cpp147
-rw-r--r--src/core/autofill_client_qt.h76
-rw-r--r--src/core/autofill_popup_controller.cpp113
-rw-r--r--src/core/autofill_popup_controller.h62
-rw-r--r--src/core/autofill_popup_controller_p.h40
-rw-r--r--src/core/browser_accessibility_manager_qt.cpp133
-rw-r--r--src/core/browser_accessibility_manager_qt.h69
-rw-r--r--src/core/browser_accessibility_qt.cpp693
-rw-r--r--src/core/browser_accessibility_qt.h152
-rw-r--r--src/core/browser_main_parts_qt.cpp255
-rw-r--r--src/core/browser_main_parts_qt.h65
-rw-r--r--src/core/browser_message_filter_qt.cpp151
-rw-r--r--src/core/browser_message_filter_qt.h101
-rw-r--r--src/core/browsing_data_remover_delegate_qt.cpp60
-rw-r--r--src/core/browsing_data_remover_delegate_qt.h57
-rw-r--r--src/core/build_config_qt.h40
-rw-r--r--src/core/certificate_error_controller.cpp247
-rw-r--r--src/core/certificate_error_controller.h132
-rw-r--r--src/core/certificate_error_controller_p.h79
-rw-r--r--src/core/chromium_overrides.cpp255
-rw-r--r--src/core/client_cert_select_controller.cpp66
-rw-r--r--src/core/client_cert_select_controller.h58
-rw-r--r--src/core/client_hints.cpp177
-rw-r--r--src/core/client_hints.h102
-rw-r--r--src/core/clipboard_change_observer.h49
-rw-r--r--src/core/clipboard_qt.cpp363
-rw-r--r--src/core/clipboard_qt.h105
-rw-r--r--src/core/clipboard_util_win.cpp115
-rw-r--r--src/core/color_chooser_controller.cpp43
-rw-r--r--src/core/color_chooser_controller.h47
-rw-r--r--src/core/color_chooser_controller_p.h44
-rw-r--r--src/core/color_chooser_qt.cpp46
-rw-r--r--src/core/color_chooser_qt.h48
-rw-r--r--src/core/common/extensions/api/qtwebengine_extensions_features.gni25
-rw-r--r--src/core/common/extensions/extensions_api_provider_qt.cpp61
-rw-r--r--src/core/common/extensions/extensions_api_provider_qt.h44
-rw-r--r--src/core/common/extensions/extensions_client_qt.cpp60
-rw-r--r--src/core/common/extensions/extensions_client_qt.h57
-rw-r--r--src/core/common/qt_ipc_logging.cpp48
-rw-r--r--src/core/common/qt_messages.cpp3
-rw-r--r--src/core/common/qt_messages.h96
-rw-r--r--src/core/common/user_script_data.cpp49
-rw-r--r--src/core/common/user_script_data.h74
-rw-r--r--src/core/compositor/chromium_gpu_helper.cpp87
-rw-r--r--src/core/compositor/chromium_gpu_helper.h73
-rw-r--r--src/core/compositor/compositor.cpp251
-rw-r--r--src/core/compositor/compositor.h238
-rw-r--r--src/core/compositor/compositor_resource.h123
-rw-r--r--src/core/compositor/compositor_resource_fence.cpp51
-rw-r--r--src/core/compositor/compositor_resource_fence.h40
-rw-r--r--src/core/compositor/compositor_resource_tracker.cpp266
-rw-r--r--src/core/compositor/compositor_resource_tracker.h127
-rw-r--r--src/core/compositor/content_gpu_client_qt.cpp49
-rw-r--r--src/core/compositor/content_gpu_client_qt.h50
-rw-r--r--src/core/compositor/delegated_frame_node.cpp1106
-rw-r--r--src/core/compositor/delegated_frame_node.h133
-rw-r--r--src/core/compositor/display_consumer.h62
-rw-r--r--src/core/compositor/display_frame_sink.cpp140
-rw-r--r--src/core/compositor/display_frame_sink.h77
-rw-r--r--src/core/compositor/display_gl_output_surface.cpp300
-rw-r--r--src/core/compositor/display_gl_output_surface.h149
-rw-r--r--src/core/compositor/display_gl_output_surface_qsg.cpp121
-rw-r--r--src/core/compositor/display_overrides.cpp153
-rw-r--r--src/core/compositor/display_producer.h69
-rw-r--r--src/core/compositor/display_skia_output_device.cpp240
-rw-r--r--src/core/compositor/display_skia_output_device.h89
-rw-r--r--src/core/compositor/display_software_output_surface.cpp180
-rw-r--r--src/core/compositor/display_software_output_surface.h46
-rw-r--r--src/core/compositor/native_skia_output_device.cpp418
-rw-r--r--src/core/compositor/native_skia_output_device.h183
-rw-r--r--src/core/compositor/native_skia_output_device_direct3d11.cpp88
-rw-r--r--src/core/compositor/native_skia_output_device_direct3d11.h28
-rw-r--r--src/core/compositor/native_skia_output_device_mac.mm90
-rw-r--r--src/core/compositor/native_skia_output_device_metal.cpp47
-rw-r--r--src/core/compositor/native_skia_output_device_metal.h28
-rw-r--r--src/core/compositor/native_skia_output_device_opengl.cpp86
-rw-r--r--src/core/compositor/native_skia_output_device_opengl.h28
-rw-r--r--src/core/compositor/native_skia_output_device_vulkan.cpp306
-rw-r--r--src/core/compositor/native_skia_output_device_vulkan.h28
-rw-r--r--src/core/compositor/stream_video_node.cpp169
-rw-r--r--src/core/compositor/stream_video_node.h88
-rw-r--r--src/core/compositor/vulkan_implementation_qt.cpp162
-rw-r--r--src/core/compositor/vulkan_implementation_qt.h46
-rw-r--r--src/core/compositor/yuv_video_node.cpp352
-rw-r--r--src/core/compositor/yuv_video_node.h117
-rw-r--r--src/core/config/common.pri50
-rw-r--r--src/core/config/linux.pri47
-rw-r--r--src/core/config/mac_osx.pri8
-rw-r--r--src/core/config/windows.pri8
-rw-r--r--src/core/configure.json313
-rw-r--r--src/core/configure/BUILD.root.gn.in779
-rw-r--r--src/core/content_browser_client_qt.cpp1165
-rw-r--r--src/core/content_browser_client_qt.h210
-rw-r--r--src/core/content_client_qt.cpp369
-rw-r--r--src/core/content_client_qt.h57
-rw-r--r--src/core/content_main_delegate_qt.cpp149
-rw-r--r--src/core/content_main_delegate_qt.h45
-rw-r--r--src/core/content_utility_client_qt.cpp65
-rw-r--r--src/core/content_utility_client_qt.h42
-rw-r--r--src/core/core.pro48
-rw-r--r--src/core/core_chromium.pri360
-rw-r--r--src/core/core_common.pri20
-rw-r--r--src/core/core_generator.pro7
-rw-r--r--src/core/core_gn_config.pri17
-rw-r--r--src/core/core_headers.pro6
-rw-r--r--src/core/core_module.pro163
-rw-r--r--src/core/core_project.pro28
-rw-r--r--src/core/custom_handlers/protocol_handler_registry_delegate_qt.cpp36
-rw-r--r--src/core/custom_handlers/protocol_handler_registry_delegate_qt.h35
-rw-r--r--src/core/custom_handlers/protocol_handler_registry_factory.cpp75
-rw-r--r--src/core/custom_handlers/protocol_handler_registry_factory.h57
-rw-r--r--src/core/custom_handlers/register_protocol_handler_request_controller.h26
-rw-r--r--src/core/custom_handlers/register_protocol_handler_request_controller_impl.cpp49
-rw-r--r--src/core/custom_handlers/register_protocol_handler_request_controller_impl.h38
-rw-r--r--src/core/delegated_frame_host_client_qt.cpp52
-rw-r--r--src/core/delegated_frame_host_client_qt.h46
-rw-r--r--src/core/desktop_media_controller.cpp244
-rw-r--r--src/core/desktop_media_controller.h65
-rw-r--r--src/core/desktop_media_controller_p.h28
-rw-r--r--src/core/desktop_screen_qt.cpp195
-rw-r--r--src/core/desktop_screen_qt.h72
-rw-r--r--src/core/devtools_frontend_qt.cpp542
-rw-r--r--src/core/devtools_frontend_qt.h138
-rw-r--r--src/core/devtools_manager_delegate_qt.cpp61
-rw-r--r--src/core/devtools_manager_delegate_qt.h40
-rw-r--r--src/core/doc/QtWebEngineDoc3
-rw-r--r--src/core/doc/about_credits.tmpl (renamed from tools/about_credits.tmpl)0
-rw-r--r--src/core/doc/about_credits_entry.tmpl13
-rw-r--r--src/core/doc/qtwebengine.qdocconf96
-rw-r--r--src/core/doc/snippets/qtwebengine_qwebenginepage_snippet.cpp14
-rw-r--r--src/core/doc/snippets/qtwebenginecore_build_snippet.qdoc36
-rw-r--r--src/core/doc/src/external-resources.qdoc138
-rw-r--r--src/core/doc/src/qt6-changes.qdoc131
-rw-r--r--src/core/doc/src/qt_webengine_add_convert_dictionary.qdoc54
-rw-r--r--src/core/doc/src/qtwebengine-debugging.qdoc112
-rw-r--r--src/core/doc/src/qtwebengine-deploying.qdoc199
-rw-r--r--src/core/doc/src/qtwebengine-features.qdoc777
-rw-r--r--src/core/doc/src/qtwebengine-global.qdoc56
-rw-r--r--src/core/doc/src/qtwebengine-index.qdoc47
-rw-r--r--src/core/doc/src/qtwebengine-modules.qdoc25
-rw-r--r--src/core/doc/src/qtwebengine-overview.qdoc307
-rw-r--r--src/core/doc/src/qtwebengine-platform-notes.qdoc223
-rw-r--r--src/core/doc/src/qtwebenginecore-index.qdoc43
-rw-r--r--src/core/doc/src/qtwebenginecore-module.qdoc49
-rw-r--r--src/core/doc/src/qwebengine-licensing.qdoc34
-rw-r--r--src/core/doc/src/qwebenginehistory_lgpl.qdoc272
-rw-r--r--src/core/doc/src/qwebenginepage_lgpl.qdoc838
-rw-r--r--src/core/doc/src/qwebenginesettings_lgpl.qdoc332
-rw-r--r--src/core/download_manager_delegate_qt.cpp202
-rw-r--r--src/core/download_manager_delegate_qt.h61
-rw-r--r--src/core/extensions/component_extension_resource_manager_qt.cpp83
-rw-r--r--src/core/extensions/component_extension_resource_manager_qt.h48
-rw-r--r--src/core/extensions/extension_host_delegate_qt.cpp116
-rw-r--r--src/core/extensions/extension_host_delegate_qt.h39
-rw-r--r--src/core/extensions/extension_system_factory_qt.cpp41
-rw-r--r--src/core/extensions/extension_system_factory_qt.h43
-rw-r--r--src/core/extensions/extension_system_qt.cpp240
-rw-r--r--src/core/extensions/extension_system_qt.h89
-rw-r--r--src/core/extensions/extension_web_contents_observer_qt.cpp54
-rw-r--r--src/core/extensions/extension_web_contents_observer_qt.h41
-rw-r--r--src/core/extensions/extensions_api_client_qt.cpp73
-rw-r--r--src/core/extensions/extensions_api_client_qt.h51
-rw-r--r--src/core/extensions/extensions_browser_client_qt.cpp258
-rw-r--r--src/core/extensions/extensions_browser_client_qt.h72
-rw-r--r--src/core/extensions/file_system_delegate_qt.cpp146
-rw-r--r--src/core/extensions/file_system_delegate_qt.h89
-rw-r--r--src/core/extensions/messaging_delegate_qt.cpp20
-rw-r--r--src/core/extensions/messaging_delegate_qt.h30
-rw-r--r--src/core/extensions/mime_handler_view_guest_delegate_qt.cpp76
-rw-r--r--src/core/extensions/mime_handler_view_guest_delegate_qt.h51
-rw-r--r--src/core/extensions/pdf_iframe_navigation_throttle_qt.cpp194
-rw-r--r--src/core/extensions/pdf_iframe_navigation_throttle_qt.h46
-rw-r--r--src/core/extensions/pdf_web_contents_helper_client_qt.h30
-rw-r--r--src/core/extensions/plugin_service_filter_qt.cpp64
-rw-r--r--src/core/extensions/plugin_service_filter_qt.h33
-rw-r--r--src/core/favicon_driver_qt.cpp422
-rw-r--r--src/core/favicon_driver_qt.h151
-rw-r--r--src/core/favicon_manager.cpp418
-rw-r--r--src/core/favicon_manager.h151
-rw-r--r--src/core/favicon_service_factory_qt.cpp163
-rw-r--r--src/core/favicon_service_factory_qt.h111
-rw-r--r--src/core/file_picker_controller.cpp173
-rw-r--r--src/core/file_picker_controller.h66
-rw-r--r--src/core/file_system_access/file_system_access_permission_context_factory_qt.cpp61
-rw-r--r--src/core/file_system_access/file_system_access_permission_context_factory_qt.h37
-rw-r--r--src/core/file_system_access/file_system_access_permission_context_qt.cpp479
-rw-r--r--src/core/file_system_access/file_system_access_permission_context_qt.h86
-rw-r--r--src/core/file_system_access/file_system_access_permission_grant_qt.cpp146
-rw-r--r--src/core/file_system_access/file_system_access_permission_grant_qt.h59
-rw-r--r--src/core/file_system_access/file_system_access_permission_request_controller.h39
-rw-r--r--src/core/file_system_access/file_system_access_permission_request_controller_impl.cpp48
-rw-r--r--src/core/file_system_access/file_system_access_permission_request_controller_impl.h32
-rw-r--r--src/core/file_system_access/file_system_access_permission_request_manager_qt.cpp195
-rw-r--r--src/core/file_system_access/file_system_access_permission_request_manager_qt.h79
-rw-r--r--src/core/find_text_helper.cpp71
-rw-r--r--src/core/find_text_helper.h57
-rw-r--r--src/core/global_descriptors_qt.h40
-rw-r--r--src/core/gn_run.pro72
-rw-r--r--src/core/javascript_dialog_controller.cpp42
-rw-r--r--src/core/javascript_dialog_controller.h42
-rw-r--r--src/core/javascript_dialog_controller_p.h45
-rw-r--r--src/core/javascript_dialog_manager_qt.cpp48
-rw-r--r--src/core/javascript_dialog_manager_qt.h45
-rw-r--r--src/core/location_provider_qt.cpp151
-rw-r--r--src/core/location_provider_qt.h55
-rw-r--r--src/core/locked_ptr.h301
-rw-r--r--src/core/login_delegate_qt.cpp60
-rw-r--r--src/core/login_delegate_qt.h40
-rw-r--r--src/core/media_capture_devices_dispatcher.cpp439
-rw-r--r--src/core/media_capture_devices_dispatcher.h88
-rw-r--r--src/core/native_web_keyboard_event_qt.cpp112
-rw-r--r--src/core/native_web_keyboard_event_qt.h20
-rw-r--r--src/core/native_web_keyboard_event_qt_mac.mm155
-rw-r--r--src/core/net/client_cert_override.cpp176
-rw-r--r--src/core/net/client_cert_override.h73
-rw-r--r--src/core/net/client_cert_qt.cpp148
-rw-r--r--src/core/net/client_cert_qt.h37
-rw-r--r--src/core/net/client_cert_store_data.cpp60
-rw-r--r--src/core/net/client_cert_store_data.h48
-rw-r--r--src/core/net/cookie_monster_delegate_qt.cpp144
-rw-r--r--src/core/net/cookie_monster_delegate_qt.h75
-rw-r--r--src/core/net/custom_url_loader_factory.cpp244
-rw-r--r--src/core/net/custom_url_loader_factory.h44
-rw-r--r--src/core/net/plugin_response_interceptor_url_loader_throttle.cpp248
-rw-r--r--src/core/net/plugin_response_interceptor_url_loader_throttle.h61
-rw-r--r--src/core/net/proxy_config_monitor.cpp52
-rw-r--r--src/core/net/proxy_config_monitor.h50
-rw-r--r--src/core/net/proxy_config_service_qt.cpp57
-rw-r--r--src/core/net/proxy_config_service_qt.h48
-rw-r--r--src/core/net/proxying_restricted_cookie_manager_qt.cpp151
-rw-r--r--src/core/net/proxying_restricted_cookie_manager_qt.h79
-rw-r--r--src/core/net/proxying_url_loader_factory_qt.cpp454
-rw-r--r--src/core/net/proxying_url_loader_factory_qt.h68
-rw-r--r--src/core/net/qrc_url_scheme_handler.cpp49
-rw-r--r--src/core/net/qrc_url_scheme_handler.h40
-rw-r--r--src/core/net/resource_request_body_qt.cpp181
-rw-r--r--src/core/net/resource_request_body_qt.h70
-rw-r--r--src/core/net/ssl_host_state_delegate_qt.cpp81
-rw-r--r--src/core/net/ssl_host_state_delegate_qt.h55
-rw-r--r--src/core/net/system_network_context_manager.cpp295
-rw-r--r--src/core/net/system_network_context_manager.h89
-rw-r--r--src/core/net/url_request_custom_job_delegate.cpp77
-rw-r--r--src/core/net/url_request_custom_job_delegate.h61
-rw-r--r--src/core/net/url_request_custom_job_proxy.cpp82
-rw-r--r--src/core/net/url_request_custom_job_proxy.h63
-rw-r--r--src/core/net/version_ui_qt.cpp56
-rw-r--r--src/core/net/version_ui_qt.h32
-rw-r--r--src/core/net/webui_controller_factory_qt.cpp110
-rw-r--r--src/core/net/webui_controller_factory_qt.h52
-rw-r--r--src/core/ozone/BUILD.gn17
-rw-r--r--src/core/ozone/gl_context_qt.cpp319
-rw-r--r--src/core/ozone/gl_context_qt.h89
-rw-r--r--src/core/ozone/gl_ozone_egl_qt.cpp163
-rw-r--r--src/core/ozone/gl_ozone_egl_qt.h63
-rw-r--r--src/core/ozone/gl_ozone_glx_qt.cpp83
-rw-r--r--src/core/ozone/gl_ozone_glx_qt.h67
-rw-r--r--src/core/ozone/gl_share_context_qt.cpp77
-rw-r--r--src/core/ozone/gl_share_context_qt.h63
-rw-r--r--src/core/ozone/gl_surface_egl_qt.cpp212
-rw-r--r--src/core/ozone/gl_surface_egl_qt.h58
-rw-r--r--src/core/ozone/gl_surface_glx_qt.cpp137
-rw-r--r--src/core/ozone/gl_surface_glx_qt.h49
-rw-r--r--src/core/ozone/gl_surface_qt.cpp188
-rw-r--r--src/core/ozone/gl_surface_qt.h59
-rw-r--r--src/core/ozone/gl_surface_wgl_qt.cpp56
-rw-r--r--src/core/ozone/gl_surface_wgl_qt.h49
-rw-r--r--src/core/ozone/ozone_extra.gni14
-rw-r--r--src/core/ozone/ozone_platform_qt.cpp223
-rw-r--r--src/core/ozone/ozone_platform_qt.h48
-rw-r--r--src/core/ozone/platform_window_qt.cpp70
-rw-r--r--src/core/ozone/platform_window_qt.h63
-rw-r--r--src/core/ozone/surface_factory_qt.cpp293
-rw-r--r--src/core/ozone/surface_factory_qt.h72
-rw-r--r--src/core/pdf_util_qt.cpp92
-rw-r--r--src/core/pdf_util_qt.h34
-rw-r--r--src/core/permission_manager_qt.cpp273
-rw-r--r--src/core/permission_manager_qt.h97
-rw-r--r--src/core/platform_notification_service_qt.cpp45
-rw-r--r--src/core/platform_notification_service_qt.h41
-rw-r--r--src/core/pointer_device_qt.cpp102
-rw-r--r--src/core/pref_service_adapter.cpp116
-rw-r--r--src/core/pref_service_adapter.h47
-rw-r--r--src/core/printing/pdf_document_helper_client_qt.cpp33
-rw-r--r--src/core/printing/pdf_document_helper_client_qt.h27
-rw-r--r--src/core/printing/pdf_stream_delegate_qt.cpp99
-rw-r--r--src/core/printing/pdf_stream_delegate_qt.h23
-rw-r--r--src/core/printing/pdfium_document_wrapper_qt.cpp40
-rw-r--r--src/core/printing/pdfium_document_wrapper_qt.h42
-rw-r--r--src/core/printing/print_view_manager_base_qt.cpp464
-rw-r--r--src/core/printing/print_view_manager_base_qt.h178
-rw-r--r--src/core/printing/print_view_manager_qt.cpp415
-rw-r--r--src/core/printing/print_view_manager_qt.h121
-rw-r--r--src/core/printing/printer_worker.cpp87
-rw-r--r--src/core/printing/printer_worker.h58
-rw-r--r--src/core/printing/printing_message_filter_qt.cpp234
-rw-r--r--src/core/printing/printing_message_filter_qt.h126
-rw-r--r--src/core/process_main.cpp67
-rw-r--r--src/core/process_main.h57
-rw-r--r--src/core/profile_adapter.cpp449
-rw-r--r--src/core/profile_adapter.h105
-rw-r--r--src/core/profile_adapter_client.cpp40
-rw-r--r--src/core/profile_adapter_client.h58
-rw-r--r--src/core/profile_io_data_qt.cpp174
-rw-r--r--src/core/profile_io_data_qt.h93
-rw-r--r--src/core/profile_qt.cpp167
-rw-r--r--src/core/profile_qt.h84
-rw-r--r--src/core/qtwebengine.gni75
-rw-r--r--src/core/qtwebengine_resources.gni140
-rw-r--r--src/core/qtwebengine_sources.gni194
-rw-r--r--src/core/quota_permission_context_qt.cpp110
-rw-r--r--src/core/quota_permission_context_qt.h61
-rw-r--r--src/core/quota_request_controller.h62
-rw-r--r--src/core/quota_request_controller_impl.cpp72
-rw-r--r--src/core/quota_request_controller_impl.h68
-rw-r--r--src/core/register_protocol_handler_request_controller.h62
-rw-r--r--src/core/register_protocol_handler_request_controller_impl.cpp83
-rw-r--r--src/core/register_protocol_handler_request_controller_impl.h73
-rw-r--r--src/core/render_view_context_menu_qt.cpp87
-rw-r--r--src/core/render_view_context_menu_qt.h48
-rw-r--r--src/core/render_widget_host_view_qt.cpp1845
-rw-r--r--src/core/render_widget_host_view_qt.h324
-rw-r--r--src/core/render_widget_host_view_qt_delegate.h85
-rw-r--r--src/core/render_widget_host_view_qt_delegate_client.cpp963
-rw-r--r--src/core/render_widget_host_view_qt_delegate_client.h132
-rw-r--r--src/core/render_widget_host_view_qt_delegate_item.cpp455
-rw-r--r--src/core/render_widget_host_view_qt_delegate_item.h125
-rw-r--r--src/core/renderer/content_renderer_client_qt.cpp687
-rw-r--r--src/core/renderer/content_renderer_client_qt.h116
-rw-r--r--src/core/renderer/content_settings_observer_qt.cpp111
-rw-r--r--src/core/renderer/content_settings_observer_qt.h61
-rw-r--r--src/core/renderer/extensions/extensions_dispatcher_delegate_qt.cpp49
-rw-r--r--src/core/renderer/extensions/extensions_dispatcher_delegate_qt.h44
-rw-r--r--src/core/renderer/extensions/extensions_renderer_client_qt.cpp81
-rw-r--r--src/core/renderer/extensions/extensions_renderer_client_qt.h62
-rw-r--r--src/core/renderer/extensions/renderer_permissions_policy_delegate_qt.cpp40
-rw-r--r--src/core/renderer/extensions/renderer_permissions_policy_delegate_qt.h44
-rw-r--r--src/core/renderer/extensions/resource_request_policy_qt.cpp58
-rw-r--r--src/core/renderer/extensions/resource_request_policy_qt.h48
-rw-r--r--src/core/renderer/pepper/pepper_flash_renderer_host_qt.cpp432
-rw-r--r--src/core/renderer/pepper/pepper_flash_renderer_host_qt.h107
-rw-r--r--src/core/renderer/pepper/pepper_renderer_host_factory_qt.cpp97
-rw-r--r--src/core/renderer/pepper/pepper_renderer_host_factory_qt.h42
-rw-r--r--src/core/renderer/plugins/loadable_plugin_placeholder_qt.cpp55
-rw-r--r--src/core/renderer/plugins/loadable_plugin_placeholder_qt.h49
-rw-r--r--src/core/renderer/plugins/plugin_placeholder_qt.cpp75
-rw-r--r--src/core/renderer/plugins/plugin_placeholder_qt.h78
-rw-r--r--src/core/renderer/print_web_view_helper_delegate_qt.cpp72
-rw-r--r--src/core/renderer/print_web_view_helper_delegate_qt.h51
-rw-r--r--src/core/renderer/render_configuration.cpp41
-rw-r--r--src/core/renderer/render_configuration.h42
-rw-r--r--src/core/renderer/render_frame_observer_qt.cpp56
-rw-r--r--src/core/renderer/render_frame_observer_qt.h54
-rw-r--r--src/core/renderer/render_thread_observer_qt.cpp75
-rw-r--r--src/core/renderer/render_thread_observer_qt.h80
-rw-r--r--src/core/renderer/render_view_observer_qt.cpp94
-rw-r--r--src/core/renderer/render_view_observer_qt.h63
-rw-r--r--src/core/renderer/user_resource_controller.cpp325
-rw-r--r--src/core/renderer/user_resource_controller.h92
-rw-r--r--src/core/renderer/web_channel_ipc_transport.cpp162
-rw-r--r--src/core/renderer/web_channel_ipc_transport.h50
-rw-r--r--src/core/renderer/web_engine_page_render_frame.cpp66
-rw-r--r--src/core/renderer/web_engine_page_render_frame.h41
-rw-r--r--src/core/renderer_host/pepper/pepper_flash_browser_host_qt.cpp137
-rw-r--r--src/core/renderer_host/pepper/pepper_flash_browser_host_qt.h93
-rw-r--r--src/core/renderer_host/pepper/pepper_host_factory_qt.cpp113
-rw-r--r--src/core/renderer_host/pepper/pepper_host_factory_qt.h73
-rw-r--r--src/core/renderer_host/pepper/pepper_isolated_file_system_message_filter.cpp135
-rw-r--r--src/core/renderer_host/pepper/pepper_isolated_file_system_message_filter.h89
-rw-r--r--src/core/renderer_host/render_view_observer_host_qt.cpp95
-rw-r--r--src/core/renderer_host/render_view_observer_host_qt.h72
-rw-r--r--src/core/renderer_host/user_resource_controller_host.cpp125
-rw-r--r--src/core/renderer_host/user_resource_controller_host.h66
-rw-r--r--src/core/renderer_host/web_channel_ipc_transport_host.cpp118
-rw-r--r--src/core/renderer_host/web_channel_ipc_transport_host.h59
-rw-r--r--src/core/renderer_host/web_engine_page_host.cpp76
-rw-r--r--src/core/renderer_host/web_engine_page_host.h54
-rw-r--r--src/core/request_controller.h40
-rw-r--r--src/core/resource_bundle_qt.cpp76
-rw-r--r--src/core/resource_context_qt.cpp49
-rw-r--r--src/core/resource_context_qt.h76
-rw-r--r--src/core/sandbox_win.cpp46
-rw-r--r--src/core/select_file_dialog_factory_qt.cpp149
-rw-r--r--src/core/select_file_dialog_factory_qt.h46
-rw-r--r--src/core/tools/qwebengine_convert_dict/CMakeLists.txt37
-rw-r--r--src/core/tools/qwebengine_convert_dict/main.cpp254
-rw-r--r--src/core/tools/webenginedriver/CMakeLists.txt57
-rw-r--r--src/core/touch_handle_drawable_client.h46
-rw-r--r--src/core/touch_handle_drawable_qt.cpp123
-rw-r--r--src/core/touch_handle_drawable_qt.h51
-rw-r--r--src/core/touch_selection_controller_client_qt.cpp84
-rw-r--r--src/core/touch_selection_controller_client_qt.h52
-rw-r--r--src/core/touch_selection_menu_controller.cpp69
-rw-r--r--src/core/touch_selection_menu_controller.h57
-rw-r--r--src/core/type_conversion.cpp158
-rw-r--r--src/core/type_conversion.h165
-rw-r--r--src/core/user_notification_controller.cpp42
-rw-r--r--src/core/user_notification_controller.h48
-rw-r--r--src/core/user_script.cpp170
-rw-r--r--src/core/user_script.h63
-rw-r--r--src/core/visited_links_manager_qt.cpp64
-rw-r--r--src/core/visited_links_manager_qt.h46
-rw-r--r--src/core/web_contents_adapter.cpp663
-rw-r--r--src/core/web_contents_adapter.h89
-rw-r--r--src/core/web_contents_adapter_client.h367
-rw-r--r--src/core/web_contents_delegate_qt.cpp548
-rw-r--r--src/core/web_contents_delegate_qt.h149
-rw-r--r--src/core/web_contents_view_qt.cpp259
-rw-r--r--src/core/web_contents_view_qt.h87
-rw-r--r--src/core/web_engine_context.cpp965
-rw-r--r--src/core/web_engine_context.h76
-rw-r--r--src/core/web_engine_context_threads.cpp138
-rw-r--r--src/core/web_engine_error.cpp65
-rw-r--r--src/core/web_engine_error.h49
-rw-r--r--src/core/web_engine_library_info.cpp319
-rw-r--r--src/core/web_engine_library_info.h55
-rw-r--r--src/core/web_engine_settings.cpp400
-rw-r--r--src/core/web_engine_settings.h172
-rw-r--r--src/core/web_event_factory.cpp260
-rw-r--r--src/core/web_event_factory.h62
-rw-r--r--src/core/web_usb_detector_qt.cpp45
-rw-r--r--src/core/web_usb_detector_qt.h34
-rw-r--r--src/gn/CMakeLists.txt80
-rw-r--r--src/host/BUILD.toolchain.gn.in18
-rw-r--r--src/host/CMakeLists.txt68
-rw-r--r--src/host/config.tests/hostcompiler/CMakeLists.txt11
-rw-r--r--src/host/config.tests/hostcompiler/main.cpp9
-rw-r--r--src/ninja/CMakeLists.txt40
-rw-r--r--src/pdf/CMakeLists.txt260
-rw-r--r--src/pdf/api/qpdfbookmarkmodel.h98
-rw-r--r--src/pdf/api/qpdfdestination.h85
-rw-r--r--src/pdf/api/qpdfdestination_p.h71
-rw-r--r--src/pdf/api/qpdfdocument.h140
-rw-r--r--src/pdf/api/qpdfdocument_p.h122
-rw-r--r--src/pdf/api/qpdfdocumentrenderoptions.h94
-rw-r--r--src/pdf/api/qpdflinkmodel_p.h106
-rw-r--r--src/pdf/api/qpdflinkmodel_p_p.h91
-rw-r--r--src/pdf/api/qpdfnamespace.h73
-rw-r--r--src/pdf/api/qpdfpagenavigation.h92
-rw-r--r--src/pdf/api/qpdfpagerenderer.h92
-rw-r--r--src/pdf/api/qpdfsearchmodel.h98
-rw-r--r--src/pdf/api/qpdfsearchmodel_p.h86
-rw-r--r--src/pdf/api/qpdfsearchresult.h76
-rw-r--r--src/pdf/api/qpdfsearchresult_p.h72
-rw-r--r--src/pdf/api/qpdfselection.h91
-rw-r--r--src/pdf/api/qpdfselection_p.h65
-rw-r--r--src/pdf/api/qtpdfglobal.h61
-rw-r--r--src/pdf/config/common.pri38
-rw-r--r--src/pdf/config/ios.pri66
-rw-r--r--src/pdf/configure.cmake54
-rw-r--r--src/pdf/configure.json64
-rw-r--r--src/pdf/configure/BUILD.root.gn.in73
-rw-r--r--src/pdf/doc/about_credits.tmpl1
-rw-r--r--src/pdf/doc/about_credits_entry.tmpl13
-rw-r--r--src/pdf/doc/images/multipageviewer.pngbin0 -> 39637 bytes
-rw-r--r--src/pdf/doc/images/pdfviewer.pngbin0 -> 264348 bytes
-rw-r--r--src/pdf/doc/images/search-results.pngbin0 -> 19718 bytes
-rw-r--r--src/pdf/doc/images/singlepageviewer.webpbin0 -> 57680 bytes
-rw-r--r--src/pdf/doc/images/wrapping-search-result.pngbin0 -> 39106 bytes
-rw-r--r--src/pdf/doc/qtpdf.qdocconf29
-rw-r--r--src/pdf/doc/snippets/multipageview.qml11
-rw-r--r--src/pdf/doc/snippets/qtpdf-build.cmake4
-rw-r--r--src/pdf/doc/snippets/qtpdf_build_snippet.qdoc33
-rw-r--r--src/pdf/doc/src/qtpdf-examples.qdoc29
-rw-r--r--src/pdf/doc/src/qtpdf-index.qdoc82
-rw-r--r--src/pdf/doc/src/qtpdf-licensing.qdoc18
-rw-r--r--src/pdf/doc/src/qtpdf-module.qdoc33
-rw-r--r--src/pdf/doc/src/qtpdf-platformnotes.qdoc11
-rw-r--r--src/pdf/gn_run.pro69
-rw-r--r--src/pdf/jsbridge.cpp38
-rw-r--r--src/pdf/pdf.pro29
-rw-r--r--src/pdf/pdfcore.pro93
-rw-r--r--src/pdf/pdfcore_generator.pro15
-rw-r--r--src/pdf/plugins/imageformats/pdf/CMakeLists.txt13
-rw-r--r--src/pdf/plugins/imageformats/pdf/main.cpp41
-rw-r--r--src/pdf/plugins/imageformats/pdf/pdf.json (renamed from src/plugins/imageformats/pdf/pdf.json)0
-rw-r--r--src/pdf/plugins/imageformats/pdf/qpdfiohandler.cpp225
-rw-r--r--src/pdf/plugins/imageformats/pdf/qpdfiohandler_p.h57
-rw-r--r--src/pdf/qpdfbookmarkmodel.cpp233
-rw-r--r--src/pdf/qpdfbookmarkmodel.h60
-rw-r--r--src/pdf/qpdfdestination.cpp145
-rw-r--r--src/pdf/qpdfdocument.cpp567
-rw-r--r--src/pdf/qpdfdocument.h127
-rw-r--r--src/pdf/qpdfdocument_p.h123
-rw-r--r--src/pdf/qpdfdocumentrenderoptions.h81
-rw-r--r--src/pdf/qpdfdocumentrenderoptions.qdoc86
-rw-r--r--src/pdf/qpdffile.cpp28
-rw-r--r--src/pdf/qpdffile_p.h37
-rw-r--r--src/pdf/qpdflink.cpp189
-rw-r--r--src/pdf/qpdflink.h78
-rw-r--r--src/pdf/qpdflink_p.h53
-rw-r--r--src/pdf/qpdflinkmodel.cpp213
-rw-r--r--src/pdf/qpdflinkmodel.h67
-rw-r--r--src/pdf/qpdflinkmodel_p.h42
-rw-r--r--src/pdf/qpdfnamespace.qdoc74
-rw-r--r--src/pdf/qpdfpagenavigation.cpp314
-rw-r--r--src/pdf/qpdfpagenavigator.cpp362
-rw-r--r--src/pdf/qpdfpagenavigator.h62
-rw-r--r--src/pdf/qpdfpagerenderer.cpp127
-rw-r--r--src/pdf/qpdfpagerenderer.h60
-rw-r--r--src/pdf/qpdfsearchmodel.cpp189
-rw-r--r--src/pdf/qpdfsearchmodel.h70
-rw-r--r--src/pdf/qpdfsearchmodel_p.h54
-rw-r--r--src/pdf/qpdfsearchresult.cpp80
-rw-r--r--src/pdf/qpdfselection.cpp73
-rw-r--r--src/pdf/qpdfselection.h62
-rw-r--r--src/pdf/qpdfselection_p.h45
-rw-r--r--src/pdf/qtpdf.gni7
-rw-r--r--src/pdf/qtpdfglobal.h11
-rw-r--r--src/pdf/quick/plugin.cpp103
-rw-r--r--src/pdf/quick/plugins.qmltypes52
-rw-r--r--src/pdf/quick/qml/+material/PdfStyle.qml54
-rw-r--r--src/pdf/quick/qml/+universal/PdfStyle.qml55
-rw-r--r--src/pdf/quick/qml/PdfMultiPageView.qml434
-rw-r--r--src/pdf/quick/qml/PdfPageView.qml276
-rw-r--r--src/pdf/quick/qml/PdfScrollablePageView.qml307
-rw-r--r--src/pdf/quick/qml/PdfStyle.qml54
-rw-r--r--src/pdf/quick/qmldir4
-rw-r--r--src/pdf/quick/qquickpdfdocument.cpp305
-rw-r--r--src/pdf/quick/qquickpdfdocument_p.h137
-rw-r--r--src/pdf/quick/qquickpdflinkmodel.cpp131
-rw-r--r--src/pdf/quick/qquickpdflinkmodel_p.h87
-rw-r--r--src/pdf/quick/qquickpdfnavigationstack.cpp272
-rw-r--r--src/pdf/quick/qquickpdfnavigationstack_p.h102
-rw-r--r--src/pdf/quick/qquickpdfsearchmodel.cpp301
-rw-r--r--src/pdf/quick/qquickpdfsearchmodel_p.h113
-rw-r--r--src/pdf/quick/qquickpdfselection.cpp541
-rw-r--r--src/pdf/quick/qquickpdfselection_p.h148
-rw-r--r--src/pdf/quick/qquicktableviewextra.cpp194
-rw-r--r--src/pdf/quick/qquicktableviewextra_p.h93
-rw-r--r--src/pdf/quick/quick.pro40
-rw-r--r--src/pdf/quick/resources.qrc10
-rw-r--r--src/pdfquick/+Material/PdfStyle.qml15
-rw-r--r--src/pdfquick/+Universal/PdfStyle.qml15
-rw-r--r--src/pdfquick/CMakeLists.txt41
-rw-r--r--src/pdfquick/PdfLinkDelegate.qml74
-rw-r--r--src/pdfquick/PdfMultiPageView.qml623
-rw-r--r--src/pdfquick/PdfPageView.qml439
-rw-r--r--src/pdfquick/PdfScrollablePageView.qml487
-rw-r--r--src/pdfquick/PdfStyle.qml71
-rw-r--r--src/pdfquick/doc/src/qtquickpdf-module.qdoc18
-rw-r--r--src/pdfquick/qquickpdfbookmarkmodel.cpp55
-rw-r--r--src/pdfquick/qquickpdfbookmarkmodel_p.h53
-rw-r--r--src/pdfquick/qquickpdfdocument.cpp271
-rw-r--r--src/pdfquick/qquickpdfdocument_p.h105
-rw-r--r--src/pdfquick/qquickpdflinkmodel.cpp109
-rw-r--r--src/pdfquick/qquickpdflinkmodel_p.h49
-rw-r--r--src/pdfquick/qquickpdfpageimage.cpp141
-rw-r--r--src/pdfquick/qquickpdfpageimage_p.h52
-rw-r--r--src/pdfquick/qquickpdfpagenavigator.cpp130
-rw-r--r--src/pdfquick/qquickpdfpagenavigator_p.h55
-rw-r--r--src/pdfquick/qquickpdfsearchmodel.cpp282
-rw-r--r--src/pdfquick/qquickpdfsearchmodel_p.h85
-rw-r--r--src/pdfquick/qquickpdfselection.cpp546
-rw-r--r--src/pdfquick/qquickpdfselection_p.h119
-rw-r--r--src/pdfquick/qtpdfquickglobal_p.h34
-rw-r--r--src/pdfwidgets/CMakeLists.txt19
-rw-r--r--src/pdfwidgets/configure.json28
-rw-r--r--src/pdfwidgets/pdfwidgets.pro12
-rw-r--r--src/pdfwidgets/qpdfpageselector.cpp171
-rw-r--r--src/pdfwidgets/qpdfpageselector.h51
-rw-r--r--src/pdfwidgets/qpdfpageselector_p.h60
-rw-r--r--src/pdfwidgets/qpdfview.cpp412
-rw-r--r--src/pdfwidgets/qpdfview.h77
-rw-r--r--src/pdfwidgets/qpdfview_p.h60
-rw-r--r--src/pdfwidgets/qtpdfwidgetsglobal.h37
-rw-r--r--src/plugins/imageformats/imageformats.pro2
-rw-r--r--src/plugins/imageformats/pdf/main.cpp74
-rw-r--r--src/plugins/imageformats/pdf/pdf.pro11
-rw-r--r--src/plugins/imageformats/pdf/qpdfiohandler.cpp239
-rw-r--r--src/plugins/imageformats/pdf/qpdfiohandler_p.h88
-rw-r--r--src/plugins/plugins.pro3
-rw-r--r--src/plugins/qwebengineview/qwebengineview.pro11
-rw-r--r--src/plugins/qwebengineview/qwebengineview_plugin.cpp137
-rw-r--r--src/plugins/qwebengineview/qwebengineview_plugin.h107
-rw-r--r--src/plugins/qwebengineview/qwebengineview_plugin.qrc5
-rw-r--r--src/process/CMakeLists.txt105
-rw-r--r--src/process/Info_mac.plist22
-rw-r--r--src/process/Info_mac.plist.in44
-rw-r--r--src/process/QtWebEngineProcess.entitlements2
-rw-r--r--src/process/QtWebEngineProcess.exe.manifest (renamed from src/process/process.exe.manifest)0
-rw-r--r--src/process/main.cpp64
-rw-r--r--src/process/process.pro75
-rw-r--r--src/process/support_win.cpp83
-rw-r--r--src/src.pro64
-rw-r--r--src/tools/qwebengine_convert_dict/main.cpp248
-rw-r--r--src/tools/qwebengine_convert_dict/qwebengine_convert_dict.pro55
-rw-r--r--src/webengine/api/qquickwebengineaction.cpp173
-rw-r--r--src/webengine/api/qquickwebengineaction_p.h107
-rw-r--r--src/webengine/api/qquickwebengineaction_p_p.h86
-rw-r--r--src/webengine/api/qquickwebenginecertificateerror.cpp251
-rw-r--r--src/webengine/api/qquickwebenginecertificateerror_p.h115
-rw-r--r--src/webengine/api/qquickwebengineclientcertificateselection.cpp226
-rw-r--r--src/webengine/api/qquickwebengineclientcertificateselection_p.h131
-rw-r--r--src/webengine/api/qquickwebenginecontextmenurequest.cpp383
-rw-r--r--src/webengine/api/qquickwebenginecontextmenurequest_p.h150
-rw-r--r--src/webengine/api/qquickwebenginedialogrequests.cpp936
-rw-r--r--src/webengine/api/qquickwebenginedialogrequests_p.h298
-rw-r--r--src/webengine/api/qquickwebenginedownloaditem.cpp789
-rw-r--r--src/webengine/api/qquickwebenginedownloaditem_p.h199
-rw-r--r--src/webengine/api/qquickwebenginedownloaditem_p_p.h99
-rw-r--r--src/webengine/api/qquickwebenginefaviconprovider.cpp191
-rw-r--r--src/webengine/api/qquickwebenginefaviconprovider_p_p.h87
-rw-r--r--src/webengine/api/qquickwebenginehistory.cpp356
-rw-r--r--src/webengine/api/qquickwebenginehistory_p.h125
-rw-r--r--src/webengine/api/qquickwebenginehistory_p_p.h107
-rw-r--r--src/webengine/api/qquickwebengineloadrequest.cpp159
-rw-r--r--src/webengine/api/qquickwebengineloadrequest_p.h87
-rw-r--r--src/webengine/api/qquickwebenginenavigationrequest.cpp171
-rw-r--r--src/webengine/api/qquickwebenginenavigationrequest_p.h93
-rw-r--r--src/webengine/api/qquickwebenginenewviewrequest.cpp121
-rw-r--r--src/webengine/api/qquickwebenginenewviewrequest_p.h90
-rw-r--r--src/webengine/api/qquickwebengineprofile.cpp1106
-rw-r--r--src/webengine/api/qquickwebengineprofile.h197
-rw-r--r--src/webengine/api/qquickwebengineprofile_p.h109
-rw-r--r--src/webengine/api/qquickwebenginescript.cpp446
-rw-r--r--src/webengine/api/qquickwebenginescript.h114
-rw-r--r--src/webengine/api/qquickwebenginescript_p.h87
-rw-r--r--src/webengine/api/qquickwebenginesettings.cpp766
-rw-r--r--src/webengine/api/qquickwebenginesettings_p.h219
-rw-r--r--src/webengine/api/qquickwebenginesingleton.cpp93
-rw-r--r--src/webengine/api/qquickwebenginesingleton_p.h72
-rw-r--r--src/webengine/api/qquickwebenginetestsupport.cpp193
-rw-r--r--src/webengine/api/qquickwebenginetestsupport_p.h135
-rw-r--r--src/webengine/api/qquickwebenginetouchhandleprovider.cpp80
-rw-r--r--src/webengine/api/qquickwebenginetouchhandleprovider_p_p.h77
-rw-r--r--src/webengine/api/qquickwebengineview.cpp2496
-rw-r--r--src/webengine/api/qquickwebengineview_p.h616
-rw-r--r--src/webengine/api/qquickwebengineview_p_p.h286
-rw-r--r--src/webengine/api/qtwebengineglobal.cpp87
-rw-r--r--src/webengine/api/qtwebengineglobal.h65
-rw-r--r--src/webengine/api/qtwebengineglobal_p.h64
-rw-r--r--src/webengine/configure.json40
-rw-r--r--src/webengine/doc/QtWebEngineDoc2
-rw-r--r--src/webengine/doc/qtwebengine.qdocconf90
-rw-r--r--src/webengine/doc/snippets/qtwebengine_build_snippet.qdoc35
-rw-r--r--src/webengine/doc/snippets/qtwebengine_webengineview_newviewrequested.qml84
-rw-r--r--src/webengine/doc/src/external-resources.qdoc146
-rw-r--r--src/webengine/doc/src/qtwebengine-debugging.qdoc117
-rw-r--r--src/webengine/doc/src/qtwebengine-deploying.qdoc158
-rw-r--r--src/webengine/doc/src/qtwebengine-examples.qdoc40
-rw-r--r--src/webengine/doc/src/qtwebengine-features.qdoc644
-rw-r--r--src/webengine/doc/src/qtwebengine-index.qdoc65
-rw-r--r--src/webengine/doc/src/qtwebengine-module.qdoc46
-rw-r--r--src/webengine/doc/src/qtwebengine-modules.qdoc48
-rw-r--r--src/webengine/doc/src/qtwebengine-overview.qdoc315
-rw-r--r--src/webengine/doc/src/qtwebengine-platform-notes.qdoc237
-rw-r--r--src/webengine/doc/src/qtwebengine-qmlmodule.qdoc48
-rw-r--r--src/webengine/doc/src/qwebengine-licensing.qdoc53
-rw-r--r--src/webengine/doc/src/webengineview_lgpl.qdoc1640
-rw-r--r--src/webengine/module.pro94
-rw-r--r--src/webengine/plugin/dependencies.json7
-rw-r--r--src/webengine/plugin/plugin.cpp190
-rw-r--r--src/webengine/plugin/plugin.pro12
-rw-r--r--src/webengine/plugin/plugins.qmltypes1705
-rw-r--r--src/webengine/plugin/qmldir4
-rw-r--r--src/webengine/render_widget_host_view_qt_delegate_quick.cpp444
-rw-r--r--src/webengine/render_widget_host_view_qt_delegate_quick.h145
-rw-r--r--src/webengine/render_widget_host_view_qt_delegate_quickwindow.cpp171
-rw-r--r--src/webengine/render_widget_host_view_qt_delegate_quickwindow.h91
-rw-r--r--src/webengine/testsupport/plugin.cpp70
-rw-r--r--src/webengine/testsupport/plugins.qmltypes73
-rw-r--r--src/webengine/testsupport/qmldir4
-rw-r--r--src/webengine/testsupport/testsupport.pro11
-rw-r--r--src/webengine/ui/AlertDialog.qml44
-rw-r--r--src/webengine/ui/AuthenticationDialog.qml131
-rw-r--r--src/webengine/ui/ColorDialog.qml50
-rw-r--r--src/webengine/ui/ConfirmDialog.qml45
-rw-r--r--src/webengine/ui/FilePicker.qml49
-rw-r--r--src/webengine/ui/Menu.qml57
-rw-r--r--src/webengine/ui/MenuItem.qml44
-rw-r--r--src/webengine/ui/MenuSeparator.qml43
-rw-r--r--src/webengine/ui/PromptDialog.qml98
-rw-r--r--src/webengine/ui/ToolTip.qml93
-rw-r--r--src/webengine/ui/TouchHandle.qml42
-rw-r--r--src/webengine/ui/TouchSelectionMenu.qml175
-rw-r--r--src/webengine/ui/qmldir8
-rw-r--r--src/webengine/ui/ui.pro20
-rw-r--r--src/webengine/ui2/AlertDialog.qml98
-rw-r--r--src/webengine/ui2/AuthenticationDialog.qml135
-rw-r--r--src/webengine/ui2/ConfirmDialog.qml111
-rw-r--r--src/webengine/ui2/Menu.qml57
-rw-r--r--src/webengine/ui2/MenuItem.qml44
-rw-r--r--src/webengine/ui2/MenuSeparator.qml42
-rw-r--r--src/webengine/ui2/PromptDialog.qml114
-rw-r--r--src/webengine/ui2/ToolTip.qml45
-rw-r--r--src/webengine/ui2/qmldir2
-rw-r--r--src/webengine/ui2/ui2.pro18
-rw-r--r--src/webengine/ui_delegates_manager.cpp740
-rw-r--r--src/webengine/ui_delegates_manager.h152
-rw-r--r--src/webengine/webengine.pro19
-rw-r--r--src/webenginequick/CMakeLists.txt78
-rw-r--r--src/webenginequick/api/qquickwebengineaction.cpp146
-rw-r--r--src/webenginequick/api/qquickwebengineaction_p.h72
-rw-r--r--src/webenginequick/api/qquickwebengineaction_p_p.h50
-rw-r--r--src/webenginequick/api/qquickwebengineclientcertificateselection.cpp189
-rw-r--r--src/webenginequick/api/qquickwebengineclientcertificateselection_p.h104
-rw-r--r--src/webenginequick/api/qquickwebenginedialogrequests.cpp817
-rw-r--r--src/webenginequick/api/qquickwebenginedialogrequests_p.h248
-rw-r--r--src/webenginequick/api/qquickwebenginedownloadrequest.cpp32
-rw-r--r--src/webenginequick/api/qquickwebenginedownloadrequest_p.h46
-rw-r--r--src/webenginequick/api/qquickwebenginefaviconprovider.cpp257
-rw-r--r--src/webenginequick/api/qquickwebenginefaviconprovider_p_p.h92
-rw-r--r--src/webenginequick/api/qquickwebengineforeigntypes_p.h236
-rw-r--r--src/webenginequick/api/qquickwebenginenewwindowrequest.cpp43
-rw-r--r--src/webenginequick/api/qquickwebenginenewwindowrequest_p.h48
-rw-r--r--src/webenginequick/api/qquickwebengineprofile.cpp1049
-rw-r--r--src/webenginequick/api/qquickwebengineprofile.h156
-rw-r--r--src/webenginequick/api/qquickwebengineprofile_p.h72
-rw-r--r--src/webenginequick/api/qquickwebenginescriptcollection.cpp244
-rw-r--r--src/webenginequick/api/qquickwebenginescriptcollection_p.h63
-rw-r--r--src/webenginequick/api/qquickwebenginescriptcollection_p_p.h38
-rw-r--r--src/webenginequick/api/qquickwebenginesettings.cpp854
-rw-r--r--src/webenginequick/api/qquickwebenginesettings_p.h212
-rw-r--r--src/webenginequick/api/qquickwebenginesingleton.cpp87
-rw-r--r--src/webenginequick/api/qquickwebenginesingleton_p.h44
-rw-r--r--src/webenginequick/api/qquickwebenginetouchhandle.cpp45
-rw-r--r--src/webenginequick/api/qquickwebenginetouchhandle_p.h47
-rw-r--r--src/webenginequick/api/qquickwebenginetouchhandleprovider.cpp44
-rw-r--r--src/webenginequick/api/qquickwebenginetouchhandleprovider_p_p.h41
-rw-r--r--src/webenginequick/api/qquickwebenginetouchselectionmenurequest.cpp108
-rw-r--r--src/webenginequick/api/qquickwebenginetouchselectionmenurequest_p.h66
-rw-r--r--src/webenginequick/api/qquickwebenginetouchselectionmenurequest_p_p.h43
-rw-r--r--src/webenginequick/api/qquickwebengineview.cpp2542
-rw-r--r--src/webenginequick/api/qquickwebengineview_p.h586
-rw-r--r--src/webenginequick/api/qquickwebengineview_p_p.h205
-rw-r--r--src/webenginequick/api/qtwebenginequickglobal.cpp59
-rw-r--r--src/webenginequick/api/qtwebenginequickglobal.h29
-rw-r--r--src/webenginequick/api/qtwebenginequickglobal_p.h22
-rw-r--r--src/webenginequick/configure.cmake10
-rw-r--r--src/webenginequick/doc/images/qtwebengine-architecture.png (renamed from src/webengine/doc/images/qtwebengine-architecture.png)bin9890 -> 9890 bytes
-rw-r--r--src/webenginequick/doc/images/qtwebengine-model.png (renamed from src/webengine/doc/images/qtwebengine-model.png)bin8656 -> 8656 bytes
-rw-r--r--src/webenginequick/doc/images/qtwebengine-model.qmodel (renamed from src/webengine/doc/images/qtwebengine-model.qmodel)0
-rw-r--r--src/webenginequick/doc/images/qtwebengine-modules-model.qmodel (renamed from src/webengine/doc/images/qtwebengine-modules-model.qmodel)0
-rw-r--r--src/webenginequick/doc/images/qtwebenginewidgets-model.png (renamed from src/webengine/doc/images/qtwebenginewidgets-model.png)bin9749 -> 9749 bytes
-rw-r--r--src/webenginequick/doc/images/qtwebenginewidgets-model.qmodel (renamed from src/webengine/doc/images/qtwebenginewidgets-model.qmodel)0
-rw-r--r--src/webenginequick/doc/snippets/minimal/main.cpp18
-rw-r--r--src/webenginequick/doc/snippets/minimal/main.qml18
-rw-r--r--src/webenginequick/doc/snippets/qtwebengine_build_snippet.qdoc11
-rw-r--r--src/webenginequick/doc/snippets/qtwebengine_webengineaction.qml123
-rw-r--r--src/webenginequick/doc/snippets/qtwebengine_webengineview_newviewrequested.qml37
-rw-r--r--src/webenginequick/doc/src/context_menu_request.qdoc194
-rw-r--r--src/webenginequick/doc/src/fullscreen_request.qdoc58
-rw-r--r--src/webenginequick/doc/src/loading_info.qdoc64
-rw-r--r--src/webenginequick/doc/src/navigation_history.qdoc113
-rw-r--r--src/webenginequick/doc/src/qtwebengine-examples.qdoc15
-rw-r--r--src/webenginequick/doc/src/qtwebengine-module.qdoc25
-rw-r--r--src/webenginequick/doc/src/qtwebengine-qmlmodule.qdoc29
-rw-r--r--src/webenginequick/doc/src/quota_request.qdoc36
-rw-r--r--src/webenginequick/doc/src/register_protocol_handler_request.qdoc42
-rw-r--r--src/webenginequick/doc/src/touch_selection_menu_request.qdoc79
-rw-r--r--src/webenginequick/doc/src/webengine_certificate_error.qdoc108
-rw-r--r--src/webenginequick/doc/src/webengine_download_request.qdoc278
-rw-r--r--src/webenginequick/doc/src/webenginescript.qdoc98
-rw-r--r--src/webenginequick/doc/src/webengineview_lgpl.qdoc1585
-rw-r--r--src/webenginequick/plugin.cpp40
-rw-r--r--src/webenginequick/qquickwebengine_accessible.cpp147
-rw-r--r--src/webenginequick/qquickwebengine_accessible.h56
-rw-r--r--src/webenginequick/render_widget_host_view_qt_delegate_quickwindow.cpp132
-rw-r--r--src/webenginequick/render_widget_host_view_qt_delegate_quickwindow.h46
-rw-r--r--src/webenginequick/ui/AlertDialog.qml64
-rw-r--r--src/webenginequick/ui/AuthenticationDialog.qml101
-rw-r--r--src/webenginequick/ui/AutofillPopup.qml41
-rw-r--r--src/webenginequick/ui/CMakeLists.txt50
-rw-r--r--src/webenginequick/ui/ColorDialog.qml13
-rw-r--r--src/webenginequick/ui/ConfirmDialog.qml77
-rw-r--r--src/webenginequick/ui/DirectoryPicker.qml15
-rw-r--r--src/webenginequick/ui/FilePicker.qml15
-rw-r--r--src/webenginequick/ui/Menu.qml22
-rw-r--r--src/webenginequick/ui/MenuItem.qml7
-rw-r--r--src/webenginequick/ui/MenuSeparator.qml6
-rw-r--r--src/webenginequick/ui/PromptDialog.qml79
-rw-r--r--src/webenginequick/ui/ToolTip.qml10
-rw-r--r--src/webenginequick/ui/TouchHandle.qml6
-rw-r--r--src/webenginequick/ui/TouchSelectionMenu.qml139
-rw-r--r--src/webenginequick/ui/custom/ColorDialog.qml285
-rw-r--r--src/webenginequick/ui/information.png (renamed from src/webengine/ui2/information.png)bin254 -> 254 bytes
-rw-r--r--src/webenginequick/ui/question.png (renamed from src/webengine/ui2/question.png)bin257 -> 257 bytes
-rw-r--r--src/webenginequick/ui_delegates_manager.cpp806
-rw-r--r--src/webenginequick/ui_delegates_manager.h130
-rw-r--r--src/webenginewidgets/CMakeLists.txt46
-rw-r--r--src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp75
-rw-r--r--src/webenginewidgets/api/qtwebenginewidgetsglobal.h40
-rw-r--r--src/webenginewidgets/api/qwebenginecertificateerror.cpp266
-rw-r--r--src/webenginewidgets/api/qwebenginecertificateerror.h104
-rw-r--r--src/webenginewidgets/api/qwebengineclientcertificateselection.cpp127
-rw-r--r--src/webenginewidgets/api/qwebengineclientcertificateselection.h80
-rw-r--r--src/webenginewidgets/api/qwebenginecontextmenudata.cpp306
-rw-r--r--src/webenginewidgets/api/qwebenginecontextmenudata.h133
-rw-r--r--src/webenginewidgets/api/qwebenginedownloaditem.cpp786
-rw-r--r--src/webenginewidgets/api/qwebenginedownloaditem.h174
-rw-r--r--src/webenginewidgets/api/qwebenginedownloaditem_p.h99
-rw-r--r--src/webenginewidgets/api/qwebenginefullscreenrequest.cpp136
-rw-r--r--src/webenginewidgets/api/qwebenginefullscreenrequest.h70
-rw-r--r--src/webenginewidgets/api/qwebenginehistory.cpp280
-rw-r--r--src/webenginewidgets/api/qwebenginehistory.h128
-rw-r--r--src/webenginewidgets/api/qwebenginehistory_p.h81
-rw-r--r--src/webenginewidgets/api/qwebenginenotificationpresenter.cpp48
-rw-r--r--src/webenginewidgets/api/qwebenginenotificationpresenter_p.h43
-rw-r--r--src/webenginewidgets/api/qwebenginepage.cpp2845
-rw-r--r--src/webenginewidgets/api/qwebenginepage.h409
-rw-r--r--src/webenginewidgets/api/qwebenginepage_p.h231
-rw-r--r--src/webenginewidgets/api/qwebengineprofile.cpp892
-rw-r--r--src/webenginewidgets/api/qwebengineprofile.h167
-rw-r--r--src/webenginewidgets/api/qwebengineprofile_p.h108
-rw-r--r--src/webenginewidgets/api/qwebenginescript.cpp293
-rw-r--r--src/webenginewidgets/api/qwebenginescript.h113
-rw-r--r--src/webenginewidgets/api/qwebenginescriptcollection.cpp248
-rw-r--r--src/webenginewidgets/api/qwebenginescriptcollection.h82
-rw-r--r--src/webenginewidgets/api/qwebenginescriptcollection_p.h91
-rw-r--r--src/webenginewidgets/api/qwebenginesettings.cpp254
-rw-r--r--src/webenginewidgets/api/qwebenginesettings.h154
-rw-r--r--src/webenginewidgets/api/qwebengineview.cpp1382
-rw-r--r--src/webenginewidgets/api/qwebengineview.h120
-rw-r--r--src/webenginewidgets/api/qwebengineview_p.h137
-rw-r--r--src/webenginewidgets/configure.json28
-rw-r--r--src/webenginewidgets/doc/snippets/push-notifications/commands19
-rw-r--r--src/webenginewidgets/doc/snippets/qtwebengine_qwebenginepage_snippet.cpp38
-rw-r--r--src/webenginewidgets/doc/snippets/qtwebengine_qwebengineview_snippet.cpp28
-rw-r--r--src/webenginewidgets/doc/snippets/qtwebenginewidgets_build_snippet.qdoc36
-rw-r--r--src/webenginewidgets/doc/snippets/simple/main.cpp62
-rw-r--r--src/webenginewidgets/doc/src/qtwebenginewidgets-examples.qdoc29
-rw-r--r--src/webenginewidgets/doc/src/qtwebenginewidgets-index.qdoc38
-rw-r--r--src/webenginewidgets/doc/src/qtwebenginewidgets-module.qdoc49
-rw-r--r--src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc28
-rw-r--r--src/webenginewidgets/doc/src/qwebenginehistory_lgpl.qdoc231
-rw-r--r--src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc851
-rw-r--r--src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc310
-rw-r--r--src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc43
-rw-r--r--src/webenginewidgets/plugins/qwebengineview/CMakeLists.txt25
-rw-r--r--src/webenginewidgets/plugins/qwebengineview/images/qwebengineview.png (renamed from src/plugins/qwebengineview/images/qwebengineview.png)bin1473 -> 1473 bytes
-rw-r--r--src/webenginewidgets/plugins/qwebengineview/qwebengineview_plugin.cpp102
-rw-r--r--src/webenginewidgets/plugins/qwebengineview/qwebengineview_plugin.h71
-rw-r--r--src/webenginewidgets/printer_worker.cpp159
-rw-r--r--src/webenginewidgets/printer_worker.h88
-rw-r--r--src/webenginewidgets/qwebengine_accessible.cpp102
-rw-r--r--src/webenginewidgets/qwebengine_accessible.h49
-rw-r--r--src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp533
-rw-r--r--src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h142
-rw-r--r--src/webenginewidgets/ui/autofillpopupwidget.cpp201
-rw-r--r--src/webenginewidgets/ui/autofillpopupwidget_p.h58
-rw-r--r--src/webenginewidgets/ui/touchhandlewidget.cpp59
-rw-r--r--src/webenginewidgets/ui/touchhandlewidget_p.h50
-rw-r--r--src/webenginewidgets/ui/touchselectionmenuwidget.cpp117
-rw-r--r--src/webenginewidgets/ui/touchselectionmenuwidget_p.h52
-rw-r--r--src/webenginewidgets/webenginewidgets.pro59
-rw-r--r--sync.profile15
-rw-r--r--tests/CMakeLists.txt1
-rw-r--r--tests/auto/CMakeLists.txt20
-rw-r--r--tests/auto/Info.plist.in18
-rw-r--r--tests/auto/auto.pro25
-rw-r--r--tests/auto/bic/data/QtWebEngine.5.15.0.linux-gcc-amd64.txt12282
-rw-r--r--tests/auto/bic/data/QtWebEngineCore.5.15.0.linux-gcc-amd64.txt12222
-rw-r--r--tests/auto/bic/data/QtWebEngineWidgets.5.15.0.linux-gcc-amd64.txt23728
-rw-r--r--tests/auto/cmake/CMakeLists.txt30
-rw-r--r--tests/auto/cmake/cmake.pro8
-rw-r--r--tests/auto/core/CMakeLists.txt25
-rw-r--r--tests/auto/core/certificateerror/BLACKLIST2
-rw-r--r--tests/auto/core/certificateerror/CMakeLists.txt26
-rw-r--r--tests/auto/core/certificateerror/resources/server.key27
-rw-r--r--tests/auto/core/certificateerror/resources/server.pem41
-rw-r--r--tests/auto/core/certificateerror/tst_certificateerror.cpp134
-rw-r--r--tests/auto/core/core.pro9
-rw-r--r--tests/auto/core/devtools/CMakeLists.txt10
-rw-r--r--tests/auto/core/devtools/tst_devtools.cpp69
-rw-r--r--tests/auto/core/getdomainandregistry/CMakeLists.txt12
-rw-r--r--tests/auto/core/getdomainandregistry/tst_getdomainandregistry.cpp30
-rw-r--r--tests/auto/core/origins/CMakeLists.txt52
-rw-r--r--tests/auto/core/origins/resources/createObjectURL.html (renamed from tests/auto/widgets/origins/resources/createObjectURL.html)0
-rw-r--r--tests/auto/core/origins/resources/dedicatedWorker.html (renamed from tests/auto/widgets/origins/resources/dedicatedWorker.html)0
-rw-r--r--tests/auto/core/origins/resources/dedicatedWorker.js (renamed from tests/auto/widgets/origins/resources/dedicatedWorker.js)0
-rw-r--r--tests/auto/core/origins/resources/fetchApi.html14
-rw-r--r--tests/auto/core/origins/resources/link.html13
-rw-r--r--tests/auto/core/origins/resources/media.html15
-rw-r--r--tests/auto/core/origins/resources/mixedSchemes.html42
-rw-r--r--tests/auto/core/origins/resources/mixedSchemesWithCsp.html (renamed from tests/auto/widgets/origins/resources/mixedSchemesWithCsp.html)0
-rw-r--r--tests/auto/core/origins/resources/mixedSchemes_frame.html15
-rw-r--r--tests/auto/core/origins/resources/mixedXHR.html (renamed from tests/auto/widgets/origins/resources/mixedXHR.html)0
-rw-r--r--tests/auto/core/origins/resources/mixedXHR.txt (renamed from tests/auto/widgets/origins/resources/mixedXHR.txt)0
-rw-r--r--tests/auto/core/origins/resources/red.pngbin0 -> 146 bytes
-rw-r--r--tests/auto/core/origins/resources/redirect.css3
-rw-r--r--tests/auto/core/origins/resources/redirect.html17
-rw-r--r--tests/auto/core/origins/resources/serviceWorker.html (renamed from tests/auto/widgets/origins/resources/serviceWorker.html)0
-rw-r--r--tests/auto/core/origins/resources/serviceWorker.js (renamed from tests/auto/widgets/origins/resources/serviceWorker.js)0
-rw-r--r--tests/auto/core/origins/resources/sharedWorker.html (renamed from tests/auto/widgets/origins/resources/sharedWorker.html)0
-rw-r--r--tests/auto/core/origins/resources/sharedWorker.js (renamed from tests/auto/widgets/origins/resources/sharedWorker.js)0
-rw-r--r--tests/auto/core/origins/resources/subdir/frame2.html (renamed from tests/auto/widgets/origins/resources/subdir/frame2.html)0
-rw-r--r--tests/auto/core/origins/resources/subdir/index.html (renamed from tests/auto/widgets/origins/resources/subdir/index.html)0
-rw-r--r--tests/auto/core/origins/resources/subdir_frame1.html (renamed from tests/auto/widgets/origins/resources/subdir_frame1.html)0
-rw-r--r--tests/auto/core/origins/resources/viewSource.html (renamed from tests/auto/widgets/origins/resources/viewSource.html)0
-rw-r--r--tests/auto/core/origins/resources/websocket.html (renamed from tests/auto/widgets/origins/resources/websocket.html)0
-rw-r--r--tests/auto/core/origins/resources/websocket2.html23
-rw-r--r--tests/auto/core/origins/tst_origins.cpp1730
-rw-r--r--tests/auto/core/qtversion/CMakeLists.txt10
-rw-r--r--tests/auto/core/qtversion/tst_qtversion.cpp34
-rw-r--r--tests/auto/core/qwebengineclientcertificatestore/CMakeLists.txt80
-rw-r--r--tests/auto/core/qwebengineclientcertificatestore/qwebengineclientcertificatestore.pro1
-rw-r--r--tests/auto/core/qwebengineclientcertificatestore/resources/ca.pem24
-rw-r--r--tests/auto/core/qwebengineclientcertificatestore/resources/client.key27
-rw-r--r--tests/auto/core/qwebengineclientcertificatestore/resources/client.pem22
-rw-r--r--tests/auto/core/qwebengineclientcertificatestore/resources/client2.key27
-rw-r--r--tests/auto/core/qwebengineclientcertificatestore/resources/client2.p12bin0 -> 2710 bytes
-rw-r--r--tests/auto/core/qwebengineclientcertificatestore/resources/client2.pem22
-rw-r--r--tests/auto/core/qwebengineclientcertificatestore/resources/server.key27
-rw-r--r--tests/auto/core/qwebengineclientcertificatestore/resources/server.pem22
-rw-r--r--tests/auto/core/qwebengineclientcertificatestore/tst_qwebengineclientcertificatestore.cpp133
-rw-r--r--tests/auto/core/qwebengineclientcertificatestore/tst_qwebengineclientcertificatestore.qrc8
-rw-r--r--tests/auto/core/qwebenginecookiestore/CMakeLists.txt26
-rw-r--r--tests/auto/core/qwebenginecookiestore/qwebenginecookiestore.pro1
-rw-r--r--tests/auto/core/qwebenginecookiestore/tst_qwebenginecookiestore.cpp228
-rw-r--r--tests/auto/core/qwebenginecookiestore/tst_qwebenginecookiestore.qrc6
-rw-r--r--tests/auto/core/qwebengineglobalsettings/CMakeLists.txt29
-rw-r--r--tests/auto/core/qwebengineglobalsettings/cert/RootCA.pem20
-rw-r--r--tests/auto/core/qwebengineglobalsettings/cert/localhost.crt22
-rw-r--r--tests/auto/core/qwebengineglobalsettings/cert/localhost.key28
-rw-r--r--tests/auto/core/qwebengineglobalsettings/tst_qwebengineglobalsettings.cpp121
-rw-r--r--tests/auto/core/qwebengineloadinginfo/CMakeLists.txt10
-rw-r--r--tests/auto/core/qwebengineloadinginfo/tst_qwebengineloadinginfo.cpp93
-rw-r--r--tests/auto/core/qwebenginesettings/BLACKLIST5
-rw-r--r--tests/auto/core/qwebenginesettings/CMakeLists.txt13
-rw-r--r--tests/auto/core/qwebenginesettings/tst_qwebenginesettings.cpp307
-rw-r--r--tests/auto/core/qwebengineurlrequestinterceptor/CMakeLists.txt49
-rw-r--r--tests/auto/core/qwebengineurlrequestinterceptor/qwebengineurlrequestinterceptor.pro2
-rw-r--r--tests/auto/core/qwebengineurlrequestinterceptor/resources/content.html3
-rw-r--r--tests/auto/core/qwebengineurlrequestinterceptor/resources/content2.html6
-rw-r--r--tests/auto/core/qwebengineurlrequestinterceptor/resources/content3.html6
-rw-r--r--tests/auto/core/qwebengineurlrequestinterceptor/resources/postBodyFile.txt3
-rw-r--r--tests/auto/core/qwebengineurlrequestinterceptor/resources/sw.html39
-rw-r--r--tests/auto/core/qwebengineurlrequestinterceptor/resources/sw.js15
-rw-r--r--tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp837
-rw-r--r--tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.qrc24
-rw-r--r--tests/auto/core/qwebengineurlrequestjob/CMakeLists.txt22
-rw-r--r--tests/auto/core/qwebengineurlrequestjob/additionalResponseHeadersScript.html12
-rw-r--r--tests/auto/core/qwebengineurlrequestjob/requestBodyScript.html12
-rw-r--r--tests/auto/core/qwebengineurlrequestjob/tst_qwebengineurlrequestjob.cpp187
-rw-r--r--tests/auto/core/tests.pri17
-rw-r--r--tests/auto/core/webenginedriver/CMakeLists.txt15
-rw-r--r--tests/auto/core/webenginedriver/browser/CMakeLists.txt13
-rw-r--r--tests/auto/core/webenginedriver/browser/main.cpp21
-rw-r--r--tests/auto/core/webenginedriver/resources/input.html5
-rw-r--r--tests/auto/core/webenginedriver/test/CMakeLists.txt26
-rw-r--r--tests/auto/core/webenginedriver/tst_webenginedriver.cpp631
-rw-r--r--tests/auto/embed_info_plist.pri13
-rw-r--r--tests/auto/httpserver/CMakeLists.txt10
-rw-r--r--tests/auto/httpserver/data/hedgehog.html9
-rw-r--r--tests/auto/httpserver/data/hedgehog.pngbin0 -> 11273 bytes
-rw-r--r--tests/auto/httpserver/data/loadprogress/downloadable.tar.gz (renamed from tests/auto/widgets/loadsignals/resources/downloadable.tar.gz)bin131 -> 131 bytes
-rw-r--r--tests/auto/httpserver/data/loadprogress/main.html30
-rw-r--r--tests/auto/httpserver/data/loadprogress/page1.html8
-rw-r--r--tests/auto/httpserver/data/loadprogress/page2.html15
-rw-r--r--tests/auto/httpserver/data/loadprogress/page3.html (renamed from tests/auto/widgets/loadsignals/resources/page3.html)0
-rw-r--r--tests/auto/httpserver/data/loadprogress/page4.html (renamed from tests/auto/widgets/loadsignals/resources/page4.html)0
-rw-r--r--tests/auto/httpserver/data/loadprogress/page5.html20
-rw-r--r--tests/auto/httpserver/data/loadprogress/page6.html13
-rw-r--r--tests/auto/httpserver/data/loadprogress/page7.html13
-rw-r--r--tests/auto/httpserver/data/loadprogress/page8.html20
-rw-r--r--tests/auto/httpserver/data/notification.html (renamed from tests/auto/shared/data/notification.html)0
-rw-r--r--tests/auto/httpserver/httpreqrep.cpp125
-rw-r--r--tests/auto/httpserver/httpreqrep.h85
-rw-r--r--tests/auto/httpserver/httpserver.cmake41
-rw-r--r--tests/auto/httpserver/httpserver.cpp127
-rw-r--r--tests/auto/httpserver/httpserver.h82
-rw-r--r--tests/auto/httpserver/httpsserver.h73
-rw-r--r--tests/auto/httpserver/proxy_server.cpp85
-rw-r--r--tests/auto/httpserver/proxy_server.h42
-rw-r--r--tests/auto/pdf/CMakeLists.txt12
-rw-r--r--tests/auto/pdf/pdf.pro8
-rw-r--r--tests/auto/pdf/qpdfbookmarkmodel/CMakeLists.txt15
-rw-r--r--tests/auto/pdf/qpdfbookmarkmodel/qpdfbookmarkmodel.pro5
-rw-r--r--tests/auto/pdf/qpdfbookmarkmodel/tst_qpdfbookmarkmodel.cpp168
-rw-r--r--tests/auto/pdf/qpdfdocument/BLACKLIST6
-rw-r--r--tests/auto/pdf/qpdfdocument/CMakeLists.txt18
-rw-r--r--tests/auto/pdf/qpdfdocument/qpdfdocument.pro6
-rw-r--r--tests/auto/pdf/qpdfdocument/rotated_text.pdf70
-rw-r--r--tests/auto/pdf/qpdfdocument/tagged_mcr_multipage.pdf136
-rw-r--r--tests/auto/pdf/qpdfdocument/test.pdfbin0 -> 76633 bytes
-rw-r--r--tests/auto/pdf/qpdfdocument/tst_qpdfdocument.cpp342
-rw-r--r--tests/auto/pdf/qpdfpagenavigation/qpdfpagenavigation.pro5
-rw-r--r--tests/auto/pdf/qpdfpagenavigation/tst_qpdfpagenavigation.cpp200
-rw-r--r--tests/auto/pdf/qpdfpagenavigator/CMakeLists.txt14
-rw-r--r--tests/auto/pdf/qpdfpagenavigator/pdf-sample.bookmarks_pages.pdf (renamed from tests/auto/pdf/qpdfpagenavigation/pdf-sample.pagenavigation.pdf)bin27523 -> 27523 bytes
-rw-r--r--tests/auto/pdf/qpdfpagenavigator/tst_qpdfpagenavigator.cpp70
-rw-r--r--tests/auto/pdf/qpdfpagerenderer/CMakeLists.txt14
-rw-r--r--tests/auto/pdf/qpdfpagerenderer/qpdfpagerenderer.pro5
-rw-r--r--tests/auto/pdf/qpdfpagerenderer/tst_qpdfpagerenderer.cpp53
-rw-r--r--tests/auto/pdf/qpdfsearchmodel/CMakeLists.txt15
-rw-r--r--tests/auto/pdf/qpdfsearchmodel/qpdfsearchmodel.pro5
-rw-r--r--tests/auto/pdf/qpdfsearchmodel/rotated_text.pdf70
-rw-r--r--tests/auto/pdf/qpdfsearchmodel/tagged_mcr_multipage.pdf136
-rw-r--r--tests/auto/pdf/qpdfsearchmodel/test.pdfbin80045 -> 76633 bytes
-rw-r--r--tests/auto/pdf/qpdfsearchmodel/tst_qpdfsearchmodel.cpp78
-rw-r--r--tests/auto/pdfquick/CMakeLists.txt2
-rw-r--r--tests/auto/pdfquick/multipageview/BLACKLIST7
-rw-r--r--tests/auto/pdfquick/multipageview/CMakeLists.txt30
-rw-r--r--tests/auto/pdfquick/multipageview/data/bookmarksAndLinks.pdf317
-rw-r--r--tests/auto/pdfquick/multipageview/data/jumpOnDocumentReady.qml18
-rw-r--r--tests/auto/pdfquick/multipageview/data/multiPageView.qml8
-rw-r--r--tests/auto/pdfquick/multipageview/data/multiPageViewWithFeedback.qml18
-rw-r--r--tests/auto/pdfquick/multipageview/data/pdf-sample.protected.pdfbin0 -> 9138 bytes
-rw-r--r--tests/auto/pdfquick/multipageview/data/qpdfwriter.pdfbin0 -> 33645 bytes
-rw-r--r--tests/auto/pdfquick/multipageview/tst_multipageview.cpp446
-rw-r--r--tests/auto/pdfquick/pdfpageimage/CMakeLists.txt30
-rw-r--r--tests/auto/pdfquick/pdfpageimage/data/bookmarksAndLinks.pdf317
-rw-r--r--tests/auto/pdfquick/pdfpageimage/data/pdfPageImage.qml16
-rw-r--r--tests/auto/pdfquick/pdfpageimage/tst_pdfpageimage.cpp131
-rw-r--r--tests/auto/pdfquick/shared/util.cpp110
-rw-r--r--tests/auto/pdfquick/shared/util.h58
-rw-r--r--tests/auto/quick/CMakeLists.txt15
-rw-r--r--tests/auto/quick/dialogs/CMakeLists.txt28
-rw-r--r--tests/auto/quick/dialogs/WebView.qml39
-rw-r--r--tests/auto/quick/dialogs/dialogs.pro13
-rw-r--r--tests/auto/quick/dialogs/dialogs.qrc6
-rw-r--r--tests/auto/quick/dialogs/server.cpp79
-rw-r--r--tests/auto/quick/dialogs/server.h59
-rw-r--r--tests/auto/quick/dialogs/testhandler.cpp31
-rw-r--r--tests/auto/quick/dialogs/testhandler.h29
-rw-r--r--tests/auto/quick/dialogs/tst_dialogs.cpp138
-rw-r--r--tests/auto/quick/inspectorserver/BLACKLIST6
-rw-r--r--tests/auto/quick/inspectorserver/CMakeLists.txt12
-rw-r--r--tests/auto/quick/inspectorserver/html/basic_page.html (renamed from tests/auto/quick/html/basic_page.html)0
-rw-r--r--tests/auto/quick/inspectorserver/inspectorserver.pro4
-rw-r--r--tests/auto/quick/inspectorserver/tst_inspectorserver.cpp91
-rw-r--r--tests/auto/quick/publicapi/CMakeLists.txt10
-rw-r--r--tests/auto/quick/publicapi/publicapi.pro3
-rw-r--r--tests/auto/quick/publicapi/tst_publicapi.cpp731
-rw-r--r--tests/auto/quick/qmltests/BLACKLIST12
-rw-r--r--tests/auto/quick/qmltests/CMakeLists.txt94
-rw-r--r--tests/auto/quick/qmltests/data/TestWebEngineView.qml114
-rw-r--r--tests/auto/quick/qmltests/data/accepttypes.html (renamed from tests/auto/quick/qmltests2/data/accepttypes.html)0
-rw-r--r--tests/auto/quick/qmltests/data/alert.html (renamed from tests/auto/quick/qmltests2/data/alert.html)0
-rw-r--r--tests/auto/quick/qmltests/data/confirm.html (renamed from tests/auto/quick/qmltests2/data/confirm.html)0
-rw-r--r--tests/auto/quick/qmltests/data/confirmclose.html (renamed from tests/auto/quick/qmltests2/data/confirmclose.html)0
-rw-r--r--tests/auto/quick/qmltests/data/directoryupload.html (renamed from tests/auto/quick/qmltests2/data/directoryupload.html)0
-rw-r--r--tests/auto/quick/qmltests/data/favicon-candidates-gray.html (renamed from tests/auto/quick/qmltests2/data/favicon-candidates-gray.html)0
-rw-r--r--tests/auto/quick/qmltests/data/favicon-misc.html11
-rw-r--r--tests/auto/quick/qmltests/data/favicon-multi-gray.html (renamed from tests/auto/quick/qmltests2/data/favicon-multi-gray.html)0
-rw-r--r--tests/auto/quick/qmltests/data/favicon-multi.html (renamed from tests/auto/quick/qmltests2/data/favicon-multi.html)0
-rw-r--r--tests/auto/quick/qmltests/data/favicon-shortcut.html (renamed from tests/auto/quick/qmltests2/data/favicon-shortcut.html)0
-rw-r--r--tests/auto/quick/qmltests/data/favicon-single.html (renamed from tests/auto/quick/qmltests2/data/favicon-single.html)0
-rw-r--r--tests/auto/quick/qmltests/data/favicon-touch.html (renamed from tests/auto/quick/qmltests2/data/favicon-touch.html)0
-rw-r--r--tests/auto/quick/qmltests/data/favicon-unavailable.html (renamed from tests/auto/quick/qmltests2/data/favicon-unavailable.html)0
-rw-r--r--tests/auto/quick/qmltests/data/favicon2.html (renamed from tests/auto/quick/qmltests2/data/favicon2.html)0
-rw-r--r--tests/auto/quick/qmltests/data/filesystemapi.html66
-rw-r--r--tests/auto/quick/qmltests/data/geolocation.html9
-rw-r--r--tests/auto/quick/qmltests/data/icons/gray128.png (renamed from tests/auto/quick/qmltests2/data/icons/gray128.png)bin146 -> 146 bytes
-rw-r--r--tests/auto/quick/qmltests/data/icons/gray16.png (renamed from tests/auto/quick/qmltests2/data/icons/gray16.png)bin72 -> 72 bytes
-rw-r--r--tests/auto/quick/qmltests/data/icons/gray255.png (renamed from tests/auto/quick/qmltests2/data/icons/gray255.png)bin335 -> 335 bytes
-rw-r--r--tests/auto/quick/qmltests/data/icons/gray32.png (renamed from tests/auto/quick/qmltests2/data/icons/gray32.png)bin79 -> 79 bytes
-rw-r--r--tests/auto/quick/qmltests/data/icons/gray64.png (renamed from tests/auto/quick/qmltests2/data/icons/gray64.png)bin99 -> 99 bytes
-rw-r--r--tests/auto/quick/qmltests/data/icons/grayicons.ico (renamed from tests/auto/quick/qmltests2/data/icons/grayicons.ico)bin22150 -> 22150 bytes
-rw-r--r--tests/auto/quick/qmltests/data/icons/qt144.png (renamed from tests/auto/quick/qmltests2/data/icons/qt144.png)bin8315 -> 8315 bytes
-rw-r--r--tests/auto/quick/qmltests/data/icons/qt32.ico (renamed from tests/auto/quick/qmltests2/data/icons/qt32.ico)bin4286 -> 4286 bytes
-rw-r--r--tests/auto/quick/qmltests/data/icons/qtmulti.ico (renamed from tests/auto/quick/qmltests2/data/icons/qtmulti.ico)bin22382 -> 22382 bytes
-rw-r--r--tests/auto/quick/qmltests/data/icons/small-favicon.png (renamed from tests/auto/quick/qmltests2/data/icons/small-favicon.png)bin878 -> 878 bytes
-rw-r--r--tests/auto/quick/qmltests/data/multifileupload.html (renamed from tests/auto/quick/qmltests2/data/multifileupload.html)0
-rw-r--r--tests/auto/quick/qmltests/data/prompt.html (renamed from tests/auto/quick/qmltests2/data/prompt.html)0
-rw-r--r--tests/auto/quick/qmltests/data/singlefileupload.html (renamed from tests/auto/quick/qmltests2/data/singlefileupload.html)0
-rw-r--r--tests/auto/quick/qmltests/data/test2.html2
-rw-r--r--tests/auto/quick/qmltests/data/test4.html2
-rw-r--r--tests/auto/quick/qmltests/data/titleupdate.js17
-rw-r--r--tests/auto/quick/qmltests/data/tst_action.qml51
-rw-r--r--tests/auto/quick/qmltests/data/tst_activeFocusOnPress.qml34
-rw-r--r--tests/auto/quick/qmltests/data/tst_audioMuted.qml37
-rw-r--r--tests/auto/quick/qmltests/data/tst_basicProfiles.qml90
-rw-r--r--tests/auto/quick/qmltests/data/tst_certificateError.qml96
-rw-r--r--tests/auto/quick/qmltests/data/tst_contextMenu.qml114
-rw-r--r--tests/auto/quick/qmltests/data/tst_datalist.qml180
-rw-r--r--tests/auto/quick/qmltests/data/tst_desktopBehaviorLoadHtml.qml37
-rw-r--r--tests/auto/quick/qmltests/data/tst_download.qml126
-rw-r--r--tests/auto/quick/qmltests/data/tst_dragHandlerUnderView.qml67
-rw-r--r--tests/auto/quick/qmltests/data/tst_favicon.qml527
-rw-r--r--tests/auto/quick/qmltests/data/tst_faviconDatabase.qml216
-rw-r--r--tests/auto/quick/qmltests/data/tst_filePicker.qml297
-rw-r--r--tests/auto/quick/qmltests/data/tst_filesystem.qml124
-rw-r--r--tests/auto/quick/qmltests/data/tst_findText.qml44
-rw-r--r--tests/auto/quick/qmltests/data/tst_focusOnNavigation.qml38
-rw-r--r--tests/auto/quick/qmltests/data/tst_fullScreenRequest.qml82
-rw-r--r--tests/auto/quick/qmltests/data/tst_geopermission.qml77
-rw-r--r--tests/auto/quick/qmltests/data/tst_getUserMedia.qml43
-rw-r--r--tests/auto/quick/qmltests/data/tst_inputMethod.qml53
-rw-r--r--tests/auto/quick/qmltests/data/tst_inputTextDirection.qml43
-rw-r--r--tests/auto/quick/qmltests/data/tst_javaScriptDialogs.qml123
-rw-r--r--tests/auto/quick/qmltests/data/tst_keyboardEvents.qml52
-rw-r--r--tests/auto/quick/qmltests/data/tst_keyboardModifierMapping.qml35
-rw-r--r--tests/auto/quick/qmltests/data/tst_linkHovered.qml108
-rw-r--r--tests/auto/quick/qmltests/data/tst_loadFail.qml79
-rw-r--r--tests/auto/quick/qmltests/data/tst_loadHtml.qml36
-rw-r--r--tests/auto/quick/qmltests/data/tst_loadProgress.qml57
-rw-r--r--tests/auto/quick/qmltests/data/tst_loadRecursionCrash.qml35
-rw-r--r--tests/auto/quick/qmltests/data/tst_loadUrl.qml80
-rw-r--r--tests/auto/quick/qmltests/data/tst_mouseClick.qml108
-rw-r--r--tests/auto/quick/qmltests/data/tst_mouseMove.qml35
-rw-r--r--tests/auto/quick/qmltests/data/tst_navigationHistory.qml105
-rw-r--r--tests/auto/quick/qmltests/data/tst_navigationRequested.qml70
-rw-r--r--tests/auto/quick/qmltests/data/tst_newViewRequest.qml149
-rw-r--r--tests/auto/quick/qmltests/data/tst_notification.qml43
-rw-r--r--tests/auto/quick/qmltests/data/tst_profile.qml66
-rw-r--r--tests/auto/quick/qmltests/data/tst_properties.qml35
-rw-r--r--tests/auto/quick/qmltests/data/tst_runJavaScript.qml38
-rw-r--r--tests/auto/quick/qmltests/data/tst_save.qml185
-rw-r--r--tests/auto/quick/qmltests/data/tst_scrollPosition.qml42
-rw-r--r--tests/auto/quick/qmltests/data/tst_settings.qml102
-rw-r--r--tests/auto/quick/qmltests/data/tst_titleChanged.qml35
-rw-r--r--tests/auto/quick/qmltests/data/tst_unhandledKeyEventPropagation.qml44
-rw-r--r--tests/auto/quick/qmltests/data/tst_userScriptCollection.qml127
-rw-r--r--tests/auto/quick/qmltests/data/tst_userScripts.qml158
-rw-r--r--tests/auto/quick/qmltests/data/tst_viewSource.qml118
-rw-r--r--tests/auto/quick/qmltests/data/tst_webchannel.qml46
-rw-r--r--tests/auto/quick/qmltests/data/webchannel-test.html1
-rw-r--r--tests/auto/quick/qmltests/mock-delegates/QtWebEngine/ControlsDelegates/AlertDialog.qml5
-rw-r--r--tests/auto/quick/qmltests/mock-delegates/QtWebEngine/ControlsDelegates/ConfirmDialog.qml24
-rw-r--r--tests/auto/quick/qmltests/mock-delegates/QtWebEngine/ControlsDelegates/DirectoryPicker.qml18
-rw-r--r--tests/auto/quick/qmltests/mock-delegates/QtWebEngine/ControlsDelegates/FilePicker.qml24
-rw-r--r--tests/auto/quick/qmltests/mock-delegates/QtWebEngine/ControlsDelegates/Menu.qml18
-rw-r--r--tests/auto/quick/qmltests/mock-delegates/QtWebEngine/ControlsDelegates/MenuItem.qml8
-rw-r--r--tests/auto/quick/qmltests/mock-delegates/QtWebEngine/ControlsDelegates/PromptDialog.qml27
-rw-r--r--tests/auto/quick/qmltests/mock-delegates/TestParams/FilePickerParams.qml13
-rw-r--r--tests/auto/quick/qmltests/mock-delegates/TestParams/JSDialogParams.qml12
-rw-r--r--tests/auto/quick/qmltests/mock-delegates/TestParams/MenuParams.qml9
-rw-r--r--tests/auto/quick/qmltests/mock-delegates/TestParams/qmldir5
-rw-r--r--tests/auto/quick/qmltests/qmltests.pro69
-rw-r--r--tests/auto/quick/qmltests/resources/server.key27
-rw-r--r--tests/auto/quick/qmltests/resources/server.pem41
-rw-r--r--tests/auto/quick/qmltests/tst_qmltests.cpp219
-rw-r--r--tests/auto/quick/qmltests2/data/favicon-misc.html11
-rw-r--r--tests/auto/quick/qmltests2/data/favicon.html10
-rw-r--r--tests/auto/quick/qmltests2/data/icons/favicon.pngbin3961 -> 0 bytes
-rw-r--r--tests/auto/quick/qmltests2/data/test1.html6
-rw-r--r--tests/auto/quick/qmltests2/data/test2.html6
-rw-r--r--tests/auto/quick/qmltests2/data/titleupdate.js42
-rw-r--r--tests/auto/quick/qmltests2/data/tst_favicon.qml413
-rw-r--r--tests/auto/quick/qmltests2/data/tst_faviconDownload.qml121
-rw-r--r--tests/auto/quick/qmltests2/data/tst_filePicker.qml310
-rw-r--r--tests/auto/quick/qmltests2/data/tst_inputMethod.qml77
-rw-r--r--tests/auto/quick/qmltests2/data/tst_javaScriptDialogs.qml141
-rw-r--r--tests/auto/quick/qmltests2/data/tst_linkHovered.qml131
-rw-r--r--tests/auto/quick/qmltests2/data/tst_loadFail.qml146
-rw-r--r--tests/auto/quick/qmltests2/data/tst_mouseClick.qml130
-rw-r--r--tests/auto/quick/qmltests2/mock-delegates/QtWebEngine/Controls1Delegates/AlertDialog.qml32
-rw-r--r--tests/auto/quick/qmltests2/mock-delegates/QtWebEngine/Controls1Delegates/ConfirmDialog.qml49
-rw-r--r--tests/auto/quick/qmltests2/mock-delegates/QtWebEngine/Controls1Delegates/FilePicker.qml49
-rw-r--r--tests/auto/quick/qmltests2/mock-delegates/QtWebEngine/Controls1Delegates/Menu.qml57
-rw-r--r--tests/auto/quick/qmltests2/mock-delegates/QtWebEngine/Controls1Delegates/MenuItem.qml44
-rw-r--r--tests/auto/quick/qmltests2/mock-delegates/QtWebEngine/Controls1Delegates/PromptDialog.qml52
-rw-r--r--tests/auto/quick/qmltests2/mock-delegates/QtWebEngine/Controls1Delegates/qmldir5
-rw-r--r--tests/auto/quick/qmltests2/mock-delegates/TestParams/FilePickerParams.qml37
-rw-r--r--tests/auto/quick/qmltests2/mock-delegates/TestParams/JSDialogParams.qml37
-rw-r--r--tests/auto/quick/qmltests2/mock-delegates/TestParams/qmldir4
-rw-r--r--tests/auto/quick/qmltests2/qmltests2.pro78
-rw-r--r--tests/auto/quick/qmltests2/tst_qmltests2.cpp127
-rw-r--r--tests/auto/quick/qquickwebenginedefaultsurfaceformat/CMakeLists.txt13
-rw-r--r--tests/auto/quick/qquickwebenginedefaultsurfaceformat/html/basic_page.html6
-rw-r--r--tests/auto/quick/qquickwebenginedefaultsurfaceformat/qquickwebenginedefaultsurfaceformat.pro6
-rw-r--r--tests/auto/quick/qquickwebenginedefaultsurfaceformat/tst_qquickwebenginedefaultsurfaceformat.cpp45
-rw-r--r--tests/auto/quick/qquickwebengineprofile/qquickwebengineprofile.pro1
-rw-r--r--tests/auto/quick/qquickwebengineprofile/tst_qquickwebengineprofile.cpp73
-rw-r--r--tests/auto/quick/qquickwebengineview/BLACKLIST2
-rw-r--r--tests/auto/quick/qquickwebengineview/CMakeLists.txt16
-rw-r--r--tests/auto/quick/qquickwebengineview/html/basic_page.html6
-rw-r--r--tests/auto/quick/qquickwebengineview/html/basic_page2.html (renamed from tests/auto/quick/html/basic_page2.html)0
-rw-r--r--tests/auto/quick/qquickwebengineview/html/direct-image-compositing.html (renamed from tests/auto/quick/html/direct-image-compositing.html)0
-rw-r--r--tests/auto/quick/qquickwebengineview/html/inputmethod.html (renamed from tests/auto/quick/html/inputmethod.html)0
-rw-r--r--tests/auto/quick/qquickwebengineview/html/resources/simple_image.png (renamed from tests/auto/quick/html/resources/simple_image.png)bin10585 -> 10585 bytes
-rw-r--r--tests/auto/quick/qquickwebengineview/html/scroll.html (renamed from tests/auto/quick/html/scroll.html)0
-rw-r--r--tests/auto/quick/qquickwebengineview/qquickwebengineview.pro6
-rw-r--r--tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp345
-rw-r--r--tests/auto/quick/qquickwebengineviewgraphics/CMakeLists.txt13
-rw-r--r--tests/auto/quick/qquickwebengineviewgraphics/qquickwebengineviewgraphics.pro4
-rw-r--r--tests/auto/quick/qquickwebengineviewgraphics/tst_qquickwebengineviewgraphics.cpp52
-rw-r--r--tests/auto/quick/qtbug-70248/CMakeLists.txt20
-rw-r--r--tests/auto/quick/qtbug-70248/qtbug-70248.pro5
-rw-r--r--tests/auto/quick/qtbug-70248/test.qml6
-rw-r--r--tests/auto/quick/qtbug-70248/test.qrc5
-rw-r--r--tests/auto/quick/qtbug-70248/tst_qtbug-70248.cpp33
-rw-r--r--tests/auto/quick/quick.pro22
-rw-r--r--tests/auto/quick/shared/qt_webengine_quicktest.h57
-rw-r--r--tests/auto/quick/shared/testwindow.h68
-rw-r--r--tests/auto/quick/shared/util.h190
-rw-r--r--tests/auto/quick/tests.pri20
-rw-r--r--tests/auto/quick/uidelegates/CMakeLists.txt17
-rw-r--r--tests/auto/quick/uidelegates/tst_uidelegates.cpp228
-rw-r--r--tests/auto/shared/http.pri3
-rw-r--r--tests/auto/shared/httpreqrep.cpp134
-rw-r--r--tests/auto/shared/httpreqrep.h107
-rw-r--r--tests/auto/shared/https.pri4
-rw-r--r--tests/auto/shared/httpserver.cpp100
-rw-r--r--tests/auto/shared/httpserver.h93
-rw-r--r--tests/auto/shared/httpsserver.h81
-rw-r--r--tests/auto/shared/httpsserver.qrc6
-rw-r--r--tests/auto/shared/resources/cert.pem64
-rw-r--r--tests/auto/shared/resources/key.pem27
-rw-r--r--tests/auto/util/CMakeLists.txt10
-rw-r--r--tests/auto/util/qt_webengine_quicktest.h25
-rw-r--r--tests/auto/util/quickutil.h166
-rw-r--r--tests/auto/util/testwindow.h43
-rw-r--r--tests/auto/util/util.cmake8
-rw-r--r--tests/auto/util/util.h178
-rw-r--r--tests/auto/util/widgetutil.h28
-rw-r--r--tests/auto/widgets/CMakeLists.txt32
-rw-r--r--tests/auto/widgets/accessibility/BLACKLIST5
-rw-r--r--tests/auto/widgets/accessibility/CMakeLists.txt13
-rw-r--r--tests/auto/widgets/accessibility/accessibility.pro1
-rw-r--r--tests/auto/widgets/accessibility/tst_accessibility.cpp164
-rw-r--r--tests/auto/widgets/certificateerror/certificateerror.pro3
-rw-r--r--tests/auto/widgets/certificateerror/tst_certificateerror.cpp124
-rw-r--r--tests/auto/widgets/defaultsurfaceformat/CMakeLists.txt23
-rw-r--r--tests/auto/widgets/defaultsurfaceformat/defaultsurfaceformat.pro1
-rw-r--r--tests/auto/widgets/defaultsurfaceformat/tst_defaultsurfaceformat.cpp31
-rw-r--r--tests/auto/widgets/defaultsurfaceformat/tst_defaultsurfaceformat.qrc5
-rw-r--r--tests/auto/widgets/devtools/devtools.pro1
-rw-r--r--tests/auto/widgets/devtools/tst_devtools.cpp87
-rw-r--r--tests/auto/widgets/favicon/CMakeLists.txt32
-rw-r--r--tests/auto/widgets/favicon/resources/favicon-misc.html11
-rw-r--r--tests/auto/widgets/favicon/resources/favicon-multi.html9
-rw-r--r--tests/auto/widgets/favicon/resources/favicon-shortcut.html (renamed from tests/auto/widgets/faviconmanager/resources/favicon-shortcut.html)0
-rw-r--r--tests/auto/widgets/favicon/resources/favicon-single.html (renamed from tests/auto/widgets/faviconmanager/resources/favicon-single.html)0
-rw-r--r--tests/auto/widgets/favicon/resources/favicon-touch.html (renamed from tests/auto/widgets/faviconmanager/resources/favicon-touch.html)0
-rw-r--r--tests/auto/widgets/favicon/resources/favicon-unavailable.html (renamed from tests/auto/widgets/faviconmanager/resources/favicon-unavailable.html)0
-rw-r--r--tests/auto/widgets/favicon/resources/icons/qt144.png (renamed from tests/auto/widgets/faviconmanager/resources/icons/qt144.png)bin8315 -> 8315 bytes
-rw-r--r--tests/auto/widgets/favicon/resources/icons/qt32.ico (renamed from tests/auto/widgets/faviconmanager/resources/icons/qt32.ico)bin4286 -> 4286 bytes
-rw-r--r--tests/auto/widgets/favicon/resources/icons/qtmulti.ico (renamed from tests/auto/widgets/faviconmanager/resources/icons/qtmulti.ico)bin22382 -> 22382 bytes
-rw-r--r--tests/auto/widgets/favicon/resources/test1.html (renamed from tests/auto/widgets/faviconmanager/resources/test1.html)0
-rw-r--r--tests/auto/widgets/favicon/tst_favicon.cpp869
-rw-r--r--tests/auto/widgets/faviconmanager/faviconmanager.pro1
-rw-r--r--tests/auto/widgets/faviconmanager/resources/favicon-misc.html11
-rw-r--r--tests/auto/widgets/faviconmanager/resources/favicon-multi.html9
-rw-r--r--tests/auto/widgets/faviconmanager/tst_faviconmanager.cpp551
-rw-r--r--tests/auto/widgets/faviconmanager/tst_faviconmanager.qrc14
-rw-r--r--tests/auto/widgets/loadsignals/BLACKLIST14
-rw-r--r--tests/auto/widgets/loadsignals/CMakeLists.txt63
-rw-r--r--tests/auto/widgets/loadsignals/loadsignals.pro1
-rw-r--r--tests/auto/widgets/loadsignals/resources/page1.html8
-rw-r--r--tests/auto/widgets/loadsignals/resources/page2.html14
-rw-r--r--tests/auto/widgets/loadsignals/tst_loadsignals.cpp609
-rw-r--r--tests/auto/widgets/loadsignals/tst_loadsignals.qrc9
-rw-r--r--tests/auto/widgets/offscreen/CMakeLists.txt25
-rw-r--r--tests/auto/widgets/offscreen/offscreen.pro6
-rw-r--r--tests/auto/widgets/offscreen/tst_offscreen.cpp32
-rw-r--r--tests/auto/widgets/offscreen/tst_offscreen.qrc6
-rw-r--r--tests/auto/widgets/origins/origins.pro7
-rw-r--r--tests/auto/widgets/origins/resources/mixedSchemes.html31
-rw-r--r--tests/auto/widgets/origins/resources/mixedSchemes_frame.html11
-rw-r--r--tests/auto/widgets/origins/resources/redirect.css8
-rw-r--r--tests/auto/widgets/origins/resources/redirect.html10
-rw-r--r--tests/auto/widgets/origins/tst_origins.cpp874
-rw-r--r--tests/auto/widgets/origins/tst_origins.qrc22
-rw-r--r--tests/auto/widgets/printing/CMakeLists.txt34
-rw-r--r--tests/auto/widgets/printing/printing.pro10
-rw-r--r--tests/auto/widgets/printing/tst_printing.cpp156
-rw-r--r--tests/auto/widgets/printing/tst_printing.qrc5
-rw-r--r--tests/auto/widgets/proxy/CMakeLists.txt12
-rw-r--r--tests/auto/widgets/proxy/proxy.pro9
-rw-r--r--tests/auto/widgets/proxy/proxy_server.cpp102
-rw-r--r--tests/auto/widgets/proxy/proxy_server.h64
-rw-r--r--tests/auto/widgets/proxy/tst_proxy.cpp49
-rw-r--r--tests/auto/widgets/proxypac/CMakeLists.txt64
-rw-r--r--tests/auto/widgets/proxypac/proxy.pac2
-rw-r--r--tests/auto/widgets/proxypac/proxypac.pri5
-rw-r--r--tests/auto/widgets/proxypac/proxypac.pro4
-rw-r--r--tests/auto/widgets/proxypac/proxypac.qrc7
-rw-r--r--tests/auto/widgets/proxypac/proxypac_file/proxypac_file.pro9
-rw-r--r--tests/auto/widgets/proxypac/proxypac_qrc/proxypac_qrc.pro7
-rw-r--r--tests/auto/widgets/proxypac/proxyserver.cpp29
-rw-r--r--tests/auto/widgets/proxypac/proxyserver.h29
-rw-r--r--tests/auto/widgets/proxypac/tst_proxypac.cpp56
-rw-r--r--tests/auto/widgets/qtbug_110287/CMakeLists.txt11
-rw-r--r--tests/auto/widgets/qtbug_110287/tst_qtbug_110287.cpp41
-rw-r--r--tests/auto/widgets/qwebenginedownloaditem/qwebenginedownloaditem.pro3
-rw-r--r--tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp1422
-rw-r--r--tests/auto/widgets/qwebenginedownloadrequest/CMakeLists.txt14
-rw-r--r--tests/auto/widgets/qwebenginedownloadrequest/tst_qwebenginedownloadrequest.cpp1286
-rw-r--r--tests/auto/widgets/qwebenginehistory/CMakeLists.txt29
-rw-r--r--tests/auto/widgets/qwebenginehistory/qwebenginehistory.pro1
-rw-r--r--tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.cpp47
-rw-r--r--tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.qrc10
-rw-r--r--tests/auto/widgets/qwebenginepage/BLACKLIST11
-rw-r--r--tests/auto/widgets/qwebenginepage/CMakeLists.txt68
-rw-r--r--tests/auto/widgets/qwebenginepage/qwebenginepage.pro3
-rw-r--r--tests/auto/widgets/qwebenginepage/resources/fontaccess.html14
-rw-r--r--tests/auto/widgets/qwebenginepage/resources/image2.png (renamed from tests/auto/widgets/resources/image2.png)bin14743 -> 14743 bytes
-rw-r--r--tests/auto/widgets/qwebenginepage/resources/redirect.html8
-rw-r--r--tests/auto/widgets/qwebenginepage/resources/reload.html2
-rw-r--r--tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp2106
-rw-r--r--tests/auto/widgets/qwebenginepage/tst_qwebenginepage.qrc31
-rw-r--r--tests/auto/widgets/qwebengineprofile/CMakeLists.txt14
-rw-r--r--tests/auto/widgets/qwebengineprofile/qwebengineprofile.pro4
-rw-r--r--tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp318
-rw-r--r--tests/auto/widgets/qwebenginescript/CMakeLists.txt29
-rw-r--r--tests/auto/widgets/qwebenginescript/qwebenginescript.pro1
-rw-r--r--tests/auto/widgets/qwebenginescript/resources/test_window_open.html2
-rw-r--r--tests/auto/widgets/qwebenginescript/tst_qwebenginescript.cpp171
-rw-r--r--tests/auto/widgets/qwebenginescript/tst_qwebenginescript.qrc11
-rw-r--r--tests/auto/widgets/qwebenginesettings/qwebenginesettings.pro2
-rw-r--r--tests/auto/widgets/qwebenginesettings/tst_qwebenginesettings.cpp198
-rw-r--r--tests/auto/widgets/qwebengineview/BLACKLIST14
-rw-r--r--tests/auto/widgets/qwebengineview/CMakeLists.txt33
-rw-r--r--tests/auto/widgets/qwebengineview/qwebengineview.pro2
-rw-r--r--tests/auto/widgets/qwebengineview/resources/dummy.html6
-rw-r--r--tests/auto/widgets/qwebengineview/resources/test.swf (renamed from tests/auto/widgets/resources/test.swf)bin10085 -> 10085 bytes
-rw-r--r--tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp1302
-rw-r--r--tests/auto/widgets/qwebengineview/tst_qwebengineview.qrc10
-rw-r--r--tests/auto/widgets/schemes/CMakeLists.txt13
-rw-r--r--tests/auto/widgets/schemes/schemes.pro3
-rw-r--r--tests/auto/widgets/schemes/tst_schemes.cpp215
-rw-r--r--tests/auto/widgets/shutdown/CMakeLists.txt9
-rw-r--r--tests/auto/widgets/shutdown/shutdown.pro1
-rw-r--r--tests/auto/widgets/shutdown/tst_shutdown.cpp40
-rw-r--r--tests/auto/widgets/spellchecking/CMakeLists.txt33
-rw-r--r--tests/auto/widgets/spellchecking/spellchecking.pro24
-rw-r--r--tests/auto/widgets/spellchecking/tst_spellchecking.cpp67
-rw-r--r--tests/auto/widgets/spellchecking/tst_spellchecking.qrc5
-rw-r--r--tests/auto/widgets/tests.pri22
-rw-r--r--tests/auto/widgets/touchinput/CMakeLists.txt13
-rw-r--r--tests/auto/widgets/touchinput/tst_touchinput.cpp372
-rw-r--r--tests/auto/widgets/util.h194
-rw-r--r--tests/auto/widgets/widgets.pro51
-rw-r--r--tests/manual/CMakeLists.txt7
-rw-r--r--tests/manual/examples/CMakeLists.txt6
-rw-r--r--tests/manual/examples/quick/CMakeLists.txt4
-rw-r--r--tests/manual/examples/quick/customdialogs/CMakeLists.txt56
-rw-r--r--tests/manual/examples/quick/customdialogs/MessageRectangle.qml18
-rw-r--r--tests/manual/examples/quick/customdialogs/SwitchButton.qml23
-rw-r--r--tests/manual/examples/quick/customdialogs/WebView.qml117
-rw-r--r--tests/manual/examples/quick/customdialogs/customdialogs.pro18
-rw-r--r--tests/manual/examples/quick/customdialogs/customdialogs.qrc24
-rw-r--r--tests/manual/examples/quick/customdialogs/forms/Authentication.qml31
-rw-r--r--tests/manual/examples/quick/customdialogs/forms/AuthenticationForm.ui.qml137
-rw-r--r--tests/manual/examples/quick/customdialogs/forms/ColorCell.qml16
-rw-r--r--tests/manual/examples/quick/customdialogs/forms/ColorPicker.qml31
-rw-r--r--tests/manual/examples/quick/customdialogs/forms/ColorPickerForm.ui.qml186
-rw-r--r--tests/manual/examples/quick/customdialogs/forms/CustomButton.qml61
-rw-r--r--tests/manual/examples/quick/customdialogs/forms/FilePicker.qml44
-rw-r--r--tests/manual/examples/quick/customdialogs/forms/FilePickerForm.ui.qml128
-rw-r--r--tests/manual/examples/quick/customdialogs/forms/FileRow.qml44
-rw-r--r--tests/manual/examples/quick/customdialogs/forms/JavaScript.qml44
-rw-r--r--tests/manual/examples/quick/customdialogs/forms/JavaScriptForm.ui.qml117
-rw-r--r--tests/manual/examples/quick/customdialogs/forms/Menu.qml22
-rw-r--r--tests/manual/examples/quick/customdialogs/forms/MenuForm.ui.qml65
-rw-r--r--tests/manual/examples/quick/customdialogs/forms/TouchSelectionMenu.qml14
-rw-r--r--tests/manual/examples/quick/customdialogs/forms/TouchSelectionMenuForm.ui.qml39
-rw-r--r--tests/manual/examples/quick/customdialogs/forms/forms.qmlproject45
-rw-r--r--tests/manual/examples/quick/customdialogs/icon.svg (renamed from examples/webengine/customdialogs/icon.svg)0
-rw-r--r--tests/manual/examples/quick/customdialogs/index.html51
-rw-r--r--tests/manual/examples/quick/customdialogs/main.cpp32
-rw-r--r--tests/manual/examples/quick/customdialogs/main.qml56
-rw-r--r--tests/manual/examples/quick/customdialogs/server.cpp47
-rw-r--r--tests/manual/examples/quick/customdialogs/server.h29
-rw-r--r--tests/manual/examples/quick/customdialogs/style.css (renamed from examples/webengine/customdialogs/style.css)0
-rw-r--r--tests/manual/examples/quick/customtouchhandle/CMakeLists.txt36
-rw-r--r--tests/manual/examples/quick/customtouchhandle/customtouchhandle.pro10
-rw-r--r--tests/manual/examples/quick/customtouchhandle/main.cpp19
-rw-r--r--tests/manual/examples/quick/customtouchhandle/main.qml96
-rw-r--r--tests/manual/examples/quick/customtouchhandle/qml.qrc (renamed from examples/webengine/webengineaction/qml.qrc)0
-rw-r--r--tests/manual/examples/quick/minimal/CMakeLists.txt36
-rw-r--r--tests/manual/examples/quick/minimal/main.cpp19
-rw-r--r--tests/manual/examples/quick/minimal/main.qml16
-rw-r--r--tests/manual/examples/quick/minimal/minimal.pro10
-rw-r--r--tests/manual/examples/quick/minimal/qml.qrc (renamed from examples/webengine/minimal/qml.qrc)0
-rw-r--r--tests/manual/examples/quick/webengineaction/CMakeLists.txt37
-rw-r--r--tests/manual/examples/quick/webengineaction/main.cpp25
-rw-r--r--tests/manual/examples/quick/webengineaction/main.qml119
-rw-r--r--tests/manual/examples/quick/webengineaction/qml.qrc5
-rw-r--r--tests/manual/examples/quick/webengineaction/utils.h25
-rw-r--r--tests/manual/examples/quick/webengineaction/webengineaction.pro8
-rw-r--r--tests/manual/examples/widgets/CMakeLists.txt1
-rw-r--r--tests/manual/examples/widgets/minimal/CMakeLists.txt24
-rw-r--r--tests/manual/examples/widgets/minimal/main.cpp28
-rw-r--r--tests/manual/examples/widgets/minimal/minimal.pro (renamed from examples/webenginewidgets/minimal/minimal.pro)0
-rw-r--r--tests/manual/manual.pro7
-rw-r--r--tests/manual/quick/CMakeLists.txt2
-rw-r--r--tests/manual/quick/faviconbrowser/AddressBar.qml102
-rw-r--r--tests/manual/quick/faviconbrowser/FaviconPanel.qml234
-rw-r--r--tests/manual/quick/faviconbrowser/faviconbrowser.pro23
-rw-r--r--tests/manual/quick/faviconbrowser/faviconbrowser.qrc17
-rw-r--r--tests/manual/quick/faviconbrowser/main.cpp54
-rw-r--r--tests/manual/quick/faviconbrowser/main.qml170
-rw-r--r--tests/manual/quick/faviconbrowser/utils.h49
-rw-r--r--tests/manual/quick/geopermission/CMakeLists.txt63
-rw-r--r--tests/manual/quick/geopermission/Info.plist32
-rw-r--r--tests/manual/quick/geopermission/geolocation.html32
-rw-r--r--tests/manual/quick/geopermission/main.cpp39
-rw-r--r--tests/manual/quick/geopermission/tst_geopermission.qml28
-rw-r--r--tests/manual/quick/pdf/bookmarks-list.qml136
-rw-r--r--tests/manual/quick/pdf/bookmarks.qml147
-rw-r--r--tests/manual/quick/pdf/gridview.qml62
-rw-r--r--tests/manual/quick/pdf/listview.qml58
-rw-r--r--tests/manual/quick/pdf/multipleDocuments.qml182
-rw-r--r--tests/manual/quick/pdf/pdfPageView.qml316
-rw-r--r--tests/manual/quick/pdf/pessimizedListView.qml69
-rw-r--r--tests/manual/quick/pdf/simplest.qml53
-rw-r--r--tests/manual/quick/pdf/test.pdfbin80045 -> 76633 bytes
-rw-r--r--tests/manual/quick/pdf/underscoredLinks.qml146
-rw-r--r--tests/manual/quick/pdf/withdoc.qml99
-rw-r--r--tests/manual/quick/quick.pro4
-rw-r--r--tests/manual/quick/touchbrowser/AddressBar.qml73
-rw-r--r--tests/manual/quick/touchbrowser/CMakeLists.txt31
-rw-r--r--tests/manual/quick/touchbrowser/MockTouchPoint.qml26
-rw-r--r--tests/manual/quick/touchbrowser/main.cpp52
-rw-r--r--tests/manual/quick/touchbrowser/main.qml40
-rw-r--r--tests/manual/quick/touchbrowser/resources.qrc7
-rw-r--r--tests/manual/quick/touchbrowser/touchbrowser.pro15
-rw-r--r--tests/manual/touchmocking/touchmockingapplication.cpp78
-rw-r--r--tests/manual/touchmocking/touchmockingapplication.h35
-rw-r--r--tests/manual/touchmocking/touchpoint.pngbin0 -> 1331 bytes
-rw-r--r--tests/manual/touchmocking/utils.h25
-rw-r--r--tests/manual/widgets/CMakeLists.txt9
-rw-r--r--tests/manual/widgets/geolocation/CMakeLists.txt55
-rw-r--r--tests/manual/widgets/geolocation/Info.plist32
-rw-r--r--tests/manual/widgets/geolocation/geolocation.html32
-rw-r--r--tests/manual/widgets/geolocation/main.cpp51
-rw-r--r--tests/manual/widgets/inputmethods/CMakeLists.txt37
-rw-r--r--tests/manual/widgets/inputmethods/colorpicker.cpp30
-rw-r--r--tests/manual/widgets/inputmethods/colorpicker.h31
-rw-r--r--tests/manual/widgets/inputmethods/controlview.cpp41
-rw-r--r--tests/manual/widgets/inputmethods/controlview.h41
-rw-r--r--tests/manual/widgets/inputmethods/main.cpp83
-rw-r--r--tests/manual/widgets/inputmethods/referenceview.cpp29
-rw-r--r--tests/manual/widgets/inputmethods/referenceview.h29
-rw-r--r--tests/manual/widgets/inputmethods/testview.cpp46
-rw-r--r--tests/manual/widgets/inputmethods/testview.h33
-rw-r--r--tests/manual/widgets/inputmethods/webview.cpp29
-rw-r--r--tests/manual/widgets/inputmethods/webview.h29
-rw-r--r--tests/manual/widgets/touchbrowser/CMakeLists.txt30
-rw-r--r--tests/manual/widgets/touchbrowser/main.cpp62
-rw-r--r--tests/manual/widgets/touchbrowser/resources.qrc5
-rw-r--r--tests/manual/widgets/touchbrowser/touchbrowser.pro15
-rw-r--r--tests/manual/widgets/webgl/CMakeLists.txt20
-rw-r--r--tests/manual/widgets/webgl/main.cpp29
-rw-r--r--tests/manual/widgets/webrtc/CMakeLists.txt24
-rw-r--r--tests/manual/widgets/webrtc/index.html86
-rw-r--r--tests/manual/widgets/webrtc/main.cpp112
-rw-r--r--tests/manual/widgets/webrtc/mediaPicker.ui118
-rw-r--r--tests/manual/widgets/webrtc/qrc.qrc5
-rw-r--r--tests/manual/widgets/widgets.pro5
-rw-r--r--tests/quicktestbrowser/ApplicationRoot.qml68
-rw-r--r--tests/quicktestbrowser/BrowserDialog.qml44
-rw-r--r--tests/quicktestbrowser/BrowserWindow.qml532
-rw-r--r--tests/quicktestbrowser/ButtonWithMenu.qml58
-rw-r--r--tests/quicktestbrowser/DownloadView.qml153
-rw-r--r--tests/quicktestbrowser/FeaturePermissionBar.qml92
-rw-r--r--tests/quicktestbrowser/FullScreenNotification.qml87
-rw-r--r--tests/quicktestbrowser/ZoomController.qml90
-rw-r--r--tests/quicktestbrowser/main.cpp96
-rw-r--r--tests/quicktestbrowser/quicktestbrowser.pro26
-rw-r--r--tests/quicktestbrowser/resources.qrc19
-rw-r--r--tests/quicktestbrowser/utils.h54
-rw-r--r--tests/tests.pro7
-rw-r--r--tools/about_credits_entry.tmpl12
-rwxr-xr-xtools/buildscripts/qtwebengine_utils.py32
-rwxr-xr-xtools/buildscripts/repack_locales.py41
-rwxr-xr-xtools/scripts/check_patches.py30
-rw-r--r--tools/scripts/cipd_package.py103
-rwxr-xr-xtools/scripts/get_version.py30
-rw-r--r--tools/scripts/git_submodule.py105
-rw-r--r--tools/scripts/gn_find_mocables.py31
-rw-r--r--tools/scripts/gn_run_binary.py29
-rwxr-xr-xtools/scripts/init-repository.py64
-rwxr-xr-xtools/scripts/make_archive.sh30
-rwxr-xr-xtools/scripts/patch_upstream.py30
-rwxr-xr-xtools/scripts/take_snapshot.py389
-rwxr-xr-xtools/scripts/update_change_ids.py30
-rw-r--r--tools/scripts/version_resolver.py99
-rwxr-xr-xtools/scripts/windeploy-examples.py30
2024 files changed, 152806 insertions, 109437 deletions
diff --git a/.clang-format b/.clang-format
index 3399f428c..e7f5352cc 100644
--- a/.clang-format
+++ b/.clang-format
@@ -1,7 +1,5 @@
# Copyright (C) 2016 Olivier Goffart <ogoffart@woboq.com>
-#
-# You may use this file under the terms of the 3-clause BSD license.
-# See the file LICENSE from this package for details.
+# SPDX-License-Identifier: BSD-3-Clause
# This is the clang-format configuration style to be used by Qt,
# based on the rules from https://wiki.qt.io/Qt_Coding_Style and
@@ -11,7 +9,7 @@
# Webkit style was loosely based on the Qt style
BasedOnStyle: WebKit
-Standard: Cpp11
+Standard: c++17
# Column width is limited to 100 in accordance with Qt Coding Style.
# https://wiki.qt.io/Qt_Coding_Style
@@ -20,9 +18,10 @@ ColumnLimit: 100
# How much weight do extra characters after the line length limit have.
# PenaltyExcessCharacter: 4
-# Disable reflow of qdoc comments: indentation rules are different.
-# Translation comments are also excluded.
-CommentPragmas: "^!|^:"
+# Disable reflow of some specific comments
+# qdoc comments: indentation rules are different.
+# Translation comments and SPDX license identifiers are also excluded.
+CommentPragmas: "^!|^:|^ SPDX-License-Identifier:"
# We want a space between the type and the star for pointer types.
PointerBindsToType: false
@@ -60,7 +59,7 @@ ContinuationIndentWidth: 8
NamespaceIndentation: None
# Allow indentation for preprocessing directives (if/ifdef/endif). https://reviews.llvm.org/rL312125
-IndentPPDirectives: AfterHash
+# IndentPPDirectives: AfterHash - Redefined for QtWebEngine Qt Style
# Horizontally align arguments after an open bracket.
# The coding style does not specify the following, but this is what gives
@@ -82,7 +81,11 @@ SortIncludes: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH, forever, Q_FOREVER, QBENCHMARK, QBENCHMARK_ONCE ]
# Break constructor initializers before the colon and after the commas.
-BreakConstructorInitializers: BeforeColon
+# BreakConstructorInitializers: BeforeColon - Redefined for QtWebEngine Qt Style
+
+# Avoids the addition of a space between an identifier and the
+# initializer list in list-initialization.
+SpaceBeforeCpp11BracedList: false
################################################################################
# QtWebEngine specific changes to Qt style
@@ -90,6 +93,9 @@ BreakConstructorInitializers: BeforeColon
# We are using BeforeComma consistently so don't change it
BreakConstructorInitializers: BeforeComma
+# Disable indentation for preprocessing directives. Looks confusing at includes.
+IndentPPDirectives: None
+
# Chromium macros
MacroBlockBegin: "^\
IPC_BEGIN_MESSAGE_MAP|\
diff --git a/.cmake.conf b/.cmake.conf
new file mode 100644
index 000000000..8c2e0e672
--- /dev/null
+++ b/.cmake.conf
@@ -0,0 +1,5 @@
+set(QT_REPO_MODULE_VERSION "6.8.0")
+set(QT_REPO_MODULE_PRERELEASE_VERSION_SEGMENT "alpha1")
+set(QT_SUPPORTED_MIN_CMAKE_VERSION_FOR_BUILDING_WEBENGINE "3.19")
+set(QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_NO_AS_CONST=1")
+list(APPEND QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_NO_FOREACH=1")
diff --git a/.qmake.conf b/.qmake.conf
deleted file mode 100644
index a942dacce..000000000
--- a/.qmake.conf
+++ /dev/null
@@ -1,8 +0,0 @@
-# Resolve root directories for sources
-QTWEBENGINE_ROOT = $$PWD
-QTWEBENGINE_OUT_ROOT = $$shadowed($$PWD)
-
-load(qt_build_config)
-CONFIG += warning_clean
-
-MODULE_VERSION = 5.15.0
diff --git a/CHROMIUM_VERSION b/CHROMIUM_VERSION
new file mode 100644
index 000000000..8bdc0df63
--- /dev/null
+++ b/CHROMIUM_VERSION
@@ -0,0 +1,3 @@
+
+Based on Chromium version: 118.0.5993.220
+Patched with security patches up to Chromium version: 122.0.6261.128
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 000000000..7d4638139
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,42 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+# Require the Qt (not WebEngine) minimum supported CMake version.
+# Another WebEngine-specific version check will be done in configure.cmake
+# and reported in the configure summary.
+cmake_minimum_required(VERSION 3.16)
+
+include(.cmake.conf)
+include(ExternalProject)
+include(cmake/Functions.cmake)
+
+project(QtWebEngineDummy)
+find_package(Qt6 6.5 CONFIG REQUIRED COMPONENTS BuildInternals Core)
+
+project(QtWebEngine
+ VERSION ${Qt6Core_VERSION}
+ DESCRIPTION "QtWebEngine and QtPdf modules"
+ HOMEPAGE_URL "https://qt.io/"
+ LANGUAGES CXX C
+)
+qt_internal_project_setup()
+
+find_package(Qt6 ${PROJECT_VERSION} CONFIG QUIET OPTIONAL_COMPONENTS
+ Gui Widgets Network OpenGL Quick Qml PrintSupport
+ WebChannel WebChannelQuick Positioning QuickControls2
+ Test QuickWidgets QuickTest WebSockets Designer
+ JpegPrivate PngPrivate HarfbuzzPrivate FreetypePrivate ZlibPrivate
+ HttpServer
+)
+
+if(MATRIX_BUILD AND NOT MATRIX_SUBBUILD AND NOT QT_SUPERBUILD)
+ add_build(webengine_webrtc OFF)
+ add_build(webengine_proprietary_codecs ON)
+ add_build(webengine_printing_and_pdf OFF)
+ add_build(webengine_extensions OFF)
+ add_build(webengine_spellchecker OFF)
+ add_build(qtwebengine_build OFF)
+ return()
+endif()
+
+qt_build_repo()
diff --git a/LICENSE.FDL b/LICENSE.FDL
deleted file mode 100644
index 086177c0a..000000000
--- a/LICENSE.FDL
+++ /dev/null
@@ -1,450 +0,0 @@
- GNU Free Documentation License
- Version 1.3, 3 November 2008
-
-
- Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
- <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-0. PREAMBLE
-
-The purpose of this License is to make a manual, textbook, or other
-functional and useful document "free" in the sense of freedom: to
-assure everyone the effective freedom to copy and redistribute it,
-with or without modifying it, either commercially or noncommercially.
-Secondarily, this License preserves for the author and publisher a way
-to get credit for their work, while not being considered responsible
-for modifications made by others.
-
-This License is a kind of "copyleft", which means that derivative
-works of the document must themselves be free in the same sense. It
-complements the GNU General Public License, which is a copyleft
-license designed for free software.
-
-We have designed this License in order to use it for manuals for free
-software, because free software needs free documentation: a free
-program should come with manuals providing the same freedoms that the
-software does. But this License is not limited to software manuals;
-it can be used for any textual work, regardless of subject matter or
-whether it is published as a printed book. We recommend this License
-principally for works whose purpose is instruction or reference.
-
-
-1. APPLICABILITY AND DEFINITIONS
-
-This License applies to any manual or other work, in any medium, that
-contains a notice placed by the copyright holder saying it can be
-distributed under the terms of this License. Such a notice grants a
-world-wide, royalty-free license, unlimited in duration, to use that
-work under the conditions stated herein. The "Document", below,
-refers to any such manual or work. Any member of the public is a
-licensee, and is addressed as "you". You accept the license if you
-copy, modify or distribute the work in a way requiring permission
-under copyright law.
-
-A "Modified Version" of the Document means any work containing the
-Document or a portion of it, either copied verbatim, or with
-modifications and/or translated into another language.
-
-A "Secondary Section" is a named appendix or a front-matter section of
-the Document that deals exclusively with the relationship of the
-publishers or authors of the Document to the Document's overall
-subject (or to related matters) and contains nothing that could fall
-directly within that overall subject. (Thus, if the Document is in
-part a textbook of mathematics, a Secondary Section may not explain
-any mathematics.) The relationship could be a matter of historical
-connection with the subject or with related matters, or of legal,
-commercial, philosophical, ethical or political position regarding
-them.
-
-The "Invariant Sections" are certain Secondary Sections whose titles
-are designated, as being those of Invariant Sections, in the notice
-that says that the Document is released under this License. If a
-section does not fit the above definition of Secondary then it is not
-allowed to be designated as Invariant. The Document may contain zero
-Invariant Sections. If the Document does not identify any Invariant
-Sections then there are none.
-
-The "Cover Texts" are certain short passages of text that are listed,
-as Front-Cover Texts or Back-Cover Texts, in the notice that says that
-the Document is released under this License. A Front-Cover Text may
-be at most 5 words, and a Back-Cover Text may be at most 25 words.
-
-A "Transparent" copy of the Document means a machine-readable copy,
-represented in a format whose specification is available to the
-general public, that is suitable for revising the document
-straightforwardly with generic text editors or (for images composed of
-pixels) generic paint programs or (for drawings) some widely available
-drawing editor, and that is suitable for input to text formatters or
-for automatic translation to a variety of formats suitable for input
-to text formatters. A copy made in an otherwise Transparent file
-format whose markup, or absence of markup, has been arranged to thwart
-or discourage subsequent modification by readers is not Transparent.
-An image format is not Transparent if used for any substantial amount
-of text. A copy that is not "Transparent" is called "Opaque".
-
-Examples of suitable formats for Transparent copies include plain
-ASCII without markup, Texinfo input format, LaTeX input format, SGML
-or XML using a publicly available DTD, and standard-conforming simple
-HTML, PostScript or PDF designed for human modification. Examples of
-transparent image formats include PNG, XCF and JPG. Opaque formats
-include proprietary formats that can be read and edited only by
-proprietary word processors, SGML or XML for which the DTD and/or
-processing tools are not generally available, and the
-machine-generated HTML, PostScript or PDF produced by some word
-processors for output purposes only.
-
-The "Title Page" means, for a printed book, the title page itself,
-plus such following pages as are needed to hold, legibly, the material
-this License requires to appear in the title page. For works in
-formats which do not have any title page as such, "Title Page" means
-the text near the most prominent appearance of the work's title,
-preceding the beginning of the body of the text.
-
-The "publisher" means any person or entity that distributes copies of
-the Document to the public.
-
-A section "Entitled XYZ" means a named subunit of the Document whose
-title either is precisely XYZ or contains XYZ in parentheses following
-text that translates XYZ in another language. (Here XYZ stands for a
-specific section name mentioned below, such as "Acknowledgements",
-"Dedications", "Endorsements", or "History".) To "Preserve the Title"
-of such a section when you modify the Document means that it remains a
-section "Entitled XYZ" according to this definition.
-
-The Document may include Warranty Disclaimers next to the notice which
-states that this License applies to the Document. These Warranty
-Disclaimers are considered to be included by reference in this
-License, but only as regards disclaiming warranties: any other
-implication that these Warranty Disclaimers may have is void and has
-no effect on the meaning of this License.
-
-2. VERBATIM COPYING
-
-You may copy and distribute the Document in any medium, either
-commercially or noncommercially, provided that this License, the
-copyright notices, and the license notice saying this License applies
-to the Document are reproduced in all copies, and that you add no
-other conditions whatsoever to those of this License. You may not use
-technical measures to obstruct or control the reading or further
-copying of the copies you make or distribute. However, you may accept
-compensation in exchange for copies. If you distribute a large enough
-number of copies you must also follow the conditions in section 3.
-
-You may also lend copies, under the same conditions stated above, and
-you may publicly display copies.
-
-
-3. COPYING IN QUANTITY
-
-If you publish printed copies (or copies in media that commonly have
-printed covers) of the Document, numbering more than 100, and the
-Document's license notice requires Cover Texts, you must enclose the
-copies in covers that carry, clearly and legibly, all these Cover
-Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
-the back cover. Both covers must also clearly and legibly identify
-you as the publisher of these copies. The front cover must present
-the full title with all words of the title equally prominent and
-visible. You may add other material on the covers in addition.
-Copying with changes limited to the covers, as long as they preserve
-the title of the Document and satisfy these conditions, can be treated
-as verbatim copying in other respects.
-
-If the required texts for either cover are too voluminous to fit
-legibly, you should put the first ones listed (as many as fit
-reasonably) on the actual cover, and continue the rest onto adjacent
-pages.
-
-If you publish or distribute Opaque copies of the Document numbering
-more than 100, you must either include a machine-readable Transparent
-copy along with each Opaque copy, or state in or with each Opaque copy
-a computer-network location from which the general network-using
-public has access to download using public-standard network protocols
-a complete Transparent copy of the Document, free of added material.
-If you use the latter option, you must take reasonably prudent steps,
-when you begin distribution of Opaque copies in quantity, to ensure
-that this Transparent copy will remain thus accessible at the stated
-location until at least one year after the last time you distribute an
-Opaque copy (directly or through your agents or retailers) of that
-edition to the public.
-
-It is requested, but not required, that you contact the authors of the
-Document well before redistributing any large number of copies, to
-give them a chance to provide you with an updated version of the
-Document.
-
-
-4. MODIFICATIONS
-
-You may copy and distribute a Modified Version of the Document under
-the conditions of sections 2 and 3 above, provided that you release
-the Modified Version under precisely this License, with the Modified
-Version filling the role of the Document, thus licensing distribution
-and modification of the Modified Version to whoever possesses a copy
-of it. In addition, you must do these things in the Modified Version:
-
-A. Use in the Title Page (and on the covers, if any) a title distinct
- from that of the Document, and from those of previous versions
- (which should, if there were any, be listed in the History section
- of the Document). You may use the same title as a previous version
- if the original publisher of that version gives permission.
-B. List on the Title Page, as authors, one or more persons or entities
- responsible for authorship of the modifications in the Modified
- Version, together with at least five of the principal authors of the
- Document (all of its principal authors, if it has fewer than five),
- unless they release you from this requirement.
-C. State on the Title page the name of the publisher of the
- Modified Version, as the publisher.
-D. Preserve all the copyright notices of the Document.
-E. Add an appropriate copyright notice for your modifications
- adjacent to the other copyright notices.
-F. Include, immediately after the copyright notices, a license notice
- giving the public permission to use the Modified Version under the
- terms of this License, in the form shown in the Addendum below.
-G. Preserve in that license notice the full lists of Invariant Sections
- and required Cover Texts given in the Document's license notice.
-H. Include an unaltered copy of this License.
-I. Preserve the section Entitled "History", Preserve its Title, and add
- to it an item stating at least the title, year, new authors, and
- publisher of the Modified Version as given on the Title Page. If
- there is no section Entitled "History" in the Document, create one
- stating the title, year, authors, and publisher of the Document as
- given on its Title Page, then add an item describing the Modified
- Version as stated in the previous sentence.
-J. Preserve the network location, if any, given in the Document for
- public access to a Transparent copy of the Document, and likewise
- the network locations given in the Document for previous versions
- it was based on. These may be placed in the "History" section.
- You may omit a network location for a work that was published at
- least four years before the Document itself, or if the original
- publisher of the version it refers to gives permission.
-K. For any section Entitled "Acknowledgements" or "Dedications",
- Preserve the Title of the section, and preserve in the section all
- the substance and tone of each of the contributor acknowledgements
- and/or dedications given therein.
-L. Preserve all the Invariant Sections of the Document,
- unaltered in their text and in their titles. Section numbers
- or the equivalent are not considered part of the section titles.
-M. Delete any section Entitled "Endorsements". Such a section
- may not be included in the Modified Version.
-N. Do not retitle any existing section to be Entitled "Endorsements"
- or to conflict in title with any Invariant Section.
-O. Preserve any Warranty Disclaimers.
-
-If the Modified Version includes new front-matter sections or
-appendices that qualify as Secondary Sections and contain no material
-copied from the Document, you may at your option designate some or all
-of these sections as invariant. To do this, add their titles to the
-list of Invariant Sections in the Modified Version's license notice.
-These titles must be distinct from any other section titles.
-
-You may add a section Entitled "Endorsements", provided it contains
-nothing but endorsements of your Modified Version by various
-parties--for example, statements of peer review or that the text has
-been approved by an organization as the authoritative definition of a
-standard.
-
-You may add a passage of up to five words as a Front-Cover Text, and a
-passage of up to 25 words as a Back-Cover Text, to the end of the list
-of Cover Texts in the Modified Version. Only one passage of
-Front-Cover Text and one of Back-Cover Text may be added by (or
-through arrangements made by) any one entity. If the Document already
-includes a cover text for the same cover, previously added by you or
-by arrangement made by the same entity you are acting on behalf of,
-you may not add another; but you may replace the old one, on explicit
-permission from the previous publisher that added the old one.
-
-The author(s) and publisher(s) of the Document do not by this License
-give permission to use their names for publicity for or to assert or
-imply endorsement of any Modified Version.
-
-
-5. COMBINING DOCUMENTS
-
-You may combine the Document with other documents released under this
-License, under the terms defined in section 4 above for modified
-versions, provided that you include in the combination all of the
-Invariant Sections of all of the original documents, unmodified, and
-list them all as Invariant Sections of your combined work in its
-license notice, and that you preserve all their Warranty Disclaimers.
-
-The combined work need only contain one copy of this License, and
-multiple identical Invariant Sections may be replaced with a single
-copy. If there are multiple Invariant Sections with the same name but
-different contents, make the title of each such section unique by
-adding at the end of it, in parentheses, the name of the original
-author or publisher of that section if known, or else a unique number.
-Make the same adjustment to the section titles in the list of
-Invariant Sections in the license notice of the combined work.
-
-In the combination, you must combine any sections Entitled "History"
-in the various original documents, forming one section Entitled
-"History"; likewise combine any sections Entitled "Acknowledgements",
-and any sections Entitled "Dedications". You must delete all sections
-Entitled "Endorsements".
-
-
-6. COLLECTIONS OF DOCUMENTS
-
-You may make a collection consisting of the Document and other
-documents released under this License, and replace the individual
-copies of this License in the various documents with a single copy
-that is included in the collection, provided that you follow the rules
-of this License for verbatim copying of each of the documents in all
-other respects.
-
-You may extract a single document from such a collection, and
-distribute it individually under this License, provided you insert a
-copy of this License into the extracted document, and follow this
-License in all other respects regarding verbatim copying of that
-document.
-
-
-7. AGGREGATION WITH INDEPENDENT WORKS
-
-A compilation of the Document or its derivatives with other separate
-and independent documents or works, in or on a volume of a storage or
-distribution medium, is called an "aggregate" if the copyright
-resulting from the compilation is not used to limit the legal rights
-of the compilation's users beyond what the individual works permit.
-When the Document is included in an aggregate, this License does not
-apply to the other works in the aggregate which are not themselves
-derivative works of the Document.
-
-If the Cover Text requirement of section 3 is applicable to these
-copies of the Document, then if the Document is less than one half of
-the entire aggregate, the Document's Cover Texts may be placed on
-covers that bracket the Document within the aggregate, or the
-electronic equivalent of covers if the Document is in electronic form.
-Otherwise they must appear on printed covers that bracket the whole
-aggregate.
-
-
-8. TRANSLATION
-
-Translation is considered a kind of modification, so you may
-distribute translations of the Document under the terms of section 4.
-Replacing Invariant Sections with translations requires special
-permission from their copyright holders, but you may include
-translations of some or all Invariant Sections in addition to the
-original versions of these Invariant Sections. You may include a
-translation of this License, and all the license notices in the
-Document, and any Warranty Disclaimers, provided that you also include
-the original English version of this License and the original versions
-of those notices and disclaimers. In case of a disagreement between
-the translation and the original version of this License or a notice
-or disclaimer, the original version will prevail.
-
-If a section in the Document is Entitled "Acknowledgements",
-"Dedications", or "History", the requirement (section 4) to Preserve
-its Title (section 1) will typically require changing the actual
-title.
-
-
-9. TERMINATION
-
-You may not copy, modify, sublicense, or distribute the Document
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense, or distribute it is void, and
-will automatically terminate your rights under this License.
-
-However, if you cease all violation of this License, then your license
-from a particular copyright holder is reinstated (a) provisionally,
-unless and until the copyright holder explicitly and finally
-terminates your license, and (b) permanently, if the copyright holder
-fails to notify you of the violation by some reasonable means prior to
-60 days after the cessation.
-
-Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
-Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, receipt of a copy of some or all of the same material does
-not give you any rights to use it.
-
-
-10. FUTURE REVISIONS OF THIS LICENSE
-
-The Free Software Foundation may publish new, revised versions of the
-GNU Free Documentation License from time to time. Such new versions
-will be similar in spirit to the present version, but may differ in
-detail to address new problems or concerns. See
-http://www.gnu.org/copyleft/.
-
-Each version of the License is given a distinguishing version number.
-If the Document specifies that a particular numbered version of this
-License "or any later version" applies to it, you have the option of
-following the terms and conditions either of that specified version or
-of any later version that has been published (not as a draft) by the
-Free Software Foundation. If the Document does not specify a version
-number of this License, you may choose any version ever published (not
-as a draft) by the Free Software Foundation. If the Document
-specifies that a proxy can decide which future versions of this
-License can be used, that proxy's public statement of acceptance of a
-version permanently authorizes you to choose that version for the
-Document.
-
-11. RELICENSING
-
-"Massive Multiauthor Collaboration Site" (or "MMC Site") means any
-World Wide Web server that publishes copyrightable works and also
-provides prominent facilities for anybody to edit those works. A
-public wiki that anybody can edit is an example of such a server. A
-"Massive Multiauthor Collaboration" (or "MMC") contained in the site
-means any set of copyrightable works thus published on the MMC site.
-
-"CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
-license published by Creative Commons Corporation, a not-for-profit
-corporation with a principal place of business in San Francisco,
-California, as well as future copyleft versions of that license
-published by that same organization.
-
-"Incorporate" means to publish or republish a Document, in whole or in
-part, as part of another Document.
-
-An MMC is "eligible for relicensing" if it is licensed under this
-License, and if all works that were first published under this License
-somewhere other than this MMC, and subsequently incorporated in whole or
-in part into the MMC, (1) had no cover texts or invariant sections, and
-(2) were thus incorporated prior to November 1, 2008.
-
-The operator of an MMC Site may republish an MMC contained in the site
-under CC-BY-SA on the same site at any time before August 1, 2009,
-provided the MMC is eligible for relicensing.
-
-
-ADDENDUM: How to use this License for your documents
-
-To use this License in a document you have written, include a copy of
-the License in the document and put the following copyright and
-license notices just after the title page:
-
- Copyright (c) YEAR YOUR NAME.
- Permission is granted to copy, distribute and/or modify this document
- under the terms of the GNU Free Documentation License, Version 1.3
- or any later version published by the Free Software Foundation;
- with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
- A copy of the license is included in the section entitled "GNU
- Free Documentation License".
-
-If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
-replace the "with...Texts." line with this:
-
- with the Invariant Sections being LIST THEIR TITLES, with the
- Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
-
-If you have Invariant Sections without Cover Texts, or some other
-combination of the three, merge those two alternatives to suit the
-situation.
-
-If your document contains nontrivial examples of program code, we
-recommend releasing these examples in parallel under your choice of
-free software license, such as the GNU General Public License,
-to permit their use in free software.
diff --git a/LICENSE.GPL3-EXCEPT b/LICENSE.GPL3-EXCEPT
deleted file mode 100644
index b1cb1bec7..000000000
--- a/LICENSE.GPL3-EXCEPT
+++ /dev/null
@@ -1,704 +0,0 @@
-This is the GNU General Public License version 3, annotated with The
-Qt Company GPL Exception 1.0:
-
--------------------------------------------------------------------------
-
-The Qt Company GPL Exception 1.0
-
-Exception 1:
-
-As a special exception you may create a larger work which contains the
-output of this application and distribute that work under terms of your
-choice, so long as the work is not otherwise derived from or based on
-this application and so long as the work does not in itself generate
-output that contains the output from this application in its original
-or modified form.
-
-Exception 2:
-
-As a special exception, you have permission to combine this application
-with Plugins licensed under the terms of your choice, to produce an
-executable, and to copy and distribute the resulting executable under
-the terms of your choice. However, the executable must be accompanied
-by a prominent notice offering all users of the executable the entire
-source code to this application, excluding the source code of the
-independent modules, but including any changes you have made to this
-application, under the terms of this license.
-
-
--------------------------------------------------------------------------
-
- GNU GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
- The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works. By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users. We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors. You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
- To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights. Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received. You must make sure that they, too, receive
-or can get the source code. And you must show them these terms so they
-know their rights.
-
- Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
- For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software. For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
- Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so. This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software. The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable. Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products. If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
- Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary. To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- TERMS AND CONDITIONS
-
- 0. Definitions.
-
- "This License" refers to version 3 of the GNU General Public License.
-
- "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
- "The Program" refers to any copyrightable work licensed under this
-License. Each licensee is addressed as "you". "Licensees" and
-"recipients" may be individuals or organizations.
-
- To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy. The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
- A "covered work" means either the unmodified Program or a work based
-on the Program.
-
- To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy. Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
- To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies. Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
- An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License. If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
- 1. Source Code.
-
- The "source code" for a work means the preferred form of the work
-for making modifications to it. "Object code" means any non-source
-form of a work.
-
- A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
- The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form. A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
- The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities. However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work. For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
- The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
- The Corresponding Source for a work in source code form is that
-same work.
-
- 2. Basic Permissions.
-
- All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met. This License explicitly affirms your unlimited
-permission to run the unmodified Program. The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work. This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
- You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force. You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright. Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
- Conveying under any other circumstances is permitted solely under
-the conditions stated below. Sublicensing is not allowed; section 10
-makes it unnecessary.
-
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
- No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
- When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
- 4. Conveying Verbatim Copies.
-
- You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
- You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
- 5. Conveying Modified Source Versions.
-
- You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
- a) The work must carry prominent notices stating that you modified
- it, and giving a relevant date.
-
- b) The work must carry prominent notices stating that it is
- released under this License and any conditions added under section
- 7. This requirement modifies the requirement in section 4 to
- "keep intact all notices".
-
- c) You must license the entire work, as a whole, under this
- License to anyone who comes into possession of a copy. This
- License will therefore apply, along with any applicable section 7
- additional terms, to the whole of the work, and all its parts,
- regardless of how they are packaged. This License gives no
- permission to license the work in any other way, but it does not
- invalidate such permission if you have separately received it.
-
- d) If the work has interactive user interfaces, each must display
- Appropriate Legal Notices; however, if the Program has interactive
- interfaces that do not display Appropriate Legal Notices, your
- work need not make them do so.
-
- A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit. Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
- 6. Conveying Non-Source Forms.
-
- You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
- a) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by the
- Corresponding Source fixed on a durable physical medium
- customarily used for software interchange.
-
- b) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by a
- written offer, valid for at least three years and valid for as
- long as you offer spare parts or customer support for that product
- model, to give anyone who possesses the object code either (1) a
- copy of the Corresponding Source for all the software in the
- product that is covered by this License, on a durable physical
- medium customarily used for software interchange, for a price no
- more than your reasonable cost of physically performing this
- conveying of source, or (2) access to copy the
- Corresponding Source from a network server at no charge.
-
- c) Convey individual copies of the object code with a copy of the
- written offer to provide the Corresponding Source. This
- alternative is allowed only occasionally and noncommercially, and
- only if you received the object code with such an offer, in accord
- with subsection 6b.
-
- d) Convey the object code by offering access from a designated
- place (gratis or for a charge), and offer equivalent access to the
- Corresponding Source in the same way through the same place at no
- further charge. You need not require recipients to copy the
- Corresponding Source along with the object code. If the place to
- copy the object code is a network server, the Corresponding Source
- may be on a different server (operated by you or a third party)
- that supports equivalent copying facilities, provided you maintain
- clear directions next to the object code saying where to find the
- Corresponding Source. Regardless of what server hosts the
- Corresponding Source, you remain obligated to ensure that it is
- available for as long as needed to satisfy these requirements.
-
- e) Convey the object code using peer-to-peer transmission, provided
- you inform other peers where the object code and Corresponding
- Source of the work are being offered to the general public at no
- charge under subsection 6d.
-
- A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
- A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling. In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage. For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product. A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
- "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source. The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
- If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information. But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
- The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed. Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
- Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
- 7. Additional Terms.
-
- "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law. If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
- When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it. (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.) You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
- Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
- a) Disclaiming warranty or limiting liability differently from the
- terms of sections 15 and 16 of this License; or
-
- b) Requiring preservation of specified reasonable legal notices or
- author attributions in that material or in the Appropriate Legal
- Notices displayed by works containing it; or
-
- c) Prohibiting misrepresentation of the origin of that material, or
- requiring that modified versions of such material be marked in
- reasonable ways as different from the original version; or
-
- d) Limiting the use for publicity purposes of names of licensors or
- authors of the material; or
-
- e) Declining to grant rights under trademark law for use of some
- trade names, trademarks, or service marks; or
-
- f) Requiring indemnification of licensors and authors of that
- material by anyone who conveys the material (or modified versions of
- it) with contractual assumptions of liability to the recipient, for
- any liability that these contractual assumptions directly impose on
- those licensors and authors.
-
- All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10. If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term. If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
- If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
- Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
- 8. Termination.
-
- You may not propagate or modify a covered work except as expressly
-provided under this License. Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
- However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
- Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
- Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
- 9. Acceptance Not Required for Having Copies.
-
- You are not required to accept this License in order to receive or
-run a copy of the Program. Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance. However,
-nothing other than this License grants you permission to propagate or
-modify any covered work. These actions infringe copyright if you do
-not accept this License. Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
- 10. Automatic Licensing of Downstream Recipients.
-
- Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License. You are not responsible
-for enforcing compliance by third parties with this License.
-
- An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations. If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
- You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License. For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
- 11. Patents.
-
- A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based. The
-work thus licensed is called the contributor's "contributor version".
-
- A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version. For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
- Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
- In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement). To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
- If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients. "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
- If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
- A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License. You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
- Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
- 12. No Surrender of Others' Freedom.
-
- If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all. For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
- 13. Use with the GNU Affero General Public License.
-
- Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work. The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
- 14. Revised Versions of this License.
-
- The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation. If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
- If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
- Later license versions may give you additional or different
-permissions. However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
- 15. Disclaimer of Warranty.
-
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. Limitation of Liability.
-
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
- 17. Interpretation of Sections 15 and 16.
-
- If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
- If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
- <program> Copyright (C) <year> <name of author>
- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
- You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-<http://www.gnu.org/licenses/>.
-
- The GNU General Public License does not permit incorporating your program
-into proprietary programs. If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License. But first, please read
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/LICENSE.GPLv3 b/LICENSE.GPLv3
deleted file mode 100644
index 71c4ad49c..000000000
--- a/LICENSE.GPLv3
+++ /dev/null
@@ -1,686 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
-
- The Qt Toolkit is Copyright (C) 2015 The Qt Company Ltd.
- Contact: http://www.qt.io/licensing/
-
- You may use, distribute and copy the Qt Toolkit under the terms of
- GNU Lesser General Public License version 3. That license references
- the General Public License version 3, that is displayed below. Other
- portions of the Qt Toolkit may be licensed directly under this license.
-
--------------------------------------------------------------------------
-
- GNU GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
- The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works. By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users. We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors. You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
- To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights. Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received. You must make sure that they, too, receive
-or can get the source code. And you must show them these terms so they
-know their rights.
-
- Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
- For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software. For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
- Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so. This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software. The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable. Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products. If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
- Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary. To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- TERMS AND CONDITIONS
-
- 0. Definitions.
-
- "This License" refers to version 3 of the GNU General Public License.
-
- "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
- "The Program" refers to any copyrightable work licensed under this
-License. Each licensee is addressed as "you". "Licensees" and
-"recipients" may be individuals or organizations.
-
- To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy. The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
- A "covered work" means either the unmodified Program or a work based
-on the Program.
-
- To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy. Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
- To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies. Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
- An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License. If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
- 1. Source Code.
-
- The "source code" for a work means the preferred form of the work
-for making modifications to it. "Object code" means any non-source
-form of a work.
-
- A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
- The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form. A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
- The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities. However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work. For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
- The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
- The Corresponding Source for a work in source code form is that
-same work.
-
- 2. Basic Permissions.
-
- All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met. This License explicitly affirms your unlimited
-permission to run the unmodified Program. The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work. This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
- You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force. You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright. Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
- Conveying under any other circumstances is permitted solely under
-the conditions stated below. Sublicensing is not allowed; section 10
-makes it unnecessary.
-
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
- No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
- When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
- 4. Conveying Verbatim Copies.
-
- You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
- You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
- 5. Conveying Modified Source Versions.
-
- You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
- a) The work must carry prominent notices stating that you modified
- it, and giving a relevant date.
-
- b) The work must carry prominent notices stating that it is
- released under this License and any conditions added under section
- 7. This requirement modifies the requirement in section 4 to
- "keep intact all notices".
-
- c) You must license the entire work, as a whole, under this
- License to anyone who comes into possession of a copy. This
- License will therefore apply, along with any applicable section 7
- additional terms, to the whole of the work, and all its parts,
- regardless of how they are packaged. This License gives no
- permission to license the work in any other way, but it does not
- invalidate such permission if you have separately received it.
-
- d) If the work has interactive user interfaces, each must display
- Appropriate Legal Notices; however, if the Program has interactive
- interfaces that do not display Appropriate Legal Notices, your
- work need not make them do so.
-
- A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit. Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
- 6. Conveying Non-Source Forms.
-
- You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
- a) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by the
- Corresponding Source fixed on a durable physical medium
- customarily used for software interchange.
-
- b) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by a
- written offer, valid for at least three years and valid for as
- long as you offer spare parts or customer support for that product
- model, to give anyone who possesses the object code either (1) a
- copy of the Corresponding Source for all the software in the
- product that is covered by this License, on a durable physical
- medium customarily used for software interchange, for a price no
- more than your reasonable cost of physically performing this
- conveying of source, or (2) access to copy the
- Corresponding Source from a network server at no charge.
-
- c) Convey individual copies of the object code with a copy of the
- written offer to provide the Corresponding Source. This
- alternative is allowed only occasionally and noncommercially, and
- only if you received the object code with such an offer, in accord
- with subsection 6b.
-
- d) Convey the object code by offering access from a designated
- place (gratis or for a charge), and offer equivalent access to the
- Corresponding Source in the same way through the same place at no
- further charge. You need not require recipients to copy the
- Corresponding Source along with the object code. If the place to
- copy the object code is a network server, the Corresponding Source
- may be on a different server (operated by you or a third party)
- that supports equivalent copying facilities, provided you maintain
- clear directions next to the object code saying where to find the
- Corresponding Source. Regardless of what server hosts the
- Corresponding Source, you remain obligated to ensure that it is
- available for as long as needed to satisfy these requirements.
-
- e) Convey the object code using peer-to-peer transmission, provided
- you inform other peers where the object code and Corresponding
- Source of the work are being offered to the general public at no
- charge under subsection 6d.
-
- A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
- A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling. In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage. For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product. A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
- "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source. The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
- If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information. But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
- The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed. Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
- Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
- 7. Additional Terms.
-
- "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law. If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
- When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it. (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.) You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
- Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
- a) Disclaiming warranty or limiting liability differently from the
- terms of sections 15 and 16 of this License; or
-
- b) Requiring preservation of specified reasonable legal notices or
- author attributions in that material or in the Appropriate Legal
- Notices displayed by works containing it; or
-
- c) Prohibiting misrepresentation of the origin of that material, or
- requiring that modified versions of such material be marked in
- reasonable ways as different from the original version; or
-
- d) Limiting the use for publicity purposes of names of licensors or
- authors of the material; or
-
- e) Declining to grant rights under trademark law for use of some
- trade names, trademarks, or service marks; or
-
- f) Requiring indemnification of licensors and authors of that
- material by anyone who conveys the material (or modified versions of
- it) with contractual assumptions of liability to the recipient, for
- any liability that these contractual assumptions directly impose on
- those licensors and authors.
-
- All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10. If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term. If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
- If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
- Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
- 8. Termination.
-
- You may not propagate or modify a covered work except as expressly
-provided under this License. Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
- However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
- Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
- Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
- 9. Acceptance Not Required for Having Copies.
-
- You are not required to accept this License in order to receive or
-run a copy of the Program. Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance. However,
-nothing other than this License grants you permission to propagate or
-modify any covered work. These actions infringe copyright if you do
-not accept this License. Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
- 10. Automatic Licensing of Downstream Recipients.
-
- Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License. You are not responsible
-for enforcing compliance by third parties with this License.
-
- An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations. If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
- You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License. For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
- 11. Patents.
-
- A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based. The
-work thus licensed is called the contributor's "contributor version".
-
- A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version. For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
- Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
- In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement). To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
- If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients. "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
- If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
- A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License. You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
- Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
- 12. No Surrender of Others' Freedom.
-
- If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all. For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
- 13. Use with the GNU Affero General Public License.
-
- Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work. The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
- 14. Revised Versions of this License.
-
- The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation. If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
- If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
- Later license versions may give you additional or different
-permissions. However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
- 15. Disclaimer of Warranty.
-
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. Limitation of Liability.
-
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
- 17. Interpretation of Sections 15 and 16.
-
- If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
- If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
- <program> Copyright (C) <year> <name of author>
- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
- You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-<http://www.gnu.org/licenses/>.
-
- The GNU General Public License does not permit incorporating your program
-into proprietary programs. If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License. But first, please read
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/LICENSE.LGPL3 b/LICENSE.LGPL3
deleted file mode 100644
index 1f78e0508..000000000
--- a/LICENSE.LGPL3
+++ /dev/null
@@ -1,177 +0,0 @@
- GNU LESSER GENERAL PUBLIC LICENSE
-
- The Qt Toolkit is Copyright (C) 2015 The Qt Company Ltd.
- Contact: http://www.qt.io/licensing/
-
- You may use, distribute and copy the Qt Toolkit under the terms of
- GNU Lesser General Public License version 3, which is displayed below.
- This license makes reference to the version 3 of the GNU General
- Public License, which you can find in the LICENSE.GPLv3 file.
-
--------------------------------------------------------------------------
-
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-
- This version of the GNU Lesser General Public License incorporates
-the terms and conditions of version 3 of the GNU General Public
-License, supplemented by the additional permissions listed below.
-
- 0. Additional Definitions.
-
- As used herein, "this License" refers to version 3 of the GNU Lesser
-General Public License, and the "GNU GPL" refers to version 3 of the GNU
-General Public License.
-
- "The Library" refers to a covered work governed by this License,
-other than an Application or a Combined Work as defined below.
-
- An "Application" is any work that makes use of an interface provided
-by the Library, but which is not otherwise based on the Library.
-Defining a subclass of a class defined by the Library is deemed a mode
-of using an interface provided by the Library.
-
- A "Combined Work" is a work produced by combining or linking an
-Application with the Library. The particular version of the Library
-with which the Combined Work was made is also called the "Linked
-Version".
-
- The "Minimal Corresponding Source" for a Combined Work means the
-Corresponding Source for the Combined Work, excluding any source code
-for portions of the Combined Work that, considered in isolation, are
-based on the Application, and not on the Linked Version.
-
- The "Corresponding Application Code" for a Combined Work means the
-object code and/or source code for the Application, including any data
-and utility programs needed for reproducing the Combined Work from the
-Application, but excluding the System Libraries of the Combined Work.
-
- 1. Exception to Section 3 of the GNU GPL.
-
- You may convey a covered work under sections 3 and 4 of this License
-without being bound by section 3 of the GNU GPL.
-
- 2. Conveying Modified Versions.
-
- If you modify a copy of the Library, and, in your modifications, a
-facility refers to a function or data to be supplied by an Application
-that uses the facility (other than as an argument passed when the
-facility is invoked), then you may convey a copy of the modified
-version:
-
- a) under this License, provided that you make a good faith effort to
- ensure that, in the event an Application does not supply the
- function or data, the facility still operates, and performs
- whatever part of its purpose remains meaningful, or
-
- b) under the GNU GPL, with none of the additional permissions of
- this License applicable to that copy.
-
- 3. Object Code Incorporating Material from Library Header Files.
-
- The object code form of an Application may incorporate material from
-a header file that is part of the Library. You may convey such object
-code under terms of your choice, provided that, if the incorporated
-material is not limited to numerical parameters, data structure
-layouts and accessors, or small macros, inline functions and templates
-(ten or fewer lines in length), you do both of the following:
-
- a) Give prominent notice with each copy of the object code that the
- Library is used in it and that the Library and its use are
- covered by this License.
-
- b) Accompany the object code with a copy of the GNU GPL and this license
- document.
-
- 4. Combined Works.
-
- You may convey a Combined Work under terms of your choice that,
-taken together, effectively do not restrict modification of the
-portions of the Library contained in the Combined Work and reverse
-engineering for debugging such modifications, if you also do each of
-the following:
-
- a) Give prominent notice with each copy of the Combined Work that
- the Library is used in it and that the Library and its use are
- covered by this License.
-
- b) Accompany the Combined Work with a copy of the GNU GPL and this license
- document.
-
- c) For a Combined Work that displays copyright notices during
- execution, include the copyright notice for the Library among
- these notices, as well as a reference directing the user to the
- copies of the GNU GPL and this license document.
-
- d) Do one of the following:
-
- 0) Convey the Minimal Corresponding Source under the terms of this
- License, and the Corresponding Application Code in a form
- suitable for, and under terms that permit, the user to
- recombine or relink the Application with a modified version of
- the Linked Version to produce a modified Combined Work, in the
- manner specified by section 6 of the GNU GPL for conveying
- Corresponding Source.
-
- 1) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (a) uses at run time
- a copy of the Library already present on the user's computer
- system, and (b) will operate properly with a modified version
- of the Library that is interface-compatible with the Linked
- Version.
-
- e) Provide Installation Information, but only if you would otherwise
- be required to provide such information under section 6 of the
- GNU GPL, and only to the extent that such information is
- necessary to install and execute a modified version of the
- Combined Work produced by recombining or relinking the
- Application with a modified version of the Linked Version. (If
- you use option 4d0, the Installation Information must accompany
- the Minimal Corresponding Source and Corresponding Application
- Code. If you use option 4d1, you must provide the Installation
- Information in the manner specified by section 6 of the GNU GPL
- for conveying Corresponding Source.)
-
- 5. Combined Libraries.
-
- You may place library facilities that are a work based on the
-Library side by side in a single library together with other library
-facilities that are not Applications and are not covered by this
-License, and convey such a combined library under terms of your
-choice, if you do both of the following:
-
- a) Accompany the combined library with a copy of the same work based
- on the Library, uncombined with any other library facilities,
- conveyed under the terms of this License.
-
- b) Give prominent notice with the combined library that part of it
- is a work based on the Library, and explaining where to find the
- accompanying uncombined form of the same work.
-
- 6. Revised Versions of the GNU Lesser General Public License.
-
- The Free Software Foundation may publish revised and/or new versions
-of the GNU Lesser General Public License from time to time. Such new
-versions will be similar in spirit to the present version, but may
-differ in detail to address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Library as you received it specifies that a certain numbered version
-of the GNU Lesser General Public License "or any later version"
-applies to it, you have the option of following the terms and
-conditions either of that published version or of any later version
-published by the Free Software Foundation. If the Library as you
-received it does not specify a version number of the GNU Lesser
-General Public License, you may choose any version of the GNU Lesser
-General Public License ever published by the Free Software Foundation.
-
- If the Library as you received it specifies that a proxy can decide
-whether future versions of the GNU Lesser General Public License shall
-apply, that proxy's public statement of acceptance of any version is
-permanent authorization for you to choose that version for the
-Library.
diff --git a/LICENSE.LGPLv3 b/LICENSE.LGPLv3
deleted file mode 100644
index e200fb5b2..000000000
--- a/LICENSE.LGPLv3
+++ /dev/null
@@ -1,174 +0,0 @@
- GNU LESSER GENERAL PUBLIC LICENSE
-
- The Qt Toolkit is Copyright (C) 2015 The Qt Company Ltd.
- Contact: http://www.qt.io/licensing/
-
- You may use, distribute and copy the Qt Toolkit under the terms of
- GNU Lesser General Public License version 3, which is displayed below.
- This license makes reference to the version 3 of the GNU General
- Public License, which you can find in the LICENSE.GPLv3 file.
-
--------------------------------------------------------------------------
-
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>
-Everyone is permitted to copy and distribute verbatim copies of this
-licensedocument, but changing it is not allowed.
-
-This version of the GNU Lesser General Public License incorporates
-the terms and conditions of version 3 of the GNU General Public
-License, supplemented by the additional permissions listed below.
-
-0. Additional Definitions.
-
- As used herein, “this License†refers to version 3 of the GNU Lesser
-General Public License, and the “GNU GPL†refers to version 3 of the
-GNU General Public License.
-
- “The Library†refers to a covered work governed by this License,
-other than an Application or a Combined Work as defined below.
-
- An “Application†is any work that makes use of an interface provided
-by the Library, but which is not otherwise based on the Library.
-Defining a subclass of a class defined by the Library is deemed a mode
-of using an interface provided by the Library.
-
- A “Combined Work†is a work produced by combining or linking an
-Application with the Library. The particular version of the Library
-with which the Combined Work was made is also called the “Linked
-Versionâ€.
-
- The “Minimal Corresponding Source†for a Combined Work means the
-Corresponding Source for the Combined Work, excluding any source code
-for portions of the Combined Work that, considered in isolation, are
-based on the Application, and not on the Linked Version.
-
- The “Corresponding Application Code†for a Combined Work means the
-object code and/or source code for the Application, including any data
-and utility programs needed for reproducing the Combined Work from the
-Application, but excluding the System Libraries of the Combined Work.
-
-1. Exception to Section 3 of the GNU GPL.
-
- You may convey a covered work under sections 3 and 4 of this License
-without being bound by section 3 of the GNU GPL.
-
-2. Conveying Modified Versions.
-
- If you modify a copy of the Library, and, in your modifications, a
-facility refers to a function or data to be supplied by an Application
-that uses the facility (other than as an argument passed when the
-facility is invoked), then you may convey a copy of the modified
-version:
-
- a) under this License, provided that you make a good faith effort
- to ensure that, in the event an Application does not supply the
- function or data, the facility still operates, and performs
- whatever part of its purpose remains meaningful, or
-
- b) under the GNU GPL, with none of the additional permissions of
- this License applicable to that copy.
-
-3. Object Code Incorporating Material from Library Header Files.
-
- The object code form of an Application may incorporate material from
-a header file that is part of the Library. You may convey such object
-code under terms of your choice, provided that, if the incorporated
-material is not limited to numerical parameters, data structure
-layouts and accessors, or small macros, inline functions and templates
-(ten or fewer lines in length), you do both of the following:
-
- a) Give prominent notice with each copy of the object code that
- the Library is used in it and that the Library and its use are
- covered by this License.
-
- b) Accompany the object code with a copy of the GNU GPL and this
- license document.
-
-4. Combined Works.
-
- You may convey a Combined Work under terms of your choice that, taken
-together, effectively do not restrict modification of the portions of
-the Library contained in the Combined Work and reverse engineering for
-debugging such modifications, if you also do each of the following:
-
- a) Give prominent notice with each copy of the Combined Work that
- the Library is used in it and that the Library and its use are
- covered by this License.
-
- b) Accompany the Combined Work with a copy of the GNU GPL and this
- license document.
-
- c) For a Combined Work that displays copyright notices during
- execution, include the copyright notice for the Library among
- these notices, as well as a reference directing the user to the
- copies of the GNU GPL and this license document.
-
- d) Do one of the following:
-
- 0) Convey the Minimal Corresponding Source under the terms of
- this License, and the Corresponding Application Code in a form
- suitable for, and under terms that permit, the user to
- recombine or relink the Application with a modified version of
- the Linked Version to produce a modified Combined Work, in the
- manner specified by section 6 of the GNU GPL for conveying
- Corresponding Source.
-
- 1) Use a suitable shared library mechanism for linking with
- the Library. A suitable mechanism is one that (a) uses at run
- time a copy of the Library already present on the user's
- computer system, and (b) will operate properly with a modified
- version of the Library that is interface-compatible with the
- Linked Version.
-
- e) Provide Installation Information, but only if you would
- otherwise be required to provide such information under section 6
- of the GNU GPL, and only to the extent that such information is
- necessary to install and execute a modified version of the
- Combined Work produced by recombining or relinking the Application
- with a modified version of the Linked Version. (If you use option
- 4d0, the Installation Information must accompany the Minimal
- Corresponding Source and Corresponding Application Code. If you
- use option 4d1, you must provide the Installation Information in
- the manner specified by section 6 of the GNU GPL for conveying
- Corresponding Source.)
-
-5. Combined Libraries.
-
- You may place library facilities that are a work based on the Library
-side by side in a single library together with other library
-facilities that are not Applications and are not covered by this
-License, and convey such a combined library under terms of your
-choice, if you do both of the following:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities, conveyed under the terms of this License.
-
- b) Give prominent notice with the combined library that part of
- it is a work based on the Library, and explaining where to find
- the accompanying uncombined form of the same work.
-
-6. Revised Versions of the GNU Lesser General Public License.
-
- The Free Software Foundation may publish revised and/or new versions
-of the GNU Lesser General Public License from time to time. Such new
-versions will be similar in spirit to the present version, but may
-differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-as you received it specifies that a certain numbered version of the
-GNU Lesser General Public License “or any later version†applies to
-it, you have the option of following the terms and conditions either
-of that published version or of any later version published by the
-Free Software Foundation. If the Library as you received it does not
-specify a version number of the GNU Lesser General Public License,
-you may choose any version of the GNU Lesser General Public License
-ever published by the Free Software Foundation.
-
-If the Library as you received it specifies that a proxy can decide
-whether future versions of the GNU Lesser General Public License shall
-apply, that proxy's public statement of acceptance of any version is
-permanent authorization for you to choose that version for the Library.
diff --git a/LICENSES/BSD-3-Clause.txt b/LICENSES/BSD-3-Clause.txt
new file mode 100644
index 000000000..b91bbd894
--- /dev/null
+++ b/LICENSES/BSD-3-Clause.txt
@@ -0,0 +1,9 @@
+Copyright (c) <year> <owner>.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+ 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/LICENSES/GFDL-1.3-no-invariants-only.txt b/LICENSES/GFDL-1.3-no-invariants-only.txt
new file mode 100644
index 000000000..857214dd8
--- /dev/null
+++ b/LICENSES/GFDL-1.3-no-invariants-only.txt
@@ -0,0 +1,451 @@
+
+ GNU Free Documentation License
+ Version 1.3, 3 November 2008
+
+
+ Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
+ <https://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+0. PREAMBLE
+
+The purpose of this License is to make a manual, textbook, or other
+functional and useful document "free" in the sense of freedom: to
+assure everyone the effective freedom to copy and redistribute it,
+with or without modifying it, either commercially or noncommercially.
+Secondarily, this License preserves for the author and publisher a way
+to get credit for their work, while not being considered responsible
+for modifications made by others.
+
+This License is a kind of "copyleft", which means that derivative
+works of the document must themselves be free in the same sense. It
+complements the GNU General Public License, which is a copyleft
+license designed for free software.
+
+We have designed this License in order to use it for manuals for free
+software, because free software needs free documentation: a free
+program should come with manuals providing the same freedoms that the
+software does. But this License is not limited to software manuals;
+it can be used for any textual work, regardless of subject matter or
+whether it is published as a printed book. We recommend this License
+principally for works whose purpose is instruction or reference.
+
+
+1. APPLICABILITY AND DEFINITIONS
+
+This License applies to any manual or other work, in any medium, that
+contains a notice placed by the copyright holder saying it can be
+distributed under the terms of this License. Such a notice grants a
+world-wide, royalty-free license, unlimited in duration, to use that
+work under the conditions stated herein. The "Document", below,
+refers to any such manual or work. Any member of the public is a
+licensee, and is addressed as "you". You accept the license if you
+copy, modify or distribute the work in a way requiring permission
+under copyright law.
+
+A "Modified Version" of the Document means any work containing the
+Document or a portion of it, either copied verbatim, or with
+modifications and/or translated into another language.
+
+A "Secondary Section" is a named appendix or a front-matter section of
+the Document that deals exclusively with the relationship of the
+publishers or authors of the Document to the Document's overall
+subject (or to related matters) and contains nothing that could fall
+directly within that overall subject. (Thus, if the Document is in
+part a textbook of mathematics, a Secondary Section may not explain
+any mathematics.) The relationship could be a matter of historical
+connection with the subject or with related matters, or of legal,
+commercial, philosophical, ethical or political position regarding
+them.
+
+The "Invariant Sections" are certain Secondary Sections whose titles
+are designated, as being those of Invariant Sections, in the notice
+that says that the Document is released under this License. If a
+section does not fit the above definition of Secondary then it is not
+allowed to be designated as Invariant. The Document may contain zero
+Invariant Sections. If the Document does not identify any Invariant
+Sections then there are none.
+
+The "Cover Texts" are certain short passages of text that are listed,
+as Front-Cover Texts or Back-Cover Texts, in the notice that says that
+the Document is released under this License. A Front-Cover Text may
+be at most 5 words, and a Back-Cover Text may be at most 25 words.
+
+A "Transparent" copy of the Document means a machine-readable copy,
+represented in a format whose specification is available to the
+general public, that is suitable for revising the document
+straightforwardly with generic text editors or (for images composed of
+pixels) generic paint programs or (for drawings) some widely available
+drawing editor, and that is suitable for input to text formatters or
+for automatic translation to a variety of formats suitable for input
+to text formatters. A copy made in an otherwise Transparent file
+format whose markup, or absence of markup, has been arranged to thwart
+or discourage subsequent modification by readers is not Transparent.
+An image format is not Transparent if used for any substantial amount
+of text. A copy that is not "Transparent" is called "Opaque".
+
+Examples of suitable formats for Transparent copies include plain
+ASCII without markup, Texinfo input format, LaTeX input format, SGML
+or XML using a publicly available DTD, and standard-conforming simple
+HTML, PostScript or PDF designed for human modification. Examples of
+transparent image formats include PNG, XCF and JPG. Opaque formats
+include proprietary formats that can be read and edited only by
+proprietary word processors, SGML or XML for which the DTD and/or
+processing tools are not generally available, and the
+machine-generated HTML, PostScript or PDF produced by some word
+processors for output purposes only.
+
+The "Title Page" means, for a printed book, the title page itself,
+plus such following pages as are needed to hold, legibly, the material
+this License requires to appear in the title page. For works in
+formats which do not have any title page as such, "Title Page" means
+the text near the most prominent appearance of the work's title,
+preceding the beginning of the body of the text.
+
+The "publisher" means any person or entity that distributes copies of
+the Document to the public.
+
+A section "Entitled XYZ" means a named subunit of the Document whose
+title either is precisely XYZ or contains XYZ in parentheses following
+text that translates XYZ in another language. (Here XYZ stands for a
+specific section name mentioned below, such as "Acknowledgements",
+"Dedications", "Endorsements", or "History".) To "Preserve the Title"
+of such a section when you modify the Document means that it remains a
+section "Entitled XYZ" according to this definition.
+
+The Document may include Warranty Disclaimers next to the notice which
+states that this License applies to the Document. These Warranty
+Disclaimers are considered to be included by reference in this
+License, but only as regards disclaiming warranties: any other
+implication that these Warranty Disclaimers may have is void and has
+no effect on the meaning of this License.
+
+2. VERBATIM COPYING
+
+You may copy and distribute the Document in any medium, either
+commercially or noncommercially, provided that this License, the
+copyright notices, and the license notice saying this License applies
+to the Document are reproduced in all copies, and that you add no
+other conditions whatsoever to those of this License. You may not use
+technical measures to obstruct or control the reading or further
+copying of the copies you make or distribute. However, you may accept
+compensation in exchange for copies. If you distribute a large enough
+number of copies you must also follow the conditions in section 3.
+
+You may also lend copies, under the same conditions stated above, and
+you may publicly display copies.
+
+
+3. COPYING IN QUANTITY
+
+If you publish printed copies (or copies in media that commonly have
+printed covers) of the Document, numbering more than 100, and the
+Document's license notice requires Cover Texts, you must enclose the
+copies in covers that carry, clearly and legibly, all these Cover
+Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
+the back cover. Both covers must also clearly and legibly identify
+you as the publisher of these copies. The front cover must present
+the full title with all words of the title equally prominent and
+visible. You may add other material on the covers in addition.
+Copying with changes limited to the covers, as long as they preserve
+the title of the Document and satisfy these conditions, can be treated
+as verbatim copying in other respects.
+
+If the required texts for either cover are too voluminous to fit
+legibly, you should put the first ones listed (as many as fit
+reasonably) on the actual cover, and continue the rest onto adjacent
+pages.
+
+If you publish or distribute Opaque copies of the Document numbering
+more than 100, you must either include a machine-readable Transparent
+copy along with each Opaque copy, or state in or with each Opaque copy
+a computer-network location from which the general network-using
+public has access to download using public-standard network protocols
+a complete Transparent copy of the Document, free of added material.
+If you use the latter option, you must take reasonably prudent steps,
+when you begin distribution of Opaque copies in quantity, to ensure
+that this Transparent copy will remain thus accessible at the stated
+location until at least one year after the last time you distribute an
+Opaque copy (directly or through your agents or retailers) of that
+edition to the public.
+
+It is requested, but not required, that you contact the authors of the
+Document well before redistributing any large number of copies, to
+give them a chance to provide you with an updated version of the
+Document.
+
+
+4. MODIFICATIONS
+
+You may copy and distribute a Modified Version of the Document under
+the conditions of sections 2 and 3 above, provided that you release
+the Modified Version under precisely this License, with the Modified
+Version filling the role of the Document, thus licensing distribution
+and modification of the Modified Version to whoever possesses a copy
+of it. In addition, you must do these things in the Modified Version:
+
+A. Use in the Title Page (and on the covers, if any) a title distinct
+ from that of the Document, and from those of previous versions
+ (which should, if there were any, be listed in the History section
+ of the Document). You may use the same title as a previous version
+ if the original publisher of that version gives permission.
+B. List on the Title Page, as authors, one or more persons or entities
+ responsible for authorship of the modifications in the Modified
+ Version, together with at least five of the principal authors of the
+ Document (all of its principal authors, if it has fewer than five),
+ unless they release you from this requirement.
+C. State on the Title page the name of the publisher of the
+ Modified Version, as the publisher.
+D. Preserve all the copyright notices of the Document.
+E. Add an appropriate copyright notice for your modifications
+ adjacent to the other copyright notices.
+F. Include, immediately after the copyright notices, a license notice
+ giving the public permission to use the Modified Version under the
+ terms of this License, in the form shown in the Addendum below.
+G. Preserve in that license notice the full lists of Invariant Sections
+ and required Cover Texts given in the Document's license notice.
+H. Include an unaltered copy of this License.
+I. Preserve the section Entitled "History", Preserve its Title, and add
+ to it an item stating at least the title, year, new authors, and
+ publisher of the Modified Version as given on the Title Page. If
+ there is no section Entitled "History" in the Document, create one
+ stating the title, year, authors, and publisher of the Document as
+ given on its Title Page, then add an item describing the Modified
+ Version as stated in the previous sentence.
+J. Preserve the network location, if any, given in the Document for
+ public access to a Transparent copy of the Document, and likewise
+ the network locations given in the Document for previous versions
+ it was based on. These may be placed in the "History" section.
+ You may omit a network location for a work that was published at
+ least four years before the Document itself, or if the original
+ publisher of the version it refers to gives permission.
+K. For any section Entitled "Acknowledgements" or "Dedications",
+ Preserve the Title of the section, and preserve in the section all
+ the substance and tone of each of the contributor acknowledgements
+ and/or dedications given therein.
+L. Preserve all the Invariant Sections of the Document,
+ unaltered in their text and in their titles. Section numbers
+ or the equivalent are not considered part of the section titles.
+M. Delete any section Entitled "Endorsements". Such a section
+ may not be included in the Modified Version.
+N. Do not retitle any existing section to be Entitled "Endorsements"
+ or to conflict in title with any Invariant Section.
+O. Preserve any Warranty Disclaimers.
+
+If the Modified Version includes new front-matter sections or
+appendices that qualify as Secondary Sections and contain no material
+copied from the Document, you may at your option designate some or all
+of these sections as invariant. To do this, add their titles to the
+list of Invariant Sections in the Modified Version's license notice.
+These titles must be distinct from any other section titles.
+
+You may add a section Entitled "Endorsements", provided it contains
+nothing but endorsements of your Modified Version by various
+parties--for example, statements of peer review or that the text has
+been approved by an organization as the authoritative definition of a
+standard.
+
+You may add a passage of up to five words as a Front-Cover Text, and a
+passage of up to 25 words as a Back-Cover Text, to the end of the list
+of Cover Texts in the Modified Version. Only one passage of
+Front-Cover Text and one of Back-Cover Text may be added by (or
+through arrangements made by) any one entity. If the Document already
+includes a cover text for the same cover, previously added by you or
+by arrangement made by the same entity you are acting on behalf of,
+you may not add another; but you may replace the old one, on explicit
+permission from the previous publisher that added the old one.
+
+The author(s) and publisher(s) of the Document do not by this License
+give permission to use their names for publicity for or to assert or
+imply endorsement of any Modified Version.
+
+
+5. COMBINING DOCUMENTS
+
+You may combine the Document with other documents released under this
+License, under the terms defined in section 4 above for modified
+versions, provided that you include in the combination all of the
+Invariant Sections of all of the original documents, unmodified, and
+list them all as Invariant Sections of your combined work in its
+license notice, and that you preserve all their Warranty Disclaimers.
+
+The combined work need only contain one copy of this License, and
+multiple identical Invariant Sections may be replaced with a single
+copy. If there are multiple Invariant Sections with the same name but
+different contents, make the title of each such section unique by
+adding at the end of it, in parentheses, the name of the original
+author or publisher of that section if known, or else a unique number.
+Make the same adjustment to the section titles in the list of
+Invariant Sections in the license notice of the combined work.
+
+In the combination, you must combine any sections Entitled "History"
+in the various original documents, forming one section Entitled
+"History"; likewise combine any sections Entitled "Acknowledgements",
+and any sections Entitled "Dedications". You must delete all sections
+Entitled "Endorsements".
+
+
+6. COLLECTIONS OF DOCUMENTS
+
+You may make a collection consisting of the Document and other
+documents released under this License, and replace the individual
+copies of this License in the various documents with a single copy
+that is included in the collection, provided that you follow the rules
+of this License for verbatim copying of each of the documents in all
+other respects.
+
+You may extract a single document from such a collection, and
+distribute it individually under this License, provided you insert a
+copy of this License into the extracted document, and follow this
+License in all other respects regarding verbatim copying of that
+document.
+
+
+7. AGGREGATION WITH INDEPENDENT WORKS
+
+A compilation of the Document or its derivatives with other separate
+and independent documents or works, in or on a volume of a storage or
+distribution medium, is called an "aggregate" if the copyright
+resulting from the compilation is not used to limit the legal rights
+of the compilation's users beyond what the individual works permit.
+When the Document is included in an aggregate, this License does not
+apply to the other works in the aggregate which are not themselves
+derivative works of the Document.
+
+If the Cover Text requirement of section 3 is applicable to these
+copies of the Document, then if the Document is less than one half of
+the entire aggregate, the Document's Cover Texts may be placed on
+covers that bracket the Document within the aggregate, or the
+electronic equivalent of covers if the Document is in electronic form.
+Otherwise they must appear on printed covers that bracket the whole
+aggregate.
+
+
+8. TRANSLATION
+
+Translation is considered a kind of modification, so you may
+distribute translations of the Document under the terms of section 4.
+Replacing Invariant Sections with translations requires special
+permission from their copyright holders, but you may include
+translations of some or all Invariant Sections in addition to the
+original versions of these Invariant Sections. You may include a
+translation of this License, and all the license notices in the
+Document, and any Warranty Disclaimers, provided that you also include
+the original English version of this License and the original versions
+of those notices and disclaimers. In case of a disagreement between
+the translation and the original version of this License or a notice
+or disclaimer, the original version will prevail.
+
+If a section in the Document is Entitled "Acknowledgements",
+"Dedications", or "History", the requirement (section 4) to Preserve
+its Title (section 1) will typically require changing the actual
+title.
+
+
+9. TERMINATION
+
+You may not copy, modify, sublicense, or distribute the Document
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense, or distribute it is void, and
+will automatically terminate your rights under this License.
+
+However, if you cease all violation of this License, then your license
+from a particular copyright holder is reinstated (a) provisionally,
+unless and until the copyright holder explicitly and finally
+terminates your license, and (b) permanently, if the copyright holder
+fails to notify you of the violation by some reasonable means prior to
+60 days after the cessation.
+
+Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, receipt of a copy of some or all of the same material does
+not give you any rights to use it.
+
+
+10. FUTURE REVISIONS OF THIS LICENSE
+
+The Free Software Foundation may publish new, revised versions of the
+GNU Free Documentation License from time to time. Such new versions
+will be similar in spirit to the present version, but may differ in
+detail to address new problems or concerns. See
+https://www.gnu.org/licenses/.
+
+Each version of the License is given a distinguishing version number.
+If the Document specifies that a particular numbered version of this
+License "or any later version" applies to it, you have the option of
+following the terms and conditions either of that specified version or
+of any later version that has been published (not as a draft) by the
+Free Software Foundation. If the Document does not specify a version
+number of this License, you may choose any version ever published (not
+as a draft) by the Free Software Foundation. If the Document
+specifies that a proxy can decide which future versions of this
+License can be used, that proxy's public statement of acceptance of a
+version permanently authorizes you to choose that version for the
+Document.
+
+11. RELICENSING
+
+"Massive Multiauthor Collaboration Site" (or "MMC Site") means any
+World Wide Web server that publishes copyrightable works and also
+provides prominent facilities for anybody to edit those works. A
+public wiki that anybody can edit is an example of such a server. A
+"Massive Multiauthor Collaboration" (or "MMC") contained in the site
+means any set of copyrightable works thus published on the MMC site.
+
+"CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
+license published by Creative Commons Corporation, a not-for-profit
+corporation with a principal place of business in San Francisco,
+California, as well as future copyleft versions of that license
+published by that same organization.
+
+"Incorporate" means to publish or republish a Document, in whole or in
+part, as part of another Document.
+
+An MMC is "eligible for relicensing" if it is licensed under this
+License, and if all works that were first published under this License
+somewhere other than this MMC, and subsequently incorporated in whole or
+in part into the MMC, (1) had no cover texts or invariant sections, and
+(2) were thus incorporated prior to November 1, 2008.
+
+The operator of an MMC Site may republish an MMC contained in the site
+under CC-BY-SA on the same site at any time before August 1, 2009,
+provided the MMC is eligible for relicensing.
+
+
+ADDENDUM: How to use this License for your documents
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and
+license notices just after the title page:
+
+ Copyright (c) YEAR YOUR NAME.
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.3
+ or any later version published by the Free Software Foundation;
+ with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
+ A copy of the license is included in the section entitled "GNU
+ Free Documentation License".
+
+If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
+replace the "with...Texts." line with this:
+
+ with the Invariant Sections being LIST THEIR TITLES, with the
+ Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
+
+If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.
+
+If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License,
+to permit their use in free software.
diff --git a/LICENSE.GPL2 b/LICENSES/GPL-2.0-only.txt
index d159169d1..d159169d1 100644
--- a/LICENSE.GPL2
+++ b/LICENSES/GPL-2.0-only.txt
diff --git a/LICENSE.GPL3 b/LICENSES/GPL-3.0-only.txt
index 94a9ed024..94a9ed024 100644
--- a/LICENSE.GPL3
+++ b/LICENSES/GPL-3.0-only.txt
diff --git a/LICENSES/LGPL-3.0-only.txt b/LICENSES/LGPL-3.0-only.txt
new file mode 100644
index 000000000..65c5ca88a
--- /dev/null
+++ b/LICENSES/LGPL-3.0-only.txt
@@ -0,0 +1,165 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+ This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+ 0. Additional Definitions.
+
+ As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+ "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+ An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+ A "Combined Work" is a work produced by combining or linking an
+Application with the Library. The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+ The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+ The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+ 1. Exception to Section 3 of the GNU GPL.
+
+ You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+ 2. Conveying Modified Versions.
+
+ If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+ a) under this License, provided that you make a good faith effort to
+ ensure that, in the event an Application does not supply the
+ function or data, the facility still operates, and performs
+ whatever part of its purpose remains meaningful, or
+
+ b) under the GNU GPL, with none of the additional permissions of
+ this License applicable to that copy.
+
+ 3. Object Code Incorporating Material from Library Header Files.
+
+ The object code form of an Application may incorporate material from
+a header file that is part of the Library. You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+ a) Give prominent notice with each copy of the object code that the
+ Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the object code with a copy of the GNU GPL and this license
+ document.
+
+ 4. Combined Works.
+
+ You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+ a) Give prominent notice with each copy of the Combined Work that
+ the Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
+ document.
+
+ c) For a Combined Work that displays copyright notices during
+ execution, include the copyright notice for the Library among
+ these notices, as well as a reference directing the user to the
+ copies of the GNU GPL and this license document.
+
+ d) Do one of the following:
+
+ 0) Convey the Minimal Corresponding Source under the terms of this
+ License, and the Corresponding Application Code in a form
+ suitable for, and under terms that permit, the user to
+ recombine or relink the Application with a modified version of
+ the Linked Version to produce a modified Combined Work, in the
+ manner specified by section 6 of the GNU GPL for conveying
+ Corresponding Source.
+
+ 1) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (a) uses at run time
+ a copy of the Library already present on the user's computer
+ system, and (b) will operate properly with a modified version
+ of the Library that is interface-compatible with the Linked
+ Version.
+
+ e) Provide Installation Information, but only if you would otherwise
+ be required to provide such information under section 6 of the
+ GNU GPL, and only to the extent that such information is
+ necessary to install and execute a modified version of the
+ Combined Work produced by recombining or relinking the
+ Application with a modified version of the Linked Version. (If
+ you use option 4d0, the Installation Information must accompany
+ the Minimal Corresponding Source and Corresponding Application
+ Code. If you use option 4d1, you must provide the Installation
+ Information in the manner specified by section 6 of the GNU GPL
+ for conveying Corresponding Source.)
+
+ 5. Combined Libraries.
+
+ You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+ a) Accompany the combined library with a copy of the same work based
+ on the Library, uncombined with any other library facilities,
+ conveyed under the terms of this License.
+
+ b) Give prominent notice with the combined library that part of it
+ is a work based on the Library, and explaining where to find the
+ accompanying uncombined form of the same work.
+
+ 6. Revised Versions of the GNU Lesser General Public License.
+
+ The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+ If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
diff --git a/LICENSES/LicenseRef-Qt-Commercial.txt b/LICENSES/LicenseRef-Qt-Commercial.txt
new file mode 100644
index 000000000..825b1f358
--- /dev/null
+++ b/LICENSES/LicenseRef-Qt-Commercial.txt
@@ -0,0 +1,8 @@
+Licensees holding valid commercial Qt licenses may use this software in
+accordance with the the terms contained in a written agreement between
+you and The Qt Company. Alternatively, the terms and conditions that were
+accepted by the licensee when buying and/or downloading the
+software do apply.
+
+For the latest licensing terms and conditions, see https://www.qt.io/terms-conditions.
+For further information use the contact form at https://www.qt.io/contact-us.
diff --git a/LICENSES/Qt-GPL-exception-1.0.txt b/LICENSES/Qt-GPL-exception-1.0.txt
new file mode 100644
index 000000000..d0322bf0e
--- /dev/null
+++ b/LICENSES/Qt-GPL-exception-1.0.txt
@@ -0,0 +1,22 @@
+The Qt Company GPL Exception 1.0
+
+Exception 1:
+
+As a special exception you may create a larger work which contains the
+output of this application and distribute that work under terms of your
+choice, so long as the work is not otherwise derived from or based on
+this application and so long as the work does not in itself generate
+output that contains the output from this application in its original
+or modified form.
+
+Exception 2:
+
+As a special exception, you have permission to combine this application
+with Plugins licensed under the terms of your choice, to produce an
+executable, and to copy and distribute the resulting executable under
+the terms of your choice. However, the executable must be accompanied
+by a prominent notice offering all users of the executable the entire
+source code to this application, excluding the source code of the
+independent modules, but including any changes you have made to this
+application, under the terms of this license.
+
diff --git a/cmake/FindGPerf.cmake b/cmake/FindGPerf.cmake
new file mode 100644
index 000000000..e42b8a372
--- /dev/null
+++ b/cmake/FindGPerf.cmake
@@ -0,0 +1,23 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+find_program(GPerf_EXECUTABLE NAMES gperf)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(GPerf
+ FOUND_VAR
+ GPerf_FOUND
+ REQUIRED_VARS
+ GPerf_EXECUTABLE
+)
+
+if(GPerf_FOUND AND NOT TARGET GPerf::GPerf)
+ add_executable(GPerf::GPerf IMPORTED)
+ set_target_properties(GPerf::GPerf PROPERTIES IMPORTED_LOCATION "${GPerf_EXECUTABLE}")
+endif()
+
+include(FeatureSummary)
+set_package_properties(GPerf PROPERTIES
+ URL "https://www.gnu.org/software/gperf/"
+ DESCRIPTION "Perfect hash function generator"
+)
diff --git a/cmake/FindGn.cmake b/cmake/FindGn.cmake
new file mode 100644
index 000000000..fd03b7346
--- /dev/null
+++ b/cmake/FindGn.cmake
@@ -0,0 +1,50 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+if(NOT DEFINED WEBENGINE_ROOT_BUILD_DIR)
+ set(WEBENGINE_ROOT_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR})
+endif()
+find_program(Gn_EXECUTABLE NAMES gn PATHS "${WEBENGINE_ROOT_BUILD_DIR}/install/bin" NO_DEFAULT_PATH)
+if(NOT QT_HOST_PATH STREQUAL "")
+ find_program(Gn_EXECUTABLE NAMES gn PATHS ${QT_HOST_PATH}/${INSTALL_LIBEXECDIR} NO_DEFAULT_PATH)
+ # note: mingw installs with INSTALL_LIBEXECDIR = bin,
+ # however android on windows has INSTALL_LIBEXECDIR = libexec,
+ # so cover this case also
+ find_program(Gn_EXECUTABLE NAMES gn PATHS ${QT_HOST_PATH}/${INSTALL_BINDIR} NO_DEFAULT_PATH)
+endif()
+find_program(Gn_EXECUTABLE NAMES gn)
+
+if(Gn_EXECUTABLE)
+ execute_process(
+ COMMAND ${Gn_EXECUTABLE} --version
+ OUTPUT_VARIABLE Gn_VERSION
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+endif()
+
+string(REGEX MATCHALL "([1-9]\\.[0-9]\\.[0-9])\\.qtwebengine\\.qt\\.io.*" Gn_QT_VERSION "${Gn_VERSION}")
+if("${Gn_QT_VERSION}")
+ set(Gn_VERSION "${Gn_QT_VERSION}")
+endif()
+
+include(FindPackageHandleStandardArgs)
+
+find_package_handle_standard_args(Gn
+ FOUND_VAR
+ Gn_FOUND
+ VERSION_VAR
+ Gn_VERSION
+ REQUIRED_VARS
+ Gn_EXECUTABLE
+)
+
+if(Gn_FOUND AND NOT TARGET Gn::gn AND NOT CMAKE_SCRIPT_MODE_FILE)
+ add_executable(Gn::gn IMPORTED)
+ set_property(TARGET Gn::gn PROPERTY IMPORTED_LOCATION ${Gn_EXECUTABLE})
+endif()
+
+include(FeatureSummary)
+set_package_properties(Gn PROPERTIES
+ URL "https://gn.googlesource.com/gn/"
+ DESCRIPTION "Meta-build system"
+)
diff --git a/cmake/FindNinja.cmake b/cmake/FindNinja.cmake
new file mode 100644
index 000000000..9b1e718c0
--- /dev/null
+++ b/cmake/FindNinja.cmake
@@ -0,0 +1,34 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+if (NOT DEFINED WEBENGINE_ROOT_BUILD_DIR)
+ set(WEBENGINE_ROOT_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR})
+endif()
+
+find_program(Ninja_EXECUTABLE NAMES ninja ninja-build PATHS "${WEBENGINE_ROOT_BUILD_DIR}/install/bin" NO_DEFAULT_PATH)
+find_program(Ninja_EXECUTABLE NAMES ninja ninja-build)
+
+if(Ninja_EXECUTABLE)
+ execute_process(
+ COMMAND ${Ninja_EXECUTABLE} --version
+ OUTPUT_VARIABLE Ninja_VERSION
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+endif()
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(
+ Ninja
+ REQUIRED_VARS Ninja_EXECUTABLE
+ VERSION_VAR Ninja_VERSION)
+
+if(Ninja_FOUND AND NOT TARGET Ninja::ninja)
+ add_executable(Ninja::ninja IMPORTED)
+ set_property(TARGET Ninja::ninja PROPERTY IMPORTED_LOCATION ${Ninja_EXECUTABLE})
+endif()
+
+include(FeatureSummary)
+set_package_properties(Ninja PROPERTIES
+ URL "https://ninja-build.org/"
+ DESCRIPTION "Build tool"
+)
diff --git a/cmake/FindNodejs.cmake b/cmake/FindNodejs.cmake
new file mode 100644
index 000000000..00ce5696c
--- /dev/null
+++ b/cmake/FindNodejs.cmake
@@ -0,0 +1,40 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+find_program(Nodejs_EXECUTABLE NAMES node nodejs)
+
+if(Nodejs_EXECUTABLE)
+ execute_process(
+ COMMAND ${Nodejs_EXECUTABLE} --version
+ OUTPUT_VARIABLE Nodejs_VERSION
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ execute_process(
+ COMMAND ${Nodejs_EXECUTABLE} -p "process.arch"
+ OUTPUT_VARIABLE Nodejs_ARCH
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+endif()
+
+string (REGEX MATCHALL "([1-9][0-9])\..*" Nodejs_VERSION "${Nodejs_VERSION}")
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Nodejs
+ FOUND_VAR
+ Nodejs_FOUND
+ VERSION_VAR
+ Nodejs_VERSION
+ REQUIRED_VARS
+ Nodejs_EXECUTABLE
+)
+
+if(Nodejs_FOUND AND NOT TARGET Nodejs::Nodejs)
+ add_executable(Nodejs::Nodejs IMPORTED)
+ set_target_properties(Nodejs::Nodejs PROPERTIES IMPORTED_LOCATION "${Nodejs_EXECUTABLE}")
+endif()
+
+include(FeatureSummary)
+set_package_properties(Nodejs PROPERTIES
+ URL "https://nodejs.org/"
+ DESCRIPTION "JavaScript runtime environment that runs on the V8 engine"
+)
diff --git a/cmake/FindPkgConfigHost.cmake b/cmake/FindPkgConfigHost.cmake
new file mode 100644
index 000000000..a7f9ab0ae
--- /dev/null
+++ b/cmake/FindPkgConfigHost.cmake
@@ -0,0 +1,43 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+# this is just simply pkg config wrapper to pass executable path to gn
+
+if(CMAKE_CROSSCOMPILING)
+ # find pkg-config, use PKG_CONFIG_HOST if set
+ if((NOT PKG_CONFIG_HOST_EXECUTABLE) AND (NOT "$ENV{PKG_CONFIG_HOST}" STREQUAL ""))
+ set(PKG_CONFIG_HOST_EXECUTABLE "$ENV{PKG_CONFIG_HOST}" CACHE FILEPATH "pkg-config host executable")
+ endif()
+
+ find_program(PKG_CONFIG_HOST_EXECUTABLE NAMES "pkg-config" DOC "pkg-config executable"
+ NO_SYSTEM_ENVIRONMENT_PATH
+ NO_CMAKE_FIND_ROOT_PATH
+ )
+
+ if(PKG_CONFIG_HOST_EXECUTABLE)
+ mark_as_advanced(PKG_CONFIG_HOST_EXECUTABLE)
+ execute_process(COMMAND ${PKG_CONFIG_HOST_EXECUTABLE} --version
+ OUTPUT_VARIABLE PKG_CONFIG_HOST_VERSION_STRING
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_QUIET)
+ endif ()
+
+ include(FindPackageHandleStandardArgs)
+ find_package_handle_standard_args(PkgConfigHost
+ FOUND_VAR PkgConfigHost_FOUND
+ VERSION_VAR PKG_CONFIG_HOST_VERSION_STRING
+ REQUIRED_VARS PKG_CONFIG_HOST_EXECUTABLE
+ )
+else() # if not corss build simply wrap FindPkgConfig
+ find_package(PkgConfig)
+ if(PKG_CONFIG_FOUND)
+ include(FindPackageHandleStandardArgs)
+ set(PKG_CONFIG_HOST_VERSION ${PKG_CONFIG_VERSION})
+ set(PKG_CONFIG_HOST_EXECUTABLE ${PKG_CONFIG_EXECUTABLE})
+ find_package_handle_standard_args(PkgConfigHost
+ FOUND_VAR PkgConfigHost_FOUND
+ VERSION_VAR PKG_CONFIG_HOST_VERSION_STRING
+ REQUIRED_VARS PKG_CONFIG_HOST_EXECUTABLE
+ )
+ endif()
+endif()
diff --git a/cmake/FindSnappy.cmake b/cmake/FindSnappy.cmake
new file mode 100644
index 000000000..e1c7d231b
--- /dev/null
+++ b/cmake/FindSnappy.cmake
@@ -0,0 +1,38 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+
+if(TARGET Snappy::Snappy)
+ set(Snappy_FOUND TRUE)
+ return()
+endif()
+find_package(PkgConfig QUIET)
+
+if(PkgConfig_FOUND)
+ pkg_check_modules(Snappy snappy IMPORTED_TARGET)
+
+ if (TARGET PkgConfig::Snappy)
+ add_library(Snappy::Snappy INTERFACE IMPORTED)
+ target_link_libraries(Snappy::Snappy INTERFACE PkgConfig::Snappy)
+ set(Snappy_FOUND TRUE)
+ endif()
+endif()
+
+if(NOT TARGET Snappy::Snappy)
+ find_path(SNAPPY_INCLUDE_DIR NAMES snappy.h)
+ find_library(SNAPPY_LIBRARY NAMES snappy)
+
+ if(SNAPPY_LIBRARY AND SNAPPY_INCLUDE_DIR)
+ add_library(Snappy::Snappy UNKNOWN IMPORTED)
+ set_target_properties(Snappy::Snappy PROPERTIES
+ IMPORTED_LOCATION ${SNAPPY_LIBRARY}
+ INTERFACE_INCLUDE_DIRECTORIES ${SNAPPY_INCLUDE_DIR}
+ )
+ endif()
+
+ include(FindPackageHandleStandardArgs)
+ find_package_handle_standard_args(Snappy REQUIRED_VARS
+ SNAPPY_LIBRARY
+ SNAPPY_INCLUDE_DIR
+ )
+endif()
diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake
new file mode 100644
index 000000000..9864cf97b
--- /dev/null
+++ b/cmake/Functions.cmake
@@ -0,0 +1,1405 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+function(assertTargets)
+ cmake_parse_arguments(PARSE_ARGV 0 arg
+ "" "" "MODULES;TARGETS"
+ )
+ _qt_internal_validate_all_args_are_parsed(arg)
+
+ foreach(module ${arg_MODULES})
+ if(NOT DEFINED ${module}_SUPPORT)
+ set(${module}_SUPPORT ON PARENT_SCOPE)
+ set(${module}_SUPPORT ON)
+ endif()
+ if(${module}_SUPPORT)
+ foreach(qtTarget ${arg_TARGETS})
+ if(NOT TARGET Qt::${qtTarget})
+ set(${module}_ERROR "Missing required Qt::${qtTarget}." PARENT_SCOPE)
+ set(${module}_SUPPORT OFF PARENT_SCOPE)
+ break()
+ endif()
+ endforeach()
+ endif()
+ endforeach()
+endfunction()
+
+# TODO: this should be idealy in qtbase
+function(add_check_for_support)
+ cmake_parse_arguments(PARSE_ARGV 0 arg
+ "" "" "MODULES;MESSAGE;CONDITION"
+ )
+ _qt_internal_validate_all_args_are_parsed(arg)
+
+ foreach(module ${arg_MODULES})
+ if(NOT DEFINED ${module}_SUPPORT)
+ set(${module}_SUPPORT ON PARENT_SCOPE)
+ set(${module}_SUPPORT ON)
+ endif()
+ if(${module}_SUPPORT)
+ if("x${arg_CONDITION}" STREQUAL "x")
+ set(arg_CONDITION ON)
+ endif()
+ qt_evaluate_config_expression(result ${arg_CONDITION})
+ if(NOT ${result})
+ set(${module}_SUPPORT OFF PARENT_SCOPE)
+ set(${module}_ERROR ${arg_MESSAGE} PARENT_SCOPE)
+ qt_configure_add_report_entry(TYPE WARNING
+ MESSAGE "${module} won't be built. ${arg_MESSAGE}"
+ CONDITION ON
+ )
+ endif()
+ endif()
+ endforeach()
+endfunction()
+
+function(create_cxx_config cmakeTarget arch configFileName)
+ if(NOT QT_SUPERBUILD AND QT_WILL_INSTALL)
+ get_target_property(mocFilePath Qt6::moc IMPORTED_LOCATION)
+ else()
+ if(CMAKE_CROSSCOMPILING)
+ set(mocFilePath "${QT_HOST_PATH}/${INSTALL_LIBEXECDIR}/moc${CMAKE_EXECUTABLE_SUFFIX}")
+ else()
+ set(mocFilePath "${QT_BUILD_DIR}/${INSTALL_LIBEXECDIR}/moc${CMAKE_EXECUTABLE_SUFFIX}")
+ endif()
+ endif()
+ file(GENERATE
+ OUTPUT $<CONFIG>/${arch}/${configFileName}
+ CONTENT "\
+ set(GN_INCLUDES \"$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>\")\n\
+ set(GN_DEFINES \"$<TARGET_PROPERTY:COMPILE_DEFINITIONS>\")\n\
+ set(GN_LINK_OPTIONS \"$<TARGET_PROPERTY:LINK_OPTIONS>\")\n\
+ set(GN_CXX_COMPILE_OPTIONS \"$<TARGET_PROPERTY:COMPILE_OPTIONS>\")\n\
+ set(GN_MOC_PATH \"${mocFilePath}\")"
+# set(GN_LIBS $<TARGET_PROPERTY:LINK_LIBRARIES>)
+ CONDITION $<COMPILE_LANGUAGE:CXX>
+ TARGET ${cmakeTarget}
+ )
+endfunction()
+
+function(create_static_config cmakeTarget arch configFileName)
+ list(APPEND libs Png Jpeg Harfbuzz Freetype Zlib)
+ foreach(lib IN LISTS libs)
+ string(TOUPPER ${lib} out)
+ set(lib Qt::${lib}Private)
+ list(APPEND contents "set(GN_${out}_INCLUDES \"$<$<STREQUAL:$<TARGET_NAME_IF_EXISTS:${lib}>,${lib}>:$<TARGET_PROPERTY:${lib},INTERFACE_INCLUDE_DIRECTORIES>>\")")
+ endforeach()
+ list(JOIN contents "\n" contents)
+ file(GENERATE
+ OUTPUT $<CONFIG>/${arch}/${configFileName}
+ CONTENT "${contents}"
+ )
+endfunction()
+
+function(create_c_config cmakeTarget arch configFileName)
+ file(GENERATE
+ OUTPUT $<CONFIG>/${arch}/${configFileName}
+ CONTENT "set(GN_C_COMPILE_OPTIONS $<TARGET_PROPERTY:COMPILE_OPTIONS>)"
+ CONDITION $<COMPILE_LANGUAGE:C>
+ TARGET ${cmakeTarget})
+endfunction()
+
+function(create_gn_target_config target configFile)
+ get_target_property(elementList ${target} ELEMENTS)
+ get_target_property(prefix ${target} PREFIX)
+ file(WRITE ${configFile}
+ "set(PREFIX ${prefix})\nset(ELEMENTS ${elementList})\n"
+ )
+ foreach(element IN LISTS elementList)
+ get_target_property(prop ${target} ${prefix}_${element})
+ if(prop)
+ file(APPEND ${configFile} "set(${prefix}_${element} ${prop})\n")
+ endif()
+ endforeach()
+endfunction()
+
+function(add_gn_target target config arch)
+ add_custom_target(${target})
+ list(REMOVE_ITEM ARGN ${target})
+ list(REMOVE_ITEM ARGN ${config})
+ list(REMOVE_ITEM ARGN ${arch})
+ set_target_properties(${target} PROPERTIES
+ ELEMENTS "${ARGN}"
+ PREFIX "GN"
+ CONFIG ${config}
+ ARCH ${arch}
+ )
+endfunction()
+
+function(init_gn_config filePath)
+ include(${filePath})
+ set_directory_properties(PROPERTIES
+ ELEMENTS "${ELEMENTS}"
+ PREFIX "${PREFIX}"
+ )
+ applyToGnTarget(DIRECTORY)
+endfunction()
+
+function(read_gn_config filePath)
+ include(${filePath})
+ applyToGnTarget(DIRECTORY)
+endfunction()
+
+# this runs also in script mode, so we use than DIRECTORY
+macro(applyToGnTarget)
+ set(type ${ARGV0})
+ set(target ${ARGV1})
+ get_property(elementList ${type} ${target} PROPERTY ELEMENTS)
+ get_property(prefix ${type} ${target} PROPERTY PREFIX)
+ foreach(element IN LISTS elementList)
+ if(${prefix}_${element})
+ message(DEBUG "${prefix}_${element} = ${${prefix}_${element}}")
+ set_property(${type} ${target} APPEND PROPERTY ${prefix}_${element} ${${prefix}_${element}})
+ endif()
+ endforeach()
+endmacro()
+
+function(extend_gn_target target)
+ get_target_property(elements ${target} ELEMENTS)
+ cmake_parse_arguments(PARSE_ARGV 1 GN "" "" "CONDITION;${elements}")
+ _qt_internal_validate_all_args_are_parsed(GN)
+
+ if("x${GN_CONDITION}" STREQUAL "x")
+ set(GN_CONDITION ON)
+ endif()
+ qt_evaluate_config_expression(result ${GN_CONDITION})
+ if(${result})
+ message(DEBUG "extend_gn_target(${target} CONDITION ${GN_CONDITION} ...): Evaluated")
+ applyToGnTarget(TARGET ${target})
+ endif()
+endfunction()
+
+function(extend_gn_list outList)
+ cmake_parse_arguments(PARSE_ARGV 1 GN "" "" "ARGS;CONDITION")
+ _qt_internal_validate_all_args_are_parsed(GN)
+
+ if("x${GN_CONDITION}" STREQUAL "x")
+ set(GN_CONDITION ON)
+ endif()
+ qt_evaluate_config_expression(result ${GN_CONDITION})
+ if(${result})
+ set(value "true")
+ else()
+ set(value "false")
+ endif()
+ message(DEBUG "extend_gn_list(${outList} ${GN_ARGS} CONDITION ${GN_CONDITION} ...): Evaluated to ${value}")
+ foreach(gnArg ${GN_ARGS})
+ set(${outList} "${${outList}}" "${gnArg}=${value}")
+ endforeach()
+ set(${outList} "${${outList}}" PARENT_SCOPE)
+endfunction()
+
+function(configure_gn_target sourceDir inFilePath outFilePath)
+ # FIXME: GN_CONFIG
+ set(GN_CONFIG NOTUSED)
+
+ set(path_mode REALPATH)
+ if(APPLE AND QT_ALLOW_SYMLINK_IN_PATHS)
+ set(path_mode ABSOLUTE)
+ endif()
+
+ # GN_SOURCES GN_HEADERS
+ get_property(gnSources DIRECTORY PROPERTY GN_SOURCES)
+ foreach(gnSourceFile ${gnSources})
+ get_filename_component(gnSourcePath ${sourceDir}/${gnSourceFile} ${path_mode})
+ list(APPEND sourceList \"${gnSourcePath}\")
+ endforeach()
+ set(GN_HEADERS ${sourceList})
+ set(GN_SOURCES ${sourceList})
+ list(FILTER GN_HEADERS INCLUDE REGEX "^.+\\.h\"$")
+ list(FILTER GN_SOURCES EXCLUDE REGEX "^.+\\.h\"$")
+
+ # GN_DEFINES
+ get_property(gnDefines DIRECTORY PROPERTY GN_DEFINES)
+ list(REMOVE_DUPLICATES gnDefines)
+ foreach(gnDefine ${gnDefines})
+ list(APPEND GN_ARGS_DEFINES \"-D${gnDefine}\")
+ list(APPEND GN_DEFINES \"${gnDefine}\")
+ endforeach()
+
+ # GN_INCLUDES
+ get_property(gnIncludes DIRECTORY PROPERTY GN_INCLUDES)
+ list(REMOVE_DUPLICATES gnIncludes)
+ foreach(gnInclude ${gnIncludes})
+ get_filename_component(gnInclude ${gnInclude} ${path_mode})
+ list(APPEND GN_ARGS_INCLUDES \"-I${gnInclude}\")
+ list(APPEND GN_INCLUDE_DIRS \"${gnInclude}\")
+ endforeach()
+
+ # MOC
+ get_property(mocFilePath DIRECTORY PROPERTY GN_MOC_PATH)
+ set(GN_ARGS_MOC_BIN \"${mocFilePath}\")
+
+ # GN_CFLAGS_CC
+ get_property(gnCxxCompileOptions DIRECTORY PROPERTY GN_CXX_COMPILE_OPTIONS)
+ foreach(gnCxxCompileOption ${gnCxxCompileOptions})
+ list(APPEND GN_CFLAGS_CC \"${gnCxxCompileOption}\")
+ endforeach()
+ list(REMOVE_DUPLICATES GN_CFLAGS_CC)
+
+ # GN_CFLAGS_C
+ get_property(gnCCompileOptions DIRECTORY PROPERTY GN_C_COMPILE_OPTIONS)
+ foreach(gnCCompileOption ${gnCCompileOptions})
+ list(APPEND GN_CFLAGS_C \"${gnCCompileOption}\")
+ endforeach()
+ list(REMOVE_DUPLICATES GN_CFLAGS_C)
+
+ # GN_SOURCE_ROOT
+ get_filename_component(GN_SOURCE_ROOT "${sourceDir}" ${path_mode})
+
+ if(APPLE) # this runs in scrpit mode without qt-cmake so on MACOS here
+ recoverFrameworkBuild(GN_INCLUDE_DIRS GN_CFLAGS_C)
+ endif()
+
+ # Static setup
+ set(libs PNG JPEG FREETYPE HARFBUZZ ZLIB)
+ foreach(lib ${libs})
+ get_property(staticIncludes DIRECTORY PROPERTY GN_${lib}_INCLUDES)
+ foreach(is ${staticIncludes})
+ list(APPEND GN_${lib}_INCLUDES \"${is}\")
+ endforeach()
+ endforeach()
+ foreach(item GN_HEADERS GN_SOURCES GN_ARGS_DEFINES GN_DEFINES GN_ARGS_INCLUDES
+ GN_INCLUDE_DIRS GN_CFLAGS_CC GN_CFLAGS_C GN_PNG_INCLUDES GN_JPEG_INCLUDES
+ GN_FREETYPE_INCLUDES GN_HARFBUZZ_INCLUDES GN_ZLIB_INCLUDES)
+ string(REPLACE ";" ",\n " ${item} "${${item}}")
+ endforeach()
+ configure_file(${inFilePath} ${outFilePath} @ONLY)
+endfunction()
+
+# we had no qtsync on headers during configure, so take current interface from expression
+# generator from our WebEngieCore target so we can apply it for our buildGn target
+function(resolve_target_includes resultVar target)
+ get_target_property(includeDirs ${target} INCLUDE_DIRECTORIES)
+ foreach(includeDir ${includeDirs})
+ if(includeDir MATCHES "\\$<BUILD_INTERFACE:([^,>]+)>")
+ list(APPEND includeDirList ${CMAKE_MATCH_1})
+ endif()
+ endforeach()
+ set(${resultVar} ${includeDirList} PARENT_SCOPE)
+endfunction()
+
+function(get_install_config result)
+ if(DEFINED CMAKE_BUILD_TYPE)
+ set(${result} ${CMAKE_BUILD_TYPE} PARENT_SCOPE)
+ elseif(DEFINED CMAKE_CONFIGURATION_TYPES)
+ if("Release" IN_LIST CMAKE_CONFIGURATION_TYPES)
+ set(${result} "Release" PARENT_SCOPE)
+ elseif("RelWithDebInfo" IN_LIST CMAKE_CONFIGURATION_TYPES)
+ set(${result} "RelWithDebInfo" PARENT_SCOPE)
+ elseif("Debug" IN_LIST CMAKE_CONFIGURATION_TYPES)
+ set(${result} "Debug" PARENT_SCOPE)
+ else()
+ # assume MinSizeRel ?
+ set(${result} "${CMAKE_CONFIGURATION_TYPES}" PARENT_SCOPE)
+ endif()
+ endif()
+endfunction()
+
+# we need to pass -F or -iframework in case of frameworks builds, which gn treats as
+# compiler flag and cmake as include dir, so swap it.
+function(recoverFrameworkBuild includeDirs compilerFlags)
+ foreach(includeDir ${${includeDirs}})
+ if(includeDir MATCHES "^\"(.*/([^/]+)\\.framework)\"$")
+ list(APPEND frameworkDirs \"-iframework${CMAKE_MATCH_1}/..\")
+ else()
+ list(APPEND newIncludeDirs ${includeDir})
+ endif()
+ endforeach()
+ set(${includeDirs} ${newIncludeDirs} PARENT_SCOPE)
+ set(${compilerFlags} ${${compilerFlags}} ${frameworkDirs} PARENT_SCOPE)
+endfunction()
+
+# we need to fix namespace ambiguity issues between Qt and Chromium like
+# forward declarations of NSString.
+function(get_forward_declaration_macro result)
+ if(MACOS)
+ set(${result} " \"Q_FORWARD_DECLARE_OBJC_CLASS(name)=class name;\" " PARENT_SCOPE)
+ else()
+ set(${result} "Q_FORWARD_DECLARE_OBJC_CLASS=QT_FORWARD_DECLARE_CLASS" PARENT_SCOPE)
+ endif()
+endfunction()
+
+function(get_darwin_sdk_version result)
+ if(APPLE)
+ if(IOS)
+ set(sdk_name "iphoneos")
+ elseif(TVOS)
+ set(sdk_name "appletvos")
+ elseif(WATCHOS)
+ set(sdk_name "watchos")
+ else()
+ # Default to macOS
+ set(sdk_name "macosx")
+ endif()
+ set(xcrun_version_arg "--show-sdk-version")
+ execute_process(COMMAND /usr/bin/xcrun --sdk ${sdk_name} ${xcrun_version_arg}
+ OUTPUT_VARIABLE sdk_version
+ ERROR_VARIABLE xcrun_error)
+ if(NOT sdk_version)
+ message(FATAL_ERROR
+ "Can't determine darwin ${sdk_name} SDK version. Error: ${xcrun_error}")
+ endif()
+ string(STRIP "${sdk_version}" sdk_version)
+ set(${result} "${sdk_version}" PARENT_SCOPE)
+ endif()
+endfunction()
+
+function(get_ios_target_triple_and_sysroot result arch)
+ get_ios_sysroot(sysroot ${arch})
+ set(${result}
+ -target ${arch}-apple-ios${CMAKE_OSX_DEPLOYMENT_TARGET}
+ -isysroot ${sysroot} PARENT_SCOPE
+ )
+endfunction()
+
+function(add_ninja_target)
+ cmake_parse_arguments(PARSE_ARGV 0 arg
+ "" "TARGET;CMAKE_TARGET;NINJA_TARGET;BUILDDIR;NINJA_STAMP;NINJA_DATA_STAMP;CONFIG;ARCH" ""
+ )
+ _qt_internal_validate_all_args_are_parsed(arg)
+ set(stamps ${arg_NINJA_STAMP} ${arg_NINJA_DATA_STAMP})
+ list(TRANSFORM stamps PREPEND "${arg_BUILDDIR}/${arg_CONFIG}/${arg_ARCH}/")
+ add_custom_target(${arg_TARGET} DEPENDS ${stamps})
+ set_target_properties(${arg_TARGET} PROPERTIES
+ CONFIG ${arg_CONFIG}
+ ARCH ${arg_ARCH}
+ CMAKE_TARGET ${arg_CMAKE_TARGET}
+ NINJA_TARGET ${arg_NINJA_TARGET}
+ NINJA_STAMP ${arg_NINJA_STAMP}
+ )
+endfunction()
+
+function(get_copy_of_response_file result target rsp)
+ get_target_property(config ${target} CONFIG)
+ get_target_property(ninjaTarget ${target} NINJA_TARGET)
+ get_target_property(cmakeTarget ${target} CMAKE_TARGET)
+ set(rsp_dst "CMakeFiles_${ninjaTarget}_${config}_${rsp}.rsp")
+ set(rsp_src "${${result}}")
+ if(NOT QT_SUPERBUILD)
+ set(rsp_output ${PROJECT_BINARY_DIR}/${rsp_dst})
+ else()
+ set(rsp_output ${PROJECT_BINARY_DIR}/../${rsp_dst})
+ endif()
+ add_custom_command(
+ OUTPUT ${rsp_output}
+ COMMAND ${CMAKE_COMMAND} -E copy ${rsp_src} ${rsp_output}
+ DEPENDS ${rsp_src}
+ USES_TERMINAL
+ )
+ set(${result} ${rsp_dst} PARENT_SCOPE)
+ add_custom_target(${cmakeTarget}_${rsp}_copy_${config}
+ DEPENDS ${rsp_output}
+ )
+ add_dependencies(${cmakeTarget} ${cmakeTarget}_${rsp}_copy_${config})
+endfunction()
+
+function(add_archiver_options target buildDir completeStatic)
+ get_target_property(config ${target} CONFIG)
+ string(TOUPPER ${config} cfg)
+ get_target_property(ninjaTarget ${target} NINJA_TARGET)
+ get_target_property(cmakeTarget ${target} CMAKE_TARGET)
+ set(objects_out "${buildDir}/${cmakeTarget}_objects.o")
+ add_library(GnObject_${cmakeTarget}_${config} OBJECT IMPORTED GLOBAL)
+ target_link_libraries(${cmakeTarget} PRIVATE $<$<CONFIG:${config}>:GnObject_${cmakeTarget}_${config}>)
+ set_property(TARGET GnObject_${cmakeTarget}_${config} PROPERTY IMPORTED_OBJECTS_${cfg} ${objects_out})
+endfunction()
+
+function(add_linker_options target buildDir completeStatic)
+ get_target_property(config ${target} CONFIG)
+ get_target_property(ninjaTarget ${target} NINJA_TARGET)
+ get_target_property(cmakeTarget ${target} CMAKE_TARGET)
+ string(TOUPPER ${cmakeTarget} tg)
+ string(TOUPPER ${config} cfg)
+ set(objects_rsp "${buildDir}/${ninjaTarget}_objects.rsp")
+ set(archives_rsp "${buildDir}/${ninjaTarget}_archives.rsp")
+ set(libs_rsp "${buildDir}/${ninjaTarget}_libs.rsp")
+ set(ldir_rsp "${buildDir}/${ninjaTarget}_ldir.rsp")
+ set_target_properties(${cmakeTarget} PROPERTIES STATIC_LIBRARY_OPTIONS "@${objects_rsp}")
+ if(LINUX OR ANDROID)
+ get_gn_arch(cpu ${TEST_architecture_arch})
+ if(CMAKE_CROSSCOMPILING AND cpu STREQUAL "arm" AND ${config} STREQUAL "Debug")
+ target_link_options(${cmakeTarget} PRIVATE "LINKER:--long-plt")
+ endif()
+ target_link_options(${cmakeTarget} PRIVATE "$<$<CONFIG:${config}>:@${objects_rsp}>")
+ # Chromium is meant for linking with gc-sections, which seems to not always get applied otherwise
+ target_link_options(${cmakeTarget} PRIVATE "-Wl,--gc-sections")
+ if(NOT completeStatic)
+ target_link_libraries(${cmakeTarget} PRIVATE
+ "$<1:-Wl,--start-group $<$<CONFIG:${config}>:@${archives_rsp}> -Wl,--end-group>"
+ )
+ endif()
+
+ # linker here options are just to prevent processing it by cmake
+ target_link_libraries(${cmakeTarget} PRIVATE
+ "$<1:-Wl,--no-fatal-warnings $<$<CONFIG:${config}>:@${ldir_rsp}> $<$<CONFIG:${config}>:@${libs_rsp}> -Wl,--no-fatal-warnings>"
+ )
+ unset(cpu)
+ endif()
+ if(MACOS)
+ target_link_options(${cmakeTarget} PRIVATE "$<$<CONFIG:${config}>:@${objects_rsp}>")
+ if(NOT completeStatic)
+ target_link_options(${cmakeTarget} PRIVATE "$<$<CONFIG:${config}>:@${archives_rsp}>")
+ endif()
+ target_link_options(${cmakeTarget} PRIVATE "$<$<CONFIG:${config}>:@${ldir_rsp}>" "$<$<CONFIG:${config}>:@${libs_rsp}>")
+ endif()
+ if(WIN32)
+ get_copy_of_response_file(objects_rsp ${target} objects)
+ if(NOT MINGW)
+ target_link_options(${cmakeTarget}
+ PRIVATE /DELAYLOAD:mf.dll /DELAYLOAD:mfplat.dll /DELAYLOAD:mfreadwrite.dll /DELAYLOAD:winmm.dll
+ )
+ # enable larger PDBs if webenginecore debug build
+ if(cmakeTarget STREQUAL "WebEngineCore")
+ target_link_options(${cmakeTarget} PRIVATE "$<$<CONFIG:Debug>:/pdbpagesize:8192>")
+ endif()
+ endif()
+ target_link_options(${cmakeTarget} PRIVATE "$<$<CONFIG:${config}>:@${objects_rsp}>")
+ if(NOT completeStatic)
+ get_copy_of_response_file(archives_rsp ${target} archives)
+ target_link_options(${cmakeTarget} PRIVATE "$<$<CONFIG:${config}>:@${archives_rsp}>")
+ endif()
+ get_copy_of_response_file(libs_rsp ${target} libs)
+ target_link_options(${cmakeTarget} PRIVATE "$<$<CONFIG:${config}>:@${libs_rsp}>")
+ # we need libs rsp also when linking process with sandbox lib
+ set_property(TARGET ${cmakeTarget} PROPERTY LIBS_RSP ${libs_rsp})
+ endif()
+endfunction()
+
+function(add_intermediate_archive target buildDir completeStatic)
+ get_target_property(config ${target} CONFIG)
+ get_target_property(arch ${target} ARCH)
+ get_target_property(ninjaTarget ${target} NINJA_TARGET)
+ get_target_property(cmakeTarget ${target} CMAKE_TARGET)
+ get_target_property(ninjaStamp ${target} NINJA_STAMP)
+ string(TOUPPER ${config} cfg)
+ set(objects_rsp "${buildDir}/${ninjaTarget}_objects.rsp")
+ set(objects_out "${buildDir}/${cmakeTarget}_objects.o")
+ if(NOT completeStatic)
+ set(archives_rsp "${buildDir}/${ninjaTarget}_archives.rsp")
+ set(archives_out "${buildDir}/${cmakeTarget}_archives.o")
+ set(archives_command
+ COMMAND clang++ -r -nostdlib -arch ${arch}
+ -o ${archives_out}
+ -Wl,-keep_private_externs
+ -Wl,-all_load
+ @${archives_rsp}
+ )
+ endif()
+ add_custom_command(
+ OUTPUT ${buildDir}/${cmakeTarget}.a
+ BYPRODUCTS ${objects_out} ${archives_out}
+ COMMAND clang++ -r -nostdlib -arch ${arch}
+ -o ${objects_out}
+ -Wl,-keep_private_externs
+ @${objects_rsp}
+ ${archives_command}
+ COMMAND ar -crs
+ ${buildDir}/${cmakeTarget}.a
+ ${objects_out}
+ ${archives_out}
+ DEPENDS
+ ${buildDir}/${ninjaStamp}
+ WORKING_DIRECTORY "${buildDir}/../../.."
+ COMMENT "Creating intermediate archives for ${cmakeTarget}/${config}/${arch}"
+ USES_TERMINAL
+ VERBATIM
+ COMMAND_EXPAND_LISTS
+ )
+endfunction()
+
+function(add_intermediate_object target buildDir completeStatic)
+ get_target_property(config ${target} CONFIG)
+ get_target_property(arch ${target} ARCH)
+ get_target_property(ninjaTarget ${target} NINJA_TARGET)
+ get_target_property(cmakeTarget ${target} CMAKE_TARGET)
+ get_target_property(ninjaStamp ${target} NINJA_STAMP)
+ string(TOUPPER ${config} cfg)
+ if(IOS)
+ get_ios_target_triple_and_sysroot(args ${arch})
+ endif()
+ set(objects_rsp "${buildDir}/${ninjaTarget}_objects.rsp")
+ set(objects_out "${buildDir}/${cmakeTarget}_objects.o")
+ add_custom_command(
+ OUTPUT ${objects_out}
+ COMMAND clang++ -r -nostdlib
+ ${args}
+ -o ${objects_out}
+ -Wl,-keep_private_externs
+ @${objects_rsp}
+ DEPENDS
+ ${buildDir}/${ninjaStamp}
+ WORKING_DIRECTORY "${buildDir}/../../.."
+ COMMENT "Creating intermediate object files for ${cmakeTarget}/${config}/${arch}"
+ USES_TERMINAL
+ VERBATIM
+ COMMAND_EXPAND_LISTS
+ )
+endfunction()
+
+# Lipo the object files together to a single fat archive
+function(create_lipo_command target buildDir fileName)
+ get_target_property(config ${target} CONFIG)
+ get_architectures(archs)
+ foreach(arch ${archs})
+ list(APPEND lipo_objects ${buildDir}/${arch}/${fileName})
+ endforeach()
+ add_custom_command(
+ OUTPUT ${buildDir}/${fileName}
+ COMMAND lipo -create
+ -output ${buildDir}/${fileName}
+ ARGS ${lipo_objects}
+ DEPENDS ${lipo_objects}
+ USES_TERMINAL
+ COMMENT "Running lipo for ${target}/${config}/${arch}"
+ VERBATIM
+ )
+endfunction()
+
+# this function only deals with objects as it is only
+# used by qtpdf and we do not need anything more
+function(add_ios_lipo_command target buildDir)
+ get_target_property(config ${target} CONFIG)
+ get_target_property(cmakeTarget ${target} CMAKE_TARGET)
+ set(fileName ${cmakeTarget}_objects.o)
+ create_lipo_command(${target} ${buildDir} ${fileName})
+ add_custom_target(lipo_${cmakeTarget}_${config} DEPENDS
+ ${buildDir}/${fileName}
+ )
+ add_dependencies(${cmakeTarget} lipo_${cmakeTarget}_${config})
+ qt_internal_get_target_property(options ${cmakeTarget} STATIC_LIBRARY_OPTIONS)
+ set_target_properties(${cmakeTarget} PROPERTIES STATIC_LIBRARY_OPTIONS
+ "${options}$<$<CONFIG:${config}>:${buildDir}/${fileName}>"
+ )
+endfunction()
+
+function(add_lipo_command target buildDir)
+ get_target_property(config ${target} CONFIG)
+ get_target_property(cmakeTarget ${target} CMAKE_TARGET)
+ get_target_property(ninjaTarget ${target} NINJA_TARGET)
+ set(fileName ${cmakeTarget}.a)
+ create_lipo_command(${target} ${buildDir} ${fileName})
+ add_library(${cmakeTarget}_${config} STATIC IMPORTED GLOBAL)
+ set_property(TARGET ${cmakeTarget}_${config}
+ PROPERTY IMPORTED_LOCATION ${buildDir}/${fileName}
+ )
+ add_custom_target(lipo_${cmakeTarget}_${config} DEPENDS
+ ${buildDir}/${fileName}
+ )
+ add_dependencies(${cmakeTarget}_${config} lipo_${cmakeTarget}_${config})
+ target_link_libraries(${cmakeTarget} PRIVATE ${cmakeTarget}_${config})
+
+ # Just link with dynamic libs once
+ # TODO: this is evil hack, since cmake has no idea about libs
+ set(libs_rsp "${buildDir}/x86_64/${ninjaTarget}_libs.rsp")
+ target_link_options(${cmakeTarget} PRIVATE "$<$<CONFIG:${config}>:@${libs_rsp}>")
+endfunction()
+
+function(qt_internal_add_external_project_dependency_to_root_project name)
+ set(independent_args)
+ cmake_policy(PUSH)
+ if(POLICY CMP0114)
+ set(independent_args INDEPENDENT TRUE)
+ cmake_policy(SET CMP0114 NEW)
+ endif()
+
+ # Force configure step to re-run after we configure the root project
+ set(reconfigure_check_file ${CMAKE_CURRENT_BINARY_DIR}/reconfigure_${name}.stamp)
+ file(TOUCH ${reconfigure_check_file})
+ ExternalProject_Add_Step(${name} reconfigure-check
+ DEPENDERS configure
+ DEPENDS ${reconfigure_check_file}
+ ${independent_args}
+ )
+
+ cmake_policy(POP)
+endfunction()
+
+# Function maps TEST_architecture_arch or CMAKE_SYSTEM_PROCESSOR into gn architecture
+function(get_gn_arch result arch)
+ set(armList arm armv7-a)
+ set(mips64List mips64 mipsel64)
+ set(x86List i386 i686)
+ set(x64List x86_64 AMD64 x86_64h aarch64)
+ if(arch IN_LIST x86List)
+ set(${result} "x86" PARENT_SCOPE)
+ elseif(arch IN_LIST x64List)
+ set(${result} "x64" PARENT_SCOPE)
+ elseif(arch IN_LIST armList)
+ set(${result} "arm" PARENT_SCOPE)
+ elseif(arch STREQUAL "arm64")
+ set(${result} "arm64" PARENT_SCOPE)
+ elseif(arch STREQUAL "mipsel")
+ set(${result} "mipsel" PARENT_SCOPE)
+ elseif(arch IN_LIST mipsList)
+ set(${result} "mips64el" PARENT_SCOPE)
+ elseif(arch STREQUAL "riscv64")
+ set(${result} "riscv64" PARENT_SCOPE)
+ else()
+ message(FATAL_ERROR "Unknown architecture: ${arch}")
+ endif()
+endfunction()
+
+# Function maps gn architecture for v8
+function(get_v8_arch result targetArch hostArch)
+ set(list32 x86 arm mipsel riscv32)
+ if(hostArch STREQUAL targetArch)
+ set(${result} "${targetArch}" PARENT_SCOPE)
+ elseif(targetArch IN_LIST list32)
+ # 32bit target which needs a 32bit compatible host
+ if(hostArch STREQUAL "x64")
+ set(${result} "x86" PARENT_SCOPE)
+ elseif(hostArch STREQUAL "arm64")
+ set(${result} "arm" PARENT_SCOPE)
+ elseif(hostArch STREQUAL "mips64el")
+ set(${result} "mipsel" PARENT_SCOPE)
+ elseif(hostArch STREQUAL "riscv64")
+ set(${result} "riscv32" PARENT_SCOPE)
+ elseif(hostArch IN_LIST list32)
+ set(${result} "${hostArch}" PARENT_SCOPE)
+ else()
+ message(FATAL_ERROR "Unknown architecture: ${hostArch}")
+ endif()
+ else()
+ # assume 64bit target which matches 64bit host
+ set(${result} "${hostArch}" PARENT_SCOPE)
+ endif()
+endfunction()
+
+function(get_gn_os result)
+ if(WIN32)
+ set(${result} "win" PARENT_SCOPE)
+ elseif(LINUX)
+ set(${result} "linux" PARENT_SCOPE)
+ elseif(MACOS)
+ set(${result} "mac" PARENT_SCOPE)
+ elseif(IOS)
+ set(${result} "ios" PARENT_SCOPE)
+ else()
+ message(DEBUG "Unrecognized OS")
+ endif()
+endfunction()
+
+function(get_gn_is_clang result)
+ if(CLANG)
+ set(${result} "true" PARENT_SCOPE)
+ else()
+ set(${result} "false" PARENT_SCOPE)
+ endif()
+endfunction()
+
+
+function(get_gn_is_mingw result)
+ if(MINGW)
+ set(${result} "true" PARENT_SCOPE)
+ else()
+ set(${result} "false" PARENT_SCOPE)
+ endif()
+endfunction()
+
+function(get_ios_sysroot result arch)
+ if(NOT CMAKE_APPLE_ARCH_SYSROOTS)
+ message(FATAL_ERROR "CMAKE_APPLE_ARCH_SYSROOTS not set.")
+ endif()
+ get_architectures(archs)
+ list(FIND archs ${arch} known_arch)
+ if (known_arch EQUAL "-1")
+ message(FATAL_ERROR "Unknown iOS architecture ${arch}.")
+ endif()
+ list(GET CMAKE_APPLE_ARCH_SYSROOTS ${known_arch} sysroot)
+ set(${result} ${sysroot} PARENT_SCOPE)
+endfunction()
+
+function(configure_gn_toolchain name cpu v8Cpu toolchainIn toolchainOut)
+ set(GN_TOOLCHAIN ${name})
+ get_gn_os(GN_OS)
+ get_gn_is_clang(GN_IS_CLANG)
+ get_gn_is_mingw(GN_IS_MINGW)
+ set(GN_CPU ${cpu})
+ set(GN_V8_CPU ${v8Cpu})
+ configure_file(${toolchainIn} ${toolchainOut}/BUILD.gn @ONLY)
+endfunction()
+
+function(create_pkg_config_wrapper wrapperName wrapperCmd)
+ file(WRITE ${wrapperName}
+ "#!/bin/sh\n"
+ "unset PKG_CONFIG_LIBDIR\n"
+ "unset PKG_CONFIG_PATH\n"
+ "unset PKG_CONFIG_SYSROOT_DIR\n"
+ "exec ${wrapperCmd} \"$@\""
+ )
+ file(CHMOD ${wrapperName} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE)
+endfunction()
+
+function(extract_cflag result cflag)
+ set(i 1)
+ while(NOT "x${CMAKE_CXX_COMPILER_ARG${i}}" STREQUAL "x")
+ list(APPEND cflags ${CMAKE_CXX_COMPILER_ARG${i}})
+ math(EXPR i "${i} + 1")
+ endwhile()
+ list(APPEND cflags ${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS})
+ string(REPLACE ";" " " cflags "${cflags}")
+ message(DEBUG "Found cflags: ${cflags}")
+ if(cflags MATCHES "-${cflag}=([^ ]+)")
+ set(${result} ${CMAKE_MATCH_1} PARENT_SCOPE)
+ return()
+ endif()
+ if(cflags MATCHES "-${cflag}")
+ set(${result} ON PARENT_SCOPE)
+ else()
+ set(${result} OFF PARENT_SCOPE)
+ endif()
+endfunction()
+
+function(extend_gn_list_cflag outList)
+ cmake_parse_arguments(PARSE_ARGV 1 GN "" "" "ARG;CFLAG")
+ _qt_internal_validate_all_args_are_parsed(GN)
+
+ extract_cflag(cflag "${GN_CFLAG}")
+ if(cflag)
+ set(${outList} "${${outList}}" "${GN_ARG}=\"${cflag}\"" PARENT_SCOPE)
+ endif()
+endfunction()
+
+function(get_arm_version result cflag)
+ if(cflag MATCHES "^armv([0-9])")
+ set(${result} ${CMAKE_MATCH_1} PARENT_SCOPE)
+ endif()
+endfunction()
+
+function(check_thumb result)
+ extract_cflag(thumb "mthumb")
+ if(thumb)
+ set(${result} TRUE PARENT_SCOPE)
+ return()
+ else()
+ extract_cflag(marm "marm")
+ if(marm)
+ set(${result} FALSE PARENT_SCOPE)
+ return()
+ else()
+ extract_cflag(march "march")
+ get_arm_version(arm_version ${march})
+ if(arm_version GREATER_EQUAL 7)
+ set(${result} TRUE PARENT_SCOPE)
+ return()
+ endif()
+ endif()
+ endif()
+ set(${result} FALSE PARENT_SCOPE)
+endfunction()
+
+macro(create_pkg_config_host_wrapper buildDir)
+ find_package(PkgConfigHost)
+ if(CMAKE_CROSSCOMPILING)
+ create_pkg_config_wrapper("${buildDir}/pkg-config-host_wrapper.sh" "${PKG_CONFIG_HOST_EXECUTABLE}")
+ set(PKG_CONFIG_HOST_EXECUTABLE "${buildDir}/pkg-config-host_wrapper.sh")
+ endif()
+endmacro()
+
+macro(setup_toolchains)
+ get_gn_arch(gn_arch ${TEST_architecture_arch})
+ if(NOT CMAKE_CROSSCOMPILING) # delivered by hostBuild project
+ configure_gn_toolchain(host ${gn_arch} ${gn_arch}
+ ${WEBENGINE_ROOT_SOURCE_DIR}/src/host/BUILD.toolchain.gn.in
+ ${buildDir}/host_toolchain)
+ configure_gn_toolchain(v8 ${gn_arch} ${gn_arch}
+ ${WEBENGINE_ROOT_SOURCE_DIR}/src/host/BUILD.toolchain.gn.in
+ ${buildDir}/v8_toolchain)
+ endif()
+ configure_gn_toolchain(target ${gn_arch} ${gn_arch}
+ ${WEBENGINE_ROOT_SOURCE_DIR}/src/host/BUILD.toolchain.gn.in
+ ${buildDir}/target_toolchain)
+ unset(gn_arch)
+endmacro()
+
+macro(append_build_type_setup)
+ list(APPEND gnArgArg
+ is_qtwebengine=true
+ init_stack_vars=false
+ is_component_build=false
+ is_shared=true
+ use_sysroot=false
+ forbid_non_component_debug_builds=false
+ treat_warnings_as_errors=false
+ use_allocator_shim=false
+ use_partition_alloc=true
+ use_partition_alloc_as_malloc=false
+ use_custom_libcxx=false
+ enable_rust=false # We do not yet support rust
+ )
+ if(${config} STREQUAL "Debug")
+ list(APPEND gnArgArg is_debug=true symbol_level=2)
+ if(WIN32)
+ list(APPEND gnArgArg enable_iterator_debugging=true)
+ endif()
+ elseif(${config} STREQUAL "Release")
+ list(APPEND gnArgArg is_debug=false symbol_level=0)
+ elseif(${config} STREQUAL "RelWithDebInfo")
+ list(APPEND gnArgArg is_debug=false)
+ if(WIN32 AND NOT CLANG)
+ list(APPEND gnArgArg symbol_level=2)
+ else()
+ list(APPEND gnArgArg symbol_level=1)
+ endif()
+ elseif(${config} STREQUAL "MinSizeRel")
+ list(APPEND gnArgArg is_debug=false symbol_level=0 optimize_for_size=true)
+ endif()
+ if(FEATURE_developer_build OR (${config} STREQUAL "Debug") OR QT_FEATURE_webengine_sanitizer)
+ list(APPEND gnArgArg
+ is_official_build=false
+ use_viz_debugger=false
+ )
+ else()
+ list(APPEND gnArgArg is_official_build=true)
+ if(NOT CLANG OR NOT QT_FEATURE_use_lld_linker)
+ list(APPEND gnArgArg
+ use_thin_lto=false
+ )
+ endif()
+ endif()
+ extend_gn_list(gnArgArg
+ ARGS is_unsafe_developer_build
+ CONDITION FEATURE_developer_build
+ )
+
+ #TODO: refactor to not check for IOS here
+ if(NOT QT_FEATURE_webengine_full_debug_info AND NOT IOS)
+ list(APPEND gnArgArg blink_symbol_level=0 v8_symbol_level=0)
+ endif()
+
+ extend_gn_list(gnArgArg ARGS use_jumbo_build CONDITION QT_FEATURE_webengine_jumbo_build)
+ if(QT_FEATURE_webengine_jumbo_build)
+ list(APPEND gnArgArg jumbo_file_merge_limit=${QT_FEATURE_webengine_jumbo_file_merge_limit})
+ if(QT_FEATURE_webengine_jumbo_file_merge_limit LESS_EQUAL 8)
+ list(APPEND gnArgArg jumbo_build_excluded=[\"browser\"])
+ endif()
+ endif()
+
+ extend_gn_list(gnArgArg
+ ARGS enable_precompiled_headers
+ CONDITION BUILD_WITH_PCH AND NOT LINUX
+ )
+ extend_gn_list(gnArgArg
+ ARGS dcheck_always_on
+ CONDITION QT_FEATURE_force_asserts
+ )
+endmacro()
+
+macro(append_compiler_linker_sdk_setup)
+ if(CMAKE_CXX_COMPILER_LAUNCHER)
+ list(APPEND gnArgArg cc_wrapper="${CMAKE_CXX_COMPILER_LAUNCHER}")
+ endif()
+
+ extend_gn_list(gnArgArg ARGS is_clang CONDITION CLANG)
+ extend_gn_list(gnArgArg ARGS is_mingw CONDITION MINGW)
+ extend_gn_list(gnArgArg ARGS is_msvc CONDITION MSVC)
+ extend_gn_list(gnArgArg ARGS is_gcc CONDITION LINUX AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+
+ if(CLANG)
+ if(MACOS)
+ get_darwin_sdk_version(macSdkVersion)
+ # macOS needs to use the objcxx compiler as the cxx compiler is just a link
+ get_filename_component(clangBasePath ${CMAKE_OBJCXX_COMPILER} DIRECTORY)
+ get_filename_component(clangBasePath ${clangBasePath} DIRECTORY)
+ else()
+ get_filename_component(clangBasePath ${CMAKE_CXX_COMPILER} DIRECTORY)
+ get_filename_component(clangBasePath ${clangBasePath} DIRECTORY)
+ endif()
+
+ string(REGEX MATCH "[0-9]+" clangVersion ${CMAKE_CXX_COMPILER_VERSION})
+ list(APPEND gnArgArg
+ clang_base_path="${clangBasePath}"
+ clang_use_chrome_plugins=false
+ clang_version=${clangVersion}
+ fatal_linker_warnings=false
+ )
+
+ if(MACOS)
+ list(APPEND gnArgArg
+ use_system_xcode=true
+ mac_deployment_target="${CMAKE_OSX_DEPLOYMENT_TARGET}"
+ mac_sdk_min="${macSdkVersion}"
+ use_libcxx=true
+ )
+ endif()
+ if(IOS)
+ list(APPEND gnArgArg
+ use_system_xcode=true
+ enable_ios_bitcode=true
+ ios_deployment_target="${CMAKE_OSX_DEPLOYMENT_TARGET}"
+ ios_enable_code_signing=false
+ use_libcxx=true
+ )
+ endif()
+ if(DEFINED QT_FEATURE_stdlib_libcpp AND LINUX)
+ extend_gn_list(gnArgArg ARGS use_libcxx
+ CONDITION QT_FEATURE_stdlib_libcpp
+ )
+ endif()
+ if(ANDROID)
+ list(APPEND gnArgArg
+ android_ndk_root="${CMAKE_ANDROID_NDK}"
+ android_ndk_version="${CMAKE_ANDROID_NDK_VERSION}"
+ clang_use_default_sample_profile=false
+ #android_ndk_major_version=22
+ )
+ endif()
+ else()
+ if(QT_FEATURE_use_lld_linker)
+ get_filename_component(clangBasePath ${CMAKE_LINKER} DIRECTORY)
+ get_filename_component(clangBasePath ${clangBasePath} DIRECTORY)
+ list(APPEND gnArgArg
+ clang_base_path="${clangBasePath}"
+ fatal_linker_warnings=false
+ )
+ endif()
+ endif()
+
+ if(MSVC)
+ get_filename_component(windowsSdkPath $ENV{WINDOWSSDKDIR} ABSOLUTE)
+ get_filename_component(visualStudioPath $ENV{VSINSTALLDIR} ABSOLUTE)
+ set(windowSdkVersion $ENV{WindowsSDKVersion})
+ list(APPEND gnArgArg
+ win_linker_timing=true
+ use_incremental_linking=false
+ visual_studio_version=2022
+ visual_studio_path=\"${visualStudioPath}\"
+ windows_sdk_version=\"${windowsSdkVersion}\"
+ windows_sdk_path=\"${windowsSdkPath}\"
+ )
+ endif()
+ get_gn_arch(cpu ${TEST_architecture_arch})
+ if(LINUX AND CMAKE_CROSSCOMPILING AND cpu STREQUAL "arm")
+
+ extend_gn_list_cflag(gnArgArg
+ ARG arm_tune
+ CFLAG mtune
+ )
+ extend_gn_list_cflag(gnArgArg
+ ARG arm_float_abi
+ CFLAG mfloat-abi
+ )
+ extend_gn_list_cflag(gnArgArg
+ ARG arm_arch
+ CFLAG march
+ )
+ extend_gn_list_cflag(gnArgArg
+ ARG arm_cpu
+ CFLAG mcpu
+ )
+ extract_cflag(cflag "mfpu")
+ get_arm_version(arm_version "${cflag}")
+ extend_gn_list(gnArgArg
+ ARGS arm_use_neon
+ CONDITION (arm_version GREATER_EQUAL 8) OR ("${cflag}" MATCHES ".*neon.*")
+ )
+ if(arm_version EQUAL 7 AND NOT "${cflag}" MATCHES ".*neon.*")
+ # If the toolchain does not explicitly specify to use NEON instructions
+ # we use arm_neon_optional for ARMv7
+ list(APPEND gnArgArg arm_optionally_use_neon=true)
+ endif()
+ extract_cflag(march "march")
+ get_arm_version(arm_version ${march})
+ if(arm_version EQUAL 7)
+ list(APPEND gnArgArg use_arm_crc32=false)
+ endif()
+ check_thumb(armThumb)
+ extend_gn_list(gnArgArg
+ ARGS arm_use_thumb
+ CONDITION armThumb
+ )
+ endif()
+ extend_gn_list(gnArgArg
+ ARGS use_gold
+ CONDITION QT_FEATURE_use_gold_linker
+ )
+ extend_gn_list(gnArgArg
+ ARGS use_lld
+ CONDITION QT_FEATURE_use_lld_linker
+ )
+ unset(cpu)
+endmacro()
+
+macro(append_sanitizer_setup)
+ if(QT_FEATURE_webengine_sanitizer)
+ extend_gn_list(gnArgArg
+ ARGS is_asan
+ CONDITION address IN_LIST ECM_ENABLE_SANITIZERS
+ )
+ extend_gn_list(gnArgArg
+ ARGS is_tsan
+ CONDITION thread IN_LIST ECM_ENABLE_SANITIZERS
+ )
+ extend_gn_list(gnArgArg
+ ARGS is_msan
+ CONDITION memory IN_LIST ECM_ENABLE_SANITIZERS
+ )
+ extend_gn_list(gnArgArg
+ ARGS is_ubsan is_ubsan_vptr
+ CONDITION undefined IN_LIST ECM_ENABLE_SANITIZERS
+ )
+ if(APPLE)
+ list(APPEND gnArgArg
+ clang_version=\"${QT_COMPILER_VERSION_MAJOR}.${QT_COMPILER_VERSION_MINOR}.${QT_COMPILER_VERSION_PATCH}\"
+ )
+ endif()
+ endif()
+endmacro()
+
+macro(append_toolchain_setup)
+ if(WIN32)
+ get_gn_arch(cpu ${arch})
+ list(APPEND gnArgArg target_cpu="${cpu}")
+ if(MINGW)
+ get_gn_arch(cpu ${TEST_architecture_arch})
+ list(APPEND gnArgArg
+ # note '/' prefix
+ custom_toolchain="/${buildDir}/target_toolchain:target"
+ host_toolchain="/${buildDir}/host_toolchain:host"
+ host_cpu="${cpu}"
+ )
+ endif()
+ elseif(LINUX)
+ get_gn_arch(cpu ${TEST_architecture_arch})
+ list(APPEND gnArgArg
+ custom_toolchain="${buildDir}/target_toolchain:target"
+ host_toolchain="${buildDir}/host_toolchain:host"
+ )
+ if(CMAKE_CROSSCOMPILING)
+ list(APPEND gnArgArg
+ v8_snapshot_toolchain="${buildDir}/v8_toolchain:v8"
+ target_cpu="${cpu}"
+ )
+ else()
+ list(APPEND gnArgArg host_cpu="${cpu}")
+ endif()
+ if(CMAKE_SYSROOT)
+ list(APPEND gnArgArg target_sysroot="${CMAKE_SYSROOT}")
+ endif()
+ elseif(MACOS)
+ get_gn_arch(cpu ${arch})
+ list(APPEND gnArgArg target_cpu="${cpu}")
+ elseif(IOS)
+ get_gn_arch(cpu ${arch})
+ get_ios_sysroot(sysroot ${arch})
+ list(APPEND gnArgArg target_cpu="${cpu}" target_sysroot="${sysroot}" target_os="ios")
+ elseif(ANDROID)
+ get_gn_arch(cpu ${TEST_architecture_arch})
+ list(APPEND gnArgArg target_os="android" target_cpu="${cpu}")
+ if(CMAKE_HOST_WIN32)
+ list(APPEND gnArgArg
+ host_toolchain="/${buildDir}/host_toolchain:host"
+ host_cpu="x64"
+ v8_snapshot_toolchain="/${buildDir}/v8_toolchain:v8"
+ )
+ endif()
+ endif()
+ unset(cpu)
+endmacro()
+
+
+macro(append_pkg_config_setup)
+ if(PkgConfig_FOUND)
+ list(APPEND gnArgArg
+ pkg_config="${PKG_CONFIG_EXECUTABLE}"
+ host_pkg_config="${PKG_CONFIG_HOST_EXECUTABLE}"
+ )
+ if(NOT "$ENV{PKG_CONFIG_LIBDIR}" STREQUAL "")
+ list(APPEND gnArgArg
+ system_libdir="$ENV{PKG_CONFIG_LIBDIR}"
+ )
+ endif()
+ endif()
+endmacro()
+
+function(add_ninja_command)
+ cmake_parse_arguments(PARSE_ARGV 0 arg
+ "" "TARGET;BUILDDIR;MODULE" "OUTPUT;BYPRODUCTS"
+ )
+ _qt_internal_validate_all_args_are_parsed(arg)
+
+ string(REPLACE " " ";" NINJAFLAGS "$ENV{NINJAFLAGS}")
+ list(TRANSFORM arg_OUTPUT PREPEND "${arg_BUILDDIR}/")
+ list(TRANSFORM arg_BYPRODUCTS PREPEND "${arg_BUILDDIR}/")
+ add_custom_command(
+ OUTPUT
+ ${arg_OUTPUT}
+ ${arg_BUILDDIR}/${arg_TARGET} # use generator expression in CMAKE 3.20
+ BYPRODUCTS ${arg_BYPRODUCTS}
+ COMMENT "Running ninja for ${arg_TARGET} in ${arg_BUILDDIR}"
+ COMMAND Ninja::ninja
+ ${NINJAFLAGS}
+ -C ${arg_BUILDDIR}
+ ${arg_TARGET}
+ USES_TERMINAL
+ VERBATIM
+ COMMAND_EXPAND_LISTS
+ DEPENDS run_${arg_MODULE}_NinjaReady
+ )
+endfunction()
+
+function(get_configs result)
+ if(QT_GENERATOR_IS_MULTI_CONFIG)
+ set(${result} ${CMAKE_CONFIGURATION_TYPES})
+ else()
+ set(${result} ${CMAKE_BUILD_TYPE})
+ endif()
+ if(NOT ${result})
+ message(FATAL_ERROR "No valid configurations found !")
+ endif()
+ set(${result} ${${result}} PARENT_SCOPE)
+endfunction()
+
+function(get_architectures result)
+ if(CMAKE_OSX_ARCHITECTURES)
+ set(${result} ${CMAKE_OSX_ARCHITECTURES})
+ else()
+ set(${result} ${CMAKE_SYSTEM_PROCESSOR})
+ endif()
+ if(NOT ${result})
+ message(FATAL_ERROR "No valid architectures found. In case of cross-compiling make sure you have CMAKE_SYSTEM_PROCESSOR in your toolchain file.")
+ endif()
+ set(${result} ${${result}} PARENT_SCOPE)
+endfunction()
+
+function(add_gn_build_artifacts_to_target)
+ cmake_parse_arguments(PARSE_ARGV 0 arg
+ "" "CMAKE_TARGET;NINJA_TARGET;BUILDDIR;MODULE;COMPLETE_STATIC;NINJA_STAMP;NINJA_DATA_STAMP" ""
+ )
+ _qt_internal_validate_all_args_are_parsed(arg)
+
+ # config loop is a workaround to be able to add_custom_command per config
+ # note this is fixed in CMAKE.3.20 and should be cleaned up when 3.20 is
+ # the minimum cmake we support
+ get_configs(configs)
+ get_architectures(archs)
+ foreach(config ${configs})
+ foreach(arch ${archs})
+ set(target ${arg_NINJA_TARGET}_${config}_${arch})
+ set(stamps ${arg_NINJA_STAMP} ${arg_NINJA_DATA_STAMP})
+ add_ninja_target(
+ TARGET ${target}
+ NINJA_TARGET ${arg_NINJA_TARGET}
+ CMAKE_TARGET ${arg_CMAKE_TARGET}
+ NINJA_STAMP ${arg_NINJA_STAMP}
+ NINJA_DATA_STAMP ${arg_NINJA_DATA_STAMP}
+ CONFIG ${config}
+ ARCH ${arch}
+ BUILDDIR ${arg_BUILDDIR}
+ )
+ add_ninja_command(
+ TARGET ${arg_NINJA_TARGET}
+ OUTPUT ${stamps}
+ BUILDDIR ${arg_BUILDDIR}/${config}/${arch}
+ MODULE ${arg_MODULE}
+ )
+ add_dependencies(run_${arg_MODULE}_NinjaDone ${target})
+ set_target_properties(${arg_CMAKE_TARGET} PROPERTIES
+ LINK_DEPENDS ${arg_BUILDDIR}/${config}/${arch}/${arg_NINJA_STAMP}
+ )
+ if(QT_IS_MACOS_UNIVERSAL)
+ add_intermediate_archive(${target} ${arg_BUILDDIR}/${config}/${arch} ${arg_COMPLETE_STATIC})
+ elseif(IOS)
+ add_intermediate_object(${target} ${arg_BUILDDIR}/${config}/${arch} ${arg_COMPLETE_STATIC})
+ else()
+ if(MACOS AND QT_FEATURE_static)
+ # mac archiver does not support @file notation, do intermediate object istead
+ add_intermediate_object(${target} ${arg_BUILDDIR}/${config}/${arch} ${arg_COMPLETE_STATIC})
+ add_archiver_options(${target} ${arg_BUILDDIR}/${config}/${arch} ${arg_COMPLETE_STATIC})
+ else()
+ add_linker_options(${target} ${arg_BUILDDIR}/${config}/${arch} ${arg_COMPLETE_STATIC})
+ endif()
+ endif()
+ unset(target)
+ endforeach()
+ list(GET archs 0 arch)
+ set(target ${arg_NINJA_TARGET}_${config}_${arch})
+ # Work around for broken builds with new Apple linker ld_prime. Force
+ # use of the classic linker until this has been fixed.
+ # TODO: remove once this has been fixed by Apple. See issue FB13667242
+ # or QTBUG-122655 for details.
+ if(APPLECLANG)
+ if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "15.0.0")
+ target_link_options(${arg_CMAKE_TARGET} PRIVATE -ld_classic)
+ endif()
+ endif()
+ if(QT_IS_MACOS_UNIVERSAL)
+ add_lipo_command(${target} ${arg_BUILDDIR}/${config})
+ endif()
+ if(IOS)
+ add_ios_lipo_command(${target} ${arg_BUILDDIR}/${config})
+ endif()
+ endforeach()
+endfunction()
+
+function(get_config_filenames c_config cxx_config static_config target_config)
+ set(${target_config} gn_config_target.cmake PARENT_SCOPE)
+ set(${cxx_config} gn_config_cxx.cmake PARENT_SCOPE)
+ set(${c_config} gn_config_c.cmake PARENT_SCOPE)
+ set(${static_config} gn_static.cmake PARENT_SCOPE)
+endfunction()
+
+function(add_gn_command)
+ cmake_parse_arguments(PARSE_ARGV 0 arg
+ "" "CMAKE_TARGET;GN_TARGET;MODULE;BUILDDIR" "NINJA_TARGETS;GN_ARGS"
+ )
+ _qt_internal_validate_all_args_are_parsed(arg)
+
+ get_config_filenames(cConfigFileName cxxConfigFileName staticConfigFileName targetConfigFileName)
+ set(gnArgArgFile ${arg_BUILDDIR}/args.gn)
+
+ list(JOIN arg_GN_ARGS "\n" arg_GN_ARGS)
+ file(WRITE ${gnArgArgFile} ${arg_GN_ARGS})
+
+ foreach(ninjaTarget ${arg_NINJA_TARGETS})
+ list(APPEND output ${ninjaTarget}_objects.rsp ${ninjaTarget}_archives.rsp ${ninjaTarget}_libs.rsp ${ninjaTarget}_ldir.rsp)
+ endforeach()
+ list(TRANSFORM output PREPEND "${arg_BUILDDIR}/")
+
+ add_custom_command(
+ OUTPUT ${output}
+ COMMAND ${CMAKE_COMMAND}
+ -DBUILD_DIR=${arg_BUILDDIR}
+ -DSOURCE_DIR=${CMAKE_CURRENT_LIST_DIR}
+ -DMODULE=${arg_MODULE}
+ -DQT_HOST_PATH=${QT_HOST_PATH}
+ -DINSTALL_LIBEXECDIR=${INSTALL_LIBEXECDIR}
+ -DINSTALL_BINDIR=${INSTALL_BINDIR}
+ -DPython3_EXECUTABLE=${Python3_EXECUTABLE}
+ -DGN_THREADS=$ENV{QTWEBENGINE_GN_THREADS}
+ -DQT_ALLOW_SYMLINK_IN_PATHS=${QT_ALLOW_SYMLINK_IN_PATHS}
+ -P ${WEBENGINE_ROOT_SOURCE_DIR}/cmake/Gn.cmake
+ WORKING_DIRECTORY ${WEBENGINE_ROOT_BUILD_DIR}
+ COMMENT "Run gn for target ${arg_CMAKE_TARGET} in ${arg_BUILDDIR}"
+ DEPENDS
+ ${gnArgArgFile}
+ run_${arg_MODULE}_GnReady
+ "${WEBENGINE_ROOT_SOURCE_DIR}/src/${arg_MODULE}/configure/BUILD.root.gn.in"
+ "${WEBENGINE_ROOT_SOURCE_DIR}/cmake/Gn.cmake"
+ )
+ add_custom_target(runGn_${arg_GN_TARGET}
+ DEPENDS #TODO this is fixed in cmake 3.20 so we could simply use GN_TARGET and not create new one
+ ${output}
+ ${arg_BUILDDIR}/${cxxConfigFileName}
+ ${arg_BUILDDIR}/${cConfigFileName}
+ ${arg_BUILDDIR}/${targetConfigFileName}
+ )
+ add_dependencies(run_${arg_MODULE}_GnDone runGn_${arg_GN_TARGET})
+ if(TARGET thirdparty_sync_headers)
+ add_dependencies(runGn_${arg_GN_TARGET} thirdparty_sync_headers)
+ endif()
+ create_gn_target_config(${arg_GN_TARGET} ${arg_BUILDDIR}/${targetConfigFileName})
+endfunction()
+
+function(create_cxx_configs cmakeTarget arch)
+ get_config_filenames(cConfigFileName cxxConfigFileName staticConfigFileName targetConfigFileName)
+ create_c_config(${cmakeTarget} ${arch} ${cConfigFileName})
+ create_cxx_config(${cmakeTarget} ${arch} ${cxxConfigFileName})
+ create_static_config(${cmakeTarget} ${arch} ${staticConfigFileName})
+endfunction()
+
+# targets to gather per config / architecture targets
+function(addSyncTargets module)
+ add_custom_target(run_${module}_GnReady)
+ add_custom_target(run_${module}_GnDone)
+ add_custom_target(run_${module}_NinjaReady)
+ add_custom_target(run_${module}_NinjaDone)
+ # make nicer log so all gn has to finish before any ninja build starts
+ add_dependencies(run_${module}_NinjaReady run_${module}_GnDone)
+endfunction()
+
+function(addCopyCommand target src dst)
+ add_custom_command(
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${dst}
+ COMMAND ${CMAKE_COMMAND} -E copy ${src} ${dst}
+ TARGET ${target}
+ DEPENDS ${src}
+ USES_TERMINAL
+ )
+endfunction()
+
+function(check_for_ulimit)
+ message("-- Checking 'ulimit -n'")
+ execute_process(COMMAND bash -c "ulimit -n"
+ OUTPUT_VARIABLE ulimitOutput
+ )
+ string(REGEX MATCHALL "[0-9]+" limit "${ulimitOutput}")
+ message(" -- Open files limit ${limit}")
+ if(NOT (QT_FEATURE_use_gold_linker OR QT_FEATURE_use_lld_linker) AND ulimitOutput LESS 4096)
+ if(NOT ${CMAKE_VERSION} VERSION_LESS "3.21.0")
+ message(" -- Creating linker launcher")
+ file(GENERATE OUTPUT ${PROJECT_BINARY_DIR}/linker_ulimit.sh
+ CONTENT "#!/bin/bash\nulimit -n 4096\nexec \"$@\""
+ FILE_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
+ )
+ set(COIN_BUG_699 ON PARENT_SCOPE)
+ else()
+ set(PRINT_BFD_LINKER_WARNING ON PARENT_SCOPE)
+ endif()
+ endif()
+endfunction()
+
+function(add_build feature value)
+ list(APPEND cmakeArgs
+ "-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}"
+ "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}"
+ "-DMATRIX_SUBBUILD=ON"
+ "-DFEATURE_${feature}=${value}"
+ )
+ if(CMAKE_C_COMPILER_LAUNCHER)
+ list(APPEND cmakeArgs "-DCMAKE_C_COMPILER_LAUNCHER=${CMAKE_C_COMPILER_LAUNCHER}")
+ endif()
+ if(CMAKE_CXX_COMPILER_LAUNCHER)
+ list(APPEND cmakeArgs "-DCMAKE_CXX_COMPILER_LAUNCHER=${CMAKE_CXX_COMPILER_LAUNCHER}")
+ endif()
+
+ externalproject_add(${feature}
+ SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}
+ BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${feature}-${value}
+ PREFIX ${feature}-${value}
+ CMAKE_ARGS ${cmakeArgs}
+ USES_TERMINAL_BUILD ON
+ USES_TERMINAL_CONFIGURE ON
+ BUILD_ALWAYS TRUE
+ INSTALL_COMMAND ""
+ )
+ get_property(depTracker GLOBAL PROPERTY MATRIX_DEPENDENCY_TRACKER)
+ foreach(dep ${depTracker})
+ add_dependencies(${feature} ${dep})
+ endforeach()
+ set(depTracker "${depTracker}" ${feature})
+ set_property(GLOBAL PROPERTY MATRIX_DEPENDENCY_TRACKER "${depTracker}")
+endfunction()
+
+function(add_code_attributions_target)
+ cmake_parse_arguments(PARSE_ARGV 0 arg ""
+ "TARGET;OUTPUT;GN_TARGET;FILE_TEMPLATE;ENTRY_TEMPLATE;BUILDDIR"
+ "EXTRA_THIRD_PARTY_DIRS"
+ )
+ _qt_internal_validate_all_args_are_parsed(arg)
+ get_filename_component(fileTemplate ${arg_FILE_TEMPLATE} ABSOLUTE)
+ get_filename_component(entryTemplate ${arg_ENTRY_TEMPLATE} ABSOLUTE)
+ add_custom_command(
+ OUTPUT ${arg_OUTPUT}
+ COMMAND ${CMAKE_COMMAND}
+ -DLICENSE_SCRIPT=${WEBENGINE_ROOT_SOURCE_DIR}/src/3rdparty/chromium/tools/licenses/licenses.py
+ -DFILE_TEMPLATE=${fileTemplate}
+ -DENTRY_TEMPLATE=${entryTemplate}
+ -DGN_TARGET=${arg_GN_TARGET}
+ -DEXTRA_THIRD_PARTY_DIRS="${arg_EXTRA_THIRD_PARTY_DIRS}"
+ -DBUILDDIR=${arg_BUILDDIR}
+ -DOUTPUT=${arg_OUTPUT}
+ -DPython3_EXECUTABLE=${Python3_EXECUTABLE}
+ -P ${WEBENGINE_ROOT_SOURCE_DIR}/cmake/License.cmake
+ WORKING_DIRECTORY ${WEBENGINE_ROOT_BUILD_DIR}
+ DEPENDS
+ ${WEBENGINE_ROOT_SOURCE_DIR}/src/3rdparty/chromium/tools/licenses/licenses.py
+ ${arg_FILE_TEMPLATE}
+ ${arg_ENTRY_TEMPLATE}
+ ${WEBENGINE_ROOT_SOURCE_DIR}/cmake/License.cmake
+ USES_TERMINAL
+ )
+ add_custom_target(${arg_TARGET} DEPENDS ${arg_OUTPUT})
+endfunction()
diff --git a/cmake/Gn.cmake b/cmake/Gn.cmake
new file mode 100644
index 000000000..15b349e08
--- /dev/null
+++ b/cmake/Gn.cmake
@@ -0,0 +1,84 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+# This is gn wrapper script and it assables final BUILD.gn based on:
+# gn_config_target.cmake gn_config_c.cmake gn_config_cxx.cmake
+
+if(NOT CMAKE_SCRIPT_MODE_FILE)
+ message("This files should run only in script mode")
+ return()
+endif()
+
+set(path_mode REALPATH)
+if(APPLE AND QT_ALLOW_SYMLINK_IN_PATHS)
+ set(path_mode ABSOLUTE)
+endif()
+
+get_filename_component(WEBENGINE_ROOT_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/.." ${path_mode})
+get_filename_component(WEBENGINE_ROOT_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}" ${path_mode})
+
+include(${WEBENGINE_ROOT_SOURCE_DIR}/.cmake.conf)
+include(${WEBENGINE_ROOT_SOURCE_DIR}/cmake/Functions.cmake)
+
+set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
+
+find_package(Gn ${QT_REPO_MODULE_VERSION} EXACT)
+if(NOT Python3_EXECUTABLE)
+ find_package(Python3 3.6 REQUIRED)
+endif()
+set(gnCmd ${Gn_EXECUTABLE})
+set(buildDir ${BUILD_DIR})
+set(sourceDir ${SOURCE_DIR})
+set(module ${MODULE})
+set(gnArg gen ${buildDir})
+file(READ ${buildDir}/args.gn gnArgArg)
+
+if(NOT gnCmd)
+ message(FATAL_ERROR "\nCould not find suitable gn to run.\n")
+endif()
+
+init_gn_config(${buildDir}/gn_config_target.cmake)
+read_gn_config(${buildDir}/gn_config_cxx.cmake)
+read_gn_config(${buildDir}/gn_config_c.cmake)
+read_gn_config(${buildDir}/gn_static.cmake)
+
+configure_gn_target(
+ "${sourceDir}"
+ "${WEBENGINE_ROOT_SOURCE_DIR}/src/${module}/configure/BUILD.root.gn.in"
+ "${buildDir}/BUILD.gn"
+)
+
+list(APPEND gnArg
+ --script-executable=${Python3_EXECUTABLE}
+ --root=${WEBENGINE_ROOT_SOURCE_DIR}/src/3rdparty/chromium)
+
+if(GN_THREADS)
+ list(APPEND gnArg --threads=${GN_THREADS})
+endif()
+
+STRING(REGEX REPLACE "\n" ";" printArgArg "${gnArgArg}")
+LIST(SORT printArgArg)
+STRING(REGEX REPLACE ";" "\n" printArgArg "${printArgArg}")
+list(JOIN gnArg " " printArg)
+
+message("-- Running gn in ${buildDir}\n"
+ "-- GN command:\n${gnCmd} ${printArg}\n"
+ "-- GN arg file:\n${buildDir}/args.gn\n"
+ "-- GN args: \n${printArgArg}"
+)
+
+execute_process(
+ COMMAND ${gnCmd} ${gnArg}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ RESULT_VARIABLE gnResult
+ OUTPUT_VARIABLE gnOutput
+ ERROR_VARIABLE gnError
+ TIMEOUT 600
+)
+
+if(NOT gnResult EQUAL 0)
+ message(FATAL_ERROR "\n-- GN FAILED\n${gnOutput}\n${gnError}\n${gnResult}\n")
+else()
+ string(REGEX REPLACE "\n$" "" gnOutput "${gnOutput}")
+ message("-- GN ${gnOutput}")
+endif()
diff --git a/cmake/License.cmake b/cmake/License.cmake
new file mode 100644
index 000000000..2427ad679
--- /dev/null
+++ b/cmake/License.cmake
@@ -0,0 +1,51 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+if(NOT CMAKE_SCRIPT_MODE_FILE)
+ message("This files should run only in script mode")
+ return()
+endif()
+
+get_filename_component(WEBENGINE_ROOT_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/.." REALPATH)
+get_filename_component(WEBENGINE_ROOT_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}" REALPATH)
+
+include(${WEBENGINE_ROOT_SOURCE_DIR}/.cmake.conf)
+include(${WEBENGINE_ROOT_SOURCE_DIR}/cmake/Functions.cmake)
+
+set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
+
+find_package(Gn ${QT_REPO_MODULE_VERSION} EXACT)
+if(NOT Python3_EXECUTABLE)
+ find_package(Python3 3.6 REQUIRED)
+endif()
+
+set(extraThirdPartyDirs "")
+if(NOT "${EXTRA_THIRD_PARTY_DIRS}" STREQUAL "")
+ string(REPLACE " " ";" dirList ${EXTRA_THIRD_PARTY_DIRS})
+ foreach(dir ${dirList})
+ string(CONCAT extraThirdPartyDirs ${extraThirdPartyDirs}"${dir}",)
+ endforeach()
+endif()
+
+execute_process(
+ COMMAND ${Python3_EXECUTABLE} ${LICENSE_SCRIPT}
+ --file-template ${FILE_TEMPLATE}
+ --entry-template ${ENTRY_TEMPLATE}
+ --gn-binary ${Gn_EXECUTABLE}
+ --gn-target ${GN_TARGET}
+ --gn-out-dir ${BUILDDIR}
+ --extra-third-party-dirs=[${extraThirdPartyDirs}]
+ credits ${OUTPUT}
+ WORKING_DIRECTORY ${BUILDDIR}
+ RESULT_VARIABLE gnResult
+ OUTPUT_VARIABLE gnOutput
+ ERROR_VARIABLE gnError
+ TIMEOUT 600
+)
+
+if(NOT gnResult EQUAL 0)
+ message(FATAL_ERROR "\n-- License FAILED\n${gnOutput}\n${gnError}\n${gnResult}\n")
+else()
+ string(REGEX REPLACE "\n$" "" gnOutput "${gnOutput}")
+ message("-- License ${gnOutput}")
+endif()
diff --git a/cmake/SubmoduleUpdate.cmake b/cmake/SubmoduleUpdate.cmake
new file mode 100644
index 000000000..123db55bf
--- /dev/null
+++ b/cmake/SubmoduleUpdate.cmake
@@ -0,0 +1,70 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+if(NOT CMAKE_SCRIPT_MODE_FILE)
+ message("This file should run only in script mode")
+ return()
+endif()
+
+get_filename_component(WEBENGINE_ROOT_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/.." REALPATH)
+get_filename_component(WEBENGINE_ROOT_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}" REALPATH)
+
+include(${WEBENGINE_ROOT_SOURCE_DIR}/.cmake.conf)
+include(${WEBENGINE_ROOT_SOURCE_DIR}/cmake/Functions.cmake)
+
+find_program(GIT_EXECUTABLE NAMES git REQUIRED)
+
+execute_process(
+ COMMAND ${GIT_EXECUTABLE} rev-parse --short=8 HEAD
+ WORKING_DIRECTORY ${WEBENGINE_ROOT_SOURCE_DIR}/src/3rdparty
+ OUTPUT_VARIABLE SUBMODULE_NEW_SHA
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+)
+execute_process(
+ COMMAND ${GIT_EXECUTABLE} rev-parse --short=8 HEAD:src/3rdparty
+ WORKING_DIRECTORY ${WEBENGINE_ROOT_SOURCE_DIR}
+ OUTPUT_VARIABLE SUBMODULE_OLD_SHA
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+)
+set(shas "${SUBMODULE_OLD_SHA}..${SUBMODULE_NEW_SHA}")
+set(format "* %s")
+execute_process(
+ COMMAND ${GIT_EXECUTABLE} log
+ --pretty=format:${format}
+ --abbrev-commit ${shas}
+ WORKING_DIRECTORY ${WEBENGINE_ROOT_SOURCE_DIR}/src/3rdparty
+ OUTPUT_VARIABLE SUBMODULE_COMMITS
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+)
+
+if(SUBMODULE_COMMITS)
+ message("commits found for ${shas}")
+ execute_process(
+ COMMAND ${GIT_EXECUTABLE} add src/3rdparty
+ WORKING_DIRECTORY ${WEBENGINE_ROOT_SOURCE_DIR}
+ )
+ set(commits ${SUBMODULE_COMMITS})
+ execute_process(
+ COMMAND ${GIT_EXECUTABLE} commit
+ --allow-empty
+ -m "Update Chromium"
+ -m "Submodule src/3rdparty ${shas}:\n${commits}"
+ WORKING_DIRECTORY ${WEBENGINE_ROOT_SOURCE_DIR}
+ RESULT_VARIABLE gitResult
+ OUTPUT_VARIABLE gitOutput
+ ERROR_VARIABLE gitError
+ )
+
+ if(NOT gitResult EQUAL 0)
+ message(FATAL_ERROR "\n-- Git Commit FAILED\n${gitOutput}\n${gitError}\n${gitResult}\n")
+ else()
+ string(REGEX REPLACE "\n$" "" gnOutput "${gitOutput}")
+ message("-- Git Commit ${gitOutput}")
+ execute_process(
+ COMMAND ${GIT_EXECUTABLE} show HEAD
+ WORKING_DIRECTORY ${WEBENGINE_ROOT_SOURCE_DIR}
+ )
+ endif()
+else()
+ message(FATAL_ERROR "-- Git Commit found no commits for ${shas}")
+endif()
diff --git a/coin-bug-707 b/coin-bug-707
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/coin-bug-707
diff --git a/coin/module_config.yaml b/coin/module_config.yaml
new file mode 100644
index 000000000..f1d69a277
--- /dev/null
+++ b/coin/module_config.yaml
@@ -0,0 +1,38 @@
+version: 2
+accept_configuration:
+ condition: property
+ property: features
+ not_contains_value: Disable
+
+machine_type:
+ Build:
+ cores: 8
+ Test:
+ cores: 4
+
+instructions:
+ Build:
+ - type: EnvironmentVariable
+ variableName: CMAKE_BUILD_TIMEOUT
+ variableValue: "36000"
+ - type: EnvironmentVariable
+ variableName: CMAKE_BUILD_OUTPUT_TIMEOUT
+ variableValue: "3600"
+ - type: EnvironmentVariable
+ variableName: QTWEBENGINE_GN_THREADS
+ variableValue: "1"
+ enable_if:
+ condition: property
+ property: host.os
+ equals_value: MacOS
+ - !include "{{qt/qtbase}}/coin_module_build_template_v2.yaml"
+ Test:
+ - type: EnvironmentVariable
+ variableName: QTWEBENGINE_DISABLE_SANDBOX
+ variableValue: "1"
+ enable_if:
+ condition: property
+ property: target.osVersion
+ equals_value: QEMU
+ - !include "{{qt/qtbase}}/coin_module_test_template_v3.yaml"
+ - !include "{{qt/qtbase}}/coin_module_test_docs.yaml"
diff --git a/coin/qt-installer-package-config.json b/coin/qt-installer-package-config.json
index f9584a100..ac604d77b 100644
--- a/coin/qt-installer-package-config.json
+++ b/coin/qt-installer-package-config.json
@@ -2,15 +2,23 @@
"version": "1",
"module-split": {
"qtpdf": [
+ "**/bin/*Pdf*",
"**/include/*QtPdf*/**/*",
- "**/lib/cmake/Qt5Gui/*",
- "**/lib/cmake/Qt5Pdf/*",
- "**/lib/cmake/Qt5PdfWidgets/*",
- "**/lib/pkgconfig/Qt5Pdf*",
- "**/lib/libQt5Pdf*",
+ "**/lib/cmake/Qt*Gui/*Pdf*",
+ "**/lib/cmake/Qt*Pdf*/*",
+ "**/lib/cmake/Qt*Qml/QmlPlugins/*Pdf*",
+ "**/lib/pkgconfig/*Pdf*",
+ "**/lib/*Pdf*",
+ "**/lib/static_chrome/*",
+ "**/lib/QtPdf*.framework/**",
+ "**/metatypes/*pdf*",
"**/mkspecs/modules/qt_lib_pdf*",
- "**/plugins/imageformats/*",
- "**/qml/QtQuick/**/*"
+ "**/mkspecs/modules/qt_plugin_qpdf.pri",
+ "**/modules/Pdf*",
+ "**/plugins/imageformats/**/*",
+ "**/qml/QtQuick/**/*",
+ "**/qml/QtQuick/Pdf/**/.rcc/*",
+ "**/qml/QtQuick/Pdf/**/.rcc/qmlcache/*"
]
}
}
diff --git a/conanfile.py b/conanfile.py
new file mode 100644
index 000000000..137285c08
--- /dev/null
+++ b/conanfile.py
@@ -0,0 +1,89 @@
+# Copyright (C) 2021 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+from conans import ConanFile
+import re
+from pathlib import Path
+from typing import Dict, Any
+
+_qtwebengine_features = [
+ "qtpdf-build",
+ "qtpdf-quick-build",
+ "qtpdf-widgets-build",
+ "qtwebengine-build",
+ "qtwebengine-core-build",
+ "qtwebengine-quick-build",
+ "qtwebengine-widgets-build",
+ "webengine-developer-build",
+ "webengine-embedded-build",
+ "webengine-extensions",
+ "webengine-full-debug-info",
+ "webengine-jumbo-build",
+ "webengine-kerberos",
+ "webengine-native-spellchecker",
+ "webengine-pepper-plugins",
+ "webengine-printing-and-pdf",
+ "webengine-proprietary-codecs",
+ "webengine-sanitizer",
+ "webengine-spellchecker",
+ "webengine-webchannel",
+ "webengine-webrtc",
+ "webengine-webrtc-pipewire",
+ "system-webengine-ffmpeg",
+ "system-webengine-icu",
+]
+
+
+def _parse_qt_version_by_key(key: str) -> str:
+ with open(Path(__file__).parent.resolve() / ".cmake.conf") as f:
+ m = re.search(fr'{key} .*"(.*)"', f.read())
+ return m.group(1) if m else ""
+
+
+def _get_qt_minor_version() -> str:
+ return ".".join(_parse_qt_version_by_key("QT_REPO_MODULE_VERSION").split(".")[:2])
+
+
+class QtWebEngine(ConanFile):
+ name = "qtwebengine"
+ license = "LGPL-3.0-only, Commercial Qt License Agreement"
+ author = "The Qt Company <https://www.qt.io/contact-us>"
+ url = "https://code.qt.io/cgit/qt/qtwebengine.git"
+ description = (
+ "Qt WebEngine integrates Chromium's fast moving web capabilities into Qt. "
+ "The integration with Qt focuses on an API that is easy to use, yet extensible. "
+ "We also make no compromise on the graphics integration, integrating the layer "
+ "rendering of Chromium directly into the OpenGL scene graph of Qt Quick."
+ )
+ topics = "qt", "qt6", "qtwebengine", "WebEngine", "Chromium"
+ settings = "os", "compiler", "arch", "build_type"
+ # for referencing the version number and prerelease tag and dependencies info
+ exports = ".cmake.conf", "dependencies.yaml"
+ exports_sources = "*", "!conan*.*"
+ python_requires = f"qt-conan-common/{_get_qt_minor_version()}@qt/everywhere"
+ python_requires_extend = "qt-conan-common.QtLeafModule"
+
+ def get_qt_leaf_module_options(self) -> Dict[str, Any]:
+ """Implements abstractmethod from qt-conan-common.QtLeafModule"""
+ return self._shared.convert_qt_features_to_conan_options(_qtwebengine_features)
+
+ def get_qt_leaf_module_default_options(self) -> Dict[str, Any]:
+ """Implements abstractmethod from qt-conan-common.QtLeafModule"""
+ return self._shared.convert_qt_features_to_default_conan_options(_qtwebengine_features)
+
+ def package_env_info(self) -> Dict[str, Any]:
+ """Implements abstractmethod from qt-conan-common.QtLeafModule"""
+ # this will be called only after a successful build
+ _f = lambda p: True
+ if tools.os_info.is_windows:
+ ptrn = "**/QtWebEngineProcess.exe"
+ elif tools.os_info.is_macos:
+ ptrn = "**/QtWebEngineProcess.app/**/QtWebEngineProcess"
+ _f = lambda p: not any(".dSYM" in item for item in p.parts)
+ else:
+ ptrn = "**/QtWebEngineProcess"
+ ret = [str(p) for p in Path(self.package_folder).rglob(ptrn) if p.is_file() and _f(p)]
+ if len(ret) != 1:
+ print("Expected to find one 'QtWebEngineProcess'. Found: {0}".format(ret))
+ return {"QTWEBENGINEPROCESS_PATH": ret.pop() if ret else ""}
+
diff --git a/config.tests/hostcompiler/hostcompiler.pro b/config.tests/hostcompiler/hostcompiler.pro
deleted file mode 100644
index 5a80246ab..000000000
--- a/config.tests/hostcompiler/hostcompiler.pro
+++ /dev/null
@@ -1,9 +0,0 @@
-option(host_build)
-
-gcc:equals(QT_ARCH, "x86_64"):contains(QT_TARGET_ARCH, "arm"):!contains(QT_TARGET_ARCH, "arm64") {
- QMAKE_CXXFLAGS += -m32
- QMAKE_LFLAGS += -m32
-}
-
-SOURCES = main.cpp
-
diff --git a/config.tests/hostcompiler/main.cpp b/config.tests/hostcompiler/main.cpp
deleted file mode 100644
index c664a810f..000000000
--- a/config.tests/hostcompiler/main.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <stdio.h>
-int main()
-{
- printf("This works\n");
- return 0;
-}
diff --git a/configure.cmake b/configure.cmake
new file mode 100644
index 000000000..9f4831257
--- /dev/null
+++ b/configure.cmake
@@ -0,0 +1,718 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+if(QT_CONFIGURE_RUNNING)
+ function(assertTargets)
+ endfunction()
+ function(add_check_for_support)
+ endfunction()
+ function(check_for_ulimit)
+ endfunction()
+else()
+ find_package(Ninja 1.7.2)
+ find_package(Gn ${QT_REPO_MODULE_VERSION} EXACT)
+ find_program(Python3_EXECUTABLE NAMES python3 python HINTS $ENV{PYTHON3_PATH})
+ if(NOT Python3_EXECUTABLE)
+ find_package(Python3 3.6)
+ endif()
+ find_package(GPerf)
+ find_package(BISON)
+ find_package(FLEX)
+ find_package(Perl)
+ find_package(PkgConfig)
+ find_package(Snappy)
+ find_package(Nodejs 14.0)
+endif()
+
+if(PkgConfig_FOUND)
+ pkg_check_modules(DBUS dbus-1)
+ pkg_check_modules(FONTCONFIG fontconfig)
+ pkg_check_modules(LIBDRM libdrm)
+ pkg_check_modules(XCOMPOSITE xcomposite)
+ pkg_check_modules(XCURSOR xcursor)
+ pkg_check_modules(XI xi)
+ pkg_check_modules(XRANDR xrandr)
+ pkg_check_modules(XSHMFENCE xshmfence)
+ pkg_check_modules(XTST xtst)
+ pkg_check_modules(NSS nss>=3.26)
+ pkg_check_modules(X11 x11)
+ pkg_check_modules(XPROTO glproto)
+ pkg_check_modules(GLIB glib-2.0>=2.32.0)
+ pkg_check_modules(HARFBUZZ harfbuzz>=4.3.0 harfbuzz-subset>=4.3.0)
+ pkg_check_modules(JPEG libjpeg IMPORTED_TARGET)
+ pkg_check_modules(LIBEVENT libevent)
+ pkg_check_modules(MINIZIP minizip)
+ pkg_check_modules(PNG libpng>=1.6.0)
+ pkg_check_modules(TIFF libtiff-4>=4.2.0)
+ pkg_check_modules(ZLIB zlib)
+ # TODO: chromium may replace base::StringView with std::string_view. See: crbug.com/691162
+ pkg_check_modules(RE2 re2>=11.0.0 IMPORTED_TARGET)
+ pkg_check_modules(ICU icu-uc>=70 icu-i18n>=70)
+ pkg_check_modules(WEBP libwebp libwebpmux libwebpdemux)
+ pkg_check_modules(LCMS2 lcms2)
+ pkg_check_modules(FREETYPE freetype2 IMPORTED_TARGET)
+ pkg_check_modules(LIBXML2 libxml-2.0 libxslt IMPORTED_TARGET)
+ pkg_check_modules(FFMPEG libavcodec libavformat libavutil IMPORTED_TARGET)
+ pkg_check_modules(OPUS opus>=1.3.1)
+ pkg_check_modules(VPX vpx>=1.10.0 IMPORTED_TARGET)
+ pkg_check_modules(LIBPCI libpci)
+ pkg_check_modules(LIBOPENJP2 libopenjp2)
+endif()
+
+if(Python3_EXECUTABLE)
+ execute_process(
+ COMMAND ${Python3_EXECUTABLE} -c "import html5lib"
+ RESULT_VARIABLE html5lib_NOT_FOUND
+ OUTPUT_QUIET
+ )
+endif()
+
+#### Tests
+if(LINUX)
+ check_for_ulimit()
+endif()
+
+qt_config_compile_test(re2
+ LABEL "re2"
+ LIBRARIES
+ PkgConfig::RE2
+ CODE
+"
+#include \"re2/filtered_re2.h\"
+#include <vector>
+int main() {
+ std::string s;
+ re2::FilteredRE2 fre2(1);
+ int id = 0;
+ fre2.Add(s, {}, &id);
+ std::vector<std::string> pattern = {\"match\"};
+ fre2.Compile(&pattern);
+ const RE2 &re2 = fre2.GetRE2(id);
+}"
+)
+
+qt_config_compile_test(vpx
+ LABEL "vpx"
+ LIBRARIES
+ PkgConfig::VPX
+ CODE
+"
+#include \"vpx/vpx_encoder.h\"
+#include \"vpx/vp8cx.h\"
+#include \"vpx/vpx_image.h\"
+int main() {
+ vpx_codec_cx_pkt pkt;
+ pkt.data.frame.width[0] = 0u;
+ pkt.data.frame.height[0] = 0u;
+ auto a = CONSTRAINED_FROM_ABOVE_DROP;
+ auto b = VPX_IMG_FMT_NV12;
+ auto v9 = vpx_codec_vp9_cx();
+}"
+)
+
+qt_config_compile_test(snappy
+ LABEL "snappy"
+ LIBRARIES
+ Snappy::Snappy
+ CODE
+"
+#include \"snappy.h\"
+int main() {
+ snappy::Source *src = 0;
+ snappy::Sink *sink = 0;
+ return 0;
+}"
+)
+
+qt_config_compile_test(libxml2
+ LABEL "compatible libxml2 and libxslt"
+ LIBRARIES
+ PkgConfig::LIBXML2
+ CODE
+"
+#include \"libxml/xmlversion.h\"
+#if !defined(LIBXML_ICU_ENABLED)
+#error libxml icu not enabled
+#endif
+int main() {
+ return 0;
+}"
+)
+
+qt_config_compile_test(jpeg
+ LABEL "compatible libjpeg"
+ LIBRARIES
+ PkgConfig::JPEG
+ CODE
+"
+#include <cstdio>
+#include <cstring>
+extern \"C\" {
+ #include <jpeglib.h>
+}
+int main() {
+ JDIMENSION dummy;
+ jpeg_crop_scanline(nullptr, &dummy, &dummy);
+ jpeg_skip_scanlines(nullptr, dummy);
+}"
+)
+
+qt_config_compile_test(freetype
+ LABEL "freetype >= 2.4.2"
+ LIBRARIES
+ PkgConfig::FREETYPE
+ CODE
+"
+#include <ft2build.h>
+#include FT_FREETYPE_H
+#if ((FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) < 20402)
+# error This version of freetype is too old.
+#endif
+int main() {
+ FT_Face ft_face = 0;
+ FT_Reference_Face(ft_face);
+ return 0;
+}"
+)
+
+qt_config_compile_test(glibc
+ LABEL "glibc > 2.16"
+ CODE
+"
+#include <features.h>
+#if __GLIBC__ < 2 || __GLIBC_MINOR__ < 17
+#error glibc versions below 2.17 are not supported
+#endif
+int main(void) {
+ return 0;
+}"
+)
+
+qt_config_compile_test(khr
+ LABEL "khr"
+ CODE
+"
+#include <KHR/khrplatform.h>
+int main(void) {
+ return 0;
+}"
+)
+
+qt_config_compile_test(libavformat
+ LABEL "libavformat"
+ LIBRARIES
+ PkgConfig::FFMPEG
+ CODE
+"
+#include \"libavformat/version.h\"
+extern \"C\" {
+#include \"libavformat/avformat.h\"
+}
+int main(void) {
+#if LIBAVFORMAT_VERSION_MAJOR >= 59
+ AVStream stream;
+ auto first_dts = av_stream_get_first_dts(&stream);
+#endif
+ return 0;
+}"
+)
+
+#### Features
+
+qt_feature("qtwebengine-build" PUBLIC
+ LABEL "Build QtWebEngine Modules"
+ PURPOSE "Enables building the Qt WebEngine modules."
+)
+qt_feature("qtwebengine-core-build" PRIVATE
+ LABEL "Build QtWebEngineCore"
+ PURPOSE "Enables building the Qt WebEngineCore module."
+ CONDITION QT_FEATURE_qtwebengine_build
+)
+qt_feature("qtwebengine-widgets-build" PRIVATE
+ LABEL "Build QtWebEngineWidgets"
+ PURPOSE "Enables building the Qt WebEngineWidgets module."
+ CONDITION TARGET Qt::Widgets AND QT_FEATURE_qtwebengine_build
+)
+qt_feature("qtwebengine-quick-build" PRIVATE
+ LABEL "Build QtWebEngineQuick"
+ PURPOSE "Enables building the Qt WebEngineQuick module."
+ CONDITION TARGET Qt::Quick AND TARGET Qt::Qml AND QT_FEATURE_qtwebengine_build
+)
+qt_feature("qtpdf-build" PUBLIC
+ LABEL "Build Qt PDF"
+ PURPOSE "Enables building the Qt Pdf modules."
+)
+qt_feature("qtpdf-widgets-build" PRIVATE
+ LABEL "Build QtPdfWidgets"
+ PURPOSE "Enables building the Qt Pdf module."
+ CONDITION TARGET Qt::Widgets AND QT_FEATURE_qtpdf_build
+)
+qt_feature("qtpdf-quick-build" PRIVATE
+ LABEL "Build QtPdfQuick"
+ PURPOSE "Enables building the QtPdfQuick module."
+ CONDITION TARGET Qt::Quick AND TARGET Qt::Qml AND QT_FEATURE_qtpdf_build AND
+ Qt6Quick_VERSION VERSION_GREATER_EQUAL "6.4.0"
+)
+
+function(qtwebengine_internal_is_file_inside_root_build_dir out_var file)
+ set(result ON)
+ if(NOT QT_CONFIGURE_RUNNING)
+ file(RELATIVE_PATH relpath "${WEBENGINE_ROOT_BUILD_DIR}" "${file}")
+ if(IS_ABSOLUTE "${relpath}" OR relpath MATCHES "^\\.\\./")
+ set(result OFF)
+ endif()
+ endif()
+ set(${out_var} ${result} PARENT_SCOPE)
+endfunction()
+
+if(Ninja_FOUND)
+ qtwebengine_internal_is_file_inside_root_build_dir(
+ Ninja_INSIDE_WEBENGINE_ROOT_BUILD_DIR "${Ninja_EXECUTABLE}")
+endif()
+qt_feature("webengine-build-ninja" PRIVATE
+ LABEL "Build Ninja"
+ AUTODETECT NOT Ninja_FOUND OR Ninja_INSIDE_WEBENGINE_ROOT_BUILD_DIR
+)
+
+if(Gn_FOUND)
+ qtwebengine_internal_is_file_inside_root_build_dir(
+ Gn_INSIDE_WEBENGINE_ROOT_BUILD_DIR "${Gn_EXECUTABLE}")
+endif()
+qt_feature("webengine-build-gn" PRIVATE
+ LABEL "Build Gn"
+ AUTODETECT NOT Gn_FOUND OR Gn_INSIDE_WEBENGINE_ROOT_BUILD_DIR
+)
+# default assumed merge limit (should match the one in qt_cmdline.cmake)
+set(jumbo_merge_limit 8)
+# check value provided through configure script with -webengine-jumbo-build=(on|off|32)
+if(DEFINED INPUT_webengine_jumbo_file_merge_limit)
+ set(jumbo_merge_limit ${INPUT_webengine_jumbo_file_merge_limit})
+# then also verify if set directly with cmake call and -DFEATURE_webengine_jumbo_build=(ON|OFF|32)
+elseif(DEFINED FEATURE_webengine_jumbo_build)
+ if(FEATURE_webengine_jumbo_build GREATER 0)
+ set(jumbo_merge_limit ${FEATURE_webengine_jumbo_build})
+ elseif (NOT FEATURE_webengine_jumbo_build)
+ set(jumbo_merge_limit 0)
+ endif()
+endif()
+set(QT_FEATURE_webengine_jumbo_file_merge_limit ${jumbo_merge_limit}
+ CACHE STRING "Jumbo merge limit for WebEngineCore" FORCE)
+qt_feature("webengine-jumbo-build" PUBLIC
+ LABEL "Jumbo Build"
+ PURPOSE "Enables support for jumbo build of core library"
+ AUTODETECT FALSE
+ ENABLE jumbo_merge_limit GREATER 0
+)
+qt_feature("webengine-developer-build" PRIVATE
+ LABEL "Developer build"
+ PURPOSE "Enables the developer build configuration."
+ AUTODETECT QT_FEATURE_private_tests
+)
+qt_feature("webengine-system-re2" PRIVATE
+ LABEL "re2"
+ CONDITION UNIX AND TEST_re2
+)
+qt_feature("webengine-system-icu" PRIVATE
+ LABEL "icu"
+ AUTODETECT FALSE
+ CONDITION ICU_FOUND
+)
+qt_feature("webengine-system-libwebp" PRIVATE
+ LABEL "libwebp, libwebpmux and libwebpdemux"
+ CONDITION UNIX AND WEBP_FOUND
+)
+qt_feature("webengine-system-libopenjpeg2" PRIVATE
+ LABEL "libopenjpeg2"
+ CONDITION UNIX AND LIBOPENJP2_FOUND
+)
+qt_feature("webengine-system-opus" PRIVATE
+ LABEL "opus"
+ CONDITION UNIX AND OPUS_FOUND
+)
+qt_feature("webengine-system-ffmpeg" PRIVATE
+ LABEL "ffmpeg"
+ AUTODETECT FALSE
+ CONDITION FFMPEG_FOUND AND QT_FEATURE_webengine_system_opus AND QT_FEATURE_webengine_system_libwebp
+)
+qt_feature("webengine-system-libvpx" PRIVATE
+ LABEL "libvpx"
+ AUTODETECT FALSE
+ CONDITION UNIX AND TEST_vpx
+)
+qt_feature("webengine-system-snappy" PRIVATE
+ LABEL "snappy"
+ CONDITION UNIX AND TEST_snappy
+)
+qt_feature("webengine-system-glib" PRIVATE
+ LABEL "glib"
+ CONDITION UNIX AND GLIB_FOUND
+)
+qt_feature("webengine-system-zlib" PRIVATE
+ LABEL "zlib"
+ CONDITION UNIX AND QT_FEATURE_system_zlib AND ZLIB_FOUND
+)
+qt_feature("webengine-qt-zlib" PRIVATE
+ LABEL "qtzlib"
+ CONDITION QT_FEATURE_static
+ AND TARGET Qt::Gui
+ AND NOT QT_FEATURE_system_zlib
+)
+qt_feature("webengine-system-minizip" PRIVATE
+ LABEL "minizip"
+ CONDITION UNIX AND MINIZIP_FOUND
+)
+qt_feature("webengine-system-libevent" PRIVATE
+ LABEL "libevent"
+ CONDITION UNIX AND LIBEVENT_FOUND
+)
+qt_feature("webengine-system-libxml" PRIVATE
+ LABEL "libxml2 and libxslt"
+ CONDITION UNIX AND TEST_libxml2
+)
+qt_feature("webengine-system-lcms2" PRIVATE
+ LABEL "lcms2"
+ CONDITION UNIX AND LCMS2_FOUND
+)
+qt_feature("webengine-system-libpng" PRIVATE
+ LABEL "png"
+ CONDITION UNIX AND TARGET Qt::Gui AND PNG_FOUND AND QT_FEATURE_system_png
+)
+qt_feature("webengine-system-libtiff" PRIVATE
+ LABEL "tiff"
+ CONDITION UNIX AND TARGET Qt::Gui AND TIFF_FOUND
+)
+qt_feature("webengine-qt-libpng" PRIVATE
+ LABEL "qtpng"
+ CONDITION QT_FEATURE_static
+ AND TARGET Qt::Gui
+ AND QT_FEATURE_png
+ AND NOT QT_FEATURE_system_png
+)
+qt_feature("webengine-system-libjpeg" PRIVATE
+ LABEL "jpeg"
+ CONDITION UNIX AND TARGET Qt::Gui AND TEST_jpeg AND QT_FEATURE_system_jpeg
+)
+qt_feature("webengine-qt-libjpeg" PRIVATE
+ LABEL "qtjpeg"
+ CONDITION QT_FEATURE_static
+ AND TARGET Qt::Gui
+ AND QT_FEATURE_jpeg
+ AND NOT QT_FEATURE_system_jpeg
+)
+qt_feature("webengine-system-harfbuzz" PRIVATE
+ LABEL "harfbuzz"
+ CONDITION UNIX AND TARGET Qt::Gui AND HARFBUZZ_FOUND AND QT_FEATURE_system_harfbuzz
+)
+qt_feature("webengine-qt-harfbuzz" PRIVATE
+ LABEL "qtharfbuzz"
+ CONDITION QT_FEATURE_static
+ AND TARGET Qt::Gui
+ AND QT_FEATURE_harfbuzz
+ AND NOT QT_FEATURE_system_harfbuzz
+)
+qt_feature("webengine-system-freetype" PRIVATE
+ LABEL "freetype"
+ CONDITION UNIX AND TARGET Qt::Gui AND TEST_freetype AND QT_FEATURE_system_freetype
+)
+qt_feature("webengine-qt-freetype" PRIVATE
+ LABEL "qtfreetype"
+ CONDITION QT_FEATURE_static
+ AND TARGET Qt::Gui
+ AND QT_FEATURE_freetype
+ AND NOT QT_FEATURE_system_freetype
+)
+qt_feature("webengine-system-libpci" PRIVATE
+ LABEL "libpci"
+ CONDITION UNIX AND LIBPCI_FOUND
+)
+
+qt_feature("webengine-ozone-x11" PRIVATE
+ LABEL "Support GLX on qpa-xcb"
+ CONDITION LINUX
+ AND TARGET Qt::Gui
+ AND QT_FEATURE_xcb
+ AND X11_FOUND
+ AND LIBDRM_FOUND
+ AND XCOMPOSITE_FOUND
+ AND XCURSOR_FOUND
+ AND XI_FOUND
+ AND XPROTO_FOUND
+ AND XRANDR_FOUND
+ AND XTST_FOUND
+ AND XSHMFENCE_FOUND
+)
+
+#### Support Checks
+if(WIN32 AND (CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64" OR CMAKE_CROSSCOMPILING))
+ set(WIN_ARM_64 ON)
+else()
+ set(WIN_ARM_64 OFF)
+endif()
+
+add_check_for_support(
+ MODULES QtWebEngine QtPdf
+ CONDITION
+ CMAKE_VERSION
+ VERSION_GREATER_EQUAL
+ ${QT_SUPPORTED_MIN_CMAKE_VERSION_FOR_BUILDING_WEBENGINE}
+ MESSAGE
+ "Build requires CMake ${QT_SUPPORTED_MIN_CMAKE_VERSION_FOR_BUILDING_WEBENGINE} or higher."
+)
+
+assertTargets(
+ MODULES QtWebEngine QtPdf
+ TARGETS Gui Quick Qml
+)
+add_check_for_support(
+ MODULES QtWebEngine
+ CONDITION LINUX OR (WIN32 AND NOT WIN_ARM_64) OR MACOS
+ MESSAGE "Build can be done only on Linux, Windows or macOS."
+)
+add_check_for_support(
+ MODULES QtPdf
+ CONDITION LINUX OR (WIN32 AND NOT WIN_ARM_64) OR MACOS OR IOS OR ANDROID
+ MESSAGE "Build can be done only on Linux, Windows, macO, iOS and Android."
+)
+if(LINUX AND CMAKE_CROSSCOMPILING)
+ set(supportedTargets "arm" "arm64" "armv7-a" "x86_64")
+ add_check_for_support(
+ MODULES QtWebEngine QtPdf
+ CONDITION TEST_architecture_arch IN_LIST supportedTargets
+ MESSAGE "Cross compiling is not supported for ${TEST_architecture_arch}."
+ )
+ unset(supportedTargets)
+endif()
+add_check_for_support(
+ MODULES QtWebEngine
+ CONDITION NOT QT_FEATURE_static
+ MESSAGE "Static build is not supported."
+)
+add_check_for_support(
+ MODULES QtWebEngine QtPdf
+ CONDITION TARGET Nodejs::Nodejs
+ MESSAGE "node.js version 14 or later is required."
+)
+add_check_for_support(
+ MODULES QtWebEngine
+ CONDITION NOT (Nodejs_ARCH STREQUAL "ia32") AND
+ NOT (Nodejs_ARCH STREQUAL "x86") AND
+ NOT (Nodejs_ARCH STREQUAL "arm")
+ MESSAGE "32bit version of Nodejs is not supported."
+)
+add_check_for_support(
+ MODULES QtWebEngine QtPdf
+ CONDITION Python3_EXECUTABLE
+ MESSAGE "Python version 3.6 or later is required."
+)
+add_check_for_support(
+ MODULES QtWebEngine QtPdf
+ CONDITION Python3_EXECUTABLE AND NOT html5lib_NOT_FOUND
+ MESSAGE "Python3 html5lib is missing."
+)
+add_check_for_support(
+ MODULES QtWebEngine QtPdf
+ CONDITION GPerf_FOUND
+ MESSAGE "Tool gperf is required."
+)
+add_check_for_support(
+ MODULES QtWebEngine QtPdf
+ CONDITION BISON_FOUND
+ MESSAGE "Tool bison is required."
+)
+add_check_for_support(
+ MODULES QtWebEngine QtPdf
+ CONDITION FLEX_FOUND
+ MESSAGE "Tool flex is required."
+)
+add_check_for_support(
+ MODULES QtWebEngine QtPdf
+ CONDITION NOT LINUX OR PkgConfig_FOUND
+ MESSAGE "A pkg-config support is required."
+)
+add_check_for_support(
+ MODULES QtWebEngine QtPdf
+ CONDITION NOT LINUX OR TEST_glibc
+ MESSAGE "A suitable version >= 2.17 of glibc is required."
+)
+add_check_for_support(
+ MODULES QtWebEngine QtPdf
+ CONDITION NOT LINUX OR TEST_khr
+ MESSAGE "Build requires Khronos development headers for build - see mesa/libegl1-mesa-dev"
+)
+add_check_for_support(
+ MODULES QtWebEngine
+ CONDITION NOT LINUX OR FONTCONFIG_FOUND
+ MESSAGE "Build requires fontconfig."
+)
+add_check_for_support(
+ MODULES QtWebEngine
+ CONDITION NOT LINUX OR NSS_FOUND
+ MESSAGE "Build requires nss >= 3.26."
+)
+add_check_for_support(
+ MODULES QtWebEngine
+ CONDITION NOT LINUX OR DBUS_FOUND
+ MESSAGE "Build requires dbus."
+)
+add_check_for_support(
+ MODULES QtWebEngine
+ CONDITION NOT LINUX OR NOT QT_FEATURE_webengine_system_ffmpeg OR TEST_libavformat
+ MESSAGE "Unmodified ffmpeg >= 5.0 is not supported."
+)
+
+add_check_for_support(
+ MODULES QtWebEngine
+ CONDITION MSVC OR
+ (LINUX AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR
+ (LINUX AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR
+ (MACOS AND CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
+ MESSAGE
+ "${CMAKE_CXX_COMPILER_ID} compiler is not supported."
+)
+
+add_check_for_support(
+ MODULES QtPdf
+ CONDITION MSVC OR
+ (LINUX AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR
+ (LINUX AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR
+ (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") OR
+ (ANDROID AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR
+ (MINGW AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR
+ (MINGW AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+ MESSAGE
+ "${CMAKE_CXX_COMPILER_ID} compiler is not supported."
+)
+if(WIN32)
+ if(MSVC)
+ if(MSVC_TOOLSET_VERSION EQUAL 142) # VS 2019 (16.0)
+ add_check_for_support(
+ MODULES QtWebEngine QtPdf
+ CONDITION NOT MSVC_VERSION LESS 1929
+ MESSAGE "VS compiler version must be at least 14.29"
+ )
+ elseif(MSVC_TOOLSET_VERSION EQUAL 143) # VS 2022 (17.0)
+ add_check_for_support(
+ MODULES QtWebEngine QtPdf
+ CONDITION NOT MSVC_VERSION LESS 1936
+ MESSAGE "VS compiler version must be at least 14.36"
+ )
+ else()
+ message(FATAL_ERROR "Build requires Visual Studio 2019 or higher.")
+ endif()
+ endif()
+ set(windowsSdkVersion $ENV{WindowsSDKVersion})
+ string(REGEX REPLACE "([0-9.]+).*" "\\1" windowsSdkVersion "${windowsSdkVersion}")
+ string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" sdkMinor "${windowsSdkVersion}")
+ message("-- Windows 10 SDK version: ${windowsSdkVersion}")
+ add_check_for_support(
+ MODULES QtWebEngine
+ CONDITION sdkMinor GREATER_EQUAL 22621
+ MESSAGE "Build requires Windows 11 SDK at least version 10.0.22621.0"
+ )
+endif()
+
+#### Summary
+
+# > Qt WebEngine Build Features
+qt_configure_add_summary_section(NAME "WebEngine Repository Build Options")
+qt_configure_add_summary_entry(ARGS "webengine-build-ninja")
+qt_configure_add_summary_entry(ARGS "webengine-build-gn")
+qt_configure_add_summary_entry(ARGS "webengine-jumbo-build")
+qt_configure_add_summary_entry(ARGS "webengine-developer-build")
+qt_configure_add_summary_section(NAME "Build QtWebEngine Modules")
+qt_configure_add_summary_entry(ARGS "qtwebengine-core-build")
+qt_configure_add_summary_entry(ARGS "qtwebengine-widgets-build")
+qt_configure_add_summary_entry(ARGS "qtwebengine-quick-build")
+qt_configure_end_summary_section()
+qt_configure_add_summary_section(NAME "Build QtPdf Modules")
+qt_configure_add_summary_entry(ARGS "qtpdf-widgets-build")
+qt_configure_add_summary_entry(ARGS "qtpdf-quick-build")
+qt_configure_end_summary_section()
+# >> Optional system libraries
+if(UNIX)
+ qt_configure_add_summary_section(NAME "Optional system libraries")
+ qt_configure_add_summary_entry(ARGS "webengine-system-re2")
+ qt_configure_add_summary_entry(ARGS "webengine-system-icu")
+ qt_configure_add_summary_entry(ARGS "webengine-system-libwebp")
+ qt_configure_add_summary_entry(ARGS "webengine-system-opus")
+ qt_configure_add_summary_entry(ARGS "webengine-system-ffmpeg")
+ qt_configure_add_summary_entry(ARGS "webengine-system-libvpx")
+ qt_configure_add_summary_entry(ARGS "webengine-system-snappy")
+ qt_configure_add_summary_entry(ARGS "webengine-system-glib")
+ qt_configure_add_summary_entry(ARGS "webengine-system-zlib")
+ qt_configure_add_summary_entry(ARGS "webengine-system-minizip")
+ qt_configure_add_summary_entry(ARGS "webengine-system-libevent")
+ qt_configure_add_summary_entry(ARGS "webengine-system-libxml")
+ qt_configure_add_summary_entry(ARGS "webengine-system-lcms2")
+ qt_configure_add_summary_entry(ARGS "webengine-system-libpng")
+ qt_configure_add_summary_entry(ARGS "webengine-system-libtiff")
+ qt_configure_add_summary_entry(ARGS "webengine-system-libjpeg")
+ qt_configure_add_summary_entry(ARGS "webengine-system-libopenjpeg2")
+ qt_configure_add_summary_entry(ARGS "webengine-system-harfbuzz")
+ qt_configure_add_summary_entry(ARGS "webengine-system-freetype")
+ qt_configure_add_summary_entry(ARGS "webengine-system-libpci")
+ qt_configure_end_summary_section()
+endif()
+
+if(QT_FEATURE_static)
+ qt_configure_add_summary_section(NAME "Qt 3rdparty libs")
+ qt_configure_add_summary_entry(ARGS "webengine-qt-freetype")
+ qt_configure_add_summary_entry(ARGS "webengine-qt-harfbuzz")
+ qt_configure_add_summary_entry(ARGS "webengine-qt-libpng")
+ qt_configure_add_summary_entry(ARGS "webengine-qt-libjpeg")
+ qt_configure_add_summary_entry(ARGS "webengine-qt-zlib")
+endif()
+
+# << Optional system libraries
+qt_configure_end_summary_section()
+# < Qt WebEngine Build Features
+
+qt_configure_add_report_entry(
+ TYPE NOTE
+ MESSAGE "QtWebEngine build is disabled by user."
+ CONDITION QtWebEngine_SUPPORT AND NOT QT_FEATURE_qtwebengine_build
+)
+
+qt_configure_add_report_entry(
+ TYPE NOTE
+ MESSAGE "QtPdf build is disabled by user."
+ CONDITION QtPdf_SUPPORT AND NOT QT_FEATURE_qtpdf_build
+)
+
+qt_configure_add_report_entry(
+ TYPE WARNING
+ MESSAGE "Building fat libray with device and simulator architectures will disable NEON."
+ CONDITION IOS AND simulator AND device AND QT_FEATURE_qtpdf_build
+)
+
+if(LINUX AND QT_FEATURE_xcb AND TARGET Qt::Gui)
+ set(ozone_x11_support X11 LIBDRM XCOMPOSITE XCURSOR XRANDR XI XPROTO XSHMFENCE XTST)
+ set(ozone_x11_error OFF)
+ foreach(xs ${ozone_x11_support})
+ if(NOT ${xs}_FOUND)
+ set(ozone_x11_error ON)
+ set(ozone_x11_error_message "${ozone_x11_error_message}\n-- ${xs} libray not found")
+ endif()
+ endforeach()
+ if(ozone_x11_error)
+ qt_configure_add_report_entry(
+ TYPE WARNING
+ MESSAGE
+ "Could not find all necessary libraries for qpa-xcb support.${ozone_x11_error_message}"
+ )
+ endif()
+endif()
+
+if(PRINT_BFD_LINKER_WARNING)
+ qt_configure_add_report_entry(
+ TYPE WARNING
+ MESSAGE "Using bfd linker requires at least 4096 open files limit"
+ )
+endif()
+if(NOT FEATURE_webengine_opus_system AND NOT Perl_FOUND)
+ qt_configure_add_report_entry(
+ TYPE WARNING
+ MESSAGE "No perl found, compiling opus without some optimizations."
+ )
+endif()
+
diff --git a/configure.json b/configure.json
deleted file mode 100644
index a5dbad35b..000000000
--- a/configure.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "subconfigs": [
- "src/buildtools",
- "src/core",
- "src/webengine",
- "src/webenginewidgets",
- "src/pdf",
- "src/pdfwidgets"
- ]
-}
diff --git a/configure.pri b/configure.pri
deleted file mode 100644
index d3ba9b147..000000000
--- a/configure.pri
+++ /dev/null
@@ -1,541 +0,0 @@
-include(src/buildtools/config/support.pri)
-include(src/buildtools/config/functions.pri)
-
-# this must be done outside any function
-QTWEBENGINE_SOURCE_TREE = $$PWD
-
-equals(QMAKE_HOST.os, Windows): EXE_SUFFIX = .exe
-
-defineTest(isPythonVersionSupported) {
- python = $$system_quote($$system_path($$1))
- python_version = $$system('$$python -c "import sys; print(sys.version_info[0:3])"')
- python_version ~= s/[()]//g
- python_version = $$split(python_version, ',')
- python_major_version = $$first(python_version)
- greaterThan(python_major_version, 2) {
- qtLog("Python version 3 is not supported by Chromium.")
- return(false)
- }
- python_minor_version = $$member(python_version, 1)
- python_patch_version = $$member(python_version, 2)
- greaterThan(python_major_version, 1): greaterThan(python_minor_version, 6): greaterThan(python_patch_version, 4): return(true)
- qtLog("Unsupported python version: $${python_major_version}.$${python_minor_version}.$${python_patch_version}.")
- return(false)
-}
-
-defineTest(qtConfTest_detectJumboBuild) {
- mergeLimit = $$eval(config.input.merge_limit)
- mergeLimit = $$find(mergeLimit, "\\d")
- isEmpty(mergeLimit) {
- win32: mergeLimit = 0
- else: mergeLimit = 8
- }
- qtLog("Setting jumbo build merge batch limit to $${mergeLimit}.")
- $${1}.merge_limit = $$mergeLimit
- export($${1}.merge_limit)
- $${1}.cache += merge_limit
- export($${1}.cache)
-
- return(true)
-}
-
-defineTest(qtConfReport_skipBuildWarning) {
- $${1}()
- !isEmpty(skipBuildReason):qtConfAddWarning($${skipBuildReason})
-}
-
-defineTest(qtConfReport_jumboBuild) {
- mergeLimit = $$eval(cache.webengine-jumbo-build.merge_limit)
- isEmpty(mergeLimit)|!greaterThan(mergeLimit,0) {
- mergeLimit = "no"
- }
- qtConfReportPadded($${1}, $$mergeLimit)
-}
-
-defineTest(qtConfTest_detectPython2) {
- python = $$qtConfFindInPath("python2$$EXE_SUFFIX")
- isEmpty(python) {
- qtLog("'python2$$EXE_SUFFIX' not found in PATH. Checking for 'python$$EXE_SUFFIX'.")
- python = $$qtConfFindInPath("python$$EXE_SUFFIX")
- }
- isEmpty(python) {
- qtLog("'python$$EXE_SUFFIX' not found in PATH. Giving up.")
- return(false)
- }
- !isPythonVersionSupported($$python) {
- qtLog("A suitable Python 2 executable could not be located.")
- return(false)
- }
-
- # Make tests.python2.location available in configure.json.
- $${1}.location = $$clean_path($$python)
- export($${1}.location)
- $${1}.cache += location
- export($${1}.cache)
-
- return(true)
-}
-
-defineReplace(qtConfFindGnuTool) {
- equals(QMAKE_HOST.os, Windows) {
- gnuwin32bindir = $$absolute_path($$QTWEBENGINE_SOURCE_TREE/../gnuwin32/bin)
- gnuwin32toolpath = "$$gnuwin32bindir/$${1}"
- exists($$gnuwin32toolpath): \
- return($$gnuwin32toolpath)
- }
- return($$qtConfFindInPath($$1))
-}
-
-defineTest(qtConfTest_detectGperf) {
- gperf = $$qtConfFindGnuTool("gperf$$EXE_SUFFIX")
- isEmpty(gperf) {
- qtLog("Required gperf could not be found.")
- return(false)
- }
- qtLog("Found gperf from path: $$gperf")
- return(true)
-}
-
-defineTest(qtConfTest_detectBison) {
- bison = $$qtConfFindGnuTool("bison$$EXE_SUFFIX")
- isEmpty(bison) {
- qtLog("Required bison could not be found.")
- return(false)
- }
- qtLog("Found bison from path: $$bison")
- return(true)
-}
-
-defineTest(qtwebengine_platformError) {
- platformError = $$1
- export(platformError)
-}
-
-defineTest(qtConfTest_detectPlatform) {
- QT_FOR_CONFIG += gui-private
-
- linux:qtwebengine_isLinuxPlatformSupported() {
- $${1}.platform = "linux"
- }
- win32:qtwebengine_isWindowsPlatformSupported() {
- $${1}.platform = "windows"
- }
- macos:qtwebengine_isMacOsPlatformSupported() {
- $${1}.platform = "macos"
- }
- ios:qtwebengine_isMacOsPlatformSupported() {
- $${1}.platform = "ios"
- }
-
- !isEmpty(platformError) {
- qtLog("Platform not supported.")
- $${1}.platformSupport = $$platformError
- export($${1}.platformSupport)
- $${1}.cache += platformSupport
- export($${1}.cache)
- return(false)
- }
- export($${1}.platformSupport)
- return(true)
-}
-
-defineTest(qtConfTest_detectArch) {
- contains(QT_ARCH, "i386")|contains(QT_ARCH, "x86_64"): return(true)
- contains(QT_ARCH, "arm")|contains(QT_ARCH, "arm64"): return(true)
- contains(QT_ARCH, "mips"): return(true)
- qtLog("Architecture not supported.")
- return(false)
-}
-
-defineTest(qtConfTest_detectFlex) {
- flex = $$qtConfFindGnuTool("flex$$EXE_SUFFIX")
- isEmpty(flex) {
- qtLog("Required flex could not be found.")
- return(false)
- }
- qtLog("Found flex from path: $$flex")
- return(true)
-}
-
-defineTest(qtConfTest_detectNinja) {
- ninja = $$qtConfFindInPath("ninja$$EXE_SUFFIX")
- !isEmpty(ninja) {
- qtLog("Found ninja from path: $$ninja")
- qtRunLoggedCommand("$$ninja --version", version)|return(false)
- contains(version, "1\.([7-9]|1[0-9])\..*"): return(true)
- qtLog("Ninja version too old")
- }
- qtLog("Building own ninja")
- return(false)
-}
-
-defineTest(qtConfTest_detectProtoc) {
- protoc = $$qtConfFindInPath("protoc")
- isEmpty(protoc) {
- qtLog("Optional protoc could not be found.")
- return(false)
- }
- qtLog("Found protoc from path: $$protoc")
- return(true)
-}
-
-defineTest(qtConfTest_detectGn) {
- gn = $$qtConfFindInPath("gn$$EXE_SUFFIX")
- !isEmpty(gn) {
- qtRunLoggedCommand("$$gn --version", version)|return(false)
- #accept all for now
- contains(version, ".*"): return(true)
- qtLog("Gn version too old")
- }
- qtLog("Building own gn")
- return(false)
-}
-
-defineTest(qtConfTest_detectNodeJS) {
- nodejs = $$qtConfFindInPath("nodejs$$EXE_SUFFIX")
- isEmpty(nodejs) {
- qtLog("'nodejs$$EXE_SUFFIX' not found in PATH. Checking for 'node$$EXE_SUFFIX'.")
- nodejs = $$qtConfFindInPath("node$$EXE_SUFFIX")
- isEmpty(nodejs) {
- qtLog("'node$$EXE_SUFFIX' not found in PATH. Giving up.")
- return(false)
- }
- }
- return(true)
-}
-
-defineTest(qtConfTest_detectEmbedded) {
- lessThan(QT_MINOR_VERSION, 9) {
- cross_compile: return(true)
- return(false)
- }
- $$qtConfEvaluate("features.cross_compile"): return(true)
- return(false)
-}
-
-defineTest(qtConfTest_detectHostPkgConfig) {
- PKG_CONFIG = $$qtConfPkgConfig(true)
- isEmpty(PKG_CONFIG) {
- qtLog("Could not find host pkg-config")
- return(false)
- }
- qtLog("Found host pkg-config: $$PKG_CONFIG")
- $${1}.path = $$PKG_CONFIG
- export($${1}.path)
- $${1}.cache += path
- export($${1}.cache)
- return(true)
-}
-
-defineTest(qtConfTest_isSanitizerSupported) {
- sanitizer_combo_supported = true
-
- sanitize_address {
- asan_supported = false
- linux-clang-libc++:isSanitizerSupportedOnLinux() {
- asan_supported = true
- } else:macos:isSanitizerSupportedOnMacOS() {
- asan_supported = true
- }
- !$$asan_supported {
- sanitizer_combo_supported = false
- qtLog("An address sanitizer-enabled Qt WebEngine build can only be built on Linux or macOS using Clang and libc++.")
- }
- }
-
- sanitize_memory {
- sanitizer_combo_supported = false
- qtLog("A memory sanitizer-enabled Qt WebEngine build is not supported.")
- }
-
- sanitize_undefined {
- ubsan_supported = false
- CONFIG(release, debug|release):!debug_and_release {
- linux-clang-libc++:isSanitizerSupportedOnLinux() {
- ubsan_supported = true
- } else:macos:isSanitizerSupportedOnMacOS() {
- ubsan_supported = true
- }
- }
- !$$ubsan_supported {
- sanitizer_combo_supported = false
- qtLog("An undefined behavior sanitizer-enabled Qt WebEngine build can only be built on Linux or macOS using Clang and libc++ in release mode.")
- }
- }
-
- sanitize_thread {
- tsan_supported = false
- linux-clang-libc++:isSanitizerSupportedOnLinux() {
- tsan_supported = true
- }
- !$$tsan_supported {
- sanitizer_combo_supported = false
- qtLog("A thread sanitizer-enabled Qt WebEngine build can only be built on Linux using Clang and libc++.")
- }
- }
-
- $$sanitizer_combo_supported: return(true)
- return(false)
-}
-
-defineTest(isSanitizerSupportedOnLinux) {
- isSanitizerLinuxClangVersionSupported(): return(true)
- return(false)
-}
-
-defineTest(isSanitizerSupportedOnMacOS) {
- isEmpty(QMAKE_APPLE_CLANG_MAJOR_VERSION) {
- QTWEBENGINE_CLANG_IS_APPLE = false
- } else {
- QTWEBENGINE_CLANG_IS_APPLE = true
- }
-
- $$QTWEBENGINE_CLANG_IS_APPLE:isSanitizerMacOSAppleClangVersionSupported(): return(true)
- else:isSanitizerMacOSClangVersionSupported(): return(true)
- return(false)
-}
-
-defineTest(isSanitizerMacOSAppleClangVersionSupported) {
- # Clang sanitizer suppression attributes work from Apple Clang version 7.3.0+.
- greaterThan(QMAKE_APPLE_CLANG_MAJOR_VERSION, 7): return(true)
- greaterThan(QMAKE_APPLE_CLANG_MINOR_VERSION, 2): return(true)
-
- qtLog("Using Apple Clang version $${QMAKE_APPLE_CLANG_MAJOR_VERSION}.$${QMAKE_APPLE_CLANG_MINOR_VERSION}.$${QMAKE_APPLE_CLANG_PATCH_VERSION}, but at least Apple Clang version 7.3.0 is required to build a sanitizer-enabled Qt WebEngine.")
- return(false)
-}
-
-defineTest(isSanitizerMacOSClangVersionSupported) {
- # Clang sanitizer suppression attributes work from non-apple Clang version 3.7+.
- greaterThan(QMAKE_CLANG_MAJOR_VERSION, 3): return(true)
- greaterThan(QMAKE_CLANG_MINOR_VERSION, 6): return(true)
-
- qtLog("Using Clang version $${QMAKE_CLANG_MAJOR_VERSION}.$${QMAKE_CLANG_MINOR_VERSION}, but at least Clang version 3.7 is required to build a sanitizer-enabled Qt WebEngine.")
- return(false)
-}
-
-defineTest(isSanitizerLinuxClangVersionSupported) {
- # Clang sanitizer suppression attributes work from Clang version 3.7+.
- greaterThan(QMAKE_CLANG_MAJOR_VERSION, 3): return(true)
- greaterThan(QMAKE_CLANG_MINOR_VERSION, 6): return(true)
-
- qtLog("Using Clang version $${QMAKE_CLANG_MAJOR_VERSION}.$${QMAKE_CLANG_MINOR_VERSION}, but at least Clang version 3.7 is required to build a sanitizer-enabled Qt WebEngine.")
- return(false)
-}
-
-defineReplace(qtConfFunc_isTestsInBuildParts) {
- contains(QT_BUILD_PARTS, tests): return(true)
- return(false)
-}
-
-defineReplace(webEngineGetMacOSVersion) {
- value = $$system("sw_vers -productVersion 2>/dev/null")
- return($$value)
-}
-
-defineReplace(webEngineGetMacOSSDKVersion) {
- value = $$system("/usr/bin/xcodebuild -sdk $$QMAKE_MAC_SDK -version ProductVersion 2>/dev/null")
- return($$value)
-}
-
-defineReplace(webEngineGetMacOSClangVerboseVersion) {
- output = $$system("$$QMAKE_CXX --version 2>/dev/null", lines)
- value = $$first(output)
- return($$value)
-}
-
-defineTest(qtConfReport_macosToolchainVersion) {
- arg = $$2
- contains(arg, "macosVersion"): report_message = $$webEngineGetMacOSVersion()
- contains(arg, "xcodeVersion"): report_message = "$$QMAKE_XCODE_VERSION"
- contains(arg, "clangVersion"): report_message = $$webEngineGetMacOSClangVerboseVersion()
- contains(arg, "sdkVersion"): report_message = $$webEngineGetMacOSSDKVersion()
- contains(arg, "deploymentTarget"): report_message = "$$QMAKE_MACOSX_DEPLOYMENT_TARGET"
- !isEmpty(report_message): qtConfReportPadded($$1, $$report_message)
-}
-
-defineTest(qtConfTest_isWindowsHostCompiler64) {
- win_host_arch = $$(VSCMD_ARG_HOST_ARCH)
- isEmpty(win_host_arch): return(true)
- contains(win_host_arch,"x64"): return(true)
- qtLog("Required 64-bit cross-building or native toolchain was not detected.")
- return(false)
-}
-
-# Fixme QTBUG-71772
-defineTest(qtConfTest_hasThumbFlag) {
- FLAG = $$qtwebengine_extractCFlag("-mthumb")
- !isEmpty(FLAG): return(true)
- FLAG = $$qtwebengine_extractCFlag("-marm")
- !isEmpty(FLAG): return(false)
-
- MARCH = $$qtwebengine_extractCFlag("-march=.*")
- MARMV = $$replace(MARCH, "armv",)
- !isEmpty(MARMV) {
- MARMV = $$split(MARMV,)
- MARMV = $$member(MARMV, 0)
- }
- if (isEmpty(MARMV) | lessThan(MARMV, 7)): return(false)
- # no flag assume mthumb
- return(true)
-}
-
-defineTest(qtConfTest_detectSubmodule) {
- isEmpty(QTWEBENGINE_ROOT) {
- # topLevel build , add poor man's workaround
- QTWEBENGINE_ROOT=$$PWD/../../../qtwebengine
- }
- !exists($$QTWEBENGINE_ROOT/src/3rdparty/chromium):return(false)
- return(true)
-}
-
-defineTest(qtConfTest_detectNoWhitespace) {
- WSPC = $$find(OUT_PWD, \\s)
- !isEmpty(WSPC):return(false)
- return(true)
-}
-
-defineTest(qtwebengine_confCheckWebEngineCoreError) {
- QT_FOR_CONFIG += buildtools-private gui-private
- return($$qtwebengine_checkWebEngineCoreError())
-}
-
-defineTest(qtwebengine_confCheckPdfError) {
- QT_FOR_CONFIG += buildtools-private gui-private
- return($$qtwebengine_checkPdfError())
-}
-
-defineTest(qtwebengine_isLinuxPlatformSupported) {
- !gcc|intel_icc {
- qtwebengine_platformError("requires clang or GCC.")
- return(false)
- }
- gcc:!clang:!qtwebengine_isGCCVersionSupported(): return(false)
- gcc:!qtConfig(c++14) {
- qtwebengine_platformError("requires c++14 support.")
- return(false)
- }
- return(true)
-}
-
-defineTest(qtwebengine_isWindowsPlatformSupported) {
- winrt {
- qtwebengine_platformError("for WinRT is not supported.")
- return(false)
- }
- qtwebengine_isBuildingOnWin32() {
- qtwebengine_platformError("must be built on a 64-bit machine.")
- return(false)
- }
- !msvc|intel_icl {
- qtwebengine_platformError("requires MSVC or Clang (MSVC mode).")
- return(false)
- }
- !qtwebengine_isMinWinSDKVersion(10, 18362): {
- qtwebengine_platformError("requires a Windows SDK version 10.0.18362 or newer.")
- return(false)
- }
- return(true)
-}
-
-defineTest(qtwebengine_isMacOsPlatformSupported) {
- !qtwebengine_isMinXcodeVersion(10, 0, 0) {
- qtwebengine_platformError("requires at least version 10.0.0, but using Xcode version $${QMAKE_XCODE_VERSION}.")
- return(false)
- }
- !clang|intel_icc {
- qtwebengine_platformError("requires Clang.")
- return(false)
- }
- # We require macOS 10.13 (darwin version 17.0.0) or newer.
- darwin_major_version = $$section(QMAKE_HOST.version, ., 0, 0)
- lessThan(darwin_major_version, 17) {
- qtwebengine_platformError("requires macOS version 10.13 or newer.")
- return(false)
- }
- !qtwebengine_isMinOSXSDKVersion(10, 13): {
- qtwebengine_platformError("requires a macOS SDK version of 10.13 or newer. Current version is $${WEBENGINE_OSX_SDK_PRODUCT_VERSION}.")
- return(false)
- }
- return(true)
-}
-
-defineTest(qtwebengine_isGCCVersionSupported) {
- # Keep in sync with src/webengine/doc/src/qtwebengine-platform-notes.qdoc
- greaterThan(QMAKE_GCC_MAJOR_VERSION, 4):return(true)
-
- qtwebengine_platformError("requires at least gcc version 5, but using gcc version $${QMAKE_GCC_MAJOR_VERSION}.$${QMAKE_GCC_MINOR_VERSION}.")
- return(false)
-}
-
-defineTest(qtwebengine_isBuildingOnWin32) {
- # The check below is ugly, but necessary, as it seems to be the only reliable way to detect if the host
- # architecture is 32 bit. QMAKE_HOST.arch does not work as it returns the architecture that the toolchain
- # is building for, not the system's actual architecture.
- PROGRAM_FILES_X86 = $$(ProgramW6432)
- isEmpty(PROGRAM_FILES_X86): return(true)
- return(false)
-}
-
-defineTest(qtwebengine_isMinOSXSDKVersion) {
- requested_major = $$1
- requested_minor = $$2
- requested_patch = $$3
- isEmpty(requested_patch): requested_patch = 0
- WEBENGINE_OSX_SDK_PRODUCT_VERSION = $$system("/usr/bin/xcodebuild -sdk $$QMAKE_MAC_SDK -version ProductVersion 2>/dev/null")
- export(WEBENGINE_OSX_SDK_PRODUCT_VERSION)
- isEmpty(WEBENGINE_OSX_SDK_PRODUCT_VERSION) {
- qtwebengine_platformError("requires SDK product version, but could not resolve it for \'$$QMAKE_MAC_SDK\'.")
- return(false)
- }
- major_version = $$section(WEBENGINE_OSX_SDK_PRODUCT_VERSION, ., 0, 0)
- minor_version = $$section(WEBENGINE_OSX_SDK_PRODUCT_VERSION, ., 1, 1)
- patch_version = $$section(WEBENGINE_OSX_SDK_PRODUCT_VERSION, ., 2, 2)
- isEmpty(patch_version): patch_version = 0
-
- greaterThan(major_version, $$requested_major):return(true)
- equals(major_version, $$requested_major):greaterThan(minor_version, $$requested_minor):return(true)
- equals(major_version, $$requested_major):equals(minor_version, $$requested_minor):!lessThan(patch_version, $$requested_patch):return(true)
-
- return(false)
-}
-
-defineTest(qtwebengine_isMinXcodeVersion) {
- requested_major = $$1
- requested_minor = $$2
- requested_patch = $$3
- isEmpty(requested_minor): requested_minor = 0
- isEmpty(requested_patch): requested_patch = 0
- target_var = QMAKE_XCODE_VERSION
- major_version = $$section($$target_var, ., 0, 0)
- minor_version = $$section($$target_var, ., 1, 1)
- patch_version = $$section($$target_var, ., 2, 2)
- isEmpty(minor_version): minor_version = 0
- isEmpty(patch_version): patch_version = 0
-
- greaterThan(major_version, $$requested_major):return(true)
- equals(major_version, $$requested_major):greaterThan(minor_version, $$requested_minor):return(true)
- equals(major_version, $$requested_major):equals(minor_version, $$requested_minor):!lessThan(patch_version, $$requested_patch):return(true)
-
- return(false)
-}
-
-defineTest(qtwebengine_isMinWinSDKVersion) {
- requested_major = $$1
- requested_minor = $$2
- WIN_SDK_VERSION = $$(WindowsSDKVersion)
-
- isEmpty(WIN_SDK_VERSION)|equals(WIN_SDK_VERSION, "\\") {
- qtwebengine_platformError("requires Windows SDK version, but could not detect it (\'WindowsSDKVersion\' environment variable is not set).")
- return(false)
- }
-
- # major.0.minor
- major_version = $$section(WIN_SDK_VERSION, ., 0, 0)
- minor_version = $$section(WIN_SDK_VERSION, ., 2, 2)
-
- greaterThan(major_version, $$requested_major):return(true)
- equals(major_version, $$requested_major):greaterThan(minor_version, $$requested_minor):return(true)
- equals(major_version, $$requested_major):equals(minor_version, $$requested_minor)::return(true)
-
- return(false)
-}
diff --git a/dependencies.yaml b/dependencies.yaml
new file mode 100644
index 000000000..f6dff0465
--- /dev/null
+++ b/dependencies.yaml
@@ -0,0 +1,13 @@
+dependencies:
+ ../qtdeclarative:
+ ref: c283d4473edd1532cf1bce91ad1215e42e4fa15b
+ required: true
+ ../qtpositioning:
+ ref: 2750f3ecc47813c0c0de1e04d4d64f839801809b
+ required: false
+ ../qttools:
+ ref: 94d1021cc54e61dcc24159f45ab47bb5fbfb1276
+ required: false
+ ../qtwebchannel:
+ ref: 0603692e37ebd026766a13d80afbf2c3620d906f
+ required: false
diff --git a/dist/changes-5.12.10 b/dist/changes-5.12.10
new file mode 100644
index 000000000..3f706d6b1
--- /dev/null
+++ b/dist/changes-5.12.10
@@ -0,0 +1,91 @@
+Qt 5.12.10 is a bug-fix release. It maintains both forward and backward
+compatibility (source and binary) with Qt 5.12.9.
+
+For more details, refer to the online documentation included in this
+distribution. The documentation is also available online:
+
+ https://doc.qt.io/qt-5.12/index.html
+
+The Qt version 5.12 series is binary compatible with the 5.11.x series.
+Applications compiled for 5.11 will continue to run with 5.12.
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker:
+
+ https://bugreports.qt.io/
+
+Each of these identifiers can be entered in the bug tracker to obtain more
+information about a particular change.
+
+****************************************************************************
+* Library *
+****************************************************************************
+
+General
+-------
+
+ - [QTBUG-75391] Fix pasting Unicode characters copied from WebEngine on macOS
+ - [QTBUG-83710] Fix input of keys requiring AltGr on Windows
+ - [QTBUG-84337] Fixed GPU switching with CoreProfile on macOS (for e.g. AirPlay)
+ - [QTBUG-86018] Fixed build with Bison 3.7
+ - Fixed build with the linux-clang 10 spec
+
+Chromium
+--------
+
+ - Security fixes from Chromium up to version 86.0.4240.111, including:
+
+ - CVE-2020-6459
+ - CVE-2020-6462: Use after free in task scheduling
+ - CVE-2020-6470
+ - CVE-2020-6474
+ - CVE-2020-6481
+ - CVE-2020-6489
+ - CVE-2020-6490
+ - CVE-2020-6511: Side-channel information leakage in CSP
+ - CVE-2020-6512: Type Confusion in V8
+ - CVE-2020-6513: Heap buffer overflow in PDFium
+ - CVE-2020-6514: Inappropriate implementation in WebRTC
+ - CVE-2020-6518: Use after free in developer tools
+ - CVE-2020-6523: Out of bounds write in Skia
+ - CVE-2020-6524: Heap buffer overflow in WebAudio
+ - CVE-2020-6529: Inappropriate implementation in WebRTC
+ - CVE-2020-6532: Use after free in SCTP
+ - CVE-2020-6535: Insufficient data validation in WebUI
+ - CVE-2020-6534: Heap buffer overflow in WebRTC
+ - CVE-2020-6540: Heap buffer overflow in Skia
+ - CVE-2020-6541: Use after free in WebUSB
+ - CVE-2020-6542: Use after free in ANGLE
+ - CVE-2020-6543: Use after free in task scheduling
+ - CVE-2020-6544: Use after free in media
+ - CVE-2020-6545: Use after free in audio
+ - CVE-2020-6548: Heap buffer overflow in Skia
+ - CVE-2020-6549: Use after free in media
+ - CVE-2020-6559: Use after free in presentation API
+ - CVE-2020-6561: Inappropriate implementation in Content Security Policy
+ - CVE-2020-6562: Insufficient policy enforcement in Blink
+ - CVE-2020-6569: Integer overflow in WebUSB
+ - CVE-2020-6571: Incorrect security UI in Omnibox
+ - CVE-2020-6573: Use after free in video
+ - CVE-2020-15962: Insufficient policy enforcement in serial
+ - CVE-2020-15964: Insufficient data validation in media
+ - CVE-2020-15965: Out of bounds write in V8
+ - CVE-2020-15968: Use after free in Blink
+ - CVE-2020-15969: Use after free in WebRTC.
+ - CVE-2020-15999: Heap buffer overflow in freetype
+ - CVE-2020-16001: Use after free in media.
+ - CVE-2020-16002: Use after free in PDFium.
+ - CVE-2020-16003: Use after free in printing.
+ - Security Bug 1051439
+ - Security bug 1052492
+ - Security bug 1054229
+ - Security Bug 1057369
+ - Security Bug 1058515
+ - Security bug 1065122
+ - Security bug 1065731
+ - Security bugs 1087629 and 1029569
+ - Security issue 1098860
+ - Security issue 1102137
+ - Security bug 1102408
+ - Security bug 1111149
+
diff --git a/dist/changes-5.15.1 b/dist/changes-5.15.1
new file mode 100644
index 000000000..263f04ec3
--- /dev/null
+++ b/dist/changes-5.15.1
@@ -0,0 +1,138 @@
+Qt 5.15.1 is a bug-fix release. It maintains both forward and backward
+compatibility (source and binary) with Qt 5.15.0.
+
+For more details, refer to the online documentation included in this
+distribution. The documentation is also available online:
+
+https://doc.qt.io/qt-5/index.html
+
+The Qt version 5.15 series is binary compatible with the 5.14.x series.
+Applications compiled for 5.14 will continue to run with 5.15.
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker:
+
+https://bugreports.qt.io/
+
+Each of these identifiers can be entered in the bug tracker to obtain more
+information about a particular change.
+
+****************************************************************************
+* Qt 5.15.1 Changes *
+****************************************************************************
+
+General
+-------
+ - [QTBUG-54720] FIDO U2F and WebAuth are now enabled
+ - [QTBUG-62957] Fix unwanted creation of databases-incognito files in the
+ home directory when using an incognito profile
+ - [QTBUG-70437] Fix scrollbar when releasing mouse button outside of window
+ on Windows
+ - [QTBUG-72497] The use of QUIC can now be enforced via a command line flag
+ - [QTBUG-75262, QTBUG-81693] Fixed HW acceleration and WebGL on macOS
+ - [QTBUG-75391] Fix copy and paste of non-ascii characters from HTML on
+ macOS
+ - [QTBUG-78559] Add basic parser for QTWEBENGINE_CHROMIUM_FLAGS to correctly
+ parse multiple arguments passed in the same flag,
+ e.g. js-flags
+ - [QTBUG-83294] The pointer lock feature is now working again
+ - [QTBUG-83476] Feature Permissions can now be set and cleared before the
+ first navigation
+ - [QTBUG-83710] Fix AltGr on Windows
+ - [QTBUG-83729] Fix regession of completion in the developer tools
+ "Console" tab not working properly
+ - [QTBUG-83732] Fix setting WebEngineView.audioMuted before first page load
+ - [QTBUG-83785] Fix upside down render passes with the software scenegraph
+ - [QTBUG-84340] Re-enable PDF viewer after regression in 5.15.0
+ - [QTBUG-84355] Fix crash when closing the WebContents
+ - [QTBUG-84660] Fix double click on Flash content
+ - [QTBUG-85116] Automatically reject feature permission requests in incognito
+ mode
+ - [QTBUG-85117] Fix regression causing client certificates to not work
+ - [QTBUG-85118] Fix regression of QWebEnginePage::recentlyAudibleChanged
+ signal
+ - [QTBUG-85309] Enable screen sharing on wayland by supporting PipeWire
+ - [QTBUG-85363] Fix wrong application name in utility process to list it
+ correctly in e.g. PulseAudio
+ - [QTBUG-85526] Fix regression with cookie filters not working
+ - [QTBUG-85626] Fix regression with crashes on media playback / D-BUS
+ - [QTBUG-85890] Support combining audio and video permission requests in the
+ getDisplayMedia API
+ - [QTBUG-85817] Fix regression causing crashes on resize
+ - [QTBUG-86018] Fix building with bison 3.7 on newer Linux
+ - [QTBUG-86092] Fix H264 support in WebRTC on Windows when using MSVC
+ - Enable hardware accelerated video decoding with ANGLE
+
+Chromium
+--------
+
+ - Security fixes from Chrome up to version 85.0.4183.83, including:
+
+ * CVE-2020-6467
+ * CVE-2020-6468
+ * CVE-2020-6470
+ * CVE-2020-6471
+ * CVE-2020-6472
+ * CVE-2020-6473
+ * CVE-2020-6474
+ * CVE-2020-6475
+ * CVE-2020-6476
+ * CVE-2020-6480
+ * CVE-2020-6481
+ * CVE-2020-6482
+ * CVE-2020-6483
+ * CVE-2020-6486
+ * CVE-2020-6487
+ * CVE-2020-6489
+ * CVE-2020-6490
+ * CVE-2020-6493: Use after free in WebAuthentication
+ * CVE-2020-6506: Insufficient policy enforcement in WebView
+ * CVE-2020-6510: Heap buffer overflow in background fetch
+ * CVE-2020-6511: Side-channel information leakage in CSP
+ * CVE-2020-6512: Type Confusion in V8
+ * CVE-2020-6513: Heap buffer overflow in PDFium
+ * CVE-2020-6514: Inappropriate implementation in WebRTC
+ * CVE-2020-6518: Use after free in developer tools
+ * CVE-2020-6523: Out of bounds write in Skia
+ * CVE-2020-6524: Heap buffer overflow in WebAudio
+ * CVE-2020-6526: Inappropriate implementation in iframe sandbox
+ * CVE-2020-6529: Inappropriate implementation in WebRTC
+ * CVE-2020-6530: Out of bounds memory access in developer tools
+ * CVE-2020-6531: Side-channel information leakage in scroll to text
+ * CVE-2020-6532: Use after free in SCTP
+ * CVE-2020-6533: Type Confusion in V8.
+ * CVE-2020-6534: Heap buffer overflow in WebRTC
+ * CVE-2020-6535: Insufficient data validation in WebUI
+ * CVE-2020-6540: Heap buffer overflow in Skia
+ * CVE-2020-6541: Use after free in WebUSB
+ * CVE-2020-6542: Use after free in ANGLE
+ * CVE-2020-6543: Use after free in task scheduling
+ * CVE-2020-6544: Use after free in media
+ * CVE-2020-6545: Use after free in audio
+ * CVE-2020-6548: Heap buffer overflow in Skia
+ * CVE-2020-6549: Use after free in media
+ * CVE-2020-6550: Use after free in IndexedDB
+ * CVE-2020-6551: Use after free in WebXR
+ * CVE-2020-6555: Out of bounds read in WebGL
+ * CVE-2020-6559: Use after free in presentation API
+ * Security bug 1025302
+ * Security bug 1029569
+ * Security Bug 1048619
+ * Security Bug 1051439
+ * Security bug 1052492
+ * Security bug 1054229
+ * Security Bug 1056161
+ * Security Bug 1057369
+ * Security Bug 1058515
+ * Security Bug 1061933
+ * Security bug 1065122
+ * Security bug 1065731
+ * Security Bug 1070012
+ * Security bug 1075907
+ * Security bug 1087158
+ * Security bug 1087629
+ * Security bug 1090543
+ * Security bug 1098860
+ * Security bug 1102137
+ * Security bug 1102408
+ * Security bug 1108639
diff --git a/dist/changes-5.15.2 b/dist/changes-5.15.2
new file mode 100644
index 000000000..792b9afd6
--- /dev/null
+++ b/dist/changes-5.15.2
@@ -0,0 +1,86 @@
+Qt 5.15.2 is a bug-fix release. It maintains both forward and backward
+compatibility (source and binary) with Qt 5.15.1.
+
+For more details, refer to the online documentation included in this
+distribution. The documentation is also available online:
+
+ https://doc.qt.io/qt-5.15/index.html
+
+The Qt version 5.15 series is binary compatible with the 5.14.x series.
+Applications compiled for 5.14 will continue to run with 5.15.
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker:
+
+ https://bugreports.qt.io/
+
+Each of these identifiers can be entered in the bug tracker to obtain more
+information about a particular change.
+
+****************************************************************************
+* Library *
+****************************************************************************
+
+General
+-------
+ - [QTBUG-84632] Warn about QtWebengineProcess launching from network share
+ on Windows.
+ - [QTBUG-85363] Handle non-ASCII names for PulseAudio
+ - [QTBUG-85494] Fix regression crash when not handling QQuickWebEngineNewViewRequest
+ - [QTBUG-85817] Fix crashes on resize
+ - [QTBUG-86672] Fix remapped menu key being mapped back to menu key
+ - [QTBUG-86945] Fix crash when opening a PDF in debug build on windows.
+ - [QTBUG-87129] Mention node.js build-time dependency
+ - The QtWebEngineProcess now has a version number
+ - The old compositor has been removed and can no longer be restored using
+ command line argument.
+
+Chromium
+--------
+
+ - The Chromium version has been updated to 83.0.4103.122
+ - Security fixes from Chromium up to version 86.0.4240.183, including:
+ - CVE-2020-6540: Heap buffer overflow in Skia
+ - CVE-2020-6557: Inappropriate implementation in networking
+ - CVE-2020-6561: Inappropriate implementation in Content Security Policy
+ - CVE-2020-6562: Insufficient policy enforcement in Blink
+ - CVE-2020-6569: Integer overflow in WebUSB
+ - CVE-2020-6570: Side-channel information leakage in WebRTC
+ - CVE-2020-6573: Use after free in video
+ - CVE-2020-6571: Incorrect security UI in Omnibox
+ - CVE-2020-6575: Race in Mojo
+ - CVE-2020-6576: Use after free in offscreen canvas
+ - CVE-2020-15959: Insufficient policy enforcement in networking
+ - CVE-2020-15960: Out of bounds read in storage
+ - CVE-2020-15961: Insufficient policy enforcement in extensions
+ - CVE-2020-15962: Insufficient policy enforcement in serial
+ - CVE-2020-15963
+ - CVE-2020-15964: Insufficient data validation in media
+ - CVE-2020-15965: Out of bounds write in V8
+ - CVE-2020-15966
+ - CVE-2020-15968: Use after free in Blink
+ - CVE-2020-15969: Use after free in WebRTC.
+ - CVE-2020-15972: Use after free in audio.
+ - CVE-2020—15973: Insufficient policy enforcement in extensions
+ - CVE-2020-15974: Integer overflow in Blink
+ - CVE-2020-15976: Use after free in WebXR
+ - CVE-2020-15977: Insufficient data validation in dialogs.
+ - CVE-2020-15978: Insufficient data validation in navigation
+ - CVE-2020-15979: Inappropriate implementation in V8.
+ - CVE-2020-15985: Inappropriate implementation in Blink.
+ - CVE-2020-15987: Use after free in WebRTC
+ - CVE-2020-15989: Uninitialized Use in PDFium
+ - CVE-2020-15992: Insufficient policy enforcement in networking
+ - CVE-2020-15999: Heap buffer overflow in freetype
+ - CVE-2020-16001: Use after free in media.
+ - CVE-2020-16002: Use after free in PDFium
+ - CVE-2020-16003: Use after free in printing
+ - CVE-2020-16005: Insufficient policy enforcement in ANGLE
+ - CVE-2020-16008: Stack buffer overflow in WebRTC
+ - CVE-2020-16009: Inappropriate implementation in V8
+ - CVE-2020-16011: Heap buffer overflow in UI on Windows.
+ - Security bug 1106091
+ - Security bug 1107824
+ - Security bug 1111149
+ - Security bug 1125199
+ - Security bug 1137608
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
new file mode 100644
index 000000000..e863dafaf
--- /dev/null
+++ b/examples/CMakeLists.txt
@@ -0,0 +1,21 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+
+qt_examples_build_begin(EXTERNAL_BUILD)
+if(NOT CMAKE_CROSSCOMPILING) #QTBUG-86533
+ if(TARGET Qt::WebEngineCore)
+ add_subdirectory(webenginequick)
+ endif()
+ if(TARGET Qt::WebEngineWidgets)
+ add_subdirectory(webenginewidgets)
+ endif()
+ if(TARGET Qt::Pdf)
+ add_subdirectory(pdf)
+ endif()
+ if(TARGET Qt::PdfWidgets)
+ add_subdirectory(pdfwidgets)
+ endif()
+endif()
+qt_examples_build_end()
diff --git a/examples/examples.pro b/examples/examples.pro
index c62d7c04d..4fffce579 100644
--- a/examples/examples.pro
+++ b/examples/examples.pro
@@ -1,25 +1,8 @@
-include($$QTWEBENGINE_OUT_ROOT/src/buildtools/qtbuildtools-config.pri)
-include($$QTWEBENGINE_OUT_ROOT/src/webengine/qtwebengine-config.pri)
-include($$QTWEBENGINE_OUT_ROOT/src/webenginewidgets/qtwebenginewidgets-config.pri)
-include($$QTWEBENGINE_OUT_ROOT/src/pdf/qtpdf-config.pri)
-include($$QTWEBENGINE_OUT_ROOT/src/pdfwidgets/qtpdfwidgets-config.pri)
-
-QT_FOR_CONFIG += \
- buildtools-private \
- webengine-private \
- webenginewidgets-private \
- pdf-private \
- pdfwidgets-private
-
TEMPLATE=subdirs
-qtConfig(build-qtwebengine-core):qtConfig(webengine-core-support) {
- qtConfig(webengine-qml): SUBDIRS += webengine
- qtConfig(webengine-widgets): SUBDIRS += webenginewidgets
-}
+qtHaveModule(webenginequick): SUBDIRS += webenginequick
+qtHaveModule(webenginewidgets): SUBDIRS += webenginewidgets
+qtHaveModule(pdf): SUBDIRS += pdf
+qtHaveModule(pdfwidgets): SUBDIRS += pdfwidgets
-qtConfig(build-qtpdf):qtConfig(webengine-qtpdf-support) {
- SUDIRS += pdf
- qtConfig(pdf-widgets): SUBDIRS += pdfwidgets
-}
diff --git a/examples/pdf/CMakeLists.txt b/examples/pdf/CMakeLists.txt
new file mode 100644
index 000000000..bdc1d0f05
--- /dev/null
+++ b/examples/pdf/CMakeLists.txt
@@ -0,0 +1,8 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+qt_internal_add_example(singlepage)
+qt_internal_add_example(multipage)
+if(NOT TARGET Qt::Svg)
+ message(WARNING "QtSvg is required as runtime dependency for qtpdfquick examples.")
+endif()
diff --git a/examples/pdf/multipage/CMakeLists.txt b/examples/pdf/multipage/CMakeLists.txt
new file mode 100644
index 000000000..8f8111c82
--- /dev/null
+++ b/examples/pdf/multipage/CMakeLists.txt
@@ -0,0 +1,75 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+project(multipage LANGUAGES CXX)
+
+set(CMAKE_AUTOMOC ON)
+
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/pdf/multipage")
+
+find_package(Qt6 REQUIRED COMPONENTS Gui Qml)
+
+qt_add_executable(multipage
+ main.cpp
+ pdfapplication.h
+ pdfapplication.cpp
+)
+
+if (APPLE AND NOT IOS)
+ set(MACOSX_BUNDLE_ICON_FILE multipage.icns)
+ set(app_icon_macos "${CMAKE_CURRENT_SOURCE_DIR}/resources/multipage.icns")
+ set_source_files_properties(${app_icon_macos} PROPERTIES
+ MACOSX_PACKAGE_LOCATION "Resources")
+ target_sources(multipage PRIVATE ${app_icon_macos})
+ set(MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/resources/macos/Info.plist")
+endif()
+
+set_target_properties(multipage PROPERTIES
+ WIN32_EXECUTABLE TRUE
+ MACOSX_BUNDLE TRUE
+)
+
+target_link_libraries(multipage PUBLIC
+ Qt::Gui
+ Qt::Qml
+)
+
+set(viewer_resource_files
+ "resources/document-open.svg"
+ "resources/edit-clear.svg"
+ "resources/edit-copy.svg"
+ "resources/edit-select-all.svg"
+ "resources/go-down-search.svg"
+ "resources/go-next-view-page.svg"
+ "resources/go-previous-view-page.svg"
+ "resources/go-up-search.svg"
+ "resources/rotate-left.svg"
+ "resources/rotate-right.svg"
+ "resources/sidebar-collapse-left.svg"
+ "resources/sidebar-expand-left.svg"
+ "resources/test.pdf"
+ "resources/zoom-fit-best.svg"
+ "resources/zoom-fit-width.svg"
+ "resources/zoom-in.svg"
+ "resources/zoom-original.svg"
+ "resources/zoom-out.svg"
+ "viewer.qml"
+)
+
+qt_add_resources(multipage "viewer"
+ PREFIX
+ "/multipage"
+ FILES
+ ${viewer_resource_files}
+)
+
+install(TARGETS multipage
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/pdf/multipage/doc/src/multipage.qdoc b/examples/pdf/multipage/doc/src/multipage.qdoc
new file mode 100644
index 000000000..7ce4b4a8b
--- /dev/null
+++ b/examples/pdf/multipage/doc/src/multipage.qdoc
@@ -0,0 +1,59 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+ \example multipage
+ \meta installpath pdf
+ \ingroup qtpdf-examples
+ \examplecategory {User Interface Components}
+
+ \title PDF Multipage Viewer Example
+ \brief A Qt Quick PDF viewer that allows scrolling through the pages.
+
+ \image multipageviewer.png
+
+ \e {PDF Multipage Viewer} demonstrates how to use the PdfMultiPageView
+ component to render PDF documents and search for text in them.
+
+ \include examples-run.qdocinc
+
+ \section1 Creating the Main Window
+
+ Instantiate an \l ApplicationWindow, bind its title to the title of the
+ PDF document, and create a toolbar:
+
+ \quotefromfile multipage/viewer.qml
+ \skipto ApplicationWindow
+ \printuntil rightMargin
+
+ The toolbar has buttons for most of the common actions:
+
+ \printuntil ZoomOut
+
+ Declare a PdfDocument and bind the \c status property and
+ \c passwordRequired signal to inform the user when an error occurs or a
+ password is required:
+
+ \skipto onAccepted
+ \skipto Dialog
+ \printto PdfMultiPageView
+
+ Add the main component, PdfMultiPageView:
+
+ \printto onCurrentPageChanged
+ \printto Drawer
+
+ A \l Drawer holds a ListView to show search results from the
+ \l {PdfMultiPageView::searchModel}{searchModel}:
+
+ \printto ToolBar
+
+ Finally, add a second toolbar as a footer, to hold the search field,
+ search up/down buttons and some status information:
+
+ \printuntil
+
+ \section1 Files and Attributions
+
+ \sa {PDF Single Page Viewer Example}
+*/
diff --git a/examples/pdf/multipage/main.cpp b/examples/pdf/multipage/main.cpp
index 35aaa8c64..b9c31c7f8 100644
--- a/examples/pdf/multipage/main.cpp
+++ b/examples/pdf/multipage/main.cpp
@@ -1,54 +1,8 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-#include <QApplication>
+#include "pdfapplication.h"
+#include <QDir>
#include <QQmlApplicationEngine>
int main(int argc, char* argv[])
@@ -56,18 +10,18 @@ int main(int argc, char* argv[])
QCoreApplication::setApplicationName("Qt Quick Multi-page PDF Viewer Example");
QCoreApplication::setOrganizationName("QtProject");
QCoreApplication::setApplicationVersion(QT_VERSION_STR);
- QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
- QApplication app(argc, argv);
+ PdfApplication app(argc, argv);
QQmlApplicationEngine engine;
- engine.load(QUrl(QStringLiteral("qrc:///pdfviewer/viewer.qml")));
+ engine.load(QUrl(QStringLiteral("qrc:///multipage/viewer.qml")));
+ app.setFileOpener(engine.rootObjects().constFirst());
if (app.arguments().count() > 1) {
- QUrl toLoad = QUrl::fromUserInput(app.arguments().at(1));
- engine.rootObjects().first()->setProperty("source", toLoad);
+ // alternatively, use QUrl::fromLocalFile(): network loading is not supported yet
+ QUrl toLoad = QUrl::fromUserInput(app.arguments().at(1), QDir::currentPath(), QUrl::AssumeLocalFile);
+ engine.rootObjects().constFirst()->setProperty("source", toLoad);
} else {
- engine.rootObjects().first()->setProperty("source", QStringLiteral("resources/test.pdf"));
+ engine.rootObjects().constFirst()->setProperty("source", QStringLiteral("resources/test.pdf"));
}
-
return app.exec();
}
diff --git a/examples/pdf/multipage/multipage.pro b/examples/pdf/multipage/multipage.pro
index 5df9e653d..c12651335 100644
--- a/examples/pdf/multipage/multipage.pro
+++ b/examples/pdf/multipage/multipage.pro
@@ -1,8 +1,8 @@
TEMPLATE = app
-QT += qml quick pdf widgets svg
+QT += qml quick pdf svg
-SOURCES += main.cpp
+SOURCES += main.cpp pdfapplication.cpp
RESOURCES += \
viewer.qrc
@@ -12,3 +12,5 @@ EXAMPLE_FILES = \
target.path = $$[QT_INSTALL_EXAMPLES]/pdf/multipage
INSTALLS += target
+macos:QMAKE_INFO_PLIST = resources/macos/Info.plist
+macos:ICON = resources/multipage.icns
diff --git a/examples/pdf/multipage/pdfapplication.cpp b/examples/pdf/multipage/pdfapplication.cpp
new file mode 100644
index 000000000..d8e7c6486
--- /dev/null
+++ b/examples/pdf/multipage/pdfapplication.cpp
@@ -0,0 +1,16 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include "pdfapplication.h"
+#include <QFileOpenEvent>
+
+PdfApplication::PdfApplication(int &argc, char **argv)
+ : QGuiApplication(argc, argv) { }
+
+bool PdfApplication::event(QEvent *e) {
+ if (e->type() == QEvent::FileOpen) {
+ QFileOpenEvent *foEvent = static_cast<QFileOpenEvent *>(e);
+ m_fileOpener->setProperty("source", foEvent->url());
+ }
+ return QGuiApplication::event(e);
+}
diff --git a/examples/pdf/multipage/pdfapplication.h b/examples/pdf/multipage/pdfapplication.h
new file mode 100644
index 000000000..06c998e1c
--- /dev/null
+++ b/examples/pdf/multipage/pdfapplication.h
@@ -0,0 +1,24 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#ifndef PDFAPPLICATION_H
+#define PDFAPPLICATION_H
+
+#include <QGuiApplication>
+#include <QObject>
+
+class PdfApplication : public QGuiApplication
+{
+public:
+ PdfApplication(int &argc, char **argv);
+ void setFileOpener(QObject *opener) {
+ m_fileOpener = opener;
+ }
+
+protected:
+ bool event(QEvent *e) override;
+
+ QObject *m_fileOpener;
+};
+
+#endif // PDFAPPLICATION_H
diff --git a/examples/pdf/multipage/resources/macos/Info.plist b/examples/pdf/multipage/resources/macos/Info.plist
new file mode 100644
index 000000000..512becda0
--- /dev/null
+++ b/examples/pdf/multipage/resources/macos/Info.plist
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
+<plist version="0.1">
+<dict>
+ <key>CFBundleIconFile</key>
+ <string>multipage</string>
+ <key>CFBundleIdentifier</key>
+ <string>org.qt-project.multipage</string>
+ <key>CFBundleDisplayName</key>
+ <string>Multi-page PDF Viewer</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleExecutable</key>
+ <string>multipage</string>
+ <key>CFBundleDocumentTypes</key>
+ <array>
+ <dict>
+ <key>CFBundleTypeRole</key>
+ <string>Viewer</string>
+ <key>CFBundleTypeName</key>
+ <string>pdf</string>
+ <key>LSItemContentTypes</key>
+ <array>
+ <string>com.adobe.pdf</string>
+ </array>
+ </dict>
+ </array>
+</dict>
+</plist>
diff --git a/examples/pdf/multipage/resources/multipage.icns b/examples/pdf/multipage/resources/multipage.icns
new file mode 100644
index 000000000..2e3756903
--- /dev/null
+++ b/examples/pdf/multipage/resources/multipage.icns
Binary files differ
diff --git a/examples/pdf/multipage/resources/sidebar-collapse-left.svg b/examples/pdf/multipage/resources/sidebar-collapse-left.svg
new file mode 100644
index 000000000..06f84afb4
--- /dev/null
+++ b/examples/pdf/multipage/resources/sidebar-collapse-left.svg
@@ -0,0 +1,13 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
+ <style type="text/css" id="current-color-scheme">
+ .ColorScheme-Text {
+ color:#232629;
+ }
+ </style>
+ <g transform="translate(1,1)">
+ <g class="ColorScheme-Text" fill="currentColor">
+ <path d="m3 3v16h16v-16zm5 1h10v14h-10z" stroke-linecap="square" stroke-linejoin="round"/>
+ <path d="m14.646484 6.6464844-4.353515 4.3535156 4.353515 4.353516.707032-.707032-3.646485-3.646484 3.646485-3.6464844z"/>
+ </g>
+ </g>
+</svg>
diff --git a/examples/pdf/multipage/resources/sidebar-expand-left.svg b/examples/pdf/multipage/resources/sidebar-expand-left.svg
new file mode 100644
index 000000000..83b35206e
--- /dev/null
+++ b/examples/pdf/multipage/resources/sidebar-expand-left.svg
@@ -0,0 +1,13 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
+ <style type="text/css" id="current-color-scheme">
+ .ColorScheme-Text {
+ color:#232629;
+ }
+ </style>
+ <g transform="translate(1,1)">
+ <g class="ColorScheme-Text" fill="currentColor">
+ <path d="m3 3v16h16v-16zm5 1h10v14h-10z" stroke-linecap="square" stroke-linejoin="round"/>
+ <path d="m11.353516 6.6464844 4.353515 4.3535156-4.353515 4.353516-.707032-.707032 3.646485-3.646484-3.646485-3.6464844z"/>
+ </g>
+ </g>
+</svg>
diff --git a/examples/pdf/multipage/resources/test.pdf b/examples/pdf/multipage/resources/test.pdf
index a9dc1bc29..0832dfbed 100644
--- a/examples/pdf/multipage/resources/test.pdf
+++ b/examples/pdf/multipage/resources/test.pdf
Binary files differ
diff --git a/examples/pdf/multipage/viewer.qml b/examples/pdf/multipage/viewer.qml
index f66c8d381..55ca2994a 100644
--- a/examples/pdf/multipage/viewer.qml
+++ b/examples/pdf/multipage/viewer.qml
@@ -1,67 +1,17 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-import QtQml 2.14 // workaround for QTBUG-82873
-import QtQuick 2.14
-import QtQuick.Controls 2.14
-import QtQuick.Layouts 1.14
-import QtQuick.Pdf 5.15
-import QtQuick.Shapes 1.14
-import QtQuick.Window 2.14
-import Qt.labs.platform 1.1 as Platform
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
+import QtQuick.Pdf
ApplicationWindow {
id: root
width: 800
height: 1024
color: "lightgrey"
- title: document.title
+ title: doc.title
visible: true
property string source // for main.cpp
@@ -72,7 +22,7 @@ ApplicationWindow {
ToolButton {
action: Action {
shortcut: StandardKey.Open
- icon.source: "resources/document-open.svg"
+ icon.source: "qrc:/multipage/resources/document-open.svg"
onTriggered: fileDialog.open()
}
}
@@ -80,7 +30,7 @@ ApplicationWindow {
action: Action {
shortcut: StandardKey.ZoomIn
enabled: view.renderScale < 10
- icon.source: "resources/zoom-in.svg"
+ icon.source: "qrc:/multipage/resources/zoom-in.svg"
onTriggered: view.renderScale *= Math.sqrt(2)
}
}
@@ -88,47 +38,47 @@ ApplicationWindow {
action: Action {
shortcut: StandardKey.ZoomOut
enabled: view.renderScale > 0.1
- icon.source: "resources/zoom-out.svg"
+ icon.source: "qrc:/multipage/resources/zoom-out.svg"
onTriggered: view.renderScale /= Math.sqrt(2)
}
}
ToolButton {
action: Action {
- icon.source: "resources/zoom-fit-width.svg"
+ icon.source: "qrc:/multipage/resources/zoom-fit-width.svg"
onTriggered: view.scaleToWidth(root.contentItem.width, root.contentItem.height)
}
}
ToolButton {
action: Action {
- icon.source: "resources/zoom-fit-best.svg"
+ icon.source: "qrc:/multipage/resources/zoom-fit-best.svg"
onTriggered: view.scaleToPage(root.contentItem.width, root.contentItem.height)
}
}
ToolButton {
action: Action {
shortcut: "Ctrl+0"
- icon.source: "resources/zoom-original.svg"
+ icon.source: "qrc:/multipage/resources/zoom-original.svg"
onTriggered: view.resetScale()
}
}
ToolButton {
action: Action {
shortcut: "Ctrl+L"
- icon.source: "resources/rotate-left.svg"
+ icon.source: "qrc:/multipage/resources/rotate-left.svg"
onTriggered: view.pageRotation -= 90
}
}
ToolButton {
action: Action {
shortcut: "Ctrl+R"
- icon.source: "resources/rotate-right.svg"
+ icon.source: "qrc:/multipage/resources/rotate-right.svg"
onTriggered: view.pageRotation += 90
}
}
ToolButton {
action: Action {
- icon.source: "resources/go-previous-view-page.svg"
- enabled: view.backEnbled
+ icon.source: "qrc:/multipage/resources/go-previous-view-page.svg"
+ enabled: view.backEnabled
onTriggered: view.back()
}
ToolTip.visible: enabled && hovered
@@ -138,7 +88,7 @@ ApplicationWindow {
SpinBox {
id: currentPageSB
from: 1
- to: document.pageCount
+ to: doc.pageCount
editable: true
onValueModified: view.goToPage(value - 1)
Shortcut {
@@ -152,7 +102,7 @@ ApplicationWindow {
}
ToolButton {
action: Action {
- icon.source: "resources/go-next-view-page.svg"
+ icon.source: "qrc:/multipage/resources/go-next-view-page.svg"
enabled: view.forwardEnabled
onTriggered: view.forward()
}
@@ -163,21 +113,24 @@ ApplicationWindow {
ToolButton {
action: Action {
shortcut: StandardKey.SelectAll
- icon.source: "resources/edit-select-all.svg"
+ icon.source: "qrc:/multipage/resources/edit-select-all.svg"
onTriggered: view.selectAll()
}
}
ToolButton {
action: Action {
shortcut: StandardKey.Copy
- icon.source: "resources/edit-copy.svg"
+ icon.source: "qrc:/multipage/resources/edit-copy.svg"
enabled: view.selectedText !== ""
onTriggered: view.copySelectionToClipboard()
}
}
Shortcut {
sequence: StandardKey.Find
- onActivated: searchField.forceActiveFocus()
+ onActivated: {
+ searchField.forceActiveFocus()
+ searchField.selectAll()
+ }
}
Shortcut {
sequence: StandardKey.Quit
@@ -186,11 +139,11 @@ ApplicationWindow {
}
}
- Platform.FileDialog {
+ FileDialog {
id: fileDialog
title: "Open a PDF file"
nameFilters: [ "PDF files (*.pdf)" ]
- onAccepted: document.source = file
+ onAccepted: doc.source = selectedFile
}
Dialog {
@@ -202,55 +155,63 @@ ApplicationWindow {
anchors.centerIn: parent
width: 300
- TextField {
+ contentItem: TextField {
id: passwordField
placeholderText: qsTr("Please provide the password")
echoMode: TextInput.Password
width: parent.width
onAccepted: passwordDialog.accept()
}
- onAccepted: document.password = passwordField.text
+ onOpened: passwordField.forceActiveFocus()
+ onAccepted: doc.password = passwordField.text
}
Dialog {
id: errorDialog
- title: "Error loading " + document.source
- standardButtons: Dialog.Ok
+ title: "Error loading " + doc.source
+ standardButtons: Dialog.Close
modal: true
closePolicy: Popup.CloseOnEscape
anchors.centerIn: parent
width: 300
+ visible: doc.status === PdfDocument.Error
- Label {
+ contentItem: Label {
id: errorField
- text: document.error
+ text: doc.error
}
}
PdfDocument {
- id: document
+ id: doc
source: Qt.resolvedUrl(root.source)
- onStatusChanged: {
- if (status === PdfDocument.Error) errorDialog.open()
- view.document = (status === PdfDocument.Ready ? document : undefined)
- }
- onPasswordRequired: {
- passwordDialog.open()
- passwordField.forceActiveFocus()
- }
+ onPasswordRequired: passwordDialog.open()
}
PdfMultiPageView {
id: view
anchors.fill: parent
- anchors.leftMargin: searchDrawer.position * searchDrawer.width
- document: root.document
+ anchors.leftMargin: sidebar.position * sidebar.width
+ document: doc
searchString: searchField.text
onCurrentPageChanged: currentPageSB.value = view.currentPage + 1
}
+ DropArea {
+ anchors.fill: parent
+ keys: ["text/uri-list"]
+ onEntered: (drag) => {
+ drag.accepted = (drag.proposedAction === Qt.MoveAction || drag.proposedAction === Qt.CopyAction) &&
+ drag.hasUrls && drag.urls[0].endsWith("pdf")
+ }
+ onDropped: (drop) => {
+ doc.source = drop.urls[0]
+ drop.acceptProposedAction()
+ }
+ }
+
Drawer {
- id: searchDrawer
+ id: sidebar
edge: Qt.LeftEdge
modal: false
width: 300
@@ -258,58 +219,189 @@ ApplicationWindow {
height: view.height
dim: false
clip: true
- ListView {
- id: searchResultsList
+
+ TabBar {
+ id: sidebarTabs
+ x: -width
+ rotation: -90
+ transformOrigin: Item.TopRight
+ currentIndex: 2 // bookmarks by default
+ TabButton {
+ text: qsTr("Info")
+ }
+ TabButton {
+ text: qsTr("Search Results")
+ }
+ TabButton {
+ text: qsTr("Bookmarks")
+ }
+ TabButton {
+ text: qsTr("Pages")
+ }
+ }
+
+ GroupBox {
anchors.fill: parent
- anchors.margins: 2
- model: view.searchModel
- ScrollBar.vertical: ScrollBar { }
- delegate: ItemDelegate {
- width: parent ? parent.width : 0
- RowLayout {
- anchors.fill: parent
- spacing: 0
- Label {
- text: "Page " + (page + 1) + ": "
- }
- Label {
- text: contextBefore
- elide: Text.ElideLeft
- horizontalAlignment: Text.AlignRight
- Layout.fillWidth: true
- Layout.preferredWidth: parent.width / 2
+ anchors.leftMargin: sidebarTabs.height
+
+ StackLayout {
+ anchors.fill: parent
+ currentIndex: sidebarTabs.currentIndex
+ component InfoField: TextInput {
+ width: parent.width
+ selectByMouse: true
+ readOnly: true
+ wrapMode: Text.WordWrap
+ }
+ Column {
+ spacing: 6
+ width: parent.width - 6
+ Label { font.bold: true; text: qsTr("Title") }
+ InfoField { text: doc.title }
+ Label { font.bold: true; text: qsTr("Author") }
+ InfoField { text: doc.author }
+ Label { font.bold: true; text: qsTr("Subject") }
+ InfoField { text: doc.subject }
+ Label { font.bold: true; text: qsTr("Keywords") }
+ InfoField { text: doc.keywords }
+ Label { font.bold: true; text: qsTr("Producer") }
+ InfoField { text: doc.producer }
+ Label { font.bold: true; text: qsTr("Creator") }
+ InfoField { text: doc.creator }
+ Label { font.bold: true; text: qsTr("Creation date") }
+ InfoField { text: doc.creationDate }
+ Label { font.bold: true; text: qsTr("Modification date") }
+ InfoField { text: doc.modificationDate }
+ }
+ ListView {
+ id: searchResultsList
+ implicitHeight: parent.height
+ model: view.searchModel
+ currentIndex: view.searchModel.currentResult
+ ScrollBar.vertical: ScrollBar { }
+ delegate: ItemDelegate {
+ id: resultDelegate
+ required property int index
+ required property int page
+ required property string contextBefore
+ required property string contextAfter
+ width: parent ? parent.width : 0
+ RowLayout {
+ anchors.fill: parent
+ spacing: 0
+ Label {
+ text: "Page " + (resultDelegate.page + 1) + ": "
+ }
+ Label {
+ text: resultDelegate.contextBefore
+ elide: Text.ElideLeft
+ horizontalAlignment: Text.AlignRight
+ Layout.fillWidth: true
+ Layout.preferredWidth: parent.width / 2
+ }
+ Label {
+ font.bold: true
+ text: view.searchString
+ width: implicitWidth
+ }
+ Label {
+ text: resultDelegate.contextAfter
+ elide: Text.ElideRight
+ Layout.fillWidth: true
+ Layout.preferredWidth: parent.width / 2
+ }
+ }
+ highlighted: ListView.isCurrentItem
+ onClicked: view.searchModel.currentResult = resultDelegate.index
}
- Label {
- font.bold: true
- text: view.searchString
- width: implicitWidth
+ }
+ TreeView {
+ id: bookmarksTree
+ implicitHeight: parent.height
+ implicitWidth: parent.width
+ columnWidthProvider: function() { return width }
+ delegate: TreeViewDelegate {
+ required property int page
+ required property point location
+ required property real zoom
+ onClicked: view.goToLocation(page, location, zoom)
}
- Label {
- text: contextAfter
- elide: Text.ElideRight
- Layout.fillWidth: true
- Layout.preferredWidth: parent.width / 2
+ model: PdfBookmarkModel {
+ document: doc
}
+ ScrollBar.vertical: ScrollBar { }
}
- highlighted: ListView.isCurrentItem
- onClicked: {
- searchResultsList.currentIndex = index
- view.goToLocation(page, location, 0)
- view.searchModel.currentResult = indexOnPage
+ GridView {
+ id: thumbnailsView
+ implicitWidth: parent.width
+ implicitHeight: parent.height
+ model: doc.pageModel
+ cellWidth: width / 2
+ cellHeight: cellWidth + 10
+ delegate: Item {
+ required property int index
+ required property string label
+ required property size pointSize
+ width: thumbnailsView.cellWidth
+ height: thumbnailsView.cellHeight
+ Rectangle {
+ id: paper
+ width: image.width
+ height: image.height
+ x: (parent.width - width) / 2
+ y: (parent.height - height - pageNumber.height) / 2
+ PdfPageImage {
+ id: image
+ document: doc
+ currentFrame: index
+ asynchronous: true
+ fillMode: Image.PreserveAspectFit
+ property bool landscape: pointSize.width > pointSize.height
+ width: landscape ? thumbnailsView.cellWidth - 6
+ : height * pointSize.width / pointSize.height
+ height: landscape ? width * pointSize.height / pointSize.width
+ : thumbnailsView.cellHeight - 14
+ sourceSize.width: width
+ sourceSize.height: height
+ }
+ }
+ Text {
+ id: pageNumber
+ anchors.bottom: parent.bottom
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: label
+ }
+ TapHandler {
+ onTapped: view.goToPage(index)
+ }
+ }
}
}
}
}
footer: ToolBar {
- height: footerRow.implicitHeight
+ height: footerRow.implicitHeight + 6
RowLayout {
id: footerRow
anchors.fill: parent
ToolButton {
action: Action {
- icon.source: "resources/go-up-search.svg"
+ id: sidebarOpenAction
+ checkable: true
+ checked: sidebar.opened
+ icon.source: checked ? "qrc:/multipage/resources/sidebar-collapse-left.svg" : "qrc:/multipage/resources/sidebar-expand-left.svg"
+ onTriggered: sidebar.open()
+ }
+ ToolTip.visible: enabled && hovered
+ ToolTip.delay: 2000
+ ToolTip.text: "open sidebar"
+ }
+ ToolButton {
+ action: Action {
+ icon.source: "qrc:/multipage/resources/go-up-search.svg"
shortcut: StandardKey.FindPrevious
+ enabled: view.searchModel.count > 0
onTriggered: view.searchBack()
}
ToolTip.visible: enabled && hovered
@@ -321,16 +413,19 @@ ApplicationWindow {
placeholderText: "search"
Layout.minimumWidth: 150
Layout.fillWidth: true
- onAccepted: searchDrawer.open()
+ Layout.bottomMargin: 3
+ onAccepted: {
+ sidebar.open()
+ sidebarTabs.setCurrentIndex(1)
+ }
Image {
visible: searchField.text !== ""
- source: "resources/edit-clear.svg"
+ source: "qrc:/multipage/resources/edit-clear.svg"
+ sourceSize.height: searchField.height - 6
anchors {
right: parent.right
- top: parent.top
- bottom: parent.bottom
+ verticalCenter: parent.verticalCenter
margins: 3
- rightMargin: 5
}
TapHandler {
onTapped: searchField.clear()
@@ -339,8 +434,9 @@ ApplicationWindow {
}
ToolButton {
action: Action {
- icon.source: "resources/go-down-search.svg"
+ icon.source: "qrc:/multipage/resources/go-down-search.svg"
shortcut: StandardKey.FindNext
+ enabled: view.searchModel.count > 0
onTriggered: view.searchForward()
}
ToolTip.visible: enabled && hovered
@@ -349,11 +445,11 @@ ApplicationWindow {
}
Label {
id: statusLabel
- property size implicitPointSize: document.pagePointSize(view.currentPage)
- text: "page " + (currentPageSB.value) + " of " + document.pageCount +
+ property size implicitPointSize: doc.pagePointSize(view.currentPage)
+ text: "page " + (currentPageSB.value) + " of " + doc.pageCount +
" scale " + view.renderScale.toFixed(2) +
" original " + implicitPointSize.width.toFixed(1) + "x" + implicitPointSize.height.toFixed(1) + " pt"
- visible: document.pageCount > 0
+ visible: doc.pageCount > 0
}
}
}
diff --git a/examples/pdf/multipage/viewer.qrc b/examples/pdf/multipage/viewer.qrc
index ffca51679..e786ae4ce 100644
--- a/examples/pdf/multipage/viewer.qrc
+++ b/examples/pdf/multipage/viewer.qrc
@@ -1,5 +1,5 @@
<RCC>
- <qresource prefix="/pdfviewer">
+ <qresource prefix="/singlepage">
<file>viewer.qml</file>
<file>resources/document-open.svg</file>
<file>resources/edit-clear.svg</file>
@@ -11,6 +11,8 @@
<file>resources/go-up-search.svg</file>
<file>resources/rotate-left.svg</file>
<file>resources/rotate-right.svg</file>
+ <file>resources/sidebar-collapse-left.svg</file>
+ <file>resources/sidebar-expand-left.svg</file>
<file>resources/test.pdf</file>
<file>resources/zoom-in.svg</file>
<file>resources/zoom-fit-best.svg</file>
diff --git a/examples/pdf/pdf.pro b/examples/pdf/pdf.pro
index 7130f3560..96ead5948 100644
--- a/examples/pdf/pdf.pro
+++ b/examples/pdf/pdf.pro
@@ -1,3 +1,3 @@
TEMPLATE=subdirs
-SUBDIRS += pdfviewer multipage
+qtHaveModule(svg): SUBDIRS += singlepage multipage
diff --git a/examples/pdf/pdfviewer/main.cpp b/examples/pdf/pdfviewer/main.cpp
deleted file mode 100644
index 5f65e3061..000000000
--- a/examples/pdf/pdfviewer/main.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QApplication>
-#include <QQmlApplicationEngine>
-
-int main(int argc, char* argv[])
-{
- QCoreApplication::setApplicationName("Qt Quick PDF Viewer Example");
- QCoreApplication::setOrganizationName("QtProject");
- QCoreApplication::setApplicationVersion(QT_VERSION_STR);
- QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
- QApplication app(argc, argv);
-
- QQmlApplicationEngine engine;
- engine.load(QUrl(QStringLiteral("qrc:///pdfviewer/viewer.qml")));
- if (app.arguments().count() > 1) {
- QUrl toLoad = QUrl::fromUserInput(app.arguments().at(1));
- engine.rootObjects().first()->setProperty("source", toLoad);
- } else {
- engine.rootObjects().first()->setProperty("source", QStringLiteral("resources/test.pdf"));
- }
-
- return app.exec();
-}
diff --git a/examples/pdf/pdfviewer/pdfviewer.pro b/examples/pdf/pdfviewer/pdfviewer.pro
deleted file mode 100644
index b8817c9be..000000000
--- a/examples/pdf/pdfviewer/pdfviewer.pro
+++ /dev/null
@@ -1,14 +0,0 @@
-TEMPLATE = app
-
-QT += qml quick pdf widgets svg
-
-SOURCES += main.cpp
-
-RESOURCES += \
- viewer.qrc
-EXAMPLE_FILES = \
- viewer.qml
-
-target.path = $$[QT_INSTALL_EXAMPLES]/pdf/pdfviewer
-INSTALLS += target
-
diff --git a/examples/pdf/pdfviewer/resources/test.pdf b/examples/pdf/pdfviewer/resources/test.pdf
deleted file mode 100644
index a9dc1bc29..000000000
--- a/examples/pdf/pdfviewer/resources/test.pdf
+++ /dev/null
Binary files differ
diff --git a/examples/pdf/pdfviewer/viewer.qml b/examples/pdf/pdfviewer/viewer.qml
deleted file mode 100644
index 38d62740a..000000000
--- a/examples/pdf/pdfviewer/viewer.qml
+++ /dev/null
@@ -1,335 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-import QtQml 2.14 // workaround for QTBUG-82873
-import QtQuick 2.14
-import QtQuick.Controls 2.14
-import QtQuick.Layouts 1.14
-import QtQuick.Pdf 5.15
-import QtQuick.Shapes 1.14
-import QtQuick.Window 2.14
-import Qt.labs.animation 1.0
-import Qt.labs.platform 1.1 as Platform
-
-ApplicationWindow {
- id: root
- width: 800
- height: 1024
- color: "lightgrey"
- title: document.title
- visible: true
- property string source // for main.cpp
- property real scaleStep: Math.sqrt(2)
-
- header: ToolBar {
- RowLayout {
- anchors.fill: parent
- anchors.rightMargin: 6
- ToolButton {
- action: Action {
- shortcut: StandardKey.Open
- icon.source: "resources/document-open.svg"
- onTriggered: fileDialog.open()
- }
- }
- ToolButton {
- action: Action {
- shortcut: StandardKey.ZoomIn
- enabled: view.sourceSize.width < 10000
- icon.source: "resources/zoom-in.svg"
- onTriggered: view.renderScale *= root.scaleStep
- }
- }
- ToolButton {
- action: Action {
- shortcut: StandardKey.ZoomOut
- enabled: view.sourceSize.width > 50
- icon.source: "resources/zoom-out.svg"
- onTriggered: view.renderScale /= root.scaleStep
- }
- }
- ToolButton {
- action: Action {
- icon.source: "resources/zoom-fit-width.svg"
- onTriggered: view.scaleToWidth(root.contentItem.width, root.contentItem.height)
- }
- }
- ToolButton {
- action: Action {
- icon.source: "resources/zoom-fit-best.svg"
- onTriggered: view.scaleToPage(root.contentItem.width, root.contentItem.height)
- }
- }
- ToolButton {
- action: Action {
- shortcut: "Ctrl+0"
- icon.source: "resources/zoom-original.svg"
- onTriggered: view.resetScale()
- }
- }
- ToolButton {
- action: Action {
- shortcut: "Ctrl+L"
- icon.source: "resources/rotate-left.svg"
- onTriggered: view.pageRotation -= 90
- }
- }
- ToolButton {
- action: Action {
- shortcut: "Ctrl+R"
- icon.source: "resources/rotate-right.svg"
- onTriggered: view.pageRotation += 90
- }
- }
- ToolButton {
- action: Action {
- icon.source: "resources/go-previous-view-page.svg"
- enabled: view.backEnabled
- onTriggered: view.back()
- }
- ToolTip.visible: enabled && hovered
- ToolTip.delay: 2000
- ToolTip.text: "go back"
- }
- SpinBox {
- id: currentPageSB
- from: 1
- to: document.pageCount
- editable: true
- value: view.currentPage + 1
- onValueModified: view.goToPage(value - 1)
- Shortcut {
- sequence: StandardKey.MoveToPreviousPage
- onActivated: view.goToPage(currentPageSB.value - 2)
- }
- Shortcut {
- sequence: StandardKey.MoveToNextPage
- onActivated: view.goToPage(currentPageSB.value)
- }
- }
- ToolButton {
- action: Action {
- icon.source: "resources/go-next-view-page.svg"
- enabled: view.forwardEnabled
- onTriggered: view.forward()
- }
- ToolTip.visible: enabled && hovered
- ToolTip.delay: 2000
- ToolTip.text: "go forward"
- }
- ToolButton {
- action: Action {
- shortcut: StandardKey.SelectAll
- icon.source: "resources/edit-select-all.svg"
- onTriggered: view.selectAll()
- }
- }
- ToolButton {
- action: Action {
- shortcut: StandardKey.Copy
- icon.source: "resources/edit-copy.svg"
- enabled: view.selectedText !== ""
- onTriggered: view.copySelectionToClipboard()
- }
- }
- Shortcut {
- sequence: StandardKey.Find
- onActivated: searchField.forceActiveFocus()
- }
- Shortcut {
- sequence: StandardKey.Quit
- onActivated: Qt.quit()
- }
- }
- }
-
- Platform.FileDialog {
- id: fileDialog
- title: "Open a PDF file"
- nameFilters: [ "PDF files (*.pdf)" ]
- onAccepted: document.source = file
- }
-
- Dialog {
- id: errorDialog
- title: "Error loading " + document.source
- standardButtons: Dialog.Ok
- modal: true
- closePolicy: Popup.CloseOnEscape
- anchors.centerIn: parent
- width: 300
-
- Label {
- id: errorField
- text: document.error
- }
- }
-
- PdfScrollablePageView {
- id: view
- anchors.fill: parent
- anchors.leftMargin: searchDrawer.position * searchDrawer.width
- document: PdfDocument {
- id: document
- source: Qt.resolvedUrl(root.source)
- onStatusChanged: if (status === PdfDocument.Error) errorDialog.open()
- }
- searchString: searchField.text
- }
-
- Drawer {
- id: searchDrawer
- edge: Qt.LeftEdge
-// modal: false
-// dim: false // commented out as workaround for QTBUG-83859
- width: 300
- y: root.header.height
- height: view.height
- clip: true
- ListView {
- id: searchResultsList
- anchors.fill: parent
- anchors.margins: 2
- model: view.searchModel
- ScrollBar.vertical: ScrollBar { }
- delegate: ItemDelegate {
- width: parent ? parent.width : 0
- RowLayout {
- anchors.fill: parent
- spacing: 0
- Label {
- text: "Page " + (page + 1) + ": "
- }
- Label {
- text: contextBefore
- elide: Text.ElideLeft
- horizontalAlignment: Text.AlignRight
- Layout.fillWidth: true
- Layout.preferredWidth: parent.width / 2
- }
- Label {
- font.bold: true
- text: view.searchString
- width: implicitWidth
- }
- Label {
- text: contextAfter
- elide: Text.ElideRight
- Layout.fillWidth: true
- Layout.preferredWidth: parent.width / 2
- }
- }
- highlighted: ListView.isCurrentItem
- onClicked: {
- searchResultsList.currentIndex = index
- view.goToLocation(page, location, 0)
- view.searchModel.currentResult = indexOnPage
- }
- }
- }
- }
-
- footer: ToolBar {
- height: footerRow.implicitHeight
- RowLayout {
- id: footerRow
- anchors.fill: parent
- ToolButton {
- action: Action {
- icon.source: "resources/go-up-search.svg"
- shortcut: StandardKey.FindPrevious
- onTriggered: view.searchBack()
- }
- ToolTip.visible: enabled && hovered
- ToolTip.delay: 2000
- ToolTip.text: "find previous"
- }
- TextField {
- id: searchField
- placeholderText: "search"
- Layout.minimumWidth: 150
- Layout.maximumWidth: 300
- Layout.fillWidth: true
- onAccepted: searchDrawer.open()
- Image {
- visible: searchField.text !== ""
- source: "resources/edit-clear.svg"
- anchors {
- right: parent.right
- top: parent.top
- bottom: parent.bottom
- margins: 3
- rightMargin: 5
- }
- TapHandler {
- onTapped: searchField.clear()
- }
- }
- }
- ToolButton {
- action: Action {
- icon.source: "resources/go-down-search.svg"
- shortcut: StandardKey.FindNext
- onTriggered: view.searchForward()
- }
- ToolTip.visible: enabled && hovered
- ToolTip.delay: 2000
- ToolTip.text: "find next"
- }
- Label {
- Layout.fillWidth: true
- property size implicitPointSize: document.pagePointSize(view.currentPage)
- text: "page " + (view.currentPage + 1) + " of " + document.pageCount +
- " scale " + view.renderScale.toFixed(2) +
- " original " + implicitPointSize.width.toFixed(1) + "x" + implicitPointSize.height.toFixed(1) + "pts"
- visible: document.status === PdfDocument.Ready
- }
- }
- }
-}
diff --git a/examples/pdf/pdfviewer/viewer.qrc b/examples/pdf/pdfviewer/viewer.qrc
deleted file mode 100644
index ffca51679..000000000
--- a/examples/pdf/pdfviewer/viewer.qrc
+++ /dev/null
@@ -1,21 +0,0 @@
-<RCC>
- <qresource prefix="/pdfviewer">
- <file>viewer.qml</file>
- <file>resources/document-open.svg</file>
- <file>resources/edit-clear.svg</file>
- <file>resources/edit-copy.svg</file>
- <file>resources/edit-select-all.svg</file>
- <file>resources/go-down-search.svg</file>
- <file>resources/go-next-view-page.svg</file>
- <file>resources/go-previous-view-page.svg</file>
- <file>resources/go-up-search.svg</file>
- <file>resources/rotate-left.svg</file>
- <file>resources/rotate-right.svg</file>
- <file>resources/test.pdf</file>
- <file>resources/zoom-in.svg</file>
- <file>resources/zoom-fit-best.svg</file>
- <file>resources/zoom-fit-width.svg</file>
- <file>resources/zoom-original.svg</file>
- <file>resources/zoom-out.svg</file>
- </qresource>
-</RCC>
diff --git a/examples/pdf/singlepage/CMakeLists.txt b/examples/pdf/singlepage/CMakeLists.txt
new file mode 100644
index 000000000..fac95f54a
--- /dev/null
+++ b/examples/pdf/singlepage/CMakeLists.txt
@@ -0,0 +1,62 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+project(singlepage LANGUAGES CXX)
+
+set(CMAKE_AUTOMOC ON)
+
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/pdf/singlepage")
+
+find_package(Qt6 REQUIRED COMPONENTS Gui Qml)
+
+qt_add_executable(pdfviewerquick
+ main.cpp
+)
+
+set_target_properties(pdfviewerquick PROPERTIES
+ WIN32_EXECUTABLE TRUE
+ MACOSX_BUNDLE TRUE
+)
+
+target_link_libraries(pdfviewerquick PUBLIC
+ Qt::Gui
+ Qt::Qml
+)
+
+set(viewer_resource_files
+ "resources/document-open.svg"
+ "resources/edit-clear.svg"
+ "resources/edit-copy.svg"
+ "resources/edit-select-all.svg"
+ "resources/go-down-search.svg"
+ "resources/go-next-view-page.svg"
+ "resources/go-previous-view-page.svg"
+ "resources/go-up-search.svg"
+ "resources/rotate-left.svg"
+ "resources/rotate-right.svg"
+ "resources/test.pdf"
+ "resources/zoom-fit-best.svg"
+ "resources/zoom-fit-width.svg"
+ "resources/zoom-in.svg"
+ "resources/zoom-original.svg"
+ "resources/zoom-out.svg"
+ "viewer.qml"
+)
+
+qt_add_resources(pdfviewerquick "viewer"
+ PREFIX
+ "/singlepage"
+ FILES
+ ${viewer_resource_files}
+)
+
+install(TARGETS pdfviewerquick
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/pdf/singlepage/doc/src/singlepage.qdoc b/examples/pdf/singlepage/doc/src/singlepage.qdoc
new file mode 100644
index 000000000..773f9acae
--- /dev/null
+++ b/examples/pdf/singlepage/doc/src/singlepage.qdoc
@@ -0,0 +1,62 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+ \example singlepage
+ \meta installpath pdf
+ \ingroup qtpdf-examples
+ \examplecategory {User Interface Components}
+
+ \title PDF Single Page Viewer Example
+ \brief A Qt Quick PDF viewer that views one page at a time.
+
+ \image singlepageviewer.webp
+
+ \e {PDF Single Page Viewer Example} demonstrates how to use the PdfScrollablePageView
+ component to render PDF documents and search for text in them.
+
+ \include examples-run.qdocinc
+
+ \section1 Creating the Main Window
+
+ Instantiate an \l ApplicationWindow, bind its title to the title of the
+ PDF document, and create a toolbar:
+
+ \quotefromfile singlepage/viewer.qml
+ \skipto ApplicationWindow
+ \printuntil rightMargin
+
+ The toolbar has buttons for most of the common actions,
+ plus a SpinBox to show and control the current page number:
+
+ \printuntil ZoomOut
+ \dots
+ \skipto SpinBox
+ \printto onValueModified
+ \dots
+
+ Add dialogs to inform the user when an error occurs and to prompt for a
+ password if required:
+
+ \skipto onAccepted
+ \skipto Dialog
+ \printto PdfScrollablePageView
+
+ Add the main component, PdfScrollablePageView:
+
+ \printto Drawer {
+
+ A \l Drawer holds a ListView to show search results from the
+ \l {PdfScrollablePageView::searchModel}{searchModel}:
+
+ \printto ToolBar
+
+ Finally, add a second toolbar as a footer, to hold the search field,
+ search up/down buttons and some status information:
+
+ \printuntil
+
+ \section1 Files and Attributions
+
+ \sa {PDF Multipage Viewer Example}
+*/
diff --git a/examples/pdf/singlepage/main.cpp b/examples/pdf/singlepage/main.cpp
new file mode 100644
index 000000000..be5c8f73c
--- /dev/null
+++ b/examples/pdf/singlepage/main.cpp
@@ -0,0 +1,37 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include <QQmlApplicationEngine>
+
+#include <QGuiApplication>
+
+#include <QCommandLineParser>
+#include <QCommandLineOption>
+
+int main(int argc, char* argv[])
+{
+ QCoreApplication::setApplicationName("Qt Quick PDF Viewer Example");
+ QCoreApplication::setOrganizationName("QtProject");
+ QCoreApplication::setApplicationVersion(QT_VERSION_STR);
+ QGuiApplication app(argc, argv);
+
+ QCommandLineParser parser;
+ parser.addHelpOption();
+ parser.addVersionOption();
+ parser.addPositionalArgument("file", "The file to open.");
+ parser.process(app);
+
+ QQmlApplicationEngine engine;
+
+ QUrl toLoad = QUrl("qrc:/singlepage/resources/test.pdf");
+ if (!parser.positionalArguments().isEmpty())
+ toLoad = QUrl::fromLocalFile(parser.positionalArguments().constFirst());
+
+ engine.setInitialProperties({{"source", toLoad}});
+
+ engine.load(QUrl(QStringLiteral("qrc:///singlepage/viewer.qml")));
+ if (engine.rootObjects().isEmpty())
+ return -1;
+
+ return app.exec();
+}
diff --git a/examples/pdf/pdfviewer/resources/document-open.svg b/examples/pdf/singlepage/resources/document-open.svg
index bf23123a3..bf23123a3 100644
--- a/examples/pdf/pdfviewer/resources/document-open.svg
+++ b/examples/pdf/singlepage/resources/document-open.svg
diff --git a/examples/pdf/pdfviewer/resources/edit-clear.svg b/examples/pdf/singlepage/resources/edit-clear.svg
index 1c35aaf04..1c35aaf04 100644
--- a/examples/pdf/pdfviewer/resources/edit-clear.svg
+++ b/examples/pdf/singlepage/resources/edit-clear.svg
diff --git a/examples/pdf/pdfviewer/resources/edit-copy.svg b/examples/pdf/singlepage/resources/edit-copy.svg
index 9dd16877d..9dd16877d 100644
--- a/examples/pdf/pdfviewer/resources/edit-copy.svg
+++ b/examples/pdf/singlepage/resources/edit-copy.svg
diff --git a/examples/pdf/pdfviewer/resources/edit-select-all.svg b/examples/pdf/singlepage/resources/edit-select-all.svg
index 5f21950a0..5f21950a0 100644
--- a/examples/pdf/pdfviewer/resources/edit-select-all.svg
+++ b/examples/pdf/singlepage/resources/edit-select-all.svg
diff --git a/examples/pdf/pdfviewer/resources/go-down-search.svg b/examples/pdf/singlepage/resources/go-down-search.svg
index ae17ab93b..ae17ab93b 100644
--- a/examples/pdf/pdfviewer/resources/go-down-search.svg
+++ b/examples/pdf/singlepage/resources/go-down-search.svg
diff --git a/examples/pdf/pdfviewer/resources/go-next-view-page.svg b/examples/pdf/singlepage/resources/go-next-view-page.svg
index e453ddbec..e453ddbec 100644
--- a/examples/pdf/pdfviewer/resources/go-next-view-page.svg
+++ b/examples/pdf/singlepage/resources/go-next-view-page.svg
diff --git a/examples/pdf/pdfviewer/resources/go-previous-view-page.svg b/examples/pdf/singlepage/resources/go-previous-view-page.svg
index b032309e9..b032309e9 100644
--- a/examples/pdf/pdfviewer/resources/go-previous-view-page.svg
+++ b/examples/pdf/singlepage/resources/go-previous-view-page.svg
diff --git a/examples/pdf/pdfviewer/resources/go-up-search.svg b/examples/pdf/singlepage/resources/go-up-search.svg
index 5cc155873..5cc155873 100644
--- a/examples/pdf/pdfviewer/resources/go-up-search.svg
+++ b/examples/pdf/singlepage/resources/go-up-search.svg
diff --git a/examples/pdf/pdfviewer/resources/rotate-left.svg b/examples/pdf/singlepage/resources/rotate-left.svg
index 90ce53c9d..90ce53c9d 100644
--- a/examples/pdf/pdfviewer/resources/rotate-left.svg
+++ b/examples/pdf/singlepage/resources/rotate-left.svg
diff --git a/examples/pdf/pdfviewer/resources/rotate-right.svg b/examples/pdf/singlepage/resources/rotate-right.svg
index 7383d1c84..7383d1c84 100644
--- a/examples/pdf/pdfviewer/resources/rotate-right.svg
+++ b/examples/pdf/singlepage/resources/rotate-right.svg
diff --git a/examples/pdf/singlepage/resources/test.pdf b/examples/pdf/singlepage/resources/test.pdf
new file mode 100644
index 000000000..0832dfbed
--- /dev/null
+++ b/examples/pdf/singlepage/resources/test.pdf
Binary files differ
diff --git a/examples/pdf/pdfviewer/resources/zoom-fit-best.svg b/examples/pdf/singlepage/resources/zoom-fit-best.svg
index adf302621..adf302621 100644
--- a/examples/pdf/pdfviewer/resources/zoom-fit-best.svg
+++ b/examples/pdf/singlepage/resources/zoom-fit-best.svg
diff --git a/examples/pdf/pdfviewer/resources/zoom-fit-width.svg b/examples/pdf/singlepage/resources/zoom-fit-width.svg
index 985ee5205..985ee5205 100644
--- a/examples/pdf/pdfviewer/resources/zoom-fit-width.svg
+++ b/examples/pdf/singlepage/resources/zoom-fit-width.svg
diff --git a/examples/pdf/pdfviewer/resources/zoom-in.svg b/examples/pdf/singlepage/resources/zoom-in.svg
index efdc9f17d..efdc9f17d 100644
--- a/examples/pdf/pdfviewer/resources/zoom-in.svg
+++ b/examples/pdf/singlepage/resources/zoom-in.svg
diff --git a/examples/pdf/pdfviewer/resources/zoom-original.svg b/examples/pdf/singlepage/resources/zoom-original.svg
index 1b4080a03..1b4080a03 100644
--- a/examples/pdf/pdfviewer/resources/zoom-original.svg
+++ b/examples/pdf/singlepage/resources/zoom-original.svg
diff --git a/examples/pdf/pdfviewer/resources/zoom-out.svg b/examples/pdf/singlepage/resources/zoom-out.svg
index fcde9e526..fcde9e526 100644
--- a/examples/pdf/pdfviewer/resources/zoom-out.svg
+++ b/examples/pdf/singlepage/resources/zoom-out.svg
diff --git a/examples/pdf/singlepage/singlepage.pro b/examples/pdf/singlepage/singlepage.pro
new file mode 100644
index 000000000..3b9f6399d
--- /dev/null
+++ b/examples/pdf/singlepage/singlepage.pro
@@ -0,0 +1,14 @@
+TEMPLATE = app
+
+QT += qml quick pdf svg
+
+SOURCES += main.cpp
+
+RESOURCES += \
+ viewer.qrc
+EXAMPLE_FILES = \
+ viewer.qml
+
+target.path = $$[QT_INSTALL_EXAMPLES]/pdf/singlepage
+INSTALLS += target
+
diff --git a/examples/pdf/singlepage/viewer.qml b/examples/pdf/singlepage/viewer.qml
new file mode 100644
index 000000000..9b6668a3a
--- /dev/null
+++ b/examples/pdf/singlepage/viewer.qml
@@ -0,0 +1,312 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
+import QtQuick.Pdf
+
+ApplicationWindow {
+ id: root
+ width: 800
+ height: 1024
+ color: "lightgrey"
+ title: document.title
+ visible: true
+ required property url source // for main.cpp
+ property real scaleStep: Math.sqrt(2)
+
+ header: ToolBar {
+ RowLayout {
+ anchors.fill: parent
+ anchors.rightMargin: 6
+ ToolButton {
+ action: Action {
+ shortcut: StandardKey.Open
+ icon.source: "qrc:/singlepage/resources/document-open.svg"
+ onTriggered: fileDialog.open()
+ }
+ }
+ ToolButton {
+ action: Action {
+ shortcut: StandardKey.ZoomIn
+ enabled: view.sourceSize.width < 10000
+ icon.source: "qrc:/singlepage/resources/zoom-in.svg"
+ onTriggered: view.renderScale *= root.scaleStep
+ }
+ }
+ ToolButton {
+ action: Action {
+ shortcut: StandardKey.ZoomOut
+ enabled: view.sourceSize.width > 50
+ icon.source: "qrc:/singlepage/resources/zoom-out.svg"
+ onTriggered: view.renderScale /= root.scaleStep
+ }
+ }
+ ToolButton {
+ action: Action {
+ icon.source: "qrc:/singlepage/resources/zoom-fit-width.svg"
+ onTriggered: view.scaleToWidth(root.contentItem.width, root.contentItem.height)
+ }
+ }
+ ToolButton {
+ action: Action {
+ icon.source: "qrc:/singlepage/resources/zoom-fit-best.svg"
+ onTriggered: view.scaleToPage(root.contentItem.width, root.contentItem.height)
+ }
+ }
+ ToolButton {
+ action: Action {
+ shortcut: "Ctrl+0"
+ icon.source: "qrc:/singlepage/resources/zoom-original.svg"
+ onTriggered: view.resetScale()
+ }
+ }
+ ToolButton {
+ action: Action {
+ shortcut: "Ctrl+L"
+ icon.source: "qrc:/singlepage/resources/rotate-left.svg"
+ onTriggered: view.pageRotation -= 90
+ }
+ }
+ ToolButton {
+ action: Action {
+ shortcut: "Ctrl+R"
+ icon.source: "qrc:/singlepage/resources/rotate-right.svg"
+ onTriggered: view.pageRotation += 90
+ }
+ }
+ ToolButton {
+ action: Action {
+ icon.source: "qrc:/singlepage/resources/go-previous-view-page.svg"
+ enabled: view.backEnabled
+ onTriggered: view.back()
+ }
+ ToolTip.visible: enabled && hovered
+ ToolTip.delay: 2000
+ ToolTip.text: "go back"
+ }
+ SpinBox {
+ id: currentPageSB
+ from: 1
+ to: document.pageCount
+ editable: true
+ value: view.currentPage + 1
+ onValueModified: view.goToPage(value - 1)
+ Shortcut {
+ sequence: StandardKey.MoveToPreviousPage
+ onActivated: view.goToPage(currentPageSB.value - 2)
+ }
+ Shortcut {
+ sequence: StandardKey.MoveToNextPage
+ onActivated: view.goToPage(currentPageSB.value)
+ }
+ }
+ ToolButton {
+ action: Action {
+ icon.source: "qrc:/singlepage/resources/go-next-view-page.svg"
+ enabled: view.forwardEnabled
+ onTriggered: view.forward()
+ }
+ ToolTip.visible: enabled && hovered
+ ToolTip.delay: 2000
+ ToolTip.text: "go forward"
+ }
+ ToolButton {
+ action: Action {
+ shortcut: StandardKey.SelectAll
+ icon.source: "qrc:/singlepage/resources/edit-select-all.svg"
+ onTriggered: view.selectAll()
+ }
+ }
+ ToolButton {
+ action: Action {
+ shortcut: StandardKey.Copy
+ icon.source: "qrc:/singlepage/resources/edit-copy.svg"
+ enabled: view.selectedText !== ""
+ onTriggered: view.copySelectionToClipboard()
+ }
+ }
+ Shortcut {
+ sequence: StandardKey.Find
+ onActivated: {
+ searchField.forceActiveFocus()
+ searchField.selectAll()
+ }
+ }
+ Shortcut {
+ sequence: StandardKey.Quit
+ onActivated: Qt.quit()
+ }
+ }
+ }
+
+ FileDialog {
+ id: fileDialog
+ title: "Open a PDF file"
+ nameFilters: [ "PDF files (*.pdf)" ]
+ onAccepted: document.source = selectedFile
+ }
+
+ Dialog {
+ id: passwordDialog
+ title: "Password"
+ standardButtons: Dialog.Ok | Dialog.Cancel
+ modal: true
+ closePolicy: Popup.CloseOnEscape
+ anchors.centerIn: parent
+ width: 300
+
+ contentItem: TextField {
+ id: passwordField
+ placeholderText: qsTr("Please provide the password")
+ echoMode: TextInput.Password
+ width: parent.width
+ onAccepted: passwordDialog.accept()
+ }
+ onOpened: function() { passwordField.forceActiveFocus() }
+ onAccepted: document.password = passwordField.text
+ }
+
+ Dialog {
+ id: errorDialog
+ title: "Error loading " + document.source
+ standardButtons: Dialog.Close
+ modal: true
+ closePolicy: Popup.CloseOnEscape
+ anchors.centerIn: parent
+ width: 300
+ visible: document.status === PdfDocument.Error
+
+ contentItem: Label {
+ id: errorField
+ text: document.error
+ }
+ }
+
+ PdfScrollablePageView {
+ id: view
+ anchors.fill: parent
+ anchors.leftMargin: searchDrawer.position * searchDrawer.width
+ document: PdfDocument {
+ id: document
+ source: Qt.resolvedUrl(root.source)
+ onPasswordRequired: passwordDialog.open()
+ }
+ searchString: searchField.text
+ }
+
+ Drawer {
+ id: searchDrawer
+ edge: Qt.LeftEdge
+// modal: false
+// dim: false // commented out as workaround for QTBUG-83859
+ width: 300
+ y: root.header.height
+ height: view.height
+ clip: true
+ ListView {
+ id: searchResultsList
+ anchors.fill: parent
+ anchors.margins: 2
+ model: view.searchModel
+ currentIndex: view.searchModel.currentResult
+ ScrollBar.vertical: ScrollBar { }
+ delegate: ItemDelegate {
+ id: resultDelegate
+ required property int index
+ required property int page
+ required property string contextBefore
+ required property string contextAfter
+ width: parent ? parent.width : 0
+ RowLayout {
+ anchors.fill: parent
+ spacing: 0
+ Label {
+ text: "Page " + (resultDelegate.page + 1) + ": "
+ }
+ Label {
+ text: resultDelegate.contextBefore
+ elide: Text.ElideLeft
+ horizontalAlignment: Text.AlignRight
+ Layout.fillWidth: true
+ Layout.preferredWidth: parent.width / 2
+ }
+ Label {
+ font.bold: true
+ text: view.searchString
+ width: implicitWidth
+ }
+ Label {
+ text: resultDelegate.contextAfter
+ elide: Text.ElideRight
+ Layout.fillWidth: true
+ Layout.preferredWidth: parent.width / 2
+ }
+ }
+ highlighted: ListView.isCurrentItem
+ onClicked: view.searchModel.currentResult = resultDelegate.index
+ }
+ }
+ }
+
+ footer: ToolBar {
+ height: footerRow.implicitHeight
+ RowLayout {
+ id: footerRow
+ anchors.fill: parent
+ ToolButton {
+ action: Action {
+ icon.source: "qrc:/singlepage/resources/go-up-search.svg"
+ shortcut: StandardKey.FindPrevious
+ enabled: view.searchModel.count > 0
+ onTriggered: view.searchBack()
+ }
+ ToolTip.visible: enabled && hovered
+ ToolTip.delay: 2000
+ ToolTip.text: "find previous"
+ }
+ TextField {
+ id: searchField
+ placeholderText: "search"
+ Layout.minimumWidth: 150
+ Layout.maximumWidth: 300
+ Layout.fillWidth: true
+ onAccepted: searchDrawer.open()
+ Image {
+ visible: searchField.text !== ""
+ source: "qrc:/singlepage/resources/edit-clear.svg"
+ anchors {
+ right: parent.right
+ top: parent.top
+ bottom: parent.bottom
+ margins: 3
+ rightMargin: 5
+ }
+ TapHandler {
+ onTapped: searchField.clear()
+ }
+ }
+ }
+ ToolButton {
+ action: Action {
+ icon.source: "qrc:/singlepage/resources/go-down-search.svg"
+ shortcut: StandardKey.FindNext
+ enabled: view.searchModel.count > 0
+ onTriggered: view.searchForward()
+ }
+ ToolTip.visible: enabled && hovered
+ ToolTip.delay: 2000
+ ToolTip.text: "find next"
+ }
+ Label {
+ Layout.fillWidth: true
+ property size implicitPointSize: document.pagePointSize(view.currentPage)
+ text: "page " + (view.currentPage + 1) + " of " + document.pageCount +
+ " scale " + view.renderScale.toFixed(2) +
+ " original " + implicitPointSize.width.toFixed(1) + "x" + implicitPointSize.height.toFixed(1) + "pts"
+ visible: document.status === PdfDocument.Ready
+ }
+ }
+ }
+}
diff --git a/examples/pdf/singlepage/viewer.qrc b/examples/pdf/singlepage/viewer.qrc
new file mode 100644
index 000000000..6f8af53ac
--- /dev/null
+++ b/examples/pdf/singlepage/viewer.qrc
@@ -0,0 +1,21 @@
+<RCC>
+ <qresource prefix="/singlepage">
+ <file>viewer.qml</file>
+ <file>resources/document-open.svg</file>
+ <file>resources/edit-clear.svg</file>
+ <file>resources/edit-copy.svg</file>
+ <file>resources/edit-select-all.svg</file>
+ <file>resources/go-down-search.svg</file>
+ <file>resources/go-next-view-page.svg</file>
+ <file>resources/go-previous-view-page.svg</file>
+ <file>resources/go-up-search.svg</file>
+ <file>resources/rotate-left.svg</file>
+ <file>resources/rotate-right.svg</file>
+ <file>resources/test.pdf</file>
+ <file>resources/zoom-in.svg</file>
+ <file>resources/zoom-fit-best.svg</file>
+ <file>resources/zoom-fit-width.svg</file>
+ <file>resources/zoom-original.svg</file>
+ <file>resources/zoom-out.svg</file>
+ </qresource>
+</RCC>
diff --git a/examples/pdfwidgets/CMakeLists.txt b/examples/pdfwidgets/CMakeLists.txt
new file mode 100644
index 000000000..dbde7f1c2
--- /dev/null
+++ b/examples/pdfwidgets/CMakeLists.txt
@@ -0,0 +1 @@
+qt_internal_add_example(pdfviewer)
diff --git a/examples/pdfwidgets/pdfviewer/CMakeLists.txt b/examples/pdfwidgets/pdfviewer/CMakeLists.txt
new file mode 100644
index 000000000..4ace81618
--- /dev/null
+++ b/examples/pdfwidgets/pdfviewer/CMakeLists.txt
@@ -0,0 +1,65 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+project(pdfviewer LANGUAGES CXX)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTOUIC ON)
+
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/pdfwidgets/pdfviewer")
+
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets PdfWidgets)
+
+qt_add_executable(pdfviewerwidgets
+ main.cpp
+ mainwindow.cpp mainwindow.h mainwindow.ui
+ searchresultdelegate.cpp searchresultdelegate.h
+ zoomselector.cpp zoomselector.h
+)
+
+set_target_properties(pdfviewerwidgets PROPERTIES
+ WIN32_EXECUTABLE TRUE
+ MACOSX_BUNDLE TRUE
+)
+
+target_link_libraries(pdfviewerwidgets PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+ Qt::PdfWidgets
+)
+
+# Resources:
+set(resources_resource_files
+ "images/zoom-fit-width.svgz"
+ "images/zoom-in.svgz"
+ "images/go-previous-view-page.svgz"
+ "images/zoom-original.svgz"
+ "images/go-previous-view.svgz"
+ "images/go-next-view-page.svgz"
+ "images/zoom-fit-best.svgz"
+ "images/zoom-out.svgz"
+ "images/zoom-previous.svgz"
+ "images/document-open.svgz"
+ "images/go-next-view.svgz"
+ "images/go-down-search.svgz"
+ "images/go-up-search.svgz"
+)
+
+qt_add_resources(pdfviewerwidgets "resources"
+ PREFIX
+ "/icons"
+ FILES
+ ${resources_resource_files}
+)
+
+install(TARGETS pdfviewerwidgets
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc b/examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc
index 9c7b3deed..b56958a9f 100644
--- a/examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc
+++ b/examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc
@@ -1,41 +1,19 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\example pdfviewer
+ \meta installpath pdfwidgets
\ingroup qtpdf-examples
+ \examplecategory {User Interface Components}
- \title PDF Viewer Example
- \brief Renders PDF documents.
+ \title PDF Viewer Widget Example
+ \brief A widget-based PDF viewer that allows scrolling through the pages.
\image pdfviewer.png
- \e {PDF Viewer} demonstrates how to use the \l QPdfDocument class to render
- PDF documents and the \l QPdfPageNavigation class to navigate them.
+ \e {PDF Viewer} demonstrates how to use the QPdfView class to render
+ PDF documents and the QPdfPageNavigator class to navigate them.
Qt Creator and the integrated Qt Designer were used to create the example
UI and to connect it to the code. This affects the code, which might be
@@ -50,13 +28,13 @@
The MainWindow class inherits the QMainWindow class:
\quotefromfile pdfviewer/mainwindow.h
- \skipto public QMainWindow
+ \skipto public
\printuntil ~MainWindow()
The class declares public and private slots that match the actions of the
selectors:
- \printuntil on_actionContinuous_triggered()
+ \printuntil on_actionForward_triggered()
The actual layout of the main window is specified in a \c{.ui} file. The
widgets and actions are available at runtime in the \c ui member variable.
@@ -74,19 +52,20 @@
constructor:
\quotefromfile pdfviewer/mainwindow.cpp
- \skipto MainWindow::
+ \skipto MainWindow
\printuntil {
- The constructor first calls \c setupUi() to construct the zoom and page
- selectors according to the UI file. We set the maximum width of the
- selectors.
+ The constructor first calls \c setupUi() to construct most of the main window
+ according to the UI file. The zoom and page selectors need to be added to
+ the toolbar via \l QToolBar::insertWidget(), because that cannot be done
+ in a UI file:
- \printuntil addWidget(m_pageSelector)
+ \printuntil insertWidget(ui->actionForward, m_pageSelector);
- We use the \l QPdfPageNavigation class to handle the navigation through a
- PDF document:
+ We connect relevant signals to the page selector spinbox and the browser-style
+ back and forward buttons:
- \printuntil setPageNavigation
+ \printuntil forwardAvailableChanged
We connect the \c zoomModeChanged and \c zoomFactor changed signals of the
PDF view to the functions that reset the zoom selector:
diff --git a/examples/pdfwidgets/pdfviewer/images/busy.png b/examples/pdfwidgets/pdfviewer/images/busy.png
deleted file mode 100644
index 69056c479..000000000
--- a/examples/pdfwidgets/pdfviewer/images/busy.png
+++ /dev/null
Binary files differ
diff --git a/examples/pdfwidgets/pdfviewer/images/document-open.svgz b/examples/pdfwidgets/pdfviewer/images/document-open.svgz
new file mode 100644
index 000000000..5ddde5981
--- /dev/null
+++ b/examples/pdfwidgets/pdfviewer/images/document-open.svgz
Binary files differ
diff --git a/examples/pdfwidgets/pdfviewer/images/fileopen.png b/examples/pdfwidgets/pdfviewer/images/fileopen.png
deleted file mode 100644
index 33e0d6394..000000000
--- a/examples/pdfwidgets/pdfviewer/images/fileopen.png
+++ /dev/null
Binary files differ
diff --git a/examples/pdfwidgets/pdfviewer/images/go-down-search.svgz b/examples/pdfwidgets/pdfviewer/images/go-down-search.svgz
new file mode 100644
index 000000000..f845473e7
--- /dev/null
+++ b/examples/pdfwidgets/pdfviewer/images/go-down-search.svgz
Binary files differ
diff --git a/examples/pdfwidgets/pdfviewer/images/go-next-24.png b/examples/pdfwidgets/pdfviewer/images/go-next-24.png
deleted file mode 100644
index 9a55ef3d8..000000000
--- a/examples/pdfwidgets/pdfviewer/images/go-next-24.png
+++ /dev/null
Binary files differ
diff --git a/examples/pdfwidgets/pdfviewer/images/go-next-view-page.svgz b/examples/pdfwidgets/pdfviewer/images/go-next-view-page.svgz
new file mode 100644
index 000000000..e7f7bece4
--- /dev/null
+++ b/examples/pdfwidgets/pdfviewer/images/go-next-view-page.svgz
Binary files differ
diff --git a/examples/pdfwidgets/pdfviewer/images/go-next-view.svgz b/examples/pdfwidgets/pdfviewer/images/go-next-view.svgz
new file mode 100644
index 000000000..2f86541cc
--- /dev/null
+++ b/examples/pdfwidgets/pdfviewer/images/go-next-view.svgz
Binary files differ
diff --git a/examples/pdfwidgets/pdfviewer/images/go-previous-24.png b/examples/pdfwidgets/pdfviewer/images/go-previous-24.png
deleted file mode 100644
index 2ea769eb8..000000000
--- a/examples/pdfwidgets/pdfviewer/images/go-previous-24.png
+++ /dev/null
Binary files differ
diff --git a/examples/pdfwidgets/pdfviewer/images/go-previous-view-page.svgz b/examples/pdfwidgets/pdfviewer/images/go-previous-view-page.svgz
new file mode 100644
index 000000000..f4df6df40
--- /dev/null
+++ b/examples/pdfwidgets/pdfviewer/images/go-previous-view-page.svgz
Binary files differ
diff --git a/examples/pdfwidgets/pdfviewer/images/go-previous-view.svgz b/examples/pdfwidgets/pdfviewer/images/go-previous-view.svgz
new file mode 100644
index 000000000..688f55ffe
--- /dev/null
+++ b/examples/pdfwidgets/pdfviewer/images/go-previous-view.svgz
Binary files differ
diff --git a/examples/pdfwidgets/pdfviewer/images/go-up-search.svgz b/examples/pdfwidgets/pdfviewer/images/go-up-search.svgz
new file mode 100644
index 000000000..6378721fa
--- /dev/null
+++ b/examples/pdfwidgets/pdfviewer/images/go-up-search.svgz
Binary files differ
diff --git a/examples/pdfwidgets/pdfviewer/images/zoom-fit-best.svgz b/examples/pdfwidgets/pdfviewer/images/zoom-fit-best.svgz
new file mode 100644
index 000000000..0cb1b3074
--- /dev/null
+++ b/examples/pdfwidgets/pdfviewer/images/zoom-fit-best.svgz
Binary files differ
diff --git a/examples/pdfwidgets/pdfviewer/images/zoom-fit-width.svgz b/examples/pdfwidgets/pdfviewer/images/zoom-fit-width.svgz
new file mode 100644
index 000000000..a467f6eae
--- /dev/null
+++ b/examples/pdfwidgets/pdfviewer/images/zoom-fit-width.svgz
Binary files differ
diff --git a/examples/pdfwidgets/pdfviewer/images/zoom-in-24.png b/examples/pdfwidgets/pdfviewer/images/zoom-in-24.png
deleted file mode 100644
index d29b142b6..000000000
--- a/examples/pdfwidgets/pdfviewer/images/zoom-in-24.png
+++ /dev/null
Binary files differ
diff --git a/examples/pdfwidgets/pdfviewer/images/zoom-in-32.png b/examples/pdfwidgets/pdfviewer/images/zoom-in-32.png
deleted file mode 100644
index 34d70af37..000000000
--- a/examples/pdfwidgets/pdfviewer/images/zoom-in-32.png
+++ /dev/null
Binary files differ
diff --git a/examples/pdfwidgets/pdfviewer/images/zoom-in.svgz b/examples/pdfwidgets/pdfviewer/images/zoom-in.svgz
new file mode 100644
index 000000000..21d6c2ab2
--- /dev/null
+++ b/examples/pdfwidgets/pdfviewer/images/zoom-in.svgz
Binary files differ
diff --git a/examples/pdfwidgets/pdfviewer/images/zoom-original.svgz b/examples/pdfwidgets/pdfviewer/images/zoom-original.svgz
new file mode 100644
index 000000000..afa79db19
--- /dev/null
+++ b/examples/pdfwidgets/pdfviewer/images/zoom-original.svgz
Binary files differ
diff --git a/examples/pdfwidgets/pdfviewer/images/zoom-out-24.png b/examples/pdfwidgets/pdfviewer/images/zoom-out-24.png
deleted file mode 100644
index 19703474f..000000000
--- a/examples/pdfwidgets/pdfviewer/images/zoom-out-24.png
+++ /dev/null
Binary files differ
diff --git a/examples/pdfwidgets/pdfviewer/images/zoom-out-32.png b/examples/pdfwidgets/pdfviewer/images/zoom-out-32.png
deleted file mode 100644
index b83220661..000000000
--- a/examples/pdfwidgets/pdfviewer/images/zoom-out-32.png
+++ /dev/null
Binary files differ
diff --git a/examples/pdfwidgets/pdfviewer/images/zoom-out.svgz b/examples/pdfwidgets/pdfviewer/images/zoom-out.svgz
new file mode 100644
index 000000000..b6db7a144
--- /dev/null
+++ b/examples/pdfwidgets/pdfviewer/images/zoom-out.svgz
Binary files differ
diff --git a/examples/pdfwidgets/pdfviewer/images/zoom-previous.svgz b/examples/pdfwidgets/pdfviewer/images/zoom-previous.svgz
new file mode 100644
index 000000000..ad4c29215
--- /dev/null
+++ b/examples/pdfwidgets/pdfviewer/images/zoom-previous.svgz
Binary files differ
diff --git a/examples/pdfwidgets/pdfviewer/main.cpp b/examples/pdfwidgets/pdfviewer/main.cpp
index 20fa6f8cd..6b890e0ac 100644
--- a/examples/pdfwidgets/pdfviewer/main.cpp
+++ b/examples/pdfwidgets/pdfviewer/main.cpp
@@ -1,51 +1,29 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "mainwindow.h"
#include <QApplication>
+#include <QCommandLineParser>
+#include <QCommandLineOption>
#include <QUrl>
int main(int argc, char *argv[])
{
+ QCoreApplication::setApplicationName("Qt PDF Viewer");
+ QCoreApplication::setOrganizationName("QtProject");
+
QApplication a(argc, argv);
+
+ QCommandLineParser parser;
+ parser.addHelpOption();
+ parser.addVersionOption();
+ parser.addPositionalArgument("file", "The file to open.");
+ parser.process(a);
+
MainWindow w;
- QStringList args = a.arguments();
w.show();
- if (args.length() > 1)
- w.open(QUrl::fromLocalFile(args[1]));
+ if (!parser.positionalArguments().isEmpty())
+ w.open(QUrl::fromLocalFile(parser.positionalArguments().constFirst()));
return a.exec();
}
diff --git a/examples/pdfwidgets/pdfviewer/mainwindow.cpp b/examples/pdfwidgets/pdfviewer/mainwindow.cpp
index 5f9bf389f..ce19359fc 100644
--- a/examples/pdfwidgets/pdfviewer/mainwindow.cpp
+++ b/examples/pdfwidgets/pdfviewer/mainwindow.cpp
@@ -1,50 +1,22 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "mainwindow.h"
#include "ui_mainwindow.h"
-#include "pageselector.h"
+#include "searchresultdelegate.h"
#include "zoomselector.h"
#include <QFileDialog>
+#include <QLineEdit>
#include <QMessageBox>
#include <QPdfBookmarkModel>
#include <QPdfDocument>
-#include <QPdfPageNavigation>
+#include <QPdfPageNavigator>
+#include <QPdfPageSelector>
+#include <QPdfSearchModel>
+#include <QShortcut>
+#include <QStandardPaths>
#include <QtMath>
const qreal zoomMultiplier = qSqrt(2.0);
@@ -55,7 +27,9 @@ MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
, m_zoomSelector(new ZoomSelector(this))
- , m_pageSelector(new PageSelector(this))
+ , m_pageSelector(new QPdfPageSelector(this))
+ , m_searchModel(new QPdfSearchModel(this))
+ , m_searchField(new QLineEdit(this))
, m_document(new QPdfDocument(this))
{
ui->setupUi(this);
@@ -63,10 +37,13 @@ MainWindow::MainWindow(QWidget *parent)
m_zoomSelector->setMaximumWidth(150);
ui->mainToolBar->insertWidget(ui->actionZoom_In, m_zoomSelector);
- m_pageSelector->setMaximumWidth(150);
- ui->mainToolBar->addWidget(m_pageSelector);
-
- m_pageSelector->setPageNavigation(ui->pdfView->pageNavigation());
+ ui->mainToolBar->insertWidget(ui->actionForward, m_pageSelector);
+ connect(m_pageSelector, &QPdfPageSelector::currentPageChanged, this, &MainWindow::pageSelected);
+ m_pageSelector->setDocument(m_document);
+ auto nav = ui->pdfView->pageNavigator();
+ connect(nav, &QPdfPageNavigator::currentPageChanged, m_pageSelector, &QPdfPageSelector::setCurrentPage);
+ connect(nav, &QPdfPageNavigator::backAvailableChanged, ui->actionBack, &QAction::setEnabled);
+ connect(nav, &QPdfPageNavigator::forwardAvailableChanged, ui->actionForward, &QAction::setEnabled);
connect(m_zoomSelector, &ZoomSelector::zoomModeChanged, ui->pdfView, &QPdfView::setZoomMode);
connect(m_zoomSelector, &ZoomSelector::zoomFactorChanged, ui->pdfView, &QPdfView::setZoomFactor);
@@ -76,9 +53,26 @@ MainWindow::MainWindow(QWidget *parent)
bookmarkModel->setDocument(m_document);
ui->bookmarkView->setModel(bookmarkModel);
- connect(ui->bookmarkView, SIGNAL(activated(QModelIndex)), this, SLOT(bookmarkSelected(QModelIndex)));
-
- ui->tabWidget->setTabEnabled(1, false); // disable 'Pages' tab for now
+ connect(ui->bookmarkView, &QAbstractItemView::activated, this, &MainWindow::bookmarkSelected);
+
+ ui->thumbnailsView->setModel(m_document->pageModel());
+
+ m_searchModel->setDocument(m_document);
+ ui->pdfView->setSearchModel(m_searchModel);
+ ui->searchToolBar->insertWidget(ui->actionFindPrevious, m_searchField);
+ connect(new QShortcut(QKeySequence::Find, this), &QShortcut::activated, this, [this]() {
+ m_searchField->setFocus(Qt::ShortcutFocusReason);
+ });
+ m_searchField->setPlaceholderText(tr("Find in document"));
+ m_searchField->setMaximumWidth(400);
+ connect(m_searchField, &QLineEdit::textEdited, this, [this](const QString &text) {
+ m_searchModel->setSearchString(text);
+ ui->tabWidget->setCurrentWidget(ui->searchResultsTab);
+ });
+ ui->searchResultsView->setModel(m_searchModel);
+ ui->searchResultsView->setItemDelegate(new SearchResultDelegate(this));
+ connect(ui->searchResultsView->selectionModel(), &QItemSelectionModel::currentChanged,
+ this, &MainWindow::searchResultSelected);
ui->pdfView->setDocument(m_document);
@@ -95,11 +89,11 @@ void MainWindow::open(const QUrl &docLocation)
{
if (docLocation.isLocalFile()) {
m_document->load(docLocation.toLocalFile());
- const auto documentTitle = m_document->metaData(QPdfDocument::Title).toString();
- setWindowTitle(!documentTitle.isEmpty() ? documentTitle : QStringLiteral("PDF Viewer"));
+ pageSelected(0);
} else {
- qCDebug(lcExample) << docLocation << "is not a valid local file";
- QMessageBox::critical(this, tr("Failed to open"), tr("%1 is not a valid local file").arg(docLocation.toString()));
+ const QString message = tr("%1 is not a valid local file").arg(docLocation.toString());
+ qCDebug(lcExample).noquote() << message;
+ QMessageBox::critical(this, tr("Failed to open"), message);
}
qCDebug(lcExample) << docLocation;
}
@@ -109,15 +103,48 @@ void MainWindow::bookmarkSelected(const QModelIndex &index)
if (!index.isValid())
return;
- const int page = index.data(QPdfBookmarkModel::PageNumberRole).toInt();
- ui->pdfView->pageNavigation()->setCurrentPage(page);
+ const int page = index.data(int(QPdfBookmarkModel::Role::Page)).toInt();
+ const qreal zoomLevel = index.data(int(QPdfBookmarkModel::Role::Level)).toReal();
+ ui->pdfView->pageNavigator()->jump(page, {}, zoomLevel);
+}
+
+void MainWindow::pageSelected(int page)
+{
+ auto nav = ui->pdfView->pageNavigator();
+ nav->jump(page, {}, nav->currentZoom());
+ const auto documentTitle = m_document->metaData(QPdfDocument::MetaDataField::Title).toString();
+ setWindowTitle(!documentTitle.isEmpty() ? documentTitle : QStringLiteral("PDF Viewer"));
+ setWindowTitle(tr("%1: page %2 (%3 of %4)")
+ .arg(documentTitle.isEmpty() ? u"PDF Viewer"_qs : documentTitle,
+ m_pageSelector->currentPageLabel(), QString::number(page + 1), QString::number(m_document->pageCount())));
+}
+
+void MainWindow::searchResultSelected(const QModelIndex &current, const QModelIndex &previous)
+{
+ Q_UNUSED(previous);
+ if (!current.isValid())
+ return;
+
+ const int page = current.data(int(QPdfSearchModel::Role::Page)).toInt();
+ const QPointF location = current.data(int(QPdfSearchModel::Role::Location)).toPointF();
+ ui->pdfView->pageNavigator()->jump(page, location);
+ ui->pdfView->setCurrentSearchResultIndex(current.row());
}
void MainWindow::on_actionOpen_triggered()
{
- QUrl toOpen = QFileDialog::getOpenFileUrl(this, tr("Choose a PDF"), QUrl(), "Portable Documents (*.pdf)");
- if (toOpen.isValid())
- open(toOpen);
+ if (m_fileDialog == nullptr) {
+ m_fileDialog = new QFileDialog(this, tr("Choose a PDF"),
+ QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation));
+ m_fileDialog->setAcceptMode(QFileDialog::AcceptOpen);
+ m_fileDialog->setMimeTypeFilters({"application/pdf"});
+ }
+
+ if (m_fileDialog->exec() == QDialog::Accepted) {
+ const QUrl toOpen = m_fileDialog->selectedUrls().constFirst();
+ if (toOpen.isValid())
+ open(toOpen);
+ }
}
void MainWindow::on_actionQuit_triggered()
@@ -148,15 +175,51 @@ void MainWindow::on_actionZoom_Out_triggered()
void MainWindow::on_actionPrevious_Page_triggered()
{
- ui->pdfView->pageNavigation()->goToPreviousPage();
+ auto nav = ui->pdfView->pageNavigator();
+ nav->jump(nav->currentPage() - 1, {}, nav->currentZoom());
}
void MainWindow::on_actionNext_Page_triggered()
{
- ui->pdfView->pageNavigation()->goToNextPage();
+ auto nav = ui->pdfView->pageNavigator();
+ nav->jump(nav->currentPage() + 1, {}, nav->currentZoom());
+}
+
+void MainWindow::on_thumbnailsView_activated(const QModelIndex &index)
+{
+ auto nav = ui->pdfView->pageNavigator();
+ nav->jump(index.row(), {}, nav->currentZoom());
}
void MainWindow::on_actionContinuous_triggered()
{
- ui->pdfView->setPageMode(ui->actionContinuous->isChecked() ? QPdfView::MultiPage : QPdfView::SinglePage);
+ ui->pdfView->setPageMode(ui->actionContinuous->isChecked() ?
+ QPdfView::PageMode::MultiPage :
+ QPdfView::PageMode::SinglePage);
+}
+
+void MainWindow::on_actionBack_triggered()
+{
+ ui->pdfView->pageNavigator()->back();
+}
+
+void MainWindow::on_actionForward_triggered()
+{
+ ui->pdfView->pageNavigator()->forward();
+}
+
+void MainWindow::on_actionFindNext_triggered()
+{
+ int next = ui->searchResultsView->currentIndex().row() + 1;
+ if (next >= m_searchModel->rowCount({}))
+ next = 0;
+ ui->searchResultsView->setCurrentIndex(m_searchModel->index(next));
+}
+
+void MainWindow::on_actionFindPrevious_triggered()
+{
+ int prev = ui->searchResultsView->currentIndex().row() - 1;
+ if (prev < 0)
+ prev = m_searchModel->rowCount({}) - 1;
+ ui->searchResultsView->setCurrentIndex(m_searchModel->index(prev));
}
diff --git a/examples/pdfwidgets/pdfviewer/mainwindow.h b/examples/pdfwidgets/pdfviewer/mainwindow.h
index afdfcade4..7f5a5dbca 100644
--- a/examples/pdfwidgets/pdfviewer/mainwindow.h
+++ b/examples/pdfwidgets/pdfviewer/mainwindow.h
@@ -1,38 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
@@ -47,11 +14,15 @@ namespace Ui {
class MainWindow;
}
+class QFileDialog;
+class QLineEdit;
class QPdfDocument;
+class QPdfPageSelector;
+class QPdfSearchModel;
class QPdfView;
+class QSpinBox;
QT_END_NAMESPACE
-class PageSelector;
class ZoomSelector;
class MainWindow : public QMainWindow
@@ -67,6 +38,8 @@ public slots:
private slots:
void bookmarkSelected(const QModelIndex &index);
+ void pageSelected(int page);
+ void searchResultSelected(const QModelIndex &current, const QModelIndex &previous);
// action handlers
void on_actionOpen_triggered();
@@ -77,12 +50,20 @@ private slots:
void on_actionZoom_Out_triggered();
void on_actionPrevious_Page_triggered();
void on_actionNext_Page_triggered();
+ void on_thumbnailsView_activated(const QModelIndex &index);
void on_actionContinuous_triggered();
+ void on_actionBack_triggered();
+ void on_actionForward_triggered();
+ void on_actionFindNext_triggered();
+ void on_actionFindPrevious_triggered();
private:
Ui::MainWindow *ui;
ZoomSelector *m_zoomSelector;
- PageSelector *m_pageSelector;
+ QPdfPageSelector *m_pageSelector;
+ QPdfSearchModel *m_searchModel;
+ QLineEdit *m_searchField;
+ QFileDialog *m_fileDialog = nullptr;
QPdfDocument *m_document;
};
diff --git a/examples/pdfwidgets/pdfviewer/mainwindow.ui b/examples/pdfwidgets/pdfviewer/mainwindow.ui
index 2651525a5..881df2e1b 100644
--- a/examples/pdfwidgets/pdfviewer/mainwindow.ui
+++ b/examples/pdfwidgets/pdfviewer/mainwindow.ui
@@ -111,6 +111,74 @@
<attribute name="title">
<string>Pages</string>
</attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_4">
+ <property name="leftMargin">
+ <number>2</number>
+ </property>
+ <property name="topMargin">
+ <number>2</number>
+ </property>
+ <property name="rightMargin">
+ <number>2</number>
+ </property>
+ <property name="bottomMargin">
+ <number>2</number>
+ </property>
+ <item>
+ <widget class="QListView" name="thumbnailsView">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="iconSize">
+ <size>
+ <width>128</width>
+ <height>128</height>
+ </size>
+ </property>
+ <property name="movement">
+ <enum>QListView::Static</enum>
+ </property>
+ <property name="resizeMode">
+ <enum>QListView::Adjust</enum>
+ </property>
+ <property name="viewMode">
+ <enum>QListView::IconMode</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="searchResultsTab">
+ <attribute name="title">
+ <string>Search Results</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_5">
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <property name="leftMargin">
+ <number>2</number>
+ </property>
+ <property name="topMargin">
+ <number>2</number>
+ </property>
+ <property name="rightMargin">
+ <number>2</number>
+ </property>
+ <property name="bottomMargin">
+ <number>2</number>
+ </property>
+ <item>
+ <widget class="QListView" name="searchResultsView">
+ <property name="horizontalScrollBarPolicy">
+ <enum>Qt::ScrollBarAlwaysOff</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
</widget>
</widget>
<widget class="QPdfView" name="pdfView" native="true">
@@ -134,7 +202,7 @@
<x>0</x>
<y>0</y>
<width>700</width>
- <height>22</height>
+ <height>23</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
@@ -184,12 +252,27 @@
<addaction name="actionZoom_Out"/>
<addaction name="actionZoom_In"/>
<addaction name="separator"/>
+ <addaction name="actionBack"/>
+ <addaction name="actionForward"/>
</widget>
<widget class="QStatusBar" name="statusBar"/>
+ <widget class="QToolBar" name="searchToolBar">
+ <property name="windowTitle">
+ <string>toolBar</string>
+ </property>
+ <attribute name="toolBarArea">
+ <enum>TopToolBarArea</enum>
+ </attribute>
+ <attribute name="toolBarBreak">
+ <bool>false</bool>
+ </attribute>
+ <addaction name="actionFindPrevious"/>
+ <addaction name="actionFindNext"/>
+ </widget>
<action name="actionOpen">
<property name="icon">
- <iconset resource="resources.qrc">
- <normaloff>:/icons/images/fileopen.png</normaloff>:/icons/images/fileopen.png</iconset>
+ <iconset theme="document-open" resource="resources.qrc">
+ <normaloff>:/icons/images/document-open.svgz</normaloff>:/icons/images/document-open.svgz</iconset>
</property>
<property name="text">
<string>Open...</string>
@@ -199,6 +282,9 @@
</property>
</action>
<action name="actionQuit">
+ <property name="icon">
+ <iconset theme="application-exit"/>
+ </property>
<property name="text">
<string>Quit</string>
</property>
@@ -207,6 +293,9 @@
</property>
</action>
<action name="actionAbout">
+ <property name="icon">
+ <iconset theme="help-about"/>
+ </property>
<property name="text">
<string>About</string>
</property>
@@ -218,8 +307,8 @@
</action>
<action name="actionZoom_In">
<property name="icon">
- <iconset resource="resources.qrc">
- <normaloff>:/icons/images/zoom-in-24.png</normaloff>:/icons/images/zoom-in-24.png</iconset>
+ <iconset theme="zoom-in" resource="resources.qrc">
+ <normaloff>:/icons/images/zoom-in.svgz</normaloff>:/icons/images/zoom-in.svgz</iconset>
</property>
<property name="text">
<string>Zoom In</string>
@@ -230,8 +319,8 @@
</action>
<action name="actionZoom_Out">
<property name="icon">
- <iconset resource="resources.qrc">
- <normaloff>:/icons/images/zoom-out-24.png</normaloff>:/icons/images/zoom-out-24.png</iconset>
+ <iconset theme="zoom-out" resource="resources.qrc">
+ <normaloff>:/icons/images/zoom-out.svgz</normaloff>:/icons/images/zoom-out.svgz</iconset>
</property>
<property name="text">
<string>Zoom Out</string>
@@ -241,6 +330,10 @@
</property>
</action>
<action name="actionPrevious_Page">
+ <property name="icon">
+ <iconset theme="go-previous-view-page" resource="resources.qrc">
+ <normaloff>:/icons/images/go-previous-view-page.svgz</normaloff>:/icons/images/go-previous-view-page.svgz</iconset>
+ </property>
<property name="text">
<string>Previous Page</string>
</property>
@@ -249,6 +342,10 @@
</property>
</action>
<action name="actionNext_Page">
+ <property name="icon">
+ <iconset theme="go-next-view-page" resource="resources.qrc">
+ <normaloff>:/icons/images/go-next-view-page.svgz</normaloff>:/icons/images/go-next-view-page.svgz</iconset>
+ </property>
<property name="text">
<string>Next Page</string>
</property>
@@ -264,6 +361,66 @@
<string>Continuous</string>
</property>
</action>
+ <action name="actionBack">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="icon">
+ <iconset resource="resources.qrc">
+ <normaloff>:/icons/images/go-previous-view.svgz</normaloff>:/icons/images/go-previous-view.svgz</iconset>
+ </property>
+ <property name="text">
+ <string>Back</string>
+ </property>
+ <property name="toolTip">
+ <string>back to previous view</string>
+ </property>
+ </action>
+ <action name="actionForward">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="icon">
+ <iconset resource="resources.qrc">
+ <normaloff>:/icons/images/go-next-view.svgz</normaloff>:/icons/images/go-next-view.svgz</iconset>
+ </property>
+ <property name="text">
+ <string>Forward</string>
+ </property>
+ <property name="toolTip">
+ <string>forward to next view</string>
+ </property>
+ </action>
+ <action name="actionFindNext">
+ <property name="icon">
+ <iconset theme="go-down" resource=".rcc/resources.qrc">
+ <normaloff>:/icons/images/go-down-search.svgz</normaloff>:/icons/images/go-down-search.svgz</iconset>
+ </property>
+ <property name="text">
+ <string>Find Next</string>
+ </property>
+ <property name="toolTip">
+ <string>Find the next occurrence of the phrase</string>
+ </property>
+ <property name="shortcut">
+ <string>F3</string>
+ </property>
+ </action>
+ <action name="actionFindPrevious">
+ <property name="icon">
+ <iconset theme="go-up" resource=".rcc/resources.qrc">
+ <normaloff>:/icons/images/go-up-search.svgz</normaloff>:/icons/images/go-up-search.svgz</iconset>
+ </property>
+ <property name="text">
+ <string>Find Previous</string>
+ </property>
+ <property name="toolTip">
+ <string>Find the previous occurrence of the phrase</string>
+ </property>
+ <property name="shortcut">
+ <string>Shift+F3</string>
+ </property>
+ </action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
diff --git a/examples/pdfwidgets/pdfviewer/pageselector.cpp b/examples/pdfwidgets/pdfviewer/pageselector.cpp
deleted file mode 100644
index cd3c4ba0e..000000000
--- a/examples/pdfwidgets/pdfviewer/pageselector.cpp
+++ /dev/null
@@ -1,111 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "pageselector.h"
-
-#include <QHBoxLayout>
-#include <QLabel>
-#include <QLineEdit>
-#include <QPdfPageNavigation>
-#include <QToolButton>
-
-PageSelector::PageSelector(QWidget *parent)
- : QWidget(parent)
- , m_pageNavigation(nullptr)
-{
- QHBoxLayout *layout = new QHBoxLayout(this);
-
- m_previousPageButton = new QToolButton(this);
- m_previousPageButton->setText("<");
- m_previousPageButton->setEnabled(false);
-
- m_pageNumberEdit = new QLineEdit(this);
- m_pageNumberEdit->setAlignment(Qt::AlignRight);
-
- m_pageCountLabel = new QLabel(this);
- m_pageCountLabel->setText("0");
-
- m_nextPageButton = new QToolButton(this);
- m_nextPageButton->setText(">");
- m_nextPageButton->setEnabled(false);
-
- layout->addWidget(m_previousPageButton);
- layout->addWidget(m_pageNumberEdit);
- layout->addWidget(m_pageCountLabel);
- layout->addWidget(m_nextPageButton);
-}
-
-void PageSelector::setPageNavigation(QPdfPageNavigation *pageNavigation)
-{
- m_pageNavigation = pageNavigation;
-
- connect(m_previousPageButton, &QToolButton::clicked, m_pageNavigation, &QPdfPageNavigation::goToPreviousPage);
- connect(m_pageNavigation, &QPdfPageNavigation::canGoToPreviousPageChanged, m_previousPageButton, &QToolButton::setEnabled);
-
- connect(m_pageNavigation, &QPdfPageNavigation::currentPageChanged, this, &PageSelector::onCurrentPageChanged);
- connect(m_pageNavigation, &QPdfPageNavigation::pageCountChanged, this, [this](int pageCount){ m_pageCountLabel->setText(QString::fromLatin1("/ %1").arg(pageCount)); });
-
- connect(m_pageNumberEdit, &QLineEdit::editingFinished, this, &PageSelector::pageNumberEdited);
-
- connect(m_nextPageButton, &QToolButton::clicked, m_pageNavigation, &QPdfPageNavigation::goToNextPage);
- connect(m_pageNavigation, &QPdfPageNavigation::canGoToNextPageChanged, m_nextPageButton, &QToolButton::setEnabled);
-
- onCurrentPageChanged(m_pageNavigation->currentPage());
-}
-
-void PageSelector::onCurrentPageChanged(int page)
-{
- if (m_pageNavigation->pageCount() == 0)
- m_pageNumberEdit->setText(QString::number(0));
- else
- m_pageNumberEdit->setText(QString::number(page + 1));
-}
-
-void PageSelector::pageNumberEdited()
-{
- if (!m_pageNavigation)
- return;
-
- const QString text = m_pageNumberEdit->text();
-
- bool ok = false;
- const int pageNumber = text.toInt(&ok);
-
- if (!ok)
- onCurrentPageChanged(m_pageNavigation->currentPage());
- else
- m_pageNavigation->setCurrentPage(qBound(0, pageNumber - 1, m_pageNavigation->pageCount() - 1));
-}
diff --git a/examples/pdfwidgets/pdfviewer/pageselector.h b/examples/pdfwidgets/pdfviewer/pageselector.h
deleted file mode 100644
index 7a7283f99..000000000
--- a/examples/pdfwidgets/pdfviewer/pageselector.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef PAGESELECTOR_H
-#define PAGESELECTOR_H
-
-#include <QWidget>
-
-QT_BEGIN_NAMESPACE
-class QLabel;
-class QLineEdit;
-class QPdfDocument;
-class QPdfPageNavigation;
-class QToolButton;
-QT_END_NAMESPACE
-
-class PageSelector : public QWidget
-{
- Q_OBJECT
-
-public:
- explicit PageSelector(QWidget *parent = nullptr);
-
- void setPageNavigation(QPdfPageNavigation *pageNavigation);
-
-private slots:
- void onCurrentPageChanged(int page);
- void pageNumberEdited();
-
-private:
- QPdfPageNavigation *m_pageNavigation;
-
- QLineEdit *m_pageNumberEdit;
- QLabel *m_pageCountLabel;
- QToolButton *m_previousPageButton;
- QToolButton *m_nextPageButton;
-};
-
-#endif // PAGESELECTOR_H
diff --git a/examples/pdfwidgets/pdfviewer/pdfviewer.pro b/examples/pdfwidgets/pdfviewer/pdfviewer.pro
index ad0607ea5..5e48edeb9 100644
--- a/examples/pdfwidgets/pdfviewer/pdfviewer.pro
+++ b/examples/pdfwidgets/pdfviewer/pdfviewer.pro
@@ -5,12 +5,12 @@ QT += core gui widgets pdfwidgets
SOURCES += \
main.cpp \
mainwindow.cpp \
- pageselector.cpp \
+ searchresultdelegate.cpp \
zoomselector.cpp
HEADERS += \
mainwindow.h \
- pageselector.h \
+ searchresultdelegate.h \
zoomselector.h
FORMS += \
diff --git a/examples/pdfwidgets/pdfviewer/resources.qrc b/examples/pdfwidgets/pdfviewer/resources.qrc
index 02d9655b4..ea408b825 100644
--- a/examples/pdfwidgets/pdfviewer/resources.qrc
+++ b/examples/pdfwidgets/pdfviewer/resources.qrc
@@ -1,12 +1,13 @@
<RCC>
<qresource prefix="/icons">
- <file>images/fileopen.png</file>
- <file>images/go-next-24.png</file>
- <file>images/go-previous-24.png</file>
- <file>images/zoom-in-24.png</file>
- <file>images/zoom-in-32.png</file>
- <file>images/zoom-out-24.png</file>
- <file>images/zoom-out-32.png</file>
- <file>images/busy.png</file>
+ <file>images/document-open.svgz</file>
+ <file>images/go-down-search.svgz</file>
+ <file>images/go-next-view.svgz</file>
+ <file>images/go-previous-view.svgz</file>
+ <file>images/go-next-view-page.svgz</file>
+ <file>images/go-previous-view-page.svgz</file>
+ <file>images/go-up-search.svgz</file>
+ <file>images/zoom-in.svgz</file>
+ <file>images/zoom-out.svgz</file>
</qresource>
</RCC>
diff --git a/examples/pdfwidgets/pdfviewer/searchresultdelegate.cpp b/examples/pdfwidgets/pdfviewer/searchresultdelegate.cpp
new file mode 100644
index 000000000..87efd916d
--- /dev/null
+++ b/examples/pdfwidgets/pdfviewer/searchresultdelegate.cpp
@@ -0,0 +1,46 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include <QFontMetrics>
+#include <QPainter>
+#include <QPdfSearchModel>
+
+#include "searchresultdelegate.h"
+
+SearchResultDelegate::SearchResultDelegate(QObject *parent)
+ : QStyledItemDelegate(parent)
+{
+}
+
+void SearchResultDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
+ const QModelIndex &index) const
+{
+ const QString displayText = index.data().toString();
+ const auto boldBegin = displayText.indexOf(u"<b>", 0, Qt::CaseInsensitive) + 3;
+ const auto boldEnd = displayText.indexOf(u"</b>", boldBegin, Qt::CaseInsensitive);
+ if (boldBegin >= 3 && boldEnd > boldBegin) {
+ const QString pageLabel = tr("Page %1: ").arg(index.data(int(QPdfSearchModel::Role::Page)).toInt());
+ const QString boldText = displayText.mid(boldBegin, boldEnd - boldBegin);
+ if (option.state & QStyle::State_Selected)
+ painter->fillRect(option.rect, option.palette.highlight());
+ const QFont defaultFont = painter->font();
+ QFontMetrics fm = painter->fontMetrics();
+ auto pageLabelWidth = fm.horizontalAdvance(pageLabel);
+ const int yOffset = (option.rect.height() - fm.height()) / 2 + fm.ascent();
+ painter->drawText(0, option.rect.y() + yOffset, pageLabel);
+ QFont boldFont = defaultFont;
+ boldFont.setBold(true);
+ auto boldWidth = QFontMetrics(boldFont).horizontalAdvance(boldText);
+ auto prefixSuffixWidth = (option.rect.width() - pageLabelWidth - boldWidth) / 2;
+ painter->setFont(boldFont);
+ painter->drawText(pageLabelWidth + prefixSuffixWidth, option.rect.y() + yOffset, boldText);
+ painter->setFont(defaultFont);
+ const QString suffix = fm.elidedText(displayText.mid(boldEnd + 4), Qt::ElideRight, prefixSuffixWidth);
+ painter->drawText(pageLabelWidth + prefixSuffixWidth + boldWidth, option.rect.y() + yOffset, suffix);
+ const QString prefix = fm.elidedText(displayText.left(boldBegin - 3), Qt::ElideLeft, prefixSuffixWidth);
+ painter->drawText(pageLabelWidth + prefixSuffixWidth - fm.horizontalAdvance(prefix),
+ option.rect.y() + yOffset, prefix);
+ } else {
+ QStyledItemDelegate::paint(painter, option, index);
+ }
+}
diff --git a/examples/pdfwidgets/pdfviewer/searchresultdelegate.h b/examples/pdfwidgets/pdfviewer/searchresultdelegate.h
new file mode 100644
index 000000000..dcf886111
--- /dev/null
+++ b/examples/pdfwidgets/pdfviewer/searchresultdelegate.h
@@ -0,0 +1,20 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#ifndef SEARCHRESULTDELEGATE_H
+#define SEARCHRESULTDELEGATE_H
+
+#include <QStyledItemDelegate>
+
+//! [0]
+class SearchResultDelegate : public QStyledItemDelegate
+{
+ Q_OBJECT
+public:
+ SearchResultDelegate(QObject *parent = nullptr);
+
+ void paint(QPainter *painter, const QStyleOptionViewItem &option,
+ const QModelIndex &index) const override;
+};
+
+#endif // SEARCHRESULTDELEGATE_H
diff --git a/examples/pdfwidgets/pdfviewer/zoomselector.cpp b/examples/pdfwidgets/pdfviewer/zoomselector.cpp
index 0205489aa..0b314129a 100644
--- a/examples/pdfwidgets/pdfviewer/zoomselector.cpp
+++ b/examples/pdfwidgets/pdfviewer/zoomselector.cpp
@@ -1,38 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "zoomselector.h"
@@ -57,7 +24,7 @@ ZoomSelector::ZoomSelector(QWidget *parent)
addItem(QLatin1String("200%"));
addItem(QLatin1String("400%"));
- connect(this, static_cast<void(QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
+ connect(this, &QComboBox::currentTextChanged,
this, &ZoomSelector::onCurrentTextChanged);
connect(lineEdit(), &QLineEdit::editingFinished,
@@ -77,9 +44,9 @@ void ZoomSelector::reset()
void ZoomSelector::onCurrentTextChanged(const QString &text)
{
if (text == QLatin1String("Fit Width")) {
- emit zoomModeChanged(QPdfView::FitToWidth);
+ emit zoomModeChanged(QPdfView::ZoomMode::FitToWidth);
} else if (text == QLatin1String("Fit Page")) {
- emit zoomModeChanged(QPdfView::FitInView);
+ emit zoomModeChanged(QPdfView::ZoomMode::FitInView);
} else {
qreal factor = 1.0;
@@ -91,7 +58,7 @@ void ZoomSelector::onCurrentTextChanged(const QString &text)
if (ok)
factor = zoomLevel / 100.0;
- emit zoomModeChanged(QPdfView::CustomZoom);
+ emit zoomModeChanged(QPdfView::ZoomMode::Custom);
emit zoomFactorChanged(factor);
}
}
diff --git a/examples/pdfwidgets/pdfviewer/zoomselector.h b/examples/pdfwidgets/pdfviewer/zoomselector.h
index c58d09970..7c35bdab7 100644
--- a/examples/pdfwidgets/pdfviewer/zoomselector.h
+++ b/examples/pdfwidgets/pdfviewer/zoomselector.h
@@ -1,38 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef ZOOMSELECTOR_H
#define ZOOMSELECTOR_H
diff --git a/examples/webengine/customdialogs/MessageRectangle.qml b/examples/webengine/customdialogs/MessageRectangle.qml
deleted file mode 100644
index d5a4621cc..000000000
--- a/examples/webengine/customdialogs/MessageRectangle.qml
+++ /dev/null
@@ -1,65 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-Rectangle {
- property alias text: messageText.text
- width: parent.width
- height: 30
- visible: false
- color: "#80c342"
- Text {
- id: messageText
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- font.pointSize: 12
- }
-}
diff --git a/examples/webengine/customdialogs/SwitchButton.qml b/examples/webengine/customdialogs/SwitchButton.qml
deleted file mode 100644
index bb9a344f5..000000000
--- a/examples/webengine/customdialogs/SwitchButton.qml
+++ /dev/null
@@ -1,70 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtQuick.Controls 1.4 as Controls
-import QtQuick.Layouts 1.3
-
-Item {
- width: parent.width
- height: 40
- property alias checked: switcher.checked
- RowLayout {
- anchors.centerIn: parent
- Text {
- text: qsTr("Use default dialogs")
- font.pointSize: 12
- }
- Controls.Switch {
- id: switcher
- checked: true
- }
- }
-}
diff --git a/examples/webengine/customdialogs/WebView.qml b/examples/webengine/customdialogs/WebView.qml
deleted file mode 100644
index d754ea7dc..000000000
--- a/examples/webengine/customdialogs/WebView.qml
+++ /dev/null
@@ -1,153 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtWebEngine 1.10
-
-WebEngineView {
-
- url: "qrc:/index.html"
- property bool useDefaultDialogs: true
- signal openForm(var form)
-
- Rectangle {
- id: tooltip
- width: 200
- height: 30
- z: 50
- visible: false
- color: "gray"
- border.color: "black"
- border.width: 2
- radius: 3
-
- property string text: ""
-
- Text {
- x: 0
- y: 0
- color: "#ffffff"
- text: parent.text
- font.pointSize: 12
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- font.bold: false
- }
-
- }
-
- onContextMenuRequested: function(request) {
- // we only show menu for links with #openMenu
- if (!request.linkUrl.toString().endsWith("#openMenu")) {
- request.accepted = true;
- return;
- }
- // return early to show default menu
- if (useDefaultDialogs)
- return;
-
- request.accepted = true;
- openForm({item: Qt.resolvedUrl("forms/Menu.qml"),
- properties: {"request": request}});
- }
-
- onTooltipRequested: function(request) {
- if (useDefaultDialogs)
- return;
-
- if (request.type == TooltipRequest.Show) {
- tooltip.visible = true;
- tooltip.x = request.x;
- tooltip.y = request.y;
- tooltip.text = request.text;
- } else {
- tooltip.visible = false;
- }
-
- request.accepted = true;
- }
-
- onAuthenticationDialogRequested: function(request) {
- if (useDefaultDialogs)
- return;
-
- request.accepted = true;
- openForm({item: Qt.resolvedUrl("forms/Authentication.qml"),
- properties: {"request": request}});
- }
-
- onJavaScriptDialogRequested: function(request) {
- if (useDefaultDialogs)
- return;
-
- request.accepted = true;
- openForm({item: Qt.resolvedUrl("forms/JavaScript.qml"),
- properties: {"request": request}});
- }
-
- onColorDialogRequested: function(request) {
- if (useDefaultDialogs)
- return;
-
- request.accepted = true;
- openForm({item: Qt.resolvedUrl("forms/ColorPicker.qml"),
- properties: {"request": request}});
- }
-
- onFileDialogRequested: function(request) {
- if (useDefaultDialogs)
- return;
-
- request.accepted = true;
- openForm({item: Qt.resolvedUrl("forms/FilePicker.qml"),
- properties: {"request": request}});
-
- }
-}
diff --git a/examples/webengine/customdialogs/customdialogs.pro b/examples/webengine/customdialogs/customdialogs.pro
deleted file mode 100644
index 5861f3af7..000000000
--- a/examples/webengine/customdialogs/customdialogs.pro
+++ /dev/null
@@ -1,18 +0,0 @@
-QT += webengine
-
-HEADERS += \
- server.h
-
-SOURCES += \
- main.cpp \
- server.cpp
-
-RESOURCES += \
- customdialogs.qrc
-
-target.path = $$[QT_INSTALL_EXAMPLES]/webengine/customdialogs
-INSTALLS += target
-
-qtHaveModule(widgets) {
- QT += widgets # QApplication is required to get native styling with QtQuickControls
-}
diff --git a/examples/webengine/customdialogs/customdialogs.qrc b/examples/webengine/customdialogs/customdialogs.qrc
deleted file mode 100644
index 5ab5b11cd..000000000
--- a/examples/webengine/customdialogs/customdialogs.qrc
+++ /dev/null
@@ -1,24 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>forms/AuthenticationForm.ui.qml</file>
- <file>forms/Authentication.qml</file>
- <file>forms/Button.qml</file>
- <file>forms/ColorCell.qml</file>
- <file>forms/ColorPickerForm.ui.qml</file>
- <file>forms/ColorPicker.qml</file>
- <file>forms/FilePickerForm.ui.qml</file>
- <file>forms/FilePicker.qml</file>
- <file>forms/FileRow.qml</file>
- <file>forms/JavaScriptForm.ui.qml</file>
- <file>forms/JavaScript.qml</file>
- <file>forms/MenuForm.ui.qml</file>
- <file>forms/Menu.qml</file>
- <file>icon.svg</file>
- <file>index.html</file>
- <file>main.qml</file>
- <file>MessageRectangle.qml</file>
- <file>style.css</file>
- <file>SwitchButton.qml</file>
- <file>WebView.qml</file>
- </qresource>
-</RCC>
diff --git a/examples/webengine/customdialogs/doc/images/customdialogs-auth1.png b/examples/webengine/customdialogs/doc/images/customdialogs-auth1.png
deleted file mode 100644
index 5e8f8d6bd..000000000
--- a/examples/webengine/customdialogs/doc/images/customdialogs-auth1.png
+++ /dev/null
Binary files differ
diff --git a/examples/webengine/customdialogs/doc/images/customdialogs-auth2.png b/examples/webengine/customdialogs/doc/images/customdialogs-auth2.png
deleted file mode 100644
index 41828d36d..000000000
--- a/examples/webengine/customdialogs/doc/images/customdialogs-auth2.png
+++ /dev/null
Binary files differ
diff --git a/examples/webengine/customdialogs/doc/images/customdialogs-color1.png b/examples/webengine/customdialogs/doc/images/customdialogs-color1.png
deleted file mode 100644
index 9208045b2..000000000
--- a/examples/webengine/customdialogs/doc/images/customdialogs-color1.png
+++ /dev/null
Binary files differ
diff --git a/examples/webengine/customdialogs/doc/images/customdialogs-color2.png b/examples/webengine/customdialogs/doc/images/customdialogs-color2.png
deleted file mode 100644
index 9087fdf14..000000000
--- a/examples/webengine/customdialogs/doc/images/customdialogs-color2.png
+++ /dev/null
Binary files differ
diff --git a/examples/webengine/customdialogs/doc/images/customdialogs-file1.png b/examples/webengine/customdialogs/doc/images/customdialogs-file1.png
deleted file mode 100644
index ba8bdf78c..000000000
--- a/examples/webengine/customdialogs/doc/images/customdialogs-file1.png
+++ /dev/null
Binary files differ
diff --git a/examples/webengine/customdialogs/doc/images/customdialogs-file2.png b/examples/webengine/customdialogs/doc/images/customdialogs-file2.png
deleted file mode 100644
index aa25579d7..000000000
--- a/examples/webengine/customdialogs/doc/images/customdialogs-file2.png
+++ /dev/null
Binary files differ
diff --git a/examples/webengine/customdialogs/doc/images/customdialogs-menu.png b/examples/webengine/customdialogs/doc/images/customdialogs-menu.png
deleted file mode 100644
index 3409c951c..000000000
--- a/examples/webengine/customdialogs/doc/images/customdialogs-menu.png
+++ /dev/null
Binary files differ
diff --git a/examples/webengine/customdialogs/doc/images/customdialogs-prompt1.png b/examples/webengine/customdialogs/doc/images/customdialogs-prompt1.png
deleted file mode 100644
index e36ba4a13..000000000
--- a/examples/webengine/customdialogs/doc/images/customdialogs-prompt1.png
+++ /dev/null
Binary files differ
diff --git a/examples/webengine/customdialogs/doc/images/customdialogs-prompt2.png b/examples/webengine/customdialogs/doc/images/customdialogs-prompt2.png
deleted file mode 100644
index 2c8d92649..000000000
--- a/examples/webengine/customdialogs/doc/images/customdialogs-prompt2.png
+++ /dev/null
Binary files differ
diff --git a/examples/webengine/customdialogs/doc/images/customdialogs-tooltip.png b/examples/webengine/customdialogs/doc/images/customdialogs-tooltip.png
deleted file mode 100644
index 498de9595..000000000
--- a/examples/webengine/customdialogs/doc/images/customdialogs-tooltip.png
+++ /dev/null
Binary files differ
diff --git a/examples/webengine/customdialogs/doc/images/customdialogs.png b/examples/webengine/customdialogs/doc/images/customdialogs.png
deleted file mode 100644
index c42114a16..000000000
--- a/examples/webengine/customdialogs/doc/images/customdialogs.png
+++ /dev/null
Binary files differ
diff --git a/examples/webengine/customdialogs/doc/src/customdialogs.qdoc b/examples/webengine/customdialogs/doc/src/customdialogs.qdoc
deleted file mode 100644
index 16eab0b6c..000000000
--- a/examples/webengine/customdialogs/doc/src/customdialogs.qdoc
+++ /dev/null
@@ -1,333 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \example webengine/customdialogs
- \title WebEngine Qt Quick Custom Dialogs Example
- \ingroup webengine-examples
- \brief Customizes UI elements of \QWE's dialogs.
-
- \image customdialogs.png
-
- A web page might request dialogs for various purposes, such as
- authentication, picking colors, choosing files, and responding to JavaScript
- alerts, confirmation requests, and prompts.
-
- \e {Custom Dialogs} demonstrates how to use WebEngine dialog request objects
- to implement custom dialogs for use instead of the default dialogs.
-
- \include examples-run.qdocinc
-
- \section1 UI Elements of WebEngineView
-
- In this example, we create a simple \c index.html page that contains buttons
- and text fields for triggering a context menu and the following dialogs:
-
- \list
- \li HTTP Authentication Dialog
- \li Proxy Authentication Dialog
- \li JavaScript Alert, Confirm, and Prompt Dialogs
- \li Color Picker Dialog
- \li File Picker Dialog
- \endlist
-
- \section1 Triggering Dialogs
-
- As mentioned, the \c index.html file is responsible for triggering the
- dialogs from the side of HTML and JavaScript. Additionally, the example
- program starts a localhost TCP server returning the mocked HTTP responses
- needed to trigger proxy and HTTP authentication dialogs.
-
- \section1 Custom Dialogs
-
- The custom dialogs are just \e {Qt Quick Designer UI Forms} without any
- business logic. The point here is to present the glue code that is required
- to display the custom dialog for a particular web engine dialog or a menu
- request.
-
- \section1 Creating the Main Window
-
- In \c main.cpp, we initialize the WebEngine the same way as in the
- \l {WebEngine Qt Quick Minimal Example}:
-
- \quotefromfile webengine/customdialogs/main.cpp
- \skipto main
- \printuntil }
-
- In addition, we set up a proxy and a TCP server to be able to simulate proxy
- and HTTP authetication requests.
-
- In \c main.qml, we create a top level window, which contains a StackView
- with a SwitchButton and a WebView:
-
- \quotefromfile webengine/customdialogs/main.qml
- \skipto Window
- \printuntil Component
- \printuntil }
- \printline }
-
- \section1 Handling Web Engine Requests
-
- In this example, we implement the handling of the following web engine
- requests:
-
- \list
- \li ContextMenuRequest
- \li AuthenticationDialogRequest
- \li JavaScriptDialogRequest
- \li ColorDialogRequest
- \li FileDialogRequest
- \endlist
-
- \section2 Context Menu Requests
-
- \l [QML]{ContextMenuRequest} is a request object that is passed as a
- parameter of the WebEngineView::contextMenuRequested signal. We use the
- \c onContextMenuRequested signal handler to handle requests for
- \c #openMenu URL links:
-
- \quotefromfile webengine/customdialogs/WebView.qml
- \skipto WebEngineView
- \printuntil {
- \dots 4
- \skipto onContextMenuRequested
- \printuntil }
- \printuntil }
- \printuntil }
- \dots 4
- \skipuntil onFileDialogRequested
- \skipuntil }});
- \skipuntil }
- \skipto }
- \printline }
-
- The first text field from the top on our page triggers the request. Next,
- we check whether we should use the default menu. If not, we accept the
- request and switch the view to show the \c MenuForm:
-
- \image customdialogs-menu.png
-
- \quotefromfile webengine/customdialogs/forms/Menu.qml
- \skipto MenuForm
- \printuntil }
- \printuntil }
-
- To keep things simple, we do not provide any logic on component completion,
- and we simply close the form on any action.
-
- \section2 Tooltip Requests
-
- \l [QML]{TooltipRequest} is a request object that is passed as a
- parameter of the WebEngineView::tooltipRequested signal. We use the
- \c onTooltipRequested signal handler to handle requests for
- custom tooltip menus at specific positions:
-
- \quotefromfile webengine/customdialogs/WebView.qml
- \skipto WebEngineView
- \printuntil {
- \dots 4
- \skipto onTooltipRequested
- \printuntil }
- \printuntil }
- \printuntil }
- \dots 4
- \skipuntil onFileDialogRequested
- \skipuntil }});
- \skipuntil }
- \skipto }
- \printline }
-
- The second text field from the top on our page triggers the request. Next,
- we check whether we should use the default menu. If not, we accept the
- request and show a custom QML element as tooltip:
-
- \image customdialogs-tooltip.png
-
- \quotefromfile webengine/customdialogs/WebView.qml
- \skipto Rectangle
- \printuntil }
-
- \section2 Authentication Dialog Requests
-
- \image customdialogs-auth1.png
-
- \l [QML]{AuthenticationDialogRequest} is a request object that is passed
- as a parameter of the WebEngineView::authenticationDialogRequested signal:
-
- \quotefromfile webengine/customdialogs/WebView.qml
- \skipto WebEngineView
- \printuntil {
- \dots 4
- \skipto onAuthenticationDialogRequested
- \printuntil }
- \printuntil }
- \dots 4
- \skipuntil onFileDialogRequested
- \skipuntil }});
- \skipuntil }
- \skipto }
- \printline }
-
- We use the \c onAuthenticationDialogRequested signal handler to check
- whether we should use the default authentication dialog. If not, we accept
- the request and switch the view to show the \c AuthenticationForm:
-
- \image customdialogs-auth2.png
-
- \quotefromfile webengine/customdialogs/forms/Authentication.qml
- \skipto AuthenticationForm
- \printuntil }
- \printuntil }
- \printuntil }
- \printuntil }
- \printuntil }
-
- On component completion, we log the request type. The user can fill in the
- credentials and click \uicontrol Login. We provide \c onClicked handlers to
- accept or reject the authentication dialog. The TCP server on localhost does
- not handle real authentication, and therefore we call \c rejectDialog()
- instead of \c acceptDialog() also for the login button \c clicked signal.
-
- \section2 JavaScript Dialog Requests
-
- \image customdialogs-prompt1.png
-
- \l [QML]{JavaScriptDialogRequest} is a request object that is passed as a
- parameter of the WebEngineView::javaScriptDialogRequested signal:
-
- \quotefromfile webengine/customdialogs/WebView.qml
- \skipto WebEngineView
- \printuntil {
- \dots 4
- \skipto onJavaScriptDialogRequested
- \printuntil }
- \printuntil }
- \dots 4
- \skipuntil onFileDialogRequested
- \skipuntil }});
- \skipuntil }
- \skipto }
- \printline }
-
- We use the \c onJavaScriptDialogRequested signal handler to check
- whether we should use the default JavaScript dialog. If not, we accept the
- request and switch the view to show the \c JavaScriptForm:
-
- \image customdialogs-prompt2.png
-
- \quotefromfile webengine/customdialogs/forms/JavaScript.qml
- \skipto JavaScriptForm
- \printuntil }
- \printuntil }
- \printuntil }
- \printuntil }
- \printuntil }
-
- On component completion, we customize the form based on the request type.
- For a JavaScript prompt dialog we use \c dialogAccept() with the
- \c prompt.text argument.
-
- \section2 Color Dialog Requests
-
- \image customdialogs-color1.png
-
- \l [QML]{ColorDialogRequest} is a request object that is passed as a
- parameter of the WebEngineView::colorDialogRequested signal:
-
- \quotefromfile webengine/customdialogs/WebView.qml
- \skipto WebEngineView
- \printuntil {
- \dots 4
- \skipto onColorDialogRequested
- \printuntil }
- \printuntil }
- \dots 4
- \skipuntil onFileDialogRequested
- \skipuntil }});
- \skipuntil }
- \skipto }
- \printline }
-
- We use the \c onColorDialogRequested signal handler to check whether
- we should use the default color picker dialog. If not, we accept the request
- and switch the view to show the \c ColorPickerForm:
-
- \image customdialogs-color2.png
-
- \quotefromfile webengine/customdialogs/forms/ColorPicker.qml
- \skipto ColorPickerForm
- \printuntil }
- \printuntil }
- \printuntil }
- \printuntil }
- \printuntil }
- \printuntil }
- \printuntil }
-
- On component completion, we create callbacks for all the color cells. When
- the user selects the color and clicks \c OK, we pass the selected color to
- the \c dialogAccept() method.
-
- \section2 File Dialog Requests
-
- \image customdialogs-file1.png
-
- \l [QML]{FileDialogRequest} is a request object that is passed as a
- parameter of the WebEngineView::fileDialogRequested signal:
-
- \quotefromfile webengine/customdialogs/WebView.qml
- \skipto WebEngineView
- \printuntil {
- \dots 4
- \skipto onFileDialogRequested
- \printuntil }
- \printuntil }
- \printuntil }
-
- We use the \c onFileDialogRequested signal handler to check whether
- we should use the default color picker dialog. If not, we accept the request
- and switch the view to show the \c FilePickerForm:
-
- \image customdialogs-file2.png
-
- \quotefromfile webengine/customdialogs/forms/FilePicker.qml
- \skipto FilePickerForm
- \printuntil }
- \printuntil }
- \printuntil }
- \printuntil }
- \printuntil }
- \printuntil }
- \printuntil }
- \printuntil }
- \printuntil }
-
- On component completion, we create callbacks for selecting files. When the user selects a
- file and clicks \c OK, we pass the selected file to the \c dialogAccept
- method.
-
-*/
diff --git a/examples/webengine/customdialogs/forms/Authentication.qml b/examples/webengine/customdialogs/forms/Authentication.qml
deleted file mode 100644
index e8995eebc..000000000
--- a/examples/webengine/customdialogs/forms/Authentication.qml
+++ /dev/null
@@ -1,78 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.4
-import QtWebEngine 1.4
-
-AuthenticationForm {
- property QtObject request
- signal closeForm()
-
- cancelButton.onClicked: {
- request.dialogReject();
- closeForm();
- }
-
- loginButton.onClicked: {
- request.dialogReject();
- closeForm();
- }
-
- Component.onCompleted: {
- switch (request.type) {
- case AuthenticationDialogRequest.AuthenticationTypeHTTP:
- console.log("HTTP Authentication Required. Host says: " + request.realm);
- break;
- case AuthenticationDialogRequest.AuthenticationTypeProxy:
- console.log("Proxy Authentication Required for: " + request.proxyHost);
- break;
- }
- }
-}
diff --git a/examples/webengine/customdialogs/forms/AuthenticationForm.ui.qml b/examples/webengine/customdialogs/forms/AuthenticationForm.ui.qml
deleted file mode 100644
index 8b8523388..000000000
--- a/examples/webengine/customdialogs/forms/AuthenticationForm.ui.qml
+++ /dev/null
@@ -1,171 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.4
-import QtQuick.Layouts 1.3
-import QtQuick.Controls 1.0 as Controls
-
-Item {
- id: item1
- property alias cancelButton: cancelButton
- property alias loginButton: loginButton
- property alias userName: userName
- property alias password: password
-
- ColumnLayout {
- id: columnLayout
- anchors.topMargin: 20
- anchors.top: parent.top
- anchors.bottomMargin: 20
- anchors.bottom: parent.bottom
- anchors.rightMargin: 20
- anchors.right: parent.right
- anchors.leftMargin: 20
- anchors.left: parent.left
-
- Image {
- id: image
- Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
- source: "qrc:/icon.svg"
- }
-
- Rectangle {
- id: rectangle
- height: 30
- anchors.rightMargin: 0
- anchors.leftMargin: 0
- anchors.right: parent.right
- anchors.left: parent.left
- gradient: Gradient {
- GradientStop {
- position: 0
- color: "#25a6e2"
- }
- GradientStop {
- color: "#188bd0"
- }
- }
-
- Text {
- id: textArea
- x: 54
- y: 5
- color: "#ffffff"
- text: qsTr("Restricted Area")
- font.pointSize: 12
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- }
- }
-
- Item {
- width: 40
- height: 40
- }
-
- Text {
- id: userNameText
- text: qsTr("Username:")
- font.pointSize: 12
- }
-
- Controls.TextField {
- id: userName
- width: 300
- height: 22
- Layout.fillWidth: true
- font.pointSize: 12
- }
-
- Text {
- id: passwordText
- text: qsTr("Password:")
- font.pointSize: 12
- }
-
- Controls.TextField {
- id: password
- width: 300
- height: 26
- Layout.fillWidth: true
- font.pointSize: 12
- }
-
- Item {
- Layout.fillHeight: true
- }
-
- RowLayout {
- id: rowLayout
- width: 100
- height: 100
-
- Item {
- Layout.fillWidth: true
- }
-
- Button {
- id: cancelButton
- width: 90
- height: 30
- btnText: qsTr("Cancel")
- btnBlue: false
- }
-
- Button {
- id: loginButton
- width: 90
- height: 30
- btnText: qsTr("Login")
- btnBlue: false
- }
- }
- }
-}
diff --git a/examples/webengine/customdialogs/forms/Button.qml b/examples/webengine/customdialogs/forms/Button.qml
deleted file mode 100644
index 474f514d2..000000000
--- a/examples/webengine/customdialogs/forms/Button.qml
+++ /dev/null
@@ -1,108 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.4
-
-Rectangle {
- id: root
- width: 200
- height: 30
- radius: 5
- property string btnText: "Name"
- property bool btnEnable: true
- property bool btnBlue: true
- opacity: btnEnable ? 1.0 : 0.5
- signal clicked()
- gradient: btnBlue ? blueButton : greenButton
- Text {
- id: textArea
- x: 54
- y: 5
- color: "#ffffff"
- text: parent.btnText
- font.pointSize: 12
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- font.bold: false
- }
-
- MouseArea {
- id: mouseArea
- anchors.fill: parent
- onClicked: {
- if (btnEnable)
- root.clicked();
- }
- }
-
- Gradient {
- id: blueButton
- GradientStop {
- position: 0
- color: "#25a6e2"
- }
- GradientStop {
- position: mouseArea.pressed && root.btnEnable ? 0.7 :1
- color: "#188bd0"
- }
- }
-
- Gradient {
- id: greenButton
- GradientStop {
- position: 0
- color: "#80c342"
- }
- GradientStop {
- position: mouseArea.pressed && root.btnEnable ? 0.7 :1
- color: "#5fac18"
- }
- }
-}
diff --git a/examples/webengine/customdialogs/forms/ColorCell.qml b/examples/webengine/customdialogs/forms/ColorCell.qml
deleted file mode 100644
index 0da029357..000000000
--- a/examples/webengine/customdialogs/forms/ColorCell.qml
+++ /dev/null
@@ -1,63 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.4
-
-Rectangle {
- id: rectangle
- width: 50
- height: 50
- signal clicked()
- MouseArea {
- id: mouseArea
- anchors.fill: parent
- onClicked: rectangle.clicked(color)
- }
-}
diff --git a/examples/webengine/customdialogs/forms/ColorPicker.qml b/examples/webengine/customdialogs/forms/ColorPicker.qml
deleted file mode 100644
index 6684db2c6..000000000
--- a/examples/webengine/customdialogs/forms/ColorPicker.qml
+++ /dev/null
@@ -1,78 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.4
-
-ColorPickerForm {
- property QtObject request
- signal closeForm()
-
- okButton.onClicked: {
- request.dialogAccept(colorPicker.color);
- closeForm();
- }
-
- cancelButton.onClicked: {
- request.dialogReject();
- closeForm();
- }
-
- function createCallback(color) {
- return function() { colorPicker.color = color };
- }
-
- Component.onCompleted:{
- for (var i = 0; i < grid.children.length; i++) {
- var cell = grid.children[i];
- cell.clicked.connect(createCallback(cell.color));
- }
- colorPicker.color = request.color;
- }
-}
diff --git a/examples/webengine/customdialogs/forms/ColorPickerForm.ui.qml b/examples/webengine/customdialogs/forms/ColorPickerForm.ui.qml
deleted file mode 100644
index 611244867..000000000
--- a/examples/webengine/customdialogs/forms/ColorPickerForm.ui.qml
+++ /dev/null
@@ -1,235 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.4
-import QtQuick.Layouts 1.3
-
-Item {
- property alias cancelButton: cancelButton
- property alias okButton: okButton
- property string message: "Message"
- property string title: "Title"
- property alias blue1: blue1
- property alias grid: grid
- property alias colorPicker: colorPicker
-
- ColumnLayout {
- id: columnLayout
- anchors.topMargin: 20
- anchors.top: parent.top
- anchors.bottomMargin: 20
- anchors.bottom: parent.bottom
- anchors.rightMargin: 20
- anchors.right: parent.right
- anchors.leftMargin: 20
- anchors.left: parent.left
-
- Image {
- Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
- source: "qrc:/icon.svg"
- }
-
- Rectangle {
- height: 30
- anchors.rightMargin: 0
- anchors.leftMargin: 0
- anchors.right: parent.right
- anchors.left: parent.left
- gradient: Gradient {
- GradientStop {
- position: 0
- color: "#25a6e2"
- }
-
- GradientStop {
- color: "#188bd0"
- }
- }
-
- Text {
- id: title
- x: 54
- y: 5
- color: "#ffffff"
- text: qsTr("Select Color")
- font.pointSize: 12
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- }
- }
-
- Item {
- width: 40
- height: 40
- }
-
- GridLayout {
- id: grid
- columns: 5
- Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
-
- ColorCell {
- id: blue1
- color: "#26d5f8"
- }
- ColorCell {
- id: green1
- color: "#25f93d"
- }
- ColorCell {
- id: red1
- color: "#f71111"
- }
- ColorCell {
- id: yellow1
- color: "#faf23c"
- }
- ColorCell {
- id: orange1
- color: "#ec8505"
- }
- ColorCell {
- id: blue2
- color: "#037eaa"
- }
- ColorCell {
- id: green2
- color: "#389a13"
- }
- ColorCell {
- id: red2
- color: "#b2001b"
- }
- ColorCell {
- id: yellow2
- color: "#caca03"
- }
- ColorCell {
- id: orange2
- color: "#bb4900"
- }
- ColorCell {
- id: blue3
- color: "#01506c"
- }
- ColorCell {
- id: green3
- color: "#37592b"
- }
- ColorCell {
- id: red3
- color: "#700113"
- }
- ColorCell {
- id: yellow3
- color: "#848404"
- }
-
- ColorCell {
- id: orange3
- color: "#563100"
- }
- }
-
- Item {
- width: 10
- height: 10
- }
-
- Rectangle {
- width: 90
- height: 90
- color: "#000000"
- radius: 4
- Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
-
- Rectangle {
- id: colorPicker
- height: 80
- color: "#ffffff"
- anchors.rightMargin: 5
- anchors.leftMargin: 5
- anchors.bottomMargin: 5
- anchors.topMargin: 5
- anchors.fill: parent
- }
- }
-
- Item {
- Layout.fillHeight: true
- }
-
- RowLayout {
- id: rowLayout
- width: 100
- height: 100
-
- Item {
- Layout.fillWidth: true
- }
-
- Button {
- id: cancelButton
- width: 90
- height: 30
- btnText: qsTr("Cancel")
- btnBlue: false
- }
-
- Button {
- id: okButton
- width: 90
- height: 30
- btnText: qsTr("OK")
- btnBlue: false
- }
- }
- }
-}
diff --git a/examples/webengine/customdialogs/forms/FilePicker.qml b/examples/webengine/customdialogs/forms/FilePicker.qml
deleted file mode 100644
index 77a9c604c..000000000
--- a/examples/webengine/customdialogs/forms/FilePicker.qml
+++ /dev/null
@@ -1,91 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.4
-
-FilePickerForm {
- property QtObject request
- property string selectedFile
- signal closeForm()
-
- cancelButton.onClicked: {
- request.dialogReject();
- closeForm();
- }
-
- okButton.onClicked: {
- request.dialogAccept('/' + selectedFile);
- closeForm();
- }
-
- function createCallback(fileIndex) {
- return function() {
- for (var i = 0; i < files.children.length; i++) {
- var file = files.children[i];
- if (i === fileIndex) {
- selectedFile = file.text;
- file.selected = true;
- } else {
- file.selected = false;
- }
- }
- }
- }
-
- Component.onCompleted: {
- selectedFile = request.defaultFileName;
- for (var i = 0; i < files.children.length; i++) {
- var file = files.children[i];
- file.clicked.connect(createCallback(i));
- if (file.text === selectedFile)
- file.selected = true;
- }
- }
-}
diff --git a/examples/webengine/customdialogs/forms/FilePickerForm.ui.qml b/examples/webengine/customdialogs/forms/FilePickerForm.ui.qml
deleted file mode 100644
index 9c69204b4..000000000
--- a/examples/webengine/customdialogs/forms/FilePickerForm.ui.qml
+++ /dev/null
@@ -1,177 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.4
-import QtQuick.Layouts 1.3
-
-Item {
- property alias cancelButton: cancelButton
- property alias okButton: okButton
- property string message: "Message"
- property string title: "Title"
- property alias files: files
-
- ColumnLayout {
- id: columnLayout
- anchors.topMargin: 20
- anchors.top: parent.top
- anchors.bottomMargin: 20
- anchors.bottom: parent.bottom
- anchors.rightMargin: 20
- anchors.right: parent.right
- anchors.leftMargin: 20
- anchors.left: parent.left
-
- Image {
- id: image
- Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
- source: "qrc:/icon.svg"
- }
-
- Rectangle {
- id: rectangle
- height: 30
- anchors.rightMargin: 0
- anchors.leftMargin: 0
- anchors.right: parent.right
- anchors.left: parent.left
- gradient: Gradient {
- GradientStop {
- position: 0
- color: "#25a6e2"
- }
-
- GradientStop {
- color: "#188bd0"
- }
- }
-
- Text {
- id: title
- x: 54
- y: 5
- color: "#ffffff"
- text: qsTr("Select File")
- font.pointSize: 12
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- }
- }
-
- Item {
- width: 40
- height: 40
- }
-
- ColumnLayout {
- id: files
-
- FileRow {
- id: filename1
- text: "example.qdoc"
- }
-
- FileRow {
- id: filename2
- text: "factory.cpp"
- }
-
- FileRow {
- id: filename3
- text: "index.html"
- }
-
- FileRow {
- id: filename4
- text: "main.qml"
- }
-
- FileRow {
- id: filename5
- text: "qt-logo.png"
- }
-
- FileRow {
- id: filename6
- text: "window.h"
- }
- }
-
- Item {
- Layout.fillHeight: true
- }
-
- RowLayout {
- id: rowLayout
- width: 20
- height: 100
-
- Item {
- Layout.fillWidth: true
- }
-
- Button {
- id: cancelButton
- width: 90
- height: 30
- btnText: qsTr("Cancel")
- btnBlue: false
- }
-
- Button {
- id: okButton
- width: 90
- height: 30
- btnText: qsTr("OK")
- btnBlue: false
- }
- }
- }
-}
diff --git a/examples/webengine/customdialogs/forms/FileRow.qml b/examples/webengine/customdialogs/forms/FileRow.qml
deleted file mode 100644
index 6946c633d..000000000
--- a/examples/webengine/customdialogs/forms/FileRow.qml
+++ /dev/null
@@ -1,92 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.4
-import QtQuick.Layouts 1.3
-import QtQuick.Controls 1.0 as Controls
-
-Item {
- id: root
- height: 30
- property string text: "Filename"
- property bool selected: false
- signal clicked()
-
- RowLayout {
- id: fileRow
- width: 100
-
- Item {
- id: item5
- width: 10
- height: 10
- }
-
- Rectangle {
- id: rectangle2
- width: 10
- height: 10
- color: selected ? "#80c342" : "#25a6e2"
- }
-
- Text {
- id: filename
- text: root.text
- font.pointSize: 12
- }
- }
-
- MouseArea {
- id: mouseArea
- width: 200
- height: 30
- onClicked: root.clicked()
- }
-}
diff --git a/examples/webengine/customdialogs/forms/JavaScript.qml b/examples/webengine/customdialogs/forms/JavaScript.qml
deleted file mode 100644
index 08d0227dc..000000000
--- a/examples/webengine/customdialogs/forms/JavaScript.qml
+++ /dev/null
@@ -1,91 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.4
-import QtWebEngine 1.4
-
-JavaScriptForm {
- property QtObject request
- signal closeForm()
-
- cancelButton.onClicked: {
- request.dialogReject();
- closeForm();
- }
-
- okButton.onClicked: {
- request.dialogAccept(prompt.text);
- closeForm();
- }
-
- Component.onCompleted: {
- switch (request.type) {
- case JavaScriptDialogRequest.DialogTypeAlert:
- cancelButton.visible = false;
- title = qsTr("Alert");
- message = request.message;
- prompt.text = "";
- prompt.visible = false;
- break;
- case JavaScriptDialogRequest.DialogTypeConfirm:
- title = qsTr("Confirm");
- message = request.message;
- prompt.text = "";
- prompt.visible = false;
- break;
- case JavaScriptDialogRequest.DialogTypePrompt:
- title = qsTr("Prompt");
- message = request.message;
- prompt.text = request.defaultText;
- prompt.visible = true;
- break;
- }
- }
-}
diff --git a/examples/webengine/customdialogs/forms/JavaScriptForm.ui.qml b/examples/webengine/customdialogs/forms/JavaScriptForm.ui.qml
deleted file mode 100644
index 1c7fd29ed..000000000
--- a/examples/webengine/customdialogs/forms/JavaScriptForm.ui.qml
+++ /dev/null
@@ -1,159 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.4
-import QtQuick.Layouts 1.3
-import QtQuick.Controls 1.0 as Controls
-
-Item {
- id: item
- property alias cancelButton: cancelButton
- property alias okButton: okButton
- property string message: "Message"
- property string title: "Title"
- property alias prompt: prompt
-
- ColumnLayout {
- id: columnLayout
- anchors.topMargin: 20
- anchors.top: parent.top
- anchors.bottomMargin: 20
- anchors.bottom: parent.bottom
- anchors.rightMargin: 20
- anchors.right: parent.right
- anchors.leftMargin: 20
- anchors.left: parent.left
-
- Image {
- id: image
- Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
- source: "qrc:/icon.svg"
- }
-
- Rectangle {
- id: rectangle
- height: 30
- anchors.rightMargin: 0
- anchors.leftMargin: 0
- anchors.right: parent.right
- anchors.left: parent.left
- gradient: Gradient {
- GradientStop {
- position: 0
- color: "#25a6e2"
- }
-
- GradientStop {
- color: "#188bd0"
- }
- }
-
- Text {
- id: title
- x: 54
- y: 5
- color: "#ffffff"
- text: qsTr("Title")
- font.pointSize: 12
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- }
- }
-
- Item {
- width: 40
- height: 40
- }
-
- Text {
- id: message
- text: item.message
- font.pointSize: 12
- }
-
- Controls.TextField {
- id: prompt
- width: 300
- height: 22
- Layout.fillWidth: true
- font.pointSize: 12
- }
-
- Item {
- Layout.fillHeight: true
- }
-
- RowLayout {
- id: rowLayout
- width: 100
- height: 100
-
- Item {
- Layout.fillWidth: true
- }
-
- Button {
- id: cancelButton
- width: 90
- height: 30
- btnText: qsTr("Cancel")
- btnBlue: false
- }
-
- Button {
- id: okButton
- width: 90
- height: 30
- btnText: qsTr("OK")
- btnBlue: false
- }
- }
- }
-}
diff --git a/examples/webengine/customdialogs/forms/Menu.qml b/examples/webengine/customdialogs/forms/Menu.qml
deleted file mode 100644
index f1b692e07..000000000
--- a/examples/webengine/customdialogs/forms/Menu.qml
+++ /dev/null
@@ -1,69 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.4
-
-MenuForm {
- property QtObject request
- signal closeForm()
-
- followLink.onClicked: closeForm()
- back.onClicked: closeForm()
- forward.onClicked: closeForm()
- reload.onClicked: closeForm()
- copyLinkUrl.onClicked: closeForm()
- saveLink.onClicked: closeForm()
- close.onClicked: closeForm()
-
- Component.onCompleted: {
- back.btnEnable = false;
- forward.btnEnable = false;
- }
-}
diff --git a/examples/webengine/customdialogs/forms/MenuForm.ui.qml b/examples/webengine/customdialogs/forms/MenuForm.ui.qml
deleted file mode 100644
index 6126f0623..000000000
--- a/examples/webengine/customdialogs/forms/MenuForm.ui.qml
+++ /dev/null
@@ -1,113 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.4
-import QtQuick.Layouts 1.3
-
-Item {
- property alias followLink: followLink
- property alias back: back
- property alias forward: forward
- property alias reload: reload
- property alias copyLinkUrl: copyLinkUrl
- property alias saveLink: saveLink
- property alias close: close
-
- ColumnLayout {
- id: columnLayout
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: parent.horizontalCenter
-
- Image {
- id: image
- width: 100
- height: 100
- Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
- source: "qrc:/icon.svg"
- }
-
- Button {
- id: followLink
- btnText: qsTr("Follow")
- }
-
- Button {
- id: back
- btnText: qsTr("Back")
- }
-
- Button {
- id: forward
- btnText: qsTr("Forward")
- }
-
- Button {
- id: reload
- btnText: qsTr("Reload")
- }
-
- Button {
- id: copyLinkUrl
- btnText: qsTr("Copy Link URL")
- }
-
- Button {
- id: saveLink
- btnText: qsTr("Save Link")
- }
-
- Button {
- id: close
- btnBlue: false
- btnText: qsTr("Close")
- }
-
- }
-}
diff --git a/examples/webengine/customdialogs/index.html b/examples/webengine/customdialogs/index.html
deleted file mode 100644
index 69c0e6b21..000000000
--- a/examples/webengine/customdialogs/index.html
+++ /dev/null
@@ -1,48 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta charset="utf-8">
- <title>Custom UI</title>
- <link rel="stylesheet" type="text/css" href="style.css">
- </head>
- <body>
- <table align="center">
- <tr>
- <td><div class="div"><a href="#openMenu" class="link">Right click on text to see link context menu</a></div></td>
- </tr>
- <tr>
- <td><div class="div"><p title="I am a tooltip.">Hover this text to display a tooltip</a></div></td>
- </tr>
- <tr>
- <td><button class="button" onclick="window.location = 'http://localhost.:5555/OPEN_AUTH'">
- Open Authentication Dialog</button></td>
- </tr>
- <tr>
- <td><button class="button" onclick="window.location = 'http://localhost.:5555/OPEN_PROXY'">
- Open Proxy Dialog</button></td>
- </tr>
- <tr>
- <td><button class="button" onclick="alert('This is the Alert Dialog !')">
- Open Alert Dialog</button></td>
- </tr>
- <tr>
- <td><button class="button" onclick="confirm('This is the Confirm Dialog.')">
- Open Confirm Dialog</button></td>
- </tr>
- <tr>
- <td><button class="button" onclick="prompt('Is this the Prompt Dialog ?', 'Yes')">
- Open Prompt Dialog</button></td>
- </tr>
- <tr>
- <td><button class="button" onclick="document.getElementById('colorpicker').click()">
- Open Color Dialog</button></td>
- </tr>
- <tr>
- <td><button class="button" onclick="document.getElementById('filepicker').click()">
- Open File Dialog</button></td>
- </tr>
- </table>
- <input type="color" id="colorpicker" value="#ff0000" style="visibility:hidden"/>
- <input type="file" id="filepicker" accept=".cpp, .html, .h, .png, .qdoc, .qml" style="visibility:hidden"/>
- </body>
-</html>
diff --git a/examples/webengine/customdialogs/main.cpp b/examples/webengine/customdialogs/main.cpp
deleted file mode 100644
index 5aad8affb..000000000
--- a/examples/webengine/customdialogs/main.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "server.h"
-#include <qtwebengineglobal.h>
-#include <QNetworkProxy>
-#include <QQmlApplicationEngine>
-#include <QTimer>
-
-#ifndef QT_NO_WIDGETS
-#include <QtWidgets/QApplication>
-// QApplication is required to get native styling with QtQuickControls
-typedef QApplication Application;
-#else
-#include <QtGui/QGuiApplication>
-typedef QGuiApplication Application;
-#endif
-
-int main(int argc, char *argv[])
-{
- QCoreApplication::setOrganizationName("QtExamples");
- QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
- QtWebEngine::initialize();
-
- Application app(argc, argv);
-
- QQmlApplicationEngine engine;
- Server *server = new Server(&engine);
-
- engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
- QTimer::singleShot(0, server, &Server::run);
-
- QNetworkProxy proxy;
- proxy.setType(QNetworkProxy::HttpProxy);
- proxy.setHostName("localhost");
- proxy.setPort(5555);
- QNetworkProxy::setApplicationProxy(proxy);
-
- return app.exec();
-}
-
diff --git a/examples/webengine/customdialogs/main.qml b/examples/webengine/customdialogs/main.qml
deleted file mode 100644
index 00fa016c6..000000000
--- a/examples/webengine/customdialogs/main.qml
+++ /dev/null
@@ -1,100 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtQuick.Controls 1.4 as Controls
-import QtQuick.Layouts 1.3
-import QtQuick.Window 2.0
-
-Window {
- width: 350
- height: 550
- visible: true
-
- Controls.StackView {
- id: stackView
- anchors.fill: parent
- focus: true
- initialItem: Item {
- id: main
- width: parent.width
- height: parent.height
- ColumnLayout {
- anchors.fill: parent
- SwitchButton {
- id: switcher
- Layout.fillWidth: true
- }
- WebView {
- id: webView
- useDefaultDialogs: switcher.checked
- Layout.fillWidth: true
- Layout.fillHeight: true
- }
- }
- }
-
- function closeForm()
- {
- pop(main);
- }
-
- function openForm(form)
- {
- push(form);
- currentItem.closeForm.connect(closeForm);
- }
-
- }
-
- Component.onCompleted: {
- webView.openForm.connect(stackView.openForm);
- }
-}
diff --git a/examples/webengine/customdialogs/server.cpp b/examples/webengine/customdialogs/server.cpp
deleted file mode 100644
index 39520e3b6..000000000
--- a/examples/webengine/customdialogs/server.cpp
+++ /dev/null
@@ -1,85 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "server.h"
-#include <QDataStream>
-#include <QTcpSocket>
-
-Server::Server(QObject *parent) : QObject(parent)
-{
- connect(&m_server, &QTcpServer::newConnection, this, &Server::handleNewConnection);
-}
-
-void Server::run()
-{
- if (!m_server.listen(QHostAddress::LocalHost, 5555))
- qWarning() << "Could not start the server -> http/proxy authentication dialog"
- " will not work. Error:" << m_server.errorString();
-}
-
-void Server::handleNewConnection()
-{
- QTcpSocket *socket = m_server.nextPendingConnection();
- connect(socket, &QAbstractSocket::disconnected, socket, &QObject::deleteLater);
- connect(socket, &QAbstractSocket::readyRead, this, &Server::handleReadReady);
-}
-
-void Server::handleReadReady()
-{
- QTcpSocket *socket = qobject_cast<QTcpSocket*>(sender());
- Q_ASSERT(socket);
- QByteArray msg = socket->readAll();
- if (msg.contains(QByteArrayLiteral("OPEN_AUTH")))
- socket->write("HTTP/1.1 401 Unauthorized\nWWW-Authenticate: "
- "Basic realm=\"Very Restricted Area\"\r\n\r\n");
- if (msg.contains(QByteArrayLiteral("OPEN_PROXY")))
- socket->write("HTTP/1.1 407 Proxy Auth Required\nProxy-Authenticate: "
- "Basic realm=\"Proxy requires authentication\"\r\n\r\n");
-}
diff --git a/examples/webengine/customdialogs/server.h b/examples/webengine/customdialogs/server.h
deleted file mode 100644
index 501aef533..000000000
--- a/examples/webengine/customdialogs/server.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef SERVER_H
-#define SERVER_H
-
-#include <QObject>
-#include <QTcpServer>
-
-class Server : public QObject
-{
- Q_OBJECT
-
-public:
- explicit Server(QObject *parent = nullptr);
-
-public slots:
- void run();
-
-private slots:
- void handleNewConnection();
- void handleReadReady();
-
-private:
- QTcpServer m_server;
-};
-
-#endif // SERVER_H
diff --git a/examples/webengine/lifecycle/WebBrowser.qml b/examples/webengine/lifecycle/WebBrowser.qml
deleted file mode 100644
index 23c2500e2..000000000
--- a/examples/webengine/lifecycle/WebBrowser.qml
+++ /dev/null
@@ -1,172 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.12
-import QtQuick.Controls 2.12
-import QtQuick.Controls.Material 2.12
-import QtQuick.Layouts 1.12
-import QtQuick.Window 2.12
-
-ApplicationWindow {
- id: root
-
- readonly property Action newTabAction: Action {
- text: qsTr("New tab")
- shortcut: StandardKey.AddTab
- onTriggered: root.createNewTab({url: "about:blank"})
- }
-
- visible: true
- width: Screen.width * 0.5
- height: Screen.height * 0.5
- title: tabStack.currentTab ? tabStack.currentTab.title : ""
-
- header: WebTabBar {
- id: tabBar
-
- z: 1
-
- newTabAction: root.newTabAction
- }
-
- WebTabStack {
- id: tabStack
-
- z: 0
- anchors.fill: parent
-
- currentIndex: tabBar.currentIndex
- freezeDelay: freezeSpin.enabled && freezeSpin.value
- discardDelay: discardSpin.enabled && discardSpin.value
-
- onCloseRequested: function(index) {
- root.closeTab(index)
- }
-
- onDrawerRequested: drawer.toggle()
- }
-
- Drawer {
- id: drawer
-
- edge: Qt.RightEdge
- height: root.height
-
- Control {
- padding: 16
- contentItem: ColumnLayout {
- Label {
- Layout.alignment: Qt.AlignHCenter
- text: qsTr("Settings")
- font.capitalization: Font.AllUppercase
- }
- MenuSeparator {}
- CheckBox {
- id: lifecycleCheck
- text: qsTr("Automatic lifecycle control")
- checked: true
- }
- CheckBox {
- id: freezeCheck
- text: qsTr("Freeze after delay (seconds)")
- enabled: lifecycleCheck.checked
- checked: true
- }
- SpinBox {
- id: freezeSpin
- editable: true
- enabled: freezeCheck.checked
- value: 60
- from: 1
- to: 60*60
- }
- CheckBox {
- id: discardCheck
- text: qsTr("Discard after delay (seconds)")
- enabled: lifecycleCheck.checked
- checked: true
- }
- SpinBox {
- id: discardSpin
- editable: true
- enabled: discardCheck.checked
- value: 60*60
- from: 1
- to: 60*60
- }
- }
- }
-
- function toggle() {
- if (drawer.visible)
- drawer.close()
- else
- drawer.open()
- }
- }
-
- Component.onCompleted: {
- createNewTab({url: "https://www.qt.io"})
- }
-
- function createNewTab(properties) {
- const tab = tabStack.createNewTab(properties)
- tabBar.createNewTab({tab: tab})
- tabBar.currentIndex = tab.index
- return tab
- }
-
- function closeTab(index) {
- if (tabStack.count == 1)
- Qt.quit()
- tabBar.closeTab(index)
- tabStack.closeTab(index)
- }
-}
diff --git a/examples/webengine/lifecycle/WebTab.qml b/examples/webengine/lifecycle/WebTab.qml
deleted file mode 100644
index 8649da3cb..000000000
--- a/examples/webengine/lifecycle/WebTab.qml
+++ /dev/null
@@ -1,212 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQml 2.12
-import QtQuick 2.12
-import QtQuick.Controls 2.12
-import QtQuick.Controls.Material 2.12
-import QtQuick.Layouts 1.12
-import QtWebEngine 1.10
-
-ColumnLayout {
- id: root
-
- signal closeRequested
- signal drawerRequested
-
- property int freezeDelay
- property int discardDelay
-
- property alias icon : view.icon
- property alias loading : view.loading
- property alias url : view.url
- property alias lifecycleState : view.lifecycleState
- property alias recommendedState : view.recommendedState
-
- readonly property string title : {
- if (view.url == "about:blank")
- return qsTr("New tab")
- if (view.title)
- return view.title
- return view.url
- }
-
- readonly property Action backAction: Action {
- property WebEngineAction webAction: view.action(WebEngineView.Back)
- enabled: webAction.enabled
- text: qsTr("Back")
- shortcut: root.visible && StandardKey.Back
- onTriggered: webAction.trigger()
- }
-
- readonly property Action forwardAction: Action {
- property WebEngineAction webAction: view.action(WebEngineView.Forward)
- enabled: webAction.enabled
- text: qsTr("Forward")
- shortcut: root.visible && StandardKey.Forward
- onTriggered: webAction.trigger()
- }
-
- readonly property Action reloadAction: Action {
- property WebEngineAction webAction: view.action(WebEngineView.Reload)
- enabled: webAction.enabled
- text: qsTr("Reload")
- shortcut: root.visible && StandardKey.Refresh
- onTriggered: webAction.trigger()
- }
-
- readonly property Action stopAction: Action {
- property WebEngineAction webAction: view.action(WebEngineView.Stop)
- enabled: webAction.enabled
- text: qsTr("Stop")
- shortcut: root.visible && StandardKey.Cancel
- onTriggered: webAction.trigger()
- }
-
- readonly property Action closeAction: Action {
- text: qsTr("Close")
- shortcut: root.visible && StandardKey.Close
- onTriggered: root.closeRequested()
- }
-
- readonly property Action activateAction: Action {
- text: qsTr("Active")
- checkable: true
- checked: view.lifecycleState == WebEngineView.LifecycleState.Active
- enabled: checked || (view.lifecycleState != WebEngineView.LifecycleState.Active)
- onTriggered: view.lifecycleState = WebEngineView.LifecycleState.Active
- }
-
- readonly property Action freezeAction: Action {
- text: qsTr("Frozen")
- checkable: true
- checked: view.lifecycleState == WebEngineView.LifecycleState.Frozen
- enabled: checked || (!view.visible && view.lifecycleState == WebEngineView.LifecycleState.Active)
- onTriggered: view.lifecycleState = WebEngineView.LifecycleState.Frozen
- }
-
- readonly property Action discardAction: Action {
- text: qsTr("Discarded")
- checkable: true
- checked: view.lifecycleState == WebEngineView.LifecycleState.Discarded
- enabled: checked || (!view.visible && view.lifecycleState == WebEngineView.LifecycleState.Frozen)
- onTriggered: view.lifecycleState = WebEngineView.LifecycleState.Discarded
- }
-
- spacing: 0
-
- ToolBar {
- Layout.fillWidth: true
- Material.elevation: 0
- Material.background: Material.color(Material.Grey, Material.Shade800)
-
- RowLayout {
- anchors.fill: parent
- WebToolButton {
- action: root.backAction
- text: "â†"
- ToolTip.text: root.backAction.text
- }
- WebToolButton {
- action: root.forwardAction
- text: "→"
- ToolTip.text: root.forwardAction.text
- }
- WebToolButton {
- action: root.reloadAction
- visible: root.reloadAction.enabled
- text: "↻"
- ToolTip.text: root.reloadAction.text
- }
- WebToolButton {
- action: root.stopAction
- visible: root.stopAction.enabled
- text: "✕"
- ToolTip.text: root.stopAction.text
- }
- TextField {
- Layout.fillWidth: true
- Layout.topMargin: 6
-
- placeholderText: qsTr("Type a URL")
- text: view.url == "about:blank" ? "" : view.url
- selectByMouse: true
-
- onAccepted: { view.url = text }
- }
- WebToolButton {
- text: "â‹®"
- ToolTip.text: qsTr("Settings")
- onClicked: root.drawerRequested()
- }
- }
- }
-
- WebEngineView {
- id: view
- Layout.fillHeight: true
- Layout.fillWidth: true
- }
-
- Timer {
- interval: {
- switch (view.recommendedState) {
- case WebEngineView.LifecycleState.Active:
- return 1
- case WebEngineView.LifecycleState.Frozen:
- return root.freezeDelay * 1000
- case WebEngineView.LifecycleState.Discarded:
- return root.discardDelay * 1000
- }
- }
- running: interval && view.lifecycleState != view.recommendedState
- onTriggered: view.lifecycleState = view.recommendedState
- }
-}
diff --git a/examples/webengine/lifecycle/WebTabBar.qml b/examples/webengine/lifecycle/WebTabBar.qml
deleted file mode 100644
index 326ad39d2..000000000
--- a/examples/webengine/lifecycle/WebTabBar.qml
+++ /dev/null
@@ -1,100 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.12
-import QtQuick.Controls 2.12
-import QtQuick.Controls.Material 2.12
-import QtQuick.Layouts 1.12
-
-Pane {
- id: root
-
- property Action newTabAction
-
- property alias currentIndex: tabBar.currentIndex
-
- signal closeRequested(int index)
-
- Material.background: Material.color(Material.Grey, Material.Shade900)
- Material.elevation: 4
- padding: 0
-
- RowLayout {
- spacing: 0
- anchors.fill: parent
-
- TabBar {
- id: tabBar
- Layout.fillWidth: true
- Layout.fillHeight: true
- }
-
- WebToolButton {
- Layout.bottomMargin: 2
-
- action: root.newTabAction
- text: "+"
- ToolTip.text: root.newTabAction.text
- }
- }
-
- Component {
- id: factory
- WebTabButton {}
- }
-
- function createNewTab(properties) {
- return factory.createObject(tabBar, properties)
- }
-
- function closeTab(index) {
- tabBar.takeItem(index).destroy()
- }
-}
diff --git a/examples/webengine/lifecycle/WebTabButton.qml b/examples/webengine/lifecycle/WebTabButton.qml
deleted file mode 100644
index 68057412b..000000000
--- a/examples/webengine/lifecycle/WebTabButton.qml
+++ /dev/null
@@ -1,158 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.12
-import QtQuick.Controls 2.12
-import QtQuick.Controls.Material 2.12
-import QtQuick.Layouts 1.12
-import QtWebEngine 1.10
-
-TabButton {
- id: root
-
- property WebTab tab
-
- text: root.tab.title
-
- ToolTip.delay: 1000
- ToolTip.visible: root.hovered
- ToolTip.text: root.text
-
- padding: 6
-
- contentItem: RowLayout {
- Item {
- implicitWidth: 16
- implicitHeight: 16
- BusyIndicator {
- visible: root.tab.loading
- anchors.fill: parent
- leftInset: 0
- topInset: 0
- rightInset: 0
- bottomInset: 0
- padding: 0
- }
- Image {
- visible: !root.tab.loading
- source: root.tab.icon
- anchors.fill: parent
- }
- }
- Label {
- Layout.fillWidth: true
- Layout.leftMargin: 4
- Layout.rightMargin: 4
- text: root.text
- elide: Text.ElideRight
- color: {
- switch (root.tab.lifecycleState) {
- case WebEngineView.LifecycleState.Active:
- return Material.color(Material.Grey, Material.Shade100)
- case WebEngineView.LifecycleState.Frozen:
- return Material.color(Material.Blue, Material.Shade400)
- case WebEngineView.LifecycleState.Discarded:
- return Material.color(Material.Red, Material.Shade400)
- }
- }
-
- }
- WebToolButton {
- action: root.tab.closeAction
- text: "✕"
- ToolTip.text: action.text
- }
- }
-
- MouseArea {
- anchors.fill: parent
- acceptedButtons: Qt.RightButton
- propagateComposedEvents: true
- onClicked: contextMenu.popup()
- }
-
- Menu {
- id: contextMenu
- Control {
- contentItem: Label {
- text: qsTr("Manual lifecycle control")
- }
- verticalPadding: 9
- horizontalPadding: 14
- }
- Repeater {
- model: [root.tab.activateAction, root.tab.freezeAction, root.tab.discardAction]
- RadioButton {
- action: modelData
- verticalPadding: 9
- horizontalPadding: 14
- }
- }
- Control {
- contentItem: Label {
- text: qsTr("Recommended: %1").arg(recommendedStateText)
- property string recommendedStateText: {
- switch (root.tab.recommendedState) {
- case WebEngineView.LifecycleState.Active:
- return root.tab.activateAction.text
- case WebEngineView.LifecycleState.Frozen:
- return root.tab.freezeAction.text
- case WebEngineView.LifecycleState.Discarded:
- return root.tab.discardAction.text
- }
- }
- color: Material.hintTextColor
- }
- font.pointSize: 8
- verticalPadding: 9
- horizontalPadding: 14
- }
- }
-}
diff --git a/examples/webengine/lifecycle/WebTabStack.qml b/examples/webengine/lifecycle/WebTabStack.qml
deleted file mode 100644
index 75cbba861..000000000
--- a/examples/webengine/lifecycle/WebTabStack.qml
+++ /dev/null
@@ -1,98 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQml.Models 2.12
-import QtQuick 2.12
-import QtQuick.Controls 2.12
-
-Rectangle {
- id: root
-
- signal closeRequested(int index)
- signal drawerRequested
-
- property int freezeDelay
- property int discardDelay
-
- property int currentIndex
- property var currentTab: model.children[currentIndex]
- property alias count: model.count
-
- color: "white"
-
- ObjectModel {
- id: model
- }
-
- Component {
- id: factory
- WebTab {
- readonly property int index : ObjectModel.index
- anchors.fill: parent
- visible: index == root.currentIndex
- freezeDelay: root.freezeDelay
- discardDelay: root.discardDelay
- onCloseRequested: root.closeRequested(index)
- onDrawerRequested: root.drawerRequested()
- }
- }
-
- function createNewTab(properties) {
- const tab = factory.createObject(root, properties)
- model.append(tab)
- return tab
- }
-
- function closeTab(index) {
- const tab = model.get(index)
- model.remove(index)
- tab.destroy()
- }
-}
diff --git a/examples/webengine/lifecycle/WebToolButton.qml b/examples/webengine/lifecycle/WebToolButton.qml
deleted file mode 100644
index 958c083cd..000000000
--- a/examples/webengine/lifecycle/WebToolButton.qml
+++ /dev/null
@@ -1,63 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.12
-import QtQuick.Controls 2.12
-import QtQuick.Controls.Material 2.12
-
-ToolButton {
- id: root
- font.bold: true
- font.pointSize: 12
- ToolTip.delay: 1000
- ToolTip.visible: hovered
- implicitWidth: 32
- implicitHeight: 32
-}
diff --git a/examples/webengine/lifecycle/doc/src/lifecycle.qdoc b/examples/webengine/lifecycle/doc/src/lifecycle.qdoc
deleted file mode 100644
index d10e617e3..000000000
--- a/examples/webengine/lifecycle/doc/src/lifecycle.qdoc
+++ /dev/null
@@ -1,104 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \example webengine/lifecycle
- \title WebEngine Lifecycle Example
- \ingroup webengine-examples
- \brief Freezes and discards background tabs to reduce CPU and memory usage.
-
- \image lifecycle.png
-
- \e {WebEngine Lifecycle Example} demonstrates how the \l
- {WebEngineView::}{lifecycleState} and \l {WebEngineView::}{recommendedState}
- properties of the \l {WebEngineView} can be used to reduce the CPU and
- memory usage of background tabs in a tabbed browser.
-
- For an overview of the lifecycle feature, see \l {Page Lifecycle API}.
-
- \include examples-run.qdocinc
-
- \section1 UI Elements of the Example
-
- The example uses \l {Qt Quick Controls 2} to implement a traditional tabbed
- browser in the \l {Material Style} (dark variant). The main application
- window (\c {WebBrowser.qml}) is divided into a header bar at the top and a
- main viewing area filling the rest of the window. The header contains the
- tab bar (\c {WebTabBar.qml}) with one button per tab (\c
- {WebTabButton.qml}). The main area consists of a stack of tabs (\c
- {WebTabStack.qml} and \c {WebTab.qml}). Each tab in turn has a tool bar at
- the top and a \l {WebEngineView} for displaying web pages. Finally, the main
- window also has a \l {Drawer} for changing settings. The drawer can be
- opened by clicking the "â‹®" button on the tool bar.
-
- \section1 Lifecycle States in the Example
-
- The example implements two ways of changing the lifecycle state: manual and
- automatic. The manual way uses the \l {WebEngineView::}{lifecycleState}
- property directly to change the web view lifecycle state, while the
- automatic way is timer-based and also takes into account the \l
- {WebEngineView::}{recommendedState}.
-
- The tab titles in the tab bar are color coded with frozen tabs shown in blue
- and discarded in red.
-
- \section2 Manual Lifecycle Control
-
- \image lifecycle-manual.png
-
- Manual control is provided by context menus on the tab bar buttons (\c
- {WebTabButton.qml}). The menu has three radio buttons, one for each
- lifecycle state, with the current state checked. Some buttons may be
- disabled, either because they represent illegal state transitions (for
- example, a \c {Discarded} view cannot directly transition to the \c {Frozen}
- state), or because other preconditions are not fulfilled (for example, a
- visible view can only be in the \c {Active} state).
-
- \section2 Automatic Lifecycle Control
-
- \image lifecycle-automatic.png
-
- Automatic control is implemented with a \l {Timer} in the \c {WebTab}
- component (\c {WebTab.qml}). The timer is started whenever the \l
- {WebEngineView::}{lifecycleState} of the web view does not match it's \l
- {WebEngineView::}{recommendedState}. Once the timer fires, the view's
- lifecycle state is set to the recommended state.
-
- The time delay is used to avoid changing the lifecycle state too quickly
- when the user is switching between tabs. The freezing and discarding delays
- can be changed in the settings drawer accessed through the "â‹®" button on the
- tool bar.
-
- This is a rather simple algorithm for automatic lifecycle control, however
- more sophisticated algorithms could also be conceived and implemented on the
- basis of the \l {WebEngineView::}{lifecycleState} property. For example, the
- Chromium browser experimentally uses a pretrained deep neural network to
- predict the next tab activation time by the user, essentially ranking tabs
- based on how interesting they are to the user. Implementing such an
- algorithm is left as an exercise to the reader for now.
-
-*/
diff --git a/examples/webengine/lifecycle/lifecycle.pro b/examples/webengine/lifecycle/lifecycle.pro
deleted file mode 100644
index 74fbf23c1..000000000
--- a/examples/webengine/lifecycle/lifecycle.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-TEMPLATE = app
-
-QT += quickcontrols2 webengine
-
-SOURCES += main.cpp
-
-RESOURCES += resources.qrc
-
-target.path = $$[QT_INSTALL_EXAMPLES]/webengine/lifecycle
-INSTALLS += target
diff --git a/examples/webengine/lifecycle/main.cpp b/examples/webengine/lifecycle/main.cpp
deleted file mode 100644
index bb93d64a7..000000000
--- a/examples/webengine/lifecycle/main.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QGuiApplication>
-#include <QQmlApplicationEngine>
-#include <QQmlContext>
-#include <QQuickStyle>
-#include <qtwebengineglobal.h>
-
-int main(int argc, char *argv[])
-{
- QCoreApplication::setOrganizationName("QtExamples");
- QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
- QtWebEngine::initialize();
- QGuiApplication app(argc, argv);
- QQmlApplicationEngine engine;
- engine.load(QUrl(QStringLiteral("qrc:/WebBrowser.qml")));
- return app.exec();
-}
diff --git a/examples/webengine/minimal/doc/src/minimal.qdoc b/examples/webengine/minimal/doc/src/minimal.qdoc
deleted file mode 100644
index 4fc62bddb..000000000
--- a/examples/webengine/minimal/doc/src/minimal.qdoc
+++ /dev/null
@@ -1,91 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \example webengine/minimal
- \title WebEngine Qt Quick Minimal Example
- \ingroup webengine-examples
- \brief Displays a web page using the Qt Quick integration of \QWE.
-
- \image minimal-example.png
-
- \e {WebEngine Qt Quick Minimal Example} demonstrates how to use the
- \l{WebEngineView} item to render a web page. It shows the minimum amount of
- code needed to load and display an HTML page, and can be used as a basis for
- further experimentation.
-
- \include examples-run.qdocinc
-
- \section1 C++ Code
-
- In \c main.cpp we use only the QGuiApplication and QQmlApplicationEngine
- classes. We also include \c qtwebengineglobal.h to be able to use
- \l{QtWebEngine::initialize}.
-
- \quotefromfile webengine/minimal/main.cpp
- \skipto #include
- \printto main
-
- In the \c main function we first set the
- \l{QCoreApplication::organizationName} property. This affects the locations
- where \QWE stores persistent and cached data (see also
- \l{WebEngineProfile::cachePath} and
- \l{WebEngineProfile::persistentStoragePath}).
-
- We also set the Qt::AA_EnableHighDpiScaling attribute. This lets the web
- view automatically scale on high-dpi displays. Then we instantiate a
- QGuiApplication object.
-
- Next, we call \l{QtWebEngine::initialize}, which makes sure that OpenGL
- contexts can be shared between the main process and the dedicated renderer
- process (\c QtWebEngineProcess). This method needs to be called before
- any OpenGL context is created.
-
- Then we create a QQmlApplicationEngine, and tell it to load \c main.qml
- from the \l{The Qt Resource System}{Qt Resource System}.
-
- Finally, QGuiApplication::exec() launches the main event loop.
-
- \printuntil }
-
- \section1 QML Code
-
- In \c main.qml we create the top level window, set a sensible default size
- and make it visible. The window will be filled by a WebEngineView item
- loading the \l{Qt Homepage}.
-
- \quotefromfile webengine/minimal/main.qml
- \skipto import
- \printuntil }
- \printline }
-
- \section1 Requirements
-
- The example requires a working internet connection to render the
- \l{Qt Homepage}.
- An optional system proxy should be picked up automatically.
-*/
diff --git a/examples/webengine/minimal/main.cpp b/examples/webengine/minimal/main.cpp
deleted file mode 100644
index 86109f97a..000000000
--- a/examples/webengine/minimal/main.cpp
+++ /dev/null
@@ -1,68 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QGuiApplication>
-#include <QQmlApplicationEngine>
-#include <qtwebengineglobal.h>
-
-int main(int argc, char *argv[])
-{
- QCoreApplication::setOrganizationName("QtExamples");
- QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
- QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
- QtWebEngine::initialize();
- QGuiApplication app(argc, argv);
-
- QQmlApplicationEngine engine;
- engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
-
- return app.exec();
-}
-
diff --git a/examples/webengine/minimal/main.qml b/examples/webengine/minimal/main.qml
deleted file mode 100644
index 75082f9c5..000000000
--- a/examples/webengine/minimal/main.qml
+++ /dev/null
@@ -1,63 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtQuick.Window 2.0
-import QtWebEngine 1.0
-
-Window {
- width: 1024
- height: 750
- visible: true
- WebEngineView {
- anchors.fill: parent
- url: "https://www.qt.io"
- }
-}
diff --git a/examples/webengine/minimal/minimal.pro b/examples/webengine/minimal/minimal.pro
deleted file mode 100644
index 23ce01d5b..000000000
--- a/examples/webengine/minimal/minimal.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-TEMPLATE = app
-
-QT += webengine
-
-SOURCES += main.cpp
-
-RESOURCES += qml.qrc
-
-target.path = $$[QT_INSTALL_EXAMPLES]/webengine/minimal
-INSTALLS += target
diff --git a/examples/webengine/quicknanobrowser/ApplicationRoot.qml b/examples/webengine/quicknanobrowser/ApplicationRoot.qml
deleted file mode 100644
index df4bbdb4a..000000000
--- a/examples/webengine/quicknanobrowser/ApplicationRoot.qml
+++ /dev/null
@@ -1,89 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.1
-import QtWebEngine 1.10
-
-QtObject {
- id: root
-
- property QtObject defaultProfile: WebEngineProfile {
- storageName: "Profile"
- offTheRecord: false
- useForGlobalCertificateVerification: true
- }
-
- property QtObject otrProfile: WebEngineProfile {
- offTheRecord: true
- }
-
- property Component browserWindowComponent: BrowserWindow {
- applicationRoot: root
- onClosing: destroy()
- }
- property Component browserDialogComponent: BrowserDialog {
- onClosing: destroy()
- }
- function createWindow(profile) {
- var newWindow = browserWindowComponent.createObject(root);
- newWindow.currentWebView.profile = profile;
- profile.downloadRequested.connect(newWindow.onDownloadRequested);
- return newWindow;
- }
- function createDialog(profile) {
- var newDialog = browserDialogComponent.createObject(root);
- newDialog.currentWebView.profile = profile;
- return newDialog;
- }
- function load(url) {
- var browserWindow = createWindow(defaultProfile);
- browserWindow.currentWebView.url = url;
- }
-}
diff --git a/examples/webengine/quicknanobrowser/BrowserDialog.qml b/examples/webengine/quicknanobrowser/BrowserDialog.qml
deleted file mode 100644
index a7ff9a55b..000000000
--- a/examples/webengine/quicknanobrowser/BrowserDialog.qml
+++ /dev/null
@@ -1,74 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.1
-import QtQuick.Window 2.2
-import QtWebEngine 1.9
-
-Window {
- id: window
- property alias currentWebView: webView
- flags: Qt.Dialog | Qt.WindowStaysOnTopHint
- width: 800
- height: 600
- visible: true
- onClosing: destroy()
- WebEngineView {
- id: webView
- anchors.fill: parent
-
- onGeometryChangeRequested: function(geometry) {
- window.x = geometry.x
- window.y = geometry.y
- window.width = geometry.width
- window.height = geometry.height
- }
- }
-}
diff --git a/examples/webengine/quicknanobrowser/BrowserWindow.qml b/examples/webengine/quicknanobrowser/BrowserWindow.qml
deleted file mode 100644
index c595c3bc5..000000000
--- a/examples/webengine/quicknanobrowser/BrowserWindow.qml
+++ /dev/null
@@ -1,724 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import Qt.labs.settings 1.0
-import QtQml 2.2
-import QtQuick 2.2
-import QtQuick.Controls 1.0
-import QtQuick.Controls.Private 1.0 as QQCPrivate
-import QtQuick.Controls.Styles 1.0
-import QtQuick.Dialogs 1.2
-import QtQuick.Layouts 1.0
-import QtQuick.Window 2.1
-import QtWebEngine 1.10
-
-ApplicationWindow {
- id: browserWindow
- property QtObject applicationRoot
- property Item currentWebView: tabs.currentIndex < tabs.count ? tabs.getTab(tabs.currentIndex).item : null
- property int previousVisibility: Window.Windowed
-
- width: 1300
- height: 900
- visible: true
- title: currentWebView && currentWebView.title
-
- // Make sure the Qt.WindowFullscreenButtonHint is set on OS X.
- Component.onCompleted: flags = flags | Qt.WindowFullscreenButtonHint
-
- onCurrentWebViewChanged: {
- findBar.reset();
- }
-
- // Create a styleItem to determine the platform.
- // When using style "mac", ToolButtons are not supposed to accept focus.
- QQCPrivate.StyleItem { id: styleItem }
- property bool platformIsMac: styleItem.style == "mac"
-
- Settings {
- id : appSettings
- property alias autoLoadImages: loadImages.checked
- property alias javaScriptEnabled: javaScriptEnabled.checked
- property alias errorPageEnabled: errorPageEnabled.checked
- property alias pluginsEnabled: pluginsEnabled.checked
- property alias fullScreenSupportEnabled: fullScreenSupportEnabled.checked
- property alias autoLoadIconsForPage: autoLoadIconsForPage.checked
- property alias touchIconsEnabled: touchIconsEnabled.checked
- property alias webRTCPublicInterfacesOnly : webRTCPublicInterfacesOnly.checked
- property alias devToolsEnabled: devToolsEnabled.checked
- property alias pdfViewerEnabled: pdfViewerEnabled.checked
- }
-
- Action {
- shortcut: "Ctrl+D"
- onTriggered: {
- downloadView.visible = !downloadView.visible;
- }
- }
- Action {
- id: focus
- shortcut: "Ctrl+L"
- onTriggered: {
- addressBar.forceActiveFocus();
- addressBar.selectAll();
- }
- }
- Action {
- shortcut: StandardKey.Refresh
- onTriggered: {
- if (currentWebView)
- currentWebView.reload();
- }
- }
- Action {
- shortcut: StandardKey.AddTab
- onTriggered: {
- tabs.createEmptyTab(tabs.count != 0 ? currentWebView.profile : defaultProfile);
- tabs.currentIndex = tabs.count - 1;
- addressBar.forceActiveFocus();
- addressBar.selectAll();
- }
- }
- Action {
- shortcut: StandardKey.Close
- onTriggered: {
- currentWebView.triggerWebAction(WebEngineView.RequestClose);
- }
- }
- Action {
- shortcut: StandardKey.Quit
- onTriggered: browserWindow.close()
- }
- Action {
- shortcut: "Escape"
- onTriggered: {
- if (currentWebView.state == "FullScreen") {
- browserWindow.visibility = browserWindow.previousVisibility;
- fullScreenNotification.hide();
- currentWebView.triggerWebAction(WebEngineView.ExitFullScreen);
- }
-
- if (findBar.visible)
- findBar.visible = false;
- }
- }
- Action {
- shortcut: "Ctrl+0"
- onTriggered: currentWebView.zoomFactor = 1.0
- }
- Action {
- shortcut: StandardKey.ZoomOut
- onTriggered: currentWebView.zoomFactor -= 0.1
- }
- Action {
- shortcut: StandardKey.ZoomIn
- onTriggered: currentWebView.zoomFactor += 0.1
- }
-
- Action {
- shortcut: StandardKey.Copy
- onTriggered: currentWebView.triggerWebAction(WebEngineView.Copy)
- }
- Action {
- shortcut: StandardKey.Cut
- onTriggered: currentWebView.triggerWebAction(WebEngineView.Cut)
- }
- Action {
- shortcut: StandardKey.Paste
- onTriggered: currentWebView.triggerWebAction(WebEngineView.Paste)
- }
- Action {
- shortcut: "Shift+"+StandardKey.Paste
- onTriggered: currentWebView.triggerWebAction(WebEngineView.PasteAndMatchStyle)
- }
- Action {
- shortcut: StandardKey.SelectAll
- onTriggered: currentWebView.triggerWebAction(WebEngineView.SelectAll)
- }
- Action {
- shortcut: StandardKey.Undo
- onTriggered: currentWebView.triggerWebAction(WebEngineView.Undo)
- }
- Action {
- shortcut: StandardKey.Redo
- onTriggered: currentWebView.triggerWebAction(WebEngineView.Redo)
- }
- Action {
- shortcut: StandardKey.Back
- onTriggered: currentWebView.triggerWebAction(WebEngineView.Back)
- }
- Action {
- shortcut: StandardKey.Forward
- onTriggered: currentWebView.triggerWebAction(WebEngineView.Forward)
- }
- Action {
- shortcut: StandardKey.Find
- onTriggered: {
- if (!findBar.visible)
- findBar.visible = true;
- }
- }
- Action {
- shortcut: StandardKey.FindNext
- onTriggered: findBar.findNext()
- }
- Action {
- shortcut: StandardKey.FindPrevious
- onTriggered: findBar.findPrevious()
- }
-
- toolBar: ToolBar {
- id: navigationBar
- RowLayout {
- anchors.fill: parent
- ToolButton {
- enabled: currentWebView && (currentWebView.canGoBack || currentWebView.canGoForward)
- menu:Menu {
- id: historyMenu
-
- Instantiator {
- model: currentWebView && currentWebView.navigationHistory.items
- MenuItem {
- text: model.title
- onTriggered: currentWebView.goBackOrForward(model.offset)
- checkable: !enabled
- checked: !enabled
- enabled: model.offset
- }
-
- onObjectAdded: function(index, object) {
- historyMenu.insertItem(index, object)
- }
- onObjectRemoved: function(index, object) {
- historyMenu.removeItem(object)
- }
- }
- }
- }
-
- ToolButton {
- id: backButton
- iconSource: "icons/go-previous.png"
- onClicked: currentWebView.goBack()
- enabled: currentWebView && currentWebView.canGoBack
- activeFocusOnTab: !browserWindow.platformIsMac
- }
- ToolButton {
- id: forwardButton
- iconSource: "icons/go-next.png"
- onClicked: currentWebView.goForward()
- enabled: currentWebView && currentWebView.canGoForward
- activeFocusOnTab: !browserWindow.platformIsMac
- }
- ToolButton {
- id: reloadButton
- iconSource: currentWebView && currentWebView.loading ? "icons/process-stop.png" : "icons/view-refresh.png"
- onClicked: currentWebView && currentWebView.loading ? currentWebView.stop() : currentWebView.reload()
- activeFocusOnTab: !browserWindow.platformIsMac
- }
- TextField {
- id: addressBar
- Image {
- anchors.verticalCenter: addressBar.verticalCenter;
- x: 5
- z: 2
- id: faviconImage
- width: 16; height: 16
- sourceSize: Qt.size(width, height)
- source: currentWebView && currentWebView.icon ? currentWebView.icon : ''
- }
- style: TextFieldStyle {
- padding {
- left: 26;
- }
- }
- focus: true
- Layout.fillWidth: true
- text: currentWebView && currentWebView.url
- onAccepted: currentWebView.url = utils.fromUserInput(text)
- }
- ToolButton {
- id: settingsMenuButton
- menu: Menu {
- MenuItem {
- id: loadImages
- text: "Autoload images"
- checkable: true
- checked: WebEngine.settings.autoLoadImages
- }
- MenuItem {
- id: javaScriptEnabled
- text: "JavaScript On"
- checkable: true
- checked: WebEngine.settings.javascriptEnabled
- }
- MenuItem {
- id: errorPageEnabled
- text: "ErrorPage On"
- checkable: true
- checked: WebEngine.settings.errorPageEnabled
- }
- MenuItem {
- id: pluginsEnabled
- text: "Plugins On"
- checkable: true
- checked: true
- }
- MenuItem {
- id: fullScreenSupportEnabled
- text: "FullScreen On"
- checkable: true
- checked: WebEngine.settings.fullScreenSupportEnabled
- }
- MenuItem {
- id: offTheRecordEnabled
- text: "Off The Record"
- checkable: true
- checked: currentWebView && currentWebView.profile === otrProfile
- onToggled: function(checked) {
- if (currentWebView) {
- currentWebView.profile = checked ? otrProfile : defaultProfile;
- }
- }
- }
- MenuItem {
- id: httpDiskCacheEnabled
- text: "HTTP Disk Cache"
- checkable: currentWebView && !currentWebView.profile.offTheRecord
- checked: currentWebView && (currentWebView.profile.httpCacheType === WebEngineProfile.DiskHttpCache)
- onToggled: function(checked) {
- if (currentWebView) {
- currentWebView.profile.httpCacheType = checked ? WebEngineProfile.DiskHttpCache : WebEngineProfile.MemoryHttpCache;
- }
- }
- }
- MenuItem {
- id: autoLoadIconsForPage
- text: "Icons On"
- checkable: true
- checked: WebEngine.settings.autoLoadIconsForPage
- }
- MenuItem {
- id: touchIconsEnabled
- text: "Touch Icons On"
- checkable: true
- checked: WebEngine.settings.touchIconsEnabled
- enabled: autoLoadIconsForPage.checked
- }
- MenuItem {
- id: webRTCPublicInterfacesOnly
- text: "WebRTC Public Interfaces Only"
- checkable: true
- checked: WebEngine.settings.webRTCPublicInterfacesOnly
- }
- MenuItem {
- id: devToolsEnabled
- text: "Open DevTools"
- checkable: true
- checked: false
- }
- MenuItem {
- id: pdfViewerEnabled
- text: "PDF viewer enabled"
- checkable: true
- checked: WebEngine.settings.pdfViewerEnabled
- }
- }
- }
- }
- ProgressBar {
- id: progressBar
- height: 3
- anchors {
- left: parent.left
- top: parent.bottom
- right: parent.right
- leftMargin: -parent.leftMargin
- rightMargin: -parent.rightMargin
- }
- style: ProgressBarStyle {
- background: Item {}
- }
- z: -2;
- minimumValue: 0
- maximumValue: 100
- value: (currentWebView && currentWebView.loadProgress < 100) ? currentWebView.loadProgress : 0
- }
- }
-
- TabView {
- id: tabs
- function createEmptyTab(profile) {
- var tab = addTab("", tabComponent);
- // We must do this first to make sure that tab.active gets set so that tab.item gets instantiated immediately.
- tab.active = true;
- tab.title = Qt.binding(function() { return tab.item.title ? tab.item.title : 'New Tab' });
- tab.item.profile = profile;
- return tab;
- }
-
- function indexOfView(view) {
- for (let i = 0; i < tabs.count; ++i)
- if (tabs.getTab(i).item == view)
- return i
- return -1
- }
-
- function removeView(index) {
- if (tabs.count > 1)
- tabs.removeTab(index)
- else
- browserWindow.close();
- }
-
- anchors.top: parent.top
- anchors.bottom: devToolsView.top
- anchors.left: parent.left
- anchors.right: parent.right
- Component.onCompleted: createEmptyTab(defaultProfile)
-
- // Add custom tab view style so we can customize the tabs to include a close button
- style: TabViewStyle {
- property color frameColor: "#999"
- property color fillColor: "#eee"
- property color nonSelectedColor: "#ddd"
- frameOverlap: 1
- frame: Rectangle {
- color: "#eee"
- border.color: frameColor
- }
- tab: Rectangle {
- id: tabRectangle
- color: styleData.selected ? fillColor : nonSelectedColor
- border.width: 1
- border.color: frameColor
- implicitWidth: Math.max(text.width + 30, 80)
- implicitHeight: Math.max(text.height + 10, 20)
- Rectangle { height: 1 ; width: parent.width ; color: frameColor}
- Rectangle { height: parent.height ; width: 1; color: frameColor}
- Rectangle { x: parent.width - 2; height: parent.height ; width: 1; color: frameColor}
- Text {
- id: text
- anchors.left: parent.left
- anchors.verticalCenter: parent.verticalCenter
- anchors.leftMargin: 6
- text: styleData.title
- elide: Text.ElideRight
- color: styleData.selected ? "black" : frameColor
- }
- Button {
- anchors.right: parent.right
- anchors.verticalCenter: parent.verticalCenter
- anchors.rightMargin: 4
- height: 12
- style: ButtonStyle {
- background: Rectangle {
- implicitWidth: 12
- implicitHeight: 12
- color: control.hovered ? "#ccc" : tabRectangle.color
- Text {text: "x" ; anchors.centerIn: parent ; color: "gray"}
- }}
- onClicked: tabs.removeView(styleData.index)
- }
- }
- }
-
- Component {
- id: tabComponent
- WebEngineView {
- id: webEngineView
- focus: true
-
- onLinkHovered: function(hoveredUrl) {
- if (hoveredUrl == "")
- hideStatusText.start();
- else {
- statusText.text = hoveredUrl;
- statusBubble.visible = true;
- hideStatusText.stop();
- }
- }
-
- states: [
- State {
- name: "FullScreen"
- PropertyChanges {
- target: tabs
- frameVisible: false
- tabsVisible: false
- }
- PropertyChanges {
- target: navigationBar
- visible: false
- }
- }
- ]
- settings.autoLoadImages: appSettings.autoLoadImages
- settings.javascriptEnabled: appSettings.javaScriptEnabled
- settings.errorPageEnabled: appSettings.errorPageEnabled
- settings.pluginsEnabled: appSettings.pluginsEnabled
- settings.fullScreenSupportEnabled: appSettings.fullScreenSupportEnabled
- settings.autoLoadIconsForPage: appSettings.autoLoadIconsForPage
- settings.touchIconsEnabled: appSettings.touchIconsEnabled
- settings.webRTCPublicInterfacesOnly: appSettings.webRTCPublicInterfacesOnly
- settings.pdfViewerEnabled: appSettings.pdfViewerEnabled
-
- onCertificateError: function(error) {
- error.defer();
- sslDialog.enqueue(error);
- }
-
- onNewViewRequested: function(request) {
- if (!request.userInitiated)
- print("Warning: Blocked a popup window.");
- else if (request.destination === WebEngineView.NewViewInTab) {
- var tab = tabs.createEmptyTab(currentWebView.profile);
- tabs.currentIndex = tabs.count - 1;
- request.openIn(tab.item);
- } else if (request.destination === WebEngineView.NewViewInBackgroundTab) {
- var backgroundTab = tabs.createEmptyTab(currentWebView.profile);
- request.openIn(backgroundTab.item);
- } else if (request.destination === WebEngineView.NewViewInDialog) {
- var dialog = applicationRoot.createDialog(currentWebView.profile);
- request.openIn(dialog.currentWebView);
- } else {
- var window = applicationRoot.createWindow(currentWebView.profile);
- request.openIn(window.currentWebView);
- }
- }
-
- onFullScreenRequested: function(request) {
- if (request.toggleOn) {
- webEngineView.state = "FullScreen";
- browserWindow.previousVisibility = browserWindow.visibility;
- browserWindow.showFullScreen();
- fullScreenNotification.show();
- } else {
- webEngineView.state = "";
- browserWindow.visibility = browserWindow.previousVisibility;
- fullScreenNotification.hide();
- }
- request.accept();
- }
-
- onQuotaRequested: function(request) {
- if (request.requestedSize <= 5 * 1024 * 1024)
- request.accept();
- else
- request.reject();
- }
-
- onRegisterProtocolHandlerRequested: function(request) {
- console.log("accepting registerProtocolHandler request for "
- + request.scheme + " from " + request.origin);
- request.accept();
- }
-
- onRenderProcessTerminated: function(terminationStatus, exitCode) {
- var status = "";
- switch (terminationStatus) {
- case WebEngineView.NormalTerminationStatus:
- status = "(normal exit)";
- break;
- case WebEngineView.AbnormalTerminationStatus:
- status = "(abnormal exit)";
- break;
- case WebEngineView.CrashedTerminationStatus:
- status = "(crashed)";
- break;
- case WebEngineView.KilledTerminationStatus:
- status = "(killed)";
- break;
- }
-
- print("Render process exited with code " + exitCode + " " + status);
- reloadTimer.running = true;
- }
-
- onWindowCloseRequested: tabs.removeView(tabs.indexOfView(webEngineView))
-
- onSelectClientCertificate: function(selection) {
- selection.certificates[0].select();
- }
-
- onFindTextFinished: function(result) {
- if (!findBar.visible)
- findBar.visible = true;
-
- findBar.numberOfMatches = result.numberOfMatches;
- findBar.activeMatch = result.activeMatch;
- }
-
- onLoadingChanged: function(loadRequest) {
- if (loadRequest.status == WebEngineView.LoadStartedStatus)
- findBar.reset();
- }
-
- Timer {
- id: reloadTimer
- interval: 0
- running: false
- repeat: false
- onTriggered: currentWebView.reload()
- }
- }
- }
- }
- WebEngineView {
- id: devToolsView
- visible: devToolsEnabled.checked
- height: visible ? 400 : 0
- inspectedView: visible && tabs.currentIndex < tabs.count ? tabs.getTab(tabs.currentIndex).item : null
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.bottom: parent.bottom
- onNewViewRequested: function(request) {
- var tab = tabs.createEmptyTab(currentWebView.profile);
- tabs.currentIndex = tabs.count - 1;
- request.openIn(tab.item);
- }
- }
- MessageDialog {
- id: sslDialog
-
- property var certErrors: []
- icon: StandardIcon.Warning
- standardButtons: StandardButton.No | StandardButton.Yes
- title: "Server's certificate not trusted"
- text: "Do you wish to continue?"
- detailedText: "If you wish so, you may continue with an unverified certificate. " +
- "Accepting an unverified certificate means " +
- "you may not be connected with the host you tried to connect to.\n" +
- "Do you wish to override the security check and continue?"
- onYes: {
- certErrors.shift().ignoreCertificateError();
- presentError();
- }
- onNo: reject()
- onRejected: reject()
-
- function reject(){
- certErrors.shift().rejectCertificate();
- presentError();
- }
- function enqueue(error){
- certErrors.push(error);
- presentError();
- }
- function presentError(){
- visible = certErrors.length > 0
- }
- }
-
- FullScreenNotification {
- id: fullScreenNotification
- }
-
- DownloadView {
- id: downloadView
- visible: false
- anchors.fill: parent
- }
-
- function onDownloadRequested(download) {
- downloadView.visible = true;
- downloadView.append(download);
- download.accept();
- }
-
- FindBar {
- id: findBar
- visible: false
- anchors.right: parent.right
- anchors.rightMargin: 10
- anchors.top: parent.top
-
- onFindNext: {
- if (text)
- currentWebView && currentWebView.findText(text);
- else if (!visible)
- visible = true;
- }
- onFindPrevious: {
- if (text)
- currentWebView && currentWebView.findText(text, WebEngineView.FindBackward);
- else if (!visible)
- visible = true;
- }
- }
-
-
- Rectangle {
- id: statusBubble
- color: "oldlace"
- property int padding: 8
- visible: false
-
- anchors.left: parent.left
- anchors.bottom: parent.bottom
- width: statusText.paintedWidth + padding
- height: statusText.paintedHeight + padding
-
- Text {
- id: statusText
- anchors.centerIn: statusBubble
- elide: Qt.ElideMiddle
-
- Timer {
- id: hideStatusText
- interval: 750
- onTriggered: {
- statusText.text = "";
- statusBubble.visible = false;
- }
- }
- }
- }
-}
diff --git a/examples/webengine/quicknanobrowser/DownloadView.qml b/examples/webengine/quicknanobrowser/DownloadView.qml
deleted file mode 100644
index e26c770bc..000000000
--- a/examples/webengine/quicknanobrowser/DownloadView.qml
+++ /dev/null
@@ -1,175 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.1
-import QtQuick.Controls 1.0
-import QtQuick.Controls.Styles 1.0
-import QtWebEngine 1.9
-import QtQuick.Layouts 1.0
-
-Rectangle {
- id: downloadView
- color: "lightgray"
-
- ListModel {
- id: downloadModel
- property var downloads: []
- }
-
- function append(download) {
- downloadModel.append(download);
- downloadModel.downloads.push(download);
- }
-
- Component {
- id: downloadItemDelegate
-
- Rectangle {
- width: listView.width
- height: childrenRect.height
- anchors.margins: 10
- radius: 3
- color: "transparent"
- border.color: "black"
- Rectangle {
- id: progressBar
-
- property real progress: downloadModel.downloads[index]
- ? downloadModel.downloads[index].receivedBytes / downloadModel.downloads[index].totalBytes : 0
-
- radius: 3
- color: width == listView.width ? "green" : "#2b74c7"
- width: listView.width * progress
- height: cancelButton.height
-
- Behavior on width {
- SmoothedAnimation { duration: 100 }
- }
- }
- Rectangle {
- anchors {
- left: parent.left
- right: parent.right
- leftMargin: 20
- }
- Label {
- id: label
- text: downloadDirectory + "/" + downloadFileName
- anchors {
- verticalCenter: cancelButton.verticalCenter
- left: parent.left
- right: cancelButton.left
- }
- }
- Button {
- id: cancelButton
- anchors.right: parent.right
- iconSource: "icons/process-stop.png"
- onClicked: {
- var download = downloadModel.downloads[index];
-
- download.cancel();
-
- downloadModel.downloads = downloadModel.downloads.filter(function (el) {
- return el.id !== download.id;
- });
- downloadModel.remove(index);
- }
- }
- }
- }
-
- }
- ListView {
- id: listView
- anchors {
- topMargin: 10
- top: parent.top
- bottom: parent.bottom
- horizontalCenter: parent.horizontalCenter
- }
- width: parent.width - 20
- spacing: 5
-
- model: downloadModel
- delegate: downloadItemDelegate
-
- Text {
- visible: !listView.count
- horizontalAlignment: Text.AlignHCenter
- height: 30
- anchors {
- top: parent.top
- left: parent.left
- right: parent.right
- }
- font.pixelSize: 20
- text: "No active downloads."
- }
-
- Rectangle {
- color: "gray"
- anchors {
- bottom: parent.bottom
- left: parent.left
- right: parent.right
- }
- height: 30
- Button {
- id: okButton
- text: "OK"
- anchors.centerIn: parent
- onClicked: {
- downloadView.visible = false;
- }
- }
- }
- }
-}
diff --git a/examples/webengine/quicknanobrowser/FindBar.qml b/examples/webengine/quicknanobrowser/FindBar.qml
deleted file mode 100644
index de407ac33..000000000
--- a/examples/webengine/quicknanobrowser/FindBar.qml
+++ /dev/null
@@ -1,146 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.5
-import QtQuick.Controls 1.4
-import QtQuick.Controls.Styles 1.4
-import QtQuick.Layouts 1.0
-
-Rectangle {
- id: root
-
- property int numberOfMatches: 0
- property int activeMatch: 0
- property alias text: findTextField.text
-
- function reset() {
- numberOfMatches = 0;
- activeMatch = 0;
- visible = false;
- }
-
- signal findNext()
- signal findPrevious()
-
- width: 250
- height: 35
- radius: 2
-
- border.width: 1
- border.color: "black"
- color: "white"
-
- onVisibleChanged: {
- if (visible)
- findTextField.forceActiveFocus();
- }
-
-
- RowLayout {
- anchors.fill: parent
- anchors.topMargin: 5
- anchors.bottomMargin: 5
- anchors.leftMargin: 10
- anchors.rightMargin: 10
-
- spacing: 5
-
- Rectangle {
- Layout.fillWidth: true
- Layout.fillHeight: true
-
- TextField {
- id: findTextField
- anchors.fill: parent
-
- style: TextFieldStyle {
- background: Rectangle {
- color: "transparent"
- }
- }
-
- onAccepted: root.findNext()
- onTextChanged: root.findNext()
- onActiveFocusChanged: activeFocus ? selectAll() : deselect()
- }
- }
-
- Label {
- text: activeMatch + "/" + numberOfMatches
- visible: findTextField.text != ""
- }
-
- Rectangle {
- border.width: 1
- border.color: "#ddd"
- width: 2
- height: parent.height
- anchors.topMargin: 5
- anchors.bottomMargin: 5
- }
-
- ToolButton {
- text: "<"
- enabled: numberOfMatches > 0
- onClicked: root.findPrevious()
- }
-
- ToolButton {
- text: ">"
- enabled: numberOfMatches > 0
- onClicked: root.findNext()
- }
-
- ToolButton {
- text: "x"
- onClicked: root.visible = false
- }
- }
-}
diff --git a/examples/webengine/quicknanobrowser/FullScreenNotification.qml b/examples/webengine/quicknanobrowser/FullScreenNotification.qml
deleted file mode 100644
index 09305ba9e..000000000
--- a/examples/webengine/quicknanobrowser/FullScreenNotification.qml
+++ /dev/null
@@ -1,109 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.5
-
-Rectangle {
- id: fullScreenNotification
- width: 500
- height: 40
- color: "white"
- radius: 7
-
- visible: false
- opacity: 0
-
- function show() {
- visible = true;
- opacity = 1;
- reset.start();
- }
-
- function hide() {
- reset.stop();
- opacity = 0;
- }
-
- Behavior on opacity {
- NumberAnimation {
- duration: 750
- onStopped: {
- if (opacity == 0)
- visible = false;
- }
- }
- }
-
- Timer {
- id: reset
- interval: 5000
- onTriggered: hide()
- }
-
- anchors.horizontalCenter: parent.horizontalCenter
- y: 125
-
- Text {
- id: message
- width: parent.width
-
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
-
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
-
- wrapMode: Text.WordWrap
- elide: Text.ElideNone
- clip: true
-
- text: qsTr("You are now in fullscreen mode. Press ESC to quit!")
- }
-}
diff --git a/examples/webengine/quicknanobrowser/doc/src/quicknanobrowser.qdoc b/examples/webengine/quicknanobrowser/doc/src/quicknanobrowser.qdoc
deleted file mode 100644
index 3188bb299..000000000
--- a/examples/webengine/quicknanobrowser/doc/src/quicknanobrowser.qdoc
+++ /dev/null
@@ -1,149 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \example webengine/quicknanobrowser
- \title WebEngine Quick Nano Browser
- \ingroup webengine-examples
- \brief A web browser implemented using the WebEngineView QML type.
-
- \image quicknanobrowser-demo.jpg
-
- \e {Quick Nano Browser} demonstrates how to use the \l{Qt WebEngine QML Types}
- {Qt WebEngine QML types} to develop a small web browser application that consists of a browser
- window with a title bar, toolbar, tab view, and status bar. The web content is loaded in a web
- engine view within the tab view. If certificate errors occur, users are prompted for action in a
- message dialog. The status bar pops up to display the URL of a hovered link.
-
- A web page can issue a request for being displayed in fullscreen mode. Users can allow full
- screen mode by using a toolbar button. They can leave fullscreen mode by using a keyboard
- shortcut. Additional toolbar buttons enable moving backwards and forwards in the browser
- history, reloading tab content, and opening a settings menu for enabling the following features:
- JavaScript, plugins, fullscreen mode, off the record, HTTP disk cache, autoloading images, and
- ignoring certificate errors.
-
- \include examples-run.qdocinc
-
- \section1 Creating the Main Browser Window
-
- When the browser main window is loaded, it creates an empty tab using the default profile. Each
- tab is a web engine view that fills the main window.
-
- We create the main window in the \e BrowserWindow.qml file using the ApplicationWindow type:
-
- \quotefromfile webengine/quicknanobrowser/BrowserWindow.qml
- \skipto ApplicationWindow
- \printuntil currentWebView
- \dots
- \skipto width
- \printuntil title
-
- We use the TabView Qt Quick control to create an empty tab view that fills the main window. We
- set the tab active first, to make sure that the tab item is immediately instantiated:
-
- \skipto TabView
- \printuntil Component.onCompleted
-
- The tab contains a web engine view that loads web content:
-
- \printuntil focus
-
- We use the \l Action type to create new tabs:
-
- \quotefromfile webengine/quicknanobrowser/BrowserWindow.qml
- \skipto reload
- \skipto Action
- \printuntil }
-
- We use the \l TextField Qt Quick Control within a \l ToolBar to create an address bar that
- shows the current URL and where users can enter another URL:
-
- \skipto toolBar
- \printuntil anchors.fill
- \dots
- \skipto TextField
- \printuntil addressBar
- \dots
- \skipto focus
- \printuntil /^\ {16}\}/
-
- \section1 Handling Certificate Errors
-
- If the certificate of the site being loaded triggers a certificate error, we call the
- \l{WebEngineCertificateError::}{defer()} QML method to pause the URL request and wait for user
- input:
-
- \quotefromfile webengine/quicknanobrowser/BrowserWindow.qml
- \skipto onCertificateError
- \printuntil }
-
- We use the MessageDialog type to prompt users to continue or cancel the loading of the web page.
- If users select \uicontrol Yes, we call the
- \l{WebEngineCertificateError::}{ignoreCertificateError()} method to ignore the error and
- continue loading content from the URL. If users select \uicontrol No, we call the
- \l{WebEngineCertificateError::}{rejectCertificate()} method to reject the request and stop
- loading content from the URL:
-
- \skipto MessageDialog
- \printuntil /^\ {4}\}/
-
- \section1 Entering and Leaving Fullscreen Mode
-
- We create a menu item for allowing fullscreen mode in a settings menu that we place on the tool
- bar. Also, we create an action for leaving fullscreen mode by using a keyboard shortcut.
- We call the \l{FullScreenRequest::}{accept()} method to accept the fullscreen request.
- The methdod sets the \l{WebEngineView::}{isFullScreen} property to be equal to the
- \l{FullScreenRequest::}{toggleOn} property.
-
- \quotefromfile webengine/quicknanobrowser/BrowserWindow.qml
- \skipto onFullScreenRequested
- \printuntil /^\ {16}\}/
-
- When entering fullscreen mode, we display a notification using the FullScreenNotification custom
- type that we create in \e FullScreenNotification.qml.
-
- We use the \l Action type in the settings menu to create a shortcut for leaving fullscreen mode
- by pressing the escape key:
-
- \quotefromfile webengine/quicknanobrowser/BrowserWindow.qml
- \skipto Settings
- \printuntil appSettings
- \skipto fullScreenSupportEnabled
- \printuntil Action
- \skipto Escape
- \printuntil /^\ {4}\}/
-
- \section1 Files and Attributions
-
- The example uses icons from the Tango Icon Library:
-
- \table
- \row
- \li \l{quicknanobrowser-tango}{Tango Icon Library}
- \li Public Domain
- \endtable
-*/
diff --git a/examples/webengine/quicknanobrowser/icons/3rdparty/qt_attribution.json b/examples/webengine/quicknanobrowser/icons/3rdparty/qt_attribution.json
deleted file mode 100644
index 4e5a44448..000000000
--- a/examples/webengine/quicknanobrowser/icons/3rdparty/qt_attribution.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "Id": "quicknanobrowser-tango",
- "Name": "Tango Icon Library",
- "QDocModule": "qtwebengine",
- "QtUsage": "Used in WebEngine Quick Nano Browser example.",
-
- "QtParts": [ "examples" ],
- "Description": "Selected icons from the Tango Icon Library",
- "Homepage": "http://tango.freedesktop.org/Tango_Icon_Library",
- "Version": "0.8.90",
- "DownloadLocation": "http://tango.freedesktop.org/releases/tango-icon-theme-0.8.90.tar.gz",
- "LicenseId": "DocumentRef-PublicDomain",
- "License": "Public Domain",
- "LicenseFile": "COPYING",
- "Copyright": "Ulisse Perusin <uli.peru@gmail.com>
-Steven Garrity <sgarrity@silverorange.com>
-Lapo Calamandrei <calamandrei@gmail.com>
-Ryan Collier <rcollier@novell.com>
-Rodney Dawes <dobey@novell.com>
-Andreas Nilsson <nisses.mail@home.se>
-Tuomas Kuosmanen <tigert@tigert.com>
-Garrett LeSage <garrett@novell.com>
-Jakub Steiner <jimmac@novell.com>"
-}
diff --git a/examples/webengine/quicknanobrowser/main.cpp b/examples/webengine/quicknanobrowser/main.cpp
deleted file mode 100644
index d09abba3c..000000000
--- a/examples/webengine/quicknanobrowser/main.cpp
+++ /dev/null
@@ -1,97 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "utils.h"
-
-#ifndef QT_NO_WIDGETS
-#include <QtWidgets/QApplication>
-typedef QApplication Application;
-#else
-#include <QtGui/QGuiApplication>
-typedef QGuiApplication Application;
-#endif
-#include <QtQml/QQmlApplicationEngine>
-#include <QtQml/QQmlContext>
-#include <QtWebEngine/qtwebengineglobal.h>
-
-static QUrl startupUrl()
-{
- QUrl ret;
- QStringList args(qApp->arguments());
- args.takeFirst();
- for (const QString &arg : qAsConst(args)) {
- if (arg.startsWith(QLatin1Char('-')))
- continue;
- ret = Utils::fromUserInput(arg);
- if (ret.isValid())
- return ret;
- }
- return QUrl(QStringLiteral("https://www.qt.io"));
-}
-
-int main(int argc, char **argv)
-{
- QCoreApplication::setOrganizationName("QtExamples");
- QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
- QtWebEngine::initialize();
-
- Application app(argc, argv);
-
- QQmlApplicationEngine appEngine;
- Utils utils;
- appEngine.rootContext()->setContextProperty("utils", &utils);
- appEngine.load(QUrl("qrc:/ApplicationRoot.qml"));
- if (!appEngine.rootObjects().isEmpty())
- QMetaObject::invokeMethod(appEngine.rootObjects().first(), "load", Q_ARG(QVariant, startupUrl()));
- else
- qFatal("Failed to load sources");
-
- return app.exec();
-}
diff --git a/examples/webengine/quicknanobrowser/quicknanobrowser.pro b/examples/webengine/quicknanobrowser/quicknanobrowser.pro
deleted file mode 100644
index 922cf79e2..000000000
--- a/examples/webengine/quicknanobrowser/quicknanobrowser.pro
+++ /dev/null
@@ -1,25 +0,0 @@
-requires(qtConfig(accessibility))
-
-TEMPLATE = app
-TARGET = quicknanobrowser
-
-HEADERS = utils.h
-SOURCES = main.cpp
-
-OTHER_FILES += ApplicationRoot.qml \
- BrowserDialog.qml \
- BrowserWindow.qml \
- DownloadView.qml \
- FindBar.qml \
- FullScreenNotification.qml
-
-RESOURCES += resources.qrc
-
-QT += qml quick webengine
-
-qtHaveModule(widgets) {
- QT += widgets # QApplication is required to get native styling with QtQuickControls
-}
-
-target.path = $$[QT_INSTALL_EXAMPLES]/webengine/quicknanobrowser
-INSTALLS += target
diff --git a/examples/webengine/quicknanobrowser/resources.qrc b/examples/webengine/quicknanobrowser/resources.qrc
deleted file mode 100644
index 50ea05f5e..000000000
--- a/examples/webengine/quicknanobrowser/resources.qrc
+++ /dev/null
@@ -1,16 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
- <qresource prefix="/">
- <file>ApplicationRoot.qml</file>
- <file>BrowserDialog.qml</file>
- <file>BrowserWindow.qml</file>
- <file>DownloadView.qml</file>
- <file>FindBar.qml</file>
- <file>FullScreenNotification.qml</file>
- </qresource>
- <qresource prefix="icons">
- <file alias="go-next.png">icons/3rdparty/go-next.png</file>
- <file alias="go-previous.png">icons/3rdparty/go-previous.png</file>
- <file alias="process-stop.png">icons/3rdparty/process-stop.png</file>
- <file alias="view-refresh.png">icons/3rdparty/view-refresh.png</file>
- </qresource>
-</RCC>
diff --git a/examples/webengine/quicknanobrowser/utils.h b/examples/webengine/quicknanobrowser/utils.h
deleted file mode 100644
index 79aa38cc7..000000000
--- a/examples/webengine/quicknanobrowser/utils.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef UTILS_H
-#define UTILS_H
-
-#include <QtCore/QFileInfo>
-#include <QtCore/QUrl>
-
-class Utils : public QObject {
- Q_OBJECT
-public:
- Q_INVOKABLE static QUrl fromUserInput(const QString& userInput);
-};
-
-inline QUrl Utils::fromUserInput(const QString& userInput)
-{
- QFileInfo fileInfo(userInput);
- if (fileInfo.exists())
- return QUrl::fromLocalFile(fileInfo.absoluteFilePath());
- return QUrl::fromUserInput(userInput);
-}
-
-#endif // UTILS_H
diff --git a/examples/webengine/recipebrowser/doc/images/recipebrowser-demo.jpg b/examples/webengine/recipebrowser/doc/images/recipebrowser-demo.jpg
deleted file mode 100644
index 761ad3576..000000000
--- a/examples/webengine/recipebrowser/doc/images/recipebrowser-demo.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webengine/recipebrowser/doc/src/recipebrowser.qdoc b/examples/webengine/recipebrowser/doc/src/recipebrowser.qdoc
deleted file mode 100644
index 63a0af361..000000000
--- a/examples/webengine/recipebrowser/doc/src/recipebrowser.qdoc
+++ /dev/null
@@ -1,234 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \example webengine/recipebrowser
- \title WebEngine Recipe Browser
- \ingroup webengine-examples
- \brief A small hybrid application based on the WebEngineView QML type and Qt Quick Controls 2.
-
- \image recipebrowser-demo.jpg
-
- \e {Recipe Browser} demonstrates how to use the \l{WebEngineView} item, \l{Qt Quick} items, and
- \l{Qt Quick Controls 2} items to develop a small hybrid web browser application.
- A \l{ListView}-based item is used to display a list of recipe names. Clicking on
- a name causes the web view to load the respective recipe page. The overall appearance
- of the application is provided by the \l{Qt Quick Controls 2} items, which have their active
- style set to the \l{Material Style}{Material} style. The web content is a mix of HTML and
- Markdown source compiled to HTML, along with CSS and JavaScript.
-
- \include examples-run.qdocinc
-
- \section1 C++ Code
-
- In \c main.cpp, we use the \l{QGuiApplication} and \l{QQmlApplicationEngine}
- classes to set up and load the main QML file. We call \l{QtWebEngine::initialize} so we can use
- \l{WebEngineView} in our QML code. We enable high DPI screen support by setting the
- \l{Qt::AA_EnableHighDpiScaling} attribute. We set the default Qt Quick Controls 2 style
- to the Material style, so we do not have to specify it for each new item we add. Finally, we use
- a C++ define to check whether the application is compiled for an embedded platform.
- The value will be used in the main QML code to determine the window size.
-
- \quotefromfile webengine/recipebrowser/main.cpp
- \skipto #include
- \printuntil }
-
- \section1 QML Code
-
- In the \c main.qml file, we first create a top-level window and set a title for it. We also set
- up the size of the window depending on its primary orientation as well as the platform, so that
- the application is usable on both desktop and embedded platforms. On desktop, the size
- is constrained by a minimum of 320x480 pixels up to the maximum size that the screen supports.
- The default window size is 1024 pixels wide and 768 pixels high in landscape orientation.
- On embedded devices, the window will occupy the whole screen.
-
- \quotefromfile webengine/recipebrowser/resources/qml/main.qml
- \skipto ApplicationWindow
- \printuntil minimumHeight
-
- Next, we add a \l{RowLayout} item so we can divide the window into two parts: one being a
- custom \c RecipeList item containing the recipe titles, and the other being the
- \l{WebEngineView}, which shows the recipe details. The spacing is set to zero so the items are
- positioned directly next to each other.
-
- \printuntil RecipeList
- \dots 16
- \skipuntil webView.showRecipe
- \printline }
- \printuntil WebEngineView
- \dots 16
- \skipuntil busy.running = true
- \skipline }
- \skipline }
- \printline }
- \printline }
-
- The \c RecipeList item has a few \l{Layout}{attached Layout properties}, in order to scale the
- item to a maximum of one third of the layout width. We give the item focus, so that the keyboard
- can be used to navigate the recipes, in addition to using mouse and touch. We also add a handler
- for the custom \c recipeSelected signal, to tell the WebEngineView to load the URL of the
- selected recipe.
-
- \quotefromfile webengine/recipebrowser/resources/qml/main.qml
- \skipto RecipeList
- \printuntil }
-
- The WebEngineView has similar layout properties, to make it occupy two thirds of the layout
- width.
-
- \skipto WebEngineView
- \printuntil Layout.fillHeight
-
- We then disable the \l{WebEngineSettings::focusOnNavigationEnabled}{focusOnNavigationEnabled}
- setting to make sure that the \l{WebEngineView} does not steal focus from the \c RecipeList
- item every time its URL is changed. This allows the user to continue navigating through the
- recipes using the keyboard. We also disable the default context menu by accepting the
- ContextMenuRequest.
-
- \skipto focusOnNavigationEnabled
- \printuntil }
-
- When the application starts, instead of directly showing the \l{WebEngineView}, we show a
- placeholder \l{Rectangle} with a \l{BusyIndicator} to provide a nicer user experience while the
- application is loading.
-
- \printuntil }
- \dots 12
- \skipto Rectangle
- \printuntil }
-
- Once the first page in the view is loaded, we start a \l{Timer} that
- will hide the placeholder and show the actual page. The delay provides more time for the recipe
- images to load, so that when the view is shown, the page is completely rendered. The timer also
- shows a help \l{ToolTip} that informs the user on how to navigate the recipes.
-
- \quotefromfile webengine/recipebrowser/resources/qml/main.qml
- \skipto Timer {
- \printuntil }
-
- Let's see what the \c RecipeList item looks like from the inside. The root item is a
- FocusScope to allow transferring focus to the child ListView whenever the root item receives
- focus. We also declare a custom \c recipeSelected signal, which will be emitted when the current
- item of the ListView changes.
-
- \quotefromfile webengine/recipebrowser/resources/qml/RecipeList.qml
- \skipto FocusScope
- \printuntil recipeSelected
-
- A ColumnLayout holds a header \l{Label} above the ListView, and the ListView itself.
- Again, we set the spacing to zero and make sure the layout occupies the whole space of
- the parent item.
-
- \skipto ColumnLayout
- \printuntil anchors.fill
-
- Inside the layout there is a styled \l{ToolBar} item, with a \l{Label} inside of it serving as
- the ListView header.
-
- \skipto ToolBar
- \printuntil Label
- \printuntil }
- \printuntil }
-
- The second item inside the layout is a \l{ListView}, whose contents will fill the remaining
- space in the layout. We set \l{Item::}{clip} to true, so that the delegates that are scrolled
- up are not seen under the ToolBar item. We set \l{Item::}{focus} to true, so the ListView gains
- focus when the FocusScope does. We add a vertical scroll bar, so the user can scroll through the
- recipes if the window size is small. We also specify the recipe model to be used by the
- ListView as described later in this topic.
-
- \skipto ListView
- \printuntil model
-
- We have an \l{ItemDelegate} set as the ListView delegate, which displays the
- recipe title. The contentItem is a \l{Text} item, customized with a few properties to adjust the
- visual appearance and position of the text. We create a binding to the current delegate's model
- URL, so we can access the respective URL outside the delegate itself. We set the
- \l{ItemDelegate::}{highlighted} property to \c true whenever the item is the current one in the
- ListView to provide visual feedback. And we set the focus on the ListView whenever a delegate
- is clicked, so that keyboard navigation works in case the focus was previously in the
- WebEngineView.
-
- \skipto delegate
- \printuntil onClicked
- \printuntil }
- \printuntil }
-
- A handler is defined for the \c currentItemChanged signal to emit our own \c recipeSelected
- signal with the URL that the WebEngineView should load.
-
- \skipto onCurrentItemChanged
- \printuntil }
-
- We use a \l{ListModel} with seven \l{ListElement}s, each of which contains a recipe
- title and the URL to an HTML page contained in a resource file. The model is used to populate
- the ListView with the recipes and to show the recipe details in the WebEngineView.
-
- \skipto ListModel
- \printuntil Cupcakes
- \printuntil }
- \printuntil }
-
- We use a \l{ToolTip} item that is displayed on application startup to inform the users
- how they can navigate and view the details of each recipe. The ToolTip is shown using the
- \c showHelp method, which is invoked by the \l{Timer} in the main.qml file.
-
- \skipto ToolTip
- \printuntil help.open()
- \printuntil }
- \printuntil }
-
- An example of a recipe page can be seen below. The page uses two stylesheets and
- two JavaScript files:
- \list
- \li \l{http://kevinburke.bitbucket.org/markdowncss/}{markdown.css} is
- a markdown-friendly stylesheet created by Kevin Burke
- \li \l{https://github.com/chjj/marked}{marked.min.js} is a markdown parser and
- compiler designed for speed written by Christopher Jeffrey
- \li custom.css makes some small styling adjustments to the final recipe page
- \li custom.js is used to invoke the conversion of the recipe content (which is written in
- markdown syntax) into HTML
- \endlist
-
- The images on the pages are loaded from the compiled resource file.
-
- \quotefromfile webengine/recipebrowser/resources/pages/soup.html
- \printuntil </html>
-
- \section1 Files and Attributions
-
- The example bundles the following code with third-party licenses:
-
- \table
- \row
- \li \l{recipebrowser-marked}{Marked}
- \li MIT License
- \row
- \li \l{recipebrowser-markdowncss}{Markdown.css}
- \li Apache License 2.0
- \endtable
-*/
diff --git a/examples/webengine/recipebrowser/main.cpp b/examples/webengine/recipebrowser/main.cpp
deleted file mode 100644
index e61b9e0f5..000000000
--- a/examples/webengine/recipebrowser/main.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QGuiApplication>
-#include <QQmlApplicationEngine>
-#include <QQmlContext>
-#include <QQuickStyle>
-#include <qtwebengineglobal.h>
-
-int main(int argc, char *argv[])
-{
- QCoreApplication::setOrganizationName("QtExamples");
- QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
- QtWebEngine::initialize();
-
- QGuiApplication app(argc, argv);
-
- QQuickStyle::setStyle(QStringLiteral("Material"));
-
- QQmlApplicationEngine engine;
-
- bool isEmbedded = false;
-#ifdef QTWEBENGINE_RECIPE_BROWSER_EMBEDDED
- isEmbedded = true;
-#endif
- engine.rootContext()->setContextProperty(QStringLiteral("isEmbedded"), isEmbedded);
-
- engine.load(QUrl(QStringLiteral("qrc:/qml/main.qml")));
-
- return app.exec();
-}
diff --git a/examples/webengine/recipebrowser/recipebrowser.pro b/examples/webengine/recipebrowser/recipebrowser.pro
deleted file mode 100644
index 2c2145fc6..000000000
--- a/examples/webengine/recipebrowser/recipebrowser.pro
+++ /dev/null
@@ -1,21 +0,0 @@
-TEMPLATE = app
-
-QT += quick qml quickcontrols2 webengine
-
-cross_compile {
- posix|qnx|linux: DEFINES += QTWEBENGINE_RECIPE_BROWSER_EMBEDDED
-}
-
-SOURCES += main.cpp
-
-RESOURCES += resources/resources.qrc
-
-# Make sure Qt Quick compiler does not remove the source code of the .js files.
-QTQUICK_COMPILER_SKIPPED_RESOURCES = resources/resources.qrc
-
-DISTFILES += \
- resources/pages/assets/3rdparty/MARKDOWN-LICENSE.txt \
- resources/pages/assets/3rdparty/MARKED-LICENSE.txt
-
-target.path = $$[QT_INSTALL_EXAMPLES]/webengine/recipebrowser
-INSTALLS += target
diff --git a/examples/webengine/recipebrowser/resources/pages/assets/3rdparty/qt_attribution.json b/examples/webengine/recipebrowser/resources/pages/assets/3rdparty/qt_attribution.json
deleted file mode 100644
index a6c68f46f..000000000
--- a/examples/webengine/recipebrowser/resources/pages/assets/3rdparty/qt_attribution.json
+++ /dev/null
@@ -1,35 +0,0 @@
-[
- {
- "Id": "recipebrowser-marked",
- "Name": "Marked (WebEngine RecipeBrowser example)",
- "QDocModule": "qtwebengine",
- "QtUsage": "Marked is used in the WebEngine RecipeBrowser example",
- "QtParts": [ "examples" ],
- "Files": "marked.js",
- "Description": "A full-featured markdown parser and compiler, written in JavaScript. Built for speed.",
- "Homepage": "https://github.com/chjj/marked",
- "Version": "0.4.0",
- "DownloadLocation": "https://github.com/markedjs/marked/blob/0.4.0/lib/marked.js",
- "Copyright": "Copyright (c) 2011-2018, Christopher Jeffrey",
- "License": "MIT License",
- "LicenseId": "MIT",
- "LicenseFile": "MARKED-LICENSE.txt"
- },
- {
- "Id": "recipebrowser-markdowncss",
- "Name": "Markdown.css (WebEngine RecipeBrowser example)",
- "QDocModule": "qtwebengine",
- "QtUsage": "markdown.css is used in the WebEngine RecipeBrowser example",
- "QtParts": [ "examples" ],
- "Files": "markdown.css",
- "Description": "Markdown.css is better default styling for your Markdown files.",
- "Homepage": "https://kevinburke.bitbucket.io/markdowncss/",
- "Version": "188530e4b5d020d7e237fc6b26be13ebf4a8def3",
- "DownloadLocation": "https://bitbucket.org/kevinburke/markdowncss/src/188530e4b5d020d7e237fc6b26be13ebf4a8def3/markdown.css",
- "Copyright": "Copyright 2011 Kevin Burke
- Copyright Twitter Inc.",
- "License": "Apache License 2.0",
- "LicenseId": "Apache-2.0",
- "LicenseFile": "MARKDOWN-LICENSE.txt"
- }
-]
diff --git a/examples/webengine/recipebrowser/resources/pages/assets/custom.css b/examples/webengine/recipebrowser/resources/pages/assets/custom.css
deleted file mode 100644
index 6089ae580..000000000
--- a/examples/webengine/recipebrowser/resources/pages/assets/custom.css
+++ /dev/null
@@ -1,75 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-body {
- padding-top: 0;
- margin-top: 0;
-}
-
-#content {
- display: none;
-}
-
-img {
- width: 100%;
- height: 100%;
-}
-
-li {
- margin-left: 25px;
-}
-
-ol li {
- margin-bottom: 10px;
-}
-
-* {
- max-width: 960px !important;
-}
diff --git a/examples/webengine/recipebrowser/resources/pages/assets/custom.js b/examples/webengine/recipebrowser/resources/pages/assets/custom.js
deleted file mode 100644
index 25bdf851a..000000000
--- a/examples/webengine/recipebrowser/resources/pages/assets/custom.js
+++ /dev/null
@@ -1,67 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-marked.setOptions({
- renderer: new marked.Renderer(),
- gfm: true,
- tables: true,
- breaks: false,
- pedantic: false,
- sanitize: false,
- smartLists: true,
- smartypants: false
-});
-
-// Poor man document.ready();
-(function() {
- var placeholder = document.getElementById('placeholder');
- var content = document.getElementById('content');
- placeholder.innerHTML = marked(content.innerHTML);
-})();
diff --git a/examples/webengine/recipebrowser/resources/pages/burger.html b/examples/webengine/recipebrowser/resources/pages/burger.html
deleted file mode 100644
index 6651cc0f0..000000000
--- a/examples/webengine/recipebrowser/resources/pages/burger.html
+++ /dev/null
@@ -1,77 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta charset="utf-8">
- <title>Insanity Burger</title>
- <link rel="stylesheet" type="text/css" href="assets/3rdparty/markdown.css">
- <link rel="stylesheet" type="text/css" href="assets/custom.css">
-</head>
-<body>
- <div id="placeholder"></div>
- <div id="content">
-
-<img src="images/burger.jpg" alt="Insanity Burger" title="Insanity Burger" />
-
-Insanity burger
-===============
-
-### Ingredients
-
-* 800 g minced chuck steak
-* olive oil
-* 1 large red onion
-* 1 splash of white wine vinegar
-* 2 large gherkins
-* 4 sesame-topped brioche burger buns
-* 4-8 rashers of smoked streaky bacon
-* 4 teaspoons American mustard
-* Tabasco Chipotle sauce
-* 4 thin slices of Red Leicester cheese
-* 4 teaspoons tomato ketchup
-
-#### For the burger sauce
-* ¼ of an iceberg lettuce
-* 2 heaped tablespoons mayonnaise
-* 1 heaped tablespoon tomato ketchup
-* 1 teaspoon Tabasco Chipotle sauce
-* 1 teaspoon Worcestershire sauce
-* 1 teaspoon brandy, or bourbon (optional)
-
-### Instructions
-For the best burger, go to your butcher’s and ask them to mince 800g of chuck steak for you.
-This cut has a really good balance of fat and flavoursome meat. Divide it into 4 and, with wet
-hands, roll each piece into a ball, then press into flat patties roughly 12cm wide and about 2cm
-wider than your buns. Place on an oiled plate and chill in the fridge. Next, finely slice the red
-onion, then dress in a bowl with the vinegar and a pinch of sea salt. Slice the gherkins and halve
-the buns. Finely chop the lettuce and mix with the rest of the burger sauce ingredients in a bowl,
-then season to taste.
-
-I like to only cook 2 burgers at a time to achieve perfection, so get two pans on the go – a large
-non-stick pan on a high heat for your burgers and another on a medium heat for the bacon. Pat your
-burgers with oil and season them with salt and pepper. Put 2 burgers into the first pan, pressing
-down on them with a fish slice, then put half the bacon into the other pan. After 1 minute, flip
-the burgers and brush each cooked side with ½ a teaspoon of mustard and a dash of Tabasco. After
-another minute, flip onto the mustard side and brush again with another ½ teaspoon of mustard and
-a second dash of Tabasco on the other side. Cook for one more minute, by which point you can place
-some crispy bacon on top of each burger with a slice of cheese. Add a tiny splash of water to the
-pan and place a heatproof bowl over the burgers to melt the cheese – 30 seconds should do it. At the
-same time, toast 2 split buns in the bacon fat in the other pan until lightly golden. Repeat with
-the remaining two burgers.
-
-To build each burger, add a quarter of the burger sauce to the bun base, then top with a cheesy
-bacon burger, a quarter of the onions and gherkins. Rub the bun top with a teaspoon of ketchup,
-then gently press together. As the burger rests, juices will soak into the bun, so serve right
-away, which is great, or for an extra filthy experience, wrap each one in greaseproof paper, then
-give it a minute to go gorgeous and sloppy.
-
-**Enjoy!**
-
- </div><!--End of content-->
-
- <script src="assets/3rdparty/marked.js"></script>
- <script src="assets/custom.js"></script>
-</body>
-</html>
-
-
-
diff --git a/examples/webengine/recipebrowser/resources/pages/cupcakes.html b/examples/webengine/recipebrowser/resources/pages/cupcakes.html
deleted file mode 100644
index 4791c7ffa..000000000
--- a/examples/webengine/recipebrowser/resources/pages/cupcakes.html
+++ /dev/null
@@ -1,55 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta charset="utf-8">
- <title>Cupcakes</title>
- <link rel="stylesheet" type="text/css" href="assets/3rdparty/markdown.css">
- <link rel="stylesheet" type="text/css" href="assets/custom.css">
-</head>
-<body>
- <div id="placeholder"></div>
- <div id="content">
-
-<img src="images/cupcakes.jpg" alt="Cupcakes" title="Cupcakes" />
-
-Cupcakes
-=============
-
-### Ingredients
-
-* 300 g caster sugar
-* 150 ml sunflower oil
-* 1 teaspoon vanilla extract
-* 500 g dairy-free soya yoghurt
-* 2 teaspoons cider vinegar
-* 350 g plain flour
-* 1 teaspoon bicarbonate of soda
-* 1½ teaspoons baking powder
-
-#### For the vegan vanilla icing
-* 200 g dairy-free soya spread , chilled
-* 660 g icing sugar
-* ½ teaspoon vanilla extract
-
-### Instructions
-1. Preheat the oven to 170°C fan/375°F/gas 5.
-2. Place the sugar, oil and vanilla extract in a large bowl, then beat with an electric mixer for 1 to 2 minutes, until well combined.
-3. Mix the yoghurt and vinegar together in a bowl, then add to the mixture and beat for 1 to 2 minutes.
-4. Add the remaining cupcake ingredients and 1 teaspoon of fine sea salt, then whisk until smooth and just combined.
-5. Fill the paper cases two-thirds full with mixture, but don’t bother to smooth it out.
-6. Bake for 20 minutes, or until they spring back when touched. Leave to cool, transferring to a wire cooling rack after 5 minutes.
-7. Meanwhile, make the icing. Beat the soya spread with an electric mixer for 1 to 2 minutes, or until smooth.
-8. Sift the icing sugar into a large bowl, then add to the soya spread in two stages, beating well between each.
-9. Add the vanilla extract and a small splash of water, then whisk for a further few minutes, or until silky smooth – if it’s too stiff, add a splash more water to loosen.
-10. Once the cupcakes are cool, decorate them with the icing and add a few sprinkles too if you like – whatever takes your fancy – then enjoy.
-
-**Enjoy!**
-
- </div><!--End of content-->
- <script src="assets/3rdparty/marked.js"></script>
- <script src="assets/custom.js"></script>
-</body>
-</html>
-
-
-
diff --git a/examples/webengine/recipebrowser/resources/pages/pasta.html b/examples/webengine/recipebrowser/resources/pages/pasta.html
deleted file mode 100644
index 41ed1a756..000000000
--- a/examples/webengine/recipebrowser/resources/pages/pasta.html
+++ /dev/null
@@ -1,58 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta charset="utf-8">
- <title>Pasta</title>
- <link rel="stylesheet" type="text/css" href="assets/3rdparty/markdown.css">
- <link rel="stylesheet" type="text/css" href="assets/custom.css">
-</head>
-<body>
- <div id="placeholder"></div>
- <div id="content">
-
-<img src="images/pasta.jpg" alt="Pasta" title="Pasta" />
-
-Pasta
-=============
-
-### Ingredients
-
-* 2 red peppers , deseeded and sliced
-* 2 yellow peppers , deseeded and sliced
-* extra virgin olive oil
-* sea salt
-* freshly ground black pepper
-* 2 red onions , peeled and finely sliced
-* 2 cloves garlic , peeled and grated
-* 2 handfuls fresh flat-leaf parsley , leaves finely chopped, stalks reserved
-* 2 tablespoons red wine vinegar or balsamic vinegar
-* 2 handfuls Parmesan cheese , grated
-* 2 heaped tablespoons mascarpone cheese or crème fraîche , optional
-* 455 g rigatoni, penne or spaghetti
-
-
-### Instructions
-1. Put all the peppers in a large frying pan over a medium heat with a little olive oil and a pinch of salt and pepper.
-2. Place a lid on, and cook slowly for 15 minutes until softened. Don't rush this too much, as cooking the peppers slowly like this really helps to bring out the flavour.
-3. Add the onion and cook for a further 20 minutes.
-4. Then add the garlic and parsley stalks and toss around, keeping everything moving in the pan.
-5. Cook for about 3 minutes most. Have a little taste, and season with a bit more salt and pepper.
-5. Add the vinegar - it will sizzle away, so give everything a good toss.
-6. Then add one handful of the grated Parmesan and the mascarpone or crème fraîche if you are using it and turn the heat down to minimum while you cook the pasta.
-7. Meanwhile put a large pot of salted water on to boil.
-8. Add the pasta to the boiling water and cook according to the packet instructions.
-9. When cooked, drain in a colander, reserving some of the cooking water.
-10. Put the peppers, pasta and parsley leaves into a large warmed bowl.
-11. Give them a good toss together, then add a little of the pasta cooking water and a few good lugs of extra virgin olive oil to coat the pasta nicely.
-12. Serve straight away sprinkled with the rest of the Parmesan.
-
-**Enjoy!**
-
- </div><!--End of content-->
- <script src="assets/3rdparty/marked.js"></script>
- <script src="assets/custom.js"></script>
-</body>
-</html>
-
-
-
diff --git a/examples/webengine/recipebrowser/resources/pages/pizza.html b/examples/webengine/recipebrowser/resources/pages/pizza.html
deleted file mode 100644
index 348d809e8..000000000
--- a/examples/webengine/recipebrowser/resources/pages/pizza.html
+++ /dev/null
@@ -1,49 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta charset="utf-8">
- <title>Pizza Diavola</title>
- <link rel="stylesheet" type="text/css" href="assets/3rdparty/markdown.css">
- <link rel="stylesheet" type="text/css" href="assets/custom.css">
-</head>
-<body>
- <div id="placeholder"></div>
- <div id="content">
-
-<img src="images/pizza.jpg" alt="Pizza Diavola" title="Pizza Diavola" />
-
-Pizza Diavola
-=============
-
-### Ingredients
-
-* 2 pizza dough balls
-* 100g Mozzarella
-* 400g Passata
-* 200 g Spicy Salami
-* 2 fresh chillies
-* Extra virgin olive oil
-* Salt
-
-### Instructions
-1. Preheat oven to 210 oc.
-2. Get your pizza dough balls ( depending on how many you are making) and roll them out to about 12 inches diameter using your hands in a circular stretching technique or using a rolling pin.
-3. With the dough prepared now get our sauce ready by mixing the passata with three tbsp of the olive oil and a good pinch of salt.
-4. Now slice up your salami into thin-ish slices and also finely chop the fresh chillies.
-5. Next, slice or dice your mozzarella and we are ready to dress the pizza.
-6. Add half the tomato sauce to each base and spread evenly leaving a half inch perimeter.
-7. Add the mozzarella, salami and finish with the chillies.
-8. Finally drizzle with some more olive oil and your are ready to cook your pizza diavola.
-9. Place in the oven for ten minutes or until golden.
-10. Remove from the oven, slice, and enjoy your pizza diavola.
-
-**Enjoy!**
-
- </div><!--End of content-->
- <script src="assets/3rdparty/marked.js"></script>
- <script src="assets/custom.js"></script>
-</body>
-</html>
-
-
-
diff --git a/examples/webengine/recipebrowser/resources/pages/skewers.html b/examples/webengine/recipebrowser/resources/pages/skewers.html
deleted file mode 100644
index aca4c4859..000000000
--- a/examples/webengine/recipebrowser/resources/pages/skewers.html
+++ /dev/null
@@ -1,55 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta charset="utf-8">
- <title>Grilled skewers</title>
- <link rel="stylesheet" type="text/css" href="assets/3rdparty/markdown.css">
- <link rel="stylesheet" type="text/css" href="assets/custom.css">
-</head>
-<body>
- <div id="placeholder"></div>
- <div id="content">
-
-<img src="images/skewers.jpg" alt="Grilled skewers" title="Grilled skewers" />
-
-Grilled skewers
-======================
-
-### Ingredients
-
-* 3 cloves of garlic
-* 200g kefalotyri cheese
-* 2 medium aubergine
-* 1 iceberg lettuce
-* 1 tablespoon coriander seeds
-* 2 teaspoons dried oregano
-* 2 lemons
-* 4 tablespoons olive oil
-* 600g lamb neck fillet , in 2cm chunks
-* 12 fresh bay leaves
-
-### Instructions
-1. Peel and crush the garlic.
-2. Chop the cheese into bite-sized pieces, trim and chop the aubergines into 2cm chunks, and trim and finely slice the lettuce.
-3. Finely crush the coriander seeds in a pestle and mortar and add to a large bowl with the oregano and garlic. Finely grate in the lemon zest (reserve the zested lemons) and stir in the oil.
-4. Season, then add the cheese, lamb, aubergines and bay leaves. Leave to marinate for at least an hour, or overnight if you can.
-5. Meanwhile, pickle your cabbage. Trim, core and finely slice the cabbage, then place in a colander in the sink or over a bowl and toss with 2 teaspoons of sea salt. Cover and set aside for at least 2 hours, then rinse.
-6. Peel and finely slice the onions, then transfer to a bowl along with the cabbage.
-7. Put the remaining ingredients in a pan and bring to a boil. Simmer for 10 minutes, then pour over the cabbage and onions. Transfer to sterilised jars – this will keep for up to 1 month.
-8. For the flatbreads, put the flour, baking powder, buttermilk and half of the sesame seeds in a bowl and mix until everything is combined.
-9. Tip onto a lightly floured surface and knead briefly. Divide into six, using a rolling pin to roll them into 1 to 2mm rounds.
-10. Scatter with the remaining sesame seeds and run the rolling pin over them. Pop the flatbreads onto the hot barbecue for 1 to 2 minutes on each side.
-11. Load 12 skewers with the cheese, lamb, aubergines and bay leaves, then place on the barbecue (not directly over the coals) for 20 to 25 minutes, turning often, until the lamb is medium-rare and the aubergines are cooked.
-12. Serve the lamb with the flatbreads, cabbage, lettuce and lemon wedges.
-
-**Enjoy!**
-
- </div><!--End of content-->
-
- <script src="assets/3rdparty/marked.js"></script>
- <script src="assets/custom.js"></script>
-</body>
-</html>
-
-
-
diff --git a/examples/webengine/recipebrowser/resources/pages/soup.html b/examples/webengine/recipebrowser/resources/pages/soup.html
deleted file mode 100644
index 1b7027e5d..000000000
--- a/examples/webengine/recipebrowser/resources/pages/soup.html
+++ /dev/null
@@ -1,43 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta charset="utf-8">
- <title>Soup</title>
- <link rel="stylesheet" type="text/css" href="assets/3rdparty/markdown.css">
- <link rel="stylesheet" type="text/css" href="assets/custom.css">
-</head>
-<body>
- <div id="placeholder"></div>
- <div id="content">
-
-<img src="images/soup.jpg" alt="Soup" title="Soup" />
-
-Soup
-=============
-
-### Ingredients
-
-* 2 potatoes
-* 2 onions
-* 2 cloves of garlic
-* olive oil
-* 400 ml organic stock
-* 3 bunches of watercress
-
-### Instructions
-* Peel and roughly chop the potatoes, onions and garlic.
-* In a large saucepan, heat a little olive oil, then sauté the potato, onion and garlic until the onions are translucent.
-* Add the stock and simmer until the potato is soft. Chop and add the watercress and simmer for a further 3 to 4 minutes.
-* Using a hand blender, liquidise the soup until smooth.
-* Serve with a swirl of crème fraîche and some Fortt’s Bath Oliver biscuits, if you like.
-
-**Enjoy!**
-
- </div><!--End of content-->
- <script src="assets/3rdparty/marked.js"></script>
- <script src="assets/custom.js"></script>
-</body>
-</html>
-
-
-
diff --git a/examples/webengine/recipebrowser/resources/pages/steak.html b/examples/webengine/recipebrowser/resources/pages/steak.html
deleted file mode 100644
index a56313e27..000000000
--- a/examples/webengine/recipebrowser/resources/pages/steak.html
+++ /dev/null
@@ -1,69 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta charset="utf-8">
- <title>Grilled steak and rice</title>
- <link rel="stylesheet" type="text/css" href="assets/3rdparty/markdown.css">
- <link rel="stylesheet" type="text/css" href="assets/custom.css">
-</head>
-<body>
- <div id="placeholder"></div>
- <div id="content">
-
-<img src="images/steak.jpg" alt="Grilled steak and rice" title="Grilled steak and rice" />
-
-Grilled steak and rice
-======================
-
-### Ingredients
-
-#### For the ratatouille
-* courgette
-* 1 small aubergine
-* 2 mixed-color peppers
-* 1 red onion
-* 1 heaped teaspoon harissa
-* 2 anchovy fillets
-* 2-4 cloves of garlic
-* 700 g passata
-* 1 tablespoon balsamic vinegar
-* ½ bunch fresh basil
-* 2 tablespoons fat-free natural yoghurt
-
-#### For the rice
-* 1 mug (300g) 10-minute wholegrain or basmati rice
-* 1 good pinch saffron
-* ½ lemon
-
-#### For the steak
-* 2 x 250 g quality sirloin steaks, fat removed
-* 1 teaspoon sweet paprika olive oil
-* ½ bunch fresh flat-leaf parsley
-* 1 heaped teaspoon Dijon mustard
-* 1 tablespoon extra virgin olive oil
-* ½ lemon
-
-### Instructions
-1. Halve the courgette lengthways, slice the aubergine 1cm thick and place both on the griddle pan, turning when charred.
-2. Put 1 mug of rice, 2 mugs of boiling water, the saffron, lemon half and a pinch of salt into the small pan, cover and cook until fluffy, stirring occasionally.
-3. Tear the seeds and stalks out of the peppers, then roughly chop with the peeled red onion and put into the casserole pan with the harissa, anchovies and 1 teaspoon of their oil.
-4. Squash in the unpeeled garlic through a garlic crusher and stir regularly.
-5. Remove the charred courgette and aubergine from the griddle pan, leaving it on the heat, and roughly chop them on a board.
-6. Add them to the casserole pan along with the passata and vinegar, and boil with the lid on.
-7. Rub the steaks with salt, the paprika and 1 teaspoon of olive oil and place on the hot griddle pan, turning every minute until cooked to your liking.
-8. On a board, finely slice the parsley stalks and roughly chop the leaves.
-9. Add the mustard and extra virgin olive oil, season with salt and pepper and squeeze over the lemon juice, then mix together and spread over the board.
-10. When the steaks are done, transfer them to the board, turn in the dressing, then slice.
-11. Tear the top leafy half of the basil into the ratatouille, season to taste, and serve with yoghurt and saffron rice.
-
-**Enjoy!**
-
- </div><!--End of content-->
-
- <script src="assets/3rdparty/marked.js"></script>
- <script src="assets/custom.js"></script>
-</body>
-</html>
-
-
-
diff --git a/examples/webengine/recipebrowser/resources/qml/RecipeList.qml b/examples/webengine/recipebrowser/resources/qml/RecipeList.qml
deleted file mode 100644
index 41806986c..000000000
--- a/examples/webengine/recipebrowser/resources/qml/RecipeList.qml
+++ /dev/null
@@ -1,172 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.1
-import QtQuick.Controls 2.0
-import QtQuick.Controls.Material 2.0
-import QtQuick.Layouts 1.0
-
-FocusScope {
- id: root
- signal recipeSelected(url url)
-
- ColumnLayout {
- spacing: 0
- anchors.fill: parent
-
- ToolBar {
- id: headerBackground
- Layout.fillWidth: true
- implicitHeight: headerText.height + 20
-
- Label {
- id: headerText
- width: parent.width
- text: qsTr("Favorite recipes")
- padding: 10
- anchors.centerIn: parent
- }
- }
-
- ListView {
- id: listView
- Layout.fillWidth: true
- Layout.fillHeight: true
- keyNavigationWraps: true
- clip: true
- focus: true
- ScrollBar.vertical: ScrollBar { }
-
- model: recipeModel
-
- delegate: ItemDelegate {
- width: parent.width
- text: model.name
- contentItem: Text {
- text: parent.text
- font: parent.font
- color: parent.enabled ? parent.Material.primaryTextColor
- : parent.Material.hintTextColor
- elide: Text.ElideRight
- horizontalAlignment: Text.AlignLeft
- verticalAlignment: Text.AlignVCenter
- wrapMode: Text.Wrap
- }
-
- property url url: model.url
- highlighted: ListView.isCurrentItem
-
- onClicked: {
- listView.forceActiveFocus()
- listView.currentIndex = model.index
- }
- }
-
- onCurrentItemChanged: {
- root.recipeSelected(currentItem.url)
- }
-
- ListModel {
- id: recipeModel
-
- ListElement {
- name: "Pizza Diavola"
- url: "qrc:///pages/pizza.html"
- }
- ListElement {
- name: "Steak"
- url: "qrc:///pages/steak.html"
- }
- ListElement {
- name: "Burger"
- url: "qrc:///pages/burger.html"
- }
- ListElement {
- name: "Soup"
- url: "qrc:///pages/soup.html"
- }
- ListElement {
- name: "Pasta"
- url: "qrc:///pages/pasta.html"
- }
- ListElement {
- name: "Grilled Skewers"
- url: "qrc:///pages/skewers.html"
- }
- ListElement {
- name: "Cupcakes"
- url: "qrc:///pages/cupcakes.html"
- }
- }
-
- ToolTip {
- id: help
- implicitWidth: root.width - padding * 3
- y: root.y + root.height
- delay: 1000
- timeout: 5000
- text: qsTr("Use keyboard, mouse, or touch controls to navigate through the\
- recipes.")
-
- contentItem: Text {
- text: help.text
- font: help.font
- color: help.Material.primaryTextColor
- wrapMode: Text.Wrap
- }
- }
- }
- }
-
- function showHelp() {
- help.open()
- }
-}
-
diff --git a/examples/webengine/recipebrowser/resources/qml/main.qml b/examples/webengine/recipebrowser/resources/qml/main.qml
deleted file mode 100644
index a9893ed67..000000000
--- a/examples/webengine/recipebrowser/resources/qml/main.qml
+++ /dev/null
@@ -1,168 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQml 2.0
-import QtQuick 2.1
-import QtQuick.Controls 2.0
-import QtQuick.Controls.Material 2.0
-import QtQuick.Layouts 1.0
-import QtQuick.Window 2.0
-import QtWebEngine 1.4
-
-ApplicationWindow {
- id: appWindow
- title: qsTr("Recipe Browser")
- visible: true
-
- property int shorterDesktop: 768
- property int longerDesktop: 1024
- property int shorterMin: 360
- property int longerMin: 480
- property bool isPortrait: Screen.primaryOrientation === Qt.PortraitOrientation
- width: {
- if (isEmbedded)
- return Screen.width
- var potentialWidth = shorterDesktop
- if (!isPortrait)
- potentialWidth = longerDesktop
- return potentialWidth > Screen.width ? Screen.width : potentialWidth
- }
- height: {
- if (isEmbedded)
- return Screen.height
- var potentialHeight = longerDesktop
- if (!isPortrait)
- potentialHeight = shorterDesktop
- return potentialHeight > Screen.height ? Screen.height : potentialHeight
- }
- minimumWidth: isPortrait ? shorterMin : longerMin
- minimumHeight: isPortrait ? longerMin : shorterMin
-
- RowLayout {
- id: container
- anchors.fill: parent
- spacing: 0
-
- RecipeList {
- id: recipeList
- Layout.minimumWidth: 124
- Layout.preferredWidth: parent.width / 3
- Layout.maximumWidth: 300
- Layout.fillWidth: true
- Layout.fillHeight: true
- focus: true
- activeFocusOnTab: true
- onRecipeSelected: function(url) {
- webView.showRecipe(url)
- }
- }
-
- WebEngineView {
- id: webView
- Layout.preferredWidth: 2 * parent.width / 3
- Layout.fillWidth: true
- Layout.fillHeight: true
- // Make sure focus is not taken by the web view, so user can continue navigating
- // recipes with the keyboard.
- settings.focusOnNavigationEnabled: false
-
- onContextMenuRequested: function(request) {
- request.accepted = true
- }
-
- property bool firstLoadComplete: false
- onLoadingChanged: function(loadRequest) {
- if (loadRequest.status === WebEngineView.LoadSucceededStatus
- && !firstLoadComplete) {
- // Debounce the showing of the web content, so images are more likely
- // to have loaded completely.
- showTimer.start()
- }
- }
-
- Timer {
- id: showTimer
- interval: 500
- repeat: false
- onTriggered: {
- webView.show(true)
- webView.firstLoadComplete = true
- recipeList.showHelp()
- }
- }
-
- Rectangle {
- id: webViewPlaceholder
- anchors.fill: parent
- z: 1
- color: "white"
-
- BusyIndicator {
- id: busy
- anchors.centerIn: parent
- }
- }
-
- function showRecipe(url) {
- webView.url = url
- }
-
- function show(show) {
- if (show === true) {
- busy.running = false
- webViewPlaceholder.visible = false
- } else {
- webViewPlaceholder.visible = true
- busy.running = true
- }
- }
- }
- }
-}
diff --git a/examples/webengine/recipebrowser/resources/resources.qrc b/examples/webengine/recipebrowser/resources/resources.qrc
deleted file mode 100644
index bd13dcfae..000000000
--- a/examples/webengine/recipebrowser/resources/resources.qrc
+++ /dev/null
@@ -1,27 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>qml/main.qml</file>
- <file>qml/RecipeList.qml</file>
-
- <file>pages/pizza.html</file>
- <file>pages/burger.html</file>
- <file>pages/steak.html</file>
- <file>pages/soup.html</file>
- <file>pages/pasta.html</file>
- <file>pages/skewers.html</file>
- <file>pages/cupcakes.html</file>
-
- <file>pages/assets/3rdparty/marked.js</file>
- <file>pages/assets/3rdparty/markdown.css</file>
- <file>pages/assets/custom.css</file>
- <file>pages/assets/custom.js</file>
-
- <file>pages/images/burger.jpg</file>
- <file>pages/images/pizza.jpg</file>
- <file>pages/images/steak.jpg</file>
- <file>pages/images/soup.jpg</file>
- <file>pages/images/pasta.jpg</file>
- <file>pages/images/skewers.jpg</file>
- <file>pages/images/cupcakes.jpg</file>
- </qresource>
-</RCC>
diff --git a/examples/webengine/webengine.pro b/examples/webengine/webengine.pro
deleted file mode 100644
index 058868395..000000000
--- a/examples/webengine/webengine.pro
+++ /dev/null
@@ -1,13 +0,0 @@
-TEMPLATE=subdirs
-
-SUBDIRS += \
- customdialogs \
- minimal \
- quicknanobrowser \
- webengineaction
-
-qtHaveModule(quickcontrols2) {
- SUBDIRS += \
- lifecycle \
- recipebrowser
-}
diff --git a/examples/webengine/webengineaction/doc/images/webengineaction-example.png b/examples/webengine/webengineaction/doc/images/webengineaction-example.png
deleted file mode 100644
index 2e34bbf63..000000000
--- a/examples/webengine/webengineaction/doc/images/webengineaction-example.png
+++ /dev/null
Binary files differ
diff --git a/examples/webengine/webengineaction/doc/src/webengineaction.qdoc b/examples/webengine/webengineaction/doc/src/webengineaction.qdoc
deleted file mode 100644
index 672f86f0f..000000000
--- a/examples/webengine/webengineaction/doc/src/webengineaction.qdoc
+++ /dev/null
@@ -1,68 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \example webengine/webengineaction
- \title WebEngine Action Example
- \ingroup webengine-examples
- \brief A simple browser implemented using WebEngineActions.
-
- \image webengineaction-example.png
-
- \e {WebEngine Action Example} demonstrates how to perform actions on a web page
- using the \l{WebEngineAction} type. It shows the minimum amount of code needed
- to bind browser functionalities to input elements and build up a custom context
- menu.
-
- \include examples-run.qdocinc
-
- \section1 Working With Web Engine Actions
-
- An intended use of \l{WebEngineAction} is building a connection between UI
- elements and browser commands. It can be added to menus and toolbars via
- assigning its properties to the corresponding ones of the element.
-
- The \l{ToolButton} relies on the properties provided by a
- \l{WebEngineAction}. Clicking the button triggers backwards navigation on the
- originating \l{WebEngineView} of the action.
-
- \quotefromfile webengine/webengineaction/main.qml
- \skipto ToolButton {
- \printuntil }
-
- The simplest way to create custom context menus is enumerating the required
- \l{WebEngineAction} types in a data model and instantiating \l{MenuItem} types
- for them, for example using a \l{Repeater}.
-
- \quotefromfile webengine/webengineaction/main.qml
- \skipto property Menu contextMenu: Menu {
- \printuntil /^ {8}\}/
-
- Assigning a \l{WebEngineAction} to multiple UI elements will keep them in sync.
- As it can be seen in the picture above, if the browser engine disables a
- navigation action, both corresponding menu items will be disabled.
-*/
diff --git a/examples/webengine/webengineaction/main.cpp b/examples/webengine/webengineaction/main.cpp
deleted file mode 100644
index f2dec9655..000000000
--- a/examples/webengine/webengineaction/main.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QGuiApplication>
-#include <QQmlApplicationEngine>
-#include <qtwebengineglobal.h>
-
-int main(int argc, char *argv[])
-{
- QCoreApplication::setOrganizationName("QtExamples");
- QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
- QtWebEngine::initialize();
-
- QGuiApplication app(argc, argv);
-
- QQmlApplicationEngine engine;
- engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
-
- return app.exec();
-}
diff --git a/examples/webengine/webengineaction/main.qml b/examples/webengine/webengineaction/main.qml
deleted file mode 100644
index a3933ee41..000000000
--- a/examples/webengine/webengineaction/main.qml
+++ /dev/null
@@ -1,166 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtQuick.Window 2.0
-import QtWebEngine 1.7
-import QtQuick.Controls 2.4
-import QtQuick.Layouts 1.11
-
-ApplicationWindow {
- id: window
- visible: true
- width: 800
- height: 600
- title: qsTr("WebEngineAction Example")
-
- header: ToolBar {
- RowLayout {
- anchors.fill: parent
-
- ToolButton {
- property int itemAction: WebEngineView.Back
- text: webEngineView.action(itemAction).text
- enabled: webEngineView.action(itemAction).enabled
- onClicked: webEngineView.action(itemAction).trigger()
- icon.name: webEngineView.action(itemAction).iconName
- display: AbstractButton.TextUnderIcon
- }
-
- ToolButton {
- property int itemAction: WebEngineView.Forward
- text: webEngineView.action(itemAction).text
- enabled: webEngineView.action(itemAction).enabled
- onClicked: webEngineView.action(itemAction).trigger()
- icon.name: webEngineView.action(itemAction).iconName
- display: AbstractButton.TextUnderIcon
- }
-
- ToolButton {
- property int itemAction: webEngineView.loading ? WebEngineView.Stop : WebEngineView.Reload
- text: webEngineView.action(itemAction).text
- enabled: webEngineView.action(itemAction).enabled
- onClicked: webEngineView.action(itemAction).trigger()
- icon.name: webEngineView.action(itemAction).iconName
- display: AbstractButton.TextUnderIcon
- }
-
- TextField {
- Layout.fillWidth: true
-
- text: webEngineView.url
- selectByMouse: true
- onEditingFinished: webEngineView.url = text
- }
-
- ToolButton {
- id: settingsButton
- text: "Settings"
- icon.name: "settings-configure"
- display: AbstractButton.TextUnderIcon
- onClicked: settingsMenu.open()
- checked: settingsMenu.visible
-
- Menu {
- id: settingsMenu
- y: settingsButton.height
-
- MenuItem {
- id: customContextMenuOption
- checkable: true
- checked: true
-
- text: "Custom context menu"
- }
- }
- }
- }
- }
-
- WebEngineView {
- id: webEngineView
- url: "https://qt.io"
- anchors.fill: parent
-
- Component.onCompleted: {
- profile.downloadRequested.connect(function(download){
- download.accept();
- })
- }
-
- property Menu contextMenu: Menu {
- Repeater {
- model: [
- WebEngineView.Back,
- WebEngineView.Forward,
- WebEngineView.Reload,
- WebEngineView.SavePage,
- WebEngineView.Copy,
- WebEngineView.Paste,
- WebEngineView.Cut
- ]
- MenuItem {
- text: webEngineView.action(modelData).text
- enabled: webEngineView.action(modelData).enabled
- onClicked: webEngineView.action(modelData).trigger()
- icon.name: webEngineView.action(modelData).iconName
- display: MenuItem.TextBesideIcon
- }
- }
- }
-
- onContextMenuRequested: function(request) {
- if (customContextMenuOption.checked) {
- request.accepted = true;
- contextMenu.popup();
- }
- }
- }
-}
diff --git a/examples/webengine/webengineaction/webengineaction.pro b/examples/webengine/webengineaction/webengineaction.pro
deleted file mode 100644
index 13cc4602d..000000000
--- a/examples/webengine/webengineaction/webengineaction.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-TEMPLATE = app
-
-QT += webengine
-
-SOURCES += main.cpp
-
-RESOURCES += qml.qrc
-
-target.path = $$[QT_INSTALL_EXAMPLES]/webengine/webengineaction
-INSTALLS += target
diff --git a/examples/webenginequick/CMakeLists.txt b/examples/webenginequick/CMakeLists.txt
new file mode 100644
index 000000000..ec29a1e58
--- /dev/null
+++ b/examples/webenginequick/CMakeLists.txt
@@ -0,0 +1,5 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+qt_internal_add_example(lifecycle)
+qt_internal_add_example(quicknanobrowser)
diff --git a/examples/webenginequick/lifecycle/CMakeLists.txt b/examples/webenginequick/lifecycle/CMakeLists.txt
new file mode 100644
index 000000000..46478b622
--- /dev/null
+++ b/examples/webenginequick/lifecycle/CMakeLists.txt
@@ -0,0 +1,55 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+project(lifecycle LANGUAGES CXX)
+
+set(CMAKE_AUTOMOC ON)
+
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webenginequick/lifecycle")
+
+find_package(Qt6 REQUIRED COMPONENTS Core Gui QuickControls2 WebEngineQuick)
+
+qt_add_executable(lifecycle
+ main.cpp
+ utils.h
+)
+
+set_target_properties(lifecycle PROPERTIES
+ WIN32_EXECUTABLE TRUE
+ MACOSX_BUNDLE TRUE
+)
+
+target_link_libraries(lifecycle PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::WebEngineQuick
+)
+
+# Resources:
+set(resources_resource_files
+ "WebBrowser.qml"
+ "WebTab.qml"
+ "WebTabBar.qml"
+ "WebTabButton.qml"
+ "WebTabStack.qml"
+ "WebToolButton.qml"
+ "qtquickcontrols2.conf"
+)
+
+qt_add_resources(lifecycle "resources"
+ PREFIX
+ "/"
+ FILES
+ ${resources_resource_files}
+)
+
+install(TARGETS lifecycle
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/webenginequick/lifecycle/WebBrowser.qml b/examples/webenginequick/lifecycle/WebBrowser.qml
new file mode 100644
index 000000000..43edcc537
--- /dev/null
+++ b/examples/webenginequick/lifecycle/WebBrowser.qml
@@ -0,0 +1,125 @@
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls.Material
+import QtQuick.Layouts
+import QtQuick.Window
+
+ApplicationWindow {
+ id: root
+
+ readonly property Action newTabAction: Action {
+ text: qsTr("New tab")
+ shortcut: StandardKey.AddTab
+ onTriggered: root.createNewTab({url: "about:blank"})
+ }
+
+ visible: true
+ width: Screen.width * 0.5
+ height: Screen.height * 0.5
+ title: tabStack.currentTab ? tabStack.currentTab.title : ""
+
+ header: WebTabBar {
+ id: tabBar
+
+ z: 1
+
+ newTabAction: root.newTabAction
+ }
+
+ WebTabStack {
+ id: tabStack
+
+ z: 0
+ anchors.fill: parent
+
+ currentIndex: tabBar.currentIndex
+ freezeDelay: freezeSpin.enabled && freezeSpin.value
+ discardDelay: discardSpin.enabled && discardSpin.value
+
+ onCloseRequested: function(index) {
+ root.closeTab(index)
+ }
+
+ onDrawerRequested: drawer.toggle()
+ }
+
+ Drawer {
+ id: drawer
+
+ edge: Qt.RightEdge
+ height: root.height
+
+ Control {
+ padding: 16
+ contentItem: ColumnLayout {
+ Label {
+ Layout.alignment: Qt.AlignHCenter
+ text: qsTr("Settings")
+ font.capitalization: Font.AllUppercase
+ }
+ MenuSeparator {}
+ CheckBox {
+ id: lifecycleCheck
+ text: qsTr("Automatic lifecycle control")
+ checked: true
+ }
+ CheckBox {
+ id: freezeCheck
+ text: qsTr("Freeze after delay (seconds)")
+ enabled: lifecycleCheck.checked
+ checked: true
+ }
+ SpinBox {
+ id: freezeSpin
+ editable: true
+ enabled: freezeCheck.checked
+ value: 60
+ from: 1
+ to: 60*60
+ }
+ CheckBox {
+ id: discardCheck
+ text: qsTr("Discard after delay (seconds)")
+ enabled: lifecycleCheck.checked
+ checked: true
+ }
+ SpinBox {
+ id: discardSpin
+ editable: true
+ enabled: discardCheck.checked
+ value: 60*60
+ from: 1
+ to: 60*60
+ }
+ }
+ }
+
+ function toggle() {
+ if (drawer.visible)
+ drawer.close()
+ else
+ drawer.open()
+ }
+ }
+
+ Component.onCompleted: {
+ createNewTab({url: "https://www.qt.io"})
+ }
+
+ function createNewTab(properties) {
+ const tab = tabStack.createNewTab(properties)
+ tabBar.createNewTab({tab: tab})
+ tabBar.currentIndex = tab.index
+ return tab
+ }
+
+ function closeTab(index) {
+ if (tabStack.count == 1)
+ Qt.quit()
+ tabBar.closeTab(index)
+ tabStack.closeTab(index)
+ }
+}
diff --git a/examples/webenginequick/lifecycle/WebTab.qml b/examples/webenginequick/lifecycle/WebTab.qml
new file mode 100644
index 000000000..6fb6cb386
--- /dev/null
+++ b/examples/webenginequick/lifecycle/WebTab.qml
@@ -0,0 +1,165 @@
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQml
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls.Material
+import QtQuick.Layouts
+import QtWebEngine
+
+ColumnLayout {
+ id: root
+
+ signal closeRequested
+ signal drawerRequested
+
+ property int freezeDelay
+ property int discardDelay
+
+ property alias icon : view.icon
+ property alias loading : view.loading
+ property alias url : view.url
+ property alias lifecycleState : view.lifecycleState
+ property alias recommendedState : view.recommendedState
+
+ readonly property string title : {
+ if (view.url == "about:blank")
+ return qsTr("New tab")
+ if (view.title)
+ return view.title
+ return view.url
+ }
+
+ readonly property Action backAction: Action {
+ property WebEngineAction webAction: view.action(WebEngineView.Back)
+ enabled: webAction.enabled
+ text: qsTr("Back")
+ shortcut: root.visible && StandardKey.Back
+ onTriggered: webAction.trigger()
+ }
+
+ readonly property Action forwardAction: Action {
+ property WebEngineAction webAction: view.action(WebEngineView.Forward)
+ enabled: webAction.enabled
+ text: qsTr("Forward")
+ shortcut: root.visible && StandardKey.Forward
+ onTriggered: webAction.trigger()
+ }
+
+ readonly property Action reloadAction: Action {
+ property WebEngineAction webAction: view.action(WebEngineView.Reload)
+ enabled: webAction.enabled
+ text: qsTr("Reload")
+ shortcut: root.visible && StandardKey.Refresh
+ onTriggered: webAction.trigger()
+ }
+
+ readonly property Action stopAction: Action {
+ property WebEngineAction webAction: view.action(WebEngineView.Stop)
+ enabled: webAction.enabled
+ text: qsTr("Stop")
+ shortcut: root.visible && StandardKey.Cancel
+ onTriggered: webAction.trigger()
+ }
+
+ readonly property Action closeAction: Action {
+ text: qsTr("Close")
+ shortcut: root.visible && StandardKey.Close
+ onTriggered: root.closeRequested()
+ }
+
+ readonly property Action activateAction: Action {
+ text: qsTr("Active")
+ checkable: true
+ checked: view.lifecycleState == WebEngineView.LifecycleState.Active
+ enabled: checked || (view.lifecycleState != WebEngineView.LifecycleState.Active)
+ onTriggered: view.lifecycleState = WebEngineView.LifecycleState.Active
+ }
+
+ readonly property Action freezeAction: Action {
+ text: qsTr("Frozen")
+ checkable: true
+ checked: view.lifecycleState == WebEngineView.LifecycleState.Frozen
+ enabled: checked || (!view.visible && view.lifecycleState == WebEngineView.LifecycleState.Active)
+ onTriggered: view.lifecycleState = WebEngineView.LifecycleState.Frozen
+ }
+
+ readonly property Action discardAction: Action {
+ text: qsTr("Discarded")
+ checkable: true
+ checked: view.lifecycleState == WebEngineView.LifecycleState.Discarded
+ enabled: checked || (!view.visible && view.lifecycleState == WebEngineView.LifecycleState.Frozen)
+ onTriggered: view.lifecycleState = WebEngineView.LifecycleState.Discarded
+ }
+
+ spacing: 0
+
+ ToolBar {
+ Layout.fillWidth: true
+ Material.elevation: 0
+ Material.background: Material.color(Material.Grey, Material.Shade800)
+
+ RowLayout {
+ anchors.fill: parent
+ WebToolButton {
+ action: root.backAction
+ text: "â†"
+ ToolTip.text: root.backAction.text
+ }
+ WebToolButton {
+ action: root.forwardAction
+ text: "→"
+ ToolTip.text: root.forwardAction.text
+ }
+ WebToolButton {
+ action: root.reloadAction
+ visible: root.reloadAction.enabled
+ text: "↻"
+ ToolTip.text: root.reloadAction.text
+ }
+ WebToolButton {
+ action: root.stopAction
+ visible: root.stopAction.enabled
+ text: "✕"
+ ToolTip.text: root.stopAction.text
+ }
+ TextField {
+ Layout.fillWidth: true
+ Layout.topMargin: 6
+
+ placeholderText: qsTr("Type a URL")
+ text: view.url == "about:blank" ? "" : view.url
+ selectByMouse: true
+
+ onAccepted: { view.url = utils.fromUserInput(text) }
+ }
+ WebToolButton {
+ text: "â‹®"
+ ToolTip.text: qsTr("Settings")
+ onClicked: root.drawerRequested()
+ }
+ }
+ }
+
+ WebEngineView {
+ id: view
+ Layout.fillHeight: true
+ Layout.fillWidth: true
+ }
+
+ Timer {
+ interval: {
+ switch (view.recommendedState) {
+ case WebEngineView.LifecycleState.Active:
+ return 1
+ case WebEngineView.LifecycleState.Frozen:
+ return root.freezeDelay * 1000
+ case WebEngineView.LifecycleState.Discarded:
+ return root.discardDelay * 1000
+ }
+ }
+ running: interval && view.lifecycleState != view.recommendedState
+ onTriggered: view.lifecycleState = view.recommendedState
+ }
+}
diff --git a/examples/webenginequick/lifecycle/WebTabBar.qml b/examples/webenginequick/lifecycle/WebTabBar.qml
new file mode 100644
index 000000000..e87380eb1
--- /dev/null
+++ b/examples/webenginequick/lifecycle/WebTabBar.qml
@@ -0,0 +1,53 @@
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls.Material
+import QtQuick.Layouts
+
+Pane {
+ id: root
+
+ property Action newTabAction
+
+ property alias currentIndex: tabBar.currentIndex
+
+ signal closeRequested(int index)
+
+ Material.background: Material.color(Material.Grey, Material.Shade900)
+ Material.elevation: 4
+ padding: 0
+
+ RowLayout {
+ spacing: 0
+ anchors.fill: parent
+
+ TabBar {
+ id: tabBar
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ }
+
+ WebToolButton {
+ Layout.bottomMargin: 2
+
+ action: root.newTabAction
+ text: "+"
+ ToolTip.text: root.newTabAction.text
+ }
+ }
+
+ Component {
+ id: factory
+ WebTabButton {}
+ }
+
+ function createNewTab(properties) {
+ return factory.createObject(tabBar, properties)
+ }
+
+ function closeTab(index) {
+ tabBar.takeItem(index).destroy()
+ }
+}
diff --git a/examples/webenginequick/lifecycle/WebTabButton.qml b/examples/webenginequick/lifecycle/WebTabButton.qml
new file mode 100644
index 000000000..c26a53f54
--- /dev/null
+++ b/examples/webenginequick/lifecycle/WebTabButton.qml
@@ -0,0 +1,111 @@
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls.Material
+import QtQuick.Layouts
+import QtWebEngine
+
+TabButton {
+ id: root
+
+ property WebTab tab
+
+ text: root.tab.title
+
+ ToolTip.delay: 1000
+ ToolTip.visible: root.hovered
+ ToolTip.text: root.text
+
+ padding: 6
+
+ contentItem: RowLayout {
+ Item {
+ implicitWidth: 16
+ implicitHeight: 16
+ BusyIndicator {
+ visible: root.tab.loading
+ anchors.fill: parent
+ leftInset: 0
+ topInset: 0
+ rightInset: 0
+ bottomInset: 0
+ padding: 0
+ }
+ Image {
+ visible: !root.tab.loading
+ source: root.tab.icon
+ anchors.fill: parent
+ }
+ }
+ Label {
+ Layout.fillWidth: true
+ Layout.leftMargin: 4
+ Layout.rightMargin: 4
+ text: root.text
+ elide: Text.ElideRight
+ color: {
+ switch (root.tab.lifecycleState) {
+ case WebEngineView.LifecycleState.Active:
+ return Material.color(Material.Grey, Material.Shade100)
+ case WebEngineView.LifecycleState.Frozen:
+ return Material.color(Material.Blue, Material.Shade400)
+ case WebEngineView.LifecycleState.Discarded:
+ return Material.color(Material.Red, Material.Shade400)
+ }
+ }
+
+ }
+ WebToolButton {
+ action: root.tab.closeAction
+ text: "✕"
+ ToolTip.text: action.text
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ acceptedButtons: Qt.RightButton
+ propagateComposedEvents: true
+ onClicked: contextMenu.popup()
+ }
+
+ Menu {
+ id: contextMenu
+ Control {
+ contentItem: Label {
+ text: qsTr("Manual lifecycle control")
+ }
+ verticalPadding: 9
+ horizontalPadding: 14
+ }
+ Repeater {
+ model: [root.tab.activateAction, root.tab.freezeAction, root.tab.discardAction]
+ RadioButton {
+ action: modelData
+ verticalPadding: 9
+ horizontalPadding: 14
+ }
+ }
+ Control {
+ contentItem: Label {
+ text: qsTr("Recommended: %1").arg(recommendedStateText)
+ property string recommendedStateText: {
+ switch (root.tab.recommendedState) {
+ case WebEngineView.LifecycleState.Active:
+ return root.tab.activateAction.text
+ case WebEngineView.LifecycleState.Frozen:
+ return root.tab.freezeAction.text
+ case WebEngineView.LifecycleState.Discarded:
+ return root.tab.discardAction.text
+ }
+ }
+ color: Material.hintTextColor
+ }
+ font.pointSize: 8
+ verticalPadding: 9
+ horizontalPadding: 14
+ }
+ }
+}
diff --git a/examples/webenginequick/lifecycle/WebTabStack.qml b/examples/webenginequick/lifecycle/WebTabStack.qml
new file mode 100644
index 000000000..1bc16f4c9
--- /dev/null
+++ b/examples/webenginequick/lifecycle/WebTabStack.qml
@@ -0,0 +1,51 @@
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQml.Models
+import QtQuick
+import QtQuick.Controls
+
+Rectangle {
+ id: root
+
+ signal closeRequested(int index)
+ signal drawerRequested
+
+ property int freezeDelay
+ property int discardDelay
+
+ property int currentIndex
+ property var currentTab: model.children[currentIndex]
+ property alias count: model.count
+
+ color: "white"
+
+ ObjectModel {
+ id: model
+ }
+
+ Component {
+ id: factory
+ WebTab {
+ readonly property int index : ObjectModel.index
+ anchors.fill: parent
+ visible: index == root.currentIndex
+ freezeDelay: root.freezeDelay
+ discardDelay: root.discardDelay
+ onCloseRequested: root.closeRequested(index)
+ onDrawerRequested: root.drawerRequested()
+ }
+ }
+
+ function createNewTab(properties) {
+ const tab = factory.createObject(root, properties)
+ model.append(tab)
+ return tab
+ }
+
+ function closeTab(index) {
+ const tab = model.get(index)
+ model.remove(index)
+ tab.destroy()
+ }
+}
diff --git a/examples/webenginequick/lifecycle/WebToolButton.qml b/examples/webenginequick/lifecycle/WebToolButton.qml
new file mode 100644
index 000000000..bdf94b4ba
--- /dev/null
+++ b/examples/webenginequick/lifecycle/WebToolButton.qml
@@ -0,0 +1,16 @@
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls.Material
+
+ToolButton {
+ id: root
+ font.bold: true
+ font.pointSize: 12
+ ToolTip.delay: 1000
+ ToolTip.visible: hovered
+ implicitWidth: 32
+ implicitHeight: 32
+}
diff --git a/examples/webengine/lifecycle/doc/images/lifecycle-automatic.png b/examples/webenginequick/lifecycle/doc/images/lifecycle-automatic.png
index 2c62967af..2c62967af 100644
--- a/examples/webengine/lifecycle/doc/images/lifecycle-automatic.png
+++ b/examples/webenginequick/lifecycle/doc/images/lifecycle-automatic.png
Binary files differ
diff --git a/examples/webengine/lifecycle/doc/images/lifecycle-manual.png b/examples/webenginequick/lifecycle/doc/images/lifecycle-manual.png
index 7fb5c5a80..7fb5c5a80 100644
--- a/examples/webengine/lifecycle/doc/images/lifecycle-manual.png
+++ b/examples/webenginequick/lifecycle/doc/images/lifecycle-manual.png
Binary files differ
diff --git a/examples/webengine/lifecycle/doc/images/lifecycle.png b/examples/webenginequick/lifecycle/doc/images/lifecycle.png
index 87b719022..87b719022 100644
--- a/examples/webengine/lifecycle/doc/images/lifecycle.png
+++ b/examples/webenginequick/lifecycle/doc/images/lifecycle.png
Binary files differ
diff --git a/examples/webenginequick/lifecycle/doc/src/lifecycle.qdoc b/examples/webenginequick/lifecycle/doc/src/lifecycle.qdoc
new file mode 100644
index 000000000..1580da26d
--- /dev/null
+++ b/examples/webenginequick/lifecycle/doc/src/lifecycle.qdoc
@@ -0,0 +1,84 @@
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+ \example webenginequick/lifecycle
+ \title WebEngine Lifecycle Example
+ \ingroup webengine-examples
+ \brief Freezes and discards background tabs to reduce CPU and memory usage.
+ \examplecategory {Web Technologies}
+
+ \image lifecycle.png
+
+ \e {WebEngine Lifecycle Example} demonstrates how the \l
+ {WebEngineView::}{lifecycleState} and \l {WebEngineView::}{recommendedState}
+ properties of the \l {WebEngineView} can be used to reduce the CPU and
+ memory usage of background tabs in a tabbed browser.
+
+ For an overview of the lifecycle feature, see \l {Page Lifecycle API}.
+
+ \include examples-run.qdocinc
+
+ \section1 UI Elements of the Example
+
+ The example uses \l {Qt Quick Controls 2} to implement a traditional tabbed
+ browser in the \l {Material Style} (dark variant). The main application
+ window (\c {WebBrowser.qml}) is divided into a header bar at the top and a
+ main viewing area filling the rest of the window. The header contains the
+ tab bar (\c {WebTabBar.qml}) with one button per tab (\c
+ {WebTabButton.qml}). The main area consists of a stack of tabs (\c
+ {WebTabStack.qml} and \c {WebTab.qml}). Each tab in turn has a tool bar at
+ the top and a \l {WebEngineView} for displaying web pages. Finally, the main
+ window also has a \l {Drawer} for changing settings. The drawer can be
+ opened by clicking the "â‹®" button on the tool bar.
+
+ \note Note that \c {WebTab.qml} uses \l {QUrl::}
+ {fromUserInput} to handle incomplete URLs.
+
+ \section1 Lifecycle States in the Example
+
+ The example implements two ways of changing the lifecycle state: manual and
+ automatic. The manual way uses the \l {WebEngineView::}{lifecycleState}
+ property directly to change the web view lifecycle state, while the
+ automatic way is timer-based and also takes into account the \l
+ {WebEngineView::}{recommendedState}.
+
+ The tab titles in the tab bar are color coded with frozen tabs shown in blue
+ and discarded in red.
+
+ \section2 Manual Lifecycle Control
+
+ \image lifecycle-manual.png
+
+ Manual control is provided by context menus on the tab bar buttons (\c
+ {WebTabButton.qml}). The menu has three radio buttons, one for each
+ lifecycle state, with the current state checked. Some buttons may be
+ disabled, either because they represent illegal state transitions (for
+ example, a \c {Discarded} view cannot directly transition to the \c {Frozen}
+ state), or because other preconditions are not fulfilled (for example, a
+ visible view can only be in the \c {Active} state).
+
+ \section2 Automatic Lifecycle Control
+
+ \image lifecycle-automatic.png
+
+ Automatic control is implemented with a \l {Timer} in the \c {WebTab}
+ component (\c {WebTab.qml}). The timer is started whenever the \l
+ {WebEngineView::}{lifecycleState} of the web view does not match it's \l
+ {WebEngineView::}{recommendedState}. Once the timer fires, the view's
+ lifecycle state is set to the recommended state.
+
+ The time delay is used to avoid changing the lifecycle state too quickly
+ when the user is switching between tabs. The freezing and discarding delays
+ can be changed in the settings drawer accessed through the "â‹®" button on the
+ tool bar.
+
+ This is a rather simple algorithm for automatic lifecycle control, however
+ more sophisticated algorithms could also be conceived and implemented on the
+ basis of the \l {WebEngineView::}{lifecycleState} property. For example, the
+ Chromium browser experimentally uses a pretrained deep neural network to
+ predict the next tab activation time by the user, essentially ranking tabs
+ based on how interesting they are to the user. Implementing such an
+ algorithm is left as an exercise to the reader for now.
+
+*/
diff --git a/examples/webenginequick/lifecycle/lifecycle.pro b/examples/webenginequick/lifecycle/lifecycle.pro
new file mode 100644
index 000000000..044d025d7
--- /dev/null
+++ b/examples/webenginequick/lifecycle/lifecycle.pro
@@ -0,0 +1,11 @@
+TEMPLATE = app
+
+QT += quickcontrols2 webenginequick
+
+HEADERS += utils.h
+SOURCES += main.cpp
+
+RESOURCES += resources.qrc
+
+target.path = $$[QT_INSTALL_EXAMPLES]/webenginequick/lifecycle
+INSTALLS += target
diff --git a/examples/webenginequick/lifecycle/main.cpp b/examples/webenginequick/lifecycle/main.cpp
new file mode 100644
index 000000000..1f45ad0ee
--- /dev/null
+++ b/examples/webenginequick/lifecycle/main.cpp
@@ -0,0 +1,21 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include "utils.h"
+
+#include <QGuiApplication>
+#include <QQmlApplicationEngine>
+#include <QQmlContext>
+#include <QtWebEngineQuick/qtwebenginequickglobal.h>
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication::setOrganizationName("QtExamples");
+ QtWebEngineQuick::initialize();
+ QGuiApplication app(argc, argv);
+ QQmlApplicationEngine engine;
+ Utils utils;
+ engine.rootContext()->setContextProperty("utils", &utils);
+ engine.load(QUrl(QStringLiteral("qrc:/WebBrowser.qml")));
+ return app.exec();
+}
diff --git a/examples/webengine/lifecycle/qtquickcontrols2.conf b/examples/webenginequick/lifecycle/qtquickcontrols2.conf
index 68c77cec5..68c77cec5 100644
--- a/examples/webengine/lifecycle/qtquickcontrols2.conf
+++ b/examples/webenginequick/lifecycle/qtquickcontrols2.conf
diff --git a/examples/webengine/lifecycle/resources.qrc b/examples/webenginequick/lifecycle/resources.qrc
index 41e5092ce..41e5092ce 100644
--- a/examples/webengine/lifecycle/resources.qrc
+++ b/examples/webenginequick/lifecycle/resources.qrc
diff --git a/examples/webenginequick/lifecycle/utils.h b/examples/webenginequick/lifecycle/utils.h
new file mode 100644
index 000000000..d9a803907
--- /dev/null
+++ b/examples/webenginequick/lifecycle/utils.h
@@ -0,0 +1,25 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#ifndef UTILS_H
+#define UTILS_H
+
+#include <QtCore/QFileInfo>
+#include <QtCore/QUrl>
+
+class Utils : public QObject
+{
+ Q_OBJECT
+public:
+ Q_INVOKABLE static QUrl fromUserInput(const QString &userInput);
+};
+
+inline QUrl Utils::fromUserInput(const QString &userInput)
+{
+ QFileInfo fileInfo(userInput);
+ if (fileInfo.exists())
+ return QUrl::fromLocalFile(fileInfo.absoluteFilePath());
+ return QUrl::fromUserInput(userInput);
+}
+
+#endif // UTILS_H
diff --git a/examples/webenginequick/quicknanobrowser/ApplicationRoot.qml b/examples/webenginequick/quicknanobrowser/ApplicationRoot.qml
new file mode 100644
index 000000000..55c414409
--- /dev/null
+++ b/examples/webenginequick/quicknanobrowser/ApplicationRoot.qml
@@ -0,0 +1,40 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtWebEngine
+
+QtObject {
+ id: root
+
+ property QtObject defaultProfile: WebEngineProfile {
+ storageName: "Profile"
+ offTheRecord: false
+ }
+
+ property QtObject otrProfile: WebEngineProfile {
+ offTheRecord: true
+ }
+
+ property Component browserWindowComponent: BrowserWindow {
+ applicationRoot: root
+ }
+ property Component browserDialogComponent: BrowserDialog {
+ onClosing: destroy()
+ }
+ function createWindow(profile) {
+ var newWindow = browserWindowComponent.createObject(root);
+ newWindow.currentWebView.profile = profile;
+ profile.downloadRequested.connect(newWindow.onDownloadRequested);
+ return newWindow;
+ }
+ function createDialog(profile) {
+ var newDialog = browserDialogComponent.createObject(root);
+ newDialog.currentWebView.profile = profile;
+ return newDialog;
+ }
+ function load(url) {
+ var browserWindow = createWindow(defaultProfile);
+ browserWindow.currentWebView.url = url;
+ }
+}
diff --git a/examples/webenginequick/quicknanobrowser/BrowserDialog.qml b/examples/webenginequick/quicknanobrowser/BrowserDialog.qml
new file mode 100644
index 000000000..7af347ec3
--- /dev/null
+++ b/examples/webenginequick/quicknanobrowser/BrowserDialog.qml
@@ -0,0 +1,27 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtQuick.Window
+import QtWebEngine
+
+Window {
+ id: window
+ property alias currentWebView: webView
+ flags: Qt.Dialog
+ width: 800
+ height: 600
+ visible: true
+ onClosing: destroy()
+ WebEngineView {
+ id: webView
+ anchors.fill: parent
+
+ onGeometryChangeRequested: function(geometry) {
+ window.x = geometry.x
+ window.y = geometry.y
+ window.width = geometry.width
+ window.height = geometry.height
+ }
+ }
+}
diff --git a/examples/webenginequick/quicknanobrowser/BrowserWindow.qml b/examples/webenginequick/quicknanobrowser/BrowserWindow.qml
new file mode 100644
index 000000000..3b911262b
--- /dev/null
+++ b/examples/webenginequick/quicknanobrowser/BrowserWindow.qml
@@ -0,0 +1,871 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtCore
+import QtQml
+import QtQuick
+import QtQuick.Controls.Fusion
+import QtQuick.Layouts
+import QtQuick.Window
+import QtWebEngine
+import BrowserUtils
+
+ApplicationWindow {
+ id: browserWindow
+ property QtObject applicationRoot
+ property Item currentWebView: tabBar.currentIndex < tabBar.count ? tabLayout.children[tabBar.currentIndex] : null
+ property int previousVisibility: Window.Windowed
+ property int createdTabs: 0
+
+ width: 1300
+ height: 900
+ visible: true
+ title: currentWebView && currentWebView.title
+
+ // Make sure the Qt.WindowFullscreenButtonHint is set on OS X.
+ Component.onCompleted: flags = flags | Qt.WindowFullscreenButtonHint
+
+ onCurrentWebViewChanged: {
+ findBar.reset();
+ }
+
+ // When using style "mac", ToolButtons are not supposed to accept focus.
+ property bool platformIsMac: Qt.platform.os == "osx"
+
+ Settings {
+ id : appSettings
+ property alias autoLoadImages: loadImages.checked
+ property alias javaScriptEnabled: javaScriptEnabled.checked
+ property alias errorPageEnabled: errorPageEnabled.checked
+ property alias pluginsEnabled: pluginsEnabled.checked
+ property alias fullScreenSupportEnabled: fullScreenSupportEnabled.checked
+ property alias autoLoadIconsForPage: autoLoadIconsForPage.checked
+ property alias touchIconsEnabled: touchIconsEnabled.checked
+ property alias webRTCPublicInterfacesOnly : webRTCPublicInterfacesOnly.checked
+ property alias devToolsEnabled: devToolsEnabled.checked
+ property alias pdfViewerEnabled: pdfViewerEnabled.checked
+ property int imageAnimationPolicy: WebEngineSettings.AllowImageAnimation
+ }
+
+ Action {
+ shortcut: "Ctrl+D"
+ onTriggered: {
+ downloadView.visible = !downloadView.visible;
+ }
+ }
+ Action {
+ id: focus
+ shortcut: "Ctrl+L"
+ onTriggered: {
+ addressBar.forceActiveFocus();
+ addressBar.selectAll();
+ }
+ }
+ Action {
+ shortcut: StandardKey.Refresh
+ onTriggered: {
+ if (currentWebView)
+ currentWebView.reload();
+ }
+ }
+ Action {
+ shortcut: StandardKey.AddTab
+ onTriggered: {
+ tabBar.createTab(tabBar.count != 0 ? currentWebView.profile : defaultProfile);
+ addressBar.forceActiveFocus();
+ addressBar.selectAll();
+ }
+ }
+ Action {
+ shortcut: StandardKey.Close
+ onTriggered: {
+ currentWebView.triggerWebAction(WebEngineView.RequestClose);
+ }
+ }
+ Action {
+ shortcut: StandardKey.Quit
+ onTriggered: browserWindow.close()
+ }
+ Action {
+ shortcut: "Escape"
+ onTriggered: {
+ if (currentWebView.state == "FullScreen") {
+ browserWindow.visibility = browserWindow.previousVisibility;
+ fullScreenNotification.hide();
+ currentWebView.triggerWebAction(WebEngineView.ExitFullScreen);
+ }
+
+ if (findBar.visible)
+ findBar.visible = false;
+ }
+ }
+ Action {
+ shortcut: "Ctrl+0"
+ onTriggered: currentWebView.zoomFactor = 1.0
+ }
+ Action {
+ shortcut: StandardKey.ZoomOut
+ onTriggered: currentWebView.zoomFactor -= 0.1
+ }
+ Action {
+ shortcut: StandardKey.ZoomIn
+ onTriggered: currentWebView.zoomFactor += 0.1
+ }
+
+ Action {
+ shortcut: StandardKey.Copy
+ onTriggered: currentWebView.triggerWebAction(WebEngineView.Copy)
+ }
+ Action {
+ shortcut: StandardKey.Cut
+ onTriggered: currentWebView.triggerWebAction(WebEngineView.Cut)
+ }
+ Action {
+ shortcut: StandardKey.Paste
+ onTriggered: currentWebView.triggerWebAction(WebEngineView.Paste)
+ }
+ Action {
+ shortcut: "Shift+"+StandardKey.Paste
+ onTriggered: currentWebView.triggerWebAction(WebEngineView.PasteAndMatchStyle)
+ }
+ Action {
+ shortcut: StandardKey.SelectAll
+ onTriggered: currentWebView.triggerWebAction(WebEngineView.SelectAll)
+ }
+ Action {
+ shortcut: StandardKey.Undo
+ onTriggered: currentWebView.triggerWebAction(WebEngineView.Undo)
+ }
+ Action {
+ shortcut: StandardKey.Redo
+ onTriggered: currentWebView.triggerWebAction(WebEngineView.Redo)
+ }
+ Action {
+ shortcut: StandardKey.Back
+ onTriggered: currentWebView.triggerWebAction(WebEngineView.Back)
+ }
+ Action {
+ shortcut: StandardKey.Forward
+ onTriggered: currentWebView.triggerWebAction(WebEngineView.Forward)
+ }
+ Action {
+ shortcut: StandardKey.Find
+ onTriggered: {
+ if (!findBar.visible)
+ findBar.visible = true;
+ }
+ }
+ Action {
+ shortcut: StandardKey.FindNext
+ onTriggered: findBar.findNext()
+ }
+ Action {
+ shortcut: StandardKey.FindPrevious
+ onTriggered: findBar.findPrevious()
+ }
+
+ menuBar: ToolBar {
+ id: navigationBar
+ RowLayout {
+ anchors.fill: parent
+ ToolButton {
+ enabled: currentWebView && (currentWebView.canGoBack || currentWebView.canGoForward)
+ onClicked: historyMenu.open()
+ text: qsTr("â–¼")
+ Menu {
+ id: historyMenu
+ Instantiator {
+ model: currentWebView && currentWebView.history.items
+ MenuItem {
+ text: model.title
+ onTriggered: currentWebView.goBackOrForward(model.offset)
+ checkable: !enabled
+ checked: !enabled
+ enabled: model.offset
+ }
+
+ onObjectAdded: function(index, object) {
+ historyMenu.insertItem(index, object)
+ }
+ onObjectRemoved: function(index, object) {
+ historyMenu.removeItem(object)
+ }
+ }
+ }
+ }
+
+ ToolButton {
+ id: backButton
+ icon.source: "qrc:/icons/go-previous.png"
+ onClicked: currentWebView.goBack()
+ enabled: currentWebView && currentWebView.canGoBack
+ activeFocusOnTab: !browserWindow.platformIsMac
+ }
+ ToolButton {
+ id: forwardButton
+ icon.source: "qrc:/icons/go-next.png"
+ onClicked: currentWebView.goForward()
+ enabled: currentWebView && currentWebView.canGoForward
+ activeFocusOnTab: !browserWindow.platformIsMac
+ }
+ ToolButton {
+ id: reloadButton
+ icon.source: currentWebView && currentWebView.loading ? "qrc:/icons/process-stop.png" : "qrc:/icons/view-refresh.png"
+ onClicked: currentWebView && currentWebView.loading ? currentWebView.stop() : currentWebView.reload()
+ activeFocusOnTab: !browserWindow.platformIsMac
+ }
+ TextField {
+ id: addressBar
+ Image {
+ anchors.verticalCenter: addressBar.verticalCenter;
+ x: 5
+ z: 2
+ id: faviconImage
+ width: 16; height: 16
+ sourceSize: Qt.size(width, height)
+ source: currentWebView && currentWebView.icon ? currentWebView.icon : ''
+ }
+ MouseArea {
+ id: textFieldMouseArea
+ acceptedButtons: Qt.RightButton
+ anchors.fill: parent
+ onClicked: {
+ var textSelectionStartPos = addressBar.selectionStart;
+ var textSelectionEndPos = addressBar.selectionEnd;
+ textFieldContextMenu.open();
+ addressBar.select(textSelectionStartPos, textSelectionEndPos);
+ }
+ Menu {
+ id: textFieldContextMenu
+ x: textFieldMouseArea.mouseX
+ y: textFieldMouseArea.mouseY
+ MenuItem {
+ text: qsTr("Cut")
+ onTriggered: addressBar.cut()
+ enabled: addressBar.selectedText.length > 0
+ }
+ MenuItem {
+ text: qsTr("Copy")
+ onTriggered: addressBar.copy()
+ enabled: addressBar.selectedText.length > 0
+ }
+ MenuItem {
+ text: qsTr("Paste")
+ onTriggered: addressBar.paste()
+ enabled: addressBar.canPaste
+ }
+ MenuItem {
+ text: qsTr("Delete")
+ onTriggered: addressBar.text = qsTr("")
+ enabled: addressBar.selectedText.length > 0
+ }
+ MenuSeparator {}
+ MenuItem {
+ text: qsTr("Select All")
+ onTriggered: addressBar.selectAll()
+ enabled: addressBar.text.length > 0
+ }
+ }
+ }
+ leftPadding: 26
+ focus: true
+ Layout.fillWidth: true
+ Binding on text {
+ when: currentWebView
+ value: currentWebView.url
+ }
+ onAccepted: currentWebView.url = Utils.fromUserInput(text)
+ selectByMouse: true
+ }
+ ToolButton {
+ id: settingsMenuButton
+ text: qsTr("â‹®")
+ onClicked: settingsMenu.open()
+ Menu {
+ id: settingsMenu
+ y: settingsMenuButton.height
+ MenuItem {
+ id: loadImages
+ text: "Autoload images"
+ checkable: true
+ checked: WebEngine.settings.autoLoadImages
+ }
+ MenuItem {
+ id: javaScriptEnabled
+ text: "JavaScript On"
+ checkable: true
+ checked: WebEngine.settings.javascriptEnabled
+ }
+ MenuItem {
+ id: errorPageEnabled
+ text: "ErrorPage On"
+ checkable: true
+ checked: WebEngine.settings.errorPageEnabled
+ }
+ MenuItem {
+ id: pluginsEnabled
+ text: "Plugins On"
+ checkable: true
+ checked: true
+ }
+ MenuItem {
+ id: fullScreenSupportEnabled
+ text: "FullScreen On"
+ checkable: true
+ checked: WebEngine.settings.fullScreenSupportEnabled
+ }
+ MenuItem {
+ id: offTheRecordEnabled
+ text: "Off The Record"
+ checkable: true
+ checked: currentWebView && currentWebView.profile === otrProfile
+ onToggled: function(checked) {
+ if (currentWebView) {
+ currentWebView.profile = checked ? otrProfile : defaultProfile;
+ }
+ }
+ }
+ MenuItem {
+ id: httpDiskCacheEnabled
+ text: "HTTP Disk Cache"
+ checkable: currentWebView && !currentWebView.profile.offTheRecord
+ checked: currentWebView && (currentWebView.profile.httpCacheType === WebEngineProfile.DiskHttpCache)
+ onToggled: function(checked) {
+ if (currentWebView) {
+ currentWebView.profile.httpCacheType = checked ? WebEngineProfile.DiskHttpCache : WebEngineProfile.MemoryHttpCache;
+ }
+ }
+ }
+ MenuItem {
+ id: autoLoadIconsForPage
+ text: "Icons On"
+ checkable: true
+ checked: WebEngine.settings.autoLoadIconsForPage
+ }
+ MenuItem {
+ id: touchIconsEnabled
+ text: "Touch Icons On"
+ checkable: true
+ checked: WebEngine.settings.touchIconsEnabled
+ enabled: autoLoadIconsForPage.checked
+ }
+ MenuItem {
+ id: webRTCPublicInterfacesOnly
+ text: "WebRTC Public Interfaces Only"
+ checkable: true
+ checked: WebEngine.settings.webRTCPublicInterfacesOnly
+ }
+ MenuItem {
+ id: devToolsEnabled
+ text: "Open DevTools"
+ checkable: true
+ checked: false
+ }
+ MenuItem {
+ id: pdfViewerEnabled
+ text: "PDF Viewer Enabled"
+ checkable: true
+ checked: WebEngine.settings.pdfViewerEnabled
+ }
+
+ Menu {
+ id: imageAnimationPolicy
+ title: "Image Animation Policy"
+
+ MenuItem {
+ id: disableImageAnimation
+ text: "Disable All Image Animation"
+ checkable: true
+ autoExclusive: true
+ checked: WebEngine.settings.imageAnimationPolicy === WebEngineSettings.DisallowImageAnimation
+ onTriggered: {
+ appSettings.imageAnimationPolicy = WebEngineSettings.DisallowImageAnimation
+ }
+ }
+
+ MenuItem {
+ id: allowImageAnimation
+ text: "Allow All Animated Images"
+ checkable: true
+ autoExclusive: true
+ checked: WebEngine.settings.imageAnimationPolicy === WebEngineSettings.AllowImageAnimation
+ onTriggered : {
+ appSettings.imageAnimationPolicy = WebEngineSettings.AllowImageAnimation
+ }
+ }
+
+ MenuItem {
+ id: animateImageOnce
+ text: "Animate Image Once"
+ checkable: true
+ autoExclusive: true
+ checked: WebEngine.settings.imageAnimationPolicy === WebEngineSettings.AnimateImageOnce
+ onTriggered : {
+ appSettings.imageAnimationPolicy = WebEngineSettings.AnimateImageOnce
+ }
+ }
+ }
+
+ }
+ }
+ }
+ ProgressBar {
+ id: progressBar
+ height: 3
+ anchors {
+ left: parent.left
+ top: parent.bottom
+ right: parent.right
+ leftMargin: parent.leftMargin
+ rightMargin: parent.rightMargin
+ }
+ background: Item {}
+ z: -2
+ from: 0
+ to: 100
+ value: (currentWebView && currentWebView.loadProgress < 100) ? currentWebView.loadProgress : 0
+ }
+ }
+
+ StackLayout {
+ id: tabLayout
+ currentIndex: tabBar.currentIndex
+
+ anchors.top: tabBar.bottom
+ anchors.bottom: devToolsView.top
+ anchors.left: parent.left
+ anchors.right: parent.right
+ }
+
+ Component {
+ id: tabButtonComponent
+
+ TabButton {
+ property color frameColor: "#999"
+ property color fillColor: "#eee"
+ property color nonSelectedColor: "#ddd"
+ property string tabTitle: "New Tab"
+
+ id: tabButton
+ contentItem: Rectangle {
+ id: tabRectangle
+ color: tabButton.down ? fillColor : nonSelectedColor
+ border.width: 1
+ border.color: frameColor
+ implicitWidth: Math.max(text.width + 30, 80)
+ implicitHeight: Math.max(text.height + 10, 20)
+ Rectangle { height: 1 ; width: parent.width ; color: frameColor}
+ Rectangle { height: parent.height ; width: 1; color: frameColor}
+ Rectangle { x: parent.width - 2; height: parent.height ; width: 1; color: frameColor}
+ Text {
+ id: text
+ anchors.left: parent.left
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.leftMargin: 6
+ text: tabButton.tabTitle
+ elide: Text.ElideRight
+ color: tabButton.down ? "black" : frameColor
+ width: parent.width - button.background.width
+ }
+ Button {
+ id: button
+ anchors.right: parent.right
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.rightMargin: 4
+ height: 12
+ background: Rectangle {
+ implicitWidth: 12
+ implicitHeight: 12
+ color: button.hovered ? "#ccc" : tabRectangle.color
+ Text {text: "x"; anchors.centerIn: parent; color: "gray"}
+ }
+ onClicked: tabButton.closeTab()
+ }
+ }
+
+ onClicked: addressBar.text = tabLayout.itemAt(TabBar.index).url;
+ function closeTab() {
+ tabBar.removeView(TabBar.index);
+ }
+ }
+ }
+
+ TabBar {
+ id: tabBar
+ anchors.top: parent.top
+ anchors.left: parent.left
+ anchors.right: parent.right
+ Component.onCompleted: createTab(defaultProfile)
+
+ function createTab(profile, focusOnNewTab = true, url = undefined) {
+ var webview = tabComponent.createObject(tabLayout, {profile: profile});
+ var newTabButton = tabButtonComponent.createObject(tabBar, {tabTitle: Qt.binding(function () { return webview.title; })});
+ tabBar.addItem(newTabButton);
+ if (focusOnNewTab) {
+ tabBar.setCurrentIndex(tabBar.count - 1);
+ }
+ if (url !== undefined) {
+ webview.url = url;
+ }
+ return webview;
+ }
+
+ function removeView(index) {
+ if (tabBar.count > 1) {
+ tabBar.removeItem(tabBar.itemAt(index));
+ tabLayout.children[index].destroy();
+ } else {
+ browserWindow.close();
+ }
+ }
+
+ Component {
+ id: tabComponent
+ WebEngineView {
+ id: webEngineView
+ focus: true
+
+ onLinkHovered: function(hoveredUrl) {
+ if (hoveredUrl == "")
+ hideStatusText.start();
+ else {
+ statusText.text = hoveredUrl;
+ statusBubble.visible = true;
+ hideStatusText.stop();
+ }
+ }
+
+ states: [
+ State {
+ name: "FullScreen"
+ PropertyChanges {
+ target: tabBar
+ visible: false
+ height: 0
+ }
+ PropertyChanges {
+ target: navigationBar
+ visible: false
+ }
+ }
+ ]
+ settings.localContentCanAccessRemoteUrls: true
+ settings.localContentCanAccessFileUrls: false
+ settings.autoLoadImages: appSettings.autoLoadImages
+ settings.javascriptEnabled: appSettings.javaScriptEnabled
+ settings.errorPageEnabled: appSettings.errorPageEnabled
+ settings.pluginsEnabled: appSettings.pluginsEnabled
+ settings.fullScreenSupportEnabled: appSettings.fullScreenSupportEnabled
+ settings.autoLoadIconsForPage: appSettings.autoLoadIconsForPage
+ settings.touchIconsEnabled: appSettings.touchIconsEnabled
+ settings.webRTCPublicInterfacesOnly: appSettings.webRTCPublicInterfacesOnly
+ settings.pdfViewerEnabled: appSettings.pdfViewerEnabled
+ settings.imageAnimationPolicy: appSettings.imageAnimationPolicy
+
+ onCertificateError: function(error) {
+ error.defer();
+ sslDialog.enqueue(error);
+ }
+
+ onNewWindowRequested: function(request) {
+ if (!request.userInitiated)
+ console.warn("Blocked a popup window.");
+ else if (request.destination === WebEngineNewWindowRequest.InNewTab) {
+ var tab = tabBar.createTab(currentWebView.profile, true, request.requestedUrl);
+ tab.acceptAsNewWindow(request);
+ } else if (request.destination === WebEngineNewWindowRequest.InNewBackgroundTab) {
+ var backgroundTab = tabBar.createTab(currentWebView.profile, false);
+ backgroundTab.acceptAsNewWindow(request);
+ } else if (request.destination === WebEngineNewWindowRequest.InNewDialog) {
+ var dialog = applicationRoot.createDialog(currentWebView.profile);
+ dialog.currentWebView.acceptAsNewWindow(request);
+ } else {
+ var window = applicationRoot.createWindow(currentWebView.profile);
+ window.currentWebView.acceptAsNewWindow(request);
+ }
+ }
+
+ onFullScreenRequested: function(request) {
+ if (request.toggleOn) {
+ webEngineView.state = "FullScreen";
+ browserWindow.previousVisibility = browserWindow.visibility;
+ browserWindow.showFullScreen();
+ fullScreenNotification.show();
+ } else {
+ webEngineView.state = "";
+ browserWindow.visibility = browserWindow.previousVisibility;
+ fullScreenNotification.hide();
+ }
+ request.accept();
+ }
+
+ onRegisterProtocolHandlerRequested: function(request) {
+ console.log("accepting registerProtocolHandler request for "
+ + request.scheme + " from " + request.origin);
+ request.accept();
+ }
+
+ onRenderProcessTerminated: function(terminationStatus, exitCode) {
+ var status = "";
+ switch (terminationStatus) {
+ case WebEngineView.NormalTerminationStatus:
+ status = "(normal exit)";
+ break;
+ case WebEngineView.AbnormalTerminationStatus:
+ status = "(abnormal exit)";
+ break;
+ case WebEngineView.CrashedTerminationStatus:
+ status = "(crashed)";
+ break;
+ case WebEngineView.KilledTerminationStatus:
+ status = "(killed)";
+ break;
+ }
+
+ print("Render process exited with code " + exitCode + " " + status);
+ reloadTimer.running = true;
+ }
+
+ onSelectClientCertificate: function(selection) {
+ selection.certificates[0].select();
+ }
+
+ onFindTextFinished: function(result) {
+ if (!findBar.visible)
+ findBar.visible = true;
+
+ findBar.numberOfMatches = result.numberOfMatches;
+ findBar.activeMatch = result.activeMatch;
+ }
+
+ onLoadingChanged: function(loadRequest) {
+ if (loadRequest.status == WebEngineView.LoadStartedStatus)
+ findBar.reset();
+ }
+
+ onFeaturePermissionRequested: function(securityOrigin, feature) {
+ featurePermissionDialog.securityOrigin = securityOrigin;
+ featurePermissionDialog.feature = feature;
+ featurePermissionDialog.visible = true;
+ }
+ onWebAuthUxRequested: function(request) {
+ webAuthDialog.init(request);
+ }
+
+ Timer {
+ id: reloadTimer
+ interval: 0
+ running: false
+ repeat: false
+ onTriggered: currentWebView.reload()
+ }
+ }
+ }
+ }
+ WebEngineView {
+ id: devToolsView
+ visible: devToolsEnabled.checked
+ height: visible ? 400 : 0
+ inspectedView: visible && tabBar.currentIndex < tabBar.count ? tabLayout.children[tabBar.currentIndex] : null
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+ onNewWindowRequested: function(request) {
+ var tab = tabBar.createTab(currentWebView.profile);
+ request.openIn(tab);
+ }
+
+ Timer {
+ id: hideTimer
+ interval: 0
+ running: false
+ repeat: false
+ onTriggered: devToolsEnabled.checked = false
+ }
+ onWindowCloseRequested: function(request) {
+ // Delay hiding for keep the inspectedView set to receive the ACK message of close.
+ hideTimer.running = true;
+ }
+ }
+ Dialog {
+ id: sslDialog
+ anchors.centerIn: parent
+ contentWidth: Math.max(mainTextForSSLDialog.width, detailedTextForSSLDialog.width)
+ contentHeight: mainTextForSSLDialog.height + detailedTextForSSLDialog.height
+ property var certErrors: []
+ // fixme: icon!
+ // icon: StandardIcon.Warning
+ standardButtons: Dialog.No | Dialog.Yes
+ title: "Server's certificate not trusted"
+ contentItem: Item {
+ Label {
+ id: mainTextForSSLDialog
+ text: "Do you wish to continue?"
+ }
+ Text {
+ id: detailedTextForSSLDialog
+ anchors.top: mainTextForSSLDialog.bottom
+ text: "If you wish so, you may continue with an unverified certificate.\n" +
+ "Accepting an unverified certificate means\n" +
+ "you may not be connected with the host you tried to connect to.\n" +
+ "Do you wish to override the security check and continue?"
+ }
+ }
+
+ onAccepted: {
+ certErrors.shift().acceptCertificate();
+ presentError();
+ }
+ onRejected: reject()
+
+ function reject(){
+ certErrors.shift().rejectCertificate();
+ presentError();
+ }
+ function enqueue(error){
+ certErrors.push(error);
+ presentError();
+ }
+ function presentError(){
+ visible = certErrors.length > 0
+ }
+ }
+ Dialog {
+ id: featurePermissionDialog
+ anchors.centerIn: parent
+ width: Math.min(browserWindow.width, browserWindow.height) / 3 * 2
+ contentWidth: mainTextForPermissionDialog.width
+ contentHeight: mainTextForPermissionDialog.height
+ standardButtons: Dialog.No | Dialog.Yes
+ title: "Permission Request"
+
+ property var feature;
+ property url securityOrigin;
+
+ contentItem: Item {
+ Label {
+ id: mainTextForPermissionDialog
+ text: featurePermissionDialog.questionForFeature()
+ }
+ }
+
+ onAccepted: currentWebView && currentWebView.grantFeaturePermission(securityOrigin, feature, true)
+ onRejected: currentWebView && currentWebView.grantFeaturePermission(securityOrigin, feature, false)
+ onVisibleChanged: {
+ if (visible)
+ width = contentWidth + 20;
+ }
+
+ function questionForFeature() {
+ var question = "Allow " + securityOrigin + " to "
+
+ switch (feature) {
+ case WebEngineView.Geolocation:
+ question += "access your location information?";
+ break;
+ case WebEngineView.MediaAudioCapture:
+ question += "access your microphone?";
+ break;
+ case WebEngineView.MediaVideoCapture:
+ question += "access your webcam?";
+ break;
+ case WebEngineView.MediaVideoCapture:
+ question += "access your microphone and webcam?";
+ break;
+ case WebEngineView.MouseLock:
+ question += "lock your mouse cursor?";
+ break;
+ case WebEngineView.DesktopVideoCapture:
+ question += "capture video of your desktop?";
+ break;
+ case WebEngineView.DesktopAudioVideoCapture:
+ question += "capture audio and video of your desktop?";
+ break;
+ case WebEngineView.Notifications:
+ question += "show notification on your desktop?";
+ break;
+ case WebEngineView.ClipboardReadWrite:
+ question += "read from and write to your clipboard?";
+ break;
+ case WebEngineView.LocalFontsAccess:
+ question += "access the fonts stored on your machine?";
+ break;
+ default:
+ question += "access unknown or unsupported feature [" + feature + "] ?";
+ break;
+ }
+
+ return question;
+ }
+ }
+
+ FullScreenNotification {
+ id: fullScreenNotification
+ }
+
+ DownloadView {
+ id: downloadView
+ visible: false
+ anchors.fill: parent
+ }
+
+ WebAuthDialog {
+ id: webAuthDialog
+ visible: false
+ }
+
+ function onDownloadRequested(download) {
+ downloadView.visible = true;
+ downloadView.append(download);
+ download.accept();
+ }
+
+ FindBar {
+ id: findBar
+ visible: false
+ anchors.right: parent.right
+ anchors.rightMargin: 10
+ anchors.top: parent.top
+
+ onFindNext: {
+ if (text)
+ currentWebView && currentWebView.findText(text);
+ else if (!visible)
+ visible = true;
+ }
+ onFindPrevious: {
+ if (text)
+ currentWebView && currentWebView.findText(text, WebEngineView.FindBackward);
+ else if (!visible)
+ visible = true;
+ }
+ }
+
+
+ Rectangle {
+ id: statusBubble
+ color: "oldlace"
+ property int padding: 8
+ visible: false
+
+ anchors.left: parent.left
+ anchors.bottom: parent.bottom
+ width: statusText.paintedWidth + padding
+ height: statusText.paintedHeight + padding
+
+ Text {
+ id: statusText
+ anchors.centerIn: statusBubble
+ elide: Qt.ElideMiddle
+
+ Timer {
+ id: hideStatusText
+ interval: 750
+ onTriggered: {
+ statusText.text = "";
+ statusBubble.visible = false;
+ }
+ }
+ }
+ }
+}
diff --git a/examples/webenginequick/quicknanobrowser/CMakeLists.txt b/examples/webenginequick/quicknanobrowser/CMakeLists.txt
new file mode 100644
index 000000000..7efb61127
--- /dev/null
+++ b/examples/webenginequick/quicknanobrowser/CMakeLists.txt
@@ -0,0 +1,111 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+project(quicknanobrowser LANGUAGES CXX)
+
+set(CMAKE_AUTOMOC ON)
+
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webenginequick/quicknanobrowser")
+
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick WebEngineQuick)
+
+qt_add_executable(quicknanobrowser
+ main.cpp
+ utils.h
+)
+
+if(WIN32)
+ set_property(
+ TARGET quicknanobrowser
+ APPEND PROPERTY
+ SOURCES quicknanobrowser.exe.manifest)
+endif()
+
+set_target_properties(quicknanobrowser PROPERTIES
+ WIN32_EXECUTABLE TRUE
+ MACOSX_BUNDLE TRUE
+ MACOSX_BUNDLE_GUI_IDENTIFIER "io.qt.examples.webenginequick.quicknanobrowser"
+)
+
+target_link_libraries(quicknanobrowser PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Qml
+ Qt::Quick
+ Qt::WebEngineQuick
+)
+
+qt_add_qml_module(quicknanobrowser
+ URI BrowserUtils
+ VERSION 1.0
+ RESOURCE_PREFIX /
+)
+
+# Resources:
+set(resources_resource_files
+ "ApplicationRoot.qml"
+ "BrowserDialog.qml"
+ "BrowserWindow.qml"
+ "DownloadView.qml"
+ "FindBar.qml"
+ "FullScreenNotification.qml"
+ "WebAuthDialog.qml"
+)
+
+qt_add_resources(quicknanobrowser "resources"
+ PREFIX
+ "/"
+ FILES
+ ${resources_resource_files}
+)
+
+set(resources1_resource_files
+ "icons/3rdparty/go-next.png"
+ "icons/3rdparty/go-previous.png"
+ "icons/3rdparty/process-stop.png"
+ "icons/3rdparty/view-refresh.png"
+)
+
+qt_add_resources(quicknanobrowser "resources1"
+ PREFIX
+ "/icons"
+ BASE
+ "icons/3rdparty"
+ FILES
+ ${resources1_resource_files}
+)
+
+if(TARGET Qt::Widgets)
+ target_link_libraries(quicknanobrowser PUBLIC
+ Qt::Widgets
+ )
+endif()
+
+if (APPLE)
+ set_target_properties(quicknanobrowser PROPERTIES
+ MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.cmake.macos.plist"
+ )
+
+ if (NOT CMAKE_GENERATOR STREQUAL "Xcode")
+ # Need to sign application for location permissions to work
+ if(QT_FEATURE_debug_and_release)
+ set(exe_path "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/")
+ else()
+ unset(exe_path)
+ endif()
+ add_custom_command(TARGET quicknanobrowser
+ POST_BUILD COMMAND codesign --force -s - ${exe_path}quicknanobrowser.app
+ )
+ endif()
+endif()
+
+install(TARGETS quicknanobrowser
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/webenginequick/quicknanobrowser/DownloadView.qml b/examples/webenginequick/quicknanobrowser/DownloadView.qml
new file mode 100644
index 000000000..421b4f55c
--- /dev/null
+++ b/examples/webenginequick/quicknanobrowser/DownloadView.qml
@@ -0,0 +1,127 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtQuick.Controls.Fusion
+import QtWebEngine
+import QtQuick.Layouts
+
+Rectangle {
+ id: downloadView
+ color: "lightgray"
+
+ ListModel {
+ id: downloadModel
+ property var downloads: []
+ }
+
+ function append(download) {
+ downloadModel.append(download);
+ downloadModel.downloads.push(download);
+ }
+
+ Component {
+ id: downloadItemDelegate
+
+ Rectangle {
+ width: listView.width
+ height: childrenRect.height
+ anchors.margins: 10
+ radius: 3
+ color: "transparent"
+ border.color: "black"
+ Rectangle {
+ id: progressBar
+
+ property real progress: downloadModel.downloads[index]
+ ? downloadModel.downloads[index].receivedBytes / downloadModel.downloads[index].totalBytes : 0
+
+ radius: 3
+ color: width == listView.width ? "green" : "#2b74c7"
+ width: listView.width * progress
+ height: cancelButton.height
+
+ Behavior on width {
+ SmoothedAnimation { duration: 100 }
+ }
+ }
+ Rectangle {
+ anchors {
+ left: parent.left
+ right: parent.right
+ leftMargin: 20
+ }
+ Label {
+ id: label
+ text: downloadModel.downloads[index] ? downloadModel.downloads[index].downloadDirectory + "/" + downloadModel.downloads[index].downloadFileName : qsTr("")
+ anchors {
+ verticalCenter: cancelButton.verticalCenter
+ left: parent.left
+ right: cancelButton.left
+ }
+ }
+ Button {
+ id: cancelButton
+ anchors.right: parent.right
+ icon.source: "qrc:/icons/process-stop.png"
+ onClicked: {
+ var download = downloadModel.downloads[index];
+
+ download.cancel();
+
+ downloadModel.downloads = downloadModel.downloads.filter(function (el) {
+ return el.id !== download.id;
+ });
+ downloadModel.remove(index);
+ }
+ }
+ }
+ }
+
+ }
+ ListView {
+ id: listView
+ anchors {
+ topMargin: 10
+ top: parent.top
+ bottom: parent.bottom
+ horizontalCenter: parent.horizontalCenter
+ }
+ width: parent.width - 20
+ spacing: 5
+
+ model: downloadModel
+ delegate: downloadItemDelegate
+
+ Text {
+ visible: !listView.count
+ horizontalAlignment: Text.AlignHCenter
+ height: 30
+ anchors {
+ top: parent.top
+ left: parent.left
+ right: parent.right
+ }
+ font.pixelSize: 20
+ text: "No active downloads."
+ }
+
+ Rectangle {
+ color: "gray"
+ anchors {
+ bottom: parent.bottom
+ left: parent.left
+ right: parent.right
+ }
+ height: 30
+ Button {
+ id: okButton
+ text: "OK"
+ anchors.centerIn: parent
+ onClicked: {
+ downloadView.visible = false;
+ }
+ }
+ }
+ }
+}
diff --git a/examples/webenginequick/quicknanobrowser/FindBar.qml b/examples/webenginequick/quicknanobrowser/FindBar.qml
new file mode 100644
index 000000000..409d8dcff
--- /dev/null
+++ b/examples/webenginequick/quicknanobrowser/FindBar.qml
@@ -0,0 +1,109 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtQuick.Controls.Fusion
+import QtQuick.Layouts
+
+Rectangle {
+ id: root
+
+ property int numberOfMatches: 0
+ property int activeMatch: 0
+ property alias text: findTextField.text
+
+ function reset() {
+ numberOfMatches = 0;
+ activeMatch = 0;
+ visible = false;
+ }
+
+ signal findNext()
+ signal findPrevious()
+
+ width: 250
+ height: 35
+ radius: 2
+
+ border.width: 1
+ border.color: "black"
+ color: "white"
+
+ onVisibleChanged: {
+ if (visible)
+ findTextField.forceActiveFocus();
+ }
+
+
+ RowLayout {
+ anchors.fill: parent
+ anchors.topMargin: 5
+ anchors.bottomMargin: 5
+ anchors.leftMargin: 10
+ anchors.rightMargin: 10
+
+ spacing: 5
+
+ Rectangle {
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+
+ TextField {
+ id: findTextField
+ anchors.fill: parent
+ color: "black"
+ background: Rectangle {
+ color: "transparent"
+ }
+
+ onAccepted: root.findNext()
+ onTextChanged: root.findNext()
+ onActiveFocusChanged: activeFocus ? selectAll() : deselect()
+ }
+ }
+
+ Label {
+ text: activeMatch + "/" + numberOfMatches
+ visible: findTextField.text != ""
+ color: "black"
+ }
+
+ Rectangle {
+ border.width: 1
+ border.color: "#ddd"
+ width: 2
+ height: parent.height
+ anchors.topMargin: 5
+ anchors.bottomMargin: 5
+ }
+
+ ToolButton {
+ text: "<"
+ enabled: numberOfMatches > 0
+ onClicked: root.findPrevious()
+ contentItem: Text {
+ color: "black"
+ text: parent.text
+ }
+ }
+
+ ToolButton {
+ text: ">"
+ enabled: numberOfMatches > 0
+ onClicked: root.findNext()
+ contentItem: Text {
+ color: "black"
+ text: parent.text
+ }
+ }
+
+ ToolButton {
+ text: "x"
+ onClicked: root.visible = false
+ contentItem: Text {
+ color: "black"
+ text: parent.text
+ }
+ }
+ }
+}
diff --git a/examples/webenginequick/quicknanobrowser/FullScreenNotification.qml b/examples/webenginequick/quicknanobrowser/FullScreenNotification.qml
new file mode 100644
index 000000000..779406432
--- /dev/null
+++ b/examples/webenginequick/quicknanobrowser/FullScreenNotification.qml
@@ -0,0 +1,62 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+
+Rectangle {
+ id: fullScreenNotification
+ width: 500
+ height: 40
+ color: "white"
+ radius: 7
+
+ visible: false
+ opacity: 0
+
+ function show() {
+ visible = true;
+ opacity = 1;
+ reset.start();
+ }
+
+ function hide() {
+ reset.stop();
+ opacity = 0;
+ }
+
+ Behavior on opacity {
+ NumberAnimation {
+ duration: 750
+ onStopped: {
+ if (opacity == 0)
+ visible = false;
+ }
+ }
+ }
+
+ Timer {
+ id: reset
+ interval: 5000
+ onTriggered: hide()
+ }
+
+ anchors.horizontalCenter: parent.horizontalCenter
+ y: 125
+
+ Text {
+ id: message
+ width: parent.width
+
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+
+ wrapMode: Text.WordWrap
+ elide: Text.ElideNone
+ clip: true
+
+ text: qsTr("You are now in fullscreen mode. Press ESC to quit!")
+ }
+}
diff --git a/examples/webenginequick/quicknanobrowser/Info.cmake.macos.plist b/examples/webenginequick/quicknanobrowser/Info.cmake.macos.plist
new file mode 100644
index 000000000..cac4fa1f4
--- /dev/null
+++ b/examples/webenginequick/quicknanobrowser/Info.cmake.macos.plist
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleName</key>
+ <string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
+ <key>CFBundleExecutable</key>
+ <string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
+ <key>CFBundleVersion</key>
+ <string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
+ <key>CFBundleShortVersionString</key>
+ <string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
+ <key>LSMinimumSystemVersion</key>
+ <string>${CMAKE_OSX_DEPLOYMENT_TARGET}</string>
+ <key>NSHumanReadableCopyright</key>
+ <string>${MACOSX_BUNDLE_COPYRIGHT}</string>
+ <key>CFBundleIconFile</key>
+ <string>${MACOSX_BUNDLE_ICON_FILE}</string>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>NSSupportsAutomaticGraphicsSwitching</key>
+ <true/>
+ <key>NSLocationUsageDescription</key>
+ <string>Quick Nano Browser would like to give web sites access to your location for demo purposes.</string>
+ <key>NSMicrophoneUsageDescription</key>
+ <string>Quick Nano Browser would like to give web sites access to your computer's microphone for demo purposes.</string>
+ <key>NSCameraUsageDescription</key>
+ <string>Quick Nano Browser would like to give web sites access to your computer's camera for demo purposes.</string>
+</dict>
+</plist>
diff --git a/examples/webenginequick/quicknanobrowser/WebAuthDialog.qml b/examples/webenginequick/quicknanobrowser/WebAuthDialog.qml
new file mode 100644
index 000000000..aeb6f5a0f
--- /dev/null
+++ b/examples/webenginequick/quicknanobrowser/WebAuthDialog.qml
@@ -0,0 +1,281 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+import QtWebEngine
+
+Dialog {
+ id: webAuthDialog
+ anchors.centerIn: parent
+ width: Math.min(browserWindow.width, browserWindow.height) / 3 * 2
+ contentWidth: verticalLayout.width +10;
+ contentHeight: verticalLayout.height +10;
+ standardButtons: Dialog.Cancel | Dialog.Apply
+ title: "WebAuth Request"
+
+ property var selectAccount;
+ property var authrequest: null;
+
+ Connections {
+ id: webauthConnection
+ ignoreUnknownSignals: true
+ function onStateChanged(state) {
+ webAuthDialog.setupUI(state);
+ }
+ }
+
+ onApplied: {
+ switch (webAuthDialog.authrequest.state) {
+ case WebEngineWebAuthUxRequest.WebAuthUxState.CollectPin:
+ webAuthDialog.authrequest.setPin(pinEdit.text);
+ break;
+ case WebEngineWebAuthUxRequest.WebAuthUxState.SelectAccount:
+ webAuthDialog.authrequest.setSelectedAccount(webAuthDialog.selectAccount);
+ break;
+ default:
+ break;
+ }
+ }
+
+ onRejected: {
+ webAuthDialog.authrequest.cancel();
+ }
+
+ function init(request) {
+ pinLabel.visible = false;
+ pinEdit.visible = false;
+ confirmPinLabel.visible = false;
+ confirmPinEdit.visible = false;
+ selectAccountModel.clear();
+ webAuthDialog.authrequest = request;
+ webauthConnection.target = request;
+ setupUI(webAuthDialog.authrequest.state)
+ webAuthDialog.visible = true;
+ pinEntryError.visible = false;
+ }
+
+ function setupUI(state) {
+ switch (state) {
+ case WebEngineWebAuthUxRequest.WebAuthUxState.SelectAccount:
+ setupSelectAccountUI();
+ break;
+ case WebEngineWebAuthUxRequest.WebAuthUxState.CollectPin:
+ setupCollectPin();
+ break;
+ case WebEngineWebAuthUxRequest.WebAuthUxState.FinishTokenCollection:
+ setupFinishCollectToken();
+ break;
+ case WebEngineWebAuthUxRequest.WebAuthUxState.RequestFailed:
+ setupErrorUI();
+ break;
+ case WebEngineWebAuthUxRequest.WebAuthUxState.Completed:
+ webAuthDialog.close();
+ break;
+ }
+ }
+
+ ButtonGroup {
+ id : selectAccount;
+ exclusive: true;
+ }
+
+ ListModel {
+ id: selectAccountModel
+
+ }
+ contentItem: Item {
+ ColumnLayout {
+ id : verticalLayout
+ spacing : 10
+
+ Label {
+ id: heading
+ text: "";
+ }
+
+ Label {
+ id: description
+ text: "";
+ }
+
+ Row {
+ spacing : 10
+ Label {
+ id: pinLabel
+ text: "PIN";
+ }
+ TextInput {
+ id: pinEdit
+ text: "EnterPin"
+ enabled: true
+ focus: true
+ color: "white"
+ layer.sourceRect: Qt.rect(0, 0, 20, 20)
+ }
+ }
+
+ Row {
+ spacing : 10
+ Label {
+ id: confirmPinLabel
+ text: "Confirm PIN";
+ }
+ TextEdit {
+ id: confirmPinEdit
+ text: ""
+ }
+ }
+
+ Label {
+ id: pinEntryError
+ text: "";
+ }
+
+ Repeater {
+ id : selectAccountRepeater
+ model: selectAccountModel
+ Column {
+ spacing : 5
+ RadioButton {
+ text: modelData
+ ButtonGroup.group : selectAccount;
+ onClicked: function(){
+ webAuthDialog.selectAccount = text;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ function setupSelectAccountUI() {
+ webAuthDialog.selectAccount = "";
+ heading.text = "Choose a passkey";
+ description.text = "Which passkey do you want to use for " + webAuthDialog.authrequest.relyingPartyId;
+
+ selectAccountModel.clear();
+ var userNames = webAuthDialog.authrequest.userNames;
+ for (var i = 0; i < userNames.length; i++) {
+ selectAccountModel.append( {"name" : userNames[i]});
+ }
+ pinLabel.visible = false;
+ pinEdit.visible = false;
+ confirmPinLabel.visible = false;
+ confirmPinEdit.visible = false;
+ pinEntryError.visible = false;
+ standardButton(Dialog.Apply).visible = true;
+ standardButton(Dialog.Cancel).visible = true;
+ standardButton(Dialog.Cancel).text ="Cancel"
+ }
+
+ function setupCollectPin() {
+ var requestInfo = webAuthDialog.authrequest.pinRequest;
+
+ pinEdit.clear();
+
+ if (requestInfo.reason === WebEngineWebAuthUxRequest.PinEntryReason.Challenge) {
+ heading.text = "PIN required";
+ description.text = "Enter the PIN for your security key";
+ pinLabel.visible = true;
+ pinEdit.visible = true;
+ confirmPinLabel.visible = false;
+ confirmPinEdit.visible = false;
+ } else if (reason === WebEngineWebAuthUxRequest.PinEntryReason.Set) {
+ heading.text = "Set PIN ";
+ description.text = "Set new PIN for your security key";
+ pinLabel.visible = true;
+ pinEdit.visible = true;
+ confirmPinLabel.visible = true;
+ confirmPinEdit.visible = true;
+ }
+ pinEntryError.text = getPINErrorDetails() + " " + requestInfo.remainingAttempts + " attempts reamining";
+ pinEntryError.visible = true;
+ selectAccountModel.clear();
+ standardButton(Dialog.Cancel).visible = true;
+ standardButton(Dialog.Cancel).text ="Cancel"
+ standardButton(Dialog.Apply).visible = true;
+ }
+
+ function getPINErrorDetails() {
+ var requestInfo = webAuthDialog.authrequest.pinRequest;
+ switch (requestInfo.error) {
+ case WebEngineWebAuthUxRequest.PinEntryError.NoError:
+ return "";
+ case WebEngineWebAuthUxRequest.PinEntryError.TooShort:
+ return "Too short";
+ case WebEngineWebAuthUxRequest.PinEntryError.InternalUvLocked:
+ return "Internal Uv locked";
+ case WebEngineWebAuthUxRequest.PinEntryError.WrongPin:
+ return "Wrong PIN";
+ case WebEngineWebAuthUxRequest.PinEntryError.InvalidCharacters:
+ return "Invalid characters";
+ case WebEngineWebAuthUxRequest.PinEntryError.SameAsCurrentPin:
+ return "Same as current PIN";
+ }
+ }
+
+ function getRequestFailureResaon() {
+ var requestFailureReason = webAuthDialog.authrequest.requestFailureReason;
+ switch (requestFailureReason) {
+ case WebEngineWebAuthUxRequest.RequestFailureReason.Timeout:
+ return " Request Timeout";
+ case WebEngineWebAuthUxRequest.RequestFailureReason.KeyNotRegistered:
+ return "Key not registered";
+ case WebEngineWebAuthUxRequest.RequestFailureReason.KeyAlreadyRegistered:
+ return "You already registered this device. You don't have to register it again
+ Try agin with different key or device";
+ case WebEngineWebAuthUxRequest.RequestFailureReason.SoftPinBlock:
+ return "The security key is locked because the wrong PIN was entered too many times.
+ To unlock it, remove and reinsert it.";
+ case WebEngineWebAuthUxRequest.RequestFailureReason.HardPinBlock:
+ return "The security key is locked because the wrong PIN was entered too many times.
+ You'll need to reset the security key.";
+ case WebEngineWebAuthUxRequest.RequestFailureReason.AuthenticatorRemovedDuringPinEntry:
+ return "Authenticator removed during verification. Please reinsert and try again";
+ case WebEngineWebAuthUxRequest.RequestFailureReason.AuthenticatorMissingResidentKeys:
+ return "Authenticator doesn't have resident key support";
+ case WebEngineWebAuthUxRequest.RequestFailureReason.AuthenticatorMissingUserVerification:
+ return "Authenticator missing user verification";
+ case WebEngineWebAuthUxRequest.RequestFailureReason.AuthenticatorMissingLargeBlob:
+ return "Authenticator missing Large Blob support";
+ case WebEngineWebAuthUxRequest.RequestFailureReason.NoCommonAlgorithms:
+ return "No common Algorithms";
+ case WebEngineWebAuthUxRequest.RequestFailureReason.StorageFull:
+ return "Storage full";
+ case WebEngineWebAuthUxRequest.RequestFailureReason.UserConsentDenied:
+ return "User consent denied";
+ case WebEngineWebAuthUxRequest.RequestFailureReason.WinUserCancelled:
+ return "User cancelled request";
+ }
+ }
+
+ function setupFinishCollectToken() {
+ heading.text = "Use your security key with " + webAuthDialog.authrequest.relyingPartyId;
+ description.text = "Touch your security key again to complete the request.";
+ pinLabel.visible = false;
+ pinEdit.visible = false;
+ confirmPinLabel.visible = false;
+ confirmPinEdit.visible = false;
+ selectAccountModel.clear();
+ pinEntryError.visible = false;
+ standardButton(Dialog.Apply).visible = false;
+ standardButton(Dialog.Cancel).visible = true;
+ standardButton(Dialog.Cancel).text ="Cancel"
+ }
+
+ function setupErrorUI() {
+ heading.text = "Something went wrong";
+ description.text = getRequestFailureResaon();
+ pinLabel.visible = false;
+ pinEdit.visible = false;
+ confirmPinLabel.visible = false;
+ confirmPinEdit.visible = false;
+ selectAccountModel.clear();
+ pinEntryError.visible = false;
+ standardButton(Dialog.Apply).visible = false;
+ standardButton(Dialog.Cancel).visible = true;
+ standardButton(Dialog.Cancel).text ="Close"
+ }
+}
diff --git a/examples/webengine/quicknanobrowser/doc/images/quicknanobrowser-demo.jpg b/examples/webenginequick/quicknanobrowser/doc/images/quicknanobrowser-demo.jpg
index 12693bb0f..12693bb0f 100644
--- a/examples/webengine/quicknanobrowser/doc/images/quicknanobrowser-demo.jpg
+++ b/examples/webenginequick/quicknanobrowser/doc/images/quicknanobrowser-demo.jpg
Binary files differ
diff --git a/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc b/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc
new file mode 100644
index 000000000..1dc209c2e
--- /dev/null
+++ b/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc
@@ -0,0 +1,187 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+ \example webenginequick/quicknanobrowser
+ \title WebEngine Quick Nano Browser
+ \ingroup webengine-examples
+ \brief A web browser implemented using the WebEngineView QML type.
+
+ \image quicknanobrowser-demo.jpg
+ \examplecategory {Application Examples}
+ \examplecategory {Web Technologies}
+
+ \e {Quick Nano Browser} demonstrates how to use the \l{Qt WebEngine QML Types}
+ {Qt WebEngine QML types} to develop a small web browser application that consists of a browser
+ window with a title bar, toolbar, tab view, and status bar. The web content is loaded in a web
+ engine view within the tab view. If certificate errors occur, users are prompted for action in a
+ message dialog. The status bar pops up to display the URL of a hovered link.
+
+ A web page can issue a request for being displayed in fullscreen mode. Users can allow full
+ screen mode by using a toolbar button. They can leave fullscreen mode by using a keyboard
+ shortcut. Additional toolbar buttons enable moving backwards and forwards in the browser
+ history, reloading tab content, and opening a settings menu for enabling the following features:
+ JavaScript, plugins, fullscreen mode, off the record, HTTP disk cache, autoloading images, and
+ ignoring certificate errors.
+
+ \include examples-run.qdocinc
+
+ \section1 Creating the Main Browser Window
+
+ When the browser main window is loaded, it creates an empty tab using the default profile. Each
+ tab is a web engine view that fills the main window.
+
+ We create the main window in the \e BrowserWindow.qml file using the ApplicationWindow type:
+
+ \quotefromfile webenginequick/quicknanobrowser/BrowserWindow.qml
+ \skipto ApplicationWindow
+ \printuntil currentWebView
+ \dots
+ \skipto width
+ \printuntil title
+
+ We use the TabBar Qt Quick control to create a tab bar anchored to the top of the window, and
+ create a new, empty tab:
+
+ \skipto TabBar {
+ \printuntil return webview
+ \printuntil }
+
+ The tab contains a web engine view that loads web content:
+
+ \skipto Component {
+ \printuntil currentWebView.reload
+ \printuntil /^\ {8}\}/
+
+ We use the \l Action type to create new tabs:
+
+ \quotefromfile webenginequick/quicknanobrowser/BrowserWindow.qml
+ \skipto reload
+ \skipto Action
+ \printuntil }
+
+ We use the \l TextField Qt Quick Control within a \l ToolBar to create an address bar that
+ shows the current URL and where users can enter another URL:
+
+ \quotefromfile webenginequick/quicknanobrowser/BrowserWindow.qml
+ \skipto menuBar: ToolBar
+ \printuntil anchors.fill
+ \dots
+ \skipto TextField
+ \printuntil addressBar
+ \dots
+ \skipto focus
+ \printuntil /^\ {12}\}/
+
+ \section1 Handling Certificate Errors
+
+ If the certificate of the site being loaded triggers a certificate error, we call the
+ \l{WebEngineCertificateError::}{defer()} QML method to pause the URL request and wait for user
+ input:
+
+ \quotefromfile webenginequick/quicknanobrowser/BrowserWindow.qml
+ \skipto onCertificateError
+ \printuntil }
+
+ We use the Dialog type to prompt users to continue or cancel the loading of the web page.
+ If users select \uicontrol Yes, we call the
+ \l{WebEngineCertificateError::}{acceptCertificate()} method to continue loading content from
+ the URL. If users select \uicontrol No, we call the
+ \l{WebEngineCertificateError::}{rejectCertificate()} method to reject the request and stop
+ loading content from the URL:
+
+ \skipto Dialog {
+ \printuntil /^\ {4}\}/
+
+ \section1 Handling Feature Permission Requests
+
+ We use the \c onFeaturePermissionRequested() signal handler to handle requests for
+ accessing a certain feature or device. The \c securityOrigin parameter identifies the
+ requester web site, and the \c feature parameter is the requested feature. We use these
+ to construct the message of the dialog:
+
+ \quotefromfile webenginequick/quicknanobrowser/BrowserWindow.qml
+ \skipto onFeaturePermissionRequested
+ \printuntil }
+
+ We show a dialog where the user is asked to grant or deny access. The custom
+ \c questionForFeature() JavaScript function generates a human-readable question about
+ the request.
+ If users select \uicontrol Yes, we call the \l{WebEngineView::}{grantFeaturePermission()}
+ method with a third \c true parameter to grant the \c securityOrigin web site the permission
+ to access the \c feature.
+ If users select \uicontrol No, we call the same method but with the \c false parameter to
+ deny access:
+
+ \skipto id: sslDialog
+ \skipto Dialog {
+ \printuntil /^\ {4}\}/
+
+
+ \section1 Entering and Leaving Fullscreen Mode
+
+ We create a menu item for allowing fullscreen mode in a settings menu that we place on the tool
+ bar. Also, we create an action for leaving fullscreen mode by using a keyboard shortcut.
+ We call the \l{FullScreenRequest::}{accept()} method to accept the fullscreen request.
+ The methdod sets the \l{WebEngineView::}{isFullScreen} property to be equal to the
+ \l{FullScreenRequest::}{toggleOn} property.
+
+ \quotefromfile webenginequick/quicknanobrowser/BrowserWindow.qml
+ \skipto onFullScreenRequested
+ \printuntil /^\ {16}\}/
+
+ When entering fullscreen mode, we display a notification using the FullScreenNotification custom
+ type that we create in \e FullScreenNotification.qml.
+
+ We use the \l Action type in the settings menu to create a shortcut for leaving fullscreen mode
+ by pressing the escape key:
+
+ \quotefromfile webenginequick/quicknanobrowser/BrowserWindow.qml
+ \skipto Settings
+ \printuntil appSettings
+ \skipto fullScreenSupportEnabled
+ \printuntil Action
+ \skipto Escape
+ \printuntil /^\ {4}\}/
+
+ \section1 Handling WebAuth/FIDO UX Requests
+
+ We use the \c onWebAuthUxRequested() signal handler to handle requests for
+ WebAuth/FIDO UX. The \c request parameter is an instance of WebEngineWebAuthUxRequest
+ which contains UX request details and APIs required to process the request.
+ We use it to construct WebAuthUX dialog and initiates the UX request flow.
+
+ \quotefromfile webenginequick/quicknanobrowser/BrowserWindow.qml
+ \skipto onWebAuthUxRequested
+ \printuntil }
+
+ The \l WebEngineWebAuthUxRequest object periodically emits the \l
+ {WebEngineWebAuthUxRequest::}{stateChanged} signal to notify potential
+ observers of the current WebAuth UX states. The observers update the WebAuth
+ dialog accordingly. We use onStateChanged() signal handler to handle
+ state change requests. See \c WebAuthDialog.qml for an example
+ of how these signals can be handled.
+
+ \quotefromfile webenginequick/quicknanobrowser/WebAuthDialog.qml
+ \skipto Connections
+ \printuntil }
+ \skipto function init(request)
+ \printuntil }
+
+ \section1 Signing Requirement for macOS
+
+ To allow web sites access to the location, camera, and microphone when running
+ \e {Quick Nano Browser} on macOS, the application needs to be signed. This is
+ done automatically when building, but you need to set up a valid signing identity
+ for the build environment.
+
+ \section1 Files and Attributions
+
+ The example uses icons from the Tango Icon Library:
+
+ \table
+ \row
+ \li \l{quicknanobrowser-tango}{Tango Icon Library}
+ \li Public Domain
+ \endtable
+*/
diff --git a/examples/webengine/quicknanobrowser/icons/3rdparty/COPYING b/examples/webenginequick/quicknanobrowser/icons/3rdparty/COPYING
index 220881da6..220881da6 100644
--- a/examples/webengine/quicknanobrowser/icons/3rdparty/COPYING
+++ b/examples/webenginequick/quicknanobrowser/icons/3rdparty/COPYING
diff --git a/examples/webengine/quicknanobrowser/icons/3rdparty/go-next.png b/examples/webenginequick/quicknanobrowser/icons/3rdparty/go-next.png
index 6f3f65d33..6f3f65d33 100644
--- a/examples/webengine/quicknanobrowser/icons/3rdparty/go-next.png
+++ b/examples/webenginequick/quicknanobrowser/icons/3rdparty/go-next.png
Binary files differ
diff --git a/examples/webengine/quicknanobrowser/icons/3rdparty/go-previous.png b/examples/webenginequick/quicknanobrowser/icons/3rdparty/go-previous.png
index 93be3d1ee..93be3d1ee 100644
--- a/examples/webengine/quicknanobrowser/icons/3rdparty/go-previous.png
+++ b/examples/webenginequick/quicknanobrowser/icons/3rdparty/go-previous.png
Binary files differ
diff --git a/examples/webengine/quicknanobrowser/icons/3rdparty/process-stop.png b/examples/webenginequick/quicknanobrowser/icons/3rdparty/process-stop.png
index b68290bf1..b68290bf1 100644
--- a/examples/webengine/quicknanobrowser/icons/3rdparty/process-stop.png
+++ b/examples/webenginequick/quicknanobrowser/icons/3rdparty/process-stop.png
Binary files differ
diff --git a/examples/webenginequick/quicknanobrowser/icons/3rdparty/qt_attribution.json b/examples/webenginequick/quicknanobrowser/icons/3rdparty/qt_attribution.json
new file mode 100644
index 000000000..d8d85d6f1
--- /dev/null
+++ b/examples/webenginequick/quicknanobrowser/icons/3rdparty/qt_attribution.json
@@ -0,0 +1,24 @@
+{
+ "Id": "quicknanobrowser-tango",
+ "Name": "Tango Icon Library",
+ "QDocModule": "qtwebengine",
+ "QtUsage": "Used in WebEngine Quick Nano Browser example.",
+
+ "QtParts": [ "examples" ],
+ "Description": "Selected icons from the Tango Icon Library",
+ "Homepage": "http://tango.freedesktop.org/Tango_Icon_Library",
+ "Version": "0.8.90",
+ "DownloadLocation": "http://tango.freedesktop.org/releases/tango-icon-theme-0.8.90.tar.gz",
+ "LicenseId": "urn:dje:license:public-domain",
+ "License": "Public Domain",
+ "LicenseFile": "COPYING",
+ "Copyright": ["Ulisse Perusin <uli.peru@gmail.com>",
+ "Steven Garrity <sgarrity@silverorange.com>",
+ "Lapo Calamandrei <calamandrei@gmail.com>",
+ "Ryan Collier <rcollier@novell.com>",
+ "Rodney Dawes <dobey@novell.com>",
+ "Andreas Nilsson <nisses.mail@home.se>",
+ "Tuomas Kuosmanen <tigert@tigert.com>",
+ "Garrett LeSage <garrett@novell.com>",
+ "Jakub Steiner <jimmac@novell.com>"]
+}
diff --git a/examples/webengine/quicknanobrowser/icons/3rdparty/view-refresh.png b/examples/webenginequick/quicknanobrowser/icons/3rdparty/view-refresh.png
index cab4d02c7..cab4d02c7 100644
--- a/examples/webengine/quicknanobrowser/icons/3rdparty/view-refresh.png
+++ b/examples/webenginequick/quicknanobrowser/icons/3rdparty/view-refresh.png
Binary files differ
diff --git a/examples/webenginequick/quicknanobrowser/main.cpp b/examples/webenginequick/quicknanobrowser/main.cpp
new file mode 100644
index 000000000..1e693cbcd
--- /dev/null
+++ b/examples/webenginequick/quicknanobrowser/main.cpp
@@ -0,0 +1,53 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include "utils.h"
+
+#include <QtWebEngineQuick/qtwebenginequickglobal.h>
+
+#include <QtQml/QQmlApplicationEngine>
+#include <QtQml/QQmlContext>
+
+#include <QtGui/QGuiApplication>
+
+#include <QtCore/QCommandLineParser>
+#include <QtCore/QCommandLineOption>
+#include <QtCore/QLoggingCategory>
+
+static QUrl startupUrl(const QCommandLineParser &parser)
+{
+ if (!parser.positionalArguments().isEmpty()) {
+ const QUrl url = Utils::fromUserInput(parser.positionalArguments().constFirst());
+ if (url.isValid())
+ return url;
+ }
+ return QUrl(QStringLiteral("chrome://qt"));
+}
+
+int main(int argc, char **argv)
+{
+ QCoreApplication::setApplicationName("Quick Nano Browser");
+ QCoreApplication::setOrganizationName("QtProject");
+
+ QtWebEngineQuick::initialize();
+
+ QGuiApplication app(argc, argv);
+ QLoggingCategory::setFilterRules(QStringLiteral("qt.webenginecontext.debug=true"));
+
+ QCommandLineParser parser;
+ parser.addHelpOption();
+ parser.addVersionOption();
+ parser.addPositionalArgument("url", "The URL to open.");
+ parser.process(app);
+
+ QQmlApplicationEngine appEngine;
+ appEngine.load(QUrl("qrc:/ApplicationRoot.qml"));
+ if (appEngine.rootObjects().isEmpty())
+ qFatal("Failed to load sources");
+
+ const QUrl url = startupUrl(parser);
+ QMetaObject::invokeMethod(appEngine.rootObjects().constFirst(),
+ "load", Q_ARG(QVariant, url));
+
+ return app.exec();
+}
diff --git a/examples/webenginequick/quicknanobrowser/quicknanobrowser.exe.manifest b/examples/webenginequick/quicknanobrowser/quicknanobrowser.exe.manifest
new file mode 100644
index 000000000..acc401776
--- /dev/null
+++ b/examples/webenginequick/quicknanobrowser/quicknanobrowser.exe.manifest
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
+ <application>
+ <!--The ID below indicates application support for Windows Vista -->
+ <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
+ <!--The ID below indicates application support for Windows 7 -->
+ <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
+ <!--The ID below indicates application support for Windows 8 -->
+ <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
+ <!--The ID below indicates application support for Windows 8.1 -->
+ <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
+ <!--The ID below indicates application support for Windows 10/11 -->
+ <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
+ </application>
+</compatibility>
+</assembly>
diff --git a/examples/webenginequick/quicknanobrowser/quicknanobrowser.pro b/examples/webenginequick/quicknanobrowser/quicknanobrowser.pro
new file mode 100644
index 000000000..bd5427dc5
--- /dev/null
+++ b/examples/webenginequick/quicknanobrowser/quicknanobrowser.pro
@@ -0,0 +1,27 @@
+requires(qtConfig(accessibility))
+
+TEMPLATE = app
+TARGET = quicknanobrowser
+
+HEADERS = utils.h
+SOURCES = main.cpp
+
+win32 {
+ CONFIG -= embed_manifest_exe
+ QMAKE_MANIFEST = $$PWD/quicknanobrowser.exe.manifest
+}
+
+RESOURCES += resources.qrc
+
+QT += qml quick webenginequick
+
+CONFIG += qmltypes
+QML_IMPORT_NAME = BrowserUtils
+QML_IMPORT_MAJOR_VERSION = 1
+
+qtHaveModule(widgets) {
+ QT += widgets # QApplication is required to get native styling with QtQuickControls
+}
+
+target.path = $$[QT_INSTALL_EXAMPLES]/webenginequick/quicknanobrowser
+INSTALLS += target
diff --git a/examples/webenginequick/quicknanobrowser/resources.qrc b/examples/webenginequick/quicknanobrowser/resources.qrc
new file mode 100644
index 000000000..0a0b42bbb
--- /dev/null
+++ b/examples/webenginequick/quicknanobrowser/resources.qrc
@@ -0,0 +1,17 @@
+<RCC>
+ <qresource prefix="/">
+ <file>ApplicationRoot.qml</file>
+ <file>BrowserDialog.qml</file>
+ <file>BrowserWindow.qml</file>
+ <file>DownloadView.qml</file>
+ <file>FindBar.qml</file>
+ <file>FullScreenNotification.qml</file>
+ <file>WebAuthDialog.qml</file>
+ </qresource>
+ <qresource prefix="/icons">
+ <file alias="go-next.png">icons/3rdparty/go-next.png</file>
+ <file alias="go-previous.png">icons/3rdparty/go-previous.png</file>
+ <file alias="process-stop.png">icons/3rdparty/process-stop.png</file>
+ <file alias="view-refresh.png">icons/3rdparty/view-refresh.png</file>
+ </qresource>
+</RCC>
diff --git a/examples/webenginequick/quicknanobrowser/utils.h b/examples/webenginequick/quicknanobrowser/utils.h
new file mode 100644
index 000000000..6c11e75fb
--- /dev/null
+++ b/examples/webenginequick/quicknanobrowser/utils.h
@@ -0,0 +1,29 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#ifndef UTILS_H
+#define UTILS_H
+
+#include <QtQml/qqml.h>
+
+#include <QtCore/QFileInfo>
+#include <QtCore/QUrl>
+
+class Utils : public QObject
+{
+ Q_OBJECT
+ QML_ELEMENT
+ QML_SINGLETON
+public:
+ Q_INVOKABLE static QUrl fromUserInput(const QString &userInput);
+};
+
+inline QUrl Utils::fromUserInput(const QString &userInput)
+{
+ QFileInfo fileInfo(userInput);
+ if (fileInfo.exists())
+ return QUrl::fromLocalFile(fileInfo.absoluteFilePath());
+ return QUrl::fromUserInput(userInput);
+}
+
+#endif // UTILS_H
diff --git a/examples/webenginequick/webenginequick.pro b/examples/webenginequick/webenginequick.pro
new file mode 100644
index 000000000..fb44f2c54
--- /dev/null
+++ b/examples/webenginequick/webenginequick.pro
@@ -0,0 +1,9 @@
+TEMPLATE=subdirs
+
+SUBDIRS += \
+ quicknanobrowser
+
+qtHaveModule(quickcontrols2) {
+ SUBDIRS += \
+ lifecycle
+}
diff --git a/examples/webenginewidgets/CMakeLists.txt b/examples/webenginewidgets/CMakeLists.txt
new file mode 100644
index 000000000..3ce666d72
--- /dev/null
+++ b/examples/webenginewidgets/CMakeLists.txt
@@ -0,0 +1,26 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+qt_internal_add_example(contentmanipulation)
+qt_internal_add_example(cookiebrowser)
+qt_internal_add_example(notifications)
+qt_internal_add_example(simplebrowser)
+qt_internal_add_example(push-notifications)
+qt_internal_add_example(videoplayer)
+if(QT_FEATURE_webengine_geolocation)
+ qt_internal_add_example(maps)
+endif()
+if(QT_FEATURE_webengine_webchannel)
+ qt_internal_add_example(recipebrowser)
+endif()
+if(QT_FEATURE_webengine_printing_and_pdf)
+ qt_internal_add_example(printme)
+ qt_internal_add_example(html2pdf)
+endif()
+if(QT_FEATURE_webengine_spellchecker AND NOT CMAKE_CROSSCOMPILING
+ AND NOT QT_FEATURE_webengine_native_spellchecker AND NOT WIN32)
+ qt_internal_add_example(spellchecker)
+endif()
+if(QT_FEATURE_ssl)
+ qt_internal_add_example(clientcertificate)
+endif()
diff --git a/examples/webenginewidgets/clientcertificate/CMakeLists.txt b/examples/webenginewidgets/clientcertificate/CMakeLists.txt
new file mode 100644
index 000000000..97c9393ff
--- /dev/null
+++ b/examples/webenginewidgets/clientcertificate/CMakeLists.txt
@@ -0,0 +1,60 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+project(clientcertificate LANGUAGES CXX)
+
+set(CMAKE_AUTOMOC ON)
+
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webenginewidgets/clientcertificate")
+
+find_package(Qt6 REQUIRED COMPONENTS Core Gui WebEngineWidgets)
+
+qt_add_executable(server
+ server.cpp
+)
+
+qt_add_executable(client
+ client.cpp
+)
+
+set_target_properties(client PROPERTIES
+ WIN32_EXECUTABLE TRUE
+ MACOSX_BUNDLE TRUE
+)
+
+qt_add_resources(client "client"
+ PREFIX
+ "/"
+ FILES
+ "resources/client.pem"
+ "resources/client.key"
+)
+
+qt_add_resources(server "server"
+ PREFIX
+ "/"
+ FILES
+ "resources/server.pem"
+ "resources/server.key"
+ "resources/ca.pem"
+)
+
+target_link_libraries(client PUBLIC
+ Qt::WebEngineWidgets
+)
+
+target_link_libraries(server PUBLIC
+ Qt::Core
+ Qt::Network
+)
+
+install(TARGETS server client
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/webenginewidgets/clientcertificate/client.cpp b/examples/webenginewidgets/clientcertificate/client.cpp
new file mode 100644
index 000000000..1227fa28e
--- /dev/null
+++ b/examples/webenginewidgets/clientcertificate/client.cpp
@@ -0,0 +1,67 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include <QtCore/qfile.h>
+#include <QtNetwork/qsslkey.h>
+#include <QtWebEngineCore/qwebenginecertificateerror.h>
+#include <QtWebEngineCore/qwebengineclientcertificatestore.h>
+#include <QtWebEngineCore/qwebengineprofile.h>
+#include <QtWebEngineCore/qwebenginepage.h>
+#include <QtWebEngineWidgets/qwebengineview.h>
+#include <QtWidgets/qapplication.h>
+#include <QtWidgets/qdialog.h>
+#include <QtWidgets/qlabel.h>
+#include <QtWidgets/qlistwidget.h>
+#include <QtWidgets/qpushbutton.h>
+#include <QtWidgets/qboxlayout.h>
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication::setOrganizationName("QtExamples");
+ QApplication app(argc, argv);
+
+ QFile certFile(":/resources/client.pem");
+ certFile.open(QIODevice::ReadOnly);
+ const QSslCertificate cert(certFile.readAll(), QSsl::Pem);
+
+ QFile keyFile(":/resources/client.key");
+ keyFile.open(QIODevice::ReadOnly);
+ const QSslKey sslKey(keyFile.readAll(), QSsl::Rsa, QSsl::Pem, QSsl::PrivateKey, "");
+
+ QWebEngineProfile::defaultProfile()->clientCertificateStore()->add(cert, sslKey);
+
+ QWebEnginePage page;
+ QObject::connect(&page, &QWebEnginePage::certificateError,
+ [](QWebEngineCertificateError e) { e.acceptCertificate(); });
+
+ QObject::connect(
+ &page, &QWebEnginePage::selectClientCertificate, &page,
+ [&cert](QWebEngineClientCertificateSelection selection) {
+ QDialog dialog;
+ QVBoxLayout *layout = new QVBoxLayout;
+ QLabel *label = new QLabel(QLatin1String("Select certificate"));
+ QListWidget *listWidget = new QListWidget;
+ listWidget->setSelectionMode(QAbstractItemView::SingleSelection);
+ QPushButton *button = new QPushButton(QLatin1String("Select"));
+ layout->addWidget(label);
+ layout->addWidget(listWidget);
+ layout->addWidget(button);
+ QObject::connect(button, &QPushButton::clicked, [&dialog]() { dialog.accept(); });
+ const QList<QSslCertificate> &list = selection.certificates();
+ for (const QSslCertificate &cert : list) {
+ listWidget->addItem(cert.subjectDisplayName() + " : " + cert.serialNumber());
+ }
+ dialog.setLayout(layout);
+ if (dialog.exec() == QDialog::Accepted)
+ selection.select(list[listWidget->currentRow()]);
+ else
+ selection.selectNone();
+ });
+
+ QWebEngineView view(&page);
+ view.setUrl(QUrl("https://localhost:5555"));
+ view.resize(800, 600);
+ view.show();
+
+ return app.exec();
+}
diff --git a/examples/webenginewidgets/clientcertificate/client.pro b/examples/webenginewidgets/clientcertificate/client.pro
new file mode 100644
index 000000000..e397d5efa
--- /dev/null
+++ b/examples/webenginewidgets/clientcertificate/client.pro
@@ -0,0 +1,10 @@
+TEMPLATE = app
+
+QT += webenginewidgets
+
+SOURCES += client.cpp
+
+RESOURCES += resources/client.qrc
+
+target.path = $$[QT_INSTALL_EXAMPLES]/clientcertificate/client
+INSTALLS += target
diff --git a/examples/webenginewidgets/clientcertificate/clientcertificate.pro b/examples/webenginewidgets/clientcertificate/clientcertificate.pro
new file mode 100644
index 000000000..66039d05c
--- /dev/null
+++ b/examples/webenginewidgets/clientcertificate/clientcertificate.pro
@@ -0,0 +1,7 @@
+QT_FOR_CONFIG += network-private
+TEMPLATE = subdirs
+
+client.file = client.pro
+server.file = server.pro
+
+qtConfig(ssl): SUBDIRS += client server
diff --git a/examples/webenginewidgets/clientcertificate/doc/images/granted.png b/examples/webenginewidgets/clientcertificate/doc/images/granted.png
new file mode 100644
index 000000000..b2def9b5e
--- /dev/null
+++ b/examples/webenginewidgets/clientcertificate/doc/images/granted.png
Binary files differ
diff --git a/examples/webenginewidgets/clientcertificate/doc/images/selection.png b/examples/webenginewidgets/clientcertificate/doc/images/selection.png
new file mode 100644
index 000000000..2756ac7be
--- /dev/null
+++ b/examples/webenginewidgets/clientcertificate/doc/images/selection.png
Binary files differ
diff --git a/examples/webenginewidgets/clientcertificate/doc/src/clientcertificate.qdoc b/examples/webenginewidgets/clientcertificate/doc/src/clientcertificate.qdoc
new file mode 100644
index 000000000..c5440f08f
--- /dev/null
+++ b/examples/webenginewidgets/clientcertificate/doc/src/clientcertificate.qdoc
@@ -0,0 +1,160 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+ \example webenginewidgets/clientcertificate
+ \examplecategory {Web Technologies}
+ \title WebEngine Widgets Client Certificate Example
+ \ingroup webengine-widgetexamples
+ \brief A simple client certificate authentication scenario using \QWE and \l QSslServer.
+
+ \image selection.png
+
+ In this example we are going to show a client certificate authentication workflow.
+ The presented authentication scenario can be for example implemented
+ for an embedded device, which provides a web interface to handle its functionality.
+ The administrator uses the \QWE powered client to maintain the embedded device
+ and has a custom SSL certificate to authenticate.
+ The connection is encrypted with SSL sockets. The embedded device uses
+ a \c QSslSocket to handle the authentication and the encryption. This way the
+ administrator does not have to enter any credentials and just needs to select
+ a proper certificate that is recognized by the device.
+
+ In the example we focus on a very simple and minimalistic approach to demonstrate
+ the workflow. Note that QSslSocket is a low level solution as we do not have to
+ run a full-blown HTTPS server on the resource limited embedded device.
+
+ \section1 Creating Certificates
+
+ The example comes with certificates already generated, but let's see how to generate
+ new ones. We create certificates for the server and the client using
+ \l{https://www.openssl.org}{OpenSSL tooling}.
+
+ First, we create the certificate signing request \c CSR and sign it. We will use
+ a CA private key to sign and issue both local certificates for the client and the server.
+
+ \badcode
+ openssl req -out ca.pem -new -x509 -nodes -keyout ca.key
+ \endcode
+
+ \note Specify the \c {-days} option to override the default certificate validity of 30 days.
+
+ Now, let's create two private keys for our client and a server:
+
+ \badcode
+ openssl genrsa -out client.key 2048
+ \endcode
+ \badcode
+ openssl genrsa -out server.key 2048
+ \endcode
+
+ Next we need two certificate signing requests:
+
+ \badcode
+ openssl req -key client.key -new -out client.req
+ \endcode
+ \badcode
+ openssl req -key server.key -new -out server.req
+ \endcode
+
+ Let's issue now both certificates from CSRs:
+
+ \badcode
+ openssl x509 -req -in client.req -out client.pem -CA ca.pem -CAkey ca.key
+ \endcode
+ \badcode
+ openssl x509 -req -in server.req -out server.pem -CA ca.pem -CAkey ca.key
+ \endcode
+
+ The client certificate subject and the serial number will be displayed for
+ selection during authentication. The serial number can be printed with:
+
+ \badcode
+ openssl x509 -serial -noout -in client.pem
+ \endcode
+
+ \section1 Implementing the Client
+
+ Now we can implement our web browser client.
+
+ We start by loading our certificate and its private key and creating \l QSslCertificate
+ and \l QSslKey instances.
+
+
+ \quotefromfile webenginewidgets/clientcertificate/client.cpp
+ \skipto QFile
+ \printuntil QSslKey
+
+ Now we add the certificate and its private key to \l {QWebEngineClientCertificateStore}.
+
+ \printuntil clientCertificateStore
+
+ To handle certificates we need to create an instance of \l QWebEnginePage and connect to two
+ singals \l QWebEnginePage::certificateError and \l QWebEnginePage::selectClientCertificate.
+ The first one is only needed as our self-signed server certificate will trigger a certificate
+ error, which has to be accepted to proceed with the authentication. In production
+ environments self-signed certificates are not used, therefore in this example we handle
+ \l QWebEngineCertificateError just to avoid providing proper certificates.
+ Note the private key is a secret and should never be published.
+
+ \printuntil acceptCertificate
+
+ The handling for \l QWebEnginePage::selectClientCertificate simply displays \l QDialog
+ with \l QListWidget showing a list of client certificates to choose from.
+ The user selected certificate is then passed to the
+ \l QWebEngineClientCertificateSelection::select call.
+
+ \printto QWebEngineView
+
+ Finally, we create a \l QWebEngineView for our \l QWebEnginePage, load the server
+ URL, and show the page.
+
+ \printuntil show
+
+ \section1 Implementing the Server
+
+ For our embedded device we will develop a minimalistic HTTPS server. We can use \l QSslServer
+ to handle incoming connections and to provide an \l QSslSocket instance. To do that,
+ we create an instance of a \l QSslServer and, similarly to our client setup, we load a server
+ certificate and its private key. Next, we create \l QSslCertificate and \l QSslKey objects
+ accordingly. Additionally, we need a CA certificate so the server can validate the certificate
+ presented by the client. The CA and local certificate are set to \l QSslConfiguration and
+ used later by the server.
+
+ \quotefromfile webenginewidgets/clientcertificate/server.cpp
+ \skipto QSslServer
+ \printuntil setSslConfiguration
+
+ Next, we set the server to listen for incoming connections on port \c 5555
+
+ \printuntil qInfo
+
+ We provide a lambda function for the \l QTcpServer::pendingConnectionAvailable signal,
+ where we implement handling for incoming connections. This signal is triggered
+ after authentication has succeeded and \c socket TLS encryption has started.
+
+ \printto readyRead
+
+ The \c Request object used above is a simple wrapper around \l QByteArray as we use
+ \l QPointer to help with memory management. This object gathers incoming HTTP data.
+ It is deleted when the request has completed or a socket has been terminated.
+
+ \quotefromfile webenginewidgets/clientcertificate/server.cpp
+ \skipto struct
+ \printuntil };
+
+ The reply for the request depends on the requested URL, and it is sent back through
+ the socket in form of a HTML page. For the \c GET root request the administrator sees
+ the \c {Access Granted} message and an \c {Exit} HTML button. If the administrator clicks it,
+ the client sends another request. This time with the \c{/exit} relative URL,
+ which it turn triggers the server termination.
+
+ \quotefromfile webenginewidgets/clientcertificate/server.cpp
+ \skipto readyRead
+ \printuntil });
+
+ To run the example, start the \c server and then the \c client. After you select
+ the certificate, the \c {Access Granted} page is displayed.
+
+ \image granted.png
+*/
diff --git a/examples/webenginewidgets/clientcertificate/resources/ca.pem b/examples/webenginewidgets/clientcertificate/resources/ca.pem
new file mode 100644
index 000000000..cb62ad62c
--- /dev/null
+++ b/examples/webenginewidgets/clientcertificate/resources/ca.pem
@@ -0,0 +1,24 @@
+-----BEGIN CERTIFICATE-----
+MIIECzCCAvOgAwIBAgIUdhDW1WgGxF313LYA0JjEQpKbanQwDQYJKoZIhvcNAQEL
+BQAwgZQxCzAJBgNVBAYTAkRFMQ8wDQYDVQQIDAZCZXJsaW4xDzANBgNVBAcMBkJl
+cmxpbjEXMBUGA1UECgwOVGhlIFF0IENvbXBhbnkxFDASBgNVBAsMC1F0V2ViRW5n
+aW5lMRIwEAYDVQQDDAl3d3cucXQuaW8xIDAeBgkqhkiG9w0BCQEWEXF0d2ViZW5n
+aW5lQHF0LmlvMB4XDTIyMTExNjExMDQxNFoXDTMyMTExMzExMDQxNFowgZQxCzAJ
+BgNVBAYTAkRFMQ8wDQYDVQQIDAZCZXJsaW4xDzANBgNVBAcMBkJlcmxpbjEXMBUG
+A1UECgwOVGhlIFF0IENvbXBhbnkxFDASBgNVBAsMC1F0V2ViRW5naW5lMRIwEAYD
+VQQDDAl3d3cucXQuaW8xIDAeBgkqhkiG9w0BCQEWEXF0d2ViZW5naW5lQHF0Lmlv
+MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxyNLLwAA+FgNQavVJ19n
+gdoy+NKLHQyhzcRFykKSp9aAbpAR6e4ukxwG7mWNBcuR7zv1Zw/JqLFE0gmVztVw
+FeQWdw1cvTN/OlVEuM+0ShTDHHsCqRpx7/XJT6ytMKVU8jdZN4Vl1m7MubWv4aPy
+0WYYd3zIAicciYgy/RHaRhPTKpPzWIPYhmHsM5w2cebL8I0aZXUkC0OeklJArnp9
+007Fr6SXXK0xQ3RO20n7X193gCfd5U70lug0ks/ZZqxtzPHmzIO1WGAOBura50HR
+hxUKAu7qQHzBiW5Qwdn0af4FPLJR/SX8ADKTLCSWlMOo1FLYO5w6D8hB4K6/b9VQ
+RwIDAQABo1MwUTAdBgNVHQ4EFgQUXuTuB85/iBgwJpLdOc+8TB0KESIwHwYDVR0j
+BBgwFoAUXuTuB85/iBgwJpLdOc+8TB0KESIwDwYDVR0TAQH/BAUwAwEB/zANBgkq
+hkiG9w0BAQsFAAOCAQEAvtucUJa0IECltWv8U6R+LQuZ1Q+ubbmstojO/h8tg6Wf
+v6FZ5bH3oboSyGEcytRr6INf4G6znUNAypbodehAEW6/PETdzGM9CJyv2JPJAWzV
+rxb1H5VTyiEs8924QOqcNATD+oe7G0vwnDkvprcqaWBA6yvQkWpCXoqMc+F95KnY
+8VFt2VQw17l4L4nhaX3Us6hJLMiKV+dLeF0pN+pkCPRP9G5WKgW3mT2U6Gig+rLz
+6L7rBbb5KWAttdAbuHCrMa65PgXoVD1P/GteFxUnghDd0PWgUaign8c/DyHGsrbA
+uvJqSym0kmQQXptryRaKFsGcCrizdbE6FfrH2iE7vQ==
+-----END CERTIFICATE-----
diff --git a/examples/webenginewidgets/clientcertificate/resources/client.key b/examples/webenginewidgets/clientcertificate/resources/client.key
new file mode 100644
index 000000000..21c8e3183
--- /dev/null
+++ b/examples/webenginewidgets/clientcertificate/resources/client.key
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEowIBAAKCAQEAqnHbq38y1VprEaV2xXzv2nAPyjqCuIfuick8qETkzEsNWPQi
+dsBlLfcyf+15wEMhpRIwILXCrUM7Sb7WCGtg1XC00JZvCh2xPBMSD2fiQyHn4men
+Fwh9vVbTf1v7w21ZT/pXQrwlgLgNWYZHE3JrcEAwlThQRIdQfzSE6/QeHfYZoGB9
+WfvbREsOWiUlZze/yrblS9vnAVhYwVurelc7lXyHA0dHmkcZ0HwMxVJZ/vLuCyIw
+lNGT/ytnA9p1l8uFkAgTcbWZKoyJAsAZG9faZp46hk8+e3KAyKQ78aoUSbjAqnNQ
+tBM3bnHeHanf3ddCxyej+k9PfSIY27a9FZxHpQIDAQABAoIBAFsomA8p8ZsQR9Fh
+SJupDXMrmhZTotRkxxxkR4/LgP8OaO4ZbFFM5xBldFndPc+pV9Y8WwczjxIxsgTo
+Dvrjyx98rwgcXPjxFniFzpP0wJudB7McMs5r2SwpwuYL4SQNWMYgowjrLbehOGqY
+GW16NaIMgq9cNfng0RmnkivMHUtyE5GGdK+C6cyK+fIE+cNtQtHPRKfEnwbE9VHz
+3EY/nCXGZvMFyj5uHaU4EeZFCzo19TUqhh8H7b0EA44pBtb5U/CxsH4xphZ7rpjt
+iVjMfRSMR4qalQNIs6ZEj57We+M/zca/Qq1yhjW+0NYbZifcYo1Oj6e4lC9YlIgn
+kGkcuUECgYEA1j0iVFjgBXS8pJP3jBgmbrbBBTNEUv27yjnJCAQx5TbplJkvBM4/
+qzum1uH2o6uRrFtrYJFiAhDHARtg+70rMeYqZp8WFvzJT5c5s+FOmGQPfFjgrD6e
+wfnCwFzS7nohJ8TM2mPGJ88pBv0eBYW6D0f7fvcJmEk8hnGktdLRCrECgYEAy6tU
+YFZDzGhbgrG2wWzBvAKVngUNhrYZHMiF1WVN8zZdCm7Z8b1S/NMe0rPA5orhAkSX
+8fxlDfKOm+U2fKp43aiN0NDiP0TlGRbypAXe7FSnvDxNHbV+Ie0UbwuiJ4s3vJuc
+6cdzgKqAs5/rjPXPdUpM8C7344HV7azgSzHIYTUCgYAtVmCmcuxtmye0uG+BoTa4
+5UnxvMivu2x7PkFRxfl9JWLHBKfTn4YPyZ7kCIu2VT+NtwcBN6MDBuPmUxHyFDVI
+6Ql+EBqPoM1FX55hd8O3Mi2oxfI94T6dlCpnpP0qZIQRs28apFSx5gArr3Mj/gnC
+5BvP4Z2RMaZyWShfJg8A8QKBgQClZEhswyDjiYtmorJqeMsKxn6BiFDnqFDUUvJ7
+zHx0mR0NL9/Es54Eud059ccccIMwuEs7s17M6MBuUMDik/z647nmbPqNroDs0vnP
+wQS6njRoY/+rtIrtOf1x/9x6iE+G1keigNmHDu7c72z1V1hVQzUfhsS+99yl2dF6
+vr6eUQKBgF/OHW1bE3FruZ+53Arcb94N/IKnpH9VWoB3elIzr0w6pLtL4HHhmQ58
+TayEpq6YguUAjTvCBbaHuYuKPHiXCAy5DhtrXvP4YdMNH9X1nHc7jVEbGltVbnQU
+bG/p5YfZSrDmsjf8w0z7feFOcovC6vF1YCXc8OHK/LQ6JFJ/gtO1
+-----END RSA PRIVATE KEY-----
diff --git a/examples/webenginewidgets/clientcertificate/resources/client.pem b/examples/webenginewidgets/clientcertificate/resources/client.pem
new file mode 100644
index 000000000..dd1f898f7
--- /dev/null
+++ b/examples/webenginewidgets/clientcertificate/resources/client.pem
@@ -0,0 +1,22 @@
+-----BEGIN CERTIFICATE-----
+MIIDrzCCApcCFFNQAgGBu5nr81tUMdXXLGkm8Li+MA0GCSqGSIb3DQEBCwUAMIGU
+MQswCQYDVQQGEwJERTEPMA0GA1UECAwGQmVybGluMQ8wDQYDVQQHDAZCZXJsaW4x
+FzAVBgNVBAoMDlRoZSBRdCBDb21wYW55MRQwEgYDVQQLDAtRdFdlYkVuZ2luZTES
+MBAGA1UEAwwJd3d3LnF0LmlvMSAwHgYJKoZIhvcNAQkBFhFxdHdlYmVuZ2luZUBx
+dC5pbzAeFw0yMjExMTYxMjExMDFaFw0zMjExMTMxMjExMDFaMIGSMQswCQYDVQQG
+EwJERTEPMA0GA1UECAwGQmVybGluMQ8wDQYDVQQHDAZCZXJsaW4xFzAVBgNVBAoM
+DlRoZSBRdCBDb21wYW55MRQwEgYDVQQLDAtRdFdlYkVuZ2luZTEVMBMGA1UEAwwM
+Y2xpZW50LnF0LmlvMRswGQYJKoZIhvcNAQkBFgxjbGllbnRAcXQuaW8wggEiMA0G
+CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCqcdurfzLVWmsRpXbFfO/acA/KOoK4
+h+6JyTyoROTMSw1Y9CJ2wGUt9zJ/7XnAQyGlEjAgtcKtQztJvtYIa2DVcLTQlm8K
+HbE8ExIPZ+JDIefiZ6cXCH29VtN/W/vDbVlP+ldCvCWAuA1ZhkcTcmtwQDCVOFBE
+h1B/NITr9B4d9hmgYH1Z+9tESw5aJSVnN7/KtuVL2+cBWFjBW6t6VzuVfIcDR0ea
+RxnQfAzFUln+8u4LIjCU0ZP/K2cD2nWXy4WQCBNxtZkqjIkCwBkb19pmnjqGTz57
+coDIpDvxqhRJuMCqc1C0Ezducd4dqd/d10LHJ6P6T099Ihjbtr0VnEelAgMBAAEw
+DQYJKoZIhvcNAQELBQADggEBALE75ZQxmEXJA16cNAxxmxCKHkaqAE6Ulim1vXNH
+jCFfNCDGYn/R28F3BVtMe+bIMoomaTh3h5eOd/9uc2nm8IiT5FUz9epJWPeRG/cl
+I+hQ3fvaE7oJ3m3EwfGq1mdqUf1zi+DFjtkimNbn9ZRDocZfpO5VN0u23ptEuk0P
+5cH4+Dst0giRMv5W0kXG6QD13H/eVH3jDZCtZa/8T4oxGGskHEa4yDr8s976lVOV
+XLI1r7oN4a/KXKow8WN3oHFeKn4QJx86z1uecuZLtT8xjABKSWpZqgsIlmGTGE1a
+9W06C+uPVamwn5ND3gnf93YQqn6PwrjlHdrQOTG/vngJLPw=
+-----END CERTIFICATE-----
diff --git a/examples/webenginewidgets/clientcertificate/resources/client.qrc b/examples/webenginewidgets/clientcertificate/resources/client.qrc
new file mode 100644
index 000000000..cc3492e80
--- /dev/null
+++ b/examples/webenginewidgets/clientcertificate/resources/client.qrc
@@ -0,0 +1,6 @@
+<RCC>
+ <qresource prefix="/resources">
+ <file>client.key</file>
+ <file>client.pem</file>
+ </qresource>
+</RCC>
diff --git a/examples/webenginewidgets/clientcertificate/resources/server.key b/examples/webenginewidgets/clientcertificate/resources/server.key
new file mode 100644
index 000000000..632cc4d2e
--- /dev/null
+++ b/examples/webenginewidgets/clientcertificate/resources/server.key
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEowIBAAKCAQEA5gQoJryenjmvzy4RbqHdNXHK8Gk/8Lto1SwT8+Wbh5EyYRTt
+hFdioT1JYcIe3XMwOmx3TjADY1jAXAPfeRcjTkMcnZwF76AXUK2XqBANhaG1wjsi
+b7ISGU/U5/Jarm2iwQJ5zjKsNm8pZYqpmKsYAVFMErtfcpdLdSp6BG54SrbItcXh
+WHfsUs5cuVEi9nCeugLkDzoPLlj/TeouKWOdzhyvLXkPvPmD4/hD0dULTXpCDZhf
+73AuQBWTGsWeUnJQiQhDRwuXWhGRX8qFJQ4rzY8rIbaKhge+BQ6BL+pij2uzHKNQ
+j12ZLFZgLihLDJogGp08y9Ud6Ru/3WGoFkY38wIDAQABAoIBABM/TczQA8XhteB0
+Tmkfik8qknzDkeInDIKqCZFjKTyS3dBZ2/YzCcHMSxOvFr4ZIXQCF4mnYuExUAdj
+G5QaZ43o98AIikae8tSBcitSDI+eFIOIRz1pfTI5B+vQz93AttnHx0GF4/s6GhCx
+JbfsuTmDAAahPz9rgZjwUP2F8PLvaAZqJrXBPY+QLWz0SN2zh6vWAHPbJA0sO/4E
+oWUhRPXJDf33YCFxnwtbUBie5313suAfNspODcyH+AxBH2FFh63pe0ZGOhX7XFMJ
+yxJqujeZrQdfwFZNPXAPVLJGbd7AIOrVE+O8/bYUB/uuj6pPJBqr+Ob/JhY48pRb
+VG2qL4ECgYEA9n3PuL13F9XFcLeergGH7fUcSQeD1T6Z1qaI2Wth0Umfmer/fFZh
+IKSCSwEGMTLsalFdlTj8jsSAasjuSorQTeSgHjzvzik1Ll2P6syputjsD1RX/nkl
+8L50Pwdeey57Y9dgow7Cw/heGYs6dkXLe9H6qM7eoB8Vrk7/TAFuqNECgYEA7uOl
+oKyOxeLn005cenc5enY2IxDhXTaAjTGHE64C0lmicD2OZB7/b+ZIb8M5R7GnCNox
+4TxLSRhZYOMO/QcTrnSND5PXbX/HLd3nyQRIN1XtBbg7pJooxP/MQ/Ne5XTTMjCg
+qPudkOe0ZgUHEcuH8m/YAFY3DDJC50uiXqYtxYMCgYBHfL+ExbZHfGExyp9Duf/x
+PHhCmeJbMzessEnaPLF24FJgcm48YlTzAaMkG5zvIeS9BPIOOCPPSCAyWCn8BnxZ
+SuhBPM0TzpG067+0ijzjiswTuhN3Iy2kv6e5K+rz8MwqbamCQOKtsVehMub2rFFS
+jNiUosKgT8Oa9SBHq9arMQKBgQCE3EVEnFP3iOAILH/QeLiV/GLVk9DTR7mtTUtj
+zZayKLnoFMQ5uOe182x8BCa6UfqlOL0fGKqCZ7Fl6kJuxV3T2+yMKlxZAQTk5JLB
+wMjtRbPCR5mcTUS5c87GR/eSRCwlsNfZw775VXSGfOtWoUzlsACBB3IsLVP6UZ1n
+aKLyQwKBgC61BvKiyGBEYIchqMI4dSF+zCJbSjNUtjwVobcgC6yERZtX2OeLFCoh
+NEf9CcL2Eqb+RzwAD3OV65AiZcrThQNXZ8poBxvwWK8I6E6zB+LX7POAvNu/AV/5
+ANnxwHGGLqi+wTcdMZal2iXkdsrno1Ek/nGMCdA7IVs7l5k7fEpG
+-----END RSA PRIVATE KEY-----
diff --git a/examples/webenginewidgets/clientcertificate/resources/server.pem b/examples/webenginewidgets/clientcertificate/resources/server.pem
new file mode 100644
index 000000000..4706fa73e
--- /dev/null
+++ b/examples/webenginewidgets/clientcertificate/resources/server.pem
@@ -0,0 +1,22 @@
+-----BEGIN CERTIFICATE-----
+MIIDrzCCApcCFFNQAgGBu5nr81tUMdXXLGkm8Li/MA0GCSqGSIb3DQEBCwUAMIGU
+MQswCQYDVQQGEwJERTEPMA0GA1UECAwGQmVybGluMQ8wDQYDVQQHDAZCZXJsaW4x
+FzAVBgNVBAoMDlRoZSBRdCBDb21wYW55MRQwEgYDVQQLDAtRdFdlYkVuZ2luZTES
+MBAGA1UEAwwJd3d3LnF0LmlvMSAwHgYJKoZIhvcNAQkBFhFxdHdlYmVuZ2luZUBx
+dC5pbzAeFw0yMjExMTYxMjExMTRaFw0zMjExMTMxMjExMTRaMIGSMQswCQYDVQQG
+EwJERTEPMA0GA1UECAwGQmVybGluMQ8wDQYDVQQHDAZCZXJsaW4xFzAVBgNVBAoM
+DlRoZSBRdCBDb21wYW55MRQwEgYDVQQLDAtRdFdlYkVuZ2luZTEVMBMGA1UEAwwM
+c2VydmVyLnF0LmlvMRswGQYJKoZIhvcNAQkBFgxzZXJ2ZXJAcXQuaW8wggEiMA0G
+CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDmBCgmvJ6eOa/PLhFuod01ccrwaT/w
+u2jVLBPz5ZuHkTJhFO2EV2KhPUlhwh7dczA6bHdOMANjWMBcA995FyNOQxydnAXv
+oBdQrZeoEA2FobXCOyJvshIZT9Tn8lqubaLBAnnOMqw2bylliqmYqxgBUUwSu19y
+l0t1KnoEbnhKtsi1xeFYd+xSzly5USL2cJ66AuQPOg8uWP9N6i4pY53OHK8teQ+8
++YPj+EPR1QtNekINmF/vcC5AFZMaxZ5SclCJCENHC5daEZFfyoUlDivNjyshtoqG
+B74FDoEv6mKPa7Mco1CPXZksVmAuKEsMmiAanTzL1R3pG7/dYagWRjfzAgMBAAEw
+DQYJKoZIhvcNAQELBQADggEBAHotgaBbqIlG4EqjzSpX8kQnZnGJUsA51dbY3K5C
+4tNCd+JquQfPmCIKDHkRsmmEU6pcU+LT8m+toJ8Gx0XG4nrdUIDt0Nlf/QrykbPj
+hN8z+aSfP9J5tg4NsT7qMWmqUHOa3BcsgWcC4IwWVkbOMz/XbczEQqdBJMbE0+PC
+32ihTKPZBPC2QlIvXyuwupvQtcXgEjw1r2FQeYcmItk3CKbJPE/Rk4/aXSCo4b0F
+iXPphh8BJPZVvQ2cLpPaGvcse5qjIhF9ODb2HEK3myMwuJVi7teURy8mPlS23Li/
+8gRCNu/stjMlkic7d3dqV0LwaG8+Df1W2wzxsT7IkxN/Z+o=
+-----END CERTIFICATE-----
diff --git a/examples/webenginewidgets/clientcertificate/resources/server.qrc b/examples/webenginewidgets/clientcertificate/resources/server.qrc
new file mode 100644
index 000000000..502afa9cc
--- /dev/null
+++ b/examples/webenginewidgets/clientcertificate/resources/server.qrc
@@ -0,0 +1,7 @@
+<RCC>
+ <qresource prefix="/resources">
+ <file>server.key</file>
+ <file>server.pem</file>
+ <file>ca.pem</file>
+ </qresource>
+</RCC>
diff --git a/examples/webenginewidgets/clientcertificate/server.cpp b/examples/webenginewidgets/clientcertificate/server.cpp
new file mode 100644
index 000000000..ee83dab8a
--- /dev/null
+++ b/examples/webenginewidgets/clientcertificate/server.cpp
@@ -0,0 +1,99 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include <QtCore/qcoreapplication.h>
+#include <QtCore/qfile.h>
+#include <QtCore/qpointer.h>
+#include <QtCore/qtimer.h>
+#include <QtNetwork/qsslconfiguration.h>
+#include <QtNetwork/qsslkey.h>
+#include <QtNetwork/qsslserver.h>
+
+struct Request : public QObject
+{
+ QByteArray m_data;
+};
+
+static const QByteArray http_ok(QByteArrayLiteral(
+ "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\nConnection: close\r\n\r\n"));
+static const QByteArray html_start(QByteArrayLiteral("<html><style>"
+ "div {"
+ "height: 400px;"
+ "width: 200px;"
+ "position: fixed;"
+ "top: 50%;"
+ "left: 50%;"
+ "margin-top: -100px;"
+ "margin-left: -200px;"
+ "}</style><body><div>"));
+static const QByteArray html_end(QByteArrayLiteral("</div></body></html>"));
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication::setOrganizationName("QtExamples");
+ QCoreApplication app(argc, argv);
+
+ QSslServer server;
+ QSslConfiguration configuration(QSslConfiguration::defaultConfiguration());
+ configuration.setPeerVerifyMode(QSslSocket::VerifyPeer);
+
+ QFile keyFile(":/resources/server.key");
+ keyFile.open(QIODevice::ReadOnly);
+
+ QSslKey key(keyFile.readAll(), QSsl::Rsa, QSsl::Pem, QSsl::PrivateKey);
+ configuration.setPrivateKey(key);
+
+ QList<QSslCertificate> localCerts = QSslCertificate::fromPath(":/resources/server.pem");
+ configuration.setLocalCertificateChain(localCerts);
+
+ QList<QSslCertificate> caCerts = QSslCertificate::fromPath(":resources/ca.pem");
+ configuration.addCaCertificates(caCerts);
+
+ server.setSslConfiguration(configuration);
+
+ if (!server.listen(QHostAddress::LocalHost, 5555))
+ qFatal("Could not start server on localhost:5555");
+ else
+ qInfo("Server started on localhost:5555");
+
+ QObject::connect(&server, &QTcpServer::pendingConnectionAvailable, [&server]() {
+ QTcpSocket *socket = server.nextPendingConnection();
+ Q_ASSERT(socket);
+
+ QPointer<Request> request(new Request);
+
+ QObject::connect(socket, &QAbstractSocket::disconnected, socket,
+ [socket, request]() mutable {
+ delete request;
+ socket->deleteLater();
+ });
+
+ QObject::connect(socket, &QTcpSocket::readyRead, socket, [socket, request]() mutable {
+ request->m_data.append(socket->readAll());
+
+ if (!request->m_data.endsWith("\r\n\r\n"))
+ return;
+
+ socket->write(http_ok);
+ socket->write(html_start);
+
+ if (request->m_data.startsWith("GET / ")) {
+ socket->write("<p>ACCESS GRANTED !</p>");
+ socket->write("<p>You reached the place, where no one has gone before.</p>");
+ socket->write("<button onclick=\"window.location.href='/exit'\">Exit</button>");
+ } else if (request->m_data.startsWith("GET /exit ")) {
+ socket->write("<p>BYE !</p>");
+ socket->write("<p>Have good day ...</p>");
+ QTimer::singleShot(0, &QCoreApplication::quit);
+ } else {
+ socket->write("<p>There is nothing to see here.</p>");
+ }
+
+ socket->write(html_end);
+ delete request;
+ socket->disconnectFromHost();
+ });
+ });
+
+ return app.exec();
+}
diff --git a/examples/webenginewidgets/clientcertificate/server.pro b/examples/webenginewidgets/clientcertificate/server.pro
new file mode 100644
index 000000000..b8fda1717
--- /dev/null
+++ b/examples/webenginewidgets/clientcertificate/server.pro
@@ -0,0 +1,11 @@
+TEMPLATE = app
+
+QT += core network
+CONFIG += console
+
+SOURCES += server.cpp
+
+RESOURCES += resources/server.qrc
+
+target.path = $$[QT_INSTALL_EXAMPLES]/clientcertificate/server
+INSTALLS += target
diff --git a/examples/webenginewidgets/contentmanipulation/CMakeLists.txt b/examples/webenginewidgets/contentmanipulation/CMakeLists.txt
new file mode 100644
index 000000000..f0b9e9638
--- /dev/null
+++ b/examples/webenginewidgets/contentmanipulation/CMakeLists.txt
@@ -0,0 +1,49 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+project(contentmanipulation LANGUAGES CXX)
+
+set(CMAKE_AUTOMOC ON)
+
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webenginewidgets/contentmanipulation")
+
+find_package(Qt6 REQUIRED COMPONENTS Core Gui WebEngineWidgets)
+
+qt_add_executable(contentmanipulation
+ main.cpp
+ mainwindow.cpp mainwindow.h
+)
+
+set_target_properties(contentmanipulation PROPERTIES
+ WIN32_EXECUTABLE TRUE
+ MACOSX_BUNDLE TRUE
+)
+
+target_link_libraries(contentmanipulation PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::WebEngineWidgets
+)
+
+# Resources:
+set(jquery_resource_files
+ "jquery.min.js"
+)
+
+qt_add_resources(contentmanipulation "jquery"
+ PREFIX
+ "/"
+ FILES
+ ${jquery_resource_files}
+)
+
+install(TARGETS contentmanipulation
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/webenginewidgets/contentmanipulation/doc/src/contentmanipulation.qdoc b/examples/webenginewidgets/contentmanipulation/doc/src/contentmanipulation.qdoc
index 66a1252dc..ae91affe5 100644
--- a/examples/webenginewidgets/contentmanipulation/doc/src/contentmanipulation.qdoc
+++ b/examples/webenginewidgets/contentmanipulation/doc/src/contentmanipulation.qdoc
@@ -1,32 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\example webenginewidgets/contentmanipulation
+ \examplecategory {Web Technologies}
\title WebEngine Content Manipulation Example
\ingroup webengine-widgetexamples
\brief Demonstrates how to load and manipulate web content.
diff --git a/examples/webenginewidgets/contentmanipulation/main.cpp b/examples/webenginewidgets/contentmanipulation/main.cpp
index 417b87184..d096a71b2 100644
--- a/examples/webenginewidgets/contentmanipulation/main.cpp
+++ b/examples/webenginewidgets/contentmanipulation/main.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include <QtWidgets>
#include "mainwindow.h"
@@ -55,7 +8,6 @@
int main(int argc, char * argv[])
{
QCoreApplication::setOrganizationName("QtExamples");
- QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication app(argc, argv);
QUrl url;
diff --git a/examples/webenginewidgets/contentmanipulation/mainwindow.cpp b/examples/webenginewidgets/contentmanipulation/mainwindow.cpp
index 154a37747..3990be2b8 100644
--- a/examples/webenginewidgets/contentmanipulation/mainwindow.cpp
+++ b/examples/webenginewidgets/contentmanipulation/mainwindow.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include <QtWidgets>
#include <QtWebEngineWidgets>
diff --git a/examples/webenginewidgets/contentmanipulation/mainwindow.h b/examples/webenginewidgets/contentmanipulation/mainwindow.h
index 66512f969..c50fccacb 100644
--- a/examples/webenginewidgets/contentmanipulation/mainwindow.h
+++ b/examples/webenginewidgets/contentmanipulation/mainwindow.h
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include <QtWidgets>
diff --git a/examples/webenginewidgets/cookiebrowser/3rdparty/qt_attribution.json b/examples/webenginewidgets/cookiebrowser/3rdparty/qt_attribution.json
index 91a0899c6..35d9cf0d7 100644
--- a/examples/webenginewidgets/cookiebrowser/3rdparty/qt_attribution.json
+++ b/examples/webenginewidgets/cookiebrowser/3rdparty/qt_attribution.json
@@ -9,16 +9,16 @@
"Homepage": "http://tango.freedesktop.org/Tango_Icon_Library",
"Version": "0.8.90",
"DownloadLocation": "http://tango.freedesktop.org/releases/tango-icon-theme-0.8.90.tar.gz",
- "LicenseId": "DocumentRef-PublicDomain",
+ "LicenseId": "urn:dje:license:public-domain",
"License": "Public Domain",
"LicenseFile": "COPYING",
- "Copyright": "Ulisse Perusin <uli.peru@gmail.com>
-Steven Garrity <sgarrity@silverorange.com>
-Lapo Calamandrei <calamandrei@gmail.com>
-Ryan Collier <rcollier@novell.com>
-Rodney Dawes <dobey@novell.com>
-Andreas Nilsson <nisses.mail@home.se>
-Tuomas Kuosmanen <tigert@tigert.com>
-Garrett LeSage <garrett@novell.com>
-Jakub Steiner <jimmac@novell.com>"
+ "Copyright": ["Ulisse Perusin <uli.peru@gmail.com>",
+ "Steven Garrity <sgarrity@silverorange.com>",
+ "Lapo Calamandrei <calamandrei@gmail.com>",
+ "Ryan Collier <rcollier@novell.com>",
+ "Rodney Dawes <dobey@novell.com>",
+ "Andreas Nilsson <nisses.mail@home.se>",
+ "Tuomas Kuosmanen <tigert@tigert.com>",
+ "Garrett LeSage <garrett@novell.com>",
+ "Jakub Steiner <jimmac@novell.com>"]
}
diff --git a/examples/webenginewidgets/cookiebrowser/CMakeLists.txt b/examples/webenginewidgets/cookiebrowser/CMakeLists.txt
new file mode 100644
index 000000000..828fb95e8
--- /dev/null
+++ b/examples/webenginewidgets/cookiebrowser/CMakeLists.txt
@@ -0,0 +1,54 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+project(cookiebrowser LANGUAGES CXX)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTOUIC ON)
+
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webenginewidgets/cookiebrowser")
+
+find_package(Qt6 REQUIRED COMPONENTS Core Gui WebEngineWidgets)
+
+qt_add_executable(cookiebrowser
+ cookiedialog.ui
+ cookiewidget.ui
+ main.cpp
+ mainwindow.cpp mainwindow.h mainwindow.ui
+)
+
+set_target_properties(cookiebrowser PROPERTIES
+ WIN32_EXECUTABLE TRUE
+ MACOSX_BUNDLE TRUE
+)
+
+target_link_libraries(cookiebrowser PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::WebEngineWidgets
+)
+
+# Resources:
+set(cookiebrowser_resource_files
+ "3rdparty/view-refresh.png"
+)
+
+qt_add_resources(cookiebrowser "cookiebrowser"
+ PREFIX
+ "/"
+ BASE
+ "3rdparty"
+ FILES
+ ${cookiebrowser_resource_files}
+)
+
+install(TARGETS cookiebrowser
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/webenginewidgets/cookiebrowser/doc/src/cookiebrowser.qdoc b/examples/webenginewidgets/cookiebrowser/doc/src/cookiebrowser.qdoc
index 316e11a9b..adc302779 100644
--- a/examples/webenginewidgets/cookiebrowser/doc/src/cookiebrowser.qdoc
+++ b/examples/webenginewidgets/cookiebrowser/doc/src/cookiebrowser.qdoc
@@ -1,32 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\example webenginewidgets/cookiebrowser
+ \examplecategory {Web Technologies}
\title WebEngine Cookie Browser Example
\ingroup webengine-widgetexamples
\brief A cookie browser based on \QWE Widgets.
diff --git a/examples/webenginewidgets/cookiebrowser/main.cpp b/examples/webenginewidgets/cookiebrowser/main.cpp
index 2a7fe6362..5722b69a4 100644
--- a/examples/webenginewidgets/cookiebrowser/main.cpp
+++ b/examples/webenginewidgets/cookiebrowser/main.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "mainwindow.h"
#include <QApplication>
@@ -55,7 +8,6 @@
int main(int argc, char *argv[])
{
QCoreApplication::setOrganizationName("QtExamples");
- QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication app(argc, argv);
MainWindow window(QUrl("http://qt.io"));
window.resize(1024, 768);
diff --git a/examples/webenginewidgets/cookiebrowser/mainwindow.cpp b/examples/webenginewidgets/cookiebrowser/mainwindow.cpp
index 970381d4d..67454a9f1 100644
--- a/examples/webenginewidgets/cookiebrowser/mainwindow.cpp
+++ b/examples/webenginewidgets/cookiebrowser/mainwindow.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "mainwindow.h"
#include <QWebEngineCookieStore>
@@ -87,7 +40,7 @@ QNetworkCookie CookieDialog::cookie()
cookie.setDomain(m_domainLineEdit->text());
cookie.setName(m_nameLineEdit->text().toLatin1());
cookie.setValue(m_valueLineEdit->text().toLatin1());
- cookie.setExpirationDate(QDateTime(m_dateEdit->date()));
+ cookie.setExpirationDate(QDateTime(m_dateEdit->date(), QTime::currentTime()));
cookie.setPath(m_pathLineEdit->text());
cookie.setSecure(m_isSecureComboBox->currentText() == tr("yes"));
cookie.setHttpOnly(m_isHttpOnlyComboBox->currentText() == tr("yes"));
@@ -106,8 +59,9 @@ CookieWidget::CookieWidget(const QNetworkCookie &cookie, QWidget *parent): QWidg
void CookieWidget::setHighlighted(bool enabled)
{
+ m_isHighlighted = enabled;
QPalette p = palette();
- p.setColor(backgroundRole(), enabled ? QColor(0xF0, 0xF8, 0xFF) : Qt::white);
+ p.setColor(backgroundRole(), enabled ? p.alternateBase().color() : p.base().color());
setPalette(p);
}
@@ -159,9 +113,18 @@ void MainWindow::handleCookieAdded(const QNetworkCookie &cookie)
return;
CookieWidget *widget = new CookieWidget(cookie);
- widget->setHighlighted(m_cookies.count() % 2);
m_cookies.append(cookie);
- m_layout->insertWidget(0,widget);
+ // Check whether the first widget in the layout is highlighted.
+ // if it is highlighted, then do not highlight the new item.
+ CookieWidget *firstWidget = m_layout->count()
+ ? qobject_cast<CookieWidget *>(m_layout->itemAt(0)->widget())
+ : nullptr;
+ if (firstWidget) {
+ widget->setHighlighted(!firstWidget->isHighlighted());
+ } else {
+ widget->setHighlighted(false);
+ }
+ m_layout->insertWidget(0, widget);
connect(widget, &CookieWidget::deleteClicked, [this, cookie, widget]() {
m_store->deleteCookie(cookie);
diff --git a/examples/webenginewidgets/cookiebrowser/mainwindow.h b/examples/webenginewidgets/cookiebrowser/mainwindow.h
index 643ff9322..da0d438ca 100644
--- a/examples/webenginewidgets/cookiebrowser/mainwindow.h
+++ b/examples/webenginewidgets/cookiebrowser/mainwindow.h
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
@@ -76,9 +29,13 @@ class CookieWidget : public QWidget, public Ui_CookieWidget
public:
CookieWidget(const QNetworkCookie &cookie, QWidget *parent = nullptr);
void setHighlighted(bool enabled);
+ bool isHighlighted() { return m_isHighlighted; }
signals:
void deleteClicked();
void viewClicked();
+
+private:
+ bool m_isHighlighted = false;
};
class MainWindow : public QMainWindow, public Ui_MainWindow
@@ -98,7 +55,7 @@ private slots:
private:
QWebEngineCookieStore *m_store;
- QVector<QNetworkCookie> m_cookies;
+ QList<QNetworkCookie> m_cookies;
QVBoxLayout *m_layout;
};
diff --git a/examples/webenginewidgets/html2pdf/CMakeLists.txt b/examples/webenginewidgets/html2pdf/CMakeLists.txt
new file mode 100644
index 000000000..0386d3d83
--- /dev/null
+++ b/examples/webenginewidgets/html2pdf/CMakeLists.txt
@@ -0,0 +1,36 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+project(html2pdf LANGUAGES CXX)
+
+set(CMAKE_AUTOMOC ON)
+
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webenginewidgets/html2pdf")
+
+find_package(Qt6 REQUIRED COMPONENTS Core Gui WebEngineWidgets)
+
+qt_add_executable(html2pdf
+ html2pdf.cpp
+)
+
+set_target_properties(html2pdf PROPERTIES
+ WIN32_EXECUTABLE TRUE
+ MACOSX_BUNDLE TRUE
+)
+
+target_link_libraries(html2pdf PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::WebEngineWidgets
+)
+
+install(TARGETS html2pdf
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/webenginewidgets/html2pdf/doc/src/html2pdf.qdoc b/examples/webenginewidgets/html2pdf/doc/src/html2pdf.qdoc
index 37fe3eb50..7199a812c 100644
--- a/examples/webenginewidgets/html2pdf/doc/src/html2pdf.qdoc
+++ b/examples/webenginewidgets/html2pdf/doc/src/html2pdf.qdoc
@@ -1,32 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\example webenginewidgets/html2pdf
+ \examplecategory {Web Technologies}
\title WebEngine Widgets Html2Pdf Example
\ingroup webengine-widgetexamples
\brief Converts web pages to PDF documents using \QWE.
@@ -43,9 +20,9 @@
In order to convert a web page into a PDF document we need to:
\list 1
- \li Create a \l QWebEnginePage.
- \li Tell the \l QWebEnginePage to begin loading the target URL and wait for it to finish.
- \li Tell the \l QWebEnginePage to begin converting the loaded page into a PDF file and again wait for it to finish.
+ \li Create a \l QWebEngineView.
+ \li Tell the \l QWebEngineView to begin loading the target URL and wait for it to finish.
+ \li Tell the \l QWebEngineView to begin converting the loaded page into a PDF file and again wait for it to finish.
\li Once the conversion is finished, exit the program.
\endlist
@@ -56,8 +33,8 @@
\printuntil Html2PdfConverter
\printuntil /^\};/
- In the constructor we create the \l QWebEnginePage and connect to its \l
- QWebEnginePage::loadFinished and \l QWebEnginePage::pdfPrintingFinished
+ In the constructor we create the \l QWebEngineView and connect to its \l
+ QWebEngineView::loadFinished and \l QWebEngineView::pdfPrintingFinished
signals:
\skipto Html2PdfConverter::Html2PdfConverter
diff --git a/examples/webenginewidgets/html2pdf/html2pdf.cpp b/examples/webenginewidgets/html2pdf/html2pdf.cpp
index e9fc69534..1c9e5f607 100644
--- a/examples/webenginewidgets/html2pdf/html2pdf.cpp
+++ b/examples/webenginewidgets/html2pdf/html2pdf.cpp
@@ -1,63 +1,14 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include <QApplication>
#include <QCommandLineParser>
#include <QFile>
#include <QTextStream>
-#include <QWebEnginePage>
+#include <QWebEngineView>
#include <functional>
-
-using namespace std;
-using namespace std::placeholders;
+#include <utility>
class Html2PdfConverter : public QObject
{
@@ -73,23 +24,23 @@ private slots:
private:
QString m_inputPath;
QString m_outputPath;
- QScopedPointer<QWebEnginePage> m_page;
+ QScopedPointer<QWebEngineView> m_view;
};
Html2PdfConverter::Html2PdfConverter(QString inputPath, QString outputPath)
- : m_inputPath(move(inputPath))
- , m_outputPath(move(outputPath))
- , m_page(new QWebEnginePage)
+ : m_inputPath(std::move(inputPath))
+ , m_outputPath(std::move(outputPath))
+ , m_view(new QWebEngineView)
{
- connect(m_page.data(), &QWebEnginePage::loadFinished,
+ connect(m_view.data(), &QWebEngineView::loadFinished,
this, &Html2PdfConverter::loadFinished);
- connect(m_page.data(), &QWebEnginePage::pdfPrintingFinished,
+ connect(m_view.data(), &QWebEngineView::pdfPrintingFinished,
this, &Html2PdfConverter::pdfPrintingFinished);
}
int Html2PdfConverter::run()
{
- m_page->load(QUrl::fromUserInput(m_inputPath));
+ m_view->load(QUrl::fromUserInput(m_inputPath));
return QApplication::exec();
}
@@ -102,7 +53,7 @@ void Html2PdfConverter::loadFinished(bool ok)
return;
}
- m_page->printToPdf(m_outputPath);
+ m_view->printToPdf(m_outputPath);
}
void Html2PdfConverter::pdfPrintingFinished(const QString &filePath, bool success)
diff --git a/examples/webenginewidgets/maps/CMakeLists.txt b/examples/webenginewidgets/maps/CMakeLists.txt
new file mode 100644
index 000000000..93d9634f8
--- /dev/null
+++ b/examples/webenginewidgets/maps/CMakeLists.txt
@@ -0,0 +1,56 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+project(maps LANGUAGES CXX)
+
+set(CMAKE_AUTOMOC ON)
+
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webenginewidgets/maps")
+
+find_package(Qt6 REQUIRED COMPONENTS Core Gui WebEngineWidgets)
+
+qt_add_executable(maps
+ main.cpp
+ mainwindow.cpp mainwindow.h
+)
+
+set_target_properties(maps PROPERTIES
+ WIN32_EXECUTABLE TRUE
+ MACOSX_BUNDLE TRUE
+ MACOSX_BUNDLE_GUI_IDENTIFIER "io.qt.examples.webenginewidgets.maps"
+)
+
+target_link_libraries(maps PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::WebEngineWidgets
+)
+
+if (APPLE)
+ set_target_properties(maps PROPERTIES
+ MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.cmake.macos.plist"
+ )
+
+ if (NOT CMAKE_GENERATOR STREQUAL "Xcode")
+ # Need to sign application for location permissions to work
+ if(QT_FEATURE_debug_and_release)
+ set(exe_path "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/")
+ else()
+ unset(exe_path)
+ endif()
+ add_custom_command(TARGET maps
+ POST_BUILD COMMAND codesign --force -s - ${exe_path}maps.app
+ )
+ endif()
+endif()
+
+install(TARGETS maps
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/webenginewidgets/maps/Info.cmake.macos.plist b/examples/webenginewidgets/maps/Info.cmake.macos.plist
new file mode 100644
index 000000000..82336b25a
--- /dev/null
+++ b/examples/webenginewidgets/maps/Info.cmake.macos.plist
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleName</key>
+ <string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
+ <key>CFBundleExecutable</key>
+ <string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
+ <key>CFBundleVersion</key>
+ <string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
+ <key>CFBundleShortVersionString</key>
+ <string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
+ <key>LSMinimumSystemVersion</key>
+ <string>${CMAKE_OSX_DEPLOYMENT_TARGET}</string>
+ <key>NSHumanReadableCopyright</key>
+ <string>${MACOSX_BUNDLE_COPYRIGHT}</string>
+ <key>CFBundleIconFile</key>
+ <string>${MACOSX_BUNDLE_ICON_FILE}</string>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>NSSupportsAutomaticGraphicsSwitching</key>
+ <true/>
+ <key>NSLocationUsageDescription</key>
+ <string>The maps demo would like to access your location for demo purposes.</string>
+
+</dict>
+</plist>
diff --git a/examples/webenginewidgets/maps/doc/src/maps.qdoc b/examples/webenginewidgets/maps/doc/src/maps.qdoc
index 489a5a780..0175f8b65 100644
--- a/examples/webenginewidgets/maps/doc/src/maps.qdoc
+++ b/examples/webenginewidgets/maps/doc/src/maps.qdoc
@@ -1,32 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\example webenginewidgets/maps
+ \examplecategory {Web Technologies}
\title WebEngine Widgets Maps Example
\ingroup webengine-widgetexamples
\brief Demonstrates how to handle geolocation requests.
@@ -38,14 +15,20 @@
The \l {https://www.w3.org/TR/geolocation-API/}{Geolocation API} is a
JavaScript API that web applications can use to determine the user's
- physical location to show on a map, for example. As \QWE relies on
- \l {Qt Location} to power this API a viable location backend is needed for
- the target platform.
+ physical location to show on a map, for example. As \QWE relies on the
+ \e {Qt Positioning} module to power this API, a viable location backend is
+ needed for the target platform.
To avoid accidentally sending location information to third parties
geolocation requests are denied by default. This example demonstrates the
steps an application must take in order to start accepting these requests.
+ \note On Windows 11, enable settings to grant the application access to
+ Windows location services. In the Settings App under
+ \uicontrol {Privacy & Security} > \uicontrol {Location}, enable \uicontrol
+ {Location services}, \uicontrol {Let apps access your location} and \uicontrol
+ {Let desktop apps access your location}.
+
\include examples-run.qdocinc
\section1 The Code
@@ -94,5 +77,5 @@
\printuntil /^\}/
- \sa {html5-geolocation}{Qt WebEngine HTML5 Geolocation}, {Qt Location}
+ \sa {html5-geolocation}{Qt WebEngine HTML5 Geolocation}
*/
diff --git a/examples/webenginewidgets/maps/main.cpp b/examples/webenginewidgets/maps/main.cpp
index cfcfa06d8..550546130 100644
--- a/examples/webenginewidgets/maps/main.cpp
+++ b/examples/webenginewidgets/maps/main.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "mainwindow.h"
#include <QApplication>
@@ -54,7 +7,6 @@
int main(int argc, char *argv[])
{
QCoreApplication::setOrganizationName("QtExamples");
- QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication app(argc, argv);
MainWindow mainWindow;
diff --git a/examples/webenginewidgets/maps/mainwindow.cpp b/examples/webenginewidgets/maps/mainwindow.cpp
index 3098bd72e..0d2b49911 100644
--- a/examples/webenginewidgets/maps/mainwindow.cpp
+++ b/examples/webenginewidgets/maps/mainwindow.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "mainwindow.h"
diff --git a/examples/webenginewidgets/maps/mainwindow.h b/examples/webenginewidgets/maps/mainwindow.h
index 6401c2087..3c8450296 100644
--- a/examples/webenginewidgets/maps/mainwindow.h
+++ b/examples/webenginewidgets/maps/mainwindow.h
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
diff --git a/examples/webenginewidgets/markdowneditor/doc/images/markdowneditor-example.png b/examples/webenginewidgets/markdowneditor/doc/images/markdowneditor-example.png
deleted file mode 100644
index 9f456c4db..000000000
--- a/examples/webenginewidgets/markdowneditor/doc/images/markdowneditor-example.png
+++ /dev/null
Binary files differ
diff --git a/examples/webenginewidgets/markdowneditor/doc/src/markdowneditor.qdoc b/examples/webenginewidgets/markdowneditor/doc/src/markdowneditor.qdoc
deleted file mode 100644
index 9ff8f0615..000000000
--- a/examples/webenginewidgets/markdowneditor/doc/src/markdowneditor.qdoc
+++ /dev/null
@@ -1,183 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \example webenginewidgets/markdowneditor
- \title WebEngine Markdown Editor Example
- \ingroup webengine-widgetexamples
- \brief Demonstrates how to integrate a web engine in a hybrid desktop
- application.
-
- \image markdowneditor-example.png
-
- \e {Markdown Editor} demonstrates how to use QWebChannel and JavaScript
- libraries to provide a rich text preview tool for a custom markup language.
-
- \l{http://daringfireball.net/projects/markdown/}{Markdown} is a lightweight
- markup language with a plain text formatting syntax.
- Some services, such as \l{http://github.com}{github}, acknowledge the
- format, and render the content as rich text when viewed in a browser.
-
- The Markdown Editor main window is split into an editor and a preview area.
- The editor supports the Markdown syntax and is implemented by using
- QPlainTextEdit. The document is rendered as rich text in the preview area,
- which is implemented by using QWebEngineView. To render the text, the
- Markdown text is converted to HTML format with the help of a JavaScript
- library inside the web engine. The preview is updated from the editor
- through QWebChannel.
-
- \include examples-run.qdocinc
-
- \section1 Exposing Document Text
-
- Because we expose the current Markdown text to be rendered to the web engine
- through QWebChannel, we need to somehow make the current text available
- through the Qt metatype system. This is done by using a dedicated
- \c Document class that exposes the document text as a \c{Q_PROPERTY}:
-
- \quotefromfile webenginewidgets/markdowneditor/document.h
- \skipto class Document
- \printto #endif
-
- The \c Document class wraps a QString to be set on the C++ side with
- the \c setText() method and exposes it at runtime as a \c text property
- with a \c textChanged signal.
-
- We define the \c setText method as follows:
-
- \quotefromfile webenginewidgets/markdowneditor/document.cpp
- \skipto Document::setText
- \printuntil
-
- \section1 Previewing Text
-
- We implement our own \c PreviewPage class that publicly inherits from
- \c QWebEnginePage:
-
- \quotefromfile webenginewidgets/markdowneditor/previewpage.h
- \skipto class PreviewPage
- \printto #endif
-
- We reimplement the virtual \c acceptNavigationRequest method to
- stop the page from navigating away from the current document. Instead,
- we redirect external links to the system browser:
-
- \quotefromfile webenginewidgets/markdowneditor/previewpage.cpp
- \skipto acceptNavigationRequest
- \printuntil
-
- \section1 Creating the Main Window
-
- The \c MainWindow class inherits the QMainWindow class:
-
- \quotefromfile webenginewidgets/markdowneditor/mainwindow.h
- \skipto class MainWindow :
- \printto endif
-
- The class declares private slots that match the actions in the menu,
- as well as the \c isModified() helper method.
-
- The actual layout of the main window is specified in a \c .ui file.
- The widgets and actions are available at runtime in the \c ui member
- variable.
-
- \c m_filePath holds the file path to the currently loaded document.
- \c m_content is an instance of the \c Document class.
-
- The actual setup of the different objects is done in the \c MainWindow
- constructor:
-
- \quotefromfile webenginewidgets/markdowneditor/mainwindow.cpp
- \skipto MainWindow::MainWindow
- \printto PreviewPage
-
- The constructor first calls \c setupUi to construct the widgets and menu
- actions according to the UI file. The text editor font is set to one
- with a fixed character width, and the QWebEngineView widget is told not
- to show a context menu.
-
- \printto connect
-
- Here the constructor makes sure our custom
- \c PreviewPage is used by the QWebEngineView instance in \c{ui->preview}.
-
- \printto ui->preview
-
- Here the \c textChanged signal of the editor is connected to a lambda that
- updates the text in \c m_content. This object is then exposed to the JS side
- by \c QWebChannel under the name \c{content}.
-
- \printto connect
-
- Now we can actually load the \e index.html file from the
- resources. For more information about the file, see
- \l{Creating an Index File}.
-
- \printto defaultTextFile
-
- The menu items are connected to the corresponding member slots. The
- \uicontrol Save item is activated or deactivated depending on whether
- the user has edited the content.
-
- \printuntil }
-
- Finally, we load a default document \e default.md from the resources.
-
- \section1 Creating an Index File
-
- \quotefile webenginewidgets/markdowneditor/resources/index.html
-
- In the \e index.html, we load a custom stylesheet and two JavaScript
- libraries. \l{http://kevinburke.bitbucket.org/markdowncss/}{markdown.css} is
- a markdown-friendly stylesheet created by Kevin Burke.
- \l{https://github.com/chjj/marked}{marked.js} is a markdown parser and
- compiler designed for speed written by Christopher Jeffrey and
- \e qwebchannel.js is part of the \l{QWebChannel} module.
-
- In the \c <body> element we first define a \c placeholder element, and
- make it available as a JavaScript variable. We then define the \c updateText
- helper method that updates the content of \c placeholder with the HTML
- that the JavaScript method \c marked() returns.
-
- Finally, we set up the web channel to access the \c content proxy object
- and make sure that \c updateText() is called whenever \c content.text
- changes.
-
- \section1 Files and Attributions
-
- The example bundles the following code with third-party licenses:
-
- \table
- \row
- \li \l{markdowneditor-marked}{Marked}
- \li MIT License
- \row
- \li \l{markdowneditor-markdowncss}{Markdown.css}
- \li Apache License 2.0
- \endtable
-*/
-
diff --git a/examples/webenginewidgets/markdowneditor/document.cpp b/examples/webenginewidgets/markdowneditor/document.cpp
deleted file mode 100644
index 20e6b6be9..000000000
--- a/examples/webenginewidgets/markdowneditor/document.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "document.h"
-
-void Document::setText(const QString &text)
-{
- if (text == m_text)
- return;
- m_text = text;
- emit textChanged(m_text);
-}
diff --git a/examples/webenginewidgets/markdowneditor/document.h b/examples/webenginewidgets/markdowneditor/document.h
deleted file mode 100644
index 785ce228f..000000000
--- a/examples/webenginewidgets/markdowneditor/document.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef DOCUMENT_H
-#define DOCUMENT_H
-
-#include <QObject>
-#include <QString>
-
-class Document : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(QString text MEMBER m_text NOTIFY textChanged FINAL)
-public:
- explicit Document(QObject *parent = nullptr) : QObject(parent) {}
-
- void setText(const QString &text);
-
-signals:
- void textChanged(const QString &text);
-
-private:
- QString m_text;
-};
-
-#endif // DOCUMENT_H
diff --git a/examples/webenginewidgets/markdowneditor/main.cpp b/examples/webenginewidgets/markdowneditor/main.cpp
deleted file mode 100644
index b7a7905be..000000000
--- a/examples/webenginewidgets/markdowneditor/main.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "document.h"
-#include "mainwindow.h"
-
-#include <QApplication>
-#include <QFile>
-
-int main(int argc, char *argv[])
-{
- QCoreApplication::setOrganizationName("QtExamples");
- QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
- QApplication a(argc, argv);
-
- MainWindow window;
- window.show();
-
- return a.exec();
-}
diff --git a/examples/webenginewidgets/markdowneditor/mainwindow.cpp b/examples/webenginewidgets/markdowneditor/mainwindow.cpp
deleted file mode 100644
index 28d6f5641..000000000
--- a/examples/webenginewidgets/markdowneditor/mainwindow.cpp
+++ /dev/null
@@ -1,189 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "mainwindow.h"
-#include "previewpage.h"
-#include "ui_mainwindow.h"
-
-#include <QFile>
-#include <QFileDialog>
-#include <QFontDatabase>
-#include <QMessageBox>
-#include <QTextStream>
-#include <QWebChannel>
-
-MainWindow::MainWindow(QWidget *parent) :
- QMainWindow(parent),
- ui(new Ui::MainWindow)
-{
- ui->setupUi(this);
- ui->editor->setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont));
- ui->preview->setContextMenuPolicy(Qt::NoContextMenu);
-
- PreviewPage *page = new PreviewPage(this);
- ui->preview->setPage(page);
-
- connect(ui->editor, &QPlainTextEdit::textChanged,
- [this]() { m_content.setText(ui->editor->toPlainText()); });
-
- QWebChannel *channel = new QWebChannel(this);
- channel->registerObject(QStringLiteral("content"), &m_content);
- page->setWebChannel(channel);
-
- ui->preview->setUrl(QUrl("qrc:/index.html"));
-
- connect(ui->actionNew, &QAction::triggered, this, &MainWindow::onFileNew);
- connect(ui->actionOpen, &QAction::triggered, this, &MainWindow::onFileOpen);
- connect(ui->actionSave, &QAction::triggered, this, &MainWindow::onFileSave);
- connect(ui->actionSaveAs, &QAction::triggered, this, &MainWindow::onFileSaveAs);
- connect(ui->actionExit, &QAction::triggered, this, &MainWindow::onExit);
-
- connect(ui->editor->document(), &QTextDocument::modificationChanged,
- ui->actionSave, &QAction::setEnabled);
-
- QFile defaultTextFile(":/default.md");
- defaultTextFile.open(QIODevice::ReadOnly);
- ui->editor->setPlainText(defaultTextFile.readAll());
-}
-
-MainWindow::~MainWindow()
-{
- delete ui;
-}
-
-void MainWindow::openFile(const QString &path)
-{
- QFile f(path);
- if (!f.open(QIODevice::ReadOnly)) {
- QMessageBox::warning(this, windowTitle(),
- tr("Could not open file %1: %2").arg(
- QDir::toNativeSeparators(path), f.errorString()));
- return;
- }
- m_filePath = path;
- ui->editor->setPlainText(f.readAll());
-}
-
-bool MainWindow::isModified() const
-{
- return ui->editor->document()->isModified();
-}
-
-void MainWindow::onFileNew()
-{
- if (isModified()) {
- QMessageBox::StandardButton button = QMessageBox::question(this, windowTitle(),
- tr("You have unsaved changes. Do you want to create a new document anyway?"));
- if (button != QMessageBox::Yes)
- return;
- }
-
- m_filePath.clear();
- ui->editor->setPlainText(tr("## New document"));
- ui->editor->document()->setModified(false);
-}
-
-void MainWindow::onFileOpen()
-{
- if (isModified()) {
- QMessageBox::StandardButton button = QMessageBox::question(this, windowTitle(),
- tr("You have unsaved changes. Do you want to open a new document anyway?"));
- if (button != QMessageBox::Yes)
- return;
- }
-
- QString path = QFileDialog::getOpenFileName(this,
- tr("Open MarkDown File"), "", tr("MarkDown File (*.md)"));
- if (path.isEmpty())
- return;
-
- openFile(path);
-}
-
-void MainWindow::onFileSave()
-{
- if (m_filePath.isEmpty()) {
- onFileSaveAs();
- return;
- }
-
- QFile f(m_filePath);
- if (!f.open(QIODevice::WriteOnly | QIODevice::Text)) {
- QMessageBox::warning(this, windowTitle(),
- tr("Could not write to file %1: %2").arg(
- QDir::toNativeSeparators(m_filePath), f.errorString()));
- return;
- }
- QTextStream str(&f);
- str << ui->editor->toPlainText();
-
- ui->editor->document()->setModified(false);
-}
-
-void MainWindow::onFileSaveAs()
-{
- QString path = QFileDialog::getSaveFileName(this,
- tr("Save MarkDown File"), "", tr("MarkDown File (*.md, *.markdown)"));
- if (path.isEmpty())
- return;
- m_filePath = path;
- onFileSave();
-}
-
-void MainWindow::onExit()
-{
- if (isModified()) {
- QMessageBox::StandardButton button = QMessageBox::question(this, windowTitle(),
- tr("You have unsaved changes. Do you want to exit anyway?"));
- if (button != QMessageBox::Yes)
- return;
- }
- close();
-}
diff --git a/examples/webenginewidgets/markdowneditor/mainwindow.h b/examples/webenginewidgets/markdowneditor/mainwindow.h
deleted file mode 100644
index bb7a7ab01..000000000
--- a/examples/webenginewidgets/markdowneditor/mainwindow.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef MAINWINDOW_H
-#define MAINWINDOW_H
-
-#include "document.h"
-
-#include <QMainWindow>
-#include <QString>
-
-QT_BEGIN_NAMESPACE
-namespace Ui {
-class MainWindow;
-}
-QT_END_NAMESPACE
-
-class MainWindow : public QMainWindow
-{
- Q_OBJECT
-
-public:
- explicit MainWindow(QWidget *parent = nullptr);
- ~MainWindow();
-
- void openFile(const QString &path);
-
-private slots:
- void onFileNew();
- void onFileOpen();
- void onFileSave();
- void onFileSaveAs();
- void onExit();
-
-private:
- bool isModified() const;
-
- Ui::MainWindow *ui;
- QString m_filePath;
- Document m_content;
-};
-
-#endif // MAINWINDOW_H
diff --git a/examples/webenginewidgets/markdowneditor/mainwindow.ui b/examples/webenginewidgets/markdowneditor/mainwindow.ui
deleted file mode 100644
index 36ab352b7..000000000
--- a/examples/webenginewidgets/markdowneditor/mainwindow.ui
+++ /dev/null
@@ -1,115 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>MainWindow</class>
- <widget class="QMainWindow" name="MainWindow">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>800</width>
- <height>600</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>MarkDown Editor</string>
- </property>
- <widget class="QWidget" name="centralwidget">
- <layout class="QHBoxLayout" name="horizontalLayout">
- <item>
- <widget class="QSplitter" name="splitter">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <widget class="QPlainTextEdit" name="editor"/>
- <widget class="QWebEngineView" name="preview" native="true"/>
- </widget>
- </item>
- </layout>
- </widget>
- <widget class="QMenuBar" name="menubar">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>800</width>
- <height>26</height>
- </rect>
- </property>
- <widget class="QMenu" name="menu_File">
- <property name="title">
- <string>&amp;File</string>
- </property>
- <addaction name="actionNew"/>
- <addaction name="actionOpen"/>
- <addaction name="actionSave"/>
- <addaction name="actionSaveAs"/>
- <addaction name="separator"/>
- <addaction name="actionExit"/>
- </widget>
- <addaction name="menu_File"/>
- </widget>
- <widget class="QStatusBar" name="statusbar"/>
- <action name="actionOpen">
- <property name="text">
- <string>&amp;Open...</string>
- </property>
- <property name="toolTip">
- <string>Open document</string>
- </property>
- <property name="shortcut">
- <string>Ctrl+O</string>
- </property>
- </action>
- <action name="actionSave">
- <property name="text">
- <string>&amp;Save</string>
- </property>
- <property name="toolTip">
- <string>Save current document</string>
- </property>
- <property name="shortcut">
- <string>Ctrl+S</string>
- </property>
- </action>
- <action name="actionExit">
- <property name="text">
- <string>E&amp;xit</string>
- </property>
- <property name="toolTip">
- <string>Exit editor</string>
- </property>
- <property name="shortcut">
- <string>Ctrl+Q</string>
- </property>
- </action>
- <action name="actionSaveAs">
- <property name="text">
- <string>Save &amp;As...</string>
- </property>
- <property name="toolTip">
- <string>Save document under different name</string>
- </property>
- </action>
- <action name="actionNew">
- <property name="text">
- <string>&amp;New</string>
- </property>
- <property name="toolTip">
- <string>Create new document</string>
- </property>
- <property name="shortcut">
- <string>Ctrl+N</string>
- </property>
- </action>
- </widget>
- <customwidgets>
- <customwidget>
- <class>QWebEngineView</class>
- <extends>QWidget</extends>
- <header>qwebengineview.h</header>
- <container>1</container>
- </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>
diff --git a/examples/webenginewidgets/markdowneditor/markdowneditor.pro b/examples/webenginewidgets/markdowneditor/markdowneditor.pro
deleted file mode 100644
index 099edf4b5..000000000
--- a/examples/webenginewidgets/markdowneditor/markdowneditor.pro
+++ /dev/null
@@ -1,32 +0,0 @@
-TEMPLATE = app
-
-QT += webenginewidgets webchannel
-
-HEADERS += \
- mainwindow.h \
- previewpage.h \
- document.h
-
-SOURCES = \
- main.cpp \
- mainwindow.cpp \
- previewpage.cpp \
- document.cpp
-
-RESOURCES = \
- resources/markdowneditor.qrc
-
-# Disable Qt Quick compiler because the example doesn't use QML, but more importantly so that
-# the source code of the .js files is not removed from the embedded qrc file.
-CONFIG -= qtquickcompiler
-
-FORMS += \
- mainwindow.ui
-
-DISTFILES += \
- resources/3rdparty/MARKDOWN-LICENSE.txt \
- resources/3rdparty/MARKED-LICENSE.txt
-
-# install
-target.path = $$[QT_INSTALL_EXAMPLES]/webenginewidgets/markdowneditor
-INSTALLS += target
diff --git a/examples/webenginewidgets/markdowneditor/previewpage.cpp b/examples/webenginewidgets/markdowneditor/previewpage.cpp
deleted file mode 100644
index 1d81d700c..000000000
--- a/examples/webenginewidgets/markdowneditor/previewpage.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "previewpage.h"
-
-#include <QDesktopServices>
-
-bool PreviewPage::acceptNavigationRequest(const QUrl &url,
- QWebEnginePage::NavigationType /*type*/,
- bool /*isMainFrame*/)
-{
- // Only allow qrc:/index.html.
- if (url.scheme() == QString("qrc"))
- return true;
- QDesktopServices::openUrl(url);
- return false;
-}
diff --git a/examples/webenginewidgets/markdowneditor/previewpage.h b/examples/webenginewidgets/markdowneditor/previewpage.h
deleted file mode 100644
index eb7d7ab00..000000000
--- a/examples/webenginewidgets/markdowneditor/previewpage.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef PREVIEWPAGE_H
-#define PREVIEWPAGE_H
-
-#include <QWebEnginePage>
-
-class PreviewPage : public QWebEnginePage
-{
- Q_OBJECT
-public:
- explicit PreviewPage(QObject *parent = nullptr) : QWebEnginePage(parent) {}
-
-protected:
- bool acceptNavigationRequest(const QUrl &url, NavigationType type, bool isMainFrame);
-};
-
-#endif // PREVIEWPAGE_H
diff --git a/examples/webenginewidgets/markdowneditor/resources/3rdparty/MARKDOWN-LICENSE.txt b/examples/webenginewidgets/markdowneditor/resources/3rdparty/MARKDOWN-LICENSE.txt
deleted file mode 100644
index 23c52cc43..000000000
--- a/examples/webenginewidgets/markdowneditor/resources/3rdparty/MARKDOWN-LICENSE.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-Copyright 2011 Kevin Burke unless otherwise noted.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-Some content is copyrighted by Twitter, Inc., and also released under an
-Apache License; these sections are noted in the source.
diff --git a/examples/webenginewidgets/markdowneditor/resources/3rdparty/MARKED-LICENSE.txt b/examples/webenginewidgets/markdowneditor/resources/3rdparty/MARKED-LICENSE.txt
deleted file mode 100644
index 8e3ba0e0a..000000000
--- a/examples/webenginewidgets/markdowneditor/resources/3rdparty/MARKED-LICENSE.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (c) 2011-2018, Christopher Jeffrey (https://github.com/chjj/)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/examples/webenginewidgets/markdowneditor/resources/3rdparty/markdown.css b/examples/webenginewidgets/markdowneditor/resources/3rdparty/markdown.css
deleted file mode 100644
index 24fc2ffe2..000000000
--- a/examples/webenginewidgets/markdowneditor/resources/3rdparty/markdown.css
+++ /dev/null
@@ -1,260 +0,0 @@
-body{
- margin: 0 auto;
- font-family: Georgia, Palatino, serif;
- color: #444444;
- line-height: 1;
- max-width: 960px;
- padding: 30px;
-}
-h1, h2, h3, h4 {
- color: #111111;
- font-weight: 400;
-}
-h1, h2, h3, h4, h5, p {
- margin-bottom: 24px;
- padding: 0;
-}
-h1 {
- font-size: 48px;
-}
-h2 {
- font-size: 36px;
- /* The bottom margin is small. It's designed to be used with gray meta text
- * below a post title. */
- margin: 24px 0 6px;
-}
-h3 {
- font-size: 24px;
-}
-h4 {
- font-size: 21px;
-}
-h5 {
- font-size: 18px;
-}
-a {
- color: #0099ff;
- margin: 0;
- padding: 0;
- vertical-align: baseline;
-}
-a:hover {
- text-decoration: none;
- color: #ff6600;
-}
-a:visited {
- color: purple;
-}
-ul, ol {
- padding: 0;
- margin: 0;
-}
-li {
- line-height: 24px;
-}
-li ul, li ul {
- margin-left: 24px;
-}
-p, ul, ol {
- font-size: 16px;
- line-height: 24px;
- max-width: 540px;
-}
-pre {
- padding: 0px 24px;
- max-width: 800px;
- white-space: pre-wrap;
-}
-code {
- font-family: Consolas, Monaco, Andale Mono, monospace;
- line-height: 1.5;
- font-size: 13px;
-}
-aside {
- display: block;
- float: right;
- width: 390px;
-}
-blockquote {
- border-left:.5em solid #eee;
- padding: 0 2em;
- margin-left:0;
- max-width: 476px;
-}
-blockquote cite {
- font-size:14px;
- line-height:20px;
- color:#bfbfbf;
-}
-blockquote cite:before {
- content: '\2014 \00A0';
-}
-
-blockquote p {
- color: #666;
- max-width: 460px;
-}
-hr {
- width: 540px;
- text-align: left;
- margin: 0 auto 0 0;
- color: #999;
-}
-
-/* Code below this line is copyright Twitter Inc. */
-
-button,
-input,
-select,
-textarea {
- font-size: 100%;
- margin: 0;
- vertical-align: baseline;
- *vertical-align: middle;
-}
-button, input {
- line-height: normal;
- *overflow: visible;
-}
-button::-moz-focus-inner, input::-moz-focus-inner {
- border: 0;
- padding: 0;
-}
-button,
-input[type="button"],
-input[type="reset"],
-input[type="submit"] {
- cursor: pointer;
- -webkit-appearance: button;
-}
-input[type=checkbox], input[type=radio] {
- cursor: pointer;
-}
-/* override default chrome & firefox settings */
-input:not([type="image"]), textarea {
- -webkit-box-sizing: content-box;
- -moz-box-sizing: content-box;
- box-sizing: content-box;
-}
-
-input[type="search"] {
- -webkit-appearance: textfield;
- -webkit-box-sizing: content-box;
- -moz-box-sizing: content-box;
- box-sizing: content-box;
-}
-input[type="search"]::-webkit-search-decoration {
- -webkit-appearance: none;
-}
-label,
-input,
-select,
-textarea {
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
- font-size: 13px;
- font-weight: normal;
- line-height: normal;
- margin-bottom: 18px;
-}
-input[type=checkbox], input[type=radio] {
- cursor: pointer;
- margin-bottom: 0;
-}
-input[type=text],
-input[type=password],
-textarea,
-select {
- display: inline-block;
- width: 210px;
- padding: 4px;
- font-size: 13px;
- font-weight: normal;
- line-height: 18px;
- height: 18px;
- color: #808080;
- border: 1px solid #ccc;
- -webkit-border-radius: 3px;
- -moz-border-radius: 3px;
- border-radius: 3px;
-}
-select, input[type=file] {
- height: 27px;
- line-height: 27px;
-}
-textarea {
- height: auto;
-}
-
-/* grey out placeholders */
-:-moz-placeholder {
- color: #bfbfbf;
-}
-::-webkit-input-placeholder {
- color: #bfbfbf;
-}
-
-input[type=text],
-input[type=password],
-select,
-textarea {
- -webkit-transition: border linear 0.2s, box-shadow linear 0.2s;
- -moz-transition: border linear 0.2s, box-shadow linear 0.2s;
- transition: border linear 0.2s, box-shadow linear 0.2s;
- -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
- -moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
- box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
-}
-input[type=text]:focus, input[type=password]:focus, textarea:focus {
- outline: none;
- border-color: rgba(82, 168, 236, 0.8);
- -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6);
- -moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6);
- box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6);
-}
-
-/* buttons */
-button {
- display: inline-block;
- padding: 4px 14px;
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
- font-size: 13px;
- line-height: 18px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
- -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
- -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
- background-color: #0064cd;
- background-repeat: repeat-x;
- background-image: -khtml-gradient(linear, left top, left bottom, from(#049cdb), to(#0064cd));
- background-image: -moz-linear-gradient(top, #049cdb, #0064cd);
- background-image: -ms-linear-gradient(top, #049cdb, #0064cd);
- background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #049cdb), color-stop(100%, #0064cd));
- background-image: -webkit-linear-gradient(top, #049cdb, #0064cd);
- background-image: -o-linear-gradient(top, #049cdb, #0064cd);
- background-image: linear-gradient(top, #049cdb, #0064cd);
- color: #fff;
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
- border: 1px solid #004b9a;
- border-bottom-color: #003f81;
- -webkit-transition: 0.1s linear all;
- -moz-transition: 0.1s linear all;
- transition: 0.1s linear all;
- border-color: #0064cd #0064cd #003f81;
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
-}
-button:hover {
- color: #fff;
- background-position: 0 -15px;
- text-decoration: none;
-}
-button:active {
- -webkit-box-shadow: inset 0 3px 7px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
- -moz-box-shadow: inset 0 3px 7px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
- box-shadow: inset 0 3px 7px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
-}
-button::-moz-focus-inner {
- padding: 0;
- border: 0;
-}
diff --git a/examples/webenginewidgets/markdowneditor/resources/3rdparty/marked.js b/examples/webenginewidgets/markdowneditor/resources/3rdparty/marked.js
deleted file mode 100644
index 33c02d9cf..000000000
--- a/examples/webenginewidgets/markdowneditor/resources/3rdparty/marked.js
+++ /dev/null
@@ -1,1514 +0,0 @@
-/**
- * marked - a markdown parser
- * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed)
- * https://github.com/markedjs/marked
- */
-
-;(function(root) {
-'use strict';
-
-/**
- * Block-Level Grammar
- */
-
-var block = {
- newline: /^\n+/,
- code: /^( {4}[^\n]+\n*)+/,
- fences: noop,
- hr: /^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,
- heading: /^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,
- nptable: noop,
- blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,
- list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,
- html: '^ {0,3}(?:' // optional indentation
- + '<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)' // (1)
- + '|comment[^\\n]*(\\n+|$)' // (2)
- + '|<\\?[\\s\\S]*?\\?>\\n*' // (3)
- + '|<![A-Z][\\s\\S]*?>\\n*' // (4)
- + '|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*' // (5)
- + '|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)' // (6)
- + '|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)' // (7) open tag
- + '|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)' // (7) closing tag
- + ')',
- def: /^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,
- table: noop,
- lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,
- paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)*)/,
- text: /^[^\n]+/
-};
-
-block._label = /(?!\s*\])(?:\\[\[\]]|[^\[\]])+/;
-block._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;
-block.def = edit(block.def)
- .replace('label', block._label)
- .replace('title', block._title)
- .getRegex();
-
-block.bullet = /(?:[*+-]|\d+\.)/;
-block.item = /^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;
-block.item = edit(block.item, 'gm')
- .replace(/bull/g, block.bullet)
- .getRegex();
-
-block.list = edit(block.list)
- .replace(/bull/g, block.bullet)
- .replace('hr', '\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))')
- .replace('def', '\\n+(?=' + block.def.source + ')')
- .getRegex();
-
-block._tag = 'address|article|aside|base|basefont|blockquote|body|caption'
- + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'
- + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'
- + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'
- + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr'
- + '|track|ul';
-block._comment = /<!--(?!-?>)[\s\S]*?-->/;
-block.html = edit(block.html, 'i')
- .replace('comment', block._comment)
- .replace('tag', block._tag)
- .replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/)
- .getRegex();
-
-block.paragraph = edit(block.paragraph)
- .replace('hr', block.hr)
- .replace('heading', block.heading)
- .replace('lheading', block.lheading)
- .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks
- .getRegex();
-
-block.blockquote = edit(block.blockquote)
- .replace('paragraph', block.paragraph)
- .getRegex();
-
-/**
- * Normal Block Grammar
- */
-
-block.normal = merge({}, block);
-
-/**
- * GFM Block Grammar
- */
-
-block.gfm = merge({}, block.normal, {
- fences: /^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,
- paragraph: /^/,
- heading: /^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/
-});
-
-block.gfm.paragraph = edit(block.paragraph)
- .replace('(?!', '(?!'
- + block.gfm.fences.source.replace('\\1', '\\2') + '|'
- + block.list.source.replace('\\1', '\\3') + '|')
- .getRegex();
-
-/**
- * GFM + Tables Block Grammar
- */
-
-block.tables = merge({}, block.gfm, {
- nptable: /^ *([^|\n ].*\|.*)\n *([-:]+ *\|[-| :]*)(?:\n((?:.*[^>\n ].*(?:\n|$))*)\n*|$)/,
- table: /^ *\|(.+)\n *\|?( *[-:]+[-| :]*)(?:\n((?: *[^>\n ].*(?:\n|$))*)\n*|$)/
-});
-
-/**
- * Pedantic grammar
- */
-
-block.pedantic = merge({}, block.normal, {
- html: edit(
- '^ *(?:comment *(?:\\n|\\s*$)'
- + '|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)' // closed tag
- + '|<tag(?:"[^"]*"|\'[^\']*\'|\\s[^\'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))')
- .replace('comment', block._comment)
- .replace(/tag/g, '(?!(?:'
- + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'
- + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'
- + '\\b)\\w+(?!:|[^\\w\\s@]*@)\\b')
- .getRegex(),
- def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/
-});
-
-/**
- * Block Lexer
- */
-
-function Lexer(options) {
- this.tokens = [];
- this.tokens.links = {};
- this.options = options || marked.defaults;
- this.rules = block.normal;
-
- if (this.options.pedantic) {
- this.rules = block.pedantic;
- } else if (this.options.gfm) {
- if (this.options.tables) {
- this.rules = block.tables;
- } else {
- this.rules = block.gfm;
- }
- }
-}
-
-/**
- * Expose Block Rules
- */
-
-Lexer.rules = block;
-
-/**
- * Static Lex Method
- */
-
-Lexer.lex = function(src, options) {
- var lexer = new Lexer(options);
- return lexer.lex(src);
-};
-
-/**
- * Preprocessing
- */
-
-Lexer.prototype.lex = function(src) {
- src = src
- .replace(/\r\n|\r/g, '\n')
- .replace(/\t/g, ' ')
- .replace(/\u00a0/g, ' ')
- .replace(/\u2424/g, '\n');
-
- return this.token(src, true);
-};
-
-/**
- * Lexing
- */
-
-Lexer.prototype.token = function(src, top) {
- src = src.replace(/^ +$/gm, '');
- var next,
- loose,
- cap,
- bull,
- b,
- item,
- space,
- i,
- tag,
- l,
- isordered,
- istask,
- ischecked;
-
- while (src) {
- // newline
- if (cap = this.rules.newline.exec(src)) {
- src = src.substring(cap[0].length);
- if (cap[0].length > 1) {
- this.tokens.push({
- type: 'space'
- });
- }
- }
-
- // code
- if (cap = this.rules.code.exec(src)) {
- src = src.substring(cap[0].length);
- cap = cap[0].replace(/^ {4}/gm, '');
- this.tokens.push({
- type: 'code',
- text: !this.options.pedantic
- ? cap.replace(/\n+$/, '')
- : cap
- });
- continue;
- }
-
- // fences (gfm)
- if (cap = this.rules.fences.exec(src)) {
- src = src.substring(cap[0].length);
- this.tokens.push({
- type: 'code',
- lang: cap[2],
- text: cap[3] || ''
- });
- continue;
- }
-
- // heading
- if (cap = this.rules.heading.exec(src)) {
- src = src.substring(cap[0].length);
- this.tokens.push({
- type: 'heading',
- depth: cap[1].length,
- text: cap[2]
- });
- continue;
- }
-
- // table no leading pipe (gfm)
- if (top && (cap = this.rules.nptable.exec(src))) {
- item = {
- type: 'table',
- header: splitCells(cap[1].replace(/^ *| *\| *$/g, '')),
- align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
- cells: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : []
- };
-
- if (item.header.length === item.align.length) {
- src = src.substring(cap[0].length);
-
- for (i = 0; i < item.align.length; i++) {
- if (/^ *-+: *$/.test(item.align[i])) {
- item.align[i] = 'right';
- } else if (/^ *:-+: *$/.test(item.align[i])) {
- item.align[i] = 'center';
- } else if (/^ *:-+ *$/.test(item.align[i])) {
- item.align[i] = 'left';
- } else {
- item.align[i] = null;
- }
- }
-
- for (i = 0; i < item.cells.length; i++) {
- item.cells[i] = splitCells(item.cells[i], item.header.length);
- }
-
- this.tokens.push(item);
-
- continue;
- }
- }
-
- // hr
- if (cap = this.rules.hr.exec(src)) {
- src = src.substring(cap[0].length);
- this.tokens.push({
- type: 'hr'
- });
- continue;
- }
-
- // blockquote
- if (cap = this.rules.blockquote.exec(src)) {
- src = src.substring(cap[0].length);
-
- this.tokens.push({
- type: 'blockquote_start'
- });
-
- cap = cap[0].replace(/^ *> ?/gm, '');
-
- // Pass `top` to keep the current
- // "toplevel" state. This is exactly
- // how markdown.pl works.
- this.token(cap, top);
-
- this.tokens.push({
- type: 'blockquote_end'
- });
-
- continue;
- }
-
- // list
- if (cap = this.rules.list.exec(src)) {
- src = src.substring(cap[0].length);
- bull = cap[2];
- isordered = bull.length > 1;
-
- this.tokens.push({
- type: 'list_start',
- ordered: isordered,
- start: isordered ? +bull : ''
- });
-
- // Get each top-level item.
- cap = cap[0].match(this.rules.item);
-
- next = false;
- l = cap.length;
- i = 0;
-
- for (; i < l; i++) {
- item = cap[i];
-
- // Remove the list item's bullet
- // so it is seen as the next token.
- space = item.length;
- item = item.replace(/^ *([*+-]|\d+\.) +/, '');
-
- // Outdent whatever the
- // list item contains. Hacky.
- if (~item.indexOf('\n ')) {
- space -= item.length;
- item = !this.options.pedantic
- ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '')
- : item.replace(/^ {1,4}/gm, '');
- }
-
- // Determine whether the next list item belongs here.
- // Backpedal if it does not belong in this list.
- if (this.options.smartLists && i !== l - 1) {
- b = block.bullet.exec(cap[i + 1])[0];
- if (bull !== b && !(bull.length > 1 && b.length > 1)) {
- src = cap.slice(i + 1).join('\n') + src;
- i = l - 1;
- }
- }
-
- // Determine whether item is loose or not.
- // Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/
- // for discount behavior.
- loose = next || /\n\n(?!\s*$)/.test(item);
- if (i !== l - 1) {
- next = item.charAt(item.length - 1) === '\n';
- if (!loose) loose = next;
- }
-
- // Check for task list items
- istask = /^\[[ xX]\] /.test(item);
- ischecked = undefined;
- if (istask) {
- ischecked = item[1] !== ' ';
- item = item.replace(/^\[[ xX]\] +/, '');
- }
-
- this.tokens.push({
- type: loose
- ? 'loose_item_start'
- : 'list_item_start',
- task: istask,
- checked: ischecked
- });
-
- // Recurse.
- this.token(item, false);
-
- this.tokens.push({
- type: 'list_item_end'
- });
- }
-
- this.tokens.push({
- type: 'list_end'
- });
-
- continue;
- }
-
- // html
- if (cap = this.rules.html.exec(src)) {
- src = src.substring(cap[0].length);
- this.tokens.push({
- type: this.options.sanitize
- ? 'paragraph'
- : 'html',
- pre: !this.options.sanitizer
- && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'),
- text: cap[0]
- });
- continue;
- }
-
- // def
- if (top && (cap = this.rules.def.exec(src))) {
- src = src.substring(cap[0].length);
- if (cap[3]) cap[3] = cap[3].substring(1, cap[3].length - 1);
- tag = cap[1].toLowerCase().replace(/\s+/g, ' ');
- if (!this.tokens.links[tag]) {
- this.tokens.links[tag] = {
- href: cap[2],
- title: cap[3]
- };
- }
- continue;
- }
-
- // table (gfm)
- if (top && (cap = this.rules.table.exec(src))) {
- item = {
- type: 'table',
- header: splitCells(cap[1].replace(/^ *| *\| *$/g, '')),
- align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
- cells: cap[3] ? cap[3].replace(/(?: *\| *)?\n$/, '').split('\n') : []
- };
-
- if (item.header.length === item.align.length) {
- src = src.substring(cap[0].length);
-
- for (i = 0; i < item.align.length; i++) {
- if (/^ *-+: *$/.test(item.align[i])) {
- item.align[i] = 'right';
- } else if (/^ *:-+: *$/.test(item.align[i])) {
- item.align[i] = 'center';
- } else if (/^ *:-+ *$/.test(item.align[i])) {
- item.align[i] = 'left';
- } else {
- item.align[i] = null;
- }
- }
-
- for (i = 0; i < item.cells.length; i++) {
- item.cells[i] = splitCells(
- item.cells[i].replace(/^ *\| *| *\| *$/g, ''),
- item.header.length);
- }
-
- this.tokens.push(item);
-
- continue;
- }
- }
-
- // lheading
- if (cap = this.rules.lheading.exec(src)) {
- src = src.substring(cap[0].length);
- this.tokens.push({
- type: 'heading',
- depth: cap[2] === '=' ? 1 : 2,
- text: cap[1]
- });
- continue;
- }
-
- // top-level paragraph
- if (top && (cap = this.rules.paragraph.exec(src))) {
- src = src.substring(cap[0].length);
- this.tokens.push({
- type: 'paragraph',
- text: cap[1].charAt(cap[1].length - 1) === '\n'
- ? cap[1].slice(0, -1)
- : cap[1]
- });
- continue;
- }
-
- // text
- if (cap = this.rules.text.exec(src)) {
- // Top-level should never reach here.
- src = src.substring(cap[0].length);
- this.tokens.push({
- type: 'text',
- text: cap[0]
- });
- continue;
- }
-
- if (src) {
- throw new Error('Infinite loop on byte: ' + src.charCodeAt(0));
- }
- }
-
- return this.tokens;
-};
-
-/**
- * Inline-Level Grammar
- */
-
-var inline = {
- escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,
- autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/,
- url: noop,
- tag: '^comment'
- + '|^</[a-zA-Z][\\w:-]*\\s*>' // self-closing tag
- + '|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>' // open tag
- + '|^<\\?[\\s\\S]*?\\?>' // processing instruction, e.g. <?php ?>
- + '|^<![a-zA-Z]+\\s[\\s\\S]*?>' // declaration, e.g. <!DOCTYPE html>
- + '|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>', // CDATA section
- link: /^!?\[(label)\]\(href(?:\s+(title))?\s*\)/,
- reflink: /^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,
- nolink: /^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,
- strong: /^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)|^__([^\s])__(?!_)|^\*\*([^\s])\*\*(?!\*)/,
- em: /^_([^\s][\s\S]*?[^\s_])_(?!_)|^_([^\s_][\s\S]*?[^\s])_(?!_)|^\*([^\s][\s\S]*?[^\s*])\*(?!\*)|^\*([^\s*][\s\S]*?[^\s])\*(?!\*)|^_([^\s_])_(?!_)|^\*([^\s*])\*(?!\*)/,
- code: /^(`+)\s*([\s\S]*?[^`]?)\s*\1(?!`)/,
- br: /^ {2,}\n(?!\s*$)/,
- del: noop,
- text: /^[\s\S]+?(?=[\\<!\[`*]|\b_| {2,}\n|$)/
-};
-
-inline._escapes = /\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;
-
-inline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;
-inline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;
-inline.autolink = edit(inline.autolink)
- .replace('scheme', inline._scheme)
- .replace('email', inline._email)
- .getRegex();
-
-inline._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;
-
-inline.tag = edit(inline.tag)
- .replace('comment', block._comment)
- .replace('attribute', inline._attribute)
- .getRegex();
-
-inline._label = /(?:\[[^\[\]]*\]|\\[\[\]]?|`[^`]*`|[^\[\]\\])*?/;
-inline._href = /\s*(<(?:\\[<>]?|[^\s<>\\])*>|(?:\\[()]?|\([^\s\x00-\x1f()\\]*\)|[^\s\x00-\x1f()\\])*?)/;
-inline._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;
-
-inline.link = edit(inline.link)
- .replace('label', inline._label)
- .replace('href', inline._href)
- .replace('title', inline._title)
- .getRegex();
-
-inline.reflink = edit(inline.reflink)
- .replace('label', inline._label)
- .getRegex();
-
-/**
- * Normal Inline Grammar
- */
-
-inline.normal = merge({}, inline);
-
-/**
- * Pedantic Inline Grammar
- */
-
-inline.pedantic = merge({}, inline.normal, {
- strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,
- em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/,
- link: edit(/^!?\[(label)\]\((.*?)\)/)
- .replace('label', inline._label)
- .getRegex(),
- reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/)
- .replace('label', inline._label)
- .getRegex()
-});
-
-/**
- * GFM Inline Grammar
- */
-
-inline.gfm = merge({}, inline.normal, {
- escape: edit(inline.escape).replace('])', '~|])').getRegex(),
- url: edit(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/)
- .replace('email', inline._email)
- .getRegex(),
- _backpedal: /(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,
- del: /^~~(?=\S)([\s\S]*?\S)~~/,
- text: edit(inline.text)
- .replace(']|', '~]|')
- .replace('|', '|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&\'*+/=?^_`{\\|}~-]+@|')
- .getRegex()
-});
-
-/**
- * GFM + Line Breaks Inline Grammar
- */
-
-inline.breaks = merge({}, inline.gfm, {
- br: edit(inline.br).replace('{2,}', '*').getRegex(),
- text: edit(inline.gfm.text).replace('{2,}', '*').getRegex()
-});
-
-/**
- * Inline Lexer & Compiler
- */
-
-function InlineLexer(links, options) {
- this.options = options || marked.defaults;
- this.links = links;
- this.rules = inline.normal;
- this.renderer = this.options.renderer || new Renderer();
- this.renderer.options = this.options;
-
- if (!this.links) {
- throw new Error('Tokens array requires a `links` property.');
- }
-
- if (this.options.pedantic) {
- this.rules = inline.pedantic;
- } else if (this.options.gfm) {
- if (this.options.breaks) {
- this.rules = inline.breaks;
- } else {
- this.rules = inline.gfm;
- }
- }
-}
-
-/**
- * Expose Inline Rules
- */
-
-InlineLexer.rules = inline;
-
-/**
- * Static Lexing/Compiling Method
- */
-
-InlineLexer.output = function(src, links, options) {
- var inline = new InlineLexer(links, options);
- return inline.output(src);
-};
-
-/**
- * Lexing/Compiling
- */
-
-InlineLexer.prototype.output = function(src) {
- var out = '',
- link,
- text,
- href,
- title,
- cap;
-
- while (src) {
- // escape
- if (cap = this.rules.escape.exec(src)) {
- src = src.substring(cap[0].length);
- out += cap[1];
- continue;
- }
-
- // autolink
- if (cap = this.rules.autolink.exec(src)) {
- src = src.substring(cap[0].length);
- if (cap[2] === '@') {
- text = escape(this.mangle(cap[1]));
- href = 'mailto:' + text;
- } else {
- text = escape(cap[1]);
- href = text;
- }
- out += this.renderer.link(href, null, text);
- continue;
- }
-
- // url (gfm)
- if (!this.inLink && (cap = this.rules.url.exec(src))) {
- cap[0] = this.rules._backpedal.exec(cap[0])[0];
- src = src.substring(cap[0].length);
- if (cap[2] === '@') {
- text = escape(cap[0]);
- href = 'mailto:' + text;
- } else {
- text = escape(cap[0]);
- if (cap[1] === 'www.') {
- href = 'http://' + text;
- } else {
- href = text;
- }
- }
- out += this.renderer.link(href, null, text);
- continue;
- }
-
- // tag
- if (cap = this.rules.tag.exec(src)) {
- if (!this.inLink && /^<a /i.test(cap[0])) {
- this.inLink = true;
- } else if (this.inLink && /^<\/a>/i.test(cap[0])) {
- this.inLink = false;
- }
- src = src.substring(cap[0].length);
- out += this.options.sanitize
- ? this.options.sanitizer
- ? this.options.sanitizer(cap[0])
- : escape(cap[0])
- : cap[0]
- continue;
- }
-
- // link
- if (cap = this.rules.link.exec(src)) {
- src = src.substring(cap[0].length);
- this.inLink = true;
- href = cap[2];
- if (this.options.pedantic) {
- link = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(href);
-
- if (link) {
- href = link[1];
- title = link[3];
- } else {
- title = '';
- }
- } else {
- title = cap[3] ? cap[3].slice(1, -1) : '';
- }
- href = href.trim().replace(/^<([\s\S]*)>$/, '$1');
- out += this.outputLink(cap, {
- href: InlineLexer.escapes(href),
- title: InlineLexer.escapes(title)
- });
- this.inLink = false;
- continue;
- }
-
- // reflink, nolink
- if ((cap = this.rules.reflink.exec(src))
- || (cap = this.rules.nolink.exec(src))) {
- src = src.substring(cap[0].length);
- link = (cap[2] || cap[1]).replace(/\s+/g, ' ');
- link = this.links[link.toLowerCase()];
- if (!link || !link.href) {
- out += cap[0].charAt(0);
- src = cap[0].substring(1) + src;
- continue;
- }
- this.inLink = true;
- out += this.outputLink(cap, link);
- this.inLink = false;
- continue;
- }
-
- // strong
- if (cap = this.rules.strong.exec(src)) {
- src = src.substring(cap[0].length);
- out += this.renderer.strong(this.output(cap[4] || cap[3] || cap[2] || cap[1]));
- continue;
- }
-
- // em
- if (cap = this.rules.em.exec(src)) {
- src = src.substring(cap[0].length);
- out += this.renderer.em(this.output(cap[6] || cap[5] || cap[4] || cap[3] || cap[2] || cap[1]));
- continue;
- }
-
- // code
- if (cap = this.rules.code.exec(src)) {
- src = src.substring(cap[0].length);
- out += this.renderer.codespan(escape(cap[2].trim(), true));
- continue;
- }
-
- // br
- if (cap = this.rules.br.exec(src)) {
- src = src.substring(cap[0].length);
- out += this.renderer.br();
- continue;
- }
-
- // del (gfm)
- if (cap = this.rules.del.exec(src)) {
- src = src.substring(cap[0].length);
- out += this.renderer.del(this.output(cap[1]));
- continue;
- }
-
- // text
- if (cap = this.rules.text.exec(src)) {
- src = src.substring(cap[0].length);
- out += this.renderer.text(escape(this.smartypants(cap[0])));
- continue;
- }
-
- if (src) {
- throw new Error('Infinite loop on byte: ' + src.charCodeAt(0));
- }
- }
-
- return out;
-};
-
-InlineLexer.escapes = function(text) {
- return text ? text.replace(InlineLexer.rules._escapes, '$1') : text;
-}
-
-/**
- * Compile Link
- */
-
-InlineLexer.prototype.outputLink = function(cap, link) {
- var href = link.href,
- title = link.title ? escape(link.title) : null;
-
- return cap[0].charAt(0) !== '!'
- ? this.renderer.link(href, title, this.output(cap[1]))
- : this.renderer.image(href, title, escape(cap[1]));
-};
-
-/**
- * Smartypants Transformations
- */
-
-InlineLexer.prototype.smartypants = function(text) {
- if (!this.options.smartypants) return text;
- return text
- // em-dashes
- .replace(/---/g, '\u2014')
- // en-dashes
- .replace(/--/g, '\u2013')
- // opening singles
- .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018')
- // closing singles & apostrophes
- .replace(/'/g, '\u2019')
- // opening doubles
- .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c')
- // closing doubles
- .replace(/"/g, '\u201d')
- // ellipses
- .replace(/\.{3}/g, '\u2026');
-};
-
-/**
- * Mangle Links
- */
-
-InlineLexer.prototype.mangle = function(text) {
- if (!this.options.mangle) return text;
- var out = '',
- l = text.length,
- i = 0,
- ch;
-
- for (; i < l; i++) {
- ch = text.charCodeAt(i);
- if (Math.random() > 0.5) {
- ch = 'x' + ch.toString(16);
- }
- out += '&#' + ch + ';';
- }
-
- return out;
-};
-
-/**
- * Renderer
- */
-
-function Renderer(options) {
- this.options = options || marked.defaults;
-}
-
-Renderer.prototype.code = function(code, lang, escaped) {
- if (this.options.highlight) {
- var out = this.options.highlight(code, lang);
- if (out != null && out !== code) {
- escaped = true;
- code = out;
- }
- }
-
- if (!lang) {
- return '<pre><code>'
- + (escaped ? code : escape(code, true))
- + '</code></pre>';
- }
-
- return '<pre><code class="'
- + this.options.langPrefix
- + escape(lang, true)
- + '">'
- + (escaped ? code : escape(code, true))
- + '</code></pre>\n';
-};
-
-Renderer.prototype.blockquote = function(quote) {
- return '<blockquote>\n' + quote + '</blockquote>\n';
-};
-
-Renderer.prototype.html = function(html) {
- return html;
-};
-
-Renderer.prototype.heading = function(text, level, raw) {
- if (this.options.headerIds) {
- return '<h'
- + level
- + ' id="'
- + this.options.headerPrefix
- + raw.toLowerCase().replace(/[^\w]+/g, '-')
- + '">'
- + text
- + '</h'
- + level
- + '>\n';
- }
- // ignore IDs
- return '<h' + level + '>' + text + '</h' + level + '>\n';
-};
-
-Renderer.prototype.hr = function() {
- return this.options.xhtml ? '<hr/>\n' : '<hr>\n';
-};
-
-Renderer.prototype.list = function(body, ordered, start) {
- var type = ordered ? 'ol' : 'ul',
- startatt = (ordered && start !== 1) ? (' start="' + start + '"') : '';
- return '<' + type + startatt + '>\n' + body + '</' + type + '>\n';
-};
-
-Renderer.prototype.listitem = function(text) {
- return '<li>' + text + '</li>\n';
-};
-
-Renderer.prototype.checkbox = function(checked) {
- return '<input '
- + (checked ? 'checked="" ' : '')
- + 'disabled="" type="checkbox"'
- + (this.options.xhtml ? ' /' : '')
- + '> ';
-}
-
-Renderer.prototype.paragraph = function(text) {
- return '<p>' + text + '</p>\n';
-};
-
-Renderer.prototype.table = function(header, body) {
- if (body) body = '<tbody>' + body + '</tbody>';
-
- return '<table>\n'
- + '<thead>\n'
- + header
- + '</thead>\n'
- + body
- + '</table>\n';
-};
-
-Renderer.prototype.tablerow = function(content) {
- return '<tr>\n' + content + '</tr>\n';
-};
-
-Renderer.prototype.tablecell = function(content, flags) {
- var type = flags.header ? 'th' : 'td';
- var tag = flags.align
- ? '<' + type + ' align="' + flags.align + '">'
- : '<' + type + '>';
- return tag + content + '</' + type + '>\n';
-};
-
-// span level renderer
-Renderer.prototype.strong = function(text) {
- return '<strong>' + text + '</strong>';
-};
-
-Renderer.prototype.em = function(text) {
- return '<em>' + text + '</em>';
-};
-
-Renderer.prototype.codespan = function(text) {
- return '<code>' + text + '</code>';
-};
-
-Renderer.prototype.br = function() {
- return this.options.xhtml ? '<br/>' : '<br>';
-};
-
-Renderer.prototype.del = function(text) {
- return '<del>' + text + '</del>';
-};
-
-Renderer.prototype.link = function(href, title, text) {
- if (this.options.sanitize) {
- try {
- var prot = decodeURIComponent(unescape(href))
- .replace(/[^\w:]/g, '')
- .toLowerCase();
- } catch (e) {
- return text;
- }
- if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) {
- return text;
- }
- }
- if (this.options.baseUrl && !originIndependentUrl.test(href)) {
- href = resolveUrl(this.options.baseUrl, href);
- }
- try {
- href = encodeURI(href).replace(/%25/g, '%');
- } catch (e) {
- return text;
- }
- var out = '<a href="' + escape(href) + '"';
- if (title) {
- out += ' title="' + title + '"';
- }
- out += '>' + text + '</a>';
- return out;
-};
-
-Renderer.prototype.image = function(href, title, text) {
- if (this.options.baseUrl && !originIndependentUrl.test(href)) {
- href = resolveUrl(this.options.baseUrl, href);
- }
- var out = '<img src="' + href + '" alt="' + text + '"';
- if (title) {
- out += ' title="' + title + '"';
- }
- out += this.options.xhtml ? '/>' : '>';
- return out;
-};
-
-Renderer.prototype.text = function(text) {
- return text;
-};
-
-/**
- * TextRenderer
- * returns only the textual part of the token
- */
-
-function TextRenderer() {}
-
-// no need for block level renderers
-
-TextRenderer.prototype.strong =
-TextRenderer.prototype.em =
-TextRenderer.prototype.codespan =
-TextRenderer.prototype.del =
-TextRenderer.prototype.text = function (text) {
- return text;
-}
-
-TextRenderer.prototype.link =
-TextRenderer.prototype.image = function(href, title, text) {
- return '' + text;
-}
-
-TextRenderer.prototype.br = function() {
- return '';
-}
-
-/**
- * Parsing & Compiling
- */
-
-function Parser(options) {
- this.tokens = [];
- this.token = null;
- this.options = options || marked.defaults;
- this.options.renderer = this.options.renderer || new Renderer();
- this.renderer = this.options.renderer;
- this.renderer.options = this.options;
-}
-
-/**
- * Static Parse Method
- */
-
-Parser.parse = function(src, options) {
- var parser = new Parser(options);
- return parser.parse(src);
-};
-
-/**
- * Parse Loop
- */
-
-Parser.prototype.parse = function(src) {
- this.inline = new InlineLexer(src.links, this.options);
- // use an InlineLexer with a TextRenderer to extract pure text
- this.inlineText = new InlineLexer(
- src.links,
- merge({}, this.options, {renderer: new TextRenderer()})
- );
- this.tokens = src.reverse();
-
- var out = '';
- while (this.next()) {
- out += this.tok();
- }
-
- return out;
-};
-
-/**
- * Next Token
- */
-
-Parser.prototype.next = function() {
- return this.token = this.tokens.pop();
-};
-
-/**
- * Preview Next Token
- */
-
-Parser.prototype.peek = function() {
- return this.tokens[this.tokens.length - 1] || 0;
-};
-
-/**
- * Parse Text Tokens
- */
-
-Parser.prototype.parseText = function() {
- var body = this.token.text;
-
- while (this.peek().type === 'text') {
- body += '\n' + this.next().text;
- }
-
- return this.inline.output(body);
-};
-
-/**
- * Parse Current Token
- */
-
-Parser.prototype.tok = function() {
- switch (this.token.type) {
- case 'space': {
- return '';
- }
- case 'hr': {
- return this.renderer.hr();
- }
- case 'heading': {
- return this.renderer.heading(
- this.inline.output(this.token.text),
- this.token.depth,
- unescape(this.inlineText.output(this.token.text)));
- }
- case 'code': {
- return this.renderer.code(this.token.text,
- this.token.lang,
- this.token.escaped);
- }
- case 'table': {
- var header = '',
- body = '',
- i,
- row,
- cell,
- j;
-
- // header
- cell = '';
- for (i = 0; i < this.token.header.length; i++) {
- cell += this.renderer.tablecell(
- this.inline.output(this.token.header[i]),
- { header: true, align: this.token.align[i] }
- );
- }
- header += this.renderer.tablerow(cell);
-
- for (i = 0; i < this.token.cells.length; i++) {
- row = this.token.cells[i];
-
- cell = '';
- for (j = 0; j < row.length; j++) {
- cell += this.renderer.tablecell(
- this.inline.output(row[j]),
- { header: false, align: this.token.align[j] }
- );
- }
-
- body += this.renderer.tablerow(cell);
- }
- return this.renderer.table(header, body);
- }
- case 'blockquote_start': {
- body = '';
-
- while (this.next().type !== 'blockquote_end') {
- body += this.tok();
- }
-
- return this.renderer.blockquote(body);
- }
- case 'list_start': {
- body = '';
- var ordered = this.token.ordered,
- start = this.token.start;
-
- while (this.next().type !== 'list_end') {
- body += this.tok();
- }
-
- return this.renderer.list(body, ordered, start);
- }
- case 'list_item_start': {
- body = '';
-
- if (this.token.task) {
- body += this.renderer.checkbox(this.token.checked);
- }
-
- while (this.next().type !== 'list_item_end') {
- body += this.token.type === 'text'
- ? this.parseText()
- : this.tok();
- }
-
- return this.renderer.listitem(body);
- }
- case 'loose_item_start': {
- body = '';
-
- while (this.next().type !== 'list_item_end') {
- body += this.tok();
- }
-
- return this.renderer.listitem(body);
- }
- case 'html': {
- // TODO parse inline content if parameter markdown=1
- return this.renderer.html(this.token.text);
- }
- case 'paragraph': {
- return this.renderer.paragraph(this.inline.output(this.token.text));
- }
- case 'text': {
- return this.renderer.paragraph(this.parseText());
- }
- }
-};
-
-/**
- * Helpers
- */
-
-function escape(html, encode) {
- return html
- .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&amp;')
- .replace(/</g, '&lt;')
- .replace(/>/g, '&gt;')
- .replace(/"/g, '&quot;')
- .replace(/'/g, '&#39;');
-}
-
-function unescape(html) {
- // explicitly match decimal, hex, and named HTML entities
- return html.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, function(_, n) {
- n = n.toLowerCase();
- if (n === 'colon') return ':';
- if (n.charAt(0) === '#') {
- return n.charAt(1) === 'x'
- ? String.fromCharCode(parseInt(n.substring(2), 16))
- : String.fromCharCode(+n.substring(1));
- }
- return '';
- });
-}
-
-function edit(regex, opt) {
- regex = regex.source || regex;
- opt = opt || '';
- return {
- replace: function(name, val) {
- val = val.source || val;
- val = val.replace(/(^|[^\[])\^/g, '$1');
- regex = regex.replace(name, val);
- return this;
- },
- getRegex: function() {
- return new RegExp(regex, opt);
- }
- };
-}
-
-function resolveUrl(base, href) {
- if (!baseUrls[' ' + base]) {
- // we can ignore everything in base after the last slash of its path component,
- // but we might need to add _that_
- // https://tools.ietf.org/html/rfc3986#section-3
- if (/^[^:]+:\/*[^/]*$/.test(base)) {
- baseUrls[' ' + base] = base + '/';
- } else {
- baseUrls[' ' + base] = base.replace(/[^/]*$/, '');
- }
- }
- base = baseUrls[' ' + base];
-
- if (href.slice(0, 2) === '//') {
- return base.replace(/:[\s\S]*/, ':') + href;
- } else if (href.charAt(0) === '/') {
- return base.replace(/(:\/*[^/]*)[\s\S]*/, '$1') + href;
- } else {
- return base + href;
- }
-}
-var baseUrls = {};
-var originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;
-
-function noop() {}
-noop.exec = noop;
-
-function merge(obj) {
- var i = 1,
- target,
- key;
-
- for (; i < arguments.length; i++) {
- target = arguments[i];
- for (key in target) {
- if (Object.prototype.hasOwnProperty.call(target, key)) {
- obj[key] = target[key];
- }
- }
- }
-
- return obj;
-}
-
-function splitCells(tableRow, count) {
- var cells = tableRow.replace(/([^\\])\|/g, '$1 |').split(/ +\| */),
- i = 0;
-
- if (cells.length > count) {
- cells.splice(count);
- } else {
- while (cells.length < count) cells.push('');
- }
-
- for (; i < cells.length; i++) {
- cells[i] = cells[i].replace(/\\\|/g, '|');
- }
- return cells;
-}
-
-/**
- * Marked
- */
-
-function marked(src, opt, callback) {
- // throw error in case of non string input
- if (typeof src === 'undefined' || src === null) {
- throw new Error('marked(): input parameter is undefined or null');
- }
- if (typeof src !== 'string') {
- throw new Error('marked(): input parameter is of type '
- + Object.prototype.toString.call(src) + ', string expected');
- }
-
- if (callback || typeof opt === 'function') {
- if (!callback) {
- callback = opt;
- opt = null;
- }
-
- opt = merge({}, marked.defaults, opt || {});
-
- var highlight = opt.highlight,
- tokens,
- pending,
- i = 0;
-
- try {
- tokens = Lexer.lex(src, opt)
- } catch (e) {
- return callback(e);
- }
-
- pending = tokens.length;
-
- var done = function(err) {
- if (err) {
- opt.highlight = highlight;
- return callback(err);
- }
-
- var out;
-
- try {
- out = Parser.parse(tokens, opt);
- } catch (e) {
- err = e;
- }
-
- opt.highlight = highlight;
-
- return err
- ? callback(err)
- : callback(null, out);
- };
-
- if (!highlight || highlight.length < 3) {
- return done();
- }
-
- delete opt.highlight;
-
- if (!pending) return done();
-
- for (; i < tokens.length; i++) {
- (function(token) {
- if (token.type !== 'code') {
- return --pending || done();
- }
- return highlight(token.text, token.lang, function(err, code) {
- if (err) return done(err);
- if (code == null || code === token.text) {
- return --pending || done();
- }
- token.text = code;
- token.escaped = true;
- --pending || done();
- });
- })(tokens[i]);
- }
-
- return;
- }
- try {
- if (opt) opt = merge({}, marked.defaults, opt);
- return Parser.parse(Lexer.lex(src, opt), opt);
- } catch (e) {
- e.message += '\nPlease report this to https://github.com/markedjs/marked.';
- if ((opt || marked.defaults).silent) {
- return '<p>An error occurred:</p><pre>'
- + escape(e.message + '', true)
- + '</pre>';
- }
- throw e;
- }
-}
-
-/**
- * Options
- */
-
-marked.options =
-marked.setOptions = function(opt) {
- merge(marked.defaults, opt);
- return marked;
-};
-
-marked.getDefaults = function () {
- return {
- baseUrl: null,
- breaks: false,
- gfm: true,
- headerIds: true,
- headerPrefix: '',
- highlight: null,
- langPrefix: 'language-',
- mangle: true,
- pedantic: false,
- renderer: new Renderer(),
- sanitize: false,
- sanitizer: null,
- silent: false,
- smartLists: false,
- smartypants: false,
- tables: true,
- xhtml: false
- };
-}
-
-marked.defaults = marked.getDefaults();
-
-/**
- * Expose
- */
-
-marked.Parser = Parser;
-marked.parser = Parser.parse;
-
-marked.Renderer = Renderer;
-marked.TextRenderer = TextRenderer;
-
-marked.Lexer = Lexer;
-marked.lexer = Lexer.lex;
-
-marked.InlineLexer = InlineLexer;
-marked.inlineLexer = InlineLexer.output;
-
-marked.parse = marked;
-
-if (typeof module !== 'undefined' && typeof exports === 'object') {
- module.exports = marked;
-} else if (typeof define === 'function' && define.amd) {
- define(function() { return marked; });
-} else {
- root.marked = marked;
-}
-})(this || (typeof window !== 'undefined' ? window : global));
diff --git a/examples/webenginewidgets/markdowneditor/resources/3rdparty/qt_attribution.json b/examples/webenginewidgets/markdowneditor/resources/3rdparty/qt_attribution.json
deleted file mode 100644
index de5458eff..000000000
--- a/examples/webenginewidgets/markdowneditor/resources/3rdparty/qt_attribution.json
+++ /dev/null
@@ -1,35 +0,0 @@
-[
- {
- "Id": "markdowneditor-marked",
- "Name": "Marked (WebEngine Markdown Editor example)",
- "QDocModule": "qtwebengine",
- "QtUsage": "Marked is used in the WebEngine MarkDown Editor example",
- "QtParts": [ "examples" ],
- "Files": "marked.js",
- "Description": "A full-featured markdown parser and compiler, written in JavaScript. Built for speed.",
- "Homepage": "https://github.com/chjj/marked",
- "Version": "0.4.0",
- "DownloadLocation": "https://github.com/markedjs/marked/blob/0.4.0/lib/marked.js",
- "Copyright": "Copyright (c) 2011-2018, Christopher Jeffrey",
- "License": "MIT License",
- "LicenseId": "MIT",
- "LicenseFile": "MARKED-LICENSE.txt"
- },
- {
- "Id": "markdowneditor-markdowncss",
- "Name": "Markdown.css (WebEngine Markdown Editor example)",
- "QDocModule": "qtwebengine",
- "QtUsage": "markdown.css is used in the WebEngine MarkDown Editor example",
- "QtParts": [ "examples" ],
- "Files": "markdown.css",
- "Description": "Markdown.css is better default styling for your Markdown files.",
- "Homepage": "https://kevinburke.bitbucket.io/markdowncss/",
- "Version": "188530e4b5d020d7e237fc6b26be13ebf4a8def3",
- "DownloadLocation": "https://bitbucket.org/kevinburke/markdowncss/src/188530e4b5d020d7e237fc6b26be13ebf4a8def3/markdown.css",
- "Copyright": "Copyright 2011 Kevin Burke
- Copyright Twitter Inc.",
- "License": "Apache License 2.0",
- "LicenseId": "Apache-2.0",
- "LicenseFile": "MARKDOWN-LICENSE.txt"
- }
-]
diff --git a/examples/webenginewidgets/markdowneditor/resources/default.md b/examples/webenginewidgets/markdowneditor/resources/default.md
deleted file mode 100644
index af835fa4d..000000000
--- a/examples/webenginewidgets/markdowneditor/resources/default.md
+++ /dev/null
@@ -1,12 +0,0 @@
-## WebEngine Markdown Editor Example
-
-This example uses [QWebEngineView](http://doc.qt.io/qt-5/qwebengineview.html)
-to preview text written using the [Markdown](https://en.wikipedia.org/wiki/Markdown)
-syntax.
-
-### Acknowledgments
-
-The conversion from Markdown to HTML is done with the help of the
-[marked JavaScript library](https://github.com/chjj/marked) by _Christopher Jeffrey_.
-The [style sheet](https://kevinburke.bitbucket.io/markdowncss/)
-was created by _Kevin Burke_.
diff --git a/examples/webenginewidgets/markdowneditor/resources/index.html b/examples/webenginewidgets/markdowneditor/resources/index.html
deleted file mode 100644
index 289a2110b..000000000
--- a/examples/webenginewidgets/markdowneditor/resources/index.html
+++ /dev/null
@@ -1,32 +0,0 @@
-<!doctype html>
-<html lang="en">
-<meta charset="utf-8">
-<head>
- <link rel="stylesheet" type="text/css" href="3rdparty/markdown.css">
- <script src="3rdparty/marked.js"></script>
- <script src="qrc:/qtwebchannel/qwebchannel.js"></script>
-</head>
-<body>
- <div id="placeholder"></div>
- <script>
- 'use strict';
-
- var placeholder = document.getElementById('placeholder');
-
- var updateText = function(text) {
- placeholder.innerHTML = marked(text);
- }
-
- new QWebChannel(qt.webChannelTransport,
- function(channel) {
- var content = channel.objects.content;
- updateText(content.text);
- content.textChanged.connect(updateText);
- }
- );
- </script>
-</body>
-</html>
-
-
-
diff --git a/examples/webenginewidgets/markdowneditor/resources/markdowneditor.qrc b/examples/webenginewidgets/markdowneditor/resources/markdowneditor.qrc
deleted file mode 100644
index bc738f1cf..000000000
--- a/examples/webenginewidgets/markdowneditor/resources/markdowneditor.qrc
+++ /dev/null
@@ -1,8 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>default.md</file>
- <file>index.html</file>
- <file>3rdparty/markdown.css</file>
- <file>3rdparty/marked.js</file>
- </qresource>
-</RCC>
diff --git a/examples/webenginewidgets/minimal/doc/images/minimal-example.png b/examples/webenginewidgets/minimal/doc/images/minimal-example.png
deleted file mode 100644
index 18ac9b177..000000000
--- a/examples/webenginewidgets/minimal/doc/images/minimal-example.png
+++ /dev/null
Binary files differ
diff --git a/examples/webenginewidgets/minimal/doc/src/minimal.qdoc b/examples/webenginewidgets/minimal/doc/src/minimal.qdoc
deleted file mode 100644
index b04390d23..000000000
--- a/examples/webenginewidgets/minimal/doc/src/minimal.qdoc
+++ /dev/null
@@ -1,82 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \example webenginewidgets/minimal
- \title WebEngine Widgets Minimal Example
- \ingroup webengine-widgetexamples
- \brief Displays a web page using \QWE Widgets.
-
- \image minimal-example.png
-
- \e {WebEngine Widgets Minimal Example} demonstrates how to use
- \l{QWebEngineView} to render a web page. It shows the minimum amount of code
- needed to load and display an HTML page, and can be used as a basis for
- further experimentation.
-
- \include examples-run.qdocinc
-
- \section1 The Code
-
- We first define a \c commandLineUrlArgument function that returns the URL to open.
- This is either the first positional argument given on the command line, or
- \c https://www.qt.io as a fallback.
-
- \quotefromfile webenginewidgets/minimal/main.cpp
- \skipto #include
-
- \printto int main
-
- In the \c main function we first set the
- \l{QCoreApplication::organizationName} property. This affects the locations
- where \QWE stores persistent and cached data (see also
- \l{QWebEngineProfile::cachePath} and
- \l{QWebEngineProfile::persistentStoragePath}).
-
- We also set the Qt::AA_EnableHighDpiScaling attribute. This lets the web
- view automatically scale on high-dpi displays.
-
- Next, we instantiate a QApplication and a QWebEngineView. The URL
- to load is taken from \c commandLineUrlArgument and
- loaded by calling \l QWebEngineView::setUrl. The view widget is
- given a reasonable default size, and shown.
- Finally, QApplication::exec() launches the main event loop.
-
- \printuntil }
-
- \section1 Requirements
-
- The example requires a working internet connection to render
- the \l{Qt Homepage}.
- An optional system proxy should be picked up automatically.
- However, for proxies that require a username or password,
- you need to connect to
- QWebEnginePage::proxyAuthenticationRequired.
-
- \l{Qt WebEngine Widgets} uses the \l{Qt Quick Scene Graph} to compose the
- page. Therefore, OpenGL support is required.
-*/
diff --git a/examples/webenginewidgets/minimal/main.cpp b/examples/webenginewidgets/minimal/main.cpp
deleted file mode 100644
index b31382ad5..000000000
--- a/examples/webenginewidgets/minimal/main.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QApplication>
-#include <QWebEngineView>
-
-QUrl commandLineUrlArgument()
-{
- const QStringList args = QCoreApplication::arguments();
- for (const QString &arg : args.mid(1)) {
- if (!arg.startsWith(QLatin1Char('-')))
- return QUrl::fromUserInput(arg);
- }
- return QUrl(QStringLiteral("https://www.qt.io"));
-}
-
-int main(int argc, char *argv[])
-{
- QCoreApplication::setOrganizationName("QtExamples");
- QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
- QApplication app(argc, argv);
-
- QWebEngineView view;
- view.setUrl(commandLineUrlArgument());
- view.resize(1024, 750);
- view.show();
-
- return app.exec();
-}
diff --git a/examples/webenginewidgets/notifications/CMakeLists.txt b/examples/webenginewidgets/notifications/CMakeLists.txt
new file mode 100644
index 000000000..8cca0ab31
--- /dev/null
+++ b/examples/webenginewidgets/notifications/CMakeLists.txt
@@ -0,0 +1,52 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+project(notifications LANGUAGES CXX)
+
+set(CMAKE_AUTOMOC ON)
+
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webenginewidgets/notifications")
+
+find_package(Qt6 REQUIRED COMPONENTS Core Gui WebEngineWidgets)
+
+qt_add_executable(notifications
+ main.cpp
+ notificationpopup.h
+)
+
+set_target_properties(notifications PROPERTIES
+ WIN32_EXECUTABLE TRUE
+ MACOSX_BUNDLE TRUE
+)
+
+target_link_libraries(notifications PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::WebEngineWidgets
+)
+
+# Resources:
+set(data_resource_files
+ "data/icon.png"
+ "data/index.html"
+)
+
+qt_add_resources(notifications "data"
+ PREFIX
+ "/"
+ BASE
+ "data"
+ FILES
+ ${data_resource_files}
+)
+
+install(TARGETS notifications
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/webenginewidgets/notifications/doc/src/notifications.qdoc b/examples/webenginewidgets/notifications/doc/src/notifications.qdoc
index ec932f90c..f4fe1818f 100644
--- a/examples/webenginewidgets/notifications/doc/src/notifications.qdoc
+++ b/examples/webenginewidgets/notifications/doc/src/notifications.qdoc
@@ -1,32 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\example webenginewidgets/notifications
+ \examplecategory {Web Technologies}
\title WebEngine Notifications Example
\ingroup webengine-widgetexamples
\brief Demonstrates how to pass HTML5 web notifications to users.
diff --git a/examples/webenginewidgets/notifications/main.cpp b/examples/webenginewidgets/notifications/main.cpp
index c3039b9e0..c754aff3f 100644
--- a/examples/webenginewidgets/notifications/main.cpp
+++ b/examples/webenginewidgets/notifications/main.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "notificationpopup.h"
@@ -72,7 +25,6 @@ public:
int main(int argc, char *argv[])
{
- QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QCoreApplication::setOrganizationName("QtExamples");
QApplication app(argc, argv);
diff --git a/examples/webenginewidgets/notifications/notificationpopup.h b/examples/webenginewidgets/notifications/notificationpopup.h
index d211c7996..57912f204 100644
--- a/examples/webenginewidgets/notifications/notificationpopup.h
+++ b/examples/webenginewidgets/notifications/notificationpopup.h
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#pragma once
diff --git a/examples/webenginewidgets/printme/CMakeLists.txt b/examples/webenginewidgets/printme/CMakeLists.txt
new file mode 100644
index 000000000..2d071903c
--- /dev/null
+++ b/examples/webenginewidgets/printme/CMakeLists.txt
@@ -0,0 +1,53 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+project(printme LANGUAGES CXX)
+
+set(CMAKE_AUTOMOC ON)
+
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webenginewidgets/printme")
+
+find_package(Qt6 REQUIRED COMPONENTS Core Gui PrintSupport WebEngineWidgets)
+
+qt_add_executable(printme
+ main.cpp
+ printhandler.cpp printhandler.h
+)
+
+set_target_properties(printme PROPERTIES
+ WIN32_EXECUTABLE TRUE
+ MACOSX_BUNDLE TRUE
+)
+
+target_link_libraries(printme PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::PrintSupport
+ Qt::WebEngineWidgets
+)
+
+# Resources:
+set(data_resource_files
+ "data/index.html"
+ "data/style.css"
+)
+
+qt_add_resources(printme "data"
+ PREFIX
+ "/"
+ BASE
+ "data"
+ FILES
+ ${data_resource_files}
+)
+
+install(TARGETS printme
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/webenginewidgets/printme/data/data.qrc b/examples/webenginewidgets/printme/data/data.qrc
index a9c76cc7e..b5e0b1fe0 100644
--- a/examples/webenginewidgets/printme/data/data.qrc
+++ b/examples/webenginewidgets/printme/data/data.qrc
@@ -2,6 +2,5 @@
<qresource prefix="/">
<file>index.html</file>
<file>style.css</file>
- <file>icon.svg</file>
</qresource>
</RCC>
diff --git a/examples/webenginewidgets/printme/data/icon.svg b/examples/webenginewidgets/printme/data/icon.svg
deleted file mode 100644
index b90ff26dd..000000000
--- a/examples/webenginewidgets/printme/data/icon.svg
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
-<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
- width="94px" height="94px" viewBox="0 0 94 94" enable-background="new 0 0 94 94" xml:space="preserve">
-<g>
- <circle fill="none" cx="47" cy="47" r="47"/>
- <g>
- <path fill="#46A2DA" d="M47,92.979c-11.779,0-23.559-4.484-32.526-13.451C-3.461,61.591-3.461,32.409,14.472,14.474
- C32.41-3.463,61.592-3.461,79.526,14.473c17.935,17.936,17.935,47.119,0.002,65.054l-0.002,0.001
- C70.559,88.495,58.779,92.979,47,92.979z"/>
- </g>
- <path fill="#80C342" d="M93,47C93,21.595,72.405,1,47,1C34.297,1,22.797,6.149,14.473,14.473l65.054,65.054
- C87.851,71.203,93,59.703,93,47z"/>
- <g>
- <path fill="#46A2DA" d="M47,65c-4.808,0-9.328-1.873-12.728-5.272c-7.018-7.019-7.018-18.438,0-25.456
- C37.672,30.873,42.192,29,47,29s9.328,1.873,12.728,5.272c7.018,7.019,7.018,18.438,0,25.456C56.328,63.127,51.808,65,47,65z"/>
- <path fill="#FFFFFF" d="M62.248,59.919c6.671-7.858,6.312-19.644-1.105-27.061C57.237,28.953,52.118,27,47,27
- c-5.118,0-10.237,1.953-14.142,5.858c-7.81,7.81-7.81,20.474,0,28.284C36.763,65.047,41.882,67,47,67
- c4.379,0,8.752-1.441,12.372-4.3L77.88,81.209c0.989-0.895,1.935-1.837,2.843-2.814L62.248,59.919z M35.686,58.314
- c-6.238-6.238-6.238-16.389,0-22.627C38.708,32.664,42.726,31,47,31c4.274,0,8.292,1.664,11.314,4.686
- c6.238,6.238,6.238,16.389,0,22.627C55.292,61.336,51.274,63,47,63C42.726,63,38.708,61.336,35.686,58.314z"/>
- </g>
-</g>
-</svg>
diff --git a/examples/webenginewidgets/printme/data/index.html b/examples/webenginewidgets/printme/data/index.html
index cf286e85a..865152c1d 100644
--- a/examples/webenginewidgets/printme/data/index.html
+++ b/examples/webenginewidgets/printme/data/index.html
@@ -12,13 +12,13 @@
</head>
<body>
<form class="form">
- <img class="logo" src="icon.svg" alt="qtwebengine">
<div class="header">
<h1>Hello Paper World!</h1>
<h2>Press Ctrl+p to print with print preview</h2>
<h2>Press Ctrl+Shift+p to print without print preview</h2>
<h2>Click the button to print using JavaScript</h2>
<p class="button" onclick="printNow()">Print Now</p>
+ </div>
</form>
</body>
</html>
diff --git a/examples/webenginewidgets/printme/data/style.css b/examples/webenginewidgets/printme/data/style.css
index cf6a2b7bf..af8b70fda 100644
--- a/examples/webenginewidgets/printme/data/style.css
+++ b/examples/webenginewidgets/printme/data/style.css
@@ -1,72 +1,74 @@
+@import url('https://fonts.googleapis.com/css2?family=Titillium+Web:ital,wght@0,200;0,300;0,400;0,600;0,700;0,900;1,200;1,300;1,400;1,600;1,700&display=swap');
+* {
+ padding: 0;
+ margin: 0;
+ box-sizing: border-box;
+}
+
html,body {
- height:100%;
- width:100%;
- margin:0;
+ height: 100%;
+ width: 100%;
}
+
body {
- display:flex;
-}
- .logo {
- width: 75px;
- height: 75px;
- float: left;
- margin: 20px 20px 0px 20px;
- -webkit-animation:spin 8s linear infinite;
-}
- @-webkit-keyframes spin {
- 100% {
- -webkit-transform: rotate(360deg);
- }
+ display: flex;
}
+
.header {
display: inline
}
+
.form {
- width: 480px;
- height: 170px;
- background: -webkit-linear-gradient(bottom, #ddd, #fff);
- border: 1px solid #999;
- border-radius: 12px;
+ width: 50%;
+ background: #fff;
+ border: 0.5px solid #999;
+ border-radius: 8px;
color: #46a;
- font-family: 'Lucida Sans Unicode', 'Lucida Grande', sans-serif;
- font-size: 14px;
- font-style: italic;
- font-weight: bold;
+ font-family: 'Titillium Web', sans-serif;
+ font-size: 1rem;
margin: auto;
- padding: 10px;
+ padding: 1.5rem;
position: relative;
- line-height: 26px;
text-decoration: none;
- -webkit-box-shadow: 0px 0px 5px #444;
}
- h1 {
- padding-left:40px;
- color: #46a2da;
+
+h1 {
+ color: #00414A;
+ font-size: 2.5rem;
+ font-weight: 700;
+ margin-top: -0.85rem;
+ margin-bottom: 2rem;
}
- h2 {
- color: #80c342;
- font-size: 13px;
- margin-top: -20px;
-}
- span {
- margin-left: 20px;
+
+h2 {
+ color: #00414A;
+ font-size: 1.125rem;
+ font-weight: 400;
+ font-style: italic;
+ margin-bottom: 1rem;
}
+
.button{
- display: inline-block;
- background: #46a2da;
- width: 100px;
- height: 30px;
- padding: 0px;
- text-align: center;
- font-weight: bold;
- color: #ffffff;
- text-decoration: none;
- border: 1px solid #999;
- margin-left: 190px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ padding: 0.4444em 0.8889em;
+ height: 2.4em;
+ cursor: pointer;
+ background: #00414A;
+ color: #fff;
+ border-radius: 4px;
+ margin-top: 2rem;
+ font-family: 'Titillium Web', sans-serif;
+ font-size: 1.125rem;
+ font-weight: 400;
+ transition: color 300ms ease-out, border 300ms ease-out;
}
+
.button:hover {
- background-color: #46a200
+ background: #19545C;
}
+
.button:active {
- background-color: #3e8e41;
+ background-color: #19545C;
}
diff --git a/examples/webenginewidgets/printme/doc/images/printme-example.png b/examples/webenginewidgets/printme/doc/images/printme-example.png
index a636972fd..dac4e61e6 100644
--- a/examples/webenginewidgets/printme/doc/images/printme-example.png
+++ b/examples/webenginewidgets/printme/doc/images/printme-example.png
Binary files differ
diff --git a/examples/webenginewidgets/printme/doc/src/printme.qdoc b/examples/webenginewidgets/printme/doc/src/printme.qdoc
index d05d5147b..91aecf6de 100644
--- a/examples/webenginewidgets/printme/doc/src/printme.qdoc
+++ b/examples/webenginewidgets/printme/doc/src/printme.qdoc
@@ -1,32 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
- \example webenginewidgets/printme
+ \example webenginewidgets/printme
+ \examplecategory {Web Technologies}
\title WebEngine Widgets PrintMe Example
\ingroup webengine-widgetexamples
\brief Demonstrates how to print web pages using Qt WebEngine Widgets.
@@ -66,8 +43,8 @@
\section1 Print Handler
- In the \c{PrintHandler} function, we first implement \c{printPreview()},
- where we instantiate \l{QPrinter} together with \l{QPrintPreviewDialog}.
+ In the \c{PrintHandler} class, we first implement \c{printPreview()},
+ where we instantiate \l{QPrintPreviewDialog}.
We need the \l{QPrintPreviewDialog::paintRequested} handle to generate a
set of preview pages.
@@ -77,16 +54,26 @@
Now we can implement the \c{PrintHandler::printDocument()} slot, which is
called in response to the \l{QPrintPreviewDialog::paintRequested} signal.
+ To do actual painting on a printer, we call the \l QWebEngineView::print()
+ function. Printing is an async operation in Chromium, but not in Qt, so we
+ run a local event loop using \l{QEventLoop::exec()} to make sure printing
+ is done before returning. User input is blocked, since clicking on a button
+ while we're waiting for the print to finish can mess up the internal state
+ and cause a crash.
\quotefromfile webenginewidgets/printme/printhandler.cpp
\skipto PrintHandler::printDocument(
\printuntil /^\}/
- To do actual painting on a printer, we call the \l{QWebEnginePage::print()}
- function. Because this call blocks the main event loop, we need to create
- a local one. We begin the local event loop by calling
- \l{QEventLoop::exec()}. When the local event loop terminates,
- we check for \c{result} and report any errors that occurred.
+ To get notified about the result of printing job, we implement
+ \c{PrintHandler::printFinished()} slot as handler of
+ \l QWebEngineView::printFinished() signal. We check for \c{success} and
+ report any errors that occurred. Finally, we call \l{QEventLoop::quit()}
+ to exit out of the local event loop.
+
+ \quotefromfile webenginewidgets/printme/printhandler.cpp
+ \skipto PrintHandler::printFinished(
+ \printuntil /^\}/
The last function we implement, \c{PrintHandler::print()}, is trivial,
because it simply opens \l{QPrintDialog} and calls the previously
diff --git a/examples/webenginewidgets/printme/main.cpp b/examples/webenginewidgets/printme/main.cpp
index e4d6d9dc8..46f44ccb6 100644
--- a/examples/webenginewidgets/printme/main.cpp
+++ b/examples/webenginewidgets/printme/main.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "printhandler.h"
#include <QApplication>
@@ -55,7 +8,6 @@
int main(int argc, char *argv[])
{
- QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication app(argc, argv);
QWebEngineView view;
@@ -64,10 +16,10 @@ int main(int argc, char *argv[])
view.show();
PrintHandler handler;
- handler.setPage(view.page());
+ handler.setView(&view);
- auto printPreviewShortCut = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_P), &view);
- auto printShortCut = new QShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_P), &view);
+ auto printPreviewShortCut = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_P), &view);
+ auto printShortCut = new QShortcut(QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_P), &view);
QObject::connect(printPreviewShortCut, &QShortcut::activated, &handler, &PrintHandler::printPreview);
QObject::connect(printShortCut, &QShortcut::activated, &handler, &PrintHandler::print);
diff --git a/examples/webenginewidgets/printme/printhandler.cpp b/examples/webenginewidgets/printme/printhandler.cpp
index d8c4fc177..9f8f6ee0b 100644
--- a/examples/webenginewidgets/printme/printhandler.cpp
+++ b/examples/webenginewidgets/printme/printhandler.cpp
@@ -1,113 +1,66 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "printhandler.h"
-#include <QEventLoop>
#include <QPrintDialog>
-#include <QPrinter>
#include <QPainter>
#include <QPrintPreviewDialog>
-#include <QWebEnginePage>
+#include <QWebEngineView>
PrintHandler::PrintHandler(QObject *parent)
: QObject(parent)
{
-
+ m_printer.setResolution(300);
}
-void PrintHandler::setPage(QWebEnginePage *page)
+void PrintHandler::setView(QWebEngineView *view)
{
- Q_ASSERT(!m_page);
- m_page = page;
- connect(m_page, &QWebEnginePage::printRequested, this, &PrintHandler::printPreview);
+ Q_ASSERT(!m_view);
+ m_view = view;
+ connect(view, &QWebEngineView::printRequested, this, &PrintHandler::printPreview);
+ connect(view, &QWebEngineView::printFinished, this, &PrintHandler::printFinished);
}
void PrintHandler::print()
{
- QPrinter printer(QPrinter::HighResolution);
- QPrintDialog dialog(&printer, m_page->view());
+ QPrintDialog dialog(&m_printer, m_view);
if (dialog.exec() != QDialog::Accepted)
return;
- printDocument(&printer);
+ printDocument(&m_printer);
}
void PrintHandler::printDocument(QPrinter *printer)
{
- QEventLoop loop;
- bool result;
- auto printPreview = [&](bool success) { result = success; loop.quit(); };
- m_page->print(printer, std::move(printPreview));
- loop.exec();
- if (!result) {
+ m_view->print(printer);
+ // User input in the print preview dialog while we're waiting on a print task
+ // can mess up the internal state and cause a crash.
+ m_waitForResult.exec(QEventLoop::ExcludeUserInputEvents);
+}
+
+void PrintHandler::printFinished(bool success)
+{
+ if (!success) {
QPainter painter;
- if (painter.begin(printer)) {
+ if (painter.begin(&m_printer)) {
QFont font = painter.font();
font.setPixelSize(20);
painter.setFont(font);
painter.drawText(QPointF(10,25),
QStringLiteral("Could not generate print preview."));
-
painter.end();
}
}
+ m_waitForResult.quit();
}
void PrintHandler::printPreview()
{
- if (!m_page)
+ if (!m_view)
return;
if (m_inPrintPreview)
return;
m_inPrintPreview = true;
- QPrinter printer;
- QPrintPreviewDialog preview(&printer, m_page->view());
+ QPrintPreviewDialog preview(&m_printer, m_view);
connect(&preview, &QPrintPreviewDialog::paintRequested,
this, &PrintHandler::printDocument);
preview.exec();
diff --git a/examples/webenginewidgets/printme/printhandler.h b/examples/webenginewidgets/printme/printhandler.h
index 69b71f4a8..ab9a8c3a4 100644
--- a/examples/webenginewidgets/printme/printhandler.h
+++ b/examples/webenginewidgets/printme/printhandler.h
@@ -1,62 +1,17 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef PRINTHANDLER_H
#define PRINTHANDLER_H
+#include <QEventLoop>
#include <QObject>
+#include <QPrinter>
QT_BEGIN_NAMESPACE
class QPainter;
class QPrinter;
-class QWebEnginePage;
+class QWebEngineView;
QT_END_NAMESPACE
class PrintHandler : public QObject
@@ -64,15 +19,18 @@ class PrintHandler : public QObject
Q_OBJECT
public:
PrintHandler(QObject *parent = nullptr);
- void setPage(QWebEnginePage *page);
+ void setView(QWebEngineView *view);
public slots:
void print();
void printPreview();
void printDocument(QPrinter *printer);
+ void printFinished(bool success);
private:
- QWebEnginePage *m_page = nullptr;
+ QWebEngineView *m_view = nullptr;
+ QPrinter m_printer;
+ QEventLoop m_waitForResult;
bool m_inPrintPreview = false;
};
diff --git a/examples/webenginewidgets/push-notifications/CMakeLists.txt b/examples/webenginewidgets/push-notifications/CMakeLists.txt
new file mode 100644
index 000000000..3328c2ce9
--- /dev/null
+++ b/examples/webenginewidgets/push-notifications/CMakeLists.txt
@@ -0,0 +1,46 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+project(notifications LANGUAGES CXX)
+
+set(CMAKE_AUTOMOC ON)
+
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webenginewidgets/push-notifications")
+
+find_package(Qt6 REQUIRED COMPONENTS Core Gui WebEngineWidgets)
+
+qt_add_executable(push-notifications
+ main.cpp
+ notificationpopup.h
+)
+
+set_target_properties(push-notifications PROPERTIES
+ WIN32_EXECUTABLE TRUE
+ MACOSX_BUNDLE TRUE
+)
+
+target_link_libraries(push-notifications PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::WebEngineWidgets
+)
+
+qt_add_resources(push-notifications "data"
+ PREFIX
+ "/"
+ BASE
+ "data"
+ FILES
+ "data/icon.png"
+)
+
+install(TARGETS push-notifications
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/webenginewidgets/push-notifications/content/index.html b/examples/webenginewidgets/push-notifications/content/index.html
new file mode 100644
index 000000000..cce3055cd
--- /dev/null
+++ b/examples/webenginewidgets/push-notifications/content/index.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Push Notification Using Node and FCM</title>
+ <link rel="stylesheet" href="style.css">
+</head>
+<body>
+ <h1>Push Notification Using NodeJS and QtWebEngine</h1>
+ <div id="app">
+ <div id="ping-setup">
+ <form>
+ <div>
+ Ping Me Every [sec]:
+ </div>
+ <div class="ping-input">
+ <input type="number" name="seconds" min="0" max="3600" required="">
+ </div><button>Ping Me</button>
+ </form>
+ </div>
+ <div id="ping-clear">
+ <div id="ping-text"></div><button id="ping-clear-button">Clear</button>
+ </div>
+ </div>
+ <script src="ping.js"></script>
+</body>
+</html>
diff --git a/examples/webenginewidgets/push-notifications/content/ping.js b/examples/webenginewidgets/push-notifications/content/ping.js
new file mode 100644
index 000000000..285a57019
--- /dev/null
+++ b/examples/webenginewidgets/push-notifications/content/ping.js
@@ -0,0 +1,84 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+const publicVapidKey =
+ "BNO4fIv439RpvbReeABNlDNiiBD2Maykn7EVnwsPseH7-P5hjnzZLEfnejXVP7Zt6MFoKqKeHm4nV9BHvbgoRPg";
+
+async function setup(delay)
+{
+ console.log('>> register service worker...');
+ const register = await navigator.serviceWorker.register('/worker.js', { scope : '/' });
+ console.log('>> service worker registered...');
+
+ console.log('>> subscribe push subscription to FCM');
+ var subscription = await register.pushManager.subscribe(
+ { userVisibleOnly : true, applicationServerKey : publicVapidKey });
+ console.log('>> subscription created...');
+
+ console.log('>> subscribe to push service...');
+ await fetch('/subscribe', {
+ method : 'POST',
+ body : JSON.stringify(subscription),
+ headers : { 'content-type' : 'application/json', 'ping-time' : delay }
+ });
+ console.log('>> push subscription created...')
+}
+
+async function clear()
+{
+ const register = await navigator.serviceWorker.getRegistration();
+ var subscription = await register.pushManager.getSubscription();
+ console.log('>> unsubscribe to push service...');
+ await fetch('/unsubscribe', {
+ method : 'POST',
+ body : JSON.stringify(subscription),
+ headers : { 'content-type' : 'application/json' }
+ });
+ console.log('>> push unsubscription removed...')
+
+ console.log('>> unsubscribe push subscription to FCM');
+ await subscription.unsubscribe();
+ console.log('>> subscription removed...');
+}
+
+function displaySetup(delay = null)
+{
+ const pingSetup = document.getElementById('ping-setup');
+ const pingClear = document.getElementById('ping-clear');
+ const pingText = document.getElementById('ping-text');
+ if (delay) {
+ pingClear.style.display = 'block';
+ pingSetup.style.display = 'none';
+ pingText.innerHTML = 'Ping Me Every ' + delay + ' seconds';
+ } else {
+ pingClear.style.display = 'none';
+ pingSetup.style.display = 'block';
+ pingText.innerHTML = "";
+ }
+}
+
+function handleSetupPing(event)
+{
+ event.preventDefault();
+
+ const seconds = document.forms[0].seconds.value;
+ document.forms[0].reset();
+
+ // check for service worker support
+ if ('serviceWorker' in navigator) {
+ setup(seconds).catch(err => console.error(err));
+ }
+
+ displaySetup(seconds);
+};
+
+function handleClearPing(event)
+{
+ event.preventDefault();
+ clear();
+ displaySetup();
+};
+
+document.forms[0].addEventListener('submit', handleSetupPing);
+const clearButton = document.getElementById('ping-clear-button');
+clearButton.addEventListener('click', handleClearPing);
diff --git a/examples/webenginewidgets/push-notifications/content/style.css b/examples/webenginewidgets/push-notifications/content/style.css
new file mode 100644
index 000000000..8176462a2
--- /dev/null
+++ b/examples/webenginewidgets/push-notifications/content/style.css
@@ -0,0 +1,29 @@
+body {
+ font-family: monaco;
+ height: 100vh;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ display: flex;
+}
+#ping-clear,
+#ping-setup {
+ font-size: 32px;
+ text-align: center;
+}
+.form-inputs{
+ margin-top: 20px;
+}
+input {
+ width: 100px;
+ height: 30px;
+}
+button {
+ font-size: 16px;
+}
+#ping-text {
+ margin-bottom: 30px;
+}
+#ping-clear {
+ display: none;
+}
diff --git a/examples/webenginewidgets/push-notifications/content/worker.js b/examples/webenginewidgets/push-notifications/content/worker.js
new file mode 100644
index 000000000..ed660a6e9
--- /dev/null
+++ b/examples/webenginewidgets/push-notifications/content/worker.js
@@ -0,0 +1,7 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+self.addEventListener('push', event => {
+ const data = event.data.json();
+ self.registration.showNotification(data.title, { body : data.text });
+});
diff --git a/examples/webenginewidgets/push-notifications/data/data.qrc b/examples/webenginewidgets/push-notifications/data/data.qrc
new file mode 100644
index 000000000..619648d1b
--- /dev/null
+++ b/examples/webenginewidgets/push-notifications/data/data.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/">
+ <file>icon.png</file>
+ </qresource>
+</RCC>
diff --git a/examples/webenginewidgets/push-notifications/data/icon.png b/examples/webenginewidgets/push-notifications/data/icon.png
new file mode 100644
index 000000000..4c3870c06
--- /dev/null
+++ b/examples/webenginewidgets/push-notifications/data/icon.png
Binary files differ
diff --git a/examples/webenginewidgets/push-notifications/doc/images/notification.png b/examples/webenginewidgets/push-notifications/doc/images/notification.png
new file mode 100644
index 000000000..ec5c67457
--- /dev/null
+++ b/examples/webenginewidgets/push-notifications/doc/images/notification.png
Binary files differ
diff --git a/examples/webenginewidgets/push-notifications/doc/images/permissions.png b/examples/webenginewidgets/push-notifications/doc/images/permissions.png
new file mode 100644
index 000000000..dedb6e472
--- /dev/null
+++ b/examples/webenginewidgets/push-notifications/doc/images/permissions.png
Binary files differ
diff --git a/examples/webenginewidgets/push-notifications/doc/images/push-notifications.png b/examples/webenginewidgets/push-notifications/doc/images/push-notifications.png
new file mode 100644
index 000000000..c5ba5f589
--- /dev/null
+++ b/examples/webenginewidgets/push-notifications/doc/images/push-notifications.png
Binary files differ
diff --git a/examples/webenginewidgets/push-notifications/doc/images/website.png b/examples/webenginewidgets/push-notifications/doc/images/website.png
new file mode 100644
index 000000000..10a4a6150
--- /dev/null
+++ b/examples/webenginewidgets/push-notifications/doc/images/website.png
Binary files differ
diff --git a/examples/webenginewidgets/push-notifications/doc/src/push-notifications.qdoc b/examples/webenginewidgets/push-notifications/doc/src/push-notifications.qdoc
new file mode 100644
index 000000000..05ccf3e8b
--- /dev/null
+++ b/examples/webenginewidgets/push-notifications/doc/src/push-notifications.qdoc
@@ -0,0 +1,203 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+
+\example webenginewidgets/push-notifications
+\examplecategory {Web Technologies}
+\title WebEngine Push Notifications Example
+\ingroup webengine-widgetexamples
+\brief Demonstrates how to subscribe to and unsubscribe from push notifications.
+
+In this example we are going to send push notifications from a web push service to the user.
+This is the typical scenario where messages are sent from the application server i.e. website
+back-end through a 3rd-party push service, to finally arrive at the user's browser in form of
+notifications. To demonstrate this flow, we will implement a simple push service server
+application, to which the user can subscribe to receive \e ping messages.
+
+As already mentioned, in such a workflow there are three different parties involved:
+
+\list
+ \li the user's web browser where they receive push notifications
+ \li 3rd-party push service, which is defined by a subscription endpoint and is a part
+ of a browser's push service implementation
+ \li application server, which will store user's subscriptions and initiate push messages
+ using a subscription endpoint
+\endlist
+
+The user visits a website, where a JavaScript web application uses the JavaScript Push API
+to create a push notification subscription. The user is then asked to grant a permission
+to receive and display push notifications. Once accepted, the Push API establishes a push channel
+with a 3rd-party push service, which in case of QtWebEngine is \l {https://firebase.google.com}
+{Firebase Cloud Messaging (FCM)}. The unique push subscription is created that
+includes the subscription endpoint URL. The browser then sends a subscription message
+to the application server forwarding the endpoint setup. The application server can now
+use the subscription endpoint to send notifications to the browser. The browser push service
+implementation will deliver a push message. However, to show it, a service worker must
+be registered. As the service worker runs in the background, it allows displaying notifications
+even if a website, which has installed it, is no longer opened.
+
+\image push-notifications.png
+
+Let's go more into implementation details. We start with implementing our custom
+push service using NodeJS with two modules:
+
+\list
+ \li \l {https://github.com/web-push-libs/web-push} {web-push} - provides the web-push protocol
+ implementation
+ \li \l {https://github.com/expressjs/express} {express} - provides the web application framework
+\endlist
+
+Let's initialize a new project and install the required modules in the root directory of this
+example:
+
+\snippet /push-notifications/commands 0
+
+These commands should create package.js, which defines the start command:
+
+\snippet /push-notifications/commands 1
+
+Now let's move on to the push service back-end implementation in server.js.
+
+We start by including the required modules and doing basic \e express framework setup, which
+we use to create our custom push server. For simplicity we are going to handle only one
+subscription at a time. To do that we need to create \e VAPID keys which we are going to
+generate with \e web-push libs. The public key is going to be used by the front-end and authenticate
+to the service.
+
+\quotefromfile webenginewidgets/push-notifications/server.js
+\skipto const express
+\printto add subscribe route
+
+\note We are not going to cover the encryption of messages in this example.
+
+To generate keys, we can use the tool shipped with \e web-push lib, that is installed by
+\c npm in our example's root directory.
+
+\snippet /push-notifications/commands 2
+
+Now we add two \c routes to the push server. One to \c subscribe and one to \c unsubscribe,
+so that our front-end can send an HTTP POST request to handle the push subscription.
+In the subscribe request we will get \c subscription in the request body and we also retrieve
+the custom header \c ping-time that defines how often the ping messages should be pushed to
+the user. We keep around the \c subscription to be able to send push notifications later.
+As a confirmation, we send the 201 status code and schedule the first push notification based on
+the \c ping-time value. The \c unsubscribe request simply removes a subscription.
+
+\quotefromfile webenginewidgets/push-notifications/server.js
+\skipto add subscribe route
+\printto function sendNotification
+
+The \c sendNotication() function sends push messages using the web-push lib. We create the payload
+with the message we want to present to a user and schedule the next push message.
+
+\quotefromfile webenginewidgets/push-notifications/server.js
+\skipto function sendNotification
+\printto server.listen
+
+In the end we start the server to listen on the given port.
+
+\quotefromfile webenginewidgets/push-notifications/server.js
+\skipto server.listen
+\printline started
+
+Let's move now to our front-end. We create a simple page index.html, where the user can enter how
+often they want to receive ping notification messages. We will have two buttons:
+\e {Ping Me} to subscribe for push notifications and \e Clear to unsubscribe.
+In the end we load ping.js, which we cover next.
+
+\quotefromfile webenginewidgets/push-notifications/content/index.html
+\skipto <body>
+\printuntil </body>
+
+The last piece is creating the logic for the push subscription within the front-end. Here we have two
+functions, \c setup and \c clear, to handle subscriptions. When the user clicks on the \e {Ping Me}
+button, \c setup is called. To be able to receive notifications, the service worker is needed.
+This way the user can leave the website and still get notified as the service worker works
+in the background and handles incoming messages. To achieve that, we have to first register
+one with:
+
+\quotefromfile webenginewidgets/push-notifications/content/ping.js
+\skipto const register
+\printline worker.js
+
+The call to \c cpushManager.subscribe() will trigger a permission prompt, which is displayed to the
+user. If the permission is granted, the push subscription is returned. It includes a URL endpoint
+that allows sending notifications to the browser, where the registered service worker waits for
+push messages.
+
+\quotefromfile webenginewidgets/push-notifications/content/ping.js
+\skipto var subscription
+\printto console.log
+
+As mentioned the subscription is created for FCM and should be now sent to our custom server
+with an HTTP POST request. In addition, we add to the post request the HTTP header with the
+\c ping-time the user entered on our website.
+
+\quotefromfile webenginewidgets/push-notifications/content/ping.js
+\skipto await fetch
+\printto console.log
+
+The function \c clear call unsubscribes first from our push server by sending an HTTP POST request
+and later from the 3rd-party push service (FCM).
+
+\quotefromfile webenginewidgets/push-notifications/content/ping.js
+\skipuntil async function clear()
+\skipuntil {
+\printto console.log
+\dots
+\skipto await fetch
+\printto console.log
+\dots
+\skipto await subscription
+\printto console.log
+
+The rest of code in ping.js is just boilerplate code to read a user provided value
+and call \c setup() or \c clear().
+
+As the last part of the front-end let's look inside a service worker script, where we simply
+register an event listener for \e push events.
+
+\quotefromfile webenginewidgets/push-notifications/content/worker.js
+\skipto self
+\printuntil });
+\printuntil });
+
+When a push event comes we simply use the Notification JavaScript API to display a notification.
+
+\note QtWebEngine Notification Example shows how to provide your own handler and customize
+the look and feel of a notification message.
+
+Having the implementation in place, we can start the server on localhost at the port 5000.
+To do that, we can simply enter in the console in the project's root directory:
+
+\snippet /push-notifications/commands 3
+
+Now we can look into the \e push-notification browser application, which is based on
+\l {WebEngine Notifications Example}:
+
+\quotefromfile webenginewidgets/push-notifications/main.cpp
+\skipto main
+\printuntil app.exec
+\printuntil }
+
+This application simply opens the page at \c http:\\localhost:5000. We are not going into detail
+about how to open a notification as it is documented \l {WebEngine Notifications Example}{here}.
+However, you need to modify the application in two ways. First, \c QWebEngineProfile cannot be
+set to \e off-the-record because push messaging would be disabled. Therefore, as you can see
+above, \c QWebEngineProfile is initialized with the name. Second, you need to enable push
+messaging with the call QWebEngineProfile::setPushServiceEnabled for the created \c profile.
+
+When the application runs it displays:
+
+\image website.png
+
+After granting the permission we can send our ping request:
+
+\image permissions.png
+
+We should see the coming push notification:
+
+\image notification.png
+
+*/
diff --git a/examples/webenginewidgets/push-notifications/doc/src/push-notifications.qmodel b/examples/webenginewidgets/push-notifications/doc/src/push-notifications.qmodel
new file mode 100644
index 000000000..048a55911
--- /dev/null
+++ b/examples/webenginewidgets/push-notifications/doc/src/push-notifications.qmodel
@@ -0,0 +1,837 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<qmt>
+ <project>
+ <uid>{9fd14f7e-7b67-4e13-9980-ef8fbe24b780}</uid>
+ <root-package>
+ <instance>
+ <MPackage>
+ <base-MObject>
+ <MObject>
+ <base-MElement>
+ <MElement>
+ <uid>{a26e0efd-1b21-4fba-96ce-a607bbcdb4f7}</uid>
+ </MElement>
+ </base-MElement>
+ <name>push_notifications</name>
+ <children>
+ <handles>
+ <handles>
+ <qlist>
+ <item>
+ <handle>
+ <uid>{6b1a06e9-960b-4a10-872e-5504d8c0b127}</uid>
+ <target>
+ <instance type="MCanvasDiagram">
+ <MCanvasDiagram>
+ <base-MDiagram>
+ <MDiagram>
+ <base-MObject>
+ <MObject>
+ <base-MElement>
+ <MElement>
+ <uid>{6b1a06e9-960b-4a10-872e-5504d8c0b127}</uid>
+ </MElement>
+ </base-MElement>
+ <name>push_notifications</name>
+ </MObject>
+ </base-MObject>
+ <elements>
+ <qlist>
+ <item>
+ <instance type="DBoundary">
+ <DBoundary>
+ <base-DElement>
+ <DElement>
+ <uid>{d50762f2-c7f4-4d52-9592-8bcc07274ba1}</uid>
+ </DElement>
+ </base-DElement>
+ <text>Browser / User Agent</text>
+ <pos>x:415;y:390</pos>
+ <rect>x:-105;y:-125;w:210;h:250</rect>
+ </DBoundary>
+ </instance>
+ </item>
+ <item>
+ <instance type="DItem">
+ <DItem>
+ <base-DObject>
+ <DObject>
+ <base-DElement>
+ <DElement>
+ <uid>{cc80cad6-2e47-4913-aeb1-0c6f41de44bb}</uid>
+ </DElement>
+ </base-DElement>
+ <object>{121189af-36df-4efa-b451-3f1f85ef339f}</object>
+ <name>JavaScript Web Application</name>
+ <pos>x:410;y:395</pos>
+ <rect>x:-75;y:-15;w:150;h:30</rect>
+ <visual-role>0</visual-role>
+ </DObject>
+ </base-DObject>
+ <shape-editable>false</shape-editable>
+ </DItem>
+ </instance>
+ </item>
+ <item>
+ <instance type="DItem">
+ <DItem>
+ <base-DObject>
+ <DObject>
+ <base-DElement>
+ <DElement>
+ <uid>{8bde1815-304a-41f6-8528-c754dc3d1eda}</uid>
+ </DElement>
+ </base-DElement>
+ <object>{13c69399-5587-4169-a012-8d86216139fd}</object>
+ <name>Push Manager API</name>
+ <pos>x:410;y:320</pos>
+ <rect>x:-75;y:-15;w:150;h:30</rect>
+ <auto-sized>false</auto-sized>
+ <visual-role>0</visual-role>
+ </DObject>
+ </base-DObject>
+ <shape-editable>false</shape-editable>
+ </DItem>
+ </instance>
+ </item>
+ <item>
+ <instance type="DItem">
+ <DItem>
+ <base-DObject>
+ <DObject>
+ <base-DElement>
+ <DElement>
+ <uid>{75431119-9e8e-4e3e-a539-9d7bad6dbf81}</uid>
+ </DElement>
+ </base-DElement>
+ <object>{3f1676be-d3a4-4751-8bcb-400b11c88ada}</object>
+ <name>Service Worker</name>
+ <pos>x:410;y:470</pos>
+ <rect>x:-75;y:-15;w:150;h:30</rect>
+ <auto-sized>false</auto-sized>
+ <visual-role>0</visual-role>
+ </DObject>
+ </base-DObject>
+ <shape-editable>false</shape-editable>
+ </DItem>
+ </instance>
+ </item>
+ <item>
+ <instance type="DDependency">
+ <DDependency>
+ <base-DRelation>
+ <DRelation>
+ <base-DElement>
+ <DElement>
+ <uid>{0a7b0146-d34b-4c39-a1af-df15a1b4108d}</uid>
+ </DElement>
+ </base-DElement>
+ <object>{648fd8d0-6f61-4cc9-b5ce-6c5b9057fe5d}</object>
+ <a>{cc80cad6-2e47-4913-aeb1-0c6f41de44bb}</a>
+ <b>{8bde1815-304a-41f6-8528-c754dc3d1eda}</b>
+ <name>subscribe</name>
+ </DRelation>
+ </base-DRelation>
+ </DDependency>
+ </instance>
+ </item>
+ <item>
+ <instance type="DDependency">
+ <DDependency>
+ <base-DRelation>
+ <DRelation>
+ <base-DElement>
+ <DElement>
+ <uid>{e7d4a675-ddbd-41aa-a802-32221a56dae2}</uid>
+ </DElement>
+ </base-DElement>
+ <object>{afae2401-ea81-4514-aa80-da53d61a8516}</object>
+ <a>{cc80cad6-2e47-4913-aeb1-0c6f41de44bb}</a>
+ <b>{75431119-9e8e-4e3e-a539-9d7bad6dbf81}</b>
+ <name>register</name>
+ </DRelation>
+ </base-DRelation>
+ </DDependency>
+ </instance>
+ </item>
+ <item>
+ <instance type="DItem">
+ <DItem>
+ <base-DObject>
+ <DObject>
+ <base-DElement>
+ <DElement>
+ <uid>{998e7d36-3416-4b2f-843a-a437449f09f1}</uid>
+ </DElement>
+ </base-DElement>
+ <object>{5a7b90ea-801e-43ea-a0b5-edaa59761b5b}</object>
+ <name>Firebase Cloud Messaging </name>
+ <pos>x:770;y:320</pos>
+ <rect>x:-75;y:-15;w:150;h:30</rect>
+ <visual-role>6</visual-role>
+ </DObject>
+ </base-DObject>
+ <shape-editable>false</shape-editable>
+ </DItem>
+ </instance>
+ </item>
+ <item>
+ <instance type="DDependency">
+ <DDependency>
+ <base-DRelation>
+ <DRelation>
+ <base-DElement>
+ <DElement>
+ <uid>{28c1fccd-c50e-458c-865d-4ba41d55690b}</uid>
+ </DElement>
+ </base-DElement>
+ <object>{d9959769-74a4-40ad-bf00-904c12a67309}</object>
+ <a>{8bde1815-304a-41f6-8528-c754dc3d1eda}</a>
+ <b>{998e7d36-3416-4b2f-843a-a437449f09f1}</b>
+ <name>create subscription</name>
+ </DRelation>
+ </base-DRelation>
+ <direction>2</direction>
+ </DDependency>
+ </instance>
+ </item>
+ <item>
+ <instance type="DItem">
+ <DItem>
+ <base-DObject>
+ <DObject>
+ <base-DElement>
+ <DElement>
+ <uid>{ba581e41-cc00-4129-adae-0a1208bb3222}</uid>
+ </DElement>
+ </base-DElement>
+ <object>{13d79379-1727-46a3-947c-e3f2f6eb3a87}</object>
+ <name>Push Application Server</name>
+ <pos>x:770;y:390</pos>
+ <rect>x:-75;y:-15;w:150;h:30</rect>
+ <auto-sized>false</auto-sized>
+ <visual-role>6</visual-role>
+ </DObject>
+ </base-DObject>
+ <shape-editable>false</shape-editable>
+ </DItem>
+ </instance>
+ </item>
+ <item>
+ <instance type="DDependency">
+ <DDependency>
+ <base-DRelation>
+ <DRelation>
+ <base-DElement>
+ <DElement>
+ <uid>{e796d1cc-f574-45db-a440-7e47d7560d71}</uid>
+ </DElement>
+ </base-DElement>
+ <object>{373c492c-0b9a-4032-9ff4-b3a7cc442883}</object>
+ <a>{cc80cad6-2e47-4913-aeb1-0c6f41de44bb}</a>
+ <b>{ba581e41-cc00-4129-adae-0a1208bb3222}</b>
+ <name>subscribe with endpoint</name>
+ </DRelation>
+ </base-DRelation>
+ </DDependency>
+ </instance>
+ </item>
+ <item>
+ <instance type="DDependency">
+ <DDependency>
+ <base-DRelation>
+ <DRelation>
+ <base-DElement>
+ <DElement>
+ <uid>{6332f8ae-ef9d-4c15-9fbf-d6ee06ba3f84}</uid>
+ </DElement>
+ </base-DElement>
+ <object>{94241d64-4e88-4855-8e78-365be237108b}</object>
+ <a>{ba581e41-cc00-4129-adae-0a1208bb3222}</a>
+ <b>{998e7d36-3416-4b2f-843a-a437449f09f1}</b>
+ <name>push notification</name>
+ <points>
+ <qlist>
+ <item>
+ <DRelation--IntermediatePoint>
+ <pos>x:770;y:335</pos>
+ </DRelation--IntermediatePoint>
+ </item>
+ </qlist>
+ </points>
+ </DRelation>
+ </base-DRelation>
+ </DDependency>
+ </instance>
+ </item>
+ <item>
+ <instance type="DItem">
+ <DItem>
+ <base-DObject>
+ <DObject>
+ <base-DElement>
+ <DElement>
+ <uid>{582af542-5f2d-4660-a6d0-a3bd983d9682}</uid>
+ </DElement>
+ </base-DElement>
+ <object>{00b8f12d-e08b-426a-83b8-83fea8907fab}</object>
+ <name>User</name>
+ <pos>x:185;y:395</pos>
+ <rect>x:-10;y:-20;w:20;h:40</rect>
+ <visual-role>0</visual-role>
+ </DObject>
+ </base-DObject>
+ <variety>actor</variety>
+ <shape-editable>false</shape-editable>
+ </DItem>
+ </instance>
+ </item>
+ <item>
+ <instance type="DDependency">
+ <DDependency>
+ <base-DRelation>
+ <DRelation>
+ <base-DElement>
+ <DElement>
+ <uid>{66ca12e1-84a1-4247-82e5-ae6891f3f376}</uid>
+ </DElement>
+ </base-DElement>
+ <object>{6d0ce78f-28e1-4a82-a443-59f4efcb8e66}</object>
+ <a>{582af542-5f2d-4660-a6d0-a3bd983d9682}</a>
+ <b>{cc80cad6-2e47-4913-aeb1-0c6f41de44bb}</b>
+ <name>subscribe</name>
+ </DRelation>
+ </base-DRelation>
+ </DDependency>
+ </instance>
+ </item>
+ <item>
+ <instance type="DDependency">
+ <DDependency>
+ <base-DRelation>
+ <DRelation>
+ <base-DElement>
+ <DElement>
+ <uid>{7657479a-a855-4d97-8c61-098690da9023}</uid>
+ </DElement>
+ </base-DElement>
+ <object>{eef542f5-e2cf-40a8-92c9-9892f3d06e1f}</object>
+ <a>{75431119-9e8e-4e3e-a539-9d7bad6dbf81}</a>
+ <b>{582af542-5f2d-4660-a6d0-a3bd983d9682}</b>
+ <name>notify</name>
+ <points>
+ <qlist>
+ <item>
+ <DRelation--IntermediatePoint>
+ <pos>x:340;y:430</pos>
+ </DRelation--IntermediatePoint>
+ </item>
+ </qlist>
+ </points>
+ </DRelation>
+ </base-DRelation>
+ </DDependency>
+ </instance>
+ </item>
+ <item>
+ <instance type="DDependency">
+ <DDependency>
+ <base-DRelation>
+ <DRelation>
+ <base-DElement>
+ <DElement>
+ <uid>{97f3e5b0-93ca-4351-98d6-ad88567979f7}</uid>
+ </DElement>
+ </base-DElement>
+ <object>{963ad9f9-ecad-430f-8233-b7897fa630bd}</object>
+ <a>{75431119-9e8e-4e3e-a539-9d7bad6dbf81}</a>
+ <b>{998e7d36-3416-4b2f-843a-a437449f09f1}</b>
+ <name>push notification</name>
+ <points>
+ <qlist>
+ <item>
+ <DRelation--IntermediatePoint>
+ <pos>x:535;y:470</pos>
+ </DRelation--IntermediatePoint>
+ </item>
+ <item>
+ <DRelation--IntermediatePoint>
+ <pos>x:590;y:470</pos>
+ </DRelation--IntermediatePoint>
+ </item>
+ <item>
+ <DRelation--IntermediatePoint>
+ <pos>x:615;y:470</pos>
+ </DRelation--IntermediatePoint>
+ </item>
+ <item>
+ <DRelation--IntermediatePoint>
+ <pos>x:670;y:470</pos>
+ </DRelation--IntermediatePoint>
+ </item>
+ <item>
+ <DRelation--IntermediatePoint>
+ <pos>x:670;y:365</pos>
+ </DRelation--IntermediatePoint>
+ </item>
+ </qlist>
+ </points>
+ </DRelation>
+ </base-DRelation>
+ <direction>1</direction>
+ </DDependency>
+ </instance>
+ </item>
+ </qlist>
+ </elements>
+ <last-modified>1665083804306</last-modified>
+ <toolbarid>UseCases</toolbarid>
+ </MDiagram>
+ </base-MDiagram>
+ </MCanvasDiagram>
+ </instance>
+ </target>
+ </handle>
+ </item>
+ <item>
+ <handle>
+ <uid>{121189af-36df-4efa-b451-3f1f85ef339f}</uid>
+ <target>
+ <instance type="MItem">
+ <MItem>
+ <base-MObject>
+ <MObject>
+ <base-MElement>
+ <MElement>
+ <uid>{121189af-36df-4efa-b451-3f1f85ef339f}</uid>
+ </MElement>
+ </base-MElement>
+ <name>JavaScript Web Application</name>
+ <relations>
+ <handles>
+ <handles>
+ <qlist>
+ <item>
+ <handle>
+ <uid>{648fd8d0-6f61-4cc9-b5ce-6c5b9057fe5d}</uid>
+ <target>
+ <instance type="MDependency">
+ <MDependency>
+ <base-MRelation>
+ <MRelation>
+ <base-MElement>
+ <MElement>
+ <uid>{648fd8d0-6f61-4cc9-b5ce-6c5b9057fe5d}</uid>
+ </MElement>
+ </base-MElement>
+ <name>subscribe</name>
+ <a>{121189af-36df-4efa-b451-3f1f85ef339f}</a>
+ <b>{13c69399-5587-4169-a012-8d86216139fd}</b>
+ </MRelation>
+ </base-MRelation>
+ </MDependency>
+ </instance>
+ </target>
+ </handle>
+ </item>
+ <item>
+ <handle>
+ <uid>{afae2401-ea81-4514-aa80-da53d61a8516}</uid>
+ <target>
+ <instance type="MDependency">
+ <MDependency>
+ <base-MRelation>
+ <MRelation>
+ <base-MElement>
+ <MElement>
+ <uid>{afae2401-ea81-4514-aa80-da53d61a8516}</uid>
+ </MElement>
+ </base-MElement>
+ <name>register</name>
+ <a>{121189af-36df-4efa-b451-3f1f85ef339f}</a>
+ <b>{3f1676be-d3a4-4751-8bcb-400b11c88ada}</b>
+ </MRelation>
+ </base-MRelation>
+ </MDependency>
+ </instance>
+ </target>
+ </handle>
+ </item>
+ <item>
+ <handle>
+ <uid>{373c492c-0b9a-4032-9ff4-b3a7cc442883}</uid>
+ <target>
+ <instance type="MDependency">
+ <MDependency>
+ <base-MRelation>
+ <MRelation>
+ <base-MElement>
+ <MElement>
+ <uid>{373c492c-0b9a-4032-9ff4-b3a7cc442883}</uid>
+ </MElement>
+ </base-MElement>
+ <name>subscribe with endpoint</name>
+ <a>{121189af-36df-4efa-b451-3f1f85ef339f}</a>
+ <b>{13d79379-1727-46a3-947c-e3f2f6eb3a87}</b>
+ </MRelation>
+ </base-MRelation>
+ </MDependency>
+ </instance>
+ </target>
+ </handle>
+ </item>
+ </qlist>
+ </handles>
+ </handles>
+ </relations>
+ </MObject>
+ </base-MObject>
+ </MItem>
+ </instance>
+ </target>
+ </handle>
+ </item>
+ <item>
+ <handle>
+ <uid>{13c69399-5587-4169-a012-8d86216139fd}</uid>
+ <target>
+ <instance type="MItem">
+ <MItem>
+ <base-MObject>
+ <MObject>
+ <base-MElement>
+ <MElement>
+ <uid>{13c69399-5587-4169-a012-8d86216139fd}</uid>
+ </MElement>
+ </base-MElement>
+ <name>Push Manager API</name>
+ <relations>
+ <handles>
+ <handles>
+ <qlist>
+ <item>
+ <handle>
+ <uid>{d9959769-74a4-40ad-bf00-904c12a67309}</uid>
+ <target>
+ <instance type="MDependency">
+ <MDependency>
+ <base-MRelation>
+ <MRelation>
+ <base-MElement>
+ <MElement>
+ <uid>{d9959769-74a4-40ad-bf00-904c12a67309}</uid>
+ </MElement>
+ </base-MElement>
+ <name>create subscription</name>
+ <a>{13c69399-5587-4169-a012-8d86216139fd}</a>
+ <b>{5a7b90ea-801e-43ea-a0b5-edaa59761b5b}</b>
+ </MRelation>
+ </base-MRelation>
+ <direction>2</direction>
+ </MDependency>
+ </instance>
+ </target>
+ </handle>
+ </item>
+ </qlist>
+ </handles>
+ </handles>
+ </relations>
+ </MObject>
+ </base-MObject>
+ </MItem>
+ </instance>
+ </target>
+ </handle>
+ </item>
+ <item>
+ <handle>
+ <uid>{3f1676be-d3a4-4751-8bcb-400b11c88ada}</uid>
+ <target>
+ <instance type="MItem">
+ <MItem>
+ <base-MObject>
+ <MObject>
+ <base-MElement>
+ <MElement>
+ <uid>{3f1676be-d3a4-4751-8bcb-400b11c88ada}</uid>
+ </MElement>
+ </base-MElement>
+ <name>Service Worker</name>
+ <relations>
+ <handles>
+ <handles>
+ <qlist>
+ <item>
+ <handle>
+ <uid>{bfebbc32-3541-4c1a-b3c6-a3652f700767}</uid>
+ <target>
+ <instance type="MDependency">
+ <MDependency>
+ <base-MRelation>
+ <MRelation>
+ <base-MElement>
+ <MElement>
+ <uid>{bfebbc32-3541-4c1a-b3c6-a3652f700767}</uid>
+ </MElement>
+ </base-MElement>
+ <name>push notification</name>
+ <a>{3f1676be-d3a4-4751-8bcb-400b11c88ada}</a>
+ <b>{5a7b90ea-801e-43ea-a0b5-edaa59761b5b}</b>
+ </MRelation>
+ </base-MRelation>
+ <direction>1</direction>
+ </MDependency>
+ </instance>
+ </target>
+ </handle>
+ </item>
+ <item>
+ <handle>
+ <uid>{89d5f886-1913-4bb7-be32-cdd5cb61eebc}</uid>
+ <target>
+ <instance type="MDependency">
+ <MDependency>
+ <base-MRelation>
+ <MRelation>
+ <base-MElement>
+ <MElement>
+ <uid>{89d5f886-1913-4bb7-be32-cdd5cb61eebc}</uid>
+ </MElement>
+ </base-MElement>
+ <name>notify</name>
+ <a>{3f1676be-d3a4-4751-8bcb-400b11c88ada}</a>
+ <b>{00b8f12d-e08b-426a-83b8-83fea8907fab}</b>
+ </MRelation>
+ </base-MRelation>
+ </MDependency>
+ </instance>
+ </target>
+ </handle>
+ </item>
+ <item>
+ <handle>
+ <uid>{eef542f5-e2cf-40a8-92c9-9892f3d06e1f}</uid>
+ <target>
+ <instance type="MDependency">
+ <MDependency>
+ <base-MRelation>
+ <MRelation>
+ <base-MElement>
+ <MElement>
+ <uid>{eef542f5-e2cf-40a8-92c9-9892f3d06e1f}</uid>
+ </MElement>
+ </base-MElement>
+ <name>notify</name>
+ <a>{3f1676be-d3a4-4751-8bcb-400b11c88ada}</a>
+ <b>{00b8f12d-e08b-426a-83b8-83fea8907fab}</b>
+ </MRelation>
+ </base-MRelation>
+ </MDependency>
+ </instance>
+ </target>
+ </handle>
+ </item>
+ <item>
+ <handle>
+ <uid>{963ad9f9-ecad-430f-8233-b7897fa630bd}</uid>
+ <target>
+ <instance type="MDependency">
+ <MDependency>
+ <base-MRelation>
+ <MRelation>
+ <base-MElement>
+ <MElement>
+ <uid>{963ad9f9-ecad-430f-8233-b7897fa630bd}</uid>
+ </MElement>
+ </base-MElement>
+ <name>push notification</name>
+ <a>{3f1676be-d3a4-4751-8bcb-400b11c88ada}</a>
+ <b>{5a7b90ea-801e-43ea-a0b5-edaa59761b5b}</b>
+ </MRelation>
+ </base-MRelation>
+ <direction>1</direction>
+ </MDependency>
+ </instance>
+ </target>
+ </handle>
+ </item>
+ </qlist>
+ </handles>
+ </handles>
+ </relations>
+ </MObject>
+ </base-MObject>
+ </MItem>
+ </instance>
+ </target>
+ </handle>
+ </item>
+ <item>
+ <handle>
+ <uid>{5a7b90ea-801e-43ea-a0b5-edaa59761b5b}</uid>
+ <target>
+ <instance type="MItem">
+ <MItem>
+ <base-MObject>
+ <MObject>
+ <base-MElement>
+ <MElement>
+ <uid>{5a7b90ea-801e-43ea-a0b5-edaa59761b5b}</uid>
+ </MElement>
+ </base-MElement>
+ <name>Firebase Cloud Messaging </name>
+ <relations>
+ <handles>
+ <handles>
+ <qlist>
+ <item>
+ <handle>
+ <uid>{560fb941-261e-4f45-8909-2106283fdb3e}</uid>
+ <target>
+ <instance type="MDependency">
+ <MDependency>
+ <base-MRelation>
+ <MRelation>
+ <base-MElement>
+ <MElement>
+ <uid>{560fb941-261e-4f45-8909-2106283fdb3e}</uid>
+ </MElement>
+ </base-MElement>
+ <a>{5a7b90ea-801e-43ea-a0b5-edaa59761b5b}</a>
+ <b>{13c69399-5587-4169-a012-8d86216139fd}</b>
+ </MRelation>
+ </base-MRelation>
+ </MDependency>
+ </instance>
+ </target>
+ </handle>
+ </item>
+ </qlist>
+ </handles>
+ </handles>
+ </relations>
+ </MObject>
+ </base-MObject>
+ </MItem>
+ </instance>
+ </target>
+ </handle>
+ </item>
+ <item>
+ <handle>
+ <uid>{13d79379-1727-46a3-947c-e3f2f6eb3a87}</uid>
+ <target>
+ <instance type="MItem">
+ <MItem>
+ <base-MObject>
+ <MObject>
+ <base-MElement>
+ <MElement>
+ <uid>{13d79379-1727-46a3-947c-e3f2f6eb3a87}</uid>
+ </MElement>
+ </base-MElement>
+ <name>Push Application Server</name>
+ <relations>
+ <handles>
+ <handles>
+ <qlist>
+ <item>
+ <handle>
+ <uid>{94241d64-4e88-4855-8e78-365be237108b}</uid>
+ <target>
+ <instance type="MDependency">
+ <MDependency>
+ <base-MRelation>
+ <MRelation>
+ <base-MElement>
+ <MElement>
+ <uid>{94241d64-4e88-4855-8e78-365be237108b}</uid>
+ </MElement>
+ </base-MElement>
+ <name>push notification</name>
+ <a>{13d79379-1727-46a3-947c-e3f2f6eb3a87}</a>
+ <b>{5a7b90ea-801e-43ea-a0b5-edaa59761b5b}</b>
+ </MRelation>
+ </base-MRelation>
+ </MDependency>
+ </instance>
+ </target>
+ </handle>
+ </item>
+ </qlist>
+ </handles>
+ </handles>
+ </relations>
+ </MObject>
+ </base-MObject>
+ </MItem>
+ </instance>
+ </target>
+ </handle>
+ </item>
+ <item>
+ <handle>
+ <uid>{00b8f12d-e08b-426a-83b8-83fea8907fab}</uid>
+ <target>
+ <instance type="MItem">
+ <MItem>
+ <base-MObject>
+ <MObject>
+ <base-MElement>
+ <MElement>
+ <uid>{00b8f12d-e08b-426a-83b8-83fea8907fab}</uid>
+ </MElement>
+ </base-MElement>
+ <name>User</name>
+ <relations>
+ <handles>
+ <handles>
+ <qlist>
+ <item>
+ <handle>
+ <uid>{6d0ce78f-28e1-4a82-a443-59f4efcb8e66}</uid>
+ <target>
+ <instance type="MDependency">
+ <MDependency>
+ <base-MRelation>
+ <MRelation>
+ <base-MElement>
+ <MElement>
+ <uid>{6d0ce78f-28e1-4a82-a443-59f4efcb8e66}</uid>
+ </MElement>
+ </base-MElement>
+ <name>subscribe</name>
+ <a>{00b8f12d-e08b-426a-83b8-83fea8907fab}</a>
+ <b>{121189af-36df-4efa-b451-3f1f85ef339f}</b>
+ </MRelation>
+ </base-MRelation>
+ </MDependency>
+ </instance>
+ </target>
+ </handle>
+ </item>
+ </qlist>
+ </handles>
+ </handles>
+ </relations>
+ </MObject>
+ </base-MObject>
+ <variety-editable>false</variety-editable>
+ <variety>actor</variety>
+ </MItem>
+ </instance>
+ </target>
+ </handle>
+ </item>
+ </qlist>
+ </handles>
+ </handles>
+ </children>
+ </MObject>
+ </base-MObject>
+ </MPackage>
+ </instance>
+ </root-package>
+ </project>
+</qmt>
diff --git a/examples/webenginewidgets/push-notifications/main.cpp b/examples/webenginewidgets/push-notifications/main.cpp
new file mode 100644
index 000000000..18a862182
--- /dev/null
+++ b/examples/webenginewidgets/push-notifications/main.cpp
@@ -0,0 +1,41 @@
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include "notificationpopup.h"
+
+#include <QApplication>
+#include <QWebEngineProfile>
+#include <QWebEnginePage>
+#include <QWebEngineView>
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication::setOrganizationName("QtExamples");
+ QApplication app(argc, argv);
+
+ const QString name =
+ QString::fromLatin1("push-notifications.%1").arg(qWebEngineChromiumVersion());
+
+ QScopedPointer<QWebEngineProfile> profile(new QWebEngineProfile(name));
+ QWebEngineView view(profile.data());
+ auto popup = new NotificationPopup(&view);
+
+ QObject::connect(view.page(), &QWebEnginePage::featurePermissionRequested,
+ [&](const QUrl &origin, QWebEnginePage::Feature feature) {
+ if (feature != QWebEnginePage::Notifications)
+ return;
+
+ view.page()->setFeaturePermission(origin, feature,
+ QWebEnginePage::PermissionGrantedByUser);
+ });
+
+ profile->setPushServiceEnabled(true);
+ profile->setNotificationPresenter([&](std::unique_ptr<QWebEngineNotification> notification) {
+ popup->present(notification);
+ });
+
+ view.resize(640, 480);
+ view.setUrl(QUrl("http://localhost:5000"));
+ view.show();
+ return app.exec();
+}
diff --git a/examples/webenginewidgets/push-notifications/notificationpopup.h b/examples/webenginewidgets/push-notifications/notificationpopup.h
new file mode 100644
index 000000000..cf53ded45
--- /dev/null
+++ b/examples/webenginewidgets/push-notifications/notificationpopup.h
@@ -0,0 +1,91 @@
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#pragma once
+
+#include <QHBoxLayout>
+#include <QLabel>
+#include <QMouseEvent>
+#include <QPushButton>
+#include <QSpacerItem>
+#include <QTimer>
+#include <QVBoxLayout>
+#include <QWebEngineNotification>
+
+#include <memory>
+
+class NotificationPopup : public QWidget
+{
+ Q_OBJECT
+
+ QLabel m_icon, m_title, m_message;
+ std::unique_ptr<QWebEngineNotification> notification;
+
+public:
+ NotificationPopup(QWidget *parent) : QWidget(parent)
+ {
+ setWindowFlags(Qt::ToolTip);
+ auto rootLayout = new QHBoxLayout(this);
+
+ rootLayout->addWidget(&m_icon);
+
+ auto bodyLayout = new QVBoxLayout;
+ rootLayout->addLayout(bodyLayout);
+
+ auto titleLayout = new QHBoxLayout;
+ bodyLayout->addLayout(titleLayout);
+
+ titleLayout->addWidget(&m_title);
+ titleLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding));
+
+ auto close = new QPushButton(tr("Close"));
+ titleLayout->addWidget(close);
+ connect(close, &QPushButton::clicked, this, &NotificationPopup::onClosed);
+
+ bodyLayout->addWidget(&m_message);
+ adjustSize();
+ }
+
+ void present(std::unique_ptr<QWebEngineNotification> &newNotification)
+ {
+ if (notification) {
+ notification->close();
+ notification.reset();
+ }
+
+ notification.swap(newNotification);
+
+ m_title.setText("<b>" + notification->title() + "</b>");
+ m_message.setText(notification->message());
+ m_icon.setPixmap(QPixmap(":/icon.png").scaledToHeight(m_icon.height()));
+
+ show();
+ notification->show();
+
+ connect(notification.get(), &QWebEngineNotification::closed, this,
+ &NotificationPopup::onClosed);
+ QTimer::singleShot(10000, notification.get(), [&]() { onClosed(); });
+
+ // position our popup in the right corner of its parent widget
+ move(parentWidget()->mapToGlobal(parentWidget()->rect().bottomRight()
+ - QPoint(width() + 10, height() + 10)));
+ }
+
+protected slots:
+ void onClosed()
+ {
+ hide();
+ notification->close();
+ notification.reset();
+ }
+
+protected:
+ void mouseReleaseEvent(QMouseEvent *event) override
+ {
+ QWidget::mouseReleaseEvent(event);
+ if (notification && event->button() == Qt::LeftButton) {
+ notification->click();
+ onClosed();
+ }
+ }
+};
diff --git a/examples/webenginewidgets/push-notifications/push-notifications.pro b/examples/webenginewidgets/push-notifications/push-notifications.pro
new file mode 100644
index 000000000..5ffb85fd7
--- /dev/null
+++ b/examples/webenginewidgets/push-notifications/push-notifications.pro
@@ -0,0 +1,10 @@
+QT += webenginewidgets
+
+HEADERS = notificationpopup.h
+
+SOURCES = main.cpp
+
+RESOURCES = data/data.qrc
+
+target.path = $$[QT_INSTALL_EXAMPLES]/webenginewidgets/push-notifications
+INSTALLS += target
diff --git a/examples/webenginewidgets/push-notifications/server.js b/examples/webenginewidgets/push-notifications/server.js
new file mode 100644
index 000000000..fc7deb08a
--- /dev/null
+++ b/examples/webenginewidgets/push-notifications/server.js
@@ -0,0 +1,65 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+const express = require('express');
+const webpush = require('web-push');
+
+// setup server
+const port = 5000;
+const server = express();
+server.use(express.json());
+server.use(express.static('content'));
+
+// we support only one subscription at the time
+var subscription = null;
+
+// setup vapid keys
+const vapidKeys = {
+ publicKey :
+ "BNO4fIv439RpvbReeABNlDNiiBD2Maykn7EVnwsPseH7-P5hjnzZLEfnejXVP7Zt6MFoKqKeHm4nV9BHvbgoRPg",
+ privateKey : "HqhrzsRfG5-SB3j45lyUmV7cYZuy-71r2Bb0tgaOefk"
+};
+
+// set vapid keys for webpush libs
+webpush.setVapidDetails('mailto:push@qt.io', vapidKeys.publicKey, vapidKeys.privateKey);
+
+// add subscribe route
+server.post('/subscribe', (req, res) => {
+
+ // subscription request
+ subscription = req.body;
+ const delay = req.headers['ping-time'];
+ console.log('Got subscription with endpoint: ' + subscription.endpoint);
+ console.log('Ping delay is at: ' + delay);
+
+ // confirm resource created
+ res.status(201).json({});
+
+ // schedule notification
+ setTimeout(() => { sendNotification(delay) }, delay * 1000);
+});
+
+// add unsubscribe route
+server.post('/unsubscribe', (req, res) => {
+ console.log('Got unsubscribe with endpoint: ' + req.body.endpoint);
+ subscription = null;
+ res.status(201).json({});
+});
+
+function sendNotification(delay)
+{
+ if (!subscription)
+ return;
+
+ // create payload text
+ const payload = JSON.stringify({ title : 'Ping !', text : 'Visit qt.io', url : 'www.qt.io' });
+
+ // send notification
+ console.log('Sending notification !');
+ webpush.sendNotification(subscription, payload).catch(err => console.error(err));
+
+ // schedule next notification
+ setTimeout(() => { sendNotification(delay) }, delay * 1000);
+}
+
+server.listen(port, () => console.log(`Push server started at port ${port}`));
diff --git a/examples/webenginewidgets/recipebrowser/CMakeLists.txt b/examples/webenginewidgets/recipebrowser/CMakeLists.txt
new file mode 100644
index 000000000..ef858616e
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/CMakeLists.txt
@@ -0,0 +1,76 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+project(recipebrowser LANGUAGES CXX)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTOUIC ON)
+
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webenginewidgets/recipebrowser")
+
+find_package(Qt6 REQUIRED COMPONENTS Core Gui WebEngineWidgets)
+
+qt_add_executable(recipebrowser
+ main.cpp
+ mainwindow.cpp mainwindow.h mainwindow.ui
+ stylesheetdialog.cpp stylesheetdialog.h stylesheetdialog.ui
+ document.cpp document.h
+)
+
+set_target_properties(recipebrowser PROPERTIES
+ WIN32_EXECUTABLE TRUE
+ MACOSX_BUNDLE TRUE
+)
+
+target_link_libraries(recipebrowser PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::WebEngineWidgets
+)
+
+# Resources:
+set(recipebrowser_resource_files
+ "assets/3rdparty/markdown.css"
+ "assets/3rdparty/marked.js"
+ "assets/custom.css"
+ "assets/custom.js"
+ "assets/pages/burger.html"
+ "assets/pages/cupcakes.html"
+ "assets/pages/images/burger.jpg"
+ "assets/pages/images/cupcakes.jpg"
+ "assets/pages/images/pasta.jpg"
+ "assets/pages/images/pizza.jpg"
+ "assets/pages/images/skewers.jpg"
+ "assets/pages/images/soup.jpg"
+ "assets/pages/images/steak.jpg"
+ "assets/pages/pasta.html"
+ "assets/pages/pizza.html"
+ "assets/pages/skewers.html"
+ "assets/pages/soup.html"
+ "assets/pages/steak.html"
+ "assets/icons/edit.svg"
+ "assets/icons/stylesheets.svg"
+ "assets/icons/add.svg"
+ "assets/icons/remove.svg"
+ "assets/icons/view.svg"
+)
+
+qt_add_resources(recipebrowser "recipebrowser"
+ PREFIX
+ "/"
+ BASE
+ "assets"
+ FILES
+ ${recipebrowser_resource_files}
+)
+
+install(TARGETS recipebrowser
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/webengine/recipebrowser/resources/pages/assets/3rdparty/MARKDOWN-LICENSE.txt b/examples/webenginewidgets/recipebrowser/assets/3rdparty/MARKDOWN-LICENSE.txt
index 23c52cc43..23c52cc43 100644
--- a/examples/webengine/recipebrowser/resources/pages/assets/3rdparty/MARKDOWN-LICENSE.txt
+++ b/examples/webenginewidgets/recipebrowser/assets/3rdparty/MARKDOWN-LICENSE.txt
diff --git a/examples/webengine/recipebrowser/resources/pages/assets/3rdparty/MARKED-LICENSE.txt b/examples/webenginewidgets/recipebrowser/assets/3rdparty/MARKED-LICENSE.txt
index 8e3ba0e0a..8e3ba0e0a 100644
--- a/examples/webengine/recipebrowser/resources/pages/assets/3rdparty/MARKED-LICENSE.txt
+++ b/examples/webenginewidgets/recipebrowser/assets/3rdparty/MARKED-LICENSE.txt
diff --git a/examples/webengine/recipebrowser/resources/pages/assets/3rdparty/markdown.css b/examples/webenginewidgets/recipebrowser/assets/3rdparty/markdown.css
index 24fc2ffe2..24fc2ffe2 100644
--- a/examples/webengine/recipebrowser/resources/pages/assets/3rdparty/markdown.css
+++ b/examples/webenginewidgets/recipebrowser/assets/3rdparty/markdown.css
diff --git a/examples/webengine/recipebrowser/resources/pages/assets/3rdparty/marked.js b/examples/webenginewidgets/recipebrowser/assets/3rdparty/marked.js
index 33c02d9cf..33c02d9cf 100644
--- a/examples/webengine/recipebrowser/resources/pages/assets/3rdparty/marked.js
+++ b/examples/webenginewidgets/recipebrowser/assets/3rdparty/marked.js
diff --git a/examples/webenginewidgets/recipebrowser/assets/3rdparty/qt_attribution.json b/examples/webenginewidgets/recipebrowser/assets/3rdparty/qt_attribution.json
new file mode 100644
index 000000000..f8b0fd023
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/assets/3rdparty/qt_attribution.json
@@ -0,0 +1,34 @@
+[
+ {
+ "Id" : "recipebrowser-marked",
+ "Name" : "Marked (WebEngine Recipe Browser example)",
+ "QDocModule" : "qtwebengine",
+ "QtUsage" : "Marked is used in the WebEngine Recipe Browser example",
+ "QtParts" : ["examples"],
+ "Files" : "marked.js",
+ "Description" :
+ "A full-featured markdown parser and compiler, written in JavaScript. Built for speed.",
+ "Homepage" : "https://github.com/chjj/marked",
+ "Version" : "0.4.0",
+ "DownloadLocation" : "https://github.com/markedjs/marked/blob/0.4.0/lib/marked.js",
+ "Copyright" : "Copyright (c) 2011-2018, Christopher Jeffrey",
+ "License" : "MIT License",
+ "LicenseId" : "MIT",
+ "LicenseFile" : "MARKED-LICENSE.txt"
+ },
+ {
+ "Id" : "recipebrowser-markdowncss",
+ "Name" : "Markdown.css (WebEngine Recipe Browser example)",
+ "QDocModule" : "qtwebengine",
+ "QtUsage" : "markdown.css is used in the WebEngine Recipe Browser example",
+ "QtParts" : ["examples"],
+ "Files" : "markdown.css",
+ "Description" : "Markdown.css is better default styling for your Markdown files.",
+ "Version" : "188530e4b5d020d7e237fc6b26be13ebf4a8def3",
+ "DownloadLocation" : "https://bitbucket.org/kevinburke/markdowncss/src/188530e4b5d020d7e237fc6b26be13ebf4a8def3/markdown.css",
+ "Copyright" : "Copyright 2011 Kevin Burke Copyright Twitter Inc.",
+ "License" : "Apache License 2.0",
+ "LicenseId" : "Apache-2.0",
+ "LicenseFile" : "MARKDOWN-LICENSE.txt"
+ }
+ ]
diff --git a/examples/webenginewidgets/recipebrowser/assets/custom.css b/examples/webenginewidgets/recipebrowser/assets/custom.css
new file mode 100644
index 000000000..cc1106af3
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/assets/custom.css
@@ -0,0 +1,28 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+body {
+ padding-top: 0;
+ margin-top: 0;
+}
+
+#content {
+ display: none;
+}
+
+img {
+ width: 100%;
+ height: 100%;
+}
+
+li {
+ margin-left: 25px;
+}
+
+ol li {
+ margin-bottom: 10px;
+}
+
+* {
+ max-width: 960px !important;
+}
diff --git a/examples/webenginewidgets/recipebrowser/assets/custom.js b/examples/webenginewidgets/recipebrowser/assets/custom.js
new file mode 100644
index 000000000..34470164e
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/assets/custom.js
@@ -0,0 +1,13 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+marked.setOptions({
+ renderer : new marked.Renderer(),
+ gfm : true,
+ tables : true,
+ breaks : false,
+ pedantic : false,
+ sanitize : false,
+ smartLists : true,
+ smartypants : false
+});
diff --git a/examples/webenginewidgets/recipebrowser/assets/icons/add.svg b/examples/webenginewidgets/recipebrowser/assets/icons/add.svg
new file mode 100644
index 000000000..b5ecf9ae2
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/assets/icons/add.svg
@@ -0,0 +1,4 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z" fill="#0D0D0D"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M11 15C11 15.5523 11.4477 16 12 16C12.5523 16 13 15.5523 13 15V13H15C15.5523 13 16 12.5523 16 12C16 11.4477 15.5523 11 15 11H13V9C13 8.44772 12.5523 8 12 8C11.4477 8 11 8.44772 11 9V11H9C8.44772 11 8 11.4477 8 12C8 12.5523 8.44772 13 9 13H11V15Z" fill="#0D0D0D"/>
+</svg>
diff --git a/examples/webenginewidgets/recipebrowser/assets/icons/edit.svg b/examples/webenginewidgets/recipebrowser/assets/icons/edit.svg
new file mode 100644
index 000000000..fe61445dc
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/assets/icons/edit.svg
@@ -0,0 +1,4 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M2 5C2 3.34315 3.34315 2 5 2H11C11.5523 2 12 2.44772 12 3C12 3.55228 11.5523 4 11 4H5C4.44772 4 4 4.44772 4 5V19C4 19.5523 4.44772 20 5 20H19C19.5523 20 20 19.5523 20 19V13.125C20 12.5727 20.4477 12.125 21 12.125C21.5523 12.125 22 12.5727 22 13.125V19C22 20.6569 20.6569 22 19 22H5C3.34315 22 2 20.6569 2 19V5Z" fill="#0D0D0D"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M19.1974 4C18.9845 4 18.7803 4.08457 18.6298 4.23509L18.1941 4.6708L19.3116 5.82359L19.7649 5.37021C19.9155 5.21969 20 5.01553 20 4.80265C20 4.58978 19.9155 4.38562 19.7649 4.23509C19.6144 4.08457 19.4102 4 19.1974 4ZM17.8972 7.23797L16.7797 6.08518L10.7528 12.1121L10.3744 13.6256L11.8879 13.2473L17.8972 7.23797ZM17.2156 2.82088C17.7412 2.29528 18.4541 2 19.1974 2C19.9407 2 20.6535 2.29528 21.1791 2.82088C21.7047 3.34648 22 4.05934 22 4.80265C22 5.54596 21.7047 6.25883 21.1791 6.78443L13.1062 14.8573C12.9781 14.9855 12.8175 15.0764 12.6417 15.1204L9.24256 15.9701C8.90178 16.0553 8.54129 15.9555 8.29291 15.7071C8.04453 15.4587 7.94468 15.0982 8.02988 14.7575L8.87966 11.3583C8.92362 11.1825 9.01453 11.0219 9.14269 10.8938L17.2156 2.82088Z" fill="#0D0D0D"/>
+</svg>
diff --git a/examples/webenginewidgets/recipebrowser/assets/icons/remove.svg b/examples/webenginewidgets/recipebrowser/assets/icons/remove.svg
new file mode 100644
index 000000000..3a5a420ac
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/assets/icons/remove.svg
@@ -0,0 +1,4 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z" fill="#0D0D0D"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M8 12C8 11.4477 8.44772 11 9 11H15C15.5523 11 16 11.4477 16 12C16 12.5523 15.5523 13 15 13H9C8.44772 13 8 12.5523 8 12Z" fill="#0D0D0D"/>
+</svg>
diff --git a/examples/webenginewidgets/recipebrowser/assets/icons/stylesheets.svg b/examples/webenginewidgets/recipebrowser/assets/icons/stylesheets.svg
new file mode 100644
index 000000000..e108265b7
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/assets/icons/stylesheets.svg
@@ -0,0 +1,4 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z" fill="#0D0D0D"/>
+<path d="M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22V2Z" fill="#0D0D0D"/>
+</svg>
diff --git a/examples/webenginewidgets/recipebrowser/assets/icons/view.svg b/examples/webenginewidgets/recipebrowser/assets/icons/view.svg
new file mode 100644
index 000000000..d2c0c474d
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/assets/icons/view.svg
@@ -0,0 +1,4 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M2.08086 11.6061C2.99143 9.48143 5.39011 4 12 4C15.2544 4 17.4247 5.25776 18.9399 6.87988C20.1459 8.17094 20.9403 9.71187 21.5334 10.8623C21.657 11.102 21.7719 11.3248 21.8799 11.5249L22.1676 12.0576L21.8289 12.5595C21.6963 12.7559 21.5424 13 21.3672 13.2781C20.7396 14.2738 19.8378 15.7048 18.6548 16.9413C17.1043 18.5619 14.9479 20 12 20C9.06156 20 6.9144 18.6096 5.36163 17.0026C4.11775 15.7152 3.19708 14.2194 2.55058 13.1691C2.40657 12.9351 2.27617 12.7233 2.15883 12.5408L1.8717 12.0941L2.08086 11.6061ZM4.12801 11.9149C4.18383 12.0048 4.24056 12.0967 4.29832 12.1903C4.94628 13.2397 5.72401 14.4993 6.79992 15.6128C8.10869 16.9673 9.76922 18 12 18C14.2213 18 15.8899 16.9381 17.2097 15.5587C18.2362 14.4858 18.9795 13.3089 19.6021 12.323C19.6836 12.194 19.7631 12.0682 19.8408 11.9464C19.7982 11.8645 19.7554 11.782 19.7124 11.6989C19.1185 10.5529 18.4761 9.31319 17.4784 8.24512C16.308 6.99224 14.6533 6 12 6C7.15387 6 5.13812 9.64957 4.12801 11.9149Z" fill="#0D0D0D"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M12 10C10.8954 10 10 10.8954 10 12C10 13.1046 10.8954 14 12 14C13.1046 14 14 13.1046 14 12C14 10.8954 13.1046 10 12 10ZM8 12C8 9.79086 9.79086 8 12 8C14.2091 8 16 9.79086 16 12C16 14.2091 14.2091 16 12 16C9.79086 16 8 14.2091 8 12Z" fill="#0D0D0D"/>
+</svg>
diff --git a/examples/webenginewidgets/recipebrowser/assets/pages/burger.html b/examples/webenginewidgets/recipebrowser/assets/pages/burger.html
new file mode 100644
index 000000000..99497959f
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/assets/pages/burger.html
@@ -0,0 +1,96 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>Insanity Burger</title>
+ <link rel="stylesheet" type="text/css" href="../3rdparty/markdown.css">
+ <link rel="stylesheet" type="text/css" href="../custom.css">
+ <script src="../3rdparty/marked.js"></script>
+ <script src="../custom.js"></script>
+ <script src="qrc:/qtwebchannel/qwebchannel.js"></script>
+</head>
+<body>
+ <div id="placeholder"></div>
+ <div id="content">
+
+<img src="images/burger.jpg" alt="Insanity Burger" title="Insanity Burger" />
+
+Insanity burger
+===============
+
+### Ingredients
+
+* 800 g minced chuck steak
+* olive oil
+* 1 large red onion
+* 1 splash of white wine vinegar
+* 2 large gherkins
+* 4 sesame-topped brioche burger buns
+* 4-8 rashers of smoked streaky bacon
+* 4 teaspoons American mustard
+* Tabasco Chipotle sauce
+* 4 thin slices of Red Leicester cheese
+* 4 teaspoons tomato ketchup
+
+#### For the burger sauce
+* ¼ of an iceberg lettuce
+* 2 heaped tablespoons mayonnaise
+* 1 heaped tablespoon tomato ketchup
+* 1 teaspoon Tabasco Chipotle sauce
+* 1 teaspoon Worcestershire sauce
+* 1 teaspoon brandy, or bourbon (optional)
+
+### Instructions
+For the best burger, go to your butcher’s and ask them to mince 800g of chuck steak for you.
+This cut has a really good balance of fat and flavoursome meat. Divide it into 4 and, with wet
+hands, roll each piece into a ball, then press into flat patties roughly 12cm wide and about 2cm
+wider than your buns. Place on an oiled plate and chill in the fridge. Next, finely slice the red
+onion, then dress in a bowl with the vinegar and a pinch of sea salt. Slice the gherkins and halve
+the buns. Finely chop the lettuce and mix with the rest of the burger sauce ingredients in a bowl,
+then season to taste.
+
+I like to only cook 2 burgers at a time to achieve perfection, so get two pans on the go – a large
+non-stick pan on a high heat for your burgers and another on a medium heat for the bacon. Pat your
+burgers with oil and season them with salt and pepper. Put 2 burgers into the first pan, pressing
+down on them with a fish slice, then put half the bacon into the other pan. After 1 minute, flip
+the burgers and brush each cooked side with ½ a teaspoon of mustard and a dash of Tabasco. After
+another minute, flip onto the mustard side and brush again with another ½ teaspoon of mustard and
+a second dash of Tabasco on the other side. Cook for one more minute, by which point you can place
+some crispy bacon on top of each burger with a slice of cheese. Add a tiny splash of water to the
+pan and place a heatproof bowl over the burgers to melt the cheese – 30 seconds should do it. At the
+same time, toast 2 split buns in the bacon fat in the other pan until lightly golden. Repeat with
+the remaining two burgers.
+
+To build each burger, add a quarter of the burger sauce to the bun base, then top with a cheesy
+bacon burger, a quarter of the onions and gherkins. Rub the bun top with a teaspoon of ketchup,
+then gently press together. As the burger rests, juices will soak into the bun, so serve right
+away, which is great, or for an extra filthy experience, wrap each one in greaseproof paper, then
+give it a minute to go gorgeous and sloppy.
+
+**Enjoy!**
+
+ </div><!--End of content-->
+
+ <script>
+ 'use strict';
+
+ var jsContent = document.getElementById('content');
+ var placeholder = document.getElementById('placeholder');
+
+ var updateText = function(text) {
+ placeholder.innerHTML = marked.parse(text);
+ }
+
+ new QWebChannel(qt.webChannelTransport,
+ function(channel) {
+ var content = channel.objects.content;
+ content.setInitialText(jsContent.innerHTML);
+ content.textChanged.connect(updateText);
+ }
+ );
+ </script>
+</body>
+</html>
+
+
+
diff --git a/examples/webenginewidgets/recipebrowser/assets/pages/cupcakes.html b/examples/webenginewidgets/recipebrowser/assets/pages/cupcakes.html
new file mode 100644
index 000000000..e8e14a9b6
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/assets/pages/cupcakes.html
@@ -0,0 +1,75 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>Cupcakes</title>
+ <link rel="stylesheet" type="text/css" href="../3rdparty/markdown.css">
+ <link rel="stylesheet" type="text/css" href="../custom.css">
+ <script src="../3rdparty/marked.js"></script>
+ <script src="../custom.js"></script>
+ <script src="qrc:/qtwebchannel/qwebchannel.js"></script>
+</head>
+<body>
+ <div id="placeholder"></div>
+ <div id="content">
+
+<img src="images/cupcakes.jpg" alt="Cupcakes" title="Cupcakes" />
+
+Cupcakes
+=============
+
+### Ingredients
+
+* 300 g caster sugar
+* 150 ml sunflower oil
+* 1 teaspoon vanilla extract
+* 500 g dairy-free soya yoghurt
+* 2 teaspoons cider vinegar
+* 350 g plain flour
+* 1 teaspoon bicarbonate of soda
+* 1½ teaspoons baking powder
+
+#### For the vegan vanilla icing
+* 200 g dairy-free soya spread , chilled
+* 660 g icing sugar
+* ½ teaspoon vanilla extract
+
+### Instructions
+1. Preheat the oven to 170°C fan/375°F/gas 5.
+2. Place the sugar, oil and vanilla extract in a large bowl, then beat with an electric mixer for 1 to 2 minutes, until well combined.
+3. Mix the yoghurt and vinegar together in a bowl, then add to the mixture and beat for 1 to 2 minutes.
+4. Add the remaining cupcake ingredients and 1 teaspoon of fine sea salt, then whisk until smooth and just combined.
+5. Fill the paper cases two-thirds full with mixture, but don’t bother to smooth it out.
+6. Bake for 20 minutes, or until they spring back when touched. Leave to cool, transferring to a wire cooling rack after 5 minutes.
+7. Meanwhile, make the icing. Beat the soya spread with an electric mixer for 1 to 2 minutes, or until smooth.
+8. Sift the icing sugar into a large bowl, then add to the soya spread in two stages, beating well between each.
+9. Add the vanilla extract and a small splash of water, then whisk for a further few minutes, or until silky smooth – if it’s too stiff, add a splash more water to loosen.
+10. Once the cupcakes are cool, decorate them with the icing and add a few sprinkles too if you like – whatever takes your fancy – then enjoy.
+
+**Enjoy!**
+
+ </div><!--End of content-->
+
+ <script>
+ 'use strict';
+
+ var jsContent = document.getElementById('content');
+ var placeholder = document.getElementById('placeholder');
+
+ var updateText = function(text) {
+ placeholder.innerHTML = marked.parse(text);
+ }
+
+ new QWebChannel(qt.webChannelTransport,
+ function(channel) {
+ var content = channel.objects.content;
+ content.setInitialText(jsContent.innerHTML);
+ content.textChanged.connect(updateText);
+ }
+ );
+ </script>
+</body>
+</html>
+
+
+
diff --git a/examples/webengine/recipebrowser/resources/pages/images/burger.jpg b/examples/webenginewidgets/recipebrowser/assets/pages/images/burger.jpg
index edc0c65de..edc0c65de 100644
--- a/examples/webengine/recipebrowser/resources/pages/images/burger.jpg
+++ b/examples/webenginewidgets/recipebrowser/assets/pages/images/burger.jpg
Binary files differ
diff --git a/examples/webengine/recipebrowser/resources/pages/images/cupcakes.jpg b/examples/webenginewidgets/recipebrowser/assets/pages/images/cupcakes.jpg
index cce52ba23..cce52ba23 100644
--- a/examples/webengine/recipebrowser/resources/pages/images/cupcakes.jpg
+++ b/examples/webenginewidgets/recipebrowser/assets/pages/images/cupcakes.jpg
Binary files differ
diff --git a/examples/webengine/recipebrowser/resources/pages/images/pasta.jpg b/examples/webenginewidgets/recipebrowser/assets/pages/images/pasta.jpg
index 7ac924b79..7ac924b79 100644
--- a/examples/webengine/recipebrowser/resources/pages/images/pasta.jpg
+++ b/examples/webenginewidgets/recipebrowser/assets/pages/images/pasta.jpg
Binary files differ
diff --git a/examples/webengine/recipebrowser/resources/pages/images/pizza.jpg b/examples/webenginewidgets/recipebrowser/assets/pages/images/pizza.jpg
index 8d8f756af..8d8f756af 100644
--- a/examples/webengine/recipebrowser/resources/pages/images/pizza.jpg
+++ b/examples/webenginewidgets/recipebrowser/assets/pages/images/pizza.jpg
Binary files differ
diff --git a/examples/webengine/recipebrowser/resources/pages/images/skewers.jpg b/examples/webenginewidgets/recipebrowser/assets/pages/images/skewers.jpg
index 6bb2f1172..6bb2f1172 100644
--- a/examples/webengine/recipebrowser/resources/pages/images/skewers.jpg
+++ b/examples/webenginewidgets/recipebrowser/assets/pages/images/skewers.jpg
Binary files differ
diff --git a/examples/webengine/recipebrowser/resources/pages/images/soup.jpg b/examples/webenginewidgets/recipebrowser/assets/pages/images/soup.jpg
index fc9dff906..fc9dff906 100644
--- a/examples/webengine/recipebrowser/resources/pages/images/soup.jpg
+++ b/examples/webenginewidgets/recipebrowser/assets/pages/images/soup.jpg
Binary files differ
diff --git a/examples/webengine/recipebrowser/resources/pages/images/steak.jpg b/examples/webenginewidgets/recipebrowser/assets/pages/images/steak.jpg
index 240b72eb4..240b72eb4 100644
--- a/examples/webengine/recipebrowser/resources/pages/images/steak.jpg
+++ b/examples/webenginewidgets/recipebrowser/assets/pages/images/steak.jpg
Binary files differ
diff --git a/examples/webenginewidgets/recipebrowser/assets/pages/pasta.html b/examples/webenginewidgets/recipebrowser/assets/pages/pasta.html
new file mode 100644
index 000000000..c2b3d840a
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/assets/pages/pasta.html
@@ -0,0 +1,78 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>Pasta</title>
+ <link rel="stylesheet" type="text/css" href="../3rdparty/markdown.css">
+ <link rel="stylesheet" type="text/css" href="../custom.css">
+ <script src="../3rdparty/marked.js"></script>
+ <script src="../custom.js"></script>
+ <script src="qrc:/qtwebchannel/qwebchannel.js"></script>
+</head>
+<body>
+ <div id="placeholder"></div>
+ <div id="content">
+
+<img src="images/pasta.jpg" alt="Pasta" title="Pasta" />
+
+Pasta
+=============
+
+### Ingredients
+
+* 2 red peppers , deseeded and sliced
+* 2 yellow peppers , deseeded and sliced
+* extra virgin olive oil
+* sea salt
+* freshly ground black pepper
+* 2 red onions , peeled and finely sliced
+* 2 cloves garlic , peeled and grated
+* 2 handfuls fresh flat-leaf parsley , leaves finely chopped, stalks reserved
+* 2 tablespoons red wine vinegar or balsamic vinegar
+* 2 handfuls Parmesan cheese , grated
+* 2 heaped tablespoons mascarpone cheese or crème fraîche , optional
+* 455 g rigatoni, penne or spaghetti
+
+
+### Instructions
+1. Put all the peppers in a large frying pan over a medium heat with a little olive oil and a pinch of salt and pepper.
+2. Place a lid on, and cook slowly for 15 minutes until softened. Don't rush this too much, as cooking the peppers slowly like this really helps to bring out the flavour.
+3. Add the onion and cook for a further 20 minutes.
+4. Then add the garlic and parsley stalks and toss around, keeping everything moving in the pan.
+5. Cook for about 3 minutes most. Have a little taste, and season with a bit more salt and pepper.
+5. Add the vinegar - it will sizzle away, so give everything a good toss.
+6. Then add one handful of the grated Parmesan and the mascarpone or crème fraîche if you are using it and turn the heat down to minimum while you cook the pasta.
+7. Meanwhile put a large pot of salted water on to boil.
+8. Add the pasta to the boiling water and cook according to the packet instructions.
+9. When cooked, drain in a colander, reserving some of the cooking water.
+10. Put the peppers, pasta and parsley leaves into a large warmed bowl.
+11. Give them a good toss together, then add a little of the pasta cooking water and a few good lugs of extra virgin olive oil to coat the pasta nicely.
+12. Serve straight away sprinkled with the rest of the Parmesan.
+
+**Enjoy!**
+
+ </div><!--End of content-->
+
+ <script>
+ 'use strict';
+
+ var jsContent = document.getElementById('content');
+ var placeholder = document.getElementById('placeholder');
+
+ var updateText = function(text) {
+ placeholder.innerHTML = marked.parse(text);
+ }
+
+ new QWebChannel(qt.webChannelTransport,
+ function(channel) {
+ var content = channel.objects.content;
+ content.setInitialText(jsContent.innerHTML);
+ content.textChanged.connect(updateText);
+ }
+ );
+ </script>
+</body>
+</html>
+
+
+
diff --git a/examples/webenginewidgets/recipebrowser/assets/pages/pizza.html b/examples/webenginewidgets/recipebrowser/assets/pages/pizza.html
new file mode 100644
index 000000000..7e390a373
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/assets/pages/pizza.html
@@ -0,0 +1,69 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>Pizza Diavola</title>
+ <link rel="stylesheet" type="text/css" href="../3rdparty/markdown.css">
+ <link rel="stylesheet" type="text/css" href="../custom.css">
+ <script src="../3rdparty/marked.js"></script>
+ <script src="../custom.js"></script>
+ <script src="qrc:/qtwebchannel/qwebchannel.js"></script>
+</head>
+<body>
+ <div id="placeholder"></div>
+ <div id="content">
+
+<img src="images/pizza.jpg" alt="Pizza Diavola" title="Pizza Diavola" />
+
+Pizza Diavola
+=============
+
+### Ingredients
+
+* 2 pizza dough balls
+* 100g Mozzarella
+* 400g Passata
+* 200 g Spicy Salami
+* 2 fresh chillies
+* Extra virgin olive oil
+* Salt
+
+### Instructions
+1. Preheat oven to 210 oc.
+2. Get your pizza dough balls ( depending on how many you are making) and roll them out to about 12 inches diameter using your hands in a circular stretching technique or using a rolling pin.
+3. With the dough prepared now get our sauce ready by mixing the passata with three tbsp of the olive oil and a good pinch of salt.
+4. Now slice up your salami into thin-ish slices and also finely chop the fresh chillies.
+5. Next, slice or dice your mozzarella and we are ready to dress the pizza.
+6. Add half the tomato sauce to each base and spread evenly leaving a half inch perimeter.
+7. Add the mozzarella, salami and finish with the chillies.
+8. Finally drizzle with some more olive oil and your are ready to cook your pizza diavola.
+9. Place in the oven for ten minutes or until golden.
+10. Remove from the oven, slice, and enjoy your pizza diavola.
+
+**Enjoy!**
+
+ </div><!--End of content-->
+
+ <script>
+ 'use strict';
+
+ var jsContent = document.getElementById('content');
+ var placeholder = document.getElementById('placeholder');
+
+ var updateText = function(text) {
+ placeholder.innerHTML = marked.parse(text);
+ }
+
+ new QWebChannel(qt.webChannelTransport,
+ function(channel) {
+ var content = channel.objects.content;
+ content.setInitialText(jsContent.innerHTML);
+ content.textChanged.connect(updateText);
+ }
+ );
+ </script>
+</body>
+</html>
+
+
+
diff --git a/examples/webenginewidgets/recipebrowser/assets/pages/skewers.html b/examples/webenginewidgets/recipebrowser/assets/pages/skewers.html
new file mode 100644
index 000000000..db2df5472
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/assets/pages/skewers.html
@@ -0,0 +1,74 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>Grilled skewers</title>
+ <link rel="stylesheet" type="text/css" href="../3rdparty/markdown.css">
+ <link rel="stylesheet" type="text/css" href="../custom.css">
+ <script src="../3rdparty/marked.js"></script>
+ <script src="../custom.js"></script>
+ <script src="qrc:/qtwebchannel/qwebchannel.js"></script>
+</head>
+<body>
+ <div id="placeholder"></div>
+ <div id="content">
+
+<img src="images/skewers.jpg" alt="Grilled skewers" title="Grilled skewers" />
+
+Grilled skewers
+======================
+
+### Ingredients
+
+* 3 cloves of garlic
+* 200g kefalotyri cheese
+* 2 medium aubergine
+* 1 iceberg lettuce
+* 1 tablespoon coriander seeds
+* 2 teaspoons dried oregano
+* 2 lemons
+* 4 tablespoons olive oil
+* 600g lamb neck fillet , in 2cm chunks
+* 12 fresh bay leaves
+
+### Instructions
+1. Peel and crush the garlic.
+2. Chop the cheese into bite-sized pieces, trim and chop the aubergines into 2cm chunks, and trim and finely slice the lettuce.
+3. Finely crush the coriander seeds in a pestle and mortar and add to a large bowl with the oregano and garlic. Finely grate in the lemon zest (reserve the zested lemons) and stir in the oil.
+4. Season, then add the cheese, lamb, aubergines and bay leaves. Leave to marinate for at least an hour, or overnight if you can.
+5. Meanwhile, pickle your cabbage. Trim, core and finely slice the cabbage, then place in a colander in the sink or over a bowl and toss with 2 teaspoons of sea salt. Cover and set aside for at least 2 hours, then rinse.
+6. Peel and finely slice the onions, then transfer to a bowl along with the cabbage.
+7. Put the remaining ingredients in a pan and bring to a boil. Simmer for 10 minutes, then pour over the cabbage and onions. Transfer to sterilised jars – this will keep for up to 1 month.
+8. For the flatbreads, put the flour, baking powder, buttermilk and half of the sesame seeds in a bowl and mix until everything is combined.
+9. Tip onto a lightly floured surface and knead briefly. Divide into six, using a rolling pin to roll them into 1 to 2mm rounds.
+10. Scatter with the remaining sesame seeds and run the rolling pin over them. Pop the flatbreads onto the hot barbecue for 1 to 2 minutes on each side.
+11. Load 12 skewers with the cheese, lamb, aubergines and bay leaves, then place on the barbecue (not directly over the coals) for 20 to 25 minutes, turning often, until the lamb is medium-rare and the aubergines are cooked.
+12. Serve the lamb with the flatbreads, cabbage, lettuce and lemon wedges.
+
+**Enjoy!**
+
+ </div><!--End of content-->
+
+ <script>
+ 'use strict';
+
+ var jsContent = document.getElementById('content');
+ var placeholder = document.getElementById('placeholder');
+
+ var updateText = function(text) {
+ placeholder.innerHTML = marked.parse(text);
+ }
+
+ new QWebChannel(qt.webChannelTransport,
+ function(channel) {
+ var content = channel.objects.content;
+ content.setInitialText(jsContent.innerHTML);
+ content.textChanged.connect(updateText);
+ }
+ );
+ </script>
+</body>
+</html>
+
+
+
diff --git a/examples/webenginewidgets/recipebrowser/assets/pages/soup.html b/examples/webenginewidgets/recipebrowser/assets/pages/soup.html
new file mode 100644
index 000000000..ea51fc8a5
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/assets/pages/soup.html
@@ -0,0 +1,63 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>Soup</title>
+ <link rel="stylesheet" type="text/css" href="../3rdparty/markdown.css">
+ <link rel="stylesheet" type="text/css" href="../custom.css">
+ <script src="../3rdparty/marked.js"></script>
+ <script src="../custom.js"></script>
+ <script src="qrc:/qtwebchannel/qwebchannel.js"></script>
+</head>
+<body>
+ <div id="placeholder"></div>
+ <div id="content">
+
+<img src="images/soup.jpg" alt="Soup" title="Soup" />
+
+Soup
+=============
+
+### Ingredients
+
+* 2 potatoes
+* 2 onions
+* 2 cloves of garlic
+* olive oil
+* 400 ml organic stock
+* 3 bunches of watercress
+
+### Instructions
+* Peel and roughly chop the potatoes, onions and garlic.
+* In a large saucepan, heat a little olive oil, then sauté the potato, onion and garlic until the onions are translucent.
+* Add the stock and simmer until the potato is soft. Chop and add the watercress and simmer for a further 3 to 4 minutes.
+* Using a hand blender, liquidise the soup until smooth.
+* Serve with a swirl of crème fraîche and some Fortt’s Bath Oliver biscuits, if you like.
+
+**Enjoy!**
+
+ </div><!--End of content-->
+
+ <script>
+ 'use strict';
+
+ var jsContent = document.getElementById('content');
+ var placeholder = document.getElementById('placeholder');
+
+ var updateText = function(text) {
+ placeholder.innerHTML = marked.parse(text);
+ }
+
+ new QWebChannel(qt.webChannelTransport,
+ function(channel) {
+ var content = channel.objects.content;
+ content.setInitialText(jsContent.innerHTML);
+ content.textChanged.connect(updateText);
+ }
+ );
+ </script>
+</body>
+</html>
+
+
+
diff --git a/examples/webenginewidgets/recipebrowser/assets/pages/steak.html b/examples/webenginewidgets/recipebrowser/assets/pages/steak.html
new file mode 100644
index 000000000..26391b409
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/assets/pages/steak.html
@@ -0,0 +1,88 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>Grilled steak and rice</title>
+ <link rel="stylesheet" type="text/css" href="../3rdparty/markdown.css">
+ <link rel="stylesheet" type="text/css" href="../custom.css">
+ <script src="../3rdparty/marked.js"></script>
+ <script src="../custom.js"></script>
+ <script src="qrc:/qtwebchannel/qwebchannel.js"></script>
+</head>
+<body>
+ <div id="placeholder"></div>
+ <div id="content">
+
+<img src="images/steak.jpg" alt="Grilled steak and rice" title="Grilled steak and rice" />
+
+Grilled steak and rice
+======================
+
+### Ingredients
+
+#### For the ratatouille
+* courgette
+* 1 small aubergine
+* 2 mixed-color peppers
+* 1 red onion
+* 1 heaped teaspoon harissa
+* 2 anchovy fillets
+* 2-4 cloves of garlic
+* 700 g passata
+* 1 tablespoon balsamic vinegar
+* ½ bunch fresh basil
+* 2 tablespoons fat-free natural yoghurt
+
+#### For the rice
+* 1 mug (300g) 10-minute wholegrain or basmati rice
+* 1 good pinch saffron
+* ½ lemon
+
+#### For the steak
+* 2 x 250 g quality sirloin steaks, fat removed
+* 1 teaspoon sweet paprika olive oil
+* ½ bunch fresh flat-leaf parsley
+* 1 heaped teaspoon Dijon mustard
+* 1 tablespoon extra virgin olive oil
+* ½ lemon
+
+### Instructions
+1. Halve the courgette lengthways, slice the aubergine 1cm thick and place both on the griddle pan, turning when charred.
+2. Put 1 mug of rice, 2 mugs of boiling water, the saffron, lemon half and a pinch of salt into the small pan, cover and cook until fluffy, stirring occasionally.
+3. Tear the seeds and stalks out of the peppers, then roughly chop with the peeled red onion and put into the casserole pan with the harissa, anchovies and 1 teaspoon of their oil.
+4. Squash in the unpeeled garlic through a garlic crusher and stir regularly.
+5. Remove the charred courgette and aubergine from the griddle pan, leaving it on the heat, and roughly chop them on a board.
+6. Add them to the casserole pan along with the passata and vinegar, and boil with the lid on.
+7. Rub the steaks with salt, the paprika and 1 teaspoon of olive oil and place on the hot griddle pan, turning every minute until cooked to your liking.
+8. On a board, finely slice the parsley stalks and roughly chop the leaves.
+9. Add the mustard and extra virgin olive oil, season with salt and pepper and squeeze over the lemon juice, then mix together and spread over the board.
+10. When the steaks are done, transfer them to the board, turn in the dressing, then slice.
+11. Tear the top leafy half of the basil into the ratatouille, season to taste, and serve with yoghurt and saffron rice.
+
+**Enjoy!**
+
+ </div><!--End of content-->
+
+ <script>
+ 'use strict';
+
+ var jsContent = document.getElementById('content');
+ var placeholder = document.getElementById('placeholder');
+
+ var updateText = function(text) {
+ placeholder.innerHTML = marked.parse(text);
+ }
+
+ new QWebChannel(qt.webChannelTransport,
+ function(channel) {
+ var content = channel.objects.content;
+ content.setInitialText(jsContent.innerHTML);
+ content.textChanged.connect(updateText);
+ }
+ );
+ </script>
+</body>
+</html>
+
+
+
diff --git a/examples/webenginewidgets/recipebrowser/doc/images/recipebrowser.webp b/examples/webenginewidgets/recipebrowser/doc/images/recipebrowser.webp
new file mode 100644
index 000000000..7e711c661
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/doc/images/recipebrowser.webp
Binary files differ
diff --git a/examples/webenginewidgets/recipebrowser/doc/src/recipebrowser.qdoc b/examples/webenginewidgets/recipebrowser/doc/src/recipebrowser.qdoc
new file mode 100644
index 000000000..0400fcecc
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/doc/src/recipebrowser.qdoc
@@ -0,0 +1,197 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+ \example webenginewidgets/recipebrowser
+ \title Recipe Browser
+ \meta tag {widgets, webengine, webchannel, webenginescript}
+ \ingroup webengine-widgetexamples
+ \brief Injecting custom stylsheets into web pages and providing a rich text preview
+ tool for a custom markup language.
+ \examplecategory {Web Technologies}
+
+ \image recipebrowser.webp
+
+ \e {Recipe Browser} is a small hybrid web browser application. It demonstrates how to
+ use the \l{Qt WebEngine Widgets C++ Classes} {Qt WebEngine C++ classes} to combine
+ C++ and JavaScript logic in the following ways.
+
+ \list
+ \li Running arbitrary JavaScript code via \c QWebEnginePage::runJavaScript() to
+ inject custom CSS stylesheets
+ \li Using QWebEngineScript and QWebEngineScriptCollection to persist the JavaScript
+ code and inject it to every page
+ \li Using QWebChannel to interact with and provide a rich text preview for a custom
+ markup language
+ \endlist
+
+ \l{http://daringfireball.net/projects/markdown/}{Markdown} is a lightweight
+ markup language with a plain text formatting syntax.
+ Some services, such as \l{http://github.com}{github}, acknowledge the
+ format, and render the content as rich text when viewed in a browser.
+
+ The Recipe Browser main window is split into a navigation on the left and
+ a preview area on the right. The preview area on the right switches to an
+ editor when the user clicks the Edit button on the top left of the main window.
+ The editor supports the Markdown syntax and is implemented by using
+ QPlainTextEdit. The document is rendered as rich text in the preview area,
+ once the user clicks the View button,to which the Edit button transforms to.
+ This rendering is implemented by using QWebEngineView. To render the text,
+ a JavaScript library inside the web engine converts the Markdown text to HTML.
+ The preview is updated from the editor through QWebChannel.
+
+ \include examples-run.qdocinc
+
+ \section1 Exposing Document Text
+
+ To render the current Markdown text it needs to be exposed to the web engine through
+ QWebChannel. To achieve this it has to be part of Qt metatype system. This is done
+ by using a dedicated \c Document class that exposes the document text as a
+ \c {Q_PROPERTY}:
+
+ \quotefromfile webenginewidgets/recipebrowser/document.h
+ \skipto class Document
+ \printto #endif
+
+ The \c Document class wraps a QString \c m_currentText to be set on the C++
+ side with the \c setText() method and exposes it at runtime as a \c text
+ property with a \c textChanged signal. We define the \c setText method as
+ follows:
+
+ \quotefromfile webenginewidgets/recipebrowser/document.cpp
+ \skipto Document::setText(const QString &text)
+ \printuntil /^\}/
+
+ Additionally, the \c Document class keeps track of the current recipe via
+ \c m_currentPage. We call the recipes pages here, because each recipe has
+ its distinct HTML document that contains the initial text content.
+ Furthermore, \c m_textCollection is a QMap<QString, QString> that contains
+ the key/value pairs \{page, text\}, so that changes made to the text content
+ of a page is persisted between navigation. Nevertheless, we do not write the
+ modified text contents to the drive, but instead we persist them between
+ application start and shutdown via QSettings.
+
+ \section1 Creating the Main Window
+
+ The \c MainWindow class inherits the QMainWindow class:
+
+ \quotefromfile webenginewidgets/recipebrowser/mainwindow.h
+ \skipto class MainWindow :
+ \printto endif
+
+ The class declares private slots that match the two buttons on the
+ top left, over the navigation list view. Additionally, helper
+ methods for custom CSS stylesheets are declared.
+
+ The actual layout of the main window is specified in a \c .ui file.
+ The widgets and actions are available at runtime in the \c ui member
+ variable.
+
+ \c m_isEditMode is a boolean that toggles between the editor and the
+ preview area.
+ \c m_content is an instance of the \c Document class.
+
+ The actual setup of the different objects is done in the \c MainWindow
+ constructor:
+
+ \quotefromfile webenginewidgets/recipebrowser/mainwindow.cpp
+ \skipto MainWindow::MainWindow
+ \printto connect
+
+ The constructor first calls \c setupUi to construct the widgets and menu
+ actions according to the UI file. The text editor font is set to one
+ with a fixed character width, and the QWebEngineView widget is told not
+ to show a context menu. Furthermore, the editor is hidden away.
+
+ \printto ui->recipes
+
+ Here the \c clicked signals of QPushButton are connected to respective functions
+ that show the stylesheets dialog or toggle between edit and view mode, that is,
+ hide and show the editor and preview area respectively.
+
+ \printto m_content.setTextEdit
+
+ Here the navigation QListWidget on the left is setup with the 7 recipes.
+ Also, the currentItemChanged signal of QListWidget is connected to a lambda
+ that loads the new, current recipe page and updates the page in \c m_content.
+
+ \printto connect
+
+ Next, the pointer to the ui editor, a QPlainTextEdit, is passed to \c m_content to ensure that
+ calls to \c Document::setInitialText() work properly.
+
+ \printto QSettings
+
+ Here the \c textChanged signal of the editor is connected to a lambda that
+ updates the text in \c m_content. This object is then exposed to the JS side
+ by \c QWebChannel under the name \c{content}.
+
+ \printto ui->recipes
+
+ By using QSettings we persist stylesheets between application runs. If there
+ should be no stylesheets configured, for example, because the user deleted all of them
+ in a previous run, we load default ones.
+
+ \printto }
+
+ Finally, we set the currently selected list item to the first contained in the
+ navigation list widget. This triggers the previously mentioned
+ QListWidget::currentItemChanged signal and navigates to the page of the list item.
+
+ \section1 Working With Stylesheets
+
+ We use JavaScript to create and append CSS elements to the documents.
+ After declaring the script source, QWebEnginePage::runJavaScript() can run it
+ immediately and apply newly created styles on the current content of the web view.
+ Encapsulating the script into a QWebEngineScript and adding it to the script collection
+ of QWebEnginePage makes its effect permanent.
+
+ \quotefromfile webenginewidgets/recipebrowser/mainwindow.cpp
+ \skipto MainWindow::insertStyleSheet
+ \printuntil /^\}/
+
+ Removing stylesheets can be done similarly:
+
+ \quotefromfile webenginewidgets/recipebrowser/mainwindow.cpp
+ \skipto MainWindow::removeStyleSheet
+ \printuntil /^\}/
+
+ \section1 Creating a recipe file
+
+ \quotefile webenginewidgets/recipebrowser/assets/pages/burger.html
+
+ All the different recipe pages are set up the same way.
+
+ In the \c <head> part they
+ include two CSS files: \c markdown.css, that styles the markdown, and
+ custom.css, that does some further styling but most importantly hides the
+ \c <div> with id \e content, as this \c <div> only contains the unmodified,
+ initial content text. Also, three JS scripts are included. \c marked.js
+ is responsible for parsing the markdown and transforming it into HTML.
+ \c custom.js does some configuration of \c marked.js, and \c qwebchannel.js
+ exposes the QWebChannel JavaScript API.
+
+ In the body there are two \c <div> elements. The \c <div> with id \e placeholder
+ gets the markdown text injected that is rendered and visible. The \c <div> with id
+ \e content is hidden by \c custom.css and only contains the original, unmodified
+ text content of the recipe.
+
+ Finally, on the bottom of each recipe HTML file is a script that is responsible for
+ the communication between the C++ and JavaScript side via QWebChannel. The original,
+ unmodified text content inside the \c <div> with id \e content is passed to the C++
+ side and a callback is setup that is invoked when the \c textChanged signal of
+ \c m_content is emitted. The callback then updates the contents of the \c <div>
+ \e placeholder with the parsed markdown.
+
+ \section1 Files and Attributions
+
+ The example bundles the following code with third-party licenses:
+ \table
+ \row
+ \li \l{recipebrowser-marked}{Marked}
+ \li MIT License
+ \row
+ \li \l{recipebrowser-markdowncss}{Markdown.css}
+ \li Apache License 2.0
+ \endtable
+*/
diff --git a/examples/webenginewidgets/recipebrowser/document.cpp b/examples/webenginewidgets/recipebrowser/document.cpp
new file mode 100644
index 000000000..c991e14f8
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/document.cpp
@@ -0,0 +1,48 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include "document.h"
+
+#include <QSettings>
+
+Document::Document(QObject *parent) : QObject(parent)
+{
+ QSettings settings;
+ settings.beginGroup("textCollection");
+ QStringList pageTexts = settings.allKeys();
+ for (const QString &name : std::as_const(pageTexts)) {
+ QString pageText = settings.value(name).value<QString>();
+ if (!pageText.isEmpty())
+ m_textCollection.insert(name, pageText);
+ }
+ settings.endGroup();
+}
+
+void Document::setTextEdit(QPlainTextEdit *textEdit)
+{
+ m_textEdit = textEdit;
+}
+
+void Document::setCurrentPage(const QString &page)
+{
+ m_currentPage = page;
+}
+
+void Document::setInitialText(const QString &text)
+{
+ m_textEdit->setPlainText(m_textCollection.value(m_currentPage, text));
+}
+
+void Document::setText(const QString &text)
+{
+ if (text == m_currentText)
+ return;
+ m_currentText = text;
+ emit textChanged(m_currentText);
+
+ QSettings settings;
+ settings.beginGroup("textCollection");
+ settings.setValue(m_currentPage, text);
+ m_textCollection.insert(m_currentPage, text);
+ settings.endGroup();
+}
diff --git a/examples/webenginewidgets/recipebrowser/document.h b/examples/webenginewidgets/recipebrowser/document.h
new file mode 100644
index 000000000..f6b537eb8
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/document.h
@@ -0,0 +1,36 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#ifndef DOCUMENT_H
+#define DOCUMENT_H
+
+#include <QObject>
+#include <QString>
+#include <QPlainTextEdit>
+
+class Document : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QString text MEMBER m_currentText NOTIFY textChanged FINAL)
+public:
+ explicit Document(QObject *parent = nullptr);
+
+ void setTextEdit(QPlainTextEdit *textEdit);
+ void setCurrentPage(const QString &page);
+
+public slots:
+ void setInitialText(const QString &text);
+ void setText(const QString &text);
+
+signals:
+ void textChanged(const QString &text);
+
+private:
+ QPlainTextEdit *m_textEdit;
+
+ QString m_currentText;
+ QString m_currentPage;
+ QMap<QString, QString> m_textCollection;
+};
+
+#endif // DOCUMENT_H
diff --git a/examples/webenginewidgets/recipebrowser/main.cpp b/examples/webenginewidgets/recipebrowser/main.cpp
new file mode 100644
index 000000000..b0b42d16b
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/main.cpp
@@ -0,0 +1,18 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include "mainwindow.h"
+#include "stylesheetdialog.h"
+#include <QApplication>
+#include <QUrl>
+
+int main(int argc, char *argv[])
+{
+ qRegisterMetaType<StyleSheet>("StyleSheet");
+
+ QCoreApplication::setOrganizationName("QtExamples");
+ QApplication a(argc, argv);
+ MainWindow w;
+ w.show();
+ return a.exec();
+}
diff --git a/examples/webenginewidgets/recipebrowser/mainwindow.cpp b/examples/webenginewidgets/recipebrowser/mainwindow.cpp
new file mode 100644
index 000000000..7eedab480
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/mainwindow.cpp
@@ -0,0 +1,154 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include "mainwindow.h"
+#include "stylesheetdialog.h"
+#include "ui_mainwindow.h"
+
+#include <QWebChannel>
+
+static QMap<QString, QString> defaultStyleSheets = {
+ { "Upside down", "body { -webkit-transform: rotate(180deg); }" },
+ { "Darkmode",
+ "body { color: #FFF; background-color: #000 }"
+ "h1, h2, h3, h4, h5 { color: #FFF }" }
+};
+
+MainWindow::MainWindow(QWidget *parent)
+ : QMainWindow(parent), ui(new Ui::MainWindow), m_isEditMode(false)
+{
+ ui->setupUi(this);
+ ui->textEdit->setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont));
+ ui->textEdit->hide();
+ ui->webEngineView->setContextMenuPolicy(Qt::NoContextMenu);
+
+ connect(ui->stylesheetsButton, &QPushButton::clicked, this, &MainWindow::showStyleSheetsDialog);
+ connect(ui->editViewButton, &QPushButton::clicked, this, &MainWindow::toggleEditView);
+
+ ui->recipes->insertItem(0, "Burger");
+ ui->recipes->insertItem(1, "Cupcakes");
+ ui->recipes->insertItem(2, "Pasta");
+ ui->recipes->insertItem(3, "Pizza");
+ ui->recipes->insertItem(4, "Skewers");
+ ui->recipes->insertItem(5, "Soup");
+ ui->recipes->insertItem(6, "Steak");
+ connect(ui->recipes, &QListWidget::currentItemChanged, this,
+ [this](QListWidgetItem *current, QListWidgetItem * /* previous */) {
+ const QString page = current->text().toLower();
+ const QString url = QStringLiteral("qrc:/pages/") + page + QStringLiteral(".html");
+ ui->webEngineView->setUrl(QUrl(url));
+ m_content.setCurrentPage(page);
+ });
+
+ m_content.setTextEdit(ui->textEdit);
+
+ connect(ui->textEdit, &QPlainTextEdit::textChanged, this,
+ [this]() { m_content.setText(ui->textEdit->toPlainText()); });
+
+ QWebChannel *channel = new QWebChannel(this);
+ channel->registerObject(QStringLiteral("content"), &m_content);
+ ui->webEngineView->page()->setWebChannel(channel);
+
+ QSettings settings;
+ settings.beginGroup("styleSheets");
+ QStringList styleSheets = settings.allKeys();
+ if (styleSheets.empty()) {
+ // Add back default style sheets if the user cleared them out
+ loadDefaultStyleSheets();
+ } else {
+ for (const auto &name : std::as_const(styleSheets)) {
+ StyleSheet styleSheet = settings.value(name).value<StyleSheet>();
+ if (styleSheet.second)
+ insertStyleSheet(name, styleSheet.first, false);
+ }
+ }
+ settings.endGroup();
+
+ ui->recipes->setCurrentItem(ui->recipes->item(0));
+}
+
+MainWindow::~MainWindow()
+{
+ delete ui;
+}
+
+void MainWindow::insertStyleSheet(const QString &name, const QString &source, bool immediately)
+{
+ QWebEngineScript script;
+ QString s = QString::fromLatin1("(function() {"
+ " css = document.createElement('style');"
+ " css.type = 'text/css';"
+ " css.id = '%1';"
+ " document.head.appendChild(css);"
+ " css.innerText = '%2';"
+ "})()")
+ .arg(name, source.simplified());
+ if (immediately)
+ ui->webEngineView->page()->runJavaScript(s, QWebEngineScript::ApplicationWorld);
+
+ script.setName(name);
+ script.setSourceCode(s);
+ script.setInjectionPoint(QWebEngineScript::DocumentReady);
+ script.setRunsOnSubFrames(true);
+ script.setWorldId(QWebEngineScript::ApplicationWorld);
+ ui->webEngineView->page()->scripts().insert(script);
+}
+
+void MainWindow::removeStyleSheet(const QString &name, bool immediately)
+{
+ QString s = QString::fromLatin1("(function() {"
+ " var element = document.getElementById('%1');"
+ " element.outerHTML = '';"
+ " delete element;"
+ "})()")
+ .arg(name);
+ if (immediately)
+ ui->webEngineView->page()->runJavaScript(s, QWebEngineScript::ApplicationWorld);
+
+ const QList<QWebEngineScript> scripts = ui->webEngineView->page()->scripts().find(name);
+ if (!scripts.isEmpty())
+ ui->webEngineView->page()->scripts().remove(scripts.first());
+}
+
+bool MainWindow::hasStyleSheet(const QString &name)
+{
+ const QList<QWebEngineScript> scripts = ui->webEngineView->page()->scripts().find(name);
+ return !scripts.isEmpty();
+}
+
+void MainWindow::loadDefaultStyleSheets()
+{
+ QSettings settings;
+ settings.beginGroup("styleSheets");
+
+ for (auto it = defaultStyleSheets.constBegin(); it != defaultStyleSheets.constEnd(); ++it) {
+ settings.setValue(it.key(), QVariant::fromValue(qMakePair(it.value(), false)));
+ }
+
+ settings.endGroup();
+}
+
+void MainWindow::showStyleSheetsDialog()
+{
+ StylesheetDialog *dialog = new StylesheetDialog(this);
+ dialog->show();
+}
+
+void MainWindow::toggleEditView()
+{
+ m_isEditMode = !m_isEditMode;
+
+ if (m_isEditMode) {
+ ui->webEngineView->hide();
+ ui->textEdit->show();
+
+ ui->editViewButton->setText(QStringLiteral("View"));
+ ui->editViewButton->setIcon(QIcon(":/icons/view.svg"));
+ } else {
+ ui->textEdit->hide();
+ ui->webEngineView->show();
+
+ ui->editViewButton->setText(QStringLiteral("Edit"));
+ ui->editViewButton->setIcon(QIcon(":/icons/edit.svg"));
+ }
+}
diff --git a/examples/webenginewidgets/recipebrowser/mainwindow.h b/examples/webenginewidgets/recipebrowser/mainwindow.h
new file mode 100644
index 000000000..959c82af8
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/mainwindow.h
@@ -0,0 +1,44 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include "document.h"
+#include <QMainWindow>
+#include <QSettings>
+#include <QWebEngineScriptCollection>
+#include <QWebEngineView>
+#include <QPlainTextEdit>
+
+QT_BEGIN_NAMESPACE
+namespace Ui {
+class MainWindow;
+}
+QT_END_NAMESPACE
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ explicit MainWindow(QWidget *parent = nullptr);
+ ~MainWindow();
+
+ void insertStyleSheet(const QString &name, const QString &source, bool immediately);
+ void removeStyleSheet(const QString &name, bool immediately);
+ bool hasStyleSheet(const QString &name);
+ void loadDefaultStyleSheets();
+
+private slots:
+ void showStyleSheetsDialog();
+ void toggleEditView();
+
+private:
+ Ui::MainWindow *ui;
+
+ bool m_isEditMode;
+ Document m_content;
+};
+
+#endif // MAINWINDOW_H
diff --git a/examples/webenginewidgets/recipebrowser/mainwindow.ui b/examples/webenginewidgets/recipebrowser/mainwindow.ui
new file mode 100644
index 000000000..9c2539fd5
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/mainwindow.ui
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>713</width>
+ <height>455</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Recipe Browser</string>
+ </property>
+ <property name="unifiedTitleAndToolBarOnMac">
+ <bool>false</bool>
+ </property>
+ <widget class="QWidget" name="centralWidget">
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <layout class="QVBoxLayout" name="navigation">
+ <item>
+ <layout class="QHBoxLayout" name="navigationBar">
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Recipes</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="editViewButton">
+ <property name="text">
+ <string>Edit</string>
+ </property>
+ <property name="icon">
+ <iconset resource="recipebrowser.qrc">
+ <normaloff>:/icons/edit.svg</normaloff>:/icons/edit.svg</iconset>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="stylesheetsButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Stylesheets</string>
+ </property>
+ <property name="icon">
+ <iconset resource="recipebrowser.qrc">
+ <normaloff>:/icons/stylesheets.svg</normaloff>:/icons/stylesheets.svg</iconset>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QListWidget" name="recipes">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QWebEngineView" name="webEngineView" native="true">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPlainTextEdit" name="textEdit"/>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <customwidgets>
+ <customwidget>
+ <class>QWebEngineView</class>
+ <extends>QWidget</extends>
+ <header>qwebengineview.h</header>
+ <container>1</container>
+ </customwidget>
+ </customwidgets>
+ <resources>
+ <include location="recipebrowser.qrc"/>
+ </resources>
+ <connections/>
+</ui>
diff --git a/examples/webenginewidgets/recipebrowser/recipebrowser.pro b/examples/webenginewidgets/recipebrowser/recipebrowser.pro
new file mode 100644
index 000000000..8f8895b52
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/recipebrowser.pro
@@ -0,0 +1,24 @@
+TEMPLATE = app
+TARGET = recipebrowser
+QT += webenginewidgets
+
+HEADERS += \
+ mainwindow.h \
+ stylesheetdialog.h \
+ document.h
+
+SOURCES += \
+ main.cpp \
+ mainwindow.cpp \
+ stylesheetdialog.cpp \
+ document.cpp
+
+FORMS += \
+ mainwindow.ui \
+ stylesheetdialog.ui
+
+RESOURCES += recipebrowser.qrc
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/webenginewidgets/recipebrowser
+INSTALLS += target
diff --git a/examples/webenginewidgets/recipebrowser/recipebrowser.qrc b/examples/webenginewidgets/recipebrowser/recipebrowser.qrc
new file mode 100644
index 000000000..c1eb909a7
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/recipebrowser.qrc
@@ -0,0 +1,27 @@
+<RCC>
+ <qresource prefix="/">
+ <file alias="3rdparty/markdown.css">assets/3rdparty/markdown.css</file>
+ <file alias="3rdparty/marked.js">assets/3rdparty/marked.js</file>
+ <file alias="custom.js">assets/custom.js</file>
+ <file alias="custom.css">assets/custom.css</file>
+ <file alias="pages/images/burger.jpg">assets/pages/images/burger.jpg</file>
+ <file alias="pages/images/cupcakes.jpg">assets/pages/images/cupcakes.jpg</file>
+ <file alias="pages/images/pasta.jpg">assets/pages/images/pasta.jpg</file>
+ <file alias="pages/images/pizza.jpg">assets/pages/images/pizza.jpg</file>
+ <file alias="pages/images/skewers.jpg">assets/pages/images/skewers.jpg</file>
+ <file alias="pages/images/soup.jpg">assets/pages/images/soup.jpg</file>
+ <file alias="pages/images/steak.jpg">assets/pages/images/steak.jpg</file>
+ <file alias="pages/burger.html">assets/pages/burger.html</file>
+ <file alias="pages/cupcakes.html">assets/pages/cupcakes.html</file>
+ <file alias="pages/pasta.html">assets/pages/pasta.html</file>
+ <file alias="pages/pizza.html">assets/pages/pizza.html</file>
+ <file alias="pages/skewers.html">assets/pages/skewers.html</file>
+ <file alias="pages/soup.html">assets/pages/soup.html</file>
+ <file alias="pages/steak.html">assets/pages/steak.html</file>
+ <file alias="icons/edit.svg">assets/icons/edit.svg</file>
+ <file alias="icons/stylesheets.svg">assets/icons/stylesheets.svg</file>
+ <file alias="icons/add.svg">assets/icons/add.svg</file>
+ <file alias="icons/remove.svg">assets/icons/remove.svg</file>
+ <file alias="icons/view.svg">assets/icons/view.svg</file>
+ </qresource>
+</RCC>
diff --git a/examples/webenginewidgets/recipebrowser/stylesheetdialog.cpp b/examples/webenginewidgets/recipebrowser/stylesheetdialog.cpp
new file mode 100644
index 000000000..2137617c3
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/stylesheetdialog.cpp
@@ -0,0 +1,129 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include "mainwindow.h"
+#include "stylesheetdialog.h"
+#include "ui_stylesheetdialog.h"
+
+StylesheetDialog::StylesheetDialog(QWidget *parent) : QDialog(parent), ui(new Ui::StylesheetDialog)
+{
+ ui->setupUi(this);
+
+ connect(ui->styleSheetList, &QListWidget::currentItemChanged, this,
+ &StylesheetDialog::currentStyleSheetChanged);
+ connect(ui->styleSheetList, &QListWidget::itemClicked, this,
+ &StylesheetDialog::listItemClicked);
+ connect(ui->fileNameEdit, &QLineEdit::textChanged, this, &StylesheetDialog::fileNameChanged);
+
+ connect(ui->addButton, &QPushButton::clicked, this, &StylesheetDialog::addButtonClicked);
+ connect(ui->removeButton, &QPushButton::clicked, this, &StylesheetDialog::removeButtonClicked);
+
+ QSettings settings;
+ settings.beginGroup("styleSheets");
+ for (const auto &name : settings.allKeys()) {
+ QListWidgetItem *listItem = new QListWidgetItem(name, ui->styleSheetList);
+ listItem->setFlags(listItem->flags() | Qt::ItemIsUserCheckable);
+ bool checked = settings.value(name).value<StyleSheet>().second;
+ listItem->setCheckState(checked ? Qt::Checked : Qt::Unchecked);
+ }
+ settings.endGroup();
+}
+
+StylesheetDialog::~StylesheetDialog()
+{
+ delete ui;
+}
+
+void StylesheetDialog::currentStyleSheetChanged(QListWidgetItem *current, QListWidgetItem *previous)
+{
+ if (!previous) {
+ // Select the first item on startup
+ ui->styleSheetList->setCurrentItem(current);
+ }
+
+ if (!current) {
+ ui->fileNameEdit->setText(QString());
+ ui->sourceCodeEdit->setPlainText(QString());
+ return;
+ }
+
+ QSettings settings;
+ settings.beginGroup("styleSheets");
+ ui->fileNameEdit->setText(current->text());
+ const QString source = settings.value(current->text()).value<StyleSheet>().first;
+ ui->sourceCodeEdit->setPlainText(source);
+ settings.endGroup();
+}
+
+void StylesheetDialog::listItemClicked(QListWidgetItem *item)
+{
+ MainWindow *window = static_cast<MainWindow *>(parent());
+ const QString name = item->text();
+ bool checkedStateChanged = (item->checkState() == Qt::Checked && !window->hasStyleSheet(name))
+ || (item->checkState() == Qt::Unchecked && window->hasStyleSheet(name));
+ if (!checkedStateChanged)
+ return;
+
+ QSettings settings;
+ settings.beginGroup("styleSheets");
+ const QString source = settings.value(name).value<StyleSheet>().first;
+
+ if (item->checkState() == Qt::Checked) {
+ settings.setValue(name, QVariant::fromValue(qMakePair(source, true)));
+ window->insertStyleSheet(name, source, true);
+ } else {
+ settings.setValue(name, QVariant::fromValue(qMakePair(source, false)));
+ window->removeStyleSheet(name, true);
+ }
+
+ settings.endGroup();
+}
+
+void StylesheetDialog::fileNameChanged(const QString &text)
+{
+ QList<QListWidgetItem *> items = ui->styleSheetList->findItems(text, Qt::MatchFixedString);
+ if (items.size())
+ ui->addButton->setEnabled(false);
+ else
+ ui->addButton->setEnabled(true);
+}
+
+void StylesheetDialog::addButtonClicked()
+{
+ const QString name = ui->fileNameEdit->text();
+ const QString source = ui->sourceCodeEdit->toPlainText();
+ if (name.isEmpty() || source.isEmpty())
+ return;
+
+ QListWidgetItem *listItem = new QListWidgetItem(ui->fileNameEdit->text(), ui->styleSheetList);
+ listItem->setFlags(listItem->flags() | Qt::ItemIsUserCheckable);
+ listItem->setCheckState(Qt::Checked);
+
+ MainWindow *window = static_cast<MainWindow *>(parent());
+ window->insertStyleSheet(name, source, true);
+
+ QSettings settings;
+ settings.beginGroup("styleSheets");
+ settings.setValue(name, QVariant::fromValue(qMakePair(source, true)));
+ settings.endGroup();
+
+ ui->addButton->setEnabled(false);
+}
+
+void StylesheetDialog::removeButtonClicked()
+{
+ if (ui->styleSheetList->selectedItems().isEmpty())
+ return;
+
+ MainWindow *window = static_cast<MainWindow *>(parent());
+ QSettings settings;
+ settings.beginGroup("styleSheets");
+
+ QListWidgetItem *item = ui->styleSheetList->selectedItems().first();
+ const QString name = item->text();
+ window->removeStyleSheet(name, true);
+ settings.remove(name);
+ delete item;
+
+ settings.endGroup();
+}
diff --git a/examples/webenginewidgets/recipebrowser/stylesheetdialog.h b/examples/webenginewidgets/recipebrowser/stylesheetdialog.h
new file mode 100644
index 000000000..ca1b4ae99
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/stylesheetdialog.h
@@ -0,0 +1,39 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#ifndef STYLESHEETDIALOG_H
+#define STYLESHEETDIALOG_H
+
+#include <QDialog>
+#include <QListWidgetItem>
+
+QT_BEGIN_NAMESPACE
+namespace Ui {
+class StylesheetDialog;
+}
+QT_END_NAMESPACE
+
+typedef QPair<QString, bool> StyleSheet; // <source, isEnabled>
+Q_DECLARE_METATYPE(StyleSheet);
+
+class StylesheetDialog : public QDialog
+{
+ Q_OBJECT
+
+public:
+ explicit StylesheetDialog(QWidget *parent = 0);
+ ~StylesheetDialog();
+
+private slots:
+ void currentStyleSheetChanged(QListWidgetItem *current, QListWidgetItem *previous);
+ void listItemClicked(QListWidgetItem *item);
+ void fileNameChanged(const QString &text);
+
+ void addButtonClicked();
+ void removeButtonClicked();
+
+private:
+ Ui::StylesheetDialog *ui;
+};
+
+#endif // STYLESHEETDIALOG_H
diff --git a/examples/webenginewidgets/recipebrowser/stylesheetdialog.ui b/examples/webenginewidgets/recipebrowser/stylesheetdialog.ui
new file mode 100644
index 000000000..6ef389195
--- /dev/null
+++ b/examples/webenginewidgets/recipebrowser/stylesheetdialog.ui
@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>StylesheetDialog</class>
+ <widget class="QDialog" name="StylesheetDialog">
+ <property name="windowModality">
+ <enum>Qt::ApplicationModal</enum>
+ </property>
+ <property name="windowTitle">
+ <string>Stylesheets</string>
+ </property>
+ <property name="modal">
+ <bool>true</bool>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_2">
+ <item row="3" column="1">
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0" rowspan="3">
+ <widget class="QListWidget" name="styleSheetList"/>
+ </item>
+ <item row="0" column="1" rowspan="3">
+ <widget class="QFrame" name="frame">
+ <property name="frameShape">
+ <enum>QFrame::StyledPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>QFrame::Plain</enum>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="fileNameLabel">
+ <property name="text">
+ <string>Stylesheet name:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="fileNameEdit"/>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="sourceLabel">
+ <property name="text">
+ <string>Source code:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" colspan="2">
+ <widget class="QPlainTextEdit" name="sourceCodeEdit">
+ <property name="font">
+ <font>
+ <family>Courier New</family>
+ <pointsize>10</pointsize>
+ </font>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" colspan="2">
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QPushButton" name="addButton">
+ <property name="text">
+ <string>Add</string>
+ </property>
+ <property name="icon">
+ <iconset resource="recipebrowser.qrc">
+ <normaloff>:/icons/add.svg</normaloff>:/icons/add.svg</iconset>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="removeButton">
+ <property name="text">
+ <string>Remove</string>
+ </property>
+ <property name="icon">
+ <iconset resource="recipebrowser.qrc">
+ <normaloff>:/icons/remove.svg</normaloff>:/icons/remove.svg</iconset>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources>
+ <include location="recipebrowser.qrc"/>
+ </resources>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>StylesheetDialog</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>248</x>
+ <y>254</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>157</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>StylesheetDialog</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>316</x>
+ <y>260</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/examples/webenginewidgets/simplebrowser/CMakeLists.txt b/examples/webenginewidgets/simplebrowser/CMakeLists.txt
new file mode 100644
index 000000000..cbaffa6d9
--- /dev/null
+++ b/examples/webenginewidgets/simplebrowser/CMakeLists.txt
@@ -0,0 +1,109 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+project(simplebrowser LANGUAGES CXX)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTOUIC ON)
+
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webenginewidgets/simplebrowser")
+
+find_package(Qt6 REQUIRED COMPONENTS Core Gui WebEngineWidgets)
+
+qt_add_executable(simplebrowser
+ browser.cpp browser.h
+ browserwindow.cpp browserwindow.h
+ certificateerrordialog.ui
+ downloadmanagerwidget.cpp downloadmanagerwidget.h downloadmanagerwidget.ui
+ downloadwidget.cpp downloadwidget.h downloadwidget.ui
+ main.cpp
+ passworddialog.ui
+ tabwidget.cpp tabwidget.h
+ webpage.cpp webpage.h
+ webpopupwindow.cpp webpopupwindow.h
+ webview.cpp webview.h
+ webauthdialog.cpp webauthdialog.h webauthdialog.ui
+)
+
+if(WIN32)
+ set_property(
+ TARGET simplebrowser
+ APPEND PROPERTY
+ SOURCES simplebrowser.exe.manifest)
+endif()
+
+set_target_properties(simplebrowser PROPERTIES
+ WIN32_EXECUTABLE TRUE
+ MACOSX_BUNDLE TRUE
+ MACOSX_BUNDLE_GUI_IDENTIFIER "io.qt.examples.webenginewidgets.simplebrowser"
+)
+
+target_link_libraries(simplebrowser PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::WebEngineWidgets
+)
+
+# Resources:
+set(simplebrowser_resource_files
+ "data/AppLogoColor.png"
+ "data/ninja.png"
+)
+
+qt_add_resources(simplebrowser "simplebrowser"
+ PREFIX
+ "/"
+ BASE
+ "data"
+ FILES
+ ${simplebrowser_resource_files}
+)
+
+set(simplebrowser1_resource_files
+ "data/3rdparty/dialog-error.png"
+ "data/3rdparty/edit-clear.png"
+ "data/3rdparty/go-bottom.png"
+ "data/3rdparty/go-next.png"
+ "data/3rdparty/go-previous.png"
+ "data/3rdparty/process-stop.png"
+ "data/3rdparty/text-html.png"
+ "data/3rdparty/view-refresh.png"
+)
+
+qt_add_resources(simplebrowser "simplebrowser1"
+ PREFIX
+ "/"
+ BASE
+ "data/3rdparty"
+ FILES
+ ${simplebrowser1_resource_files}
+)
+
+if (APPLE)
+ set_target_properties(simplebrowser PROPERTIES
+ MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.cmake.macos.plist"
+ )
+
+ if (NOT CMAKE_GENERATOR STREQUAL "Xcode")
+ # Need to sign application for location permissions to work
+ if(QT_FEATURE_debug_and_release)
+ set(exe_path "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/")
+ else()
+ unset(exe_path)
+ endif()
+ add_custom_command(TARGET simplebrowser
+ POST_BUILD COMMAND codesign --force -s - ${exe_path}simplebrowser.app
+ )
+ endif()
+endif()
+
+install(TARGETS simplebrowser
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/webenginewidgets/simplebrowser/Info.cmake.macos.plist b/examples/webenginewidgets/simplebrowser/Info.cmake.macos.plist
new file mode 100644
index 000000000..7abb7e01a
--- /dev/null
+++ b/examples/webenginewidgets/simplebrowser/Info.cmake.macos.plist
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleName</key>
+ <string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
+ <key>CFBundleExecutable</key>
+ <string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
+ <key>CFBundleVersion</key>
+ <string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
+ <key>CFBundleShortVersionString</key>
+ <string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
+ <key>LSMinimumSystemVersion</key>
+ <string>${CMAKE_OSX_DEPLOYMENT_TARGET}</string>
+ <key>NSHumanReadableCopyright</key>
+ <string>${MACOSX_BUNDLE_COPYRIGHT}</string>
+ <key>CFBundleIconFile</key>
+ <string>${MACOSX_BUNDLE_ICON_FILE}</string>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>NSSupportsAutomaticGraphicsSwitching</key>
+ <true/>
+ <key>NSLocationUsageDescription</key>
+ <string>Simple Browser would like to give web sites access to your location for demo purposes.</string>
+ <key>NSMicrophoneUsageDescription</key>
+ <string>Simple Browser would like to give web sites access to your computer's microphone for demo purposes.</string>
+ <key>NSCameraUsageDescription</key>
+ <string>Simple Browser would like to give web sites access to your computer's camera for demo purposes.</string>
+</dict>
+</plist>
diff --git a/examples/webenginewidgets/simplebrowser/browser.cpp b/examples/webenginewidgets/simplebrowser/browser.cpp
index 68458b2a4..fd68246d0 100644
--- a/examples/webenginewidgets/simplebrowser/browser.cpp
+++ b/examples/webenginewidgets/simplebrowser/browser.cpp
@@ -1,56 +1,13 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "browser.h"
#include "browserwindow.h"
+#include <QWebEngineSettings>
+
+using namespace Qt::StringLiterals;
+
Browser::Browser()
{
// Quit application if the download manager window is the only remaining window
@@ -61,27 +18,38 @@ Browser::Browser()
&m_downloadManagerWidget, &DownloadManagerWidget::downloadRequested);
}
-BrowserWindow *Browser::createWindow(bool offTheRecord)
+BrowserWindow *Browser::createHiddenWindow(bool offTheRecord)
{
- if (offTheRecord && !m_otrProfile) {
- m_otrProfile.reset(new QWebEngineProfile);
- QObject::connect(
- m_otrProfile.get(), &QWebEngineProfile::downloadRequested,
- &m_downloadManagerWidget, &DownloadManagerWidget::downloadRequested);
+ if (!offTheRecord && !m_profile) {
+ const QString name = u"simplebrowser."_s + QLatin1StringView(qWebEngineChromiumVersion());
+ m_profile.reset(new QWebEngineProfile(name));
+ m_profile->settings()->setAttribute(QWebEngineSettings::PluginsEnabled, true);
+ m_profile->settings()->setAttribute(QWebEngineSettings::DnsPrefetchEnabled, true);
+ m_profile->settings()->setAttribute(QWebEngineSettings::LocalContentCanAccessRemoteUrls, true);
+ m_profile->settings()->setAttribute(QWebEngineSettings::LocalContentCanAccessFileUrls, false);
+ m_profile->settings()->setAttribute(QWebEngineSettings::ScreenCaptureEnabled, true);
+ QObject::connect(m_profile.get(), &QWebEngineProfile::downloadRequested,
+ &m_downloadManagerWidget, &DownloadManagerWidget::downloadRequested);
}
- auto profile = offTheRecord ? m_otrProfile.get() : QWebEngineProfile::defaultProfile();
+ auto profile = !offTheRecord ? m_profile.get() : QWebEngineProfile::defaultProfile();
auto mainWindow = new BrowserWindow(this, profile, false);
m_windows.append(mainWindow);
QObject::connect(mainWindow, &QObject::destroyed, [this, mainWindow]() {
m_windows.removeOne(mainWindow);
});
+ return mainWindow;
+}
+
+BrowserWindow *Browser::createWindow(bool offTheRecord)
+{
+ auto *mainWindow = createHiddenWindow(offTheRecord);
mainWindow->show();
return mainWindow;
}
BrowserWindow *Browser::createDevToolsWindow()
{
- auto profile = QWebEngineProfile::defaultProfile();
+ auto profile = m_profile ? m_profile.get() : QWebEngineProfile::defaultProfile();
auto mainWindow = new BrowserWindow(this, profile, true);
m_windows.append(mainWindow);
QObject::connect(mainWindow, &QObject::destroyed, [this, mainWindow]() {
diff --git a/examples/webenginewidgets/simplebrowser/browser.h b/examples/webenginewidgets/simplebrowser/browser.h
index 4c17121df..dcee68c79 100644
--- a/examples/webenginewidgets/simplebrowser/browser.h
+++ b/examples/webenginewidgets/simplebrowser/browser.h
@@ -1,59 +1,12 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef BROWSER_H
#define BROWSER_H
#include "downloadmanagerwidget.h"
-#include <QVector>
+#include <QList>
#include <QWebEngineProfile>
class BrowserWindow;
@@ -63,16 +16,17 @@ class Browser
public:
Browser();
- QVector<BrowserWindow*> windows() { return m_windows; }
+ QList<BrowserWindow*> windows() { return m_windows; }
+ BrowserWindow *createHiddenWindow(bool offTheRecord = false);
BrowserWindow *createWindow(bool offTheRecord = false);
BrowserWindow *createDevToolsWindow();
DownloadManagerWidget &downloadManagerWidget() { return m_downloadManagerWidget; }
private:
- QVector<BrowserWindow*> m_windows;
+ QList<BrowserWindow*> m_windows;
DownloadManagerWidget m_downloadManagerWidget;
- QScopedPointer<QWebEngineProfile> m_otrProfile;
+ QScopedPointer<QWebEngineProfile> m_profile;
};
#endif // BROWSER_H
diff --git a/examples/webenginewidgets/simplebrowser/browserwindow.cpp b/examples/webenginewidgets/simplebrowser/browserwindow.cpp
index 12a1e6844..a5a83a2d3 100644
--- a/examples/webenginewidgets/simplebrowser/browserwindow.cpp
+++ b/examples/webenginewidgets/simplebrowser/browserwindow.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "browser.h"
#include "browserwindow.h"
@@ -55,7 +8,6 @@
#include "webview.h"
#include <QApplication>
#include <QCloseEvent>
-#include <QDesktopWidget>
#include <QEvent>
#include <QFileDialog>
#include <QInputDialog>
@@ -66,23 +18,15 @@
#include <QStatusBar>
#include <QToolBar>
#include <QVBoxLayout>
-#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
#include <QWebEngineFindTextResult>
-#endif
#include <QWebEngineProfile>
+using namespace Qt::StringLiterals;
+
BrowserWindow::BrowserWindow(Browser *browser, QWebEngineProfile *profile, bool forDevTools)
: m_browser(browser)
, m_profile(profile)
, m_tabWidget(new TabWidget(profile, this))
- , m_progressBar(nullptr)
- , m_historyBackAction(nullptr)
- , m_historyForwardAction(nullptr)
- , m_stopAction(nullptr)
- , m_reloadAction(nullptr)
- , m_stopReloadAction(nullptr)
- , m_urlLineEdit(nullptr)
- , m_favAction(nullptr)
{
setAttribute(Qt::WA_DeleteOnClose, true);
setFocusPolicy(Qt::ClickFocus);
@@ -108,7 +52,7 @@ BrowserWindow::BrowserWindow(Browser *browser, QWebEngineProfile *profile, bool
m_progressBar->setMaximumHeight(1);
m_progressBar->setTextVisible(false);
- m_progressBar->setStyleSheet(QStringLiteral("QProgressBar {border: 0px} QProgressBar::chunk {background-color: #da4453}"));
+ m_progressBar->setStyleSheet(u"QProgressBar {border: 0px} QProgressBar::chunk {background-color: #da4453}"_s);
layout->addWidget(m_progressBar);
}
@@ -132,9 +76,7 @@ BrowserWindow::BrowserWindow(Browser *browser, QWebEngineProfile *profile, bool
connect(m_urlLineEdit, &QLineEdit::returnPressed, [this]() {
m_tabWidget->setUrl(QUrl::fromUserInput(m_urlLineEdit->text()));
});
-#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
connect(m_tabWidget, &TabWidget::findTextFinished, this, &BrowserWindow::handleFindTextFinished);
-#endif
QAction *focusUrlLineEditAction = new QAction(this);
addAction(focusUrlLineEditAction);
@@ -158,7 +100,11 @@ QSize BrowserWindow::sizeHint() const
QMenu *BrowserWindow::createFileMenu(TabWidget *tabWidget)
{
QMenu *fileMenu = new QMenu(tr("&File"));
+#if QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)
+ fileMenu->addAction(tr("&New Window"), QKeySequence::New, this, &BrowserWindow::handleNewWindowTriggered);
+#else
fileMenu->addAction(tr("&New Window"), this, &BrowserWindow::handleNewWindowTriggered, QKeySequence::New);
+#endif
fileMenu->addAction(tr("New &Incognito Window"), this, &BrowserWindow::handleNewIncognitoWindowTriggered);
QAction *newTabAction = new QAction(tr("New &Tab"), this);
@@ -169,7 +115,11 @@ QMenu *BrowserWindow::createFileMenu(TabWidget *tabWidget)
});
fileMenu->addAction(newTabAction);
+#if QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)
+ fileMenu->addAction(tr("&Open File..."), QKeySequence::Open, this, &BrowserWindow::handleFileOpenTriggered);
+#else
fileMenu->addAction(tr("&Open File..."), this, &BrowserWindow::handleFileOpenTriggered, QKeySequence::Open);
+#endif
fileMenu->addSeparator();
QAction *closeTabAction = new QAction(tr("&Close Tab"), this);
@@ -310,13 +260,21 @@ QMenu *BrowserWindow::createWindowMenu(TabWidget *tabWidget)
previousTabAction->setShortcuts(shortcuts);
connect(previousTabAction, &QAction::triggered, tabWidget, &TabWidget::previousTab);
- connect(menu, &QMenu::aboutToShow, [this, menu, nextTabAction, previousTabAction]() {
+ QAction *inspectorAction = new QAction(tr("Open inspector in new window"), this);
+ shortcuts.clear();
+ shortcuts.append(QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_I));
+ inspectorAction->setShortcuts(shortcuts);
+ connect(inspectorAction, &QAction::triggered, [this]() { emit currentTab()->devToolsRequested(currentTab()->page()); });
+
+ connect(menu, &QMenu::aboutToShow, [this, menu, nextTabAction, previousTabAction, inspectorAction]() {
menu->clear();
menu->addAction(nextTabAction);
menu->addAction(previousTabAction);
menu->addSeparator();
+ menu->addAction(inspectorAction);
+ menu->addSeparator();
- QVector<BrowserWindow*> windows = m_browser->windows();
+ QList<BrowserWindow*> windows = m_browser->windows();
int index(-1);
for (auto window : windows) {
QAction *action = menu->addAction(window->windowTitle(), this, &BrowserWindow::handleShowWindowTriggered);
@@ -336,6 +294,20 @@ QMenu *BrowserWindow::createHelpMenu()
return helpMenu;
}
+static bool isBackspace(const QKeySequence &k)
+{
+ return (k[0].key() & Qt::Key_unknown) == Qt::Key_Backspace;
+}
+
+// Chromium already handles navigate on backspace when appropriate.
+static QList<QKeySequence> removeBackspace(QList<QKeySequence> keys)
+{
+ const auto it = std::find_if(keys.begin(), keys.end(), isBackspace);
+ if (it != keys.end())
+ keys.erase(it);
+ return keys;
+}
+
QToolBar *BrowserWindow::createToolBar()
{
QToolBar *navigationBar = new QToolBar(tr("Navigation"));
@@ -343,19 +315,13 @@ QToolBar *BrowserWindow::createToolBar()
navigationBar->toggleViewAction()->setEnabled(false);
m_historyBackAction = new QAction(this);
- QList<QKeySequence> backShortcuts = QKeySequence::keyBindings(QKeySequence::Back);
- for (auto it = backShortcuts.begin(); it != backShortcuts.end();) {
- // Chromium already handles navigate on backspace when appropriate.
- if ((*it)[0] == Qt::Key_Backspace)
- it = backShortcuts.erase(it);
- else
- ++it;
- }
+ auto backShortcuts = removeBackspace(QKeySequence::keyBindings(QKeySequence::Back));
// For some reason Qt doesn't bind the dedicated Back key to Back.
backShortcuts.append(QKeySequence(Qt::Key_Back));
m_historyBackAction->setShortcuts(backShortcuts);
m_historyBackAction->setIconVisibleInMenu(false);
- m_historyBackAction->setIcon(QIcon(QStringLiteral(":go-previous.png")));
+ m_historyBackAction->setIcon(QIcon::fromTheme(QIcon::ThemeIcon::GoPrevious,
+ QIcon(":go-previous.png"_L1)));
m_historyBackAction->setToolTip(tr("Go back in history"));
connect(m_historyBackAction, &QAction::triggered, [this]() {
m_tabWidget->triggerWebPageAction(QWebEnginePage::Back);
@@ -363,17 +329,12 @@ QToolBar *BrowserWindow::createToolBar()
navigationBar->addAction(m_historyBackAction);
m_historyForwardAction = new QAction(this);
- QList<QKeySequence> fwdShortcuts = QKeySequence::keyBindings(QKeySequence::Forward);
- for (auto it = fwdShortcuts.begin(); it != fwdShortcuts.end();) {
- if (((*it)[0] & Qt::Key_unknown) == Qt::Key_Backspace)
- it = fwdShortcuts.erase(it);
- else
- ++it;
- }
+ auto fwdShortcuts = removeBackspace(QKeySequence::keyBindings(QKeySequence::Forward));
fwdShortcuts.append(QKeySequence(Qt::Key_Forward));
m_historyForwardAction->setShortcuts(fwdShortcuts);
m_historyForwardAction->setIconVisibleInMenu(false);
- m_historyForwardAction->setIcon(QIcon(QStringLiteral(":go-next.png")));
+ m_historyForwardAction->setIcon(QIcon::fromTheme(QIcon::ThemeIcon::GoNext,
+ QIcon(":go-next.png"_L1)));
m_historyForwardAction->setToolTip(tr("Go forward in history"));
connect(m_historyForwardAction, &QAction::triggered, [this]() {
m_tabWidget->triggerWebPageAction(QWebEnginePage::Forward);
@@ -393,12 +354,11 @@ QToolBar *BrowserWindow::createToolBar()
navigationBar->addWidget(m_urlLineEdit);
auto downloadsAction = new QAction(this);
- downloadsAction->setIcon(QIcon(QStringLiteral(":go-bottom.png")));
+ downloadsAction->setIcon(QIcon(u":go-bottom.png"_s));
downloadsAction->setToolTip(tr("Show downloads"));
navigationBar->addAction(downloadsAction);
- connect(downloadsAction, &QAction::triggered, [this]() {
- m_browser->downloadManagerWidget().show();
- });
+ connect(downloadsAction, &QAction::triggered,
+ &m_browser->downloadManagerWidget(), &QWidget::show);
return navigationBar;
}
@@ -466,14 +426,7 @@ void BrowserWindow::handleFindActionTriggered()
m_lastSearch, &ok);
if (ok && !search.isEmpty()) {
m_lastSearch = search;
-#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
currentTab()->findText(m_lastSearch);
-#else
- currentTab()->findText(m_lastSearch, 0, [this](bool found) {
- if (!found)
- statusBar()->showMessage(tr("\"%1\" not found.").arg(m_lastSearch));
- });
-#endif
}
}
@@ -505,8 +458,10 @@ WebView *BrowserWindow::currentTab() const
void BrowserWindow::handleWebViewLoadProgress(int progress)
{
- static QIcon stopIcon(QStringLiteral(":process-stop.png"));
- static QIcon reloadIcon(QStringLiteral(":view-refresh.png"));
+ static QIcon stopIcon = QIcon::fromTheme(QIcon::ThemeIcon::ProcessStop,
+ QIcon(":process-stop.png"_L1));
+ static QIcon reloadIcon = QIcon::fromTheme(QIcon::ThemeIcon::ViewRefresh,
+ QIcon(":view-refresh.png"_L1));
if (0 < progress && progress < 100) {
m_stopReloadAction->setData(QWebEnginePage::Stop);
@@ -525,7 +480,7 @@ void BrowserWindow::handleShowWindowTriggered()
{
if (QAction *action = qobject_cast<QAction*>(sender())) {
int offset = action->data().toInt();
- QVector<BrowserWindow*> windows = m_browser->windows();
+ QList<BrowserWindow*> windows = m_browser->windows();
windows.at(offset)->activateWindow();
windows.at(offset)->currentTab()->setFocus();
}
@@ -537,7 +492,6 @@ void BrowserWindow::handleDevToolsRequested(QWebEnginePage *source)
source->triggerAction(QWebEnginePage::InspectElement);
}
-#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
void BrowserWindow::handleFindTextFinished(const QWebEngineFindTextResult &result)
{
if (result.numberOfMatches() == 0) {
@@ -548,4 +502,3 @@ void BrowserWindow::handleFindTextFinished(const QWebEngineFindTextResult &resul
QString::number(result.numberOfMatches())));
}
}
-#endif
diff --git a/examples/webenginewidgets/simplebrowser/browserwindow.h b/examples/webenginewidgets/simplebrowser/browserwindow.h
index ea12ad9df..55eeb46c2 100644
--- a/examples/webenginewidgets/simplebrowser/browserwindow.h
+++ b/examples/webenginewidgets/simplebrowser/browserwindow.h
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef BROWSERWINDOW_H
#define BROWSERWINDOW_H
@@ -69,7 +22,8 @@ class BrowserWindow : public QMainWindow
Q_OBJECT
public:
- BrowserWindow(Browser *browser, QWebEngineProfile *profile, bool forDevTools = false);
+ explicit BrowserWindow(Browser *browser, QWebEngineProfile *profile,
+ bool forDevTools = false);
QSize sizeHint() const override;
TabWidget *tabWidget() const;
WebView *currentTab() const;
@@ -88,9 +42,7 @@ private slots:
void handleWebViewTitleChanged(const QString &title);
void handleWebActionEnabledChanged(QWebEnginePage::WebAction action, bool enabled);
void handleDevToolsRequested(QWebEnginePage *source);
-#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
void handleFindTextFinished(const QWebEngineFindTextResult &result);
-#endif
private:
QMenu *createFileMenu(TabWidget *tabWidget);
@@ -104,14 +56,14 @@ private:
Browser *m_browser;
QWebEngineProfile *m_profile;
TabWidget *m_tabWidget;
- QProgressBar *m_progressBar;
- QAction *m_historyBackAction;
- QAction *m_historyForwardAction;
- QAction *m_stopAction;
- QAction *m_reloadAction;
- QAction *m_stopReloadAction;
- QLineEdit *m_urlLineEdit;
- QAction *m_favAction;
+ QProgressBar *m_progressBar = nullptr;
+ QAction *m_historyBackAction = nullptr;
+ QAction *m_historyForwardAction = nullptr;
+ QAction *m_stopAction = nullptr;
+ QAction *m_reloadAction = nullptr;
+ QAction *m_stopReloadAction = nullptr;
+ QLineEdit *m_urlLineEdit = nullptr;
+ QAction *m_favAction = nullptr;
QString m_lastSearch;
};
diff --git a/examples/webenginewidgets/simplebrowser/data/3rdparty/qt_attribution.json b/examples/webenginewidgets/simplebrowser/data/3rdparty/qt_attribution.json
index 853adeb20..fbc96416e 100644
--- a/examples/webenginewidgets/simplebrowser/data/3rdparty/qt_attribution.json
+++ b/examples/webenginewidgets/simplebrowser/data/3rdparty/qt_attribution.json
@@ -9,16 +9,16 @@
"Homepage": "http://tango.freedesktop.org/Tango_Icon_Library",
"Version": "0.8.90",
"DownloadLocation": "http://tango.freedesktop.org/releases/tango-icon-theme-0.8.90.tar.gz",
- "LicenseId": "DocumentRef-PublicDomain",
+ "LicenseId": "urn:dje:license:public-domain",
"License": "Public Domain",
"LicenseFile": "COPYING",
- "Copyright": "Ulisse Perusin <uli.peru@gmail.com>
-Steven Garrity <sgarrity@silverorange.com>
-Lapo Calamandrei <calamandrei@gmail.com>
-Ryan Collier <rcollier@novell.com>
-Rodney Dawes <dobey@novell.com>
-Andreas Nilsson <nisses.mail@home.se>
-Tuomas Kuosmanen <tigert@tigert.com>
-Garrett LeSage <garrett@novell.com>
-Jakub Steiner <jimmac@novell.com>"
+ "Copyright": ["Ulisse Perusin <uli.peru@gmail.com>",
+ "Steven Garrity <sgarrity@silverorange.com>",
+ "Lapo Calamandrei <calamandrei@gmail.com>",
+ "Ryan Collier <rcollier@novell.com>",
+ "Rodney Dawes <dobey@novell.com>",
+ "Andreas Nilsson <nisses.mail@home.se>",
+ "Tuomas Kuosmanen <tigert@tigert.com>",
+ "Garrett LeSage <garrett@novell.com>",
+ "Jakub Steiner <jimmac@novell.com>"]
}
diff --git a/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc b/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc
index 251ca5ad8..dd7a8b998 100644
--- a/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc
+++ b/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc
@@ -1,35 +1,12 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\example webenginewidgets/simplebrowser
\title WebEngine Widgets Simple Browser Example
\ingroup webengine-widgetexamples
\brief A simple browser based on \QWE Widgets.
+ \examplecategory {Web Technologies}
\image simplebrowser.png
@@ -91,6 +68,9 @@
\skipto main
\printuntil }
+ To suppress flicker when switching the window to OpenGL rendering, we call
+ show after the first browser tab has been added.
+
\section1 Creating Tabs
The \c BrowserWindow constructor initializes all the necessary user interface
@@ -197,22 +177,26 @@
\printuntil menu->popup
\printline }
- \section1 Implementing WebPage Functionality
+ \section1 Implementing WebPage and WebView Functionality
- We implement \c WebPage as a subclass of QWebEnginePage to enable HTTP,
- proxy authentication, and ignoring SSL certificate errors when accessing web
- pages:
+ We implement \c WebPage as a subclass of QWebEnginePage and \c WebView as
+ as subclass of QWebEngineView to enable HTTP, proxy authentication, as well
+ as ignoring SSL certificate errors when accessing web pages:
\quotefromfile webenginewidgets/simplebrowser/webpage.h
\skipto WebPage :
\printuntil }
+ \quotefromfile webenginewidgets/simplebrowser/webview.h
+ \skipto WebView :
+ \printuntil }
+
In all the cases above, we display the appropriate dialog to the user. In
case of authentication, we need to set the correct credential values on the
QAuthenticator object:
- \quotefromfile webenginewidgets/simplebrowser/webpage.cpp
- \skipto WebPage::handleAuthenticationRequired(
+ \quotefromfile webenginewidgets/simplebrowser/webview.cpp
+ \skipto WebView::handleAuthenticationRequired(
\printuntil }
\printuntil }
\printline }
@@ -224,7 +208,7 @@
whether the certificate should be ignored.
\quotefromfile webenginewidgets/simplebrowser/webpage.cpp
- \skipto WebPage::certificateError(
+ \skipto WebPage::handleCertificateError(
\printuntil }
\printuntil }
@@ -276,13 +260,15 @@
\skipto /^class Browser$/
\printuntil public:
\dots
+ \skipto createHiddenWindow
+ \printline createHiddenWindow
\skipto createWindow
\printline createWindow
\skipto private:
\printline private:
\dots
- \skipto m_otrProfile
- \printline m_otrProfile
+ \skipto m_profile
+ \printline m_profile
\printline /^\};$/
Required profile for \e{private browsing} is created together with its
@@ -291,8 +277,8 @@
\quotefromfile webenginewidgets/simplebrowser/browser.cpp
- \skipto Browser::createWindow
- \printuntil m_otrProfile.reset
+ \skipto Browser::createHiddenWindow
+ \printuntil m_profile.reset
\dots
All that is left to do is to pass the appropriate profile down to the
@@ -302,7 +288,7 @@
\e{off-the-record} profile instance:
\dots
- \skipto m_otrProfile.get
+ \skipto m_profile.get
\printuntil mainWindow = new BrowserWindow
\skipto return mainWindow
\printuntil /^\}/
@@ -314,7 +300,7 @@
Downloads are associated with a \l QWebEngineProfile. Whenever a download is
triggered on a web page the \l QWebEngineProfile::downloadRequested signal is
- emitted with a \l QWebEngineDownloadItem, which in this example is forwarded
+ emitted with a \l QWebEngineDownloadRequest, which in this example is forwarded
to \c DownloadManagerWidget::downloadRequested:
\quotefromfile webenginewidgets/simplebrowser/browser.cpp
@@ -329,13 +315,44 @@
\skipto DownloadManagerWidget::downloadRequested
\printuntil /^\}/
- The \l QWebEngineDownloadItem object will periodically emit the \l
- {QWebEngineDownloadItem::}{downloadProgress} signal to notify potential
+ The \l QWebEngineDownloadRequest object will periodically emit the \l
+ {QWebEngineDownloadRequest::}{receivedBytesChanged} signal to notify potential
observers of the download progress and the \l
- {QWebEngineDownloadItem::}{stateChanged} signal when the download is
+ {QWebEngineDownloadRequest::}{stateChanged} signal when the download is
finished or when an error occurs. See \c downloadmanagerwidget.cpp for an
example of how these signals can be handled.
+ \section1 Managing WebAuth/FIDO UX Requests
+
+ WebAuth UX requests are associated with \l QWebEnginePage. Whenever an authenticator
+ requires user interaction, a UX request is triggered on the QWebEnginePage and
+ the \l QWebEnginePage::webAuthUxRequested signal is emitted with
+ \l QWebEngineWebAuthUxRequest, which in this example is forwarded
+ to \c WebView::handleAuthenticatorRequired:
+
+ \quotefromfile webenginewidgets/simplebrowser/webview.cpp
+ \skipto connect(page, &QWebEnginePage::webAuthUxRequested
+ \printline connect(page, &QWebEnginePage::webAuthUxRequested
+
+ This method creates a WebAuth UX dialog and initiates the UX request flow.
+
+ \quotefromfile webenginewidgets/simplebrowser/webview.cpp
+ \skipto void WebView::handleWebAuthUxRequested(QWebEngineWebAuthUxRequest *request)
+ \printuntil /^\}/
+
+ The \l QWebEngineWebAuthUxRequest object periodically emits the \l
+ {QWebEngineWebAuthUxRequest::}{stateChanged} signal to notify potential
+ observers of the current WebAuth UX states. The observers update the WebAuth
+ dialog accordingly. See \c webview.cpp and \c webauthdialog.cpp for an example
+ of how these signals can be handled.
+
+ \section1 Signing Requirement for macOS
+
+ To allow web sites access to the location, camera, and microphone when running
+ \e {Simple Browser} on macOS, the application needs to be signed. This is
+ done automatically when building, but you need to set up a valid signing identity
+ for the build environment.
+
\section1 Files and Attributions
The example uses icons from the Tango Icon Library:
diff --git a/examples/webenginewidgets/simplebrowser/downloadmanagerwidget.cpp b/examples/webenginewidgets/simplebrowser/downloadmanagerwidget.cpp
index 2c8831429..fdddc4fb0 100644
--- a/examples/webenginewidgets/simplebrowser/downloadmanagerwidget.cpp
+++ b/examples/webenginewidgets/simplebrowser/downloadmanagerwidget.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "downloadmanagerwidget.h"
@@ -56,33 +9,24 @@
#include <QFileDialog>
#include <QDir>
-#include <QWebEngineDownloadItem>
+#include <QWebEngineDownloadRequest>
DownloadManagerWidget::DownloadManagerWidget(QWidget *parent)
: QWidget(parent)
- , m_numDownloads(0)
{
setupUi(this);
}
-void DownloadManagerWidget::downloadRequested(QWebEngineDownloadItem *download)
+void DownloadManagerWidget::downloadRequested(QWebEngineDownloadRequest *download)
{
- Q_ASSERT(download && download->state() == QWebEngineDownloadItem::DownloadRequested);
+ Q_ASSERT(download && download->state() == QWebEngineDownloadRequest::DownloadRequested);
-#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
QString path = QFileDialog::getSaveFileName(this, tr("Save as"), QDir(download->downloadDirectory()).filePath(download->downloadFileName()));
-#else
- QString path = QFileDialog::getSaveFileName(this, tr("Save as"), download->path());
-#endif
if (path.isEmpty())
return;
-#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
download->setDownloadDirectory(QFileInfo(path).path());
download->setDownloadFileName(QFileInfo(path).fileName());
-#else
- download->setPath(path);
-#endif
download->accept();
add(new DownloadWidget(download));
diff --git a/examples/webenginewidgets/simplebrowser/downloadmanagerwidget.h b/examples/webenginewidgets/simplebrowser/downloadmanagerwidget.h
index 7be9d8102..67df492b9 100644
--- a/examples/webenginewidgets/simplebrowser/downloadmanagerwidget.h
+++ b/examples/webenginewidgets/simplebrowser/downloadmanagerwidget.h
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef DOWNLOADMANAGERWIDGET_H
#define DOWNLOADMANAGERWIDGET_H
@@ -56,7 +9,7 @@
#include <QWidget>
QT_BEGIN_NAMESPACE
-class QWebEngineDownloadItem;
+class QWebEngineDownloadRequest;
QT_END_NAMESPACE
class DownloadWidget;
@@ -69,15 +22,15 @@ public:
explicit DownloadManagerWidget(QWidget *parent = nullptr);
// Prompts user with a "Save As" dialog. If the user doesn't cancel it, then
- // the QWebEngineDownloadItem will be accepted and the DownloadManagerWidget
+ // the QWebEngineDownloadRequest will be accepted and the DownloadManagerWidget
// will be shown on the screen.
- void downloadRequested(QWebEngineDownloadItem *webItem);
+ void downloadRequested(QWebEngineDownloadRequest *webItem);
private:
void add(DownloadWidget *downloadWidget);
void remove(DownloadWidget *downloadWidget);
- int m_numDownloads;
+ int m_numDownloads = 0;
};
#endif // DOWNLOADMANAGERWIDGET_H
diff --git a/examples/webenginewidgets/simplebrowser/downloadwidget.cpp b/examples/webenginewidgets/simplebrowser/downloadwidget.cpp
index c4e3cd805..2fb65e1a8 100644
--- a/examples/webenginewidgets/simplebrowser/downloadwidget.cpp
+++ b/examples/webenginewidgets/simplebrowser/downloadwidget.cpp
@@ -1,85 +1,36 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "downloadwidget.h"
#include <QFileInfo>
#include <QUrl>
-#include <QWebEngineDownloadItem>
+#include <QWebEngineDownloadRequest>
-DownloadWidget::DownloadWidget(QWebEngineDownloadItem *download, QWidget *parent)
+using namespace Qt::StringLiterals;
+
+DownloadWidget::DownloadWidget(QWebEngineDownloadRequest *download, QWidget *parent)
: QFrame(parent)
, m_download(download)
, m_timeAdded()
{
m_timeAdded.start();
setupUi(this);
-#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
m_dstName->setText(m_download->downloadFileName());
-#else
- m_dstName->setText(QFileInfo(m_download->path()).fileName());
-#endif
m_srcUrl->setText(m_download->url().toDisplayString());
connect(m_cancelButton, &QPushButton::clicked,
[this](bool) {
- if (m_download->state() == QWebEngineDownloadItem::DownloadInProgress)
+ if (m_download->state() == QWebEngineDownloadRequest::DownloadInProgress)
m_download->cancel();
else
emit removeClicked(this);
});
- connect(m_download, &QWebEngineDownloadItem::downloadProgress,
- this, &DownloadWidget::updateWidget);
+ connect(m_download, &QWebEngineDownloadRequest::totalBytesChanged, this, &DownloadWidget::updateWidget);
+ connect(m_download, &QWebEngineDownloadRequest::receivedBytesChanged, this, &DownloadWidget::updateWidget);
- connect(m_download, &QWebEngineDownloadItem::stateChanged,
+ connect(m_download, &QWebEngineDownloadRequest::stateChanged,
this, &DownloadWidget::updateWidget);
updateWidget();
@@ -89,12 +40,11 @@ inline QString DownloadWidget::withUnit(qreal bytes)
{
if (bytes < (1 << 10))
return tr("%L1 B").arg(bytes);
- else if (bytes < (1 << 20))
+ if (bytes < (1 << 20))
return tr("%L1 KiB").arg(bytes / (1 << 10), 0, 'f', 2);
- else if (bytes < (1 << 30))
+ if (bytes < (1 << 30))
return tr("%L1 MiB").arg(bytes / (1 << 20), 0, 'f', 2);
- else
- return tr("%L1 GiB").arg(bytes / (1 << 30), 0, 'f', 2);
+ return tr("%L1 GiB").arg(bytes / (1 << 30), 0, 'f', 2);
}
void DownloadWidget::updateWidget()
@@ -105,44 +55,40 @@ void DownloadWidget::updateWidget()
auto state = m_download->state();
switch (state) {
- case QWebEngineDownloadItem::DownloadRequested:
+ case QWebEngineDownloadRequest::DownloadRequested:
Q_UNREACHABLE();
break;
- case QWebEngineDownloadItem::DownloadInProgress:
+ case QWebEngineDownloadRequest::DownloadInProgress:
if (totalBytes >= 0) {
m_progressBar->setValue(qRound(100 * receivedBytes / totalBytes));
m_progressBar->setDisabled(false);
m_progressBar->setFormat(
tr("%p% - %1 of %2 downloaded - %3/s")
- .arg(withUnit(receivedBytes))
- .arg(withUnit(totalBytes))
- .arg(withUnit(bytesPerSecond)));
+ .arg(withUnit(receivedBytes), withUnit(totalBytes),
+ withUnit(bytesPerSecond)));
} else {
m_progressBar->setValue(0);
m_progressBar->setDisabled(false);
m_progressBar->setFormat(
tr("unknown size - %1 downloaded - %2/s")
- .arg(withUnit(receivedBytes))
- .arg(withUnit(bytesPerSecond)));
+ .arg(withUnit(receivedBytes), withUnit(bytesPerSecond)));
}
break;
- case QWebEngineDownloadItem::DownloadCompleted:
+ case QWebEngineDownloadRequest::DownloadCompleted:
m_progressBar->setValue(100);
m_progressBar->setDisabled(true);
m_progressBar->setFormat(
tr("completed - %1 downloaded - %2/s")
- .arg(withUnit(receivedBytes))
- .arg(withUnit(bytesPerSecond)));
+ .arg(withUnit(receivedBytes), withUnit(bytesPerSecond)));
break;
- case QWebEngineDownloadItem::DownloadCancelled:
+ case QWebEngineDownloadRequest::DownloadCancelled:
m_progressBar->setValue(0);
m_progressBar->setDisabled(true);
m_progressBar->setFormat(
tr("cancelled - %1 downloaded - %2/s")
- .arg(withUnit(receivedBytes))
- .arg(withUnit(bytesPerSecond)));
+ .arg(withUnit(receivedBytes), withUnit(bytesPerSecond)));
break;
- case QWebEngineDownloadItem::DownloadInterrupted:
+ case QWebEngineDownloadRequest::DownloadInterrupted:
m_progressBar->setValue(0);
m_progressBar->setDisabled(true);
m_progressBar->setFormat(
@@ -151,12 +97,14 @@ void DownloadWidget::updateWidget()
break;
}
- if (state == QWebEngineDownloadItem::DownloadInProgress) {
- static QIcon cancelIcon(QStringLiteral(":process-stop.png"));
+ if (state == QWebEngineDownloadRequest::DownloadInProgress) {
+ static QIcon cancelIcon(QIcon::fromTheme(QIcon::ThemeIcon::ProcessStop,
+ QIcon(":process-stop.png"_L1)));
m_cancelButton->setIcon(cancelIcon);
m_cancelButton->setToolTip(tr("Stop downloading"));
} else {
- static QIcon removeIcon(QStringLiteral(":edit-clear.png"));
+ static QIcon removeIcon(QIcon::fromTheme(QIcon::ThemeIcon::EditClear,
+ QIcon(":edit-clear.png"_L1)));
m_cancelButton->setIcon(removeIcon);
m_cancelButton->setToolTip(tr("Remove from list"));
}
diff --git a/examples/webenginewidgets/simplebrowser/downloadwidget.h b/examples/webenginewidgets/simplebrowser/downloadwidget.h
index c20676aa6..bf24d242c 100644
--- a/examples/webenginewidgets/simplebrowser/downloadwidget.h
+++ b/examples/webenginewidgets/simplebrowser/downloadwidget.h
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef DOWNLOADWIDGET_H
#define DOWNLOADWIDGET_H
@@ -57,16 +10,16 @@
#include <QElapsedTimer>
QT_BEGIN_NAMESPACE
-class QWebEngineDownloadItem;
+class QWebEngineDownloadRequest;
QT_END_NAMESPACE
-// Displays one ongoing or finished download (QWebEngineDownloadItem).
+// Displays one ongoing or finished download (QWebEngineDownloadRequest).
class DownloadWidget final : public QFrame, public Ui::DownloadWidget
{
Q_OBJECT
public:
- // Precondition: The QWebEngineDownloadItem has been accepted.
- explicit DownloadWidget(QWebEngineDownloadItem *download, QWidget *parent = nullptr);
+ // Precondition: The QWebEngineDownloadRequest has been accepted.
+ explicit DownloadWidget(QWebEngineDownloadRequest *download, QWidget *parent = nullptr);
signals:
// This signal is emitted when the user indicates that they want to remove
@@ -79,7 +32,7 @@ private slots:
private:
QString withUnit(qreal bytes);
- QWebEngineDownloadItem *m_download;
+ QWebEngineDownloadRequest *m_download;
QElapsedTimer m_timeAdded;
};
diff --git a/examples/webenginewidgets/simplebrowser/main.cpp b/examples/webenginewidgets/simplebrowser/main.cpp
index ddc8b4d01..ff4811eae 100644
--- a/examples/webenginewidgets/simplebrowser/main.cpp
+++ b/examples/webenginewidgets/simplebrowser/main.cpp
@@ -1,90 +1,44 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "browser.h"
#include "browserwindow.h"
#include "tabwidget.h"
#include <QApplication>
+#include <QLoggingCategory>
#include <QWebEngineProfile>
#include <QWebEngineSettings>
+using namespace Qt::StringLiterals;
+
QUrl commandLineUrlArgument()
{
const QStringList args = QCoreApplication::arguments();
for (const QString &arg : args.mid(1)) {
- if (!arg.startsWith(QLatin1Char('-')))
+ if (!arg.startsWith(u'-'))
return QUrl::fromUserInput(arg);
}
- return QUrl(QStringLiteral("https://www.qt.io"));
+ return QUrl(u"chrome://qt"_s);
}
int main(int argc, char **argv)
{
QCoreApplication::setOrganizationName("QtExamples");
- QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
- QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
QApplication app(argc, argv);
- app.setWindowIcon(QIcon(QStringLiteral(":AppLogoColor.png")));
+ app.setWindowIcon(QIcon(u":AppLogoColor.png"_s));
+ QLoggingCategory::setFilterRules(u"qt.webenginecontext.debug=true"_s);
- QWebEngineSettings::defaultSettings()->setAttribute(QWebEngineSettings::PluginsEnabled, true);
-#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
- QWebEngineSettings::defaultSettings()->setAttribute(QWebEngineSettings::DnsPrefetchEnabled, true);
- QWebEngineProfile::defaultProfile()->setUseForGlobalCertificateVerification();
-#endif
+ QWebEngineProfile::defaultProfile()->settings()->setAttribute(QWebEngineSettings::PluginsEnabled, true);
+ QWebEngineProfile::defaultProfile()->settings()->setAttribute(QWebEngineSettings::DnsPrefetchEnabled, true);
+ QWebEngineProfile::defaultProfile()->settings()->setAttribute(
+ QWebEngineSettings::ScreenCaptureEnabled, true);
QUrl url = commandLineUrlArgument();
Browser browser;
- BrowserWindow *window = browser.createWindow();
+ BrowserWindow *window = browser.createHiddenWindow();
window->tabWidget()->setUrl(url);
-
+ window->show();
return app.exec();
}
diff --git a/examples/webenginewidgets/simplebrowser/simplebrowser.exe.manifest b/examples/webenginewidgets/simplebrowser/simplebrowser.exe.manifest
new file mode 100644
index 000000000..acc401776
--- /dev/null
+++ b/examples/webenginewidgets/simplebrowser/simplebrowser.exe.manifest
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
+ <application>
+ <!--The ID below indicates application support for Windows Vista -->
+ <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
+ <!--The ID below indicates application support for Windows 7 -->
+ <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
+ <!--The ID below indicates application support for Windows 8 -->
+ <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
+ <!--The ID below indicates application support for Windows 8.1 -->
+ <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
+ <!--The ID below indicates application support for Windows 10/11 -->
+ <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
+ </application>
+</compatibility>
+</assembly>
diff --git a/examples/webenginewidgets/simplebrowser/simplebrowser.pro b/examples/webenginewidgets/simplebrowser/simplebrowser.pro
index 7584cfb01..8598d237a 100644
--- a/examples/webenginewidgets/simplebrowser/simplebrowser.pro
+++ b/examples/webenginewidgets/simplebrowser/simplebrowser.pro
@@ -10,7 +10,8 @@ HEADERS += \
tabwidget.h \
webpage.h \
webpopupwindow.h \
- webview.h
+ webview.h \
+ webauthdialog.h
SOURCES += \
browser.cpp \
@@ -21,13 +22,20 @@ SOURCES += \
tabwidget.cpp \
webpage.cpp \
webpopupwindow.cpp \
- webview.cpp
+ webview.cpp \
+ webauthdialog.cpp
+
+win32 {
+ CONFIG -= embed_manifest_exe
+ QMAKE_MANIFEST = $$PWD/simplebrowser.exe.manifest
+}
FORMS += \
certificateerrordialog.ui \
passworddialog.ui \
downloadmanagerwidget.ui \
- downloadwidget.ui
+ downloadwidget.ui \
+ webauthdialog.ui
RESOURCES += data/simplebrowser.qrc
diff --git a/examples/webenginewidgets/simplebrowser/tabwidget.cpp b/examples/webenginewidgets/simplebrowser/tabwidget.cpp
index d7a69e61f..f9037a8e1 100644
--- a/examples/webenginewidgets/simplebrowser/tabwidget.cpp
+++ b/examples/webenginewidgets/simplebrowser/tabwidget.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "tabwidget.h"
#include "webpage.h"
@@ -56,6 +9,8 @@
#include <QTabBar>
#include <QWebEngineProfile>
+using namespace Qt::StringLiterals;
+
TabWidget::TabWidget(QWebEngineProfile *profile, QWidget *parent)
: QTabWidget(parent)
, m_profile(profile)
@@ -79,10 +34,10 @@ TabWidget::TabWidget(QWebEngineProfile *profile, QWidget *parent)
if (profile->isOffTheRecord()) {
QLabel *icon = new QLabel(this);
- QPixmap pixmap(QStringLiteral(":ninja.png"));
+ QPixmap pixmap(u":ninja.png"_s);
icon->setPixmap(pixmap.scaledToHeight(tabBar->height()));
- setStyleSheet(QStringLiteral("QTabWidget::tab-bar { left: %1px; }").
- arg(icon->pixmap()->width()));
+ setStyleSheet(u"QTabWidget::tab-bar { left: %1px; }"_s.
+ arg(icon->pixmap().width()));
}
}
@@ -115,7 +70,11 @@ void TabWidget::handleCurrentChanged(int index)
void TabWidget::handleContextMenuRequested(const QPoint &pos)
{
QMenu menu;
+#if QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)
+ menu.addAction(tr("New &Tab"), QKeySequence::AddTab, this, &TabWidget::createTab);
+#else
menu.addAction(tr("New &Tab"), this, &TabWidget::createTab, QKeySequence::AddTab);
+#endif
int index = tabBar()->tabAt(pos);
if (index != -1) {
QAction *action = menu.addAction(tr("Clone Tab"));
@@ -196,16 +155,16 @@ void TabWidget::setupView(WebView *webView)
});
connect(webPage, &QWebEnginePage::windowCloseRequested, [this, webView]() {
int index = indexOf(webView);
- if (index >= 0)
+ if (webView->page()->inspectedPage())
+ window()->close();
+ else if (index >= 0)
closeTab(index);
});
connect(webView, &WebView::devToolsRequested, this, &TabWidget::devToolsRequested);
-#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
connect(webPage, &QWebEnginePage::findTextFinished, [this, webView](const QWebEngineFindTextResult &result) {
if (currentIndex() == indexOf(webView))
emit findTextFinished(result);
});
-#endif
}
WebView *TabWidget::createTab()
diff --git a/examples/webenginewidgets/simplebrowser/tabwidget.h b/examples/webenginewidgets/simplebrowser/tabwidget.h
index bf65c9505..a1a893b62 100644
--- a/examples/webenginewidgets/simplebrowser/tabwidget.h
+++ b/examples/webenginewidgets/simplebrowser/tabwidget.h
@@ -1,57 +1,11 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef TABWIDGET_H
#define TABWIDGET_H
#include <QTabWidget>
+#include <QWebEngineFindTextResult>
#include <QWebEnginePage>
QT_BEGIN_NAMESPACE
@@ -65,7 +19,7 @@ class TabWidget : public QTabWidget
Q_OBJECT
public:
- TabWidget(QWebEngineProfile *profile, QWidget *parent = nullptr);
+ explicit TabWidget(QWebEngineProfile *profile, QWidget *parent = nullptr);
WebView *currentWebView() const;
@@ -78,9 +32,7 @@ signals:
void favIconChanged(const QIcon &icon);
void webActionEnabledChanged(QWebEnginePage::WebAction action, bool enabled);
void devToolsRequested(QWebEnginePage *source);
-#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
void findTextFinished(const QWebEngineFindTextResult &result);
-#endif
public slots:
// current tab/page slots
diff --git a/examples/webenginewidgets/simplebrowser/webauthdialog.cpp b/examples/webenginewidgets/simplebrowser/webauthdialog.cpp
new file mode 100644
index 000000000..85d944db6
--- /dev/null
+++ b/examples/webenginewidgets/simplebrowser/webauthdialog.cpp
@@ -0,0 +1,294 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include "webauthdialog.h"
+
+#include <QVBoxLayout>
+#include <QRadioButton>
+#include <QLineEdit>
+#include <QTextEdit>
+#include <QPushButton>
+#include <QWebEngineView>
+
+WebAuthDialog::WebAuthDialog(QWebEngineWebAuthUxRequest *request, QWidget *parent)
+ : QDialog(parent), uxRequest(request), uiWebAuthDialog(new Ui::WebAuthDialog)
+{
+ uiWebAuthDialog->setupUi(this);
+
+ buttonGroup = new QButtonGroup(this);
+ buttonGroup->setExclusive(true);
+
+ scrollArea = new QScrollArea(this);
+ selectAccountWidget = new QWidget(this);
+ scrollArea->setWidget(selectAccountWidget);
+ scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
+ selectAccountWidget->resize(400, 150);
+ selectAccountLayout = new QVBoxLayout(selectAccountWidget);
+ uiWebAuthDialog->m_mainVerticalLayout->addWidget(scrollArea);
+ selectAccountLayout->setAlignment(Qt::AlignTop);
+
+ updateDisplay();
+
+ connect(uiWebAuthDialog->buttonBox, &QDialogButtonBox::rejected, this,
+ qOverload<>(&WebAuthDialog::onCancelRequest));
+
+ connect(uiWebAuthDialog->buttonBox, &QDialogButtonBox::accepted, this,
+ qOverload<>(&WebAuthDialog::onAcceptRequest));
+ QAbstractButton *button = uiWebAuthDialog->buttonBox->button(QDialogButtonBox::Retry);
+ connect(button, &QAbstractButton::clicked, this, qOverload<>(&WebAuthDialog::onRetry));
+ setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
+}
+
+WebAuthDialog::~WebAuthDialog()
+{
+ QList<QAbstractButton *> buttons = buttonGroup->buttons();
+ auto itr = buttons.begin();
+ while (itr != buttons.end()) {
+ QAbstractButton *radioButton = *itr;
+ delete radioButton;
+ itr++;
+ }
+
+ if (buttonGroup) {
+ delete buttonGroup;
+ buttonGroup = nullptr;
+ }
+
+ if (uiWebAuthDialog) {
+ delete uiWebAuthDialog;
+ uiWebAuthDialog = nullptr;
+ }
+
+ // selectAccountWidget and it's children will get deleted when scroll area is destroyed
+ if (scrollArea) {
+ delete scrollArea;
+ scrollArea = nullptr;
+ }
+}
+
+void WebAuthDialog::updateDisplay()
+{
+ switch (uxRequest->state()) {
+ case QWebEngineWebAuthUxRequest::WebAuthUxState::SelectAccount:
+ setupSelectAccountUI();
+ break;
+ case QWebEngineWebAuthUxRequest::WebAuthUxState::CollectPin:
+ setupCollectPinUI();
+ break;
+ case QWebEngineWebAuthUxRequest::WebAuthUxState::FinishTokenCollection:
+ setupFinishCollectTokenUI();
+ break;
+ case QWebEngineWebAuthUxRequest::WebAuthUxState::RequestFailed:
+ setupErrorUI();
+ break;
+ default:
+ break;
+ }
+ adjustSize();
+}
+
+void WebAuthDialog::setupSelectAccountUI()
+{
+ uiWebAuthDialog->m_headingLabel->setText(tr("Choose a Passkey"));
+ uiWebAuthDialog->m_description->setText(tr("Which passkey do you want to use for ")
+ + uxRequest->relyingPartyId() + tr("? "));
+ uiWebAuthDialog->m_pinGroupBox->setVisible(false);
+ uiWebAuthDialog->m_mainVerticalLayout->removeWidget(uiWebAuthDialog->m_pinGroupBox);
+ uiWebAuthDialog->buttonBox->button(QDialogButtonBox::Retry)->setVisible(false);
+
+ clearSelectAccountButtons();
+ scrollArea->setVisible(true);
+ selectAccountWidget->resize(this->width(), this->height());
+ QStringList userNames = uxRequest->userNames();
+ // Create radio buttons for each name
+ for (const QString &name : userNames) {
+ QRadioButton *radioButton = new QRadioButton(name);
+ selectAccountLayout->addWidget(radioButton);
+ buttonGroup->addButton(radioButton);
+ }
+
+ uiWebAuthDialog->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Ok"));
+ uiWebAuthDialog->buttonBox->button(QDialogButtonBox::Ok)->setVisible(true);
+ uiWebAuthDialog->buttonBox->button(QDialogButtonBox::Cancel)->setVisible(true);
+ uiWebAuthDialog->buttonBox->button(QDialogButtonBox::Retry)->setVisible(false);
+}
+
+void WebAuthDialog::setupFinishCollectTokenUI()
+{
+ clearSelectAccountButtons();
+ uiWebAuthDialog->m_headingLabel->setText(tr("Use your security key with")
+ + uxRequest->relyingPartyId());
+ uiWebAuthDialog->m_description->setText(
+ tr("Touch your security key again to complete the request."));
+ uiWebAuthDialog->m_pinGroupBox->setVisible(false);
+ uiWebAuthDialog->buttonBox->button(QDialogButtonBox::Ok)->setVisible(false);
+ uiWebAuthDialog->buttonBox->button(QDialogButtonBox::Retry)->setVisible(false);
+ scrollArea->setVisible(false);
+}
+void WebAuthDialog::setupCollectPinUI()
+{
+ clearSelectAccountButtons();
+ uiWebAuthDialog->m_mainVerticalLayout->addWidget(uiWebAuthDialog->m_pinGroupBox);
+ uiWebAuthDialog->m_pinGroupBox->setVisible(true);
+ uiWebAuthDialog->m_confirmPinLabel->setVisible(false);
+ uiWebAuthDialog->m_confirmPinLineEdit->setVisible(false);
+ uiWebAuthDialog->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Next"));
+ uiWebAuthDialog->buttonBox->button(QDialogButtonBox::Ok)->setVisible(true);
+ uiWebAuthDialog->buttonBox->button(QDialogButtonBox::Cancel)->setVisible(true);
+ uiWebAuthDialog->buttonBox->button(QDialogButtonBox::Retry)->setVisible(false);
+ scrollArea->setVisible(false);
+
+ QWebEngineWebAuthPinRequest pinRequestInfo = uxRequest->pinRequest();
+
+ if (pinRequestInfo.reason == QWebEngineWebAuthUxRequest::PinEntryReason::Challenge) {
+ uiWebAuthDialog->m_headingLabel->setText(tr("PIN Required"));
+ uiWebAuthDialog->m_description->setText(tr("Enter the PIN for your security key"));
+ uiWebAuthDialog->m_confirmPinLabel->setVisible(false);
+ uiWebAuthDialog->m_confirmPinLineEdit->setVisible(false);
+ } else {
+ if (pinRequestInfo.reason == QWebEngineWebAuthUxRequest::PinEntryReason::Set) {
+ uiWebAuthDialog->m_headingLabel->setText(tr("New PIN Required"));
+ uiWebAuthDialog->m_description->setText(tr("Set new PIN for your security key"));
+ } else {
+ uiWebAuthDialog->m_headingLabel->setText(tr("Change PIN Required"));
+ uiWebAuthDialog->m_description->setText(tr("Change PIN for your security key"));
+ }
+ uiWebAuthDialog->m_confirmPinLabel->setVisible(true);
+ uiWebAuthDialog->m_confirmPinLineEdit->setVisible(true);
+ }
+
+ QString errorDetails;
+ switch (pinRequestInfo.error) {
+ case QWebEngineWebAuthUxRequest::PinEntryError::NoError:
+ break;
+ case QWebEngineWebAuthUxRequest::PinEntryError::InternalUvLocked:
+ errorDetails = tr("Internal User Verification Locked ");
+ break;
+ case QWebEngineWebAuthUxRequest::PinEntryError::WrongPin:
+ errorDetails = tr("Wrong PIN");
+ break;
+ case QWebEngineWebAuthUxRequest::PinEntryError::TooShort:
+ errorDetails = tr("Too Short");
+ break;
+ case QWebEngineWebAuthUxRequest::PinEntryError::InvalidCharacters:
+ errorDetails = tr("Invalid Characters");
+ break;
+ case QWebEngineWebAuthUxRequest::PinEntryError::SameAsCurrentPin:
+ errorDetails = tr("Same as current PIN");
+ break;
+ }
+ if (!errorDetails.isEmpty()) {
+ errorDetails += tr(" ") + QString::number(pinRequestInfo.remainingAttempts)
+ + tr(" attempts remaining");
+ }
+ uiWebAuthDialog->m_pinEntryErrorLabel->setText(errorDetails);
+}
+
+void WebAuthDialog::onCancelRequest()
+{
+ uxRequest->cancel();
+}
+
+void WebAuthDialog::onAcceptRequest()
+{
+ switch (uxRequest->state()) {
+ case QWebEngineWebAuthUxRequest::WebAuthUxState::SelectAccount:
+ if (buttonGroup->checkedButton()) {
+ uxRequest->setSelectedAccount(buttonGroup->checkedButton()->text());
+ }
+ break;
+ case QWebEngineWebAuthUxRequest::WebAuthUxState::CollectPin:
+ uxRequest->setPin(uiWebAuthDialog->m_pinLineEdit->text());
+ break;
+ default:
+ break;
+ }
+}
+
+void WebAuthDialog::setupErrorUI()
+{
+ clearSelectAccountButtons();
+ QString errorDescription;
+ QString errorHeading = tr("Something went wrong");
+ bool isVisibleRetry = false;
+ switch (uxRequest->requestFailureReason()) {
+ case QWebEngineWebAuthUxRequest::RequestFailureReason::Timeout:
+ errorDescription = tr("Request Timeout");
+ break;
+ case QWebEngineWebAuthUxRequest::RequestFailureReason::KeyNotRegistered:
+ errorDescription = tr("Key not registered");
+ break;
+ case QWebEngineWebAuthUxRequest::RequestFailureReason::KeyAlreadyRegistered:
+ errorDescription = tr("You already registered this device."
+ "Try again with device");
+ isVisibleRetry = true;
+ break;
+ case QWebEngineWebAuthUxRequest::RequestFailureReason::SoftPinBlock:
+ errorDescription =
+ tr("The security key is locked because the wrong PIN was entered too many times."
+ "To unlock it, remove and reinsert it.");
+ isVisibleRetry = true;
+ break;
+ case QWebEngineWebAuthUxRequest::RequestFailureReason::HardPinBlock:
+ errorDescription =
+ tr("The security key is locked because the wrong PIN was entered too many times."
+ " You'll need to reset the security key.");
+ break;
+ case QWebEngineWebAuthUxRequest::RequestFailureReason::AuthenticatorRemovedDuringPinEntry:
+ errorDescription =
+ tr("Authenticator removed during verification. Please reinsert and try again");
+ break;
+ case QWebEngineWebAuthUxRequest::RequestFailureReason::AuthenticatorMissingResidentKeys:
+ errorDescription = tr("Authenticator doesn't have resident key support");
+ break;
+ case QWebEngineWebAuthUxRequest::RequestFailureReason::AuthenticatorMissingUserVerification:
+ errorDescription = tr("Authenticator missing user verification");
+ break;
+ case QWebEngineWebAuthUxRequest::RequestFailureReason::AuthenticatorMissingLargeBlob:
+ errorDescription = tr("Authenticator missing Large Blob support");
+ break;
+ case QWebEngineWebAuthUxRequest::RequestFailureReason::NoCommonAlgorithms:
+ errorDescription = tr("Authenticator missing Large Blob support");
+ break;
+ case QWebEngineWebAuthUxRequest::RequestFailureReason::StorageFull:
+ errorDescription = tr("Storage Full");
+ break;
+ case QWebEngineWebAuthUxRequest::RequestFailureReason::UserConsentDenied:
+ errorDescription = tr("User consent denied");
+ break;
+ case QWebEngineWebAuthUxRequest::RequestFailureReason::WinUserCancelled:
+ errorDescription = tr("User Cancelled Request");
+ break;
+ }
+
+ uiWebAuthDialog->m_headingLabel->setText(errorHeading);
+ uiWebAuthDialog->m_description->setText(errorDescription);
+ uiWebAuthDialog->m_description->adjustSize();
+ uiWebAuthDialog->m_pinGroupBox->setVisible(false);
+ uiWebAuthDialog->buttonBox->button(QDialogButtonBox::Ok)->setVisible(false);
+ uiWebAuthDialog->buttonBox->button(QDialogButtonBox::Retry)->setVisible(isVisibleRetry);
+ if (isVisibleRetry)
+ uiWebAuthDialog->buttonBox->button(QDialogButtonBox::Retry)->setFocus();
+ uiWebAuthDialog->buttonBox->button(QDialogButtonBox::Cancel)->setVisible(true);
+ uiWebAuthDialog->buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("Close"));
+ scrollArea->setVisible(false);
+}
+
+void WebAuthDialog::onRetry()
+{
+ uxRequest->retry();
+}
+
+void WebAuthDialog::clearSelectAccountButtons()
+{
+ QList<QAbstractButton *> buttons = buttonGroup->buttons();
+ auto itr = buttons.begin();
+ while (itr != buttons.end()) {
+ QAbstractButton *radioButton = *itr;
+ selectAccountLayout->removeWidget(radioButton);
+ buttonGroup->removeButton(radioButton);
+ delete radioButton;
+ itr++;
+ }
+}
diff --git a/examples/webenginewidgets/simplebrowser/webauthdialog.h b/examples/webenginewidgets/simplebrowser/webauthdialog.h
new file mode 100644
index 000000000..47832c1bb
--- /dev/null
+++ b/examples/webenginewidgets/simplebrowser/webauthdialog.h
@@ -0,0 +1,41 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#ifndef WEBAUTHDIALOG_H
+#define WEBAUTHDIALOG_H
+
+#include <QDialog>
+#include <QButtonGroup>
+#include <QScrollArea>
+#include "ui_webauthdialog.h"
+#include "qwebenginewebauthuxrequest.h"
+
+class WebAuthDialog : public QDialog
+{
+ Q_OBJECT
+public:
+ WebAuthDialog(QWebEngineWebAuthUxRequest *request, QWidget *parent = nullptr);
+ ~WebAuthDialog();
+
+ void updateDisplay();
+
+private:
+ QWebEngineWebAuthUxRequest *uxRequest;
+ QButtonGroup *buttonGroup = nullptr;
+ QScrollArea *scrollArea = nullptr;
+ QWidget *selectAccountWidget = nullptr;
+ QVBoxLayout *selectAccountLayout = nullptr;
+
+ void setupSelectAccountUI();
+ void setupCollectPinUI();
+ void setupFinishCollectTokenUI();
+ void setupErrorUI();
+ void onCancelRequest();
+ void onRetry();
+ void onAcceptRequest();
+ void clearSelectAccountButtons();
+
+ Ui::WebAuthDialog *uiWebAuthDialog;
+};
+
+#endif // WEBAUTHDIALOG_H
diff --git a/examples/webenginewidgets/simplebrowser/webauthdialog.ui b/examples/webenginewidgets/simplebrowser/webauthdialog.ui
new file mode 100644
index 000000000..c8a0456d6
--- /dev/null
+++ b/examples/webenginewidgets/simplebrowser/webauthdialog.ui
@@ -0,0 +1,151 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>WebAuthDialog</class>
+ <widget class="QDialog" name="WebAuthDialog">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>563</width>
+ <height>397</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Dialog</string>
+ </property>
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="geometry">
+ <rect>
+ <x>20</x>
+ <y>320</y>
+ <width>471</width>
+ <height>32</height>
+ </rect>
+ </property>
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::Retry</set>
+ </property>
+ </widget>
+ <widget class="QLabel" name="m_headingLabel">
+ <property name="geometry">
+ <rect>
+ <x>30</x>
+ <y>20</y>
+ <width>321</width>
+ <height>16</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Heading</string>
+ </property>
+ <property name="wordWrap">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QLabel" name="m_description">
+ <property name="geometry">
+ <rect>
+ <x>30</x>
+ <y>60</y>
+ <width>491</width>
+ <height>31</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Description</string>
+ </property>
+ <property name="wordWrap">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QWidget" name="layoutWidget">
+ <property name="geometry">
+ <rect>
+ <x>20</x>
+ <y>100</y>
+ <width>471</width>
+ <height>171</height>
+ </rect>
+ </property>
+ <layout class="QVBoxLayout" name="m_mainVerticalLayout">
+ <property name="sizeConstraint">
+ <enum>QLayout::SetDefaultConstraint</enum>
+ </property>
+ <item>
+ <widget class="QGroupBox" name="m_pinGroupBox">
+ <property name="title">
+ <string/>
+ </property>
+ <property name="flat">
+ <bool>true</bool>
+ </property>
+ <widget class="QLabel" name="m_pinLabel">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>20</y>
+ <width>58</width>
+ <height>16</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>PIN</string>
+ </property>
+ </widget>
+ <widget class="QLineEdit" name="m_pinLineEdit">
+ <property name="geometry">
+ <rect>
+ <x>90</x>
+ <y>20</y>
+ <width>113</width>
+ <height>21</height>
+ </rect>
+ </property>
+ </widget>
+ <widget class="QLabel" name="m_confirmPinLabel">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>50</y>
+ <width>81</width>
+ <height>16</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Confirm PIN</string>
+ </property>
+ </widget>
+ <widget class="QLineEdit" name="m_confirmPinLineEdit">
+ <property name="geometry">
+ <rect>
+ <x>90</x>
+ <y>50</y>
+ <width>113</width>
+ <height>21</height>
+ </rect>
+ </property>
+ </widget>
+ <widget class="QLabel" name="m_pinEntryErrorLabel">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>80</y>
+ <width>441</width>
+ <height>16</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>TextLabel</string>
+ </property>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/examples/webenginewidgets/simplebrowser/webpage.cpp b/examples/webenginewidgets/simplebrowser/webpage.cpp
index 9f7038cdb..807cdf0ff 100644
--- a/examples/webenginewidgets/simplebrowser/webpage.cpp
+++ b/examples/webenginewidgets/simplebrowser/webpage.cpp
@@ -1,230 +1,37 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "browserwindow.h"
#include "tabwidget.h"
-#include "ui_certificateerrordialog.h"
-#include "ui_passworddialog.h"
+
#include "webpage.h"
#include "webview.h"
-#include <QAuthenticator>
-#include <QMessageBox>
-#include <QStyle>
#include <QTimer>
-#include <QWebEngineCertificateError>
WebPage::WebPage(QWebEngineProfile *profile, QObject *parent)
: QWebEnginePage(profile, parent)
{
- connect(this, &QWebEnginePage::authenticationRequired, this, &WebPage::handleAuthenticationRequired);
- connect(this, &QWebEnginePage::featurePermissionRequested, this, &WebPage::handleFeaturePermissionRequested);
- connect(this, &QWebEnginePage::proxyAuthenticationRequired, this, &WebPage::handleProxyAuthenticationRequired);
- connect(this, &QWebEnginePage::registerProtocolHandlerRequested, this, &WebPage::handleRegisterProtocolHandlerRequested);
-#if !defined(QT_NO_SSL) || QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
connect(this, &QWebEnginePage::selectClientCertificate, this, &WebPage::handleSelectClientCertificate);
-#endif
-}
-
-bool WebPage::certificateError(const QWebEngineCertificateError &error)
-{
- QWidget *mainWindow = view()->window();
-
-#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
- QWebEngineCertificateError deferredError = error;
- deferredError.defer();
-
- QTimer::singleShot(0, mainWindow, [mainWindow, error = std::move(deferredError)] () mutable {
- if (!error.deferred()) {
- QMessageBox::critical(mainWindow, tr("Certificate Error"), error.errorDescription());
- } else {
-#else
- if (error.isOverridable()) {
-#endif
- QDialog dialog(mainWindow);
- dialog.setModal(true);
- dialog.setWindowFlags(dialog.windowFlags() & ~Qt::WindowContextHelpButtonHint);
-
- Ui::CertificateErrorDialog certificateDialog;
- certificateDialog.setupUi(&dialog);
- certificateDialog.m_iconLabel->setText(QString());
- QIcon icon(mainWindow->style()->standardIcon(QStyle::SP_MessageBoxWarning, 0, mainWindow));
- certificateDialog.m_iconLabel->setPixmap(icon.pixmap(32, 32));
- certificateDialog.m_errorLabel->setText(error.errorDescription());
- dialog.setWindowTitle(tr("Certificate Error"));
-
-#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
- if (dialog.exec() == QDialog::Accepted)
- error.ignoreCertificateError();
- else
- error.rejectCertificate();
- }
- });
- return true;
-#else
- return dialog.exec() == QDialog::Accepted;
- }
-
- QMessageBox::critical(mainWindow, tr("Certificate Error"), error.errorDescription());
- return false;
-#endif
-}
-
-void WebPage::handleAuthenticationRequired(const QUrl &requestUrl, QAuthenticator *auth)
-{
- QWidget *mainWindow = view()->window();
- QDialog dialog(mainWindow);
- dialog.setModal(true);
- dialog.setWindowFlags(dialog.windowFlags() & ~Qt::WindowContextHelpButtonHint);
-
- Ui::PasswordDialog passwordDialog;
- passwordDialog.setupUi(&dialog);
-
- passwordDialog.m_iconLabel->setText(QString());
- QIcon icon(mainWindow->style()->standardIcon(QStyle::SP_MessageBoxQuestion, 0, mainWindow));
- passwordDialog.m_iconLabel->setPixmap(icon.pixmap(32, 32));
-
- QString introMessage(tr("Enter username and password for \"%1\" at %2")
- .arg(auth->realm()).arg(requestUrl.toString().toHtmlEscaped()));
- passwordDialog.m_infoLabel->setText(introMessage);
- passwordDialog.m_infoLabel->setWordWrap(true);
-
- if (dialog.exec() == QDialog::Accepted) {
- auth->setUser(passwordDialog.m_userNameLineEdit->text());
- auth->setPassword(passwordDialog.m_passwordLineEdit->text());
- } else {
- // Set authenticator null if dialog is cancelled
- *auth = QAuthenticator();
- }
+ connect(this, &QWebEnginePage::certificateError, this, &WebPage::handleCertificateError);
+ connect(this, &QWebEnginePage::desktopMediaRequested, this,
+ &WebPage::handleDesktopMediaRequest);
}
-inline QString questionForFeature(QWebEnginePage::Feature feature)
+void WebPage::handleCertificateError(QWebEngineCertificateError error)
{
- switch (feature) {
- case QWebEnginePage::Geolocation:
- return WebPage::tr("Allow %1 to access your location information?");
- case QWebEnginePage::MediaAudioCapture:
- return WebPage::tr("Allow %1 to access your microphone?");
- case QWebEnginePage::MediaVideoCapture:
- return WebPage::tr("Allow %1 to access your webcam?");
- case QWebEnginePage::MediaAudioVideoCapture:
- return WebPage::tr("Allow %1 to access your microphone and webcam?");
- case QWebEnginePage::MouseLock:
- return WebPage::tr("Allow %1 to lock your mouse cursor?");
- case QWebEnginePage::DesktopVideoCapture:
- return WebPage::tr("Allow %1 to capture video of your desktop?");
- case QWebEnginePage::DesktopAudioVideoCapture:
- return WebPage::tr("Allow %1 to capture audio and video of your desktop?");
- case QWebEnginePage::Notifications:
- return WebPage::tr("Allow %1 to show notification on your desktop?");
- }
- return QString();
+ error.defer();
+ QTimer::singleShot(0, this,
+ [this, error]() mutable { emit createCertificateErrorDialog(error); });
}
-void WebPage::handleFeaturePermissionRequested(const QUrl &securityOrigin, Feature feature)
-{
- QString title = tr("Permission Request");
- QString question = questionForFeature(feature).arg(securityOrigin.host());
- if (!question.isEmpty() && QMessageBox::question(view()->window(), title, question) == QMessageBox::Yes)
- setFeaturePermission(securityOrigin, feature, PermissionGrantedByUser);
- else
- setFeaturePermission(securityOrigin, feature, PermissionDeniedByUser);
-}
-
-void WebPage::handleProxyAuthenticationRequired(const QUrl &, QAuthenticator *auth, const QString &proxyHost)
-{
- QWidget *mainWindow = view()->window();
- QDialog dialog(mainWindow);
- dialog.setModal(true);
- dialog.setWindowFlags(dialog.windowFlags() & ~Qt::WindowContextHelpButtonHint);
-
- Ui::PasswordDialog passwordDialog;
- passwordDialog.setupUi(&dialog);
-
- passwordDialog.m_iconLabel->setText(QString());
- QIcon icon(mainWindow->style()->standardIcon(QStyle::SP_MessageBoxQuestion, 0, mainWindow));
- passwordDialog.m_iconLabel->setPixmap(icon.pixmap(32, 32));
-
- QString introMessage = tr("Connect to proxy \"%1\" using:");
- introMessage = introMessage.arg(proxyHost.toHtmlEscaped());
- passwordDialog.m_infoLabel->setText(introMessage);
- passwordDialog.m_infoLabel->setWordWrap(true);
-
- if (dialog.exec() == QDialog::Accepted) {
- auth->setUser(passwordDialog.m_userNameLineEdit->text());
- auth->setPassword(passwordDialog.m_passwordLineEdit->text());
- } else {
- // Set authenticator null if dialog is cancelled
- *auth = QAuthenticator();
- }
-}
-
-//! [registerProtocolHandlerRequested]
-void WebPage::handleRegisterProtocolHandlerRequested(QWebEngineRegisterProtocolHandlerRequest request)
-{
- auto answer = QMessageBox::question(
- view()->window(),
- tr("Permission Request"),
- tr("Allow %1 to open all %2 links?")
- .arg(request.origin().host())
- .arg(request.scheme()));
- if (answer == QMessageBox::Yes)
- request.accept();
- else
- request.reject();
-}
-//! [registerProtocolHandlerRequested]
-
-#if !defined(QT_NO_SSL) || QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
void WebPage::handleSelectClientCertificate(QWebEngineClientCertificateSelection selection)
{
// Just select one.
selection.select(selection.certificates().at(0));
}
-#endif
+
+void WebPage::handleDesktopMediaRequest(const QWebEngineDesktopMediaRequest &request)
+{
+ // select the primary screen
+ request.selectScreen(request.screensModel()->index(0));
+}
diff --git a/examples/webenginewidgets/simplebrowser/webpage.h b/examples/webenginewidgets/simplebrowser/webpage.h
index 908295894..56740f817 100644
--- a/examples/webenginewidgets/simplebrowser/webpage.h
+++ b/examples/webenginewidgets/simplebrowser/webpage.h
@@ -1,77 +1,28 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef WEBPAGE_H
#define WEBPAGE_H
#include <QWebEnginePage>
#include <QWebEngineRegisterProtocolHandlerRequest>
+#include <QWebEngineCertificateError>
+#include <QWebEngineDesktopMediaRequest>
class WebPage : public QWebEnginePage
{
Q_OBJECT
public:
- WebPage(QWebEngineProfile *profile, QObject *parent = nullptr);
+ explicit WebPage(QWebEngineProfile *profile, QObject *parent = nullptr);
-protected:
- bool certificateError(const QWebEngineCertificateError &error) override;
+signals:
+ void createCertificateErrorDialog(QWebEngineCertificateError error);
private slots:
- void handleAuthenticationRequired(const QUrl &requestUrl, QAuthenticator *auth);
- void handleFeaturePermissionRequested(const QUrl &securityOrigin, Feature feature);
- void handleProxyAuthenticationRequired(const QUrl &requestUrl, QAuthenticator *auth, const QString &proxyHost);
- void handleRegisterProtocolHandlerRequested(QWebEngineRegisterProtocolHandlerRequest request);
-#if !defined(QT_NO_SSL) || QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
+ void handleCertificateError(QWebEngineCertificateError error);
void handleSelectClientCertificate(QWebEngineClientCertificateSelection clientCertSelection);
-#endif
+ void handleDesktopMediaRequest(const QWebEngineDesktopMediaRequest &request);
};
#endif // WEBPAGE_H
diff --git a/examples/webenginewidgets/simplebrowser/webpopupwindow.cpp b/examples/webenginewidgets/simplebrowser/webpopupwindow.cpp
index 566723e1f..bed956fd0 100644
--- a/examples/webenginewidgets/simplebrowser/webpopupwindow.cpp
+++ b/examples/webenginewidgets/simplebrowser/webpopupwindow.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "webpage.h"
#include "webpopupwindow.h"
diff --git a/examples/webenginewidgets/simplebrowser/webpopupwindow.h b/examples/webenginewidgets/simplebrowser/webpopupwindow.h
index 9cecb28a7..0726bf0c2 100644
--- a/examples/webenginewidgets/simplebrowser/webpopupwindow.h
+++ b/examples/webenginewidgets/simplebrowser/webpopupwindow.h
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef WEBPOPUPWINDOW_H
#define WEBPOPUPWINDOW_H
@@ -66,7 +19,7 @@ class WebPopupWindow : public QWidget
Q_OBJECT
public:
- WebPopupWindow(QWebEngineProfile *profile);
+ explicit WebPopupWindow(QWebEngineProfile *profile);
WebView *view() const;
private slots:
diff --git a/examples/webenginewidgets/simplebrowser/webview.cpp b/examples/webenginewidgets/simplebrowser/webview.cpp
index fcbb543f2..08e044f70 100644
--- a/examples/webenginewidgets/simplebrowser/webview.cpp
+++ b/examples/webenginewidgets/simplebrowser/webview.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "browser.h"
#include "browserwindow.h"
@@ -54,15 +7,21 @@
#include "webpage.h"
#include "webpopupwindow.h"
#include "webview.h"
+#include "ui_certificateerrordialog.h"
+#include "ui_passworddialog.h"
+#include "webauthdialog.h"
#include <QContextMenuEvent>
#include <QDebug>
#include <QMenu>
#include <QMessageBox>
+#include <QAuthenticator>
#include <QTimer>
+#include <QStyle>
+
+using namespace Qt::StringLiterals;
WebView::WebView(QWidget *parent)
: QWebEngineView(parent)
- , m_loadProgress(100)
{
connect(this, &QWebEngineView::loadStarted, [this]() {
m_loadProgress = 0;
@@ -100,17 +59,82 @@ WebView::WebView(QWidget *parent)
tr("Render process exited with code: %1\n"
"Do you want to reload the page ?").arg(statusCode));
if (btn == QMessageBox::Yes)
- QTimer::singleShot(0, [this] { reload(); });
+ QTimer::singleShot(0, this, &WebView::reload);
});
}
+WebView::~WebView()
+{
+ if (m_imageAnimationGroup)
+ delete m_imageAnimationGroup;
+
+ m_imageAnimationGroup = nullptr;
+}
+
+inline QString questionForFeature(QWebEnginePage::Feature feature)
+{
+ switch (feature) {
+ case QWebEnginePage::Geolocation:
+ return QObject::tr("Allow %1 to access your location information?");
+ case QWebEnginePage::MediaAudioCapture:
+ return QObject::tr("Allow %1 to access your microphone?");
+ case QWebEnginePage::MediaVideoCapture:
+ return QObject::tr("Allow %1 to access your webcam?");
+ case QWebEnginePage::MediaAudioVideoCapture:
+ return QObject::tr("Allow %1 to access your microphone and webcam?");
+ case QWebEnginePage::MouseLock:
+ return QObject::tr("Allow %1 to lock your mouse cursor?");
+ case QWebEnginePage::DesktopVideoCapture:
+ return QObject::tr("Allow %1 to capture video of your desktop?");
+ case QWebEnginePage::DesktopAudioVideoCapture:
+ return QObject::tr("Allow %1 to capture audio and video of your desktop?");
+ case QWebEnginePage::Notifications:
+ return QObject::tr("Allow %1 to show notification on your desktop?");
+ case QWebEnginePage::ClipboardReadWrite:
+ return QObject::tr("Allow %1 to read from and write to the clipboard?");
+ }
+ return QString();
+}
+
void WebView::setPage(WebPage *page)
{
+ if (auto oldPage = qobject_cast<WebPage *>(QWebEngineView::page())) {
+ disconnect(oldPage, &WebPage::createCertificateErrorDialog, this,
+ &WebView::handleCertificateError);
+ disconnect(oldPage, &QWebEnginePage::authenticationRequired, this,
+ &WebView::handleAuthenticationRequired);
+ disconnect(oldPage, &QWebEnginePage::featurePermissionRequested, this,
+ &WebView::handleFeaturePermissionRequested);
+ disconnect(oldPage, &QWebEnginePage::proxyAuthenticationRequired, this,
+ &WebView::handleProxyAuthenticationRequired);
+ disconnect(oldPage, &QWebEnginePage::registerProtocolHandlerRequested, this,
+ &WebView::handleRegisterProtocolHandlerRequested);
+ disconnect(oldPage, &QWebEnginePage::webAuthUxRequested, this,
+ &WebView::handleWebAuthUxRequested);
+#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0)
+ disconnect(oldPage, &QWebEnginePage::fileSystemAccessRequested, this,
+ &WebView::handleFileSystemAccessRequested);
+#endif
+ }
createWebActionTrigger(page,QWebEnginePage::Forward);
createWebActionTrigger(page,QWebEnginePage::Back);
createWebActionTrigger(page,QWebEnginePage::Reload);
createWebActionTrigger(page,QWebEnginePage::Stop);
QWebEngineView::setPage(page);
+ connect(page, &WebPage::createCertificateErrorDialog, this, &WebView::handleCertificateError);
+ connect(page, &QWebEnginePage::authenticationRequired, this,
+ &WebView::handleAuthenticationRequired);
+ connect(page, &QWebEnginePage::featurePermissionRequested, this,
+ &WebView::handleFeaturePermissionRequested);
+ connect(page, &QWebEnginePage::proxyAuthenticationRequired, this,
+ &WebView::handleProxyAuthenticationRequired);
+ connect(page, &QWebEnginePage::registerProtocolHandlerRequested, this,
+ &WebView::handleRegisterProtocolHandlerRequested);
+#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0)
+ connect(page, &QWebEnginePage::fileSystemAccessRequested, this,
+ &WebView::handleFileSystemAccessRequested);
+#endif
+ connect(page, &QWebEnginePage::webAuthUxRequested, this, &WebView::handleWebAuthUxRequested);
}
int WebView::loadProgress() const
@@ -138,15 +162,17 @@ QIcon WebView::favIcon() const
return favIcon;
if (m_loadProgress < 0) {
- static QIcon errorIcon(QStringLiteral(":dialog-error.png"));
+ static QIcon errorIcon(u":dialog-error.png"_s);
return errorIcon;
- } else if (m_loadProgress < 100) {
- static QIcon loadingIcon(QStringLiteral(":view-refresh.png"));
+ }
+ if (m_loadProgress < 100) {
+ static QIcon loadingIcon = QIcon::fromTheme(QIcon::ThemeIcon::ViewRefresh,
+ QIcon(":view-refresh.png"_L1));
return loadingIcon;
- } else {
- static QIcon defaultIcon(QStringLiteral(":text-html.png"));
- return defaultIcon;
}
+
+ static QIcon defaultIcon(u":text-html.png"_s);
+ return defaultIcon;
}
QWebEngineView *WebView::createWindow(QWebEnginePage::WebWindowType type)
@@ -176,7 +202,7 @@ QWebEngineView *WebView::createWindow(QWebEnginePage::WebWindowType type)
void WebView::contextMenuEvent(QContextMenuEvent *event)
{
- QMenu *menu = page()->createStandardContextMenu();
+ QMenu *menu = createStandardContextMenu();
const QList<QAction *> actions = menu->actions();
auto inspectElement = std::find(actions.cbegin(), actions.cend(), page()->action(QWebEnginePage::InspectElement));
if (inspectElement == actions.cend()) {
@@ -184,15 +210,221 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
if (viewSource == actions.cend())
menu->addSeparator();
- QAction *action = new QAction(menu);
- action->setText("Open inspector in new window");
+ QAction *action = menu->addAction("Open inspector in new window");
connect(action, &QAction::triggered, [this]() { emit devToolsRequested(page()); });
-
- QAction *before(inspectElement == actions.cend() ? nullptr : *inspectElement);
- menu->insertAction(before, action);
} else {
(*inspectElement)->setText(tr("Inspect element"));
}
+
+ // add conext menu for image policy
+ QMenu *editImageAnimation = new QMenu(tr("Image animation policy"));
+
+ m_imageAnimationGroup = new QActionGroup(editImageAnimation);
+ m_imageAnimationGroup->setExclusive(true);
+
+ QAction *disableImageAnimation =
+ editImageAnimation->addAction(tr("Disable all image animation"));
+ disableImageAnimation->setCheckable(true);
+ m_imageAnimationGroup->addAction(disableImageAnimation);
+ connect(disableImageAnimation, &QAction::triggered, [this]() {
+ handleImageAnimationPolicyChange(QWebEngineSettings::DisallowImageAnimation);
+ });
+ QAction *allowImageAnimationOnce =
+ editImageAnimation->addAction(tr("Allow animated images, but only once"));
+ allowImageAnimationOnce->setCheckable(true);
+ m_imageAnimationGroup->addAction(allowImageAnimationOnce);
+ connect(allowImageAnimationOnce, &QAction::triggered,
+ [this]() { handleImageAnimationPolicyChange(QWebEngineSettings::AnimateImageOnce); });
+ QAction *allowImageAnimation = editImageAnimation->addAction(tr("Allow all animated images"));
+ allowImageAnimation->setCheckable(true);
+ m_imageAnimationGroup->addAction(allowImageAnimation);
+ connect(allowImageAnimation, &QAction::triggered, [this]() {
+ handleImageAnimationPolicyChange(QWebEngineSettings::AllowImageAnimation);
+ });
+
+ switch (page()->settings()->imageAnimationPolicy()) {
+ case QWebEngineSettings::AllowImageAnimation:
+ allowImageAnimation->setChecked(true);
+ break;
+ case QWebEngineSettings::AnimateImageOnce:
+ allowImageAnimationOnce->setChecked(true);
+ break;
+ case QWebEngineSettings::DisallowImageAnimation:
+ disableImageAnimation->setChecked(true);
+ break;
+ default:
+ allowImageAnimation->setChecked(true);
+ break;
+ }
+
+ menu->addMenu(editImageAnimation);
menu->popup(event->globalPos());
}
+void WebView::handleCertificateError(QWebEngineCertificateError error)
+{
+ QDialog dialog(window());
+ dialog.setModal(true);
+ dialog.setWindowFlags(dialog.windowFlags() & ~Qt::WindowContextHelpButtonHint);
+
+ Ui::CertificateErrorDialog certificateDialog;
+ certificateDialog.setupUi(&dialog);
+ certificateDialog.m_iconLabel->setText(QString());
+ QIcon icon(window()->style()->standardIcon(QStyle::SP_MessageBoxWarning, 0, window()));
+ certificateDialog.m_iconLabel->setPixmap(icon.pixmap(32, 32));
+ certificateDialog.m_errorLabel->setText(error.description());
+ dialog.setWindowTitle(tr("Certificate Error"));
+
+ if (dialog.exec() == QDialog::Accepted)
+ error.acceptCertificate();
+ else
+ error.rejectCertificate();
+}
+
+void WebView::handleAuthenticationRequired(const QUrl &requestUrl, QAuthenticator *auth)
+{
+ QDialog dialog(window());
+ dialog.setModal(true);
+ dialog.setWindowFlags(dialog.windowFlags() & ~Qt::WindowContextHelpButtonHint);
+
+ Ui::PasswordDialog passwordDialog;
+ passwordDialog.setupUi(&dialog);
+
+ passwordDialog.m_iconLabel->setText(QString());
+ QIcon icon(window()->style()->standardIcon(QStyle::SP_MessageBoxQuestion, 0, window()));
+ passwordDialog.m_iconLabel->setPixmap(icon.pixmap(32, 32));
+
+ QString introMessage(tr("Enter username and password for \"%1\" at %2")
+ .arg(auth->realm(),
+ requestUrl.toString().toHtmlEscaped()));
+ passwordDialog.m_infoLabel->setText(introMessage);
+ passwordDialog.m_infoLabel->setWordWrap(true);
+
+ if (dialog.exec() == QDialog::Accepted) {
+ auth->setUser(passwordDialog.m_userNameLineEdit->text());
+ auth->setPassword(passwordDialog.m_passwordLineEdit->text());
+ } else {
+ // Set authenticator null if dialog is cancelled
+ *auth = QAuthenticator();
+ }
+}
+
+void WebView::handleFeaturePermissionRequested(const QUrl &securityOrigin,
+ QWebEnginePage::Feature feature)
+{
+ QString title = tr("Permission Request");
+ QString question = questionForFeature(feature).arg(securityOrigin.host());
+ if (!question.isEmpty() && QMessageBox::question(window(), title, question) == QMessageBox::Yes)
+ page()->setFeaturePermission(securityOrigin, feature,
+ QWebEnginePage::PermissionGrantedByUser);
+ else
+ page()->setFeaturePermission(securityOrigin, feature,
+ QWebEnginePage::PermissionDeniedByUser);
+}
+
+void WebView::handleProxyAuthenticationRequired(const QUrl &, QAuthenticator *auth,
+ const QString &proxyHost)
+{
+ QDialog dialog(window());
+ dialog.setModal(true);
+ dialog.setWindowFlags(dialog.windowFlags() & ~Qt::WindowContextHelpButtonHint);
+
+ Ui::PasswordDialog passwordDialog;
+ passwordDialog.setupUi(&dialog);
+
+ passwordDialog.m_iconLabel->setText(QString());
+ QIcon icon(window()->style()->standardIcon(QStyle::SP_MessageBoxQuestion, 0, window()));
+ passwordDialog.m_iconLabel->setPixmap(icon.pixmap(32, 32));
+
+ QString introMessage = tr("Connect to proxy \"%1\" using:");
+ introMessage = introMessage.arg(proxyHost.toHtmlEscaped());
+ passwordDialog.m_infoLabel->setText(introMessage);
+ passwordDialog.m_infoLabel->setWordWrap(true);
+
+ if (dialog.exec() == QDialog::Accepted) {
+ auth->setUser(passwordDialog.m_userNameLineEdit->text());
+ auth->setPassword(passwordDialog.m_passwordLineEdit->text());
+ } else {
+ // Set authenticator null if dialog is cancelled
+ *auth = QAuthenticator();
+ }
+}
+
+void WebView::handleWebAuthUxRequested(QWebEngineWebAuthUxRequest *request)
+{
+ if (m_authDialog)
+ delete m_authDialog;
+
+ m_authDialog = new WebAuthDialog(request, window());
+ m_authDialog->setModal(false);
+ m_authDialog->setWindowFlags(m_authDialog->windowFlags() & ~Qt::WindowContextHelpButtonHint);
+
+ connect(request, &QWebEngineWebAuthUxRequest::stateChanged, this, &WebView::onStateChanged);
+ m_authDialog->show();
+}
+
+void WebView::onStateChanged(QWebEngineWebAuthUxRequest::WebAuthUxState state)
+{
+ if (QWebEngineWebAuthUxRequest::WebAuthUxState::Completed == state
+ || QWebEngineWebAuthUxRequest::WebAuthUxState::Cancelled == state) {
+ if (m_authDialog) {
+ delete m_authDialog;
+ m_authDialog = nullptr;
+ }
+ } else {
+ m_authDialog->updateDisplay();
+ }
+}
+
+//! [registerProtocolHandlerRequested]
+void WebView::handleRegisterProtocolHandlerRequested(
+ QWebEngineRegisterProtocolHandlerRequest request)
+{
+ auto answer = QMessageBox::question(window(), tr("Permission Request"),
+ tr("Allow %1 to open all %2 links?")
+ .arg(request.origin().host())
+ .arg(request.scheme()));
+ if (answer == QMessageBox::Yes)
+ request.accept();
+ else
+ request.reject();
+}
+//! [registerProtocolHandlerRequested]
+
+#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0)
+void WebView::handleFileSystemAccessRequested(QWebEngineFileSystemAccessRequest request)
+{
+ QString accessType;
+ switch (request.accessFlags()) {
+ case QWebEngineFileSystemAccessRequest::Read:
+ accessType = "read";
+ break;
+ case QWebEngineFileSystemAccessRequest::Write:
+ accessType = "write";
+ break;
+ case QWebEngineFileSystemAccessRequest::Read | QWebEngineFileSystemAccessRequest::Write:
+ accessType = "read and write";
+ break;
+ default:
+ Q_UNREACHABLE();
+ }
+
+ auto answer = QMessageBox::question(window(), tr("File system access request"),
+ tr("Give %1 %2 access to %3?")
+ .arg(request.origin().host())
+ .arg(accessType)
+ .arg(request.filePath().toString()));
+ if (answer == QMessageBox::Yes)
+ request.accept();
+ else
+ request.reject();
+}
+
+void WebView::handleImageAnimationPolicyChange(QWebEngineSettings::ImageAnimationPolicy policy)
+{
+ if (!page())
+ return;
+
+ page()->settings()->setImageAnimationPolicy(policy);
+}
+#endif // QT_VERSION >= QT_VERSION_CHECK(6, 4, 0)
diff --git a/examples/webenginewidgets/simplebrowser/webview.h b/examples/webenginewidgets/simplebrowser/webview.h
index 8559a68b8..c7e7f394c 100644
--- a/examples/webenginewidgets/simplebrowser/webview.h
+++ b/examples/webenginewidgets/simplebrowser/webview.h
@@ -1,67 +1,31 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef WEBVIEW_H
#define WEBVIEW_H
#include <QIcon>
#include <QWebEngineView>
+#include <QWebEngineCertificateError>
+#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0)
+#include <QWebEngineFileSystemAccessRequest>
+#endif
+#include <QWebEnginePage>
+#include <QWebEngineRegisterProtocolHandlerRequest>
+#include <QWebEngineWebAuthUxRequest>
+#include <QWebEngineSettings>
+#include <QActionGroup>
class WebPage;
+class WebAuthDialog;
class WebView : public QWebEngineView
{
Q_OBJECT
public:
- WebView(QWidget *parent = nullptr);
+ explicit WebView(QWidget *parent = nullptr);
+ ~WebView();
void setPage(WebPage *page);
int loadProgress() const;
@@ -76,12 +40,28 @@ signals:
void webActionEnabledChanged(QWebEnginePage::WebAction webAction, bool enabled);
void favIconChanged(const QIcon &icon);
void devToolsRequested(QWebEnginePage *source);
+private slots:
+ void handleCertificateError(QWebEngineCertificateError error);
+ void handleAuthenticationRequired(const QUrl &requestUrl, QAuthenticator *auth);
+ void handleFeaturePermissionRequested(const QUrl &securityOrigin,
+ QWebEnginePage::Feature feature);
+ void handleProxyAuthenticationRequired(const QUrl &requestUrl, QAuthenticator *auth,
+ const QString &proxyHost);
+ void handleRegisterProtocolHandlerRequested(QWebEngineRegisterProtocolHandlerRequest request);
+#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0)
+ void handleFileSystemAccessRequested(QWebEngineFileSystemAccessRequest request);
+ void handleWebAuthUxRequested(QWebEngineWebAuthUxRequest *request);
+#endif
+ void handleImageAnimationPolicyChange(QWebEngineSettings::ImageAnimationPolicy policy);
private:
void createWebActionTrigger(QWebEnginePage *page, QWebEnginePage::WebAction);
+ void onStateChanged(QWebEngineWebAuthUxRequest::WebAuthUxState state);
private:
- int m_loadProgress;
+ int m_loadProgress = 100;
+ WebAuthDialog *m_authDialog = nullptr;
+ QActionGroup *m_imageAnimationGroup = nullptr;
};
#endif
diff --git a/examples/webenginewidgets/spellchecker/CMakeLists.txt b/examples/webenginewidgets/spellchecker/CMakeLists.txt
new file mode 100644
index 000000000..3a5ea08ca
--- /dev/null
+++ b/examples/webenginewidgets/spellchecker/CMakeLists.txt
@@ -0,0 +1,65 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+project(spellchecker LANGUAGES CXX)
+
+set(CMAKE_AUTOMOC ON)
+
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webenginewidgets/spellchecker")
+
+find_package(Qt6 REQUIRED COMPONENTS Core Gui WebEngineWidgets)
+
+qt_add_executable(spellchecker
+ main.cpp
+ webview.cpp webview.h
+)
+
+set_target_properties(spellchecker PROPERTIES
+ WIN32_EXECUTABLE TRUE
+ MACOSX_BUNDLE TRUE
+)
+
+target_link_libraries(spellchecker PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::WebEngineWidgets
+)
+
+# Resources:
+set(spellchecker_resource_files
+ "data/index.html"
+ "data/style.css"
+)
+
+qt_add_resources(spellchecker "spellchecker"
+ PREFIX
+ "/"
+ BASE
+ "data"
+ FILES
+ ${spellchecker_resource_files}
+)
+
+install(TARGETS spellchecker
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
+
+file(GLOB_RECURSE dicts
+ ABSOLUTE ${CMAKE_CURRENT_LIST_DIR}/dict
+ */*.dic
+)
+
+foreach(dictFile ${dicts})
+ qt_add_webengine_dictionary(
+ TARGET spellchecker
+ SOURCE "${dictFile}"
+ OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ )
+endforeach()
diff --git a/examples/webenginewidgets/spellchecker/data/icon.svg b/examples/webenginewidgets/spellchecker/data/icon.svg
deleted file mode 100644
index b90ff26dd..000000000
--- a/examples/webenginewidgets/spellchecker/data/icon.svg
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
-<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
- width="94px" height="94px" viewBox="0 0 94 94" enable-background="new 0 0 94 94" xml:space="preserve">
-<g>
- <circle fill="none" cx="47" cy="47" r="47"/>
- <g>
- <path fill="#46A2DA" d="M47,92.979c-11.779,0-23.559-4.484-32.526-13.451C-3.461,61.591-3.461,32.409,14.472,14.474
- C32.41-3.463,61.592-3.461,79.526,14.473c17.935,17.936,17.935,47.119,0.002,65.054l-0.002,0.001
- C70.559,88.495,58.779,92.979,47,92.979z"/>
- </g>
- <path fill="#80C342" d="M93,47C93,21.595,72.405,1,47,1C34.297,1,22.797,6.149,14.473,14.473l65.054,65.054
- C87.851,71.203,93,59.703,93,47z"/>
- <g>
- <path fill="#46A2DA" d="M47,65c-4.808,0-9.328-1.873-12.728-5.272c-7.018-7.019-7.018-18.438,0-25.456
- C37.672,30.873,42.192,29,47,29s9.328,1.873,12.728,5.272c7.018,7.019,7.018,18.438,0,25.456C56.328,63.127,51.808,65,47,65z"/>
- <path fill="#FFFFFF" d="M62.248,59.919c6.671-7.858,6.312-19.644-1.105-27.061C57.237,28.953,52.118,27,47,27
- c-5.118,0-10.237,1.953-14.142,5.858c-7.81,7.81-7.81,20.474,0,28.284C36.763,65.047,41.882,67,47,67
- c4.379,0,8.752-1.441,12.372-4.3L77.88,81.209c0.989-0.895,1.935-1.837,2.843-2.814L62.248,59.919z M35.686,58.314
- c-6.238-6.238-6.238-16.389,0-22.627C38.708,32.664,42.726,31,47,31c4.274,0,8.292,1.664,11.314,4.686
- c6.238,6.238,6.238,16.389,0,22.627C55.292,61.336,51.274,63,47,63C42.726,63,38.708,61.336,35.686,58.314z"/>
- </g>
-</g>
-</svg>
diff --git a/examples/webenginewidgets/spellchecker/data/index.html b/examples/webenginewidgets/spellchecker/data/index.html
index b6cec5fe0..f68d64bc4 100644
--- a/examples/webenginewidgets/spellchecker/data/index.html
+++ b/examples/webenginewidgets/spellchecker/data/index.html
@@ -6,28 +6,29 @@
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
- <form class="form">
- <img class="logo" src="icon.svg" alt="qtwebengine">
- <div class="header">
- <h1>Contact us</h1>
- <h2>We are here to help</h2>
- </div>
- <label>
- <span>First Name:</span><input id="firstname" type="text" name="name" />
- </label>
- <label>
- <span>Last Name:</span><input id="lastName" type="text" name="name" />
- </label>
- <label>
- <span>Email Address:</span><input id="email" type="text" name="email" />
- </label>
- <label>
- <span>Subject:</span><input id="subject" type="text" name="subject" />
- </label>
- <label>
- <span>Message:</span><textarea id="feedback" name="feedback"></textarea>
- </label>
- <input type="submit" value="Send" />
- </form>
+ <main>
+ <form class="form">
+ <div class="header">
+ <h1>Contact us</h1>
+ <h2>We are here to help</h2>
+ </div>
+ <label>
+ <span>First Name</span><input id="firstname" type="text" name="name" />
+ </label>
+ <label>
+ <span>Last Name</span><input id="lastName" type="text" name="name" />
+ </label>
+ <label>
+ <span>Email</span><input id="email" type="text" name="email" />
+ </label>
+ <label>
+ <span>Subject</span><input id="subject" type="text" name="subject" />
+ </label>
+ <label>
+ <span>Message</span><textarea id="feedback" name="feedback"></textarea>
+ </label>
+ <input type="submit" value="Send" />
+ </form>
+ </main>
</body>
</html>
diff --git a/examples/webenginewidgets/spellchecker/data/spellchecker.qrc b/examples/webenginewidgets/spellchecker/data/spellchecker.qrc
index a9c76cc7e..b5e0b1fe0 100644
--- a/examples/webenginewidgets/spellchecker/data/spellchecker.qrc
+++ b/examples/webenginewidgets/spellchecker/data/spellchecker.qrc
@@ -2,6 +2,5 @@
<qresource prefix="/">
<file>index.html</file>
<file>style.css</file>
- <file>icon.svg</file>
</qresource>
</RCC>
diff --git a/examples/webenginewidgets/spellchecker/data/style.css b/examples/webenginewidgets/spellchecker/data/style.css
index 7b6736f1f..38873c5a0 100644
--- a/examples/webenginewidgets/spellchecker/data/style.css
+++ b/examples/webenginewidgets/spellchecker/data/style.css
@@ -1,90 +1,119 @@
-.logo {
- width: 50px;
- height: 50px;
- float: left;
- margin: 20px 20px 0px 20px;
- -webkit-animation:spin 8s linear infinite;
+@import url('https://fonts.googleapis.com/css2?family=Titillium+Web:ital,wght@0,200;0,300;0,400;0,600;0,700;0,900;1,200;1,300;1,400;1,600;1,700&display=swap');
+* {
+ padding: 0;
+ margin: 0;
+ box-sizing: border-box;
+}
+
+
+body {
+ width: 100%;
+ padding: 0px;
+ margin: 0px;
}
-@-webkit-keyframes spin { 100% { -webkit-transform: rotate(360deg); } }
.header {
- display: inline
+ display: inline;
+}
+
+.main {
+ max-width: 100%;
}
.form {
- width: 450px;
- height: 600px;
- background: -webkit-linear-gradient(bottom, #ddd, #fff);
- border: 1px solid #999;
- border-radius: 12px;
- color: #46a;
- font-family: 'Lucida Sans Unicode', 'Lucida Grande', sans-serif;
- font-size: 14px;
- font-style: italic;
- font-weight: bold;
- margin: auto;
- padding: 10px;
- position: relative;
- line-height: 26px;
- text-decoration: none;
- -webkit-box-shadow: 0px 0px 5px #444;
+ width: 100%;
+ height: 100%;
+ background: #fff;
+ border: 0px solid #999;
+ border-radius: 8px;
+ color: #46a;
+ font-family: 'Titillium Web', sans-serif;
+ font-size: 1rem;
+ margin: auto;
+ padding: 40px;
+ position: relative;
+ line-height: 26px;
+ text-decoration: none;
}
h1 {
- padding-left:40px;
- color: #46a2da;
+ padding-left: 20px;
+ color: #00414A;
+ font-size: 2.5rem;
+ font-weight: 700;
+ margin-bottom: 1rem;
}
h2 {
- color: #80c342;
- font-size: 13px;
- margin-top: -20px;
+ padding-left: 20px;
+ color: #00414A;
+ font-size: 1.125rem;
+ font-weight: 400;
+ font-style: italic;
+ margin-bottom: 1.75rem;
}
span {
- margin-left: 20px;
+ font-size: 1.5rem;
+ margin-left: 20px;
+ color: #00414A;
+ font-weight: 700;
}
input {
- width: 400px;
- display: block;
- border: 1px solid #999;
- height: 25px;
- margin-left: 20px;
- margin-bottom: 10px;
- padding-left: 10px;
- -webkit-box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.3);
+ width: 90%;
+ display: block;
+ height: 2.25rem;
+ margin-left: 20px;
+ margin-right: 20px;
+ margin-bottom: 8px;
+ padding-left: 10px;
+ box-shadow: 1px 1px 4px 0px rgba(0, 0, 0, 0.15);
+ border-radius: var(--radius-radius-minimal, 0.25rem);
+ border: 1px solid var(--color-background-normal, #CCC);
+ background: var(--color-text-input-background, #FFF);
}
textarea {
- width: 400px;
- max-width: 400px;
- height: 180px;
- max-height: 400px;
- display: block;
- margin-left: 20px;
- padding-left: 10px;
- padding-right: 10px;
- -webkit-box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.3);
+ width: 90%;
+ max-width: 90%;
+ height: 10rem;
+ max-height: 14rem;
+ display: block;
+ margin-left: 20px;
+ margin-right: 20px;
+ padding-left: 10px;
+ padding-top: 10px;
+ box-shadow: 1px 1px 4px 0px rgba(0, 0, 0, 0.15);
+ border-radius: var(--radius-radius-minimal, 0.25rem);
+ border: 1px solid var(--color-background-normal, #CCC);
+ background: var(--color-text-input-background, #FFF);
}
input:focus, textarea:focus {
- outline:none;
- border: 1px solid #46a2da;
+ outline: none;
+ border: 1px solid #00414A;
}
input[type=submit] {
- width: 100px;
- left: 170px;
- bottom: 10px;
- background: #46a2da;
- color: #fff;
- height: 30px;
- position: absolute;
- border-radius: 14px;
+ display: flex;
+ align-items: center;
+ justify-content: center; /* Add this to horizontally center the content */
+ padding: 0.4444em 0.8889em;
+ height: 2.4em;
+ cursor: pointer;
+ width: 6.5rem;
+ background: #00414A;
+ color: #fff;
+ border-radius: 4px;
+ margin-top: 28px;
+ font-family: 'Titillium Web', sans-serif;
+ font-size: 1.125rem;
+ font-weight: 400;
+ transition: color 300ms ease-out, border 300ms ease-out;
}
input[type=submit]:hover {
- background: #80c342;
+ background: #19545C;
}
diff --git a/examples/webenginewidgets/spellchecker/doc/images/spellchecker-example.png b/examples/webenginewidgets/spellchecker/doc/images/spellchecker-example.png
index cc4e74946..1cbe9e6d3 100644
--- a/examples/webenginewidgets/spellchecker/doc/images/spellchecker-example.png
+++ b/examples/webenginewidgets/spellchecker/doc/images/spellchecker-example.png
Binary files differ
diff --git a/examples/webenginewidgets/spellchecker/doc/src/spellchecker.qdoc b/examples/webenginewidgets/spellchecker/doc/src/spellchecker.qdoc
index ecdb1c818..1d9d7b73c 100644
--- a/examples/webenginewidgets/spellchecker/doc/src/spellchecker.qdoc
+++ b/examples/webenginewidgets/spellchecker/doc/src/spellchecker.qdoc
@@ -1,35 +1,12 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\example webenginewidgets/spellchecker
\title WebEngine Widgets Spellchecker Example
\ingroup webengine-widgetexamples
\brief Integrates a spellchecker into a simple HTML form.
+ \examplecategory {Web Technologies}
\image spellchecker-example.png
diff --git a/examples/webenginewidgets/spellchecker/main.cpp b/examples/webenginewidgets/spellchecker/main.cpp
index bf056ea9e..55e06a874 100644
--- a/examples/webenginewidgets/spellchecker/main.cpp
+++ b/examples/webenginewidgets/spellchecker/main.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "webview.h"
#include <QApplication>
@@ -54,12 +7,11 @@
int main(int argc, char *argv[])
{
QCoreApplication::setOrganizationName("QtExamples");
- QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication app(argc, argv);
WebView view;
view.setUrl(QUrl(QStringLiteral("qrc:/index.html")));
- view.resize(500, 640);
+ view.resize(500, 750);
view.show();
return app.exec();
diff --git a/examples/webenginewidgets/spellchecker/spellchecker.pro b/examples/webenginewidgets/spellchecker/spellchecker.pro
index d652e4b1f..a720776ca 100644
--- a/examples/webenginewidgets/spellchecker/spellchecker.pro
+++ b/examples/webenginewidgets/spellchecker/spellchecker.pro
@@ -1,4 +1,3 @@
-include($$QTWEBENGINE_OUT_ROOT/src/core/qtwebenginecore-config.pri) # workaround for QTBUG-68093
QT_FOR_CONFIG += webenginecore
TEMPLATE = app
@@ -10,7 +9,7 @@ QT += webenginewidgets
}
qtConfig(webengine-native-spellchecker) {
- error("Spellcheck example can not be built when using native OS dictionaries.")
+ error("Spellchecker example can not be built when using native OS dictionaries.")
}
HEADERS += \
@@ -34,7 +33,7 @@ DISTFILES += \
target.path = $$[QT_INSTALL_EXAMPLES]/webenginewidgets/spellchecker
INSTALLS += target
-qtPrepareTool(CONVERT_TOOL, qwebengine_convert_dict)
+qtPrepareTool(CONVERT_TOOL, qwebengine_convert_dict, "", "", $$[QT_INSTALL_LIBEXECS])
debug_and_release {
CONFIG(debug, debug|release): DICTIONARIES_DIR = debug/qtwebengine_dictionaries
diff --git a/examples/webenginewidgets/spellchecker/webview.cpp b/examples/webenginewidgets/spellchecker/webview.cpp
index a65fb1a1a..388146d31 100644
--- a/examples/webenginewidgets/spellchecker/webview.cpp
+++ b/examples/webenginewidgets/spellchecker/webview.cpp
@@ -1,58 +1,11 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "webview.h"
#include <QContextMenuEvent>
#include <QMenu>
#include <QWebEngineProfile>
-#include <QWebEngineContextMenuData>
+#include <QWebEngineContextMenuRequest>
WebView::WebView(QWidget *parent)
: QWebEngineView(parent)
@@ -66,17 +19,17 @@ WebView::WebView(QWidget *parent)
void WebView::contextMenuEvent(QContextMenuEvent *event)
{
- const QWebEngineContextMenuData &data = page()->contextMenuData();
- Q_ASSERT(data.isValid());
+ QWebEngineContextMenuRequest *data = lastContextMenuRequest();
+ Q_ASSERT(data);
- if (!data.isContentEditable()) {
+ if (!data->isContentEditable()) {
QWebEngineView::contextMenuEvent(event);
return;
}
QWebEngineProfile *profile = page()->profile();
const QStringList &languages = profile->spellCheckLanguages();
- QMenu *menu = page()->createStandardContextMenu();
+ QMenu *menu = createStandardContextMenu();
menu->addSeparator();
QAction *spellcheckAction = new QAction(tr("Check Spelling"), nullptr);
diff --git a/examples/webenginewidgets/spellchecker/webview.h b/examples/webenginewidgets/spellchecker/webview.h
index 8c877b6e4..598f8b830 100644
--- a/examples/webenginewidgets/spellchecker/webview.h
+++ b/examples/webenginewidgets/spellchecker/webview.h
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef WEBVIEW_H
#define WEBVIEW_H
diff --git a/examples/webenginewidgets/stylesheetbrowser/3rdparty/COPYING b/examples/webenginewidgets/stylesheetbrowser/3rdparty/COPYING
deleted file mode 100644
index 220881da6..000000000
--- a/examples/webenginewidgets/stylesheetbrowser/3rdparty/COPYING
+++ /dev/null
@@ -1 +0,0 @@
-The icons in this repository are herefore released into the Public Domain.
diff --git a/examples/webenginewidgets/stylesheetbrowser/3rdparty/qt_attribution.json b/examples/webenginewidgets/stylesheetbrowser/3rdparty/qt_attribution.json
deleted file mode 100644
index ffca1812b..000000000
--- a/examples/webenginewidgets/stylesheetbrowser/3rdparty/qt_attribution.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "Id": "stylesheetbrowser-tango",
- "Name": "Tango Icon Library",
- "QDocModule": "qtwebengine",
- "QtUsage": "Used in WebEngine StyleSheet Browser example.",
-
- "QtParts": [ "examples" ],
- "Description": "Selected icons from the Tango Icon Library",
- "Homepage": "http://tango.freedesktop.org/Tango_Icon_Library",
- "Version": "0.8.90",
- "DownloadLocation": "http://tango.freedesktop.org/releases/tango-icon-theme-0.8.90.tar.gz",
- "LicenseId": "DocumentRef-PublicDomain",
- "License": "Public Domain",
- "LicenseFile": "COPYING",
- "Copyright": "Ulisse Perusin <uli.peru@gmail.com>
-Steven Garrity <sgarrity@silverorange.com>
-Lapo Calamandrei <calamandrei@gmail.com>
-Ryan Collier <rcollier@novell.com>
-Rodney Dawes <dobey@novell.com>
-Andreas Nilsson <nisses.mail@home.se>
-Tuomas Kuosmanen <tigert@tigert.com>
-Garrett LeSage <garrett@novell.com>
-Jakub Steiner <jimmac@novell.com>"
-}
diff --git a/examples/webenginewidgets/stylesheetbrowser/3rdparty/view-refresh.png b/examples/webenginewidgets/stylesheetbrowser/3rdparty/view-refresh.png
deleted file mode 100644
index cab4d02c7..000000000
--- a/examples/webenginewidgets/stylesheetbrowser/3rdparty/view-refresh.png
+++ /dev/null
Binary files differ
diff --git a/examples/webenginewidgets/stylesheetbrowser/doc/images/stylesheetbrowser.png b/examples/webenginewidgets/stylesheetbrowser/doc/images/stylesheetbrowser.png
deleted file mode 100644
index 32c7c43ed..000000000
--- a/examples/webenginewidgets/stylesheetbrowser/doc/images/stylesheetbrowser.png
+++ /dev/null
Binary files differ
diff --git a/examples/webenginewidgets/stylesheetbrowser/doc/src/stylesheetbrowser.qdoc b/examples/webenginewidgets/stylesheetbrowser/doc/src/stylesheetbrowser.qdoc
deleted file mode 100644
index 5b271bafb..000000000
--- a/examples/webenginewidgets/stylesheetbrowser/doc/src/stylesheetbrowser.qdoc
+++ /dev/null
@@ -1,68 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \example webenginewidgets/stylesheetbrowser
- \title WebEngine StyleSheet Browser Example
- \ingroup webengine-widgetexamples
- \brief Demonstrates how to inject CSS into web pages using user scripts.
-
- \image stylesheetbrowser.png
-
- \e {StyleSheet Browser} demonstrates how to use the \l{Qt WebEngine Widgets C++ Classes}
- {Qt WebEngine C++ classes} to inject user stylesheets into web pages.
-
- \include examples-run.qdocinc
-
- \section1 Working With Stylesheets
-
- We use JavaScript to create and append CSS elements to the documents.
- After declaring the script source, QWebEnginePage::runJavaScript() can run it
- immediately and apply newly created styles on the current content of the web view.
- Encapsulating the script into a QWebEngineScript and adding it to the script collection
- of QWebEnginePage makes its effect permanent.
-
- \quotefromfile webenginewidgets/stylesheetbrowser/mainwindow.cpp
- \skipto MainWindow::insertStyleSheet
- \printuntil /^\}/
-
- Removing stylesheets can be done similarly:
-
- \quotefromfile webenginewidgets/stylesheetbrowser/mainwindow.cpp
- \skipto MainWindow::removeStyleSheet
- \printuntil /^\}/
-
- \section1 Files and Attributions
-
- The example uses icons from the Tango Icon Library:
-
- \table
- \row
- \li \l{stylesheetbrowser-tango}{Tango Icon Library}
- \li Public Domain
- \endtable
-*/
diff --git a/examples/webenginewidgets/stylesheetbrowser/main.cpp b/examples/webenginewidgets/stylesheetbrowser/main.cpp
deleted file mode 100644
index 833ea6bb0..000000000
--- a/examples/webenginewidgets/stylesheetbrowser/main.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "mainwindow.h"
-#include "stylesheetdialog.h"
-#include <QApplication>
-#include <QUrl>
-
-int main(int argc, char *argv[])
-{
- qRegisterMetaTypeStreamOperators<StyleSheet>("StyleSheet");
-
- QCoreApplication::setOrganizationName("QtExamples");
- QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
- QApplication a(argc, argv);
- MainWindow w(QUrl("http://qt.io"));
- w.show();
- return a.exec();
-}
diff --git a/examples/webenginewidgets/stylesheetbrowser/mainwindow.cpp b/examples/webenginewidgets/stylesheetbrowser/mainwindow.cpp
deleted file mode 100644
index c93205b18..000000000
--- a/examples/webenginewidgets/stylesheetbrowser/mainwindow.cpp
+++ /dev/null
@@ -1,168 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "mainwindow.h"
-#include "stylesheetdialog.h"
-#include "ui_mainwindow.h"
-
-static QMap<QString, QString> defaultStyleSheets = {
- {"Upside down", "body { -webkit-transform: rotate(180deg); }"}
-};
-
-MainWindow::MainWindow(const QUrl &url) :
- QMainWindow(),
- ui(new Ui::MainWindow)
-{
- ui->setupUi(this);
-
- connect(ui->urlBar, &QLineEdit::returnPressed, this, &MainWindow::urlEntered);
- connect(ui->webEngineView, &QWebEngineView::urlChanged, this, &MainWindow::urlChanged);
- connect(ui->settingsButton, &QPushButton::clicked, this, &MainWindow::showStyleSheetsDialog);
- connect(ui->reloadButton, &QPushButton::clicked, this, &MainWindow::reloadRequested);
-
- QSettings settings;
- settings.beginGroup("styleSheets");
- QStringList styleSheets = settings.allKeys();
- if (styleSheets.empty()) {
- // Add back default style sheets if the user cleared them out
- loadDefaultStyleSheets();
- } else {
- for (auto name : qAsConst(styleSheets)) {
- StyleSheet styleSheet = settings.value(name).value<StyleSheet>();
- if (styleSheet.second)
- insertStyleSheet(name, styleSheet.first, false);
- }
- }
- settings.endGroup();
-
- ui->webEngineView->setUrl(url);
-}
-
-MainWindow::~MainWindow()
-{
- delete ui;
-}
-
-void MainWindow::insertStyleSheet(const QString &name, const QString &source, bool immediately)
-{
- QWebEngineScript script;
- QString s = QString::fromLatin1("(function() {"\
- " css = document.createElement('style');"\
- " css.type = 'text/css';"\
- " css.id = '%1';"\
- " document.head.appendChild(css);"\
- " css.innerText = '%2';"\
- "})()").arg(name).arg(source.simplified());
- if (immediately)
- ui->webEngineView->page()->runJavaScript(s, QWebEngineScript::ApplicationWorld);
-
- script.setName(name);
- script.setSourceCode(s);
- script.setInjectionPoint(QWebEngineScript::DocumentReady);
- script.setRunsOnSubFrames(true);
- script.setWorldId(QWebEngineScript::ApplicationWorld);
- ui->webEngineView->page()->scripts().insert(script);
-}
-
-void MainWindow::removeStyleSheet(const QString &name, bool immediately)
-{
- QString s = QString::fromLatin1("(function() {"\
- " var element = document.getElementById('%1');"\
- " element.outerHTML = '';"\
- " delete element;"\
- "})()").arg(name);
- if (immediately)
- ui->webEngineView->page()->runJavaScript(s, QWebEngineScript::ApplicationWorld);
-
- QWebEngineScript script = ui->webEngineView->page()->scripts().findScript(name);
- ui->webEngineView->page()->scripts().remove(script);
-}
-
-bool MainWindow::hasStyleSheet(const QString &name)
-{
- QWebEngineScript script = ui->webEngineView->page()->scripts().findScript(name);
- return !script.isNull();
-}
-
-void MainWindow::loadDefaultStyleSheets()
-{
- QSettings settings;
- settings.beginGroup("styleSheets");
-
- auto it = defaultStyleSheets.constBegin();
- while (it != defaultStyleSheets.constEnd()) {
- settings.setValue(it.key(), QVariant::fromValue(qMakePair(it.value(), true)));
- insertStyleSheet(it.key(), it.value(), false);
- ++it;
- }
-
- settings.endGroup();
-}
-
-void MainWindow::urlEntered()
-{
- ui->webEngineView->setUrl(QUrl::fromUserInput(ui->urlBar->text()));
-}
-
-void MainWindow::urlChanged(const QUrl &url)
-{
- ui->urlBar->setText(url.toString());
-}
-
-void MainWindow::showStyleSheetsDialog()
-{
- StylesheetDialog *dialog = new StylesheetDialog(this);
- dialog->show();
-}
-
-void MainWindow::reloadRequested()
-{
- ui->webEngineView->reload();
-}
diff --git a/examples/webenginewidgets/stylesheetbrowser/mainwindow.h b/examples/webenginewidgets/stylesheetbrowser/mainwindow.h
deleted file mode 100644
index c39735af8..000000000
--- a/examples/webenginewidgets/stylesheetbrowser/mainwindow.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef MAINWINDOW_H
-#define MAINWINDOW_H
-
-#include <QMainWindow>
-#include <QSettings>
-#include <QWebEngineScriptCollection>
-
-QT_BEGIN_NAMESPACE
-namespace Ui {
-class MainWindow;
-}
-QT_END_NAMESPACE
-
-class MainWindow : public QMainWindow
-{
- Q_OBJECT
-
-public:
- explicit MainWindow(const QUrl &url);
- ~MainWindow();
-
- void insertStyleSheet(const QString &name, const QString &source, bool immediately);
- void removeStyleSheet(const QString &name, bool immediately);
- bool hasStyleSheet(const QString &name);
- void loadDefaultStyleSheets();
-
-private slots:
- void urlEntered();
- void urlChanged(const QUrl &url);
- void showStyleSheetsDialog();
- void reloadRequested();
-
-private:
- Ui::MainWindow *ui;
-};
-
-#endif // MAINWINDOW_H
diff --git a/examples/webenginewidgets/stylesheetbrowser/mainwindow.ui b/examples/webenginewidgets/stylesheetbrowser/mainwindow.ui
deleted file mode 100644
index bc68c16bb..000000000
--- a/examples/webenginewidgets/stylesheetbrowser/mainwindow.ui
+++ /dev/null
@@ -1,133 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>MainWindow</class>
- <widget class="QMainWindow" name="MainWindow">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>713</width>
- <height>455</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>StyleSheet Browser</string>
- </property>
- <property name="unifiedTitleAndToolBarOnMac">
- <bool>false</bool>
- </property>
- <widget class="QWidget" name="centralWidget">
- <layout class="QHBoxLayout" name="horizontalLayout">
- <property name="spacing">
- <number>0</number>
- </property>
- <property name="leftMargin">
- <number>0</number>
- </property>
- <property name="topMargin">
- <number>0</number>
- </property>
- <property name="rightMargin">
- <number>0</number>
- </property>
- <property name="bottomMargin">
- <number>0</number>
- </property>
- <item>
- <widget class="QWidget" name="webContentsWidget" native="true">
- <layout class="QVBoxLayout" name="verticalLayout_3">
- <property name="spacing">
- <number>0</number>
- </property>
- <property name="leftMargin">
- <number>0</number>
- </property>
- <property name="topMargin">
- <number>0</number>
- </property>
- <property name="rightMargin">
- <number>0</number>
- </property>
- <property name="bottomMargin">
- <number>0</number>
- </property>
- <item>
- <widget class="QWidget" name="urlBarWidget" native="true">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <layout class="QHBoxLayout" name="horizontalLayout_2">
- <item>
- <widget class="QLineEdit" name="urlBar"/>
- </item>
- <item>
- <widget class="QPushButton" name="reloadButton">
- <property name="text">
- <string/>
- </property>
- <property name="icon">
- <iconset resource="stylesheetbrowser.qrc">
- <normaloff>:/view-refresh.png</normaloff>:/view-refresh.png</iconset>
- </property>
- <property name="shortcut">
- <string>Ctrl+R</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="settingsButton">
- <property name="text">
- <string>Settings</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <widget class="QWebEngineView" name="webEngineView" native="true">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="url" stdset="0">
- <url>
- <string>about:blank</string>
- </url>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- </layout>
- </widget>
- <widget class="QMenuBar" name="menuBar">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>713</width>
- <height>20</height>
- </rect>
- </property>
- </widget>
- </widget>
- <layoutdefault spacing="6" margin="11"/>
- <customwidgets>
- <customwidget>
- <class>QWebEngineView</class>
- <extends>QWidget</extends>
- <header location="global">QtWebEngineWidgets/QWebEngineView</header>
- </customwidget>
- </customwidgets>
- <resources>
- <include location="stylesheetbrowser.qrc"/>
- </resources>
- <connections/>
-</ui>
diff --git a/examples/webenginewidgets/stylesheetbrowser/stylesheetbrowser.pro b/examples/webenginewidgets/stylesheetbrowser/stylesheetbrowser.pro
deleted file mode 100644
index a9ff54400..000000000
--- a/examples/webenginewidgets/stylesheetbrowser/stylesheetbrowser.pro
+++ /dev/null
@@ -1,22 +0,0 @@
-TEMPLATE = app
-TARGET = stylesheetbrowser
-QT += webenginewidgets
-
-HEADERS += \
- mainwindow.h \
- stylesheetdialog.h
-
-SOURCES += \
- main.cpp \
- mainwindow.cpp \
- stylesheetdialog.cpp
-
-FORMS += \
- mainwindow.ui \
- stylesheetdialog.ui
-
-RESOURCES += stylesheetbrowser.qrc
-
-# install
-target.path = $$[QT_INSTALL_EXAMPLES]/webenginewidgets/stylesheetbrowser
-INSTALLS += target
diff --git a/examples/webenginewidgets/stylesheetbrowser/stylesheetbrowser.qrc b/examples/webenginewidgets/stylesheetbrowser/stylesheetbrowser.qrc
deleted file mode 100644
index a1cebd6a7..000000000
--- a/examples/webenginewidgets/stylesheetbrowser/stylesheetbrowser.qrc
+++ /dev/null
@@ -1,5 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file alias="view-refresh.png">3rdparty/view-refresh.png</file>
- </qresource>
-</RCC>
diff --git a/examples/webenginewidgets/stylesheetbrowser/stylesheetdialog.cpp b/examples/webenginewidgets/stylesheetbrowser/stylesheetdialog.cpp
deleted file mode 100644
index 7351ab75f..000000000
--- a/examples/webenginewidgets/stylesheetbrowser/stylesheetdialog.cpp
+++ /dev/null
@@ -1,177 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "mainwindow.h"
-#include "stylesheetdialog.h"
-#include "ui_stylesheetdialog.h"
-
-StylesheetDialog::StylesheetDialog(QWidget *parent) :
- QDialog(parent),
- ui(new Ui::StylesheetDialog)
-{
- ui->setupUi(this);
-
- connect(ui->styleSheetList, &QListWidget::currentItemChanged, this, &StylesheetDialog::currentStyleSheetChanged);
- connect(ui->styleSheetList, &QListWidget::itemClicked, this, &StylesheetDialog::listItemClicked);
- connect(ui->fileNameEdit, &QLineEdit::textChanged, this, &StylesheetDialog::fileNameChanged);
-
- connect(ui->addButton, &QPushButton::clicked, this, &StylesheetDialog::addButtonClicked);
- connect(ui->removeButton, &QPushButton::clicked, this, &StylesheetDialog::removeButtonClicked);
-
- QSettings settings;
- settings.beginGroup("styleSheets");
- for (auto name : settings.allKeys()) {
- QListWidgetItem *listItem = new QListWidgetItem(name, ui->styleSheetList);
- listItem->setFlags(listItem->flags() | Qt::ItemIsUserCheckable);
- bool checked = settings.value(name).value<StyleSheet>().second;
- listItem->setCheckState(checked ? Qt::Checked : Qt::Unchecked);
- }
- settings.endGroup();
-}
-
-StylesheetDialog::~StylesheetDialog()
-{
- delete ui;
-}
-
-void StylesheetDialog::currentStyleSheetChanged(QListWidgetItem *current, QListWidgetItem *previous)
-{
- if (!previous) {
- // Select the first item on startup
- ui->styleSheetList->setCurrentItem(current);
- }
-
- if (!current) {
- ui->fileNameEdit->setText(QString());
- ui->sourceCodeEdit->setPlainText(QString());
- return;
- }
-
- QSettings settings;
- settings.beginGroup("styleSheets");
- ui->fileNameEdit->setText(current->text());
- const QString source = settings.value(current->text()).value<StyleSheet>().first;
- ui->sourceCodeEdit->setPlainText(source);
- settings.endGroup();
-}
-
-void StylesheetDialog::listItemClicked(QListWidgetItem *item)
-{
- MainWindow *window = static_cast<MainWindow *>(parent());
- const QString name = item->text();
- bool checkedStateChanged =
- (item->checkState() == Qt::Checked && !window->hasStyleSheet(name)) ||
- (item->checkState() == Qt::Unchecked && window->hasStyleSheet(name));
- if (!checkedStateChanged)
- return;
-
- QSettings settings;
- settings.beginGroup("styleSheets");
- const QString source = settings.value(name).value<StyleSheet>().first;
-
- if (item->checkState() == Qt::Checked) {
- settings.setValue(name, QVariant::fromValue(qMakePair(source, true)));
- window->insertStyleSheet(name, source, true);
- } else {
- settings.setValue(name, QVariant::fromValue(qMakePair(source, false)));
- window->removeStyleSheet(name, true);
- }
-
- settings.endGroup();
-}
-
-void StylesheetDialog::fileNameChanged(const QString &text)
-{
- QList<QListWidgetItem *> items = ui->styleSheetList->findItems(text, Qt::MatchFixedString);
- if (items.size())
- ui->addButton->setEnabled(false);
- else
- ui->addButton->setEnabled(true);
-}
-
-void StylesheetDialog::addButtonClicked()
-{
- const QString name = ui->fileNameEdit->text();
- const QString source = ui->sourceCodeEdit->toPlainText();
- if (name.isEmpty() || source.isEmpty())
- return;
-
- QListWidgetItem *listItem = new QListWidgetItem(ui->fileNameEdit->text(), ui->styleSheetList);
- listItem->setFlags(listItem->flags() | Qt::ItemIsUserCheckable);
- listItem->setCheckState(Qt::Checked);
-
- MainWindow *window = static_cast<MainWindow *>(parent());
- window->insertStyleSheet(name, source, true);
-
- QSettings settings;
- settings.beginGroup("styleSheets");
- settings.setValue(name, QVariant::fromValue(qMakePair(source, true)));
- settings.endGroup();
-
- ui->addButton->setEnabled(false);
-}
-
-void StylesheetDialog::removeButtonClicked()
-{
- if (ui->styleSheetList->selectedItems().isEmpty())
- return;
-
- MainWindow *window = static_cast<MainWindow *>(parent());
- QSettings settings;
- settings.beginGroup("styleSheets");
-
- QListWidgetItem *item = ui->styleSheetList->selectedItems().first();
- const QString name = item->text();
- window->removeStyleSheet(name, true);
- settings.remove(name);
- delete item;
-
- settings.endGroup();
-}
diff --git a/examples/webenginewidgets/stylesheetbrowser/stylesheetdialog.h b/examples/webenginewidgets/stylesheetbrowser/stylesheetdialog.h
deleted file mode 100644
index 3bf3219ca..000000000
--- a/examples/webenginewidgets/stylesheetbrowser/stylesheetdialog.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef STYLESHEETDIALOG_H
-#define STYLESHEETDIALOG_H
-
-#include <QDialog>
-#include <QListWidgetItem>
-
-QT_BEGIN_NAMESPACE
-namespace Ui {
-class StylesheetDialog;
-}
-QT_END_NAMESPACE
-
-typedef QPair<QString, bool> StyleSheet; // <source, isEnabled>
-Q_DECLARE_METATYPE(StyleSheet);
-
-class StylesheetDialog : public QDialog
-{
- Q_OBJECT
-
-public:
- explicit StylesheetDialog(QWidget *parent = 0);
- ~StylesheetDialog();
-
-private slots:
- void currentStyleSheetChanged(QListWidgetItem *current, QListWidgetItem *previous);
- void listItemClicked(QListWidgetItem *item);
- void fileNameChanged(const QString &text);
-
- void addButtonClicked();
- void removeButtonClicked();
-
-private:
- Ui::StylesheetDialog *ui;
-};
-
-#endif // STYLESHEETDIALOG_H
diff --git a/examples/webenginewidgets/stylesheetbrowser/stylesheetdialog.ui b/examples/webenginewidgets/stylesheetbrowser/stylesheetdialog.ui
deleted file mode 100644
index 19db267e8..000000000
--- a/examples/webenginewidgets/stylesheetbrowser/stylesheetdialog.ui
+++ /dev/null
@@ -1,122 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>StylesheetDialog</class>
- <widget class="QDialog" name="StylesheetDialog">
- <property name="windowModality">
- <enum>Qt::ApplicationModal</enum>
- </property>
- <property name="windowTitle">
- <string>Stylesheets</string>
- </property>
- <property name="modal">
- <bool>true</bool>
- </property>
- <layout class="QGridLayout" name="gridLayout_2">
- <item row="3" column="1">
- <widget class="QDialogButtonBox" name="buttonBox">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="standardButtons">
- <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
- </property>
- </widget>
- </item>
- <item row="0" column="0" rowspan="3">
- <widget class="QListWidget" name="styleSheetList"/>
- </item>
- <item row="0" column="1" rowspan="3">
- <widget class="QFrame" name="frame">
- <property name="frameShape">
- <enum>QFrame::StyledPanel</enum>
- </property>
- <property name="frameShadow">
- <enum>QFrame::Plain</enum>
- </property>
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0">
- <widget class="QLabel" name="fileNameLabel">
- <property name="text">
- <string>Stylesheet name:</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QLineEdit" name="fileNameEdit"/>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="sourceLabel">
- <property name="text">
- <string>Source code:</string>
- </property>
- </widget>
- </item>
- <item row="2" column="0" colspan="2">
- <widget class="QPlainTextEdit" name="sourceCodeEdit">
- <property name="font">
- <font>
- <family>Courier New</family>
- <pointsize>10</pointsize>
- </font>
- </property>
- </widget>
- </item>
- <item row="3" column="0" colspan="2">
- <layout class="QHBoxLayout" name="horizontalLayout">
- <item>
- <widget class="QPushButton" name="addButton">
- <property name="text">
- <string>Add</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="removeButton">
- <property name="text">
- <string>Remove</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections>
- <connection>
- <sender>buttonBox</sender>
- <signal>accepted()</signal>
- <receiver>StylesheetDialog</receiver>
- <slot>accept()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>248</x>
- <y>254</y>
- </hint>
- <hint type="destinationlabel">
- <x>157</x>
- <y>274</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>buttonBox</sender>
- <signal>rejected()</signal>
- <receiver>StylesheetDialog</receiver>
- <slot>reject()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>316</x>
- <y>260</y>
- </hint>
- <hint type="destinationlabel">
- <x>286</x>
- <y>274</y>
- </hint>
- </hints>
- </connection>
- </connections>
-</ui>
diff --git a/examples/webenginewidgets/videoplayer/CMakeLists.txt b/examples/webenginewidgets/videoplayer/CMakeLists.txt
new file mode 100644
index 000000000..0aff069d7
--- /dev/null
+++ b/examples/webenginewidgets/videoplayer/CMakeLists.txt
@@ -0,0 +1,53 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+project(videoplayer LANGUAGES CXX)
+
+set(CMAKE_AUTOMOC ON)
+
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webenginewidgets/videoplayer")
+
+find_package(Qt6 REQUIRED COMPONENTS Core Gui WebEngineWidgets)
+
+qt_add_executable(videoplayer
+ fullscreennotification.cpp fullscreennotification.h
+ fullscreenwindow.cpp fullscreenwindow.h
+ main.cpp
+ mainwindow.cpp mainwindow.h
+)
+
+set_target_properties(videoplayer PROPERTIES
+ WIN32_EXECUTABLE TRUE
+ MACOSX_BUNDLE TRUE
+)
+
+target_link_libraries(videoplayer PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::WebEngineWidgets
+)
+
+# Resources:
+set(videoplayer_resource_files
+ "data/index.html"
+)
+
+qt_add_resources(videoplayer "videoplayer"
+ PREFIX
+ "/"
+ BASE
+ "data"
+ FILES
+ ${videoplayer_resource_files}
+)
+
+install(TARGETS videoplayer
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/webenginewidgets/videoplayer/doc/src/videoplayer.qdoc b/examples/webenginewidgets/videoplayer/doc/src/videoplayer.qdoc
index 256a69baf..931f08558 100644
--- a/examples/webenginewidgets/videoplayer/doc/src/videoplayer.qdoc
+++ b/examples/webenginewidgets/videoplayer/doc/src/videoplayer.qdoc
@@ -1,32 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\example webenginewidgets/videoplayer
+ \examplecategory {Web Technologies}
\title WebEngine Widgets Video Player Example
\ingroup webengine-widgetexamples
\brief Displays full screen video using \l QWebEngineView.
diff --git a/examples/webenginewidgets/videoplayer/fullscreennotification.cpp b/examples/webenginewidgets/videoplayer/fullscreennotification.cpp
index dbbf4660d..effd85ded 100644
--- a/examples/webenginewidgets/videoplayer/fullscreennotification.cpp
+++ b/examples/webenginewidgets/videoplayer/fullscreennotification.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "fullscreennotification.h"
diff --git a/examples/webenginewidgets/videoplayer/fullscreennotification.h b/examples/webenginewidgets/videoplayer/fullscreennotification.h
index 31fa0b59d..eebe3b85d 100644
--- a/examples/webenginewidgets/videoplayer/fullscreennotification.h
+++ b/examples/webenginewidgets/videoplayer/fullscreennotification.h
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef FULLSCREENNOTIFICATION_H
#define FULLSCREENNOTIFICATION_H
diff --git a/examples/webenginewidgets/videoplayer/fullscreenwindow.cpp b/examples/webenginewidgets/videoplayer/fullscreenwindow.cpp
index fbc899d83..fe2e72d86 100644
--- a/examples/webenginewidgets/videoplayer/fullscreenwindow.cpp
+++ b/examples/webenginewidgets/videoplayer/fullscreenwindow.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "fullscreenwindow.h"
diff --git a/examples/webenginewidgets/videoplayer/fullscreenwindow.h b/examples/webenginewidgets/videoplayer/fullscreenwindow.h
index a5d53bcd8..d7af0b655 100644
--- a/examples/webenginewidgets/videoplayer/fullscreenwindow.h
+++ b/examples/webenginewidgets/videoplayer/fullscreenwindow.h
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef FULLSCREENWINDOW_H
#define FULLSCREENWINDOW_H
diff --git a/examples/webenginewidgets/videoplayer/main.cpp b/examples/webenginewidgets/videoplayer/main.cpp
index cfcfa06d8..550546130 100644
--- a/examples/webenginewidgets/videoplayer/main.cpp
+++ b/examples/webenginewidgets/videoplayer/main.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "mainwindow.h"
#include <QApplication>
@@ -54,7 +7,6 @@
int main(int argc, char *argv[])
{
QCoreApplication::setOrganizationName("QtExamples");
- QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication app(argc, argv);
MainWindow mainWindow;
diff --git a/examples/webenginewidgets/videoplayer/mainwindow.cpp b/examples/webenginewidgets/videoplayer/mainwindow.cpp
index e930041a8..7de2446f1 100644
--- a/examples/webenginewidgets/videoplayer/mainwindow.cpp
+++ b/examples/webenginewidgets/videoplayer/mainwindow.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "mainwindow.h"
diff --git a/examples/webenginewidgets/videoplayer/mainwindow.h b/examples/webenginewidgets/videoplayer/mainwindow.h
index cdbe5d98e..3138800b5 100644
--- a/examples/webenginewidgets/videoplayer/mainwindow.h
+++ b/examples/webenginewidgets/videoplayer/mainwindow.h
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
diff --git a/examples/webenginewidgets/webenginewidgets.pro b/examples/webenginewidgets/webenginewidgets.pro
index deb42a8cd..2a24686cf 100644
--- a/examples/webenginewidgets/webenginewidgets.pro
+++ b/examples/webenginewidgets/webenginewidgets.pro
@@ -1,20 +1,17 @@
-include($$QTWEBENGINE_OUT_ROOT/src/core/qtwebenginecore-config.pri) # workaround for QTBUG-68093
-QT_FOR_CONFIG += webenginecore webenginecore-private
+QT_FOR_CONFIG += webenginecore webenginecore-private network-private
TEMPLATE=subdirs
SUBDIRS += \
- minimal \
contentmanipulation \
cookiebrowser \
notifications \
simplebrowser \
- stylesheetbrowser \
- videoplayer \
- webui
+ push-notifications \
+ videoplayer
qtConfig(webengine-geolocation): SUBDIRS += maps
-qtConfig(webengine-webchannel): SUBDIRS += markdowneditor
+qtConfig(webengine-webchannel): SUBDIRS += recipebrowser
qtConfig(webengine-printing-and-pdf) {
SUBDIRS += printme html2pdf
@@ -23,6 +20,7 @@ qtConfig(webengine-printing-and-pdf) {
qtConfig(webengine-spellchecker):!qtConfig(webengine-native-spellchecker):!cross_compile {
SUBDIRS += spellchecker
} else {
- message("Spellcheck example will not be built because it depends on usage of Hunspell dictionaries.")
+ message("Spellchecker example will not be built because it depends on usage of Hunspell dictionaries.")
}
+qtConfig(ssl): SUBDIRS += clientcertificate
diff --git a/examples/webenginewidgets/webui/about.html b/examples/webenginewidgets/webui/about.html
deleted file mode 100644
index 7b5a58969..000000000
--- a/examples/webenginewidgets/webui/about.html
+++ /dev/null
@@ -1,129 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>Qt WebEngine WebUI Example</title>
- <style>
- html {
- background: #f0f0f0;
- color: #303030;
- font: 16px system-ui;
- height: 100%;
- }
-
- body {
- margin: 0;
- padding: 0;
- height: 100%;
- display: flex;
- flex-direction: column;
- align-items: stretch;
- }
-
- body > * {
- padding-left: 20px;
- padding-right: 20px;
- }
-
- header {
- flex: none;
- display: flex;
- align-items: center;
- background: #f0fff0;
- border-bottom: 1px solid #e0e0e0;
- padding-top: 20px;
- padding-bottom: 20px;
- }
-
- header > h1 {
- font: bold 20px system-ui;
- margin-left: 18px;
- }
-
- main {
- flex: auto;
- }
-
- footer {
- flex: none;
- display: flex;
- justify-content: center;
- padding-bottom: 20px;
- }
-
- button {
- background: #41cd52;
- color: #f0f0f0;
- font: 16px system-ui;
- border: 0;
- box-shadow: 0px 1px 3px rgb(0,0,0,0.5);
- cursor: pointer;
- margin: 0 0 1px;
- padding: 10px 24px;
- }
-
- button:hover {
- background: #50dc61;
- }
-
- button:active {
- background: #50dc61;
- box-shadow: 0px 1px 2px rgb(0,0,0,0.5);
- margin: 1px 0 0;
- }
-
- button:focus {
- outline: 0;
- }
-
- </style>
- </head>
- <body>
- <header>
- <img width="48px" height="48px"
- src="qrc:/qt-project.org/qmessagebox/images/qtlogo-64.png">
- <h1>WebEngine Widgets<br>WebUI Example</h1>
- </header>
- <main>
- <p>
- Aside from the built-in schemes, such as <code>http</code> and
- <code>qrc</code>, Qt WebEngine may be extended with <em>custom
- schemes</em> by creating <em>custom scheme handlers</em>.
- </p>
-
- <p>
- This is a simple HTML page loaded from a custom scheme and
- displayed by a <code>QWebEngineView</code>. Even the Quit button
- below is a standard HTML <code>&lt;button&gt;</code> element.
- </p>
-
- <p>
- Read the documentation to find out
- </p>
- <ul>
- <li>
- <p>
- How to create a custom scheme handler which serves HTML
- and handles HTML form submissions.
- </p>
- </li>
- <li>
- <p>
- How to prevent ordinary web content from accessing the
- custom scheme.
- </p>
- </li>
- <li>
- <p>
- How to prevent any other scheme from submitting HTML
- form data.
- </p>
- </li>
- </ul>
- </main>
- <footer>
- <form action="" method="post">
- <button name="quit">Quit</button>
- </form>
- </footer>
- </body>
-</html>
diff --git a/examples/webenginewidgets/webui/doc/images/webui-example.png b/examples/webenginewidgets/webui/doc/images/webui-example.png
deleted file mode 100644
index 84e2c7fc3..000000000
--- a/examples/webenginewidgets/webui/doc/images/webui-example.png
+++ /dev/null
Binary files differ
diff --git a/examples/webenginewidgets/webui/doc/src/webui.qdoc b/examples/webenginewidgets/webui/doc/src/webui.qdoc
deleted file mode 100644
index 949b358a7..000000000
--- a/examples/webenginewidgets/webui/doc/src/webui.qdoc
+++ /dev/null
@@ -1,165 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \example webenginewidgets/webui
- \title WebEngine Widgets WebUI Example
- \ingroup webengine-widgetexamples
- \brief Displays HTML over a custom scheme.
-
- \image webui-example.png
-
- \e {WebUI} demonstrates how to implement a custom scheme in a secure way.
-
- Aside from the built-in URL schemes, such as \c {http} and \c {qrc},
- \QWE may be extended with \e {custom schemes} by creating \e {custom
- scheme handlers}. This example shows:
-
- \list
- \li How to create a custom scheme handler which serves HTML and handles
- HTML form submissions.
- \li How to prevent ordinary web content from accessing the custom scheme.
- \li How to prevent any other scheme from submitting HTML form data.
- \endlist
-
- \include examples-run.qdocinc
-
- \section1 Overview
-
- The example program consists of a single \l {QWebEngineView} showing a
- simple HTML page loaded from the URL \c {webui:about}, over our custom
- scheme. Pressing the button at the bottom of the page will trigger an HTML
- form submission via POST to the same URL, at which point our custom scheme
- handler will cause the application to exit.
-
- The program is divided into two parts, the \c {main} function for setting
- everything up, and the \c {WebUiHandler} class for implementing our custom
- scheme handler. The \c {main} function is quite short:
-
- \quotefromfile webenginewidgets/webui/main.cpp
- \skipto int main
- \printuntil /^\}/
-
- Aside from the relatively standard setup of widgets, two points are
- noteworthy. First, we call the static method \c
- {WebUiHandler::registerUrlScheme()} to register our custom scheme with the
- web engine. Second, we create and install our custom scheme handler \c
- {WebUiHandler} using \l
- {QWebEngineProfile::installUrlSchemeHandler()}{installUrlSchemeHandler()}.
- The following sections describe these aspects in more detail.
-
- \section1 Registering the Scheme
-
- As custom schemes are integrated directly into the web engine, they do not
- necessarily need to follow the standard security rules which apply to
- ordinary web content. Depending on the chosen configuration, content served
- over a custom scheme may be given access to local resources, be set to
- ignore Content-Security-Policy rules, or conversely, be denied access to any
- other content entirely.
-
- In order to take advantage of these possibilities, the custom scheme must
- first be registered. This means creating and configuring a \l
- {QWebEngineUrlScheme} object and then handing it over to \l
- {QWebEngineUrlScheme::registerScheme()}. The example program does exactly this in
- the static method \c {WebUiHandler::registerUrlScheme()}:
-
- \quotefromfile webenginewidgets/webui/webuihandler.cpp
- \skipto void WebUiHandler::registerUrlScheme
- \printuntil /^\}/
-
- A custom scheme needs a name, which can be set by passing it to
- the constructor of \c {QWebEngineUrlScheme} or by calling \l
- {QWebEngineUrlScheme::setName}. In the above, the name \c {webui} is set
- through the constructor. Additionally, we activate the flags \l
- {QWebEngineUrlScheme::SecureScheme}{SecureScheme}, \l
- {QWebEngineUrlScheme::LocalScheme}{LocalScheme} and \l
- {QWebEngineUrlScheme::LocalAccessAllowed}{LocalAccessAllowed}. Since our
- custom scheme handler will not deliver resources received from insecure
- network connections, we can safely mark it as a \c {SecureScheme}. The \c {LocalScheme}
- flag prevents content from non-local schemes (such as \c {http}) from
- interacting with our custom scheme. Without this flag it would be possible,
- for example, to embed the \c {webui:about} page in an \c <iframe> element on
- a remotely loaded HTML page, perhaps to attempt a phishing attack. We also
- need the \c {LocalAccessAllowed} flag without which we would not be able to
- access the \c {webui} scheme from our \c {webui:about} page.
-
- Earlier we saw that the call to \c {WebUiHandler::registerUrlScheme()} is
- made already at the top of the \c {main} function. This is so because custom
- schemes need to be registered as early as possible so that that they can be
- passed to all subprocesses. Specifically, custom schemes need to be registered
- before any other \QWE classes are instantiated by the application.
-
- \section1 Handling Requests
-
- A custom scheme handler is, broadly speaking, similar to a web application
- served over HTTP. However, because custom schemes are integrated directly
- into the web engine, they have the advantage in terms of efficiency: there's
- no need for generating and parsing HTTP messages or for transferring data
- over sockets.
-
- Implementing a handler means creating a subclass of \l
- {QWebEngineUrlSchemeHandler}, which is just what is done by the \c
- {WebUiHandler} class of the example program:
-
- \quotefromfile webenginewidgets/webui/webuihandler.h
- \skipto class WebUiHandler
- \printuntil /^\}/
-
- For each request to a \c {webui} URL, the \c
- {WebUiHandler::requestStarted()} method will be called:
-
- \quotefromfile webenginewidgets/webui/webuihandler.cpp
- \skipto void WebUiHandler::requestStarted
- \printuntil /^\}/
-
- The \l {QWebEngineUrlRequestJob} object \c {job} contains the request's
- attributes and provides methods for replying to the request with a response.
- Responses are generated asynchronously by reading them from the \l
- {QIODevice} that the application passes to \l
- {QWebEngineUrlRequestJob::reply()}{reply()}.
-
- \warning The \c requestStarted() method is not called from the main thread,
- but from the web engine's IO thread. Care must be taken to synchronize
- access to any resources on the main thread.
-
- Aside from the usual fare of \l
- {QWebEngineUrlRequestJob::requestMethod()}{requestMethod} and \l
- {QWebEngineUrlRequestJob::requestUrl()}{requestUrl}, there is also the \l
- {QWebEngineUrlRequestJob::initiator()}{initiator}, holding the origin of the
- content which initiated the request. An empty \c initiator means the request
- was initiated directly by the application (via \l
- {QWebEnginePage::setUrl()}, for example). The special value \c "null"
- corresponds to an opaque origin (a sandboxed \c {<iframe>} element, for
- example). Otherwise, the \c initiator will contain the URL scheme, hostname,
- and port of the content which initiated the request.
-
- In this example, the \c initiator is used to ensure that \c {POST} requests
- to \c {webui:about} will only trigger the application's exit if they
- originate from the \c {webui} scheme. This prevents content loaded over
- other schemes from triggering the application's exit.
-
-*/
diff --git a/examples/webenginewidgets/webui/main.cpp b/examples/webenginewidgets/webui/main.cpp
deleted file mode 100644
index 0f6a3e87e..000000000
--- a/examples/webenginewidgets/webui/main.cpp
+++ /dev/null
@@ -1,82 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "webuihandler.h"
-
-#include <QApplication>
-#include <QWebEnginePage>
-#include <QWebEngineProfile>
-#include <QWebEngineView>
-
-int main(int argc, char *argv[])
-{
- QCoreApplication::setOrganizationName("QtExamples");
- QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
-
- WebUiHandler::registerUrlScheme();
-
- QApplication app(argc, argv);
-
- QWebEngineProfile profile;
-
- WebUiHandler handler;
- profile.installUrlSchemeHandler(WebUiHandler::schemeName, &handler);
-
- QWebEnginePage page(&profile);
- page.load(WebUiHandler::aboutUrl);
-
- QWebEngineView view;
- view.setPage(&page);
- view.setContextMenuPolicy(Qt::NoContextMenu);
- view.resize(500, 600);
- view.show();
-
- return app.exec();
-}
diff --git a/examples/webenginewidgets/webui/webui.pro b/examples/webenginewidgets/webui/webui.pro
deleted file mode 100644
index 714833587..000000000
--- a/examples/webenginewidgets/webui/webui.pro
+++ /dev/null
@@ -1,16 +0,0 @@
-TEMPLATE = app
-
-QT += webenginewidgets
-
-HEADERS += \
- webuihandler.h
-
-SOURCES += \
- main.cpp \
- webuihandler.cpp
-
-RESOURCES += \
- webui.qrc
-
-target.path = $$[QT_INSTALL_EXAMPLES]/webenginewidgets/webui
-INSTALLS += target
diff --git a/examples/webenginewidgets/webui/webui.qrc b/examples/webenginewidgets/webui/webui.qrc
deleted file mode 100644
index 6ddf01fa2..000000000
--- a/examples/webenginewidgets/webui/webui.qrc
+++ /dev/null
@@ -1,5 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>about.html</file>
- </qresource>
-</RCC>
diff --git a/examples/webenginewidgets/webui/webuihandler.cpp b/examples/webenginewidgets/webui/webuihandler.cpp
deleted file mode 100644
index 63c249368..000000000
--- a/examples/webenginewidgets/webui/webuihandler.cpp
+++ /dev/null
@@ -1,98 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "webuihandler.h"
-
-#include <QApplication>
-#include <QFile>
-#include <QWebEngineUrlRequestJob>
-#include <QWebEngineUrlScheme>
-
-#define SCHEMENAME "webui"
-
-const QByteArray WebUiHandler::schemeName = QByteArrayLiteral(SCHEMENAME);
-const QUrl WebUiHandler::aboutUrl = QUrl(QStringLiteral(SCHEMENAME ":about"));
-
-WebUiHandler::WebUiHandler(QObject *parent)
- : QWebEngineUrlSchemeHandler(parent)
-{
-}
-
-void WebUiHandler::requestStarted(QWebEngineUrlRequestJob *job)
-{
- static const QUrl webUiOrigin(QStringLiteral(SCHEMENAME ":"));
- static const QByteArray GET(QByteArrayLiteral("GET"));
- static const QByteArray POST(QByteArrayLiteral("POST"));
-
- QByteArray method = job->requestMethod();
- QUrl url = job->requestUrl();
- QUrl initiator = job->initiator();
-
- if (method == GET && url == aboutUrl) {
- QFile *file = new QFile(QStringLiteral(":/about.html"), job);
- file->open(QIODevice::ReadOnly);
- job->reply(QByteArrayLiteral("text/html"), file);
- } else if (method == POST && url == aboutUrl && initiator == webUiOrigin) {
- job->fail(QWebEngineUrlRequestJob::RequestAborted);
- QApplication::exit();
- } else {
- job->fail(QWebEngineUrlRequestJob::UrlNotFound);
- }
-}
-
-// static
-void WebUiHandler::registerUrlScheme()
-{
- QWebEngineUrlScheme webUiScheme(schemeName);
- webUiScheme.setFlags(QWebEngineUrlScheme::SecureScheme |
- QWebEngineUrlScheme::LocalScheme |
- QWebEngineUrlScheme::LocalAccessAllowed);
- QWebEngineUrlScheme::registerScheme(webUiScheme);
-}
diff --git a/examples/webenginewidgets/webui/webuihandler.h b/examples/webenginewidgets/webui/webuihandler.h
deleted file mode 100644
index f2ac0dcef..000000000
--- a/examples/webenginewidgets/webui/webuihandler.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef WEBUIHANDLER_H
-#define WEBUIHANDLER_H
-
-#include <QWebEngineUrlSchemeHandler>
-
-class WebUiHandler : public QWebEngineUrlSchemeHandler
-{
- Q_OBJECT
-public:
- explicit WebUiHandler(QObject *parent = nullptr);
-
- void requestStarted(QWebEngineUrlRequestJob *job) override;
-
- static void registerUrlScheme();
-
- const static QByteArray schemeName;
- const static QUrl aboutUrl;
-};
-
-#endif // !WEBUIHANDLER_H
diff --git a/mkspecs/features/default_pre.prf b/mkspecs/features/default_pre.prf
deleted file mode 100644
index c7440fa7a..000000000
--- a/mkspecs/features/default_pre.prf
+++ /dev/null
@@ -1,20 +0,0 @@
-QTWEBENGINEPROCESS_NAME_RELEASE = QtWebEngineProcess
-debug_and_release {
- QTWEBENGINEPROCESS_NAME_DEBUG = $$join(QTWEBENGINEPROCESS_NAME_RELEASE,,,d)
-} else {
- QTWEBENGINEPROCESS_NAME_DEBUG = $$QTWEBENGINEPROCESS_NAME_RELEASE
-}
-build_pass:CONFIG(debug, debug|release) {
- QTWEBENGINEPROCESS_NAME = $$QTWEBENGINEPROCESS_NAME_DEBUG
-} else {
- QTWEBENGINEPROCESS_NAME = $$QTWEBENGINEPROCESS_NAME_RELEASE
-}
-
-# Location of sync.profile
-MODULE_BASE_DIR = $$QTWEBENGINE_ROOT
-
-EOL = $$escape_expand(\\n)
-
-# Call the original default_pre.
-load(default_pre)
-load(functions)
diff --git a/mkspecs/features/functions.prf b/mkspecs/features/functions.prf
deleted file mode 100644
index d3ceb4c5e..000000000
--- a/mkspecs/features/functions.prf
+++ /dev/null
@@ -1,134 +0,0 @@
-include($$QTWEBENGINE_ROOT/src/buildtools/config/support.pri)
-
-defineReplace(getConfigDir) {
- CONFIG(release, debug|release):return("release")
- return("debug")
-}
-
-defineReplace(getChromiumSrcDir) {
- exists($$QTWEBENGINE_ROOT/.git): git_chromium_src_dir = $$system("git config qtwebengine.chromiumsrcdir")
- # Fall back to the snapshot path if git does not know about chromium sources (i.e. init-repository.py has not been used)
- isEmpty(git_chromium_src_dir): git_chromium_src_dir = "src/3rdparty/chromium"
- return($$git_chromium_src_dir)
-}
-
-defineReplace(which) {
- out = $$1
- win32 {
- command = $$split(out, " ")
- executable = $$first(command)
- # Return the first match only
- out = $$system("((for /f \"usebackq delims=\" %i in (`where $$executable 2^> NUL`) do @if not defined _endwhich (@echo %i & set _endwhich=true)) & set _endwhich=)")
- isEmpty(out) {
- message($$executable not found)
- out = $$executable
- }
- for(arg, command): !equals(arg, $$executable): out += $$arg
- } else:unix {
- command = $$split(out, " ")
- executable = $$first(command)
- out = $$system("which $$executable 2>/dev/null")
- isEmpty(out) {
- message($$executable not found)
- out = $$executable
- }
- for(arg, command): !equals(arg, $$executable): out += $$arg
- }
- return($$out)
-}
-
-# Returns the unquoted path to the python executable.
-defineReplace(pythonPath) {
- isEmpty(QMAKE_PYTHON2) {
- # Fallback for building QtWebEngine with Qt < 5.8
- QMAKE_PYTHON2 = python
- }
- return($$QMAKE_PYTHON2)
-}
-
-# Returns the python executable for use with shell / make targets.
-defineReplace(pythonPathForShell) {
- return($$shell_quote($$shell_path($$pythonPath())))
-}
-
-# Returns the python executable for use with $$system()
-defineReplace(pythonPathForSystem) {
- return($$system_quote($$system_path($$pythonPath())))
-}
-
-defineReplace(ninjaPath) {
- src_3rd_party_dir = $$absolute_path("$${getChromiumSrcDir()}/../", "$$QTWEBENGINE_ROOT")
- out = $$shadowed($$absolute_path(ninja/ninja, $$src_3rd_party_dir))
- win32: out = $${out}.exe
- return($$out)
-}
-
-defineReplace(gnPath) {
- src_3rd_party_dir = $$absolute_path("$${getChromiumSrcDir()}/../", "$$QTWEBENGINE_ROOT")
- out = $$shadowed($$absolute_path(gn/out/Release/gn, $$src_3rd_party_dir))
-
- win32: out = $${out}.exe
- return($$out)
-}
-
-defineReplace(gnWebEngineArgs) {
- linux {
- include($$QTWEBENGINE_ROOT/src/buildtools/config/linux.pri)
- include($$QTWEBENGINE_ROOT/src/core/config/linux.pri)
- }
- macos {
- include($$QTWEBENGINE_ROOT/src/buildtools/config/mac_osx.pri)
- include($$QTWEBENGINE_ROOT/src/core/config/mac_osx.pri)
- }
- win32 {
- include($$QTWEBENGINE_ROOT/src/buildtools/config/windows.pri)
- include($$QTWEBENGINE_ROOT/src/core/config/windows.pri)
- }
- isEmpty(gn_args): error(No gn_args found please make sure you have valid configuration.)
- return($$gn_args)
-}
-
-defineReplace(gnPdfArgs) {
- linux: include($$QTWEBENGINE_ROOT/src/buildtools/config/linux.pri)
- macos: include($$QTWEBENGINE_ROOT/src/buildtools/config/mac_osx.pri)
- ios: include($$QTWEBENGINE_ROOT/src/pdf/config/ios.pri)
- win32: include($$QTWEBENGINE_ROOT/src/buildtools/config/windows.pri)
- include($$QTWEBENGINE_ROOT/src/pdf/config/common.pri)
- isEmpty(gn_args): error(No gn_args found please make sure you have valid configuration.)
- return($$gn_args)
-}
-
-defineReplace(gnArch) {
- qtArch = $$1
- contains(qtArch, "i386"): return(x86)
- contains(qtArch, "x86_64"): return(x64)
- contains(qtArch, "arm"): return(arm)
- contains(qtArch, "arm64"): return(arm64)
- contains(qtArch, "mips"): return(mipsel)
- contains(qtArch, "mips64"): return(mips64el)
- return(unknown)
-}
-
-defineReplace(gnOS) {
- macos: return(mac)
- win32: return(win)
- linux: return(linux)
- error(Unsupported platform)
- return(unknown)
-}
-
-defineReplace(pkgConfigHostExecutable) {
- wrapper_name = $$OUT_PWD/pkg-config-host_wrapper.sh
- wrapper_cmd = $$QMAKE_PKG_CONFIG_HOST
- isEmpty(wrapper_cmd): wrapper_cmd = pkg-config
- wrapper_content = \
- "$$LITERAL_HASH!/bin/sh" \
- "unset PKG_CONFIG_LIBDIR" \
- "unset PKG_CONFIG_SYSROOT_DIR" \
- "exec $$wrapper_cmd \"$@\""
- !build_pass:!write_file($$wrapper_name, wrapper_content, exe): error()
- QMAKE_DISTCLEAN += $$wrapper_name
- export(QMAKE_DISTCLEAN)
- return($$system_quote($$system_path($$wrapper_name)))
-}
-
diff --git a/mkspecs/features/gn_generator.prf b/mkspecs/features/gn_generator.prf
deleted file mode 100644
index a83b59847..000000000
--- a/mkspecs/features/gn_generator.prf
+++ /dev/null
@@ -1,271 +0,0 @@
-load(moc)
-load(resources)
-
-defineReplace(getTargetType) {
- equals(TEMPLATE, "app"):return("executable")
- equals(TEMPLATE, "lib") {
- CONFIG(static): return("static_library")
- return("shared_library")
- }
- return("none")
-}
-
-defineReplace(filter_flag_values) {
- value_to_check = $$1
- if (macos|ios):equals(value_to_check, "$(EXPORT_ARCH_ARGS)") {
- # EXPORT_ARCH_ARGS comes from qtbase/mkspecs/features/mac/default_post.prf which is a way
- # to figure out the architectures to pass to the compiler at Makefile time. Because this
- # variable expansion is not supported by GN, we filter it out. GN takes care of assigning
- # the architecture itself.
- return("")
- }
- if (ios) {
- equals(value_to_check, "$(EXPORT_QMAKE_XARCH_LFLAGS)"): return("")
- equals(value_to_check, "$(EXPORT_QMAKE_XARCH_CFLAGS)"): return("")
- }
-
- return($$value_to_check)
-}
-
-isEmpty(GN_FILE): GN_FILE = $$system_path($$_PRO_FILE_PWD_/BUILD.gn)
-isEmpty(GN_RUN_BINARY_SCRIPT): GN_RUN_BINARY_SCRIPT = "//build/gn_run_binary.py"
-isEmpty(GN_FIND_MOCABLES_SCRIPT): GN_FIND_MOCABLES_SCRIPT = "//build/gn_find_mocables.py"
-
-# MOC SETUP
-
-GN_CONTENTS += "moc_source_h_files = exec_script(\"$$GN_FIND_MOCABLES_SCRIPT\","
-GN_CONTENTS += " ["
-for (headerfile, HEADERS): GN_CONTENTS += " \"$$GN_SRC_DIR/$$headerfile\","
-GN_CONTENTS += " ], \"list lines\", [\"$$system_path($$_PRO_FILE_)\"]"\
- ")"
-GN_CONTENTS += "moc_source_cpp_files = exec_script(\"$$GN_FIND_MOCABLES_SCRIPT\","
-GN_CONTENTS += " ["
-for (sourcefile, SOURCES): GN_CONTENTS += " \"$$GN_SRC_DIR/$$sourcefile\","
-GN_CONTENTS += " ], \"list lines\", [\"$$system_path($$_PRO_FILE_)\"]"\
- ")"
-
-DEFINES_LIST = $$join(DEFINES, " -D", "-D")
-INCLUDE_LIST = $$join(INCLUDEPATH, " -I", "-I")
-
-# we don't generate a moc_predef file yet.
-MOC_PREDEF_FILE =
-MOC_COMMAND = $$clean_path($$mocCmdBase())
-MOC_COMMAND = $$replace(MOC_COMMAND, $$re_escape("$(DEFINES)"), $$DEFINES_LIST)
-MOC_COMMAND = $$replace(MOC_COMMAND, $$re_escape("$(INCPATH)"), $$INCLUDE_LIST)
-MOC_COMMAND = $$eval($$list($$MOC_COMMAND))
-
-GN_CONTENTS += "if (moc_source_h_files != []) {"
-GN_CONTENTS += " action_foreach(\"generate_h_mocs\") {"\
- " script = \"$$GN_RUN_BINARY_SCRIPT\""
-GN_CONTENTS += " sources = moc_source_h_files" \
- " outputs = [ \"$target_gen_dir/.moc/moc_{{source_name_part}}.cpp\" ]"
-GN_CONTENTS += " inputs = [ \"$$system_path($$_PRO_FILE_)\" ]" \
- " args = ["
-for(token, MOC_COMMAND): GN_CONTENTS += " \"$$replace(token,\",\\\")\","
-GN_CONTENTS += " \"{{source}}\"," \
- " \"-o\"," \
- " rebase_path(\"$target_gen_dir/.moc/moc_{{source_name_part}}.cpp\")"\
- " ]"
-GN_CONTENTS += " }"
-GN_CONTENTS += "}"
-GN_CONTENTS += "if (moc_source_cpp_files != []) {"
-GN_CONTENTS += " action_foreach(\"generate_cpp_mocs\") {"\
- " script = \"$$GN_RUN_BINARY_SCRIPT\""
-GN_CONTENTS += " sources = moc_source_cpp_files" \
- " outputs = [ \"$target_gen_dir/.moc/{{source_name_part}}.moc\" ]"
-GN_CONTENTS += " inputs = [ \"$$system_path($$_PRO_FILE_)\" ]" \
- " args = ["
-for(token, MOC_COMMAND): GN_CONTENTS += " \"$$replace(token,\",\\\")\","
-GN_CONTENTS += " \"{{source}}\"," \
- " \"-o\"," \
- " rebase_path(\"$target_gen_dir/.moc/{{source_name_part}}.moc\")"\
- " ]"
-GN_CONTENTS += " }"
-GN_CONTENTS += "}"
-
-# RESOURCES SETUP
-
-CLEAN_QMAKE_RCC = $$clean_path($$QMAKE_RCC)
-
-!isEmpty(RESOURCES) {
- GN_CONTENTS += "action_foreach(\"generate_resources\") {"\
- " script = \"$$GN_RUN_BINARY_SCRIPT\""
- GN_CONTENTS += " sources = ["
- for (sourcefile, RESOURCES): GN_CONTENTS += " \"$$GN_SRC_DIR/$$sourcefile\","
- GN_CONTENTS += " ]" \
- " outputs = [ \"$target_gen_dir/.rcc/qrc_{{source_name_part}}.cpp\" ]"
- GN_CONTENTS += " inputs = [ \"$$system_path($$_PRO_FILE_)\" ]" \
- " args = [" \
- " \"$$replace(CLEAN_QMAKE_RCC,\",\\\")\","
- for(resource_flag, $$QMAKE_RESOURCE_FLAGS): GN_CONTENTS += " \"$$resource_flag\""
- GN_CONTENTS += " \"-name\"," \
- " \"{{source_name_part}}\"," \
- " \"{{source}}\"," \
- " \"-o\"," \
- " rebase_path(\"$target_gen_dir/.rcc/qrc_{{source_name_part}}.cpp\")"\
- " ]"
- GN_CONTENTS += "}"
-}
-
-# CONFIG SETUP
-
-GN_CONTENTS += "config(\"$${TARGET}_config\") {"
-!isEmpty(QMAKE_CFLAGS) {
- GN_CONTENTS += " cflags = ["
- for(flag, QMAKE_CFLAGS): GN_CONTENTS += " \"$$filter_flag_values($$flag)\","
- GN_CONTENTS += " ]"
-}
-
-!isEmpty(QMAKE_FRAMEWORKPATH) {
- GN_CONTENTS += " cflags += ["
- for(path, QMAKE_FRAMEWORKPATH): GN_CONTENTS += " \"-F$$path\","
- GN_CONTENTS += " ]"
-}
-
-# Stop the barrage of unused variables warnings.
-gcc|clang|clang_cl {
- QMAKE_CXXFLAGS += "-Wno-unused-parameter"
- QMAKE_CXXFLAGS += "-Wno-unused-variable"
-} else:msvc {
- QMAKE_CXXFLAGS += /wd4100 /wd4101
-}
-
-# Chromium activates this, but we need it off to be able to compile QFlags
-clang_cl {
- QMAKE_CXXFLAGS += "-fno-complete-member-pointers"
-}
-
-!isEmpty(QMAKE_CXXFLAGS) {
- GN_CONTENTS += " cflags_cc = ["
- for(flag, QMAKE_CXXFLAGS): GN_CONTENTS += " \"$$filter_flag_values($$flag)\","
- GN_CONTENTS += " ]"
-}
-
-GN_CONTENTS += " defines = ["
-# Remove single quotes around function macro defines, so that GN doesn't escape them, thus breaking
-# the macro.
-# Also add a layer of escaping for double quotes.
-for (define, DEFINES): {
- define = $$replace(define,\",\\\")
- define = $$replace(define,\',)
- GN_CONTENTS += " \"$$define\","
-}
-GN_CONTENTS += " ]"
-
-GN_CONTENTS += " include_dirs = ["
-for (path, INCLUDEPATH): GN_CONTENTS += " \"$$path\","
-GN_CONTENTS += " rebase_path(\"$target_gen_dir/.moc/\"),"
-GN_CONTENTS += " \"$$QMAKESPEC\""
-GN_CONTENTS += " ]"
-
-GN_CONTENTS += " ldflags = ["
-for (flag, QMAKE_LFLAGS): GN_CONTENTS += " \"$$filter_flag_values($$flag)\","
-for (flag, GN_FLAGS): GN_CONTENTS += " \"$$flag\","
-!isEmpty(QMAKE_RPATHDIR) {
- for (rpath, QMAKE_RPATHDIR) {
- unix:!macos: GN_CONTENTS += " \"-Wl,-rpath=$${rpath}\","
- }
-}
-!isEmpty(QMAKE_RPATHLINKDIR): GN_CONTENTS += " \"-Wl,-rpath-link=$${QMAKE_RPATHLINKDIR}\","
-GN_CONTENTS += " ]"
-
-GN_CONTENTS += " lib_dirs = ["
-lib_dirs = $$find(LIBS, ^-L.*)
-lib_dirs = $$unique(lib_dirs)
-for (lib_dir, lib_dirs): GN_CONTENTS += " \"$$replace(lib_dir, -L, )\","
-GN_CONTENTS += " ]"
-
-GN_CONTENTS += "}"
-
-# TARGET SETUP
-
-TARGET_TYPE = $$getTargetType()
-
-GN_CONTENTS += "$${TARGET_TYPE}(\"$$TARGET\") {"
-!isEmpty(GN_CREATE_PRI): GN_CONTENTS += " create_pri_file = $$GN_CREATE_PRI"
-!isEmpty(GN_IMPORTS) {
- for (imp, GN_IMPORTS): GN_CONTENTS += " import(\"$$imp\")"
-}
-
-GN_CONTENTS += " configs += [ \":$${TARGET}_config\" ]"
-!isEmpty(GN_PRECOMPILED_HEADERS): GN_CONTENTS += " configs += [ \"//build/config:precompiled_headers\" ]"
-
-# Source files to compile
-GN_CONTENTS += " sources = ["
-for (sourcefile, SOURCES): GN_CONTENTS += " \"$$GN_SRC_DIR/$$sourcefile\","
-for (headerfile, HEADERS): GN_CONTENTS += " \"$$GN_SRC_DIR/$$headerfile\","
-GN_CONTENTS += " ]"
-
-# Add Sources generated by rcc from qrc files.
-!isEmpty(RESOURCES): GN_CONTENTS += " sources += get_target_outputs(\":generate_resources\")"
-
-GN_CONTENTS += " if (!defined(libs)) {"\
- " libs = []"\
- " }"
-GN_CONTENTS += " libs += ["
-for (lib, GN_LIBS): GN_CONTENTS += " \"$$lib\","
-libs = $$find(LIBS, ^-l.*)
-libs = $$unique(libs)
-for (lib, libs): GN_CONTENTS += " \"$$replace(lib, -l, )\","
-GN_CONTENTS += " ]"
-
-GN_CONTENTS += " if (!defined(deps)) {"\
- " deps = []"\
- " }"
-
-!isEmpty(RESOURCES) {
- GN_CONTENTS += " deps += ["
- GN_CONTENTS += " \":generate_resources\","
- GN_CONTENTS += " ]"
-}
-
-# Remove the default no_rtti config for our own cpp files, thus leaving the decision
-# to the compiler's defaults. This is consistent with how qtbase does it.
-# Unless the user explicitly configured Qt with a different RTTI setting.
-# Windows only for now, because macOS (and presumably Linux) does not support
-# partial rtti info (e.g. rtti info present for derived class, but not base class), and the
-# qtbase rtti feature affects only Windows.
-win32 {
- GN_CONTENTS += " configs -= [\"//build/config/compiler:no_rtti\"]"
- CONFIG(rtti_off): GN_CONTENTS += " configs += [\"//build/config/compiler:no_rtti\"]"
- CONFIG(rtti): GN_CONTENTS += " configs += [\"//build/config/compiler:rtti\"]"
-}
-gcc:!qtConfig(reduce_exports) {
- GN_CONTENTS += " configs -= [\"//build/config/gcc:symbol_visibility_hidden\"]"
-}
-
-GN_CONTENTS += " if (moc_source_h_files != []) {"
-GN_CONTENTS += " deps += ["
-GN_CONTENTS += " \":generate_h_mocs\","
-GN_CONTENTS += " ]"
-# Add moc output files to compile
-GN_CONTENTS += " sources += get_target_outputs(\":generate_h_mocs\")"
-GN_CONTENTS += " }"
-GN_CONTENTS += " if (moc_source_cpp_files != []) {"
-GN_CONTENTS += " deps += ["
-GN_CONTENTS += " \":generate_cpp_mocs\","
-GN_CONTENTS += " ]"
-GN_CONTENTS += " }"
-GN_CONTENTS += "}"
-!isEmpty(GN_CORE_INCLUDE_DIRS) {
- GN_CONTENTS += " if (!defined(core_include_dirs)) {"\
- " core_include_dirs = []"\
- " }"
- GN_CONTENTS += "core_include_dirs += ["
- for (inc, GN_CORE_INCLUDE_DIRS): GN_CONTENTS += " \"$$inc\","
- GN_CONTENTS += "]"
-}
-
-!isEmpty(GN_INCLUDES) {
- for (inc, GN_INCLUDES): GN_CONTENTS += $$cat($$inc,lines)
-}
-
-build_pass|!debug_and_release: write_file($$GN_FILE, GN_CONTENTS)
-
-# The generated Makefile shouldn't build anything by itself, just re-run qmake if necessary
-TEMPLATE = aux
-SOURCES =
-HEADERS =
-RESOURCES =
-
-QMAKE_DISTCLEAN += $$GN_FILE
diff --git a/qt_cmdline.cmake b/qt_cmdline.cmake
new file mode 100644
index 000000000..f89692711
--- /dev/null
+++ b/qt_cmdline.cmake
@@ -0,0 +1,7 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_commandline_option(build-qtpdf TYPE boolean NAME qtpdf-build)
+qt_commandline_option(webengine-developer-build TYPE boolean)
+
+qt_commandline_subconfig(src/core/api)
diff --git a/qtwebengine.pro b/qtwebengine.pro
deleted file mode 100644
index 4db530030..000000000
--- a/qtwebengine.pro
+++ /dev/null
@@ -1,15 +0,0 @@
-requires(qtHaveModule(gui))
-load(qt_parts)
-load(functions)
-
-QMAKE_DISTCLEAN += .qmake.cache
-
-OTHER_FILES = \
- tools/buildscripts/* \
- tools/scripts/* \
- config.tests/khr/* \
- config.tests/libcap/* \
- config.tests/libvpx/* \
- config.tests/snappy/* \
- config.tests/re2/* \
- mkspecs/features/*
diff --git a/src/3rdparty b/src/3rdparty
-Subproject 15a42873b9a4bda657e7a435f25241a05b8bd1c
+Subproject ac780f41ba9b3eb8329ca8e09b8857a070aed8c
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 000000000..0084697f2
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,223 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+##
+# MAIN CONFIGURE
+##
+
+qt_internal_get_filename_path_mode(path_mode)
+
+get_filename_component(WEBENGINE_ROOT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/.." ${path_mode})
+get_filename_component(WEBENGINE_ROOT_BUILD_DIR "${PROJECT_BINARY_DIR}" ${path_mode})
+
+# Note this is configure that does not belong to any module
+qt_feature_module_begin(ONLY_EVALUATE_FEATURES)
+# Enable printing of feature summary by forcing qt_configure_record_command
+# to work in spite of ONLY_EVALUATE_FEATURES.
+set(__QtFeature_only_evaluate_features OFF)
+include(../configure.cmake)
+qt_feature_module_end(ONLY_EVALUATE_FEATURES)
+
+##
+# SUPPORT CHECK
+##
+
+# TODO: here we should return FATAL_ERROR and ask user to define
+# FEATURE_qtwebenignebuild=OFF if one wants to only build qtpdf,
+# however our ci setup is not flexible enough and configure step must succeed
+
+if(NOT ${QtWebEngine_SUPPORT})
+ add_custom_target(WebEngineErrorMessage ALL
+ ${CMAKE_COMMAND} -E cmake_echo_color --red "QtWebEngine will not be built: ${QtWebEngine_ERROR}"
+ COMMENT "Check QtWebEngine support"
+ VERBATIM
+ )
+ message("-- Support check for QtWebEngine failed: ${QtWebEngine_ERROR}")
+ set(QT_FEATURE_qtwebengine_build OFF CACHE BOOL "Build QtWebEngine Modules" FORCE)
+ set(QT_FEATURE_qtwebengine_core_build OFF CACHE BOOL "Build QtWebEngineCore" FORCE)
+ set(QT_FEATURE_qtwebengine_widgets_build OFF CACHE BOOL "Build QtWebEngineWidgets" FORCE)
+ set(QT_FEATURE_qtwebengine_quick_build OFF CACHE BOOL "Build QtWebEngineQuick" FORCE)
+
+endif()
+
+if(NOT ${QtPdf_SUPPORT})
+ add_custom_target(PdfErrorMessage ALL
+ ${CMAKE_COMMAND} -E cmake_echo_color --red "QtPdf will not be built: ${QtPdf_ERROR}"
+ COMMENT "Check QtPdf support"
+ VERBATIM
+ )
+ message("-- Support check for QtPdf failed: ${QtPdf_ERROR}")
+ set(QT_FEATURE_qtpdf_build OFF CACHE BOOL "Build QtPdf" FORCE)
+ set(QT_FEATURE_qtpdf_widgets_build OFF CACHE BOOL "Build QtPdfWidgets" FORCE)
+ set(QT_FEATURE_qtpdf_quick_build OFF CACHE BOOL "Build QtPdfQuick" FORCE)
+endif()
+
+if(NOT QT_FEATURE_qtwebengine_build AND NOT QT_FEATURE_qtpdf_build)
+ return()
+endif()
+
+# Upgrade CMake policies to the minimum supported version.
+cmake_minimum_required(VERSION ${QT_SUPPORTED_MIN_CMAKE_VERSION_FOR_BUILDING_WEBENGINE})
+
+##
+# MODULES
+##
+
+if(QT_FEATURE_qtwebengine_core_build)
+ add_subdirectory(core)
+ add_subdirectory(process)
+endif()
+if(QT_FEATURE_qtwebengine_widgets_build)
+ add_subdirectory(webenginewidgets)
+endif()
+if(QT_FEATURE_qtwebengine_quick_build)
+ add_subdirectory(webenginequick)
+endif()
+
+if(QT_FEATURE_qtpdf_build)
+ add_subdirectory(pdf)
+ # keep log order, pdf build after webengine
+ if(QT_FEATURE_qtwebengine_core_build)
+ add_dependencies(run_pdf_NinjaReady WebEngineCore)
+ endif()
+ if(QT_FEATURE_qtwebengine_widgets_build)
+ add_dependencies(run_pdf_NinjaReady WebEngineWidgets)
+ endif()
+ if(QT_FEATURE_qtwebengine_quick_build)
+ add_dependencies(run_pdf_NinjaReady WebEngineQuick)
+ endif()
+ if(QT_FEATURE_qtpdf_widgets_build)
+ add_subdirectory(pdfwidgets)
+ endif()
+ if(QT_FEATURE_qtpdf_quick_build)
+ add_subdirectory(pdfquick)
+ endif()
+endif()
+
+##
+# NINJA PROJECT
+##
+
+set(installDir ${PROJECT_BINARY_DIR}/install)
+
+if(NOT Ninja_FOUND)
+ externalproject_add(ninja
+ SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/ninja
+ BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/ninja
+ INSTALL_DIR ${installDir}
+ PREFIX ninja
+ USES_TERMINAL_BUILD TRUE
+ EXCLUDE_FROM_ALL TRUE
+ CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release
+ -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+ -DCMAKE_PREFIX_PATH:PATH=<INSTALL_DIR>
+ )
+ if(QT_FEATURE_qtwebengine_core_build)
+ add_dependencies(run_core_NinjaReady ninja)
+ endif()
+ if(QT_FEATURE_qtpdf_build)
+ add_dependencies(run_pdf_NinjaReady ninja)
+ endif()
+endif()
+
+##
+# GN PROJECT
+##
+
+if(CMAKE_CROSSCOMPILING AND NOT Gn_FOUND)
+ message(FATAL_ERROR "No gn found for cross-compilation")
+endif()
+
+if(NOT Gn_FOUND)
+ externalproject_add(gn
+ SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/gn
+ BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gn
+ INSTALL_DIR ${installDir}
+ PREFIX gn
+ USES_TERMINAL_BUILD TRUE
+ EXCLUDE_FROM_ALL TRUE
+ CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release
+ -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
+ -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
+ -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+ -DCMAKE_PREFIX_PATH:PATH=<INSTALL_DIR>
+ -DWEBENGINE_ROOT_BUILD_DIR=${PROJECT_BINARY_DIR}
+ -DQT_ALLOW_SYMLINK_IN_PATHS=${QT_ALLOW_SYMLINK_IN_PATHS}
+ )
+ if(QT_FEATURE_qtwebengine_core_build)
+ add_dependencies(run_core_GnReady gn)
+ endif()
+ if(QT_FEATURE_qtpdf_build)
+ add_dependencies(run_pdf_GnReady gn)
+ endif()
+endif()
+
+string(REGEX REPLACE "(.)" "\\\\\\1" path_to_match "${installDir}")
+if(NOT Gn_FOUND OR Gn_EXECUTABLE MATCHES "^${path_to_match}")
+ set(INSTALL_GN 1 CACHE INTERNAL "")
+endif()
+
+##
+# HOST PROJECT
+##
+
+if(CMAKE_CROSSCOMPILING AND NOT IOS AND NOT MACOS)
+
+ if(NOT Gn_FOUND)
+ message(FATAL_ERROR "\nHost gn not found - cross compilation not possible")
+ endif()
+
+ externalproject_add(hostBuild
+ SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/host
+ BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/host
+ PREFIX host
+ USES_TERMINAL_BUILD TRUE
+ EXCLUDE_FROM_ALL TRUE
+ CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${QT_HOST_PATH_CMAKE_DIR}/Qt6/qt.toolchain.cmake
+ -DQT_USE_ORIGINAL_COMPILER=ON
+ -DWEBENGINE_ROOT_BUILD_DIR=${PROJECT_BINARY_DIR}
+ -DWEBENGINE_ROOT_SOURCE_DIR=${WEBENGINE_ROOT_SOURCE_DIR}
+ -DGN_TARGET_CPU=${TEST_architecture_arch}
+ -DCMAKE_C_FLAGS=
+ -DCMAKE_CXX_FLAGS=
+ -DQT_FEATURE_qtwebengine_build=${QT_FEATURE_qtwebengine_build}
+ -DQT_FEATURE_qtpdf_build=${QT_FEATURE_qtpdf_build}
+ )
+ if(QT_FEATURE_qtwebengine_build)
+ add_dependencies(run_core_GnReady hostBuild)
+ endif()
+ if(QT_FEATURE_qtpdf_build)
+ add_dependencies(run_pdf_GnReady hostBuild)
+ endif()
+endif()
+
+# install gn for cross build
+if((LINUX OR MACOS OR WIN32) AND INSTALL_GN)
+ if(NOT QT_WILL_INSTALL)
+ set(copyOutput
+ ${QT_BUILD_DIR}/${INSTALL_LIBEXECDIR}/gn${CMAKE_EXECUTABLE_SUFFIX}
+ )
+ if(Gn_FOUND)
+ set(copyInput ${Gn_EXECUTABLE})
+ set(copyDep ${Gn_EXECUTABLE})
+ else()
+ set(copyInput ${installDir}/bin/gn${CMAKE_EXECUTABLE_SUFFIX})
+ set(copyDep gn)
+ endif()
+ add_custom_target(copy-gn ALL DEPENDS ${copyOutput})
+ add_custom_command(
+ OUTPUT ${copyOutput}
+ COMMAND ${CMAKE_COMMAND} -E copy ${copyInput} ${QT_BUILD_DIR}/${INSTALL_LIBEXECDIR}
+ DEPENDS ${copyDep}
+ USES_TERMINAL
+ )
+ else()
+ get_install_config(installConfig)
+ install(
+ PROGRAMS "${installDir}/bin/gn${CMAKE_EXECUTABLE_SUFFIX}"
+ CONFIGURATIONS ${installConfig}
+ RUNTIME DESTINATION "${INSTALL_LIBEXECDIR}"
+ )
+ endif()
+endif()
+
diff --git a/src/buildtools/buildtools.pro b/src/buildtools/buildtools.pro
deleted file mode 100644
index 1366d18d5..000000000
--- a/src/buildtools/buildtools.pro
+++ /dev/null
@@ -1,20 +0,0 @@
-TEMPLATE = subdirs
-
-linux {
- # configure_host.pro and configure_target.pro are phony pro files that
- # extract things like compiler and linker from qmake.
- # Only used on Linux as it is only important for cross-building and alternative compilers.
- configure_host.file = configure_host.pro
- configure_target.file = configure_target.pro
- configure_target.depends = configure_host
- gn.depends += configure_target
-
- SUBDIRS += configure_host configure_target
-}
-
-ninja.file = ninja.pro
-SUBDIRS += ninja
-
-gn.file = gn.pro
-gn.depends = ninja
-SUBDIRS += gn
diff --git a/src/buildtools/config/common.pri b/src/buildtools/config/common.pri
deleted file mode 100644
index 8aeeb3894..000000000
--- a/src/buildtools/config/common.pri
+++ /dev/null
@@ -1,98 +0,0 @@
-# Shared configuration for all our supported platforms
-include($$QTWEBENGINE_OUT_ROOT/src/buildtools/qtbuildtools-config.pri)
-include($$QTWEBENGINE_OUT_ROOT/src/core/qtwebenginecore-config.pri)
-QT_FOR_CONFIG += buildtools-private webenginecore webenginecore-private
-
-gn_args += \
- use_qt=true \
- closure_compile=false \
- is_component_build=false \
- is_shared=true \
- enable_debugallocation=false \
- enable_media_remoting=false \
- enable_message_center=false \
- enable_nacl=false \
- enable_remoting=false \
- enable_reporting=false \
- enable_resource_whitelist_generation=false \
- enable_swiftshader=false \
- angle_enable_swiftshader=false \
- enable_web_auth=false \
- enable_web_speech=false \
- enable_widevine=true \
- has_native_accessibility=false \
- optimize_webui=false \
- safe_browsing_mode=0 \
- strip_absolute_paths_from_debug_symbols=false \
- toolkit_views=false \
- treat_warnings_as_errors=false \
- use_allocator_shim=false \
- use_allocator=\"none\" \
- use_custom_libcxx=false \
- v8_use_external_startup_data=false \
- forbid_non_component_debug_builds=false
-
-greaterThan(QMAKE_JUMBO_MERGE_LIMIT,0) {
- gn_args += \
- use_jumbo_build=true \
- jumbo_file_merge_limit=$$QMAKE_JUMBO_MERGE_LIMIT
-}
-
-!greaterThan(QMAKE_JUMBO_MERGE_LIMIT,8) {
- gn_args += jumbo_build_excluded="[\"browser\"]"
-}
-
-precompile_header {
- gn_args += enable_precompiled_headers=true
-} else {
- gn_args += enable_precompiled_headers=false
-}
-
-CONFIG(release, debug|release):!qtConfig(webengine-developer-build) {
- gn_args += is_official_build=true
-} else {
- gn_args += is_official_build=false
- !qtConfig(webengine-developer-build): gn_args += is_unsafe_developer_build=false
-}
-
-CONFIG(release, debug|release) {
- gn_args += is_debug=false
- force_debug_info {
- # Level 1 is not enough to generate all Chromium debug symbols on Windows
- msvc: gn_args += symbol_level=2
- else: gn_args += symbol_level=1
- } else {
- gn_args += symbol_level=0
- }
-}
-
-CONFIG(debug, debug|release) {
- gn_args += is_debug=true
- gn_args += use_debug_fission=false
- # MSVC requires iterator debug to always match and Qt leaves it default on.
- msvc: gn_args += enable_iterator_debugging=true
-
- # We also can not have optimized V8 binaries for MSVC as iterator debugging
- # would mismatch.
- msvc|v8base_debug: gn_args += v8_optimized_debug=false
-}
-
-!webcore_debug: gn_args += blink_symbol_level=0
-!v8base_debug: gn_args += remove_v8base_debug_symbols=true
-
-# Compiling with -Os makes a huge difference in binary size
-optimize_size: gn_args += optimize_for_size=true
-
-# We don't want to apply sanitizer options to the build tools (GN, dict convert, etc).
-!host_build {
- sanitize_address: gn_args += is_asan=true
- sanitize_thread: gn_args += is_tsan=true
- sanitize_memory: gn_args += is_msan=true
- sanitize_undefined: gn_args += is_ubsan=true is_ubsan_vptr=true
-}
-
-ccache {
- gn_args += cc_wrapper=\"ccache\"
-}
-
-qtConfig(force_asserts): gn_args += dcheck_always_on=true
diff --git a/src/buildtools/config/functions.pri b/src/buildtools/config/functions.pri
deleted file mode 100644
index 8c11faa16..000000000
--- a/src/buildtools/config/functions.pri
+++ /dev/null
@@ -1,8 +0,0 @@
-defineReplace(qtwebengine_extractCFlag) {
- CFLAGS = $$QMAKE_CC $$QMAKE_CFLAGS
- OPTION = $$find(CFLAGS, $$1)
- OPTION = $$split(OPTION, =)
- PARAM = $$member(OPTION, 1)
- !isEmpty(PARAM): return ($$PARAM)
- return ($$OPTION)
-}
diff --git a/src/buildtools/config/linux.pri b/src/buildtools/config/linux.pri
deleted file mode 100644
index 56c18bdb5..000000000
--- a/src/buildtools/config/linux.pri
+++ /dev/null
@@ -1,178 +0,0 @@
-include(common.pri)
-include(functions.pri)
-
-defineReplace(extractCFlag) {
- return($$qtwebengine_extractCFlag($$1))
-}
-
-QT_FOR_CONFIG += gui-private webenginecore-private pdf-private
-
-gn_args += \
- use_cups=false \
- use_gio=false \
- use_gnome_keyring=false \
- linux_use_bundled_binutils=false \
- use_udev=true \
- use_bundled_fontconfig=false \
- use_sysroot=false \
- enable_session_service=false \
- is_cfi=false \
- use_ozone=true \
- ozone_auto_platforms=false \
- ozone_platform_headless=false \
- ozone_platform_external=true \
- ozone_platform=\"qt\" \
- ozone_extra_path=\"$$QTWEBENGINE_ROOT/src/core/ozone/ozone_extra.gni\"
-
-use_gold_linker: gn_args += use_gold=true
-else: gn_args += use_gold=false
-
-use_lld_linker: gn_args += use_lld=true
-else: gn_args += use_lld=false
-
-clang {
- clang_full_path = $$which($${QMAKE_CXX})
- # Remove the "/bin/clang++" part.
- clang_prefix = $$section(clang_full_path, /, 0, -3)
- gn_args += \
- is_clang=true \
- clang_use_chrome_plugins=false \
- clang_use_default_sample_profile=false \
- clang_base_path=\"$${clang_prefix}\"
-
- linux-clang-libc++: gn_args += use_libcxx=true
-} else {
- gn_args += \
- is_clang=false
-}
-
-cross_compile:!host_build {
- TOOLCHAIN_SYSROOT = $$[QT_SYSROOT]
- !isEmpty(TOOLCHAIN_SYSROOT): gn_args += target_sysroot=\"$${TOOLCHAIN_SYSROOT}\"
-}
-
-contains(QT_ARCH, "arm") {
- # Extract ARM specific compiler options that we have to pass to gn,
- # but let gn figure out a default if an option is not present.
- MTUNE = $$extractCFlag("-mtune=.*")
- !isEmpty(MTUNE): gn_args += arm_tune=\"$$MTUNE\"
-
- MFLOAT = $$extractCFlag("-mfloat-abi=.*")
- !isEmpty(MFLOAT): gn_args += arm_float_abi=\"$$MFLOAT\"
-
- MARCH = $$extractCFlag("-march=.*")
- !isEmpty(MARCH): gn_args += arm_arch=\"$$MARCH\"
-
- MARMV = $$replace(MARCH, "armv",)
- !isEmpty(MARMV) {
- MARMV = $$split(MARMV,)
- MARMV = $$member(MARMV, 0)
- lessThan(MARMV, 6): error("$$MARCH architecture is not supported")
- gn_args += arm_version=$$MARMV
- }
-
- # TODO: use neon detection from qtbase
- !lessThan(MARMV, 8) {
- gn_args += arm_use_neon=true
- } else {
- MFPU = $$extractCFlag("-mfpu=.*")
- !isEmpty(MFPU):contains(MFPU, ".*neon.*") {
- gn_args += arm_use_neon=true
- } else {
- gn_args += arm_use_neon=false
- # If the toolchain does not explicitly specify to use NEON instructions
- # we use arm_neon_optional for ARMv7
- equals(MARMV, 7): gn_args += arm_optionally_use_neon=true
- }
- }
-
- qtConfig(webengine-arm-thumb) {
- gn_args += arm_use_thumb=true # this adds -mthumb
- } else {
- gn_args += arm_use_thumb=false
- !qtConfig(webengine-system-ffmpeg) {
- # Fixme QTBUG-71772
- gn_args += media_use_ffmpeg=false
- gn_args += use_webaudio_ffmpeg=false
- }
- }
-}
-
-contains(QT_ARCH, "mips") {
- MARCH = $$extractCFlag("-march=.*")
- !isEmpty(MARCH) {
- equals(MARCH, "mips32r6"): gn_args += mips_arch_variant=\"r6\"
- else: equals(MARCH, "mips32r2"): gn_args += mips_arch_variant=\"r2\"
- else: equals(MARCH, "mips32"): gn_args += mips_arch_variant=\"r1\"
- } else {
- contains(QMAKE_CFLAGS, "mips32r6"): gn_args += mips_arch_variant=\"r6\"
- else: contains(QMAKE_CFLAGS, "mips32r2"): gn_args += mips_arch_variant=\"r2\"
- else: contains(QMAKE_CFLAGS, "mips32"): gn_args += mips_arch_variant=\"r1\"
- }
-
- contains(QMAKE_CFLAGS, "-mmsa"): gn_args += mips_use_msa=true
-
- contains(QMAKE_CFLAGS, "-mdsp2"): gn_args += mips_dsp_rev=2
- else: contains(QMAKE_CFLAGS, "-mdsp"): gn_args += mips_dsp_rev=1
-}
-
-host_build {
- gn_args += custom_toolchain=\"$$QTWEBENGINE_OUT_ROOT/src/toolchain:host\"
- GN_HOST_CPU = $$gnArch($$QT_ARCH)
- gn_args += host_cpu=\"$$GN_HOST_CPU\"
- # Don't bother trying to use system libraries in this case
- gn_args += use_glib=false
-} else {
- gn_args += custom_toolchain=\"$$QTWEBENGINE_OUT_ROOT/src/toolchain:target\"
- gn_args += host_toolchain=\"$$QTWEBENGINE_OUT_ROOT/src/toolchain:host\"
- GN_TARGET_CPU = $$gnArch($$QT_ARCH)
- cross_compile {
- gn_args += v8_snapshot_toolchain=\"$$QTWEBENGINE_OUT_ROOT/src/toolchain:v8_snapshot\"
- # FIXME: we should set host_cpu in case host-toolchain doesn't match os arch,
- # but currently we don't it available at this point
- gn_args += target_cpu=\"$$GN_TARGET_CPU\"
- } else {
- gn_args += host_cpu=\"$$GN_TARGET_CPU\"
- }
- !contains(QT_CONFIG, no-pkg-config) {
- # Strip '>2 /dev/null' from $$pkgConfigExecutable()
- PKGCONFIG = $$first($$list($$pkgConfigExecutable()))
- gn_args += pkg_config=\"$$PKGCONFIG\"
- PKG_CONFIG_HOST = $$(GN_PKG_CONFIG_HOST)
- pkgConfigLibDir = $$(PKG_CONFIG_LIBDIR)
- pkgConfigSysrootDir = $$(PKG_CONFIG_SYSROOT_DIR)
- isEmpty(PKG_CONFIG_HOST): cross_compile {
- !isEmpty(pkgConfigLibDir)|!isEmpty(pkgConfigSysrootDir) {
- PKG_CONFIG_HOST = $$pkgConfigHostExecutable()
- }
- }
- isEmpty(PKG_CONFIG_HOST): PKG_CONFIG_HOST = $$QMAKE_PKG_CONFIG_HOST
- gn_args += host_pkg_config=\"$$PKG_CONFIG_HOST\"
- }
-
- qtConfig(webengine-system-zlib) {
- qtConfig(webengine-system-minizip): gn_args += use_system_zlib=true use_system_minizip=true
- gn_args += pdfium_use_system_zlib=true
- }
-
- qtConfig(webengine-system-png) {
- gn_args += use_system_libpng=true pdfium_use_system_libpng=true
- }
-
- qtConfig(webengine-system-jpeg) {
- gn_args += use_system_libjpeg=true
- } else {
- gn_args += use_system_libjpeg=false
- }
- qtConfig(webengine-system-freetype) {
- gn_args += use_system_freetype=true
- } else {
- gn_args += use_system_freetype=false
- }
- qtConfig(webengine-system-harfbuzz) {
- gn_args += use_system_harfbuzz=true
- } else {
- gn_args += use_system_harfbuzz=false
- }
- gn_args += use_glib=false
-}
diff --git a/src/buildtools/config/mac_osx.pri b/src/buildtools/config/mac_osx.pri
deleted file mode 100644
index b53f91706..000000000
--- a/src/buildtools/config/mac_osx.pri
+++ /dev/null
@@ -1,38 +0,0 @@
-include(common.pri)
-load(functions)
-
-# Reuse the cached sdk version value from mac/sdk.prf if available
-# otherwise query for it.
-QMAKE_MAC_SDK_VERSION = $$eval(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.SDKVersion)
-isEmpty(QMAKE_MAC_SDK_VERSION) {
- QMAKE_MAC_SDK_VERSION = $$system("/usr/bin/xcodebuild -sdk $${QMAKE_MAC_SDK} -version SDKVersion 2>/dev/null")
- isEmpty(QMAKE_MAC_SDK_VERSION): error("Could not resolve SDK version for \'$${QMAKE_MAC_SDK}\'")
-}
-
-# chromium/build/mac/find_sdk.py expects the SDK version (mac_sdk_min) in Major.Minor format.
-# If Patch version is provided it fails with "Exception: No Major.Minor.Patch+ SDK found"
-QMAKE_MAC_SDK_VERSION_MAJOR_MINOR = $$section(QMAKE_MAC_SDK_VERSION, ".", 0, 1)
-
-QMAKE_CLANG_DIR = "/usr"
-QMAKE_CLANG_PATH = $$eval(QMAKE_MAC_SDK.macx-clang.$${QMAKE_MAC_SDK}.QMAKE_CXX)
-!isEmpty(QMAKE_CLANG_PATH) {
- clang_dir = $$clean_path("$$dirname(QMAKE_CLANG_PATH)/../")
- exists($$clang_dir): QMAKE_CLANG_DIR = $$clang_dir
-}
-
-QMAKE_CLANG_PATH = "$${QMAKE_CLANG_DIR}/bin/clang++"
-message("Using clang++ from $${QMAKE_CLANG_PATH}")
-system("$${QMAKE_CLANG_PATH} --version")
-
-
-gn_args += \
- is_clang=true \
- use_sysroot=false \
- use_system_xcode=true \
- clang_base_path=\"$${QMAKE_CLANG_DIR}\" \
- clang_use_chrome_plugins=false \
- mac_deployment_target=\"$${QMAKE_MACOSX_DEPLOYMENT_TARGET}\" \
- mac_sdk_min=\"$${QMAKE_MAC_SDK_VERSION_MAJOR_MINOR}\" \
- use_external_popup_menu=false \
- angle_enable_vulkan=false
-
diff --git a/src/buildtools/config/support.pri b/src/buildtools/config/support.pri
deleted file mode 100644
index 80f291500..000000000
--- a/src/buildtools/config/support.pri
+++ /dev/null
@@ -1,250 +0,0 @@
-defineTest(qtwebengine_skipBuild) {
- skipBuildReason = $$1
- export(skipBuildReason)
-}
-
-# this should match webengine-core-support
-defineReplace(qtwebengine_checkWebEngineCoreError) {
- !qtwebengine_checkForBuildSupport(QtWebEngine):return(false)
- static {
- qtwebengine_skipBuild("Static builds of QtWebEngine are not supported.")
- return(false)
- }
- !qtwebengine_checkForGui(QtWebEngine):return(false)
- !qtwebengine_checkForSubmodule(QtWebEngine):return(false)
- !qtwebengine_checkForWhiteSpace(QtWebEngine):return(false)
- !qtwebengine_checkForPlatform(QtWebEngine):return(false)
- !qtwebengine_checkForArch(QtWebEngine):return(false)
- !qtwebengine_checkForGperf(QtWebEngine):return(false)
- !qtwebengine_checkForBison(QtWebEngine):return(false)
- !qtwebengine_checkForFlex(QtWebEngine):return(false)
- !qtwebengine_checkForPython2(QtWebengine):return(false)
- !qtwebengine_checkForSanitizer(QtWebEngine):return(false)
- linux:!qtwebengine_checkForPkgCfg(QtWebEngine):return(false)
- linux:!qtwebengine_checkForHostPkgCfg(QtWebEngine):return(false)
- linux:!qtwebengine_checkForGlibc(QtWebEngine):return(false)
- linux:!qtwebengine_checkForKhronos(QtWebEngine):return(false)
- linux:!qtwebengine_checkForPackage(QtWebEngine,nss):return(false)
- linux:!qtwebengine_checkForPackage(QtWebEngine,dbus):return(false)
- linux:!qtwebengine_checkForPackage(QtWebEngine,fontconfig):return(false)
- linux:!qtwebengine_checkForQpaXcb(QtWebEngine):return(false)
- win32:!qtwebengine_checkForCompiler64(QtWebEngine):return(false)
- win32:!qtwebengine_checkForWinVersion(QtWebEngine):return(false)
- return(true)
-}
-
-# this shuold match webengine-qtpdf-support
-defineReplace(qtwebengine_checkPdfError) {
- !qtwebengine_checkForBuildSupport(QtPdf):return(false)
- !qtwebengine_checkForGui(QtPdf):return(false)
- !qtwebengine_checkForSubmodule(QtPdf):return(false)
- !qtwebengine_checkForWhiteSpace(QtPdf):return(false)
- !qtwebengine_checkForPlatform(QtPdf):return(false)
- !qtwebengine_checkForArch(QtPdf):return(false)
- !qtwebengine_checkForGperf(QtPdf):return(false)
- !qtwebengine_checkForBison(QtPdf):return(false)
- !qtwebengine_checkForFlex(QtPdf):return(false)
- !qtwebengine_checkForPython2(QtPdf):return(false)
- !qtwebengine_checkForSanitizer(QtPdf):return(false)
- linux:!qtwebengine_checkForPkgCfg(QtPdf):return(false)
- linux:!qtwebengine_checkForHostPkgCfg(QtPdf):return(false)
- win32:!qtwebengine_checkForWinVersion(QtPdf):return(false)
- return(true)
-}
-
-defineTest(qtwebengine_checkForBuildSupport) {
- module = $$1
- !linux:!win32:!macos {
- qtwebengine_skipBuild("$${module} can be build only on Linux, Windows or macOS.")
- return(false)
- }
- return(true)
-}
-
-defineTest(qtwebengine_checkForGui) {
- module = $$1
- !qtHaveModule(gui) {
- qtwebengine_skipBuild("$${module} requires QtGui.")
- return(false)
- }
- return(true)
-}
-
-defineTest(qtwebengine_checkForSubmodule) {
- module = $$1
- !qtConfig(webengine-submodule) {
- qtwebengine_skipBuild("$${module} required submodule qtwebengine-chromium does not exist. Run 'git submodule update --init'.")
- return(false)
- }
- return(true)
-}
-
-defineTest(qtwebengine_checkForWhiteSpace) {
- module = $$1
- !qtConfig(webengine-nowhitespace) {
- qtwebengine_skipBuild("$${module} cannot be built in a path that contains whitespace characters.")
- return(false)
- }
- return(true)
-}
-
-defineTest(qtwebengine_checkForPlatform) {
- module = $$1
- qtConfig(webengine-no-platform-support) {
- !isEmpty(platformError) {
- qtwebengine_skipBuild("$${module} $${platformError}")
- return(false)
- }
- !isEmpty(QTWEBENGINE_OUT_ROOT) {
- include($$QTWEBENGINE_OUT_ROOT/src/buildtools/qtbuildtools-config.pri)
- QT_FOR_CONFIG += buildtools-private
- !isEmpty(PLATFORM_ERROR) {
- qtwebengine_skipBuild("$${module} $${PLATFORM_ERROR}")
- return(false)
- }
- }
- qtwebengine_skipBuild("$${module} will not be built. Platform unsupported.")
- return(false):
- }
- return(true)
-}
-
-defineTest(qtwebengine_checkForArch) {
- module = $$1
- !qtConfig(webengine-arch-support) {
- qtwebengine_skipBuild("$${module} can only be built for x86, x86-64, ARM, Aarch64, and MIPSel architectures.")
- return(false)
- }
- return(true)
-}
-
-defineTest(qtwebengine_checkForGperf) {
- module = $$1
- !qtConfig(webengine-gperf) {
- qtwebengine_skipBuild("Tool gperf is required to build $${module}.")
- return(false)
- }
- return(true)
-}
-
-defineTest(qtwebengine_checkForBison) {
- module = $$1
- !qtConfig(webengine-bison) {
- qtwebengine_skipBuild("Tool bison is required to build $${module}.")
- return(false)
- }
- return(true)
-}
-
-defineTest(qtwebengine_checkForFlex) {
- module = $$1
- !qtConfig(webengine-flex) {
- qtwebengine_skipBuild("Tool flex is required to build $${module}.")
- return(false)
- }
- return(true)
-}
-
-defineTest(qtwebengine_checkForPython2) {
- module = $$1
- !qtConfig(webengine-python2) {
- qtwebengine_skipBuild("Python version 2 (2.7.5 or later) is required to build $${module}.")
- return(false)
- }
- return(true)
-}
-
-defineTest(qtwebengine_checkForSanitizer) {
- module = $$1
- sanitizer:!qtConfig(webengine-sanitizer) {
- qtwebengine_skipBuild("Chosen sanitizer configuration is not supported for $${module}." \
- "Check config.log for details or use -feature-webengine-sanitizer to force build with the chosen sanitizer configuration.")
- return(false);
- }
- return(true)
-}
-
-defineTest(qtwebengine_checkForPkgCfg) {
- module = $$1
- !qtConfig(pkg-config) {
- qtwebengine_skipBuild("A pkg-config support is required to build $${module}.")
- return(false)
- }
- return(true)
-}
-
-defineTest(qtwebengine_checkForHostPkgCfg) {
- module = $$1
- !qtConfig(webengine-host-pkg-config) {
- qtwebengine_skipBuild("Host pkg-config is required to build $${module}.")
- return(false)
- }
- return(true)
-}
-
-defineTest(qtwebengine_checkForGlibc) {
- module = $$1
- !qtConfig(webengine-system-glibc) {
- qtwebengine_skipBuild("A suitable version >= 2.27 of libc required to build $${module} could not be found.")
- return(false)
- }
- return(true)
-}
-
-defineTest(qtwebengine_checkForKhronos) {
- module = $$1
- !qtConfig(webengine-system-khr) {
- qtwebengine_skipBuild("Khronos development headers required to build $${module} are missing (see mesa/libegl1-mesa-dev)")
- return(false)
- }
- return(true)
-}
-
-defineTest(qtwebengine_checkForPackage) {
- module = $$1
- package = $$2
- !qtConfig(webengine-system-$$package) {
- qtwebengine_skipBuild("A suitable version of $$package required to build QtWebEngine could not be found.")
- return(false)
- }
- return(true)
-}
-
-defineTest(qtwebengine_checkForQpaXcb) {
- module = $$1
- qtConfig(pkg-config):qtConfig(xcb):!qtConfig(webengine-ozone-x11) {
- qtwebengine_skipBuild("Could not find all necessary libraries for qpa-xcb support in $${module}.")
- return(false)
- }
- return(true)
-}
-
-defineTest(qtwebengine_checkForCompiler64) {
- module = $$1
- !qtConfig(webengine-win-compiler64) {
- qtwebengine_skipBuild("64-bit cross-building or native toolchain required to build $${module} could not be found.")
- return(false)
- }
- return(true)
-}
-
-defineTest(qtwebengine_checkForWinVersion) {
- module = $$1
- !qtConfig(webengine-winversion) {
- qtwebengine_skipBuild("$${module} requires Visual Studio 2017 or higher.")
- return(false)
- }
- return(true)
-}
-
-defineTest(qtwebengine_makeCheckWebEngineCoreError) {
- include($$QTWEBENGINE_OUT_ROOT/src/buildtools/qtbuildtools-config.pri)
- QT_FOR_CONFIG += buildtools-private gui-private
- return($$qtwebengine_checkWebEngineCoreError())
-}
-
-defineTest(qtwebengine_makeCheckPdfError) {
- include($$QTWEBENGINE_OUT_ROOT/src/buildtools/qtbuildtools-config.pri)
- QT_FOR_CONFIG += buildtools-private gui-private
- return($$qtwebengine_checkPdfError())
-}
diff --git a/src/buildtools/config/windows.pri b/src/buildtools/config/windows.pri
deleted file mode 100644
index c36534d19..000000000
--- a/src/buildtools/config/windows.pri
+++ /dev/null
@@ -1,95 +0,0 @@
-include(common.pri)
-
-gn_args += \
- use_sysroot=false \
- enable_session_service=false \
- ninja_use_custom_environment_files=false \
- is_multi_dll_chrome=false \
- win_linker_timing=true \
- com_init_check_hook_disabled=true \
- heterogeneous_executables=true
-
-clang_cl {
- clang_full_path = $$system_path($$which($${QMAKE_CXX}))
- # Remove the "\bin\clang-cl.exe" part:
- clang_dir = $$dirname(clang_full_path)
- clang_prefix = $$join(clang_dir,,,"\..")
- gn_args += \
- is_clang=true \
- use_lld=true \
- clang_use_chrome_plugins=false \
- clang_base_path=\"$$system_path($$clean_path($$clang_prefix))\"
-} else {
- gn_args += is_clang=false use_lld=false
-}
-
-qtConfig(webengine-developer-build) {
- gn_args += \
- is_win_fastlink=true
-
- # Incremental linking doesn't work in release developer builds due to usage of /OPT:ICF
- # by Chromium.
- CONFIG(debug, debug|release) {
- gn_args += \
- use_incremental_linking=true
- } else {
- gn_args += \
- use_incremental_linking=false
- }
-} else {
- gn_args += \
- is_win_fastlink=false \
- use_incremental_linking=false
-}
-
-defineTest(usingMSVC32BitCrossCompiler) {
- CL_DIR =
- for(dir, QMAKE_PATH_ENV) {
- exists($$dir/cl.exe) {
- CL_DIR = $$dir
- break()
- }
- }
- isEmpty(CL_DIR): {
- warning(Cannot determine location of cl.exe.)
- return(false)
- }
- CL_DIR = $$system_path($$CL_DIR)
- CL_DIR = $$split(CL_DIR, \\)
- CL_PLATFORM = $$take_last(CL_DIR)
- equals(CL_PLATFORM, amd64_x86): return(true)
- equals(CL_PLATFORM, x86)|equals(CL_PLATFORM, x64) {
- CL_PLATFORM = $$take_last(CL_DIR)
- equals(CL_PLATFORM, HostX64): return(true)
- }
- return(false)
-}
-
-msvc:contains(QT_ARCH, "i386"):!usingMSVC32BitCrossCompiler() {
- warning(Full debug info is disabled for chromium due to 32bit compiler)
- # The 32 bit MSVC linker runs out of memory if we do not remove all debug information.
- force_debug_info: gn_args -= symbol_level=1
- gn_args *= symbol_level=0
-}
-
-msvc {
- equals(MSVC_VER, 15.0) {
- MSVS_VERSION = 2017
- } else: equals(MSVC_VER, 16.0) {
- MSVS_VERSION = 2019
- } else {
- error("Visual Studio compiler version \"$$MSVC_VER\" is not supported by gn.")
- }
-
- gn_args += visual_studio_version=$$MSVS_VERSION
-
- SDK_PATH = $$(WINDOWSSDKDIR)
- VS_PATH= $$(VSINSTALLDIR)
- gn_args += visual_studio_path=\"$$clean_path($$VS_PATH)\"
- gn_args += windows_sdk_path=\"$$clean_path($$SDK_PATH)\"
-
- GN_TARGET_CPU = $$gnArch($$QT_ARCH)
- gn_args += target_cpu=\"$$GN_TARGET_CPU\"
-} else {
- error("Microsoft Visual Studio C++ compatible compiler is required by gn.")
-}
diff --git a/src/buildtools/configure.json b/src/buildtools/configure.json
deleted file mode 100644
index e59757a69..000000000
--- a/src/buildtools/configure.json
+++ /dev/null
@@ -1,780 +0,0 @@
-{
- "module": "buildtools",
- "depends": [
- "core-private",
- "gui-private",
- "printsupport"
- ],
- "condition": "module.gui",
- "commandline": {
- "options": {
- "build-qtwebengine-core": "boolean",
- "build-qtpdf": "boolean",
- "webengine-jumbo-build": { "type": "optionalString", "name": "merge_limit"}
- }
- },
- "libraries": {
- "webengine-dbus": {
- "label": "d-bus",
- "sources": [
- { "type": "pkgConfig", "args": "dbus-1" }
- ]
- },
- "webengine-fontconfig": {
- "label": "fontconfig",
- "sources": [
- { "type": "pkgConfig", "args": "fontconfig" }
- ]
- },
- "webengine-libdrm": {
- "label": "libdrm",
- "sources": [
- { "type": "pkgConfig", "args": "libdrm" }
- ]
- },
- "webengine-xcomposite": {
- "label": "xcomposite",
- "sources": [
- { "type": "pkgConfig", "args": "xcomposite" }
- ]
- },
- "webengine-xcursor": {
- "label": "xcursor",
- "sources": [
- { "type": "pkgConfig", "args": "xcursor" }
- ]
- },
- "webengine-xi": {
- "label": "xi",
- "sources": [
- { "type": "pkgConfig", "args": "xi" }
- ]
- },
- "webengine-xtst": {
- "label": "xtst",
- "sources": [
- { "type": "pkgConfig", "args": "xtst" }
- ]
- },
- "webengine-nss": {
- "label": "nss >= 3.26",
- "sources": [
- { "type": "pkgConfig", "args": "nss >= 3.26" }
- ]
- },
- "webengine-x11" : {
- "label" : "x11",
- "sources": [
- { "type": "pkgConfig", "args": "x11" }
- ]
- },
- "webengine-glib": {
- "label": "glib-2.0 >= 2.32.0",
- "sources": [
- { "type": "pkgConfig", "args": "glib-2.0 >= 2.32.0" }
- ]
- },
- "webengine-harfbuzz": {
- "label": "harfbuzz >= 2.2.0",
- "sources": [
- { "type": "pkgConfig", "args": "harfbuzz >= 2.2.0" }
- ]
- },
- "webengine-jpeglib": {
- "label": "compatible jpeglib",
- "type": "compile",
- "test": {
- "head": [
- "#include <cstdio>",
- "#include <cstring>",
- "extern \"C\" {",
- " #include <jpeglib.h>",
- "}"
- ],
- "main": [
- "JDIMENSION dummy;",
- "jpeg_crop_scanline(nullptr, &dummy, &dummy);",
- "jpeg_skip_scanlines(nullptr, dummy);"
- ]
- },
- "sources": [
- { "type": "pkgConfig", "args": "libjpeg" },
- "-ljpeg"
- ]
- },
- "webengine-jsoncpp": {
- "label": "jsoncpp",
- "sources": [
- { "type": "pkgConfig", "args": "jsoncpp" }
- ]
- },
- "webengine-libevent": {
- "label": "libevent",
- "sources": [
- { "type": "pkgConfig", "args": "libevent" }
- ]
- },
- "webengine-minizip": {
- "label": "minizip",
- "sources": [
- { "type": "pkgConfig", "args": "minizip" }
- ]
- },
- "webengine-png": {
- "label": "libpng >= 1.6.0",
- "sources": [
- { "type": "pkgConfig", "args": "libpng >= 1.6.0" }
- ]
- },
- "webengine-protobuf": {
- "label": "protobuf",
- "sources": [
- { "type": "pkgConfig", "args": "protobuf" }
- ]
- },
- "webengine-zlib": {
- "label": "zlib",
- "sources": [
- { "type": "pkgConfig", "args": "zlib" }
- ]
- },
- "webengine-re2": {
- "label": "re2",
- "test" : {
- "main": [
- "std::string s;",
- "re2::FilteredRE2 fre2(1);",
- "int id = 0;",
- "fre2.Add(s, {}, &id);",
- "const RE2 &re2 = fre2.GetRE2(id);"
- ]
- },
- "headers": "re2/filtered_re2.h",
- "sources": [
- { "type": "pkgConfig", "args": "re2" }
- ]
- },
- "webengine-icu": {
- "label": "icu >= 64",
- "sources": [
- { "type": "pkgConfig", "args": "icu-uc >= 64 icu-i18n >= 64" }
- ]
- },
- "webengine-webp": {
- "label": "libwebp, libwebpmux and libwebpdemux",
- "sources": [
- { "type": "pkgConfig", "args": "libwebp libwebpmux libwebpdemux" }
- ]
- },
- "webengine-lcms2": {
- "label": "lcms2",
- "sources": [
- { "type": "pkgConfig", "args": "lcms2" }
- ]
- },
- "webengine-freetype": {
- "label": "freetype >= 2.4.2",
- "test": {
- "head": [
- "#include <ft2build.h>",
- "#include FT_FREETYPE_H",
- "#if ((FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) < 20402)",
- "# error This version of freetype is too old.",
- "#endif"
- ],
- "main": [
- "FT_Face ft_face = 0;",
- "FT_Reference_Face(ft_face);"
- ]
- },
- "sources": [
- { "type": "pkgConfig", "args": "freetype2" }
- ]
- },
- "webengine-libxml2": {
- "label": "compatible libxml2 and libxslt",
- "type": "compile",
- "test": {
- "tail": [
- "#if !defined(LIBXML_ICU_ENABLED)",
- "#error libxml icu not enabled",
- "#endif"
- ]
- },
- "headers": "libxml/xmlversion.h",
- "sources": [
- { "type": "pkgConfig", "args": "libxml-2.0 libxslt" }
- ]
- },
- "webengine-ffmpeg": {
- "label": "libavcodec libavformat libavutil",
- "sources": [
- { "type": "pkgConfig", "args": "libavcodec libavformat libavutil" }
- ]
- },
- "webengine-opus": {
- "label": "opus",
- "sources": [
- { "type": "pkgConfig", "args": "opus >= 1.3.1" }
- ]
- },
- "webengine-snappy": {
- "label": "snappy",
- "test": {
- "main": [
- "snappy::Source *src = 0;",
- "snappy::Sink *sink = 0;"
- ]
- },
- "headers": "snappy.h",
- "sources": [
- "-lsnappy"
- ]
- },
- "webengine-libvpx": {
- "label": "libvpx",
- "test": {
- "main": [
- "vpx_codec_cx_pkt pkt;",
- "pkt.data.frame.width[0] = 0u;",
- "pkt.data.frame.height[0] = 0u;",
- "auto a = CONSTRAINED_FROM_ABOVE_DROP;"
- ]
- },
- "headers": [ "vpx/vpx_encoder.h", "vpx/vp8cx.h" ],
- "sources": [
- { "type": "pkgConfig", "args": "vpx" },
- "-lvpx"
- ]
- }
- },
-
- "testDir": "config.tests",
- "tests" : {
- "webengine-bison": {
- "label": "bison",
- "type": "detectBison"
- },
- "webengine-flex": {
- "label": "flex",
- "type": "detectFlex"
- },
- "webengine-gn": {
- "label": "system gn",
- "type": "detectGn"
- },
- "webengine-glibc": {
- "label": "glibc > 2.16",
- "type": "compile",
- "test": {
- "include": "features.h",
- "tail": [
- "#if __GLIBC__ < 2 || __GLIBC_MINOR__ < 17",
- "#error glibc versions below 2.17 are not supported",
- "#endif"
- ]
- }
- },
- "webengine-gperf": {
- "label": "gperf",
- "type": "detectGperf"
- },
- "webengine-khr": {
- "label": "khr",
- "type": "compile",
- "test": {
- "include": "KHR/khrplatform.h",
- "qmake" : [
- "!isEmpty(QMAKE_INCDIR_EGL): INCLUDEPATH += $$QMAKE_INCDIR_EGL",
- "!isEmpty(QMAKE_INCDIR_OPENGL): INCLUDEPATH += $$QMAKE_INCDIR_OPENGL"
- ]
- }
- },
- "webengine-ninja": {
- "label": "system ninja",
- "type": "detectNinja"
- },
- "webengine-python2": {
- "label": "python2",
- "type": "detectPython2",
- "log": "location"
- },
- "webengine-winversion": {
- "label": "winversion",
- "type": "compile",
- "test": {
- "head" : [
- "#if !defined(__clang__) && _MSC_FULL_VER < 191426428",
- "#error unsupported Visual Studio version",
- "#endif"
- ]
- }
- },
- "webengine-host-pkg-config": {
- "label": "host pkg-config",
- "type": "detectHostPkgConfig",
- "log": "path"
- },
- "webengine-jumbo-build": {
- "label": "jumbo build merge limit",
- "type": "detectJumboBuild",
- "log": "merge_limit"
- },
- "webengine-protoc": {
- "label": "protoc",
- "type": "detectProtoc"
- },
- "webengine-win-compiler64": {
- "label": "64bit compiler",
- "type": "isWindowsHostCompiler64"
- },
- "webengine-platform-support": {
- "label": "platform supported",
- "type": "detectPlatform",
- "log": "platformSupport"
- },
- "webengine-arch-support": {
- "label": "architecture supported",
- "type": "detectArch"
- },
- "webengine-submodule" : {
- "label": "submodule initialized",
- "type": "detectSubmodule"
- },
- "webengine-nowhitespace" : {
- "label": "build path without whitespace",
- "type": "detectNoWhitespace"
- },
- "webengine-arm-thumb" : {
- "label": "thumb instruction set",
- "type": "hasThumbFlag"
- },
- "webengine-sanitizer": {
- "label" : "sanitizer support",
- "type": "isSanitizerSupported"
- }
- },
- "features": {
- "webengine-core-support": {
- "label": "Support Qt WebEngine Core",
- "condition": "(config.linux || config.win32 || config.macos)
- && !config.static
- && module.gui
- && features.webengine-submodule
- && features.webengine-nowhitespace
- && !features.webengine-no-platform-support
- && features.webengine-arch-support
- && features.webengine-gperf
- && features.webengine-bison
- && features.webengine-flex
- && features.webengine-python2
- && (!config.sanitizer || features.webengine-sanitizer)
- && (!config.linux || features.pkg-config)
- && (!config.linux || features.webengine-host-pkg-config)
- && (!config.linux || features.webengine-system-glibc)
- && (!config.linux || features.webengine-system-khr)
- && (!config.linux || features.webengine-system-nss)
- && (!config.linux || features.webengine-system-dbus)
- && (!config.linux || features.webengine-system-fontconfig)
- && (!config.linux || !features.pkg-config || !features.xcb || features.webengine-ozone-x11)
- && (!config.win32 || features.webengine-win-compiler64)
- && (!config.win32 || features.webengine-winversion)",
- "output": [ "privateFeature" ]
- },
- "webengine-qtpdf-support": {
- "label": "Support Qt Pdf",
- "condition": "(config.linux || config.win32 || config.macos)
- && module.gui
- && features.webengine-submodule
- && features.webengine-nowhitespace
- && !features.webengine-no-platform-support
- && features.webengine-arch-support
- && features.webengine-gperf
- && features.webengine-bison
- && features.webengine-flex
- && features.webengine-python2
- && (!config.sanitizer || features.webengine-sanitizer)
- && (!config.linux || features.pkg-config)
- && (!config.linux || features.webengine-host-pkg-config)
- && (!config.win32 || features.webengine-winversion)",
- "output": [ "privateFeature" ]
- },
- "build-qtwebengine-core": {
- "label": "Build Qt WebEngine Core",
- "purpose": "Provides WebEngine Core support.",
- "output": [ "privateFeature" ]
- },
- "build-qtpdf": {
- "label": "Support Qt PDF rendering module",
- "purpose": "Enables building the Qt PDF rendering module.",
- "output": [ "privateFeature" ]
- },
- "webengine-developer-build": {
- "label": "Developer build",
- "purpose": "Enables the developer build configuration.",
- "autoDetect": "features.private_tests",
- "output": [ "privateFeature" ]
- },
- "webengine-python2": {
- "label": "python2",
- "condition": "tests.webengine-python2",
- "output": [
- "privateFeature",
- { "type": "varAssign", "name": "QMAKE_PYTHON2", "value": "tests.webengine-python2.location" }
- ]
- },
- "webengine-gperf": {
- "label": "gperf",
- "condition": "tests.webengine-gperf",
- "output": [ "privateFeature" ]
- },
- "webengine-bison": {
- "label": "bison",
- "condition": "tests.webengine-bison",
- "output": [ "privateFeature" ]
- },
- "webengine-flex": {
- "label": "flex",
- "condition": "tests.webengine-flex",
- "output": [ "privateFeature" ]
- },
- "webengine-system-ninja": {
- "label": "Use System Ninja",
- "condition": "tests.webengine-ninja",
- "output": [ "privateFeature" ]
- },
- "webengine-system-fontconfig": {
- "label": "fontconfig",
- "condition": "libs.webengine-fontconfig",
- "output": [ "privateFeature" ]
- },
- "webengine-system-dbus": {
- "label": "dbus",
- "condition": "libs.webengine-dbus",
- "output": [ "privateFeature" ]
- },
- "webengine-system-libdrm": {
- "label": "libdrm",
- "condition": "libs.webengine-libdrm",
- "output": [ "privateFeature" ]
- },
- "webengine-system-xcomposite": {
- "label": "xcomposite",
- "condition": "libs.webengine-xcomposite",
- "output": [ "privateFeature" ]
- },
- "webengine-system-xcursor": {
- "label": "xcursor",
- "condition": "libs.webengine-xcursor",
- "output": [ "privateFeature" ]
- },
- "webengine-system-xi": {
- "label": "xi",
- "condition": "libs.webengine-xi",
- "output": [ "privateFeature" ]
- },
- "webengine-system-xtst": {
- "label": "xtst",
- "condition": "libs.webengine-xtst",
- "output": [ "privateFeature" ]
- },
- "webengine-system-gn": {
- "label": "Use System Gn",
- "autoDetect": "false",
- "condition": "tests.webengine-gn",
- "output": [ "privateFeature" ]
- },
- "webengine-system-khr" : {
- "label": "khr",
- "condition": "config.unix && tests.webengine-khr",
- "output": [ "privateFeature" ]
- },
- "webengine-system-nss": {
- "label": "nss",
- "condition": "config.unix && !config.darwin && libs.webengine-nss",
- "output": [ "privateFeature" ]
- },
- "webengine-system-glibc": {
- "label": "glibc",
- "condition": "config.linux && tests.webengine-glibc",
- "output": [ "privateFeature" ]
- },
- "webengine-system-x11" : {
- "label": "x11",
- "condition": "config.unix && libs.webengine-x11",
- "output": [ "privateFeature" ]
- },
- "webengine-host-pkg-config": {
- "label": "host-pkg-config",
- "condition": "config.unix && tests.webengine-host-pkg-config",
- "output": [
- "privateFeature",
- { "type": "varAssign", "name": "QMAKE_PKG_CONFIG_HOST", "value": "tests.webengine-host-pkg-config.path" }
- ]
- },
- "webengine-ozone-x11" : {
- "condition": "config.unix
- && features.xcb
- && features.webengine-system-x11
- && features.webengine-system-libdrm
- && features.webengine-system-xcomposite
- && features.webengine-system-xcursor
- && features.webengine-system-xi
- && features.webengine-system-xtst",
- "output": [ "privateFeature" ]
- },
- "webengine-jumbo-build": {
- "label": "jumbo build merge batch",
- "condition": "tests.webengine-jumbo-build",
- "output": [
- "privateFeature",
- { "type": "varAssign", "name": "QMAKE_JUMBO_MERGE_LIMIT", "value": "tests.webengine-jumbo-build.merge_limit" }
- ]
- },
- "webengine-system-harfbuzz": {
- "label": "harfbuzz",
- "condition": "config.unix && features.system-harfbuzz && libs.webengine-harfbuzz",
- "output": [ "privateFeature" ]
- },
- "webengine-system-glib" : {
- "label": "glib",
- "condition": "config.unix && libs.webengine-glib",
- "output": [ "privateFeature" ]
- },
- "webengine-system-minizip" : {
- "label": "minizip",
- "condition": "config.unix && libs.webengine-minizip",
- "output": [ "privateFeature" ]
- },
- "webengine-system-zlib" : {
- "label": "zlib",
- "condition": "config.unix && features.system-zlib && libs.webengine-zlib",
- "output": [ "privateFeature" ]
- },
- "webengine-system-libevent" : {
- "label": "libevent",
- "condition": "config.unix && libs.webengine-libevent",
- "output": [ "privateFeature" ]
- },
- "webengine-system-jsoncpp" : {
- "label": "jsoncpp",
- "condition": "config.unix && libs.webengine-jsoncpp",
- "output": [ "privateFeature" ]
- },
- "webengine-system-protobuf" : {
- "label": "protobuf",
- "condition": "config.unix && libs.webengine-protobuf && tests.webengine-protoc",
- "output": [ "privateFeature" ]
- },
- "webengine-system-png" : {
- "label": "png",
- "condition": "config.unix && features.system-png && libs.webengine-png",
- "output": [ "privateFeature" ]
- },
- "webengine-system-jpeg" : {
- "label": "JPEG",
- "condition": "config.unix && features.system-jpeg && libs.webengine-jpeglib",
- "output": [ "privateFeature" ]
- },
- "webengine-system-re2": {
- "label": "re2",
- "condition": "config.unix && libs.webengine-re2",
- "output": [ "privateFeature" ]
- },
- "webengine-system-icu": {
- "label": "icu",
- "autoDetect": "false",
- "condition": "libs.webengine-icu",
- "output": [ "privateFeature" ]
- },
- "webengine-system-libwebp": {
- "label": "libwebp, libwebpmux and libwebpdemux",
- "condition": "config.unix && libs.webengine-webp",
- "output": [ "privateFeature" ]
- },
- "webengine-system-opus": {
- "label": "opus",
- "condition": "config.unix && libs.webengine-opus",
- "output": [ "privateFeature" ]
- },
- "webengine-system-ffmpeg": {
- "label": "ffmpeg",
- "autoDetect": "false",
- "condition": "libs.webengine-ffmpeg && features.webengine-system-opus && features.webengine-system-libwebp",
- "output": [ "privateFeature" ]
- },
- "webengine-system-libxml2": {
- "label": "libxml2 and libxslt",
- "condition": "config.unix && libs.webengine-libxml2",
- "output": [ "privateFeature" ]
- },
- "webengine-system-lcms2" : {
- "label": "lcms2",
- "condition": "config.unix && libs.webengine-lcms2",
- "output": [ "privateFeature" ]
- },
- "webengine-system-freetype" : {
- "label": "freetype",
- "condition": "config.unix && features.system-freetype && libs.webengine-freetype",
- "output": [ "privateFeature" ]
- },
- "webengine-system-libvpx" : {
- "label": "libvpx",
- "condition": "config.unix && libs.webengine-libvpx",
- "output": [ "privateFeature" ]
- },
- "webengine-system-snappy" : {
- "label": "snappy",
- "condition": "config.unix && libs.webengine-snappy",
- "output": [ "privateFeature" ]
- },
- "webengine-winversion" : {
- "label": "winversion",
- "condition": "config.win32 && tests.webengine-winversion",
- "output": [ "privateFeature" ]
- },
- "webengine-win-compiler64": {
- "label": "64bit compiler",
- "condition": "config.win32 && tests.webengine-win-compiler64",
- "output": [ "privateFeature" ]
- },
- "webengine-submodule": {
- "label": "submodule",
- "condition": "tests.webengine-submodule",
- "output": [ "privateFeature" ]
- },
- "webengine-nowhitespace": {
- "label": "nowhitespace",
- "condition" : "tests.webengine-nowhitespace",
- "output": [ "privateFeature" ]
- },
- "webengine-arch-support": {
- "label": "architecture",
- "condition" : "tests.webengine-arch-support",
- "output": [ "privateFeature" ]
- },
- "webengine-no-platform-support": {
- "label": "platform",
- "condition" : "!tests.webengine-platform-support",
- "output": [
- "privateFeature",
- { "type": "varAssign", "name": "PLATFORM_ERROR", "value": "tests.webengine-platform-support.platformSupport" }
- ]
- },
- "webengine-arm-thumb": {
- "label": "Thumb instruction set",
- "condition": "config.linux && arch.arm && tests.webengine-arm-thumb",
- "output": [ "privateFeature" ]
- },
- "webengine-sanitizer" : {
- "label": "Sanitizer",
- "autoDetect": "config.sanitizer && tests.webengine-sanitizer",
- "condition": "config.sanitizer",
- "output": [ "privateFeature" ]
- }
- },
- "report": [
- {
- "type": "skipBuildWarning",
- "condition": "!features.webengine-core-support && features.build-qtwebengine-core",
- "message": "qtwebengine_confCheckWebEngineCoreError"
- },
- {
- "type": "skipBuildWarning",
- "condition": "!features.webengine-qtpdf-support && features.build-qtpdf",
- "message": "qtwebengine_confCheckPdfError"
- },
- {
- "type": "note",
- "condition": "features.webengine-core-support && !features.build-qtwebengine-core",
- "message": "QtWebEngine build is disabled by user."
- },
- {
- "type": "note",
- "condition": "features.webengine-qtpdf-support && !features.build-qtpdf",
- "message": "QtPdf build is disabled by user."
- },
- {
- "type": "warning",
- "condition": "!features.webengine-core-support && features.build-qtwebengine-core",
- "message": "QtWebEngine will not be built."
- },
- {
- "type": "warning",
- "condition": "!features.webengine-qtpdf-support && features.build-qtpdf",
- "message": "QtPdf will not be built."
- },
- {
- "type": "warning",
- "condition": "config.ios && config.simulator && config.device && features.build-qtpdf",
- "message": "Building fat libray with device and simulator architectures will disable NEON."
- }
- ],
- "summary": [
- {
- "section": "Qt WebEngine Build Tools",
- "entries": [
- "webengine-system-ninja",
- "webengine-system-gn",
- {
- "message": "Jumbo Build Merge Limit",
- "type": "jumboBuild"
- },
- "webengine-developer-build",
- {
- "type": "feature",
- "args": "webengine-sanitizer",
- "condition": "!config.sanitizer"
- },
- {
- "section": "QtWebEngine required system libraries",
- "condition": "config.unix && !config.macos && !config.ios",
- "entries": [
- "webengine-system-fontconfig",
- "webengine-system-dbus",
- "webengine-system-nss",
- "webengine-system-khr",
- "webengine-system-glibc"
- ]
- },
- {
- "section": "QtWebEngine required system libraries for qpa-xcb",
- "condition": "config.unix && !config.macos && features.xcb",
- "entries": [
- "webengine-system-x11",
- "webengine-system-libdrm",
- "webengine-system-xcomposite",
- "webengine-system-xcursor",
- "webengine-system-xi",
- "webengine-system-xtst"
- ]
- },
- {
- "section": "Optional system libraries used",
- "condition": "config.unix",
- "entries": [
- "webengine-system-re2",
- "webengine-system-icu",
- "webengine-system-libwebp",
- "webengine-system-opus",
- "webengine-system-ffmpeg",
- "webengine-system-libvpx",
- "webengine-system-snappy",
- "webengine-system-glib",
- "webengine-system-zlib",
- "webengine-system-minizip",
- "webengine-system-libevent",
- "webengine-system-jsoncpp",
- "webengine-system-protobuf",
- "webengine-system-libxml2",
- "webengine-system-lcms2",
- "webengine-system-png",
- "webengine-system-jpeg",
- "webengine-system-harfbuzz",
- "webengine-system-freetype"
- ]
- }
- ]
- }
- ]
-}
diff --git a/src/buildtools/configure_host.pro b/src/buildtools/configure_host.pro
deleted file mode 100644
index dd0d3e327..000000000
--- a/src/buildtools/configure_host.pro
+++ /dev/null
@@ -1,65 +0,0 @@
-# Prevent generating a makefile that attempts to create a lib
-TEMPLATE = aux
-
-# Pick up the host toolchain
-option(host_build)
-
-GN_HOST_CPU = $$gnArch($$QT_ARCH)
-!isEmpty(QT_TARGET_ARCH): GN_TARGET_CPU = $$gnArch($$QT_TARGET_ARCH)
-else: GN_TARGET_CPU = $$GN_HOST_CPU
-GN_OS = $$gnOS()
-
-clang: GN_CLANG = true
-else: GN_CLANG = false
-
-use_gold_linker: GN_USE_GOLD=true
-else: GN_USE_GOLD=false
-
-GN_V8_HOST_CPU = $$GN_HOST_CPU
-contains(GN_TARGET_CPU, "arm")|contains(GN_TARGET_CPU, "mipsel")|contains(GN_TARGET_CPU, "x86") {
- # The v8 snapshot need a host that matches bitwidth, so we build makesnapshot to 32-bit variants of host.
- contains(GN_V8_HOST_CPU, x64): GN_V8_HOST_CPU = "x86"
- else: contains(GN_V8_HOST_CPU, arm64): GN_V8_HOST_CPU = "arm"
- else: contains(GN_V8_HOST_CPU, mips64el): GN_V8_HOST_CPU = "mipsel"
-}
-
-GN_HOST_EXTRA_CPPFLAGS = $$(GN_HOST_TOOLCHAIN_EXTRA_CPPFLAGS)
-
-# We always use the gcc_toolchain, because clang_toolchain is just
-# a broken wrapper around it for Google's custom clang binaries.
-GN_CONTENTS = \
-"import(\"//build/config/sysroot.gni\")" \
-"import(\"//build/toolchain/gcc_toolchain.gni\")" \
-"gcc_toolchain(\"host\") {" \
-" cc = \"$$which($$QMAKE_CC)\" " \
-" cxx = \"$$which($$QMAKE_CXX)\" " \
-" ld = \"$$which($$QMAKE_LINK)\" " \
-" ar = \"$$which(ar)\" " \
-" nm = \"$$which(nm)\" " \
-" extra_cppflags = \"$$GN_HOST_EXTRA_CPPFLAGS\" " \
-" toolchain_args = { " \
-" current_os = \"$$GN_OS\" " \
-" current_cpu = \"$$GN_HOST_CPU\" " \
-" is_clang = $$GN_CLANG " \
-" use_gold = $$GN_USE_GOLD " \
-" } " \
-"}" \
-"gcc_toolchain(\"v8_snapshot\") {" \
-" cc = \"$$which($$QMAKE_CC)\" " \
-" cxx = \"$$which($$QMAKE_CXX)\" " \
-" ld = \"$$which($$QMAKE_LINK)\" " \
-" ar = \"$$which(ar)\" " \
-" nm = \"$$which(nm)\" " \
-" toolchain_args = { " \
-" current_os = \"$$GN_OS\" " \
-" current_cpu = \"$$GN_V8_HOST_CPU\" " \
-" v8_current_cpu = \"$$GN_TARGET_CPU\" " \
-" is_clang = $$GN_CLANG " \
-" use_gold = $$GN_USE_GOLD " \
-" } " \
-" } "
-
-GN_FILE = $$OUT_PWD/../toolchain/BUILD.gn
-!build_pass {
- write_file($$GN_FILE, GN_CONTENTS)
-}
diff --git a/src/buildtools/configure_target.pro b/src/buildtools/configure_target.pro
deleted file mode 100644
index 31aa283f6..000000000
--- a/src/buildtools/configure_target.pro
+++ /dev/null
@@ -1,33 +0,0 @@
-# Prevent generating a makefile that attempts to create a lib
-TEMPLATE = aux
-
-GN_CPU = $$gnArch($$QT_ARCH)
-GN_OS = $$gnOS()
-
-clang: GN_CLANG = true
-else: GN_CLANG = false
-
-use_gold_linker: GN_USE_GOLD=true
-else: GN_USE_GOLD=false
-
-GN_CONTENTS = \
-"gcc_toolchain(\"target\") {" \
-" cc = \"$$which($$QMAKE_CC)\" " \
-" cxx = \"$$which($$QMAKE_CXX)\" " \
-" ld = \"$$which($$QMAKE_LINK)\" " \
-" ar = \"$$which($${CROSS_COMPILE}ar)\" " \
-" nm = \"$$which($${CROSS_COMPILE}nm)\" " \
-" toolchain_args = { " \
-" current_os = \"$$GN_OS\" " \
-" current_cpu = \"$$GN_CPU\" " \
-" is_clang = $$GN_CLANG " \
-" use_gold = $$GN_USE_GOLD " \
-" } " \
-"}"
-
-GN_FILE = $$OUT_PWD/../toolchain/BUILD.gn
-!build_pass {
- write_file($$GN_FILE, GN_CONTENTS, append)
-}
-
-QMAKE_DISTCLEAN += $$GN_FILE
diff --git a/src/buildtools/gn.pro b/src/buildtools/gn.pro
deleted file mode 100644
index 033202e6e..000000000
--- a/src/buildtools/gn.pro
+++ /dev/null
@@ -1,41 +0,0 @@
-TEMPLATE = aux
-option(host_build)
-
-!debug_and_release: CONFIG += release
-
-include($$QTWEBENGINE_OUT_ROOT/src/buildtools/qtbuildtools-config.pri)
-QT_FOR_CONFIG += buildtools-private
-
-build_pass|!debug_and_release {
- !qtConfig(webengine-system-gn): CONFIG(release, debug|release) {
- buildgn.target = build_gn
- out = $$gnPath()
- out_path = $$dirname(out)
- !qtConfig(webengine-system-ninja): ninja_path = $$ninjaPath()
- else: ninja_path="ninja"
- # check if it is not already build
- !exists($$out) {
- src_3rd_party_dir = $$absolute_path("$${getChromiumSrcDir()}/../", "$$QTWEBENGINE_ROOT")
- gn_bootstrap = $$system_path($$absolute_path(gn/build/gen.py, $$src_3rd_party_dir))
-
- gn_gen_args = --no-last-commit-position --out-path $$out_path \
- --cc \"$$which($$QMAKE_CC)\" --cxx \"$$which($$QMAKE_CXX)\" \
- --ld \"$$which($$QMAKE_LINK)\"
-
- msvc:!clang_cl: gn_gen_args += --use-lto
-
- gn_configure = $$system_quote($$gn_bootstrap) $$gn_gen_args
- macos {
- gn_configure += --isysroot \"$$QMAKE_MAC_SDK_PATH\"
- }
- message($$gn_configure)
- !system("$$pythonPathForSystem() $$gn_configure") {
- error("GN generation error!")
- }
- !system("cd $$system_quote($$system_path($$out_path)) && $$ninja_path $$basename(out)" ) {
- error("GN build error!")
- }
- }
- QMAKE_DISTCLEAN += $$out
- }
-}
diff --git a/src/buildtools/ninja.pro b/src/buildtools/ninja.pro
deleted file mode 100644
index 66a6d5aa6..000000000
--- a/src/buildtools/ninja.pro
+++ /dev/null
@@ -1,23 +0,0 @@
-TEMPLATE = aux
-
-!debug_and_release: CONFIG += release
-
-include($$QTWEBENGINE_OUT_ROOT/src/buildtools/qtbuildtools-config.pri)
-QT_FOR_CONFIG += buildtools-private
-
-build_pass|!debug_and_release {
- !qtConfig(webengine-system-ninja): CONFIG(release, debug|release) {
- out = $$ninjaPath()
- # check if it is not already build
- !exists($$out) {
- mkpath($$dirname(out))
- src_3rd_party_dir = $$absolute_path("$${getChromiumSrcDir()}/../", "$$QTWEBENGINE_ROOT")
- ninja_configure = $$system_quote($$system_path($$absolute_path(ninja/configure.py, $$src_3rd_party_dir)))
- !system("cd $$system_quote($$system_path($$dirname(out))) && $$pythonPathForSystem() $$ninja_configure --bootstrap") {
- error("NINJA build error!")
- }
- }
- QMAKE_DISTCLEAN += $$out
- }
-}
-
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
new file mode 100644
index 000000000..8ba77607b
--- /dev/null
+++ b/src/core/CMakeLists.txt
@@ -0,0 +1,673 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.19)
+
+find_package(Ninja 1.7.2 REQUIRED)
+find_package(Nodejs 14.19 REQUIRED)
+find_package(Perl)
+find_package(PkgConfig)
+if(PkgConfig_FOUND)
+ create_pkg_config_host_wrapper(${CMAKE_CURRENT_BINARY_DIR})
+endif()
+
+set(buildDir "${CMAKE_CURRENT_BINARY_DIR}")
+
+add_subdirectory(api)
+add_subdirectory(tools/webenginedriver)
+add_subdirectory(tools/qwebengine_convert_dict)
+
+##
+# TOOLCHAIN SETUP
+##
+
+if(LINUX)
+ setup_toolchains()
+endif()
+
+##
+# GN BUILD SETUP
+##
+
+addSyncTargets(core)
+
+get_configs(configs)
+get_architectures(archs)
+
+foreach(arch ${archs})
+ foreach(config ${configs})
+
+ ##
+ # BUILD.gn SETUP
+ ##
+
+ set(buildGn core_${config}_${arch})
+ add_gn_target(${buildGn} ${config} ${arch}
+ SOURCES DEFINES CXX_COMPILE_OPTIONS C_COMPILE_OPTIONS INCLUDES MOC_PATH
+ )
+ resolve_target_includes(gnIncludes WebEngineCore)
+ get_forward_declaration_macro(forwardDeclarationMacro)
+ get_target_property(qtWebEngineProcessName WebEngineCore QTWEBENGINEPROCESS_NAME)
+
+ if("${config}" STREQUAL "Debug")
+ set(qtWebEngineProcessName "${qtWebEngineProcessName}${CMAKE_DEBUG_POSTFIX}")
+ endif()
+
+ set(gnCxxCompileOptions "")
+ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
+ # Silence warning in boringssl headers.
+ list(APPEND gnCxxCompileOptions -Wno-ignored-qualifiers)
+
+ if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "11.0.0" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "11.2.0")
+ # GCC 11.1 has a regression in the integrated preprocessor, so disable it as a workaround (QTBUG-93360)
+ # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100796
+ list(APPEND gnCxxCompileOptions -no-integrated-cpp)
+ endif()
+ endif()
+
+ extend_gn_target(${buildGn}
+ INCLUDES
+ ${gnIncludes}
+ DEFINES
+ QT_NO_KEYWORDS
+ QT_USE_QSTRINGBUILDER
+ QTWEBENGINECORE_VERSION_STR=${QT_REPO_MODULE_VERSION}
+ QTWEBENGINEPROCESS_NAME=${qtWebEngineProcessName}
+ BUILDING_CHROMIUM
+ "${forwardDeclarationMacro}"
+ CXX_COMPILE_OPTIONS
+ ${gnCxxCompileOptions}
+ SOURCES
+ accessibility_tree_formatter_qt.cpp
+ browser_accessibility_qt.cpp browser_accessibility_qt.h
+ authentication_dialog_controller.cpp authentication_dialog_controller.h authentication_dialog_controller_p.h
+ autofill_client_qt.cpp autofill_client_qt.h
+ autofill_popup_controller.cpp autofill_popup_controller.h autofill_popup_controller_p.h
+ browser_accessibility_manager_qt.cpp browser_accessibility_manager_qt.h
+ browser_main_parts_qt.cpp browser_main_parts_qt.h
+ browser_message_filter_qt.cpp browser_message_filter_qt.h
+ browsing_data_remover_delegate_qt.cpp browsing_data_remover_delegate_qt.h
+ build_config_qt.h
+ certificate_error_controller.cpp certificate_error_controller.h
+ chromium_overrides.cpp
+ client_cert_select_controller.cpp client_cert_select_controller.h
+ client_hints.cpp client_hints.h
+ clipboard_change_observer.h
+ clipboard_qt.cpp clipboard_qt.h
+ color_chooser_controller.cpp color_chooser_controller.h color_chooser_controller_p.h
+ color_chooser_qt.cpp color_chooser_qt.h
+ common/qt_messages.cpp common/qt_messages.h
+ compositor/compositor.cpp compositor/compositor.h
+ compositor/content_gpu_client_qt.cpp compositor/content_gpu_client_qt.h
+ compositor/display_overrides.cpp
+ compositor/display_software_output_surface.cpp compositor/display_software_output_surface.h
+ compositor/native_skia_output_device.cpp compositor/native_skia_output_device.h
+ content_browser_client_qt.cpp content_browser_client_qt.h
+ content_client_qt.cpp content_client_qt.h
+ content_main_delegate_qt.cpp content_main_delegate_qt.h
+ content_utility_client_qt.cpp content_utility_client_qt.h
+ custom_handlers/protocol_handler_registry_delegate_qt.h custom_handlers/protocol_handler_registry_delegate_qt.cpp
+ custom_handlers/protocol_handler_registry_factory.h custom_handlers/protocol_handler_registry_factory.cpp
+ custom_handlers/register_protocol_handler_request_controller.h
+ custom_handlers/register_protocol_handler_request_controller_impl.cpp custom_handlers/register_protocol_handler_request_controller_impl.h
+ delegated_frame_host_client_qt.cpp delegated_frame_host_client_qt.h
+ desktop_media_controller.cpp desktop_media_controller.h desktop_media_controller_p.h
+ desktop_screen_qt.cpp desktop_screen_qt.h
+ devtools_frontend_qt.cpp devtools_frontend_qt.h
+ devtools_manager_delegate_qt.cpp devtools_manager_delegate_qt.h
+ download_manager_delegate_qt.cpp download_manager_delegate_qt.h
+ favicon_driver_qt.cpp favicon_driver_qt.h
+ favicon_service_factory_qt.cpp favicon_service_factory_qt.h
+ file_picker_controller.cpp file_picker_controller.h
+ file_system_access/file_system_access_permission_context_factory_qt.cpp file_system_access/file_system_access_permission_context_factory_qt.h
+ file_system_access/file_system_access_permission_context_qt.cpp file_system_access/file_system_access_permission_context_qt.h
+ file_system_access/file_system_access_permission_grant_qt.cpp file_system_access/file_system_access_permission_grant_qt.h
+ file_system_access/file_system_access_permission_request_controller.h
+ file_system_access/file_system_access_permission_request_controller_impl.cpp file_system_access/file_system_access_permission_request_controller_impl.h
+ file_system_access/file_system_access_permission_request_manager_qt.cpp file_system_access/file_system_access_permission_request_manager_qt.h
+ find_text_helper.cpp find_text_helper.h
+ global_descriptors_qt.h
+ javascript_dialog_controller.cpp javascript_dialog_controller.h javascript_dialog_controller_p.h
+ javascript_dialog_manager_qt.cpp javascript_dialog_manager_qt.h
+ login_delegate_qt.cpp login_delegate_qt.h
+ media_capture_devices_dispatcher.cpp media_capture_devices_dispatcher.h
+ native_web_keyboard_event_qt.cpp native_web_keyboard_event_qt.h
+ net/client_cert_qt.cpp net/client_cert_qt.h
+ net/client_cert_store_data.cpp net/client_cert_store_data.h
+ net/cookie_monster_delegate_qt.cpp net/cookie_monster_delegate_qt.h
+ net/custom_url_loader_factory.cpp net/custom_url_loader_factory.h
+ net/proxy_config_monitor.cpp net/proxy_config_monitor.h
+ net/proxy_config_service_qt.cpp net/proxy_config_service_qt.h
+ net/proxying_restricted_cookie_manager_qt.cpp net/proxying_restricted_cookie_manager_qt.h
+ net/proxying_url_loader_factory_qt.cpp net/proxying_url_loader_factory_qt.h
+ net/qrc_url_scheme_handler.cpp net/qrc_url_scheme_handler.h
+ net/resource_request_body_qt.cpp net/resource_request_body_qt.h
+ net/ssl_host_state_delegate_qt.cpp net/ssl_host_state_delegate_qt.h
+ net/system_network_context_manager.cpp net/system_network_context_manager.h
+ net/url_request_custom_job_delegate.cpp net/url_request_custom_job_delegate.h
+ net/url_request_custom_job_proxy.cpp net/url_request_custom_job_proxy.h
+ net/version_ui_qt.cpp net/version_ui_qt.h
+ net/webui_controller_factory_qt.cpp net/webui_controller_factory_qt.h
+ ozone/gl_context_qt.cpp ozone/gl_context_qt.h
+ ozone/gl_ozone_egl_qt.cpp ozone/gl_ozone_egl_qt.h
+ ozone/gl_share_context_qt.cpp ozone/gl_share_context_qt.h
+ ozone/gl_surface_egl_qt.cpp ozone/gl_surface_egl_qt.h
+ ozone/gl_surface_qt.cpp ozone/gl_surface_qt.h
+ ozone/gl_surface_wgl_qt.cpp ozone/gl_surface_wgl_qt.h
+ ozone/platform_window_qt.cpp ozone/platform_window_qt.h
+ ozone/surface_factory_qt.cpp ozone/surface_factory_qt.h
+ permission_manager_qt.cpp permission_manager_qt.h
+ pdf_util_qt.cpp pdf_util_qt.h
+ platform_notification_service_qt.cpp platform_notification_service_qt.h
+ pointer_device_qt.cpp
+ pref_service_adapter.cpp pref_service_adapter.h
+ process_main.cpp
+ profile_adapter.cpp profile_adapter.h
+ profile_adapter_client.cpp profile_adapter_client.h
+ profile_io_data_qt.cpp profile_io_data_qt.h
+ profile_qt.cpp profile_qt.h
+ render_view_context_menu_qt.cpp render_view_context_menu_qt.h
+ render_widget_host_view_qt.cpp render_widget_host_view_qt.h
+ render_widget_host_view_qt_delegate.h
+ render_widget_host_view_qt_delegate_client.cpp render_widget_host_view_qt_delegate_client.h
+ render_widget_host_view_qt_delegate_item.cpp render_widget_host_view_qt_delegate_item.h
+ renderer/content_renderer_client_qt.cpp renderer/content_renderer_client_qt.h
+ renderer/content_settings_observer_qt.cpp renderer/content_settings_observer_qt.h
+ renderer/render_configuration.cpp renderer/render_configuration.h
+ renderer/render_frame_observer_qt.cpp renderer/render_frame_observer_qt.h
+ renderer/user_resource_controller.cpp renderer/user_resource_controller.h
+ renderer/web_engine_page_render_frame.cpp renderer/web_engine_page_render_frame.h
+ renderer_host/user_resource_controller_host.cpp renderer_host/user_resource_controller_host.h
+ renderer_host/web_engine_page_host.cpp renderer_host/web_engine_page_host.h
+ request_controller.h
+ resource_bundle_qt.cpp
+ select_file_dialog_factory_qt.cpp select_file_dialog_factory_qt.h
+ touch_handle_drawable_client.h
+ touch_handle_drawable_qt.cpp touch_handle_drawable_qt.h
+ touch_selection_controller_client_qt.cpp touch_selection_controller_client_qt.h
+ touch_selection_menu_controller.cpp touch_selection_menu_controller.h
+ type_conversion.cpp type_conversion.h
+ user_notification_controller.cpp user_notification_controller.h
+ user_script.cpp user_script.h
+ visited_links_manager_qt.cpp visited_links_manager_qt.h
+ web_contents_adapter.cpp web_contents_adapter.h
+ web_contents_adapter_client.h
+ web_contents_delegate_qt.cpp web_contents_delegate_qt.h
+ web_contents_view_qt.cpp web_contents_view_qt.h
+ web_engine_context.cpp web_engine_context.h
+ web_engine_error.cpp web_engine_error.h
+ web_engine_library_info.cpp web_engine_library_info.h
+ web_engine_settings.cpp web_engine_settings.h
+ web_event_factory.cpp web_event_factory.h
+ web_usb_detector_qt.cpp web_usb_detector_qt.h
+ authenticator_request_client_delegate_qt.cpp authenticator_request_client_delegate_qt.h
+ authenticator_request_dialog_controller.cpp authenticator_request_dialog_controller.h authenticator_request_dialog_controller_p.h
+ )
+
+ extend_gn_target(${buildGn} CONDITION QT_FEATURE_accessibility
+ SOURCES
+ accessibility_activation_observer.cpp accessibility_activation_observer.h
+ )
+
+ extend_gn_target(${buildGn} CONDITION QT_FEATURE_webengine_ozone_x11
+ SOURCES
+ ozone/gl_ozone_glx_qt.cpp ozone/gl_ozone_glx_qt.h
+ ozone/gl_surface_glx_qt.cpp ozone/gl_surface_glx_qt.h
+ )
+
+ extend_gn_target(${buildGn} CONDITION QT_FEATURE_webengine_vulkan
+ SOURCES
+ compositor/native_skia_output_device_vulkan.cpp compositor/native_skia_output_device_vulkan.h
+ compositor/vulkan_implementation_qt.cpp compositor/vulkan_implementation_qt.h
+ )
+
+ extend_gn_target(${buildGn} CONDITION QT_FEATURE_opengl
+ SOURCES
+ compositor/compositor_resource_fence.cpp compositor/compositor_resource_fence.h
+ compositor/display_skia_output_device.cpp compositor/display_skia_output_device.h
+ compositor/native_skia_output_device_opengl.cpp compositor/native_skia_output_device_opengl.h
+ )
+
+ extend_gn_target(${buildGn} CONDITION MACOS
+ SOURCES
+ native_web_keyboard_event_qt_mac.mm
+ compositor/native_skia_output_device_mac.mm
+ compositor/native_skia_output_device_metal.cpp compositor/native_skia_output_device_metal.h
+ )
+
+ extend_gn_target(${buildGn} CONDITION QT_FEATURE_webengine_pepper_plugins
+ SOURCES
+ renderer/pepper/pepper_renderer_host_factory_qt.cpp renderer/pepper/pepper_renderer_host_factory_qt.h
+ renderer/plugins/loadable_plugin_placeholder_qt.cpp renderer/plugins/loadable_plugin_placeholder_qt.h
+ )
+
+ extend_gn_target(${buildGn} CONDITION QT_FEATURE_webengine_printing_and_pdf
+ SOURCES
+ printing/pdfium_document_wrapper_qt.cpp printing/pdfium_document_wrapper_qt.h
+ printing/print_view_manager_base_qt.cpp printing/print_view_manager_base_qt.h
+ printing/print_view_manager_qt.cpp printing/print_view_manager_qt.h
+ printing/printer_worker.cpp printing/printer_worker.h
+ renderer/print_web_view_helper_delegate_qt.cpp renderer/print_web_view_helper_delegate_qt.h
+ )
+
+ extend_gn_target(${buildGn} CONDITION QT_FEATURE_webengine_geolocation
+ SOURCES
+ location_provider_qt.cpp location_provider_qt.h
+ )
+
+ extend_gn_target(${buildGn} CONDITION QT_FEATURE_webengine_webchannel
+ SOURCES
+ renderer/web_channel_ipc_transport.cpp renderer/web_channel_ipc_transport.h
+ renderer_host/web_channel_ipc_transport_host.cpp renderer_host/web_channel_ipc_transport_host.h
+ )
+
+ extend_gn_target(${buildGn} CONDITION QT_FEATURE_webengine_extensions
+ SOURCES
+ common/extensions/extensions_api_provider_qt.cpp common/extensions/extensions_api_provider_qt.h
+ common/extensions/extensions_client_qt.cpp common/extensions/extensions_client_qt.h
+ extensions/component_extension_resource_manager_qt.cpp extensions/component_extension_resource_manager_qt.h
+ extensions/extension_host_delegate_qt.cpp extensions/extension_host_delegate_qt.h
+ extensions/extension_system_factory_qt.cpp extensions/extension_system_factory_qt.h
+ extensions/extension_system_qt.cpp extensions/extension_system_qt.h
+ extensions/extension_web_contents_observer_qt.cpp extensions/extension_web_contents_observer_qt.h
+ extensions/extensions_api_client_qt.cpp extensions/extensions_api_client_qt.h
+ extensions/extensions_browser_client_qt.cpp extensions/extensions_browser_client_qt.h
+ extensions/file_system_delegate_qt.cpp extensions/file_system_delegate_qt.h
+ extensions/messaging_delegate_qt.cpp extensions/messaging_delegate_qt.h
+ extensions/mime_handler_view_guest_delegate_qt.cpp extensions/mime_handler_view_guest_delegate_qt.h
+ extensions/plugin_service_filter_qt.cpp extensions/plugin_service_filter_qt.h
+ net/plugin_response_interceptor_url_loader_throttle.cpp net/plugin_response_interceptor_url_loader_throttle.h
+ renderer/extensions/extensions_dispatcher_delegate_qt.cpp renderer/extensions/extensions_dispatcher_delegate_qt.h
+ renderer/extensions/extensions_renderer_client_qt.cpp renderer/extensions/extensions_renderer_client_qt.h
+ renderer/extensions/renderer_permissions_policy_delegate_qt.cpp renderer/extensions/renderer_permissions_policy_delegate_qt.h
+ renderer/extensions/resource_request_policy_qt.cpp renderer/extensions/resource_request_policy_qt.h
+ )
+
+ extend_gn_target(${buildGn} CONDITION QT_FEATURE_webengine_extensions AND QT_FEATURE_webengine_printing_and_pdf
+ SOURCES
+ extensions/pdf_iframe_navigation_throttle_qt.cpp extensions/pdf_iframe_navigation_throttle_qt.h
+ printing/pdf_stream_delegate_qt.cpp printing/pdf_stream_delegate_qt.h
+ printing/pdf_document_helper_client_qt.cpp printing/pdf_document_helper_client_qt.h
+ )
+
+ extend_gn_target(${buildGn} CONDITION WIN32
+ SOURCES
+ clipboard_util_win.cpp
+ compositor/native_skia_output_device_direct3d11.cpp compositor/native_skia_output_device_direct3d11.h
+ )
+
+ ##
+ # GN PARAMETERS SETUP
+ ##
+
+ unset(gnArgArg)
+
+ append_build_type_setup(gnArgArg)
+ append_compiler_linker_sdk_setup(gnArgArg)
+ append_sanitizer_setup(gnArgArg)
+ append_toolchain_setup(gnArgArg)
+ append_pkg_config_setup(gnArgArg)
+
+ list(APPEND gnArgArg
+ qtwebengine_target="${buildDir}/${config}/${arch}:QtWebEngineCore"
+ build_dawn_tests=false
+ build_with_tflite_lib=false
+ enable_background_contents=false
+ enable_background_mode=false
+ enable_ipc_fuzzer=false
+ enable_ipc_logging=false
+ enable_java_templates=false
+ enable_media_remoting=false
+ enable_message_center=false
+ enable_nacl=false
+ enable_oop_printing=false
+ enable_remoting=false
+ enable_reporting=false
+ enable_resource_allowlist_generation=false
+ enable_screen_ai_service=false
+ enable_session_service=false
+ enable_supervised_users=false
+ enable_swiftshader=false
+ enable_swiftshader_vulkan=false
+ angle_enable_swiftshader=false
+ dawn_use_swiftshader=false
+ enable_vr=false
+ enable_web_speech=false
+ enable_widevine=true
+ enable_library_cdms=true
+ fatal_linker_warnings=false
+ has_native_accessibility=false
+ safe_browsing_mode=0
+ toolkit_views=false
+ chrome_pgo_phase=0
+ optimize_webui=false
+ strip_absolute_paths_from_debug_symbols=false
+ pdf_use_skia=true
+ use_dawn=false
+ skia_use_dawn=false
+ devtools_fast_bundle=false
+ devtools_skip_typecheck=false
+ use_static_angle=true
+ use_perfetto_client_library=false
+ trial_comparison_cert_verifier_supported=false
+ )
+ extend_gn_list(gnArgArg
+ ARGS use_v8_context_snapshot v8_use_external_startup_data
+ CONDITION QT_FEATURE_webengine_v8_context_snapshot
+ )
+ extend_gn_list(gnArgArg
+ ARGS enable_printing enable_basic_printing enable_print_preview enable_pdf
+ CONDITION QT_FEATURE_webengine_printing_and_pdf
+ )
+ extend_gn_list(gnArgArg
+ ARGS use_cups
+ CONDITION QT_FEATURE_webengine_printing_and_pdf AND NOT WIN32
+ )
+ extend_gn_list(gnArgArg
+ ARGS enable_plugins
+ CONDITION QT_FEATURE_webengine_printing_and_pdf OR
+ QT_FEATURE_webengine_pepper_plugins
+ )
+ extend_gn_list(gnArgArg
+ ARGS enable_ppapi
+ CONDITION QT_FEATURE_webengine_pepper_plugins
+ )
+ extend_gn_list(gnArgArg
+ ARGS enable_spellcheck
+ CONDITION QT_FEATURE_webengine_spellchecker
+ )
+ extend_gn_list(gnArgArg
+ ARGS enable_webrtc
+ CONDITION QT_FEATURE_webengine_webrtc
+ )
+ extend_gn_list(gnArgArg
+ ARGS enable_screen_capture
+ CONDITION QT_FEATURE_webengine_webrtc
+ )
+ extend_gn_list(gnArgArg
+ ARGS enable_hangout_services_extension
+ CONDITION QT_FEATURE_webengine_webrtc AND QT_FEATURE_webengine_extensions
+ )
+ extend_gn_list(gnArgArg
+ ARGS rtc_use_pipewire
+ CONDITION QT_FEATURE_webengine_webrtc_pipewire
+ )
+ extend_gn_list(gnArgArg
+ ARGS enable_extensions
+ CONDITION QT_FEATURE_webengine_extensions
+ )
+ extend_gn_list(gnArgArg
+ ARGS enable_vulkan
+ CONDITION QT_FEATURE_webengine_vulkan
+ )
+ extend_gn_list(gnArgArg
+ ARGS use_kerberos
+ CONDITION QT_FEATURE_webengine_kerberos
+ )
+ extend_gn_list(gnArgArg
+ ARGS proprietary_codecs
+ CONDITION QT_FEATURE_webengine_proprietary_codecs
+ )
+ if(QT_FEATURE_webengine_proprietary_codecs)
+ list(APPEND gnArgArg ffmpeg_branding="Chrome")
+ endif()
+ extend_gn_list(gnArgArg
+ ARGS use_browser_spellchecker
+ CONDITION QT_FEATURE_webengine_native_spellchecker
+ )
+ extend_gn_list(gnArgArg
+ ARGS use_embedded_config
+ CONDITION QT_FEATURE_webengine_embedded_build
+ )
+ extend_gn_list(gnArgArg
+ ARGS enable_webenginedriver
+ CONDITION QT_FEATURE_webenginedriver
+ )
+
+ if(LINUX)
+ list(APPEND gnArgArg
+ use_gtk=false # GTK toolkit bindings
+ use_qt=false # Qt5 toolkit bindings
+ use_cups=false
+ use_gio=false
+ use_bundled_fontconfig=false
+ use_glib=false
+ use_bluez=false
+ use_udev=true
+ is_cfi=false
+ use_ozone=true
+ ozone_auto_platforms=false
+ ozone_platform_headless=false
+ ozone_platform_external=true
+ ozone_platform="qt"
+ ozone_extra_path="${CMAKE_CURRENT_LIST_DIR}/ozone/ozone_extra.gni"
+ )
+ set(systemLibs libjpeg libpng freetype harfbuzz libevent libwebp libxml
+ opus snappy icu ffmpeg re2 lcms2 libopenjpeg2 libvpx
+ )
+ foreach(slib ${systemLibs})
+ extend_gn_list(gnArgArg
+ ARGS use_system_${slib}
+ CONDITION QT_FEATURE_webengine_system_${slib}
+ )
+ endforeach()
+ if(NOT QT_FEATURE_webengine_system_opus)
+ extend_gn_list(gnArgArg
+ ARGS has_perl
+ CONDITION Perl_FOUND
+ )
+ endif()
+ extend_gn_list(gnArgArg
+ ARGS use_system_libxslt
+ CONDITION QT_FEATURE_webengine_system_libxml
+ )
+ extend_gn_list(gnArgArg
+ ARGS icu_use_data_file
+ CONDITION NOT QT_FEATURE_webengine_system_icu
+ )
+ extend_gn_list(gnArgArg
+ ARGS use_system_zlib use_system_minizip
+ CONDITION QT_FEATURE_webengine_system_zlib AND QT_FEATURE_webengine_system_minizip
+ )
+ extend_gn_list(gnArgArg
+ ARGS pdfium_use_system_zlib
+ CONDITION QT_FEATURE_webengine_system_zlib
+ )
+ extend_gn_list(gnArgArg
+ ARGS pdfium_use_system_libpng
+ CONDITION QT_FEATURE_webengine_system_libpng
+ )
+ extend_gn_list(gnArgArg
+ ARGS pdfium_use_system_libtiff
+ CONDITION QT_FEATURE_webengine_system_libtiff
+ )
+ extend_gn_list(gnArgArg
+ ARGS use_libpci
+ CONDITION QT_FEATURE_webengine_system_libpci
+ )
+ extend_gn_list(gnArgArg
+ ARGS use_alsa
+ CONDITION QT_FEATURE_webengine_system_alsa
+ )
+ extend_gn_list(gnArgArg
+ ARGS use_pulseaudio
+ CONDITION QT_FEATURE_webengine_system_pulseaudio
+ )
+ extend_gn_list(gnArgArg
+ ARGS use_system_minigbm
+ CONDITION QT_FEATURE_webengine_system_gbm
+ )
+ extend_gn_list(gnArgArg
+ ARGS use_vaapi
+ CONDITION QT_FEATURE_webengine_vaapi
+ )
+ extend_gn_list(gnArgArg
+ ARGS ozone_platform_x11 use_xkbcommon
+ CONDITION QT_FEATURE_webengine_ozone_x11
+ )
+ extend_gn_list(gnArgArg
+ ARGS rtc_use_x11
+ CONDITION QT_FEATURE_webengine_ozone_x11 AND QT_FEATURE_webengine_webrtc
+ )
+ extend_gn_list(gnArgArg
+ ARGS use_vaapi_x11
+ CONDITION QT_FEATURE_webengine_ozone_x11 AND QT_FEATURE_webengine_vaapi
+ )
+
+ if(QT_FEATURE_webengine_kerberos)
+ list(APPEND gnArgArg
+ external_gssapi_include_dir="${GSSAPI_INCLUDE_DIRS}/gssapi"
+ )
+ endif()
+ get_gn_arch(cpu ${TEST_architecture_arch})
+ if(CMAKE_CROSSCOMPILING AND cpu STREQUAL "arm")
+ check_thumb(armThumb)
+ if(NOT armThumb AND NOT QT_FEATURE_webengine_system_ffmpeg)
+ list(APPEND gnArgArg media_use_ffmpeg=false use_webaudio_ffmpeg=false)
+ endif()
+ endif()
+
+ if(CMAKE_CROSSCOMPILING AND cpu STREQUAL "arm64")
+ # This is a workaround to avoid auto test timeouts on the QEMU arm64 CI.
+ if ("$ENV{TARGET_OSVERSION_COIN}" STREQUAL "qemu")
+ list(APPEND gnArgArg
+ v8_enable_sandbox=false
+ arm_control_flow_integrity="none"
+ )
+ endif()
+ endif()
+ unset(cpu)
+ endif()
+
+ if(MACOS)
+ list(APPEND gnArgArg
+ use_external_popup_menu=false
+ skia_use_metal=false
+ )
+ endif()
+
+ if(WIN32)
+ list(APPEND gnArgArg
+ ninja_use_custom_environment_files=false
+ com_init_check_hook_disabled=true
+ heterogeneous_executables=true
+ )
+ endif()
+
+ add_gn_command(
+ CMAKE_TARGET WebEngineCore
+ NINJA_TARGETS QtWebEngineCore convert_dict
+ GN_TARGET ${buildGn}
+ GN_ARGS ${gnArgArg}
+ BUILDDIR ${buildDir}/${config}/${arch}
+ MODULE core
+ )
+
+ endforeach()
+ create_cxx_configs(WebEngineCore ${arch})
+endforeach()
+
+
+##
+# WEBENGINECORE SETUP
+##
+
+list(GET archs 0 arch)
+target_include_directories(WebEngineCore PRIVATE
+ ${buildDir}/$<CONFIG>/${arch}/gen
+ ${buildDir}/$<CONFIG>/${arch}/gen/third_party/perfetto
+ ${buildDir}/$<CONFIG>/${arch}/gen/third_party/perfetto/build_config
+)
+
+set(stamps QtWebEngineCore.stamp)
+if(QT_FEATURE_webengine_v8_context_snapshot)
+ set(dataStamp obj/tools/v8_context_snapshot/v8_context_snapshot.stamp)
+endif()
+
+add_gn_build_artifacts_to_target(
+ CMAKE_TARGET WebEngineCore
+ NINJA_TARGET QtWebEngineCore
+ MODULE core
+ BUILDDIR ${buildDir}
+ COMPLETE_STATIC FALSE
+ NINJA_STAMP QtWebEngineCore.stamp
+ NINJA_DATA_STAMP ${dataStamp}
+)
+add_dependencies(WebEngineCore run_core_NinjaDone)
+if(COIN_BUG_699)
+ set_property(TARGET WebEngineCore PROPERTY CXX_LINKER_LAUNCHER ${PROJECT_BINARY_DIR}/linker_ulimit.sh)
+endif()
+
+##
+# SANDBOX
+##
+
+if(WIN32)
+ add_library(WebEngineCoreSandbox STATIC IMPORTED GLOBAL)
+ foreach(config ${configs})
+ string(TOUPPER ${config} cfg)
+ add_ninja_command(
+ TARGET QtWebEngineCoreSandbox
+ OUTPUT QtWebEngineCoreSandbox.lib
+ BUILDDIR ${buildDir}/${config}/${arch}
+ MODULE core
+ )
+ set(sandboxLibraryPath ${buildDir}/${config}/${arch}/QtWebEngineCoreSandbox.lib)
+ set_property(TARGET WebEngineCoreSandbox
+ PROPERTY IMPORTED_LOCATION_${cfg} ${sandboxLibraryPath}
+ )
+ add_custom_target(sandboxLibrary_${config}
+ DEPENDS ${buildDir}/${config}/${arch}/QtWebEngineCoreSandbox.lib)
+ add_dependencies(run_core_NinjaDone sandboxLibrary_${config})
+ add_dependencies(WebEngineCoreSandbox WebEngineCore)
+ endforeach()
+endif()
+
+##
+# WEBENGINECORE DICT TOOL SETUP
+##
+
+if(QT_FEATURE_webengine_spellchecker AND NOT CMAKE_CROSSCOMPILING)
+ qt_get_tool_target_name(dict_target_name qwebengine_convert_dict)
+ target_include_directories(${dict_target_name} PRIVATE
+ ../3rdparty/chromium
+ ../3rdparty/chromium/third_party/boringssl/src/include
+ ${buildDir}/$<CONFIG>/${arch}/gen
+ )
+ add_gn_build_artifacts_to_target(
+ CMAKE_TARGET ${dict_target_name}
+ NINJA_TARGET convert_dict
+ MODULE core
+ BUILDDIR ${buildDir}
+ COMPLETE_STATIC FALSE
+ NINJA_STAMP convert_dict.stamp
+ )
+ add_dependencies(${dict_target_name} run_core_NinjaDone)
+ add_dependencies(${dict_target_name} WebEngineCore)
+endif()
+
+##
+# WEBENGINEDRIVER
+##
+
+if(QT_FEATURE_webenginedriver)
+ add_ninja_command(
+ TARGET webenginedriver_group
+ OUTPUT ${WEBENGINEDRIVER_EXECUTABLE}
+ BUILDDIR ${buildDir}/$<CONFIG>/${arch}
+ MODULE core
+ )
+ add_custom_target(webenginedriver
+ DEPENDS
+ ${buildDir}/$<CONFIG>/${arch}/${WEBENGINEDRIVER_EXECUTABLE})
+ add_dependencies(run_core_NinjaDone webenginedriver)
+endif()
+
+##
+# CHROMIUM UPDATE
+##
+
+add_custom_target(update-chromium
+ COMMAND ${CMAKE_COMMAND} -P ${WEBENGINE_ROOT_SOURCE_DIR}/cmake/SubmoduleUpdate.cmake
+ DEPENDS ${WEBENGINE_ROOT_SOURCE_DIR}/cmake/SubmoduleUpdate.cmake
+)
diff --git a/src/core/accessibility_activation_observer.cpp b/src/core/accessibility_activation_observer.cpp
index 833190844..4f25a35ff 100644
--- a/src/core/accessibility_activation_observer.cpp
+++ b/src/core/accessibility_activation_observer.cpp
@@ -1,46 +1,8 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "accessibility_activation_observer.h"
-#if QT_CONFIG(accessibility)
-
#include "content/browser/accessibility/browser_accessibility_state_impl.h"
namespace QtWebEngineCore {
@@ -48,12 +10,13 @@ namespace QtWebEngineCore {
namespace {
bool isAccessibilityEnabled() {
- // On Linux accessibility is disabled by default due to performance issues,
- // and can be re-enabled by setting the QTWEBENGINE_ENABLE_LINUX_ACCESSIBILITY environment
- // variable. For details, see QTBUG-59922.
+ // On Linux accessibility can be disabled due to performance issues by setting the
+ // QTWEBENGINE_ENABLE_LINUX_ACCESSIBILITY environment variable to 0. For details,
+ // see QTBUG-59922.
#ifdef Q_OS_LINUX
static bool accessibility_enabled
- = qEnvironmentVariableIsSet("QTWEBENGINE_ENABLE_LINUX_ACCESSIBILITY");
+ = qEnvironmentVariable("QTWEBENGINE_ENABLE_LINUX_ACCESSIBILITY", QLatin1String("1"))
+ == QLatin1String("1");
#else
const bool accessibility_enabled = true;
#endif
@@ -85,5 +48,3 @@ void AccessibilityActivationObserver::accessibilityActiveChanged(bool active)
}
} // namespace QtWebEngineCore
-
-#endif // QT_CONFIG(accessibility)
diff --git a/src/core/accessibility_activation_observer.h b/src/core/accessibility_activation_observer.h
index 23fd2101e..81d8b843c 100644
--- a/src/core/accessibility_activation_observer.h
+++ b/src/core/accessibility_activation_observer.h
@@ -1,53 +1,13 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef ACCESSIBILITY_ACTIVATION_OBSERVER_H
#define ACCESSIBILITY_ACTIVATION_OBSERVER_H
#include <QtGui/qaccessible.h>
-#if QT_CONFIG(accessibility)
-
namespace QtWebEngineCore {
-class RenderWidgetHostViewQt;
-
class AccessibilityActivationObserver : public QAccessible::ActivationObserver
{
public:
@@ -59,6 +19,4 @@ public:
} // namespace QtWebEngineCore
-#endif // QT_CONFIG(accessibility)
-
#endif // ACCESSIBILITY_ACTIVATION_OBSERVER_H
diff --git a/src/core/accessibility_tree_formatter_qt.cpp b/src/core/accessibility_tree_formatter_qt.cpp
index 081856b37..3a3b30cb4 100644
--- a/src/core/accessibility_tree_formatter_qt.cpp
+++ b/src/core/accessibility_tree_formatter_qt.cpp
@@ -1,71 +1,46 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "content/browser/accessibility/accessibility_tree_formatter_browser.h"
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+#include "content/browser/accessibility/browser_accessibility_manager.h"
+#include "content/browser/accessibility/accessibility_tree_formatter_blink.h"
+#include "content/public/browser/ax_inspect_factory.h"
+#include "ui/accessibility/platform/inspect/ax_event_recorder.h"
+
+#include <QtGui/qtguiglobal.h>
+
+#include <memory>
+#include <string>
#include <utility>
-#include "base/logging.h"
-#include "base/strings/string_number_conversions.h"
-#include "base/strings/string_util.h"
+#if QT_CONFIG(accessibility)
+#include "browser_accessibility_qt.h"
+
#include "base/strings/stringprintf.h"
-#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
+#include "content/browser/accessibility/browser_accessibility.h"
+#include "ui/accessibility/platform/inspect/ax_tree_formatter_base.h"
-#include "browser_accessibility_qt.h"
+#include <QtGui/qaccessible.h>
+#endif
namespace content {
#if QT_CONFIG(accessibility)
-class AccessibilityTreeFormatterQt : public AccessibilityTreeFormatterBrowser {
+class AccessibilityTreeFormatterQt : public ui::AXTreeFormatterBase {
public:
explicit AccessibilityTreeFormatterQt();
~AccessibilityTreeFormatterQt() override;
+ base::Value::Dict BuildTree(ui::AXPlatformNodeDelegate *start) const override;
+ base::Value::Dict BuildTreeForSelector(const AXTreeSelector &selector) const override
+ {
+ return base::Value::Dict{};
+ }
+
private:
- base::FilePath::StringType GetExpectedFileSuffix() override;
- const std::string GetAllowEmptyString() override;
- const std::string GetAllowString() override;
- const std::string GetDenyString() override;
- const std::string GetDenyNodeString() override;
- void AddProperties(const BrowserAccessibility &node, base::DictionaryValue* dict) override;
- base::string16 ProcessTreeForOutput(const base::DictionaryValue &node, base::DictionaryValue * = nullptr) override;
+ void RecursiveBuildAccessibilityTree(const BrowserAccessibility &node, base::Value::Dict *dict) const;
+ void AddProperties(const BrowserAccessibility &node, base::Value::Dict *dict) const;
+ std::string ProcessTreeForOutput(const base::Value::Dict &node) const override;
};
AccessibilityTreeFormatterQt::AccessibilityTreeFormatterQt()
@@ -76,144 +51,177 @@ AccessibilityTreeFormatterQt::~AccessibilityTreeFormatterQt()
{
}
-void AccessibilityTreeFormatterQt::AddProperties(const BrowserAccessibility &node, base::DictionaryValue *dict)
+base::Value::Dict AccessibilityTreeFormatterQt::BuildTree(ui::AXPlatformNodeDelegate *start) const
{
- dict->SetInteger("id", node.GetId());
- const BrowserAccessibilityQt *acc_node = ToBrowserAccessibilityQt(&node);
+ BrowserAccessibility *root_internal =
+ BrowserAccessibility::FromAXPlatformNodeDelegate(start);
+ base::Value::Dict dict;
+ RecursiveBuildAccessibilityTree(*root_internal, &dict);
+ return dict;
+}
- dict->SetString("role", qAccessibleRoleString(acc_node->role()));
+void AccessibilityTreeFormatterQt::RecursiveBuildAccessibilityTree(const BrowserAccessibility &node, base::Value::Dict *dict) const
+{
+ AddProperties(node, dict);
- QAccessible::State state = acc_node->state();
+ base::Value::List children;
+ for (size_t i = 0; i < node.PlatformChildCount(); ++i) {
+ base::Value::Dict child_dict;
- std::vector<base::Value> states;
+ content::BrowserAccessibility *child_node = node.PlatformGetChild(i);
+
+ RecursiveBuildAccessibilityTree(*child_node, &child_dict);
+ children.Append(std::move(child_dict));
+ }
+ dict->Set(kChildrenDictAttr, std::move(children));
+}
+
+void AccessibilityTreeFormatterQt::AddProperties(const BrowserAccessibility &node, base::Value::Dict *dict) const
+{
+ dict->Set("id", node.GetId());
+ const QAccessibleInterface *iface = toQAccessibleInterface(&node);
+
+ dict->Set("role", qAccessibleRoleString(iface->role()));
+
+ QAccessible::State state = iface->state();
+
+ base::Value::List states;
if (state.busy)
- states.push_back(base::Value("busy"));
+ states.Append(base::Value("busy"));
if (state.checkable)
- states.push_back(base::Value("checkable"));
+ states.Append(base::Value("checkable"));
if (state.checked)
- states.push_back(base::Value("checked"));
- if (acc_node->IsClickable())
- states.push_back(base::Value("clickable"));
+ states.Append(base::Value("checked"));
+ if (node.IsClickable())
+ states.Append(base::Value("clickable"));
if (state.collapsed)
- states.push_back(base::Value("collapsed"));
+ states.Append(base::Value("collapsed"));
if (state.disabled)
- states.push_back(base::Value("disabled"));
+ states.Append(base::Value("disabled"));
if (state.editable)
- states.push_back(base::Value("editable"));
+ states.Append(base::Value("editable"));
if (state.expandable)
- states.push_back(base::Value("expandable"));
+ states.Append(base::Value("expandable"));
if (state.expanded)
- states.push_back(base::Value("expanded"));
+ states.Append(base::Value("expanded"));
if (state.focusable)
- states.push_back(base::Value("focusable"));
+ states.Append(base::Value("focusable"));
if (state.focused)
- states.push_back(base::Value("focused"));
+ states.Append(base::Value("focused"));
if (state.hasPopup)
- states.push_back(base::Value("hasPopup"));
+ states.Append(base::Value("hasPopup"));
if (state.hotTracked)
- states.push_back(base::Value("hotTracked"));
+ states.Append(base::Value("hotTracked"));
if (state.invisible)
- states.push_back(base::Value("invisible"));
+ states.Append(base::Value("invisible"));
if (state.linked)
- states.push_back(base::Value("linked"));
+ states.Append(base::Value("linked"));
if (state.multiLine)
- states.push_back(base::Value("multiLine"));
+ states.Append(base::Value("multiLine"));
if (state.multiSelectable)
- states.push_back(base::Value("multiSelectable"));
+ states.Append(base::Value("multiSelectable"));
if (state.modal)
- states.push_back(base::Value("modal"));
+ states.Append(base::Value("modal"));
if (state.offscreen)
- states.push_back(base::Value("offscreen"));
+ states.Append(base::Value("offscreen"));
if (state.passwordEdit)
- states.push_back(base::Value("password"));
+ states.Append(base::Value("password"));
if (state.pressed)
- states.push_back(base::Value("pressed"));
+ states.Append(base::Value("pressed"));
if (state.readOnly)
- states.push_back(base::Value("readOnly"));
+ states.Append(base::Value("readOnly"));
if (state.selectable)
- states.push_back(base::Value("selectable"));
+ states.Append(base::Value("selectable"));
if (state.selected)
- states.push_back(base::Value("selected"));
+ states.Append(base::Value("selected"));
if (state.traversed)
- states.push_back(base::Value("traversed"));
- dict->SetKey("states", base::Value(states));
+ states.Append(base::Value("traversed"));
+ dict->Set("states", std::move(states));
- dict->SetString("name", acc_node->text(QAccessible::Name).toStdString());
- dict->SetString("description", acc_node->text(QAccessible::Description).toStdString());
+ dict->Set("name", iface->text(QAccessible::Name).toStdString());
+ dict->Set("description", iface->text(QAccessible::Description).toStdString());
}
-base::string16 AccessibilityTreeFormatterQt::ProcessTreeForOutput(const base::DictionaryValue &node, base::DictionaryValue *)
+std::string AccessibilityTreeFormatterQt::ProcessTreeForOutput(const base::Value::Dict &node) const
{
- base::string16 error_value;
- if (node.GetString("error", &error_value))
- return error_value;
+ std::string error_value;
+ if (auto error_value = node.FindString("error"))
+ return *error_value;
- base::string16 line;
+ std::string line;
std::string role_value;
- node.GetString("role", &role_value);
- if (!role_value.empty())
- WriteAttribute(true, base::StringPrintf("%s", role_value.c_str()), &line);
+ if (auto role_value = node.FindString("role"))
+ WriteAttribute(true, base::StringPrintf("%s", role_value->c_str()), &line);
- const base::ListValue *states_value = nullptr;
- node.GetList("states", &states_value);
- if (states_value) {
+ if (const auto states_value = node.FindList("states")) {
for (const auto &state : *states_value) {
- std::string state_value;
- if (state.GetAsString(&state_value))
- WriteAttribute(true, state_value, &line);
+ if (auto *state_value = state.GetIfString())
+ WriteAttribute(false, *state_value, &line);
}
}
- std::string name_value;
- if (node.GetString("name", &name_value))
- WriteAttribute(true, base::StringPrintf("name='%s'", name_value.c_str()), &line);
+ if (auto name_value = node.FindString("name"))
+ WriteAttribute(true, base::StringPrintf("name='%s'", name_value->c_str()), &line);
- std::string description_value;
- if (node.GetString("description", &description_value))
- WriteAttribute(false, base::StringPrintf("description='%s'", description_value.c_str()), &line);
+ if (auto description_value = node.FindString("description"))
+ WriteAttribute(false, base::StringPrintf("description='%s'", description_value->c_str()), &line);
int id_value;
- node.GetInteger("id", &id_value);
+ if (auto maybe_id = node.FindInt("id"))
+ id_value = *maybe_id;
WriteAttribute(false, base::StringPrintf("id=%d", id_value), &line);
- return line + base::ASCIIToUTF16("\n");
-}
-
-base::FilePath::StringType AccessibilityTreeFormatterQt::GetExpectedFileSuffix()
-{
- return FILE_PATH_LITERAL("-expected-qt.txt");
+ return line + "\n";
}
-const std::string AccessibilityTreeFormatterQt::GetAllowEmptyString()
-{
- return "@QT-ALLOW-EMPTY:";
-}
+#endif // QT_CONFIG(accessibility)
-const std::string AccessibilityTreeFormatterQt::GetAllowString()
+// static
+std::unique_ptr<ui::AXTreeFormatter>
+AXInspectFactory::CreatePlatformFormatter()
{
- return "@QT-ALLOW:";
+ return AXInspectFactory::CreateFormatter(ui::AXApiType::kQt);
}
-const std::string AccessibilityTreeFormatterQt::GetDenyString()
+// static
+std::unique_ptr<ui::AXEventRecorder> AXInspectFactory::CreatePlatformRecorder(BrowserAccessibilityManager *manager,
+ base::ProcessId pid,
+ const ui::AXTreeSelector &selector)
{
- return "@QT-DENY:";
+ return AXInspectFactory::CreateRecorder(ui::AXApiType::kQt, manager, pid, selector);
}
-const std::string AccessibilityTreeFormatterQt::GetDenyNodeString()
+// static
+std::unique_ptr<ui::AXTreeFormatter> AXInspectFactory::CreateFormatter(ui::AXApiType::Type type)
{
- return "@QT-DENY-NODE:";
+ switch (type) {
+ case ui::AXApiType::kBlink:
+ return std::make_unique<AccessibilityTreeFormatterBlink>();
+ case ui::AXApiType::kQt:
+#if QT_CONFIG(accessibility)
+ return std::make_unique<AccessibilityTreeFormatterQt>();
+#else
+ return nullptr;
+#endif
+ default:
+ NOTREACHED() << "Unsupported inspect type " << type;
+ }
+ return nullptr;
}
-#endif // QT_CONFIG(accessibility)
-
// static
-std::unique_ptr<AccessibilityTreeFormatter> AccessibilityTreeFormatter::Create()
+std::unique_ptr<ui::AXEventRecorder> AXInspectFactory::CreateRecorder(ui::AXApiType::Type type,
+ BrowserAccessibilityManager *manager,
+ base::ProcessId pid,
+ const ui::AXTreeSelector &selector)
{
-#if QT_CONFIG(accessibility)
- return std::unique_ptr<AccessibilityTreeFormatter>(new AccessibilityTreeFormatterQt());
-#else
+ switch (type) {
+ case ui::AXApiType::kQt:
+ return std::make_unique<ui::AXEventRecorder>();
+ default:
+ NOTREACHED() << "Unsupported inspect type " << type;
+ }
return nullptr;
-#endif
}
} // namespace content
diff --git a/src/core/api/CMakeLists.txt b/src/core/api/CMakeLists.txt
new file mode 100644
index 000000000..f2ceb2dfd
--- /dev/null
+++ b/src/core/api/CMakeLists.txt
@@ -0,0 +1,221 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+find_package(Qt6 ${PROJECT_VERSION} REQUIRED COMPONENTS Gui Network Quick)
+find_package(Qt6 ${PROJECT_VERSION} QUIET OPTIONAL_COMPONENTS WebChannel Positioning)
+
+set(qtWebEngineProcessName QtWebEngineProcess)
+
+qt_internal_add_module(WebEngineCore
+ SOURCES
+ qtwebenginecoreglobal.cpp qtwebenginecoreglobal.h qtwebenginecoreglobal_p.h
+ qwebenginecertificateerror.cpp qwebenginecertificateerror.h
+ qwebengineclientcertificateselection.cpp qwebengineclientcertificateselection.h
+ qwebengineclientcertificatestore.cpp qwebengineclientcertificatestore.h
+ qwebengineclienthints.cpp qwebengineclienthints.h
+ qwebenginecontextmenurequest.cpp qwebenginecontextmenurequest.h qwebenginecontextmenurequest_p.h
+ qwebenginecookiestore.cpp qwebenginecookiestore.h qwebenginecookiestore_p.h
+ qwebenginedesktopmediarequest.cpp qwebenginedesktopmediarequest.h qwebenginedesktopmediarequest_p.h
+ qwebenginedownloadrequest.cpp qwebenginedownloadrequest.h qwebenginedownloadrequest_p.h
+ qwebenginefilesystemaccessrequest.cpp qwebenginefilesystemaccessrequest.h
+ qwebenginefindtextresult.cpp qwebenginefindtextresult.h
+ qwebenginefullscreenrequest.cpp qwebenginefullscreenrequest.h
+ qwebenginehistory.cpp qwebenginehistory.h qwebenginehistory_p.h
+ qwebenginehttprequest.cpp qwebenginehttprequest.h
+ qwebengineloadinginfo.cpp qwebengineloadinginfo.h
+ qwebenginemessagepumpscheduler.cpp qwebenginemessagepumpscheduler_p.h
+ qwebenginenavigationrequest.cpp qwebenginenavigationrequest.h
+ qwebenginenewwindowrequest.cpp qwebenginenewwindowrequest.h qwebenginenewwindowrequest_p.h
+ qwebenginenotification.cpp qwebenginenotification.h
+ qwebenginepage.cpp qwebenginepage.h qwebenginepage_p.h
+ qwebengineprofile.cpp qwebengineprofile.h qwebengineprofile_p.h
+ qwebenginequotarequest.cpp qwebenginequotarequest.h
+ qwebengineregisterprotocolhandlerrequest.cpp qwebengineregisterprotocolhandlerrequest.h
+ qwebenginescript.cpp qwebenginescript.h
+ qwebenginescriptcollection.cpp qwebenginescriptcollection.h qwebenginescriptcollection_p.h
+ qwebenginesettings.cpp qwebenginesettings.h
+ qwebengineurlrequestinfo.cpp qwebengineurlrequestinfo.h qwebengineurlrequestinfo_p.h
+ qwebengineurlrequestinterceptor.h qwebengineurlrequestinterceptor.cpp
+ qwebengineurlrequestjob.cpp qwebengineurlrequestjob.h
+ qwebengineurlscheme.cpp qwebengineurlscheme.h
+ qwebengineurlschemehandler.cpp qwebengineurlschemehandler.h
+ qwebengineglobalsettings.cpp qwebengineglobalsettings.h qwebengineglobalsettings_p.h
+ qwebenginewebauthuxrequest.cpp qwebenginewebauthuxrequest.h qwebenginewebauthuxrequest_p.h
+ DEFINES
+ BUILDING_CHROMIUM
+ INCLUDE_DIRECTORIES
+ ../
+ ../../3rdparty/chromium
+ ../../3rdparty/chromium/third_party/abseil-cpp
+ ../../3rdparty/chromium/third_party/perfetto/include
+ ../../3rdparty/chromium/third_party/boringssl/src/include
+ LIBRARIES
+ Qt::CorePrivate
+ Qt::GuiPrivate
+ Qt::QuickPrivate
+ PUBLIC_LIBRARIES
+ Qt::Core
+ Qt::Gui
+ Qt::Network
+ Qt::Quick
+ EXTRA_CMAKE_FILES
+ "${CMAKE_CURRENT_LIST_DIR}/${INSTALL_CMAKE_NAMESPACE}WebEngineCoreDeploySupport.cmake"
+ NO_GENERATE_CPP_EXPORTS
+)
+
+set_target_properties(WebEngineCore PROPERTIES QTWEBENGINEPROCESS_NAME ${qtWebEngineProcessName})
+set_target_properties(WebEngineCore PROPERTIES CXX_STANDARD 20)
+
+# Chromium included headers are not clean
+qt_skip_warnings_are_errors(WebEngineCore)
+
+if(CLANG OR GCC)
+ target_compile_options(WebEngineCore PRIVATE
+ "-Wno-unused-parameter"
+ "-Wno-expansion-to-defined"
+ )
+endif()
+
+if(GCC)
+ target_compile_options(WebEngineCore PRIVATE
+ "-Wno-packed-not-aligned"
+ )
+endif()
+
+qt_internal_extend_target(WebEngineCore CONDITION QT_FEATURE_webengine_webchannel
+ PUBLIC_LIBRARIES
+ Qt::WebChannel
+)
+qt_internal_extend_target(WebEngineCore CONDITION QT_FEATURE_webengine_geolocation
+ PUBLIC_LIBRARIES
+ Qt::Positioning
+)
+
+get_install_config(config)
+get_architectures(archs)
+get_configs(configs)
+list(GET archs 0 arch)
+
+##
+# DOCS
+##
+
+qt_internal_add_docs(WebEngineCore
+ ../doc/qtwebengine.qdocconf
+)
+
+add_code_attributions_target(
+ TARGET generate_chromium_attributions
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/chromium_attributions.qdoc
+ GN_TARGET :QtWebEngineCore
+ FILE_TEMPLATE ../doc/about_credits.tmpl
+ ENTRY_TEMPLATE ../doc/about_credits_entry.tmpl
+ BUILDDIR ${buildDir}/${config}/${arch}
+)
+add_dependencies(generate_chromium_attributions run_core_GnDone)
+add_dependencies(prepare_docs_WebEngineCore generate_chromium_attributions)
+
+##
+# WEBENGINECORE RESOURCES
+##
+
+#TODO: use simply filter / globbing-expressions
+set(localeList am ar bg bn ca cs da de el en-GB en-US es-419 es et fa fi fil fr
+ gu he hi hr hu id it ja kn ko lt lv ml mr ms nb nl pl pt-BR pt-PT ro ru sk
+ sl sr sv sw ta te th tr uk vi zh-CN zh-TW)
+
+set(resourceList qtwebengine_resources.pak
+ qtwebengine_resources_100p.pak
+ qtwebengine_resources_200p.pak
+ qtwebengine_devtools_resources.pak)
+
+set(stamps ${buildDir}/${config}/${arch}/QtWebEngineCore.stamp)
+
+qt_internal_get_filename_path_mode(path_mode)
+
+if(QT_FEATURE_webengine_v8_context_snapshot)
+ foreach(arch ${archs})
+ foreach(config ${configs})
+ if(MACOS)
+ set(ext_arch ".${arch}")
+ # QTBUG-118120 gn does not support x86_64h
+ if(ext_arch STREQUAL "x86_64h")
+ set(ext_arch "x86_64")
+ endif()
+ else()
+ unset(ext_arch)
+ endif()
+ if("${config}" STREQUAL "Debug")
+ set(ext_debug ".debug")
+ else()
+ unset(ext_debug)
+ endif()
+ get_filename_component(resSourcePath ${buildDir}/${config}/${arch}/v8_context_snapshot${ext_arch}${ext_debug}.bin ${path_mode})
+ list(APPEND resourceFiles ${resSourcePath})
+ if(MACOS)
+ set(stamps ${stamps} ${buildDir}/${config}/${arch}/obj/tools/v8_context_snapshot/v8_context_snapshot.stamp)
+ endif()
+ endforeach()
+ endforeach()
+endif()
+
+foreach(loc ${localeList})
+ get_filename_component(locSourcePath ${buildDir}/${config}/${arch}/qtwebengine_locales/${loc}.pak ${path_mode})
+ list(APPEND localeFiles ${locSourcePath})
+endforeach()
+
+foreach(res ${resourceList})
+ get_filename_component(resSourcePath ${buildDir}/${config}/${arch}/${res} ${path_mode})
+ list(APPEND resourceFiles ${resSourcePath})
+endforeach()
+
+
+if(NOT QT_FEATURE_webengine_system_icu)
+ get_filename_component(icuFile ${buildDir}/${config}/${arch}/icudtl.dat ${path_mode})
+ list(APPEND resourceFiles ${icuFile})
+ set_target_properties(WebEngineCore PROPERTIES ICUDTL_FILE ${icuFile})
+endif()
+
+if(QT_FEATURE_framework)
+ set(allResourceFiles ${localeFiles} ${resourceFiles})
+ target_sources(WebEngineCore PRIVATE ${allResourceFiles})
+
+ set_source_files_properties(${localeFiles}
+ TARGET_DIRECTORY WebEngineCore
+ PROPERTIES MACOSX_PACKAGE_LOCATION Resources/qtwebengine_locales
+ GENERATED TRUE
+ )
+ set_source_files_properties(${resourceFiles}
+ TARGET_DIRECTORY WebEngineCore
+ PROPERTIES MACOSX_PACKAGE_LOCATION Resources
+ GENERATED TRUE
+ )
+
+ add_custom_command(OUTPUT ${allResourceFiles} DEPENDS "${stamps}")
+ add_custom_target(generate_resources_${config} DEPENDS ${allResourceFiles})
+
+ addCopyCommand(WebEngineCore "${localeFiles}"
+ "${QT_BUILD_DIR}/${INSTALL_LIBDIR}/QtWebEngineCore.framework/Versions/A/Resources/qtwebengine_locales/"
+ )
+ addCopyCommand(WebEngineCore "${resourceFiles}"
+ "${QT_BUILD_DIR}/${INSTALL_LIBDIR}/QtWebEngineCore.framework/Versions/A/Resources/"
+ )
+
+else()
+ install(FILES ${localeFiles}
+ DESTINATION ${INSTALL_TRANSLATIONSDIR}/qtwebengine_locales
+ CONFIGURATIONS ${config}
+ )
+ install(FILES ${resourceFiles}
+ DESTINATION ${INSTALL_DATADIR}/resources
+ CONFIGURATIONS ${config}
+ )
+ if(QT_SUPERBUILD OR NOT QT_WILL_INSTALL)
+ addCopyCommand(WebEngineCore "${localeFiles}"
+ ${QT_BUILD_DIR}/${INSTALL_TRANSLATIONSDIR}/qtwebengine_locales
+ )
+ addCopyCommand(WebEngineCore "${resourceFiles}"
+ ${QT_BUILD_DIR}/${INSTALL_DATADIR}/resources
+ )
+ endif()
+endif()
diff --git a/src/core/api/Qt6WebEngineCoreDeploySupport.cmake b/src/core/api/Qt6WebEngineCoreDeploySupport.cmake
new file mode 100644
index 000000000..e67eb212b
--- /dev/null
+++ b/src/core/api/Qt6WebEngineCoreDeploySupport.cmake
@@ -0,0 +1,173 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+# NOTE: This code should only ever be executed in script mode. It expects to be
+# used either as part of an install(CODE) call or called by a script
+# invoked via cmake -P as a POST_BUILD step. It would not normally be
+# included directly, it should be pulled in automatically by the deploy
+# support set up by qtbase.
+
+cmake_minimum_required(VERSION 3.16...3.21)
+
+_qt_internal_add_deployment_hook(_qt_internal_webenginecore_deploy_hook)
+
+if(NOT QT_DEPLOY_WEBENGINECORE_RESOURCES_DIR)
+ set(QT_DEPLOY_WEBENGINECORE_RESOURCES_DIR "resources")
+endif()
+
+function(_qt_internal_webenginecore_status_message)
+ if(__QT_DEPLOY_VERBOSE)
+ message(STATUS ${ARGV})
+ endif()
+endfunction()
+
+function(_qt_internal_webenginecore_deploy_hook)
+ set(no_value_options "")
+ set(single_value_options "")
+ set(multi_value_options RESOLVED_DEPENDENCIES)
+ cmake_parse_arguments(PARSE_ARGV 0 arg
+ "${no_value_options}" "${single_value_options}" "${multi_value_options}"
+ )
+
+ set(webenginecore_dependency_found FALSE)
+ foreach(dependency IN LISTS arg_RESOLVED_DEPENDENCIES)
+ if(dependency MATCHES "/libQt[0-9]+WebEngineCore[^/]+")
+ set(webenginecore_dependency_found TRUE)
+ break()
+ endif()
+ endforeach()
+
+ if(NOT webenginecore_dependency_found)
+ _qt_internal_webenginecore_status_message(
+ "No QtWebEngineCore dependency found. "
+ "Skipping deployment of QtWebEngine assets."
+ )
+ return()
+ endif()
+
+ _qt_internal_deploy_webenginecore()
+endfunction()
+
+function(_qt_internal_deploy_webenginecore)
+ _qt_internal_deploy_webenginecore_binary()
+ _qt_internal_deploy_webenginecore_data()
+ _qt_internal_deploy_webenginecore_translations()
+endfunction()
+
+function(_qt_internal_deploy_webenginecore_binary)
+ _qt_internal_webenginecore_status_message("Deploying the WebEngineCore process binary")
+
+ set(candidates "QtWebEngineProcess")
+ if(__QT_DEPLOY_ACTIVE_CONFIG STREQUAL "Debug" AND __QT_DEPLOY_SYSTEM_NAME STREQUAL "Windows")
+ list(PREPEND candidates "QtWebEngineProcessd")
+ endif()
+
+ list(TRANSFORM candidates
+ PREPEND "${__QT_DEPLOY_QT_INSTALL_PREFIX}/${__QT_DEPLOY_QT_INSTALL_LIBEXECS}/"
+ )
+
+ set(process_path "")
+ foreach(file_path IN LISTS candidates)
+ if(EXISTS "${file_path}")
+ set(process_path "${file_path}")
+ break()
+ endif()
+ endforeach()
+
+ set(install_destination "${QT_DEPLOY_PREFIX}/")
+ if(__QT_DEPLOY_SYSTEM_NAME STREQUAL "Windows")
+ string(APPEND install_destination "${QT_DEPLOY_BIN_DIR}")
+ else()
+ string(APPEND install_destination "${QT_DEPLOY_LIBEXEC_DIR}")
+ endif()
+ file(INSTALL "${process_path}" DESTINATION "${install_destination}")
+
+ get_filename_component(process_file_name "${process_path}" NAME)
+ if(CMAKE_VERSION GREATER_EQUAL "3.19")
+ file(CHMOD "${install_destination}/${process_file_name}"
+ PERMISSIONS OWNER_EXECUTE OWNER_READ OWNER_WRITE
+ GROUP_EXECUTE GROUP_READ
+ WORLD_EXECUTE WORLD_READ
+ )
+ else()
+ execute_process(
+ COMMAND chmod 0755 "${install_destination}/${process_file_name}"
+ )
+ endif()
+endfunction()
+
+function(_qt_internal_deploy_webenginecore_data)
+ _qt_internal_webenginecore_status_message("Deploying the WebEngineCore data files")
+ set(data_files
+ icudtl.dat
+ qtwebengine_devtools_resources.pak
+ qtwebengine_resources.pak
+ qtwebengine_resources_100p.pak
+ qtwebengine_resources_200p.pak
+ )
+ get_filename_component(resources_dir "resources" ABSOLUTE
+ BASE_DIR "${__QT_DEPLOY_QT_INSTALL_PREFIX}/${__QT_DEPLOY_QT_INSTALL_DATA}"
+ )
+
+ _qt_internal_webenginecore_find_v8_context_snapshot(
+ snapshot_file
+ RESOURCES_DIR "${resources_dir}"
+ )
+ if(NOT snapshot_file STREQUAL "")
+ list(APPEND data_files "${snapshot_file}")
+ endif()
+
+ get_filename_component(install_destination "${QT_DEPLOY_WEBENGINECORE_RESOURCES_DIR}" ABSOLUTE
+ BASE_DIR "${QT_DEPLOY_PREFIX}/${QT_DEPLOY_DATA_DIR}"
+ )
+ foreach(data_file IN LISTS data_files)
+ file(INSTALL "${resources_dir}/${data_file}" DESTINATION "${install_destination}")
+ endforeach()
+endfunction()
+
+# The V8 snapshot file comes as debug or release build. Multi-config builds have both, a self-built
+# Qt might only have the debug one.
+#
+# This function returns the file name of the V8 context snapshot file in ${out_var}.
+# If no snapshot could be found, ${out_var} is the empty string.
+function(_qt_internal_webenginecore_find_v8_context_snapshot out_var)
+ set(no_value_options "")
+ set(single_value_options RESOURCES_DIR)
+ set(multi_value_options "")
+ cmake_parse_arguments(PARSE_ARGV 1 arg
+ "${no_value_options}" "${single_value_options}" "${multi_value_options}"
+ )
+
+ set(result "")
+ set(candidates
+ v8_context_snapshot.bin
+ v8_context_snapshot.debug.bin
+ )
+ if(__QT_DEPLOY_QT_IS_MULTI_CONFIG_BUILD_WITH_DEBUG
+ AND __QT_DEPLOY_ACTIVE_CONFIG STREQUAL "Debug")
+ # Favor the debug version of the snapshot.
+ list(REVERSE candidates)
+ endif()
+ foreach(candidate IN LISTS candidates)
+ if(EXISTS "${arg_RESOURCES_DIR}/${candidate}")
+ set(result "${candidate}")
+ break()
+ endif()
+ endforeach()
+ set("${out_var}" "${result}" PARENT_SCOPE)
+endfunction()
+
+function(_qt_internal_deploy_webenginecore_translations)
+ _qt_internal_webenginecore_status_message("Deploying the WebEngineCore translations")
+
+ get_filename_component(locales_dir "qtwebengine_locales" ABSOLUTE
+ BASE_DIR "${__QT_DEPLOY_QT_INSTALL_PREFIX}/${__QT_DEPLOY_QT_INSTALL_TRANSLATIONS}"
+ )
+ get_filename_component(install_destination "qtwebengine_locales" ABSOLUTE
+ BASE_DIR "${QT_DEPLOY_PREFIX}/${QT_DEPLOY_TRANSLATIONS_DIR}"
+ )
+ file(GLOB locale_files "${locales_dir}/*.pak")
+ foreach(locale_file IN LISTS locale_files)
+ file(INSTALL "${locale_file}" DESTINATION "${install_destination}")
+ endforeach()
+endfunction()
diff --git a/src/core/api/Qt6WebEngineCoreMacros.cmake b/src/core/api/Qt6WebEngineCoreMacros.cmake
new file mode 100644
index 000000000..8bb731548
--- /dev/null
+++ b/src/core/api/Qt6WebEngineCoreMacros.cmake
@@ -0,0 +1,74 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+# Install support uses the CMAKE_INSTALL_xxxDIR variables. Include this here
+# so that it is more likely to get pulled in earlier at a higher level, and also
+# to avoid re-including it many times later
+include(GNUInstallDirs)
+_qt_internal_add_deploy_support("${CMAKE_CURRENT_LIST_DIR}/Qt6WebEngineCoreDeploySupport.cmake")
+
+function(qt6_add_webengine_dictionary)
+ set(options)
+ set(oneValueArgs TARGET SOURCE OUTPUT_DIRECTORY)
+ set(multiValueArgs)
+
+ cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+
+ if (NOT ARGS_SOURCE OR NOT EXISTS "${ARGS_SOURCE}" OR NOT IS_ABSOLUTE "${ARGS_SOURCE}")
+ message(FATAL_ERROR "Function qt_add_webengine_dictionary requires an absolute path to SOURCE dictionary.")
+ endif()
+
+ if (NOT ARGS_OUTPUT_DIRECTORY)
+ set(ARGS_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
+ endif()
+
+ get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
+ get_target_property(isBundle ${ARGS_TARGET} MACOSX_BUNDLE)
+ if(isMultiConfig)
+ set(spellcheckerDir ${ARGS_OUTPUT_DIRECTORY}/dict/qtwebengine_dictionaries)
+ set(copyCommand COMMAND ${CMAKE_COMMAND} -E copy_directory ${ARGS_OUTPUT_DIRECTORY}/dict
+ ${ARGS_OUTPUT_DIRECTORY}/$<CONFIG>
+ )
+ elseif(APPLE AND isBundle)
+ get_target_property(outputName ${ARGS_TARGET} OUTPUT_NAME)
+ if(NOT outputName)
+ set(outputName ${ARGS_TARGET})
+ endif()
+ set(spellcheckerDir "${ARGS_OUTPUT_DIRECTORY}/${outputName}.app/Contents/Resources/qtwebengine_dictionaries")
+ else()
+ set(spellcheckerDir ${ARGS_OUTPUT_DIRECTORY}/qtwebengine_dictionaries)
+ endif()
+
+ get_filename_component(dictName ${ARGS_SOURCE} NAME_WE)
+ add_custom_command(
+ OUTPUT ${spellcheckerDir}/${dictName}.bdic
+ DEPENDS ${ARGS_SOURCE}
+ COMMENT "Running qwebengine_convert_dict for ${ARGS_SOURCE}"
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${spellcheckerDir}
+ COMMAND ${CMAKE_COMMAND} -E env
+ $<TARGET_FILE:${QT_CMAKE_EXPORT_NAMESPACE}::qwebengine_convert_dict>
+ ${ARGS_SOURCE} ${spellcheckerDir}/${dictName}.bdic
+ ${copyCommand}
+ )
+ set(global_dict_target "qtwebengine_dictionaries")
+ if(NOT TARGET ${global_dict_target})
+ add_custom_target(${global_dict_target})
+ endif()
+
+ # in case of large project gen target should have unique name since it can collide, use TARGET
+ if (ARGS_TARGET)
+ add_custom_target(gen-${ARGS_TARGET}-${dictName} DEPENDS ${spellcheckerDir}/${dictName}.bdic)
+ add_dependencies(${ARGS_TARGET} gen-${ARGS_TARGET}-${dictName})
+ add_dependencies(${global_dict_target} gen-${ARGS_TARGET}-${dictName})
+ else()
+ add_custom_target(gen-${dictName} DEPENDS ${spellcheckerDir}/${dictName}.bdic)
+ add_dependencies(${global_dict_target} gen-${dictName})
+ endif()
+
+endfunction()
+
+if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
+ function(qt_add_webengine_dictionary)
+ qt6_add_webengine_dictionary(${ARGN})
+ endfunction()
+endif()
diff --git a/src/core/api/configure.cmake b/src/core/api/configure.cmake
new file mode 100644
index 000000000..f8488c057
--- /dev/null
+++ b/src/core/api/configure.cmake
@@ -0,0 +1,255 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+#### Libraries
+
+if(NOT QT_CONFIGURE_RUNNING)
+ find_package(GLIB2 COMPONENTS GIO)
+ find_package(GSSAPI)
+ find_package(PkgConfig)
+ if(PkgConfig_FOUND AND QT_FEATURE_pkg_config)
+ pkg_check_modules(ALSA alsa IMPORTED_TARGET)
+ pkg_check_modules(PULSEAUDIO libpulse>=0.9.10 libpulse-mainloop-glib)
+ pkg_check_modules(XDAMAGE xdamage)
+ pkg_check_modules(POPPLER_CPP poppler-cpp IMPORTED_TARGET)
+ pkg_check_modules(GBM gbm)
+ pkg_check_modules(LIBVA libva>=1.14)
+ if(NOT GIO_FOUND)
+ pkg_check_modules(GIO gio-2.0)
+ endif()
+ endif()
+ find_package(Cups)
+
+ find_package(Qt6 ${PROJECT_VERSION} CONFIG QUIET
+ OPTIONAL_COMPONENTS Positioning WebChannel PrintSupport)
+endif()
+
+#### Tests
+
+qt_config_compile_test(poppler
+ LABEL "poppler"
+ LIBRARIES
+ PkgConfig::POPPLER_CPP
+ CODE
+"
+#include <poppler-document.h>
+
+int main() {
+ auto *pdf = poppler::document::load_from_raw_data(\"file\",100,std::string(\"user\"));
+}"
+)
+
+qt_config_compile_test(alsa
+ LABEL "alsa"
+ LIBRARIES
+ PkgConfig::ALSA
+ CODE
+"
+#include \"alsa/asoundlib.h\"
+#if SND_LIB_VERSION < 0x1000a // 1.0.10
+#error Alsa version found too old, require >= 1.0.10
+#endif
+int main(){};
+")
+
+#### Features
+
+qt_feature("webengine-embedded-build" PRIVATE
+ LABEL "Embedded build"
+ PURPOSE "Enables the embedded build configuration."
+ AUTODETECT CMAKE_CROSSCOMPILING
+ CONDITION UNIX
+)
+qt_feature("webengine-system-alsa" PRIVATE
+ LABEL "Use ALSA"
+ CONDITION UNIX AND TEST_alsa
+)
+qt_feature("webengine-v8-context-snapshot" PRIVATE
+ LABEL "Use v8 context snapshot"
+ AUTODETECT NOT CMAKE_CROSSCOMPILING
+)
+qt_feature("webengine-geolocation" PUBLIC
+ LABEL "Geolocation"
+ CONDITION TARGET Qt::Positioning
+)
+qt_feature("webengine-system-pulseaudio" PRIVATE
+ LABEL "Use PulseAudio"
+ AUTODETECT UNIX
+ CONDITION PULSEAUDIO_FOUND
+)
+qt_feature("webengine-system-gbm" PRIVATE
+ SECTION "WebEngine"
+ LABEL "Use system GBM"
+ AUTODETECT UNIX
+ CONDITION GBM_FOUND
+)
+qt_feature("webengine-printing-and-pdf" PRIVATE
+ LABEL "Printing and PDF"
+ PURPOSE "Provides printing and output to PDF."
+ AUTODETECT NOT QT_FEATURE_webengine_embedded_build
+ CONDITION TARGET Qt::PrintSupport AND QT_FEATURE_printer AND
+ (CUPS_FOUND OR WIN32)
+)
+qt_feature("webengine-pepper-plugins" PRIVATE
+ LABEL "Pepper Plugins"
+ PURPOSE "Enables use of Pepper plugins."
+ AUTODETECT QT_FEATURE_webengine_printing_and_pdf
+)
+qt_feature("webengine-webchannel" PUBLIC
+ SECTION "WebEngine"
+ LABEL "WebChannel support"
+ PURPOSE "Provides QtWebChannel integration."
+ CONDITION TARGET Qt::WebChannel
+)
+qt_feature("webengine-proprietary-codecs" PRIVATE
+ SECTION "WebEngine"
+ LABEL "Proprietary Codecs"
+ PURPOSE "Enables the use of proprietary codecs such as h.264/h.265 and MP3."
+ AUTODETECT OFF
+)
+qt_feature("webengine-kerberos" PRIVATE
+ SECTION "WebEngine"
+ LABEL "Kerberos Authentication"
+ PURPOSE "Enables Kerberos Authentication Support"
+ AUTODETECT WIN32
+ CONDITION NOT LINUX OR GSSAPI_FOUND
+)
+qt_feature("webengine-spellchecker" PUBLIC
+ LABEL "Spellchecker"
+ PURPOSE "Provides a spellchecker."
+)
+qt_feature("webengine-native-spellchecker" PUBLIC
+ LABEL "Native Spellchecker"
+ PURPOSE "Use the system's native spellchecking engine."
+ AUTODETECT OFF
+ CONDITION QT_FEATURE_webengine_spellchecker AND NOT LINUX
+)
+qt_feature("webengine-extensions" PUBLIC
+ SECTION "WebEngine"
+ LABEL "Extensions"
+ PURPOSE "Enables Chromium extensions within certain limits. Currently used by the pdf viewer and hangout webrtc extension."
+ AUTODETECT ON
+ CONDITION QT_FEATURE_webengine_printing_and_pdf OR QT_FEATURE_webengine_webrtc
+)
+qt_feature("webengine-webrtc" PRIVATE
+ LABEL "WebRTC"
+ PURPOSE "Provides WebRTC support."
+ AUTODETECT NOT QT_FEATURE_webengine_embedded_build
+ CONDITION XDAMAGE_FOUND OR NOT QT_FEATURE_webengine_ozone_x11
+)
+qt_feature("webengine-webrtc-pipewire" PRIVATE
+ LABEL "PipeWire over GIO"
+ PURPOSE "Provides PipeWire support in WebRTC using GIO."
+ AUTODETECT false
+ CONDITION QT_FEATURE_webengine_webrtc AND GIO_FOUND
+)
+qt_feature("webengine-full-debug-info" PRIVATE
+ SECTION "WebEngine"
+ LABEL "Full debug information"
+ PURPOSE "Enables debug information for Blink and V8."
+ AUTODETECT OFF
+ CONDITION CMAKE_BUILD_TYPE STREQUAL Debug OR Debug IN_LIST CMAKE_CONFIGURATION_TYPES OR
+ CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo OR RelWithDebInfo IN_LIST CMAKE_CONFIGURATION_TYPES
+)
+qt_feature("webengine-sanitizer" PRIVATE
+ SECTION "WebEngine"
+ LABEL "Sanitizer support"
+ PURPOSE "Enables support for build with sanitizers"
+ AUTODETECT CLANG
+ CONDITION CLANG AND ECM_ENABLE_SANITIZERS
+)
+qt_feature("webengine-vulkan" PRIVATE
+ SECTION "WebEngine"
+ LABEL "Vulkan support"
+ PURPOSE "Enables support for Vulkan rendering"
+ CONDITION QT_FEATURE_vulkan
+)
+qt_feature("webengine-vaapi" PRIVATE
+ SECTION "WebEngine"
+ LABEL "VA-API support"
+ PURPOSE "Enables support for VA-API hardware acceleration"
+ AUTODETECT GBM_FOUND AND LIBVA_FOUND AND QT_FEATURE_vulkan
+ # hardware accelerated encoding requires bundled libvpx
+ CONDITION LINUX AND NOT QT_FEATURE_webengine_system_libvpx
+)
+list(LENGTH CMAKE_OSX_ARCHITECTURES osx_arch_count)
+qt_feature("webenginedriver" PUBLIC
+ SECTION "WebEngine"
+ LABEL "Build WebEngineDriver"
+ PURPOSE "Enables WebEngineDriver build"
+ CONDITION NOT CMAKE_CROSSCOMPILING
+ AND NOT (CMAKE_OSX_ARCHITECTURES AND osx_arch_count GREATER 1)
+ DISABLE CMAKE_BUILD_TYPE STREQUAL Debug
+)
+# internal testing feature
+qt_feature("webengine-system-poppler" PRIVATE
+ LABEL "poppler"
+ CONDITION UNIX AND TEST_poppler
+)
+qt_configure_add_summary_section(NAME "Qt WebEngineCore")
+qt_configure_add_summary_entry(ARGS "webengine-embedded-build")
+qt_configure_add_summary_entry(ARGS "webengine-full-debug-info")
+qt_configure_add_summary_entry(ARGS "webengine-sanitizer")
+qt_configure_add_summary_entry(ARGS "webengine-pepper-plugins")
+qt_configure_add_summary_entry(ARGS "webengine-printing-and-pdf")
+qt_configure_add_summary_entry(ARGS "webengine-proprietary-codecs")
+qt_configure_add_summary_entry(ARGS "webengine-spellchecker")
+qt_configure_add_summary_entry(
+ ARGS "webengine-native-spellchecker"
+ CONDITION NOT LINUX
+)
+qt_configure_add_summary_entry(ARGS "webengine-webrtc")
+qt_configure_add_summary_entry(ARGS "webengine-webrtc-pipewire")
+qt_configure_add_summary_entry(ARGS "webengine-geolocation")
+qt_configure_add_summary_entry(ARGS "webengine-webchannel")
+qt_configure_add_summary_entry(ARGS "webengine-kerberos")
+qt_configure_add_summary_entry(ARGS "webengine-extensions")
+qt_configure_add_summary_entry(
+ ARGS "webengine-ozone-x11"
+ CONDITION UNIX
+)
+qt_configure_add_summary_entry(
+ ARGS "webengine-vulkan"
+ CONDITION QT_FEATURE_vulkan
+)
+qt_configure_add_summary_entry(
+ ARGS "webengine-vaapi"
+ CONDITION LINUX
+)
+qt_configure_add_summary_entry(
+ ARGS "webengine-system-alsa"
+ CONDITION LINUX
+)
+qt_configure_add_summary_entry(
+ ARGS "webengine-system-pulseaudio"
+ CONDITION LINUX
+)
+qt_configure_add_summary_entry(ARGS "webengine-v8-context-snapshot")
+qt_configure_add_summary_entry(ARGS "webenginedriver")
+qt_configure_end_summary_section() # end of "Qt WebEngineCore" section
+if(CMAKE_CROSSCOMPILING)
+ check_thumb(armThumb)
+ qt_configure_add_report_entry(
+ TYPE WARNING
+ MESSAGE "Thumb instruction set is required to build ffmpeg for QtWebEngine."
+ CONDITION LINUX
+ AND NOT QT_FEATURE_webengine_system_ffmpeg
+ AND TEST_architecture_arch MATCHES arm
+ AND NOT armThumb
+ )
+endif()
+qt_configure_add_report_entry(
+ TYPE WARNING
+ MESSAGE "WebRTC requires XDamage with qpa_xcb."
+ CONDITION QT_FEATURE_webengine_ozone_x11 AND NOT XDAMAGE_FOUND
+)
+qt_configure_add_report_entry(
+ TYPE WARNING
+ MESSAGE "VA-API is incompatible with system libvpx."
+ CONDITION QT_FEATURE_webengine_system_libvpx AND QT_FEATURE_webengine_vaapi
+)
+qt_configure_add_report_entry(
+ TYPE WARNING
+ MESSAGE "System GBM is disabled. The bundled minigbm supports Intel only, you might need to install libgbm to avoid rendering issues."
+ CONDITION LINUX AND NOT QT_FEATURE_webengine_system_gbm
+)
diff --git a/src/core/api/core_api.pro b/src/core/api/core_api.pro
deleted file mode 100644
index d53fb6942..000000000
--- a/src/core/api/core_api.pro
+++ /dev/null
@@ -1,86 +0,0 @@
-TARGET = qtwebenginecoreapi$$qtPlatformTargetSuffix()
-DESTDIR = $$OUT_PWD/$$getConfigDir()
-
-TEMPLATE = lib
-
-CONFIG += staticlib
-QT += network core-private webenginecoreheaders-private
-
-# Don't create .prl file for this intermediate library because
-# their contents get used when linking against them, breaking
-# "-Wl,-whole-archive -lqtwebenginecoreapi --Wl,-no-whole-archive"
-CONFIG -= create_prl
-
-# Copy this logic from qt_module.prf so that the intermediate library can be
-# created to the same rules as the final module linking in core_module.pro.
-!host_build:if(win32|mac):!macx-xcode {
- qtConfig(debug_and_release): CONFIG += debug_and_release
- qtConfig(build_all): CONFIG += build_all
-}
-
-DEFINES += \
- BUILDING_CHROMIUM \
- NOMINMAX
-
-CHROMIUM_SRC_DIR = $$QTWEBENGINE_ROOT/$$getChromiumSrcDir()
-CHROMIUM_GEN_DIR = $$OUT_PWD/../$$getConfigDir()/gen
-INCLUDEPATH += $$QTWEBENGINE_ROOT/src/core \
- $$CHROMIUM_GEN_DIR \
- $$CHROMIUM_SRC_DIR
-
-gcc: QMAKE_CXXFLAGS_WARN_ON = -Wno-unused-parameter
-
-HEADERS = \
- qwebenginecallback.h \
- qwebenginecallback_p.h \
- qwebengineclientcertificatestore.h \
- qtwebenginecoreglobal.h \
- qtwebenginecoreglobal_p.h \
- qwebenginecookiestore.h \
- qwebenginecookiestore_p.h \
- qwebenginefindtextresult.h \
- qwebenginehttprequest.h \
- qwebenginemessagepumpscheduler_p.h \
- qwebenginenotification.h \
- qwebenginequotarequest.h \
- qwebengineregisterprotocolhandlerrequest.h \
- qwebengineurlrequestinterceptor.h \
- qwebengineurlrequestinfo.h \
- qwebengineurlrequestinfo_p.h \
- qwebengineurlrequestjob.h \
- qwebengineurlscheme.h \
- qwebengineurlschemehandler.h
-
-SOURCES = \
- qtwebenginecoreglobal.cpp \
- qwebengineclientcertificatestore.cpp \
- qwebenginecookiestore.cpp \
- qwebenginefindtextresult.cpp \
- qwebenginehttprequest.cpp \
- qwebenginemessagepumpscheduler.cpp \
- qwebenginenotification.cpp \
- qwebenginequotarequest.cpp \
- qwebengineregisterprotocolhandlerrequest.cpp \
- qwebengineurlrequestinfo.cpp \
- qwebengineurlrequestjob.cpp \
- qwebengineurlscheme.cpp \
- qwebengineurlschemehandler.cpp
-
-### Qt6 Remove this workaround
-unix:!isEmpty(QMAKE_LFLAGS_VERSION_SCRIPT):!static {
- SOURCES += qtbug-60565.cpp \
- qtbug-61521.cpp
-}
-
-# Chromium headers included are not remotely clean
-CONFIG -= warning_clean
-
-msvc {
- # Create a list of object files that can be used as response file for the linker.
- # This is done to simulate -whole-archive on MSVC.
- QMAKE_POST_LINK = \
- "if exist $(DESTDIR_TARGET).objects del $(DESTDIR_TARGET).objects$$escape_expand(\\n\\t)" \
- "for %%a in ($(OBJECTS)) do echo $$shell_quote($$shell_path($$OUT_PWD))\\%%a >> $(DESTDIR_TARGET).objects"
-}
-
-load(qt_common)
diff --git a/src/core/api/qt_cmdline.cmake b/src/core/api/qt_cmdline.cmake
new file mode 100644
index 000000000..fe7092b8c
--- /dev/null
+++ b/src/core/api/qt_cmdline.cmake
@@ -0,0 +1,34 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_commandline_option(webengine-embedded-build TYPE boolean)
+qt_commandline_option(webengine-pepper-plugins TYPE boolean)
+qt_commandline_option(webengine-printing-and-pdf TYPE boolean)
+qt_commandline_option(webengine-proprietary-codecs TYPE boolean)
+qt_commandline_option(webengine-spellchecker TYPE boolean)
+qt_commandline_option(webengine-native-spellchecker TYPE boolean)
+qt_commandline_option(webengine-webrtc TYPE boolean)
+qt_commandline_option(webengine-full-debug-info TYPE boolean)
+qt_commandline_option(webengine-sanitizer TYPE boolean)
+
+qt_commandline_option(webengine-jumbo-build TYPE jumbo)
+function(qt_commandline_jumbo arg val nextok)
+ if ("${val}" STREQUAL "")
+ qtConfGetNextCommandlineArg(val)
+ endif()
+ if ("${val}" STREQUAL "no")
+ qtConfCommandlineSetInput(webengine_jumbo_file_merge_limit 0)
+ elseif("${val}" STREQUAL "")
+ qtConfCommandlineSetInput(webengine_jumbo_file_merge_limit 8)
+ elseif (val MATCHES "[0-9]+")
+ qtConfCommandlineSetInput(webengine_jumbo_file_merge_limit ${val})
+ else()
+ qtConfAddError("Invalid argument '${val}' to command line parameter '${arg}'")
+ endif()
+endfunction()
+
+set(systemLibs alsa ffmpeg freetype harfbuzz icu lcms2 libevent libjpeg
+ libpng libvpx libxml libwebp minizip opus pulseaudio re2 snappy zlib)
+foreach(slib ${systemLibs})
+ qt_commandline_option(webengine-${slib} TYPE enum NAME webengine-system-${slib} VALUES yes no system)
+endforeach()
diff --git a/src/core/api/qtbug-60565.cpp b/src/core/api/qtbug-60565.cpp
deleted file mode 100644
index f48a2a701..000000000
--- a/src/core/api/qtbug-60565.cpp
+++ /dev/null
@@ -1,138 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <new>
-#include <unistd.h>
-
-#if defined(__LP64__)
-# define SIZE_T_MANGLING "m"
-#else
-# define SIZE_T_MANGLING "j"
-#endif
-
-#define SHIM_ALIAS_SYMBOL(fn) __attribute__((weak, alias(#fn)))
-#define SHIM_HIDDEN __attribute__ ((visibility ("hidden")))
-
-extern "C" {
-
-__asm__(".symver __ShimCppNew, _Znw" SIZE_T_MANGLING "@Qt_5");
-void* __ShimCppNew(size_t size)
- SHIM_ALIAS_SYMBOL(ShimCppNew);
-
-__asm__(".symver __ShimCppDelete, _ZdlPv@Qt_5");
-void __ShimCppDelete(void* address)
- SHIM_ALIAS_SYMBOL(ShimCppDelete);
-
-__asm__(".symver __ShimCppNewArray, _Zna" SIZE_T_MANGLING "@Qt_5");
-void* __ShimCppNewArray(size_t size)
- SHIM_ALIAS_SYMBOL(ShimCppNewArray);
-
-__asm__(".symver __ShimCppDeleteArray, _ZdaPv@Qt_5");
-void __ShimCppDeleteArray(void* address)
- SHIM_ALIAS_SYMBOL(ShimCppDeleteArray);
-
-__asm__(".symver __ShimCppNewNoThrow, _Znw" SIZE_T_MANGLING "RKSt9nothrow_t@Qt_5");
-void *__ShimCppNewNoThrow(size_t size, const std::nothrow_t&) noexcept
- SHIM_ALIAS_SYMBOL(ShimCppNewNoThrow);
-
-__asm__(".symver __ShimCppNewArrayNoThrow, _Zna" SIZE_T_MANGLING "RKSt9nothrow_t@Qt_5");
-void *__ShimCppNewArrayNoThrow(size_t size, const std::nothrow_t&) noexcept
- SHIM_ALIAS_SYMBOL(ShimCppNewArrayNoThrow);
-
-__asm__(".symver __ShimCppDeleteNoThrow, _ZdlPvRKSt9nothrow_t@Qt_5");
-void __ShimCppDeleteNoThrow(void* address, const std::nothrow_t&) noexcept
- SHIM_ALIAS_SYMBOL(ShimCppDeleteNoThrow);
-
-__asm__(".symver __ShimCppDeleteArrayNoThrow, _ZdaPvRKSt9nothrow_t@Qt_5");
-void __ShimCppDeleteArrayNoThrow(void* address, const std::nothrow_t&) noexcept
- SHIM_ALIAS_SYMBOL(ShimCppDeleteArrayNoThrow);
-
-static void* __shimCppNew(size_t size);
-static void* __shimCppNewArray(size_t size);
-static void __shimCppDelete(void *address);
-static void __shimCppDeleteArray(void *address);
-
-SHIM_HIDDEN void* ShimCppNew(size_t size) {
- return __shimCppNew(size);
-}
-
-SHIM_HIDDEN void* ShimCppNewNoThrow(size_t size, const std::nothrow_t&) noexcept {
- return __shimCppNew(size);
-}
-
-SHIM_HIDDEN void* ShimCppNewArray(size_t size) {
- return __shimCppNewArray(size);
-}
-
-SHIM_HIDDEN void* ShimCppNewArrayNoThrow(size_t size, const std::nothrow_t&) noexcept {
- return __shimCppNewArray(size);
-}
-
-SHIM_HIDDEN void ShimCppDelete(void* address) {
- __shimCppDelete(address);
-}
-
-SHIM_HIDDEN void ShimCppDeleteNoThrow(void* address, const std::nothrow_t&) noexcept {
- __shimCppDelete(address);
-}
-
-SHIM_HIDDEN void ShimCppDeleteArray(void* address) {
- __shimCppDeleteArray(address);
-}
-
-SHIM_HIDDEN void ShimCppDeleteArrayNoThrow(void* address, const std::nothrow_t&) noexcept {
- __shimCppDeleteArray(address);
-}
-} // extern "C"
-
-static void* __shimCppNew(size_t size) {
- return operator new(size);
-}
-
-static void* __shimCppNewArray(size_t size) {
- return operator new[](size);
-}
-
-static void __shimCppDelete(void* address) {
- operator delete(address);
-}
-
-static void __shimCppDeleteArray(void* address) {
- operator delete[](address);
-}
diff --git a/src/core/api/qtbug-61521.cpp b/src/core/api/qtbug-61521.cpp
deleted file mode 100644
index 002a1af22..000000000
--- a/src/core/api/qtbug-61521.cpp
+++ /dev/null
@@ -1,120 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <stdlib.h>
-#include <malloc.h>
-
-#define SHIM_ALIAS_SYMBOL(fn) __attribute__((weak, alias(#fn)))
-#define SHIM_SYMBOL_VERSION(fn) __asm__(".symver __" #fn "," #fn "@Qt_5")
-#define SHIM_HIDDEN __attribute__ ((visibility ("hidden")))
-
-extern "C" {
-
-SHIM_SYMBOL_VERSION(malloc);
-void* __malloc(size_t size)
- SHIM_ALIAS_SYMBOL(ShimMalloc);
-
-SHIM_SYMBOL_VERSION(free);
-void __free(void* ptr)
- SHIM_ALIAS_SYMBOL(ShimFree);
-
-SHIM_SYMBOL_VERSION(realloc);
-void* __realloc(void* ptr, size_t size)
- SHIM_ALIAS_SYMBOL(ShimRealloc);
-
-SHIM_SYMBOL_VERSION(calloc);
-void* __calloc(size_t n, size_t size)
- SHIM_ALIAS_SYMBOL(ShimCalloc);
-
-SHIM_SYMBOL_VERSION(cfree);
-void __cfree(void* ptr)
- SHIM_ALIAS_SYMBOL(ShimCFree);
-
-SHIM_SYMBOL_VERSION(memalign);
-void* __memalign(size_t align, size_t s)
- SHIM_ALIAS_SYMBOL(ShimMemalign);
-
-SHIM_SYMBOL_VERSION(valloc);
-void* __valloc(size_t size)
- SHIM_ALIAS_SYMBOL(ShimValloc);
-
-SHIM_SYMBOL_VERSION(pvalloc);
-void* __pvalloc(size_t size)
- SHIM_ALIAS_SYMBOL(ShimPvalloc);
-
-SHIM_SYMBOL_VERSION(posix_memalign);
-int __posix_memalign(void** r, size_t a, size_t s)
- SHIM_ALIAS_SYMBOL(ShimPosixMemalign);
-
-SHIM_HIDDEN void* ShimMalloc(size_t size) {
- return malloc(size);
-}
-
-SHIM_HIDDEN void ShimFree(void* ptr) {
- free(ptr);
-}
-
-SHIM_HIDDEN void* ShimRealloc(void* ptr, size_t size) {
- return realloc(ptr,size);
-}
-
-SHIM_HIDDEN void* ShimCalloc(size_t n, size_t size) {
- return calloc(n,size);
-}
-
-SHIM_HIDDEN void ShimCFree(void* ptr) {
- free(ptr);
-}
-
-SHIM_HIDDEN void* ShimMemalign(size_t align, size_t s) {
- return memalign(align,s);
-}
-
-SHIM_HIDDEN void* ShimValloc(size_t size) {
- return valloc(size);
-}
-
-SHIM_HIDDEN void* ShimPvalloc(size_t size) {
- return pvalloc(size);
-}
-
-SHIM_HIDDEN int ShimPosixMemalign(void** r, size_t a, size_t s) {
- return posix_memalign(r,a,s);
-}
-} // extern "C"
diff --git a/src/core/api/qtwebenginecoreglobal.cpp b/src/core/api/qtwebenginecoreglobal.cpp
index ce4362741..d5112ccb3 100644
--- a/src/core/api/qtwebenginecoreglobal.cpp
+++ b/src/core/api/qtwebenginecoreglobal.cpp
@@ -1,81 +1,31 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qtwebenginecoreglobal_p.h"
#include <QGuiApplication>
#if QT_CONFIG(opengl)
# include <QOpenGLContext>
-#ifdef Q_OS_MACOS
-#include <sys/types.h>
-#include <sys/sysctl.h>
-#endif
#endif
#include <QThread>
+#include <QQuickWindow>
+#include "web_engine_context.h"
+#include "web_engine_library_info.h"
-#if QT_CONFIG(opengl)
+#include "base/base_paths.h"
+#include "base/i18n/icu_util.h"
+#include "base/path_service.h"
+#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
+
+#if QT_CONFIG(opengl) && !defined(Q_OS_MACOS)
QT_BEGIN_NAMESPACE
Q_GUI_EXPORT void qt_gl_set_global_share_context(QOpenGLContext *context);
Q_GUI_EXPORT QOpenGLContext *qt_gl_global_share_context();
QT_END_NAMESPACE
#endif
-#if QT_CONFIG(opengl)
-#ifdef Q_OS_MACOS
-static bool needsOfflineRendererWorkaround()
-{
- size_t hwmodelsize = 0;
-
- if (sysctlbyname("hw.model", nullptr, &hwmodelsize, nullptr, 0) == -1)
- return false;
-
- char hwmodel[hwmodelsize];
- if (sysctlbyname("hw.model", &hwmodel, &hwmodelsize, nullptr, 0) == -1)
- return false;
-
- return QString::fromLatin1(hwmodel) == QLatin1String("MacPro6,1");
-}
-#endif
-#endif
-
namespace QtWebEngineCore {
-#if QT_CONFIG(opengl)
+#if QT_CONFIG(opengl) && !defined(Q_OS_MACOS)
static QOpenGLContext *shareContext;
static void deleteShareContext()
@@ -88,52 +38,105 @@ static void deleteShareContext()
#endif
// ### Qt 6: unify this logic and Qt::AA_ShareOpenGLContexts.
-// QtWebEngine::initialize was introduced first and meant to be called
+// QtWebEngineQuick::initialize was introduced first and meant to be called
// after the QGuiApplication creation, when AA_ShareOpenGLContexts fills
// the same need but the flag has to be set earlier.
-Q_WEBENGINECORE_PRIVATE_EXPORT void initialize()
+Q_WEBENGINECORE_EXPORT void initialize()
{
-#if QT_CONFIG(opengl)
+#if QT_CONFIG(opengl) && !defined(Q_OS_MACOS)
#ifdef Q_OS_WIN32
qputenv("QT_D3DCREATE_MULTITHREADED", "1");
#endif
-#ifdef Q_OS_MACOS
- if (needsOfflineRendererWorkaround())
- qputenv("QT_MAC_PRO_WEBENGINE_WORKAROUND", "1");
+ auto api = QQuickWindow::graphicsApi();
+ if (api != QSGRendererInterface::OpenGL
+#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0)
+ && api != QSGRendererInterface::Vulkan && api != QSGRendererInterface::Metal
+ && api != QSGRendererInterface::Direct3D11
#endif
+ )
+ QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL);
// No need to override the shared context if QApplication already set one (e.g with Qt::AA_ShareOpenGLContexts).
- if (qt_gl_global_share_context())
- return;
+ if (!qt_gl_global_share_context()) {
- QCoreApplication *app = QCoreApplication::instance();
- if (!app) {
- qFatal("QtWebEngine::initialize() but no core application instance.");
- return;
- }
+ QCoreApplication *app = QCoreApplication::instance();
+ if (!app) {
+ qFatal("QtWebEngineQuick::initialize() but no core application instance.");
+ return;
+ }
- // Bail out silently if the user did not construct a QGuiApplication.
- if (!qobject_cast<QGuiApplication *>(app))
- return;
+ // Bail out silently if the user did not construct a QGuiApplication.
+ if (!qobject_cast<QGuiApplication *>(app))
+ return;
- if (app->thread() != QThread::currentThread()) {
- qFatal("QtWebEngine::initialize() must be called from the Qt gui thread.");
- return;
+ if (app->thread() != QThread::currentThread()) {
+ qFatal("QtWebEngineQuick::initialize() must be called from the Qt gui thread.");
+ return;
+ }
+
+ if (shareContext)
+ return;
+
+ shareContext = new QOpenGLContext;
+ QSurfaceFormat format = QSurfaceFormat::defaultFormat();
+
+ shareContext->setFormat(format);
+ shareContext->create();
+ qAddPostRoutine(deleteShareContext);
+ qt_gl_set_global_share_context(shareContext);
+
+ // Classes like QOpenGLWidget check for the attribute
+ app->setAttribute(Qt::AA_ShareOpenGLContexts);
}
- if (shareContext)
- return;
+#endif // QT_CONFIG(opengl) && !defined(Q_OS_MACOS)
+}
- shareContext = new QOpenGLContext;
- QSurfaceFormat format = QSurfaceFormat::defaultFormat();
-// format.setOption(QSurfaceFormat::ResetNotification);
- shareContext->setFormat(format);
- shareContext->create();
- qAddPostRoutine(deleteShareContext);
- qt_gl_set_global_share_context(shareContext);
+bool closingDown()
+{
+ return WebEngineContext::closingDown();
+}
- // Classes like QOpenGLWidget check for the attribute
- app->setAttribute(Qt::AA_ShareOpenGLContexts);
+} // namespace QtWebEngineCore
+
+#if defined(Q_OS_WIN)
+namespace QtWebEngineSandbox {
+sandbox::SandboxInterfaceInfo *staticSandboxInterfaceInfo(sandbox::SandboxInterfaceInfo *info)
+{
+ static sandbox::SandboxInterfaceInfo *g_info = nullptr;
+ if (info) {
+ Q_ASSERT(g_info == nullptr);
+ g_info = info;
+ }
+ return g_info;
+}
+} //namespace
+#endif
+static void initialize()
+{
+#if QT_CONFIG(opengl) && !defined(Q_OS_MACOS)
+ // QCoreApplication is not yet instantiated, ensuring the call will be deferred
+ qAddPreRoutine(QtWebEngineCore::initialize);
#endif // QT_CONFIG(opengl)
}
-} // namespace QtWebEngineCore
+
+QT_BEGIN_NAMESPACE
+
+QString qWebEngineGetDomainAndRegistry(const QUrl &url) {
+ base::FilePath icuDataPath;
+ // Let's assume that ICU is already initialized if DIR_QT_LIBRARY_DATA is set.
+ if (!base::PathService::Get(base::DIR_QT_LIBRARY_DATA, &icuDataPath)) {
+ icuDataPath = WebEngineLibraryInfo::getPath(base::DIR_QT_LIBRARY_DATA);
+ if (!base::PathService::OverrideAndCreateIfNeeded(base::DIR_QT_LIBRARY_DATA, icuDataPath, false, false))
+ qWarning("Failed to set ICU data path.");
+ base::i18n::InitializeICU();
+ }
+
+ const QString host = url.host();
+ const std::string domain = net::registry_controlled_domains::GetDomainAndRegistry(host.toStdString(), net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES);
+ return QString::fromStdString(domain);
+}
+
+QT_END_NAMESPACE
+
+Q_CONSTRUCTOR_FUNCTION(initialize)
diff --git a/src/core/api/qtwebenginecoreglobal.h b/src/core/api/qtwebenginecoreglobal.h
index c425d1478..0041a72be 100644
--- a/src/core/api/qtwebenginecoreglobal.h
+++ b/src/core/api/qtwebenginecoreglobal.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QTWEBENGINECOREGLOBAL_H
#define QTWEBENGINECOREGLOBAL_H
@@ -45,6 +9,8 @@
QT_BEGIN_NAMESPACE
+class QUrl;
+
#if defined(BUILDING_CHROMIUM)
# define Q_WEBENGINECORE_EXPORT Q_DECL_EXPORT
#else
@@ -53,6 +19,13 @@ QT_BEGIN_NAMESPACE
#define ASSERT_ENUMS_MATCH(A, B) Q_STATIC_ASSERT_X(static_cast<int>(A) == static_cast<int>(B), "The enum values must match");
+Q_WEBENGINECORE_EXPORT Q_DECL_CONST_FUNCTION const char *qWebEngineVersion() noexcept;
+Q_WEBENGINECORE_EXPORT Q_DECL_CONST_FUNCTION const char *qWebEngineProcessName() noexcept;
+Q_WEBENGINECORE_EXPORT Q_DECL_CONST_FUNCTION const char *qWebEngineChromiumVersion() noexcept;
+Q_WEBENGINECORE_EXPORT Q_DECL_CONST_FUNCTION const char *qWebEngineChromiumSecurityPatchVersion() noexcept;
+
+Q_WEBENGINECORE_EXPORT QString qWebEngineGetDomainAndRegistry(const QUrl &url);
+
QT_END_NAMESPACE
#endif // QTWEBENGINECOREGLOBAL_H
diff --git a/src/core/api/qtwebenginecoreglobal_p.h b/src/core/api/qtwebenginecoreglobal_p.h
index 655b2a814..a63568c8a 100644
--- a/src/core/api/qtwebenginecoreglobal_p.h
+++ b/src/core/api/qtwebenginecoreglobal_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QTWEBENGINECOREGLOBAL_P_H
#define QTWEBENGINECOREGLOBAL_P_H
@@ -63,6 +27,17 @@
#define QT_NOT_USED Q_UNREACHABLE(); // This will assert in debug.
#endif
-#define Q_WEBENGINECORE_PRIVATE_EXPORT Q_WEBENGINECORE_EXPORT
-
+namespace QtWebEngineCore {
+Q_WEBENGINECORE_EXPORT int processMain(int argc, const char **argv);
+Q_WEBENGINECORE_EXPORT bool closingDown();
+} // namespace
+#if defined(Q_OS_WIN)
+namespace sandbox {
+struct SandboxInterfaceInfo;
+}
+namespace QtWebEngineSandbox {
+Q_WEBENGINECORE_EXPORT sandbox::SandboxInterfaceInfo *staticSandboxInterfaceInfo(sandbox::SandboxInterfaceInfo *info = nullptr);
+void initializeStaticCopy(int argc, const char **argv);
+}
+#endif
#endif // QTWEBENGINECOREGLOBAL_P_H
diff --git a/src/core/api/qwebenginecallback.h b/src/core/api/qwebenginecallback.h
deleted file mode 100644
index 49efc50b2..000000000
--- a/src/core/api/qwebenginecallback.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWEBENGINECALLBACK_H
-#define QWEBENGINECALLBACK_H
-
-#include <QtWebEngineCore/qtwebenginecoreglobal.h>
-
-#include <QtCore/qshareddata.h>
-#include <QtCore/qstring.h>
-#include <QtCore/qvariant.h>
-
-namespace QtWebEngineCore {
-class CallbackDirectory;
-}
-
-QT_BEGIN_NAMESPACE
-
-namespace QtWebEnginePrivate {
-
-template<typename T>
-class QWebEngineCallbackPrivateBase : public QSharedData {
-public:
- QWebEngineCallbackPrivateBase() {}
- virtual ~QWebEngineCallbackPrivateBase() {}
- virtual void operator()(T) = 0;
-};
-
-template<typename T, typename F>
-class QWebEngineCallbackPrivate : public QWebEngineCallbackPrivateBase<T> {
-public:
- QWebEngineCallbackPrivate(F callable) : m_callable(callable) {}
- void operator()(T value) override { m_callable(value); }
-
-private:
- F m_callable;
-};
-
-} // namespace QtWebEnginePrivate
-
-template<typename T>
-class QWebEngineCallback {
-public:
- template<typename F>
- QWebEngineCallback(F f)
- : d(new QtWebEnginePrivate::QWebEngineCallbackPrivate<T, F>(f))
- {}
- QWebEngineCallback() {}
- void swap(QWebEngineCallback &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
- operator bool() const { return d; }
-
-private:
- friend class QtWebEngineCore::CallbackDirectory;
- QExplicitlySharedDataPointer<QtWebEnginePrivate::QWebEngineCallbackPrivateBase<T>> d;
-};
-
-Q_DECLARE_SHARED(QWebEngineCallback<int>)
-Q_DECLARE_SHARED(QWebEngineCallback<const QByteArray &>)
-Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QWebEngineCallback<bool>)
-Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QWebEngineCallback<const QString &>)
-Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QWebEngineCallback<const QVariant &>)
-
-QT_END_NAMESPACE
-
-#endif // QWEBENGINECALLBACK_H
diff --git a/src/core/api/qwebenginecallback_p.h b/src/core/api/qwebenginecallback_p.h
deleted file mode 100644
index 133a86f6d..000000000
--- a/src/core/api/qwebenginecallback_p.h
+++ /dev/null
@@ -1,253 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWEBENGINECALLBACK_P_H
-#define QWEBENGINECALLBACK_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "qtwebenginecoreglobal_p.h"
-#include "qwebenginecallback.h"
-
-#include <QByteArray>
-#include <QHash>
-#include <QSharedData>
-#include <QString>
-#include <QVariant>
-#include <type_traits>
-
-// keep in sync with Q_DECLARE_SHARED... in qwebenginecallback.h
-#define FOR_EACH_TYPE(F) \
- F(bool) \
- F(int) \
- F(const QString &) \
- F(const QByteArray &) \
- F(const QVariant &)
-
-namespace QtWebEngineCore {
-
-class CallbackDirectory {
- template<typename T>
- void invokeInternal(quint64 callbackId, T result);
- template<typename T>
- void invokeEmptyInternal(QtWebEnginePrivate::QWebEngineCallbackPrivateBase<T> *callback);
-
-public:
- ~CallbackDirectory()
- {
- // "Cancel" pending callbacks by calling them with an invalid value.
- // This guarantees that each callback is called exactly once.
- for (CallbackSharedDataPointerBase *const sharedPtrBase : m_callbackMap) {
- Q_ASSERT(sharedPtrBase);
- sharedPtrBase->invokeEmpty();
- delete sharedPtrBase;
- }
- }
-
- enum ReservedCallbackIds {
- NoCallbackId = 0,
- DeleteCookieCallbackId,
- DeleteSessionCookiesCallbackId,
- DeleteAllCookiesCallbackId,
- GetAllCookiesCallbackId,
-
- // Place reserved id's before this.
- ReservedCallbackIdsEnd
- };
-
- template<typename T>
- void registerCallback(quint64 callbackId, const QWebEngineCallback<T> &callback);
-
- template<typename T>
- void invokeEmpty(const QWebEngineCallback<T> &callback);
-
-#define DEFINE_INVOKE_FOR_TYPE(Type) \
- void invoke(quint64 callbackId, Type result) { invokeInternal<Type>(callbackId, std::forward<Type>(result)); }
- FOR_EACH_TYPE(DEFINE_INVOKE_FOR_TYPE)
-#undef DEFINE_INVOKE_FOR_TYPE
-
- template<typename A>
- void invokeDirectly(const QWebEngineCallback<typename std::remove_reference<A>::type &> &callback, A &argument)
- {
- return callback.d.data()->operator()(argument);
- }
-
- template<typename A>
- void invokeDirectly(const QWebEngineCallback<typename std::remove_reference<A>::type> &callback, const A &argument)
- {
- return callback.d.data()->operator()(std::forward<const A &>(argument));
- }
-
-private:
- struct CallbackSharedDataPointerBase {
- virtual ~CallbackSharedDataPointerBase() {}
- virtual void invokeEmpty() = 0;
- virtual void doRef() = 0;
- virtual void doDeref() = 0;
- virtual operator bool() const = 0;
- };
-
- template<typename T>
- struct CallbackSharedDataPointer : public CallbackSharedDataPointerBase {
- CallbackDirectory *parent;
- QtWebEnginePrivate::QWebEngineCallbackPrivateBase<T> *callback;
-
- ~CallbackSharedDataPointer() { doDeref(); }
- CallbackSharedDataPointer() : parent(0), callback(0) {}
- CallbackSharedDataPointer(const CallbackSharedDataPointer<T> &other)
- : parent(other.parent), callback(other.callback)
- {
- doRef();
- }
- CallbackSharedDataPointer(CallbackDirectory *p, QtWebEnginePrivate::QWebEngineCallbackPrivateBase<T> *c)
- : parent(p), callback(c)
- {
- Q_ASSERT(callback);
- doRef();
- }
-
- void invokeEmpty() override;
- operator bool() const override { return callback; }
-
- private:
- void doRef() override;
- void doDeref() override;
- };
-
- QHash<quint64, CallbackSharedDataPointerBase *> m_callbackMap;
-};
-
-template<typename T>
-inline void CallbackDirectory::registerCallback(quint64 callbackId, const QWebEngineCallback<T> &callback)
-{
- if (!callback.d)
- return;
- m_callbackMap.insert(callbackId, new CallbackSharedDataPointer<T>(this, callback.d.data()));
-}
-
-template<typename T>
-inline void CallbackDirectory::invokeInternal(quint64 callbackId, T result)
-{
- CallbackSharedDataPointerBase *const sharedPtrBase = m_callbackMap.take(callbackId);
- if (!sharedPtrBase)
- return;
-
- auto ptr = static_cast<CallbackSharedDataPointer<T> *>(sharedPtrBase);
- Q_ASSERT(ptr);
- (*ptr->callback)(std::forward<T>(result));
- delete ptr;
-}
-
-template<typename T>
-inline void CallbackDirectory::invokeEmptyInternal(QtWebEnginePrivate::QWebEngineCallbackPrivateBase<T> *callback)
-{
- Q_ASSERT(callback);
- using NoRefT = typename std::remove_reference<T>::type;
- using NoConstNoRefT = typename std::remove_const<NoRefT>::type;
- NoConstNoRefT t;
- (*callback)(t);
-}
-
-template<>
-inline void CallbackDirectory::invokeEmptyInternal(QtWebEnginePrivate::QWebEngineCallbackPrivateBase<bool> *callback)
-{
- Q_ASSERT(callback);
- (*callback)(false);
-}
-
-template<>
-inline void CallbackDirectory::invokeEmptyInternal(QtWebEnginePrivate::QWebEngineCallbackPrivateBase<int> *callback)
-{
- Q_ASSERT(callback);
- (*callback)(0);
-}
-
-template<typename T>
-inline void CallbackDirectory::invokeEmpty(const QWebEngineCallback<T> &callback)
-{
- if (!callback.d)
- return;
-
- invokeEmptyInternal(callback.d.data());
-}
-
-template<typename T>
-inline void CallbackDirectory::CallbackSharedDataPointer<T>::doRef()
-{
- if (!callback)
- return;
-
- callback->ref.ref();
-}
-
-template<typename T>
-inline void CallbackDirectory::CallbackSharedDataPointer<T>::doDeref()
-{
- if (!callback)
- return;
- if (!callback->ref.deref())
- delete callback;
-}
-
-template<typename T>
-inline void CallbackDirectory::CallbackSharedDataPointer<T>::invokeEmpty()
-{
- if (!callback)
- return;
-
- Q_ASSERT(parent);
- parent->invokeEmptyInternal(callback);
-}
-
-#define CHECK_RELOCATABLE(x) Q_STATIC_ASSERT((QTypeInfoQuery<QWebEngineCallback<x>>::isRelocatable));
-FOR_EACH_TYPE(CHECK_RELOCATABLE)
-#undef CHECK_RELOCATABLE
-
-} // namespace QtWebEngineCore
-
-#endif // QWEBENGINECALLBACK_P_H
diff --git a/src/core/api/qwebenginecertificateerror.cpp b/src/core/api/qwebenginecertificateerror.cpp
new file mode 100644
index 000000000..90d8a542d
--- /dev/null
+++ b/src/core/api/qwebenginecertificateerror.cpp
@@ -0,0 +1,162 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qwebenginecertificateerror.h"
+
+#include "certificate_error_controller.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QWebEngineCertificateError
+ \brief The QWebEngineCertificateError class provides information about a certificate error.
+ \since 5.4
+ \inmodule QtWebEngineCore
+
+ Provides information about a certificate error. This class is used as a parameter of
+ QWebEnginePage::certificateError().
+*/
+
+/*! \internal
+*/
+QWebEngineCertificateError::QWebEngineCertificateError(
+ const QSharedPointer<QtWebEngineCore::CertificateErrorController> &controller)
+ : d(controller)
+{
+}
+
+QWebEngineCertificateError::QWebEngineCertificateError(const QWebEngineCertificateError &) = default;
+
+QWebEngineCertificateError& QWebEngineCertificateError::operator=(const QWebEngineCertificateError &) = default;
+
+/*! \internal
+*/
+QWebEngineCertificateError::~QWebEngineCertificateError() = default;
+
+/*!
+ \enum QWebEngineCertificateError::Type
+
+ This enum describes the type of certificate error encountered.
+
+ The values of this enum type match the SSL errors Chromium provides.
+ QSslError::SslError values are not used directly, because the Qt error
+ categories cannot be mapped to the Chromium error categories.
+
+ \value SslPinnedKeyNotInCertificateChain The certificate did not match the built-in public keys
+ pinned for the host name.
+ \value CertificateCommonNameInvalid The certificate's common name did not match the host name.
+ \value CertificateDateInvalid The certificate is not valid at the current date and time.
+ \value CertificateAuthorityInvalid The certificate is not signed by a trusted authority.
+ \value CertificateContainsErrors The certificate contains errors.
+ \value CertificateNoRevocationMechanism The certificate has no mechanism for determining if it has been revoked.
+ \value CertificateUnableToCheckRevocation Revocation information for the certificate is not available.
+ \value CertificateRevoked The certificate has been revoked.
+ \value CertificateInvalid The certificate is invalid.
+ \value CertificateWeakSignatureAlgorithm The certificate is signed using a weak signature algorithm.
+ \value CertificateNonUniqueName The host name specified in the certificate is not unique.
+ \value CertificateWeakKey The certificate contains a weak key.
+ \value CertificateNameConstraintViolation The certificate claimed DNS names that are in violation of name constraints.
+ \value CertificateValidityTooLong The certificate has a validity period that is too long. (Added in Qt 5.7)
+ \value CertificateTransparencyRequired Certificate Transparency was required for this connection, but the server
+ did not provide CT information that complied with the policy. (Added in Qt 5.8)
+ \value CertificateKnownInterceptionBlocked The certificate is known to be
+ used for interception by an entity other the device owner. (Added in
+ 5.15)
+ \value SslObsoleteVersion The connection uses an obsolete version of SSL/TLS. (Added in Qt 6.2, deprecated in Qt 6.4)
+ \value CertificateSymantecLegacy The certificate is a legacy Symantec one that's no longer valid. (Added in Qt 6.2)
+*/
+
+/*!
+ \property QWebEngineCertificateError::overridable
+ \brief Whether this error can be overridden and accepted.
+
+ \sa description()
+*/
+bool QWebEngineCertificateError::isOverridable() const
+{
+ return d->overridable();
+}
+
+/*!
+ Returns the URL that triggered the error.
+
+ \sa description()
+*/
+QUrl QWebEngineCertificateError::url() const
+{
+ return d->url();
+}
+
+/*!
+ Returns the type of the error.
+
+ \sa description(), isOverridable()
+*/
+QWebEngineCertificateError::Type QWebEngineCertificateError::type() const
+{
+ return d->error();
+}
+
+/*!
+ Returns a short localized human-readable description of the error.
+
+ \sa url(), isOverridable()
+*/
+QString QWebEngineCertificateError::description() const
+{
+ return d->errorString();
+}
+
+/*!
+ \since 5.14
+
+ Marks the certificate error for delayed handling.
+
+ This function should be called when there is a need to postpone the decision whether to accept a
+ certificate, for example, while waiting for user input. When called, the function pauses the
+ URL request until acceptCertificate() or rejectCertificate() is called.
+
+ \note It is only possible to defer overridable certificate errors.
+
+ \sa isOverridable()
+*/
+void QWebEngineCertificateError::defer()
+{
+ d->defer();
+}
+
+/*!
+ \since 5.14
+
+ Accepts the certificate and continues the loading of the requested URL.
+*/
+void QWebEngineCertificateError::acceptCertificate()
+{
+ d->ignoreCertificateError();
+}
+
+/*!
+ \since 5.14
+
+ Rejects the certificate and aborts the loading of the requested URL.
+*/
+void QWebEngineCertificateError::rejectCertificate()
+{
+ d->rejectCertificate();
+}
+
+/*!
+ \since 5.14
+
+ Returns the peer's chain of digital certificates.
+
+ Chain starts with the peer's immediate certificate and ending with the CA's certificate.
+*/
+QList<QSslCertificate> QWebEngineCertificateError::certificateChain() const
+{
+ return d->certificateChain();
+}
+
+QT_END_NAMESPACE
+
+#include "moc_qwebenginecertificateerror.cpp"
diff --git a/src/core/api/qwebenginecertificateerror.h b/src/core/api/qwebenginecertificateerror.h
new file mode 100644
index 000000000..c4a3585f4
--- /dev/null
+++ b/src/core/api/qwebenginecertificateerror.h
@@ -0,0 +1,78 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QWEBENGINECERTIFICATEERROR_H
+#define QWEBENGINECERTIFICATEERROR_H
+
+#include <QtWebEngineCore/qtwebenginecoreglobal.h>
+
+#include <QtCore/qsharedpointer.h>
+#include <QtCore/qurl.h>
+#include <QtNetwork/qsslcertificate.h>
+
+namespace QtWebEngineCore {
+class WebContentsDelegateQt;
+class CertificateErrorController;
+}
+
+QT_BEGIN_NAMESPACE
+
+class Q_WEBENGINECORE_EXPORT QWebEngineCertificateError
+{
+ Q_GADGET
+ Q_PROPERTY(QUrl url READ url CONSTANT FINAL)
+ Q_PROPERTY(Type type READ type CONSTANT FINAL)
+ Q_PROPERTY(QString description READ description CONSTANT FINAL)
+ Q_PROPERTY(bool overridable READ isOverridable CONSTANT FINAL)
+
+public:
+ QWebEngineCertificateError(const QWebEngineCertificateError &other);
+ QWebEngineCertificateError &operator=(const QWebEngineCertificateError &other);
+ ~QWebEngineCertificateError();
+
+ // Keep this identical to NET_ERROR in net_error_list.h, or add mapping layer.
+ enum Type {
+ SslPinnedKeyNotInCertificateChain = -150,
+ CertificateCommonNameInvalid = -200,
+ CertificateDateInvalid = -201,
+ CertificateAuthorityInvalid = -202,
+ CertificateContainsErrors = -203,
+ CertificateNoRevocationMechanism = -204,
+ CertificateUnableToCheckRevocation = -205,
+ CertificateRevoked = -206,
+ CertificateInvalid = -207,
+ CertificateWeakSignatureAlgorithm = -208,
+ CertificateNonUniqueName = -210,
+ CertificateWeakKey = -211,
+ CertificateNameConstraintViolation = -212,
+ CertificateValidityTooLong = -213,
+ CertificateTransparencyRequired = -214,
+ CertificateSymantecLegacy = -215,
+ CertificateKnownInterceptionBlocked = -217,
+ SslObsoleteVersion = -218,
+ };
+ Q_ENUM(Type)
+
+ Type type() const;
+ QUrl url() const;
+ bool isOverridable() const;
+ QString description() const;
+
+ Q_INVOKABLE void defer();
+ Q_INVOKABLE void rejectCertificate();
+ Q_INVOKABLE void acceptCertificate();
+
+ QList<QSslCertificate> certificateChain() const;
+
+private:
+ friend class QtWebEngineCore::WebContentsDelegateQt;
+ QWebEngineCertificateError(
+ const QSharedPointer<QtWebEngineCore::CertificateErrorController> &controller);
+ QSharedPointer<QtWebEngineCore::CertificateErrorController> d;
+};
+
+QT_END_NAMESPACE
+
+Q_DECLARE_METATYPE(QWebEngineCertificateError)
+
+#endif // QWEBENGINECERTIFICATEERROR_H
diff --git a/src/core/api/qwebengineclientcertificateselection.cpp b/src/core/api/qwebengineclientcertificateselection.cpp
new file mode 100644
index 000000000..d6402353c
--- /dev/null
+++ b/src/core/api/qwebengineclientcertificateselection.cpp
@@ -0,0 +1,88 @@
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qwebengineclientcertificateselection.h"
+#include "client_cert_select_controller.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QWebEngineClientCertificateSelection
+ \brief The QWebEngineClientCertSelection class wraps a client certificate selection.
+ \since 5.12
+ \inmodule QtWebEngineCore
+
+ When a web site requests an SSL client certificate, and one or more certificates
+ are found in the system's client certificate store, this class provides access to
+ the certificates to choose from, as well as a method for selecting one.
+
+ The selection is asynchronous. If no certificate is selected and no copy of the
+ object is kept alive, loading will continue without a certificate.
+
+ \sa QWebEnginePage::selectClientCertificate()
+*/
+
+/*! \internal
+*/
+QWebEngineClientCertificateSelection::QWebEngineClientCertificateSelection(
+ QSharedPointer<QtWebEngineCore::ClientCertSelectController> selectController)
+ : d_ptr(selectController)
+{}
+
+QWebEngineClientCertificateSelection::QWebEngineClientCertificateSelection(const QWebEngineClientCertificateSelection &other)
+ : d_ptr(other.d_ptr)
+{}
+
+QWebEngineClientCertificateSelection &QWebEngineClientCertificateSelection::operator=(const QWebEngineClientCertificateSelection &other)
+{
+ d_ptr = other.d_ptr;
+ return *this;
+}
+
+QWebEngineClientCertificateSelection::~QWebEngineClientCertificateSelection()
+{
+}
+
+/*!
+ Returns the client certificates available to choose from.
+
+ \sa select()
+*/
+QList<QSslCertificate> QWebEngineClientCertificateSelection::certificates() const
+{
+ return d_ptr->certificates();
+}
+
+/*!
+ Selects the client certificate \a certificate. The certificate must be one
+ of those offered in certificates().
+
+ \sa certificates(), selectNone()
+*/
+void QWebEngineClientCertificateSelection::select(const QSslCertificate &certificate)
+{
+ d_ptr->select(certificate);
+}
+
+/*!
+ Continue without using any of the offered certificates. This is the same
+ action as taken when destroying the last copy of this object if no
+ selection has been made.
+
+ \sa select()
+*/
+void QWebEngineClientCertificateSelection::selectNone()
+{
+ d_ptr->selectNone();
+}
+
+/*!
+ Returns the host and port of the server requesting the client certificate.
+*/
+QUrl QWebEngineClientCertificateSelection::host() const
+{
+ return d_ptr->hostAndPort();
+}
+
+QT_END_NAMESPACE
+
diff --git a/src/core/api/qwebengineclientcertificateselection.h b/src/core/api/qwebengineclientcertificateselection.h
new file mode 100644
index 000000000..559d1753b
--- /dev/null
+++ b/src/core/api/qwebengineclientcertificateselection.h
@@ -0,0 +1,44 @@
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QWEBENGINECLIENTCERTSELECTION_H
+#define QWEBENGINECLIENTCERTSELECTION_H
+
+#include <QtWebEngineCore/qtwebenginecoreglobal.h>
+#include <QtNetwork/qtnetwork-config.h>
+#include <QtCore/qlist.h>
+#include <QtCore/qscopedpointer.h>
+#include <QtNetwork/qsslcertificate.h>
+
+namespace QtWebEngineCore {
+class ClientCertSelectController;
+}
+
+QT_BEGIN_NAMESPACE
+
+class Q_WEBENGINECORE_EXPORT QWebEngineClientCertificateSelection
+{
+public:
+ QWebEngineClientCertificateSelection(const QWebEngineClientCertificateSelection &);
+ ~QWebEngineClientCertificateSelection();
+
+ QWebEngineClientCertificateSelection &operator=(const QWebEngineClientCertificateSelection &);
+
+ QUrl host() const;
+
+ void select(const QSslCertificate &certificate);
+ void selectNone();
+ QList<QSslCertificate> certificates() const;
+
+private:
+ friend class QWebEnginePagePrivate;
+
+ QWebEngineClientCertificateSelection(
+ QSharedPointer<QtWebEngineCore::ClientCertSelectController>);
+
+ QSharedPointer<QtWebEngineCore::ClientCertSelectController> d_ptr;
+};
+
+QT_END_NAMESPACE
+
+#endif // QWEBENGINECLIENTCERTSELECTION_H
diff --git a/src/core/api/qwebengineclientcertificatestore.cpp b/src/core/api/qwebengineclientcertificatestore.cpp
index 84f273328..3d231c05f 100644
--- a/src/core/api/qwebengineclientcertificatestore.cpp
+++ b/src/core/api/qwebengineclientcertificatestore.cpp
@@ -1,47 +1,10 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qwebengineclientcertificatestore.h"
#include "net/client_cert_store_data.h"
-#include <QByteArray>
#include <QList>
QT_BEGIN_NAMESPACE
@@ -57,7 +20,21 @@ QT_BEGIN_NAMESPACE
The class allows to store client certificates in an in-memory store.
When a web site requests an SSL client certificate, the QWebEnginePage::selectClientCertificate
signal is emitted with matching certificates from the native certificate store or the in-memory store.
- The getInstance() method can be used to access the single instance of the class.
+
+ The class instance can be obtained with the QWebEngineProfile::clientCertificateStore() method.
+
+ \code
+ QFile certFile(":/resouces/certificate.crt");
+ certFile.open(QIODevice::ReadOnly);
+ const QSslCertificate cert(certFile.readAll(), QSsl::Pem);
+
+ QFile keyFile(":/resources/privatekey.key");
+ keyFile.open(QIODevice::ReadOnly);
+ const QSslKey sslKey(keyFile.readAll(), QSsl::Rsa, QSsl::Pem, QSsl::PrivateKey, "");
+
+ QWebEngineProfile profile;
+ profile.clientCertificateStore()->add(cert, sslKey);
+ \endcode
*/
QWebEngineClientCertificateStore::QWebEngineClientCertificateStore(QtWebEngineCore::ClientCertificateStoreData *storeData)
@@ -88,10 +65,10 @@ void QWebEngineClientCertificateStore::add(const QSslCertificate &certificate, c
Returns an empty list if the store does not contain any certificates.
*/
-QVector<QSslCertificate> QWebEngineClientCertificateStore::certificates() const
+QList<QSslCertificate> QWebEngineClientCertificateStore::certificates() const
{
- QVector<QSslCertificate> certificateList;
- for (auto data : qAsConst(m_storeData->extraCerts))
+ QList<QSslCertificate> certificateList;
+ for (auto data : std::as_const(m_storeData->extraCerts))
certificateList.append(data->certificate);
return certificateList;
}
diff --git a/src/core/api/qwebengineclientcertificatestore.h b/src/core/api/qwebengineclientcertificatestore.h
index a4c83bb2e..fcebbe2b1 100644
--- a/src/core/api/qwebengineclientcertificatestore.h
+++ b/src/core/api/qwebengineclientcertificatestore.h
@@ -1,48 +1,14 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QWEBENGINECLIENTCERTIFICATESTORE_H
#define QWEBENGINECLIENTCERTIFICATESTORE_H
#include <QtWebEngineCore/qtwebenginecoreglobal.h>
+#include <QtNetwork/qtnetwork-config.h>
-#include <QtCore/qvector.h>
+#if QT_CONFIG(ssl)
+#include <QtCore/qlist.h>
#include <QtNetwork/qsslcertificate.h>
#include <QtNetwork/qsslkey.h>
@@ -53,13 +19,12 @@ class ProfileAdapter;
QT_BEGIN_NAMESPACE
-#if QT_CONFIG(ssl)
-
-class Q_WEBENGINECORE_EXPORT QWebEngineClientCertificateStore {
+class Q_WEBENGINECORE_EXPORT QWebEngineClientCertificateStore
+{
public:
void add(const QSslCertificate &certificate, const QSslKey &privateKey);
- QVector<QSslCertificate> certificates() const;
+ QList<QSslCertificate> certificates() const;
void remove(const QSslCertificate &certificate);
void clear();
@@ -72,8 +37,7 @@ private:
QtWebEngineCore::ClientCertificateStoreData *m_storeData;
};
-#endif // QT_CONFIG(ssl)
-
QT_END_NAMESPACE
+#endif // QT_CONFIG(ssl)
#endif // QWebEngineClientCertificateStore_H
diff --git a/src/core/api/qwebengineclienthints.cpp b/src/core/api/qwebengineclienthints.cpp
new file mode 100644
index 000000000..907d4ae76
--- /dev/null
+++ b/src/core/api/qwebengineclienthints.cpp
@@ -0,0 +1,211 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qwebengineclienthints.h"
+
+#include "profile_adapter.h"
+
+#include <QJsonObject>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QWebEngineClientHints
+ \brief The QWebEngineClientHints class provides an object to customize User-Agent Client Hints used by a profile.
+
+ \since 6.8
+
+ \inmodule QtWebEngineCore
+
+ QWebEngineClientHints allows configuration of exposing browser and platform information via
+ User-Agent response and request headers, and a JavaScript API.
+
+ The information accessed via this API is split into two groups: low entropy and high entropy hints.
+ Low entropy hints (\l{QWebEngineClientHints::platform}{platform} and \l{QWebEngineClientHints::mobile}{mobile})
+ are those that do not give away much information; the API makes these accessible with every request and they can not
+ be disabled by QWebEngineClientHints::setAllClientHintsEnabled.
+
+ All the others are high entropy hints; they have the potential to give away more information, therefore they can be
+ disabled by QWebEngineClientHints::setAllClientHintsEnabled.
+
+ Each profile object has its own QWebEngineClientHints object, which configures the
+ Client Hint settings for that browsing context. If a Client Hint is not configured for a web engine
+ profile, its default value is deduced from the system.
+
+ \sa QWebEngineProfile::clientHints(), QQuickWebEngineProfile::clientHints()
+*/
+
+QWebEngineClientHints::QWebEngineClientHints(QtWebEngineCore::ProfileAdapter *profileAdapter)
+ : m_profileAdapter(profileAdapter)
+{
+}
+
+QWebEngineClientHints::~QWebEngineClientHints()
+{
+}
+
+/*!
+ \property QWebEngineClientHints::arch
+ The value of the \c{Sec-CH-UA-Arch} HTTP header and \c{architecture} member of NavigatorUAData in JavaScript.
+*/
+QString QWebEngineClientHints::arch() const
+{
+ return m_profileAdapter->clientHint(QtWebEngineCore::ProfileAdapter::UAArchitecture).toString();
+}
+
+/*!
+ \property QWebEngineClientHints::platform
+ The value of the \c{Sec-CH-UA-Platform} HTTP header and \c{platform} member of NavigatorUAData in JavaScript.
+
+ Can not be disabled.
+*/
+QString QWebEngineClientHints::platform() const
+{
+ return m_profileAdapter->clientHint(QtWebEngineCore::ProfileAdapter::UAPlatform).toString();
+}
+
+/*!
+ \property QWebEngineClientHints::model
+ The value of the \c{Sec-CH-UA-Model} HTTP header and \c{model} member of NavigatorUAData in JavaScript.
+*/
+QString QWebEngineClientHints::model() const
+{
+ return m_profileAdapter->clientHint(QtWebEngineCore::ProfileAdapter::UAModel).toString();
+}
+
+/*!
+ \property QWebEngineClientHints::mobile
+ The value of the \c{Sec-CH-UA-Mobile} HTTP header and \c{mobile} member of NavigatorUAData in JavaScript.
+
+ Can not be disabled.
+*/
+bool QWebEngineClientHints::isMobile() const
+{
+ return m_profileAdapter->clientHint(QtWebEngineCore::ProfileAdapter::UAMobile).toBool();
+}
+
+/*!
+ \property QWebEngineClientHints::fullVersion
+ The value of the \c{Sec-CH-UA-Full-Version} HTTP header and \c{uaFullVersion} member of NavigatorUAData in JavaScript.
+*/
+QString QWebEngineClientHints::fullVersion() const
+{
+ return m_profileAdapter->clientHint(QtWebEngineCore::ProfileAdapter::UAFullVersion).toString();
+}
+
+/*!
+ \property QWebEngineClientHints::platformVersion
+ The value of the \c{Sec-CH-UA-Platform-Version} HTTP header and \c{platformVersion} member of NavigatorUAData in JavaScript.
+*/
+QString QWebEngineClientHints::platformVersion() const
+{
+ return m_profileAdapter->clientHint(QtWebEngineCore::ProfileAdapter::UAPlatformVersion).toString();
+}
+
+/*!
+ \property QWebEngineClientHints::bitness
+ The value of the \c{Sec-CH-UA-Bitness} HTTP header and \c{bitness} member of NavigatorUAData in JavaScript.
+*/
+QString QWebEngineClientHints::bitness() const
+{
+ return m_profileAdapter->clientHint(QtWebEngineCore::ProfileAdapter::UABitness).toString();
+}
+
+/*!
+ \property QWebEngineClientHints::fullVersionList
+ The value of the \c{Sec-CH-UA-Full-Version-List} HTTP header and \c{fullVersionList} member of NavigatorUAData in JavaScript.
+
+ It holds brand name and version number pairs in a QHash. The provided values will be automatically extended by the currently used version
+ of Chromium and a semi-random brand.
+*/
+QHash<QString,QString> QWebEngineClientHints::fullVersionList() const
+{
+ QHash<QString, QString> ret;
+ QJsonObject fullVersionList = m_profileAdapter->clientHint(QtWebEngineCore::ProfileAdapter::UAFullVersionList).toJsonObject();
+ for (const QString &key : fullVersionList.keys())
+ ret.insert(key, fullVersionList.value(key).toString());
+ return ret;
+}
+
+/*!
+ \property QWebEngineClientHints::wow64
+ The value of the \c{Sec-CH-UA-Wow64} HTTP header and \c{wow64} member of NavigatorUAData in JavaScript.
+*/
+bool QWebEngineClientHints::isWow64() const
+{
+ return m_profileAdapter->clientHint(QtWebEngineCore::ProfileAdapter::UAWOW64).toBool();
+}
+
+void QWebEngineClientHints::setArch(const QString &arch)
+{
+ m_profileAdapter->setClientHint(QtWebEngineCore::ProfileAdapter::UAArchitecture, QVariant(arch));
+}
+
+void QWebEngineClientHints::setPlatform(const QString &platform)
+{
+ m_profileAdapter->setClientHint(QtWebEngineCore::ProfileAdapter::UAPlatform, QVariant(platform));
+}
+
+void QWebEngineClientHints::setModel(const QString &model)
+{
+ m_profileAdapter->setClientHint(QtWebEngineCore::ProfileAdapter::UAModel, QVariant(model));
+}
+
+void QWebEngineClientHints::setIsMobile(const bool mobile)
+{
+ m_profileAdapter->setClientHint(QtWebEngineCore::ProfileAdapter::UAMobile, QVariant(mobile));
+}
+
+void QWebEngineClientHints::setFullVersion(const QString &fullVerson)
+{
+ m_profileAdapter->setClientHint(QtWebEngineCore::ProfileAdapter::UAFullVersion, QVariant(fullVerson));
+}
+
+void QWebEngineClientHints::setPlatformVersion(const QString &platformVersion)
+{
+ m_profileAdapter->setClientHint(QtWebEngineCore::ProfileAdapter::UAPlatformVersion, QVariant(platformVersion));
+}
+
+void QWebEngineClientHints::setBitness(const QString &bitness)
+{
+ m_profileAdapter->setClientHint(QtWebEngineCore::ProfileAdapter::UABitness, QVariant(bitness));
+}
+
+void QWebEngineClientHints::setFullVersionList(const QHash<QString,QString> &fullVersionList)
+{
+ QJsonObject jsonObject;
+ for (auto i = fullVersionList.cbegin(), end = fullVersionList.cend(); i != end; ++i)
+ jsonObject.insert(i.key(), QJsonValue(i.value()));
+ m_profileAdapter->setClientHint(QtWebEngineCore::ProfileAdapter::UAFullVersionList, QVariant(jsonObject));
+}
+
+void QWebEngineClientHints::setIsWow64(const bool wow64)
+{
+ m_profileAdapter->setClientHint(QtWebEngineCore::ProfileAdapter::UAWOW64, QVariant(wow64));
+}
+
+/*!
+ \property QWebEngineClientHints::isAllClientHintsEnabled
+ This property controls whether the Client Hints HTTP headers are sent by WebEngine or not.
+
+ Enabled by default.
+*/
+bool QWebEngineClientHints::isAllClientHintsEnabled()
+{
+ return m_profileAdapter->clientHintsEnabled();
+}
+
+void QWebEngineClientHints::setAllClientHintsEnabled(bool enabled)
+{
+ m_profileAdapter->setClientHintsEnabled(enabled);
+}
+
+/*!
+ Resets all Client Hints settings to their default values.
+*/
+void QWebEngineClientHints::resetAll()
+{
+ m_profileAdapter->resetClientHints();
+}
+
+QT_END_NAMESPACE
diff --git a/src/core/api/qwebengineclienthints.h b/src/core/api/qwebengineclienthints.h
new file mode 100644
index 000000000..8956b5cb6
--- /dev/null
+++ b/src/core/api/qwebengineclienthints.h
@@ -0,0 +1,72 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QWEBENGINECLIENTHINTS_H
+#define QWEBENGINECLIENTHINTS_H
+
+#include <QtWebEngineCore/qtwebenginecoreglobal.h>
+
+#include <QtCore/qobject.h>
+#include <QtCore/qhash.h>
+
+namespace QtWebEngineCore {
+class ProfileAdapter;
+}
+
+QT_BEGIN_NAMESPACE
+
+class Q_WEBENGINECORE_EXPORT QWebEngineClientHints
+{
+ Q_GADGET
+ Q_PROPERTY(QString arch READ arch WRITE setArch)
+ Q_PROPERTY(QString platform READ platform WRITE setPlatform)
+ Q_PROPERTY(QString model READ model WRITE setModel)
+ Q_PROPERTY(bool mobile READ isMobile WRITE setIsMobile)
+ Q_PROPERTY(QString fullVersion READ fullVersion WRITE setFullVersion)
+ Q_PROPERTY(QString platformVersion READ platformVersion WRITE setPlatformVersion)
+ Q_PROPERTY(QString bitness READ bitness WRITE setBitness)
+ Q_PROPERTY(QHash<QString,QString> fullVersionList READ fullVersionList WRITE setFullVersionList)
+ Q_PROPERTY(bool wow64 READ isWow64 WRITE setIsWow64)
+
+ Q_PROPERTY(bool isAllClientHintsEnabled READ isAllClientHintsEnabled WRITE setAllClientHintsEnabled)
+
+public:
+ ~QWebEngineClientHints();
+
+ QString arch() const;
+ QString platform() const;
+ QString model() const;
+ bool isMobile() const;
+ QString fullVersion() const;
+ QString platformVersion() const;
+ QString bitness() const;
+ QHash<QString,QString> fullVersionList() const;
+ bool isWow64() const;
+
+ void setArch(const QString &);
+ void setPlatform(const QString &);
+ void setModel(const QString &);
+ void setIsMobile(const bool);
+ void setFullVersion(const QString &);
+ void setPlatformVersion(const QString &);
+ void setBitness(const QString &);
+ void setFullVersionList(const QHash<QString,QString> &);
+ void setIsWow64(const bool);
+
+ bool isAllClientHintsEnabled();
+ void setAllClientHintsEnabled(bool enabled);
+
+ void resetAll();
+
+private:
+ explicit QWebEngineClientHints(QtWebEngineCore::ProfileAdapter *profileAdapter);
+ Q_DISABLE_COPY(QWebEngineClientHints)
+ friend class QWebEngineProfilePrivate;
+ friend class QQuickWebEngineProfilePrivate;
+
+ QtWebEngineCore::ProfileAdapter *m_profileAdapter;
+};
+
+QT_END_NAMESPACE
+
+#endif // QWEBENGINECLIENTHINTS_H
diff --git a/src/core/api/qwebenginecontextmenurequest.cpp b/src/core/api/qwebenginecontextmenurequest.cpp
new file mode 100644
index 000000000..25de1fe6b
--- /dev/null
+++ b/src/core/api/qwebenginecontextmenurequest.cpp
@@ -0,0 +1,260 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qwebenginecontextmenurequest.h"
+#include "qwebenginecontextmenurequest_p.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QWebEngineContextMenuRequest
+ \since 6.2
+ \brief The QWebEngineContextMenuRequest class provides request for populating or extending a context menu with actions.
+
+ \inmodule QtWebEngineCore
+
+ QWebEngineContextMenuRequest is returned by QWebEngineView::lastContextMenuRequest() after a context menu event,
+ and contains information about where the context menu event took place. This is also in the context
+ in which any context specific QWebEnginePage::WebAction will be performed.
+*/
+
+/*!
+ \enum QWebEngineContextMenuRequest::MediaType
+ \readonly
+ \since 6.2
+
+ This enum describes the media type of the context menu request if any.
+
+ \value MediaTypeNone The context is not a media type.
+ \value MediaTypeImage The context is an image element.
+ \value MediaTypeVideo The context is a video element.
+ \value MediaTypeAudio The context is an audio element.
+ \value MediaTypeCanvas The context is a canvas element.
+ \value MediaTypeFile The context is a file.
+ \value MediaTypePlugin The context is a plugin element.
+*/
+
+/*!
+ \enum QWebEngineContextMenuRequest::EditFlag
+ \readonly
+ \since 6.2
+
+ The available edit operations in the current context menu request.
+
+ \value CanUndo Undo is available.
+ \value CanRedo Redo is available.
+ \value CanCut Cut is available.
+ \value CanCopy Copy is available.
+ \value CanPaste Paste is available.
+ \value CanDelete Delete is available.
+ \value CanSelectAll Select All is available.
+ \value CanTranslate Translate is available.
+ \value CanEditRichly Context is richly editable.
+*/
+
+/*!
+ \enum QWebEngineContextMenuRequest::MediaFlag
+ \readonly
+ \since 6.2
+
+ The current media element's status and its available operations.
+ \c MediaNone if the selected web page content is not a media element.
+
+ \value MediaInError An error occurred.
+ \value MediaPaused Media is paused.
+ \value MediaMuted Media is muted.
+ \value MediaLoop Media can be looped.
+ \value MediaCanSave Media can be saved.
+ \value MediaHasAudio Media has audio.
+ \value MediaCanToggleControls Media can show controls.
+ \value MediaControls Media controls are shown.
+ \value MediaCanPrint Media is printable.
+ \value MediaCanRotate Media is rotatable.
+*/
+
+/*!
+ \internal
+*/
+QWebEngineContextMenuRequest::QWebEngineContextMenuRequest(
+ QWebEngineContextMenuRequestPrivate *request)
+ : d(request)
+{
+}
+
+/*!
+ Destroys the context menu request.
+*/
+QWebEngineContextMenuRequest::~QWebEngineContextMenuRequest() = default;
+
+/*!
+ Returns the position of the context menu request, usually the mouse
+ position where the context menu event was triggered.
+*/
+QPoint QWebEngineContextMenuRequest::position() const
+{
+ return d->m_position;
+}
+
+/*!
+ Returns the selected text of the context menu request.
+*/
+QString QWebEngineContextMenuRequest::selectedText() const
+{
+ return d->m_selectedText;
+}
+
+/*!
+ Returns the text of a link if the context menu request was requested for a link.
+*/
+QString QWebEngineContextMenuRequest::linkText() const
+{
+ return d->m_linkText;
+}
+
+/*!
+ Returns the URL of a link if the menu context request is a link.
+ It is not guaranteed to be a valid URL.
+*/
+QUrl QWebEngineContextMenuRequest::linkUrl() const
+{
+ return d->m_unfilteredLinkUrl;
+}
+
+/*!
+ If the context menu request is a media element, returns the URL of that media.
+*/
+QUrl QWebEngineContextMenuRequest::mediaUrl() const
+{
+ return d->m_mediaUrl;
+}
+
+/*!
+ Returns the type of the media element or \c MediaTypeNone
+ if the context menu requestis not a media element.
+*/
+QWebEngineContextMenuRequest::MediaType QWebEngineContextMenuRequest::mediaType() const
+{
+ return static_cast<QWebEngineContextMenuRequest::MediaType>(d->m_mediaType);
+}
+
+/*!
+ Returns \c true if the context menu request is editable by the user;
+ otherwise returns \c false.
+*/
+bool QWebEngineContextMenuRequest::isContentEditable() const
+{
+ return d->m_isEditable;
+}
+
+/*!
+ If the menu context request is a word considered misspelled by the spell-checker,
+ returns the misspelled word.
+
+ For possible replacements of the word, see spellCheckerSuggestions().
+*/
+QString QWebEngineContextMenuRequest::misspelledWord() const
+{
+ return d->m_misspelledWord;
+}
+
+
+/*!
+ If the menu context request is a word considered misspelled by the spell-checker,
+ returns a list of suggested replacements for misspelledWord().
+*/
+QStringList QWebEngineContextMenuRequest::spellCheckerSuggestions() const
+{
+ return d->m_spellCheckerSuggestions;
+}
+
+/*!
+ \property QWebEngineContextMenuRequest::accepted
+ \brief Whether the request is accepted.
+*/
+bool QWebEngineContextMenuRequest::isAccepted() const
+{
+ return d->m_accepted;
+}
+
+void QWebEngineContextMenuRequest::setAccepted(bool accepted)
+{
+ d->m_accepted = accepted;
+}
+
+/*!
+ Returns the current media element's status and its available operations.
+ \c MediaNone if the selected web page content is not a media element.
+*/
+QWebEngineContextMenuRequest::MediaFlags QWebEngineContextMenuRequest::mediaFlags() const
+{
+ return static_cast<QWebEngineContextMenuRequest::MediaFlags>(d->m_mediaFlags);
+}
+
+/*!
+ Returns the available edit operations in the current context
+ or \c CanDoNone if no actions are available.
+*/
+QWebEngineContextMenuRequest::EditFlags QWebEngineContextMenuRequest::editFlags() const
+{
+ return static_cast<QWebEngineContextMenuRequest::EditFlags>(d->m_editFlags);
+}
+
+/*!
+ \internal
+*/
+QUrl QWebEngineContextMenuRequest::filteredLinkUrl() const
+{
+ return d->m_filteredLinkUrl;
+}
+
+/*!
+ \internal
+*/
+QString QWebEngineContextMenuRequest::altText() const
+{
+ return d->m_altText;
+}
+
+/*!
+ \internal
+*/
+QString QWebEngineContextMenuRequest::titleText() const
+{
+ return d->m_titleText;
+}
+
+/*!
+ \internal
+*/
+QUrl QWebEngineContextMenuRequest::referrerUrl() const
+{
+ return !d->m_frameUrl.isEmpty() ? d->m_frameUrl : d->m_pageUrl;
+}
+
+/*!
+ \internal
+*/
+QtWebEngineCore::ReferrerPolicy QWebEngineContextMenuRequest::referrerPolicy() const
+{
+ return d->m_referrerPolicy;
+}
+
+/*!
+ \internal
+*/
+QString QWebEngineContextMenuRequest::suggestedFileName() const
+{
+ return d->m_suggestedFileName;
+}
+
+/*!
+ \internal
+*/
+bool QWebEngineContextMenuRequest::hasImageContent() const
+{
+ return d->m_hasImageContent;
+}
+
+QT_END_NAMESPACE
+
+#include "moc_qwebenginecontextmenurequest.cpp"
diff --git a/src/core/api/qwebenginecontextmenurequest.h b/src/core/api/qwebenginecontextmenurequest.h
new file mode 100644
index 000000000..6e6f6338c
--- /dev/null
+++ b/src/core/api/qwebenginecontextmenurequest.h
@@ -0,0 +1,136 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QWEBENGINECONTEXTMENUREQUEST_H
+#define QWEBENGINECONTEXTMENUREQUEST_H
+
+#include <QtWebEngineCore/qtwebenginecoreglobal.h>
+#include <QtCore/qobject.h>
+#include <QtCore/qurl.h>
+#include <QtCore/qpoint.h>
+#include <QtCore/qscopedpointer.h>
+
+namespace extensions {
+class MimeHandlerViewGuestDelegateQt;
+}
+
+namespace QtWebEngineCore {
+class RenderViewContextMenuQt;
+class WebContentsViewQt;
+
+// Must match blink::WebReferrerPolicy
+enum class ReferrerPolicy {
+ Always,
+ Default,
+ NoReferrerWhenDowngrade,
+ Never,
+ Origin,
+ OriginWhenCrossOrigin,
+ NoReferrerWhenDowngradeOriginWhenCrossOrigin,
+ SameOrigin,
+ StrictOrigin,
+ Last = StrictOrigin,
+};
+}
+
+QT_BEGIN_NAMESPACE
+
+class QWebEngineContextMenuRequestPrivate;
+class Q_WEBENGINECORE_EXPORT QWebEngineContextMenuRequest : public QObject
+{
+ Q_OBJECT
+public:
+ // Must match blink::mojom::ContextMenuDataMediaType:
+ enum MediaType {
+ MediaTypeNone,
+ MediaTypeImage,
+ MediaTypeVideo,
+ MediaTypeAudio,
+ MediaTypeCanvas,
+ MediaTypeFile,
+ MediaTypePlugin
+ };
+ Q_ENUM(MediaType)
+
+ // Must match blink::ContextMenuData::MediaFlags:
+ enum MediaFlag {
+ MediaInError = 0x1,
+ MediaPaused = 0x2,
+ MediaMuted = 0x4,
+ MediaLoop = 0x8,
+ MediaCanSave = 0x10,
+ MediaHasAudio = 0x20,
+ MediaCanToggleControls = 0x40,
+ MediaControls = 0x80,
+ MediaCanPrint = 0x100,
+ MediaCanRotate = 0x200,
+ };
+ Q_DECLARE_FLAGS(MediaFlags, MediaFlag)
+ Q_FLAG(MediaFlags)
+
+ // Must match blink::ContextMenuDataEditFlags:
+ enum EditFlag {
+ CanUndo = 0x1,
+ CanRedo = 0x2,
+ CanCut = 0x4,
+ CanCopy = 0x8,
+ CanPaste = 0x10,
+ CanDelete = 0x20,
+ CanSelectAll = 0x40,
+ CanTranslate = 0x80,
+ CanEditRichly = 0x100,
+ };
+ Q_DECLARE_FLAGS(EditFlags, EditFlag)
+ Q_FLAG(EditFlags)
+
+ Q_PROPERTY(QPoint position READ position CONSTANT FINAL)
+ Q_PROPERTY(QString selectedText READ selectedText CONSTANT FINAL)
+ Q_PROPERTY(QString linkText READ linkText CONSTANT FINAL)
+ Q_PROPERTY(QUrl linkUrl READ linkUrl CONSTANT FINAL)
+ Q_PROPERTY(QUrl mediaUrl READ mediaUrl CONSTANT FINAL)
+ Q_PROPERTY(MediaType mediaType READ mediaType CONSTANT FINAL)
+ Q_PROPERTY(bool isContentEditable READ isContentEditable CONSTANT FINAL)
+ Q_PROPERTY(QString misspelledWord READ misspelledWord CONSTANT FINAL)
+ Q_PROPERTY(QStringList spellCheckerSuggestions READ spellCheckerSuggestions CONSTANT FINAL)
+ Q_PROPERTY(bool accepted READ isAccepted WRITE setAccepted FINAL)
+ Q_PROPERTY(MediaFlags mediaFlags READ mediaFlags CONSTANT FINAL REVISION(1, 1))
+ Q_PROPERTY(EditFlags editFlags READ editFlags CONSTANT FINAL REVISION(1, 1))
+
+ virtual ~QWebEngineContextMenuRequest();
+ QPoint position() const;
+ QString selectedText() const;
+ QString linkText() const;
+ QUrl linkUrl() const;
+ QUrl mediaUrl() const;
+ MediaType mediaType() const;
+ bool isContentEditable() const;
+ QString misspelledWord() const;
+ QStringList spellCheckerSuggestions() const;
+ bool isAccepted() const;
+ void setAccepted(bool accepted);
+ MediaFlags mediaFlags() const;
+ EditFlags editFlags() const;
+
+private:
+ QUrl filteredLinkUrl() const;
+ QString altText() const;
+ QString titleText() const;
+ QUrl referrerUrl() const;
+ QtWebEngineCore::ReferrerPolicy referrerPolicy() const;
+ bool hasImageContent() const;
+ QString suggestedFileName() const;
+
+private:
+ QWebEngineContextMenuRequest(QWebEngineContextMenuRequestPrivate *d);
+ QScopedPointer<QWebEngineContextMenuRequestPrivate> d;
+ friend class QtWebEngineCore::WebContentsViewQt;
+ friend class QtWebEngineCore::RenderViewContextMenuQt;
+ friend class extensions::MimeHandlerViewGuestDelegateQt;
+ friend class QQuickWebEngineViewPrivate;
+ friend class QQuickWebEngineView;
+ friend class QWebEnginePage;
+};
+
+QT_END_NAMESPACE
+
+#endif // QWEBENGINECONTEXTMENUREQUEST_H
diff --git a/src/core/api/qwebenginecontextmenurequest_p.h b/src/core/api/qwebenginecontextmenurequest_p.h
new file mode 100644
index 000000000..0e774f534
--- /dev/null
+++ b/src/core/api/qwebenginecontextmenurequest_p.h
@@ -0,0 +1,57 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QWEBENGINECONTEXTMENUREQUEST_P_H
+#define QWEBENGINECONTEXTMENUREQUEST_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qtwebenginecoreglobal_p.h"
+#include "qwebenginecontextmenurequest.h"
+#include <QPoint>
+#include <QUrl>
+
+QT_BEGIN_NAMESPACE
+
+class QWebEngineContextMenuRequestPrivate
+{
+public:
+ bool m_accepted = false;
+ bool m_hasImageContent = false;
+ bool m_isEditable = false;
+ bool m_isSpellCheckerEnabled = false;
+ uint m_mediaType = 0;
+ uint m_mediaFlags = 0;
+ uint m_editFlags = 0;
+ QPoint m_position;
+ QUrl m_filteredLinkUrl;
+ QUrl m_unfilteredLinkUrl;
+ QUrl m_mediaUrl;
+ QString m_altText;
+ QString m_linkText;
+ QString m_titleText;
+ QString m_selectedText;
+ QString m_suggestedFileName;
+ QString m_misspelledWord;
+ QStringList m_spellCheckerSuggestions;
+ QUrl m_pageUrl;
+ QUrl m_frameUrl;
+ QtWebEngineCore::ReferrerPolicy m_referrerPolicy = QtWebEngineCore::ReferrerPolicy::Default;
+ // Some likely candidates for future additions as we add support for the related actions:
+ // bool isImageBlocked;
+ // <enum tbd> mediaType;
+ // ...
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/core/api/qwebenginecookiestore.cpp b/src/core/api/qwebenginecookiestore.cpp
index 40594b9c0..6c4536a4a 100644
--- a/src/core/api/qwebenginecookiestore.cpp
+++ b/src/core/api/qwebenginecookiestore.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qwebenginecookiestore.h"
#include "qwebenginecookiestore_p.h"
@@ -62,11 +26,10 @@ using namespace QtWebEngineCore;
QWebEngineCookieStorePrivate::QWebEngineCookieStorePrivate(QWebEngineCookieStore *q)
: q_ptr(q)
- , m_nextCallbackId(CallbackDirectory::ReservedCallbackIdsEnd)
, m_deleteSessionCookiesPending(false)
, m_deleteAllCookiesPending(false)
, m_getAllCookiesPending(false)
- , delegate(0)
+ , delegate(nullptr)
{}
void QWebEngineCookieStorePrivate::processPendingUserCookies()
@@ -76,27 +39,30 @@ void QWebEngineCookieStorePrivate::processPendingUserCookies()
if (m_getAllCookiesPending) {
m_getAllCookiesPending = false;
- delegate->getAllCookies(CallbackDirectory::GetAllCookiesCallbackId);
+ delegate->getAllCookies();
}
if (m_deleteAllCookiesPending) {
m_deleteAllCookiesPending = false;
- delegate->deleteAllCookies(CallbackDirectory::DeleteAllCookiesCallbackId);
+ delegate->deleteAllCookies();
}
if (m_deleteSessionCookiesPending) {
m_deleteSessionCookiesPending = false;
- delegate->deleteSessionCookies(CallbackDirectory::DeleteSessionCookiesCallbackId);
+ delegate->deleteSessionCookies();
}
+ if (bool(filterCallback))
+ delegate->setHasFilter(true);
+
if (m_pendingUserCookies.isEmpty())
return;
- for (const CookieData &cookieData : qAsConst(m_pendingUserCookies)) {
- if (cookieData.callbackId == CallbackDirectory::DeleteCookieCallbackId)
+ for (const CookieData &cookieData : std::as_const(m_pendingUserCookies)) {
+ if (cookieData.wasDelete)
delegate->deleteCookie(cookieData.cookie, cookieData.origin);
else
- delegate->setCookie(cookieData.callbackId, cookieData.cookie, cookieData.origin);
+ delegate->setCookie(cookieData.cookie, cookieData.origin);
}
m_pendingUserCookies.clear();
@@ -110,26 +76,20 @@ void QWebEngineCookieStorePrivate::rejectPendingUserCookies()
m_pendingUserCookies.clear();
}
-void QWebEngineCookieStorePrivate::setCookie(const QWebEngineCallback<bool> &callback, const QNetworkCookie &cookie,
- const QUrl &origin)
+void QWebEngineCookieStorePrivate::setCookie(const QNetworkCookie &cookie, const QUrl &origin)
{
- const quint64 currentCallbackId = callback ? m_nextCallbackId++ : static_cast<quint64>(CallbackDirectory::NoCallbackId);
-
- if (currentCallbackId != CallbackDirectory::NoCallbackId)
- callbackDirectory.registerCallback(currentCallbackId, callback);
-
if (!delegate || !delegate->hasCookieMonster()) {
- m_pendingUserCookies.append(CookieData{ currentCallbackId, cookie, origin });
+ m_pendingUserCookies.append(CookieData{ false, cookie, origin });
return;
}
- delegate->setCookie(currentCallbackId, cookie, origin);
+ delegate->setCookie(cookie, origin);
}
void QWebEngineCookieStorePrivate::deleteCookie(const QNetworkCookie &cookie, const QUrl &url)
{
if (!delegate || !delegate->hasCookieMonster()) {
- m_pendingUserCookies.append(CookieData{ CallbackDirectory::DeleteCookieCallbackId, cookie, url });
+ m_pendingUserCookies.append(CookieData{ true, cookie, url });
return;
}
@@ -143,7 +103,7 @@ void QWebEngineCookieStorePrivate::deleteSessionCookies()
return;
}
- delegate->deleteSessionCookies(CallbackDirectory::DeleteSessionCookiesCallbackId);
+ delegate->deleteSessionCookies();
}
void QWebEngineCookieStorePrivate::deleteAllCookies()
@@ -154,7 +114,7 @@ void QWebEngineCookieStorePrivate::deleteAllCookies()
return;
}
- delegate->deleteAllCookies(CallbackDirectory::DeleteAllCookiesCallbackId);
+ delegate->deleteAllCookies();
}
void QWebEngineCookieStorePrivate::getAllCookies()
@@ -164,22 +124,9 @@ void QWebEngineCookieStorePrivate::getAllCookies()
return;
}
- delegate->getAllCookies(CallbackDirectory::GetAllCookiesCallbackId);
+ delegate->getAllCookies();
}
-void QWebEngineCookieStorePrivate::onGetAllCallbackResult(qint64 callbackId, const QByteArray &cookieList)
-{
- callbackDirectory.invoke(callbackId, cookieList);
-}
-void QWebEngineCookieStorePrivate::onSetCallbackResult(qint64 callbackId, bool success)
-{
- callbackDirectory.invoke(callbackId, success);
-}
-
-void QWebEngineCookieStorePrivate::onDeleteCallbackResult(qint64 callbackId, int numCookies)
-{
- callbackDirectory.invoke(callbackId, numCookies);
-}
void QWebEngineCookieStorePrivate::onCookieChanged(const QNetworkCookie &cookie, bool removed)
{
@@ -263,8 +210,7 @@ QWebEngineCookieStore::~QWebEngineCookieStore() {}
void QWebEngineCookieStore::setCookie(const QNetworkCookie &cookie, const QUrl &origin)
{
- //TODO: use callbacks or delete dummy ones
- d_ptr->setCookie(QWebEngineCallback<bool>(), cookie, origin);
+ d_ptr->setCookie(cookie, origin);
}
/*!
@@ -291,11 +237,8 @@ void QWebEngineCookieStore::deleteCookie(const QNetworkCookie &cookie, const QUr
void QWebEngineCookieStore::loadAllCookies()
{
- //TODO: use callbacks or delete dummy ones
if (d_ptr->m_getAllCookiesPending)
return;
- d_ptr->callbackDirectory.registerCallback(CallbackDirectory::GetAllCookiesCallbackId,
- QWebEngineCallback<const QByteArray &>());
//this will trigger cookieAdded signal
d_ptr->getAllCookies();
}
@@ -310,10 +253,8 @@ void QWebEngineCookieStore::loadAllCookies()
void QWebEngineCookieStore::deleteSessionCookies()
{
- //TODO: use callbacks or delete dummy ones
if (d_ptr->m_deleteAllCookiesPending || d_ptr->m_deleteSessionCookiesPending)
return;
- d_ptr->callbackDirectory.registerCallback(CallbackDirectory::DeleteSessionCookiesCallbackId, QWebEngineCallback<int>());
d_ptr->deleteSessionCookies();
}
@@ -325,10 +266,8 @@ void QWebEngineCookieStore::deleteSessionCookies()
void QWebEngineCookieStore::deleteAllCookies()
{
- //TODO: use callbacks or delete dummy ones
if (d_ptr->m_deleteAllCookiesPending)
return;
- d_ptr->callbackDirectory.registerCallback(CallbackDirectory::DeleteAllCookiesCallbackId, QWebEngineCallback<int>());
d_ptr->deleteAllCookies();
}
@@ -362,7 +301,10 @@ void QWebEngineCookieStore::deleteAllCookies()
*/
void QWebEngineCookieStore::setCookieFilter(const std::function<bool(const FilterRequest &)> &filterCallback)
{
+ bool changed = bool(d_ptr->filterCallback) != bool(filterCallback);
d_ptr->filterCallback = filterCallback;
+ if (changed && d_ptr->delegate)
+ d_ptr->delegate->setHasFilter(bool(d_ptr->filterCallback));
}
/*!
@@ -371,7 +313,10 @@ void QWebEngineCookieStore::setCookieFilter(const std::function<bool(const Filte
*/
void QWebEngineCookieStore::setCookieFilter(std::function<bool(const FilterRequest &)> &&filterCallback)
{
+ bool changed = bool(d_ptr->filterCallback) != bool(filterCallback);
d_ptr->filterCallback = std::move(filterCallback);
+ if (changed && d_ptr->delegate)
+ d_ptr->delegate->setHasFilter(bool(d_ptr->filterCallback));
}
/*!
@@ -429,3 +374,5 @@ void QWebEngineCookieStore::setCookieFilter(std::function<bool(const FilterReque
*/
QT_END_NAMESPACE
+
+#include "moc_qwebenginecookiestore.cpp"
diff --git a/src/core/api/qwebenginecookiestore.h b/src/core/api/qwebenginecookiestore.h
index ff8865406..347d0c45c 100644
--- a/src/core/api/qwebenginecookiestore.h
+++ b/src/core/api/qwebenginecookiestore.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QWEBENGINECOOKIESTORE_H
#define QWEBENGINECOOKIESTORE_H
@@ -53,13 +17,13 @@ namespace QtWebEngineCore {
class ContentBrowserClientQt;
class CookieMonsterDelegateQt;
class ProfileAdapter;
-class RestrictedCookieManagerQt;
} // namespace QtWebEngineCore
QT_BEGIN_NAMESPACE
class QWebEngineCookieStorePrivate;
-class Q_WEBENGINECORE_EXPORT QWebEngineCookieStore : public QObject {
+class Q_WEBENGINECORE_EXPORT QWebEngineCookieStore : public QObject
+{
Q_OBJECT
public:
@@ -85,11 +49,10 @@ Q_SIGNALS:
void cookieRemoved(const QNetworkCookie &cookie);
private:
- explicit QWebEngineCookieStore(QObject *parent = Q_NULLPTR);
+ explicit QWebEngineCookieStore(QObject *parent = nullptr);
friend class QtWebEngineCore::ContentBrowserClientQt;
friend class QtWebEngineCore::CookieMonsterDelegateQt;
friend class QtWebEngineCore::ProfileAdapter;
- friend class QtWebEngineCore::RestrictedCookieManagerQt;
Q_DISABLE_COPY(QWebEngineCookieStore)
Q_DECLARE_PRIVATE(QWebEngineCookieStore)
QScopedPointer<QWebEngineCookieStorePrivate> d_ptr;
diff --git a/src/core/api/qwebenginecookiestore_p.h b/src/core/api/qwebenginecookiestore_p.h
index a79e2b095..51200436d 100644
--- a/src/core/api/qwebenginecookiestore_p.h
+++ b/src/core/api/qwebenginecookiestore_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QWEBENGINECOOKIESTORE_P_H
#define QWEBENGINECOOKIESTORE_P_H
@@ -53,10 +17,9 @@
#include "qtwebenginecoreglobal_p.h"
-#include "qwebenginecallback_p.h"
#include "qwebenginecookiestore.h"
-#include <QVector>
+#include <QList>
#include <QNetworkCookie>
#include <QUrl>
@@ -66,10 +29,11 @@ class CookieMonsterDelegateQt;
QT_BEGIN_NAMESPACE
-class Q_WEBENGINECORE_PRIVATE_EXPORT QWebEngineCookieStorePrivate {
+class Q_WEBENGINECORE_EXPORT QWebEngineCookieStorePrivate
+{
Q_DECLARE_PUBLIC(QWebEngineCookieStore)
struct CookieData {
- quint64 callbackId;
+ bool wasDelete;
QNetworkCookie cookie;
QUrl origin;
};
@@ -77,10 +41,8 @@ class Q_WEBENGINECORE_PRIVATE_EXPORT QWebEngineCookieStorePrivate {
QWebEngineCookieStore *q_ptr;
public:
- QtWebEngineCore::CallbackDirectory callbackDirectory;
std::function<bool(const QWebEngineCookieStore::FilterRequest &)> filterCallback;
- QVector<CookieData> m_pendingUserCookies;
- quint64 m_nextCallbackId;
+ QList<CookieData> m_pendingUserCookies;
bool m_deleteSessionCookiesPending;
bool m_deleteAllCookiesPending;
bool m_getAllCookiesPending;
@@ -91,7 +53,7 @@ public:
void processPendingUserCookies();
void rejectPendingUserCookies();
- void setCookie(const QWebEngineCallback<bool> &callback, const QNetworkCookie &cookie, const QUrl &origin);
+ void setCookie(const QNetworkCookie &cookie, const QUrl &origin);
void deleteCookie(const QNetworkCookie &cookie, const QUrl &url);
void deleteSessionCookies();
void deleteAllCookies();
@@ -99,13 +61,10 @@ public:
bool canAccessCookies(const QUrl &firstPartyUrl, const QUrl &url) const;
- void onGetAllCallbackResult(qint64 callbackId, const QByteArray &cookieList);
- void onSetCallbackResult(qint64 callbackId, bool success);
- void onDeleteCallbackResult(qint64 callbackId, int numCookies);
void onCookieChanged(const QNetworkCookie &cookie, bool removed);
};
-Q_DECLARE_TYPEINFO(QWebEngineCookieStorePrivate::CookieData, Q_MOVABLE_TYPE);
+Q_DECLARE_TYPEINFO(QWebEngineCookieStorePrivate::CookieData, Q_RELOCATABLE_TYPE);
QT_END_NAMESPACE
diff --git a/src/core/api/qwebenginedesktopmediarequest.cpp b/src/core/api/qwebenginedesktopmediarequest.cpp
new file mode 100644
index 000000000..dae69a68c
--- /dev/null
+++ b/src/core/api/qwebenginedesktopmediarequest.cpp
@@ -0,0 +1,206 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "desktop_media_controller.h"
+#include "qwebenginedesktopmediarequest.h"
+#include "qwebenginedesktopmediarequest_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QT_DEFINE_QESDP_SPECIALIZATION_DTOR(QWebEngineDesktopMediaRequestPrivate)
+
+/*!
+ \class QWebEngineDesktopMediaRequest
+ \brief A request for populating a dialog with available sources for screen capturing.
+
+ \since 6.7
+
+ \inmodule QtWebEngineCore
+
+ To allow web applications to capture contents of a display, applications must connect
+ to QWebEnginePage::desktopMediaRequested, which takes a QWebEngineDesktopMediaRequest
+ instance as an argument.
+
+ If a web application requests access to the contents of a display,
+ QWebEnginePage::desktopMediaRequested will be emitted with a
+ QWebEngineDesktopMediaRequest instance as an argument which holds references to
+ QAbstractListModels for available windows and screens that can be captured.
+
+ The data model's \e Qt::DisplayRole specifies the name of the source which is the title of a
+ window or the number of the display.
+ The model is dynamically updates if the available list of sources has changed e.g a window is
+ opened/closed.
+
+ The signal handler needs to then either call QWebEngineDesktopMediaRequest:selectScreen() or
+ QWebEngineDesktopMediaRequest::selectWindow() to accept the request and start screensharing.
+ \sa QWebEnginePage::desktopMediaRequested().
+*/
+
+class QWebEngineMediaSourceModel : public QAbstractListModel
+{
+public:
+ ~QWebEngineMediaSourceModel() override;
+
+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
+
+private:
+ friend class QWebEngineDesktopMediaRequestPrivate;
+ explicit QWebEngineMediaSourceModel(QtWebEngineCore::DesktopMediaListQt *mediaList);
+ QtWebEngineCore::DesktopMediaListQt *m_mediaList;
+};
+
+QWebEngineMediaSourceModel::QWebEngineMediaSourceModel(QtWebEngineCore::DesktopMediaListQt *mediaList)
+ : m_mediaList(mediaList)
+{
+ QObject::connect(m_mediaList, &QtWebEngineCore::DesktopMediaListQt::sourceAdded, this,
+ [this](int index) {
+ beginInsertRows(QModelIndex(), index, index);
+ endInsertRows();
+ });
+ QObject::connect(m_mediaList, &QtWebEngineCore::DesktopMediaListQt::sourceRemoved, this,
+ [this](int index) {
+ beginRemoveRows(QModelIndex(), index, index);
+ endRemoveRows();
+ });
+ QObject::connect(m_mediaList, &QtWebEngineCore::DesktopMediaListQt::sourceMoved, this,
+ [this](int oldIndex, int newIndex) {
+ beginMoveRows(QModelIndex(), oldIndex, oldIndex, QModelIndex(), newIndex);
+ endMoveRows();
+ });
+ QObject::connect(m_mediaList, &QtWebEngineCore::DesktopMediaListQt::sourceNameChanged, this,
+ [this](int index) {
+ Q_EMIT dataChanged(QModelIndex(), QModelIndex(),
+ { Qt::DisplayRole });
+ });
+}
+
+QWebEngineMediaSourceModel::~QWebEngineMediaSourceModel() { }
+
+int QWebEngineMediaSourceModel::rowCount(const QModelIndex &) const
+{
+ return m_mediaList->getSourceCount();
+}
+
+QVariant QWebEngineMediaSourceModel::data(const QModelIndex &index, int role) const
+{
+ if (!index.isValid())
+ return QVariant();
+ switch (role) {
+ case Qt::DisplayRole:
+ case Qt::EditRole:
+ return m_mediaList->getSourceName(index.row());
+ default:
+ break;
+ }
+ return QVariant();
+}
+
+QWebEngineDesktopMediaRequestPrivate::QWebEngineDesktopMediaRequestPrivate(
+ QtWebEngineCore::DesktopMediaController *controller)
+ : controller(controller)
+ , m_screensModel(new QWebEngineMediaSourceModel(controller->screens()))
+ , m_windowsModel(new QWebEngineMediaSourceModel(controller->windows()))
+{
+}
+
+QWebEngineDesktopMediaRequestPrivate::~QWebEngineDesktopMediaRequestPrivate()
+{
+ // Keep old behavior, if there were no user action select the primary screen.
+ if (!didSelectOrCancel)
+ controller->selectScreen(0);
+}
+
+void QWebEngineDesktopMediaRequestPrivate::selectWindow(const QModelIndex &index)
+{
+ Q_ASSERT(index.model() == m_windowsModel.get());
+ if (!index.isValid())
+ return;
+ didSelectOrCancel = true;
+ controller->selectWindow(index.row());
+}
+
+void QWebEngineDesktopMediaRequestPrivate::selectScreen(const QModelIndex &index)
+{
+ Q_ASSERT(index.model() == m_screensModel.get());
+ if (!index.isValid())
+ return;
+ didSelectOrCancel = true;
+ controller->selectScreen(index.row());
+}
+
+void QWebEngineDesktopMediaRequestPrivate::cancel()
+{
+ // Notifies webrtc so it can free up it's resources.
+ didSelectOrCancel = true;
+ controller->cancel();
+}
+
+QWebEngineDesktopMediaRequest::QWebEngineDesktopMediaRequest(
+ QtWebEngineCore::DesktopMediaController *controller)
+ : d(new QWebEngineDesktopMediaRequestPrivate(controller))
+{
+}
+
+QWebEngineDesktopMediaRequest::~QWebEngineDesktopMediaRequest() = default;
+
+QWebEngineDesktopMediaRequest::QWebEngineDesktopMediaRequest(
+ const QWebEngineDesktopMediaRequest &other) noexcept = default;
+
+QWebEngineDesktopMediaRequest &QWebEngineDesktopMediaRequest::operator=(
+ const QWebEngineDesktopMediaRequest &other) noexcept = default;
+
+QWebEngineDesktopMediaRequest::QWebEngineDesktopMediaRequest(
+ QWebEngineDesktopMediaRequest &&other) noexcept = default;
+
+/*!
+ Returns a QAbstractListModel for the available screens.
+
+ \sa windowsModel()
+*/
+QAbstractListModel *QWebEngineDesktopMediaRequest::screensModel() const
+{
+ return d->m_screensModel.get();
+}
+
+/*!
+ Returns a QAbstractListModel for the available windows.
+
+ \sa screensModel()
+*/
+QAbstractListModel *QWebEngineDesktopMediaRequest::windowsModel() const
+{
+ return d->m_windowsModel.get();
+}
+
+/*!
+ Selects the window on the \a index to be captured.
+
+ \sa QWebEngineDesktopMediaRequest::selectScreen()
+*/
+void QWebEngineDesktopMediaRequest::selectWindow(const QModelIndex &index) const
+{
+ d->selectWindow(index);
+}
+
+/*!
+ Selects the screen on the \a index to be captured.
+
+ \sa QWebEngineDesktopMediaRequest::selectWindow()
+*/
+void QWebEngineDesktopMediaRequest::selectScreen(const QModelIndex &index) const
+{
+ d->selectScreen(index);
+}
+
+/*!
+ Rejects a request. Screen capturing will be aborted.
+*/
+void QWebEngineDesktopMediaRequest::cancel() const
+{
+ d->cancel();
+}
+
+QT_END_NAMESPACE
+
+#include "moc_qwebenginedesktopmediarequest.cpp"
diff --git a/src/core/api/qwebenginedesktopmediarequest.h b/src/core/api/qwebenginedesktopmediarequest.h
new file mode 100644
index 000000000..ebf66bce4
--- /dev/null
+++ b/src/core/api/qwebenginedesktopmediarequest.h
@@ -0,0 +1,59 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QWEBENGINEDESKTOPMEDIAREQUEST_H
+#define QWEBENGINEDESKTOPMEDIAREQUEST_H
+
+#include <QtCore/qabstractitemmodel.h>
+#include <QtCore/qshareddata.h>
+#include <QtCore/qobject.h>
+#include <QtWebEngineCore/qtwebenginecoreglobal.h>
+
+namespace QtWebEngineCore {
+class DesktopMediaController;
+}
+
+QT_BEGIN_NAMESPACE
+class QWebEnginePagePrivate;
+class QQuickWebEngineViewPrivate;
+class QWebEngineDesktopMediaRequestPrivate;
+QT_DECLARE_QESDP_SPECIALIZATION_DTOR_WITH_EXPORT(QWebEngineDesktopMediaRequestPrivate,
+ Q_WEBENGINECORE_EXPORT)
+
+class QWebEngineDesktopMediaRequest
+{
+ Q_GADGET_EXPORT(Q_WEBENGINECORE_EXPORT)
+ Q_PROPERTY(QAbstractListModel *screensModel READ screensModel FINAL)
+ Q_PROPERTY(QAbstractListModel *windowsModel READ windowsModel FINAL)
+
+public:
+ Q_WEBENGINECORE_EXPORT ~QWebEngineDesktopMediaRequest();
+
+ Q_WEBENGINECORE_EXPORT
+ QWebEngineDesktopMediaRequest(const QWebEngineDesktopMediaRequest &other) noexcept;
+ Q_WEBENGINECORE_EXPORT
+ QWebEngineDesktopMediaRequest(QWebEngineDesktopMediaRequest &&other) noexcept;
+ Q_WEBENGINECORE_EXPORT
+ QWebEngineDesktopMediaRequest &operator=(const QWebEngineDesktopMediaRequest &other) noexcept;
+ QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QWebEngineDesktopMediaRequest)
+ void swap(QWebEngineDesktopMediaRequest &other) noexcept { d.swap(other.d); }
+
+ Q_WEBENGINECORE_EXPORT QAbstractListModel *screensModel() const;
+ Q_WEBENGINECORE_EXPORT QAbstractListModel *windowsModel() const;
+
+ Q_WEBENGINECORE_EXPORT Q_INVOKABLE void selectScreen(const QModelIndex &index) const;
+ Q_WEBENGINECORE_EXPORT Q_INVOKABLE void selectWindow(const QModelIndex &index) const;
+ Q_WEBENGINECORE_EXPORT Q_INVOKABLE void cancel() const;
+
+private:
+ friend class QWebEnginePagePrivate;
+ friend class QQuickWebEngineViewPrivate;
+ Q_WEBENGINECORE_EXPORT explicit QWebEngineDesktopMediaRequest(
+ QtWebEngineCore::DesktopMediaController *controller);
+ QExplicitlySharedDataPointer<QWebEngineDesktopMediaRequestPrivate> d;
+};
+Q_DECLARE_SHARED(QWebEngineDesktopMediaRequest)
+
+QT_END_NAMESPACE
+
+#endif // QWEBENGINEDESKTOPMEDIAREQUEST_H
diff --git a/src/core/api/qwebenginedesktopmediarequest_p.h b/src/core/api/qwebenginedesktopmediarequest_p.h
new file mode 100644
index 000000000..3add71bc0
--- /dev/null
+++ b/src/core/api/qwebenginedesktopmediarequest_p.h
@@ -0,0 +1,49 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#ifndef QWEBENGINEDESKTOPMEDIAREQUEST_P_H
+#define QWEBENGINEDESKTOPMEDIAREQUEST_P_H
+
+#include <QtCore/qabstractitemmodel.h>
+#include <QtCore/QSharedData>
+#include <QtCore/qobject.h>
+#include <QtWebEngineCore/qtwebenginecoreglobal.h>
+
+namespace QtWebEngineCore {
+class DesktopMediaController;
+}
+
+QT_BEGIN_NAMESPACE
+class QWebEngineMediaSourceModel;
+
+class QWebEngineDesktopMediaRequestPrivate : public QSharedData
+{
+public:
+ ~QWebEngineDesktopMediaRequestPrivate();
+ explicit QWebEngineDesktopMediaRequestPrivate(
+ QtWebEngineCore::DesktopMediaController *controller);
+
+ void selectScreen(const QModelIndex &index);
+ void selectWindow(const QModelIndex &index);
+ void cancel();
+
+ bool didSelectOrCancel = false;
+ std::unique_ptr<QtWebEngineCore::DesktopMediaController> controller;
+ std::unique_ptr<QWebEngineMediaSourceModel> m_screensModel;
+ std::unique_ptr<QWebEngineMediaSourceModel> m_windowsModel;
+};
+
+QT_END_NAMESPACE
+
+#endif // QWEBENGINEDESKTOPMEDIAREQUEST_P_H
diff --git a/src/core/api/qwebenginedownloadrequest.cpp b/src/core/api/qwebenginedownloadrequest.cpp
new file mode 100644
index 000000000..cbf46b448
--- /dev/null
+++ b/src/core/api/qwebenginedownloadrequest.cpp
@@ -0,0 +1,637 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qwebenginedownloadrequest.h"
+#include "qwebenginedownloadrequest_p.h"
+
+#include "qwebenginepage.h"
+
+#include "profile_adapter.h"
+#include "web_contents_adapter_client.h"
+
+#include <QFileInfo>
+
+QT_BEGIN_NAMESPACE
+
+using QtWebEngineCore::ProfileAdapterClient;
+
+ASSERT_ENUMS_MATCH(ProfileAdapterClient::NoReason, QWebEngineDownloadRequest::NoReason)
+ASSERT_ENUMS_MATCH(ProfileAdapterClient::FileFailed, QWebEngineDownloadRequest::FileFailed)
+ASSERT_ENUMS_MATCH(ProfileAdapterClient::FileAccessDenied, QWebEngineDownloadRequest::FileAccessDenied)
+ASSERT_ENUMS_MATCH(ProfileAdapterClient::FileNoSpace, QWebEngineDownloadRequest::FileNoSpace)
+ASSERT_ENUMS_MATCH(ProfileAdapterClient::FileNameTooLong, QWebEngineDownloadRequest::FileNameTooLong)
+ASSERT_ENUMS_MATCH(ProfileAdapterClient::FileTooLarge, QWebEngineDownloadRequest::FileTooLarge)
+ASSERT_ENUMS_MATCH(ProfileAdapterClient::FileVirusInfected, QWebEngineDownloadRequest::FileVirusInfected)
+ASSERT_ENUMS_MATCH(ProfileAdapterClient::FileTransientError, QWebEngineDownloadRequest::FileTransientError)
+ASSERT_ENUMS_MATCH(ProfileAdapterClient::FileBlocked, QWebEngineDownloadRequest::FileBlocked)
+ASSERT_ENUMS_MATCH(ProfileAdapterClient::FileSecurityCheckFailed, QWebEngineDownloadRequest::FileSecurityCheckFailed)
+ASSERT_ENUMS_MATCH(ProfileAdapterClient::FileTooShort, QWebEngineDownloadRequest::FileTooShort)
+ASSERT_ENUMS_MATCH(ProfileAdapterClient::FileHashMismatch, QWebEngineDownloadRequest::FileHashMismatch)
+ASSERT_ENUMS_MATCH(ProfileAdapterClient::NetworkFailed, QWebEngineDownloadRequest::NetworkFailed)
+ASSERT_ENUMS_MATCH(ProfileAdapterClient::NetworkTimeout, QWebEngineDownloadRequest::NetworkTimeout)
+ASSERT_ENUMS_MATCH(ProfileAdapterClient::NetworkDisconnected, QWebEngineDownloadRequest::NetworkDisconnected)
+ASSERT_ENUMS_MATCH(ProfileAdapterClient::NetworkServerDown, QWebEngineDownloadRequest::NetworkServerDown)
+ASSERT_ENUMS_MATCH(ProfileAdapterClient::NetworkInvalidRequest, QWebEngineDownloadRequest::NetworkInvalidRequest)
+ASSERT_ENUMS_MATCH(ProfileAdapterClient::ServerFailed, QWebEngineDownloadRequest::ServerFailed)
+//ASSERT_ENUMS_MATCH(ProfileAdapterClient::ServerNoRange, QWebEngineDownloadRequest::ServerNoRange)
+ASSERT_ENUMS_MATCH(ProfileAdapterClient::ServerBadContent, QWebEngineDownloadRequest::ServerBadContent)
+ASSERT_ENUMS_MATCH(ProfileAdapterClient::ServerUnauthorized, QWebEngineDownloadRequest::ServerUnauthorized)
+ASSERT_ENUMS_MATCH(ProfileAdapterClient::ServerCertProblem, QWebEngineDownloadRequest::ServerCertProblem)
+ASSERT_ENUMS_MATCH(ProfileAdapterClient::ServerForbidden, QWebEngineDownloadRequest::ServerForbidden)
+ASSERT_ENUMS_MATCH(ProfileAdapterClient::ServerUnreachable, QWebEngineDownloadRequest::ServerUnreachable)
+ASSERT_ENUMS_MATCH(ProfileAdapterClient::UserCanceled, QWebEngineDownloadRequest::UserCanceled)
+//ASSERT_ENUMS_MATCH(ProfileAdapterClient::UserShutdown, QWebEngineDownloadRequest::UserShutdown)
+//ASSERT_ENUMS_MATCH(ProfileAdapterClient::Crash, QWebEngineDownloadRequest::Crash)
+
+static inline QWebEngineDownloadRequest::DownloadState toDownloadState(int state)
+{
+ switch (state) {
+ case ProfileAdapterClient::DownloadInProgress:
+ return QWebEngineDownloadRequest::DownloadInProgress;
+ case ProfileAdapterClient::DownloadCompleted:
+ return QWebEngineDownloadRequest::DownloadCompleted;
+ case ProfileAdapterClient::DownloadCancelled:
+ return QWebEngineDownloadRequest::DownloadCancelled;
+ case ProfileAdapterClient::DownloadInterrupted:
+ return QWebEngineDownloadRequest::DownloadInterrupted;
+ default:
+ Q_UNREACHABLE();
+ return QWebEngineDownloadRequest::DownloadCancelled;
+ }
+}
+
+static inline QWebEngineDownloadRequest::DownloadInterruptReason toDownloadInterruptReason(int reason)
+{
+ return static_cast<QWebEngineDownloadRequest::DownloadInterruptReason>(reason);
+}
+
+/*!
+ \class QWebEngineDownloadRequest
+ \brief The QWebEngineDownloadRequest class provides information about a download.
+
+ \inmodule QtWebEngineCore
+
+ QWebEngineDownloadRequest models a download throughout its life cycle, starting
+ with a pending download request and finishing with a completed download. It
+ can be used, for example, to get information about new downloads, to monitor
+ progress, and to pause, resume, and cancel downloads.
+
+ Downloads are usually triggered by user interaction on a web page. It is the
+ QWebEngineProfile's responsibility to notify the application of new download
+ requests, which it does by emitting the
+ \l{QWebEngineProfile::downloadRequested}{downloadRequested} signal together
+ with a newly created QWebEngineDownloadRequest. The application can then
+ examine this item and decide whether to accept it or not. A signal handler
+ must explicitly call accept() on the item for \QWE to actually start
+ downloading and writing data to disk. If no signal handler calls accept(),
+ then the download request will be automatically rejected and nothing will be
+ written to disk.
+
+ \note Some properties, such as setting the path and file name where the file
+ will be saved (see \l downloadDirectory() and \l downloadFileName()), can
+ only be changed before calling accept().
+
+ \section2 Object Life Cycle
+
+ All items are guaranteed to be valid during the emission of the
+ \l{QWebEngineProfile::downloadRequested}{downloadRequested} signal. If
+ accept() is \e not called by any signal handler, then the item will be
+ deleted \e immediately after signal emission. This means that the
+ application \b{must not} keep references to rejected download items. It also
+ means the application should not use a queued connection to this signal.
+
+ If accept() \e is called by a signal handler, then the QWebEngineProfile
+ will take ownership of the item. However, it is safe for the application to
+ delete the item at any time, except during the handling of the
+ \l{QWebEngineProfile::downloadRequested}{downloadRequested} signal. The
+ QWebEngineProfile being a long-lived object, it is in fact recommended that
+ the application delete any items it is no longer interested in.
+
+ \note Deleting an item will also automatically cancel a download since 5.12.2,
+ but it is recommended to cancel manually before deleting for portability.
+
+ \section2 Web Page Downloads
+
+ In addition to normal file downloads, which consist simply of retrieving
+ some raw bytes from the network and writing them to disk, \QWE also
+ supports saving complete web pages, which involves parsing the page's HTML,
+ downloading any dependent resources, and potentially packaging everything
+ into a special file format (\l savePageFormat). To check if a download is
+ for a file or a web page, use \l isSavePageDownload.
+
+ \sa QWebEngineProfile, QWebEngineProfile::downloadRequested,
+ QWebEnginePage::download, QWebEnginePage::save
+*/
+
+QWebEngineDownloadRequestPrivate::QWebEngineDownloadRequestPrivate(
+ QtWebEngineCore::ProfileAdapter *adapter)
+ : profileAdapter(adapter)
+{
+}
+
+QWebEngineDownloadRequestPrivate::~QWebEngineDownloadRequestPrivate()
+{
+}
+
+void QWebEngineDownloadRequestPrivate::update(const ProfileAdapterClient::DownloadItemInfo &info)
+{
+ Q_Q(QWebEngineDownloadRequest);
+
+ Q_ASSERT(downloadState != QWebEngineDownloadRequest::DownloadRequested);
+
+ if (toDownloadInterruptReason(info.downloadInterruptReason) != interruptReason) {
+ interruptReason = toDownloadInterruptReason(info.downloadInterruptReason);
+ Q_EMIT q->interruptReasonChanged();
+ }
+ if (toDownloadState(info.state) != downloadState) {
+ downloadState = toDownloadState(info.state);
+ Q_EMIT q->stateChanged(downloadState);
+ }
+
+ if (info.receivedBytes != receivedBytes || info.totalBytes != totalBytes) {
+
+ if (info.receivedBytes != receivedBytes) {
+ receivedBytes = info.receivedBytes;
+ Q_EMIT q->receivedBytesChanged();
+ }
+ if (info.totalBytes != totalBytes) {
+ totalBytes = info.totalBytes;
+ Q_EMIT q->totalBytesChanged();
+ }
+ }
+
+ if (info.done)
+ setFinished();
+
+ if (downloadPaused != info.paused) {
+ downloadPaused = info.paused;
+ Q_EMIT q->isPausedChanged();
+ }
+}
+
+void QWebEngineDownloadRequestPrivate::setFinished()
+{
+ if (downloadFinished)
+ return;
+
+ downloadFinished = true;
+ Q_EMIT q_ptr->isFinishedChanged();
+}
+
+/*!
+ Accepts the current download request, which will start the download.
+
+ If the item is in the \l DownloadRequested state, then it will transition
+ into the \l DownloadInProgress state and the downloading will begin. If the
+ item is in any other state, then nothing will happen.
+
+ \sa isFinished, stateChanged()
+*/
+
+void QWebEngineDownloadRequest::accept()
+{
+ Q_D(QWebEngineDownloadRequest);
+
+ if (d->downloadState != QWebEngineDownloadRequest::DownloadRequested)
+ return;
+
+ d->downloadState = QWebEngineDownloadRequest::DownloadInProgress;
+ Q_EMIT stateChanged(d->downloadState);
+}
+
+/*!
+ Cancels the current download.
+
+ If the item is in the \l DownloadInProgress state, then it will transition
+ into the \l DownloadCancelled state, the downloading will stop, and partially
+ downloaded files will be deleted from disk.
+
+ If the item is in the \l DownloadCompleted state, then nothing will happen.
+ If the item is in any other state, then it will transition into the \l
+ DownloadCancelled state without further effect.
+
+ \sa isFinished, stateChanged()
+*/
+
+void QWebEngineDownloadRequest::cancel()
+{
+ Q_D(QWebEngineDownloadRequest);
+
+ QWebEngineDownloadRequest::DownloadState state = d->downloadState;
+
+ if (state == QWebEngineDownloadRequest::DownloadCompleted)
+ return;
+
+ bool cancelled = state == QWebEngineDownloadRequest::DownloadCancelled;
+ if (cancelled)
+ return;
+
+ // Check if the download manager has a DownloadItem for this ID
+ // (network downloads or in progress page/resource saves)
+ if (state == QWebEngineDownloadRequest::DownloadInProgress) {
+ if (d->profileAdapter)
+ cancelled = d->profileAdapter->cancelDownload(d->downloadId);
+ }
+
+ // Not cancelled downloads are not even started yet at this point
+ if (!cancelled) {
+ d->downloadState = QWebEngineDownloadRequest::DownloadCancelled;
+ Q_EMIT stateChanged(d->downloadState);
+ d->setFinished();
+ }
+}
+
+/*!
+ Pauses the download.
+
+ Has no effect if the state is not \l DownloadInProgress. Does not change the
+ state.
+
+ \sa resume(), isPaused()
+*/
+
+void QWebEngineDownloadRequest::pause()
+{
+ Q_D(QWebEngineDownloadRequest);
+
+ QWebEngineDownloadRequest::DownloadState state = d->downloadState;
+
+ if (state != QWebEngineDownloadRequest::DownloadInProgress)
+ return;
+
+ if (d->profileAdapter)
+ d->profileAdapter->pauseDownload(d->downloadId);
+}
+
+/*!
+ Resumes the current download if it was paused or interrupted.
+
+ Has no effect if the state is not \l DownloadInProgress or \l
+ DownloadInterrupted. Does not change the state.
+
+ \sa pause(), isPaused(), state()
+*/
+void QWebEngineDownloadRequest::resume()
+{
+ Q_D(QWebEngineDownloadRequest);
+
+ QWebEngineDownloadRequest::DownloadState state = d->downloadState;
+
+ if (d->downloadFinished || (state != QWebEngineDownloadRequest::DownloadInProgress && state != QWebEngineDownloadRequest::DownloadInterrupted))
+ return;
+ if (d->profileAdapter)
+ d->profileAdapter->resumeDownload(d->downloadId);
+}
+
+/*!
+ Returns the download item's ID.
+*/
+
+quint32 QWebEngineDownloadRequest::id() const
+{
+ Q_D(const QWebEngineDownloadRequest);
+ return d->downloadId;
+}
+
+/*!
+ \fn void QWebEngineDownloadRequest::isPausedChanged()
+
+ This signal is emitted whenever isPaused changes.
+
+ \sa pause(), isPaused
+*/
+
+/*!
+ \fn void QWebEngineDownloadRequest::stateChanged(DownloadState state)
+
+ This signal is emitted whenever the download's \a state changes.
+
+ \sa state(), DownloadState
+*/
+
+/*!
+ \enum QWebEngineDownloadRequest::DownloadState
+
+ This enum describes the state of the download:
+
+ \value DownloadRequested Download has been requested, but has not been accepted yet.
+ \value DownloadInProgress Download is in progress.
+ \value DownloadCompleted Download completed successfully.
+ \value DownloadCancelled Download has been cancelled.
+ \value DownloadInterrupted Download has been interrupted (by the server or because of lost
+ connectivity).
+*/
+
+/*!
+ \enum QWebEngineDownloadRequest::SavePageFormat
+
+ This enum describes the format that is used to save a web page.
+
+ \value UnknownSaveFormat This is not a request for downloading a complete web page.
+ \value SingleHtmlSaveFormat The page is saved as a single HTML page. Resources such as images
+ are not saved.
+ \value CompleteHtmlSaveFormat The page is saved as a complete HTML page, for example a directory
+ containing the single HTML page and the resources.
+ \value MimeHtmlSaveFormat The page is saved as a complete web page in the MIME HTML format.
+*/
+
+/*!
+ \enum QWebEngineDownloadRequest::DownloadInterruptReason
+
+ Describes the reason why a download was interrupted:
+
+ \value NoReason Unknown reason or not interrupted.
+ \value FileFailed General file operation failure.
+ \value FileAccessDenied The file cannot be written locally, due to access restrictions.
+ \value FileNoSpace Insufficient space on the target drive.
+ \value FileNameTooLong The directory or file name is too long.
+ \value FileTooLarge The file size exceeds the file system limitation.
+ \value FileVirusInfected The file is infected with a virus.
+ \value FileTransientError Temporary problem (for example the file is in use,
+ out of memory, or too many files are opened at once).
+ \value FileBlocked The file was blocked due to local policy.
+ \value FileSecurityCheckFailed An attempt to check the safety of the download
+ failed due to unexpected reasons.
+ \value FileTooShort An attempt was made to seek past the end of a file when
+ opening a file (as part of resuming a previously interrupted download).
+ \value FileHashMismatch The partial file did not match the expected hash.
+
+ \value NetworkFailed General network failure.
+ \value NetworkTimeout The network operation has timed out.
+ \value NetworkDisconnected The network connection has been terminated.
+ \value NetworkServerDown The server has gone down.
+ \value NetworkInvalidRequest The network request was invalid (for example, the
+ original or redirected URL is invalid, has an unsupported scheme, or is disallowed by policy).
+
+ \value ServerFailed General server failure.
+ \value ServerBadContent The server does not have the requested data.
+ \value ServerUnauthorized The server did not authorize access to the resource.
+ \value ServerCertProblem A problem with the server certificate occurred.
+ \value ServerForbidden Access forbidden by the server.
+ \value ServerUnreachable Unexpected server response (might indicate that
+ the responding server may not be the intended server).
+ \value UserCanceled The user canceled the download.
+*/
+
+/*!
+ Returns the download item's current state.
+
+ \sa DownloadState
+*/
+
+QWebEngineDownloadRequest::DownloadState QWebEngineDownloadRequest::state() const
+{
+ Q_D(const QWebEngineDownloadRequest);
+ return d->downloadState;
+}
+
+/*!
+ Returns the total amount of data to download in bytes.
+
+ \c -1 means the size is unknown.
+*/
+
+qint64 QWebEngineDownloadRequest::totalBytes() const
+{
+ Q_D(const QWebEngineDownloadRequest);
+ return d->totalBytes;
+}
+
+/*!
+ Returns the amount of data in bytes that has been downloaded so far.
+
+ \c -1 means the size is unknown.
+*/
+
+qint64 QWebEngineDownloadRequest::receivedBytes() const
+{
+ Q_D(const QWebEngineDownloadRequest);
+ return d->receivedBytes;
+}
+
+/*!
+ Returns the download's origin URL.
+*/
+
+QUrl QWebEngineDownloadRequest::url() const
+{
+ Q_D(const QWebEngineDownloadRequest);
+ return d->downloadUrl;
+}
+
+/*!
+ Returns the MIME type of the download.
+*/
+
+QString QWebEngineDownloadRequest::mimeType() const
+{
+ Q_D(const QWebEngineDownloadRequest);
+ return d->mimeType;
+}
+
+/*!
+ Returns the download directory path.
+*/
+
+QString QWebEngineDownloadRequest::downloadDirectory() const
+{
+ Q_D(const QWebEngineDownloadRequest);
+ return d->downloadDirectory;
+}
+
+/*!
+ Sets \a directory as the directory path to download the file to.
+
+ The download directory path can only be set in response to the QWebEngineProfile::downloadRequested()
+ signal before the download is accepted. Past that point, this function has no effect on the
+ download item's state.
+*/
+
+void QWebEngineDownloadRequest::setDownloadDirectory(const QString &directory)
+{
+ Q_D(QWebEngineDownloadRequest);
+ if (d->downloadState != QWebEngineDownloadRequest::DownloadRequested) {
+ qWarning("Setting the download directory is not allowed after the download has been accepted.");
+ return;
+ }
+
+ if (!directory.isEmpty() && d->downloadDirectory != directory) {
+ d->downloadDirectory = directory;
+ Q_EMIT downloadDirectoryChanged();
+ }
+
+ if (!d->isCustomFileName && d->profileAdapter) {
+ QString newFileName = QFileInfo(d->profileAdapter->determineDownloadPath(d->downloadDirectory,
+ d->suggestedFileName,
+ d->startTime)).fileName();
+ if (d->downloadFileName != newFileName) {
+ d->downloadFileName = newFileName;
+ Q_EMIT downloadFileNameChanged();
+ }
+ }
+}
+
+/*!
+ Returns the file name to download the file to.
+*/
+
+QString QWebEngineDownloadRequest::downloadFileName() const
+{
+ Q_D(const QWebEngineDownloadRequest);
+ return d->downloadFileName;
+}
+
+/*!
+ Sets \a fileName as the file name to download the file to.
+
+ The download file name can only be set in response to the QWebEngineProfile::downloadRequested()
+ signal before the download is accepted. Past that point, this function has no effect on the
+ download item's state.
+*/
+
+void QWebEngineDownloadRequest::setDownloadFileName(const QString &fileName)
+{
+ Q_D(QWebEngineDownloadRequest);
+ if (d->downloadState != QWebEngineDownloadRequest::DownloadRequested) {
+ qWarning("Setting the download file name is not allowed after the download has been accepted.");
+ return;
+ }
+
+ if (!fileName.isEmpty()) {
+ d->downloadFileName = fileName;
+ d->isCustomFileName = true;
+ Q_EMIT downloadFileNameChanged();
+ }
+}
+
+/*!
+ Returns the suggested file name.
+*/
+
+QString QWebEngineDownloadRequest::suggestedFileName() const
+{
+ Q_D(const QWebEngineDownloadRequest);
+ return d->suggestedFileName;
+}
+
+/*!
+ \property QWebEngineDownloadRequest::isFinished
+ \brief Whether this download is finished (completed, cancelled,
+ or non-resumable interrupted state).
+
+ \sa state()
+*/
+
+bool QWebEngineDownloadRequest::isFinished() const
+{
+ Q_D(const QWebEngineDownloadRequest);
+ return d->downloadFinished;
+}
+
+/*!
+ \property QWebEngineDownloadRequest::isPaused
+ \brief Whether this download is paused.
+
+ \sa pause(), resume()
+*/
+
+bool QWebEngineDownloadRequest::isPaused() const
+{
+ Q_D(const QWebEngineDownloadRequest);
+ return d->downloadPaused;
+}
+
+/*!
+ Returns the format the web page will be saved in if this is a download request for a web page.
+ \sa setSavePageFormat(), isSavePageDownload()
+*/
+QWebEngineDownloadRequest::SavePageFormat QWebEngineDownloadRequest::savePageFormat() const
+{
+ Q_D(const QWebEngineDownloadRequest);
+ return d->savePageFormat;
+}
+
+/*!
+ Sets the \a format the web page will be saved in if this is a download request for a web page.
+
+ \sa savePageFormat(), isSavePageDownload()
+*/
+void QWebEngineDownloadRequest::setSavePageFormat(QWebEngineDownloadRequest::SavePageFormat format)
+{
+ Q_D(QWebEngineDownloadRequest);
+ if (d->savePageFormat != format) {
+ d->savePageFormat = format;
+ Q_EMIT savePageFormatChanged();
+ }
+}
+
+/*!
+ Returns \c true if this is a download request for saving a web page.
+
+ \sa savePageFormat(), setSavePageFormat()
+ */
+bool QWebEngineDownloadRequest::isSavePageDownload() const
+{
+ Q_D(const QWebEngineDownloadRequest);
+ return d->isSavePageDownload;
+}
+
+/*!
+ Returns the reason why the download was interrupted.
+
+ \sa interruptReasonString()
+*/
+
+QWebEngineDownloadRequest::DownloadInterruptReason QWebEngineDownloadRequest::interruptReason() const
+{
+ Q_D(const QWebEngineDownloadRequest);
+ return d->interruptReason;
+}
+
+/*!
+ Returns a human-readable description of the reason for interrupting the download.
+
+ \sa interruptReason()
+*/
+
+QString QWebEngineDownloadRequest::interruptReasonString() const
+{
+ return ProfileAdapterClient::downloadInterruptReasonToString(
+ static_cast<ProfileAdapterClient::DownloadInterruptReason>(interruptReason()));
+}
+
+/*!
+ Returns the page the download was requested on. If the download was not triggered by content in a page,
+ \c nullptr is returned.
+*/
+QWebEnginePage *QWebEngineDownloadRequest::page() const
+{
+ Q_D(const QWebEngineDownloadRequest);
+ if (d->adapterClient && d->adapterClient->clientType() == QtWebEngineCore::WebContentsAdapterClient::WidgetsClient)
+ return const_cast<QWebEnginePage *>(static_cast<const QWebEnginePage *>(d->adapterClient->holdingQObject()));
+ return nullptr;
+}
+
+
+/*! \internal
+*/
+QWebEngineDownloadRequest::QWebEngineDownloadRequest(QWebEngineDownloadRequestPrivate *p, QObject *parent)
+ : QObject(parent)
+ , d_ptr(p)
+{
+ p->q_ptr = this;
+}
+
+/*! \internal
+*/
+QWebEngineDownloadRequest::~QWebEngineDownloadRequest()
+{
+ // MEMO Items are owned by profile by default and will be destroyed on profile's destruction
+ // It's not safe to access profile in that case, so we rely on profile to clean up items
+ if (!isFinished())
+ cancel();
+}
+
+QT_END_NAMESPACE
+
+#include "moc_qwebenginedownloadrequest.cpp"
diff --git a/src/core/api/qwebenginedownloadrequest.h b/src/core/api/qwebenginedownloadrequest.h
new file mode 100644
index 000000000..36604188e
--- /dev/null
+++ b/src/core/api/qwebenginedownloadrequest.h
@@ -0,0 +1,139 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QWEBENGINEDOWNLOADREQUEST_H
+#define QWEBENGINEDOWNLOADREQUEST_H
+
+#include <QtWebEngineCore/qtwebenginecoreglobal.h>
+
+#include <QtCore/qobject.h>
+#include <QtCore/qurl.h>
+
+QT_BEGIN_NAMESPACE
+
+class QWebEngineDownloadRequestPrivate;
+class QWebEnginePage;
+class QWebEngineProfilePrivate;
+
+class Q_WEBENGINECORE_EXPORT QWebEngineDownloadRequest : public QObject
+{
+ Q_OBJECT
+public:
+ Q_PROPERTY(quint32 id READ id CONSTANT FINAL)
+ Q_PROPERTY(DownloadState state READ state NOTIFY stateChanged FINAL)
+ Q_PROPERTY(SavePageFormat savePageFormat READ savePageFormat WRITE setSavePageFormat NOTIFY savePageFormatChanged FINAL)
+ Q_PROPERTY(qint64 totalBytes READ totalBytes NOTIFY totalBytesChanged FINAL)
+ Q_PROPERTY(qint64 receivedBytes READ receivedBytes NOTIFY receivedBytesChanged FINAL)
+ Q_PROPERTY(QString mimeType READ mimeType FINAL)
+ Q_PROPERTY(DownloadInterruptReason interruptReason READ interruptReason NOTIFY interruptReasonChanged FINAL)
+ Q_PROPERTY(QString interruptReasonString READ interruptReasonString NOTIFY interruptReasonChanged FINAL)
+ Q_PROPERTY(bool isFinished READ isFinished NOTIFY isFinishedChanged FINAL)
+ Q_PROPERTY(bool isPaused READ isPaused NOTIFY isPausedChanged FINAL)
+ Q_PROPERTY(bool isSavePageDownload READ isSavePageDownload CONSTANT FINAL)
+ Q_PROPERTY(QUrl url READ url CONSTANT FINAL)
+ Q_PROPERTY(QString suggestedFileName READ suggestedFileName CONSTANT FINAL)
+ Q_PROPERTY(QString downloadDirectory READ downloadDirectory WRITE setDownloadDirectory NOTIFY downloadDirectoryChanged FINAL)
+ Q_PROPERTY(QString downloadFileName READ downloadFileName WRITE setDownloadFileName NOTIFY downloadFileNameChanged FINAL)
+
+ ~QWebEngineDownloadRequest() override;
+
+ enum DownloadState {
+ DownloadRequested,
+ DownloadInProgress,
+ DownloadCompleted,
+ DownloadCancelled,
+ DownloadInterrupted
+ };
+ Q_ENUM(DownloadState)
+
+ enum SavePageFormat {
+ UnknownSaveFormat = -1,
+ SingleHtmlSaveFormat,
+ CompleteHtmlSaveFormat,
+ MimeHtmlSaveFormat
+ };
+ Q_ENUM(SavePageFormat)
+
+ enum DownloadInterruptReason {
+ NoReason = 0,
+ FileFailed = 1,
+ FileAccessDenied = 2,
+ FileNoSpace = 3,
+ FileNameTooLong = 5,
+ FileTooLarge = 6,
+ FileVirusInfected = 7,
+ FileTransientError = 10,
+ FileBlocked = 11,
+ FileSecurityCheckFailed = 12,
+ FileTooShort = 13,
+ FileHashMismatch = 14,
+ NetworkFailed = 20,
+ NetworkTimeout = 21,
+ NetworkDisconnected = 22,
+ NetworkServerDown = 23,
+ NetworkInvalidRequest = 24,
+ ServerFailed = 30,
+ //ServerNoRange = 31,
+ ServerBadContent = 33,
+ ServerUnauthorized = 34,
+ ServerCertProblem = 35,
+ ServerForbidden = 36,
+ ServerUnreachable = 37,
+ UserCanceled = 40,
+ //UserShutdown = 41,
+ //Crash = 50
+ };
+ Q_ENUM(DownloadInterruptReason)
+
+ quint32 id() const;
+ DownloadState state() const;
+ qint64 totalBytes() const;
+ qint64 receivedBytes() const;
+ QUrl url() const;
+ QString mimeType() const;
+ bool isFinished() const;
+ bool isPaused() const;
+ SavePageFormat savePageFormat() const;
+ void setSavePageFormat(SavePageFormat format);
+ DownloadInterruptReason interruptReason() const;
+ QString interruptReasonString() const;
+ bool isSavePageDownload() const;
+ QString suggestedFileName() const;
+ QString downloadDirectory() const;
+ void setDownloadDirectory(const QString &directory);
+ QString downloadFileName() const;
+ void setDownloadFileName(const QString &fileName);
+
+ QWebEnginePage *page() const;
+
+public Q_SLOTS:
+ void accept();
+ void cancel();
+ void pause();
+ void resume();
+
+Q_SIGNALS:
+ void stateChanged(QWebEngineDownloadRequest::DownloadState state);
+ void savePageFormatChanged();
+ void receivedBytesChanged();
+ void totalBytesChanged();
+ void interruptReasonChanged();
+ void isFinishedChanged();
+ void isPausedChanged();
+ void downloadDirectoryChanged();
+ void downloadFileNameChanged();
+
+private:
+ Q_DISABLE_COPY(QWebEngineDownloadRequest)
+ Q_DECLARE_PRIVATE(QWebEngineDownloadRequest)
+
+ friend class QWebEngineProfilePrivate;
+
+protected:
+ QWebEngineDownloadRequest(QWebEngineDownloadRequestPrivate *, QObject *parent = nullptr);
+ QScopedPointer<QWebEngineDownloadRequestPrivate> d_ptr;
+};
+
+QT_END_NAMESPACE
+
+#endif // QWEBENGINEDOWNLOADREQUEST_H
diff --git a/src/core/api/qwebenginedownloadrequest_p.h b/src/core/api/qwebenginedownloadrequest_p.h
new file mode 100644
index 000000000..eef6c9bb5
--- /dev/null
+++ b/src/core/api/qwebenginedownloadrequest_p.h
@@ -0,0 +1,68 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QWEBENGINEDOWNLOADREQUEST_P_H
+#define QWEBENGINEDOWNLOADREQUEST_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qtwebenginecoreglobal.h"
+#include "qwebenginedownloadrequest.h"
+#include "profile_adapter_client.h"
+#include <QString>
+#include <QPointer>
+
+namespace QtWebEngineCore {
+class ProfileAdapter;
+class WebContentsAdapterClient;
+}
+
+QT_BEGIN_NAMESPACE
+
+class Q_WEBENGINECORE_EXPORT QWebEngineDownloadRequestPrivate
+{
+public:
+ QWebEngineDownloadRequestPrivate(QtWebEngineCore::ProfileAdapter *adapter);
+ ~QWebEngineDownloadRequestPrivate();
+
+ void update(const QtWebEngineCore::ProfileAdapterClient::DownloadItemInfo &info);
+ void setFinished();
+
+ bool downloadFinished = false;
+ quint32 downloadId = -1;
+ qint64 startTime;
+ QWebEngineDownloadRequest::DownloadState downloadState =
+ QWebEngineDownloadRequest::DownloadCancelled;
+ QWebEngineDownloadRequest::SavePageFormat savePageFormat =
+ QWebEngineDownloadRequest::MimeHtmlSaveFormat;
+ QWebEngineDownloadRequest::DownloadInterruptReason interruptReason =
+ QWebEngineDownloadRequest::NoReason;
+ QString downloadPath;
+ QUrl downloadUrl;
+ QString mimeType;
+ bool downloadPaused = false;
+ QString suggestedFileName;
+ QString downloadDirectory;
+ QString downloadFileName;
+ bool isCustomFileName = false;
+ qint64 totalBytes = -1;
+ qint64 receivedBytes = 0;
+ bool isSavePageDownload = false;
+ QWebEngineDownloadRequest *q_ptr;
+ QPointer<QtWebEngineCore::ProfileAdapter> profileAdapter;
+ QtWebEngineCore::WebContentsAdapterClient *adapterClient = nullptr;
+ Q_DECLARE_PUBLIC(QWebEngineDownloadRequest)
+};
+
+QT_END_NAMESPACE
+
+#endif // QWEBENGINEDOWNLOADREQUEST_P_H
diff --git a/src/core/api/qwebenginefilesystemaccessrequest.cpp b/src/core/api/qwebenginefilesystemaccessrequest.cpp
new file mode 100644
index 000000000..3f901b671
--- /dev/null
+++ b/src/core/api/qwebenginefilesystemaccessrequest.cpp
@@ -0,0 +1,126 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qwebenginefilesystemaccessrequest.h"
+
+#include "file_system_access/file_system_access_permission_request_controller.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QWebEngineFileSystemAccessRequest
+ \brief The QWebEngineFileSystemAccessRequest class enables accepting or rejecting
+ requests for local file system access from JavaScript applications.
+
+ \since 6.4
+
+ \inmodule QtWebEngineCore
+
+ To allow web applications to access local files of the computer,
+ applications must connect to QWebEnginePage::fileSystemAccessRequested, which takes a
+ QWebEngineFileSystemAccessRequest instance as an argument.
+
+ If a web applications requests access to local files or directories,
+ QWebEnginePage::fileSystemAccessRequested will be emitted with an
+ QWebEngineFileSystemAccessRequest instance as an argument where accessFlags() indicates
+ the type of the requested access: read, write or both. The signal handler needs to then
+ either call accept() or reject().
+*/
+
+/*!
+ \enum QWebEngineFileSystemAccessRequest::AccessFlag
+
+ This enum describes the type of the requested access: read, write or both. The options
+ can be OR-ed together from the following list:
+
+ \value Read
+ \value Write
+*/
+
+/*!
+ \enum QWebEngineFileSystemAccessRequest::HandleType
+
+ This enum describes the type of the requested file system entry.
+
+ \value File
+ \value Directory
+*/
+
+QWebEngineFileSystemAccessRequest::QWebEngineFileSystemAccessRequest(
+ const QWebEngineFileSystemAccessRequest &other) = default;
+QWebEngineFileSystemAccessRequest &QWebEngineFileSystemAccessRequest::operator=(
+ const QWebEngineFileSystemAccessRequest &other) = default;
+QWebEngineFileSystemAccessRequest::~QWebEngineFileSystemAccessRequest() = default;
+
+/*! \fn bool QWebEngineFileSystemAccessRequest::operator==(const QWebEngineFileSystemAccessRequest &lhs, const QWebEngineFileSystemAccessRequest &rhs)
+ Returns \c true if \a lhs and \a rhs both point to the same request.
+*/
+
+/*! \fn bool QWebEngineFileSystemAccessRequest::operator!=(const QWebEngineFileSystemAccessRequest &lhs, const QWebEngineFileSystemAccessRequest &rhs)
+ Returns \c true if \a lhs and \a rhs point to different requests.
+*/
+
+/*! \internal */
+QWebEngineFileSystemAccessRequest::QWebEngineFileSystemAccessRequest(
+ std::shared_ptr<QtWebEngineCore::FileSystemAccessPermissionRequestController> controller)
+ : d_ptr(std::move(controller))
+{
+}
+
+/*!
+ Rejects a request to access local files.
+*/
+void QWebEngineFileSystemAccessRequest::reject()
+{
+ d_ptr->reject();
+}
+
+/*!
+ Accepts the request to access local files.
+*/
+void QWebEngineFileSystemAccessRequest::accept()
+{
+ d_ptr->accept();
+}
+
+/*!
+ \property QWebEngineFileSystemAccessRequest::origin
+ \brief The URL of the web page that issued the file system access request.
+*/
+
+QUrl QWebEngineFileSystemAccessRequest::origin() const
+{
+ return d_ptr->origin();
+}
+
+/*!
+ \property QWebEngineFileSystemAccessRequest::filePath
+ \brief Returns the file path this file system access request is referring to.
+*/
+
+QUrl QWebEngineFileSystemAccessRequest::filePath() const
+{
+ return d_ptr->filePath();
+}
+
+/*!
+ \property QWebEngineFileSystemAccessRequest::handleType
+ \brief Returns the type of the requested file system entry. (File or directory)
+ */
+HandleType QWebEngineFileSystemAccessRequest::handleType() const
+{
+ return d_ptr->handleType();
+}
+
+/*!
+ \property QWebEngineFileSystemAccessRequest::accessFlags
+ \brief Contains the requested file access rights.
+ */
+AccessFlags QWebEngineFileSystemAccessRequest::accessFlags() const
+{
+ return d_ptr->accessFlags();
+}
+
+QT_END_NAMESPACE
+
+#include "moc_qwebenginefilesystemaccessrequest.cpp"
diff --git a/src/core/api/qwebenginefilesystemaccessrequest.h b/src/core/api/qwebenginefilesystemaccessrequest.h
new file mode 100644
index 000000000..37b1e1861
--- /dev/null
+++ b/src/core/api/qwebenginefilesystemaccessrequest.h
@@ -0,0 +1,70 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QWEBENGINEFILESYSTEMACCESSREQUEST_H
+#define QWEBENGINEFILESYSTEMACCESSREQUEST_H
+
+#include <QtWebEngineCore/qtwebenginecoreglobal.h>
+#include <QtCore/qurl.h>
+#include <memory>
+
+namespace QtWebEngineCore {
+class FileSystemAccessPermissionRequestController;
+class FileSystemAccessPermissionRequestManagerQt;
+}
+
+QT_BEGIN_NAMESPACE
+
+class Q_WEBENGINECORE_EXPORT QWebEngineFileSystemAccessRequest
+{
+ Q_GADGET
+ Q_PROPERTY(QUrl origin READ origin CONSTANT FINAL)
+ Q_PROPERTY(QUrl filePath READ filePath CONSTANT FINAL)
+ Q_PROPERTY(HandleType handleType READ handleType CONSTANT FINAL)
+ Q_PROPERTY(AccessFlags accessFlags READ accessFlags CONSTANT FINAL)
+
+public:
+ QWebEngineFileSystemAccessRequest(const QWebEngineFileSystemAccessRequest &other);
+ QWebEngineFileSystemAccessRequest &operator=(const QWebEngineFileSystemAccessRequest &other);
+ QWebEngineFileSystemAccessRequest(QWebEngineFileSystemAccessRequest &&other) noexcept = default;
+ QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QWebEngineFileSystemAccessRequest)
+ ~QWebEngineFileSystemAccessRequest();
+
+ void swap(QWebEngineFileSystemAccessRequest &other) noexcept { d_ptr.swap(other.d_ptr); }
+
+ enum HandleType { File, Directory };
+ Q_ENUM(HandleType)
+
+ enum AccessFlag { Read = 0x1, Write = 0x2 };
+ Q_DECLARE_FLAGS(AccessFlags, AccessFlag)
+ Q_FLAG(AccessFlags)
+
+ Q_INVOKABLE void accept();
+ Q_INVOKABLE void reject();
+ QUrl origin() const;
+ QUrl filePath() const;
+ HandleType handleType() const;
+ AccessFlags accessFlags() const;
+
+ inline friend bool operator==(const QWebEngineFileSystemAccessRequest &lhs,
+ const QWebEngineFileSystemAccessRequest &rhs) noexcept
+ { return lhs.d_ptr == rhs.d_ptr; }
+ inline friend bool operator!=(const QWebEngineFileSystemAccessRequest &lhs,
+ const QWebEngineFileSystemAccessRequest &rhs) noexcept
+ { return lhs.d_ptr != rhs.d_ptr; }
+
+private:
+ QWebEngineFileSystemAccessRequest(
+ std::shared_ptr<QtWebEngineCore::FileSystemAccessPermissionRequestController>);
+ friend QtWebEngineCore::FileSystemAccessPermissionRequestManagerQt;
+
+ std::shared_ptr<QtWebEngineCore::FileSystemAccessPermissionRequestController> d_ptr;
+};
+
+Q_DECLARE_SHARED(QWebEngineFileSystemAccessRequest)
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(QWebEngineFileSystemAccessRequest::AccessFlags)
+
+QT_END_NAMESPACE
+
+#endif // QWEBENGINEFILESYSTEMACCESSREQUEST_H
diff --git a/src/core/api/qwebenginefindtextresult.cpp b/src/core/api/qwebenginefindtextresult.cpp
index c0adc6177..ce953ddff 100644
--- a/src/core/api/qwebenginefindtextresult.cpp
+++ b/src/core/api/qwebenginefindtextresult.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qwebenginefindtextresult.h"
diff --git a/src/core/api/qwebenginefindtextresult.h b/src/core/api/qwebenginefindtextresult.h
index 246e689c3..d506a50f5 100644
--- a/src/core/api/qwebenginefindtextresult.h
+++ b/src/core/api/qwebenginefindtextresult.h
@@ -1,48 +1,12 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QWEBENGINEFINDTEXTRESULT_H
#define QWEBENGINEFINDTEXTRESULT_H
#include <QtWebEngineCore/qtwebenginecoreglobal.h>
-#include <QtCore/QObject>
-#include <QtCore/QSharedData>
+#include <QtCore/qobject.h>
+#include <QtCore/qshareddata.h>
namespace QtWebEngineCore {
class FindTextHelper;
@@ -52,7 +16,8 @@ QT_BEGIN_NAMESPACE
class QWebEngineFindTextResultPrivate;
-class Q_WEBENGINECORE_EXPORT QWebEngineFindTextResult {
+class Q_WEBENGINECORE_EXPORT QWebEngineFindTextResult
+{
Q_GADGET
Q_PROPERTY(int numberOfMatches READ numberOfMatches CONSTANT FINAL)
Q_PROPERTY(int activeMatch READ activeMatch CONSTANT FINAL)
diff --git a/src/core/api/qwebenginefullscreenrequest.cpp b/src/core/api/qwebenginefullscreenrequest.cpp
new file mode 100644
index 000000000..938aad19c
--- /dev/null
+++ b/src/core/api/qwebenginefullscreenrequest.cpp
@@ -0,0 +1,113 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qwebenginefullscreenrequest.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QWebEngineFullScreenRequest
+ \brief The QWebEngineFullScreenRequest class enables accepting or rejecting
+ requests for entering and exiting the fullscreen mode.
+
+ \since 5.6
+
+ \inmodule QtWebEngineCore
+
+ To allow elements such as videos to be shown in the fullscreen mode,
+ applications must set QWebEngineSettings::FullScreenSupportEnabled and
+ connect to QWebEnginePage::fullScreenRequested, which takes a
+ QWebEngineFullScreenRequest instance as an argument.
+
+ If an element of a web page requests to be shown in the fullscreen mode,
+ QWebEnginePage::fullScreenRequested will be emitted with an
+ QWebEngineFullScreenRequest instance as an argument where toggleOn() returns
+ \c true. The signal handler needs to then either call accept() or reject().
+
+ If the request to enter the fullscreen mode is accepted, the element
+ requesting fullscreen mode will fill the viewport, but it is up to the
+ application to make the view fullscreen or to move the page to a view that
+ is in the fullscreen mode.
+
+ Likewise, a QWebEnginePage::fullScreenRequested will be emitted when
+ the user wants to leave the full screen mode (that is, through the
+ QWebEnginePage::ExitFullScreen context menu action). In this case,
+ toggleOn() will return \c false, and the signal handler again needs to
+ accept() or reject() the request. If it is accepted, the applicaton needs to
+ make sure that the global window state is restored.
+*/
+
+/*!
+ \property QWebEngineFullScreenRequest::toggleOn
+ \brief Whether the web page has issued a request to enter fullscreen mode.
+*/
+
+/*!
+ \property QWebEngineFullScreenRequest::origin
+ \brief The URL to be opened in the fullscreen mode.
+*/
+
+/*
+ Creates a request for opening the \a page from the URL specified by
+ \a origin in the fullscreen mode if \a fullscreen is \c true.
+*/
+
+class QWebEngineFullScreenRequestPrivate : public QSharedData {
+public:
+ QWebEngineFullScreenRequestPrivate(const QUrl &origin, bool toggleOn, const std::function<void (bool)> &setFullScreenCallback)
+ : m_origin(origin)
+ , m_toggleOn(toggleOn)
+ , m_setFullScreenCallback(setFullScreenCallback) { }
+
+ const QUrl m_origin;
+ const bool m_toggleOn;
+ const std::function<void (bool)> m_setFullScreenCallback;
+};
+
+QWebEngineFullScreenRequest::QWebEngineFullScreenRequest(const QUrl &origin, bool toggleOn, const std::function<void (bool)> &setFullScreenCallback)
+ : d_ptr(new QWebEngineFullScreenRequestPrivate(origin, toggleOn, setFullScreenCallback)) { }
+
+QWebEngineFullScreenRequest::QWebEngineFullScreenRequest(const QWebEngineFullScreenRequest &other) = default;
+QWebEngineFullScreenRequest& QWebEngineFullScreenRequest::operator=(const QWebEngineFullScreenRequest &other) = default;
+QWebEngineFullScreenRequest::QWebEngineFullScreenRequest(QWebEngineFullScreenRequest &&other) = default;
+QWebEngineFullScreenRequest& QWebEngineFullScreenRequest::operator=(QWebEngineFullScreenRequest &&other) = default;
+QWebEngineFullScreenRequest::~QWebEngineFullScreenRequest() = default;
+
+/*!
+ Rejects a request to enter or exit the fullscreen mode.
+*/
+void QWebEngineFullScreenRequest::reject()
+{
+ d_ptr->m_setFullScreenCallback(!d_ptr->m_toggleOn);
+}
+
+/*!
+ Accepts the request to enter or exit the fullscreen mode.
+*/
+void QWebEngineFullScreenRequest::accept()
+{
+ d_ptr->m_setFullScreenCallback(d_ptr->m_toggleOn);
+}
+
+/*!
+ \fn QWebEngineFullScreenRequest::toggleOn() const
+ Returns \c true if the web page has issued a request to enter the fullscreen
+ mode, otherwise returns \c false.
+*/
+bool QWebEngineFullScreenRequest::toggleOn() const
+{
+ return d_ptr->m_toggleOn;
+}
+
+/*!
+ \fn QWebEngineFullScreenRequest::origin() const
+ Returns the URL to be opened in the fullscreen mode.
+*/
+QUrl QWebEngineFullScreenRequest::origin() const
+{
+ return d_ptr->m_origin;
+}
+
+QT_END_NAMESPACE
+
+#include "moc_qwebenginefullscreenrequest.cpp"
diff --git a/src/core/api/qwebenginefullscreenrequest.h b/src/core/api/qwebenginefullscreenrequest.h
new file mode 100644
index 000000000..8e25286b6
--- /dev/null
+++ b/src/core/api/qwebenginefullscreenrequest.h
@@ -0,0 +1,46 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QWEBENGINEFULLSCREENREQUEST_H
+#define QWEBENGINEFULLSCREENREQUEST_H
+
+#include <QtWebEngineCore/qtwebenginecoreglobal.h>
+
+#include <QtCore/qglobal.h>
+#include <QtCore/qshareddata.h>
+#include <QtCore/qurl.h>
+
+#include <functional>
+
+QT_BEGIN_NAMESPACE
+
+class QWebEngineFullScreenRequestPrivate;
+
+class Q_WEBENGINECORE_EXPORT QWebEngineFullScreenRequest
+{
+ Q_GADGET
+ Q_PROPERTY(bool toggleOn READ toggleOn CONSTANT)
+ Q_PROPERTY(QUrl origin READ origin CONSTANT)
+
+public:
+ QWebEngineFullScreenRequest(const QWebEngineFullScreenRequest &other);
+ QWebEngineFullScreenRequest &operator=(const QWebEngineFullScreenRequest &other);
+ QWebEngineFullScreenRequest(QWebEngineFullScreenRequest &&other);
+ QWebEngineFullScreenRequest &operator=(QWebEngineFullScreenRequest &&other);
+ ~QWebEngineFullScreenRequest();
+
+ Q_INVOKABLE void reject();
+ Q_INVOKABLE void accept();
+ bool toggleOn() const;
+ QUrl origin() const;
+
+private:
+ friend class QWebEnginePagePrivate;
+ friend class QQuickWebEngineViewPrivate;
+ QWebEngineFullScreenRequest(const QUrl &origin, bool toggleOn, const std::function<void (bool)> &setFullScreenCallback);
+ QExplicitlySharedDataPointer<QWebEngineFullScreenRequestPrivate> d_ptr;
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/core/api/qwebengineglobalsettings.cpp b/src/core/api/qwebengineglobalsettings.cpp
new file mode 100644
index 000000000..6aadd5517
--- /dev/null
+++ b/src/core/api/qwebengineglobalsettings.cpp
@@ -0,0 +1,125 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qwebengineglobalsettings.h"
+#include "qwebengineglobalsettings_p.h"
+#include <QDebug>
+
+#ifdef signals
+#undef signals
+#endif
+
+namespace QtWebEngineCore {
+extern void configureStubHostResolver(QWebEngineGlobalSettings::SecureDnsMode dnsMode,
+ std::string dnsOverHttpsTemplates, bool insecureDnsClientEnabled,
+ bool additionalInsecureDnsTypesEnabled);
+extern bool isValidTemplates(std::string templates);
+
+} // namespace QtWebEngineCore
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \namespace QWebEngineGlobalSettings
+ \brief The QWebEngineGlobalSettings namespace holds global settings of the web engine.
+ \since 6.6
+ \inmodule QtWebEngineCore
+
+ The QWebEngineGlobalSettings namespace holds global properties of the web engine.
+
+ Invoke setDnsMode() to configure DNS-over-HTTPS.
+
+ \sa QWebEngineGlobalSettings::setDnsMode()
+*/
+
+/*!
+ \enum QWebEngineGlobalSettings::SecureDnsMode
+
+ This enum sets the DNS-over-HTTPS mode used by the DnsMode structure:
+
+ \value SystemOnly This is the default. Use the system DNS host resolution.
+ \value SecureWithFallback Enable DNS-over-HTTPS (DoH). DoH servers have to be
+ provided through \l {QWebEngineGlobalSettings::DnsMode::serverTemplates}{serverTemplates} in
+ the DnsMode structure. If a host cannot be resolved via the provided servers,
+ the system DNS host resolution is used.
+ \value SecureOnly Enable DNS-over-HTTPS and only allow hosts to be resolved
+ this way. DoH servers have to be provided through
+ \l {QWebEngineGlobalSettings::DnsMode::serverTemplates}{serverTemplates} in the DnsMode
+ structure. If the DNS-over-HTTPS resolution fails, there is no fallback and the DNS host
+ resolution fails completely.
+*/
+
+/*!
+ \class QWebEngineGlobalSettings::DnsMode
+ \brief The DnsMode struct provides means to specify the DNS host resolution mode.
+ \since 6.6
+ \inmodule QtWebEngineCore
+
+ The QWebEngineGlobalSettings::DnsMode structure describes the DNS mode and
+ the associated DNS server template used for the DNS host resolution.
+*/
+
+/*!
+ \variable QWebEngineGlobalSettings::DnsMode::secureMode
+ \brief The DNS mode used for the host resolution.
+
+ Set \a secureMode to SecureDnsMode::SecureOnly to only allow DNS-over-HTTPS host resolution
+ using servers from \a serverTemplates.
+
+ Set \a secureMode to SecureDnsMode::SecureWithFallback to enable DNS-over-HTTPS host resolution
+ using servers from \a serverTemplates, with a fallback to the system DNS.
+
+ \sa QWebEngineGlobalSettings::SecureDnsMode
+*/
+
+/*!
+ \variable QWebEngineGlobalSettings::DnsMode::serverTemplates
+ \brief A list of server URI templates used for secure DNS-over-HTTPS host resolution.
+
+ The \c serverTemplates structure member lists
+ \l{https://datatracker.ietf.org/d7oc/html/rfc6570}{URI templates}.
+ An example of a URI template is https://dns.google/dns-query{?dns}.
+*/
+
+/*!
+ \fn void QWebEngineGlobalSettings::setDnsMode(DnsMode dnsMode)
+
+ Sets \a dnsMode for DNS-over-HTTPS host resolution.
+
+ This function returns \c false if the \l {QWebEngineGlobalSettings::DnsMode::serverTemplates}
+ {serverTemplates} list in the \l {QWebEngineGlobalSettings::DnsMode}{DnsMode} structure is empty
+ or contains URI templates that cannot be parsed for SecureDnsMode::SecureOnly or
+ SecureDnsMode::SecureWithFallback. Otherwise, it returns \c true meaning that the DNS mode
+ change is triggered.
+*/
+
+bool QWebEngineGlobalSettings::setDnsMode(DnsMode dnsMode)
+{
+ QWebEngineGlobalSettingsPrivate *d = QWebEngineGlobalSettingsPrivate::instance();
+ if (dnsMode.secureMode != SecureDnsMode::SystemOnly) {
+ const QString servers = dnsMode.serverTemplates.join(QChar::Space);
+ const std::string templates = servers.toStdString();
+ if (!QtWebEngineCore::isValidTemplates(templates))
+ return false;
+ d->dnsOverHttpsTemplates = templates;
+ }
+ d->dnsMode = dnsMode.secureMode;
+ d->configureStubHostResolver();
+ return true;
+}
+
+/*!
+ \internal
+*/
+QWebEngineGlobalSettingsPrivate *QWebEngineGlobalSettingsPrivate::instance()
+{
+ static QWebEngineGlobalSettingsPrivate settings;
+ return &settings;
+}
+
+void QWebEngineGlobalSettingsPrivate::configureStubHostResolver()
+{
+ QtWebEngineCore::configureStubHostResolver(dnsMode, dnsOverHttpsTemplates, insecureDnsClientEnabled, additionalInsecureDnsTypesEnabled);
+}
+
+QT_END_NAMESPACE
diff --git a/src/core/api/qwebengineglobalsettings.h b/src/core/api/qwebengineglobalsettings.h
new file mode 100644
index 000000000..a9eff6d12
--- /dev/null
+++ b/src/core/api/qwebengineglobalsettings.h
@@ -0,0 +1,30 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QWEBENGINEGLOBALSETTINGS_H
+#define QWEBENGINEGLOBALSETTINGS_H
+
+#if 0
+#pragma qt_class(QWebEngineGlobalSettings)
+#endif
+
+#include <QtWebEngineCore/qtwebenginecoreglobal.h>
+#include <QtCore/QObject>
+#include <QtCore/QScopedPointer>
+
+QT_BEGIN_NAMESPACE
+
+namespace QWebEngineGlobalSettings {
+// Mapping net::SecureDnsMode
+enum class SecureDnsMode : quint8 { SystemOnly = 0, SecureWithFallback = 1, SecureOnly = 2 };
+struct DnsMode
+{
+ SecureDnsMode secureMode = SecureDnsMode::SystemOnly;
+ QStringList serverTemplates;
+};
+Q_WEBENGINECORE_EXPORT bool setDnsMode(DnsMode dnsMode);
+}
+
+QT_END_NAMESPACE
+
+#endif // QWEBENGINEGLOBALSETTINGS_H
diff --git a/src/core/api/qwebengineglobalsettings_p.h b/src/core/api/qwebengineglobalsettings_p.h
new file mode 100644
index 000000000..8e35ad68c
--- /dev/null
+++ b/src/core/api/qwebengineglobalsettings_p.h
@@ -0,0 +1,44 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QWEBENGINEGLOBALSETTINGS_P_H
+#define QWEBENGINEGLOBALSETTINGS_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qtwebenginecoreglobal_p.h"
+#include "qwebengineglobalsettings.h"
+#include <string>
+
+QT_BEGIN_NAMESPACE
+
+class Q_WEBENGINECORE_EXPORT QWebEngineGlobalSettingsPrivate
+{
+public:
+ QWebEngineGlobalSettingsPrivate()
+ : dnsMode(QWebEngineGlobalSettings::SecureDnsMode::SystemOnly)
+ , dnsOverHttpsTemplates("")
+ , insecureDnsClientEnabled(false)
+ , additionalInsecureDnsTypesEnabled(false){};
+
+ static QWebEngineGlobalSettingsPrivate *instance();
+ QWebEngineGlobalSettings::SecureDnsMode dnsMode;
+ std::string dnsOverHttpsTemplates;
+ const bool insecureDnsClientEnabled;
+ const bool additionalInsecureDnsTypesEnabled;
+
+ void configureStubHostResolver();
+};
+
+QT_END_NAMESPACE
+
+#endif // QWEBENGINEGLOBALSETTINGS_P_H
diff --git a/src/core/api/qwebenginehistory.cpp b/src/core/api/qwebenginehistory.cpp
new file mode 100644
index 000000000..5d2fc8e9e
--- /dev/null
+++ b/src/core/api/qwebenginehistory.cpp
@@ -0,0 +1,389 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qwebenginehistory.h"
+#include "qwebenginehistory_p.h"
+
+#include "web_contents_adapter.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \fn QWebEngineHistoryItem::swap(QWebEngineHistoryItem &other)
+ Swaps the history item with the \a other item.
+*/
+
+QWebEngineHistoryItemPrivate::QWebEngineHistoryItemPrivate(
+ QtWebEngineCore::WebContentsAdapterClient *client, int index)
+ : client(client), index(index)
+{
+}
+
+QtWebEngineCore::WebContentsAdapter *QWebEngineHistoryItemPrivate::adapter() const
+{
+ return client ? client->webContentsAdapter() : nullptr;
+}
+
+QWebEngineHistoryItem::QWebEngineHistoryItem(QWebEngineHistoryItemPrivate *d) : d(d) { }
+QWebEngineHistoryItem::QWebEngineHistoryItem(const QWebEngineHistoryItem &other) = default;
+QWebEngineHistoryItem::QWebEngineHistoryItem(QWebEngineHistoryItem &&other) = default;
+QWebEngineHistoryItem &QWebEngineHistoryItem::operator=(const QWebEngineHistoryItem &other) = default;
+QWebEngineHistoryItem &QWebEngineHistoryItem::operator=(QWebEngineHistoryItem &&other) = default;
+QWebEngineHistoryItem::~QWebEngineHistoryItem() = default;
+
+QUrl QWebEngineHistoryItem::originalUrl() const
+{
+ Q_D(const QWebEngineHistoryItem);
+ return d->adapter() ? d->adapter()->getNavigationEntryOriginalUrl(d->index) : QUrl();
+}
+
+QUrl QWebEngineHistoryItem::url() const
+{
+ Q_D(const QWebEngineHistoryItem);
+ return d->adapter() ? d->adapter()->getNavigationEntryUrl(d->index) : QUrl();
+}
+
+QString QWebEngineHistoryItem::title() const
+{
+ Q_D(const QWebEngineHistoryItem);
+ return d->adapter() ? d->adapter()->getNavigationEntryTitle(d->index) : QString();
+}
+
+QDateTime QWebEngineHistoryItem::lastVisited() const
+{
+ Q_D(const QWebEngineHistoryItem);
+ return d->adapter() ? d->adapter()->getNavigationEntryTimestamp(d->index) : QDateTime();
+}
+
+/*!
+ Returns the URL of the icon associated with the history item.
+
+ \sa url(), originalUrl(), title()
+*/
+QUrl QWebEngineHistoryItem::iconUrl() const
+{
+ Q_D(const QWebEngineHistoryItem);
+ return d->adapter() ? d->adapter()->getNavigationEntryIconUrl(d->index) : QUrl();
+}
+
+bool QWebEngineHistoryItem::isValid() const
+{
+ Q_D(const QWebEngineHistoryItem);
+ if (!d->client)
+ return false;
+ return d->index >= 0 && d->index < d->adapter()->navigationEntryCount();
+}
+
+QWebEngineHistoryPrivate::QWebEngineHistoryPrivate(QtWebEngineCore::WebContentsAdapterClient *client,
+ const ImageProviderUrl &imageProviderUrl)
+ : client(client), imageProviderUrl(imageProviderUrl)
+{
+ Q_ASSERT(client);
+}
+
+QWebEngineHistoryPrivate::~QWebEngineHistoryPrivate()
+{
+ // Invalidate shared item references possibly still out there.
+ QList<QWebEngineHistoryItem>::iterator it, end;
+ for (it = items.begin(), end = items.end(); it != end; ++it)
+ it->d->client = nullptr;
+}
+
+void QWebEngineHistoryPrivate::updateItems() const
+{
+ // Keep track of items we return to be able to invalidate them
+ // and avoid dangling references to our client.
+ int entryCount = adapter()->navigationEntryCount();
+ while (items.size() > entryCount) {
+ items.last().d->client = nullptr;
+ items.removeLast();
+ }
+ while (items.size() < entryCount) {
+ int nextIndex = items.size();
+ items.append(QWebEngineHistoryItem(new QWebEngineHistoryItemPrivate(client, nextIndex)));
+ }
+}
+
+QtWebEngineCore::WebContentsAdapter *QWebEngineHistoryPrivate::adapter() const
+{
+ Q_ASSERT(client->webContentsAdapter());
+ return client->webContentsAdapter();
+}
+
+QWebEngineHistoryModelPrivate::QWebEngineHistoryModelPrivate(const QWebEngineHistoryPrivate *history)
+ : history(history)
+{
+ Q_ASSERT(history);
+}
+
+QWebEngineHistoryModelPrivate::~QWebEngineHistoryModelPrivate()
+{
+}
+
+QtWebEngineCore::WebContentsAdapter *QWebEngineHistoryModelPrivate::adapter() const
+{
+ Q_ASSERT(history->adapter());
+ return history->adapter();
+}
+
+int QWebEngineHistoryModelPrivate::count() const
+{
+ return adapter()->navigationEntryCount();
+}
+
+int QWebEngineHistoryModelPrivate::index(int index) const
+{
+ return index;
+}
+
+int QWebEngineHistoryModelPrivate::offsetForIndex(int index) const
+{
+ return index - adapter()->currentNavigationEntryIndex();
+}
+
+int QWebEngineBackHistoryModelPrivate::count() const
+{
+ return adapter()->currentNavigationEntryIndex();
+}
+
+int QWebEngineBackHistoryModelPrivate::index(int i) const
+{
+ Q_ASSERT(i >= 0 && i < count());
+ return count() - 1 - i;
+}
+
+int QWebEngineBackHistoryModelPrivate::offsetForIndex(int index) const
+{
+ return - index - 1;
+}
+
+int QWebEngineForwardHistoryModelPrivate::count() const
+{
+ if (!adapter()->isInitialized())
+ return 0;
+ return adapter()->navigationEntryCount() - adapter()->currentNavigationEntryIndex() - 1;
+}
+
+int QWebEngineForwardHistoryModelPrivate::index(int i) const
+{
+ return adapter()->currentNavigationEntryIndex() + i + 1;
+}
+
+int QWebEngineForwardHistoryModelPrivate::offsetForIndex(int index) const
+{
+ return index + 1;
+}
+
+QWebEngineHistoryModel::QWebEngineHistoryModel(QWebEngineHistoryModelPrivate *d)
+ : d_ptr(d)
+{
+}
+
+QWebEngineHistoryModel::~QWebEngineHistoryModel()
+{
+}
+
+QHash<int, QByteArray> QWebEngineHistoryModel::roleNames() const
+{
+ QHash<int, QByteArray> roles;
+ roles[Qt::DisplayRole] = "display";
+ roles[Qt::ToolTipRole] = "toolTip";
+ roles[UrlRole] = "url";
+ roles[TitleRole] = "title";
+ roles[OffsetRole] = "offset";
+ roles[IconUrlRole] = "icon";
+ return roles;
+}
+
+int QWebEngineHistoryModel::rowCount(const QModelIndex &index) const
+{
+ Q_UNUSED(index);
+ Q_D(const QWebEngineHistoryModel);
+ return d->count();
+}
+
+QVariant QWebEngineHistoryModel::data(const QModelIndex &index, int role) const
+{
+ Q_D(const QWebEngineHistoryModel);
+
+ if (!index.isValid())
+ return QVariant();
+
+ switch (role) {
+ case Qt::DisplayRole:
+ case TitleRole:
+ return d->adapter()->getNavigationEntryTitle(d->index(index.row()));
+
+ case Qt::ToolTipRole:
+ case UrlRole:
+ return d->adapter()->getNavigationEntryUrl(d->index(index.row()));
+
+ case OffsetRole:
+ return d->offsetForIndex(index.row());
+
+ case IconUrlRole: {
+ QUrl url = QUrl(d->adapter()->getNavigationEntryIconUrl(d->index(index.row())));
+ return d->history->urlOrImageProviderUrl(url);
+ }
+ default:
+ break;
+ }
+
+ return QVariant();
+}
+
+void QWebEngineHistoryModel::reset()
+{
+ beginResetModel();
+ endResetModel();
+}
+
+QWebEngineHistory::QWebEngineHistory(QWebEngineHistoryPrivate *d) : d_ptr(d) { }
+
+QWebEngineHistory::~QWebEngineHistory() { }
+
+void QWebEngineHistory::clear()
+{
+ Q_D(const QWebEngineHistory);
+ d->adapter()->clearNavigationHistory();
+ d->client->updateNavigationActions();
+ reset();
+}
+
+QList<QWebEngineHistoryItem> QWebEngineHistory::items() const
+{
+ Q_D(const QWebEngineHistory);
+ d->updateItems();
+ return d->items;
+}
+
+QList<QWebEngineHistoryItem> QWebEngineHistory::backItems(int maxItems) const
+{
+ Q_D(const QWebEngineHistory);
+ d->updateItems();
+ const int end = currentItemIndex();
+ const int start = std::max(0, end - maxItems);
+ return d->items.mid(start, end - start);
+}
+
+QList<QWebEngineHistoryItem> QWebEngineHistory::forwardItems(int maxItems) const
+{
+ Q_D(const QWebEngineHistory);
+ d->updateItems();
+ const int start = currentItemIndex() + 1;
+ const int end = std::min(count(), start + maxItems);
+ return d->items.mid(start, end - start);
+}
+
+bool QWebEngineHistory::canGoBack() const
+{
+ Q_D(const QWebEngineHistory);
+ return d->adapter()->canGoToOffset(-1);
+}
+
+bool QWebEngineHistory::canGoForward() const
+{
+ Q_D(const QWebEngineHistory);
+ return d->adapter()->canGoToOffset(1);
+}
+
+void QWebEngineHistory::back()
+{
+ Q_D(const QWebEngineHistory);
+ d->adapter()->navigateToOffset(-1);
+}
+
+void QWebEngineHistory::forward()
+{
+ Q_D(const QWebEngineHistory);
+ d->adapter()->navigateToOffset(1);
+}
+
+void QWebEngineHistory::goToItem(const QWebEngineHistoryItem &item)
+{
+ Q_D(const QWebEngineHistory);
+ Q_ASSERT(item.d->client == d->client);
+ d->adapter()->navigateToIndex(item.d->index);
+}
+
+QWebEngineHistoryItem QWebEngineHistory::backItem() const
+{
+ return itemAt(currentItemIndex() - 1);
+}
+
+QWebEngineHistoryItem QWebEngineHistory::currentItem() const
+{
+ return itemAt(currentItemIndex());
+}
+
+QWebEngineHistoryItem QWebEngineHistory::forwardItem() const
+{
+ return itemAt(currentItemIndex() + 1);
+}
+
+QWebEngineHistoryItem QWebEngineHistory::itemAt(int i) const
+{
+ Q_D(const QWebEngineHistory);
+ if (i >= 0 && i < count()) {
+ d->updateItems();
+ return d->items[i];
+ } else {
+ // Return an invalid item right away.
+ QWebEngineHistoryItem item(new QWebEngineHistoryItemPrivate(0, i));
+ Q_ASSERT(!item.isValid());
+ return item;
+ }
+}
+
+int QWebEngineHistory::currentItemIndex() const
+{
+ Q_D(const QWebEngineHistory);
+ return d->adapter()->currentNavigationEntryIndex();
+}
+
+int QWebEngineHistory::count() const
+{
+ Q_D(const QWebEngineHistory);
+ if (!d->adapter()->isInitialized())
+ return 0;
+ return d->adapter()->navigationEntryCount();
+}
+
+QWebEngineHistoryModel *QWebEngineHistory::itemsModel() const
+{
+ Q_D(const QWebEngineHistory);
+ if (!d->navigationModel)
+ d->navigationModel.reset(new QWebEngineHistoryModel(new QWebEngineHistoryModelPrivate(d)));
+ return d->navigationModel.data();
+}
+
+QWebEngineHistoryModel *QWebEngineHistory::backItemsModel() const
+{
+ Q_D(const QWebEngineHistory);
+ if (!d->backNavigationModel)
+ d->backNavigationModel.reset(new QWebEngineHistoryModel(new QWebEngineBackHistoryModelPrivate(d)));
+ return d->backNavigationModel.data();
+}
+
+QWebEngineHistoryModel *QWebEngineHistory::forwardItemsModel() const
+{
+ Q_D(const QWebEngineHistory);
+ if (!d->forwardNavigationModel)
+ d->forwardNavigationModel.reset(new QWebEngineHistoryModel(new QWebEngineForwardHistoryModelPrivate(d)));
+ return d->forwardNavigationModel.data();
+}
+
+void QWebEngineHistory::reset()
+{
+ Q_D(QWebEngineHistory);
+ if (d->navigationModel)
+ d->navigationModel->reset();
+ if (d->backNavigationModel)
+ d->backNavigationModel->reset();
+ if (d->forwardNavigationModel)
+ d->forwardNavigationModel->reset();
+}
+
+QT_END_NAMESPACE
+
+#include "moc_qwebenginehistory.cpp"
diff --git a/src/core/api/qwebenginehistory.h b/src/core/api/qwebenginehistory.h
new file mode 100644
index 000000000..fd54e62a5
--- /dev/null
+++ b/src/core/api/qwebenginehistory.h
@@ -0,0 +1,136 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QWEBENGINEHISTORY_H
+#define QWEBENGINEHISTORY_H
+
+#include <QtWebEngineCore/qtwebenginecoreglobal.h>
+#include <QtCore/qabstractitemmodel.h>
+#include <QtCore/qurl.h>
+#include <QtCore/qstring.h>
+#include <QtCore/qdatetime.h>
+#include <QtCore/qshareddata.h>
+
+QT_BEGIN_NAMESPACE
+
+class QWebEngineHistory;
+class QWebEngineHistoryPrivate;
+class QWebEngineHistoryItemPrivate;
+class QWebEngineHistoryModelPrivate;
+class QWebEnginePagePrivate;
+class QQuickWebEngineViewPrivate;
+
+class Q_WEBENGINECORE_EXPORT QWebEngineHistoryItem
+{
+public:
+ QWebEngineHistoryItem(const QWebEngineHistoryItem &other);
+ QWebEngineHistoryItem(QWebEngineHistoryItem &&other);
+ QWebEngineHistoryItem &operator=(const QWebEngineHistoryItem &other);
+ QWebEngineHistoryItem &operator=(QWebEngineHistoryItem &&other);
+ ~QWebEngineHistoryItem();
+
+ QUrl originalUrl() const;
+ QUrl url() const;
+
+ QString title() const;
+ QDateTime lastVisited() const;
+ QUrl iconUrl() const;
+
+ bool isValid() const;
+
+ void swap(QWebEngineHistoryItem &other) noexcept { d.swap(other.d); }
+
+private:
+ QWebEngineHistoryItem(QWebEngineHistoryItemPrivate *priv);
+ Q_DECLARE_PRIVATE_D(d.data(), QWebEngineHistoryItem)
+ QExplicitlySharedDataPointer<QWebEngineHistoryItemPrivate> d;
+ friend class QWebEngineHistory;
+ friend class QWebEngineHistoryPrivate;
+};
+
+Q_DECLARE_SHARED(QWebEngineHistoryItem)
+
+class Q_WEBENGINECORE_EXPORT QWebEngineHistoryModel : public QAbstractListModel
+{
+ Q_OBJECT
+
+public:
+ enum Roles {
+ UrlRole = Qt::UserRole,
+ TitleRole,
+ OffsetRole,
+ IconUrlRole,
+ };
+
+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
+ QHash<int, QByteArray> roleNames() const override;
+ void reset();
+
+private:
+ QWebEngineHistoryModel(QWebEngineHistoryModelPrivate *);
+ virtual ~QWebEngineHistoryModel();
+
+ Q_DISABLE_COPY(QWebEngineHistoryModel)
+ Q_DECLARE_PRIVATE(QWebEngineHistoryModel)
+ QScopedPointer<QWebEngineHistoryModelPrivate> d_ptr;
+
+ friend class QWebEngineHistory;
+ friend class QWebEngineHistoryPrivate;
+ friend void QScopedPointerDeleter<QWebEngineHistoryModel>::cleanup(QWebEngineHistoryModel *) noexcept;
+};
+
+class Q_WEBENGINECORE_EXPORT QWebEngineHistory : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QWebEngineHistoryModel *items READ itemsModel CONSTANT FINAL)
+ Q_PROPERTY(QWebEngineHistoryModel *backItems READ backItemsModel CONSTANT FINAL)
+ Q_PROPERTY(QWebEngineHistoryModel *forwardItems READ forwardItemsModel CONSTANT FINAL)
+
+public:
+ Q_REVISION(1) Q_INVOKABLE void clear();
+
+ QList<QWebEngineHistoryItem> items() const;
+ QList<QWebEngineHistoryItem> backItems(int maxItems) const;
+ QList<QWebEngineHistoryItem> forwardItems(int maxItems) const;
+
+ bool canGoBack() const;
+ bool canGoForward() const;
+
+ void back();
+ void forward();
+ void goToItem(const QWebEngineHistoryItem &item);
+
+ QWebEngineHistoryItem backItem() const;
+ QWebEngineHistoryItem currentItem() const;
+ QWebEngineHistoryItem forwardItem() const;
+ QWebEngineHistoryItem itemAt(int i) const;
+
+ int currentItemIndex() const;
+
+ int count() const;
+
+ QWebEngineHistoryModel *itemsModel() const;
+ QWebEngineHistoryModel *backItemsModel() const;
+ QWebEngineHistoryModel *forwardItemsModel() const;
+
+private:
+ QWebEngineHistory(QWebEngineHistoryPrivate *d);
+ ~QWebEngineHistory();
+
+ Q_DISABLE_COPY(QWebEngineHistory)
+ Q_DECLARE_PRIVATE(QWebEngineHistory)
+ QScopedPointer<QWebEngineHistoryPrivate> d_ptr;
+
+ void reset();
+
+ friend Q_WEBENGINECORE_EXPORT QDataStream &operator>>(QDataStream &, QWebEngineHistory &);
+ friend Q_WEBENGINECORE_EXPORT QDataStream &operator<<(QDataStream &, const QWebEngineHistory &);
+ friend class QWebEnginePagePrivate;
+ friend class QQuickWebEngineViewPrivate;
+ friend void QScopedPointerDeleter<QWebEngineHistory>::cleanup(QWebEngineHistory *) noexcept;
+};
+
+QT_END_NAMESPACE
+
+#endif // QWEBENGINEHISTORY_H
diff --git a/src/core/api/qwebenginehistory_p.h b/src/core/api/qwebenginehistory_p.h
new file mode 100644
index 000000000..fe28f4a0e
--- /dev/null
+++ b/src/core/api/qwebenginehistory_p.h
@@ -0,0 +1,99 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QWEBENGINEHISTORY_P_H
+#define QWEBENGINEHISTORY_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+#include "qtwebenginecoreglobal_p.h"
+#include "qwebenginehistory.h"
+#include <QtCore/qshareddata.h>
+
+namespace QtWebEngineCore {
+class WebContentsAdapter;
+class WebContentsAdapterClient;
+}
+
+QT_BEGIN_NAMESPACE
+
+class QWebEnginePagePrivate;
+
+class QWebEngineHistoryItemPrivate : public QSharedData
+{
+public:
+ QWebEngineHistoryItemPrivate(QtWebEngineCore::WebContentsAdapterClient *client = nullptr, int index = 0);
+ QtWebEngineCore::WebContentsAdapter *adapter() const;
+ QtWebEngineCore::WebContentsAdapterClient *client;
+ int index;
+};
+
+class QWebEngineHistoryModelPrivate
+{
+public:
+ QWebEngineHistoryModelPrivate(const QWebEngineHistoryPrivate *history);
+ virtual ~QWebEngineHistoryModelPrivate();
+
+ virtual int count() const;
+ virtual int index(int) const;
+ virtual int offsetForIndex(int) const;
+
+ QtWebEngineCore::WebContentsAdapter *adapter() const;
+ const QWebEngineHistoryPrivate *history;
+};
+
+class QWebEngineBackHistoryModelPrivate : public QWebEngineHistoryModelPrivate
+{
+public:
+ QWebEngineBackHistoryModelPrivate(const QWebEngineHistoryPrivate *history)
+ : QWebEngineHistoryModelPrivate(history) { }
+
+ int count() const override;
+ int index(int) const override;
+ int offsetForIndex(int) const override;
+};
+
+class QWebEngineForwardHistoryModelPrivate : public QWebEngineHistoryModelPrivate
+{
+public:
+ QWebEngineForwardHistoryModelPrivate(const QWebEngineHistoryPrivate *history)
+ : QWebEngineHistoryModelPrivate(history) { }
+
+ int count() const override;
+ int index(int) const override;
+ int offsetForIndex(int) const override;
+};
+
+class Q_WEBENGINECORE_EXPORT QWebEngineHistoryPrivate
+{
+public:
+ typedef std::function<QUrl (const QUrl &)> ImageProviderUrl;
+ QWebEngineHistoryPrivate(QtWebEngineCore::WebContentsAdapterClient *client,
+ const ImageProviderUrl &imageProviderUrl = ImageProviderUrl());
+ ~QWebEngineHistoryPrivate();
+
+ void updateItems() const;
+ QtWebEngineCore::WebContentsAdapter *adapter() const;
+
+ QtWebEngineCore::WebContentsAdapterClient *client;
+
+ ImageProviderUrl imageProviderUrl;
+ QUrl urlOrImageProviderUrl(const QUrl &url) const { return imageProviderUrl ? imageProviderUrl(url) : url; }
+
+ mutable QList<QWebEngineHistoryItem> items;
+ mutable QScopedPointer<QWebEngineHistoryModel> navigationModel;
+ mutable QScopedPointer<QWebEngineHistoryModel> backNavigationModel;
+ mutable QScopedPointer<QWebEngineHistoryModel> forwardNavigationModel;
+};
+
+QT_END_NAMESPACE
+
+#endif // QWEBENGINEHISTORY_P_H
diff --git a/src/core/api/qwebenginehttprequest.cpp b/src/core/api/qwebenginehttprequest.cpp
index 3395cc99f..050213d1e 100644
--- a/src/core/api/qwebenginehttprequest.cpp
+++ b/src/core/api/qwebenginehttprequest.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qplatformdefs.h"
#include <QtCore/qshareddata.h>
@@ -72,7 +36,7 @@ public:
QUrl url;
QWebEngineHttpRequest::Method method;
typedef QPair<QByteArray, QByteArray> HeaderPair;
- typedef QVector<HeaderPair> Headers;
+ typedef QList<HeaderPair> Headers;
Headers headers;
QByteArray postData;
@@ -96,7 +60,7 @@ public:
Headers::ConstIterator findHeader(const QByteArray &key) const;
Headers allHeaders() const;
- QVector<QByteArray> headersKeys() const;
+ QList<QByteArray> headersKeys() const;
void setHeader(const QByteArray &key, const QByteArray &value);
void unsetHeader(const QByteArray &key);
void setAllHeaders(const Headers &list);
@@ -182,16 +146,16 @@ QWebEngineHttpRequest QWebEngineHttpRequest::postRequest(const QUrl &url,
QWebEngineHttpRequest result(url);
result.setMethod(QWebEngineHttpRequest::Post);
- QString buffer;
+ QByteArray buffer;
for (QMap<QString, QString>::const_iterator it = postData.begin(); it != postData.end(); it++) {
QByteArray key = QUrl::toPercentEncoding(it.key());
QByteArray value = QUrl::toPercentEncoding(it.value());
- if (buffer.length() > 0)
- buffer += QLatin1Char('&');
- buffer += key + QLatin1Char('=') + value;
+ if (buffer.size() > 0)
+ buffer += '&';
+ buffer.append(key).append('=').append(value);
}
- result.setPostData(buffer.toLatin1());
+ result.setPostData(buffer);
result.setHeader(QByteArrayLiteral("Content-Type"),
QByteArrayLiteral("application/x-www-form-urlencoded"));
@@ -293,7 +257,7 @@ QByteArray QWebEngineHttpRequest::header(const QByteArray &headerName) const
\sa setHeader(), header(), hasHeader(), unsetHeader()
*/
-QVector<QByteArray> QWebEngineHttpRequest::headers() const
+QList<QByteArray> QWebEngineHttpRequest::headers() const
{
return d->headersKeys();
}
@@ -339,9 +303,9 @@ QWebEngineHttpRequestPrivate::Headers QWebEngineHttpRequestPrivate::allHeaders()
return headers;
}
-QVector<QByteArray> QWebEngineHttpRequestPrivate::headersKeys() const
+QList<QByteArray> QWebEngineHttpRequestPrivate::headersKeys() const
{
- QVector<QByteArray> result;
+ QList<QByteArray> result;
result.reserve(headers.size());
Headers::ConstIterator it = headers.constBegin(), end = headers.constEnd();
for (; it != end; ++it)
diff --git a/src/core/api/qwebenginehttprequest.h b/src/core/api/qwebenginehttprequest.h
index 1c4d7837b..6c0298f86 100644
--- a/src/core/api/qwebenginehttprequest.h
+++ b/src/core/api/qwebenginehttprequest.h
@@ -1,49 +1,13 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QWEBENGINEHTTPREQUEST_H
#define QWEBENGINEHTTPREQUEST_H
#include <QtWebEngineCore/qtwebenginecoreglobal.h>
-#include <QtCore/qshareddata.h>
-#include <QtCore/qvector.h>
+#include <QtCore/qlist.h>
#include <QtCore/qmap.h>
+#include <QtCore/qshareddata.h>
#include <QtCore/qstring.h>
#include <QtCore/qurl.h>
@@ -51,7 +15,8 @@ QT_BEGIN_NAMESPACE
class QWebEngineHttpRequestPrivate;
-class Q_WEBENGINECORE_EXPORT QWebEngineHttpRequest {
+class Q_WEBENGINECORE_EXPORT QWebEngineHttpRequest
+{
public:
enum Method {
Get,
@@ -72,7 +37,7 @@ public:
QWebEngineHttpRequest &operator=(const QWebEngineHttpRequest &other);
static QWebEngineHttpRequest postRequest(const QUrl &url, const QMap<QString, QString> &postData);
- void swap(QWebEngineHttpRequest &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QWebEngineHttpRequest &other) noexcept { d.swap(other.d); }
bool operator==(const QWebEngineHttpRequest &other) const;
inline bool operator!=(const QWebEngineHttpRequest &other) const { return !operator==(other); }
@@ -87,14 +52,13 @@ public:
void setPostData(const QByteArray &postData);
bool hasHeader(const QByteArray &headerName) const;
- QVector<QByteArray> headers() const;
+ QList<QByteArray> headers() const;
QByteArray header(const QByteArray &headerName) const;
void setHeader(const QByteArray &headerName, const QByteArray &value);
void unsetHeader(const QByteArray &headerName);
private:
QSharedDataPointer<QWebEngineHttpRequestPrivate> d;
- friend class QWebEngineHttpRequestPrivate;
};
Q_DECLARE_SHARED(QWebEngineHttpRequest)
diff --git a/src/core/api/qwebengineloadinginfo.cpp b/src/core/api/qwebengineloadinginfo.cpp
new file mode 100644
index 000000000..a72117e9d
--- /dev/null
+++ b/src/core/api/qwebengineloadinginfo.cpp
@@ -0,0 +1,180 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include <qwebengineloadinginfo.h>
+
+#include <web_engine_error.h>
+
+QT_BEGIN_NAMESPACE
+
+using LoadStatus = QWebEngineLoadingInfo::LoadStatus;
+using ErrorDomain = QWebEngineLoadingInfo::ErrorDomain;
+
+Q_STATIC_ASSERT(static_cast<int>(WebEngineError::NoErrorDomain) == static_cast<int>(ErrorDomain::NoErrorDomain));
+Q_STATIC_ASSERT(static_cast<int>(WebEngineError::InternalErrorDomain) == static_cast<int>(ErrorDomain::InternalErrorDomain));
+Q_STATIC_ASSERT(static_cast<int>(WebEngineError::ConnectionErrorDomain) == static_cast<int>(ErrorDomain::ConnectionErrorDomain));
+Q_STATIC_ASSERT(static_cast<int>(WebEngineError::CertificateErrorDomain) == static_cast<int>(ErrorDomain::CertificateErrorDomain));
+Q_STATIC_ASSERT(static_cast<int>(WebEngineError::HttpErrorDomain) == static_cast<int>(ErrorDomain::HttpErrorDomain));
+Q_STATIC_ASSERT(static_cast<int>(WebEngineError::FtpErrorDomain) == static_cast<int>(ErrorDomain::FtpErrorDomain));
+Q_STATIC_ASSERT(static_cast<int>(WebEngineError::DnsErrorDomain) == static_cast<int>(ErrorDomain::DnsErrorDomain));
+Q_STATIC_ASSERT(static_cast<int>(WebEngineError::HttpStatusCodeDomain) == static_cast<int>(ErrorDomain::HttpStatusCodeDomain));
+
+class QWebEngineLoadingInfo::QWebEngineLoadingInfoPrivate : public QSharedData {
+public:
+ QWebEngineLoadingInfoPrivate(const QUrl& url, LoadStatus status, bool isErrorPage,
+ const QString& errorString, int errorCode, ErrorDomain errorDomain,
+ const QMultiMap<QByteArray,QByteArray>& responseHeaders)
+ : url(url)
+ , status(status)
+ , isErrorPage(isErrorPage)
+ , errorString(errorString)
+ , errorCode(errorCode)
+ , errorDomain(errorDomain)
+ , responseHeaders(responseHeaders)
+ {
+ }
+
+ QUrl url;
+ LoadStatus status;
+ bool isErrorPage;
+ QString errorString;
+ int errorCode;
+ ErrorDomain errorDomain;
+ QMultiMap<QByteArray,QByteArray> responseHeaders;
+};
+
+/*!
+ \class QWebEngineLoadingInfo
+ \brief A utility type for the WebEngineView::loadingChanged signal.
+ \inmodule QtWebEngineCore
+ \since 6.2
+
+ Contains information about a web page loading status change, such as the URL and
+ current loading status (started, succeeded, stopped, failed).
+
+ \sa QWebEnginePage::loadStarted, QWebEnginePage::loadFinished, WebEngineView::loadingChanged
+*/
+QWebEngineLoadingInfo::QWebEngineLoadingInfo(const QUrl& url, LoadStatus status, bool isErrorPage,
+ const QString& errorString, int errorCode, ErrorDomain errorDomain,
+ const QMultiMap<QByteArray,QByteArray>& responseHeaders)
+ : d_ptr(new QWebEngineLoadingInfoPrivate(url, status, isErrorPage, errorString, errorCode, errorDomain,
+ responseHeaders))
+{
+}
+
+QWebEngineLoadingInfo::QWebEngineLoadingInfo(const QWebEngineLoadingInfo &other) = default;
+QWebEngineLoadingInfo& QWebEngineLoadingInfo::operator=(const QWebEngineLoadingInfo &other) = default;
+QWebEngineLoadingInfo::QWebEngineLoadingInfo(QWebEngineLoadingInfo &&other) = default;
+QWebEngineLoadingInfo& QWebEngineLoadingInfo::operator=(QWebEngineLoadingInfo &&other) = default;
+
+QWebEngineLoadingInfo::~QWebEngineLoadingInfo()
+{
+}
+/*!
+ \property QWebEngineLoadingInfo::url
+ \brief Holds the URL of the load request.
+*/
+/*!
+ Returns the URL of the load request.
+*/
+QUrl QWebEngineLoadingInfo::url() const
+{
+ Q_D(const QWebEngineLoadingInfo);
+ return d->url;
+}
+/*!
+ \enum QWebEngineLoadingInfo::LoadStatus
+
+ This enumeration represents the load status of a web page load request:
+
+ \value LoadStartedStatus Page is currently loading.
+ \value LoadStoppedStatus
+ Loading the page was stopped by the stop() method or by the loader
+ code or network stack in Chromium.
+ \value LoadSucceededStatus Page has been loaded with success.
+ \value LoadFailedStatus Page could not be loaded.
+*/
+/*!
+ \property QWebEngineLoadingInfo::status
+ \brief The load status of the page.
+*/
+LoadStatus QWebEngineLoadingInfo::status() const
+{
+ Q_D(const QWebEngineLoadingInfo);
+ return d->status;
+}
+/*!
+ \property QWebEngineLoadingInfo::isErrorPage
+ \brief Indicates if the load resulted in an error page.
+*/
+bool QWebEngineLoadingInfo::isErrorPage() const
+{
+ Q_D(const QWebEngineLoadingInfo);
+ return d->isErrorPage;
+}
+/*!
+ \property QWebEngineLoadingInfo::errorString
+ \brief Holds the error message.
+*/
+QString QWebEngineLoadingInfo::errorString() const
+{
+ Q_D(const QWebEngineLoadingInfo);
+ return d->errorString;
+}
+/*!
+ \enum QWebEngineLoadingInfo::ErrorDomain
+ This enumeration holds the type of a load error:
+
+ \value NoErrorDomain
+ Error type is not known.
+ \value InternalErrorDomain
+ Content cannot be interpreted by \QWE.
+ \value ConnectionErrorDomain
+ Error results from a faulty network connection.
+ \value CertificateErrorDomain
+ Error is related to the SSL/TLS certificate.
+ \value HttpErrorDomain
+ Error is related to the HTTP connection.
+ \value FtpErrorDomain
+ Error is related to the FTP connection.
+ \value DnsErrorDomain
+ Error is related to the DNS connection.
+ \value HttpStatusCodeDomain
+ Error is the HTTP response status code, even in case of success e.g. the server replied with status 200.
+*/
+/*
+ \property QWebEngineLoadingInfo::errorDomain
+ \brief Holds the error domain.
+*/
+ErrorDomain QWebEngineLoadingInfo::errorDomain() const
+{
+ Q_D(const QWebEngineLoadingInfo);
+ return d->errorDomain;
+}
+
+/*!
+ \property QWebEngineLoadingInfo::errorCode
+ \brief Holds the error code.
+*/
+int QWebEngineLoadingInfo::errorCode() const
+{
+ Q_D(const QWebEngineLoadingInfo);
+ return d->errorCode;
+}
+
+/*!
+ \property QWebEngineLoadingInfo::responseHeaders
+ \since 6.6
+ \brief Holds the response headers when \c QWebEngineLoadingInfo::status()
+ is equal to \c QWebEngineLoadingInfo::LoadSucceededStatus or
+ \c QWebEngineLoadingInfo::LoadFailedStatus.
+*/
+QMultiMap<QByteArray,QByteArray> QWebEngineLoadingInfo::responseHeaders() const
+{
+ Q_D(const QWebEngineLoadingInfo);
+ return d->responseHeaders;
+}
+
+QT_END_NAMESPACE
+
+#include "moc_qwebengineloadinginfo.cpp"
diff --git a/src/core/api/qwebengineloadinginfo.h b/src/core/api/qwebengineloadinginfo.h
new file mode 100644
index 000000000..48d14601a
--- /dev/null
+++ b/src/core/api/qwebengineloadinginfo.h
@@ -0,0 +1,82 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QWEBENGINELOADINGINFO_H
+#define QWEBENGINELOADINGINFO_H
+
+#include <QtWebEngineCore/qtwebenginecoreglobal.h>
+
+#include <QtCore/qmap.h>
+#include <QtCore/qobject.h>
+#include <QtCore/qshareddata.h>
+#include <QtCore/qurl.h>
+
+namespace QtWebEngineCore {
+class WebContentsAdapter;
+class WebContentsDelegateQt;
+}
+
+QT_BEGIN_NAMESPACE
+
+class Q_WEBENGINECORE_EXPORT QWebEngineLoadingInfo
+{
+ Q_GADGET
+ Q_PROPERTY(QUrl url READ url CONSTANT FINAL)
+ Q_PROPERTY(bool isErrorPage READ isErrorPage CONSTANT FINAL)
+ Q_PROPERTY(LoadStatus status READ status CONSTANT FINAL)
+ Q_PROPERTY(QString errorString READ errorString CONSTANT FINAL)
+ Q_PROPERTY(ErrorDomain errorDomain READ errorDomain CONSTANT FINAL)
+ Q_PROPERTY(int errorCode READ errorCode CONSTANT FINAL)
+ Q_PROPERTY(QMultiMap<QByteArray,QByteArray> responseHeaders READ responseHeaders CONSTANT REVISION(6,6) FINAL)
+
+public:
+ enum LoadStatus {
+ LoadStartedStatus,
+ LoadStoppedStatus,
+ LoadSucceededStatus,
+ LoadFailedStatus
+ };
+ Q_ENUM(LoadStatus)
+
+ enum ErrorDomain {
+ NoErrorDomain,
+ InternalErrorDomain,
+ ConnectionErrorDomain,
+ CertificateErrorDomain,
+ HttpErrorDomain,
+ FtpErrorDomain,
+ DnsErrorDomain,
+ HttpStatusCodeDomain
+ };
+ Q_ENUM(ErrorDomain)
+
+ QWebEngineLoadingInfo(const QWebEngineLoadingInfo &other);
+ QWebEngineLoadingInfo &operator=(const QWebEngineLoadingInfo &other);
+ QWebEngineLoadingInfo(QWebEngineLoadingInfo &&other);
+ QWebEngineLoadingInfo &operator=(QWebEngineLoadingInfo &&other);
+ ~QWebEngineLoadingInfo();
+
+ QUrl url() const;
+ bool isErrorPage() const;
+ LoadStatus status() const;
+ QString errorString() const;
+ ErrorDomain errorDomain() const;
+ int errorCode() const;
+ QMultiMap<QByteArray,QByteArray> responseHeaders() const;
+
+private:
+ QWebEngineLoadingInfo(const QUrl &url, LoadStatus status, bool isErrorPage = false,
+ const QString &errorString = QString(), int errorCode = 0,
+ ErrorDomain errorDomain = NoErrorDomain,
+ const QMultiMap<QByteArray,QByteArray> &responseHeaders = {});
+ class QWebEngineLoadingInfoPrivate;
+ Q_DECLARE_PRIVATE(QWebEngineLoadingInfo)
+ QExplicitlySharedDataPointer<QWebEngineLoadingInfoPrivate> d_ptr;
+ friend class QQuickWebEngineViewPrivate;
+ friend class QtWebEngineCore::WebContentsAdapter;
+ friend class QtWebEngineCore::WebContentsDelegateQt;
+};
+
+QT_END_NAMESPACE
+
+#endif // QWEBENGINELOADINGINFO_H
diff --git a/src/core/api/qwebenginemessagepumpscheduler.cpp b/src/core/api/qwebenginemessagepumpscheduler.cpp
index 34cbc49bf..a435e2c0c 100644
--- a/src/core/api/qwebenginemessagepumpscheduler.cpp
+++ b/src/core/api/qwebenginemessagepumpscheduler.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qwebenginemessagepumpscheduler_p.h"
@@ -47,9 +11,14 @@ QWebEngineMessagePumpScheduler::QWebEngineMessagePumpScheduler(std::function<voi
: m_callback(std::move(callback))
{}
-void QWebEngineMessagePumpScheduler::scheduleWork()
+void QWebEngineMessagePumpScheduler::scheduleImmediateWork()
{
- QCoreApplication::postEvent(this, new QTimerEvent(0));
+ QCoreApplication::postEvent(this, new QTimerEvent(0), Qt::NormalEventPriority);
+}
+
+void QWebEngineMessagePumpScheduler::scheduleIdleWork()
+{
+ QCoreApplication::postEvent(this, new QTimerEvent(0), Qt::LowEventPriority);
}
void QWebEngineMessagePumpScheduler::scheduleDelayedWork(int delay)
@@ -70,3 +39,5 @@ void QWebEngineMessagePumpScheduler::timerEvent(QTimerEvent *ev)
m_timerId = 0;
m_callback();
}
+
+#include "moc_qwebenginemessagepumpscheduler_p.cpp"
diff --git a/src/core/api/qwebenginemessagepumpscheduler_p.h b/src/core/api/qwebenginemessagepumpscheduler_p.h
index 07b2ca203..37f7dd9a6 100644
--- a/src/core/api/qwebenginemessagepumpscheduler_p.h
+++ b/src/core/api/qwebenginemessagepumpscheduler_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QWEBENGINEMESSAGEPUMPSCHEDULER_P_H
#define QWEBENGINEMESSAGEPUMPSCHEDULER_P_H
@@ -59,11 +23,13 @@
QT_BEGIN_NAMESPACE
-class Q_WEBENGINECORE_PRIVATE_EXPORT QWebEngineMessagePumpScheduler : public QObject {
+class Q_WEBENGINECORE_EXPORT QWebEngineMessagePumpScheduler : public QObject
+{
Q_OBJECT
public:
QWebEngineMessagePumpScheduler(std::function<void()> callback);
- void scheduleWork();
+ void scheduleImmediateWork();
+ void scheduleIdleWork();
void scheduleDelayedWork(int delay);
protected:
diff --git a/src/core/api/qwebenginenavigationrequest.cpp b/src/core/api/qwebenginenavigationrequest.cpp
new file mode 100644
index 000000000..0a30f6472
--- /dev/null
+++ b/src/core/api/qwebenginenavigationrequest.cpp
@@ -0,0 +1,185 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qwebenginenavigationrequest.h"
+
+#include "qwebenginepage.h"
+
+QT_BEGIN_NAMESPACE
+
+class QWebEngineNavigationRequestPrivate {
+public:
+ QWebEngineNavigationRequestPrivate(const QUrl& url, QWebEngineNavigationRequest::NavigationType navigationType, bool mainFrame)
+ : url(url)
+ , navigationType(navigationType)
+ , isMainFrame(mainFrame)
+ {}
+
+ QUrl url;
+ QWebEngineNavigationRequest::NavigationType navigationType;
+ bool isMainFrame;
+ bool isAccepted = true;
+};
+
+/*!
+ \class QWebEngineNavigationRequest
+ \brief A utility type for the QWebEnginePage::navigationRequested signal.
+ \since 6.2
+
+ \inmodule QtWebEngineCore
+
+ Contains information about a navigation request.
+
+ To accept or reject a request, call accept() or reject().
+
+ The default if not handled is to accept the navigation.
+
+ \sa QWebEnginePage::navigationRequested
+*/
+
+/*!
+ \qmltype WebEngineNavigationRequest
+ \instantiates QWebEngineNavigationRequest
+ \inqmlmodule QtWebEngine
+ \since QtWebEngine 1.0
+
+ \brief Represents a request for navigating to a web page as part of
+ \l{WebEngineView::navigationRequested()}.
+
+ To accept or reject a request, call accept() or reject().
+*/
+
+/*! \internal
+*/
+QWebEngineNavigationRequest::QWebEngineNavigationRequest(const QUrl& url, QWebEngineNavigationRequest::NavigationType navigationType, bool mainFrame, QObject* parent)
+ : QObject(parent)
+ , d_ptr(new QWebEngineNavigationRequestPrivate(url, navigationType, mainFrame))
+{
+}
+
+QWebEngineNavigationRequest::~QWebEngineNavigationRequest()
+{
+}
+
+#if QT_DEPRECATED_SINCE(6, 2)
+/*!
+ \qmlproperty enumeration WebEngineNavigationRequest::action
+
+ Whether to accept or ignore the navigation request.
+
+ \value WebEngineNavigationRequest.AcceptRequest
+ Accepts a navigation request.
+ \value WebEngineNavigationRequest.IgnoreRequest
+ Ignores a navigation request.
+*/
+QWebEngineNavigationRequest::NavigationRequestAction QWebEngineNavigationRequest::action() const
+{
+ qWarning("Navigation request: action/setAction are deprecated. Please, use accept/reject methods instead.");
+ Q_D(const QWebEngineNavigationRequest);
+ return d->isAccepted ? AcceptRequest : IgnoreRequest;
+}
+
+/*! \internal */
+void QWebEngineNavigationRequest::setAction(QWebEngineNavigationRequest::NavigationRequestAction action)
+{
+ qWarning("Navigation request: action/setAction are deprecated. Please, use accept/reject methods instead.");
+ Q_D(QWebEngineNavigationRequest);
+ bool acceptRequest = action == AcceptRequest;
+ if (d->isAccepted == acceptRequest)
+ return;
+
+ acceptRequest ? accept() : reject();
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
+ emit actionChanged();
+QT_WARNING_POP
+}
+#endif
+/*!
+ Accepts a navigation request.
+*/
+void QWebEngineNavigationRequest::accept()
+{
+ d_ptr->isAccepted = true;
+}
+/*!
+ Rejects a navigation request.
+*/
+void QWebEngineNavigationRequest::reject()
+{
+ d_ptr->isAccepted = false;
+}
+/*!
+ \property QWebEngineNavigationRequest::url
+ \brief The URL of the web page to go to.
+*/
+/*!
+ \qmlproperty url WebEngineNavigationRequest::url
+ \readonly
+
+ The URL of the web page to go to.
+*/
+
+QUrl QWebEngineNavigationRequest::url() const
+{
+ Q_D(const QWebEngineNavigationRequest);
+ return d->url;
+}
+/*!
+ \property QWebEngineNavigationRequest::navigationType
+ \brief The method used to navigate to a web page.
+*/
+/*!
+ \qmlproperty enumeration WebEngineNavigationRequest::navigationType
+ \readonly
+
+ The method used to navigate to a web page.
+
+ \value WebEngineNavigationRequest.LinkClickedNavigation
+ Clicking a link.
+ \value WebEngineNavigationRequest.TypedNavigation
+ Entering an URL on the address bar.
+ \value WebEngineNavigationRequest.FormSubmittedNavigation
+ Submitting a form.
+ \value WebEngineNavigationRequest.BackForwardNavigation
+ Using navigation history to go to the previous or next page.
+ \value WebEngineNavigationRequest.ReloadNavigation
+ Reloading the page.
+ \value WebEngineNavigationRequest.RedirectNavigation
+ Page content or server triggered a redirection or page refresh.
+ \value WebEngineNavigationRequest.OtherNavigation
+ Using some other method to go to a page.
+*/
+
+QWebEngineNavigationRequest::NavigationType QWebEngineNavigationRequest::navigationType() const
+{
+ Q_D(const QWebEngineNavigationRequest);
+ return d->navigationType;
+}
+
+/*!
+ \property QWebEngineNavigationRequest::isMainFrame
+ \brief Whether the navigation issue is requested for a top level page.
+*/
+/*!
+ \qmlproperty bool WebEngineNavigationRequest::isMainFrame
+ \readonly
+
+ Whether the navigation issue is requested for a top level page.
+*/
+
+bool QWebEngineNavigationRequest::isMainFrame() const
+{
+ Q_D(const QWebEngineNavigationRequest);
+ return d->isMainFrame;
+}
+
+/*! \internal */
+bool QWebEngineNavigationRequest::isAccepted() const
+{
+ return d_ptr->isAccepted;
+}
+
+QT_END_NAMESPACE
+
+#include "moc_qwebenginenavigationrequest.cpp"
diff --git a/src/core/api/qwebenginenavigationrequest.h b/src/core/api/qwebenginenavigationrequest.h
new file mode 100644
index 000000000..12fc2b4a1
--- /dev/null
+++ b/src/core/api/qwebenginenavigationrequest.h
@@ -0,0 +1,76 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QWEBENGINENAVIGATIONREQUEST_H
+#define QWEBENGINENAVIGATIONREQUEST_H
+
+#include <QtWebEngineCore/qtwebenginecoreglobal.h>
+#include <QtCore/qobject.h>
+#include <QtCore/qurl.h>
+
+QT_BEGIN_NAMESPACE
+
+class QWebEngineNavigationRequestPrivate;
+
+class Q_WEBENGINECORE_EXPORT QWebEngineNavigationRequest : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QUrl url READ url CONSTANT FINAL)
+ Q_PROPERTY(bool isMainFrame READ isMainFrame CONSTANT FINAL)
+ Q_PROPERTY(NavigationType navigationType READ navigationType CONSTANT FINAL)
+
+public:
+ ~QWebEngineNavigationRequest();
+
+ // must match WebContentsAdapterClient::NavigationType
+ enum NavigationType {
+ LinkClickedNavigation,
+ TypedNavigation,
+ FormSubmittedNavigation,
+ BackForwardNavigation,
+ ReloadNavigation,
+ OtherNavigation,
+ RedirectNavigation,
+ };
+ Q_ENUM(NavigationType)
+
+ QUrl url() const;
+ bool isMainFrame() const;
+ NavigationType navigationType() const;
+
+ Q_INVOKABLE void accept();
+ Q_INVOKABLE void reject();
+
+#if QT_DEPRECATED_SINCE(6, 2)
+ enum NavigationRequestAction {
+ AcceptRequest,
+ IgnoreRequest = 0xFF
+ };
+ Q_ENUM(NavigationRequestAction)
+
+private:
+ Q_PROPERTY(NavigationRequestAction action READ action WRITE setAction NOTIFY actionChanged FINAL)
+
+ QT_DEPRECATED NavigationRequestAction action() const;
+ QT_DEPRECATED_X("Use accept/reject methods to handle the request")
+ void setAction(NavigationRequestAction action);
+
+Q_SIGNALS:
+ QT_DEPRECATED void actionChanged();
+#endif
+
+private:
+ QWebEngineNavigationRequest(const QUrl &url, NavigationType navigationType, bool mainFrame,
+ QObject *parent = nullptr);
+
+ friend class QWebEnginePagePrivate;
+ friend class QQuickWebEngineViewPrivate;
+ bool isAccepted() const;
+
+ Q_DECLARE_PRIVATE(QWebEngineNavigationRequest)
+ QScopedPointer<QWebEngineNavigationRequestPrivate> d_ptr;
+};
+
+QT_END_NAMESPACE
+
+#endif // QWEBENGINENAVIGATIONREQUEST_H
diff --git a/src/core/api/qwebenginenewwindowrequest.cpp b/src/core/api/qwebenginenewwindowrequest.cpp
new file mode 100644
index 000000000..895033fd1
--- /dev/null
+++ b/src/core/api/qwebenginenewwindowrequest.cpp
@@ -0,0 +1,157 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qwebenginenewwindowrequest.h"
+#include "qwebenginenewwindowrequest_p.h"
+
+#include "qwebenginepage.h"
+
+#include "web_contents_adapter.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QWebEngineNewWindowRequest
+ \brief A utility type for the QWebEnginePage::newWindowRequested() signal.
+ \since 6.2
+
+ \inmodule QtWebEngineCore
+
+ Contains information about a request to load a page in a separate web engine view.
+
+ \sa QWebEnginePage::newWindowRequested()
+*/
+
+/*!
+ \qmltype WebEngineNewWindowRequest
+ \instantiates QWebEngineNewWindowRequest
+ \inqmlmodule QtWebEngine
+ \since QtWebEngine 1.12
+
+ \brief A utility type for the WebEngineView::newWindowRequested signal.
+
+ Contains information about a request to load a page in a separate web engine view.
+
+ \sa WebEngineView::newWindowRequested
+*/
+
+/*!
+ \enum QWebEngineNewWindowRequest::DestinationType
+
+ This enum describes the type of window requested:
+
+ \value InNewWindow
+ In a separate window.
+ \value InNewTab
+ In a tab of the same window.
+ \value InNewDialog
+ In a window without a tab bar, toolbar, or URL bar.
+ \value InNewBackgroundTab
+ In a tab of the same window, without hiding the currently visible web engine view.
+*/
+
+/*!
+ \qmlproperty enumeration WebEngineNewWindowRequest::DestinationType
+
+ Describes how to open a new view:
+
+ \value WebEngineNewWindowRequest.InNewWindow
+ In a separate window.
+ \value WebEngineNewWindowRequest.InNewTab
+ In a tab of the same window.
+ \value WebEngineNewWindowRequest.InNewDialog
+ In a window without a tab bar, toolbar, or URL bar.
+ \value WebEngineNewWindowRequest.InNewBackgroundTab
+ In a tab of the same window, without hiding the currently visible web engine view.
+*/
+
+QWebEngineNewWindowRequest::QWebEngineNewWindowRequest(QWebEngineNewWindowRequest::DestinationType destination,
+ const QRect &geometry,
+ const QUrl &url,
+ bool userInitiated,
+ QSharedPointer<QtWebEngineCore::WebContentsAdapter> adapter,
+ QObject *parent)
+ : QObject(parent)
+ , d_ptr(new QWebEngineNewWindowRequestPrivate{destination, geometry, url, adapter, userInitiated})
+{
+}
+
+QWebEngineNewWindowRequest::~QWebEngineNewWindowRequest()
+{
+}
+
+/*!
+ \property QWebEngineNewWindowRequest::destination
+ \brief The type of window that is requested.
+*/
+/*!
+ \qmlproperty WebEngineNewWindowRequest::DestinationType WebEngineNewWindowRequest::destination
+ \brief The type of window that is requested.
+*/
+QWebEngineNewWindowRequest::DestinationType QWebEngineNewWindowRequest::destination() const
+{
+ return d_ptr->destination;
+}
+
+/*!
+ \property QWebEngineNewWindowRequest::requestedUrl
+ \brief The URL that is requested for the new page.
+*/
+/*!
+ \qmlproperty QUrl WebEngineNewWindowRequest::requestedUrl
+ \brief The URL that is requested for the new page.
+ \since QtWebEngine 1.5
+ */
+QUrl QWebEngineNewWindowRequest::requestedUrl() const
+{
+ return d_ptr->requestedUrl;
+}
+
+/*!
+ \property QWebEngineNewWindowRequest::requestedGeometry
+ \brief The size that is requested for the new page.
+*/
+/*!
+ \qmlproperty QRect WebEngineNewWindowRequest::requestedGeometry
+ \brief The size that is requested for the new page.
+ \since QtWebEngine 2.0
+ */
+QRect QWebEngineNewWindowRequest::requestedGeometry() const
+{
+ return d_ptr->requestedGeometry;
+}
+
+/*!
+ \property QWebEngineNewWindowRequest::userInitiated
+ Whether this page request was directly triggered as the result of a keyboard or mouse event.
+
+ You can use this property to block automatic \e popups.
+*/
+/*!
+ \qmlproperty bool WebEngineNewWindowRequest::userInitiated
+ Whether this window request was directly triggered as the result of a keyboard or mouse event.
+
+ You can use this property to block automatic \e popups.
+ */
+bool QWebEngineNewWindowRequest::isUserInitiated() const
+{
+ return d_ptr->isUserInitiated;
+}
+
+/*!
+ Opens the requested window in the view represented by \a page.
+
+ \sa QWebEnginePage::newWindowRequested
+*/
+void QWebEngineNewWindowRequest::openIn(QWebEnginePage *page)
+{
+ if (!page) {
+ qWarning("Trying to open a QWebEngineNewWindowRequest in an invalid QWebEnginePage.");
+ return;
+ }
+ page->acceptAsNewWindow(*this);
+}
+
+QT_END_NAMESPACE
+
+#include "moc_qwebenginenewwindowrequest.cpp"
diff --git a/src/core/api/qwebenginenewwindowrequest.h b/src/core/api/qwebenginenewwindowrequest.h
new file mode 100644
index 000000000..86d182581
--- /dev/null
+++ b/src/core/api/qwebenginenewwindowrequest.h
@@ -0,0 +1,62 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QWEBENGINENEWWINDOWREQUEST_H
+#define QWEBENGINENEWWINDOWREQUEST_H
+
+#include <QtWebEngineCore/qtwebenginecoreglobal.h>
+#include <QtCore/qobject.h>
+#include <QtCore/qrect.h>
+#include <QtCore/qscopedpointer.h>
+#include <QtCore/qsharedpointer.h>
+#include <QtCore/qurl.h>
+
+namespace QtWebEngineCore {
+class WebContentsAdapter;
+}
+
+QT_BEGIN_NAMESPACE
+
+class QWebEnginePage;
+struct QWebEngineNewWindowRequestPrivate;
+
+class Q_WEBENGINECORE_EXPORT QWebEngineNewWindowRequest : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(DestinationType destination READ destination CONSTANT FINAL)
+ Q_PROPERTY(QUrl requestedUrl READ requestedUrl CONSTANT FINAL)
+ Q_PROPERTY(QRect requestedGeometry READ requestedGeometry CONSTANT FINAL)
+ Q_PROPERTY(bool userInitiated READ isUserInitiated CONSTANT FINAL)
+public:
+ ~QWebEngineNewWindowRequest();
+
+ enum DestinationType {
+ InNewWindow,
+ InNewTab,
+ InNewDialog,
+ InNewBackgroundTab
+ };
+ Q_ENUM(DestinationType)
+
+ DestinationType destination() const;
+ QUrl requestedUrl() const;
+ QRect requestedGeometry() const;
+ bool isUserInitiated() const;
+
+ void openIn(QWebEnginePage *);
+
+protected:
+ QWebEngineNewWindowRequest(DestinationType, const QRect &, const QUrl &, bool,
+ QSharedPointer<QtWebEngineCore::WebContentsAdapter>,
+ QObject * = nullptr);
+
+ QScopedPointer<QWebEngineNewWindowRequestPrivate> d_ptr;
+ friend class QWebEnginePage;
+ friend class QWebEnginePagePrivate;
+ friend class QQuickWebEngineView;
+ friend class QQuickWebEngineViewPrivate;
+};
+
+QT_END_NAMESPACE
+
+#endif // QWEBENGINENEWWINDOWREQUEST_H
diff --git a/src/core/api/qwebenginenewwindowrequest_p.h b/src/core/api/qwebenginenewwindowrequest_p.h
new file mode 100644
index 000000000..979d3fe2d
--- /dev/null
+++ b/src/core/api/qwebenginenewwindowrequest_p.h
@@ -0,0 +1,48 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QWEBENGINENEWWINDOWREQUEST_P_H
+#define QWEBENGINENEWWINDOWREQUEST_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qwebenginenewwindowrequest.h"
+
+#include <QtCore/QRect>
+#include <QtCore/QSharedPointer>
+#include <QtCore/QUrl>
+
+namespace QtWebEngineCore {
+class WebContentsAdapter;
+}
+
+QT_BEGIN_NAMESPACE
+
+struct QWebEngineNewWindowRequestPrivate
+{
+ void setHandled()
+ {
+ isRequestHandled = true;
+ adapter.reset();
+ }
+
+ QWebEngineNewWindowRequest::DestinationType destination;
+ QRect requestedGeometry;
+ QUrl requestedUrl;
+ QSharedPointer<QtWebEngineCore::WebContentsAdapter> adapter;
+ bool isUserInitiated;
+ bool isRequestHandled = false;
+};
+
+QT_END_NAMESPACE
+
+#endif // QWEBENGINENEWWINDOWREQUEST_P_H
diff --git a/src/core/api/qwebenginenotification.cpp b/src/core/api/qwebenginenotification.cpp
index 0505b825a..136047042 100644
--- a/src/core/api/qwebenginenotification.cpp
+++ b/src/core/api/qwebenginenotification.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qwebenginenotification.h"
@@ -90,7 +54,7 @@ public:
~QWebEngineNotificationPrivate() override
{
if (controller->client() == this)
- controller->setClient(0);
+ controller->setClient(nullptr);
}
// UserNotificationController::Client:
diff --git a/src/core/api/qwebenginenotification.h b/src/core/api/qwebenginenotification.h
index 08fd629be..646413d39 100644
--- a/src/core/api/qwebenginenotification.h
+++ b/src/core/api/qwebenginenotification.h
@@ -1,51 +1,15 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QWEBENGINENOTIFICATION_H
#define QWEBENGINENOTIFICATION_H
#include <QtWebEngineCore/qtwebenginecoreglobal.h>
-#include <QtCore/QObject>
-#include <QtCore/QScopedPointer>
-#include <QtCore/QSharedPointer>
-#include <QtCore/QUrl>
+#include <QtCore/qobject.h>
+#include <QtCore/qscopedpointer.h>
+#include <QtCore/qsharedpointer.h>
+#include <QtCore/qurl.h>
namespace QtWebEngineCore {
class UserNotificationController;
@@ -55,7 +19,8 @@ QT_BEGIN_NAMESPACE
class QWebEngineNotificationPrivate;
-class Q_WEBENGINECORE_EXPORT QWebEngineNotification : public QObject {
+class Q_WEBENGINECORE_EXPORT QWebEngineNotification : public QObject
+{
Q_OBJECT
Q_PROPERTY(QUrl origin READ origin CONSTANT FINAL)
Q_PROPERTY(QString title READ title CONSTANT FINAL)
diff --git a/src/core/api/qwebenginepage.cpp b/src/core/api/qwebenginepage.cpp
new file mode 100644
index 000000000..ac645c430
--- /dev/null
+++ b/src/core/api/qwebenginepage.cpp
@@ -0,0 +1,2521 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qwebenginepage.h"
+#include "authenticator_request_dialog_controller.h"
+#include "qwebenginepage_p.h"
+
+#include "qwebenginecertificateerror.h"
+#include "qwebenginedesktopmediarequest.h"
+#include "qwebenginefilesystemaccessrequest.h"
+#include "qwebenginefindtextresult.h"
+#include "qwebenginefullscreenrequest.h"
+#include "qwebenginehistory.h"
+#include "qwebenginehistory_p.h"
+#include "qwebenginehttprequest.h"
+#include "qwebengineloadinginfo.h"
+#include "qwebenginenavigationrequest.h"
+#include "qwebenginenewwindowrequest.h"
+#include "qwebenginenewwindowrequest_p.h"
+#include "qwebengineprofile.h"
+#include "qwebengineprofile_p.h"
+#include "qwebengineregisterprotocolhandlerrequest.h"
+#include "qwebenginescript.h"
+#include "qwebenginescriptcollection_p.h"
+#include "qwebenginesettings.h"
+#include "qwebenginewebauthuxrequest.h"
+
+#include "authentication_dialog_controller.h"
+#include "autofill_popup_controller.h"
+#include "color_chooser_controller.h"
+#include "find_text_helper.h"
+#include "file_picker_controller.h"
+#include "javascript_dialog_controller.h"
+#include "profile_adapter.h"
+#include "render_view_context_menu_qt.h"
+#include "render_widget_host_view_qt_delegate.h"
+#include "render_widget_host_view_qt_delegate_client.h"
+#include "render_widget_host_view_qt_delegate_item.h"
+#include "touch_selection_menu_controller.h"
+#include "web_contents_adapter.h"
+
+#include <QAction>
+#include <QGuiApplication>
+#include <QAuthenticator>
+#include <QClipboard>
+#include <QKeyEvent>
+#include <QIcon>
+
+#include <QLoggingCategory>
+#include <QMimeData>
+#include <QtCore/QPointer>
+#include <QRect>
+#include <QTimer>
+#include <QUrl>
+#include <QVariant>
+
+QT_BEGIN_NAMESPACE
+
+using namespace QtWebEngineCore;
+
+static QWebEnginePage::WebWindowType toWindowType(WebContentsAdapterClient::WindowOpenDisposition disposition)
+{
+ switch (disposition) {
+ case WebContentsAdapterClient::NewForegroundTabDisposition:
+ return QWebEnginePage::WebBrowserTab;
+ case WebContentsAdapterClient::NewBackgroundTabDisposition:
+ return QWebEnginePage::WebBrowserBackgroundTab;
+ case WebContentsAdapterClient::NewPopupDisposition:
+ return QWebEnginePage::WebDialog;
+ case WebContentsAdapterClient::NewWindowDisposition:
+ return QWebEnginePage::WebBrowserWindow;
+ default:
+ Q_UNREACHABLE();
+ }
+}
+
+static QWebEngineNewWindowRequest::DestinationType toDestinationType(WebContentsAdapterClient::WindowOpenDisposition disposition)
+{
+ switch (disposition) {
+ case WebContentsAdapterClient::NewForegroundTabDisposition:
+ return QWebEngineNewWindowRequest::InNewTab;
+ case WebContentsAdapterClient::NewBackgroundTabDisposition:
+ return QWebEngineNewWindowRequest::InNewBackgroundTab;
+ case WebContentsAdapterClient::NewPopupDisposition:
+ return QWebEngineNewWindowRequest::InNewDialog;
+ case WebContentsAdapterClient::NewWindowDisposition:
+ return QWebEngineNewWindowRequest::InNewWindow;
+ default:
+ Q_UNREACHABLE();
+ }
+}
+
+QWebEnginePagePrivate::QWebEnginePagePrivate(QWebEngineProfile *_profile)
+ : adapter(QSharedPointer<WebContentsAdapter>::create())
+ , history(new QWebEngineHistory(new QWebEngineHistoryPrivate(this)))
+ , profile(_profile ? _profile : QWebEngineProfile::defaultProfile())
+ , settings(new QWebEngineSettings(profile->settings()))
+ , view(nullptr)
+ , isLoading(false)
+ , scriptCollection(new QWebEngineScriptCollectionPrivate(profileAdapter()->userResourceController(), adapter))
+ , m_isBeingAdopted(false)
+ , m_backgroundColor(Qt::white)
+ , fullscreenMode(false)
+ , webChannel(nullptr)
+ , webChannelWorldId(QWebEngineScript::MainWorld)
+ , defaultAudioMuted(false)
+ , defaultZoomFactor(1.0)
+{
+ memset(actions, 0, sizeof(actions));
+
+#if QT_DEPRECATED_SINCE(6, 5)
+ qRegisterMetaType<QWebEngineQuotaRequest>();
+#endif
+ qRegisterMetaType<QWebEngineRegisterProtocolHandlerRequest>();
+ qRegisterMetaType<QWebEngineFileSystemAccessRequest>();
+ qRegisterMetaType<QWebEngineFindTextResult>();
+
+ // See setVisible().
+ wasShownTimer.setSingleShot(true);
+ QObject::connect(&wasShownTimer, &QTimer::timeout, [this](){
+ ensureInitialized();
+ });
+
+ profile->d_ptr->addWebContentsAdapterClient(this);
+}
+
+QWebEnginePagePrivate::~QWebEnginePagePrivate()
+{
+ delete history;
+ delete settings;
+ profile->d_ptr->removeWebContentsAdapterClient(this);
+}
+
+RenderWidgetHostViewQtDelegate *QWebEnginePagePrivate::CreateRenderWidgetHostViewQtDelegate(RenderWidgetHostViewQtDelegateClient *client)
+{
+ if (view)
+ return view->CreateRenderWidgetHostViewQtDelegate(client);
+ delegateItem = new QtWebEngineCore::RenderWidgetHostViewQtDelegateItem(client, false);
+ return delegateItem;
+}
+
+RenderWidgetHostViewQtDelegate *QWebEnginePagePrivate::CreateRenderWidgetHostViewQtDelegateForPopup(RenderWidgetHostViewQtDelegateClient *client)
+{
+ // Set the QWebEngineView as the parent for a popup delegate, so that the new popup window
+ // responds properly to clicks in case the QWebEngineView is inside a modal QDialog. Setting the
+ // parent essentially notifies the OS that the popup window is part of the modal session, and
+ // should allow interaction.
+ // The new delegate will not be deleted by the parent view though, because we unset the parent
+ // when the parent is destroyed. The delegate will be destroyed by Chromium when the popup is
+ // dismissed.
+ return view
+ ? view->CreateRenderWidgetHostViewQtDelegateForPopup(client)
+ : new QtWebEngineCore::RenderWidgetHostViewQtDelegateItem(client, true);
+}
+
+void QWebEnginePagePrivate::initializationFinished()
+{
+ if (m_backgroundColor != Qt::white)
+ adapter->setBackgroundColor(m_backgroundColor);
+#if QT_CONFIG(webengine_webchannel)
+ if (webChannel)
+ adapter->setWebChannel(webChannel, webChannelWorldId);
+#endif
+ if (defaultAudioMuted != adapter->isAudioMuted())
+ adapter->setAudioMuted(defaultAudioMuted);
+ if (!qFuzzyCompare(adapter->currentZoomFactor(), defaultZoomFactor))
+ adapter->setZoomFactor(defaultZoomFactor);
+ if (view)
+ adapter->setVisible(view->isVisible());
+
+ scriptCollection.d->initializationFinished(adapter);
+
+ m_isBeingAdopted = false;
+}
+
+void QWebEnginePagePrivate::titleChanged(const QString &title)
+{
+ Q_Q(QWebEnginePage);
+ Q_EMIT q->titleChanged(title);
+}
+
+void QWebEnginePagePrivate::urlChanged()
+{
+ Q_Q(QWebEnginePage);
+ QUrl qurl = adapter->activeUrl();
+ if (url != qurl) {
+ url = qurl;
+ Q_EMIT q->urlChanged(qurl);
+ }
+}
+
+void QWebEnginePagePrivate::iconChanged(const QUrl &url)
+{
+ Q_Q(QWebEnginePage);
+ if (iconUrl == url)
+ return;
+ iconUrl = url;
+ Q_EMIT q->iconUrlChanged(iconUrl);
+ Q_EMIT q->iconChanged(iconUrl.isEmpty() ? QIcon() : adapter->icon());
+}
+
+void QWebEnginePagePrivate::loadProgressChanged(int progress)
+{
+ Q_Q(QWebEnginePage);
+ QTimer::singleShot(0, q, [q, progress] () { Q_EMIT q->loadProgress(progress); });
+}
+
+void QWebEnginePagePrivate::didUpdateTargetURL(const QUrl &hoveredUrl)
+{
+ Q_Q(QWebEnginePage);
+ Q_EMIT q->linkHovered(hoveredUrl.toString());
+}
+
+void QWebEnginePagePrivate::selectionChanged()
+{
+ Q_Q(QWebEnginePage);
+ QTimer::singleShot(0, q, [this, q]() {
+ updateEditActions();
+ Q_EMIT q->selectionChanged();
+ });
+}
+
+void QWebEnginePagePrivate::zoomUpdateIsNeeded()
+{
+ Q_Q(QWebEnginePage);
+ q->setZoomFactor(defaultZoomFactor);
+}
+
+void QWebEnginePagePrivate::recentlyAudibleChanged(bool recentlyAudible)
+{
+ Q_Q(QWebEnginePage);
+ Q_EMIT q->recentlyAudibleChanged(recentlyAudible);
+}
+
+void QWebEnginePagePrivate::renderProcessPidChanged(qint64 pid)
+{
+ Q_Q(QWebEnginePage);
+ Q_EMIT q->renderProcessPidChanged(pid);
+}
+
+QRectF QWebEnginePagePrivate::viewportRect() const
+{
+ return view ? view->viewportRect() : QRectF();
+}
+
+QColor QWebEnginePagePrivate::backgroundColor() const
+{
+ return m_backgroundColor;
+}
+
+void QWebEnginePagePrivate::loadStarted(QWebEngineLoadingInfo info)
+{
+ Q_Q(QWebEnginePage);
+ isLoading = true;
+ QTimer::singleShot(0, q, [q, info = std::move(info)] () {
+ Q_EMIT q->loadStarted();
+ Q_EMIT q->loadingChanged(info);
+ });
+}
+
+void QWebEnginePagePrivate::loadFinished(QWebEngineLoadingInfo info)
+{
+ Q_Q(QWebEnginePage);
+ isLoading = false;
+ QTimer::singleShot(0, q, [q, info = std::move(info)] () {
+ Q_EMIT q->loadFinished(info.status() == QWebEngineLoadingInfo::LoadSucceededStatus);
+ Q_EMIT q->loadingChanged(info);
+ });
+}
+
+void QWebEnginePagePrivate::didPrintPageToPdf(const QString &filePath, bool success)
+{
+ Q_Q(QWebEnginePage);
+ Q_EMIT q->pdfPrintingFinished(filePath, success);
+ if (view)
+ view->didPrintPageToPdf(filePath, success);
+}
+
+void QWebEnginePagePrivate::focusContainer()
+{
+ if (view) {
+ view->focusContainer();
+ }
+}
+
+void QWebEnginePagePrivate::unhandledKeyEvent(QKeyEvent *event)
+{
+ if (view) {
+ view->unhandledKeyEvent(event);
+ }
+}
+
+QSharedPointer<WebContentsAdapter>
+QWebEnginePagePrivate::adoptNewWindow(QSharedPointer<WebContentsAdapter> newWebContents,
+ WindowOpenDisposition disposition, bool userGesture,
+ const QRect &initialGeometry, const QUrl &targetUrl)
+{
+ Q_Q(QWebEnginePage);
+ Q_ASSERT(newWebContents);
+ QWebEnginePage *newPage = q->createWindow(toWindowType(disposition));
+ if (newPage) {
+ if (!newWebContents->webContents())
+ return newPage->d_func()->adapter; // Reuse existing adapter
+
+ if (!newPage->d_func()->adoptWebContents(newWebContents.get()))
+ return nullptr;
+
+ if (!initialGeometry.isEmpty())
+ emit newPage->geometryChangeRequested(initialGeometry);
+
+ return newWebContents;
+ }
+
+ QWebEngineNewWindowRequest request(toDestinationType(disposition), initialGeometry,
+ targetUrl, userGesture, newWebContents);
+
+ Q_EMIT q->newWindowRequested(request);
+
+ if (request.d_ptr->isRequestHandled)
+ return newWebContents;
+ return nullptr;
+}
+
+void QWebEnginePagePrivate::createNewWindow(WindowOpenDisposition disposition, bool userGesture, const QUrl &targetUrl)
+{
+ Q_Q(QWebEnginePage);
+ QWebEnginePage *newPage = q->createWindow(toWindowType(disposition));
+ if (newPage) {
+ newPage->setUrl(targetUrl);
+ return;
+ }
+
+ QWebEngineNewWindowRequest request(toDestinationType(disposition), QRect(),
+ targetUrl, userGesture, nullptr);
+
+ Q_EMIT q->newWindowRequested(request);
+}
+
+QString QWebEnginePagePrivate::actionText(int action)
+{
+ switch (action) {
+ case QWebEnginePage::Back:
+ return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Back);
+ case QWebEnginePage::Forward:
+ return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Forward);
+ case QWebEnginePage::Stop:
+ return QWebEnginePage::tr("Stop");
+ case QWebEnginePage::Reload:
+ return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Reload);
+ case QWebEnginePage::ReloadAndBypassCache:
+ return QWebEnginePage::tr("Reload and Bypass Cache");
+ case QWebEnginePage::Cut:
+ return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Cut);
+ case QWebEnginePage::Copy:
+ return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Copy);
+ case QWebEnginePage::Paste:
+ return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Paste);
+ case QWebEnginePage::Undo:
+ return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Undo);
+ case QWebEnginePage::Redo:
+ return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Redo);
+ case QWebEnginePage::SelectAll:
+ return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::SelectAll);
+ case QWebEnginePage::PasteAndMatchStyle:
+ return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::PasteAndMatchStyle);
+ case QWebEnginePage::OpenLinkInThisWindow:
+ return QWebEnginePage::tr("Open link in this window");
+ case QWebEnginePage::OpenLinkInNewWindow:
+ return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::OpenLinkInNewWindow);
+ case QWebEnginePage::OpenLinkInNewTab:
+ return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::OpenLinkInNewTab);
+ case QWebEnginePage::OpenLinkInNewBackgroundTab:
+ return QWebEnginePage::tr("Open link in new background tab");
+ case QWebEnginePage::CopyLinkToClipboard:
+ return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::CopyLinkToClipboard);
+ case QWebEnginePage::DownloadLinkToDisk:
+ return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::DownloadLinkToDisk);
+ case QWebEnginePage::CopyImageToClipboard:
+ return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::CopyImageToClipboard);
+ case QWebEnginePage::CopyImageUrlToClipboard:
+ return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::CopyImageUrlToClipboard);
+ case QWebEnginePage::DownloadImageToDisk:
+ return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::DownloadImageToDisk);
+ case QWebEnginePage::CopyMediaUrlToClipboard:
+ return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::CopyMediaUrlToClipboard);
+ case QWebEnginePage::ToggleMediaControls:
+ return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::ToggleMediaControls);
+ case QWebEnginePage::ToggleMediaLoop:
+ return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::ToggleMediaLoop);
+ case QWebEnginePage::ToggleMediaPlayPause:
+ return QWebEnginePage::tr("Toggle Play/Pause");
+ case QWebEnginePage::ToggleMediaMute:
+ return QWebEnginePage::tr("Toggle Mute");
+ case QWebEnginePage::DownloadMediaToDisk:
+ return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::DownloadMediaToDisk);
+ case QWebEnginePage::InspectElement:
+ return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::InspectElement);
+ case QWebEnginePage::ExitFullScreen:
+ return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::ExitFullScreen);
+ case QWebEnginePage::RequestClose:
+ return QWebEnginePage::tr("Close Page");
+ case QWebEnginePage::Unselect:
+ return QWebEnginePage::tr("Unselect");
+ case QWebEnginePage::SavePage:
+ return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::SavePage);
+ case QWebEnginePage::ViewSource:
+ return RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::ViewSource);
+ case QWebEnginePage::ToggleBold:
+ return QWebEnginePage::tr("&Bold");
+ case QWebEnginePage::ToggleItalic:
+ return QWebEnginePage::tr("&Italic");
+ case QWebEnginePage::ToggleUnderline:
+ return QWebEnginePage::tr("&Underline");
+ case QWebEnginePage::ToggleStrikethrough:
+ return QWebEnginePage::tr("&Strikethrough");
+ case QWebEnginePage::AlignLeft:
+ return QWebEnginePage::tr("Align &Left");
+ case QWebEnginePage::AlignCenter:
+ return QWebEnginePage::tr("Align &Center");
+ case QWebEnginePage::AlignRight:
+ return QWebEnginePage::tr("Align &Right");
+ case QWebEnginePage::AlignJustified:
+ return QWebEnginePage::tr("Align &Justified");
+ case QWebEnginePage::Indent:
+ return QWebEnginePage::tr("&Indent");
+ case QWebEnginePage::Outdent:
+ return QWebEnginePage::tr("&Outdent");
+ case QWebEnginePage::InsertOrderedList:
+ return QWebEnginePage::tr("Insert &Ordered List");
+ case QWebEnginePage::InsertUnorderedList:
+ return QWebEnginePage::tr("Insert &Unordered List");
+ case QWebEnginePage::ChangeTextDirectionLTR:
+ return QWebEnginePage::tr("Change text direction left to right");
+ case QWebEnginePage::ChangeTextDirectionRTL:
+ return QWebEnginePage::tr("Change text direction right to left");
+ default:
+ break;
+ }
+ return {};
+}
+
+class WebContentsAdapterOwner : public QObject
+{
+public:
+ typedef QSharedPointer<QtWebEngineCore::WebContentsAdapter> AdapterPtr;
+ WebContentsAdapterOwner(const AdapterPtr &ptr)
+ : adapter(ptr)
+ {}
+
+private:
+ AdapterPtr adapter;
+};
+
+bool QWebEnginePagePrivate::adoptWebContents(WebContentsAdapter *webContents)
+{
+ Q_ASSERT(webContents);
+ if (webContents->profileAdapter() && profileAdapter() != webContents->profileAdapter()) {
+ qWarning("Can not adopt content from a different WebEngineProfile.");
+ return false;
+ }
+
+ m_isBeingAdopted = true;
+
+ webContents->setRequestInterceptor(adapter->requestInterceptor());
+
+ // This throws away the WebContentsAdapter that has been used until now.
+ // All its states, particularly the loading URL, are replaced by the adopted WebContentsAdapter.
+ WebContentsAdapterOwner *adapterOwner = new WebContentsAdapterOwner(adapter->sharedFromThis());
+ adapterOwner->deleteLater();
+
+ adapter = webContents->sharedFromThis();
+ adapter->setClient(this);
+ return true;
+}
+
+bool QWebEnginePagePrivate::isBeingAdopted()
+{
+ return m_isBeingAdopted;
+}
+
+void QWebEnginePagePrivate::close()
+{
+ Q_Q(QWebEnginePage);
+ Q_EMIT q->windowCloseRequested();
+}
+
+void QWebEnginePagePrivate::windowCloseRejected()
+{
+ // Do nothing for now.
+}
+
+void QWebEnginePagePrivate::didRunJavaScript(quint64 requestId, const QVariant& result)
+{
+ if (auto callback = m_variantCallbacks.take(requestId))
+ callback(result);
+}
+
+void QWebEnginePagePrivate::didFetchDocumentMarkup(quint64 requestId, const QString& result)
+{
+ if (auto callback = m_stringCallbacks.take(requestId))
+ callback(result);
+}
+
+void QWebEnginePagePrivate::didFetchDocumentInnerText(quint64 requestId, const QString& result)
+{
+ if (auto callback = m_stringCallbacks.take(requestId))
+ callback(result);
+}
+
+void QWebEnginePagePrivate::didPrintPage(quint64 requestId, QSharedPointer<QByteArray> result)
+{
+#if QT_CONFIG(webengine_printing_and_pdf)
+ // If no currentPrinter is set that means that were printing to PDF only.
+ if (!currentPrinter) {
+ if (!result.data())
+ return;
+ if (auto callback = m_pdfResultCallbacks.take(requestId))
+ callback(*(result.data()));
+ return;
+ }
+
+ if (view)
+ view->didPrintPage(currentPrinter, result);
+ else
+ currentPrinter = nullptr;
+#else
+ // we should never enter this branch, but just for safe-keeping...
+ Q_UNUSED(result);
+ if (auto callback = m_pdfResultCallbacks.take(requestId))
+ callback(QByteArray());
+#endif
+}
+
+bool QWebEnginePagePrivate::passOnFocus(bool reverse)
+{
+ return view ? view->passOnFocus(reverse) : false;
+}
+
+void QWebEnginePagePrivate::authenticationRequired(QSharedPointer<AuthenticationDialogController> controller)
+{
+ Q_Q(QWebEnginePage);
+ QAuthenticator networkAuth;
+ networkAuth.setRealm(controller->realm());
+
+ if (controller->isProxy())
+ Q_EMIT q->proxyAuthenticationRequired(controller->url(), &networkAuth, controller->host());
+ else
+ Q_EMIT q->authenticationRequired(controller->url(), &networkAuth);
+
+ // Authentication has been cancelled
+ if (networkAuth.isNull()) {
+ controller->reject();
+ return;
+ }
+
+ controller->accept(networkAuth.user(), networkAuth.password());
+}
+
+void QWebEnginePagePrivate::releaseProfile()
+{
+ qWarning("Release of profile requested but WebEnginePage still not deleted. Expect troubles !");
+ // this is not the way to go, but might avoid the crash if user code does not make any calls to page.
+ q_ptr->d_ptr.reset();
+}
+
+void QWebEnginePagePrivate::showColorDialog(QSharedPointer<ColorChooserController> controller)
+{
+ if (view)
+ view->showColorDialog(controller);
+}
+
+void QWebEnginePagePrivate::runMediaAccessPermissionRequest(const QUrl &securityOrigin, WebContentsAdapterClient::MediaRequestFlags requestFlags)
+{
+ Q_Q(QWebEnginePage);
+ QWebEnginePage::Feature feature;
+ if (requestFlags.testFlag(WebContentsAdapterClient::MediaAudioCapture) &&
+ requestFlags.testFlag(WebContentsAdapterClient::MediaVideoCapture))
+ feature = QWebEnginePage::MediaAudioVideoCapture;
+ else if (requestFlags.testFlag(WebContentsAdapterClient::MediaAudioCapture))
+ feature = QWebEnginePage::MediaAudioCapture;
+ else if (requestFlags.testFlag(WebContentsAdapterClient::MediaVideoCapture))
+ feature = QWebEnginePage::MediaVideoCapture;
+ else if (requestFlags.testFlag(WebContentsAdapterClient::MediaDesktopAudioCapture) &&
+ requestFlags.testFlag(WebContentsAdapterClient::MediaDesktopVideoCapture))
+ feature = QWebEnginePage::DesktopAudioVideoCapture;
+ else // if (requestFlags.testFlag(WebContentsAdapterClient::MediaDesktopVideoCapture))
+ feature = QWebEnginePage::DesktopVideoCapture;
+ Q_EMIT q->featurePermissionRequested(securityOrigin, feature);
+}
+
+static QWebEnginePage::Feature toFeature(QtWebEngineCore::ProfileAdapter::PermissionType type)
+{
+ switch (type) {
+ case QtWebEngineCore::ProfileAdapter::NotificationPermission:
+ return QWebEnginePage::Notifications;
+ case QtWebEngineCore::ProfileAdapter::GeolocationPermission:
+ return QWebEnginePage::Geolocation;
+ case QtWebEngineCore::ProfileAdapter::ClipboardReadWrite:
+ return QWebEnginePage::ClipboardReadWrite;
+ case QtWebEngineCore::ProfileAdapter::LocalFontsPermission:
+ return QWebEnginePage::LocalFontsAccess;
+ default:
+ break;
+ }
+ Q_UNREACHABLE();
+ return QWebEnginePage::Feature(-1);
+}
+
+void QWebEnginePagePrivate::runFeaturePermissionRequest(QtWebEngineCore::ProfileAdapter::PermissionType permission, const QUrl &securityOrigin)
+{
+ Q_Q(QWebEnginePage);
+ Q_EMIT q->featurePermissionRequested(securityOrigin, toFeature(permission));
+}
+
+void QWebEnginePagePrivate::runMouseLockPermissionRequest(const QUrl &securityOrigin)
+{
+ Q_Q(QWebEnginePage);
+ Q_EMIT q->featurePermissionRequested(securityOrigin, QWebEnginePage::MouseLock);
+}
+
+void QWebEnginePagePrivate::runRegisterProtocolHandlerRequest(QWebEngineRegisterProtocolHandlerRequest request)
+{
+ Q_Q(QWebEnginePage);
+ Q_EMIT q->registerProtocolHandlerRequested(request);
+}
+
+/*!
+ \fn void QWebEnginePage::fileSystemAccessRequested(QWebEngineFileSystemAccessRequest request)
+ \since 6.4
+
+ This signal is emitted when the web page requests access to local files or directories.
+
+ The request object \a request can be used to accept or reject the request.
+*/
+
+void QWebEnginePagePrivate::runFileSystemAccessRequest(QWebEngineFileSystemAccessRequest request)
+{
+ Q_Q(QWebEnginePage);
+ Q_EMIT q->fileSystemAccessRequested(request);
+}
+
+QObject *QWebEnginePagePrivate::accessibilityParentObject()
+{
+ return view ? view->accessibilityParentObject() : nullptr;
+}
+
+void QWebEnginePagePrivate::updateAction(QWebEnginePage::WebAction action) const
+{
+#if !QT_CONFIG(action)
+ Q_UNUSED(action);
+#else
+ QAction *a = actions[action];
+ if (!a)
+ return;
+
+ bool enabled = true;
+
+ switch (action) {
+ case QWebEnginePage::Back:
+ enabled = adapter->canGoToOffset(-1);
+ break;
+ case QWebEnginePage::Forward:
+ enabled = adapter->canGoToOffset(1);
+ break;
+ case QWebEnginePage::Stop:
+ enabled = isLoading;
+ break;
+ case QWebEnginePage::Reload:
+ case QWebEnginePage::ReloadAndBypassCache:
+ enabled = !isLoading;
+ break;
+ case QWebEnginePage::ViewSource:
+ enabled = adapter->canViewSource();
+ break;
+ case QWebEnginePage::Cut:
+ case QWebEnginePage::Copy:
+ case QWebEnginePage::Unselect:
+ enabled = adapter->hasFocusedFrame() && !adapter->selectedText().isEmpty();
+ break;
+ case QWebEnginePage::Paste:
+ case QWebEnginePage::Undo:
+ case QWebEnginePage::Redo:
+ case QWebEnginePage::SelectAll:
+ case QWebEnginePage::PasteAndMatchStyle:
+ enabled = adapter->hasFocusedFrame();
+ break;
+ default:
+ break;
+ }
+
+ a->setEnabled(enabled);
+#endif // QT_CONFIG(action)
+}
+
+void QWebEnginePagePrivate::updateNavigationActions()
+{
+ updateAction(QWebEnginePage::Back);
+ updateAction(QWebEnginePage::Forward);
+ updateAction(QWebEnginePage::Stop);
+ updateAction(QWebEnginePage::Reload);
+ updateAction(QWebEnginePage::ReloadAndBypassCache);
+ updateAction(QWebEnginePage::ViewSource);
+}
+
+void QWebEnginePagePrivate::updateEditActions()
+{
+ updateAction(QWebEnginePage::Cut);
+ updateAction(QWebEnginePage::Copy);
+ updateAction(QWebEnginePage::Paste);
+ updateAction(QWebEnginePage::Undo);
+ updateAction(QWebEnginePage::Redo);
+ updateAction(QWebEnginePage::SelectAll);
+ updateAction(QWebEnginePage::PasteAndMatchStyle);
+ updateAction(QWebEnginePage::Unselect);
+}
+
+#if QT_CONFIG(action)
+void QWebEnginePagePrivate::_q_webActionTriggered(bool checked)
+{
+ Q_Q(QWebEnginePage);
+ QAction *a = qobject_cast<QAction *>(q->sender());
+ if (!a)
+ return;
+ QWebEnginePage::WebAction action = static_cast<QWebEnginePage::WebAction>(a->data().toInt());
+ q->triggerAction(action, checked);
+}
+#endif // QT_CONFIG(action)
+
+void QWebEnginePagePrivate::recreateFromSerializedHistory(QDataStream &input)
+{
+ QSharedPointer<WebContentsAdapter> newWebContents = WebContentsAdapter::createFromSerializedNavigationHistory(input, this);
+ if (newWebContents) {
+ adapter = std::move(newWebContents);
+ adapter->setClient(this);
+ adapter->loadDefault();
+ }
+}
+
+void QWebEnginePagePrivate::updateScrollPosition(const QPointF &position)
+{
+ Q_Q(QWebEnginePage);
+ Q_EMIT q->scrollPositionChanged(position);
+}
+
+void QWebEnginePagePrivate::updateContentsSize(const QSizeF &size)
+{
+ Q_Q(QWebEnginePage);
+ Q_EMIT q->contentsSizeChanged(size);
+}
+
+void QWebEnginePagePrivate::setFullScreenMode(bool fullscreen)
+{
+ if (fullscreenMode != fullscreen) {
+ fullscreenMode = fullscreen;
+ adapter->changedFullScreen();
+ }
+}
+
+ProfileAdapter* QWebEnginePagePrivate::profileAdapter()
+{
+ return profile->d_ptr->profileAdapter();
+}
+
+WebContentsAdapter *QWebEnginePagePrivate::webContentsAdapter()
+{
+ ensureInitialized();
+ return adapter.data();
+}
+
+const QObject *QWebEnginePagePrivate::holdingQObject() const
+{
+ Q_Q(const QWebEnginePage);
+ return q;
+}
+
+void QWebEnginePagePrivate::findTextFinished(const QWebEngineFindTextResult &result)
+{
+ Q_Q(QWebEnginePage);
+ Q_EMIT q->findTextFinished(result);
+}
+
+void QWebEnginePagePrivate::showAutofillPopup(QtWebEngineCore::AutofillPopupController *controller,
+ const QRect &bounds, bool autoselectFirstSuggestion)
+{
+ if (view)
+ view->showAutofillPopup(controller, bounds, autoselectFirstSuggestion);
+}
+
+void QWebEnginePagePrivate::hideAutofillPopup()
+{
+ if (view)
+ view->hideAutofillPopup();
+}
+
+void QWebEnginePagePrivate::ensureInitialized() const
+{
+ if (!adapter->isInitialized())
+ adapter->loadDefault();
+}
+
+void QWebEnginePagePrivate::showWebAuthDialog(QWebEngineWebAuthUxRequest *request)
+{
+ Q_Q(QWebEnginePage);
+ Q_EMIT q->webAuthUxRequested(request);
+}
+
+QWebEnginePage::QWebEnginePage(QObject* parent)
+ : QObject(parent)
+ , d_ptr(new QWebEnginePagePrivate())
+{
+ Q_D(QWebEnginePage);
+ d->q_ptr = this;
+ d->adapter->setClient(d);
+}
+
+/*!
+ \fn void QWebEnginePage::findTextFinished(const QWebEngineFindTextResult &result)
+ \since 5.14
+
+ This signal is emitted when a search string search on a page is completed. \a result is
+ the result of the string search.
+
+ \sa findText()
+*/
+
+
+/*!
+ \enum QWebEnginePage::RenderProcessTerminationStatus
+ \since 5.6
+
+ This enum describes the status with which the render process terminated:
+
+ \value NormalTerminationStatus
+ The render process terminated normally.
+ \value AbnormalTerminationStatus
+ The render process terminated with with a non-zero exit status.
+ \value CrashedTerminationStatus
+ The render process crashed, for example because of a segmentation fault.
+ \value KilledTerminationStatus
+ The render process was killed, for example by \c SIGKILL or task manager kill.
+*/
+
+/*!
+ \fn QWebEnginePage::renderProcessTerminated(RenderProcessTerminationStatus terminationStatus, int exitCode)
+ \since 5.6
+
+ This signal is emitted when the render process is terminated with a non-zero exit status.
+ \a terminationStatus is the termination status of the process and \a exitCode is the status code
+ with which the process terminated.
+*/
+
+/*!
+ \fn QWebEnginePage::fullScreenRequested(QWebEngineFullScreenRequest fullScreenRequest)
+
+ This signal is emitted when the web page issues the request to enter fullscreen mode for
+ a web-element, usually a video element.
+
+ The request object \a fullScreenRequest can be used to accept or reject the request.
+
+ If the request is accepted the element requesting fullscreen will fill the viewport,
+ but it is up to the application to make the view fullscreen or move the page to a view
+ that is fullscreen.
+
+ \sa QWebEngineSettings::FullScreenSupportEnabled
+*/
+
+/*!
+ \fn QWebEnginePage::quotaRequested(QWebEngineQuotaRequest quotaRequest)
+ \since 5.11
+ \deprecated [6.5] This signal is no longer emitted.
+
+ Requesting host quota is no longer supported by Chromium.
+ The behavior of navigator.webkitPersistentStorage
+ is identical to navigator.webkitTemporaryStorage.
+
+ For further details, see https://crbug.com/1233525
+*/
+
+/*!
+ \fn QWebEnginePage::registerProtocolHandlerRequested(QWebEngineRegisterProtocolHandlerRequest request)
+ \since 5.11
+
+ This signal is emitted when the web page tries to register a custom protocol
+ using the \l registerProtocolHandler API.
+
+ The request object \a request can be used to accept or reject the request:
+
+ \snippet webenginewidgets/simplebrowser/webview.cpp registerProtocolHandlerRequested
+*/
+
+/*!
+ \property QWebEnginePage::scrollPosition
+ \since 5.7
+
+ \brief The scroll position of the page contents.
+*/
+
+/*!
+ \property QWebEnginePage::contentsSize
+ \since 5.7
+
+ \brief The size of the page contents.
+*/
+
+/*!
+ \fn void QWebEnginePage::audioMutedChanged(bool muted)
+ \since 5.7
+
+ This signal is emitted when the page's \a muted state changes.
+ \note Not to be confused with a specific HTML5 audio or video element being muted.
+*/
+
+/*!
+ \fn void QWebEnginePage::recentlyAudibleChanged(bool recentlyAudible);
+ \since 5.7
+
+ This signal is emitted when the page's audible state, \a recentlyAudible, changes, because
+ the audio is played or stopped.
+
+ \note The signal is also emitted when calling the setAudioMuted() method.
+*/
+
+/*!
+ \fn void QWebEnginePage::renderProcessPidChanged(qint64 pid);
+ \since 5.15
+
+ This signal is emitted when the underlying render process PID, \a pid, changes.
+*/
+
+/*!
+ \fn void QWebEnginePage::iconUrlChanged(const QUrl &url)
+
+ This signal is emitted when the URL of the icon ("favicon") associated with the
+ page is changed. The new URL is specified by \a url.
+
+ \sa iconUrl(), icon(), iconChanged()
+*/
+
+/*!
+ \fn void QWebEnginePage::iconChanged(const QIcon &icon)
+ \since 5.7
+
+ This signal is emitted when the icon ("favicon") associated with the
+ page is changed. The new icon is specified by \a icon.
+
+ \sa icon(), iconUrl(), iconUrlChanged()
+*/
+
+/*!
+ Constructs an empty web engine page in the web engine profile \a profile with the parent
+ \a parent.
+
+ If the profile is not the default profile, the caller must ensure that the profile stays alive
+ for as long as the page does.
+
+ \since 5.5
+*/
+QWebEnginePage::QWebEnginePage(QWebEngineProfile *profile, QObject* parent)
+ : QObject(parent)
+ , d_ptr(new QWebEnginePagePrivate(profile))
+{
+ Q_D(QWebEnginePage);
+ d->q_ptr = this;
+ d->adapter->setClient(d);
+}
+
+QWebEnginePage::~QWebEnginePage()
+{
+ if (d_ptr) {
+ // d_ptr might be exceptionally null if profile adapter got deleted first
+ setDevToolsPage(nullptr);
+ emit _q_aboutToDelete();
+
+ for (auto varFun : std::as_const(d_ptr->m_variantCallbacks))
+ varFun(QVariant());
+ for (auto strFun : std::as_const(d_ptr->m_stringCallbacks))
+ strFun(QString());
+ d_ptr->m_variantCallbacks.clear();
+ d_ptr->m_stringCallbacks.clear();
+ }
+}
+
+QWebEngineHistory *QWebEnginePage::history() const
+{
+ Q_D(const QWebEnginePage);
+ return d->history;
+}
+
+QWebEngineSettings *QWebEnginePage::settings() const
+{
+ Q_D(const QWebEnginePage);
+ return d->settings;
+}
+
+/*!
+ * Returns a pointer to the web channel instance used by this page or a null pointer if none was set.
+ * This channel automatically uses the internal web engine transport mechanism over Chromium IPC
+ * that is exposed in the JavaScript context of this page as \c qt.webChannelTransport.
+ *
+ * \since 5.5
+ * \sa setWebChannel()
+ */
+QWebChannel *QWebEnginePage::webChannel() const
+{
+#if QT_CONFIG(webengine_webchannel)
+ Q_D(const QWebEnginePage);
+ return d->webChannel;
+#endif
+ qWarning("WebEngine compiled without webchannel support");
+ return nullptr;
+}
+
+/*!
+ * Sets the web channel instance to be used by this page to \a channel and connects it to
+ * web engine's transport using Chromium IPC messages. The transport is exposed in the JavaScript
+ * world \a worldId as
+ * \c qt.webChannelTransport, which should be used when using the \l{Qt WebChannel JavaScript API}.
+ *
+ * \note The page does not take ownership of the channel object.
+ * \note Only one web channel can be installed per page, setting one even in another JavaScript
+ * world uninstalls any already installed web channel.
+ *
+ * \since 5.7
+ * \sa QWebEngineScript::ScriptWorldId
+ */
+void QWebEnginePage::setWebChannel(QWebChannel *channel, quint32 worldId)
+{
+#if QT_CONFIG(webengine_webchannel)
+ Q_D(QWebEnginePage);
+ if (d->webChannel != channel || d->webChannelWorldId != worldId) {
+ d->webChannel = channel;
+ d->webChannelWorldId = worldId;
+ d->adapter->setWebChannel(channel, worldId);
+ }
+#else
+ Q_UNUSED(channel);
+ Q_UNUSED(worldId);
+ qWarning("WebEngine compiled without webchannel support");
+#endif
+}
+
+/*!
+ \property QWebEnginePage::backgroundColor
+ \brief The page's background color behind the document's body.
+ \since 5.6
+
+ You can set the background color to Qt::transparent or to a translucent
+ color to see through the document, or you can set it to match your
+ web content in a hybrid application to prevent the white flashes that may appear
+ during loading.
+
+ The default value is white.
+*/
+QColor QWebEnginePage::backgroundColor() const
+{
+ Q_D(const QWebEnginePage);
+ return d->m_backgroundColor;
+}
+
+void QWebEnginePage::setBackgroundColor(const QColor &color)
+{
+ Q_D(QWebEnginePage);
+ if (d->m_backgroundColor == color)
+ return;
+ d->m_backgroundColor = color;
+ d->adapter->setBackgroundColor(color);
+}
+
+/*!
+ * Save the currently loaded web page to disk.
+ *
+ * The web page is saved to \a filePath in the specified \a{format}.
+ *
+ * This is a short cut for the following actions:
+ * \list
+ * \li Trigger the Save web action.
+ * \li Accept the next download item and set the specified file path and save format.
+ * \endlist
+ *
+ * This function issues an asynchronous download request for the web page and returns immediately.
+ *
+ * \sa QWebEngineDownloadRequest::SavePageFormat
+ * \since 5.8
+ */
+void QWebEnginePage::save(const QString &filePath,
+ QWebEngineDownloadRequest::SavePageFormat format) const
+{
+ Q_D(const QWebEnginePage);
+ d->ensureInitialized();
+ d->adapter->save(filePath, format);
+}
+
+/*!
+ \property QWebEnginePage::audioMuted
+ \brief Whether the current page audio is muted.
+ \since 5.7
+
+ The default value is \c false.
+ \sa recentlyAudible
+*/
+bool QWebEnginePage::isAudioMuted() const {
+ Q_D(const QWebEnginePage);
+ if (d->adapter->isInitialized())
+ return d->adapter->isAudioMuted();
+ return d->defaultAudioMuted;
+}
+
+void QWebEnginePage::setAudioMuted(bool muted) {
+ Q_D(QWebEnginePage);
+ bool wasAudioMuted = isAudioMuted();
+ d->defaultAudioMuted = muted;
+ d->adapter->setAudioMuted(muted);
+ if (wasAudioMuted != isAudioMuted())
+ Q_EMIT audioMutedChanged(muted);
+}
+
+/*!
+ \property QWebEnginePage::recentlyAudible
+ \brief The current page's \e {audible state}, that is, whether audio was recently played
+ or not.
+ \since 5.7
+
+ The default value is \c false.
+ \sa audioMuted
+*/
+bool QWebEnginePage::recentlyAudible() const
+{
+ Q_D(const QWebEnginePage);
+ return d->adapter->isInitialized() && d->adapter->recentlyAudible();
+}
+
+/*!
+ \property QWebEnginePage::renderProcessPid
+ \brief The process ID (PID) of the render process assigned to the current
+ page's main frame.
+ \since 5.15
+
+ If no render process is available yet, \c 0 is returned.
+*/
+qint64 QWebEnginePage::renderProcessPid() const
+{
+ Q_D(const QWebEnginePage);
+ return d->adapter->renderProcessPid();
+}
+
+/*!
+ Returns the web engine profile the page belongs to.
+ \since 5.5
+*/
+QWebEngineProfile *QWebEnginePage::profile() const
+{
+ Q_D(const QWebEnginePage);
+ return d->profile;
+}
+
+bool QWebEnginePage::hasSelection() const
+{
+ return !selectedText().isEmpty();
+}
+
+QString QWebEnginePage::selectedText() const
+{
+ Q_D(const QWebEnginePage);
+ return d->adapter->selectedText();
+}
+
+#if QT_CONFIG(action)
+QAction *QWebEnginePage::action(WebAction action) const
+{
+ Q_D(const QWebEnginePage);
+ if (action == QWebEnginePage::NoWebAction)
+ return nullptr;
+ if (d->actions[action])
+ return d->actions[action];
+
+ const QString text = QWebEnginePagePrivate::actionText(action);
+
+ QAction *a = new QAction(const_cast<QWebEnginePage*>(this));
+ a->setText(text);
+ a->setData(action);
+
+ connect(a, SIGNAL(triggered(bool)), this, SLOT(_q_webActionTriggered(bool)));
+
+ d->actions[action] = a;
+ d->updateAction(action);
+ return a;
+}
+#endif // QT_CONFIG(action)
+
+void QWebEnginePage::triggerAction(WebAction action, bool)
+{
+ Q_D(QWebEnginePage);
+ d->ensureInitialized();
+ switch (action) {
+ case Back:
+ d->adapter->navigateBack();
+ break;
+ case Forward:
+ d->adapter->navigateForward();
+ break;
+ case Stop:
+ d->adapter->stop();
+ break;
+ case Reload:
+ d->adapter->reload();
+ break;
+ case ReloadAndBypassCache:
+ d->adapter->reloadAndBypassCache();
+ break;
+ case Cut:
+ d->adapter->cut();
+ break;
+ case Copy:
+ d->adapter->copy();
+ break;
+ case Paste:
+ d->adapter->paste();
+ break;
+ case Undo:
+ d->adapter->undo();
+ break;
+ case Redo:
+ d->adapter->redo();
+ break;
+ case SelectAll:
+ d->adapter->selectAll();
+ break;
+ case PasteAndMatchStyle:
+ d->adapter->pasteAndMatchStyle();
+ break;
+ case Unselect:
+ d->adapter->unselect();
+ break;
+ case OpenLinkInThisWindow:
+ if (d->view && d->view->lastContextMenuRequest() && d->view->lastContextMenuRequest()->filteredLinkUrl().isValid())
+ setUrl(d->view->lastContextMenuRequest()->filteredLinkUrl());
+ break;
+ case OpenLinkInNewWindow:
+ if (d->view && d->view->lastContextMenuRequest() && d->view->lastContextMenuRequest()->filteredLinkUrl().isValid())
+ d->createNewWindow(WebContentsAdapterClient::NewWindowDisposition, true,
+ d->view->lastContextMenuRequest()->filteredLinkUrl());
+ break;
+ case OpenLinkInNewTab:
+ if (d->view && d->view->lastContextMenuRequest() && d->view->lastContextMenuRequest()->filteredLinkUrl().isValid())
+ d->createNewWindow(WebContentsAdapterClient::NewForegroundTabDisposition, true,
+ d->view->lastContextMenuRequest()->filteredLinkUrl());
+ break;
+ case OpenLinkInNewBackgroundTab:
+ if (d->view && d->view->lastContextMenuRequest() && d->view->lastContextMenuRequest()->filteredLinkUrl().isValid())
+ d->createNewWindow(WebContentsAdapterClient::NewBackgroundTabDisposition, true,
+ d->view->lastContextMenuRequest()->filteredLinkUrl());
+ break;
+ case CopyLinkToClipboard:
+ if (d->view && d->view->lastContextMenuRequest() && !d->view->lastContextMenuRequest()->linkUrl().isEmpty()) {
+ QString urlString = d->view->lastContextMenuRequest()->linkUrl().toString(
+ QUrl::FullyEncoded);
+ QString linkText = d->view->lastContextMenuRequest()->linkText().toHtmlEscaped();
+ QString title = d->view->lastContextMenuRequest()->titleText();
+ if (!title.isEmpty())
+ title = QStringLiteral(" title=\"%1\"").arg(title.toHtmlEscaped());
+ QMimeData *data = new QMimeData();
+ data->setText(urlString);
+ QString html = QStringLiteral("<a href=\"") + urlString + QStringLiteral("\"") + title + QStringLiteral(">")
+ + linkText + QStringLiteral("</a>");
+ data->setHtml(html);
+ data->setUrls(QList<QUrl>() << d->view->lastContextMenuRequest()->linkUrl());
+ QGuiApplication::clipboard()->setMimeData(data);
+ }
+ break;
+ case DownloadLinkToDisk:
+ if (d->view && d->view->lastContextMenuRequest() && d->view->lastContextMenuRequest()->filteredLinkUrl().isValid())
+ d->adapter->download(d->view->lastContextMenuRequest()->filteredLinkUrl(),
+ d->view->lastContextMenuRequest()->suggestedFileName(),
+ d->view->lastContextMenuRequest()->referrerUrl(),
+ d->view->lastContextMenuRequest()->referrerPolicy());
+
+ break;
+ case CopyImageToClipboard:
+ if (d->view && d->view->lastContextMenuRequest() && d->view->lastContextMenuRequest()->hasImageContent()
+ && (d->view->lastContextMenuRequest()->mediaType()
+ == QWebEngineContextMenuRequest::MediaTypeImage
+ || d->view->lastContextMenuRequest()->mediaType()
+ == QWebEngineContextMenuRequest::MediaTypeCanvas)) {
+ d->adapter->copyImageAt(d->view->lastContextMenuRequest()->position());
+ }
+ break;
+ case CopyImageUrlToClipboard:
+ if (d->view && d->view->lastContextMenuRequest() && d->view->lastContextMenuRequest()->mediaUrl().isValid()
+ && d->view->lastContextMenuRequest()->mediaType()
+ == QWebEngineContextMenuRequest::MediaTypeImage) {
+ QString urlString =
+ d->view->lastContextMenuRequest()->mediaUrl().toString(QUrl::FullyEncoded);
+ QString alt = d->view->lastContextMenuRequest()->altText();
+ if (!alt.isEmpty())
+ alt = QStringLiteral(" alt=\"%1\"").arg(alt.toHtmlEscaped());
+ QString title = d->view->lastContextMenuRequest()->titleText();
+ if (!title.isEmpty())
+ title = QStringLiteral(" title=\"%1\"").arg(title.toHtmlEscaped());
+ QMimeData *data = new QMimeData();
+ data->setText(urlString);
+ QString html = QStringLiteral("<img src=\"") + urlString + QStringLiteral("\"") + title + alt + QStringLiteral("></img>");
+ data->setHtml(html);
+ data->setUrls(QList<QUrl>() << d->view->lastContextMenuRequest()->mediaUrl());
+ QGuiApplication::clipboard()->setMimeData(data);
+ }
+ break;
+ case DownloadImageToDisk:
+ case DownloadMediaToDisk:
+ if (d->view && d->view->lastContextMenuRequest() && d->view->lastContextMenuRequest()->mediaUrl().isValid())
+ d->adapter->download(d->view->lastContextMenuRequest()->mediaUrl(),
+ d->view->lastContextMenuRequest()->suggestedFileName(),
+ d->view->lastContextMenuRequest()->referrerUrl(),
+ d->view->lastContextMenuRequest()->referrerPolicy());
+ break;
+ case CopyMediaUrlToClipboard:
+ if (d->view && d->view->lastContextMenuRequest() && d->view->lastContextMenuRequest()->mediaUrl().isValid()
+ && (d->view->lastContextMenuRequest()->mediaType()
+ == QWebEngineContextMenuRequest::MediaTypeAudio
+ || d->view->lastContextMenuRequest()->mediaType()
+ == QWebEngineContextMenuRequest::MediaTypeVideo)) {
+ QString urlString =
+ d->view->lastContextMenuRequest()->mediaUrl().toString(QUrl::FullyEncoded);
+ QString title = d->view->lastContextMenuRequest()->titleText();
+ if (!title.isEmpty())
+ title = QStringLiteral(" title=\"%1\"").arg(title.toHtmlEscaped());
+ QMimeData *data = new QMimeData();
+ data->setText(urlString);
+ if (d->view->lastContextMenuRequest()->mediaType()
+ == QWebEngineContextMenuRequest::MediaTypeAudio)
+ data->setHtml(QStringLiteral("<audio src=\"") + urlString + QStringLiteral("\"") + title +
+ QStringLiteral("></audio>"));
+ else
+ data->setHtml(QStringLiteral("<video src=\"") + urlString + QStringLiteral("\"") + title +
+ QStringLiteral("></video>"));
+ data->setUrls(QList<QUrl>() << d->view->lastContextMenuRequest()->mediaUrl());
+ QGuiApplication::clipboard()->setMimeData(data);
+ }
+ break;
+ case ToggleMediaControls:
+ if (d->view && d->view->lastContextMenuRequest() && d->view->lastContextMenuRequest()->mediaUrl().isValid()
+ && d->view->lastContextMenuRequest()->mediaFlags()
+ & QWebEngineContextMenuRequest::MediaCanToggleControls) {
+ bool enable = !(d->view->lastContextMenuRequest()->mediaFlags()
+ & QWebEngineContextMenuRequest::MediaControls);
+ d->adapter->executeMediaPlayerActionAt(d->view->lastContextMenuRequest()->position(),
+ WebContentsAdapter::MediaPlayerControls, enable);
+ }
+ break;
+ case ToggleMediaLoop:
+ if (d->view && d->view->lastContextMenuRequest() && d->view->lastContextMenuRequest()->mediaUrl().isValid()
+ && (d->view->lastContextMenuRequest()->mediaType()
+ == QWebEngineContextMenuRequest::MediaTypeAudio
+ || d->view->lastContextMenuRequest()->mediaType()
+ == QWebEngineContextMenuRequest::MediaTypeVideo)) {
+ bool enable = !(d->view->lastContextMenuRequest()->mediaFlags()
+ & QWebEngineContextMenuRequest::MediaLoop);
+ d->adapter->executeMediaPlayerActionAt(d->view->lastContextMenuRequest()->position(),
+ WebContentsAdapter::MediaPlayerLoop, enable);
+ }
+ break;
+ case ToggleMediaPlayPause:
+ if (d->view && d->view->lastContextMenuRequest() && d->view->lastContextMenuRequest()->mediaUrl().isValid()
+ && (d->view->lastContextMenuRequest()->mediaType()
+ == QWebEngineContextMenuRequest::MediaTypeAudio
+ || d->view->lastContextMenuRequest()->mediaType()
+ == QWebEngineContextMenuRequest::MediaTypeVideo)) {
+ bool enable = (d->view->lastContextMenuRequest()->mediaFlags()
+ & QWebEngineContextMenuRequest::MediaPaused);
+ d->adapter->executeMediaPlayerActionAt(d->view->lastContextMenuRequest()->position(),
+ WebContentsAdapter::MediaPlayerPlay, enable);
+ }
+ break;
+ case ToggleMediaMute:
+ if (d->view && d->view->lastContextMenuRequest() && d->view->lastContextMenuRequest()->mediaUrl().isValid()
+ && d->view->lastContextMenuRequest()->mediaFlags()
+ & QWebEngineContextMenuRequest::MediaHasAudio) {
+ // Make sure to negate the value, so that toggling actually works.
+ bool enable = !(d->view->lastContextMenuRequest()->mediaFlags()
+ & QWebEngineContextMenuRequest::MediaMuted);
+ d->adapter->executeMediaPlayerActionAt(d->view->lastContextMenuRequest()->position(),
+ WebContentsAdapter::MediaPlayerMute, enable);
+ }
+ break;
+ case InspectElement:
+ if (d->view && d->view->lastContextMenuRequest())
+ d->adapter->inspectElementAt(d->view->lastContextMenuRequest()->position());
+ break;
+ case ExitFullScreen:
+ // See under ViewSource, anything that can trigger a delete of the current view is dangerous to call directly here.
+ QTimer::singleShot(0, this, [d](){ d->adapter->exitFullScreen(); });
+ break;
+ case RequestClose:
+ d->adapter->requestClose();
+ break;
+ case SavePage:
+ d->adapter->save();
+ break;
+ case ViewSource:
+ // This is a workaround to make the ViewSource action working in a context menu.
+ // The WebContentsAdapter::viewSource() method deletes a
+ // RenderWidgetHostViewQtDelegateWidget instance which passes the control to the event
+ // loop. If the QMenu::aboutToHide() signal is connected to the QObject::deleteLater()
+ // slot the QMenu is deleted by the event handler while the ViewSource action is still not
+ // completed. This may lead to a crash. To avoid this the WebContentsAdapter::viewSource()
+ // method is called indirectly via the QTimer::singleShot() function which schedules the
+ // the viewSource() call after the QMenu's destruction.
+ QTimer::singleShot(0, this, [d](){ d->adapter->viewSource(); });
+ break;
+ case ToggleBold:
+ runJavaScript(QStringLiteral("document.execCommand('bold');"), QWebEngineScript::ApplicationWorld);
+ break;
+ case ToggleItalic:
+ runJavaScript(QStringLiteral("document.execCommand('italic');"), QWebEngineScript::ApplicationWorld);
+ break;
+ case ToggleUnderline:
+ runJavaScript(QStringLiteral("document.execCommand('underline');"), QWebEngineScript::ApplicationWorld);
+ break;
+ case ToggleStrikethrough:
+ runJavaScript(QStringLiteral("document.execCommand('strikethrough');"), QWebEngineScript::ApplicationWorld);
+ break;
+ case AlignLeft:
+ runJavaScript(QStringLiteral("document.execCommand('justifyLeft');"), QWebEngineScript::ApplicationWorld);
+ break;
+ case AlignCenter:
+ runJavaScript(QStringLiteral("document.execCommand('justifyCenter');"), QWebEngineScript::ApplicationWorld);
+ break;
+ case AlignRight:
+ runJavaScript(QStringLiteral("document.execCommand('justifyRight');"), QWebEngineScript::ApplicationWorld);
+ break;
+ case AlignJustified:
+ runJavaScript(QStringLiteral("document.execCommand('justifyFull');"), QWebEngineScript::ApplicationWorld);
+ break;
+ case Indent:
+ runJavaScript(QStringLiteral("document.execCommand('indent');"), QWebEngineScript::ApplicationWorld);
+ break;
+ case Outdent:
+ runJavaScript(QStringLiteral("document.execCommand('outdent');"), QWebEngineScript::ApplicationWorld);
+ break;
+ case InsertOrderedList:
+ runJavaScript(QStringLiteral("document.execCommand('insertOrderedList');"), QWebEngineScript::ApplicationWorld);
+ break;
+ case InsertUnorderedList:
+ runJavaScript(QStringLiteral("document.execCommand('insertUnorderedList');"), QWebEngineScript::ApplicationWorld);
+ break;
+ case ChangeTextDirectionLTR:
+ d->adapter->changeTextDirection(true /*left to right*/);
+ break;
+ case ChangeTextDirectionRTL:
+ d->adapter->changeTextDirection(false /*left to right*/);
+ break;
+ case NoWebAction:
+ break;
+ case WebActionCount:
+ Q_UNREACHABLE();
+ break;
+ }
+}
+
+/*!
+ * \since 5.8
+ * Replace the current misspelled word with \a replacement.
+ *
+ * The current misspelled word can be found in QWebEngineContextMenuRequest::misspelledWord(),
+ * and suggested replacements in QWebEngineContextMenuRequest::spellCheckerSuggestions().
+ *
+ */
+
+void QWebEnginePage::replaceMisspelledWord(const QString &replacement)
+{
+ Q_D(QWebEnginePage);
+ d->adapter->replaceMisspelling(replacement);
+}
+
+void QWebEnginePage::findText(const QString &subString, FindFlags options, const std::function<void(const QWebEngineFindTextResult &)> &resultCallback)
+{
+ Q_D(QWebEnginePage);
+ if (!d->adapter->isInitialized()) {
+ if (resultCallback)
+ resultCallback(QWebEngineFindTextResult());
+ return;
+ }
+
+ d->adapter->findTextHelper()->startFinding(subString, options & FindCaseSensitively, options & FindBackward, resultCallback);
+}
+
+/*!
+ * \reimp
+ */
+bool QWebEnginePage::event(QEvent *e)
+{
+ return QObject::event(e);
+}
+
+void QWebEnginePagePrivate::desktopMediaRequested(
+ QtWebEngineCore::DesktopMediaController *controller)
+{
+ Q_Q(QWebEnginePage);
+ QTimer::singleShot(0, q, [q, controller]() {
+ Q_EMIT q->desktopMediaRequested(QWebEngineDesktopMediaRequest(controller));
+ });
+}
+
+void QWebEnginePagePrivate::contextMenuRequested(QWebEngineContextMenuRequest *data)
+{
+ if (view)
+ view->contextMenuRequested(data);
+}
+
+/*!
+ \fn void QWebEnginePage::navigationRequested(QWebEngineNavigationRequest &request)
+ \since 6.2
+
+ This signal is emitted on navigation together with the call the acceptNavigationRequest().
+ It can be used to accept or ignore the \a request. The default is to accept.
+
+ \sa acceptNavigationRequest()
+*/
+
+void QWebEnginePagePrivate::navigationRequested(int navigationType, const QUrl &url, bool &accepted, bool isMainFrame)
+{
+ Q_Q(QWebEnginePage);
+
+ accepted = q->acceptNavigationRequest(url, static_cast<QWebEnginePage::NavigationType>(navigationType), isMainFrame);
+ if (accepted) {
+ QWebEngineNavigationRequest navigationRequest(url, static_cast<QWebEngineNavigationRequest::NavigationType>(navigationType), isMainFrame);
+ Q_EMIT q->navigationRequested(navigationRequest);
+ accepted = navigationRequest.isAccepted();
+ }
+
+ if (accepted && adapter->findTextHelper()->isFindTextInProgress())
+ adapter->findTextHelper()->stopFinding();
+}
+
+void QWebEnginePagePrivate::requestFullScreenMode(const QUrl &origin, bool fullscreen)
+{
+ Q_Q(QWebEnginePage);
+ QWebEngineFullScreenRequest request(origin, fullscreen, [q = QPointer(q)] (bool toggleOn) { if (q) q->d_ptr->setFullScreenMode(toggleOn); });
+ Q_EMIT q->fullScreenRequested(std::move(request));
+}
+
+bool QWebEnginePagePrivate::isFullScreenMode() const
+{
+ return fullscreenMode;
+}
+
+void QWebEnginePagePrivate::javascriptDialog(QSharedPointer<JavaScriptDialogController> controller)
+{
+ Q_Q(QWebEnginePage);
+ bool accepted = false;
+ QString promptResult;
+ switch (controller->type()) {
+ case AlertDialog:
+ q->javaScriptAlert(controller->securityOrigin(), controller->message());
+ accepted = true;
+ break;
+ case ConfirmDialog:
+ accepted = q->javaScriptConfirm(controller->securityOrigin(), controller->message());
+ break;
+ case PromptDialog:
+ accepted = q->javaScriptPrompt(controller->securityOrigin(), controller->message(), controller->defaultPrompt(), &promptResult);
+ if (accepted)
+ controller->textProvided(promptResult);
+ break;
+ case UnloadDialog:
+ accepted = q->javaScriptConfirm(controller->securityOrigin(), QCoreApplication::translate("QWebEnginePage", "Are you sure you want to leave this page? Changes that you made may not be saved."));
+ break;
+ case InternalAuthorizationDialog:
+ accepted = view ? view->showAuthorizationDialog(controller->title(), controller->message())
+ : false;
+ break;
+ }
+ if (accepted)
+ controller->accept();
+ else
+ controller->reject();
+}
+
+void QWebEnginePagePrivate::allowCertificateError(const QWebEngineCertificateError &error)
+{
+ Q_Q(QWebEnginePage);
+ Q_EMIT q->certificateError(error);
+}
+
+void QWebEnginePagePrivate::selectClientCert(const QSharedPointer<ClientCertSelectController> &controller)
+{
+ Q_Q(QWebEnginePage);
+ QWebEngineClientCertificateSelection certSelection(controller);
+
+ Q_EMIT q->selectClientCertificate(certSelection);
+}
+
+/*!
+ \fn void QWebEnginePage::selectClientCertificate(QWebEngineClientCertificateSelection clientCertificateSelection)
+ \since 5.12
+
+ This signal is emitted when a web site requests an SSL client certificate, and one or more were
+ found in system's client certificate store.
+
+ Handling the signal is asynchronous, and loading will be waiting until a certificate is selected,
+ or the last copy of \a clientCertificateSelection is destroyed.
+
+ If the signal is not handled, \a clientCertificateSelection is automatically destroyed, and loading
+ will continue without a client certificate.
+
+ \sa QWebEngineClientCertificateSelection
+*/
+
+void QWebEnginePagePrivate::javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString &message, int lineNumber, const QString &sourceID)
+{
+ Q_Q(QWebEnginePage);
+ q->javaScriptConsoleMessage(static_cast<QWebEnginePage::JavaScriptConsoleMessageLevel>(level), message, lineNumber, sourceID);
+}
+
+void QWebEnginePagePrivate::renderProcessTerminated(RenderProcessTerminationStatus terminationStatus,
+ int exitCode)
+{
+ Q_Q(QWebEnginePage);
+ Q_EMIT q->renderProcessTerminated(static_cast<QWebEnginePage::RenderProcessTerminationStatus>(
+ terminationStatus), exitCode);
+}
+
+void QWebEnginePagePrivate::requestGeometryChange(const QRect &geometry, const QRect &frameGeometry)
+{
+ Q_UNUSED(geometry);
+ Q_Q(QWebEnginePage);
+ Q_EMIT q->geometryChangeRequested(frameGeometry);
+}
+
+QObject *QWebEnginePagePrivate::dragSource() const
+{
+#if QT_CONFIG(draganddrop)
+ return view->accessibilityParentObject();
+#else
+ return nullptr;
+#endif // QT_CONFIG(draganddrop)
+}
+
+bool QWebEnginePagePrivate::isEnabled() const
+{
+ if (view)
+ return view->isEnabled();
+ return true;
+}
+
+void QWebEnginePagePrivate::setToolTip(const QString &toolTipText)
+{
+ if (view)
+ view->setToolTip(toolTipText);
+}
+
+/*!
+ \fn void QWebEnginePage::printRequested()
+ \since 5.12
+
+ This signal is emitted when the JavaScript \c{window.print()} method is called or the user pressed the print
+ button of PDF viewer plugin.
+ Typically, the signal handler can simply call printToPdf().
+
+ \sa printToPdf()
+*/
+
+void QWebEnginePagePrivate::printRequested()
+{
+ Q_Q(QWebEnginePage);
+ QTimer::singleShot(0, q, [q]() {
+ Q_EMIT q->printRequested();
+ });
+ if (view)
+ view->printRequested();
+}
+
+QtWebEngineCore::TouchHandleDrawableDelegate *
+QWebEnginePagePrivate::createTouchHandleDelegate(const QMap<int, QImage> &images)
+{
+ return view->createTouchHandleDelegate(images);
+}
+
+void QWebEnginePagePrivate::showTouchSelectionMenu(
+ QtWebEngineCore::TouchSelectionMenuController *controller, const QRect &selectionBounds,
+ const QSize &handleSize)
+{
+ Q_UNUSED(handleSize);
+
+ if (controller->buttonCount() == 1) {
+ controller->runContextMenu();
+ return;
+ }
+
+ view->showTouchSelectionMenu(controller, selectionBounds);
+}
+
+void QWebEnginePagePrivate::hideTouchSelectionMenu()
+{
+ view->hideTouchSelectionMenu();
+}
+
+void QWebEnginePagePrivate::lifecycleStateChanged(LifecycleState state)
+{
+ Q_Q(QWebEnginePage);
+ Q_EMIT q->lifecycleStateChanged(static_cast<QWebEnginePage::LifecycleState>(state));
+}
+
+void QWebEnginePagePrivate::recommendedStateChanged(LifecycleState state)
+{
+ Q_Q(QWebEnginePage);
+ QTimer::singleShot(0, q, [q, state]() {
+ Q_EMIT q->recommendedStateChanged(static_cast<QWebEnginePage::LifecycleState>(state));
+ });
+}
+
+void QWebEnginePagePrivate::visibleChanged(bool visible)
+{
+ Q_Q(QWebEnginePage);
+ Q_EMIT q->visibleChanged(visible);
+}
+
+/*!
+ \since 5.13
+
+ Registers the request interceptor \a interceptor to intercept URL requests.
+
+ The page does not take ownership of the pointer. This interceptor is called
+ after any interceptors on the profile, and unlike profile interceptors, only
+ URL requests from this page are intercepted. If the original request was
+ already blocked or redirected by the profile interceptor, it will not be
+ intercepted by this.
+
+ To unset the request interceptor, set a \c nullptr.
+
+ \sa QWebEngineUrlRequestInfo, QWebEngineProfile::setUrlRequestInterceptor()
+*/
+
+void QWebEnginePage::setUrlRequestInterceptor(QWebEngineUrlRequestInterceptor *interceptor)
+{
+ Q_D(QWebEnginePage);
+ d->adapter->setRequestInterceptor(interceptor);
+}
+
+void QWebEnginePage::setFeaturePermission(const QUrl &securityOrigin, QWebEnginePage::Feature feature, QWebEnginePage::PermissionPolicy policy)
+{
+ Q_D(QWebEnginePage);
+ if (policy == PermissionUnknown) {
+ switch (feature) {
+ case MediaAudioVideoCapture:
+ case MediaAudioCapture:
+ case MediaVideoCapture:
+ case DesktopAudioVideoCapture:
+ case DesktopVideoCapture:
+ case MouseLock:
+ break;
+ case Geolocation:
+ d->adapter->grantFeaturePermission(securityOrigin, ProfileAdapter::GeolocationPermission, ProfileAdapter::AskPermission);
+ break;
+ case Notifications:
+ d->adapter->grantFeaturePermission(securityOrigin, ProfileAdapter::NotificationPermission, ProfileAdapter::AskPermission);
+ break;
+ case ClipboardReadWrite:
+ d->adapter->grantFeaturePermission(securityOrigin, ProfileAdapter::ClipboardReadWrite,
+ ProfileAdapter::AskPermission);
+ break;
+ case LocalFontsAccess:
+ d->adapter->grantFeaturePermission(securityOrigin, ProfileAdapter::LocalFontsPermission, ProfileAdapter::AskPermission);
+ break;
+ }
+ return;
+ }
+
+ const WebContentsAdapterClient::MediaRequestFlags audioVideoCaptureFlags(
+ WebContentsAdapterClient::MediaVideoCapture |
+ WebContentsAdapterClient::MediaAudioCapture);
+ const WebContentsAdapterClient::MediaRequestFlags desktopAudioVideoCaptureFlags(
+ WebContentsAdapterClient::MediaDesktopVideoCapture |
+ WebContentsAdapterClient::MediaDesktopAudioCapture);
+
+ if (policy == PermissionGrantedByUser) {
+ switch (feature) {
+ case MediaAudioVideoCapture:
+ d->adapter->grantMediaAccessPermission(securityOrigin, audioVideoCaptureFlags);
+ break;
+ case MediaAudioCapture:
+ d->adapter->grantMediaAccessPermission(securityOrigin, WebContentsAdapterClient::MediaAudioCapture);
+ break;
+ case MediaVideoCapture:
+ d->adapter->grantMediaAccessPermission(securityOrigin, WebContentsAdapterClient::MediaVideoCapture);
+ break;
+ case DesktopAudioVideoCapture:
+ d->adapter->grantMediaAccessPermission(securityOrigin, desktopAudioVideoCaptureFlags);
+ break;
+ case DesktopVideoCapture:
+ d->adapter->grantMediaAccessPermission(securityOrigin, WebContentsAdapterClient::MediaDesktopVideoCapture);
+ break;
+ case MouseLock:
+ d->adapter->grantMouseLockPermission(securityOrigin, true);
+ break;
+ case Geolocation:
+ d->adapter->grantFeaturePermission(securityOrigin, ProfileAdapter::GeolocationPermission, ProfileAdapter::AllowedPermission);
+ break;
+ case Notifications:
+ d->adapter->grantFeaturePermission(securityOrigin, ProfileAdapter::NotificationPermission, ProfileAdapter::AllowedPermission);
+ break;
+ case ClipboardReadWrite:
+ d->adapter->grantFeaturePermission(securityOrigin, ProfileAdapter::ClipboardReadWrite,
+ ProfileAdapter::AllowedPermission);
+ break;
+ case LocalFontsAccess:
+ d->adapter->grantFeaturePermission(securityOrigin, ProfileAdapter::LocalFontsPermission, ProfileAdapter::AllowedPermission);
+ break;
+ }
+ } else { // if (policy == PermissionDeniedByUser)
+ switch (feature) {
+ case MediaAudioVideoCapture:
+ case MediaAudioCapture:
+ case MediaVideoCapture:
+ case DesktopAudioVideoCapture:
+ case DesktopVideoCapture:
+ d->adapter->grantMediaAccessPermission(securityOrigin, WebContentsAdapterClient::MediaNone);
+ break;
+ case Geolocation:
+ d->adapter->grantFeaturePermission(securityOrigin, ProfileAdapter::GeolocationPermission, ProfileAdapter::DeniedPermission);
+ break;
+ case MouseLock:
+ d->adapter->grantMouseLockPermission(securityOrigin, false);
+ break;
+ case Notifications:
+ d->adapter->grantFeaturePermission(securityOrigin, ProfileAdapter::NotificationPermission, ProfileAdapter::DeniedPermission);
+ break;
+ case ClipboardReadWrite:
+ d->adapter->grantFeaturePermission(securityOrigin, ProfileAdapter::ClipboardReadWrite,
+ ProfileAdapter::DeniedPermission);
+ break;
+ case LocalFontsAccess:
+ d->adapter->grantFeaturePermission(securityOrigin, ProfileAdapter::LocalFontsPermission, ProfileAdapter::DeniedPermission);
+ break;
+ }
+ }
+}
+
+static inline QWebEnginePage::FileSelectionMode toPublic(FilePickerController::FileChooserMode mode)
+{
+ // Should the underlying values change, we'll need a switch here.
+ return static_cast<QWebEnginePage::FileSelectionMode>(mode);
+}
+
+void QWebEnginePagePrivate::runFileChooser(QSharedPointer<FilePickerController> controller)
+{
+ Q_Q(QWebEnginePage);
+
+ QStringList selectedFileNames = q->chooseFiles(toPublic(controller->mode()), (QStringList() << controller->defaultFileName()), controller->acceptedMimeTypes());
+
+ if (!selectedFileNames.empty())
+ controller->accepted(selectedFileNames);
+ else
+ controller->rejected();
+}
+
+QWebEngineSettings *QWebEnginePagePrivate::webEngineSettings() const
+{
+ return settings;
+}
+
+/*!
+ \since 5.10
+ Downloads the resource from the location given by \a url to a local file.
+
+ If \a filename is given, it is used as the suggested file name.
+ If it is relative, the file is saved in the standard download location with
+ the given name.
+ If it is a null or empty QString, the default file name is used.
+
+ This will emit QWebEngineProfile::downloadRequested() after the download
+ has started.
+*/
+
+void QWebEnginePage::download(const QUrl& url, const QString& filename)
+{
+ Q_D(QWebEnginePage);
+ d->ensureInitialized();
+ d->adapter->download(url, filename);
+}
+
+/*!
+ \fn void QWebEnginePage::loadingChanged(const QWebEngineLoadingInfo &loadingInfo)
+ \since 6.2
+ This signal is emitted when loading the page specified by \a loadingInfo begins,
+ ends, or fails.
+*/
+
+/*!
+ \property QWebEnginePage::loading
+ \since 6.2
+
+ \brief Whether the page is currently loading.
+
+ \sa QWebEngineLoadingInfo, loadStarted, loadFinished
+*/
+bool QWebEnginePage::isLoading() const
+{
+ return d_ptr->isLoading;
+}
+
+void QWebEnginePage::load(const QUrl& url)
+{
+ Q_D(QWebEnginePage);
+ d->adapter->load(url);
+}
+
+/*!
+ \since 5.9
+ Issues the specified \a request and loads the response.
+
+ \sa load(), setUrl(), url(), urlChanged(), QUrl::fromUserInput()
+*/
+void QWebEnginePage::load(const QWebEngineHttpRequest& request)
+{
+ Q_D(QWebEnginePage);
+ d->adapter->load(request);
+}
+
+void QWebEnginePage::toHtml(const std::function<void(const QString &)> &resultCallback) const
+{
+ Q_D(const QWebEnginePage);
+ d->ensureInitialized();
+ quint64 requestId = d->adapter->fetchDocumentMarkup();
+ d->m_stringCallbacks.insert(requestId, resultCallback);
+}
+
+void QWebEnginePage::toPlainText(const std::function<void(const QString &)> &resultCallback) const
+{
+ Q_D(const QWebEnginePage);
+ d->ensureInitialized();
+ quint64 requestId = d->adapter->fetchDocumentInnerText();
+ d->m_stringCallbacks.insert(requestId, resultCallback);
+}
+
+void QWebEnginePage::setHtml(const QString &html, const QUrl &baseUrl)
+{
+ setContent(html.toUtf8(), QStringLiteral("text/html;charset=UTF-8"), baseUrl);
+}
+
+void QWebEnginePage::setContent(const QByteArray &data, const QString &mimeType, const QUrl &baseUrl)
+{
+ Q_D(QWebEnginePage);
+ d->adapter->setContent(data, mimeType, baseUrl);
+}
+
+QString QWebEnginePage::title() const
+{
+ Q_D(const QWebEnginePage);
+ return d->adapter->pageTitle();
+}
+
+void QWebEnginePage::setUrl(const QUrl &url)
+{
+ Q_D(QWebEnginePage);
+ if (d->url != url) {
+ d->url = url;
+ emit urlChanged(url);
+ }
+ load(url);
+}
+
+QUrl QWebEnginePage::url() const
+{
+ Q_D(const QWebEnginePage);
+ return d->url;
+}
+
+QUrl QWebEnginePage::requestedUrl() const
+{
+ Q_D(const QWebEnginePage);
+ return d->adapter->requestedUrl();
+}
+
+/*!
+ \property QWebEnginePage::iconUrl
+ \brief The URL of the icon associated with the page currently viewed.
+
+ By default, this property contains an empty URL.
+
+ \sa iconUrlChanged(), icon(), iconChanged()
+*/
+QUrl QWebEnginePage::iconUrl() const
+{
+ Q_D(const QWebEnginePage);
+ return d->iconUrl;
+}
+
+/*!
+ \property QWebEnginePage::icon
+ \brief The icon associated with the page currently viewed.
+ \since 5.7
+
+ By default, this property contains a null icon. If touch icons are disabled
+ (see \c QWebEngineSettings::TouchIconsEnabled), the favicon is provided in two sizes
+ (16x16 and 32x32 pixels) encapsulated in \c{QIcon}. Otherwise, single icon is provided
+ with the largest available size.
+
+ \sa iconChanged(), iconUrl(), iconUrlChanged(), QWebEngineSettings::TouchIconsEnabled
+*/
+QIcon QWebEnginePage::icon() const
+{
+ Q_D(const QWebEnginePage);
+
+ if (d->iconUrl.isEmpty() || !d->adapter->isInitialized())
+ return QIcon();
+
+ return d->adapter->icon();
+}
+
+qreal QWebEnginePage::zoomFactor() const
+{
+ Q_D(const QWebEnginePage);
+ if (d->adapter->isInitialized())
+ return d->adapter->currentZoomFactor();
+ return d->defaultZoomFactor;
+}
+
+void QWebEnginePage::setZoomFactor(qreal factor)
+{
+ Q_D(QWebEnginePage);
+ d->defaultZoomFactor = factor;
+
+ if (d->adapter->isInitialized()) {
+ d->adapter->setZoomFactor(factor);
+ // MEMO: should reset if factor was not applied due to being invalid
+ d->defaultZoomFactor = zoomFactor();
+ }
+}
+
+void QWebEnginePage::runJavaScript(const QString& scriptSource, const std::function<void(const QVariant &)> &resultCallback)
+{
+ Q_D(QWebEnginePage);
+ d->ensureInitialized();
+ if (d->adapter->lifecycleState() == WebContentsAdapter::LifecycleState::Discarded) {
+ qWarning("runJavaScript: disabled in Discarded state");
+ if (resultCallback)
+ resultCallback(QVariant());
+ return;
+ }
+ quint64 requestId = d->adapter->runJavaScriptCallbackResult(scriptSource, QWebEngineScript::MainWorld);
+ if (requestId)
+ d->m_variantCallbacks.insert(requestId, resultCallback);
+ else if (resultCallback)
+ resultCallback(QVariant());
+}
+
+void QWebEnginePage::runJavaScript(const QString& scriptSource, quint32 worldId, const std::function<void(const QVariant &)> &resultCallback)
+{
+ Q_D(QWebEnginePage);
+ d->ensureInitialized();
+ if (d->adapter->lifecycleState() == WebContentsAdapter::LifecycleState::Discarded) {
+ qWarning("runJavaScript: disabled in Discarded state");
+ if (resultCallback)
+ resultCallback(QVariant());
+ return;
+ }
+ if (resultCallback) {
+ quint64 requestId = d->adapter->runJavaScriptCallbackResult(scriptSource, worldId);
+ if (requestId)
+ d->m_variantCallbacks.insert(requestId, resultCallback);
+ else
+ resultCallback(QVariant());
+ } else {
+ d->adapter->runJavaScript(scriptSource, worldId);
+ }
+}
+
+/*!
+ Returns the collection of scripts that are injected into the page.
+
+ In addition, a page might also execute scripts
+ added through QWebEngineProfile::scripts().
+
+ \sa QWebEngineScriptCollection, QWebEngineScript, {Script Injection}
+*/
+
+QWebEngineScriptCollection &QWebEnginePage::scripts()
+{
+ Q_D(QWebEnginePage);
+ return d->scriptCollection;
+}
+
+QWebEnginePage *QWebEnginePage::createWindow(WebWindowType type)
+{
+ Q_D(QWebEnginePage);
+ return d->view ? d->view->createPageForWindow(type) : nullptr;
+}
+
+/*!
+ \since 5.11
+ Returns the page this page is inspecting, if any.
+
+ Returns \c nullptr if this page is not a developer tools page.
+
+ \sa setInspectedPage(), devToolsPage()
+*/
+
+QWebEnginePage *QWebEnginePage::inspectedPage() const
+{
+ Q_D(const QWebEnginePage);
+ return d->inspectedPage;
+}
+
+/*!
+ \since 5.11
+ Navigates this page to an internal URL that is the developer
+ tools of \a page.
+
+ This is the same as calling setDevToolsPage() on \a page
+ with \c this as argument.
+
+ \sa inspectedPage(), setDevToolsPage()
+*/
+
+void QWebEnginePage::setInspectedPage(QWebEnginePage *page)
+{
+ Q_D(QWebEnginePage);
+ if (d->inspectedPage == page)
+ return;
+ QWebEnginePage *oldPage = d->inspectedPage;
+ d->inspectedPage = nullptr;
+ if (oldPage)
+ oldPage->setDevToolsPage(nullptr);
+ d->inspectedPage = page;
+ if (page)
+ page->setDevToolsPage(this);
+}
+
+/*!
+ \since 5.11
+ Returns the page that is hosting the developer tools
+ of this page, if any.
+
+ Returns \c nullptr if no developer tools page is set.
+
+ \sa setDevToolsPage(), inspectedPage()
+*/
+
+QWebEnginePage *QWebEnginePage::devToolsPage() const
+{
+ Q_D(const QWebEnginePage);
+ return d->devToolsPage;
+}
+
+/*!
+ \since 5.11
+ Binds \a devToolsPage to be the developer tools of this page.
+ Triggers \a devToolsPage to navigate to an internal URL
+ with the developer tools.
+
+ This is the same as calling setInspectedPage() on \a devToolsPage
+ with \c this as argument.
+
+ \sa devToolsPage(), setInspectedPage()
+*/
+
+void QWebEnginePage::setDevToolsPage(QWebEnginePage *devToolsPage)
+{
+ Q_D(QWebEnginePage);
+ if (d->devToolsPage == devToolsPage)
+ return;
+ d->ensureInitialized();
+ QWebEnginePage *oldDevTools = d->devToolsPage;
+ d->devToolsPage = nullptr;
+ if (oldDevTools)
+ oldDevTools->setInspectedPage(nullptr);
+ d->devToolsPage = devToolsPage;
+ if (devToolsPage)
+ devToolsPage->setInspectedPage(this);
+ if (d->adapter) {
+ if (devToolsPage)
+ d->adapter->openDevToolsFrontend(devToolsPage->d_ptr->adapter);
+ else
+ d->adapter->closeDevToolsFrontend();
+ }
+}
+
+/*!
+ \since 6.6
+ Returns the id of the developer tools host associated with this page.
+
+ If remote debugging is enabled (see \l{Qt WebEngine Developer Tools}), the id can be used to
+ build the URL to connect to the developer tool websocket:
+ \c{ws://localhost:<debugggin-port>/devtools/page/<id>)}. The websocket can be used to to interact
+ with the page using the \l{https://chromedevtools.github.io/devtools-protocol/}{DevTools
+ Protocol}.
+*/
+
+QString QWebEnginePage::devToolsId() const
+{
+ Q_D(const QWebEnginePage);
+ d->ensureInitialized();
+ return d->adapter->devToolsId();
+}
+
+ASSERT_ENUMS_MATCH(FilePickerController::Open, QWebEnginePage::FileSelectOpen)
+ASSERT_ENUMS_MATCH(FilePickerController::OpenMultiple, QWebEnginePage::FileSelectOpenMultiple)
+ASSERT_ENUMS_MATCH(FilePickerController::UploadFolder, QWebEnginePage::FileSelectUploadFolder)
+ASSERT_ENUMS_MATCH(FilePickerController::Save, QWebEnginePage::FileSelectSave)
+
+// TODO: remove virtuals
+QStringList QWebEnginePage::chooseFiles(FileSelectionMode mode, const QStringList &oldFiles, const QStringList &acceptedMimeTypes)
+{
+ Q_D(const QWebEnginePage);
+ return d->view ? d->view->chooseFiles(mode, oldFiles, acceptedMimeTypes) : QStringList();
+}
+
+void QWebEnginePage::javaScriptAlert(const QUrl &securityOrigin, const QString &msg)
+{
+ Q_UNUSED(securityOrigin);
+ Q_D(const QWebEnginePage);
+ if (d->view)
+ d->view->javaScriptAlert(url(), msg);
+}
+
+bool QWebEnginePage::javaScriptConfirm(const QUrl &securityOrigin, const QString &msg)
+{
+ Q_UNUSED(securityOrigin);
+ Q_D(const QWebEnginePage);
+ return d->view ? d->view->javaScriptConfirm(url(), msg) : false;
+}
+
+bool QWebEnginePage::javaScriptPrompt(const QUrl &securityOrigin, const QString &msg, const QString &defaultValue, QString *result)
+{
+ Q_UNUSED(securityOrigin);
+ Q_D(const QWebEnginePage);
+ return d->view ? d->view->javaScriptPrompt(url(), msg, defaultValue, result) : false;
+}
+
+void QWebEnginePage::javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString &message, int lineNumber, const QString &sourceID)
+{
+ static QLoggingCategory loggingCategory("js", QtWarningMsg);
+ static QByteArray file = sourceID.toUtf8();
+ QMessageLogger logger(file.constData(), lineNumber, nullptr, loggingCategory.categoryName());
+
+ switch (level) {
+ case JavaScriptConsoleMessageLevel::InfoMessageLevel:
+ if (loggingCategory.isInfoEnabled())
+ logger.info().noquote() << message;
+ break;
+ case JavaScriptConsoleMessageLevel::WarningMessageLevel:
+ if (loggingCategory.isWarningEnabled())
+ logger.warning().noquote() << message;
+ break;
+ case JavaScriptConsoleMessageLevel::ErrorMessageLevel:
+ if (loggingCategory.isCriticalEnabled())
+ logger.critical().noquote() << message;
+ break;
+ }
+}
+
+bool QWebEnginePage::acceptNavigationRequest(const QUrl &url, NavigationType type, bool isMainFrame)
+{
+ Q_UNUSED(url);
+ Q_UNUSED(type);
+ Q_UNUSED(isMainFrame);
+ return true;
+}
+
+QPointF QWebEnginePage::scrollPosition() const
+{
+ Q_D(const QWebEnginePage);
+ return d->adapter->lastScrollOffset();
+}
+
+QSizeF QWebEnginePage::contentsSize() const
+{
+ Q_D(const QWebEnginePage);
+ return d->adapter->lastContentsSize();
+}
+
+/*!
+ \fn void QWebEnginePage::newWindowRequested(QWebEngineNewWindowRequest &request)
+ \since 6.2
+
+ This signal is emitted when \a request is issued to load a page in a separate
+ web engine window. This can either be because the current page requested it explicitly
+ through a JavaScript call to \c window.open, or because the user clicked on a link
+ while holding Shift, Ctrl, or a built-in combination that triggers the page to open
+ in a new window.
+
+ The signal is handled by calling openIn() with the new page on the request.
+ If this signal is not handled, the requested load will fail.
+
+ \note This signal is not emitted if \l createWindow() handled the request first.
+
+ \sa createWindow(), QWebEngineNewWindowRequest::openIn()
+*/
+
+/*!
+ \fn void QWebEnginePage::pdfPrintingFinished(const QString &filePath, bool success)
+
+ This signal is emitted when printing the web page into a PDF file has
+ finished.
+ \a filePath will contain the path the file was requested to be created
+ at, and \a success will be \c true if the file was successfully created and
+ \c false otherwise.
+
+ \sa printToPdf()
+*/
+
+/*!
+ Renders the current content of the page into a PDF document and saves it
+ in the location specified in \a filePath.
+ The page size and orientation of the produced PDF document are taken from
+ the values specified in \a layout, while the range of pages printed is
+ taken from \a ranges with the default being printing all pages.
+
+ This method issues an asynchronous request for printing the web page into
+ a PDF and returns immediately.
+ To be informed about the result of the request, connect to the signal
+ pdfPrintingFinished().
+
+ \note The \l QWebEnginePage::Stop web action can be used to interrupt
+ this asynchronous operation.
+
+ If a file already exists at the provided file path, it will be overwritten.
+ \sa pdfPrintingFinished()
+*/
+void QWebEnginePage::printToPdf(const QString &filePath, const QPageLayout &layout, const QPageRanges &ranges)
+{
+#if QT_CONFIG(webengine_printing_and_pdf)
+ Q_D(QWebEnginePage);
+ d->ensureInitialized();
+ d->adapter->printToPDF(layout, ranges, filePath);
+#else
+ Q_UNUSED(filePath);
+ Q_UNUSED(layout);
+ Q_UNUSED(ranges);
+#endif
+}
+
+/*!
+ Renders the current content of the page into a PDF document and returns a byte array containing the PDF data
+ as parameter to \a resultCallback.
+ The page size and orientation of the produced PDF document are taken from the values specified in \a layout,
+ while the range of pages printed is taken from \a ranges with the default being printing all pages.
+
+ The \a resultCallback must take a const reference to a QByteArray as parameter. If printing was successful, this byte array
+ will contain the PDF data, otherwise, the byte array will be empty.
+
+ \note The \l QWebEnginePage::Stop web action can be used to interrupt this operation.
+
+ \warning We guarantee that the callback (\a resultCallback) is always called, but it might be done
+ during page destruction. When QWebEnginePage is deleted, the callback is triggered with an invalid
+ value and it is not safe to use the corresponding QWebEnginePage or QWebEngineView instance inside it.
+*/
+void QWebEnginePage::printToPdf(const std::function<void(const QByteArray&)> &resultCallback, const QPageLayout &layout, const QPageRanges &ranges)
+{
+ Q_D(QWebEnginePage);
+#if QT_CONFIG(webengine_printing_and_pdf)
+ d->ensureInitialized();
+ quint64 requestId = d->adapter->printToPDFCallbackResult(layout, ranges);
+ d->m_pdfResultCallbacks.insert(requestId, resultCallback);
+#else
+ Q_UNUSED(layout);
+ Q_UNUSED(ranges);
+ if (resultCallback)
+ resultCallback(QByteArray());
+#endif
+}
+
+/*!
+ \internal
+*/
+void QWebEnginePage::acceptAsNewWindow(QWebEngineNewWindowRequest &request)
+{
+ Q_D(QWebEnginePage);
+ auto adapter = request.d_ptr->adapter;
+ QUrl url = request.requestedUrl();
+ if ((!adapter && !url.isValid()) || request.d_ptr->isRequestHandled) {
+ qWarning("Trying to open an empty request, it was either already used or was invalidated."
+ "\nYou must complete the request synchronously within the newWindowRequested signal handler."
+ " If a view hasn't been adopted before returning, the request will be invalidated.");
+ return;
+ }
+
+ if (!adapter)
+ setUrl(url);
+ else if (!d->adoptWebContents(adapter.data()))
+ return;
+
+ QRect geometry = request.requestedGeometry();
+ if (!geometry.isEmpty())
+ emit geometryChangeRequested(geometry);
+
+ request.d_ptr->setHandled();
+}
+
+/*!
+ \enum QWebEnginePage::LifecycleState
+ \since 5.14
+
+ This enum describes the lifecycle state of the page:
+
+ \value Active
+ Normal state.
+ \value Frozen
+ Low CPU usage state where most HTML task sources are suspended.
+ \value Discarded
+ Very low resource usage state where the entire browsing context is discarded.
+
+ \sa lifecycleState, {Page Lifecycle API}, {WebEngine Lifecycle Example}
+*/
+
+/*!
+ \property QWebEnginePage::lifecycleState
+ \since 5.14
+
+ \brief The current lifecycle state of the page.
+
+ The following restrictions are enforced by the setter:
+
+ \list
+ \li A \l{visible} page must remain in the \c{Active} state.
+ \li If the page is being inspected by a \l{devToolsPage} then both pages must
+ remain in the \c{Active} states.
+ \li A page in the \c{Discarded} state can only transition to the \c{Active}
+ state. This will cause a reload of the page.
+ \endlist
+
+ These are the only hard limits on the lifecycle state, but see also
+ \l{recommendedState} for the recommended soft limits.
+
+ \sa recommendedState, {Page Lifecycle API}, {WebEngine Lifecycle Example}
+*/
+
+QWebEnginePage::LifecycleState QWebEnginePage::lifecycleState() const
+{
+ Q_D(const QWebEnginePage);
+ return static_cast<LifecycleState>(d->adapter->lifecycleState());
+}
+
+void QWebEnginePage::setLifecycleState(LifecycleState state)
+{
+ Q_D(QWebEnginePage);
+ d->adapter->setLifecycleState(static_cast<WebContentsAdapterClient::LifecycleState>(state));
+}
+
+/*!
+ \property QWebEnginePage::recommendedState
+ \since 5.14
+
+ \brief The recommended limit for the lifecycle state of the page.
+
+ Setting the lifecycle state to a lower resource usage state than the
+ recommended state may cause side-effects such as stopping background audio
+ playback or loss of HTML form input. Setting the lifecycle state to a higher
+ resource state is however completely safe.
+
+ \sa lifecycleState, {Page Lifecycle API}, {WebEngine Lifecycle Example}
+*/
+
+QWebEnginePage::LifecycleState QWebEnginePage::recommendedState() const
+{
+ Q_D(const QWebEnginePage);
+ return static_cast<LifecycleState>(d->adapter->recommendedState());
+}
+
+/*!
+ \property QWebEnginePage::visible
+ \since 5.14
+
+ \brief Whether the page is considered visible in the Page Visibility API.
+
+ Setting this property changes the \c{Document.hidden} and the
+ \c{Document.visibilityState} properties in JavaScript which web sites can use
+ to voluntarily reduce their resource usage if they are not visible to the
+ user.
+
+ If the page is connected to a \e {view} then this property will be managed
+ automatically by the view according to it's own visibility.
+
+ \sa lifecycleState
+*/
+
+bool QWebEnginePage::isVisible() const
+{
+ Q_D(const QWebEnginePage);
+ return d->adapter->isVisible();
+}
+
+void QWebEnginePage::setVisible(bool visible)
+{
+ Q_D(QWebEnginePage);
+
+ if (!d->adapter->isInitialized()) {
+ // On the one hand, it is too early to initialize here. The application
+ // may call show() before load(), or it may call show() from
+ // createWindow(), and then we would create an unnecessary blank
+ // WebContents here. On the other hand, if the application calls show()
+ // then it expects something to be shown, so we have to initialize.
+ // Therefore we have to delay the initialization via the event loop.
+ if (visible)
+ d->wasShownTimer.start();
+ else
+ d->wasShownTimer.stop();
+ return;
+ }
+
+ d->adapter->setVisible(visible);
+}
+
+QDataStream &operator<<(QDataStream &stream, const QWebEngineHistory &history)
+{
+ auto adapter = history.d_func()->adapter();
+ if (!adapter->isInitialized())
+ adapter->loadDefault();
+ adapter->serializeNavigationHistory(stream);
+ return stream;
+}
+
+QDataStream &operator>>(QDataStream &stream, QWebEngineHistory &history)
+{
+ static_cast<QWebEnginePagePrivate *>(history.d_func()->client)->recreateFromSerializedHistory(stream);
+ return stream;
+}
+
+QT_END_NAMESPACE
+
+#include "moc_qwebenginepage.cpp"
diff --git a/src/core/api/qwebenginepage.h b/src/core/api/qwebenginepage.h
new file mode 100644
index 000000000..621dacdc8
--- /dev/null
+++ b/src/core/api/qwebenginepage.h
@@ -0,0 +1,400 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QWEBENGINEPAGE_H
+#define QWEBENGINEPAGE_H
+
+#include <QtWebEngineCore/qtwebenginecoreglobal.h>
+#include <QtWebEngineCore/qwebengineclientcertificateselection.h>
+#include <QtWebEngineCore/qwebenginedownloadrequest.h>
+#include <QtWebEngineCore/qwebenginequotarequest.h>
+
+#include <QtCore/qobject.h>
+#include <QtCore/qurl.h>
+#include <QtGui/qpagelayout.h>
+#include <QtGui/qpageranges.h>
+#include <QtGui/qtgui-config.h>
+
+#include <functional>
+
+QT_BEGIN_NAMESPACE
+
+class QAction;
+class QAuthenticator;
+class QContextMenuBuilder;
+class QRect;
+class QVariant;
+class QWebChannel;
+class QWebEngineCertificateError;
+class QWebEngineDesktopMediaRequest;
+class QWebEngineFileSystemAccessRequest;
+class QWebEngineFindTextResult;
+class QWebEngineFullScreenRequest;
+class QWebEngineHistory;
+class QWebEngineHttpRequest;
+class QWebEngineLoadingInfo;
+class QWebEngineNavigationRequest;
+class QWebEngineNewWindowRequest;
+class QWebEnginePagePrivate;
+class QWebEngineProfile;
+class QWebEngineRegisterProtocolHandlerRequest;
+class QWebEngineScriptCollection;
+class QWebEngineSettings;
+class QWebEngineUrlRequestInterceptor;
+class QWebEngineWebAuthUxRequest;
+
+class Q_WEBENGINECORE_EXPORT QWebEnginePage : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QString selectedText READ selectedText)
+ Q_PROPERTY(bool hasSelection READ hasSelection)
+ Q_PROPERTY(QUrl requestedUrl READ requestedUrl)
+ Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor)
+ Q_PROPERTY(QString title READ title)
+ Q_PROPERTY(QUrl url READ url WRITE setUrl NOTIFY urlChanged)
+ Q_PROPERTY(QUrl iconUrl READ iconUrl NOTIFY iconUrlChanged)
+ Q_PROPERTY(QIcon icon READ icon NOTIFY iconChanged)
+ Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor)
+ Q_PROPERTY(QSizeF contentsSize READ contentsSize NOTIFY contentsSizeChanged)
+ Q_PROPERTY(QPointF scrollPosition READ scrollPosition NOTIFY scrollPositionChanged)
+ Q_PROPERTY(bool audioMuted READ isAudioMuted WRITE setAudioMuted NOTIFY audioMutedChanged)
+ Q_PROPERTY(bool recentlyAudible READ recentlyAudible NOTIFY recentlyAudibleChanged)
+ Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged)
+ Q_PROPERTY(LifecycleState lifecycleState READ lifecycleState WRITE setLifecycleState NOTIFY lifecycleStateChanged)
+ Q_PROPERTY(LifecycleState recommendedState READ recommendedState NOTIFY recommendedStateChanged)
+ Q_PROPERTY(qint64 renderProcessPid READ renderProcessPid NOTIFY renderProcessPidChanged)
+ Q_PROPERTY(bool loading READ isLoading NOTIFY loadingChanged FINAL)
+
+public:
+ enum WebAction {
+ NoWebAction = - 1,
+ Back,
+ Forward,
+ Stop,
+ Reload,
+
+ Cut,
+ Copy,
+ Paste,
+
+ Undo,
+ Redo,
+ SelectAll,
+ ReloadAndBypassCache,
+
+ PasteAndMatchStyle,
+
+ OpenLinkInThisWindow,
+ OpenLinkInNewWindow,
+ OpenLinkInNewTab,
+ CopyLinkToClipboard,
+ DownloadLinkToDisk,
+
+ CopyImageToClipboard,
+ CopyImageUrlToClipboard,
+ DownloadImageToDisk,
+
+ CopyMediaUrlToClipboard,
+ ToggleMediaControls,
+ ToggleMediaLoop,
+ ToggleMediaPlayPause,
+ ToggleMediaMute,
+ DownloadMediaToDisk,
+
+ InspectElement,
+ ExitFullScreen,
+ RequestClose,
+ Unselect,
+ SavePage,
+ OpenLinkInNewBackgroundTab,
+ ViewSource,
+
+ ToggleBold,
+ ToggleItalic,
+ ToggleUnderline,
+ ToggleStrikethrough,
+
+ AlignLeft,
+ AlignCenter,
+ AlignRight,
+ AlignJustified,
+ Indent,
+ Outdent,
+
+ InsertOrderedList,
+ InsertUnorderedList,
+
+ ChangeTextDirectionLTR,
+ ChangeTextDirectionRTL,
+
+ WebActionCount
+ };
+ Q_ENUM(WebAction)
+
+ enum FindFlag {
+ FindBackward = 1,
+ FindCaseSensitively = 2,
+ };
+ Q_DECLARE_FLAGS(FindFlags, FindFlag)
+
+ enum WebWindowType {
+ WebBrowserWindow,
+ WebBrowserTab,
+ WebDialog,
+ WebBrowserBackgroundTab
+ };
+ Q_ENUM(WebWindowType)
+
+ enum PermissionPolicy {
+ PermissionUnknown,
+ PermissionGrantedByUser,
+ PermissionDeniedByUser
+ };
+ Q_ENUM(PermissionPolicy)
+
+ // must match WebContentsAdapterClient::NavigationType
+ enum NavigationType {
+ NavigationTypeLinkClicked,
+ NavigationTypeTyped,
+ NavigationTypeFormSubmitted,
+ NavigationTypeBackForward,
+ NavigationTypeReload,
+ NavigationTypeOther,
+ NavigationTypeRedirect,
+ };
+ Q_ENUM(NavigationType)
+
+ enum Feature {
+ Notifications = 0,
+ Geolocation = 1,
+ MediaAudioCapture = 2,
+ MediaVideoCapture,
+ MediaAudioVideoCapture,
+ MouseLock,
+ DesktopVideoCapture,
+ DesktopAudioVideoCapture,
+ ClipboardReadWrite,
+ LocalFontsAccess,
+ };
+ Q_ENUM(Feature)
+
+ // Ex-QWebFrame enum
+
+ enum FileSelectionMode {
+ FileSelectOpen,
+ FileSelectOpenMultiple,
+ FileSelectUploadFolder,
+ FileSelectSave
+ };
+ Q_ENUM(FileSelectionMode)
+
+ // must match WebContentsAdapterClient::JavaScriptConsoleMessageLevel
+ enum JavaScriptConsoleMessageLevel {
+ InfoMessageLevel = 0,
+ WarningMessageLevel,
+ ErrorMessageLevel
+ };
+ Q_ENUM(JavaScriptConsoleMessageLevel)
+
+ // must match WebContentsAdapterClient::RenderProcessTerminationStatus
+ enum RenderProcessTerminationStatus {
+ NormalTerminationStatus = 0,
+ AbnormalTerminationStatus,
+ CrashedTerminationStatus,
+ KilledTerminationStatus
+ };
+ Q_ENUM(RenderProcessTerminationStatus)
+
+ // must match WebContentsAdapterClient::LifecycleState
+ enum class LifecycleState {
+ Active,
+ Frozen,
+ Discarded,
+ };
+ Q_ENUM(LifecycleState)
+
+ explicit QWebEnginePage(QObject *parent = nullptr);
+ QWebEnginePage(QWebEngineProfile *profile, QObject *parent = nullptr);
+ ~QWebEnginePage();
+ QWebEngineHistory *history() const;
+
+ bool hasSelection() const;
+ QString selectedText() const;
+
+ QWebEngineProfile *profile() const;
+
+#if QT_CONFIG(action)
+ QAction *action(WebAction action) const;
+#endif
+ virtual void triggerAction(WebAction action, bool checked = false);
+
+ void replaceMisspelledWord(const QString &replacement);
+
+ bool event(QEvent*) override;
+
+ void findText(const QString &subString, FindFlags options = {}, const std::function<void(const QWebEngineFindTextResult &)> &resultCallback = std::function<void(const QWebEngineFindTextResult &)>());
+
+ void setFeaturePermission(const QUrl &securityOrigin, Feature feature, PermissionPolicy policy);
+
+ bool isLoading() const;
+
+ void load(const QUrl &url);
+ void load(const QWebEngineHttpRequest &request);
+ void download(const QUrl &url, const QString &filename = QString());
+ void setHtml(const QString &html, const QUrl &baseUrl = QUrl());
+ void setContent(const QByteArray &data, const QString &mimeType = QString(), const QUrl &baseUrl = QUrl());
+
+ void toHtml(const std::function<void(const QString &)> &resultCallback) const;
+ void toPlainText(const std::function<void(const QString &)> &resultCallback) const;
+
+ QString title() const;
+ void setUrl(const QUrl &url);
+ QUrl url() const;
+ QUrl requestedUrl() const;
+ QUrl iconUrl() const;
+ QIcon icon() const;
+
+ qreal zoomFactor() const;
+ void setZoomFactor(qreal factor);
+
+ QPointF scrollPosition() const;
+ QSizeF contentsSize() const;
+
+ void runJavaScript(const QString &scriptSource, const std::function<void(const QVariant &)> &resultCallback);
+ void runJavaScript(const QString &scriptSource, quint32 worldId = 0, const std::function<void(const QVariant &)> &resultCallback = {});
+ QWebEngineScriptCollection &scripts();
+ QWebEngineSettings *settings() const;
+
+ QWebChannel *webChannel() const;
+ void setWebChannel(QWebChannel *, quint32 worldId = 0);
+ QColor backgroundColor() const;
+ void setBackgroundColor(const QColor &color);
+
+ void save(const QString &filePath, QWebEngineDownloadRequest::SavePageFormat format
+ = QWebEngineDownloadRequest::MimeHtmlSaveFormat) const;
+
+ bool isAudioMuted() const;
+ void setAudioMuted(bool muted);
+ bool recentlyAudible() const;
+ qint64 renderProcessPid() const;
+
+ void printToPdf(const QString &filePath,
+ const QPageLayout &layout = QPageLayout(QPageSize(QPageSize::A4), QPageLayout::Portrait, QMarginsF()),
+ const QPageRanges &ranges = {});
+ void printToPdf(const std::function<void(const QByteArray&)> &resultCallback,
+ const QPageLayout &layout = QPageLayout(QPageSize(QPageSize::A4), QPageLayout::Portrait, QMarginsF()),
+ const QPageRanges &ranges = {});
+
+ void setInspectedPage(QWebEnginePage *page);
+ QWebEnginePage *inspectedPage() const;
+ void setDevToolsPage(QWebEnginePage *page);
+ QWebEnginePage *devToolsPage() const;
+ QString devToolsId() const;
+
+ void setUrlRequestInterceptor(QWebEngineUrlRequestInterceptor *interceptor);
+
+ LifecycleState lifecycleState() const;
+ void setLifecycleState(LifecycleState state);
+
+ LifecycleState recommendedState() const;
+
+ bool isVisible() const;
+ void setVisible(bool visible);
+
+ void acceptAsNewWindow(QWebEngineNewWindowRequest &request);
+
+Q_SIGNALS:
+ void loadStarted();
+ void loadProgress(int progress);
+ void loadFinished(bool ok);
+ void loadingChanged(const QWebEngineLoadingInfo &loadingInfo);
+
+ void linkHovered(const QString &url);
+ void selectionChanged();
+ void geometryChangeRequested(const QRect &geom);
+ void windowCloseRequested();
+
+ void featurePermissionRequested(const QUrl &securityOrigin, QWebEnginePage::Feature feature);
+ void featurePermissionRequestCanceled(const QUrl &securityOrigin, QWebEnginePage::Feature feature);
+ void fullScreenRequested(QWebEngineFullScreenRequest fullScreenRequest);
+#if QT_DEPRECATED_SINCE(6, 5)
+ QT_DEPRECATED_VERSION_X_6_5("Requesting host quota is no longer supported.")
+ void quotaRequested(QWebEngineQuotaRequest quotaRequest);
+#endif
+ void registerProtocolHandlerRequested(QWebEngineRegisterProtocolHandlerRequest request);
+ void fileSystemAccessRequested(QWebEngineFileSystemAccessRequest request);
+ void selectClientCertificate(QWebEngineClientCertificateSelection clientCertSelection);
+ void authenticationRequired(const QUrl &requestUrl, QAuthenticator *authenticator);
+ void proxyAuthenticationRequired(const QUrl &requestUrl, QAuthenticator *authenticator, const QString &proxyHost);
+
+ void renderProcessTerminated(RenderProcessTerminationStatus terminationStatus, int exitCode);
+ void desktopMediaRequested(const QWebEngineDesktopMediaRequest &request);
+ void certificateError(const QWebEngineCertificateError &certificateError);
+ void navigationRequested(QWebEngineNavigationRequest &request);
+ void newWindowRequested(QWebEngineNewWindowRequest &request);
+
+ // Ex-QWebFrame signals
+ void titleChanged(const QString &title);
+ void urlChanged(const QUrl &url);
+ void iconUrlChanged(const QUrl &url);
+ void iconChanged(const QIcon &icon);
+
+ void scrollPositionChanged(const QPointF &position);
+ void contentsSizeChanged(const QSizeF &size);
+ void audioMutedChanged(bool muted);
+ void recentlyAudibleChanged(bool recentlyAudible);
+ void renderProcessPidChanged(qint64 pid);
+
+ void pdfPrintingFinished(const QString &filePath, bool success);
+ void printRequested();
+
+ void visibleChanged(bool visible);
+
+ void lifecycleStateChanged(LifecycleState state);
+ void recommendedStateChanged(LifecycleState state);
+
+ void findTextFinished(const QWebEngineFindTextResult &result);
+
+ // TODO: fixme / rewrite bindPageToView
+ void _q_aboutToDelete();
+
+ void webAuthUxRequested(QWebEngineWebAuthUxRequest *request);
+
+protected:
+ virtual QWebEnginePage *createWindow(WebWindowType type);
+ virtual QStringList chooseFiles(FileSelectionMode mode, const QStringList &oldFiles,
+ const QStringList &acceptedMimeTypes);
+ virtual void javaScriptAlert(const QUrl &securityOrigin, const QString &msg);
+ virtual bool javaScriptConfirm(const QUrl &securityOrigin, const QString &msg);
+ virtual bool javaScriptPrompt(const QUrl &securityOrigin, const QString &msg,
+ const QString &defaultValue, QString *result);
+ virtual void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level,
+ const QString &message, int lineNumber,
+ const QString &sourceID);
+ virtual bool acceptNavigationRequest(const QUrl &url, NavigationType type, bool isMainFrame);
+
+private:
+ Q_DISABLE_COPY(QWebEnginePage)
+ Q_DECLARE_PRIVATE(QWebEnginePage)
+ QScopedPointer<QWebEnginePagePrivate> d_ptr;
+#if QT_CONFIG(action)
+ Q_PRIVATE_SLOT(d_func(), void _q_webActionTriggered(bool checked))
+#endif
+
+ friend class QContextMenuBuilder;
+ friend class QWebEngineView;
+ friend class QWebEngineViewPrivate;
+#if QT_CONFIG(accessibility)
+ friend class QWebEngineViewAccessible;
+#endif // QT_CONFIG(accessibility)
+};
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(QWebEnginePage::FindFlags)
+
+Q_WEBENGINECORE_EXPORT QDataStream &operator<<(QDataStream &stream,
+ const QWebEngineHistory &history);
+Q_WEBENGINECORE_EXPORT QDataStream &operator>>(QDataStream &stream, QWebEngineHistory &history);
+
+QT_END_NAMESPACE
+
+#endif // QWEBENGINEPAGE_H
diff --git a/src/core/api/qwebenginepage_p.h b/src/core/api/qwebenginepage_p.h
new file mode 100644
index 000000000..a51d8603b
--- /dev/null
+++ b/src/core/api/qwebenginepage_p.h
@@ -0,0 +1,225 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QWEBENGINEPAGE_P_H
+#define QWEBENGINEPAGE_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qwebenginepage.h"
+
+#include "qwebenginescriptcollection.h"
+#include "web_contents_adapter_client.h"
+
+#include <QtCore/qcompilerdetection.h>
+#include <QtCore/QPointer>
+#include <QtCore/QTimer>
+#include <QtGui/QColor>
+
+namespace QtWebEngineCore {
+class AutofillPopupController;
+class RenderWidgetHostViewQtDelegate;
+class RenderWidgetHostViewQtDelegateClient;
+class RenderWidgetHostViewQtDelegateItem;
+class TouchHandleDrawableDelegate;
+class TouchSelectionMenuController;
+class WebContentsAdapter;
+}
+
+QT_BEGIN_NAMESPACE
+class QPrinter;
+class QWebEngineFindTextResult;
+class QWebEngineHistory;
+class QWebEnginePage;
+class QWebEngineProfile;
+class QWebEngineSettings;
+
+class PageView
+{
+public:
+ virtual void contextMenuRequested(QWebEngineContextMenuRequest *request) = 0;
+ virtual QStringList chooseFiles(QWebEnginePage::FileSelectionMode mode,
+ const QStringList &oldFiles,
+ const QStringList &acceptedMimeTypes) = 0;
+ virtual void
+ showColorDialog(QSharedPointer<QtWebEngineCore::ColorChooserController> controller) = 0;
+ virtual bool showAuthorizationDialog(const QString &title, const QString &message) = 0;
+ virtual void javaScriptAlert(const QUrl &url, const QString &msg) = 0;
+ virtual bool javaScriptConfirm(const QUrl &url, const QString &msg) = 0;
+ virtual bool javaScriptPrompt(const QUrl &url, const QString &msg, const QString &defaultValue,
+ QString *result) = 0;
+ virtual void setToolTip(const QString &toolTipText) = 0;
+ virtual QtWebEngineCore::RenderWidgetHostViewQtDelegate *CreateRenderWidgetHostViewQtDelegate(
+ QtWebEngineCore::RenderWidgetHostViewQtDelegateClient *client) = 0;
+ virtual QtWebEngineCore::RenderWidgetHostViewQtDelegate *CreateRenderWidgetHostViewQtDelegateForPopup(
+ QtWebEngineCore::RenderWidgetHostViewQtDelegateClient *client) = 0;
+ virtual QWebEngineContextMenuRequest *lastContextMenuRequest() const = 0;
+ virtual QWebEnginePage *createPageForWindow(QWebEnginePage::WebWindowType type) = 0;
+ virtual bool isEnabled() const = 0;
+ virtual bool isVisible() const = 0;
+ virtual QRect viewportRect() const = 0;
+ virtual void focusContainer() = 0;
+ virtual void unhandledKeyEvent(QKeyEvent *event) = 0;
+ virtual bool passOnFocus(bool reverse) = 0;
+ virtual QObject *accessibilityParentObject() = 0;
+ virtual void didPrintPage(QPrinter *&printer, QSharedPointer<QByteArray> result) = 0;
+ virtual void didPrintPageToPdf(const QString &filePath, bool success) = 0;
+ virtual void printRequested() = 0;
+ virtual void showAutofillPopup(QtWebEngineCore::AutofillPopupController *controller,
+ const QRect &bounds, bool autoselectFirstSuggestion) = 0;
+ virtual void hideAutofillPopup() = 0;
+ virtual QtWebEngineCore::TouchHandleDrawableDelegate *
+ createTouchHandleDelegate(const QMap<int, QImage> &) = 0;
+ virtual void showTouchSelectionMenu(QtWebEngineCore::TouchSelectionMenuController *,
+ const QRect &) = 0;
+ virtual void hideTouchSelectionMenu() = 0;
+};
+
+class Q_WEBENGINECORE_EXPORT QWebEnginePagePrivate : public QtWebEngineCore::WebContentsAdapterClient
+{
+public:
+ Q_DECLARE_PUBLIC(QWebEnginePage)
+ QWebEnginePage *q_ptr;
+
+ QWebEnginePagePrivate(QWebEngineProfile *profile = nullptr);
+ ~QWebEnginePagePrivate();
+
+ QtWebEngineCore::RenderWidgetHostViewQtDelegate* CreateRenderWidgetHostViewQtDelegate(QtWebEngineCore::RenderWidgetHostViewQtDelegateClient *client) override;
+ QtWebEngineCore::RenderWidgetHostViewQtDelegate* CreateRenderWidgetHostViewQtDelegateForPopup(QtWebEngineCore::RenderWidgetHostViewQtDelegateClient *client) override;
+ void initializationFinished() override;
+ void lifecycleStateChanged(LifecycleState state) override;
+ void recommendedStateChanged(LifecycleState state) override;
+ void visibleChanged(bool visible) override;
+ void titleChanged(const QString &) override;
+ void urlChanged() override;
+ void iconChanged(const QUrl &) override;
+ void loadProgressChanged(int progress) override;
+ void didUpdateTargetURL(const QUrl &) override;
+ void selectionChanged() override;
+ void zoomUpdateIsNeeded() override;
+ void recentlyAudibleChanged(bool recentlyAudible) override;
+ void renderProcessPidChanged(qint64 pid) override;
+ QRectF viewportRect() const override;
+ QColor backgroundColor() const override;
+ void loadStarted(QWebEngineLoadingInfo info) override;
+ void loadCommitted() override { }
+ void loadFinished(QWebEngineLoadingInfo info) override;
+ void focusContainer() override;
+ void unhandledKeyEvent(QKeyEvent *event) override;
+ QSharedPointer<QtWebEngineCore::WebContentsAdapter>
+ adoptNewWindow(QSharedPointer<QtWebEngineCore::WebContentsAdapter> newWebContents,
+ WindowOpenDisposition disposition, bool userGesture,
+ const QRect &initialGeometry, const QUrl &targetUrl) override;
+ bool isBeingAdopted() override;
+ void close() override;
+ void windowCloseRejected() override;
+ void desktopMediaRequested(QtWebEngineCore::DesktopMediaController *) override;
+ void contextMenuRequested(QWebEngineContextMenuRequest *request) override;
+ void navigationRequested(int navigationType, const QUrl &url, bool &accepted, bool isMainFrame) override;
+ void requestFullScreenMode(const QUrl &origin, bool fullscreen) override;
+ bool isFullScreenMode() const override;
+ void javascriptDialog(QSharedPointer<QtWebEngineCore::JavaScriptDialogController>) override;
+ void runFileChooser(QSharedPointer<QtWebEngineCore::FilePickerController>) override;
+ void showColorDialog(QSharedPointer<QtWebEngineCore::ColorChooserController>) override;
+ void didRunJavaScript(quint64 requestId, const QVariant &result) override;
+ void didFetchDocumentMarkup(quint64 requestId, const QString &result) override;
+ void didFetchDocumentInnerText(quint64 requestId, const QString &result) override;
+ void didPrintPage(quint64 requestId, QSharedPointer<QByteArray> result) override;
+ void didPrintPageToPdf(const QString &filePath, bool success) override;
+ bool passOnFocus(bool reverse) override;
+ void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString &message,
+ int lineNumber, const QString &sourceID) override;
+ void authenticationRequired(
+ QSharedPointer<QtWebEngineCore::AuthenticationDialogController>) override;
+ void releaseProfile() override;
+ void runMediaAccessPermissionRequest(const QUrl &securityOrigin, MediaRequestFlags requestFlags) override;
+ void runFeaturePermissionRequest(QtWebEngineCore::ProfileAdapter::PermissionType permission, const QUrl &securityOrigin) override;
+ void runMouseLockPermissionRequest(const QUrl &securityOrigin) override;
+ void runRegisterProtocolHandlerRequest(QWebEngineRegisterProtocolHandlerRequest) override;
+ void runFileSystemAccessRequest(QWebEngineFileSystemAccessRequest) override;
+ QObject *accessibilityParentObject() override;
+ QWebEngineSettings *webEngineSettings() const override;
+ void allowCertificateError(const QWebEngineCertificateError &error) override;
+ void selectClientCert(
+ const QSharedPointer<QtWebEngineCore::ClientCertSelectController> &controller) override;
+ void renderProcessTerminated(RenderProcessTerminationStatus terminationStatus, int exitCode) override;
+ void requestGeometryChange(const QRect &geometry, const QRect &frameGeometry) override;
+ void updateScrollPosition(const QPointF &position) override;
+ void updateContentsSize(const QSizeF &size) override;
+ void updateNavigationActions() override;
+ void updateEditActions() override;
+ QObject *dragSource() const override;
+ bool isEnabled() const override;
+ void setToolTip(const QString &toolTipText) override;
+ void printRequested() override;
+ QtWebEngineCore::TouchHandleDrawableDelegate *
+ createTouchHandleDelegate(const QMap<int, QImage> &) override;
+ void showTouchSelectionMenu(QtWebEngineCore::TouchSelectionMenuController *, const QRect &,
+ const QSize &) override;
+ void hideTouchSelectionMenu() override;
+ const QObject *holdingQObject() const override;
+ ClientType clientType() override { return QtWebEngineCore::WebContentsAdapterClient::WidgetsClient; }
+ void findTextFinished(const QWebEngineFindTextResult &result) override;
+ void showAutofillPopup(QtWebEngineCore::AutofillPopupController *controller,
+ const QRect &bounds, bool autoselectFirstSuggestion) override;
+ void hideAutofillPopup() override;
+ void showWebAuthDialog(QWebEngineWebAuthUxRequest *controller) override;
+
+ QtWebEngineCore::ProfileAdapter *profileAdapter() override;
+ QtWebEngineCore::WebContentsAdapter *webContentsAdapter() override;
+
+ void updateAction(QWebEnginePage::WebAction) const;
+ void _q_webActionTriggered(bool checked);
+
+ void createNewWindow(WindowOpenDisposition disposition, bool userGesture, const QUrl &targetUrl);
+ bool adoptWebContents(QtWebEngineCore::WebContentsAdapter *webContents);
+ QtWebEngineCore::WebContentsAdapter *webContents() { return adapter.data(); }
+ void recreateFromSerializedHistory(QDataStream &input);
+
+ void setFullScreenMode(bool);
+ void ensureInitialized() const;
+
+ static QString actionText(int action);
+
+ QSharedPointer<QtWebEngineCore::WebContentsAdapter> adapter;
+ QWebEngineHistory *history;
+ QWebEngineProfile *profile;
+ QWebEngineSettings *settings;
+ PageView *view;
+ QUrl url;
+ bool isLoading;
+ QWebEngineScriptCollection scriptCollection;
+ bool m_isBeingAdopted;
+ QColor m_backgroundColor;
+ bool fullscreenMode;
+ QWebChannel *webChannel;
+ unsigned int webChannelWorldId;
+ QUrl iconUrl;
+ QPointer<QWebEnginePage> inspectedPage;
+ QPointer<QWebEnginePage> devToolsPage;
+ bool defaultAudioMuted;
+ qreal defaultZoomFactor;
+ QTimer wasShownTimer;
+ QtWebEngineCore::RenderWidgetHostViewQtDelegateItem *delegateItem = nullptr;
+#if QT_CONFIG(webengine_printing_and_pdf)
+ QPrinter *currentPrinter = nullptr;
+#endif
+
+ mutable QMap<quint64, std::function<void(const QVariant &)>> m_variantCallbacks;
+ mutable QMap<quint64, std::function<void(const QString &)>> m_stringCallbacks;
+ QMap<quint64, std::function<void(const QByteArray &)>> m_pdfResultCallbacks;
+ mutable QAction *actions[QWebEnginePage::WebActionCount];
+};
+
+QT_END_NAMESPACE
+
+#endif // QWEBENGINEPAGE_P_H
diff --git a/src/core/api/qwebengineprofile.cpp b/src/core/api/qwebengineprofile.cpp
new file mode 100644
index 000000000..dbb98102c
--- /dev/null
+++ b/src/core/api/qwebengineprofile.cpp
@@ -0,0 +1,947 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qwebengineprofile.h"
+#include "qwebengineprofile_p.h"
+#include "qwebengineclienthints.h"
+#include "qwebenginecookiestore.h"
+#include "qwebenginedownloadrequest.h"
+#include "qwebenginedownloadrequest_p.h"
+#include "qwebenginenotification.h"
+#include "qwebenginesettings.h"
+#include "qwebenginescriptcollection.h"
+#include "qwebenginescriptcollection_p.h"
+#include "qtwebenginecoreglobal.h"
+#include "profile_adapter.h"
+#include "visited_links_manager_qt.h"
+#include "web_engine_settings.h"
+
+#include <QDir>
+#include <QtWebEngineCore/qwebengineurlscheme.h>
+
+QT_BEGIN_NAMESPACE
+
+ASSERT_ENUMS_MATCH(QWebEngineDownloadRequest::UnknownSaveFormat, QtWebEngineCore::ProfileAdapterClient::UnknownSavePageFormat)
+ASSERT_ENUMS_MATCH(QWebEngineDownloadRequest::SingleHtmlSaveFormat, QtWebEngineCore::ProfileAdapterClient::SingleHtmlSaveFormat)
+ASSERT_ENUMS_MATCH(QWebEngineDownloadRequest::CompleteHtmlSaveFormat, QtWebEngineCore::ProfileAdapterClient::CompleteHtmlSaveFormat)
+ASSERT_ENUMS_MATCH(QWebEngineDownloadRequest::MimeHtmlSaveFormat, QtWebEngineCore::ProfileAdapterClient::MimeHtmlSaveFormat)
+
+using QtWebEngineCore::ProfileAdapter;
+
+/*!
+ \class QWebEngineProfile
+ \brief The QWebEngineProfile class provides a web engine profile shared by multiple pages.
+ \since 5.5
+
+ \inmodule QtWebEngineCore
+
+ A web engine profile contains settings, scripts, persistent cookie policy, and the list of
+ visited links shared by all web engine pages that belong to the profile.
+
+ All pages that belong to the profile share a common QWebEngineSettings instance, which can
+ be accessed with the settings() method. Likewise, the scripts() method provides access
+ to a common QWebEngineScriptCollection instance.
+
+ Information about visited links is stored together with persistent cookies and other persistent
+ data in a storage returned by storageName(). Persistent data is stored in a subdirectory set by
+ calling setPersistentStoragePath(), and the cache is located in a subdirectory set by calling
+ setCachePath(). The cache type can be set to \e in-memory or \e on-disk by calling
+ setHttpCacheType(). If only the storage name is set, the subdirectories are created and named
+ automatically. If you set any of the values manually, you should do it before creating any
+ pages that belong to the profile.
+
+ The cache can be cleared of links by calling
+ clearVisitedLinks() or clearAllVisitedLinks(). PersistentCookiesPolicy describes whether
+ session and persistent cookies are saved to and restored from memory or disk.
+
+ Profiles can be used to isolate pages from each other. A typical use case is a dedicated
+ \e {off-the-record profile} for a \e {private browsing} mode. Using QWebEngineProfile() without
+ defining a storage name constructs a new off-the-record profile that leaves no record on the
+ local machine, and has no persistent data or cache. The isOffTheRecord() method can be used
+ to check whether a profile is off-the-record.
+
+ The default profile can be accessed by defaultProfile(). It is a built-in profile that all
+ web pages not specifically created with another profile belong to.
+
+ Implementing the QWebEngineUrlRequestInterceptor interface and registering the interceptor on a
+ profile by setUrlRequestInterceptor() enables intercepting, blocking, and modifying URL
+ requests (QWebEngineUrlRequestInfo) before they reach the networking stack of Chromium.
+
+ A QWebEngineUrlSchemeHandler can be registered for a profile by installUrlSchemeHandler()
+ to add support for custom URL schemes. Requests for the scheme are then issued to
+ QWebEngineUrlSchemeHandler::requestStarted() as QWebEngineUrlRequestJob objects.
+
+ Spellchecking HTML form fields can be enabled per profile by using the setSpellCheckEnabled()
+ method and the current languages used for spellchecking can be set by using the
+ setSpellCheckLanguages() method.
+
+*/
+
+/*!
+ \enum QWebEngineProfile::HttpCacheType
+
+ This enum describes the HTTP cache type:
+
+ \value MemoryHttpCache Use an in-memory cache. This is the default if
+ \c off-the-record is set.
+ \value DiskHttpCache Use a disk cache. This is the default if the profile
+ is not \c off-the-record. If set on an \c off-the-record profile will instead
+ set \c MemoryHttpCache.
+ \value NoCache Disable both in-memory and disk caching. (Added in Qt 5.7)
+*/
+
+/*!
+ \enum QWebEngineProfile::PersistentCookiesPolicy
+
+ This enum describes policy for cookie persistency:
+
+ \value NoPersistentCookies
+ Both session and persistent cookies are stored in memory. This is the only setting
+ possible if \c off-the-record is set or no persistent data path is available.
+ \value AllowPersistentCookies
+ Cookies marked persistent are saved to and restored from disk, whereas session cookies
+ are only stored to disk for crash recovery. This is the default setting.
+ \value ForcePersistentCookies
+ Both session and persistent cookies are saved to and restored from disk.
+*/
+
+void QWebEngineProfilePrivate::showNotification(QSharedPointer<QtWebEngineCore::UserNotificationController> &controller)
+{
+ if (m_notificationPresenter) {
+ std::unique_ptr<QWebEngineNotification> notification(new QWebEngineNotification(controller));
+ m_notificationPresenter(std::move(notification));
+ }
+}
+
+/*!
+ \fn QWebEngineProfile::downloadRequested(QWebEngineDownloadRequest *download)
+
+ \since 5.5
+
+ This signal is emitted whenever a download has been triggered.
+ The \a download argument holds the state of the download.
+ The download has to be explicitly accepted with QWebEngineDownloadRequest::accept() or it will be
+ cancelled by default.
+ The download item is parented by the profile. If it is not accepted, it
+ will be deleted immediately after the signal emission.
+ This signal cannot be used with a queued connection.
+
+ \sa QWebEngineDownloadRequest, QWebEnginePage::download()
+*/
+
+/*!
+ \fn QWebEngineProfile::clearHttpCacheCompleted()
+
+ \since 6.7
+
+ This signal is emitted when the clearHttpCache() operation is completed.
+
+ \sa QWebEngineProfile::clearHttpCache()
+*/
+
+QWebEngineProfilePrivate::QWebEngineProfilePrivate(ProfileAdapter* profileAdapter)
+ : m_settings(new QWebEngineSettings())
+ , m_profileAdapter(profileAdapter)
+ , m_scriptCollection(new QWebEngineScriptCollection(
+ new QWebEngineScriptCollectionPrivate(profileAdapter->userResourceController())))
+ , m_clientHints(new QWebEngineClientHints(profileAdapter))
+{
+ m_profileAdapter->addClient(this);
+}
+
+QWebEngineProfilePrivate::~QWebEngineProfilePrivate()
+{
+ if (m_profileAdapter) {
+ // In the case the user sets this profile as the parent of the interceptor
+ // it can be deleted before the browser-context still referencing it is.
+ m_profileAdapter->setRequestInterceptor(nullptr);
+ m_profileAdapter->removeClient(this);
+ }
+
+ if (m_profileAdapter != QtWebEngineCore::ProfileAdapter::defaultProfileAdapter())
+ delete m_profileAdapter;
+ else if (m_profileAdapter)
+ m_profileAdapter->releaseAllWebContentsAdapterClients();
+
+ delete m_settings;
+}
+
+ProfileAdapter* QWebEngineProfilePrivate::profileAdapter() const
+{
+ return m_profileAdapter;
+}
+
+void QWebEngineProfilePrivate::downloadDestroyed(quint32 downloadId)
+{
+ m_ongoingDownloads.remove(downloadId);
+ if (m_profileAdapter)
+ m_profileAdapter->removeDownload(downloadId);
+}
+
+void QWebEngineProfilePrivate::cleanDownloads()
+{
+ for (auto download : m_ongoingDownloads.values()) {
+ if (!download)
+ continue;
+
+ if (!download->isFinished())
+ download->cancel();
+
+ if (m_profileAdapter)
+ m_profileAdapter->removeDownload(download->id());
+ }
+ m_ongoingDownloads.clear();
+}
+
+void QWebEngineProfilePrivate::downloadRequested(DownloadItemInfo &info)
+{
+ Q_Q(QWebEngineProfile);
+
+ Q_ASSERT(!m_ongoingDownloads.contains(info.id));
+ QWebEngineDownloadRequestPrivate *itemPrivate =
+ new QWebEngineDownloadRequestPrivate(m_profileAdapter);
+ itemPrivate->downloadId = info.id;
+ itemPrivate->downloadState = info.accepted ? QWebEngineDownloadRequest::DownloadInProgress
+ : QWebEngineDownloadRequest::DownloadRequested;
+ itemPrivate->startTime = info.startTime;
+ itemPrivate->downloadUrl = info.url;
+ itemPrivate->totalBytes = info.totalBytes;
+ itemPrivate->downloadDirectory = QFileInfo(info.path).path();
+ itemPrivate->downloadFileName = QFileInfo(info.path).fileName();
+ itemPrivate->suggestedFileName = info.suggestedFileName;
+ itemPrivate->mimeType = info.mimeType;
+ itemPrivate->savePageFormat = static_cast<QWebEngineDownloadRequest::SavePageFormat>(info.savePageFormat);
+ itemPrivate->isSavePageDownload = info.isSavePageDownload;
+ if (info.page && info.page->clientType() == QtWebEngineCore::WebContentsAdapterClient::WidgetsClient)
+ itemPrivate->adapterClient = info.page;
+ else
+ itemPrivate->adapterClient = nullptr;
+
+ QWebEngineDownloadRequest *download = new QWebEngineDownloadRequest(itemPrivate, q);
+
+ m_ongoingDownloads.insert(info.id, download);
+ QObject::connect(download, &QWebEngineDownloadRequest::destroyed, q, [id = info.id, this] () { downloadDestroyed(id); });
+
+ Q_EMIT q->downloadRequested(download);
+
+ QWebEngineDownloadRequest::DownloadState state = download->state();
+
+ info.path = QDir(download->downloadDirectory()).filePath(download->downloadFileName());
+ info.savePageFormat = static_cast<QtWebEngineCore::ProfileAdapterClient::SavePageFormat>(
+ download->savePageFormat());
+ info.accepted = state != QWebEngineDownloadRequest::DownloadCancelled;
+
+ if (state == QWebEngineDownloadRequest::DownloadRequested) {
+ // Delete unaccepted downloads.
+ info.accepted = false;
+ delete download;
+ }
+}
+
+void QWebEngineProfilePrivate::downloadUpdated(const DownloadItemInfo &info)
+{
+ if (!m_ongoingDownloads.contains(info.id))
+ return;
+
+ QWebEngineDownloadRequest* download = m_ongoingDownloads.value(info.id).data();
+
+ if (!download) {
+ downloadDestroyed(info.id);
+ return;
+ }
+
+ download->d_func()->update(info);
+}
+
+void QWebEngineProfilePrivate::clearHttpCacheCompleted()
+{
+ Q_Q(QWebEngineProfile);
+ Q_EMIT q->clearHttpCacheCompleted();
+}
+
+void QWebEngineProfilePrivate::addWebContentsAdapterClient(QtWebEngineCore::WebContentsAdapterClient *adapter)
+{
+ Q_ASSERT(m_profileAdapter);
+ m_profileAdapter->addWebContentsAdapterClient(adapter);
+}
+
+void QWebEngineProfilePrivate::removeWebContentsAdapterClient(QtWebEngineCore::WebContentsAdapterClient *adapter)
+{
+ Q_ASSERT(m_profileAdapter);
+ m_profileAdapter->removeWebContentsAdapterClient(adapter);
+}
+
+QtWebEngineCore::WebEngineSettings *QWebEngineProfilePrivate::coreSettings() const
+{
+ return QtWebEngineCore::WebEngineSettings::get(settings());
+}
+
+/*!
+ Constructs a new off-the-record profile with the parent \a parent.
+
+ An off-the-record profile leaves no record on the local machine, and has no persistent data or cache.
+ Thus, the HTTP cache can only be in memory and the cookies can only be non-persistent. Trying to change
+ these settings will have no effect.
+
+ \sa isOffTheRecord()
+*/
+QWebEngineProfile::QWebEngineProfile(QObject *parent)
+ : QObject(parent)
+ , d_ptr(new QWebEngineProfilePrivate(new QtWebEngineCore::ProfileAdapter()))
+{
+ d_ptr->q_ptr = this;
+}
+
+/*!
+ Constructs a new profile with the storage name \a storageName and parent \a parent.
+
+ The storage name must be unique.
+
+ A disk-based QWebEngineProfile should be destroyed on or before application exit, otherwise the cache
+ and persistent data may not be fully flushed to disk.
+
+ \sa storageName()
+*/
+QWebEngineProfile::QWebEngineProfile(const QString &storageName, QObject *parent)
+ : QObject(parent)
+ , d_ptr(new QWebEngineProfilePrivate(new QtWebEngineCore::ProfileAdapter(storageName)))
+{
+ d_ptr->q_ptr = this;
+}
+
+/*! \internal
+*/
+QWebEngineProfile::QWebEngineProfile(QWebEngineProfilePrivate *privatePtr, QObject *parent)
+ : QObject(parent)
+ , d_ptr(privatePtr)
+{
+ d_ptr->q_ptr = this;
+}
+
+/*! \internal
+*/
+QWebEngineProfile::~QWebEngineProfile()
+{
+ d_ptr->cleanDownloads();
+}
+
+/*!
+ Returns the storage name for the profile.
+
+ The storage name is used to give each profile that uses the disk separate subdirectories for persistent data and cache.
+*/
+QString QWebEngineProfile::storageName() const
+{
+ const Q_D(QWebEngineProfile);
+ return d->profileAdapter()->storageName();
+}
+
+/*!
+ Returns \c true if this is an off-the-record profile that leaves no record on the computer.
+
+ This will force cookies and HTTP cache to be in memory, but also force all other normally
+ persistent data to be stored in memory.
+*/
+bool QWebEngineProfile::isOffTheRecord() const
+{
+ const Q_D(QWebEngineProfile);
+ return d->profileAdapter()->isOffTheRecord();
+}
+
+/*!
+ Returns the path used to store persistent data for the browser and web content.
+
+ Persistent data includes persistent cookies, HTML5 local storage, and visited links.
+
+ By default, this is below QStandardPaths::DataLocation in a QtWebengine/StorageName specific
+ subdirectory.
+
+ \note Use QStandardPaths::writableLocation(QStandardPaths::DataLocation)
+ to obtain the QStandardPaths::DataLocation path.
+
+ \sa setPersistentStoragePath(), storageName(), QStandardPaths::writableLocation()
+*/
+QString QWebEngineProfile::persistentStoragePath() const
+{
+ const Q_D(QWebEngineProfile);
+ return d->profileAdapter()->dataPath();
+}
+
+/*!
+ Overrides the default path used to store persistent web engine data.
+
+ If \a path is set to the null string, the default path is restored.
+
+ \sa persistentStoragePath()
+*/
+void QWebEngineProfile::setPersistentStoragePath(const QString &path)
+{
+ const Q_D(QWebEngineProfile);
+ d->profileAdapter()->setDataPath(path);
+}
+
+/*!
+ \since 5.13
+
+ The path to the location where the downloaded files are stored.
+
+ \note By default, the download path is QStandardPaths::DownloadLocation.
+
+ \sa setDownloadPath(), QStandardPaths::writableLocation()
+*/
+QString QWebEngineProfile::downloadPath() const
+{
+ const Q_D(QWebEngineProfile);
+ return d->profileAdapter()->downloadPath();
+}
+
+/*!
+ \since 5.13
+
+ Overrides the default path used for download location, setting it to \a path.
+
+ If set to the null string, the default path is restored.
+
+ \sa downloadPath()
+*/
+void QWebEngineProfile::setDownloadPath(const QString &path)
+{
+ Q_D(QWebEngineProfile);
+ d->profileAdapter()->setDownloadPath(path);
+}
+
+/*!
+ \since 6.5
+
+ Returns \c true if the push messaging service is enabled.
+ \note By default the push messaging service is disabled.
+
+ \sa setPushServiceEnabled()
+*/
+bool QWebEngineProfile::isPushServiceEnabled() const
+{
+ const Q_D(QWebEngineProfile);
+ return d->profileAdapter()->pushServiceEnabled();
+}
+
+/*!
+ \since 6.5
+
+ Enables the push messaging service if \a enable is \c true, otherwise disables it.
+
+ \note \QWE uses \l {https://firebase.google.com}{Firebase Cloud Messaging (FCM)}
+ as a browser push service. Therefore, all push messages will go through the
+ Google push service and its respective servers.
+
+ \sa isPushServiceEnabled()
+*/
+void QWebEngineProfile::setPushServiceEnabled(bool enable)
+{
+ Q_D(QWebEngineProfile);
+ d->profileAdapter()->setPushServiceEnabled(enable);
+}
+
+/*!
+ Returns the path used for caches.
+
+ By default, this is below StandardPaths::CacheLocation in a QtWebengine/StorageName specific
+ subdirectory.
+
+ \note Use QStandardPaths::writableLocation(QStandardPaths::CacheLocation)
+ to obtain the QStandardPaths::CacheLocation path.
+
+ \sa setCachePath(), storageName(), QStandardPaths::writableLocation()
+*/
+QString QWebEngineProfile::cachePath() const
+{
+ const Q_D(QWebEngineProfile);
+ return d->profileAdapter()->cachePath();
+}
+
+/*!
+ Overrides the default path used for disk caches, setting it to \a path.
+
+ If set to the null string, the default path is restored.
+
+ \sa cachePath()
+*/
+void QWebEngineProfile::setCachePath(const QString &path)
+{
+ Q_D(QWebEngineProfile);
+ d->profileAdapter()->setCachePath(path);
+}
+
+/*!
+ Returns the user-agent string sent with HTTP to identify the browser.
+
+ \note On Windows 8.1 and newer, the default user agent will always report
+ "Windows NT 6.2" (Windows 8), unless the application does contain a manifest
+ that declares newer Windows versions as supported.
+
+ \sa setHttpUserAgent(), {windows_manifest} {Windows Application Manifest}
+*/
+QString QWebEngineProfile::httpUserAgent() const
+{
+ const Q_D(QWebEngineProfile);
+ return d->profileAdapter()->httpUserAgent();
+}
+
+/*!
+ Overrides the default user-agent string, setting it to \a userAgent.
+
+ \sa httpUserAgent()
+*/
+void QWebEngineProfile::setHttpUserAgent(const QString &userAgent)
+{
+ Q_D(QWebEngineProfile);
+ d->profileAdapter()->setHttpUserAgent(userAgent);
+}
+
+/*!
+ Returns the type of HTTP cache used.
+
+ If the profile is off-the-record, MemoryHttpCache is returned.
+
+ \sa setHttpCacheType(), cachePath()
+*/
+QWebEngineProfile::HttpCacheType QWebEngineProfile::httpCacheType() const
+{
+ const Q_D(QWebEngineProfile);
+ return QWebEngineProfile::HttpCacheType(d->profileAdapter()->httpCacheType());
+}
+
+/*!
+ Sets the HTTP cache type to \a httpCacheType.
+
+ \note Setting the \a httpCacheType to NoCache on the profile, which has already some cache
+ entries does not trigger the removal of those entries.
+
+ \sa httpCacheType(), setCachePath(), clearHttpCache()
+*/
+void QWebEngineProfile::setHttpCacheType(QWebEngineProfile::HttpCacheType httpCacheType)
+{
+ Q_D(QWebEngineProfile);
+ d->profileAdapter()->setHttpCacheType(ProfileAdapter::HttpCacheType(httpCacheType));
+}
+
+/*!
+ Sets the value of the Accept-Language HTTP request-header field to \a httpAcceptLanguage.
+
+ \since 5.6
+ */
+void QWebEngineProfile::setHttpAcceptLanguage(const QString &httpAcceptLanguage)
+{
+ Q_D(QWebEngineProfile);
+ d->profileAdapter()->setHttpAcceptLanguage(httpAcceptLanguage);
+}
+
+/*!
+ Returns the value of the Accept-Language HTTP request-header field.
+
+ \since 5.6
+ */
+QString QWebEngineProfile::httpAcceptLanguage() const
+{
+ Q_D(const QWebEngineProfile);
+ return d->profileAdapter()->httpAcceptLanguage();
+}
+
+/*!
+ Returns the current policy for persistent cookies.
+
+ If the profile is off-the-record, NoPersistentCookies is returned.
+
+ \sa setPersistentCookiesPolicy()
+*/
+QWebEngineProfile::PersistentCookiesPolicy QWebEngineProfile::persistentCookiesPolicy() const
+{
+ const Q_D(QWebEngineProfile);
+ return QWebEngineProfile::PersistentCookiesPolicy(d->profileAdapter()->persistentCookiesPolicy());
+}
+
+/*!
+ Sets the policy for persistent cookies to \a newPersistentCookiesPolicy.
+
+ \sa persistentCookiesPolicy()
+*/
+void QWebEngineProfile::setPersistentCookiesPolicy(QWebEngineProfile::PersistentCookiesPolicy newPersistentCookiesPolicy)
+{
+ Q_D(QWebEngineProfile);
+ d->profileAdapter()->setPersistentCookiesPolicy(ProfileAdapter::PersistentCookiesPolicy(newPersistentCookiesPolicy));
+}
+
+/*!
+ Returns the maximum size of the HTTP cache in bytes.
+
+ Will return \c 0 if the size is automatically controlled by QtWebEngine.
+
+ \sa setHttpCacheMaximumSize(), httpCacheType()
+*/
+int QWebEngineProfile::httpCacheMaximumSize() const
+{
+ const Q_D(QWebEngineProfile);
+ return d->profileAdapter()->httpCacheMaxSize();
+}
+
+/*!
+ Sets the maximum size of the HTTP cache to \a maxSize bytes.
+
+ Setting it to \c 0 means the size will be controlled automatically by QtWebEngine.
+
+ \sa httpCacheMaximumSize(), setHttpCacheType()
+*/
+void QWebEngineProfile::setHttpCacheMaximumSize(int maxSize)
+{
+ Q_D(QWebEngineProfile);
+ d->profileAdapter()->setHttpCacheMaxSize(maxSize);
+}
+
+/*!
+ Returns the cookie store for this profile.
+
+ \since 5.6
+*/
+
+QWebEngineCookieStore* QWebEngineProfile::cookieStore()
+{
+ Q_D(QWebEngineProfile);
+ return d->profileAdapter()->cookieStore();
+}
+
+/*!
+ Registers a request interceptor singleton \a interceptor to intercept URL requests.
+
+ The profile does not take ownership of the pointer.
+
+ \since 5.13
+ \sa QWebEngineUrlRequestInfo QWebEngineUrlRequestInterceptor
+*/
+
+void QWebEngineProfile::setUrlRequestInterceptor(QWebEngineUrlRequestInterceptor *interceptor)
+{
+ Q_D(QWebEngineProfile);
+ d->profileAdapter()->setRequestInterceptor(interceptor);
+}
+
+/*!
+ Clears all links from the visited links database.
+
+ \sa clearVisitedLinks()
+*/
+void QWebEngineProfile::clearAllVisitedLinks()
+{
+ Q_D(QWebEngineProfile);
+ d->profileAdapter()->visitedLinksManager()->deleteAllVisitedLinkData();
+}
+
+/*!
+ Clears the links in \a urls from the visited links database.
+
+ \sa clearAllVisitedLinks()
+*/
+void QWebEngineProfile::clearVisitedLinks(const QList<QUrl> &urls)
+{
+ Q_D(QWebEngineProfile);
+ d->profileAdapter()->visitedLinksManager()->deleteVisitedLinkDataForUrls(urls);
+}
+
+/*!
+ Returns \c true if \a url is considered a visited link by this profile.
+*/
+bool QWebEngineProfile::visitedLinksContainsUrl(const QUrl &url) const
+{
+ Q_D(const QWebEngineProfile);
+ return d->profileAdapter()->visitedLinksManager()->containsUrl(url);
+}
+
+/*!
+ Returns the collection of scripts that are injected into all pages that share
+ this profile.
+
+ \sa QWebEngineScriptCollection, QWebEngineScript, QWebEnginePage::scripts(),
+ {Script Injection}
+*/
+QWebEngineScriptCollection *QWebEngineProfile::scripts() const
+{
+ Q_D(const QWebEngineProfile);
+ return d->m_scriptCollection.data();
+}
+
+/*!
+ Sets the function \a notificationPresenter as responsible for presenting sent notifications.
+
+ \since 5.13
+ \sa QWebEngineNotification
+*/
+void QWebEngineProfile::setNotificationPresenter(std::function<void(std::unique_ptr<QWebEngineNotification>)> notificationPresenter)
+{
+ Q_D(QWebEngineProfile);
+ d->m_notificationPresenter = std::move(notificationPresenter);
+}
+
+/*!
+ \fn QWebEngineProfile::notificationPresenter()
+ Returns the presenter responsible for presenting sent notifications.
+ \since 6.2
+ */
+std::function<void(std::unique_ptr<QWebEngineNotification>)> QWebEngineProfile::notificationPresenter()
+{
+ Q_D(QWebEngineProfile);
+ return d->m_notificationPresenter;
+}
+
+/*!
+ Returns the default profile.
+
+ The default profile is off-the-record.
+
+ \sa storageName()
+*/
+QWebEngineProfile *QWebEngineProfile::defaultProfile()
+{
+ static QWebEngineProfile* profile = new QWebEngineProfile(
+ new QWebEngineProfilePrivate(ProfileAdapter::createDefaultProfileAdapter()),
+ ProfileAdapter::globalQObjectRoot());
+ return profile;
+}
+
+/*!
+ \since 5.8
+
+ Sets the current list of \a languages for the spell checker.
+ Each language should match the name of the \c .bdic dictionary.
+ For example, the language \c en-US will load the \c en-US.bdic
+ dictionary file.
+
+ See the \l {Spellchecker}{Spellchecker feature documentation} for how
+ dictionary files are searched.
+
+ For more information about how to compile \c .bdic dictionaries, see the
+ \l{WebEngine Widgets Spellchecker Example}{Spellchecker Example}.
+
+*/
+void QWebEngineProfile::setSpellCheckLanguages(const QStringList &languages)
+{
+ Q_D(QWebEngineProfile);
+ d->profileAdapter()->setSpellCheckLanguages(languages);
+}
+
+/*!
+ \since 5.8
+
+ Returns the list of languages used by the spell checker.
+*/
+QStringList QWebEngineProfile::spellCheckLanguages() const
+{
+ const Q_D(QWebEngineProfile);
+ return d->profileAdapter()->spellCheckLanguages();
+}
+
+/*!
+ \since 5.8
+
+ Enables spell checker if \a enable is \c true, otherwise disables it.
+ \sa isSpellCheckEnabled()
+ */
+void QWebEngineProfile::setSpellCheckEnabled(bool enable)
+{
+ Q_D(QWebEngineProfile);
+ d->profileAdapter()->setSpellCheckEnabled(enable);
+}
+/*!
+ \since 5.8
+
+ Returns \c true if the spell checker is enabled; otherwise returns \c false.
+ \sa setSpellCheckEnabled()
+ */
+bool QWebEngineProfile::isSpellCheckEnabled() const
+{
+ const Q_D(QWebEngineProfile);
+ return d->profileAdapter()->isSpellCheckEnabled();
+}
+
+/*!
+ Returns the default settings for all pages in this profile.
+*/
+QWebEngineSettings *QWebEngineProfile::settings() const
+{
+ const Q_D(QWebEngineProfile);
+ return d->settings();
+}
+
+/*!
+ \since 5.6
+
+ Returns the custom URL scheme handler register for the URL scheme \a scheme.
+*/
+const QWebEngineUrlSchemeHandler *QWebEngineProfile::urlSchemeHandler(const QByteArray &scheme) const
+{
+ const Q_D(QWebEngineProfile);
+ return d->profileAdapter()->urlSchemeHandler(scheme);
+}
+
+/*!
+ \since 5.6
+
+ Registers a handler \a handler for custom URL scheme \a scheme in the profile.
+
+ It is necessary to first register the scheme with \l
+ QWebEngineUrlScheme::registerScheme at application startup.
+*/
+void QWebEngineProfile::installUrlSchemeHandler(const QByteArray &scheme, QWebEngineUrlSchemeHandler *handler)
+{
+ Q_D(QWebEngineProfile);
+ d->profileAdapter()->installUrlSchemeHandler(scheme, handler);
+}
+
+/*!
+ \since 5.6
+
+ Removes the custom URL scheme handler \a handler from the profile.
+
+ \sa removeUrlScheme()
+*/
+void QWebEngineProfile::removeUrlSchemeHandler(QWebEngineUrlSchemeHandler *handler)
+{
+ Q_D(QWebEngineProfile);
+ d->profileAdapter()->removeUrlSchemeHandler(handler);
+}
+
+/*!
+ \since 5.6
+
+ Removes the custom URL scheme \a scheme from the profile.
+
+ \sa removeUrlSchemeHandler()
+*/
+void QWebEngineProfile::removeUrlScheme(const QByteArray &scheme)
+{
+ Q_D(QWebEngineProfile);
+ d->profileAdapter()->removeUrlScheme(scheme);
+}
+
+/*!
+ \since 5.6
+
+ Removes all custom URL scheme handlers installed in the profile.
+*/
+void QWebEngineProfile::removeAllUrlSchemeHandlers()
+{
+ Q_D(QWebEngineProfile);
+ d->profileAdapter()->removeAllUrlSchemeHandlers();
+}
+
+/*!
+ \since 5.7
+
+ Removes the profile's cache entries.
+
+ \note Make sure that you do not start new navigation or any operation on the profile while
+ the clear operation is in progress. The clearHttpCacheCompleted() signal notifies about the
+ completion.
+
+ \sa QWebEngineProfile::clearHttpCacheCompleted()
+*/
+void QWebEngineProfile::clearHttpCache()
+{
+ Q_D(QWebEngineProfile);
+ d->profileAdapter()->clearHttpCache();
+}
+
+/*!
+ \since 5.13
+
+ Returns the profile's client certificate store.
+*/
+QWebEngineClientCertificateStore *QWebEngineProfile::clientCertificateStore()
+{
+#if QT_CONFIG(ssl)
+ Q_D(QWebEngineProfile);
+ return d->profileAdapter()->clientCertificateStore();
+#else
+ return nullptr;
+#endif
+}
+
+/*!
+ * Requests an icon for a previously loaded page with this profile from the database. Each profile
+ * has its own icon database and it is stored in the persistent storage thus the stored icons
+ * can be accessed without network connection too. The icon must be previously loaded to be
+ * stored in the database.
+ *
+ * \a url specifies the URL of the page what the icon is requested for. In case of more than one
+ * available icons the one with the size closest to \a desiredSizeInPixel will be returned.
+ * The result icon is resized to \a desiredSizeInPixel. If desiredSizeInPixel is 0 the largest
+ * available icon is returned.
+ *
+ * This function is asynchronous and the result is returned by \a iconAvailableCallback.
+ * The callback is called if a request for an icon is performed. If the requested icon is
+ * available, the first parameter (with type QIcon) is the result. Otherwise, it is null.
+ *
+ * The second parameter stores the URL of the requested icon. It is empty if the icon can't be
+ * fetched.
+ *
+ * The third parameter stores the URL of the page which the icon is assigned.
+ *
+ * \note Icons can't be requested with an off-the-record profile.
+ *
+ * \since 6.2
+ * \sa requestIconForIconURL()
+ */
+void QWebEngineProfile::requestIconForPageURL(const QUrl &url, int desiredSizeInPixel,
+ std::function<void(const QIcon &, const QUrl &, const QUrl &)> iconAvailableCallback) const
+{
+ Q_D(const QWebEngineProfile);
+ d->profileAdapter()->requestIconForPageURL(url, desiredSizeInPixel,
+ settings()->testAttribute(QWebEngineSettings::TouchIconsEnabled),
+ iconAvailableCallback);
+}
+
+/*!
+ * Requests an icon with the specified \a url from the database. Each profile has its
+ * own icon database and it is stored in the persistent storage thus the stored icons
+ * can be accessed without network connection too. The icon must be previously loaded to be
+ * stored in the database.
+ *
+ * \a url specifies the URL of the icon. In case of more than one
+ * available icons the one with the size closest to \a desiredSizeInPixel will be returned.
+ * The result icon is resized to \a desiredSizeInPixel. If desiredSizeInPixel is 0 the largest
+ * available icon is returned.
+ *
+ * This function is asynchronous and the result is returned by \a iconAvailableCallback.
+ * The callback is called if a request for an icon is performed. If the requested icon is
+ * available, the first parameter (with type QIcon) is the result. Otherwise, it is null.
+ *
+ * The second parameter stores the URL of the requested icon. It is empty if the icon can't be
+ * fetched.
+ *
+ * \note Icons can't be requested with an off-the-record profile.
+ *
+ * \since 6.2
+ * \sa requestIconForPageURL()
+ */
+void QWebEngineProfile::requestIconForIconURL(const QUrl &url, int desiredSizeInPixel,
+ std::function<void(const QIcon &, const QUrl &)> iconAvailableCallback) const
+{
+ Q_D(const QWebEngineProfile);
+ d->profileAdapter()->requestIconForIconURL(url, desiredSizeInPixel,
+ settings()->testAttribute(QWebEngineSettings::TouchIconsEnabled),
+ iconAvailableCallback);
+}
+
+/*!
+ Return the Client Hints settings associated with this browsing context.
+
+ \since 6.8
+ \sa QWebEngineClientHints
+*/
+QWebEngineClientHints *QWebEngineProfile::clientHints() const
+{
+ Q_D(const QWebEngineProfile);
+ return d->m_clientHints.data();
+}
+
+QT_END_NAMESPACE
+
+#include "moc_qwebengineprofile.cpp"
+#include "moc_qwebengineurlrequestinterceptor.cpp"
diff --git a/src/core/api/qwebengineprofile.h b/src/core/api/qwebengineprofile.h
new file mode 100644
index 000000000..a0027cb81
--- /dev/null
+++ b/src/core/api/qwebengineprofile.h
@@ -0,0 +1,133 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QWEBENGINEPROFILE_H
+#define QWEBENGINEPROFILE_H
+
+#include <QtWebEngineCore/qtwebenginecoreglobal.h>
+
+#include <QtCore/qobject.h>
+#include <QtCore/qscopedpointer.h>
+#include <QtCore/qstring.h>
+
+#include <functional>
+#include <memory>
+
+QT_BEGIN_NAMESPACE
+
+class QUrl;
+class QWebEngineClientCertificateStore;
+class QWebEngineClientHints;
+class QWebEngineCookieStore;
+class QWebEngineDownloadRequest;
+class QWebEngineNotification;
+class QWebEngineProfilePrivate;
+class QWebEngineSettings;
+class QWebEngineScriptCollection;
+class QWebEngineUrlRequestInterceptor;
+class QWebEngineUrlSchemeHandler;
+
+class Q_WEBENGINECORE_EXPORT QWebEngineProfile : public QObject
+{
+ Q_OBJECT
+public:
+ explicit QWebEngineProfile(QObject *parent = nullptr);
+ explicit QWebEngineProfile(const QString &name, QObject *parent = nullptr);
+ virtual ~QWebEngineProfile();
+
+ enum HttpCacheType {
+ MemoryHttpCache,
+ DiskHttpCache,
+ NoCache
+ };
+ Q_ENUM(HttpCacheType)
+
+ enum PersistentCookiesPolicy {
+ NoPersistentCookies,
+ AllowPersistentCookies,
+ ForcePersistentCookies
+ };
+ Q_ENUM(PersistentCookiesPolicy)
+
+ QString storageName() const;
+ bool isOffTheRecord() const;
+
+ QString persistentStoragePath() const;
+ void setPersistentStoragePath(const QString &path);
+
+ QString cachePath() const;
+ void setCachePath(const QString &path);
+
+ QString httpUserAgent() const;
+ void setHttpUserAgent(const QString &userAgent);
+
+ HttpCacheType httpCacheType() const;
+ void setHttpCacheType(QWebEngineProfile::HttpCacheType);
+
+ void setHttpAcceptLanguage(const QString &httpAcceptLanguage);
+ QString httpAcceptLanguage() const;
+
+ PersistentCookiesPolicy persistentCookiesPolicy() const;
+ void setPersistentCookiesPolicy(QWebEngineProfile::PersistentCookiesPolicy);
+
+ int httpCacheMaximumSize() const;
+ void setHttpCacheMaximumSize(int maxSize);
+
+ QWebEngineCookieStore *cookieStore();
+ void setUrlRequestInterceptor(QWebEngineUrlRequestInterceptor *interceptor);
+
+ void clearAllVisitedLinks();
+ void clearVisitedLinks(const QList<QUrl> &urls);
+ bool visitedLinksContainsUrl(const QUrl &url) const;
+
+ QWebEngineSettings *settings() const;
+ QWebEngineScriptCollection *scripts() const;
+ QWebEngineClientHints *clientHints() const;
+
+ const QWebEngineUrlSchemeHandler *urlSchemeHandler(const QByteArray &) const;
+ void installUrlSchemeHandler(const QByteArray &scheme, QWebEngineUrlSchemeHandler *);
+ void removeUrlScheme(const QByteArray &scheme);
+ void removeUrlSchemeHandler(QWebEngineUrlSchemeHandler *);
+ void removeAllUrlSchemeHandlers();
+
+ void clearHttpCache();
+
+ void setSpellCheckLanguages(const QStringList &languages);
+ QStringList spellCheckLanguages() const;
+ void setSpellCheckEnabled(bool enabled);
+ bool isSpellCheckEnabled() const;
+
+ QString downloadPath() const;
+ void setDownloadPath(const QString &path);
+
+ bool isPushServiceEnabled() const;
+ void setPushServiceEnabled(bool enabled);
+
+ void setNotificationPresenter(std::function<void(std::unique_ptr<QWebEngineNotification>)> notificationPresenter);
+
+ QWebEngineClientCertificateStore *clientCertificateStore();
+
+ void requestIconForPageURL(const QUrl &url, int desiredSizeInPixel, std::function<void(const QIcon &, const QUrl &, const QUrl &)> iconAvailableCallback) const;
+ void requestIconForIconURL(const QUrl &url, int desiredSizeInPixel, std::function<void(const QIcon &, const QUrl &)> iconAvailableCallback) const;
+
+ static QWebEngineProfile *defaultProfile();
+
+Q_SIGNALS:
+ void downloadRequested(QWebEngineDownloadRequest *download);
+ void clearHttpCacheCompleted();
+
+private:
+ Q_DISABLE_COPY(QWebEngineProfile)
+ Q_DECLARE_PRIVATE(QWebEngineProfile)
+ QWebEngineProfile(QWebEngineProfilePrivate *, QObject *parent = nullptr);
+
+ friend class QWebEngineView;
+ std::function<void(std::unique_ptr<QWebEngineNotification>)> notificationPresenter();
+
+ friend class QWebEnginePagePrivate;
+ QScopedPointer<QWebEngineProfilePrivate> d_ptr;
+};
+
+QT_END_NAMESPACE
+
+#endif // QWEBENGINEPROFILE_H
diff --git a/src/core/api/qwebengineprofile_p.h b/src/core/api/qwebengineprofile_p.h
new file mode 100644
index 000000000..0ccc27037
--- /dev/null
+++ b/src/core/api/qwebengineprofile_p.h
@@ -0,0 +1,75 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QWEBENGINEPROFILE_P_H
+#define QWEBENGINEPROFILE_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "profile_adapter_client.h"
+
+#include <QMap>
+#include <QPointer>
+#include <QScopedPointer>
+#include <QSharedPointer>
+
+#include <functional>
+
+namespace QtWebEngineCore {
+class ProfileAdapter;
+class WebEngineSettings;
+}
+
+QT_BEGIN_NAMESPACE
+
+class QWebEngineClientHints;
+class QWebEngineNotification;
+class QWebEngineProfile;
+class QWebEngineScriptCollection;
+class QWebEngineSettings;
+
+class Q_WEBENGINECORE_EXPORT QWebEngineProfilePrivate : public QtWebEngineCore::ProfileAdapterClient {
+public:
+ Q_DECLARE_PUBLIC(QWebEngineProfile)
+ QWebEngineProfilePrivate(QtWebEngineCore::ProfileAdapter *profileAdapter);
+ ~QWebEngineProfilePrivate();
+
+ QtWebEngineCore::ProfileAdapter *profileAdapter() const;
+ QWebEngineSettings *settings() const { return m_settings; }
+ QtWebEngineCore::WebEngineSettings *coreSettings() const override;
+
+ void downloadDestroyed(quint32 downloadId);
+
+ void cleanDownloads();
+
+ void downloadRequested(DownloadItemInfo &info) override;
+ void downloadUpdated(const DownloadItemInfo &info) override;
+
+ void showNotification(QSharedPointer<QtWebEngineCore::UserNotificationController> &) override;
+ void clearHttpCacheCompleted() override;
+
+ void addWebContentsAdapterClient(QtWebEngineCore::WebContentsAdapterClient *adapter) override;
+ void removeWebContentsAdapterClient(QtWebEngineCore::WebContentsAdapterClient *adapter) override;
+
+private:
+ QWebEngineProfile *q_ptr;
+ QWebEngineSettings *m_settings;
+ QPointer<QtWebEngineCore::ProfileAdapter> m_profileAdapter;
+ QScopedPointer<QWebEngineScriptCollection> m_scriptCollection;
+ QScopedPointer<QWebEngineClientHints> m_clientHints;
+ QMap<quint32, QPointer<QWebEngineDownloadRequest>> m_ongoingDownloads;
+ std::function<void(std::unique_ptr<QWebEngineNotification>)> m_notificationPresenter;
+};
+
+QT_END_NAMESPACE
+
+#endif // QWEBENGINEPROFILE_P_H
diff --git a/src/core/api/qwebenginequotarequest.cpp b/src/core/api/qwebenginequotarequest.cpp
index 7686d0806..3c312216d 100644
--- a/src/core/api/qwebenginequotarequest.cpp
+++ b/src/core/api/qwebenginequotarequest.cpp
@@ -1,113 +1,56 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qwebenginequotarequest.h"
-#include "quota_request_controller.h"
+#if QT_DEPRECATED_SINCE(6, 5)
QT_BEGIN_NAMESPACE
/*!
\class QWebEngineQuotaRequest
- \brief The QWebEngineQuotaRequest class enables accepting or rejecting
- requests for larger persistent storage than the application's current
- allocation in File System API.
-
\since 5.11
\inmodule QtWebEngineCore
+ \deprecated [6.5] Requesting host quota is no longer supported by Chromium.
+
+ The behavior of navigator.webkitPersistentStorage
+ is identical to navigator.webkitTemporaryStorage.
- This class is used by the QWebEnginePage::quotaRequested() signal to \l
- accept() or \l reject() a request for an increase in the persistent storage
- allocated to the application. The default quota is 0 bytes.
+ For further details, see https://crbug.com/1233525
*/
/*! \fn QWebEngineQuotaRequest::QWebEngineQuotaRequest()
\internal
*/
-/*! \internal */
-QWebEngineQuotaRequest::QWebEngineQuotaRequest(QSharedPointer<QtWebEngineCore::QuotaRequestController> controller)
- : d_ptr(controller)
-{}
-
-/*!
- Rejects a request for larger persistent storage.
-*/
void QWebEngineQuotaRequest::reject()
{
- d_ptr->reject();
}
-/*!
- Accepts a request for larger persistent storage.
-*/
void QWebEngineQuotaRequest::accept()
{
- d_ptr->accept();
}
/*!
\property QWebEngineQuotaRequest::origin
- \brief The URL of the web page that issued the quota request.
*/
QUrl QWebEngineQuotaRequest::origin() const
{
- return d_ptr->origin();
+ return QUrl();
}
/*!
\property QWebEngineQuotaRequest::requestedSize
- \brief Contains the size of the requested disk space in bytes.
*/
qint64 QWebEngineQuotaRequest::requestedSize() const
{
- return d_ptr->requestedSize();
+ return 0;
}
-/*! \fn bool QWebEngineQuotaRequest::operator==(const QWebEngineQuotaRequest &that) const
- Returns \c true if \a that points to the same object as this quota request.
-*/
+QT_END_NAMESPACE
-/*! \fn bool QWebEngineQuotaRequest::operator!=(const QWebEngineQuotaRequest &that) const
- Returns \c true if \a that points to a different object than this request.
-*/
+#endif // QT_DEPRECATED_SINCE(6, 5)
-QT_END_NAMESPACE
+#include "moc_qwebenginequotarequest.cpp"
diff --git a/src/core/api/qwebenginequotarequest.h b/src/core/api/qwebenginequotarequest.h
index da72116c8..f542f5576 100644
--- a/src/core/api/qwebenginequotarequest.h
+++ b/src/core/api/qwebenginequotarequest.h
@@ -1,75 +1,35 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QWEBENGINEQUOTAREQUEST_H
#define QWEBENGINEQUOTAREQUEST_H
-#include <QtCore/qsharedpointer.h>
-#include <QtCore/qurl.h>
#include <QtWebEngineCore/qtwebenginecoreglobal.h>
-namespace QtWebEngineCore {
-class QuotaPermissionContextQt;
-class QuotaRequestController;
-} // namespace QtWebEngineCore
+#include <QtCore/qurl.h>
+
+#if QT_DEPRECATED_SINCE(6, 5)
QT_BEGIN_NAMESPACE
-class Q_WEBENGINECORE_EXPORT QWebEngineQuotaRequest {
+class Q_WEBENGINECORE_EXPORT QWebEngineQuotaRequest
+{
Q_GADGET
Q_PROPERTY(QUrl origin READ origin CONSTANT FINAL)
Q_PROPERTY(qint64 requestedSize READ requestedSize CONSTANT FINAL)
public:
+ QT_DEPRECATED_VERSION_X_6_5("Requesting host quota is no longer supported.")
QWebEngineQuotaRequest() {}
Q_INVOKABLE void accept();
Q_INVOKABLE void reject();
QUrl origin() const;
qint64 requestedSize() const;
- bool operator==(const QWebEngineQuotaRequest &that) const { return d_ptr == that.d_ptr; }
- bool operator!=(const QWebEngineQuotaRequest &that) const { return d_ptr != that.d_ptr; }
-
-private:
- QWebEngineQuotaRequest(QSharedPointer<QtWebEngineCore::QuotaRequestController>);
- friend QtWebEngineCore::QuotaPermissionContextQt;
- QSharedPointer<QtWebEngineCore::QuotaRequestController> d_ptr;
+ bool operator==(const QWebEngineQuotaRequest &) const { Q_UNREACHABLE(); }
+ bool operator!=(const QWebEngineQuotaRequest &) const { Q_UNREACHABLE(); }
};
QT_END_NAMESPACE
+#endif // QT_DEPRECATED_SINCE(6, 5)
+
#endif // QWEBENGINEQUOTAREQUEST_H
diff --git a/src/core/api/qwebengineregisterprotocolhandlerrequest.cpp b/src/core/api/qwebengineregisterprotocolhandlerrequest.cpp
index a3960327d..3e52302e4 100644
--- a/src/core/api/qwebengineregisterprotocolhandlerrequest.cpp
+++ b/src/core/api/qwebengineregisterprotocolhandlerrequest.cpp
@@ -1,45 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qwebengineregisterprotocolhandlerrequest.h"
-#include "register_protocol_handler_request_controller.h"
+#include "custom_handlers/register_protocol_handler_request_controller.h"
QT_BEGIN_NAMESPACE
@@ -50,7 +14,7 @@ QT_BEGIN_NAMESPACE
\brief The QWebEngineRegisterProtocolHandlerRequest class enables
accepting or rejecting requests from the \l registerProtocolHandler API.
- \sa QWebEnginePage::registerProtocolHandlerRequested
+ \sa QWebEnginePage::registerProtocolHandlerRequested()
*/
/*! \fn QWebEngineRegisterProtocolHandlerRequest::QWebEngineRegisterProtocolHandlerRequest()
@@ -114,3 +78,5 @@ QString QWebEngineRegisterProtocolHandlerRequest::scheme() const
*/
QT_END_NAMESPACE
+
+#include "moc_qwebengineregisterprotocolhandlerrequest.cpp"
diff --git a/src/core/api/qwebengineregisterprotocolhandlerrequest.h b/src/core/api/qwebengineregisterprotocolhandlerrequest.h
index 67caf1590..d6e51695e 100644
--- a/src/core/api/qwebengineregisterprotocolhandlerrequest.h
+++ b/src/core/api/qwebengineregisterprotocolhandlerrequest.h
@@ -1,48 +1,13 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QWEBENGINEREGISTERPROTOCOLHANDLERREQUEST_H
#define QWEBENGINEREGISTERPROTOCOLHANDLERREQUEST_H
+#include <QtWebEngineCore/qtwebenginecoreglobal.h>
+
#include <QtCore/qsharedpointer.h>
#include <QtCore/qurl.h>
-#include <QtWebEngineCore/qtwebenginecoreglobal.h>
namespace QtWebEngineCore {
class RegisterProtocolHandlerRequestController;
@@ -51,7 +16,8 @@ class WebContentsDelegateQt;
QT_BEGIN_NAMESPACE
-class Q_WEBENGINECORE_EXPORT QWebEngineRegisterProtocolHandlerRequest {
+class Q_WEBENGINECORE_EXPORT QWebEngineRegisterProtocolHandlerRequest
+{
Q_GADGET
Q_PROPERTY(QUrl origin READ origin CONSTANT FINAL)
Q_PROPERTY(QString scheme READ scheme CONSTANT FINAL)
diff --git a/src/core/api/qwebenginescript.cpp b/src/core/api/qwebenginescript.cpp
new file mode 100644
index 000000000..29b92a396
--- /dev/null
+++ b/src/core/api/qwebenginescript.cpp
@@ -0,0 +1,283 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qwebenginescript.h"
+
+#include "user_script.h"
+#include <QtCore/QDebug>
+#include <QtCore/QFile>
+
+using QtWebEngineCore::UserScript;
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QWebEngineScript
+ \inmodule QtWebEngineCore
+ \since 5.5
+ \brief The QWebEngineScript class encapsulates a JavaScript program.
+
+
+ QWebEngineScript enables the programmatic injection of so called \e {user scripts} in the
+ JavaScript engine at different points, determined by injectionPoint(), during the loading of web
+ contents.
+
+ Scripts can be executed either in the main JavaScript \e world, along with the rest of the
+ JavaScript coming from the web contents, or in their own isolated world. While the DOM of the
+ page can be accessed from any world, JavaScript variables of a function defined in one world are
+ not accessible from a different one. ScriptWorldId provides some predefined IDs for this
+ purpose.
+
+ The following \l Greasemonkey attributes are supported since Qt 5.8:
+ \c @exclude, \c @include, \c @name, \c @match, and \c @run-at.
+
+ Use QWebEnginePage::scripts() and QWebEngineProfile::scripts() to access
+ the collection of scripts associated with a single page or a
+ number of pages sharing the same profile.
+
+ \sa {Script Injection}
+*/
+/*!
+ \enum QWebEngineScript::InjectionPoint
+
+ This enum describes the timing of the script injection:
+
+ \value DocumentCreation The script will be executed as soon as the document is created. This is not suitable for
+ any DOM operation.
+ \value DocumentReady The script will run as soon as the DOM is ready. This is equivalent to the
+ \c DOMContentLoaded event firing in JavaScript.
+ \value Deferred The script will run when the page load finishes, or 500ms after the document is ready, whichever
+ comes first.
+
+*/
+/*!
+ \enum QWebEngineScript::ScriptWorldId
+
+ This enum provides pre-defined world IDs for isolating user scripts into different worlds:
+
+ \value MainWorld The world used by the page's web contents. It can be useful in order to expose custom functionality
+ to web contents in certain scenarios.
+ \value ApplicationWorld The default isolated world used for application level functionality implemented in JavaScript.
+ \value UserWorld The first isolated world to be used by scripts set by users if the application is not making use
+ of more worlds. As a rule of thumb, if that functionality is exposed to the application users, each individual script
+ should probably get its own isolated world.
+
+*/
+
+/*!
+ \fn QWebEngineScript::operator!=(const QWebEngineScript &other) const
+
+ Returns \c true if the script is not equal to \a other, otherwise returns \c false.
+*/
+
+/*!
+ \fn QWebEngineScript::swap(QWebEngineScript &other)
+
+ Swaps the contents of the script with the contents of \a other.
+*/
+
+/*!
+ * Constructs a null script.
+ */
+
+QWebEngineScript::QWebEngineScript()
+ : d(new UserScript)
+{
+}
+
+/*!
+ * Constructs a user script using the contents of \a other.
+ */
+QWebEngineScript::QWebEngineScript(const QWebEngineScript &other)
+ : d(other.d)
+{
+}
+
+/*!
+ Destroys a script.
+*/
+QWebEngineScript::~QWebEngineScript()
+{
+}
+
+/*!
+ Assigns \a other to the script.
+*/
+QWebEngineScript &QWebEngineScript::operator=(const QWebEngineScript &other)
+{
+ d = other.d;
+ return *this;
+}
+
+/*!
+ * Returns the name of the script. Can be useful to retrieve a particular script from a
+ * QWebEngineScriptCollection.
+ *
+ * \sa QWebEngineScriptCollection::find()
+ */
+
+QString QWebEngineScript::name() const
+{
+ return d->name();
+}
+
+/*!
+ * Sets the script name to \a scriptName.
+ */
+void QWebEngineScript::setName(const QString &scriptName)
+{
+ if (scriptName == name())
+ return;
+ d->setName(scriptName);
+}
+
+
+QUrl QWebEngineScript::sourceUrl() const
+{
+ return d->sourceUrl();
+}
+
+void QWebEngineScript::setSourceUrl(const QUrl &url)
+{
+ if (url == sourceUrl())
+ return;
+
+ d->setSourceUrl(url);
+
+ QFile file;
+ if (url.isLocalFile()) {
+ file.setFileName(url.toLocalFile());
+ } else if (url.scheme().compare(QLatin1String("qrc"), Qt::CaseInsensitive) == 0) {
+ if (url.authority().isEmpty())
+ file.setFileName(QLatin1Char(':') + url.path());
+ }
+
+ if (!file.open(QIODevice::ReadOnly)) {
+ qWarning() << "Can't open user script " << url;
+ return;
+ }
+
+ QString source = QString::fromUtf8(file.readAll());
+ setSourceCode(source);
+}
+
+/*!
+ Returns the source of the script.
+ */
+QString QWebEngineScript::sourceCode() const
+{
+ return d->sourceCode();
+}
+
+/*!
+ * Sets the script source to \a scriptSource.
+ */
+void QWebEngineScript::setSourceCode(const QString &scriptSource)
+{
+ if (scriptSource == sourceCode())
+ return;
+ d->setSourceCode(scriptSource);
+}
+
+ASSERT_ENUMS_MATCH(QWebEngineScript::Deferred, UserScript::AfterLoad)
+ASSERT_ENUMS_MATCH(QWebEngineScript::DocumentReady, UserScript::DocumentLoadFinished)
+ASSERT_ENUMS_MATCH(QWebEngineScript::DocumentCreation, UserScript::DocumentElementCreation)
+
+/*!
+ * Returns the point in the loading process at which the script will be executed.
+ * The default value is QWebEngineScript::Deferred.
+ *
+ * \sa setInjectionPoint()
+ */
+QWebEngineScript::InjectionPoint QWebEngineScript::injectionPoint() const
+{
+ return static_cast<QWebEngineScript::InjectionPoint>(d->injectionPoint());
+}
+/*!
+ * Sets the point at which to execute the script to be \a p.
+ *
+ * \sa InjectionPoint
+ */
+void QWebEngineScript::setInjectionPoint(QWebEngineScript::InjectionPoint p)
+{
+ if (p == injectionPoint())
+ return;
+ d->setInjectionPoint(static_cast<UserScript::InjectionPoint>(p));
+}
+
+/*!
+ Returns the world ID defining which world the script is executed in.
+ */
+quint32 QWebEngineScript::worldId() const
+{
+ return d->worldId();
+}
+
+/*!
+ Sets the world ID of the isolated world to \a id when running this script.
+
+ Must be between \c 0 and \c 256.
+ */
+void QWebEngineScript::setWorldId(quint32 id)
+{
+ if (id == d->worldId())
+ return;
+ d->setWorldId(id);
+}
+
+/*!
+ Returns \c true if the script is executed on every frame in the page, or \c false if it is only
+ ran for the main frame.
+ */
+bool QWebEngineScript::runsOnSubFrames() const
+{
+ return d->runsOnSubFrames();
+}
+
+/*!
+ * Executes the script on sub frames in addition to the main frame if \a on returns \c true.
+ */
+void QWebEngineScript::setRunsOnSubFrames(bool on)
+{
+ if (runsOnSubFrames() == on)
+ return;
+ d->setRunsOnSubFrames(on);
+}
+
+/*!
+ Returns \c true if the script is equal to \a other, otherwise returns \c false.
+ */
+bool QWebEngineScript::operator==(const QWebEngineScript &other) const
+{
+ return d == other.d || *d == *(other.d);
+}
+
+QWebEngineScript::QWebEngineScript(const UserScript &coreScript)
+ : d(new UserScript(coreScript))
+{
+}
+
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug d, const QWebEngineScript &script)
+{
+ d.nospace() << "QWebEngineScript(" << script.name() << ", ";
+ switch (script.injectionPoint()) {
+ case QWebEngineScript::DocumentCreation:
+ d << "QWebEngineScript::DocumentCreation" << ", ";
+ break;
+ case QWebEngineScript::DocumentReady:
+ d << "QWebEngineScript::DocumentReady" << ", ";
+ break;
+ case QWebEngineScript::Deferred:
+ d << "QWebEngineScript::Deferred" << ", ";
+ break;
+ }
+ d << script.worldId() << ", "
+ << script.runsOnSubFrames() << ", " << script.sourceCode() << ")";
+ return d.space();
+}
+#endif
+
+QT_END_NAMESPACE
+
+#include "moc_qwebenginescript.cpp"
diff --git a/src/core/api/qwebenginescript.h b/src/core/api/qwebenginescript.h
new file mode 100644
index 000000000..9827c4879
--- /dev/null
+++ b/src/core/api/qwebenginescript.h
@@ -0,0 +1,91 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QWEBENGINESCRIPT_H
+#define QWEBENGINESCRIPT_H
+
+#include <QtWebEngineCore/qtwebenginecoreglobal.h>
+#include <QtCore/qurl.h>
+#include <QtCore/qobject.h>
+#include <QtCore/qshareddata.h>
+
+namespace QtWebEngineCore {
+class UserScript;
+} // namespace
+
+QT_BEGIN_NAMESPACE
+
+class Q_WEBENGINECORE_EXPORT QWebEngineScript
+{
+
+ Q_GADGET
+ Q_PROPERTY(QString name READ name WRITE setName FINAL)
+ Q_PROPERTY(QUrl sourceUrl READ sourceUrl WRITE setSourceUrl FINAL)
+ Q_PROPERTY(QString sourceCode READ sourceCode WRITE setSourceCode FINAL)
+ Q_PROPERTY(InjectionPoint injectionPoint READ injectionPoint WRITE setInjectionPoint FINAL)
+ Q_PROPERTY(quint32 worldId READ worldId WRITE setWorldId FINAL)
+ Q_PROPERTY(bool runsOnSubFrames READ runsOnSubFrames WRITE setRunsOnSubFrames FINAL)
+
+public:
+
+ enum InjectionPoint {
+ Deferred,
+ DocumentReady,
+ DocumentCreation
+ };
+
+ Q_ENUM(InjectionPoint)
+
+ enum ScriptWorldId {
+ MainWorld = 0,
+ ApplicationWorld,
+ UserWorld
+ };
+
+ Q_ENUM(ScriptWorldId)
+
+ QWebEngineScript();
+ QWebEngineScript(const QWebEngineScript &other);
+ ~QWebEngineScript();
+
+ QWebEngineScript &operator=(const QWebEngineScript &other);
+
+ QString name() const;
+ void setName(const QString &);
+
+ QUrl sourceUrl() const;
+ void setSourceUrl(const QUrl &url);
+
+ QString sourceCode() const;
+ void setSourceCode(const QString &);
+
+ InjectionPoint injectionPoint() const;
+ void setInjectionPoint(InjectionPoint);
+
+ quint32 worldId() const;
+ void setWorldId(quint32);
+
+ bool runsOnSubFrames() const;
+ void setRunsOnSubFrames(bool on);
+
+ bool operator==(const QWebEngineScript &other) const;
+ inline bool operator!=(const QWebEngineScript &other) const
+ { return !operator==(other); }
+ void swap(QWebEngineScript &other) noexcept { d.swap(other.d); }
+
+private:
+ friend class QWebEngineScriptCollectionPrivate;
+ QWebEngineScript(const QtWebEngineCore::UserScript &);
+
+ QSharedDataPointer<QtWebEngineCore::UserScript> d;
+};
+
+Q_DECLARE_TYPEINFO(QWebEngineScript, Q_RELOCATABLE_TYPE);
+
+#ifndef QT_NO_DEBUG_STREAM
+Q_WEBENGINECORE_EXPORT QDebug operator<<(QDebug, const QWebEngineScript &);
+#endif
+
+QT_END_NAMESPACE
+
+#endif // QWEBENGINESCRIPT_H
diff --git a/src/core/api/qwebenginescriptcollection.cpp b/src/core/api/qwebenginescriptcollection.cpp
new file mode 100644
index 000000000..7867192b6
--- /dev/null
+++ b/src/core/api/qwebenginescriptcollection.cpp
@@ -0,0 +1,179 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qwebenginescriptcollection.h"
+#include "qwebenginescriptcollection_p.h"
+
+#include "renderer_host/user_resource_controller_host.h"
+
+/*!
+ \class QWebEngineScriptCollection
+ \inmodule QtWebEngineCore
+ \since 5.5
+ \brief The QWebEngineScriptCollection class represents a collection of user scripts.
+
+ QWebEngineScriptCollection manages a set of user scripts.
+
+ Use QWebEnginePage::scripts() and QWebEngineProfile::scripts() to access
+ the collection of scripts associated with a single page or a
+ number of pages sharing the same profile.
+
+ \sa {Script Injection}
+*/
+
+/*!
+ \fn QWebEngineScriptCollection::isEmpty() const
+
+ Returns \c true if the collection is empty; otherwise returns \c false.
+*/
+
+QWebEngineScriptCollection::QWebEngineScriptCollection(QWebEngineScriptCollectionPrivate *collectionPrivate)
+ :d(collectionPrivate)
+{
+}
+
+/*!
+ Destroys the collection.
+*/
+QWebEngineScriptCollection::~QWebEngineScriptCollection()
+{
+}
+
+/*!
+ Returns the number of elements in the collection.
+ */
+
+int QWebEngineScriptCollection::count() const
+{
+ return d->count();
+}
+
+/*!
+ Returns \c true if the collection contains an occurrence of \a value; otherwise returns
+ \c false.
+ */
+
+bool QWebEngineScriptCollection::contains(const QWebEngineScript &value) const
+{
+ return d->contains(value);
+}
+
+/*!
+ Returns the list of scripts in the collection with the name \a name, or an empty list if none
+ was found.
+ */
+
+QList<QWebEngineScript> QWebEngineScriptCollection::find(const QString &name) const
+{
+ return d->toList(name);
+}
+/*!
+ Inserts the script \a s into the collection.
+ */
+void QWebEngineScriptCollection::insert(const QWebEngineScript &s)
+{
+ d->insert(s);
+}
+/*!
+ Inserts scripts from the list \a list into the collection.
+ */
+void QWebEngineScriptCollection::insert(const QList<QWebEngineScript> &list)
+{
+ d->reserve(list.size());
+ for (const QWebEngineScript &s : list)
+ d->insert(s);
+}
+
+/*!
+ Removes \a script from the collection.
+
+ Returns \c true if the script was found and successfully removed from the collection; otherwise
+ returns \c false.
+ */
+bool QWebEngineScriptCollection::remove(const QWebEngineScript &script)
+{
+ return d->remove(script);
+}
+
+/*!
+ * Removes all scripts from this collection.
+ */
+void QWebEngineScriptCollection::clear()
+{
+ d->clear();
+}
+
+/*!
+ Returns a list with the values of the scripts used in this collection.
+ */
+QList<QWebEngineScript> QWebEngineScriptCollection::toList() const
+{
+ return d->toList();
+}
+
+
+QWebEngineScriptCollectionPrivate::QWebEngineScriptCollectionPrivate(QtWebEngineCore::UserResourceControllerHost *controller, QSharedPointer<QtWebEngineCore::WebContentsAdapter> webContents)
+ : m_scriptController(controller)
+ , m_contents(webContents)
+{
+}
+
+int QWebEngineScriptCollectionPrivate::count() const
+{
+ return m_scripts.size();
+}
+
+bool QWebEngineScriptCollectionPrivate::contains(const QWebEngineScript &s) const
+{
+ return m_scripts.contains(s);
+}
+
+void QWebEngineScriptCollectionPrivate::insert(const QWebEngineScript &script)
+{
+ m_scripts.append(script);
+ if (!m_contents || m_contents->isInitialized())
+ m_scriptController->addUserScript(*script.d, m_contents.data());
+}
+
+bool QWebEngineScriptCollectionPrivate::remove(const QWebEngineScript &script)
+{
+ if (!m_contents || m_contents->isInitialized())
+ m_scriptController->removeUserScript(*script.d, m_contents.data());
+ return m_scripts.removeAll(script);
+}
+
+QList<QWebEngineScript> QWebEngineScriptCollectionPrivate::toList(const QString &scriptName) const
+{
+ if (scriptName.isNull())
+ return m_scripts;
+
+ QList<QWebEngineScript> ret;
+ for (const QWebEngineScript &script : std::as_const(m_scripts))
+ if (scriptName == script.name())
+ ret.append(script);
+ return ret;
+}
+
+void QWebEngineScriptCollectionPrivate::clear()
+{
+ m_scripts.clear();
+ if (!m_contents || m_contents->isInitialized())
+ m_scriptController->clearAllScripts(m_contents.data());
+}
+
+void QWebEngineScriptCollectionPrivate::reserve(int capacity)
+{
+ m_scripts.reserve(capacity);
+ if (!m_contents || m_contents->isInitialized())
+ m_scriptController->reserve(m_contents.data(), capacity);
+}
+
+void QWebEngineScriptCollectionPrivate::initializationFinished(QSharedPointer<QtWebEngineCore::WebContentsAdapter> contents)
+{
+ Q_ASSERT(m_contents);
+ Q_ASSERT(contents);
+
+ for (const QWebEngineScript &script : std::as_const(m_scripts))
+ m_scriptController->addUserScript(*script.d, contents.data());
+ m_contents = contents;
+}
diff --git a/src/core/api/qwebenginescriptcollection.h b/src/core/api/qwebenginescriptcollection.h
new file mode 100644
index 000000000..a3b3c1c08
--- /dev/null
+++ b/src/core/api/qwebenginescriptcollection.h
@@ -0,0 +1,44 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QWEBENGINESCRIPTCOLLECTION_H
+#define QWEBENGINESCRIPTCOLLECTION_H
+
+#include <QtWebEngineCore/qtwebenginecoreglobal.h>
+#include <QtWebEngineCore/qwebenginescript.h>
+#include <QtCore/qscopedpointer.h>
+#include <QtCore/qlist.h>
+
+QT_BEGIN_NAMESPACE
+class QWebEngineScriptCollectionPrivate;
+
+class Q_WEBENGINECORE_EXPORT QWebEngineScriptCollection
+{
+public:
+ ~QWebEngineScriptCollection();
+
+ bool isEmpty() const { return !count(); }
+ int count() const;
+ bool contains(const QWebEngineScript &value) const;
+ QList<QWebEngineScript> find(const QString &name) const;
+ void insert(const QWebEngineScript &);
+ void insert(const QList<QWebEngineScript> &list);
+ bool remove(const QWebEngineScript &);
+ void clear();
+
+ QList<QWebEngineScript> toList() const;
+
+private:
+ Q_DISABLE_COPY(QWebEngineScriptCollection)
+ friend class QWebEnginePagePrivate;
+ friend class QWebEngineProfilePrivate;
+ friend class QQuickWebEngineProfilePrivate;
+ friend class QQuickWebEngineViewPrivate;
+ friend class QQuickWebEngineScriptCollectionPrivate;
+ QWebEngineScriptCollection(QWebEngineScriptCollectionPrivate *);
+
+ QScopedPointer<QWebEngineScriptCollectionPrivate> d;
+};
+
+QT_END_NAMESPACE
+#endif // QWEBENGINESCRIPTCOLLECTION_H
diff --git a/src/core/api/qwebenginescriptcollection_p.h b/src/core/api/qwebenginescriptcollection_p.h
new file mode 100644
index 000000000..67b3aa4a7
--- /dev/null
+++ b/src/core/api/qwebenginescriptcollection_p.h
@@ -0,0 +1,51 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QWEBENGINESCRIPTCOLLECTION_P_H
+#define QWEBENGINESCRIPTCOLLECTION_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qtwebenginecoreglobal.h"
+#include "qwebenginescript.h"
+#include "web_contents_adapter.h"
+
+#include <QtCore/QList>
+#include <QtCore/QSharedPointer>
+
+namespace QtWebEngineCore {
+class UserResourceControllerHost;
+} // namespace
+
+QT_BEGIN_NAMESPACE
+class Q_WEBENGINECORE_EXPORT QWebEngineScriptCollectionPrivate
+{
+public:
+ QWebEngineScriptCollectionPrivate(QtWebEngineCore::UserResourceControllerHost *, QSharedPointer<QtWebEngineCore::WebContentsAdapter> = QSharedPointer<QtWebEngineCore::WebContentsAdapter>());
+ int count() const;
+ bool contains(const QWebEngineScript &) const;
+ QList<QWebEngineScript> toList(const QString &scriptName = QString()) const;
+ void initializationFinished(QSharedPointer<QtWebEngineCore::WebContentsAdapter> contents);
+ void insert(const QWebEngineScript &);
+ bool remove(const QWebEngineScript &);
+ void clear();
+ void reserve(int);
+
+private:
+ QtWebEngineCore::UserResourceControllerHost *m_scriptController;
+ QSharedPointer<QtWebEngineCore::WebContentsAdapter> m_contents;
+ QList<QWebEngineScript> m_scripts;
+};
+
+QT_END_NAMESPACE
+
+#endif // QWEBENGINESCRIPTCOLLECTION__PH
diff --git a/src/core/api/qwebenginesettings.cpp b/src/core/api/qwebenginesettings.cpp
new file mode 100644
index 000000000..f19d8efe5
--- /dev/null
+++ b/src/core/api/qwebenginesettings.cpp
@@ -0,0 +1,121 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qwebenginesettings.h"
+#include "web_engine_settings.h"
+
+QT_BEGIN_NAMESPACE
+
+using QtWebEngineCore::WebEngineSettings;
+
+QWebEngineSettings::QWebEngineSettings(QWebEngineSettings *parentSettings)
+ : d_ptr(new WebEngineSettings(parentSettings ? parentSettings->d_ptr.data() : nullptr))
+{
+ d_ptr->scheduleApplyRecursively();
+}
+
+QWebEngineSettings::~QWebEngineSettings() { }
+
+/*
+ Returns the settings for a web engine page that belongs to the default
+ profile. All web pages not specifically created with another profile belong
+ to the default profile.
+
+QWebEngineSettings *QWebEngineSettings::defaultSettings()
+{
+ return QWebEngineProfile::defaultProfile()->settings();
+}
+*/
+
+void QWebEngineSettings::setFontFamily(QWebEngineSettings::FontFamily which, const QString &family)
+{
+ d_ptr->setFontFamily(which, family);
+}
+
+QString QWebEngineSettings::fontFamily(QWebEngineSettings::FontFamily which) const
+{
+ return d_ptr->fontFamily(which);
+}
+
+void QWebEngineSettings::resetFontFamily(QWebEngineSettings::FontFamily which)
+{
+ d_ptr->resetFontFamily(which);
+}
+
+void QWebEngineSettings::setFontSize(QWebEngineSettings::FontSize type, int size)
+{
+ d_ptr->setFontSize(type, size);
+}
+
+int QWebEngineSettings::fontSize(QWebEngineSettings::FontSize type) const
+{
+ return d_ptr->fontSize(type);
+}
+
+void QWebEngineSettings::resetFontSize(QWebEngineSettings::FontSize type)
+{
+ d_ptr->resetFontSize(type);
+}
+
+QString QWebEngineSettings::defaultTextEncoding() const
+{
+ return d_ptr->defaultTextEncoding();
+}
+
+QWebEngineSettings::UnknownUrlSchemePolicy QWebEngineSettings::unknownUrlSchemePolicy() const
+{
+ return d_ptr->unknownUrlSchemePolicy();
+}
+
+void QWebEngineSettings::resetUnknownUrlSchemePolicy()
+{
+ d_ptr->setUnknownUrlSchemePolicy(QWebEngineSettings::InheritedUnknownUrlSchemePolicy);
+}
+
+void QWebEngineSettings::setAttribute(QWebEngineSettings::WebAttribute attr, bool on)
+{
+ d_ptr->setAttribute(attr, on);
+}
+
+bool QWebEngineSettings::testAttribute(QWebEngineSettings::WebAttribute attr) const
+{
+ return d_ptr->testAttribute(attr);
+}
+
+void QWebEngineSettings::resetAttribute(QWebEngineSettings::WebAttribute attr)
+{
+ d_ptr->resetAttribute(attr);
+}
+
+void QWebEngineSettings::setDefaultTextEncoding(const QString &encoding)
+{
+ d_ptr->setDefaultTextEncoding(encoding);
+}
+
+void QWebEngineSettings::setUnknownUrlSchemePolicy(
+ QWebEngineSettings::UnknownUrlSchemePolicy policy)
+{
+ d_ptr->setUnknownUrlSchemePolicy(policy);
+}
+
+void QWebEngineSettings::setParentSettings(QWebEngineSettings *parentSettings)
+{
+ d_ptr->setParentSettings(parentSettings->d_ptr.data());
+}
+
+void QWebEngineSettings::setImageAnimationPolicy(QWebEngineSettings::ImageAnimationPolicy policy)
+{
+ d_ptr->setImageAnimationPolicy(policy);
+}
+
+QWebEngineSettings::ImageAnimationPolicy QWebEngineSettings::imageAnimationPolicy() const
+{
+ return d_ptr->imageAnimationPolicy();
+}
+
+void QWebEngineSettings::resetImageAnimationPolicy()
+{
+ d_ptr->setImageAnimationPolicy(QWebEngineSettings::InheritedImageAnimationPolicy);
+}
+
+QT_END_NAMESPACE
diff --git a/src/core/api/qwebenginesettings.h b/src/core/api/qwebenginesettings.h
new file mode 100644
index 000000000..7f89f1ea6
--- /dev/null
+++ b/src/core/api/qwebenginesettings.h
@@ -0,0 +1,127 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QWEBENGINESETTINGS_H
+#define QWEBENGINESETTINGS_H
+
+#include <QtWebEngineCore/qtwebenginecoreglobal.h>
+#include <QtCore/qscopedpointer.h>
+#include <QtCore/qstring.h>
+
+namespace QtWebEngineCore {
+class WebEngineSettings;
+}
+
+QT_BEGIN_NAMESPACE
+
+class Q_WEBENGINECORE_EXPORT QWebEngineSettings
+{
+public:
+ enum FontFamily {
+ StandardFont,
+ FixedFont,
+ SerifFont,
+ SansSerifFont,
+ CursiveFont,
+ FantasyFont,
+ PictographFont
+ };
+
+ enum WebAttribute {
+ AutoLoadImages,
+ JavascriptEnabled,
+ JavascriptCanOpenWindows,
+ JavascriptCanAccessClipboard,
+ LinksIncludedInFocusChain,
+ LocalStorageEnabled,
+ LocalContentCanAccessRemoteUrls,
+ XSSAuditingEnabled,
+ SpatialNavigationEnabled,
+ LocalContentCanAccessFileUrls,
+ HyperlinkAuditingEnabled,
+ ScrollAnimatorEnabled,
+ ErrorPageEnabled,
+ PluginsEnabled,
+ FullScreenSupportEnabled,
+ ScreenCaptureEnabled,
+ WebGLEnabled,
+ Accelerated2dCanvasEnabled,
+ AutoLoadIconsForPage,
+ TouchIconsEnabled,
+ FocusOnNavigationEnabled,
+ PrintElementBackgrounds,
+ AllowRunningInsecureContent,
+ AllowGeolocationOnInsecureOrigins,
+ AllowWindowActivationFromJavaScript,
+ ShowScrollBars,
+ PlaybackRequiresUserGesture,
+ WebRTCPublicInterfacesOnly,
+ JavascriptCanPaste,
+ DnsPrefetchEnabled,
+ PdfViewerEnabled,
+ NavigateOnDropEnabled,
+ ReadingFromCanvasEnabled,
+ ForceDarkMode,
+ };
+
+ enum FontSize {
+ MinimumFontSize,
+ MinimumLogicalFontSize,
+ DefaultFontSize,
+ DefaultFixedFontSize
+ };
+
+ enum UnknownUrlSchemePolicy {
+ InheritedUnknownUrlSchemePolicy = 0, // TODO: hide
+ DisallowUnknownUrlSchemes = 1,
+ AllowUnknownUrlSchemesFromUserInteraction,
+ AllowAllUnknownUrlSchemes
+ };
+
+ enum ImageAnimationPolicy {
+ InheritedImageAnimationPolicy = 0,
+ AllowImageAnimation,
+ AnimateImageOnce,
+ DisallowImageAnimation
+ };
+
+public:
+ ~QWebEngineSettings();
+ void setFontFamily(FontFamily which, const QString &family);
+ QString fontFamily(FontFamily which) const;
+ void resetFontFamily(FontFamily which);
+
+ void setFontSize(FontSize type, int size);
+ int fontSize(FontSize type) const;
+ void resetFontSize(FontSize type);
+
+ void setAttribute(WebAttribute attr, bool on);
+ bool testAttribute(WebAttribute attr) const;
+ void resetAttribute(WebAttribute attr);
+
+ void setDefaultTextEncoding(const QString &encoding);
+ QString defaultTextEncoding() const;
+
+ UnknownUrlSchemePolicy unknownUrlSchemePolicy() const;
+ void setUnknownUrlSchemePolicy(UnknownUrlSchemePolicy policy);
+ void resetUnknownUrlSchemePolicy();
+
+ void setImageAnimationPolicy(ImageAnimationPolicy policy);
+ ImageAnimationPolicy imageAnimationPolicy() const;
+ void resetImageAnimationPolicy();
+
+private:
+ explicit QWebEngineSettings(QWebEngineSettings *parentSettings = nullptr);
+ void setParentSettings(QWebEngineSettings *parentSettings);
+ Q_DISABLE_COPY(QWebEngineSettings)
+ typedef ::QtWebEngineCore::WebEngineSettings QWebEngineSettingsPrivate;
+ QScopedPointer<QWebEngineSettingsPrivate> d_ptr;
+ friend class QWebEnginePagePrivate;
+ friend class QWebEngineProfilePrivate;
+ friend class QQuickWebEngineSettings;
+ friend class QtWebEngineCore::WebEngineSettings;
+};
+
+QT_END_NAMESPACE
+
+#endif // QWEBENGINESETTINGS_H
diff --git a/src/core/api/qwebengineurlrequestinfo.cpp b/src/core/api/qwebengineurlrequestinfo.cpp
index 5ed729f5e..152cf4dd0 100644
--- a/src/core/api/qwebengineurlrequestinfo.cpp
+++ b/src/core/api/qwebengineurlrequestinfo.cpp
@@ -1,72 +1,20 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qwebengineurlrequestinfo.h"
#include "qwebengineurlrequestinfo_p.h"
-#include "content/public/common/resource_type.h"
-
#include "web_contents_adapter_client.h"
+#include "net/resource_request_body_qt.h"
+
+#include <memory>
+#include <utility>
QT_BEGIN_NAMESPACE
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeMainFrame, content::ResourceType::kMainFrame)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeSubFrame, content::ResourceType::kSubFrame)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeStylesheet, content::ResourceType::kStylesheet)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeScript, content::ResourceType::kScript)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeImage, content::ResourceType::kImage)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeFontResource, content::ResourceType::kFontResource)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeSubResource, content::ResourceType::kSubResource)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeObject, content::ResourceType::kObject)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeMedia, content::ResourceType::kMedia)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeWorker, content::ResourceType::kWorker)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeSharedWorker, content::ResourceType::kSharedWorker)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypePrefetch, content::ResourceType::kPrefetch)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeFavicon, content::ResourceType::kFavicon)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeXhr, content::ResourceType::kXhr)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypePing, content::ResourceType::kPing)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeServiceWorker, content::ResourceType::kServiceWorker)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeCspReport, content::ResourceType::kCspReport)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypePluginResource, content::ResourceType::kPluginResource)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeNavigationPreloadMainFrame, content::ResourceType::kNavigationPreloadMainFrame)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeNavigationPreloadSubFrame, content::ResourceType::kNavigationPreloadSubFrame)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeLast, content::ResourceType::kMaxValue)
+// We changed the type from QScopedPointer to unique_ptr, make sure it's binary compatible:
+static_assert(sizeof(QScopedPointer<QWebEngineUrlRequestInfoPrivate>)
+ == sizeof(std::unique_ptr<QWebEngineUrlRequestInfoPrivate>));
ASSERT_ENUMS_MATCH(QtWebEngineCore::WebContentsAdapterClient::LinkNavigation, QWebEngineUrlRequestInfo::NavigationTypeLink)
ASSERT_ENUMS_MATCH(QtWebEngineCore::WebContentsAdapterClient::TypedNavigation, QWebEngineUrlRequestInfo::NavigationTypeTyped)
@@ -111,7 +59,7 @@ ASSERT_ENUMS_MATCH(QtWebEngineCore::WebContentsAdapterClient::RedirectNavigation
*/
/*!
- \fn QWebEngineUrlRequestInterceptor::QWebEngineUrlRequestInterceptor(QObject * p = 0)
+ \fn QWebEngineUrlRequestInterceptor::QWebEngineUrlRequestInterceptor(QObject *p = nullptr)
Creates a new QWebEngineUrlRequestInterceptor object with \a p as parent.
*/
@@ -129,10 +77,11 @@ ASSERT_ENUMS_MATCH(QtWebEngineCore::WebContentsAdapterClient::RedirectNavigation
execution of this function is finished.
*/
-QWebEngineUrlRequestInfoPrivate::QWebEngineUrlRequestInfoPrivate(QWebEngineUrlRequestInfo::ResourceType resource,
- QWebEngineUrlRequestInfo::NavigationType navigation,
- const QUrl &u, const QUrl &fpu, const QUrl &i,
- const QByteArray &m)
+QWebEngineUrlRequestInfoPrivate::QWebEngineUrlRequestInfoPrivate(
+ QWebEngineUrlRequestInfo::ResourceType resource,
+ QWebEngineUrlRequestInfo::NavigationType navigation, const QUrl &u, const QUrl &fpu,
+ const QUrl &i, const QByteArray &m, QtWebEngineCore::ResourceRequestBody *const rb,
+ const QHash<QByteArray, QByteArray> &h)
: resourceType(resource)
, navigationType(navigation)
, shouldBlockRequest(false)
@@ -142,6 +91,8 @@ QWebEngineUrlRequestInfoPrivate::QWebEngineUrlRequestInfoPrivate(QWebEngineUrlRe
, initiator(i)
, method(m)
, changed(false)
+ , extraHeaders(h)
+ , resourceRequestBody(rb)
{}
/*!
@@ -152,14 +103,17 @@ QWebEngineUrlRequestInfo::QWebEngineUrlRequestInfo() {}
/*!
\internal
*/
-QWebEngineUrlRequestInfo::QWebEngineUrlRequestInfo(QWebEngineUrlRequestInfo &&p) : d_ptr(p.d_ptr.take()) {}
+QWebEngineUrlRequestInfo::QWebEngineUrlRequestInfo(QWebEngineUrlRequestInfo &&p)
+ : d_ptr(std::move(p.d_ptr))
+{
+}
/*!
\internal
*/
QWebEngineUrlRequestInfo &QWebEngineUrlRequestInfo::operator=(QWebEngineUrlRequestInfo &&p)
{
- d_ptr.reset(p.d_ptr.take());
+ d_ptr = std::move(p.d_ptr);
return *this;
}
@@ -205,6 +159,7 @@ QWebEngineUrlRequestInfo::QWebEngineUrlRequestInfo(QWebEngineUrlRequestInfoPriva
\value ResourceTypePluginResource A resource requested by a plugin. (Added in Qt 5.7)
\value ResourceTypeNavigationPreloadMainFrame A main-frame service worker navigation preload request. (Added in Qt 5.14)
\value ResourceTypeNavigationPreloadSubFrame A sub-frame service worker navigation preload request. (Added in Qt 5.14)
+ \value ResourceTypeWebSocket A WebSocket request. (Added in Qt 6.4)
\value ResourceTypeUnknown Unknown request type.
\note For forward compatibility all values not matched should be treated as unknown,
@@ -288,6 +243,20 @@ QByteArray QWebEngineUrlRequestInfo::requestMethod() const
}
/*!
+ Returns a pointer to a QIODevice that gives access to the request body.
+ The request body can contain data for example when the request is
+ a POST request. If the request body is empty the QIODevice reflects this
+ and does not return any data when performing read operations on it.
+
+ \since 6.7
+*/
+
+QIODevice *QWebEngineUrlRequestInfo::requestBody() const
+{
+ return d_ptr->resourceRequestBody;
+}
+
+/*!
\internal
*/
bool QWebEngineUrlRequestInfo::changed() const
@@ -333,8 +302,36 @@ void QWebEngineUrlRequestInfo::block(bool shouldBlock)
void QWebEngineUrlRequestInfo::setHttpHeader(const QByteArray &name, const QByteArray &value)
{
- d_ptr->changed = true;
+ // Headers are case insentive, so we need to compare manually
+ for (auto it = d_ptr->extraHeaders.begin(); it != d_ptr->extraHeaders.end(); ++it) {
+ if (it.key().compare(name, Qt::CaseInsensitive) == 0) {
+ d_ptr->extraHeaders.erase(it);
+ break;
+ }
+ }
+
d_ptr->extraHeaders.insert(name, value);
}
+/*!
+ Returns the request headers.
+ \since 6.5
+ \note Not all headers are visible at this stage as Chromium will add
+ security and proxy headers at a later stage.
+*/
+
+QHash<QByteArray, QByteArray> QWebEngineUrlRequestInfo::httpHeaders() const
+{
+ return d_ptr->extraHeaders;
+}
+
+/*!
+ \internal
+*/
+void QWebEngineUrlRequestInfoPrivate::appendFileToResourceRequestBodyForTest(const QString &path)
+{
+ if (resourceRequestBody)
+ resourceRequestBody->appendFilesForTest(path);
+}
+
QT_END_NAMESPACE
diff --git a/src/core/api/qwebengineurlrequestinfo.h b/src/core/api/qwebengineurlrequestinfo.h
index 21e44d2f1..33efcbeda 100644
--- a/src/core/api/qwebengineurlrequestinfo.h
+++ b/src/core/api/qwebengineurlrequestinfo.h
@@ -1,61 +1,29 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QWEBENGINEURLREQUESTINFO_H
#define QWEBENGINEURLREQUESTINFO_H
#include <QtWebEngineCore/qtwebenginecoreglobal.h>
-#include <QtCore/qscopedpointer.h>
#include <QtCore/qurl.h>
+#include <QtCore/qiodevice.h>
+
+#include <memory>
namespace QtWebEngineCore {
+class ContentBrowserClientQt;
class InterceptedRequest;
-class NetworkDelegateQt;
-class URLRequestNotification;
} // namespace QtWebEngineCore
+class TestPostRequestInterceptor;
+
QT_BEGIN_NAMESPACE
class QWebEngineUrlRequestInfoPrivate;
-class Q_WEBENGINECORE_EXPORT QWebEngineUrlRequestInfo {
+class Q_WEBENGINECORE_EXPORT QWebEngineUrlRequestInfo
+{
public:
enum ResourceType {
ResourceTypeMainFrame = 0, // top level page
@@ -82,6 +50,7 @@ public:
#ifndef Q_QDOC
ResourceTypeLast = ResourceTypeNavigationPreloadSubFrame,
#endif
+ ResourceTypeWebSocket = 254,
ResourceTypeUnknown = 255
};
@@ -102,16 +71,18 @@ public:
QUrl firstPartyUrl() const;
QUrl initiator() const;
QByteArray requestMethod() const;
+ QIODevice *requestBody() const;
bool changed() const;
void block(bool shouldBlock);
void redirect(const QUrl &url);
void setHttpHeader(const QByteArray &name, const QByteArray &value);
+ QHash<QByteArray, QByteArray> httpHeaders() const;
private:
- friend class QtWebEngineCore::NetworkDelegateQt;
- friend class QtWebEngineCore::URLRequestNotification;
+ friend class QtWebEngineCore::ContentBrowserClientQt;
friend class QtWebEngineCore::InterceptedRequest;
+ friend class ::TestPostRequestInterceptor;
Q_DISABLE_COPY(QWebEngineUrlRequestInfo)
Q_DECLARE_PRIVATE(QWebEngineUrlRequestInfo)
@@ -122,7 +93,7 @@ private:
QWebEngineUrlRequestInfo(QWebEngineUrlRequestInfo &&p);
QWebEngineUrlRequestInfo &operator=(QWebEngineUrlRequestInfo &&p);
~QWebEngineUrlRequestInfo();
- QScopedPointer<QWebEngineUrlRequestInfoPrivate> d_ptr;
+ std::unique_ptr<QWebEngineUrlRequestInfoPrivate> d_ptr;
};
QT_END_NAMESPACE
diff --git a/src/core/api/qwebengineurlrequestinfo_p.h b/src/core/api/qwebengineurlrequestinfo_p.h
index 206104ec9..95cc72362 100644
--- a/src/core/api/qwebengineurlrequestinfo_p.h
+++ b/src/core/api/qwebengineurlrequestinfo_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QWEBENGINEURLREQUESTINFO_P_H
#define QWEBENGINEURLREQUESTINFO_P_H
@@ -63,14 +27,22 @@ namespace net {
class URLRequest;
}
+namespace QtWebEngineCore {
+class ResourceRequestBody;
+}
+
QT_BEGIN_NAMESPACE
-class QWebEngineUrlRequestInfoPrivate {
+class Q_WEBENGINECORE_EXPORT QWebEngineUrlRequestInfoPrivate
+{
Q_DECLARE_PUBLIC(QWebEngineUrlRequestInfo)
public:
QWebEngineUrlRequestInfoPrivate(QWebEngineUrlRequestInfo::ResourceType resource,
- QWebEngineUrlRequestInfo::NavigationType navigation, const QUrl &u, const QUrl &fpu,
- const QUrl &i, const QByteArray &m);
+ QWebEngineUrlRequestInfo::NavigationType navigation,
+ const QUrl &u, const QUrl &fpu, const QUrl &i,
+ const QByteArray &m,
+ QtWebEngineCore::ResourceRequestBody *const rb = nullptr,
+ const QHash<QByteArray, QByteArray> &h = {});
QWebEngineUrlRequestInfo::ResourceType resourceType;
QWebEngineUrlRequestInfo::NavigationType navigationType;
@@ -82,8 +54,11 @@ public:
const QByteArray method;
bool changed;
QHash<QByteArray, QByteArray> extraHeaders;
+ QtWebEngineCore::ResourceRequestBody *const resourceRequestBody;
QWebEngineUrlRequestInfo *q_ptr;
+
+ void appendFileToResourceRequestBodyForTest(const QString &path);
};
QT_END_NAMESPACE
diff --git a/src/core/api/qwebengineurlrequestinterceptor.cpp b/src/core/api/qwebengineurlrequestinterceptor.cpp
new file mode 100644
index 000000000..c3cd49a5b
--- /dev/null
+++ b/src/core/api/qwebengineurlrequestinterceptor.cpp
@@ -0,0 +1,11 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qwebengineurlrequestinterceptor.h"
+
+QT_BEGIN_NAMESPACE
+
+// Has to stay empty till Qt7
+QWebEngineUrlRequestInterceptor::~QWebEngineUrlRequestInterceptor() = default;
+
+QT_END_NAMESPACE
diff --git a/src/core/api/qwebengineurlrequestinterceptor.h b/src/core/api/qwebengineurlrequestinterceptor.h
index 4d3020306..2ca8ee914 100644
--- a/src/core/api/qwebengineurlrequestinterceptor.h
+++ b/src/core/api/qwebengineurlrequestinterceptor.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QWEBENINGEURLREQUESTINTERCEPTOR_H
#define QWEBENINGEURLREQUESTINTERCEPTOR_H
@@ -43,19 +7,16 @@
#include <QtWebEngineCore/qtwebenginecoreglobal.h>
#include <QtWebEngineCore/qwebengineurlrequestinfo.h>
-#include <QtCore/qbytearray.h>
-#include <QtCore/qhash.h>
#include <QtCore/qobject.h>
-#include <QtCore/qurl.h>
QT_BEGIN_NAMESPACE
-class Q_WEBENGINECORE_EXPORT QWebEngineUrlRequestInterceptor : public QObject {
+class Q_WEBENGINECORE_EXPORT QWebEngineUrlRequestInterceptor : public QObject
+{
Q_OBJECT
- Q_DISABLE_COPY(QWebEngineUrlRequestInterceptor)
public:
explicit QWebEngineUrlRequestInterceptor(QObject *p = nullptr) : QObject(p) {}
-
+ ~QWebEngineUrlRequestInterceptor() override;
virtual void interceptRequest(QWebEngineUrlRequestInfo &info) = 0;
};
diff --git a/src/core/api/qwebengineurlrequestjob.cpp b/src/core/api/qwebengineurlrequestjob.cpp
index 3bb9d1732..b3997a49d 100644
--- a/src/core/api/qwebengineurlrequestjob.cpp
+++ b/src/core/api/qwebengineurlrequestjob.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qwebengineurlrequestjob.h"
@@ -148,7 +112,36 @@ QMap<QByteArray, QByteArray> QWebEngineUrlRequestJob::requestHeaders() const
}
/*!
- Replies to the request with \a device and the MIME type \a contentType.
+ Returns a pointer to a QIODevice that gives access to the request body.
+ The request body can contain data for example when the request is
+ a POST request. If the request body is empty the QIODevice reflects this
+ and does not return any data when performing read operations on it.
+
+ \since 6.7
+ \sa QIODevice
+*/
+QIODevice *QWebEngineUrlRequestJob::requestBody() const
+{
+ return d_ptr->requestBody();
+}
+
+/*!
+ \since 6.6
+ Set \a additionalResponseHeaders. These additional headers of the response
+ are only used when QWebEngineUrlRequestJob::reply(const QByteArray&, QIODevice*)
+ is called.
+*/
+void QWebEngineUrlRequestJob::setAdditionalResponseHeaders(
+ const QMultiMap<QByteArray, QByteArray> &additionalResponseHeaders) const
+{
+ d_ptr->setAdditionalResponseHeaders(additionalResponseHeaders);
+}
+
+/*!
+ Replies to the request with \a device and the content type \a contentType.
+ Content type is similar to the HTTP Content-Type header, and can either be
+ a MIME type, or a MIME type and charset encoding combined like this:
+ "text/html; charset=utf-8".
The user has to be aware that \a device will be used on another thread
until the job is deleted. In case simultaneous access from the main thread
@@ -189,3 +182,5 @@ void QWebEngineUrlRequestJob::redirect(const QUrl &url)
}
QT_END_NAMESPACE
+
+#include "moc_qwebengineurlrequestjob.cpp"
diff --git a/src/core/api/qwebengineurlrequestjob.h b/src/core/api/qwebengineurlrequestjob.h
index 6d4a9e734..a0cb48b8b 100644
--- a/src/core/api/qwebengineurlrequestjob.h
+++ b/src/core/api/qwebengineurlrequestjob.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QWEBENGINEURLREQUESTJOB_H
#define QWEBENGINEURLREQUESTJOB_H
@@ -55,7 +19,8 @@ QT_BEGIN_NAMESPACE
class QIODevice;
-class Q_WEBENGINECORE_EXPORT QWebEngineUrlRequestJob : public QObject {
+class Q_WEBENGINECORE_EXPORT QWebEngineUrlRequestJob : public QObject
+{
Q_OBJECT
public:
~QWebEngineUrlRequestJob();
@@ -74,10 +39,13 @@ public:
QByteArray requestMethod() const;
QUrl initiator() const;
QMap<QByteArray, QByteArray> requestHeaders() const;
+ QIODevice *requestBody() const;
void reply(const QByteArray &contentType, QIODevice *device);
void fail(Error error);
void redirect(const QUrl &url);
+ void setAdditionalResponseHeaders(
+ const QMultiMap<QByteArray, QByteArray> &additionalResponseHeaders) const;
private:
QWebEngineUrlRequestJob(QtWebEngineCore::URLRequestCustomJobDelegate *);
diff --git a/src/core/api/qwebengineurlscheme.cpp b/src/core/api/qwebengineurlscheme.cpp
index f73992c6b..3093c2b8e 100644
--- a/src/core/api/qwebengineurlscheme.cpp
+++ b/src/core/api/qwebengineurlscheme.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qwebengineurlscheme.h"
@@ -171,12 +135,12 @@ public:
Indicates that the URL scheme provides access to local resources. The purpose
of this flag is to prevent network content from accessing local resources.
Only schemes with the \c LocalAccessAllowed flag may load resources from a
- scheme with the \c Local flag. The only builtin schemes with this flag are \c
- file and \c qrc.
+ scheme with the \c LocalScheme flag. The only builtin scheme with this flag is \c
+ file.
\value LocalAccessAllowed
Indicates that content from this scheme should be allowed to load resources
- from schemes with the \c Local flag.
+ from schemes with the \c LocalScheme flag.
\value NoAccessAllowed
Indicates that all content from this scheme should be forced to have unique
@@ -194,10 +158,15 @@ public:
\value CorsEnabled
Enables cross-origin resource sharing (CORS) for this scheme. This flag is
- required in order to, for example, use the scheme with the \l
- {https://fetch.spec.whatwg.org/}{Fetch API}, or to deliver CSS fonts to a
- different origin. The appropriate CORS headers are generated automatically by
- the QWebEngineUrlRequestJob class. (Added in Qt 5.14)
+ required in order for content to be loaded by documents of a different origin,
+ this includes access from other schemes. The appropriate CORS headers are
+ generated automatically by the QWebEngineUrlRequestJob class. By default only
+ \c http and \c https are CORS enabled. (Added in Qt 5.14)
+
+ \value [since 6.6] FetchApiAllowed
+ Enables a URL scheme to be used by the HTML5 fetch API and \c XMLHttpRequest.send with
+ a body. By default only \c http and \c https can be send to using the Fetch API or with
+ an XMLHttpRequest with a body.
*/
QWebEngineUrlScheme::QWebEngineUrlScheme(QWebEngineUrlSchemePrivate *d) : d(d) {}
@@ -415,3 +384,5 @@ void QWebEngineUrlScheme::lockSchemes()
}
QT_END_NAMESPACE
+
+#include "moc_qwebengineurlscheme.cpp"
diff --git a/src/core/api/qwebengineurlscheme.h b/src/core/api/qwebengineurlscheme.h
index ecac44184..35498a68e 100644
--- a/src/core/api/qwebengineurlscheme.h
+++ b/src/core/api/qwebengineurlscheme.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QWEBENGINEURLSCHEME_H
#define QWEBENGINEURLSCHEME_H
@@ -54,7 +18,8 @@ QT_BEGIN_NAMESPACE
class QWebEngineUrlSchemePrivate;
-class Q_WEBENGINECORE_EXPORT QWebEngineUrlScheme {
+class Q_WEBENGINECORE_EXPORT QWebEngineUrlScheme
+{
Q_GADGET
public:
enum class Syntax {
@@ -77,6 +42,7 @@ public:
ViewSourceAllowed = 0x20,
ContentSecurityPolicyIgnored = 0x40,
CorsEnabled = 0x80,
+ FetchApiAllowed = 0x100,
};
Q_DECLARE_FLAGS(Flags, Flag)
Q_FLAG(Flags)
diff --git a/src/core/api/qwebengineurlschemehandler.cpp b/src/core/api/qwebengineurlschemehandler.cpp
index aecee5044..e01ecef49 100644
--- a/src/core/api/qwebengineurlschemehandler.cpp
+++ b/src/core/api/qwebengineurlschemehandler.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qwebengineurlschemehandler.h"
@@ -48,9 +12,23 @@ QT_BEGIN_NAMESPACE
\brief The QWebEngineUrlSchemeHandler class is a base class for handling custom URL schemes.
\since 5.6
+ A custom scheme handler is, broadly speaking, similar to a web application
+ served over HTTP. However, because custom schemes are integrated directly
+ into the web engine, they have the advantage in terms of efficiency and security:
+ There is no need for generating and parsing HTTP messages or for transferring data
+ over sockets, nor any way to intercept or monitor the traffic.
+
To implement a custom URL scheme for QtWebEngine, you first have to create an instance of
QWebEngineUrlScheme and register it using QWebEngineUrlScheme::registerScheme().
+ As custom schemes are integrated directly into the web engine, they do not
+ necessarily need to follow the standard security rules which apply to
+ ordinary web content. Depending on the chosen configuration, content served
+ over a custom scheme may be given access to local resources, be set to
+ ignore Content-Security-Policy rules, or conversely, be denied access to any
+ other content entirely. If it is to be accessed by normal content, ensure cross-origin
+ access is enabled, and if accessed from HTTPS that it is marked as secure.
+
\note Make sure that you create and register the scheme object \e before the QGuiApplication
or QApplication object is instantiated.
@@ -66,10 +44,23 @@ QT_BEGIN_NAMESPACE
{
public:
MySchemeHandler(QObject *parent = nullptr);
- void requestStarted(QWebEngineUrlRequestJob *request)
+ void requestStarted(QWebEngineUrlRequestJob *job)
{
- // ....
+ const QByteArray method = job->requestMethod();
+ const QUrl url = job->requestUrl();
+
+ if (isValidUrl(url)) {
+ if (method == QByteArrayLiteral("GET")) {
+ job->reply(QByteArrayLiteral("text/html"), makeReply(url));
+ else // Unsupported method
+ job->fail(QWebEngineUrlRequestJob::RequestDenied);
+ } else {
+ // Invalid URL
+ job->fail(QWebEngineUrlRequestJob::UrlNotFound);
+ }
}
+ bool isValidUrl(const QUrl &url) const // ....
+ QIODevice *makeReply(const QUrl &url) // ....
};
int main(int argc, char **argv)
@@ -92,7 +83,7 @@ QT_BEGIN_NAMESPACE
\inmodule QtWebEngineCore
- \sa {QWebEngineUrlScheme}, {WebEngine Widgets WebUI Example}
+ \sa {QWebEngineUrlScheme}
*/
/*!
@@ -125,3 +116,5 @@ QWebEngineUrlSchemeHandler::~QWebEngineUrlSchemeHandler()
*/
QT_END_NAMESPACE
+
+#include "moc_qwebengineurlschemehandler.cpp"
diff --git a/src/core/api/qwebengineurlschemehandler.h b/src/core/api/qwebengineurlschemehandler.h
index 09c5b08cb..848904719 100644
--- a/src/core/api/qwebengineurlschemehandler.h
+++ b/src/core/api/qwebengineurlschemehandler.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QWEBENGINEURLSCHEMEHANDLER_H
#define QWEBENGINEURLSCHEMEHANDLER_H
@@ -44,18 +8,15 @@
#include <QtCore/qobject.h>
-namespace QtWebEngineCore {
-class URLRequestContextGetterQt;
-}
-
QT_BEGIN_NAMESPACE
class QWebEngineUrlRequestJob;
-class Q_WEBENGINECORE_EXPORT QWebEngineUrlSchemeHandler : public QObject {
+class Q_WEBENGINECORE_EXPORT QWebEngineUrlSchemeHandler : public QObject
+{
Q_OBJECT
public:
- QWebEngineUrlSchemeHandler(QObject *parent = Q_NULLPTR);
+ QWebEngineUrlSchemeHandler(QObject *parent = nullptr);
~QWebEngineUrlSchemeHandler();
virtual void requestStarted(QWebEngineUrlRequestJob *) = 0;
diff --git a/src/core/api/qwebenginewebauthuxrequest.cpp b/src/core/api/qwebenginewebauthuxrequest.cpp
new file mode 100644
index 000000000..6a79daec9
--- /dev/null
+++ b/src/core/api/qwebenginewebauthuxrequest.cpp
@@ -0,0 +1,427 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qwebenginewebauthuxrequest.h"
+#include "qwebenginewebauthuxrequest_p.h"
+#include "authenticator_request_dialog_controller.h"
+
+/*!
+ \qmltype WebEngineWebAuthUxRequest
+ \instantiates QWebEngineWebAuthUxRequest
+ \inqmlmodule QtWebEngine
+ \since QtWebEngine 6.7
+ \brief Encapsulates the data of a WebAuth UX request.
+
+ Web engine's WebAuth UX requests are passed to the user in the
+ \l WebEngineView::webAuthUxRequested() signal.
+
+ For more information about how to handle web engine authenticator requests, see the
+ \l{WebEngine Quick Nano Browser}{Nano Browser}.
+*/
+
+/*!
+ \class QWebEngineWebAuthUxRequest
+ \brief The QWebEngineWebAuthUxRequest class encapsulates the data of a WebAuth UX request.
+ \since 6.7
+
+ \inmodule QtWebEngineCore
+
+ This class contains the information and API for WebAuth UX. WebAuth may require user
+ interaction during the authentication process. These requests are handled by displaying a
+ dialog to users. QtWebEngine currently supports user verification, resident credentials,
+ and display request failure UX requests.
+
+ QWebEngineWebAuthUxRequest models a WebAuth UX request throughout its life cycle,
+ starting with showing a UX dialog, updating it's content through state changes, and
+ finally closing the dialog.
+
+ WebAuth UX requests are normally triggered when the authenticator requires user interaction.
+ It is the QWebEnginePage's responsibility to notify the application of the new WebAuth UX
+ requests, which it does by emitting the
+ \l{QWebEnginePage::webAuthUxRequested}{webAuthUxRequested} signal together with a newly
+ created QWebEngineWebAuthUxRequest. The application can then examine this request and
+ display a WebAuth UX dialog.
+
+ The QWebEngineWebAuthUxRequest object periodically emits the \l
+ {QWebEngineWebAuthUxRequest::}{stateChanged} signal to notify potential
+ observers of the current WebAuth UX states. The observers update the WebAuth dialog
+ accordingly.
+
+ For more information about how to handle web engine authenticator requests, see the
+ \l{WebEngine Widgets Simple Browser Example}{Simple Browser}.
+*/
+
+/*!
+ \struct QWebEngineWebAuthPinRequest
+ \brief The QWebEngineWebAuthPinRequest class encapsulates the data of a PIN WebAuth UX request.
+ \since 6.7
+
+ \inmodule QtWebEngineCore
+
+ This encapsulates the following information related to a PIN request made by an authenticator.
+ \list
+ \li The reason for the PIN prompt.
+ \li The error details for the PIN prompt.
+ \li The number of attempts remaining before a hard lock. Should be ignored unless
+ \l{QWebEngineWebAuthPinRequest::reason} is
+ \l{QWebEngineWebAuthUxRequest::PinEntryReason::Challenge}.
+ \li The minimum PIN length the authenticator will accept for the PIN.
+ \endlist
+ Use this structure to update the WebAuth UX dialog when the WebAuth UX state is \l
+ QWebEngineWebAuthUxRequest::WebAuthUxState::CollectPin.
+*/
+
+/*!
+ \property QWebEngineWebAuthPinRequest::reason
+ \brief The reason for the PIN prompt.
+*/
+
+/*!
+ \property QWebEngineWebAuthPinRequest::error
+ \brief The error details for the PIN prompt.
+*/
+
+/*!
+ \property QWebEngineWebAuthPinRequest::remainingAttempts
+ \brief The number of attempts remaining before a hard lock. Should be ignored unless
+ \l{QWebEngineWebAuthPinRequest::reason} is
+ \l{QWebEngineWebAuthUxRequest::PinEntryReason::Challenge}.
+*/
+
+/*!
+ \property QWebEngineWebAuthPinRequest::minPinLength
+ \brief The minimum PIN length the authenticator will accept for the PIN.
+*/
+
+/*!
+ \enum QWebEngineWebAuthUxRequest::WebAuthUxState
+
+ This enum describes the state of the current WebAuth UX request.
+
+ \value NotStarted WebAuth UX request not started yet.
+ \value SelectAccount The authenticator requires resident credential details.
+ The application needs to display an account details dialog, and
+ the user needs to select an account to proceed.
+ \value CollectPin The authenticator requires user verification.
+ The application needs to display a PIN request dialog.
+ \value FinishTokenCollection The authenticator requires token/user verification (like tap on
+ the FIDO key) to complete the process.
+ \value RequestFailed WebAuth request failed. Display error details.
+ \value Cancelled WebAuth request is cancelled. Close the WebAuth dialog.
+ \value Completed WebAuth request is completed. Close the WebAuth dialog.
+*/
+
+/*!
+ \enum QWebEngineWebAuthUxRequest::PinEntryReason
+
+ This enum describes the reasons that may prompt the authenticator to ask for a PIN.
+
+ \value Set A new PIN is being set.
+ \value Change The existing PIN must be changed before using this authenticator.
+ \value Challenge The existing PIN is being collected to prove user verification.
+*/
+
+/*!
+ \enum QWebEngineWebAuthUxRequest::PinEntryError
+
+ This enum describes the errors that may prompt the authenticator to ask for a PIN.
+
+ \value NoError No error has occurred.
+ \value InternalUvLocked Internal UV is locked, so we are falling back to PIN.
+ \value WrongPin The PIN the user entered does not match the authenticator PIN.
+ \value TooShort The new PIN the user entered is too short.
+ \value InvalidCharacters The new PIN the user entered contains invalid characters.
+ \value SameAsCurrentPin The new PIN the user entered is the same as the currently set PIN.
+*/
+
+/*!
+ \enum QWebEngineWebAuthUxRequest::RequestFailureReason
+
+ This enum describes the reason for WebAuth request failure.
+
+ \value Timeout The authentication session has timed out.
+ \value KeyNotRegistered Key is not registered with the authenticator.
+ \value KeyAlreadyRegistered Key is already registered with the authenticator.
+ Try to register with another Key or use another authenticator.
+ \value SoftPinBlock The authenticator is blocked as the user entered the wrong key many times.
+ \value HardPinBlock The authenticator is blocked as the user entered the wrong key many times
+ and reset the PIN to use the specific authenticator again.
+ \value AuthenticatorRemovedDuringPinEntry Authenticator removed during PIN entry.
+ \value AuthenticatorMissingResidentKeys Authenticator doesn't have resident key support.
+ \value AuthenticatorMissingUserVerification Authenticator doesn't
+ have user verification support.
+ \value AuthenticatorMissingLargeBlob Authenticator doesn't have large blob support.
+ \value NoCommonAlgorithms No common algorithm.
+ \value StorageFull The resident credential could not be created because the
+ authenticator has insufficient storage.
+ \value UserConsentDenied User consent denied.
+ \value WinUserCancelled The user clicked \uicontrol Cancel in the native windows UI.
+*/
+
+/*!
+ \fn void QWebEngineWebAuthUxRequest::stateChanged(WebAuthUxState state)
+
+ This signal is emitted whenever the WebAuth UX's \a state changes.
+
+ \sa state, WebAuthUxState
+*/
+
+/*!
+ \qmlsignal void WebEngineWebAuthUxRequest::stateChanged(WebAuthUxState state)
+ This signal is emitted whenever the WebAuth UX's \a state changes.
+
+ \sa state, QWebEngineWebAuthUxRequest::WebAuthUxState
+*/
+
+/*! \internal
+ */
+QWebEngineWebAuthUxRequestPrivate::QWebEngineWebAuthUxRequestPrivate(
+ QtWebEngineCore::AuthenticatorRequestDialogController *controller)
+ : webAuthDialogController(controller)
+{
+ m_currentState = controller->state();
+}
+
+/*! \internal
+ */
+QWebEngineWebAuthUxRequestPrivate::~QWebEngineWebAuthUxRequestPrivate() { }
+
+/*! \internal
+ */
+QWebEngineWebAuthUxRequest::QWebEngineWebAuthUxRequest(QWebEngineWebAuthUxRequestPrivate *p)
+ : d_ptr(p)
+{
+ connect(d_ptr->webAuthDialogController,
+ &QtWebEngineCore::AuthenticatorRequestDialogController::stateChanged,
+ [this](WebAuthUxState currentState) {
+ Q_D(QWebEngineWebAuthUxRequest);
+ d->m_currentState = currentState;
+ Q_EMIT stateChanged(d->m_currentState);
+ });
+}
+
+/*! \internal
+ */
+QWebEngineWebAuthUxRequest::~QWebEngineWebAuthUxRequest() { }
+
+/*!
+ \qmlproperty stringlist WebEngineWebAuthUxRequest::userNames
+ \brief The available user names for the resident credential support.
+
+ This is needed when the current WebAuth request's UX state is
+ WebEngineWebAuthUxRequest.WebAuthUxState.SelectAccount. The
+ WebAuth dialog displays user names. The user needs to select an
+ account to proceed.
+
+ \sa state setSelectedAccount() QWebEngineWebAuthUxRequest::userNames
+*/
+/*!
+ \property QWebEngineWebAuthUxRequest::userNames
+ \brief The available user names for the resident credential support.
+ This is needed when the current WebAuth request's UX state is \l SelectAccount.
+ The WebAuth dialog displays user names. The user needs to select an account to proceed.
+
+ \sa SelectAccount setSelectedAccount()
+*/
+QStringList QWebEngineWebAuthUxRequest::userNames() const
+{
+ const Q_D(QWebEngineWebAuthUxRequest);
+
+ return d->webAuthDialogController->userNames();
+}
+
+/*!
+ \qmlproperty string WebEngineWebAuthUxRequest::relyingPartyId
+ \brief The WebAuth request's relying party id.
+*/
+/*!
+ \property QWebEngineWebAuthUxRequest::relyingPartyId
+ \brief The WebAuth request's relying party id.
+*/
+QString QWebEngineWebAuthUxRequest::relyingPartyId() const
+{
+ const Q_D(QWebEngineWebAuthUxRequest);
+
+ return d->webAuthDialogController->relyingPartyId();
+}
+
+/*!
+ \qmlproperty QWebEngineWebAuthPinRequest WebEngineWebAuthUxRequest::pinRequest
+ \brief The WebAuth request's PIN request information.
+
+ \sa QWebEngineWebAuthPinRequest
+*/
+/*!
+ \property QWebEngineWebAuthUxRequest::pinRequest
+ \brief The WebAuth request's PIN request information.
+
+ This is needed when the current WebAuth request state is \l CollectPin.
+ WebAuth Dialog displays a PIN request dialog. The user needs to enter a PIN and
+ invoke \l setPin() to proceed.
+
+ \sa QWebEngineWebAuthPinRequest CollectPin setPin()
+*/
+QWebEngineWebAuthPinRequest QWebEngineWebAuthUxRequest::pinRequest() const
+{
+ const Q_D(QWebEngineWebAuthUxRequest);
+
+ return d->webAuthDialogController->pinRequest();
+}
+
+/*!
+ \qmlproperty enumeration WebEngineWebAuthUxRequest::state
+ \brief The WebAuth request's current UX state.
+
+ \value WebEngineWebAuthUxRequest.WebAuthUxState.NotStarted WebAuth UX request not started yet.
+ \value WebEngineWebAuthUxRequest.WebAuthUxState.SelectAccount The authenticator requires
+ resident credential details. The application needs to display an account details dialog,
+ and the user needs to select an account to proceed.
+ \value WebEngineWebAuthUxRequest.WebAuthUxState.CollectPin The authenticator requires user verification.
+ The application needs to display a PIN request dialog.
+ \value WebEngineWebAuthUxRequest.WebAuthUxState.FinishTokenCollection The authenticator requires
+ token/user verification (like tap on the FIDO key) to complete the process.
+ \value WebEngineWebAuthUxRequest.WebAuthUxState.RequestFailed WebAuth request failed. Display error details.
+ \value WebEngineWebAuthUxRequest.WebAuthUxState.Cancelled WebAuth request is cancelled.
+ Close the WebAuth dialog.
+ \value WebEngineWebAuthUxRequest.WebAuthUxState.Completed WebAuth request is completed.
+ Close the WebAuth dialog.
+*/
+/*!
+ \property QWebEngineWebAuthUxRequest::state
+ \brief The WebAuth request's current UX state.
+
+ \l stateChanged() is emitted when the current state changes.
+ Update the WebAuth dialog in reponse to the changes in state.
+*/
+QWebEngineWebAuthUxRequest::WebAuthUxState QWebEngineWebAuthUxRequest::state() const
+{
+ return d_ptr->m_currentState;
+}
+
+/*!
+ \qmlmethod void WebEngineWebAuthUxRequest::setSelectedAccount(const QString &selectedAccount)
+
+ Sends the \a selectedAccount name to the authenticator.
+ This is needed when the current WebAuth request's UX state is
+ WebEngineWebAuthUxRequest.WebAuthUxState.SelectAccount. The
+ WebAuth request is blocked until the user selects an account and
+ invokes this method.
+
+ \sa WebEngineWebAuthUxRequest::userNames state
+*/
+/*!
+ Sends the \a selectedAccount name to the authenticator.
+ This is needed when the current WebAuth request's UX state is \l SelectAccount.
+ The WebAuth request is blocked until the user selects an account and invokes this method.
+
+ \sa userNames SelectAccount
+*/
+void QWebEngineWebAuthUxRequest::setSelectedAccount(const QString &selectedAccount)
+{
+ Q_D(QWebEngineWebAuthUxRequest);
+
+ d->webAuthDialogController->sendSelectAccountResponse(selectedAccount);
+}
+
+/*!
+ \qmlmethod void WebEngineWebAuthUxRequest::setPin(const QString &pin)
+ Sends the \a pin to the authenticator that prompts for a PIN.
+ This is needed when the current WebAuth request's UX state is
+ WebEngineWebAuthUxRequest.WebAuthUxState.CollectPin. The WebAuth
+ request is blocked until the user responds with a PIN.
+
+ \sa QWebEngineWebAuthPinRequest state
+*/
+/*!
+ Sends the \a pin to the authenticator that prompts for a PIN.
+ This is needed when the current WebAuth request's UX state is \l CollectPin.
+ The WebAuth request is blocked until the user responds with a PIN.
+
+ \sa QWebEngineWebAuthPinRequest CollectPin
+*/
+void QWebEngineWebAuthUxRequest::setPin(const QString &pin)
+{
+ Q_D(QWebEngineWebAuthUxRequest);
+ d->webAuthDialogController->sendCollectPinResponse(pin);
+}
+
+/*!
+ \qmlmethod void WebEngineWebAuthUxRequest::cancel()
+ Cancels the current WebAuth request.
+
+ \sa QWebEngineWebAuthUxRequest::Cancelled, WebEngineWebAuthUxRequest::stateChanged()
+*/
+/*!
+ Cancels the current WebAuth request.
+
+ \sa QWebEngineWebAuthUxRequest::Cancelled, stateChanged()
+*/
+void QWebEngineWebAuthUxRequest::cancel()
+{
+ Q_D(QWebEngineWebAuthUxRequest);
+
+ d->webAuthDialogController->reject();
+}
+
+/*!
+ \qmlmethod void WebEngineWebAuthUxRequest::retry()
+ Retries the current WebAuth request.
+
+ \sa stateChanged()
+*/
+/*!
+ Retries the current WebAuth request.
+
+ \sa stateChanged()
+*/
+void QWebEngineWebAuthUxRequest::retry()
+{
+ const Q_D(QWebEngineWebAuthUxRequest);
+
+ d->webAuthDialogController->retryRequest();
+}
+
+/*!
+ \qmlproperty enumeration WebEngineWebAuthUxRequest::requestFailureReason
+ \brief The WebAuth request's failure reason.
+
+ \value WebEngineWebAuthUxRequest.RequestFailureReason.Timeout The authentication session has timed out.
+ \value WebEngineWebAuthUxRequest.RequestFailureReason.KeyNotRegistered Key is not registered with the authenticator.
+ \value WebEngineWebAuthUxRequest.RequestFailureReason.KeyAlreadyRegistered Key is already registered with
+ the authenticator. Try to register with another key or use another authenticator.
+ \value WebEngineWebAuthUxRequest.RequestFailureReason.SoftPinBlock The authenticator is blocked as the user
+ entered the wrong key many times.
+ \value WebEngineWebAuthUxRequest.RequestFailureReason.HardPinBlock The authenticator is blocked as the user entered
+ the wrong key many times and reset the PIN to use the specific authenticator again.
+ \value WebEngineWebAuthUxRequest.RequestFailureReason.AuthenticatorRemovedDuringPinEntry Authenticator
+ removed during PIN entry.
+ \value WebEngineWebAuthUxRequest.RequestFailureReason.AuthenticatorMissingResidentKeys Authenticator doesn't
+ have resident key support.
+ \value WebEngineWebAuthUxRequest.RequestFailureReason.AuthenticatorMissingUserVerification Authenticator doesn't
+ have user verification support.
+ \value WebEngineWebAuthUxRequest.RequestFailureReason.AuthenticatorMissingLargeBlob Authenticator doesn't have
+ large blob support.
+ \value WebEngineWebAuthUxRequest.RequestFailureReason.NoCommonAlgorithms No common algorithm.
+ \value WebEngineWebAuthUxRequest.RequestFailureReason.StorageFull The resident credential could not be created
+ because the authenticator has insufficient storage.
+ \value WebEngineWebAuthUxRequest.RequestFailureReason.UserConsentDenied User consent denied.
+ \value WebEngineWebAuthUxRequest.RequestFailureReason.WinUserCancelled The user clicked \uicontrol Cancel
+ in the native windows UI.
+
+ \sa stateChanged()
+*/
+/*!
+ \property QWebEngineWebAuthUxRequest::requestFailureReason
+ \brief The WebAuth request's failure reason.
+
+ \sa stateChanged() QWebEngineWebAuthUxRequest::RequestFailureReason
+*/
+QWebEngineWebAuthUxRequest::RequestFailureReason
+QWebEngineWebAuthUxRequest::requestFailureReason() const
+{
+ const Q_D(QWebEngineWebAuthUxRequest);
+
+ return d->webAuthDialogController->requestFailureReason();
+}
+
+#include "moc_qwebenginewebauthuxrequest.cpp"
diff --git a/src/core/api/qwebenginewebauthuxrequest.h b/src/core/api/qwebenginewebauthuxrequest.h
new file mode 100644
index 000000000..111f52847
--- /dev/null
+++ b/src/core/api/qwebenginewebauthuxrequest.h
@@ -0,0 +1,117 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QWEBENGINEWEBAUTHUXREQUEST_H
+#define QWEBENGINEWEBAUTHUXREQUEST_H
+
+#include <QtWebEngineCore/qtwebenginecoreglobal.h>
+#include <QtCore/qobject.h>
+
+namespace QtWebEngineCore {
+class AuthenticatorRequestDialogControllerPrivate;
+}
+
+QT_BEGIN_NAMESPACE
+
+class QWebEngineWebAuthUxRequestPrivate;
+struct QWebEngineWebAuthPinRequest;
+
+class Q_WEBENGINECORE_EXPORT QWebEngineWebAuthUxRequest : public QObject
+{
+ Q_OBJECT
+
+ Q_PROPERTY(QStringList userNames READ userNames CONSTANT FINAL)
+ Q_PROPERTY(WebAuthUxState state READ state NOTIFY stateChanged FINAL)
+ Q_PROPERTY(QString relyingPartyId READ relyingPartyId CONSTANT FINAL)
+ Q_PROPERTY(QWebEngineWebAuthPinRequest pinRequest READ pinRequest CONSTANT FINAL)
+ Q_PROPERTY(RequestFailureReason requestFailureReason READ requestFailureReason CONSTANT FINAL)
+ Q_CLASSINFO("RegisterEnumClassesUnscoped", "false")
+public:
+ enum class WebAuthUxState {
+ NotStarted,
+ SelectAccount,
+ CollectPin,
+ FinishTokenCollection,
+ RequestFailed,
+ Cancelled,
+ Completed,
+ };
+ Q_ENUM(WebAuthUxState)
+
+ enum class PinEntryReason {
+ Set,
+ Change,
+ Challenge,
+ };
+ Q_ENUM(PinEntryReason)
+
+ enum class PinEntryError {
+ NoError,
+ InternalUvLocked,
+ WrongPin,
+ TooShort,
+ InvalidCharacters,
+ SameAsCurrentPin,
+ };
+ Q_ENUM(PinEntryError)
+
+ enum class RequestFailureReason {
+ Timeout,
+ KeyNotRegistered,
+ KeyAlreadyRegistered,
+ SoftPinBlock,
+ HardPinBlock,
+ AuthenticatorRemovedDuringPinEntry,
+ AuthenticatorMissingResidentKeys,
+ AuthenticatorMissingUserVerification,
+ AuthenticatorMissingLargeBlob,
+ NoCommonAlgorithms,
+ StorageFull,
+ UserConsentDenied,
+ WinUserCancelled,
+ };
+ Q_ENUM(RequestFailureReason)
+
+ ~QWebEngineWebAuthUxRequest() override;
+
+ QStringList userNames() const;
+ QString relyingPartyId() const;
+ QWebEngineWebAuthPinRequest pinRequest() const;
+ WebAuthUxState state() const;
+ RequestFailureReason requestFailureReason() const;
+
+Q_SIGNALS:
+ void stateChanged(QWebEngineWebAuthUxRequest::WebAuthUxState state);
+
+public Q_SLOTS:
+ void cancel();
+ void retry();
+ void setSelectedAccount(const QString &selectedAccount);
+ void setPin(const QString &pin);
+
+protected:
+ explicit QWebEngineWebAuthUxRequest(QWebEngineWebAuthUxRequestPrivate *);
+
+ std::unique_ptr<QWebEngineWebAuthUxRequestPrivate> d_ptr;
+ friend class QtWebEngineCore::AuthenticatorRequestDialogControllerPrivate;
+ Q_DECLARE_PRIVATE(QWebEngineWebAuthUxRequest)
+};
+
+struct QWebEngineWebAuthPinRequest
+{
+ Q_GADGET_EXPORT(Q_WEBENGINECORE_EXPORT)
+
+ Q_PROPERTY(QWebEngineWebAuthUxRequest::PinEntryReason reason MEMBER reason CONSTANT FINAL)
+ Q_PROPERTY(QWebEngineWebAuthUxRequest::PinEntryError error MEMBER error CONSTANT FINAL)
+ Q_PROPERTY(qint32 minPinLength MEMBER minPinLength CONSTANT FINAL)
+ Q_PROPERTY(int remainingAttempts MEMBER remainingAttempts CONSTANT FINAL)
+public:
+ QWebEngineWebAuthUxRequest::PinEntryReason reason;
+ QWebEngineWebAuthUxRequest::PinEntryError error;
+ qint32 minPinLength;
+ int remainingAttempts;
+};
+
+QT_END_NAMESPACE
+
+#endif // QWEBENGINEWEBAUTHUXREQUEST_H
diff --git a/src/core/api/qwebenginewebauthuxrequest_p.h b/src/core/api/qwebenginewebauthuxrequest_p.h
new file mode 100644
index 000000000..4c685bac7
--- /dev/null
+++ b/src/core/api/qwebenginewebauthuxrequest_p.h
@@ -0,0 +1,43 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QWEBENGINEWEBAUTHUXREQUEST_P_H
+#define QWEBENGINEWEBAUTHUXREQUEST_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qtwebenginecoreglobal_p.h"
+#include "qwebenginewebauthuxrequest.h"
+#include <QtCore/QSharedPointer>
+
+namespace QtWebEngineCore {
+class WebContentsAdapterClient;
+class AuthenticatorRequestDialogController;
+}
+
+QT_BEGIN_NAMESPACE
+
+class Q_WEBENGINECORE_EXPORT QWebEngineWebAuthUxRequestPrivate
+{
+
+public:
+ QWebEngineWebAuthUxRequestPrivate(
+ QtWebEngineCore::AuthenticatorRequestDialogController *controller);
+ ~QWebEngineWebAuthUxRequestPrivate();
+
+ QWebEngineWebAuthUxRequest::WebAuthUxState m_currentState =
+ QWebEngineWebAuthUxRequest::WebAuthUxState::NotStarted;
+ QtWebEngineCore::AuthenticatorRequestDialogController *webAuthDialogController;
+};
+
+QT_END_NAMESPACE
+#endif // QWEBENGINEWEBAUTHUXREQUEST_P_H
diff --git a/src/core/authentication_dialog_controller.cpp b/src/core/authentication_dialog_controller.cpp
index e37ffab44..4efd5dad3 100644
--- a/src/core/authentication_dialog_controller.cpp
+++ b/src/core/authentication_dialog_controller.cpp
@@ -1,46 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "authentication_dialog_controller.h"
#include "authentication_dialog_controller_p.h"
-#include "base/task/post_task.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/browser_task_traits.h"
@@ -53,7 +16,7 @@ AuthenticationDialogControllerPrivate::AuthenticationDialogControllerPrivate(bas
void AuthenticationDialogControllerPrivate::dialogFinished(bool accepted, const QString &user, const QString &password)
{
- base::PostTask(FROM_HERE, {content::BrowserThread::UI},
+ content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
base::BindOnce(&LoginDelegateQt::sendAuthToRequester,
loginDelegate, accepted, user, password));
}
diff --git a/src/core/authentication_dialog_controller.h b/src/core/authentication_dialog_controller.h
index 631a95c34..944ec4d15 100644
--- a/src/core/authentication_dialog_controller.h
+++ b/src/core/authentication_dialog_controller.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
//
// W A R N I N G
@@ -51,15 +15,14 @@
#ifndef AUTHENTICATION_DIALOG_CONTROLLER_H
#define AUTHENTICATION_DIALOG_CONTROLLER_H
-#include "qtwebenginecoreglobal_p.h"
-
+#include <QtWebEngineCore/private/qtwebenginecoreglobal_p.h>
#include <QObject>
namespace QtWebEngineCore {
class AuthenticationDialogControllerPrivate;
-class Q_WEBENGINECORE_PRIVATE_EXPORT AuthenticationDialogController : public QObject {
+class Q_WEBENGINECORE_EXPORT AuthenticationDialogController : public QObject {
Q_OBJECT
public:
~AuthenticationDialogController();
diff --git a/src/core/authentication_dialog_controller_p.h b/src/core/authentication_dialog_controller_p.h
index 1abff576d..6c35a60dc 100644
--- a/src/core/authentication_dialog_controller_p.h
+++ b/src/core/authentication_dialog_controller_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef AUTHENTICATION_DIALOG_CONTROLLER_P_H
#define AUTHENTICATION_DIALOG_CONTROLLER_P_H
diff --git a/src/core/authenticator_request_client_delegate_qt.cpp b/src/core/authenticator_request_client_delegate_qt.cpp
new file mode 100644
index 000000000..5f9fd9ca3
--- /dev/null
+++ b/src/core/authenticator_request_client_delegate_qt.cpp
@@ -0,0 +1,247 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "authenticator_request_client_delegate_qt.h"
+#include "authenticator_request_dialog_controller.h"
+#include "authenticator_request_dialog_controller_p.h"
+#include "base/base64.h"
+#include "profile_adapter_client.h"
+#include "profile_qt.h"
+#include "content/public/browser/web_contents.h"
+#include "web_contents_delegate_qt.h"
+#include "type_conversion.h"
+
+namespace QtWebEngineCore {
+
+using RequestFailureReason = QWebEngineWebAuthUxRequest::RequestFailureReason;
+
+WebAuthenticationDelegateQt::WebAuthenticationDelegateQt() = default;
+
+WebAuthenticationDelegateQt::~WebAuthenticationDelegateQt() = default;
+
+bool WebAuthenticationDelegateQt::SupportsResidentKeys(content::RenderFrameHost *render_frame_host)
+{
+ return true;
+}
+
+AuthenticatorRequestClientDelegateQt::AuthenticatorRequestClientDelegateQt(
+ content::RenderFrameHost *render_frame_host)
+ : m_renderFrameHost(render_frame_host), m_weakFactory(this)
+{
+ m_dialogController.reset(new AuthenticatorRequestDialogController(
+ new AuthenticatorRequestDialogControllerPrivate(m_renderFrameHost,
+ m_weakFactory.GetWeakPtr())));
+}
+
+AuthenticatorRequestClientDelegateQt::~AuthenticatorRequestClientDelegateQt()
+{
+ // Currently WebAuth request is completed. Now it is possible to delete the dialog if displayed
+ m_dialogController->finishRequest();
+}
+
+void AuthenticatorRequestClientDelegateQt::SetRelyingPartyId(const std::string &rp_id)
+{
+ m_dialogController->setRelyingPartyId(rp_id);
+}
+
+bool AuthenticatorRequestClientDelegateQt::DoesBlockRequestOnFailure(
+ InterestingFailureReason reason)
+{
+ if (!IsWebAuthnUIEnabled())
+ return false;
+
+ switch (reason) {
+ case InterestingFailureReason::kTimeout:
+ m_dialogController->handleRequestFailure(RequestFailureReason::Timeout);
+ break;
+ case InterestingFailureReason::kAuthenticatorMissingResidentKeys:
+ m_dialogController->handleRequestFailure(
+ RequestFailureReason::AuthenticatorMissingResidentKeys);
+ break;
+ case InterestingFailureReason::kAuthenticatorMissingUserVerification:
+ m_dialogController->handleRequestFailure(
+ RequestFailureReason::AuthenticatorMissingUserVerification);
+ break;
+ case InterestingFailureReason::kAuthenticatorMissingLargeBlob:
+ m_dialogController->handleRequestFailure(
+ RequestFailureReason::AuthenticatorMissingLargeBlob);
+ break;
+ case InterestingFailureReason::kAuthenticatorRemovedDuringPINEntry:
+ m_dialogController->handleRequestFailure(
+ RequestFailureReason::AuthenticatorRemovedDuringPinEntry);
+ break;
+ case InterestingFailureReason::kHardPINBlock:
+ m_dialogController->handleRequestFailure(RequestFailureReason::HardPinBlock);
+ break;
+ case InterestingFailureReason::kSoftPINBlock:
+ m_dialogController->handleRequestFailure(RequestFailureReason::SoftPinBlock);
+ break;
+ case InterestingFailureReason::kKeyAlreadyRegistered:
+ m_dialogController->handleRequestFailure(RequestFailureReason::KeyAlreadyRegistered);
+ break;
+ case InterestingFailureReason::kKeyNotRegistered:
+ m_dialogController->handleRequestFailure(RequestFailureReason::KeyNotRegistered);
+ break;
+ case InterestingFailureReason::kNoCommonAlgorithms:
+ m_dialogController->handleRequestFailure(RequestFailureReason::NoCommonAlgorithms);
+ break;
+ case InterestingFailureReason::kStorageFull:
+ m_dialogController->handleRequestFailure(RequestFailureReason::StorageFull);
+ break;
+ case InterestingFailureReason::kUserConsentDenied:
+ m_dialogController->handleRequestFailure(RequestFailureReason::UserConsentDenied);
+ break;
+ case InterestingFailureReason::kWinUserCancelled:
+#if BUILDFLAG(IS_WIN)
+ m_dialogController->handleRequestFailure(RequestFailureReason::WinUserCancelled);
+#else
+ return false;
+#endif
+ break;
+ default:
+ return false;
+ }
+ return true;
+}
+void AuthenticatorRequestClientDelegateQt::RegisterActionCallbacks(
+ base::OnceClosure cancel_callback, base::RepeatingClosure start_over_callback,
+ AccountPreselectedCallback account_preselected_callback,
+ device::FidoRequestHandlerBase::RequestCallback request_callback,
+ base::RepeatingClosure bluetooth_adapter_power_on_callback)
+{
+ m_cancelCallback = std::move(cancel_callback);
+ m_startOverCallback = std::move(start_over_callback);
+ m_accountPreselectedCallback = std::move(account_preselected_callback);
+ m_requestCallback = std::move(request_callback);
+ m_bluetoothAdapterPowerOnCallback = std::move(bluetooth_adapter_power_on_callback);
+}
+
+void AuthenticatorRequestClientDelegateQt::ShouldReturnAttestation(
+ const std::string &relying_party_id, const device::FidoAuthenticator *authenticator,
+ bool is_enterprise_attestation, base::OnceCallback<void(bool)> callback)
+{
+ std::move(callback).Run(!is_enterprise_attestation);
+}
+
+void AuthenticatorRequestClientDelegateQt::SelectAccount(
+ std::vector<device::AuthenticatorGetAssertionResponse> responses,
+ base::OnceCallback<void(device::AuthenticatorGetAssertionResponse)> callback)
+{
+ if (m_isUiDisabled) {
+ // Requests with UI disabled should never reach account selection.
+ DCHECK(IsVirtualEnvironmentEnabled());
+ std::move(callback).Run(std::move(responses.at(0)));
+ return;
+ }
+
+ if (m_isConditionalRequest) {
+ return;
+ }
+
+ m_authenticatorGetAssertionResponse = std::move(responses);
+ m_selectAccountCallback = std::move(callback);
+
+ QStringList userList;
+ int nIndex = -1;
+ for (const auto &response : m_authenticatorGetAssertionResponse) {
+ nIndex++;
+ const auto &user_entity = response.user_entity;
+ const bool has_user_identifying_info = user_entity && user_entity->name;
+ if (has_user_identifying_info) {
+ QString userName = toQt(*response.user_entity->name);
+ m_userMap[userName] = nIndex;
+ userList.append(userName);
+ }
+ }
+ m_dialogController->selectAccount(userList);
+}
+
+void AuthenticatorRequestClientDelegateQt::DisableUI()
+{
+ m_isUiDisabled = true;
+}
+
+bool AuthenticatorRequestClientDelegateQt::IsWebAuthnUIEnabled()
+{
+ return !m_isUiDisabled;
+}
+
+void AuthenticatorRequestClientDelegateQt::SetConditionalRequest(bool is_conditional)
+{
+ m_isConditionalRequest = is_conditional;
+}
+
+// This method will not be invoked until the observer is set.
+void AuthenticatorRequestClientDelegateQt::OnTransportAvailabilityEnumerated(
+ device::FidoRequestHandlerBase::TransportAvailabilityInfo data)
+{
+ // Show dialog only after this step;
+ // If m_isUiDisabled is set or another UI request in progress return
+ if (m_isUiDisabled
+ || m_dialogController->state() != QWebEngineWebAuthUxRequest::WebAuthUxState::NotStarted)
+ return;
+
+ // Start WebAuth UX
+ // we may need to pass data as well. for SelectAccount and SupportPin it is not required,
+ // skipping that for the timebeing.
+ m_dialogController->startRequest(m_isConditionalRequest);
+}
+
+bool AuthenticatorRequestClientDelegateQt::SupportsPIN() const
+{
+ return true;
+}
+
+void AuthenticatorRequestClientDelegateQt::CollectPIN(
+ CollectPINOptions options, base::OnceCallback<void(std::u16string)> provide_pin_cb)
+{
+
+ m_providePinCallback = std::move(provide_pin_cb);
+ QWebEngineWebAuthPinRequest pinRequestInfo;
+
+ pinRequestInfo.reason = static_cast<QWebEngineWebAuthUxRequest::PinEntryReason>(options.reason);
+ pinRequestInfo.error = static_cast<QWebEngineWebAuthUxRequest::PinEntryError>(options.error);
+ pinRequestInfo.remainingAttempts = options.attempts;
+ pinRequestInfo.minPinLength = options.min_pin_length;
+ m_dialogController->collectPin(pinRequestInfo);
+}
+
+void AuthenticatorRequestClientDelegateQt::FinishCollectToken()
+{
+ m_dialogController->finishCollectToken();
+}
+
+void AuthenticatorRequestClientDelegateQt::onCancelRequest()
+{
+ if (!m_cancelCallback)
+ return;
+
+ std::move(m_cancelCallback).Run();
+}
+
+void AuthenticatorRequestClientDelegateQt::onSelectAccount(const QString &selectedAccount)
+{
+ if (!m_selectAccountCallback)
+ return;
+
+ if (m_userMap.find(selectedAccount) != m_userMap.end()) {
+ std::move(m_selectAccountCallback)
+ .Run(std::move(m_authenticatorGetAssertionResponse.at(m_userMap[selectedAccount])));
+ } else {
+ onCancelRequest();
+ }
+}
+
+void AuthenticatorRequestClientDelegateQt::onCollectPin(const QString &pin)
+{
+ if (!m_providePinCallback)
+ return;
+ std::move(m_providePinCallback).Run(pin.toStdU16String());
+}
+
+void AuthenticatorRequestClientDelegateQt::onRetryRequest()
+{
+ DCHECK(m_startOverCallback);
+ m_startOverCallback.Run();
+}
+}
diff --git a/src/core/authenticator_request_client_delegate_qt.h b/src/core/authenticator_request_client_delegate_qt.h
new file mode 100644
index 000000000..05c6136bd
--- /dev/null
+++ b/src/core/authenticator_request_client_delegate_qt.h
@@ -0,0 +1,96 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef AUTHENTICATOR_REQUEST_CLIENT_DELEGATE_QT_H
+#define AUTHENTICATOR_REQUEST_CLIENT_DELEGATE_QT_H
+
+#include "qtwebenginecoreglobal_p.h"
+#include "content/public/browser/authenticator_request_client_delegate.h"
+#include <unordered_map>
+#include <QSharedPointer>
+
+namespace QtWebEngineCore {
+
+class AuthenticatorRequestDialogController;
+
+class WebAuthenticationDelegateQt : public content::WebAuthenticationDelegate
+{
+public:
+ WebAuthenticationDelegateQt();
+ virtual ~WebAuthenticationDelegateQt();
+
+ bool SupportsResidentKeys(content::RenderFrameHost *render_frame_host) override;
+};
+
+class AuthenticatorRequestClientDelegateQt : public content::AuthenticatorRequestClientDelegate
+{
+public:
+ explicit AuthenticatorRequestClientDelegateQt(content::RenderFrameHost *render_frame_host);
+ AuthenticatorRequestClientDelegateQt(const AuthenticatorRequestClientDelegateQt &) = delete;
+ AuthenticatorRequestClientDelegateQt &
+ operator=(const AuthenticatorRequestClientDelegateQt &) = delete;
+ ~AuthenticatorRequestClientDelegateQt();
+
+ // content::AuthenticatorRequestClientDelegate ovverrides
+ void SetRelyingPartyId(const std::string &rp_id) override;
+ bool DoesBlockRequestOnFailure(InterestingFailureReason reason) override;
+ void RegisterActionCallbacks(base::OnceClosure cancel_callback,
+ base::RepeatingClosure start_over_callback,
+ AccountPreselectedCallback account_preselected_callback,
+ device::FidoRequestHandlerBase::RequestCallback request_callback,
+ base::RepeatingClosure bluetooth_adapter_power_on_callback) override;
+ void ShouldReturnAttestation(const std::string &relying_party_id,
+ const device::FidoAuthenticator *authenticator,
+ bool is_enterprise_attestation,
+ base::OnceCallback<void(bool)> callback) override;
+ void SelectAccount(
+ std::vector<device::AuthenticatorGetAssertionResponse> responses,
+ base::OnceCallback<void(device::AuthenticatorGetAssertionResponse)> callback) override;
+ void DisableUI() override;
+ bool IsWebAuthnUIEnabled() override;
+ void SetConditionalRequest(bool is_conditional) override;
+
+ // device::FidoRequestHandlerBase::Observer overrides:
+ // This method will not be invoked until the observer is set.
+ void OnTransportAvailabilityEnumerated(
+ device::FidoRequestHandlerBase::TransportAvailabilityInfo data) override;
+
+ bool SupportsPIN() const override;
+ void CollectPIN(CollectPINOptions options,
+ base::OnceCallback<void(std::u16string)> provide_pin_cb) override;
+ void FinishCollectToken() override;
+
+ // Dialog helper
+ void onCancelRequest();
+ void onSelectAccount(const QString &selectedAccount);
+ void onCollectPin(const QString &pin);
+ void onRetryRequest();
+
+private:
+ content::RenderFrameHost *m_renderFrameHost;
+ bool m_isUiDisabled = false;
+ bool m_isConditionalRequest = false;
+
+ base::OnceClosure m_cancelCallback;
+ base::RepeatingClosure m_startOverCallback;
+ AccountPreselectedCallback m_accountPreselectedCallback;
+ device::FidoRequestHandlerBase::RequestCallback m_requestCallback;
+ base::RepeatingClosure m_bluetoothAdapterPowerOnCallback;
+
+ // Select account details;
+ std::vector<device::AuthenticatorGetAssertionResponse> m_authenticatorGetAssertionResponse;
+ std::unordered_map<QString, int> m_userMap;
+ base::OnceCallback<void(device::AuthenticatorGetAssertionResponse)> m_selectAccountCallback;
+
+ // collect pin
+ base::OnceCallback<void(std::u16string)> m_providePinCallback;
+
+ // This member is used to keep authenticator request dialog controller alive until
+ // authenticator request is completed or cancelled.
+ QSharedPointer<AuthenticatorRequestDialogController> m_dialogController;
+ base::WeakPtrFactory<AuthenticatorRequestClientDelegateQt> m_weakFactory;
+};
+
+}
+
+#endif // AUTHENTICATOR_REQUEST_CLIENT_DELEGATE_QT_H
diff --git a/src/core/authenticator_request_dialog_controller.cpp b/src/core/authenticator_request_dialog_controller.cpp
new file mode 100644
index 000000000..73fb4e7f3
--- /dev/null
+++ b/src/core/authenticator_request_dialog_controller.cpp
@@ -0,0 +1,302 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "authenticator_request_dialog_controller.h"
+#include "authenticator_request_dialog_controller_p.h"
+#include "content/public/browser/render_frame_host.h"
+#include "content/public/browser/web_contents.h"
+#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/browser_task_traits.h"
+#include "web_contents_delegate_qt.h"
+#include "qwebenginewebauthuxrequest_p.h"
+#include "qwebenginewebauthuxrequest.h"
+
+using PinEntryError = QWebEngineWebAuthUxRequest::PinEntryError;
+using PinEntryReason = QWebEngineWebAuthUxRequest::PinEntryReason;
+using WebAuthUxState = QWebEngineWebAuthUxRequest::WebAuthUxState;
+
+namespace QtWebEngineCore {
+
+ASSERT_ENUMS_MATCH(PinEntryReason::Set, device::pin::PINEntryReason::kSet)
+ASSERT_ENUMS_MATCH(PinEntryReason::Change, device::pin::PINEntryReason::kChange)
+ASSERT_ENUMS_MATCH(PinEntryReason::Challenge, device::pin::PINEntryReason::kChallenge)
+ASSERT_ENUMS_MATCH(PinEntryError::WrongPin, device::pin::PINEntryError::kWrongPIN)
+ASSERT_ENUMS_MATCH(PinEntryError::TooShort, device::pin::PINEntryError::kTooShort)
+ASSERT_ENUMS_MATCH(PinEntryError::SameAsCurrentPin, device::pin::PINEntryError::kSameAsCurrentPIN)
+ASSERT_ENUMS_MATCH(PinEntryError::NoError, device::pin::PINEntryError::kNoError)
+ASSERT_ENUMS_MATCH(PinEntryError::InvalidCharacters, device::pin::PINEntryError::kInvalidCharacters)
+ASSERT_ENUMS_MATCH(PinEntryError::InternalUvLocked, device::pin::PINEntryError::kInternalUvLocked)
+
+AuthenticatorRequestDialogControllerPrivate::AuthenticatorRequestDialogControllerPrivate(
+ content::RenderFrameHost *renderFrameHost,
+ base::WeakPtr<AuthenticatorRequestClientDelegateQt> authenticatorRequestDelegate)
+ : m_renderFrameHost(renderFrameHost)
+ , m_authenticatorRequestDelegate(authenticatorRequestDelegate)
+{
+}
+
+AuthenticatorRequestDialogControllerPrivate::~AuthenticatorRequestDialogControllerPrivate()
+{
+ if (m_request) {
+ delete m_request;
+ m_request = nullptr;
+ }
+}
+
+void AuthenticatorRequestDialogControllerPrivate::showWebAuthDialog()
+{
+ Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+
+ content::WebContents *webContent = content::WebContents::FromRenderFrameHost(m_renderFrameHost);
+
+ if (!webContent)
+ return;
+
+ WebContentsAdapterClient *adapterClient = nullptr;
+ if (webContent)
+ adapterClient =
+ static_cast<WebContentsDelegateQt *>(webContent->GetDelegate())->adapterClient();
+
+ if (adapterClient) {
+
+ QWebEngineWebAuthUxRequestPrivate *itemPrivate =
+ new QWebEngineWebAuthUxRequestPrivate(q_ptr);
+
+ m_request = new QWebEngineWebAuthUxRequest(itemPrivate);
+
+ adapterClient->showWebAuthDialog(m_request);
+ m_isDialogCreated = true;
+ } else {
+ cancelRequest();
+ }
+}
+
+void AuthenticatorRequestDialogControllerPrivate::selectAccount(const QStringList &userList)
+{
+ m_userList.clear();
+ m_userList = userList;
+ setCurrentState(WebAuthUxState::SelectAccount);
+}
+
+void AuthenticatorRequestDialogControllerPrivate::collectPin(QWebEngineWebAuthPinRequest pinRequest)
+{
+ m_pinRequest = pinRequest;
+ setCurrentState(WebAuthUxState::CollectPin);
+}
+
+void AuthenticatorRequestDialogControllerPrivate::finishCollectToken()
+{
+ setCurrentState(WebAuthUxState::FinishTokenCollection);
+}
+
+QStringList AuthenticatorRequestDialogControllerPrivate::userNames() const
+{
+ return m_userList;
+}
+
+void AuthenticatorRequestDialogControllerPrivate::finishRequest()
+{
+ if (!m_isDialogCreated)
+ return;
+ setCurrentState(WebAuthUxState::Completed);
+}
+
+void AuthenticatorRequestDialogControllerPrivate::setCurrentState(
+ QWebEngineWebAuthUxRequest::WebAuthUxState uxState)
+{
+ if (!m_isStarted) {
+ // Dialog isn't showing yet. Remember to show this step when it appears.
+ m_pendingState = uxState;
+ return;
+ }
+
+ m_currentState = uxState;
+
+ if (m_isConditionalRequest)
+ return;
+
+ if (!m_isDialogCreated) {
+ showWebAuthDialog();
+ } else {
+ Q_EMIT q_ptr->stateChanged(m_currentState);
+
+ if (m_currentState == QWebEngineWebAuthUxRequest::WebAuthUxState::Cancelled
+ || m_currentState == QWebEngineWebAuthUxRequest::WebAuthUxState::Completed) {
+ m_isDialogCreated = false;
+ }
+ }
+}
+
+void AuthenticatorRequestDialogControllerPrivate::cancelRequest()
+{
+ setCurrentState(WebAuthUxState::Cancelled);
+ content::GetUIThreadTaskRunner({})->PostTask(
+ FROM_HERE,
+ base::BindOnce(&AuthenticatorRequestClientDelegateQt::onCancelRequest,
+ m_authenticatorRequestDelegate));
+}
+
+void AuthenticatorRequestDialogControllerPrivate::retryRequest()
+{
+ content::GetUIThreadTaskRunner({})->PostTask(
+ FROM_HERE,
+ base::BindOnce(&AuthenticatorRequestClientDelegateQt::onRetryRequest,
+ m_authenticatorRequestDelegate));
+}
+
+void AuthenticatorRequestDialogControllerPrivate::sendSelectAccountResponse(
+ const QString &selectedAccount)
+{
+ content::GetUIThreadTaskRunner({})->PostTask(
+ FROM_HERE,
+ base::BindOnce(&AuthenticatorRequestClientDelegateQt::onSelectAccount,
+ m_authenticatorRequestDelegate, selectedAccount));
+}
+
+QWebEngineWebAuthUxRequest::WebAuthUxState
+AuthenticatorRequestDialogControllerPrivate::state() const
+{
+ return m_currentState;
+}
+
+void AuthenticatorRequestDialogControllerPrivate::startRequest(bool isConditionalRequest)
+{
+ DCHECK(!m_isStarted);
+
+ m_isStarted = true;
+ m_isConditionalRequest = isConditionalRequest;
+
+ if (m_pendingState) {
+ setCurrentState(*m_pendingState);
+ m_pendingState.reset();
+ }
+}
+
+void AuthenticatorRequestDialogControllerPrivate::setRelyingPartyId(const QString &rpId)
+{
+ m_relyingPartyId = rpId;
+}
+
+QString AuthenticatorRequestDialogControllerPrivate::relyingPartyId() const
+{
+ return m_relyingPartyId;
+}
+
+QWebEngineWebAuthPinRequest AuthenticatorRequestDialogControllerPrivate::pinRequest()
+{
+ return m_pinRequest;
+}
+
+void AuthenticatorRequestDialogControllerPrivate::handleRequestFailure(
+ QWebEngineWebAuthUxRequest::RequestFailureReason reason)
+{
+ m_requestFailureReason = reason;
+ setCurrentState(WebAuthUxState::RequestFailed);
+}
+
+void AuthenticatorRequestDialogControllerPrivate::sendCollectPinResponse(const QString &pin)
+{
+ content::GetUIThreadTaskRunner({})->PostTask(
+ FROM_HERE,
+ base::BindOnce(&AuthenticatorRequestClientDelegateQt::onCollectPin,
+ m_authenticatorRequestDelegate, pin));
+}
+
+QWebEngineWebAuthUxRequest::RequestFailureReason
+AuthenticatorRequestDialogControllerPrivate::requestFailureReason() const
+{
+ return m_requestFailureReason;
+}
+
+AuthenticatorRequestDialogController::AuthenticatorRequestDialogController(
+ AuthenticatorRequestDialogControllerPrivate *dd)
+{
+ Q_ASSERT(dd);
+ d_ptr.reset(dd);
+ d_ptr->q_ptr = this;
+}
+
+AuthenticatorRequestDialogController::~AuthenticatorRequestDialogController() { }
+
+void AuthenticatorRequestDialogController::selectAccount(const QStringList &userList)
+{
+ d_ptr->selectAccount(userList);
+}
+
+void AuthenticatorRequestDialogController::collectPin(QWebEngineWebAuthPinRequest pinRequest)
+{
+ d_ptr->collectPin(pinRequest);
+}
+
+QStringList AuthenticatorRequestDialogController::userNames() const
+{
+ return d_ptr->userNames();
+}
+
+QWebEngineWebAuthPinRequest AuthenticatorRequestDialogController::pinRequest()
+{
+ return d_ptr->pinRequest();
+}
+
+void AuthenticatorRequestDialogController::reject()
+{
+ d_ptr->cancelRequest();
+}
+
+void AuthenticatorRequestDialogController::sendSelectAccountResponse(const QString &account)
+{
+ d_ptr->sendSelectAccountResponse(account);
+}
+
+void AuthenticatorRequestDialogController::finishCollectToken()
+{
+ d_ptr->finishCollectToken();
+}
+
+void AuthenticatorRequestDialogController::finishRequest()
+{
+ d_ptr->finishRequest();
+}
+
+QWebEngineWebAuthUxRequest::WebAuthUxState AuthenticatorRequestDialogController::state() const
+{
+ return d_ptr->state();
+}
+
+void AuthenticatorRequestDialogController::startRequest(bool bIsConditionalRequest)
+{
+ d_ptr->startRequest(bIsConditionalRequest);
+}
+
+void AuthenticatorRequestDialogController::setRelyingPartyId(const std::string &rpId)
+{
+ d_ptr->setRelyingPartyId(QString::fromStdString(rpId));
+}
+
+QString AuthenticatorRequestDialogController::relyingPartyId() const
+{
+ return d_ptr->relyingPartyId();
+}
+
+void AuthenticatorRequestDialogController::handleRequestFailure(
+ QWebEngineWebAuthUxRequest::RequestFailureReason reason)
+{
+ d_ptr->handleRequestFailure(reason);
+}
+
+void AuthenticatorRequestDialogController::retryRequest()
+{
+ d_ptr->retryRequest();
+}
+
+void AuthenticatorRequestDialogController::sendCollectPinResponse(const QString &pin)
+{
+ d_ptr->sendCollectPinResponse(pin);
+}
+
+QWebEngineWebAuthUxRequest::RequestFailureReason
+AuthenticatorRequestDialogController::requestFailureReason() const
+{
+ return d_ptr->requestFailureReason();
+}
+}
diff --git a/src/core/authenticator_request_dialog_controller.h b/src/core/authenticator_request_dialog_controller.h
new file mode 100644
index 000000000..98e8dcf90
--- /dev/null
+++ b/src/core/authenticator_request_dialog_controller.h
@@ -0,0 +1,53 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef AUTHENTICATOR_REQUEST_DIALOG_CONTROLLER_H
+#define AUTHENTICATOR_REQUEST_DIALOG_CONTROLLER_H
+
+#include <QtWebEngineCore/private/qtwebenginecoreglobal_p.h>
+#include <QtCore/qobject.h>
+#include "qwebenginewebauthuxrequest.h"
+
+namespace content {
+class WebContents;
+class RenderFrameHost;
+}
+namespace QtWebEngineCore {
+
+class AuthenticatorRequestDialogControllerPrivate;
+
+class Q_WEBENGINECORE_EXPORT AuthenticatorRequestDialogController : public QObject
+{
+ Q_OBJECT
+public:
+ ~AuthenticatorRequestDialogController();
+ void sendSelectAccountResponse(const QString &account);
+ void sendCollectPinResponse(const QString &pin);
+ QStringList userNames() const;
+ QWebEngineWebAuthPinRequest pinRequest();
+ void reject();
+ AuthenticatorRequestDialogController(AuthenticatorRequestDialogControllerPrivate *);
+
+ QWebEngineWebAuthUxRequest::WebAuthUxState state() const;
+ QString relyingPartyId() const;
+ void retryRequest();
+ QWebEngineWebAuthUxRequest::RequestFailureReason requestFailureReason() const;
+
+Q_SIGNALS:
+ void stateChanged(QWebEngineWebAuthUxRequest::WebAuthUxState state);
+
+private:
+ void selectAccount(const QStringList &userList);
+ void collectPin(QWebEngineWebAuthPinRequest pinRequest);
+ void finishCollectToken();
+ void startRequest(bool bIsConditionalRequest);
+ void finishRequest();
+ void setRelyingPartyId(const std::string &rpId);
+ void handleRequestFailure(QWebEngineWebAuthUxRequest::RequestFailureReason reason);
+
+ QScopedPointer<AuthenticatorRequestDialogControllerPrivate> d_ptr;
+ friend class AuthenticatorRequestClientDelegateQt;
+};
+}
+
+#endif // AUTHENTICATOR_REQUEST_DIALOG_CONTROLLER_H
diff --git a/src/core/authenticator_request_dialog_controller_p.h b/src/core/authenticator_request_dialog_controller_p.h
new file mode 100644
index 000000000..5e7333d56
--- /dev/null
+++ b/src/core/authenticator_request_dialog_controller_p.h
@@ -0,0 +1,78 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef AUTHENTICATOR_REQUEST_DIALOG_CONTROLLER_P_H
+#define AUTHENTICATOR_REQUEST_DIALOG_CONTROLLER_P_H
+#include <QStringList>
+#include <QSharedPointer>
+#include "authenticator_request_client_delegate_qt.h"
+#include "authenticator_request_dialog_controller.h"
+
+namespace content {
+class WebContents;
+class RenderFrameHost;
+}
+
+namespace QtWebEngineCore {
+
+class AuthenticatorRequestDialogControllerPrivate
+{
+
+public:
+ AuthenticatorRequestDialogControllerPrivate(
+ content::RenderFrameHost *renderFrameHost,
+ base::WeakPtr<AuthenticatorRequestClientDelegateQt> authenticatorRequestDelegate);
+ ~AuthenticatorRequestDialogControllerPrivate();
+ void showWebAuthDialog();
+ void selectAccount(const QStringList &userList);
+ QStringList userNames() const;
+ QString relyingPartyId() const;
+ QWebEngineWebAuthUxRequest::WebAuthUxState state() const;
+ QWebEngineWebAuthPinRequest pinRequest();
+ QWebEngineWebAuthUxRequest::RequestFailureReason requestFailureReason() const;
+ void sendSelectAccountResponse(const QString &selectedAccount);
+ void setCurrentState(QWebEngineWebAuthUxRequest::WebAuthUxState uxState);
+ void setRelyingPartyId(const QString &rpId);
+
+ // Support pin functionality
+ void collectPin(QWebEngineWebAuthPinRequest pinRequestInfo);
+ void finishCollectToken();
+ void handleRequestFailure(QWebEngineWebAuthUxRequest::RequestFailureReason reason);
+ void sendCollectPinResponse(const QString &pin);
+
+ // Deleting dialog;
+ void finishRequest();
+
+ // cancel request
+ void cancelRequest();
+ void retryRequest();
+ void startRequest(bool isConditionalRequest);
+
+ AuthenticatorRequestDialogController *q_ptr;
+
+private:
+ content::RenderFrameHost *m_renderFrameHost;
+ QStringList m_userList;
+ QString m_pin;
+ QString m_relyingPartyId;
+
+ bool m_isStarted = false;
+ bool m_isConditionalRequest = false;
+ QWebEngineWebAuthUxRequest::WebAuthUxState m_currentState =
+ QWebEngineWebAuthUxRequest::WebAuthUxState::NotStarted;
+ base::WeakPtr<AuthenticatorRequestClientDelegateQt> m_authenticatorRequestDelegate;
+ bool m_isDialogCreated = false;
+ QWebEngineWebAuthPinRequest m_pinRequest;
+
+ QWebEngineWebAuthUxRequest *m_request = nullptr;
+ QWebEngineWebAuthUxRequest::RequestFailureReason m_requestFailureReason;
+
+ // m_pendingState holds requested steps until the UI is shown. The UI is only
+ // shown once the TransportAvailabilityInfo is available, but authenticators
+ // may request, e.g., PIN entry prior to that.
+ absl::optional<QWebEngineWebAuthUxRequest::WebAuthUxState> m_pendingState;
+};
+
+} // namespace QtWebEngineCore
+
+#endif // AUTHENTICATOR_REQUEST_DIALOG_CONTROLLER_P_H
diff --git a/src/core/autofill_client_qt.cpp b/src/core/autofill_client_qt.cpp
new file mode 100644
index 000000000..3bdc62e19
--- /dev/null
+++ b/src/core/autofill_client_qt.cpp
@@ -0,0 +1,147 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "autofill_client_qt.h"
+
+#include "autofill_popup_controller.h"
+#include "autofill_popup_controller_p.h"
+#include "render_widget_host_view_qt.h"
+#include "type_conversion.h"
+#include "web_contents_adapter_client.h"
+#include "web_contents_view_qt.h"
+
+#include "chrome/browser/profiles/profile.h"
+#include "components/autofill/core/common/autofill_prefs.h"
+#include "content/browser/web_contents/web_contents_impl.h"
+#include "services/network/public/cpp/shared_url_loader_factory.h"
+
+namespace QtWebEngineCore {
+
+void AutofillClientQt::CreateForWebContents(content::WebContents *contents)
+{
+ DCHECK(contents);
+ if (!FromWebContents(contents))
+ contents->SetUserData(UserDataKey(), base::WrapUnique(new AutofillClientQt(contents)));
+}
+
+AutofillClientQt::AutofillClientQt(content::WebContents *webContents)
+ : autofill::ContentAutofillClient(
+ webContents, base::BindRepeating(&autofill::BrowserDriverInitHook, this, ""))
+ , content::WebContentsObserver(webContents)
+ , m_popupController(new AutofillPopupController(new AutofillPopupControllerPrivate))
+{
+}
+
+AutofillClientQt::~AutofillClientQt() { }
+
+autofill::PersonalDataManager *AutofillClientQt::GetPersonalDataManager()
+{
+ return nullptr;
+}
+
+autofill::AutocompleteHistoryManager *AutofillClientQt::GetAutocompleteHistoryManager()
+{
+ return nullptr;
+}
+
+PrefService *AutofillClientQt::GetPrefs()
+{
+ return const_cast<PrefService *>(std::as_const(*this).GetPrefs());
+}
+
+const PrefService *AutofillClientQt::GetPrefs() const
+{
+ Profile *profile = Profile::FromBrowserContext(web_contents()->GetBrowserContext());
+ return profile->GetPrefs();
+}
+
+void AutofillClientQt::ShowAutofillPopup(const autofill::AutofillClient::PopupOpenArgs &open_args,
+ base::WeakPtr<autofill::AutofillPopupDelegate> delegate)
+{
+ m_popupController->d->delegate = delegate;
+ m_popupController->d->suggestions = open_args.suggestions;
+ m_popupController->updateModel();
+
+ bool autoSelectFirstSuggestion =
+ open_args.trigger_source == autofill::AutofillSuggestionTriggerSource::kTextFieldDidReceiveKeyDown;
+
+ adapterClient()->showAutofillPopup(m_popupController.data(),
+ QRect(toQt(gfx::ToEnclosingRect(open_args.element_bounds))),
+ autoSelectFirstSuggestion);
+}
+
+void AutofillClientQt::UpdateAutofillPopupDataListValues(const std::vector<std::u16string> &values,
+ const std::vector<std::u16string> &labels)
+{
+ Q_UNUSED(labels);
+
+ if (values.empty())
+ HideAutofillPopup(autofill::PopupHidingReason::kNoSuggestions);
+}
+
+void AutofillClientQt::PinPopupView()
+{
+ // Called by password_manager component only.
+ NOTIMPLEMENTED();
+}
+
+autofill::AutofillClient::PopupOpenArgs AutofillClientQt::GetReopenPopupArgs(autofill::AutofillSuggestionTriggerSource trigger_source) const
+{
+ // Called by password_manager component only.
+ NOTIMPLEMENTED();
+ return autofill::AutofillClient::PopupOpenArgs();
+}
+
+std::vector<autofill::Suggestion> AutofillClientQt::GetPopupSuggestions() const
+{
+ // Called by password_manager component only.
+ NOTIMPLEMENTED();
+ return {};
+}
+
+void AutofillClientQt::UpdatePopup(const std::vector<autofill::Suggestion> &, autofill::PopupType, autofill::AutofillSuggestionTriggerSource)
+{
+ // Called by password_manager component only.
+ NOTIMPLEMENTED();
+}
+
+void AutofillClientQt::HideAutofillPopup(autofill::PopupHidingReason)
+{
+ adapterClient()->hideAutofillPopup();
+}
+
+bool AutofillClientQt::IsAutocompleteEnabled() const
+{
+ return autofill::prefs::IsAutocompleteEnabled(GetPrefs());
+}
+
+bool AutofillClientQt::IsPasswordManagerEnabled()
+{
+ return false;
+}
+
+bool AutofillClientQt::IsOffTheRecord()
+{
+ return web_contents()->GetBrowserContext()->IsOffTheRecord();
+}
+
+scoped_refptr<network::SharedURLLoaderFactory> AutofillClientQt::GetURLLoaderFactory()
+{
+ return nullptr;
+}
+
+void AutofillClientQt::PropagateAutofillPredictionsDeprecated(autofill::AutofillDriver *,
+ const std::vector<autofill::FormStructure *> &)
+{
+ // For testing purposes only.
+ NOTIMPLEMENTED();
+}
+
+WebContentsAdapterClient *AutofillClientQt::adapterClient()
+{
+ return WebContentsViewQt::from(
+ static_cast<content::WebContentsImpl *>(web_contents())->GetView())
+ ->client();
+}
+
+} // namespace QtWebEngineCore
diff --git a/src/core/autofill_client_qt.h b/src/core/autofill_client_qt.h
new file mode 100644
index 000000000..cd38de462
--- /dev/null
+++ b/src/core/autofill_client_qt.h
@@ -0,0 +1,76 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#ifndef AUTOFILL_CLIENT_QT_H
+#define AUTOFILL_CLIENT_QT_H
+
+#include <string>
+#include <vector>
+
+#include "base/memory/weak_ptr.h"
+#include "components/autofill/content/browser/content_autofill_client.h"
+#include "content/public/browser/web_contents_observer.h"
+#include "content/public/browser/web_contents_user_data.h"
+
+#include <QScopedPointer>
+
+namespace QtWebEngineCore {
+
+class AutofillPopupController;
+class WebContentsAdapterClient;
+
+class AutofillClientQt : public autofill::ContentAutofillClient,
+ public content::WebContentsObserver
+{
+public:
+ ~AutofillClientQt() override;
+
+ static void CreateForWebContents(content::WebContents *contents);
+
+ // autofill::AutofillClient overrides:
+ autofill::PersonalDataManager *GetPersonalDataManager() override;
+ autofill::AutocompleteHistoryManager *GetAutocompleteHistoryManager() override;
+ PrefService *GetPrefs() override;
+ const PrefService *GetPrefs() const override;
+
+ void ShowAutofillPopup(const autofill::AutofillClient::PopupOpenArgs &open_args,
+ base::WeakPtr<autofill::AutofillPopupDelegate> delegate) override;
+ void UpdateAutofillPopupDataListValues(const std::vector<std::u16string> &values,
+ const std::vector<std::u16string> &labels) override;
+ void PinPopupView() override;
+ PopupOpenArgs GetReopenPopupArgs(
+ autofill::AutofillSuggestionTriggerSource trigger_source) const override;
+ std::vector<autofill::Suggestion> GetPopupSuggestions() const override;
+ void UpdatePopup(const std::vector<autofill::Suggestion>& suggestions,
+ autofill::PopupType popup_type,
+ autofill::AutofillSuggestionTriggerSource trigger_source) override;
+ void HideAutofillPopup(autofill::PopupHidingReason reason) override;
+ bool IsAutocompleteEnabled() const override;
+ bool IsPasswordManagerEnabled() override;
+ void PropagateAutofillPredictionsDeprecated(autofill::AutofillDriver *,
+ const std::vector<autofill::FormStructure *> &) override;
+ bool IsOffTheRecord() override;
+ scoped_refptr<network::SharedURLLoaderFactory> GetURLLoaderFactory() override;
+
+private:
+ explicit AutofillClientQt(content::WebContents *webContents);
+
+ WebContentsAdapterClient *adapterClient();
+
+ QScopedPointer<AutofillPopupController> m_popupController;
+};
+
+} // namespace QtWebEngineCore
+
+#endif // AUTOFILL_CLIENT_QT_H
diff --git a/src/core/autofill_popup_controller.cpp b/src/core/autofill_popup_controller.cpp
new file mode 100644
index 000000000..a6baf5fc2
--- /dev/null
+++ b/src/core/autofill_popup_controller.cpp
@@ -0,0 +1,113 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "autofill_popup_controller.h"
+#include "autofill_popup_controller_p.h"
+
+#include "components/autofill/core/browser/ui/autofill_popup_delegate.h"
+#include "components/autofill/core/browser/ui/suggestion.h"
+
+namespace QtWebEngineCore {
+
+AutofillPopupController::AutofillPopupController(AutofillPopupControllerPrivate *dd)
+{
+ Q_ASSERT(dd);
+ d.reset(dd);
+}
+
+AutofillPopupController::~AutofillPopupController() { }
+
+void AutofillPopupController::setCurrentIndex(const QModelIndex &index)
+{
+ if (m_currentIndex == index)
+ return;
+
+ m_currentIndex = index;
+
+ if (m_currentIndex.isValid()) {
+ const autofill::Suggestion &suggestion = d->suggestions[m_currentIndex.row()];
+ d->delegate->DidSelectSuggestion(suggestion, autofill::AutofillSuggestionTriggerSource::kFormControlElementClicked);
+ }
+
+ Q_EMIT currentIndexChanged(index);
+}
+
+void AutofillPopupController::selectPreviousSuggestion()
+{
+ if (!m_currentIndex.isValid()) {
+ setCurrentIndex(m_model.index(m_model.rowCount() - 1, 0));
+ return;
+ }
+
+ if (m_currentIndex.row() == 0) {
+ selectLastSuggestion();
+ return;
+ }
+
+ setCurrentIndex(m_model.index(m_currentIndex.row() - 1, 0));
+}
+
+void AutofillPopupController::selectNextSuggestion()
+{
+ if (!m_currentIndex.isValid()) {
+ setCurrentIndex(m_model.index(0, 0));
+ return;
+ }
+
+ if (m_currentIndex.row() == m_model.rowCount() - 1) {
+ selectFirstSuggestion();
+ return;
+ }
+
+ setCurrentIndex(m_model.index(m_currentIndex.row() + 1, 0));
+}
+
+void AutofillPopupController::selectFirstSuggestion()
+{
+ setCurrentIndex(m_model.index(0, 0));
+}
+
+void AutofillPopupController::selectLastSuggestion()
+{
+ setCurrentIndex(m_model.index(m_model.rowCount() - 1, 0));
+}
+
+void AutofillPopupController::acceptSuggestion()
+{
+ if (!m_currentIndex.isValid())
+ return;
+
+ const int index = m_currentIndex.row();
+ const autofill::Suggestion &suggestion = d->suggestions[index];
+ d->delegate->DidAcceptSuggestion(suggestion, index, autofill::AutofillSuggestionTriggerSource::kFormControlElementClicked);
+}
+
+void AutofillPopupController::notifyPopupShown()
+{
+ d->delegate->OnPopupShown();
+}
+
+void AutofillPopupController::notifyPopupHidden()
+{
+ d->delegate->OnPopupHidden();
+}
+
+void AutofillPopupController::selectSuggestion(int index)
+{
+ if (index < 0)
+ setCurrentIndex(QModelIndex());
+ else
+ setCurrentIndex(m_model.index(index, 0));
+}
+
+void AutofillPopupController::updateModel()
+{
+ QStringList values;
+ for (size_t i = 0; i < d->suggestions.size(); ++i) {
+ values.append(QString::fromStdU16String(d->suggestions[i].main_text.value));
+ }
+ m_model.setStringList(values);
+ setCurrentIndex(QModelIndex());
+}
+
+} // namespace QtWebEngineCore
diff --git a/src/core/autofill_popup_controller.h b/src/core/autofill_popup_controller.h
new file mode 100644
index 000000000..1b4d8d7e8
--- /dev/null
+++ b/src/core/autofill_popup_controller.h
@@ -0,0 +1,62 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef AUTOFILL_POPUP_CONTROLLER_H
+#define AUTOFILL_POPUP_CONTROLLER_H
+
+#include <QtWebEngineCore/private/qtwebenginecoreglobal_p.h>
+
+#include <QModelIndex>
+#include <QObject>
+#include <QScopedPointer>
+#include <QStringListModel>
+
+namespace QtWebEngineCore {
+
+class AutofillPopupControllerPrivate;
+
+class Q_WEBENGINECORE_EXPORT AutofillPopupController : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QStringListModel *model READ model CONSTANT FINAL)
+
+public:
+ ~AutofillPopupController();
+
+ QStringListModel *model() { return &m_model; }
+
+ void selectPreviousSuggestion();
+ void selectNextSuggestion();
+ void selectFirstSuggestion();
+ void selectLastSuggestion();
+
+ void notifyPopupShown();
+ void notifyPopupHidden();
+
+public Q_SLOTS:
+ void selectSuggestion(int index);
+ void acceptSuggestion();
+
+Q_SIGNALS:
+ void currentIndexChanged(const QModelIndex &index);
+
+private:
+ AutofillPopupController(AutofillPopupControllerPrivate *);
+ QScopedPointer<AutofillPopupControllerPrivate> d;
+
+ void setCurrentIndex(const QModelIndex &index);
+
+ // Only called by AutofillClientQt:
+ void updateModel();
+
+ QStringListModel m_model;
+ QModelIndex m_currentIndex;
+
+ friend class AutofillClientQt;
+};
+
+} // namespace QtWebEngineCore
+
+Q_DECLARE_METATYPE(QtWebEngineCore::AutofillPopupController *)
+
+#endif // AUTOFILL_POPUP_CONTROLLER_H
diff --git a/src/core/autofill_popup_controller_p.h b/src/core/autofill_popup_controller_p.h
new file mode 100644
index 000000000..886fe4dcd
--- /dev/null
+++ b/src/core/autofill_popup_controller_p.h
@@ -0,0 +1,40 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef AUTOFILL_POPUP_CONTROLLER_P_H
+#define AUTOFILL_POPUP_CONTROLLER_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <vector>
+
+#include "base/memory/weak_ptr.h"
+#include "components/autofill/core/browser/ui/suggestion.h"
+
+namespace autofill {
+class AutofillPopupDelegate;
+}
+
+namespace QtWebEngineCore {
+
+class AutofillPopupControllerPrivate
+{
+public:
+ AutofillPopupControllerPrivate() = default;
+
+ base::WeakPtr<autofill::AutofillPopupDelegate> delegate = nullptr;
+ std::vector<autofill::Suggestion> suggestions;
+};
+
+} // namespace QtWebEngineCore
+
+#endif // AUTOFILL_POPUP_CONTROLLER_P_H
diff --git a/src/core/browser_accessibility_manager_qt.cpp b/src/core/browser_accessibility_manager_qt.cpp
index 5968bfd30..077856266 100644
--- a/src/core/browser_accessibility_manager_qt.cpp
+++ b/src/core/browser_accessibility_manager_qt.cpp
@@ -1,79 +1,67 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+#include "qtwebenginecoreglobal.h"
+
+#include "content/browser/accessibility/browser_accessibility_manager.h"
+
+#include <QtGui/qtguiglobal.h>
+
+#if QT_CONFIG(accessibility)
+#include "browser_accessibility_qt.h"
#include "browser_accessibility_manager_qt.h"
+#include "render_widget_host_view_qt.h" // WebContentsAccessibilityQt
+#include "content/browser/accessibility/browser_accessibility.h"
#include "ui/accessibility/ax_enums.mojom.h"
-#include "browser_accessibility_qt.h"
-using namespace blink;
+#include <QtGui/qaccessible.h>
+#endif // QT_CONFIG(accessibility)
namespace content {
-BrowserAccessibilityManager* BrowserAccessibilityManager::Create(
- const ui::AXTreeUpdate& initialTree,
- BrowserAccessibilityDelegate* delegate,
- BrowserAccessibilityFactory* factory)
+// static
+BrowserAccessibilityManager *BrowserAccessibilityManager::Create(
+ const ui::AXTreeUpdate &initialTree,
+ WebAXPlatformTreeManagerDelegate *delegate)
{
#if QT_CONFIG(accessibility)
- return new BrowserAccessibilityManagerQt(nullptr, initialTree, delegate, factory);
+ Q_ASSERT(delegate);
+ QtWebEngineCore::WebContentsAccessibilityQt *access = nullptr;
+ access = static_cast<QtWebEngineCore::WebContentsAccessibilityQt *>(delegate->AccessibilityGetWebContentsAccessibility());
+
+ // Accessibility is not supported for guest views and child frames.
+ if (!access) {
+ return nullptr;
+ }
+
+ return new BrowserAccessibilityManagerQt(access, initialTree, delegate);
#else
- delete factory;
+ Q_UNUSED(initialTree);
+ Q_UNUSED(delegate);
return nullptr;
#endif // QT_CONFIG(accessibility)
}
-BrowserAccessibility *BrowserAccessibility::Create()
+// static
+BrowserAccessibilityManager *BrowserAccessibilityManager::Create(
+ WebAXPlatformTreeManagerDelegate *delegate)
{
#if QT_CONFIG(accessibility)
- return new BrowserAccessibilityQt();
+ return BrowserAccessibilityManager::Create(BrowserAccessibilityManagerQt::GetEmptyDocument(), delegate);
#else
+ Q_UNUSED(delegate);
return nullptr;
-#endif // QT_CONFIG(accessibility)
+#endif
}
#if QT_CONFIG(accessibility)
BrowserAccessibilityManagerQt::BrowserAccessibilityManagerQt(
- QObject *parentObject, const ui::AXTreeUpdate &initialTree,
- BrowserAccessibilityDelegate* delegate, BrowserAccessibilityFactory* factory)
- : BrowserAccessibilityManager(delegate, factory)
- , m_parentObject(parentObject)
+ QtWebEngineCore::WebContentsAccessibilityQt *webContentsAccessibility,
+ const ui::AXTreeUpdate &initialTree,
+ WebAXPlatformTreeManagerDelegate* delegate)
+ : BrowserAccessibilityManager(delegate)
+ , m_webContentsAccessibility(webContentsAccessibility)
{
Initialize(initialTree);
m_valid = true; // BrowserAccessibilityQt can start using the AXTree
@@ -86,17 +74,28 @@ BrowserAccessibilityManagerQt::~BrowserAccessibilityManagerQt()
QAccessibleInterface *BrowserAccessibilityManagerQt::rootParentAccessible()
{
- return QAccessible::queryAccessibleInterface(m_parentObject);
+ content::BrowserAccessibility *parent_node = GetParentNodeFromParentTreeAsBrowserAccessibility();
+ if (!parent_node) {
+ Q_ASSERT(m_webContentsAccessibility);
+ return QAccessible::queryAccessibleInterface(m_webContentsAccessibility->accessibilityParentObject());
+ }
+
+ auto *parent_manager =
+ static_cast<BrowserAccessibilityManagerQt *>(parent_node->manager());
+ return parent_manager->rootParentAccessible();
}
void BrowserAccessibilityManagerQt::FireBlinkEvent(ax::mojom::Event event_type,
- BrowserAccessibility* node)
+ BrowserAccessibility *node,
+ int action_request_id)
{
- BrowserAccessibilityQt *iface = static_cast<BrowserAccessibilityQt*>(node);
+ auto *iface = toQAccessibleInterface(node);
switch (event_type) {
case ax::mojom::Event::kFocus: {
QAccessibleEvent event(iface, QAccessible::Focus);
+ if (event.object())
+ event.setChild(-1);
QAccessible::updateAccessibility(&event);
break;
}
@@ -104,6 +103,8 @@ void BrowserAccessibilityManagerQt::FireBlinkEvent(ax::mojom::Event event_type,
QAccessible::State change;
change.checked = true;
QAccessibleStateChangeEvent event(iface, change);
+ if (event.object())
+ event.setChild(-1);
QAccessible::updateAccessibility(&event);
break;
}
@@ -112,6 +113,8 @@ void BrowserAccessibilityManagerQt::FireBlinkEvent(ax::mojom::Event event_type,
if (QAccessibleValueInterface *valueIface = iface->valueInterface())
value = valueIface->currentValue();
QAccessibleValueChangeEvent event(iface, value);
+ if (event.object())
+ event.setChild(-1);
QAccessible::updateAccessibility(&event);
break;
}
@@ -123,6 +126,8 @@ void BrowserAccessibilityManagerQt::FireBlinkEvent(ax::mojom::Event event_type,
break;
case ax::mojom::Event::kTextChanged: {
QAccessibleTextUpdateEvent event(iface, -1, QString(), QString());
+ if (event.object())
+ event.setChild(-1);
QAccessible::updateAccessibility(&event);
break;
}
@@ -134,9 +139,13 @@ void BrowserAccessibilityManagerQt::FireBlinkEvent(ax::mojom::Event event_type,
textIface->selection(0, &start, &end);
if (start == end) {
QAccessibleTextCursorEvent event(iface, start);
+ if (event.object())
+ event.setChild(-1);
QAccessible::updateAccessibility(&event);
} else {
QAccessibleTextSelectionEvent event(iface, start, end);
+ if (event.object())
+ event.setChild(-1);
QAccessible::updateAccessibility(&event);
}
}
@@ -148,14 +157,20 @@ void BrowserAccessibilityManagerQt::FireBlinkEvent(ax::mojom::Event event_type,
}
void BrowserAccessibilityManagerQt::FireGeneratedEvent(ui::AXEventGenerator::Event event_type,
- BrowserAccessibility* node)
+ const ui::AXNode *node)
{
- BrowserAccessibilityQt *iface = static_cast<BrowserAccessibilityQt*>(node);
+ BrowserAccessibilityManager::FireGeneratedEvent(event_type, node);
+
+ BrowserAccessibility *wrapper = GetFromAXNode(node);
+ DCHECK(wrapper);
+ auto *iface = toQAccessibleInterface(wrapper);
switch (event_type) {
- case ui::AXEventGenerator::Event::VALUE_CHANGED:
+ case ui::AXEventGenerator::Event::VALUE_IN_TEXT_FIELD_CHANGED:
if (iface->role() == QAccessible::EditableText) {
QAccessibleTextUpdateEvent event(iface, -1, QString(), QString());
+ if (event.object())
+ event.setChild(-1);
QAccessible::updateAccessibility(&event);
}
break;
diff --git a/src/core/browser_accessibility_manager_qt.h b/src/core/browser_accessibility_manager_qt.h
index 6d6086811..e36edd979 100644
--- a/src/core/browser_accessibility_manager_qt.h
+++ b/src/core/browser_accessibility_manager_qt.h
@@ -1,81 +1,44 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef BROWSER_ACCESSIBILITY_MANAGER_QT_H
#define BROWSER_ACCESSIBILITY_MANAGER_QT_H
#include "content/browser/accessibility/browser_accessibility_manager.h"
-#include <QtCore/qobject.h>
-#include <QtGui/qtgui-config.h>
+#include <QtCore/qtclasshelpermacros.h>
+#include <QtCore/qtconfigmacros.h>
-#if QT_CONFIG(accessibility)
+QT_FORWARD_DECLARE_CLASS(QAccessibleInterface)
-QT_BEGIN_NAMESPACE
-class QAccessibleInterface;
-QT_END_NAMESPACE
+namespace QtWebEngineCore {
+class WebContentsAccessibilityQt;
+}
namespace content {
class BrowserAccessibilityManagerQt : public BrowserAccessibilityManager
{
public:
- BrowserAccessibilityManagerQt(QObject* parentObject,
- const ui::AXTreeUpdate& initialTree,
- BrowserAccessibilityDelegate* delegate,
- BrowserAccessibilityFactory* factory = new BrowserAccessibilityFactory());
+ BrowserAccessibilityManagerQt(QtWebEngineCore::WebContentsAccessibilityQt *webContentsAccessibility,
+ const ui::AXTreeUpdate &initialTree,
+ WebAXPlatformTreeManagerDelegate *delegate);
~BrowserAccessibilityManagerQt() override;
void FireBlinkEvent(ax::mojom::Event event_type,
- BrowserAccessibility* node) override;
+ BrowserAccessibility *node,
+ int action_request_id) override;
void FireGeneratedEvent(ui::AXEventGenerator::Event event_type,
- BrowserAccessibility* node) override;
+ const ui::AXNode *node) override;
QAccessibleInterface *rootParentAccessible();
bool isValid() const { return m_valid; }
private:
Q_DISABLE_COPY(BrowserAccessibilityManagerQt)
- QObject *m_parentObject;
+ QtWebEngineCore::WebContentsAccessibilityQt *m_webContentsAccessibility;
bool m_valid = false;
};
}
-#endif // QT_CONFIG(accessibility)
-#endif
+#endif // BROWSER_ACCESSIBILITY_MANAGER_QT_H
diff --git a/src/core/browser_accessibility_qt.cpp b/src/core/browser_accessibility_qt.cpp
index de78eb85d..de3347df3 100644
--- a/src/core/browser_accessibility_qt.cpp
+++ b/src/core/browser_accessibility_qt.cpp
@@ -1,88 +1,197 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE.Chromium file.
#include "browser_accessibility_qt.h"
-
-#if QT_CONFIG(accessibility)
-
-#include "ui/accessibility/ax_enums.mojom.h"
-
#include "browser_accessibility_manager_qt.h"
#include "qtwebenginecoreglobal_p.h"
#include "type_conversion.h"
-using namespace blink;
-using QtWebEngineCore::toQt;
+#if QT_CONFIG(accessibility)
+#include "content/browser/accessibility/browser_accessibility.h"
+#include "ui/accessibility/ax_enums.mojom.h"
-namespace content {
+#include <QtGui/qaccessible.h>
+
+namespace QtWebEngineCore {
+class BrowserAccessibilityInterface;
+
+class BrowserAccessibilityQt
+ : public content::BrowserAccessibility
+{
+public:
+ BrowserAccessibilityQt(content::BrowserAccessibilityManager *manager, ui::AXNode *node);
+ ~BrowserAccessibilityQt();
+
+ bool isReady() const;
+
+ QtWebEngineCore::BrowserAccessibilityInterface *interface = nullptr;
+};
+
+class BrowserAccessibilityInterface
+ : public QAccessibleInterface
+ , public QAccessibleActionInterface
+ , public QAccessibleTextInterface
+ , public QAccessibleValueInterface
+ , public QAccessibleTableInterface
+ , public QAccessibleTableCellInterface
+{
+public:
+ BrowserAccessibilityInterface(BrowserAccessibilityQt *chromiumInterface);
+ ~BrowserAccessibilityInterface() override;
+
+ void destroy();
+
+ // QAccessibleInterface
+ bool isValid() const override;
+ QObject *object() const override;
+ QAccessibleInterface *childAt(int x, int y) const override;
+ void *interface_cast(QAccessible::InterfaceType type) override;
+
+ // navigation, hierarchy
+ QAccessibleInterface *parent() const override;
+ QAccessibleInterface *child(int index) const override;
+ QAccessibleInterface *focusChild() const override;
+ int childCount() const override;
+ int indexOfChild(const QAccessibleInterface *) const override;
+
+ // properties and state
+ QString text(QAccessible::Text t) const override;
+ void setText(QAccessible::Text t, const QString &text) override;
+ QRect rect() const override;
+ QAccessible::Role role() const override;
+ QAccessible::State state() const override;
+
+ // QAccessibleActionInterface
+ QStringList actionNames() const override;
+ void doAction(const QString &actionName) override;
+ QStringList keyBindingsForAction(const QString &actionName) const override;
+
+ // QAccessibleTextInterface
+ void addSelection(int startOffset, int endOffset) override;
+ QString attributes(int offset, int *startOffset, int *endOffset) const override;
+ int cursorPosition() const override;
+ QRect characterRect(int offset) const override;
+ int selectionCount() const override;
+ int offsetAtPoint(const QPoint &point) const override;
+ void selection(int selectionIndex, int *startOffset, int *endOffset) const override;
+ QString text(int startOffset, int endOffset) const override;
+ void removeSelection(int selectionIndex) override;
+ void setCursorPosition(int position) override;
+ void setSelection(int selectionIndex, int startOffset, int endOffset) override;
+ int characterCount() const override;
+ void scrollToSubstring(int startIndex, int endIndex) override;
+
+ // QAccessibleValueInterface
+ QVariant currentValue() const override;
+ void setCurrentValue(const QVariant &value) override;
+ QVariant maximumValue() const override;
+ QVariant minimumValue() const override;
+ QVariant minimumStepSize() const override;
+
+ // QAccessibleTableInterface
+ QAccessibleInterface *cellAt(int row, int column) const override;
+ QAccessibleInterface *caption() const override;
+ QAccessibleInterface *summary() const override;
+ QString columnDescription(int column) const override;
+ QString rowDescription(int row) const override;
+ int columnCount() const override;
+ int rowCount() const override;
+ // selection
+ int selectedCellCount() const override;
+ int selectedColumnCount() const override;
+ int selectedRowCount() const override;
+ QList<QAccessibleInterface *> selectedCells() const override;
+ QList<int> selectedColumns() const override;
+ QList<int> selectedRows() const override;
+ bool isColumnSelected(int column) const override;
+ bool isRowSelected(int row) const override;
+ bool selectRow(int row) override;
+ bool selectColumn(int column) override;
+ bool unselectRow(int row) override;
+ bool unselectColumn(int column) override;
+
+ // QAccessibleTableCellInterface
+ int columnExtent() const override;
+ QList<QAccessibleInterface *> columnHeaderCells() const override;
+ int columnIndex() const override;
+ int rowExtent() const override;
+ QList<QAccessibleInterface *> rowHeaderCells() const override;
+ int rowIndex() const override;
+ bool isSelected() const override;
+ QAccessibleInterface *table() const override;
+
+ void modelChange(QAccessibleTableModelChangeEvent *event) override;
+
+private:
+ content::BrowserAccessibility *findTable() const;
+
+ QObject *m_object = nullptr;
+ QAccessible::Id m_id = 0;
+ BrowserAccessibilityQt *q;
+};
+
+BrowserAccessibilityQt::BrowserAccessibilityQt(content::BrowserAccessibilityManager *manager,
+ ui::AXNode *node)
+ : content::BrowserAccessibility(manager, node)
+ , interface(new BrowserAccessibilityInterface(this))
+{
+}
+
+BrowserAccessibilityQt::~BrowserAccessibilityQt()
+{
+ if (interface)
+ interface->destroy();
+}
+
+bool BrowserAccessibilityQt::isReady() const
+{
+ // FIXME: This is just a workaround, remove this when the commented out assert in
+ // BrowserAccessibilityManager::GetFromID(int32_t id) gets fixed.
+ return manager()->GetFromID(node()->id()) != nullptr;
+}
+
+BrowserAccessibilityInterface::BrowserAccessibilityInterface(BrowserAccessibilityQt *chromiumInterface)
+ : q(chromiumInterface)
+{
+ if (parent() && parent()->object()) {
+ m_object = new QObject(parent()->object());
+ QString name = toQt(q->GetAuthorUniqueId());
+ if (!name.isEmpty())
+ m_object->setObjectName(name);
+ }
-const BrowserAccessibilityQt *ToBrowserAccessibilityQt(const BrowserAccessibility *obj)
-{
- return static_cast<const BrowserAccessibilityQt *>(obj);
+ m_id = QAccessible::registerAccessibleInterface(this);
}
-QAccessibleInterface *toQAccessibleInterface(BrowserAccessibility *obj)
+BrowserAccessibilityInterface::~BrowserAccessibilityInterface()
{
- return static_cast<BrowserAccessibilityQt *>(obj);
+ q->interface = nullptr;
}
-BrowserAccessibilityQt::BrowserAccessibilityQt()
+void BrowserAccessibilityInterface::destroy()
{
- QAccessible::registerAccessibleInterface(this);
+ QAccessible::deleteAccessibleInterface(m_id);
}
-bool BrowserAccessibilityQt::isValid() const
+bool BrowserAccessibilityInterface::isValid() const
{
- auto managerQt = static_cast<BrowserAccessibilityManagerQt *>(manager_);
+ if (!q->isReady())
+ return false;
+
+ auto managerQt = static_cast<content::BrowserAccessibilityManagerQt *>(q->manager());
return managerQt && managerQt->isValid();
}
-QObject *BrowserAccessibilityQt::object() const
+QObject *BrowserAccessibilityInterface::object() const
{
- return 0;
+ return m_object;
}
-QAccessibleInterface *BrowserAccessibilityQt::childAt(int x, int y) const
+QAccessibleInterface *BrowserAccessibilityInterface::childAt(int x, int y) const
{
for (int i = 0; i < childCount(); ++i) {
QAccessibleInterface *childIface = child(i);
@@ -90,10 +199,10 @@ QAccessibleInterface *BrowserAccessibilityQt::childAt(int x, int y) const
if (childIface->rect().contains(x,y))
return childIface;
}
- return 0;
+ return nullptr;
}
-void *BrowserAccessibilityQt::interface_cast(QAccessible::InterfaceType type)
+void *BrowserAccessibilityInterface::interface_cast(QAccessible::InterfaceType type)
{
switch (type) {
case QAccessible::ActionInterface:
@@ -101,7 +210,7 @@ void *BrowserAccessibilityQt::interface_cast(QAccessible::InterfaceType type)
return static_cast<QAccessibleActionInterface*>(this);
break;
case QAccessible::TextInterface:
- if (HasState(ax::mojom::State::kEditable))
+ if (q->HasState(ax::mojom::State::kEditable))
return static_cast<QAccessibleTextInterface*>(this);
break;
case QAccessible::ValueInterface: {
@@ -123,35 +232,36 @@ void *BrowserAccessibilityQt::interface_cast(QAccessible::InterfaceType type)
}
case QAccessible::TableCellInterface: {
QAccessible::Role r = role();
- if (r == QAccessible::Cell ||
- r == QAccessible::ListItem ||
- r == QAccessible::TreeItem)
- return static_cast<QAccessibleTableCellInterface*>(this);
+ if (r == QAccessible::Cell || r == QAccessible::ListItem || r == QAccessible::TreeItem) {
+ if (findTable())
+ return static_cast<QAccessibleTableCellInterface *>(this);
+ }
break;
}
default:
break;
}
- return 0;
+ return nullptr;
}
-QAccessibleInterface *BrowserAccessibilityQt::parent() const
+QAccessibleInterface *BrowserAccessibilityInterface::parent() const
{
- BrowserAccessibility *p = PlatformGetParent();
- if (p)
- return static_cast<BrowserAccessibilityQt*>(p);
- return static_cast<BrowserAccessibilityManagerQt*>(manager())->rootParentAccessible();
+ content::BrowserAccessibility *chromiumParent = q->PlatformGetParent();
+ if (chromiumParent)
+ return toQAccessibleInterface(chromiumParent);
+ return static_cast<content::BrowserAccessibilityManagerQt*>(q->manager())->rootParentAccessible();
}
-QAccessibleInterface *BrowserAccessibilityQt::child(int index) const
+QAccessibleInterface *BrowserAccessibilityInterface::child(int index) const
{
- return static_cast<BrowserAccessibilityQt*>(BrowserAccessibility::PlatformGetChild(index));
+ content::BrowserAccessibility *chromiumChild = q->PlatformGetChild(index);
+ return chromiumChild ? toQAccessibleInterface(chromiumChild) : nullptr;
}
-QAccessibleInterface *BrowserAccessibilityQt::focusChild() const
+QAccessibleInterface *BrowserAccessibilityInterface::focusChild() const
{
if (state().focused)
- return const_cast<BrowserAccessibilityQt *>(this);
+ return const_cast<BrowserAccessibilityInterface *>(this);
for (int i = 0; i < childCount(); ++i) {
if (QAccessibleInterface *iface = child(i)->focusChild())
@@ -161,57 +271,65 @@ QAccessibleInterface *BrowserAccessibilityQt::focusChild() const
return nullptr;
}
-int BrowserAccessibilityQt::childCount() const
+int BrowserAccessibilityInterface::childCount() const
{
- return PlatformChildCount();
+ return q->PlatformChildCount();
}
-int BrowserAccessibilityQt::indexOfChild(const QAccessibleInterface *iface) const
+int BrowserAccessibilityInterface::indexOfChild(const QAccessibleInterface *iface) const
{
- const BrowserAccessibilityQt *child = static_cast<const BrowserAccessibilityQt*>(iface);
- return const_cast<BrowserAccessibilityQt *>(child)->GetIndexInParent();
+ const BrowserAccessibilityInterface *child = static_cast<const BrowserAccessibilityInterface *>(iface);
+ return const_cast<BrowserAccessibilityInterface *>(child)->q->GetIndexInParent().value();
}
-QString BrowserAccessibilityQt::text(QAccessible::Text t) const
+QString BrowserAccessibilityInterface::text(QAccessible::Text t) const
{
+ if (!q->isReady())
+ return QString();
+
switch (t) {
case QAccessible::Name:
- return toQt(GetStringAttribute(ax::mojom::StringAttribute::kName));
+ return toQt(q->GetStringAttribute(ax::mojom::StringAttribute::kName));
case QAccessible::Description:
- return toQt(GetStringAttribute(ax::mojom::StringAttribute::kDescription));
+ return toQt(q->GetStringAttribute(ax::mojom::StringAttribute::kDescription));
case QAccessible::Value:
- return toQt(GetStringAttribute(ax::mojom::StringAttribute::kValue));
+ return toQt(q->GetStringAttribute(ax::mojom::StringAttribute::kValue));
case QAccessible::Accelerator:
- return toQt(GetStringAttribute(ax::mojom::StringAttribute::kKeyShortcuts));
+ return toQt(q->GetStringAttribute(ax::mojom::StringAttribute::kKeyShortcuts));
default:
break;
}
return QString();
}
-void BrowserAccessibilityQt::setText(QAccessible::Text t, const QString &text)
+void BrowserAccessibilityInterface::setText(QAccessible::Text t, const QString &text)
{
}
-QRect BrowserAccessibilityQt::rect() const
+QRect BrowserAccessibilityInterface::rect() const
{
- if (!manager()) // needed implicitly by GetScreenBoundsRect()
+ if (!q->manager() || !q->isReady()) // needed implicitly by GetScreenBoundsRect()
return QRect();
- gfx::Rect bounds = GetUnclippedScreenBoundsRect();
+ gfx::Rect bounds = q->GetUnclippedScreenBoundsRect();
+ bounds = gfx::ScaleToRoundedRect(bounds, 1.f / q->manager()->device_scale_factor()); // FIXME: check
return QRect(bounds.x(), bounds.y(), bounds.width(), bounds.height());
}
-QAccessible::Role BrowserAccessibilityQt::role() const
+QAccessible::Role BrowserAccessibilityInterface::role() const
{
- switch (GetRole()) {
+ switch (q->GetRole()) {
case ax::mojom::Role::kNone:
case ax::mojom::Role::kUnknown:
return QAccessible::NoRole;
+ // Internal roles (matching auralinux and win)
+ case ax::mojom::Role::kKeyboard:
+ case ax::mojom::Role::kImeCandidate:
+ return QAccessible::NoRole;
+
// Used by Chromium to distinguish between the root of the tree
// for this page, and a web area for a frame within this page.
- case ax::mojom::Role::kWebArea:
case ax::mojom::Role::kWebView:
case ax::mojom::Role::kRootWebArea: // not sure if we need to make a diff here, but this seems common
return QAccessible::WebDocument;
@@ -223,8 +341,6 @@ QAccessible::Role BrowserAccessibilityQt::role() const
case ax::mojom::Role::kAlert:
case ax::mojom::Role::kAlertDialog:
return QAccessible::AlertMessage;
- case ax::mojom::Role::kAnchor:
- return QAccessible::Link;
case ax::mojom::Role::kApplication:
return QAccessible::Document; // returning Application here makes Qt return the top level app object
case ax::mojom::Role::kArticle:
@@ -261,10 +377,11 @@ QAccessible::Role BrowserAccessibilityQt::role() const
case ax::mojom::Role::kComboBoxMenuButton:
case ax::mojom::Role::kTextFieldWithComboBox:
return QAccessible::ComboBox;
+ case ax::mojom::Role::kComboBoxSelect:
+ return QAccessible::PopupMenu;
case ax::mojom::Role::kComplementary:
return QAccessible::ComplementaryContent;
case ax::mojom::Role::kComment:
- case ax::mojom::Role::kCommentSection:
return QAccessible::Section;
case ax::mojom::Role::kContentDeletion:
case ax::mojom::Role::kContentInsertion:
@@ -328,6 +445,11 @@ QAccessible::Role BrowserAccessibilityQt::role() const
case ax::mojom::Role::kDocIndex:
case ax::mojom::Role::kDocIntroduction:
case ax::mojom::Role::kDocNotice:
+ return QAccessible::Section;
+ case ax::mojom::Role::kDocPageFooter:
+ return QAccessible::Footer;
+ case ax::mojom::Role::kDocPageHeader:
+ return QAccessible::Heading;
case ax::mojom::Role::kDocPageList:
case ax::mojom::Role::kDocPart:
case ax::mojom::Role::kDocPreface:
@@ -353,7 +475,8 @@ QAccessible::Role BrowserAccessibilityQt::role() const
case ax::mojom::Role::kFigure:
return QAccessible::Section;
case ax::mojom::Role::kFooter:
- return QAccessible::Footer;
+ // CORE-AAM recommends LANDMARK instead of FOOTER.
+ return QAccessible::Section;
case ax::mojom::Role::kFooterAsNonLandmark:
return QAccessible::Section;
case ax::mojom::Role::kForm:
@@ -377,23 +500,16 @@ QAccessible::Role BrowserAccessibilityQt::role() const
return QAccessible::WebDocument;
case ax::mojom::Role::kIframePresentational:
return QAccessible::Grouping;
- case ax::mojom::Role::kIgnored:
- return QAccessible::NoRole;
case ax::mojom::Role::kImage:
return QAccessible::Graphic;
- case ax::mojom::Role::kImageMap:
- return QAccessible::Document;
case ax::mojom::Role::kInlineTextBox:
return QAccessible::StaticText;
case ax::mojom::Role::kInputTime:
return QAccessible::SpinBox;
- case ax::mojom::Role::kKeyboard:
- return QAccessible::NoRole; // FIXME
case ax::mojom::Role::kLabelText:
return QAccessible::StaticText;
case ax::mojom::Role::kLayoutTable:
case ax::mojom::Role::kLayoutTableCell:
- case ax::mojom::Role::kLayoutTableColumn:
case ax::mojom::Role::kLayoutTableRow:
return QAccessible::Section;
case ax::mojom::Role::kLegend:
@@ -423,7 +539,50 @@ QAccessible::Role BrowserAccessibilityQt::role() const
case ax::mojom::Role::kMarquee:
return QAccessible::Section;
case ax::mojom::Role::kMath:
+ case ax::mojom::Role::kMathMLMath:
return QAccessible::Equation;
+ case ax::mojom::Role::kMathMLFraction:
+ return QAccessible::Grouping;
+ case ax::mojom::Role::kMathMLIdentifier:
+ return QAccessible::StaticText;
+ case ax::mojom::Role::kMathMLMultiscripts:
+ return QAccessible::Section;
+ case ax::mojom::Role::kMathMLNoneScript:
+ return QAccessible::Section;
+ case ax::mojom::Role::kMathMLNumber:
+ return QAccessible::StaticText;
+ case ax::mojom::Role::kMathMLOperator:
+ return QAccessible::StaticText;
+ case ax::mojom::Role::kMathMLOver:
+ return QAccessible::Section;
+ case ax::mojom::Role::kMathMLPrescriptDelimiter:
+ return QAccessible::Section;
+ case ax::mojom::Role::kMathMLRoot:
+ return QAccessible::Section;
+ case ax::mojom::Role::kMathMLRow:
+ return QAccessible::Section;
+ case ax::mojom::Role::kMathMLSquareRoot:
+ return QAccessible::Section;
+ case ax::mojom::Role::kMathMLStringLiteral:
+ return QAccessible::StaticText;
+ case ax::mojom::Role::kMathMLSub:
+ return QAccessible::Section;
+ case ax::mojom::Role::kMathMLSubSup:
+ return QAccessible::Section;
+ case ax::mojom::Role::kMathMLSup:
+ return QAccessible::Section;
+ case ax::mojom::Role::kMathMLTable:
+ return QAccessible::Table;
+ case ax::mojom::Role::kMathMLTableCell:
+ return QAccessible::Cell;
+ case ax::mojom::Role::kMathMLTableRow:
+ return QAccessible::Row;
+ case ax::mojom::Role::kMathMLText:
+ return QAccessible::StaticText;
+ case ax::mojom::Role::kMathMLUnder:
+ return QAccessible::Section;
+ case ax::mojom::Role::kMathMLUnderOver:
+ return QAccessible::Section;
case ax::mojom::Role::kMenu:
return QAccessible::PopupMenu;
case ax::mojom::Role::kMenuBar:
@@ -434,8 +593,6 @@ QAccessible::Role BrowserAccessibilityQt::role() const
return QAccessible::CheckBox;
case ax::mojom::Role::kMenuItemRadio:
return QAccessible::RadioButton;
- case ax::mojom::Role::kMenuButton:
- return QAccessible::MenuItem;
case ax::mojom::Role::kMenuListOption:
return QAccessible::MenuItem;
case ax::mojom::Role::kMenuListPopup:
@@ -450,12 +607,18 @@ QAccessible::Role BrowserAccessibilityQt::role() const
return QAccessible::Pane;
case ax::mojom::Role::kParagraph:
return QAccessible::Paragraph;
+ case ax::mojom::Role::kPdfActionableHighlight:
+ return QAccessible::Button;
+ case ax::mojom::Role::kPdfRoot:
+ return QAccessible::Document;
+ case ax::mojom::Role::kPluginObject:
+ return QAccessible::Grouping;
case ax::mojom::Role::kPopUpButton:
return QAccessible::ComboBox;
+ case ax::mojom::Role::kPortal:
+ return QAccessible::Button;
case ax::mojom::Role::kPre:
return QAccessible::Section;
- case ax::mojom::Role::kPresentational:
- return QAccessible::NoRole; // FIXME
case ax::mojom::Role::kProgressIndicator:
return QAccessible::ProgressBar;
case ax::mojom::Role::kRadioButton:
@@ -464,8 +627,6 @@ QAccessible::Role BrowserAccessibilityQt::role() const
return QAccessible::Grouping;
case ax::mojom::Role::kRegion:
return QAccessible::Section;
- case ax::mojom::Role::kRevision:
- return QAccessible::Section;
case ax::mojom::Role::kRow:
return QAccessible::Row;
case ax::mojom::Role::kRowGroup:
@@ -473,7 +634,7 @@ QAccessible::Role BrowserAccessibilityQt::role() const
case ax::mojom::Role::kRowHeader:
return QAccessible::RowHeader;
case ax::mojom::Role::kRuby:
- return QAccessible::StaticText;
+ return QAccessible::Grouping;
case ax::mojom::Role::kRubyAnnotation:
return QAccessible::StaticText;
case ax::mojom::Role::kScrollBar:
@@ -487,7 +648,6 @@ QAccessible::Role BrowserAccessibilityQt::role() const
case ax::mojom::Role::kSection:
return QAccessible::Section;
case ax::mojom::Role::kSlider:
- case ax::mojom::Role::kSliderThumb:
return QAccessible::Slider;
case ax::mojom::Role::kSpinButton:
return QAccessible::SpinBox;
@@ -499,10 +659,14 @@ QAccessible::Role BrowserAccessibilityQt::role() const
return QAccessible::Indicator;
case ax::mojom::Role::kStrong:
return QAccessible::StaticText;
+ case ax::mojom::Role::kSubscript:
+ return QAccessible::Grouping;
case ax::mojom::Role::kSuggestion:
return QAccessible::Section;
+ case ax::mojom::Role::kSuperscript:
+ return QAccessible::Grouping;
case ax::mojom::Role::kSvgRoot:
- return QAccessible::Graphic;
+ return QAccessible::WebDocument;
case ax::mojom::Role::kSwitch:
return QAccessible::Button;
case ax::mojom::Role::kTable:
@@ -544,63 +708,68 @@ QAccessible::Role BrowserAccessibilityQt::role() const
return QAccessible::NoRole;
}
-QAccessible::State BrowserAccessibilityQt::state() const
+QAccessible::State BrowserAccessibilityInterface::state() const
{
QAccessible::State state = QAccessible::State();
- if (HasState(ax::mojom::State::kCollapsed))
+ if (!q->isReady()) {
+ state.invalid = true;
+ return state;
+ }
+
+ if (q->HasState(ax::mojom::State::kCollapsed))
state.collapsed = true;
- if (HasState(ax::mojom::State::kDefault))
+ if (q->HasState(ax::mojom::State::kDefault))
state.defaultButton = true;
- if (HasState(ax::mojom::State::kEditable))
+ if (q->HasState(ax::mojom::State::kEditable))
state.editable = true;
- if (HasState(ax::mojom::State::kExpanded))
+ if (q->HasState(ax::mojom::State::kExpanded))
state.expanded = true;
- if (HasState(ax::mojom::State::kFocusable))
+ if (q->HasState(ax::mojom::State::kFocusable))
state.focusable = true;
- if (HasState(ax::mojom::State::kHorizontal))
+ if (q->HasState(ax::mojom::State::kHorizontal))
{} // FIXME
- if (HasState(ax::mojom::State::kHovered))
+ if (q->HasState(ax::mojom::State::kHovered))
state.hotTracked = true;
- if (HasState(ax::mojom::State::kIgnored))
+ if (q->HasState(ax::mojom::State::kIgnored))
{} // FIXME
- if (HasState(ax::mojom::State::kInvisible))
+ if (q->HasState(ax::mojom::State::kInvisible))
state.invisible = true;
- if (HasState(ax::mojom::State::kLinked))
+ if (q->HasState(ax::mojom::State::kLinked))
state.linked = true;
- if (HasState(ax::mojom::State::kMultiline))
+ if (q->HasState(ax::mojom::State::kMultiline))
state.multiLine = true;
- if (HasState(ax::mojom::State::kMultiselectable))
+ if (q->HasState(ax::mojom::State::kMultiselectable))
state.multiSelectable = true;
- if (HasState(ax::mojom::State::kProtected))
+ if (q->HasState(ax::mojom::State::kProtected))
state.passwordEdit = true;
- if (HasState(ax::mojom::State::kRequired))
+ if (q->HasState(ax::mojom::State::kRequired))
{} // FIXME
- if (HasState(ax::mojom::State::kRichlyEditable))
+ if (q->HasState(ax::mojom::State::kRichlyEditable))
{} // FIXME
- if (HasState(ax::mojom::State::kVertical))
+ if (q->HasState(ax::mojom::State::kVertical))
{} // FIXME
- if (HasState(ax::mojom::State::kVisited))
+ if (q->HasState(ax::mojom::State::kVisited))
state.traversed = true;
- if (IsOffscreen())
+ if (q->IsOffscreen())
state.offscreen = true;
- if (manager()->GetFocus() == this)
+ if (q->manager()->GetFocus() == q)
state.focused = true;
- if (GetBoolAttribute(ax::mojom::BoolAttribute::kBusy))
+ if (q->GetBoolAttribute(ax::mojom::BoolAttribute::kBusy))
state.busy = true;
- if (GetBoolAttribute(ax::mojom::BoolAttribute::kModal))
+ if (q->GetBoolAttribute(ax::mojom::BoolAttribute::kModal))
state.modal = true;
- if (HasBoolAttribute(ax::mojom::BoolAttribute::kSelected)) {
+ if (q->HasBoolAttribute(ax::mojom::BoolAttribute::kSelected)) {
state.selectable = true;
- state.selected = GetBoolAttribute(ax::mojom::BoolAttribute::kSelected);
+ state.selected = q->GetBoolAttribute(ax::mojom::BoolAttribute::kSelected);
}
- if (HasIntAttribute(ax::mojom::IntAttribute::kCheckedState)) {
+ if (q->HasIntAttribute(ax::mojom::IntAttribute::kCheckedState)) {
state.checkable = true;
const ax::mojom::CheckedState checkedState =
- static_cast<ax::mojom::CheckedState>(GetIntAttribute(ax::mojom::IntAttribute::kCheckedState));
+ static_cast<ax::mojom::CheckedState>(q->GetIntAttribute(ax::mojom::IntAttribute::kCheckedState));
switch (checkedState) {
case ax::mojom::CheckedState::kTrue:
- if (GetRole() == ax::mojom::Role::kToggleButton)
+ if (q->GetRole() == ax::mojom::Role::kToggleButton)
state.pressed = true;
else
state.checked = true;
@@ -613,8 +782,8 @@ QAccessible::State BrowserAccessibilityQt::state() const
break;
}
}
- if (HasIntAttribute(ax::mojom::IntAttribute::kRestriction)) {
- const ax::mojom::Restriction restriction = static_cast<ax::mojom::Restriction>(GetIntAttribute(ax::mojom::IntAttribute::kRestriction));
+ if (q->HasIntAttribute(ax::mojom::IntAttribute::kRestriction)) {
+ const ax::mojom::Restriction restriction = static_cast<ax::mojom::Restriction>(q->GetIntAttribute(ax::mojom::IntAttribute::kRestriction));
switch (restriction) {
case ax::mojom::Restriction::kReadOnly:
state.readOnly = true;
@@ -626,8 +795,8 @@ QAccessible::State BrowserAccessibilityQt::state() const
break;
}
}
- if (HasIntAttribute(ax::mojom::IntAttribute::kHasPopup)) {
- const ax::mojom::HasPopup hasPopup = static_cast<ax::mojom::HasPopup>(GetIntAttribute(ax::mojom::IntAttribute::kHasPopup));
+ if (q->HasIntAttribute(ax::mojom::IntAttribute::kHasPopup)) {
+ const ax::mojom::HasPopup hasPopup = static_cast<ax::mojom::HasPopup>(q->GetIntAttribute(ax::mojom::IntAttribute::kHasPopup));
switch (hasPopup) {
case ax::mojom::HasPopup::kFalse:
break;
@@ -644,356 +813,370 @@ QAccessible::State BrowserAccessibilityQt::state() const
return state;
}
-// Qt does not reference count accessibles
-void BrowserAccessibilityQt::NativeAddReference()
-{
-}
-
-// there is no reference counting, but BrowserAccessibility::Destroy
-// calls this (and that is the only place in the chromium sources,
-// so we can safely use it to dispose of ourselves here
-// (the default implementation of this function just contains a "delete this")
-void BrowserAccessibilityQt::NativeReleaseReference()
-{
- // delete this
- QAccessible::Id interfaceId = QAccessible::uniqueId(this);
- QAccessible::deleteAccessibleInterface(interfaceId);
-}
-
-QStringList BrowserAccessibilityQt::actionNames() const
+QStringList BrowserAccessibilityInterface::actionNames() const
{
QStringList actions;
- if (HasState(ax::mojom::State::kFocusable))
+ if (q->HasState(ax::mojom::State::kFocusable))
actions << QAccessibleActionInterface::setFocusAction();
return actions;
}
-void BrowserAccessibilityQt::doAction(const QString &actionName)
+void BrowserAccessibilityInterface::doAction(const QString &actionName)
{
if (actionName == QAccessibleActionInterface::setFocusAction())
- manager()->SetFocus(*this);
+ q->manager()->SetFocus(*q);
}
-QStringList BrowserAccessibilityQt::keyBindingsForAction(const QString &actionName) const
+QStringList
+BrowserAccessibilityInterface::keyBindingsForAction(const QString & /*actionName*/) const
{
QT_NOT_YET_IMPLEMENTED
return QStringList();
}
-void BrowserAccessibilityQt::addSelection(int startOffset, int endOffset)
+void BrowserAccessibilityInterface::addSelection(int startOffset, int endOffset)
{
- manager()->SetSelection(AXPlatformRange(CreatePositionAt(startOffset), CreatePositionAt(endOffset)));
+ q->manager()->SetSelection(content::BrowserAccessibility::AXRange(q->CreatePositionAt(startOffset), q->CreatePositionAt(endOffset)));
}
-QString BrowserAccessibilityQt::attributes(int offset, int *startOffset, int *endOffset) const
+QString BrowserAccessibilityInterface::attributes(int offset, int *startOffset, int *endOffset) const
{
*startOffset = offset;
*endOffset = offset;
return QString();
}
-int BrowserAccessibilityQt::cursorPosition() const
+int BrowserAccessibilityInterface::cursorPosition() const
{
int pos = 0;
- GetIntAttribute(ax::mojom::IntAttribute::kTextSelStart, &pos);
+ q->GetIntAttribute(ax::mojom::IntAttribute::kTextSelStart, &pos);
return pos;
}
-QRect BrowserAccessibilityQt::characterRect(int /*offset*/) const
+QRect BrowserAccessibilityInterface::characterRect(int /*offset*/) const
{
QT_NOT_YET_IMPLEMENTED
return QRect();
}
-int BrowserAccessibilityQt::selectionCount() const
+int BrowserAccessibilityInterface::selectionCount() const
{
int start = 0;
int end = 0;
- GetIntAttribute(ax::mojom::IntAttribute::kTextSelStart, &start);
- GetIntAttribute(ax::mojom::IntAttribute::kTextSelEnd, &end);
+ q->GetIntAttribute(ax::mojom::IntAttribute::kTextSelStart, &start);
+ q->GetIntAttribute(ax::mojom::IntAttribute::kTextSelEnd, &end);
if (start != end)
return 1;
return 0;
}
-int BrowserAccessibilityQt::offsetAtPoint(const QPoint &/*point*/) const
+int BrowserAccessibilityInterface::offsetAtPoint(const QPoint &/*point*/) const
{
QT_NOT_YET_IMPLEMENTED
return 0;
}
-void BrowserAccessibilityQt::selection(int selectionIndex, int *startOffset, int *endOffset) const
+void BrowserAccessibilityInterface::selection(int selectionIndex, int *startOffset, int *endOffset) const
{
Q_ASSERT(startOffset && endOffset);
*startOffset = 0;
*endOffset = 0;
if (selectionIndex != 0)
return;
- GetIntAttribute(ax::mojom::IntAttribute::kTextSelStart, startOffset);
- GetIntAttribute(ax::mojom::IntAttribute::kTextSelEnd, endOffset);
+ q->GetIntAttribute(ax::mojom::IntAttribute::kTextSelStart, startOffset);
+ q->GetIntAttribute(ax::mojom::IntAttribute::kTextSelEnd, endOffset);
}
-QString BrowserAccessibilityQt::text(int startOffset, int endOffset) const
+QString BrowserAccessibilityInterface::text(int startOffset, int endOffset) const
{
return text(QAccessible::Value).mid(startOffset, endOffset - startOffset);
}
-void BrowserAccessibilityQt::removeSelection(int selectionIndex)
+void BrowserAccessibilityInterface::removeSelection(int selectionIndex)
{
- manager()->SetSelection(AXPlatformRange(CreatePositionAt(0), CreatePositionAt(0)));
+ q->manager()->SetSelection(content::BrowserAccessibility::AXRange(q->CreatePositionAt(0), q->CreatePositionAt(0)));
}
-void BrowserAccessibilityQt::setCursorPosition(int position)
+void BrowserAccessibilityInterface::setCursorPosition(int position)
{
- manager()->SetSelection(AXPlatformRange(CreatePositionAt(position), CreatePositionAt(position)));
+ q->manager()->SetSelection(content::BrowserAccessibility::AXRange(q->CreatePositionAt(position), q->CreatePositionAt(position)));
}
-void BrowserAccessibilityQt::setSelection(int selectionIndex, int startOffset, int endOffset)
+void BrowserAccessibilityInterface::setSelection(int selectionIndex, int startOffset, int endOffset)
{
if (selectionIndex != 0)
return;
- manager()->SetSelection(AXPlatformRange(CreatePositionAt(startOffset), CreatePositionAt(endOffset)));
+ q->manager()->SetSelection(content::BrowserAccessibility::AXRange(q->CreatePositionAt(startOffset), q->CreatePositionAt(endOffset)));
}
-int BrowserAccessibilityQt::characterCount() const
+int BrowserAccessibilityInterface::characterCount() const
{
return text(QAccessible::Value).length();
}
-void BrowserAccessibilityQt::scrollToSubstring(int startIndex, int endIndex)
+void BrowserAccessibilityInterface::scrollToSubstring(int startIndex, int endIndex)
{
int count = characterCount();
if (startIndex < endIndex && endIndex < count)
- manager()->ScrollToMakeVisible(*this,
- GetRootFrameHypertextRangeBoundsRect(
- startIndex,
- endIndex - startIndex,
- ui::AXClippingBehavior::kUnclipped));
+ q->manager()->ScrollToMakeVisible(*q,
+ q->GetRootFrameHypertextRangeBoundsRect(
+ startIndex,
+ endIndex - startIndex,
+ ui::AXClippingBehavior::kUnclipped));
}
-QVariant BrowserAccessibilityQt::currentValue() const
+QVariant BrowserAccessibilityInterface::currentValue() const
{
QVariant result;
float value;
- if (GetFloatAttribute(ax::mojom::FloatAttribute::kValueForRange, &value)) {
+ if (q->GetFloatAttribute(ax::mojom::FloatAttribute::kValueForRange, &value)) {
result = (double) value;
}
return result;
}
-void BrowserAccessibilityQt::setCurrentValue(const QVariant &value)
+void BrowserAccessibilityInterface::setCurrentValue(const QVariant &value)
{
// not yet implemented anywhere in blink
QT_NOT_YET_IMPLEMENTED
}
-QVariant BrowserAccessibilityQt::maximumValue() const
+QVariant BrowserAccessibilityInterface::maximumValue() const
{
QVariant result;
float value;
- if (GetFloatAttribute(ax::mojom::FloatAttribute::kMaxValueForRange, &value)) {
+ if (q->GetFloatAttribute(ax::mojom::FloatAttribute::kMaxValueForRange, &value)) {
result = (double) value;
}
return result;
}
-QVariant BrowserAccessibilityQt::minimumValue() const
+QVariant BrowserAccessibilityInterface::minimumValue() const
{
QVariant result;
float value;
- if (GetFloatAttribute(ax::mojom::FloatAttribute::kMinValueForRange, &value)) {
+ if (q->GetFloatAttribute(ax::mojom::FloatAttribute::kMinValueForRange, &value)) {
result = (double) value;
}
return result;
}
-QVariant BrowserAccessibilityQt::minimumStepSize() const
+QVariant BrowserAccessibilityInterface::minimumStepSize() const
{
QVariant result;
float value;
- if (GetFloatAttribute(ax::mojom::FloatAttribute::kStepValueForRange, &value)) {
+ if (q->GetFloatAttribute(ax::mojom::FloatAttribute::kStepValueForRange, &value)) {
result = (double) value;
}
return result;
}
-QAccessibleInterface *BrowserAccessibilityQt::cellAt(int row, int column) const
+QAccessibleInterface *BrowserAccessibilityInterface::cellAt(int row, int column) const
{
int columns = 0;
int rows = 0;
- if (!GetIntAttribute(ax::mojom::IntAttribute::kTableColumnCount, &columns) ||
- !GetIntAttribute(ax::mojom::IntAttribute::kTableRowCount, &rows) ||
- columns <= 0 ||
- rows <= 0) {
- return 0;
+ if (!q->GetIntAttribute(ax::mojom::IntAttribute::kTableColumnCount, &columns)
+ || !q->GetIntAttribute(ax::mojom::IntAttribute::kTableRowCount, &rows)
+ || columns <= 0
+ || rows <= 0) {
+ return nullptr;
}
if (row < 0 || row >= rows || column < 0 || column >= columns)
- return 0;
+ return nullptr;
- base::Optional<int> cell_id = GetCellId(row, column);
- BrowserAccessibility* cell = cell_id ? manager()->GetFromID(*cell_id) : nullptr;
- if (cell) {
- QAccessibleInterface *iface = static_cast<BrowserAccessibilityQt*>(cell);
- return iface;
- }
+ absl::optional<int> cell_id = q->GetCellId(row, column);
+ content::BrowserAccessibility *cell = cell_id ? q->manager()->GetFromID(*cell_id) : nullptr;
+ if (cell)
+ return content::toQAccessibleInterface(cell);
return nullptr;
}
-QAccessibleInterface *BrowserAccessibilityQt::caption() const
+QAccessibleInterface *BrowserAccessibilityInterface::caption() const
{
return nullptr;
}
-QAccessibleInterface *BrowserAccessibilityQt::summary() const
+QAccessibleInterface *BrowserAccessibilityInterface::summary() const
{
return nullptr;
}
-QString BrowserAccessibilityQt::columnDescription(int column) const
+QString BrowserAccessibilityInterface::columnDescription(int column) const
{
return QString();
}
-QString BrowserAccessibilityQt::rowDescription(int row) const
+QString BrowserAccessibilityInterface::rowDescription(int row) const
{
return QString();
}
-int BrowserAccessibilityQt::columnCount() const
+int BrowserAccessibilityInterface::columnCount() const
{
int columns = 0;
- if (GetIntAttribute(ax::mojom::IntAttribute::kTableColumnCount, &columns))
+ if (q->GetIntAttribute(ax::mojom::IntAttribute::kTableColumnCount, &columns))
return columns;
-
return 0;
}
-int BrowserAccessibilityQt::rowCount() const
+int BrowserAccessibilityInterface::rowCount() const
{
int rows = 0;
- if (GetIntAttribute(ax::mojom::IntAttribute::kTableRowCount, &rows))
- return rows;
+ if (q->GetIntAttribute(ax::mojom::IntAttribute::kTableRowCount, &rows))
+ return rows;
return 0;
}
-int BrowserAccessibilityQt::selectedCellCount() const
+int BrowserAccessibilityInterface::selectedCellCount() const
{
return 0;
}
-int BrowserAccessibilityQt::selectedColumnCount() const
+int BrowserAccessibilityInterface::selectedColumnCount() const
{
return 0;
}
-int BrowserAccessibilityQt::selectedRowCount() const
+int BrowserAccessibilityInterface::selectedRowCount() const
{
return 0;
}
-QList<QAccessibleInterface *> BrowserAccessibilityQt::selectedCells() const
+QList<QAccessibleInterface *> BrowserAccessibilityInterface::selectedCells() const
{
return QList<QAccessibleInterface *>();
}
-QList<int> BrowserAccessibilityQt::selectedColumns() const
+QList<int> BrowserAccessibilityInterface::selectedColumns() const
{
return QList<int>();
}
-QList<int> BrowserAccessibilityQt::selectedRows() const
+QList<int> BrowserAccessibilityInterface::selectedRows() const
{
return QList<int>();
}
-bool BrowserAccessibilityQt::isColumnSelected(int /*column*/) const
+bool BrowserAccessibilityInterface::isColumnSelected(int /*column*/) const
{
return false;
}
-bool BrowserAccessibilityQt::isRowSelected(int /*row*/) const
+bool BrowserAccessibilityInterface::isRowSelected(int /*row*/) const
{
return false;
}
-bool BrowserAccessibilityQt::selectRow(int /*row*/)
+bool BrowserAccessibilityInterface::selectRow(int /*row*/)
{
return false;
}
-bool BrowserAccessibilityQt::selectColumn(int /*column*/)
+bool BrowserAccessibilityInterface::selectColumn(int /*column*/)
{
return false;
}
-bool BrowserAccessibilityQt::unselectRow(int /*row*/)
+bool BrowserAccessibilityInterface::unselectRow(int /*row*/)
{
return false;
}
-bool BrowserAccessibilityQt::unselectColumn(int /*column*/)
+bool BrowserAccessibilityInterface::unselectColumn(int /*column*/)
{
return false;
}
-int BrowserAccessibilityQt::columnExtent() const
+int BrowserAccessibilityInterface::columnExtent() const
{
return 1;
}
-QList<QAccessibleInterface *> BrowserAccessibilityQt::columnHeaderCells() const
+QList<QAccessibleInterface *> BrowserAccessibilityInterface::columnHeaderCells() const
{
return QList<QAccessibleInterface*>();
}
-int BrowserAccessibilityQt::columnIndex() const
+int BrowserAccessibilityInterface::columnIndex() const
{
int column = 0;
- if (GetIntAttribute(ax::mojom::IntAttribute::kTableCellColumnIndex, &column))
- return column;
+ if (q->GetIntAttribute(ax::mojom::IntAttribute::kTableCellColumnIndex, &column))
+ return column;
return 0;
}
-int BrowserAccessibilityQt::rowExtent() const
+int BrowserAccessibilityInterface::rowExtent() const
{
return 1;
}
-QList<QAccessibleInterface *> BrowserAccessibilityQt::rowHeaderCells() const
+QList<QAccessibleInterface *> BrowserAccessibilityInterface::rowHeaderCells() const
{
return QList<QAccessibleInterface*>();
}
-int BrowserAccessibilityQt::rowIndex() const
+int BrowserAccessibilityInterface::rowIndex() const
{
int row = 0;
- if (GetIntAttribute(ax::mojom::IntAttribute::kTableCellRowIndex, &row))
- return row;
+ if (q->GetIntAttribute(ax::mojom::IntAttribute::kTableCellRowIndex, &row))
+ return row;
return 0;
}
-bool BrowserAccessibilityQt::isSelected() const
+bool BrowserAccessibilityInterface::isSelected() const
{
return false;
}
-QAccessibleInterface *BrowserAccessibilityQt::table() const
+content::BrowserAccessibility *BrowserAccessibilityInterface::findTable() const
{
- BrowserAccessibility* find_table = PlatformGetParent();
- while (find_table && find_table->GetRole() != ax::mojom::Role::kTable)
- find_table = find_table->PlatformGetParent();
- if (!find_table)
- return 0;
- return static_cast<BrowserAccessibilityQt*>(find_table);
+ content::BrowserAccessibility *parent = q->PlatformGetParent();
+ while (parent && parent->GetRole() != ax::mojom::Role::kTable)
+ parent = parent->PlatformGetParent();
+
+ return parent;
}
-void BrowserAccessibilityQt::modelChange(QAccessibleTableModelChangeEvent *)
+QAccessibleInterface *BrowserAccessibilityInterface::table() const
{
+ content::BrowserAccessibility *table = findTable();
+ Q_ASSERT(table);
+ return content::toQAccessibleInterface(table);
+}
+void BrowserAccessibilityInterface::modelChange(QAccessibleTableModelChangeEvent *)
+{
}
-} // namespace content
+} // namespace QtWebEngineCore
#endif // QT_CONFIG(accessibility)
+namespace content {
+
+// static
+std::unique_ptr<BrowserAccessibility> BrowserAccessibility::Create(BrowserAccessibilityManager *man, ui::AXNode *node)
+{
+#if QT_CONFIG(accessibility)
+ return std::unique_ptr<BrowserAccessibility>(new QtWebEngineCore::BrowserAccessibilityQt(man, node));
+#else
+ Q_UNUSED(man);
+ Q_UNUSED(node);
+ return nullptr;
+#endif // #if QT_CONFIG(accessibility)
+}
+
+#if QT_CONFIG(accessibility)
+QAccessibleInterface *toQAccessibleInterface(BrowserAccessibility *obj)
+{
+ return static_cast<QtWebEngineCore::BrowserAccessibilityQt *>(obj)->interface;
+}
+
+const QAccessibleInterface *toQAccessibleInterface(const BrowserAccessibility *obj)
+{
+ return static_cast<const QtWebEngineCore::BrowserAccessibilityQt *>(obj)->interface;
+}
+#endif // #if QT_CONFIG(accessibility)
+
+} // namespace content
diff --git a/src/core/browser_accessibility_qt.h b/src/core/browser_accessibility_qt.h
index 19c7a1e54..598aa3ef5 100644
--- a/src/core/browser_accessibility_qt.h
+++ b/src/core/browser_accessibility_qt.h
@@ -1,155 +1,21 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef BROWSER_ACCESSIBILITY_QT_H
#define BROWSER_ACCESSIBILITY_QT_H
-#include <QtGui/qaccessible.h>
-#include "content/browser/accessibility/browser_accessibility.h"
+#include <QtGui/qtguiglobal.h>
#if QT_CONFIG(accessibility)
+QT_FORWARD_DECLARE_CLASS(QAccessibleInterface)
namespace content {
+class BrowserAccessibility;
-class BrowserAccessibilityQt
- : public BrowserAccessibility
- , public QAccessibleInterface
- , public QAccessibleActionInterface
- , public QAccessibleTextInterface
- , public QAccessibleValueInterface
- , public QAccessibleTableInterface
- , public QAccessibleTableCellInterface
-{
-public:
- BrowserAccessibilityQt();
-
- // QAccessibleInterface
- bool isValid() const override;
- QObject *object() const override;
- QAccessibleInterface *childAt(int x, int y) const override;
- void *interface_cast(QAccessible::InterfaceType type) override;
-
- // navigation, hierarchy
- QAccessibleInterface *parent() const override;
- QAccessibleInterface *child(int index) const override;
- QAccessibleInterface *focusChild() const override;
- int childCount() const override;
- int indexOfChild(const QAccessibleInterface *) const override;
-
- // properties and state
- QString text(QAccessible::Text t) const override;
- void setText(QAccessible::Text t, const QString &text) override;
- QRect rect() const override;
- QAccessible::Role role() const override;
- QAccessible::State state() const override;
-
- // BrowserAccessible
- void NativeAddReference() override;
- void NativeReleaseReference() override;
- bool IsNative() const override { return true; }
-
- // QAccessibleActionInterface
- QStringList actionNames() const override;
- void doAction(const QString &actionName) override;
- QStringList keyBindingsForAction(const QString &actionName) const override;
-
- // QAccessibleTextInterface
- void addSelection(int startOffset, int endOffset) override;
- QString attributes(int offset, int *startOffset, int *endOffset) const override;
- int cursorPosition() const override;
- QRect characterRect(int offset) const override;
- int selectionCount() const override;
- int offsetAtPoint(const QPoint &point) const override;
- void selection(int selectionIndex, int *startOffset, int *endOffset) const override;
- QString text(int startOffset, int endOffset) const override;
- void removeSelection(int selectionIndex) override;
- void setCursorPosition(int position) override;
- void setSelection(int selectionIndex, int startOffset, int endOffset) override;
- int characterCount() const override;
- void scrollToSubstring(int startIndex, int endIndex) override;
-
- // QAccessibleValueInterface
- QVariant currentValue() const override;
- void setCurrentValue(const QVariant &value) override;
- QVariant maximumValue() const override;
- QVariant minimumValue() const override;
- QVariant minimumStepSize() const override;
-
- // QAccessibleTableInterface
- QAccessibleInterface *cellAt(int row, int column) const override;
- QAccessibleInterface *caption() const override;
- QAccessibleInterface *summary() const override;
- QString columnDescription(int column) const override;
- QString rowDescription(int row) const override;
- int columnCount() const override;
- int rowCount() const override;
- // selection
- int selectedCellCount() const override;
- int selectedColumnCount() const override;
- int selectedRowCount() const override;
- QList<QAccessibleInterface*> selectedCells() const override;
- QList<int> selectedColumns() const override;
- QList<int> selectedRows() const override;
- bool isColumnSelected(int column) const override;
- bool isRowSelected(int row) const override;
- bool selectRow(int row) override;
- bool selectColumn(int column) override;
- bool unselectRow(int row) override;
- bool unselectColumn(int column) override;
-
- // QAccessibleTableCellInterface
- int columnExtent() const override;
- QList<QAccessibleInterface*> columnHeaderCells() const override;
- int columnIndex() const override;
- int rowExtent() const override;
- QList<QAccessibleInterface*> rowHeaderCells() const override;
- int rowIndex() const override;
- bool isSelected() const override;
- QAccessibleInterface* table() const override;
-
- void modelChange(QAccessibleTableModelChangeEvent *event) override;
-};
-
-const BrowserAccessibilityQt *ToBrowserAccessibilityQt(const BrowserAccessibility *obj);
-QAccessibleInterface *toQAccessibleInterface(BrowserAccessibility *acc);
+QAccessibleInterface *toQAccessibleInterface(BrowserAccessibility *obj);
+const QAccessibleInterface *toQAccessibleInterface(const BrowserAccessibility *obj);
} // namespace content
-
#endif // QT_CONFIG(accessibility)
-#endif
+
+#endif // BROWSER_ACCESSIBILITY_QT_H
diff --git a/src/core/browser_main_parts_qt.cpp b/src/core/browser_main_parts_qt.cpp
index 925c18664..9021dbb98 100644
--- a/src/core/browser_main_parts_qt.cpp
+++ b/src/core/browser_main_parts_qt.cpp
@@ -1,81 +1,68 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "browser_main_parts_qt.h"
#include "api/qwebenginemessagepumpscheduler_p.h"
-#include "base/message_loop/message_loop.h"
-#include "base/message_loop/message_loop_current.h"
+#include "base/message_loop/message_pump.h"
#include "base/message_loop/message_pump_for_ui.h"
#include "base/process/process.h"
+#include "base/task/current_thread.h"
#include "base/task/sequence_manager/sequence_manager_impl.h"
#include "base/task/sequence_manager/thread_controller_with_message_pump_impl.h"
+#include "base/task/task_traits.h"
+#include "base/task/thread_pool.h"
#include "base/threading/thread_restrictions.h"
+#include "chrome/browser/tab_contents/form_interaction_tab_helper.h"
+#include "components/device_event_log/device_event_log.h"
+#include "components/performance_manager/embedder/graph_features.h"
+#include "components/performance_manager/embedder/performance_manager_lifetime.h"
+#include "components/performance_manager/public/graph/graph.h"
+#include "components/performance_manager/public/performance_manager.h"
#include "content/public/browser/browser_main_parts.h"
+#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/child_process_security_policy.h"
-#include "content/public/browser/system_connector.h"
-#include "content/public/common/service_manager_connection.h"
+#include "content/public/common/content_features.h"
+#include "content/public/common/result_codes.h"
#include "extensions/buildflags/buildflags.h"
+#include "ppapi/buildflags/buildflags.h"
+#include "select_file_dialog_factory_qt.h"
+#include "services/service_manager/public/cpp/connector.h"
+#include "services/service_manager/public/cpp/service.h"
+#include "type_conversion.h"
+#include "ui/display/screen.h"
+
#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "extensions/common/constants.h"
#include "extensions/common/extensions_client.h"
#include "extensions/extensions_browser_client_qt.h"
#include "extensions/extension_system_factory_qt.h"
#include "common/extensions/extensions_client_qt.h"
-#endif //BUILDFLAG(ENABLE_EXTENSIONS)
-#include "services/service_manager/public/cpp/connector.h"
-#include "services/service_manager/public/cpp/service.h"
-#include "ui/display/screen.h"
+#endif // BUILDFLAG(ENABLE_EXTENSIONS)
+
+#if BUILDFLAG(ENABLE_PLUGINS)
+#include "content/public/browser/plugin_service.h"
+#include "extensions/plugin_service_filter_qt.h"
+#endif // BUILDFLAG(ENABLE_PLUGINS)
#include "web_engine_context.h"
+#include "web_usb_detector_qt.h"
+#include <QDeadlineTimer>
#include <QtGui/qtgui-config.h>
+#include <QStandardPaths>
#if QT_CONFIG(opengl)
#include "ui/gl/gl_context.h"
#include <QOpenGLContext>
#endif
-#if defined(OS_MACOSX)
-#include "base/message_loop/message_pump_mac.h"
+#if BUILDFLAG(IS_MAC)
+#include "base/message_loop/message_pump_apple.h"
+#include "services/device/public/cpp/geolocation/geolocation_manager.h"
+#include "services/device/public/cpp/geolocation/system_geolocation_source.h"
#include "ui/base/idle/idle.h"
#endif
@@ -85,6 +72,10 @@
#include "desktop_screen_qt.h"
#endif
+#if defined(Q_OS_LINUX)
+#include "components/os_crypt/sync/key_storage_config_linux.h"
+#include "components/os_crypt/sync/os_crypt.h"
+#endif
namespace QtWebEngineCore {
@@ -131,12 +122,17 @@ public:
{
// NOTE: This method may called from any thread at any time.
ensureDelegate();
- m_scheduler.scheduleWork();
+ m_scheduler.scheduleImmediateWork();
}
- void ScheduleDelayedWork(const base::TimeTicks &delayed_work_time) override
+ void ScheduleDelayedWork(const Delegate::NextWorkInfo &next_work_info) override
{
// NOTE: This method may called from any thread at any time.
+ ScheduleDelayedWork(next_work_info.delayed_run_time);
+ }
+
+ void ScheduleDelayedWork(const base::TimeTicks &delayed_work_time)
+ {
ensureDelegate();
m_scheduler.scheduleDelayedWork(GetTimeIntervalMilliseconds(delayed_work_time));
}
@@ -145,79 +141,51 @@ private:
void ensureDelegate()
{
if (!m_delegate) {
- auto seqMan = base::MessageLoopCurrent::GetCurrentSequenceManagerImpl();
+ auto seqMan = base::CurrentThread::Get()->GetCurrentSequenceManagerImpl();
m_delegate = static_cast<base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl *>(
seqMan->controller_.get());
}
}
- // Both Qt and Chromium keep track of the current GL context by using
- // thread-local variables, and naturally they are completely unaware of each
- // other. As a result, when a QOpenGLContext is made current, the previous
- // gl::GLContext is not released, and vice-versa. This is fine as long as
- // each thread uses exclusively either Qt or Chromium GL bindings, which is
- // usually the case.
- //
- // The only exception is when the GL driver is considered thread-unsafe
- // (QOpenGLContext::supportsThreadedOpenGL() is false), in which case we
- // have to run all GL operations, including Chromium's GPU service, on the
- // UI thread. Now the bindings are being mixed and both Qt and Chromium get
- // quite confused regarding the current state of the surface.
- //
- // To get this to work we have to release the current QOpenGLContext before
- // executing any tasks from Chromium's GPU service and the gl::GLContext
- // afterwards. Since GPU service just posts tasks to the UI thread task
- // runner, we'll have to instrument the entire UI thread message pump.
- class ScopedGLContextChecker
- {
-#if QT_CONFIG(opengl)
- public:
- ScopedGLContextChecker()
- {
- if (!m_enabled)
- return;
-
- if (QOpenGLContext *context = QOpenGLContext::currentContext())
- context->doneCurrent();
- }
-
- ~ScopedGLContextChecker()
- {
- if (!m_enabled)
- return;
-
- if (gl::GLContext *context = gl::GLContext::GetCurrent())
- context->ReleaseCurrent(nullptr);
- }
-
- private:
- bool m_enabled = !QOpenGLContext::supportsThreadedOpenGL();
-#endif // QT_CONFIG(opengl)
- };
-
void handleScheduledWork()
{
- ScopedGLContextChecker glContextChecker;
-
- bool more_work_is_plausible = m_delegate->DoWork();
+ QDeadlineTimer timer(std::chrono::milliseconds(2));
+ base::MessagePump::Delegate::NextWorkInfo more_work_info = m_delegate->DoWork();
+ while (more_work_info.is_immediate() && !timer.hasExpired())
+ more_work_info = m_delegate->DoWork();
- base::TimeTicks delayed_work_time;
- more_work_is_plausible |= m_delegate->DoDelayedWork(&delayed_work_time);
+ if (more_work_info.is_immediate())
+ return m_scheduler.scheduleImmediateWork();
- if (more_work_is_plausible)
- return ScheduleWork();
+ if (m_delegate->DoIdleWork())
+ return m_scheduler.scheduleIdleWork();
- more_work_is_plausible |= m_delegate->DoIdleWork();
- if (more_work_is_plausible)
- return ScheduleWork();
-
- ScheduleDelayedWork(delayed_work_time);
+ ScheduleDelayedWork(more_work_info.delayed_run_time);
}
Delegate *m_delegate = nullptr;
QWebEngineMessagePumpScheduler m_scheduler;
};
+#if BUILDFLAG(IS_MAC)
+class FakeGeolocationSource : public device::SystemGeolocationSource
+{
+public:
+ FakeGeolocationSource() = default;
+ ~FakeGeolocationSource() override = default;
+
+ // SystemGeolocationSource implementation:
+ void StartWatchingPosition(bool) override {}
+ void StopWatchingPosition() override {}
+ void RegisterPermissionUpdateCallback(PermissionUpdateCallback callback)
+ {
+ callback.Run(device::LocationSystemPermissionStatus::kDenied);
+ }
+ void RegisterPositionUpdateCallback(PositionUpdateCallback callback) {}
+ void RequestPermission() override {}
+};
+#endif // BUILDFLAG(IS_MAC)
+
std::unique_ptr<base::MessagePump> messagePumpFactory()
{
static bool madePrimaryPump = false;
@@ -225,8 +193,8 @@ std::unique_ptr<base::MessagePump> messagePumpFactory()
madePrimaryPump = true;
return std::make_unique<MessagePumpForUIQt>();
}
-#if defined(OS_MACOSX)
- return base::MessagePumpMac::Create();
+#if BUILDFLAG(IS_MAC)
+ return base::message_pump_apple::Create();
#else
return std::make_unique<base::MessagePumpForUI>();
#endif
@@ -237,24 +205,61 @@ int BrowserMainPartsQt::PreEarlyInitialization()
#if BUILDFLAG(ENABLE_EXTENSIONS)
content::ChildProcessSecurityPolicy::GetInstance()->RegisterWebSafeScheme(extensions::kExtensionScheme);
#endif //ENABLE_EXTENSIONS
- return 0;
+ return content::RESULT_CODE_NORMAL_EXIT;
+}
+
+void BrowserMainPartsQt::PreCreateMainMessageLoop()
+{
+#if BUILDFLAG(IS_MAC)
+ m_geolocationManager = std::make_unique<device::GeolocationManager>(std::make_unique<FakeGeolocationSource>());
+#endif
}
-void BrowserMainPartsQt::PreMainMessageLoopStart()
+void BrowserMainPartsQt::PostCreateMainMessageLoop()
{
+ if (!device_event_log::IsInitialized())
+ device_event_log::Initialize(0 /* default max entries */);
+
+#if defined(Q_OS_LINUX)
+ auto config = std::make_unique<os_crypt::Config>();
+ config->product_name = "Qt WebEngine";
+ config->should_use_preference = false;
+ config->user_data_path = toFilePath(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation));
+ OSCrypt::SetConfig(std::move(config));
+#endif
}
-void BrowserMainPartsQt::PreMainMessageLoopRun()
+int BrowserMainPartsQt::PreMainMessageLoopRun()
{
+ ui::SelectFileDialog::SetFactory(std::make_unique<SelectFileDialogFactoryQt>());
+
#if BUILDFLAG(ENABLE_EXTENSIONS)
extensions::ExtensionsClient::Set(new extensions::ExtensionsClientQt());
extensions::ExtensionsBrowserClient::Set(new extensions::ExtensionsBrowserClientQt());
extensions::ExtensionSystemFactoryQt::GetInstance();
-#endif //ENABLE_EXTENSIONS
+
+#if BUILDFLAG(ENABLE_PLUGINS)
+ content::PluginService *plugin_service = content::PluginService::GetInstance();
+ plugin_service->SetFilter(extensions::PluginServiceFilterQt::GetInstance());
+#endif // BUILDFLAG(ENABLE_PLUGINS)
+#endif // BUILDFLAG(ENABLE_EXTENSIONS)
+
+ if (base::FeatureList::IsEnabled(features::kWebUsb)) {
+ m_webUsbDetector.reset(new WebUsbDetectorQt());
+ content::GetUIThreadTaskRunner({ base::TaskPriority::BEST_EFFORT })
+ ->PostTask(FROM_HERE,
+ base::BindOnce(&WebUsbDetectorQt::Initialize,
+ base::Unretained(m_webUsbDetector.get())));
+ }
+ return content::RESULT_CODE_NORMAL_EXIT;
}
void BrowserMainPartsQt::PostMainMessageLoopRun()
{
+ performance_manager_lifetime_.reset();
+
+ m_webUsbDetector.reset();
+
// The ProfileQt's destructor uses the MessageLoop so it should be deleted
// right before the RenderProcessHostImpl's destructor destroys it.
WebEngineContext::current()->destroyProfileAdapter();
@@ -262,23 +267,39 @@ void BrowserMainPartsQt::PostMainMessageLoopRun()
int BrowserMainPartsQt::PreCreateThreads()
{
- base::ThreadRestrictions::SetIOAllowed(true);
-
-#if defined(OS_MACOSX)
+#if BUILDFLAG(IS_MAC)
ui::InitIdleMonitor();
#endif
// Like ChromeBrowserMainExtraPartsViews::PreCreateThreads does.
#if defined(Q_OS_WIN)
display::Screen::SetScreenInstance(new display::win::ScreenWin);
+#elif defined(Q_OS_DARWIN)
+ display::Screen::SetScreenInstance(display::CreateNativeScreen());
#else
display::Screen::SetScreenInstance(new DesktopScreenQt);
#endif
- return 0;
+ return content::RESULT_CODE_NORMAL_EXIT;
+}
+
+static void CreatePoliciesAndDecorators(performance_manager::Graph *graph)
+{
+ graph->PassToGraph(FormInteractionTabHelper::CreateGraphObserver());
}
void BrowserMainPartsQt::PostCreateThreads()
{
+ performance_manager_lifetime_ =
+ std::make_unique<performance_manager::PerformanceManagerLifetime>(
+ performance_manager::GraphFeatures::WithDefault(),
+ base::BindOnce(&QtWebEngineCore::CreatePoliciesAndDecorators));
+}
+
+#if BUILDFLAG(IS_MAC)
+device::GeolocationManager *BrowserMainPartsQt::GetGeolocationManager()
+{
+ return m_geolocationManager.get();
}
+#endif
} // namespace QtWebEngineCore
diff --git a/src/core/browser_main_parts_qt.h b/src/core/browser_main_parts_qt.h
index f287c2e44..6828552b7 100644
--- a/src/core/browser_main_parts_qt.h
+++ b/src/core/browser_main_parts_qt.h
@@ -1,47 +1,13 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef BROWSER_MAIN_PARTS_QT_H
#define BROWSER_MAIN_PARTS_QT_H
#include "content/public/browser/browser_main_parts.h"
+#include "web_usb_detector_qt.h"
+
namespace base {
class MessagePump;
}
@@ -50,6 +16,14 @@ namespace content {
class ServiceManagerConnection;
}
+namespace device {
+class GeolocationManager;
+}
+
+namespace performance_manager {
+class PerformanceManagerLifetime;
+}
+
namespace QtWebEngineCore {
std::unique_ptr<base::MessagePump> messagePumpFactory();
@@ -61,14 +35,23 @@ public:
~BrowserMainPartsQt() override = default;
int PreEarlyInitialization() override;
- void PreMainMessageLoopStart() override;
- void PreMainMessageLoopRun() override;
+ void PreCreateMainMessageLoop() override;
+ void PostCreateMainMessageLoop() override;
+ int PreMainMessageLoopRun() override;
void PostMainMessageLoopRun() override;
int PreCreateThreads() override;
void PostCreateThreads() override;
+#if BUILDFLAG(IS_MAC)
+ device::GeolocationManager *GetGeolocationManager();
+#endif
+
private:
- DISALLOW_COPY_AND_ASSIGN(BrowserMainPartsQt);
+ std::unique_ptr<performance_manager::PerformanceManagerLifetime> performance_manager_lifetime_;
+ std::unique_ptr<WebUsbDetectorQt> m_webUsbDetector;
+#if BUILDFLAG(IS_MAC)
+ std::unique_ptr<device::GeolocationManager> m_geolocationManager;
+#endif
};
} // namespace QtWebEngineCore
diff --git a/src/core/browser_message_filter_qt.cpp b/src/core/browser_message_filter_qt.cpp
index a4b75f075..e8fcb994a 100644
--- a/src/core/browser_message_filter_qt.cpp
+++ b/src/core/browser_message_filter_qt.cpp
@@ -1,46 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "browser_message_filter_qt.h"
#include "chrome/browser/profiles/profile.h"
-#include "content/public/browser/plugin_service.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_getter.h"
@@ -56,103 +19,85 @@ BrowserMessageFilterQt::BrowserMessageFilterQt(int /*render_process_id*/, Profil
{
}
-// The following is based on chrome/browser/plugins/plugin_info_message_filter.cc:
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE.Chromium file.
-
bool BrowserMessageFilterQt::OnMessageReceived(const IPC::Message& message)
{
IPC_BEGIN_MESSAGE_MAP(BrowserMessageFilterQt, message)
- IPC_MESSAGE_HANDLER(QtWebEngineHostMsg_AllowDatabase, OnAllowDatabase)
- IPC_MESSAGE_HANDLER(QtWebEngineHostMsg_AllowDOMStorage, OnAllowDOMStorage)
- IPC_MESSAGE_HANDLER_DELAY_REPLY(QtWebEngineHostMsg_RequestFileSystemAccessSync,
- OnRequestFileSystemAccessSync)
- IPC_MESSAGE_HANDLER(QtWebEngineHostMsg_RequestFileSystemAccessAsync,
- OnRequestFileSystemAccessAsync)
- IPC_MESSAGE_HANDLER(QtWebEngineHostMsg_AllowIndexedDB, OnAllowIndexedDB)
+ IPC_MESSAGE_HANDLER(QtWebEngineHostMsg_AllowStorageAccess, OnAllowStorageAccess)
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(QtWebEngineHostMsg_RequestStorageAccessSync,
+ OnRequestStorageAccessSync)
+ IPC_MESSAGE_HANDLER(QtWebEngineHostMsg_RequestStorageAccessAsync,
+ OnRequestStorageAccessAsync)
IPC_MESSAGE_UNHANDLED(return false)
IPC_END_MESSAGE_MAP()
return true;
}
-void BrowserMessageFilterQt::OnAllowDatabase(int /*render_frame_id*/,
- const GURL &origin_url,
- const GURL &top_origin_url,
- bool* allowed)
-{
- *allowed = m_profileData->canGetCookies(toQt(top_origin_url), toQt(origin_url));
-}
-
-void BrowserMessageFilterQt::OnAllowDOMStorage(int /*render_frame_id*/,
- const GURL &origin_url,
- const GURL &top_origin_url,
- bool /*local*/,
- bool *allowed)
-{
- *allowed = m_profileData->canGetCookies(toQt(top_origin_url), toQt(origin_url));
-}
-
-void BrowserMessageFilterQt::OnAllowIndexedDB(int /*render_frame_id*/,
- const GURL &origin_url,
- const GURL &top_origin_url,
- bool *allowed)
+void BrowserMessageFilterQt::OnAllowStorageAccess(int /*render_frame_id*/,
+ const GURL &origin_url,
+ const GURL &top_origin_url,
+ int /*storage_type*/,
+ bool *allowed)
{
*allowed = m_profileData->canGetCookies(toQt(top_origin_url), toQt(origin_url));
}
-void BrowserMessageFilterQt::OnRequestFileSystemAccessSync(int render_frame_id,
- const GURL& origin_url,
- const GURL& top_origin_url,
- IPC::Message* reply_msg)
+void BrowserMessageFilterQt::OnRequestStorageAccessSync(int render_frame_id,
+ const GURL& origin_url,
+ const GURL& top_origin_url,
+ int storage_type,
+ IPC::Message* reply_msg)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
- base::Callback<void(bool)> callback = base::Bind(
- &BrowserMessageFilterQt::OnRequestFileSystemAccessSyncResponse,
+ auto callback = base::BindOnce(
+ &BrowserMessageFilterQt::OnRequestStorageAccessSyncResponse,
base::WrapRefCounted(this), reply_msg);
- OnRequestFileSystemAccess(render_frame_id,
- origin_url,
- top_origin_url,
- callback);
+ OnRequestStorageAccess(render_frame_id,
+ origin_url,
+ top_origin_url,
+ storage_type,
+ std::move(callback));
}
-void BrowserMessageFilterQt::OnRequestFileSystemAccessSyncResponse(IPC::Message *reply_msg, bool allowed)
+void BrowserMessageFilterQt::OnRequestStorageAccessSyncResponse(IPC::Message *reply_msg, bool allowed)
{
- QtWebEngineHostMsg_RequestFileSystemAccessSync::WriteReplyParams(reply_msg, allowed);
+ QtWebEngineHostMsg_RequestStorageAccessSync::WriteReplyParams(reply_msg, allowed);
Send(reply_msg);
}
-void BrowserMessageFilterQt::OnRequestFileSystemAccessAsync(int render_frame_id,
- int request_id,
- const GURL& origin_url,
- const GURL& top_origin_url)
+void BrowserMessageFilterQt::OnRequestStorageAccessAsync(int render_frame_id,
+ int request_id,
+ const GURL& origin_url,
+ const GURL& top_origin_url,
+ int storage_type)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
- base::Callback<void(bool)> callback = base::Bind(
- &BrowserMessageFilterQt::OnRequestFileSystemAccessAsyncResponse,
+ auto callback = base::BindOnce(
+ &BrowserMessageFilterQt::OnRequestStorageAccessAsyncResponse,
base::WrapRefCounted(this), render_frame_id, request_id);
- OnRequestFileSystemAccess(render_frame_id,
- origin_url,
- top_origin_url,
- callback);
+ OnRequestStorageAccess(render_frame_id,
+ origin_url,
+ top_origin_url,
+ storage_type,
+ std::move(callback));
}
-void BrowserMessageFilterQt::OnRequestFileSystemAccessAsyncResponse(int render_frame_id,
- int request_id,
- bool allowed)
+void BrowserMessageFilterQt::OnRequestStorageAccessAsyncResponse(int render_frame_id,
+ int request_id,
+ bool allowed)
{
- Send(new QtWebEngineMsg_RequestFileSystemAccessAsyncResponse(render_frame_id, request_id, allowed));
+ Send(new QtWebEngineMsg_RequestStorageAccessAsyncResponse(render_frame_id, request_id, allowed));
}
-void BrowserMessageFilterQt::OnRequestFileSystemAccess(int /*render_frame_id*/,
- const GURL &origin_url,
- const GURL &top_origin_url,
- base::Callback<void(bool)> callback)
+void BrowserMessageFilterQt::OnRequestStorageAccess(int /*render_frame_id*/,
+ const GURL &origin_url,
+ const GURL &top_origin_url,
+ int /*storage_type*/,
+ base::OnceCallback<void(bool)> callback)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
bool allowed = m_profileData->canGetCookies(toQt(top_origin_url), toQt(origin_url));
- callback.Run(allowed);
+ std::move(callback).Run(allowed);
}
} // namespace QtWebEngineCore
diff --git a/src/core/browser_message_filter_qt.h b/src/core/browser_message_filter_qt.h
index 4abc612f8..0f5721c82 100644
--- a/src/core/browser_message_filter_qt.h
+++ b/src/core/browser_message_filter_qt.h
@@ -1,48 +1,11 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef BROWSER_MESSAGE_FILTER_QT_H
#define BROWSER_MESSAGE_FILTER_QT_H
-#include "base/callback.h"
+#include "base/functional/callback.h"
#include "content/public/browser/browser_message_filter.h"
-#include "content/public/common/webplugininfo.h"
class GURL;
class Profile;
@@ -59,39 +22,33 @@ public:
private:
bool OnMessageReceived(const IPC::Message& message) override;
- void OnAllowDatabase(int render_frame_id,
- const GURL &origin_url,
- const GURL &top_origin_url,
- bool *allowed);
- void OnAllowDOMStorage(int render_frame_id,
- const GURL &origin_url,
- const GURL &top_origin_url,
- bool local,
- bool *allowed);
-
- void OnAllowIndexedDB(int render_frame_id,
- const GURL &origin_url,
- const GURL &top_origin_url,
- bool *allowed);
-
- void OnRequestFileSystemAccessSync(int render_frame_id,
- const GURL &origin_url,
- const GURL &top_origin_url,
- IPC::Message *message);
- void OnRequestFileSystemAccessAsync(int render_frame_id,
- int request_id,
- const GURL &origin_url,
- const GURL &top_origin_url);
- void OnRequestFileSystemAccessSyncResponse(IPC::Message *reply_msg,
- bool allowed);
- void OnRequestFileSystemAccessAsyncResponse(int render_frame_id,
- int request_id,
- bool allowed);
- void OnRequestFileSystemAccess(int render_frame_id,
- const GURL &origin_url,
- const GURL &top_origin_url,
- base::Callback<void(bool)> callback);
+ void OnAllowStorageAccess(int render_frame_id,
+ const GURL &origin_url,
+ const GURL &top_origin_url,
+ int storage_type,
+ bool *allowed);
+
+ void OnRequestStorageAccessSync(int render_frame_id,
+ const GURL &origin_url,
+ const GURL &top_origin_url,
+ int storage_type,
+ IPC::Message *message);
+ void OnRequestStorageAccessAsync(int render_frame_id,
+ int request_id,
+ const GURL &origin_url,
+ const GURL &top_origin_url,
+ int storage_type);
+ void OnRequestStorageAccessSyncResponse(IPC::Message *reply_msg,
+ bool allowed);
+ void OnRequestStorageAccessAsyncResponse(int render_frame_id,
+ int request_id,
+ bool allowed);
+ void OnRequestStorageAccess(int render_frame_id,
+ const GURL &origin_url,
+ const GURL &top_origin_url,
+ int storage_type,
+ base::OnceCallback<void(bool)> callback);
ProfileIODataQt *m_profileData;
};
diff --git a/src/core/browsing_data_remover_delegate_qt.cpp b/src/core/browsing_data_remover_delegate_qt.cpp
index 344ba817f..eb33fb992 100644
--- a/src/core/browsing_data_remover_delegate_qt.cpp
+++ b/src/core/browsing_data_remover_delegate_qt.cpp
@@ -1,46 +1,10 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "browsing_data_remover_delegate_qt.h"
-#include "base/bind.h"
-#include "base/callback.h"
+#include "base/functional/bind.h"
+#include "base/functional/callback.h"
#include "components/web_cache/browser/web_cache_manager.h"
#include "content/public/browser/browsing_data_remover.h"
@@ -48,7 +12,7 @@
namespace QtWebEngineCore {
-bool DoesOriginMatchEmbedderMask(int origin_type_mask,
+bool DoesOriginMatchEmbedderMask(uint64_t origin_type_mask,
const url::Origin &origin,
storage::SpecialStoragePolicy *policy)
{
@@ -70,10 +34,10 @@ bool BrowsingDataRemoverDelegateQt::MayRemoveDownloadHistory()
void BrowsingDataRemoverDelegateQt::RemoveEmbedderData(const base::Time &delete_begin,
const base::Time &delete_end,
- int remove_mask,
+ uint64_t remove_mask,
content::BrowsingDataFilterBuilder *filter_builder,
- int origin_type_mask,
- base::OnceClosure callback)
+ uint64_t origin_type_mask,
+ base::OnceCallback<void(/*failed_data_types=*/uint64_t)> callback)
{
Q_UNUSED(delete_begin);
Q_UNUSED(delete_end);
@@ -83,7 +47,13 @@ void BrowsingDataRemoverDelegateQt::RemoveEmbedderData(const base::Time &delete_
if (remove_mask & content::BrowsingDataRemover::DATA_TYPE_CACHE)
web_cache::WebCacheManager::GetInstance()->ClearCache();
- std::move(callback).Run();
+ std::move(callback).Run(0);
+}
+
+std::vector<std::string> BrowsingDataRemoverDelegateQt::GetDomainsForDeferredCookieDeletion(
+ content::StoragePartition *, uint64_t)
+{
+ return {};
}
} // namespace QtWebEngineCore
diff --git a/src/core/browsing_data_remover_delegate_qt.h b/src/core/browsing_data_remover_delegate_qt.h
index dc2761ffc..d33af4acb 100644
--- a/src/core/browsing_data_remover_delegate_qt.h
+++ b/src/core/browsing_data_remover_delegate_qt.h
@@ -1,45 +1,11 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef BROWSING_DATA_REMOVER_DELEGATE_QT_H
#define BROWSING_DATA_REMOVER_DELEGATE_QT_H
+#include <cstdint>
+
#include "content/public/browser/browsing_data_remover_delegate.h"
namespace QtWebEngineCore {
@@ -53,12 +19,15 @@ public:
content::BrowsingDataRemoverDelegate::EmbedderOriginTypeMatcher GetOriginTypeMatcher() override;
bool MayRemoveDownloadHistory() override;
void RemoveEmbedderData(
- const base::Time &delete_begin,
- const base::Time &delete_end,
- int remove_mask,
- content::BrowsingDataFilterBuilder *filter_builder,
- int origin_type_mask,
- base::OnceClosure callback) override;
+ const base::Time &delete_begin,
+ const base::Time &delete_end,
+ uint64_t remove_mask,
+ content::BrowsingDataFilterBuilder *filter_builder,
+ uint64_t origin_type_mask,
+ base::OnceCallback<void(/*failed_data_types=*/uint64_t)> callback) override;
+ std::vector<std::string> GetDomainsForDeferredCookieDeletion(
+ content::StoragePartition *storage_partition,
+ uint64_t remove_mask) override;
};
} // namespace QtWebEngineCore
diff --git a/src/core/build_config_qt.h b/src/core/build_config_qt.h
index 9c7a77d65..5f6978e13 100644
--- a/src/core/build_config_qt.h
+++ b/src/core/build_config_qt.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef BUILD_CONFIG_QT
#define BUILD_CONFIG_QT
diff --git a/src/core/certificate_error_controller.cpp b/src/core/certificate_error_controller.cpp
index 353228c2d..014d74500 100644
--- a/src/core/certificate_error_controller.cpp
+++ b/src/core/certificate_error_controller.cpp
@@ -1,44 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "certificate_error_controller.h"
-#include "certificate_error_controller_p.h"
#include <net/base/net_errors.h>
#include <net/cert/x509_certificate.h>
@@ -48,98 +11,142 @@
#include "components/strings/grit/components_strings.h"
#include "type_conversion.h"
-QT_BEGIN_NAMESPACE
-
-using namespace QtWebEngineCore;
-
-ASSERT_ENUMS_MATCH(CertificateErrorController::SslPinnedKeyNotInCertificateChain, net::ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN)
-ASSERT_ENUMS_MATCH(CertificateErrorController::CertificateCommonNameInvalid, net::ERR_CERT_BEGIN)
-ASSERT_ENUMS_MATCH(CertificateErrorController::CertificateCommonNameInvalid, net::ERR_CERT_COMMON_NAME_INVALID)
-ASSERT_ENUMS_MATCH(CertificateErrorController::CertificateDateInvalid, net::ERR_CERT_DATE_INVALID)
-ASSERT_ENUMS_MATCH(CertificateErrorController::CertificateAuthorityInvalid, net::ERR_CERT_AUTHORITY_INVALID)
-ASSERT_ENUMS_MATCH(CertificateErrorController::CertificateContainsErrors, net::ERR_CERT_CONTAINS_ERRORS)
-ASSERT_ENUMS_MATCH(CertificateErrorController::CertificateUnableToCheckRevocation, net::ERR_CERT_UNABLE_TO_CHECK_REVOCATION)
-ASSERT_ENUMS_MATCH(CertificateErrorController::CertificateRevoked, net::ERR_CERT_REVOKED)
-ASSERT_ENUMS_MATCH(CertificateErrorController::CertificateInvalid, net::ERR_CERT_INVALID)
-ASSERT_ENUMS_MATCH(CertificateErrorController::CertificateWeakSignatureAlgorithm, net::ERR_CERT_WEAK_SIGNATURE_ALGORITHM)
-ASSERT_ENUMS_MATCH(CertificateErrorController::CertificateNonUniqueName, net::ERR_CERT_NON_UNIQUE_NAME)
-ASSERT_ENUMS_MATCH(CertificateErrorController::CertificateWeakKey, net::ERR_CERT_WEAK_KEY)
-ASSERT_ENUMS_MATCH(CertificateErrorController::CertificateNameConstraintViolation, net::ERR_CERT_NAME_CONSTRAINT_VIOLATION)
-ASSERT_ENUMS_MATCH(CertificateErrorController::CertificateValidityTooLong, net::ERR_CERT_VALIDITY_TOO_LONG)
-ASSERT_ENUMS_MATCH(CertificateErrorController::CertificateTransparencyRequired, net::ERR_CERTIFICATE_TRANSPARENCY_REQUIRED)
-ASSERT_ENUMS_MATCH(CertificateErrorController::CertificateSymantecLegacy, net::ERR_CERT_SYMANTEC_LEGACY)
-ASSERT_ENUMS_MATCH(CertificateErrorController::CertificateKnownInterceptionBlocked, net::ERR_CERT_KNOWN_INTERCEPTION_BLOCKED)
-ASSERT_ENUMS_MATCH(CertificateErrorController::CertificateErrorEnd, net::ERR_CERT_END)
-
-void CertificateErrorControllerPrivate::accept(bool accepted)
+namespace QtWebEngineCore {
+
+ASSERT_ENUMS_MATCH(QWebEngineCertificateError::SslPinnedKeyNotInCertificateChain,
+ net::ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN)
+ASSERT_ENUMS_MATCH(QWebEngineCertificateError::CertificateCommonNameInvalid, net::ERR_CERT_BEGIN)
+ASSERT_ENUMS_MATCH(QWebEngineCertificateError::CertificateCommonNameInvalid,
+ net::ERR_CERT_COMMON_NAME_INVALID)
+ASSERT_ENUMS_MATCH(QWebEngineCertificateError::CertificateDateInvalid, net::ERR_CERT_DATE_INVALID)
+ASSERT_ENUMS_MATCH(QWebEngineCertificateError::CertificateAuthorityInvalid,
+ net::ERR_CERT_AUTHORITY_INVALID)
+ASSERT_ENUMS_MATCH(QWebEngineCertificateError::CertificateContainsErrors,
+ net::ERR_CERT_CONTAINS_ERRORS)
+ASSERT_ENUMS_MATCH(QWebEngineCertificateError::CertificateUnableToCheckRevocation,
+ net::ERR_CERT_UNABLE_TO_CHECK_REVOCATION)
+ASSERT_ENUMS_MATCH(QWebEngineCertificateError::CertificateRevoked, net::ERR_CERT_REVOKED)
+ASSERT_ENUMS_MATCH(QWebEngineCertificateError::CertificateInvalid, net::ERR_CERT_INVALID)
+ASSERT_ENUMS_MATCH(QWebEngineCertificateError::CertificateWeakSignatureAlgorithm,
+ net::ERR_CERT_WEAK_SIGNATURE_ALGORITHM)
+ASSERT_ENUMS_MATCH(QWebEngineCertificateError::CertificateNonUniqueName,
+ net::ERR_CERT_NON_UNIQUE_NAME)
+ASSERT_ENUMS_MATCH(QWebEngineCertificateError::CertificateWeakKey, net::ERR_CERT_WEAK_KEY)
+ASSERT_ENUMS_MATCH(QWebEngineCertificateError::CertificateNameConstraintViolation,
+ net::ERR_CERT_NAME_CONSTRAINT_VIOLATION)
+ASSERT_ENUMS_MATCH(QWebEngineCertificateError::CertificateValidityTooLong,
+ net::ERR_CERT_VALIDITY_TOO_LONG)
+ASSERT_ENUMS_MATCH(QWebEngineCertificateError::CertificateTransparencyRequired,
+ net::ERR_CERTIFICATE_TRANSPARENCY_REQUIRED)
+ASSERT_ENUMS_MATCH(QWebEngineCertificateError::CertificateSymantecLegacy,
+ net::ERR_CERT_SYMANTEC_LEGACY)
+ASSERT_ENUMS_MATCH(QWebEngineCertificateError::CertificateKnownInterceptionBlocked,
+ net::ERR_CERT_KNOWN_INTERCEPTION_BLOCKED)
+// net::ERR_SSL_OBSOLETE_VERSION was removed again in Chromium 98
+//ASSERT_ENUMS_MATCH(QWebEngineCertificateError::SslObsoleteVersion,
+// net::ERR_SSL_OBSOLETE_VERSION)
+//ASSERT_ENUMS_MATCH(QWebEngineCertificateError::CertificateErrorEnd, net::ERR_CERT_END)
+
+// Copied from chrome/browser/ssl/ssl_error_handler.cc:
+static int IsCertErrorFatal(int cert_error)
{
- std::move(callback).Run(accepted ? content::CERTIFICATE_REQUEST_RESULT_TYPE_CONTINUE : content::CERTIFICATE_REQUEST_RESULT_TYPE_DENY);
+ switch (cert_error) {
+ case net::ERR_CERT_COMMON_NAME_INVALID:
+ case net::ERR_CERT_DATE_INVALID:
+ case net::ERR_CERT_AUTHORITY_INVALID:
+ case net::ERR_CERT_NO_REVOCATION_MECHANISM:
+ case net::ERR_CERT_UNABLE_TO_CHECK_REVOCATION:
+ case net::ERR_CERT_WEAK_SIGNATURE_ALGORITHM:
+ case net::ERR_CERT_WEAK_KEY:
+ case net::ERR_CERT_NAME_CONSTRAINT_VIOLATION:
+ case net::ERR_CERT_VALIDITY_TOO_LONG:
+ case net::ERR_CERTIFICATE_TRANSPARENCY_REQUIRED:
+ case net::ERR_CERT_SYMANTEC_LEGACY:
+ case net::ERR_CERT_KNOWN_INTERCEPTION_BLOCKED:
+ return false;
+ case net::ERR_CERT_CONTAINS_ERRORS:
+ case net::ERR_CERT_REVOKED:
+ case net::ERR_CERT_INVALID:
+ case net::ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN:
+ return true;
+ default:
+ NOTREACHED();
+ }
+ return true;
}
-CertificateErrorControllerPrivate::CertificateErrorControllerPrivate(int cert_error,
- const net::SSLInfo& ssl_info,
- const GURL &request_url,
- bool main_frame,
- bool fatal_error,
- bool strict_enforcement,
- base::OnceCallback<void(content::CertificateRequestResultType)> cb
- )
- : certError(CertificateErrorController::CertificateError(cert_error))
- , requestUrl(toQt(request_url))
- , resourceType(main_frame ? CertificateErrorController::ResourceTypeMainFrame : CertificateErrorController::ResourceTypeOther)
- , fatalError(fatal_error)
- , strictEnforcement(strict_enforcement)
- , callback(std::move(cb))
+CertificateErrorController::CertificateErrorController(
+ int cert_error, const net::SSLInfo &ssl_info, const GURL &request_url,
+ bool strict_enforcement, base::OnceCallback<void(content::CertificateRequestResultType)> cb)
+ : m_certError(QWebEngineCertificateError::Type(cert_error))
+ , m_requestUrl(toQt(request_url))
+ , m_overridable(!IsCertErrorFatal(cert_error) && !strict_enforcement)
{
+ // MEMO set callback anyway even for non overridable error since chromium halts load until it's called
+ // callback will be executed either explicitly by use code or implicitly when error goes out of scope
+ m_callback = std::move(cb);
+
if (auto cert = ssl_info.cert.get()) {
- validStart = toQt(cert->valid_start());
- validExpiry = toQt(cert->valid_expiry());
- certificateChain = toCertificateChain(cert);
+ m_validExpiry = toQt(cert->valid_expiry());
+ m_certificateChain = toCertificateChain(cert);
}
}
-CertificateErrorController::CertificateErrorController(CertificateErrorControllerPrivate *p) : d(p)
-{
-}
-
CertificateErrorController::~CertificateErrorController()
{
- delete d;
- d = 0;
+ if (!answered())
+ rejectCertificate();
}
-CertificateErrorController::CertificateError CertificateErrorController::error() const
+QWebEngineCertificateError::Type CertificateErrorController::error() const
{
- return d->certError;
+ return m_certError;
}
QUrl CertificateErrorController::url() const
{
- return d->requestUrl;
+ return m_requestUrl;
}
bool CertificateErrorController::overridable() const
{
- return !d->fatalError && !d->strictEnforcement;
+ return m_overridable;
}
-bool CertificateErrorController::strictEnforcement() const
+bool CertificateErrorController::deferred() const
{
- return d->strictEnforcement;
+ return m_deferred;
+}
+
+void CertificateErrorController::defer()
+{
+ m_deferred = true;
+}
+
+bool CertificateErrorController::answered() const
+{
+ return m_answered;
}
void CertificateErrorController::accept(bool accepted)
{
- d->accept(accepted);
+ if (answered())
+ return;
+
+ m_answered = true;
+ if (m_callback)
+ std::move(m_callback)
+ .Run(accepted ? content::CERTIFICATE_REQUEST_RESULT_TYPE_CONTINUE
+ : content::CERTIFICATE_REQUEST_RESULT_TYPE_DENY);
}
-CertificateErrorController::ResourceType CertificateErrorController::resourceType() const
+void CertificateErrorController::deactivate()
{
- return d->resourceType;
+ m_callback.Reset();
}
static QString getQStringForMessageId(int message_id) {
- base::string16 string = l10n_util::GetStringUTF16(message_id);
+ std::u16string string = l10n_util::GetStringUTF16(message_id);
return toQt(string);
}
@@ -148,41 +155,43 @@ QString CertificateErrorController::errorString() const
// Try to use chromiums translation of the error strings, though not all are
// consistently described and we need to use versions that does not contain HTML
// formatted text.
- switch (d->certError) {
- case SslPinnedKeyNotInCertificateChain:
+ switch (m_certError) {
+ case QWebEngineCertificateError::SslPinnedKeyNotInCertificateChain:
return getQStringForMessageId(IDS_CERT_ERROR_SUMMARY_PINNING_FAILURE_DETAILS);
- case CertificateCommonNameInvalid:
+ case QWebEngineCertificateError::CertificateCommonNameInvalid:
return getQStringForMessageId(IDS_CERT_ERROR_COMMON_NAME_INVALID_DESCRIPTION);
- case CertificateDateInvalid:
- if (QDateTime::currentDateTime() > d->validExpiry)
+ case QWebEngineCertificateError::CertificateDateInvalid:
+ if (QDateTime::currentDateTime() > m_validExpiry)
return getQStringForMessageId(IDS_CERT_ERROR_EXPIRED_DESCRIPTION);
else
return getQStringForMessageId(IDS_CERT_ERROR_NOT_YET_VALID_DESCRIPTION);
- case CertificateAuthorityInvalid:
- case CertificateKnownInterceptionBlocked:
- case CertificateSymantecLegacy:
+ case QWebEngineCertificateError::CertificateAuthorityInvalid:
+ case QWebEngineCertificateError::CertificateKnownInterceptionBlocked:
+ case QWebEngineCertificateError::CertificateSymantecLegacy:
return getQStringForMessageId(IDS_CERT_ERROR_AUTHORITY_INVALID_DESCRIPTION);
- case CertificateContainsErrors:
+ case QWebEngineCertificateError::CertificateContainsErrors:
return getQStringForMessageId(IDS_CERT_ERROR_CONTAINS_ERRORS_DESCRIPTION);
- case CertificateNoRevocationMechanism:
- return getQStringForMessageId(IDS_CERT_ERROR_NO_REVOCATION_MECHANISM_DETAILS);
- case CertificateRevoked:
+ case QWebEngineCertificateError::CertificateNoRevocationMechanism:
+ return getQStringForMessageId(IDS_CERT_ERROR_NO_REVOCATION_MECHANISM_DESCRIPTION);
+ case QWebEngineCertificateError::CertificateRevoked:
return getQStringForMessageId(IDS_CERT_ERROR_REVOKED_CERT_DESCRIPTION);
- case CertificateInvalid:
+ case QWebEngineCertificateError::CertificateInvalid:
return getQStringForMessageId(IDS_CERT_ERROR_INVALID_CERT_DESCRIPTION);
- case CertificateWeakSignatureAlgorithm:
+ case QWebEngineCertificateError::CertificateWeakSignatureAlgorithm:
return getQStringForMessageId(IDS_CERT_ERROR_WEAK_SIGNATURE_ALGORITHM_DESCRIPTION);
- case CertificateNonUniqueName:
+ case QWebEngineCertificateError::CertificateNonUniqueName:
return getQStringForMessageId(IDS_PAGE_INFO_SECURITY_TAB_NON_UNIQUE_NAME);
- case CertificateWeakKey:
+ case QWebEngineCertificateError::CertificateWeakKey:
return getQStringForMessageId(IDS_CERT_ERROR_WEAK_KEY_DESCRIPTION);
- case CertificateNameConstraintViolation:
+ case QWebEngineCertificateError::CertificateNameConstraintViolation:
return getQStringForMessageId(IDS_CERT_ERROR_NAME_CONSTRAINT_VIOLATION_DESCRIPTION);
- case CertificateValidityTooLong:
+ case QWebEngineCertificateError::CertificateValidityTooLong:
return getQStringForMessageId(IDS_CERT_ERROR_VALIDITY_TOO_LONG_DESCRIPTION);
- case CertificateTransparencyRequired:
+ case QWebEngineCertificateError::CertificateTransparencyRequired:
return getQStringForMessageId(IDS_CERT_ERROR_CERTIFICATE_TRANSPARENCY_REQUIRED_DESCRIPTION);
- case CertificateUnableToCheckRevocation: // Deprecated in Chromium.
+ case QWebEngineCertificateError::SslObsoleteVersion:
+ return getQStringForMessageId(IDS_SSL_ERROR_OBSOLETE_VERSION_DESCRIPTION);
+ case QWebEngineCertificateError::CertificateUnableToCheckRevocation: // Deprecated in Chromium.
default:
break;
}
@@ -192,7 +201,7 @@ QString CertificateErrorController::errorString() const
QList<QSslCertificate> CertificateErrorController::certificateChain() const
{
- return d->certificateChain;
+ return m_certificateChain;
}
-QT_END_NAMESPACE
+}
diff --git a/src/core/certificate_error_controller.h b/src/core/certificate_error_controller.h
index dc1c3cf54..cbcb60f8a 100644
--- a/src/core/certificate_error_controller.h
+++ b/src/core/certificate_error_controller.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
//
// W A R N I N G
@@ -53,82 +17,60 @@
#include "qtwebenginecoreglobal_p.h"
+#include "base/functional/callback.h"
+#include "content/public/browser/certificate_request_result_type.h"
+
+#include "qwebenginecertificateerror.h"
#include <QtCore/QDateTime>
+#include <QtCore/QScopedPointer>
#include <QtCore/QUrl>
#include <QtNetwork/QSslCertificate>
-QT_BEGIN_NAMESPACE
+namespace net {
+class SSLInfo;
+}
+class GURL;
-class CertificateErrorControllerPrivate;
+namespace QtWebEngineCore {
-class Q_WEBENGINECORE_PRIVATE_EXPORT CertificateErrorController {
+class Q_WEBENGINECORE_EXPORT CertificateErrorController {
public:
- CertificateErrorController(CertificateErrorControllerPrivate *p);
+ CertificateErrorController(
+ int cert_error, const net::SSLInfo &ssl_info, const GURL &request_url,
+ bool strict_enforcement,
+ base::OnceCallback<void(content::CertificateRequestResultType)> callback);
~CertificateErrorController();
- // We can't use QSslError::SslErrors, because the error categories doesn't map.
- // Keep up to date with net/base/net_errors.h and net::IsCertificateError():
- enum CertificateError {
- SslPinnedKeyNotInCertificateChain = -150,
- CertificateCommonNameInvalid = -200,
- CertificateDateInvalid = -201,
- CertificateAuthorityInvalid = -202,
- CertificateContainsErrors = -203,
- CertificateNoRevocationMechanism = -204,
- CertificateUnableToCheckRevocation = -205,
- CertificateRevoked = -206,
- CertificateInvalid = -207,
- CertificateWeakSignatureAlgorithm = -208,
- CertificateNonUniqueName = -210,
- CertificateWeakKey = -211,
- CertificateNameConstraintViolation = -212,
- CertificateValidityTooLong = -213,
- CertificateTransparencyRequired = -214,
- CertificateSymantecLegacy = -215,
- CertificateKnownInterceptionBlocked = -217,
- CertificateErrorEnd = -218 // not an error, just an enum boundary
- };
-
- CertificateError error() const;
+ QWebEngineCertificateError::Type error() const;
QUrl url() const;
bool overridable() const;
- bool strictEnforcement() const;
QString errorString() const;
- QDateTime validStart() const;
QDateTime validExpiry() const;
QList<QSslCertificate> certificateChain() const;
+ bool deferred() const;
+ void defer();
+
+ bool answered() const;
void accept(bool);
- // Note: The resource type should probably not be exported, since once accepted the certificate exception
- // counts for all resource types.
- // Keep up to date with webkit/common/resource_type.h
- enum ResourceType {
- ResourceTypeMainFrame = 0, // top level page
- ResourceTypeSubFrame, // frame or iframe
- ResourceTypeStylesheet, // a CSS stylesheet
- ResourceTypeScript, // an external script
- ResourceTypeImage, // an image (jpg/gif/png/etc)
- ResourceTypeFont, // a font
- ResourceTypeOther, // an "other" subresource.
- ResourceTypeObject, // an object (or embed) tag for a plugin,
- // or a resource that a plugin requested.
- ResourceTypeMedia, // a media resource.
- ResourceTypeWorker, // the main resource of a dedicated worker.
- ResourceTypeSharedWorker, // the main resource of a shared worker.
- ResourceTypePrefetch, // an explicitly requested prefetch
- ResourceTypeFavicon, // a favicon
- ResourceTypeXHR, // a XMLHttpRequest
- ResourceTypePing, // a ping request for <a ping>
- ResourceTypeServiceWorker, // the main resource of a service worker.
- };
-
- ResourceType resourceType() const;
+ void ignoreCertificateError() { accept(true); }
+ void rejectCertificate() { accept(false); }
+
+ void deactivate();
+
+ QWebEngineCertificateError::Type m_certError;
+ const QUrl m_requestUrl;
+ QDateTime m_validExpiry;
+ bool m_overridable;
+ base::OnceCallback<void(content::CertificateRequestResultType)> m_callback;
+ QList<QSslCertificate> m_certificateChain;
+
+ bool m_answered = false, m_deferred = false;
private:
- CertificateErrorControllerPrivate* d;
+ Q_DISABLE_COPY(CertificateErrorController)
};
-QT_END_NAMESPACE
-
+}
#endif // CERTIFICATE_ERROR_CONTROLLER_H
diff --git a/src/core/certificate_error_controller_p.h b/src/core/certificate_error_controller_p.h
deleted file mode 100644
index b0b0bc658..000000000
--- a/src/core/certificate_error_controller_p.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef CERTIFICATE_ERROR_CONTROLLER_P_H
-#define CERTIFICATE_ERROR_CONTROLLER_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "content/public/browser/content_browser_client.h"
-
-#include "certificate_error_controller.h"
-
-QT_BEGIN_NAMESPACE
-
-class CertificateErrorControllerPrivate {
-public:
- CertificateErrorControllerPrivate(int cert_error, const net::SSLInfo& ssl_info, const GURL& request_url, bool main_frame, bool fatal_error, bool strict_enforcement, base::OnceCallback<void(content::CertificateRequestResultType)> callback);
-
- void accept(bool accepted);
-
- CertificateErrorController::CertificateError certError;
- const QUrl requestUrl;
- QDateTime validStart;
- QDateTime validExpiry;
- CertificateErrorController::ResourceType resourceType;
- bool fatalError;
- bool strictEnforcement;
- base::OnceCallback<void(content::CertificateRequestResultType)> callback;
- QList<QSslCertificate> certificateChain;
-};
-
-QT_END_NAMESPACE
-
-#endif // CERTIFICATE_ERROR_CONTROLLER_P_H
diff --git a/src/core/chromium_overrides.cpp b/src/core/chromium_overrides.cpp
index 01937d3e7..28917e6c5 100644
--- a/src/core/chromium_overrides.cpp
+++ b/src/core/chromium_overrides.cpp
@@ -1,76 +1,41 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+#include "type_conversion.h"
#include "ozone/gl_context_qt.h"
#include "qtwebenginecoreglobal_p.h"
#include "web_contents_view_qt.h"
+#include "web_engine_library_info.h"
#include "base/values.h"
-#include "content/browser/accessibility/accessibility_tree_formatter_blink.h"
-#include "content/browser/accessibility/accessibility_tree_formatter_browser.h"
-#include "content/browser/renderer_host/render_widget_host_view_base.h"
#include "content/browser/web_contents/web_contents_impl.h"
+#include "content/browser/web_contents/web_contents_view.h"
#include "content/common/font_list.h"
+#include "content/public/browser/web_contents_view_delegate.h"
+#include "extensions/buildflags/buildflags.h"
+#include "extensions/common/constants.h"
+#include "gpu/vulkan/buildflags.h"
#include "ui/base/dragdrop/os_exchange_data.h"
#include "ui/base/dragdrop/os_exchange_data_provider_factory.h"
-#include "ui/events/devices/device_data_manager.h"
-#include "ui/events/platform/platform_event_source.h"
-#include "ui/snapshot/snapshot.h"
-#include "ppapi/buildflags/buildflags.h"
#include <QGuiApplication>
-#include <QScreen>
-#include <QWindow>
#include <QFontDatabase>
-#include <QStringList>
#include <QLibraryInfo>
-#if defined(USE_AURA) && !defined(USE_OZONE)
-#include "ui/base/dragdrop/os_exchange_data.h"
-#include "ui/base/dragdrop/os_exchange_data_provider_aura.h"
-#include "ui/gfx/render_text.h"
-#include "ui/gfx/platform_font.h"
+#if !QT_CONFIG(webengine_webrtc) && QT_CONFIG(webengine_extensions)
+#include "chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_api.h"
#endif
-#if defined(USE_OPENSSL_CERTS)
-#include "net/ssl/openssl_client_key_store.h"
-#endif
+#if BUILDFLAG(ENABLE_VULKAN)
+#include "compositor/vulkan_implementation_qt.h"
+
+#include "gpu/vulkan/init/vulkan_factory.h"
+
+#if defined(USE_OZONE)
+#include "ui/ozone/public/ozone_platform.h"
+#include "ui/ozone/public/surface_factory_ozone.h"
+#endif // defined(USE_OZONE)
+#endif // defined(ENABLE_VULKAN)
void *GetQtXDisplay()
{
@@ -78,124 +43,166 @@ void *GetQtXDisplay()
}
namespace content {
-class WebContentsImpl;
-class WebContentsView;
-class WebContentsViewDelegate;
class RenderViewHostDelegateView;
-WebContentsView* CreateWebContentsView(WebContentsImpl *web_contents,
- WebContentsViewDelegate *,
- RenderViewHostDelegateView **render_view_host_delegate_view)
+std::unique_ptr<WebContentsView> CreateWebContentsView(
+ WebContentsImpl *web_contents,
+ std::unique_ptr<WebContentsViewDelegate> delegate,
+ raw_ptr<RenderViewHostDelegateView>* render_view_host_delegate_view)
{
- QtWebEngineCore::WebContentsViewQt* rv = new QtWebEngineCore::WebContentsViewQt(web_contents);
+ QtWebEngineCore::WebContentsViewQt *rv = new QtWebEngineCore::WebContentsViewQt(web_contents);
*render_view_host_delegate_view = rv;
- return rv;
+ return std::unique_ptr<WebContentsView>(rv);
}
-#if defined(Q_OS_MACOS)
-std::string getQtPrefix()
+#if defined(Q_OS_DARWIN)
+#if defined(QT_MAC_FRAMEWORK_BUILD)
+base::FilePath getSandboxPath()
+{
+ return WebEngineLibraryInfo::getPath(QT_FRAMEWORK_BUNDLE);
+}
+#else
+base::FilePath getSandboxPath()
{
const QString prefix = QLibraryInfo::location(QLibraryInfo::PrefixPath);
- return prefix.toStdString();
+ return QtWebEngineCore::toFilePath(prefix);
}
#endif
-
+#endif
} // namespace content
#if defined(USE_AURA) || defined(USE_OZONE)
namespace content {
// content/common/font_list.h
-std::unique_ptr<base::ListValue> GetFontList_SlowBlocking()
+base::Value::List GetFontList_SlowBlocking()
{
- std::unique_ptr<base::ListValue> font_list(new base::ListValue);
+ base::Value::List font_list;
- QFontDatabase database;
- for (auto family : database.families()){
- std::unique_ptr<base::ListValue> font_item(new base::ListValue());
- font_item->AppendString(family.toStdString());
- font_item->AppendString(family.toStdString()); // localized name.
+ for (auto family : QFontDatabase::families()){
+ base::Value::List font_item;
+ font_item.Append(family.toStdString());
+ font_item.Append(family.toStdString()); // localized name.
// TODO(yusukes): Support localized family names.
- font_list->Append(std::move(font_item));
+ font_list.Append(std::move(font_item));
}
return font_list;
}
} // namespace content
+#endif // defined(USE_AURA) || defined(USE_OZONE)
-namespace aura {
-class Window;
-}
+#if BUILDFLAG(ENABLE_VULKAN)
+namespace gpu {
+std::unique_ptr<VulkanImplementation> CreateVulkanImplementation(bool use_swiftshader,
+ bool allow_protected_memory)
+{
+#if QT_CONFIG(webengine_vulkan)
+#if BUILDFLAG(IS_APPLE)
+ // TODO: Investigate if we can support MoltenVK.
+ NOTIMPLEMENTED();
+ return nullptr;
+#else
+#if defined(USE_OZONE)
+ return ui::OzonePlatform::GetInstance()->GetSurfaceFactoryOzone()->CreateVulkanImplementation(
+ use_swiftshader, allow_protected_memory);
+#endif
+
+#if !BUILDFLAG(IS_WIN)
+ // TODO(samans): Support Swiftshader on more platforms.
+ // https://crbug.com/963988
+ DCHECK(!use_swiftshader) << "Vulkan Swiftshader is not supported on this platform.";
+#endif // !BUILDFLAG(IS_WIN)
-namespace wm {
-class ActivationClient;
+ // Protected memory is supported only on Fuchsia, which uses Ozone, i.e.
+ // VulkanImplementation is initialized above.
+ DCHECK(!allow_protected_memory) << "Protected memory is not supported on this platform.";
+
+ return std::make_unique<VulkanImplementationQt>();
+#endif // BUILDFLAG(IS_APPLE)
+#else
+ NOTREACHED();
+ return nullptr;
+#endif // QT_CONFIG(webengine_vulkan)
+}
+} // namespace gpu
+#endif // BUILDFLAG(ENABLE_VULKAN)
-ActivationClient *GetActivationClient(aura::Window *)
+std::unique_ptr<ui::OSExchangeDataProvider> ui::OSExchangeDataProviderFactory::CreateProvider()
{
return nullptr;
}
-} // namespace wm
-#endif // defined(USE_AURA) || defined(USE_OZONE)
+#if !QT_CONFIG(webengine_webrtc) && QT_CONFIG(webengine_extensions)
+namespace extensions {
+ExtensionFunction::ResponseAction WebrtcLoggingPrivateSetMetaDataFunction::Run()
+{
+ return RespondNow(NoArguments());
+}
-namespace content {
-std::vector<AccessibilityTreeFormatter::TestPass> AccessibilityTreeFormatter::GetTestPasses()
+ExtensionFunction::ResponseAction WebrtcLoggingPrivateStartFunction::Run()
{
- return {
- {"blink", &AccessibilityTreeFormatterBlink::CreateBlink, nullptr},
- {"native", &AccessibilityTreeFormatter::Create, nullptr},
- };
+ return RespondNow(NoArguments());
}
-} // namespace content
-#if defined(USE_AURA)
-namespace ui {
+ExtensionFunction::ResponseAction WebrtcLoggingPrivateSetUploadOnRenderCloseFunction::Run()
+{
+ return RespondNow(NoArguments());
+}
-bool GrabWindowSnapshot(gfx::NativeWindow window,
- const gfx::Rect& snapshot_bounds,
- gfx::Image* image)
+ExtensionFunction::ResponseAction WebrtcLoggingPrivateStopFunction::Run()
{
- NOTIMPLEMENTED();
- return false;
+ return RespondNow(NoArguments());
}
-bool GrabViewSnapshot(gfx::NativeView view,
- const gfx::Rect& snapshot_bounds,
- gfx::Image* image)
+ExtensionFunction::ResponseAction WebrtcLoggingPrivateStoreFunction::Run()
{
- NOTIMPLEMENTED();
- return false;
+ return RespondNow(NoArguments());
}
-void GrabWindowSnapshotAndScaleAsync(gfx::NativeWindow window,
- const gfx::Rect& source_rect,
- const gfx::Size& target_size,
- GrabWindowSnapshotAsyncCallback callback)
+ExtensionFunction::ResponseAction WebrtcLoggingPrivateUploadStoredFunction::Run()
{
- NOTIMPLEMENTED();
- std::move(callback).Run(gfx::Image());
+ return RespondNow(NoArguments());
}
-void GrabWindowSnapshotAsync(gfx::NativeWindow window,
- const gfx::Rect& source_rect,
- GrabWindowSnapshotAsyncCallback callback)
+ExtensionFunction::ResponseAction WebrtcLoggingPrivateUploadFunction::Run()
{
- NOTIMPLEMENTED();
- std::move(callback).Run(gfx::Image());
+ return RespondNow(NoArguments());
}
-void GrabViewSnapshotAsync(gfx::NativeView view,
- const gfx::Rect& source_rect,
- GrabWindowSnapshotAsyncCallback callback)
+ExtensionFunction::ResponseAction WebrtcLoggingPrivateDiscardFunction::Run()
{
- NOTIMPLEMENTED();
- std::move(callback).Run(gfx::Image());
+ return RespondNow(NoArguments());
}
-} // namespace ui
-#endif // defined(USE_AURA)
+ExtensionFunction::ResponseAction WebrtcLoggingPrivateStartRtpDumpFunction::Run()
+{
+ return RespondNow(NoArguments());
+}
-std::unique_ptr<ui::OSExchangeData::Provider>
-ui::OSExchangeDataProviderFactory::CreateProvider() {
- return nullptr;
+ExtensionFunction::ResponseAction WebrtcLoggingPrivateStopRtpDumpFunction::Run()
+{
+ return RespondNow(NoArguments());
+}
+
+ExtensionFunction::ResponseAction WebrtcLoggingPrivateStartAudioDebugRecordingsFunction::Run()
+{
+ return RespondNow(NoArguments());
+}
+
+ExtensionFunction::ResponseAction WebrtcLoggingPrivateStopAudioDebugRecordingsFunction::Run()
+{
+ return RespondNow(NoArguments());
+}
+
+ExtensionFunction::ResponseAction WebrtcLoggingPrivateStartEventLoggingFunction::Run()
+{
+ return RespondNow(NoArguments());
+}
+
+ExtensionFunction::ResponseAction WebrtcLoggingPrivateGetLogsDirectoryFunction::Run()
+{
+ return RespondNow(NoArguments());
}
+} // namespace extensions
+#endif // !QT_CONFIG(webengine_webrtc) && QT_CONFIG(webengine_extensions)
diff --git a/src/core/client_cert_select_controller.cpp b/src/core/client_cert_select_controller.cpp
index 0baaf2bc5..d6af984c1 100644
--- a/src/core/client_cert_select_controller.cpp
+++ b/src/core/client_cert_select_controller.cpp
@@ -1,58 +1,21 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "client_cert_select_controller.h"
-#include <base/bind.h>
+#include <base/functional/bind.h>
#include <content/public/browser/client_certificate_delegate.h>
#include <net/cert/x509_certificate.h>
#include <net/ssl/client_cert_identity.h>
#include <net/ssl/ssl_cert_request_info.h>
#include <net/ssl/ssl_info.h>
+#include "net/ssl/ssl_private_key.h"
#include "type_conversion.h"
#include <QDebug>
-QT_BEGIN_NAMESPACE
-
-using namespace QtWebEngineCore;
+namespace QtWebEngineCore {
ClientCertSelectController::ClientCertSelectController(net::SSLCertRequestInfo *certRequestInfo,
std::vector<std::unique_ptr<net::ClientCertIdentity>> clientCerts,
@@ -73,8 +36,6 @@ ClientCertSelectController::~ClientCertSelectController()
m_delegate->ContinueWithCertificate(nullptr, nullptr);
}
-#if !defined(QT_NO_SSL) || QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
-
void ClientCertSelectController::selectNone()
{
if (m_selected) {
@@ -97,8 +58,8 @@ void ClientCertSelectController::select(int index)
scoped_refptr<net::X509Certificate> cert = certInfo->certificate();
net::ClientCertIdentity::SelfOwningAcquirePrivateKey(
std::move(certInfo),
- base::Bind(&content::ClientCertificateDelegate::ContinueWithCertificate,
- base::Passed(std::move(m_delegate)), std::move(cert)));
+ base::BindOnce(&content::ClientCertificateDelegate::ContinueWithCertificate,
+ std::move(m_delegate), std::move(cert)));
return;
}
std::vector<std::string> pem_encoded;
@@ -116,15 +77,16 @@ void ClientCertSelectController::select(const QSslCertificate &certificate)
}
QByteArray derCertificate = certificate.toDer();
scoped_refptr<net::X509Certificate> selectedCert =
- net::X509Certificate::CreateFromBytes(derCertificate.constData(), derCertificate.length());
+ net::X509Certificate::CreateFromBytes(base::make_span((const unsigned char *)derCertificate.constData(),
+ (long unsigned)derCertificate.length()));
for (auto &certInfo : m_clientCerts) {
scoped_refptr<net::X509Certificate> cert = certInfo->certificate();
if (cert->EqualsExcludingChain(selectedCert.get())) {
m_selected = true;
net::ClientCertIdentity::SelfOwningAcquirePrivateKey(
std::move(certInfo),
- base::Bind(&content::ClientCertificateDelegate::ContinueWithCertificate,
- base::Passed(std::move(m_delegate)), std::move(cert)));
+ base::BindOnce(&content::ClientCertificateDelegate::ContinueWithCertificate,
+ std::move(m_delegate), std::move(cert)));
return;
}
}
@@ -132,7 +94,7 @@ void ClientCertSelectController::select(const QSslCertificate &certificate)
<< " Selected certificate needs to be one of the offered";
}
-QVector<QSslCertificate> ClientCertSelectController::certificates() const
+QList<QSslCertificate> ClientCertSelectController::certificates() const
{
if (!m_certificates.isEmpty())
return m_certificates;
@@ -144,6 +106,4 @@ QVector<QSslCertificate> ClientCertSelectController::certificates() const
return m_certificates;
}
-#endif // !defined(QT_NO_SSL) || QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
-
-QT_END_NAMESPACE
+}
diff --git a/src/core/client_cert_select_controller.h b/src/core/client_cert_select_controller.h
index f121c1155..8380a7845 100644
--- a/src/core/client_cert_select_controller.h
+++ b/src/core/client_cert_select_controller.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
//
// W A R N I N G
@@ -51,14 +15,12 @@
#ifndef CLIENT_CERT_SELECT_CONTROLLER_H
#define CLIENT_CERT_SELECT_CONTROLLER_H
-#include "qtwebenginecoreglobal_p.h"
+#include <QtWebEngineCore/private/qtwebenginecoreglobal_p.h>
#include <QtNetwork/qtnetwork-config.h>
#include <QtCore/QUrl>
-#if !defined(QT_NO_SSL) || QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
-#include <QtCore/QVector>
+#include <QtCore/QList>
#include <QtNetwork/QSslCertificate>
-#endif
#include <memory>
namespace content {
@@ -70,9 +32,9 @@ class ClientCertIdentity;
class SSLCertRequestInfo;
}
-QT_BEGIN_NAMESPACE
+namespace QtWebEngineCore {
-class Q_WEBENGINECORE_PRIVATE_EXPORT ClientCertSelectController {
+class Q_WEBENGINECORE_EXPORT ClientCertSelectController {
public:
ClientCertSelectController(net::SSLCertRequestInfo *certRequestInfo,
std::vector<std::unique_ptr<net::ClientCertIdentity>> clientCerts,
@@ -80,22 +42,20 @@ public:
~ClientCertSelectController();
QUrl hostAndPort() const { return m_hostAndPort; }
-#if !defined(QT_NO_SSL) || QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
void selectNone();
void select(const QSslCertificate &certificate);
void select(int index);
- QVector<QSslCertificate> certificates() const;
-#endif
+ QList<QSslCertificate> certificates() const;
private:
QUrl m_hostAndPort;
std::vector<std::unique_ptr<net::ClientCertIdentity>> m_clientCerts;
std::unique_ptr<content::ClientCertificateDelegate> m_delegate;
- mutable QVector<QSslCertificate> m_certificates;
+ mutable QList<QSslCertificate> m_certificates;
bool m_selected;
};
-QT_END_NAMESPACE
+}
#endif // CLIENT_CERT_SELECT_CONTROLLER_H
diff --git a/src/core/client_hints.cpp b/src/core/client_hints.cpp
new file mode 100644
index 000000000..9fa7531da
--- /dev/null
+++ b/src/core/client_hints.cpp
@@ -0,0 +1,177 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+#include "client_hints.h"
+
+#include "profile_qt.h"
+#include "web_contents_delegate_qt.h"
+#include "web_engine_settings.h"
+
+#include "components/embedder_support/user_agent_utils.h"
+#include "components/keyed_service/content/browser_context_dependency_manager.h"
+#include "content/public/browser/network_service_instance.h"
+#include "extensions/buildflags/buildflags.h"
+#include "services/network/public/cpp/is_potentially_trustworthy.h"
+#include "services/network/public/cpp/network_quality_tracker.h"
+
+#if BUILDFLAG(ENABLE_EXTENSIONS)
+#include "components/guest_view/browser/guest_view_base.h"
+#endif
+
+namespace QtWebEngineCore {
+
+// based on weblayer/browser/client_hints_factory.cc:
+// Copyright 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// static
+ClientHints *ClientHintsFactory::GetForBrowserContext(content::BrowserContext *browser_context)
+{
+ return static_cast<ClientHints*>(GetInstance()->GetServiceForBrowserContext(browser_context, true));
+}
+
+// static
+ClientHintsFactory *ClientHintsFactory::GetInstance()
+{
+ static base::NoDestructor<ClientHintsFactory> factory;
+ return factory.get();
+}
+
+ClientHintsFactory::ClientHintsFactory()
+ : BrowserContextKeyedServiceFactory("ClientHints", BrowserContextDependencyManager::GetInstance())
+{
+}
+
+ClientHintsFactory::~ClientHintsFactory() = default;
+
+KeyedService *ClientHintsFactory::BuildServiceInstanceFor(content::BrowserContext *context) const
+{
+ return new ClientHints(context);
+}
+
+content::BrowserContext *ClientHintsFactory::GetBrowserContextToUse(content::BrowserContext *context) const
+{
+ return context;
+}
+
+// based on components/client_hints/browser/in_memory_client_hints_controller_delegate.cc:
+// Copyright 2022 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+ClientHints::ClientHints(content::BrowserContext *context)
+ : context_(context)
+{
+}
+
+ClientHints::~ClientHints() = default;
+
+// Enabled Client Hints are only cached and not persisted in this
+// implementation.
+void ClientHints::PersistClientHints(const url::Origin &primary_origin,
+ content::RenderFrameHost *parent_rfh,
+ const std::vector<network::mojom::WebClientHintsType> &client_hints)
+{
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ const GURL primary_url = primary_origin.GetURL();
+ DCHECK(primary_url.is_valid());
+ if (!network::IsUrlPotentiallyTrustworthy(primary_url))
+ return;
+
+ // Client hints should only be enabled when JavaScript is enabled.
+ if (!IsJavaScriptAllowed(primary_url, parent_rfh))
+ return;
+
+ blink::EnabledClientHints enabled_hints;
+ ProfileAdapter *profileAdapter = static_cast<ProfileQt *>(context_)->profileAdapter();
+ for (auto hint : client_hints) {
+ enabled_hints.SetIsEnabled(hint, profileAdapter->clientHintsEnabled());
+ }
+ accept_ch_cache_[primary_origin] = enabled_hints;
+}
+
+// Looks up enabled Client Hints for the URL origin, and adds additional Client
+// Hints if set.
+void ClientHints::GetAllowedClientHintsFromSource(const url::Origin &origin,
+ blink::EnabledClientHints *client_hints)
+{
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ DCHECK(client_hints);
+ // Can not assert this, as we get here for unregistered custom schemes:
+ if (!network::IsOriginPotentiallyTrustworthy(origin))
+ return;
+
+ const auto &it = accept_ch_cache_.find(origin);
+ if (it != accept_ch_cache_.end()) {
+ *client_hints = it->second;
+ }
+
+ ProfileAdapter *profileAdapter = static_cast<ProfileQt *>(context_)->profileAdapter();
+ for (auto hint : additional_hints_)
+ client_hints->SetIsEnabled(hint, profileAdapter->clientHintsEnabled());
+}
+
+void ClientHints::SetAdditionalClientHints(const std::vector<network::mojom::WebClientHintsType> &hints)
+{
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ additional_hints_ = hints;
+}
+
+void ClientHints::ClearAdditionalClientHints()
+{
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ additional_hints_.clear();
+}
+
+network::NetworkQualityTracker *ClientHints::GetNetworkQualityTracker()
+{
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ if (!network_quality_tracker_) {
+ network_quality_tracker_ =
+ std::make_unique<network::NetworkQualityTracker>(
+ base::BindRepeating(&content::GetNetworkService));
+ }
+ return network_quality_tracker_.get();
+}
+
+bool ClientHints::IsJavaScriptAllowed(const GURL &url, content::RenderFrameHost *parent_rfh)
+{
+ content::WebContents *webContents = content::WebContents::FromRenderFrameHost(parent_rfh);
+
+#if BUILDFLAG(ENABLE_EXTENSIONS)
+ if (webContents && guest_view::GuestViewBase::IsGuest(webContents))
+ webContents = guest_view::GuestViewBase::GetTopLevelWebContents(webContents);
+#endif
+
+ if (webContents) {
+ WebContentsDelegateQt* delegate =
+ static_cast<WebContentsDelegateQt*>(webContents->GetDelegate());
+ if (delegate) {
+ WebEngineSettings *settings = delegate->webEngineSettings();
+ if (settings)
+ return settings->testAttribute(QWebEngineSettings::JavascriptEnabled);
+ }
+ }
+ return true;
+}
+
+bool ClientHints::AreThirdPartyCookiesBlocked(const GURL &url, content::RenderFrameHost *rfh)
+{
+ return false; // we probably can not report anything more specific
+}
+
+blink::UserAgentMetadata ClientHints::GetUserAgentMetadata()
+{
+ return static_cast<ProfileQt *>(context_)->userAgentMetadata();
+}
+
+void ClientHints::SetMostRecentMainFrameViewportSize(
+ const gfx::Size& viewport_size) {
+ viewport_size_ = viewport_size;
+}
+
+gfx::Size
+ClientHints::GetMostRecentMainFrameViewportSize() {
+ return viewport_size_;
+}
+} // namespace
diff --git a/src/core/client_hints.h b/src/core/client_hints.h
new file mode 100644
index 000000000..193982d16
--- /dev/null
+++ b/src/core/client_hints.h
@@ -0,0 +1,102 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef CLIENT_HINTS_H_
+#define CLIENT_HINTS_H_
+
+// based on components/client_hints/browser/client_hints.h:
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/memory/raw_ptr.h"
+#include "base/no_destructor.h"
+#include "base/sequence_checker.h"
+#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
+#include "components/keyed_service/core/keyed_service.h"
+#include "content/public/browser/client_hints_controller_delegate.h"
+#include "third_party/blink/public/common/user_agent/user_agent_metadata.h"
+
+namespace QtWebEngineCore {
+
+class ClientHints;
+
+class ClientHintsFactory : public BrowserContextKeyedServiceFactory
+{
+public:
+ ClientHintsFactory(const ClientHintsFactory &) = delete;
+ ClientHintsFactory &operator=(const ClientHintsFactory &) = delete;
+
+ static ClientHints *GetForBrowserContext(content::BrowserContext *browser_context);
+ static ClientHintsFactory *GetInstance();
+
+private:
+ friend class base::NoDestructor<ClientHintsFactory>;
+
+ ClientHintsFactory();
+ ~ClientHintsFactory() override;
+
+ // BrowserContextKeyedServiceFactory methods:
+ KeyedService *BuildServiceInstanceFor(content::BrowserContext *profile) const override;
+ content::BrowserContext *GetBrowserContextToUse(content::BrowserContext *context) const override;
+};
+
+class ClientHints : public KeyedService, public content::ClientHintsControllerDelegate
+{
+public:
+ ClientHints(content::BrowserContext *context);
+
+ ClientHints(const ClientHints &) = delete;
+ ClientHints &operator=(const ClientHints &) = delete;
+
+ ~ClientHints() override;
+
+ // content::ClientHintsControllerDelegate:
+ network::NetworkQualityTracker *GetNetworkQualityTracker() override;
+
+ void GetAllowedClientHintsFromSource(const url::Origin &origin, blink::EnabledClientHints *client_hints) override;
+
+ bool IsJavaScriptAllowed(const GURL &url, content::RenderFrameHost *parent_rfh) override;
+
+ bool AreThirdPartyCookiesBlocked(const GURL &url, content::RenderFrameHost *rfh) override;
+
+ blink::UserAgentMetadata GetUserAgentMetadata() override;
+
+ void PersistClientHints(const url::Origin &primary_origin,
+ content::RenderFrameHost *parent_rfh,
+ const std::vector<network::mojom::WebClientHintsType> &client_hints) override;
+
+ void SetAdditionalClientHints(const std::vector<network::mojom::WebClientHintsType> &) override;
+
+ void ClearAdditionalClientHints() override;
+
+ void SetMostRecentMainFrameViewportSize(const gfx::Size&) override;
+ gfx::Size GetMostRecentMainFrameViewportSize() override;
+
+private:
+ SEQUENCE_CHECKER(sequence_checker_);
+
+ raw_ptr<content::BrowserContext> context_ = nullptr;
+
+ // Stores enabled Client Hint types for an origin.
+ std::map<url::Origin, blink::EnabledClientHints> accept_ch_cache_
+ GUARDED_BY_CONTEXT(sequence_checker_);
+
+ // Additional Client Hint types for Client Hints Reliability. If additional
+ // hints are set, they would be included by subsequent calls to
+ // GetAllowedClientHintsFromSource.
+ std::vector<network::mojom::WebClientHintsType> additional_hints_
+ GUARDED_BY_CONTEXT(sequence_checker_);
+
+ std::unique_ptr<network::NetworkQualityTracker> network_quality_tracker_
+ GUARDED_BY_CONTEXT(sequence_checker_);
+
+ // This stores the viewport size of the most recent visible main frame tree
+ // node. This value is only used when the viewport size cannot be directly
+ // queried such as for prefetch requests and for tab restores.
+ gfx::Size viewport_size_;
+};
+
+} // namespace QtWebEngineCore
+
+#endif
diff --git a/src/core/clipboard_change_observer.h b/src/core/clipboard_change_observer.h
index f9b33fc93..33a382fbe 100644
--- a/src/core/clipboard_change_observer.h
+++ b/src/core/clipboard_change_observer.h
@@ -1,62 +1,29 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef CLIPBOARD_CHANGE_OBSERVER_H
#define CLIPBOARD_CHANGE_OBSERVER_H
#include <QClipboard>
-#include <QMap>
#include <QObject>
+#include "ui/base/clipboard/clipboard_sequence_number_token.h"
+
namespace QtWebEngineCore {
class ClipboardChangeObserver : public QObject {
Q_OBJECT
public:
ClipboardChangeObserver();
- quint64 getSequenceNumber(QClipboard::Mode mode) { return sequenceNumber.value(mode); }
+ const ui::ClipboardSequenceNumberToken &getPrimarySequenceNumber() { return m_primarySequenceNumber; }
+ const ui::ClipboardSequenceNumberToken &getSelectionSequenceNumber() { return m_selectionSequenceNumber; }
private Q_SLOTS:
void trackChange(QClipboard::Mode mode);
private:
- QMap<QClipboard::Mode, quint64> sequenceNumber;
+ ui::ClipboardSequenceNumberToken m_primarySequenceNumber;
+ ui::ClipboardSequenceNumberToken m_selectionSequenceNumber;
};
} // namespace QtWebEngineCore
diff --git a/src/core/clipboard_qt.cpp b/src/core/clipboard_qt.cpp
index ef7a05299..3f49c6e3c 100644
--- a/src/core/clipboard_qt.cpp
+++ b/src/core/clipboard_qt.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
@@ -46,16 +10,26 @@
#include "type_conversion.h"
#include "base/logging.h"
+#include "base/strings/utf_offset_string_conversions.h"
+#include "base/strings/utf_string_conversions.h"
+#include "base/types/variant_util.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/clipboard/custom_data_helper.h"
#include "ui/base/clipboard/clipboard.h"
+#include "ui/base/clipboard/clipboard_monitor.h"
#include "ui/base/clipboard/clipboard_constants.h"
#include "ui/base/clipboard/clipboard_format_type.h"
+#include "ui/base/data_transfer_policy/data_transfer_endpoint.h"
+#include "ui/base/ui_base_features.h"
+#include <QBuffer>
#include <QGuiApplication>
#include <QImage>
+#include <QImageWriter>
#include <QMimeData>
+#include <memory>
+
namespace QtWebEngineCore {
static void registerMetaTypes()
@@ -74,7 +48,13 @@ ClipboardChangeObserver::ClipboardChangeObserver()
void ClipboardChangeObserver::trackChange(QClipboard::Mode mode)
{
- ++sequenceNumber[mode];
+ if (mode == QClipboard::Clipboard)
+ m_primarySequenceNumber = ui::ClipboardSequenceNumberToken();
+ else if (mode == QClipboard::Selection)
+ m_selectionSequenceNumber = ui::ClipboardSequenceNumberToken();
+ else
+ return;
+ ui::ClipboardMonitor::GetInstance()->NotifyClipboardDataChanged();
}
} // namespace QtWebEngineCore
@@ -83,12 +63,12 @@ using namespace QtWebEngineCore;
namespace {
-QScopedPointer<QMimeData> uncommittedData;
+std::unique_ptr<QMimeData> uncommittedData;
QMimeData *getUncommittedData()
{
if (!uncommittedData)
uncommittedData.reset(new QMimeData);
- return uncommittedData.data();
+ return uncommittedData.get();
}
} // namespace
@@ -105,50 +85,83 @@ Clipboard *Clipboard::Create()
namespace QtWebEngineCore {
-void ClipboardQt::WritePortableRepresentations(ui::ClipboardBuffer type, const ObjectMap &objects)
+#if defined(Q_OS_WIN)
+extern std::string HtmlToCFHtml(const std::string &html, const std::string &base_url);
+extern void CFHtmlExtractMetadata(const std::string &cf_html, std::string *base_url,
+ size_t *html_start, size_t *fragment_start, size_t *fragment_end);
+#endif // defined(Q_OS_WIN)
+
+void ClipboardQt::WritePortableAndPlatformRepresentations(ui::ClipboardBuffer type,
+ const ObjectMap &objects,
+ std::vector<ui::Clipboard::PlatformRepresentation> platform_representations,
+ std::unique_ptr<ui::DataTransferEndpoint> data_src)
{
DCHECK(CalledOnValidThread());
DCHECK(IsSupportedClipboardBuffer(type));
+ if (!platform_representations.empty())
+ DispatchPlatformRepresentations(std::move(platform_representations));
for (const auto &object : objects)
- DispatchPortableRepresentation(object.first, object.second);
+ DispatchPortableRepresentation(object.second);
// Commit the accumulated data.
if (uncommittedData)
- QGuiApplication::clipboard()->setMimeData(uncommittedData.take(),
+ QGuiApplication::clipboard()->setMimeData(uncommittedData.release(),
type == ui::ClipboardBuffer::kCopyPaste ? QClipboard::Clipboard
: QClipboard::Selection);
if (type == ui::ClipboardBuffer::kCopyPaste && IsSupportedClipboardBuffer(ui::ClipboardBuffer::kSelection)) {
- ObjectMap::const_iterator text_iter = objects.find(PortableFormat::kText);
+ auto text_iter = objects.find(base::VariantIndexOfType<Data, TextData>());
if (text_iter != objects.end()) {
// Copy text and SourceTag to the selection clipboard.
- WritePortableRepresentations(ui::ClipboardBuffer::kSelection,
- ObjectMap(text_iter, text_iter + 1));
+ WritePortableAndPlatformRepresentations(ui::ClipboardBuffer::kSelection,
+ ObjectMap(text_iter, ++text_iter),
+ {},
+ nullptr);
}
}
+ m_dataSrc[type] = std::move(data_src);
}
-void ClipboardQt::WritePlatformRepresentations(ui::ClipboardBuffer buffer, std::vector<ui::Clipboard::PlatformRepresentation> platform_representations)
-{
- DCHECK(CalledOnValidThread());
- DCHECK(IsSupportedClipboardBuffer(buffer));
- DispatchPlatformRepresentations(std::move(platform_representations));
-}
-
-void ClipboardQt::WriteText(const char *text_data, size_t text_len)
+void ClipboardQt::WriteText(base::StringPiece text)
{
- getUncommittedData()->setText(QString::fromUtf8(text_data, text_len));
+ getUncommittedData()->setText(toQString(text));
}
-void ClipboardQt::WriteHTML(const char *markup_data, size_t markup_len, const char *url_data, size_t url_len)
+void ClipboardQt::WriteHTML(base::StringPiece markup, absl::optional<base::StringPiece> source_url)
{
- getUncommittedData()->setHtml(QString::fromUtf8(markup_data, markup_len));
+ QString markup_string = toQString(markup);
+#if defined (Q_OS_MACOS)
+ // We need to prepend the charset on macOS to prevent garbled Unicode characters
+ // when pasting to certain applications (e.g. Notes, TextEdit)
+ // Mirrors the behavior in ui/base/clipboard/clipboard_mac.mm in Chromium.
+ markup_string.prepend(QLatin1String("<meta charset='utf-8'>"));
+#endif
+
+#if !defined(Q_OS_WIN)
+ getUncommittedData()->setHtml(markup_string);
+#else
+ QString url;
+ if (source_url)
+ url = toQString(*source_url);
+
+ std::string cf_html = HtmlToCFHtml(markup_string.toStdString(), url.toStdString());
+ size_t html_start = std::string::npos;
+ size_t fragment_start = std::string::npos;
+ size_t fragment_end = std::string::npos;
+ CFHtmlExtractMetadata(cf_html, nullptr, &html_start, &fragment_start, &fragment_end);
+
+ DCHECK(fragment_start != std::string::npos && fragment_end != std::string::npos
+ && html_start != std::string::npos);
+ DCHECK(fragment_start >= html_start && fragment_end >= fragment_start);
+
+ getUncommittedData()->setHtml(QString::fromStdString(cf_html.substr(html_start)));
+#endif // !defined(Q_OS_WIN)
}
-void ClipboardQt::WriteRTF(const char *rtf_data, size_t data_len)
+void ClipboardQt::WriteRTF(base::StringPiece rtf)
{
- getUncommittedData()->setData(QString::fromLatin1(ui::kMimeTypeRTF), QByteArray(rtf_data, data_len));
+ getUncommittedData()->setData(QString::fromLatin1(ui::kMimeTypeRTF), toQByteArray(rtf));
}
void ClipboardQt::WriteWebSmartPaste()
@@ -161,12 +174,12 @@ void ClipboardQt::WriteBitmap(const SkBitmap &bitmap)
getUncommittedData()->setImageData(toQImage(bitmap).copy());
}
-void ClipboardQt::WriteBookmark(const char *title_data, size_t title_len, const char *url_data, size_t url_len)
+void ClipboardQt::WriteBookmark(base::StringPiece title_in, base::StringPiece url_in)
{
// FIXME: Untested, seems to be used only for drag-n-drop.
// Write as a mozilla url (UTF16: URL, newline, title).
- QString url = QString::fromUtf8(url_data, url_len);
- QString title = QString::fromUtf8(title_data, title_len);
+ QString url = toQString(url_in);
+ QString title = toQString(title_in);
QByteArray data;
data.append(reinterpret_cast<const char *>(url.utf16()), url.size() * 2);
@@ -175,28 +188,37 @@ void ClipboardQt::WriteBookmark(const char *title_data, size_t title_len, const
getUncommittedData()->setData(QString::fromLatin1(ui::kMimeTypeMozillaURL), data);
}
-void ClipboardQt::WriteData(const ui::ClipboardFormatType &format, const char *data_data, size_t data_len)
+void ClipboardQt::WriteData(const ui::ClipboardFormatType &format, base::span<const uint8_t> data)
{
- getUncommittedData()->setData(QString::fromStdString(format.ToString()), QByteArray(data_data, data_len));
+ getUncommittedData()->setData(QString::fromStdString(format.GetName()), QByteArray((const char *)data.data(), data.size()));
}
-bool ClipboardQt::IsFormatAvailable(const ui::ClipboardFormatType &format, ui::ClipboardBuffer type) const
+bool ClipboardQt::IsFormatAvailable(const ui::ClipboardFormatType &format,
+ ui::ClipboardBuffer type,
+ const ui::DataTransferEndpoint *data_dst) const
{
const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(
type == ui::ClipboardBuffer::kCopyPaste ? QClipboard::Clipboard : QClipboard::Selection);
- return mimeData && mimeData->hasFormat(QString::fromStdString(format.ToString()));
+
+ if (!mimeData)
+ return false;
+ if (format == ui::ClipboardFormatType::PngType())
+ return mimeData->hasImage();
+ return mimeData->hasFormat(QString::fromStdString(format.GetName()));
}
void ClipboardQt::Clear(ui::ClipboardBuffer type)
{
QGuiApplication::clipboard()->clear(type == ui::ClipboardBuffer::kCopyPaste ? QClipboard::Clipboard
- : QClipboard::Selection);
+ : QClipboard::Selection);
+ m_dataSrc[type].reset();
}
-void ClipboardQt::ReadAvailableTypes(ui::ClipboardBuffer type, std::vector<base::string16> *types,
- bool *contains_filenames) const
+void ClipboardQt::ReadAvailableTypes(ui::ClipboardBuffer type,
+ const ui::DataTransferEndpoint *data_dst,
+ std::vector<std::u16string> *types) const
{
- if (!types || !contains_filenames) {
+ if (!types) {
NOTREACHED();
return;
}
@@ -206,18 +228,19 @@ void ClipboardQt::ReadAvailableTypes(ui::ClipboardBuffer type, std::vector<base:
type == ui::ClipboardBuffer::kCopyPaste ? QClipboard::Clipboard : QClipboard::Selection);
if (!mimeData)
return;
- if (mimeData->hasImage() && !mimeData->formats().contains(QStringLiteral("image/png")))
- types->push_back(toString16(QStringLiteral("image/png")));
- const QStringList formats = mimeData->formats();
- for (const QString &mimeType : formats)
- types->push_back(toString16(mimeType));
- *contains_filenames = false;
- const QByteArray customData = mimeData->data(QString::fromLatin1(ui::kMimeTypeWebCustomData));
- ui::ReadCustomDataTypes(customData.constData(), customData.size(), types);
+ for (const auto& mime_type : GetStandardFormats(type, data_dst))
+ types->push_back(mime_type);
+
+ if (mimeData->hasFormat(QString::fromLatin1(ui::kMimeTypeWebCustomData))) {
+ const QByteArray customData = mimeData->data(QString::fromLatin1(ui::kMimeTypeWebCustomData));
+ ui::ReadCustomDataTypes(customData.constData(), customData.size(), types);
+ }
}
-void ClipboardQt::ReadText(ui::ClipboardBuffer type, base::string16 *result) const
+void ClipboardQt::ReadText(ui::ClipboardBuffer type,
+ const ui::DataTransferEndpoint *data_dst,
+ std::u16string *result) const
{
const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(
type == ui::ClipboardBuffer::kCopyPaste ? QClipboard::Clipboard : QClipboard::Selection);
@@ -225,7 +248,9 @@ void ClipboardQt::ReadText(ui::ClipboardBuffer type, base::string16 *result) con
*result = toString16(mimeData->text());
}
-void ClipboardQt::ReadAsciiText(ui::ClipboardBuffer type, std::string *result) const
+void ClipboardQt::ReadAsciiText(ui::ClipboardBuffer type,
+ const ui::DataTransferEndpoint *data_dst,
+ std::string *result) const
{
const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(
type == ui::ClipboardBuffer::kCopyPaste ? QClipboard::Clipboard : QClipboard::Selection);
@@ -233,7 +258,9 @@ void ClipboardQt::ReadAsciiText(ui::ClipboardBuffer type, std::string *result) c
*result = mimeData->text().toStdString();
}
-void ClipboardQt::ReadHTML(ui::ClipboardBuffer type, base::string16 *markup, std::string *src_url,
+void ClipboardQt::ReadHTML(ui::ClipboardBuffer type,
+ const ui::DataTransferEndpoint *data_dst,
+ std::u16string *markup, std::string *src_url,
uint32_t *fragment_start, uint32_t *fragment_end) const
{
markup->clear();
@@ -246,11 +273,40 @@ void ClipboardQt::ReadHTML(ui::ClipboardBuffer type, base::string16 *markup, std
type == ui::ClipboardBuffer::kCopyPaste ? QClipboard::Clipboard : QClipboard::Selection);
if (!mimeData)
return;
+
+#if !defined(Q_OS_WIN)
*markup = toString16(mimeData->html());
*fragment_end = static_cast<uint32_t>(markup->length());
+#else
+ const std::string cf_html = mimeData->html().toStdString();
+ size_t html_start = std::string::npos;
+ size_t start_index = std::string::npos;
+ size_t end_index = std::string::npos;
+ CFHtmlExtractMetadata(cf_html, src_url, &html_start, &start_index, &end_index);
+
+ // This might happen if the contents of the clipboard changed and CF_HTML is
+ // no longer available.
+ if (start_index == std::string::npos || end_index == std::string::npos
+ || html_start == std::string::npos)
+ return;
+
+ if (start_index < html_start || end_index < start_index)
+ return;
+
+ std::vector<size_t> offsets;
+ offsets.push_back(start_index - html_start);
+ offsets.push_back(end_index - html_start);
+ markup->assign(base::UTF8ToUTF16AndAdjustOffsets(cf_html.data() + html_start, &offsets));
+ // Ensure the Fragment points within the string; see https://crbug.com/607181.
+ size_t end = std::min(offsets[1], markup->length());
+ *fragment_start = base::checked_cast<uint32_t>(std::min(offsets[0], end));
+ *fragment_end = base::checked_cast<uint32_t>(end);
+#endif // !defined(Q_OS_WIN)
}
-void ClipboardQt::ReadRTF(ui::ClipboardBuffer type, std::string *result) const
+void ClipboardQt::ReadRTF(ui::ClipboardBuffer type,
+ const ui::DataTransferEndpoint *data_dst,
+ std::string *result) const
{
const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(
type == ui::ClipboardBuffer::kCopyPaste ? QClipboard::Clipboard : QClipboard::Selection);
@@ -260,33 +316,26 @@ void ClipboardQt::ReadRTF(ui::ClipboardBuffer type, std::string *result) const
*result = std::string(byteArray.constData(), byteArray.length());
}
-SkBitmap ClipboardQt::ReadImage(ui::ClipboardBuffer type) const
+void ClipboardQt::ReadPng(ui::ClipboardBuffer type, const ui::DataTransferEndpoint *, ui::Clipboard::ReadPngCallback callback) const
{
const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(
type == ui::ClipboardBuffer::kCopyPaste ? QClipboard::Clipboard : QClipboard::Selection);
if (!mimeData)
- return SkBitmap();
+ return std::move(callback).Run({});
QImage image = qvariant_cast<QImage>(mimeData->imageData());
- image = image.convertToFormat(QImage::Format_ARGB32);
- SkBitmap bitmap;
-
- bitmap.allocN32Pixels(image.width(), image.height(), true);
- const size_t bytesPerRowDst = bitmap.rowBytes();
- const size_t bytesPerLineSrc = static_cast<size_t>(image.bytesPerLine());
- const size_t dataBytes = std::min(bytesPerRowDst, bytesPerLineSrc);
- uchar *dst = static_cast<uchar *>(bitmap.getPixels());
- const uchar *src = image.constBits();
- for (int y = 0; y < image.height(); ++y) {
- memcpy(dst, src, dataBytes);
- dst += bytesPerRowDst;
- src += bytesPerLineSrc;
- }
-
- return bitmap;
+ QBuffer buffer;
+ QImageWriter writer(&buffer, "png");
+ writer.write(image);
+ std::vector<uint8_t> pngData;
+ pngData.resize(buffer.size());
+ memcpy(pngData.data(), buffer.data().data(), buffer.size());
+ return std::move(callback).Run(std::move(pngData));
}
-void ClipboardQt::ReadCustomData(ui::ClipboardBuffer clipboard_type, const base::string16 &type, base::string16 *result) const
+void ClipboardQt::ReadCustomData(ui::ClipboardBuffer clipboard_type, const std::u16string &type,
+ const ui::DataTransferEndpoint *data_dst,
+ std::u16string *result) const
{
const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(
clipboard_type == ui::ClipboardBuffer::kCopyPaste ? QClipboard::Clipboard : QClipboard::Selection);
@@ -296,24 +345,122 @@ void ClipboardQt::ReadCustomData(ui::ClipboardBuffer clipboard_type, const base:
ui::ReadCustomDataForType(customData.constData(), customData.size(), type, result);
}
-void ClipboardQt::ReadBookmark(base::string16 *title, std::string *url) const
+void ClipboardQt::ReadBookmark(const ui::DataTransferEndpoint *data_dst, std::u16string *title, std::string *url) const
{
NOTIMPLEMENTED();
}
-void ClipboardQt::ReadData(const ui::ClipboardFormatType &format, std::string *result) const
+void ClipboardQt::ReadSvg(ui::ClipboardBuffer clipboard_type,
+ const ui::DataTransferEndpoint *,
+ std::u16string *result) const
+{
+ const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(
+ clipboard_type == ui::ClipboardBuffer::kCopyPaste ? QClipboard::Clipboard : QClipboard::Selection);
+ if (!mimeData)
+ return;
+ const QByteArray svgData = mimeData->data(QString::fromLatin1(ui::kMimeTypeSvg));
+ if (!svgData.isEmpty())
+ *result = toString16(QString::fromUtf8(svgData));
+}
+
+void ClipboardQt::WriteSvg(base::StringPiece markup)
+{
+ getUncommittedData()->setData(QString::fromLatin1(ui::kMimeTypeSvg),
+ toQByteArray(markup));
+}
+
+void ClipboardQt::ReadData(const ui::ClipboardFormatType &format,
+ const ui::DataTransferEndpoint *data_dst,
+ std::string *result) const
{
const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData();
if (!mimeData)
return;
- const QByteArray byteArray = mimeData->data(QString::fromStdString(format.ToString()));
+ const QByteArray byteArray = mimeData->data(QString::fromStdString(format.GetName()));
*result = std::string(byteArray.constData(), byteArray.length());
}
-uint64_t ClipboardQt::GetSequenceNumber(ui::ClipboardBuffer type) const
+const ui::ClipboardSequenceNumberToken &ClipboardQt::GetSequenceNumber(ui::ClipboardBuffer type) const
{
- return clipboardChangeObserver()->getSequenceNumber(type == ui::ClipboardBuffer::kCopyPaste ? QClipboard::Clipboard
- : QClipboard::Selection);
+ return type == ui::ClipboardBuffer::kCopyPaste
+ ? clipboardChangeObserver()->getPrimarySequenceNumber()
+ : clipboardChangeObserver()->getSelectionSequenceNumber();
+}
+
+const ui::DataTransferEndpoint *ClipboardQt::GetSource(ui::ClipboardBuffer buffer) const
+{
+ auto it = m_dataSrc.find(buffer);
+ return it == m_dataSrc.end() ? nullptr : it->second.get();
+}
+
+void ClipboardQt::ReadFilenames(ui::ClipboardBuffer buffer,
+ const ui::DataTransferEndpoint *data_dst,
+ std::vector<ui::FileInfo> *result) const
+{
+ const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(
+ buffer == ui::ClipboardBuffer::kCopyPaste ? QClipboard::Clipboard : QClipboard::Selection);
+ if (!mimeData)
+ return;
+ const QList<QUrl> urls = mimeData->urls();
+ for (const QUrl &url : urls) {
+ if (url.isLocalFile()) {
+ base::FilePath filepath = toFilePath(url.toLocalFile());
+ result->push_back(ui::FileInfo(filepath, base::FilePath()));
+ }
+ }
+}
+
+void ClipboardQt::WriteFilenames(std::vector<ui::FileInfo> filenames)
+{
+ QList<QUrl> urls;
+ for (const ui::FileInfo &file : filenames) {
+ QUrl url = QUrl::fromLocalFile(QString::fromStdString(file.path.AsUTF8Unsafe()));
+ urls.append(url);
+ }
+ getUncommittedData()->setUrls(urls);
+}
+
+void ClipboardQt::WriteUnsanitizedHTML(base::StringPiece markup, absl::optional<base::StringPiece> source_url)
+{
+ WriteHTML(std::move(markup), std::move(source_url));
+}
+
+#if defined(USE_OZONE)
+bool ClipboardQt::IsSelectionBufferAvailable() const
+{
+ return QGuiApplication::clipboard()->supportsSelection();
+}
+#endif
+
+// This is the same as ReadAvailableTypes minus dealing with custom-data
+std::vector<std::u16string> ClipboardQt::GetStandardFormats(ui::ClipboardBuffer buffer, const ui::DataTransferEndpoint *data_dst) const
+{
+ Q_UNUSED(data_dst);
+ const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(
+ buffer == ui::ClipboardBuffer::kCopyPaste ? QClipboard::Clipboard : QClipboard::Selection);
+ if (!mimeData)
+ return {};
+
+ std::vector<std::u16string> types;
+ if (mimeData->hasImage())
+ types.push_back(base::UTF8ToUTF16(ui::kMimeTypePNG));
+ if (mimeData->hasHtml())
+ types.push_back(base::UTF8ToUTF16(ui::kMimeTypeHTML));
+ if (mimeData->hasText())
+ types.push_back(base::UTF8ToUTF16(ui::kMimeTypeText));
+ if (mimeData->hasUrls())
+ types.push_back(base::UTF8ToUTF16(ui::kMimeTypeURIList));
+ const QStringList formats = mimeData->formats();
+ for (const QString &mimeType : formats) {
+ auto mime_type = mimeType.toStdString();
+ // Only add white-listed formats here
+ if (mime_type == ui::ClipboardFormatType::SvgType().GetName() ||
+ mime_type == ui::ClipboardFormatType::RtfType().GetName()) {
+ types.push_back(base::UTF8ToUTF16(mime_type));
+ continue;
+ }
+ }
+ return types;
}
} // namespace QtWebEngineCore
diff --git a/src/core/clipboard_qt.h b/src/core/clipboard_qt.h
index 6d86e8f6c..22f24cfe5 100644
--- a/src/core/clipboard_qt.h
+++ b/src/core/clipboard_qt.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef CLIPBOARD_QT_H
#define CLIPBOARD_QT_H
@@ -44,36 +8,57 @@
namespace QtWebEngineCore {
-class ClipboardQt : public ui::Clipboard {
+class ClipboardQt : public ui::Clipboard
+{
public:
- uint64_t GetSequenceNumber(ui::ClipboardBuffer type) const override;
- bool IsFormatAvailable(const ui::ClipboardFormatType &format, ui::ClipboardBuffer type) const override;
+ const ui::ClipboardSequenceNumberToken &GetSequenceNumber(ui::ClipboardBuffer type) const override;
+ bool IsFormatAvailable(const ui::ClipboardFormatType &format,
+ ui::ClipboardBuffer buffer,
+ const ui::DataTransferEndpoint *data_dst) const override;
void Clear(ui::ClipboardBuffer type) override;
- void ReadAvailableTypes(ui::ClipboardBuffer type, std::vector<base::string16> *types,
- bool *contains_filenames) const override;
- void ReadText(ui::ClipboardBuffer type, base::string16 *result) const override;
- void ReadAsciiText(ui::ClipboardBuffer type, std::string *result) const override;
- void ReadHTML(ui::ClipboardBuffer type, base::string16 *markup, std::string *src_url, uint32_t *fragment_start,
+ void ReadAvailableTypes(ui::ClipboardBuffer type,
+ const ui::DataTransferEndpoint *data_dst,
+ std::vector<std::u16string> *types) const override;
+ void ReadText(ui::ClipboardBuffer type, const ui::DataTransferEndpoint *data_dst, std::u16string *result) const override;
+ void ReadAsciiText(ui::ClipboardBuffer type, const ui::DataTransferEndpoint *data_dst, std::string *result) const override;
+ void ReadHTML(ui::ClipboardBuffer type, const ui::DataTransferEndpoint *data_dst, std::u16string *markup, std::string *src_url, uint32_t *fragment_start,
uint32_t *fragment_end) const override;
- void ReadRTF(ui::ClipboardBuffer type, std::string *result) const override;
- SkBitmap ReadImage(ui::ClipboardBuffer type) const override;
- void ReadCustomData(ui::ClipboardBuffer clipboard_type, const base::string16 &type, base::string16 *result) const override;
- void ReadBookmark(base::string16 *title, std::string *url) const override;
- void ReadData(const ui::ClipboardFormatType &format, std::string *result) const override;
-
+ void ReadRTF(ui::ClipboardBuffer type, const ui::DataTransferEndpoint *data_dst, std::string *result) const override;
+ void ReadCustomData(ui::ClipboardBuffer clipboard_type, const std::u16string &type, const ui::DataTransferEndpoint *data_dst, std::u16string *result) const override;
+ void ReadBookmark(const ui::DataTransferEndpoint *data_dst, std::u16string *title, std::string *url) const override;
+ void ReadData(const ui::ClipboardFormatType &format, const ui::DataTransferEndpoint *data_dst, std::string *result) const override;
+#if defined(USE_OZONE)
+ bool IsSelectionBufferAvailable() const override;
+#endif
void OnPreShutdown() override {}
+ void ReadSvg(ui::ClipboardBuffer, const ui::DataTransferEndpoint *, std::u16string *) const override;
+ void ReadPng(ui::ClipboardBuffer, const ui::DataTransferEndpoint *, ui::Clipboard::ReadPngCallback) const override;
+
+ std::vector<std::u16string> GetStandardFormats(ui::ClipboardBuffer buffer, const ui::DataTransferEndpoint *data_dst) const override;
+
+ const ui::DataTransferEndpoint *GetSource(ui::ClipboardBuffer buffer) const override;
+ void ReadFilenames(ui::ClipboardBuffer buffer,
+ const ui::DataTransferEndpoint *data_dst,
+ std::vector<ui::FileInfo> *result) const override;
protected:
- void WritePortableRepresentations(ui::ClipboardBuffer type, const ObjectMap &objects) override;
- void WritePlatformRepresentations(ui::ClipboardBuffer type,
- std::vector<ui::Clipboard::PlatformRepresentation> platform_representations) override;
- void WriteText(const char *text_data, size_t text_len) override;
- void WriteHTML(const char *markup_data, size_t markup_len, const char *url_data, size_t url_len) override;
- void WriteRTF(const char *rtf_data, size_t data_len) override;
- void WriteBookmark(const char *title_data, size_t title_len, const char *url_data, size_t url_len) override;
+ void WritePortableAndPlatformRepresentations(ui::ClipboardBuffer buffer,
+ const ObjectMap &objects,
+ std::vector<Clipboard::PlatformRepresentation> platform_representations,
+ std::unique_ptr<ui::DataTransferEndpoint> data_src) override;
+
+ void WriteText(base::StringPiece text) override;
+ void WriteHTML(base::StringPiece markup, absl::optional<base::StringPiece> source_url) override;
+ void WriteRTF(base::StringPiece rtf) override;
+ void WriteBookmark(base::StringPiece title, base::StringPiece url) override;
void WriteWebSmartPaste() override;
void WriteBitmap(const SkBitmap &bitmap) override;
- void WriteData(const ui::ClipboardFormatType &format, const char *data_data, size_t data_len) override;
+ void WriteData(const ui::ClipboardFormatType &format, base::span<const uint8_t> data) override;
+ void WriteSvg(base::StringPiece markup) override;
+ void WriteFilenames(std::vector<ui::FileInfo> filenames) override;
+ void WriteUnsanitizedHTML(base::StringPiece markup, absl::optional<base::StringPiece> source_url) override;
+
+ base::flat_map<ui::ClipboardBuffer, std::unique_ptr<ui::DataTransferEndpoint>> m_dataSrc;
};
} // namespace QtWebEngineCore
diff --git a/src/core/clipboard_util_win.cpp b/src/core/clipboard_util_win.cpp
new file mode 100644
index 000000000..601e44180
--- /dev/null
+++ b/src/core/clipboard_util_win.cpp
@@ -0,0 +1,115 @@
+// Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include <string>
+
+#include "base/strings/stringprintf.h"
+#include "base/strings/string_util.h"
+
+// These functions are copied from ui/base/clipboard/clipboard_util_win.cc
+
+namespace QtWebEngineCore {
+
+// Helper method for converting from text/html to MS CF_HTML.
+// Documentation for the CF_HTML format is available at
+// http://msdn.microsoft.com/en-us/library/aa767917(VS.85).aspx
+// HtmlToCFHtml is based on similar method in
+// WebCore/platform/win/ClipboardUtilitiesWin.cpp.
+std::string HtmlToCFHtml(const std::string &html, const std::string &base_url)
+{
+ if (html.empty())
+ return std::string();
+
+#define MAX_DIGITS 10
+#define MAKE_NUMBER_FORMAT_1(digits) MAKE_NUMBER_FORMAT_2(digits)
+#define MAKE_NUMBER_FORMAT_2(digits) "%0" #digits "u"
+#define NUMBER_FORMAT MAKE_NUMBER_FORMAT_1(MAX_DIGITS)
+
+ static const char *header = "Version:0.9\r\n"
+ "StartHTML:" NUMBER_FORMAT "\r\n"
+ "EndHTML:" NUMBER_FORMAT "\r\n"
+ "StartFragment:" NUMBER_FORMAT "\r\n"
+ "EndFragment:" NUMBER_FORMAT "\r\n";
+ static const char *source_url_prefix = "SourceURL:";
+
+ static const char *start_markup = "<html>\r\n<body>\r\n<!--StartFragment-->";
+ static const char *end_markup = "<!--EndFragment-->\r\n</body>\r\n</html>";
+
+ // Calculate offsets
+ size_t start_html_offset = strlen(header) - strlen(NUMBER_FORMAT) * 4 + MAX_DIGITS * 4;
+ if (!base_url.empty()) {
+ start_html_offset += strlen(source_url_prefix) + base_url.length() + 2; // Add 2 for \r\n.
+ }
+ size_t start_fragment_offset = start_html_offset + strlen(start_markup);
+ size_t end_fragment_offset = start_fragment_offset + html.length();
+ size_t end_html_offset = end_fragment_offset + strlen(end_markup);
+
+ std::string result = base::StringPrintf(header, start_html_offset, end_html_offset,
+ start_fragment_offset, end_fragment_offset);
+ if (!base_url.empty()) {
+ result += source_url_prefix;
+ result += base_url;
+ result += "\r\n";
+ }
+ result += start_markup;
+ result += html;
+ result += end_markup;
+
+#undef MAX_DIGITS
+#undef MAKE_NUMBER_FORMAT_1
+#undef MAKE_NUMBER_FORMAT_2
+#undef NUMBER_FORMAT
+
+ return result;
+}
+
+void CFHtmlExtractMetadata(const std::string &cf_html, std::string *base_url, size_t *html_start,
+ size_t *fragment_start, size_t *fragment_end)
+{
+ // Obtain base_url if present.
+ if (base_url) {
+ static constexpr char kSrcUrlStr[] = "SourceURL:";
+ size_t line_start = cf_html.find(kSrcUrlStr);
+ if (line_start != std::string::npos) {
+ size_t src_end = cf_html.find("\n", line_start);
+ size_t src_start = line_start + strlen(kSrcUrlStr);
+ if (src_end != std::string::npos && src_start != std::string::npos) {
+ *base_url = cf_html.substr(src_start, src_end - src_start);
+ base::TrimWhitespaceASCII(*base_url, base::TRIM_ALL, base_url);
+ }
+ }
+ }
+
+ // Find the markup between "<!--StartFragment-->" and "<!--EndFragment-->".
+ // If the comments cannot be found, like copying from OpenOffice Writer,
+ // we simply fall back to using StartFragment/EndFragment bytecount values
+ // to determine the fragment indexes.
+ std::string cf_html_lower = base::ToLowerASCII(cf_html);
+ size_t markup_start = cf_html_lower.find("<html", 0);
+ if (html_start) {
+ *html_start = markup_start;
+ }
+ size_t tag_start = cf_html.find("<!--StartFragment", markup_start);
+ if (tag_start == std::string::npos) {
+ static constexpr char kStartFragmentStr[] = "StartFragment:";
+ size_t start_fragment_start = cf_html.find(kStartFragmentStr);
+ if (start_fragment_start != std::string::npos) {
+ *fragment_start = static_cast<size_t>(
+ atoi(cf_html.c_str() + start_fragment_start + strlen(kStartFragmentStr)));
+ }
+
+ static constexpr char kEndFragmentStr[] = "EndFragment:";
+ size_t end_fragment_start = cf_html.find(kEndFragmentStr);
+ if (end_fragment_start != std::string::npos) {
+ *fragment_end = static_cast<size_t>(
+ atoi(cf_html.c_str() + end_fragment_start + strlen(kEndFragmentStr)));
+ }
+ } else {
+ *fragment_start = cf_html.find('>', tag_start) + 1;
+ size_t tag_end = cf_html.rfind("<!--EndFragment", std::string::npos);
+ *fragment_end = cf_html.rfind('<', tag_end);
+ }
+}
+
+} // namespace QtWebEngineCore
diff --git a/src/core/color_chooser_controller.cpp b/src/core/color_chooser_controller.cpp
index 361ff93ba..fcaef2eba 100644
--- a/src/core/color_chooser_controller.cpp
+++ b/src/core/color_chooser_controller.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "content/browser/web_contents/web_contents_impl.h"
@@ -101,5 +65,4 @@ void ColorChooserController::reject()
didEndColorDialog();
}
-
-} // namespace
+} // namespace QtWebEngineCore
diff --git a/src/core/color_chooser_controller.h b/src/core/color_chooser_controller.h
index 66222bb77..a97ebfbff 100644
--- a/src/core/color_chooser_controller.h
+++ b/src/core/color_chooser_controller.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
//
// W A R N I N G
@@ -51,8 +15,7 @@
#ifndef COLOR_CHOOSER_CONTROLLER_H
#define COLOR_CHOOSER_CONTROLLER_H
-#include "qtwebenginecoreglobal_p.h"
-
+#include <QtWebEngineCore/private/qtwebenginecoreglobal_p.h>
#include <QObject>
QT_FORWARD_DECLARE_CLASS(QColor)
@@ -62,7 +25,7 @@ namespace QtWebEngineCore {
class ColorChooserControllerPrivate;
-class Q_WEBENGINECORE_PRIVATE_EXPORT ColorChooserController : public QObject {
+class Q_WEBENGINECORE_EXPORT ColorChooserController : public QObject {
Q_OBJECT
public:
~ColorChooserController();
@@ -84,6 +47,6 @@ private:
friend class ColorChooserQt;
};
-} // namespace
+} // namespace QtWebEngineCore
#endif // COLOR_CHOOSER_CONTROLLER_H
diff --git a/src/core/color_chooser_controller_p.h b/src/core/color_chooser_controller_p.h
index a03167f21..45eeb9471 100644
--- a/src/core/color_chooser_controller_p.h
+++ b/src/core/color_chooser_controller_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef COLOR_CHOOSER_CONTROLLER_P_H
#define COLOR_CHOOSER_CONTROLLER_P_H
@@ -54,7 +18,7 @@
#include <QColor>
namespace content {
- class WebContents;
+class WebContents;
}
namespace QtWebEngineCore {
@@ -67,7 +31,7 @@ public:
QColor m_initialColor;
};
-} // namespace
+} // namespace QtWebEngineCore
#endif // COLOR_CHOOSER_CONTROLLER_P_H
diff --git a/src/core/color_chooser_qt.cpp b/src/core/color_chooser_qt.cpp
index 749d04148..de2e833a0 100644
--- a/src/core/color_chooser_qt.cpp
+++ b/src/core/color_chooser_qt.cpp
@@ -1,49 +1,11 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "color_chooser_qt.h"
#include "color_chooser_controller.h"
#include "color_chooser_controller_p.h"
-namespace content {
- class WebContents;
-}
+#include <QColor>
namespace QtWebEngineCore {
@@ -57,4 +19,4 @@ QSharedPointer<ColorChooserController> ColorChooserQt::controller()
return m_controller;
}
-} // namespace
+} // namespace QtWebEngineCore
diff --git a/src/core/color_chooser_qt.h b/src/core/color_chooser_qt.h
index 200db3266..dde9a51ce 100644
--- a/src/core/color_chooser_qt.h
+++ b/src/core/color_chooser_qt.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef COLOR_CHOOSER_QT_H
#define COLOR_CHOOSER_QT_H
@@ -43,11 +7,12 @@
#include "content/public/browser/color_chooser.h"
#include "type_conversion.h"
-#include <QColor>
#include <QSharedPointer>
+QT_FORWARD_DECLARE_CLASS(QColor)
+
namespace content {
- class WebContents;
+class WebContents;
}
namespace QtWebEngineCore {
@@ -68,7 +33,6 @@ private:
QSharedPointer<ColorChooserController> m_controller;
};
-
-} // namespace
+} // namespace QtWebEngineCore
#endif // COLOR_CHOOSER_QT_H
diff --git a/src/core/common/extensions/api/qtwebengine_extensions_features.gni b/src/core/common/extensions/api/qtwebengine_extensions_features.gni
deleted file mode 100644
index ed7e713c6..000000000
--- a/src/core/common/extensions/api/qtwebengine_extensions_features.gni
+++ /dev/null
@@ -1,25 +0,0 @@
-import("//tools/json_schema_compiler/json_features.gni")
-
-json_features("qt_api_features") {
- feature_type = "APIFeature"
- method_name = "AddQtAPIFeatures"
- sources = [
- "//extensions/common/api/_webengine_api_features.json"
- ]
-}
-
-json_features("qt_permission_features") {
- feature_type = "PermissionFeature"
- method_name = "AddQtPermissionFeatures"
- sources = [
- "//extensions/common/api/_permission_features.json"
- ]
-}
-
-group("qtwebengine_extensions_features") {
- public_deps = [
- ":qt_api_features",
- ":qt_permission_features",
- "//extensions/common/api:extensions_features",
- ]
-}
diff --git a/src/core/common/extensions/extensions_api_provider_qt.cpp b/src/core/common/extensions/extensions_api_provider_qt.cpp
index 22154a9d1..1c8e89747 100644
--- a/src/core/common/extensions/extensions_api_provider_qt.cpp
+++ b/src/core/common/extensions/extensions_api_provider_qt.cpp
@@ -1,44 +1,10 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "extensions_api_provider_qt.h"
+#include "chrome/common/extensions/permissions/chrome_api_permissions.h"
+#include "chrome/common/extensions/api/generated_schemas.h"
#include "chrome/grit/common_resources.h"
#include "extensions/common/api/api_features.h"
@@ -51,6 +17,7 @@
#include "extensions/common/features/json_feature_provider_source.h"
#include "extensions/common/permissions/permissions_info.h"
#include "extensions/grit/extensions_resources.h"
+#include "qtwebengine/common/extensions/api/generated_schemas.h"
#include "qt_api_features.h"
//#include "qt_behavior_features.h"
@@ -85,16 +52,30 @@ void ExtensionsAPIProviderQt::AddPermissionFeatures(FeatureProvider *provider)
bool ExtensionsAPIProviderQt::IsAPISchemaGenerated(const std::string &name)
{
- return api::GeneratedSchemas::IsGenerated(name);
+ return api::GeneratedSchemas::IsGenerated(name) ||
+ api::ChromeGeneratedSchemas::IsGenerated(name) ||
+ api::QtWebEngineGeneratedSchemas::IsGenerated(name);
}
base::StringPiece ExtensionsAPIProviderQt::GetAPISchema(const std::string &name)
{
- return api::GeneratedSchemas::Get(name);
+ if (!api::GeneratedSchemas::Get(name).empty())
+ return api::GeneratedSchemas::Get(name);
+
+ if (!api::ChromeGeneratedSchemas::Get(name).empty())
+ return api::ChromeGeneratedSchemas::Get(name);
+
+ if (!api::QtWebEngineGeneratedSchemas::Get(name).empty())
+ return api::QtWebEngineGeneratedSchemas::Get(name);
+
+ return "";
}
void ExtensionsAPIProviderQt::RegisterPermissions(PermissionsInfo* permissions_info)
{
+ permissions_info->RegisterPermissions(
+ chrome_api_permissions::GetPermissionInfos(),
+ chrome_api_permissions::GetPermissionAliases());
}
}
diff --git a/src/core/common/extensions/extensions_api_provider_qt.h b/src/core/common/extensions/extensions_api_provider_qt.h
index 7d8c5f98b..34e8bdd9f 100644
--- a/src/core/common/extensions/extensions_api_provider_qt.h
+++ b/src/core/common/extensions/extensions_api_provider_qt.h
@@ -1,48 +1,10 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef EXTENSIONS_API_PROVIDER_QT_H
#define EXTENSIONS_API_PROVIDER_QT_H
#include "extensions/common/extensions_api_provider.h"
-#include "base/macros.h"
-
namespace extensions {
class ExtensionsAPIProviderQt : public ExtensionsAPIProvider
@@ -64,8 +26,6 @@ public:
// Registers permissions for any associated API features.
void RegisterPermissions(PermissionsInfo* permissions_info) override;
-
-DISALLOW_COPY_AND_ASSIGN(ExtensionsAPIProviderQt);
};
}
diff --git a/src/core/common/extensions/extensions_client_qt.cpp b/src/core/common/extensions/extensions_client_qt.cpp
index dd1de1483..9240e6528 100644
--- a/src/core/common/extensions/extensions_client_qt.cpp
+++ b/src/core/common/extensions/extensions_client_qt.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Portions copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
@@ -108,18 +72,18 @@ void ExtensionsClientQt::FilterHostPermissions(const URLPatternSet &hosts,
{
}
-// Replaces the scripting whitelist with |whitelist|. Used in the renderer{}
+// Replaces the scripting allowlist with |allowlist|. Used in the renderer{}
// only used for testing in the browser process.
-void ExtensionsClientQt::SetScriptingWhitelist(const ExtensionsClient::ScriptingWhitelist &whitelist)
+void ExtensionsClientQt::SetScriptingAllowlist(const ExtensionsClient::ScriptingAllowlist &allowlist)
{
- scripting_whitelist_ = whitelist;
+ scripting_allowlist_ = allowlist;
}
-// Return the whitelist of extensions that can run content scripts on
+// Return the allowlist of extensions that can run content scripts on
// any origin.
-const ExtensionsClient::ScriptingWhitelist &ExtensionsClientQt::GetScriptingWhitelist() const
+const ExtensionsClient::ScriptingAllowlist &ExtensionsClientQt::GetScriptingAllowlist() const
{
- return scripting_whitelist_;
+ return scripting_allowlist_;
}
// Get the set of chrome:// hosts that |extension| can run content scripts on.
@@ -153,11 +117,17 @@ const GURL &ExtensionsClientQt::GetWebstoreUpdateURL() const
// Returns a flag indicating whether or not a given URL is a valid
// extension blacklist URL.
-bool ExtensionsClientQt::IsBlacklistUpdateURL(const GURL &url) const
+bool ExtensionsClientQt::IsBlocklistUpdateURL(const GURL &url) const
{
return true;
}
+const GURL &ExtensionsClientQt::GetNewWebstoreBaseURL() const
+{
+ static GURL dummy;
+ return dummy;
+}
+
// Returns the set of file paths corresponding to any images within an
// extension's contents that may be displayed directly within the browser UI
// or WebUI, such as icons or theme images. This set of paths is used by the
diff --git a/src/core/common/extensions/extensions_client_qt.h b/src/core/common/extensions/extensions_client_qt.h
index e689f76b7..b2d128bf9 100644
--- a/src/core/common/extensions/extensions_client_qt.h
+++ b/src/core/common/extensions/extensions_client_qt.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Portions copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
@@ -46,9 +10,7 @@
#include "extensions/common/extensions_client.h"
-#include "base/compiler_specific.h"
#include "base/lazy_instance.h"
-#include "base/macros.h"
#include "chrome/common/extensions/permissions/chrome_permission_message_provider.h"
#include "extensions/common/features/feature_provider.h"
#include "extensions/common/features/json_feature_provider_source.h"
@@ -87,13 +49,13 @@ public:
URLPatternSet *new_hosts,
PermissionIDSet *permissions) const override;
- // Replaces the scripting whitelist with |whitelist|. Used in the renderer;
+ // Replaces the scripting allowlist with |allowlist|. Used in the renderer;
// only used for testing in the browser process.
- void SetScriptingWhitelist(const ScriptingWhitelist &whitelist) override;
+ void SetScriptingAllowlist(const ScriptingAllowlist &allowlist) override;
- // Return the whitelist of extensions that can run content scripts on
+ // Return the allowlist of extensions that can run content scripts on
// any origin.
- const ScriptingWhitelist &GetScriptingWhitelist() const override;
+ const ScriptingAllowlist &GetScriptingAllowlist() const override;
// Get the set of chrome:// hosts that |extension| can run content scripts on.
URLPatternSet GetPermittedChromeSchemeHosts(const Extension *extension,
@@ -110,7 +72,9 @@ public:
// Returns a flag indicating whether or not a given URL is a valid
// extension blacklist URL.
- bool IsBlacklistUpdateURL(const GURL &url) const override;
+ bool IsBlocklistUpdateURL(const GURL &url) const override;
+
+ const GURL &GetNewWebstoreBaseURL() const override;
// Returns the set of file paths corresponding to any images within an
// extension's contents that may be displayed directly within the browser UI
@@ -127,11 +91,10 @@ public:
static ExtensionsClientQt *GetInstance();
private:
- ScriptingWhitelist scripting_whitelist_;
+ ScriptingAllowlist scripting_allowlist_;
const ChromePermissionMessageProvider permission_message_provider_;
mutable GURL update_url_;
mutable GURL base_url_;
- DISALLOW_COPY_AND_ASSIGN(ExtensionsClientQt);
};
} // namespace extensions
diff --git a/src/core/common/qt_ipc_logging.cpp b/src/core/common/qt_ipc_logging.cpp
deleted file mode 100644
index 83eb5a5ad..000000000
--- a/src/core/common/qt_ipc_logging.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "ipc/ipc_buildflags.h" // Generated buildflag header
-
-#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED)
-#define IPC_MESSAGE_MACROS_LOG_ENABLED
-#include "content/public/common/content_ipc_logging.h"
-#define IPC_LOG_TABLE_ADD_ENTRY(msg_id, logger) \
- content::RegisterIPCLogger(msg_id, logger)
-#include "common/qt_messages.h"
-#endif
diff --git a/src/core/common/qt_messages.cpp b/src/core/common/qt_messages.cpp
index 2f087d21f..bc3a1560d 100644
--- a/src/core/common/qt_messages.cpp
+++ b/src/core/common/qt_messages.cpp
@@ -1,6 +1,5 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE.Chromium file.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
// Get basic type definitions.
#define IPC_MESSAGE_IMPL
diff --git a/src/core/common/qt_messages.h b/src/core/common/qt_messages.h
index 43f07c9a6..17adcbb0d 100644
--- a/src/core/common/qt_messages.h
+++ b/src/core/common/qt_messages.h
@@ -1,116 +1,46 @@
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE.Chromium file.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
// Multiply-included file, no traditional include guard.
-#include "base/optional.h"
#include "content/public/common/common_param_traits.h"
-#include "content/public/common/webplugininfo.h"
#include "ipc/ipc_message_macros.h"
-#include "ppapi/buildflags/buildflags.h"
-#include "user_script_data.h"
-
-IPC_STRUCT_TRAITS_BEGIN(UserScriptData)
- IPC_STRUCT_TRAITS_MEMBER(source)
- IPC_STRUCT_TRAITS_MEMBER(url)
- IPC_STRUCT_TRAITS_MEMBER(injectionPoint)
- IPC_STRUCT_TRAITS_MEMBER(injectForSubframes)
- IPC_STRUCT_TRAITS_MEMBER(worldId)
- IPC_STRUCT_TRAITS_MEMBER(scriptId)
- IPC_STRUCT_TRAITS_MEMBER(globs)
- IPC_STRUCT_TRAITS_MEMBER(excludeGlobs)
- IPC_STRUCT_TRAITS_MEMBER(urlPatterns)
-IPC_STRUCT_TRAITS_END()
-
+#include "ipc/ipc_message_start.h"
+#include "url/gurl.h"
#define IPC_MESSAGE_START QtMsgStart
//-----------------------------------------------------------------------------
-// RenderView messages
// These are messages sent from the browser to the renderer process.
-IPC_MESSAGE_ROUTED1(RenderViewObserverQt_FetchDocumentMarkup,
- uint64_t /* requestId */)
-
-IPC_MESSAGE_ROUTED1(RenderViewObserverQt_FetchDocumentInnerText,
- uint64_t /* requestId */)
-
-IPC_MESSAGE_ROUTED1(RenderViewObserverQt_SetBackgroundColor,
- uint32_t /* color */)
-
-// User scripts messages
-IPC_MESSAGE_ROUTED1(RenderFrameObserverHelper_AddScript,
- UserScriptData /* script */)
-IPC_MESSAGE_ROUTED1(RenderFrameObserverHelper_RemoveScript,
- UserScriptData /* script */)
-IPC_MESSAGE_ROUTED0(RenderFrameObserverHelper_ClearScripts)
-
-IPC_MESSAGE_CONTROL1(UserResourceController_AddScript, UserScriptData /* scriptContents */)
-IPC_MESSAGE_CONTROL1(UserResourceController_RemoveScript, UserScriptData /* scriptContents */)
-IPC_MESSAGE_CONTROL0(UserResourceController_ClearScripts)
-
-// Tells the renderer whether or not a file system access has been allowed.
-IPC_MESSAGE_ROUTED2(QtWebEngineMsg_RequestFileSystemAccessAsyncResponse,
+// Tells the renderer whether or not a storage access has been allowed.
+IPC_MESSAGE_ROUTED2(QtWebEngineMsg_RequestStorageAccessAsyncResponse,
int /* request_id */,
bool /* allowed */)
-
-//-----------------------------------------------------------------------------
-// WebContents messages
-// These are messages sent from the renderer back to the browser process.
-
-IPC_MESSAGE_ROUTED2(RenderViewObserverHostQt_DidFetchDocumentMarkup,
- uint64_t /* requestId */,
- base::string16 /* markup */)
-
-IPC_MESSAGE_ROUTED2(RenderViewObserverHostQt_DidFetchDocumentInnerText,
- uint64_t /* requestId */,
- base::string16 /* innerText */)
-
-IPC_MESSAGE_ROUTED0(RenderViewObserverHostQt_DidFirstVisuallyNonEmptyLayout)
-
//-----------------------------------------------------------------------------
-// Misc messages
// These are messages sent from the renderer to the browser process.
-// Sent by the renderer process to check whether access to web databases is
-// granted by content settings.
-IPC_SYNC_MESSAGE_CONTROL3_1(QtWebEngineHostMsg_AllowDatabase,
+IPC_SYNC_MESSAGE_CONTROL4_1(QtWebEngineHostMsg_AllowStorageAccess,
int /* render_frame_id */,
GURL /* origin_url */,
GURL /* top origin url */,
+ int /* storage_type */,
bool /* allowed */)
-// Sent by the renderer process to check whether access to DOM Storage is
-// granted by content settings.
-IPC_SYNC_MESSAGE_CONTROL4_1(QtWebEngineHostMsg_AllowDOMStorage,
+IPC_SYNC_MESSAGE_CONTROL4_1(QtWebEngineHostMsg_RequestStorageAccessSync,
int /* render_frame_id */,
GURL /* origin_url */,
GURL /* top origin url */,
- bool /* if true local storage, otherwise session */,
+ int /* storage_type */,
bool /* allowed */)
-// Sent by the renderer process to check whether access to FileSystem is
+// Sent by the renderer process to check whether access to storage is
// granted by content settings.
-IPC_SYNC_MESSAGE_CONTROL3_1(QtWebEngineHostMsg_RequestFileSystemAccessSync,
- int /* render_frame_id */,
- GURL /* origin_url */,
- GURL /* top origin url */,
- bool /* allowed */)
-
-// Sent by the renderer process to check whether access to FileSystem is
-// granted by content settings.
-IPC_MESSAGE_CONTROL4(QtWebEngineHostMsg_RequestFileSystemAccessAsync,
+IPC_MESSAGE_CONTROL5(QtWebEngineHostMsg_RequestStorageAccessAsync,
int /* render_frame_id */,
int /* request_id */,
GURL /* origin_url */,
- GURL /* top origin url */)
+ GURL /* top origin url */,
+ int /* storage_type */)
-// Sent by the renderer process to check whether access to Indexed DB is
-// granted by content settings.
-IPC_SYNC_MESSAGE_CONTROL3_1(QtWebEngineHostMsg_AllowIndexedDB,
- int /* render_frame_id */,
- GURL /* origin_url */,
- GURL /* top origin url */,
- bool /* allowed */)
diff --git a/src/core/common/user_script_data.cpp b/src/core/common/user_script_data.cpp
deleted file mode 100644
index 6f4b8cb05..000000000
--- a/src/core/common/user_script_data.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "user_script_data.h"
-#include "base/pickle.h"
-
-UserScriptData::UserScriptData() : injectionPoint(AfterLoad)
- , injectForSubframes(false)
- , worldId(1)
-{
- static uint64_t idCount = 0;
- scriptId = idCount++;
-}
diff --git a/src/core/common/user_script_data.h b/src/core/common/user_script_data.h
deleted file mode 100644
index 8d98890e3..000000000
--- a/src/core/common/user_script_data.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef USER_SCRIPT_DATA_H
-#define USER_SCRIPT_DATA_H
-
-#include <QtCore/QHash>
-#include <string>
-#include "ipc/ipc_message_utils.h"
-#include "url/gurl.h"
-
-struct UserScriptData {
- enum InjectionPoint {
- AfterLoad,
- DocumentLoadFinished,
- DocumentElementCreation
- };
-
- UserScriptData();
-
- std::string source;
- GURL url;
- /*InjectionPoint*/uint8_t injectionPoint;
- bool injectForSubframes;
- uint worldId;
- uint64_t scriptId;
- std::vector<std::string> globs;
- std::vector<std::string> excludeGlobs;
- std::vector<std::string> urlPatterns;
-};
-
-QT_BEGIN_NAMESPACE
-
-Q_DECLARE_TYPEINFO(UserScriptData, Q_MOVABLE_TYPE);
-
-QT_END_NAMESPACE
-
-#endif // USER_SCRIPT_DATA_H
diff --git a/src/core/compositor/chromium_gpu_helper.cpp b/src/core/compositor/chromium_gpu_helper.cpp
deleted file mode 100644
index 1ddbf75e5..000000000
--- a/src/core/compositor/chromium_gpu_helper.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE.Chromium file.
-
-#include "chromium_gpu_helper.h"
-
-// Some headers include the namespace ws, and can not coexist with
-// Qt headers that include QTextStream, which includes most QSG headers
-// via QMatrix4x4.
-#include "content/browser/renderer_host/render_widget_host_impl.h"
-
-// Including gpu/command_buffer headers before content/gpu headers makes sure that
-// guards are defined to prevent duplicate definition errors with forward declared
-// GL typedefs cascading through content header includes.
-#include "gpu/command_buffer/service/mailbox_manager.h"
-#include "gpu/command_buffer/service/texture_base.h"
-
-#include "content/gpu/gpu_child_thread.h"
-#include "gpu/ipc/service/gpu_channel_manager.h"
-
-#include <QtGlobal> // We need this for Q_UNUSED
-
-scoped_refptr<base::SingleThreadTaskRunner> gpu_task_runner()
-{
- return content::GpuChildThread::instance()->main_thread_runner();
-}
-
-gpu::MailboxManager *mailbox_manager()
-{
- gpu::GpuChannelManager *gpuChannelManager = content::GpuChildThread::instance()->gpu_channel_manager();
- return gpuChannelManager->mailbox_manager();
-}
-
-gpu::TextureBase* ConsumeTexture(gpu::MailboxManager *mailboxManager, unsigned target, const gpu::Mailbox& mailbox)
-{
- Q_UNUSED(target);
- return mailboxManager->ConsumeTexture(mailbox);
-}
-
-unsigned int service_id(gpu::TextureBase *tex)
-{
- return tex->service_id();
-}
-
-void ProgressFlingIfNeeded(content::RenderWidgetHost *host, const base::TimeTicks &current_time)
-{
- content::RenderWidgetHostImpl::From(host)->ProgressFlingIfNeeded(current_time);
-}
diff --git a/src/core/compositor/chromium_gpu_helper.h b/src/core/compositor/chromium_gpu_helper.h
deleted file mode 100644
index e692b9b85..000000000
--- a/src/core/compositor/chromium_gpu_helper.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef CHROMIUM_GPU_HELPER_H
-#define CHROMIUM_GPU_HELPER_H
-
-#include "base/memory/scoped_refptr.h"
-
-namespace base {
-class SingleThreadTaskRunner;
-class TimeTicks;
-}
-
-namespace content {
-class RenderWidgetHost;
-}
-
-namespace gpu {
-struct Mailbox;
-class MailboxManager;
-class TextureBase;
-}
-
-// These functions wrap code that needs to include headers that are
-// incompatible with Qt GL headers.
-// From the outside, types from incompatible headers referenced in these
-// functions should only be forward-declared and considered as opaque types.
-
-scoped_refptr<base::SingleThreadTaskRunner> gpu_task_runner();
-gpu::MailboxManager *mailbox_manager();
-
-gpu::TextureBase* ConsumeTexture(gpu::MailboxManager *mailboxManager, unsigned target, const gpu::Mailbox& mailbox);
-unsigned int service_id(gpu::TextureBase *tex);
-
-void ProgressFlingIfNeeded(content::RenderWidgetHost *host, const base::TimeTicks &current_time);
-
-#endif // CHROMIUM_GPU_HELPER_H
diff --git a/src/core/compositor/compositor.cpp b/src/core/compositor/compositor.cpp
index 82a9f7ee4..4c0bd4c0d 100644
--- a/src/core/compositor/compositor.cpp
+++ b/src/core/compositor/compositor.cpp
@@ -1,187 +1,162 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "compositor.h"
-#include "compositor_resource_tracker.h"
-#include "delegated_frame_node.h"
+#include "base/memory/ref_counted.h"
+#include "components/viz/common/surfaces/frame_sink_id.h"
-#include "base/task/post_task.h"
-#include "components/viz/common/resources/returned_resource.h"
-#include "content/public/browser/browser_task_traits.h"
-#include "content/public/browser/browser_thread.h"
-#include "services/viz/privileged/mojom/compositing/frame_sink_manager.mojom.h"
+#include <QHash>
+#include <QMutex>
+#include <QQuickWindow>
namespace QtWebEngineCore {
-Compositor::Compositor(content::RenderWidgetHost *host)
- : m_resourceTracker(new CompositorResourceTracker)
- , m_host(host)
-{
- DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+// Compositor::Id
- m_taskRunner = base::CreateSingleThreadTaskRunner({content::BrowserThread::UI, base::TaskPriority::USER_VISIBLE});
- m_beginFrameSource =
- std::make_unique<viz::DelayBasedBeginFrameSource>(
- std::make_unique<viz::DelayBasedTimeSource>(m_taskRunner.get()),
- viz::BeginFrameSource::kNotRestartableId);
-}
+Compositor::Id::Id(viz::FrameSinkId fid) : client_id(fid.client_id()), sink_id(fid.sink_id()) { }
-Compositor::~Compositor()
+static size_t qHash(Compositor::Id id, size_t seed = 0)
{
- DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ QtPrivate::QHashCombine hasher;
+ seed = hasher(seed, id.client_id);
+ seed = hasher(seed, id.sink_id);
+ return seed;
}
-void Compositor::setFrameSinkClient(viz::mojom::CompositorFrameSinkClient *frameSinkClient)
+static bool operator==(Compositor::Id id1, Compositor::Id id2)
{
- DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
-
- if (m_frameSinkClient == frameSinkClient)
- return;
-
- // Accumulated resources belong to the old RendererCompositorFrameSink and
- // should not be returned.
- //
- // TODO(juvaldma): Can there be a pending frame from the old client?
- m_resourceTracker->returnResources();
- m_frameSinkClient = frameSinkClient;
+ return id1.client_id == id2.client_id && id1.sink_id == id2.sink_id;
}
-void Compositor::setNeedsBeginFrames(bool needsBeginFrames)
-{
- DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
-
- if (m_needsBeginFrames == needsBeginFrames)
- return;
-
- if (needsBeginFrames)
- m_beginFrameSource->AddObserver(this);
- else
- m_beginFrameSource->RemoveObserver(this);
+// Compositor::Binding and Compositor::Bindings
- m_needsBeginFrames = needsBeginFrames;
-}
-
-void Compositor::submitFrame(viz::CompositorFrame frame, base::OnceClosure callback)
+struct Compositor::Binding
{
- DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- DCHECK(!m_submitCallback);
+ const Id id;
+ Compositor *compositor = nullptr;
+ Observer *observer = nullptr;
- m_pendingFrame = std::move(frame);
- m_submitCallback = std::move(callback);
- m_resourceTracker->submitResources(
- m_pendingFrame,
- base::BindOnce(&Compositor::runSubmitCallback, base::Unretained(this)));
-}
+ Binding(Id id) : id(id) { }
+ ~Binding();
+};
-QSGNode *Compositor::updatePaintNode(QSGNode *oldNode, RenderWidgetHostViewQtDelegate *viewDelegate)
+class Compositor::BindingMap
{
- // DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- //
- // This might be called from a Qt Quick render thread, but the UI thread
- // will still be blocked for the duration of this call.
+public:
+ void lock() { m_mutex.lock(); }
- DelegatedFrameNode *frameNode = static_cast<DelegatedFrameNode *>(oldNode);
- if (!frameNode)
- frameNode = new DelegatedFrameNode;
+ void unlock() { m_mutex.unlock(); }
- if (!m_updatePaintNodeShouldCommit) {
- frameNode->commit(m_committedFrame, viz::CompositorFrame(), m_resourceTracker.get(), viewDelegate);
- return frameNode;
+ Binding *findOrCreate(Id id)
+ {
+ auto it = m_map.find(id);
+ if (it == m_map.end())
+ it = m_map.insert(id, new Binding(id));
+ return *it;
}
- m_updatePaintNodeShouldCommit = false;
- m_presentations.emplace(m_committedFrame.metadata.frame_token, viz::FrameTimingDetails{base::TimeTicks::Now()});
+ void remove(Id id) { m_map.remove(id); }
- m_resourceTracker->commitResources();
- frameNode->commit(m_pendingFrame, m_committedFrame, m_resourceTracker.get(), viewDelegate);
- m_committedFrame = std::move(m_pendingFrame);
- m_pendingFrame = viz::CompositorFrame();
+private:
+ QMutex m_mutex;
+ QHash<Id, Binding *> m_map;
+} static g_bindings;
- m_taskRunner->PostTask(FROM_HERE,
- base::BindOnce(&Compositor::notifyFrameCommitted, m_weakPtrFactory.GetWeakPtr()));
+Compositor::Binding::~Binding()
+{
+ g_bindings.remove(id);
+}
+
+// Compositor::Observer
- return frameNode;
+void Compositor::Observer::bind(Id id)
+{
+ DCHECK(!m_binding);
+ g_bindings.lock();
+ m_binding = g_bindings.findOrCreate(id);
+ DCHECK(!m_binding->observer);
+ m_binding->observer = this;
+ g_bindings.unlock();
}
-void Compositor::runSubmitCallback()
+void Compositor::Observer::unbind()
{
- DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ DCHECK(m_binding);
+ g_bindings.lock();
+ m_binding->observer = nullptr;
+ if (m_binding->compositor == nullptr)
+ delete m_binding;
+ m_binding = nullptr;
+ g_bindings.unlock();
+}
- m_updatePaintNodeShouldCommit = true;
- std::move(m_submitCallback).Run();
+Compositor::Handle<Compositor> Compositor::Observer::compositor()
+{
+ g_bindings.lock();
+ if (m_binding && m_binding->compositor)
+ return m_binding->compositor; // delay unlock
+ g_bindings.unlock();
+ return nullptr;
}
-void Compositor::notifyFrameCommitted()
+// Compositor
+
+void Compositor::bind(Id id)
{
- DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ DCHECK(!m_binding);
+ g_bindings.lock();
+ m_binding = g_bindings.findOrCreate(id);
+ DCHECK(!m_binding->compositor);
+ m_binding->compositor = this;
+ g_bindings.unlock();
+}
- m_beginFrameSource->DidFinishFrame(this);
- if (m_frameSinkClient)
- m_frameSinkClient->DidReceiveCompositorFrameAck(m_resourceTracker->returnResources());
+void Compositor::unbind()
+{
+ DCHECK(m_binding);
+ g_bindings.lock();
+ m_binding->compositor = nullptr;
+ if (m_binding->observer == nullptr)
+ delete m_binding;
+ m_binding = nullptr;
+ g_bindings.unlock();
}
-void Compositor::sendPresentationFeedback(uint frame_token)
+Compositor::Handle<Compositor::Observer> Compositor::observer()
{
- viz::FrameTimingDetails dummyDetails = {base::TimeTicks::Now()};
- m_presentations.emplace(frame_token, dummyDetails);
+ g_bindings.lock();
+ if (m_binding && m_binding->observer)
+ return m_binding->observer; // delay unlock
+ g_bindings.unlock();
+ return nullptr;
}
-bool Compositor::OnBeginFrameDerivedImpl(const viz::BeginFrameArgs &args)
+void Compositor::waitForTexture()
{
- DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+}
- ProgressFlingIfNeeded(m_host, args.frame_time);
- m_beginFrameSource->OnUpdateVSyncParameters(args.frame_time, args.interval);
- if (m_frameSinkClient) {
- m_frameSinkClient->OnBeginFrame(args, m_presentations);
- m_presentations.clear();
- }
+void Compositor::releaseTexture()
+{
+}
- return true;
+QSGTexture *Compositor::texture(QQuickWindow *, uint32_t textureOptions)
+{
+ Q_UNREACHABLE();
+ return nullptr;
}
-void Compositor::OnBeginFrameSourcePausedChanged(bool)
+bool Compositor::textureIsFlipped()
{
- // Ignored for now. If the begin frame source is paused, the renderer
- // doesn't need to be informed about it and will just not receive more
- // begin frames.
+ Q_UNREACHABLE();
+ return false;
}
+void Compositor::releaseResources() { }
+
+// static
+void Compositor::unlockBindings()
+{
+ g_bindings.unlock();
+}
} // namespace QtWebEngineCore
diff --git a/src/core/compositor/compositor.h b/src/core/compositor/compositor.h
index 36e62c17a..501559060 100644
--- a/src/core/compositor/compositor.h
+++ b/src/core/compositor/compositor.h
@@ -1,129 +1,153 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef COMPOSITOR_H
#define COMPOSITOR_H
-#include "base/memory/weak_ptr.h"
-#include "components/viz/common/frame_timing_details.h"
-#include "components/viz/common/frame_sinks/begin_frame_source.h"
-#include "components/viz/common/quads/compositor_frame.h"
-
-#include <QtCore/qglobal.h>
-#include <QtCore/qshareddata.h>
-
-#include <QtCore/qglobal.h>
-#include <QtCore/qshareddata.h>
+#include <QtWebEngineCore/private/qtwebenginecoreglobal_p.h>
QT_BEGIN_NAMESPACE
-class QSGNode;
+class QQuickWindow;
+class QSize;
+class QSGTexture;
QT_END_NAMESPACE
-namespace content {
-class RenderWidgetHost;
-}
namespace viz {
-struct ReturnedResource;
-namespace mojom {
-class CompositorFrameSinkClient;
-} // namespace mojom
+class FrameSinkId;
} // namespace viz
namespace QtWebEngineCore {
-class CompositorResourceTracker;
-class RenderWidgetHostViewQtDelegate;
-
-// Receives viz::CompositorFrames from child compositors and provides QSGNodes
-// to the Qt Quick renderer.
-//
-// The life cycle of a frame:
-//
-// Step 1. A new CompositorFrame is received from child compositors and handed
-// off to submitFrame(). The new frame will start off in a pending state.
+// Produces composited frames for display.
//
-// Step 2. Once the new frame is ready to be rendered, Compositor will notify
-// the client by running the callback given to submitFrame().
-//
-// Step 3. Once the client is ready to render, updatePaintNode() should be
-// called to receive the scene graph for the new frame. This call will commit
-// the pending frame. Until the next frame is ready, all subsequent calls to
-// updatePaintNode() will keep using this same committed frame.
-//
-// Step 4. The Compositor will return unneeded resources back to the child
-// compositors. Go to step 1.
-class Compositor final : private viz::BeginFrameObserverBase
+// Used by quick/widgets libraries for accessing the frames and
+// controlling frame swapping.
+class Q_WEBENGINECORE_EXPORT Compositor
{
+ struct Binding;
+
public:
- explicit Compositor(content::RenderWidgetHost *host);
- ~Compositor() override;
+ // Identifies the implementation type.
+ enum class Type {
+ Software,
+ OpenGL, // TODO: Legacy, remove it with DisplaySkiaOutputDevice!
+ Native
+ };
+
+ // Identifies a compositor.
+ //
+ // The purpose of assigning ids to compositors is to allow the
+ // corresponding observer to be registered before the compositor
+ // itself is created, which is necessary since the creation
+ // happens on a different thread in the depths of viz.
+ //
+ // (Maps to viz::FrameSinkId internally).
+ struct Id
+ {
+ quint32 client_id;
+ quint32 sink_id;
+
+ Id(viz::FrameSinkId);
+ };
+
+ // Pointer to Compositor or Observer that holds a lock to prevent
+ // either from being unbound and destroyed.
+ template<typename T>
+ class Handle
+ {
+ public:
+ Handle(std::nullptr_t) : m_data(nullptr) { }
+ Handle(T *data) : m_data(data) { }
+ Handle(Handle &&that) : m_data(that.m_data) { that.m_data = nullptr; }
+ ~Handle()
+ {
+ if (m_data)
+ Compositor::unlockBindings();
+ }
+ T *operator->() const { return m_data; }
+ T &operator*() const { return *m_data; }
+ explicit operator bool() const { return m_data; }
+
+ private:
+ T *m_data;
+ };
+
+ // Observes the compositor corresponding to the given id.
+ //
+ // Only one observer can exist per compositor.
+ class Q_WEBENGINECORE_EXPORT Observer
+ {
+ public:
+ // Binding to compositor
+ void bind(Id id);
+ void unbind();
+
+ // Compositor if bound
+ Handle<Compositor> compositor();
+
+ // There's a new frame ready, time to swapFrame().
+ virtual void readyToSwap() = 0;
+
+ protected:
+ Observer() = default;
+ ~Observer() { if (m_binding) unbind(); }
+
+ private:
+ Binding *m_binding = nullptr;
+ };
+
+ // Type determines which methods can be called.
+ Type type() const { return m_type; }
+
+ // Binding to observer.
+ void bind(Id id);
+ void unbind();
+
+ // Observer if bound.
+ Handle<Observer> observer();
+
+ // Update to next frame if possible.
+ virtual void swapFrame() = 0;
+
+ // Ratio of pixels to DIPs.
+ //
+ // Don't use the devicePixelRatio of QImage, it's always 1.
+ virtual float devicePixelRatio() = 0;
+
+ // Size of frame in pixels.
+ virtual QSize size() = 0;
+
+ // Whether frame needs an alpha channel.
+ virtual bool requiresAlphaChannel() = 0;
+
+ // Wait on texture to be ready aka. sync.
+ virtual void waitForTexture();
+
+ // Release any held texture resources
+ virtual void releaseTexture();
+
+ // QSGTexture of the frame.
+ virtual QSGTexture *texture(QQuickWindow *win, uint32_t textureOptions);
+
+ // Is the texture produced upside down?
+ virtual bool textureIsFlipped();
+
+ // Release resources created in texture()
+ virtual void releaseResources();
+
+protected:
+ Compositor(Type type) : m_type(type) { }
+ virtual ~Compositor() { if (m_binding) unbind(); }
- void setFrameSinkClient(viz::mojom::CompositorFrameSinkClient *frameSinkClient);
- void setNeedsBeginFrames(bool needsBeginFrames);
+private:
+ template<typename T>
+ friend class Handle;
- void submitFrame(viz::CompositorFrame frame, base::OnceClosure callback);
- QSGNode *updatePaintNode(QSGNode *oldNode, RenderWidgetHostViewQtDelegate *viewDelegate);
+ class BindingMap;
+ static void unlockBindings();
-private:
- void runSubmitCallback();
- void notifyFrameCommitted();
- void sendPresentationFeedback(uint frame_token);
-
- // viz::BeginFrameObserverBase
- bool OnBeginFrameDerivedImpl(const viz::BeginFrameArgs &args) override;
- void OnBeginFrameSourcePausedChanged(bool paused) override;
-
- viz::CompositorFrame m_committedFrame;
- viz::CompositorFrame m_pendingFrame;
- base::OnceClosure m_submitCallback;
- std::unique_ptr<CompositorResourceTracker> m_resourceTracker;
- content::RenderWidgetHost *m_host;
- std::unique_ptr<viz::SyntheticBeginFrameSource> m_beginFrameSource;
- base::flat_map<uint32_t, viz::FrameTimingDetails> m_presentations;
- viz::mojom::CompositorFrameSinkClient *m_frameSinkClient = nullptr;
- bool m_updatePaintNodeShouldCommit = false;
- bool m_needsBeginFrames = false;
-
- scoped_refptr<base::SingleThreadTaskRunner> m_taskRunner;
- base::WeakPtrFactory<Compositor> m_weakPtrFactory{this};
-
- DISALLOW_COPY_AND_ASSIGN(Compositor);
+ const Type m_type;
+ Binding *m_binding = nullptr;
};
} // namespace QtWebEngineCore
diff --git a/src/core/compositor/compositor_resource.h b/src/core/compositor/compositor_resource.h
deleted file mode 100644
index f7df2ab59..000000000
--- a/src/core/compositor/compositor_resource.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef COMPOSITOR_RESOURCE_H
-#define COMPOSITOR_RESOURCE_H
-
-#include <base/memory/ref_counted.h>
-#include <components/viz/common/resources/transferable_resource.h>
-
-#include <QtCore/qglobal.h>
-#include <QtGui/qtgui-config.h>
-
-#if QT_CONFIG(opengl)
-# include "compositor_resource_fence.h"
-#endif
-
-namespace viz {
-class SharedBitmap;
-} // namespace viz
-
-namespace QtWebEngineCore {
-
-using CompositorResourceId = quint32;
-
-// A resource (OpenGL texture or software shared bitmap).
-//
-// - Created by the CompositorResourceTracker from a newly submitted
-// CompositorFrame's resource_list.
-//
-// - Until the frame is committed, its resources are in a 'pending' state and
-// are inaccessible from outside the CompositorResourceTracker.
-//
-// - Once the frame is committed, its resources can be found via
-// CompositorResourceTracker::findResource.
-//
-// - A committed resource's fields may not be updated and are safe to use from
-// other threads without synchronization (unless noted otherwise).
-class CompositorResource : public viz::TransferableResource
-{
-public:
- CompositorResource(const viz::TransferableResource &tr) : viz::TransferableResource(tr) {}
-
- // Counts the number of times this resource has been encountered in
- // CompositorFrames' resource lists.
- //
- // Corresponds to viz::ReturnedResource::count.
- //
- // Updated by CompositorResourceTracker on UI thread.
- int import_count = 1;
-
- // Identifies the last frame that needed this resource. Used by
- // CompositorResourceTracker to return unused resources back to child
- // compositors.
- //
- // Updated by CompositorResourceTracker on UI thread.
- quint32 last_used_for_frame = 0;
-
- // Bitmap (if is_software).
- std::unique_ptr<viz::SharedBitmap> bitmap;
-
-#if QT_CONFIG(opengl)
- // OpenGL texture id (if !is_software).
- quint32 texture_id = 0;
-
- // Should be waited on before using the texture (non-null if !is_software).
- scoped_refptr<CompositorResourceFence> texture_fence;
-#endif // QT_CONFIG(opengl)
-};
-
-inline bool operator<(const CompositorResource &r1, const CompositorResource &r2)
-{
- return r1.id < r2.id;
-}
-
-inline bool operator<(const CompositorResource &r, CompositorResourceId id)
-{
- return r.id < id;
-}
-
-inline bool operator<(CompositorResourceId id, const CompositorResource &r)
-{
- return id < r.id;
-}
-
-} // namespace QtWebEngineCore
-
-#endif // !COMPOSITOR_RESOURCE_H
diff --git a/src/core/compositor/compositor_resource_fence.cpp b/src/core/compositor/compositor_resource_fence.cpp
index 4179395d6..bd1c95cd9 100644
--- a/src/core/compositor/compositor_resource_fence.cpp
+++ b/src/core/compositor/compositor_resource_fence.cpp
@@ -1,44 +1,8 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "compositor_resource_fence.h"
-
+#include "ozone/gl_surface_qt.h"
#include "ui/gl/gl_context.h"
#include <QtGui/qopenglcontext.h>
@@ -47,6 +11,12 @@
#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFFull
#endif
+
+#if QT_CONFIG(egl)
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
+#endif
+
namespace QtWebEngineCore {
void CompositorResourceFence::wait()
@@ -55,7 +25,8 @@ void CompositorResourceFence::wait()
return;
QOpenGLContext *context = QOpenGLContext::currentContext();
- Q_ASSERT(context);
+ if (!context)
+ return;
// Chromium uses its own GL bindings and stores in in thread local storage.
// For that reason, let chromium_gpu_helper.cpp contain the producing code that will run in the Chromium
diff --git a/src/core/compositor/compositor_resource_fence.h b/src/core/compositor/compositor_resource_fence.h
index 574416b8b..ab92ca5c7 100644
--- a/src/core/compositor/compositor_resource_fence.h
+++ b/src/core/compositor/compositor_resource_fence.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef COMPOSITOR_RESOURCE_FENCE_H
#define COMPOSITOR_RESOURCE_FENCE_H
diff --git a/src/core/compositor/compositor_resource_tracker.cpp b/src/core/compositor/compositor_resource_tracker.cpp
deleted file mode 100644
index 1e7108571..000000000
--- a/src/core/compositor/compositor_resource_tracker.cpp
+++ /dev/null
@@ -1,266 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "compositor_resource_tracker.h"
-
-#include "chromium_gpu_helper.h"
-#include "render_widget_host_view_qt_delegate.h"
-#include "web_engine_context.h"
-
-#include "base/message_loop/message_loop.h"
-#include "base/task/post_task.h"
-#include "components/viz/common/quads/compositor_frame.h"
-#include "components/viz/common/resources/returned_resource.h"
-#include "components/viz/service/display_embedder/server_shared_bitmap_manager.h"
-#include "content/browser/browser_main_loop.h"
-#include "content/public/browser/browser_task_traits.h"
-#include "content/public/browser/browser_thread.h"
-#include "content/public/gpu/content_gpu_client.h"
-#include "gpu/command_buffer/service/mailbox_manager.h"
-#include "gpu/command_buffer/service/sync_point_manager.h"
-
-namespace QtWebEngineCore {
-
-CompositorResourceTracker::CompositorResourceTracker()
-{}
-
-CompositorResourceTracker::~CompositorResourceTracker()
-{}
-
-void CompositorResourceTracker::submitResources(const viz::CompositorFrame &frame, base::OnceClosure callback)
-{
- DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- DCHECK(!m_submitCallback);
- DCHECK(m_pendingResources.empty());
- DCHECK(m_pendingImports.empty());
- DCHECK(m_pendingResourceUpdates == 0);
-
- m_submitCallback = std::move(callback);
-
- m_pendingResources.reserve(frame.resource_list.size());
- m_pendingImports.reserve(frame.resource_list.size());
-
- for (const viz::TransferableResource &transferableResource : frame.resource_list) {
- auto it = m_committedResources.find(transferableResource.id);
- if (it != m_committedResources.end())
- m_pendingImports.push_back(&*it);
- else
- m_pendingResources.emplace_back(transferableResource);
- }
-
- if (m_pendingResources.empty()) {
- scheduleRunSubmitCallback();
- return;
- }
-
- m_pendingResourceUpdates = m_pendingResources.size();
-
- std::vector<CompositorResource *> batch;
- batch.reserve(m_pendingResources.size());
-
- for (CompositorResource &resource : m_pendingResources) {
- if (resource.is_software)
- updateBitmap(&resource);
- else if (!scheduleUpdateMailbox(&resource))
- batch.push_back(&resource);
- }
-
- if (!batch.empty())
- scheduleUpdateMailboxes(std::move(batch));
-}
-
-void CompositorResourceTracker::commitResources()
-{
- // DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- //
- // This might be called from a Qt Quick render thread, but the UI thread
- // will still be blocked for the duration of this call.
-
- DCHECK(m_pendingResourceUpdates == 0);
-
- for (CompositorResource *resource : m_pendingImports)
- resource->import_count++;
- m_pendingImports.clear();
-
- m_committedResources.insert(std::make_move_iterator(m_pendingResources.begin()),
- std::make_move_iterator(m_pendingResources.end()));
- m_pendingResources.clear();
-
- ++m_committedFrameId;
-}
-
-std::vector<viz::ReturnedResource> CompositorResourceTracker::returnResources()
-{
- DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
-
- std::vector<viz::ReturnedResource> returnedResources;
- base::EraseIf(m_committedResources, [&](const CompositorResource &resource) {
- if (resource.last_used_for_frame != m_committedFrameId) {
- viz::ReturnedResource returnedResource;
- returnedResource.id = resource.id;
- returnedResource.count = resource.import_count;
- returnedResources.push_back(std::move(returnedResource));
- return true;
- }
- return false;
- });
- return returnedResources;
-}
-
-const CompositorResource *CompositorResourceTracker::findResource(CompositorResourceId id) const
-{
- auto it = m_committedResources.find(id);
- DCHECK(it != m_committedResources.end());
-
- const_cast<CompositorResource &>(*it).last_used_for_frame = m_committedFrameId;
-
- return &*it;
-}
-
-void CompositorResourceTracker::updateBitmap(CompositorResource *resource)
-{
- content::BrowserMainLoop *browserMainLoop = content::BrowserMainLoop::GetInstance();
- viz::ServerSharedBitmapManager *bitmapManager = browserMainLoop->GetServerSharedBitmapManager();
-
- resource->bitmap = bitmapManager->GetSharedBitmapFromId(
- resource->size,
- viz::BGRA_8888,
- resource->mailbox_holder.mailbox);
-
- if (--m_pendingResourceUpdates == 0)
- scheduleRunSubmitCallback();
-}
-
-quint32 CompositorResourceTracker::consumeMailbox(const gpu::MailboxHolder &mailboxHolder)
-{
-#if QT_CONFIG(opengl)
- gpu::MailboxManager *mailboxManager = mailbox_manager();
- DCHECK(mailboxManager);
- if (mailboxHolder.sync_token.HasData())
- mailboxManager->PullTextureUpdates(mailboxHolder.sync_token);
- gpu::TextureBase *tex = mailboxManager->ConsumeTexture(mailboxHolder.mailbox);
- return tex ? service_id(tex) : 0;
-#else
- NOTREACHED();
-#endif // QT_CONFIG(OPENGL)
-}
-
-bool CompositorResourceTracker::scheduleUpdateMailbox(CompositorResource *resource)
-{
-#if QT_CONFIG(opengl)
- gpu::SyncPointManager *syncPointManager = WebEngineContext::syncPointManager();
- DCHECK(syncPointManager);
- return syncPointManager->WaitOutOfOrder(
- resource->mailbox_holder.sync_token,
- base::BindOnce(&CompositorResourceTracker::updateMailbox,
- m_weakPtrFactory.GetWeakPtr(),
- resource));
-#else
- NOTREACHED();
-#endif // QT_CONFIG(OPENGL)
-}
-
-void CompositorResourceTracker::updateMailbox(CompositorResource *resource)
-{
-#if QT_CONFIG(opengl)
- resource->texture_id = consumeMailbox(resource->mailbox_holder);
- resource->texture_fence = CompositorResourceFence::create();
-
- if (--m_pendingResourceUpdates == 0)
- scheduleRunSubmitCallback();
-#else
- NOTREACHED();
-#endif // QT_CONFIG(OPENGL)
-}
-
-void CompositorResourceTracker::scheduleUpdateMailboxes(std::vector<CompositorResource *> resources)
-{
-#if QT_CONFIG(opengl)
- scoped_refptr<base::SingleThreadTaskRunner> gpuTaskRunner = gpu_task_runner();
- DCHECK(gpuTaskRunner);
- thread_local bool currentThreadIsGpu = gpuTaskRunner->BelongsToCurrentThread();
- if (currentThreadIsGpu)
- return updateMailboxes(std::move(resources));
- gpuTaskRunner->PostTask(
- FROM_HERE,
- base::BindOnce(&CompositorResourceTracker::updateMailboxes,
- m_weakPtrFactory.GetWeakPtr(),
- std::move(resources)));
-#else
- NOTREACHED();
-#endif // QT_CONFIG(OPENGL)
-}
-
-void CompositorResourceTracker::updateMailboxes(std::vector<CompositorResource *> resources)
-{
-#if QT_CONFIG(opengl)
- for (CompositorResource *resource : resources)
- resource->texture_id = consumeMailbox(resource->mailbox_holder);
-
- scoped_refptr<CompositorResourceFence> fence = CompositorResourceFence::create();
-
- for (CompositorResource *resource : resources)
- resource->texture_fence = fence;
-
- if ((m_pendingResourceUpdates -= resources.size()) == 0)
- scheduleRunSubmitCallback();
-#else
- NOTREACHED();
-#endif // QT_CONFIG(OPENGL)
-}
-
-void CompositorResourceTracker::scheduleRunSubmitCallback()
-{
- thread_local bool currentThreadIsUi = content::BrowserThread::CurrentlyOn(content::BrowserThread::UI);
- if (currentThreadIsUi)
- return runSubmitCallback();
- base::PostTask(
- FROM_HERE, { content::BrowserThread::UI, base::TaskPriority::USER_VISIBLE },
- base::BindOnce(&CompositorResourceTracker::runSubmitCallback,
- m_weakPtrFactory.GetWeakPtr()));
-}
-
-void CompositorResourceTracker::runSubmitCallback()
-{
- DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
-
- std::move(m_submitCallback).Run();
-}
-
-} // namespace QtWebEngineCore
diff --git a/src/core/compositor/compositor_resource_tracker.h b/src/core/compositor/compositor_resource_tracker.h
deleted file mode 100644
index 080891e5f..000000000
--- a/src/core/compositor/compositor_resource_tracker.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef COMPOSITOR_RESOURCE_TRACKER_H
-#define COMPOSITOR_RESOURCE_TRACKER_H
-
-#include "base/bind.h"
-#include "base/callback.h"
-#include "base/containers/flat_set.h"
-
-#include "compositor_resource.h"
-#include "locked_ptr.h"
-
-#include <atomic>
-#include <vector>
-
-namespace viz {
-class CompositorFrame;
-struct ReturnedResource;
-} // namespace viz
-
-namespace gpu {
-struct MailboxHolder;
-} // namespace gpu
-
-namespace QtWebEngineCore {
-
-// Ensures resources are not used before they are ready.
-//
-// The life cycle of a frame's resources:
-//
-// Step 1. A new CompositorFrame is received and given to submitResources().
-// The frame's resources will extracted and initialized to a pending state.
-//
-// Step 2. Once the new resources are ready to be committed,
-// CompositorResourceTracker will notify the client by running the callback
-// given to submitResources().
-//
-// Step 3. Once the client is ready to render, commitResources() should be
-// called. This will commit all the pending resources, making them available
-// via findResource().
-//
-// Step 4. Once all the resources have been used (via findResource()),
-// returnResources() may be called to return a list of all the resources which
-// were *not* used since the last commitResources(). Go to step 1.
-class CompositorResourceTracker final
-{
-public:
- CompositorResourceTracker();
- ~CompositorResourceTracker();
-
- void submitResources(const viz::CompositorFrame &frame, base::OnceClosure callback);
- void commitResources();
- std::vector<viz::ReturnedResource> returnResources();
-
- // The returned pointer is invalidated by the next call to commitFrame() or
- // returnResources(). It should therefore not be stored in data structures
- // but used immediately.
- //
- // Do not ask for resources which do not exist.
- const CompositorResource *findResource(CompositorResourceId id) const;
-
-private:
- void updateBitmap(CompositorResource *resource);
-
- quint32 consumeMailbox(const gpu::MailboxHolder &mailboxHolder);
-
- bool scheduleUpdateMailbox(CompositorResource *resource);
- void updateMailbox(CompositorResource *resource);
-
- void scheduleUpdateMailboxes(std::vector<CompositorResource *> resources);
- void updateMailboxes(std::vector<CompositorResource *> resources);
-
- void scheduleRunSubmitCallback();
- void runSubmitCallback();
-
- base::flat_set<CompositorResource> m_committedResources;
- std::vector<CompositorResource> m_pendingResources;
- std::vector<CompositorResource *> m_pendingImports;
- base::OnceClosure m_submitCallback;
- std::atomic<size_t> m_pendingResourceUpdates{0};
- quint32 m_committedFrameId = 0;
-
- base::LockedPtrFactory<CompositorResourceTracker> m_weakPtrFactory{this};
-
- DISALLOW_COPY_AND_ASSIGN(CompositorResourceTracker);
-};
-
-} // namespace QtWebEngineCore
-
-#endif // !COMPOSITOR_RESOURCE_TRACKER_H
diff --git a/src/core/compositor/content_gpu_client_qt.cpp b/src/core/compositor/content_gpu_client_qt.cpp
index f934979a0..6ef8048f2 100644
--- a/src/core/compositor/content_gpu_client_qt.cpp
+++ b/src/core/compositor/content_gpu_client_qt.cpp
@@ -1,45 +1,8 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "content_gpu_client_qt.h"
-
-#include "web_engine_context.h"
+#include "ozone/gl_share_context_qt.h"
namespace QtWebEngineCore {
@@ -51,9 +14,11 @@ ContentGpuClientQt::~ContentGpuClientQt()
{
}
-gpu::SyncPointManager *ContentGpuClientQt::GetSyncPointManager()
+gl::GLShareGroup *ContentGpuClientQt::GetInProcessGpuShareGroup()
{
- return WebEngineContext::syncPointManager();
+ if (!m_shareGroupQt.get())
+ m_shareGroupQt = new ShareGroupQt;
+ return m_shareGroupQt.get();
}
} // namespace
diff --git a/src/core/compositor/content_gpu_client_qt.h b/src/core/compositor/content_gpu_client_qt.h
index d7ad43881..33314e0bb 100644
--- a/src/core/compositor/content_gpu_client_qt.h
+++ b/src/core/compositor/content_gpu_client_qt.h
@@ -1,47 +1,16 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef CONTENT_GPU_CLIENT_QT_H
#define CONTENT_GPU_CLIENT_QT_H
#include "content/public/gpu/content_gpu_client.h"
+namespace gl {
+class GLShareGroup;
+}
+
namespace QtWebEngineCore {
+class ShareGroupQt;
class ContentGpuClientQt : public content::ContentGpuClient {
public:
@@ -49,7 +18,10 @@ public:
~ContentGpuClientQt() override;
// content::ContentGpuClient implementation.
- gpu::SyncPointManager *GetSyncPointManager() override;
+ gl::GLShareGroup *GetInProcessGpuShareGroup() override;
+
+private:
+ scoped_refptr<ShareGroupQt> m_shareGroupQt;
};
}
diff --git a/src/core/compositor/delegated_frame_node.cpp b/src/core/compositor/delegated_frame_node.cpp
deleted file mode 100644
index 06ca49f4f..000000000
--- a/src/core/compositor/delegated_frame_node.cpp
+++ /dev/null
@@ -1,1106 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-// On Mac we need to reset this define in order to prevent definition
-// of "check" macros etc. The "check" macro collides with a member function name in QtQuick.
-// See AssertMacros.h in the Mac SDK.
-#include <QtGlobal> // We need this for the Q_OS_MAC define.
-#if defined(Q_OS_MAC)
-#undef __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES
-#define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
-#endif
-
-#include "delegated_frame_node.h"
-
-#include "chromium_gpu_helper.h"
-#include "stream_video_node.h"
-#include "type_conversion.h"
-#include "yuv_video_node.h"
-#include "compositor_resource_tracker.h"
-
-#include "base/bind.h"
-#include "cc/base/math_util.h"
-#include "components/viz/common/quads/compositor_frame.h"
-#include "components/viz/common/quads/debug_border_draw_quad.h"
-#include "components/viz/common/quads/draw_quad.h"
-#include "components/viz/common/quads/render_pass_draw_quad.h"
-#include "components/viz/common/quads/solid_color_draw_quad.h"
-#include "components/viz/common/quads/stream_video_draw_quad.h"
-#include "components/viz/common/quads/texture_draw_quad.h"
-#include "components/viz/common/quads/tile_draw_quad.h"
-#include "components/viz/common/quads/yuv_video_draw_quad.h"
-#include "components/viz/service/display/bsp_tree.h"
-#include "components/viz/service/display_embedder/server_shared_bitmap_manager.h"
-
-#if QT_CONFIG(opengl)
-# include <QOpenGLContext>
-# include <QOpenGLFunctions>
-# include <QSGFlatColorMaterial>
-#endif
-#include <QSGTexture>
-#include <private/qsgadaptationlayer_p.h>
-
-#include <QSGImageNode>
-#include <QSGRectangleNode>
-
-#if QT_CONFIG(egl)
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-#endif
-
-#ifndef GL_TEXTURE_RECTANGLE
-#define GL_TEXTURE_RECTANGLE 0x84F5
-#endif
-
-#ifndef GL_NEAREST
-#define GL_NEAREST 0x2600
-#endif
-
-#ifndef GL_LINEAR
-#define GL_LINEAR 0x2601
-#endif
-
-#ifndef GL_RGBA
-#define GL_RGBA 0x1908
-#endif
-
-#ifndef GL_RGB
-#define GL_RGB 0x1907
-#endif
-
-#ifndef GL_LINE_LOOP
-#define GL_LINE_LOOP 0x0002
-#endif
-
-#if QT_CONFIG(opengl)
-QT_BEGIN_NAMESPACE
-Q_GUI_EXPORT QOpenGLContext *qt_gl_global_share_context();
-QT_END_NAMESPACE
-#endif
-
-namespace QtWebEngineCore {
-#if QT_CONFIG(opengl)
-class MailboxTexture : public QSGTexture, protected QOpenGLFunctions {
-public:
- MailboxTexture(const CompositorResource *resource, bool hasAlphaChannel, int target = -1);
- ~MailboxTexture();
- // QSGTexture:
- int textureId() const override { return m_textureId; }
- QSize textureSize() const override { return m_textureSize; }
- bool hasAlphaChannel() const override { return m_hasAlpha; }
- bool hasMipmaps() const override { return false; }
- void bind() override;
-
-private:
- int m_textureId;
- scoped_refptr<CompositorResourceFence> m_fence;
- QSize m_textureSize;
- bool m_hasAlpha;
- GLenum m_target;
-#if defined(USE_OZONE)
- bool m_ownsTexture;
-#endif
- friend class DelegatedFrameNode;
-};
-#endif // QT_CONFIG(opengl)
-
-class RectClipNode : public QSGClipNode
-{
-public:
- RectClipNode(const QRectF &);
-private:
- QSGGeometry m_geometry;
-};
-
-class DelegatedNodeTreeHandler
-{
-public:
- DelegatedNodeTreeHandler(QVector<QSGNode*> *sceneGraphNodes)
- : m_sceneGraphNodes(sceneGraphNodes)
- {
- }
-
- virtual ~DelegatedNodeTreeHandler(){}
-
- virtual void setupRenderPassNode(QSGTexture *, const QRect &, const QRectF &, QSGNode *) = 0;
- virtual void setupTextureContentNode(QSGTexture *, const QRect &, const QRectF &,
- QSGImageNode::TextureCoordinatesTransformMode,
- QSGNode *) = 0;
- virtual void setupSolidColorNode(const QRect &, const QColor &, QSGNode *) = 0;
-
-#if QT_CONFIG(opengl)
- virtual void setupDebugBorderNode(QSGGeometry *, QSGFlatColorMaterial *, QSGNode *) = 0;
- virtual void setupYUVVideoNode(QSGTexture *, QSGTexture *, QSGTexture *, QSGTexture *,
- const QRectF &, const QRectF &, const QSizeF &, const QSizeF &,
- gfx::ColorSpace, float, float, const QRectF &,
- QSGNode *) = 0;
-#ifdef GL_OES_EGL_image_external
- virtual void setupStreamVideoNode(MailboxTexture *, const QRectF &,
- const QMatrix4x4 &, QSGNode *) = 0;
-#endif // GL_OES_EGL_image_external
-#endif // QT_CONFIG(opengl)
-protected:
- QVector<QSGNode*> *m_sceneGraphNodes;
-};
-
-class DelegatedNodeTreeUpdater : public DelegatedNodeTreeHandler
-{
-public:
- DelegatedNodeTreeUpdater(QVector<QSGNode*> *sceneGraphNodes)
- : DelegatedNodeTreeHandler(sceneGraphNodes)
- , m_nodeIterator(sceneGraphNodes->begin())
- {
- }
-
- void setupRenderPassNode(QSGTexture *layer, const QRect &rect, const QRectF &sourceRect, QSGNode *) override
- {
- Q_ASSERT(layer);
- Q_ASSERT(m_nodeIterator != m_sceneGraphNodes->end());
- QSGImageNode *imageNode = static_cast<QSGImageNode*>(*m_nodeIterator++);
- imageNode->setRect(rect);
- imageNode->setSourceRect(sourceRect);
- imageNode->setTexture(layer);
- }
-
- void setupTextureContentNode(QSGTexture *texture, const QRect &rect, const QRectF &sourceRect,
- QSGImageNode::TextureCoordinatesTransformMode texCoordTransForm,
- QSGNode *) override
- {
- Q_ASSERT(m_nodeIterator != m_sceneGraphNodes->end());
- QSGImageNode *textureNode = static_cast<QSGImageNode*>(*m_nodeIterator++);
- if (textureNode->texture() != texture) {
- // Chromium sometimes uses textures that doesn't completely fit
- // in which case the geometry needs to be recalculated even if
- // rect and src-rect matches.
- if (textureNode->texture()->textureSize() != texture->textureSize())
- textureNode->markDirty(QSGImageNode::DirtyGeometry);
- textureNode->setTexture(texture);
- }
- if (textureNode->textureCoordinatesTransform() != texCoordTransForm)
- textureNode->setTextureCoordinatesTransform(texCoordTransForm);
- if (textureNode->rect() != rect)
- textureNode->setRect(rect);
- if (textureNode->sourceRect() != sourceRect)
- textureNode->setSourceRect(sourceRect);
- if (textureNode->filtering() != texture->filtering())
- textureNode->setFiltering(texture->filtering());
- }
- void setupSolidColorNode(const QRect &rect, const QColor &color, QSGNode *) override
- {
- Q_ASSERT(m_nodeIterator != m_sceneGraphNodes->end());
- QSGRectangleNode *rectangleNode = static_cast<QSGRectangleNode*>(*m_nodeIterator++);
-
- if (rectangleNode->rect() != rect)
- rectangleNode->setRect(rect);
- if (rectangleNode->color() != color)
- rectangleNode->setColor(color);
- }
-#if QT_CONFIG(opengl)
- void setupDebugBorderNode(QSGGeometry *geometry, QSGFlatColorMaterial *material,
- QSGNode *) override
- {
- Q_ASSERT(m_nodeIterator != m_sceneGraphNodes->end());
- QSGGeometryNode *geometryNode = static_cast<QSGGeometryNode*>(*m_nodeIterator++);
-
- geometryNode->setGeometry(geometry);
- geometryNode->setMaterial(material);
- }
-
- void setupYUVVideoNode(QSGTexture *, QSGTexture *, QSGTexture *, QSGTexture *,
- const QRectF &, const QRectF &, const QSizeF &, const QSizeF &,
- gfx::ColorSpace, float, float, const QRectF &,
- QSGNode *) override
- {
- Q_UNREACHABLE();
- }
-#ifdef GL_OES_EGL_image_external
- void setupStreamVideoNode(MailboxTexture *, const QRectF &,
- const QMatrix4x4 &, QSGNode *) override
- {
- Q_UNREACHABLE();
- }
-#endif // GL_OES_EGL_image_external
-#endif // QT_CONFIG(opengl)
-
-private:
- QVector<QSGNode*>::iterator m_nodeIterator;
-};
-
-class DelegatedNodeTreeCreator : public DelegatedNodeTreeHandler
-{
-public:
- DelegatedNodeTreeCreator(QVector<QSGNode*> *sceneGraphNodes,
- RenderWidgetHostViewQtDelegate *apiDelegate)
- : DelegatedNodeTreeHandler(sceneGraphNodes)
- , m_apiDelegate(apiDelegate)
- {
- }
-
- void setupRenderPassNode(QSGTexture *layer, const QRect &rect, const QRectF &sourceRect,
- QSGNode *layerChain) override
- {
- Q_ASSERT(layer);
- QSGImageNode *imageNode = m_apiDelegate->createImageNode();
- imageNode->setRect(rect);
- imageNode->setSourceRect(sourceRect);
- imageNode->setTexture(layer);
-
- layerChain->appendChildNode(imageNode);
- m_sceneGraphNodes->append(imageNode);
- }
-
- void setupTextureContentNode(QSGTexture *texture, const QRect &rect, const QRectF &sourceRect,
- QSGImageNode::TextureCoordinatesTransformMode texCoordTransForm,
- QSGNode *layerChain) override
- {
- QSGImageNode *textureNode = m_apiDelegate->createImageNode();
- textureNode->setTextureCoordinatesTransform(texCoordTransForm);
- textureNode->setRect(rect);
- textureNode->setSourceRect(sourceRect);
- textureNode->setTexture(texture);
- textureNode->setFiltering(texture->filtering());
-
- layerChain->appendChildNode(textureNode);
- m_sceneGraphNodes->append(textureNode);
- }
-
- void setupSolidColorNode(const QRect &rect, const QColor &color,
- QSGNode *layerChain) override
- {
- QSGRectangleNode *rectangleNode = m_apiDelegate->createRectangleNode();
- rectangleNode->setRect(rect);
- rectangleNode->setColor(color);
-
- layerChain->appendChildNode(rectangleNode);
- m_sceneGraphNodes->append(rectangleNode);
- }
-
-#if QT_CONFIG(opengl)
- void setupDebugBorderNode(QSGGeometry *geometry, QSGFlatColorMaterial *material,
- QSGNode *layerChain) override
- {
- QSGGeometryNode *geometryNode = new QSGGeometryNode;
- geometryNode->setFlags(QSGNode::OwnsGeometry | QSGNode::OwnsMaterial);
-
- geometryNode->setGeometry(geometry);
- geometryNode->setMaterial(material);
-
- layerChain->appendChildNode(geometryNode);
- m_sceneGraphNodes->append(geometryNode);
- }
-
- void setupYUVVideoNode(QSGTexture *yTexture, QSGTexture *uTexture, QSGTexture *vTexture,
- QSGTexture *aTexture, const QRectF &yaTexCoordRect,
- const QRectF &uvTexCoordRect, const QSizeF &yaTexSize,
- const QSizeF &uvTexSize, gfx::ColorSpace colorspace,
- float rMul, float rOff, const QRectF &rect,
- QSGNode *layerChain) override
- {
- YUVVideoNode *videoNode = new YUVVideoNode(
- yTexture,
- uTexture,
- vTexture,
- aTexture,
- yaTexCoordRect,
- uvTexCoordRect,
- yaTexSize,
- uvTexSize,
- colorspace,
- rMul,
- rOff);
- videoNode->setRect(rect);
-
- layerChain->appendChildNode(videoNode);
- m_sceneGraphNodes->append(videoNode);
- }
-#ifdef GL_OES_EGL_image_external
- void setupStreamVideoNode(MailboxTexture *texture, const QRectF &rect,
- const QMatrix4x4 &textureMatrix, QSGNode *layerChain) override
- {
- StreamVideoNode *svideoNode = new StreamVideoNode(texture, false, ExternalTarget);
- svideoNode->setRect(rect);
- svideoNode->setTextureMatrix(textureMatrix);
- layerChain->appendChildNode(svideoNode);
- m_sceneGraphNodes->append(svideoNode);
- }
-#endif // GL_OES_EGL_image_external
-#endif // QT_CONFIG(opengl)
-
-private:
- RenderWidgetHostViewQtDelegate *m_apiDelegate;
-};
-
-
-static inline QSharedPointer<QSGLayer> findRenderPassLayer(const int &id, const QVector<QPair<int, QSharedPointer<QSGLayer> > > &list)
-{
- typedef QPair<int, QSharedPointer<QSGLayer> > Pair;
- for (const Pair &pair : list)
- if (pair.first == id)
- return pair.second;
- return QSharedPointer<QSGLayer>();
-}
-
-static QSGNode *buildRenderPassChain(QSGNode *chainParent)
-{
- // Chromium already ordered the quads from back to front for us, however the
- // Qt scene graph layers individual geometries in their own z-range and uses
- // the depth buffer to visually stack nodes according to their item tree order.
-
- // This gets rid of the z component of all quads, once any x and y perspective
- // transformation has been applied to vertices not on the z=0 plane. Qt will
- // use an orthographic projection to render them.
- QSGTransformNode *zCompressNode = new QSGTransformNode;
- QMatrix4x4 zCompressMatrix;
- zCompressMatrix.scale(1, 1, 0);
- zCompressNode->setMatrix(zCompressMatrix);
- chainParent->appendChildNode(zCompressNode);
- return zCompressNode;
-}
-
-static QSGNode *buildLayerChain(QSGNode *chainParent, const viz::SharedQuadState *layerState)
-{
- QSGNode *layerChain = chainParent;
- if (layerState->is_clipped) {
- RectClipNode *clipNode = new RectClipNode(toQt(layerState->clip_rect));
- layerChain->appendChildNode(clipNode);
- layerChain = clipNode;
- }
- if (!layerState->quad_to_target_transform.IsIdentity()) {
- QSGTransformNode *transformNode = new QSGTransformNode;
- QMatrix4x4 qMatrix;
- convertToQt(layerState->quad_to_target_transform.matrix(), qMatrix);
- transformNode->setMatrix(qMatrix);
- layerChain->appendChildNode(transformNode);
- layerChain = transformNode;
- }
- if (layerState->opacity < 1.0) {
- QSGOpacityNode *opacityNode = new QSGOpacityNode;
- opacityNode->setOpacity(layerState->opacity);
- layerChain->appendChildNode(opacityNode);
- layerChain = opacityNode;
- }
- return layerChain;
-}
-
-#if QT_CONFIG(opengl)
-MailboxTexture::MailboxTexture(const CompositorResource *resource, bool hasAlphaChannel, int target)
- : m_textureId(resource->texture_id)
- , m_fence(resource->texture_fence)
- , m_textureSize(toQt(resource->size))
- , m_hasAlpha(hasAlphaChannel)
- , m_target(target >= 0 ? target : GL_TEXTURE_2D)
-#if defined(USE_OZONE)
- , m_ownsTexture(false)
-#endif
-{
- initializeOpenGLFunctions();
-
- // Assume that resources without a size will be used with a full source rect.
- // Setting a size of 1x1 will let any texture node compute a normalized source
- // rect of (0, 0) to (1, 1) while an empty texture size would set (0, 0) on all corners.
- if (m_textureSize.isEmpty())
- m_textureSize = QSize(1, 1);
-}
-
-MailboxTexture::~MailboxTexture()
-{
-#if defined(USE_OZONE)
- // This is rare case, where context is not shared
- // we created extra texture in current context, so
- // delete it now
- if (m_ownsTexture) {
- QOpenGLContext *currentContext = QOpenGLContext::currentContext() ;
- QOpenGLFunctions *funcs = currentContext->functions();
- GLuint id(m_textureId);
- funcs->glDeleteTextures(1, &id);
- }
-#endif
-}
-
-void MailboxTexture::bind()
-{
- if (m_fence)
- m_fence->wait();
- glBindTexture(m_target, m_textureId);
-}
-#endif // QT_CONFIG(opengl)
-
-RectClipNode::RectClipNode(const QRectF &rect)
- : m_geometry(QSGGeometry::defaultAttributes_Point2D(), 4)
-{
- QSGGeometry::updateRectGeometry(&m_geometry, rect);
- setGeometry(&m_geometry);
- setClipRect(rect);
- setIsRectangular(true);
-}
-
-DelegatedFrameNode::DelegatedFrameNode()
-#if defined(USE_OZONE) && QT_CONFIG(opengl)
- : m_contextShared(true)
-#endif
-{
- setFlag(UsePreprocess);
-#if defined(USE_OZONE) && QT_CONFIG(opengl)
- QOpenGLContext *currentContext = QOpenGLContext::currentContext() ;
- QOpenGLContext *sharedContext = qt_gl_global_share_context();
- if (currentContext && sharedContext && !QOpenGLContext::areSharing(currentContext, sharedContext)) {
- static bool allowNotSharedContextWarningShown = true;
- if (allowNotSharedContextWarningShown) {
- allowNotSharedContextWarningShown = false;
- qWarning("Context is not shared, textures will be copied between contexts.");
- }
- m_offsurface.reset(new QOffscreenSurface);
- m_offsurface->create();
- m_contextShared = false;
- }
-#endif
-}
-
-DelegatedFrameNode::~DelegatedFrameNode()
-{
-}
-
-void DelegatedFrameNode::preprocess()
-{
- // Then render any intermediate RenderPass in order.
- typedef QPair<int, QSharedPointer<QSGLayer> > Pair;
- for (const Pair &pair : qAsConst(m_sgObjects.renderPassLayers)) {
- // The layer is non-live, request a one-time update here.
- pair.second->scheduleUpdate();
- // Proceed with the actual update.
- pair.second->updateTexture();
- }
-}
-
-static bool areSharedQuadStatesEqual(const viz::SharedQuadState *layerState,
- const viz::SharedQuadState *prevLayerState)
-{
- if (layerState->sorting_context_id != 0 || prevLayerState->sorting_context_id != 0)
- return false;
- if (layerState->is_clipped != prevLayerState->is_clipped
- || layerState->clip_rect != prevLayerState->clip_rect)
- return false;
- if (layerState->quad_to_target_transform != prevLayerState->quad_to_target_transform)
- return false;
- return qFuzzyCompare(layerState->opacity, prevLayerState->opacity);
-}
-
-// Compares if the frame data that we got from the Chromium Compositor is
-// *structurally* equivalent to the one of the previous frame.
-// If it is, we will just reuse and update the old nodes where necessary.
-static bool areRenderPassStructuresEqual(const viz::CompositorFrame *frameData,
- const viz::CompositorFrame *previousFrameData)
-{
- if (!previousFrameData)
- return false;
-
- if (previousFrameData->render_pass_list.size() != frameData->render_pass_list.size())
- return false;
-
- for (unsigned i = 0; i < frameData->render_pass_list.size(); ++i) {
- viz::RenderPass *newPass = frameData->render_pass_list.at(i).get();
- viz::RenderPass *prevPass = previousFrameData->render_pass_list.at(i).get();
-
- if (newPass->id != prevPass->id)
- return false;
-
- if (newPass->quad_list.size() != prevPass->quad_list.size())
- return false;
-
- viz::QuadList::ConstBackToFrontIterator it = newPass->quad_list.BackToFrontBegin();
- viz::QuadList::ConstBackToFrontIterator end = newPass->quad_list.BackToFrontEnd();
- viz::QuadList::ConstBackToFrontIterator prevIt = prevPass->quad_list.BackToFrontBegin();
- viz::QuadList::ConstBackToFrontIterator prevEnd = prevPass->quad_list.BackToFrontEnd();
- for (; it != end && prevIt != prevEnd; ++it, ++prevIt) {
- const viz::DrawQuad *quad = *it;
- const viz::DrawQuad *prevQuad = *prevIt;
- if (quad->material != prevQuad->material)
- return false;
-#if QT_CONFIG(opengl)
- if (quad->material == viz::DrawQuad::Material::kYuvVideoContent)
- return false;
-#ifdef GL_OES_EGL_image_external
- if (quad->material == viz::DrawQuad::Material::kStreamVideoContent)
- return false;
-#endif // GL_OES_EGL_image_external
-#endif // QT_CONFIG(opengl)
- if (!areSharedQuadStatesEqual(quad->shared_quad_state, prevQuad->shared_quad_state))
- return false;
- if (quad->shared_quad_state->is_clipped && quad->visible_rect != prevQuad->visible_rect) {
- gfx::Rect targetRect1 =
- cc::MathUtil::MapEnclosingClippedRect(quad->shared_quad_state->quad_to_target_transform, quad->visible_rect);
- gfx::Rect targetRect2 =
- cc::MathUtil::MapEnclosingClippedRect(quad->shared_quad_state->quad_to_target_transform, prevQuad->visible_rect);
- targetRect1.Intersect(quad->shared_quad_state->clip_rect);
- targetRect2.Intersect(quad->shared_quad_state->clip_rect);
- if (targetRect1.IsEmpty() != targetRect2.IsEmpty())
- return false;
- }
- }
- }
- return true;
-}
-
-void DelegatedFrameNode::commit(const viz::CompositorFrame &pendingFrame,
- const viz::CompositorFrame &committedFrame,
- const CompositorResourceTracker *resourceTracker,
- RenderWidgetHostViewQtDelegate *apiDelegate)
-{
- const viz::CompositorFrame* frameData = &pendingFrame;
- if (frameData->render_pass_list.empty())
- return;
-
- // DelegatedFrameNode is a transform node only for the purpose of
- // countering the scale of devicePixel-scaled tiles when rendering them
- // to the final surface.
- QMatrix4x4 matrix;
- const float devicePixelRatio = frameData->metadata.device_scale_factor;
- matrix.scale(1 / devicePixelRatio, 1 / devicePixelRatio);
- if (QSGTransformNode::matrix() != matrix)
- setMatrix(matrix);
-
- QScopedPointer<DelegatedNodeTreeHandler> nodeHandler;
-
- const QSizeF viewportSizeInPt = apiDelegate->viewGeometry().size();
- const QSizeF viewportSizeF = viewportSizeInPt * devicePixelRatio;
- const QSize viewportSize(std::ceil(viewportSizeF.width()), std::ceil(viewportSizeF.height()));
-
- // We first compare if the render passes from the previous frame data are structurally
- // equivalent to the render passes in the current frame data. If they are, we are going
- // to reuse the old nodes. Otherwise, we will delete the old nodes and build a new tree.
- //
- // Additionally, because we clip (i.e. don't build scene graph nodes for) quads outside
- // of the visible area, we also have to rebuild the tree whenever the window is resized.
- const bool buildNewTree =
- !areRenderPassStructuresEqual(frameData, &committedFrame) ||
- m_sceneGraphNodes.empty() ||
- viewportSize != m_previousViewportSize;
-
- if (buildNewTree) {
- // Keep the old objects in scope to hold a ref on layers, resources and textures
- // that we can re-use. Destroy the remaining objects before returning.
- qSwap(m_sgObjects, m_previousSGObjects);
- // Discard the scene graph nodes from the previous frame.
- while (QSGNode *oldChain = firstChild())
- delete oldChain;
- m_sceneGraphNodes.clear();
- nodeHandler.reset(new DelegatedNodeTreeCreator(&m_sceneGraphNodes, apiDelegate));
- } else {
- qSwap(m_sgObjects.bitmapTextures, m_previousSGObjects.bitmapTextures);
- qSwap(m_sgObjects.mailboxTextures, m_previousSGObjects.mailboxTextures);
- nodeHandler.reset(new DelegatedNodeTreeUpdater(&m_sceneGraphNodes));
- }
- // The RenderPasses list is actually a tree where a parent RenderPass is connected
- // to its dependencies through a RenderPassId reference in one or more RenderPassQuads.
- // The list is already ordered with intermediate RenderPasses placed before their
- // parent, with the last one in the list being the root RenderPass, the one
- // that we displayed to the user.
- // All RenderPasses except the last one are rendered to an FBO.
- viz::RenderPass *rootRenderPass = frameData->render_pass_list.back().get();
-
- gfx::Rect viewportRect(toGfx(viewportSize));
- for (unsigned i = 0; i < frameData->render_pass_list.size(); ++i) {
- viz::RenderPass *pass = frameData->render_pass_list.at(i).get();
-
- QSGNode *renderPassParent = 0;
- gfx::Rect scissorRect;
- if (pass != rootRenderPass) {
- QSharedPointer<QSGLayer> rpLayer;
- if (buildNewTree) {
- rpLayer = findRenderPassLayer(pass->id, m_previousSGObjects.renderPassLayers);
- if (!rpLayer) {
- rpLayer = QSharedPointer<QSGLayer>(apiDelegate->createLayer());
- // Avoid any premature texture update since we need to wait
- // for the GPU thread to produce the dependent resources first.
- rpLayer->setLive(false);
- }
- QSharedPointer<QSGRootNode> rootNode(new QSGRootNode);
- rpLayer->setItem(rootNode.data());
- m_sgObjects.renderPassLayers.append(QPair<int,
- QSharedPointer<QSGLayer> >(pass->id, rpLayer));
- m_sgObjects.renderPassRootNodes.append(rootNode);
- renderPassParent = rootNode.data();
- } else
- rpLayer = findRenderPassLayer(pass->id, m_sgObjects.renderPassLayers);
-
- rpLayer->setRect(toQt(pass->output_rect));
- rpLayer->setSize(toQt(pass->output_rect.size()));
- rpLayer->setFormat(pass->has_transparent_background ? GL_RGBA : GL_RGB);
- rpLayer->setHasMipmaps(pass->generate_mipmap);
- rpLayer->setMirrorVertical(false);
- scissorRect = pass->output_rect;
- } else {
- renderPassParent = this;
- scissorRect = viewportRect;
- scissorRect += rootRenderPass->output_rect.OffsetFromOrigin();
- }
-
- if (scissorRect.IsEmpty()) {
- holdResources(pass, resourceTracker);
- continue;
- }
-
- QSGNode *renderPassChain = nullptr;
- if (buildNewTree)
- renderPassChain = buildRenderPassChain(renderPassParent);
-
- base::circular_deque<std::unique_ptr<viz::DrawPolygon>> polygonQueue;
- int nextPolygonId = 0;
- int currentSortingContextId = 0;
- const viz::SharedQuadState *currentLayerState = nullptr;
- QSGNode *currentLayerChain = nullptr;
- const auto quadListBegin = pass->quad_list.BackToFrontBegin();
- const auto quadListEnd = pass->quad_list.BackToFrontEnd();
- for (auto it = quadListBegin; it != quadListEnd; ++it) {
- const viz::DrawQuad *quad = *it;
- const viz::SharedQuadState *quadState = quad->shared_quad_state;
-
- gfx::Rect targetRect =
- cc::MathUtil::MapEnclosingClippedRect(quadState->quad_to_target_transform,
- quad->visible_rect);
- if (quadState->is_clipped)
- targetRect.Intersect(quadState->clip_rect);
- targetRect.Intersect(scissorRect);
- if (targetRect.IsEmpty()) {
- holdResources(quad, resourceTracker);
- continue;
- }
-
- if (quadState->sorting_context_id != currentSortingContextId) {
- flushPolygons(&polygonQueue, renderPassChain,
- nodeHandler.data(), resourceTracker, apiDelegate);
- currentSortingContextId = quadState->sorting_context_id;
- }
-
- if (currentSortingContextId != 0) {
- std::unique_ptr<viz::DrawPolygon> polygon(
- new viz::DrawPolygon(
- quad,
- gfx::RectF(quad->visible_rect),
- quadState->quad_to_target_transform,
- nextPolygonId++));
- if (polygon->points().size() > 2u)
- polygonQueue.push_back(std::move(polygon));
- continue;
- }
-
- if (renderPassChain && currentLayerState != quadState) {
- currentLayerState = quadState;
- currentLayerChain = buildLayerChain(renderPassChain, quadState);
- }
-
- handleQuad(quad, currentLayerChain,
- nodeHandler.data(), resourceTracker, apiDelegate);
- }
- flushPolygons(&polygonQueue, renderPassChain,
- nodeHandler.data(), resourceTracker, apiDelegate);
- }
-
- copyMailboxTextures();
-
- m_previousViewportSize = viewportSize;
- m_previousSGObjects = SGObjects();
-}
-
-void DelegatedFrameNode::flushPolygons(
- base::circular_deque<std::unique_ptr<viz::DrawPolygon>> *polygonQueue,
- QSGNode *renderPassChain,
- DelegatedNodeTreeHandler *nodeHandler,
- const CompositorResourceTracker *resourceTracker,
- RenderWidgetHostViewQtDelegate *apiDelegate)
-{
- if (polygonQueue->empty())
- return;
-
- const auto actionHandler = [&](viz::DrawPolygon *polygon) {
- const viz::DrawQuad *quad = polygon->original_ref();
- const viz::SharedQuadState *quadState = quad->shared_quad_state;
-
- QSGNode *currentLayerChain = nullptr;
- if (renderPassChain)
- currentLayerChain = buildLayerChain(renderPassChain, quad->shared_quad_state);
-
- gfx::Transform inverseTransform;
- bool invertible = quadState->quad_to_target_transform.GetInverse(&inverseTransform);
- DCHECK(invertible);
- polygon->TransformToLayerSpace(inverseTransform);
-
- handlePolygon(polygon, currentLayerChain,
- nodeHandler, resourceTracker, apiDelegate);
- };
-
- viz::BspTree(polygonQueue).TraverseWithActionHandler(&actionHandler);
-}
-
-void DelegatedFrameNode::handlePolygon(
- const viz::DrawPolygon *polygon,
- QSGNode *currentLayerChain,
- DelegatedNodeTreeHandler *nodeHandler,
- const CompositorResourceTracker *resourceTracker,
- RenderWidgetHostViewQtDelegate *apiDelegate)
-{
- const viz::DrawQuad *quad = polygon->original_ref();
-
- if (!polygon->is_split()) {
- handleQuad(quad, currentLayerChain,
- nodeHandler, resourceTracker, apiDelegate);
- } else {
- std::vector<gfx::QuadF> clipRegionList;
- polygon->ToQuads2D(&clipRegionList);
- for (const auto & clipRegion : clipRegionList)
- handleClippedQuad(quad, clipRegion, currentLayerChain,
- nodeHandler, resourceTracker, apiDelegate);
- }
-}
-
-void DelegatedFrameNode::handleClippedQuad(
- const viz::DrawQuad *quad,
- const gfx::QuadF &clipRegion,
- QSGNode *currentLayerChain,
- DelegatedNodeTreeHandler *nodeHandler,
- const CompositorResourceTracker *resourceTracker,
- RenderWidgetHostViewQtDelegate *apiDelegate)
-{
- if (currentLayerChain) {
- auto clipGeometry = new QSGGeometry(QSGGeometry::defaultAttributes_Point2D(), 4);
- auto clipGeometryVertices = clipGeometry->vertexDataAsPoint2D();
- clipGeometryVertices[0].set(clipRegion.p1().x(), clipRegion.p1().y());
- clipGeometryVertices[1].set(clipRegion.p2().x(), clipRegion.p2().y());
- clipGeometryVertices[2].set(clipRegion.p4().x(), clipRegion.p4().y());
- clipGeometryVertices[3].set(clipRegion.p3().x(), clipRegion.p3().y());
- auto clipNode = new QSGClipNode;
- clipNode->setGeometry(clipGeometry);
- clipNode->setIsRectangular(false);
- clipNode->setFlag(QSGNode::OwnsGeometry);
- currentLayerChain->appendChildNode(clipNode);
- currentLayerChain = clipNode;
- }
- handleQuad(quad, currentLayerChain,
- nodeHandler, resourceTracker, apiDelegate);
-}
-
-void DelegatedFrameNode::handleQuad(
- const viz::DrawQuad *quad,
- QSGNode *currentLayerChain,
- DelegatedNodeTreeHandler *nodeHandler,
- const CompositorResourceTracker *resourceTracker,
- RenderWidgetHostViewQtDelegate *apiDelegate)
-{
- switch (quad->material) {
- case viz::DrawQuad::Material::kRenderPass: {
- const viz::RenderPassDrawQuad *renderPassQuad = viz::RenderPassDrawQuad::MaterialCast(quad);
- if (!renderPassQuad->mask_texture_size.IsEmpty()) {
- const CompositorResource *resource = findAndHoldResource(renderPassQuad->mask_resource_id(), resourceTracker);
- Q_UNUSED(resource); // FIXME: QTBUG-67652
- }
- QSGLayer *layer =
- findRenderPassLayer(renderPassQuad->render_pass_id, m_sgObjects.renderPassLayers).data();
-
- if (layer)
- nodeHandler->setupRenderPassNode(layer, toQt(quad->rect), toQt(renderPassQuad->tex_coord_rect), currentLayerChain);
-
- break;
- }
- case viz::DrawQuad::Material::kTextureContent: {
- const viz::TextureDrawQuad *tquad = viz::TextureDrawQuad::MaterialCast(quad);
- const CompositorResource *resource = findAndHoldResource(tquad->resource_id(), resourceTracker);
- QSGTexture *texture =
- initAndHoldTexture(resource, quad->ShouldDrawWithBlending(true), apiDelegate);
- QSizeF textureSize;
- if (texture)
- textureSize = texture->textureSize();
- gfx::RectF uv_rect =
- gfx::ScaleRect(gfx::BoundingRect(tquad->uv_top_left, tquad->uv_bottom_right),
- textureSize.width(), textureSize.height());
-
- nodeHandler->setupTextureContentNode(
- texture, toQt(quad->rect), toQt(uv_rect),
- tquad->y_flipped ? QSGImageNode::MirrorVertically : QSGImageNode::NoTransform,
- currentLayerChain);
- break;
- }
- case viz::DrawQuad::Material::kSolidColor: {
- const viz::SolidColorDrawQuad *scquad = viz::SolidColorDrawQuad::MaterialCast(quad);
- // Qt only supports MSAA and this flag shouldn't be needed.
- // If we ever want to use QSGRectangleNode::setAntialiasing for this we should
- // try to see if we can do something similar for tile quads first.
- Q_UNUSED(scquad->force_anti_aliasing_off);
- nodeHandler->setupSolidColorNode(toQt(quad->rect), toQt(scquad->color), currentLayerChain);
- break;
-#if QT_CONFIG(opengl)
- }
- case viz::DrawQuad::Material::kDebugBorder: {
- const viz::DebugBorderDrawQuad *dbquad = viz::DebugBorderDrawQuad::MaterialCast(quad);
-
- QSGGeometry *geometry = new QSGGeometry(QSGGeometry::defaultAttributes_Point2D(), 4);
- geometry->setDrawingMode(GL_LINE_LOOP);
- geometry->setLineWidth(dbquad->width);
- // QSGGeometry::updateRectGeometry would actually set the
- // corners in the following order:
- // top-left, bottom-left, top-right, bottom-right, leading to a nice criss cross,
- // instead of having a closed loop.
- const gfx::Rect &r(dbquad->rect);
- geometry->vertexDataAsPoint2D()[0].set(r.x(), r.y());
- geometry->vertexDataAsPoint2D()[1].set(r.x() + r.width(), r.y());
- geometry->vertexDataAsPoint2D()[2].set(r.x() + r.width(), r.y() + r.height());
- geometry->vertexDataAsPoint2D()[3].set(r.x(), r.y() + r.height());
-
- QSGFlatColorMaterial *material = new QSGFlatColorMaterial;
- material->setColor(toQt(dbquad->color));
-
- nodeHandler->setupDebugBorderNode(geometry, material, currentLayerChain);
- break;
-#endif
- }
- case viz::DrawQuad::Material::kTiledContent: {
- const viz::TileDrawQuad *tquad = viz::TileDrawQuad::MaterialCast(quad);
- const CompositorResource *resource = findAndHoldResource(tquad->resource_id(), resourceTracker);
- nodeHandler->setupTextureContentNode(
- initAndHoldTexture(resource, quad->ShouldDrawWithBlending(true), apiDelegate),
- toQt(quad->rect), toQt(tquad->tex_coord_rect),
- QSGImageNode::NoTransform, currentLayerChain);
- break;
-#if QT_CONFIG(opengl)
- }
- case viz::DrawQuad::Material::kYuvVideoContent: {
- const viz::YUVVideoDrawQuad *vquad = viz::YUVVideoDrawQuad::MaterialCast(quad);
- const CompositorResource *yResource =
- findAndHoldResource(vquad->y_plane_resource_id(), resourceTracker);
- const CompositorResource *uResource =
- findAndHoldResource(vquad->u_plane_resource_id(), resourceTracker);
- const CompositorResource *vResource =
- findAndHoldResource(vquad->v_plane_resource_id(), resourceTracker);
- const CompositorResource *aResource = nullptr;
- // This currently requires --enable-vp8-alpha-playback and
- // needs a video with alpha data to be triggered.
- if (vquad->a_plane_resource_id())
- aResource = findAndHoldResource(vquad->a_plane_resource_id(), resourceTracker);
-
- nodeHandler->setupYUVVideoNode(
- initAndHoldTexture(yResource, quad->ShouldDrawWithBlending(true)),
- initAndHoldTexture(uResource, quad->ShouldDrawWithBlending(true)),
- initAndHoldTexture(vResource, quad->ShouldDrawWithBlending(true)),
- aResource ? initAndHoldTexture(aResource, quad->ShouldDrawWithBlending(true)) : 0,
- toQt(vquad->ya_tex_coord_rect), toQt(vquad->uv_tex_coord_rect),
- toQt(vquad->ya_tex_size), toQt(vquad->uv_tex_size), vquad->video_color_space,
- vquad->resource_multiplier, vquad->resource_offset, toQt(quad->rect),
- currentLayerChain);
- break;
-#ifdef GL_OES_EGL_image_external
- }
- case viz::DrawQuad::Material::kStreamVideoContent: {
- const viz::StreamVideoDrawQuad *squad = viz::StreamVideoDrawQuad::MaterialCast(quad);
- const CompositorResource *resource = findAndHoldResource(squad->resource_id(), resourceTracker);
- MailboxTexture *texture = static_cast<MailboxTexture *>(
- initAndHoldTexture(resource, quad->ShouldDrawWithBlending(true), apiDelegate, GL_TEXTURE_EXTERNAL_OES));
-
- QMatrix4x4 qMatrix;
-// convertToQt(squad->matrix.matrix(), qMatrix);
- nodeHandler->setupStreamVideoNode(texture, toQt(squad->rect), qMatrix, currentLayerChain);
- break;
-#endif // GL_OES_EGL_image_external
-#endif // QT_CONFIG(opengl)
- }
- case viz::DrawQuad::Material::kSurfaceContent:
- Q_UNREACHABLE();
- default:
- qWarning("Unimplemented quad material: %d", (int)quad->material);
- }
-}
-
-const CompositorResource *DelegatedFrameNode::findAndHoldResource(unsigned resourceId, const CompositorResourceTracker *resourceTracker)
-{
- return resourceTracker->findResource(resourceId);
-}
-
-void DelegatedFrameNode::holdResources(const viz::DrawQuad *quad, const CompositorResourceTracker *resourceTracker)
-{
- for (auto resource : quad->resources)
- findAndHoldResource(resource, resourceTracker);
-}
-
-void DelegatedFrameNode::holdResources(const viz::RenderPass *pass, const CompositorResourceTracker *resourceTracker)
-{
- for (const auto &quad : pass->quad_list)
- holdResources(quad, resourceTracker);
-}
-
-template<class Container, class Key>
-inline auto &findTexture(Container &map, Container &previousMap, const Key &key)
-{
- auto &value = map[key];
- if (value)
- return value;
- value = previousMap[key];
- return value;
-}
-
-QSGTexture *DelegatedFrameNode::initAndHoldTexture(const CompositorResource *resource, bool hasAlphaChannel, RenderWidgetHostViewQtDelegate *apiDelegate, int target)
-{
- QSGTexture::Filtering filtering;
-
- if (resource->filter == GL_NEAREST)
- filtering = QSGTexture::Nearest;
- else if (resource->filter == GL_LINEAR)
- filtering = QSGTexture::Linear;
- else {
- // Depends on qtdeclarative fix, see QTBUG-71322
-#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 1)
- filtering = QSGTexture::Linear;
-#else
- filtering = QSGTexture::Nearest;
-#endif
- }
-
- if (resource->is_software) {
- QSharedPointer<QSGTexture> &texture =
- findTexture(m_sgObjects.bitmapTextures, m_previousSGObjects.bitmapTextures, resource->id);
- if (texture)
- return texture.data();
- texture = createBitmapTexture(resource, hasAlphaChannel, apiDelegate);
- texture->setFiltering(filtering);
- return texture.data();
- } else {
-#if QT_CONFIG(opengl)
- QSharedPointer<MailboxTexture> &texture =
- findTexture(m_sgObjects.mailboxTextures, m_previousSGObjects.mailboxTextures, resource->id);
- if (texture)
- return texture.data();
- texture = createMailboxTexture(resource, hasAlphaChannel, target);
- texture->setFiltering(filtering);
- return texture.data();
-#else
- Q_UNREACHABLE();
- return nullptr;
-#endif
- }
-}
-
-QSharedPointer<QSGTexture> DelegatedFrameNode::createBitmapTexture(const CompositorResource *resource, bool hasAlphaChannel, RenderWidgetHostViewQtDelegate *apiDelegate)
-{
- Q_ASSERT(apiDelegate);
- viz::SharedBitmap *sharedBitmap = resource->bitmap.get();
- gfx::Size size = resource->size;
-
- // QSG interprets QImage::hasAlphaChannel meaning that a node should enable blending
- // to draw it but Chromium keeps this information in the quads.
- // The input format is currently always Format_ARGB32_Premultiplied, so assume that all
- // alpha bytes are 0xff if quads aren't requesting blending and avoid the conversion
- // from Format_ARGB32_Premultiplied to Format_RGB32 just to get hasAlphaChannel to
- // return false.
- QImage::Format format = hasAlphaChannel ? QImage::Format_ARGB32_Premultiplied : QImage::Format_RGB32;
- QImage image = sharedBitmap
- ? QImage(sharedBitmap->pixels(), size.width(), size.height(), format)
- : QImage(size.width(), size.height(), format);
- return QSharedPointer<QSGTexture>(apiDelegate->createTextureFromImage(image.copy()));
-}
-
-QSharedPointer<MailboxTexture> DelegatedFrameNode::createMailboxTexture(const CompositorResource *resource, bool hasAlphaChannel, int target)
-{
-#if QT_CONFIG(opengl)
- return QSharedPointer<MailboxTexture>::create(resource, hasAlphaChannel, target);
-#else
- Q_UNREACHABLE();
-#endif
-}
-
-void DelegatedFrameNode::copyMailboxTextures()
-{
-#if QT_CONFIG(opengl) && defined(USE_OZONE)
- // Workaround when context is not shared QTBUG-48969
- // Make slow copy between two contexts.
- if (!m_contextShared) {
- QOpenGLContext *currentContext = QOpenGLContext::currentContext() ;
- QOpenGLContext *sharedContext = qt_gl_global_share_context();
-
- QSurface *surface = currentContext->surface();
- Q_ASSERT(m_offsurface);
- sharedContext->makeCurrent(m_offsurface.data());
- QOpenGLFunctions *funcs = sharedContext->functions();
-
- GLuint fbo = 0;
- funcs->glGenFramebuffers(1, &fbo);
-
- for (const QSharedPointer<MailboxTexture> &mailboxTexture : qAsConst(m_sgObjects.mailboxTextures)) {
- if (mailboxTexture->m_ownsTexture)
- continue;
-
- // Read texture into QImage from shared context.
- // Switch to shared context.
- sharedContext->makeCurrent(m_offsurface.data());
- funcs = sharedContext->functions();
- QImage img(mailboxTexture->textureSize(), QImage::Format_RGBA8888_Premultiplied);
- funcs->glBindFramebuffer(GL_FRAMEBUFFER, fbo);
- mailboxTexture->m_fence->wait();
- funcs->glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mailboxTexture->m_textureId, 0);
- GLenum status = funcs->glCheckFramebufferStatus(GL_FRAMEBUFFER);
- if (status != GL_FRAMEBUFFER_COMPLETE) {
- qWarning("fbo error, skipping slow copy...");
- continue;
- }
- funcs->glReadPixels(0, 0, mailboxTexture->textureSize().width(), mailboxTexture->textureSize().height(),
- GL_RGBA, GL_UNSIGNED_BYTE, img.bits());
-
- // Restore current context.
- // Create texture from QImage in current context.
- currentContext->makeCurrent(surface);
- GLuint texture = 0;
- funcs = currentContext->functions();
- funcs->glGenTextures(1, &texture);
- funcs->glBindTexture(GL_TEXTURE_2D, texture);
- funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- funcs->glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, mailboxTexture->textureSize().width(), mailboxTexture->textureSize().height(), 0,
- GL_RGBA, GL_UNSIGNED_BYTE, img.bits());
- mailboxTexture->m_textureId = texture;
- mailboxTexture->m_ownsTexture = true;
- }
- // Cleanup allocated resources
- sharedContext->makeCurrent(m_offsurface.data());
- funcs = sharedContext->functions();
- funcs->glBindFramebuffer(GL_FRAMEBUFFER, 0);
- funcs->glDeleteFramebuffers(1, &fbo);
- currentContext->makeCurrent(surface);
- }
-#endif
-}
-
-} // namespace QtWebEngineCore
diff --git a/src/core/compositor/delegated_frame_node.h b/src/core/compositor/delegated_frame_node.h
deleted file mode 100644
index 34e4ba029..000000000
--- a/src/core/compositor/delegated_frame_node.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef DELEGATED_FRAME_NODE_H
-#define DELEGATED_FRAME_NODE_H
-
-#include "base/containers/circular_deque.h"
-#include "components/viz/common/quads/compositor_frame.h"
-#include "components/viz/common/quads/render_pass.h"
-
-#include <QtCore/QSharedPointer>
-#include <QtGui/QOffscreenSurface>
-#include <QtQuick/QSGTransformNode>
-
-#include "chromium_gpu_helper.h"
-#include "render_widget_host_view_qt_delegate.h"
-
-QT_BEGIN_NAMESPACE
-class QSGLayer;
-QT_END_NAMESPACE
-
-namespace gfx {
-class QuadF;
-}
-
-namespace viz {
-class DelegatedFrameData;
-class DrawQuad;
-class DrawPolygon;
-}
-
-namespace QtWebEngineCore {
-
-class CompositorResource;
-class CompositorResourceTracker;
-class DelegatedNodeTreeHandler;
-class MailboxTexture;
-
-class DelegatedFrameNode : public QSGTransformNode {
-public:
- DelegatedFrameNode();
- ~DelegatedFrameNode();
- void preprocess() override;
- void commit(const viz::CompositorFrame &pendingFrame, const viz::CompositorFrame &committedFrame, const CompositorResourceTracker *resourceTracker, RenderWidgetHostViewQtDelegate *apiDelegate);
-
-private:
- void flushPolygons(base::circular_deque<std::unique_ptr<viz::DrawPolygon> > *polygonQueue,
- QSGNode *renderPassChain,
- DelegatedNodeTreeHandler *nodeHandler,
- const CompositorResourceTracker *resourceTracker,
- RenderWidgetHostViewQtDelegate *apiDelegate);
- void handlePolygon(
- const viz::DrawPolygon *polygon,
- QSGNode *currentLayerChain,
- DelegatedNodeTreeHandler *nodeHandler,
- const CompositorResourceTracker *resourceTracker,
- RenderWidgetHostViewQtDelegate *apiDelegate);
- void handleClippedQuad(
- const viz::DrawQuad *quad,
- const gfx::QuadF &clipRegion,
- QSGNode *currentLayerChain,
- DelegatedNodeTreeHandler *nodeHandler,
- const CompositorResourceTracker *resourceTracker,
- RenderWidgetHostViewQtDelegate *apiDelegate);
- void handleQuad(
- const viz::DrawQuad *quad,
- QSGNode *currentLayerChain,
- DelegatedNodeTreeHandler *nodeHandler,
- const CompositorResourceTracker *resourceTracker,
- RenderWidgetHostViewQtDelegate *apiDelegate);
-
- const CompositorResource *findAndHoldResource(unsigned resourceId, const CompositorResourceTracker *resourceTracker);
- void holdResources(const viz::DrawQuad *quad, const CompositorResourceTracker *resourceTracker);
- void holdResources(const viz::RenderPass *pass, const CompositorResourceTracker *resourceTracker);
- QSGTexture *initAndHoldTexture(const CompositorResource *resource, bool hasAlphaChannel, RenderWidgetHostViewQtDelegate *apiDelegate = 0, int target = -1);
- QSharedPointer<QSGTexture> createBitmapTexture(const CompositorResource *resource, bool hasAlphaChannel, RenderWidgetHostViewQtDelegate *apiDelegate);
- QSharedPointer<MailboxTexture> createMailboxTexture(const CompositorResource *resource, bool hasAlphaChannel, int target);
-
- void copyMailboxTextures();
-
- struct SGObjects {
- QVector<QPair<int, QSharedPointer<QSGLayer> > > renderPassLayers;
- QVector<QSharedPointer<QSGRootNode> > renderPassRootNodes;
- QHash<unsigned, QSharedPointer<QSGTexture> > bitmapTextures;
- QHash<unsigned, QSharedPointer<MailboxTexture> > mailboxTextures;
- } m_sgObjects, m_previousSGObjects;
- QVector<QSGNode*> m_sceneGraphNodes;
-#if defined(USE_OZONE)
- bool m_contextShared;
- QScopedPointer<QOffscreenSurface> m_offsurface;
-#endif
- QSize m_previousViewportSize;
-};
-
-} // namespace QtWebEngineCore
-
-#endif // DELEGATED_FRAME_NODE_H
diff --git a/src/core/compositor/display_consumer.h b/src/core/compositor/display_consumer.h
deleted file mode 100644
index d220088ad..000000000
--- a/src/core/compositor/display_consumer.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef DISPLAY_CONSUMER_H
-#define DISPLAY_CONSUMER_H
-
-#include "qtwebenginecoreglobal_p.h"
-
-namespace QtWebEngineCore {
-
-// Receives composited frames for display.
-class DisplayConsumer
-{
-public:
- // Schedule a call to updatePaintNode soon.
- //
- // Called on the consumer thread.
- virtual void scheduleUpdate() = 0;
-
-protected:
- ~DisplayConsumer() {}
-};
-
-} // namespace QtWebEngineCore
-
-#endif // !DISPLAY_CONSUMER_H
diff --git a/src/core/compositor/display_frame_sink.cpp b/src/core/compositor/display_frame_sink.cpp
deleted file mode 100644
index 945600299..000000000
--- a/src/core/compositor/display_frame_sink.cpp
+++ /dev/null
@@ -1,140 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "display_frame_sink.h"
-
-#include <QMap>
-
-namespace QtWebEngineCore {
-
-namespace {
-
-class DisplayFrameSinkMap
-{
-public:
- static DisplayFrameSinkMap *instance()
- {
- static DisplayFrameSinkMap map;
- return &map;
- }
-
- scoped_refptr<DisplayFrameSink> findOrCreate(viz::FrameSinkId frameSinkId)
- {
- QMutexLocker locker(&m_mutex);
- auto it = m_map.find(frameSinkId);
- if (it == m_map.end())
- it = m_map.insert(frameSinkId, new DisplayFrameSink(frameSinkId));
- return *it;
- }
-
- void remove(viz::FrameSinkId frameSinkId)
- {
- QMutexLocker locker(&m_mutex);
- m_map.remove(frameSinkId);
- }
-
-private:
- mutable QMutex m_mutex;
- QMap<viz::FrameSinkId, DisplayFrameSink *> m_map;
-};
-
-} // namespace
-
-// static
-scoped_refptr<DisplayFrameSink> DisplayFrameSink::findOrCreate(viz::FrameSinkId frameSinkId)
-{
- return DisplayFrameSinkMap::instance()->findOrCreate(frameSinkId);
-}
-
-DisplayFrameSink::DisplayFrameSink(viz::FrameSinkId frameSinkId)
- : m_frameSinkId(frameSinkId)
-{
- DCHECK(m_frameSinkId.is_valid());
-}
-
-DisplayFrameSink::~DisplayFrameSink()
-{
- DisplayFrameSinkMap::instance()->remove(m_frameSinkId);
-}
-
-void DisplayFrameSink::connect(DisplayConsumer *consumer)
-{
- QMutexLocker locker(&m_mutex);
- DCHECK(m_consumer == nullptr);
- m_consumer = consumer;
-}
-
-void DisplayFrameSink::connect(DisplayProducer *producer)
-{
- QMutexLocker locker(&m_mutex);
- DCHECK(m_producer == nullptr);
- m_producer = producer;
-}
-
-void DisplayFrameSink::disconnect(DisplayConsumer *consumer)
-{
- QMutexLocker locker(&m_mutex);
- DCHECK(m_consumer == consumer);
- m_consumer = nullptr;
-}
-
-void DisplayFrameSink::disconnect(DisplayProducer *producer)
-{
- QMutexLocker locker(&m_mutex);
- DCHECK(m_producer == producer);
- m_producer = nullptr;
-}
-
-void DisplayFrameSink::scheduleUpdate()
-{
- QMutexLocker locker(&m_mutex);
- if (m_consumer)
- m_consumer->scheduleUpdate();
-}
-
-QSGNode *DisplayFrameSink::updatePaintNode(QSGNode *oldNode, RenderWidgetHostViewQtDelegate *delegate)
-{
- QMutexLocker locker(&m_mutex);
- QSGNode *newNode = oldNode;
- if (m_producer)
- newNode = m_producer->updatePaintNode(oldNode, delegate);
- return newNode;
-}
-
-} // namespace QtWebEngineCore
diff --git a/src/core/compositor/display_frame_sink.h b/src/core/compositor/display_frame_sink.h
deleted file mode 100644
index f620dc4f2..000000000
--- a/src/core/compositor/display_frame_sink.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef DISPLAY_FRAME_SINK_H
-#define DISPLAY_FRAME_SINK_H
-
-#include "display_consumer.h"
-#include "display_producer.h"
-
-#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_refptr.h"
-#include "components/viz/common/surfaces/frame_sink_id.h"
-
-#include <QMutex>
-
-namespace QtWebEngineCore {
-
-// Connects a DisplayConsumer with a DisplayProducer.
-class DisplayFrameSink final : public base::RefCountedThreadSafe<DisplayFrameSink>
-{
-public:
- static scoped_refptr<DisplayFrameSink> findOrCreate(viz::FrameSinkId frameSinkId);
- DisplayFrameSink(viz::FrameSinkId frameSinkId);
- ~DisplayFrameSink();
- void connect(DisplayConsumer *consumer);
- void connect(DisplayProducer *producer);
- void disconnect(DisplayConsumer *consumer);
- void disconnect(DisplayProducer *producer);
- void scheduleUpdate();
- QSGNode *updatePaintNode(QSGNode *oldNode, RenderWidgetHostViewQtDelegate *delegate);
-
-private:
- const viz::FrameSinkId m_frameSinkId;
- mutable QMutex m_mutex;
- DisplayProducer *m_producer = nullptr;
- DisplayConsumer *m_consumer = nullptr;
-};
-
-} // namespace QtWebEngineCore
-
-#endif // !DISPLAY_FRAME_SINK_H
diff --git a/src/core/compositor/display_gl_output_surface.cpp b/src/core/compositor/display_gl_output_surface.cpp
deleted file mode 100644
index ef12cc71b..000000000
--- a/src/core/compositor/display_gl_output_surface.cpp
+++ /dev/null
@@ -1,300 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "display_gl_output_surface.h"
-
-#include "chromium_gpu_helper.h"
-
-#include "base/threading/thread_task_runner_handle.h"
-#include "components/viz/service/display/display.h"
-#include "components/viz/service/display/output_surface_frame.h"
-#include "gpu/command_buffer/client/gles2_implementation.h"
-#include "gpu/command_buffer/client/gles2_interface.h"
-#include "gpu/command_buffer/service/mailbox_manager.h"
-#include "gpu/command_buffer/service/texture_base.h"
-#include "gpu/ipc/in_process_command_buffer.h"
-#include "ui/gl/color_space_utils.h"
-
-namespace QtWebEngineCore {
-
-DisplayGLOutputSurface::DisplayGLOutputSurface(scoped_refptr<viz::VizProcessContextProvider> contextProvider)
- : OutputSurface(contextProvider)
- , m_commandBuffer(contextProvider->command_buffer())
- , m_gl(contextProvider->ContextGL())
- , m_vizContextProvider(contextProvider)
-{
- capabilities_.uses_default_gl_framebuffer = false;
- m_gl->GenFramebuffers(1, &m_fboId);
-}
-
-DisplayGLOutputSurface::~DisplayGLOutputSurface()
-{
- m_vizContextProvider->SetUpdateVSyncParametersCallback(viz::UpdateVSyncParametersCallback());
- m_gl->DeleteFramebuffers(1, &m_fboId);
- if (m_sink)
- m_sink->disconnect(this);
-}
-
-// Called from viz::Display::Initialize.
-void DisplayGLOutputSurface::BindToClient(viz::OutputSurfaceClient *client)
-{
- m_display = static_cast<viz::Display *>(client);
- m_sink = DisplayFrameSink::findOrCreate(m_display->frame_sink_id());
- m_sink->connect(this);
-}
-
-// Triggered by ui::Compositor::SetVisible(true).
-void DisplayGLOutputSurface::EnsureBackbuffer()
-{
-}
-
-// Triggered by ui::Compositor::SetVisible(false). Framebuffer must be cleared.
-void DisplayGLOutputSurface::DiscardBackbuffer()
-{
- NOTIMPLEMENTED();
- // m_gl->DiscardBackbufferCHROMIUM();
-}
-
-// Called from viz::DirectRenderer::DrawFrame before rendering starts, but only
-// if the parameters differ from the previous Reshape call.
-//
-// Parameters:
-//
-// - sizeInPixels comes from ui::Compositor::SetScaleAndSize via
-// viz::HostContextFactoryPrivate::ResizeDisplay.
-//
-// - devicePixelRatio comes from viz::CompositorFrame::device_scale_factor()
-// via viz::RootCompositorFrameSinkImpl::SubmitCompositorFrame and
-// viz::Display::SetLocalSurfaceId.
-//
-// - colorSpace and hasAlpha correspond to the color_space and
-// has_transparent_background properties of the root viz::RenderPass.
-//
-// - useStencil should create a stencil buffer, but this is only needed for
-// overdraw feedback (--show-overdraw-feedback), so it's safe to ignore.
-// Accordingly, capabilities_.supports_stencil should be set to false.
-//
-void DisplayGLOutputSurface::Reshape(const gfx::Size &sizeInPixels,
- float devicePixelRatio,
- const gfx::ColorSpace &colorSpace,
- bool hasAlpha,
- bool /*useStencil*/)
-{
- m_currentShape = Shape{sizeInPixels, devicePixelRatio, colorSpace, hasAlpha};
- m_gl->ResizeCHROMIUM(sizeInPixels.width(), sizeInPixels.height(), devicePixelRatio,
- gl::ColorSpaceUtils::GetGLColorSpace(colorSpace), hasAlpha);
-}
-
-std::unique_ptr<DisplayGLOutputSurface::Buffer> DisplayGLOutputSurface::makeBuffer(const Shape &shape)
-{
- std::unique_ptr<Buffer> buffer = std::make_unique<Buffer>(this);
- buffer->shape = shape;
- m_gl->GenTextures(1, &buffer->clientId);
- m_gl->BindTexture(GL_TEXTURE_2D, buffer->clientId);
- m_gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- m_gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- m_gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- m_gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- uint32_t width = shape.sizeInPixels.width();
- uint32_t height = shape.sizeInPixels.height();
- uint32_t format = shape.hasAlpha ? GL_RGBA : GL_RGB;
- m_gl->TexImage2D(GL_TEXTURE_2D, 0, format, width, height, 0, format, GL_UNSIGNED_BYTE, nullptr);
- return buffer;
-}
-
-void DisplayGLOutputSurface::deleteBufferResources(Buffer *buffer)
-{
- m_gl->DeleteTextures(1, &buffer->clientId);
-}
-
-// Called by viz::GLRenderer during rendering whenever it switches to the root
-// render pass.
-void DisplayGLOutputSurface::BindFramebuffer()
-{
- if (!m_backBuffer || m_backBuffer->shape != m_currentShape)
- m_backBuffer = makeBuffer(m_currentShape);
-
- m_gl->BindFramebuffer(GL_FRAMEBUFFER, m_fboId);
- m_gl->FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, m_backBuffer->clientId, 0);
-}
-
-// Called from viz::Display::DrawAndSwap after rendering.
-//
-// Parameters:
-//
-// - frame.size is the same as the size given to Reshape.
-//
-// - frame.sub_buffer_rect and frame.content_bounds are never used since these
-// are only enabled if gl::GLSurface::SupportsPostSubBuffer() or
-// gl::GLSurface::SupportsSwapBuffersWithBounds() are true, respectively,
-// but this not the case for any offscreen gl::GLSurface.
-//
-// - frame.latency_info is viz::CompositorFrame::metadata.latency_info.
-void DisplayGLOutputSurface::SwapBuffers(viz::OutputSurfaceFrame frame)
-{
- DCHECK(frame.size == m_currentShape.sizeInPixels);
- DCHECK(!frame.sub_buffer_rect.has_value());
- DCHECK(frame.content_bounds.empty());
- DCHECK(m_backBuffer);
-
- m_gl->BindFramebuffer(GL_FRAMEBUFFER, m_fboId);
- m_gl->FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0);
- gpu::SyncToken syncToken;
- m_gl->GenSyncTokenCHROMIUM(syncToken.GetData());
-
- unsigned int clientId = m_backBuffer->clientId;
-
- // Now some thread-hopping:
- //
- // - We start here on the viz thread (client side of command buffer).
- //
- // - Then we'll jump to the gpu thread (service side of command buffer) to
- // get the real OpenGL texture id.
- //
- // - Then we'll get a call from the Qt Quick Scene Graph thread (could be
- // a separate thread or the main thread).
- //
- // - Finally we'll return to the viz thread to acknowledge the swap.
-
- {
- QMutexLocker locker(&m_mutex);
- m_taskRunner = base::ThreadTaskRunnerHandle::Get();
- m_middleBuffer = std::move(m_backBuffer);
- m_middleBuffer->serviceId = 0;
- }
-
- m_commandBuffer->GetTextureQt(
- clientId,
- base::BindOnce(&DisplayGLOutputSurface::swapBuffersOnGpuThread, base::Unretained(this)),
- std::vector<gpu::SyncToken>{syncToken});
-}
-
-void DisplayGLOutputSurface::swapBuffersOnGpuThread(unsigned int id, std::unique_ptr<gl::GLFence> fence)
-{
- {
- QMutexLocker locker(&m_mutex);
- m_middleBuffer->serviceId = id;
- m_middleBuffer->fence = CompositorResourceFence::create(std::move(fence));
- }
-
- m_sink->scheduleUpdate();
-}
-
-void DisplayGLOutputSurface::swapBuffersOnVizThread()
-{
- {
- QMutexLocker locker(&m_mutex);
- m_backBuffer = std::move(m_middleBuffer);
- }
-
- const auto now = base::TimeTicks::Now();
- m_display->DidReceiveSwapBuffersAck(gfx::SwapTimings{now, now});
- m_display->DidReceivePresentationFeedback(
- gfx::PresentationFeedback(now, base::TimeDelta(),
- gfx::PresentationFeedback::Flags::kVSync));
-}
-
-void DisplayGLOutputSurface::SetDrawRectangle(const gfx::Rect &)
-{
-}
-
-// Returning true here will cause viz::GLRenderer to try to render the output
-// surface as an overlay plane (see viz::DirectRenderer::DrawFrame and
-// viz::GLRenderer::ScheduleOverlays).
-bool DisplayGLOutputSurface::IsDisplayedAsOverlayPlane() const
-{
- return false;
-}
-
-// Only used if IsDisplayedAsOverlayPlane was true (called from
-// viz::GLRenderer::ScheduleOverlays).
-unsigned DisplayGLOutputSurface::GetOverlayTextureId() const
-{
- return 0;
-}
-
-// Only used if IsDisplayedAsOverlayPlane was true (called from
-// viz::DirectRender::DrawFrame).
-gfx::BufferFormat DisplayGLOutputSurface::GetOverlayBufferFormat() const
-{
- return gfx::BufferFormat();
-}
-
-// Called by viz::GLRenderer but always false in all implementations except for
-// android_webview::ParentOutputSurface.
-bool DisplayGLOutputSurface::HasExternalStencilTest() const
-{
- return false;
-}
-
-// Only called if HasExternalStencilTest was true. Dead code?
-void DisplayGLOutputSurface::ApplyExternalStencil()
-{
- NOTREACHED();
-}
-
-// Called from GLRenderer::GetFramebufferCopyTextureFormat when using
-// glCopyTexSubImage2D on our framebuffer.
-uint32_t DisplayGLOutputSurface::GetFramebufferCopyTextureFormat()
-{
- return m_currentShape.hasAlpha ? GL_RGBA : GL_RGB;
-}
-
-// Called from viz::DirectRenderer::DrawFrame, only used for overlays.
-unsigned DisplayGLOutputSurface::UpdateGpuFence()
-{
- NOTREACHED();
- return 0;
-}
-
-void DisplayGLOutputSurface::SetUpdateVSyncParametersCallback(viz::UpdateVSyncParametersCallback callback)
-{
- m_vizContextProvider->SetUpdateVSyncParametersCallback(std::move(callback));
-}
-
-void DisplayGLOutputSurface::SetDisplayTransformHint(gfx::OverlayTransform)
-{
-}
-
-gfx::OverlayTransform DisplayGLOutputSurface::GetDisplayTransform()
-{
- return gfx::OVERLAY_TRANSFORM_NONE;
-}
-
-} // namespace QtWebEngineCore
diff --git a/src/core/compositor/display_gl_output_surface.h b/src/core/compositor/display_gl_output_surface.h
deleted file mode 100644
index 67d987263..000000000
--- a/src/core/compositor/display_gl_output_surface.h
+++ /dev/null
@@ -1,149 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef DISPLAY_GL_OUTPUT_SURFACE_H
-#define DISPLAY_GL_OUTPUT_SURFACE_H
-
-#include "compositor_resource_fence.h"
-#include "display_frame_sink.h"
-
-#include "components/viz/common/display/update_vsync_parameters_callback.h"
-#include "components/viz/service/display/output_surface.h"
-#include "components/viz/service/display_embedder/viz_process_context_provider.h"
-#include "gpu/command_buffer/common/mailbox.h"
-#include "gpu/command_buffer/common/sync_token.h"
-
-namespace viz {
-class Display;
-class SyntheticBeginFrameSource;
-} // namespace viz
-
-namespace QtWebEngineCore {
-
-// NOTE: Some methods are defined in display_gl_output_surface_qsg.cpp due
-// to conflicts between Qt & Chromium OpenGL APIs.
-class DisplayGLOutputSurface final : public viz::OutputSurface, public DisplayProducer
-{
-public:
- DisplayGLOutputSurface(scoped_refptr<viz::VizProcessContextProvider> contextProvider);
- ~DisplayGLOutputSurface() override;
-
- // Overridden from viz::OutputSurface.
- void BindToClient(viz::OutputSurfaceClient *client) override;
- void EnsureBackbuffer() override;
- void DiscardBackbuffer() override;
- void BindFramebuffer() override;
- void SetDrawRectangle(const gfx::Rect &drawRect) override;
- bool IsDisplayedAsOverlayPlane() const override;
- unsigned GetOverlayTextureId() const override;
- gfx::BufferFormat GetOverlayBufferFormat() const override;
- void Reshape(const gfx::Size &size,
- float devicePixelRatio,
- const gfx::ColorSpace &colorSpace,
- bool hasAlpha,
- bool useStencil) override;
- bool HasExternalStencilTest() const override;
- void ApplyExternalStencil() override;
- uint32_t GetFramebufferCopyTextureFormat() override;
- void SwapBuffers(viz::OutputSurfaceFrame frame) override;
- unsigned UpdateGpuFence() override;
- void SetUpdateVSyncParametersCallback(viz::UpdateVSyncParametersCallback callback) override;
- void SetDisplayTransformHint(gfx::OverlayTransform transform) override;
- gfx::OverlayTransform GetDisplayTransform() override;
-
- // Overridden from DisplayProducer.
- QSGNode *updatePaintNode(QSGNode *oldNode, RenderWidgetHostViewQtDelegate *delegate) override;
-
-private:
- struct Shape
- {
- gfx::Size sizeInPixels;
- float devicePixelRatio;
- gfx::ColorSpace colorSpace;
- bool hasAlpha;
-
- bool operator==(const Shape &that) const
- {
- return (sizeInPixels == that.sizeInPixels &&
- devicePixelRatio == that.devicePixelRatio &&
- colorSpace == that.colorSpace &&
- hasAlpha == that.hasAlpha);
- }
- bool operator!=(const Shape &that) const { return !(*this == that); }
- };
-
- struct Buffer
- {
- DisplayGLOutputSurface *parent;
- Shape shape;
- uint32_t clientId = 0;
- uint32_t serviceId = 0;
- scoped_refptr<CompositorResourceFence> fence;
-
- Buffer(DisplayGLOutputSurface *parent) : parent(parent) {}
- ~Buffer() { parent->deleteBufferResources(this); }
- };
-
- class Texture;
-
- void swapBuffersOnGpuThread(unsigned int id, std::unique_ptr<gl::GLFence> fence);
- void swapBuffersOnVizThread();
-
- std::unique_ptr<Buffer> makeBuffer(const Shape &shape);
- void deleteBufferResources(Buffer *buffer);
- void attachBuffer();
- void detachBuffer();
-
- gpu::InProcessCommandBuffer *const m_commandBuffer;
- gpu::gles2::GLES2Interface *const m_gl;
- mutable QMutex m_mutex;
- uint32_t m_fboId = 0;
- viz::Display *m_display = nullptr;
- scoped_refptr<DisplayFrameSink> m_sink;
- Shape m_currentShape;
- std::unique_ptr<Buffer> m_backBuffer;
- std::unique_ptr<Buffer> m_middleBuffer;
- std::unique_ptr<Buffer> m_frontBuffer;
- scoped_refptr<base::SingleThreadTaskRunner> m_taskRunner;
- scoped_refptr<viz::VizProcessContextProvider> m_vizContextProvider;
-};
-
-} // namespace QtWebEngineCore
-
-#endif // !DISPLAY_GL_OUTPUT_SURFACE_H
diff --git a/src/core/compositor/display_gl_output_surface_qsg.cpp b/src/core/compositor/display_gl_output_surface_qsg.cpp
deleted file mode 100644
index 2f7b3de84..000000000
--- a/src/core/compositor/display_gl_output_surface_qsg.cpp
+++ /dev/null
@@ -1,121 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "display_gl_output_surface.h"
-
-#include "compositor_resource_fence.h"
-#include "render_widget_host_view_qt_delegate.h"
-#include "type_conversion.h"
-
-#include <QOpenGLFunctions>
-#include <QSGImageNode>
-#include <QSGTexture>
-
-namespace QtWebEngineCore {
-
-class DisplayGLOutputSurface::Texture final : public QSGTexture
-{
-public:
- Texture(uint32_t id, QSize sizeInPixels, bool hasAlphaChannel, scoped_refptr<CompositorResourceFence> fence)
- : m_id(id)
- , m_sizeInPixels(sizeInPixels)
- , m_hasAlphaChannel(hasAlphaChannel)
- , m_fence(std::move(fence))
- {
- }
-
- // QSGTexture:
- int textureId() const override { return m_id; }
- QSize textureSize() const override { return m_sizeInPixels; }
- bool hasAlphaChannel() const override { return m_hasAlphaChannel; }
- bool hasMipmaps() const override { return false; }
- void bind() override
- {
- if (m_fence) {
- m_fence->wait();
- m_fence.reset();
- }
-
- QOpenGLContext *context = QOpenGLContext::currentContext();
- QOpenGLFunctions *funcs = context->functions();
- funcs->glBindTexture(GL_TEXTURE_2D, m_id);
- }
-
-private:
- uint32_t m_id;
- QSize m_sizeInPixels;
- bool m_hasAlphaChannel;
- scoped_refptr<CompositorResourceFence> m_fence;
-};
-
-QSGNode *DisplayGLOutputSurface::updatePaintNode(QSGNode *oldNode, RenderWidgetHostViewQtDelegate *delegate)
-{
- {
- QMutexLocker locker(&m_mutex);
- if (m_middleBuffer && m_middleBuffer->serviceId) {
- std::swap(m_middleBuffer, m_frontBuffer);
- m_taskRunner->PostTask(
- FROM_HERE,
- base::BindOnce(&DisplayGLOutputSurface::swapBuffersOnVizThread, base::Unretained(this)));
- m_taskRunner.reset();
- }
- }
-
- if (!m_frontBuffer)
- return oldNode;
-
- auto node = static_cast<QSGImageNode *>(oldNode);
- if (!node)
- node = delegate->createImageNode();
-
- QSize sizeInPixels = toQt(m_frontBuffer->shape.sizeInPixels);
- QSizeF sizeInDips = QSizeF(sizeInPixels) / m_frontBuffer->shape.devicePixelRatio;
- QRectF rectInDips(QPointF(0, 0), sizeInDips);
- node->setRect(rectInDips);
- node->setOwnsTexture(true);
- node->setTexture(new Texture(m_frontBuffer->serviceId,
- sizeInPixels,
- m_frontBuffer->shape.hasAlpha,
- m_frontBuffer->fence));
- node->setTextureCoordinatesTransform(QSGImageNode::MirrorVertically);
-
- return node;
-}
-
-} // namespace QtWebEngineCore
diff --git a/src/core/compositor/display_overrides.cpp b/src/core/compositor/display_overrides.cpp
index 89bf8ad2f..ebaa96dbb 100644
--- a/src/core/compositor/display_overrides.cpp
+++ b/src/core/compositor/display_overrides.cpp
@@ -1,85 +1,100 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "display_gl_output_surface.h"
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "display_skia_output_device.h"
#include "display_software_output_surface.h"
+#include "native_skia_output_device.h"
#include "components/viz/service/display_embedder/output_surface_provider_impl.h"
+#include "components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.h"
#include "gpu/ipc/in_process_command_buffer.h"
+
#include <qtgui-config.h>
+#include <QtQuick/qquickwindow.h>
-std::unique_ptr<viz::OutputSurface>
-viz::OutputSurfaceProviderImpl::CreateGLOutputSurface(
- scoped_refptr<VizProcessContextProvider> context_provider)
-{
#if QT_CONFIG(opengl)
- return std::make_unique<QtWebEngineCore::DisplayGLOutputSurface>(std::move(context_provider));
-#else
- return nullptr;
-#endif // QT_CONFIG(opengl)
-}
+#include "native_skia_output_device_opengl.h"
+#endif
+
+#if BUILDFLAG(ENABLE_VULKAN)
+#include "native_skia_output_device_vulkan.h"
+#endif
+
+#if defined(Q_OS_WIN)
+#include "native_skia_output_device_direct3d11.h"
+#endif
+
+#if defined(Q_OS_MACOS)
+#include "native_skia_output_device_metal.h"
+#endif
std::unique_ptr<viz::OutputSurface>
-viz::OutputSurfaceProviderImpl::CreateSoftwareOutputSurface()
+viz::OutputSurfaceProviderImpl::CreateSoftwareOutputSurface(const RendererSettings &renderer_settings)
{
- return std::make_unique<QtWebEngineCore::DisplaySoftwareOutputSurface>();
+ return std::make_unique<QtWebEngineCore::DisplaySoftwareOutputSurface>(renderer_settings.requires_alpha_channel);
}
-void gpu::InProcessCommandBuffer::GetTextureQt(
- unsigned int client_id,
- GetTextureCallback callback,
- const std::vector<SyncToken>& sync_token_fences)
+std::unique_ptr<viz::SkiaOutputDevice>
+viz::SkiaOutputSurfaceImplOnGpu::CreateOutputDevice()
{
- ScheduleGpuTask(base::BindOnce(&InProcessCommandBuffer::GetTextureQtOnGpuThread,
- gpu_thread_weak_ptr_factory_.GetWeakPtr(),
- client_id,
- std::move(callback)),
- sync_token_fences);
-}
+ static const auto graphicsApi = QQuickWindow::graphicsApi();
-void gpu::InProcessCommandBuffer::GetTextureQtOnGpuThread(
- unsigned int client_id, GetTextureCallback callback)
-{
- if (!MakeCurrent()) {
- LOG(ERROR) << "MakeCurrent failed for GetTextureQt";
- return;
+#if QT_CONFIG(opengl)
+ if (graphicsApi == QSGRendererInterface::OpenGL) {
+ if (gl::GetGLImplementation() != gl::kGLImplementationEGLANGLE) {
+#if !defined(Q_OS_MACOS)
+ return std::make_unique<QtWebEngineCore::DisplaySkiaOutputDevice>(
+ context_state_, renderer_settings_.requires_alpha_channel,
+ shared_gpu_deps_->memory_tracker(), GetDidSwapBuffersCompleteCallback());
+#else
+ qFatal("macOS only supports ANGLE.");
+#endif // !defined(Q_OS_MACOS)
+ }
+
+ return std::make_unique<QtWebEngineCore::NativeSkiaOutputDeviceOpenGL>(
+ context_state_, renderer_settings_.requires_alpha_channel,
+ shared_gpu_deps_->memory_tracker(), dependency_.get(), shared_image_factory_.get(),
+ shared_image_representation_factory_.get(), GetDidSwapBuffersCompleteCallback());
+ }
+#endif // QT_CONFIG(opengl)
+
+#if BUILDFLAG(ENABLE_VULKAN)
+ if (graphicsApi == QSGRendererInterface::Vulkan) {
+#if !defined(Q_OS_MACOS)
+ return std::make_unique<QtWebEngineCore::NativeSkiaOutputDeviceVulkan>(
+ context_state_, renderer_settings_.requires_alpha_channel,
+ shared_gpu_deps_->memory_tracker(), dependency_.get(), shared_image_factory_.get(),
+ shared_image_representation_factory_.get(), GetDidSwapBuffersCompleteCallback());
+#else
+ qFatal("Vulkan is not supported on macOS.");
+#endif // !defined(Q_OS_MACOS)
+ }
+#endif // BUILDFLAG(ENABLE_VULKAN)
+
+#if defined(Q_OS_WIN)
+ if (graphicsApi == QSGRendererInterface::Direct3D11) {
+ if (gl::GetGLImplementation() != gl::kGLImplementationEGLANGLE)
+ qFatal("Direct3D11 is only supported over ANGLE.");
+
+ return std::make_unique<QtWebEngineCore::NativeSkiaOutputDeviceDirect3D11>(
+ context_state_, renderer_settings_.requires_alpha_channel,
+ shared_gpu_deps_->memory_tracker(), dependency_.get(), shared_image_factory_.get(),
+ shared_image_representation_factory_.get(), GetDidSwapBuffersCompleteCallback());
}
- gpu::TextureBase *texture = decoder_->GetTextureBase(client_id);
- std::move(callback).Run(texture ? texture->service_id() : 0, gl::GLFence::Create());
+#endif
+
+#if defined(Q_OS_MACOS)
+ if (graphicsApi == QSGRendererInterface::Metal) {
+ if (gl::GetGLImplementation() != gl::kGLImplementationEGLANGLE)
+ qFatal("Metal is only supported over ANGLE.");
+
+ return std::make_unique<QtWebEngineCore::NativeSkiaOutputDeviceMetal>(
+ context_state_, renderer_settings_.requires_alpha_channel,
+ shared_gpu_deps_->memory_tracker(), dependency_.get(), shared_image_factory_.get(),
+ shared_image_representation_factory_.get(), GetDidSwapBuffersCompleteCallback());
+ }
+#endif
+
+ qFatal() << "Unsupported Graphics API:" << graphicsApi;
+ return nullptr;
}
diff --git a/src/core/compositor/display_producer.h b/src/core/compositor/display_producer.h
deleted file mode 100644
index 5de09d2d2..000000000
--- a/src/core/compositor/display_producer.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef DISPLAY_PRODUCER_H
-#define DISPLAY_PRODUCER_H
-
-#include "qtwebenginecoreglobal_p.h"
-
-QT_BEGIN_NAMESPACE
-class QSGNode;
-QT_END_NAMESPACE
-
-namespace QtWebEngineCore {
-class RenderWidgetHostViewQtDelegate;
-
-// Produces composited frames for display.
-class DisplayProducer
-{
-public:
- // Generate scene graph nodes for the current frame.
- //
- // If this is a scheduled update (that is, scheduleUpdate was called
- // earlier), then updatePaintNode will generate nodes for a new frame.
- // Otherwise, it will just regenerate nodes for the old frame.
- virtual QSGNode *updatePaintNode(QSGNode *oldNode, RenderWidgetHostViewQtDelegate *delegate) = 0;
-
-protected:
- ~DisplayProducer() {}
-};
-
-} // namespace QtWebEngineCore
-
-#endif // !DISPLAY_PRODUCER_H
diff --git a/src/core/compositor/display_skia_output_device.cpp b/src/core/compositor/display_skia_output_device.cpp
new file mode 100644
index 000000000..0ca466fe8
--- /dev/null
+++ b/src/core/compositor/display_skia_output_device.cpp
@@ -0,0 +1,240 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "display_skia_output_device.h"
+
+#include "compositor_resource_fence.h"
+#include "type_conversion.h"
+
+#include "gpu/command_buffer/service/skia_utils.h"
+#include "third_party/skia/include/core/SkSurface.h"
+#include "third_party/skia/include/core/SkSurfaceProps.h"
+#include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h"
+#include "third_party/skia/include/gpu/ganesh/gl/GrGLBackendSurface.h"
+
+#include <QSGTexture>
+
+namespace QtWebEngineCore {
+
+class DisplaySkiaOutputDevice::Buffer
+{
+public:
+ Buffer(DisplaySkiaOutputDevice *parent)
+ : m_parent(parent)
+ , m_shape(m_parent->m_shape)
+ {
+ }
+ void initialize()
+ {
+ const auto &colorType = m_shape.imageInfo.colorType();
+ DCHECK(colorType != kUnknown_SkColorType);
+
+ m_texture = m_parent->m_contextState->gr_context()->createBackendTexture(
+ m_shape.imageInfo.width(), m_shape.imageInfo.height(), colorType,
+ GrMipMapped::kNo, GrRenderable::kYes);
+ DCHECK(m_texture.isValid());
+
+ DCHECK(m_texture.backend() == GrBackendApi::kOpenGL);
+ auto info = SkImageInfo::Make(m_shape.imageInfo.width(), m_shape.imageInfo.height(),
+ colorType, kUnpremul_SkAlphaType);
+ m_estimatedSize = info.computeMinByteSize();
+ m_parent->memory_type_tracker_->TrackMemAlloc(m_estimatedSize);
+
+ SkSurfaceProps surfaceProps = SkSurfaceProps{0, kUnknown_SkPixelGeometry};
+ m_surface = SkSurfaces::WrapBackendTexture(
+ m_parent->m_contextState->gr_context(), m_texture,
+ m_parent->capabilities_.output_surface_origin == gfx::SurfaceOrigin::kTopLeft
+ ? kTopLeft_GrSurfaceOrigin
+ : kBottomLeft_GrSurfaceOrigin,
+ 0 /* sampleCount */, colorType, m_shape.colorSpace.ToSkColorSpace(),
+ &surfaceProps);
+ }
+
+ ~Buffer()
+ {
+ if (m_texture.isValid()) {
+ DeleteGrBackendTexture(m_parent->m_contextState.get(), &m_texture);
+ m_parent->memory_type_tracker_->TrackMemFree(m_estimatedSize);
+ }
+ }
+
+ void createFence()
+ {
+ m_fence = CompositorResourceFence::create();
+ }
+
+ void consumeFence()
+ {
+ if (m_fence) {
+ m_fence->wait();
+ m_fence.reset();
+ }
+ }
+
+ const Shape &shape() const { return m_shape; }
+ const GrBackendTexture &texture() const { return m_texture; }
+ SkSurface *surface() const { return m_surface.get(); }
+
+private:
+ DisplaySkiaOutputDevice *m_parent;
+ Shape m_shape;
+ GrBackendTexture m_texture;
+ sk_sp<SkSurface> m_surface;
+ uint64_t m_estimatedSize = 0;
+ scoped_refptr<CompositorResourceFence> m_fence;
+};
+
+DisplaySkiaOutputDevice::DisplaySkiaOutputDevice(
+ scoped_refptr<gpu::SharedContextState> contextState,
+ bool requiresAlpha,
+ gpu::MemoryTracker *memoryTracker,
+ DidSwapBufferCompleteCallback didSwapBufferCompleteCallback)
+ : SkiaOutputDevice(contextState->gr_context(), contextState->graphite_context(),
+ memoryTracker, didSwapBufferCompleteCallback)
+ , Compositor(Compositor::Type::OpenGL)
+ , m_contextState(contextState)
+ , m_requiresAlpha(requiresAlpha)
+{
+ capabilities_.uses_default_gl_framebuffer = false;
+ capabilities_.supports_surfaceless = true;
+ capabilities_.preserve_buffer_content = true;
+ capabilities_.only_invalidates_damage_rect = false;
+ capabilities_.number_of_buffers = 3;
+
+ capabilities_.sk_color_types[static_cast<int>(gfx::BufferFormat::RGBA_8888)] =
+ kRGBA_8888_SkColorType;
+ capabilities_.sk_color_types[static_cast<int>(gfx::BufferFormat::RGBX_8888)] =
+ kRGBA_8888_SkColorType;
+ capabilities_.sk_color_types[static_cast<int>(gfx::BufferFormat::BGRA_8888)] =
+ kRGBA_8888_SkColorType;
+ capabilities_.sk_color_types[static_cast<int>(gfx::BufferFormat::BGRX_8888)] =
+ kRGBA_8888_SkColorType;
+}
+
+DisplaySkiaOutputDevice::~DisplaySkiaOutputDevice()
+{
+}
+
+void DisplaySkiaOutputDevice::SetFrameSinkId(const viz::FrameSinkId &id)
+{
+ bind(id);
+}
+bool DisplaySkiaOutputDevice::Reshape(const SkImageInfo &image_info,
+ const gfx::ColorSpace &colorSpace,
+ int sample_count,
+ float device_scale_factor,
+ gfx::OverlayTransform transform)
+{
+ m_shape = Shape{image_info, device_scale_factor, colorSpace};
+ DCHECK_EQ(transform, gfx::OVERLAY_TRANSFORM_NONE);
+ return true;
+}
+
+void DisplaySkiaOutputDevice::Present(const absl::optional<gfx::Rect> &update_rect,
+ BufferPresentedCallback feedback,
+ viz::OutputSurfaceFrame frame)
+{
+ DCHECK(m_backBuffer);
+
+ StartSwapBuffers(std::move(feedback));
+ m_frame = std::move(frame);
+ m_backBuffer->createFence();
+
+ {
+ QMutexLocker locker(&m_mutex);
+ m_taskRunner = base::SingleThreadTaskRunner::GetCurrentDefault();
+ std::swap(m_middleBuffer, m_backBuffer);
+ m_readyToUpdate = true;
+ }
+
+ if (auto obs = observer())
+ obs->readyToSwap();
+}
+
+void DisplaySkiaOutputDevice::EnsureBackbuffer()
+{
+}
+
+void DisplaySkiaOutputDevice::DiscardBackbuffer()
+{
+}
+
+SkSurface *DisplaySkiaOutputDevice::BeginPaint(std::vector<GrBackendSemaphore> *end_semaphores)
+{
+ if (!m_backBuffer || m_backBuffer->shape() != m_shape) {
+ m_backBuffer = std::make_unique<Buffer>(this);
+ m_backBuffer->initialize();
+ }
+ return m_backBuffer->surface();
+}
+
+void DisplaySkiaOutputDevice::EndPaint()
+{
+}
+
+void DisplaySkiaOutputDevice::swapFrame()
+{
+ QMutexLocker locker(&m_mutex);
+ if (m_readyToUpdate) {
+ std::swap(m_middleBuffer, m_frontBuffer);
+ m_taskRunner->PostTask(FROM_HERE,
+ base::BindOnce(&DisplaySkiaOutputDevice::SwapBuffersFinished,
+ base::Unretained(this)));
+ m_taskRunner.reset();
+ m_readyToUpdate = false;
+ }
+}
+
+void DisplaySkiaOutputDevice::waitForTexture()
+{
+ if (m_frontBuffer)
+ m_frontBuffer->consumeFence();
+}
+
+QSGTexture *DisplaySkiaOutputDevice::texture(QQuickWindow *win, uint32_t textureOptions)
+{
+ if (!m_frontBuffer)
+ return nullptr;
+
+ QQuickWindow::CreateTextureOptions texOpts(textureOptions);
+
+ QSGTexture *texture = nullptr;
+ GrGLTextureInfo info;
+ if (GrBackendTextures::GetGLTextureInfo(m_frontBuffer->texture(), &info))
+ texture = QNativeInterface::QSGOpenGLTexture::fromNative(info.fID, win, size(), texOpts);
+ return texture;
+}
+
+bool DisplaySkiaOutputDevice::textureIsFlipped()
+{
+ return true;
+}
+
+QSize DisplaySkiaOutputDevice::size()
+{
+ return m_frontBuffer ? toQt(m_frontBuffer->shape().imageInfo.dimensions()) : QSize();
+}
+
+bool DisplaySkiaOutputDevice::requiresAlphaChannel()
+{
+ return m_requiresAlpha;
+}
+
+float DisplaySkiaOutputDevice::devicePixelRatio()
+{
+ return m_frontBuffer ? m_frontBuffer->shape().devicePixelRatio : 1;
+}
+
+void DisplaySkiaOutputDevice::SwapBuffersFinished()
+{
+ {
+ QMutexLocker locker(&m_mutex);
+ std::swap(m_backBuffer, m_middleBuffer);
+ }
+
+ FinishSwapBuffers(gfx::SwapCompletionResult(gfx::SwapResult::SWAP_ACK),
+ gfx::Size(m_shape.imageInfo.width(), m_shape.imageInfo.height()),
+ std::move(m_frame));
+}
+
+} // namespace QtWebEngineCore
diff --git a/src/core/compositor/display_skia_output_device.h b/src/core/compositor/display_skia_output_device.h
new file mode 100644
index 000000000..e6a97b810
--- /dev/null
+++ b/src/core/compositor/display_skia_output_device.h
@@ -0,0 +1,89 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef DISPLAY_SKIA_OUTPUT_DEVICE_H
+#define DISPLAY_SKIA_OUTPUT_DEVICE_H
+
+#include <QtCore/QMutex>
+#include <QtWebEngineCore/private/qtwebenginecoreglobal_p.h>
+
+#include "compositor.h"
+
+#include "base/task/single_thread_task_runner.h"
+#include "components/viz/service/display_embedder/skia_output_device.h"
+#include "gpu/command_buffer/service/shared_context_state.h"
+
+QT_BEGIN_NAMESPACE
+class QQuickWindow;
+QT_END_NAMESPACE
+
+namespace QtWebEngineCore {
+
+class DisplaySkiaOutputDevice final : public viz::SkiaOutputDevice, public Compositor
+{
+public:
+ DisplaySkiaOutputDevice(scoped_refptr<gpu::SharedContextState> contextState,
+ bool requiresAlpha,
+ gpu::MemoryTracker *memoryTracker,
+ DidSwapBufferCompleteCallback didSwapBufferCompleteCallback);
+ ~DisplaySkiaOutputDevice() override;
+
+ // Overridden from SkiaOutputDevice.
+ void SetFrameSinkId(const viz::FrameSinkId &frame_sink_id) override;
+ bool Reshape(const SkImageInfo &image_info,
+ const gfx::ColorSpace &color_space,
+ int sample_count,
+ float device_scale_factor,
+ gfx::OverlayTransform transform) override;
+ void Present(const absl::optional<gfx::Rect>& update_rect,
+ BufferPresentedCallback feedback,
+ viz::OutputSurfaceFrame frame) override;
+ void EnsureBackbuffer() override;
+ void DiscardBackbuffer() override;
+ SkSurface *BeginPaint(std::vector<GrBackendSemaphore> *semaphores) override;
+ void EndPaint() override;
+
+ // Overridden from Compositor.
+ void swapFrame() override;
+ void waitForTexture() override;
+ QSGTexture *texture(QQuickWindow *win, uint32_t texOpts) override;
+ bool textureIsFlipped() override;
+ QSize size() override;
+ bool requiresAlphaChannel() override;
+ float devicePixelRatio() override;
+
+private:
+ struct Shape
+ {
+ SkImageInfo imageInfo;
+ float devicePixelRatio;
+ gfx::ColorSpace colorSpace;
+
+ bool operator==(const Shape &that) const
+ {
+ return (imageInfo == that.imageInfo &&
+ devicePixelRatio == that.devicePixelRatio &&
+ colorSpace == that.colorSpace);
+ }
+ bool operator!=(const Shape &that) const { return !(*this == that); }
+ };
+
+ class Buffer;
+
+ void SwapBuffersFinished();
+
+ mutable QMutex m_mutex;
+ scoped_refptr<gpu::SharedContextState> m_contextState;
+ Shape m_shape;
+ std::unique_ptr<Buffer> m_frontBuffer;
+ std::unique_ptr<Buffer> m_middleBuffer;
+ std::unique_ptr<Buffer> m_backBuffer;
+ viz::OutputSurfaceFrame m_frame;
+ bool m_readyToUpdate = false;
+ bool m_requiresAlpha;
+ scoped_refptr<base::SingleThreadTaskRunner> m_taskRunner;
+};
+
+} // namespace QtWebEngineCore
+
+#endif // !DISPLAY_SKIA_OUTPUT_DEVICE_H
diff --git a/src/core/compositor/display_software_output_surface.cpp b/src/core/compositor/display_software_output_surface.cpp
index ba99799f0..2c208ca57 100644
--- a/src/core/compositor/display_software_output_surface.cpp
+++ b/src/core/compositor/display_software_output_surface.cpp
@@ -1,93 +1,53 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "display_software_output_surface.h"
-#include "display_frame_sink.h"
-#include "render_widget_host_view_qt_delegate.h"
+#include "compositor.h"
#include "type_conversion.h"
-#include "base/threading/thread_task_runner_handle.h"
+#include "base/task/single_thread_task_runner.h"
#include "components/viz/service/display/display.h"
#include "components/viz/service/display/output_surface_frame.h"
#include <QMutex>
#include <QPainter>
-#include <QSGImageNode>
+#include <QQuickWindow>
namespace QtWebEngineCore {
-class DisplaySoftwareOutputSurface::Device final : public viz::SoftwareOutputDevice, public DisplayProducer
+class DisplaySoftwareOutputSurface::Device final : public viz::SoftwareOutputDevice,
+ public Compositor
{
public:
- ~Device();
-
- // Called from DisplaySoftwareOutputSurface.
- void bind(viz::FrameSinkId frameSinkId);
+ Device(bool requiresAlpha);
// Overridden from viz::SoftwareOutputDevice.
void Resize(const gfx::Size &sizeInPixels, float devicePixelRatio) override;
- void OnSwapBuffers(SwapBuffersCallback swap_ack_callback) override;
+ void OnSwapBuffers(SwapBuffersCallback swap_ack_callback, gfx::FrameData data) override;
- // Overridden from DisplayProducer.
- QSGNode *updatePaintNode(QSGNode *oldNode, RenderWidgetHostViewQtDelegate *delegate) override;
+ // Overridden from Compositor.
+ void swapFrame() override;
+ QSGTexture *texture(QQuickWindow *win, uint32_t) override;
+ bool textureIsFlipped() override;
+ float devicePixelRatio() override;
+ QSize size() override;
+ bool requiresAlphaChannel() override;
private:
mutable QMutex m_mutex;
- scoped_refptr<DisplayFrameSink> m_sink;
float m_devicePixelRatio = 1.0;
+ bool m_requiresAlpha;
scoped_refptr<base::SingleThreadTaskRunner> m_taskRunner;
SwapBuffersCallback m_swapCompletionCallback;
QImage m_image;
float m_imageDevicePixelRatio = 1.0;
};
-DisplaySoftwareOutputSurface::Device::~Device()
-{
- if (m_sink)
- m_sink->disconnect(this);
-}
-
-void DisplaySoftwareOutputSurface::Device::bind(viz::FrameSinkId frameSinkId)
+DisplaySoftwareOutputSurface::Device::Device(bool requiresAlpha)
+ : Compositor(Type::Software)
+ , m_requiresAlpha(requiresAlpha)
{
- m_sink = DisplayFrameSink::findOrCreate(frameSinkId);
- m_sink->connect(this);
}
void DisplaySoftwareOutputSurface::Device::Resize(const gfx::Size &sizeInPixels, float devicePixelRatio)
@@ -96,15 +56,19 @@ void DisplaySoftwareOutputSurface::Device::Resize(const gfx::Size &sizeInPixels,
return;
m_devicePixelRatio = devicePixelRatio;
viewport_pixel_size_ = sizeInPixels;
- surface_ = SkSurface::MakeRaster(SkImageInfo::MakeN32Premul(sizeInPixels.width(), sizeInPixels.height()));
+ surface_ = SkSurfaces::Raster(SkImageInfo::MakeN32Premul(sizeInPixels.width(), sizeInPixels.height()));
}
-void DisplaySoftwareOutputSurface::Device::OnSwapBuffers(SwapBuffersCallback swap_ack_callback)
+void DisplaySoftwareOutputSurface::Device::OnSwapBuffers(SwapBuffersCallback swap_ack_callback, gfx::FrameData data)
{
- QMutexLocker locker(&m_mutex);
- m_taskRunner = base::ThreadTaskRunnerHandle::Get();
- m_swapCompletionCallback = std::move(swap_ack_callback);
- m_sink->scheduleUpdate();
+ { // MEMO don't hold a lock together with an 'observer', as the call from Qt's scene graph may come at the same time
+ QMutexLocker locker(&m_mutex);
+ m_taskRunner = base::SingleThreadTaskRunner::GetCurrentDefault();
+ m_swapCompletionCallback = std::move(swap_ack_callback);
+ }
+
+ if (auto obs = observer())
+ obs->readyToSwap();
}
inline QImage::Format imageFormat(SkColorType colorType)
@@ -120,56 +84,68 @@ inline QImage::Format imageFormat(SkColorType colorType)
}
}
-QSGNode *DisplaySoftwareOutputSurface::Device::updatePaintNode(
- QSGNode *oldNode, RenderWidgetHostViewQtDelegate *delegate)
+void DisplaySoftwareOutputSurface::Device::swapFrame()
{
QMutexLocker locker(&m_mutex);
- // Delete old node to make sure refcount of m_image is at most 1.
- delete oldNode;
- QSGImageNode *node = delegate->createImageNode();
-
- if (m_swapCompletionCallback) {
- SkPixmap skPixmap;
- surface_->peekPixels(&skPixmap);
- QImage image(reinterpret_cast<const uchar *>(skPixmap.addr()),
- viewport_pixel_size_.width(), viewport_pixel_size_.height(),
- skPixmap.rowBytes(), imageFormat(skPixmap.colorType()));
- if (m_image.size() == image.size()) {
- QRect damageRect = toQt(damage_rect_);
- QPainter painter(&m_image);
- painter.setCompositionMode(QPainter::CompositionMode_Source);
- painter.drawImage(damageRect, image, damageRect);
- } else {
- m_image = image;
- m_image.detach();
- }
- m_imageDevicePixelRatio = m_devicePixelRatio;
- m_taskRunner->PostTask(FROM_HERE, base::BindOnce(std::move(m_swapCompletionCallback), toGfx(m_image.size())));
- m_taskRunner.reset();
+ if (!m_swapCompletionCallback)
+ return;
+
+ SkPixmap skPixmap;
+ surface_->peekPixels(&skPixmap);
+ QImage image(reinterpret_cast<const uchar *>(skPixmap.addr()), viewport_pixel_size_.width(),
+ viewport_pixel_size_.height(), skPixmap.rowBytes(),
+ imageFormat(skPixmap.colorType()));
+ if (m_image.size() == image.size()) {
+ QRect damageRect = toQt(damage_rect_);
+ QPainter painter(&m_image);
+ painter.setCompositionMode(QPainter::CompositionMode_Source);
+ painter.drawImage(damageRect, image, damageRect);
+ } else {
+ m_image = image;
+ m_image.detach();
}
+ m_imageDevicePixelRatio = m_devicePixelRatio;
+ m_taskRunner->PostTask(
+ FROM_HERE, base::BindOnce(std::move(m_swapCompletionCallback), toGfx(m_image.size())));
+ m_taskRunner.reset();
+}
+
+QSGTexture *DisplaySoftwareOutputSurface::Device::texture(QQuickWindow *win, uint32_t)
+{
+ return win->createTextureFromImage(m_image);
+}
- QSizeF sizeInDips = QSizeF(m_image.size()) / m_imageDevicePixelRatio;
- node->setRect(QRectF(QPointF(0, 0), sizeInDips));
- node->setOwnsTexture(true);
- node->setTexture(delegate->createTextureFromImage(m_image));
+bool DisplaySoftwareOutputSurface::Device::textureIsFlipped()
+{
+ return false;
+}
- return node;
+float DisplaySoftwareOutputSurface::Device::devicePixelRatio()
+{
+ return m_imageDevicePixelRatio;
+}
+
+QSize DisplaySoftwareOutputSurface::Device::size()
+{
+ return m_image.size();
+}
+
+bool DisplaySoftwareOutputSurface::Device::requiresAlphaChannel()
+{
+ return m_requiresAlpha;
}
-DisplaySoftwareOutputSurface::DisplaySoftwareOutputSurface()
- : SoftwareOutputSurface(std::make_unique<Device>())
+DisplaySoftwareOutputSurface::DisplaySoftwareOutputSurface(bool requiresAlpha)
+ : SoftwareOutputSurface(std::make_unique<Device>(requiresAlpha))
{}
DisplaySoftwareOutputSurface::~DisplaySoftwareOutputSurface() {}
// Called from viz::Display::Initialize.
-void DisplaySoftwareOutputSurface::BindToClient(viz::OutputSurfaceClient *client)
+void DisplaySoftwareOutputSurface::SetFrameSinkId(const viz::FrameSinkId &id)
{
- auto display = static_cast<viz::Display *>(client);
- auto device = static_cast<Device *>(software_device());
- device->bind(display->frame_sink_id());
- SoftwareOutputSurface::BindToClient(client);
+ static_cast<Device *>(software_device())->bind(id);
}
} // namespace QtWebEngineCore
diff --git a/src/core/compositor/display_software_output_surface.h b/src/core/compositor/display_software_output_surface.h
index ae4b277dd..d23664d56 100644
--- a/src/core/compositor/display_software_output_surface.h
+++ b/src/core/compositor/display_software_output_surface.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef DISPLAY_SOFTWARE_OUTPUT_SURFACE_H
#define DISPLAY_SOFTWARE_OUTPUT_SURFACE_H
@@ -47,11 +11,11 @@ namespace QtWebEngineCore {
class DisplaySoftwareOutputSurface final : public viz::SoftwareOutputSurface
{
public:
- DisplaySoftwareOutputSurface();
+ DisplaySoftwareOutputSurface(bool requiresAlpha);
~DisplaySoftwareOutputSurface() override;
- // Overridden from viz::SoftwareOutputSurface.
- void BindToClient(viz::OutputSurfaceClient *client) override;
+ // Overridden from viz::OutputSurface.
+ void SetFrameSinkId(const viz::FrameSinkId &id) override;
private:
class Device;
diff --git a/src/core/compositor/native_skia_output_device.cpp b/src/core/compositor/native_skia_output_device.cpp
new file mode 100644
index 000000000..8f11e5162
--- /dev/null
+++ b/src/core/compositor/native_skia_output_device.cpp
@@ -0,0 +1,418 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "native_skia_output_device.h"
+
+#include "type_conversion.h"
+
+#include "components/viz/common/resources/shared_image_format.h"
+#include "components/viz/common/resources/shared_image_format_utils.h"
+#include "components/viz/service/display_embedder/skia_output_surface_dependency.h"
+#include "gpu/command_buffer/common/mailbox.h"
+#include "gpu/command_buffer/common/shared_image_usage.h"
+#include "gpu/command_buffer/service/shared_image/shared_image_factory.h"
+#include "gpu/command_buffer/service/shared_image/shared_image_representation.h"
+#include "gpu/command_buffer/service/skia_utils.h"
+#include "third_party/skia/include/gpu/GrDirectContext.h"
+#include "third_party/skia/include/core/SkSurfaceProps.h"
+#include "ui/gfx/native_pixmap.h"
+#include "ui/gfx/gpu_fence.h"
+#include "ui/gl/gl_fence.h"
+
+#if defined(USE_OZONE)
+#include "ui/ozone/public/ozone_platform.h"
+#endif
+
+namespace QtWebEngineCore {
+
+namespace {
+
+// Helper function for moving a GpuFence from a fence handle to a unique_ptr.
+std::unique_ptr<gfx::GpuFence> TakeGpuFence(gfx::GpuFenceHandle fence)
+{
+ return fence.is_null() ? nullptr : std::make_unique<gfx::GpuFence>(std::move(fence));
+}
+
+} // namespace
+
+NativeSkiaOutputDevice::NativeSkiaOutputDevice(
+ scoped_refptr<gpu::SharedContextState> contextState, bool requiresAlpha,
+ gpu::MemoryTracker *memoryTracker, viz::SkiaOutputSurfaceDependency *dependency,
+ gpu::SharedImageFactory *shared_image_factory,
+ gpu::SharedImageRepresentationFactory *shared_image_representation_factory,
+ DidSwapBufferCompleteCallback didSwapBufferCompleteCallback)
+ : SkiaOutputDevice(contextState->gr_context(), contextState->graphite_context(), memoryTracker,
+ didSwapBufferCompleteCallback)
+ , Compositor(Type::Native)
+ , m_contextState(contextState)
+ , m_requiresAlpha(requiresAlpha)
+ , m_factory(shared_image_factory)
+ , m_representationFactory(shared_image_representation_factory)
+ , m_deps(dependency)
+{
+ capabilities_.uses_default_gl_framebuffer = false;
+ capabilities_.supports_surfaceless = true;
+ capabilities_.output_surface_origin = gfx::SurfaceOrigin::kTopLeft;
+ capabilities_.preserve_buffer_content = true;
+ capabilities_.only_invalidates_damage_rect = false;
+
+#if defined(USE_OZONE)
+ m_isNativeBufferSupported = ui::OzonePlatform::GetInstance()
+ ->GetPlatformRuntimeProperties()
+ .supports_native_pixmaps;
+#endif
+}
+
+NativeSkiaOutputDevice::~NativeSkiaOutputDevice()
+{
+}
+
+void NativeSkiaOutputDevice::SetFrameSinkId(const viz::FrameSinkId &id)
+{
+ bind(id);
+}
+
+bool NativeSkiaOutputDevice::Reshape(const SkImageInfo &image_info,
+ const gfx::ColorSpace &colorSpace,
+ int sample_count,
+ float device_scale_factor,
+ gfx::OverlayTransform transform)
+{
+ m_shape = Shape{image_info, device_scale_factor, colorSpace, sample_count};
+ DCHECK_EQ(transform, gfx::OVERLAY_TRANSFORM_NONE);
+ return true;
+}
+
+void NativeSkiaOutputDevice::Present(const absl::optional<gfx::Rect> &update_rect,
+ BufferPresentedCallback feedback,
+ viz::OutputSurfaceFrame frame)
+{
+ DCHECK(m_backBuffer);
+
+ StartSwapBuffers(std::move(feedback));
+ m_frame = std::move(frame);
+ {
+ QMutexLocker locker(&m_mutex);
+ m_backBuffer->createFence();
+ m_gpuTaskRunner = base::SingleThreadTaskRunner::GetCurrentDefault();
+ std::swap(m_middleBuffer, m_backBuffer);
+ m_readyToUpdate = true;
+ }
+
+ if (auto obs = observer())
+ obs->readyToSwap();
+}
+
+void NativeSkiaOutputDevice::EnsureBackbuffer()
+{
+}
+
+void NativeSkiaOutputDevice::DiscardBackbuffer()
+{
+}
+
+SkSurface *NativeSkiaOutputDevice::BeginPaint(std::vector<GrBackendSemaphore> *end_semaphores)
+{
+ {
+ QMutexLocker locker(&m_mutex);
+ if (!m_backBuffer || m_backBuffer->shape() != m_shape) {
+ m_backBuffer = std::make_unique<Buffer>(this);
+ if (!m_backBuffer->initialize())
+ return nullptr;
+ }
+ }
+ auto surface = m_backBuffer->beginWriteSkia();
+ *end_semaphores = m_backBuffer->takeEndWriteSkiaSemaphores();
+ return surface;
+}
+
+void NativeSkiaOutputDevice::EndPaint()
+{
+ m_backBuffer->endWriteSkia(true);
+}
+
+void NativeSkiaOutputDevice::swapFrame()
+{
+ QMutexLocker locker(&m_mutex);
+ if (m_readyToUpdate) {
+ std::swap(m_frontBuffer, m_middleBuffer);
+ m_gpuTaskRunner->PostTask(FROM_HERE,
+ base::BindOnce(&NativeSkiaOutputDevice::SwapBuffersFinished,
+ base::Unretained(this)));
+ m_readyToUpdate = false;
+ if (m_frontBuffer) {
+ m_readyWithTexture = true;
+ m_frontBuffer->beginPresent();
+ }
+ if (m_middleBuffer)
+ m_middleBuffer->freeTexture();
+ m_gpuTaskRunner.reset();
+ }
+}
+
+void NativeSkiaOutputDevice::waitForTexture()
+{
+ if (m_readyWithTexture)
+ m_frontBuffer->consumeFence();
+}
+
+void NativeSkiaOutputDevice::releaseTexture()
+{
+ if (m_readyWithTexture) {
+ m_frontBuffer->endPresent();
+ m_readyWithTexture = false;
+ }
+}
+
+void NativeSkiaOutputDevice::releaseResources()
+{
+ if (m_frontBuffer)
+ m_frontBuffer->freeTexture();
+}
+
+bool NativeSkiaOutputDevice::textureIsFlipped()
+{
+ return false;
+}
+
+QSize NativeSkiaOutputDevice::size()
+{
+ return m_frontBuffer ? toQt(m_frontBuffer->shape().imageInfo.dimensions()) : QSize();
+}
+
+bool NativeSkiaOutputDevice::requiresAlphaChannel()
+{
+ return m_requiresAlpha;
+}
+
+float NativeSkiaOutputDevice::devicePixelRatio()
+{
+ return m_frontBuffer ? m_frontBuffer->shape().devicePixelRatio : 1;
+}
+
+void NativeSkiaOutputDevice::SwapBuffersFinished()
+{
+ {
+ QMutexLocker locker(&m_mutex);
+ std::swap(m_backBuffer, m_middleBuffer);
+ }
+
+ FinishSwapBuffers(gfx::SwapCompletionResult(gfx::SwapResult::SWAP_ACK),
+ gfx::Size(m_shape.imageInfo.width(), m_shape.imageInfo.height()),
+ std::move(m_frame));
+}
+
+NativeSkiaOutputDevice::Buffer::Buffer(NativeSkiaOutputDevice *parent)
+ : m_parent(parent), m_shape(m_parent->m_shape)
+{
+}
+
+NativeSkiaOutputDevice::Buffer::~Buffer()
+{
+ if (m_scopedSkiaWriteAccess)
+ endWriteSkia(false);
+
+ if (!m_mailbox.IsZero())
+ m_parent->m_factory->DestroySharedImage(m_mailbox);
+}
+
+// The following Buffer methods are based on
+// components/viz/service/display_embedder/output_presenter.cc: Copyright 2020 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+bool NativeSkiaOutputDevice::Buffer::initialize()
+{
+ static const uint32_t kDefaultSharedImageUsage = gpu::SHARED_IMAGE_USAGE_SCANOUT
+ | gpu::SHARED_IMAGE_USAGE_DISPLAY_READ | gpu::SHARED_IMAGE_USAGE_DISPLAY_WRITE
+ | gpu::SHARED_IMAGE_USAGE_GLES2_FRAMEBUFFER_HINT;
+ auto mailbox = gpu::Mailbox::GenerateForSharedImage();
+
+ SkColorType skColorType = m_shape.imageInfo.colorType();
+ if (!m_parent->m_factory->CreateSharedImage(
+ mailbox, viz::SkColorTypeToSinglePlaneSharedImageFormat(skColorType),
+ { m_shape.imageInfo.width(), m_shape.imageInfo.height() }, m_shape.colorSpace,
+ kTopLeft_GrSurfaceOrigin, kPremul_SkAlphaType, m_parent->m_deps->GetSurfaceHandle(),
+ kDefaultSharedImageUsage, "QWE_SharedImageBuffer")) {
+ LOG(ERROR) << "CreateSharedImage failed.";
+ return false;
+ }
+ m_mailbox = mailbox;
+
+ m_skiaRepresentation =
+ m_parent->m_representationFactory->ProduceSkia(m_mailbox, m_parent->m_contextState);
+ if (!m_skiaRepresentation) {
+ LOG(ERROR) << "ProduceSkia() failed.";
+ return false;
+ }
+
+ if (m_parent->m_isNativeBufferSupported) {
+ m_overlayRepresentation = m_parent->m_representationFactory->ProduceOverlay(m_mailbox);
+ if (!m_overlayRepresentation) {
+ LOG(ERROR) << "ProduceOverlay() failed";
+ return false;
+ }
+ }
+
+ return true;
+}
+
+SkSurface *NativeSkiaOutputDevice::Buffer::beginWriteSkia()
+{
+ DCHECK(!m_scopedSkiaWriteAccess);
+ DCHECK(!m_presentCount);
+ DCHECK(m_endSemaphores.empty());
+
+ std::vector<GrBackendSemaphore> beginSemaphores;
+ SkSurfaceProps surface_props{ 0, kUnknown_SkPixelGeometry };
+
+ // Buffer queue is internal to GPU proc and handles texture initialization,
+ // so allow uncleared access.
+ m_scopedSkiaWriteAccess = m_skiaRepresentation->BeginScopedWriteAccess(
+ m_shape.sampleCount, surface_props, &beginSemaphores, &m_endSemaphores,
+ gpu::SharedImageRepresentation::AllowUnclearedAccess::kYes);
+ DCHECK(m_scopedSkiaWriteAccess);
+ if (!beginSemaphores.empty()) {
+ m_scopedSkiaWriteAccess->surface()->wait(beginSemaphores.size(), beginSemaphores.data(),
+ /*deleteSemaphoresAfterWait=*/false);
+ }
+ return m_scopedSkiaWriteAccess->surface();
+}
+
+void NativeSkiaOutputDevice::Buffer::endWriteSkia(bool force_flush)
+{
+ // The Flush now takes place in finishPaintCurrentBuffer on the CPU side.
+ // check if end_semaphores is not empty then flush here
+ DCHECK(m_scopedSkiaWriteAccess);
+ if (!m_endSemaphores.empty() || force_flush) {
+ GrFlushInfo flush_info = {};
+ flush_info.fNumSemaphores = m_endSemaphores.size();
+ flush_info.fSignalSemaphores = m_endSemaphores.data();
+ auto *direct_context =
+ m_scopedSkiaWriteAccess->surface()->recordingContext()->asDirectContext();
+ DCHECK(direct_context);
+ direct_context->flush(m_scopedSkiaWriteAccess->surface(), {});
+ m_scopedSkiaWriteAccess->ApplyBackendSurfaceEndState();
+ direct_context->flush(m_scopedSkiaWriteAccess->surface(), flush_info, nullptr);
+ direct_context->submit();
+ }
+ m_scopedSkiaWriteAccess.reset();
+ m_endSemaphores.clear();
+
+ // SkiaRenderer always draws the full frame.
+ m_skiaRepresentation->SetCleared();
+}
+
+std::vector<GrBackendSemaphore> NativeSkiaOutputDevice::Buffer::takeEndWriteSkiaSemaphores()
+{
+ return std::exchange(m_endSemaphores, {});
+}
+
+void NativeSkiaOutputDevice::Buffer::createSkImageOnGPUThread()
+{
+ if (!m_scopedSkiaReadAccess)
+ return;
+
+ QMutexLocker locker(&m_skImageMutex);
+ m_cachedSkImage = m_scopedSkiaReadAccess->CreateSkImage(m_parent->m_contextState.get());
+ if (!m_cachedSkImage)
+ qWarning("SKIA: Failed to create SkImage.");
+}
+
+void NativeSkiaOutputDevice::Buffer::beginPresent()
+{
+ if (++m_presentCount != 1) {
+ DCHECK(m_scopedOverlayReadAccess || m_scopedSkiaReadAccess);
+ return;
+ }
+
+ DCHECK(!m_scopedSkiaWriteAccess);
+ DCHECK(!m_scopedOverlayReadAccess && !m_scopedSkiaReadAccess);
+
+ if (m_overlayRepresentation) {
+ m_scopedOverlayReadAccess = m_overlayRepresentation->BeginScopedReadAccess();
+ DCHECK(m_scopedOverlayReadAccess);
+ m_acquireFence = TakeGpuFence(m_scopedOverlayReadAccess->TakeAcquireFence());
+ } else {
+ DCHECK(m_skiaRepresentation);
+ std::vector<GrBackendSemaphore> beginSemaphores;
+ m_scopedSkiaReadAccess =
+ m_skiaRepresentation->BeginScopedReadAccess(&beginSemaphores, nullptr);
+ DCHECK(m_scopedSkiaReadAccess);
+ if (!beginSemaphores.empty())
+ qWarning("SKIA: Unexpected semaphores while reading texture, wait is not implemented.");
+
+ m_parent->m_gpuTaskRunner->PostTask(FROM_HERE,
+ base::BindOnce(&NativeSkiaOutputDevice::Buffer::createSkImageOnGPUThread,
+ base::Unretained(this)));
+ }
+}
+
+void NativeSkiaOutputDevice::Buffer::endPresent()
+{
+ if (!m_presentCount)
+ return;
+ DCHECK(m_scopedOverlayReadAccess || m_scopedSkiaReadAccess);
+ if (--m_presentCount)
+ return;
+
+ if (m_scopedOverlayReadAccess) {
+ DCHECK(!m_scopedSkiaReadAccess);
+ m_scopedOverlayReadAccess.reset();
+ } else if (m_scopedSkiaReadAccess) {
+ DCHECK(!m_scopedOverlayReadAccess);
+ QMutexLocker locker(&m_skImageMutex);
+ m_scopedSkiaReadAccess.reset();
+ }
+}
+
+void NativeSkiaOutputDevice::Buffer::freeTexture()
+{
+ if (textureCleanupCallback) {
+ textureCleanupCallback();
+ textureCleanupCallback = nullptr;
+ }
+}
+
+void NativeSkiaOutputDevice::Buffer::createFence()
+{
+ // For some reason we still need to create this, but we do not need to wait on it.
+ if (m_parent->m_contextState->gr_context_type() == gpu::GrContextType::kGL)
+ m_fence = gl::GLFence::Create();
+}
+
+void NativeSkiaOutputDevice::Buffer::consumeFence()
+{
+ if (m_acquireFence) {
+ m_acquireFence->Wait();
+ m_acquireFence.reset();
+ }
+}
+
+sk_sp<SkImage> NativeSkiaOutputDevice::Buffer::skImage()
+{
+ return m_cachedSkImage;
+}
+#if defined(USE_OZONE)
+scoped_refptr<gfx::NativePixmap> NativeSkiaOutputDevice::Buffer::nativePixmap()
+{
+ DCHECK(m_presentCount);
+ if (!m_scopedOverlayReadAccess)
+ return nullptr;
+
+ return m_scopedOverlayReadAccess->GetNativePixmap();
+}
+#elif defined(Q_OS_WIN)
+absl::optional<gl::DCLayerOverlayImage> NativeSkiaOutputDevice::Buffer::overlayImage() const
+{
+ DCHECK(m_presentCount);
+ return m_scopedOverlayReadAccess->GetDCLayerOverlayImage();
+}
+#elif defined(Q_OS_MACOS)
+gfx::ScopedIOSurface NativeSkiaOutputDevice::Buffer::ioSurface() const
+{
+ DCHECK(m_presentCount);
+ return m_scopedOverlayReadAccess->GetIOSurface();
+}
+#endif
+
+} // namespace QtWebEngineCore
diff --git a/src/core/compositor/native_skia_output_device.h b/src/core/compositor/native_skia_output_device.h
new file mode 100644
index 000000000..2c35cef77
--- /dev/null
+++ b/src/core/compositor/native_skia_output_device.h
@@ -0,0 +1,183 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef NATIVE_SKIA_OUTPUT_DEVICE_H
+#define NATIVE_SKIA_OUTPUT_DEVICE_H
+
+#include "compositor.h"
+
+#include "base/task/single_thread_task_runner.h"
+#include "components/viz/service/display_embedder/skia_output_device.h"
+#include "gpu/command_buffer/service/shared_context_state.h"
+#include "gpu/command_buffer/service/shared_image/shared_image_representation.h"
+#include "gpu/config/gpu_preferences.h"
+
+#include <QMutex>
+
+#if defined(Q_OS_WIN)
+#include "ui/gl/dc_layer_overlay_image.h"
+#endif
+
+#if defined(Q_OS_MACOS)
+#include "ui/gfx/mac/io_surface.h"
+#endif
+
+QT_BEGIN_NAMESPACE
+class QQuickWindow;
+QT_END_NAMESPACE
+
+namespace gl {
+class GLFence;
+}
+
+namespace gfx {
+class GpuFence;
+class NativePixmap;
+}
+
+namespace gpu {
+class SharedImageFactory;
+class SharedImageRepresentationFactory;
+}
+
+namespace viz {
+class SkiaOutputSurfaceDependency;
+}
+
+namespace QtWebEngineCore {
+
+class NativeSkiaOutputDevice : public viz::SkiaOutputDevice, public Compositor
+{
+public:
+ NativeSkiaOutputDevice(scoped_refptr<gpu::SharedContextState> contextState,
+ bool requiresAlpha,
+ gpu::MemoryTracker *memoryTracker,
+ viz::SkiaOutputSurfaceDependency *dependency,
+ gpu::SharedImageFactory *shared_image_factory,
+ gpu::SharedImageRepresentationFactory *shared_image_representation_factory,
+ DidSwapBufferCompleteCallback didSwapBufferCompleteCallback);
+ ~NativeSkiaOutputDevice() override;
+
+ // Overridden from SkiaOutputDevice.
+ void SetFrameSinkId(const viz::FrameSinkId &frame_sink_id) override;
+ bool Reshape(const SkImageInfo &image_info,
+ const gfx::ColorSpace &color_space,
+ int sample_count,
+ float device_scale_factor,
+ gfx::OverlayTransform transform) override;
+ void Present(const absl::optional<gfx::Rect>& update_rect,
+ BufferPresentedCallback feedback,
+ viz::OutputSurfaceFrame frame) override;
+ void EnsureBackbuffer() override;
+ void DiscardBackbuffer() override;
+ SkSurface *BeginPaint(std::vector<GrBackendSemaphore> *semaphores) override;
+ void EndPaint() override;
+
+ // Overridden from Compositor.
+ void swapFrame() override;
+ void waitForTexture() override;
+ void releaseTexture() override;
+ void releaseResources() override;
+ bool textureIsFlipped() override;
+ QSize size() override;
+ bool requiresAlphaChannel() override;
+ float devicePixelRatio() override;
+
+protected:
+ struct Shape
+ {
+ SkImageInfo imageInfo;
+ float devicePixelRatio;
+ gfx::ColorSpace colorSpace;
+ int sampleCount;
+
+ bool operator==(const Shape &that) const
+ {
+ return (imageInfo == that.imageInfo &&
+ devicePixelRatio == that.devicePixelRatio &&
+ colorSpace == that.colorSpace &&
+ sampleCount == that.sampleCount);
+ }
+ bool operator!=(const Shape &that) const { return !(*this == that); }
+ };
+
+ class Buffer
+ {
+ public:
+ Buffer(NativeSkiaOutputDevice *parent);
+ ~Buffer();
+
+ bool initialize();
+ SkSurface *beginWriteSkia();
+ void endWriteSkia(bool force_flush);
+ std::vector<GrBackendSemaphore> takeEndWriteSkiaSemaphores();
+ void beginPresent();
+ void endPresent();
+ void freeTexture();
+ void createFence();
+ void consumeFence();
+
+ sk_sp<SkImage> skImage();
+#if defined(USE_OZONE)
+ scoped_refptr<gfx::NativePixmap> nativePixmap();
+#elif defined(Q_OS_WIN)
+ absl::optional<gl::DCLayerOverlayImage> overlayImage() const;
+#elif defined(Q_OS_MACOS)
+ gfx::ScopedIOSurface ioSurface() const;
+#endif
+
+ const Shape &shape() const { return m_shape; }
+ viz::SharedImageFormat sharedImageFormat() const { return m_skiaRepresentation->format(); }
+
+ std::function<void()> textureCleanupCallback;
+
+ private:
+ void createSkImageOnGPUThread();
+
+ NativeSkiaOutputDevice *m_parent;
+ Shape m_shape;
+ uint64_t m_estimatedSize = 0; // FIXME: estimate size
+ std::unique_ptr<gfx::GpuFence> m_acquireFence;
+ std::unique_ptr<gl::GLFence> m_fence;
+ gpu::Mailbox m_mailbox;
+ std::unique_ptr<gpu::SkiaImageRepresentation> m_skiaRepresentation;
+ std::unique_ptr<gpu::SkiaImageRepresentation::ScopedWriteAccess> m_scopedSkiaWriteAccess;
+ std::unique_ptr<gpu::SkiaImageRepresentation::ScopedReadAccess> m_scopedSkiaReadAccess;
+ std::unique_ptr<gpu::OverlayImageRepresentation> m_overlayRepresentation;
+ std::unique_ptr<gpu::OverlayImageRepresentation::ScopedReadAccess>
+ m_scopedOverlayReadAccess;
+ std::vector<GrBackendSemaphore> m_endSemaphores;
+ int m_presentCount = 0;
+
+ mutable QMutex m_skImageMutex;
+ sk_sp<SkImage> m_cachedSkImage;
+ };
+
+protected:
+ scoped_refptr<gpu::SharedContextState> m_contextState;
+ std::unique_ptr<Buffer> m_frontBuffer;
+ bool m_readyWithTexture = false;
+ bool m_isNativeBufferSupported = true;
+
+private:
+ friend class NativeSkiaOutputDevice::Buffer;
+
+ void SwapBuffersFinished();
+
+ mutable QMutex m_mutex;
+ Shape m_shape;
+ std::unique_ptr<Buffer> m_middleBuffer;
+ std::unique_ptr<Buffer> m_backBuffer;
+ viz::OutputSurfaceFrame m_frame;
+ bool m_readyToUpdate = false;
+ bool m_requiresAlpha;
+ scoped_refptr<base::SingleThreadTaskRunner> m_gpuTaskRunner;
+
+ const raw_ptr<gpu::SharedImageFactory> m_factory;
+ const raw_ptr<gpu::SharedImageRepresentationFactory> m_representationFactory;
+ const raw_ptr<viz::SkiaOutputSurfaceDependency> m_deps;
+};
+
+} // namespace QtWebEngineCore
+
+#endif // !NATIVE_SKIA_OUTPUT_DEVICE_H
diff --git a/src/core/compositor/native_skia_output_device_direct3d11.cpp b/src/core/compositor/native_skia_output_device_direct3d11.cpp
new file mode 100644
index 000000000..352fa9f92
--- /dev/null
+++ b/src/core/compositor/native_skia_output_device_direct3d11.cpp
@@ -0,0 +1,88 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "native_skia_output_device_direct3d11.h"
+
+#include <QtCore/private/qsystemerror_p.h>
+#include <QtQuick/qquickwindow.h>
+#include <QtQuick/qsgtexture.h>
+
+#include <d3d11_1.h>
+
+namespace QtWebEngineCore {
+
+NativeSkiaOutputDeviceDirect3D11::NativeSkiaOutputDeviceDirect3D11(
+ scoped_refptr<gpu::SharedContextState> contextState, bool requiresAlpha,
+ gpu::MemoryTracker *memoryTracker, viz::SkiaOutputSurfaceDependency *dependency,
+ gpu::SharedImageFactory *shared_image_factory,
+ gpu::SharedImageRepresentationFactory *shared_image_representation_factory,
+ DidSwapBufferCompleteCallback didSwapBufferCompleteCallback)
+ : NativeSkiaOutputDevice(contextState, requiresAlpha, memoryTracker, dependency,
+ shared_image_factory, shared_image_representation_factory,
+ didSwapBufferCompleteCallback)
+{
+ SkColorType skColorType = kRGBA_8888_SkColorType;
+ capabilities_.sk_color_types[static_cast<int>(gfx::BufferFormat::RGBA_8888)] = skColorType;
+ capabilities_.sk_color_types[static_cast<int>(gfx::BufferFormat::RGBX_8888)] = skColorType;
+ capabilities_.sk_color_types[static_cast<int>(gfx::BufferFormat::BGRA_8888)] = skColorType;
+ capabilities_.sk_color_types[static_cast<int>(gfx::BufferFormat::BGRX_8888)] = skColorType;
+}
+
+NativeSkiaOutputDeviceDirect3D11::~NativeSkiaOutputDeviceDirect3D11() { }
+
+QSGTexture *NativeSkiaOutputDeviceDirect3D11::texture(QQuickWindow *win, uint32_t textureOptions)
+{
+ if (!m_frontBuffer || !m_readyWithTexture)
+ return nullptr;
+
+ absl::optional<gl::DCLayerOverlayImage> overlayImage = m_frontBuffer->overlayImage();
+ if (!overlayImage) {
+ qWarning("No overlay image.");
+ return nullptr;
+ }
+
+ QSGRendererInterface *ri = win->rendererInterface();
+
+ HRESULT status = S_OK;
+ HANDLE sharedHandle = nullptr;
+ IDXGIResource1 *resource = nullptr;
+ if (!overlayImage->nv12_texture()) {
+ qWarning("No D3D texture.");
+ return nullptr;
+ }
+ status = overlayImage->nv12_texture()->QueryInterface(__uuidof(IDXGIResource1),
+ (void **)&resource);
+ Q_ASSERT(status == S_OK);
+ status = resource->CreateSharedHandle(NULL, DXGI_SHARED_RESOURCE_READ, NULL, &sharedHandle);
+ Q_ASSERT(status == S_OK);
+ Q_ASSERT(sharedHandle);
+
+ // Pass texture between two D3D devices:
+ ID3D11Device1 *device = static_cast<ID3D11Device1 *>(
+ ri->getResource(win, QSGRendererInterface::DeviceResource));
+
+ ID3D11Texture2D *qtTexture;
+ status = device->OpenSharedResource1(sharedHandle, __uuidof(ID3D11Texture2D),
+ (void **)&qtTexture);
+ if (status != S_OK) {
+ qWarning("Failed to share D3D11 texture (%s). This will result in failed rendering. Report "
+ "the bug, and try restarting with QTWEBENGINE_CHROMIUM_FLAGS=--disble-gpu",
+ qPrintable(QSystemError::windowsComString(status)));
+ ::CloseHandle(sharedHandle);
+ return nullptr;
+ }
+
+ Q_ASSERT(qtTexture);
+ QQuickWindow::CreateTextureOptions texOpts(textureOptions);
+ QSGTexture *texture =
+ QNativeInterface::QSGD3D11Texture::fromNative(qtTexture, win, size(), texOpts);
+
+ m_frontBuffer->textureCleanupCallback = [qtTexture, sharedHandle]() {
+ qtTexture->Release();
+ ::CloseHandle(sharedHandle);
+ };
+
+ return texture;
+}
+
+} // namespace QtWebEngineCore
diff --git a/src/core/compositor/native_skia_output_device_direct3d11.h b/src/core/compositor/native_skia_output_device_direct3d11.h
new file mode 100644
index 000000000..33cf1bcd6
--- /dev/null
+++ b/src/core/compositor/native_skia_output_device_direct3d11.h
@@ -0,0 +1,28 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef NATIVE_SKIA_OUTPUT_DEVICE_DIRECT3D11_H
+#define NATIVE_SKIA_OUTPUT_DEVICE_DIRECT3D11_H
+
+#include "native_skia_output_device.h"
+
+namespace QtWebEngineCore {
+
+class NativeSkiaOutputDeviceDirect3D11 final : public NativeSkiaOutputDevice
+{
+public:
+ NativeSkiaOutputDeviceDirect3D11(
+ scoped_refptr<gpu::SharedContextState> contextState, bool requiresAlpha,
+ gpu::MemoryTracker *memoryTracker, viz::SkiaOutputSurfaceDependency *dependency,
+ gpu::SharedImageFactory *shared_image_factory,
+ gpu::SharedImageRepresentationFactory *shared_image_representation_factory,
+ DidSwapBufferCompleteCallback didSwapBufferCompleteCallback);
+ ~NativeSkiaOutputDeviceDirect3D11() override;
+
+ // Overridden from Compositor:
+ QSGTexture *texture(QQuickWindow *win, uint32_t textureOptions) override;
+};
+
+} // namespace QtWebEngineCore
+
+#endif // NATIVE_SKIA_OUTPUT_DEVICE_DIRECT3D11_H
diff --git a/src/core/compositor/native_skia_output_device_mac.mm b/src/core/compositor/native_skia_output_device_mac.mm
new file mode 100644
index 000000000..fd3930a9f
--- /dev/null
+++ b/src/core/compositor/native_skia_output_device_mac.mm
@@ -0,0 +1,90 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+// This is a workaround to be able to include Qt headers without
+// "redefinition of 'NSString' as different kind of symbol" errors.
+// TODO: Remove this when namespace ambiguity issues are fixed properly,
+// see get_forward_declaration_macro() in cmake/Functions.cmake
+#undef Q_FORWARD_DECLARE_OBJC_CLASS
+
+#import <AppKit/AppKit.h>
+#import <IOSurface/IOSurface.h>
+#import <Metal/Metal.h>
+
+#include <QtGui/qtguiglobal.h>
+#include <QtQuick/qquickwindow.h>
+#include <QtQuick/qsgrendererinterface.h>
+#include <QtQuick/qsgtexture.h>
+
+#if QT_CONFIG(opengl)
+#include <OpenGL/OpenGL.h>
+#include <QtGui/qopenglcontext.h>
+#include <QtGui/qopenglextrafunctions.h>
+#include <QtOpenGL/qopengltextureblitter.h>
+#include <QtOpenGL/qopenglframebufferobject.h>
+#endif
+
+namespace QtWebEngineCore {
+
+QSGTexture *makeMetalTexture(QQuickWindow *win, IOSurfaceRef ioSurface, uint ioSurfacePlane,
+ const QSize &size, QQuickWindow::CreateTextureOptions texOpts)
+{
+ auto desc = [MTLTextureDescriptor texture2DDescriptorWithPixelFormat:MTLPixelFormatBGRA8Unorm
+ width:size.width()
+ height:size.height()
+ mipmapped:false];
+
+ QSGRendererInterface *ri = win->rendererInterface();
+ auto device = (__bridge id<MTLDevice>)(ri->getResource(win, QSGRendererInterface::DeviceResource));
+ auto texture = [device newTextureWithDescriptor:desc iosurface:ioSurface plane:ioSurfacePlane];
+ return QNativeInterface::QSGMetalTexture::fromNative(texture, win, size, texOpts);
+}
+
+#if QT_CONFIG(opengl)
+uint32_t makeCGLTexture(QQuickWindow *win, IOSurfaceRef ioSurface, const QSize &size)
+{
+ const int width = size.width();
+ const int height = size.height();
+
+ auto glContext = QOpenGLContext::currentContext();
+ auto glFun = glContext->extraFunctions();
+ auto nscontext = glContext->nativeInterface<QNativeInterface::QCocoaGLContext>()->nativeContext();
+ CGLContextObj cglContext = [nscontext CGLContextObj];
+
+ win->beginExternalCommands();
+ // Bind the IO surface to a texture
+ GLuint glTexture;
+ glFun->glGenTextures(1, &glTexture);
+ glFun->glBindTexture(GL_TEXTURE_RECTANGLE_ARB, glTexture);
+ CGLTexImageIOSurface2D(cglContext, GL_TEXTURE_RECTANGLE_ARB, GL_RGBA, width, height, GL_BGRA,
+ GL_UNSIGNED_INT_8_8_8_8_REV, ioSurface, 0);
+ glFun->glBindTexture(GL_TEXTURE_RECTANGLE_ARB, 0);
+ glFun->glViewport(0, 0, width, height);
+
+ // The bound IO surface is a weird dynamic bind, so take a snapshot of it to a normal texture
+ {
+ QOpenGLFramebufferObject fbo(width, height, GL_TEXTURE_2D);
+ auto success = fbo.bind();
+ Q_ASSERT(success);
+
+ QOpenGLTextureBlitter blitter;
+ success = blitter.create();
+ Q_ASSERT(success);
+ glFun->glDisable(GL_BLEND);
+ glFun->glDisable(GL_SCISSOR_TEST);
+ blitter.bind(GL_TEXTURE_RECTANGLE_ARB);
+ blitter.blit(glTexture, {}, QOpenGLTextureBlitter::OriginBottomLeft);
+ blitter.release();
+ blitter.destroy();
+
+ glFun->glDeleteTextures(1, &glTexture);
+ glTexture = fbo.takeTexture();
+ fbo.release();
+ }
+ win->endExternalCommands();
+
+ return glTexture;
+}
+#endif // QT_CONFIG(opengl)
+
+} // namespace
diff --git a/src/core/compositor/native_skia_output_device_metal.cpp b/src/core/compositor/native_skia_output_device_metal.cpp
new file mode 100644
index 000000000..95ed02779
--- /dev/null
+++ b/src/core/compositor/native_skia_output_device_metal.cpp
@@ -0,0 +1,47 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "native_skia_output_device_metal.h"
+
+#include <QtQuick/qquickwindow.h>
+
+namespace QtWebEngineCore {
+
+NativeSkiaOutputDeviceMetal::NativeSkiaOutputDeviceMetal(
+ scoped_refptr<gpu::SharedContextState> contextState, bool requiresAlpha,
+ gpu::MemoryTracker *memoryTracker, viz::SkiaOutputSurfaceDependency *dependency,
+ gpu::SharedImageFactory *shared_image_factory,
+ gpu::SharedImageRepresentationFactory *shared_image_representation_factory,
+ DidSwapBufferCompleteCallback didSwapBufferCompleteCallback)
+ : NativeSkiaOutputDevice(contextState, requiresAlpha, memoryTracker, dependency,
+ shared_image_factory, shared_image_representation_factory,
+ didSwapBufferCompleteCallback)
+{
+ SkColorType skColorType = kRGBA_8888_SkColorType;
+ capabilities_.sk_color_types[static_cast<int>(gfx::BufferFormat::RGBA_8888)] = skColorType;
+ capabilities_.sk_color_types[static_cast<int>(gfx::BufferFormat::RGBX_8888)] = skColorType;
+ capabilities_.sk_color_types[static_cast<int>(gfx::BufferFormat::BGRA_8888)] = skColorType;
+ capabilities_.sk_color_types[static_cast<int>(gfx::BufferFormat::BGRX_8888)] = skColorType;
+}
+
+NativeSkiaOutputDeviceMetal::~NativeSkiaOutputDeviceMetal() { }
+
+QSGTexture *makeMetalTexture(QQuickWindow *win, IOSurfaceRef ioSurface, uint ioSurfacePlane,
+ const QSize &size, QQuickWindow::CreateTextureOptions texOpts);
+
+QSGTexture *NativeSkiaOutputDeviceMetal::texture(QQuickWindow *win, uint32_t textureOptions)
+{
+ if (!m_frontBuffer || !m_readyWithTexture)
+ return nullptr;
+
+ gfx::ScopedIOSurface ioSurface = m_frontBuffer->ioSurface();
+ if (!ioSurface) {
+ qWarning("No IOSurface.");
+ return nullptr;
+ }
+
+ QQuickWindow::CreateTextureOptions texOpts(textureOptions);
+ return makeMetalTexture(win, ioSurface.release(), /* plane */ 0, size(), texOpts);
+}
+
+} // namespace QtWebEngineCore
diff --git a/src/core/compositor/native_skia_output_device_metal.h b/src/core/compositor/native_skia_output_device_metal.h
new file mode 100644
index 000000000..e61665fb5
--- /dev/null
+++ b/src/core/compositor/native_skia_output_device_metal.h
@@ -0,0 +1,28 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef NATIVE_SKIA_OUTPUT_DEVICE_METAL_H
+#define NATIVE_SKIA_OUTPUT_DEVICE_METAL_H
+
+#include "native_skia_output_device.h"
+
+namespace QtWebEngineCore {
+
+class NativeSkiaOutputDeviceMetal final : public NativeSkiaOutputDevice
+{
+public:
+ NativeSkiaOutputDeviceMetal(
+ scoped_refptr<gpu::SharedContextState> contextState, bool requiresAlpha,
+ gpu::MemoryTracker *memoryTracker, viz::SkiaOutputSurfaceDependency *dependency,
+ gpu::SharedImageFactory *shared_image_factory,
+ gpu::SharedImageRepresentationFactory *shared_image_representation_factory,
+ DidSwapBufferCompleteCallback didSwapBufferCompleteCallback);
+ ~NativeSkiaOutputDeviceMetal() override;
+
+ // Overridden from Compositor:
+ QSGTexture *texture(QQuickWindow *win, uint32_t textureOptions) override;
+};
+
+} // namespace QtWebEngineCore
+
+#endif // NATIVE_SKIA_OUTPUT_DEVICE_METAL_H
diff --git a/src/core/compositor/native_skia_output_device_opengl.cpp b/src/core/compositor/native_skia_output_device_opengl.cpp
new file mode 100644
index 000000000..ea4c0c500
--- /dev/null
+++ b/src/core/compositor/native_skia_output_device_opengl.cpp
@@ -0,0 +1,86 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "native_skia_output_device_opengl.h"
+
+#include <QtGui/qopenglcontext.h>
+#include <QtGui/qopenglextrafunctions.h>
+#include <QtQuick/qquickwindow.h>
+#include <QtQuick/qsgtexture.h>
+
+namespace QtWebEngineCore {
+
+NativeSkiaOutputDeviceOpenGL::NativeSkiaOutputDeviceOpenGL(
+ scoped_refptr<gpu::SharedContextState> contextState, bool requiresAlpha,
+ gpu::MemoryTracker *memoryTracker, viz::SkiaOutputSurfaceDependency *dependency,
+ gpu::SharedImageFactory *shared_image_factory,
+ gpu::SharedImageRepresentationFactory *shared_image_representation_factory,
+ DidSwapBufferCompleteCallback didSwapBufferCompleteCallback)
+ : NativeSkiaOutputDevice(contextState, requiresAlpha, memoryTracker, dependency,
+ shared_image_factory, shared_image_representation_factory,
+ didSwapBufferCompleteCallback)
+{
+ SkColorType skColorType = kRGBA_8888_SkColorType;
+ capabilities_.sk_color_types[static_cast<int>(gfx::BufferFormat::RGBA_8888)] = skColorType;
+ capabilities_.sk_color_types[static_cast<int>(gfx::BufferFormat::RGBX_8888)] = skColorType;
+ capabilities_.sk_color_types[static_cast<int>(gfx::BufferFormat::BGRA_8888)] = skColorType;
+ capabilities_.sk_color_types[static_cast<int>(gfx::BufferFormat::BGRX_8888)] = skColorType;
+}
+
+NativeSkiaOutputDeviceOpenGL::~NativeSkiaOutputDeviceOpenGL() { }
+
+#if defined(Q_OS_MACOS)
+uint32_t makeCGLTexture(QQuickWindow *win, IOSurfaceRef ioSurface, const QSize &size);
+#endif
+
+QSGTexture *NativeSkiaOutputDeviceOpenGL::texture(QQuickWindow *win, uint32_t textureOptions)
+{
+ if (!m_frontBuffer || !m_readyWithTexture)
+ return nullptr;
+
+#if defined(USE_OZONE)
+ scoped_refptr<gfx::NativePixmap> nativePixmap = m_frontBuffer->nativePixmap();
+ if (!nativePixmap) {
+ qWarning("No native pixmap.");
+ return nullptr;
+ }
+#elif defined(Q_OS_WIN)
+ auto overlayImage = m_frontBuffer->overlayImage();
+ if (!overlayImage) {
+ qWarning("No overlay image.");
+ return nullptr;
+ }
+#elif defined(Q_OS_MACOS)
+ gfx::ScopedIOSurface ioSurface = m_frontBuffer->ioSurface();
+ if (!ioSurface) {
+ qWarning("No IOSurface.");
+ return nullptr;
+ }
+#endif
+
+ QQuickWindow::CreateTextureOptions texOpts(textureOptions);
+ QSGTexture *texture = nullptr;
+
+#if defined(USE_OZONE)
+ // TODO(QTBUG-112281): Add ANGLE support to Linux.
+ QT_NOT_YET_IMPLEMENTED
+#elif defined(Q_OS_WIN)
+ // TODO: Add WGL support over ANGLE.
+ QT_NOT_YET_IMPLEMENTED
+#elif defined(Q_OS_MACOS)
+ uint32_t glTexture = makeCGLTexture(win, ioSurface.release(), size());
+ texture = QNativeInterface::QSGOpenGLTexture::fromNative(glTexture, win, size(), texOpts);
+
+ m_frontBuffer->textureCleanupCallback = [glTexture]() {
+ auto *glContext = QOpenGLContext::currentContext();
+ if (!glContext)
+ return;
+ auto glFun = glContext->functions();
+ glFun->glDeleteTextures(1, &glTexture);
+ };
+#endif
+
+ return texture;
+}
+
+} // namespace QtWebEngineCore
diff --git a/src/core/compositor/native_skia_output_device_opengl.h b/src/core/compositor/native_skia_output_device_opengl.h
new file mode 100644
index 000000000..233f51df9
--- /dev/null
+++ b/src/core/compositor/native_skia_output_device_opengl.h
@@ -0,0 +1,28 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef NATIVE_SKIA_OUTPUT_DEVICE_OPENGL_H
+#define NATIVE_SKIA_OUTPUT_DEVICE_OPENGL_H
+
+#include "native_skia_output_device.h"
+
+namespace QtWebEngineCore {
+
+class NativeSkiaOutputDeviceOpenGL final : public NativeSkiaOutputDevice
+{
+public:
+ NativeSkiaOutputDeviceOpenGL(
+ scoped_refptr<gpu::SharedContextState> contextState, bool requiresAlpha,
+ gpu::MemoryTracker *memoryTracker, viz::SkiaOutputSurfaceDependency *dependency,
+ gpu::SharedImageFactory *shared_image_factory,
+ gpu::SharedImageRepresentationFactory *shared_image_representation_factory,
+ DidSwapBufferCompleteCallback didSwapBufferCompleteCallback);
+ ~NativeSkiaOutputDeviceOpenGL() override;
+
+ // Overridden from Compositor:
+ QSGTexture *texture(QQuickWindow *win, uint32_t textureOptions) override;
+};
+
+} // namespace QtWebEngineCore
+
+#endif // NATIVE_SKIA_OUTPUT_DEVICE_OPENGL_H
diff --git a/src/core/compositor/native_skia_output_device_vulkan.cpp b/src/core/compositor/native_skia_output_device_vulkan.cpp
new file mode 100644
index 000000000..c2ad7a382
--- /dev/null
+++ b/src/core/compositor/native_skia_output_device_vulkan.cpp
@@ -0,0 +1,306 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "native_skia_output_device_vulkan.h"
+
+#include "gpu/command_buffer/service/shared_image/shared_image_format_service_utils.h"
+
+#include <QtGui/qvulkaninstance.h>
+#include <QtGui/qvulkanfunctions.h>
+#include <QtQuick/qquickwindow.h>
+#include <QtQuick/qsgtexture.h>
+
+#if defined(USE_OZONE)
+#include "ui/ozone/buildflags.h"
+#if BUILDFLAG(OZONE_PLATFORM_X11)
+// We need to define USE_VULKAN_XCB for proper vulkan function pointers.
+// Avoiding it may lead to call wrong vulkan functions.
+// This is originally defined in chromium/gpu/vulkan/BUILD.gn.
+#define USE_VULKAN_XCB
+#endif // BUILDFLAG(OZONE_PLATFORM_X11)
+#include "gpu/vulkan/vulkan_function_pointers.h"
+
+#include "components/viz/common/gpu/vulkan_context_provider.h"
+#include "gpu/vulkan/vulkan_device_queue.h"
+#endif // defined(USE_OZONE)
+
+namespace QtWebEngineCore {
+
+NativeSkiaOutputDeviceVulkan::NativeSkiaOutputDeviceVulkan(
+ scoped_refptr<gpu::SharedContextState> contextState, bool requiresAlpha,
+ gpu::MemoryTracker *memoryTracker, viz::SkiaOutputSurfaceDependency *dependency,
+ gpu::SharedImageFactory *shared_image_factory,
+ gpu::SharedImageRepresentationFactory *shared_image_representation_factory,
+ DidSwapBufferCompleteCallback didSwapBufferCompleteCallback)
+ : NativeSkiaOutputDevice(contextState, requiresAlpha, memoryTracker, dependency,
+ shared_image_factory, shared_image_representation_factory,
+ didSwapBufferCompleteCallback)
+{
+ SkColorType skColorType = kRGBA_8888_SkColorType;
+ capabilities_.sk_color_types[static_cast<int>(gfx::BufferFormat::RGBA_8888)] = skColorType;
+ capabilities_.sk_color_types[static_cast<int>(gfx::BufferFormat::RGBX_8888)] = skColorType;
+ capabilities_.sk_color_types[static_cast<int>(gfx::BufferFormat::BGRA_8888)] = skColorType;
+ capabilities_.sk_color_types[static_cast<int>(gfx::BufferFormat::BGRX_8888)] = skColorType;
+}
+
+NativeSkiaOutputDeviceVulkan::~NativeSkiaOutputDeviceVulkan() { }
+
+QSGTexture *NativeSkiaOutputDeviceVulkan::texture(QQuickWindow *win, uint32_t textureOptions)
+{
+ if (!m_frontBuffer || !m_readyWithTexture)
+ return nullptr;
+
+#if defined(USE_OZONE)
+ Q_ASSERT(m_contextState->gr_context_type() == gpu::GrContextType::kVulkan);
+
+ GrVkImageInfo vkImageInfo;
+ scoped_refptr<gfx::NativePixmap> nativePixmap = m_frontBuffer->nativePixmap();
+ if (!nativePixmap) {
+ if (m_isNativeBufferSupported) {
+ qWarning("VULKAN: No NativePixmap.");
+ return nullptr;
+ }
+
+ sk_sp<SkImage> skImage = m_frontBuffer->skImage();
+ if (!skImage) {
+ qWarning("VULKAN: No SkImage.");
+ return nullptr;
+ }
+
+ if (!skImage->isTextureBacked()) {
+ qWarning("VULKAN: SkImage is not backed by GPU texture.");
+ return nullptr;
+ }
+
+ GrBackendTexture backendTexture;
+ bool success = SkImages::GetBackendTextureFromImage(skImage, &backendTexture, false);
+ if (!success || !backendTexture.isValid()) {
+ qWarning("VULKAN: Failed to retrieve backend texture from SkImage.");
+ return nullptr;
+ }
+
+ if (backendTexture.backend() != GrBackendApi::kVulkan) {
+ qWarning("VULKAN: Backend texture is not a Vulkan texture.");
+ return nullptr;
+ }
+
+ backendTexture.getVkImageInfo(&vkImageInfo);
+ if (vkImageInfo.fAlloc.fMemory == VK_NULL_HANDLE) {
+ qWarning("VULKAN: Unable to access Vulkan memory.");
+ return nullptr;
+ }
+ }
+#elif defined(Q_OS_WIN)
+ Q_ASSERT(m_contextState->gr_context_type() == gpu::GrContextType::kGL);
+
+ absl::optional<gl::DCLayerOverlayImage> overlayImage = m_frontBuffer->overlayImage();
+ if (!overlayImage) {
+ qWarning("No overlay image.");
+ return nullptr;
+ }
+#endif
+
+ QSGRendererInterface *ri = win->rendererInterface();
+ VkDevice qtVulkanDevice =
+ *static_cast<VkDevice *>(ri->getResource(win, QSGRendererInterface::DeviceResource));
+ VkPhysicalDevice qtPhysicalDevice = *static_cast<VkPhysicalDevice *>(
+ ri->getResource(win, QSGRendererInterface::PhysicalDeviceResource));
+ QVulkanFunctions *f = win->vulkanInstance()->functions();
+ QVulkanDeviceFunctions *df = win->vulkanInstance()->deviceFunctions(qtVulkanDevice);
+
+ VkImageLayout imageLayout = VK_IMAGE_LAYOUT_UNDEFINED;
+ VkPhysicalDeviceProperties deviceProperties;
+ f->vkGetPhysicalDeviceProperties(qtPhysicalDevice, &deviceProperties);
+ if (deviceProperties.vendorID == 0x10DE) {
+ // FIXME: This is a workaround for Nvidia driver.
+ // The imported image is empty if the initialLayout is not
+ // VK_IMAGE_LAYOUT_PREINITIALIZED.
+ imageLayout = VK_IMAGE_LAYOUT_PREINITIALIZED;
+ }
+
+ VkExternalMemoryImageCreateInfoKHR externalMemoryImageCreateInfo = {
+ VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_KHR
+ };
+#if defined(USE_OZONE)
+ VkSubresourceLayout planeLayout = {};
+ VkImageDrmFormatModifierExplicitCreateInfoEXT modifierInfo = {
+ VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_EXPLICIT_CREATE_INFO_EXT
+ };
+ base::ScopedFD scopedFd;
+
+ if (nativePixmap) {
+ gfx::NativePixmapHandle nativePixmapHandle = nativePixmap->ExportHandle();
+ if (nativePixmapHandle.planes.size() != 1)
+ qFatal("VULKAN: Multiple planes are not supported.");
+
+ planeLayout.offset = nativePixmapHandle.planes[0].offset;
+ planeLayout.size = 0;
+ planeLayout.rowPitch = nativePixmapHandle.planes[0].stride;
+ planeLayout.arrayPitch = 0;
+ planeLayout.depthPitch = 0;
+
+ modifierInfo.drmFormatModifier = nativePixmapHandle.modifier;
+ modifierInfo.drmFormatModifierPlaneCount = 1;
+ modifierInfo.pPlaneLayouts = &planeLayout;
+
+ externalMemoryImageCreateInfo.pNext = &modifierInfo;
+ externalMemoryImageCreateInfo.handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT;
+
+ scopedFd = std::move(nativePixmapHandle.planes[0].fd);
+ } else {
+ externalMemoryImageCreateInfo.pNext = nullptr;
+ externalMemoryImageCreateInfo.handleTypes =
+ VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR;
+
+ VkMemoryGetFdInfoKHR exportInfo = { VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR };
+ exportInfo.pNext = nullptr;
+ exportInfo.memory = vkImageInfo.fAlloc.fMemory;
+ exportInfo.handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR;
+
+ gpu::VulkanFunctionPointers *vfp = gpu::GetVulkanFunctionPointers();
+ gpu::VulkanDeviceQueue *vulkanDeviceQueue =
+ m_contextState->vk_context_provider()->GetDeviceQueue();
+ VkDevice vulkanDevice = vulkanDeviceQueue->GetVulkanDevice();
+
+ int fd = -1;
+ if (vfp->vkGetMemoryFdKHR(vulkanDevice, &exportInfo, &fd) != VK_SUCCESS)
+ qFatal("VULKAN: Unable to extract file descriptor out of external VkImage.");
+
+ scopedFd.reset(fd);
+ }
+
+ if (!scopedFd.is_valid())
+ qFatal("VULKAN: Unable to extract file descriptor.");
+#elif defined(Q_OS_WIN)
+ externalMemoryImageCreateInfo.pNext = nullptr;
+ externalMemoryImageCreateInfo.handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT;
+
+ HRESULT status = S_OK;
+ HANDLE sharedHandle = nullptr;
+ IDXGIResource1 *resource = nullptr;
+ if (!overlayImage->nv12_texture()) {
+ qWarning("VULKAN: No D3D texture.");
+ return nullptr;
+ }
+ status = overlayImage->nv12_texture()->QueryInterface(__uuidof(IDXGIResource1),
+ (void **)&resource);
+ Q_ASSERT(status == S_OK);
+ status = resource->CreateSharedHandle(NULL, DXGI_SHARED_RESOURCE_READ, NULL, &sharedHandle);
+ Q_ASSERT(status == S_OK);
+
+ if (!sharedHandle)
+ qFatal("VULKAN: Unable to extract shared handle.");
+#endif
+
+ constexpr VkImageUsageFlags kUsage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
+ | VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT
+ | VK_IMAGE_USAGE_TRANSFER_SRC_BIT;
+
+ VkImageCreateInfo importedImageCreateInfo = { VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO };
+ importedImageCreateInfo.pNext = &externalMemoryImageCreateInfo;
+ importedImageCreateInfo.flags = 0;
+ importedImageCreateInfo.imageType = VK_IMAGE_TYPE_2D;
+ importedImageCreateInfo.format = gpu::ToVkFormat(m_frontBuffer->sharedImageFormat());
+ importedImageCreateInfo.extent.width = static_cast<uint32_t>(size().width());
+ importedImageCreateInfo.extent.height = static_cast<uint32_t>(size().height());
+ importedImageCreateInfo.extent.depth = 1;
+ importedImageCreateInfo.mipLevels = 1;
+ importedImageCreateInfo.arrayLayers = 1;
+ importedImageCreateInfo.samples = VK_SAMPLE_COUNT_1_BIT;
+ importedImageCreateInfo.tiling = VK_IMAGE_TILING_OPTIMAL;
+ importedImageCreateInfo.usage = kUsage;
+ importedImageCreateInfo.sharingMode = VK_SHARING_MODE_EXCLUSIVE;
+ importedImageCreateInfo.queueFamilyIndexCount = 0;
+ importedImageCreateInfo.pQueueFamilyIndices = nullptr;
+ importedImageCreateInfo.initialLayout = imageLayout;
+
+#if defined(USE_OZONE)
+ if (nativePixmap)
+ importedImageCreateInfo.tiling = VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT;
+ else
+ importedImageCreateInfo.tiling = vkImageInfo.fImageTiling;
+#endif
+
+ VkResult result;
+ VkImage importedImage = VK_NULL_HANDLE;
+ result = df->vkCreateImage(qtVulkanDevice, &importedImageCreateInfo, nullptr /* pAllocator */,
+ &importedImage);
+ if (result != VK_SUCCESS)
+ qFatal() << "VULKAN: vkCreateImage failed result:" << result;
+
+#if defined(USE_OZONE)
+ VkImportMemoryFdInfoKHR importMemoryHandleInfo = {
+ VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR
+ };
+ importMemoryHandleInfo.handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR;
+ importMemoryHandleInfo.fd = scopedFd.release();
+
+ if (nativePixmap)
+ importMemoryHandleInfo.handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT;
+#elif defined(Q_OS_WIN)
+ VkImportMemoryWin32HandleInfoKHR importMemoryHandleInfo = {
+ VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR
+ };
+ importMemoryHandleInfo.pNext = nullptr;
+ importMemoryHandleInfo.handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT;
+ importMemoryHandleInfo.handle = sharedHandle;
+#endif
+
+ VkMemoryDedicatedAllocateInfoKHR dedicatedMemoryInfo = {
+ VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_KHR
+ };
+ dedicatedMemoryInfo.pNext = &importMemoryHandleInfo;
+ dedicatedMemoryInfo.image = importedImage;
+
+ VkMemoryAllocateInfo memoryAllocateInfo = { VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO };
+ memoryAllocateInfo.pNext = &dedicatedMemoryInfo;
+
+ VkMemoryRequirements requirements;
+ df->vkGetImageMemoryRequirements(qtVulkanDevice, importedImage, &requirements);
+ if (!requirements.memoryTypeBits)
+ qFatal("VULKAN: vkGetImageMemoryRequirements failed.");
+
+ VkPhysicalDeviceMemoryProperties memoryProperties;
+ f->vkGetPhysicalDeviceMemoryProperties(qtPhysicalDevice, &memoryProperties);
+ constexpr VkMemoryPropertyFlags flags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
+ constexpr uint32_t kMaxIndex = 31;
+ uint32_t memoryTypeIndex = kMaxIndex + 1;
+ for (uint32_t i = 0; i <= kMaxIndex; i++) {
+ if (((1u << i) & requirements.memoryTypeBits) == 0)
+ continue;
+ if ((memoryProperties.memoryTypes[i].propertyFlags & flags) != flags)
+ continue;
+ memoryTypeIndex = i;
+ break;
+ }
+
+ if (memoryTypeIndex > kMaxIndex)
+ qFatal("VULKAN: Cannot find valid memory type index.");
+
+ memoryAllocateInfo.allocationSize = requirements.size;
+ memoryAllocateInfo.memoryTypeIndex = memoryTypeIndex;
+
+ VkDeviceMemory importedImageMemory = VK_NULL_HANDLE;
+ result = df->vkAllocateMemory(qtVulkanDevice, &memoryAllocateInfo, nullptr /* pAllocator */,
+ &importedImageMemory);
+ if (result != VK_SUCCESS)
+ qFatal() << "VULKAN: vkAllocateMemory failed result:" << result;
+
+ df->vkBindImageMemory(qtVulkanDevice, importedImage, importedImageMemory, 0);
+
+ QQuickWindow::CreateTextureOptions texOpts(textureOptions);
+ QSGTexture *texture = QNativeInterface::QSGVulkanTexture::fromNative(importedImage, imageLayout,
+ win, size(), texOpts);
+
+ m_frontBuffer->textureCleanupCallback = [=]() {
+ df->vkDestroyImage(qtVulkanDevice, importedImage, nullptr);
+ df->vkFreeMemory(qtVulkanDevice, importedImageMemory, nullptr);
+#if defined(Q_OS_WIN)
+ ::CloseHandle(sharedHandle);
+#endif
+ };
+
+ return texture;
+}
+
+} // namespace QtWebEngineCore
diff --git a/src/core/compositor/native_skia_output_device_vulkan.h b/src/core/compositor/native_skia_output_device_vulkan.h
new file mode 100644
index 000000000..bead0cc11
--- /dev/null
+++ b/src/core/compositor/native_skia_output_device_vulkan.h
@@ -0,0 +1,28 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef NATIVE_SKIA_OUTPUT_DEVICE_VULKAN_H
+#define NATIVE_SKIA_OUTPUT_DEVICE_VULKAN_H
+
+#include "native_skia_output_device.h"
+
+namespace QtWebEngineCore {
+
+class NativeSkiaOutputDeviceVulkan final : public NativeSkiaOutputDevice
+{
+public:
+ NativeSkiaOutputDeviceVulkan(
+ scoped_refptr<gpu::SharedContextState> contextState, bool requiresAlpha,
+ gpu::MemoryTracker *memoryTracker, viz::SkiaOutputSurfaceDependency *dependency,
+ gpu::SharedImageFactory *shared_image_factory,
+ gpu::SharedImageRepresentationFactory *shared_image_representation_factory,
+ DidSwapBufferCompleteCallback didSwapBufferCompleteCallback);
+ ~NativeSkiaOutputDeviceVulkan() override;
+
+ // Overridden from Compositor:
+ QSGTexture *texture(QQuickWindow *win, uint32_t textureOptions) override;
+};
+
+} // namespace QtWebEngineCore
+
+#endif // NATIVE_SKIA_OUTPUT_DEVICE_VULKAN_H
diff --git a/src/core/compositor/stream_video_node.cpp b/src/core/compositor/stream_video_node.cpp
deleted file mode 100644
index fb9501f24..000000000
--- a/src/core/compositor/stream_video_node.cpp
+++ /dev/null
@@ -1,169 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "stream_video_node.h"
-
-#include <QtQuick/qsgtexture.h>
-
-namespace QtWebEngineCore {
-
-class StreamVideoMaterialShader : public QSGMaterialShader
-{
-public:
- StreamVideoMaterialShader(TextureTarget target) : m_target(target) { }
- virtual void updateState(const RenderState &state, QSGMaterial *newMaterial, QSGMaterial *oldMaterial) override;
-
- char const *const *attributeNames() const override {
- static const char *names[] = {
- "a_position",
- "a_texCoord",
- 0
- };
- return names;
- }
-
-protected:
- const char *vertexShader() const override {
- // Keep in sync with cc::VertexShaderVideoTransform
- static const char *shader =
- "attribute highp vec4 a_position;\n"
- "attribute mediump vec2 a_texCoord;\n"
- "uniform highp mat4 matrix;\n"
- "uniform highp mat4 texMatrix;\n"
- "varying mediump vec2 v_texCoord;\n"
- "void main() {\n"
- " gl_Position = matrix * a_position;\n"
- " v_texCoord = vec4(texMatrix * vec4(a_texCoord.x, 1.0 - a_texCoord.y, 0.0, 1.0)).xy;\n"
- "}";
- return shader;
- }
-
- const char *fragmentShader() const override {
- // Keep in sync with cc::FragmentShaderRGBATexAlpha
- static const char *shaderExternal =
- "#extension GL_OES_EGL_image_external : require\n"
- "varying mediump vec2 v_texCoord;\n"
- "uniform samplerExternalOES s_texture;\n"
- "uniform lowp float alpha;\n"
- "void main() {\n"
- " lowp vec4 texColor = texture2D(s_texture, v_texCoord);\n"
- " gl_FragColor = texColor * alpha;\n"
- "}";
- static const char *shader2DRect =
- "#extension GL_ARB_texture_rectangle : require\n"
- "varying mediump vec2 v_texCoord;\n"
- "uniform sampler2DRect s_texture;\n"
- "uniform lowp float alpha;\n"
- "void main() {\n"
- " lowp vec4 texColor = texture2DRect(s_texture, v_texCoord);\n"
- " gl_FragColor = texColor * alpha;\n"
- "}";
- if (m_target == ExternalTarget)
- return shaderExternal;
- else
- return shader2DRect;
- }
-
- virtual void initialize() override {
- m_id_matrix = program()->uniformLocation("matrix");
- m_id_sTexture = program()->uniformLocation("s_texture");
- m_id_texMatrix = program()->uniformLocation("texMatrix");
- m_id_opacity = program()->uniformLocation("alpha");
- }
-
- int m_id_matrix;
- int m_id_texMatrix;
- int m_id_sTexture;
- int m_id_opacity;
- TextureTarget m_target;
-};
-
-void StreamVideoMaterialShader::updateState(const RenderState &state, QSGMaterial *newMaterial, QSGMaterial *oldMaterial)
-{
- Q_UNUSED(oldMaterial);
-
- StreamVideoMaterial *mat = static_cast<StreamVideoMaterial *>(newMaterial);
- program()->setUniformValue(m_id_sTexture, 0);
-
- mat->m_texture->bind();
-
- if (state.isOpacityDirty())
- program()->setUniformValue(m_id_opacity, state.opacity());
-
- if (state.isMatrixDirty())
- program()->setUniformValue(m_id_matrix, state.combinedMatrix());
-
- program()->setUniformValue(m_id_texMatrix, mat->m_texMatrix);
-}
-
-StreamVideoMaterial::StreamVideoMaterial(QSGTexture *texture, TextureTarget target)
- : m_texture(texture)
- , m_target(target)
-{
-}
-
-QSGMaterialShader *StreamVideoMaterial::createShader() const
-{
- return new StreamVideoMaterialShader(m_target);
-}
-
-StreamVideoNode::StreamVideoNode(QSGTexture *texture, bool flip, TextureTarget target)
- : m_geometry(QSGGeometry::defaultAttributes_TexturedPoint2D(), 4)
- , m_flip(flip)
-{
- setGeometry(&m_geometry);
- setFlag(QSGNode::OwnsMaterial);
- m_material = new StreamVideoMaterial(texture, target);
- setMaterial(m_material);
-}
-
-void StreamVideoNode::setRect(const QRectF &rect)
-{
- if (m_flip)
- QSGGeometry::updateTexturedRectGeometry(geometry(), rect, QRectF(0, 1, 1, -1));
- else
- QSGGeometry::updateTexturedRectGeometry(geometry(), rect, QRectF(0, 0, 1, 1));
-}
-
-void StreamVideoNode::setTextureMatrix(const QMatrix4x4 &matrix)
-{
- m_material->m_texMatrix = matrix;
-}
-
-} // namespace
diff --git a/src/core/compositor/stream_video_node.h b/src/core/compositor/stream_video_node.h
deleted file mode 100644
index 9d937791f..000000000
--- a/src/core/compositor/stream_video_node.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef STREAM_VIDEO_NODE_H
-#define STREAM_VIDEO_NODE_H
-
-#include <QtQuick/qsgmaterial.h>
-#include <QtQuick/qsgnode.h>
-
-QT_FORWARD_DECLARE_CLASS(QSGTexture)
-
-namespace QtWebEngineCore {
-
-// These classes duplicate, QtQuick style, the logic of GLRenderer::DrawStreamVideoQuad.
-// Their behavior should stay as close as possible to GLRenderer.
-
-enum TextureTarget { ExternalTarget, RectangleTarget };
-
-class StreamVideoMaterial : public QSGMaterial
-{
-public:
- StreamVideoMaterial(QSGTexture *texture, TextureTarget target);
-
- QSGMaterialType *type() const override
- {
- static QSGMaterialType theType;
- return &theType;
- }
-
- QSGMaterialShader *createShader() const override;
-
- QSGTexture *m_texture;
- QMatrix4x4 m_texMatrix;
- TextureTarget m_target;
-};
-
-class StreamVideoNode : public QSGGeometryNode
-{
-public:
- StreamVideoNode(QSGTexture *texture, bool flip, TextureTarget target);
- void setRect(const QRectF &rect);
- void setTextureMatrix(const QMatrix4x4 &matrix);
-
-private:
- QSGGeometry m_geometry;
- bool m_flip;
- StreamVideoMaterial *m_material;
-};
-
-} // namespace
-
-#endif // STREAM_VIDEO_NODE_H
diff --git a/src/core/compositor/vulkan_implementation_qt.cpp b/src/core/compositor/vulkan_implementation_qt.cpp
new file mode 100644
index 000000000..2f2259666
--- /dev/null
+++ b/src/core/compositor/vulkan_implementation_qt.cpp
@@ -0,0 +1,162 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "vulkan_implementation_qt.h"
+
+#include "base/environment.h"
+#include "base/logging.h"
+#include "gpu/vulkan/vulkan_image.h"
+#include "gpu/vulkan/vulkan_surface.h"
+#include "gpu/vulkan/vulkan_util.h"
+#include "ui/gfx/gpu_fence.h"
+
+#include <vulkan/vulkan.h>
+
+namespace gpu {
+
+VulkanImplementationQt::VulkanImplementationQt() : VulkanImplementation(false) { }
+
+VulkanImplementationQt::~VulkanImplementationQt() = default;
+
+bool VulkanImplementationQt::InitializeVulkanInstance(bool /*using_surface*/)
+{
+ std::vector<const char *> required_extensions = {
+ VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME,
+ VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME,
+ };
+
+ auto env = base::Environment::Create();
+ std::string vulkan_path;
+ if (!env->GetVar("QT_VULKAN_LIB", &vulkan_path)) {
+#if BUILDFLAG(IS_WIN)
+ vulkan_path = "vulkan-1.dll";
+#else
+ vulkan_path = "libvulkan.so.1";
+#endif
+ }
+
+ if (!vulkan_instance_.Initialize(base::FilePath::FromUTF8Unsafe(vulkan_path),
+ required_extensions, {})) {
+ LOG(ERROR) << "Failed to initialize vulkan instance";
+ return false;
+ }
+
+ return true;
+}
+
+VulkanInstance *VulkanImplementationQt::GetVulkanInstance()
+{
+ return &vulkan_instance_;
+}
+
+std::unique_ptr<VulkanSurface>
+VulkanImplementationQt::CreateViewSurface(gfx::AcceleratedWidget /*window*/)
+{
+ NOTREACHED();
+ return nullptr;
+}
+
+bool VulkanImplementationQt::GetPhysicalDevicePresentationSupport(
+ VkPhysicalDevice /*device*/,
+ const std::vector<VkQueueFamilyProperties> & /*queue_family_properties*/,
+ uint32_t /*queue_family_index*/)
+{
+ NOTREACHED();
+ return true;
+}
+
+std::vector<const char *> VulkanImplementationQt::GetRequiredDeviceExtensions()
+{
+ return {
+ VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME,
+#if BUILDFLAG(IS_WIN)
+ VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME,
+#else
+ VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME,
+#endif
+ };
+}
+
+std::vector<const char *> VulkanImplementationQt::GetOptionalDeviceExtensions()
+{
+ return {
+ VK_KHR_EXTERNAL_SEMAPHORE_EXTENSION_NAME,
+#if BUILDFLAG(IS_WIN)
+ VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME,
+#else
+ VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME,
+ VK_KHR_IMAGE_FORMAT_LIST_EXTENSION_NAME,
+ VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_EXTENSION_NAME,
+ VK_EXT_EXTERNAL_MEMORY_DMA_BUF_EXTENSION_NAME,
+#endif
+ };
+}
+
+VkFence VulkanImplementationQt::CreateVkFenceForGpuFence(VkDevice /*vk_device*/)
+{
+ NOTREACHED();
+ return VK_NULL_HANDLE;
+}
+
+std::unique_ptr<gfx::GpuFence>
+VulkanImplementationQt::ExportVkFenceToGpuFence(VkDevice /*vk_device*/, VkFence /*vk_fence*/)
+{
+ NOTREACHED();
+ return nullptr;
+}
+
+VkSemaphore VulkanImplementationQt::ImportSemaphoreHandle(VkDevice vk_device,
+ SemaphoreHandle sync_handle)
+{
+ return ImportVkSemaphoreHandle(vk_device, std::move(sync_handle));
+}
+
+VkExternalSemaphoreHandleTypeFlagBits VulkanImplementationQt::GetExternalSemaphoreHandleType()
+{
+#if BUILDFLAG(IS_WIN)
+ return VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT;
+#else
+ return VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT;
+#endif
+}
+
+bool VulkanImplementationQt::CanImportGpuMemoryBuffer(
+ VulkanDeviceQueue *device_queue,
+ gfx::GpuMemoryBufferType memory_buffer_type)
+{
+#if BUILDFLAG(IS_LINUX)
+ const auto &enabled_extensions = device_queue->enabled_extensions();
+ return gfx::HasExtension(enabled_extensions,
+ VK_EXT_EXTERNAL_MEMORY_DMA_BUF_EXTENSION_NAME) &&
+ gfx::HasExtension(enabled_extensions,
+ VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_EXTENSION_NAME) &&
+ memory_buffer_type == gfx::GpuMemoryBufferType::NATIVE_PIXMAP;
+#else
+ return false;
+#endif
+}
+
+std::unique_ptr<VulkanImage> VulkanImplementationQt::CreateImageFromGpuMemoryHandle(VulkanDeviceQueue *device_queue,
+ gfx::GpuMemoryBufferHandle gmb_handle,
+ gfx::Size size,
+ VkFormat vk_format,
+ const gfx::ColorSpace &)
+{
+#if BUILDFLAG(IS_LINUX)
+ constexpr auto kUsage =
+ VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_SAMPLED_BIT |
+ VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT;
+ auto tiling = gmb_handle.native_pixmap_handle.modifier ==
+ gfx::NativePixmapHandle::kNoModifier
+ ? VK_IMAGE_TILING_OPTIMAL
+ : VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT;
+ return gpu::VulkanImage::CreateFromGpuMemoryBufferHandle(
+ device_queue, std::move(gmb_handle), size, vk_format, kUsage, /*flags=*/0,
+ tiling, VK_QUEUE_FAMILY_EXTERNAL);
+#else
+ NOTIMPLEMENTED();
+ return nullptr;
+#endif
+}
+
+} // namespace gpu
diff --git a/src/core/compositor/vulkan_implementation_qt.h b/src/core/compositor/vulkan_implementation_qt.h
new file mode 100644
index 000000000..88983331f
--- /dev/null
+++ b/src/core/compositor/vulkan_implementation_qt.h
@@ -0,0 +1,46 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef VULKAN_IMPLEMENTATION_QT_H
+#define VULKAN_IMPLEMENTATION_QT_H
+
+#include "gpu/vulkan/vulkan_implementation.h"
+#include "gpu/vulkan/vulkan_instance.h"
+
+namespace gpu {
+
+class VulkanImplementationQt : public VulkanImplementation
+{
+public:
+ VulkanImplementationQt();
+ ~VulkanImplementationQt() override;
+
+ // Overridden from VulkanImplementation.
+ bool InitializeVulkanInstance(bool using_surface) override;
+ VulkanInstance *GetVulkanInstance() override;
+ std::unique_ptr<VulkanSurface> CreateViewSurface(gfx::AcceleratedWidget window) override;
+ bool GetPhysicalDevicePresentationSupport(
+ VkPhysicalDevice device,
+ const std::vector<VkQueueFamilyProperties> &queue_family_properties,
+ uint32_t queue_family_index) override;
+ std::vector<const char *> GetRequiredDeviceExtensions() override;
+ std::vector<const char *> GetOptionalDeviceExtensions() override;
+ VkFence CreateVkFenceForGpuFence(VkDevice vk_device) override;
+ std::unique_ptr<gfx::GpuFence> ExportVkFenceToGpuFence(VkDevice vk_device,
+ VkFence vk_fence) override;
+ VkSemaphore ImportSemaphoreHandle(VkDevice vk_device, SemaphoreHandle handle) override;
+ VkExternalSemaphoreHandleTypeFlagBits GetExternalSemaphoreHandleType() override;
+ bool CanImportGpuMemoryBuffer(VulkanDeviceQueue* device_queue,
+ gfx::GpuMemoryBufferType memory_buffer_type) override;
+ std::unique_ptr<VulkanImage> CreateImageFromGpuMemoryHandle(VulkanDeviceQueue *device_queue,
+ gfx::GpuMemoryBufferHandle gmb_handle,
+ gfx::Size size, VkFormat vk_format,
+ const gfx::ColorSpace &color_space) override;
+
+private:
+ VulkanInstance vulkan_instance_;
+};
+
+} // namespace gpu
+
+#endif // VULKAN_IMPLEMENTATION_QT_H
diff --git a/src/core/compositor/yuv_video_node.cpp b/src/core/compositor/yuv_video_node.cpp
deleted file mode 100644
index 4a436d952..000000000
--- a/src/core/compositor/yuv_video_node.cpp
+++ /dev/null
@@ -1,352 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-// Based on cc/output/gl_renderer.cc and cc/output/shader.cc:
-// Copyright 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE.Chromium file.
-
-#include "yuv_video_node.h"
-
-#include <QtGui/qopenglcontext.h>
-#include <QtGui/qopenglfunctions.h>
-#include <QtQuick/qsgtexture.h>
-
-#include "ui/gfx/color_space.h"
-#include "ui/gfx/color_transform.h"
-
-namespace QtWebEngineCore {
-
-class YUVVideoMaterialShader : public QSGMaterialShader
-{
-public:
- YUVVideoMaterialShader(const gfx::ColorSpace &colorSpace)
- {
- static const char *shaderHead =
- "varying mediump vec2 v_yaTexCoord;\n"
- "varying mediump vec2 v_uvTexCoord;\n"
- "uniform sampler2D y_texture;\n"
- "uniform sampler2D u_texture;\n"
- "uniform sampler2D v_texture;\n"
- "uniform mediump float alpha;\n"
- "uniform mediump vec4 ya_clamp_rect;\n"
- "uniform mediump vec4 uv_clamp_rect;\n";
- static const char *shader =
- "void main() {\n"
- " mediump vec2 ya_clamped =\n"
- " max(ya_clamp_rect.xy, min(ya_clamp_rect.zw, v_yaTexCoord));\n"
- " mediump float y_raw = texture2D(y_texture, ya_clamped).x;\n"
- " mediump vec2 uv_clamped =\n"
- " max(uv_clamp_rect.xy, min(uv_clamp_rect.zw, v_uvTexCoord));\n"
- " mediump float u_unsigned = texture2D(u_texture, uv_clamped).x;\n"
- " mediump float v_unsigned = texture2D(v_texture, uv_clamped).x;\n"
- " mediump vec3 yuv = vec3(y_raw, u_unsigned, v_unsigned);\n"
- " mediump vec3 rgb = DoColorConversion(yuv);\n"
- " gl_FragColor = vec4(rgb, 1.0) * alpha;\n"
- "}";
- // Invalid or unspecified color spaces should be treated as REC709.
- gfx::ColorSpace src = colorSpace.IsValid() ? colorSpace : gfx::ColorSpace::CreateREC709();
- gfx::ColorSpace dst = gfx::ColorSpace::CreateSRGB();
- std::unique_ptr<gfx::ColorTransform> transform =
- gfx::ColorTransform::NewColorTransform(src, dst, gfx::ColorTransform::Intent::INTENT_PERCEPTUAL);
-
- QByteArray header(shaderHead);
- if (QOpenGLContext::currentContext()->isOpenGLES())
- header = QByteArray("precision mediump float;\n") + header;
-
- m_csShader = QByteArray::fromStdString(transform->GetShaderSource());
- m_fragmentShader = header + m_csShader + QByteArray(shader);
- }
- void updateState(const RenderState &state, QSGMaterial *newMaterial, QSGMaterial *oldMaterial) override;
-
- char const *const *attributeNames() const override {
- static const char *names[] = {
- "a_position",
- "a_texCoord",
- 0
- };
- return names;
- }
-
-protected:
- const char *vertexShader() const override {
- // Keep in sync with logic in VertexShader in components/viz/service/display/shader.cc
- const char *shader =
- "attribute highp vec4 a_position;\n"
- "attribute mediump vec2 a_texCoord;\n"
- "uniform highp mat4 matrix;\n"
- "varying mediump vec2 v_yaTexCoord;\n"
- "varying mediump vec2 v_uvTexCoord;\n"
- "uniform mediump vec2 yaTexScale;\n"
- "uniform mediump vec2 yaTexOffset;\n"
- "uniform mediump vec2 uvTexScale;\n"
- "uniform mediump vec2 uvTexOffset;\n"
- "void main() {\n"
- " gl_Position = matrix * a_position;\n"
- " v_yaTexCoord = a_texCoord * yaTexScale + yaTexOffset;\n"
- " v_uvTexCoord = a_texCoord * uvTexScale + uvTexOffset;\n"
- "}";
- return shader;
- }
-
- const char *fragmentShader() const override {
- return m_fragmentShader.constData();
- }
-
- void initialize() override {
- m_id_matrix = program()->uniformLocation("matrix");
- m_id_yaTexScale = program()->uniformLocation("yaTexScale");
- m_id_uvTexScale = program()->uniformLocation("uvTexScale");
- m_id_yaTexOffset = program()->uniformLocation("yaTexOffset");
- m_id_uvTexOffset = program()->uniformLocation("uvTexOffset");
- m_id_yaClampRect = program()->uniformLocation("ya_clamp_rect");
- m_id_uvClampRect = program()->uniformLocation("uv_clamp_rect");
- m_id_yTexture = program()->uniformLocation("y_texture");
- m_id_uTexture = program()->uniformLocation("u_texture");
- m_id_vTexture = program()->uniformLocation("v_texture");
- m_id_yuvMatrix = program()->uniformLocation("yuv_matrix");
- m_id_yuvAdjust = program()->uniformLocation("yuv_adj");
- m_id_opacity = program()->uniformLocation("alpha");
- }
-
- int m_id_matrix;
- int m_id_yaTexScale;
- int m_id_uvTexScale;
- int m_id_yaTexOffset;
- int m_id_uvTexOffset;
- int m_id_yaClampRect;
- int m_id_uvClampRect;
- int m_id_yTexture;
- int m_id_uTexture;
- int m_id_vTexture;
- int m_id_yuvMatrix;
- int m_id_yuvAdjust;
- int m_id_opacity;
- QByteArray m_csShader;
- QByteArray m_fragmentShader;
-};
-
-class YUVAVideoMaterialShader : public YUVVideoMaterialShader
-{
-public:
- YUVAVideoMaterialShader(const gfx::ColorSpace &colorSpace) : YUVVideoMaterialShader(colorSpace)
- {
- static const char *shaderHead =
- "varying mediump vec2 v_yaTexCoord;\n"
- "varying mediump vec2 v_uvTexCoord;\n"
- "uniform sampler2D y_texture;\n"
- "uniform sampler2D u_texture;\n"
- "uniform sampler2D v_texture;\n"
- "uniform sampler2D a_texture;\n"
- "uniform mediump float alpha;\n"
- "uniform mediump vec4 ya_clamp_rect;\n"
- "uniform mediump vec4 uv_clamp_rect;\n";
- static const char *shader =
- "void main() {\n"
- " mediump vec2 ya_clamped =\n"
- " max(ya_clamp_rect.xy, min(ya_clamp_rect.zw, v_yaTexCoord));\n"
- " mediump float y_raw = texture2D(y_texture, ya_clamped).x;\n"
- " mediump vec2 uv_clamped =\n"
- " max(uv_clamp_rect.xy, min(uv_clamp_rect.zw, v_uvTexCoord));\n"
- " mediump float u_unsigned = texture2D(u_texture, uv_clamped).x;\n"
- " mediump float v_unsigned = texture2D(v_texture, uv_clamped).x;\n"
- " mediump float a_raw = texture2D(a_texture, ya_clamped).x;\n"
- " mediump vec3 yuv = vec3(y_raw, u_unsigned, v_unsigned);\n"
- " mediump vec3 rgb = DoColorConversion(yuv);\n"
- " gl_FragColor = vec4(rgb, 1.0) * (alpha * a_raw);\n"
- "}";
- QByteArray header(shaderHead);
- if (QOpenGLContext::currentContext()->isOpenGLES())
- header = QByteArray("precision mediump float;\n") + header;
- m_fragmentShader = header + m_csShader + QByteArray(shader);
- }
- void updateState(const RenderState &state, QSGMaterial *newMaterial, QSGMaterial *oldMaterial) override;
-
-protected:
- void initialize() override {
- // YUVVideoMaterialShader has a subset of the uniforms.
- YUVVideoMaterialShader::initialize();
- m_id_aTexture = program()->uniformLocation("a_texture");
- }
-
- int m_id_aTexture;
-};
-
-void YUVVideoMaterialShader::updateState(const RenderState &state, QSGMaterial *newMaterial, QSGMaterial *oldMaterial)
-{
- Q_UNUSED(oldMaterial);
-
- // Keep logic in sync with logic in GLRenderer::DrawYUVVideoQuad:
-
- YUVVideoMaterial *mat = static_cast<YUVVideoMaterial *>(newMaterial);
- program()->setUniformValue(m_id_yTexture, 0);
- program()->setUniformValue(m_id_uTexture, 1);
- program()->setUniformValue(m_id_vTexture, 2);
-
- QOpenGLFunctions glFuncs(QOpenGLContext::currentContext());
-
- glFuncs.glActiveTexture(GL_TEXTURE1);
- mat->m_uTexture->bind();
- glFuncs.glActiveTexture(GL_TEXTURE2);
- mat->m_vTexture->bind();
- glFuncs.glActiveTexture(GL_TEXTURE0); // Finish with 0 as default texture unit
- mat->m_yTexture->bind();
-
- const QSizeF yaSizeScale(1.0f / mat->m_yaTexSize.width(), 1.0f / mat->m_yaTexSize.height());
- const QSizeF uvSizeScale(1.0f / mat->m_uvTexSize.width(), 1.0f / mat->m_uvTexSize.height());
-
- const QPointF yaTexOffset(mat->m_yaTexCoordRect.left() * yaSizeScale.width(), mat->m_yaTexCoordRect.top() * yaSizeScale.height());
- const QPointF uvTexOffset(mat->m_uvTexCoordRect.left() * uvSizeScale.width(), mat->m_uvTexCoordRect.top() * uvSizeScale.height());
- const QSizeF yaTexScale(mat->m_yaTexCoordRect.width() * yaSizeScale.width(), mat->m_yaTexCoordRect.height() * yaSizeScale.height());
- const QSizeF uvTexScale(mat->m_uvTexCoordRect.width() * uvSizeScale.width(), mat->m_uvTexCoordRect.height() * uvSizeScale.height());
- program()->setUniformValue(m_id_yaTexOffset, yaTexOffset);
- program()->setUniformValue(m_id_uvTexOffset, uvTexOffset);
- program()->setUniformValue(m_id_yaTexScale, yaTexScale);
- program()->setUniformValue(m_id_uvTexScale, uvTexScale);
- QRectF yaClampRect(yaTexOffset, yaTexScale);
- QRectF uvClampRect(uvTexOffset, uvTexScale);
- yaClampRect = yaClampRect.marginsRemoved(QMarginsF(yaSizeScale.width() * 0.5f, yaSizeScale.height() * 0.5f,
- yaSizeScale.width() * 0.5f, yaSizeScale.height() * 0.5f));
- uvClampRect = uvClampRect.marginsRemoved(QMarginsF(uvSizeScale.width() * 0.5f, uvSizeScale.height() * 0.5f,
- uvSizeScale.width() * 0.5f, uvSizeScale.height() * 0.5f));
-
- const QVector4D yaClampV(yaClampRect.left(), yaClampRect.top(), yaClampRect.right(), yaClampRect.bottom());
- const QVector4D uvClampV(uvClampRect.left(), uvClampRect.top(), uvClampRect.right(), uvClampRect.bottom());
- program()->setUniformValue(m_id_yaClampRect, yaClampV);
- program()->setUniformValue(m_id_uvClampRect, uvClampV);
-
- if (state.isOpacityDirty())
- program()->setUniformValue(m_id_opacity, state.opacity());
-
- if (state.isMatrixDirty())
- program()->setUniformValue(m_id_matrix, state.combinedMatrix());
-}
-
-void YUVAVideoMaterialShader::updateState(const RenderState &state, QSGMaterial *newMaterial, QSGMaterial *oldMaterial)
-{
- YUVVideoMaterialShader::updateState(state, newMaterial, oldMaterial);
-
- YUVAVideoMaterial *mat = static_cast<YUVAVideoMaterial *>(newMaterial);
- program()->setUniformValue(m_id_aTexture, 3);
-
- QOpenGLFunctions glFuncs(QOpenGLContext::currentContext());
-
- glFuncs.glActiveTexture(GL_TEXTURE3);
- mat->m_aTexture->bind();
-
- // Reset the default texture unit.
- glFuncs.glActiveTexture(GL_TEXTURE0);
-}
-
-
-YUVVideoMaterial::YUVVideoMaterial(QSGTexture *yTexture, QSGTexture *uTexture, QSGTexture *vTexture,
- const QRectF &yaTexCoordRect, const QRectF &uvTexCoordRect, const QSizeF &yaTexSize, const QSizeF &uvTexSize,
- const gfx::ColorSpace &colorspace,
- float rMul, float rOff)
- : m_yTexture(yTexture)
- , m_uTexture(uTexture)
- , m_vTexture(vTexture)
- , m_yaTexCoordRect(yaTexCoordRect)
- , m_uvTexCoordRect(uvTexCoordRect)
- , m_yaTexSize(yaTexSize)
- , m_uvTexSize(uvTexSize)
- , m_colorSpace(colorspace)
- , m_resourceMultiplier(rMul)
- , m_resourceOffset(rOff)
-{
-}
-
-QSGMaterialShader *YUVVideoMaterial::createShader() const
-{
- return new YUVVideoMaterialShader(m_colorSpace);
-}
-
-int YUVVideoMaterial::compare(const QSGMaterial *other) const
-{
- const YUVVideoMaterial *m = static_cast<const YUVVideoMaterial *>(other);
- if (int diff = m_yTexture->textureId() - m->m_yTexture->textureId())
- return diff;
- if (int diff = m_uTexture->textureId() - m->m_uTexture->textureId())
- return diff;
- return m_vTexture->textureId() - m->m_vTexture->textureId();
-}
-
-YUVAVideoMaterial::YUVAVideoMaterial(QSGTexture *yTexture, QSGTexture *uTexture, QSGTexture *vTexture, QSGTexture *aTexture,
- const QRectF &yaTexCoordRect, const QRectF &uvTexCoordRect, const QSizeF &yaTexSize, const QSizeF &uvTexSize,
- const gfx::ColorSpace &colorspace,
- float rMul, float rOff)
- : YUVVideoMaterial(yTexture, uTexture, vTexture, yaTexCoordRect, uvTexCoordRect, yaTexSize, uvTexSize, colorspace, rMul, rOff)
- , m_aTexture(aTexture)
-{
- setFlag(Blending, aTexture);
-}
-
-QSGMaterialShader *YUVAVideoMaterial::createShader() const
-{
- return new YUVAVideoMaterialShader(m_colorSpace);
-}
-
-int YUVAVideoMaterial::compare(const QSGMaterial *other) const
-{
- if (int diff = YUVVideoMaterial::compare(other))
- return diff;
- const YUVAVideoMaterial *m = static_cast<const YUVAVideoMaterial *>(other);
- return (m_aTexture ? m_aTexture->textureId() : 0) - (m->m_aTexture ? m->m_aTexture->textureId() : 0);
-}
-
-YUVVideoNode::YUVVideoNode(QSGTexture *yTexture, QSGTexture *uTexture, QSGTexture *vTexture, QSGTexture *aTexture,
- const QRectF &yaTexCoordRect, const QRectF &uvTexCoordRect, const QSizeF &yaTexSize, const QSizeF &uvTexSize,
- const gfx::ColorSpace &colorspace, float rMul, float rOff)
- : m_geometry(QSGGeometry::defaultAttributes_TexturedPoint2D(), 4)
-{
- setGeometry(&m_geometry);
- setFlag(QSGNode::OwnsMaterial);
- if (aTexture)
- m_material = new YUVAVideoMaterial(yTexture, uTexture, vTexture, aTexture, yaTexCoordRect, uvTexCoordRect, yaTexSize, uvTexSize, colorspace, rMul, rOff);
- else
- m_material = new YUVVideoMaterial(yTexture, uTexture, vTexture, yaTexCoordRect, uvTexCoordRect, yaTexSize, uvTexSize, colorspace, rMul, rOff);
- setMaterial(m_material);
-}
-
-void YUVVideoNode::setRect(const QRectF &rect)
-{
- QSGGeometry::updateTexturedRectGeometry(geometry(), rect, QRectF(0, 0, 1, 1));
-}
-
-} // namespace
diff --git a/src/core/compositor/yuv_video_node.h b/src/core/compositor/yuv_video_node.h
deleted file mode 100644
index dca8fa5e2..000000000
--- a/src/core/compositor/yuv_video_node.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef YUV_VIDEO_NODE_H
-#define YUV_VIDEO_NODE_H
-
-#include <QtQuick/qsgmaterial.h>
-#include <QtQuick/qsgnode.h>
-
-#include "ui/gfx/color_space.h"
-
-QT_FORWARD_DECLARE_CLASS(QSGTexture)
-
-namespace QtWebEngineCore {
-
-// These classes duplicate, QtQuick style, the logic of GLRenderer::DrawYUVVideoQuad.
-// Their behavior should stay as close as possible to GLRenderer.
-
-class YUVVideoMaterial : public QSGMaterial
-{
-public:
- YUVVideoMaterial(QSGTexture *yTexture, QSGTexture *uTexture, QSGTexture *vTexture,
- const QRectF &yaTexCoordRect, const QRectF &uvTexCoordRect, const QSizeF &yaTexSize, const QSizeF &uvTexSize,
- const gfx::ColorSpace &colorspace, float rMul, float rOff);
-
- QSGMaterialType *type() const override
- {
- static QSGMaterialType theType;
- return &theType;
- }
-
- QSGMaterialShader *createShader() const override;
- int compare(const QSGMaterial *other) const override;
-
- QSGTexture *m_yTexture;
- QSGTexture *m_uTexture;
- QSGTexture *m_vTexture;
- QRectF m_yaTexCoordRect;
- QRectF m_uvTexCoordRect;
- QSizeF m_yaTexSize;
- QSizeF m_uvTexSize;
- gfx::ColorSpace m_colorSpace;
- float m_resourceMultiplier;
- float m_resourceOffset;
-};
-
-class YUVAVideoMaterial : public YUVVideoMaterial
-{
-public:
- YUVAVideoMaterial(QSGTexture *yTexture, QSGTexture *uTexture, QSGTexture *vTexture, QSGTexture *aTexture,
- const QRectF &yaTexCoordRect, const QRectF &uvTexCoordRect, const QSizeF &yaTexSize, const QSizeF &uvTexSize,
- const gfx::ColorSpace &colorspace, float rMul, float rOff);
-
- QSGMaterialType *type() const override
- {
- static QSGMaterialType theType;
- return &theType;
- }
-
- QSGMaterialShader *createShader() const override;
- int compare(const QSGMaterial *other) const override;
-
- QSGTexture *m_aTexture;
-};
-
-class YUVVideoNode : public QSGGeometryNode
-{
-public:
- YUVVideoNode(QSGTexture *yTexture, QSGTexture *uTexture, QSGTexture *vTexture, QSGTexture *aTexture,
- const QRectF &yaTexCoordRect, const QRectF &uvTexCoordRect, const QSizeF &yaTexSize, const QSizeF &uvTexSize,
- const gfx::ColorSpace &colorspace, float rMul, float rOff);
- void setRect(const QRectF &rect);
-
-private:
- QSGGeometry m_geometry;
- YUVVideoMaterial *m_material;
-};
-
-} // namespace
-
-#endif // YUV_VIDEO_NODE_H
diff --git a/src/core/config/common.pri b/src/core/config/common.pri
deleted file mode 100644
index c1658ce82..000000000
--- a/src/core/config/common.pri
+++ /dev/null
@@ -1,50 +0,0 @@
-
-qtConfig(webengine-printing-and-pdf) {
- gn_args += enable_basic_printing=true enable_print_preview=true
- gn_args += enable_pdf=true
-} else {
- gn_args += enable_basic_printing=false enable_print_preview=false
- gn_args += enable_pdf=false
-}
-
-qtConfig(webengine-pepper-plugins) {
- gn_args += enable_plugins=true
-} else {
- gn_args += enable_plugins=false
-}
-
-qtConfig(webengine-spellchecker) {
- gn_args += enable_spellcheck=true
-} else {
- gn_args += enable_spellcheck=false
-}
-
-qtConfig(webengine-webrtc) {
- gn_args += enable_webrtc=true
-} else {
- gn_args += enable_webrtc=false audio_processing_in_audio_service_supported=false
-}
-
-qtConfig(webengine-proprietary-codecs) {
- gn_args += proprietary_codecs=true ffmpeg_branding=\"Chrome\"
-} else {
- gn_args += proprietary_codecs=false
-}
-
-qtConfig(webengine-extensions) {
- gn_args += enable_extensions=true
-} else {
- gn_args += enable_extensions=false
-}
-
-qtConfig(webengine-kerberos) {
- gn_args += use_kerberos=true
-} else {
- gn_args += use_kerberos=false
-}
-
-qtConfig(webengine-nodejs) {
- gn_args += have_nodejs=true
-} else {
- gn_args += have_nodejs=false
-}
diff --git a/src/core/config/linux.pri b/src/core/config/linux.pri
deleted file mode 100644
index e98524002..000000000
--- a/src/core/config/linux.pri
+++ /dev/null
@@ -1,47 +0,0 @@
-include(common.pri)
-
-qtConfig(webengine-embedded-build) {
- gn_args += is_desktop_linux=false
-}
-
-!host_build{
-
-
-
- qtConfig(webengine-pulseaudio) {
- gn_args += use_pulseaudio=true
- } else {
- gn_args += use_pulseaudio=false
- }
-
- qtConfig(webengine-alsa) {
- gn_args += use_alsa=true
- } else {
- gn_args += use_alsa=false
- }
-
- !packagesExist(libpci): gn_args += use_libpci=false
-
- qtConfig(webengine-ozone-x11) {
- gn_args += ozone_platform_x11=true
- gn_args += use_xkbcommon=true
- packagesExist(xscrnsaver): gn_args += use_xscrnsaver=true
- qtConfig(webengine-webrtc): gn_args += rtc_use_x11=true
- }
-
- qtConfig(webengine-system-libevent): gn_args += use_system_libevent=true
- qtConfig(webengine-system-libwebp): gn_args += use_system_libwebp=true
- qtConfig(webengine-system-libxml2): gn_args += use_system_libxml=true use_system_libxslt=true
- qtConfig(webengine-system-opus): gn_args += use_system_opus=true
- qtConfig(webengine-system-snappy): gn_args += use_system_snappy=true
- qtConfig(webengine-system-libvpx): gn_args += use_system_libvpx=true
- qtConfig(webengine-system-icu): gn_args += use_system_icu=true icu_use_data_file=false
- qtConfig(webengine-system-ffmpeg): gn_args += use_system_ffmpeg=true
- qtConfig(webengine-system-re2): gn_args += use_system_re2=true
- qtConfig(webengine-system-lcms2): gn_args += use_system_lcms2=true
-
- # FIXME:
- #qtConfig(webengine-system-protobuf): gn_args += use_system_protobuf=true
- #qtConfig(webengine-system-jsoncpp): gn_args += use_system_jsoncpp=true
- #qtConfig(webengine-system-libsrtp: gn_args += use_system_libsrtp=true
-}
diff --git a/src/core/config/mac_osx.pri b/src/core/config/mac_osx.pri
deleted file mode 100644
index 9543daf90..000000000
--- a/src/core/config/mac_osx.pri
+++ /dev/null
@@ -1,8 +0,0 @@
-include(common.pri)
-
-qtConfig(build-qtwebengine-core):qtConfig(webengine-spellchecker) {
- qtConfig(webengine-native-spellchecker): gn_args += use_browser_spellchecker=true
- else: gn_args += use_browser_spellchecker=false
-} else {
- gn_args += use_browser_spellchecker=false
-}
diff --git a/src/core/config/windows.pri b/src/core/config/windows.pri
deleted file mode 100644
index 9543daf90..000000000
--- a/src/core/config/windows.pri
+++ /dev/null
@@ -1,8 +0,0 @@
-include(common.pri)
-
-qtConfig(build-qtwebengine-core):qtConfig(webengine-spellchecker) {
- qtConfig(webengine-native-spellchecker): gn_args += use_browser_spellchecker=true
- else: gn_args += use_browser_spellchecker=false
-} else {
- gn_args += use_browser_spellchecker=false
-}
diff --git a/src/core/configure.json b/src/core/configure.json
deleted file mode 100644
index 1a2162723..000000000
--- a/src/core/configure.json
+++ /dev/null
@@ -1,313 +0,0 @@
-{
- "module": "webenginecore",
- "depends": [
- "buildtools-private",
- "core-private",
- "gui-private",
- "printsupport"
- ],
- "condition": "module.gui && features.build-qtwebengine-core && features.webengine-core-support",
- "testDir": "../../config.tests",
- "commandline": {
- "options": {
- "webengine-alsa": "boolean",
- "webengine-embedded-build": "boolean",
- "webengine-full-debug-info": "boolean",
- "webengine-icu": { "type": "enum", "name": "webengine-system-icu", "values": { "system": "yes", "qt": "no" } },
- "webengine-ffmpeg": { "type": "enum", "name": "webengine-system-ffmpeg", "values": { "system": "yes", "qt": "no" } },
- "webengine-opus": { "type": "enum", "name": "webengine-system-opus", "values": { "system": "yes", "qt": "no" } },
- "webengine-webp": { "type": "enum", "name": "webengine-system-libwebp", "values": { "system": "yes", "qt": "no" } },
- "webengine-pepper-plugins": "boolean",
- "webengine-printing-and-pdf": "boolean",
- "webengine-proprietary-codecs": "boolean",
- "webengine-pulseaudio": "boolean",
- "webengine-spellchecker": "boolean",
- "webengine-native-spellchecker": "boolean",
- "webengine-extensions": "boolean",
- "webengine-webrtc": "boolean",
- "webengine-geolocation": "boolean",
- "webengine-webchannel": "boolean",
- "webengine-kerberos": "boolean",
- "alsa": { "type": "boolean", "name": "webengine-alsa" },
- "pulseaudio": { "type": "boolean", "name": "webengine-pulseaudio" },
- "ffmpeg": { "type": "enum", "name": "webengine-system-ffmpeg", "values": { "system": "yes", "qt": "no" } },
- "opus": { "type": "enum", "name": "webengine-system-opus", "values": { "system": "yes", "qt": "no" } },
- "webp": { "type": "enum", "name": "webengine-system-libwebp", "values": { "system": "yes", "qt": "no" } },
- "pepper-plugins": { "type": "boolean", "name": "webengine-pepper-plugins" },
- "printing-and-pdf": { "type": "boolean", "name": "webengine-printing-and-pdf" },
- "proprietary-codecs": { "type": "boolean", "name": "webengine-proprietary-codecs" },
- "spellchecker": { "type": "boolean", "name": "webengine-spellchecker" },
- "extensions": { "type": "boolean", "name": "webengine-extensions" },
- "webrtc": { "type": "boolean", "name": "webengine-webrtc" }
- }
- },
-
- "libraries": {
- "webengine-alsa": {
- "label": "alsa",
- "test": {
- "tail": [
- "#if SND_LIB_VERSION < 0x1000a // 1.0.10",
- "#error Alsa version found too old, require >= 1.0.10",
- "#endif"
- ]
- },
- "headers" : ["alsa/asoundlib.h"],
- "sources" : [{ "type": "pkgConfig", "args": "alsa" }
- ]
- },
- "webengine-poppler-cpp": {
- "label": "poppler-cpp",
- "sources": [
- { "type": "pkgConfig", "args": "poppler-cpp" }
- ]
- },
- "webengine-pulseaudio": {
- "label": "pulseaudio >= 0.9.10",
- "sources": [
- { "type": "pkgConfig", "args": "libpulse >= 0.9.10 libpulse-mainloop-glib" }
- ]
- }
- },
- "tests" : {
- "webengine-host-compiler": {
- "label": "host compiler",
- "test": "hostcompiler",
- "host": "true",
- "type": "compile"
- },
- "webengine-host-pkg-config": {
- "label": "host pkg-config",
- "type": "detectHostPkgConfig",
- "log": "path"
- },
- "webengine-embedded-build": {
- "label": "embedded build",
- "type": "detectEmbedded"
- },
- "webengine-noexecstack" : {
- "label": "linker supports -z noexecstack",
- "type": "linkerSupportsFlag",
- "flag": "-z,noexecstack"
- },
- "webengine-nodejs": {
- "label": "node.js",
- "type": "detectNodeJS"
- }
- },
- "features": {
- "webengine-embedded-build": {
- "label": "Embedded build",
- "purpose": "Enables the embedded build configuration.",
- "condition": "config.unix",
- "autoDetect": "tests.webengine-embedded-build",
- "output": [ "privateFeature" ]
- },
- "webengine-alsa": {
- "label": "Use ALSA",
- "condition": "config.unix && libs.webengine-alsa",
- "output": [ "privateFeature" ]
- },
- "webengine-v8-snapshot-support": {
- "label" : "Building v8 snapshot supported",
- "condition": "!config.unix || !features.cross_compile || arch.arm64 || tests.webengine-host-compiler",
- "output": [ "privateFeature" ]
- },
- "webengine-geolocation": {
- "label": "Geolocation",
- "condition": "module.positioning",
- "output": [ "publicFeature" ]
- },
- "webengine-pulseaudio": {
- "label": "Use PulseAudio",
- "autoDetect": "config.unix",
- "condition": "libs.webengine-pulseaudio",
- "output": [ "privateFeature" ]
- },
- "webengine-pepper-plugins": {
- "label": "Pepper Plugins",
- "purpose": "Enables use of Pepper Flash plugins.",
- "autoDetect": "!features.webengine-embedded-build",
- "output": [ "privateFeature" ]
- },
- "webengine-printing-and-pdf": {
- "label": "Printing and PDF",
- "purpose": "Provides printing and output to PDF.",
- "condition": "module.printsupport && features.printer",
- "autoDetect": "!features.webengine-embedded-build",
- "output": [ "privateFeature" ]
- },
- "webengine-webchannel": {
- "label": "WebChannel support",
- "purpose": "Provides QtWebChannel integration.",
- "section": "WebEngine",
- "condition": "module.webchannel",
- "output": [ "publicFeature" ]
- },
- "webengine-proprietary-codecs": {
- "label": "Proprietary Codecs",
- "purpose": "Enables the use of proprietary codecs such as h.264/h.265 and MP3.",
- "autoDetect": false,
- "output": [ "privateFeature" ]
- },
- "webengine-kerberos": {
- "label": "Kerberos Authentication",
- "purpose": "Enables Kerberos Authentication Support",
- "autoDetect": "config.win32",
- "section": "WebEngine",
- "output": [ "privateFeature" ]
- },
- "webengine-spellchecker": {
- "label": "Spellchecker",
- "purpose": "Provides a spellchecker.",
- "output": [ "publicFeature" ]
- },
- "webengine-native-spellchecker": {
- "label": "Native Spellchecker",
- "purpose": "Use the system's native spellchecking engine.",
- "autoDetect": false,
- "condition": "config.macos && features.webengine-spellchecker",
- "output": [ "publicFeature" ]
- },
- "webengine-extensions": {
- "label": "Extensions",
- "purpose": "Enables Chromium extensions within certain limits. Currently used for enabling the pdf viewer.",
- "section": "WebEngine",
- "condition": "features.webengine-printing-and-pdf",
- "autoDetect": "features.webengine-printing-and-pdf",
- "output": [ "publicFeature" ]
- },
- "webengine-webrtc": {
- "label": "WebRTC",
- "purpose": "Provides WebRTC support.",
- "autoDetect": "!features.webengine-embedded-build",
- "output": [ "privateFeature" ]
- },
- "webengine-ozone" : {
- "label": "Support qpa-xcb",
- "condition": "features.webengine-ozone-x11",
- "output": [ "privateFeature" ]
- },
- "webengine-poppler-cpp": {
- "label": "poppler-cpp",
- "autoDetect": "config.unix",
- "condition": "libs.webengine-poppler-cpp",
- "output": [ "privateFeature" ]
- },
- "webengine-full-debug-info": {
- "label": "Full debug information",
- "purpose": "Enables debug information for Blink and V8.",
- "autoDetect": false,
- "condition": "config.debug || features.debug_and_release || features.force_debug_info",
- "output": [
- { "type": "privateConfig", "name": "v8base_debug" },
- { "type": "privateConfig", "name": "webcore_debug" }
- ]
- },
- "webengine-noexecstack": {
- "label": "linker supports -z noexecstack",
- "condition": "config.unix && tests.webengine-noexecstack",
- "output": [ "privateFeature" ]
- },
- "webengine-nodejs": {
- "label": "Node.js",
- "condition": "tests.webengine-nodejs",
- "output": [ "privateFeature" ]
- }
- },
-
- "report": [
- {
- "type": "warning",
- "condition": "config.unix && !features.webengine-host-pkg-config",
- "message": "host pkg-config not found"
- },
- {
- "type": "warning",
- "condition": "config.linux && features.webengine-embedded-build && !features.webengine-system-ffmpeg && arch.arm && !features.webengine-arm-thumb",
- "message": "Thumb instruction set is required to build ffmpeg for QtWebEngine."
- },
- {
- "type": "warning",
- "condition": "config.unix && config.cross_compile && !features.webengine-v8-snapshot-support",
- "message": "V8 snapshot cannot be built. Most likely, the 32-bit host compiler does not work. Please make sure you have 32-bit devel environment installed."
- },
- {
- "type": "warning",
- "condition": "!features.webengine-nodejs",
- "message": "Building without node.js will disable some features of QtWebEngine DevTools."
- }
- ],
-
- "summary": [
- {
- "section": "Qt WebEngineCore",
- "condition": "features.build-qtwebengine-core",
- "entries": [
- "webengine-embedded-build",
- "webengine-full-debug-info",
- "webengine-pepper-plugins",
- "webengine-printing-and-pdf",
- "webengine-proprietary-codecs",
- "webengine-spellchecker",
- "webengine-native-spellchecker",
- "webengine-webrtc",
- "webengine-geolocation",
- "webengine-webchannel",
- "webengine-kerberos",
- "webengine-extensions",
- "webengine-nodejs",
- {
- "type": "feature",
- "args": "webengine-ozone",
- "condition": "config.unix"
- },
- {
- "type": "feature",
- "args": "webengine-v8-snapshot-support",
- "condition": "config.unix && config.cross_compile"
- },
- {
- "type": "feature",
- "args": "webengine-alsa",
- "condition": "config.unix"
- },
- {
- "type": "feature",
- "args": "webengine-pulseaudio",
- "condition": "config.unix"
- },
- {
- "message": "macOS version",
- "type": "macosToolchainVersion",
- "args": "macosVersion",
- "condition": "config.macos"
- },
- {
- "message": "Xcode version",
- "type": "macosToolchainVersion",
- "args": "xcodeVersion",
- "condition": "config.macos"
- },
- {
- "message": "Clang version",
- "type": "macosToolchainVersion",
- "args": "clangVersion",
- "condition": "config.macos"
- },
- {
- "message": "macOS SDK version",
- "type": "macosToolchainVersion",
- "args": "sdkVersion",
- "condition": "config.macos"
- },
- {
- "message": "macOS minimum deployment target",
- "type": "macosToolchainVersion",
- "args": "deploymentTarget",
- "condition": "config.macos"
- }
- ]
- }
- ]
-}
diff --git a/src/core/configure/BUILD.root.gn.in b/src/core/configure/BUILD.root.gn.in
new file mode 100644
index 000000000..986db5026
--- /dev/null
+++ b/src/core/configure/BUILD.root.gn.in
@@ -0,0 +1,779 @@
+import("//build/config/features.gni")
+import("//build/config/ui.gni")
+import("//chrome/common/features.gni")
+import("//components/spellcheck/spellcheck_build_features.gni")
+import("//pdf/features.gni")
+import("//ppapi/buildflags/buildflags.gni")
+import("//printing/buildflags/buildflags.gni")
+import("//extensions/buildflags/buildflags.gni")
+import("//tools/grit/repack.gni")
+import("//build/config/locales.gni")
+import("//chrome/chrome_repack_locales.gni")
+import("//extensions/buildflags/buildflags.gni")
+import("//ui/ozone/ozone.gni")
+import("//tools/v8_context_snapshot/v8_context_snapshot.gni")
+
+# Workaround for cmake configure_file command. Words wrapped with @ characters are
+# handled as variables in this file.
+chromium_version_template = string_replace("atMAJORat.atMINORat.atBUILDat.atPATCHat", "at", "@")
+chromium_version = exec_script("//build/util/version.py",
+ [ "-f", rebase_path("//chrome/VERSION"), "-t", chromium_version_template], "list lines")
+
+moc_source_h_files = exec_script("@WEBENGINE_ROOT_SOURCE_DIR@/tools/scripts/gn_find_mocables.py",
+ [
+ @GN_HEADERS@
+ ], "list lines", ["@WEBENGINE_ROOT_SOURCE_DIR@/src/core/CMakeLists.txt"]
+)
+moc_source_cpp_files = exec_script("@WEBENGINE_ROOT_SOURCE_DIR@/tools/scripts/gn_find_mocables.py",
+ [
+ @GN_SOURCES@
+ ], "list lines", ["@WEBENGINE_ROOT_SOURCE_DIR@/src/core/CMakeLists.txt"]
+)
+if (moc_source_h_files != []) {
+ action_foreach("generate_h_mocs") {
+ script = "@WEBENGINE_ROOT_SOURCE_DIR@/tools/scripts/gn_run_binary.py"
+ sources = moc_source_h_files
+ outputs = [ "${target_gen_dir}/.moc/moc_{{source_name_part}}.cpp" ]
+ inputs = [ "@WEBENGINE_ROOT_SOURCE_DIR@/src/core/CMakeLists.txt" ]
+ args = [
+ @GN_ARGS_MOC_BIN@,
+ @GN_ARGS_DEFINES@,
+ @GN_ARGS_INCLUDES@,
+ "{{source}}",
+ "-o",
+ rebase_path("${target_gen_dir}/.moc/moc_{{source_name_part}}.cpp")
+ ]
+ }
+}
+
+if (moc_source_cpp_files != []) {
+ action_foreach("generate_cpp_mocs") {
+ script = "@WEBENGINE_ROOT_SOURCE_DIR@/tools/scripts/gn_run_binary.py"
+ sources = moc_source_cpp_files
+ outputs = [ "${target_gen_dir}/.moc/{{source_name_part}}.moc" ]
+ inputs = [ "@WEBENGINE_ROOT_SOURCE_DIR@/src/core/CMakeLists.txt" ]
+ args = [
+ @GN_ARGS_MOC_BIN@,
+ @GN_ARGS_DEFINES@,
+ @GN_ARGS_INCLUDES@,
+ "{{source}}",
+ "-o",
+ rebase_path("${target_gen_dir}/.moc/{{source_name_part}}.moc")
+ ]
+ }
+}
+
+config("QtWebEngineCore_config") {
+ cflags = [
+ @GN_CFLAGS_C@,
+ ]
+ cflags_cc = [
+ @GN_CFLAGS_CC@,
+ ]
+ defines = [
+ @GN_DEFINES@,
+ ]
+ include_dirs = [
+ @GN_INCLUDE_DIRS@,
+ rebase_path("${target_gen_dir}/.moc/")
+ ]
+}
+
+declare_args() {
+ use_embedded_config = false
+ enable_webenginedriver = true
+}
+
+config("embedded_config") {
+ defines = [ "QTWEBENGINE_EMBEDDED_SWITCHES=1" ]
+}
+
+config("cpp20_config") {
+ # Chromium is built with C++20
+ if (is_win) {
+ cflags_cc = [ "/std:c++20" ]
+ } else {
+ cflags_cc = [ "-std=c++20" ]
+ }
+}
+
+shared_library("QtWebEngineCore") {
+ rsp_types = [ "objects", "archives", "libs", "ldir"]
+ configs += [
+ ":cpp20_config",
+ ":QtWebEngineCore_config",
+ "//build/config:precompiled_headers"
+ ]
+ include_dirs = [
+ "//skia/config",
+ "//third_party",
+ "//third_party/boringssl/src/include",
+ "//third_party/skia/include/core"
+ ]
+ data_deps = []
+ defines = [ "CHROMIUM_VERSION=" + chromium_version[0] ]
+ deps = [
+ "//base",
+ "//components/autofill/content/browser",
+ "//components/autofill/content/renderer",
+ "//components/autofill/core/browser",
+ "//components/autofill/core/browser:buildflags",
+ "//components/cdm/renderer",
+ "//components/embedder_support/origin_trials",
+ "//components/error_page/common",
+ "//components/favicon/content",
+ "//components/gcm_driver",
+ "//components/history/content/browser",
+ "//components/keyed_service/content",
+ "//components/lens:buildflags",
+ "//components/navigation_interception",
+ "//components/network_hints/browser",
+ "//components/network_hints/common:mojo_bindings",
+ "//components/network_hints/renderer",
+ "//components/signin/public/base",
+ "//components/visitedlink/browser",
+ "//components/visitedlink/renderer",
+ "//components/web_cache/browser",
+ "//components/web_cache/renderer",
+ "//components/spellcheck:buildflags",
+ "//components/supervised_user/core/common:buildflags",
+ "//components/profile_metrics",
+ "//components/proxy_config",
+ "//components/user_prefs",
+ "//content/public/app",
+ "//content/public/browser",
+ "//content",
+ "//gpu/ipc:gl_in_process_context",
+ "//media:media_buildflags",
+ "//net",
+ "//services/proxy_resolver:lib",
+ "//skia",
+ "//third_party/blink/public:blink",
+ "//ui/accessibility",
+ "//ui/gl",
+ "//qtwebengine/browser:interfaces",
+ "//qtwebengine/userscript",
+ "//qtwebengine/common:mojo_bindings",
+ ":qtwebengine_sources",
+ ":qtwebengine_resources",
+ ]
+
+ if (use_ozone) {
+ _ozone_extra_directory = get_path_info(ozone_extra_path, "dir")
+ deps += [ "$_ozone_extra_directory:qt" ]
+ }
+
+ if (enable_webrtc) {
+ deps += [ "//third_party/webrtc_overrides:webrtc_component" ]
+ }
+
+ if (is_win) {
+ configs += [ "//build/config/compiler:rtti" ]
+ data_deps += [ ":QtWebEngineCoreSandbox" ]
+ }
+ if (use_embedded_config) {
+ configs += [ ":embedded_config" ]
+ }
+
+ if (is_apple) {
+ configs -= [ "//build/config/compiler:enable_arc" ]
+ }
+
+ sources = [
+ @GN_HEADERS@,
+ @GN_SOURCES@
+ ]
+ if (moc_source_h_files != []) {
+ deps += [
+ ":generate_h_mocs",
+ ]
+ sources += get_target_outputs(":generate_h_mocs")
+ }
+ if (moc_source_cpp_files != []) {
+ deps += [
+ ":generate_cpp_mocs",
+ ]
+ }
+ if (use_v8_context_snapshot) {
+ data_deps += [
+ "//tools/v8_context_snapshot:v8_context_snapshot"
+ ]
+ }
+}
+
+source_set("qtwebengine_spellcheck_sources") {
+ include_dirs = [ "@WEBENGINE_ROOT_SOURCE_DIR@/src/core/service" ]
+ configs += [ "//third_party/boringssl:external_config" ]
+ sources = [
+ "//chrome/browser/spellchecker/spell_check_host_chrome_impl.cc",
+ "//chrome/browser/spellchecker/spell_check_host_chrome_impl.h",
+ "//chrome/browser/spellchecker/spellcheck_custom_dictionary.cc",
+ "//chrome/browser/spellchecker/spellcheck_custom_dictionary.h",
+ "//chrome/browser/spellchecker/spellcheck_factory.cc",
+ "//chrome/browser/spellchecker/spellcheck_factory.h",
+ "//chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc",
+ "//chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h",
+ "//chrome/browser/spellchecker/spellcheck_service.cc",
+ "//chrome/browser/spellchecker/spellcheck_service.h",
+ ]
+ deps = [
+ "//components/language/core/browser",
+ "//components/spellcheck/browser",
+ "//components/spellcheck/renderer",
+ "//third_party/blink/public:blink",
+ "//third_party/hunspell",
+ ]
+ if (is_mac && use_browser_spellchecker) {
+ sources += [
+ "//chrome/browser/spellchecker/spelling_request.cc",
+ ]
+ }
+}
+
+source_set("devtools_sources") {
+ configs += [ ":cpp20_config" ]
+ deps = [
+ "//components/zoom",
+ "//third_party/blink/public/mojom:mojom_platform",
+ ]
+ sources = [
+ "//chrome/browser/devtools/devtools_eye_dropper.cc",
+ "//chrome/browser/devtools/devtools_eye_dropper.h",
+ "//chrome/browser/devtools/devtools_file_helper.cc",
+ "//chrome/browser/devtools/devtools_file_helper.h",
+ "//chrome/browser/devtools/devtools_file_system_indexer.cc",
+ "//chrome/browser/devtools/devtools_file_system_indexer.h",
+ "//chrome/browser/devtools/devtools_file_watcher.cc",
+ "//chrome/browser/devtools/devtools_file_watcher.h",
+ "//chrome/browser/devtools/url_constants.cc",
+ "//chrome/browser/devtools/url_constants.h",
+ "//chrome/browser/devtools/devtools_ui_bindings.cc",
+ "//chrome/browser/devtools/devtools_ui_bindings.h",
+ "//chrome/browser/devtools/devtools_settings.cc",
+ "//chrome/browser/devtools/devtools_settings.h",
+ "//chrome/browser/devtools/devtools_embedder_message_dispatcher.cc",
+ "//chrome/browser/devtools/devtools_embedder_message_dispatcher.h",
+ ]
+}
+
+source_set("qtwebengine_sources") {
+ configs += [
+ ":cpp20_config",
+ "//skia:skia_config",
+ "//third_party/boringssl:external_config",
+ ]
+ deps = [
+ ":devtools_sources",
+ "//build:branding_buildflags",
+ "//build/config/chromebox_for_meetings:buildflags",
+ "//chrome/browser:dev_ui_browser_resources_grit",
+ "//chrome/browser/resources/accessibility:resources",
+ "//chrome/browser/resources/net_internals:resources",
+ "//chrome/browser/signin:identity_manager_provider",
+ "//chrome/common:buildflags",
+ "//chrome/common:version_header",
+ "//components/custom_handlers",
+ "//components/embedder_support:embedder_support",
+ "//components/nacl/common:buildflags",
+ "//components/performance_manager",
+ "//components/permissions:permissions_common",
+ "//components/plugins/renderer/",
+ "//content/browser/resources/quota:resources",
+ "//extensions/buildflags:buildflags",
+ "//pdf:buildflags",
+ "//printing/buildflags:buildflags",
+ "//qtwebengine/common:mojo_bindings",
+ "//rlz/buildflags:buildflags",
+ "//third_party/blink/public/mojom:mojom_platform",
+ ]
+ sources = [
+ "//chrome/browser/accessibility/accessibility_ui.cc",
+ "//chrome/browser/accessibility/accessibility_ui.h",
+ "//chrome/browser/gcm/gcm_product_util.cc",
+ "//chrome/browser/gcm/gcm_product_util.h",
+ "//chrome/browser/gcm/gcm_profile_service_factory.cc",
+ "//chrome/browser/gcm/gcm_profile_service_factory.h",
+ "//chrome/browser/gcm/instance_id/instance_id_profile_service_factory.cc",
+ "//chrome/browser/gcm/instance_id/instance_id_profile_service_factory.h",
+ "//chrome/browser/media/webrtc/desktop_capturer_wrapper.cc",
+ "//chrome/browser/media/webrtc/desktop_capturer_wrapper.h",
+ "//chrome/browser/media/webrtc/desktop_media_list.cc",
+ "//chrome/browser/media/webrtc/desktop_media_list.h",
+ "//chrome/browser/media/webrtc/desktop_media_list_base.cc",
+ "//chrome/browser/media/webrtc/desktop_media_list_base.h",
+ "//chrome/browser/media/webrtc/native_desktop_media_list.cc",
+ "//chrome/browser/media/webrtc/native_desktop_media_list.h",
+ "//chrome/browser/media/webrtc/thumbnail_capturer.cc",
+ "//chrome/browser/media/webrtc/thumbnail_capturer.h",
+ "//chrome/browser/net/chrome_mojo_proxy_resolver_factory.cc",
+ "//chrome/browser/net/chrome_mojo_proxy_resolver_factory.h",
+ "//chrome/browser/prefs/chrome_command_line_pref_store.cc",
+ "//chrome/browser/prefs/chrome_command_line_pref_store.h",
+ "//chrome/browser/profiles/incognito_helpers.cc",
+ "//chrome/browser/profiles/incognito_helpers.h",
+ "//chrome/browser/profiles/profile_keyed_service_factory.cc",
+ "//chrome/browser/profiles/profile_keyed_service_factory.h",
+ "//chrome/browser/profiles/profile_selections.cc",
+ "//chrome/browser/profiles/profile_selections.h",
+ "//chrome/browser/profiles/profile.cc",
+ "//chrome/browser/profiles/profile.h",
+ "//chrome/browser/push_messaging/push_messaging_app_identifier.cc",
+ "//chrome/browser/push_messaging/push_messaging_app_identifier.h",
+ "//chrome/browser/push_messaging/push_messaging_constants.cc",
+ "//chrome/browser/push_messaging/push_messaging_constants.h",
+ "//chrome/browser/push_messaging/push_messaging_features.cc",
+ "//chrome/browser/push_messaging/push_messaging_features.h",
+ "//chrome/browser/push_messaging/push_messaging_notification_manager.cc",
+ "//chrome/browser/push_messaging/push_messaging_notification_manager.h",
+ "//chrome/browser/push_messaging/push_messaging_refresher.cc",
+ "//chrome/browser/push_messaging/push_messaging_refresher.h",
+ "//chrome/browser/push_messaging/push_messaging_service_factory.cc",
+ "//chrome/browser/push_messaging/push_messaging_service_factory.h",
+ "//chrome/browser/push_messaging/push_messaging_service_impl.cc",
+ "//chrome/browser/push_messaging/push_messaging_service_impl.h",
+ "//chrome/browser/push_messaging/push_messaging_utils.cc",
+ "//chrome/browser/push_messaging/push_messaging_utils.h",
+ "//chrome/browser/signin/chrome_signin_client.cc",
+ "//chrome/browser/signin/chrome_signin_client.h",
+ "//chrome/browser/signin/chrome_signin_client_factory.cc",
+ "//chrome/browser/signin/chrome_signin_client_factory.h",
+ "//chrome/browser/signin/force_signin_verifier.cc",
+ "//chrome/browser/signin/force_signin_verifier.h",
+ "//chrome/browser/signin/identity_manager_factory.cc",
+ "//chrome/browser/signin/identity_manager_factory.h",
+ "//chrome/browser/signin/signin_util.cc",
+ "//chrome/browser/signin/signin_util.h",
+ "//chrome/browser/tab_contents/form_interaction_tab_helper.cc",
+ "//chrome/browser/tab_contents/form_interaction_tab_helper.h",
+ "//chrome/browser/tab_contents/web_contents_collection.cc",
+ "//chrome/browser/tab_contents/web_contents_collection.h",
+ "//chrome/browser/ui/webui/device_log_ui.cc",
+ "//chrome/browser/ui/webui/device_log_ui.h",
+ "//chrome/browser/ui/webui/devtools_ui.cc",
+ "//chrome/browser/ui/webui/devtools_ui.h",
+ "//chrome/browser/ui/webui/devtools_ui_data_source.cc",
+ "//chrome/browser/ui/webui/devtools_ui_data_source.h",
+ "//chrome/browser/ui/webui/net_internals/net_internals_ui.cc",
+ "//chrome/browser/ui/webui/net_internals/net_internals_ui.h",
+ "//chrome/browser/ui/webui/user_actions/user_actions_ui.cc",
+ "//chrome/browser/ui/webui/user_actions/user_actions_ui.h",
+ "//chrome/browser/ui/webui/user_actions/user_actions_ui_handler.cc",
+ "//chrome/browser/ui/webui/user_actions/user_actions_ui_handler.h",
+ "//chrome/browser/ui/webui/webui_util.cc",
+ "//chrome/browser/ui/webui/webui_util.h",
+ "//chrome/common/chrome_switches.cc",
+ "//chrome/common/chrome_switches.h",
+ "//chrome/common/pref_names.h",
+ "//chrome/common/url_constants.cc",
+ "//chrome/common/url_constants.h",
+ "//chrome/common/webui_url_constants.cc",
+ "//chrome/common/webui_url_constants.h",
+ "//components/embedder_support/user_agent_utils.cc",
+ "//components/embedder_support/user_agent_utils.h",
+ ]
+ if (use_ozone) {
+ deps += [
+ "//ui/gfx/linux:drm",
+ ]
+
+ sources += [
+ "//ui/ozone/platform/wayland/gpu/wayland_gl_egl_utility.cc",
+ "//ui/ozone/platform/wayland/gpu/wayland_gl_egl_utility.h",
+ ]
+
+ if (ozone_platform_x11) {
+ deps += [
+ "//ui/base/x:gl",
+ "//ui/gfx/linux:gpu_memory_buffer_support_x11",
+ ]
+
+ sources += [
+ "//ui/ozone/platform/x11/gl_egl_utility_x11.cc",
+ "//ui/ozone/platform/x11/gl_egl_utility_x11.h",
+ ]
+ }
+ }
+ if (enable_extensions) {
+ deps += [
+ ":qtwebengine_extensions_features",
+ "//chrome/app:generated_resources",
+ "//chrome/browser/extensions/api:api_registration",
+ "//chrome/browser/resources:component_extension_resources_grit",
+ "//chrome/common/extensions/api:api",
+ "//chrome/common/extensions/api:extensions_features",
+ "//components/crx_file",
+ "//components/crx_file:crx_creator",
+ "//components/spellcheck:buildflags",
+ "//extensions/buildflags:buildflags",
+ "//extensions/common",
+ "//extensions/common/api",
+ "//extensions/common:core_api_provider",
+ "//extensions/browser",
+ "//extensions/browser/api",
+ "//extensions/renderer",
+ "//extensions:extensions_resources",
+ "//extensions/strings",
+ "//qtwebengine/browser/extensions/api:api_registration",
+ "//qtwebengine/common/extensions/api:api",
+ ]
+ sources += [
+ "//chrome/browser/extensions/api/streams_private/streams_private_api.cc",
+ "//chrome/browser/extensions/api/streams_private/streams_private_api.h",
+ "//chrome/browser/extensions/api/enterprise_hardware_platform/enterprise_hardware_platform_api.cc",
+ "//chrome/browser/extensions/api/enterprise_hardware_platform/enterprise_hardware_platform_api.h",
+ "//chrome/common/extensions/permissions/chrome_api_permissions.cc",
+ "//chrome/common/extensions/permissions/chrome_api_permissions.h",
+ "//chrome/common/extensions/permissions/chrome_permission_message_provider.cc",
+ "//chrome/common/extensions/permissions/chrome_permission_message_provider.h",
+ "//chrome/common/extensions/permissions/chrome_permission_message_rules.cc",
+ "//chrome/common/extensions/permissions/chrome_permission_message_rules.h",
+ ]
+ } else {
+ sources += [
+ "//extensions/common/url_pattern.cc",
+ "//extensions/common/url_pattern.h",
+ ]
+ }
+ if (is_linux || is_win) {
+ sources += [
+ "//chrome/browser/ui/webui/sandbox/sandbox_internals_ui.cc",
+ "//chrome/browser/ui/webui/sandbox/sandbox_internals_ui.h",
+ ]
+ deps += [
+ "//chrome/browser/resources/sandbox_internals:resources",
+ ]
+ }
+ if (is_win) {
+ sources += [
+ "//chrome/browser/net/chrome_mojo_proxy_resolver_win.cc",
+ "//chrome/browser/net/chrome_mojo_proxy_resolver_win.h",
+ "//chrome/browser/ui/webui/sandbox/sandbox_handler.cc",
+ "//chrome/browser/ui/webui/sandbox/sandbox_handler.h",
+ ]
+ deps += [ "//services/proxy_resolver_win",
+ "//services/proxy_resolver_win/public/mojom",
+ ]
+ }
+ if (enable_spellcheck) {
+ deps += [
+ ":qtwebengine_spellcheck_sources",
+ "//chrome/tools/convert_dict:lib",
+ "//third_party/hunspell",
+ ]
+ }
+ if (enable_plugins) {
+ sources += [
+ "//chrome/renderer/pepper/pepper_shared_memory_message_filter.cc",
+ "//chrome/renderer/pepper/pepper_shared_memory_message_filter.h",
+ ]
+ }
+ if (enable_basic_printing || enable_print_preview) {
+ sources += [
+ "//chrome/browser/printing/printer_query.cc",
+ "//chrome/browser/printing/printer_query.h",
+ "//chrome/browser/printing/print_job.cc",
+ "//chrome/browser/printing/print_job.h",
+ "//chrome/browser/printing/print_job_manager.cc",
+ "//chrome/browser/printing/print_job_manager.h",
+ "//chrome/browser/printing/print_job_worker.cc",
+ "//chrome/browser/printing/print_job_worker.h",
+ ]
+ }
+ if (enable_pdf) {
+ deps += [
+ "//pdf",
+ "//chrome/browser/resources/pdf:resources",
+ "//components/pdf/browser",
+ "//components/pdf/browser:interceptors",
+ "//components/pdf/common",
+ "//components/pdf/renderer",
+ "//components/printing/browser",
+ "//components/printing/renderer",
+ ]
+ }
+
+ if (enable_webrtc && enable_extensions) {
+ deps += [
+ "//chrome/browser/resources/media:resources",
+ "//components/upload_list",
+ "//components/webrtc_logging/browser",
+ "//components/webrtc_logging/common",
+ ]
+
+ sources += [
+ "//chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_api.cc",
+ "//chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_api.h",
+ "//chrome/browser/media/webrtc/audio_debug_recordings_handler.cc",
+ "//chrome/browser/media/webrtc/audio_debug_recordings_handler.h",
+ "//chrome/browser/media/webrtc/webrtc_event_log_history.cc",
+ "//chrome/browser/media/webrtc/webrtc_event_log_history.h",
+ "//chrome/browser/media/webrtc/webrtc_event_log_manager.cc",
+ "//chrome/browser/media/webrtc/webrtc_event_log_manager.h",
+ "//chrome/browser/media/webrtc/webrtc_event_log_manager_common.cc",
+ "//chrome/browser/media/webrtc/webrtc_event_log_manager_common.h",
+ "//chrome/browser/media/webrtc/webrtc_event_log_manager_local.cc",
+ "//chrome/browser/media/webrtc/webrtc_event_log_manager_local.h",
+ "//chrome/browser/media/webrtc/webrtc_event_log_manager_remote.cc",
+ "//chrome/browser/media/webrtc/webrtc_event_log_manager_remote.h",
+ "//chrome/browser/media/webrtc/webrtc_event_log_uploader.cc",
+ "//chrome/browser/media/webrtc/webrtc_event_log_uploader.h",
+ "//chrome/browser/media/webrtc/webrtc_log_buffer.cc",
+ "//chrome/browser/media/webrtc/webrtc_log_buffer.h",
+ "//chrome/browser/media/webrtc/webrtc_log_uploader.cc",
+ "//chrome/browser/media/webrtc/webrtc_log_uploader.h",
+ "//chrome/browser/media/webrtc/webrtc_logging_controller.cc",
+ "//chrome/browser/media/webrtc/webrtc_logging_controller.h",
+ "//chrome/browser/media/webrtc/webrtc_rtp_dump_handler.cc",
+ "//chrome/browser/media/webrtc/webrtc_rtp_dump_handler.h",
+ "//chrome/browser/media/webrtc/webrtc_rtp_dump_writer.cc",
+ "//chrome/browser/media/webrtc/webrtc_rtp_dump_writer.h",
+ "//chrome/browser/media/webrtc/webrtc_text_log_handler.cc",
+ "//chrome/browser/media/webrtc/webrtc_text_log_handler.h",
+ "//chrome/browser/ui/webui/media/webrtc_logs_ui.cc",
+ "//chrome/browser/ui/webui/media/webrtc_logs_ui.h",
+ "//chrome/renderer/media/webrtc_logging_agent_impl.cc",
+ "//chrome/renderer/media/webrtc_logging_agent_impl.h",
+ ]
+ }
+}
+
+if (is_win) {
+ static_library("QtWebEngineCoreSandbox") {
+ complete_static_lib = true
+ configs += [ ":cpp20_config",
+ ":QtWebEngineCore_config",
+ "//build/config:precompiled_headers"
+ ]
+ output_dir = "$root_out_dir"
+ sources = [
+ "@GN_SOURCE_ROOT@/sandbox_win.cpp"
+ ]
+ public_deps = [ "//sandbox/win:sandbox" ]
+ }
+}
+
+group("qtwebengine_resources") {
+ deps = [
+ "//chrome/app:generated_resources",
+ "//chrome/browser:resources",
+ "//chrome/browser/resources:component_extension_resources",
+ "//chrome/common:resources",
+ "//components/resources:components_resources",
+ ":qtwebengine_repack_resources",
+ ":qtwebengine_repack_resources_100",
+ ":qtwebengine_repack_resources_200",
+ ":qtwebengine_repack_resources_devtools",
+ ":qtwebengine_repack_locales_pack"
+ ]
+}
+
+repack("qtwebengine_repack_resources") {
+ sources = [
+ "$root_gen_dir/qtwebengine/qt_webengine_resources.pak",
+ "$root_gen_dir/chrome/accessibility_resources.pak",
+ "$root_gen_dir/chrome/common_resources.pak",
+ "$root_gen_dir/chrome/dev_ui_browser_resources.pak",
+ "$root_gen_dir/chrome/net_internals_resources.pak",
+ "$root_gen_dir/components/components_resources.pak",
+ "$root_gen_dir/components/dev_ui_components_resources.pak",
+ "$root_gen_dir/content/attribution_internals_resources.pak",
+ "$root_gen_dir/content/browser/resources/media/media_internals_resources.pak",
+ "$root_gen_dir/content/browser/tracing/tracing_resources.pak",
+ "$root_gen_dir/content/content_resources.pak",
+ "$root_gen_dir/content/gpu_resources.pak",
+ "$root_gen_dir/content/histograms_resources.pak",
+ "$root_gen_dir/content/indexed_db_resources.pak",
+ "$root_gen_dir/content/network_errors_resources.pak",
+ "$root_gen_dir/content/process_resources.pak",
+ "$root_gen_dir/content/quota_internals_resources.pak",
+ "$root_gen_dir/content/service_worker_resources.pak",
+ "$root_gen_dir/mojo/public/js/mojo_bindings_resources.pak",
+ "$root_gen_dir/net/net_resources.pak",
+ "$root_gen_dir/third_party/blink/public/resources/blink_resources.pak",
+ "$root_gen_dir/ui/resources/webui_resources.pak",
+ ]
+ output = "$root_out_dir/qtwebengine_resources.pak"
+ deps = [
+ "//qtwebengine/browser:qt_webengine_resources",
+ "//chrome/browser:dev_ui_browser_resources_grit",
+ "//chrome/browser/resources/accessibility:resources",
+ "//chrome/browser/resources/net_internals:resources",
+ "//chrome/common:resources_grit",
+ "//components/resources:components_resources_grit",
+ "//components/resources:dev_ui_components_resources_grit",
+ "//content/browser/resources/attribution_reporting:resources",
+ "//content/browser/resources/gpu:resources",
+ "//content/browser/resources/histograms:resources_grit",
+ "//content/browser/resources/indexed_db:resources",
+ "//content/browser/resources/media:resources",
+ "//content/browser/resources/net:resources",
+ "//content/browser/resources/process:resources",
+ "//content/browser/resources/quota:resources",
+ "//content/browser/resources/service_worker:resources",
+ "//content/browser/tracing:resources",
+ "//content:content_resources",
+ "//mojo/public/js:resources",
+ "//net:net_resources_grit",
+ "//third_party/blink/public:resources_grit",
+ "//ui/resources:webui_resources_grd",
+ ]
+ if (enable_extensions) {
+ sources += [
+ "$root_gen_dir/chrome/component_extension_resources.pak",
+ "$root_gen_dir/extensions/extensions_renderer_resources.pak",
+ "$root_gen_dir/extensions/extensions_resources.pak",
+ ]
+ deps += [
+ "//chrome/browser/resources:component_extension_resources_grit",
+ "//extensions:extensions_renderer_resources_grit",
+ "//extensions:extensions_resources_grd_grit",
+ ]
+ }
+ if (enable_webrtc) {
+ sources += [
+ "$root_gen_dir/content/browser/webrtc/resources/webrtc_internals_resources.pak",
+ ]
+ deps += [
+ "//content/browser/webrtc/resources",
+ ]
+ }
+ if (enable_webrtc && enable_extensions) {
+ sources += [
+ "$root_gen_dir/chrome/media_resources.pak",
+ ]
+ deps += [
+ "//chrome/browser/resources/media:resources",
+ ]
+ }
+ if (enable_pdf) {
+ sources += [
+ "$root_gen_dir/chrome/pdf_resources.pak",
+ ]
+ deps += [
+ "//chrome/browser/resources/pdf:resources",
+ ]
+ }
+ if (is_linux || is_win) {
+ sources += [
+ "$root_gen_dir/chrome/sandbox_internals_resources.pak",
+ ]
+ deps += [
+ "//chrome/browser/resources/sandbox_internals:resources_grit",
+ ]
+ }
+}
+
+repack("qtwebengine_repack_resources_100") {
+ sources = [
+ "$root_gen_dir/chrome/renderer_resources_100_percent.pak",
+ "$root_gen_dir/components/components_resources_100_percent.pak",
+ "$root_gen_dir/third_party/blink/public/resources/blink_scaled_resources_100_percent.pak",
+ "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
+ ]
+ output = "$root_out_dir/qtwebengine_resources_100p.pak"
+ deps = [
+ "//chrome/renderer:resources_grit",
+ "//components/resources:components_scaled_resources_grit",
+ "//third_party/blink/public:scaled_resources_100_percent",
+ "//ui/resources:ui_resources_grd_grit"
+ ]
+ if (enable_extensions) {
+ sources += [
+ "$root_gen_dir/extensions/extensions_browser_resources_100_percent.pak"
+ ]
+ deps += [
+ "//extensions:extensions_browser_resources_grit"
+ ]
+ }
+}
+
+repack("qtwebengine_repack_resources_200") {
+ sources = [
+ "$root_gen_dir/chrome/renderer_resources_200_percent.pak",
+ "$root_gen_dir/components/components_resources_200_percent.pak",
+ "$root_gen_dir/third_party/blink/public/resources/blink_scaled_resources_200_percent.pak",
+ "$root_gen_dir/ui/resources/ui_resources_200_percent.pak",
+ ]
+ output = "$root_out_dir/qtwebengine_resources_200p.pak"
+ deps = [
+ "//chrome/renderer:resources_grit",
+ "//components/resources:components_scaled_resources_grit",
+ "//third_party/blink/public:scaled_resources_200_percent",
+ "//ui/resources:ui_resources_grd_grit"
+ ]
+ if (enable_extensions) {
+ sources += [
+ "$root_gen_dir/extensions/extensions_browser_resources_200_percent.pak"
+ ]
+ deps += [
+ "//extensions:extensions_browser_resources_grit"
+ ]
+ }
+}
+
+repack("qtwebengine_repack_resources_devtools") {
+ sources = [
+ "$root_gen_dir/content/browser/devtools/devtools_resources.pak",
+ "$root_gen_dir/third_party/blink/public/resources/inspector_overlay_resources.pak",
+ ]
+ output = "$root_out_dir/qtwebengine_devtools_resources.pak"
+ deps = [
+ "//content/browser/devtools:devtools_resources_grit",
+ "//third_party/blink/public:devtools_inspector_resources_grit",
+ ]
+}
+
+chrome_repack_locales("qtwebengine_repack_locales_pack") {
+ input_locales = platform_pak_locales
+ output_dir = "$root_out_dir/qtwebengine_locales"
+ output_locales = platform_pak_locales
+}
+
+if (enable_extensions) {
+ import("//tools/json_schema_compiler/json_features.gni")
+ json_features("qt_api_features") {
+ feature_type = "APIFeature"
+ method_name = "AddQtAPIFeatures"
+ sources = [
+ "//extensions/common/api/_webengine_api_features.json"
+ ]
+ }
+ json_features("qt_permission_features") {
+ feature_type = "PermissionFeature"
+ method_name = "AddQtPermissionFeatures"
+ sources = [
+ "//chrome/common/extensions/api/_permission_features.json",
+ "//extensions/common/api/_permission_features.json",
+ ]
+ }
+ group("qtwebengine_extensions_features") {
+ public_deps = [
+ ":qt_api_features",
+ ":qt_permission_features",
+ "//chrome/common/extensions/api:extensions_features",
+ "//extensions/common/api:extensions_features",
+ ]
+ }
+}
+
+if (enable_spellcheck) {
+ shared_library("convert_dict") {
+ rsp_types = [ "objects", "archives", "libs", "ldir" ]
+ configs += [ "//build/config/compiler:wexit_time_destructors" ]
+ deps = [
+ "//chrome/tools/convert_dict:lib",
+ "//base",
+ "//base:i18n",
+ "//third_party/hunspell",
+ ]
+ }
+}
+
+if (enable_webenginedriver) {
+ group("webenginedriver_group") {
+ testonly = true
+ deps = [
+ "//chrome/test/chromedriver:chromedriver_server",
+ ]
+ }
+}
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp
index 05957c26f..53c2caa2d 100644
--- a/src/core/content_browser_client_qt.cpp
+++ b/src/core/content_browser_client_qt.cpp
@@ -1,200 +1,162 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "content_browser_client_qt.h"
-#include "base/memory/ptr_util.h"
-#include "base/optional.h"
-#include "base/path_service.h"
-#include "base/strings/utf_string_conversions.h"
-#include "base/message_loop/message_loop.h"
-#include "base/task/post_task.h"
-#include "base/threading/thread_restrictions.h"
-#include "chrome/browser/custom_handlers/protocol_handler_registry.h"
-#include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h"
-#if QT_CONFIG(webengine_spellchecker)
-#include "chrome/browser/spellchecker/spell_check_host_chrome_impl.h"
-#endif
-#include "components/guest_view/browser/guest_view_base.h"
+#include "base/files/file_util.h"
+#include "chrome/browser/tab_contents/form_interaction_tab_helper.h"
+#include "components/autofill/content/browser/content_autofill_driver_factory.h"
+#include "components/custom_handlers/protocol_handler_registry.h"
+#include "components/embedder_support/user_agent_utils.h"
+#include "components/error_page/common/error.h"
+#include "components/error_page/common/localized_error.h"
#include "components/navigation_interception/intercept_navigation_throttle.h"
-#include "components/navigation_interception/navigation_params.h"
#include "components/network_hints/browser/simple_network_hints_handler_impl.h"
-#include "components/spellcheck/spellcheck_buildflags.h"
-#include "content/browser/renderer_host/render_view_host_delegate.h"
+#include "components/performance_manager/embedder/performance_manager_lifetime.h"
+#include "components/performance_manager/embedder/performance_manager_registry.h"
+#include "components/performance_manager/public/performance_manager.h"
#include "content/browser/web_contents/web_contents_impl.h"
-#include "content/common/url_schemes.h"
-#include "content/public/browser/browser_task_traits.h"
+#include "content/public/browser/browser_main_runner.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/child_process_security_policy.h"
#include "content/public/browser/client_certificate_delegate.h"
#include "content/public/browser/file_url_loader.h"
#include "content/public/browser/media_observer.h"
-#include "content/public/browser/network_service_instance.h"
+#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/shared_cors_origin_access_list.h"
-#include "content/public/browser/storage_partition.h"
+#include "content/public/browser/url_loader_request_interceptor.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_user_data.h"
+#include "content/public/browser/web_contents_view_delegate.h"
#include "content/public/browser/web_ui_url_loader_factory.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/main_function_params.h"
-#include "content/public/common/service_manager_connection.h"
-#include "content/public/common/service_names.mojom.h"
#include "content/public/common/url_constants.h"
#include "content/public/common/user_agent.h"
-#include "media/media_buildflags.h"
#include "extensions/buildflags/buildflags.h"
-#include "extensions/browser/extension_protocols.h"
-#include "extensions/browser/guest_view/web_view/web_view_guest.h"
-#include "mojo/public/cpp/bindings/binding.h"
-#include "mojo/public/cpp/bindings/binding_set.h"
-#include "mojo/public/cpp/bindings/remote.h"
-#include "printing/buildflags/buildflags.h"
-#include "qtwebengine/browser/qtwebengine_content_browser_overlay_manifest.h"
-#include "qtwebengine/browser/qtwebengine_content_renderer_overlay_manifest.h"
+#include "mojo/public/cpp/bindings/self_owned_associated_receiver.h"
+#include "pdf/buildflags.h"
#include "net/ssl/client_cert_identity.h"
#include "net/ssl/client_cert_store.h"
+#include "net/ssl/ssl_private_key.h"
+#include "printing/buildflags/buildflags.h"
+#include "services/device/public/cpp/geolocation/geolocation_manager.h"
#include "services/network/network_service.h"
-#include "services/network/public/cpp/features.h"
-#include "services/service_manager/public/cpp/connector.h"
-#include "services/service_manager/public/cpp/service.h"
-#include "services/service_manager/sandbox/switches.h"
-#include "storage/browser/quota/quota_settings.h"
+#include "services/network/public/cpp/web_sandbox_flags.h"
+#include "services/network/public/mojom/websocket.mojom.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h"
#include "third_party/blink/public/common/loader/url_loader_throttle.h"
-#include "third_party/blink/public/mojom/insecure_input/insecure_input_service.mojom.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_switches.h"
-#include "ui/gl/gl_context.h"
-#include "ui/gl/gl_implementation.h"
-#include "ui/gl/gl_share_group.h"
-#include "ui/gl/gpu_timing.h"
#include "url/url_util_qt.h"
#include "qtwebengine/common/renderer_configuration.mojom.h"
-#include "qtwebengine/grit/qt_webengine_resources.h"
#include "profile_adapter.h"
#include "browser_main_parts_qt.h"
#include "browser_message_filter_qt.h"
#include "certificate_error_controller.h"
-#include "certificate_error_controller_p.h"
#include "client_cert_select_controller.h"
+#include "custom_handlers/protocol_handler_registry_factory.h"
#include "devtools_manager_delegate_qt.h"
+#include "file_system_access/file_system_access_permission_request_manager_qt.h"
#include "login_delegate_qt.h"
#include "media_capture_devices_dispatcher.h"
#include "net/cookie_monster_delegate_qt.h"
#include "net/custom_url_loader_factory.h"
#include "net/proxying_restricted_cookie_manager_qt.h"
#include "net/proxying_url_loader_factory_qt.h"
-#include "net/qrc_url_scheme_handler.h"
#include "net/system_network_context_manager.h"
#include "platform_notification_service_qt.h"
-#if QT_CONFIG(webengine_printing_and_pdf)
-#include "printing/printing_message_filter_qt.h"
-#endif
#include "profile_qt.h"
#include "profile_io_data_qt.h"
-#include "quota_permission_context_qt.h"
#include "renderer_host/user_resource_controller_host.h"
+#include "select_file_dialog_factory_qt.h"
#include "type_conversion.h"
#include "web_contents_adapter_client.h"
#include "web_contents_adapter.h"
#include "web_contents_delegate_qt.h"
-#include "web_engine_context.h"
#include "web_contents_view_qt.h"
+#include "web_engine_context.h"
#include "web_engine_library_info.h"
+#include "web_engine_settings.h"
+#include "authenticator_request_client_delegate_qt.h"
#include "api/qwebenginecookiestore.h"
#include "api/qwebenginecookiestore_p.h"
-#include "api/qwebengineurlscheme.h"
+#include "api/qwebengineurlrequestinfo_p.h"
-#if defined(Q_OS_LINUX)
-#include "global_descriptors_qt.h"
-#include "ui/base/resource/resource_bundle.h"
+#if QT_CONFIG(webengine_geolocation)
+#include "base/memory/ptr_util.h"
+#include "location_provider_qt.h"
#endif
-#if QT_CONFIG(webengine_pepper_plugins)
-#include "content/public/browser/browser_ppapi_host.h"
-#include "ppapi/host/ppapi_host.h"
-#include "renderer_host/pepper/pepper_host_factory_qt.h"
+#if QT_CONFIG(webengine_spellchecker)
+#include "chrome/browser/spellchecker/spell_check_host_chrome_impl.h"
+#include "chrome/browser/spellchecker/spellcheck_factory.h"
+#include "chrome/browser/spellchecker/spellcheck_service.h"
+#include "components/spellcheck/browser/pref_names.h"
+#include "components/spellcheck/common/spellcheck.mojom.h"
+#include "components/spellcheck/common/spellcheck_features.h"
#endif
-#if QT_CONFIG(webengine_geolocation)
-#include "location_provider_qt.h"
+#if QT_CONFIG(webengine_webrtc) && QT_CONFIG(webengine_extensions)
+#include "chrome/browser/media/webrtc/webrtc_logging_controller.h"
+#endif
+
+#if defined(Q_OS_LINUX)
+#include "global_descriptors_qt.h"
#endif
#if BUILDFLAG(ENABLE_EXTENSIONS)
-#include "content/public/browser/file_url_loader.h"
+#include "common/extensions/extensions_client_qt.h"
+#include "components/guest_view/browser/guest_view_base.h"
+#include "extensions/browser/api/messaging/messaging_api_message_filter.h"
+#include "extensions/browser/api/mime_handler_private/mime_handler_private.h"
+#include "extensions/browser/event_router.h"
#include "extensions/browser/extension_message_filter.h"
-#include "extensions/browser/guest_view/extensions_guest_view_message_filter.h"
+#include "extensions/browser/extension_protocols.h"
+#include "extensions/browser/extension_registry.h"
+#include "extensions/browser/extension_util.h"
+#include "extensions/browser/guest_view/extensions_guest_view.h"
+#include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h"
+#include "extensions/browser/guest_view/web_view/web_view_guest.h"
+#include "extensions/browser/process_map.h"
+#include "extensions/browser/url_loader_factory_manager.h"
+#include "extensions/browser/view_type_utils.h"
#include "extensions/common/constants.h"
-
-#include "common/extensions/extensions_client_qt.h"
+#include "extensions/common/manifest_handlers/mime_types_handler.h"
#include "extensions/extension_web_contents_observer_qt.h"
#include "extensions/extensions_browser_client_qt.h"
#include "net/plugin_response_interceptor_url_loader_throttle.h"
#endif
-#if BUILDFLAG(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS)
-#include "media/mojo/interfaces/constants.mojom.h"
-#include "media/mojo/services/media_service_factory.h"
+#if QT_CONFIG(webengine_webchannel)
+#include "qtwebengine/browser/qtwebchannel.mojom.h"
+#include "renderer_host/web_channel_ipc_transport_host.h"
#endif
-#if BUILDFLAG(ENABLE_SPELLCHECK)
-#include "chrome/browser/spellchecker/spell_check_host_chrome_impl.h"
-#include "components/spellcheck/common/spellcheck.mojom.h"
+#if BUILDFLAG(ENABLE_PRINTING) && BUILDFLAG(ENABLE_PRINT_PREVIEW)
+#include "printing/pdf_stream_delegate_qt.h"
+#include "printing/print_view_manager_qt.h"
#endif
-#include <QGuiApplication>
-#include <QLocale>
-#include <QStandardPaths>
-#if QT_CONFIG(opengl)
-# include <QOpenGLContext>
-# include <QOpenGLExtraFunctions>
+#if BUILDFLAG(ENABLE_PDF)
+#include "components/pdf/browser/pdf_navigation_throttle.h"
+#include "components/pdf/browser/pdf_url_loader_request_interceptor.h"
+#include "components/pdf/browser/pdf_document_helper.h"
+
+#include "printing/pdf_document_helper_client_qt.h"
#endif
-#include <qpa/qplatformnativeinterface.h>
-QT_BEGIN_NAMESPACE
-Q_GUI_EXPORT QOpenGLContext *qt_gl_global_share_context();
-QT_END_NAMESPACE
+#if BUILDFLAG(ENABLE_PDF) && BUILDFLAG(ENABLE_EXTENSIONS)
+#include "extensions/pdf_iframe_navigation_throttle_qt.h"
+#endif
+
+#include <QGuiApplication>
+#include <QStandardPaths>
// Implement IsHandledProtocol as declared in //url/url_util_qt.h.
namespace url {
@@ -215,9 +177,6 @@ bool IsHandledProtocol(base::StringPiece scheme)
content::kChromeUIScheme,
url::kDataScheme,
url::kAboutScheme,
-#if !BUILDFLAG(DISABLE_FTP_SUPPORT)
- url::kFtpScheme,
-#endif // !BUILDFLAG(DISABLE_FTP_SUPPORT)
url::kBlobScheme,
url::kFileSystemScheme,
url::kQrcScheme,
@@ -235,91 +194,11 @@ bool IsHandledProtocol(base::StringPiece scheme)
namespace QtWebEngineCore {
-class QtShareGLContext : public gl::GLContext {
-public:
- QtShareGLContext(QOpenGLContext *qtContext)
- : gl::GLContext(0)
- , m_handle(0)
- {
- QString platform = qApp->platformName().toLower();
- QPlatformNativeInterface *pni = QGuiApplication::platformNativeInterface();
- if (platform == QLatin1String("xcb") || platform == QLatin1String("offscreen")) {
- if (gl::GetGLImplementation() == gl::kGLImplementationEGLGLES2)
- m_handle = pni->nativeResourceForContext(QByteArrayLiteral("eglcontext"), qtContext);
- else
- m_handle = pni->nativeResourceForContext(QByteArrayLiteral("glxcontext"), qtContext);
- } else if (platform == QLatin1String("cocoa"))
- m_handle = pni->nativeResourceForContext(QByteArrayLiteral("cglcontextobj"), qtContext);
- else if (platform == QLatin1String("qnx"))
- m_handle = pni->nativeResourceForContext(QByteArrayLiteral("eglcontext"), qtContext);
- else if (platform == QLatin1String("eglfs") || platform == QLatin1String("wayland")
- || platform == QLatin1String("wayland-egl"))
- m_handle = pni->nativeResourceForContext(QByteArrayLiteral("eglcontext"), qtContext);
- else if (platform == QLatin1String("windows")) {
- if (gl::GetGLImplementation() == gl::kGLImplementationEGLGLES2)
- m_handle = pni->nativeResourceForContext(QByteArrayLiteral("eglContext"), qtContext);
- else
- m_handle = pni->nativeResourceForContext(QByteArrayLiteral("renderingcontext"), qtContext);
- } else {
- qFatal("%s platform not yet supported", platform.toLatin1().constData());
- // Add missing platforms once they work.
- Q_UNREACHABLE();
- }
- }
-
- void* GetHandle() override { return m_handle; }
- unsigned int CheckStickyGraphicsResetStatus() override
- {
-#if QT_CONFIG(opengl)
- if (QOpenGLContext *context = qt_gl_global_share_context()) {
- if (context->format().testOption(QSurfaceFormat::ResetNotification))
- return context->extraFunctions()->glGetGraphicsResetStatus();
- }
-#endif
- return 0 /*GL_NO_ERROR*/;
- }
-
- // We don't care about the rest, this context shouldn't be used except for its handle.
- bool Initialize(gl::GLSurface *, const gl::GLContextAttribs &) override { Q_UNREACHABLE(); return false; }
- bool MakeCurrent(gl::GLSurface *) override { Q_UNREACHABLE(); return false; }
- void ReleaseCurrent(gl::GLSurface *) override { Q_UNREACHABLE(); }
- bool IsCurrent(gl::GLSurface *) override { Q_UNREACHABLE(); return false; }
- scoped_refptr<gl::GPUTimingClient> CreateGPUTimingClient() override
- {
- return nullptr;
- }
- const gfx::ExtensionSet& GetExtensions() override
- {
- static const gfx::ExtensionSet s_emptySet;
- return s_emptySet;
- }
- void ResetExtensions() override
- {
- }
-
-private:
- void *m_handle;
-};
-
-class ShareGroupQtQuick : public gl::GLShareGroup {
-public:
- gl::GLContext* GetContext() override { return m_shareContextQtQuick.get(); }
- void AboutToAddFirstContext() override;
-
-private:
- scoped_refptr<QtShareGLContext> m_shareContextQtQuick;
-};
-
-void ShareGroupQtQuick::AboutToAddFirstContext()
-{
-#if QT_CONFIG(opengl)
- // This currently has to be setup by ::main in all applications using QQuickWebEngineView with delegated rendering.
- QOpenGLContext *shareContext = qt_gl_global_share_context();
- if (!shareContext) {
- qFatal("QWebEngine: OpenGL resource sharing is not set up in QtQuick. Please make sure to call QtWebEngine::initialize() in your main() function before QCoreApplication is created.");
- }
- m_shareContextQtQuick = new QtShareGLContext(shareContext);
-#endif
+void MaybeAddThrottle(
+ std::unique_ptr<content::NavigationThrottle> maybe_throttle,
+ std::vector<std::unique_ptr<content::NavigationThrottle>>* throttles) {
+ if (maybe_throttle)
+ throttles->push_back(std::move(maybe_throttle));
}
ContentBrowserClientQt::ContentBrowserClientQt()
@@ -330,9 +209,12 @@ ContentBrowserClientQt::~ContentBrowserClientQt()
{
}
-std::unique_ptr<content::BrowserMainParts> ContentBrowserClientQt::CreateBrowserMainParts(const content::MainFunctionParams&)
+std::unique_ptr<content::BrowserMainParts> ContentBrowserClientQt::CreateBrowserMainParts(bool)
{
- return std::make_unique<BrowserMainPartsQt>();
+ Q_ASSERT(!m_browserMainParts);
+ auto browserMainParts = std::make_unique<BrowserMainPartsQt>();
+ m_browserMainParts = browserMainParts.get();
+ return browserMainParts;
}
void ContentBrowserClientQt::RenderProcessWillLaunch(content::RenderProcessHost *host)
@@ -340,6 +222,15 @@ void ContentBrowserClientQt::RenderProcessWillLaunch(content::RenderProcessHost
const int id = host->GetID();
Profile *profile = Profile::FromBrowserContext(host->GetBrowserContext());
+#if QT_CONFIG(webengine_spellchecker)
+ if (spellcheck::UseBrowserSpellChecker() && !profile->GetPrefs()->GetBoolean(spellcheck::prefs::kSpellCheckEnable))
+ SpellcheckServiceFactory::GetForContext(profile)->InitForRenderer(host);
+#endif
+
+#if QT_CONFIG(webengine_webrtc) && QT_CONFIG(webengine_extensions)
+ WebRtcLoggingController::AttachToRenderProcessHost(host, WebEngineContext::current()->webRtcLogUploader());
+#endif
+
// Allow requesting custom schemes.
const auto policy = content::ChildProcessSecurityPolicy::GetInstance();
const auto profileAdapter = static_cast<ProfileQt *>(profile)->profileAdapter();
@@ -350,115 +241,62 @@ void ContentBrowserClientQt::RenderProcessWillLaunch(content::RenderProcessHost
policy->GrantRequestScheme(id, url::kFileScheme);
profileAdapter->userResourceController()->renderProcessStartedWithHost(host);
host->AddFilter(new BrowserMessageFilterQt(id, profile));
-#if QT_CONFIG(webengine_printing_and_pdf)
- host->AddFilter(new PrintingMessageFilterQt(id));
-#endif
#if BUILDFLAG(ENABLE_EXTENSIONS)
host->AddFilter(new extensions::ExtensionMessageFilter(id, profile));
- host->AddFilter(new extensions::ExtensionsGuestViewMessageFilter(id, profile));
+ host->AddFilter(new extensions::MessagingAPIMessageFilter(id, profile));
#endif //ENABLE_EXTENSIONS
bool is_incognito_process = profile->IsOffTheRecord();
- qtwebengine::mojom::RendererConfigurationAssociatedPtr renderer_configuration;
+ mojo::AssociatedRemote<qtwebengine::mojom::RendererConfiguration> renderer_configuration;
host->GetChannel()->GetRemoteAssociatedInterface(&renderer_configuration);
renderer_configuration->SetInitialConfiguration(is_incognito_process);
}
-gl::GLShareGroup *ContentBrowserClientQt::GetInProcessGpuShareGroup()
-{
- if (!m_shareGroupQtQuick.get())
- m_shareGroupQtQuick = new ShareGroupQtQuick;
- return m_shareGroupQtQuick.get();
-}
-
content::MediaObserver *ContentBrowserClientQt::GetMediaObserver()
{
return MediaCaptureDevicesDispatcher::GetInstance();
}
-void ContentBrowserClientQt::OverrideWebkitPrefs(content::RenderViewHost *rvh, content::WebPreferences *web_prefs)
+void ContentBrowserClientQt::OverrideWebkitPrefs(content::WebContents *webContents, blink::web_pref::WebPreferences *web_prefs)
{
- if (content::WebContents *webContents = rvh->GetDelegate()->GetAsWebContents()) {
#if BUILDFLAG(ENABLE_EXTENSIONS)
- if (guest_view::GuestViewBase::IsGuest(webContents))
- return;
-#endif // BUILDFLAG(ENABLE_EXTENSIONS)
- WebContentsDelegateQt* delegate = static_cast<WebContentsDelegateQt*>(webContents->GetDelegate());
- if (delegate)
- delegate->overrideWebPreferences(webContents, web_prefs);
- }
-}
-
-scoped_refptr<content::QuotaPermissionContext> ContentBrowserClientQt::CreateQuotaPermissionContext()
-{
- return new QuotaPermissionContextQt;
-}
-
-void ContentBrowserClientQt::GetQuotaSettings(content::BrowserContext* context,
- content::StoragePartition* partition,
- base::OnceCallback<void(base::Optional<storage::QuotaSettings>)> callback)
-{
- storage::GetNominalDynamicSettings(partition->GetPath(), context->IsOffTheRecord(),
- storage::GetDefaultDeviceInfoHelper(), std::move(callback));
-}
+ if (guest_view::GuestViewBase::IsGuest(webContents))
+ return;
-// Copied from chrome/browser/ssl/ssl_error_handler.cc:
-static int IsCertErrorFatal(int cert_error)
-{
- switch (cert_error) {
- case net::ERR_CERT_COMMON_NAME_INVALID:
- case net::ERR_CERT_DATE_INVALID:
- case net::ERR_CERT_AUTHORITY_INVALID:
- case net::ERR_CERT_WEAK_SIGNATURE_ALGORITHM:
- case net::ERR_CERT_WEAK_KEY:
- case net::ERR_CERT_NAME_CONSTRAINT_VIOLATION:
- case net::ERR_CERT_VALIDITY_TOO_LONG:
- case net::ERR_CERTIFICATE_TRANSPARENCY_REQUIRED:
- case net::ERR_CERT_SYMANTEC_LEGACY:
- return false;
- case net::ERR_CERT_CONTAINS_ERRORS:
- case net::ERR_CERT_REVOKED:
- case net::ERR_CERT_INVALID:
- case net::ERR_SSL_WEAK_SERVER_EPHEMERAL_DH_KEY:
- case net::ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN:
- return true;
- default:
- NOTREACHED();
- }
- return true;
+ WebContentsViewQt *view = WebContentsViewQt::from(static_cast<content::WebContentsImpl *>(webContents)->GetView());
+ if (!view->client())
+ return;
+#endif // BUILDFLAG(ENABLE_EXTENSIONS)
+ WebContentsDelegateQt* delegate = static_cast<WebContentsDelegateQt*>(webContents->GetDelegate());
+ if (delegate)
+ delegate->overrideWebPreferences(webContents, web_prefs);
}
void ContentBrowserClientQt::AllowCertificateError(content::WebContents *webContents,
int cert_error,
const net::SSLInfo &ssl_info,
const GURL &request_url,
- bool is_main_frame_request,
+ bool /* is_main_frame_request */,
bool strict_enforcement,
base::OnceCallback<void(content::CertificateRequestResultType)> callback)
{
WebContentsDelegateQt* contentsDelegate = static_cast<WebContentsDelegateQt*>(webContents->GetDelegate());
- QSharedPointer<CertificateErrorController> errorController(
- new CertificateErrorController(
- new CertificateErrorControllerPrivate(
- cert_error,
- ssl_info,
- request_url,
- is_main_frame_request,
- IsCertErrorFatal(cert_error),
- strict_enforcement,
- std::move(callback))));
+ QSharedPointer<CertificateErrorController> errorController(new CertificateErrorController(
+ cert_error, ssl_info, request_url, strict_enforcement, std::move(callback)));
contentsDelegate->allowCertificateError(errorController);
}
-base::OnceClosure ContentBrowserClientQt::SelectClientCertificate(content::WebContents *webContents,
+base::OnceClosure ContentBrowserClientQt::SelectClientCertificate(content::BrowserContext *browser_context,
+ content::WebContents *webContents,
net::SSLCertRequestInfo *certRequestInfo,
net::ClientCertIdentityList clientCerts,
std::unique_ptr<content::ClientCertificateDelegate> delegate)
{
+ Q_UNUSED(browser_context);
if (!clientCerts.empty()) {
- WebContentsDelegateQt* contentsDelegate = static_cast<WebContentsDelegateQt*>(webContents->GetDelegate());
+ WebContentsDelegateQt *contentsDelegate = static_cast<WebContentsDelegateQt*>(webContents->GetDelegate());
QSharedPointer<ClientCertSelectController> certSelectController(
new ClientCertSelectController(certRequestInfo, std::move(clientCerts), std::move(delegate)));
@@ -496,8 +334,8 @@ void ContentBrowserClientQt::AppendExtraCommandLineSwitches(base::CommandLine* c
url::CustomScheme::SaveSchemes(command_line);
std::string processType = command_line->GetSwitchValueASCII(switches::kProcessType);
- if (processType == service_manager::switches::kZygoteProcess)
- command_line->AppendSwitchASCII(switches::kLang, GetApplicationLocale());
+ if (processType == switches::kZygoteProcess)
+ command_line->AppendSwitchASCII(switches::kLang, WebEngineLibraryInfo::getApplicationLocale());
}
void ContentBrowserClientQt::GetAdditionalWebUISchemes(std::vector<std::string>* additional_schemes)
@@ -522,12 +360,17 @@ void ContentBrowserClientQt::GetAdditionalAllowedSchemesForFileSystem(std::vecto
additional_schemes->push_back(content::kChromeUIScheme);
}
+std::unique_ptr<ui::SelectFilePolicy>
+ContentBrowserClientQt::CreateSelectFilePolicy(content::WebContents *web_contents)
+{
+ return std::make_unique<SelectFilePolicyQt>(web_contents);
+}
+
#if defined(Q_OS_LINUX)
void ContentBrowserClientQt::GetAdditionalMappedFilesForChildProcess(const base::CommandLine& command_line, int child_process_id, content::PosixFileDescriptorInfo* mappings)
{
- const std::string &locale = GetApplicationLocale();
- const base::FilePath &locale_file_path = ui::ResourceBundle::GetSharedInstance().GetLocaleFilePath(locale);
- if (locale_file_path.empty())
+ const base::FilePath &locale_file_path = ui::ResourceBundle::GetSharedInstance().GetLocaleFilePath(WebEngineLibraryInfo::getResolvedLocale());
+ if (locale_file_path.empty() || !base::PathExists(locale_file_path))
return;
// Open pak file of the current locale in the Browser process and pass its file descriptor to the sandboxed
@@ -538,101 +381,20 @@ void ContentBrowserClientQt::GetAdditionalMappedFilesForChildProcess(const base:
}
#endif
-#if QT_CONFIG(webengine_pepper_plugins)
-void ContentBrowserClientQt::DidCreatePpapiPlugin(content::BrowserPpapiHost* browser_host)
-{
- browser_host->GetPpapiHost()->AddHostFactoryFilter(
- std::make_unique<QtWebEngineCore::PepperHostFactoryQt>(browser_host));
-}
-#endif
-
-content::DevToolsManagerDelegate* ContentBrowserClientQt::GetDevToolsManagerDelegate()
-{
- return new DevToolsManagerDelegateQt;
-}
-
-content::PlatformNotificationService *ContentBrowserClientQt::GetPlatformNotificationService(content::BrowserContext *browser_context)
-{
- ProfileQt *profile = static_cast<ProfileQt *>(browser_context);
- if (!profile)
- return nullptr;
- return profile->platformNotificationService();
-}
-
-// This is a really complicated way of doing absolutely nothing, but Mojo demands it:
-class ServiceDriver
- : public blink::mojom::InsecureInputService
- , public content::WebContentsUserData<ServiceDriver>
-{
-public:
- static void CreateForRenderFrameHost(content::RenderFrameHost *renderFrameHost)
- {
- content::WebContents* web_contents = content::WebContents::FromRenderFrameHost(renderFrameHost);
- if (!web_contents)
- return;
- CreateForWebContents(web_contents);
-
- }
- static ServiceDriver* FromRenderFrameHost(content::RenderFrameHost *renderFrameHost)
- {
- content::WebContents* web_contents = content::WebContents::FromRenderFrameHost(renderFrameHost);
- if (!web_contents)
- return nullptr;
- return FromWebContents(web_contents);
- }
- static void BindInsecureInputService(blink::mojom::InsecureInputServiceRequest request, content::RenderFrameHost *render_frame_host)
- {
- CreateForRenderFrameHost(render_frame_host);
- ServiceDriver *driver = FromRenderFrameHost(render_frame_host);
-
- if (driver)
- driver->BindInsecureInputServiceRequest(std::move(request));
- }
- void BindInsecureInputServiceRequest(blink::mojom::InsecureInputServiceRequest request)
- {
- m_insecureInputServiceBindings.AddBinding(this, std::move(request));
- }
-
- // blink::mojom::InsecureInputService:
- void DidEditFieldInInsecureContext() override
- { }
-
-private:
- WEB_CONTENTS_USER_DATA_KEY_DECL();
- explicit ServiceDriver(content::WebContents* /*web_contents*/) { }
- friend class content::WebContentsUserData<ServiceDriver>;
- mojo::BindingSet<blink::mojom::InsecureInputService> m_insecureInputServiceBindings;
-};
-
-WEB_CONTENTS_USER_DATA_KEY_IMPL(ServiceDriver)
-
-void ContentBrowserClientQt::InitFrameInterfaces()
+std::unique_ptr<content::DevToolsManagerDelegate> ContentBrowserClientQt::CreateDevToolsManagerDelegate()
{
- m_frameInterfaces = std::make_unique<service_manager::BinderRegistry>();
- m_frameInterfacesParameterized = std::make_unique<service_manager::BinderRegistryWithArgs<content::RenderFrameHost*>>();
- m_frameInterfacesParameterized->AddInterface(base::BindRepeating(&ServiceDriver::BindInsecureInputService));
-}
-
-void ContentBrowserClientQt::BindInterfaceRequestFromFrame(content::RenderFrameHost* render_frame_host,
- const std::string& interface_name,
- mojo::ScopedMessagePipeHandle interface_pipe)
-{
- if (!m_frameInterfaces.get() && !m_frameInterfacesParameterized.get())
- InitFrameInterfaces();
-
- if (!m_frameInterfacesParameterized->TryBindInterface(interface_name, &interface_pipe, render_frame_host))
- m_frameInterfaces->TryBindInterface(interface_name, &interface_pipe);
+ return std::make_unique<DevToolsManagerDelegateQt>();
}
void ContentBrowserClientQt::BindHostReceiverForRenderer(content::RenderProcessHost *render_process_host,
mojo::GenericPendingReceiver receiver)
{
-#if BUILDFLAG(ENABLE_SPELLCHECK)
+#if QT_CONFIG(webengine_spellchecker)
if (auto host_receiver = receiver.As<spellcheck::mojom::SpellCheckHost>()) {
SpellCheckHostChromeImpl::Create(render_process_host->GetID(), std::move(host_receiver));
return;
}
-#endif // BUILDFLAG(ENABLE_SPELLCHECK)
+#endif
}
static void BindNetworkHintsHandler(content::RenderFrameHost *frame_host,
@@ -641,38 +403,120 @@ static void BindNetworkHintsHandler(content::RenderFrameHost *frame_host,
network_hints::SimpleNetworkHintsHandlerImpl::Create(frame_host, std::move(receiver));
}
+#if BUILDFLAG(ENABLE_EXTENSIONS)
+static void BindMimeHandlerService(content::RenderFrameHost *frame_host,
+ mojo::PendingReceiver<extensions::mime_handler::MimeHandlerService>
+ receiver) {
+ auto *web_contents = content::WebContents::FromRenderFrameHost(frame_host);
+ if (!web_contents)
+ return;
+ auto *guest_view = extensions::MimeHandlerViewGuest::FromWebContents(web_contents);
+ if (!guest_view)
+ return;
+ extensions::MimeHandlerServiceImpl::Create(guest_view->GetStreamWeakPtr(), std::move(receiver));
+}
+
+static void BindBeforeUnloadControl(content::RenderFrameHost *frame_host,
+ mojo::PendingReceiver<extensions::mime_handler::BeforeUnloadControl>
+ receiver) {
+ auto *web_contents = content::WebContents::FromRenderFrameHost(frame_host);
+ if (!web_contents)
+ return;
+ auto *guest_view = extensions::MimeHandlerViewGuest::FromWebContents(web_contents);
+ if (!guest_view)
+ return;
+ guest_view->FuseBeforeUnloadControl(std::move(receiver));
+}
+#endif
+
void ContentBrowserClientQt::RegisterBrowserInterfaceBindersForFrame(
content::RenderFrameHost *render_frame_host,
- service_manager::BinderMapWithContext<content::RenderFrameHost *> *map)
+ mojo::BinderMapWithContext<content::RenderFrameHost *> *map)
{
- Q_UNUSED(render_frame_host);
map->Add<network_hints::mojom::NetworkHintsHandler>(base::BindRepeating(&BindNetworkHintsHandler));
-}
-
-void ContentBrowserClientQt::RunServiceInstance(const service_manager::Identity &identity,
- mojo::PendingReceiver<service_manager::mojom::Service> *receiver)
-{
-#if BUILDFLAG(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS)
- if (identity.name() == media::mojom::kMediaServiceName) {
- service_manager::Service::RunAsyncUntilTermination(media::CreateMediaService(std::move(*receiver)));
+#if BUILDFLAG(ENABLE_EXTENSIONS)
+ map->Add<extensions::mime_handler::MimeHandlerService>(base::BindRepeating(&BindMimeHandlerService));
+ map->Add<extensions::mime_handler::BeforeUnloadControl>(base::BindRepeating(&BindBeforeUnloadControl));
+ const GURL &site = render_frame_host->GetSiteInstance()->GetSiteURL();
+ if (!site.SchemeIs(extensions::kExtensionScheme))
return;
- }
+ content::BrowserContext *browser_context = render_frame_host->GetProcess()->GetBrowserContext();
+ auto *extension = extensions::ExtensionRegistry::Get(browser_context)
+ ->enabled_extensions()
+ .GetByID(site.host());
+ if (!extension)
+ return;
+ extensions::ExtensionsBrowserClient::Get()->RegisterBrowserInterfaceBindersForFrame(map,
+ render_frame_host,
+ extension);
+#else
+ Q_UNUSED(render_frame_host);
#endif
-
- content::ContentBrowserClient::RunServiceInstance(identity, receiver);
}
-base::Optional<service_manager::Manifest> ContentBrowserClientQt::GetServiceManifestOverlay(base::StringPiece name)
+void ContentBrowserClientQt::ExposeInterfacesToRenderer(service_manager::BinderRegistry *registry,
+ blink::AssociatedInterfaceRegistry *associated_registry,
+ content::RenderProcessHost *render_process_host)
{
- if (name == content::mojom::kBrowserServiceName)
- return GetQtWebEngineContentBrowserOverlayManifest();
-
- return base::nullopt;
+ if (auto *manager = performance_manager::PerformanceManagerRegistry::GetInstance())
+ manager->CreateProcessNodeAndExposeInterfacesToRendererProcess(registry, render_process_host);
+#if BUILDFLAG(ENABLE_EXTENSIONS)
+ associated_registry->AddInterface<extensions::mojom::EventRouter>(
+ base::BindRepeating(&extensions::EventRouter::BindForRenderer, render_process_host->GetID()));
+ associated_registry->AddInterface<guest_view::mojom::GuestViewHost>(
+ base::BindRepeating(&extensions::ExtensionsGuestView::CreateForComponents, render_process_host->GetID()));
+ associated_registry->AddInterface<extensions::mojom::GuestView>(
+ base::BindRepeating(&extensions::ExtensionsGuestView::CreateForExtensions, render_process_host->GetID()));
+#else
+ Q_UNUSED(associated_registry);
+#endif
}
-std::vector<service_manager::Manifest> ContentBrowserClientQt::GetExtraServiceManifests()
+void ContentBrowserClientQt::RegisterAssociatedInterfaceBindersForRenderFrameHost(
+ content::RenderFrameHost &rfh,
+ blink::AssociatedInterfaceRegistry &associated_registry)
{
- return { };
+#if QT_CONFIG(webengine_webchannel)
+ associated_registry.AddInterface<qtwebchannel::mojom::WebChannelTransportHost>(
+ base::BindRepeating(
+ [](content::RenderFrameHost *render_frame_host,
+ mojo::PendingAssociatedReceiver<qtwebchannel::mojom::WebChannelTransportHost> receiver) {
+ auto *web_contents = content::WebContents::FromRenderFrameHost(render_frame_host);
+ auto *adapter = static_cast<WebContentsDelegateQt *>(web_contents->GetDelegate())->webContentsAdapter();
+ adapter->webChannelTransport()->BindReceiver(std::move(receiver), render_frame_host);
+ }, &rfh));
+#endif
+#if BUILDFLAG(ENABLE_PRINTING) && BUILDFLAG(ENABLE_PRINT_PREVIEW)
+ associated_registry.AddInterface<printing::mojom::PrintManagerHost>(
+ base::BindRepeating(
+ [](content::RenderFrameHost* render_frame_host,
+ mojo::PendingAssociatedReceiver<printing::mojom::PrintManagerHost> receiver) {
+ PrintViewManagerQt::BindPrintManagerHost(std::move(receiver), render_frame_host);
+ }, &rfh));
+#endif
+#if BUILDFLAG(ENABLE_EXTENSIONS)
+ associated_registry.AddInterface<extensions::mojom::LocalFrameHost>(
+ base::BindRepeating(
+ [](content::RenderFrameHost *render_frame_host,
+ mojo::PendingAssociatedReceiver<extensions::mojom::LocalFrameHost> receiver) {
+ extensions::ExtensionWebContentsObserverQt::BindLocalFrameHost(std::move(receiver), render_frame_host);
+ }, &rfh));
+#endif
+ associated_registry.AddInterface<autofill::mojom::AutofillDriver>(
+ base::BindRepeating(
+ [](content::RenderFrameHost *render_frame_host,
+ mojo::PendingAssociatedReceiver<autofill::mojom::AutofillDriver> receiver) {
+ autofill::ContentAutofillDriverFactory::BindAutofillDriver(std::move(receiver), render_frame_host);
+ }, &rfh));
+#if BUILDFLAG(ENABLE_PDF)
+ associated_registry.AddInterface<pdf::mojom::PdfService>(
+ base::BindRepeating(
+ [](content::RenderFrameHost *render_frame_host,
+ mojo::PendingAssociatedReceiver<pdf::mojom::PdfService> receiver) {
+ pdf::PDFDocumentHelper::BindPdfService(std::move(receiver), render_frame_host, std::make_unique<PDFDocumentHelperClientQt>());
+ }, &rfh));
+#endif // BUILDFLAG(ENABLE_PDF)
+ ContentBrowserClient::RegisterAssociatedInterfaceBindersForRenderFrameHost(rfh, associated_registry);
}
bool ContentBrowserClientQt::CanCreateWindow(
@@ -724,6 +568,15 @@ std::unique_ptr<device::LocationProvider> ContentBrowserClientQt::OverrideSystem
}
#endif
+device::GeolocationManager *ContentBrowserClientQt::GetGeolocationManager()
+{
+#if BUILDFLAG(IS_MAC)
+ return m_browserMainParts->GetGeolocationManager();
+#else
+ return nullptr;
+#endif
+}
+
bool ContentBrowserClientQt::ShouldEnableStrictSiteIsolation()
{
// mirroring AwContentBrowserClient, CastContentBrowserClient and
@@ -731,15 +584,13 @@ bool ContentBrowserClientQt::ShouldEnableStrictSiteIsolation()
return false;
}
-bool ContentBrowserClientQt::WillCreateRestrictedCookieManager(
- network::mojom::RestrictedCookieManagerRole role,
+bool ContentBrowserClientQt::WillCreateRestrictedCookieManager(network::mojom::RestrictedCookieManagerRole role,
content::BrowserContext *browser_context,
const url::Origin & /*origin*/,
- const GURL & /*site_for_cookies*/,
- const url::Origin & /*top_frame_origin*/,
- bool is_service_worker,
- int process_id,
- int routing_id,
+ const net::IsolationInfo & /*isolation_info*/,
+ bool /*is_service_worker*/,
+ int /*process_id*/,
+ int /*routing_id*/,
mojo::PendingReceiver<network::mojom::RestrictedCookieManager> *receiver)
{
mojo::PendingReceiver<network::mojom::RestrictedCookieManager> orig_receiver = std::move(*receiver);
@@ -750,53 +601,37 @@ bool ContentBrowserClientQt::WillCreateRestrictedCookieManager(
ProxyingRestrictedCookieManagerQt::CreateAndBind(
ProfileIODataQt::FromBrowserContext(browser_context),
std::move(target_rcm_remote),
- is_service_worker, process_id, routing_id,
std::move(orig_receiver));
return false; // only made a proxy, still need the actual impl to be made.
}
-bool ContentBrowserClientQt::AllowAppCache(const GURL &manifest_url,
- const GURL &first_party,
+content::AllowServiceWorkerResult
+ContentBrowserClientQt::AllowServiceWorker(const GURL &scope,
+ const net::SiteForCookies &site_for_cookies,
+ const absl::optional<url::Origin> & /*top_frame_origin*/,
+ const GURL & /*script_url*/,
content::BrowserContext *context)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- return static_cast<ProfileQt *>(context)->profileAdapter()->cookieStore()->d_func()->canAccessCookies(toQt(first_party), toQt(manifest_url));
-}
-
-bool ContentBrowserClientQt::AllowServiceWorkerOnIO(const GURL &scope,
- const GURL &site_for_cookies,
- const base::Optional<url::Origin> & /*top_frame_origin*/,
- const GURL & /*script_url*/,
- content::ResourceContext *context,
- base::RepeatingCallback<content::WebContents*()> wc_getter)
-{
- DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
- // FIXME: Chrome also checks if javascript is enabled here to check if has been disabled since the service worker
- // was started.
- return ProfileIODataQt::FromResourceContext(context)->canGetCookies(toQt(site_for_cookies), toQt(scope));
-}
-
-bool ContentBrowserClientQt::AllowServiceWorkerOnUI(const GURL &scope,
- const GURL &site_for_cookies,
- const base::Optional<url::Origin> & /*top_frame_origin*/,
- const GURL & /*script_url*/,
- content::BrowserContext *context,
- base::RepeatingCallback<content::WebContents*()> wc_getter)
-{
- DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ if (!context || context->ShutdownStarted())
+ return content::AllowServiceWorkerResult::No();
// FIXME: Chrome also checks if javascript is enabled here to check if has been disabled since the service worker
// was started.
- return static_cast<ProfileQt *>(context)->profileAdapter()->cookieStore()->d_func()->canAccessCookies(toQt(site_for_cookies), toQt(scope));
+ return static_cast<ProfileQt *>(context)->profileAdapter()->cookieStore()->d_func()->canAccessCookies(toQt(site_for_cookies.first_party_url()), toQt(scope))
+ ? content::AllowServiceWorkerResult::Yes()
+ : content::AllowServiceWorkerResult::No();
}
// We control worker access to FS and indexed-db using cookie permissions, this is mirroring Chromium's logic.
void ContentBrowserClientQt::AllowWorkerFileSystem(const GURL &url,
content::BrowserContext *context,
- const std::vector<content::GlobalFrameRoutingId> &/*render_frames*/,
+ const std::vector<content::GlobalRenderFrameHostId> &/*render_frames*/,
base::OnceCallback<void(bool)> callback)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ if (!context || context->ShutdownStarted())
+ return std::move(callback).Run(false);
std::move(callback).Run(
static_cast<ProfileQt *>(context)->profileAdapter()->cookieStore()->d_func()->canAccessCookies(toQt(url), toQt(url)));
}
@@ -804,55 +639,83 @@ void ContentBrowserClientQt::AllowWorkerFileSystem(const GURL &url,
bool ContentBrowserClientQt::AllowWorkerIndexedDB(const GURL &url,
content::BrowserContext *context,
- const std::vector<content::GlobalFrameRoutingId> &/*render_frames*/)
+ const std::vector<content::GlobalRenderFrameHostId> &/*render_frames*/)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ if (!context || context->ShutdownStarted())
+ return false;
return static_cast<ProfileQt *>(context)->profileAdapter()->cookieStore()->d_func()->canAccessCookies(toQt(url), toQt(url));
}
static void LaunchURL(const GURL& url,
- base::OnceCallback<content::WebContents*()> web_contents_getter,
- ui::PageTransition page_transition, bool is_main_frame, bool has_user_gesture)
+ base::RepeatingCallback<content::WebContents*()> web_contents_getter,
+ ui::PageTransition page_transition,
+ network::mojom::WebSandboxFlags sandbox_flags,
+ bool is_main_frame, bool has_user_gesture)
{
Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
content::WebContents* webContents = std::move(web_contents_getter).Run();
if (!webContents)
return;
- ProtocolHandlerRegistry* protocolHandlerRegistry =
- ProtocolHandlerRegistryFactory::GetForBrowserContext(
- webContents->GetBrowserContext());
- if (protocolHandlerRegistry &&
- protocolHandlerRegistry->IsHandledProtocol(url.scheme()))
+ custom_handlers::ProtocolHandlerRegistry *protocolHandlerRegistry =
+ ProtocolHandlerRegistryFactory::GetForBrowserContext(webContents->GetBrowserContext());
+ if (protocolHandlerRegistry && protocolHandlerRegistry->IsHandledProtocol(url.scheme()))
return;
+ // Sandbox flag logic from chrome/browser/chrome_content_browser_client.cc:
+ if (!is_main_frame) {
+ using SandboxFlags = network::mojom::WebSandboxFlags;
+ auto allow = [&](SandboxFlags flag) {
+ return (sandbox_flags & flag) == SandboxFlags::kNone;
+ };
+ bool allowed = (allow(SandboxFlags::kPopups)) ||
+ (allow(SandboxFlags::kTopNavigation)) ||
+ (allow(SandboxFlags::kTopNavigationByUserActivation) &&
+ has_user_gesture);
+
+ if (!allowed) {
+ content::RenderFrameHost *rfh = webContents->GetPrimaryMainFrame();
+ if (!base::CommandLine::ForCurrentProcess()->HasSwitch("disable-sandbox-external-protocols")) {
+ rfh->AddMessageToConsole(blink::mojom::ConsoleMessageLevel::kError,
+ "Navigation to external protocol blocked by sandbox.");
+ return;
+ }
+ }
+ }
+
WebContentsDelegateQt *contentsDelegate = static_cast<WebContentsDelegateQt*>(webContents->GetDelegate());
contentsDelegate->launchExternalURL(toQt(url), page_transition, is_main_frame, has_user_gesture);
}
bool ContentBrowserClientQt::HandleExternalProtocol(const GURL &url,
- base::OnceCallback<content::WebContents*()> web_contents_getter,
- int child_id,
+ base::RepeatingCallback<content::WebContents*()> web_contents_getter,
+ int frame_tree_node_id,
content::NavigationUIData *navigation_data,
- bool is_main_frame,
+ bool is_primary_main_frame,
+ bool is_in_fenced_frame_tree,
+ network::mojom::WebSandboxFlags sandbox_flags,
ui::PageTransition page_transition,
bool has_user_gesture,
- const base::Optional<url::Origin> &initiating_origin,
+ const absl::optional<url::Origin> &initiating_origin,
+ content::RenderFrameHost *initiator_document,
mojo::PendingRemote<network::mojom::URLLoaderFactory> *out_factory)
{
-// Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
- Q_UNUSED(child_id);
+ Q_UNUSED(frame_tree_node_id);
+ Q_UNUSED(is_in_fenced_frame_tree);
Q_UNUSED(navigation_data);
Q_UNUSED(initiating_origin);
+ Q_UNUSED(initiator_document);
Q_UNUSED(out_factory);
- base::PostTask(FROM_HERE, {content::BrowserThread::UI},
+ content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
base::BindOnce(&LaunchURL,
url,
std::move(web_contents_getter),
page_transition,
- is_main_frame,
+ sandbox_flags,
+ is_primary_main_frame,
has_user_gesture));
return true;
}
@@ -862,7 +725,7 @@ namespace {
class ProtocolHandlerThrottle : public blink::URLLoaderThrottle
{
public:
- explicit ProtocolHandlerThrottle(ProtocolHandlerRegistry *protocol_handler_registry)
+ explicit ProtocolHandlerThrottle(custom_handlers::ProtocolHandlerRegistry *protocol_handler_registry)
: protocol_handler_registry_(protocol_handler_registry)
{
}
@@ -877,7 +740,8 @@ public:
const network::mojom::URLResponseHead &response_head,
bool *defer,
std::vector<std::string> *to_be_removed_headers,
- net::HttpRequestHeaders *modified_headers) override
+ net::HttpRequestHeaders *modified_headers,
+ net::HttpRequestHeaders *modified_cors_exempt_headers) override
{
TranslateUrl(&redirect_info->new_url);
}
@@ -892,7 +756,7 @@ private:
*url = translated_url;
}
- ProtocolHandlerRegistry *protocol_handler_registry_;
+ custom_handlers::ProtocolHandlerRegistry *protocol_handler_registry_;
};
} // namespace
@@ -907,7 +771,7 @@ ContentBrowserClientQt::CreateURLLoaderThrottles(
ProtocolHandlerRegistryFactory::GetForBrowserContext(browser_context)));
#if BUILDFLAG(ENABLE_EXTENSIONS)
result.push_back(std::make_unique<PluginResponseInterceptorURLLoaderThrottle>(
- browser_context, request.resource_type, frame_tree_node_id));
+ request.destination, frame_tree_node_id));
#endif
return result;
}
@@ -938,23 +802,33 @@ WebContentsAdapterClient::NavigationType pageTransitionToNavigationType(ui::Page
}
}
-static bool navigationThrottleCallback(content::WebContents *source,
- const navigation_interception::NavigationParams &params)
+static bool navigationThrottleCallback(content::NavigationHandle *handle)
{
// We call navigationRequested later in launchExternalUrl for external protocols.
// The is_external_protocol parameter here is not fully accurate though,
// and doesn't know about profile specific custom URL schemes.
+ content::WebContents *source = handle->GetWebContents();
ProfileQt *profile = static_cast<ProfileQt *>(source->GetBrowserContext());
- if (params.is_external_protocol() && !profile->profileAdapter()->urlSchemeHandler(toQByteArray(params.url().scheme())))
+ if (handle->IsExternalProtocol() && !profile->profileAdapter()->urlSchemeHandler(toQByteArray(handle->GetURL().scheme())))
return false;
- int navigationRequestAction = WebContentsAdapterClient::AcceptRequest;
- WebContentsDelegateQt *delegate = static_cast<WebContentsDelegateQt *>(source->GetDelegate());
- WebContentsAdapterClient *client = delegate->adapterClient();
- client->navigationRequested(pageTransitionToNavigationType(params.transition_type()),
- toQt(params.url()),
- navigationRequestAction,
- params.is_main_frame());
- return navigationRequestAction == static_cast<int>(WebContentsAdapterClient::IgnoreRequest);
+
+ bool navigationAccepted = true;
+
+ WebContentsAdapterClient *client =
+ WebContentsViewQt::from(static_cast<content::WebContentsImpl *>(source)->GetView())->client();
+ if (!client)
+ return false;
+
+ // Redirects might not be reflected in transition_type at this point (see also chrome/.../web_navigation_api_helpers.cc)
+ auto transition_type = handle->GetPageTransition();
+ if (handle->WasServerRedirect())
+ transition_type = ui::PageTransitionFromInt(transition_type | ui::PAGE_TRANSITION_SERVER_REDIRECT);
+
+ client->navigationRequested(pageTransitionToNavigationType(transition_type),
+ toQt(handle->GetURL()),
+ navigationAccepted,
+ handle->IsInPrimaryMainFrame());
+ return !navigationAccepted;
}
std::vector<std::unique_ptr<content::NavigationThrottle>> ContentBrowserClientQt::CreateThrottlesForNavigation(
@@ -965,6 +839,14 @@ std::vector<std::unique_ptr<content::NavigationThrottle>> ContentBrowserClientQt
navigation_handle,
base::BindRepeating(&navigationThrottleCallback),
navigation_interception::SynchronyMode::kSync));
+
+#if BUILDFLAG(ENABLE_PDF) && BUILDFLAG(ENABLE_EXTENSIONS)
+ MaybeAddThrottle(
+ extensions::PDFIFrameNavigationThrottleQt::MaybeCreateThrottleFor(navigation_handle),
+ &throttles);
+ MaybeAddThrottle(pdf::PdfNavigationThrottle::MaybeCreateThrottleFor(navigation_handle, std::make_unique<PdfStreamDelegateQt>()), &throttles);
+#endif // BUILDFLAG(ENABLE_PDF) && BUIDLFLAG(ENABLE_EXTENSIONS)
+
return throttles;
}
@@ -973,6 +855,32 @@ bool ContentBrowserClientQt::IsHandledURL(const GURL &url)
return url::IsHandledProtocol(url.scheme());
}
+bool ContentBrowserClientQt::HasCustomSchemeHandler(content::BrowserContext *browser_context,
+ const std::string &scheme)
+{
+ if (custom_handlers::ProtocolHandlerRegistry *protocol_handler_registry =
+ ProtocolHandlerRegistryFactory::GetForBrowserContext(browser_context)) {
+ return protocol_handler_registry->IsHandledProtocol(scheme);
+ }
+
+ return false;
+}
+
+bool ContentBrowserClientQt::HasErrorPage(int httpStatusCode, content::WebContents *contents)
+{
+ if (contents) {
+ WebEngineSettings *settings = nullptr;
+ WebContentsDelegateQt *delegate =
+ static_cast<WebContentsDelegateQt*>(contents->GetDelegate());
+ if (delegate)
+ settings = delegate->webEngineSettings();
+ if (settings && !settings->testAttribute(QWebEngineSettings::ErrorPageEnabled))
+ return false;
+ }
+ // Use an internal error page, if we have one for the status code.
+ return error_page::LocalizedError::HasStrings(error_page::Error::kHttpErrorDomain, httpStatusCode);
+}
+
std::unique_ptr<content::LoginDelegate> ContentBrowserClientQt::CreateLoginDelegate(
const net::AuthChallengeInfo &authInfo,
content::WebContents *web_contents,
@@ -1033,10 +941,40 @@ bool ContentBrowserClientQt::ShouldTreatURLSchemeAsFirstPartyWhenTopLevel(base::
#endif
}
+bool ContentBrowserClientQt::DoesSchemeAllowCrossOriginSharedWorker(const std::string &scheme)
+{
+#if BUILDFLAG(ENABLE_EXTENSIONS)
+ // Extensions are allowed to start cross-origin shared workers.
+ return scheme == extensions::kExtensionScheme;
+#else
+ return false;
+#endif
+}
+
+void ContentBrowserClientQt::OverrideURLLoaderFactoryParams(content::BrowserContext *browser_context,
+ const url::Origin &origin,
+ bool is_for_isolated_world,
+ network::mojom::URLLoaderFactoryParams *factory_params)
+{
+#if BUILDFLAG(ENABLE_EXTENSIONS)
+ extensions::URLLoaderFactoryManager::OverrideURLLoaderFactoryParams(
+ browser_context, origin, is_for_isolated_world, factory_params);
+#endif
+}
+
std::string ContentBrowserClientQt::getUserAgent()
{
// Mention the Chromium version we're based on to get passed stupid UA-string-based feature detection (several WebRTC demos need this)
- return content::BuildUserAgentFromProduct("QtWebEngine/" QTWEBENGINECORE_VERSION_STR " Chrome/" CHROMIUM_VERSION);
+ return content::BuildUserAgentFromProduct("QtWebEngine/" + std::string(qWebEngineVersion())
+ + " Chrome/"
+ + std::string(qWebEngineChromiumVersion()));
+}
+
+blink::UserAgentMetadata ContentBrowserClientQt::GetUserAgentMetadata()
+{
+ // Implemented only for safe-keeping. It will be overridden on WebContents level.
+ static blink::UserAgentMetadata userAgentMetadata(embedder_support::GetUserAgentMetadata());
+ return userAgentMetadata;
}
std::string ContentBrowserClientQt::GetProduct()
@@ -1068,32 +1006,30 @@ void ContentBrowserClientQt::OnNetworkServiceCreated(network::mojom::NetworkServ
SystemNetworkContextManager::GetInstance()->OnNetworkServiceCreated(network_service);
}
-mojo::Remote<network::mojom::NetworkContext> ContentBrowserClientQt::CreateNetworkContext(
+void ContentBrowserClientQt::ConfigureNetworkContextParams(
content::BrowserContext *context,
bool in_memory,
- const base::FilePath &relative_partition_path)
+ const base::FilePath &relative_partition_path,
+ network::mojom::NetworkContextParams *network_context_params,
+ cert_verifier::mojom::CertVerifierCreationParams *cert_verifier_creation_params)
{
- mojo::Remote<network::mojom::NetworkContext> network_context;
- // ### do we need to pass in_memory and relative_partition_path to ProfileIODataQt::CreateNetworkContextParams() ?
- network::mojom::NetworkContextParamsPtr context_params = ProfileIODataQt::FromBrowserContext(context)->CreateNetworkContextParams();
- content::GetNetworkService()->CreateNetworkContext(
- network_context.BindNewPipeAndPassReceiver(), std::move(context_params));
-
- network::mojom::CookieManagerPtrInfo cookie_manager_info;
- network_context->GetCookieManager(mojo::MakeRequest(&cookie_manager_info));
- ProfileIODataQt::FromBrowserContext(context)->cookieDelegate()->setMojoCookieManager(std::move(cookie_manager_info));
+ ProfileIODataQt::FromBrowserContext(context)->ConfigureNetworkContextParams(in_memory, relative_partition_path,
+ network_context_params, cert_verifier_creation_params);
- return network_context;
+ mojo::PendingRemote<network::mojom::CookieManager> cookie_manager_remote;
+ network_context_params->cookie_manager = cookie_manager_remote.InitWithNewPipeAndPassReceiver();
+ ProfileIODataQt::FromBrowserContext(context)->cookieDelegate()->setMojoCookieManager(std::move(cookie_manager_remote));
}
std::vector<base::FilePath> ContentBrowserClientQt::GetNetworkContextsParentDirectory()
{
return {
- toFilePath(QStandardPaths::writableLocation(QStandardPaths::DataLocation)),
+ toFilePath(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation)),
toFilePath(QStandardPaths::writableLocation(QStandardPaths::CacheLocation)) };
}
void ContentBrowserClientQt::RegisterNonNetworkNavigationURLLoaderFactories(int frame_tree_node_id,
+ ukm::SourceIdObj ukm_source_id,
NonNetworkURLLoaderFactoryMap *factories)
{
content::WebContents *web_contents = content::WebContents::FromFrameTreeNodeId(frame_tree_node_id);
@@ -1106,7 +1042,7 @@ void ContentBrowserClientQt::RegisterNonNetworkNavigationURLLoaderFactories(int
#if BUILDFLAG(ENABLE_EXTENSIONS)
factories->emplace(
extensions::kExtensionScheme,
- extensions::CreateExtensionNavigationURLLoaderFactory(profile,
+ extensions::CreateExtensionNavigationURLLoaderFactory(profile, ukm_source_id,
!!extensions::WebViewGuest::FromWebContents(web_contents)));
#endif
}
@@ -1119,11 +1055,39 @@ void ContentBrowserClientQt::RegisterNonNetworkWorkerMainResourceURLLoaderFactor
for (const QByteArray &scheme : profileAdapter->customUrlSchemes())
factories->emplace(scheme.toStdString(), CreateCustomURLLoaderFactory(profileAdapter));
+
+#if BUILDFLAG(ENABLE_EXTENSIONS)
+ factories->emplace(
+ extensions::kExtensionScheme,
+ extensions::CreateExtensionWorkerMainResourceURLLoaderFactory(browser_context));
+#endif // BUILDFLAG(ENABLE_EXTENSIONS)
+}
+
+void ContentBrowserClientQt::RegisterNonNetworkServiceWorkerUpdateURLLoaderFactories(content::BrowserContext* browser_context,
+ NonNetworkURLLoaderFactoryMap* factories)
+{
+ Profile *profile = Profile::FromBrowserContext(browser_context);
+ ProfileAdapter *profileAdapter = static_cast<ProfileQt *>(profile)->profileAdapter();
+
+ for (const QByteArray &scheme : profileAdapter->customUrlSchemes()) {
+ if (const url::CustomScheme *cs = url::CustomScheme::FindScheme(scheme.toStdString())) {
+ if (cs->flags & url::CustomScheme::ServiceWorkersAllowed)
+ factories->emplace(scheme.toStdString(), CreateCustomURLLoaderFactory(profileAdapter));
+ }
+ }
+
+#if BUILDFLAG(ENABLE_EXTENSIONS)
+ factories->emplace(
+ extensions::kExtensionScheme,
+ extensions::CreateExtensionServiceWorkerScriptURLLoaderFactory(browser_context));
+#endif // BUILDFLAG(ENABLE_EXTENSIONS)
}
void ContentBrowserClientQt::RegisterNonNetworkSubresourceURLLoaderFactories(int render_process_id, int render_frame_id,
+ const absl::optional<url::Origin> &request_initiator_origin,
NonNetworkURLLoaderFactoryMap *factories)
{
+ Q_UNUSED(request_initiator_origin);
content::RenderProcessHost *process_host = content::RenderProcessHost::FromID(render_process_id);
Profile *profile = Profile::FromBrowserContext(process_host->GetBrowserContext());
ProfileAdapter *profileAdapter = static_cast<ProfileQt *>(profile)->profileAdapter();
@@ -1137,23 +1101,18 @@ void ContentBrowserClientQt::RegisterNonNetworkSubresourceURLLoaderFactories(int
if (web_contents)
url = web_contents->GetVisibleURL();
- // Install file scheme if necessary:
- // FIXME: "extension -> file" will not be needed after switching to using transferable url loaders and guest views.
- // FIXME: "qrc -> file" should be reconsidered for Qt6.
- bool install_file_scheme = url.SchemeIs("qrc");
+ bool is_background_page = false;
#if BUILDFLAG(ENABLE_EXTENSIONS)
- install_file_scheme = install_file_scheme || url.SchemeIs(extensions::kExtensionScheme);
-#endif
- if (!install_file_scheme && web_contents) {
- const auto *settings = static_cast<WebContentsDelegateQt *>(web_contents->GetDelegate())->webEngineSettings();
- if (settings->testAttribute(WebEngineSettings::LocalContentCanAccessFileUrls)) {
- for (const auto &local_scheme : url::GetLocalSchemes()) {
- if (url.SchemeIs(local_scheme)) {
- install_file_scheme = true;
- break;
- }
- }
- }
+ is_background_page = extensions::GetViewType(web_contents) == extensions::mojom::ViewType::kExtensionBackgroundPage;
+#endif // BUILDFLAG(ENABLE_EXTENSIONS)
+
+ // Install file scheme if necessary:
+ bool install_file_scheme = false;
+ if (web_contents && !is_background_page) {
+ const std::string scheme = url.scheme();
+ install_file_scheme = base::Contains(url::GetLocalSchemes(), scheme);
+ if (const url::CustomScheme *cs = url::CustomScheme::FindScheme(scheme))
+ install_file_scheme = cs->flags & (url::CustomScheme::LocalAccessAllowed | url::CustomScheme::Local);
}
if (install_file_scheme && factories->find(url::kFileScheme) == factories->end()) {
@@ -1189,48 +1148,236 @@ void ContentBrowserClientQt::RegisterNonNetworkSubresourceURLLoaderFactories(int
}
if (!allowed_webui_hosts.empty()) {
factories->emplace(content::kChromeUIScheme,
- content::CreateWebUIURLLoader(frame_host,
- content::kChromeUIScheme,
- std::move(allowed_webui_hosts)));
+ content::CreateWebUIURLLoaderFactory(frame_host,
+ content::kChromeUIScheme,
+ std::move(allowed_webui_hosts)));
}
#endif
}
+base::flat_set<std::string> ContentBrowserClientQt::GetPluginMimeTypesWithExternalHandlers(
+ content::BrowserContext *browser_context)
+{
+ base::flat_set<std::string> mime_types;
+#if BUILDFLAG(ENABLE_EXTENSIONS)
+ ProfileQt *profile = static_cast<ProfileQt *>(browser_context);
+ for (const std::string &extension_id : MimeTypesHandler::GetMIMETypeAllowlist()) {
+ const extensions::Extension *extension =
+ extensions::ExtensionRegistry::Get(browser_context)
+ ->enabled_extensions()
+ .GetByID(extension_id);
+ // The allowed extension may not be installed, so we have to nullptr
+ // check |extension|.
+ if (!extension ||
+ (profile->IsOffTheRecord() && !extensions::util::IsIncognitoEnabled(
+ extension_id, browser_context))) {
+ continue;
+ }
+ if (MimeTypesHandler *handler = MimeTypesHandler::GetHandler(extension)) {
+ for (const auto &supported_mime_type : handler->mime_type_set())
+ mime_types.insert(supported_mime_type);
+ }
+ }
+#endif
+#if BUILDFLAG(ENABLE_PDF)
+ mime_types.insert("application/x-google-chrome-pdf");
+#endif
+ return mime_types;
+}
+
bool ContentBrowserClientQt::WillCreateURLLoaderFactory(
content::BrowserContext *browser_context,
content::RenderFrameHost *frame,
int render_process_id,
URLLoaderFactoryType type,
const url::Origin &request_initiator,
- base::Optional<int64_t> navigation_id,
+ absl::optional<int64_t> navigation_id,
+ ukm::SourceIdObj ukm_source_id,
mojo::PendingReceiver<network::mojom::URLLoaderFactory> *factory_receiver,
mojo::PendingRemote<network::mojom::TrustedURLLoaderHeaderClient> *header_client,
bool *bypass_redirect_checks,
- network::mojom::URLLoaderFactoryOverridePtr *factory_override)
+ bool *disable_secure_dns,
+ network::mojom::URLLoaderFactoryOverridePtr *factory_override,
+ scoped_refptr<base::SequencedTaskRunner> navigation_response_task_runner)
+{
+ Q_UNUSED(render_process_id);
+ Q_UNUSED(type);
+ Q_UNUSED(request_initiator);
+ Q_UNUSED(navigation_id);
+ Q_UNUSED(ukm_source_id);
+ Q_UNUSED(header_client);
+ Q_UNUSED(bypass_redirect_checks);
+ Q_UNUSED(disable_secure_dns);
+ Q_UNUSED(factory_override);
+ auto adapter = static_cast<ProfileQt *>(browser_context)->profileAdapter();
+ auto proxied_receiver = std::move(*factory_receiver);
+ mojo::PendingRemote<network::mojom::URLLoaderFactory> pending_url_loader_factory;
+ *factory_receiver = pending_url_loader_factory.InitWithNewPipeAndPassReceiver();
+ // Will manage its own lifetime
+ // FIXME: use navigation_response_task_runner?
+ new ProxyingURLLoaderFactoryQt(adapter,
+ frame ? frame->GetFrameTreeNodeId() : content::RenderFrameHost::kNoFrameTreeNodeId,
+ std::move(proxied_receiver), std::move(pending_url_loader_factory));
+ return true;
+}
+
+std::vector<std::unique_ptr<content::URLLoaderRequestInterceptor>>
+ContentBrowserClientQt::WillCreateURLLoaderRequestInterceptors(content::NavigationUIData* navigation_ui_data,
+ int frame_tree_node_id, int64_t navigation_id,
+ scoped_refptr<base::SequencedTaskRunner> navigation_response_task_runner)
{
- auto *web_contents = content::WebContents::FromRenderFrameHost(frame);
- ProfileQt *profile = static_cast<ProfileQt *>(browser_context);
+ std::vector<std::unique_ptr<content::URLLoaderRequestInterceptor>> interceptors;
+#if BUILDFLAG(ENABLE_PDF) && BUILDFLAG(ENABLE_EXTENSIONS)
+ {
+ std::unique_ptr<content::URLLoaderRequestInterceptor> pdf_interceptor =
+ pdf::PdfURLLoaderRequestInterceptor::MaybeCreateInterceptor(
+ frame_tree_node_id, std::make_unique<PdfStreamDelegateQt>());
+ if (pdf_interceptor)
+ interceptors.push_back(std::move(pdf_interceptor));
+ }
+#endif // BUILDFLAG(ENABLE_PDF) && BUIDLFLAG(ENABLE_EXTENSIONS)
- QWebEngineUrlRequestInterceptor *profile_interceptor = profile->profileAdapter()->requestInterceptor();
- QWebEngineUrlRequestInterceptor *page_interceptor = nullptr;
+ return interceptors;
+}
+
+bool ContentBrowserClientQt::WillInterceptWebSocket(content::RenderFrameHost *frame)
+{
+ return frame != nullptr;
+}
+
+QWebEngineUrlRequestInterceptor *getProfileInterceptorFromFrame(content::RenderFrameHost *frame)
+{
+ ProfileQt *profile = static_cast<ProfileQt *>(frame->GetBrowserContext());
+ if (profile)
+ return profile->profileAdapter()->requestInterceptor();
+ return nullptr;
+}
+QWebEngineUrlRequestInterceptor *getPageInterceptor(content::WebContents *web_contents)
+{
if (web_contents) {
- WebContentsAdapterClient *client =
- WebContentsViewQt::from(static_cast<content::WebContentsImpl *>(web_contents)->GetView())->client();
- page_interceptor = client->webContentsAdapter()->requestInterceptor();
+ auto view = static_cast<content::WebContentsImpl *>(web_contents)->GetView();
+ if (WebContentsAdapterClient *client = WebContentsViewQt::from(view)->client())
+ return client->webContentsAdapter()->requestInterceptor();
}
+ return nullptr;
+}
- if (profile_interceptor || page_interceptor) {
- int process_id = type == URLLoaderFactoryType::kNavigation ? 0 : render_process_id;
- auto proxied_receiver = std::move(*factory_receiver);
- mojo::PendingRemote<network::mojom::URLLoaderFactory> pending_url_loader_factory;
- *factory_receiver = pending_url_loader_factory.InitWithNewPipeAndPassReceiver();
- // Will manage its own lifetime
- new ProxyingURLLoaderFactoryQt(process_id, profile_interceptor, page_interceptor, std::move(proxied_receiver),
- std::move(pending_url_loader_factory));
- return true;
+void ContentBrowserClientQt::CreateWebSocket(
+ content::RenderFrameHost *frame,
+ WebSocketFactory factory,
+ const GURL &url,
+ const net::SiteForCookies &site_for_cookies,
+ const absl::optional<std::string> &user_agent,
+ mojo::PendingRemote<network::mojom::WebSocketHandshakeClient> handshake_client)
+{
+ QWebEngineUrlRequestInterceptor *profileInterceptor = getProfileInterceptorFromFrame(frame);
+ content::WebContents *web_contents = content::WebContents::FromRenderFrameHost(frame);
+ QWebEngineUrlRequestInterceptor *pageInterceptor = getPageInterceptor(web_contents);
+ std::vector<network::mojom::HttpHeaderPtr> headers;
+ GURL to_url = url;
+ bool addedUserAgent = false;
+ if (profileInterceptor || pageInterceptor) {
+ QUrl initiator = web_contents ? toQt(web_contents->GetURL()) : QUrl();
+ auto *infoPrivate = new QWebEngineUrlRequestInfoPrivate(
+ QWebEngineUrlRequestInfo::ResourceTypeWebSocket,
+ QWebEngineUrlRequestInfo::NavigationTypeOther,
+ toQt(url), toQt(site_for_cookies.first_party_url()), initiator,
+ QByteArrayLiteral("GET"));
+ QWebEngineUrlRequestInfo requestInfo(infoPrivate);
+ if (profileInterceptor) {
+ profileInterceptor->interceptRequest(requestInfo);
+ pageInterceptor = getPageInterceptor(web_contents);
+ }
+ if (pageInterceptor && !requestInfo.changed())
+ pageInterceptor->interceptRequest(requestInfo);
+ if (infoPrivate->shouldBlockRequest)
+ return; // ### should we call OnFailure on handshake_client?
+ if (infoPrivate->shouldRedirectRequest)
+ to_url = toGurl(infoPrivate->url);
+ for (auto header = infoPrivate->extraHeaders.constBegin(); header != infoPrivate->extraHeaders.constEnd(); ++header) {
+ std::string h = header.key().toStdString();
+ if (base::EqualsCaseInsensitiveASCII(h, net::HttpRequestHeaders::kUserAgent))
+ addedUserAgent = true;
+ headers.push_back(network::mojom::HttpHeader::New(h, header.value().toStdString()));
+ }
}
- return false;
+ if (!addedUserAgent && user_agent)
+ headers.push_back(network::mojom::HttpHeader::New(net::HttpRequestHeaders::kUserAgent, *user_agent));
+
+ std::move(factory).Run(to_url, std::move(headers), std::move(handshake_client), mojo::NullRemote(), mojo::NullRemote());
+}
+
+void ContentBrowserClientQt::SiteInstanceGotProcess(content::SiteInstance *site_instance)
+{
+#if BUILDFLAG(ENABLE_EXTENSIONS)
+ content::BrowserContext *context = site_instance->GetBrowserContext();
+ extensions::ExtensionRegistry *registry = extensions::ExtensionRegistry::Get(context);
+ if (!registry)
+ return;
+ if (site_instance->IsGuest())
+ return;
+ auto site_url = site_instance->GetSiteURL();
+ if (!site_url.SchemeIs(extensions::kExtensionScheme))
+ return;
+ const extensions::Extension *extension = registry->enabled_extensions().GetByID(site_url.host());
+ if (!extension)
+ return;
+
+ extensions::ProcessMap *processMap = extensions::ProcessMap::Get(context);
+ processMap->Insert(extension->id(), site_instance->GetProcess()->GetID());
+#endif
+}
+
+std::unique_ptr<content::WebContentsViewDelegate> ContentBrowserClientQt::GetWebContentsViewDelegate(content::WebContents *web_contents)
+{
+ FormInteractionTabHelper::CreateForWebContents(web_contents);
+ FileSystemAccessPermissionRequestManagerQt::CreateForWebContents(web_contents);
+ if (auto *registry = performance_manager::PerformanceManagerRegistry::GetInstance())
+ registry->MaybeCreatePageNodeForWebContents(web_contents);
+
+ return nullptr;
+}
+
+content::ContentBrowserClient::AllowWebBluetoothResult
+ContentBrowserClientQt::AllowWebBluetooth(content::BrowserContext *browser_context,
+ const url::Origin &requesting_origin,
+ const url::Origin &embedding_origin)
+{
+ DCHECK(browser_context);
+ return content::ContentBrowserClient::AllowWebBluetoothResult::BLOCK_GLOBALLY_DISABLED;
+}
+
+content::WebAuthenticationDelegate *ContentBrowserClientQt::GetWebAuthenticationDelegate()
+{
+ static base::NoDestructor<WebAuthenticationDelegateQt> delegate;
+ return delegate.get();
+}
+
+#if !BUILDFLAG(IS_ANDROID)
+std::unique_ptr<content::AuthenticatorRequestClientDelegate>
+ContentBrowserClientQt::GetWebAuthenticationRequestDelegate(
+ content::RenderFrameHost *render_frame_host)
+{
+ return std::make_unique<AuthenticatorRequestClientDelegateQt>(render_frame_host);
+}
+#endif
+
+void ContentBrowserClientQt::GetMediaDeviceIDSalt(content::RenderFrameHost *rfh,
+ const net::SiteForCookies & /*site_for_cookies*/,
+ const blink::StorageKey & /*storage_key*/,
+ base::OnceCallback<void(bool, const std::string&)> callback)
+{
+#if BUILDFLAG(ENABLE_WEBRTC)
+ content::BrowserContext *browser_context = rfh->GetBrowserContext();
+ if (!browser_context->IsOffTheRecord()) {
+ ProfileQt *profile = static_cast<ProfileQt *>(browser_context);
+ std::string mediaId = profile->GetMediaDeviceIDSalt();
+ std::move(callback).Run(true, mediaId);
+ return;
+ }
+#endif
+ std::move(callback).Run(false, "");
}
} // namespace QtWebEngineCore
diff --git a/src/core/content_browser_client_qt.h b/src/core/content_browser_client_qt.h
index 341564574..7d8e98028 100644
--- a/src/core/content_browser_client_qt.h
+++ b/src/core/content_browser_client_qt.h
@@ -1,53 +1,12 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef CONTENT_BROWSER_CLIENT_QT_H
#define CONTENT_BROWSER_CLIENT_QT_H
#include "qtwebenginecoreglobal_p.h"
-#include "base/memory/ref_counted.h"
#include "content/public/browser/content_browser_client.h"
-namespace net {
-class URLRequestContextGetter;
-}
-
namespace content {
class BrowserContext;
class BrowserMainParts;
@@ -59,39 +18,30 @@ class BrowserPpapiHost;
class DevToolsManagerDelegate;
class RenderFrameHost;
class RenderProcessHost;
-class RenderViewHostDelegateView;
class ResourceContext;
-class ResourceDispatcherHostDelegate;
-class WebContentsViewPort;
class WebContents;
struct MainFunctionParams;
struct Referrer;
-}
+} // namespace content
-namespace gl {
-class GLShareGroup;
-}
+namespace device {
+class GeolocationManager;
+} // namespace device
namespace QtWebEngineCore {
class BrowserMainPartsQt;
-class ProfileQt;
-class ShareGroupQtQuick;
class ContentBrowserClientQt : public content::ContentBrowserClient
{
public:
ContentBrowserClientQt();
~ContentBrowserClientQt();
- std::unique_ptr<content::BrowserMainParts> CreateBrowserMainParts(const content::MainFunctionParams&) override;
+ std::unique_ptr<content::BrowserMainParts> CreateBrowserMainParts(bool is_integration_test) override;
void RenderProcessWillLaunch(content::RenderProcessHost *host) override;
- gl::GLShareGroup* GetInProcessGpuShareGroup() override;
content::MediaObserver* GetMediaObserver() override;
- scoped_refptr<content::QuotaPermissionContext> CreateQuotaPermissionContext() override;
- void GetQuotaSettings(content::BrowserContext *context,
- content::StoragePartition *partition,
- base::OnceCallback<void(base::Optional<storage::QuotaSettings>)> callback) override;
- void OverrideWebkitPrefs(content::RenderViewHost *, content::WebPreferences *) override;
+ void OverrideWebkitPrefs(content::WebContents *web_contents,
+ blink::web_pref::WebPreferences *prefs) override;
void AllowCertificateError(content::WebContents *web_contents,
int cert_error,
const net::SSLInfo &ssl_info,
@@ -99,13 +49,13 @@ public:
bool is_main_frame_request,
bool strict_enforcement,
base::OnceCallback<void(content::CertificateRequestResultType)> callback) override;
- base::OnceClosure SelectClientCertificate(content::WebContents* web_contents,
+ base::OnceClosure SelectClientCertificate(content::BrowserContext* browser_context,
+ content::WebContents* web_contents,
net::SSLCertRequestInfo* cert_request_info,
net::ClientCertIdentityList client_certs,
std::unique_ptr<content::ClientCertificateDelegate> delegate) override;
std::unique_ptr<net::ClientCertStore> CreateClientCertStore(content::BrowserContext *browser_context) override;
- content::DevToolsManagerDelegate *GetDevToolsManagerDelegate() override;
- content::PlatformNotificationService * GetPlatformNotificationService(content::BrowserContext *browser_context) override;
+ std::unique_ptr<content::DevToolsManagerDelegate> CreateDevToolsManagerDelegate() override;
std::string GetApplicationLocale() override;
std::string GetAcceptLangs(content::BrowserContext* context) override;
@@ -115,18 +65,18 @@ public:
void GetAdditionalWebUISchemes(std::vector<std::string>* additional_schemes) override;
void GetAdditionalAllowedSchemesForFileSystem(std::vector<std::string>* additional_schemes) override;
- void BindInterfaceRequestFromFrame(content::RenderFrameHost* render_frame_host,
- const std::string& interface_name,
- mojo::ScopedMessagePipeHandle interface_pipe) override;
+ std::unique_ptr<ui::SelectFilePolicy>
+ CreateSelectFilePolicy(content::WebContents *web_contents) override;
void BindHostReceiverForRenderer(content::RenderProcessHost *render_process_host,
mojo::GenericPendingReceiver receiver) override;
void RegisterBrowserInterfaceBindersForFrame(content::RenderFrameHost *render_frame_host,
- service_manager::BinderMapWithContext<content::RenderFrameHost *> *map) override;
- void RunServiceInstance(const service_manager::Identity &identity,
- mojo::PendingReceiver<service_manager::mojom::Service> *receiver) override;
+ mojo::BinderMapWithContext<content::RenderFrameHost *> *map) override;
+ void ExposeInterfacesToRenderer(service_manager::BinderRegistry *registry,
+ blink::AssociatedInterfaceRegistry *associated_registry,
+ content::RenderProcessHost *render_process_host) override;
+ void RegisterAssociatedInterfaceBindersForRenderFrameHost(content::RenderFrameHost &render_frame_host,
+ blink::AssociatedInterfaceRegistry &associated_registry) override;
- std::vector<service_manager::Manifest> GetExtraServiceManifests() override;
- base::Optional<service_manager::Manifest> GetServiceManifestOverlay(base::StringPiece name) override;
bool CanCreateWindow(content::RenderFrameHost *opener,
const GURL &opener_url,
const GURL &opener_top_level_frame_url,
@@ -146,43 +96,44 @@ public:
network::mojom::RestrictedCookieManagerRole role,
content::BrowserContext *browser_context,
const url::Origin &origin,
- const GURL &site_for_cookies,
- const url::Origin &top_frame_origin,
+ const net::IsolationInfo &isolation_info,
bool is_service_worker,
int process_id,
int routing_id,
mojo::PendingReceiver<network::mojom::RestrictedCookieManager> *receiver) override;
+ bool WillInterceptWebSocket(content::RenderFrameHost *frame) override;
+ void CreateWebSocket(
+ content::RenderFrameHost *frame,
+ WebSocketFactory factory,
+ const GURL &url,
+ const net::SiteForCookies &site_for_cookies,
+ const absl::optional<std::string> &user_agent,
+ mojo::PendingRemote<network::mojom::WebSocketHandshakeClient> handshake_client) override;
- bool AllowAppCache(const GURL &manifest_url,
- const GURL &first_party,
- content::BrowserContext *context) override;
-
- bool AllowServiceWorkerOnIO(const GURL &scope,
- const GURL &site_for_cookies,
- const base::Optional<url::Origin> &top_frame_origin,
- const GURL &script_url,
- content::ResourceContext *context,
- base::RepeatingCallback<content::WebContents*()> wc_getter) override;
-
- bool AllowServiceWorkerOnUI(const GURL &scope,
- const GURL &site_for_cookies,
- const base::Optional<url::Origin> &top_frame_origin,
- const GURL &script_url,
- content::BrowserContext *context,
- base::RepeatingCallback<content::WebContents*()> wc_getter) override;
+ content::AllowServiceWorkerResult AllowServiceWorker(
+ const GURL &scope,
+ const net::SiteForCookies &site_for_cookies,
+ const absl::optional<url::Origin> &top_frame_origin,
+ const GURL &script_url,
+ content::BrowserContext *context) override;
void AllowWorkerFileSystem(const GURL &url,
content::BrowserContext *context,
- const std::vector<content::GlobalFrameRoutingId> &render_frames,
+ const std::vector<content::GlobalRenderFrameHostId> &render_frames,
base::OnceCallback<void(bool)> callback) override;
bool AllowWorkerIndexedDB(const GURL &url,
content::BrowserContext *context,
- const std::vector<content::GlobalFrameRoutingId> &render_frames) override;
+ const std::vector<content::GlobalRenderFrameHostId> &render_frames) override;
+ AllowWebBluetoothResult AllowWebBluetooth(content::BrowserContext *browser_context,
+ const url::Origin &requesting_origin,
+ const url::Origin &embedding_origin) override;
#if QT_CONFIG(webengine_geolocation)
std::unique_ptr<device::LocationProvider> OverrideSystemLocationProvider() override;
#endif
+ device::GeolocationManager *GetGeolocationManager() override;
+
bool ShouldIsolateErrorPage(bool in_main_frame) override;
bool ShouldUseProcessPerSite(content::BrowserContext *browser_context, const GURL &effective_url) override;
bool DoesSiteRequireDedicatedProcess(content::BrowserContext *browser_context,
@@ -190,15 +141,15 @@ public:
bool ShouldUseSpareRenderProcessHost(content::BrowserContext *browser_context, const GURL& site_url) override;
bool ShouldTreatURLSchemeAsFirstPartyWhenTopLevel(base::StringPiece scheme,
bool is_embedded_origin_secure) override;
-
+ bool DoesSchemeAllowCrossOriginSharedWorker(const std::string &scheme) override;
+ void OverrideURLLoaderFactoryParams(content::BrowserContext *browser_context,
+ const url::Origin &origin,
+ bool is_for_isolated_world,
+ network::mojom::URLLoaderFactoryParams *factory_params) override;
#if defined(Q_OS_LINUX)
void GetAdditionalMappedFilesForChildProcess(const base::CommandLine& command_line, int child_process_id, content::PosixFileDescriptorInfo* mappings) override;
#endif
-#if QT_CONFIG(webengine_pepper_plugins)
- void DidCreatePpapiPlugin(content::BrowserPpapiHost* browser_host) override;
-#endif
-
std::unique_ptr<content::LoginDelegate> CreateLoginDelegate(
const net::AuthChallengeInfo &auth_info,
content::WebContents *web_contents,
@@ -211,13 +162,16 @@ public:
bool HandleExternalProtocol(
const GURL &url,
- base::OnceCallback<content::WebContents*()> web_contents_getter,
- int child_id,
+ base::RepeatingCallback<content::WebContents*()> web_contents_getter,
+ int frame_tree_node_id,
content::NavigationUIData *navigation_data,
- bool is_main_frame,
+ bool is_primary_main_frame,
+ bool is_in_fenced_frame_tree,
+ network::mojom::WebSandboxFlags sandbox_flags,
ui::PageTransition page_transition,
bool has_user_gesture,
- const base::Optional<url::Origin> &initiating_origin,
+ const absl::optional<url::Origin> &initiating_origin,
+ content::RenderFrameHost *initiator_document,
mojo::PendingRemote<network::mojom::URLLoaderFactory> *out_factory) override;
std::vector<std::unique_ptr<blink::URLLoaderThrottle>> CreateURLLoaderThrottles(
@@ -229,41 +183,71 @@ public:
content::NavigationHandle *navigation_handle) override;
bool IsHandledURL(const GURL &url) override;
-
+ bool HasErrorPage(int http_status_code, content::WebContents *contents) override;
+ bool HasCustomSchemeHandler(content::BrowserContext *browser_context,
+ const std::string &scheme) override;
+ std::vector<std::unique_ptr<content::URLLoaderRequestInterceptor>>
+ WillCreateURLLoaderRequestInterceptors(content::NavigationUIData *navigation_ui_data,
+ int frame_tree_node_id,
+ int64_t navigation_id,
+ scoped_refptr<base::SequencedTaskRunner> navigation_response_task_runner) override;
bool WillCreateURLLoaderFactory(content::BrowserContext *browser_context,
content::RenderFrameHost *frame,
int render_process_id,
URLLoaderFactoryType type,
const url::Origin &request_initiator,
- base::Optional<int64_t> navigation_id,
+ absl::optional<int64_t> navigation_id,
+ ukm::SourceIdObj ukm_source_id,
mojo::PendingReceiver<network::mojom::URLLoaderFactory> *factory_receiver,
mojo::PendingRemote<network::mojom::TrustedURLLoaderHeaderClient> *header_client,
bool *bypass_redirect_checks,
- network::mojom::URLLoaderFactoryOverridePtr *factory_override) override;
+ bool *disable_secure_dns,
+ network::mojom::URLLoaderFactoryOverridePtr *factory_override,
+ scoped_refptr<base::SequencedTaskRunner> navigation_response_task_runner) override;
scoped_refptr<network::SharedURLLoaderFactory> GetSystemSharedURLLoaderFactory() override;
network::mojom::NetworkContext *GetSystemNetworkContext() override;
void OnNetworkServiceCreated(network::mojom::NetworkService *network_service) override;
- mojo::Remote<network::mojom::NetworkContext> CreateNetworkContext(content::BrowserContext *context,
- bool in_memory,
- const base::FilePath &relative_partition_path) override;
+ void ConfigureNetworkContextParams(content::BrowserContext *context,
+ bool in_memory,
+ const base::FilePath &relative_partition_path,
+ network::mojom::NetworkContextParams *network_context_params,
+ cert_verifier::mojom::CertVerifierCreationParams *cert_verifier_creation_params) override;
+
std::vector<base::FilePath> GetNetworkContextsParentDirectory() override;
- void RegisterNonNetworkNavigationURLLoaderFactories(int frame_tree_node_id, NonNetworkURLLoaderFactoryMap *factories) override;
+ void RegisterNonNetworkNavigationURLLoaderFactories(int frame_tree_node_id,
+ ukm::SourceIdObj ukm_source_id,
+ NonNetworkURLLoaderFactoryMap *factories) override;
void RegisterNonNetworkSubresourceURLLoaderFactories(int render_process_id, int render_frame_id,
- NonNetworkURLLoaderFactoryMap* factories) override;
+ const absl::optional<url::Origin>& request_initiator_origin,
+ NonNetworkURLLoaderFactoryMap *factories) override;
void RegisterNonNetworkWorkerMainResourceURLLoaderFactories(content::BrowserContext* browser_context,
NonNetworkURLLoaderFactoryMap* factories) override;
+ void RegisterNonNetworkServiceWorkerUpdateURLLoaderFactories(content::BrowserContext* browser_context,
+ NonNetworkURLLoaderFactoryMap* factories) override;
+ void SiteInstanceGotProcess(content::SiteInstance *site_instance) override;
+ base::flat_set<std::string> GetPluginMimeTypesWithExternalHandlers(content::BrowserContext *browser_context) override;
+
+ std::unique_ptr<content::WebContentsViewDelegate> GetWebContentsViewDelegate(content::WebContents *web_contents) override;
static std::string getUserAgent();
std::string GetUserAgent() override { return getUserAgent(); }
+ blink::UserAgentMetadata GetUserAgentMetadata() override;
std::string GetProduct() override;
-private:
- void InitFrameInterfaces();
+ content::WebAuthenticationDelegate *GetWebAuthenticationDelegate() override;
+#if !BUILDFLAG(IS_ANDROID)
+ std::unique_ptr<content::AuthenticatorRequestClientDelegate>
+ GetWebAuthenticationRequestDelegate(content::RenderFrameHost *render_frame_host) override;
+#endif
- scoped_refptr<ShareGroupQtQuick> m_shareGroupQtQuick;
- std::unique_ptr<service_manager::BinderRegistry> m_frameInterfaces;
- std::unique_ptr<service_manager::BinderRegistryWithArgs<content::RenderFrameHost*>> m_frameInterfacesParameterized;
+ void GetMediaDeviceIDSalt(content::RenderFrameHost *rfh,
+ const net::SiteForCookies &site_for_cookies,
+ const blink::StorageKey &storage_key,
+ base::OnceCallback<void(bool, const std::string&)> callback) override;
+
+private:
+ BrowserMainPartsQt *m_browserMainParts = nullptr;
};
} // namespace QtWebEngineCore
diff --git a/src/core/content_client_qt.cpp b/src/core/content_client_qt.cpp
index 083e10f2a..b6a0909b0 100644
--- a/src/core/content_client_qt.cpp
+++ b/src/core/content_client_qt.cpp
@@ -1,60 +1,28 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "content_client_qt.h"
#include "base/command_line.h"
#include "base/files/file_util.h"
+#include "base/json/json_string_value_serializer.h"
#include "base/strings/string_piece.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
-#include "base/strings/utf_string_conversions.h"
+#include "base/values.h"
#include "base/version.h"
#include "content/public/common/cdm_info.h"
#include "content/public/common/content_constants.h"
+#include "content/public/common/content_switches.h"
+#include "extensions/buildflags/buildflags.h"
+#include "extensions/common/constants.h"
#include "media/base/media_switches.h"
#include "media/base/video_codecs.h"
+#include "media/cdm/supported_audio_codecs.h"
#include "media/media_buildflags.h"
#include "ui/base/layout.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
-#include "services/service_manager/embedder/switches.h"
#include "type_conversion.h"
#include <QCoreApplication>
@@ -62,8 +30,10 @@
#include <QLibraryInfo>
#include <QString>
+
#if BUILDFLAG(ENABLE_LIBRARY_CDMS)
#include "media/cdm/cdm_paths.h" // nogncheck
+#include "media/cdm/clear_key_cdm_common.h"
#include "third_party/widevine/cdm/buildflags.h"
#include "third_party/widevine/cdm/widevine_cdm_common.h"
#if BUILDFLAG(ENABLE_WIDEVINE) && !BUILDFLAG(ENABLE_WIDEVINE_CDM_COMPONENT)
@@ -71,28 +41,29 @@
// File name of the CDM on different platforms.
const char kWidevineCdmFileName[] =
-#if defined(OS_MACOSX)
+#if BUILDFLAG(IS_MAC)
"widevinecdm.plugin";
-#elif defined(OS_WIN)
+#elif BUILDFLAG(IS_WIN)
"widevinecdm.dll";
#else // OS_LINUX, etc.
"libwidevinecdm.so";
#endif
#endif
+#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
#if QT_CONFIG(webengine_printing_and_pdf)
+#include "components/pdf/common/internal_plugin_helpers.h"
#include "pdf/pdf.h"
-#include "pdf/pdf_ppapi.h"
-const char kPdfPluginMimeType[] = "application/x-google-chrome-pdf";
-const char kPdfPluginPath[] = "internal-pdf-viewer/";
-const char kPdfPluginSrc[] = "src";
+const char kPdfPluginPath[] = "internal-pdf-viewer";
#endif // QT_CONFIG(webengine_printing_and_pdf)
+using Robustness = content::CdmInfo::Robustness;
+
static QString webenginePluginsPath()
{
// Look for plugins in /plugins/webengine or application dir.
static bool initialized = false;
- static QString potentialPluginsPath = QLibraryInfo::location(QLibraryInfo::PluginsPath) % QLatin1String("/webengine");
+ static QString potentialPluginsPath = QLibraryInfo::path(QLibraryInfo::PluginsPath) % QLatin1String("/webengine");
if (!initialized) {
initialized = true;
if (!QFileInfo::exists(potentialPluginsPath))
@@ -100,7 +71,6 @@ static QString webenginePluginsPath()
}
return potentialPluginsPath;
}
-#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
#if defined(Q_OS_WIN)
#include <shlobj.h>
@@ -130,26 +100,14 @@ static QString getProgramFilesDir(bool x86Dir = false)
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE.Chromium file.
-#include "content/public/common/pepper_plugin_info.h"
+#include "content/public/common/content_plugin_info.h"
#include "ppapi/shared_impl/ppapi_permissions.h"
-static const int32_t kPepperFlashPermissions = ppapi::PERMISSION_DEV |
- ppapi::PERMISSION_PRIVATE |
- ppapi::PERMISSION_BYPASS_USER_GESTURE |
- ppapi::PERMISSION_FLASH |
- ppapi::PERMISSION_SOCKET;
-
-namespace switches {
-const char kPpapiFlashPath[] = "ppapi-flash-path";
-const char kPpapiFlashVersion[] = "ppapi-flash-version";
-const char kPpapiWidevinePath[] = "ppapi-widevine-path";
-}
-
static QString ppapiPluginsPath()
{
// Look for plugins in /plugins/ppapi or application dir.
static bool initialized = false;
- static QString potentialPluginsPath = QLibraryInfo::location(QLibraryInfo::PluginsPath) % QLatin1String("/ppapi");
+ static QString potentialPluginsPath = QLibraryInfo::path(QLibraryInfo::PluginsPath) % QLatin1String("/ppapi");
if (!initialized) {
initialized = true;
if (!QFileInfo::exists(potentialPluginsPath))
@@ -158,121 +116,29 @@ static QString ppapiPluginsPath()
return potentialPluginsPath;
}
-
-content::PepperPluginInfo CreatePepperFlashInfo(const base::FilePath& path, const std::string& version)
-{
- content::PepperPluginInfo plugin;
-
- plugin.is_out_of_process = true;
- plugin.name = content::kFlashPluginName;
- plugin.path = path;
- plugin.permissions = kPepperFlashPermissions;
-
- std::vector<std::string> flash_version_numbers = base::SplitString(version, ".", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
- if (flash_version_numbers.size() < 1)
- flash_version_numbers.push_back("11");
- else if (flash_version_numbers[0].empty())
- flash_version_numbers[0] = "11";
- if (flash_version_numbers.size() < 2)
- flash_version_numbers.push_back("2");
- if (flash_version_numbers.size() < 3)
- flash_version_numbers.push_back("999");
- if (flash_version_numbers.size() < 4)
- flash_version_numbers.push_back("999");
-
- // E.g., "Shockwave Flash 10.2 r154":
- plugin.description = plugin.name + " " + flash_version_numbers[0] + "." + flash_version_numbers[1] + " r" + flash_version_numbers[2];
- plugin.version = base::JoinString(flash_version_numbers, ".");
- content::WebPluginMimeType swf_mime_type(content::kFlashPluginSwfMimeType,
- content::kFlashPluginSwfExtension,
- content::kFlashPluginSwfDescription);
- plugin.mime_types.push_back(swf_mime_type);
- content::WebPluginMimeType spl_mime_type(content::kFlashPluginSplMimeType,
- content::kFlashPluginSplExtension,
- content::kFlashPluginSplDescription);
- plugin.mime_types.push_back(spl_mime_type);
-
- return plugin;
-}
-
-void AddPepperFlashFromSystem(std::vector<content::PepperPluginInfo>* plugins)
-{
- QStringList pluginPaths;
-#if defined(Q_OS_WIN)
- QString winDir = QDir::fromNativeSeparators(qgetenv("WINDIR"));
- if (winDir.isEmpty())
- winDir = QString::fromLatin1("C:/Windows");
- QDir pluginDir(winDir + "/System32/Macromed/Flash");
- pluginDir.setFilter(QDir::Files);
- const QFileInfoList infos = pluginDir.entryInfoList(QStringList("pepflashplayer*.dll"));
- for (const QFileInfo &info : infos)
- pluginPaths << info.absoluteFilePath();
- pluginPaths << ppapiPluginsPath() + QStringLiteral("/pepflashplayer.dll");
-#endif
-#if defined(Q_OS_OSX)
- pluginPaths << "/Library/Internet Plug-Ins/PepperFlashPlayer/PepperFlashPlayer.plugin"; // System path
- QDir potentialDir(QDir::homePath() + "/Library/Application Support/Google/Chrome/PepperFlash");
- if (potentialDir.exists()) {
- QFileInfoList versionDirs = potentialDir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name | QDir::Reversed);
- for (int i = 0; i < versionDirs.size(); ++i) {
- pluginPaths << versionDirs.at(i).absoluteFilePath() + "/PepperFlashPlayer.plugin";
- }
- }
- pluginPaths << ppapiPluginsPath() + QStringLiteral("/PepperFlashPlayer.plugin");
-#endif
-#if defined(Q_OS_LINUX)
- pluginPaths << "/opt/google/chrome/PepperFlash/libpepflashplayer.so" // Google Chrome
- << "/usr/lib/pepperflashplugin-nonfree/libpepflashplayer.so" // Ubuntu, package pepperflashplugin-nonfree
- << "/usr/lib/adobe-flashplugin/libpepflashplayer.so" // Ubuntu, package adobe-flashplugin
- << "/usr/lib/PepperFlash/libpepflashplayer.so" // Arch
- << "/usr/lib64/chromium/PepperFlash/libpepflashplayer.so"; // OpenSuSE
- pluginPaths << ppapiPluginsPath() + QStringLiteral("/libpepflashplayer.so");
-#endif
- std::string flash_version = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kPpapiFlashVersion);
- for (auto it = pluginPaths.constBegin(); it != pluginPaths.constEnd(); ++it) {
- if (!QFile::exists(*it))
- continue;
- plugins->push_back(CreatePepperFlashInfo(QtWebEngineCore::toFilePath(*it), flash_version));
- }
-}
-
-void AddPepperFlashFromCommandLine(std::vector<content::PepperPluginInfo>* plugins)
-{
- const base::CommandLine::StringType flash_path = base::CommandLine::ForCurrentProcess()->GetSwitchValueNative(switches::kPpapiFlashPath);
- if (flash_path.empty() || !QFile::exists(QtWebEngineCore::toQt(flash_path)))
- return;
-
- // Read pepper flash plugin version from command-line. (e.g. 16.0.0.235)
- std::string flash_version = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kPpapiFlashVersion);
- plugins->push_back(CreatePepperFlashInfo(base::FilePath(flash_path), flash_version));
-}
-
-void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins)
+void ComputeBuiltInPlugins(std::vector<content::ContentPluginInfo> *plugins)
{
#if QT_CONFIG(webengine_printing_and_pdf)
- content::PepperPluginInfo pdf_info;
+ static constexpr char kPDFPluginExtension[] = "pdf";
+ static constexpr char kPDFPluginDescription[] = "Portable Document Format";
+ content::ContentPluginInfo pdf_info;
pdf_info.is_internal = true;
pdf_info.is_out_of_process = true;
pdf_info.name = "Chromium PDF Viewer";
- pdf_info.description = "Portable Document Format";
+ pdf_info.description = kPDFPluginDescription;
pdf_info.path = base::FilePath::FromUTF8Unsafe(kPdfPluginPath);
- content::WebPluginMimeType pdf_mime_type(kPdfPluginMimeType, "pdf", "Portable Document Format");
+ content::WebPluginMimeType pdf_mime_type(
+ pdf::kInternalPluginMimeType, kPDFPluginExtension, kPDFPluginDescription);
pdf_info.mime_types.push_back(pdf_mime_type);
- pdf_info.internal_entry_points.get_interface = chrome_pdf::PPP_GetInterface;
- pdf_info.internal_entry_points.initialize_module = chrome_pdf::PPP_InitializeModule;
- pdf_info.internal_entry_points.shutdown_module = chrome_pdf::PPP_ShutdownModule;
- pdf_info.permissions = ppapi::PERMISSION_PRIVATE | ppapi::PERMISSION_DEV | ppapi::PERMISSION_PDF;
plugins->push_back(pdf_info);
#endif // QT_CONFIG(webengine_printing_and_pdf)
}
namespace QtWebEngineCore {
-void ContentClientQt::AddPepperPlugins(std::vector<content::PepperPluginInfo>* plugins)
+void ContentClientQt::AddPlugins(std::vector<content::ContentPluginInfo> *plugins)
{
ComputeBuiltInPlugins(plugins);
- AddPepperFlashFromSystem(plugins);
- AddPepperFlashFromCommandLine(plugins);
}
} // namespace QtWebEngineCore
@@ -281,11 +147,45 @@ void ContentClientQt::AddPepperPlugins(std::vector<content::PepperPluginInfo>* p
namespace QtWebEngineCore {
#if defined(WIDEVINE_CDM_AVAILABLE_NOT_COMPONENT)
+#if defined(Q_OS_LINUX)
+static const QDir widevineCdmDirHint(const QDir &widevineDir)
+{
+ const QString hintFilePath = widevineDir.absolutePath() % QDir::separator()
+ % QLatin1String("latest-component-updated-widevine-cdm");
+ if (!QFileInfo::exists(hintFilePath)) {
+ // CDM hint file does not exist.
+ return widevineDir;
+ }
+
+ std::string jsonString;
+ if (!base::ReadFileToString(toFilePath(hintFilePath), &jsonString)) {
+ // Could not read the CDM hint file.
+ return widevineDir;
+ }
+
+ std::string error_message;
+ JSONStringValueDeserializer deserializer(jsonString);
+ std::unique_ptr<base::Value> dict = deserializer.Deserialize(nullptr, &error_message);
+ if (!dict || !dict->is_dict()) {
+ DLOG(ERROR) << "Could not deserialize the CDM hint file. Error: "
+ << error_message;
+ // Could not deserialize the CDM hint file.
+ return widevineDir;
+ }
+
+ std::string *widevineCdmDirPath = dict->GetDict().FindString("Path");
+ if (!widevineCdmDirPath)
+ return widevineDir;
+
+ return QDir(QString::fromStdString(*widevineCdmDirPath));
+}
+#endif // defined(Q_OS_LINUX)
+
static bool IsWidevineAvailable(base::FilePath *cdm_path,
- content::CdmCapability *capability)
+ media::CdmCapability *capability)
{
QStringList pluginPaths;
- const base::CommandLine::StringType widevine_argument = base::CommandLine::ForCurrentProcess()->GetSwitchValueNative(service_manager::switches::kCdmWidevinePath);
+ const base::CommandLine::StringType widevine_argument = base::CommandLine::ForCurrentProcess()->GetSwitchValueNative(switches::kCdmWidevinePath);
if (!widevine_argument.empty())
pluginPaths << QtWebEngineCore::toQt(widevine_argument);
else {
@@ -350,28 +250,76 @@ static bool IsWidevineAvailable(base::FilePath *cdm_path,
}
}
#elif defined(Q_OS_LINUX)
- pluginPaths << QStringLiteral("/opt/google/chrome/libwidevinecdm.so") // Old Google Chrome
+ QList<QDir> potentialWidevineVersionDirs;
+
+ // Google Chrome widevine modules
+ QDir chromeWidevineDir(QDir::homePath() + "/.config/google-chrome/WidevineCdm");
+ if (chromeWidevineDir.exists())
+ potentialWidevineVersionDirs << widevineCdmDirHint(chromeWidevineDir);
+
+ // Firefox widevine modules
+ QDir firefoxPotentialProfilesDir(QDir::homePath() + "/.mozilla/firefox");
+ if (firefoxPotentialProfilesDir.exists()) {
+ QFileInfoList firefoxProfileDirs = firefoxPotentialProfilesDir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name | QDir::Reversed);
+ for (const QFileInfo &info : firefoxProfileDirs) {
+ QDir widevinePluginsDir(info.absoluteFilePath() + "/gmp-widevinecdm");
+ if (widevinePluginsDir.exists())
+ potentialWidevineVersionDirs << widevinePluginsDir;
+ }
+ }
+
+ // Chromium widevine modules (might not work with proprietary codecs)
+ QDir chromiumWidevineDir(QDir::homePath() + "/.config/chromium/WidevineCdm");
+ if (chromiumWidevineDir.exists())
+ potentialWidevineVersionDirs << widevineCdmDirHint(chromiumWidevineDir);
+
+ // Search for widewine versions
+ for (const QDir &dir : potentialWidevineVersionDirs) {
+ QFileInfoList widevineVersionDirs = dir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name | QDir::Reversed);
+ widevineVersionDirs.prepend(QFileInfo(dir.absolutePath()));
+ // ### alternatively look up in the manifest.json and take the path from there.
#if Q_PROCESSOR_WORDSIZE == 8
- << QStringLiteral("/opt/google/chrome/WidevineCdm/_platform_specific/linux_x64/libwidevinecdm.so")
+ const QString library = QLatin1String("/_platform_specific/linux_x64/libwidevinecdm.so");
#else
- << QStringLiteral("/opt/google/chrome/WidevineCdm/_platform_specific/linux_x86/libwidevinecdm.so")
+ const QString library = QLatin1String("/_platform_specific/linux_x86/libwidevinecdm.so");
#endif
- << QStringLiteral("/usr/lib/chromium/libwidevinecdm.so") // Arch
+ for (const QFileInfo &info : widevineVersionDirs) {
+ pluginPaths << info.absoluteFilePath() + "/libwidevinecdm.so";
+ pluginPaths << info.absoluteFilePath() + library;
+ }
+ }
+
+ // Fixed paths:
+ pluginPaths << QStringLiteral("/usr/lib/chromium/libwidevinecdm.so") // Arch
<< QStringLiteral("/usr/lib/chromium-browser/libwidevinecdm.so") // Ubuntu/neon
- << QStringLiteral("/usr/lib64/chromium/libwidevinecdm.so"); // OpenSUSE style
+ << QStringLiteral("/usr/lib64/chromium/libwidevinecdm.so") // OpenSUSE style
+#if Q_PROCESSOR_WORDSIZE == 8
+ << QStringLiteral("/usr/lib64/chromium-browser/WidevineCdm/_platform_specific/linux_x64/libwidevinecdm.so") // Gentoo
+ << QStringLiteral("/opt/google/chrome/WidevineCdm/_platform_specific/linux_x64/libwidevinecdm.so") // Old Google Chrome
+#else
+ << QStringLiteral("/usr/lib/chromium-browser/WidevineCdm/_platform_specific/linux_x86/libwidevinecdm.so") // Gentoo
+ << QStringLiteral("/opt/google/chrome/WidevineCdm/_platform_specific/linux_x86/libwidevinecdm.so") // Old Google Chrome
+#endif
+ << QStringLiteral("/opt/google/chrome/libwidevinecdm.so"); // Older Google Chrome
#endif
}
- for (const QString &pluginPath : qAsConst(pluginPaths)) {
+ for (const QString &pluginPath : std::as_const(pluginPaths)) {
*cdm_path = QtWebEngineCore::toFilePath(pluginPath);
if (base::PathExists(*cdm_path)) {
// Add the supported codecs as if they came from the component manifest.
// This list must match the CDM that is being bundled with Chrome.
- capability->video_codecs.push_back(media::VideoCodec::kCodecVP8);
- capability->video_codecs.push_back(media::VideoCodec::kCodecVP9);
+ const std::vector<media::VideoCodecProfile> kAllProfiles = {};
+ capability->video_codecs.emplace(media::VideoCodec::kVP8, kAllProfiles);
+ capability->video_codecs.emplace(media::VideoCodec::kVP9, kAllProfiles);
+ capability->video_codecs.emplace(media::VideoCodec::kAV1, kAllProfiles);
#if BUILDFLAG(USE_PROPRIETARY_CODECS)
- capability->video_codecs.push_back(media::VideoCodec::kCodecH264);
+ capability->video_codecs.emplace(media::VideoCodec::kH264, kAllProfiles);
#endif // BUILDFLAG(USE_PROPRIETARY_CODECS)
+#if BUILDFLAG(ENABLE_PLATFORM_HEVC)
+ capability->video_codecs.emplace(media::VideoCodec::kHEVC, kAllProfiles);
+#endif
+ capability->audio_codecs = media::GetCdmSupportedAudioCodecs();
// Add the supported encryption schemes as if they came from the
// component manifest. This list must match the CDM that is being
@@ -396,12 +344,12 @@ void ContentClientQt::AddContentDecryptionModules(std::vector<content::CdmInfo>
if (cdms) {
#if defined(WIDEVINE_CDM_AVAILABLE_NOT_COMPONENT)
base::FilePath cdm_path;
- content::CdmCapability capability;
+ media::CdmCapability capability;
if (IsWidevineAvailable(&cdm_path, &capability)) {
const base::Version version;
- cdms->push_back(content::CdmInfo(kWidevineCdmDisplayName, kWidevineCdmGuid, version, cdm_path,
- kWidevineCdmFileSystemId, std::move(capability),
- kWidevineKeySystem, false));
+ cdms->push_back(content::CdmInfo(kWidevineKeySystem, Robustness::kSoftwareSecure, std::move(capability),
+ /*supports_sub_key_systems=*/false, kWidevineCdmDisplayName,
+ kWidevineCdmType, version, cdm_path));
}
#endif // defined(WIDEVINE_CDM_AVAILABLE_NOT_COMPONENT)
@@ -410,35 +358,27 @@ void ContentClientQt::AddContentDecryptionModules(std::vector<content::CdmInfo>
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
base::FilePath clear_key_cdm_path = command_line->GetSwitchValuePath(switches::kClearKeyCdmPathForTesting);
if (!clear_key_cdm_path.empty() && base::PathExists(clear_key_cdm_path)) {
- // TODO(crbug.com/764480): Remove these after we have a central place for
- // External Clear Key (ECK) related information.
- // Normal External Clear Key key system.
- const char kExternalClearKeyKeySystem[] = "org.chromium.externalclearkey";
- // A variant of ECK key system that has a different GUID.
- const char kExternalClearKeyDifferentGuidTestKeySystem[] =
- "org.chromium.externalclearkey.differentguid";
-
// Supported codecs are hard-coded in ExternalClearKeyProperties.
- content::CdmCapability capability(
- {}, {media::EncryptionScheme::kCenc, media::EncryptionScheme::kCbcs},
+ media::CdmCapability capability(
+ {}, {}, {media::EncryptionScheme::kCenc, media::EncryptionScheme::kCbcs},
{media::CdmSessionType::kTemporary,
- media::CdmSessionType::kPersistentLicense},
- {});
+ media::CdmSessionType::kPersistentLicense});
- // Register kExternalClearKeyDifferentGuidTestKeySystem first separately.
+ // Register media::kExternalClearKeyDifferentCdmTypeTestKeySystem first separately.
// Otherwise, it'll be treated as a sub-key-system of normal
// kExternalClearKeyKeySystem. See MultipleCdmTypes test in
// ECKEncryptedMediaTest.
- cdms->push_back(content::CdmInfo(media::kClearKeyCdmDisplayName, media::kClearKeyCdmDifferentGuid,
- base::Version("0.1.0.0"), clear_key_cdm_path,
- media::kClearKeyCdmFileSystemId, capability,
- kExternalClearKeyDifferentGuidTestKeySystem, false));
-
- // Supported codecs are hard-coded in ExternalClearKeyProperties.
- cdms->push_back(content::CdmInfo(media::kClearKeyCdmDisplayName, media::kClearKeyCdmGuid,
- base::Version("0.1.0.0"), clear_key_cdm_path,
- media::kClearKeyCdmFileSystemId, capability,
- kExternalClearKeyKeySystem, true));
+ cdms->push_back(content::CdmInfo(media::kExternalClearKeyDifferentCdmTypeTestKeySystem,
+ Robustness::kSoftwareSecure, capability,
+ /*supports_sub_key_systems=*/false, media::kClearKeyCdmDisplayName,
+ media::kClearKeyCdmDifferentCdmType, base::Version("0.1.0.0"),
+ clear_key_cdm_path));
+
+ cdms->push_back(content::CdmInfo(media::kExternalClearKeyKeySystem,
+ Robustness::kSoftwareSecure, capability,
+ /*supports_sub_key_systems=*/true, media::kClearKeyCdmDisplayName,
+ media::kClearKeyCdmType, base::Version("0.1.0.0"),
+ clear_key_cdm_path));
}
#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
}
@@ -446,10 +386,18 @@ void ContentClientQt::AddContentDecryptionModules(std::vector<content::CdmInfo>
void ContentClientQt::AddAdditionalSchemes(Schemes* schemes)
{
- schemes->standard_schemes.push_back("chrome-extension");
+ // Matching ChromeContentClient::AddAdditionalSchemes
+ schemes->standard_schemes.push_back(extensions::kExtensionScheme);
+ schemes->secure_schemes.push_back(extensions::kExtensionScheme);
+
+#if BUILDFLAG(ENABLE_EXTENSIONS)
+ schemes->service_worker_schemes.push_back(extensions::kExtensionScheme);
+ schemes->cors_enabled_schemes.push_back(extensions::kExtensionScheme);
+ schemes->csp_bypassing_schemes.push_back(extensions::kExtensionScheme);
+#endif
}
-base::StringPiece ContentClientQt::GetDataResource(int resource_id, ui::ScaleFactor scale_factor)
+base::StringPiece ContentClientQt::GetDataResource(int resource_id, ui::ResourceScaleFactor scale_factor)
{
return ui::ResourceBundle::GetSharedInstance().GetRawDataResourceForScale(resource_id, scale_factor);
}
@@ -464,9 +412,24 @@ gfx::Image &ContentClientQt::GetNativeImageNamed(int resource_id)
return ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id);
}
-base::string16 ContentClientQt::GetLocalizedString(int message_id)
+std::u16string ContentClientQt::GetLocalizedString(int message_id)
{
return l10n_util::GetStringUTF16(message_id);
}
+// This method is a copy from chrome/common/chrome_content_client.cc:
+// Copyright 2012 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE.Chromium file.
+blink::OriginTrialPolicy *ContentClientQt::GetOriginTrialPolicy()
+{
+ // Prevent initialization race (see crbug.com/721144). There may be a
+ // race when the policy is needed for worker startup (which happens on a
+ // separate worker thread).
+ base::AutoLock auto_lock(origin_trial_policy_lock_);
+ if (!origin_trial_policy_)
+ origin_trial_policy_ = std::make_unique<embedder_support::OriginTrialPolicyImpl>();
+ return origin_trial_policy_.get();
+}
+
} // namespace QtWebEngineCore
diff --git a/src/core/content_client_qt.h b/src/core/content_client_qt.h
index a7fc7432a..f58e17f96 100644
--- a/src/core/content_client_qt.h
+++ b/src/core/content_client_qt.h
@@ -1,65 +1,40 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef CONTENT_CLIENT_QT_H
#define CONTENT_CLIENT_QT_H
#include "qtwebenginecoreglobal_p.h"
+
#include "base/strings/string_piece.h"
+#include "base/synchronization/lock.h"
+#include "components/embedder_support/origin_trials/origin_trial_policy_impl.h"
#include "content/public/common/content_client.h"
#include "ui/base/layout.h"
+#include <memory>
+
namespace QtWebEngineCore {
class ContentClientQt : public content::ContentClient {
public:
#if QT_CONFIG(webengine_pepper_plugins)
- void AddPepperPlugins(std::vector<content::PepperPluginInfo>* plugins) override;
+ void AddPlugins(std::vector<content::ContentPluginInfo> *plugins) override;
#endif
void AddContentDecryptionModules(std::vector<content::CdmInfo> *cdms,
std::vector<media::CdmHostFilePath> *cdm_host_file_paths) override;
void AddAdditionalSchemes(Schemes* schemes) override;
- base::StringPiece GetDataResource(int, ui::ScaleFactor) override;
+ base::StringPiece GetDataResource(int, ui::ResourceScaleFactor) override;
base::RefCountedMemory* GetDataResourceBytes(int resource_id) override;
gfx::Image &GetNativeImageNamed(int resource_id) override;
- base::string16 GetLocalizedString(int message_id) override;
+ std::u16string GetLocalizedString(int message_id) override;
+ blink::OriginTrialPolicy *GetOriginTrialPolicy() override;
+
+private:
+ // Used to lock when |origin_trial_policy_| is initialized.
+ base::Lock origin_trial_policy_lock_;
+ std::unique_ptr<embedder_support::OriginTrialPolicyImpl> origin_trial_policy_;
};
} // namespace QtWebEngineCore
diff --git a/src/core/content_main_delegate_qt.cpp b/src/core/content_main_delegate_qt.cpp
index f93a3c0ea..f949d93a5 100644
--- a/src/core/content_main_delegate_qt.cpp
+++ b/src/core/content_main_delegate_qt.cpp
@@ -1,61 +1,26 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "content_main_delegate_qt.h"
#include "base/command_line.h"
#include "base/i18n/rtl.h"
#include "base/logging.h"
+#include "base/memory/ref_counted_memory.h"
+#include "base/no_destructor.h"
#include "base/path_service.h"
#include "base/strings/string_number_conversions.h"
#include "chrome/grit/generated_resources.h"
#include "content/public/browser/browser_main_runner.h"
#include "content/public/common/content_paths.h"
#include "content/public/common/content_switches.h"
-#include "media/gpu/buildflags.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/ui_base_paths.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/webui/jstemplate_builder.h"
#include "net/grit/net_resources.h"
#include "net/base/net_module.h"
-#include "services/service_manager/sandbox/switches.h"
+#include "sandbox/policy/switches.h"
#include "url/url_util_qt.h"
#include "content_client_qt.h"
@@ -64,30 +29,27 @@
#include "web_engine_context.h"
#include "web_engine_library_info.h"
-#if defined(ARCH_CPU_ARM_FAMILY) && (defined(OS_ANDROID) || defined(OS_LINUX))
+#if defined(ARCH_CPU_ARM_FAMILY) && (BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX))
#include "base/cpu.h"
#endif
-#if defined(OS_LINUX)
+#if BUILDFLAG(IS_LINUX)
+#include "media/audio/audio_manager.h"
#include "ui/base/ui_base_switches.h"
#endif
-// must be included before vaapi_wrapper.h
-#include <QtCore/qcoreapplication.h>
-
-#if defined(OS_WIN)
-#include "media/gpu/windows/dxva_video_decode_accelerator_win.h"
-#include "media/gpu/windows/media_foundation_video_encode_accelerator_win.h"
+#if BUILDFLAG(IS_WIN)
+#include "media/base/win/mf_initializer.h"
+#include "sandbox/policy/win/sandbox_warmup.h"
#endif
-#if defined(OS_MACOSX)
+#if BUILDFLAG(IS_MAC)
+#include "base/trace_event/trace_event.h"
#include "content/public/common/content_features.h"
#include "media/gpu/mac/vt_video_decode_accelerator_mac.h"
#endif
-#if BUILDFLAG(USE_VAAPI)
-#include "media/gpu/vaapi/vaapi_wrapper.h"
-#endif
+#include <QtCore/qcoreapplication.h>
namespace content {
ContentClient *GetContentClient();
@@ -109,23 +71,19 @@ struct LazyDirectoryListerCacher
{
LazyDirectoryListerCacher()
{
- base::DictionaryValue dict;
- dict.SetString("header", l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_HEADER));
- dict.SetString("parentDirText", l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_PARENT));
- dict.SetString("headerName", l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_NAME));
- dict.SetString("headerSize", l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_SIZE));
- dict.SetString("headerDateModified",
- l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_DATE_MODIFIED));
- dict.SetString("language", l10n_util::GetLanguage(base::i18n::GetConfiguredLocale()));
- dict.SetString("listingParsingErrorBoxText",
- l10n_util::GetStringFUTF16(IDS_DIRECTORY_LISTING_PARSING_ERROR_BOX_TEXT,
- toString16(QCoreApplication::applicationName())));
- dict.SetString("textdirection", base::i18n::IsRTL() ? "rtl" : "ltr");
+ base::Value::Dict dict;
+ dict.Set("header", l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_HEADER));
+ dict.Set("parentDirText", l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_PARENT));
+ dict.Set("headerName", l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_NAME));
+ dict.Set("headerSize", l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_SIZE));
+ dict.Set("headerDateModified", l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_DATE_MODIFIED));
+ dict.Set("language", l10n_util::GetLanguage(base::i18n::GetConfiguredLocale()));
+ dict.Set("textdirection", base::i18n::IsRTL() ? "rtl" : "ltr");
std::string html =
webui::GetI18nTemplateHtml(
ui::ResourceBundle::GetSharedInstance().LoadDataResourceString(IDR_DIR_HEADER_HTML),
- &dict);
- html_data = base::RefCountedString::TakeString(&html);
+ std::move(dict));
+ html_data = base::MakeRefCounted<base::RefCountedString>(std::move(html));
}
scoped_refptr<base::RefCountedMemory> html_data;
@@ -169,14 +127,16 @@ static logging::LoggingDestination DetermineLogMode(const base::CommandLine& com
void ContentMainDelegateQt::PreSandboxStartup()
{
-#if defined(ARCH_CPU_ARM_FAMILY) && (defined(OS_ANDROID) || defined(OS_LINUX))
+#if defined(ARCH_CPU_ARM_FAMILY) && (BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX))
// Create an instance of the CPU class to parse /proc/cpuinfo and cache
// cpu_brand info.
base::CPU cpu_info;
#endif
net::NetModule::SetResourceProvider(PlatformResourceProvider);
- ui::ResourceBundle::InitSharedInstanceWithLocale(WebEngineLibraryInfo::getApplicationLocale(), 0, ui::ResourceBundle::LOAD_COMMON_RESOURCES);
+
+ base::i18n::SetICUDefaultLocale(WebEngineLibraryInfo::getApplicationLocale());
+ ui::ResourceBundle::InitSharedInstanceWithLocale(WebEngineLibraryInfo::getResolvedLocale(), nullptr, ui::ResourceBundle::LOAD_COMMON_RESOURCES);
base::CommandLine* parsedCommandLine = base::CommandLine::ForCurrentProcess();
logging::LoggingSettings settings;
@@ -191,35 +151,48 @@ void ContentMainDelegateQt::PreSandboxStartup()
false //enable_tickcount
);
- if (logging::GetMinLogLevel() >= logging::LOG_INFO) {
+ if (logging::GetMinLogLevel() >= logging::LOGGING_INFO) {
if (parsedCommandLine->HasSwitch(switches::kLoggingLevel)) {
std::string logLevelValue = parsedCommandLine->GetSwitchValueASCII(switches::kLoggingLevel);
int level = 0;
- if (base::StringToInt(logLevelValue, &level) && level >= logging::LOG_INFO && level < logging::LOG_NUM_SEVERITIES)
+ if (base::StringToInt(logLevelValue, &level) && level >= logging::LOGGING_INFO && level < logging::LOGGING_NUM_SEVERITIES)
logging::SetMinLogLevel(level);
}
}
-#if defined(OS_POSIX) && !defined(OS_ANDROID)
+#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_ANDROID)
if (parsedCommandLine->HasSwitch(switches::kSingleProcess))
setlocale(LC_NUMERIC, "C");
#endif
- // from gpu_main.cc:
-#if BUILDFLAG(USE_VAAPI)
- media::VaapiWrapper::PreSandboxInitialization();
-#endif
-#if defined(OS_WIN)
- media::DXVAVideoDecodeAccelerator::PreSandboxInitialization();
- media::MediaFoundationVideoEncodeAccelerator::PreSandboxInitialization();
+ bool isBrowserProcess = !parsedCommandLine->HasSwitch(switches::kProcessType);
+ if (isBrowserProcess) {
+ // from gpu_main.cc:
+#if BUILDFLAG(IS_WIN)
+ media::PreSandboxMediaFoundationInitialization();
#endif
-#if defined(OS_MACOSX)
- if (base::FeatureList::IsEnabled(features::kMacV2GPUSandbox)) {
- TRACE_EVENT0("gpu", "Initialize VideoToolbox");
- media::InitializeVideoToolbox();
+#if BUILDFLAG(IS_MAC)
+ {
+ TRACE_EVENT0("gpu", "Initialize VideoToolbox");
+ media::InitializeVideoToolbox();
+ }
+#endif
}
+
+ if (parsedCommandLine->HasSwitch(switches::kApplicationName)) {
+ std::string appName = parsedCommandLine->GetSwitchValueASCII(switches::kApplicationName);
+ appName = QByteArray::fromPercentEncoding(QByteArray::fromStdString(appName)).toStdString();
+ QCoreApplication::setApplicationName(QString::fromStdString(appName));
+#if BUILDFLAG(IS_LINUX)
+ media::AudioManager::SetGlobalAppName(appName);
#endif
+ }
+}
+
+content::ContentClient *ContentMainDelegateQt::CreateContentClient()
+{
+ return &m_contentClient;
}
content::ContentBrowserClient *ContentMainDelegateQt::CreateContentBrowserClient()
@@ -236,10 +209,10 @@ content::ContentGpuClient *ContentMainDelegateQt::CreateContentGpuClient()
content::ContentRendererClient *ContentMainDelegateQt::CreateContentRendererClient()
{
-#if defined(OS_LINUX)
+#if BUILDFLAG(IS_LINUX)
base::CommandLine *parsedCommandLine = base::CommandLine::ForCurrentProcess();
std::string process_type = parsedCommandLine->GetSwitchValueASCII(switches::kProcessType);
- bool no_sandbox = parsedCommandLine->HasSwitch(service_manager::switches::kNoSandbox);
+ bool no_sandbox = parsedCommandLine->HasSwitch(sandbox::policy::switches::kNoSandbox);
// Reload locale if the renderer process is sandboxed
if (process_type == switches::kRendererProcess && !no_sandbox) {
@@ -278,20 +251,20 @@ static void SafeOverridePathImpl(const char *keyName, int key, const base::FileP
#define SafeOverridePath(KEY, PATH) SafeOverridePathImpl(#KEY, KEY, PATH)
-bool ContentMainDelegateQt::BasicStartupComplete(int *exit_code)
+absl::optional<int> ContentMainDelegateQt::BasicStartupComplete()
{
SafeOverridePath(base::FILE_EXE, WebEngineLibraryInfo::getPath(base::FILE_EXE));
SafeOverridePath(base::DIR_QT_LIBRARY_DATA, WebEngineLibraryInfo::getPath(base::DIR_QT_LIBRARY_DATA));
+ SafeOverridePath(base::DIR_ASSETS, WebEngineLibraryInfo::getPath(base::DIR_ASSETS));
+ SafeOverridePath(base::DIR_EXE, WebEngineLibraryInfo::getPath(base::DIR_ASSETS));
SafeOverridePath(ui::DIR_LOCALES, WebEngineLibraryInfo::getPath(ui::DIR_LOCALES));
#if QT_CONFIG(webengine_spellchecker)
SafeOverridePath(base::DIR_APP_DICTIONARIES, WebEngineLibraryInfo::getPath(base::DIR_APP_DICTIONARIES));
#endif
- if (!content::GetContentClient())
- content::SetContentClient(new ContentClientQt);
url::CustomScheme::LoadSchemes(base::CommandLine::ForCurrentProcess());
- return false;
+ return absl::nullopt;
}
} // namespace QtWebEngineCore
diff --git a/src/core/content_main_delegate_qt.h b/src/core/content_main_delegate_qt.h
index 4d2f33792..a177bd6df 100644
--- a/src/core/content_main_delegate_qt.h
+++ b/src/core/content_main_delegate_qt.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef CONTENT_MAIN_DELEGATE_QT_H
#define CONTENT_MAIN_DELEGATE_QT_H
@@ -44,6 +8,7 @@
#include "compositor/content_gpu_client_qt.h"
#include "content_browser_client_qt.h"
+#include "content_client_qt.h"
#include "content_utility_client_qt.h"
namespace QtWebEngineCore {
@@ -56,13 +21,15 @@ public:
// before the sandbox is engaged.
void PreSandboxStartup() override;
+ content::ContentClient *CreateContentClient() override;
content::ContentBrowserClient* CreateContentBrowserClient() override;
content::ContentGpuClient* CreateContentGpuClient() override;
content::ContentRendererClient* CreateContentRendererClient() override;
content::ContentUtilityClient* CreateContentUtilityClient() override;
- bool BasicStartupComplete(int* /*exit_code*/) override;
+ absl::optional<int> BasicStartupComplete() override;
private:
+ ContentClientQt m_contentClient;
std::unique_ptr<ContentBrowserClientQt> m_browserClient;
std::unique_ptr<ContentGpuClientQt> m_gpuClient;
std::unique_ptr<ContentUtilityClientQt> m_utilityClient;
diff --git a/src/core/content_utility_client_qt.cpp b/src/core/content_utility_client_qt.cpp
index 3582e15a7..7af90c7a1 100644
--- a/src/core/content_utility_client_qt.cpp
+++ b/src/core/content_utility_client_qt.cpp
@@ -1,48 +1,16 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "content_utility_client_qt.h"
-#include "base/no_destructor.h"
#include "mojo/public/cpp/bindings/service_factory.h"
#include "services/proxy_resolver/proxy_resolver_factory_impl.h"
+#if BUILDFLAG(IS_WIN)
+#include "services/proxy_resolver_win/public/mojom/proxy_resolver_win.mojom.h"
+#include "services/proxy_resolver_win/windows_system_proxy_resolver_impl.h"
+#endif
+
namespace QtWebEngineCore {
ContentUtilityClientQt::ContentUtilityClientQt()
@@ -56,12 +24,21 @@ auto RunProxyResolver(mojo::PendingReceiver<proxy_resolver::mojom::ProxyResolver
return std::make_unique<proxy_resolver::ProxyResolverFactoryImpl>(std::move(receiver));
}
-mojo::ServiceFactory *ContentUtilityClientQt::GetIOThreadServiceFactory()
+#if BUILDFLAG(IS_WIN)
+auto RunWindowsSystemProxyResolver(
+ mojo::PendingReceiver<proxy_resolver_win::mojom::WindowsSystemProxyResolver> receiver)
+{
+ return std::make_unique<proxy_resolver_win::WindowsSystemProxyResolverImpl>(
+ std::move(receiver));
+}
+#endif
+
+void ContentUtilityClientQt::RegisterIOThreadServices(mojo::ServiceFactory &services)
{
- static base::NoDestructor<mojo::ServiceFactory> factory {
- RunProxyResolver,
- };
- return factory.get();
+ services.Add(RunProxyResolver);
+#if BUILDFLAG(IS_WIN)
+ services.Add(RunWindowsSystemProxyResolver);
+#endif
}
} // namespace
diff --git a/src/core/content_utility_client_qt.h b/src/core/content_utility_client_qt.h
index fc1d1eb05..f2d287cf5 100644
--- a/src/core/content_utility_client_qt.h
+++ b/src/core/content_utility_client_qt.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef CONTENT_UTILITY_CLIENT_QT_H
#define CONTENT_UTILITY_CLIENT_QT_H
@@ -53,7 +17,7 @@ public:
~ContentUtilityClientQt() override;
// content::ContentUtilityClient:
- mojo::ServiceFactory *GetIOThreadServiceFactory() override;
+ void RegisterIOThreadServices(mojo::ServiceFactory &services) override;
};
} // namespace
diff --git a/src/core/core.pro b/src/core/core.pro
deleted file mode 100644
index f2d3fd307..000000000
--- a/src/core/core.pro
+++ /dev/null
@@ -1,48 +0,0 @@
-include($$QTWEBENGINE_OUT_ROOT/src/buildtools/qtbuildtools-config.pri)
-QT_FOR_CONFIG += buildtools-private
-TEMPLATE = subdirs
-
-# core_headers is a dummy module to syncqt the headers so we can
-# use them by later targets
-core_headers.file = core_headers.pro
-core_api.file = api/core_api.pro
-
-# This will take the compile output of ninja, and link+deploy the final binary.
-core_module.file = core_module.pro
-core_module.depends = core_api
-
-core_generator.file = core_generator.pro
-core_generator.depends = core_headers
-
-# core_gn_generator.pro is a dummy .pro file that is used by qmake
-# to generate our main BUILD.gn file
-
-gn_run.file = gn_run.pro
-gn_run.depends = core_generator
-
-core_api.depends = gn_run
-
-# A fake project for qt creator
-core_project.file = core_project.pro
-core_project.depends = gn_run
-
-!qtConfig(webengine-core-support):qtConfig(build-qtwebengine-core):!build_pass {
- !qtwebengine_makeCheckWebEngineCoreError() {
- errorbuild.commands = @echo $$shell_quote("QtWebEngineCore module will not be built. $${skipBuildReason}")
- } else {
- errorbuild.commands = @echo $$shell_quote("QtWebEngineCore module will not be built for unknown reason, please open a bug report at https://bugreports.qt.io")
- }
- errorbuild.CONFIG = phony
- QMAKE_EXTRA_TARGETS += errorbuild
- first.depends += errorbuild
- QMAKE_EXTRA_TARGETS += first
-} else {
- SUBDIRS += \
- core_headers \
- core_generator \
- gn_run \
- core_api \
- core_module
-
- false: SUBDIRS += core_project
-}
diff --git a/src/core/core_chromium.pri b/src/core/core_chromium.pri
deleted file mode 100644
index e1f5cd7ac..000000000
--- a/src/core/core_chromium.pri
+++ /dev/null
@@ -1,360 +0,0 @@
-qtConfig(debug_and_release): CONFIG += debug_and_release
-
-macos {
- # This fixes namespace builds on macOS. Specifically namespace ambiguity issues between Qt and
- # Chromium forward declarations of NSString.
-
- # The single quotes are present so that qmake iteration does not interpret the space as
- # delimiting a new value, they are removed before writing to the GN file, and the final shell
- # quoting is done by GN itself.
- forward_declaration_macro = "'Q_FORWARD_DECLARE_OBJC_CLASS(name)=class name;'"
-} else {
- forward_declaration_macro = "Q_FORWARD_DECLARE_OBJC_CLASS=QT_FORWARD_DECLARE_CLASS"
-}
-
-# Defining keywords such as 'signal' clashes with the chromium code base.
-DEFINES += QT_NO_KEYWORDS \
- QT_USE_QSTRINGBUILDER \
- $$forward_declaration_macro \
- QTWEBENGINECORE_VERSION_STR=\"$$MODULE_VERSION\" \
- QTWEBENGINEPROCESS_NAME=\"$$QTWEBENGINEPROCESS_NAME\" \
- BUILDING_CHROMIUM
-
-# Ensure that response files, generated by qtbase/mkspecs/features/moc.prf, are found by moc.
-MOC_DIR = $$OUT_PWD/$$getConfigDir()/.moc
-RCC_DIR = $$OUT_PWD/$$getConfigDir()/.rcc
-
-# Assume that we want mobile touch and low-end hardware behaviors
-# whenever we are cross compiling.
-qtConfig(webengine-embedded-build): DEFINES += QTWEBENGINE_EMBEDDED_SWITCHES
-
-INCLUDEPATH += $$PWD $$PWD/api
-
-clang_cl {
- QMAKE_CFLAGS -= $$QMAKE_CFLAGS_MSVC_COMPAT
- QMAKE_CXXFLAGS -= $$QMAKE_CFLAGS_MSVC_COMPAT
-}
-
-SOURCES = \
- accessibility_activation_observer.cpp \
- accessibility_tree_formatter_qt.cpp \
- authentication_dialog_controller.cpp \
- browser_accessibility_manager_qt.cpp \
- browser_accessibility_qt.cpp \
- browsing_data_remover_delegate_qt.cpp \
- browser_main_parts_qt.cpp \
- browser_message_filter_qt.cpp \
- certificate_error_controller.cpp \
- chromium_overrides.cpp \
- client_cert_select_controller.cpp \
- clipboard_qt.cpp \
- color_chooser_qt.cpp \
- color_chooser_controller.cpp \
- common/qt_ipc_logging.cpp \
- common/qt_messages.cpp \
- common/user_script_data.cpp \
- compositor/chromium_gpu_helper.cpp \
- compositor/compositor.cpp \
- compositor/compositor_resource_tracker.cpp \
- compositor/content_gpu_client_qt.cpp \
- compositor/delegated_frame_node.cpp \
- compositor/display_frame_sink.cpp \
- compositor/display_overrides.cpp \
- compositor/display_software_output_surface.cpp \
- content_client_qt.cpp \
- content_browser_client_qt.cpp \
- content_main_delegate_qt.cpp \
- content_utility_client_qt.cpp \
- delegated_frame_host_client_qt.cpp \
- desktop_screen_qt.cpp \
- devtools_frontend_qt.cpp \
- devtools_manager_delegate_qt.cpp \
- download_manager_delegate_qt.cpp \
- favicon_manager.cpp \
- file_picker_controller.cpp \
- find_text_helper.cpp \
- javascript_dialog_controller.cpp \
- javascript_dialog_manager_qt.cpp \
- login_delegate_qt.cpp \
- media_capture_devices_dispatcher.cpp \
- native_web_keyboard_event_qt.cpp \
- net/client_cert_override.cpp \
- net/client_cert_store_data.cpp \
- net/cookie_monster_delegate_qt.cpp \
- net/custom_url_loader_factory.cpp \
- net/proxy_config_monitor.cpp \
- net/proxy_config_service_qt.cpp \
- net/proxying_url_loader_factory_qt.cpp \
- net/proxying_restricted_cookie_manager_qt.cpp \
- net/qrc_url_scheme_handler.cpp \
- net/ssl_host_state_delegate_qt.cpp \
- net/system_network_context_manager.cpp \
- net/url_request_custom_job_delegate.cpp \
- net/url_request_custom_job_proxy.cpp \
- net/webui_controller_factory_qt.cpp \
- ozone/gl_context_qt.cpp \
- ozone/gl_ozone_egl_qt.cpp \
- ozone/gl_surface_qt.cpp \
- ozone/gl_surface_egl_qt.cpp \
- ozone/gl_surface_wgl_qt.cpp \
- ozone/platform_window_qt.cpp \
- ozone/surface_factory_qt.cpp \
- permission_manager_qt.cpp \
- platform_notification_service_qt.cpp \
- process_main.cpp \
- profile_adapter.cpp \
- profile_adapter_client.cpp \
- profile_qt.cpp \
- profile_io_data_qt.cpp \
- quota_permission_context_qt.cpp \
- quota_request_controller_impl.cpp \
- pref_service_adapter.cpp \
- register_protocol_handler_request_controller_impl.cpp \
- render_view_context_menu_qt.cpp \
- render_widget_host_view_qt.cpp \
- renderer/content_renderer_client_qt.cpp \
- renderer/content_settings_observer_qt.cpp \
- renderer/render_frame_observer_qt.cpp \
- renderer/render_view_observer_qt.cpp \
- renderer/render_thread_observer_qt.cpp \
- renderer/user_resource_controller.cpp \
- renderer/plugins/plugin_placeholder_qt.cpp \
- renderer_host/render_view_observer_host_qt.cpp \
- renderer_host/user_resource_controller_host.cpp \
- resource_bundle_qt.cpp \
- resource_context_qt.cpp \
- touch_handle_drawable_qt.cpp \
- touch_selection_controller_client_qt.cpp \
- touch_selection_menu_controller.cpp \
- type_conversion.cpp \
- user_notification_controller.cpp \
- user_script.cpp \
- visited_links_manager_qt.cpp \
- web_contents_adapter.cpp \
- web_contents_delegate_qt.cpp \
- web_contents_view_qt.cpp \
- web_engine_context.cpp \
- web_engine_context_threads.cpp \
- web_engine_error.cpp \
- web_engine_library_info.cpp \
- web_engine_settings.cpp \
- web_event_factory.cpp
-
-HEADERS = \
- accessibility_activation_observer.h \
- authentication_dialog_controller_p.h \
- authentication_dialog_controller.h \
- build_config_qt.h \
- browser_accessibility_manager_qt.h \
- browser_accessibility_qt.h \
- browsing_data_remover_delegate_qt.h \
- browser_main_parts_qt.h \
- browser_message_filter_qt.h \
- certificate_error_controller_p.h \
- certificate_error_controller.h \
- client_cert_select_controller.h \
- clipboard_change_observer.h \
- clipboard_qt.h \
- color_chooser_qt.h \
- color_chooser_controller_p.h \
- color_chooser_controller.h \
- common/qt_messages.h \
- common/user_script_data.h \
- compositor/chromium_gpu_helper.h \
- compositor/compositor.h \
- compositor/compositor_resource.h \
- compositor/compositor_resource_tracker.h \
- compositor/content_gpu_client_qt.h \
- compositor/delegated_frame_node.h \
- compositor/display_frame_sink.h \
- compositor/display_software_output_surface.h \
- content_client_qt.h \
- content_browser_client_qt.h \
- content_main_delegate_qt.h \
- content_utility_client_qt.h \
- delegated_frame_host_client_qt.h \
- desktop_screen_qt.h \
- devtools_frontend_qt.h \
- devtools_manager_delegate_qt.h \
- download_manager_delegate_qt.h \
- favicon_manager.h \
- file_picker_controller.h \
- find_text_helper.h \
- global_descriptors_qt.h \
- javascript_dialog_controller_p.h \
- javascript_dialog_controller.h \
- javascript_dialog_manager_qt.h \
- locked_ptr.h \
- login_delegate_qt.h \
- media_capture_devices_dispatcher.h \
- net/client_cert_override.h \
- net/client_cert_store_data.h \
- net/cookie_monster_delegate_qt.h \
- net/custom_url_loader_factory.h \
- net/proxying_url_loader_factory_qt.h \
- net/proxying_restricted_cookie_manager_qt.h \
- net/qrc_url_scheme_handler.h \
- net/ssl_host_state_delegate_qt.h \
- net/system_network_context_manager.h \
- net/url_request_custom_job_delegate.h \
- net/url_request_custom_job_proxy.h \
- net/webui_controller_factory_qt.h \
- ozone/gl_context_qt.h \
- ozone/gl_ozone_egl_qt.h \
- ozone/gl_surface_qt.h \
- ozone/gl_surface_egl_qt.h \
- ozone/gl_surface_wgl_qt.h \
- ozone/platform_window_qt.h \
- ozone/surface_factory_qt.h \
- permission_manager_qt.h \
- platform_notification_service_qt.h \
- pref_service_adapter.h \
- process_main.h \
- profile_adapter.h \
- profile_adapter_client.h \
- profile_qt.h \
- profile_io_data_qt.h \
- proxy_config_monitor.h \
- proxy_config_service_qt.h \
- quota_permission_context_qt.h \
- quota_request_controller.h \
- quota_request_controller_impl.h \
- register_protocol_handler_request_controller.h \
- register_protocol_handler_request_controller_impl.h \
- render_view_context_menu_qt.h \
- render_widget_host_view_qt.h \
- render_widget_host_view_qt_delegate.h \
- renderer/content_renderer_client_qt.h \
- renderer/content_settings_observer_qt.h \
- renderer/render_frame_observer_qt.h \
- renderer/render_view_observer_qt.h \
- renderer/render_thread_observer_qt.h \
- renderer/user_resource_controller.h \
- renderer/plugins/plugin_placeholder_qt.h \
- renderer_host/render_view_observer_host_qt.h \
- renderer_host/user_resource_controller_host.h \
- request_controller.h \
- resource_context_qt.h \
- touch_handle_drawable_client.h \
- touch_handle_drawable_qt.h \
- touch_selection_controller_client_qt.h \
- touch_selection_menu_controller.h \
- type_conversion.h \
- user_notification_controller.h \
- user_script.h \
- visited_links_manager_qt.h \
- web_contents_adapter.h \
- web_contents_adapter_client.h \
- web_contents_delegate_qt.h \
- web_contents_view_qt.h \
- web_engine_context.h \
- web_engine_error.h \
- web_engine_library_info.h \
- web_engine_settings.h \
- web_event_factory.h
-
-qtConfig(webengine-ozone-x11) {
- HEADERS += ozone/gl_ozone_glx_qt.h \
- ozone/gl_surface_glx_qt.h
- SOURCES += ozone/gl_surface_glx_qt.cpp \
- ozone/gl_ozone_glx_qt.cpp
-}
-
-qtConfig(webengine-pepper-plugins) {
-
- SOURCES += \
- renderer_host/pepper/pepper_flash_browser_host_qt.cpp \
- renderer_host/pepper/pepper_host_factory_qt.cpp \
- renderer_host/pepper/pepper_isolated_file_system_message_filter.cpp \
- renderer/pepper/pepper_flash_renderer_host_qt.cpp \
- renderer/pepper/pepper_renderer_host_factory_qt.cpp \
- renderer/plugins/loadable_plugin_placeholder_qt.cpp
-
- HEADERS += \
- renderer_host/pepper/pepper_flash_browser_host_qt.h \
- renderer_host/pepper/pepper_host_factory_qt.h \
- renderer_host/pepper/pepper_isolated_file_system_message_filter.h \
- renderer/pepper/pepper_flash_renderer_host_qt.h \
- renderer/pepper/pepper_renderer_host_factory_qt.h \
- renderer/plugins/loadable_plugin_placeholder_qt.h
-}
-
-qtConfig(webengine-printing-and-pdf) {
-
- SOURCES += \
- printing/printing_message_filter_qt.cpp \
- printing/print_view_manager_base_qt.cpp \
- printing/print_view_manager_qt.cpp \
- renderer/print_web_view_helper_delegate_qt.cpp
-
- HEADERS += \
- printing/printing_message_filter_qt.h \
- printing/print_view_manager_base_qt.h \
- printing/print_view_manager_qt.h \
- renderer/print_web_view_helper_delegate_qt.h
-
- # pdf sources
- SOURCES += printing/pdfium_document_wrapper_qt.cpp
- HEADERS += printing/pdfium_document_wrapper_qt.h
-}
-
-contains(QT_CONFIG, opengl) {
- SOURCES += \
- compositor/compositor_resource_fence.cpp \
- compositor/display_gl_output_surface.cpp \
- compositor/display_gl_output_surface_qsg.cpp \
- compositor/stream_video_node.cpp \
- compositor/yuv_video_node.cpp
- HEADERS += \
- compositor/compositor_resource_fence.h \
- compositor/display_gl_output_surface.h \
- compositor/stream_video_node.h \
- compositor/yuv_video_node.h
-}
-
-qtConfig(webengine-geolocation) {
- SOURCES += location_provider_qt.cpp
- HEADERS += location_provider_qt.h
-}
-
-qtConfig(webengine-webchannel) {
- HEADERS += renderer/web_channel_ipc_transport.h \
- renderer_host/web_channel_ipc_transport_host.h
-
- SOURCES += renderer/web_channel_ipc_transport.cpp \
- renderer_host/web_channel_ipc_transport_host.cpp
-}
-
-qtConfig(webengine-extensions) {
- SOURCES += \
- common/extensions/extensions_api_provider_qt.cpp \
- common/extensions/extensions_client_qt.cpp \
- extensions/component_extension_resource_manager_qt.cpp \
- extensions/extension_system_qt.cpp \
- extensions/extension_system_factory_qt.cpp \
- extensions/extension_web_contents_observer_qt.cpp \
- extensions/extensions_api_client_qt.cpp \
- extensions/extensions_browser_client_qt.cpp \
- extensions/mime_handler_view_guest_delegate_qt.cpp \
- net/plugin_response_interceptor_url_loader_throttle.cpp \
- renderer/extensions/extensions_dispatcher_delegate_qt.cpp \
- renderer/extensions/extensions_renderer_client_qt.cpp \
- renderer/extensions/renderer_permissions_policy_delegate_qt.cpp \
- renderer/extensions/resource_request_policy_qt.cpp
-
- HEADERS += \
- common/extensions/extensions_api_provider_qt.h \
- common/extensions/extensions_client_qt.h \
- extensions/component_extension_resource_manager_qt.h \
- extensions/extension_system_qt.h \
- extensions/extension_system_factory_qt.h \
- extensions/extension_web_contents_observer_qt.h \
- extensions/extensions_api_client_qt.h \
- extensions/extensions_browser_client_qt.h \
- extensions/mime_handler_view_guest_delegate_qt.h \
- net/plugin_response_interceptor_url_loader_throttle.h \
- renderer/extensions/extensions_dispatcher_delegate_qt.h \
- renderer/extensions/extensions_renderer_client_qt.h \
- renderer/extensions/renderer_permissions_policy_delegate_qt.h \
- renderer/extensions/resource_request_policy_qt.h
-}
diff --git a/src/core/core_common.pri b/src/core/core_common.pri
deleted file mode 100644
index e10d14267..000000000
--- a/src/core/core_common.pri
+++ /dev/null
@@ -1,20 +0,0 @@
-include($$QTWEBENGINE_OUT_ROOT/src/buildtools/qtbuildtools-config.pri)
-include($$QTWEBENGINE_OUT_ROOT/src/core/qtwebenginecore-config.pri)
-QT_FOR_CONFIG += buildtools-private webenginecore webenginecore-private
-
-# NOTE: The TARGET, QT, QT_PRIVATE variables are used in both core_module.pro and core_gyp_generator.pro
-# gyp/ninja will take care of the compilation, qmake/make will finish with linking and install.
-
-TARGET = QtWebEngineCore
-QT += qml-private quick-private gui-private core-private
-QT_PRIVATE += webenginecoreheaders-private
-
-qtConfig(webengine-geolocation): QT += positioning
-qtConfig(webengine-webchannel): QT += webchannel
-
-# LTO does not work for Chromium at the moment, so disable it completely for core.
-CONFIG -= ltcg
-
-# Chromium requires C++14
-CONFIG += c++14
-
diff --git a/src/core/core_generator.pro b/src/core/core_generator.pro
deleted file mode 100644
index 935c653a4..000000000
--- a/src/core/core_generator.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-include(core_common.pri)
-
-include(core_gn_config.pri)
-
-TEMPLATE = lib
-
-include(core_chromium.pri)
diff --git a/src/core/core_gn_config.pri b/src/core/core_gn_config.pri
deleted file mode 100644
index 2b8f2e18f..000000000
--- a/src/core/core_gn_config.pri
+++ /dev/null
@@ -1,17 +0,0 @@
-CONFIG = gn_generator $$CONFIG
-GN_SRC_DIR = $$PWD
-GN_FILE = $$OUT_PWD/$$getConfigDir()/BUILD.gn
-GN_FIND_MOCABLES_SCRIPT = $$shell_path($$QTWEBENGINE_ROOT/tools/scripts/gn_find_mocables.py)
-GN_RUN_BINARY_SCRIPT = $$shell_path($$QTWEBENGINE_ROOT/tools/scripts/gn_run_binary.py)
-GN_IMPORTS = $$PWD/qtwebengine.gni
-qtConfig (webengine-extensions) {
- GN_INCLUDES += $$PWD/qtwebengine_sources.gni $$PWD/qtwebengine_resources.gni $$PWD/common/extensions/api/qtwebengine_extensions_features.gni
-} else {
- GN_INCLUDES = $$PWD/qtwebengine_sources.gni $$PWD/qtwebengine_resources.gni
-}
-GN_CORE_INCLUDE_DIRS = $$PWD/service
-GN_CREATE_PRI = true
-GN_PRECOMPILED_HEADERS = true
-QMAKE_INTERNAL_INCLUDED_FILES = $$GN_IMPORTS $$GN_INCLUDES $$GN_FILE
-
-
diff --git a/src/core/core_headers.pro b/src/core/core_headers.pro
deleted file mode 100644
index cd5352eb7..000000000
--- a/src/core/core_headers.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-TARGET = QtWebEngineCore
-CONFIG += no_private_module header_module internal_module no_plist
-QT -= core gui
-MODULE = webenginecoreheaders
-MODULE_CFG_FILE = qtwebenginecore-config
-load(qt_module)
diff --git a/src/core/core_module.pro b/src/core/core_module.pro
deleted file mode 100644
index 5007012ac..000000000
--- a/src/core/core_module.pro
+++ /dev/null
@@ -1,163 +0,0 @@
-MODULE = webenginecore
-
-include(core_common.pri)
-# Needed to set a CFBundleIdentifier
-QMAKE_INFO_PLIST = Info_mac.plist
-
-linking_pri = $$OUT_PWD/$$getConfigDir()/$${TARGET}.pri
-
-!include($$linking_pri) {
- error("Could not find the linking information that gn should have generated.")
-}
-
-api_library_name = qtwebenginecoreapi$$qtPlatformTargetSuffix()
-api_library_path = $$OUT_PWD/api/$$getConfigDir()
-
-# Do not precompile any headers. We are only interested in the linker step.
-PRECOMPILED_HEADER =
-
-isEmpty(NINJA_OBJECTS): error("Missing object files from QtWebEngineCore linking pri.")
-isEmpty(NINJA_LFLAGS): error("Missing linker flags from QtWebEngineCore linking pri")
-isEmpty(NINJA_ARCHIVES): error("Missing archive files from QtWebEngineCore linking pri")
-isEmpty(NINJA_LIBS): error("Missing library files from QtWebEngineCore linking pri")
-NINJA_OBJECTS = $$eval($$list($$NINJA_OBJECTS))
-# Do manual response file linking for macOS and Linux
-
-RSP_OBJECT_FILE = $$OUT_PWD/$$getConfigDir()/$${TARGET}_o.rsp
-for(object, NINJA_OBJECTS): RSP_O_CONTENT += $$object
-write_file($$RSP_OBJECT_FILE, RSP_O_CONTENT)
-RSP_ARCHIVE_FILE = $$OUT_PWD/$$getConfigDir()/$${TARGET}_a.rsp
-for(archive, NINJA_ARCHIVES): RSP_A_CONTENT += $$archive
-write_file($$RSP_ARCHIVE_FILE, RSP_A_CONTENT)
-
-macos:LIBS_PRIVATE += -Wl,-filelist,$$shell_quote($${RSP_OBJECT_FILE}) @$${RSP_ARCHIVE_FILE}
-linux:QMAKE_LFLAGS += @$${RSP_OBJECT_FILE} -Wl,--start-group @$${RSP_ARCHIVE_FILE} -Wl,--end-group
-win32:QMAKE_LFLAGS += @$${RSP_OBJECT_FILE} @$${RSP_ARCHIVE_FILE}
-
-LIBS_PRIVATE += $$NINJA_LIB_DIRS $$NINJA_LIBS
-# GN's LFLAGS doesn't always work across all the Linux configurations we support.
-# The Windows and macOS ones from GN does provide a few useful flags however
-
-unix:qtConfig(webengine-noexecstack): \
- QMAKE_LFLAGS += -Wl,-z,noexecstack
-linux {
- # add chromium flags
- for(flag, NINJA_LFLAGS) {
- # filter out some flags
- !contains(flag, .*noexecstack$): \
- !contains(flag, .*as-needed$): \
- !contains(flag, ^-B.*): \
- !contains(flag, ^-fuse-ld.*): \
- QMAKE_LFLAGS += $$flag
- }
-} else {
- QMAKE_LFLAGS += $$NINJA_LFLAGS
-}
-
-POST_TARGETDEPS += $$NINJA_TARGETDEPS
-
-
-LIBS_PRIVATE += -L$$api_library_path
-CONFIG *= no_smart_library_merge
-osx {
- LIBS_PRIVATE += -Wl,-force_load,$${api_library_path}$${QMAKE_DIR_SEP}lib$${api_library_name}.a
-} else: win32 {
- !qtConfig(webengine-developer-build) {
- # Remove unused functions and data in debug non-developer builds, because the binaries will
- # be smaller in the shipped packages.
- QMAKE_LFLAGS += /OPT:REF
- } else:CONFIG(debug, debug|release):!clang_cl {
- # Make sure to override qtbase's QMAKE_LFLAGS_DEBUG option in debug developer builds,
- # because qmake chooses and overrides the option when it gets appended to QMAKE_LFLAGS in
- # qtbase\mkspecs\features\default_post.prf, regardless of what Chromium passes back from GN.
- QMAKE_LFLAGS_DEBUG -= /DEBUG
- QMAKE_LFLAGS_DEBUG += /DEBUG:FASTLINK
- }
- # Simulate -whole-archive by passing the list of object files that belong to the public
- # API library as response file to the linker.
- QMAKE_LFLAGS += @$${api_library_path}$${QMAKE_DIR_SEP}$${api_library_name}.lib.objects
-} else {
- QMAKE_LFLAGS += -Wl,-whole-archive -l$$api_library_name -Wl,-no-whole-archive
-}
-
-win32 {
- POST_TARGETDEPS += $${api_library_path}$${QMAKE_DIR_SEP}$${api_library_name}.lib
-} else {
- POST_TARGETDEPS += $${api_library_path}$${QMAKE_DIR_SEP}lib$${api_library_name}.a
-}
-
-# Using -Wl,-Bsymbolic-functions seems to confuse the dynamic linker
-# and doesn't let Chromium get access to libc symbols through dlsym.
-CONFIG -= bsymbolic_functions
-
-linux:qtConfig(separate_debug_info): QMAKE_POST_LINK="cd $(DESTDIR) && $(STRIP) --strip-unneeded $(TARGET)"
-
-REPACK_DIR = $$OUT_PWD/$$getConfigDir()
-
-# Duplicated from resources/resources.gyp
-LOCALE_LIST = am ar bg bn ca cs da de el en-GB en-US es-419 es et fa fi fil fr gu he hi hr hu id it ja kn ko lt lv ml mr ms nb nl pl pt-BR pt-PT ro ru sk sl sr sv sw ta te th tr uk vi zh-CN zh-TW
-for(LOC, LOCALE_LIST) {
- locales.files += $$REPACK_DIR/qtwebengine_locales/$${LOC}.pak
-}
-resources.files = $$REPACK_DIR/qtwebengine_resources.pak \
- $$REPACK_DIR/qtwebengine_resources_100p.pak \
- $$REPACK_DIR/qtwebengine_resources_200p.pak \
- $$REPACK_DIR/qtwebengine_devtools_resources.pak
-
-icu.files = $$OUT_PWD/$$getConfigDir()/icudtl.dat
-
-!qtConfig(debug_and_release)|!qtConfig(build_all)|CONFIG(release, debug|release) {
- qtConfig(framework) {
- locales.version = Versions
- locales.path = Resources/qtwebengine_locales
- resources.version = Versions
- resources.path = Resources
- icu.version = Versions
- icu.path = Resources
- # No files, this prepares the bundle Helpers symlink, process.pro will create the directories
- qtwebengineprocessplaceholder.version = Versions
- qtwebengineprocessplaceholder.path = Helpers
- QMAKE_BUNDLE_DATA += icu locales resources qtwebengineprocessplaceholder
- } else {
- locales.CONFIG += no_check_exist
- locales.path = $$[QT_INSTALL_TRANSLATIONS]/qtwebengine_locales
- resources.CONFIG += no_check_exist
- resources.path = $$[QT_INSTALL_DATA]/resources
- INSTALLS += locales resources
-
- !qtConfig(webengine-system-icu) {
- icu.CONFIG += no_check_exist
- icu.path = $$[QT_INSTALL_DATA]/resources
- INSTALLS += icu
- }
- }
-
- !qtConfig(framework):!force_independent {
- #
- # Copy essential files to the qtbase build directory for non-prefix builds
- #
-
- !qtConfig(webengine-system-icu) {
- COPIES += icu
- }
-
- COPIES += resources locales
- }
-}
-
-!build_pass:qtConfig(debug_and_release) {
- # Special GNU make target that ensures linking isn't done for both debug and release builds
- # at the same time.
- notParallel.target = .NOTPARALLEL
- QMAKE_EXTRA_TARGETS += notParallel
-}
-
-OTHER_FILES = \
- $$files(../3rdparty/chromium/*.py, true) \
- $$files(../3rdparty/chromium/*.gyp, true) \
- $$files(../3rdparty/chromium/*.gypi, true) \
- $$files(../3rdparty/chromium/*.gn, true) \
- $$files(../3rdparty/chromium/*.gni, true)
-
-load(qt_module)
-
diff --git a/src/core/core_project.pro b/src/core/core_project.pro
deleted file mode 100644
index 9c8e20808..000000000
--- a/src/core/core_project.pro
+++ /dev/null
@@ -1,28 +0,0 @@
-TEMPLATE = lib
-# Fake project to make QtCreator happy.
-
-include(core_common.pri)
-
-
-linking_pri = $$OUT_PWD/$$getConfigDir()/$${TARGET}.pri
-
-!include($$linking_pri) {
- error("Could not find the linking information that gn should have generated.")
-}
-
-CHROMIUM_SRC_DIR = $$QTWEBENGINE_ROOT/$$getChromiumSrcDir()
-INCLUDEPATH += $$CHROMIUM_SRC_DIR \
- $$CHROMIUM_SRC_DIR/third_party/blink/public \
- $$OUT_PWD/$$getConfigDir()/gen
-
-SOURCES += $$NINJA_SOURCES
-HEADERS += $$NINJA_HEADERS
-DEFINES += $$NINJA_DEFINES
-
-lupdate_run {
- SOURCES += clipboard_qt.cpp \
- profile_adapter_client.cpp \
- profile_adapter.cpp \
- render_view_context_menu_qt.cpp \
- web_contents_adapter.cpp
-}
diff --git a/src/core/custom_handlers/protocol_handler_registry_delegate_qt.cpp b/src/core/custom_handlers/protocol_handler_registry_delegate_qt.cpp
new file mode 100644
index 000000000..a5074fb88
--- /dev/null
+++ b/src/core/custom_handlers/protocol_handler_registry_delegate_qt.cpp
@@ -0,0 +1,36 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+// based on chrome/browser/custom_handlers/chrome_protocol_handler_registry_delegate.cc:
+// Copyright 2021 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "protocol_handler_registry_delegate_qt.h"
+
+#include "content/public/browser/child_process_security_policy.h"
+#include "url/url_util_qt.h"
+
+namespace QtWebEngineCore {
+
+using content::ChildProcessSecurityPolicy;
+
+ProtocolHandlerRegistryDelegateQt::ProtocolHandlerRegistryDelegateQt() = default;
+
+ProtocolHandlerRegistryDelegateQt::~ProtocolHandlerRegistryDelegateQt() = default;
+
+// ProtocolHandlerRegistry::Delegate:
+void ProtocolHandlerRegistryDelegateQt::RegisterExternalHandler(const std::string &protocol)
+{
+ ChildProcessSecurityPolicy *policy = ChildProcessSecurityPolicy::GetInstance();
+ if (!policy->IsWebSafeScheme(protocol)) {
+ policy->RegisterWebSafeScheme(protocol);
+ }
+}
+
+bool ProtocolHandlerRegistryDelegateQt::IsExternalHandlerRegistered(const std::string &protocol)
+{
+ return url::IsHandledProtocol(protocol);
+}
+
+} // namespace QtWebEngineCore
diff --git a/src/core/custom_handlers/protocol_handler_registry_delegate_qt.h b/src/core/custom_handlers/protocol_handler_registry_delegate_qt.h
new file mode 100644
index 000000000..6a0753d22
--- /dev/null
+++ b/src/core/custom_handlers/protocol_handler_registry_delegate_qt.h
@@ -0,0 +1,35 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+// based on chrome/browser/custom_handlers/chrome_protocol_handler_registry_delegate.h:
+// Copyright 2021 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef PROTOCOL_HANDLER_REGISTRY_DELEGATE_QT_H_
+#define PROTOCOL_HANDLER_REGISTRY_DELEGATE_QT_H_
+
+#include <string>
+
+#include "components/custom_handlers/protocol_handler_registry.h"
+
+namespace QtWebEngineCore {
+
+// This class implements the ProtocolHandlerRegistry::Delegate
+// abstract class to provide an OS dependent implementation
+class ProtocolHandlerRegistryDelegateQt : public custom_handlers::ProtocolHandlerRegistry::Delegate {
+public:
+ ProtocolHandlerRegistryDelegateQt();
+ ~ProtocolHandlerRegistryDelegateQt() override;
+
+ ProtocolHandlerRegistryDelegateQt(const ProtocolHandlerRegistryDelegateQt &other) = delete;
+ ProtocolHandlerRegistryDelegateQt &operator=(const ProtocolHandlerRegistryDelegateQt &other) = delete;
+
+ // ProtocolHandlerRegistry::Delegate:
+ void RegisterExternalHandler(const std::string &protocol) override;
+ bool IsExternalHandlerRegistered(const std::string &protocol) override;
+};
+
+} // namespace QtWebEngineCore
+
+#endif // PROTOCOL_HANDLER_REGISTRY_DELEGATE_QT_H_
diff --git a/src/core/custom_handlers/protocol_handler_registry_factory.cpp b/src/core/custom_handlers/protocol_handler_registry_factory.cpp
new file mode 100644
index 000000000..50b17006b
--- /dev/null
+++ b/src/core/custom_handlers/protocol_handler_registry_factory.cpp
@@ -0,0 +1,75 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+// based on chrome/browser/custom_handlers/protocol_handler_registry_factory.cc
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "protocol_handler_registry_factory.h"
+
+#include <memory>
+
+#include "base/memory/singleton.h"
+#include "components/custom_handlers/protocol_handler_registry.h"
+#include "components/keyed_service/content/browser_context_dependency_manager.h"
+
+#include "protocol_handler_registry_delegate_qt.h"
+
+namespace QtWebEngineCore {
+
+// static
+ProtocolHandlerRegistryFactory *ProtocolHandlerRegistryFactory::GetInstance()
+{
+ return base::Singleton<ProtocolHandlerRegistryFactory>::get();
+}
+
+// static
+custom_handlers::ProtocolHandlerRegistry *ProtocolHandlerRegistryFactory::GetForBrowserContext(content::BrowserContext *context)
+{
+ return static_cast<custom_handlers::ProtocolHandlerRegistry *>(GetInstance()->GetServiceForBrowserContext(context, true));
+}
+
+ProtocolHandlerRegistryFactory::ProtocolHandlerRegistryFactory()
+ : BrowserContextKeyedServiceFactory("ProtocolHandlerRegistry", BrowserContextDependencyManager::GetInstance()) {}
+
+ProtocolHandlerRegistryFactory::~ProtocolHandlerRegistryFactory()
+{
+}
+
+// Will be created when initializing profile_io_data, so we might
+// as well have the framework create this along with other
+// PKSs to preserve orderly civic conduct :)
+bool ProtocolHandlerRegistryFactory::ServiceIsCreatedWithBrowserContext() const
+{
+ return true;
+}
+
+// Allows the produced registry to be used in incognito mode.
+content::BrowserContext *ProtocolHandlerRegistryFactory::GetBrowserContextToUse(content::BrowserContext *context) const
+{
+ return context;
+// return chrome::GetBrowserContextRedirectedInIncognito(context);
+}
+
+// Do not create this service for tests. MANY tests will fail
+// due to the threading requirements of this service. ALSO,
+// not creating this increases test isolation (which is GOOD!)
+bool ProtocolHandlerRegistryFactory::ServiceIsNULLWhileTesting() const
+{
+ return true;
+}
+
+KeyedService *ProtocolHandlerRegistryFactory::BuildServiceInstanceFor(content::BrowserContext *context) const
+{
+ custom_handlers::ProtocolHandlerRegistry *registry =
+ new custom_handlers::ProtocolHandlerRegistry(/*prefs*/ nullptr,
+ std::make_unique<ProtocolHandlerRegistryDelegateQt>());
+
+ // Must be called as a part of the creation process.
+ registry->InitProtocolSettings();
+
+ return registry;
+}
+
+} // namespace QtWebEngineCore
diff --git a/src/core/custom_handlers/protocol_handler_registry_factory.h b/src/core/custom_handlers/protocol_handler_registry_factory.h
new file mode 100644
index 000000000..6559addc0
--- /dev/null
+++ b/src/core/custom_handlers/protocol_handler_registry_factory.h
@@ -0,0 +1,57 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+// based on chrome/browser/custom_handlers/protocol_handler_registry_factory.h:
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef PROTOCOL_HANDLER_REGISTRY_FACTORY_H_
+#define PROTOCOL_HANDLER_REGISTRY_FACTORY_H_
+
+#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
+
+namespace custom_handlers {
+class ProtocolHandlerRegistry;
+}
+
+namespace base {
+template <typename T> struct DefaultSingletonTraits;
+}
+
+namespace QtWebEngineCore {
+
+// Singleton that owns all ProtocolHandlerRegistrys and associates them with
+// Profiles. Listens for the Profile's destruction notification and cleans up
+// the associated ProtocolHandlerRegistry.
+class ProtocolHandlerRegistryFactory : public BrowserContextKeyedServiceFactory {
+public:
+ // Returns the singleton instance of the ProtocolHandlerRegistryFactory.
+ static ProtocolHandlerRegistryFactory *GetInstance();
+
+ // Returns the ProtocolHandlerRegistry that provides intent registration for
+ // |context|. Ownership stays with this factory object.
+ static custom_handlers::ProtocolHandlerRegistry *GetForBrowserContext(content::BrowserContext *context);
+
+ ProtocolHandlerRegistryFactory(const ProtocolHandlerRegistryFactory &) = delete;
+ ProtocolHandlerRegistryFactory &operator=(const ProtocolHandlerRegistryFactory &) = delete;
+
+protected:
+ // BrowserContextKeyedServiceFactory implementation.
+ bool ServiceIsCreatedWithBrowserContext() const override;
+ content::BrowserContext *GetBrowserContextToUse(content::BrowserContext *context) const override;
+ bool ServiceIsNULLWhileTesting() const override;
+
+private:
+ friend struct base::DefaultSingletonTraits<ProtocolHandlerRegistryFactory>;
+
+ ProtocolHandlerRegistryFactory();
+ ~ProtocolHandlerRegistryFactory() override;
+
+ // BrowserContextKeyedServiceFactory implementation.
+ KeyedService *BuildServiceInstanceFor(content::BrowserContext *profile) const override;
+};
+
+} // namespace QtWebEngineCore
+
+#endif // PROTOCOL_HANDLER_REGISTRY_FACTORY_H_
diff --git a/src/core/custom_handlers/register_protocol_handler_request_controller.h b/src/core/custom_handlers/register_protocol_handler_request_controller.h
new file mode 100644
index 000000000..6305ce5b7
--- /dev/null
+++ b/src/core/custom_handlers/register_protocol_handler_request_controller.h
@@ -0,0 +1,26 @@
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef REGISTER_PROTOCOL_HANDLER_REQUEST_CONTROLLER_H
+#define REGISTER_PROTOCOL_HANDLER_REQUEST_CONTROLLER_H
+
+#include "request_controller.h"
+
+namespace QtWebEngineCore {
+
+class RegisterProtocolHandlerRequestController : public RequestController {
+public:
+ RegisterProtocolHandlerRequestController(QUrl origin, QString scheme)
+ : RequestController(std::move(origin))
+ , m_scheme(std::move(scheme))
+ {}
+
+ QString scheme() const { return m_scheme; }
+
+private:
+ QString m_scheme;
+};
+
+} // namespace QtWebEngineCore
+
+#endif // REGISTER_PROTOCOL_HANDLER_REQUEST_CONTROLLER_H
diff --git a/src/core/custom_handlers/register_protocol_handler_request_controller_impl.cpp b/src/core/custom_handlers/register_protocol_handler_request_controller_impl.cpp
new file mode 100644
index 000000000..efaf54cd2
--- /dev/null
+++ b/src/core/custom_handlers/register_protocol_handler_request_controller_impl.cpp
@@ -0,0 +1,49 @@
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+#include "custom_handlers/register_protocol_handler_request_controller_impl.h"
+
+#include "components/custom_handlers/protocol_handler_registry.h"
+#include "content/public/browser/web_contents.h"
+
+#include "custom_handlers/protocol_handler_registry_factory.h"
+#include "type_conversion.h"
+
+namespace QtWebEngineCore {
+
+RegisterProtocolHandlerRequestControllerImpl::RegisterProtocolHandlerRequestControllerImpl(
+ content::WebContents *webContents,
+ custom_handlers::ProtocolHandler handler)
+ : RegisterProtocolHandlerRequestController(
+ toQt(handler.url()),
+ toQt(handler.protocol()))
+ , content::WebContentsObserver(webContents)
+ , m_handler(handler)
+{}
+
+RegisterProtocolHandlerRequestControllerImpl::~RegisterProtocolHandlerRequestControllerImpl()
+{
+ reject();
+}
+
+custom_handlers::ProtocolHandlerRegistry *RegisterProtocolHandlerRequestControllerImpl::protocolHandlerRegistry()
+{
+ content::WebContents *webContents = web_contents();
+ if (!webContents)
+ return nullptr;
+ content::BrowserContext *context = webContents->GetBrowserContext();
+ return ProtocolHandlerRegistryFactory::GetForBrowserContext(context);
+}
+
+void RegisterProtocolHandlerRequestControllerImpl::accepted()
+{
+ if (custom_handlers::ProtocolHandlerRegistry *registry = protocolHandlerRegistry())
+ registry->OnAcceptRegisterProtocolHandler(m_handler);
+}
+
+void RegisterProtocolHandlerRequestControllerImpl::rejected()
+{
+ if (custom_handlers::ProtocolHandlerRegistry *registry = protocolHandlerRegistry())
+ registry->OnIgnoreRegisterProtocolHandler(m_handler);
+}
+
+} // namespace QtWebEngineCore
diff --git a/src/core/custom_handlers/register_protocol_handler_request_controller_impl.h b/src/core/custom_handlers/register_protocol_handler_request_controller_impl.h
new file mode 100644
index 000000000..073ca9bf8
--- /dev/null
+++ b/src/core/custom_handlers/register_protocol_handler_request_controller_impl.h
@@ -0,0 +1,38 @@
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef REGISTER_PROTOCOL_HANDLER_REQUEST_CONTROLLER_IMPL_H
+#define REGISTER_PROTOCOL_HANDLER_REQUEST_CONTROLLER_IMPL_H
+
+#include "register_protocol_handler_request_controller.h"
+
+#include "content/public/browser/web_contents_observer.h"
+#include "components/custom_handlers/protocol_handler.h"
+
+namespace custom_handlers {
+class ProtocolHandlerRegistry;
+}
+
+namespace QtWebEngineCore {
+
+class RegisterProtocolHandlerRequestControllerImpl final : public RegisterProtocolHandlerRequestController,
+ private content::WebContentsObserver {
+public:
+ RegisterProtocolHandlerRequestControllerImpl(
+ content::WebContents *webContents,
+ custom_handlers::ProtocolHandler handler);
+
+ ~RegisterProtocolHandlerRequestControllerImpl();
+
+protected:
+ void accepted() override;
+ void rejected() override;
+
+private:
+ custom_handlers::ProtocolHandlerRegistry *protocolHandlerRegistry();
+ custom_handlers::ProtocolHandler m_handler;
+};
+
+} // namespace QtWebEngineCore
+
+#endif // REGISTER_PROTOCOL_HANDLER_REQUEST_CONTROLLER_IMPL_H
diff --git a/src/core/delegated_frame_host_client_qt.cpp b/src/core/delegated_frame_host_client_qt.cpp
index 817ea2fa5..ad1de91f6 100644
--- a/src/core/delegated_frame_host_client_qt.cpp
+++ b/src/core/delegated_frame_host_client_qt.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "delegated_frame_host_client_qt.h"
@@ -58,20 +22,14 @@ SkColor DelegatedFrameHostClientQt::DelegatedFrameHostGetGutterColor() const
return p->GetBackgroundColor().value_or(SK_ColorWHITE);
}
-void DelegatedFrameHostClientQt::OnBeginFrame(base::TimeTicks frame_time)
+void DelegatedFrameHostClientQt::OnFrameTokenChanged(uint32_t frame_token, base::TimeTicks activation_time)
{
- p->host()->ProgressFlingIfNeeded(frame_time);
- p->UpdateNeedsBeginFramesInternal();
-}
-
-void DelegatedFrameHostClientQt::OnFrameTokenChanged(uint32_t frame_token)
-{
- p->OnFrameTokenChangedForView(frame_token);
+ p->OnFrameTokenChangedForView(frame_token, activation_time);
}
float DelegatedFrameHostClientQt::GetDeviceScaleFactor() const
{
- return p->m_screenInfo.device_scale_factor;
+ return p->GetScreenInfo().device_scale_factor;
}
void DelegatedFrameHostClientQt::InvalidateLocalSurfaceIdOnEviction()
diff --git a/src/core/delegated_frame_host_client_qt.h b/src/core/delegated_frame_host_client_qt.h
index b5dc6eb59..184b84d7a 100644
--- a/src/core/delegated_frame_host_client_qt.h
+++ b/src/core/delegated_frame_host_client_qt.h
@@ -1,46 +1,10 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef DELEGATED_FRAME_HOST_CLIENT_QT_H
#define DELEGATED_FRAME_HOST_CLIENT_QT_H
-#include "qtwebenginecoreglobal_p.h"
+#include <QtWebEngineCore/private/qtwebenginecoreglobal_p.h>
#include "content/browser/renderer_host/delegated_frame_host.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
@@ -57,8 +21,8 @@ public:
ui::Layer *DelegatedFrameHostGetLayer() const override;
bool DelegatedFrameHostIsVisible() const override;
SkColor DelegatedFrameHostGetGutterColor() const override;
- void OnBeginFrame(base::TimeTicks frame_time) override;
- void OnFrameTokenChanged(uint32_t frame_token) override;
+ void OnFrameTokenChanged(uint32_t frame_token,
+ base::TimeTicks activation_time) override;
float GetDeviceScaleFactor() const override;
void InvalidateLocalSurfaceIdOnEviction() override;
std::vector<viz::SurfaceId> CollectSurfaceIdsForEviction() override;
diff --git a/src/core/desktop_media_controller.cpp b/src/core/desktop_media_controller.cpp
new file mode 100644
index 000000000..50ac0a40c
--- /dev/null
+++ b/src/core/desktop_media_controller.cpp
@@ -0,0 +1,244 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "desktop_media_controller.h"
+#include "desktop_media_controller_p.h"
+#include "type_conversion.h"
+
+#include "base/containers/contains.h"
+#include "base/functional/callback.h"
+#include "chrome/browser/media/webrtc/desktop_capturer_wrapper.h"
+#include "chrome/browser/media/webrtc/native_desktop_media_list.h"
+#include "content/public/browser/desktop_media_id.h"
+
+#if QT_CONFIG(webengine_webrtc)
+#include "content/public/browser/desktop_capture.h"
+#endif // QT_CONFIG(webengine_webrtc)
+
+namespace QtWebEngineCore {
+namespace {
+DesktopMediaList::Type toMediaListType(DesktopMediaType type)
+{
+ switch (type) {
+ case DesktopMediaType::Screen:
+ return DesktopMediaList::Type::kScreen;
+ case DesktopMediaType::Window:
+ return DesktopMediaList::Type::kWindow;
+ default:
+ return DesktopMediaList::Type::kNone;
+ }
+}
+
+std::unique_ptr<DesktopMediaList> createMediaList(DesktopMediaType type)
+{
+#if QT_CONFIG(webengine_webrtc)
+ DesktopMediaList::Type listType = toMediaListType(type);
+ webrtc::DesktopCaptureOptions options = content::desktop_capture::CreateDesktopCaptureOptions();
+
+ switch (listType) {
+ case DesktopMediaList::Type::kScreen: {
+ std::unique_ptr<webrtc::DesktopCapturer> screenCapturer =
+ webrtc::DesktopCapturer::CreateScreenCapturer(options);
+ std::unique_ptr<DesktopCapturerWrapper> capturer =
+ std::make_unique<DesktopCapturerWrapper>(std::move(screenCapturer));
+ return std::make_unique<NativeDesktopMediaList>(listType, std::move(capturer));
+ }
+ case DesktopMediaList::Type::kWindow: {
+ std::unique_ptr<webrtc::DesktopCapturer> windowCapturer =
+ webrtc::DesktopCapturer::CreateWindowCapturer(options);
+ std::unique_ptr<DesktopCapturerWrapper> capturer =
+ std::make_unique<DesktopCapturerWrapper>(std::move(windowCapturer));
+ return std::make_unique<NativeDesktopMediaList>(
+ listType, std::move(capturer),
+ !content::desktop_capture::ShouldEnumerateCurrentProcessWindows());
+ }
+ default: {
+ Q_UNREACHABLE();
+ }
+ }
+#else
+ return nullptr;
+#endif // QT_CONFIG(webengine_webrtc)
+}
+} // namespace
+
+class DesktopMediaListQtPrivate : public DesktopMediaListObserver
+{
+public:
+ DesktopMediaListQtPrivate(DesktopMediaType type, DesktopMediaListQt *qq);
+
+ void init();
+ void startUpdating();
+ const DesktopMediaList::Source& getSource(int index) const;
+
+ void OnSourceAdded(int index) override;
+ void OnSourceRemoved(int index) override;
+ void OnSourceMoved(int old_index, int new_index) override;
+ void OnSourceNameChanged(int index) override;
+ void OnSourceThumbnailChanged(int index) override { }
+ void OnSourcePreviewChanged(size_t index) override { }
+ void OnDelegatedSourceListSelection() override { }
+ void OnDelegatedSourceListDismissed() override { }
+
+ bool isInitialized;
+ std::unique_ptr<DesktopMediaList> mediaList;
+ DesktopMediaListQt *q_ptr;
+ Q_DECLARE_PUBLIC(DesktopMediaListQt)
+};
+
+DesktopMediaListQtPrivate::DesktopMediaListQtPrivate(DesktopMediaType type, DesktopMediaListQt *qq)
+ : isInitialized(false)
+ , mediaList(createMediaList(type))
+ , q_ptr(qq)
+{
+}
+
+const DesktopMediaList::Source& DesktopMediaListQtPrivate::getSource(int index) const
+{
+ return mediaList->GetSource(index);
+}
+
+void DesktopMediaListQtPrivate::init()
+{
+ // Work around the asynchronous initialization of the source list.
+ // DesktopMediaList::Update populates the list and notifies the controller when it completes.
+ // This makes direct 'selectScreen/Window' calls possible from the frontend.
+ // Note: StartUpdating should be called after Update is completed as it can overwrite the
+ // internal cb.
+ base::OnceCallback<void()> onComplete = base::BindOnce(
+ [](DesktopMediaListQtPrivate *observer) {
+ observer->isInitialized = true;
+ Q_EMIT observer->q_ptr->initialized();
+ observer->startUpdating();
+ },
+ this);
+ mediaList->Update(std::move(onComplete));
+}
+
+void DesktopMediaListQtPrivate::startUpdating()
+{
+ mediaList->StartUpdating(this);
+}
+
+void DesktopMediaListQtPrivate::OnSourceAdded(int index)
+{
+ Q_Q(DesktopMediaListQt);
+ Q_EMIT q->sourceAdded(index);
+}
+
+void DesktopMediaListQtPrivate::OnSourceRemoved(int index)
+{
+ Q_Q(DesktopMediaListQt);
+ Q_EMIT q->sourceRemoved(index);
+}
+
+void DesktopMediaListQtPrivate::OnSourceMoved(int old_index, int new_index)
+{
+ Q_Q(DesktopMediaListQt);
+ Q_EMIT q->sourceMoved(old_index, new_index);
+}
+
+void DesktopMediaListQtPrivate::OnSourceNameChanged(int index)
+{
+ Q_Q(DesktopMediaListQt);
+ Q_EMIT q->sourceNameChanged(index);
+}
+
+DesktopMediaListQt::DesktopMediaListQt(DesktopMediaType type)
+ : d(new DesktopMediaListQtPrivate(type, this))
+{
+}
+
+DesktopMediaListQt::~DesktopMediaListQt() { }
+
+QString DesktopMediaListQt::getSourceName(int index) const
+{
+ const auto &source = d->getSource(index);
+ return toQt(source.name);
+}
+
+int DesktopMediaListQt::getSourceCount() const
+{
+ return d->mediaList->GetSourceCount();
+}
+
+bool DesktopMediaListQt::isInitialized() const
+{
+ return d->isInitialized;
+}
+
+DesktopMediaControllerPrivate::DesktopMediaControllerPrivate(
+ base::OnceCallback<void(content::DesktopMediaID)> doneCallback)
+ : doneCallback(std::move(doneCallback))
+ , screens(new DesktopMediaListQt(DesktopMediaType::Screen))
+ , windows(new DesktopMediaListQt(DesktopMediaType::Window))
+{
+}
+
+void DesktopMediaControllerPrivate::selectScreen(int index)
+{
+ const auto &source = screens->d->getSource(index);
+ std::move(doneCallback).Run(source.id);
+}
+
+void DesktopMediaControllerPrivate::selectWindow(int index)
+{
+ const auto &source = windows->d->getSource(index);
+ std::move(doneCallback).Run(source.id);
+}
+
+void DesktopMediaControllerPrivate::cancel()
+{
+ std::move(doneCallback).Run({});
+}
+
+DesktopMediaController::DesktopMediaController(DesktopMediaControllerPrivate *dd)
+ : d(dd)
+{
+ // Make sure both lists are populated before sending the request.
+ DesktopMediaListQt *screens = DesktopMediaController::screens();
+ DesktopMediaListQt *windows = DesktopMediaController::windows();
+ QObject::connect(screens, &DesktopMediaListQt::initialized, [windows, this]() {
+ if (windows->isInitialized())
+ Q_EMIT mediaListsInitialized();
+ });
+
+ QObject::connect(windows, &DesktopMediaListQt::initialized, [screens, this]() {
+ if (screens->isInitialized())
+ Q_EMIT mediaListsInitialized();
+ });
+
+ screens->d->init();
+ windows->d->init();
+}
+
+DesktopMediaController::~DesktopMediaController()
+{
+}
+
+void DesktopMediaController::selectScreen(int index)
+{
+ d->selectScreen(index);
+}
+
+void DesktopMediaController::selectWindow(int index)
+{
+ d->selectWindow(index);
+}
+
+void DesktopMediaController::cancel()
+{
+ d->cancel();
+}
+
+DesktopMediaListQt *DesktopMediaController::screens() const
+{
+ return d->screens.data();
+}
+
+DesktopMediaListQt *DesktopMediaController::windows() const
+{
+ return d->windows.data();
+}
+
+} // namespace QtWebEngineCore
diff --git a/src/core/desktop_media_controller.h b/src/core/desktop_media_controller.h
new file mode 100644
index 000000000..0cb741225
--- /dev/null
+++ b/src/core/desktop_media_controller.h
@@ -0,0 +1,65 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef DESKTOP_MEDIA_CONTROLLER_H
+#define DESKTOP_MEDIA_CONTROLLER_H
+
+#include <QtWebEngineCore/private/qtwebenginecoreglobal_p.h>
+#include <QtCore/QObject>
+
+#include <QString>
+
+namespace QtWebEngineCore {
+class DesktopMediaListQtPrivate;
+class DesktopMediaControllerPrivate;
+
+enum DesktopMediaType { Screen = 0, Window };
+
+class Q_WEBENGINECORE_EXPORT DesktopMediaListQt : public QObject
+{
+ Q_OBJECT
+public:
+ ~DesktopMediaListQt() override;
+
+ QString getSourceName(int index) const;
+ int getSourceCount() const;
+
+Q_SIGNALS:
+ void initialized();
+ void itemSelected(int index);
+ void sourceAdded(int index);
+ void sourceRemoved(int index);
+ void sourceMoved(int oldIndex, int newIndex);
+ void sourceNameChanged(int index);
+
+private:
+ friend class DesktopMediaController;
+ friend class DesktopMediaControllerPrivate;
+ bool isInitialized() const;
+ explicit DesktopMediaListQt(DesktopMediaType type);
+ std::unique_ptr<DesktopMediaListQtPrivate> d;
+};
+
+class Q_WEBENGINECORE_EXPORT DesktopMediaController : public QObject
+{
+ Q_OBJECT
+public:
+ explicit DesktopMediaController(DesktopMediaControllerPrivate *dd);
+ ~DesktopMediaController() override;
+
+ DesktopMediaListQt *screens() const;
+ DesktopMediaListQt *windows() const;
+
+ void selectScreen(int index);
+ void selectWindow(int index);
+ void cancel();
+
+Q_SIGNALS:
+ void mediaListsInitialized();
+
+private:
+ std::unique_ptr<DesktopMediaControllerPrivate> d;
+};
+
+} // namespace QtWebEngineCore
+#endif // DESKTOP_MEDIA_CONTROLLER_H
diff --git a/src/core/desktop_media_controller_p.h b/src/core/desktop_media_controller_p.h
new file mode 100644
index 000000000..4bb3a6312
--- /dev/null
+++ b/src/core/desktop_media_controller_p.h
@@ -0,0 +1,28 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef DESKTOP_MEDIA_CONTROLLER_P_H
+#define DESKTOP_MEDIA_CONTROLLER_P_H
+
+#include <QtCore/QObject>
+#include <QtWebEngineCore/private/qtwebenginecoreglobal_p.h>
+
+#include "content/public/browser/desktop_media_id.h"
+#include "base/functional/callback.h"
+
+namespace QtWebEngineCore {
+class Q_WEBENGINECORE_EXPORT DesktopMediaControllerPrivate
+{
+public:
+ DesktopMediaControllerPrivate(base::OnceCallback<void(content::DesktopMediaID)> doneCallback);
+ void selectScreen(int index);
+ void selectWindow(int index);
+ void cancel();
+ base::OnceCallback<void(content::DesktopMediaID)> doneCallback;
+ QScopedPointer<DesktopMediaListQt> screens;
+ QScopedPointer<DesktopMediaListQt> windows;
+};
+
+} // namespace QtWebEngineCore
+
+#endif // DESKTOP_MEDIA_CONTROLLER_P_H
diff --git a/src/core/desktop_screen_qt.cpp b/src/core/desktop_screen_qt.cpp
index 15a3856fc..fb68f7b09 100644
--- a/src/core/desktop_screen_qt.cpp
+++ b/src/core/desktop_screen_qt.cpp
@@ -1,113 +1,156 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "desktop_screen_qt.h"
#include "ui/display/display.h"
-#include "ui/gfx/geometry/point.h"
-#include <QtGlobal>
+#include "type_conversion.h"
-namespace QtWebEngineCore {
+#include <QGuiApplication>
+#include <QScreen>
-gfx::Point DesktopScreenQt::GetCursorScreenPoint()
-{
- Q_UNREACHABLE();
- return gfx::Point();
-}
+#if defined(USE_OZONE)
+#include "ui/ozone/buildflags.h"
+#if BUILDFLAG(OZONE_PLATFORM_X11)
+#define USE_XSCREENSAVER
+#include "ui/base/x/x11_screensaver.h"
+#include "ui/base/x/x11_util.h"
+#endif
+#endif
-bool DesktopScreenQt::IsWindowUnderCursor(gfx::NativeWindow)
-{
- Q_UNREACHABLE();
- return false;
-}
+#include <cmath>
+
+namespace QtWebEngineCore {
-gfx::NativeWindow DesktopScreenQt::GetWindowAtScreenPoint(const gfx::Point& point)
+static display::Display::Rotation toDisplayRotation(Qt::ScreenOrientation orientation)
{
- Q_UNREACHABLE();
- return gfx::NativeWindow();
+ switch (orientation) {
+ case Qt::PrimaryOrientation:
+ case Qt::LandscapeOrientation:
+ return display::Display::ROTATE_0;
+ case Qt::PortraitOrientation:
+ return display::Display::ROTATE_90;
+ case Qt::InvertedLandscapeOrientation:
+ return display::Display::ROTATE_180;
+ case Qt::InvertedPortraitOrientation:
+ return display::Display::ROTATE_270;
+ }
}
-int DesktopScreenQt::GetNumDisplays() const
+display::Display toDisplayDisplay(int id, const QScreen *screen)
{
- Q_UNREACHABLE();
- return 0;
+ auto display = display::Display(id, toGfx(screen->geometry()));
+ display.set_work_area(toGfx(screen->availableGeometry()));
+ display.set_is_monochrome(screen->depth() == 1);
+ display.set_color_depth(screen->depth());
+ display.set_depth_per_component(8); // FIXME: find the real value
+ display.set_display_frequency(std::ceil(screen->refreshRate()));
+ display.set_rotation(toDisplayRotation(screen->orientation()));
+
+ // FIXME: support lower scale factor
+ float pixelRatio = screen->devicePixelRatio();
+ if (pixelRatio < 1) {
+ qWarning("Unsupported scale factor (%f) detected on Display%d", pixelRatio, id);
+ display.set_device_scale_factor(qGuiApp->devicePixelRatio());
+ } else {
+ display.set_device_scale_factor(pixelRatio);
+ }
+
+ if (screen->nativeOrientation() != Qt::PrimaryOrientation)
+ display.set_panel_rotation(toDisplayRotation(screen->nativeOrientation()));
+ return display;
}
-std::vector<display::Display>& DesktopScreenQt::GetAllDisplays() const
+DesktopScreenQt::DesktopScreenQt()
{
- static std::vector<display::Display> empty;
- return empty;
+ initializeScreens();
}
-display::Display DesktopScreenQt::GetDisplayNearestWindow(gfx::NativeWindow window) const
+DesktopScreenQt::~DesktopScreenQt()
{
- // RenderViewHostImpl::OnStartDragging uses this to determine
- // the scale factor for the view.
- return display::Display(0);
+ for (auto conn : std::as_const(m_connections))
+ QObject::disconnect(conn);
}
-display::Display DesktopScreenQt::GetDisplayNearestPoint(const gfx::Point& point) const
+void DesktopScreenQt::initializeScreens()
{
- Q_UNREACHABLE();
- return display::Display();
+ if (updateAllScreens()) {
+ m_connections[0] =
+ QObject::connect(qApp, &QGuiApplication::primaryScreenChanged, [this] (QScreen *screen) {
+ ProcessDisplayChanged(toDisplayDisplay(0, screen), true /* is_primary */);
+ });
+ // no guarantees how these will affect ids:
+ m_connections[1] =
+ QObject::connect(qApp, &QGuiApplication::screenAdded, [this] (QScreen *) {
+ updateAllScreens();
+ });
+ m_connections[2] =
+ QObject::connect(qApp, &QGuiApplication::screenRemoved, [this] (QScreen *) {
+ updateAllScreens();
+ });
+ } else {
+ // Running headless
+ ProcessDisplayChanged(display::Display::GetDefaultDisplay(), true /* is_primary */);
+ m_connections[0] =
+ QObject::connect(qApp, &QGuiApplication::screenAdded, [this] (QScreen *) {
+ display_list().RemoveDisplay(display::kDefaultDisplayId);
+ QObject::disconnect(m_connections[0]);
+ initializeScreens();
+ });
+ }
}
-display::Display DesktopScreenQt::GetDisplayMatching(const gfx::Rect& match_rect) const
+bool DesktopScreenQt::updateAllScreens()
{
- Q_UNREACHABLE();
- return display::Display();
+ Q_ASSERT(qApp->primaryScreen() == qApp->screens().first());
+ const auto screens = qApp->screens();
+ const int oldLen = GetNumDisplays();
+ for (int i = screens.length(); i < oldLen; ++i)
+ display_list().RemoveDisplay(i);
+ for (int i = 0; i < screens.length(); ++i)
+ ProcessDisplayChanged(toDisplayDisplay(i, screens.at(i)), i == 0 /* is_primary */);
+
+ return screens.length() > 0;
}
-display::Display DesktopScreenQt::GetPrimaryDisplay() const
+display::Display DesktopScreenQt::GetDisplayNearestWindow(gfx::NativeWindow /*window*/) const
{
- return display::Display(0);
+ return GetPrimaryDisplay();
}
-void DesktopScreenQt::AddObserver(display::DisplayObserver* observer)
+#if defined(USE_XSCREENSAVER)
+class XScreenSuspender : public display::Screen::ScreenSaverSuspender
{
- Q_UNREACHABLE();
+public:
+ XScreenSuspender()
+ {
+ ui::SuspendX11ScreenSaver(true);
+ }
+ ~XScreenSuspender() override
+ {
+ ui::SuspendX11ScreenSaver(false);
+ }
+};
+#endif
+#if BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX)
+std::unique_ptr<display::Screen::ScreenSaverSuspender> DesktopScreenQt::SuspendScreenSaver()
+{
+#if defined(USE_XSCREENSAVER)
+ return std::make_unique<XScreenSuspender>();
+#else
+ return nullptr;
+#endif
}
+#endif
-void DesktopScreenQt::RemoveObserver(display::DisplayObserver* observer)
+bool DesktopScreenQt::IsScreenSaverActive() const
{
- Q_UNREACHABLE();
+#if defined(USE_XSCREENSAVER)
+ return ui::IsXScreensaverActive();
+#else
+ return false;
+#endif
}
} // namespace QtWebEngineCore
diff --git a/src/core/desktop_screen_qt.h b/src/core/desktop_screen_qt.h
index 0c52c615a..a322c4840 100644
--- a/src/core/desktop_screen_qt.h
+++ b/src/core/desktop_screen_qt.h
@@ -1,63 +1,31 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef DESKTOP_SCREEN_QT_H
#define DESKTOP_SCREEN_QT_H
-#include "ui/display/screen.h"
+#include "ui/display/screen_base.h"
+
+#include <qmetaobject.h>
namespace QtWebEngineCore {
-class DesktopScreenQt : public display::Screen {
+class DesktopScreenQt : public display::ScreenBase
+{
public:
- // Overridden from gfx::Screen:
- gfx::Point GetCursorScreenPoint() override;
- bool IsWindowUnderCursor(gfx::NativeWindow) override;
- gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override;
- int GetNumDisplays() const override;
- std::vector<display::Display>& GetAllDisplays() const override;
- display::Display GetDisplayNearestWindow(gfx::NativeWindow window) const override;
- display::Display GetDisplayNearestPoint(const gfx::Point& point) const override;
- display::Display GetDisplayMatching(const gfx::Rect& match_rect) const override;
- display::Display GetPrimaryDisplay() const override;
- void AddObserver(display::DisplayObserver* observer) override;
- void RemoveObserver(display::DisplayObserver* observer) override;
+ DesktopScreenQt();
+ ~DesktopScreenQt() override;
+
+ display::Display GetDisplayNearestWindow(gfx::NativeWindow /*window*/) const override;
+#if BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX)
+ std::unique_ptr<ScreenSaverSuspender> SuspendScreenSaver() override;
+#endif
+ bool IsScreenSaverActive() const override;
+
+private:
+ void initializeScreens();
+ bool updateAllScreens();
+ QMetaObject::Connection m_connections[3];
};
} // namespace QtWebEngineCore
diff --git a/src/core/devtools_frontend_qt.cpp b/src/core/devtools_frontend_qt.cpp
index 52d7dc669..7cea68390 100644
--- a/src/core/devtools_frontend_qt.cpp
+++ b/src/core/devtools_frontend_qt.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// based on content/shell/browser/shell_devtools_frontend.cc:
// Copyright 2013 The Chromium Authors. All rights reserved.
@@ -44,151 +8,44 @@
#include "devtools_frontend_qt.h"
-#include "profile_adapter.h"
#include "profile_qt.h"
#include "web_contents_adapter.h"
+#include "web_contents_delegate_qt.h"
-#include "base/base64.h"
-#include "base/json/json_reader.h"
-#include "base/json/json_writer.h"
-#include "base/json/string_escape.h"
-#include "base/macros.h"
-#include "base/memory/ptr_util.h"
-#include "base/strings/string_number_conversions.h"
-#include "base/strings/stringprintf.h"
-#include "base/strings/utf_string_conversions.h"
-#include "base/task/post_task.h"
-#include "base/values.h"
-#include "chrome/common/url_constants.h"
-#include "components/prefs/in_memory_pref_store.h"
-#include "components/prefs/json_pref_store.h"
+#include "chrome/browser/devtools/devtools_eye_dropper.h"
+#include "chrome/browser/devtools/devtools_ui_bindings.h"
+#include "chrome/common/pref_names.h"
+#include "components/prefs/scoped_user_pref_update.h"
#include "content/public/browser/browser_context.h"
-#include "content/public/browser/browser_task_traits.h"
-#include "content/public/browser/browser_thread.h"
-#include "content/public/browser/file_url_loader.h"
+#include "content/public/browser/devtools_agent_host.h"
#include "content/public/browser/navigation_controller.h"
-#include "content/public/browser/navigation_handle.h"
-#include "content/public/browser/render_frame_host.h"
-#include "content/public/browser/render_view_host.h"
-#include "content/public/browser/shared_cors_origin_access_list.h"
-#include "content/public/browser/storage_partition.h"
-#include "content/public/browser/web_contents.h"
-#include "content/public/common/content_client.h"
-#include "content/public/common/url_constants.h"
-#include "content/public/common/url_utils.h"
-#include "ipc/ipc_channel.h"
-#include "net/http/http_response_headers.h"
-#include "net/traffic_annotation/network_traffic_annotation.h"
-#include "services/network/public/cpp/simple_url_loader.h"
-#include "services/network/public/cpp/simple_url_loader_stream_consumer.h"
+#include "content/public/browser/page_navigator.h"
+#include "content/public/browser/site_instance.h"
+#include "url/gurl.h"
using namespace QtWebEngineCore;
namespace {
-
-std::unique_ptr<base::DictionaryValue> BuildObjectForResponse(const net::HttpResponseHeaders *rh)
-{
- auto response = std::make_unique<base::DictionaryValue>();
- response->SetInteger("statusCode", rh ? rh->response_code() : 200);
-
- auto headers = std::make_unique<base::DictionaryValue>();
- size_t iterator = 0;
- std::string name;
- std::string value;
- // TODO(caseq): this probably needs to handle duplicate header names
- // correctly by folding them.
- while (rh && rh->EnumerateHeaderLines(&iterator, &name, &value))
- headers->SetString(name, value);
-
- response->Set("headers", std::move(headers));
- return response;
-}
+static const char kScreencastEnabled[] = "screencastEnabled";
static std::string GetFrontendURL()
{
- return "devtools://devtools/bundled/devtools_app.html";
+ return "devtools://devtools/bundled/inspector.html";
}
-
-} // namespace
+} // namespace
namespace QtWebEngineCore {
-class DevToolsFrontendQt::NetworkResourceLoader
- : public network::SimpleURLLoaderStreamConsumer {
-public:
- NetworkResourceLoader(int stream_id,
- int request_id,
- DevToolsFrontendQt *bindings,
- std::unique_ptr<network::SimpleURLLoader> loader,
- network::mojom::URLLoaderFactory *url_loader_factory)
- : stream_id_(stream_id),
- request_id_(request_id),
- bindings_(bindings),
- loader_(std::move(loader))
- {
- loader_->SetOnResponseStartedCallback(base::BindOnce(
- &NetworkResourceLoader::OnResponseStarted, base::Unretained(this)));
- loader_->DownloadAsStream(url_loader_factory, this);
- }
-
-private:
- void OnResponseStarted(const GURL &final_url,
- const network::mojom::URLResponseHead &response_head)
- {
- response_headers_ = response_head.headers;
- }
-
- void OnDataReceived(base::StringPiece chunk, base::OnceClosure resume) override
- {
- base::Value chunkValue;
-
- bool encoded = !base::IsStringUTF8(chunk);
- if (encoded) {
- std::string encoded_string;
- base::Base64Encode(chunk, &encoded_string);
- chunkValue = base::Value(std::move(encoded_string));
- } else {
- chunkValue = base::Value(chunk);
- }
- base::Value id(stream_id_);
- base::Value encodedValue(encoded);
-
- bindings_->CallClientFunction("DevToolsAPI.streamWrite", &id, &chunkValue, &encodedValue);
- std::move(resume).Run();
- }
-
- void OnComplete(bool success) override
- {
- Q_UNUSED(success);
- auto response = BuildObjectForResponse(response_headers_.get());
- bindings_->SendMessageAck(request_id_, response.get());
- bindings_->m_loaders.erase(bindings_->m_loaders.find(this));
- }
-
- void OnRetry(base::OnceClosure start_retry) override { NOTREACHED(); }
-
- const int stream_id_;
- const int request_id_;
- DevToolsFrontendQt *const bindings_;
- std::unique_ptr<network::SimpleURLLoader> loader_;
- scoped_refptr<net::HttpResponseHeaders> response_headers_;
-
- DISALLOW_COPY_AND_ASSIGN(NetworkResourceLoader);
-};
-
-// This constant should be in sync with
-// the constant at devtools_ui_bindings.cc.
-const size_t kMaxMessageChunkSize = IPC::Channel::kMaximumMessageSize / 4;
-
// static
-DevToolsFrontendQt *DevToolsFrontendQt::Show(QSharedPointer<WebContentsAdapter> frontendAdapter, content::WebContents *inspectedContents)
+DevToolsFrontendQt *DevToolsFrontendQt::Show(QSharedPointer<WebContentsAdapter> frontendAdapter,
+ content::WebContents *inspectedContents)
{
DCHECK(frontendAdapter);
DCHECK(inspectedContents);
if (!frontendAdapter->isInitialized()) {
- scoped_refptr<content::SiteInstance> site =
- content::SiteInstance::CreateForURL(frontendAdapter->profile(), GURL(GetFrontendURL()));
+ scoped_refptr<content::SiteInstance> site = content::SiteInstance::CreateForURL(
+ frontendAdapter->profile(), GURL(GetFrontendURL()));
frontendAdapter->initialize(site.get());
}
@@ -200,13 +57,15 @@ DevToolsFrontendQt *DevToolsFrontendQt::Show(QSharedPointer<WebContentsAdapter>
return nullptr;
}
- DevToolsFrontendQt *devtoolsFrontend = new DevToolsFrontendQt(frontendAdapter, inspectedContents);
+ DevToolsFrontendQt *devtoolsFrontend =
+ new DevToolsFrontendQt(frontendAdapter, inspectedContents);
if (contents->GetURL() == GURL(GetFrontendURL())) {
- contents->GetController().Reload(content::ReloadType::ORIGINAL_REQUEST_URL, false);
- } else {
+ contents->GetController().LoadOriginalRequestURL();
+ } else {
content::NavigationController::LoadURLParams loadParams((GURL(GetFrontendURL())));
- loadParams.transition_type = ui::PageTransitionFromInt(ui::PAGE_TRANSITION_AUTO_TOPLEVEL | ui::PAGE_TRANSITION_FROM_API);
+ loadParams.transition_type = ui::PageTransitionFromInt(ui::PAGE_TRANSITION_AUTO_TOPLEVEL
+ | ui::PAGE_TRANSITION_FROM_API);
contents->GetController().LoadURLWithParams(loadParams);
}
@@ -216,33 +75,33 @@ DevToolsFrontendQt *DevToolsFrontendQt::Show(QSharedPointer<WebContentsAdapter>
DevToolsFrontendQt::DevToolsFrontendQt(QSharedPointer<WebContentsAdapter> webContentsAdapter,
content::WebContents *inspectedContents)
: content::WebContentsObserver(webContentsAdapter->webContents())
- , m_webContentsAdapter(webContentsAdapter)
+ , m_frontendAdapter(webContentsAdapter)
, m_inspectedContents(inspectedContents)
- , m_inspect_element_at_x(-1)
- , m_inspect_element_at_y(-1)
- , m_prefStore(nullptr)
- , m_weakFactory(this)
+ , m_outermostContents(inspectedContents->GetOutermostWebContents())
+ , m_bindings(new DevToolsUIBindings(webContentsAdapter->webContents()))
{
- // We use a separate prefstore than one in ProfileQt, because that one is in-memory only, and this
- // needs to be stored or it will show introduction text on every load.
- if (webContentsAdapter->profileAdapter()->isOffTheRecord())
- m_prefStore = scoped_refptr<PersistentPrefStore>(new InMemoryPrefStore());
- else
- CreateJsonPreferences(false);
-
- m_frontendDelegate = static_cast<WebContentsDelegateQt *>(webContentsAdapter->webContents()->GetDelegate());
-}
+ // bindings take ownership over devtools
+ m_bindings->SetDelegate(this);
+ m_bindings->AttachTo(content::DevToolsAgentHost::GetOrCreateFor(m_inspectedContents));
+ auto *prefService = m_bindings->profile()->GetPrefs();
+ const auto &devtoolsPrefs = prefService->GetDict(prefs::kDevToolsPreferences);
+
+ if (!devtoolsPrefs.Find(kScreencastEnabled)) {
+ ScopedDictPrefUpdate update(prefService, prefs::kDevToolsPreferences);
+ update->Set(kScreencastEnabled, "false");
+ }
+}
DevToolsFrontendQt::~DevToolsFrontendQt()
{
- if (QSharedPointer<WebContentsAdapter> p = m_webContentsAdapter)
+ if (QSharedPointer<WebContentsAdapter> p = m_frontendAdapter)
p->setInspector(false);
}
void DevToolsFrontendQt::Activate()
{
- m_frontendDelegate->ActivateContents(web_contents());
+ web_contents()->GetDelegate()->ActivateContents(web_contents());
}
void DevToolsFrontendQt::Focus()
@@ -252,12 +111,11 @@ void DevToolsFrontendQt::Focus()
void DevToolsFrontendQt::InspectElementAt(int x, int y)
{
- if (m_agentHost)
- m_agentHost->InspectElement(m_inspectedContents->GetFocusedFrame(), x, y);
- else {
- m_inspect_element_at_x = x;
- m_inspect_element_at_y = y;
- }
+ if (!m_inspectedContents)
+ return;
+ scoped_refptr<content::DevToolsAgentHost> agent(
+ content::DevToolsAgentHost::GetOrCreateFor(m_inspectedContents));
+ agent->InspectElement(m_inspectedContents->GetFocusedFrame(), x, y);
}
void DevToolsFrontendQt::Close()
@@ -268,304 +126,96 @@ void DevToolsFrontendQt::Close()
void DevToolsFrontendQt::DisconnectFromTarget()
{
- if (!m_agentHost)
- return;
- m_agentHost->DetachClient(this);
- m_agentHost = nullptr;
+ m_bindings->Detach();
}
-void DevToolsFrontendQt::ReadyToCommitNavigation(content::NavigationHandle *navigationHandle)
+WebContentsDelegateQt *DevToolsFrontendQt::frontendDelegate() const
{
- // ShellDevToolsFrontend does this in RenderViewCreated,
- // but that doesn't work for us for some reason.
- content::RenderFrameHost *frame = navigationHandle->GetRenderFrameHost();
- if (navigationHandle->IsInMainFrame()) {
- // If the frontend for some reason goes to some place other than devtools, stop the bindings
- if (navigationHandle->GetURL() != GetFrontendURL())
- m_frontendHost.reset(nullptr);
- else
- m_frontendHost = content::DevToolsFrontendHost::Create(
- frame,
- base::Bind(&DevToolsFrontendQt::HandleMessageFromDevToolsFrontend,
- base::Unretained(this)));
- }
+ return static_cast<WebContentsDelegateQt *>(web_contents()->GetDelegate());
}
-void DevToolsFrontendQt::DocumentAvailableInMainFrame()
+void DevToolsFrontendQt::ColorPickedInEyeDropper(int r, int g, int b, int a)
{
- if (!m_inspectedContents)
- return;
- // Don't call AttachClient multiple times for the same DevToolsAgentHost.
- // Otherwise it will call AgentHostClosed which closes the DevTools window.
- // This may happen in cases where the DevTools content fails to load.
- scoped_refptr<content::DevToolsAgentHost> agent_host =
- content::DevToolsAgentHost::GetOrCreateFor(m_inspectedContents);
- if (agent_host != m_agentHost) {
- if (m_agentHost)
- m_agentHost->DetachClient(this);
- m_agentHost = agent_host;
- m_agentHost->AttachClient(this);
- if (m_inspect_element_at_x != -1) {
- m_agentHost->InspectElement(m_inspectedContents->GetFocusedFrame(), m_inspect_element_at_x, m_inspect_element_at_y);
- m_inspect_element_at_x = -1;
- m_inspect_element_at_y = -1;
- }
- }
+ base::Value::Dict color;
+ color.Set("r", r);
+ color.Set("g", g);
+ color.Set("b", b);
+ color.Set("a", a);
+ m_bindings->CallClientMethod("DevToolsAPI", "eyeDropperPickedColor", base::Value(std::move(color)));
}
+// content::WebContentsObserver implementation
void DevToolsFrontendQt::WebContentsDestroyed()
{
- if (m_inspectedContents)
- static_cast<WebContentsDelegateQt *>(m_inspectedContents->GetDelegate())->webContentsAdapter()->devToolsFrontendDestroyed(this);
+ // If m_inspectedContents was a guest view it was probably already destroyed,
+ // but its embedder still lives.
+ WebContentsAdapter *inspectedAdapter =
+ static_cast<WebContentsDelegateQt *>(m_outermostContents->GetDelegate())
+ ->webContentsAdapter();
+ if (inspectedAdapter)
+ inspectedAdapter->devToolsFrontendDestroyed(this);
- if (m_agentHost) {
- m_agentHost->DetachClient(this);
- m_agentHost = nullptr;
- }
- delete this;
+ delete m_bindings; // it will call ~DevToolsFrontendQt()
}
-void DevToolsFrontendQt::SetPreference(const std::string &name, const std::string &value)
+// DevToolsUIBindings::Delegate implementation
+void DevToolsFrontendQt::ActivateWindow()
{
- DCHECK(m_prefStore);
- m_prefStore->SetValue(name, base::WrapUnique(new base::Value(value)), 0);
+ web_contents()->Focus();
}
-void DevToolsFrontendQt::RemovePreference(const std::string &name)
+void DevToolsFrontendQt::OnLoadCompleted()
{
- DCHECK(m_prefStore);
- m_prefStore->RemoveValue(name, 0);
+ m_bindings->CallClientMethod("DevToolsAPI", "setUseSoftMenu", base::Value(true));
}
-void DevToolsFrontendQt::ClearPreferences()
+void DevToolsFrontendQt::OpenInNewTab(const std::string &url)
{
- if (web_contents()->GetBrowserContext()->IsOffTheRecord())
- m_prefStore = scoped_refptr<PersistentPrefStore>(new InMemoryPrefStore());
- else
- CreateJsonPreferences(true);
-}
+ content::OpenURLParams params(GURL(url), content::Referrer(),
+ WindowOpenDisposition::NEW_FOREGROUND_TAB,
+ ui::PAGE_TRANSITION_LINK, false);
-void DevToolsFrontendQt::CreateJsonPreferences(bool clear)
-{
- content::BrowserContext *browserContext = web_contents()->GetBrowserContext();
- DCHECK(!browserContext->IsOffTheRecord());
- JsonPrefStore *jsonPrefStore = new JsonPrefStore(
- browserContext->GetPath().Append(FILE_PATH_LITERAL("devtoolsprefs.json")));
- // We effectively clear the preferences by not calling ReadPrefs
- if (!clear)
- jsonPrefStore->ReadPrefs();
-
- m_prefStore = scoped_refptr<PersistentPrefStore>(jsonPrefStore);
+ m_inspectedContents->OpenURL(params);
}
-void DevToolsFrontendQt::HandleMessageFromDevToolsFrontend(const std::string &message)
+void DevToolsFrontendQt::SetEyeDropperActive(bool active)
{
- if (!m_agentHost)
- return;
- std::string method;
- base::ListValue *params = nullptr;
- base::DictionaryValue *dict = nullptr;
- std::unique_ptr<base::Value> parsed_message = base::JSONReader::ReadDeprecated(message);
- if (!parsed_message || !parsed_message->GetAsDictionary(&dict) || !dict->GetString("method", &method))
- return;
- int request_id = 0;
- dict->GetInteger("id", &request_id);
- dict->GetList("params", &params);
-
- if (method == "dispatchProtocolMessage" && params && params->GetSize() == 1) {
- std::string protocol_message;
- if (!params->GetString(0, &protocol_message))
- return;
- m_agentHost->DispatchProtocolMessage(this, protocol_message);
- } else if (method == "loadCompleted") {
- web_contents()->GetMainFrame()->ExecuteJavaScript(base::ASCIIToUTF16("DevToolsAPI.setUseSoftMenu(true);"),
- base::NullCallback());
- } else if (method == "loadNetworkResource" && params->GetSize() == 3) {
- // TODO(pfeldman): handle some of the embedder messages in content.
- std::string url;
- std::string headers;
- int stream_id;
- if (!params->GetString(0, &url) || !params->GetString(1, &headers) || !params->GetInteger(2, &stream_id))
- return;
-
- GURL gurl(url);
- if (!gurl.is_valid()) {
- base::DictionaryValue response;
- response.SetInteger("statusCode", 404);
- SendMessageAck(request_id, &response);
- return;
- }
-
- net::NetworkTrafficAnnotationTag traffic_annotation =
- net::DefineNetworkTrafficAnnotation(
- "devtools_handle_front_end_messages", R"(
- semantics {
- sender: "Developer Tools"
- description:
- "When user opens Developer Tools, the browser may fetch "
- "additional resources from the network to enrich the debugging "
- "experience (e.g. source map resources)."
- trigger: "User opens Developer Tools to debug a web page."
- data: "Any resources requested by Developer Tools."
- destination: OTHER
- }
- policy {
- cookies_allowed: YES
- cookies_store: "user"
- setting:
- "It's not possible to disable this feature from settings."
- chrome_policy {
- DeveloperToolsAvailability {
- policy_options {mode: MANDATORY}
- DeveloperToolsAvailability: 2
- }
- }
- })");
- auto resource_request = std::make_unique<network::ResourceRequest>();
- resource_request->url = gurl;
- // TODO(caseq): this preserves behavior of URLFetcher-based implementation.
- // We really need to pass proper first party origin from the front-end.
- resource_request->site_for_cookies = gurl;
- resource_request->headers.AddHeadersFromString(headers);
-
- std::unique_ptr<network::mojom::URLLoaderFactory> file_url_loader_factory;
- scoped_refptr<network::SharedURLLoaderFactory> network_url_loader_factory;
- network::mojom::URLLoaderFactory *url_loader_factory;
- if (gurl.SchemeIsFile()) {
- file_url_loader_factory = content::CreateFileURLLoaderFactory(base::FilePath(), nullptr);
- url_loader_factory = file_url_loader_factory.get();
- } else if (content::HasWebUIScheme(gurl)) {
- base::DictionaryValue response;
- response.SetInteger("statusCode", 403);
- SendMessageAck(request_id, &response);
- return;
- } else {
- auto *partition = content::BrowserContext::GetStoragePartitionForSite(
- web_contents()->GetBrowserContext(), gurl);
- network_url_loader_factory = partition->GetURLLoaderFactoryForBrowserProcess();
- url_loader_factory = network_url_loader_factory.get();
- }
- auto simple_url_loader = network::SimpleURLLoader::Create(
- std::move(resource_request), traffic_annotation);
- auto resource_loader = std::make_unique<NetworkResourceLoader>(
- stream_id, request_id, this, std::move(simple_url_loader),
- url_loader_factory);
- m_loaders.insert(std::move(resource_loader));
- return;
- } else if (method == "getPreferences") {
- m_preferences = std::move(*m_prefStore->GetValues());
- SendMessageAck(request_id, &m_preferences);
+ if (!m_inspectedContents)
return;
- } else if (method == "setPreference") {
- std::string name;
- std::string value;
- if (!params->GetString(0, &name) || !params->GetString(1, &value))
- return;
- SetPreference(name, value);
- } else if (method == "removePreference") {
- std::string name;
- if (!params->GetString(0, &name))
- return;
- RemovePreference(name);
- } else if (method == "clearPreferences") {
- ClearPreferences();
- } else if (method == "requestFileSystems") {
- web_contents()->GetMainFrame()->ExecuteJavaScript(base::ASCIIToUTF16("DevToolsAPI.fileSystemsLoaded([]);"),
- base::NullCallback());
- } else if (method == "reattach") {
- m_agentHost->DetachClient(this);
- m_agentHost->AttachClient(this);
- } else if (method == "openInNewTab") {
- std::string urlString;
- if (!params->GetString(0, &urlString))
- return;
- GURL url(urlString);
- if (!url.is_valid())
- return;
- content::OpenURLParams openParams(GURL(url),
- content::Referrer(),
- WindowOpenDisposition::NEW_FOREGROUND_TAB,
- ui::PAGE_TRANSITION_LINK,
- false);
- // OpenURL will (via WebContentsDelegateQt::OpenURLFromTab) call
- // application code, which may decide to close this devtools view (see
- // quicknanobrowser for example).
- //
- // Chromium always calls SendMessageAck through a callback bound to a
- // WeakPtr, we do the same here, except without the callback.
- base::WeakPtr<DevToolsFrontendQt> weakThis = m_weakFactory.GetWeakPtr();
- web_contents()->OpenURL(openParams);
- if (!weakThis)
- return;
- } else if (method == "bringToFront") {
- Activate();
+ if (active) {
+ m_eyeDropper.reset(new DevToolsEyeDropper(
+ m_inspectedContents,
+ base::BindRepeating(&DevToolsFrontendQt::ColorPickedInEyeDropper,
+ base::Unretained(this))));
} else {
- VLOG(1) << "Unimplemented devtools method: " << message;
- return;
+ m_eyeDropper.reset();
}
-
- if (request_id)
- SendMessageAck(request_id, nullptr);
}
-void DevToolsFrontendQt::DispatchProtocolMessage(content::DevToolsAgentHost *agentHost, const std::string &message)
+// static
+bool DevToolsFrontendQt::IsValidFrontendURL(const GURL &url)
{
- Q_UNUSED(agentHost);
- if (message.length() < kMaxMessageChunkSize) {
- std::string param;
- base::EscapeJSONString(message, true, &param);
- std::string code = "DevToolsAPI.dispatchMessage(" + param + ");";
- base::string16 javascript = base::UTF8ToUTF16(code);
- web_contents()->GetMainFrame()->ExecuteJavaScript(javascript, base::NullCallback());
- return;
- }
-
- size_t total_size = message.length();
- for (size_t pos = 0; pos < message.length(); pos += kMaxMessageChunkSize) {
- std::string param;
- base::EscapeJSONString(message.substr(pos, kMaxMessageChunkSize), true, &param);
- std::string code = "DevToolsAPI.dispatchMessageChunk(" + param + ","
- + std::to_string(pos ? 0 : total_size) + ");";
- base::string16 javascript = base::UTF8ToUTF16(code);
- web_contents()->GetMainFrame()->ExecuteJavaScript(javascript, base::NullCallback());
- }
+ // NOTE: the inspector app does not change the frontend url.
+ // If we bring back the devtools_app, the url must be sanitized
+ // according to chrome/browser/devtools/devtools_ui_bindings.cc.
+ return url.spec() == GetFrontendURL();
}
-void DevToolsFrontendQt::CallClientFunction(const std::string &function_name,
- const base::Value *arg1,
- const base::Value *arg2,
- const base::Value *arg3)
+void DevToolsFrontendQt::InspectedContentsClosing()
{
- std::string javascript = function_name + "(";
- if (arg1) {
- std::string json;
- base::JSONWriter::Write(*arg1, &json);
- javascript.append(json);
- if (arg2) {
- base::JSONWriter::Write(*arg2, &json);
- javascript.append(", ").append(json);
- if (arg3) {
- base::JSONWriter::Write(*arg3, &json);
- javascript.append(", ").append(json);
- }
- }
- }
- javascript.append(");");
- web_contents()->GetMainFrame()->ExecuteJavaScript(base::UTF8ToUTF16(javascript), base::NullCallback());
+ // Called for already destroyed guest views
+ m_inspectedContents = nullptr;
+ web_contents()->ClosePage();
}
-void DevToolsFrontendQt::SendMessageAck(int request_id, const base::Value *arg)
+std::string DevToolsFrontendQt::GetId(content::WebContents *inspectedContents)
{
- base::Value id_value(request_id);
- CallClientFunction("DevToolsAPI.embedderMessageAck", &id_value, arg, nullptr);
+ return content::DevToolsAgentHost::GetOrCreateFor(inspectedContents)->GetId();
}
-void DevToolsFrontendQt::AgentHostClosed(content::DevToolsAgentHost *agentHost)
+void DevToolsFrontendQt::CloseWindow()
{
- DCHECK(agentHost == m_agentHost.get());
- m_agentHost = nullptr;
- m_inspectedContents = nullptr;
- Close();
+ web_contents()->Close();
}
} // namespace QtWebEngineCore
diff --git a/src/core/devtools_frontend_qt.h b/src/core/devtools_frontend_qt.h
index fed2d47fc..b867d4af1 100644
--- a/src/core/devtools_frontend_qt.h
+++ b/src/core/devtools_frontend_qt.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef DEVTOOLS_FRONTEND_QT_H
#define DEVTOOLS_FRONTEND_QT_H
@@ -45,34 +9,26 @@
#include "web_contents_delegate_qt.h"
-#include "base/compiler_specific.h"
#include "base/containers/unique_ptr_adapters.h"
-#include "base/macros.h"
-#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
-#include "base/values.h"
-#include "content/public/browser/devtools_agent_host.h"
-#include "content/public/browser/devtools_frontend_host.h"
+#include "chrome/browser/devtools/devtools_ui_bindings.h"
#include "content/public/browser/web_contents_observer.h"
-namespace base {
-class Value;
-}
+class DevToolsEyeDropper;
namespace content {
-class NavigationHandle;
-class RenderViewHost;
+class DevToolsAgentHost;
class WebContents;
-} // namespace content
-
-class PersistentPrefStore;
+} // namespace content
namespace QtWebEngineCore {
+class WebContentsAdapter;
-class DevToolsFrontendQt : public content::WebContentsObserver
- , public content::DevToolsAgentHostClient {
+class DevToolsFrontendQt : public DevToolsUIBindings::Delegate, public content::WebContentsObserver
+{
public:
- static DevToolsFrontendQt *Show(QSharedPointer<WebContentsAdapter> frontendAdapter, content::WebContents *inspectedContents);
+ static DevToolsFrontendQt *Show(QSharedPointer<WebContentsAdapter> frontendAdapter,
+ content::WebContents *inspectedContents);
void Activate();
void Focus();
@@ -81,58 +37,50 @@ public:
void DisconnectFromTarget();
- void CallClientFunction(const std::string& function_name,
- const base::Value* arg1,
- const base::Value* arg2,
- const base::Value* arg3);
+ WebContentsDelegateQt *frontendDelegate() const;
- WebContentsDelegateQt *frontendDelegate() const
- {
- return m_frontendDelegate;
- }
+ static bool IsValidFrontendURL(const GURL &url);
+ static std::string GetId(content::WebContents *inspectedContents);
protected:
- DevToolsFrontendQt(QSharedPointer<WebContentsAdapter> webContentsAdapter, content::WebContents *inspectedContents);
+ DevToolsFrontendQt(QSharedPointer<WebContentsAdapter> webContentsAdapter,
+ content::WebContents *inspectedContents);
~DevToolsFrontendQt() override;
- // content::DevToolsAgentHostClient implementation.
- void AgentHostClosed(content::DevToolsAgentHost* agent_host) override;
- void DispatchProtocolMessage(content::DevToolsAgentHost* agent_host, const std::string& message) override;
-
- void SetPreferences(const std::string& json);
- virtual void HandleMessageFromDevToolsFrontend(const std::string& message);
-
private:
- // WebContentsObserver overrides
- void ReadyToCommitNavigation(content::NavigationHandle* navigation_handle) override;
- void DocumentAvailableInMainFrame() override;
+ void ColorPickedInEyeDropper(int r, int g, int b, int a);
+
+ // content::WebContentsObserver overrides
void WebContentsDestroyed() override;
- void SendMessageAck(int request_id, const base::Value* arg1);
- void SetPreference(const std::string &name, const std::string &value);
- void RemovePreference(const std::string &name);
- void ClearPreferences();
- void CreateJsonPreferences(bool clear);
+ // DevToolsUIBindings::Delegate overrides
+ void ActivateWindow() override;
+ void SetEyeDropperActive(bool active) override;
+ void OpenInNewTab(const std::string &url) override;
+ void InspectedContentsClosing() override;
+ void OnLoadCompleted() override;
+
+ void InspectElementCompleted() override{};
+ void CloseWindow() override;
+ void Inspect(scoped_refptr<content::DevToolsAgentHost>) override{};
+ void SetInspectedPageBounds(const gfx::Rect &) override{};
+ void SetIsDocked(bool) override{};
+ void SetWhitelistedShortcuts(const std::string &) override{};
+ void OpenNodeFrontend() override{};
+ void ReadyForTest() override{};
+ void ConnectionReady() override{};
+ void SetOpenNewWindowForPopups(bool) override{};
+ void RenderProcessGone(bool) override{};
+ void ShowCertificateViewer(const std::string &) override{};
// We shouldn't be keeping it alive
- QWeakPointer<WebContentsAdapter> m_webContentsAdapter;
- WebContentsDelegateQt *m_frontendDelegate;
+ QWeakPointer<WebContentsAdapter> m_frontendAdapter;
content::WebContents *m_inspectedContents;
- scoped_refptr<content::DevToolsAgentHost> m_agentHost;
- int m_inspect_element_at_x;
- int m_inspect_element_at_y;
- std::unique_ptr<content::DevToolsFrontendHost> m_frontendHost;
-
- class NetworkResourceLoader;
- std::set<std::unique_ptr<NetworkResourceLoader>, base::UniquePtrComparator> m_loaders;
-
- base::DictionaryValue m_preferences;
- scoped_refptr<PersistentPrefStore> m_prefStore;
- base::WeakPtrFactory<DevToolsFrontendQt> m_weakFactory;
-
- DISALLOW_COPY_AND_ASSIGN(DevToolsFrontendQt);
+ content::WebContents *m_outermostContents;
+ std::unique_ptr<DevToolsEyeDropper> m_eyeDropper;
+ DevToolsUIBindings *m_bindings;
};
} // namespace QtWebEngineCore
-#endif // DEVTOOLS_FRONTEND_QT_H
+#endif // DEVTOOLS_FRONTEND_QT_H
diff --git a/src/core/devtools_manager_delegate_qt.cpp b/src/core/devtools_manager_delegate_qt.cpp
index ecd2a7d40..6654ead0e 100644
--- a/src/core/devtools_manager_delegate_qt.cpp
+++ b/src/core/devtools_manager_delegate_qt.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// based on content/shell/browser/shell_devtools_manager_delegate.cc:
// Copyright 2013 The Chromium Authors. All rights reserved.
@@ -43,31 +7,19 @@
// found in the LICENSE.Chromium file.
#include "devtools_manager_delegate_qt.h"
+#include "qtwebengine/grit/qt_webengine_resources.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
-#include "base/memory/ptr_util.h"
-#include "base/strings/string_number_conversions.h"
-#include "base/strings/utf_string_conversions.h"
#include "content/browser/devtools/devtools_http_handler.h"
#include "content/public/browser/devtools_agent_host.h"
-#include "content/public/browser/devtools_frontend_host.h"
#include "content/public/browser/devtools_socket_factory.h"
-#include "content/public/browser/favicon_status.h"
-#include "content/public/browser/navigation_entry.h"
-#include "content/public/browser/render_view_host.h"
-#include "content/public/browser/web_contents.h"
-#include "content/public/browser/web_contents_delegate.h"
#include "content/public/common/content_switches.h"
#include "net/base/ip_endpoint.h"
#include "net/base/net_errors.h"
#include "net/socket/tcp_server_socket.h"
#include "ui/base/resource/resource_bundle.h"
-#include "qtwebengine/grit/qt_webengine_resources.h"
-
-#include "type_conversion.h"
-
using content::DevToolsAgentHost;
namespace {
@@ -93,7 +45,6 @@ private:
const std::string m_address;
int m_port;
int m_backlog;
- DISALLOW_COPY_AND_ASSIGN(TCPServerSocketFactory);
};
} // namespace
@@ -114,7 +65,7 @@ DevToolsServerQt::~DevToolsServerQt()
void DevToolsServerQt::parseAddressAndPort()
{
- const QString inspectorEnv = QString::fromUtf8(qgetenv("QTWEBENGINE_REMOTE_DEBUGGING"));
+ const QString inspectorEnv = qEnvironmentVariable("QTWEBENGINE_REMOTE_DEBUGGING");
const base::CommandLine &commandLine = *base::CommandLine::ForCurrentProcess();
QString portStr;
@@ -181,7 +132,7 @@ void DevToolsManagerDelegateQt::Initialized(const net::IPEndPoint *ip_address)
std::string DevToolsManagerDelegateQt::GetDiscoveryPageHTML()
{
- return ui::ResourceBundle::GetSharedInstance().GetRawDataResource(IDR_DEVTOOLS_DISCOVERY_PAGE_HTML).as_string();
+ return ui::ResourceBundle::GetSharedInstance().LoadDataResourceString(IDR_DEVTOOLS_DISCOVERY_PAGE_HTML);
}
bool DevToolsManagerDelegateQt::HasBundledFrontendResources()
@@ -189,4 +140,4 @@ bool DevToolsManagerDelegateQt::HasBundledFrontendResources()
return true;
}
-} //namespace QtWebEngineCore
+} // namespace QtWebEngineCore
diff --git a/src/core/devtools_manager_delegate_qt.h b/src/core/devtools_manager_delegate_qt.h
index 3a519a03f..6e02b04a4 100644
--- a/src/core/devtools_manager_delegate_qt.h
+++ b/src/core/devtools_manager_delegate_qt.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef DEV_TOOLS_HTTP_HANDLER_DELEGATE_QT_H
#define DEV_TOOLS_HTTP_HANDLER_DELEGATE_QT_H
diff --git a/src/core/doc/QtWebEngineDoc b/src/core/doc/QtWebEngineDoc
new file mode 100644
index 000000000..7ab3164fd
--- /dev/null
+++ b/src/core/doc/QtWebEngineDoc
@@ -0,0 +1,3 @@
+#include <QtWebEngineCore/QtWebEngineCore>
+#include <QtWebEngineQuick/QtWebEngineQuick>
+#include <QtWebEngineWidgets/QtWebEngineWidgets>
diff --git a/tools/about_credits.tmpl b/src/core/doc/about_credits.tmpl
index 57fae9e78..57fae9e78 100644
--- a/tools/about_credits.tmpl
+++ b/src/core/doc/about_credits.tmpl
diff --git a/src/core/doc/about_credits_entry.tmpl b/src/core/doc/about_credits_entry.tmpl
new file mode 100644
index 000000000..aa94f2945
--- /dev/null
+++ b/src/core/doc/about_credits_entry.tmpl
@@ -0,0 +1,13 @@
+/*!
+\page qtwebengine-3rdparty-{{name-sanitized}}.html
+\attribution
+\ingroup qtwebengine-licensing
+\brief {{license-type}}
+\title {{name}}
+
+\l{{{url}}}{Project Homepage}
+
+\badcode
+{{license}}
+\endcode
+*/
diff --git a/src/core/doc/qtwebengine.qdocconf b/src/core/doc/qtwebengine.qdocconf
new file mode 100644
index 000000000..6b78f13f8
--- /dev/null
+++ b/src/core/doc/qtwebengine.qdocconf
@@ -0,0 +1,96 @@
+include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
+include($QT_INSTALL_DOCS/config/exampleurl-qtwebengine.qdocconf)
+
+project = QtWebEngine
+description = Qt WebEngine Reference Documentation
+version = $QT_VERSION
+
+qhp.projects = QtWebEngine
+
+qhp.QtWebEngine.file = qtwebengine.qhp
+qhp.QtWebEngine.namespace = org.qt-project.qtwebengine.$QT_VERSION_TAG
+qhp.QtWebEngine.virtualFolder = qtwebengine
+qhp.QtWebEngine.indexTitle = Qt WebEngine
+qhp.QtWebEngine.indexRoot =
+
+qhp.QtWebEngine.subprojects = classes qmltypes examples
+
+qhp.QtWebEngine.subprojects.classes.title = C++ Classes and Namespaces
+qhp.QtWebEngine.subprojects.classes.indexTitle = Qt WebEngine C++ Classes and Namespaces
+qhp.QtWebEngine.subprojects.classes.selectors = class group:qtwebengine-namespaces doc:headerfile
+qhp.QtWebEngine.subprojects.classes.sortPages = true
+
+qhp.QtWebEngine.subprojects.qmltypes.title = QML Types
+qhp.QtWebEngine.subprojects.qmltypes.indexTitle = Qt WebEngine QML Types
+qhp.QtWebEngine.subprojects.qmltypes.selectors = qmltype
+qhp.QtWebEngine.subprojects.qmltypes.sortPages = true
+
+qhp.QtWebEngine.subprojects.examples.title = Examples
+qhp.QtWebEngine.subprojects.examples.indexTitle = Qt WebEngine Examples
+qhp.QtWebEngine.subprojects.examples.selectors = doc:example
+qhp.QtWebEngine.subprojects.examples.sortPages = true
+
+manifestmeta.highlighted.names += "QtWebEngine/WebEngine Widgets Simple Browser Example" \
+ "QtWebEngine/WebEngine Quick Nano Browser" \
+ "QtWebEngine/Recipe Browser"
+
+tagfile = ../../../doc/qtwebengine/qtwebengine.tags
+
+# Custom module header for clang that pulls in also QtWebEngineWidgets
+moduleheader = QtWebEngineDoc
+
+# Additional include paths for clang
+includepaths += -I .
+
+depends += qtcore \
+ qtcore5compat \
+ qtdesigner \
+ qtgui \
+ qtnetwork \
+ qtprintsupport \
+ qtpositioning \
+ qtqml \
+ qtqmlmodels \
+ qtquick \
+ qtquickcontrols \
+ qtdoc \
+ qtcmake \
+ qtwebchannel \
+ qtwebview \
+ qtwidgets
+
+headerdirs += ../../core/api \
+ ../../webenginequick/api \
+ ../../webenginewidgets/api
+
+sourcedirs += ../../core/api \
+ ../../core/doc \
+ ../../webenginequick/api \
+ ../../webenginequick/doc \
+ ../../webenginewidgets/api \
+ ../../webenginewidgets/doc
+
+exampledirs += ../../../examples \
+ ../../core/doc/snippets \
+ ../../webenginequick/doc/snippets \
+ ../../webenginewidgets/doc/snippets
+
+#exclude Qt PDF example directories
+excludedirs += ../../../examples/pdfwidgets \
+ ../../../examples/pdf
+
+examples.fileextensions += *.aff *.dic *.html
+
+imagedirs += \
+ images \
+ ../../webenginequick/doc/images
+
+navigation.landingpage = "Qt WebEngine"
+navigation.cppclassespage = "Qt WebEngine C++ Classes and Namespaces"
+navigation.qmltypespage = "Qt WebEngine QML Types"
+
+# \QWE macro expands to 'Qt WebEngine' without auto-linking anywhere.
+macro.QWE = "Qt \\WebEngine"
+
+# Enforce zero documentation warnings
+warninglimit = 0
diff --git a/src/core/doc/snippets/qtwebengine_qwebenginepage_snippet.cpp b/src/core/doc/snippets/qtwebengine_qwebenginepage_snippet.cpp
new file mode 100644
index 000000000..6b39eed03
--- /dev/null
+++ b/src/core/doc/snippets/qtwebengine_qwebenginepage_snippet.cpp
@@ -0,0 +1,14 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+void wrapInFunction()
+{
+
+//! [0]
+ m_view->page()->findText(QStringLiteral("Qt"), QWebEnginePage::FindFlags(), [this](const QWebEngineFindTextResult &result) {
+ if (result.numberOfMatches() == 0) QMessageBox::information(m_view, QString(), QStringLiteral("No occurrences found"));
+ });
+//! [0]
+
+}
+
diff --git a/src/core/doc/snippets/qtwebenginecore_build_snippet.qdoc b/src/core/doc/snippets/qtwebenginecore_build_snippet.qdoc
index 94e26c9c5..9a7370d62 100644
--- a/src/core/doc/snippets/qtwebenginecore_build_snippet.qdoc
+++ b/src/core/doc/snippets/qtwebenginecore_build_snippet.qdoc
@@ -1,35 +1,11 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
//! [0]
QT += webenginecore
//! [0]
-
-//! [1]
-#include <QtWebEngineCore>
-//! [1]
+//! [2]
+find_package(Qt6 REQUIRED COMPONENTS WebEngineCore)
+target_link_libraries(target PRIVATE Qt6::WebEngineCore)
+//! [2]
diff --git a/src/core/doc/src/external-resources.qdoc b/src/core/doc/src/external-resources.qdoc
new file mode 100644
index 000000000..775492c7e
--- /dev/null
+++ b/src/core/doc/src/external-resources.qdoc
@@ -0,0 +1,138 @@
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+ \externalpage http://www.chromium.org
+ \title Chromium Project
+*/
+
+/*!
+ \externalpage https://developers.google.com/web/tools/chrome-devtools
+ \title Chrome DevTools
+*/
+
+/*!
+ \externalpage https://developer.chrome.com/docs/devtools/console/
+ \title Chrome console API
+*/
+
+/*!
+ \externalpage http://ffmpeg.org/
+ \title FFmpeg
+*/
+
+/*!
+ \externalpage http://www.openh264.org/
+ \title OpenH264 Project Homepage
+*/
+
+/*!
+ \externalpage http://html5demos.com/drag
+ \title HTML5 Demos - Drag and Drop
+*/
+
+/*!
+ \externalpage http://html5demos.com/drag-anything
+ \title HTML5 Demos - Simple Drag and Drop
+*/
+
+/*!
+ \externalpage http://html5demos.com/dnd-upload
+ \title HTML5 Demos - Drag and Drop, Automatic Upload
+*/
+
+/*!
+ \externalpage http://html5demos.com/file-api
+ \title HTML5 Demos - File API
+*/
+
+/*!
+ \externalpage http://www.widevine.com
+ \title Widevine CDM
+*/
+
+/*!
+ \externalpage http://demo.castlabs.com/
+ \title castLabs
+*/
+
+/*!
+ \externalpage http://ssdemo04.swankmp.net/
+ \title Swank Motion Pictures, Inc.
+*/
+
+/*!
+ \externalpage https://bitmovin.com/demos/drm
+ \title Bitmovin Player
+*/
+
+/*!
+ \externalpage https://sourceforge.net/projects/hunspell/
+ \title Hunspell Project
+*/
+
+/*!
+ \externalpage https://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1
+ \title RFC 2616 section 19.5.1
+*/
+
+/*!
+ \externalpage https://www.iana.org/assignments/uri-schemes/prov/view-source
+ \title view-source URI scheme
+*/
+
+/*!
+ \externalpage https://wiki.greasespot.net/Metadata_Block
+ \title Greasemonkey
+*/
+
+/*!
+ \externalpage https://http2.github.io/
+ \title HTTP/2
+*/
+
+/*!
+ \externalpage https://http2.akamai.com/demo
+ \title Akamai HTTP/2 Demo
+*/
+
+/*!
+ \externalpage https://www.chromium.org/developers/design-documents/user-scripts
+ \title User Scripts
+*/
+
+/*!
+ \externalpage https://wiki.greasespot.net/Metadata_Block#.40name
+ \title Metadata Block
+*/
+
+/*!
+ \externalpage https://developer.mozilla.org/en-US/docs/Web/API/Navigator/registerProtocolHandler
+ \title registerProtocolHandler
+*/
+
+/*!
+ \externalpage https://www.w3.org/TR/notifications
+ \title Web Notifications API
+*/
+
+/*!
+ \externalpage https://developers.google.com/web/updates/2017/09/autoplay-policy-changes
+ \title Autoplay Policy Changes
+*/
+
+// Workarounds for broken links introduced by README.chromium license files
+/*!
+ \externalpage #
+ \title This is the canonical public repository
+*/
+
+/*!
+ \externalpage #
+ \title NA
+*/
+
+/*!
+ \externalpage https://source.chromium.org/chromium/chromium/src/+/master:v8/src/base/ieee754.cc
+ \title source.chromium.org/chromium/chromium/src/+/master:v8/src/base/ieee754.cc
+*/
diff --git a/src/core/doc/src/qt6-changes.qdoc b/src/core/doc/src/qt6-changes.qdoc
new file mode 100644
index 000000000..5061c77ab
--- /dev/null
+++ b/src/core/doc/src/qt6-changes.qdoc
@@ -0,0 +1,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.
+
+
+*/
diff --git a/src/core/doc/src/qt_webengine_add_convert_dictionary.qdoc b/src/core/doc/src/qt_webengine_add_convert_dictionary.qdoc
new file mode 100644
index 000000000..6af681cc5
--- /dev/null
+++ b/src/core/doc/src/qt_webengine_add_convert_dictionary.qdoc
@@ -0,0 +1,54 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+\page qt-add-webengine-dictionary.html
+\ingroup cmake-commands-qtwebenginecore
+
+\title qt_add_webengine_dictionary
+\keyword qt6_add_webengine_dictionary
+
+\brief Converts the hunspell dictionary format into \e bdict binary format.
+
+\cmakecommandsince 6.3
+
+\section1 Synopsis
+
+\badcode
+qt_add_webengine_dictionary(
+ [TARGET]
+ [SOURCE]
+ [OUTPUT_DIRECTORY]
+)
+
+\endcode
+
+\versionlessCMakeCommandsNote qt6_webengine_add_dictionary()
+
+\section1 Description
+
+ A spell checker in Qt Web Engine needs dictionaries in a specific binary format.
+ This CMake command converts dictionaries from the \l{Hunspell project}. into the \c bdict
+ binary format. It creates a \c qtwebengine_dictionaries target, which your project can
+ use as a dependency. This way your project can easily add dictionaries for the spell
+ checker. Refer to the \l{WebEngine Widgets Spellchecker Example}{spell checker example}
+ for more details.
+
+\section1 Arguments
+
+ \c TARGET is an optinal argument and specifies the name of the application target that should
+ depend on \c qtwebengine_dictionaries target. In other words it is used to define a build
+ dependency to create the binary format of dictionaries before building \c TARGET.
+
+ \c SOURCE is the absolute path to the \l{Hunspell project} dictionary for which
+ a corresponding binary format (\c.bdict) will be created.
+
+ \c OUTPUT_DIRECTORY is an optional argument and specifies the directory where the binary format
+ of the dictionary will be created. If not specified, \c CMAKE_CURRENT_BINARY_DIR will be used
+ as \c OUTPUT_DIRECTORY.
+
+ \note The \c qtwebengine_dictionaries directory or \c <CONFIG>/qtwebengine_dictionaries
+ directories in the case of the multi-config generator is appended to OUTPUT_DIRECTORY. This
+ helps to utilize dictionaries, as the \c webengine_dictionaries directory is the default
+ search location.
+*/
diff --git a/src/core/doc/src/qtwebengine-debugging.qdoc b/src/core/doc/src/qtwebengine-debugging.qdoc
new file mode 100644
index 000000000..3dd4d9276
--- /dev/null
+++ b/src/core/doc/src/qtwebengine-debugging.qdoc
@@ -0,0 +1,112 @@
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+ \page qtwebengine-debugging.html
+ \title Qt WebEngine Debugging and Profiling
+
+ \section1 Console Logging
+
+ JavaScript executed inside \QWE can use the
+ \l{Chrome console API} to log information to a console. The logging messages
+ are forwarded to Qt's logging facilities inside a \c js
+ \l{QLoggingCategory}{logging category}. However, only warning and fatal
+ messages are printed by default. To change this, you either have to set custom
+ rules for the \c js category, or provide custom message handlers
+ by reimplementing \l{QWebEnginePage::javaScriptConsoleMessage()}, or
+ connecting to \l{WebEngineView::javaScriptConsoleMessage()}.
+
+ All messages can also be accessed through the \QWE developer
+ tools.
+
+ \section1 Qt WebEngine Developer Tools
+
+ The \QWE module provides web developer tools that make it easy
+ to inspect and debug layout and performance issues of any web content.
+
+ The developer tools are accessed as a local web page using a Chromium or
+ \QWE based browser, such as the Chrome browser.
+
+ To activate the developer tools, start an application that uses \QWE
+ with the command-line argument \c {--remote-debugging-port=<portnumber>}.
+
+ \note Any WebEngine command line options should be specified after the
+ \c {--webEngineArgs} option, which is used to separate the user's application
+ specific options from the WebEngine's ones.
+
+ \badcode
+ --webEngineArgs --remote-debugging-port=<portnumber>
+ \endcode
+
+ Where \c <port_number> refers to a local network port. The web developer
+ tools can then be accessed by launching a browser at the address
+ \c http://localhost:<port_number>.
+
+ Alternatively, the environment variable QTWEBENGINE_REMOTE_DEBUGGING
+ can be set. It can be set as either just a port working similarly to
+ \c --remote-debugging-port or given both a host address and a port. The
+ latter can be used to control which network interface to export the
+ interface on, so that you can access the developer tools from a remote
+ device.
+
+ To avoid WebSocket errors during remote debugging, add an additional command-line
+ argument \c {--remote-allow-origins=<origin>[,<origin>, ...]}, where \c <origin> refers to the request origin.
+ Use \c {--remote-allow-origins=*} to allow connections from all origins. If nothing is specified,
+ \QWE will add \c {--remote-allow-origins=*} to command-line arguments when remote-debugging is enabled,
+ thereby allowing requests from all origins.
+
+ For a detailed explanation of the capabilities of developer tools, see the
+ \l {Chrome DevTools} page.
+
+ \section1 Using Command-Line Arguments
+
+ You can use the following command-line arguments while debugging to provide
+ input for bug reports:
+
+ \list
+ \li \c {--disable-gpu} disables GPU hardware acceleration. This is
+ useful when diagnosing OpenGL problems.
+ \li \c {--disable-logging} disables console logging, which might be
+ useful for debug builds.
+ \li \c {--enable-logging --log-level=0} enables console logging and sets
+ the logging level to 0, which means that messages of the severity
+ \c info and above are recorded in the log. This is the default for
+ debug builds. Other possible log levels are \c 1 for warnings, \c 2
+ for errors, and \c 3 for fatal errors.
+ \li \c {--v=1} Increases the logging level beyond what \c {--log-level}
+ can, and enables logging debug messages up to verbosity level \c 1.
+ A higher number further increases verbosity, but may result in a
+ large number of logged messages. Default is \c 0 (no debug messages).
+ \li \c {--no-sandbox} disables the sandbox for the renderer and plugin
+ processes. Keep in mind that disabling the sandbox might present a
+ security risk.
+ \li \c {--single-process} runs the renderer and plugins in the same
+ process as the browser. This is useful for getting stack traces for
+ renderer crashes.
+ \li \c {--enable-features=NetworkServiceInProcess} runs networking in
+ the main process. This may help firewall management, since only the
+ application executable will need to be whitelisted and
+ not QtWebEngineProcess. It means losing the security of
+ sandboxing of the network service though.
+ \endlist
+
+ Alternatively, the environment variable QTWEBENGINE_CHROMIUM_FLAGS can be
+ set. For example, the following value could be set to disable logging while
+ debugging an application called \e mybrowser:
+
+ \code
+ QTWEBENGINE_CHROMIUM_FLAGS="--disable-logging" mybrowser
+ \endcode
+
+ QTWEBENGINE_CHROMIUM_FLAGS can also be set using \c qputenv from within the
+ application if called before QtWebEngineQuick::initialize().
+
+ \section1 Dump WebEngineContext Information
+
+ For dumping the WebEngineContext information, you can set the \c QT_LOGGING_RULES
+ environment variable to \c "qt.webenginecontext.debug=true".
+
+ The output contains information about the graphical backend, and the way how \QWE
+ is initialized for the application. This is particularly useful for reproducing
+ issues.
+*/
diff --git a/src/core/doc/src/qtwebengine-deploying.qdoc b/src/core/doc/src/qtwebengine-deploying.qdoc
new file mode 100644
index 000000000..3d8a976c8
--- /dev/null
+++ b/src/core/doc/src/qtwebengine-deploying.qdoc
@@ -0,0 +1,199 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+ \page qtwebengine-deploying.html
+ \title Deploying Qt WebEngine Applications
+ \ingroup explanations-webtechnologies
+
+ The way to package and deploy applications varies between operating systems.
+ For Windows and \macos, \l{The Windows Deployment Tool}{windeployqt} and
+ \l{Deploying Applications on macOS}{macdeployqt} automate the steps to
+ generate a stand-alone application package.
+
+ When manually deploying applications that depend on \QWE, all the
+ files that are required to run the application have to be included:
+ libraries, QML imports, plugins, and translations.
+
+ For more information, see \l {Deploying Qt Applications}.
+
+ \section1 Target Platforms
+
+ \QWE does try to support all \l{Supported Platforms} of Qt. However,
+ due to different requirements of Chromium this is not always possible. Known
+ limitations are:
+
+ \list
+ \li \QWE currently supports only Windows, Linux, and \macos.
+
+ \li On Windows, \QWE only supports Windows Vista or newer as
+ target platform. Due to use of newer API in Chromium, Windows XP is
+ not supported. WinRT is not supported, either.
+ \endlist
+
+ \section1 Deploying Applications Manually
+
+ When manually deploying applications that depend on \QWE, the
+ following files might have to be deployed:
+
+ \list
+ \li Libraries
+ \li QML imports
+ \li \QWE process
+ \li Resources
+ \li Translations
+ \li Audio and video codecs
+ \endlist
+
+ \section2 Deploying Libraries
+
+ The following libraries must be deployed with applications that depend on
+ \QWE:
+
+ \list
+ \li QtWebEngineCore library
+ \li QtWebEngineWidgets or QtWebEngine libraries, depending on
+ application type
+ \endlist
+
+ \section2 Deploying QML Imports
+
+ If Qt Quick integration is used in the application, the QtWebEngine import
+ directory needs to be deployed.
+
+ \section2 Deploying \QWE Processes
+
+ \QWE takes advantage of the multi-process model that the Chromium
+ project offers. The multi-process model requires that the \QWE
+ Process executable be deployed alongside your application.
+
+ The WebEngine process is executed for each QWebEngineView or WebEngineView
+ instance. For example, a browser application
+ with two tabs open should have two separate instances of the process
+ running. This is a common approach used by most modern web engines to
+ provide a stable browsing experience.
+
+ At runtime, \QWE looks for the \c QtWebEngineProcess executable in
+ the directory that
+ QLibraryInfo::location(QLibraryInfo::LibraryExecutablesPath) returns.
+ For Qt installations, this is \c QTDIR/libexec (Linux) or \c QTDIR\bin
+ (Windows). The path can be changed by defining a \c qt.conf file, for
+ example. Alternatively, an executable path can be set as a value of the
+ \c QTWEBENGINEPROCESS_PATH environment variable. On \macos, \QWE
+ looks for the executable in \c .app/Helpers/QtWebEngineProcess.
+
+ \section2 Deploying Resources
+
+ \QWE requires the following resource files:
+
+ \list
+ \li \c qtwebengine_resources.pak contains the resources needed by
+ Chromium.
+ \li \c qtwebengine_devtools_resources.pak contains tools for remote
+ debugging.
+ \li \c qtwebengine_resources_100p.pak contains images suitable for low
+ resolution displays.
+ \li \c qtwebengine_resources_200p.pak contains images suitable for high
+ DPI displays.
+ \li \c icudtl.dat provides support for International Components for
+ Unicode (ICU). It is the Chromium version of ICU, which is not
+ needed if \QWE was configured to use the system ICU.
+ \li \c v8_context_snapshot.bin contains a previously prepared snapshot
+ of a v8 context used to speed up initialization. Debug builds use
+ separate snapshots with the file name extension \c .debug.bin instead
+ of \c .bin. On \macos, there is a snapshot for each architecture named
+ accordingly, for example \c v8_context_snapshot.arm64.bin or
+ \c v8_context_snapshot.arm64.debug.bin.
+ \endlist
+
+ Resources are searched from the following locations:
+
+ \list
+ \li On Linux and Windows: the \c resources directory in the directory
+ specified by QLibraryInfo::location(QLibraryInfo::DataPath)
+ \li On \macos: \c .app/Content/Resources
+ \li The application directory specified by QCoreApplication::applicationDirPath()
+ \endlist
+
+ Alternatively, a resources directory path can be set as a value of the
+ \c QTWEBENGINE_RESOURCES_PATH environment variable.
+
+ \section2 Translations
+
+ Locale data (such as \c en-US.pak) is searched form the following locations:
+
+ \list
+ \li On \macos: \c .app/Content/Resources
+ \li On Linux and Windows: \c qtwebengine_locales directory in the
+ directory specified by
+ QLibraryInfo::location(QLibraryInfo::TranslationsPath)
+ \endlist
+
+ Alternatively, a locales directory path can be set as a value of the
+ \c QTWEBENGINE_LOCALES_PATH environment variable.
+
+ \section2 JavaScript Files in Qt Resource Files
+
+ If your WebEngine application is built using the Qt Quick Compiler, and the application ships
+ JavaScript files inside .qrc resources, and these files are supposed to be loaded from inside
+ HTML pages, make sure to specify the resource files in a \c QTQUICK_COMPILER_SKIPPED_RESOURCES
+ qmake variable inside your project. This prevents the Qt Quick Compiler from trying to generate
+ C++ code for the corresponding JavaScript code, as well as removing the original JavaScript code
+ from the Qt resources file, which would lead to broken HTML pages. For example:
+
+ \code
+ QTQUICK_COMPILER_SKIPPED_RESOURCES += resources/my_resource.qrc
+ \endcode
+
+ \section2 \macos Specific Deployment Steps
+
+ To deploy a \QWE application on \macos, you will need to ensure that the \QWE process is signed
+ with an entitlements file that at least contains the entitlements listed in
+ QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/Resources/QtWebEngineProcess.entitlements.
+
+ To deploy a \QWE application that accesses the microphone or camera
+ on \macos, you will need to provide texts for the messages that will be shown to the user to
+ explain why the application asks for permission to access to the camera or microphone.
+ To do this, add the texts to the application's \c Info.plist file using the keys
+ described below.
+
+ For the camera usage message, provide a text using the following key:
+ \code
+ <key>NSCameraUsageDescription</key>
+ <string>Your message text for camera usage.</string>
+ \endcode
+
+ See also \l{https://developer.apple.com/documentation/bundleresources/information_property_list/nscamerausagedescription}
+ {Apple's property list file documentation}.
+
+ For the microphone usage message, provide a text using the following key:
+ \code
+ <key>NSMicrophoneUsageDescription</key>
+ <string>Your message text for microphone usage.</string>
+ \endcode
+
+ See also \l{https://developer.apple.com/documentation/bundleresources/information_property_list/nsmicrophoneusagedescription}
+ {Apple's property list file documentation}.
+
+ To notarize an application that accesses the camera or the microphone,
+ you will need to add the corresponding keys to your application's entitlements file used for
+ deployment and notarization.
+
+ To enable access to the camera, add:
+ \code
+ <key>com.apple.security.device.camera</key>
+ <true/>
+ \endcode
+
+ See also \l{https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_device_camera}
+ {Apple's camera entitlement documentation}.
+
+ To enable access to the microphone, add:
+ \code
+ <key>com.apple.security.device.microphone</key>
+ <true/>
+ \endcode
+
+ See also \l{https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_device_microphone}
+ {Apple's microphone entitlement documentation}.
+*/
diff --git a/src/core/doc/src/qtwebengine-features.qdoc b/src/core/doc/src/qtwebengine-features.qdoc
new file mode 100644
index 000000000..9465d75a2
--- /dev/null
+++ b/src/core/doc/src/qtwebengine-features.qdoc
@@ -0,0 +1,777 @@
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+ \page qtwebengine-features.html
+ \title Qt WebEngine Features
+ \ingroup explanations-webtechnologies
+
+ \brief Summarizes \QWE features.
+
+ \QWE supports the following features:
+
+ \list
+ \li \l{Audio and Video Codecs}
+ \li \l{WebEngineDriver}
+ \li \l{Chromium DevTools}
+ \li \l{Client Certificates}
+ \li \l{Custom Schemes}
+ \li \l{Drag and Drop}
+ \li \l{Favicon}
+ \li \l{Fullscreen}
+ \li \l{Hardware Acceleration}
+ \li \l{HTML5 DRM}
+ \li \l{HTML5 Geolocation}
+ \li \l{HTML5 WebSockets}
+ \li \l{HTTP/2 Protocol}
+ \li \l{Local Storage}
+ \li \l{Native Dialogs}
+ \li \l{PDF File Viewing}
+ \li \l{Page Lifecycle API}
+ \li \l{Print to PDF}
+ \li \l{Process Models}
+ \li \l{Spellchecker}
+ \li \l{Touch}
+ \li \l{View Source}
+ \li \l{Web Notifications}
+ \li \l{WebGL}
+ \li \l{webrtc_feature}{WebRTC}
+ \endlist
+
+ \section1 Audio and Video Codecs
+
+ \QWE supports the MPEG-4 Part 14 (MP4) file format only if the
+ required proprietary audio and video codecs, such as H.264 and MPEG layer-3
+ (MP3), have been enabled. Proprietary codecs can be enabled by passing the
+ following option to the \c configure tool when configuring Qt:
+
+ \badcode
+ -webengine-proprietary-codecs
+ \endcode
+
+ For example, the following option could be passed when configuring Qt for
+ building it at the top level:
+
+ \badcode
+ configure -webengine-proprietary-codecs
+ \endcode
+
+ For more information, see \l{Qt Configure Options}.
+
+ When using cmake to build just the \QWE module, the following
+ command can be used to configure and build (in this example, the \QWE source code is
+ located in \c {C:\qt\qtwebengine}):
+
+ \badcode
+ qt-configure-module C:\qt\qtwebengine -webengine-proprietary-codecs
+ cmake --build . --parallel
+ \endcode
+
+ \warning When distributing proprietary codec libraries, you must acquire
+ licenses for them.
+
+ \l FFmpeg is a cross-platform solution to record, convert, and stream audio
+ and video. It can be configured for use with several codecs, which rises
+ licensing issues during distribution with the codec libraries. For some
+ codecs, open source implementations, such as \l{OpenH264 Project Homepage}
+ {OpenH264}, are available.
+
+ \section1 WebEngineDriver
+
+ With WebEngineDriver, you can automate the testing of web sites across browsers.
+ WebEngineDriver is based on ChromeDriver and can be used the same way.
+ For more information about ChromeDriver and its use, visit
+ \l {https://chromedriver.chromium.org/}{ChromeDriver user site}.
+
+ WebEngineDriver has slight modifications compared to ChromeDriver to be able to connect to
+ \QWE based browsers. It is compatible with \QWE example browsers, such as
+ \l {WebEngine Widgets Simple Browser Example}{Simple Browser} or
+ \l{WebEngine Quick Nano Browser}{Nano Browser}.
+
+ The browser automation is scripted through a WebDriver client like the
+ \l {https://www.selenium.dev/}{Selenium WebDriver}.
+ For example, WebEngineDriver can be used with the Python lanugage bindings of
+ Selenium WebDriver:
+
+ \code
+ from selenium import webdriver
+ from selenium.webdriver.chrome.service import Service
+
+ service = Service(executable_path='QTDIR/libexec/webenginedriver')
+ options = webdriver.ChromeOptions()
+ options.binary_location = 'path/to/browser_binary'
+
+ driver = webdriver.Chrome(service=service, options=options)
+ driver.get("http://www.google.com/")
+ driver.quit()
+ \endcode
+
+ In this example,
+ \list
+ \li \c executable_path has to be set to the WebEngineDriver's binary path
+ \li \c QTDIR is the directory where Qt is installed
+ \li \c options.binary_location has to be set to the browser's binary path
+ \endlist
+
+ \note On Windows: \c executable_path='QTDIR/bin/webenginedriver.exe'
+
+ Before executing the script, the \c QTWEBENGINE_REMOTE_DEBUGGING environment variable has to
+ be set. Its value is a port number what is used by both the browser and WebEngineDriver to
+ communicate with each other.
+ \badcode
+ export QTWEBENGINE_REMOTE_DEBUGGING=12345
+ \endcode
+
+ By executing, the script opens the specified web browser and loads the Google web site.
+
+ WebEngineDriver can be also attached to an already running browser if it was started with the
+ remote debugging port set. \c options.debugger_address has to be set to the remote debugging
+ address in the script:
+
+ \code
+ options.debugger_address = 'localhost:12345'
+ \endcode
+
+ In this case, \c options.binary_location should not be set because the browser is already
+ running. The environment variable \c QTWEBENGINE_REMOTE_DEBUGGING is not used by the
+ WebEngineDriver if \c options.debugger_address is set.
+
+ \note WebEngineDriver must be built with the same version of Chromium as \QWE is using.
+
+ \section1 Chromium DevTools
+
+ The Chromium DevTools provide the ability to inspect and debug layout and
+ performance issues of any web content.
+
+ This feature can be tested by launching a \QWE application with the
+ command line option \c {--remote-debugging-port=[your-port]} or by setting
+ the environment variable \c QTWEBENGINE_REMOTE_DEBUGGING and then using a
+ Chromium based browser (such as \l{WebEngine Widgets Simple Browser Example}
+ {Simple Browser} or \l{WebEngine Quick Nano Browser}{Nano Browser}) to connect
+ to \c {http://localhost:[your-port]}.
+
+ \note Any WebEngine command line options should be specified after the
+ \c {--webEngineArgs} option, which is used to separate the user's application
+ specific options from the WebEngine's ones.
+
+ \badcode
+ --webEngineArgs --remote-debugging-port=5000
+ \endcode
+
+ To avoid WebSocket errors during remote debugging, add an additional command-line argument
+ \c {--remote-allow-origins=<origin>[,<origin>, ...]}, where \c <origin> refers to the request origin.
+ Use \c {--remote-allow-origins=*} to allow connections from all origins. If nothing is specified,
+ \QWE will add \c {--remote-allow-origins=*} to command-line arguments when remote-debugging is enabled,
+ thereby allowing requests from all origins.
+
+ The Chromium DevTools page can also be shown within the application. To set
+ this up, you can call either QWebEnginePage::setInspectedPage() to the page
+ to be inspected, which implicitly loads the DevTools into the \c this page,
+ or QWebEnginePage::setDevToolsPage() to let the \c this page be inspected.
+
+ The respective QML properties are \l{WebEngineView::devToolsView}
+ {WebEngineView.devToolsView} and \l{WebEngineView::inspectedView}
+ {WebEngineView.inspectedView}.
+
+ For more information, see \l {Qt WebEngine Debugging and Profiling}.
+
+ \section1 Client Certificates
+
+ Some web servers, in particular many intranet sites, require the client to
+ authenticate itself with a certificate, called a \e {client certificate}. \QWE
+ will read the client certificates installed in the system settings in macOS and
+ Windows, and on Linux those installed into the NSS database. Certificates can
+ be installed into the NSS database using the \c pk12util tool.
+
+ By default, \QWE will not offer any client certificates to servers, as doing
+ so uniquely identifies the user and might violate privacy expectations.
+
+ To activate support for client certificates, an application needs to listen to
+ the QWebEnginePage::selectClientCertificate or
+ \l{WebEngineView::selectClientCertificate}{WebEngineView.selectClientCertificate}
+ signals and select one of the offered
+ certificates. For applications that can navigate to untrusted web sites, it is
+ recommended to always give the user a choice before uniquely identifying them
+ to a remote server.
+
+ In addition to the client certificate stored in system settings, \QWE offers also
+ the in-memory store. The QWebEngineClientCertificateStore instance can be obtained with
+ the QWebEngineProfile::clientCertificateStore() method. An application can use this
+ class to add a new certificate with a QWebEngineClientCertificateStore::add() call.
+ Note that during the \c selectClientCertificate calls, \QWE lists both system
+ and in-memory stored clients certificates.
+
+ See also \l{WebEngine Widgets Client Certificate Example}{Client Certificate Example}
+ for more implementation details.
+
+ \section1 Custom Schemes
+
+ \QWE makes it possible for the application to define its own custom
+ URL schemes with specialized security policies and transport mechanisms.
+
+ Custom schemes can be used to implement alternative network protocols with
+ all the usual web security policies, privileged internal schemes for
+ displaying user interface components or debugging information, sandboxed
+ schemes with extra restrictions, and so on.
+
+ For more information, see \l QWebEngineUrlScheme and \l
+ QWebEngineUrlSchemeHandler.
+
+ \section1 Drag and Drop
+
+ \QWE supports HTML5 drag and drop.
+
+ This feature can be tested by opening an HTML5 drag and drop demo, such as
+ \l{HTML5 Demos - Drag and Drop}, \l{HTML5 Demos - Simple Drag and Drop}, or
+ \l{HTML5 Demos - Drag and Drop, Automatic Upload}, in \l{WebEngine Widgets
+ Simple Browser Example}{Simple Browser} or \l{WebEngine Quick Nano Browser}
+ {Nano Browser}.
+
+ Dragging files into the browser is not actually part of HTML5, but it is
+ supported. It can be tested by opening \l{HTML5 Demos - File API}.
+
+ Support for this feature was added in Qt 5.7.0.
+
+ \section1 Favicon
+
+ \QWE supports the web site URL icon, \e favicon. Each icon is stored in the internal
+ database for each \l QWebEngineProfile and can be accessed using a \l QWebEnginePage::icon()
+ call or a \l {WebEngineView::icon}{WebEngineView.icon} property for the currently loaded content.
+
+ Moreover \QWE provides API for accessing already stored icons in the internal profile's database.
+
+ \note The icon database is not available for off-the-record profiles.
+
+ \section2 QML Favicon Handling
+
+ For accessing icons a \c QQuickImageProvider is registered. This provider can be
+ accessed by a special URL where the scheme is "image:" and the host is "favicon".
+
+ \qml
+ Image {
+ source: "image://favicon/url"
+ }
+ \endqml
+
+ The \c url can be the URL of the favicon:
+
+ \qml
+ Image {
+ source: "image://favicon/https://www.qt.io/hubfs/2016_Qt_Logo/qt_logo_green_rgb_16x16.png"
+ }
+ \endqml
+
+ The \c url also can be a page URL to access its icon:
+
+ \qml
+ Image {
+ source: "image://favicon/https://www.qt.io/"
+ }
+ \endqml
+
+ If more than one icon is available, the \l {Image::sourceSize} property can be
+ specified to choose the icon with the desired size. If \l {Image::sourceSize}
+ is not specified or 0, the largest available icon will be chosen.
+
+ The image provider looks up the requested icon in the existing \l {WebEngineView}
+ instances. First, it tries to match the currently displayed icons. If no match
+ has been found it requests the icon from the database. Each profile has its
+ own icon database and it is stored in the persistent storage thus the stored icons
+ can be accessed without network connection too. The icon must be previously loaded
+ to be stored in the database.
+
+ \section2 C++ Favicon Handling
+
+ A user can request an icon from the previously loaded content for each
+ \l QWebEngineProfile using the \l QWebEngineProfile::requestIconForPageURL() or
+ \l QWebEngineProfile::requestIconForIconURL() calls. Note that the profile's database is
+ stored in the persistent storage and can be accessed without a network connection.
+
+ \section1 Fullscreen
+
+ \QWE supports viewing web content in fullscreen mode. For more
+ information, see \l{WebEngineSettings::fullscreenSupportEnabled}
+ {WebEngineSettings.fullscreenSupportEnabled},
+ \l{WebEngineView::fullScreenRequested}{WebEngineView.fullScreenRequested},
+ QWebEngineSettings::FullScreenSupportEnabled, and
+ QWebEnginePage::fullScreenRequested.
+
+ This feature can be tested by playing a video from YouTube in \l{WebEngine
+ Widgets Video Player Example}{Video Player} or \l{WebEngine Quick Nano Browser}
+ {Nano Browser}, and clicking the full screen icon to go into fullscreen
+ mode.
+
+ Support for this feature was added in Qt 5.6.0.
+
+ \section1 Hardware Acceleration
+
+ QtWebEngine tries to use hardware acceleration for rendering the content. It uses
+ \c OpenGL or \c OpenGLES APIs to execute rendering calls on the GPU. As a fallback,
+ software rendering is used whenever the hardware does not meet the required set of
+ OpenGL functionality. A user can check the current hardware acceleration state by
+ loading the \c {chrome://gpu} internal page. Moreover, the acceleration can be explicitly
+ disabled with \c {QTWEBENGINE_CHROMIUM_FLAGS} using the \c {disable-gpu} switch.
+ For example on Linux:
+
+ \badcode
+ export QTWEBENGINE_CHROMIUM_FLAGS=--disable-gpu
+ \endcode
+
+ \section1 HTML5 DRM
+
+ \QWE supports viewing DRM protected videos if the \l{Widevine CDM} plugin has been installed.
+ CDM plugin is a replacement of Flash based plugins for displaying DRM-protected content.
+ It comes only in a binary format, so it can hide DRM decryption implementation details.
+ It can be obtained from a third party or from a Google Chrome installation.
+
+ \QWE on startup looks for the \l{Widevine CDM} plugin in well know locations, like
+ default Google Chrome installation directory or Linux distro specific paths. However, plugin
+ location can be also passed with \c {QTWEBENGINE_CHROMIUM_FLAGS} using \c {widevine-path}.
+
+ On Windows:
+ \badcode
+ set QTWEBENGINE_CHROMIUM_FLAGS=--widevine-path="C:/some path/widevinecdm.dll"
+ \endcode
+
+ On Linux:
+ \badcode
+ export QTWEBENGINE_CHROMIUM_FLAGS=--widevine-path="/some path/libwidevinecdm.so"
+ \endcode
+
+ On macOS:
+ \badcode
+ export QTWEBENGINE_CHROMIUM_FLAGS=--widevine-path="/some path/libwidevinecdm.dylib"
+ \endcode
+
+
+ The video format most commonly used by DRM services, H.264, requires
+ proprietary audio and video codecs. For more information about enabling the
+ codecs, see \l{Audio and Video Codecs}.
+
+ This feature can be tested by playing a video in \l{WebEngine Widgets Simple Browser
+ Example}{Simple Browser} or \l{WebEngine Quick Nano Browser}{Nano Browser}
+ from \l{castLabs}, \l{Swank Motion Pictures, Inc.}, or \l{Bitmovin Player}.
+
+ Support for this feature was added in Qt 5.7.0.
+
+ \section1 HTML5 Geolocation
+
+ \QWE supports JavaScript Geolocation API with \l {Qt Positioning} as a
+ backend. HTML5 geolocation is disabled by default. To explicitly allow it, the application
+ needs to listen to QWebEnginePage::featurePermissionRequested. Use QWebEnginePage::Geolocation
+ with a QWebEnginePage::setFeaturePermission() call or \l{WebEngineView::Feature}
+ with a \l{WebEngineView::grantFeaturePermission} {WebEngineView.grantFeaturePermission}() call
+ to grant the required permission.
+
+ If \QWE was built with Qt Positioning support then this feature can be
+ tested by using \l{WebEngine Widgets Maps Example}{Maps} and allowing it to
+ find the current position of the user.
+
+ \note On Windows 11, enable settings to grant the maps example access to
+ Windows location services. In the Settings App under
+ \uicontrol {Privacy & Security} > \uicontrol {Location}, enable \uicontrol
+ {Location services}, \uicontrol {Let apps access your location} and \uicontrol
+ {Let desktop apps access your location}.
+
+ See \l{Qt Positioning} for a possible backend setup like the GPS or IP based positioning.
+
+ Support for this feature was added in Qt 5.5.0.
+
+ \section1 HTML5 WebSockets
+
+ \QWE supports the WebSocket JavaScript API to communicate with WebSocket servers
+ using the \c {ws://} or \c {wss://} protocols. Moreover, integration with Qt WebChannel
+ and Qt WebSockets enables communication between JavaScript and the native side of
+ the application.
+
+ The Qt WebChannel module has a great example for a
+ \l[QtWebChannel]{Qt WebChannel ChatServer Example}{chat server}
+ and its web based
+ \l[QtWebChannel]{Qt WebChannel ChatClient HTML Example}{chat client}.
+ The client works out of the box in the example browsers of \QWE
+ (such as \l{WebEngine Widgets Simple Browser Example}
+ {Simple Browser} or \l{WebEngine Quick Nano Browser}{Nano Browser}).
+
+ \section1 HTTP/2 Protocol
+
+ \QWE supports the Chromium implementation of the \l{HTTP/2}
+ protocol.
+
+ This feature can be tested by opening an HTTP/2 demo, such as the
+ \l{Akamai HTTP/2 Demo}, in \l{WebEngine Widgets Simple Browser Example}
+ {Simple Browser} or \l{WebEngine Quick Nano Browser}{Nano Browser}.
+
+ \section1 Local Storage
+
+ \QWE supports saving key-value pairs in a \c {Local Storage} with no expiration date.
+ This is a part of the \l
+ {https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API/Using_the_Web_Storage_API}
+ {Web Storage API}, where a user can access a \c Storage object for the given domains
+ using the \c Window.localStorage JavaScript property. The stored data will persist even
+ after the page or the browser application is closed.
+
+ Note that the \c Local Storage can be also disabled with a
+ \l QWebEngineSettings::LocalStorageEnabled
+ setting. Moreover, the storage path can be adjusted with a
+ \l QWebEngineProfile::setPersistentStoragePath
+ call.
+
+ \code
+ QWebEngineProfile profile("MyProfile");
+ profile.settings()->setAttribute(QWebEngineSettings::LocalStorageEnabled, isEnabled);
+ profile.setPersistentStoragePath("/path/to/storage");
+ \endcode
+
+ \QWE offers also an easy way of investigating the content of the \c {Local Storage}
+ with \l {Qt WebEngine Developer Tools} by visiting the \uicontrol Application panel
+ and expanding the \uicontrol {Local Storage} menu.
+
+ \section1 Native Dialogs
+
+ A web page might request dialogs for the following functions:
+
+ \list
+ \li Entering user credentials for HTTP and proxy authentication
+ \li Displaying JavaScript alerts, confirmation dialogs, and prompts
+ \li Picking colors
+ \li Selecting files
+ \li Displaying form validation messages
+ \endlist
+
+ \QWE provides standard dialogs for these functions. In widget-based
+ applications, the standard dialogs are based on QDialog, whereas in Qt Quick
+ applications, they can be based either on Qt Quick Controls 1 or Qt Quick
+ Controls 2 (since Qt 5.8). The latter are used only on \c eglfs platforms.
+
+ To explicitly force either dialogs based on Qt Quick Controls 1 or Qt Quick
+ Controls 2, set the \c QTWEBENGINE_DIALOG_SET environment variable to either
+ \c{QtQuickControls1} or \c{QtQuickControls2}.
+
+ \QWE Widgets dialogs can be customized by reimplementing the
+ QWebEnginePage::chooseFiles(), QWebEnginePage::javaScriptAlert(),
+ QWebEnginePage::javaScriptConfirm(), and QWebEnginePage::javaScriptPrompt()
+ functions.
+
+ Since Qt 5.8, Qt Quick dialogs can be customized by connecting to the
+ WebEngineView::authenticationDialogRequested(),
+ WebEngineView::javaScriptDialogRequested(),
+ WebEngineView::colorDialogRequested(),
+ WebEngineView::fileDialogRequested(), and
+ WebEngineView::formValidationMessageRequested() signals. For an example,
+
+ \section1 PDF File Viewing
+
+ \QWE supports viewing PDF documents by navigating to them. This feature uses the Chromium
+ extensions API and PDF viewer plugin to display the PDF documents.
+ It can be tested in \l{WebEngine Widgets Simple Browser Example}{Simple Browser} or
+ \l{WebEngine Quick Nano Browser}{Nano Browser}.
+
+ Loading plugins needs to be enabled using QWebEngineSettings::PluginsEnabled or
+ WebEngineSettings::pluginsEnabled in order to use this feature.
+
+ This feature can be turned on (default) or off via the QWebEngineSettings::PdfViewerEnabled or
+ WebEngineSettings::pdfViewerEnabled setting.
+
+ Support for this feature was added in Qt 5.13.0.
+
+ \section1 Page Lifecycle API
+
+ \QWE supports the \l {https://wicg.github.io/page-lifecycle/spec.html}{Page
+ Lifecycle API specification}, a work-in-progress extension to the HTML
+ standard for allowing user agents to reduce their resource consumption by
+ freezing or discarding background pages. The feature is exposed both in the
+ Widgets and QML APIs.
+
+ For an example of the QML API in use, see the \l {WebEngine Lifecycle
+ Example}.
+
+ Support for this feature was added in Qt 5.14.0.
+
+ \section2 Overview of Lifecycle States
+
+ Each \l {WebEngineView} item (or \l {QWebEnginePage} object) can be in one
+ of three \e {lifecycle states}: active, frozen, or discarded. These states,
+ like the sleep states of a CPU, control the resource usage of web views.
+
+ The \e {active} state is the normal, unrestricted state of a web view. All
+ visible web views are always in the active state, as are all web views that
+ have not yet finished loading. Only invisible, idle web views can be
+ transitioned to other lifecycle states.
+
+ The \e {frozen} state is a low CPU usage state. In this state, most HTML
+ task sources are suspended (frozen) and, as a result, most DOM event
+ processing and JavaScript execution will also be suspended. The web view
+ must be invisible in order to be frozen as rendering is not possible in this
+ state.
+
+ The \e {discarded} state is an extreme resource-saving state. In this state,
+ the browsing context of the web view will be discarded and the corresponding
+ renderer subprocess shut down. CPU and memory usage in this state is reduced
+ virtually to zero. On exiting this state the web page will be automatically
+ reloaded. The process of entering and exiting the discarded state is similar
+ to serializing the browsing history of the web view and destroying the view,
+ then creating a new view and restoring its history.
+
+ See also \l {WebEngineView::LifecycleState}. The equivalent in the Widgets
+ API is \l {QWebEnginePage::LifecycleState}.
+
+ \section2 The \c {lifecycleState} and \c {recommendedState} Properties
+
+ The \l {WebEngineView::}{lifecycleState} property of the \l {WebEngineView}
+ type is a read-write property that controls the current lifecycle state of
+ the web view. This property is designed to place as few restrictions as
+ possible on what states can be transitioned to. For example, it is allowed
+ to freeze a web view that is currently playing music in the background,
+ stopping the music. In order to implement a less aggressive resource-saving
+ strategy that avoids interrupting user-visible background activity, the \l
+ {WebEngineView::} {recommendedState} property must be used.
+
+ The \l {WebEngineView::}{recommendedState} property of the \l
+ {WebEngineView} type is a read-only property that calculates a safe limit on
+ the \l {WebEngineView::}{lifecycleState} property, taking into account the
+ current activity of the web view. So, in the example of a web view playing
+ music in the background, the recommended state will be \c {Active} since a
+ more aggressive state would stop the music. If the application wants to
+ avoid interrupting background activity, then it should avoid putting the web
+ view into a more aggressively resource-saving lifecycle state than what's
+ given by \l {WebEngineView::}{recommendedState}.
+
+ See also \l {WebEngineView::lifecycleState} and \l
+ {WebEngineView::recommendedState}. The equivalents in the Widgets API are \l
+ {QWebEnginePage::lifecycleState} and \l {QWebEnginePage::recommendedState}.
+
+ \section2 The DOM Extensions
+
+ The \l {WebEngineView::}{lifecycleState} property is connected to the \l
+ {https://wicg.github.io/page-lifecycle/spec.html}{Page Lifecycle API
+ specification}, which specifies two new DOM events, \c {freeze} and \c
+ {resume}, and adds a new \c {Document.wasDiscarded} boolean property. The \c
+ {freeze} and \c {resume} events are fired when transitioning from the \c
+ {Active} to the \c {Frozen state}, and vice-versa. The \c
+ {Document.wasDiscarded} property is set to \c {true} when transitioning from
+ the \c {Discarded} state to the \c {Active} state.
+
+ \section1 Print to PDF
+
+ \QWE supports printing a web page to a PDF file. For more
+ information, see QWebEnginePage::printToPdf() and
+ \l{WebEngineView::printToPdf}{WebEngineView.printToPdf}.
+
+ This feature can be tested using \l{WebEngine Widgets Html2Pdf Example}
+ {Html2Pdf}.
+
+ Support for this feature was added in Qt 5.7.0.
+
+ \section1 Process Models
+
+ \QWE uses multiple OS processes to isolate web sites from each other
+ and from the client application, improving security and robustness. The
+ following process models, or ways to divide web sites between OS processes,
+ are supported:
+
+ \list
+ \li \l{Process per Site Instance}
+ \li \l{Process per Site}
+ \li \l{Single Process}
+ \endlist
+
+ \section2 Process per Site Instance
+
+ This is the default model. Pages from separate sites are put into separate
+ processes and separate visits to the same site are also isolated.
+
+ Two web pages are considered as belonging to the same site if they originate
+ from the same registered domain name (for example, \c wikipedia.org) and
+ scheme (for example, \c https). This is similar to the same-origin policy
+ but subdomains are ignored. For example, both \c{https://en.wikipedia.org/}
+ and \c{https://de.wikipedia.org/} would belong to the same site.
+
+ A site instance is a collection of web pages belonging to the same site.
+ When the application explicitly loads a URL into \QWE (via \l
+ QWebEnginePage::setUrl, for example), a new site instance is created for the
+ page. However, when the user clicks same-site links on the page, the
+ existing site instance is merely extended with more pages.
+
+ For instance, in the \l{WebEngine Widgets Simple Browser Example}{Simple
+ Browser} example, when a user opens two tabs and explicitly enters
+ \c{https://en.wikipedia.org/} into the URL bars, both tabs will have their
+ own separate OS processes (because explicitly entering a URL creates a new
+ site instance). However, when the user then middle-clicks some same-site
+ links to open more tabs, these new tabs will share the same OS process
+ (because user interaction extends the existing site instance).
+
+ \section2 Process per Site
+
+ Pages from separate sites are put into separate processes. Unlike Process
+ per Site Instance, all visits to the same site will share an OS process.
+
+ The benefit of this model is reduced memory consumption, because more web
+ pages will share processes. The drawbacks include reduced security,
+ robustness, and responsiveness.
+
+ To enable this model, use the command-line argument \c{--process-per-site}.
+ See \l{Using Command-Line Arguments}.
+
+ \section2 Single Process
+
+ For debugging purposes only, a single process mode can be enabled using the
+ command-line argument \c{--single-process}. See \l{Using Command-Line
+ Arguments} and \l{Qt WebEngine Debugging and Profiling}.
+
+ \section1 Spellchecker
+
+ \QWE supports integrating spellchecking support into HTML forms to
+ enable users to submit spellchecked messages. When the user clicks on
+ an underlined misspelled word, the default context menu displays up to four
+ suggestions. Selecting one will replace the misspelled word.
+
+ To be able to check the spelling, the spellchecker needs dictionaries. It
+ supports dictionaries from the \l{Hunspell project}, but they have to be
+ compiled into a special binary format. A Hunspell dictionary consists of two
+ files:
+
+ \list
+
+ \li A \c .dic file that is a dictionary containing words for the
+ language
+ \li An \c .aff file that defines the meaning of special flags in the
+ dictionary
+ \endlist
+
+ These two files can be converted into the \c bdic format by using the
+ \c qwebengine_convert_dict tool that is shipped together with Qt.
+ When the \QWE spellchecker initializes, it will try to load the
+ \c bdict dictionaries and to check them for consistency.
+
+ If \c QTWEBENGINE_DICTIONARIES_PATH is set, the spellchecker uses the
+ dictionaries in the specified directory without looking anywere else.
+ Otherwise, it uses the \e qtwebengine_dictionaries directory relative to the
+ executable if it exists. If it does not exist, it will look in \c
+ QT_INSTALL_PREFIX/qtwebengine_dictionaries.
+
+ On macOS, depending on how \QWE is configured at build time, there
+ are two possibilities how spellchecking data is found:
+
+ \list
+ \li Hunspell dictionaries (default) - .bdic dictionaries are used, just
+ like on other platforms
+ \li Native dictionaries - the macOS spellchecking APIs are used (which
+ means the results will depend on the installed OS dictionaries)
+ \endlist
+
+ Thus, in the macOS Hunspell case, \QWE will look in the \e
+ qtwebengine_dictionaries subdirectory located inside the application bundle
+ \c Resources directory, and also in the \c Resources directory located
+ inside the Qt framework bundle.
+
+ To summarize, in case of Hunspell usage, the following paths are considered:
+
+ \list
+ \li \c QTWEBENGINE_DICTIONARIES_PATH, if set
+ \li QCoreApplication::applicationDirPath()/qtwebengine_dictionaries
+ or QCoreApplication::applicationDirPath()/../Contents/Resources/qtwebengine_dictionaries
+ (on macOS)
+ \li [QLibraryInfo::DataPath]/qtwebengine_dictionaries
+ or path/to/QtWebEngineCore.framework/Resources/qtwebengine_dictionaries (Qt framework
+ bundle on macOS)
+ \endlist
+
+ Spellchecking is disabled by default and can be enabled per profile by
+ using the QWebEngineProfile::setSpellCheckEnabled() method in widget-based
+ applications and the \l {QQuickWebEngineProfile::spellCheckEnabled}
+ {WebEngineProfile.spellCheckEnabled} property in Qt Quick applications.
+
+ The current language used for spellchecking is defined per profile, and can
+ be set using the QWebEngineProfile::setSpellCheckLanguages() method or the
+ \l {QQuickWebEngineProfile::spellCheckLanguages}
+ {WebEngineProfile.spellCheckLanguages} property.
+
+ This feature can be tested by building and running the
+ \l{WebEngine Widgets Spellchecker Example}{Spellchecker Example}.
+
+ \QWE can be compiled also without spellchecker support with the use of
+ a \c {webengine-spellchecker} configure switch.
+
+ \badcode
+ qt-configure-module path\to\qtwebengine\sources -no-webengine-spellchecker
+ \endcode
+
+ For more information, see \l{Qt Configure Options}.
+
+ Support for this feature was added in Qt 5.8.0.
+
+ \section1 Touch
+
+ \QWE supports touch devices for navigating and interacting with web pages.
+
+ Applications can prohibit the use of touch events in the following ways:
+
+ \list
+ \li Passing the flag \c --touch-events=disabled on the command line will disable touch event
+ support in JavaScript API (meaning \c ontouchstart and related handlers will not be present
+ in the \c document.window object). Touch events will still be delivered to web pages.
+
+ \li Installing an event filter object using \l {QObject::installEventFilter} on the WebEngine
+ view focus proxy object, and filtering out all touch events.
+
+ \endlist
+
+ \section1 View Source
+
+ \QWE supports viewing the HTML source of a web page.
+
+ This feature can be used from custom menus or assigned to custom events.
+ For more information, see WebEngineView::WebAction, and QWebEnginePage::WebAction.
+
+ This feature can be tested by opening a web page in \l{WebEngine Widgets
+ Simple Browser Example}{Simple Browser} or \l{WebEngine Quick Nano Browser}
+ {Nano Browser}, and then selecting \c{Page Source} in the context menu. The
+ \c{Page Source} context menu entry opens the source view in a new tab.
+
+ For opening the source view in the current tab, URLs with \l{view-source URI scheme}
+ are also supported. For example, you can type the following URL to the URL bar
+ to view the HTML source of the qt.io web page:
+ \badcode
+ view-source:https://www.qt.io/
+ \endcode
+
+ Auto-completion of incomplete URLs with \l{view-source URI scheme} makes the usage of
+ this feature more comfortable. For example, the following incomplete URL also loads
+ the source view of the qt.io web page:
+ \badcode
+ view-source:qt.io
+ \endcode
+
+ Support for this feature was added in Qt 5.8.0.
+
+ \section1 Web Notifications
+
+ Qt WebEngine supports JavaScript \l{Web Notifications API}.
+ The application has to explicitly allow the feature by using
+ QWebEnginePage::Notifications or \l{WebEngineView::Feature}
+ {WebEngineView.Notifications}.
+
+ Support for this feature was added in Qt 5.13.0.
+
+ \section1 WebGL
+
+ \QWE supports WebGL for some graphics stacks setups. A user can visit the
+ chrome://gpu page using the QtWebEngine powered application. The \e {Graphics Feature Status}
+ overview states if WebGL is supported for the current platform setup. A user can also
+ check the \l {https://webglreport.com}{WebGL Report}.
+
+ The WebGL support is enabled by default. You can disable it with the
+ \l QWebEngineSettings::WebGLEnabled setting.
+
+ \target webrtc_feature
+ \section1 WebRTC
+
+ WebRTC provides browsers with Real-Time Communications (RTC) capabilities
+ via simple APIs. For more information, see \l{WebEngineView::Feature}
+ {WebEngineView.Feature}, and QWebEnginePage::Feature.
+
+ This feature can be tested by setting up a webcam or microphone and then
+ opening \c https://test.webrtc.org/ in \l{WebEngine Widgets Simple Browser
+ Example}{Simple Browser} or \l{WebEngine Quick Nano Browser}{Nano Browser}.
+
+*/
diff --git a/src/core/doc/src/qtwebengine-global.qdoc b/src/core/doc/src/qtwebengine-global.qdoc
new file mode 100644
index 000000000..7f6636c16
--- /dev/null
+++ b/src/core/doc/src/qtwebengine-global.qdoc
@@ -0,0 +1,56 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+ \headerfile <qtwebenginecoreglobal.h>
+ \inmodule QtWebEngineCore
+ \title Global Qt WebEngine Core Declarations
+ \ingroup funclists
+
+ \brief Helper functions for the \QWE Core module.
+
+*/
+
+
+/*!
+ \fn const char *qWebEngineVersion() noexcept
+ \relates <qtwebenginecoreglobal.h>
+ \since 6.2
+
+ Returns the version number of \QWE at run-time as a string
+ (for example, "6.2.0"). This may be a different version than the
+ version the application was compiled against, and a different version
+ than Qt.
+*/
+
+/*!
+ \fn const char *qWebEngineChromiumVersion() noexcept
+ \relates <qtwebenginecoreglobal.h>
+ \since 6.2
+
+ Returns the version number of Chromium used by \QWE at run-time
+ as a string (for example, "83.0.4103.122").
+*/
+
+/*!
+ \fn const char *qWebEngineChromiumSecurityPatchVersion() noexcept
+ \relates <qtwebenginecoreglobal.h>
+ \since 6.3
+
+ Returns the version number of last Chromium version security patches have been
+ merged from.
+*/
+
+/*!
+ \fn QString qWebEngineGetDomainAndRegistry(const QUrl &url)
+ \relates <qtwebenginecoreglobal.h>
+ \since 6.6
+
+ Returns the domain of the host, that is, the effective top-level domain
+ (eTLD) and the first domain below it, from \a url.
+
+ This function supports internationalized domain names (IDN). In this case,
+ it returns the domain encoded in Punycode.
+
+ If the host is not a domain, returns an empty string.
+*/
diff --git a/src/core/doc/src/qtwebengine-index.qdoc b/src/core/doc/src/qtwebengine-index.qdoc
new file mode 100644
index 000000000..b20a96dc1
--- /dev/null
+++ b/src/core/doc/src/qtwebengine-index.qdoc
@@ -0,0 +1,47 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+ \page qtwebengine-index.html
+ \title Qt WebEngine
+
+ \brief Provides functionality for rendering regions of dynamic web content.
+
+ \QWE provides functionality for rendering regions of dynamic web content.
+
+ The functionality in \QWE is divided into the following modules:
+
+ \annotatedlist qtwebengine-modules
+
+ \section1 Articles and Guides
+
+ \list
+ \li \l{Qt WebEngine Overview}
+ \li \l{Qt WebEngine Features}
+ \li \l{Qt WebEngine Platform Notes}
+ \li \l{Qt WebEngine Licensing}
+ \li \l{Qt WebEngine Debugging and Profiling}
+ \li \l{Deploying Qt WebEngine Applications}
+ \li \l{Porting from Qt WebKit to Qt WebEngine}
+ \endlist
+
+
+ \section1 Module Evolution
+
+ \l{Changes to Qt WebEngine} lists important changes in the module API
+ and functionality that were done for the Qt 6 series of Qt.
+
+ \section1 Examples
+
+ \list
+ \li \l{Qt WebEngine Quick Examples}
+ \li \l{Qt WebEngine Widgets Examples}
+ \endlist
+
+ \section1 API References
+
+ \list
+ \li \l{Qt WebEngine C++ Classes and Namespaces}
+ \li \l{Qt WebEngine QML Types}
+ \endlist
+*/
diff --git a/src/core/doc/src/qtwebengine-modules.qdoc b/src/core/doc/src/qtwebengine-modules.qdoc
new file mode 100644
index 000000000..ee1ad8188
--- /dev/null
+++ b/src/core/doc/src/qtwebengine-modules.qdoc
@@ -0,0 +1,25 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+ \page qtwebengine-modules.html
+ \title Qt WebEngine C++ Classes and Namespaces
+ \brief Provides functionality for rendering regions of dynamic web content.
+
+ \QWE provides functionality for rendering regions of dynamic web content.
+
+ \section1 Namespaces
+ \annotatedlist qtwebengine-namespaces
+
+ \section1 Classes
+
+ \section2 Qt WebEngine Core Module
+ \generatelist {classesbymodule QtWebEngineCore}
+
+ \section2 Qt WebEngine Widgets Module
+ \generatelist {classesbymodule QtWebEngineWidgets}
+
+ \section2 Qt WebEngine Quick Module
+ \generatelist {classesbymodule QtWebEngineQuick}
+
+*/
diff --git a/src/core/doc/src/qtwebengine-overview.qdoc b/src/core/doc/src/qtwebengine-overview.qdoc
new file mode 100644
index 000000000..6eccc669e
--- /dev/null
+++ b/src/core/doc/src/qtwebengine-overview.qdoc
@@ -0,0 +1,307 @@
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+ \page qtwebengine-overview.html
+ \title Qt WebEngine Overview
+ \ingroup explanations-webtechnologies
+
+ The \QWE module provides a web browser engine that makes it easy to embed content from
+ the World Wide Web into your Qt application on platforms that do not have a native web engine.
+
+ \QWE provides C++ classes and QML types for rendering HTML, XHTML, and SVG documents,
+ styled using Cascading Style Sheets (CSS) and scripted with JavaScript. HTML documents can be
+ made fully editable by the user through the use of the \c{contenteditable} attribute on HTML
+ elements.
+
+ \section1 Qt WebEngine Architecture
+
+ \image qtwebengine-architecture.png
+
+ The functionality in \QWE is divided into the following modules:
+
+ \list
+ \li \l{Qt WebEngine Widgets Module} for creating widget-based web applications
+ \li \l{Qt WebEngine Module} for creating Qt Quick based web applications
+ \li \l{Qt WebEngine Core Module} for interacting with Chromium
+ \endlist
+
+ Page rendering and JavaScript execution are separated from the GUI process into the \QWE
+ Process. It is a library that must be shipped with the application if the Qt libraries are
+ bundled into the application.
+
+ \section2 Qt WebEngine Widgets Module
+
+ \image qtwebenginewidgets-model.png
+
+ A \e {web engine view} is the main widget component of the \QWE module. It can be used
+ in various applications to load web content. Within a view, a \e {web engine page} holds a main
+ frame that is responsible for web content, the \e history of navigated links, and \e actions.
+ The view and page are quite similar, as they provide a set of common functions.
+
+ All pages belong to a \e {web engine profile} that contains shared \e settings, \e scripts, and
+ \e cookies. Profiles can be used to isolate pages from each other. A typical use case is a
+ dedicated profile for a \e {private browsing} mode, where no information is permanently saved.
+
+ \note The \QWE Widgets module uses the \l{Qt Quick Scene Graph}{Qt Quick scene graph}
+ to compose the elements of a web page into one view. This means that the UI process
+ requires OpenGL ES 2.0 or OpenGL 2.0 for its rendering.
+
+ \section2 Qt WebEngine Module
+
+ \image qtwebengine-model.png
+
+ The \QWE QML implementation contains the same elements as the \QWE Widgets
+ implementation, except that there is no separately accessible web engine page.
+ The supported page functionality is integrated into the web engine view.
+
+ \section2 Qt WebEngine Core Module
+
+ The \QWE core is based on the \l {Chromium Project}. Chromium provides its own network
+ and painting engines and is developed tightly together with its dependent modules.
+ Even though the QtNetwork stack is not used, its setup can be synchronized with the \QWE.
+ See \l {Proxy Support}, \l {Managing Certificates}, \l {Client Certificates}, and
+ \l {QWebEngineCookieStore} for more details.
+
+ \note \QWE is based on Chromium, but does not contain or use any services
+ or add-ons that might be part of the Chrome browser that is built and delivered by Google.
+ You can find more detailed information about the differences between Chromium and Chrome in this
+ \l{https://chromium.googlesource.com/chromium/src/+/master/docs/chromium_browser_vs_google_chrome.md}{overview}
+ that is part of the documentation in the \l {Chromium Project} upstream source tree.
+
+ The Chromium version used is the one used by the latest stable Chrome version at the time of Qt feature freeze
+ for the current version of \QWE. Additional security patches are cherry picked from newer Chrome releases on
+ every patch release, security patches released in time for the Qt patch release freeze will be included.
+ If Chrome releases critical fixes outside our release window, the next patch release is sped up to ensure a
+ patched \QWE is released before the patch details goes public.
+
+ If you need a newer \QWE beyond security fixes, and can not update all of Qt, \QWE supports building with
+ older version of Qt back to the last Qt LTS. For instance \QWE 6.3, 6.4, and 6.5 can all be built with Qt 6.2.
+ In Qt LTS releases, \QWE may be fully replaced with such a newer version to make security patching easier.
+
+ The relevant Chromium versions in question can also be read at runtime using the
+ \l qWebEngineChromiumVersion() method, and \l qWebEngineChromiumSecurityPatchVersion()
+ to read the current security patch level. You can also find the versions in the \QWE
+ sources in the CHROMIUM_VERSION file.
+
+ \section2 Qt WebEngine Process
+
+ The \QWE Process is a separate executable that is used to render web pages and
+ execute JavaScript. This mitigates security issues and isolates crashes caused by specific
+ content.
+
+ \section1 Embedding Web Content into Widget Based Applications
+
+ Use the QWebEngineView class to display web pages in the simplest way. Because it is a widget,
+ you can embed QWebEngineView into your forms and use its convenience functions to download and
+ display web sites.
+
+ \code
+ QWebEngineView *view = new QWebEngineView(parent);
+ view->load(QUrl("http://www.qt.io/"));
+ view->show();
+ \endcode
+
+ An instance of QWebEngineView has one QWebEnginePage. QWebEnginePage can have a
+ QWebEngineHistory that provides access to the page's navigation history and several QAction
+ objects that apply actions on the web page. In addition, a QWebEnginePage has the ability to
+ run JavaScript code in the context of the page's main frame and to enable customization of
+ handlers for specific events like showing custom authentication dialogs.
+
+ Each QWebEnginePage belongs to a QWebEngineProfile that can have a QWebEngineSettings
+ for specifying page settings, a QWebEngineScriptCollection for running scripts on the page, and
+ a QWebEngineCookieStore for accessing the HTTP cookies of Chromium. A QWebEnginePage can also
+ directly point to a script collection.
+
+ For a widget based application, the web engine is automatically initialized, unless it is
+ placed in a plugin. In that case, it must be initialized in the application main source file
+ by using \l QtWebEngineQuick::initialize, as illustrated by the following code snippet:
+
+ \code
+ int main(int argc, char **argv)
+ {
+ QtWebEngineQuick::initialize();
+
+ QApplication app(argc, argv);
+
+ QMainWindow window;
+ window.show();
+
+ return app.exec();
+ }
+ \endcode
+
+ \section1 Embedding Web Content into Qt Quick Applications
+
+ The WebEngineView QML type allows Qt Quick applications to render regions of dynamic web
+ content. A \e{WebEngineView} type may share the screen with other QML types or encompass the
+ full screen as specified within the Qt Quick application.
+
+ To make sure that OpenGL context can be shared between the GUI and render processes, the web
+ engine must be initialized by using \l QtWebEngineQuick::initialize in the application main source
+ file, as illustrated by the following code snippet:
+
+ \code
+ int main(int argc, char *argv[])
+ {
+ QGuiApplication app(argc, argv);
+
+ QtWebEngineQuick::initialize();
+
+ QQmlApplicationEngine engine;
+ engine.load(QUrl("qrc:/main.qml"));
+
+ return app.exec();
+ }
+ \endcode
+
+ An application can load pages into the WebEngineView, using either an URL or HTML string, and
+ navigate within session history. By default, links to different pages load within the same
+ WebEngineView object, but web sites may request them to be opened as a new tab, window, or
+ dialog.
+
+ The following sample QML application loads a web page using the \l{WebEngineView::}{url}
+ property:
+
+ \quotefromfile minimal/main.qml
+ \skipto import
+ \printuntil /^\}/
+
+ \section1 Script Injection
+
+ \QWE does not allow direct access to the document object model (DOM) of a page.
+ However, the DOM can be inspected and adapted by injecting scripts.
+
+ The DOM of a page is constructed when the document is ready, typically
+ when the page is completely loaded. Therefore, executing scripts as soon as a document is
+ created is not suitable for DOM operations, where one has to wait until the DOM is ready.
+
+ In addition, an injected script shares the same \e world as the other scripts executed on the
+ page, which might lead to conflicts. To avoid this, the QWebEngineScript class and the
+ WebEngineScript QML type provide implementations of the Chromium API for
+ \e{Content Script Extensions}. They specify the
+ script to run, the injection point, and the world where the script is run. This enables
+ accessing the DOM to manipulate it within a world.
+
+ Since Qt 5.8, \QWE supports augmenting a script by using the
+ following \l{Metadata Block}{Greasemonkey-like attributes}:
+
+ \list
+ \li \c {@exclude <regexp>}
+ \li \c {@include <regexp>}
+ \li \c {@match <regexp>}
+ \li \c {@name <free text>}
+ \li \c {@run-at [document-start|document-end|document-idle]}
+ \endlist
+
+ The attributes determine if and when a \l {User Scripts}{user script} is
+ run. They must be placed immediately in the beginning of the script, inside
+ a \c ==UserScript== comment:
+
+ \code
+ // ==UserScript==
+ // @include http://*.qt.io/*
+ // @exclude http://wiki.qt.io/*
+ // ==/UserScript==
+
+ window.alert("Page is from qt.io, but not wiki.qt.io");
+ \endcode
+
+ If your WebEngine application is built using the Qt Quick Compiler, and the application ships
+ JavaScript files inside .qrc resources, consider reading the section
+ \l{JavaScript Files in Qt Resource Files}.
+
+ \section1 Managing Certificates
+
+ \QWE uses its own network stack, and therefore QSslConfiguration is not used to
+ open SSL connections. Instead, \QWE uses the root CA certificates from the operating
+ system to validate the peer's certificate.
+
+ The \l{WebEngineCertificateError::type} and \l{QWebEngineCertificateError::Type} enumerations
+ provide information about the types of certificate errors that might occur. The errors can be
+ handled by using the WebEngineView::certificateError QML method or by connecting to the
+ QWebEnginePage::certificateError signal.
+
+ \section1 Proxy Support
+
+ \QWE uses the proxy settings from \l{Qt Network}, and forwards them to Chromium's
+ networking stack. If QNetworkProxy::applicationProxy is set, it will also be used for \QWE.
+ If QNetworkProxyFactory::usesSystemConfiguration() is enabled, the proxy settings
+ are automatically retrieved from the system. Settings from an installed QNetworkProxyFactory
+ will be ignored, though.
+
+ In case QNetworkProxy::user() and QNetworkProxy::password() are set, these credentials
+ will be automatically used for proxy authentication. It is up to the user to provide valid
+ credentials, since there is no error handling callback.
+
+ If no credentials are set with QNetworkProxy, but the proxy requires authentication,
+ QWebEnginePage::proxyAuthenticationRequired is emitted.
+ For Qt Quick, a dialog is shown.
+
+ Not all properties of QNetworkProxy are supported by \QWE. That is,
+ QNetworkProxy::type(), QNetworkProxy::hostName() and QNetworkProxy::port() are taken into
+ account. All other proxy settings such as QNetworkProxy::rawHeader() are ignored.
+
+ \section1 High DPI Support
+
+ To support High DPI devices, it is recommended that the application attribute
+ Qt::AA_EnableHighDpiScaling is set to enable automatic scaling based on the
+ pixel density of the monitor. In \QWE applications, the scaling
+ affects the default zooming factor and scrollbar size.
+
+ For example:
+
+ \code
+ int main(int argc, char *argv[])
+ {
+ QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+ QApplication app(argc, argv);
+ // ...
+ }
+ \endcode
+
+ \QWE bundles images for normal and high-dpi resolutions into
+ \e qtwebengine_resources_100p.pak and \e qtwebengine_resources_200p.pak
+ files. Depending on the target resolutions, one or both of these files need
+ to be deployed.
+
+ For more information, see \l{High DPI}.
+
+ \section1 Using WebEngine Core
+
+ \QWE Core provides an API shared by \QWE and \QWE Widgets for handling
+ URL requests issued for the networking stack of Chromium and for accessing its HTTP cookies.
+
+ Implementing the QWebEngineUrlRequestInterceptor interface and installing the interceptor on a
+ profile enables intercepting, blocking, and modifying URL requests (QWebEngineUrlRequestInfo)
+ before they reach the networking stack of Chromium.
+
+ A QWebEngineUrlSchemeHandler can be registered for a profile to add support for custom URL
+ schemes. Requests for the scheme are then issued to QWebEngineUrlSchemeHandler::requestStarted()
+ as QWebEngineUrlRequestJob objects.
+
+ The QWebEngineCookieStore class provides functions for accessing HTTP cookies of Chromium.
+ The functions can be used to synchronize cookies with QNetworkAccessManager, as well as to set,
+ delete, and intercept cookies during navigation.
+
+ \section1 Platform Notes
+
+ \QWE currently supports only Windows, Linux, and \macos. Due to Chromium build
+ requirements it also often requires a newer compiler than the rest of Qt. See
+ \l{Qt WebEngine Platform Notes} for further details.
+
+ \section1 Related Modules
+
+ \QWE supersedes the \l{http://doc.qt.io/archives/qt-5.3/qtwebkit-index.html}{Qt WebKit}
+ module, which is based on the
+ WebKit project, but has not been actively synchronized with the upstream WebKit code since
+ Qt 5.2 and has been deprecated in Qt 5.5. For tips on how to change a Qt \WebKit widgets
+ application to use \QWE widgets, see \l{Porting from Qt WebKit to Qt WebEngine}.
+
+ The \l{Qt WebView} module allows to use a native web browser on platforms where one is
+ available.
+
+ The \l{Qt WebChannel} module can be used to create a bi-directional communication channel
+ between QObject objects on the C++ side and JavaScript on the QML side.
+
+*/
diff --git a/src/core/doc/src/qtwebengine-platform-notes.qdoc b/src/core/doc/src/qtwebengine-platform-notes.qdoc
new file mode 100644
index 000000000..33bac101a
--- /dev/null
+++ b/src/core/doc/src/qtwebengine-platform-notes.qdoc
@@ -0,0 +1,223 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+ \page qtwebengine-platform-notes.html
+ \title Qt WebEngine Platform Notes
+
+ \brief Contains information about issues that are specific to the \QWE module.
+
+ \section1 Building \QWE from Source
+
+ Static builds are not supported.
+
+ The requirements for building Qt modules from source are listed separately for each supported
+ platform:
+
+ \list
+ \li \l{Qt for Windows - Building from Source}
+ \li \l{Qt for X11 Requirements}
+ \li \l{Qt for macOS - Building from Source}
+ \endlist
+
+ In addition, the following tools are required for building the \l {Qt WebEngine} module:
+
+ \list
+ \li \l {All Platforms}
+ \li \l {Windows}
+ \li \l {Linux}
+ \li \l {macOS}
+ \endlist
+
+ \section2 All Platforms
+
+ On all platforms, the following tools are required at build time:
+
+ \list
+ \li C++20 compiler support
+ \li CMake 3.19 or newer
+ \li \l Python 3 with html5lib library
+ \li Bison, Flex
+ \li GPerf
+ \li Node.js version 14 or later
+ \endlist
+
+ \section2 Windows
+
+ On Windows, the following additional tools are required:
+
+ \list
+ \li Visual Studio 2019 or later, or clang-cl version 10 or later
+ \li Active Template Library (ATL), usually included in the Visual Studio
+ installation
+ \li Windows 11 SDK version 10.0.22621.0 or later
+ \endlist
+
+ \note It is not recommended to use tools from \c msys2 or \c cygwin to build \QWE as it may result in build errors.
+
+ \section2 Linux
+
+ On Linux, Clang or GCC version 9 or later is required.
+
+ \QWE requires \c pkg-config to detect most of its dependencies. The
+ following \c pkg-config files are required:
+
+ \list
+ \li \c dbus-1
+ \li \c fontconfig
+ \endlist
+
+ If Qt was configured for \c xcb, the following \c pkg-config files are also
+ required:
+
+ \list
+ \li \c libdrm
+ \li \c xcomposite
+ \li \c xcursor
+ \li \c xi
+ \li \c xrandr
+ \li \c xscrnsaver
+ \li \c xtst
+ \endlist
+
+ \section2 \macos
+
+ On \macos, the following are required:
+
+ \list
+ \li \macos 10.14 or later
+ \li Xcode 12.0 or later
+ \li \macos 11 SDK or later
+ \endlist
+
+ \note \QWE cannot be built for the 32-bit mode of \macos (using the
+ \c macx-clang-32 \c mkspec).
+
+ \section1 Using Earlier Qt Versions to Build \QWE
+
+ Building \QWE with earlier Qt versions (down to the last LTS
+ version) is supported. It means that \QWE 6.4 can be built with
+ Qt 6.2.x, Qt 6.3.x, and Qt 6.4.
+
+ To use an earlier Qt version to build Qt Webengine:
+
+ \list 1
+ \li Download the qtwebengine sources.
+ \li From the earlier Qt version, run
+ \c {qmake && make (&& make install)}.
+ \endlist
+
+ \section1 Mac App Store Compatibility
+
+ Applications using \QWE are not compatible with the Mac App Store, because:
+
+ \list
+ \li The Chromium part of the code uses several private API methods, which are prohibited by
+ the App Store.
+ \li Applications submitted to the App Store must be code-signed with the App Sandbox feature
+ enabled. The App Sandbox feature interferes with Chromium's own sandbox
+ initialization, which results in Chromium not being properly initialized. This also
+ ties in with the private API usage. Furthermore, standalone Chromium itself is not
+ officially tested with the App Sandbox enabled, and even if work is done to bypass
+ the App Store's restrictions, that would not guarantee correct behavior of the library.
+
+ \endlist
+
+ \section1 macOS Airplay Support on MacBooks with Dual GPUs
+
+ To make \QWE work correctly when streaming to an AppleTV from a MacBook that supports
+ GPU switching, it is important to add the \c NSSupportsAutomaticGraphicsSwitching option to the
+ application Info.plist file, with the value set to \c YES. Otherwise rendering issues might
+ occur when creating new web engine view instances after Airplay is switched on or off.
+
+ \section1 Default QSurfaceFormat OpenGL Profile Support
+
+ If a new default QSurfaceFormat with a modified OpenGL profile has to be set, it should be set
+ before the application instance is declared, to make sure that all created OpenGL contexts use
+ the same OpenGL profile.
+
+ On \macos, if the default QSurfaceFormat is set after the application instance, the application
+ will exit with qFatal(), and print a message that the default QSurfaceFormat should be set
+ before the application instance.
+
+ \section1 Sandboxing Support
+
+ \QWE provides out-of-the-box sandboxing support for Chromium render
+ processes.
+
+ On Linux, note the following restrictions:
+
+ \list
+ \li The kernel has to support the anonymous namespaces feature
+ (kernel version 3.8 or later). However, on Debian, Ubuntu,
+ and other Debian-derived distributions, this feature is off
+ by default. It can be turned on by setting
+ \c /proc/sys/kernel/unprivileged_userns_clone to 1.
+ \li The kernel has to support the \c seccomp-bpf feature (kernel
+ version 3.5 or later).
+ \li Setuid sandboxes are not supported and are thus disabled.
+ \endlist
+
+ To explicitly disable sandboxing, use one of the following options:
+
+ \list
+ \li Set the \c QTWEBENGINE_DISABLE_SANDBOX environment variable to 1.
+ \li Pass the \c{--no-sandbox} command line argument to the user
+ application executable.
+ \li Set \c QTWEBENGINE_CHROMIUM_FLAGS to \c{--no-sandbox}.
+ \endlist
+
+ For more information, see \l{Using Command-Line Arguments}.
+
+ \section1 Memory Requirements in Docker Environment
+
+ When running Qt Web Engine examples in a Docker container and browsing
+ content-heavy sites, BUS errors (SIGBUS) might be reported. Typically,
+ this is caused by Docker running a container with a too small memory space
+ (such as 64MB). To fix this problem, increase the memory space size.
+
+ \section1 Accessibility and Performance
+
+ \QWE enables accessibility support for web pages when the following conditions
+ are met:
+
+ \list
+ \li Qt Core is configured and built with accessibility support enabled.
+ \li The QPA plugin is notified by the operating system that accessibility should be
+ activated. This happens for example when using a screen reader application on Windows
+ or VoiceOver on \macos.
+ \endlist
+
+ On some old Linux configurations, accessibility can cause a significant slowdown
+ on large HTML pages.
+
+ Because of that, \QWE accessibility support can be disabled on Linux, by setting the
+ \c QTWEBENGINE_ENABLE_LINUX_ACCESSIBILITY environment variable to 0.
+
+ \section1 Popups in Fullscreen Applications on Windows
+ Because of a limitation in the Windows compositor, applications that show a fullscreen web
+ engine view will not properly display popups or other top-level windows. The reason and
+ workaround is described in \l {Fullscreen OpenGL Based Windows}.
+
+ \target windows_manifest
+ \section1 Windows Application Manifest
+ A manifest is an XML file that is read when the program starts and informs Windows how to run the program.
+ Some \QWE features may require adding a manifest file for the user application to work correctly on Windows.
+
+ The following snippets show the manifest file's structure and how to embed it into the program.
+
+ \note These code snippets are taken from the \l {WebEngine Quick Nano Browser} example.
+
+ The manifest file defines which Windows versions the application supports.
+ \l {QWebEngineProfile::} {httpUserAgent} needs this information to report the correct Windows version.
+ \quotefile ../../../../examples/webenginequick/quicknanobrowser/quicknanobrowser.exe.manifest
+
+ To embed the file into the executable, add it to the sources:
+ \quotefromfile ../../../../examples/webenginequick/quicknanobrowser/CMakeLists.txt
+ \skipto qt_add_executable
+ \dots
+ \printuntil endif
+ \dots
+
+ For more information, see the \l {https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests} {Application manifest documentation page}.
+*/
diff --git a/src/core/doc/src/qtwebenginecore-index.qdoc b/src/core/doc/src/qtwebenginecore-index.qdoc
index 692e33d1d..e6fc0b307 100644
--- a/src/core/doc/src/qtwebenginecore-index.qdoc
+++ b/src/core/doc/src/qtwebenginecore-index.qdoc
@@ -1,49 +1,26 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\page qtwebenginecore-index.html
\title Qt WebEngine Core
- \brief Provides common API shared by \QWE and \QWE Widgets.
+ \brief Provides common API shared by \QWE Quick and \QWE Widgets.
- \QWE Core provides API shared by \l {Qt WebEngine} and \l {Qt WebEngine Widgets}.
+ \QWE Core provides API shared by \l {Qt WebEngine QML Types}{Qt WebEngine Quick} and
+ \l {Qt WebEngine Widgets C++ Classes}{Qt WebEngine Widgets}.
\section1 Getting Started
- To include the definitions of the module's classes, use the
- following directive:
-
- \snippet qtwebenginecore_build_snippet.qdoc 1
-
To link against the module, add this line to your qmake project file:
\snippet qtwebenginecore_build_snippet.qdoc 0
+ For build with CMake use the \c find_package() command to locate the needed module components
+ in the Qt6 package and \c target_link_libraries() to link against the module:
+
+ \snippet qtwebenginecore_build_snippet.qdoc 2
+
\section1 Articles and Guides
\list
diff --git a/src/core/doc/src/qtwebenginecore-module.qdoc b/src/core/doc/src/qtwebenginecore-module.qdoc
index c976d024c..188609793 100644
--- a/src/core/doc/src/qtwebenginecore-module.qdoc
+++ b/src/core/doc/src/qtwebenginecore-module.qdoc
@@ -1,53 +1,32 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\module QtWebEngineCore
\title Qt WebEngine Core C++ Classes
- \brief Provides public API shared by both QtWebEngine and QtWebEngineWidgets.
+ \brief Provides public API shared by both QtWebEngineQuick and QtWebEngineWidgets.
\since 5.6
\ingroup qtwebengine-modules
\ingroup modules
-
- To include the definitions of the module's classes, use the
- following directive:
-
- \snippet qtwebenginecore_build_snippet.qdoc 1
+ \qtvariable webenginecore
+ \qtcmakepackage WebEngineCore
If you use qmake to build your projects, \QWE Core is usually
- indirectly included through the \l{Qt WebEngine QML Types}{Qt WebEngine} or
+ indirectly included through the \l{Qt WebEngine QML Types}{Qt WebEngine Quick} or
\l{Qt WebEngine Widgets C++ Classes}{Qt WebEngine Widgets} modules.
\if !defined(qtforpython)
- To link against the module, add this line to your qmake project file:
+ To link against the module using build with qmake,
+ add this line to your qmake project file:
\snippet qtwebenginecore_build_snippet.qdoc 0
- However, \c webenginecore is implied by adding \c webengine or \c webenginewidgets.
+ However, \c webenginecore is implied by adding \c webenginequick or \c webenginewidgets.
+
+ For build with CMake use the \c find_package() command to locate the needed module components
+ in the Qt6 package and \c target_link_libraries() to link against the module:
+
+ \snippet qtwebenginecore_build_snippet.qdoc 2
\endif
*/
diff --git a/src/core/doc/src/qwebengine-licensing.qdoc b/src/core/doc/src/qwebengine-licensing.qdoc
new file mode 100644
index 000000000..796a9664d
--- /dev/null
+++ b/src/core/doc/src/qwebengine-licensing.qdoc
@@ -0,0 +1,34 @@
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+\group qtwebengine-licensing
+\title Qt WebEngine Licensing
+
+The Qt specific parts of the \QWE module are dual-licensed
+under Commercial and GNU Lesser General Public License (LGPLv3).
+In addition, the module contains code licensed under LGPLv2.
+
+The module includes a snapshot of Chromium. As such, users need to
+respect the licenses of Chromium, and third-party code included in
+Chromium. The arguably most restrictive license to be respected by
+all users is LGPLv2.1.
+
+\note Any GPL licenses listed below are only used to access Linux system
+resources. \QWE does not link to nor distribute GPL binary code, and
+it does not affect users of \QWE.
+
+Third party licenses included in the sources are:
+*/
+
+/*!
+\page qtwebengine-3rdparty-chromium-global.html
+\attribution
+\ingroup qtwebengine-licensing
+\title Chromium License
+\brief BSD
+
+The Google-authored portion of Chromium is released under a BSD license:
+
+\quotefile ../../../3rdparty/chromium/LICENSE
+*/
diff --git a/src/core/doc/src/qwebenginehistory_lgpl.qdoc b/src/core/doc/src/qwebenginehistory_lgpl.qdoc
new file mode 100644
index 000000000..f61bb3b85
--- /dev/null
+++ b/src/core/doc/src/qwebenginehistory_lgpl.qdoc
@@ -0,0 +1,272 @@
+// Copyright (C) 2015 The Qt Company Ltd.
+// Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+// The documentation in this file was imported from QtWebKit and is thus constrained
+// by its LGPL license. Documentation written from scratch for new methods should be
+// placed inline in the code as usual.
+
+/*!
+ \class QWebEngineHistoryItem
+ \brief The QWebEngineHistoryItem class represents one item in the history of a web engine page.
+ \since 5.4
+ \inmodule QtWebEngineCore
+
+ Each web engine history item represents an entry in the history stack of a web page,
+ containing information about the page, its location, and the time when it was last visited.
+
+ \sa QWebEngineHistory, QWebEnginePage::history()
+*/
+
+/*!
+ \fn QWebEngineHistoryItem::QWebEngineHistoryItem(const QWebEngineHistoryItem &other)
+ Constructs a history item from \a other. The new item and \a other
+ will share their data, and modifying either this item or \a other will
+ modify both instances.
+*/
+
+/*!
+ \fn QWebEngineHistoryItem &QWebEngineHistoryItem::operator=(const QWebEngineHistoryItem &other)
+ Assigns the \a other history item to this. This item and \a other
+ will share their data, and modifying either this item or \a other will
+ modify both instances.
+*/
+
+/*!
+ \fn QWebEngineHistoryItem::~QWebEngineHistoryItem()
+ Destroys the history item.
+*/
+
+/*!
+ \fn QUrl QWebEngineHistoryItem::originalUrl() const
+ Returns the original URL associated with the history item.
+
+ \sa url()
+*/
+
+/*!
+ \fn QUrl QWebEngineHistoryItem::url() const
+ Returns the URL associated with the history item.
+
+ \sa originalUrl(), title(), lastVisited()
+*/
+
+/*!
+ \fn QString QWebEngineHistoryItem::title() const
+ Returns the title of the page associated with the history item.
+
+ \sa url(), lastVisited()
+*/
+
+/*!
+ \fn QDateTime QWebEngineHistoryItem::lastVisited() const
+ Returns the date and time when the page associated with the item was last visited.
+
+ \sa title(), url()
+*/
+
+/*!
+ \fn bool QWebEngineHistoryItem::isValid() const
+ Returns whether this is a valid history item.
+*/
+
+/*!
+ \class QWebEngineHistoryModel
+ \inmodule QtWebEngineCore
+ \since 6.2
+
+ \brief A data model that represents the history of a web engine page.
+
+ The QWebEngineHistoryModel type exposes the \e title, \e url, \e icon, and \e offset roles.
+ The \e title, \e url and \e icon specify the title, URL, and favicon of the visited page.
+ The \e offset specifies the position of the page in respect to the current page (0).
+ A positive number indicates that the page was visited after the current page, whereas a
+ negative number indicates that the page was visited before the current page.
+
+ This type is uncreatable, but it can be accessed by using the QWebEngineHistory::itemsModel,
+ QWebEngineHistory::backItemsModel, QWebEngineHistory::forwardItemsModel methods.
+
+ \sa QWebEngineHistory
+*/
+
+/*!
+ \enum QWebEngineHistoryModel::Roles
+
+ This enum describes specific roles, which history data model supports.
+
+ \value UrlRole URL of the visited page
+ \value TitleRole Title of the visited page
+ \value OffsetRole The offset of the page in respect to the current page (0)
+ \value IconUrlRole Favicon of the visited page
+*/
+
+/*!
+ \class QWebEngineHistory
+ \brief The QWebEngineHistory class represents the history of a web engine page.
+ \since 5.4
+ \inmodule QtWebEngineCore
+
+ Each web engine page contains a history of visited pages that can be accessed
+ by QWebEnginePage::history().
+
+ The history uses the concept of a \e{current item}, dividing the pages visited
+ into those that can be visited by navigating \e back and \e forward using the
+ back() and forward() functions. The current item can be obtained by calling
+ currentItem(), and an arbitrary item in the history can be made the current
+ item by passing it to goToItem().
+
+ A list of items describing the pages that can be visited by going back can be
+ obtained by calling the backItems() function; similarly, items describing the
+ pages ahead of the current page can be obtained with the forwardItems() function.
+ The total list of items is obtained with the items() function.
+
+ Also, the following QWebEngineHistoryModel data model objects are provided:
+
+ \list
+ \li \c backItemsModel(), which contains the URLs of visited pages.
+ \li \c forwardItemsModel(), which contains the URLs of the pages that were visited after visiting
+ the current page.
+ \li \c itemsModel(), which contains the URLs of the back and forward items, as well as the URL of
+ the current page.
+ \endlist
+
+ Just as with containers, functions are available to examine the history in terms
+ of a list. Arbitrary items in the history can be obtained with itemAt(), the total
+ number of items is given by count(), and the history can be cleared with the
+ clear() function.
+
+ QWebEngineHistory's state can be saved to a QDataStream using the >> operator and loaded
+ by using the << operator.
+
+ \sa QWebEngineHistoryItem, QWebEnginePage
+*/
+
+/*!
+ \fn void QWebEngineHistory::clear()
+ Clears the history.
+
+ \sa count(), items()
+*/
+
+/*!
+ \fn QList<QWebEngineHistoryItem> QWebEngineHistory::items() const
+ Returns a list of all items currently in the history.
+
+ \sa count(), clear()
+*/
+
+/*!
+ \fn QList<QWebEngineHistoryItem> QWebEngineHistory::backItems(int maxItems) const
+ Returns the list of items in the backwards history list.
+ At most \a maxItems entries are returned.
+
+ \sa forwardItems()
+*/
+
+/*!
+ \fn QList<QWebEngineHistoryItem> QWebEngineHistory::forwardItems(int maxItems) const
+ Returns the list of items in the forward history list.
+ At most \a maxItems entries are returned.
+
+ \sa backItems()
+*/
+
+/*!
+ \fn QWebEngineHistoryModel *QWebEngineHistory::itemsModel() const
+ Returns the data model, which represents URLs of back items, forward items,
+ and the current item in the history.
+*/
+
+/*!
+ \fn QWebEngineHistoryModel *QWebEngineHistory::backItemsModel() const
+ Return the data model, which represents URLs of visited pages.
+*/
+
+/*!
+ \fn QWebEngineHistoryModel *QWebEngineHistory::forwardItemsModel() const
+ Return the data model, which represents URLs of the pages
+ that were visited after visiting the current page.
+*/
+
+/*!
+ \fn bool QWebEngineHistory::canGoBack() const
+ Returns \c true if there is an item preceding the current item in the history;
+ otherwise returns \c false.
+
+ \sa canGoForward()
+*/
+
+/*!
+ \fn bool QWebEngineHistory::canGoForward() const
+ Returns \c true if we have an item to go forward to; otherwise returns \c false.
+
+ \sa canGoBack()
+*/
+
+/*!
+ \fn void QWebEngineHistory::back()
+ Sets the current item to be the previous item in the history and goes to the
+ corresponding page; that is, goes back one history item.
+
+ \sa forward(), goToItem()
+*/
+
+/*!
+ \fn void QWebEngineHistory::forward()
+ Sets the current item to be the next item in the history and goes to the
+ corresponding page; that is, goes forward one history item.
+
+ \sa back(), goToItem()
+*/
+
+/*!
+ \fn void QWebEngineHistory::goToItem(const QWebEngineHistoryItem &item)
+ Sets the current item to be the specified \a item in the history and goes to the page.
+
+ \sa back(), forward()
+*/
+
+/*!
+ \fn QWebEngineHistoryItem QWebEngineHistory::backItem() const
+ Returns the item before the current item in the history.
+*/
+
+/*!
+ \fn QWebEngineHistoryItem QWebEngineHistory::currentItem() const
+ Returns the current item in the history.
+*/
+
+/*!
+ \fn QWebEngineHistoryItem QWebEngineHistory::forwardItem() const
+ Returns the item after the current item in the history.
+*/
+
+/*!
+ \fn int QWebEngineHistory::currentItemIndex() const
+ Returns the index of the current item in history.
+*/
+
+/*!
+ \fn QWebEngineHistoryItem QWebEngineHistory::itemAt(int i) const
+ Returns the item at index \a i in the history.
+*/
+
+/*!
+ \fn int QWebEngineHistory::count() const
+ Returns the total number of items in the history.
+*/
+
+/*!
+ \fn QDataStream& operator<<(QDataStream& stream, const QWebEngineHistory& history)
+ \relates QWebEngineHistory
+
+ Saves the web engine history \a history into \a stream.
+*/
+
+
+/*!
+ \fn QDataStream& operator>>(QDataStream& stream, QWebEngineHistory& history)
+ \relates QWebEngineHistory
+
+ Loads the web engine history from \a stream into \a history.
+*/
diff --git a/src/core/doc/src/qwebenginepage_lgpl.qdoc b/src/core/doc/src/qwebenginepage_lgpl.qdoc
new file mode 100644
index 000000000..c2515cd13
--- /dev/null
+++ b/src/core/doc/src/qwebenginepage_lgpl.qdoc
@@ -0,0 +1,838 @@
+// Copyright (C) 2019 The Qt Company Ltd.
+// Copyright (C) 2008, 2009, 2012 Nokia Corporation and/or its subsidiary(-ies)
+// Copyright (C) 2007 Staikos Computing Services Inc.
+// Copyright (C) 2007 Apple Inc.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+// The documentation in this file was imported from QtWebKit and is thus constrained
+// by its LGPL license. Documentation written from scratch for new methods should be
+// placed inline in the code as usual.
+
+/*!
+ \class QWebEnginePage
+ \brief The QWebEnginePage class provides an object to view and edit web documents.
+ \since 5.4
+ \inmodule QtWebEngineCore
+
+ A \e {web engine page} holds the contents of an HTML document, the history of navigated
+ links, and actions.
+
+ QWebEnginePage's API is very similar to QWebEngineView, as you are still provided with
+ common functions like action() (known as
+ \l{QWebEngineView::pageAction()}{pageAction}() in QWebEngineView), triggerAction(),
+ and findText().
+
+ A page can be loaded using load() or setUrl(). Alternatively, if you have
+ the HTML content readily available, you can use setHtml(). The GET method is
+ always used to load URLs.
+
+ The QWebEnginePage class also offers methods to retrieve both the URL currently
+ loaded by the page (see url()) as well as the URL originally requested
+ to be loaded (see requestedUrl()). These methods make possible the retrieval
+ of the URL before and after a DNS resolution or a redirection occurs during
+ the load process. The requestedUrl() also matches to the URL added to the
+ page history (\l{QWebEngineHistory}) if load is successful.
+
+ The title of an HTML page can be accessed with the title() property.
+ Additionally, a page may also specify an icon, which can be accessed
+ using the icon() or its URL using the iconUrl() property.
+ If the title or the icon changes, the corresponding titleChanged(), iconChanged()
+ and iconUrlChanged() signals will be emitted.
+ The zoomFactor() property enables zooming the contents of the web page by a
+ scale factor.
+
+ The loadStarted() signal is emitted when the page begins to load, whereas the loadProgress()
+ signal is emitted whenever an element of the web page completes loading, such as an embedded
+ image or a script. The loadFinished() signal is emitted when the page contents
+ have been loaded completely, independent of script execution or page rendering.
+ Its argument, either \c true or \c false, indicates whether or not the load
+ operation succeeded.
+
+ An HTML document is loaded in a \e {main frame} within the web page. If it references
+ \e {child frames} (as defined by the \c <frame> or \c <iframe> elements), they are considered
+ part of the content. Child frames are individually accessible only through JavaScript.
+
+ Web sites define \e {security origin} for safely accessing each other's resources for
+ client-side scripting or databases. An origin consist of a host name, a scheme, and a port
+ number. For example, the sites \c http://www.example.com/my/page.html and
+ \c http://www.example.com/my/overview.html are allowed to share the same database or access
+ each other's documents when used in HTML frame sets and JavaScript. At the same time,
+ \c http://www.malicious.com/evil.html is prevented from accessing the resources of
+ \c http://www.example.com/, because they are of a different security origin.
+ By default, local schemes like \c file:// and \c qrc:// are considered to be in the same
+ security origin, and can access each other's resources. Local resources are by default
+ restricted from accessing remote content, which means that \c file:// will not be able to
+ access \c http://domain.com/foo.html.
+
+ Scripts can be executed on the web page by using runJavaScript(), either in the main
+ JavaScript \e world, along with the rest of the JavaScript coming from the web contents, or in
+ their own isolated world. While the DOM of the page can be accessed from any world, JavaScript
+ variables of a function defined in one world are not accessible from a different one.
+ QWebEngineScript::ScriptWorldId provides some predefined IDs for this purpose. Using the
+ \c runJavaScript() version without the world ID is the same as running the script in the
+ \c MainWorld.
+
+ The \l {QWebEngineSettings::FocusOnNavigationEnabled} {FocusOnNavigationEnabled} setting can be
+ used to make the view associated with the page automatically receive focus when a navigation
+ operation occurs (like loading or reloading a page or navigating through history).
+*/
+
+/*!
+ \enum QWebEnginePage::FindFlag
+
+ This enum describes the options available to the findText() function. The options
+ can be OR-ed together from the following list:
+
+ \value FindBackward Searches backwards instead of forwards.
+ \value FindCaseSensitively By default findText() works case insensitive. Specifying this option
+ changes the behavior to a case sensitive find operation.
+*/
+
+/*!
+ \enum QWebEnginePage::WebAction
+
+ This enum describes the types of action which can be performed on the web page.
+
+ Actions only have an effect when they are applicable.
+
+ The availability of actions can be be determined by checking
+ \l{QAction::}{isEnabled()} on the action returned by action().
+
+ \value NoWebAction No action is triggered.
+ \value Back Navigate back in the history of navigated links.
+ \value Forward Navigate forward in the history of navigated links.
+ \value Stop Stop loading the current page.
+ \value Reload Reload the current page.
+ \value ReloadAndBypassCache Reload the current page, but do not use any local cache.
+ \value Cut Cut the content currently selected into the clipboard.
+ \value Copy Copy the content currently selected into the clipboard.
+ \value Paste Paste content from the clipboard.
+ \value Undo Undo the last editing action.
+ \value Redo Redo the last editing action.
+ \value SelectAll Select all content. This action is only enabled when the page's content is focused.
+ The focus can be forced by the JavaScript \c{window.focus()} call, or the
+ \l{QWebEngineSettings::FocusOnNavigationEnabled} {FocusOnNavigationEnabled} setting
+ should be enabled to get automatic focus.
+ \value PasteAndMatchStyle Paste content from the clipboard with current style.
+
+ \value [since 5.6] OpenLinkInThisWindow Open the current link in the current window.
+ \value [since 5.6] OpenLinkInNewWindow Open the current link in a new window. Requires implementation of
+ \l createWindow() or \l newWindowRequested().
+ \value [since 5.6] OpenLinkInNewTab Open the current link in a new tab. Requires implementation of
+ \l createWindow() or \l newWindowRequested().
+ \value [since 5.7] OpenLinkInNewBackgroundTab Open the current link in a new background tab. Requires
+ implementation of \l createWindow() or \l newWindowRequested().
+ \value [since 5.6] CopyLinkToClipboard Copy the current link to the clipboard.
+
+ \value [since 5.6] CopyImageToClipboard Copy the clicked image to the clipboard.
+ \value [since 5.6] CopyImageUrlToClipboard Copy the clicked image's URL to the clipboard.
+ \value [since 5.6] CopyMediaUrlToClipboard Copy the hovered audio or video's URL to the clipboard.
+ \value [since 5.6] ToggleMediaControls Toggle between showing and hiding the controls for the hovered audio
+ or video element.
+ \value [since 5.6] ToggleMediaLoop Toggle whether the hovered audio or video should loop on completetion or
+ not.
+ \value [since 5.6] ToggleMediaPlayPause Toggle the play/pause state of the hovered audio or video element.
+ \value [since 5.6] ToggleMediaMute Mute or unmute the hovered audio or video element.
+ \value [since 5.6] DownloadLinkToDisk Download the current link to the disk. Requires a slot for
+ \l{QWebEngineProfile::}{downloadRequested()}.
+ \value [since 5.6] DownloadImageToDisk Download the highlighted image to the disk. Requires a slot for
+ \l{QWebEngineProfile::}{downloadRequested()}.
+ \value [since 5.6] DownloadMediaToDisk Download the hovered audio or video to the disk. Requires a slot for
+ \l{QWebEngineProfile::}{downloadRequested()}.
+
+ \value [since 5.6] InspectElement Trigger any attached Web Inspector to inspect the highlighed element.
+ \value [since 5.6] ExitFullScreen Exit the fullscreen mode.
+ \value [since 5.6] RequestClose Request to close the web page. If defined, the \c{window.onbeforeunload}
+ handler is run, and the user can confirm or reject to close the page. If the close
+ request is confirmed, \c windowCloseRequested is emitted.
+ \value [since 5.7] Unselect Clear the current selection.
+ \value [since 5.7] SavePage Save the current page to disk. MHTML is the default format that is used to store
+ the web page on disk. Requires a slot for \l{QWebEngineProfile::}{downloadRequested()}.
+ \value [since 5.8] ViewSource Show the source of the current page in a new tab. Requires implementation of
+ \l createWindow() or \l newWindowRequested().
+
+ \value [since 5.10] ToggleBold
+ Toggles boldness for the selection or at the cursor position.
+ Requires \c contenteditable="true".
+ \value [since 5.10] ToggleItalic
+ Toggles italics for the selection or at the cursor position.
+ Requires \c contenteditable="true".
+ \value [since 5.10] ToggleUnderline
+ Toggles underlining of the selection or at the cursor position.
+ Requires \c contenteditable="true".
+ \value [since 5.10] ToggleStrikethrough
+ Toggles striking through the selection or at the cursor position.
+ Requires \c contenteditable="true".
+
+ \value [since 5.10] AlignLeft
+ Aligns the lines containing the selection or the cursor to the left.
+ Requires \c contenteditable="true".
+ \value [since 5.10] AlignCenter
+ Aligns the lines containing the selection or the cursor at the center.
+ Requires \c contenteditable="true".
+ \value [since 5.10] AlignRight
+ Aligns the lines containing the selection or the cursor to the right.
+ Requires \c contenteditable="true".
+ \value [since 5.10] AlignJustified
+ Stretches the lines containing the selection or the cursor so that each
+ line has equal width.
+ Requires \c contenteditable="true".
+ \value [since 5.10] Indent
+ Indents the lines containing the selection or the cursor.
+ Requires \c contenteditable="true".
+ \value [since 5.10] Outdent
+ Outdents the lines containing the selection or the cursor.
+ Requires \c contenteditable="true".
+
+ \value [since 5.10] InsertOrderedList
+ Inserts an ordered list at the current cursor position, deleting the current selection.
+ Requires \c contenteditable="true".
+ \value [since 5.10] InsertUnorderedList
+ Inserts an unordered list at the current cursor position,
+ deleting the current selection.
+ Requires \c contenteditable="true".
+ \value [since 6.6] ChangeTextDirectionLTR
+ Changes text direction to left-to-right in the focused input element.
+ \value [since 6.6] ChangeTextDirectionRTL
+ Changes text direction to right-to-left in the focused input element.
+ \omitvalue WebActionCount
+
+*/
+
+/*!
+ \enum QWebEnginePage::WebWindowType
+
+ This enum describes the types of window that can be created by the createWindow() function:
+
+ \value WebBrowserWindow
+ A complete web browser window.
+ \value WebBrowserTab
+ A web browser tab.
+ \value WebDialog
+ A window without decoration.
+ \value [since 5.7] WebBrowserBackgroundTab
+ A web browser tab without hiding the current visible WebEngineView.
+*/
+
+/*!
+ \enum QWebEnginePage::JavaScriptConsoleMessageLevel
+
+ This enum describes the different severity levels a JavaScript console message can have:
+
+ \value InfoMessageLevel The message is purely informative and can safely be ignored.
+ \value WarningMessageLevel The message informs about unexpected behavior or errors that may
+ need attention.
+ \value ErrorMessageLevel The message indicates there has been an error.
+*/
+
+/*!
+ \enum QWebEnginePage::FileSelectionMode
+
+ This enum indicates whether the implementation of the chooseFiles() function should
+ return only one file or may return multiple files:
+
+ \value FileSelectOpen
+ Return only one file name.
+ \value FileSelectOpenMultiple
+ Return multiple file names.
+ \value FileSelectUploadFolder
+ Allows users to specify a single existing folder for upload.
+ \value FileSelectSave
+ Specify a new file to be created.
+
+ \sa chooseFiles()
+*/
+
+/*!
+ \enum QWebEnginePage::PermissionPolicy
+
+ This enum describes the permission policies that the user may set for data or device access:
+
+ \value PermissionUnknown It is unknown whether the user grants or denies permission.
+ \value PermissionGrantedByUser The user has granted permission.
+ \value PermissionDeniedByUser The user has denied permission.
+
+ \sa featurePermissionRequested(), featurePermissionRequestCanceled(), setFeaturePermission(), Feature
+*/
+
+/*!
+ \enum QWebEnginePage::NavigationType
+
+ This enum describes the type of a navigation request:
+
+ \value NavigationTypeLinkClicked The navigation request resulted from a clicked link.
+ \value NavigationTypeTyped The navigation request resulted from an explicitly loaded URL.
+ \value NavigationTypeFormSubmitted The navigation request resulted from a form submission.
+ \value NavigationTypeBackForward The navigation request resulted from a back or forward action.
+ \value NavigationTypeReload The navigation request resulted from a reload action.
+ \value [since 5.14] NavigationTypeRedirect The navigation request resulted from a content or server controlled redirect. This also includes automatic reloads.
+ \value NavigationTypeOther The navigation request was triggered by other means not covered by the above.
+
+ \sa acceptNavigationRequest()
+*/
+
+/*!
+ \enum QWebEnginePage::Feature
+
+ This enum describes the platform feature access categories that the user may be asked to grant
+ or deny access to:
+
+ \value Notifications
+ Web notifications for the end-user.
+ \value Geolocation
+ Location hardware or service.
+ \value MediaAudioCapture
+ Audio capture devices, such as microphones.
+ \value MediaVideoCapture
+ Video devices, such as cameras.
+ \value MediaAudioVideoCapture
+ Both audio and video capture devices.
+ \value MouseLock
+ Mouse locking, which locks the mouse pointer to the web view and is typically used in
+ games.
+ \value [since 5.10] DesktopVideoCapture
+ Video output capture, that is, the capture of the user's display,
+ for screen sharing purposes for example.
+ \value [since 5.10] DesktopAudioVideoCapture
+ Both audio and video output capture.
+ \value [since 6.8] ClipboardReadWrite
+ Read and write access for the clipboard. If both \l{QWebEngineSettings::JavascriptCanPaste}
+ {JavascriptCanPaste} and \l{QWebEngineSettings::JavascriptCanAccessClipboard}
+ {JavascriptCanAccessClipboard} settings are enabled, this permission will always be granted
+ automatically and no feature requests will be made.
+ \value [since 6.8] LocalFontsAccess
+ Access to the fonts installed on the user's machine. Only available on desktop platforms.
+
+ \sa featurePermissionRequested(), featurePermissionRequestCanceled(), setFeaturePermission(), PermissionPolicy
+
+*/
+
+/*!
+ \fn QWebEnginePage::QWebEnginePage(QObject *parent)
+ Constructs an empty QWebEnginePage with the parent \a parent.
+*/
+
+/*!
+ \fn QWebEnginePage::~QWebEnginePage()
+ Destroys the web page.
+*/
+
+/*!
+ \fn QWebEngineHistory *QWebEnginePage::history() const
+ Returns a pointer to the view's history of navigated web pages.
+*/
+
+/*!
+ \fn void QWebEnginePage::javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString& message, int lineNumber, const QString& sourceID)
+ This function is called when a JavaScript program tries to print the \a message to the web
+ browser's console.
+
+ For example, in case of evaluation errors the source URL may be provided in \a sourceID as well
+ as the \a lineNumber.
+
+ \a level indicates the severity of the event that triggered the message. That is, whether it
+ was triggered by an error or a less severe event.
+
+ Since Qt 5.6, the default implementation logs the messages in a \c js
+ \l{QLoggingCategory}{logging category}.
+
+ \sa{Console Logging}
+*/
+
+/*!
+ \fn bool QWebEnginePage::acceptNavigationRequest(const QUrl &url, NavigationType type, bool isMainFrame)
+ \since 5.5
+ This function is called upon receiving a request to navigate to the specified \a url by means of
+ the specified navigation type \a type. \a isMainFrame indicates whether the request corresponds
+ to the main frame or a child frame. If the function returns \c true, the navigation request is
+ accepted and \c url is loaded. The default implementation accepts all navigation requests.
+
+ Navigation requests can be delegated to the Qt application instead of having the HTML handler
+ engine process them by overloading this function. This is necessary when an HTML document is
+ used as part of the user interface, and not to display external data, for example, when
+ displaying a list of results.
+
+ \note This function is not called for fragment navigation on the same page. Such navigation,
+ for example, happens by clicking a link to a '#fragment' within the page. It does not trigger
+ a load to a different document, even though it changes page's url and adds history entry.
+ It only serves as a shortcut to scroll within the page. Hence, no delegation of this navigation
+ type is expected to happen.
+
+ \note The loading process is started and the loadStarted() signal is emitted
+ \e before the request is accepted or rejected. Therefore, a loadFinished()
+ signal that returns \c false is to be expected even after delegating the
+ request.
+
+ \note When using setHtml or setContent with relative links, make
+ sure to specify a base url, otherwise the links will be considered
+ invalid and no navigation requests will be emitted.
+
+ The \l{QWebEngineUrlRequestInterceptor} class offers further options for intercepting and
+ manipulating requests.
+*/
+
+/*!
+ \fn void QWebEnginePage::javaScriptAlert(const QUrl &securityOrigin, const QString& msg)
+ This function is called whenever a JavaScript program running in a frame affiliated with
+ \a securityOrigin calls the \c alert() function with the message \a msg.
+
+ The default implementation shows the message, \a msg, with QMessageBox::information.
+*/
+
+/*!
+ \fn bool QWebEnginePage::javaScriptConfirm(const QUrl &securityOrigin, const QString& msg)
+ This function is called whenever a JavaScript program running in a frame affiliated with
+ \a securityOrigin calls the \c confirm() function with the message \a msg. Returns \c true
+ if the user confirms the message; otherwise returns \c false.
+
+ It is also called when the \c onbeforeunload handler is requesting a confirmation before
+ leaving a page.
+
+ The default implementation executes the query using QMessageBox::information with QMessageBox::Ok and QMessageBox::Cancel buttons.
+*/
+
+/*!
+ \fn bool QWebEnginePage::javaScriptPrompt(const QUrl &securityOrigin, const QString& msg, const QString& defaultValue, QString* result)
+ This function is called whenever a JavaScript program running in a frame affiliated with \a securityOrigin tries to prompt the user for input.
+ The program may provide an optional message, \a msg, as well as a default value for the input in \a defaultValue.
+
+ If the prompt was cancelled by the user, the implementation should return \c false; otherwise the
+ result should be written to \a result and \c true should be returned. If the prompt was not
+ cancelled by the user, the implementation should return \c true and the result string must not
+ be null.
+
+ The default implementation uses QInputDialog::getText().
+*/
+
+/*!
+ \fn QWebEnginePage *QWebEnginePage::createWindow(WebWindowType type)
+ This function is called to create a new window of the specified \a type. For example, when a
+ JavaScript program requests to open a document in a new window.
+
+ If the new window can be created, the new window's QWebEnginePage is returned; otherwise a null pointer is returned.
+
+ If the view associated with the web page is a QWebEngineView object, then the default implementation forwards
+ the request to QWebEngineView::createWindow(); otherwise it returns a null pointer.
+
+ If this call is not implemented or does not return a new page, \l newWindowRequested()
+ is emitted to handle the request.
+
+ \note In the cases when the window creation is being triggered by JavaScript, apart from
+ reimplementing this method the application must also set
+ QWebEngineSettings::JavascriptCanOpenWindows to \c true in order for the method to get called.
+
+ \sa QWebEngineView::createWindow(), newWindowRequested()
+*/
+
+/*!
+ \fn void QWebEnginePage::triggerAction(WebAction action, bool checked = false)
+ This function can be called to trigger the specified \a action.
+ It is also called by \QWE if the user triggers the action, for example
+ through a context menu item.
+
+ If \a action is a checkable action, then \a checked specifies whether the action
+ is toggled or not.
+
+ \sa action()
+*/
+
+/*!
+ \property QWebEnginePage::hasSelection
+ \brief Whether this page contains selected content or not.
+
+ \sa selectionChanged()
+*/
+
+/*!
+ \property QWebEnginePage::selectedText
+ \brief The text currently selected.
+
+ By default, this property contains an empty string.
+
+ \sa selectionChanged()
+*/
+
+/*!
+ \fn QAction *QWebEnginePage::action(WebAction action) const
+ Returns a QAction for the specified WebAction \a action.
+
+ The action is owned by the QWebEnginePage but you can customize the look by
+ changing its properties.
+
+ \l{QWebEnginePage::action(WebAction action)} does not have a default styled icon.
+ Use \l{QWebEngineView::pageAction()} to have an action with a default styled icon.
+
+ QWebEnginePage also takes care of implementing the action, so that upon
+ triggering the corresponding action is performed on the page.
+
+ \sa triggerAction()
+*/
+
+/*!
+ \fn void QWebEnginePage::findText(const QString &subString, QWebEnginePage::FindFlags options = {}, const std::function<void(const QWebEngineFindTextResult &)> &resultCallback = std::function<void(const QWebEngineFindTextResult &)>)
+ Finds the specified string, \a subString, in the page, using the given \a options.
+ The findTextFinished() signal is emitted when a string search is completed.
+
+ To clear the search highlight, just pass an empty string.
+
+ The \a resultCallback must take a QWebEngineFindTextResult parameter.
+
+ \warning We guarantee that the callback (\a resultCallback) is always called, but it might be done
+ during page destruction. When QWebEnginePage is deleted, the callback is triggered with an invalid
+ value and it is not safe to use the corresponding QWebEnginePage or QWebEngineView instance inside it.
+
+ For example:
+ \snippet qtwebengine_qwebenginepage_snippet.cpp 0
+
+ \sa findTextFinished()
+*/
+
+/*!
+ \fn QWebEngineSettings *QWebEnginePage::settings() const
+ Returns a pointer to the page's settings object.
+*/
+
+/*!
+ \fn void QWebEnginePage::certificateError(const QWebEngineCertificateError & certificateError)
+ This signal is emitted when an invalid certificate error is raised while loading a given request.
+
+ The \a certificateError parameter contains information about the certificate and details of the error,
+ it also provides the way to ignore the error and complete the request or stop loading
+ the request.
+
+ \sa QWebEngineCertificateError
+*/
+
+/*!
+ \fn QString QWebEnginePage::chooseFiles(FileSelectionMode mode, const QStringList& oldFiles, const QStringList& acceptedMimeTypes)
+ This function is called when the web content requests a file name, for example
+ as a result of the user clicking on a file upload button in an HTML form.
+
+ \a mode indicates whether only one file or multiple files are expected to be returned.
+
+ A suggested filename may be provided as the first entry of \a oldFiles. \a acceptedMimeTypes is ignored by the default implementation,
+ but might be used by overrides.
+*/
+
+/*!
+ \fn void QWebEnginePage::loadStarted()
+
+ This signal is emitted when a page starts loading content.
+
+ \sa loadFinished(), acceptNavigationRequest()
+*/
+
+/*!
+ \fn void QWebEnginePage::loadProgress(int progress)
+
+ This signal is emitted when the global progress status changes.
+ The current value is provided by \a progress and scales from 0 to 100,
+ which is the default range of QProgressBar.
+ It accumulates changes from all the child frames.
+
+*/
+
+/*!
+ \fn void QWebEnginePage::loadFinished(bool ok)
+
+ This signal is emitted when the page finishes loading content. This signal
+ is independent of script execution or page rendering.
+ \a ok will indicate whether the load was successful or any error occurred.
+
+ \note Navigation requests can be delegated to the Qt application instead
+ of having the HTML handler engine process them by overloading the
+ acceptNavigationRequest() function. Because the loading process is started
+ and the loadStarted() signal is emitted \e before the request is accepted
+ or rejected, a \c loadFinished() signal that returns \c false is to be
+ expected even after delegating the request.
+
+ \sa loadStarted(), acceptNavigationRequest()
+*/
+
+/*!
+ \fn void QWebEnginePage::selectionChanged()
+
+ This signal is emitted whenever the selection changes, either interactively
+ or programmatically. For example, by calling triggerAction() with a selection action.
+
+ \note When using the mouse to select text by left-clicking and dragging, the signal will be
+ emitted for each new character selected, and not upon releasing the left mouse button.
+
+ \sa selectedText()
+*/
+
+/*!
+ \fn void QWebEnginePage::linkHovered(const QString &url)
+
+ This signal is emitted when the mouse hovers over a link.
+ \a url contains the target URL of the link.
+*/
+
+/*!
+
+ \fn void QWebEnginePage::authenticationRequired(const QUrl &requestUrl, QAuthenticator *authenticator)
+
+ This signal is emitted when access to \a requestUrl requires authentication.
+ \a authenticator should be used to pass the user name and password for the connection.
+*/
+
+/*!
+ \fn void QWebEnginePage::proxyAuthenticationRequired(const QUrl &requestUrl, QAuthenticator *authenticator, const QString &proxyHost)
+
+ This signal is emitted when access to \a requestUrl via \a proxyHost requires authentication for the proxy.
+ \a authenticator should be used to pass the user name and password for the connection.
+
+*/
+
+/*!
+ \fn void QWebEnginePage::geometryChangeRequested(const QRect& geom)
+
+ This signal is emitted whenever the document wants to change the position and size of the
+ page to \a geom. This can happen for example through JavaScript.
+
+ \note \l{QWindow::}{setGeometry()} expects a size excluding the window
+ decoration, while \a geom includes it. You have to remove the size of the frame margins
+ from \a geom to handle this signal correctly.
+
+ \code
+ window->setGeometry(geom.marginsRemoved(window->frameMargins()));
+ \endcode
+*/
+
+/*!
+ \fn void QWebEnginePage::windowCloseRequested()
+
+ This signal is emitted whenever the page requests the web browser window to be closed,
+ for example through the JavaScript \c{window.close()} call.
+
+ \sa RequestClose
+*/
+
+/*!
+ \fn void QWebEnginePage::toHtml(const std::function<void(const QString &)> &resultCallback) const
+ Asynchronous method to retrieve the page's content as HTML, enclosed in HTML and BODY tags.
+ Upon successful completion, \a resultCallback is called with the page's content.
+
+ \note \a resultCallback can be any of a function pointer, a functor or a lambda, and it is expected to take a QString parameter.
+
+ \warning We guarantee that the callback (\a resultCallback) is always called, but it might be done
+ during page destruction. When QWebEnginePage is deleted, the callback is triggered with an invalid
+ value and it is not safe to use the corresponding QWebEnginePage or QWebEngineView instance inside it.
+
+ \sa setHtml(), toPlainText()
+*/
+
+/*!
+ \fn void QWebEnginePage::toPlainText(const std::function<void(const QString &)> &resultCallback) const
+ Asynchronous method to retrieve the page's content converted to plain text, completely stripped of all
+ HTML formatting.
+ Upon successful completion, \a resultCallback is called with the page's content.
+
+ \note \a resultCallback can be any of a function pointer, a functor or a lambda, and it is expected to take a QString parameter.
+
+ \warning We guarantee that the callback (\a resultCallback) is always called, but it might be done
+ during page destruction. When QWebEnginePage is deleted, the callback is triggered with an invalid
+ value and it is not safe to use the corresponding QWebEnginePage or QWebEngineView instance inside it.
+
+ \sa toHtml()
+*/
+
+/*!
+ \property QWebEnginePage::title
+ \brief The title of the page as defined by the HTML \c <title> element.
+
+ If the page has no \c <title> element, then the URL is used instead. For \c
+ file:// URLs only the filename is used and not the full path.
+
+ By default, before any content has been loaded, this property contains an
+ empty string.
+
+ \sa titleChanged()
+*/
+
+/*!
+ \property QWebEnginePage::url
+ \brief The URL of the page currently viewed.
+
+ Setting this property clears the view and loads the URL.
+
+ By default, this property contains an empty, invalid URL.
+
+ \sa urlChanged()
+*/
+
+/*!
+ \property QWebEnginePage::requestedUrl
+ \brief The URL that was originally requested to be loaded by the page
+ that is currently viewed.
+
+ \note The URL may differ from the one returned by url(), which is the actual
+ URL that results from DNS resolution or redirection.
+
+ \sa url(), setUrl()
+*/
+
+/*!
+ \fn void QWebEnginePage::load(const QUrl &url)
+ Loads \a url into this page.
+
+ \note The view remains the same until enough data has arrived to display the new URL.
+
+ \sa setUrl(), setHtml(), setContent()
+*/
+
+/*!
+ \fn void QWebEnginePage::setHtml(const QString &html, const QUrl &baseUrl)
+ Sets the content of this page to \a html. \a baseUrl is optional and used to resolve relative
+ URLs in the document, such as referenced images or stylesheets.
+
+ The \a html is loaded immediately; external objects are loaded asynchronously.
+
+ If a script in the \a html runs longer than the default script timeout (currently 10 seconds),
+ for example due to being blocked by a modal JavaScript alert dialog, this method will return
+ as soon as possible after the timeout and any subsequent \a html will be loaded asynchronously.
+
+ When using this method, the web engine assumes that external resources, such as JavaScript programs or style
+ sheets, are encoded in UTF-8 unless otherwise specified. For example, the encoding of an external
+ script can be specified through the charset attribute of the HTML script tag. It is also possible
+ for the encoding to be specified by the web server.
+
+ This is a convenience function equivalent to setContent(html, "text/html", baseUrl).
+
+ \note This method will not affect session or global history for the page.
+
+ \warning This function works only for HTML, for other mime types (such as XHTML and SVG)
+ setContent() should be used instead.
+
+ \warning The content will be percent encoded before being sent to the renderer via IPC.
+ This may increase its size. The maximum size of the percent encoded content is
+ 2 megabytes minus 30 bytes.
+
+ \sa toHtml(), setContent(), load()
+*/
+
+/*!
+ \fn void QWebEnginePage::setContent(const QByteArray &data, const QString &mimeType, const QUrl &baseUrl)
+ Sets the content of the web page to \a data. If the \a mimeType argument
+ is empty, it is assumed that the content is \c{text/plain,charset=US-ASCII}.
+
+ External objects referenced in the content are located relative to \a baseUrl.
+ For external objects with relative URLs to be loaded, \c baseUrl cannot be empty.
+
+ The \a data is loaded immediately; external objects are loaded asynchronously.
+
+ \note This method will not affect session or global history for the page.
+
+ \warning The content will be percent encoded before being sent to the renderer via IPC.
+ This may increase its size. The maximum size of the percent encoded content is
+ 2 megabytes minus 6 bytes plus the length of the mime type string.
+
+ \sa toHtml(), setHtml()
+*/
+
+/*!
+ \property QWebEnginePage::zoomFactor
+ \brief The zoom factor for the page content.
+
+ Valid values are within the range from \c{0.25} to \c{5.0}. The default factor is \c{1.0}.
+*/
+
+/*!
+ \fn void QWebEnginePage::runJavaScript(const QString &scriptSource, quint32 worldId = 0, const std::function<void(const QVariant &)> &resultCallback = {})
+ \fn void QWebEnginePage::runJavaScript(const QString &scriptSource, const std::function<void(const QVariant &)> &resultCallback)
+ \since 5.7
+
+ Runs the JavaScript code contained in \a scriptSource without checking
+ whether the DOM of the page has been constructed. If you need more
+ control over how the script is run, consider using \l scripts() instead.
+
+ To avoid conflicts with other scripts executed on the page, the world in
+ which the script is run is specified by \a worldId. The world ID values are
+ the same as provided by QWebEngineScript::ScriptWorldId, and between \c 0
+ and \c 256. If you leave out the \c world ID, the script is run in the
+ \c MainWorld.
+
+ When the script has been executed, \a resultCallback is called with the result of the last
+ executed statement. \c resultCallback can be any of a function pointer, a functor or a lambda,
+ and it is expected to take a QVariant parameter. For example:
+
+ \code
+ page.runJavaScript("document.title", [](const QVariant &v) { qDebug() << v.toString(); });
+ \endcode
+
+ Only plain data can be returned from JavaScript as the result value.
+ Supported data types include all of the JSON data types as well as, for
+ example, \c{Date} and \c{ArrayBuffer}. Unsupported data types include, for
+ example, \c{Function} and \c{Promise}.
+
+ \warning Do not execute lengthy routines in the callback function, because it might block the
+ rendering of the web engine page.
+
+ \warning We guarantee that the callback (\a resultCallback) is always called, but it might be done
+ during page destruction. When QWebEnginePage is deleted, the callback is triggered with an invalid
+ value and it is not safe to use the corresponding QWebEnginePage or QWebEngineView instance inside it.
+
+ \sa scripts(), QWebEngineScript::ScriptWorldId, {Script Injection}
+*/
+
+/*!
+ \fn void QWebEnginePage::setFeaturePermission(const QUrl &securityOrigin, Feature feature, PermissionPolicy policy)
+
+ Sets the permission for the web site identified by \a securityOrigin to use \a feature to \a policy.
+
+ \note This method is primarily for calling after a featurePermissionRequested() signal has been emitted
+ to trigger the feature permission response. It can also be called before a request has been emitted,
+ but will only set a granted permission for passive checks, mainly for Notification APIs that can check
+ if permission has already been granted before explicitly requesting it.
+
+ \sa featurePermissionRequested(), featurePermissionRequestCanceled()
+*/
+
+/*!
+ \fn void QWebEnginePage::featurePermissionRequested(const QUrl &securityOrigin, Feature feature)
+
+ This signal is emitted when the web site identified by \a securityOrigin requests to make use of
+ the resource or device identified by \a feature.
+
+ \sa featurePermissionRequestCanceled(), setFeaturePermission()
+*/
+
+/*!
+ \fn void QWebEnginePage::featurePermissionRequestCanceled(const QUrl &securityOrigin, Feature feature)
+
+ This signal is emitted when the web site identified by \a securityOrigin cancels a previously issued
+ request to make use of \a feature.
+
+ \sa featurePermissionRequested(), setFeaturePermission()
+
+*/
+
+/*!
+ \fn void QWebEnginePage::titleChanged(const QString &title)
+
+ This signal is emitted whenever the title of the page changes.
+ The \a title string specifies the new title.
+
+ \sa title()
+*/
+
+/*!
+ \fn void QWebEnginePage::urlChanged(const QUrl &url)
+
+ This signal is emitted with the URL of the page when the page title is
+ received. The new URL is specified by \a url.
+
+ \sa url()
+*/
+
+/*!
+ \fn void QWebEnginePage::webAuthUxRequested(QWebEngineWebAuthUxRequest *request);
+ \since 6.7
+
+ This signal is emitted when a WebAuth authenticator needs user interaction
+ during the authentication process. These requests are handled by displaying a dialog to the user.
+
+ The \a request contains the information and API required to complete the WebAuth UX request.
+
+ \sa QWebEngineWebAuthUxRequest
+*/
diff --git a/src/core/doc/src/qwebenginesettings_lgpl.qdoc b/src/core/doc/src/qwebenginesettings_lgpl.qdoc
new file mode 100644
index 000000000..cd7ff8e8c
--- /dev/null
+++ b/src/core/doc/src/qwebenginesettings_lgpl.qdoc
@@ -0,0 +1,332 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+// The documentation in this file was imported from QtWebKit and is thus constrained
+// by its LGPL license. Documentation written from scratch for new methods should be
+// placed inline in the code as usual.
+
+/*!
+ \class QWebEngineSettings
+ \since 5.4
+ \brief The QWebEngineSettings class provides an object to store the settings used
+ by QWebEnginePage.
+
+ \inmodule QtWebEngineCore
+
+ QWebEngineSettings allows configuration of browser properties, such as font sizes and
+ families, and generic attributes, such as JavaScript support.
+ Individual attributes are set using the setAttribute() function. The
+ \l{QWebEngineSettings::WebAttribute}{WebAttribute} enum further describes each attribute.
+
+ Each QWebEnginePage object has its own QWebEngineSettings object, which configures the
+ settings for that page. If a setting is not configured for a web engine
+ page, it is looked up in the settings of the profile the page belongs to.
+
+ \sa QWebEnginePage::settings(), QWebEngineView::settings()
+*/
+
+/*!
+ \enum QWebEngineSettings::FontFamily
+
+ This enum describes the generic font families defined by CSS 2.
+ For more information see the
+ \l{http://www.w3.org/TR/REC-CSS2/fonts.html#generic-font-families}{CSS standard}.
+
+ \value StandardFont
+ \value FixedFont
+ \value SerifFont
+ \value SansSerifFont
+ \value CursiveFont
+ \value FantasyFont
+ \value PictographFont
+ (added in Qt 5.7, deprecated Qt 6.4)
+*/
+
+/*!
+ \enum QWebEngineSettings::FontSize
+
+ This enum describes the font sizes configurable through QWebEngineSettings:
+
+ \value MinimumFontSize The hard minimum font size.
+ \value MinimumLogicalFontSize The minimum logical font size that is applied
+ when zooming out.
+ \value DefaultFontSize The default font size for regular text.
+ \value DefaultFixedFontSize The default font size for fixed-pitch text.
+*/
+
+/*!
+ \enum QWebEngineSettings::WebAttribute
+
+ This enum type specifies settings for web pages:
+
+ \value AutoLoadImages
+ Automatically dowloads images for web pages. When this setting is
+ disabled, images are loaded from the cache. Enabled by default.
+ \value JavascriptEnabled
+ Enables the running of JavaScript programs in the
+ \l{QWebEngineScript::MainWorld}{MainWorld}. Enabled by default.
+ \value JavascriptCanOpenWindows
+ Allows JavaScript programs to open popup windows without user
+ interaction. Enabled by default.
+ \value JavascriptCanAccessClipboard
+ Allows JavaScript programs to read from and write to the clipboard.
+ Writing to the clipboard is always allowed if it is specifically requested by the user.
+ See JavascriptCanPaste to also allow pasting the content of the clipboard content from
+ JavaScript. Since unrestricted clipboard access is a potential security concern, it is
+ recommended that applications leave this disabled and instead respond to
+ \l{QWebEnginePage::ClipboardReadWrite}{ClipboardReadWrite} feature permission requests.
+ Disabled by default.
+ \value LinksIncludedInFocusChain
+ Includes hyperlinks in the keyboard focus chain. Enabled by default.
+ \value LocalStorageEnabled
+ Enables support for the HTML 5 local storage feature. Enabled by default.
+ \value LocalContentCanAccessRemoteUrls
+ Allows local origin documents to access remote resources that would normally be blocked.
+ Disabled by default. Note DnsPrefetchEnabled below operates independently of this setting,
+ and can if enabled, cause remote accesses from local content.
+ \value XSSAuditingEnabled
+ Obsolete and has no effect.
+ \value SpatialNavigationEnabled
+ Enables the Spatial Navigation feature, which means the ability to navigate between
+ focusable elements, such as hyperlinks and form controls, on a web page by using the
+ Left, Right, Up and Down arrow keys. For example, if a user presses the
+ Right key, heuristics determine whether there is an element they might be
+ trying to reach towards the right and which element they probably want.
+ Disabled by default.
+ \value LocalContentCanAccessFileUrls
+ Allows locally loaded documents to access other local URLs. Disabling this makes QtWebEngine
+ behave more like Chrome and Firefox does by default. Enabled by default.
+ \value HyperlinkAuditingEnabled
+ Enables support for the \c ping attribute for hyperlinks. Disabled by default.
+ \value ScrollAnimatorEnabled
+ Enables animated scrolling. Disabled by default.
+ \value ErrorPageEnabled
+ Enables displaying the built-in error pages of Chromium. Enabled by default.
+ \value PluginsEnabled
+ Enables support for Pepper plugins, such as the Flash player. Disabled by default.
+ See also \l{Pepper Plugin API}. (Added in Qt 5.6)
+ \value FullScreenSupportEnabled
+ Enables fullscreen support in an application. Disabled by default. (Added in Qt 5.6)
+ \value ScreenCaptureEnabled
+ Enables screen capture in an application. Disabled by default. (Added in Qt 5.7)
+ \value WebGLEnabled
+ Enables support for HTML 5 WebGL. Enabled by default if available. (Added in Qt 5.7)
+ \value Accelerated2dCanvasEnabled
+ Specifies whether the HTML5 2D canvas should be a OpenGL framebuffer.
+ This makes many painting operations faster, but slows down pixel access. Enabled by default if available. (Added in Qt 5.7)
+ \value AutoLoadIconsForPage
+ Automatically downloads icons for web pages. Enabled by default. (Added in Qt 5.7)
+ \value TouchIconsEnabled
+ Enables support for touch icons and precomposed touch icons
+ Disabled by default. (Added in Qt 5.7)
+ \value FocusOnNavigationEnabled
+ Gives focus to the view associated with the page, whenever a navigation operation occurs
+ (load, stop, reload, reload and bypass cache, forward, backward, set content, and so
+ on).
+ Disabled by default. (Added in Qt 5.8)
+ \value PrintElementBackgrounds
+ Turns on printing of CSS backgrounds when printing a web page.
+ Enabled by default. (Added in Qt 5.8)
+ \value AllowRunningInsecureContent
+ By default, HTTPS pages cannot run JavaScript, CSS, plugins or
+ web-sockets from HTTP URLs. This provides an override to get
+ the old insecure behavior.
+ Disabled by default. (Added in Qt 5.8)
+ \value AllowGeolocationOnInsecureOrigins
+ Since Qt 5.7, only secure origins such as HTTPS have been able to request
+ Geolocation features. This provides an override to allow non secure
+ origins to access Geolocation again.
+ Disabled by default. (Added in Qt 5.9)
+ \value AllowWindowActivationFromJavaScript
+ Allows activating windows by using the window.focus() JavaScript
+ method. Disabled by default.
+ (Added in Qt 5.10)
+ \value ShowScrollBars
+ Shows scroll bars.
+ Enabled by default. (Added in Qt 5.10)
+ \value PlaybackRequiresUserGesture
+ Inhibits playback of media content until the user interacts with
+ the page. By default, WebEngine uses Chromium settings, as described
+ in \l {Autoplay Policy Changes}. This is similar to how Chrome on
+ Android behaves, while the default behavior when it is disabled is
+ similar to Chrome on desktops. To overwrite the default behavior,
+ disable this setting. (Added in Qt 5.11)
+ \value JavascriptCanPaste
+ Enables JavaScript \c{execCommand("paste")}. This also requires enabling
+ JavascriptCanAccessClipboard. Since unrestricted clipboard access is a potential
+ security concern, it is recommended that applications leave this disabled
+ and instead respond to \l{QWebEnginePage::ClipboardReadWrite}{ClipboardReadWrite}
+ feature permission requests.
+ Disabled by default. (Added in Qt 5.11)
+ \value WebRTCPublicInterfacesOnly
+ Limits WebRTC to public IP addresses only. When disabled WebRTC may also use
+ local network IP addresses, but remote hosts can also see your local network
+ IP address.
+ Disabled by default. (Added in Qt 5.11)
+ \value DnsPrefetchEnabled Specifies whether WebEngine will try to pre-fetch DNS entries to
+ speed up browsing.
+ Disabled by default. (Added in Qt 5.12)
+ \value PdfViewerEnabled Specifies that PDF documents will be opened in the internal PDF viewer
+ instead of being downloaded.
+ Enabled by default. (Added in Qt 5.13)
+ \value NavigateOnDropEnabled Specifies that navigations can be triggered by dropping URLs on
+ the view.
+ Enabled by default. (Added in Qt 6.4)
+ \value ReadingFromCanvasEnabled Specifies that reading from all canvas elements is enabled.
+ This setting will have impact on all HTML5 canvas elements irrespective of origin, and can be disabled
+ to prevent canvas fingerprinting.
+ Enabled by default. (Added in Qt 6.6)
+ \value ForceDarkMode Specifies that all web contents will be rendered using a dark theme.
+ For more information, see \l{https://developer.chrome.com/blog/auto-dark-theme/}{Auto dark theme}.
+ Disabled by default. (Added in Qt 6.7)
+*/
+
+/*!
+ \enum QWebEngineSettings::UnknownUrlSchemePolicy
+ \since Qt 5.11
+
+ This enum describes how navigation requests to URLs with unknown schemes are handled.
+
+ \value DisallowUnknownUrlSchemes
+ Disallows all navigation requests to URLs with unknown schemes.
+ \value AllowUnknownUrlSchemesFromUserInteraction
+ Allows navigation requests to URLs with unknown schemes that are issued from
+ user-interaction (like a mouse-click), whereas other navigation requests (for example
+ from JavaScript) are suppressed.
+ \value AllowAllUnknownUrlSchemes
+ Allows all navigation requests to URLs with unknown schemes.
+ \omitvalue InheritedUnknownUrlSchemePolicy
+
+ \sa unknownUrlSchemePolicy setUnknownUrlSchemePolicy resetUnknownUrlSchemePolicy
+*/
+
+/*!
+ \enum QWebEngineSettings::ImageAnimationPolicy
+ \since Qt 6.8
+
+ This enum describes how an image animation should be handled when the image frames
+ are rendered for animation.
+
+ \value AllowImageAnimation
+ Allows image animation when the image frames are rendered.
+ \value AnimateImageOnce
+ Animate the image once when the image frames are rendered.
+ \value DisallowImageAnimation
+ Disallows image animation when the image frames are rendered.
+ \omitvalue InheritedImageAnimationPolicy
+
+ \sa imageAnimationPolicy setImageAnimationPolicy resetImageAnimationPolicy
+*/
+
+/*!
+ \fn void QWebEngineSettings::setFontSize(FontSize type, int size)
+ Sets the font size for \a type to \a size in pixels.
+*/
+
+/*!
+ \fn int QWebEngineSettings::fontSize(FontSize type) const
+ Returns the default font size for \a type in pixels.
+*/
+
+/*!
+ \fn void QWebEngineSettings::resetFontSize(FontSize type)
+ Resets the font size for \a type to the size specified in the profile that
+ the page belongs to.
+*/
+
+/*!
+ \fn void QWebEngineSettings::setDefaultTextEncoding(const QString& encoding)
+ Specifies the default text encoding system.
+
+ The value of \a encoding must be a string describing an encoding such as "utf-8" or
+ "iso-8859-1". If left empty, a default value will be used. For a more
+ extensive list of encoding names see \l{QTextCodec}.
+
+ \sa defaultTextEncoding()
+*/
+
+/*!
+ \fn QString QWebEngineSettings::defaultTextEncoding() const
+ Returns the default text encoding.
+
+ \sa setDefaultTextEncoding()
+*/
+
+/*!
+ \fn QString QWebEngineSettings::fontFamily(FontFamily which) const
+ Returns the actual font family for the specified generic font family,
+ \a which.
+*/
+
+/*!
+ \fn void QWebEngineSettings::resetFontFamily(FontFamily which)
+ Resets the actual font family specified by \a which to the one specified
+ in the profile that the page belongs to.
+*/
+
+/*!
+ \fn QWebEngineSettings::UnknownUrlSchemePolicy QWebEngineSettings::unknownUrlSchemePolicy() const
+ \since Qt 5.11
+ Returns the currently selected policy for handling navigation requests to URLs with
+ unknown schemes. Default is \l{QWebEngineSettings::AllowUnknownUrlSchemesFromUserInteraction}.
+ \sa setUnknownUrlSchemePolicy resetUnknownUrlSchemePolicy
+*/
+
+/*!
+ \fn void QWebEngineSettings::setUnknownUrlSchemePolicy(QWebEngineSettings::UnknownUrlSchemePolicy policy)
+ \since Qt 5.11
+ Sets the policy for handling navigation requests to URLs with unknown schemes to \a policy.
+ Default is \l{QWebEngineSettings::AllowUnknownUrlSchemesFromUserInteraction}.
+ \sa unknownUrlSchemePolicy resetUnknownUrlSchemePolicy
+*/
+
+/*!
+ \fn void QWebEngineSettings::resetUnknownUrlSchemePolicy()
+ \since Qt 5.11
+ Removes the policy for handling navigation requests to URLs with unknown schemes.
+ \sa unknownUrlSchemePolicy setUnknownUrlSchemePolicy
+*/
+
+/*!
+ \fn void QWebEngineSettings::setAttribute(WebAttribute attribute, bool on)
+
+ Enables or disables the specified \a attribute feature depending on the
+ value of \a on.
+*/
+
+/*!
+ \fn bool QWebEngineSettings::testAttribute(WebAttribute attribute) const
+
+ Returns \c true if \a attribute is enabled; otherwise returns \c false.
+*/
+
+/*!
+ \fn void QWebEngineSettings::resetAttribute(WebAttribute attribute)
+
+ Resets the setting of \a attribute to the value specified in the
+ profile that the page belongs to.
+*/
+
+/*!
+ \fn QWebEngineSettings::ImageAnimationPolicy QWebEngineSettings::imageAnimationPolicy() const
+ \since Qt 6.8
+ Returns the currently selected policy for handling image animation when the image frames are rendered.
+ Default is \l{QWebEngineSettings::AllowImageAnimation}.
+ \sa setImageAnimationPolicy resetImageAnimationPolicy
+*/
+
+/*!
+ \fn void QWebEngineSettings::setImageAnimationPolicy(QWebEngineSettings::ImageAnimationPolicy policy)
+ \since Qt 6.8
+ Sets the policy for handling image animation when the image frames are rendered to \a policy.
+ Default is \l{QWebEngineSettings::AllowImageAnimation}.
+ \sa imageAnimationPolicy resetImageAnimationPolicy
+*/
+
+/*!
+ \fn void QWebEngineSettings::resetImageAnimationPolicy()
+ \since Qt 6.7
+ Removes the policy for handling image animation.
+ \sa imageAnimationPolicy setImageAnimationPolicy
+*/
diff --git a/src/core/download_manager_delegate_qt.cpp b/src/core/download_manager_delegate_qt.cpp
index ebf498fdf..c0fd0d3ee 100644
--- a/src/core/download_manager_delegate_qt.cpp
+++ b/src/core/download_manager_delegate_qt.cpp
@@ -1,46 +1,8 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "download_manager_delegate_qt.h"
-#include "base/files/file_util.h"
-#include "base/time/time_to_iso8601.h"
#include "content/public/browser/download_item_utils.h"
#include "content/public/browser/download_manager.h"
#include "content/public/browser/save_page_type.h"
@@ -49,9 +11,7 @@
#include "net/http/http_content_disposition.h"
#include <QDir>
-#include <QFile>
#include <QFileInfo>
-#include <QMap>
#include <QMimeDatabase>
#include <QStandardPaths>
@@ -68,7 +28,6 @@ DownloadManagerDelegateQt::DownloadManagerDelegateQt(ProfileAdapter *profileAdap
: m_profileAdapter(profileAdapter)
, m_currentId(0)
, m_weakPtrFactory(this)
- , m_nextDownloadIsUserRequested(false)
{
Q_ASSERT(m_profileAdapter);
}
@@ -77,30 +36,36 @@ DownloadManagerDelegateQt::~DownloadManagerDelegateQt()
{
}
-void DownloadManagerDelegateQt::GetNextId(const content::DownloadIdCallback& callback)
+void DownloadManagerDelegateQt::GetNextId(content::DownloadIdCallback callback)
{
- callback.Run(m_currentId);
+ std::move(callback).Run(m_currentId);
}
download::DownloadItem *DownloadManagerDelegateQt::findDownloadById(quint32 downloadId)
{
- content::DownloadManager* dlm = content::BrowserContext::GetDownloadManager(m_profileAdapter->profile());
+ content::DownloadManager *dlm = m_profileAdapter->profile()->GetDownloadManager();
return dlm->GetDownload(downloadId);
}
-void DownloadManagerDelegateQt::cancelDownload(const content::DownloadTargetCallback& callback)
+void DownloadManagerDelegateQt::cancelDownload(content::DownloadTargetCallback callback)
{
- callback.Run(base::FilePath(),
- download::DownloadItem::TARGET_DISPOSITION_PROMPT,
- download::DownloadDangerType::DOWNLOAD_DANGER_TYPE_MAYBE_DANGEROUS_CONTENT,
- base::FilePath(),
- download::DownloadInterruptReason::DOWNLOAD_INTERRUPT_REASON_USER_CANCELED);
+ std::move(callback).Run(base::FilePath(),
+ download::DownloadItem::TARGET_DISPOSITION_PROMPT,
+ download::DownloadDangerType::DOWNLOAD_DANGER_TYPE_MAYBE_DANGEROUS_CONTENT,
+ download::DownloadItem::UNKNOWN,
+ base::FilePath(),
+ base::FilePath(),
+ std::string(),
+ download::DownloadInterruptReason::DOWNLOAD_INTERRUPT_REASON_USER_CANCELED);
}
-void DownloadManagerDelegateQt::cancelDownload(quint32 downloadId)
+bool DownloadManagerDelegateQt::cancelDownload(quint32 downloadId)
{
- if (download::DownloadItem *download = findDownloadById(downloadId))
+ if (download::DownloadItem *download = findDownloadById(downloadId)) {
download->Cancel(/* user_cancel */ true);
+ return true;
+ }
+ return false;
}
void DownloadManagerDelegateQt::pauseDownload(quint32 downloadId)
@@ -121,8 +86,8 @@ void DownloadManagerDelegateQt::removeDownload(quint32 downloadId)
download->Remove();
}
-bool DownloadManagerDelegateQt::DetermineDownloadTarget(download::DownloadItem* item,
- const content::DownloadTargetCallback& callback)
+bool DownloadManagerDelegateQt::DetermineDownloadTarget(download::DownloadItem *item,
+ content::DownloadTargetCallback *callback)
{
m_currentId = item->GetId();
@@ -130,25 +95,47 @@ bool DownloadManagerDelegateQt::DetermineDownloadTarget(download::DownloadItem*
// will already return that the file exists. Forced file paths seem to be only used for
// store downloads and other special downloads, so they might never end up here anyway.
if (!item->GetForcedFilePath().empty()) {
- callback.Run(item->GetForcedFilePath(), download::DownloadItem::TARGET_DISPOSITION_PROMPT,
- download::DownloadDangerType::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, item->GetForcedFilePath(), download::DownloadInterruptReason::DOWNLOAD_INTERRUPT_REASON_NONE);
+ std::move(*callback).Run(item->GetForcedFilePath(), download::DownloadItem::TARGET_DISPOSITION_PROMPT,
+ download::DownloadDangerType::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
+ download::DownloadItem::VALIDATED,
+ item->GetForcedFilePath(),
+ item->GetFileNameToReportUser(),
+ item->GetMimeType(),
+ download::DownloadInterruptReason::DOWNLOAD_INTERRUPT_REASON_NONE);
return true;
}
- QString suggestedFilename = toQt(item->GetSuggestedFilename());
+ bool acceptedByDefault = false;
+ QString suggestedFilePath;
+ QString suggestedFilename;
+ bool isSavePageDownload = false;
+ WebContentsAdapterClient *adapterClient = nullptr;
+ if (content::WebContents *webContents = content::DownloadItemUtils::GetWebContents(item)) {
+ WebContentsDelegateQt *contentsDelegate = static_cast<WebContentsDelegateQt *>(webContents->GetDelegate());
+ adapterClient = contentsDelegate->adapterClient();
+ if (SavePageInfo *spi = contentsDelegate->savePageInfo()) {
+ // We end up here when saving non text-based files (MHTML, PDF or images)
+ suggestedFilePath = spi->requestedFilePath;
+ const QFileInfo fileInfo(suggestedFilePath);
+ if (fileInfo.isRelative()) {
+ const QDir downloadDir(m_profileAdapter->downloadPath());
+ suggestedFilePath = downloadDir.absoluteFilePath(suggestedFilePath);
+ }
+ suggestedFilename = fileInfo.fileName();
+
+ if (!suggestedFilePath.isEmpty() && !suggestedFilename.isEmpty())
+ acceptedByDefault = true;
+ isSavePageDownload = true;
+
+ // Clear the delegate's SavePageInfo. It's only valid for the page currently being saved.
+ contentsDelegate->setSavePageInfo(nullptr);
+ }
+ }
+
QString mimeTypeString = toQt(item->GetMimeType());
- int downloadType = 0;
- if (m_nextDownloadIsUserRequested) {
- downloadType = ProfileAdapterClient::UserRequested;
- m_nextDownloadIsUserRequested = false;
- } else {
- bool isAttachment = net::HttpContentDisposition(item->GetContentDisposition(), std::string()).is_attachment();
- if (isAttachment)
- downloadType = ProfileAdapterClient::Attachment;
- else
- downloadType = ProfileAdapterClient::DownloadAttribute;
- }
+ if (suggestedFilename.isEmpty())
+ suggestedFilename = toQt(item->GetSuggestedFilename());
if (suggestedFilename.isEmpty())
suggestedFilename = toQt(net::HttpContentDisposition(item->GetContentDisposition(), net::kCharsetLatin1).filename());
@@ -156,8 +143,11 @@ bool DownloadManagerDelegateQt::DetermineDownloadTarget(download::DownloadItem*
if (suggestedFilename.isEmpty())
suggestedFilename = toQt(item->GetTargetFilePath().AsUTF8Unsafe());
- if (suggestedFilename.isEmpty())
- suggestedFilename = QUrl::fromPercentEncoding(toQByteArray(item->GetURL().ExtractFileName()));
+ if (suggestedFilename.isEmpty()) {
+ GURL itemUrl = item->GetURL();
+ if (!itemUrl.SchemeIs("about") && !itemUrl.SchemeIs("data"))
+ suggestedFilename = QUrl::fromPercentEncoding(toQByteArray(itemUrl.ExtractFileName()));
+ }
if (suggestedFilename.isEmpty()) {
suggestedFilename = QStringLiteral("qwe_download");
@@ -168,16 +158,12 @@ bool DownloadManagerDelegateQt::DetermineDownloadTarget(download::DownloadItem*
QDir defaultDownloadDirectory(m_profileAdapter->downloadPath());
- QString suggestedFilePath = m_profileAdapter->determineDownloadPath(defaultDownloadDirectory.absolutePath(), suggestedFilename, item->GetStartTime().ToTimeT());
+ if (suggestedFilePath.isEmpty())
+ suggestedFilePath = m_profileAdapter->determineDownloadPath(defaultDownloadDirectory.absolutePath(), suggestedFilename, item->GetStartTime().ToTimeT());
item->AddObserver(this);
QList<ProfileAdapterClient*> clients = m_profileAdapter->clients();
if (!clients.isEmpty()) {
- content::WebContents *webContents = content::DownloadItemUtils::GetWebContents(item);
- WebContentsAdapterClient *adapterClient = nullptr;
- if (webContents)
- adapterClient = static_cast<WebContentsDelegateQt *>(webContents->GetDelegate())->adapterClient();
-
Q_ASSERT(m_currentId == item->GetId());
ProfileAdapterClient::DownloadItemInfo info = {
item->GetId(),
@@ -188,17 +174,17 @@ bool DownloadManagerDelegateQt::DetermineDownloadTarget(download::DownloadItem*
mimeTypeString,
suggestedFilePath,
ProfileAdapterClient::UnknownSavePageFormat,
- false /* accepted */,
+ acceptedByDefault,
false /* paused */,
false /* done */,
- downloadType,
+ isSavePageDownload,
item->GetLastReason(),
adapterClient,
suggestedFilename,
item->GetStartTime().ToTimeT()
};
- for (ProfileAdapterClient *client : qAsConst(clients)) {
+ for (ProfileAdapterClient *client : std::as_const(clients)) {
client->downloadRequested(info);
if (info.accepted)
break;
@@ -207,23 +193,34 @@ bool DownloadManagerDelegateQt::DetermineDownloadTarget(download::DownloadItem*
QFileInfo suggestedFile(info.path);
if (info.accepted && !suggestedFile.absoluteDir().mkpath(suggestedFile.absolutePath())) {
+#if defined(Q_OS_WIN)
+ // TODO: Remove this when https://bugreports.qt.io/browse/QTBUG-85997 is fixed.
+ QDir suggestedDir = QDir(suggestedFile.absolutePath());
+ if (!suggestedDir.isRoot() || !suggestedDir.exists()) {
+#endif
qWarning("Creating download path failed, download cancelled: %s", suggestedFile.absolutePath().toUtf8().data());
info.accepted = false;
+#if defined(Q_OS_WIN)
+ }
+#endif
}
if (!info.accepted) {
- cancelDownload(callback);
+ cancelDownload(std::move(*callback));
return true;
}
base::FilePath filePathForCallback(toFilePathString(suggestedFile.absoluteFilePath()));
- callback.Run(filePathForCallback,
- download::DownloadItem::TARGET_DISPOSITION_OVERWRITE,
- download::DownloadDangerType::DOWNLOAD_DANGER_TYPE_MAYBE_DANGEROUS_CONTENT,
- filePathForCallback.AddExtension(toFilePathString("download")),
- download::DownloadInterruptReason::DOWNLOAD_INTERRUPT_REASON_NONE);
+ std::move(*callback).Run(filePathForCallback,
+ download::DownloadItem::TARGET_DISPOSITION_OVERWRITE,
+ download::DownloadDangerType::DOWNLOAD_DANGER_TYPE_MAYBE_DANGEROUS_CONTENT,
+ download::DownloadItem::VALIDATED,
+ filePathForCallback.AddExtension(toFilePathString("download")),
+ base::FilePath(),
+ item->GetMimeType(),
+ download::DownloadInterruptReason::DOWNLOAD_INTERRUPT_REASON_NONE);
} else
- cancelDownload(callback);
+ cancelDownload(std::move(*callback));
return true;
}
@@ -250,12 +247,18 @@ void DownloadManagerDelegateQt::ChooseSavePath(content::WebContents *web_content
if (clients.isEmpty())
return;
+ bool acceptedByDefault = false;
+ QString suggestedFilePath;
+ ProfileAdapterClient::SavePageFormat suggestedSaveFormat = ProfileAdapterClient::UnknownSavePageFormat;
WebContentsDelegateQt *contentsDelegate = static_cast<WebContentsDelegateQt *>(
web_contents->GetDelegate());
- const SavePageInfo &spi = contentsDelegate->savePageInfo();
+ if (SavePageInfo *spi = contentsDelegate->savePageInfo()) {
+ suggestedFilePath = spi->requestedFilePath;
+ suggestedSaveFormat = static_cast<ProfileAdapterClient::SavePageFormat>(spi->requestedFormat);
+ // Clear the delegate's SavePageInfo. It's only valid for the page currently being saved.
+ contentsDelegate->setSavePageInfo(nullptr);
+ }
- bool acceptedByDefault = false;
- QString suggestedFilePath = spi.requestedFilePath;
if (suggestedFilePath.isEmpty()) {
suggestedFilePath = QFileInfo(toQt(suggested_path.AsUTF8Unsafe())).completeBaseName()
+ QStringLiteral(".mhtml");
@@ -267,14 +270,9 @@ void DownloadManagerDelegateQt::ChooseSavePath(content::WebContents *web_content
suggestedFilePath = downloadDir.absoluteFilePath(suggestedFilePath);
}
- ProfileAdapterClient::SavePageFormat suggestedSaveFormat
- = static_cast<ProfileAdapterClient::SavePageFormat>(spi.requestedFormat);
if (suggestedSaveFormat == ProfileAdapterClient::UnknownSavePageFormat)
suggestedSaveFormat = ProfileAdapterClient::MimeHtmlSaveFormat;
- // Clear the delegate's SavePageInfo. It's only valid for the page currently being saved.
- contentsDelegate->setSavePageInfo(SavePageInfo());
-
WebContentsAdapterClient *adapterClient = nullptr;
if (web_contents)
adapterClient = static_cast<WebContentsDelegateQt *>(web_contents->GetDelegate())->adapterClient();
@@ -284,7 +282,7 @@ void DownloadManagerDelegateQt::ChooseSavePath(content::WebContents *web_content
++m_currentId,
toQt(web_contents->GetURL()),
download::DownloadItem::IN_PROGRESS,
- 0, /* totalBytes */
+ -1, /* totalBytes */
0, /* receivedBytes */
QStringLiteral("application/x-mimearchive"),
suggestedFilePath,
@@ -292,14 +290,14 @@ void DownloadManagerDelegateQt::ChooseSavePath(content::WebContents *web_content
acceptedByDefault,
false, /* paused */
false, /* done */
- ProfileAdapterClient::SavePage,
+ true, /* isSavePageDownload */
ProfileAdapterClient::NoReason,
adapterClient,
QFileInfo(suggestedFilePath).fileName(),
QDateTime::currentMSecsSinceEpoch()
};
- for (ProfileAdapterClient *client : qAsConst(clients)) {
+ for (ProfileAdapterClient *client : std::as_const(clients)) {
client->downloadRequested(info);
if (info.accepted)
break;
@@ -309,8 +307,8 @@ void DownloadManagerDelegateQt::ChooseSavePath(content::WebContents *web_content
return;
std::move(callback).Run(toFilePath(info.path), static_cast<content::SavePageType>(info.savePageFormat),
- base::Bind(&DownloadManagerDelegateQt::savePackageDownloadCreated,
- m_weakPtrFactory.GetWeakPtr()));
+ base::BindOnce(&DownloadManagerDelegateQt::savePackageDownloadCreated,
+ m_weakPtrFactory.GetWeakPtr()));
}
void DownloadManagerDelegateQt::savePackageDownloadCreated(download::DownloadItem *item)
@@ -347,7 +345,7 @@ void DownloadManagerDelegateQt::OnDownloadUpdated(download::DownloadItem *downlo
download->GetStartTime().ToTimeT()
};
- for (ProfileAdapterClient *client : qAsConst(clients)) {
+ for (ProfileAdapterClient *client : std::as_const(clients)) {
client->downloadUpdated(info);
}
}
diff --git a/src/core/download_manager_delegate_qt.h b/src/core/download_manager_delegate_qt.h
index 0cdbd6ee3..cc6d49764 100644
--- a/src/core/download_manager_delegate_qt.h
+++ b/src/core/download_manager_delegate_qt.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef DOWNLOAD_MANAGER_DELEGATE_QT_H
#define DOWNLOAD_MANAGER_DELEGATE_QT_H
@@ -60,8 +24,6 @@ class DownloadItem;
namespace QtWebEngineCore {
class ProfileAdapter;
-class DownloadManagerDelegateInstance;
-class DownloadTargetHelper;
class DownloadManagerDelegateQt
: public content::DownloadManagerDelegate
@@ -70,10 +32,10 @@ class DownloadManagerDelegateQt
public:
DownloadManagerDelegateQt(ProfileAdapter *profileAdapter);
~DownloadManagerDelegateQt();
- void GetNextId(const content::DownloadIdCallback& callback) override;
+ void GetNextId(content::DownloadIdCallback callback) override;
- bool DetermineDownloadTarget(download::DownloadItem* item,
- const content::DownloadTargetCallback& callback) override;
+ bool DetermineDownloadTarget(download::DownloadItem *item,
+ content::DownloadTargetCallback *callback) override;
void GetSaveDir(content::BrowserContext* browser_context,
base::FilePath* website_save_dir,
@@ -84,32 +46,25 @@ public:
bool can_save_as_complete,
content::SavePackagePathPickedCallback callback) override;
- void cancelDownload(quint32 downloadId);
+ bool cancelDownload(quint32 downloadId);
void pauseDownload(quint32 downloadId);
void resumeDownload(quint32 downloadId);
void removeDownload(quint32 downloadId);
- void markNextDownloadAsUserRequested() { m_nextDownloadIsUserRequested = true; }
-
// Inherited from content::DownloadItem::Observer
void OnDownloadUpdated(download::DownloadItem *download) override;
void OnDownloadDestroyed(download::DownloadItem *download) override;
private:
- void cancelDownload(const content::DownloadTargetCallback& callback);
+ void cancelDownload(content::DownloadTargetCallback callback);
download::DownloadItem *findDownloadById(quint32 downloadId);
void savePackageDownloadCreated(download::DownloadItem *download);
ProfileAdapter *m_profileAdapter;
uint32_t m_currentId;
base::WeakPtrFactory<DownloadManagerDelegateQt> m_weakPtrFactory;
- bool m_nextDownloadIsUserRequested;
-
- friend class DownloadManagerDelegateInstance;
- friend class ProfileAdapter;
- DISALLOW_COPY_AND_ASSIGN(DownloadManagerDelegateQt);
};
} // namespace QtWebEngineCore
-#endif //DOWNLOAD_MANAGER_DELEGATE_QT_H
+#endif // DOWNLOAD_MANAGER_DELEGATE_QT_H
diff --git a/src/core/extensions/component_extension_resource_manager_qt.cpp b/src/core/extensions/component_extension_resource_manager_qt.cpp
index 1f58de151..428f673d3 100644
--- a/src/core/extensions/component_extension_resource_manager_qt.cpp
+++ b/src/core/extensions/component_extension_resource_manager_qt.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// based on chrome/browser/extensions/chrome_component_extension_resource_manager.cc:
// Copyright 2014 The Chromium Authors. All rights reserved.
@@ -44,12 +8,24 @@
#include "component_extension_resource_manager_qt.h"
-#include "base/logging.h"
+#include "base/check.h"
+#include "base/containers/contains.h"
#include "base/path_service.h"
#include "base/stl_util.h"
#include "base/values.h"
-
#include "chrome/grit/component_extension_resources_map.h"
+#include "content/public/browser/browser_thread.h"
+#include "extensions/common/constants.h"
+#include "pdf/buildflags.h"
+#include "ppapi/buildflags/buildflags.h"
+
+#if BUILDFLAG(ENABLE_PLUGINS)
+#include "chrome/grit/pdf_resources_map.h"
+#endif
+
+#if BUILDFLAG(ENABLE_PDF)
+#include "qtwebengine/browser/pdf/pdf_extension_util.h"
+#endif // BUILDFLAG(ENABLE_PDF)
namespace extensions {
@@ -57,6 +33,18 @@ ComponentExtensionResourceManagerQt::ComponentExtensionResourceManagerQt()
{
AddComponentResourceEntries(kComponentExtensionResources,
kComponentExtensionResourcesSize);
+#if BUILDFLAG(ENABLE_PLUGINS)
+ AddComponentResourceEntries(kPdfResources, kPdfResourcesSize);
+#endif
+#if BUILDFLAG(ENABLE_PDF)
+ base::Value::Dict dict;
+ pdf_extension_util::AddStrings(pdf_extension_util::PdfViewerContext::kPdfViewer, &dict);
+ pdf_extension_util::AddAdditionalData(/*enable_annotations=*/true, &dict);
+
+ ui::TemplateReplacements pdf_viewer_replacements;
+ ui::TemplateReplacementsFromDictionaryValue(dict, &pdf_viewer_replacements);
+ template_replacements_[extension_misc::kPdfExtensionId] = std::move(pdf_viewer_replacements);
+#endif
}
ComponentExtensionResourceManagerQt::~ComponentExtensionResourceManagerQt() {}
@@ -85,24 +73,25 @@ bool ComponentExtensionResourceManagerQt::IsComponentExtensionResource(const bas
return false;
}
-const ui::TemplateReplacements *ComponentExtensionResourceManagerQt::GetTemplateReplacementsForExtension(const std::string &) const
+const ui::TemplateReplacements *ComponentExtensionResourceManagerQt::GetTemplateReplacementsForExtension(const std::string &extension_id) const
{
- return nullptr;
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ auto it = template_replacements_.find(extension_id);
+ return it != template_replacements_.end() ? &it->second : nullptr;
}
-void ComponentExtensionResourceManagerQt::AddComponentResourceEntries(const GritResourceMap *entries, size_t size)
+void ComponentExtensionResourceManagerQt::AddComponentResourceEntries(const webui::ResourcePath *entries, size_t size)
{
base::FilePath gen_folder_path = base::FilePath().AppendASCII("@out_folder@/gen/chrome/browser/resources/");
gen_folder_path = gen_folder_path.NormalizePathSeparators();
for (size_t i = 0; i < size; ++i) {
- base::FilePath resource_path = base::FilePath().AppendASCII(entries[i].name);
+ base::FilePath resource_path = base::FilePath().AppendASCII(entries[i].path);
resource_path = resource_path.NormalizePathSeparators();
-
if (!gen_folder_path.IsParent(resource_path)) {
DCHECK(!base::Contains(path_to_resource_id_, resource_path));
- path_to_resource_id_[resource_path] = entries[i].value;
+ path_to_resource_id_[resource_path] = entries[i].id;
} else {
// If the resource is a generated file, strip the generated folder's path,
// so that it can be served from a normal URL (as if it were not
@@ -111,7 +100,7 @@ void ComponentExtensionResourceManagerQt::AddComponentResourceEntries(const Grit
base::FilePath().AppendASCII(resource_path.AsUTF8Unsafe().substr(
gen_folder_path.value().length()));
DCHECK(!base::Contains(path_to_resource_id_, effective_path));
- path_to_resource_id_[effective_path] = entries[i].value;
+ path_to_resource_id_[effective_path] = entries[i].id;
}
}
}
diff --git a/src/core/extensions/component_extension_resource_manager_qt.h b/src/core/extensions/component_extension_resource_manager_qt.h
index b719c8960..4da18890e 100644
--- a/src/core/extensions/component_extension_resource_manager_qt.h
+++ b/src/core/extensions/component_extension_resource_manager_qt.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
@@ -48,8 +12,7 @@
#include "base/files/file_path.h"
#include "extensions/browser/component_extension_resource_manager.h"
-
-struct GritResourceMap;
+#include "ui/base/webui/resource_path.h"
namespace extensions {
@@ -66,13 +29,14 @@ public:
const ui::TemplateReplacements *GetTemplateReplacementsForExtension(const std::string &extension_id) const override;
private:
- void AddComponentResourceEntries(const GritResourceMap *entries, size_t size);
+ void AddComponentResourceEntries(const webui::ResourcePath *entries, size_t size);
// A map from a resource path to the resource ID. Used by
// IsComponentExtensionResource.
std::map<base::FilePath, int> path_to_resource_id_;
- DISALLOW_COPY_AND_ASSIGN(ComponentExtensionResourceManagerQt);
+ // A map from an extension ID to its i18n template replacements.
+ std::map<std::string, ui::TemplateReplacements> template_replacements_;
};
} // namespace extensions
diff --git a/src/core/extensions/extension_host_delegate_qt.cpp b/src/core/extensions/extension_host_delegate_qt.cpp
new file mode 100644
index 000000000..aa408a544
--- /dev/null
+++ b/src/core/extensions/extension_host_delegate_qt.cpp
@@ -0,0 +1,116 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "extension_host_delegate_qt.h"
+
+#include "desktop_media_controller.h"
+#include "desktop_media_controller_p.h"
+#include "extension_web_contents_observer_qt.h"
+#include "media_capture_devices_dispatcher.h"
+#include "extension_system_qt.h"
+#include "web_contents_view_qt.h"
+
+#include "base/functional/callback.h"
+#include "content/browser/web_contents/web_contents_impl.h"
+#include "extensions/browser/extension_host.h"
+#include "third_party/blink/public/mojom/mediastream/media_stream.mojom-shared.h"
+#include "third_party/blink/public/mojom/mediastream/media_stream.mojom.h"
+
+using namespace QtWebEngineCore;
+
+namespace extensions {
+
+ExtensionHostDelegateQt::ExtensionHostDelegateQt()
+{
+}
+
+void ExtensionHostDelegateQt::OnExtensionHostCreated(content::WebContents *web_contents)
+{
+ extensions::ExtensionWebContentsObserverQt::CreateForWebContents(web_contents);
+}
+
+void ExtensionHostDelegateQt::OnMainFrameCreatedForBackgroundPage(ExtensionHost *host)
+{
+ Q_UNUSED(host);
+}
+
+content::JavaScriptDialogManager *ExtensionHostDelegateQt::GetJavaScriptDialogManager()
+{
+ Q_UNREACHABLE();
+ return nullptr;
+}
+
+void ExtensionHostDelegateQt::CreateTab(std::unique_ptr<content::WebContents> web_contents,
+ const std::string &extension_id,
+ WindowOpenDisposition disposition,
+ const blink::mojom::WindowFeatures &features,
+ bool user_gesture)
+{
+ Q_UNUSED(web_contents);
+ Q_UNUSED(extension_id);
+ Q_UNUSED(disposition);
+ Q_UNUSED(features);
+ Q_UNUSED(user_gesture);
+
+ Q_UNREACHABLE();
+}
+
+static void processMediaAccessRequest(content::WebContents *webContents,
+ const content::MediaStreamRequest &request,
+ content::MediaResponseCallback callback,
+ content::DesktopMediaID id)
+{
+ MediaCaptureDevicesDispatcher::GetInstance()->processMediaAccessRequest(
+ webContents, request, std::move(callback), id);
+}
+
+void ExtensionHostDelegateQt::ProcessMediaAccessRequest(content::WebContents *web_contents,
+ const content::MediaStreamRequest &request,
+ content::MediaResponseCallback callback,
+ const Extension *extension)
+{
+ Q_UNUSED(extension);
+ base::OnceCallback<void(content::DesktopMediaID)> cb = base::BindOnce(
+ &processMediaAccessRequest, web_contents, std::move(request), std::move(callback));
+
+ // ownership is taken by the request
+ auto *controller = new DesktopMediaController(new DesktopMediaControllerPrivate(std::move(cb)));
+ base::WeakPtr<content::WebContents> webContents = web_contents->GetWeakPtr();
+ QObject::connect(controller, &DesktopMediaController::mediaListsInitialized, [controller, webContents]() {
+ if (webContents) {
+ auto *client = WebContentsViewQt::from(static_cast<content::WebContentsImpl *>(webContents.get())->GetView())->client();
+ client->desktopMediaRequested(controller);
+ } else {
+ controller->deleteLater();
+ }
+ });
+}
+
+bool ExtensionHostDelegateQt::CheckMediaAccessPermission(content::RenderFrameHost *render_frame_host,
+ const GURL &security_origin,
+ blink::mojom::MediaStreamType type,
+ const Extension *extension)
+{
+ Q_UNUSED(render_frame_host);
+ Q_UNUSED(security_origin);
+ Q_UNUSED(type);
+ Q_UNUSED(extension);
+
+ Q_UNREACHABLE();
+ return false;
+}
+
+content::PictureInPictureResult ExtensionHostDelegateQt::EnterPictureInPicture(content::WebContents *web_contents)
+{
+ Q_UNUSED(web_contents);
+
+ Q_UNREACHABLE();
+ return content::PictureInPictureResult::kNotSupported;
+}
+
+void ExtensionHostDelegateQt::ExitPictureInPicture()
+{
+ Q_UNREACHABLE();
+}
+
+} // namespace extensions
diff --git a/src/core/extensions/extension_host_delegate_qt.h b/src/core/extensions/extension_host_delegate_qt.h
new file mode 100644
index 000000000..1c2688933
--- /dev/null
+++ b/src/core/extensions/extension_host_delegate_qt.h
@@ -0,0 +1,39 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef EXTENSION_HOST_DELEGATE_QT_H
+#define EXTENSION_HOST_DELEGATE_QT_H
+
+#include "extensions/browser/extension_host_delegate.h"
+
+namespace extensions {
+
+class ExtensionHostDelegateQt : public ExtensionHostDelegate
+{
+public:
+ ExtensionHostDelegateQt();
+
+ // EtensionHostDelegate implementation.
+ void OnExtensionHostCreated(content::WebContents *web_contents) override;
+ void OnMainFrameCreatedForBackgroundPage(ExtensionHost *host) override;
+ content::JavaScriptDialogManager *GetJavaScriptDialogManager() override;
+ void CreateTab(std::unique_ptr<content::WebContents> web_contents,
+ const std::string &extension_id,
+ WindowOpenDisposition disposition,
+ const blink::mojom::WindowFeatures &features,
+ bool user_gesture) override;
+ void ProcessMediaAccessRequest(content::WebContents *web_contents,
+ const content::MediaStreamRequest &request,
+ content::MediaResponseCallback callback,
+ const Extension *extension) override;
+ bool CheckMediaAccessPermission(content::RenderFrameHost *render_frame_host,
+ const GURL &security_origin,
+ blink::mojom::MediaStreamType type,
+ const Extension *extension) override;
+ content::PictureInPictureResult EnterPictureInPicture(content::WebContents *web_contents) override;
+ void ExitPictureInPicture() override;
+};
+
+} // namespace extensions
+
+#endif // EXTENSION_HOST_DELEGATE_QT_H
diff --git a/src/core/extensions/extension_system_factory_qt.cpp b/src/core/extensions/extension_system_factory_qt.cpp
index 41ba31214..63d88fcaf 100644
--- a/src/core/extensions/extension_system_factory_qt.cpp
+++ b/src/core/extensions/extension_system_factory_qt.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
@@ -44,7 +8,6 @@
#include "extension_system_factory_qt.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
-#include "extensions/browser/declarative_user_script_manager_factory.h"
#include "extensions/browser/event_router_factory.h"
#include "extensions/browser/extension_prefs_factory.h"
#include "extensions/browser/extension_registry_factory.h"
diff --git a/src/core/extensions/extension_system_factory_qt.h b/src/core/extensions/extension_system_factory_qt.h
index 6e840b6d6..b6f6acc5d 100644
--- a/src/core/extensions/extension_system_factory_qt.h
+++ b/src/core/extensions/extension_system_factory_qt.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
@@ -44,7 +8,6 @@
#ifndef EXTENSION_SYSTEM_FACTORY_QT_H_
#define EXTENSION_SYSTEM_FACTORY_QT_H_
-#include "base/macros.h"
#include "base/memory/singleton.h"
#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
#include "extensions/browser/extension_system_provider.h"
@@ -73,8 +36,6 @@ private:
KeyedService *BuildServiceInstanceFor(content::BrowserContext *context) const override;
content::BrowserContext *GetBrowserContextToUse(content::BrowserContext *context) const override;
bool ServiceIsCreatedWithBrowserContext() const override;
-
- DISALLOW_COPY_AND_ASSIGN(ExtensionSystemFactoryQt);
};
} // namespace extensions
diff --git a/src/core/extensions/extension_system_qt.cpp b/src/core/extensions/extension_system_qt.cpp
index a66051fbd..b9f11646d 100644
--- a/src/core/extensions/extension_system_qt.cpp
+++ b/src/core/extensions/extension_system_qt.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
@@ -47,7 +11,7 @@
#include "base/base_paths.h"
#include "base/base_switches.h"
-#include "base/bind.h"
+#include "base/functional/bind.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
@@ -57,19 +21,21 @@
#include "base/path_service.h"
#include "base/strings/string_tokenizer.h"
#include "base/strings/utf_string_conversions.h"
-#include "base/task/post_task.h"
#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
+#include "chrome/common/buildflags.h"
#include "components/crx_file/id_util.h"
+#include "components/value_store/value_store_factory.h"
+#include "components/value_store/value_store_factory_impl.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
-#include "content/public/browser/plugin_service.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/url_data_source.h"
#include "content/public/common/webplugininfo.h"
+#include "extensions/browser/app_sorting.h"
#include "extensions/browser/content_verifier.h"
#include "extensions/browser/content_verifier_delegate.h"
#include "extensions/browser/extension_pref_store.h"
@@ -77,24 +43,24 @@
#include "extensions/browser/extension_pref_value_map_factory.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_registry.h"
-#include "extensions/browser/info_map.h"
-#include "extensions/browser/notification_types.h"
-#include "extensions/browser/null_app_sorting.h"
#include "extensions/browser/quota_service.h"
#include "extensions/browser/renderer_startup_helper.h"
-#include "extensions/browser/runtime_data.h"
-#include "extensions/browser/shared_user_script_master.h"
#include "extensions/browser/service_worker_manager.h"
-#include "extensions/browser/value_store/value_store_factory_impl.h"
+#include "extensions/browser/task_queue_util.h"
+#include "extensions/browser/user_script_manager.h"
#include "extensions/common/constants.h"
-#include "extensions/common/extension_messages.h"
#include "extensions/common/manifest_constants.h"
#include "extensions/common/manifest_handlers/mime_types_handler.h"
#include "extensions/common/manifest_url_handlers.h"
-#include "ui/base/resource/resource_bundle.h"
-#include "chrome/grit/component_extension_resources.h"
-#include "chrome/grit/browser_resources.h"
#include "net/base/mime_util.h"
+#include "pdf/buildflags.h"
+#include "ppapi/buildflags/buildflags.h"
+#include "qtwebengine/grit/qt_webengine_resources.h"
+#include "ui/base/resource/resource_bundle.h"
+
+#if BUILDFLAG(ENABLE_PLUGINS)
+#include "content/public/browser/plugin_service.h"
+#endif
using content::BrowserThread;
@@ -102,28 +68,28 @@ namespace extensions {
namespace {
-std::string GenerateId(const base::DictionaryValue *manifest, const base::FilePath &path)
+std::string GenerateId(const base::Value::Dict &manifest, const base::FilePath &path)
{
- std::string raw_key;
+ const std::string *raw_key;
std::string id_input;
- CHECK(manifest->GetString(manifest_keys::kPublicKey, &raw_key));
- CHECK(Extension::ParsePEMKeyBytes(raw_key, &id_input));
+ CHECK(raw_key = manifest.FindString(manifest_keys::kPublicKey));
+ CHECK(Extension::ParsePEMKeyBytes(*raw_key, &id_input));
std::string id = crx_file::id_util::GenerateId(id_input);
return id;
}
// Implementation based on ComponentLoader::ParseManifest.
-std::unique_ptr<base::DictionaryValue> ParseManifest(const std::string &manifest_contents)
+absl::optional<base::Value::Dict> ParseManifest(base::StringPiece manifest_contents)
{
JSONStringValueDeserializer deserializer(manifest_contents);
- std::unique_ptr<base::Value> manifest(deserializer.Deserialize(NULL, NULL));
+ std::unique_ptr<base::Value> manifest = deserializer.Deserialize(nullptr, nullptr);
if (!manifest.get() || !manifest->is_dict()) {
LOG(ERROR) << "Failed to parse extension manifest.";
- return NULL;
+ return absl::nullopt;
}
- // Transfer ownership to the caller.
- return base::DictionaryValue::From(std::move(manifest));
+
+ return std::move(*manifest).TakeDict();
}
} // namespace
@@ -162,38 +128,25 @@ public:
void Shutdown() override {}
};
-void ExtensionSystemQt::LoadExtension(std::string extension_id, std::unique_ptr<base::DictionaryValue> manifest, const base::FilePath &directory)
+void ExtensionSystemQt::LoadExtension(std::string extension_id, const base::Value::Dict &manifest, const base::FilePath &directory)
{
int flags = Extension::REQUIRE_KEY;
std::string error;
+
scoped_refptr<const Extension> extension = Extension::Create(
directory,
- Manifest::COMPONENT,
- *manifest,
+ mojom::ManifestLocation::kComponent,
+ manifest,
flags,
&error);
if (!extension.get())
LOG(ERROR) << error;
- base::PostTask(FROM_HERE, {content::BrowserThread::IO},
- base::Bind(&InfoMap::AddExtension,
- base::Unretained(info_map()),
- base::RetainedRef(extension),
- base::Time::Now(),
- true,
- false));
extension_registry_->AddEnabled(extension.get());
NotifyExtensionLoaded(extension.get());
}
-void ExtensionSystemQt::OnExtensionRegisteredWithRequestContexts(scoped_refptr<const extensions::Extension> extension)
-{
- extension_registry_->AddReady(extension);
- if (extension_registry_->enabled_extensions().Contains(extension->id()))
- extension_registry_->TriggerOnReady(extension.get());
-}
-
// Implementation based on ExtensionService::NotifyExtensionLoaded.
void ExtensionSystemQt::NotifyExtensionLoaded(const Extension *extension)
{
@@ -203,11 +156,7 @@ void ExtensionSystemQt::NotifyExtensionLoaded(const Extension *extension)
// that the request context doesn't yet know about. The profile is responsible
// for ensuring its URLRequestContexts appropriately discover the loaded
// extension.
- RegisterExtensionWithRequestContexts(
- extension,
- base::Bind(&ExtensionSystemQt::OnExtensionRegisteredWithRequestContexts,
- weak_ptr_factory_.GetWeakPtr(),
- base::WrapRefCounted(extension)));
+ ActivateTaskQueueForExtension(browser_context_, extension);
// Tell renderers about the loaded extension.
renderer_helper_->OnExtensionLoaded(*extension);
@@ -221,14 +170,18 @@ void ExtensionSystemQt::NotifyExtensionLoaded(const Extension *extension)
// know about it.
extension_registry_->TriggerOnLoaded(extension);
+#if BUILDFLAG(ENABLE_PLUGINS)
// Register plugins included with the extension.
// Implementation based on PluginManager::OnExtensionLoaded.
+ bool plugins_changed = false;
const MimeTypesHandler *handler = MimeTypesHandler::GetHandler(extension);
- if (handler && !handler->handler_url().empty()) {
+ if (handler && handler->HasPlugin()) {
+ plugins_changed = true;
content::WebPluginInfo info;
info.type = content::WebPluginInfo::PLUGIN_TYPE_BROWSER_PLUGIN;
info.name = base::UTF8ToUTF16(extension->name());
- info.path = base::FilePath::FromUTF8Unsafe(extension->url().spec());
+ info.path = handler->GetPluginPath();
+ info.background_color = handler->GetBackgroundColor();
for (std::set<std::string>::const_iterator mime_type = handler->mime_type_set().begin();
mime_type != handler->mime_type_set().end(); ++mime_type) {
content::WebPluginMimeType mime_type_info;
@@ -245,6 +198,13 @@ void ExtensionSystemQt::NotifyExtensionLoaded(const Extension *extension)
plugin_service->RefreshPlugins();
plugin_service->RegisterInternalPlugin(info, true);
}
+ if (plugins_changed)
+ content::PluginService::GetInstance()->PurgePluginListCache(browser_context_, false);
+#endif // BUILDFLAG(ENABLE_PLUGINS)
+
+ extension_registry_->AddReady(extension);
+ if (extension_registry_->enabled_extensions().Contains(extension->id()))
+ extension_registry_->TriggerOnReady(extension);
}
bool ExtensionSystemQt::FinishDelayedInstallationIfReady(const std::string &extension_id, bool install_immediately)
@@ -269,19 +229,14 @@ ExtensionService *ExtensionSystemQt::extension_service()
return nullptr;
}
-RuntimeData *ExtensionSystemQt::runtime_data()
-{
- return runtime_data_.get();
-}
-
ManagementPolicy *ExtensionSystemQt::management_policy()
{
return nullptr;
}
-SharedUserScriptMaster *ExtensionSystemQt::shared_user_script_master()
+UserScriptManager *ExtensionSystemQt::user_script_manager()
{
- return shared_user_script_master_.get();
+ return user_script_manager_.get();
}
StateStore *ExtensionSystemQt::state_store()
@@ -294,16 +249,14 @@ StateStore *ExtensionSystemQt::rules_store()
return nullptr;
}
-scoped_refptr<ValueStoreFactory> ExtensionSystemQt::store_factory()
+StateStore *ExtensionSystemQt::dynamic_user_scripts_store()
{
- return store_factory_;
+ return nullptr;
}
-InfoMap *ExtensionSystemQt::info_map()
+scoped_refptr<value_store::ValueStoreFactory> ExtensionSystemQt::store_factory()
{
- if (!info_map_.get())
- info_map_ = new InfoMap;
- return info_map_.get();
+ return store_factory_;
}
QuotaService *ExtensionSystemQt::quota_service()
@@ -313,7 +266,7 @@ QuotaService *ExtensionSystemQt::quota_service()
AppSorting *ExtensionSystemQt::app_sorting()
{
- return app_sorting_.get();
+ return nullptr;
}
ContentVerifier *ExtensionSystemQt::content_verifier()
@@ -326,7 +279,7 @@ ContentVerifier *ExtensionSystemQt::content_verifier()
ExtensionSystemQt::ExtensionSystemQt(content::BrowserContext *browserContext)
: browser_context_(browserContext)
- , store_factory_(new ValueStoreFactoryImpl(browserContext->GetPath()))
+ , store_factory_(new value_store::ValueStoreFactoryImpl(browserContext->GetPath()))
, extension_registry_(ExtensionRegistry::Get(browserContext))
, renderer_helper_(extensions::RendererStartupHelperFactory::GetForBrowserContext(browserContext))
, initialized_(false)
@@ -345,13 +298,9 @@ void ExtensionSystemQt::Init(bool extensions_enabled)
initialized_ = true;
- service_worker_manager_.reset(new ServiceWorkerManager(browser_context_));
- runtime_data_.reset(new RuntimeData(extension_registry_));
- quota_service_.reset(new QuotaService);
- app_sorting_.reset(new NullAppSorting);
-
- shared_user_script_master_ =
- std::make_unique<SharedUserScriptMaster>(browser_context_);
+ service_worker_manager_ = std::make_unique<ServiceWorkerManager>(browser_context_);
+ user_script_manager_ = std::make_unique<UserScriptManager>(browser_context_);
+ quota_service_ = std::make_unique<QuotaService>();
// Make the chrome://extension-icon/ resource available.
// content::URLDataSource::Add(browser_context_, new ExtensionIconSource(browser_context_));
@@ -359,20 +308,34 @@ void ExtensionSystemQt::Init(bool extensions_enabled)
if (extensions_enabled) {
// Inform the rest of the extensions system to start.
ready_.Signal();
- content::NotificationService::current()->Notify(
- NOTIFICATION_EXTENSIONS_READY_DEPRECATED,
- content::Source<content::BrowserContext>(browser_context_),
- content::NotificationService::NoDetails());
-
- std::string pdf_manifest = ui::ResourceBundle::GetSharedInstance().GetRawDataResource(IDR_PDF_MANIFEST).as_string();
- base::ReplaceFirstSubstringAfterOffset(&pdf_manifest, 0, "<NAME>", "chromium-pdf");
-
- std::unique_ptr<base::DictionaryValue> pdfManifestDict = ParseManifest(pdf_manifest);
- base::FilePath path;
- base::PathService::Get(base::DIR_QT_LIBRARY_DATA, &path);
- path = path.Append(base::FilePath(FILE_PATH_LITERAL("pdf")));
- std::string id = GenerateId(pdfManifestDict.get(), path);
- LoadExtension(id, std::move(pdfManifestDict), path);
+
+#if BUILDFLAG(ENABLE_PDF)
+ {
+ std::string pdf_manifest = ui::ResourceBundle::GetSharedInstance().LoadDataResourceString(IDR_PDF_MANIFEST);
+ base::ReplaceFirstSubstringAfterOffset(&pdf_manifest, 0, "<NAME>", "chromium-pdf");
+
+ auto pdfManifestDict = ParseManifest(pdf_manifest);
+ CHECK(pdfManifestDict);
+ base::FilePath path;
+ base::PathService::Get(base::DIR_QT_LIBRARY_DATA, &path);
+ path = path.Append(base::FilePath(FILE_PATH_LITERAL("pdf")));
+ std::string id = GenerateId(pdfManifestDict.value(), path);
+ LoadExtension(id, pdfManifestDict.value(), path);
+ }
+#endif // BUILDFLAG(ENABLE_PDF)
+
+#if BUILDFLAG(ENABLE_HANGOUT_SERVICES_EXTENSION)
+ {
+ std::string hangout_manifest = ui::ResourceBundle::GetSharedInstance().LoadDataResourceString(IDR_HANGOUT_SERVICES_MANIFEST);
+ auto hangoutManifestDict = ParseManifest(hangout_manifest);
+ CHECK(hangoutManifestDict);
+ base::FilePath path;
+ base::PathService::Get(base::DIR_QT_LIBRARY_DATA, &path);
+ path = path.Append(base::FilePath(FILE_PATH_LITERAL("hangout_services")));
+ std::string id = GenerateId(hangoutManifestDict.value(), path);
+ LoadExtension(id, hangoutManifestDict.value(), path);
+ }
+#endif // BUILDFLAG(ENABLE_HANGOUT_SERVICES_EXTENSION)
}
}
@@ -380,8 +343,6 @@ void ExtensionSystemQt::InitForRegularProfile(bool extensions_enabled)
{
if (initialized_)
return; // Already initialized.
- // The InfoMap needs to be created before the ProcessManager.
- info_map();
Init(extensions_enabled);
}
@@ -391,40 +352,9 @@ std::unique_ptr<ExtensionSet> ExtensionSystemQt::GetDependentExtensions(const Ex
return base::WrapUnique(new ExtensionSet());
}
-#if !defined(TOOLKIT_QT)
-void ExtensionSystemQt::InstallUpdate(const std::string &extension_id,
- const std::string &public_key,
- const base::FilePath &unpacked_dir,
- bool install_immediately,
- InstallUpdateCallback install_update_callback)
+bool ExtensionSystemQt::is_ready() const
{
- NOTREACHED() << "Not yet implemented";
- base::DeleteFile(unpacked_dir, true /* recursive */);
- std::move(install_update_callback).Run(CrxInstallError(CrxInstallErrorType::DECLINED, CrxInstallErrorDetail::DISALLOWED_BY_POLICY));
+ return ready_.is_signaled();
}
-#endif
-
-void ExtensionSystemQt::RegisterExtensionWithRequestContexts(const Extension *extension,
- const base::Closure &callback)
-{
- base::Time install_time = base::Time::Now();
-
- bool incognito_enabled = false;
- bool notifications_disabled = false;
- base::PostTaskAndReply(
- FROM_HERE, {BrowserThread::IO},
- base::Bind(&InfoMap::AddExtension, info_map(),
- base::RetainedRef(extension), install_time, incognito_enabled,
- notifications_disabled),
- callback);
-}
-
-void ExtensionSystemQt::UnregisterExtensionWithRequestContexts(const std::string &extension_id,
- const UnloadedExtensionReason reason)
-{
- base::PostTask(
- FROM_HERE, {BrowserThread::IO},
- base::Bind(&InfoMap::RemoveExtension, info_map(), extension_id, reason));
-}
} // namespace extensions
diff --git a/src/core/extensions/extension_system_qt.h b/src/core/extensions/extension_system_qt.h
index 04bffb74d..c213671a7 100644
--- a/src/core/extensions/extension_system_qt.h
+++ b/src/core/extensions/extension_system_qt.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
@@ -50,12 +14,15 @@
#include <string>
#include "base/one_shot_event.h"
-#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "build/build_config.h"
#include "extensions/browser/extension_system.h"
#include "extensions/common/extension_set.h"
+namespace value_store {
+class ValueStoreFactory;
+}
+
namespace extensions {
class ExtensionRegistry;
@@ -63,8 +30,6 @@ class InfoMap;
class RendererStartupHelper;
class ServiceWorkerManager;
class StateStoreNotificationObserver;
-class ValueStoreFactory;
-class ValueStoreFactoryImpl;
// The ExtensionSystem for ProfileImpl and OffTheRecordProfileImpl.
// Implementation details: non-shared services are owned by
@@ -86,70 +51,48 @@ public:
// ExtensionSystem implementation:
void InitForRegularProfile(bool extensions_enabled) override;
ExtensionService *extension_service() override;
- RuntimeData *runtime_data() override;
ManagementPolicy *management_policy() override;
ServiceWorkerManager *service_worker_manager() override;
- SharedUserScriptMaster *shared_user_script_master() override;
+ UserScriptManager *user_script_manager() override;
StateStore *state_store() override;
StateStore *rules_store() override;
- scoped_refptr<ValueStoreFactory> store_factory() override;
- InfoMap *info_map() override;
+ StateStore *dynamic_user_scripts_store() override;
+ scoped_refptr<value_store::ValueStoreFactory> store_factory() override;
QuotaService *quota_service() override;
AppSorting *app_sorting() override;
- void RegisterExtensionWithRequestContexts(const Extension *extension,
- const base::Closure &callback) override;
-
- void UnregisterExtensionWithRequestContexts(const std::string &extension_id,
- const UnloadedExtensionReason reason) override;
-
ContentVerifier *content_verifier() override;
std::unique_ptr<ExtensionSet> GetDependentExtensions(const Extension *extension) override;
-#if !defined(TOOLKIT_QT)
- void InstallUpdate(const std::string &extension_id,
- const std::string &public_key,
- const base::FilePath &unpacked_dir,
- bool install_immediately,
- InstallUpdateCallback install_update_callback) override;
-#endif // TOOLKIT_QT
- //friend class ExtensionSystemSharedFactory;
-
bool FinishDelayedInstallationIfReady(const std::string &extension_id, bool install_immediately) override;
void Init(bool extensions_enabled);
const base::OneShotEvent &ready() const override { return ready_; }
+ bool is_ready() const override;
-private:
- void OnExtensionRegisteredWithRequestContexts(scoped_refptr<const extensions::Extension> extension);
+ void PerformActionBasedOnOmahaAttributes(const std::string &, const base::Value::Dict &) override { /* fixme? */}
+private:
void NotifyExtensionLoaded(const Extension *extension);
- void LoadExtension(std::string extension_id, std::unique_ptr<base::DictionaryValue> manifest, const base::FilePath &directory);
- // The services that are shared between normal and incognito profiles.
-
- // Data to be accessed on the IO thread. Must outlive process_manager_.
- scoped_refptr<InfoMap> info_map_;
+ void LoadExtension(std::string extension_id, const base::Value::Dict &manifest, const base::FilePath &directory);
+ // The services that are shared between normal and incognito profiles.
std::unique_ptr<ServiceWorkerManager> service_worker_manager_;
- std::unique_ptr<RuntimeData> runtime_data_;
std::unique_ptr<QuotaService> quota_service_;
- std::unique_ptr<AppSorting> app_sorting_;
- std::unique_ptr<SharedUserScriptMaster> shared_user_script_master_;
-
+ std::unique_ptr<UserScriptManager> user_script_manager_;
// For verifying the contents of extensions read from disk.
scoped_refptr<ContentVerifier> content_verifier_;
base::OneShotEvent ready_;
content::BrowserContext *browser_context_;
- scoped_refptr<ValueStoreFactory> store_factory_;
+ scoped_refptr<value_store::ValueStoreFactory> store_factory_;
ExtensionRegistry *extension_registry_;
extensions::RendererStartupHelper *renderer_helper_;
bool initialized_;
base::WeakPtrFactory<ExtensionSystemQt> weak_ptr_factory_;
- DISALLOW_COPY_AND_ASSIGN(ExtensionSystemQt);
};
} // namespace extensions
diff --git a/src/core/extensions/extension_web_contents_observer_qt.cpp b/src/core/extensions/extension_web_contents_observer_qt.cpp
index 5b1514bb4..a33954a20 100644
--- a/src/core/extensions/extension_web_contents_observer_qt.cpp
+++ b/src/core/extensions/extension_web_contents_observer_qt.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
@@ -43,17 +7,21 @@
#include "extension_web_contents_observer_qt.h"
+#include "content/browser/renderer_host/render_frame_host_impl.h"
#include "content/public/browser/child_process_security_policy.h"
#include "content/public/browser/render_process_host.h"
-#include "content/public/browser/render_frame_host.h"
-#include "content/public/common/url_constants.h"
+#include "content/public/browser/render_view_host.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/common/manifest.h"
+#include "third_party/blink/public/common/chrome_debug_urls.h"
+
+#include "render_widget_host_view_qt.h"
namespace extensions {
ExtensionWebContentsObserverQt::ExtensionWebContentsObserverQt(content::WebContents *web_contents)
: ExtensionWebContentsObserver(web_contents)
+ , content::WebContentsUserData<ExtensionWebContentsObserverQt>(*web_contents)
{
}
@@ -73,6 +41,8 @@ void ExtensionWebContentsObserverQt::CreateForWebContents(content::WebContents *
void ExtensionWebContentsObserverQt::RenderFrameCreated(content::RenderFrameHost *render_frame_host)
{
ExtensionWebContentsObserver::RenderFrameCreated(render_frame_host);
+ QtWebEngineCore::RenderWidgetHostViewQt::registerInputEventObserver(web_contents(),
+ render_frame_host);
const Extension *extension = GetExtensionFromFrame(render_frame_host, false);
if (!extension)
@@ -82,9 +52,9 @@ void ExtensionWebContentsObserverQt::RenderFrameCreated(content::RenderFrameHost
auto *policy = content::ChildProcessSecurityPolicy::GetInstance();
if (extension->is_extension() && Manifest::IsComponentLocation(extension->location()))
- policy->GrantRequestOrigin(process_id, url::Origin::Create(GURL(content::kChromeUIResourcesURL)));
+ policy->GrantRequestOrigin(process_id, url::Origin::Create(GURL(blink::kChromeUIResourcesURL)));
}
-WEB_CONTENTS_USER_DATA_KEY_IMPL(ExtensionWebContentsObserverQt)
+WEB_CONTENTS_USER_DATA_KEY_IMPL(ExtensionWebContentsObserverQt);
} // namespace extensions
diff --git a/src/core/extensions/extension_web_contents_observer_qt.h b/src/core/extensions/extension_web_contents_observer_qt.h
index 658966b31..ff50b28e2 100644
--- a/src/core/extensions/extension_web_contents_observer_qt.h
+++ b/src/core/extensions/extension_web_contents_observer_qt.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
@@ -65,7 +29,6 @@ public:
private:
friend class content::WebContentsUserData<ExtensionWebContentsObserverQt>;
WEB_CONTENTS_USER_DATA_KEY_DECL();
- DISALLOW_COPY_AND_ASSIGN(ExtensionWebContentsObserverQt);
};
} // namespace extensions
diff --git a/src/core/extensions/extensions_api_client_qt.cpp b/src/core/extensions/extensions_api_client_qt.cpp
index 731b79a63..678c252cc 100644
--- a/src/core/extensions/extensions_api_client_qt.cpp
+++ b/src/core/extensions/extensions_api_client_qt.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Portions copyright 2015 The Chromium Embedded Framework Authors.
// Portions copyright 2014 The Chromium Authors. All rights reserved.
@@ -43,14 +7,21 @@
// found in the LICENSE file.
#include "extensions_api_client_qt.h"
+#include "file_system_delegate_qt.h"
+#include "messaging_delegate_qt.h"
#include <memory>
-//#include "base/memory/ptr_util.h"
+
#include "extension_web_contents_observer_qt.h"
-#include "components/pdf/browser/pdf_web_contents_helper.h"
#include "extensions/browser/guest_view/extensions_guest_view_manager_delegate.h"
#include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest_delegate.h"
+#include "mime_handler_view_guest_delegate_qt.h"
+#include "pdf/buildflags.h"
+#include "printing/buildflags/buildflags.h"
+
+#if BUILDFLAG(ENABLE_PRINTING) && BUILDFLAG(ENABLE_PRINT_PREVIEW)
#include "printing/print_view_manager_qt.h"
+#endif
namespace extensions {
@@ -65,21 +36,37 @@ AppViewGuestDelegate *ExtensionsAPIClientQt::CreateAppViewGuestDelegate() const
return nullptr;
}
-std::unique_ptr<guest_view::GuestViewManagerDelegate> ExtensionsAPIClientQt::CreateGuestViewManagerDelegate(content::BrowserContext *context) const
+FileSystemDelegate *ExtensionsAPIClientQt::GetFileSystemDelegate()
+{
+ if (!m_fileSystemDelegate)
+ m_fileSystemDelegate = std::make_unique<FileSystemDelegateQt>();
+ return m_fileSystemDelegate.get();
+}
+
+std::unique_ptr<guest_view::GuestViewManagerDelegate> ExtensionsAPIClientQt::CreateGuestViewManagerDelegate() const
{
- return std::make_unique<guest_view::GuestViewManagerDelegate>();
+ return std::make_unique<extensions::ExtensionsGuestViewManagerDelegate>();
}
std::unique_ptr<MimeHandlerViewGuestDelegate> ExtensionsAPIClientQt::CreateMimeHandlerViewGuestDelegate(MimeHandlerViewGuest *guest) const
{
- return std::make_unique<MimeHandlerViewGuestDelegate>();
+ return std::make_unique<MimeHandlerViewGuestDelegateQt>(guest);
}
void ExtensionsAPIClientQt::AttachWebContentsHelpers(content::WebContents *web_contents) const
{
// PrefsTabHelper::CreateForWebContents(web_contents);
+#if BUILDFLAG(ENABLE_PRINTING) && BUILDFLAG(ENABLE_PRINT_PREVIEW)
QtWebEngineCore::PrintViewManagerQt::CreateForWebContents(web_contents);
+#endif
ExtensionWebContentsObserverQt::CreateForWebContents(web_contents);
}
+MessagingDelegate *ExtensionsAPIClientQt::GetMessagingDelegate()
+{
+ if (!m_messagingDelegate)
+ m_messagingDelegate = std::make_unique<MessagingDelegateQt>();
+ return m_messagingDelegate.get();
+}
+
} // namespace extensions
diff --git a/src/core/extensions/extensions_api_client_qt.h b/src/core/extensions/extensions_api_client_qt.h
index 2fa69f539..e7838138c 100644
--- a/src/core/extensions/extensions_api_client_qt.h
+++ b/src/core/extensions/extensions_api_client_qt.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Portions copyright 2015 The Chromium Embedded Framework Authors.
// Portions copyright 2014 The Chromium Authors. All rights reserved.
@@ -49,6 +13,9 @@
namespace extensions {
+class FileSystemDelegate;
+class MessagingDelegate;
+
class ExtensionsAPIClientQt : public ExtensionsAPIClient
{
public:
@@ -56,11 +23,17 @@ public:
// ExtensionsAPIClient implementation.
AppViewGuestDelegate *CreateAppViewGuestDelegate() const override;
+ FileSystemDelegate *GetFileSystemDelegate() override;
std::unique_ptr<guest_view::GuestViewManagerDelegate>
- CreateGuestViewManagerDelegate(content::BrowserContext *context) const override;
+ CreateGuestViewManagerDelegate() const override;
std::unique_ptr<MimeHandlerViewGuestDelegate>
CreateMimeHandlerViewGuestDelegate(MimeHandlerViewGuest *guest) const override;
void AttachWebContentsHelpers(content::WebContents *web_contents) const override;
+ MessagingDelegate *GetMessagingDelegate() override;
+
+private:
+ std::unique_ptr<FileSystemDelegate> m_fileSystemDelegate;
+ std::unique_ptr<MessagingDelegate> m_messagingDelegate;
};
} // namespace extensions
diff --git a/src/core/extensions/extensions_browser_client_qt.cpp b/src/core/extensions/extensions_browser_client_qt.cpp
index 1b2bb51f4..19fc6c808 100644
--- a/src/core/extensions/extensions_browser_client_qt.cpp
+++ b/src/core/extensions/extensions_browser_client_qt.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Portions copyright 2015 The Chromium Embedded Framework Authors.
// Portions copyright 2014 The Chromium Authors. All rights reserved.
@@ -49,29 +13,27 @@
#include "base/files/file_path.h"
#include "base/memory/weak_ptr.h"
#include "base/path_service.h"
-#include "base/strings/stringprintf.h"
-#include "base/task/post_task.h"
+#include "base/task/thread_pool.h"
#include "base/memory/ref_counted_memory.h"
+#include "chrome/browser/extensions/api/generated_api_registration.h"
#include "chrome/browser/profiles/profile.h"
#include "content/public/browser/browser_context.h"
-#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_frame_host.h"
+#include "extensions/browser/api/core_extensions_browser_api_provider.h"
#include "extensions/browser/api/extensions_api_client.h"
#include "extensions/browser/api/runtime/runtime_api_delegate.h"
-#include "extensions/browser/app_sorting.h"
-#include "extensions/browser/core_extensions_browser_api_provider.h"
#include "extensions/browser/event_router.h"
#include "extensions/browser/extension_host_delegate.h"
#include "extensions/browser/extension_protocols.h"
+#include "extensions/browser/extensions_browser_api_provider.h"
#include "extensions/browser/extensions_browser_interface_binders.h"
-#include "extensions/browser/mojo/interface_registration.h"
#include "extensions/browser/url_request_util.h"
#include "extensions/common/file_util.h"
-#include "mojo/public/cpp/bindings/strong_binding.h"
-#include "net/base/completion_once_callback.h"
#include "net/base/mime_util.h"
-#include "services/network/public/cpp/resource_response.h"
+#include "qtwebengine/browser/extensions/api/generated_api_registration.h"
+#include "services/network/public/cpp/resource_request.h"
#include "services/network/public/mojom/url_loader.mojom.h"
+#include "services/network/public/mojom/url_response_head.mojom.h"
#include "third_party/zlib/google/compression_utils.h"
#include "ui/base/resource/resource_bundle.h"
@@ -80,10 +42,10 @@
#include "extension_web_contents_observer_qt.h"
#include "extensions_api_client_qt.h"
#include "extensions_browser_client_qt.h"
+#include "extension_host_delegate_qt.h"
#include "web_engine_library_info.h"
using content::BrowserContext;
-using content::BrowserThread;
namespace {
@@ -113,29 +75,13 @@ scoped_refptr<base::RefCountedMemory> GetResource(int resource_id, const std::st
extension_id)
: nullptr;
- bool is_gzipped = rb.IsGzipped(resource_id);
- if (!bytes->size() || (!replacements && !is_gzipped)) {
- return bytes;
- }
-
- base::StringPiece input(reinterpret_cast<const char *>(bytes->front()), bytes->size());
-
- std::string temp_str;
-
- base::StringPiece source = input;
- if (is_gzipped) {
- temp_str.resize(compression::GetUncompressedSize(input));
- source = temp_str;
- CHECK(compression::GzipUncompress(input, source));
- }
-
if (replacements) {
- temp_str = ui::ReplaceTemplateExpressions(source, *replacements);
+ base::StringPiece input(reinterpret_cast<const char *>(bytes->front()), bytes->size());
+ std::string temp_str = ui::ReplaceTemplateExpressions(input, *replacements);
+ DCHECK(!temp_str.empty());
+ return base::MakeRefCounted<base::RefCountedString>(std::move(temp_str));
}
-
- DCHECK(!temp_str.empty());
-
- return base::RefCountedString::TakeString(&temp_str);
+ return bytes;
}
// Loads an extension resource in a Chrome .pak file. These are used by
@@ -147,18 +93,20 @@ public:
mojo::PendingReceiver<network::mojom::URLLoader> loader,
mojo::PendingRemote<network::mojom::URLLoaderClient> client_info,
const base::FilePath &filename, int resource_id,
- const std::string &content_security_policy, bool send_cors_header)
+ scoped_refptr<net::HttpResponseHeaders> headers)
{
// Owns itself. Will live as long as its URLLoader and URLLoaderClientPtr
// bindings are alive - essentially until either the client gives up or all
// file data has been sent to it.
- auto *bundle_loader = new ResourceBundleFileLoader(content_security_policy, send_cors_header);
+ auto *bundle_loader = new ResourceBundleFileLoader(std::move(headers));
bundle_loader->Start(request, std::move(loader), std::move(client_info), filename, resource_id);
}
// mojom::URLLoader implementation:
void FollowRedirect(const std::vector<std::string> &removed_headers,
- const net::HttpRequestHeaders &modified_headers, const base::Optional<GURL> &new_url) override
+ const net::HttpRequestHeaders &modified_headers,
+ const net::HttpRequestHeaders &modified_cors_exempt_headers,
+ const absl::optional<GURL> &new_url) override
{
NOTREACHED() << "No redirects for local file loads.";
}
@@ -169,9 +117,9 @@ public:
void ResumeReadingBodyFromNet() override {}
private:
- ResourceBundleFileLoader(const std::string &content_security_policy, bool send_cors_header) : binding_(this)
+ ResourceBundleFileLoader(scoped_refptr<net::HttpResponseHeaders> headers)
+ : response_headers_(std::move(headers))
{
- response_headers_ = extensions::BuildHttpHeaders(content_security_policy, send_cors_header, base::Time());
}
~ResourceBundleFileLoader() override = default;
@@ -181,16 +129,16 @@ private:
const base::FilePath &filename, int resource_id)
{
client_.Bind(std::move(client_info_remote));
- binding_.Bind(std::move(loader));
- binding_.set_connection_error_handler(
- base::BindOnce(&ResourceBundleFileLoader::OnBindingError, base::Unretained(this)));
- client_.set_connection_error_handler(
- base::BindOnce(&ResourceBundleFileLoader::OnConnectionError, base::Unretained(this)));
+ receiver_.Bind(std::move(loader));
+ receiver_.set_disconnect_handler(base::BindOnce(
+ &ResourceBundleFileLoader::OnReceiverError, base::Unretained(this)));
+ client_.set_disconnect_handler(base::BindOnce(
+ &ResourceBundleFileLoader::OnMojoDisconnect, base::Unretained(this)));
auto data = GetResource(resource_id, request.url.host());
std::string *read_mime_type = new std::string;
- base::PostTaskAndReplyWithResult(
- FROM_HERE, { base::ThreadPool(), base::MayBlock() },
+ base::ThreadPool::PostTaskAndReplyWithResult(
+ FROM_HERE, { base::MayBlock() },
base::BindOnce(&net::GetMimeTypeFromFile, filename, base::Unretained(read_mime_type)),
base::BindOnce(&ResourceBundleFileLoader::OnMimeTypeRead, weak_factory_.GetWeakPtr(), std::move(data),
base::Owned(read_mime_type)));
@@ -198,49 +146,48 @@ private:
void OnMimeTypeRead(scoped_refptr<base::RefCountedMemory> data, std::string *read_mime_type, bool read_result)
{
- network::ResourceResponseHead head;
- head.request_start = base::TimeTicks::Now();
- head.response_start = base::TimeTicks::Now();
- head.content_length = data->size();
- head.mime_type = *read_mime_type;
- DetermineCharset(head.mime_type, data.get(), &head.charset);
- mojo::DataPipe pipe(data->size());
- if (!pipe.consumer_handle.is_valid()) {
+ auto head = network::mojom::URLResponseHead::New();
+ head->request_start = base::TimeTicks::Now();
+ head->response_start = base::TimeTicks::Now();
+ head->content_length = data->size();
+ head->mime_type = *read_mime_type;
+ DetermineCharset(head->mime_type, data.get(), &head->charset);
+ mojo::ScopedDataPipeProducerHandle producer_handle;
+ mojo::ScopedDataPipeConsumerHandle consumer_handle;
+ if (mojo::CreateDataPipe(data->size(), producer_handle, consumer_handle) != MOJO_RESULT_OK) {
client_->OnComplete(network::URLLoaderCompletionStatus(net::ERR_FAILED));
client_.reset();
MaybeDeleteSelf();
return;
}
- head.headers = response_headers_;
- head.headers->AddHeader(base::StringPrintf("%s: %s", net::HttpRequestHeaders::kContentLength,
- base::NumberToString(head.content_length).c_str()));
- if (!head.mime_type.empty()) {
- head.headers->AddHeader(
- base::StringPrintf("%s: %s", net::HttpRequestHeaders::kContentType, head.mime_type.c_str()));
+ head->headers = response_headers_;
+ head->headers->AddHeader(net::HttpRequestHeaders::kContentLength,
+ base::NumberToString(head->content_length).c_str());
+ if (!head->mime_type.empty()) {
+ head->headers->AddHeader(net::HttpRequestHeaders::kContentType, head->mime_type.c_str());
}
- client_->OnReceiveResponse(head);
- client_->OnStartLoadingResponseBody(std::move(pipe.consumer_handle));
+ client_->OnReceiveResponse(std::move(head), std::move(consumer_handle), absl::nullopt);
uint32_t write_size = data->size();
- MojoResult result = pipe.producer_handle->WriteData(data->front(), &write_size, MOJO_WRITE_DATA_FLAG_NONE);
+ MojoResult result = producer_handle->WriteData(data->front(), &write_size, MOJO_WRITE_DATA_FLAG_NONE);
OnFileWritten(result);
}
- void OnConnectionError()
+ void OnMojoDisconnect()
{
client_.reset();
MaybeDeleteSelf();
}
- void OnBindingError()
+ void OnReceiverError()
{
- binding_.Close();
+ receiver_.reset();
MaybeDeleteSelf();
}
void MaybeDeleteSelf()
{
- if (!binding_.is_bound() && !client_.is_bound())
+ if (!receiver_.is_bound() && !client_.is_bound())
delete this;
}
@@ -256,23 +203,51 @@ private:
MaybeDeleteSelf();
}
- mojo::Binding<network::mojom::URLLoader> binding_;
- network::mojom::URLLoaderClientPtr client_;
+ mojo::Receiver<network::mojom::URLLoader> receiver_{this};
+ mojo::Remote<network::mojom::URLLoaderClient> client_;
scoped_refptr<net::HttpResponseHeaders> response_headers_;
- base::WeakPtrFactory<ResourceBundleFileLoader> weak_factory_{ this };
-
- DISALLOW_COPY_AND_ASSIGN(ResourceBundleFileLoader);
+ base::WeakPtrFactory<ResourceBundleFileLoader> weak_factory_{this};
};
} // namespace
namespace extensions {
+// Copied from chrome/browser/extensions/chrome_extensions_browser_api_provider.(h|cc)
+class ChromeExtensionsBrowserAPIProvider : public ExtensionsBrowserAPIProvider
+{
+public:
+ ChromeExtensionsBrowserAPIProvider() = default;
+ ~ChromeExtensionsBrowserAPIProvider() override = default;
+
+ void RegisterExtensionFunctions(ExtensionFunctionRegistry *registry) override
+ {
+ // Generated APIs from Chrome.
+ api::ChromeGeneratedFunctionRegistry::RegisterAll(registry);
+ }
+
+};
+
+class QtWebEngineExtensionsBrowserAPIProvider : public ExtensionsBrowserAPIProvider
+{
+public:
+ QtWebEngineExtensionsBrowserAPIProvider() = default;
+ ~QtWebEngineExtensionsBrowserAPIProvider() override = default;
+
+ void RegisterExtensionFunctions(ExtensionFunctionRegistry *registry) override
+ {
+ // Generated APIs from QtWebEngine.
+ api::QtWebEngineGeneratedFunctionRegistry::RegisterAll(registry);
+ }
+};
+
ExtensionsBrowserClientQt::ExtensionsBrowserClientQt()
: api_client_(new ExtensionsAPIClientQt)
, resource_manager_(new ComponentExtensionResourceManagerQt)
{
AddAPIProvider(std::make_unique<CoreExtensionsBrowserAPIProvider>());
+ AddAPIProvider(std::make_unique<ChromeExtensionsBrowserAPIProvider>());
+ AddAPIProvider(std::make_unique<QtWebEngineExtensionsBrowserAPIProvider>());
}
ExtensionsBrowserClientQt::~ExtensionsBrowserClientQt()
@@ -289,7 +264,7 @@ bool ExtensionsBrowserClientQt::AreExtensionsDisabled(const base::CommandLine &c
return false;
}
-bool ExtensionsBrowserClientQt::IsValidContext(BrowserContext *context)
+bool ExtensionsBrowserClientQt::IsValidContext(void *)
{
return true;
}
@@ -316,11 +291,35 @@ BrowserContext *ExtensionsBrowserClientQt::GetOriginalContext(BrowserContext *co
return context;
}
-bool ExtensionsBrowserClientQt::IsGuestSession(BrowserContext *context) const
+content::BrowserContext* ExtensionsBrowserClientQt::GetContextRedirectedToOriginal(content::BrowserContext *context, bool)
+{
+ // like in ShellExtensionsBrowserClient:
+ return context;
+}
+
+content::BrowserContext* ExtensionsBrowserClientQt::GetContextOwnInstance(content::BrowserContext *context, bool)
+{
+ // like in ShellExtensionsBrowserClient:
+ return context;
+}
+
+content::BrowserContext* ExtensionsBrowserClientQt::GetContextForOriginalOnly(content::BrowserContext *context, bool)
+{
+ // like in ShellExtensionsBrowserClient:
+ return context;
+}
+
+bool ExtensionsBrowserClientQt::AreExtensionsDisabledForContext(content::BrowserContext*)
{
+ // like in ShellExtensionsBrowserClient:
return false;
}
+bool ExtensionsBrowserClientQt::IsGuestSession(BrowserContext *context) const
+{
+ return context->IsOffTheRecord();
+}
+
bool ExtensionsBrowserClientQt::IsExtensionIncognitoEnabled(const std::string &extension_id,
content::BrowserContext *context) const
{
@@ -369,17 +368,16 @@ void ExtensionsBrowserClientQt::LoadResourceFromResourceBundle(const network::Re
mojo::PendingReceiver<network::mojom::URLLoader> loader,
const base::FilePath &resource_relative_path,
int resource_id,
- const std::string &content_security_policy,
- mojo::PendingRemote<network::mojom::URLLoaderClient> client,
- bool send_cors_header)
+ scoped_refptr<net::HttpResponseHeaders> headers,
+ mojo::PendingRemote<network::mojom::URLLoaderClient> client)
{
ResourceBundleFileLoader::CreateAndStart(request, std::move(loader), std::move(client), resource_relative_path,
- resource_id, content_security_policy, send_cors_header);
+ resource_id, headers);
}
-bool ExtensionsBrowserClientQt::AllowCrossRendererResourceLoad(const GURL &url,
- content::ResourceType resource_type,
+bool ExtensionsBrowserClientQt::AllowCrossRendererResourceLoad(const network::ResourceRequest &request,
+ network::mojom::RequestDestination destination,
ui::PageTransition page_transition,
int child_id,
bool is_incognito,
@@ -387,12 +385,15 @@ bool ExtensionsBrowserClientQt::AllowCrossRendererResourceLoad(const GURL &url,
const ExtensionSet &extensions,
const ProcessMap &process_map)
{
-
if (extension && extension->id() == extension_misc::kPdfExtensionId)
return true;
+ // hangout services id
+ if (extension && extension->id() == "nkeimhogjdpnpccoofpliimaahmaaome")
+ return true;
+
bool allowed = false;
- if (url_request_util::AllowCrossRendererResourceLoad(url, resource_type,
+ if (url_request_util::AllowCrossRendererResourceLoad(request, destination,
page_transition, child_id,
is_incognito, extension, extensions,
process_map, &allowed)) {
@@ -419,9 +420,7 @@ ProcessManagerDelegate *ExtensionsBrowserClientQt::GetProcessManagerDelegate() c
std::unique_ptr<ExtensionHostDelegate> ExtensionsBrowserClientQt::CreateExtensionHostDelegate()
{
- // TODO(extensions): Implement to support Apps.
- NOTREACHED();
- return std::unique_ptr<ExtensionHostDelegate>();
+ return std::unique_ptr<ExtensionHostDelegate>(new ExtensionHostDelegateQt);
}
bool ExtensionsBrowserClientQt::DidVersionUpdate(BrowserContext *context)
@@ -449,15 +448,8 @@ ExtensionSystemProvider *ExtensionsBrowserClientQt::GetExtensionSystemFactory()
return ExtensionSystemFactoryQt::GetInstance();
}
-void ExtensionsBrowserClientQt::RegisterExtensionInterfaces(service_manager::BinderRegistryWithArgs<content::RenderFrameHost *> *registry,
- content::RenderFrameHost *render_frame_host,
- const Extension *extension) const
-{
- RegisterInterfacesForExtension(registry, render_frame_host, extension);
-}
-
void ExtensionsBrowserClientQt::RegisterBrowserInterfaceBindersForFrame(
- service_manager::BinderMapWithContext<content::RenderFrameHost*> *binder_map,
+ mojo::BinderMapWithContext<content::RenderFrameHost*> *binder_map,
content::RenderFrameHost* render_frame_host,
const Extension* extension) const
{
@@ -478,7 +470,8 @@ const ComponentExtensionResourceManager *ExtensionsBrowserClientQt::GetComponent
void ExtensionsBrowserClientQt::BroadcastEventToRenderers(events::HistogramValue histogram_value,
const std::string &event_name,
- std::unique_ptr<base::ListValue> args, bool dispatch_to_off_the_record_profiles)
+ base::Value::List args,
+ bool dispatch_to_off_the_record_profiles)
{
NOTIMPLEMENTED();
// TODO : do the event routing
@@ -531,7 +524,6 @@ ExtensionWebContentsObserver *ExtensionsBrowserClientQt::GetExtensionWebContents
KioskDelegate *ExtensionsBrowserClientQt::GetKioskDelegate()
{
- NOTREACHED();
return nullptr;
}
@@ -545,4 +537,10 @@ void ExtensionsBrowserClientQt::SetAPIClientForTest(ExtensionsAPIClient *api_cli
api_client_.reset(api_client);
}
+media_device_salt::MediaDeviceSaltService *ExtensionsBrowserClientQt::GetMediaDeviceSaltService(content::BrowserContext *context)
+{
+ // Not needed for QWE
+ return nullptr;
+}
+
} // namespace extensions
diff --git a/src/core/extensions/extensions_browser_client_qt.h b/src/core/extensions/extensions_browser_client_qt.h
index 97da83240..bcc8f142b 100644
--- a/src/core/extensions/extensions_browser_client_qt.h
+++ b/src/core/extensions/extensions_browser_client_qt.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Portions copyright 2015 The Chromium Embedded Framework Authors.
// Portions copyright 2014 The Chromium Authors. All rights reserved.
@@ -45,8 +9,9 @@
#ifndef EXTENSIONS_BROWSER_CLIENT_QT_H_
#define EXTENSIONS_BROWSER_CLIENT_QT_H_
-#include "base/compiler_specific.h"
#include "extensions/browser/extensions_browser_client.h"
+#include "mojo/public/cpp/bindings/pending_receiver.h"
+#include "mojo/public/cpp/bindings/pending_remote.h"
namespace extensions {
@@ -64,23 +29,27 @@ public:
bool IsShuttingDown() override;
bool AreExtensionsDisabled(const base::CommandLine &command_line,
content::BrowserContext *context) override;
- bool IsValidContext(content::BrowserContext *context) override;
+ bool IsValidContext(void*) override;
bool IsSameContext(content::BrowserContext *first,
content::BrowserContext *second) override;
bool HasOffTheRecordContext(content::BrowserContext *context) override;
content::BrowserContext *GetOffTheRecordContext(content::BrowserContext *context) override;
content::BrowserContext *GetOriginalContext(content::BrowserContext *context) override;
+ content::BrowserContext *GetContextRedirectedToOriginal(content::BrowserContext*, bool) override;
+ content::BrowserContext *GetContextOwnInstance(content::BrowserContext*, bool) override;
+ content::BrowserContext *GetContextForOriginalOnly(content::BrowserContext*, bool) override;
bool IsGuestSession(content::BrowserContext *context) const override;
bool IsExtensionIncognitoEnabled(const std::string &extension_id, content::BrowserContext *context) const override;
bool CanExtensionCrossIncognito(const Extension *extension, content::BrowserContext *context) const override;
- bool AllowCrossRendererResourceLoad(const GURL &url,
- content::ResourceType resource_type,
+ bool AllowCrossRendererResourceLoad(const network::ResourceRequest &request,
+ network::mojom::RequestDestination destination,
ui::PageTransition page_transition,
int child_id,
bool is_incognito,
const Extension *extension,
const ExtensionSet &extensions,
const ProcessMap &process_map) override;
+
PrefService *GetPrefServiceForContext(content::BrowserContext *context) override;
void GetEarlyExtensionPrefsObservers(content::BrowserContext *context,
std::vector<EarlyExtensionPrefsObserver *> *observers) const override;
@@ -91,17 +60,15 @@ public:
bool IsRunningInForcedAppMode() override;
bool IsLoggedInAsPublicAccount() override;
ExtensionSystemProvider *GetExtensionSystemFactory() override;
- void RegisterBrowserInterfaceBindersForFrame(service_manager::BinderMapWithContext<content::RenderFrameHost*> *,
+ void RegisterBrowserInterfaceBindersForFrame(mojo::BinderMapWithContext<content::RenderFrameHost*> *,
content::RenderFrameHost *, const extensions::Extension *) const override;
+
std::unique_ptr<RuntimeAPIDelegate> CreateRuntimeAPIDelegate(content::BrowserContext *context) const override;
- void RegisterExtensionInterfaces(service_manager::BinderRegistryWithArgs<content::RenderFrameHost *> *registry,
- content::RenderFrameHost *render_frame_host,
- const Extension *extension) const override;
const ComponentExtensionResourceManager *
GetComponentExtensionResourceManager() override;
void BroadcastEventToRenderers(events::HistogramValue histogram_value,
const std::string &event_name,
- std::unique_ptr<base::ListValue> args,
+ base::Value::List args,
bool dispatch_to_off_the_record_profiles) override;
ExtensionCache *GetExtensionCache() override;
bool IsBackgroundUpdateAllowed() override;
@@ -126,9 +93,8 @@ public:
mojo::PendingReceiver<network::mojom::URLLoader> loader,
const base::FilePath &resource_relative_path,
int resource_id,
- const std::string &content_security_policy,
- mojo::PendingRemote<network::mojom::URLLoaderClient> client,
- bool send_cors_header) override;
+ scoped_refptr<net::HttpResponseHeaders> headers,
+ mojo::PendingRemote<network::mojom::URLLoaderClient> client) override;
// Returns the locale used by the application.
std::string GetApplicationLocale() override;
@@ -138,6 +104,10 @@ public:
// Sets the API client.
void SetAPIClientForTest(ExtensionsAPIClient *api_client);
+ bool AreExtensionsDisabledForContext(content::BrowserContext*) override;
+
+ media_device_salt::MediaDeviceSaltService *GetMediaDeviceSaltService(content::BrowserContext *context) override;
+
private:
// Support for extension APIs.
std::unique_ptr<ExtensionsAPIClient> api_client_;
@@ -146,8 +116,6 @@ private:
std::unique_ptr<ComponentExtensionResourceManager> resource_manager_;
//scoped_refptr<EventRouterForwarder> event_router_forwarder_;
-
- DISALLOW_COPY_AND_ASSIGN(ExtensionsBrowserClientQt);
};
} // namespace extensions
diff --git a/src/core/extensions/file_system_delegate_qt.cpp b/src/core/extensions/file_system_delegate_qt.cpp
new file mode 100644
index 000000000..7c1c5bbd8
--- /dev/null
+++ b/src/core/extensions/file_system_delegate_qt.cpp
@@ -0,0 +1,146 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "file_system_delegate_qt.h"
+
+#include "select_file_dialog_factory_qt.h"
+#include "type_conversion.h"
+
+#include "base/files/file_path.h"
+#include "base/files/file_path.h"
+#include "base/functional/callback.h"
+#include "base/functional/callback.h"
+#include "base/memory/ref_counted.h"
+#include "content/public/browser/web_contents.h"
+#include "content/public/browser/web_contents.h"
+#include "extensions/browser/api/file_system/file_system_delegate.h"
+#include "extensions/browser/extension_function.h"
+#include "ui/shell_dialogs/selected_file_info.h"
+
+#include <QStandardPaths>
+
+namespace extensions {
+
+FileEntryPickerQt::FileEntryPickerQt(
+ content::WebContents *web_contents,
+ const base::FilePath &suggested_name,
+ const ui::SelectFileDialog::FileTypeInfo *file_type_info,
+ ui::SelectFileDialog::Type picker_type,
+ FileSystemDelegate::FilesSelectedCallback files_selected_callback,
+ base::OnceClosure file_selection_canceled_callback)
+ : m_filesSelectedCallback(std::move(files_selected_callback))
+ , m_fileSelectionCanceledCallback(std::move(file_selection_canceled_callback))
+{
+ const GURL caller = web_contents->GetPrimaryMainFrame()->GetLastCommittedURL();
+ m_selectFileDialog = ui::SelectFileDialog::Create(
+ this, std::make_unique<QtWebEngineCore::SelectFilePolicyQt>(web_contents));
+ m_selectFileDialog->SelectFile(
+ picker_type, std::u16string(), suggested_name, file_type_info, 0,
+ base::FilePath::StringType(), nullptr, nullptr, &caller);
+}
+
+FileEntryPickerQt::~FileEntryPickerQt() = default;
+
+void FileEntryPickerQt::FileSelected(const base::FilePath &path,
+ int index,
+ void *params)
+{
+ MultiFilesSelected({path}, params);
+}
+
+void FileEntryPickerQt::FileSelectedWithExtraInfo(const ui::SelectedFileInfo& file,
+ int index,
+ void *params)
+{
+ FileSelected(file.file_path, index, params);
+}
+
+void FileEntryPickerQt::MultiFilesSelected(const std::vector<base::FilePath>& files,
+ void* params)
+{
+ Q_UNUSED(params);
+ std::move(m_filesSelectedCallback).Run(files);
+ delete this;
+}
+
+void FileEntryPickerQt::MultiFilesSelectedWithExtraInfo(
+ const std::vector<ui::SelectedFileInfo> &files,
+ void *params)
+{
+ std::vector<base::FilePath> paths;
+ for (const auto& file : files)
+ paths.push_back(file.file_path);
+ MultiFilesSelected(paths, params);
+}
+
+void FileEntryPickerQt::FileSelectionCanceled(void *params)
+{
+ std::move(m_fileSelectionCanceledCallback).Run();
+ delete this;
+}
+
+FileSystemDelegateQt::FileSystemDelegateQt()
+{
+}
+
+base::FilePath FileSystemDelegateQt::GetDefaultDirectory()
+{
+ return QtWebEngineCore::toFilePath(
+ QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation));
+}
+
+base::FilePath FileSystemDelegateQt::GetManagedSaveAsDirectory(
+ content::BrowserContext *browser_context,
+ const Extension &extension)
+{
+ Q_UNUSED(browser_context);
+ Q_UNUSED(extension);
+ return base::FilePath();
+}
+
+bool FileSystemDelegateQt::ShowSelectFileDialog(
+ scoped_refptr<ExtensionFunction> extension_function,
+ ui::SelectFileDialog::Type type,
+ const base::FilePath &default_path,
+ const ui::SelectFileDialog::FileTypeInfo *file_type_info,
+ FileSystemDelegate::FilesSelectedCallback files_selected_callback,
+ base::OnceClosure file_selection_canceled_callback)
+{
+ content::WebContents *web_contents = extension_function->GetSenderWebContents();
+ if (!web_contents)
+ return false;
+
+ new FileEntryPickerQt(web_contents, default_path, file_type_info, type,
+ std::move(files_selected_callback),
+ std::move(file_selection_canceled_callback));
+ return true;
+}
+
+void FileSystemDelegateQt::ConfirmSensitiveDirectoryAccess(
+ bool has_write_permission,
+ const std::u16string &app_name,
+ content::WebContents *web_contents,
+ base::OnceClosure on_accept,
+ base::OnceClosure on_cancel)
+{
+ Q_UNUSED(has_write_permission);
+ Q_UNUSED(app_name);
+ Q_UNUSED(web_contents);
+ Q_UNUSED(on_accept);
+ std::move(on_cancel).Run();
+}
+
+int FileSystemDelegateQt::GetDescriptionIdForAcceptType(const std::string &accept_type)
+{
+ Q_UNUSED(accept_type);
+ return 0;
+}
+
+SavedFilesServiceInterface *FileSystemDelegateQt::GetSavedFilesService(
+ content::BrowserContext *browser_context)
+{
+ Q_UNUSED(browser_context);
+ return nullptr;
+}
+
+} // namespace extensions
diff --git a/src/core/extensions/file_system_delegate_qt.h b/src/core/extensions/file_system_delegate_qt.h
new file mode 100644
index 000000000..1e9d87c38
--- /dev/null
+++ b/src/core/extensions/file_system_delegate_qt.h
@@ -0,0 +1,89 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef FILE_SYSTEM_DELEGATE_QT_H
+#define FILE_SYSTEM_DELEGATE_QT_H
+
+#include "extensions/browser/api/file_system/file_system_delegate.h"
+
+#include "base/files/file_path.h"
+#include "base/functional/callback.h"
+#include "base/memory/ref_counted.h"
+#include "extensions/browser/extension_function.h"
+#include "ui/shell_dialogs/select_file_dialog.h"
+
+#include <memory>
+#include <vector>
+
+namespace content {
+class BrowserContext;
+} // namespace content
+
+namespace extensions {
+
+class FileEntryPickerQt : public ui::SelectFileDialog::Listener {
+public:
+ FileEntryPickerQt(
+ content::WebContents *web_contents,
+ const base::FilePath &suggested_name,
+ const ui::SelectFileDialog::FileTypeInfo *file_type_info,
+ ui::SelectFileDialog::Type picker_type,
+ FileSystemDelegate::FilesSelectedCallback files_selected_callback,
+ base::OnceClosure file_selection_canceled_callback);
+
+ FileEntryPickerQt(const FileEntryPickerQt &) = delete;
+ FileEntryPickerQt &operator=(const FileEntryPickerQt &) = delete;
+
+private:
+ ~FileEntryPickerQt() override;
+
+ // ui::SelectFileDialog::Listener implementation.
+ void FileSelected(const base::FilePath &path,
+ int index,
+ void *params) override;
+ void FileSelectedWithExtraInfo(const ui::SelectedFileInfo &file,
+ int index,
+ void *params) override;
+ void MultiFilesSelected(const std::vector<base::FilePath> &files,
+ void *params) override;
+ void MultiFilesSelectedWithExtraInfo(
+ const std::vector<ui::SelectedFileInfo> &files,
+ void *params) override;
+ void FileSelectionCanceled(void *params) override;
+
+ FileSystemDelegate::FilesSelectedCallback m_filesSelectedCallback;
+ base::OnceClosure m_fileSelectionCanceledCallback;
+ scoped_refptr<ui::SelectFileDialog> m_selectFileDialog;
+};
+
+class FileSystemDelegateQt : public FileSystemDelegate
+{
+public:
+ FileSystemDelegateQt();
+
+ // FileSystemDelegate implementation
+ virtual base::FilePath GetDefaultDirectory() override;
+ virtual base::FilePath GetManagedSaveAsDirectory(
+ content::BrowserContext *browser_context,
+ const Extension &extension) override;
+ virtual bool ShowSelectFileDialog(
+ scoped_refptr<ExtensionFunction> extension_function,
+ ui::SelectFileDialog::Type type,
+ const base::FilePath &default_path,
+ const ui::SelectFileDialog::FileTypeInfo *file_types,
+ FileSystemDelegate::FilesSelectedCallback files_selected_callback,
+ base::OnceClosure file_selection_canceled_callback) override;
+ virtual void ConfirmSensitiveDirectoryAccess(
+ bool has_write_permission,
+ const std::u16string &app_name,
+ content::WebContents *web_contents,
+ base::OnceClosure on_accept,
+ base::OnceClosure on_cancel) override;
+ virtual int GetDescriptionIdForAcceptType(const std::string &accept_type) override;
+ virtual SavedFilesServiceInterface *GetSavedFilesService(
+ content::BrowserContext *browser_context) override;
+};
+
+} // namespace extensions
+
+#endif // FILE_SYSTEM_DELEGATE_QT_H
diff --git a/src/core/extensions/messaging_delegate_qt.cpp b/src/core/extensions/messaging_delegate_qt.cpp
new file mode 100644
index 000000000..b0089aea2
--- /dev/null
+++ b/src/core/extensions/messaging_delegate_qt.cpp
@@ -0,0 +1,20 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "messaging_delegate_qt.h"
+
+#include <QtGlobal>
+
+namespace extensions {
+
+MessagingDelegateQt::MessagingDelegateQt()
+{
+}
+
+absl::optional<base::Value::Dict> MessagingDelegateQt::MaybeGetTabInfo(content::WebContents *web_contents)
+{
+ Q_UNUSED(web_contents);
+ return absl::nullopt;
+}
+
+} // namespace extensions
diff --git a/src/core/extensions/messaging_delegate_qt.h b/src/core/extensions/messaging_delegate_qt.h
new file mode 100644
index 000000000..c3c6244f5
--- /dev/null
+++ b/src/core/extensions/messaging_delegate_qt.h
@@ -0,0 +1,30 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef MESSAGING_DELEGATE_QT_H
+#define MESSAGING_DELEGATE_QT_H
+
+#include "extensions/browser/api/messaging/messaging_delegate.h"
+
+namespace base {
+class DictionaryValue;
+}
+
+namespace content {
+class WebContents;
+}
+
+namespace extensions {
+
+class MessagingDelegateQt : public MessagingDelegate
+{
+public:
+ MessagingDelegateQt();
+
+ // MessagingDelegate implementation.
+ absl::optional<base::Value::Dict> MaybeGetTabInfo(content::WebContents *web_contents) override;
+};
+
+} // namespace extensions
+
+#endif // MESSAGING_DELEGATE_QT_H
diff --git a/src/core/extensions/mime_handler_view_guest_delegate_qt.cpp b/src/core/extensions/mime_handler_view_guest_delegate_qt.cpp
index 022bc7db6..fcea708b0 100644
--- a/src/core/extensions/mime_handler_view_guest_delegate_qt.cpp
+++ b/src/core/extensions/mime_handler_view_guest_delegate_qt.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Portions copyright 2015 The Chromium Embedded Framework Authors.
// Portions copyright 2014 The Chromium Authors. All rights reserved.
@@ -44,33 +8,45 @@
#include "mime_handler_view_guest_delegate_qt.h"
-#include "content/browser/browser_plugin/browser_plugin_guest.h"
-#include "content/browser/web_contents/web_contents_impl.h"
+#include "content/public/browser/context_menu_params.h"
#include "content/public/browser/web_contents.h"
-#include "content/public/common/context_menu_params.h"
#include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h"
+#include "profile_adapter.h"
+#include "qwebenginecontextmenurequest.h"
+#include "qwebenginecontextmenurequest_p.h"
+#include "render_widget_host_view_qt.h"
+#include "touch_selection_controller_client_qt.h"
+#include "web_contents_adapter.h"
+#include "web_contents_adapter_client.h"
+#include "web_contents_view_qt.h"
+
namespace extensions {
MimeHandlerViewGuestDelegateQt::MimeHandlerViewGuestDelegateQt(MimeHandlerViewGuest *)
: MimeHandlerViewGuestDelegate()
+ , m_contextMenuRequest(new QWebEngineContextMenuRequest(new QWebEngineContextMenuRequestPrivate))
{
}
MimeHandlerViewGuestDelegateQt::~MimeHandlerViewGuestDelegateQt()
{
+ delete m_contextMenuRequest;
}
-bool MimeHandlerViewGuestDelegateQt::HandleContextMenu(content::WebContents *web_contents, const content::ContextMenuParams &params)
+bool MimeHandlerViewGuestDelegateQt::HandleContextMenu(content::RenderFrameHost &render_frame_host, const content::ContextMenuParams &params)
{
- content::ContextMenuParams new_params = params;
-
- gfx::Point guest_coordinates =
- static_cast<content::WebContentsImpl *>(web_contents)->GetBrowserPluginGuest()->GetScreenCoordinates(gfx::Point());
-
- // Adjust (x,y) position for offset from guest to embedder.
- new_params.x += guest_coordinates.x();
- new_params.y += guest_coordinates.y();
+ content::WebContents *web_contents = content::WebContents::FromRenderFrameHost(&render_frame_host);
+ content::WebContents *parent_web_contents = guest_view::GuestViewBase::GetTopLevelWebContents(web_contents);
+ if (auto rwhv = static_cast<QtWebEngineCore::RenderWidgetHostViewQt *>(parent_web_contents->GetRenderWidgetHostView())) {
+ if (rwhv->getTouchSelectionControllerClient()->handleContextMenu(params))
+ return true;
+
+ QtWebEngineCore::WebContentsAdapterClient *adapterClient = rwhv->adapterClient();
+ QtWebEngineCore::WebContentsViewQt::update(m_contextMenuRequest, params, adapterClient->profileAdapter()->isSpellCheckEnabled());
+ adapterClient->contextMenuRequested(m_contextMenuRequest);
+ return true;
+ }
return false;
}
diff --git a/src/core/extensions/mime_handler_view_guest_delegate_qt.h b/src/core/extensions/mime_handler_view_guest_delegate_qt.h
index 6cd80689c..bdb3c840b 100644
--- a/src/core/extensions/mime_handler_view_guest_delegate_qt.h
+++ b/src/core/extensions/mime_handler_view_guest_delegate_qt.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Portions copyright 2015 The Chromium Embedded Framework Authors.
// Portions copyright 2014 The Chromium Authors. All rights reserved.
@@ -46,8 +10,11 @@
#define MIME_HANDLER_VIEW_GUEST_DELEGATE_QT_H_
#include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest_delegate.h"
-#include "content/browser/web_contents/web_contents_view.h"
-#include "content/public/browser/web_contents.h"
+#include "api/qtwebenginecoreglobal_p.h"
+
+QT_BEGIN_NAMESPACE
+class QWebEngineContextMenuRequest;
+QT_END_NAMESPACE
namespace content {
struct ContextMenuParams;
@@ -62,11 +29,11 @@ public:
explicit MimeHandlerViewGuestDelegateQt(MimeHandlerViewGuest *guest);
~MimeHandlerViewGuestDelegateQt() override;
- bool HandleContextMenu(content::WebContents *web_contents,
+ bool HandleContextMenu(content::RenderFrameHost &render_frame_host,
const content::ContextMenuParams &params) override;
private:
- DISALLOW_COPY_AND_ASSIGN(MimeHandlerViewGuestDelegateQt);
+ QWebEngineContextMenuRequest *m_contextMenuRequest;
};
} // namespace extensions
diff --git a/src/core/extensions/pdf_iframe_navigation_throttle_qt.cpp b/src/core/extensions/pdf_iframe_navigation_throttle_qt.cpp
new file mode 100644
index 000000000..a494e2f49
--- /dev/null
+++ b/src/core/extensions/pdf_iframe_navigation_throttle_qt.cpp
@@ -0,0 +1,194 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+// based on //chrome/browser/plugins/pdf_iframe_navigation_throttle.cc
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+
+#include "extensions/pdf_iframe_navigation_throttle_qt.h"
+
+#include "base/task/sequenced_task_runner.h"
+#include "chrome/grit/renderer_resources.h"
+#include "components/strings/grit/components_strings.h"
+#include "content/public/browser/download_utils.h"
+#include "content/public/browser/navigation_handle.h"
+#include "content/public/browser/plugin_service.h"
+#include "content/public/browser/render_process_host.h"
+#include "content/public/browser/web_contents.h"
+#include "content/public/browser/web_contents_user_data.h"
+#include "content/public/common/webplugininfo.h"
+#include "base/strings/escape.h"
+#include "net/http/http_response_headers.h"
+#include "ui/base/l10n/l10n_util.h"
+#include "ui/base/resource/resource_bundle.h"
+#include "ui/base/webui/jstemplate_builder.h"
+#include "ui/base/webui/web_ui_util.h"
+
+#include "pdf_util_qt.h"
+
+#include <QtGlobal>
+
+namespace extensions {
+
+// Used to scope the posted navigation task to the lifetime of |web_contents|.
+class PdfWebContentsLifetimeHelper : public content::WebContentsUserData<PdfWebContentsLifetimeHelper>
+{
+public:
+ explicit PdfWebContentsLifetimeHelper(content::WebContents *web_contents)
+ : content::WebContentsUserData<PdfWebContentsLifetimeHelper>(*web_contents)
+ {}
+
+ base::WeakPtr<PdfWebContentsLifetimeHelper> GetWeakPtr()
+ {
+ return weak_factory_.GetWeakPtr();
+ }
+
+ void NavigateIFrameToPlaceholder(const content::OpenURLParams &url_params)
+ {
+ GetWebContents().OpenURL(url_params);
+ }
+
+private:
+ friend class content::WebContentsUserData<PdfWebContentsLifetimeHelper>;
+
+ base::WeakPtrFactory<PdfWebContentsLifetimeHelper> weak_factory_{this};
+
+ WEB_CONTENTS_USER_DATA_KEY_DECL();
+};
+
+WEB_CONTENTS_USER_DATA_KEY_IMPL(PdfWebContentsLifetimeHelper);
+
+bool IsPDFPluginEnabled(content::NavigationHandle *navigation_handle, bool *is_stale)
+{
+ content::WebContents *web_contents = navigation_handle->GetWebContents();
+ Q_ASSERT(web_contents);
+
+ if (web_contents->IsInnerWebContentsForGuest())
+ web_contents = web_contents->GetOuterWebContents();
+
+ int process_id = web_contents->GetPrimaryMainFrame()->GetProcess()->GetID();
+ int routing_id = web_contents->GetPrimaryMainFrame()->GetRoutingID();
+ content::WebPluginInfo plugin_info;
+ // Will check WebEngineSettings by PluginServiceFilterQt
+ return content::PluginService::GetInstance()->GetPluginInfo(
+ process_id, routing_id,
+ navigation_handle->GetWebContents()->GetBrowserContext(),
+ navigation_handle->GetURL(),
+ QtWebEngineCore::kPDFMimeType, false /* allow_wildcard */,
+ is_stale, &plugin_info, nullptr /* actual_mime_type */);
+}
+
+std::string GetPDFPlaceholderHTML(const GURL &pdf_url)
+{
+ std::string template_html = ui::ResourceBundle::GetSharedInstance().LoadDataResourceString(IDR_PDF_PLUGIN_HTML);
+ webui::AppendWebUiCssTextDefaults(&template_html);
+
+ base::Value::Dict values;
+ values.Set("fileName", pdf_url.ExtractFileName());
+ values.Set("open", l10n_util::GetStringUTF8(IDS_ACCNAME_OPEN));
+ values.Set("pdfUrl", pdf_url.spec());
+
+ return webui::GetI18nTemplateHtml(template_html, std::move(values));
+}
+
+// static
+std::unique_ptr<content::NavigationThrottle>
+PDFIFrameNavigationThrottleQt::MaybeCreateThrottleFor(content::NavigationHandle *handle)
+{
+ if (handle->IsInMainFrame())
+ return nullptr;
+ return std::make_unique<PDFIFrameNavigationThrottleQt>(handle);
+}
+
+PDFIFrameNavigationThrottleQt::PDFIFrameNavigationThrottleQt(content::NavigationHandle *handle)
+ : content::NavigationThrottle(handle)
+{
+}
+
+PDFIFrameNavigationThrottleQt::~PDFIFrameNavigationThrottleQt()
+{
+}
+
+content::NavigationThrottle::ThrottleCheckResult PDFIFrameNavigationThrottleQt::WillProcessResponse()
+{
+ const net::HttpResponseHeaders *response_headers = navigation_handle()->GetResponseHeaders();
+ if (!response_headers)
+ return content::NavigationThrottle::PROCEED;
+
+ std::string mime_type;
+ response_headers->GetMimeType(&mime_type);
+ if (mime_type != QtWebEngineCore::kPDFMimeType)
+ return content::NavigationThrottle::PROCEED;
+
+ // We MUST download responses marked as attachments rather than showing
+ // a placeholder.
+ if (content::download_utils::MustDownload(navigation_handle()->GetWebContents()
+ ? navigation_handle()->GetWebContents()->GetBrowserContext()
+ : nullptr,
+ navigation_handle()->GetURL(), response_headers, mime_type))
+ return content::NavigationThrottle::PROCEED;
+
+ bool is_stale = false;
+ bool pdf_plugin_enabled = IsPDFPluginEnabled(navigation_handle(), &is_stale);
+
+ if (is_stale) {
+ // On browser start, the plugin list may not be ready yet.
+ content::PluginService::GetInstance()->GetPlugins(
+ base::BindOnce(&PDFIFrameNavigationThrottleQt::OnPluginsLoaded,
+ weak_factory_.GetWeakPtr()));
+ return content::NavigationThrottle::DEFER;
+ }
+
+ // If the plugin was found, proceed on the navigation. Otherwise fall through
+ // to the placeholder case.
+ if (pdf_plugin_enabled)
+ return content::NavigationThrottle::PROCEED;
+
+ LoadPlaceholderHTML();
+ return content::NavigationThrottle::CANCEL_AND_IGNORE;
+}
+
+const char *PDFIFrameNavigationThrottleQt::GetNameForLogging()
+{
+ return "PDFIFrameNavigationThrottleQt";
+}
+
+void PDFIFrameNavigationThrottleQt::OnPluginsLoaded(
+ const std::vector<content::WebPluginInfo> &plugins)
+{
+ if (IsPDFPluginEnabled(navigation_handle(), nullptr /* is_stale */)) {
+ Resume();
+ } else {
+ LoadPlaceholderHTML();
+ CancelDeferredNavigation(content::NavigationThrottle::CANCEL_AND_IGNORE);
+ }
+}
+
+void PDFIFrameNavigationThrottleQt::LoadPlaceholderHTML()
+{
+ // Prepare the params to navigate to the placeholder.
+ std::string html = GetPDFPlaceholderHTML(navigation_handle()->GetURL());
+ GURL data_url("data:text/html," + base::EscapePath(html));
+ content::OpenURLParams params = content::OpenURLParams::FromNavigationHandle(navigation_handle());
+ params.url = data_url;
+ params.transition = ui::PAGE_TRANSITION_AUTO_SUBFRAME;
+
+ // Post a task to navigate to the placeholder HTML. We don't navigate
+ // synchronously here, as starting a navigation within a navigation is
+ // an antipattern. Use a helper object scoped to the WebContents lifetime to
+ // scope the navigation task to the WebContents lifetime.
+ content::WebContents *web_contents = navigation_handle()->GetWebContents();
+ if (!web_contents)
+ return;
+
+ PdfWebContentsLifetimeHelper::CreateForWebContents(web_contents);
+ PdfWebContentsLifetimeHelper *helper = PdfWebContentsLifetimeHelper::FromWebContents(web_contents);
+ base::SequencedTaskRunner::GetCurrentDefault()->PostTask(
+ FROM_HERE,
+ base::BindOnce(&PdfWebContentsLifetimeHelper::NavigateIFrameToPlaceholder,
+ helper->GetWeakPtr(), std::move(params)));
+}
+
+} // namespace extensions
diff --git a/src/core/extensions/pdf_iframe_navigation_throttle_qt.h b/src/core/extensions/pdf_iframe_navigation_throttle_qt.h
new file mode 100644
index 000000000..fdc168aec
--- /dev/null
+++ b/src/core/extensions/pdf_iframe_navigation_throttle_qt.h
@@ -0,0 +1,46 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+// based on //chrome/browser/plugins/pdf_iframe_navigation_throttle.h
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef PDF_IFRAME_NAVIGATION_THROTTLE_QT
+#define PDF_IFRAME_NAVIGATION_THROTTLE_QT
+
+#include "content/public/browser/navigation_throttle.h"
+
+#include "base/memory/weak_ptr.h"
+
+namespace content {
+class NavigationHandle;
+struct WebPluginInfo;
+}
+
+namespace extensions {
+
+// This class prevents automatical download of PDFs when they are embedded
+// in subframes and plugins are disabled in API.
+class PDFIFrameNavigationThrottleQt : public content::NavigationThrottle
+{
+public:
+ static std::unique_ptr<content::NavigationThrottle> MaybeCreateThrottleFor(content::NavigationHandle *handle);
+
+ explicit PDFIFrameNavigationThrottleQt(content::NavigationHandle *handle);
+ ~PDFIFrameNavigationThrottleQt() override;
+
+ // content::NavigationThrottle
+ content::NavigationThrottle::ThrottleCheckResult WillProcessResponse() override;
+ const char *GetNameForLogging() override;
+
+private:
+ void OnPluginsLoaded(const std::vector<content::WebPluginInfo> &plugins);
+ void LoadPlaceholderHTML();
+
+ base::WeakPtrFactory<PDFIFrameNavigationThrottleQt> weak_factory_{this};
+};
+
+} // namespace extensions
+
+#endif // PDF_IFRAME_NAVIGATION_THROTTLE_QT
diff --git a/src/core/extensions/pdf_web_contents_helper_client_qt.h b/src/core/extensions/pdf_web_contents_helper_client_qt.h
deleted file mode 100644
index 9a37375b3..000000000
--- a/src/core/extensions/pdf_web_contents_helper_client_qt.h
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef PDF_WEB_CONTENTS_HELPER_CLIENT_QT_H_
-#define PDF_WEB_CONTENTS_HELPER_CLIENT_QT_H_
-
-#include "base/macros.h"
-#include "components/pdf/browser/pdf_web_contents_helper_client.h"
-
-namespace extensions {
-
-class PDFWebContentsHelperClientQt : public pdf::PDFWebContentsHelperClient
-{
-public:
- PDFWebContentsHelperClientQt();
- ~PDFWebContentsHelperClientQt() override;
-
-private:
- // pdf::PDFWebContentsHelperClient:
- void UpdateContentRestrictions(content::WebContents *contents, int content_restrictions) override;
- void OnPDFHasUnsupportedFeature(content::WebContents *contents) override;
- void OnSaveURL(content::WebContents *contents) override;
-
- DISALLOW_COPY_AND_ASSIGN(PDFWebContentsHelperClientQt);
-};
-
-} // namespace extensions
-
-#endif // PDF_WEB_CONTENTS_HELPER_CLIENT_QT_H_
diff --git a/src/core/extensions/plugin_service_filter_qt.cpp b/src/core/extensions/plugin_service_filter_qt.cpp
new file mode 100644
index 000000000..1f6c606bc
--- /dev/null
+++ b/src/core/extensions/plugin_service_filter_qt.cpp
@@ -0,0 +1,64 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "extensions/plugin_service_filter_qt.h"
+
+#include "content/public/browser/render_process_host.h"
+
+#include "web_contents_delegate_qt.h"
+#include "web_engine_settings.h"
+
+using namespace QtWebEngineCore;
+
+namespace extensions {
+
+// static
+PluginServiceFilterQt *PluginServiceFilterQt::GetInstance()
+{
+ return base::Singleton<PluginServiceFilterQt>::get();
+}
+
+bool PluginServiceFilterQt::IsPluginAvailable(int render_process_id, int render_frame_id,
+ content::BrowserContext *browser_context,
+ const content::WebPluginInfo &plugin)
+{
+ Q_UNUSED(plugin);
+ Q_UNUSED(browser_context);
+ content::RenderFrameHost *frame_host = content::RenderFrameHost::FromID(render_process_id, render_frame_id);
+ content::WebContents *web_contents = content::WebContents::FromRenderFrameHost(frame_host);
+ if (!web_contents) {
+ // Availability checked somewhere before/during WebContents initialization. Let it load and enable
+ // all the plugins at this phase. This information will be queried again when receiving the response
+ // for the requested content. Postponing our decision and enabling/blocking there makes WebEngineSettings
+ // modifiable in runtime without reconstructing WebContents.
+ return true;
+ }
+
+ if (web_contents->IsInnerWebContentsForGuest())
+ web_contents = web_contents->GetOuterWebContents();
+
+ if (auto *delegate = static_cast<WebContentsDelegateQt *>(web_contents->GetDelegate())) {
+ const WebEngineSettings *settings = delegate->webEngineSettings();
+ if (!settings->testAttribute(QWebEngineSettings::PdfViewerEnabled)
+ || !settings->testAttribute(QWebEngineSettings::PluginsEnabled))
+ return false;
+ }
+
+ return true;
+}
+
+bool PluginServiceFilterQt::CanLoadPlugin(int render_process_id,
+ const base::FilePath &path)
+{
+ return true;
+}
+
+PluginServiceFilterQt::PluginServiceFilterQt()
+{
+}
+
+PluginServiceFilterQt::~PluginServiceFilterQt()
+{
+}
+
+} // namespace extensions
diff --git a/src/core/extensions/plugin_service_filter_qt.h b/src/core/extensions/plugin_service_filter_qt.h
new file mode 100644
index 000000000..d171edfde
--- /dev/null
+++ b/src/core/extensions/plugin_service_filter_qt.h
@@ -0,0 +1,33 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef PLUGIN_SERVICE_FILTER_QT
+#define PLUGIN_SERVICE_FILTER_QT
+
+#include "content/public/browser/plugin_service_filter.h"
+
+#include "base/memory/singleton.h"
+
+namespace extensions {
+
+class PluginServiceFilterQt : public content::PluginServiceFilter {
+public:
+ static PluginServiceFilterQt* GetInstance();
+
+ bool IsPluginAvailable(int render_process_id, int render_frame_id,
+ content::BrowserContext *browser_context,
+ const content::WebPluginInfo &plugin) override;
+
+ bool CanLoadPlugin(int render_process_id,
+ const base::FilePath &path) override;
+
+private:
+ friend struct base::DefaultSingletonTraits<PluginServiceFilterQt>;
+
+ PluginServiceFilterQt();
+ ~PluginServiceFilterQt();
+};
+
+} // namespace extensions
+
+#endif // PLUGIN_SERVICE_FILTER_QT
diff --git a/src/core/favicon_driver_qt.cpp b/src/core/favicon_driver_qt.cpp
new file mode 100644
index 000000000..bb4a734b4
--- /dev/null
+++ b/src/core/favicon_driver_qt.cpp
@@ -0,0 +1,422 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+// Based on components/favicon/content/content_favicon_driver.cc:
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "favicon_driver_qt.h"
+#include "type_conversion.h"
+#include "web_contents_adapter_client.h"
+#include "web_engine_settings.h"
+
+#include "components/favicon/content/favicon_url_util.h"
+#include "components/favicon/core/favicon_service.h"
+#include "content/public/browser/browser_context.h"
+#include "content/public/browser/favicon_status.h"
+#include "content/public/browser/navigation_entry.h"
+#include "content/public/browser/navigation_handle.h"
+#include "content/public/browser/page.h"
+#include "content/public/browser/render_frame_host.h"
+#include "third_party/blink/public/mojom/manifest/manifest.mojom.h"
+
+namespace QtWebEngineCore {
+
+namespace {
+
+int activeHandlersCount(QWebEngineSettings *settings)
+{
+ bool touchIconsEnabled = settings->testAttribute(QWebEngineSettings::TouchIconsEnabled);
+ return touchIconsEnabled ? 2 : 1;
+}
+
+} // namespace
+
+FaviconStatusQt::FaviconStatusQt()
+ : FaviconStatus(), source(favicon::FaviconDriverObserver::NON_TOUCH_16_DIP)
+{
+}
+
+// static
+void FaviconDriverQt::CreateForWebContents(content::WebContents *webContents,
+ favicon::CoreFaviconService *faviconService,
+ WebContentsAdapterClient *viewClient)
+{
+ if (FromWebContents(webContents))
+ return;
+
+ webContents->SetUserData(
+ UserDataKey(),
+ base::WrapUnique(new FaviconDriverQt(webContents, faviconService, viewClient)));
+}
+
+FaviconDriverQt::FaviconDriverQt(content::WebContents *webContents,
+ favicon::CoreFaviconService *faviconService,
+ WebContentsAdapterClient *viewClient)
+ : content::WebContentsObserver(webContents)
+ , content::WebContentsUserData<FaviconDriverQt>(*webContents)
+ , m_faviconService(faviconService)
+ , m_viewClient(viewClient)
+{
+ if (!m_faviconService)
+ return;
+
+ m_handlers.push_back(std::make_unique<favicon::FaviconHandler>(
+ m_faviconService, this, favicon::FaviconDriverObserver::NON_TOUCH_16_DIP));
+ m_handlers.push_back(std::make_unique<favicon::FaviconHandler>(
+ m_faviconService, this, favicon::FaviconDriverObserver::NON_TOUCH_LARGEST));
+ m_handlers.push_back(std::make_unique<favicon::FaviconHandler>(
+ m_faviconService, this, favicon::FaviconDriverObserver::TOUCH_LARGEST));
+}
+
+void FaviconDriverQt::FetchFavicon(const GURL &page_url, bool is_same_document)
+{
+ QWebEngineSettings *settings = m_viewClient->webEngineSettings();
+ bool iconsEnabled = settings->testAttribute(QWebEngineSettings::AutoLoadIconsForPage);
+ bool touchIconsEnabled = settings->testAttribute(QWebEngineSettings::TouchIconsEnabled);
+
+ if (!iconsEnabled)
+ return;
+
+ for (const std::unique_ptr<favicon::FaviconHandler> &handler : m_handlers) {
+ switch (handler->Type()) {
+ case favicon::FaviconDriverObserver::NON_TOUCH_16_DIP:
+ if (touchIconsEnabled)
+ continue;
+ break;
+ case favicon::FaviconDriverObserver::NON_TOUCH_LARGEST:
+ case favicon::FaviconDriverObserver::TOUCH_LARGEST:
+ if (!touchIconsEnabled)
+ continue;
+ break;
+ }
+
+ handler->FetchFavicon(page_url, is_same_document);
+ }
+}
+
+gfx::Image FaviconDriverQt::GetFavicon() const
+{
+ // Like GetTitle(), we also want to use the favicon for the last committed
+ // entry rather than a pending navigation entry.
+ content::NavigationController &controller = web_contents()->GetController();
+
+ content::NavigationEntry *entry = controller.GetLastCommittedEntry();
+ if (entry)
+ return entry->GetFavicon().image;
+ return gfx::Image();
+}
+
+bool FaviconDriverQt::FaviconIsValid() const
+{
+ content::NavigationController &controller = web_contents()->GetController();
+
+ content::NavigationEntry *entry = controller.GetLastCommittedEntry();
+ if (entry)
+ return entry->GetFavicon().valid;
+
+ return false;
+}
+
+GURL FaviconDriverQt::GetActiveURL()
+{
+ content::NavigationEntry *entry = web_contents()->GetController().GetLastCommittedEntry();
+ return entry ? entry->GetURL() : GURL();
+}
+
+GURL FaviconDriverQt::GetManifestURL(content::RenderFrameHost *rfh)
+{
+ DocumentManifestData *document_data = DocumentManifestData::GetOrCreateForCurrentDocument(rfh);
+ return document_data->has_manifest_url ? rfh->GetPage().GetManifestUrl().value_or(GURL())
+ : GURL();
+}
+
+GURL FaviconDriverQt::GetFaviconURL() const
+{
+ content::NavigationController &controller = web_contents()->GetController();
+
+ content::NavigationEntry *entry = controller.GetLastCommittedEntry();
+ if (entry)
+ return entry->GetFavicon().url;
+ return GURL();
+}
+
+FaviconDriverQt::DocumentManifestData::DocumentManifestData(content::RenderFrameHost *rfh)
+ : content::DocumentUserData<DocumentManifestData>(rfh)
+{
+}
+
+FaviconDriverQt::DocumentManifestData::~DocumentManifestData() = default;
+
+FaviconDriverQt::NavigationManifestData::NavigationManifestData(
+ content::NavigationHandle &navigation_handle)
+{
+}
+
+FaviconDriverQt::NavigationManifestData::~NavigationManifestData() = default;
+
+void FaviconDriverQt::OnDidDownloadManifest(ManifestDownloadCallback callback,
+ const GURL &manifest_url,
+ blink::mojom::ManifestPtr manifest)
+{
+ Q_UNUSED(manifest_url);
+
+ // ~WebContentsImpl triggers running any pending callbacks for manifests.
+ // As we're about to be destroyed ignore the request. To do otherwise may
+ // result in calling back to this and attempting to use the WebContents, which
+ // will crash.
+ if (!web_contents())
+ return;
+
+ std::vector<favicon::FaviconURL> candidates;
+ if (manifest) {
+ for (const auto &icon : manifest->icons) {
+ candidates.emplace_back(icon.src, favicon_base::IconType::kWebManifestIcon, icon.sizes);
+ }
+ }
+ std::move(callback).Run(candidates);
+}
+
+int FaviconDriverQt::DownloadImage(const GURL &url, int max_image_size,
+ ImageDownloadCallback callback)
+{
+ bool bypass_cache = (m_bypassCachePageURL == GetActiveURL());
+ m_bypassCachePageURL = GURL();
+
+ const gfx::Size preferred_size(max_image_size, max_image_size);
+ return web_contents()->DownloadImage(url, true, preferred_size,
+ /*max_bitmap_size=*/max_image_size,
+ bypass_cache, std::move(callback));
+}
+
+void FaviconDriverQt::DownloadManifest(const GURL &url, ManifestDownloadCallback callback)
+{
+ // TODO(crbug.com/1201237): This appears to be reachable from pages other
+ // than the primary page. This code should likely be refactored so that either
+ // this is unreachable from other pages, or the correct page is plumbed in
+ // here.
+ web_contents()->GetPrimaryPage().GetManifest(base::BindOnce(
+ &FaviconDriverQt::OnDidDownloadManifest, base::Unretained(this), std::move(callback)));
+}
+
+bool FaviconDriverQt::IsOffTheRecord()
+{
+ DCHECK(web_contents());
+ return web_contents()->GetBrowserContext()->IsOffTheRecord();
+}
+
+void FaviconDriverQt::OnFaviconUpdated(
+ const GURL &page_url,
+ favicon::FaviconDriverObserver::NotificationIconType notification_icon_type,
+ const GURL &icon_url, bool icon_url_changed, const gfx::Image &image)
+{
+ Q_UNUSED(page_url);
+
+ QWebEngineSettings *settings = m_viewClient->webEngineSettings();
+ bool touchIconsEnabled = settings->testAttribute(QWebEngineSettings::TouchIconsEnabled);
+
+ // Prefer touch icons over favicons if touch icons are enabled.
+ if (!touchIconsEnabled
+ || m_latestFavicon.source != favicon::FaviconDriverObserver::TOUCH_LARGEST
+ || notification_icon_type == favicon::FaviconDriverObserver::TOUCH_LARGEST) {
+ m_latestFavicon.valid = true;
+ m_latestFavicon.url = icon_url;
+ m_latestFavicon.image = image;
+ m_latestFavicon.source = notification_icon_type;
+ }
+
+ NotifyFaviconUpdatedObservers(notification_icon_type, icon_url, icon_url_changed, image);
+ emitIconChangedIfNeeded();
+}
+
+void FaviconDriverQt::OnFaviconDeleted(
+ const GURL &page_url,
+ favicon::FaviconDriverObserver::NotificationIconType notification_icon_type)
+{
+ content::NavigationEntry *entry = web_contents()->GetController().GetLastCommittedEntry();
+ DCHECK(entry && entry->GetURL() == page_url);
+
+ entry->GetFavicon() = FaviconStatusQt();
+ web_contents()->NotifyNavigationStateChanged(content::INVALIDATE_TYPE_TAB);
+
+ NotifyFaviconUpdatedObservers(notification_icon_type, /*icon_url=*/GURL(),
+ /*icon_url_changed=*/true, FaviconStatusQt().image);
+}
+
+void FaviconDriverQt::OnHandlerCompleted(favicon::FaviconHandler *handler)
+{
+ Q_UNUSED(handler);
+
+ if (activeHandlersCount(m_viewClient->webEngineSettings()) > m_completedHandlersCount)
+ ++m_completedHandlersCount;
+ emitIconChangedIfNeeded();
+}
+
+void FaviconDriverQt::DidUpdateFaviconURL(
+ content::RenderFrameHost *rfh, const std::vector<blink::mojom::FaviconURLPtr> &candidates)
+{
+ // Ignore the update if there is no last committed navigation entry. This can
+ // occur when loading an initially blank page.
+ content::NavigationEntry *entry = web_contents()->GetController().GetLastCommittedEntry();
+
+ if (!entry)
+ return;
+
+ // We update |m_faviconUrls| even if the list is believed to be partial
+ // (checked below), because callers of our getter favicon_urls() expect so.
+ std::vector<blink::mojom::FaviconURLPtr> faviconUrls;
+ for (const auto &candidate : candidates)
+ faviconUrls.push_back(candidate.Clone());
+ m_faviconUrls = std::move(faviconUrls);
+
+ if (!rfh->IsDocumentOnLoadCompletedInMainFrame())
+ return;
+
+ OnUpdateCandidates(rfh->GetLastCommittedURL(),
+ favicon::FaviconURLsFromContentFaviconURLs(candidates), GetManifestURL(rfh));
+}
+
+void FaviconDriverQt::DidUpdateWebManifestURL(content::RenderFrameHost *rfh,
+ const GURL &manifest_url)
+{
+ Q_UNUSED(manifest_url);
+
+ // Ignore the update if there is no last committed navigation entry. This can
+ // occur when loading an initially blank page.
+ content::NavigationEntry *entry = web_contents()->GetController().GetLastCommittedEntry();
+ if (!entry || !rfh->IsDocumentOnLoadCompletedInMainFrame())
+ return;
+
+ DocumentManifestData *document_data = DocumentManifestData::GetOrCreateForCurrentDocument(rfh);
+ document_data->has_manifest_url = true;
+
+ // On regular page loads, DidUpdateManifestURL() is guaranteed to be called
+ // before DidUpdateFaviconURL(). However, a page can update the favicons via
+ // javascript.
+ if (!rfh->FaviconURLs().empty()) {
+ OnUpdateCandidates(rfh->GetLastCommittedURL(),
+ favicon::FaviconURLsFromContentFaviconURLs(rfh->FaviconURLs()),
+ GetManifestURL(rfh));
+ }
+}
+
+void FaviconDriverQt::DidStartNavigation(content::NavigationHandle *navigation_handle)
+{
+ if (!navigation_handle->IsInPrimaryMainFrame())
+ return;
+
+ if (!navigation_handle->IsSameDocument()) {
+ m_completedHandlersCount = 0;
+ m_latestFavicon = FaviconStatusQt();
+ m_viewClient->iconChanged(QUrl());
+ }
+
+ content::ReloadType reload_type = navigation_handle->GetReloadType();
+ if (reload_type == content::ReloadType::NONE || IsOffTheRecord())
+ return;
+
+ if (!navigation_handle->IsSameDocument()) {
+ NavigationManifestData *navigation_data =
+ NavigationManifestData::GetOrCreateForNavigationHandle(*navigation_handle);
+ navigation_data->has_manifest_url = false;
+ }
+
+ if (reload_type == content::ReloadType::BYPASSING_CACHE)
+ m_bypassCachePageURL = navigation_handle->GetURL();
+
+ SetFaviconOutOfDateForPage(navigation_handle->GetURL(),
+ reload_type == content::ReloadType::BYPASSING_CACHE);
+}
+
+void FaviconDriverQt::DidFinishNavigation(content::NavigationHandle *navigation_handle)
+{
+ if (!navigation_handle->IsInPrimaryMainFrame() || !navigation_handle->HasCommitted()
+ || navigation_handle->IsErrorPage()) {
+ return;
+ }
+
+ // Transfer in-flight navigation data to the document user data.
+ NavigationManifestData *navigation_data =
+ NavigationManifestData::GetOrCreateForNavigationHandle(*navigation_handle);
+ DocumentManifestData *document_data = DocumentManifestData::GetOrCreateForCurrentDocument(
+ navigation_handle->GetRenderFrameHost());
+ document_data->has_manifest_url = navigation_data->has_manifest_url;
+
+ // Wait till the user navigates to a new URL to start checking the cache
+ // again. The cache may be ignored for non-reload navigations (e.g.
+ // history.replace() in-page navigation). This is allowed to increase the
+ // likelihood that "reloading a page ignoring the cache" redownloads the
+ // favicon. In particular, a page may do an in-page navigation before
+ // FaviconHandler has the time to determine that the favicon needs to be
+ // redownloaded.
+ GURL url = navigation_handle->GetURL();
+ if (url != m_bypassCachePageURL)
+ m_bypassCachePageURL = GURL();
+
+ // Get the favicon, either from history or request it from the net.
+ FetchFavicon(url, navigation_handle->IsSameDocument());
+}
+
+void FaviconDriverQt::SetFaviconOutOfDateForPage(const GURL &url, bool force_reload)
+{
+ if (m_faviconService) {
+ m_faviconService->SetFaviconOutOfDateForPage(url);
+ if (force_reload)
+ m_faviconService->ClearUnableToDownloadFavicons();
+ }
+}
+
+void FaviconDriverQt::OnUpdateCandidates(const GURL &page_url,
+ const std::vector<favicon::FaviconURL> &candidates,
+ const GURL &manifest_url)
+{
+ QWebEngineSettings *settings = m_viewClient->webEngineSettings();
+ bool touchIconsEnabled = settings->testAttribute(QWebEngineSettings::TouchIconsEnabled);
+ for (const std::unique_ptr<favicon::FaviconHandler> &handler : m_handlers) {
+ switch (handler->Type()) {
+ case favicon::FaviconDriverObserver::NON_TOUCH_16_DIP:
+ if (touchIconsEnabled)
+ continue;
+ break;
+ case favicon::FaviconDriverObserver::NON_TOUCH_LARGEST:
+ case favicon::FaviconDriverObserver::TOUCH_LARGEST:
+ if (!touchIconsEnabled)
+ continue;
+ break;
+ }
+
+ // We feed in the Web Manifest URL (if any) to the instance handling type
+ // kWebManifestIcon, because those compete which each other (i.e. manifest
+ // icons override inline touch icons).
+ handler->OnUpdateCandidates(
+ page_url, candidates,
+ (handler->icon_types().count(favicon_base::IconType::kWebManifestIcon) != 0)
+ ? manifest_url
+ : GURL::EmptyGURL());
+ }
+}
+
+void FaviconDriverQt::emitIconChangedIfNeeded()
+{
+ if (activeHandlersCount(m_viewClient->webEngineSettings()) != m_completedHandlersCount)
+ return;
+
+ content::NavigationEntry *entry = web_contents()->GetController().GetLastCommittedEntry();
+ DCHECK(entry);
+
+ if (entry->GetFavicon().url != m_latestFavicon.url) {
+ entry->GetFavicon().valid = m_latestFavicon.valid;
+ entry->GetFavicon().url = m_latestFavicon.url;
+ entry->GetFavicon().image = m_latestFavicon.image;
+ web_contents()->NotifyNavigationStateChanged(content::INVALIDATE_TYPE_TAB);
+ }
+
+ m_viewClient->iconChanged(toQt(m_latestFavicon.url));
+}
+
+NAVIGATION_HANDLE_USER_DATA_KEY_IMPL(FaviconDriverQt::NavigationManifestData);
+DOCUMENT_USER_DATA_KEY_IMPL(FaviconDriverQt::DocumentManifestData);
+WEB_CONTENTS_USER_DATA_KEY_IMPL(FaviconDriverQt);
+
+} // namespace QtWebEngineCore
diff --git a/src/core/favicon_driver_qt.h b/src/core/favicon_driver_qt.h
new file mode 100644
index 000000000..96bd682a2
--- /dev/null
+++ b/src/core/favicon_driver_qt.h
@@ -0,0 +1,151 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#ifndef FAVICON_DRIVER_QT_H
+#define FAVICON_DRIVER_QT_H
+
+#include "qtwebenginecoreglobal_p.h"
+
+#include "components/favicon/core/favicon_driver.h"
+#include "components/favicon/core/favicon_handler.h"
+#include "content/public/browser/document_user_data.h"
+#include "content/public/browser/favicon_status.h"
+#include "content/public/browser/navigation_handle_user_data.h"
+#include "content/public/browser/web_contents_observer.h"
+#include "content/public/browser/web_contents_user_data.h"
+#include "third_party/blink/public/mojom/favicon/favicon_url.mojom.h"
+
+namespace content {
+class WebContents;
+}
+
+namespace favicon {
+class CoreFaviconService;
+}
+
+namespace QtWebEngineCore {
+
+class WebContentsAdapterClient;
+
+struct FaviconStatusQt : public content::FaviconStatus
+{
+ FaviconStatusQt();
+
+ // Type of the favicon::FaviconHandler that provided this icon.
+ favicon::FaviconDriverObserver::NotificationIconType source;
+};
+
+class FaviconDriverQt : public favicon::FaviconDriver,
+ public favicon::FaviconHandler::Delegate,
+ public content::WebContentsObserver,
+ public content::WebContentsUserData<FaviconDriverQt>
+{
+public:
+ static void CreateForWebContents(content::WebContents *webContents,
+ favicon::CoreFaviconService *faviconService,
+ WebContentsAdapterClient *viewClient);
+
+ // FaviconDriver implementation.
+ void FetchFavicon(const GURL &page_url, bool is_same_document) override;
+ gfx::Image GetFavicon() const override;
+ bool FaviconIsValid() const override;
+ GURL GetActiveURL() override;
+
+ GURL GetManifestURL(content::RenderFrameHost *rfh);
+ GURL GetFaviconURL() const;
+
+protected:
+ FaviconDriverQt(content::WebContents *webContent, favicon::CoreFaviconService *faviconService,
+ WebContentsAdapterClient *viewClient);
+
+private:
+ friend class content::WebContentsUserData<FaviconDriverQt>;
+
+ // TODO(crbug.com/1205018): these two classes are current used to ensure that
+ // we disregard manifest URL updates that arrive prior to onload firing.
+ struct DocumentManifestData : public content::DocumentUserData<DocumentManifestData>
+ {
+ explicit DocumentManifestData(content::RenderFrameHost *rfh);
+ ~DocumentManifestData() override;
+ DOCUMENT_USER_DATA_KEY_DECL();
+ bool has_manifest_url = false;
+ };
+
+ struct NavigationManifestData : public content::NavigationHandleUserData<NavigationManifestData>
+ {
+ explicit NavigationManifestData(content::NavigationHandle &navigation_handle);
+ ~NavigationManifestData() override;
+ NAVIGATION_HANDLE_USER_DATA_KEY_DECL();
+ bool has_manifest_url = false;
+ };
+
+ // Callback when a manifest is downloaded.
+ void OnDidDownloadManifest(ManifestDownloadCallback callback, const GURL &manifest_url,
+ blink::mojom::ManifestPtr manifest);
+
+ // FaviconHandler::Delegate implementation.
+ int DownloadImage(const GURL &url, int max_image_size, ImageDownloadCallback callback) override;
+ void DownloadManifest(const GURL &url, ManifestDownloadCallback callback) override;
+ bool IsOffTheRecord() override;
+ void OnFaviconUpdated(const GURL &page_url,
+ favicon::FaviconDriverObserver::NotificationIconType icon_type,
+ const GURL &icon_url, bool icon_url_changed,
+ const gfx::Image &image) override;
+ void OnFaviconDeleted(
+ const GURL &page_url,
+ favicon::FaviconDriverObserver::NotificationIconType notification_icon_type) override;
+ void OnHandlerCompleted(favicon::FaviconHandler *handler) override;
+
+ // content::WebContentsObserver implementation.
+ void DidUpdateFaviconURL(content::RenderFrameHost *rfh,
+ const std::vector<blink::mojom::FaviconURLPtr> &candidates) override;
+ void DidUpdateWebManifestURL(content::RenderFrameHost *rfh, const GURL &manifest_url) override;
+ void DidStartNavigation(content::NavigationHandle *navigation_handle) override;
+ void DidFinishNavigation(content::NavigationHandle *navigation_handle) override;
+
+ // Informs CoreFaviconService that the favicon for |url| is out of date. If
+ // |force_reload| is true, then discard information about favicon download
+ // failures.
+ void SetFaviconOutOfDateForPage(const GURL &url, bool force_reload);
+
+ // Broadcasts new favicon URL candidates to FaviconHandlers.
+ void OnUpdateCandidates(const GURL &page_url,
+ const std::vector<favicon::FaviconURL> &candidates,
+ const GURL &manifest_url);
+
+ void emitIconChangedIfNeeded();
+
+ // KeyedService used by FaviconDriverImpl. It may be null during testing,
+ // but if it is defined, it must outlive the FaviconDriverImpl.
+ raw_ptr<favicon::CoreFaviconService> m_faviconService;
+
+ WebContentsAdapterClient *m_viewClient;
+
+ // FaviconHandlers are used to download the different kind of favicons.
+ std::vector<std::unique_ptr<favicon::FaviconHandler>> m_handlers;
+
+ GURL m_bypassCachePageURL;
+
+ // nullopt until the actual list is reported via DidUpdateFaviconURL().
+ absl::optional<std::vector<blink::mojom::FaviconURLPtr>> m_faviconUrls;
+
+ int m_completedHandlersCount = 0;
+ FaviconStatusQt m_latestFavicon;
+
+ WEB_CONTENTS_USER_DATA_KEY_DECL();
+};
+
+} // namespace QtWebEngineCore
+
+#endif // FAVICON_DRIVER_QT_H
diff --git a/src/core/favicon_manager.cpp b/src/core/favicon_manager.cpp
deleted file mode 100644
index 412aab90d..000000000
--- a/src/core/favicon_manager.cpp
+++ /dev/null
@@ -1,418 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "favicon_manager.h"
-#include "type_conversion.h"
-#include "web_contents_adapter_client.h"
-#include "web_engine_settings.h"
-
-#include "base/bind.h"
-#include "content/public/browser/favicon_status.h"
-#include "content/public/browser/navigation_entry.h"
-#include "content/public/browser/web_contents.h"
-#include "content/public/common/url_constants.h"
-#include "net/base/data_url.h"
-#include "third_party/skia/include/core/SkBitmap.h"
-#include "third_party/skia/include/core/SkPixelRef.h"
-#include "ui/gfx/geometry/size.h"
-
-namespace QtWebEngineCore {
-
-static inline bool isResourceUrl(const QUrl &url)
-{
- return !url.scheme().compare(QLatin1String("qrc"));
-}
-
-static inline bool isDataUrl(const QUrl &url)
-{
- return !url.scheme().compare(QLatin1String(url::kDataScheme));
-}
-
-static inline unsigned area(const QSize &size)
-{
- return size.width() * size.height();
-}
-
-
-FaviconManager::FaviconManager(content::WebContents *webContents, WebContentsAdapterClient *viewClient)
- : m_webContents(webContents)
- , m_viewClient(viewClient)
- , m_candidateCount(0)
- , m_weakFactory(new base::WeakPtrFactory<FaviconManager>(this))
-{
-}
-
-FaviconManager::~FaviconManager()
-{
-}
-
-int FaviconManager::downloadIcon(const QUrl &url)
-{
- static const uint32_t maxSize = 256;
- static int fakeId = 0;
- int id;
-
- bool cached = m_icons.contains(url);
- if (isResourceUrl(url) || isDataUrl(url) || cached) {
- id = --fakeId;
- m_pendingRequests.insert(id, url);
- } else {
- id = m_webContents->DownloadImage(
- toGurl(url),
- true, // is_favicon
- 0, // preferred_size
- maxSize,
- false, // normal cache policy
- base::Bind(&FaviconManager::iconDownloadFinished, m_weakFactory->GetWeakPtr()));
- }
-
- Q_ASSERT(!m_inProgressRequests.contains(id));
- m_inProgressRequests.insert(id, url);
-
- return id;
-}
-
-void FaviconManager::iconDownloadFinished(int id,
- int status,
- const GURL &url,
- const std::vector<SkBitmap> &bitmaps,
- const std::vector<gfx::Size> &original_bitmap_sizes)
-{
- Q_UNUSED(status);
- Q_UNUSED(url);
- Q_UNUSED(original_bitmap_sizes);
-
- storeIcon(id, toQIcon(bitmaps));
-}
-
-/* Pending requests are used to mark icons that are already downloaded (cached icons or icons
- * stored in qrc). These requests are also stored in the m_inProgressRequests but the corresponding
- * icons are stored in m_icons explicitly by this function. It is necessary to avoid
- * m_inProgressRequests being emptied right before the next icon is added by a downloadIcon() call.
- */
-void FaviconManager::downloadPendingRequests()
-{
- for (auto it = m_pendingRequests.cbegin(), end = m_pendingRequests.cend(); it != end; ++it) {
- QIcon icon;
-
- QUrl requestUrl = it.value();
- if (!m_icons.contains(requestUrl)) {
- if (isResourceUrl(requestUrl)) {
- icon = QIcon(requestUrl.toString().remove(0, 3));
- } else if (isDataUrl(requestUrl)) {
- std::string mime_type, char_set, data;
- if (net::DataURL::Parse(toGurl(requestUrl), &mime_type, &char_set, &data) && !data.empty()) {
- const unsigned char *src_data = reinterpret_cast<const unsigned char *>(data.data());
- QImage image = QImage::fromData(src_data, data.size());
- icon.addPixmap(QPixmap::fromImage(image).copy());
- }
- }
- }
-
- storeIcon(it.key(), icon);
- }
-
- m_pendingRequests.clear();
-}
-
-void FaviconManager::storeIcon(int id, const QIcon &icon)
-{
-
- // Icon download has been interrupted
- if (!m_inProgressRequests.contains(id))
- return;
-
- QUrl requestUrl = m_inProgressRequests[id];
- FaviconInfo &faviconInfo = m_faviconInfoMap[requestUrl];
-
- unsigned iconCount = 0;
- if (!icon.isNull())
- iconCount = icon.availableSizes().count();
-
- if (iconCount > 0) {
- m_icons.insert(requestUrl, icon);
-
- faviconInfo.size = icon.availableSizes().at(0);
- if (iconCount > 1) {
- faviconInfo.multiSize = true;
- unsigned bestArea = area(faviconInfo.size);
- for (unsigned i = 1; i < iconCount; ++i) {
- QSize iconSize = icon.availableSizes().at(i);
- if (bestArea < area(iconSize)) {
- faviconInfo.size = iconSize;
- bestArea = area(iconSize);
- }
- }
- }
- } else if (id >= 0) {
- // Reset size if icon cannot be downloaded
- faviconInfo.size = QSize(0, 0);
- }
-
- m_inProgressRequests.remove(id);
- if (m_inProgressRequests.isEmpty()) {
- WebEngineSettings *settings = m_viewClient->webEngineSettings();
- bool touchIconsEnabled = settings->testAttribute(WebEngineSettings::TouchIconsEnabled);
-
- generateCandidateIcon(touchIconsEnabled);
- const QUrl &iconUrl = candidateIconUrl(touchIconsEnabled);
- propagateIcon(iconUrl);
- }
-}
-
-void FaviconManager::propagateIcon(const QUrl &iconUrl) const
-{
- content::NavigationEntry *entry = m_webContents->GetController().GetVisibleEntry();
- if (entry) {
- content::FaviconStatus &favicon = entry->GetFavicon();
- favicon.url = toGurl(iconUrl);
- favicon.valid = true;
- }
-
- m_viewClient->iconChanged(iconUrl);
-}
-
-QIcon FaviconManager::getIcon(const QUrl &url) const
-{
- if (url.isEmpty())
- return m_candidateIcon;
-
- if (!m_icons.contains(url))
- return QIcon();
-
- return m_icons[url];
-}
-
-FaviconInfo FaviconManager::getFaviconInfo(const QUrl &url) const
-{
- Q_ASSERT(m_faviconInfoMap.contains(url));
- return m_faviconInfoMap[url];
-}
-
-QList<FaviconInfo> FaviconManager::getFaviconInfoList(bool candidatesOnly) const
-{
- QList<FaviconInfo> faviconInfoList = m_faviconInfoMap.values();
-
- if (candidatesOnly) {
- const auto hasNoCandidate = [](const FaviconInfo &info) { return !info.candidate; };
- faviconInfoList.erase(std::remove_if(faviconInfoList.begin(), faviconInfoList.end(),
- hasNoCandidate),
- faviconInfoList.end());
- }
-
- return faviconInfoList;
-}
-
-void FaviconManager::update(const QList<FaviconInfo> &candidates)
-{
- updateCandidates(candidates);
-
- WebEngineSettings *settings = m_viewClient->webEngineSettings();
- if (!settings->testAttribute(WebEngineSettings::AutoLoadIconsForPage)) {
- m_viewClient->iconChanged(QUrl());
- return;
- }
-
- bool touchIconsEnabled = settings->testAttribute(WebEngineSettings::TouchIconsEnabled);
-
- const QList<FaviconInfo> &faviconInfoList = getFaviconInfoList(true /* candidates only */);
- for (auto it = faviconInfoList.cbegin(), end = faviconInfoList.cend(); it != end; ++it) {
- if (!touchIconsEnabled && !(it->type & FaviconInfo::Favicon))
- continue;
-
- if (it->isValid())
- downloadIcon(it->url);
- }
-
- downloadPendingRequests();
-
- // Reset icon if nothing was downloaded
- if (m_inProgressRequests.isEmpty()) {
- content::NavigationEntry *entry = m_webContents->GetController().GetVisibleEntry();
- if (entry && !entry->GetFavicon().valid)
- m_viewClient->iconChanged(QUrl());
- }
-}
-
-void FaviconManager::updateCandidates(const QList<FaviconInfo> &candidates)
-{
- // Invalidate types of the already stored candidate icons because it might differ
- // among pages.
- for (FaviconInfo candidateFaviconInfo : candidates) {
- const QUrl &candidateUrl = candidateFaviconInfo.url;
- if (m_faviconInfoMap.contains(candidateUrl))
- m_faviconInfoMap[candidateUrl].type = FaviconInfo::InvalidIcon;
- }
-
- m_candidateCount = candidates.count();
- for (FaviconInfo candidateFaviconInfo : candidates) {
- const QUrl &candidateUrl = candidateFaviconInfo.url;
-
- if (!m_faviconInfoMap.contains(candidateUrl))
- m_faviconInfoMap.insert(candidateUrl, candidateFaviconInfo);
- else {
- // The same icon URL can be used for different types.
- m_faviconInfoMap[candidateUrl].type |= candidateFaviconInfo.type;
- }
-
- m_faviconInfoMap[candidateUrl].candidate = true;
- }
-}
-
-void FaviconManager::resetCandidates()
-{
- // Interrupt in progress icon downloads
- m_pendingRequests.clear();
- m_inProgressRequests.clear();
-
- m_candidateCount = 0;
- m_candidateIcon = QIcon();
- for (auto it = m_faviconInfoMap.begin(), end = m_faviconInfoMap.end(); it != end; ++it)
- it->candidate = false;
-}
-
-bool FaviconManager::hasCandidate() const
-{
- return (m_candidateCount > 0);
-}
-
-QUrl FaviconManager::candidateIconUrl(bool touchIconsEnabled) const
-{
- QUrl iconUrl;
- const QList<FaviconInfo> &faviconInfoList = getFaviconInfoList(true /* candidates only */);
-
- unsigned bestArea = 0;
- for (auto it = faviconInfoList.cbegin(), end = faviconInfoList.cend(); it != end; ++it) {
- if (!touchIconsEnabled && !(it->type & FaviconInfo::Favicon))
- continue;
-
- if (it->isValid() && bestArea < area(it->size)) {
- iconUrl = it->url;
- bestArea = area(it->size);
- }
- }
-
- return iconUrl;
-}
-
-void FaviconManager::generateCandidateIcon(bool touchIconsEnabled)
-{
- Q_ASSERT(m_candidateCount);
-
- m_candidateIcon = QIcon();
- const QList<FaviconInfo> &faviconInfoList = getFaviconInfoList(true /* candidates only */);
-
- for (auto it = faviconInfoList.cbegin(), end = faviconInfoList.cend(); it != end; ++it) {
- if (!touchIconsEnabled && !(it->type & FaviconInfo::Favicon))
- continue;
-
- if (!it->isValid() || !it->isDownloaded())
- continue;
-
- const QIcon &icon = getIcon(it->url);
-
- if (!it->multiSize) {
- if (!m_candidateIcon.availableSizes().contains(it->size))
- m_candidateIcon.addPixmap(icon.pixmap(it->size));
-
- continue;
- }
-
- const auto sizes = icon.availableSizes();
- for (const QSize &size : sizes) {
- if (!m_candidateIcon.availableSizes().contains(size))
- m_candidateIcon.addPixmap(icon.pixmap(size));
- }
- }
-}
-
-void FaviconManager::copyStateFrom(FaviconManager *source)
-{
- m_faviconInfoMap = source->m_faviconInfoMap;
- m_icons = source->m_icons;
-}
-
-FaviconInfo::FaviconInfo()
- : url(QUrl())
- , type(FaviconInfo::InvalidIcon)
- , size(QSize(0, 0))
- , candidate(false)
- , multiSize(false)
-{
-}
-
-FaviconInfo::FaviconInfo(const FaviconInfo &other)
- : url(other.url)
- , type(other.type)
- , size(other.size)
- , candidate(other.candidate)
- , multiSize(other.multiSize)
-{
-}
-
-FaviconInfo::FaviconInfo(const QUrl &url, FaviconInfo::FaviconTypeFlags type)
- : url(url)
- , type(type)
- , size(QSize(0, 0))
- , candidate(false)
- , multiSize(false)
-{
-}
-
-FaviconInfo::~FaviconInfo()
-{
-}
-
-bool FaviconInfo::isValid() const
-{
- if (type == FaviconInfo::InvalidIcon)
- return false;
-
- if (url.isEmpty() || !url.isValid())
- return false;
-
- return true;
-}
-
-bool FaviconInfo::isDownloaded() const
-{
- return area(size) > 0;
-}
-
-} // namespace QtWebEngineCore
diff --git a/src/core/favicon_manager.h b/src/core/favicon_manager.h
deleted file mode 100644
index a8247d15f..000000000
--- a/src/core/favicon_manager.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#ifndef FAVICON_MANAGER_H
-#define FAVICON_MANAGER_H
-
-#include "qtwebenginecoreglobal_p.h"
-#include <memory>
-#include <QtCore/QMap>
-#include <QtCore/QObject>
-#include <QtCore/QSize>
-#include <QtCore/QUrl>
-#include <QtGui/QIcon>
-
-#include "web_engine_settings.h"
-
-class GURL;
-class SkBitmap;
-
-namespace gfx {
-class Size;
-}
-
-namespace content {
-class WebContents;
-}
-
-namespace base {
-template<class T>
-class WeakPtrFactory;
-}
-
-namespace QtWebEngineCore {
-
-class WebContentsAdapterClient;
-
-// Based on src/3rdparty/chromium/content/public/common/favicon_url.h
-class Q_WEBENGINECORE_PRIVATE_EXPORT FaviconInfo {
-public:
- enum FaviconTypeFlag {
- InvalidIcon = 0,
- Favicon = 1 << 0,
- TouchIcon = 1 << 1,
- TouchPrecomposedIcon = 1 << 2
- };
- Q_DECLARE_FLAGS(FaviconTypeFlags, FaviconTypeFlag)
-
- FaviconInfo();
- FaviconInfo(const FaviconInfo &);
- FaviconInfo(const QUrl &, FaviconInfo::FaviconTypeFlags);
- ~FaviconInfo();
-
- bool isValid() const;
- bool isDownloaded() const;
-
- QUrl url;
- FaviconTypeFlags type;
- // Stores the largest size in case of multi-size icon
- QSize size;
- bool candidate;
- bool multiSize;
-};
-
-
-class Q_WEBENGINECORE_PRIVATE_EXPORT FaviconManager {
-
-public:
- FaviconManager(content::WebContents *, WebContentsAdapterClient *);
- ~FaviconManager();
-
- QIcon getIcon(const QUrl &url = QUrl()) const;
- FaviconInfo getFaviconInfo(const QUrl &) const;
- QList<FaviconInfo> getFaviconInfoList(bool) const;
- void copyStateFrom(FaviconManager *source);
-
-private:
- void update(const QList<FaviconInfo> &);
- void updateCandidates(const QList<FaviconInfo> &);
- void resetCandidates();
- bool hasCandidate() const;
- QUrl candidateIconUrl(bool touchIconsEnabled) const;
- void generateCandidateIcon(bool touchIconsEnabled);
- int downloadIcon(const QUrl &);
- void iconDownloadFinished(int, int, const GURL &, const std::vector<SkBitmap> &, const std::vector<gfx::Size> &);
- void storeIcon(int, const QIcon &);
- void downloadPendingRequests();
- void propagateIcon(const QUrl &) const;
-
-private:
- content::WebContents *m_webContents;
- WebContentsAdapterClient *m_viewClient;
- QMap<QUrl, FaviconInfo> m_faviconInfoMap;
- int m_candidateCount;
- QIcon m_candidateIcon;
- QMap<QUrl, QIcon> m_icons;
- QMap<int, QUrl> m_inProgressRequests;
- QMap<int, QUrl> m_pendingRequests;
- std::unique_ptr<base::WeakPtrFactory<FaviconManager>> m_weakFactory;
- friend class WebContentsDelegateQt;
-};
-
-} // namespace QtWebEngineCore
-
-#endif // FAVICON_MANAGER_H
diff --git a/src/core/favicon_service_factory_qt.cpp b/src/core/favicon_service_factory_qt.cpp
new file mode 100644
index 000000000..dd2a1979a
--- /dev/null
+++ b/src/core/favicon_service_factory_qt.cpp
@@ -0,0 +1,163 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "favicon_service_factory_qt.h"
+
+#include "base/files/file_util.h"
+#include "components/favicon/core/favicon_service_impl.h"
+#include "components/history/content/browser/content_visit_delegate.h"
+#include "components/history/content/browser/history_database_helper.h"
+#include "components/history/core/browser/history_backend_client.h"
+#include "components/history/core/browser/history_database_params.h"
+#include "components/history/core/browser/history_service.h"
+#include "components/keyed_service/content/browser_context_dependency_manager.h"
+#include "content/public/browser/browser_context.h"
+#include "url/gurl.h"
+
+namespace QtWebEngineCore {
+
+void HistoryClientQt::OnHistoryServiceCreated(history::HistoryService *history_service)
+{
+ Q_UNUSED(history_service);
+}
+
+void HistoryClientQt::Shutdown() { }
+
+static bool CanAddURL(const GURL &url)
+{
+ Q_UNUSED(url);
+ return true;
+}
+
+history::CanAddURLCallback HistoryClientQt::GetThreadSafeCanAddURLCallback() const
+{
+ return base::BindRepeating(&CanAddURL);
+}
+
+void HistoryClientQt::NotifyProfileError(sql::InitStatus init_status,
+ const std::string &diagnostics)
+{
+ Q_UNUSED(init_status);
+ Q_UNUSED(diagnostics);
+}
+
+std::unique_ptr<history::HistoryBackendClient> HistoryClientQt::CreateBackendClient()
+{
+ return nullptr;
+}
+
+void HistoryClientQt::UpdateBookmarkLastUsedTime(const base::Uuid &, base::Time /*time*/)
+{
+}
+
+// static
+history::HistoryService *
+HistoryServiceFactoryQt::GetForBrowserContext(content::BrowserContext *context)
+{
+ if (context->IsOffTheRecord())
+ return nullptr;
+
+
+ return static_cast<history::HistoryService *>(
+ GetInstance()->GetServiceForBrowserContext(context, true));
+}
+
+// static
+HistoryServiceFactoryQt *HistoryServiceFactoryQt::GetInstance()
+{
+ return base::Singleton<HistoryServiceFactoryQt>::get();
+}
+
+HistoryServiceFactoryQt::HistoryServiceFactoryQt()
+ : BrowserContextKeyedServiceFactory("HistoryService",
+ BrowserContextDependencyManager::GetInstance())
+{
+}
+
+HistoryServiceFactoryQt::~HistoryServiceFactoryQt() { }
+
+content::BrowserContext *
+HistoryServiceFactoryQt::GetBrowserContextToUse(content::BrowserContext *context) const
+{
+ return context;
+}
+
+KeyedService *
+HistoryServiceFactoryQt::BuildServiceInstanceFor(content::BrowserContext *context) const
+{
+ Q_ASSERT(!context->IsOffTheRecord());
+
+ std::unique_ptr<history::HistoryService> historyService(
+ new history::HistoryService(std::make_unique<HistoryClientQt>(), nullptr));
+ if (!historyService->Init(history::HistoryDatabaseParamsForPath(context->GetPath(), version_info::Channel::DEFAULT))) {
+ return nullptr;
+ }
+ return historyService.release();
+}
+
+bool FaviconClientQt::IsNativeApplicationURL(const GURL &url)
+{
+ Q_UNUSED(url);
+ return false;
+}
+
+bool FaviconClientQt::IsReaderModeURL(const GURL &url)
+{
+ Q_UNUSED(url)
+ return false;
+}
+
+const GURL FaviconClientQt::GetOriginalUrlFromReaderModeUrl(const GURL &url)
+{
+ return url;
+}
+
+base::CancelableTaskTracker::TaskId FaviconClientQt::GetFaviconForNativeApplicationURL(
+ const GURL &url, const std::vector<int> &desired_sizes_in_pixel,
+ favicon_base::FaviconResultsCallback callback, base::CancelableTaskTracker *tracker)
+{
+ Q_UNUSED(url);
+ Q_UNUSED(desired_sizes_in_pixel);
+ Q_UNUSED(callback);
+ Q_UNUSED(tracker);
+
+ return base::CancelableTaskTracker::kBadTaskId;
+}
+
+// static
+favicon::FaviconService *
+FaviconServiceFactoryQt::GetForBrowserContext(content::BrowserContext *context)
+{
+ return static_cast<favicon::FaviconService *>(
+ GetInstance()->GetServiceForBrowserContext(context, true));
+}
+
+// static
+FaviconServiceFactoryQt *FaviconServiceFactoryQt::GetInstance()
+{
+ return base::Singleton<FaviconServiceFactoryQt>::get();
+}
+
+FaviconServiceFactoryQt::FaviconServiceFactoryQt()
+ : BrowserContextKeyedServiceFactory("FaviconService",
+ BrowserContextDependencyManager::GetInstance())
+{
+}
+
+FaviconServiceFactoryQt::~FaviconServiceFactoryQt() { }
+
+content::BrowserContext *
+FaviconServiceFactoryQt::GetBrowserContextToUse(content::BrowserContext *context) const
+{
+ return context;
+}
+
+KeyedService *
+FaviconServiceFactoryQt::BuildServiceInstanceFor(content::BrowserContext *context) const
+{
+ history::HistoryService *historyService = static_cast<history::HistoryService *>(
+ HistoryServiceFactoryQt::GetInstance()->GetForBrowserContext(context));
+ return new favicon::FaviconServiceImpl(std::make_unique<FaviconClientQt>(), historyService);
+}
+
+} // namespace QtWebEngineCore
diff --git a/src/core/favicon_service_factory_qt.h b/src/core/favicon_service_factory_qt.h
new file mode 100644
index 000000000..55d5f3b33
--- /dev/null
+++ b/src/core/favicon_service_factory_qt.h
@@ -0,0 +1,111 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#ifndef FAVICON_SERVICE_FACTORY_QT_H
+#define FAVICON_SERVICE_FACTORY_QT_H
+
+#include "qtwebenginecoreglobal_p.h"
+
+#include "base/memory/singleton.h"
+#include "base/task/cancelable_task_tracker.h"
+#include "components/favicon/core/favicon_client.h"
+#include "components/history/core/browser/history_client.h"
+#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
+
+class GURL;
+
+namespace content {
+class BrowserContext;
+}
+
+namespace favicon {
+class FaviconService;
+}
+
+namespace history {
+class HistoryBackendClient;
+class HistoryService;
+}
+
+namespace QtWebEngineCore {
+
+class HistoryClientQt : public history::HistoryClient
+{
+public:
+ HistoryClientQt() { }
+ virtual ~HistoryClientQt() { }
+
+ void OnHistoryServiceCreated(history::HistoryService *history_service) override;
+ void Shutdown() override;
+ history::CanAddURLCallback GetThreadSafeCanAddURLCallback() const override;
+ void NotifyProfileError(sql::InitStatus init_status, const std::string &diagnostics) override;
+ std::unique_ptr<history::HistoryBackendClient> CreateBackendClient() override;
+ void UpdateBookmarkLastUsedTime(const base::Uuid &, base::Time) override;
+};
+
+class HistoryServiceFactoryQt : public BrowserContextKeyedServiceFactory
+{
+public:
+ static history::HistoryService *GetForBrowserContext(content::BrowserContext *context);
+ static HistoryServiceFactoryQt *GetInstance();
+
+private:
+ friend struct base::DefaultSingletonTraits<HistoryServiceFactoryQt>;
+
+ HistoryServiceFactoryQt();
+ ~HistoryServiceFactoryQt() override;
+
+ // BrowserContextKeyedServiceFactory:
+ content::BrowserContext *
+ GetBrowserContextToUse(content::BrowserContext *context) const override;
+ KeyedService *BuildServiceInstanceFor(content::BrowserContext *context) const override;
+};
+
+class FaviconClientQt : public favicon::FaviconClient
+{
+public:
+ FaviconClientQt() { }
+ virtual ~FaviconClientQt() { }
+
+ bool IsNativeApplicationURL(const GURL &url) override;
+ bool IsReaderModeURL(const GURL &url) override;
+ const GURL GetOriginalUrlFromReaderModeUrl(const GURL &url) override;
+ base::CancelableTaskTracker::TaskId
+ GetFaviconForNativeApplicationURL(const GURL &url,
+ const std::vector<int> &desired_sizes_in_pixel,
+ favicon_base::FaviconResultsCallback callback,
+ base::CancelableTaskTracker *tracker) override;
+};
+
+class FaviconServiceFactoryQt : public BrowserContextKeyedServiceFactory
+{
+public:
+ static favicon::FaviconService *GetForBrowserContext(content::BrowserContext *context);
+ static FaviconServiceFactoryQt *GetInstance();
+
+private:
+ friend struct base::DefaultSingletonTraits<FaviconServiceFactoryQt>;
+
+ FaviconServiceFactoryQt();
+ ~FaviconServiceFactoryQt() override;
+
+ // BrowserContextKeyedServiceFactory:
+ content::BrowserContext *
+ GetBrowserContextToUse(content::BrowserContext *context) const override;
+ KeyedService *BuildServiceInstanceFor(content::BrowserContext *context) const override;
+};
+
+} // namespace QtWebEngineCore
+
+#endif // FAVICON_SERVICE_FACTORY_QT_H
diff --git a/src/core/file_picker_controller.cpp b/src/core/file_picker_controller.cpp
index 65e2c6f00..9b4521358 100644
--- a/src/core/file_picker_controller.cpp
+++ b/src/core/file_picker_controller.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "file_picker_controller.h"
#include "type_conversion.h"
@@ -44,7 +8,9 @@
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/public/browser/file_select_listener.h"
+#include "ui/shell_dialogs/select_file_dialog.h"
+#include <QtCore/qcoreapplication.h>
#include <QDir>
#include <QFileInfo>
#include <QMimeDatabase>
@@ -53,16 +19,48 @@
namespace QtWebEngineCore {
-FilePickerController::FilePickerController(FileChooserMode mode, std::unique_ptr<content::FileSelectListener> listener, const QString &defaultFileName, const QStringList &acceptedMimeTypes, QObject *parent)
+class FilePickerControllerPrivate {
+public:
+ FilePickerController::FileChooserMode mode;
+ scoped_refptr<content::FileSelectListener> fileDialogListener;
+ ui::SelectFileDialog::Listener *fileSystemAccessDialogListener;
+ QString defaultFileName;
+ QStringList acceptedMimeTypes;
+};
+
+FilePickerController *createFilePickerController(
+ FilePickerController::FileChooserMode mode, scoped_refptr<content::FileSelectListener> listener,
+ const QString &defaultFileName, const QStringList &acceptedMimeTypes, QObject *parent = nullptr)
+{
+ auto priv = new FilePickerControllerPrivate { mode, listener, nullptr, defaultFileName,
+ acceptedMimeTypes };
+ return new FilePickerController(priv, parent);
+}
+
+FilePickerController *createFilePickerController(FilePickerController::FileChooserMode mode,
+ ui::SelectFileDialog::Listener *listener,
+ const QString &defaultFileName,
+ const QStringList &acceptedMimeTypes,
+ QObject *parent = nullptr)
+{
+ auto priv = new FilePickerControllerPrivate { mode, nullptr, listener, defaultFileName,
+ acceptedMimeTypes };
+ return new FilePickerController(priv, parent);
+}
+
+FilePickerController::FilePickerController(FilePickerControllerPrivate *priv, QObject *parent)
: QObject(parent)
- , m_defaultFileName(defaultFileName)
- , m_acceptedMimeTypes(acceptedMimeTypes)
- , m_listener(std::move(listener))
- , m_mode(mode)
+ , d_ptr(priv)
{
}
-FilePickerController::~FilePickerController() = default;
+FilePickerController::~FilePickerController()
+{
+ if (!m_isHandled) {
+ rejected();
+ }
+ delete d_ptr;
+}
void FilePickerController::accepted(const QStringList &files)
{
@@ -79,25 +77,25 @@ void FilePickerController::accepted(const QStringList &files)
if (urlString.startsWith("file:")) {
base::FilePath filePath = toFilePath(urlString).NormalizePathSeparators();
std::vector<base::FilePath::StringType> pathComponents;
- // Splits the file URL into host name, path and file name.
- filePath.GetComponents(&pathComponents);
+ // Splits the file URL into scheme, host name, path and file name.
+ pathComponents = filePath.GetComponents();
QString absolutePath;
-#if !defined(OS_WIN)
+#if !defined(Q_OS_WIN)
absolutePath = "/";
#endif
QString scheme = toQt(pathComponents[0]);
if (scheme.size() > 5) {
-#if defined(OS_WIN)
+#if defined(Q_OS_WIN)
// There is no slash at the end of the file scheme and it is valid on Windows: file:C:/
- if (scheme.at(5).isLetter() && scheme.at(6) != ':') {
+ if (scheme.size() == 7 && scheme.at(5).isLetter() && scheme.at(6) == ':') {
absolutePath += scheme.at(5) + ":/";
} else {
#endif
qWarning("Ignoring invalid item in FilePickerController::accepted(QStringList): %s", qPrintable(urlString));
continue;
-#if defined(OS_WIN)
+#if defined(Q_OS_WIN)
}
#endif
}
@@ -106,7 +104,7 @@ void FilePickerController::accepted(const QStringList &files)
if (base::FilePath::IsSeparator(urlString.at(5).toLatin1())
&& base::FilePath::IsSeparator(urlString.at(6).toLatin1())
&& !base::FilePath::IsSeparator(urlString.at(7).toLatin1())) {
-#if defined(OS_WIN)
+#if defined(Q_OS_WIN)
if (urlString.at(8) != ':' && pathComponents.size() > 2) {
absolutePath += "//";
#else
@@ -138,7 +136,7 @@ void FilePickerController::accepted(const QVariant &files)
{
QStringList stringList;
- if (files.canConvert(QVariant::StringList)) {
+ if (files.canConvert(QMetaType{QMetaType::QStringList})) {
stringList = files.toStringList();
} else if (files.canConvert<QList<QUrl> >()) {
const QList<QUrl> urls = files.value<QList<QUrl>>();
@@ -177,38 +175,62 @@ ASSERT_ENUMS_MATCH(FilePickerController::Save, blink::mojom::FileChooserParams_M
void FilePickerController::filesSelectedInChooser(const QStringList &filesList)
{
- QStringList files(filesList);
- if (this->m_mode == UploadFolder && !filesList.isEmpty()
- && QFileInfo(filesList.first()).isDir()) // Enumerate the directory
- files = listRecursively(QDir(filesList.first()));
-
- std::vector<blink::mojom::FileChooserFileInfoPtr> chooser_files;
- for (const auto &file : qAsConst(files)) {
- chooser_files.push_back(blink::mojom::FileChooserFileInfo::NewNativeFile(
- blink::mojom::NativeFileInfo::New(toFilePath(file), base::string16())));
- }
+ m_isHandled = true;
+ if (d_ptr->fileDialogListener) {
+ QStringList files(filesList);
+ base::FilePath baseDir;
+ if (d_ptr->mode == UploadFolder && !filesList.isEmpty()) {
+ if (QFileInfo(filesList.first()).isDir()) {
+ // Enumerate the directory
+ files = listRecursively(QDir(filesList.first()));
+ baseDir = toFilePath(filesList.first());
+ } else {
+ baseDir = toFilePath(filesList.first()).DirName();
+ }
+ }
+
+ std::vector<blink::mojom::FileChooserFileInfoPtr> chooser_files;
+ for (const auto &file : std::as_const(files)) {
+ chooser_files.push_back(blink::mojom::FileChooserFileInfo::NewNativeFile(
+ blink::mojom::NativeFileInfo::New(toFilePath(file), std::u16string())));
+ }
+
+ if (files.isEmpty())
+ d_ptr->fileDialogListener->FileSelectionCanceled();
+ else
+ d_ptr->fileDialogListener->FileSelected(
+ std::move(chooser_files), baseDir,
+ static_cast<blink::mojom::FileChooserParams::Mode>(d_ptr->mode));
+
+ // release the fileSelectListener manually because it blocks fullscreen requests in chromium
+ // see QTBUG-106975
+ d_ptr->fileDialogListener.reset();
+ } else if (d_ptr->fileSystemAccessDialogListener) {
+ std::vector<base::FilePath> files;
+ for (const auto &file : std::as_const(filesList)) {
+ files.push_back(toFilePath(file));
+ }
- if (files.isEmpty())
- m_listener->FileSelectionCanceled();
- else
- m_listener->FileSelected(std::move(chooser_files),
- /* FIXME? */ base::FilePath(),
- static_cast<blink::mojom::FileChooserParams::Mode>(this->m_mode));
+ if (files.empty())
+ d_ptr->fileSystemAccessDialogListener->FileSelectionCanceled(nullptr);
+ else
+ d_ptr->fileSystemAccessDialogListener->MultiFilesSelected(files, nullptr);
+ }
}
QStringList FilePickerController::acceptedMimeTypes() const
{
- return m_acceptedMimeTypes;
+ return d_ptr->acceptedMimeTypes;
}
FilePickerController::FileChooserMode FilePickerController::mode() const
{
- return m_mode;
+ return d_ptr->mode;
}
QString FilePickerController::defaultFileName() const
{
- return m_defaultFileName;
+ return d_ptr->defaultFileName;
}
QStringList FilePickerController::nameFilters(const QStringList &acceptedMimeTypes)
@@ -236,7 +258,7 @@ QStringList FilePickerController::nameFilters(const QStringList &acceptedMimeTyp
const QMimeType &mimeType = mimeDatabase.mimeTypeForName(type);
if (mimeType.isValid() && !mimeType.globPatterns().isEmpty()) {
QString globs = mimeType.globPatterns().join(" ");
- acceptedGlobs.append(globs);
+ acceptedGlobs.append(mimeType.globPatterns());
nameFilters.append(mimeType.comment() + " (" + globs + ")");
}
} else if (type.endsWith("/*")) {
@@ -247,7 +269,7 @@ QStringList FilePickerController::nameFilters(const QStringList &acceptedMimeTyp
for (const QMimeType &m : allMimeTypes) {
if (m.name().startsWith(type) && !m.globPatterns().isEmpty()) {
QString globs = m.globPatterns().join(" ");
- acceptedGlobs.append(globs);
+ acceptedGlobs.append(m.globPatterns());
nameFilters.append(m.comment() + " (" + globs + ")");
}
}
@@ -256,7 +278,10 @@ QStringList FilePickerController::nameFilters(const QStringList &acceptedMimeTyp
}
}
- nameFilters.prepend(QObject::tr("Accepted types") + " (" + acceptedGlobs.join(" ") + ")");
+ const QString filter =
+ QCoreApplication::translate("FilePickerController",
+ "Accepted types (%1)").arg(acceptedGlobs.join(' '));
+ nameFilters.prepend(filter);
return nameFilters;
}
diff --git a/src/core/file_picker_controller.h b/src/core/file_picker_controller.h
index 0b680161a..42ffd6a2d 100644
--- a/src/core/file_picker_controller.h
+++ b/src/core/file_picker_controller.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
//
// W A R N I N G
@@ -51,20 +15,14 @@
#ifndef FILE_PICKER_CONTROLLER_H
#define FILE_PICKER_CONTROLLER_H
-#include "qtwebenginecoreglobal_p.h"
-
-#include <memory>
-
+#include <QtWebEngineCore/private/qtwebenginecoreglobal_p.h>
#include <QObject>
#include <QStringList>
-namespace content {
- class FileSelectListener;
-}
-
namespace QtWebEngineCore {
-class Q_WEBENGINECORE_PRIVATE_EXPORT FilePickerController : public QObject {
+class FilePickerControllerPrivate;
+class Q_WEBENGINECORE_EXPORT FilePickerController : public QObject {
Q_OBJECT
public:
enum FileChooserMode {
@@ -74,8 +32,9 @@ public:
Save
};
- FilePickerController(FileChooserMode mode, std::unique_ptr<content::FileSelectListener> listener, const QString &defaultFileName, const QStringList &acceptedMimeTypes, QObject * = 0);
+ FilePickerController(FilePickerControllerPrivate *priv, QObject *parent = nullptr);
~FilePickerController() override;
+
QStringList acceptedMimeTypes() const;
QString defaultFileName() const;
FileChooserMode mode() const;
@@ -89,13 +48,12 @@ public Q_SLOTS:
private:
void filesSelectedInChooser(const QStringList &filesList);
- QString m_defaultFileName;
- QStringList m_acceptedMimeTypes;
- std::unique_ptr<content::FileSelectListener> m_listener;
- FileChooserMode m_mode;
-
+ FilePickerControllerPrivate *d_ptr;
+ // Using Quick, the FileSelectListenerImpl destructor may crash in debug mode
+ // if the browser window is closed and the FilePicker is still open
+ bool m_isHandled = false;
};
-} // namespace
+} // namespace QtWebEngineCore
#endif // FILE_PICKER_CONTROLLER_H
diff --git a/src/core/file_system_access/file_system_access_permission_context_factory_qt.cpp b/src/core/file_system_access/file_system_access_permission_context_factory_qt.cpp
new file mode 100644
index 000000000..51c8a8991
--- /dev/null
+++ b/src/core/file_system_access/file_system_access_permission_context_factory_qt.cpp
@@ -0,0 +1,61 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "file_system_access_permission_context_factory_qt.h"
+
+#include "components/keyed_service/content/browser_context_dependency_manager.h"
+
+#include <QtGlobal>
+
+namespace QtWebEngineCore {
+
+// static
+FileSystemAccessPermissionContextQt *
+FileSystemAccessPermissionContextFactoryQt::GetForProfile(content::BrowserContext *profile)
+{
+ return static_cast<FileSystemAccessPermissionContextQt *>(
+ GetInstance()->GetServiceForBrowserContext(profile, true));
+}
+
+// static
+FileSystemAccessPermissionContextQt *
+FileSystemAccessPermissionContextFactoryQt::GetForProfileIfExists(content::BrowserContext *profile)
+{
+ return static_cast<FileSystemAccessPermissionContextQt *>(
+ GetInstance()->GetServiceForBrowserContext(profile, true));
+}
+
+// static
+FileSystemAccessPermissionContextFactoryQt *
+FileSystemAccessPermissionContextFactoryQt::GetInstance()
+{
+ return base::Singleton<FileSystemAccessPermissionContextFactoryQt>::get();
+}
+
+FileSystemAccessPermissionContextFactoryQt::FileSystemAccessPermissionContextFactoryQt()
+ : BrowserContextKeyedServiceFactory("FileSystemAccessPermissionContext",
+ BrowserContextDependencyManager::GetInstance())
+{
+}
+
+FileSystemAccessPermissionContextFactoryQt::~FileSystemAccessPermissionContextFactoryQt() = default;
+
+content::BrowserContext *FileSystemAccessPermissionContextFactoryQt::GetBrowserContextToUse(
+ content::BrowserContext *context) const
+{
+ return context;
+}
+
+KeyedService *FileSystemAccessPermissionContextFactoryQt::BuildServiceInstanceFor(
+ content::BrowserContext *context) const
+{
+ return new FileSystemAccessPermissionContextQt(context);
+}
+
+void FileSystemAccessPermissionContextFactoryQt::BrowserContextShutdown(
+ content::BrowserContext *context)
+{
+ Q_UNUSED(context);
+}
+
+} // namespace QtWebEngineCore
diff --git a/src/core/file_system_access/file_system_access_permission_context_factory_qt.h b/src/core/file_system_access/file_system_access_permission_context_factory_qt.h
new file mode 100644
index 000000000..1d98243d6
--- /dev/null
+++ b/src/core/file_system_access/file_system_access_permission_context_factory_qt.h
@@ -0,0 +1,37 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef FILE_SYSTEM_ACCESS_PERMISSION_CONTEXT_FACTORY_QT_H
+#define FILE_SYSTEM_ACCESS_PERMISSION_CONTEXT_FACTORY_QT_H
+
+#include "base/memory/singleton.h"
+#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
+
+#include "file_system_access_permission_context_qt.h"
+
+namespace QtWebEngineCore {
+
+class FileSystemAccessPermissionContextFactoryQt : public BrowserContextKeyedServiceFactory
+{
+public:
+ static FileSystemAccessPermissionContextQt *GetForProfile(content::BrowserContext *profile);
+ static FileSystemAccessPermissionContextQt *
+ GetForProfileIfExists(content::BrowserContext *profile);
+ static FileSystemAccessPermissionContextFactoryQt *GetInstance();
+
+private:
+ friend struct base::DefaultSingletonTraits<FileSystemAccessPermissionContextFactoryQt>;
+
+ FileSystemAccessPermissionContextFactoryQt();
+ ~FileSystemAccessPermissionContextFactoryQt() override;
+
+ // BrowserContextKeyedServiceFactory
+ content::BrowserContext *
+ GetBrowserContextToUse(content::BrowserContext *context) const override;
+ KeyedService *BuildServiceInstanceFor(content::BrowserContext *profile) const override;
+ void BrowserContextShutdown(content::BrowserContext *context) override;
+};
+
+} // namespace QtWebEngineCore
+
+#endif // FILE_SYSTEM_ACCESS_PERMISSION_CONTEXT_FACTORY_QT_H
diff --git a/src/core/file_system_access/file_system_access_permission_context_qt.cpp b/src/core/file_system_access/file_system_access_permission_context_qt.cpp
new file mode 100644
index 000000000..c290aab82
--- /dev/null
+++ b/src/core/file_system_access/file_system_access_permission_context_qt.cpp
@@ -0,0 +1,479 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+// This file is based on chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc:
+// Copyright 2019 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "file_system_access_permission_context_qt.h"
+
+#include "base/base_paths.h"
+#include "base/path_service.h"
+#include "base/task/task_traits.h"
+#include "base/task/thread_pool.h"
+#include "chrome/common/chrome_paths.h"
+#include "components/content_settings/core/common/content_settings_types.h"
+#include "content/browser/web_contents/web_contents_impl.h"
+
+#include "file_system_access_permission_grant_qt.h"
+#include "type_conversion.h"
+
+#include <QCoreApplication>
+#include <QStandardPaths>
+
+namespace QtWebEngineCore {
+
+// Sentinel used to indicate that no PathService key is specified for a path in
+// the struct below.
+constexpr const int kNoBasePathKey = -1;
+
+enum BlockType { kBlockAllChildren, kBlockNestedDirectories, kDontBlockChildren, kDontBlockAppFolder };
+
+const struct
+{
+ // base::BasePathKey value (or one of the platform specific extensions to it)
+ // for a path that should be blocked. Specify kNoBasePathKey if |path| should
+ // be used instead.
+ int base_path_key;
+
+ // Explicit path to block instead of using |base_path_key|. Set to nullptr to
+ // use |base_path_key| on its own. If both |base_path_key| and |path| are set,
+ // |path| is treated relative to the path |base_path_key| resolves to.
+ const base::FilePath::CharType *path;
+
+ // If this is set to kDontBlockChildren, only the given path and its parents
+ // are blocked. If this is set to kBlockAllChildren, all children of the given
+ // path are blocked as well. Finally if this is set to kBlockNestedDirectories
+ // access is allowed to individual files in the directory, but nested
+ // directories are still blocked.
+ // The BlockType of the nearest ancestor of a path to check is what ultimately
+ // determines if a path is blocked or not. If a blocked path is a descendent
+ // of another blocked path, then it may override the child-blocking policy of
+ // its ancestor. For example, if /home blocks all children, but
+ // /home/downloads does not, then /home/downloads/file.ext will *not* be
+ // blocked.
+ BlockType type;
+} kBlockedPaths[] = {
+ // Don't allow users to share their entire home directory, entire desktop or
+ // entire documents folder, but do allow sharing anything inside those
+ // directories not otherwise blocked.
+ { base::DIR_HOME, nullptr, kDontBlockChildren },
+ { base::DIR_USER_DESKTOP, nullptr, kDontBlockChildren },
+ { chrome::DIR_USER_DOCUMENTS, nullptr, kDontBlockChildren },
+ // Similar restrictions for the downloads directory.
+ { chrome::DIR_DEFAULT_DOWNLOADS, nullptr, kDontBlockChildren },
+ { chrome::DIR_DEFAULT_DOWNLOADS_SAFE, nullptr, kDontBlockChildren },
+ // The Chrome installation itself should not be modified by the web.
+ { base::DIR_EXE, nullptr, kBlockAllChildren },
+ { base::DIR_MODULE, nullptr, kBlockAllChildren },
+ { base::DIR_ASSETS, nullptr, kBlockAllChildren },
+ // And neither should the configuration of at least the currently running
+ // Chrome instance (note that this does not take --user-data-dir command
+ // line overrides into account).
+ { chrome::DIR_USER_DATA, nullptr, kBlockAllChildren },
+ // ~/.ssh is pretty sensitive on all platforms, so block access to that.
+ { base::DIR_HOME, FILE_PATH_LITERAL(".ssh"), kBlockAllChildren },
+ // And limit access to ~/.gnupg as well.
+ { base::DIR_HOME, FILE_PATH_LITERAL(".gnupg"), kBlockAllChildren },
+#if defined(OS_WIN)
+ // Some Windows specific directories to block, basically all apps, the
+ // operating system itself, as well as configuration data for apps.
+ { base::DIR_PROGRAM_FILES, nullptr, kBlockAllChildren },
+ { base::DIR_PROGRAM_FILESX86, nullptr, kBlockAllChildren },
+ { base::DIR_PROGRAM_FILES6432, nullptr, kBlockAllChildren },
+ { base::DIR_WINDOWS, nullptr, kBlockAllChildren },
+ { base::DIR_ROAMING_APP_DATA, nullptr, kBlockAllChildren },
+ { base::DIR_LOCAL_APP_DATA, nullptr, kBlockAllChildren },
+ // Whitelist AppData\Local\Temp to make the default location of QDir::tempPath(),
+ // QTemporaryFile and QTemporaryDir working on Windows.
+ { base::DIR_LOCAL_APP_DATA, FILE_PATH_LITERAL("Temp"), kDontBlockAppFolder },
+ { base::DIR_COMMON_APP_DATA, nullptr, kBlockAllChildren },
+ // Opening a file from an MTP device, such as a smartphone or a camera, is
+ // implemented by Windows as opening a file in the temporary internet files
+ // directory. To support that, allow opening files in that directory, but
+ // not whole directories.
+ { base::DIR_IE_INTERNET_CACHE, nullptr, kBlockNestedDirectories },
+#endif
+#if defined(OS_MAC)
+ // Similar Mac specific blocks.
+ { base::DIR_APP_DATA, nullptr, kBlockAllChildren },
+ { base::DIR_HOME, FILE_PATH_LITERAL("Library"), kBlockAllChildren },
+ // Allow access to iCloud files.
+ { base::DIR_HOME, FILE_PATH_LITERAL("Library/Mobile Documents"), kDontBlockChildren },
+#endif
+#if defined(OS_LINUX) || defined(OS_CHROMEOS)
+ // On Linux also block access to devices via /dev, as well as security
+ // sensitive data in /sys and /proc.
+ { kNoBasePathKey, FILE_PATH_LITERAL("/dev"), kBlockAllChildren },
+ { kNoBasePathKey, FILE_PATH_LITERAL("/sys"), kBlockAllChildren },
+ { kNoBasePathKey, FILE_PATH_LITERAL("/proc"), kBlockAllChildren },
+ // And block all of ~/.config, matching the similar restrictions on mac
+ // and windows.
+ { base::DIR_HOME, FILE_PATH_LITERAL(".config"), kBlockAllChildren },
+ // Block ~/.dbus as well, just in case, although there probably isn't much a
+ // website can do with access to that directory and its contents.
+ { base::DIR_HOME, FILE_PATH_LITERAL(".dbus"), kBlockAllChildren },
+#endif
+ // TODO(https://crbug.com/984641): Refine this list, for example add
+ // XDG_CONFIG_HOME when it is not set ~/.config?
+};
+
+bool ShouldBlockAccessToPath(const base::FilePath &check_path, HandleType handle_type)
+{
+ DCHECK(!check_path.empty());
+ DCHECK(check_path.IsAbsolute());
+
+ base::FilePath nearest_ancestor;
+ int nearest_ancestor_path_key = kNoBasePathKey;
+ BlockType nearest_ancestor_block_type = kDontBlockChildren;
+ for (const auto &block : kBlockedPaths) {
+ base::FilePath blocked_path;
+ if (block.base_path_key != kNoBasePathKey) {
+ if (!base::PathService::Get(block.base_path_key, &blocked_path))
+ continue;
+ if (block.path)
+ blocked_path = blocked_path.Append(block.path);
+ } else {
+ DCHECK(block.path);
+ blocked_path = base::FilePath(block.path);
+ }
+
+ if (check_path == blocked_path || check_path.IsParent(blocked_path)) {
+ VLOG(1) << "Blocking access to " << check_path << " because it is a parent of "
+ << blocked_path << " (" << block.base_path_key << ")";
+ return true;
+ }
+
+ if (blocked_path.IsParent(check_path)
+ && (nearest_ancestor.empty() || nearest_ancestor.IsParent(blocked_path))) {
+ nearest_ancestor = blocked_path;
+ nearest_ancestor_path_key = block.base_path_key;
+ nearest_ancestor_block_type = block.type;
+ }
+ }
+
+ // The path we're checking is not in a potentially blocked directory, or the
+ // nearest ancestor does not block access to its children. Grant access.
+ if (nearest_ancestor.empty() || nearest_ancestor_block_type == kDontBlockChildren)
+ return false;
+
+ // The path we're checking is a file, and the nearest ancestor only blocks
+ // access to directories. Grant access.
+ if (handle_type == HandleType::kFile && nearest_ancestor_block_type == kBlockNestedDirectories)
+ return false;
+
+ if (nearest_ancestor_block_type == kDontBlockAppFolder) {
+ // Relative path from the nearest blocklisted ancestor
+ base::FilePath diff;
+ nearest_ancestor.AppendRelativePath(check_path, &diff);
+
+ auto diff_components = diff.GetComponents();
+ if (diff_components.size() > 0 && toQt(diff_components[0]).contains(QCoreApplication::applicationName())) {
+ // The relative path contains the application name. Grant access.
+ return false;
+ }
+ }
+
+ // The nearest ancestor blocks access to its children, so block access.
+ VLOG(1) << "Blocking access to " << check_path << " because it is inside " << nearest_ancestor
+ << " (" << nearest_ancestor_path_key << ")";
+ return true;
+}
+
+struct FileSystemAccessPermissionContextQt::OriginState
+{
+ // Raw pointers, owned collectively by all the handles that reference this
+ // grant. When last reference goes away this state is cleared as well by
+ // PermissionGrantDestroyed().
+ std::map<base::FilePath, FileSystemAccessPermissionGrantQt *> read_grants;
+ std::map<base::FilePath, FileSystemAccessPermissionGrantQt *> write_grants;
+};
+
+FileSystemAccessPermissionContextQt::FileSystemAccessPermissionContextQt(
+ content::BrowserContext *context)
+ : m_profile(context)
+{
+}
+
+FileSystemAccessPermissionContextQt::~FileSystemAccessPermissionContextQt() = default;
+
+scoped_refptr<content::FileSystemAccessPermissionGrant>
+FileSystemAccessPermissionContextQt::GetReadPermissionGrant(const url::Origin &origin,
+ const base::FilePath &path,
+ HandleType handle_type,
+ UserAction user_action)
+{
+ auto &origin_state = m_origins[origin];
+ auto *&existing_grant = origin_state.read_grants[path];
+ scoped_refptr<FileSystemAccessPermissionGrantQt> new_grant;
+
+ if (existing_grant && existing_grant->handleType() != handle_type) {
+ // |path| changed from being a directory to being a file or vice versa,
+ // don't just re-use the existing grant but revoke the old grant before
+ // creating a new grant.
+ existing_grant->SetStatus(blink::mojom::PermissionStatus::DENIED);
+ existing_grant = nullptr;
+ }
+
+ if (!existing_grant) {
+ new_grant = base::MakeRefCounted<FileSystemAccessPermissionGrantQt>(
+ m_weakFactory.GetWeakPtr(), origin, path, handle_type, GrantType::kRead);
+ existing_grant = new_grant.get();
+ }
+
+ // If a parent directory is already readable this new grant should also be readable.
+ if (new_grant && AncestorHasActivePermission(origin, path, GrantType::kRead)) {
+ existing_grant->SetStatus(blink::mojom::PermissionStatus::GRANTED);
+ return existing_grant;
+ }
+
+ switch (user_action) {
+ case UserAction::kOpen:
+ case UserAction::kSave:
+ // Open and Save dialog only grant read access for individual files.
+ if (handle_type == HandleType::kDirectory)
+ break;
+ Q_FALLTHROUGH();
+ case UserAction::kDragAndDrop:
+ // Drag&drop grants read access for all handles.
+ existing_grant->SetStatus(blink::mojom::PermissionStatus::GRANTED);
+ break;
+ case UserAction::kLoadFromStorage:
+ break;
+ case UserAction::kNone:
+ Q_UNREACHABLE();
+ }
+
+ return existing_grant;
+}
+
+scoped_refptr<content::FileSystemAccessPermissionGrant>
+FileSystemAccessPermissionContextQt::GetWritePermissionGrant(const url::Origin &origin,
+ const base::FilePath &path,
+ HandleType handle_type,
+ UserAction user_action)
+{
+ auto &origin_state = m_origins[origin];
+ auto *&existing_grant = origin_state.write_grants[path];
+ scoped_refptr<FileSystemAccessPermissionGrantQt> new_grant;
+
+ if (existing_grant && existing_grant->handleType() != handle_type) {
+ // |path| changed from being a directory to being a file or vice versa,
+ // don't just re-use the existing grant but revoke the old grant before
+ // creating a new grant.
+ existing_grant->SetStatus(blink::mojom::PermissionStatus::DENIED);
+ existing_grant = nullptr;
+ }
+
+ if (!existing_grant) {
+ new_grant = base::MakeRefCounted<FileSystemAccessPermissionGrantQt>(
+ m_weakFactory.GetWeakPtr(), origin, path, handle_type, GrantType::kWrite);
+ existing_grant = new_grant.get();
+ }
+
+ // If a parent directory is already writable this new grant should also be writable.
+ if (new_grant && AncestorHasActivePermission(origin, path, GrantType::kWrite)) {
+ existing_grant->SetStatus(blink::mojom::PermissionStatus::GRANTED);
+ return existing_grant;
+ }
+
+ switch (user_action) {
+ case UserAction::kSave:
+ // Only automatically grant write access for save dialogs.
+ existing_grant->SetStatus(blink::mojom::PermissionStatus::GRANTED);
+ break;
+ case UserAction::kOpen:
+ case UserAction::kDragAndDrop:
+ case UserAction::kLoadFromStorage:
+ break;
+ case UserAction::kNone:
+ Q_UNREACHABLE();
+ }
+
+ return existing_grant;
+}
+
+void FileSystemAccessPermissionContextQt::ConfirmSensitiveEntryAccess(
+ const url::Origin &origin, PathType path_type, const base::FilePath &path,
+ HandleType handle_type, UserAction user_action,
+ content::GlobalRenderFrameHostId frame_id,
+ base::OnceCallback<void(SensitiveEntryResult)> callback)
+{
+ if (path_type == PathType::kExternal) {
+ std::move(callback).Run(SensitiveEntryResult::kAllowed);
+ return;
+ }
+
+ base::ThreadPool::PostTaskAndReplyWithResult(
+ FROM_HERE, { base::MayBlock(), base::TaskPriority::USER_VISIBLE },
+ base::BindOnce(&ShouldBlockAccessToPath, path, handle_type),
+ base::BindOnce(&FileSystemAccessPermissionContextQt::DidConfirmSensitiveDirectoryAccess,
+ m_weakFactory.GetWeakPtr(), origin, path, handle_type, user_action, frame_id,
+ std::move(callback)));
+}
+
+void FileSystemAccessPermissionContextQt::PerformAfterWriteChecks(
+ std::unique_ptr<content::FileSystemAccessWriteItem> item,
+ content::GlobalRenderFrameHostId frame_id,
+ base::OnceCallback<void(AfterWriteCheckResult)> callback)
+{
+ Q_UNUSED(item);
+ Q_UNUSED(frame_id);
+ std::move(callback).Run(AfterWriteCheckResult::kAllow);
+}
+
+bool FileSystemAccessPermissionContextQt::CanObtainReadPermission(const url::Origin &origin)
+{
+ Q_UNUSED(origin);
+ return true;
+}
+
+bool FileSystemAccessPermissionContextQt::CanObtainWritePermission(const url::Origin &origin)
+{
+ Q_UNUSED(origin);
+ return true;
+}
+
+void FileSystemAccessPermissionContextQt::SetLastPickedDirectory(const url::Origin &origin,
+ const std::string &id,
+ const base::FilePath &path,
+ const PathType type)
+{
+ Q_UNUSED(origin);
+
+ FileSystemAccessPermissionContextQt::PathInfo info;
+ info.path = path;
+ info.type = type;
+ m_lastPickedDirectories.insert({ id, info });
+}
+
+FileSystemAccessPermissionContextQt::PathInfo
+FileSystemAccessPermissionContextQt::GetLastPickedDirectory(const url::Origin &origin,
+ const std::string &id)
+{
+ Q_UNUSED(origin);
+
+ return m_lastPickedDirectories.find(id) != m_lastPickedDirectories.end()
+ ? m_lastPickedDirectories[id]
+ : FileSystemAccessPermissionContextQt::PathInfo();
+}
+
+base::FilePath FileSystemAccessPermissionContextQt::GetWellKnownDirectoryPath(
+ blink::mojom::WellKnownDirectory directory, const url::Origin &origin)
+{
+ QStandardPaths::StandardLocation location = QStandardPaths::DocumentsLocation;
+ switch (directory) {
+ case blink::mojom::WellKnownDirectory::kDirDesktop:
+ location = QStandardPaths::DesktopLocation;
+ break;
+ case blink::mojom::WellKnownDirectory::kDirDocuments:
+ location = QStandardPaths::DocumentsLocation;
+ break;
+ case blink::mojom::WellKnownDirectory::kDirDownloads:
+ location = QStandardPaths::DownloadLocation;
+ break;
+ case blink::mojom::WellKnownDirectory::kDirMusic:
+ location = QStandardPaths::MusicLocation;
+ break;
+ case blink::mojom::WellKnownDirectory::kDirPictures:
+ location = QStandardPaths::PicturesLocation;
+ break;
+ case blink::mojom::WellKnownDirectory::kDirVideos:
+ location = QStandardPaths::MoviesLocation;
+ break;
+ }
+
+ return toFilePath(QStandardPaths::writableLocation(location));
+}
+
+void FileSystemAccessPermissionContextQt::NavigatedAwayFromOrigin(const url::Origin &origin)
+{
+ // If the last top-level WebContents for an origin is closed (or is navigated to another
+ // origin), all the permissions for that origin will be revoked.
+
+ auto it = m_origins.find(origin);
+ // If we have no permissions for the origin, there is nothing to do.
+ if (it == m_origins.end())
+ return;
+
+ std::vector<content::WebContentsImpl *> list = content::WebContentsImpl::GetAllWebContents();
+ for (content::WebContentsImpl *web_contents : list) {
+ url::Origin web_contents_origin = url::Origin::Create(web_contents->GetLastCommittedURL());
+ // Found a tab for this origin, so early exit and don't revoke grants.
+ if (web_contents_origin == origin)
+ return;
+ }
+
+ OriginState &origin_state = it->second;
+ for (auto &grant : origin_state.read_grants)
+ grant.second->SetStatus(blink::mojom::PermissionStatus::ASK);
+ for (auto &grant : origin_state.write_grants)
+ grant.second->SetStatus(blink::mojom::PermissionStatus::ASK);
+}
+
+void FileSystemAccessPermissionContextQt::DidConfirmSensitiveDirectoryAccess(
+ const url::Origin &origin, const base::FilePath &path, HandleType handle_type, UserAction user_action,
+ content::GlobalRenderFrameHostId frame_id,
+ base::OnceCallback<void(SensitiveEntryResult)> callback, bool should_block)
+{
+ Q_UNUSED(origin);
+ Q_UNUSED(path);
+ Q_UNUSED(handle_type);
+ Q_UNUSED(user_action);
+ Q_UNUSED(frame_id);
+
+ if (should_block)
+ std::move(callback).Run(SensitiveEntryResult::kAbort);
+ else
+ std::move(callback).Run(SensitiveEntryResult::kAllowed);
+}
+
+bool FileSystemAccessPermissionContextQt::AncestorHasActivePermission(
+ const url::Origin &origin, const base::FilePath &path, GrantType grant_type) const
+{
+ auto it = m_origins.find(origin);
+ if (it == m_origins.end())
+ return false;
+
+ const auto &relevant_grants = grant_type == GrantType::kWrite ? it->second.write_grants : it->second.read_grants;
+ if (relevant_grants.empty())
+ return false;
+
+ // Permissions are inherited from the closest ancestor.
+ for (base::FilePath parent = path.DirName(); parent != parent.DirName(); parent = parent.DirName()) {
+ auto i = relevant_grants.find(parent);
+ if (i != relevant_grants.end() && i->second && i->second->GetStatus() == blink::mojom::PermissionStatus::GRANTED)
+ return true;
+ }
+ return false;
+}
+
+std::u16string FileSystemAccessPermissionContextQt::GetPickerTitle(const blink::mojom::FilePickerOptionsPtr &)
+{
+ return {};
+}
+
+void FileSystemAccessPermissionContextQt::PermissionGrantDestroyed(
+ FileSystemAccessPermissionGrantQt *grant)
+{
+ auto it = m_origins.find(grant->origin());
+ if (it == m_origins.end())
+ return;
+
+ auto &grants =
+ grant->type() == GrantType::kRead ? it->second.read_grants : it->second.write_grants;
+ auto grant_it = grants.find(grant->path());
+
+ if (grant_it == grants.end()) {
+ return;
+ }
+ if (grant_it->second == grant)
+ grants.erase(grant_it);
+}
+
+void FileSystemAccessPermissionContextQt::NotifyEntryMoved(const url::Origin &, const base::FilePath &, const base::FilePath &)
+{
+}
+
+} // namespace QtWebEngineCore
diff --git a/src/core/file_system_access/file_system_access_permission_context_qt.h b/src/core/file_system_access/file_system_access_permission_context_qt.h
new file mode 100644
index 000000000..06fbfae3f
--- /dev/null
+++ b/src/core/file_system_access/file_system_access_permission_context_qt.h
@@ -0,0 +1,86 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+// This file is based on chrome/browser/file_system_access/chrome_file_system_access_permission_context.h:
+// Copyright 2019 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef FILE_SYSTEM_ACCESS_PERMISSION_CONTEXT_QT_H
+#define FILE_SYSTEM_ACCESS_PERMISSION_CONTEXT_QT_H
+
+#include "base/files/file_path.h"
+#include "components/keyed_service/core/keyed_service.h"
+#include "content/public/browser/file_system_access_permission_context.h"
+#include "content/public/browser/global_routing_id.h"
+
+namespace content {
+class BrowserContext;
+}
+
+namespace QtWebEngineCore {
+class FileSystemAccessPermissionGrantQt;
+class FileSystemAccessPermissionContextQt : public content::FileSystemAccessPermissionContext,
+ public KeyedService
+{
+public:
+ explicit FileSystemAccessPermissionContextQt(content::BrowserContext *context);
+ ~FileSystemAccessPermissionContextQt() override;
+
+ enum class GrantType { kRead, kWrite };
+
+ // content::FileSystemAccessPermissionContext:
+ scoped_refptr<content::FileSystemAccessPermissionGrant>
+ GetReadPermissionGrant(const url::Origin &origin, const base::FilePath &path,
+ HandleType handle_type, UserAction user_action) override;
+ scoped_refptr<content::FileSystemAccessPermissionGrant>
+ GetWritePermissionGrant(const url::Origin &origin, const base::FilePath &path,
+ HandleType handle_type, UserAction user_action) override;
+ void ConfirmSensitiveEntryAccess(
+ const url::Origin &origin, PathType path_type, const base::FilePath &path,
+ HandleType handle_type, UserAction user_action,
+ content::GlobalRenderFrameHostId frame_id,
+ base::OnceCallback<void(SensitiveEntryResult)> callback) override;
+ void PerformAfterWriteChecks(std::unique_ptr<content::FileSystemAccessWriteItem> item,
+ content::GlobalRenderFrameHostId frame_id,
+ base::OnceCallback<void(AfterWriteCheckResult)> callback) override;
+ bool CanObtainReadPermission(const url::Origin &origin) override;
+ bool CanObtainWritePermission(const url::Origin &origin) override;
+ void SetLastPickedDirectory(const url::Origin &origin, const std::string &id,
+ const base::FilePath &path, const PathType type) override;
+ FileSystemAccessPermissionContextQt::PathInfo
+ GetLastPickedDirectory(const url::Origin &origin, const std::string &id) override;
+ base::FilePath GetWellKnownDirectoryPath(blink::mojom::WellKnownDirectory directory, const url::Origin &origin) override;
+ std::u16string GetPickerTitle(const blink::mojom::FilePickerOptionsPtr &) override;
+ void NotifyEntryMoved(const url::Origin &, const base::FilePath &, const base::FilePath &) override;
+
+ void NavigatedAwayFromOrigin(const url::Origin &origin);
+ content::BrowserContext *profile() const { return m_profile; }
+
+ void PermissionGrantDestroyed(FileSystemAccessPermissionGrantQt *);
+
+private:
+ class PermissionGrantImpl;
+
+ void DidConfirmSensitiveDirectoryAccess(
+ const url::Origin &origin, const base::FilePath &path, HandleType handle_type,
+ UserAction user_action, content::GlobalRenderFrameHostId frame_id,
+ base::OnceCallback<void(SensitiveEntryResult)> callback, bool should_block);
+ bool AncestorHasActivePermission(const url::Origin &origin,
+ const base::FilePath &path,
+ GrantType grant_type) const;
+
+ content::BrowserContext *m_profile;
+
+ // Permission state per origin.
+ struct OriginState;
+ std::map<url::Origin, OriginState> m_origins;
+
+ std::map<std::string, FileSystemAccessPermissionContextQt::PathInfo> m_lastPickedDirectories;
+
+ base::WeakPtrFactory<FileSystemAccessPermissionContextQt> m_weakFactory { this };
+};
+
+} // namespace QtWebEngineCore
+
+#endif // FILE_SYSTEM_ACCESS_PERMISSION_CONTEXT_QT_H
diff --git a/src/core/file_system_access/file_system_access_permission_grant_qt.cpp b/src/core/file_system_access/file_system_access_permission_grant_qt.cpp
new file mode 100644
index 000000000..67fa1c8cf
--- /dev/null
+++ b/src/core/file_system_access/file_system_access_permission_grant_qt.cpp
@@ -0,0 +1,146 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "file_system_access_permission_grant_qt.h"
+
+#include "file_system_access_permission_request_manager_qt.h"
+
+#include "components/permissions/permission_util.h"
+#include "content/public/browser/browser_task_traits.h"
+#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/render_frame_host.h"
+#include "content/public/browser/render_process_host.h"
+#include "content/public/browser/web_contents.h"
+#include "content/public/browser/disallow_activation_reason.h"
+#include "url/origin.h"
+
+namespace QtWebEngineCore {
+
+FileSystemAccessPermissionGrantQt::FileSystemAccessPermissionGrantQt(
+ base::WeakPtr<FileSystemAccessPermissionContextQt> context, const url::Origin &origin,
+ const base::FilePath &path, HandleType handle_type, GrantType type)
+ : m_context(context), m_origin(origin), m_path(path), m_handleType(handle_type), m_type(type)
+{
+}
+FileSystemAccessPermissionGrantQt::~FileSystemAccessPermissionGrantQt()
+{
+ if (m_context)
+ m_context->PermissionGrantDestroyed(this);
+}
+void FileSystemAccessPermissionGrantQt::RequestPermission(
+ content::GlobalRenderFrameHostId frame_id, UserActivationState user_activation_state,
+ base::OnceCallback<void(PermissionRequestOutcome)> callback)
+{
+ // Check if a permission request has already been processed previously. This
+ // check is done first because we don't want to reset the status of a
+ // permission if it has already been granted.
+ if (GetStatus() != blink::mojom::PermissionStatus::ASK || !m_context) {
+ if (GetStatus() == blink::mojom::PermissionStatus::GRANTED)
+ SetStatus(blink::mojom::PermissionStatus::GRANTED);
+ std::move(callback).Run(PermissionRequestOutcome::kRequestAborted);
+ return;
+ }
+
+ // Otherwise, perform checks and ask the user for permission.
+
+ content::RenderFrameHost *rfh = content::RenderFrameHost::FromID(frame_id);
+ if (!rfh) {
+ // Requested from a no longer valid render frame host.
+ std::move(callback).Run(PermissionRequestOutcome::kInvalidFrame);
+ return;
+ }
+
+ // Don't show request permission UI for an inactive RenderFrameHost as the
+ // page might not distinguish properly between user denying the permission
+ // and automatic rejection, leading to an inconsistent UX once the page
+ // becomes active again.
+ // - If this is called when RenderFrameHost is in BackForwardCache, evict
+ // the document from the cache.
+ // - If this is called when RenderFrameHost is in prerendering, cancel
+ // prerendering.
+ if (rfh->IsInactiveAndDisallowActivation(
+ content::DisallowActivationReasonId::kFileSystemAccessPermissionRequest)) {
+ std::move(callback).Run(PermissionRequestOutcome::kInvalidFrame);
+ return;
+ }
+
+ if (user_activation_state == UserActivationState::kRequired
+ && !rfh->HasTransientUserActivation()) {
+ // No permission prompts without user activation.
+ std::move(callback).Run(PermissionRequestOutcome::kNoUserActivation);
+ return;
+ }
+
+ content::WebContents *web_contents = content::WebContents::FromRenderFrameHost(rfh);
+ if (!web_contents) {
+ // Requested from a worker, or a no longer existing tab.
+ std::move(callback).Run(PermissionRequestOutcome::kInvalidFrame);
+ return;
+ }
+
+ url::Origin embedding_origin = url::Origin::Create(web_contents->GetLastCommittedURL());
+ if (embedding_origin != m_origin) {
+ // Third party iframes are not allowed to request more permissions.
+ std::move(callback).Run(PermissionRequestOutcome::kThirdPartyContext);
+ return;
+ }
+
+ auto *request_manager =
+ FileSystemAccessPermissionRequestManagerQt::FromWebContents(web_contents);
+ if (!request_manager) {
+ std::move(callback).Run(PermissionRequestOutcome::kRequestAborted);
+ return;
+ }
+
+ // Drop fullscreen mode so that the user sees the URL bar.
+ base::ScopedClosureRunner fullscreen_block = web_contents->ForSecurityDropFullscreen();
+
+ FileSystemAccessPermissionRequestManagerQt::Access access = m_type == GrantType::kRead
+ ? FileSystemAccessPermissionRequestManagerQt::Access::kRead
+ : FileSystemAccessPermissionRequestManagerQt::Access::kWrite;
+
+ // If a website wants both read and write access, code in content will
+ // request those as two separate requests. The |request_manager| will then
+ // detect this and combine the two requests into one prompt. As such this
+ // code does not have to have any way to request Access::kReadWrite.
+
+ request_manager->AddRequest(
+ { m_origin, m_path, m_handleType, access },
+ base::BindOnce(&FileSystemAccessPermissionGrantQt::OnPermissionRequestResult, this,
+ std::move(callback)),
+ std::move(fullscreen_block));
+}
+
+void FileSystemAccessPermissionGrantQt::SetStatus(blink::mojom::PermissionStatus status)
+{
+ bool should_notify = m_status != status;
+ m_status = status;
+ if (should_notify)
+ NotifyPermissionStatusChanged();
+}
+
+void FileSystemAccessPermissionGrantQt::OnPermissionRequestResult(
+ base::OnceCallback<void(PermissionRequestOutcome)> callback, permissions::PermissionAction result)
+{
+ switch (result) {
+ case permissions::PermissionAction::GRANTED:
+ SetStatus(blink::mojom::PermissionStatus::GRANTED);
+ std::move(callback).Run(PermissionRequestOutcome::kUserGranted);
+ break;
+ case permissions::PermissionAction::DENIED:
+ SetStatus(blink::mojom::PermissionStatus::DENIED);
+ std::move(callback).Run(PermissionRequestOutcome::kUserDenied);
+ break;
+ case permissions::PermissionAction::DISMISSED:
+ case permissions::PermissionAction::IGNORED:
+ std::move(callback).Run(PermissionRequestOutcome::kUserDismissed);
+ break;
+ case permissions::PermissionAction::REVOKED:
+ case permissions::PermissionAction::GRANTED_ONCE:
+ case permissions::PermissionAction::NUM:
+ NOTREACHED();
+ break;
+ }
+}
+
+} // namespace QtWebEngineCore
diff --git a/src/core/file_system_access/file_system_access_permission_grant_qt.h b/src/core/file_system_access/file_system_access_permission_grant_qt.h
new file mode 100644
index 000000000..829d2b889
--- /dev/null
+++ b/src/core/file_system_access/file_system_access_permission_grant_qt.h
@@ -0,0 +1,59 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef FILE_SYSTEM_ACCESS_PERMISSION_GRANT_QT_H
+#define FILE_SYSTEM_ACCESS_PERMISSION_GRANT_QT_H
+
+#include "content/public/browser/file_system_access_permission_grant.h"
+#include "url/origin.h"
+#include "file_system_access_permission_context_qt.h"
+#include "content/public/browser/global_routing_id.h"
+#include "components/permissions/permission_util.h"
+
+namespace QtWebEngineCore {
+
+using HandleType = content::FileSystemAccessPermissionContext::HandleType;
+using GrantType = FileSystemAccessPermissionContextQt::GrantType;
+
+class FileSystemAccessPermissionGrantQt : public content::FileSystemAccessPermissionGrant
+{
+public:
+ FileSystemAccessPermissionGrantQt(base::WeakPtr<FileSystemAccessPermissionContextQt> context,
+ const url::Origin &origin, const base::FilePath &path,
+ HandleType handle_type, GrantType type);
+
+ // content::FileSystemAccessPermissionGrant:
+ blink::mojom::PermissionStatus GetStatus() override { return m_status; }
+ base::FilePath GetPath() override { return m_path; }
+ void RequestPermission(content::GlobalRenderFrameHostId frame_id,
+ UserActivationState user_activation_state,
+ base::OnceCallback<void(PermissionRequestOutcome)> callback) override;
+
+ const url::Origin &origin() const { return m_origin; }
+ HandleType handleType() const { return m_handleType; }
+ const base::FilePath &path() const { return m_path; }
+ GrantType type() const { return m_type; }
+
+ void SetStatus(blink::mojom::PermissionStatus status);
+
+protected:
+ ~FileSystemAccessPermissionGrantQt() override;
+
+private:
+ void OnPermissionRequestResult(base::OnceCallback<void(PermissionRequestOutcome)> callback,
+ permissions::PermissionAction result);
+
+ base::WeakPtr<FileSystemAccessPermissionContextQt> const m_context;
+ const url::Origin m_origin;
+ const base::FilePath m_path;
+ const HandleType m_handleType;
+ const GrantType m_type;
+
+ // This member should only be updated via SetStatus(), to make sure
+ // observers are properly notified about any change in status.
+ blink::mojom::PermissionStatus m_status = blink::mojom::PermissionStatus::ASK;
+};
+
+} // namespace QtWebEngineCore
+
+#endif // FILE_SYSTEM_ACCESS_PERMISSION_GRANT_QT_H
diff --git a/src/core/file_system_access/file_system_access_permission_request_controller.h b/src/core/file_system_access/file_system_access_permission_request_controller.h
new file mode 100644
index 000000000..e659f81a7
--- /dev/null
+++ b/src/core/file_system_access/file_system_access_permission_request_controller.h
@@ -0,0 +1,39 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef FILE_SYSTEM_ACCESS_PERMISSION_REQUEST_CONTROLLER_H
+#define FILE_SYSTEM_ACCESS_PERMISSION_REQUEST_CONTROLLER_H
+
+#include "api/qwebenginefilesystemaccessrequest.h"
+#include "request_controller.h"
+
+using HandleType = QWebEngineFileSystemAccessRequest::HandleType;
+using AccessFlags = QWebEngineFileSystemAccessRequest::AccessFlags;
+
+namespace QtWebEngineCore {
+
+class FileSystemAccessPermissionRequestController : public RequestController
+{
+public:
+ FileSystemAccessPermissionRequestController(const QUrl &origin, const QUrl &filePath,
+ HandleType handleType, AccessFlags accessType)
+ : RequestController(origin)
+ , m_filePath(filePath)
+ , m_handleType(handleType)
+ , m_accessType(accessType)
+ {
+ }
+
+ QUrl filePath() const { return m_filePath; }
+ HandleType handleType() const { return m_handleType; }
+ AccessFlags accessFlags() const { return m_accessType; }
+
+private:
+ QUrl m_filePath;
+ HandleType m_handleType;
+ AccessFlags m_accessType;
+};
+
+} // namespace QtWebEngineCore
+
+#endif // FILE_SYSTEM_ACCESS_PERMISSION_REQUEST_CONTROLLER_H
diff --git a/src/core/file_system_access/file_system_access_permission_request_controller_impl.cpp b/src/core/file_system_access/file_system_access_permission_request_controller_impl.cpp
new file mode 100644
index 000000000..f77c974d0
--- /dev/null
+++ b/src/core/file_system_access/file_system_access_permission_request_controller_impl.cpp
@@ -0,0 +1,48 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "file_system_access_permission_request_controller_impl.h"
+
+#include "components/permissions/permission_util.h"
+#include "content/public/browser/file_system_access_permission_context.h"
+#include "type_conversion.h"
+
+namespace QtWebEngineCore {
+
+ASSERT_ENUMS_MATCH(content::FileSystemAccessPermissionContext::HandleType::kFile,
+ QWebEngineFileSystemAccessRequest::HandleType::File);
+ASSERT_ENUMS_MATCH(content::FileSystemAccessPermissionContext::HandleType::kDirectory,
+ QWebEngineFileSystemAccessRequest::HandleType::Directory);
+
+ASSERT_ENUMS_MATCH(FileSystemAccessPermissionRequestManagerQt::Access::kRead,
+ QWebEngineFileSystemAccessRequest::AccessFlag::Read);
+ASSERT_ENUMS_MATCH(FileSystemAccessPermissionRequestManagerQt::Access::kWrite,
+ QWebEngineFileSystemAccessRequest::AccessFlag::Write);
+
+FileSystemAccessPermissionRequestControllerImpl::FileSystemAccessPermissionRequestControllerImpl(
+ const FileSystemAccessPermissionRequestManagerQt::RequestData &request,
+ base::OnceCallback<void(permissions::PermissionAction result)> callback)
+ : FileSystemAccessPermissionRequestController(
+ toQt(request.origin.GetURL()), QUrl::fromLocalFile(toQt(request.path.value())),
+ (HandleType)request.handle_type, AccessFlags((int)request.access))
+ , m_callback(std::move(callback))
+{
+}
+
+FileSystemAccessPermissionRequestControllerImpl::~FileSystemAccessPermissionRequestControllerImpl()
+{
+ if (m_callback)
+ std::move(m_callback).Run(permissions::PermissionAction::IGNORED);
+}
+
+void FileSystemAccessPermissionRequestControllerImpl::accepted()
+{
+ std::move(m_callback).Run(permissions::PermissionAction::GRANTED);
+}
+
+void FileSystemAccessPermissionRequestControllerImpl::rejected()
+{
+ std::move(m_callback).Run(permissions::PermissionAction::DENIED);
+}
+
+} // namespace QtWebEngineCore
diff --git a/src/core/file_system_access/file_system_access_permission_request_controller_impl.h b/src/core/file_system_access/file_system_access_permission_request_controller_impl.h
new file mode 100644
index 000000000..6cca1e549
--- /dev/null
+++ b/src/core/file_system_access/file_system_access_permission_request_controller_impl.h
@@ -0,0 +1,32 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef FILE_SYSTEM_ACCESS_PERMISSION_REQUEST_CONTROLLER_IMPL_H
+#define FILE_SYSTEM_ACCESS_PERMISSION_REQUEST_CONTROLLER_IMPL_H
+
+#include "file_system_access_permission_request_controller.h"
+#include "file_system_access_permission_request_manager_qt.h"
+
+namespace QtWebEngineCore {
+
+class FileSystemAccessPermissionRequestControllerImpl final
+ : public FileSystemAccessPermissionRequestController
+{
+public:
+ FileSystemAccessPermissionRequestControllerImpl(
+ const FileSystemAccessPermissionRequestManagerQt::RequestData &request,
+ base::OnceCallback<void(permissions::PermissionAction result)> callback);
+
+ ~FileSystemAccessPermissionRequestControllerImpl();
+
+protected:
+ void accepted() override;
+ void rejected() override;
+
+private:
+ base::OnceCallback<void(permissions::PermissionAction result)> m_callback;
+};
+
+} // namespace QtWebEngineCore
+
+#endif // FILE_SYSTEM_ACCESS_PERMISSION_REQUEST_CONTROLLER_IMPL_H
diff --git a/src/core/file_system_access/file_system_access_permission_request_manager_qt.cpp b/src/core/file_system_access/file_system_access_permission_request_manager_qt.cpp
new file mode 100644
index 000000000..c384dc7b3
--- /dev/null
+++ b/src/core/file_system_access/file_system_access_permission_request_manager_qt.cpp
@@ -0,0 +1,195 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "file_system_access_permission_request_manager_qt.h"
+
+#include "components/permissions/permission_util.h"
+#include "content/browser/web_contents/web_contents_impl.h"
+#include "content/public/browser/browser_task_traits.h"
+#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/navigation_handle.h"
+
+#include "api/qwebenginefilesystemaccessrequest.h"
+#include "file_system_access_permission_context_factory_qt.h"
+#include "file_system_access_permission_request_controller_impl.h"
+#include "web_contents_adapter_client.h"
+#include "web_contents_view_qt.h"
+
+namespace QtWebEngineCore {
+
+bool RequestsAreIdentical(const FileSystemAccessPermissionRequestManagerQt::RequestData &a,
+ const FileSystemAccessPermissionRequestManagerQt::RequestData &b)
+{
+ return a.origin == b.origin && a.path == b.path && a.handle_type == b.handle_type
+ && a.access == b.access;
+}
+
+bool RequestsAreForSamePath(const FileSystemAccessPermissionRequestManagerQt::RequestData &a,
+ const FileSystemAccessPermissionRequestManagerQt::RequestData &b)
+{
+ return a.origin == b.origin && a.path == b.path && a.handle_type == b.handle_type;
+}
+
+struct FileSystemAccessPermissionRequestManagerQt::Request
+{
+ Request(RequestData data,
+ base::OnceCallback<void(permissions::PermissionAction result)> callback,
+ base::ScopedClosureRunner fullscreen_block)
+ : data(std::move(data))
+ {
+ callbacks.push_back(std::move(callback));
+ fullscreen_blocks.push_back(std::move(fullscreen_block));
+ }
+
+ RequestData data;
+ std::vector<base::OnceCallback<void(permissions::PermissionAction result)>> callbacks;
+ std::vector<base::ScopedClosureRunner> fullscreen_blocks;
+};
+
+FileSystemAccessPermissionRequestManagerQt::~FileSystemAccessPermissionRequestManagerQt() = default;
+
+void FileSystemAccessPermissionRequestManagerQt::AddRequest(
+ RequestData data, base::OnceCallback<void(permissions::PermissionAction result)> callback,
+ base::ScopedClosureRunner fullscreen_block)
+{
+ // Check if any pending requests are identical to the new request.
+ if (m_currentRequest && RequestsAreIdentical(m_currentRequest->data, data)) {
+ m_currentRequest->callbacks.push_back(std::move(callback));
+ m_currentRequest->fullscreen_blocks.push_back(std::move(fullscreen_block));
+ return;
+ }
+ for (const auto &request : m_queuedRequests) {
+ if (RequestsAreIdentical(request->data, data)) {
+ request->callbacks.push_back(std::move(callback));
+ request->fullscreen_blocks.push_back(std::move(fullscreen_block));
+ return;
+ }
+ if (RequestsAreForSamePath(request->data, data)) {
+ // This means access levels are different. Change the existing request
+ // to kReadWrite, and add the new callback.
+ request->data.access = Access::kReadWrite;
+ request->callbacks.push_back(std::move(callback));
+ request->fullscreen_blocks.push_back(std::move(fullscreen_block));
+ return;
+ }
+ }
+
+ m_queuedRequests.push_back(std::make_unique<Request>(std::move(data), std::move(callback),
+ std::move(fullscreen_block)));
+ if (!IsShowingRequest())
+ ScheduleShowRequest();
+}
+
+FileSystemAccessPermissionRequestManagerQt::FileSystemAccessPermissionRequestManagerQt(
+ content::WebContents *web_contents)
+ : content::WebContentsObserver(web_contents)
+ , content::WebContentsUserData<FileSystemAccessPermissionRequestManagerQt>(*web_contents)
+{
+}
+
+bool FileSystemAccessPermissionRequestManagerQt::CanShowRequest() const
+{
+ // Delay showing requests until the main frame is fully loaded.
+ // ScheduleShowRequest() will be called again when that happens.
+ return web_contents()->IsDocumentOnLoadCompletedInPrimaryMainFrame() && !m_queuedRequests.empty()
+ && !m_currentRequest;
+}
+
+void FileSystemAccessPermissionRequestManagerQt::ScheduleShowRequest()
+{
+ if (!CanShowRequest())
+ return;
+
+ content::GetUIThreadTaskRunner({})->PostTask(
+ FROM_HERE,
+ base::BindOnce(&FileSystemAccessPermissionRequestManagerQt::DequeueAndShowRequest,
+ m_weakFactory.GetWeakPtr()));
+}
+
+void FileSystemAccessPermissionRequestManagerQt::DequeueAndShowRequest()
+{
+ if (!CanShowRequest())
+ return;
+
+ m_currentRequest = std::move(m_queuedRequests.front());
+ m_queuedRequests.pop_front();
+
+ WebContentsAdapterClient *client =
+ WebContentsViewQt::from(
+ static_cast<content::WebContentsImpl *>(web_contents())->GetView())
+ ->client();
+ if (!client) {
+ LOG(ERROR)
+ << "Attempt to request file system access from content missing WebContents client";
+ for (auto &callback : m_currentRequest->callbacks)
+ std::move(callback).Run(permissions::PermissionAction::DENIED);
+ return;
+ }
+
+ QWebEngineFileSystemAccessRequest request(
+ std::make_shared<FileSystemAccessPermissionRequestControllerImpl>(
+ m_currentRequest->data,
+ base::BindOnce(
+ &FileSystemAccessPermissionRequestManagerQt::OnPermissionDialogResult,
+ m_weakFactory.GetWeakPtr())));
+ client->runFileSystemAccessRequest(std::move(request));
+}
+
+void FileSystemAccessPermissionRequestManagerQt::DocumentOnLoadCompletedInPrimaryMainFrame()
+{
+ // This is scheduled because while all calls to the browser have been
+ // issued at DOMContentLoaded, they may be bouncing around in scheduled
+ // callbacks finding the UI thread still. This makes sure we allow those
+ // scheduled calls to AddRequest to complete before we show the page-load
+ // permissions bubble.
+ if (!m_queuedRequests.empty())
+ ScheduleShowRequest();
+}
+
+void FileSystemAccessPermissionRequestManagerQt::DidFinishNavigation(
+ content::NavigationHandle *navigation)
+{
+ // We only care about top-level navigations that actually committed.
+ if (!navigation->IsInMainFrame() || !navigation->HasCommitted())
+ return;
+
+ auto src_origin = url::Origin::Create(navigation->GetPreviousPrimaryMainFrameURL());
+ auto dest_origin = url::Origin::Create(navigation->GetURL());
+ if (src_origin == dest_origin)
+ return;
+
+ // Navigated away from |src_origin|, tell permission context to check if
+ // permissions need to be revoked.
+ auto *context = FileSystemAccessPermissionContextFactoryQt::GetForProfileIfExists(
+ web_contents()->GetBrowserContext());
+ if (context)
+ context->NavigatedAwayFromOrigin(src_origin);
+}
+
+void FileSystemAccessPermissionRequestManagerQt::WebContentsDestroyed()
+{
+ auto src_origin = web_contents()->GetPrimaryMainFrame()->GetLastCommittedOrigin();
+
+ // Navigated away from |src_origin|, tell permission context to check if
+ // permissions need to be revoked.
+ auto *context = FileSystemAccessPermissionContextFactoryQt::GetForProfileIfExists(
+ web_contents()->GetBrowserContext());
+ if (context)
+ context->NavigatedAwayFromOrigin(src_origin);
+}
+
+void FileSystemAccessPermissionRequestManagerQt::OnPermissionDialogResult(
+ permissions::PermissionAction result)
+{
+ DCHECK(m_currentRequest);
+ for (auto &callback : m_currentRequest->callbacks)
+ std::move(callback).Run(result);
+
+ m_currentRequest = nullptr;
+ if (!m_queuedRequests.empty())
+ ScheduleShowRequest();
+}
+
+WEB_CONTENTS_USER_DATA_KEY_IMPL(FileSystemAccessPermissionRequestManagerQt);
+
+} // namespace QtWebEngineCore
diff --git a/src/core/file_system_access/file_system_access_permission_request_manager_qt.h b/src/core/file_system_access/file_system_access_permission_request_manager_qt.h
new file mode 100644
index 000000000..840854911
--- /dev/null
+++ b/src/core/file_system_access/file_system_access_permission_request_manager_qt.h
@@ -0,0 +1,79 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef FILE_SYSTEM_ACCESS_PERMISSION_REQUEST_MANAGER_QT_H
+#define FILE_SYSTEM_ACCESS_PERMISSION_REQUEST_MANAGER_QT_H
+
+#include "base/containers/circular_deque.h"
+#include "base/files/file_path.h"
+#include "base/functional/callback_helpers.h"
+#include "base/memory/weak_ptr.h"
+#include "content/public/browser/file_system_access_permission_context.h"
+#include "content/public/browser/web_contents_observer.h"
+#include "content/public/browser/web_contents_user_data.h"
+#include "url/origin.h"
+
+namespace permissions {
+enum class PermissionAction;
+}
+
+namespace QtWebEngineCore {
+
+class FileSystemAccessPermissionRequestManagerQt
+ : public content::WebContentsObserver,
+ public content::WebContentsUserData<FileSystemAccessPermissionRequestManagerQt>
+{
+public:
+ ~FileSystemAccessPermissionRequestManagerQt() override;
+
+ enum class Access {
+ // Only ask for read access.
+ kRead = 0x1,
+ // Only ask for write access, assuming read access has already been granted.
+ kWrite = 0x2,
+ // Ask for both read and write access.
+ kReadWrite = 0x3
+ };
+
+ struct RequestData
+ {
+ url::Origin origin;
+ base::FilePath path;
+ content::FileSystemAccessPermissionContext::HandleType handle_type;
+ Access access;
+ };
+
+ void AddRequest(RequestData request,
+ base::OnceCallback<void(permissions::PermissionAction result)> callback,
+ base::ScopedClosureRunner fullscreen_block);
+
+private:
+ friend class content::WebContentsUserData<FileSystemAccessPermissionRequestManagerQt>;
+
+ explicit FileSystemAccessPermissionRequestManagerQt(content::WebContents *web_contents);
+
+ bool IsShowingRequest() const { return m_currentRequest != nullptr; }
+ bool CanShowRequest() const;
+ void ScheduleShowRequest();
+ void DequeueAndShowRequest();
+
+ // content::WebContentsObserver
+ void DocumentOnLoadCompletedInPrimaryMainFrame() override;
+ void DidFinishNavigation(content::NavigationHandle *navigation_handle) override;
+ void WebContentsDestroyed() override;
+
+ void OnPermissionDialogResult(permissions::PermissionAction result);
+
+ struct Request;
+ // Request currently being shown in prompt.
+ std::unique_ptr<Request> m_currentRequest;
+ // Queued up requests.
+ base::circular_deque<std::unique_ptr<Request>> m_queuedRequests;
+
+ base::WeakPtrFactory<FileSystemAccessPermissionRequestManagerQt> m_weakFactory { this };
+ WEB_CONTENTS_USER_DATA_KEY_DECL();
+};
+
+} // namespace QtWebEngineCore
+
+#endif // FILE_SYSTEM_ACCESS_PERMISSION_REQUEST_MANAGER_QT_H
diff --git a/src/core/find_text_helper.cpp b/src/core/find_text_helper.cpp
index da9d7f352..5dc12fab7 100644
--- a/src/core/find_text_helper.cpp
+++ b/src/core/find_text_helper.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "find_text_helper.h"
#include "qwebenginefindtextresult.h"
@@ -64,17 +28,18 @@ FindTextHelper::~FindTextHelper()
stopFinding();
}
-void FindTextHelper::startFinding(const QString &findText, bool caseSensitively, bool findBackward, const QWebEngineCallback<bool> resultCallback)
+void FindTextHelper::startFinding(const QString &findText, bool caseSensitively, bool findBackward, const std::function<void(const QWebEngineFindTextResult &)> &resultCallback)
{
if (findText.isEmpty()) {
stopFinding();
m_viewClient->findTextFinished(QWebEngineFindTextResult());
- m_widgetCallbacks.invokeEmpty(resultCallback);
+ if (resultCallback)
+ resultCallback(QWebEngineFindTextResult());
return;
}
startFinding(findText, caseSensitively, findBackward);
- m_widgetCallbacks.registerCallback(m_currentFindRequestId, resultCallback);
+ m_widgetCallbacks.insert(m_currentFindRequestId, resultCallback);
}
void FindTextHelper::startFinding(const QString &findText, bool caseSensitively, bool findBackward, const QJSValue &resultCallback)
@@ -97,30 +62,30 @@ void FindTextHelper::startFinding(const QString &findText, bool caseSensitively,
void FindTextHelper::startFinding(const QString &findText, bool caseSensitively, bool findBackward)
{
- if (findText.isEmpty()) {
- stopFinding();
- return;
- }
+ Q_ASSERT(!findText.isEmpty());
- if (m_currentFindRequestId > m_lastCompletedFindRequestId) {
+ const bool findNext = !m_previousFindText.isEmpty() && findText == m_previousFindText;
+ if (isFindTextInProgress()) {
// There are cases where the render process will overwrite a previous request
// with the new search and we'll have a dangling callback, leaving the application
// waiting for it forever.
// Assume that any unfinished find has been unsuccessful when a new one is started
// to cover that case.
m_lastCompletedFindRequestId = m_currentFindRequestId;
+ if (!findNext)
+ m_webContents->StopFinding(content::STOP_FIND_ACTION_KEEP_SELECTION);
m_viewClient->findTextFinished(QWebEngineFindTextResult());
- invokeResultCallback(m_currentFindRequestId, 0);
+ invokeResultCallback(m_currentFindRequestId, 0, 0);
}
blink::mojom::FindOptionsPtr options = blink::mojom::FindOptions::New();
options->forward = !findBackward;
options->match_case = caseSensitively;
- options->find_next = findText == m_previousFindText;
+ options->new_session = !findNext;
m_previousFindText = findText;
m_currentFindRequestId = m_findRequestIdCounter++;
- m_webContents->Find(m_currentFindRequestId, toString16(findText), std::move(options));
+ m_webContents->Find(m_currentFindRequestId, toString16(findText), std::move(options), /*skip_delay=*/true);
}
void FindTextHelper::stopFinding()
@@ -148,7 +113,7 @@ void FindTextHelper::handleFindReply(content::WebContents *source, int requestId
Q_ASSERT(m_currentFindRequestId == requestId);
m_lastCompletedFindRequestId = requestId;
m_viewClient->findTextFinished(QWebEngineFindTextResult(numberOfMatches, activeMatch));
- invokeResultCallback(requestId, numberOfMatches);
+ invokeResultCallback(requestId, numberOfMatches, activeMatch);
}
void FindTextHelper::handleLoadCommitted()
@@ -157,15 +122,15 @@ void FindTextHelper::handleLoadCommitted()
m_previousFindText = QString();
}
-void FindTextHelper::invokeResultCallback(int requestId, int numberOfMatches)
+void FindTextHelper::invokeResultCallback(int requestId, int numberOfMatches, int activeMatch)
{
if (m_quickCallbacks.contains(requestId)) {
QJSValue resultCallback = m_quickCallbacks.take(requestId);
QJSValueList args;
args.append(QJSValue(numberOfMatches));
resultCallback.call(args);
- } else {
- m_widgetCallbacks.invoke(requestId, numberOfMatches > 0);
+ } else if (auto func = m_widgetCallbacks.take(requestId)) {
+ func(QWebEngineFindTextResult(numberOfMatches, activeMatch));
}
}
diff --git a/src/core/find_text_helper.h b/src/core/find_text_helper.h
index 9843dc8b5..6d2e48b63 100644
--- a/src/core/find_text_helper.h
+++ b/src/core/find_text_helper.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
//
// W A R N I N G
@@ -51,10 +15,13 @@
#ifndef FIND_TEXT_HELPER_H
#define FIND_TEXT_HELPER_H
-#include "qtwebenginecoreglobal_p.h"
+#include <QtWebEngineCore/private/qtwebenginecoreglobal_p.h>
-#include "qwebenginecallback_p.h"
#include <QJSValue>
+#include <QMap>
+#include <QString>
+
+#include <functional>
namespace content {
class WebContents;
@@ -64,16 +31,18 @@ namespace gfx {
class Rect;
}
+QT_FORWARD_DECLARE_CLASS(QWebEngineFindTextResult)
+
namespace QtWebEngineCore {
class WebContentsAdapterClient;
-class Q_WEBENGINECORE_PRIVATE_EXPORT FindTextHelper {
+class Q_WEBENGINECORE_EXPORT FindTextHelper {
public:
FindTextHelper(content::WebContents *webContents, WebContentsAdapterClient *viewClient);
~FindTextHelper();
- void startFinding(const QString &findText, bool caseSensitively, bool findBackward, const QWebEngineCallback<bool> resultCallback);
+ void startFinding(const QString &findText, bool caseSensitively, bool findBackward, const std::function<void(const QWebEngineFindTextResult &)> &resultCallback);
void startFinding(const QString &findText, bool caseSensitively, bool findBackward, const QJSValue &resultCallback);
void startFinding(const QString &findText, bool caseSensitively, bool findBackward);
void stopFinding();
@@ -82,7 +51,7 @@ public:
void handleLoadCommitted();
private:
- void invokeResultCallback(int requestId, int numberOfMatches);
+ void invokeResultCallback(int requestId, int numberOfMatches, int activeMatch);
content::WebContents *m_webContents;
WebContentsAdapterClient *m_viewClient;
@@ -94,7 +63,7 @@ private:
QString m_previousFindText;
QMap<int, QJSValue> m_quickCallbacks;
- CallbackDirectory m_widgetCallbacks;
+ QMap<int, std::function<void(const QWebEngineFindTextResult &)>> m_widgetCallbacks;
};
} // namespace QtWebEngineCore
diff --git a/src/core/global_descriptors_qt.h b/src/core/global_descriptors_qt.h
index b9d622606..f9b08f1d6 100644
--- a/src/core/global_descriptors_qt.h
+++ b/src/core/global_descriptors_qt.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef GLOBAL_DESCRIPTORS_QT_H
#define GLOBAL_DESCRIPTORS_QT_H
diff --git a/src/core/gn_run.pro b/src/core/gn_run.pro
deleted file mode 100644
index 3d6fda80e..000000000
--- a/src/core/gn_run.pro
+++ /dev/null
@@ -1,72 +0,0 @@
-include($$QTWEBENGINE_OUT_ROOT/src/buildtools/qtbuildtools-config.pri)
-include($$QTWEBENGINE_OUT_ROOT/src/core/qtwebenginecore-config.pri)
-QT_FOR_CONFIG += buildtools-private webenginecore-private core-private gui-private
-
-TEMPLATE = aux
-
-qtConfig(debug_and_release): CONFIG += debug_and_release
-qtConfig(build_all): CONFIG += build_all
-
-qtConfig(webengine-system-ninja) {
- QT_TOOL.ninja.binary = ninja
-} else {
- QT_TOOL.ninja.binary = $$shell_quote($$shell_path($$ninjaPath()))
-}
-
-win32 {
- # Add the gnuwin32/bin subdir of qt5.git to PATH. Needed for calling bison and friends.
- gnuwin32path.name = PATH
- gnuwin32path.value = $$shell_path($$clean_path($$QTWEBENGINE_ROOT/../gnuwin32/bin))
- gnuwin32path.CONFIG += prepend
- exists($$gnuwin32path.value): QT_TOOL_ENV = gnuwin32path
-}
-
-qtPrepareTool(NINJA, ninja)
-QT_TOOL_ENV =
-
-build_pass|!debug_and_release {
- gn_binary = gn
-
- runninja.target = run_ninja
-
- gn_args = $$gnWebEngineArgs()
-
- gn_args += "qtwebengine_target=\"$$system_path($$OUT_PWD/$$getConfigDir()):QtWebEngineCore\""
-
- !qtConfig(webengine-system-gn) {
- gn_binary = $$system_quote($$system_path($$gnPath()))
- }
-
- gn_args = $$system_quote($$gn_args)
- gn_src_root = $$system_quote($$system_path($$QTWEBENGINE_ROOT/$$getChromiumSrcDir()))
- gn_build_root = $$system_quote($$system_path($$OUT_PWD/$$getConfigDir()))
- gn_python = "--script-executable=$$pythonPathForSystem()"
- gn_run = $$gn_binary gen $$gn_build_root $$gn_python --args=$$gn_args --root=$$gn_src_root
-
- message("Running: $$gn_run ")
- !system($$gn_run) {
- error("GN run error!")
- }
-
- ninjaflags = $$(NINJAFLAGS)
- isEmpty(ninjaflags):!silent: ninjaflags = "-v"
-
- runninja.commands = $$NINJA $$ninjaflags \$\(NINJAJOBS\) -C $$gn_build_root QtWebEngineCore
- QMAKE_EXTRA_TARGETS += runninja
-
- build_pass:build_all: default_target.target = all
- else: default_target.target = first
- default_target.depends = runninja
- QMAKE_EXTRA_TARGETS += default_target
-}
-
-!build_pass:debug_and_release {
- # Special GNU make target for the meta Makefile that ensures that our debug and release Makefiles won't both run ninja in parallel.
- notParallel.target = .NOTPARALLEL
- QMAKE_EXTRA_TARGETS += notParallel
-}
-
-build_pass:CONFIG(debug, debug|release) {
- TARGET = gn_run_debug
-}
-
diff --git a/src/core/javascript_dialog_controller.cpp b/src/core/javascript_dialog_controller.cpp
index 86f5b9795..c8a6a58bf 100644
--- a/src/core/javascript_dialog_controller.cpp
+++ b/src/core/javascript_dialog_controller.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "javascript_dialog_controller.h"
#include "javascript_dialog_controller_p.h"
@@ -45,7 +9,7 @@
namespace QtWebEngineCore {
-void JavaScriptDialogControllerPrivate::dialogFinished(bool accepted, const base::string16 &promptValue)
+void JavaScriptDialogControllerPrivate::dialogFinished(bool accepted, const std::u16string &promptValue)
{
// Clear the queue first as this could result in the engine asking us to run another dialog,
// but hold a shared pointer so the dialog does not get deleted prematurely when running in-process.
diff --git a/src/core/javascript_dialog_controller.h b/src/core/javascript_dialog_controller.h
index ba9f51944..6c1ee269f 100644
--- a/src/core/javascript_dialog_controller.h
+++ b/src/core/javascript_dialog_controller.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
//
// W A R N I N G
@@ -59,7 +23,7 @@ namespace QtWebEngineCore {
class JavaScriptDialogControllerPrivate;
-class Q_WEBENGINECORE_PRIVATE_EXPORT JavaScriptDialogController : public QObject {
+class Q_WEBENGINECORE_EXPORT JavaScriptDialogController : public QObject {
Q_OBJECT
public:
~JavaScriptDialogController();
diff --git a/src/core/javascript_dialog_controller_p.h b/src/core/javascript_dialog_controller_p.h
index ab7b09268..af064250b 100644
--- a/src/core/javascript_dialog_controller_p.h
+++ b/src/core/javascript_dialog_controller_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef JAVASCRIPT_DIALOG_CONTROLLER_P_H
#define JAVASCRIPT_DIALOG_CONTROLLER_P_H
@@ -51,12 +15,13 @@
// We mean it.
//
-#include "base/callback.h"
+#include "base/functional/callback.h"
#include "content/public/browser/javascript_dialog_manager.h"
#include "web_contents_adapter_client.h"
#include <QString>
+#include <QUrl>
namespace content {
class WebContents;
@@ -67,7 +32,7 @@ namespace QtWebEngineCore {
class JavaScriptDialogControllerPrivate {
public:
- void dialogFinished(bool accepted, const base::string16 &promptValue);
+ void dialogFinished(bool accepted, const std::u16string &promptValue);
JavaScriptDialogControllerPrivate(WebContentsAdapterClient::JavascriptDialogType, const QString &message, const QString &prompt
, const QString& title, const QUrl &securityOrigin
, content::JavaScriptDialogManager::DialogClosedCallback &&, content::WebContents *);
diff --git a/src/core/javascript_dialog_manager_qt.cpp b/src/core/javascript_dialog_manager_qt.cpp
index 289947237..c5ee357ad 100644
--- a/src/core/javascript_dialog_manager_qt.cpp
+++ b/src/core/javascript_dialog_manager_qt.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "javascript_dialog_manager_qt.h"
@@ -63,8 +27,8 @@ JavaScriptDialogManagerQt *JavaScriptDialogManagerQt::GetInstance()
void JavaScriptDialogManagerQt::RunJavaScriptDialog(content::WebContents *webContents,
content::RenderFrameHost *renderFrameHost,
content::JavaScriptDialogType dialog_type,
- const base::string16 &messageText,
- const base::string16 &defaultPromptText,
+ const std::u16string &messageText,
+ const std::u16string &defaultPromptText,
content::JavaScriptDialogManager::DialogClosedCallback callback,
bool *didSuppressMessage)
{
@@ -87,12 +51,12 @@ void JavaScriptDialogManagerQt::RunBeforeUnloadDialog(content::WebContents *webC
runDialogForContents(webContents, WebContentsAdapterClient::UnloadDialog, QString(), QString(), toQt(originUrl), std::move(callback));
}
-bool JavaScriptDialogManagerQt::HandleJavaScriptDialog(content::WebContents *contents, bool accept, const base::string16 *promptOverride)
+bool JavaScriptDialogManagerQt::HandleJavaScriptDialog(content::WebContents *contents, bool accept, const std::u16string *promptOverride)
{
QSharedPointer<JavaScriptDialogController> dialog = m_activeDialogs.value(contents);
if (!dialog)
return false;
- dialog->d->dialogFinished(accept, promptOverride ? *promptOverride : base::string16());
+ dialog->d->dialogFinished(accept, promptOverride ? *promptOverride : std::u16string());
takeDialogForContents(contents);
return true;
}
diff --git a/src/core/javascript_dialog_manager_qt.h b/src/core/javascript_dialog_manager_qt.h
index ca7432a77..2a587afc7 100644
--- a/src/core/javascript_dialog_manager_qt.h
+++ b/src/core/javascript_dialog_manager_qt.h
@@ -1,45 +1,8 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef JAVASCRIPT_DIALOG_MANAGER_QT_H
#define JAVASCRIPT_DIALOG_MANAGER_QT_H
-#include "base/callback.h"
#include "content/public/browser/javascript_dialog_manager.h"
#include "web_contents_adapter_client.h"
@@ -61,14 +24,14 @@ public:
static JavaScriptDialogManagerQt *GetInstance();
void RunJavaScriptDialog(content::WebContents *, content::RenderFrameHost *, content::JavaScriptDialogType dialog_type,
- const base::string16 &messageText, const base::string16 &defaultPromptText,
+ const std::u16string &messageText, const std::u16string &defaultPromptText,
DialogClosedCallback callback,
bool *didSuppressMessage) override;
void RunBeforeUnloadDialog(content::WebContents *web_contents,
content::RenderFrameHost *render_frame_host,
bool is_reload,
DialogClosedCallback callback) override;
- bool HandleJavaScriptDialog(content::WebContents *, bool accept, const base::string16 *promptOverride) override;
+ bool HandleJavaScriptDialog(content::WebContents *, bool accept, const std::u16string *promptOverride) override;
void CancelDialogs(content::WebContents *contents, bool /*reset_state*/) override
{
takeDialogForContents(contents);
diff --git a/src/core/location_provider_qt.cpp b/src/core/location_provider_qt.cpp
index d5a7f1297..dc0d80aa7 100644
--- a/src/core/location_provider_qt.cpp
+++ b/src/core/location_provider_qt.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "location_provider_qt.h"
@@ -48,13 +12,18 @@
#include <QtCore/QThread>
#include <QtPositioning/QGeoPositionInfoSource>
-#include "base/bind.h"
+#if QT_CONFIG(permissions)
+#include <QtCore/qpermissions.h>
+#endif
+
+#include "base/functional/bind.h"
#include "base/memory/weak_ptr.h"
-#include "base/message_loop/message_loop.h"
#include "content/public/browser/browser_thread.h"
#include "services/device/geolocation/geolocation_provider.h"
#include "services/device/geolocation/geolocation_provider_impl.h"
+#include "services/device/public/mojom/geoposition.mojom.h"
+
namespace QtWebEngineCore {
using content::BrowserThread;
@@ -72,14 +41,14 @@ public:
private Q_SLOTS:
void updatePosition(const QGeoPositionInfo &);
void error(QGeoPositionInfoSource::Error positioningError);
- void timeout();
private:
+ void startImpl(bool highAccuracy);
LocationProviderQt *m_locationProvider;
QGeoPositionInfoSource *m_positionInfoSource;
base::WeakPtrFactory<LocationProviderQt> m_locationProviderFactory;
- void postToLocationProvider(const base::Closure &task);
+ void postToLocationProvider(base::OnceClosure task);
friend class LocationProviderQt;
};
@@ -104,6 +73,38 @@ static bool isHighAccuracySource(const QGeoPositionInfoSource *source)
void QtPositioningHelper::start(bool highAccuracy)
{
DCHECK_CURRENTLY_ON(BrowserThread::UI);
+
+ // New Qt permissions API from 6.5.0
+#if QT_CONFIG(permissions)
+ QLocationPermission locationPermission;
+ locationPermission.setAvailability(QLocationPermission::WhenInUse);
+
+ QLocationPermission::Accuracy accuracy = highAccuracy ? QLocationPermission::Precise
+ : QLocationPermission::Approximate;
+ locationPermission.setAccuracy(accuracy);
+
+ switch (qApp->checkPermission(locationPermission)) {
+ case Qt::PermissionStatus::Undetermined:
+ qApp->requestPermission(locationPermission, this,
+ [this, &highAccuracy](const QPermission &permission) {
+ if (permission.status() == Qt::PermissionStatus::Granted)
+ this->startImpl(highAccuracy);
+ });
+
+ return;
+ case Qt::PermissionStatus::Denied:
+ qWarning("Failed to initialize location provider: The user does not have the right "
+ "permissions or has denied the permission request.");
+ return;
+ case Qt::PermissionStatus::Granted:
+ break; // Proceed
+ }
+#endif
+ startImpl(highAccuracy);
+}
+
+void QtPositioningHelper::startImpl(bool highAccuracy){
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!m_positionInfoSource)
m_positionInfoSource = QGeoPositionInfoSource::createDefaultSource(this);
if (!m_positionInfoSource) {
@@ -134,9 +135,8 @@ void QtPositioningHelper::start(bool highAccuracy)
connect(m_positionInfoSource, &QGeoPositionInfoSource::positionUpdated, this, &QtPositioningHelper::updatePosition);
// disambiguate the error getter and the signal in QGeoPositionInfoSource.
- connect(m_positionInfoSource, static_cast<void (QGeoPositionInfoSource::*)(QGeoPositionInfoSource::Error)>(&QGeoPositionInfoSource::error)
+ connect(m_positionInfoSource, static_cast<void (QGeoPositionInfoSource::*)(QGeoPositionInfoSource::Error)>(&QGeoPositionInfoSource::errorOccurred)
, this, &QtPositioningHelper::error);
- connect(m_positionInfoSource, &QGeoPositionInfoSource::updateTimeout, this, &QtPositioningHelper::timeout);
m_positionInfoSource->startUpdates();
return;
@@ -163,80 +163,75 @@ void QtPositioningHelper::updatePosition(const QGeoPositionInfo &pos)
if (!pos.isValid())
return;
Q_ASSERT(m_positionInfoSource->error() == QGeoPositionInfoSource::NoError);
- device::mojom::Geoposition newPos;
- newPos.error_code = device::mojom::Geoposition::ErrorCode::NONE;
- newPos.error_message.clear();
+ auto newPos = device::mojom::Geoposition::New();
- newPos.timestamp = toTime(pos.timestamp());
- newPos.latitude = pos.coordinate().latitude();
- newPos.longitude = pos.coordinate().longitude();
+ newPos->timestamp = toTime(pos.timestamp());
+ newPos->latitude = pos.coordinate().latitude();
+ newPos->longitude = pos.coordinate().longitude();
const double altitude = pos.coordinate().altitude();
if (!qIsNaN(altitude))
- newPos.altitude = altitude;
+ newPos->altitude = altitude;
// Chromium's geoposition needs a valid (as in >=0.) accuracy field.
// try and get an accuracy estimate from QGeoPositionInfo.
// If we don't have any accuracy info, 100m seems a pesimistic enough default.
if (!pos.hasAttribute(QGeoPositionInfo::VerticalAccuracy) && !pos.hasAttribute(QGeoPositionInfo::HorizontalAccuracy))
- newPos.accuracy = 100;
+ newPos->accuracy = 100;
else {
const double vAccuracy = pos.hasAttribute(QGeoPositionInfo::VerticalAccuracy) ? pos.attribute(QGeoPositionInfo::VerticalAccuracy) : 0;
const double hAccuracy = pos.hasAttribute(QGeoPositionInfo::HorizontalAccuracy) ? pos.attribute(QGeoPositionInfo::HorizontalAccuracy) : 0;
- newPos.accuracy = sqrt(vAccuracy * vAccuracy + hAccuracy * hAccuracy);
+ newPos->accuracy = sqrt(vAccuracy * vAccuracy + hAccuracy * hAccuracy);
}
// And now the "nice to have" fields (-1 means invalid).
- newPos.speed = pos.hasAttribute(QGeoPositionInfo::GroundSpeed) ? pos.attribute(QGeoPositionInfo::GroundSpeed) : -1;
- newPos.heading = pos.hasAttribute(QGeoPositionInfo::Direction) ? pos.attribute(QGeoPositionInfo::Direction) : -1;
+ newPos->speed = pos.hasAttribute(QGeoPositionInfo::GroundSpeed) ? pos.attribute(QGeoPositionInfo::GroundSpeed) : -1;
+ newPos->heading = pos.hasAttribute(QGeoPositionInfo::Direction) ? pos.attribute(QGeoPositionInfo::Direction) : -1;
+ auto newResult = device::mojom::GeopositionResult::NewPosition(std::move(newPos));
if (m_locationProvider)
- postToLocationProvider(base::Bind(&LocationProviderQt::updatePosition, m_locationProviderFactory.GetWeakPtr(), newPos));
+ postToLocationProvider(base::BindOnce(&LocationProviderQt::updatePosition, m_locationProviderFactory.GetWeakPtr(), std::move(newResult)));
}
void QtPositioningHelper::error(QGeoPositionInfoSource::Error positioningError)
{
Q_ASSERT(positioningError != QGeoPositionInfoSource::NoError);
- device::mojom::Geoposition newPos;
+ auto newError = device::mojom::GeopositionError::New();
switch (positioningError) {
case QGeoPositionInfoSource::AccessError:
- newPos.error_code = device::mojom::Geoposition::ErrorCode::PERMISSION_DENIED;
+ newError->error_code = device::mojom::GeopositionErrorCode::kPermissionDenied;
+ break;
+ case QGeoPositionInfoSource::UpdateTimeoutError:
+ // content::Geoposition::ERROR_CODE_TIMEOUT is not handled properly in the renderer process, and the timeout
+ // argument used in JS never comes all the way to the browser process.
+ // Let's just treat it like any other error where the position is unavailable.
+ newError->error_code = device::mojom::GeopositionErrorCode::kPositionUnavailable;
break;
case QGeoPositionInfoSource::ClosedError:
case QGeoPositionInfoSource::UnknownSourceError: // position unavailable is as good as it gets in Geoposition
default:
- newPos.error_code = device::mojom::Geoposition::ErrorCode::POSITION_UNAVAILABLE;
+ newError->error_code = device::mojom::GeopositionErrorCode::kPositionUnavailable;
break;
}
+ auto newResult = device::mojom::GeopositionResult::NewError(std::move(newError));
if (m_locationProvider)
- postToLocationProvider(base::Bind(&LocationProviderQt::updatePosition, m_locationProviderFactory.GetWeakPtr(), newPos));
-}
-
-void QtPositioningHelper::timeout()
-{
- device::mojom::Geoposition newPos;
- // content::Geoposition::ERROR_CODE_TIMEOUT is not handled properly in the renderer process, and the timeout
- // argument used in JS never comes all the way to the browser process.
- // Let's just treat it like any other error where the position is unavailable.
- newPos.error_code = device::mojom::Geoposition::ErrorCode::POSITION_UNAVAILABLE;
- if (m_locationProvider)
- postToLocationProvider(base::Bind(&LocationProviderQt::updatePosition, m_locationProviderFactory.GetWeakPtr(), newPos));
+ postToLocationProvider(base::BindOnce(&LocationProviderQt::updatePosition, m_locationProviderFactory.GetWeakPtr(), std::move(newResult)));
}
-inline void QtPositioningHelper::postToLocationProvider(const base::Closure &task)
+inline void QtPositioningHelper::postToLocationProvider(base::OnceClosure task)
{
- static_cast<device::GeolocationProviderImpl*>(device::GeolocationProvider::GetInstance())->task_runner()->PostTask(FROM_HERE, task);
+ static_cast<device::GeolocationProviderImpl*>(device::GeolocationProvider::GetInstance())->task_runner()->PostTask(FROM_HERE, std::move(task));
}
LocationProviderQt::LocationProviderQt()
- : m_positioningHelper(0)
+ : m_positioningHelper(nullptr)
{
}
LocationProviderQt::~LocationProviderQt()
{
if (m_positioningHelper) {
- m_positioningHelper->m_locationProvider = 0;
+ m_positioningHelper->m_locationProvider = nullptr;
m_positioningHelper->m_locationProviderFactory.InvalidateWeakPtrs();
m_positioningHelper->deleteLater();
}
@@ -270,10 +265,10 @@ void LocationProviderQt::SetUpdateCallback(const LocationProviderUpdateCallback&
m_callback = callback;
}
-void LocationProviderQt::updatePosition(const device::mojom::Geoposition &position)
+void LocationProviderQt::updatePosition(device::mojom::GeopositionResultPtr position)
{
- m_lastKnownPosition = position;
- m_callback.Run(this, position);
+ m_lastKnownPosition = std::move(position);
+ m_callback.Run(this, m_lastKnownPosition.Clone());
}
} // namespace QtWebEngineCore
diff --git a/src/core/location_provider_qt.h b/src/core/location_provider_qt.h
index 8e5ad0e54..93e409d77 100644
--- a/src/core/location_provider_qt.h
+++ b/src/core/location_provider_qt.h
@@ -1,56 +1,16 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef LOCATION_PROVIDER_QT_H
#define LOCATION_PROVIDER_QT_H
-#include <QtCore/qcompilerdetection.h>
+#include <QtCore/qtconfigmacros.h>
#include "services/device/public/cpp/geolocation/geoposition.h"
#include "services/device/public/cpp/geolocation/location_provider.h"
QT_FORWARD_DECLARE_CLASS(QThread)
-namespace base {
-class MessageLoop;
-}
-
namespace QtWebEngineCore {
class QtPositioningHelper;
@@ -63,16 +23,17 @@ public:
// LocationProvider
void StartProvider(bool high_accuracy) override;
void StopProvider() override;
- const device::mojom::Geoposition& GetPosition() override { return m_lastKnownPosition; }
+ const device::mojom::GeopositionResult* GetPosition() override { return m_lastKnownPosition.get(); }
void OnPermissionGranted() override;
- void SetUpdateCallback(const LocationProviderUpdateCallback& callback) override;
+ void SetUpdateCallback(const LocationProviderUpdateCallback &callback) override;
+ void FillDiagnostics(device::mojom::GeolocationDiagnostics &) override {}
private:
friend class QtPositioningHelper;
- void updatePosition(const device::mojom::Geoposition &);
+ void updatePosition(device::mojom::GeopositionResultPtr);
- device::mojom::Geoposition m_lastKnownPosition;
+ device::mojom::GeopositionResultPtr m_lastKnownPosition;
LocationProviderUpdateCallback m_callback;
QtPositioningHelper *m_positioningHelper;
};
diff --git a/src/core/locked_ptr.h b/src/core/locked_ptr.h
deleted file mode 100644
index 46d89819b..000000000
--- a/src/core/locked_ptr.h
+++ /dev/null
@@ -1,301 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef LOCKED_PTR_H
-#define LOCKED_PTR_H
-
-#include <base/bind_internal.h>
-
-#include <QtCore/qreadwritelock.h>
-
-namespace base {
-
-struct LockedPtrCore
-{
- LockedPtrCore(uintptr_t data) : data(data) {}
-
- std::atomic<size_t> refCount{1};
- // Atomic so that WeakLockedPtr::get can still read it.
- std::atomic<uintptr_t> data;
- QReadWriteLock lock{QReadWriteLock::Recursive};
-};
-
-enum class LockedPtrMode { Weak, Shared, Exclusive };
-
-template<class T, LockedPtrMode mode> class LockedPtr;
-
-// A WeakLockedPtr<T> is something like shared_ptr<T*>. The T* value can only be
-// accessed by atomic read.
-template<class T> using WeakLockedPtr = LockedPtr<T, LockedPtrMode::Weak>;
-
-// A SharedLockedPtr<T> is like WeakLockedPtr<T>, but the T* value is prevented
-// from changing for the lifetime of the SharedLockedPtr by holding a
-// shared-exclusive mutex in shared mode.
-template<class T> using SharedLockedPtr = LockedPtr<T, LockedPtrMode::Shared>;
-
-// An ExclusiveLockedPtr<T> is like SharedLockedPtr<T>, but the mutex is held in
-// exclusive mode. Only in this mode can the T* value be changed.
-template<class T> using ExclusiveLockedPtr = LockedPtr<T, LockedPtrMode::Exclusive>;
-
-template<class T, LockedPtrMode mode>
-class LockedPtr
-{
- template<class T1>
- static constexpr bool canConstructFrom =
- std::is_same<T, T1>::value ||
- std::is_same<T, const T1>::value;
-
-public:
- constexpr LockedPtr() {}
- constexpr LockedPtr(std::nullptr_t) {}
-
- LockedPtr(const LockedPtr &that)
- {
- m_core = that.m_core;
- lock();
- }
-
- LockedPtr &operator=(const LockedPtr &that)
- {
- unlock();
- m_core = that.m_core;
- lock();
- }
-
- LockedPtr(LockedPtr &&that)
- {
- m_core = that.m_core;
- that.m_core = nullptr;
- }
-
- LockedPtr &operator=(LockedPtr &&that)
- {
- unlock();
- m_core = that.m_core;
- that.m_core = nullptr;
- }
-
- template<class T1, LockedPtrMode mode1,
- class Enable = std::enable_if_t<canConstructFrom<T1>>>
- LockedPtr(const LockedPtr<T1, mode1> &that)
- {
- m_core = that.m_core;
- lock();
- }
-
- template<class T1, LockedPtrMode mode1,
- class Enable = std::enable_if_t<canConstructFrom<T1>>>
- LockedPtr &operator=(const LockedPtr<T1, mode1> &that)
- {
- unlock();
- m_core = that.m_core;
- lock();
- }
-
- template<class T1,
- class Enable = std::enable_if_t<canConstructFrom<T1>>>
- LockedPtr(LockedPtr<T1, mode> &&that)
- {
- m_core = that.m_core;
- that.m_core = nullptr;
- }
-
- template<class T1,
- class Enable = std::enable_if_t<canConstructFrom<T1>>>
- LockedPtr &operator=(LockedPtr<T1, mode> &&that)
- {
- unlock();
- m_core = that.m_core;
- that.m_core = nullptr;
- }
-
- ~LockedPtr()
- {
- unlock();
- }
-
- T *get() const
- {
- if (m_core) {
- if (mode == LockedPtrMode::Weak)
- return reinterpret_cast<T *>(m_core->data.load(std::memory_order_acquire));
- else
- return reinterpret_cast<T *>(m_core->data.load(std::memory_order_relaxed));
- }
- return nullptr;
- }
-
- void set(T *value)
- {
- static_assert(mode == LockedPtrMode::Exclusive, "");
- DCHECK(m_core);
- m_core->data.store(reinterpret_cast<uintptr_t>(value), std::memory_order_release);
- }
-
- T &operator*() const { return *get(); }
- T *operator->() const { return get(); }
- explicit operator bool() const { return get(); }
-
- bool MaybeValid() const { return m_core; }
-
- static LockedPtr create(T *value)
- {
- return new LockedPtrCore(reinterpret_cast<uintptr_t>(value));
- }
-
-private:
- template<class T1, LockedPtrMode mode1> friend class LockedPtr;
-
- LockedPtr(LockedPtrCore *core)
- : m_core(core)
- {}
-
- void lock()
- {
- if (m_core) {
- ++m_core->refCount;
-
- if (mode == LockedPtrMode::Shared)
- m_core->lock.lockForRead();
- else if (mode == LockedPtrMode::Exclusive)
- m_core->lock.lockForWrite();
- }
- }
-
- void unlock()
- {
- if (m_core) {
- if (mode != LockedPtrMode::Weak)
- m_core->lock.unlock();
-
- if (--m_core->refCount == 0)
- delete m_core;
- }
- }
-
- LockedPtrCore *m_core = nullptr;
-};
-
-// This makes Bind check the pointer before calling the functor.
-template<class T>
-struct IsWeakReceiver<WeakLockedPtr<T>> : std::true_type {};
-
-// By converting the WeakLockedPtr into a SharedLockedPtr we prevent the
-// pointed-to object from being destroyed during the base::Callback::Run call.
-//
-// Unwrap() is called before checking the pointer, so there's no race condition.
-template<class T>
-struct BindUnwrapTraits<WeakLockedPtr<T>>
-{
- static SharedLockedPtr<T> Unwrap(const WeakLockedPtr<T> &o)
- {
- return o;
- }
-};
-
-// Like base::WeakPtrFactory, but InvalidateWeakPtrs *waits* until all currently
-// executing base::Callbacks are finished. Queued up base::Callbacks are still
-// canceled, exactly like with WeakPtrFactory.
-//
-// Consider, for example, the function
-//
-// void fun()
-// {
-// MyClass *myClass = new MyClass;
-// myClass->scheduleDoStuff();
-// delete myClass; // ???
-// }
-//
-// where
-//
-// class MyClass
-// {
-// public:
-// void scheduleDoStuff()
-// {
-// content::BrowserThread::PostTask(
-// content::BrowserThread::IO, FROM_HERE,
-// base::BindOnce(&MyClass::doStuff, m_weakPtrFactory.GetWeakPtr()));
-// }
-// void doStuff();
-// private:
-// //base::WeakPtrFactory m_weakPtrFactory{this};
-// base::LockedPtrFactory m_weakPtrFactory{this};
-// };
-//
-// What happens if the 'delete myClass' line is executed concurrently with
-// MyClass::doStuff?
-//
-// With WeakPtrs we get a segfault or perhaps memory corruption.
-//
-// With LockedPtrs we get no crash and no corruption: LockedPtrFactory's
-// destructor will wait until doStuff is done before continuing.
-template<class T>
-class LockedPtrFactory
-{
-public:
- explicit LockedPtrFactory(T *value)
- : m_ptr(WeakLockedPtr<T>::create(value))
- {}
-
- ~LockedPtrFactory()
- {
- InvalidateWeakPtrs();
- }
-
- WeakLockedPtr<T> GetWeakPtr() { return m_ptr; }
- WeakLockedPtr<const T> GetWeakPtr() const { return m_ptr; }
- SharedLockedPtr<T> GetSharedPtr() { return m_ptr; }
- SharedLockedPtr<const T> GetSharedPtr() const { return m_ptr; }
- ExclusiveLockedPtr<T> GetExclusivePtr() { return m_ptr; }
- ExclusiveLockedPtr<const T> GetExclusivePtr() const { return m_ptr; }
-
- void InvalidateWeakPtrs()
- {
- if (ExclusiveLockedPtr<T> ptr = m_ptr)
- ptr.set(nullptr);
- }
-
-private:
- WeakLockedPtr<T> m_ptr;
-};
-
-} // namespace base
-
-#endif // !LOCKED_PTR_H
diff --git a/src/core/login_delegate_qt.cpp b/src/core/login_delegate_qt.cpp
index 7942c8279..3f916b797 100644
--- a/src/core/login_delegate_qt.cpp
+++ b/src/core/login_delegate_qt.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
@@ -43,28 +7,15 @@
#include "login_delegate_qt.h"
-#include "base/task/post_task.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_view_host.h"
-#include "extensions/buildflags/buildflags.h"
-#include "services/network/public/cpp/features.h"
-
-#if BUILDFLAG(ENABLE_EXTENSIONS)
-#include "extensions/browser/info_map.h"
-#include "extensions/common/extension.h"
-#include "extensions/common/manifest_handlers/mime_types_handler.h"
-#endif // BUILDFLAG(ENABLE_EXTENSIONS)
-
#include "net/url_request/url_request.h"
+#include "services/network/public/cpp/features.h"
#include "authentication_dialog_controller.h"
#include "authentication_dialog_controller_p.h"
-#if BUILDFLAG(ENABLE_EXTENSIONS)
-#include "extensions/extension_system_qt.h"
-#endif // BUILDFLAG(ENABLE_EXTENSIONS)
-#include "resource_context_qt.h"
#include "type_conversion.h"
#include "web_contents_view_qt.h"
#include "web_engine_context.h"
@@ -82,8 +33,7 @@ LoginDelegateQt::LoginDelegateQt(const net::AuthChallengeInfo &authInfo,
, m_auth_required_callback(std::move(auth_required_callback))
, m_weakFactory(this)
{
- base::PostTask(
- FROM_HERE, { content::BrowserThread::UI },
+ content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
base::BindOnce(&LoginDelegateQt::triggerDialog, m_weakFactory.GetWeakPtr()));
}
@@ -145,7 +95,7 @@ void LoginDelegateQt::sendAuthToRequester(bool success, const QString &user, con
if (success && web_contents())
std::move(m_auth_required_callback).Run(net::AuthCredentials(toString16(user), toString16(password)));
else
- std::move(m_auth_required_callback).Run(base::nullopt);
+ std::move(m_auth_required_callback).Run(absl::nullopt);
}
}
diff --git a/src/core/login_delegate_qt.h b/src/core/login_delegate_qt.h
index 7b8d869e1..b1bae0c0b 100644
--- a/src/core/login_delegate_qt.h
+++ b/src/core/login_delegate_qt.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef LOGIN_DELEGATE_QT_H
#define LOGIN_DELEGATE_QT_H
diff --git a/src/core/media_capture_devices_dispatcher.cpp b/src/core/media_capture_devices_dispatcher.cpp
index 2293c424a..6dc45c442 100644
--- a/src/core/media_capture_devices_dispatcher.cpp
+++ b/src/core/media_capture_devices_dispatcher.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
@@ -43,33 +7,35 @@
#include "media_capture_devices_dispatcher.h"
-#include "javascript_dialog_manager_qt.h"
#include "type_conversion.h"
#include "web_contents_delegate_qt.h"
#include "web_contents_view_qt.h"
#include "web_engine_settings.h"
-#include "base/strings/utf_string_conversions.h"
+#include "base/strings/strcat.h"
#include "content/browser/web_contents/web_contents_impl.h"
+#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/desktop_media_id.h"
#include "content/public/browser/desktop_streams_registry.h"
#include "content/public/browser/media_capture_devices.h"
-#include "content/public/browser/notification_service.h"
-#include "content/public/browser/notification_source.h"
-#include "content/public/browser/notification_types.h"
#include "content/public/browser/render_process_host.h"
-#include "content/public/common/origin_util.h"
#include "media/audio/audio_device_description.h"
#include "media/audio/audio_manager_base.h"
-#include "ui/base/l10n/l10n_util.h"
+#include "services/network/public/cpp/is_potentially_trustworthy.h"
+#include "third_party/blink/public/mojom/mediastream/media_stream.mojom-shared.h"
+#include "third_party/blink/public/mojom/mediastream/media_stream.mojom.h"
#if QT_CONFIG(webengine_webrtc)
#include "third_party/webrtc/modules/desktop_capture/desktop_capture_options.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h"
#endif
-#include <QtCore/qcoreapplication.h>
+#if defined(WEBRTC_USE_X11)
+#include <dlfcn.h>
+#include <X11/extensions/Xrandr.h>
+#include <X11/Xlib.h>
+#endif
namespace QtWebEngineCore {
@@ -87,74 +53,174 @@ const blink::MediaStreamDevice *findDeviceWithId(const blink::MediaStreamDevices
return &(*iter);
}
}
- return 0;
+ return nullptr;
+}
+
+// Based on chrome/browser/media/webrtc/desktop_capture_devices_util.cc:
+media::mojom::CaptureHandlePtr CreateCaptureHandle(content::WebContents *capturer,
+ const url::Origin &capturer_origin,
+ const content::DesktopMediaID &captured_id)
+{
+ if (capturer_origin.opaque())
+ return nullptr;
+
+ content::RenderFrameHost *const captured_rfh =
+ content::RenderFrameHost::FromID(
+ captured_id.web_contents_id.render_process_id,
+ captured_id.web_contents_id.main_render_frame_id);
+ if (!captured_rfh || !captured_rfh->IsActive())
+ return nullptr;
+
+ content::WebContents *const captured = content::WebContents::FromRenderFrameHost(captured_rfh);
+ if (!captured)
+ return nullptr;
+
+ const auto &captured_config = captured->GetCaptureHandleConfig();
+ if (!captured_config.all_origins_permitted &&
+ std::none_of(captured_config.permitted_origins.begin(),
+ captured_config.permitted_origins.end(),
+ [capturer_origin](const url::Origin& permitted_origin) {
+ return capturer_origin.IsSameOriginWith(permitted_origin);
+ }))
+ {
+ return nullptr;
+ }
+
+ // Observing CaptureHandle when either the capturing or the captured party
+ // is incognito is disallowed, except for self-capture.
+ if (capturer->GetPrimaryMainFrame() != captured->GetPrimaryMainFrame()) {
+ if (capturer->GetBrowserContext()->IsOffTheRecord() ||
+ captured->GetBrowserContext()->IsOffTheRecord()) {
+ return nullptr;
+ }
+ }
+
+ if (!captured_config.expose_origin && captured_config.capture_handle.empty())
+ return nullptr;
+
+ auto result = media::mojom::CaptureHandle::New();
+ if (captured_config.expose_origin)
+ result->origin = captured->GetPrimaryMainFrame()->GetLastCommittedOrigin();
+
+ result->capture_handle = captured_config.capture_handle;
+
+ return result;
}
// Based on chrome/browser/media/webrtc/desktop_capture_devices_util.cc:
-void getDevicesForDesktopCapture(blink::MediaStreamDevices *devices,
+media::mojom::DisplayMediaInformationPtr DesktopMediaIDToDisplayMediaInformation(content::WebContents *capturer,
+ const url::Origin &capturer_origin,
+ const content::DesktopMediaID &media_id)
+{
+ media::mojom::DisplayCaptureSurfaceType display_surface = media::mojom::DisplayCaptureSurfaceType::MONITOR;
+ bool logical_surface = true;
+ media::mojom::CursorCaptureType cursor = media::mojom::CursorCaptureType::NEVER;
+#if defined(USE_AURA)
+ const bool uses_aura = (media_id.window_id != content::DesktopMediaID::kNullId ? true : false);
+#else
+ const bool uses_aura = false;
+#endif // defined(USE_AURA)
+
+ media::mojom::CaptureHandlePtr capture_handle;
+ switch (media_id.type) {
+ case content::DesktopMediaID::TYPE_SCREEN:
+ display_surface = media::mojom::DisplayCaptureSurfaceType::MONITOR;
+ cursor = uses_aura ? media::mojom::CursorCaptureType::MOTION
+ : media::mojom::CursorCaptureType::ALWAYS;
+ break;
+ case content::DesktopMediaID::TYPE_WINDOW:
+ display_surface = media::mojom::DisplayCaptureSurfaceType::WINDOW;
+ cursor = uses_aura ? media::mojom::CursorCaptureType::MOTION
+ : media::mojom::CursorCaptureType::ALWAYS;
+ break;
+ case content::DesktopMediaID::TYPE_WEB_CONTENTS:
+ display_surface = media::mojom::DisplayCaptureSurfaceType::BROWSER;
+ cursor = media::mojom::CursorCaptureType::MOTION;
+ capture_handle = CreateCaptureHandle(capturer, capturer_origin, media_id);
+ break;
+ case content::DesktopMediaID::TYPE_NONE:
+ break;
+ }
+
+ return media::mojom::DisplayMediaInformation::New(display_surface, logical_surface, cursor, std::move(capture_handle));
+}
+
+
+// Based on chrome/browser/media/webrtc/desktop_capture_devices_util.cc:
+std::string DeviceNamePrefix(content::WebContents *web_contents,
+ blink::mojom::MediaStreamType requested_stream_type,
+ const content::DesktopMediaID &media_id)
+{
+ if (!web_contents || requested_stream_type != blink::mojom::MediaStreamType::DISPLAY_VIDEO_CAPTURE_THIS_TAB) {
+ return std::string();
+ }
+
+ // Note that all of these must still be checked, as the explicit-selection
+ // dialog for DISPLAY_VIDEO_CAPTURE_THIS_TAB could still return something
+ // other than the current tab - be it a screen, window, or another tab.
+ if (media_id.type == content::DesktopMediaID::TYPE_WEB_CONTENTS &&
+ web_contents->GetPrimaryMainFrame()->GetProcess()->GetID() ==
+ media_id.web_contents_id.render_process_id &&
+ web_contents->GetPrimaryMainFrame()->GetRoutingID() ==
+ media_id.web_contents_id.main_render_frame_id) {
+ return "current-";
+ }
+
+ return std::string();
+}
+
+// Based on chrome/browser/media/webrtc/desktop_capture_devices_util.cc:
+std::string DeviceName(content::WebContents *web_contents,
+ blink::mojom::MediaStreamType requested_stream_type,
+ const content::DesktopMediaID &media_id)
+{
+ const std::string prefix =
+ DeviceNamePrefix(web_contents, requested_stream_type, media_id);
+ if (media_id.type == content::DesktopMediaID::TYPE_WEB_CONTENTS) {
+ return base::StrCat({prefix, content::kWebContentsCaptureScheme,
+ base::UnguessableToken::Create().ToString()});
+ } else {
+ // TODO(crbug.com/1252682): MediaStreamTrack.label leaks internal state for
+ // screen/window
+ return base::StrCat({prefix, media_id.ToString()});
+ }
+}
+
+// Based on chrome/browser/media/webrtc/desktop_capture_devices_util.cc:
+void getDevicesForDesktopCapture(const content::MediaStreamRequest &request,
+ content::WebContents *web_contents,
content::DesktopMediaID mediaId,
bool captureAudio,
- MediaStreamType videoType,
- MediaStreamType audioType)
+ bool disableLocalEcho,
+ blink::mojom::StreamDevices &out_devices)
{
DCHECK_CURRENTLY_ON(BrowserThread::UI);
// Add selected desktop source to the list.
- devices->push_back(blink::MediaStreamDevice(videoType, mediaId.ToString(), mediaId.ToString()));
+ blink::MediaStreamDevice device(request.video_type, mediaId.ToString(),
+ DeviceName(web_contents, request.video_type, mediaId));
+ device.display_media_info = DesktopMediaIDToDisplayMediaInformation(
+ web_contents, url::Origin::Create(request.security_origin), mediaId);
+ out_devices.video_device = device;
+
if (captureAudio) {
+ DCHECK_NE(request.audio_type, blink::mojom::MediaStreamType::NO_SERVICE);
+
if (mediaId.type == content::DesktopMediaID::TYPE_WEB_CONTENTS) {
- devices->push_back(
- blink::MediaStreamDevice(audioType, mediaId.ToString(), "Tab audio"));
+ content::WebContentsMediaCaptureId web_id = mediaId.web_contents_id;
+ web_id.disable_local_echo = disableLocalEcho;
+ out_devices.audio_device = blink::MediaStreamDevice(request.audio_type, web_id.ToString(), "Tab audio");
} else {
// Use the special loopback device ID for system audio capture.
- devices->push_back(blink::MediaStreamDevice(
- audioType,
- media::AudioDeviceDescription::kLoopbackInputDeviceId,
- "System Audio"));
+ out_devices.audio_device = blink::MediaStreamDevice(
+ request.audio_type, (disableLocalEcho
+ ? media::AudioDeviceDescription::kLoopbackWithMuteDeviceId
+ : media::AudioDeviceDescription::kLoopbackInputDeviceId),
+ "System Audio");
}
}
}
-content::DesktopMediaID getDefaultScreenId()
-{
- // While this function is executing another thread may also want to create a
- // DesktopCapturer [1]. Unfortunately, creating a DesktopCapturer is not
- // thread safe on X11 due to the use of webrtc::XErrorTrap. It's safe to
- // disable this code on X11 since we don't actually need to create a
- // DesktopCapturer to get the screen id anyway
- // (ScreenCapturerLinux::GetSourceList always returns 0 as the id).
- //
- // [1]: webrtc::InProcessVideoCaptureDeviceLauncher::DoStartDesktopCaptureOnDeviceThread
-
-#if QT_CONFIG(webengine_webrtc) && !defined(WEBRTC_USE_X11)
- // Source id patterns are different across platforms.
- // On Linux, the hardcoded value "0" is used.
- // On Windows, the screens are enumerated consecutively in increasing order from 0.
- // On macOS the source ids are randomish numbers assigned by the OS.
-
- // In order to provide a correct screen id, we query for the available screen ids, and
- // select the first one as the main display id.
- // The code is based on the file
- // src/chrome/browser/extensions/api/desktop_capture/desktop_capture_base.cc.
- webrtc::DesktopCaptureOptions options =
- webrtc::DesktopCaptureOptions::CreateDefault();
- options.set_disable_effects(false);
- std::unique_ptr<webrtc::DesktopCapturer> screen_capturer(
- webrtc::DesktopCapturer::CreateScreenCapturer(options));
-
- if (screen_capturer) {
- webrtc::DesktopCapturer::SourceList screens;
- if (screen_capturer->GetSourceList(&screens)) {
- if (screens.size() > 0) {
- return content::DesktopMediaID(content::DesktopMediaID::TYPE_SCREEN, screens[0].id);
- }
- }
- }
-#endif
-
- return content::DesktopMediaID(content::DesktopMediaID::TYPE_SCREEN, 0);
-}
-
WebContentsAdapterClient::MediaRequestFlags mediaRequestFlagsForRequest(const content::MediaStreamRequest &request)
{
if (request.audio_type == MediaStreamType::DEVICE_AUDIO_CAPTURE &&
@@ -173,8 +239,17 @@ WebContentsAdapterClient::MediaRequestFlags mediaRequestFlagsForRequest(const co
request.video_type == MediaStreamType::GUM_DESKTOP_VIDEO_CAPTURE)
return {WebContentsAdapterClient::MediaDesktopAudioCapture, WebContentsAdapterClient::MediaDesktopVideoCapture};
- if (request.video_type == MediaStreamType::GUM_DESKTOP_VIDEO_CAPTURE ||
+ if (request.audio_type == MediaStreamType::DISPLAY_AUDIO_CAPTURE &&
request.video_type == MediaStreamType::DISPLAY_VIDEO_CAPTURE)
+ return {WebContentsAdapterClient::MediaDesktopAudioCapture, WebContentsAdapterClient::MediaDesktopVideoCapture};
+
+ if (request.audio_type == MediaStreamType::DISPLAY_AUDIO_CAPTURE &&
+ request.video_type == MediaStreamType::DISPLAY_VIDEO_CAPTURE_THIS_TAB)
+ return {WebContentsAdapterClient::MediaDesktopAudioCapture, WebContentsAdapterClient::MediaDesktopVideoCapture};
+
+ if (request.video_type == MediaStreamType::GUM_DESKTOP_VIDEO_CAPTURE ||
+ request.video_type == MediaStreamType::DISPLAY_VIDEO_CAPTURE ||
+ request.video_type == MediaStreamType::DISPLAY_VIDEO_CAPTURE_THIS_TAB)
return {WebContentsAdapterClient::MediaDesktopVideoCapture};
return {};
@@ -184,42 +259,57 @@ WebContentsAdapterClient::MediaRequestFlags mediaRequestFlagsForRequest(const co
class MediaStreamUIQt : public content::MediaStreamUI
{
public:
- MediaStreamUIQt(content::WebContents *webContents, const blink::MediaStreamDevices &devices)
+ MediaStreamUIQt(content::WebContents *webContents, const blink::mojom::StreamDevices &devices)
: m_delegate(static_cast<WebContentsDelegateQt *>(webContents->GetDelegate())->AsWeakPtr())
, m_devices(devices)
{
- DCHECK(!m_devices.empty());
+ DCHECK(m_devices.audio_device.has_value() ||
+ m_devices.video_device.has_value());
}
~MediaStreamUIQt() override
{
if (m_started && m_delegate)
m_delegate->removeDevices(m_devices);
+ m_onStop.Reset();
}
private:
- gfx::NativeViewId OnStarted(base::OnceClosure, SourceCallback) override
+ gfx::NativeViewId OnStarted(base::RepeatingClosure stop, SourceCallback source,
+ const std::string& label,
+ std::vector<content::DesktopMediaID> screen_capture_ids,
+ StateChangeCallback state_change) override
{
- DCHECK(!m_started);
+ if (m_started) {
+ // Ignore possibly-compromised renderers that might call
+ // MediaStreamDispatcherHost::OnStreamStarted() more than once.
+ // See: https://crbug.com/1155426
+ return 0;
+ }
m_started = true;
+ m_onStop = std::move(stop);
if (m_delegate)
m_delegate->addDevices(m_devices);
return 0;
}
-
+ void OnDeviceStopped(const std::string &label, const content::DesktopMediaID &media_id) override
+ {
+ Q_UNUSED(label);
+ Q_UNUSED(media_id);
+ }
+ void OnDeviceStoppedForSourceChange(const std::string&, const content::DesktopMediaID&, const content::DesktopMediaID&) override
+ {}
base::WeakPtr<WebContentsDelegateQt> m_delegate;
- const blink::MediaStreamDevices m_devices;
+ const blink::mojom::StreamDevices m_devices;
bool m_started = false;
-
- DISALLOW_COPY_AND_ASSIGN(MediaStreamUIQt);
+ base::RepeatingClosure m_onStop; // currently unused
};
-
} // namespace
-MediaCaptureDevicesDispatcher::PendingAccessRequest::PendingAccessRequest(const content::MediaStreamRequest &request,
- const RepeatingMediaResponseCallback &callback)
- : request(request)
- , callback(callback)
+MediaCaptureDevicesDispatcher::PendingAccessRequest::PendingAccessRequest(
+ const content::MediaStreamRequest &request, content::MediaResponseCallback callback,
+ content::DesktopMediaID id)
+ : request(request), callback(std::move(callback)), mediaId(id)
{
}
@@ -231,13 +321,13 @@ void MediaCaptureDevicesDispatcher::handleMediaAccessPermissionResponse(content:
{
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- blink::MediaStreamDevices devices;
+ blink::mojom::StreamDevicesSet deviceSet;
auto it = m_pendingRequests.find(webContents);
if (it == m_pendingRequests.end() || it->second.empty())
return;
RequestsQueue &queue(it->second);
- content::MediaStreamRequest &request = queue.front().request;
+ content::MediaStreamRequest &request = queue.front()->request;
const QUrl requestSecurityOrigin(toQt(request.security_origin));
bool securityOriginsMatch = (requestSecurityOrigin.host() == securityOrigin.host()
@@ -255,42 +345,48 @@ void MediaCaptureDevicesDispatcher::handleMediaAccessPermissionResponse(content:
bool desktopVideoRequested = finalFlags.testFlag(WebContentsAdapterClient::MediaDesktopVideoCapture);
if (securityOriginsMatch) {
+ content::DesktopMediaID &id = queue.front()->mediaId;
+
if (microphoneRequested || webcamRequested) {
switch (request.request_type) {
case blink::MEDIA_OPEN_DEVICE_PEPPER_ONLY:
- getDefaultDevices("", "", microphoneRequested, webcamRequested, &devices);
+ getDefaultDevices("", "", microphoneRequested, webcamRequested, deviceSet);
break;
case blink::MEDIA_DEVICE_ACCESS:
case blink::MEDIA_DEVICE_UPDATE:
case blink::MEDIA_GENERATE_STREAM:
+ case blink::MEDIA_GET_OPEN_DEVICE:
getDefaultDevices(request.requested_audio_device_id, request.requested_video_device_id,
- microphoneRequested, webcamRequested, &devices);
+ microphoneRequested, webcamRequested, deviceSet);
break;
}
- } else if (desktopVideoRequested) {
- getDevicesForDesktopCapture(&devices, getDefaultScreenId(), desktopAudioRequested,
- request.video_type, request.audio_type);
+ } else if (desktopVideoRequested && !id.is_null()) {
+ deviceSet.stream_devices.emplace_back(blink::mojom::StreamDevices::New());
+ bool captureAudio = desktopAudioRequested && m_loopbackAudioSupported;
+ blink::mojom::StreamDevices &stream_devices = *deviceSet.stream_devices[0];
+ getDevicesForDesktopCapture(request, webContents, id, captureAudio,
+ request.disable_local_echo, stream_devices);
}
}
- content::MediaResponseCallback callback = std::move(queue.front().callback);
+ content::MediaResponseCallback callback = std::move(queue.front()->callback);
queue.pop_front();
if (!queue.empty()) {
// Post a task to process next queued request. It has to be done
// asynchronously to make sure that calling infobar is not destroyed until
// after this function returns.
- base::PostTask(FROM_HERE, {BrowserThread::UI},
+ content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
base::BindOnce(&MediaCaptureDevicesDispatcher::ProcessQueuedAccessRequest,
base::Unretained(this), webContents));
}
- if (devices.empty())
- std::move(callback).Run(devices, MediaStreamRequestResult::INVALID_STATE,
+ if (deviceSet.stream_devices.empty())
+ std::move(callback).Run(deviceSet, MediaStreamRequestResult::INVALID_STATE,
std::unique_ptr<content::MediaStreamUI>());
else
- std::move(callback).Run(devices, MediaStreamRequestResult::OK,
- std::make_unique<MediaStreamUIQt>(webContents, devices));
+ std::move(callback).Run(deviceSet, MediaStreamRequestResult::OK,
+ std::make_unique<MediaStreamUIQt>(webContents, *deviceSet.stream_devices[0]));
}
MediaCaptureDevicesDispatcher *MediaCaptureDevicesDispatcher::GetInstance()
@@ -299,45 +395,47 @@ MediaCaptureDevicesDispatcher *MediaCaptureDevicesDispatcher::GetInstance()
}
MediaCaptureDevicesDispatcher::MediaCaptureDevicesDispatcher()
+ : m_webContentsCollection(this)
{
- // MediaCaptureDevicesDispatcher is a singleton. It should be created on
- // UI thread. Otherwise, it will not receive
- // content::NOTIFICATION_WEB_CONTENTS_DESTROYED, and that will result in
- // possible use after free.
- DCHECK_CURRENTLY_ON(BrowserThread::UI);
- m_notificationsRegistrar.Add(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED,
- content::NotificationService::AllSources());
+#if defined(Q_OS_WIN)
+ // Currently loopback audio capture is supported only on Windows.
+ m_loopbackAudioSupported = true;
+#endif
}
MediaCaptureDevicesDispatcher::~MediaCaptureDevicesDispatcher()
{
}
-void MediaCaptureDevicesDispatcher::Observe(int type, const content::NotificationSource &source, const content::NotificationDetails &details)
+void MediaCaptureDevicesDispatcher::WebContentsDestroyed(content::WebContents *webContents)
{
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED) {
- content::WebContents *webContents = content::Source<content::WebContents>(source).ptr();
- m_pendingRequests.erase(webContents);
- }
+ m_pendingRequests.erase(webContents);
}
-void MediaCaptureDevicesDispatcher::processMediaAccessRequest(WebContentsAdapterClient *adapterClient, content::WebContents *webContents, const content::MediaStreamRequest &request, content::MediaResponseCallback callback)
+void MediaCaptureDevicesDispatcher::processMediaAccessRequest(
+ content::WebContents *webContents, const content::MediaStreamRequest &request,
+ content::MediaResponseCallback callback, content::DesktopMediaID id)
{
DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ // Ensure we are observing the deletion of |webContents|.
+ m_webContentsCollection.StartObserving(webContents);
WebContentsAdapterClient::MediaRequestFlags flags = mediaRequestFlagsForRequest(request);
if (!flags) {
- std::move(callback).Run(blink::MediaStreamDevices(), MediaStreamRequestResult::NOT_SUPPORTED, std::unique_ptr<content::MediaStreamUI>());
+ std::move(callback).Run(blink::mojom::StreamDevicesSet(), MediaStreamRequestResult::NOT_SUPPORTED, std::unique_ptr<content::MediaStreamUI>());
return;
}
+ WebContentsDelegateQt *delegate = static_cast<WebContentsDelegateQt *>(webContents->GetDelegate());
+ WebContentsAdapterClient *adapterClient = delegate->adapterClient();
+
if (flags.testFlag(WebContentsAdapterClient::MediaDesktopVideoCapture)) {
- const bool screenCaptureEnabled =
- adapterClient->webEngineSettings()->testAttribute(WebEngineSettings::ScreenCaptureEnabled);
- const bool originIsSecure = content::IsOriginSecure(request.security_origin);
- if (!screenCaptureEnabled || !originIsSecure) {
- std::move(callback).Run(blink::MediaStreamDevices(), MediaStreamRequestResult::INVALID_STATE, std::unique_ptr<content::MediaStreamUI>());
+ const bool screenCaptureEnabled = adapterClient->webEngineSettings()->testAttribute(
+ QWebEngineSettings::ScreenCaptureEnabled);
+ const bool originIsSecure = network::IsUrlPotentiallyTrustworthy(request.security_origin);
+ if (!screenCaptureEnabled || !originIsSecure || (id.is_null() && request.requested_video_device_id.empty())) {
+ std::move(callback).Run(blink::mojom::StreamDevicesSet(), MediaStreamRequestResult::INVALID_STATE, std::unique_ptr<content::MediaStreamUI>());
return;
}
@@ -348,57 +446,60 @@ void MediaCaptureDevicesDispatcher::processMediaAccessRequest(WebContentsAdapter
}
}
- enqueueMediaAccessRequest(webContents, request, std::move(callback));
+ enqueueMediaAccessRequest(webContents, request, std::move(callback), id);
// We might not require this approval for pepper requests.
adapterClient->runMediaAccessPermissionRequest(toQt(request.security_origin), flags);
}
void MediaCaptureDevicesDispatcher::processDesktopCaptureAccessRequest(content::WebContents *webContents, const content::MediaStreamRequest &request, content::MediaResponseCallback callback)
{
- blink::MediaStreamDevices devices;
+ blink::mojom::StreamDevicesSet deviceSet;
content::WebContents *const web_contents_for_stream = content::WebContents::FromRenderFrameHost(
content::RenderFrameHost::FromID(request.render_process_id, request.render_frame_id));
- content::RenderFrameHost *const main_frame = web_contents_for_stream ? web_contents_for_stream->GetMainFrame() : NULL;
+ content::RenderFrameHost *const main_frame = web_contents_for_stream ? web_contents_for_stream->GetPrimaryMainFrame() : nullptr;
content::DesktopMediaID mediaId;
if (main_frame) {
- // The extension name that the stream is registered with.
- std::string originalExtensionName;
// Resolve DesktopMediaID for the specified device id.
mediaId = content::DesktopStreamsRegistry::GetInstance()->RequestMediaForStreamId(
request.requested_video_device_id, main_frame->GetProcess()->GetID(),
main_frame->GetRoutingID(), url::Origin::Create(request.security_origin),
- &originalExtensionName, content::kRegistryStreamTypeDesktop);
+ content::kRegistryStreamTypeDesktop);
}
// Received invalid device id.
if (mediaId.type == content::DesktopMediaID::TYPE_NONE) {
- std::move(callback).Run(devices, MediaStreamRequestResult::INVALID_STATE, std::unique_ptr<content::MediaStreamUI>());
+ std::move(callback).Run(deviceSet, MediaStreamRequestResult::INVALID_STATE, std::unique_ptr<content::MediaStreamUI>());
return;
}
// Audio is only supported for screen capture streams.
- bool capture_audio = (mediaId.type == content::DesktopMediaID::TYPE_SCREEN && request.audio_type == MediaStreamType::GUM_DESKTOP_AUDIO_CAPTURE);
+ bool audioRequested = (request.audio_type == MediaStreamType::GUM_DESKTOP_AUDIO_CAPTURE ||
+ request.audio_type == MediaStreamType::DISPLAY_AUDIO_CAPTURE);
+ bool audioSupported = (mediaId.type == content::DesktopMediaID::TYPE_SCREEN && m_loopbackAudioSupported);
+ bool captureAudio = (audioRequested && audioSupported);
- getDevicesForDesktopCapture(&devices, mediaId, capture_audio, request.video_type, request.audio_type);
+ deviceSet.stream_devices.emplace_back(blink::mojom::StreamDevices::New());
+ blink::mojom::StreamDevices &stream_devices = *deviceSet.stream_devices[0];
+ getDevicesForDesktopCapture(request, webContents, mediaId, captureAudio, request.disable_local_echo, stream_devices);
- if (devices.empty())
- std::move(callback).Run(devices, MediaStreamRequestResult::INVALID_STATE,
+ if (deviceSet.stream_devices.empty())
+ std::move(callback).Run(deviceSet, MediaStreamRequestResult::INVALID_STATE,
std::unique_ptr<content::MediaStreamUI>());
else
- std::move(callback).Run(devices, MediaStreamRequestResult::OK,
- std::make_unique<MediaStreamUIQt>(webContents, devices));
+ std::move(callback).Run(deviceSet, MediaStreamRequestResult::OK,
+ std::make_unique<MediaStreamUIQt>(webContents, *deviceSet.stream_devices[0]));
}
-void MediaCaptureDevicesDispatcher::enqueueMediaAccessRequest(content::WebContents *webContents,
- const content::MediaStreamRequest &request,
- content::MediaResponseCallback callback)
+void MediaCaptureDevicesDispatcher::enqueueMediaAccessRequest(
+ content::WebContents *webContents, const content::MediaStreamRequest &request,
+ content::MediaResponseCallback callback, content::DesktopMediaID id)
{
DCHECK_CURRENTLY_ON(BrowserThread::UI);
RequestsQueue &queue = m_pendingRequests[webContents];
- queue.push_back(PendingAccessRequest(request, base::AdaptCallbackForRepeating(std::move(callback))));
+ queue.push_back(std::make_unique<PendingAccessRequest>(request, std::move(callback), id));
}
void MediaCaptureDevicesDispatcher::ProcessQueuedAccessRequest(content::WebContents *webContents)
@@ -410,25 +511,27 @@ void MediaCaptureDevicesDispatcher::ProcessQueuedAccessRequest(content::WebConte
return;
RequestsQueue &queue(it->second);
- content::MediaStreamRequest &request = queue.front().request;
+ content::MediaStreamRequest &request = queue.front()->request;
WebContentsAdapterClient *adapterClient = WebContentsViewQt::from(static_cast<content::WebContentsImpl *>(webContents)->GetView())->client();
adapterClient->runMediaAccessPermissionRequest(toQt(request.security_origin), mediaRequestFlagsForRequest(request));
}
void MediaCaptureDevicesDispatcher::getDefaultDevices(const std::string &audioDeviceId, const std::string &videoDeviceId,
- bool audio, bool video, blink::MediaStreamDevices *devices)
+ bool audio, bool video, blink::mojom::StreamDevicesSet &devicesSet)
{
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(audio || video);
+ devicesSet.stream_devices.emplace_back(blink::mojom::StreamDevices::New());
+ blink::mojom::StreamDevices& devices = *devicesSet.stream_devices[0];
if (audio) {
const blink::MediaStreamDevices &audioDevices = content::MediaCaptureDevices::GetInstance()->GetAudioCaptureDevices();
const blink::MediaStreamDevice *device = findDeviceWithId(audioDevices, audioDeviceId);
if (!device && !audioDevices.empty())
device = &audioDevices.front();
if (device)
- devices->push_back(*device);
+ devices.audio_device = *device;
}
if (video) {
@@ -437,14 +540,14 @@ void MediaCaptureDevicesDispatcher::getDefaultDevices(const std::string &audioDe
if (!device && !videoDevices.empty())
device = &videoDevices.front();
if (device)
- devices->push_back(*device);
+ devices.video_device = *device;
}
}
void MediaCaptureDevicesDispatcher::OnMediaRequestStateChanged(int render_process_id, int render_frame_id, int page_request_id, const GURL &security_origin, blink::mojom::MediaStreamType stream_type, content::MediaRequestState state)
{
DCHECK_CURRENTLY_ON(BrowserThread::IO);
- base::PostTask(FROM_HERE, {BrowserThread::UI},
+ content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
base::BindOnce(&MediaCaptureDevicesDispatcher::updateMediaRequestStateOnUIThread,
base::Unretained(this), render_process_id, render_frame_id,
page_request_id, security_origin, stream_type, state));
@@ -464,9 +567,9 @@ void MediaCaptureDevicesDispatcher::updateMediaRequestStateOnUIThread(int render
for (auto &pair : m_pendingRequests) {
RequestsQueue &queue = pair.second;
for (auto it = queue.begin(); it != queue.end(); ++it) {
- if (it->request.render_process_id == render_process_id
- && it->request.render_frame_id == render_frame_id
- && it->request.page_request_id == page_request_id) {
+ if ((*it)->request.render_process_id == render_process_id
+ && (*it)->request.render_frame_id == render_frame_id
+ && (*it)->request.page_request_id == page_request_id) {
queue.erase(it);
return;
}
diff --git a/src/core/media_capture_devices_dispatcher.h b/src/core/media_capture_devices_dispatcher.h
index 6a67a53e9..2b6bb98d8 100644
--- a/src/core/media_capture_devices_dispatcher.h
+++ b/src/core/media_capture_devices_dispatcher.h
@@ -1,78 +1,37 @@
-/****************************************************************************
-**
-** Copyright (c) 2012 The Chromium Authors. All rights reserved.
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef MEDIA_CAPTURE_DEVICES_DISPATCHER_H
#define MEDIA_CAPTURE_DEVICES_DISPATCHER_H
-#include <deque>
-#include <list>
-#include <map>
-
#include "web_contents_adapter_client.h"
-#include "base/callback.h"
#include "base/containers/circular_deque.h"
+#include "base/containers/flat_map.h"
#include "base/memory/singleton.h"
-#include "base/observer_list.h"
+#include "chrome/browser/tab_contents/web_contents_collection.h"
#include "content/public/browser/media_observer.h"
-#include "content/public/browser/notification_observer.h"
-#include "content/public/browser/notification_registrar.h"
-#include "content/public/browser/web_contents_delegate.h"
+#include "content/public/browser/media_stream_request.h"
namespace QtWebEngineCore {
// This singleton is used to receive updates about media events from the content
// layer. Based on Chrome's implementation.
class MediaCaptureDevicesDispatcher : public content::MediaObserver,
- public content::NotificationObserver
+ public WebContentsCollection::Observer
{
public:
static MediaCaptureDevicesDispatcher *GetInstance();
- void processMediaAccessRequest(WebContentsAdapterClient *, content::WebContents *, const content::MediaStreamRequest &, content::MediaResponseCallback);
+ void processMediaAccessRequest(content::WebContents *, const content::MediaStreamRequest &,
+ content::MediaResponseCallback, content::DesktopMediaID);
// Called back from our WebContentsAdapter to grant the requested permission.
void handleMediaAccessPermissionResponse(content::WebContents *, const QUrl &securityOrigin, WebContentsAdapterClient::MediaRequestFlags);
private:
- void getDefaultDevices(const std::string &audioDeviceId, const std::string &videoDeviceId, bool audio, bool video, blink::MediaStreamDevices *);
+ void getDefaultDevices(const std::string &audioDeviceId, const std::string &videoDeviceId, bool audio, bool video, blink::mojom::StreamDevicesSet &devices);
// Overridden from content::MediaObserver:
void OnAudioCaptureDevicesChanged() override {}
@@ -93,30 +52,29 @@ private:
friend struct base::DefaultSingletonTraits<MediaCaptureDevicesDispatcher>;
- typedef base::RepeatingCallback<void(const blink::MediaStreamDevices &devices,
- blink::mojom::MediaStreamRequestResult result,
- std::unique_ptr<content::MediaStreamUI> ui)>
- RepeatingMediaResponseCallback;
-
struct PendingAccessRequest {
- PendingAccessRequest(const content::MediaStreamRequest &request, const RepeatingMediaResponseCallback &callback);
+ PendingAccessRequest(const content::MediaStreamRequest &request,
+ content::MediaResponseCallback callback, content::DesktopMediaID id);
~PendingAccessRequest();
content::MediaStreamRequest request;
- RepeatingMediaResponseCallback callback;
+ content::MediaResponseCallback callback;
+ content::DesktopMediaID mediaId;
};
- typedef base::circular_deque<PendingAccessRequest> RequestsQueue;
- typedef std::map<content::WebContents *, RequestsQueue> RequestsQueues;
+ typedef base::circular_deque<std::unique_ptr<PendingAccessRequest>> RequestsQueue;
+ typedef base::flat_map<content::WebContents *, RequestsQueue> RequestsQueues;
MediaCaptureDevicesDispatcher();
virtual ~MediaCaptureDevicesDispatcher();
- // content::NotificationObserver implementation.
- void Observe(int type, const content::NotificationSource &source, const content::NotificationDetails &details) override;
+ // WebContentsCollection::Observer:
+ void WebContentsDestroyed(content::WebContents *webContents) override;
// Helpers for ProcessMediaAccessRequest().
+ void handleRequest(content::WebContents *, const content::MediaStreamRequest &, content::MediaResponseCallback);
void processDesktopCaptureAccessRequest(content::WebContents *, const content::MediaStreamRequest &, content::MediaResponseCallback);
- void enqueueMediaAccessRequest(content::WebContents *, const content::MediaStreamRequest &, content::MediaResponseCallback);
+ void enqueueMediaAccessRequest(content::WebContents *, const content::MediaStreamRequest &,
+ content::MediaResponseCallback, content::DesktopMediaID);
void ProcessQueuedAccessRequest(content::WebContents *);
// Called by the MediaObserver() functions, executed on UI thread.
@@ -125,9 +83,9 @@ private:
RequestsQueues m_pendingRequests;
- content::NotificationRegistrar m_notificationsRegistrar;
+ WebContentsCollection m_webContentsCollection;
- DISALLOW_COPY_AND_ASSIGN(MediaCaptureDevicesDispatcher);
+ bool m_loopbackAudioSupported = false;
};
} // namespace QtWebEngineCore
diff --git a/src/core/native_web_keyboard_event_qt.cpp b/src/core/native_web_keyboard_event_qt.cpp
index b2e857aaf..9a5576fbb 100644
--- a/src/core/native_web_keyboard_event_qt.cpp
+++ b/src/core/native_web_keyboard_event_qt.cpp
@@ -1,101 +1,88 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE.Chromium file.
-#include "content/public/browser/native_web_keyboard_event.h"
-#include <QKeyEvent>
+#include <QtCore/qglobal.h>
-namespace {
+#if !defined(Q_OS_MACOS)
+#include "native_web_keyboard_event_qt.h"
+
+#include <QtGui/QKeyEvent>
+
+namespace QtWebEngineCore {
+gfx::NativeEvent ToNativeEvent(QKeyEvent *keyEvent)
+{
+ return reinterpret_cast<gfx::NativeEvent>(keyEvent);
+}
+
+QKeyEvent *ToKeyEvent(gfx::NativeEvent nativeEvent)
+{
+ return reinterpret_cast<QKeyEvent *>(nativeEvent);
+}
+} // namespace QtWebEngineCore
+namespace {
// We need to copy |os_event| in NativeWebKeyboardEvent because it is
// queued in RenderWidgetHost and may be passed and used
// RenderViewHostDelegate::HandledKeybardEvent after the original aura
// event is destroyed.
-gfx::NativeEvent CopyEvent(gfx::NativeEvent event)
+gfx::NativeEvent CopyEvent(gfx::NativeEvent nativeEvent)
{
- return event ? reinterpret_cast<gfx::NativeEvent>(new QKeyEvent(*reinterpret_cast<QKeyEvent*>(event))) : 0;
+ if (!nativeEvent)
+ return nullptr;
+
+ QKeyEvent *keyEvent = QtWebEngineCore::ToKeyEvent(nativeEvent);
+ return QtWebEngineCore::ToNativeEvent(keyEvent->clone());
}
-void DestroyEvent(gfx::NativeEvent event)
+void DestroyEvent(gfx::NativeEvent nativeEvent)
{
- delete reinterpret_cast<QKeyEvent*>(event);
+ delete QtWebEngineCore::ToKeyEvent(nativeEvent);
}
+} // namespace
-} // namespace
-
-using blink::WebKeyboardEvent;
namespace content {
-NativeWebKeyboardEvent::NativeWebKeyboardEvent(blink::WebKeyboardEvent const&, gfx::NativeView)
- : os_event(0)
- , skip_in_browser(false)
+NativeWebKeyboardEvent::NativeWebKeyboardEvent(const blink::WebKeyboardEvent &web_event, gfx::NativeView)
+ : blink::WebKeyboardEvent(web_event)
+ , os_event(nullptr)
+ , skip_if_unhandled(false)
{
}
-NativeWebKeyboardEvent::NativeWebKeyboardEvent(blink::WebInputEvent::Type, int, base::TimeTicks)
- : os_event(0)
- , skip_in_browser(false)
+NativeWebKeyboardEvent::NativeWebKeyboardEvent(blink::WebInputEvent::Type type, int modifiers,
+ base::TimeTicks timestamp)
+ : blink::WebKeyboardEvent(type, modifiers, timestamp)
+ , os_event(nullptr)
+ , skip_if_unhandled(false)
{
}
NativeWebKeyboardEvent::NativeWebKeyboardEvent(gfx::NativeEvent native_event)
- : os_event(CopyEvent(native_event)),
- skip_in_browser(false)
+ : os_event(CopyEvent(native_event))
+ , skip_if_unhandled(false)
{
}
NativeWebKeyboardEvent::NativeWebKeyboardEvent(const NativeWebKeyboardEvent& other)
- : WebKeyboardEvent(other),
- os_event(CopyEvent(other.os_event)),
- skip_in_browser(other.skip_in_browser)
+ : blink::WebKeyboardEvent(other)
+ , os_event(CopyEvent(other.os_event))
+ , skip_if_unhandled(other.skip_if_unhandled)
{
}
-NativeWebKeyboardEvent& NativeWebKeyboardEvent::operator=(const NativeWebKeyboardEvent& other) {
- WebKeyboardEvent::operator=(other);
+NativeWebKeyboardEvent &NativeWebKeyboardEvent::operator=(const NativeWebKeyboardEvent &other)
+{
+ if (this == &other)
+ return *this;
+ blink::WebKeyboardEvent::operator=(other);
DestroyEvent(os_event);
os_event = CopyEvent(other.os_event);
- skip_in_browser = other.skip_in_browser;
+ skip_if_unhandled = other.skip_if_unhandled;
return *this;
}
@@ -104,3 +91,4 @@ NativeWebKeyboardEvent::~NativeWebKeyboardEvent() {
}
} // namespace content
+#endif // !defined(Q_OS_MACOS)
diff --git a/src/core/native_web_keyboard_event_qt.h b/src/core/native_web_keyboard_event_qt.h
new file mode 100644
index 000000000..13179d07a
--- /dev/null
+++ b/src/core/native_web_keyboard_event_qt.h
@@ -0,0 +1,20 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef NATIVE_WEB_KEYBOARD_EVENT_QT_H
+#define NATIVE_WEB_KEYBOARD_EVENT_QT_H
+
+#include <QtCore/qglobal.h>
+
+#include "content/public/common/input/native_web_keyboard_event.h"
+
+QT_FORWARD_DECLARE_CLASS(QKeyEvent)
+
+namespace QtWebEngineCore {
+
+gfx::NativeEvent ToNativeEvent(QKeyEvent *keyEvent);
+QKeyEvent *ToKeyEvent(gfx::NativeEvent event);
+
+} // namespace QtWebEngineCore
+
+#endif // NATIVE_WEB_KEYBOARD_EVENT_QT_H
diff --git a/src/core/native_web_keyboard_event_qt_mac.mm b/src/core/native_web_keyboard_event_qt_mac.mm
new file mode 100644
index 000000000..0f5b12db4
--- /dev/null
+++ b/src/core/native_web_keyboard_event_qt_mac.mm
@@ -0,0 +1,155 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+// Copyright 2011 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE.Chromium file.
+
+// This is a workaround to be able to include Qt headers without
+// "redefinition of 'NSString' as different kind of symbol" errors.
+// TODO: Remove this when namespace ambiguity issues are fixed properly,
+// see get_forward_declaration_macro() in cmake/Functions.cmake
+#undef Q_FORWARD_DECLARE_OBJC_CLASS
+
+#include "native_web_keyboard_event_qt.h"
+
+#include <AppKit/AppKit.h>
+
+#include "base/apple/owned_objc.h"
+
+#include <QtGui/QKeyEvent>
+#include <QtGui/private/qapplekeymapper_p.h>
+
+namespace QtWebEngineCore {
+
+base::apple::OwnedNSEvent ToNativeEvent(QKeyEvent *keyEvent)
+{
+ NSEventType type;
+ switch (keyEvent->type()) {
+ case QEvent::KeyPress:
+ type = NSEventTypeKeyDown;
+ break;
+ case QEvent::KeyRelease:
+ type = NSEventTypeKeyUp;
+ break;
+ default:
+ Q_UNREACHABLE();
+ return base::apple::OwnedNSEvent();
+ }
+
+ NSString *text = keyEvent->text().toNSString();
+ if (text.length == 0) {
+ Qt::Key key = static_cast<Qt::Key>(keyEvent->key());
+ QChar cocoaKey = QAppleKeyMapper::toCocoaKey(key);
+ text = QStringView(&cocoaKey, 1).toNSString();
+ }
+
+ return base::apple::OwnedNSEvent([NSEvent
+ keyEventWithType:type
+ location:NSZeroPoint
+ modifierFlags:QAppleKeyMapper::toCocoaModifiers(keyEvent->modifiers())
+ timestamp:keyEvent->timestamp() / 1000
+ windowNumber:0
+ context:nil
+ characters:text
+ charactersIgnoringModifiers:text
+ isARepeat:keyEvent->isAutoRepeat()
+ keyCode:keyEvent->nativeVirtualKey()
+ ]);
+}
+
+// Based on qtbase/src/plugins/platforms/cocoa/qnsview_keys.mm (KeyEvent::KeyEvent())
+QKeyEvent *ToKeyEvent(base::apple::OwnedNSEvent event)
+{
+ NSEvent *nsevent = event.Get();
+
+ QEvent::Type type = QEvent::None;
+ switch (nsevent.type) {
+ case NSEventTypeKeyDown:
+ type = QEvent::KeyPress;
+ break;
+ case NSEventTypeKeyUp:
+ type = QEvent::KeyRelease;
+ break;
+ default:
+ Q_UNREACHABLE();
+ return nullptr;
+ }
+
+ // Scan codes are hardware dependent codes for each key. There is no way to get these
+ // from Carbon or Cocoa, so leave it 0, as documented in QKeyEvent::nativeScanCode().
+ quint32 nativeScanCode = 0;
+ quint32 nativeVirtualKey = nsevent.keyCode;
+
+ NSEventModifierFlags nativeModifiers = nsevent.modifierFlags;
+ Qt::KeyboardModifiers modifiers = QAppleKeyMapper::fromCocoaModifiers(nativeModifiers);
+
+ NSString *charactersIgnoringModifiers = nsevent.charactersIgnoringModifiers;
+ NSString *characters = nsevent.characters;
+
+ // If a dead key occurs as a result of pressing a key combination then
+ // characters will have 0 length, but charactersIgnoringModifiers will
+ // have a valid character in it. This enables key combinations such as
+ // ALT+E to be used as a shortcut with an English keyboard even though
+ // pressing ALT+E will give a dead key while doing normal text input.
+ Qt::Key key = Qt::Key_unknown;
+ if (characters.length || charactersIgnoringModifiers.length) {
+ QChar character = QChar::ReplacementCharacter;
+ if (nativeModifiers & (NSEventModifierFlagControl | NSEventModifierFlagOption)
+ && charactersIgnoringModifiers.length)
+ character = QChar([charactersIgnoringModifiers characterAtIndex:0]);
+ else if (characters.length)
+ character = QChar([characters characterAtIndex:0]);
+ key = QAppleKeyMapper::fromCocoaKey(character);
+ }
+
+ QString text = QString::fromNSString(characters);
+ bool autorep = nsevent.ARepeat;
+
+ return new QKeyEvent(type, key, modifiers, nativeScanCode, nativeVirtualKey, nativeModifiers,
+ text, autorep);
+}
+
+} // namespace QtWebEngineCore
+
+namespace content {
+
+NativeWebKeyboardEvent::NativeWebKeyboardEvent(const blink::WebKeyboardEvent &web_event, gfx::NativeView)
+ : blink::WebKeyboardEvent(web_event)
+ , skip_if_unhandled(false)
+{
+}
+
+NativeWebKeyboardEvent::NativeWebKeyboardEvent(blink::WebInputEvent::Type type, int modifiers,
+ base::TimeTicks timestamp)
+ : blink::WebKeyboardEvent(type, modifiers, timestamp)
+ , skip_if_unhandled(false)
+{
+}
+
+NativeWebKeyboardEvent::NativeWebKeyboardEvent(gfx::NativeEvent native_event)
+ : os_event(native_event) // FIXME: Copy?
+ , skip_if_unhandled(false)
+{
+}
+
+NativeWebKeyboardEvent::NativeWebKeyboardEvent(const NativeWebKeyboardEvent& other)
+ : blink::WebKeyboardEvent(other)
+ , os_event(other.os_event) // FIXME: Copy?
+ , skip_if_unhandled(other.skip_if_unhandled)
+{
+}
+
+NativeWebKeyboardEvent &NativeWebKeyboardEvent::operator=(const NativeWebKeyboardEvent &other)
+{
+ blink::WebKeyboardEvent::operator=(other);
+
+ os_event = other.os_event; // FIXME: Copy?
+ skip_if_unhandled = other.skip_if_unhandled;
+
+ return *this;
+}
+
+NativeWebKeyboardEvent::~NativeWebKeyboardEvent() = default;
+
+} // namespace content
diff --git a/src/core/net/client_cert_override.cpp b/src/core/net/client_cert_override.cpp
deleted file mode 100644
index f33515f63..000000000
--- a/src/core/net/client_cert_override.cpp
+++ /dev/null
@@ -1,176 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "client_cert_override.h"
-
-#include "base/bind.h"
-#include "base/bind_helpers.h"
-#include "base/task/post_task.h"
-#include "base/callback_forward.h"
-#include "content/public/browser/browser_task_traits.h"
-#include "net/ssl/client_cert_store.h"
-#include "net/ssl/ssl_cert_request_info.h"
-#include "net/ssl/ssl_private_key.h"
-#include "net/cert/x509_certificate.h"
-#include "third_party/boringssl/src/include/openssl/pem.h"
-#include "third_party/boringssl/src/include/openssl/err.h"
-#include "third_party/boringssl/src/include/openssl/evp.h"
-
-#include "client_cert_store_data.h"
-#include "profile_io_data_qt.h"
-
-#include <QtNetwork/qtnetworkglobal.h>
-
-#if defined(USE_NSS_CERTS)
-#include "net/ssl/client_cert_store_nss.h"
-#endif
-
-#if defined(OS_WIN)
-#include "net/ssl/client_cert_store_win.h"
-#endif
-
-#if defined(OS_MACOSX)
-#include "net/ssl/client_cert_store_mac.h"
-#endif
-
-namespace {
-
-class ClientCertIdentityOverride : public net::ClientCertIdentity
-{
-public:
- ClientCertIdentityOverride(scoped_refptr<net::X509Certificate> cert, scoped_refptr<net::SSLPrivateKey> key)
- : net::ClientCertIdentity(std::move(cert)), m_key(std::move(key)) {}
- ~ClientCertIdentityOverride() override = default;
-
- void AcquirePrivateKey(base::OnceCallback<void(scoped_refptr<net::SSLPrivateKey>)> private_key_callback) override
- {
- std::move(private_key_callback).Run(m_key);
- }
-
-#if defined(OS_MACOSX)
- SecIdentityRef sec_identity_ref() const override
- {
- return nullptr;
- }
-#endif
-
-private:
- scoped_refptr<net::SSLPrivateKey> m_key;
-};
-
-} // namespace
-
-namespace QtWebEngineCore {
-
-ClientCertOverrideStore::ClientCertOverrideStore(ClientCertificateStoreData *storeData)
- : ClientCertStore()
- , m_storeData(storeData)
- , m_nativeStore(createNativeStore())
-{
-}
-
-ClientCertOverrideStore::~ClientCertOverrideStore() = default;
-
-#if QT_CONFIG(ssl)
-net::ClientCertIdentityList ClientCertOverrideStore::GetClientCertsOnUIThread(const net::SSLCertRequestInfo &cert_request_info)
-{
- DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- const auto &clientCertOverrideData = m_storeData->extraCerts;
- // Look for certificates in memory store
- for (int i = 0; i < clientCertOverrideData.length(); i++) {
- scoped_refptr<net::X509Certificate> cert = clientCertOverrideData[i]->certPtr;
- if (cert != NULL && cert->IsIssuedByEncoded(cert_request_info.cert_authorities)) {
- net::ClientCertIdentityList selected_identities;
- selected_identities.push_back(std::make_unique<ClientCertIdentityOverride>(cert, clientCertOverrideData[i]->keyPtr));
- return selected_identities;
- }
- }
- return net::ClientCertIdentityList();
-}
-
-void ClientCertOverrideStore::GetClientCertsReturn(const net::SSLCertRequestInfo &cert_request_info,
- ClientCertListCallback callback,
- net::ClientCertIdentityList &&result)
-{
- // Continue with native cert store if matching certificatse were not found in memory
- if (result.empty() && m_nativeStore)
- m_nativeStore->GetClientCerts(cert_request_info, std::move(callback));
- else
- std::move(callback).Run(std::move(result));
-}
-
-#endif // QT_CONFIG(ssl)
-
-void ClientCertOverrideStore::GetClientCerts(const net::SSLCertRequestInfo &cert_request_info,
- ClientCertListCallback callback)
-{
-#if QT_CONFIG(ssl)
- // Access the user-provided data from the UI thread, but return on whatever thread this is.
- if (base::PostTaskAndReplyWithResult(
- FROM_HERE, { content::BrowserThread::UI },
- base::BindOnce(&ClientCertOverrideStore::GetClientCertsOnUIThread,
- base::Unretained(this), std::cref(cert_request_info)),
- base::BindOnce(&ClientCertOverrideStore::GetClientCertsReturn,
- base::Unretained(this), std::cref(cert_request_info), std::move(callback)))
- ) {
- return;
- }
-#endif // QT_CONFIG(ssl)
-
- // Continue with native cert store if we failed to post task
- if (m_nativeStore)
- m_nativeStore->GetClientCerts(cert_request_info, std::move(callback));
- else
- std::move(callback).Run(net::ClientCertIdentityList());
-}
-
-// static
-std::unique_ptr<net::ClientCertStore> ClientCertOverrideStore::createNativeStore()
-{
-#if defined(USE_NSS_CERTS)
- return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreNSS(net::ClientCertStoreNSS::PasswordDelegateFactory()));
-#elif defined(OS_WIN)
- return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreWin());
-#elif defined(OS_MACOSX)
- return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreMac());
-#else
- return nullptr;
-#endif
-}
-} // namespace QtWebEngineCore
diff --git a/src/core/net/client_cert_override.h b/src/core/net/client_cert_override.h
deleted file mode 100644
index 7fd28eaeb..000000000
--- a/src/core/net/client_cert_override.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef CLIENT_CERT_OVERRIDE_P_H
-#define CLIENT_CERT_OVERRIDE_P_H
-
-#include "net/ssl/client_cert_store.h"
-#include "base/callback_forward.h"
-#include "net/cert/x509_certificate.h"
-
-namespace net {
-class SSLCertRequestInfo;
-} // namespace net
-
-namespace QtWebEngineCore {
-struct ClientCertificateStoreData;
-
-class ClientCertOverrideStore : public net::ClientCertStore
-{
-public:
- ClientCertOverrideStore(ClientCertificateStoreData *storeData);
- virtual ~ClientCertOverrideStore() override;
- void GetClientCerts(const net::SSLCertRequestInfo &cert_request_info,
- ClientCertListCallback callback) override;
-private:
- static std::unique_ptr<net::ClientCertStore> createNativeStore();
- net::ClientCertIdentityList GetClientCertsOnUIThread(const net::SSLCertRequestInfo &request);
- void GetClientCertsReturn(const net::SSLCertRequestInfo &cert_request_info,
- ClientCertListCallback callback,
- net::ClientCertIdentityList &&result);
- ClientCertificateStoreData *m_storeData;
- std::unique_ptr<net::ClientCertStore> m_nativeStore;
-};
-
-} // QtWebEngineCore
-
-#endif
diff --git a/src/core/net/client_cert_qt.cpp b/src/core/net/client_cert_qt.cpp
new file mode 100644
index 000000000..044e5618e
--- /dev/null
+++ b/src/core/net/client_cert_qt.cpp
@@ -0,0 +1,148 @@
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "client_cert_qt.h"
+
+#include "base/functional/bind.h"
+#include "base/functional/callback_forward.h"
+#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/browser_task_traits.h"
+#include "crypto/crypto_buildflags.h"
+#include "net/ssl/client_cert_store.h"
+#include "net/ssl/ssl_cert_request_info.h"
+#include "net/ssl/ssl_private_key.h"
+#include "net/cert/x509_certificate.h"
+#include "third_party/boringssl/src/include/openssl/pem.h"
+#include "third_party/boringssl/src/include/openssl/err.h"
+#include "third_party/boringssl/src/include/openssl/evp.h"
+
+#include "client_cert_store_data.h"
+
+#include <QtNetwork/qtnetworkglobal.h>
+
+#if BUILDFLAG(USE_NSS_CERTS)
+#include "net/ssl/client_cert_store_nss.h"
+#endif
+
+#if defined(Q_OS_WIN)
+#include "net/ssl/client_cert_store_win.h"
+#endif
+
+#if BUILDFLAG(IS_MAC)
+#include "net/ssl/client_cert_store_mac.h"
+#endif
+
+namespace {
+
+class ClientCertIdentityQt : public net::ClientCertIdentity
+{
+public:
+ ClientCertIdentityQt(scoped_refptr<net::X509Certificate> cert, scoped_refptr<net::SSLPrivateKey> key)
+ : net::ClientCertIdentity(std::move(cert)), m_key(std::move(key)) {}
+ ~ClientCertIdentityQt() override = default;
+
+ void AcquirePrivateKey(base::OnceCallback<void(scoped_refptr<net::SSLPrivateKey>)> private_key_callback) override
+ {
+ std::move(private_key_callback).Run(m_key);
+ }
+
+private:
+ scoped_refptr<net::SSLPrivateKey> m_key;
+};
+
+} // namespace
+
+namespace QtWebEngineCore {
+
+ClientCertStoreQt::ClientCertStoreQt(ClientCertificateStoreData *storeData)
+ : ClientCertStore()
+ , m_storeData(storeData)
+ , m_nativeStore(createNativeStore())
+{
+}
+
+ClientCertStoreQt::~ClientCertStoreQt() = default;
+
+#if QT_CONFIG(ssl)
+net::ClientCertIdentityList ClientCertStoreQt::GetClientCertsOnUIThread(const net::SSLCertRequestInfo &cert_request_info)
+{
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ const auto &clientCertOverrideData = m_storeData->extraCerts;
+
+ // Look for certificates in memory store
+ net::ClientCertIdentityList selected_identities;
+ for (int i = 0; i < clientCertOverrideData.length(); i++) {
+ scoped_refptr<net::X509Certificate> cert = clientCertOverrideData[i]->certPtr;
+ if (cert) {
+ if (cert->HasExpired()) {
+ qWarning() << "Expired certificate" << clientCertOverrideData[i];
+ continue;
+ }
+ if (cert_request_info.cert_authorities.empty()
+ || cert->IsIssuedByEncoded(cert_request_info.cert_authorities)) {
+ selected_identities.push_back(std::make_unique<ClientCertIdentityQt>(
+ cert, clientCertOverrideData[i]->keyPtr));
+ }
+ }
+ }
+ return selected_identities;
+}
+
+void ClientCertStoreQt::GetClientCertsReturn(const net::SSLCertRequestInfo &cert_request_info,
+ ClientCertListCallback callback,
+ net::ClientCertIdentityList &&result)
+{
+ // Continue with native cert store and append them after memory certificates
+ if (m_nativeStore) {
+ ClientCertListCallback callback2 = base::BindOnce(
+ [](ClientCertStoreQt::ClientCertListCallback callback,
+ net::ClientCertIdentityList result1, net::ClientCertIdentityList result2) {
+ while (!result2.empty()) {
+ result1.push_back(std::move(result2.back()));
+ result2.pop_back();
+ }
+ std::move(callback).Run(std::move(result1));
+ },
+ std::move(callback), std::move(result));
+ m_nativeStore->GetClientCerts(cert_request_info, std::move(callback2));
+ } else {
+ std::move(callback).Run(std::move(result));
+ }
+}
+
+#endif // QT_CONFIG(ssl)
+
+void ClientCertStoreQt::GetClientCerts(const net::SSLCertRequestInfo &cert_request_info,
+ ClientCertListCallback callback)
+{
+#if QT_CONFIG(ssl)
+ // Access the user-provided data from the UI thread, but return on whatever thread this is.
+ bool ok = content::GetUIThreadTaskRunner({})->PostTaskAndReplyWithResult(
+ FROM_HERE,
+ base::BindOnce(&ClientCertStoreQt::GetClientCertsOnUIThread,
+ base::Unretained(this), std::cref(cert_request_info)),
+ base::BindOnce(&ClientCertStoreQt::GetClientCertsReturn,
+ base::Unretained(this), std::cref(cert_request_info), std::move(callback)));
+ DCHECK(ok); // callback is already moved and we can't really recover here.
+#else
+ if (m_nativeStore)
+ m_nativeStore->GetClientCerts(cert_request_info, std::move(callback));
+ else
+ std::move(callback).Run(net::ClientCertIdentityList());
+#endif // QT_CONFIG(ssl)
+}
+
+// static
+std::unique_ptr<net::ClientCertStore> ClientCertStoreQt::createNativeStore()
+{
+#if BUILDFLAG(USE_NSS_CERTS)
+ return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreNSS(net::ClientCertStoreNSS::PasswordDelegateFactory()));
+#elif defined(Q_OS_WIN)
+ return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreWin());
+#elif BUILDFLAG(IS_MAC)
+ return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreMac());
+#else
+ return nullptr;
+#endif
+}
+} // namespace QtWebEngineCore
diff --git a/src/core/net/client_cert_qt.h b/src/core/net/client_cert_qt.h
new file mode 100644
index 000000000..96579fae6
--- /dev/null
+++ b/src/core/net/client_cert_qt.h
@@ -0,0 +1,37 @@
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef CLIENT_CERT_QT_P_H
+#define CLIENT_CERT_QT_P_H
+
+#include "base/functional/callback_forward.h"
+#include "net/cert/x509_certificate.h"
+#include "net/ssl/client_cert_store.h"
+
+namespace net {
+class SSLCertRequestInfo;
+} // namespace net
+
+namespace QtWebEngineCore {
+struct ClientCertificateStoreData;
+
+class ClientCertStoreQt : public net::ClientCertStore
+{
+public:
+ ClientCertStoreQt(ClientCertificateStoreData *storeData);
+ virtual ~ClientCertStoreQt() override;
+ void GetClientCerts(const net::SSLCertRequestInfo &cert_request_info,
+ ClientCertListCallback callback) override;
+private:
+ static std::unique_ptr<net::ClientCertStore> createNativeStore();
+ net::ClientCertIdentityList GetClientCertsOnUIThread(const net::SSLCertRequestInfo &request);
+ void GetClientCertsReturn(const net::SSLCertRequestInfo &cert_request_info,
+ ClientCertListCallback callback,
+ net::ClientCertIdentityList &&result);
+ ClientCertificateStoreData *m_storeData;
+ std::unique_ptr<net::ClientCertStore> m_nativeStore;
+};
+
+} // QtWebEngineCore
+
+#endif
diff --git a/src/core/net/client_cert_store_data.cpp b/src/core/net/client_cert_store_data.cpp
index 314e64145..0de6885df 100644
--- a/src/core/net/client_cert_store_data.cpp
+++ b/src/core/net/client_cert_store_data.cpp
@@ -1,48 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "net/client_cert_store_data.h"
#if QT_CONFIG(ssl)
-#include "base/logging.h"
-#include "base/macros.h"
-#include "base/memory/ptr_util.h"
#include "net/base/net_errors.h"
#include "net/cert/x509_certificate.h"
#include "net/ssl/ssl_platform_key_util.h"
@@ -59,16 +20,16 @@
namespace {
-class SSLPlatformKeyOverride : public net::ThreadedSSLPrivateKey::Delegate
+class SSLPlatformKeyQt : public net::ThreadedSSLPrivateKey::Delegate
{
public:
- SSLPlatformKeyOverride(const QByteArray &sslKeyInBytes)
+ SSLPlatformKeyQt(const QByteArray &sslKeyInBytes)
{
m_mem = BIO_new_mem_buf(sslKeyInBytes, -1);
m_key = PEM_read_bio_PrivateKey(m_mem, nullptr, nullptr, nullptr);
}
- ~SSLPlatformKeyOverride() override
+ ~SSLPlatformKeyQt() override
{
if (m_key)
EVP_PKEY_free(m_key);
@@ -104,8 +65,8 @@ public:
std::vector<uint16_t> GetAlgorithmPreferences() override
{
- return { SSL_SIGN_RSA_PKCS1_SHA1, SSL_SIGN_RSA_PKCS1_SHA512
- , SSL_SIGN_RSA_PKCS1_SHA384, SSL_SIGN_RSA_PKCS1_SHA256 };
+ return net::SSLPrivateKey::DefaultAlgorithmPreferences(EVP_PKEY_id(m_key),
+ /* supports pss */ true);
}
std::string GetProviderName() override {
return "qtwebengine";
@@ -113,8 +74,6 @@ public:
private:
EVP_PKEY *m_key;
BIO *m_mem;
-
- DISALLOW_COPY_AND_ASSIGN(SSLPlatformKeyOverride);
};
scoped_refptr<net::SSLPrivateKey> wrapOpenSSLPrivateKey(const QByteArray &sslKeyInBytes)
@@ -123,7 +82,7 @@ scoped_refptr<net::SSLPrivateKey> wrapOpenSSLPrivateKey(const QByteArray &sslKey
return nullptr;
return base::MakeRefCounted<net::ThreadedSSLPrivateKey>(
- std::make_unique<SSLPlatformKeyOverride>(sslKeyInBytes),
+ std::make_unique<SSLPlatformKeyQt>(sslKeyInBytes),
net::GetSSLPlatformKeyTaskRunner());
}
@@ -138,7 +97,8 @@ void ClientCertificateStoreData::add(const QSslCertificate &certificate, const Q
Entry *data = new Entry;
data->keyPtr = wrapOpenSSLPrivateKey(sslKeyInBytes);
- data->certPtr = net::X509Certificate::CreateFromBytes(certInBytes.data(), certInBytes.length());
+ data->certPtr = net::X509Certificate::CreateFromBytes(base::make_span((const unsigned char *)certInBytes.data(),
+ (unsigned long)certInBytes.length()));
data->key = privateKey;
data->certificate = certificate;
extraCerts.append(data);
diff --git a/src/core/net/client_cert_store_data.h b/src/core/net/client_cert_store_data.h
index e47a909e4..c2e28ac18 100644
--- a/src/core/net/client_cert_store_data.h
+++ b/src/core/net/client_cert_store_data.h
@@ -1,52 +1,16 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef CLIENT_CERT_STORE_DATA_H
#define CLIENT_CERT_STORE_DATA_H
-#include "qtwebenginecoreglobal.h"
-#include "qtnetworkglobal.h"
+#include <QtWebEngineCore/qtwebenginecoreglobal.h>
+#include <QtNetwork/qtnetworkglobal.h>
#if QT_CONFIG(ssl)
#include "base/memory/ref_counted.h"
-#include <QtCore/qvector.h>
+#include <QtCore/qlist.h>
#include <QtNetwork/qsslcertificate.h>
#include <QtNetwork/qsslkey.h>
@@ -71,7 +35,7 @@ struct ClientCertificateStoreData
void remove(const QSslCertificate &certificate);
void clear();
- QVector<Entry *> extraCerts;
+ QList<Entry *> extraCerts;
};
} // namespace QtWebEngineCore
diff --git a/src/core/net/cookie_monster_delegate_qt.cpp b/src/core/net/cookie_monster_delegate_qt.cpp
index d3157f760..d107c520c 100644
--- a/src/core/net/cookie_monster_delegate_qt.cpp
+++ b/src/core/net/cookie_monster_delegate_qt.cpp
@@ -1,50 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "cookie_monster_delegate_qt.h"
-#include "base/bind.h"
-#include "base/memory/ptr_util.h"
-#include "base/task/post_task.h"
-#include "content/public/browser/browser_task_traits.h"
-#include "content/public/browser/browser_thread.h"
-#include "mojo/public/cpp/bindings/binding.h"
+#include "base/functional/bind.h"
#include "net/cookies/cookie_util.h"
#include "services/network/public/mojom/cookie_manager.mojom.h"
@@ -52,6 +11,8 @@
#include "api/qwebenginecookiestore_p.h"
#include "type_conversion.h"
+#include <QNetworkCookie>
+
namespace QtWebEngineCore {
class CookieChangeListener : public network::mojom::CookieChangeListener
@@ -68,10 +29,25 @@ public:
private:
CookieMonsterDelegateQt *m_delegate;
+};
+
+class CookieAccessFilter : public network::mojom::CookieRemoteAccessFilter
+{
+public:
+ CookieAccessFilter(CookieMonsterDelegateQt *delegate) : m_delegate(delegate) { }
+ ~CookieAccessFilter() override = default;
- DISALLOW_COPY_AND_ASSIGN(CookieChangeListener);
+ void AllowedAccess(const GURL &url, const net::SiteForCookies &site_for_cookies, AllowedAccessCallback callback) override
+ {
+ bool allow = m_delegate->canGetCookies(toQt(site_for_cookies.first_party_url()), toQt(url));
+ std::move(callback).Run(allow);
+ }
+
+private:
+ CookieMonsterDelegateQt *m_delegate;
};
+
static GURL sourceUrlForCookie(const QNetworkCookie &cookie)
{
QString urlFragment = QStringLiteral("%1%2").arg(cookie.domain()).arg(cookie.path());
@@ -81,7 +57,10 @@ static GURL sourceUrlForCookie(const QNetworkCookie &cookie)
CookieMonsterDelegateQt::CookieMonsterDelegateQt()
: m_client(nullptr)
, m_listener(new CookieChangeListener(this))
+ , m_filter(new CookieAccessFilter(this))
, m_receiver(m_listener.get())
+ , m_filterReceiver(m_filter.get())
+ , m_hasFilter(false)
{
}
@@ -104,29 +83,30 @@ bool CookieMonsterDelegateQt::hasCookieMonster()
return m_mojoCookieManager.is_bound();
}
-void CookieMonsterDelegateQt::getAllCookies(quint64 callbackId)
+void CookieMonsterDelegateQt::getAllCookies()
{
- m_mojoCookieManager->GetAllCookies(base::BindOnce(&CookieMonsterDelegateQt::GetAllCookiesCallbackOnUIThread, this, callbackId));
+ m_mojoCookieManager->GetAllCookies(net::CookieStore::GetAllCookiesCallback());
}
-void CookieMonsterDelegateQt::setCookie(quint64 callbackId, const QNetworkCookie &cookie, const QUrl &origin)
+void CookieMonsterDelegateQt::setCookie(const QNetworkCookie &cookie, const QUrl &origin)
{
Q_ASSERT(hasCookieMonster());
Q_ASSERT(m_client);
- net::CookieStore::SetCookiesCallback callback;
-
GURL gurl = origin.isEmpty() ? sourceUrlForCookie(cookie) : toGurl(origin);
std::string cookie_line = cookie.toRawForm().toStdString();
- if (callbackId != CallbackDirectory::NoCallbackId)
- callback = base::BindOnce(&CookieMonsterDelegateQt::SetCookieCallbackOnUIThread, this, callbackId);
- net::CanonicalCookie::CookieInclusionStatus inclusion;
- auto canonCookie = net::CanonicalCookie::Create(gurl, cookie_line, base::Time::Now(), base::nullopt, &inclusion);
+ net::CookieInclusionStatus inclusion;
+ auto canonCookie = net::CanonicalCookie::Create(gurl, cookie_line, base::Time::Now(),
+ absl::nullopt, absl::nullopt, true, &inclusion);
+ if (!canonCookie || !inclusion.IsInclude()) {
+ LOG(WARNING) << "QWebEngineCookieStore::setCookie() - Tried to set invalid cookie";
+ return;
+ }
net::CookieOptions options;
- if (!inclusion.HasExclusionReason(net::CanonicalCookie::CookieInclusionStatus::EXCLUDE_HTTP_ONLY))
- options.set_include_httponly();
- m_mojoCookieManager->SetCanonicalCookie(*canonCookie.get(), gurl.scheme(), options, std::move(callback));
+ options.set_include_httponly();
+ options.set_same_site_cookie_context(net::CookieOptions::SameSiteCookieContext::MakeInclusiveForSet());
+ m_mojoCookieManager->SetCanonicalCookie(*canonCookie.get(), gurl, options, net::CookieStore::SetCookiesCallback());
}
void CookieMonsterDelegateQt::deleteCookie(const QNetworkCookie &cookie, const QUrl &origin)
@@ -142,30 +122,26 @@ void CookieMonsterDelegateQt::deleteCookie(const QNetworkCookie &cookie, const Q
m_mojoCookieManager->DeleteCookies(std::move(filter), network::mojom::CookieManager::DeleteCookiesCallback());
}
-void CookieMonsterDelegateQt::deleteSessionCookies(quint64 callbackId)
+void CookieMonsterDelegateQt::deleteSessionCookies()
{
Q_ASSERT(hasCookieMonster());
Q_ASSERT(m_client);
- network::mojom::CookieManager::DeleteCookiesCallback callback =
- base::BindOnce(&CookieMonsterDelegateQt::DeleteCookiesCallbackOnUIThread, this, callbackId);
auto filter = network::mojom::CookieDeletionFilter::New();
filter->session_control = network::mojom::CookieDeletionSessionControl::SESSION_COOKIES;
- m_mojoCookieManager->DeleteCookies(std::move(filter), std::move(callback));
+ m_mojoCookieManager->DeleteCookies(std::move(filter), network::mojom::CookieManager::DeleteCookiesCallback());
}
-void CookieMonsterDelegateQt::deleteAllCookies(quint64 callbackId)
+void CookieMonsterDelegateQt::deleteAllCookies()
{
Q_ASSERT(hasCookieMonster());
Q_ASSERT(m_client);
- network::mojom::CookieManager::DeleteCookiesCallback callback =
- base::BindOnce(&CookieMonsterDelegateQt::DeleteCookiesCallbackOnUIThread, this, callbackId);
auto filter = network::mojom::CookieDeletionFilter::New();
- m_mojoCookieManager->DeleteCookies(std::move(filter), std::move(callback));
+ m_mojoCookieManager->DeleteCookies(std::move(filter), network::mojom::CookieManager::DeleteCookiesCallback());
}
-void CookieMonsterDelegateQt::setMojoCookieManager(network::mojom::CookieManagerPtrInfo cookie_manager_info)
+void CookieMonsterDelegateQt::setMojoCookieManager(mojo::PendingRemote<network::mojom::CookieManager> cookie_manager_info)
{
if (m_mojoCookieManager.is_bound())
unsetMojoCookieManager();
@@ -176,14 +152,31 @@ void CookieMonsterDelegateQt::setMojoCookieManager(network::mojom::CookieManager
m_mojoCookieManager.Bind(std::move(cookie_manager_info));
m_mojoCookieManager->AddGlobalChangeListener(m_receiver.BindNewPipeAndPassRemote());
+ if (m_hasFilter)
+ m_mojoCookieManager->SetRemoteFilter(m_filterReceiver.BindNewPipeAndPassRemote());
if (m_client)
m_client->d_func()->processPendingUserCookies();
}
+void CookieMonsterDelegateQt::setHasFilter(bool hasFilter)
+{
+ m_hasFilter = hasFilter;
+ if (!m_mojoCookieManager.is_bound())
+ return;
+ if (m_hasFilter) {
+ if (!m_filterReceiver.is_bound())
+ m_mojoCookieManager->SetRemoteFilter(m_filterReceiver.BindNewPipeAndPassRemote());
+ } else {
+ if (m_filterReceiver.is_bound())
+ m_filterReceiver.reset();
+ }
+}
+
void CookieMonsterDelegateQt::unsetMojoCookieManager()
{
m_receiver.reset();
+ m_filterReceiver.reset();
m_mojoCookieManager.reset();
}
@@ -223,23 +216,4 @@ void CookieMonsterDelegateQt::OnCookieChanged(const net::CookieChangeInfo &chang
m_client->d_func()->onCookieChanged(toQt(change.cookie), change.cause != net::CookieChangeCause::INSERTED);
}
-void CookieMonsterDelegateQt::GetAllCookiesCallbackOnUIThread(qint64 callbackId, const net::CookieList &cookies)
-{
- QByteArray rawCookies = QByteArray::fromStdString(net::CanonicalCookie::BuildCookieLine(cookies));
- if (m_client)
- m_client->d_func()->onGetAllCallbackResult(callbackId, rawCookies);
-}
-
-void CookieMonsterDelegateQt::SetCookieCallbackOnUIThread(qint64 callbackId, net::CanonicalCookie::CookieInclusionStatus status)
-{
- if (m_client)
- m_client->d_func()->onSetCallbackResult(callbackId, status.IsInclude());
-}
-
-void CookieMonsterDelegateQt::DeleteCookiesCallbackOnUIThread(qint64 callbackId, uint numCookies)
-{
- if (m_client)
- m_client->d_func()->onDeleteCallbackResult(callbackId, numCookies);
-}
-
} // namespace QtWebEngineCore
diff --git a/src/core/net/cookie_monster_delegate_qt.h b/src/core/net/cookie_monster_delegate_qt.h
index bcbbe4c52..f6872323d 100644
--- a/src/core/net/cookie_monster_delegate_qt.h
+++ b/src/core/net/cookie_monster_delegate_qt.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
//
// W A R N I N G
@@ -53,11 +17,6 @@
#include "qtwebenginecoreglobal_p.h"
-QT_WARNING_PUSH
-// For some reason adding -Wno-unused-parameter to QMAKE_CXXFLAGS has no
-// effect with clang, so use a pragma for these dirty chromium headers
-QT_WARNING_DISABLE_CLANG("-Wunused-parameter")
-
// We need to work around Chromium using 'signals' as a variable name in headers:
#ifdef signals
#define StAsH_signals signals
@@ -65,7 +24,7 @@ QT_WARNING_DISABLE_CLANG("-Wunused-parameter")
#endif
#include "base/memory/ref_counted.h"
#include "mojo/public/cpp/bindings/receiver.h"
-#include "net/cookies/cookie_change_dispatcher.h"
+#include "mojo/public/cpp/bindings/remote.h"
#include "net/cookies/cookie_store.h"
#include "services/network/public/mojom/cookie_manager.mojom-forward.h"
#include "services/network/public/mojom/cookie_manager.mojom.h"
@@ -73,53 +32,51 @@ QT_WARNING_DISABLE_CLANG("-Wunused-parameter")
#define signals StAsH_signals
#undef StAsH_signals
#endif
-QT_WARNING_POP
-#include <QNetworkCookie>
#include <QPointer>
+QT_FORWARD_DECLARE_CLASS(QNetworkCookie)
QT_FORWARD_DECLARE_CLASS(QWebEngineCookieStore)
namespace QtWebEngineCore {
class CookieMonsterDelegateQtPrivate;
-class Q_WEBENGINECORE_PRIVATE_EXPORT CookieMonsterDelegateQt : public base::RefCountedThreadSafe<CookieMonsterDelegateQt>
+class Q_WEBENGINECORE_EXPORT CookieMonsterDelegateQt : public base::RefCountedThreadSafe<CookieMonsterDelegateQt>
{
QPointer<QWebEngineCookieStore> m_client;
std::vector<std::unique_ptr<net::CookieChangeSubscription>> m_subscriptions;
- network::mojom::CookieManagerPtr m_mojoCookieManager;
+ mojo::Remote<network::mojom::CookieManager> m_mojoCookieManager;
std::unique_ptr<network::mojom::CookieChangeListener> m_listener;
+ std::unique_ptr<network::mojom::CookieRemoteAccessFilter> m_filter;
mojo::Receiver<network::mojom::CookieChangeListener> m_receiver;
+ mojo::Receiver<network::mojom::CookieRemoteAccessFilter> m_filterReceiver;
+ bool m_hasFilter;
public:
CookieMonsterDelegateQt();
~CookieMonsterDelegateQt();
bool hasCookieMonster();
- void setCookie(quint64 callbackId, const QNetworkCookie &cookie, const QUrl &origin);
+ void setCookie(const QNetworkCookie &cookie, const QUrl &origin);
void deleteCookie(const QNetworkCookie &cookie, const QUrl &origin);
- void getAllCookies(quint64 callbackId);
- void deleteSessionCookies(quint64 callbackId);
- void deleteAllCookies(quint64 callbackId);
+ void getAllCookies();
+ void deleteSessionCookies();
+ void deleteAllCookies();
void setClient(QWebEngineCookieStore *client);
- void setMojoCookieManager(network::mojom::CookieManagerPtrInfo cookie_manager_info);
+ void setMojoCookieManager(mojo::PendingRemote<network::mojom::CookieManager> cookie_manager_info);
void unsetMojoCookieManager();
+ void setHasFilter(bool b);
bool canSetCookie(const QUrl &firstPartyUrl, const QByteArray &cookieLine, const QUrl &url) const;
bool canGetCookies(const QUrl &firstPartyUrl, const QUrl &url) const;
void AddStore(net::CookieStore *store);
void OnCookieChanged(const net::CookieChangeInfo &change);
-
-private:
- void GetAllCookiesCallbackOnUIThread(qint64 callbackId, const net::CookieList &cookies);
- void SetCookieCallbackOnUIThread(qint64 callbackId, net::CanonicalCookie::CookieInclusionStatus status);
- void DeleteCookiesCallbackOnUIThread(qint64 callbackId, uint numCookies);
};
-}
+} // namespace QtWebEngineCore
#endif // COOKIE_MONSTER_DELEGATE_QT_H
diff --git a/src/core/net/custom_url_loader_factory.cpp b/src/core/net/custom_url_loader_factory.cpp
index e5f580536..4274def99 100644
--- a/src/core/net/custom_url_loader_factory.cpp
+++ b/src/core/net/custom_url_loader_factory.cpp
@@ -1,49 +1,11 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "custom_url_loader_factory.h"
#include "base/strings/stringprintf.h"
-#include "base/task/post_task.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
-#include "mojo/public/cpp/bindings/binding.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/receiver_set.h"
#include "mojo/public/cpp/system/data_pipe.h"
@@ -51,9 +13,13 @@
#include "net/base/net_errors.h"
#include "net/http/http_status_code.h"
#include "net/http/http_util.h"
-#include "services/network/public/cpp/resource_response.h"
+#include "services/network/public/cpp/cors/cors.h"
+#include "services/network/public/cpp/resource_request.h"
#include "services/network/public/mojom/url_loader.mojom.h"
#include "services/network/public/mojom/url_loader_factory.mojom.h"
+#include "services/network/public/mojom/url_response_head.mojom.h"
+#include "url/url_util.h"
+#include "url/url_util_qt.h"
#include "api/qwebengineurlscheme.h"
#include "net/url_request_custom_job_proxy.h"
@@ -66,6 +32,7 @@
#include <QtCore/qiodevice.h>
#include <QtCore/qmimedatabase.h>
#include <QtCore/qmimedata.h>
+#include <QtCore/qpointer.h>
#include <QtCore/qurl.h>
namespace QtWebEngineCore {
@@ -77,26 +44,27 @@ class CustomURLLoader : public network::mojom::URLLoader
{
public:
static void CreateAndStart(const network::ResourceRequest &request,
- network::mojom::URLLoaderRequest loader,
- network::mojom::URLLoaderClientPtrInfo client_info,
+ mojo::PendingReceiver<network::mojom::URLLoader> loader,
+ mojo::PendingRemote<network::mojom::URLLoaderClient> client_remote,
QPointer<ProfileAdapter> profileAdapter)
{
// CustomURLLoader will handle its own life-cycle, and delete when
// the client lets go.
- auto *customUrlLoader = new CustomURLLoader(request, std::move(loader), std::move(client_info), profileAdapter);
+ auto *customUrlLoader = new CustomURLLoader(request, std::move(loader), std::move(client_remote), profileAdapter);
customUrlLoader->Start();
}
// network::mojom::URLLoader:
void FollowRedirect(const std::vector<std::string> &removed_headers,
const net::HttpRequestHeaders &modified_headers,
- const base::Optional<GURL> &new_url) override
+ const net::HttpRequestHeaders &modified_cors_exempt_headers, // FIXME: do something with this?
+ const absl::optional<GURL> &new_url) override
{
// We can be asked for follow our own redirect
scoped_refptr<URLRequestCustomJobProxy> proxy = new URLRequestCustomJobProxy(this, m_proxy->m_scheme, m_proxy->m_profileAdapter);
m_proxy->m_client = nullptr;
// m_taskRunner->PostTask(FROM_HERE, base::BindOnce(&URLRequestCustomJobProxy::release, m_proxy));
- base::PostTask(FROM_HERE, { content::BrowserThread::UI },
+ content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
base::BindOnce(&URLRequestCustomJobProxy::release, m_proxy));
m_proxy = std::move(proxy);
if (new_url)
@@ -115,24 +83,25 @@ public:
private:
CustomURLLoader(const network::ResourceRequest &request,
- network::mojom::URLLoaderRequest loader,
- network::mojom::URLLoaderClientPtrInfo client_info,
+ mojo::PendingReceiver<network::mojom::URLLoader> loader,
+ mojo::PendingRemote<network::mojom::URLLoaderClient> client_remote,
QPointer<ProfileAdapter> profileAdapter)
// ### We can opt to run the url-loader on the UI thread instead
- : m_taskRunner(base::CreateSingleThreadTaskRunner({ content::BrowserThread::IO }))
+ : m_taskRunner(content::GetIOThreadTaskRunner({}))
, m_proxy(new URLRequestCustomJobProxy(this, request.url.scheme(), profileAdapter))
- , m_binding(this, std::move(loader))
- , m_client(std::move(client_info))
+ , m_receiver(this, std::move(loader))
+ , m_client(std::move(client_remote))
, m_request(request)
{
DCHECK(m_taskRunner->RunsTasksInCurrentSequence());
- m_binding.set_connection_error_handler(
- base::BindOnce(&CustomURLLoader::OnConnectionError, m_weakPtrFactory.GetWeakPtr()));
+ m_receiver.set_disconnect_handler(
+ base::BindOnce(&CustomURLLoader::OnConnectionError, m_weakPtrFactory.GetWeakPtr()));
m_firstBytePosition = 0;
m_device = nullptr;
m_error = 0;
QWebEngineUrlScheme scheme = QWebEngineUrlScheme::schemeByName(QByteArray::fromStdString(request.url.scheme()));
m_corsEnabled = scheme.flags().testFlag(QWebEngineUrlScheme::CorsEnabled);
+ m_isLocal = scheme.flags().testFlag(QWebEngineUrlScheme::LocalScheme);
}
~CustomURLLoader() override = default;
@@ -140,9 +109,34 @@ private:
void Start()
{
DCHECK(m_taskRunner->RunsTasksInCurrentSequence());
- m_head.request_start = base::TimeTicks::Now();
- if (!m_pipe.consumer_handle.is_valid())
+ if (network::cors::IsCorsEnabledRequestMode(m_request.mode)) {
+ // CORS mode requires a valid request_initiator.
+ if (!m_request.request_initiator)
+ return CompleteWithFailure(net::ERR_INVALID_ARGUMENT);
+
+ if (m_isLocal) {
+ std::string fromScheme = m_request.request_initiator->GetTupleOrPrecursorTupleIfOpaque().scheme();
+ const std::vector<std::string> &localSchemes = url::GetLocalSchemes();
+ bool fromLocal = base::Contains(localSchemes, fromScheme);
+ bool hasLocalAccess = fromLocal;
+ if (const url::CustomScheme *cs = url::CustomScheme::FindScheme(fromScheme))
+ hasLocalAccess = cs->flags & (url::CustomScheme::LocalAccessAllowed | url::CustomScheme::Local);
+ if (!hasLocalAccess)
+ return CompleteWithFailure(net::ERR_ACCESS_DENIED);
+ } else if (!m_corsEnabled && !m_request.request_initiator->IsSameOriginWith(url::Origin::Create(m_request.url))) {
+ // Custom schemes are not covered by CorsURLLoader, so we need to reject CORS requests manually.
+ return CompleteWithFailure(network::CorsErrorStatus(network::mojom::CorsError::kCorsDisabledScheme));
+ }
+ }
+
+ if (mojo::CreateDataPipe(nullptr, m_pipeProducerHandle, m_pipeConsumerHandle) != MOJO_RESULT_OK)
+ return CompleteWithFailure(net::ERR_FAILED);
+
+ m_head = network::mojom::URLResponseHead::New();
+ m_head->request_start = base::TimeTicks::Now();
+
+ if (!m_pipeConsumerHandle.is_valid())
return CompleteWithFailure(net::ERR_FAILED);
std::map<std::string, std::string> headers;
@@ -157,9 +151,18 @@ private:
m_firstBytePosition = m_byteRange.first_byte_position();
// m_taskRunner->PostTask(FROM_HERE,
- base::PostTask(FROM_HERE, { content::BrowserThread::UI },
- base::BindOnce(&URLRequestCustomJobProxy::initialize, m_proxy,
- m_request.url, m_request.method, m_request.request_initiator, std::move(headers)));
+ content::GetUIThreadTaskRunner({})->PostTask(
+ FROM_HERE,
+ base::BindOnce(&URLRequestCustomJobProxy::initialize, m_proxy, m_request.url,
+ m_request.method, m_request.request_initiator, std::move(headers),
+ m_request.request_body));
+ }
+
+ void CompleteWithFailure(network::CorsErrorStatus cors_error)
+ {
+ DCHECK(m_taskRunner->RunsTasksInCurrentSequence());
+ m_client->OnComplete(network::URLLoaderCompletionStatus(cors_error));
+ ClearProxyAndClient(false);
}
void CompleteWithFailure(net::Error net_error)
@@ -172,7 +175,7 @@ private:
void OnConnectionError()
{
DCHECK(m_taskRunner->RunsTasksInCurrentSequence());
- m_binding.Close();
+ m_receiver.reset();
if (m_client.is_bound())
ClearProxyAndClient(false);
else
@@ -184,7 +187,7 @@ private:
DCHECK(m_taskRunner->RunsTasksInCurrentSequence());
if (result == MOJO_RESULT_OK) {
network::URLLoaderCompletionStatus status(net::OK);
- status.encoded_data_length = m_totalBytesRead + m_head.headers->raw_headers().length();
+ status.encoded_data_length = m_totalBytesRead + m_headerBytesRead;
status.encoded_body_length = m_totalBytesRead;
status.decoded_body_length = m_totalBytesRead;
m_client->OnComplete(status);
@@ -203,9 +206,9 @@ private:
m_device->close();
m_device = nullptr;
// m_taskRunner->PostTask(FROM_HERE, base::BindOnce(&URLRequestCustomJobProxy::release, m_proxy));
- base::PostTask(FROM_HERE, { content::BrowserThread::UI },
+ content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
base::BindOnce(&URLRequestCustomJobProxy::release, m_proxy));
- if (!wait_for_loader_error || !m_binding.is_bound())
+ if (!wait_for_loader_error || !m_receiver.is_bound())
delete this;
}
@@ -219,17 +222,17 @@ private:
CompleteWithFailure(net::ERR_REQUEST_RANGE_NOT_SATISFIABLE);
} else {
m_maxBytesToRead = m_byteRange.last_byte_position() - m_byteRange.first_byte_position() + 1;
- m_head.content_length = m_maxBytesToRead;
+ m_head->content_length = m_maxBytesToRead;
}
} else {
- m_head.content_length = size;
+ m_head->content_length = size;
}
}
void notifyHeadersComplete() override
{
DCHECK(m_taskRunner->RunsTasksInCurrentSequence());
DCHECK(!m_error);
- m_head.response_start = base::TimeTicks::Now();
+ m_head->response_start = base::TimeTicks::Now();
std::string headers;
if (!m_redirect.is_empty()) {
@@ -262,39 +265,46 @@ private:
headers += "Access-Control-Allow-Credentials: true\n";
}
}
- m_head.headers = base::MakeRefCounted<net::HttpResponseHeaders>(net::HttpUtil::AssembleRawHeaders(headers));
- m_head.encoded_data_length = m_head.headers->raw_headers().length();
+ for (auto it = m_additionalResponseHeaders.cbegin();
+ it != m_additionalResponseHeaders.cend(); ++it) {
+ headers += it.key().toLower().toStdString() + ": " + it.value().toLower().toStdString()
+ + "\n";
+ }
+ m_head->headers = base::MakeRefCounted<net::HttpResponseHeaders>(net::HttpUtil::AssembleRawHeaders(headers));
+ m_head->encoded_data_length = m_head->headers->raw_headers().length();
if (!m_redirect.is_empty()) {
- m_head.content_length = m_head.encoded_body_length = -1;
- net::URLRequest::FirstPartyURLPolicy first_party_url_policy =
- m_request.update_first_party_url_on_redirect ? net::URLRequest::UPDATE_FIRST_PARTY_URL_ON_REDIRECT
- : net::URLRequest::NEVER_CHANGE_FIRST_PARTY_URL;
+ m_head->content_length = {};
+ m_head->encoded_body_length = {};
+ net::RedirectInfo::FirstPartyURLPolicy first_party_url_policy =
+ m_request.update_first_party_url_on_redirect ? net::RedirectInfo::FirstPartyURLPolicy::UPDATE_URL_ON_REDIRECT
+ : net::RedirectInfo::FirstPartyURLPolicy::NEVER_CHANGE_URL;
net::RedirectInfo redirectInfo = net::RedirectInfo::ComputeRedirectInfo(
m_request.method, m_request.url,
m_request.site_for_cookies,
first_party_url_policy, m_request.referrer_policy,
m_request.referrer.spec(), net::HTTP_SEE_OTHER,
- m_redirect, base::nullopt, false /*insecure_scheme_was_upgraded*/);
- m_client->OnReceiveRedirect(redirectInfo, m_head);
+ m_redirect, absl::nullopt, false /*insecure_scheme_was_upgraded*/);
+ m_client->OnReceiveRedirect(redirectInfo, std::move(m_head));
+ m_head = nullptr;
// ### should m_request be updated with RedirectInfo? (see FollowRedirect)
return;
}
DCHECK(m_device);
- m_head.mime_type = m_mimeType;
- m_head.charset = m_charset;
- m_client->OnReceiveResponse(m_head);
- m_client->OnStartLoadingResponseBody(std::move(m_pipe.consumer_handle));
-
- if (readAvailableData()) // May delete this
- return;
+ m_head->mime_type = m_mimeType;
+ m_head->charset = m_charset;
+ m_headerBytesRead = m_head->headers->raw_headers().length();
+ m_client->OnReceiveResponse(std::move(m_head), std::move(m_pipeConsumerHandle), absl::nullopt);
+ m_head = nullptr;
m_watcher = std::make_unique<mojo::SimpleWatcher>(
- FROM_HERE, mojo::SimpleWatcher::ArmingPolicy::AUTOMATIC, m_taskRunner);
- m_watcher->Watch(m_pipe.producer_handle.get(), MOJO_HANDLE_SIGNAL_WRITABLE,
+ FROM_HERE, mojo::SimpleWatcher::ArmingPolicy::MANUAL, m_taskRunner);
+ m_watcher->Watch(m_pipeProducerHandle.get(), MOJO_HANDLE_SIGNAL_WRITABLE,
MOJO_WATCH_CONDITION_SATISFIED,
base::BindRepeating(&CustomURLLoader::notifyReadyWrite,
m_weakPtrFactory.GetWeakPtr()));
+
+ readAvailableData(); // May delete this
}
void notifyCanceled() override
{
@@ -309,7 +319,7 @@ private:
void notifyStartFailure(int error) override
{
DCHECK(m_taskRunner->RunsTasksInCurrentSequence());
- m_head.response_start = base::TimeTicks::Now();
+ m_head->response_start = base::TimeTicks::Now();
std::string headers;
switch (error) {
case net::ERR_INVALID_URL:
@@ -331,10 +341,11 @@ private:
headers = "HTTP/1.1 500 Internal Error\n";
break;
}
- m_head.headers = base::MakeRefCounted<net::HttpResponseHeaders>(net::HttpUtil::AssembleRawHeaders(headers));
- m_head.encoded_data_length = m_head.headers->raw_headers().length();
- m_head.content_length = m_head.encoded_body_length = -1;
- m_client->OnReceiveResponse(m_head);
+ m_head->headers = base::MakeRefCounted<net::HttpResponseHeaders>(net::HttpUtil::AssembleRawHeaders(headers));
+ m_head->encoded_data_length = m_head->headers->raw_headers().length();
+ m_head->content_length = {};
+ m_head->encoded_body_length = {};
+ m_client->OnReceiveResponse(std::move(m_head), mojo::ScopedDataPipeConsumerHandle(), absl::nullopt);
CompleteWithFailure(net::Error(error));
}
void notifyReadyRead() override
@@ -360,10 +371,12 @@ private:
void *buffer = nullptr;
uint32_t bufferSize = 0;
- MojoResult beginResult = m_pipe.producer_handle->BeginWriteData(
+ MojoResult beginResult = m_pipeProducerHandle->BeginWriteData(
&buffer, &bufferSize, MOJO_BEGIN_WRITE_DATA_FLAG_NONE);
- if (beginResult == MOJO_RESULT_SHOULD_WAIT)
+ if (beginResult == MOJO_RESULT_SHOULD_WAIT) {
+ m_watcher->ArmOrNotify();
return false; // Wait for pipe watcher
+ }
if (beginResult != MOJO_RESULT_OK)
break;
if (m_maxBytesToRead > 0 && m_maxBytesToRead <= int64_t{std::numeric_limits<uint32_t>::max()})
@@ -371,17 +384,24 @@ private:
int readResult = m_device->read(static_cast<char *>(buffer), bufferSize);
uint32_t bytesRead = std::max(readResult, 0);
- m_pipe.producer_handle->EndWriteData(bytesRead);
+ m_pipeProducerHandle->EndWriteData(bytesRead);
m_totalBytesRead += bytesRead;
m_client->OnTransferSizeUpdated(m_totalBytesRead);
- if (m_device->atEnd() || (m_maxBytesToRead > 0 && m_totalBytesRead >= m_maxBytesToRead)) {
+ const bool deviceAtEnd = m_device->atEnd();
+ if ((deviceAtEnd && !m_device->isSequential())
+ || (m_maxBytesToRead > 0 && m_totalBytesRead >= m_maxBytesToRead)) {
OnTransferComplete(MOJO_RESULT_OK);
return true; // Done with reading
}
if (readResult == 0)
return false; // Wait for readyRead
+ if (readResult < 0 && deviceAtEnd && m_device->isSequential()) {
+ // Failure on read, and sequential device claiming to be at end, so treat it as a successful end-of-data.
+ OnTransferComplete(MOJO_RESULT_OK);
+ return true; // Done with reading
+ }
if (readResult < 0)
break;
}
@@ -404,7 +424,7 @@ private:
}
return false;
}
- base::TaskRunner *taskRunner() override
+ base::SequencedTaskRunner *taskRunner() override
{
DCHECK(m_taskRunner->RunsTasksInCurrentSequence());
return m_taskRunner.get();
@@ -413,36 +433,39 @@ private:
scoped_refptr<base::SequencedTaskRunner> m_taskRunner;
scoped_refptr<URLRequestCustomJobProxy> m_proxy;
- mojo::Binding<network::mojom::URLLoader> m_binding;
- network::mojom::URLLoaderClientPtr m_client;
- mojo::DataPipe m_pipe;
+ mojo::Receiver<network::mojom::URLLoader> m_receiver;
+ mojo::Remote<network::mojom::URLLoaderClient> m_client;
+ mojo::ScopedDataPipeProducerHandle m_pipeProducerHandle;
+ mojo::ScopedDataPipeConsumerHandle m_pipeConsumerHandle;
std::unique_ptr<mojo::SimpleWatcher> m_watcher;
net::HttpByteRange m_byteRange;
int64_t m_totalSize = 0;
int64_t m_maxBytesToRead = -1;
network::ResourceRequest m_request;
- network::ResourceResponseHead m_head;
+ network::mojom::URLResponseHeadPtr m_head;
+ qint64 m_headerBytesRead = 0;
qint64 m_totalBytesRead = 0;
bool m_corsEnabled;
+ bool m_isLocal;
base::WeakPtrFactory<CustomURLLoader> m_weakPtrFactory{this};
-
- DISALLOW_COPY_AND_ASSIGN(CustomURLLoader);
};
class CustomURLLoaderFactory : public network::mojom::URLLoaderFactory {
public:
- CustomURLLoaderFactory(ProfileAdapter *profileAdapter)
- : m_taskRunner(base::CreateSequencedTaskRunner({ content::BrowserThread::IO }))
+ CustomURLLoaderFactory(ProfileAdapter *profileAdapter, mojo::PendingReceiver<network::mojom::URLLoaderFactory> receiver)
+ : m_taskRunner(content::GetIOThreadTaskRunner({}))
, m_profileAdapter(profileAdapter)
{
+ m_receivers.set_disconnect_handler(base::BindRepeating(
+ &CustomURLLoaderFactory::OnDisconnect, base::Unretained(this)));
+ m_receivers.Add(this, std::move(receiver));
}
~CustomURLLoaderFactory() override = default;
// network::mojom::URLLoaderFactory:
void CreateLoaderAndStart(mojo::PendingReceiver<network::mojom::URLLoader> loader,
- int32_t routing_id,
int32_t request_id,
uint32_t options,
const network::ResourceRequest &request,
@@ -450,7 +473,6 @@ public:
const net::MutableNetworkTrafficAnnotationTag &traffic_annotation) override
{
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- Q_UNUSED(routing_id);
Q_UNUSED(request_id);
Q_UNUSED(options);
Q_UNUSED(traffic_annotation);
@@ -467,17 +489,29 @@ public:
m_receivers.Add(this, std::move(receiver));
}
+ void OnDisconnect()
+ {
+ if (m_receivers.empty())
+ delete this;
+ }
+
+ static mojo::PendingRemote<network::mojom::URLLoaderFactory> Create(ProfileAdapter *profileAdapter)
+ {
+ mojo::PendingRemote<network::mojom::URLLoaderFactory> pending_remote;
+ new CustomURLLoaderFactory(profileAdapter, pending_remote.InitWithNewPipeAndPassReceiver());
+ return pending_remote;
+ }
+
const scoped_refptr<base::SequencedTaskRunner> m_taskRunner;
mojo::ReceiverSet<network::mojom::URLLoaderFactory> m_receivers;
QPointer<ProfileAdapter> m_profileAdapter;
- DISALLOW_COPY_AND_ASSIGN(CustomURLLoaderFactory);
};
} // namespace
-std::unique_ptr<network::mojom::URLLoaderFactory> CreateCustomURLLoaderFactory(ProfileAdapter *profileAdapter)
+mojo::PendingRemote<network::mojom::URLLoaderFactory> CreateCustomURLLoaderFactory(ProfileAdapter *profileAdapter)
{
- return std::make_unique<CustomURLLoaderFactory>(profileAdapter);
+ return CustomURLLoaderFactory::Create(profileAdapter);
}
} // namespace QtWebEngineCore
diff --git a/src/core/net/custom_url_loader_factory.h b/src/core/net/custom_url_loader_factory.h
index 58adf4b79..fb0c74627 100644
--- a/src/core/net/custom_url_loader_factory.h
+++ b/src/core/net/custom_url_loader_factory.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
//
// W A R N I N G
@@ -51,7 +15,7 @@
#ifndef CUSTOM_URL_LOADER_FACTORY_H_
#define CUSTOM_URL_LOADER_FACTORY_H_
-#include <memory>
+#include "mojo/public/cpp/bindings/pending_remote.h"
namespace network {
namespace mojom {
@@ -62,7 +26,7 @@ class URLLoaderFactory;
namespace QtWebEngineCore {
class ProfileAdapter;
-std::unique_ptr<network::mojom::URLLoaderFactory> CreateCustomURLLoaderFactory(ProfileAdapter *profileAdapter);
+mojo::PendingRemote<network::mojom::URLLoaderFactory> CreateCustomURLLoaderFactory(ProfileAdapter *profileAdapter);
} // namespace QtWebEngineCore
diff --git a/src/core/net/plugin_response_interceptor_url_loader_throttle.cpp b/src/core/net/plugin_response_interceptor_url_loader_throttle.cpp
index d854a556c..159fa28ca 100644
--- a/src/core/net/plugin_response_interceptor_url_loader_throttle.cpp
+++ b/src/core/net/plugin_response_interceptor_url_loader_throttle.cpp
@@ -1,135 +1,201 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+// based on chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.cc
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
#include "plugin_response_interceptor_url_loader_throttle.h"
-#include "base/bind.h"
-#include "base/task/post_task.h"
-#include "content/public/browser/browser_task_traits.h"
+#include "base/functional/bind.h"
+#include "base/uuid.h"
+#include "chrome/browser/extensions/api/streams_private/streams_private_api.h"
+#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/download_manager.h"
#include "content/public/browser/download_request_utils.h"
#include "content/public/browser/download_utils.h"
-#include "content/public/common/resource_type.h"
+#include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_attach_helper.h"
#include "extensions/common/constants.h"
#include "extensions/common/extension.h"
+#include "extensions/common/manifest_handlers/mime_types_handler.h"
+#include "third_party/blink/public/mojom/loader/transferrable_url_loader.mojom.h"
#include "extensions/extension_system_qt.h"
-#include "profile_adapter.h"
-#include "profile_io_data_qt.h"
-#include "profile_qt.h"
#include "web_contents_delegate_qt.h"
+#include "web_engine_settings.h"
#include <string>
+#include <tuple>
-namespace QtWebEngineCore {
-
-void onPdfStreamIntercepted(const GURL &original_url, std::string extension_id, int frame_tree_node_id)
+namespace {
+void ClearAllButFrameAncestors(network::mojom::URLResponseHead *response_head)
{
- content::WebContents *web_contents = content::WebContents::FromFrameTreeNodeId(frame_tree_node_id);
- if (!web_contents)
- return;
+ response_head->headers->RemoveHeader("Content-Security-Policy");
+ response_head->headers->RemoveHeader("Content-Security-Policy-Report-Only");
- WebContentsDelegateQt *contentsDelegate = static_cast<WebContentsDelegateQt *>(web_contents->GetDelegate());
- if (!contentsDelegate)
+ if (!response_head->parsed_headers)
return;
- WebEngineSettings *settings = contentsDelegate->webEngineSettings();
- if (!settings->testAttribute(WebEngineSettings::PdfViewerEnabled)
- || !settings->testAttribute(WebEngineSettings::PluginsEnabled)) {
- // If the applications has been set up to always download PDF files to open them in an
- // external viewer, trigger the download.
- std::unique_ptr<download::DownloadUrlParameters> params(
- content::DownloadRequestUtils::CreateDownloadForWebContentsMainFrame(web_contents, original_url,
- MISSING_TRAFFIC_ANNOTATION));
- content::BrowserContext::GetDownloadManager(web_contents->GetBrowserContext())->DownloadUrl(std::move(params));
- return;
+ std::vector<network::mojom::ContentSecurityPolicyPtr> &csp =
+ response_head->parsed_headers->content_security_policy;
+ std::vector<network::mojom::ContentSecurityPolicyPtr> cleared;
+
+ for (auto &policy : csp) {
+ auto frame_ancestors = policy->directives.find(network::mojom::CSPDirectiveName::FrameAncestors);
+ if (frame_ancestors == policy->directives.end())
+ continue;
+
+ auto cleared_policy = network::mojom::ContentSecurityPolicy::New();
+ cleared_policy->self_origin = std::move(policy->self_origin);
+ cleared_policy->header = std::move(policy->header);
+ cleared_policy->header->header_value = "";
+ cleared_policy->directives[network::mojom::CSPDirectiveName::FrameAncestors] = std::move(frame_ancestors->second);
+
+ auto raw_frame_ancestors = policy->raw_directives.find(network::mojom::CSPDirectiveName::FrameAncestors);
+ DCHECK(raw_frame_ancestors != policy->raw_directives.end());
+
+ cleared_policy->header->header_value = "frame-ancestors " + raw_frame_ancestors->second;
+ response_head->headers->AddHeader(
+ cleared_policy->header->type == network::mojom::ContentSecurityPolicyType::kEnforce
+ ? "Content-Security-Policy"
+ : "Content-Security-Policy-Report-Only",
+ cleared_policy->header->header_value);
+ cleared_policy->raw_directives[network::mojom::CSPDirectiveName::FrameAncestors] =
+ std::move(raw_frame_ancestors->second);
+
+ cleared.push_back(std::move(cleared_policy));
}
- // The URL passes the original pdf resource url, that will be requested
- // by the pdf viewer extension page.
- content::NavigationController::LoadURLParams params(
- GURL(base::StringPrintf("%s://%s/index.html?%s", extensions::kExtensionScheme,
- extension_id.c_str(), original_url.spec().c_str())));
-
- params.frame_tree_node_id = frame_tree_node_id;
- web_contents->GetController().LoadURLWithParams(params);
+ csp.swap(cleared);
}
+} // namespace
-PluginResponseInterceptorURLLoaderThrottle::PluginResponseInterceptorURLLoaderThrottle(
- content::ResourceContext *resource_context, int resource_type, int frame_tree_node_id)
- : m_resource_context(resource_context), m_resource_type(resource_type), m_frame_tree_node_id(frame_tree_node_id)
-{}
+namespace QtWebEngineCore {
PluginResponseInterceptorURLLoaderThrottle::PluginResponseInterceptorURLLoaderThrottle(
- content::BrowserContext *browser_context, int resource_type, int frame_tree_node_id)
- : m_browser_context(browser_context), m_resource_type(resource_type), m_frame_tree_node_id(frame_tree_node_id)
+ network::mojom::RequestDestination request_destination,
+ int frame_tree_node_id)
+ : m_request_destination(request_destination), m_frame_tree_node_id(frame_tree_node_id)
{}
void PluginResponseInterceptorURLLoaderThrottle::WillProcessResponse(const GURL &response_url,
network::mojom::URLResponseHead *response_head,
bool *defer)
{
- Q_UNUSED(defer);
- if (content::download_utils::MustDownload(response_url, response_head->headers.get(), response_head->mime_type))
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+
+ content::WebContents *web_contents = content::WebContents::FromFrameTreeNodeId(m_frame_tree_node_id);
+ if (!web_contents)
return;
- if (m_resource_context) {
- DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
- } else {
- DCHECK(m_browser_context);
- DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- }
+ if (content::download_utils::MustDownload(
+ web_contents->GetBrowserContext(),
+ response_url, response_head->headers.get(), response_head->mime_type))
+ return;
std::string extension_id;
- // FIXME: We should use extensions::InfoMap in the future:
if (response_head->mime_type == "application/pdf")
extension_id = extension_misc::kPdfExtensionId;
if (extension_id.empty())
return;
- base::PostTask(FROM_HERE, {content::BrowserThread::UI},
- base::BindOnce(&onPdfStreamIntercepted,
- response_url,
- extension_id,
- m_frame_tree_node_id));
+ WebContentsDelegateQt *contentsDelegate = static_cast<WebContentsDelegateQt *>(web_contents->GetDelegate());
+ if (!contentsDelegate)
+ return;
+
+ WebEngineSettings *settings = contentsDelegate->webEngineSettings();
+ if (!settings->testAttribute(QWebEngineSettings::PdfViewerEnabled)
+ || !settings->testAttribute(QWebEngineSettings::PluginsEnabled)) {
+ // PluginServiceFilterQt will inform the URLLoader about the disabled state of plugins
+ // and we can expect the download to be triggered automatically. It's unnecessary to
+ // go further and start the guest view embedding process.
+ return;
+ }
+
+ // Chrome's PDF Extension does not work properly in the face of a restrictive
+ // Content-Security-Policy, and does not currently respect the policy anyway.
+ // Ignore CSP served on a PDF response. https://crbug.com/271452
+ if (extension_id == extension_misc::kPdfExtensionId && response_head->headers)
+ ClearAllButFrameAncestors(response_head);
+
+ MimeTypesHandler::ReportUsedHandler(extension_id);
+
+ std::string view_id = base::Uuid::GenerateRandomV4().AsLowercaseString();
+ // The string passed down to the original client with the response body.
+ std::string payload = view_id;
+
+ mojo::PendingRemote<network::mojom::URLLoader> dummy_new_loader;
+ std::ignore = dummy_new_loader.InitWithNewPipeAndPassReceiver();
+ mojo::Remote<network::mojom::URLLoaderClient> new_client;
+ mojo::PendingReceiver<network::mojom::URLLoaderClient> new_client_receiver =
+ new_client.BindNewPipeAndPassReceiver();
+
+
+ uint32_t data_pipe_size = 64U;
+ // Provide the MimeHandlerView code a chance to override the payload. This is
+ // the case where the resource is handled by frame-based MimeHandlerView.
+ *defer = extensions::MimeHandlerViewAttachHelper::OverrideBodyForInterceptedResponse(
+ m_frame_tree_node_id, response_url, response_head->mime_type, view_id,
+ &payload, &data_pipe_size,
+ base::BindOnce(
+ &PluginResponseInterceptorURLLoaderThrottle::ResumeLoad,
+ weak_factory_.GetWeakPtr()));
+
+ mojo::ScopedDataPipeProducerHandle producer_handle;
+ mojo::ScopedDataPipeConsumerHandle consumer_handle;
+ CHECK_EQ(MOJO_RESULT_OK, mojo::CreateDataPipe(data_pipe_size, producer_handle, consumer_handle));
+
+ uint32_t len = static_cast<uint32_t>(payload.size());
+ CHECK_EQ(MOJO_RESULT_OK,
+ producer_handle->WriteData(
+ payload.c_str(), &len, MOJO_WRITE_DATA_FLAG_ALL_OR_NONE));
+
+ network::URLLoaderCompletionStatus status(net::OK);
+ status.decoded_body_length = len;
+ new_client->OnComplete(status);
+
+ mojo::PendingRemote<network::mojom::URLLoader> original_loader;
+ mojo::PendingReceiver<network::mojom::URLLoaderClient> original_client;
+ mojo::ScopedDataPipeConsumerHandle body = std::move(consumer_handle);
+ delegate_->InterceptResponse(std::move(dummy_new_loader),
+ std::move(new_client_receiver),
+ &original_loader, &original_client,
+ &body);
+
+ // Make a deep copy of URLResponseHead before passing it cross-thread.
+ auto deep_copied_response = response_head->Clone();
+ if (response_head->headers) {
+ deep_copied_response->headers =
+ base::MakeRefCounted<net::HttpResponseHeaders>(
+ response_head->headers->raw_headers());
+ }
+
+ auto transferrable_loader = blink::mojom::TransferrableURLLoader::New();
+ transferrable_loader->url = GURL(
+ extensions::Extension::GetBaseURLFromExtensionId(extension_id).spec() +
+ base::Uuid::GenerateRandomV4().AsLowercaseString());
+ transferrable_loader->url_loader = std::move(original_loader);
+ transferrable_loader->url_loader_client = std::move(original_client);
+ transferrable_loader->head = std::move(deep_copied_response);
+ transferrable_loader->head->intercepted_by_plugin = true;
+ transferrable_loader->body = std::move(body);
+
+ bool embedded = m_request_destination !=
+ network::mojom::RequestDestination::kDocument;
+ content::GetUIThreadTaskRunner({})->PostTask(
+ FROM_HERE,
+ base::BindOnce(
+ &extensions::StreamsPrivateAPI::SendExecuteMimeTypeHandlerEvent,
+ extension_id, view_id, embedded, m_frame_tree_node_id,
+ std::move(transferrable_loader), response_url));
+}
+
+void PluginResponseInterceptorURLLoaderThrottle::ResumeLoad()
+{
+ delegate_->Resume();
}
} // namespace QtWebEngineCore
diff --git a/src/core/net/plugin_response_interceptor_url_loader_throttle.h b/src/core/net/plugin_response_interceptor_url_loader_throttle.h
index 7b9db6490..fb3918c45 100644
--- a/src/core/net/plugin_response_interceptor_url_loader_throttle.h
+++ b/src/core/net/plugin_response_interceptor_url_loader_throttle.h
@@ -1,51 +1,15 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef PLUGIN_RESPONSE_INTERCEPTOR_URL_LOADER_THROTTLE_H_
#define PLUGIN_RESPONSE_INTERCEPTOR_URL_LOADER_THROTTLE_H_
-#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "services/network/public/mojom/fetch_api.mojom-shared.h"
#include "third_party/blink/public/common/loader/url_loader_throttle.h"
namespace content {
class BrowserContext;
-class ResourceContext;
}
namespace QtWebEngineCore {
@@ -53,22 +17,23 @@ namespace QtWebEngineCore {
class PluginResponseInterceptorURLLoaderThrottle : public blink::URLLoaderThrottle
{
public:
- PluginResponseInterceptorURLLoaderThrottle(content::ResourceContext *resource_context,
- int resource_type, int frame_tree_node_id);
- PluginResponseInterceptorURLLoaderThrottle(content::BrowserContext *browser_context,
- int resource_type, int frame_tree_node_id);
+ PluginResponseInterceptorURLLoaderThrottle(network::mojom::RequestDestination request_destination,
+ int frame_tree_node_id);
~PluginResponseInterceptorURLLoaderThrottle() override = default;
private:
// content::URLLoaderThrottle overrides;
void WillProcessResponse(const GURL &response_url, network::mojom::URLResponseHead *response_head, bool *defer) override;
- content::ResourceContext *m_resource_context = nullptr;
- content::BrowserContext *m_browser_context = nullptr;
- const int m_resource_type;
+ // Resumes loading for an intercepted response. This would give the extension
+ // layer chance to initialize its browser side state.
+ void ResumeLoad();
+
+ const network::mojom::RequestDestination m_request_destination;
const int m_frame_tree_node_id;
- DISALLOW_COPY_AND_ASSIGN(PluginResponseInterceptorURLLoaderThrottle);
+ base::WeakPtrFactory<PluginResponseInterceptorURLLoaderThrottle>
+ weak_factory_{this};
};
} // namespace QtWebEngineCore
diff --git a/src/core/net/proxy_config_monitor.cpp b/src/core/net/proxy_config_monitor.cpp
index a0aaf0c05..8315b7bf2 100644
--- a/src/core/net/proxy_config_monitor.cpp
+++ b/src/core/net/proxy_config_monitor.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// originally based on chrome/browser/net/proxy_config_monitor.cc
// Copyright 2017 The Chromium Authors. All rights reserved.
@@ -46,15 +10,11 @@
#include "proxy_config_monitor.h"
#include "proxy_config_service_qt.h"
-#include "base/strings/utf_string_conversions.h"
-#include "base/task/post_task.h"
-#include "build/build_config.h"
-#include "components/proxy_config/pref_proxy_config_tracker_impl.h"
#include "content/public/browser/browser_task_traits.h"
+#include "components/prefs/pref_service.h"
#include "content/public/browser/browser_thread.h"
-#include "mojo/public/cpp/bindings/associated_interface_ptr.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
-#include "net/proxy_resolution/proxy_resolution_service.h"
+#include "net/proxy_resolution/proxy_config_with_annotation.h"
#include "services/network/public/mojom/network_context.mojom.h"
#include <utility>
@@ -65,9 +25,7 @@ ProxyConfigMonitor::ProxyConfigMonitor(PrefService *prefs)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- proxy_config_service_.reset(
- new ProxyConfigServiceQt(
- prefs, base::CreateSingleThreadTaskRunner({ BrowserThread::UI })));
+ proxy_config_service_.reset(new ProxyConfigServiceQt(prefs, content::GetUIThreadTaskRunner({})));
proxy_config_service_->AddObserver(this);
}
diff --git a/src/core/net/proxy_config_monitor.h b/src/core/net/proxy_config_monitor.h
index fda6a6fb9..585e4b7ed 100644
--- a/src/core/net/proxy_config_monitor.h
+++ b/src/core/net/proxy_config_monitor.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// originally based on chrome/browser/net/proxy_config_monitor.h
// Copyright 2017 The Chromium Authors. All rights reserved.
@@ -46,17 +10,11 @@
#define PROXY_CONFIG_MONITOR_H
#include <memory>
-#include <string>
-#include "base/macros.h"
-#include "build/buildflag.h"
-#include "extensions/buildflags/buildflags.h"
#include "mojo/public/cpp/bindings/receiver_set.h"
#include "mojo/public/cpp/bindings/remote_set.h"
#include "net/proxy_resolution/proxy_config_service.h"
#include "services/network/public/mojom/network_context.mojom-forward.h"
-#include "services/network/public/mojom/network_service.mojom-forward.h"
-#include "services/network/public/mojom/proxy_config.mojom-forward.h"
#include "services/network/public/mojom/proxy_config_with_annotation.mojom.h"
namespace net {
@@ -96,8 +54,6 @@ private:
mojo::ReceiverSet<network::mojom::ProxyConfigPollerClient> poller_receiver_set_;
mojo::RemoteSet<network::mojom::ProxyConfigClient> proxy_config_client_set_;
-
- DISALLOW_COPY_AND_ASSIGN(ProxyConfigMonitor);
};
-#endif // !PROXY_CONFIG_MONITOR_H
+#endif // PROXY_CONFIG_MONITOR_H
diff --git a/src/core/net/proxy_config_service_qt.cpp b/src/core/net/proxy_config_service_qt.cpp
index 59884961d..fcce08550 100644
--- a/src/core/net/proxy_config_service_qt.cpp
+++ b/src/core/net/proxy_config_service_qt.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
//================ Based on ChromeProxyConfigService =======================
@@ -45,23 +9,22 @@
#include "proxy_config_service_qt.h"
-#include "base/bind.h"
#include "components/proxy_config/pref_proxy_config_tracker_impl.h"
-#include "content/public/browser/browser_thread.h"
-#include "net/proxy_resolution/proxy_resolution_service.h"
+#include "net/base/proxy_server.h"
-using content::BrowserThread;
+#include <QNetworkProxy>
net::ProxyServer ProxyConfigServiceQt::fromQNetworkProxy(const QNetworkProxy &qtProxy)
{
- net::HostPortPair hostPortPair(qtProxy.hostName().toStdString(), qtProxy.port());
+ std::string host = qtProxy.hostName().toStdString();
+ uint16_t port = qtProxy.port();
switch (qtProxy.type()) {
case QNetworkProxy::Socks5Proxy:
- return net::ProxyServer(net::ProxyServer::SCHEME_SOCKS5, hostPortPair);
+ return net::ProxyServer::FromSchemeHostAndPort(net::ProxyServer::SCHEME_SOCKS5, host, port);
case QNetworkProxy::HttpProxy:
case QNetworkProxy::HttpCachingProxy:
case QNetworkProxy::FtpCachingProxy:
- return net::ProxyServer(net::ProxyServer::SCHEME_HTTP, hostPortPair);
+ return net::ProxyServer::FromSchemeHostAndPort(net::ProxyServer::SCHEME_HTTP, host, port);
case QNetworkProxy::NoProxy:
case QNetworkProxy::DefaultProxy:
return net::ProxyServer(net::ProxyServer::SCHEME_DIRECT, net::HostPortPair());
@@ -71,8 +34,8 @@ net::ProxyServer ProxyConfigServiceQt::fromQNetworkProxy(const QNetworkProxy &qt
}
ProxyConfigServiceQt::ProxyConfigServiceQt(PrefService *prefService,
- const scoped_refptr<base::SingleThreadTaskRunner> &taskRunner)
- : m_baseService(net::ProxyResolutionService::CreateSystemProxyConfigService(taskRunner))
+ const scoped_refptr<base::SequencedTaskRunner> &taskRunner)
+ : m_baseService(net::ProxyConfigService::CreateSystemProxyConfigService(taskRunner))
, m_usesSystemConfiguration(false)
, m_registeredObserver(false)
, m_prefState(prefService
diff --git a/src/core/net/proxy_config_service_qt.h b/src/core/net/proxy_config_service_qt.h
index c0928bc03..49c9877a5 100644
--- a/src/core/net/proxy_config_service_qt.h
+++ b/src/core/net/proxy_config_service_qt.h
@@ -1,49 +1,11 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef PROXY_CONFIG_SERVICE_QT_H
#define PROXY_CONFIG_SERVICE_QT_H
-#include "base/memory/ref_counted.h"
#include "base/observer_list.h"
-#include "base/single_thread_task_runner.h"
-
+#include "base/task/sequenced_task_runner.h"
#include "net/proxy_resolution/proxy_config.h"
#include "net/proxy_resolution/proxy_config_service.h"
#include "net/proxy_resolution/proxy_config_with_annotation.h"
@@ -61,7 +23,7 @@ public:
static net::ProxyServer fromQNetworkProxy(const QNetworkProxy &);
explicit ProxyConfigServiceQt(PrefService *prefService,
- const scoped_refptr<base::SingleThreadTaskRunner> &taskRunner);
+ const scoped_refptr<base::SequencedTaskRunner> &taskRunner);
~ProxyConfigServiceQt() override;
// ProxyConfigService implementation:
@@ -97,8 +59,6 @@ private:
ProxyPrefs::ConfigState m_prefState;
SEQUENCE_CHECKER(m_sequenceChecker);
-
- DISALLOW_COPY_AND_ASSIGN(ProxyConfigServiceQt);
};
#endif // PROXY_CONFIG_SERVICE_QT_H
diff --git a/src/core/net/proxying_restricted_cookie_manager_qt.cpp b/src/core/net/proxying_restricted_cookie_manager_qt.cpp
index 7ee6c2a15..d4d5cc4ab 100644
--- a/src/core/net/proxying_restricted_cookie_manager_qt.cpp
+++ b/src/core/net/proxying_restricted_cookie_manager_qt.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// originally based on android_webview/browser/network_service/aw_proxying_restricted_cookie_manager.cc:
// Copyright 2019 The Chromium Authors. All rights reserved.
@@ -46,61 +10,27 @@
#include "api/qwebenginecookiestore.h"
#include "api/qwebenginecookiestore_p.h"
-#include "profile_adapter.h"
-#include "profile_qt.h"
+#include "profile_io_data_qt.h"
#include "type_conversion.h"
#include "base/memory/ptr_util.h"
-#include "base/task/post_task.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
namespace QtWebEngineCore {
-class ProxyingRestrictedCookieManagerListenerQt : public network::mojom::CookieChangeListener {
-public:
- ProxyingRestrictedCookieManagerListenerQt(const GURL &url,
- const GURL &site_for_cookies,
- const url::Origin &top_frame_origin,
- base::WeakPtr<ProxyingRestrictedCookieManagerQt> restricted_cookie_manager,
- mojo::PendingRemote<network::mojom::CookieChangeListener> client_listener)
- : url_(url)
- , site_for_cookies_(site_for_cookies)
- , top_frame_origin_(top_frame_origin)
- , restricted_cookie_manager_(restricted_cookie_manager)
- , client_listener_(std::move(client_listener))
- {}
-
- void OnCookieChange(const net::CookieChangeInfo &change) override
- {
- if (restricted_cookie_manager_ && restricted_cookie_manager_->allowCookies(url_, site_for_cookies_))
- client_listener_->OnCookieChange(change);
- }
-
-private:
- const GURL url_;
- const GURL site_for_cookies_;
- const url::Origin top_frame_origin_;
- base::WeakPtr<ProxyingRestrictedCookieManagerQt> restricted_cookie_manager_;
- mojo::Remote<network::mojom::CookieChangeListener> client_listener_;
-};
-
// static
void ProxyingRestrictedCookieManagerQt::CreateAndBind(ProfileIODataQt *profileIoData,
mojo::PendingRemote<network::mojom::RestrictedCookieManager> underlying_rcm,
- bool is_service_worker,
- int process_id,
- int frame_id,
mojo::PendingReceiver<network::mojom::RestrictedCookieManager> receiver)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- base::PostTask(FROM_HERE, {content::BrowserThread::IO},
+ content::GetIOThreadTaskRunner({})->PostTask(FROM_HERE,
base::BindOnce(&ProxyingRestrictedCookieManagerQt::CreateAndBindOnIoThread,
profileIoData,
std::move(underlying_rcm),
- is_service_worker, process_id, frame_id,
std::move(receiver)));
}
@@ -108,31 +38,21 @@ void ProxyingRestrictedCookieManagerQt::CreateAndBind(ProfileIODataQt *profileIo
// static
void ProxyingRestrictedCookieManagerQt::CreateAndBindOnIoThread(ProfileIODataQt *profileIoData,
mojo::PendingRemote<network::mojom::RestrictedCookieManager> underlying_rcm,
- bool is_service_worker,
- int process_id,
- int frame_id,
mojo::PendingReceiver<network::mojom::RestrictedCookieManager> receiver)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
auto wrapper = base::WrapUnique(new ProxyingRestrictedCookieManagerQt(
profileIoData->getWeakPtrOnIOThread(),
- std::move(underlying_rcm),
- is_service_worker, process_id, frame_id));
+ std::move(underlying_rcm)));
mojo::MakeSelfOwnedReceiver(std::move(wrapper), std::move(receiver));
}
ProxyingRestrictedCookieManagerQt::ProxyingRestrictedCookieManagerQt(
base::WeakPtr<ProfileIODataQt> profileIoData,
- mojo::PendingRemote<network::mojom::RestrictedCookieManager> underlyingRestrictedCookieManager,
- bool is_service_worker,
- int32_t process_id,
- int32_t frame_id)
+ mojo::PendingRemote<network::mojom::RestrictedCookieManager> underlyingRestrictedCookieManager)
: m_profileIoData(std::move(profileIoData))
, underlying_restricted_cookie_manager_(std::move(underlyingRestrictedCookieManager))
- , is_service_worker_(is_service_worker)
- , process_id_(process_id)
- , frame_id_(frame_id)
, weak_factory_(this)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
@@ -144,98 +64,99 @@ ProxyingRestrictedCookieManagerQt::~ProxyingRestrictedCookieManagerQt()
}
void ProxyingRestrictedCookieManagerQt::GetAllForUrl(const GURL &url,
- const GURL &site_for_cookies,
- const url::Origin &top_frame_origin,
+ const net::SiteForCookies &site_for_cookies,
+ const url::Origin &top_frame_origin, bool has_storage_access,
network::mojom::CookieManagerGetOptionsPtr options,
GetAllForUrlCallback callback)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
if (allowCookies(url, site_for_cookies)) {
- underlying_restricted_cookie_manager_->GetAllForUrl(url, site_for_cookies, top_frame_origin, std::move(options), std::move(callback));
+ underlying_restricted_cookie_manager_->GetAllForUrl(url, site_for_cookies, top_frame_origin, has_storage_access,
+ std::move(options), std::move(callback));
} else {
- std::move(callback).Run(std::vector<net::CanonicalCookie>());
+ std::move(callback).Run(std::vector<net::CookieWithAccessResult>());
}
}
void ProxyingRestrictedCookieManagerQt::SetCanonicalCookie(const net::CanonicalCookie &cookie,
const GURL &url,
- const GURL &site_for_cookies, const url::Origin &top_frame_origin,
+ const net::SiteForCookies &site_for_cookies,
+ const url::Origin &top_frame_origin,
+ bool has_storage_access,
+ net::CookieInclusionStatus status,
SetCanonicalCookieCallback callback)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
if (allowCookies(url, site_for_cookies)) {
- underlying_restricted_cookie_manager_->SetCanonicalCookie(cookie, url, site_for_cookies, top_frame_origin, std::move(callback));
+ underlying_restricted_cookie_manager_->SetCanonicalCookie(cookie, url, site_for_cookies, top_frame_origin,
+ has_storage_access, status, std::move(callback));
} else {
std::move(callback).Run(false);
}
}
void ProxyingRestrictedCookieManagerQt::AddChangeListener(const GURL &url,
- const GURL &site_for_cookies,
+ const net::SiteForCookies &site_for_cookies,
const url::Origin &top_frame_origin,
+ bool has_storage_access,
mojo::PendingRemote<network::mojom::CookieChangeListener> listener,
AddChangeListenerCallback callback)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
-
- mojo::PendingRemote<network::mojom::CookieChangeListener> proxy_listener_remote;
- auto proxy_listener =
- std::make_unique<ProxyingRestrictedCookieManagerListenerQt>(
- url, site_for_cookies, top_frame_origin,
- weak_factory_.GetWeakPtr(),
- std::move(listener));
-
- mojo::MakeSelfOwnedReceiver(std::move(proxy_listener),
- proxy_listener_remote.InitWithNewPipeAndPassReceiver());
-
- underlying_restricted_cookie_manager_->AddChangeListener(url, site_for_cookies, top_frame_origin, std::move(proxy_listener_remote), std::move(callback));
+ underlying_restricted_cookie_manager_->AddChangeListener(url, site_for_cookies, top_frame_origin, has_storage_access,
+ std::move(listener), std::move(callback));
}
void ProxyingRestrictedCookieManagerQt::SetCookieFromString(const GURL &url,
- const GURL &site_for_cookies,
- const url::Origin &top_frame_origin,
+ const net::SiteForCookies &site_for_cookies,
+ const url::Origin &top_frame_origin, bool has_storage_access,
const std::string &cookie,
SetCookieFromStringCallback callback)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
if (allowCookies(url, site_for_cookies)) {
- underlying_restricted_cookie_manager_->SetCookieFromString(url, site_for_cookies, top_frame_origin, cookie, std::move(callback));
+ underlying_restricted_cookie_manager_->SetCookieFromString(url, site_for_cookies, top_frame_origin, has_storage_access,
+ cookie, std::move(callback));
} else {
- std::move(callback).Run();
+ std::move(callback).Run(false, false); // FIXME: is true, true in aw_proxying_restricted_cookie_manager.cc though..
}
}
void ProxyingRestrictedCookieManagerQt::GetCookiesString(const GURL &url,
- const GURL &site_for_cookies,
+ const net::SiteForCookies &site_for_cookies,
const url::Origin &top_frame_origin,
+ bool has_storage_access, bool get_version_shared_memory,
GetCookiesStringCallback callback)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
if (allowCookies(url, site_for_cookies)) {
- underlying_restricted_cookie_manager_->GetCookiesString(url, site_for_cookies, top_frame_origin, std::move(callback));
+ underlying_restricted_cookie_manager_->GetCookiesString(url, site_for_cookies, top_frame_origin,
+ has_storage_access, get_version_shared_memory,
+ std::move(callback));
} else {
- std::move(callback).Run("");
+ std::move(callback).Run(network::mojom::kInvalidCookieVersion, base::ReadOnlySharedMemoryRegion(), "");
}
}
void ProxyingRestrictedCookieManagerQt::CookiesEnabledFor(const GURL &url,
- const GURL &site_for_cookies,
+ const net::SiteForCookies &site_for_cookies,
const url::Origin & /*top_frame_origin*/,
+ bool /*has_storage_access*/,
CookiesEnabledForCallback callback)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
std::move(callback).Run(allowCookies(url, site_for_cookies));
}
-bool ProxyingRestrictedCookieManagerQt::allowCookies(const GURL &url, const GURL &site_for_cookies) const
+bool ProxyingRestrictedCookieManagerQt::allowCookies(const GURL &url, const net::SiteForCookies &site_for_cookies) const
{
if (!m_profileIoData)
return false;
- return m_profileIoData->canGetCookies(toQt(site_for_cookies), toQt(url));
+ return m_profileIoData->canGetCookies(toQt(site_for_cookies.first_party_url()), toQt(url));
}
} // namespace QtWebEngineCore
diff --git a/src/core/net/proxying_restricted_cookie_manager_qt.h b/src/core/net/proxying_restricted_cookie_manager_qt.h
index b682075ed..faf0545c3 100644
--- a/src/core/net/proxying_restricted_cookie_manager_qt.h
+++ b/src/core/net/proxying_restricted_cookie_manager_qt.h
@@ -1,46 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef PROXYING_RESTRICTED_COOKIE_MANAGER_QT_H
#define PROXYING_RESTRICTED_COOKIE_MANAGER_QT_H
-#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "services/network/public/mojom/restricted_cookie_manager.mojom.h"
@@ -56,70 +19,64 @@ public:
// Expects to be called on the UI thread.
static void CreateAndBind(ProfileIODataQt *profileIoData,
mojo::PendingRemote<network::mojom::RestrictedCookieManager> underlying_rcm,
- bool is_service_worker,
- int process_id,
- int frame_id,
mojo::PendingReceiver<network::mojom::RestrictedCookieManager> receiver);
~ProxyingRestrictedCookieManagerQt() override;
// network::mojom::RestrictedCookieManager interface:
void GetAllForUrl(const GURL &url,
- const GURL &site_for_cookies,
+ const net::SiteForCookies &site_for_cookies,
const url::Origin &top_frame_origin,
+ bool has_storage_access,
network::mojom::CookieManagerGetOptionsPtr options,
GetAllForUrlCallback callback) override;
+
void SetCanonicalCookie(const net::CanonicalCookie& cookie,
const GURL &url,
- const GURL &site_for_cookies,
+ const net::SiteForCookies &site_for_cookies,
const url::Origin &top_frame_origin,
+ bool has_storage_access,
+ net::CookieInclusionStatus status,
SetCanonicalCookieCallback callback) override;
void AddChangeListener(const GURL &url,
- const GURL &site_for_cookies,
+ const net::SiteForCookies &site_for_cookies,
const url::Origin &top_frame_origin,
+ bool has_storage_access,
mojo::PendingRemote<network::mojom::CookieChangeListener> listener,
AddChangeListenerCallback callback) override;
void SetCookieFromString(const GURL &url,
- const GURL &site_for_cookies,
+ const net::SiteForCookies &site_for_cookies,
const url::Origin &top_frame_origin,
+ bool has_storage_access,
const std::string &cookie,
SetCookieFromStringCallback callback) override;
void GetCookiesString(const GURL &url,
- const GURL &site_for_cookies,
+ const net::SiteForCookies &site_for_cookies,
const url::Origin &top_frame_origin,
+ bool has_storage_access, bool get_version_shared_memory,
GetCookiesStringCallback callback) override;
void CookiesEnabledFor(const GURL &url,
- const GURL &site_for_cookies,
+ const net::SiteForCookies &site_for_cookies,
const url::Origin &top_frame_origin,
+ bool has_storage_access,
CookiesEnabledForCallback callback) override;
// Internal:
- bool allowCookies(const GURL &url, const GURL &site_for_cookies) const;
+ bool allowCookies(const GURL &url, const net::SiteForCookies &site_for_cookies) const;
private:
ProxyingRestrictedCookieManagerQt(base::WeakPtr<ProfileIODataQt> profileIoData,
- mojo::PendingRemote<network::mojom::RestrictedCookieManager> underlying_rcm,
- bool is_service_worker,
- int32_t process_id,
- int32_t frame_id);
+ mojo::PendingRemote<network::mojom::RestrictedCookieManager> underlying_rcm);
static void CreateAndBindOnIoThread(ProfileIODataQt *profileIoData,
mojo::PendingRemote<network::mojom::RestrictedCookieManager> underlying_rcm,
- bool is_service_worker,
- int process_id,
- int frame_id,
mojo::PendingReceiver<network::mojom::RestrictedCookieManager> receiver);
base::WeakPtr<ProfileIODataQt> m_profileIoData;
mojo::Remote<network::mojom::RestrictedCookieManager> underlying_restricted_cookie_manager_;
- bool is_service_worker_;
- int process_id_;
- int frame_id_;
base::WeakPtrFactory<ProxyingRestrictedCookieManagerQt> weak_factory_;
-
- DISALLOW_COPY_AND_ASSIGN(ProxyingRestrictedCookieManagerQt);
};
} // namespace QtWebEngineCore
diff --git a/src/core/net/proxying_url_loader_factory_qt.cpp b/src/core/net/proxying_url_loader_factory_qt.cpp
index b42aa64bb..3a83ed7ea 100644
--- a/src/core/net/proxying_url_loader_factory_qt.cpp
+++ b/src/core/net/proxying_url_loader_factory_qt.cpp
@@ -1,83 +1,77 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "proxying_url_loader_factory_qt.h"
#include <utility>
-#include "base/bind.h"
-#include "base/strings/string_number_conversions.h"
-#include "base/strings/stringprintf.h"
-#include "base/task/post_task.h"
-#include "components/safe_browsing/common/safebrowsing_constants.h"
+#include "base/functional/bind.h"
#include "content/browser/web_contents/web_contents_impl.h"
-#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
-#include "content/public/browser/global_request_id.h"
-#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h"
-#include "content/public/common/content_constants.h"
-#include "content/public/common/url_utils.h"
-#include "net/base/load_flags.h"
+#include "content/public/common/content_switches.h"
+#include "net/base/filename_util.h"
#include "net/http/http_status_code.h"
-#include "net/http/http_util.h"
+#include "services/network/public/cpp/cors/cors.h"
+#include "services/network/public/cpp/resource_request.h"
+#include "services/network/public/mojom/early_hints.mojom.h"
+#include "third_party/blink/public/mojom/loader/resource_load_info.mojom-shared.h"
+#include "url/url_util.h"
+#include "url/url_util_qt.h"
#include "api/qwebengineurlrequestinfo_p.h"
-#include "profile_qt.h"
#include "type_conversion.h"
+#include "web_contents_adapter.h"
#include "web_contents_adapter_client.h"
#include "web_contents_view_qt.h"
-
-#include <QVariant>
+#include "net/resource_request_body_qt.h"
// originally based on aw_proxying_url_loader_factory.cc:
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+namespace {
+ network::mojom::URLResponseHeadPtr createResponse(const network::ResourceRequest &request) {
+ const bool disable_web_security = base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableWebSecurity);
+ network::mojom::URLResponseHeadPtr response = network::mojom::URLResponseHead::New();
+ response->response_type = network::cors::CalculateResponseType(
+ request.mode, disable_web_security || (
+ request.request_initiator && request.request_initiator->IsSameOriginWith(url::Origin::Create(request.url))));
+
+ return response;
+ }
+}
+
namespace QtWebEngineCore {
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeMainFrame, blink::mojom::ResourceType::kMainFrame)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeSubFrame, blink::mojom::ResourceType::kSubFrame)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeStylesheet, blink::mojom::ResourceType::kStylesheet)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeScript, blink::mojom::ResourceType::kScript)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeImage, blink::mojom::ResourceType::kImage)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeFontResource, blink::mojom::ResourceType::kFontResource)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeSubResource, blink::mojom::ResourceType::kSubResource)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeObject, blink::mojom::ResourceType::kObject)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeMedia, blink::mojom::ResourceType::kMedia)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeWorker, blink::mojom::ResourceType::kWorker)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeSharedWorker, blink::mojom::ResourceType::kSharedWorker)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypePrefetch, blink::mojom::ResourceType::kPrefetch)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeFavicon, blink::mojom::ResourceType::kFavicon)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeXhr, blink::mojom::ResourceType::kXhr)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypePing, blink::mojom::ResourceType::kPing)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeServiceWorker, blink::mojom::ResourceType::kServiceWorker)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeCspReport, blink::mojom::ResourceType::kCspReport)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypePluginResource, blink::mojom::ResourceType::kPluginResource)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeNavigationPreloadMainFrame, blink::mojom::ResourceType::kNavigationPreloadMainFrame)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeNavigationPreloadSubFrame, blink::mojom::ResourceType::kNavigationPreloadSubFrame)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeLast, blink::mojom::ResourceType::kMaxValue)
+
extern WebContentsAdapterClient::NavigationType pageTransitionToNavigationType(ui::PageTransition transition);
-static QWebEngineUrlRequestInfo::ResourceType toQt(content::ResourceType resourceType)
+static QWebEngineUrlRequestInfo::ResourceType toQt(blink::mojom::ResourceType resourceType)
{
- if (resourceType >= content::ResourceType::kMainFrame && resourceType <= content::ResourceType::kMaxValue)
+ if (resourceType >= blink::mojom::ResourceType::kMinValue && resourceType <= blink::mojom::ResourceType::kMaxValue)
return static_cast<QWebEngineUrlRequestInfo::ResourceType>(resourceType);
return QWebEngineUrlRequestInfo::ResourceTypeUnknown;
}
@@ -87,17 +81,28 @@ static QWebEngineUrlRequestInfo::NavigationType toQt(WebContentsAdapterClient::N
return static_cast<QWebEngineUrlRequestInfo::NavigationType>(navigationType);
}
+static QHash<QByteArray, QByteArray> toQt(const net::HttpRequestHeaders &headers)
+{
+ const auto vector = headers.GetHeaderVector();
+ QHash<QByteArray, QByteArray> hash;
+
+ for (const auto &header : vector) {
+ hash.insert(QByteArray::fromStdString(header.key), QByteArray::fromStdString(header.value));
+ }
+
+ return hash;
+}
+
// Handles intercepted, in-progress requests/responses, so that they can be
// controlled and modified accordingly.
class InterceptedRequest : public network::mojom::URLLoader
, public network::mojom::URLLoaderClient
{
public:
- InterceptedRequest(int process_id, uint64_t request_id, int32_t routing_id, uint32_t options,
+ InterceptedRequest(ProfileAdapter *profile_adapter,
+ int frame_tree_node_id, int32_t request_id, uint32_t options,
const network::ResourceRequest &request,
const net::MutableNetworkTrafficAnnotationTag &traffic_annotation,
- QWebEngineUrlRequestInterceptor *profile_request_interceptor,
- QWebEngineUrlRequestInterceptor *page_request_interceptor,
mojo::PendingReceiver<network::mojom::URLLoader> loader,
mojo::PendingRemote<network::mojom::URLLoaderClient> client,
mojo::PendingRemote<network::mojom::URLLoaderFactory> target_factory);
@@ -106,24 +111,24 @@ public:
void Restart();
// network::mojom::URLLoaderClient
- void OnReceiveResponse(network::mojom::URLResponseHeadPtr head) override;
+ void OnReceiveResponse(network::mojom::URLResponseHeadPtr head, mojo::ScopedDataPipeConsumerHandle, absl::optional<mojo_base::BigBuffer>) override;
void OnReceiveRedirect(const net::RedirectInfo &redirect_info, network::mojom::URLResponseHeadPtr head) override;
void OnUploadProgress(int64_t current_position, int64_t total_size, OnUploadProgressCallback callback) override;
- void OnReceiveCachedMetadata(mojo_base::BigBuffer data) override;
void OnTransferSizeUpdated(int32_t transfer_size_diff) override;
- void OnStartLoadingResponseBody(mojo::ScopedDataPipeConsumerHandle body) override;
void OnComplete(const network::URLLoaderCompletionStatus &status) override;
+ void OnReceiveEarlyHints(network::mojom::EarlyHintsPtr) override {}
// network::mojom::URLLoader
void FollowRedirect(const std::vector<std::string> &removed_headers,
- const net::HttpRequestHeaders &modified_headers, const base::Optional<GURL> &new_url) override;
+ const net::HttpRequestHeaders &modified_headers,
+ const net::HttpRequestHeaders &modified_cors_exempt_headers,
+ const absl::optional<GURL> &new_url) override;
void SetPriority(net::RequestPriority priority, int32_t intra_priority_value) override;
void PauseReadingBodyFromNet() override;
void ResumeReadingBodyFromNet() override;
private:
void InterceptOnUIThread();
- void InterceptOnIOThread(base::WaitableEvent *event);
void ContinueAfterIntercept();
// This is called when the original URLLoaderClient has a connection error.
@@ -139,25 +144,39 @@ private:
void SendErrorAndCompleteImmediately(int error_code);
- const int process_id_;
- const uint64_t request_id_;
- const int32_t routing_id_;
+ content::WebContents* webContents();
+ QWebEngineUrlRequestInterceptor* getProfileInterceptor();
+ QWebEngineUrlRequestInterceptor* getPageInterceptor();
+
+ QPointer<ProfileAdapter> profile_adapter_;
+ const int frame_tree_node_id_;
+ const int32_t request_id_;
const uint32_t options_;
- bool input_stream_previously_failed_ = false;
- bool request_was_redirected_ = false;
+ bool allow_local_ = false;
+ bool allow_remote_ = true;
+ bool local_access_ = false;
+ bool remote_access_ = true;
+
+ bool loader_error_seen_ = false;
// If the |target_loader_| called OnComplete with an error this stores it.
// That way the destructor can send it to OnReceivedError if safe browsing
// error didn't occur.
int error_status_ = net::OK;
network::ResourceRequest request_;
- network::ResourceResponseHead current_response_;
+ ResourceRequestBody request_body_;
+ network::mojom::URLResponseHeadPtr current_response_;
const net::MutableNetworkTrafficAnnotationTag traffic_annotation_;
- QWebEngineUrlRequestInfo request_info_;
- QPointer<QWebEngineUrlRequestInterceptor> profile_request_interceptor_;
- QPointer<QWebEngineUrlRequestInterceptor> page_request_interceptor_;
+ struct RequestInfoDeleter
+ {
+ void operator()(QWebEngineUrlRequestInfo *ptr) const
+ { delete ptr; }
+ };
+
+ std::unique_ptr<QWebEngineUrlRequestInfo, RequestInfoDeleter> request_info_;
+
mojo::Receiver<network::mojom::URLLoader> proxied_loader_receiver_;
mojo::Remote<network::mojom::URLLoaderClient> target_client_;
mojo::Receiver<network::mojom::URLLoaderClient> proxied_client_receiver_{this};
@@ -165,35 +184,52 @@ private:
mojo::Remote<network::mojom::URLLoaderFactory> target_factory_;
base::WeakPtrFactory<InterceptedRequest> weak_factory_;
- DISALLOW_COPY_AND_ASSIGN(InterceptedRequest);
};
-InterceptedRequest::InterceptedRequest(int process_id, uint64_t request_id, int32_t routing_id, uint32_t options,
+InterceptedRequest::InterceptedRequest(ProfileAdapter *profile_adapter,
+ int frame_tree_node_id, int32_t request_id, uint32_t options,
const network::ResourceRequest &request,
const net::MutableNetworkTrafficAnnotationTag &traffic_annotation,
- QWebEngineUrlRequestInterceptor *profile_request_interceptor,
- QWebEngineUrlRequestInterceptor *page_request_interceptor,
mojo::PendingReceiver<network::mojom::URLLoader> loader_receiver,
mojo::PendingRemote<network::mojom::URLLoaderClient> client,
mojo::PendingRemote<network::mojom::URLLoaderFactory> target_factory)
- : process_id_(process_id)
+ : profile_adapter_(profile_adapter)
+ , frame_tree_node_id_(frame_tree_node_id)
, request_id_(request_id)
- , routing_id_(routing_id)
, options_(options)
, request_(request)
+ , request_body_(ResourceRequestBody(request_.request_body.get()))
, traffic_annotation_(traffic_annotation)
- , profile_request_interceptor_(profile_request_interceptor)
- , page_request_interceptor_(page_request_interceptor)
, proxied_loader_receiver_(this, std::move(loader_receiver))
, target_client_(std::move(client))
, target_factory_(std::move(target_factory))
, weak_factory_(this)
{
+ const bool disable_web_security = base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableWebSecurity);
+ current_response_ = createResponse(request_);
// If there is a client error, clean up the request.
target_client_.set_disconnect_handler(
- base::BindOnce(&InterceptedRequest::OnURLLoaderClientError, weak_factory_.GetWeakPtr()));
+ base::BindOnce(&InterceptedRequest::OnURLLoaderClientError, base::Unretained(this)));
proxied_loader_receiver_.set_disconnect_with_reason_handler(
- base::BindOnce(&InterceptedRequest::OnURLLoaderError, weak_factory_.GetWeakPtr()));
+ base::BindOnce(&InterceptedRequest::OnURLLoaderError, base::Unretained(this)));
+ if (!disable_web_security && request_.request_initiator) {
+ const std::vector<std::string> &localSchemes = url::GetLocalSchemes();
+ const std::string fromScheme = request_.request_initiator->GetTupleOrPrecursorTupleIfOpaque().scheme();
+ const std::string toScheme = request_.url.scheme();
+ const bool fromLocal = base::Contains(localSchemes, fromScheme);
+ const bool toLocal = base::Contains(localSchemes, toScheme);
+ bool hasLocalAccess = false;
+ local_access_ = toLocal;
+ remote_access_ = !toLocal && (toScheme != "data") && (toScheme != "qrc");
+ if (const url::CustomScheme *cs = url::CustomScheme::FindScheme(fromScheme))
+ hasLocalAccess = cs->flags & url::CustomScheme::LocalAccessAllowed;
+ if (fromLocal || toLocal) {
+ content::WebContents *wc = webContents();
+ // local schemes must have universal access, or be accessing something local and have local access.
+ allow_local_ = hasLocalAccess || (fromLocal && wc && wc->GetOrCreateWebPreferences().allow_file_access_from_file_urls);
+ allow_remote_ = !fromLocal || (wc && wc->GetOrCreateWebPreferences().allow_remote_access_from_local_urls);
+ }
+ }
}
InterceptedRequest::~InterceptedRequest()
@@ -201,115 +237,175 @@ InterceptedRequest::~InterceptedRequest()
weak_factory_.InvalidateWeakPtrs();
}
+content::WebContents* InterceptedRequest::webContents()
+{
+ if (frame_tree_node_id_ == content::RenderFrameHost::kNoFrameTreeNodeId)
+ return nullptr;
+ return content::WebContents::FromFrameTreeNodeId(frame_tree_node_id_);
+}
+
+QWebEngineUrlRequestInterceptor* InterceptedRequest::getProfileInterceptor()
+{
+ return profile_adapter_ ? profile_adapter_->requestInterceptor() : nullptr;
+}
+
+QWebEngineUrlRequestInterceptor* InterceptedRequest::getPageInterceptor()
+{
+ if (auto wc = webContents()) {
+ auto view = static_cast<content::WebContentsImpl *>(wc)->GetView();
+ if (WebContentsAdapterClient *client = WebContentsViewQt::from(view)->client())
+ return client->webContentsAdapter()->requestInterceptor();
+ }
+ return nullptr;
+}
+
void InterceptedRequest::Restart()
{
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- content::ResourceType resourceType = content::ResourceType(request_.resource_type);
- WebContentsAdapterClient::NavigationType navigationType =
- pageTransitionToNavigationType(ui::PageTransition(request_.transition_type));
- const QUrl originalUrl = toQt(request_.url);
- const QUrl initiator = request_.request_initiator.has_value() ? toQt(request_.request_initiator->GetURL()) : QUrl();
+ bool granted_special_access = false;
+ auto navigationType = toQt(pageTransitionToNavigationType(ui::PageTransition(request_.transition_type)));
+ switch (navigationType) {
+ case QWebEngineUrlRequestInfo::NavigationTypeLink:
+ case QWebEngineUrlRequestInfo::NavigationTypeTyped:
+ if (blink::mojom::ResourceType(request_.resource_type) == blink::mojom::ResourceType::kMainFrame && request_.has_user_gesture)
+ granted_special_access = true; // allow normal explicit navigation
+ break;
+ case QWebEngineUrlRequestInfo::NavigationTypeBackForward:
+ case QWebEngineUrlRequestInfo::NavigationTypeReload:
+ if (blink::mojom::ResourceType(request_.resource_type) == blink::mojom::ResourceType::kMainFrame)
+ granted_special_access = true;
+ break;
+ default:
+ break;
+ }
- content::WebContents *webContents = nullptr;
- if (process_id_) {
- content::RenderFrameHost *frameHost = content::RenderFrameHost::FromID(process_id_, request_.render_frame_id);
- webContents = content::WebContents::FromRenderFrameHost(frameHost);
- } else {
- webContents = content::WebContents::FromFrameTreeNodeId(request_.render_frame_id);
+ // Check if non-local access is allowed
+ if (!allow_remote_ && remote_access_) {
+ if (!granted_special_access) {
+ target_client_->OnComplete(network::URLLoaderCompletionStatus(net::ERR_NETWORK_ACCESS_DENIED));
+ delete this;
+ return;
+ }
+ }
+
+ // Check if local access is allowed
+ if (!allow_local_ && local_access_) {
+ // Check for specifically granted file access:
+ if (auto *frame_tree = content::FrameTreeNode::GloballyFindByID(frame_tree_node_id_)) {
+ const int renderer_id = frame_tree->current_frame_host()->GetProcess()->GetID();
+ base::FilePath file_path;
+ if (net::FileURLToFilePath(request_.url, &file_path)) {
+ if (content::ChildProcessSecurityPolicy::GetInstance()->CanReadFile(renderer_id, file_path))
+ granted_special_access = true;
+ }
+ }
+ if (!granted_special_access) {
+ target_client_->OnComplete(network::URLLoaderCompletionStatus(net::ERR_ACCESS_DENIED));
+ delete this;
+ return;
+ }
+ }
+
+ // MEMO since all codepatch leading to Restart scheduled and executed as asynchronous tasks in main thread,
+ // interceptors may change in meantime and also during intercept call, so they should be resolved anew.
+ // Set here only profile's interceptor since it runs first without going to user code.
+ auto profileInterceptor = getProfileInterceptor();
+ if (!profileInterceptor && !getPageInterceptor()) {
+ ContinueAfterIntercept();
+ return;
}
- GURL top_document_url = webContents ? webContents->GetLastCommittedURL() : GURL();
+ auto resourceType = toQt(blink::mojom::ResourceType(request_.resource_type));
+ const QUrl originalUrl = toQt(request_.url);
+ const QUrl initiator = request_.request_initiator.has_value() ? toQt(request_.request_initiator->GetURL()) : QUrl();
+
+ auto wc = webContents();
+ GURL top_document_url = wc ? wc->GetVisibleURL() : GURL();
QUrl firstPartyUrl;
if (!top_document_url.is_empty())
firstPartyUrl = toQt(top_document_url);
else
- firstPartyUrl = toQt(request_.site_for_cookies); // m_topDocumentUrl can be empty for the main-frame.
-
- QWebEngineUrlRequestInfoPrivate *infoPrivate =
- new QWebEngineUrlRequestInfoPrivate(toQt(resourceType), toQt(navigationType), originalUrl, firstPartyUrl,
- initiator, QByteArray::fromStdString(request_.method));
- request_info_ = QWebEngineUrlRequestInfo(infoPrivate);
-
- // TODO: remove for Qt6
- if (profile_request_interceptor_ && profile_request_interceptor_->property("deprecated").toBool()) {
- // sync call supports depracated call of an interceptor on io thread
- base::WaitableEvent event;
- base::PostTask(FROM_HERE, { content::BrowserThread::IO },
- base::BindOnce(&InterceptedRequest::InterceptOnIOThread, base::Unretained(this), &event));
- event.Wait();
- if (request_info_.changed()) {
- ContinueAfterIntercept();
- return;
- }
- }
+ firstPartyUrl = toQt(request_.site_for_cookies.first_party_url()); // m_topDocumentUrl can be empty for the main-frame.
+
+ QHash<QByteArray, QByteArray> headers = toQt(request_.headers);
+
+ if (!request_.referrer.is_empty())
+ headers.insert("Referer", toQt(request_.referrer).toEncoded());
+
+ auto info = new QWebEngineUrlRequestInfoPrivate(
+ resourceType, navigationType, originalUrl, firstPartyUrl, initiator,
+ QByteArray::fromStdString(request_.method), &request_body_, headers);
+ Q_ASSERT(!request_info_);
+ request_info_.reset(new QWebEngineUrlRequestInfo(info));
+
InterceptOnUIThread();
ContinueAfterIntercept();
}
-void InterceptedRequest::InterceptOnIOThread(base::WaitableEvent *event)
-{
- DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
- if (profile_request_interceptor_)
- profile_request_interceptor_->interceptRequest(request_info_);
- event->Signal();
-}
-
void InterceptedRequest::InterceptOnUIThread()
{
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- if (profile_request_interceptor_)
- profile_request_interceptor_->interceptRequest(request_info_);
+ if (auto interceptor = getProfileInterceptor())
+ interceptor->interceptRequest(*request_info_);
- if (!request_info_.changed() && page_request_interceptor_)
- page_request_interceptor_->interceptRequest(request_info_);
+ if (!request_info_->changed()) {
+ if (auto interceptor = getPageInterceptor())
+ interceptor->interceptRequest(*request_info_);
+ }
}
void InterceptedRequest::ContinueAfterIntercept()
{
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- if (request_info_.changed()) {
- if (request_info_.d_ptr->shouldBlockRequest)
- return SendErrorAndCompleteImmediately(net::ERR_BLOCKED_BY_CLIENT);
- if (request_info_.d_ptr->shouldRedirectRequest) {
- net::URLRequest::FirstPartyURLPolicy first_party_url_policy =
- request_.update_first_party_url_on_redirect ? net::URLRequest::UPDATE_FIRST_PARTY_URL_ON_REDIRECT
- : net::URLRequest::NEVER_CHANGE_FIRST_PARTY_URL;
- net::RedirectInfo redirectInfo = net::RedirectInfo::ComputeRedirectInfo(
- request_.method, request_.url, request_.site_for_cookies,
- first_party_url_policy, request_.referrer_policy, request_.referrer.spec(),
- net::HTTP_TEMPORARY_REDIRECT, toGurl(request_info_.requestUrl()), base::nullopt,
- false /*insecure_scheme_was_upgraded*/);
-
- // FIXME: Should probably create a new header.
- current_response_.encoded_data_length = 0;
- request_.method = redirectInfo.new_method;
- request_.url = redirectInfo.new_url;
- request_.site_for_cookies = redirectInfo.new_site_for_cookies;
- request_.referrer = GURL(redirectInfo.new_referrer);
- request_.referrer_policy = redirectInfo.new_referrer_policy;
- if (request_.method == net::HttpRequestHeaders::kGetMethod)
- request_.request_body = nullptr;
- target_client_->OnReceiveRedirect(redirectInfo, current_response_);
- return;
+ if (request_info_) {
+ // cleanup in scope because of delete this and it's not needed else where after
+ const auto scoped_request_info = std::move(request_info_);
+ QWebEngineUrlRequestInfoPrivate &info = *scoped_request_info->d_ptr;
+
+ for (auto header = info.extraHeaders.constBegin(); header != info.extraHeaders.constEnd(); ++header) {
+ std::string h = header.key().toStdString();
+ if (base::EqualsCaseInsensitiveASCII(h, "referer"))
+ request_.referrer = GURL(header.value().toStdString());
+ else
+ request_.headers.SetHeader(h, header.value().toStdString());
}
- if (!request_info_.d_ptr->extraHeaders.isEmpty()) {
- auto end = request_info_.d_ptr->extraHeaders.constEnd();
- for (auto header = request_info_.d_ptr->extraHeaders.constBegin(); header != end; ++header) {
- std::string h = header.key().toStdString();
- if (base::LowerCaseEqualsASCII(h, "referer")) {
- request_.referrer = GURL(header.value().toStdString());
- } else {
- request_.headers.SetHeader(h, header.value().toStdString());
- }
+ if (info.changed) {
+ if (info.shouldBlockRequest)
+ return SendErrorAndCompleteImmediately(net::ERR_BLOCKED_BY_CLIENT);
+
+ if (info.shouldRedirectRequest) {
+ net::RedirectInfo::FirstPartyURLPolicy first_party_url_policy =
+ request_.update_first_party_url_on_redirect ? net::RedirectInfo::FirstPartyURLPolicy::UPDATE_URL_ON_REDIRECT
+ : net::RedirectInfo::FirstPartyURLPolicy::NEVER_CHANGE_URL;
+ net::RedirectInfo redirectInfo = net::RedirectInfo::ComputeRedirectInfo(
+ request_.method, request_.url, request_.site_for_cookies,
+ first_party_url_policy, request_.referrer_policy, request_.referrer.spec(),
+ net::HTTP_TEMPORARY_REDIRECT, toGurl(info.url), absl::nullopt,
+ false /*insecure_scheme_was_upgraded*/);
+ request_.method = redirectInfo.new_method;
+ request_.url = redirectInfo.new_url;
+ request_.site_for_cookies = redirectInfo.new_site_for_cookies;
+ request_.referrer = GURL(redirectInfo.new_referrer);
+ request_.referrer_policy = redirectInfo.new_referrer_policy;
+ if (request_.method == net::HttpRequestHeaders::kGetMethod)
+ request_.request_body = nullptr;
+ // In case of multiple sequential rediredts, current_response_ has previously been moved to target_client_
+ // so we create a new one using the redirect url.
+ if (!current_response_)
+ current_response_ = createResponse(request_);
+ current_response_->encoded_data_length = 0;
+ target_client_->OnReceiveRedirect(redirectInfo, std::move(current_response_));
+ return;
}
}
}
if (!target_loader_ && target_factory_) {
- target_factory_->CreateLoaderAndStart(target_loader_.BindNewPipeAndPassReceiver(), routing_id_, request_id_,
+ loader_error_seen_ = false;
+ target_factory_->CreateLoaderAndStart(target_loader_.BindNewPipeAndPassReceiver(), request_id_,
options_, request_, proxied_client_receiver_.BindNewPipeAndPassRemote(),
traffic_annotation_);
}
@@ -317,18 +413,17 @@ void InterceptedRequest::ContinueAfterIntercept()
// URLLoaderClient methods.
-void InterceptedRequest::OnReceiveResponse(network::mojom::URLResponseHeadPtr head)
+void InterceptedRequest::OnReceiveResponse(network::mojom::URLResponseHeadPtr head, mojo::ScopedDataPipeConsumerHandle handle, absl::optional<mojo_base::BigBuffer> buffer)
{
- current_response_ = head;
+ current_response_ = head.Clone();
- target_client_->OnReceiveResponse(std::move(head));
+ target_client_->OnReceiveResponse(std::move(head), std::move(handle), std::move(buffer));
}
void InterceptedRequest::OnReceiveRedirect(const net::RedirectInfo &redirect_info, network::mojom::URLResponseHeadPtr head)
{
// TODO(timvolodine): handle redirect override.
- request_was_redirected_ = true;
- current_response_ = head;
+ current_response_ = head.Clone();
target_client_->OnReceiveRedirect(redirect_info, std::move(head));
request_.url = redirect_info.new_url;
request_.method = redirect_info.new_method;
@@ -342,21 +437,11 @@ void InterceptedRequest::OnUploadProgress(int64_t current_position, int64_t tota
target_client_->OnUploadProgress(current_position, total_size, std::move(callback));
}
-void InterceptedRequest::OnReceiveCachedMetadata(mojo_base::BigBuffer data)
-{
- target_client_->OnReceiveCachedMetadata(std::move(data));
-}
-
void InterceptedRequest::OnTransferSizeUpdated(int32_t transfer_size_diff)
{
target_client_->OnTransferSizeUpdated(transfer_size_diff);
}
-void InterceptedRequest::OnStartLoadingResponseBody(mojo::ScopedDataPipeConsumerHandle body)
-{
- target_client_->OnStartLoadingResponseBody(std::move(body));
-}
-
void InterceptedRequest::OnComplete(const network::URLLoaderCompletionStatus &status)
{
// Only wait for the original loader to possibly have a custom error if the
@@ -369,10 +454,11 @@ void InterceptedRequest::OnComplete(const network::URLLoaderCompletionStatus &st
void InterceptedRequest::FollowRedirect(const std::vector<std::string> &removed_headers,
const net::HttpRequestHeaders &modified_headers,
- const base::Optional<GURL> &new_url)
+ const net::HttpRequestHeaders &modified_cors_exempt_headers,
+ const absl::optional<GURL> &new_url)
{
if (target_loader_)
- target_loader_->FollowRedirect(removed_headers, modified_headers, new_url);
+ target_loader_->FollowRedirect(removed_headers, modified_headers, modified_cors_exempt_headers, new_url);
// If |OnURLLoaderClientError| was called then we're just waiting for the
// connection error handler of |proxied_loader_binding_|. Don't restart the
@@ -414,6 +500,8 @@ void InterceptedRequest::OnURLLoaderError(uint32_t custom_reason, const std::str
// If CallOnComplete was already called, then this object is ready to be deleted.
if (!target_client_)
delete this;
+ else
+ loader_error_seen_ = true;
}
void InterceptedRequest::CallOnComplete(const network::URLLoaderCompletionStatus &status, bool wait_for_loader_error)
@@ -427,7 +515,7 @@ void InterceptedRequest::CallOnComplete(const network::URLLoaderCompletionStatus
if (target_client_)
target_client_->OnComplete(status);
- if (proxied_loader_receiver_.is_bound() && wait_for_loader_error) {
+ if (proxied_loader_receiver_.is_bound() && wait_for_loader_error && !loader_error_seen_) {
// Since the original client is gone no need to continue loading the
// request.
proxied_client_receiver_.reset();
@@ -456,10 +544,10 @@ void InterceptedRequest::SendErrorAndCompleteImmediately(int error_code)
delete this;
}
-ProxyingURLLoaderFactoryQt::ProxyingURLLoaderFactoryQt(int process_id, QWebEngineUrlRequestInterceptor *profile, QWebEngineUrlRequestInterceptor *page,
+ProxyingURLLoaderFactoryQt::ProxyingURLLoaderFactoryQt(ProfileAdapter *adapter, int frame_tree_node_id,
mojo::PendingReceiver<network::mojom::URLLoaderFactory> loader_receiver,
mojo::PendingRemote<network::mojom::URLLoaderFactory> target_factory_info)
- : m_processId(process_id), m_profileRequestInterceptor(profile), m_pageRequestInterceptor(page), m_weakFactory(this)
+ : m_profileAdapter(adapter), m_frameTreeNodeId(frame_tree_node_id), m_weakFactory(this)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
if (target_factory_info) {
@@ -477,8 +565,8 @@ ProxyingURLLoaderFactoryQt::~ProxyingURLLoaderFactoryQt()
m_weakFactory.InvalidateWeakPtrs();
}
-void ProxyingURLLoaderFactoryQt::CreateLoaderAndStart(mojo::PendingReceiver<network::mojom::URLLoader> loader, int32_t routing_id,
- int32_t request_id, uint32_t options, const network::ResourceRequest &request,
+void ProxyingURLLoaderFactoryQt::CreateLoaderAndStart(mojo::PendingReceiver<network::mojom::URLLoader> loader, int32_t request_id,
+ uint32_t options, const network::ResourceRequest &request,
mojo::PendingRemote<network::mojom::URLLoaderClient> url_loader_client,
const net::MutableNetworkTrafficAnnotationTag &traffic_annotation)
{
@@ -488,8 +576,8 @@ void ProxyingURLLoaderFactoryQt::CreateLoaderAndStart(mojo::PendingReceiver<netw
m_targetFactory->Clone(target_factory_clone.InitWithNewPipeAndPassReceiver());
// Will manage its own lifetime
- InterceptedRequest *req = new InterceptedRequest(m_processId, request_id, routing_id, options, request, traffic_annotation,
- m_profileRequestInterceptor, m_pageRequestInterceptor, std::move(loader),
+ InterceptedRequest *req = new InterceptedRequest(m_profileAdapter, m_frameTreeNodeId, request_id, options,
+ request, traffic_annotation, std::move(loader),
std::move(url_loader_client), std::move(target_factory_clone));
req->Restart();
}
diff --git a/src/core/net/proxying_url_loader_factory_qt.h b/src/core/net/proxying_url_loader_factory_qt.h
index 3d77856cc..904a40c2d 100644
--- a/src/core/net/proxying_url_loader_factory_qt.h
+++ b/src/core/net/proxying_url_loader_factory_qt.h
@@ -1,58 +1,14 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef PROXYING_URL_LOADER_FACTORY_QT_H_
#define PROXYING_URL_LOADER_FACTORY_QT_H_
-#include "base/callback.h"
-#include "base/macros.h"
-#include "base/memory/ref_counted.h"
-#include "base/memory/ref_counted_delete_on_sequence.h"
#include "base/memory/weak_ptr.h"
-#include "base/optional.h"
#include "mojo/public/cpp/bindings/receiver_set.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
-#include "services/network/public/cpp/resource_request.h"
-#include "services/network/public/cpp/resource_response.h"
#include "services/network/public/mojom/url_loader.mojom.h"
#include "services/network/public/mojom/url_loader_factory.mojom.h"
-#include "url/gurl.h"
#include <QPointer>
// based on aw_proxying_url_loader_factory.h:
@@ -60,26 +16,25 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-QT_FORWARD_DECLARE_CLASS(QWebEngineUrlRequestInterceptor)
-
-namespace content {
-class ResourceContext;
+namespace network {
+struct ResourceRequest;
}
namespace QtWebEngineCore {
+class ProfileAdapter;
+
class ProxyingURLLoaderFactoryQt : public network::mojom::URLLoaderFactory
{
public:
- ProxyingURLLoaderFactoryQt(int processId, QWebEngineUrlRequestInterceptor *profile,
- QWebEngineUrlRequestInterceptor *page,
+ ProxyingURLLoaderFactoryQt(ProfileAdapter *adapter, int frameTreeNodeId,
mojo::PendingReceiver<network::mojom::URLLoaderFactory> loader_receiver,
mojo::PendingRemote<network::mojom::URLLoaderFactory> pending_target_factory_remote);
~ProxyingURLLoaderFactoryQt() override;
void CreateLoaderAndStart(mojo::PendingReceiver<network::mojom::URLLoader> loader,
- int32_t routing_id, int32_t request_id,
+ int32_t request_id,
uint32_t options, const network::ResourceRequest &request,
mojo::PendingRemote<network::mojom::URLLoaderClient> client,
const net::MutableNetworkTrafficAnnotationTag &traffic_annotation) override;
@@ -90,14 +45,11 @@ private:
void OnTargetFactoryError();
void OnProxyBindingError();
- int m_processId;
+ QPointer<ProfileAdapter> m_profileAdapter;
+ int m_frameTreeNodeId;
mojo::ReceiverSet<network::mojom::URLLoaderFactory> m_proxyReceivers;
mojo::Remote<network::mojom::URLLoaderFactory> m_targetFactory;
- QPointer<QWebEngineUrlRequestInterceptor> m_profileRequestInterceptor;
- QPointer<QWebEngineUrlRequestInterceptor> m_pageRequestInterceptor;
base::WeakPtrFactory<ProxyingURLLoaderFactoryQt> m_weakFactory;
-
- DISALLOW_COPY_AND_ASSIGN(ProxyingURLLoaderFactoryQt);
};
} // namespace QtWebEngineCore
diff --git a/src/core/net/qrc_url_scheme_handler.cpp b/src/core/net/qrc_url_scheme_handler.cpp
index 73bf24f1d..a8b4e4388 100644
--- a/src/core/net/qrc_url_scheme_handler.cpp
+++ b/src/core/net/qrc_url_scheme_handler.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qrc_url_scheme_handler.h"
@@ -46,6 +10,8 @@
#include <QMimeDatabase>
#include <QMimeType>
+#include <memory>
+
namespace QtWebEngineCore {
void QrcUrlSchemeHandler::requestStarted(QWebEngineUrlRequestJob *job)
@@ -58,7 +24,7 @@ void QrcUrlSchemeHandler::requestStarted(QWebEngineUrlRequestJob *job)
QUrl requestUrl = job->requestUrl();
QString requestPath = requestUrl.path();
- QScopedPointer<QFile> file(new QFile(':' + requestPath, job));
+ auto file = std::make_unique<QFile>(':' + requestPath, job);
if (!file->exists() || file->size() == 0) {
qWarning("QResource '%s' not found or is empty", qUtf8Printable(requestPath));
job->fail(QWebEngineUrlRequestJob::UrlNotFound);
@@ -67,7 +33,10 @@ void QrcUrlSchemeHandler::requestStarted(QWebEngineUrlRequestJob *job)
QFileInfo fileInfo(*file);
QMimeDatabase mimeDatabase;
QMimeType mimeType = mimeDatabase.mimeTypeForFile(fileInfo);
- job->reply(mimeType.name().toUtf8(), file.take());
+ if (mimeType.name() == QStringLiteral("application/x-extension-html"))
+ job->reply("text/html", file.release());
+ else
+ job->reply(mimeType.name().toUtf8(), file.release());
}
} // namespace QtWebEngineCore
diff --git a/src/core/net/qrc_url_scheme_handler.h b/src/core/net/qrc_url_scheme_handler.h
index 586147cdf..96155b05b 100644
--- a/src/core/net/qrc_url_scheme_handler.h
+++ b/src/core/net/qrc_url_scheme_handler.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QRC_URL_SCHEME_HANDLER_H
#define QRC_URL_SCHEME_HANDLER_H
diff --git a/src/core/net/resource_request_body_qt.cpp b/src/core/net/resource_request_body_qt.cpp
new file mode 100644
index 000000000..d0d54784d
--- /dev/null
+++ b/src/core/net/resource_request_body_qt.cpp
@@ -0,0 +1,181 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "resource_request_body_qt.h"
+#include "type_conversion.h"
+
+#include "services/network/public/cpp/resource_request_body.h"
+#include "services/network/public/mojom/data_pipe_getter.mojom.h"
+#include "services/network/public/mojom/url_request.mojom-shared.h"
+#include "mojo/public/cpp/bindings/remote.h"
+
+namespace QtWebEngineCore {
+
+ResourceRequestBody::ResourceRequestBody(network::ResourceRequestBody *requestBody, QObject *parent)
+ : QIODevice(parent)
+ , m_requestBody(requestBody)
+ , m_dataElementsIdx(0)
+ , m_dataElementBytesIdx(0)
+ , m_dataElementFileIdx(0)
+{};
+
+ResourceRequestBody::~ResourceRequestBody(){};
+
+qint64 ResourceRequestBody::readData(char *data, qint64 maxSize)
+{
+ if (!m_requestBody)
+ return -1;
+
+ const std::size_t dataElementsSize = m_requestBody->elements()->size();
+ if (m_dataElementsIdx == dataElementsSize)
+ return -1;
+
+ qint64 bytesRead = 0;
+ const std::vector<network::DataElement> *elements = m_requestBody->elements();
+ while (bytesRead < maxSize && m_dataElementsIdx < dataElementsSize) {
+ const network::DataElement &currentDataElement = elements->at(m_dataElementsIdx);
+
+ switch (currentDataElement.type()) {
+ case network::mojom::DataElementDataView::Tag::kBytes: {
+ readDataElementBytes(currentDataElement.As<network::DataElementBytes>().bytes(),
+ bytesRead, maxSize, &data);
+ break;
+ }
+ case network::mojom::DataElementDataView::Tag::kFile: {
+ const network::DataElementFile file = currentDataElement.As<network::DataElementFile>();
+ const qint64 offset = file.offset();
+ const qint64 length = file.length();
+ readDataElementFile(file.path(), offset, length, bytesRead, maxSize, &data);
+ break;
+ }
+ case network::mojom::DataElementDataView::Tag::kDataPipe: {
+ mojo::Remote<network::mojom::DataPipeGetter> pipeGetter;
+ pipeGetter.Bind(
+ currentDataElement.As<network::DataElementDataPipe>().CloneDataPipeGetter());
+ const mojo::ScopedHandleBase<mojo::DataPipeConsumerHandle> consumerHandle =
+ getConsumerHandleFromPipeGetter(pipeGetter);
+ readDataElementPipe(consumerHandle, bytesRead, maxSize, &data);
+ break;
+ }
+ case network::mojom::DataElementDataView::Tag::kChunkedDataPipe: {
+ setErrorString(QStringLiteral("Chunked data pipe is used in request body upload, which "
+ "is currently not supported"));
+ // Nothing should come before or after DataElementChunkedDataPipe
+ return -1;
+ }
+ }
+
+ if (bytesRead == maxSize || m_dataElementsIdx == dataElementsSize)
+ break;
+ }
+
+ return bytesRead;
+}
+
+// We don't want to write, ever
+qint64 ResourceRequestBody::writeData(const char *data, qint64 maxSize)
+{
+ return -1;
+}
+
+bool ResourceRequestBody::isSequential() const
+{
+ return true;
+}
+
+void ResourceRequestBody::readDataElementBytes(const std::vector<uint8_t> &dataElement,
+ qint64 &bytesRead, const qint64 &maxSize,
+ char **data)
+{
+ const std::size_t dataElementSize = dataElement.size();
+ const std::size_t bytesToRead = std::min(dataElementSize, static_cast<std::size_t>(maxSize));
+
+ std::memcpy(*data, dataElement.data(), bytesToRead);
+ *data += bytesToRead;
+ m_dataElementBytesIdx += bytesToRead;
+ bytesRead += bytesToRead;
+
+ if (m_dataElementBytesIdx == dataElementSize) {
+ m_dataElementsIdx++;
+ m_dataElementBytesIdx = 0;
+ }
+}
+
+void ResourceRequestBody::readDataElementFile(const base::FilePath &filePath, const qint64 &offset,
+ const qint64 &length, qint64 &bytesRead,
+ const qint64 &maxSize, char **data)
+{
+ QFile file(toQt(filePath.value()));
+ const qint64 realOffset = offset + m_dataElementFileIdx;
+ const std::size_t fileSize = std::min(file.size(), length) - realOffset;
+ const std::size_t bytesToRead = std::min(fileSize, static_cast<std::size_t>(maxSize));
+
+ file.open(QFile::ReadOnly);
+ file.seek(realOffset);
+
+ std::memcpy(*data, file.read(bytesToRead).data(), bytesToRead);
+ *data += bytesToRead;
+ m_dataElementFileIdx += bytesToRead;
+ bytesRead += bytesToRead;
+
+ file.close();
+
+ if (m_dataElementFileIdx == fileSize) {
+ m_dataElementsIdx++;
+ m_dataElementFileIdx = 0;
+ }
+}
+
+mojo::ScopedHandleBase<mojo::DataPipeConsumerHandle>
+ResourceRequestBody::getConsumerHandleFromPipeGetter(
+ mojo::Remote<network::mojom::DataPipeGetter> &pipeGetter)
+{
+ mojo::ScopedHandleBase<mojo::DataPipeProducerHandle> producerHandle;
+ mojo::ScopedHandleBase<mojo::DataPipeConsumerHandle> consumerHandle;
+ mojo::CreateDataPipe(nullptr, producerHandle, consumerHandle);
+ base::WeakPtrFactory<ResourceRequestBody> weakPtrFactory{ this };
+ pipeGetter->Read(std::move(producerHandle),
+ base::BindOnce(&ResourceRequestBody::pipeGetterOnReadComplete,
+ weakPtrFactory.GetWeakPtr()));
+
+ return consumerHandle;
+}
+
+void ResourceRequestBody::readDataElementPipe(
+ const mojo::ScopedHandleBase<mojo::DataPipeConsumerHandle> &consumerHandle,
+ qint64 &bytesRead, const qint64 &maxSize, char **data)
+{
+ MojoResult result;
+ do {
+ uint32_t bytesToRead = 1;
+ result = consumerHandle->ReadData(*data, &bytesToRead, MOJO_READ_DATA_FLAG_NONE);
+
+ if (result == MOJO_RESULT_OK) {
+ *data += bytesToRead;
+ bytesRead += bytesToRead;
+ } else if (result != MOJO_RESULT_SHOULD_WAIT && result != MOJO_RESULT_FAILED_PRECONDITION) {
+ setErrorString(QString::fromLatin1("Error while reading from data pipe, skipping"
+ "remaining content of data pipe. Mojo error code: ")
+ + QString::number(result));
+ }
+ } while ((result == MOJO_RESULT_SHOULD_WAIT || result == MOJO_RESULT_OK)
+ && bytesRead < maxSize);
+
+ m_dataElementsIdx++;
+}
+
+void ResourceRequestBody::pipeGetterOnReadComplete(int32_t status, uint64_t size) { }
+
+void ResourceRequestBody::appendFilesForTest(const QString &path)
+{
+ if (!m_requestBody)
+ return;
+
+ base::FilePath filePath = toFilePath(path);
+ m_requestBody->elements_mutable()->push_back(static_cast<network::DataElement>(
+ network::DataElementFile(filePath, 0, 23, base::Time())));
+ m_requestBody->elements_mutable()->push_back(static_cast<network::DataElement>(
+ network::DataElementFile(filePath, 10, 23, base::Time())));
+}
+
+} // namespace QtWebEngineCore
diff --git a/src/core/net/resource_request_body_qt.h b/src/core/net/resource_request_body_qt.h
new file mode 100644
index 000000000..717885d7d
--- /dev/null
+++ b/src/core/net/resource_request_body_qt.h
@@ -0,0 +1,70 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef RESOURCEREQUESTBODY_QT_H
+#define RESOURCEREQUESTBODY_QT_H
+
+#include <QtWebEngineCore/private/qtwebenginecoreglobal_p.h>
+#include <QtCore/QIODevice>
+#include <QtCore/QFile>
+#include <QtCore/QUrl>
+
+namespace network {
+class ResourceRequestBody;
+namespace mojom {
+class DataPipeGetter;
+class ChunkedDataPipeGetter;
+}
+}
+
+namespace base {
+class FilePath;
+}
+
+namespace mojo {
+template<typename T>
+class Remote;
+template<typename T>
+class ScopedHandleBase;
+class DataPipeConsumerHandle;
+}
+
+namespace QtWebEngineCore {
+
+class Q_WEBENGINECORE_EXPORT ResourceRequestBody : public QIODevice
+{
+ Q_OBJECT
+public:
+ explicit ResourceRequestBody(network::ResourceRequestBody *requestBody,
+ QObject *parent = nullptr);
+ ~ResourceRequestBody();
+
+ qint64 readData(char *data, qint64 maxSize) override;
+ qint64 writeData(const char *data, qint64 maxSize) override;
+ bool isSequential() const override;
+
+ void appendFilesForTest(const QString &path);
+
+private:
+ network::ResourceRequestBody *const m_requestBody;
+
+ std::size_t m_dataElementsIdx;
+ std::size_t m_dataElementBytesIdx;
+ std::size_t m_dataElementFileIdx;
+
+ void readDataElementBytes(const std::vector<uint8_t> &dataElement, qint64 &bytesRead,
+ const qint64 &maxSize, char **data);
+ void readDataElementFile(const base::FilePath &filePath, const qint64 &offset,
+ const qint64 &length, qint64 &bytesRead, const qint64 &maxSize,
+ char **data);
+ mojo::ScopedHandleBase<mojo::DataPipeConsumerHandle>
+ getConsumerHandleFromPipeGetter(mojo::Remote<network::mojom::DataPipeGetter> &pipeGetter);
+ void
+ readDataElementPipe(const mojo::ScopedHandleBase<mojo::DataPipeConsumerHandle> &consumerHandle,
+ qint64 &bytesRead, const qint64 &maxSize, char **data);
+ void pipeGetterOnReadComplete(int32_t status, uint64_t size);
+};
+
+} // namespace QtWebEngineCore
+
+#endif // RESOURCEREQUESTBODY_QT_H
diff --git a/src/core/net/ssl_host_state_delegate_qt.cpp b/src/core/net/ssl_host_state_delegate_qt.cpp
index 3f3f95c83..41967f14e 100644
--- a/src/core/net/ssl_host_state_delegate_qt.cpp
+++ b/src/core/net/ssl_host_state_delegate_qt.cpp
@@ -1,47 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "base/callback.h"
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "ssl_host_state_delegate_qt.h"
-#include "type_conversion.h"
+#include "base/functional/callback.h"
namespace QtWebEngineCore {
@@ -77,7 +39,7 @@ SSLHostStateDelegateQt::SSLHostStateDelegateQt() {}
SSLHostStateDelegateQt::~SSLHostStateDelegateQt() {}
-void SSLHostStateDelegateQt::AllowCert(const std::string &host, const net::X509Certificate &cert, int error)
+void SSLHostStateDelegateQt::AllowCert(const std::string &host, const net::X509Certificate &cert, int error, content::StoragePartition *)
{
m_certPolicyforHost[host].Allow(cert, error);
}
@@ -105,7 +67,7 @@ void SSLHostStateDelegateQt::Clear(base::RepeatingCallback<bool(const std::strin
// prior to this query, otherwise false.
content::SSLHostStateDelegate::CertJudgment SSLHostStateDelegateQt::QueryPolicy(const std::string &host,
const net::X509Certificate &cert,
- int error)
+ int error, content::StoragePartition *)
{
return m_certPolicyforHost[host].Check(cert, error) ? SSLHostStateDelegate::ALLOWED : SSLHostStateDelegate::DENIED;
}
@@ -121,6 +83,16 @@ bool SSLHostStateDelegateQt::DidHostRunInsecureContent(const std::string &host,
return false;
}
+void SSLHostStateDelegateQt::AllowHttpForHost(const std::string &host, content::StoragePartition *web_contents)
+{
+ // Intentional no-op see aw_ssl_host_state_delegate
+}
+
+bool SSLHostStateDelegateQt::IsHttpAllowedForHost(const std::string &host, content::StoragePartition *web_contents)
+{
+ return false;
+}
+
// Revokes all SSL certificate error allow exceptions made by the user for
// |host|.
void SSLHostStateDelegateQt::RevokeUserAllowExceptions(const std::string &host)
@@ -132,12 +104,33 @@ void SSLHostStateDelegateQt::RevokeUserAllowExceptions(const std::string &host)
// |host|. This does not mean that *all* certificate errors are allowed, just
// that there exists an exception. To see if a particular certificate and
// error combination exception is allowed, use QueryPolicy().
-bool SSLHostStateDelegateQt::HasAllowException(const std::string &host)
+bool SSLHostStateDelegateQt::HasAllowException(const std::string &host, content::StoragePartition *)
{
auto policy_iterator = m_certPolicyforHost.find(host);
return policy_iterator != m_certPolicyforHost.end() &&
policy_iterator->second.HasAllowException();
}
+bool SSLHostStateDelegateQt::HasAllowExceptionForAnyHost(content::StoragePartition *storage_partition)
+{
+ for (auto const &it : m_certPolicyforHost) {
+ if (it.second.HasAllowException()) {
+ return true;
+ }
+ }
+ return false;
+}
+
+void SSLHostStateDelegateQt::SetHttpsEnforcementForHost(const std::string &host, bool enforce,
+ content::StoragePartition *storage_partition)
+{
+ // Intentional no-op see aw_ssl_host_state_delegate
+}
+
+bool SSLHostStateDelegateQt::IsHttpsEnforcedForHost(const std::string &host, content::StoragePartition *storage_partition)
+{
+ // Intentional no-op
+ return false;
+}
} // namespace QtWebEngineCore
diff --git a/src/core/net/ssl_host_state_delegate_qt.h b/src/core/net/ssl_host_state_delegate_qt.h
index 26e503eb5..0b3d7974c 100644
--- a/src/core/net/ssl_host_state_delegate_qt.h
+++ b/src/core/net/ssl_host_state_delegate_qt.h
@@ -1,47 +1,13 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef SSL_HOST_STATE_DELEGATE_QT_H
#define SSL_HOST_STATE_DELEGATE_QT_H
#include "content/public/browser/ssl_host_state_delegate.h"
-#include "profile_adapter.h"
+
+#include <map>
+#include <string>
namespace QtWebEngineCore {
@@ -66,13 +32,18 @@ public:
~SSLHostStateDelegateQt();
// content::SSLHostStateDelegate implementation:
- void AllowCert(const std::string &, const net::X509Certificate &cert, int error) override;
+ void AllowCert(const std::string &, const net::X509Certificate &cert, int error, content::StoragePartition *storage_partition) override;
void Clear(base::RepeatingCallback<bool(const std::string&)> host_filter) override;
- CertJudgment QueryPolicy(const std::string &host, const net::X509Certificate &cert, int error) override;
+ CertJudgment QueryPolicy(const std::string &host, const net::X509Certificate &cert, int error, content::StoragePartition *web_contents) override;
void HostRanInsecureContent(const std::string &host, int child_id, InsecureContentType content_type) override;
bool DidHostRunInsecureContent(const std::string &host, int child_id, InsecureContentType content_type) override;
+ void AllowHttpForHost(const std::string &host, content::StoragePartition *web_contents) override;
+ bool IsHttpAllowedForHost(const std::string &host, content::StoragePartition *web_contents) override;
+ void SetHttpsEnforcementForHost(const std::string &host, bool enforce, content::StoragePartition *storage_partition) override;
+ bool IsHttpsEnforcedForHost(const std::string &host, content::StoragePartition *web_contents) override;
void RevokeUserAllowExceptions(const std::string &host) override;
- bool HasAllowException(const std::string &host) override;
+ bool HasAllowException(const std::string &host, content::StoragePartition *web_contents) override;
+ bool HasAllowExceptionForAnyHost(content::StoragePartition *storage_partition) override;
private:
std::map<std::string, CertPolicy> m_certPolicyforHost;
diff --git a/src/core/net/system_network_context_manager.cpp b/src/core/net/system_network_context_manager.cpp
index 29cc82abf..439d1066c 100644
--- a/src/core/net/system_network_context_manager.cpp
+++ b/src/core/net/system_network_context_manager.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// based on chrome/browser/net/system_network_context_manager.cc:
// Copyright 2017 The Chromium Authors. All rights reserved.
@@ -44,54 +8,47 @@
#include "net/system_network_context_manager.h"
-#include <set>
-#include <unordered_map>
-#include <utility>
-
-#include "base/bind.h"
#include "base/command_line.h"
-#include "base/feature_list.h"
-#include "base/logging.h"
-#include "base/sequence_checker.h"
+#include "base/functional/bind.h"
#include "base/strings/string_split.h"
-#include "base/task/post_task.h"
-#include "base/values.h"
-#include "build/build_config.h"
#include "chrome/browser/net/chrome_mojo_proxy_resolver_factory.h"
#include "chrome/common/chrome_switches.h"
#include "components/certificate_transparency/ct_known_logs.h"
-#include "components/network_session_configurator/common/network_features.h"
-#include "content/public/browser/browser_task_traits.h"
-#include "content/public/browser/browser_thread.h"
-#include "content/public/browser/cors_exempt_headers.h"
+#include "components/network_session_configurator/common/network_switches.h"
#include "content/public/browser/network_service_instance.h"
-#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
-#include "content/public/common/service_names.mojom.h"
-#include "content/public/common/user_agent.h"
-#include "mojo/public/cpp/bindings/associated_interface_ptr.h"
-#include "net/dns/public/util.h"
+#include "crypto/sha2.h"
+#include "mojo/public/cpp/bindings/pending_remote.h"
+#include "net/base/port_util.h"
#include "net/net_buildflags.h"
-#include "net/third_party/uri_template/uri_template.h"
+#include "services/cert_verifier/public/mojom/cert_verifier_service_factory.mojom.h"
#include "services/network/network_service.h"
#include "services/network/public/cpp/cross_thread_pending_shared_url_loader_factory.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
-#include "services/network/public/mojom/host_resolver.mojom.h"
-#include "services/network/public/mojom/url_loader_factory.mojom.h"
+#include "services/network/public/mojom/cert_verifier_service.mojom.h"
+#include "services/network/public/mojom/network_context.mojom.h"
#include "services/proxy_resolver/public/mojom/proxy_resolver.mojom.h"
-#include "url/gurl.h"
+#include "api/qwebengineglobalsettings.h"
+#include "api/qwebengineglobalsettings_p.h"
-namespace {
+#if BUILDFLAG(IS_WIN)
+#include "chrome/browser/net/chrome_mojo_proxy_resolver_win.h"
+#include "components/os_crypt/sync/os_crypt.h"
+#include "content/public/browser/network_service_util.h"
+#endif
-// The global instance of the SystemNetworkContextmanager.
-SystemNetworkContextManager *g_system_network_context_manager = nullptr;
+ASSERT_ENUMS_MATCH(net::SecureDnsMode::kSecure, QWebEngineGlobalSettings::SecureDnsMode::SecureOnly)
+ASSERT_ENUMS_MATCH(net::SecureDnsMode::kAutomatic,
+ QWebEngineGlobalSettings::SecureDnsMode::SecureWithFallback)
+ASSERT_ENUMS_MATCH(net::SecureDnsMode::kOff, QWebEngineGlobalSettings::SecureDnsMode::SystemOnly)
+
+namespace {
network::mojom::HttpAuthStaticParamsPtr CreateHttpAuthStaticParams()
{
- network::mojom::HttpAuthStaticParamsPtr auth_static_params = network::mojom::HttpAuthStaticParams::New();
-
- auth_static_params->supported_schemes = { "basic", "digest", "ntlm", "negotiate" };
+ network::mojom::HttpAuthStaticParamsPtr auth_static_params =
+ network::mojom::HttpAuthStaticParams::New();
return auth_static_params;
}
@@ -100,8 +57,10 @@ network::mojom::HttpAuthDynamicParamsPtr CreateHttpAuthDynamicParams()
{
network::mojom::HttpAuthDynamicParamsPtr auth_dynamic_params = network::mojom::HttpAuthDynamicParams::New();
+ auth_dynamic_params->allowed_schemes = { "basic", "digest", "ntlm", "negotiate" };
+
auto *command_line = base::CommandLine::ForCurrentProcess();
- auth_dynamic_params->server_allowlist = command_line->GetSwitchValueASCII(switches::kAuthServerWhitelist);
+ auth_dynamic_params->server_allowlist = command_line->GetSwitchValueASCII(switches::kAuthServerAllowlist);
// auth_dynamic_params->delegate_allowlist = command_line->GetSwitchValueASCII(switches::kAuthNegotiateDelegateWhitelist);
// auth_dynamic_params->enable_negotiate_port = command_line->HasSwitch(switches::kEnableAuthNegotiatePort);
@@ -110,6 +69,11 @@ network::mojom::HttpAuthDynamicParamsPtr CreateHttpAuthDynamicParams()
} // namespace
+namespace QtWebEngineCore {
+
+// The global instance of the SystemNetworkContextmanager.
+SystemNetworkContextManager *g_system_network_context_manager = nullptr;
+
// SharedURLLoaderFactory backed by a SystemNetworkContextManager and its
// network context. Transparently handles crashes.
class SystemNetworkContextManager::URLLoaderFactoryForSystem : public network::SharedURLLoaderFactory
@@ -123,7 +87,6 @@ public:
// mojom::URLLoaderFactory implementation:
void CreateLoaderAndStart(mojo::PendingReceiver<network::mojom::URLLoader> receiver,
- int32_t routing_id,
int32_t request_id,
uint32_t options,
const network::ResourceRequest &url_request,
@@ -134,7 +97,7 @@ public:
if (!manager_)
return;
manager_->GetURLLoaderFactory()->CreateLoaderAndStart(
- std::move(receiver), routing_id, request_id, options, url_request,
+ std::move(receiver), request_id, options, url_request,
std::move(client), traffic_annotation);
}
@@ -160,8 +123,6 @@ private:
SEQUENCE_CHECKER(sequence_checker_);
SystemNetworkContextManager *manager_;
-
- DISALLOW_COPY_AND_ASSIGN(URLLoaderFactoryForSystem);
};
network::mojom::NetworkContext *SystemNetworkContextManager::GetContext()
@@ -199,19 +160,6 @@ scoped_refptr<network::SharedURLLoaderFactory> SystemNetworkContextManager::GetS
return shared_url_loader_factory_;
}
-void SystemNetworkContextManager::SetUp(
- network::mojom::NetworkContextRequest *network_context_request,
- network::mojom::NetworkContextParamsPtr *network_context_params, bool *stub_resolver_enabled,
- base::Optional<std::vector<network::mojom::DnsOverHttpsServerPtr>> *dns_over_https_servers,
- network::mojom::HttpAuthStaticParamsPtr *http_auth_static_params,
- network::mojom::HttpAuthDynamicParamsPtr *http_auth_dynamic_params, bool *is_quic_allowed)
-{
- *is_quic_allowed = false;
- *http_auth_static_params = CreateHttpAuthStaticParams();
- *http_auth_dynamic_params = CreateHttpAuthDynamicParams();
- // GetStubResolverConfig(local_state_, stub_resolver_enabled, dns_over_https_servers);
-}
-
// static
SystemNetworkContextManager *SystemNetworkContextManager::CreateInstance()
{
@@ -245,102 +193,167 @@ SystemNetworkContextManager::~SystemNetworkContextManager()
void SystemNetworkContextManager::OnNetworkServiceCreated(network::mojom::NetworkService *network_service)
{
+ bool is_quic_force_enabled = base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableQuic);
// Disable QUIC globally
- network_service->DisableQuic();
+ if (!is_quic_force_enabled)
+ network_service->DisableQuic();
network_service->SetUpHttpAuth(CreateHttpAuthStaticParams());
network_service->ConfigureHttpAuthPrefs(CreateHttpAuthDynamicParams());
- // The system NetworkContext must be created first, since it sets
- // |primary_network_context| to true.
+#if BUILDFLAG(IS_WIN)
+ if (content::IsOutOfProcessNetworkService())
+ network_service->SetEncryptionKey(OSCrypt::GetRawEncryptionKey());
+#endif
+
+ // Configure the Certificate Transparency logs.
+ std::vector<std::pair<std::string, base::Time>> disqualified_logs =
+ certificate_transparency::GetDisqualifiedLogs();
+ std::vector<network::mojom::CTLogInfoPtr> log_list_mojo;
+ for (const auto &ct_log : certificate_transparency::GetKnownLogs()) {
+ network::mojom::CTLogInfoPtr log_info = network::mojom::CTLogInfo::New();
+ log_info->public_key = std::string(ct_log.log_key, ct_log.log_key_length);
+ log_info->id = crypto::SHA256HashString(log_info->public_key);
+ log_info->name = ct_log.log_name;
+ log_info->current_operator = ct_log.current_operator;
+
+ auto it = std::lower_bound(
+ std::begin(disqualified_logs), std::end(disqualified_logs), log_info->id,
+ [](const auto& disqualified_log, const std::string& log_id) {
+ return disqualified_log.first < log_id;
+ });
+ if (it != std::end(disqualified_logs) && it->first == log_info->id)
+ log_info->disqualified_at = it->second;
+
+ for (size_t i = 0; i < ct_log.previous_operators_length; i++) {
+ const auto& op = ct_log.previous_operators[i];
+ network::mojom::PreviousOperatorEntryPtr previous_operator =
+ network::mojom::PreviousOperatorEntry::New();
+ previous_operator->name = op.name;
+ previous_operator->end_time = op.end_time;
+ log_info->previous_operators.push_back(std::move(previous_operator));
+ }
+
+ log_list_mojo.push_back(std::move(log_info));
+ }
+ network_service->UpdateCtLogList(
+ std::move(log_list_mojo),
+ certificate_transparency::GetLogListTimestamp(),
+ base::DoNothing());
+
+ // The system NetworkContext is created first
network_service_network_context_.reset();
network_service->CreateNetworkContext(
network_service_network_context_.BindNewPipeAndPassReceiver(),
CreateNetworkContextParams());
- // Configure the stub resolver. This must be done after the system
- // NetworkContext is created, but before anything has the chance to use it.
- // bool stub_resolver_enabled;
- // base::Optional<std::vector<network::mojom::DnsOverHttpsServerPtr>> dns_over_https_servers;
- // GetStubResolverConfig(local_state_, &stub_resolver_enabled, &dns_over_https_servers);
- // content::GetNetworkService()->ConfigureStubHostResolver(stub_resolver_enabled, std::move(dns_over_https_servers));
+ // Handle --explicitly-allowed-ports
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kExplicitlyAllowedPorts)) {
+ std::vector<uint16_t> explicitly_allowed_network_ports;
+ std::string switch_value =
+ base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kExplicitlyAllowedPorts);
+ const auto split = base::SplitStringPiece(switch_value, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
+ for (const auto &piece : split) {
+ int port;
+ if (!base::StringToInt(piece, &port))
+ continue;
+ if (!net::IsPortValid(port))
+ continue;
+ explicitly_allowed_network_ports.push_back(static_cast<uint16_t>(port));
+ }
+
+ network_service->SetExplicitlyAllowedPorts(explicitly_allowed_network_ports);
+ }
+
+ // The network service is a singleton that can be reinstantiated for different reasons,
+ // e.g., when the network service crashes. Therefore, we configure the stub host
+ // resolver of the network service here, each time it is instantiated, with our global
+ // DNS-Over-HTTPS settings. This ensures that the global settings don't get lost
+ // on reinstantiation and are in effect upon initial instantiation.
+ QWebEngineGlobalSettingsPrivate::instance()->configureStubHostResolver();
}
void SystemNetworkContextManager::AddSSLConfigToNetworkContextParams(network::mojom::NetworkContextParams *network_context_params)
{
network_context_params->initial_ssl_config = network::mojom::SSLConfig::New();
- network_context_params->initial_ssl_config->rev_checking_enabled = true;
network_context_params->initial_ssl_config->symantec_enforcement_disabled = true;
}
-network::mojom::NetworkContextParamsPtr SystemNetworkContextManager::CreateDefaultNetworkContextParams()
+void SystemNetworkContextManager::ConfigureDefaultNetworkContextParams(network::mojom::NetworkContextParams *network_context_params,
+ cert_verifier::mojom::CertVerifierCreationParams *cert_verifier_creation_params)
{
- network::mojom::NetworkContextParamsPtr network_context_params = network::mojom::NetworkContextParams::New();
- content::UpdateCorsExemptHeader(network_context_params.get());
-
network_context_params->enable_brotli = true;
- // network_context_params->user_agent = GetUserAgent();
-
// Disable referrers by default. Any consumer that enables referrers should
// respect prefs::kEnableReferrers from the appropriate pref store.
network_context_params->enable_referrers = false;
- // const base::CommandLine& command_line =
- // *base::CommandLine::ForCurrentProcess();
-
- // // TODO(eroman): Figure out why this doesn't work in single-process mode,
- // // or if it does work, now.
- // // Should be possible now that a private isolate is used.
- // // http://crbug.com/474654
- // if (!command_line.HasSwitch(switches::kWinHttpProxyResolver)) {
- // if (command_line.HasSwitch(switches::kSingleProcess)) {
- // LOG(ERROR) << "Cannot use V8 Proxy resolver in single process mode.";
- // } else {
- network_context_params->proxy_resolver_factory = ChromeMojoProxyResolverFactory::CreateWithSelfOwnedReceiver();
- // }
- // }
-
- // network_context_params->pac_quick_check_enabled = local_state_->GetBoolean(prefs::kQuickCheckEnabled);
+ const base::CommandLine& command_line =
+ *base::CommandLine::ForCurrentProcess();
+ if (!command_line.HasSwitch(switches::kWinHttpProxyResolver)) {
+ if (command_line.HasSwitch(switches::kSingleProcess)) {
+ LOG(ERROR) << "Cannot use V8 Proxy resolver in single process mode.";
+ } else {
+ network_context_params->proxy_resolver_factory =
+ ChromeMojoProxyResolverFactory::CreateWithSelfOwnedReceiver();
+ }
+ }
+#if BUILDFLAG(IS_WIN)
+ if (command_line.HasSwitch(switches::kUseSystemProxyResolver)) {
+ network_context_params->windows_system_proxy_resolver =
+ ChromeMojoProxyResolverWin::CreateWithSelfOwnedReceiver();
+ }
+#endif
// Use the SystemNetworkContextManager to populate and update SSL
// configuration. The SystemNetworkContextManager is owned by the
// BrowserProcess itself, so will only be destroyed on shutdown, at which
// point, all NetworkContexts will be destroyed as well.
- AddSSLConfigToNetworkContextParams(network_context_params.get());
-
- // CT is only enabled on Desktop platforms for now.
- network_context_params->enforce_chrome_ct_policy = true;
- for (const auto &ct_log : certificate_transparency::GetKnownLogs()) {
- // TODO(rsleevi): https://crbug.com/702062 - Remove this duplication.
- network::mojom::CTLogInfoPtr log_info = network::mojom::CTLogInfo::New();
- log_info->public_key = std::string(ct_log.log_key, ct_log.log_key_length);
- log_info->name = ct_log.log_name;
- network_context_params->ct_logs.push_back(std::move(log_info));
- }
-
- return network_context_params;
+ AddSSLConfigToNetworkContextParams(network_context_params);
}
network::mojom::NetworkContextParamsPtr SystemNetworkContextManager::CreateNetworkContextParams()
{
// TODO(mmenke): Set up parameters here (in memory cookie store, etc).
- network::mojom::NetworkContextParamsPtr network_context_params = CreateDefaultNetworkContextParams();
-
- network_context_params->context_name = std::string("system");
+ network::mojom::NetworkContextParamsPtr network_context_params = network::mojom::NetworkContextParams::New();
+ cert_verifier::mojom::CertVerifierCreationParamsPtr
+ cert_verifier_creation_params = cert_verifier::mojom::CertVerifierCreationParams::New();
+ ConfigureDefaultNetworkContextParams(network_context_params.get(), cert_verifier_creation_params.get());
network_context_params->enable_referrers = false;
network_context_params->http_cache_enabled = false;
- // These are needed for PAC scripts that use FTP URLs.
-#if !BUILDFLAG(DISABLE_FTP_SUPPORT)
- network_context_params->enable_ftp_url_support = true;
-#endif
-
- network_context_params->primary_network_context = false;
-
proxy_config_monitor_.AddToNetworkContextParams(network_context_params.get());
+ network_context_params->cert_verifier_params =
+ content::GetCertVerifierParams(std::move(cert_verifier_creation_params));
return network_context_params;
}
+
+bool isValidTemplates(std::string templates)
+{
+ absl::optional<net::DnsOverHttpsConfig> dnsOverHttpsConfig =
+ net::DnsOverHttpsConfig::FromString(templates);
+ return dnsOverHttpsConfig.has_value();
+}
+
+
+void configureStubHostResolver(QWebEngineGlobalSettings::SecureDnsMode dnsMode,
+ std::string dnsOverHttpsTemplates, bool insecureDnsClientEnabled,
+ bool additionalInsecureDnsTypesEnabled)
+{
+ if (content::IsNetworkServiceCreated()) {
+ network::mojom::NetworkService *networkService = content::GetNetworkService();
+ if (networkService) {
+ absl::optional<net::DnsOverHttpsConfig> dohConfig = dnsOverHttpsTemplates.empty()
+ ? net::DnsOverHttpsConfig()
+ : net::DnsOverHttpsConfig::FromString(dnsOverHttpsTemplates);
+ networkService->ConfigureStubHostResolver(insecureDnsClientEnabled,
+ net::SecureDnsMode(dnsMode), *dohConfig,
+ additionalInsecureDnsTypesEnabled);
+ }
+ }
+}
+
+} // namespace QtWebEngineCore
diff --git a/src/core/net/system_network_context_manager.h b/src/core/net/system_network_context_manager.h
index 5094008f2..d56bdab78 100644
--- a/src/core/net/system_network_context_manager.h
+++ b/src/core/net/system_network_context_manager.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// based on chrome/browser/net/system_network_context_manager.h:
// Copyright 2017 The Chromium Authors. All rights reserved.
@@ -46,20 +10,17 @@
#define SYSTEM_NETWORK_CONTEXT_MANAGER_H_
#include <memory>
-#include <string>
-#include <vector>
-#include "base/macros.h"
-#include "base/memory/ref_counted.h"
-#include "base/optional.h"
-#include "services/network/public/mojom/host_resolver.mojom-forward.h"
#include "services/network/public/mojom/network_context.mojom.h"
#include "services/network/public/mojom/network_service.mojom-forward.h"
-#include "services/network/public/mojom/ssl_config.mojom-forward.h"
-#include "services/network/public/mojom/url_loader_factory.mojom-forward.h"
-
+#include "services/network/public/mojom/url_loader_factory.mojom.h"
#include "net/proxy_config_monitor.h"
+namespace cert_verifier {
+namespace mojom {
+class CertVerifierCreationParams;
+}}
+
namespace network {
namespace mojom {
class URLLoaderFactory;
@@ -67,9 +28,7 @@ class URLLoaderFactory;
class SharedURLLoaderFactory;
} // namespace network
-namespace net_log {
-class NetExportFileWriter;
-}
+namespace QtWebEngineCore {
// Responsible for creating and managing access to the system NetworkContext.
// Lives on the UI thread. The NetworkContext this owns is intended for requests
@@ -105,27 +64,6 @@ public:
// Destroys the global SystemNetworkContextManager instance.
static void DeleteInstance();
- // If the network service is disabled, |network_context_request| will be for
- // the NetworkContext used by the SystemNetworkContextManager and
- // |network_context_params| as needed to set up a system NetworkContext.
- // Otherwise, this method can still be used to help set up the IOThread's
- // in-process URLRequestContext.
- //
- // Must be called before the system NetworkContext is first used.
- //
- // |stub_resolver_enabled|, |dns_over_https_servers|,
- // |http_auth_static_params|, |http_auth_dynamic_params|, and
- // |is_quic_allowed| are used to pass initial NetworkService state to the
- // caller, so the NetworkService can be configured appropriately. Using
- // NetworkService's Mojo interface to set those options would lead to races
- // with other UI->IO thread network-related tasks, since Mojo doesn't preserve
- // execution order relative to PostTasks.
- void SetUp(network::mojom::NetworkContextRequest *network_context_request,
- network::mojom::NetworkContextParamsPtr *network_context_params, bool *stub_resolver_enabled,
- base::Optional<std::vector<network::mojom::DnsOverHttpsServerPtr>> *dns_over_https_servers,
- network::mojom::HttpAuthStaticParamsPtr *http_auth_static_params,
- network::mojom::HttpAuthDynamicParamsPtr *http_auth_dynamic_params, bool *is_quic_allowed);
-
// Returns the System NetworkContext. May only be called after SetUp(). Does
// any initialization of the NetworkService that may be needed when first
// called.
@@ -151,8 +89,9 @@ public:
// SSL configuration updates.
void AddSSLConfigToNetworkContextParams(network::mojom::NetworkContextParams *network_context_params);
- // Returns default set of parameters for configuring the network service.
- network::mojom::NetworkContextParamsPtr CreateDefaultNetworkContextParams();
+ // Configures the default set of parameters for the network context.
+ void ConfigureDefaultNetworkContextParams(network::mojom::NetworkContextParams *,
+ cert_verifier::mojom::CertVerifierCreationParams *);
private:
class URLLoaderFactoryForSystem;
@@ -175,8 +114,8 @@ private:
mojo::Remote<network::mojom::URLLoaderFactory> url_loader_factory_;
ProxyConfigMonitor proxy_config_monitor_;
-
- DISALLOW_COPY_AND_ASSIGN(SystemNetworkContextManager);
};
+} // namespace QtWebEngineCore
+
#endif // SYSTEM_NETWORK_CONTEXT_MANAGER_H_
diff --git a/src/core/net/url_request_custom_job_delegate.cpp b/src/core/net/url_request_custom_job_delegate.cpp
index ff307bede..c877de669 100644
--- a/src/core/net/url_request_custom_job_delegate.cpp
+++ b/src/core/net/url_request_custom_job_delegate.cpp
@@ -1,46 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "url_request_custom_job_delegate.h"
#include "url_request_custom_job_proxy.h"
-#include "base/task/post_task.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "net/base/net_errors.h"
@@ -51,16 +14,16 @@
namespace QtWebEngineCore {
-URLRequestCustomJobDelegate::URLRequestCustomJobDelegate(URLRequestCustomJobProxy *proxy,
- const QUrl &url,
- const QByteArray &method,
- const QUrl &initiatorOrigin,
- const QMap<QByteArray, QByteArray> &headers)
- : m_proxy(proxy),
- m_request(url),
- m_method(method),
- m_initiatorOrigin(initiatorOrigin),
- m_requestHeaders(headers)
+URLRequestCustomJobDelegate::URLRequestCustomJobDelegate(
+ URLRequestCustomJobProxy *proxy, const QUrl &url, const QByteArray &method,
+ const QUrl &initiatorOrigin, const QMap<QByteArray, QByteArray> &headers,
+ network::ResourceRequestBody *requestBody)
+ : m_proxy(proxy)
+ , m_request(url)
+ , m_method(method)
+ , m_initiatorOrigin(initiatorOrigin)
+ , m_requestHeaders(headers)
+ , m_resourceRequestBody(ResourceRequestBody(requestBody))
{
}
@@ -88,13 +51,25 @@ QMap<QByteArray, QByteArray> URLRequestCustomJobDelegate::requestHeaders() const
return m_requestHeaders;
}
+QIODevice *URLRequestCustomJobDelegate::requestBody()
+{
+ return &m_resourceRequestBody;
+}
+
+void URLRequestCustomJobDelegate::setAdditionalResponseHeaders(
+ const QMultiMap<QByteArray, QByteArray> &additionalResponseHeaders)
+{
+ m_additionalResponseHeaders = additionalResponseHeaders;
+}
+
void URLRequestCustomJobDelegate::reply(const QByteArray &contentType, QIODevice *device)
{
if (device)
QObject::connect(device, &QIODevice::readyRead, this, &URLRequestCustomJobDelegate::slotReadyRead);
m_proxy->m_ioTaskRunner->PostTask(FROM_HERE,
- base::BindOnce(&URLRequestCustomJobProxy::reply,
- m_proxy, contentType.toStdString(),device));
+ base::BindOnce(&URLRequestCustomJobProxy::reply, m_proxy,
+ contentType.toStdString(), device,
+ std::move(m_additionalResponseHeaders)));
}
void URLRequestCustomJobDelegate::slotReadyRead()
diff --git a/src/core/net/url_request_custom_job_delegate.h b/src/core/net/url_request_custom_job_delegate.h
index 93ae39e84..63db46464 100644
--- a/src/core/net/url_request_custom_job_delegate.h
+++ b/src/core/net/url_request_custom_job_delegate.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
//
// W A R N I N G
@@ -53,6 +17,7 @@
#include "base/memory/ref_counted.h"
#include "qtwebenginecoreglobal_p.h"
+#include "resource_request_body_qt.h"
#include <QMap>
#include <QObject>
@@ -60,11 +25,15 @@
QT_FORWARD_DECLARE_CLASS(QIODevice)
+namespace network {
+class ResourceRequestBody;
+}
+
namespace QtWebEngineCore {
class URLRequestCustomJobProxy;
-class Q_WEBENGINECORE_PRIVATE_EXPORT URLRequestCustomJobDelegate : public QObject
+class Q_WEBENGINECORE_EXPORT URLRequestCustomJobDelegate : public QObject
{
Q_OBJECT
public:
@@ -83,7 +52,10 @@ public:
QByteArray method() const;
QUrl initiator() const;
QMap<QByteArray, QByteArray> requestHeaders() const;
+ QIODevice *requestBody();
+ void
+ setAdditionalResponseHeaders(const QMultiMap<QByteArray, QByteArray> &additionalResponseHeaders);
void reply(const QByteArray &contentType, QIODevice *device);
void redirect(const QUrl &url);
void abort();
@@ -93,11 +65,10 @@ private Q_SLOTS:
void slotReadyRead();
private:
- URLRequestCustomJobDelegate(URLRequestCustomJobProxy *proxy,
- const QUrl &url,
- const QByteArray &method,
- const QUrl &initiatorOrigin,
- const QMap<QByteArray, QByteArray> &requestHeaders);
+ URLRequestCustomJobDelegate(URLRequestCustomJobProxy *proxy, const QUrl &url,
+ const QByteArray &method, const QUrl &initiatorOrigin,
+ const QMap<QByteArray, QByteArray> &requestHeaders,
+ network::ResourceRequestBody *requestBody);
friend class URLRequestCustomJobProxy;
scoped_refptr<URLRequestCustomJobProxy> m_proxy;
@@ -105,6 +76,8 @@ private:
QByteArray m_method;
QUrl m_initiatorOrigin;
const QMap<QByteArray, QByteArray> m_requestHeaders;
+ QMultiMap<QByteArray, QByteArray> m_additionalResponseHeaders;
+ ResourceRequestBody m_resourceRequestBody;
};
} // namespace
diff --git a/src/core/net/url_request_custom_job_proxy.cpp b/src/core/net/url_request_custom_job_proxy.cpp
index f734db645..0f41a3670 100644
--- a/src/core/net/url_request_custom_job_proxy.cpp
+++ b/src/core/net/url_request_custom_job_proxy.cpp
@@ -1,47 +1,12 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "url_request_custom_job_proxy.h"
#include "url_request_custom_job_delegate.h"
#include "content/public/browser/browser_thread.h"
#include "net/base/net_errors.h"
+#include "services/network/public/cpp/resource_request_body.h"
#include "api/qwebengineurlrequestjob.h"
#include "profile_adapter.h"
@@ -76,27 +41,30 @@ void URLRequestCustomJobProxy::release()
}
}
-// Fix me: this is never used
-/*
-void URLRequestCustomJobProxy::setReplyCharset(const std::string &charset)
-{
- DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
- if (!m_job)
- return;
- m_job->m_charset = charset;
-}
-*/
-void URLRequestCustomJobProxy::reply(std::string mimeType, QIODevice *device)
+void URLRequestCustomJobProxy::reply(std::string contentType, QIODevice *device,
+ QMultiMap<QByteArray, QByteArray> additionalResponseHeaders)
{
if (!m_client)
return;
DCHECK (!m_ioTaskRunner || m_ioTaskRunner->RunsTasksInCurrentSequence());
- m_client->m_mimeType = mimeType;
+ QByteArray qcontentType = QByteArray::fromStdString(contentType).toLower();
+ const int sidx = qcontentType.indexOf(';');
+ if (sidx > 0) {
+ const int cidx = qcontentType.indexOf("charset=", sidx);
+ if (cidx > 0) {
+ m_client->m_charset = qcontentType.mid(cidx + 8).trimmed().toStdString();
+ qcontentType = qcontentType.first(sidx);
+ } else {
+ qWarning() << "QWebEngineUrlRequestJob::reply(): Unrecognized content-type format with ';'" << qcontentType;
+ }
+ }
+ m_client->m_mimeType = qcontentType.trimmed().toStdString();
m_client->m_device = device;
+ m_client->m_additionalResponseHeaders = std::move(additionalResponseHeaders);
if (m_client->m_device && !m_client->m_device->isReadable())
m_client->m_device->open(QIODevice::ReadOnly);
- if (m_client->m_firstBytePosition > 0)
+ if (m_client->m_device && m_client->m_firstBytePosition > 0)
m_client->m_device->seek(m_client->m_firstBytePosition);
qint64 deviceSize = m_client->m_device ? m_client->m_device->size() : -1;
@@ -158,8 +126,9 @@ void URLRequestCustomJobProxy::readyRead()
}
void URLRequestCustomJobProxy::initialize(GURL url, std::string method,
- base::Optional<url::Origin> initiator,
- std::map<std::string, std::string> headers)
+ absl::optional<url::Origin> initiator,
+ std::map<std::string, std::string> headers,
+ scoped_refptr<network::ResourceRequestBody> requestBody)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
Q_ASSERT(!m_delegate);
@@ -177,10 +146,9 @@ void URLRequestCustomJobProxy::initialize(GURL url, std::string method,
qHeaders.insert(toQByteArray(it->first), toQByteArray(it->second));
if (schemeHandler) {
- m_delegate = new URLRequestCustomJobDelegate(this, toQt(url),
- QByteArray::fromStdString(method),
- initiatorOrigin,
- qHeaders);
+ m_delegate =
+ new URLRequestCustomJobDelegate(this, toQt(url), QByteArray::fromStdString(method),
+ initiatorOrigin, qHeaders, requestBody.get());
QWebEngineUrlRequestJob *requestJob = new QWebEngineUrlRequestJob(m_delegate);
schemeHandler->requestStarted(requestJob);
}
diff --git a/src/core/net/url_request_custom_job_proxy.h b/src/core/net/url_request_custom_job_proxy.h
index db38083dd..65c919ed0 100644
--- a/src/core/net/url_request_custom_job_proxy.h
+++ b/src/core/net/url_request_custom_job_proxy.h
@@ -1,54 +1,23 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef URL_REQUEST_CUSTOM_JOB_PROXY_H_
#define URL_REQUEST_CUSTOM_JOB_PROXY_H_
-#include "base/memory/weak_ptr.h"
-#include "base/optional.h"
-#include "base/task_runner.h"
+#include "base/task/sequenced_task_runner.h"
+#include "third_party/abseil-cpp/absl/types/optional.h"
#include "url/gurl.h"
#include "url/origin.h"
#include <QtCore/QPointer>
+#include <QMap>
+#include <QByteArray>
QT_FORWARD_DECLARE_CLASS(QIODevice)
+namespace network {
+class ResourceRequestBody;
+}
+
namespace QtWebEngineCore {
class URLRequestCustomJob;
@@ -65,6 +34,7 @@ public:
public:
std::string m_mimeType;
std::string m_charset;
+ QMultiMap<QByteArray, QByteArray> m_additionalResponseHeaders;
GURL m_redirect;
QIODevice *m_device;
int64_t m_firstBytePosition;
@@ -75,7 +45,7 @@ public:
virtual void notifyAborted() = 0;
virtual void notifyStartFailure(int) = 0;
virtual void notifyReadyRead() = 0;
- virtual base::TaskRunner *taskRunner() = 0;
+ virtual base::SequencedTaskRunner *taskRunner() = 0;
};
URLRequestCustomJobProxy(Client *client,
@@ -85,12 +55,15 @@ public:
// Called from URLRequestCustomJobDelegate via post:
//void setReplyCharset(const std::string &);
- void reply(std::string mimeType, QIODevice *device);
+ void reply(std::string mimeType, QIODevice *device,
+ QMultiMap<QByteArray, QByteArray> additionalResponseHeaders);
void redirect(GURL url);
void abort();
void fail(int error);
void release();
- void initialize(GURL url, std::string method, base::Optional<url::Origin> initiatorOrigin, std::map<std::string, std::string> headers);
+ void initialize(GURL url, std::string method, absl::optional<url::Origin> initiatorOrigin,
+ std::map<std::string, std::string> headers,
+ scoped_refptr<network::ResourceRequestBody> requestBody);
void readyRead();
// IO thread owned:
@@ -101,7 +74,7 @@ public:
std::string m_scheme;
URLRequestCustomJobDelegate *m_delegate;
QPointer<ProfileAdapter> m_profileAdapter;
- scoped_refptr<base::TaskRunner> m_ioTaskRunner;
+ scoped_refptr<base::SequencedTaskRunner> m_ioTaskRunner;
};
} // namespace QtWebEngineCore
diff --git a/src/core/net/version_ui_qt.cpp b/src/core/net/version_ui_qt.cpp
new file mode 100644
index 000000000..61a89596a
--- /dev/null
+++ b/src/core/net/version_ui_qt.cpp
@@ -0,0 +1,56 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "version_ui_qt.h"
+#include "api/qtwebenginecoreglobal.h"
+#include "build/build_config.h"
+#include "base/command_line.h"
+#include "chrome/common/url_constants.h"
+#include "chrome/browser/profiles/profile.h"
+#include "qtwebengine/grit/qt_webengine_resources.h"
+#include "services/network/public/cpp/content_security_policy/content_security_policy.h"
+
+namespace {
+const char kQtWebEngineVersion[] = "qtwebengine_version";
+const char kQtWebEngineChromiumVersion[] = "qtwebengine_chromium_version";
+const char kQtWebEngineChromiumSecurityPatchVersion[] =
+ "qtwebengine_chromium_security_patch_version";
+const char kCommandLine[] = "command_line";
+const char kQtVersionCSS[] = "qt_version.css";
+const char kQtLogo[] = "images/qt.png";
+const char kQtWebEngineLogo[] = "images/qtwebengine.png";
+}
+
+VersionUIQt::VersionUIQt(content::WebUI *web_ui) : content::WebUIController(web_ui)
+{
+
+ Profile *profile = Profile::FromWebUI(web_ui);
+ content::WebUIDataSource *html_source =
+ content::WebUIDataSource::CreateAndAdd(profile, chrome::kChromeUIVersionQtHost);
+ html_source->OverrideContentSecurityPolicy(
+ network::mojom::CSPDirectiveName::ScriptSrc,
+ "script-src chrome://resources 'self' 'unsafe-inline';");
+ html_source->SetDefaultResource(IDR_VERSION_UI_QT_HTML);
+ html_source->AddResourcePath(kQtVersionCSS, IDR_VERSION_UI_QT_CSS);
+ html_source->AddResourcePath(kQtLogo, IDR_QT_LOGO);
+ html_source->AddResourcePath(kQtWebEngineLogo, IDR_QTWEBENGINE_LOGO);
+
+ html_source->AddString(kQtWebEngineVersion, qWebEngineVersion());
+ html_source->AddString(kQtWebEngineChromiumVersion, qWebEngineChromiumVersion());
+ html_source->AddString(kQtWebEngineChromiumSecurityPatchVersion,
+ qWebEngineChromiumSecurityPatchVersion());
+#if BUILDFLAG(IS_WIN)
+ html_source->AddString(
+ kCommandLine,
+ base::AsString16(base::CommandLine::ForCurrentProcess()->GetCommandLineString()));
+#else
+ std::string command_line;
+ typedef std::vector<std::string> ArgvList;
+ const ArgvList &argv = base::CommandLine::ForCurrentProcess()->argv();
+ for (auto iter = argv.begin(); iter != argv.end(); iter++)
+ command_line += " " + *iter;
+ html_source->AddString(kCommandLine, command_line);
+#endif
+}
+
+VersionUIQt::~VersionUIQt() { }
diff --git a/src/core/net/version_ui_qt.h b/src/core/net/version_ui_qt.h
new file mode 100644
index 000000000..1fe8ef9e0
--- /dev/null
+++ b/src/core/net/version_ui_qt.h
@@ -0,0 +1,32 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#ifndef VERSION_UI_QT_H_
+#define VERSION_UI_QT_H_
+
+#include "build/build_config.h"
+#include "content/public/browser/web_ui_controller.h"
+#include "content/public/browser/web_ui_data_source.h"
+
+class VersionUIQt : public content::WebUIController
+{
+public:
+ explicit VersionUIQt(content::WebUI *web_ui);
+ ~VersionUIQt() override;
+
+ VersionUIQt(const VersionUIQt &) = delete;
+ VersionUIQt &operator=(const VersionUIQt &) = delete;
+};
+
+#endif // VERSION_UI_QT_H
diff --git a/src/core/net/webui_controller_factory_qt.cpp b/src/core/net/webui_controller_factory_qt.cpp
index 27e58d75f..ed35a3e36 100644
--- a/src/core/net/webui_controller_factory_qt.cpp
+++ b/src/core/net/webui_controller_factory_qt.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Based on chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc:
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
@@ -44,39 +8,37 @@
#include "webui_controller_factory_qt.h"
-#include "base/bind.h"
-#include "base/location.h"
-#include "base/threading/thread_task_runner_handle.h"
+#include "build_config_qt.h"
+#include "devtools_frontend_qt.h"
+#include "base/functional/bind.h"
#include "build/build_config.h"
#include "chrome/browser/accessibility/accessibility_ui.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/webui/device_log_ui.h"
#include "chrome/browser/ui/webui/devtools_ui.h"
-#include "chrome/browser/ui/webui/quota_internals/quota_internals_ui.h"
+#include "chrome/browser/ui/webui/net_internals/net_internals_ui.h"
+#include "chrome/browser/ui/webui/user_actions/user_actions_ui.h"
#include "chrome/common/url_constants.h"
-#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
-#include "content/public/common/content_client.h"
#include "content/public/common/url_utils.h"
#include "extensions/buildflags/buildflags.h"
#include "media/media_buildflags.h"
-#include "ppapi/buildflags/buildflags.h"
#include "printing/buildflags/buildflags.h"
-#include "ui/web_dialogs/web_dialog_ui.h"
#include "url/gurl.h"
+#include "version_ui_qt.h"
-#if defined(OS_LINUX) || defined(OS_ANDROID)
+#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
#include "chrome/browser/ui/webui/sandbox/sandbox_internals_ui.h"
#endif
+#if QT_CONFIG(webengine_webrtc) && QT_CONFIG(webengine_extensions)
+#include "chrome/browser/ui/webui/media/webrtc_logs_ui.h"
+#endif
+
// The Following WebUIs are disabled because they currently doesn't build
// or doesn't work, but would be interesting for us if they did:
// #include "chrome/browser/ui/webui/inspect_ui.h"
-// #include "chrome/browser/ui/webui/user_actions/user_actions_ui.h"
-
-// #if BUILDFLAG(ENABLE_WEBRTC)
-// #include "chrome/browser/ui/webui/media/webrtc_logs_ui.h"
-// #endif
// #if BUILDFLAG(ENABLE_PRINT_PREVIEW)
// #include "chrome/browser/ui/webui/print_preview/print_preview_ui.h"
@@ -119,26 +81,35 @@ std::unique_ptr<WebUIController> NewWebUI(WebUI *web_ui, const GURL & /*url*/)
// with it.
WebUIFactoryFunction GetWebUIFactoryFunction(WebUI *web_ui, Profile *profile, const GURL &url)
{
+ Q_UNUSED(web_ui);
+ Q_UNUSED(profile);
// This will get called a lot to check all URLs, so do a quick check of other
// schemes to filter out most URLs.
if (!content::HasWebUIScheme(url))
- return NULL;
+ return nullptr;
// We must compare hosts only since some of the Web UIs append extra stuff
// after the host name.
- if (url.host() == chrome::kChromeUIQuotaInternalsHost)
- return &NewWebUI<QuotaInternalsUI>;
+ if (url.host_piece() == chrome::kChromeUINetInternalsHost)
+ return &NewWebUI<NetInternalsUI>;
if (url.SchemeIs(content::kChromeDevToolsScheme)) {
- // if (!DevToolsUIBindings::IsValidFrontendURL(url))
- // return nullptr;
+ if (!QtWebEngineCore::DevToolsFrontendQt::IsValidFrontendURL(url))
+ return nullptr;
return &NewWebUI<DevToolsUI>;
}
- if (url.host() == chrome::kChromeUIAccessibilityHost)
+ if (url.host_piece() == chrome::kChromeUIAccessibilityHost)
return &NewWebUI<AccessibilityUI>;
-// if (url.host_piece() == chrome::kChromeUIUserActionsHost)
-// return &NewWebUI<UserActionsUI>;
+ if (url.host_piece() == chrome::kChromeUIUserActionsHost)
+ return &NewWebUI<UserActionsUI>;
+
+ if (url.host_piece() == chrome::kChromeUIDeviceLogHost)
+ return &NewWebUI<chromeos::DeviceLogUI>;
+
+ if (url.host_piece() == chrome::kChromeUIVersionQtHost)
+ return &NewWebUI<VersionUIQt>;
+
// if (url.host_piece() == chrome::kChromeUIInspectHost)
// return &NewWebUI<InspectUI>;
//
@@ -150,21 +121,17 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI *web_ui, Profile *profile, co
// if (url.host_piece() == chrome::kChromeUIExtensionsFrameHost)
// return &NewWebUI<extensions::ExtensionsUI>;
//#endif
-//#if BUILDFLAG(ENABLE_PLUGINS)
-// if (url.host_piece() == chrome::kChromeUIFlashHost)
-// return &NewWebUI<FlashUI>;
-//#endif
//#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
// if (url.host_piece() == chrome::kChromeUIPrintHost &&
// !profile->GetPrefs()->GetBoolean(prefs::kPrintPreviewDisabled)) {
// return &NewWebUI<PrintPreviewUI>;
// }
//#endif
-//#if BUILDFLAG(ENABLE_WEBRTC)
-// if (url.host_piece() == chrome::kChromeUIWebRtcLogsHost)
-// return &NewWebUI<WebRtcLogsUI>;
-//#endif
-#if defined(OS_LINUX) || defined(OS_ANDROID)
+#if QT_CONFIG(webengine_webrtc) && QT_CONFIG(webengine_extensions)
+ if (url.host_piece() == chrome::kChromeUIWebRtcLogsHost)
+ return &NewWebUI<WebRtcLogsUI>;
+#endif
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
if (url.host_piece() == chrome::kChromeUISandboxHost)
return &NewWebUI<SandboxInternalsUI>;
#endif
@@ -187,11 +154,6 @@ bool WebUIControllerFactoryQt::UseWebUIForURL(content::BrowserContext *browser_c
return GetWebUIType(browser_context, url) != WebUI::kNoWebUI;
}
-bool WebUIControllerFactoryQt::UseWebUIBindingsForURL(content::BrowserContext *browser_context, const GURL &url)
-{
- return UseWebUIForURL(browser_context, url);
-}
-
std::unique_ptr<WebUIController> WebUIControllerFactoryQt::CreateWebUIControllerForURL(WebUI *web_ui, const GURL &url)
{
Profile *profile = Profile::FromWebUI(web_ui);
diff --git a/src/core/net/webui_controller_factory_qt.h b/src/core/net/webui_controller_factory_qt.h
index 1cc76349b..22219dd5a 100644
--- a/src/core/net/webui_controller_factory_qt.h
+++ b/src/core/net/webui_controller_factory_qt.h
@@ -1,57 +1,12 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef WEB_UI_CONTROLLER_FACTORY_QT_H_
#define WEB_UI_CONTROLLER_FACTORY_QT_H_
-#include "base/macros.h"
#include "base/memory/singleton.h"
-#include "components/favicon_base/favicon_callback.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_controller_factory.h"
-#include "ui/base/layout.h"
-
-class Profile;
-
-namespace base {
-class RefCountedMemory;
-}
namespace QtWebEngineCore {
@@ -60,7 +15,6 @@ class WebUIControllerFactoryQt : public content::WebUIControllerFactory
public:
content::WebUI::TypeID GetWebUIType(content::BrowserContext *browserContext, const GURL &url) override;
bool UseWebUIForURL(content::BrowserContext *browserContext, const GURL &url) override;
- bool UseWebUIBindingsForURL(content::BrowserContext *browserContext, const GURL &url) override;
std::unique_ptr<content::WebUIController> CreateWebUIControllerForURL(content::WebUI *webUi, const GURL &url) override;
static WebUIControllerFactoryQt *GetInstance();
@@ -71,8 +25,6 @@ protected:
private:
friend struct base::DefaultSingletonTraits<WebUIControllerFactoryQt>;
-
- DISALLOW_COPY_AND_ASSIGN(WebUIControllerFactoryQt);
};
} // namespace QtWebEngineCore
diff --git a/src/core/ozone/BUILD.gn b/src/core/ozone/BUILD.gn
index 4d27f8877..aa7b282ae 100644
--- a/src/core/ozone/BUILD.gn
+++ b/src/core/ozone/BUILD.gn
@@ -1,6 +1,14 @@
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//ui/base/ui_features.gni")
+import("//build/config/linux/pkg_config.gni")
+
+if (use_xkbcommon) {
+ pkg_config("xkb") {
+ packages = [ "xkbcommon", "xkbfile" ]
+ }
+}
source_set("qt") {
sources = [
@@ -13,9 +21,18 @@ source_set("qt") {
deps = [
"//base",
+ "//ui/base:buildflags",
"//ui/ozone:ozone_base",
"//ui/ozone/common",
]
defines = [ "OZONE_IMPLEMENTATION" ]
+ libs = []
+ if (use_xkbcommon) {
+ configs += [ ":xkb" ]
+ }
+
+ if (ozone_platform_x11) {
+ libs += [ "X11" ]
+ }
}
diff --git a/src/core/ozone/gl_context_qt.cpp b/src/core/ozone/gl_context_qt.cpp
index 10347bdc7..0042f2bce 100644
--- a/src/core/ozone/gl_context_qt.cpp
+++ b/src/core/ozone/gl_context_qt.cpp
@@ -1,59 +1,35 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "gl_context_qt.h"
#include <QGuiApplication>
#include <QOpenGLContext>
#include <QThread>
+#include <QtGui/private/qtgui-config_p.h>
#include <qpa/qplatformnativeinterface.h>
-#include "ui/gl/gl_context_egl.h"
+
#include "ui/gl/gl_implementation.h"
+#include "ui/gl/gl_surface.h"
+
+#if defined(USE_OZONE)
+#include "ui/gl/egl_util.h"
+
+#include <QOpenGLFunctions>
+#include <QOffscreenSurface>
+
+#include <vector>
+#endif
-#if defined(OS_WIN)
+#if BUILDFLAG(IS_WIN)
+#include "ui/gl/gl_context_egl.h"
#include "ui/gl/gl_context_wgl.h"
#endif
QT_BEGIN_NAMESPACE
Q_GUI_EXPORT QOpenGLContext *qt_gl_global_share_context();
-GLContextHelper* GLContextHelper::contextHelper = 0;
+GLContextHelper* GLContextHelper::contextHelper = nullptr;
namespace {
@@ -62,7 +38,8 @@ inline void *resourceForContext(const QByteArray &resource)
#if QT_CONFIG(opengl)
QOpenGLContext *shareContext = qt_gl_global_share_context();
if (!shareContext) {
- qFatal("QWebEngine: OpenGL resource sharing is not set up in QtQuick. Please make sure to call QtWebEngine::initialize() in your main() function.");
+ qFatal("QWebEngine: OpenGL resource sharing is not set up in QtQuick. Please make sure to "
+ "call QtWebEngineQuick::initialize() in your main() function.");
}
return qApp->platformNativeInterface()->nativeResourceForContext(resource, shareContext);
#else
@@ -95,7 +72,7 @@ void GLContextHelper::initialize()
void GLContextHelper::destroy()
{
delete contextHelper;
- contextHelper = 0;
+ contextHelper = nullptr;
}
bool GLContextHelper::initializeContextOnBrowserThread(gl::GLContext* context, gl::GLSurface* surface, gl::GLContextAttribs attribs)
@@ -123,12 +100,13 @@ void* GLContextHelper::getEGLConfig()
void* GLContextHelper::getGlXConfig()
{
- return resourceForContext(QByteArrayLiteral("glxconfig"));
+ QByteArray resource = QByteArrayLiteral("glxconfig");
+ return resourceForContext(resource);
}
void* GLContextHelper::getEGLDisplay()
{
-#ifdef Q_OS_WIN
+#if BUILDFLAG(IS_WIN)
// Windows QPA plugin does not implement resourceForIntegration for "egldisplay".
// Use resourceForContext instead.
return resourceForContext(QByteArrayLiteral("egldisplay"));
@@ -139,10 +117,12 @@ void* GLContextHelper::getEGLDisplay()
void* GLContextHelper::getXDisplay()
{
- QPlatformNativeInterface *pni = QGuiApplication::platformNativeInterface();
- if (pni)
- return pni->nativeResourceForScreen(QByteArrayLiteral("display"), qApp->primaryScreen());
+#if QT_CONFIG(xcb)
+ auto *x11app = qGuiApp->nativeInterface<QNativeInterface::QX11Application>();
+ return x11app ? x11app->display() : nullptr;
+#else
return nullptr;
+#endif
}
void* GLContextHelper::getNativeDisplay()
@@ -153,7 +133,7 @@ void* GLContextHelper::getNativeDisplay()
QFunctionPointer GLContextHelper::getGlXGetProcAddress()
{
QFunctionPointer get_proc_address = nullptr;
-#if QT_CONFIG(opengl)
+#if QT_CONFIG(xcb_glx)
if (QOpenGLContext *context = qt_gl_global_share_context()) {
get_proc_address = context->getProcAddress("glXGetProcAddress");
}
@@ -172,38 +152,251 @@ QFunctionPointer GLContextHelper::getEglGetProcAddress()
return get_proc_address;
}
+void *GLContextHelper::getGlxPlatformInterface()
+{
+#if QT_CONFIG(xcb_glx)
+ if (QOpenGLContext *context = qt_gl_global_share_context())
+ return context->nativeInterface<QNativeInterface::QGLXContext>();
+#endif
+ return nullptr;
+}
+
+void *GLContextHelper::getEglPlatformInterface()
+{
+#if QT_CONFIG(opengl) && QT_CONFIG(egl)
+ if (QOpenGLContext *context = qt_gl_global_share_context())
+ return context->nativeInterface<QNativeInterface::QEGLContext>();
+#endif
+ return nullptr;
+}
+
bool GLContextHelper::isCreateContextRobustnessSupported()
{
return contextHelper->m_robustness;
}
+#if QT_CONFIG(opengl) && defined(USE_OZONE)
+class ScopedGLContext
+{
+public:
+ ScopedGLContext()
+ : m_context(new QOpenGLContext())
+ , m_previousContext(gl::GLContext::GetCurrent())
+ , m_previousSurface(gl::GLSurface::GetCurrent())
+ {
+ if (!m_context->create()) {
+ qWarning("Failed to create OpenGL context.");
+ return;
+ }
+
+ QOffscreenSurface *surface = new QOffscreenSurface(m_context->screen(), m_context.get());
+ surface->create();
+ Q_ASSERT(surface->isValid());
+
+ if (!m_context->makeCurrent(surface)) {
+ qWarning("Failed to make OpenGL context current.");
+ return;
+ }
+ }
+
+ ~ScopedGLContext()
+ {
+ if (!m_textures.empty()) {
+ auto glFun = m_context->functions();
+ glFun->glDeleteTextures(m_textures.size(), m_textures.data());
+ }
+
+ if (m_previousContext)
+ m_previousContext->MakeCurrent(m_previousSurface);
+ }
+
+ bool isValid() const { return m_context->isValid() && (m_context->surface() != nullptr); }
+
+ EGLDisplay eglDisplay() const
+ {
+ QNativeInterface::QEGLContext *nativeInterface =
+ m_context->nativeInterface<QNativeInterface::QEGLContext>();
+ return nativeInterface->display();
+ }
+
+ EGLContext eglContext() const
+ {
+ QNativeInterface::QEGLContext *nativeInterface =
+ m_context->nativeInterface<QNativeInterface::QEGLContext>();
+ return nativeInterface->nativeContext();
+ }
+
+ uint createTexture(int width, int height)
+ {
+ auto glFun = m_context->functions();
+
+ uint glTexture;
+ glFun->glGenTextures(1, &glTexture);
+ glFun->glBindTexture(GL_TEXTURE_2D, glTexture);
+ glFun->glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE,
+ NULL);
+ glFun->glBindTexture(GL_TEXTURE_2D, 0);
+
+ m_textures.push_back(glTexture);
+ return glTexture;
+ }
+
+private:
+ QScopedPointer<QOpenGLContext> m_context;
+ gl::GLContext *m_previousContext;
+ gl::GLSurface *m_previousSurface;
+ std::vector<uint> m_textures;
+};
+
+EGLHelper::EGLFunctions::EGLFunctions()
+{
+ const static auto getProcAddress =
+ reinterpret_cast<gl::GLGetProcAddressProc>(GLContextHelper::getEglGetProcAddress());
+
+ eglCreateImage = reinterpret_cast<PFNEGLCREATEIMAGEPROC>(getProcAddress("eglCreateImage"));
+ eglDestroyImage = reinterpret_cast<PFNEGLDESTROYIMAGEPROC>(getProcAddress("eglDestroyImage"));
+ eglGetError = reinterpret_cast<PFNEGLGETERRORPROC>(getProcAddress("eglGetError"));
+ eglExportDMABUFImageMESA = reinterpret_cast<PFNEGLEXPORTDMABUFIMAGEMESAPROC>(
+ getProcAddress("eglExportDMABUFImageMESA"));
+ eglExportDMABUFImageQueryMESA = reinterpret_cast<PFNEGLEXPORTDMABUFIMAGEQUERYMESAPROC>(
+ getProcAddress("eglExportDMABUFImageQueryMESA"));
+ eglQueryString = reinterpret_cast<PFNEGLQUERYSTRINGPROC>(getProcAddress("eglQueryString"));
+}
+
+EGLHelper *EGLHelper::instance()
+{
+ static EGLHelper eglHelper;
+ return &eglHelper;
+}
+
+EGLHelper::EGLHelper() : m_functions(new EGLHelper::EGLFunctions())
+{
+ const char *extensions = m_functions->eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
+ if (!extensions) {
+ qWarning("EGL: Failed to query EGL extensions.");
+ return;
+ }
+
+ if (strstr(extensions, "EGL_KHR_base_image")) {
+ qWarning("EGL: EGL_KHR_base_image extension is not supported.");
+ return;
+ }
+
+ auto eglDisplay = GLContextHelper::getEGLDisplay();
+ if (!eglDisplay) {
+ qWarning("EGL: No EGL display.");
+ return;
+ }
+
+ const char *displayExtensions = m_functions->eglQueryString(eglDisplay, EGL_EXTENSIONS);
+ m_isDmaBufSupported = strstr(displayExtensions, "EGL_EXT_image_dma_buf_import")
+ && strstr(displayExtensions, "EGL_EXT_image_dma_buf_import_modifiers")
+ && strstr(displayExtensions, "EGL_MESA_image_dma_buf_export");
+
+ if (m_isDmaBufSupported) {
+ // FIXME: This disables GBM for nvidia. Remove this when nvidia fixes its GBM support.
+ //
+ // "Buffer allocation and submission to DRM KMS using gbm is not currently supported."
+ // See: https://download.nvidia.com/XFree86/Linux-x86_64/550.40.07/README/kms.html
+ //
+ // Chromium uses GBM to allocate scanout buffers. Scanout requires DRM KMS. If KMS is
+ // enabled, gbm_device and gbm_buffer are created without any issues but rendering to the
+ // buffer will malfunction. It is not known how to detect this problem before rendering
+ // so we just disable GBM for nvidia.
+ const char *displayVendor = m_functions->eglQueryString(eglDisplay, EGL_VENDOR);
+ m_isDmaBufSupported = !strstr(displayVendor, "NVIDIA");
+ }
+}
+
+void EGLHelper::queryDmaBuf(const int width, const int height, int *fd, int *stride, int *offset,
+ uint64_t *modifiers)
+{
+ if (!m_isDmaBufSupported)
+ return;
+
+ ScopedGLContext context;
+ if (!context.isValid())
+ return;
+
+ EGLDisplay eglDisplay = context.eglDisplay();
+ EGLContext eglContext = context.eglContext();
+ if (!eglContext) {
+ qWarning("EGL: No EGLContext.");
+ return;
+ }
+
+ uint64_t textureId = context.createTexture(width, height);
+ EGLImage eglImage = m_functions->eglCreateImage(eglDisplay, eglContext, EGL_GL_TEXTURE_2D,
+ (EGLClientBuffer)textureId, NULL);
+ if (eglImage == EGL_NO_IMAGE) {
+ qWarning() << "EGL: Failed to create EGLImage:"
+ << ui::GetEGLErrorString(m_functions->eglGetError());
+ return;
+ }
+
+ int numPlanes = 0;
+ if (!m_functions->eglExportDMABUFImageQueryMESA(eglDisplay, eglImage, nullptr, &numPlanes,
+ modifiers))
+ qWarning() << "EGL: Failed to retrieve the pixel format of the buffer:"
+ << ui::GetEGLErrorString(m_functions->eglGetError());
+ Q_ASSERT(numPlanes == 1);
+
+ if (!m_functions->eglExportDMABUFImageMESA(eglDisplay, eglImage, fd, stride, offset))
+ qWarning() << "EGL: Failed to retrieve the dma_buf file descriptor:"
+ << ui::GetEGLErrorString(m_functions->eglGetError());
+
+ m_functions->eglDestroyImage(eglDisplay, eglImage);
+}
+
+bool EGLHelper::isDmaBufSupported()
+{
+ if (!m_isDmaBufSupported)
+ return false;
+
+ int fd = -1;
+ queryDmaBuf(2, 2, &fd, nullptr, nullptr, nullptr);
+ if (fd == -1) {
+ m_isDmaBufSupported = false;
+ return false;
+ }
+
+ close(fd);
+ return true;
+}
+#endif // QT_CONFIG(opengl) && defined(USE_OZONE)
+
QT_END_NAMESPACE
-#if defined(OS_WIN)
+#if BUILDFLAG(IS_WIN)
namespace gl {
namespace init {
-scoped_refptr<GLContext> CreateGLContext(GLShareGroup* share_group,
- GLSurface* compatible_surface,
- const GLContextAttribs& attribs)
+scoped_refptr<GLContext> CreateGLContext(GLShareGroup *share_group,
+ GLSurface *compatible_surface,
+ const GLContextAttribs &attribs)
{
- scoped_refptr<GLContext> context;
- if (GetGLImplementation() == kGLImplementationDesktopGL) {
- context = new GLContextWGL(share_group);
+ switch (GetGLImplementation()) {
+ case kGLImplementationDesktopGLCoreProfile:
+ case kGLImplementationDesktopGL: {
+ scoped_refptr<GLContext> context = new GLContextWGL(share_group);
if (!context->Initialize(compatible_surface, attribs))
return nullptr;
return context;
- } else {
- context = new GLContextEGL(share_group);
}
-
- if (!GLContextHelper::initializeContext(context.get(), compatible_surface, attribs))
+ case kGLImplementationEGLANGLE:
+ case kGLImplementationEGLGLES2:
+ return InitializeGLContext(new GLContextEGL(share_group),
+ compatible_surface, attribs);
+ case kGLImplementationDisabled:
return nullptr;
-
- return context;
+ default:
+ break;
+ }
+ Q_UNREACHABLE();
+ return nullptr;
}
} // namespace init
} // namespace gl
-#endif // defined(OS_WIN)
+#endif // BUILDFLAG(IS_WIN)
diff --git a/src/core/ozone/gl_context_qt.h b/src/core/ozone/gl_context_qt.h
index cc4f6b0d1..bd1137053 100644
--- a/src/core/ozone/gl_context_qt.h
+++ b/src/core/ozone/gl_context_qt.h
@@ -1,50 +1,21 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef GL_GL_CONTEXT_QT_H_
#define GL_GL_CONTEXT_QT_H_
#include <QObject>
+#include <QtCore/qscopedpointer.h>
+#include <QtGui/qtgui-config.h>
+
#include "ui/gl/gl_context.h"
+#if QT_CONFIG(opengl) && defined(USE_OZONE)
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
+#endif
+
namespace gl {
-class GLContext;
class GLSurface;
}
@@ -65,6 +36,8 @@ public:
static QFunctionPointer getGlXGetProcAddress();
static QFunctionPointer getEglGetProcAddress();
static bool isCreateContextRobustnessSupported();
+ static void *getGlxPlatformInterface();
+ static void *getEglPlatformInterface();
private:
Q_INVOKABLE bool initializeContextOnBrowserThread(gl::GLContext* context, gl::GLSurface* surface, gl::GLContextAttribs attribs);
@@ -73,6 +46,44 @@ private:
bool m_robustness = false;
};
+#if QT_CONFIG(opengl) && defined(USE_OZONE)
+#undef eglCreateImage
+#undef eglDestroyImage
+#undef eglExportDMABUFImageMESA
+#undef eglExportDMABUFImageQueryMESA
+#undef eglGetError
+#undef eglQueryString
+
+class EGLHelper
+{
+public:
+ struct EGLFunctions
+ {
+ EGLFunctions();
+
+ PFNEGLCREATEIMAGEPROC eglCreateImage;
+ PFNEGLDESTROYIMAGEPROC eglDestroyImage;
+ PFNEGLEXPORTDMABUFIMAGEMESAPROC eglExportDMABUFImageMESA;
+ PFNEGLEXPORTDMABUFIMAGEQUERYMESAPROC eglExportDMABUFImageQueryMESA;
+ PFNEGLGETERRORPROC eglGetError;
+ PFNEGLQUERYSTRINGPROC eglQueryString;
+ };
+
+ static EGLHelper *instance();
+
+ EGLFunctions *functions() const { return m_functions.get(); }
+ void queryDmaBuf(const int width, const int height, int *fd, int *stride, int *offset,
+ uint64_t *modifiers);
+ bool isDmaBufSupported();
+
+private:
+ EGLHelper();
+
+ QScopedPointer<EGLFunctions> m_functions;
+ bool m_isDmaBufSupported = false;
+};
+#endif // QT_CONFIG(opengl) && defined(USE_OZONE)
+
QT_END_NAMESPACE
#endif
diff --git a/src/core/ozone/gl_ozone_egl_qt.cpp b/src/core/ozone/gl_ozone_egl_qt.cpp
index c692920cf..26d11df31 100644
--- a/src/core/ozone/gl_ozone_egl_qt.cpp
+++ b/src/core/ozone/gl_ozone_egl_qt.cpp
@@ -1,140 +1,70 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#if defined(USE_OZONE)
-#include "gl_ozone_egl_qt.h"
-#include "gl_context_qt.h"
-#include "gl_surface_egl_qt.h"
-#include "base/files/file_path.h"
-#include "base/native_library.h"
#include "gl_context_qt.h"
#include "gl_ozone_egl_qt.h"
-#include "ui/gl/gl_context_egl.h"
-#include "ui/gl/gl_implementation.h"
-#include "ui/gl/gl_surface.h"
-#include "ui/gl/init/gl_factory.h"
-#include "ui/gl/init/gl_initializer.h"
-
-
-#include <EGL/egl.h>
-#include <dlfcn.h>
-
-#include <QtGui/qtgui-config.h>
+#include "gl_surface_egl_qt.h"
-#if QT_CONFIG(opengl)
-#include <QOpenGLContext>
-QT_BEGIN_NAMESPACE
-Q_GUI_EXPORT QOpenGLContext *qt_gl_global_share_context();
-QT_END_NAMESPACE
-#endif
+#include "media/gpu/buildflags.h"
+#include "ui/gl/gl_bindings.h"
+#include "ui/gl/gl_display.h"
+#include "ui/gl/gl_surface.h"
+#include "ui/gl/gl_utils.h"
+#include "ui/ozone/common/native_pixmap_egl_binding.h"
namespace ui {
-base::NativeLibrary LoadLibrary(const base::FilePath& filename) {
- base::NativeLibraryLoadError error;
- base::NativeLibrary library = base::LoadNativeLibrary(filename, &error);
- if (!library) {
- LOG(ERROR) << "Failed to load " << filename.MaybeAsASCII() << ": " << error.ToString();
- return NULL;
- }
- return library;
-}
-
-bool GLOzoneEGLQt::LoadGLES2Bindings(gl::GLImplementation /*implementation*/)
+bool LoadQtEGLBindings()
{
- base::NativeLibrary eglgles2Library = dlopen(NULL, RTLD_LAZY);
- if (!eglgles2Library) {
- LOG(ERROR) << "Failed to open EGL/GLES2 context " << dlerror();
- return false;
- }
-
- gl::GLGetProcAddressProc get_proc_address =
- reinterpret_cast<gl::GLGetProcAddressProc>(
- base::GetFunctionPointerFromNativeLibrary(eglgles2Library,
- "eglGetProcAddress"));
-#if QT_CONFIG(opengl)
- if (!get_proc_address) {
- // QTBUG-63341 most likely libgles2 not linked with libegl -> fallback to qpa
- if (QOpenGLContext *context = qt_gl_global_share_context()) {
- get_proc_address = reinterpret_cast<gl::GLGetProcAddressProc>(
- context->getProcAddress("eglGetProcAddress"));
- }
- }
-#endif
-
+ gl::GLGetProcAddressProc get_proc_address = reinterpret_cast<gl::GLGetProcAddressProc>(GLContextHelper::getEglGetProcAddress());
if (!get_proc_address) {
LOG(ERROR) << "eglGetProcAddress not found.";
- base::UnloadNativeLibrary(eglgles2Library);
return false;
}
-
gl::SetGLGetProcAddressProc(get_proc_address);
- gl::AddGLNativeLibrary(eglgles2Library);
return true;
}
-bool GLOzoneEGLQt::InitializeGLOneOffPlatform()
+bool GLOzoneEGLQt::LoadGLES2Bindings(const gl::GLImplementationParts & /*implementation*/)
{
- if (!gl::GLSurfaceEGLQt::InitializeOneOff()) {
- LOG(ERROR) << "GLOzoneEGLQt::InitializeOneOff failed.";
- return false;
+ return LoadQtEGLBindings();
+}
+
+gl::GLDisplay *GLOzoneEGLQt::InitializeGLOneOffPlatform(bool supports_angle,
+ std::vector<gl::DisplayType> init_displays,
+ gl::GpuPreference gpu_preference)
+{
+ if (auto display = gl::GLSurfaceEGLQt::InitializeOneOff(gpu_preference)) {
+ if (!static_cast<gl::GLDisplayEGL*>(display)->Initialize(supports_angle, std::move(init_displays), GetNativeDisplay())) {
+ LOG(ERROR) << "GLDisplayEGL::Initialize failed.";
+ return nullptr;
+ }
+ return display;
}
- return true;
+ return nullptr;
}
-bool GLOzoneEGLQt::InitializeExtensionSettingsOneOffPlatform()
+
+bool GLOzoneEGLQt::InitializeExtensionSettingsOneOffPlatform(gl::GLDisplay *display)
{
- return gl::GLSurfaceEGLQt::InitializeExtensionSettingsOneOff();
+ return static_cast<gl::GLDisplayEGL*>(display)->InitializeExtensionSettings();
}
-scoped_refptr<gl::GLSurface> GLOzoneEGLQt::CreateViewGLSurface(gfx::AcceleratedWidget window)
+scoped_refptr<gl::GLSurface> GLOzoneEGLQt::CreateViewGLSurface(gl::GLDisplay* display, gfx::AcceleratedWidget window)
{
+ Q_UNUSED(display);
+ Q_UNUSED(window);
return nullptr;
}
-scoped_refptr<gl::GLSurface> GLOzoneEGLQt::CreateOffscreenGLSurface(const gfx::Size &size)
+scoped_refptr<gl::GLSurface> GLOzoneEGLQt::CreateOffscreenGLSurface(gl::GLDisplay* display, const gfx::Size &size)
{
- scoped_refptr<gl::GLSurface> surface = new gl::GLSurfaceEGLQt(size);
+ scoped_refptr<gl::GLSurface> surface = new gl::GLSurfaceEGLQt(static_cast<gl::GLDisplayEGL*>(display), size);
if (surface->Initialize(gl::GLSurfaceFormat()))
return surface;
- surface = new gl::GLSurfacelessQtEGL(size);
+ surface = new gl::GLSurfacelessQtEGL(static_cast<gl::GLDisplayEGL*>(display), size);
if (surface->Initialize(gl::GLSurfaceFormat()))
return surface;
@@ -142,14 +72,29 @@ scoped_refptr<gl::GLSurface> GLOzoneEGLQt::CreateOffscreenGLSurface(const gfx::S
return nullptr;
}
-intptr_t GLOzoneEGLQt::GetNativeDisplay()
+gl::EGLDisplayPlatform GLOzoneEGLQt::GetNativeDisplay()
{
static void *display = GLContextHelper::getNativeDisplay();
+ static gl::EGLDisplayPlatform platform(display ? reinterpret_cast<intptr_t>(display) : EGL_DEFAULT_DISPLAY);
+ return platform;
+}
- if (display)
- return reinterpret_cast<intptr_t>(display);
+bool GLOzoneEGLQt::CanImportNativePixmap()
+{
+ return gl::GLSurfaceEGL::GetGLDisplayEGL()->ext->b_EGL_EXT_image_dma_buf_import;
+}
- return reinterpret_cast<intptr_t>(EGL_DEFAULT_DISPLAY);
+std::unique_ptr<NativePixmapGLBinding> GLOzoneEGLQt::ImportNativePixmap(
+ scoped_refptr<gfx::NativePixmap> pixmap,
+ gfx::BufferFormat plane_format,
+ gfx::BufferPlane plane,
+ gfx::Size plane_size,
+ const gfx::ColorSpace &color_space,
+ GLenum target,
+ GLuint texture_id)
+{
+ return NativePixmapEGLBinding::Create(pixmap, plane_format, plane, plane_size, color_space,
+ target, texture_id);
}
} // namespace ui
diff --git a/src/core/ozone/gl_ozone_egl_qt.h b/src/core/ozone/gl_ozone_egl_qt.h
index c24d03a81..7ac55979a 100644
--- a/src/core/ozone/gl_ozone_egl_qt.h
+++ b/src/core/ozone/gl_ozone_egl_qt.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef GL_OZONE_EGL_QT
#define GL_OZONE_EGL_QT
@@ -48,20 +12,33 @@ namespace ui {
class GLOzoneEGLQt : public GLOzoneEGL {
public:
- bool InitializeGLOneOffPlatform() override;
- bool InitializeExtensionSettingsOneOffPlatform() override;
+ gl::GLDisplay *InitializeGLOneOffPlatform(bool supports_angle,
+ std::vector<gl::DisplayType> init_displays,
+ gl::GpuPreference gpu_preference) override;
+ bool InitializeExtensionSettingsOneOffPlatform(gl::GLDisplay *display) override;
scoped_refptr<gl::GLSurface> CreateViewGLSurface(
+ gl::GLDisplay *display,
gfx::AcceleratedWidget window) override;
scoped_refptr<gl::GLSurface> CreateOffscreenGLSurface(
- const gfx::Size& size) override;
+ gl::GLDisplay *display,
+ const gfx::Size &size) override;
+ bool CanImportNativePixmap() override;
+ std::unique_ptr<NativePixmapGLBinding> ImportNativePixmap(
+ scoped_refptr<gfx::NativePixmap> pixmap,
+ gfx::BufferFormat plane_format,
+ gfx::BufferPlane plane,
+ gfx::Size plane_size,
+ const gfx::ColorSpace &color_space,
+ GLenum target,
+ GLuint texture_id) override;
protected:
// Returns native platform display handle. This is used to obtain the EGL
// display connection for the native display.
- intptr_t GetNativeDisplay() override;
+ gl::EGLDisplayPlatform GetNativeDisplay() override;
// Sets up GL bindings for the native surface.
- bool LoadGLES2Bindings(gl::GLImplementation implementation) override;
+ bool LoadGLES2Bindings(const gl::GLImplementationParts &implementation) override;
};
} // namespace ui
diff --git a/src/core/ozone/gl_ozone_glx_qt.cpp b/src/core/ozone/gl_ozone_glx_qt.cpp
index 0c54299ba..23ba92ea4 100644
--- a/src/core/ozone/gl_ozone_glx_qt.cpp
+++ b/src/core/ozone/gl_ozone_glx_qt.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
@@ -45,23 +9,25 @@
#include "gl_ozone_glx_qt.h"
#include "gl_surface_glx_qt.h"
#include "gl_context_qt.h"
+
+#include "media/gpu/buildflags.h"
#include "ui/gl/gl_context_glx.h"
#include "ui/gl/gl_gl_api_implementation.h"
#include "ui/gl/gl_glx_api_implementation.h"
+#include "ui/gl/presenter.h"
+
#include <dlfcn.h>
namespace ui {
-bool GLOzoneGLXQt::InitializeGLOneOffPlatform() {
- if (!gl::GLSurfaceGLXQt::InitializeOneOff()) {
- LOG(ERROR) << "GLSurfaceGLXQt::InitializeOneOff failed.";
- return false;
- }
- return true;
+gl::GLDisplay *GLOzoneGLXQt::InitializeGLOneOffPlatform(bool, std::vector<gl::DisplayType>, gl::GpuPreference preference)
+{
+ return gl::GLSurfaceGLXQt::InitializeOneOff(preference);
}
bool GLOzoneGLXQt::InitializeStaticGLBindings(
- gl::GLImplementation implementation) {
+ const gl::GLImplementationParts &implementation) {
+ Q_UNUSED(implementation);
base::NativeLibrary library = dlopen(NULL, RTLD_LAZY);
if (!library) {
@@ -95,18 +61,12 @@ bool GLOzoneGLXQt::InitializeStaticGLBindings(
return true;
}
-void GLOzoneGLXQt::InitializeLogGLBindings()
-{
- gl::InitializeLogGLBindingsGL();
- gl::InitializeLogGLBindingsGLX();
-}
-
void GLOzoneGLXQt::SetDisabledExtensionsPlatform(
const std::string& disabled_extensions) {
gl::SetDisabledExtensionsGLX(disabled_extensions);
}
-void GLOzoneGLXQt::ShutdownGL() {
+void GLOzoneGLXQt::ShutdownGL(gl::GLDisplay *) {
gl::ClearBindingsGL();
gl::ClearBindingsGLX();
}
@@ -127,16 +87,19 @@ scoped_refptr<gl::GLContext> GLOzoneGLXQt::CreateGLContext(
}
scoped_refptr<gl::GLSurface> GLOzoneGLXQt::CreateViewGLSurface(
+ gl::GLDisplay* display,
gfx::AcceleratedWidget window) {
return nullptr;
}
-scoped_refptr<gl::GLSurface> GLOzoneGLXQt::CreateSurfacelessViewGLSurface(
+scoped_refptr<gl::Presenter> GLOzoneGLXQt::CreateSurfacelessViewGLSurface(
+ gl::GLDisplay* display,
gfx::AcceleratedWidget window) {
return nullptr;
}
scoped_refptr<gl::GLSurface> GLOzoneGLXQt::CreateOffscreenGLSurface(
+ gl::GLDisplay* display,
const gfx::Size& size) {
scoped_refptr<gl::GLSurface> surface = new gl::GLSurfaceGLXQt(size);
if (surface->Initialize(gl::GLSurfaceFormat()))
@@ -145,7 +108,19 @@ scoped_refptr<gl::GLSurface> GLOzoneGLXQt::CreateOffscreenGLSurface(
return nullptr;
}
-bool GLOzoneGLXQt::InitializeExtensionSettingsOneOffPlatform()
+bool GLOzoneGLXQt::CanImportNativePixmap()
+{
+ return false;
+}
+
+std::unique_ptr<ui::NativePixmapGLBinding> GLOzoneGLXQt::ImportNativePixmap(
+ scoped_refptr<gfx::NativePixmap> pixmap, gfx::BufferFormat plane_format, gfx::BufferPlane plane,
+ gfx::Size plane_size, const gfx::ColorSpace &, GLenum target, GLuint texture_id)
+{
+ return nullptr;
+}
+
+bool GLOzoneGLXQt::InitializeExtensionSettingsOneOffPlatform(gl::GLDisplay *)
{
return gl::GLSurfaceGLXQt::InitializeExtensionSettingsOneOff();
}
diff --git a/src/core/ozone/gl_ozone_glx_qt.h b/src/core/ozone/gl_ozone_glx_qt.h
index 8f85ea23b..4df26ba71 100644
--- a/src/core/ozone/gl_ozone_glx_qt.h
+++ b/src/core/ozone/gl_ozone_glx_qt.h
@@ -1,46 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef UI_OZONE_GLX_QT_H_
-#define UI_OZONE_GLX_QT_H
+#define UI_OZONE_GLX_QT_H_
-#include "base/macros.h"
#include "ui/gl/gl_implementation.h"
#include "ui/ozone/public/gl_ozone.h"
@@ -52,35 +15,39 @@ public:
GLOzoneGLXQt() {}
~GLOzoneGLXQt() override {}
- bool InitializeGLOneOffPlatform() override;
- bool InitializeStaticGLBindings(gl::GLImplementation implementation) override;
- void InitializeLogGLBindings() override;
- bool InitializeExtensionSettingsOneOffPlatform() override;
- void ShutdownGL() override;
+ gl::GLDisplay *InitializeGLOneOffPlatform(bool, std::vector<gl::DisplayType>, gl::GpuPreference) override;
+ bool InitializeStaticGLBindings(const gl::GLImplementationParts &implementation) override;
+ bool InitializeExtensionSettingsOneOffPlatform(gl::GLDisplay *display) override;
+ void ShutdownGL(gl::GLDisplay *display) override;
void SetDisabledExtensionsPlatform(
const std::string& disabled_extensions) override;
bool GetGLWindowSystemBindingInfo(
const gl::GLVersionInfo &gl_info,
gl::GLWindowSystemBindingInfo *info) override;
+ bool CanImportNativePixmap() override;
+ std::unique_ptr<ui::NativePixmapGLBinding> ImportNativePixmap(
+ scoped_refptr<gfx::NativePixmap>, gfx::BufferFormat, gfx::BufferPlane,
+ gfx::Size, const gfx::ColorSpace &, GLenum, GLuint) override;
+
scoped_refptr<gl::GLContext> CreateGLContext(
gl::GLShareGroup* share_group,
gl::GLSurface* compatible_surface,
const gl::GLContextAttribs& attribs) override;
scoped_refptr<gl::GLSurface> CreateViewGLSurface(
+ gl::GLDisplay* display,
gfx::AcceleratedWidget window) override;
- scoped_refptr<gl::GLSurface> CreateSurfacelessViewGLSurface(
+ scoped_refptr<gl::Presenter> CreateSurfacelessViewGLSurface(
+ gl::GLDisplay* display,
gfx::AcceleratedWidget window) override;
scoped_refptr<gl::GLSurface> CreateOffscreenGLSurface(
+ gl::GLDisplay* display,
const gfx::Size& size) override;
-
-private:
- DISALLOW_COPY_AND_ASSIGN(GLOzoneGLXQt);
};
} // namespace ui
-#endif // UI_OZONE_GLX_QT_H
+#endif // UI_OZONE_GLX_QT_H_
diff --git a/src/core/ozone/gl_share_context_qt.cpp b/src/core/ozone/gl_share_context_qt.cpp
new file mode 100644
index 000000000..b1c5e201f
--- /dev/null
+++ b/src/core/ozone/gl_share_context_qt.cpp
@@ -0,0 +1,77 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "gl_share_context_qt.h"
+#include <QtGui/qtgui-config.h>
+#include <qpa/qplatformnativeinterface.h>
+
+#include "ui/gl/gl_context_egl.h"
+#include "ui/gl/gl_implementation.h"
+
+#if QT_CONFIG(opengl)
+#include <QtGui/qopenglcontext_platform.h>
+#include <QOpenGLContext>
+#include <QOpenGLExtraFunctions>
+#endif // QT_CONFIG(opengl)
+
+namespace QtWebEngineCore {
+
+QtShareGLContext::QtShareGLContext(QOpenGLContext *context)
+ : gl::GLContext(nullptr), m_handle(nullptr)
+{
+#if QT_CONFIG(opengl)
+#if defined(Q_OS_MACOS)
+ qFatal("macOS only support using ANGLE.");
+#endif
+#if defined(Q_OS_WIN)
+ auto *win_ctx = context->nativeInterface<QNativeInterface::QWGLContext>();
+ if (win_ctx && !m_handle)
+ m_handle = (void *)win_ctx->nativeContext();
+#endif
+#if QT_CONFIG(xcb_glx_plugin)
+ auto *glx_ctx = context->nativeInterface<QNativeInterface::QGLXContext>();
+ if (glx_ctx && !m_handle)
+ m_handle = (void *)glx_ctx->nativeContext();
+#endif
+#if QT_CONFIG(egl)
+ auto *egl_ctx = context->nativeInterface<QNativeInterface::QEGLContext>();
+ if (egl_ctx && !m_handle)
+ m_handle = (void *)egl_ctx->nativeContext();
+#endif
+ if (!m_handle)
+ qFatal("Could not get handle for shared context.");
+#endif // QT_CONFIG(opengl)
+}
+
+unsigned int QtShareGLContext::CheckStickyGraphicsResetStatusImpl()
+{
+#if QT_CONFIG(opengl)
+ if (QOpenGLContext *context = QOpenGLContext::globalShareContext()) {
+ if (context->format().testOption(QSurfaceFormat::ResetNotification))
+ return context->extraFunctions()->glGetGraphicsResetStatus();
+ }
+#endif
+ return 0 /*GL_NO_ERROR*/;
+}
+
+void ShareGroupQt::AboutToAddFirstContext()
+{
+ if (gl::GetGLImplementation() == gl::kGLImplementationEGLANGLE) {
+ m_shareContextQt = new gl::GLContextEGL(nullptr);
+ return;
+ }
+
+#if QT_CONFIG(opengl)
+ // This currently has to be setup by ::main in all applications using QQuickWebEngineView with
+ // delegated rendering.
+ QOpenGLContext *shareContext = QOpenGLContext::globalShareContext();
+ if (!shareContext) {
+ qFatal("QWebEngine: OpenGL resource sharing is not set up in QtQuick. Please make sure to "
+ "call QtWebEngineQuick::initialize() in your main() function before "
+ "QCoreApplication is created.");
+ }
+ m_shareContextQt = new QtShareGLContext(shareContext);
+#endif // QT_CONFIG(opengl)
+}
+
+} // namespace
diff --git a/src/core/ozone/gl_share_context_qt.h b/src/core/ozone/gl_share_context_qt.h
new file mode 100644
index 000000000..89be00421
--- /dev/null
+++ b/src/core/ozone/gl_share_context_qt.h
@@ -0,0 +1,63 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef GL_SHARE_CONTEXT_QT
+#define GL_SHARE_CONTEXT_QT
+
+#include "ui/gl/gpu_timing.h"
+#include "ui/gl/gl_context.h"
+#include "ui/gl/gl_share_group.h"
+#include "qtwebenginecoreglobal.h"
+
+QT_FORWARD_DECLARE_CLASS(QOpenGLContext)
+
+namespace QtWebEngineCore {
+
+class QtShareGLContext : public gl::GLContext
+{
+
+public:
+ QtShareGLContext(QOpenGLContext *qtContext);
+ void *GetHandle() override { return m_handle; }
+ unsigned int CheckStickyGraphicsResetStatusImpl() override;
+ // We don't care about the rest, this context shouldn't be used except for its handle.
+ bool Initialize(gl::GLSurface *, const gl::GLContextAttribs &) override
+ {
+ Q_UNREACHABLE();
+ return false;
+ }
+ bool MakeCurrentImpl(gl::GLSurface *) override
+ {
+ Q_UNREACHABLE();
+ return false;
+ }
+ void ReleaseCurrent(gl::GLSurface *) override { Q_UNREACHABLE(); }
+ bool IsCurrent(gl::GLSurface *) override
+ {
+ Q_UNREACHABLE();
+ return false;
+ }
+ scoped_refptr<gl::GPUTimingClient> CreateGPUTimingClient() override { return nullptr; }
+ const gfx::ExtensionSet &GetExtensions() override
+ {
+ static const gfx::ExtensionSet s_emptySet;
+ return s_emptySet;
+ }
+ void ResetExtensions() override {}
+
+private:
+ void *m_handle;
+};
+
+class ShareGroupQt : public gl::GLShareGroup
+{
+
+public:
+ gl::GLContext *GetContext() override { return m_shareContextQt.get(); }
+ void AboutToAddFirstContext() override;
+
+private:
+ scoped_refptr<gl::GLContext> m_shareContextQt;
+};
+} // namespace
+#endif
diff --git a/src/core/ozone/gl_surface_egl_qt.cpp b/src/core/ozone/gl_surface_egl_qt.cpp
index ac0e79b67..a0c120ac6 100644
--- a/src/core/ozone/gl_surface_egl_qt.cpp
+++ b/src/core/ozone/gl_surface_egl_qt.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
@@ -44,58 +8,60 @@
#include "gl_context_qt.h"
#include "ozone/gl_surface_egl_qt.h"
-#if !defined(OS_MACOSX)
#include "ui/gl/egl_util.h"
-#include "ui/gl/gl_surface_egl.h"
+#include "ui/gl/gl_bindings.h"
+#include "ui/gl/gl_display.h"
+#include "ui/gl/gl_display_manager.h"
#include "ui/gl/init/gl_factory.h"
-// From ANGLE's egl/eglext.h.
-#ifndef EGL_ANGLE_surface_d3d_texture_2d_share_handle
-#define EGL_ANGLE_surface_d3d_texture_2d_share_handle 1
-#define EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE 0x3200
-#endif
+#if !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_WIN)
using ui::GetLastEGLErrorString;
-namespace gl{
+namespace gl {
bool GLSurfaceEGLQt::g_egl_surfaceless_context_supported = false;
bool GLSurfaceEGLQt::s_initialized = false;
+GLSurfaceEGLQt::GLSurfaceEGLQt(gl::GLDisplayEGL *display, const gfx::Size& size)
+ : GLSurfaceQt(size),
+ m_surfaceBuffer(0)
+{
+}
+
GLSurfaceEGLQt::~GLSurfaceEGLQt()
{
Destroy();
}
-bool GLSurfaceEGLQt::InitializeOneOff()
+gl::GLDisplay *GLSurfaceEGLQt::InitializeOneOff(gl::GpuPreference preference)
{
if (s_initialized)
- return true;
-
- // Must be called before initializing the display.
- g_driver_egl.InitializeClientExtensionBindings();
+ return g_display;
- g_display = GLContextHelper::getEGLDisplay();
- if (!g_display) {
+ auto *egl_display = GLDisplayManagerEGL::GetInstance()->GetDisplay(preference);
+ g_display = egl_display;
+ egl_display->SetDisplay(GLContextHelper::getEGLDisplay());
+ if (!egl_display->GetDisplay()) {
LOG(ERROR) << "GLContextHelper::getEGLDisplay() failed.";
- return false;
+ return nullptr;
}
g_config = GLContextHelper::getEGLConfig();
if (!g_config) {
LOG(ERROR) << "GLContextHelper::getEGLConfig() failed.";
- return false;
+ return nullptr;
}
- if (!eglInitialize(g_display, NULL, NULL)) {
+ if (!eglInitialize(egl_display->GetDisplay(), NULL, NULL)) {
LOG(ERROR) << "eglInitialize failed with error " << GetLastEGLErrorString();
- return false;
+ return nullptr;
}
- g_extensions = eglQueryString(g_display, EGL_EXTENSIONS);
- g_egl_surfaceless_context_supported = ExtensionsContain(g_extensions, "EGL_KHR_surfaceless_context");
+ g_extensions = eglQueryString(egl_display->GetDisplay(), EGL_EXTENSIONS);
+ g_egl_surfaceless_context_supported = ExtensionsContain(g_extensions.c_str(), "EGL_KHR_surfaceless_context");
if (g_egl_surfaceless_context_supported) {
- scoped_refptr<GLSurface> surface = new GLSurfacelessQtEGL(gfx::Size(1, 1));
+ scoped_refptr<GLSurface> surface = new GLSurfacelessQtEGL(egl_display, gfx::Size(1, 1));
gl::GLContextAttribs attribs;
scoped_refptr<GLContext> context = init::CreateGLContext(
NULL, surface.get(), attribs);
@@ -111,11 +77,8 @@ bool GLSurfaceEGLQt::InitializeOneOff()
}
}
- // Must be called after initializing the display.
- g_driver_egl.InitializeExtensionBindings();
-
s_initialized = true;
- return true;
+ return egl_display;
}
bool GLSurfaceEGLQt::InitializeExtensionSettingsOneOff()
@@ -123,100 +86,12 @@ bool GLSurfaceEGLQt::InitializeExtensionSettingsOneOff()
return s_initialized;
}
-bool GLSurfaceEGL::InitializeExtensionSettingsOneOff()
-{
- return GLSurfaceEGLQt::InitializeExtensionSettingsOneOff();
-}
-
-EGLDisplay GLSurfaceEGL::GetHardwareDisplay()
-{
- return static_cast<EGLDisplay>(GLSurfaceQt::g_display);
-}
-
-bool GLSurfaceEGL::IsCreateContextRobustnessSupported()
-{
- return GLContextHelper::isCreateContextRobustnessSupported() && HasEGLExtension("EGL_EXT_create_context_robustness");
-}
-
-bool GLSurfaceEGL::IsCreateContextBindGeneratesResourceSupported()
-{
- return false;
-}
-
-bool GLSurfaceEGL::IsCreateContextWebGLCompatabilitySupported()
-{
- return false;
-}
-bool GLSurfaceEGL::IsEGLSurfacelessContextSupported()
-{
- return GLSurfaceEGLQt::g_egl_surfaceless_context_supported;
-}
-bool GLSurfaceEGL::IsEGLContextPrioritySupported()
-{
- return false;
-}
-
-bool GLSurfaceEGL::IsRobustResourceInitSupported()
-{
- return false;
-}
-
-bool GLSurfaceEGL::IsDisplayTextureShareGroupSupported()
-{
- return false;
-}
-
-bool GLSurfaceEGL::IsCreateContextClientArraysSupported()
-{
- return false;
-}
-
-bool GLSurfaceEGL::IsPixelFormatFloatSupported()
-{
- return false;
-}
-
-bool GLSurfaceEGL::IsANGLEFeatureControlSupported()
-{
- return false;
-}
-
-void GLSurfaceEGL::ShutdownOneOff()
-{
-}
-
-const char* GLSurfaceEGL::GetEGLExtensions()
-{
- return GLSurfaceQt::g_extensions;
-}
-
-bool GLSurfaceEGL::HasEGLExtension(const char* name)
-{
- return ExtensionsContain(GetEGLExtensions(), name);
-}
-
-bool GLSurfaceEGL::InitializeOneOff(EGLNativeDisplayType /*native_display*/)
-{
- return GLSurfaceEGLQt::InitializeOneOff();
-}
-
-bool GLSurfaceEGL::IsAndroidNativeFenceSyncSupported()
-{
- return false;
-}
-
-GLSurfaceEGLQt::GLSurfaceEGLQt(const gfx::Size& size)
- : GLSurfaceQt(size),
- m_surfaceBuffer(0)
-{
-}
-
bool GLSurfaceEGLQt::Initialize(GLSurfaceFormat format)
{
Q_ASSERT(!m_surfaceBuffer);
m_format = format;
- EGLDisplay display = g_display;
+ EGLDisplay display = GLContextHelper::getEGLDisplay();
if (!display) {
LOG(ERROR) << "Trying to create surface with invalid display.";
return false;
@@ -244,7 +119,7 @@ bool GLSurfaceEGLQt::Initialize(GLSurfaceFormat format)
void GLSurfaceEGLQt::Destroy()
{
if (m_surfaceBuffer) {
- if (!eglDestroySurface(g_display, m_surfaceBuffer))
+ if (!eglDestroySurface(GLContextHelper::getEGLDisplay(), m_surfaceBuffer))
LOG(ERROR) << "eglDestroySurface failed with error " << GetLastEGLErrorString();
m_surfaceBuffer = 0;
@@ -252,7 +127,7 @@ void GLSurfaceEGLQt::Destroy()
}
bool GLSurfaceEGLQt::Resize(const gfx::Size& size, float scale_factor,
- ColorSpace color_space, bool has_alpha)
+ const gfx::ColorSpace &color_space, bool has_alpha)
{
if (size == m_size)
return true;
@@ -282,7 +157,7 @@ void* GLSurfaceEGLQt::GetHandle()
return reinterpret_cast<void*>(m_surfaceBuffer);
}
-GLSurfacelessQtEGL::GLSurfacelessQtEGL(const gfx::Size& size)
+GLSurfacelessQtEGL::GLSurfacelessQtEGL(GLDisplayEGL *display, const gfx::Size& size)
: GLSurfaceQt(size)
{
}
@@ -303,7 +178,7 @@ bool GLSurfacelessQtEGL::IsSurfaceless() const
}
bool GLSurfacelessQtEGL::Resize(const gfx::Size& size, float scale_factor,
- ColorSpace color_space, bool has_alpha)
+ const gfx::ColorSpace &color_space, bool has_alpha)
{
m_size = size;
return true;
@@ -319,26 +194,5 @@ void* GLSurfacelessQtEGL::GetShareHandle()
return NULL;
}
-std::string DriverEGL::GetPlatformExtensions()
-{
- EGLDisplay display = GLContextHelper::getEGLDisplay();
- if (display == EGL_NO_DISPLAY)
- return "";
-
- DCHECK(g_driver_egl.fn.eglQueryStringFn);
- const char* str = g_driver_egl.fn.eglQueryStringFn(display, EGL_EXTENSIONS);
- return str ? std::string(str) : "";
-}
-} // namespace gl
-#else
-namespace gl {
-struct GL_EXPORT DriverEGL {
- static std::string GetPlatformExtensions();
-};
-
-std::string DriverEGL::GetPlatformExtensions()
-{
- return "";
-}
} // namespace gl
-#endif // !defined(OS_MACOSX)
+#endif // !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_WIN)
diff --git a/src/core/ozone/gl_surface_egl_qt.h b/src/core/ozone/gl_surface_egl_qt.h
index ecc2327b3..d581f9079 100644
--- a/src/core/ozone/gl_surface_egl_qt.h
+++ b/src/core/ozone/gl_surface_egl_qt.h
@@ -1,63 +1,29 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef GL_SURFACE_EGL_QT_H_
#define GL_SURFACE_EGL_QT_H_
#include "gl_surface_qt.h"
#include <EGL/egl.h>
-#include <EGL/eglext.h>
namespace gl {
+class GLDisplayEGL;
+
class GLSurfaceEGLQt: public GLSurfaceQt {
public:
- explicit GLSurfaceEGLQt(const gfx::Size& size);
+ explicit GLSurfaceEGLQt(gl::GLDisplayEGL *display, const gfx::Size& size);
- static bool InitializeOneOff();
+ static gl::GLDisplay *InitializeOneOff(gl::GpuPreference preference);
static bool InitializeExtensionSettingsOneOff();
bool Initialize(GLSurfaceFormat format) override;
void Destroy() override;
void* GetHandle() override;
bool Resize(const gfx::Size& size, float scale_factor,
- ColorSpace color_space, bool has_alpha) override;
+ const gfx::ColorSpace &color_space, bool has_alpha) override;
+
protected:
~GLSurfaceEGLQt();
@@ -68,7 +34,6 @@ public:
private:
EGLSurface m_surfaceBuffer;
static bool s_initialized;
- DISALLOW_COPY_AND_ASSIGN(GLSurfaceEGLQt);
};
// The following comment is cited from chromium/ui/gl/gl_surface_egl.cc:
@@ -78,19 +43,16 @@ private:
class GLSurfacelessQtEGL : public GLSurfaceQt {
public:
- explicit GLSurfacelessQtEGL(const gfx::Size& size);
+ explicit GLSurfacelessQtEGL(gl::GLDisplayEGL *display, const gfx::Size& size);
public:
bool Initialize(GLSurfaceFormat format) override;
void Destroy() override;
bool IsSurfaceless() const override;
bool Resize(const gfx::Size& size, float scale_factor,
- ColorSpace color_space, bool has_alpha) override;
+ const gfx::ColorSpace &color_space, bool has_alpha) override;
EGLSurface GetHandle() override;
void* GetShareHandle() override;
-
-private:
- DISALLOW_COPY_AND_ASSIGN(GLSurfacelessQtEGL);
};
}
diff --git a/src/core/ozone/gl_surface_glx_qt.cpp b/src/core/ozone/gl_surface_glx_qt.cpp
index e150c940a..61c9ef9de 100644
--- a/src/core/ozone/gl_surface_glx_qt.cpp
+++ b/src/core/ozone/gl_surface_glx_qt.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
@@ -43,27 +7,23 @@
#include "gl_context_qt.h"
#include "ozone/gl_surface_glx_qt.h"
+
#include "ui/gl/gl_bindings.h"
+#include "ui/gl/gl_display.h"
+#include "ui/gl/gl_display_manager.h"
+#include "ui/gl/gl_surface.h"
#include "ui/gl/gl_surface_glx.h"
-#include <GL/glx.h>
-#include <GL/glxext.h>
namespace gl {
-bool GLSurfaceGLXQt::s_initialized = false;
-
-GLSurfaceGLXQt::~GLSurfaceGLXQt()
-{
- Destroy();
-}
-
-void GLSurfaceGLX::ShutdownOneOff()
+static bool HasGLXExtension(const char *name)
{
+ return GLSurface::ExtensionsContain(GLSurfaceQt::g_extensions.c_str(), name);
}
bool GLSurfaceGLX::IsCreateContextSupported()
{
- return ExtensionsContain(GLSurfaceQt::g_extensions, "GLX_ARB_create_context");
+ return HasGLXExtension("GLX_ARB_create_context");
}
bool GLSurfaceGLX::IsCreateContextRobustnessSupported()
@@ -71,16 +31,6 @@ bool GLSurfaceGLX::IsCreateContextRobustnessSupported()
return GLContextHelper::isCreateContextRobustnessSupported() && HasGLXExtension("GLX_ARB_create_context_robustness");
}
-bool GLSurfaceGLX::IsEXTSwapControlSupported()
-{
- return HasGLXExtension("GLX_EXT_swap_control");
-}
-
-bool GLSurfaceGLX::IsMESASwapControlSupported()
-{
- return HasGLXExtension("GLX_MESA_swap_control");
-}
-
bool GLSurfaceGLX::IsCreateContextProfileSupported()
{
return false; // ExtensionsContain(g_extensions, "GLX_ARB_create_context_profile");
@@ -88,92 +38,83 @@ bool GLSurfaceGLX::IsCreateContextProfileSupported()
bool GLSurfaceGLX::IsCreateContextES2ProfileSupported()
{
- return ExtensionsContain(GLSurfaceQt::g_extensions, "GLX_ARB_create_context_es2_profile");
+ return HasGLXExtension("GLX_ARB_create_context_es2_profile");
}
-bool GLSurfaceGLX::IsOMLSyncControlSupported()
+bool GLSurfaceGLX::IsRobustnessVideoMemoryPurgeSupported()
{
- return false; // ExtensionsContain(g_extensions, "GLX_OML_sync_control");
+ return false;
}
-bool GLSurfaceGLX::HasGLXExtension(const char *name)
-{
- return ExtensionsContain(GLSurfaceQt::g_extensions, name);
-}
-bool GLSurfaceGLX::IsTextureFromPixmapSupported()
+bool GLSurfaceGLXQt::s_initialized = false;
+
+GLSurfaceGLXQt::GLSurfaceGLXQt(const gfx::Size& size)
+ : GLSurfaceQt(size),
+ m_surfaceBuffer(0)
{
- return ExtensionsContain(GLSurfaceQt::g_extensions, "GLX_EXT_texture_from_pixmap");
}
-const char* GLSurfaceGLX::GetGLXExtensions()
+GLSurfaceGLXQt::~GLSurfaceGLXQt()
{
- return GLSurfaceQt::g_extensions;
+ Destroy();
}
-bool GLSurfaceGLXQt::InitializeOneOff()
+GLDisplay *GLSurfaceGLXQt::InitializeOneOff(gl::GpuPreference preference)
{
if (s_initialized)
- return true;
+ return g_display;
- XInitThreads();
-
- g_display = GLContextHelper::getXDisplay();
- if (!g_display) {
+ g_display = GLDisplayManagerX11::GetInstance()->GetDisplay(preference);
+ if (!g_display->GetDisplay()) {
LOG(ERROR) << "GLContextHelper::getXDisplay() failed.";
- return false;
+ return nullptr;
}
g_config = GLContextHelper::getGlXConfig();
if (!g_config) {
LOG(ERROR) << "GLContextHelper::getGlxConfig() failed.";
- return false;
+ return nullptr;
}
- Display* display = static_cast<Display*>(g_display);
+ Display* display = static_cast<Display*>(g_display->GetDisplay());
int major, minor;
if (!glXQueryVersion(display, &major, &minor)) {
LOG(ERROR) << "glxQueryVersion failed.";
- return false;
+ return nullptr;
}
if (major == 1 && minor < 3) {
LOG(ERROR) << "GLX 1.3 or later is required.";
- return false;
+ return nullptr;
}
s_initialized = true;
- return true;
+ return g_display;
}
-
bool GLSurfaceGLXQt::InitializeExtensionSettingsOneOff()
{
if (!s_initialized)
return false;
- Display* display = static_cast<Display*>(g_display);
+ Display* display = static_cast<Display*>(g_display->GetDisplay());
GLSurfaceQt::g_extensions = glXQueryExtensionsString(display, 0);
- g_driver_glx.InitializeExtensionBindings(g_extensions);
+ g_driver_glx.InitializeExtensionBindings(g_extensions.c_str());
return true;
}
-bool GLSurfaceGLX::InitializeExtensionSettingsOneOff()
-{
- return GLSurfaceGLXQt::InitializeExtensionSettingsOneOff();
-}
-
bool GLSurfaceGLXQt::Initialize(GLSurfaceFormat format)
{
Q_ASSERT(!m_surfaceBuffer);
- Display* display = static_cast<Display*>(g_display);
+ Display* display = static_cast<Display*>(g_display->GetDisplay());
const int pbuffer_attributes[] = {
GLX_PBUFFER_WIDTH, m_size.width(),
GLX_PBUFFER_HEIGHT, m_size.height(),
- GLX_LARGEST_PBUFFER, x11::False,
- GLX_PRESERVED_CONTENTS, x11::False,
- x11::None // MEMO doc: ...must be terminated with None or NULL
+ GLX_LARGEST_PBUFFER, GL_FALSE,
+ GLX_PRESERVED_CONTENTS, GL_FALSE,
+ GL_NONE // MEMO doc: ...must be terminated with None or NULL
};
m_surfaceBuffer = glXCreatePbuffer(display, static_cast<GLXFBConfig>(g_config), pbuffer_attributes);
@@ -190,17 +131,11 @@ bool GLSurfaceGLXQt::Initialize(GLSurfaceFormat format)
void GLSurfaceGLXQt::Destroy()
{
if (m_surfaceBuffer) {
- glXDestroyPbuffer(static_cast<Display*>(g_display), m_surfaceBuffer);
+ glXDestroyPbuffer(static_cast<Display*>(g_display->GetDisplay()), m_surfaceBuffer);
m_surfaceBuffer = 0;
}
}
-GLSurfaceGLXQt::GLSurfaceGLXQt(const gfx::Size& size)
- : GLSurfaceQt(size),
- m_surfaceBuffer(0)
-{
-}
-
void* GLSurfaceGLXQt::GetHandle()
{
return reinterpret_cast<void*>(m_surfaceBuffer);
diff --git a/src/core/ozone/gl_surface_glx_qt.h b/src/core/ozone/gl_surface_glx_qt.h
index 3a465f448..8cbf1fcf2 100644
--- a/src/core/ozone/gl_surface_glx_qt.h
+++ b/src/core/ozone/gl_surface_glx_qt.h
@@ -1,58 +1,18 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef GL_SURFACE_GLX_QT_H_
#define GL_SURFACE_GLX_QT_H_
#include "gl_surface_qt.h"
-extern "C" {
-#include <X11/Xlib.h>
-}
-
namespace gl {
class GLSurfaceGLXQt: public GLSurfaceQt {
public:
explicit GLSurfaceGLXQt(const gfx::Size& size);
- static bool InitializeOneOff();
+ static gl::GLDisplay *InitializeOneOff(gl::GpuPreference preference);
static bool InitializeExtensionSettingsOneOff();
bool Initialize(GLSurfaceFormat format) override;
@@ -64,8 +24,7 @@ protected:
private:
static bool s_initialized;
- XID m_surfaceBuffer;
- DISALLOW_COPY_AND_ASSIGN(GLSurfaceGLXQt);
+ int m_surfaceBuffer;
};
}
diff --git a/src/core/ozone/gl_surface_qt.cpp b/src/core/ozone/gl_surface_qt.cpp
index 4be17f12b..0cbe75cbd 100644
--- a/src/core/ozone/gl_surface_qt.cpp
+++ b/src/core/ozone/gl_surface_qt.cpp
@@ -1,84 +1,39 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE.Chromium file.
+#include "qtwebenginecoreglobal_p.h"
+
+#if !defined(Q_OS_MACOS)
+
#include "gl_surface_qt.h"
-#if !defined(OS_MACOSX)
+#include "base/logging.h"
-#include <QGuiApplication>
-#include "gl_context_qt.h"
-#include "qtwebenginecoreglobal_p.h"
+#if BUILDFLAG(IS_WIN)
#include "web_engine_context.h"
-#include "ozone/gl_surface_egl_qt.h"
+#include "ozone/gl_surface_wgl_qt.h"
-#include "base/logging.h"
-#include "base/threading/thread_restrictions.h"
#include "gpu/ipc/service/image_transport_surface.h"
-#include "ui/gl/gl_bindings.h"
-#include "ui/gl/gl_context.h"
+#include "ui/gl/init/gl_display_initializer.h"
+#include "ui/gl/direct_composition_support.h"
+#include "ui/gl/gl_angle_util_win.h"
+#include "ui/gl/gl_display.h"
#include "ui/gl/gl_implementation.h"
-#include "ui/gl/init/gl_initializer.h"
-#include "ui/gl/init/gl_factory.h"
-#include "ui/gl/gl_gl_api_implementation.h"
-#if defined(OS_WIN)
-#include "ozone/gl_surface_wgl_qt.h"
-
-#include "ui/gl/direct_composition_surface_win.h"
+#include "ui/gl/gl_surface_egl.h"
+#include "ui/gl/gl_utils.h"
#include "ui/gl/vsync_provider_win.h"
#endif
-#include "ozone/gl_surface_egl_qt.h"
-#include "ui/gl/gl_egl_api_implementation.h"
namespace gl {
-namespace {
-bool g_initializedEGL = false;
-}
-
-void* GLSurfaceQt::g_display = nullptr;
-void* GLSurfaceQt::g_config = nullptr;
-const char* GLSurfaceQt::g_extensions = nullptr;
+GLDisplay *GLSurfaceQt::g_display = nullptr;
+void *GLSurfaceQt::g_config = nullptr;
+std::string GLSurfaceQt::g_extensions;
GLSurfaceQt::~GLSurfaceQt()
{
@@ -99,7 +54,7 @@ GLSurfaceQt::GLSurfaceQt(const gfx::Size& size)
bool GLSurfaceQt::HasEGLExtension(const char* name)
{
- return ExtensionsContain(g_extensions, name);
+ return ExtensionsContain(g_extensions.c_str(), name);
}
bool GLSurfaceQt::IsOffscreen()
@@ -107,7 +62,7 @@ bool GLSurfaceQt::IsOffscreen()
return true;
}
-gfx::SwapResult GLSurfaceQt::SwapBuffers(PresentationCallback callback)
+gfx::SwapResult GLSurfaceQt::SwapBuffers(PresentationCallback callback, gfx::FrameData data)
{
LOG(ERROR) << "Attempted to call SwapBuffers on a pbuffer.";
Q_UNREACHABLE();
@@ -124,7 +79,7 @@ GLSurfaceFormat GLSurfaceQt::GetFormat()
return m_format;
}
-void* GLSurfaceQt::GetDisplay()
+GLDisplay *GLSurfaceQt::GetGLDisplay()
{
return g_display;
}
@@ -134,35 +89,47 @@ void* GLSurfaceQt::GetConfig()
return g_config;
}
-#if defined(OS_WIN)
+#if BUILDFLAG(IS_WIN)
namespace init {
-bool InitializeGLOneOffPlatform()
+
+gl::GLDisplay *InitializeGLOneOffPlatform(gl::GpuPreference gpu_preference)
{
VSyncProviderWin::InitializeOneOff();
- if (GetGLImplementation() == kGLImplementationEGLGLES2 || GetGLImplementation() == kGLImplementationEGLANGLE)
- return GLSurfaceEGLQt::InitializeOneOff();
+ if (GetGLImplementation() == kGLImplementationDesktopGL || GetGLImplementation() == kGLImplementationDesktopGLCoreProfile)
+ return GLSurfaceWGLQt::InitializeOneOff(gpu_preference);
- if (GetGLImplementation() == kGLImplementationDesktopGL) {
- return GLSurfaceWGLQt::InitializeOneOff();
-
- // Fallback to trying EGL with desktop GL.
- if (GLSurfaceEGLQt::InitializeOneOff()) {
- g_initializedEGL = true;
- return true;
+ GLDisplayEGL *display = GetDisplayEGL(gpu_preference);
+ switch (GetGLImplementation()) {
+ case kGLImplementationEGLANGLE:
+ case kGLImplementationEGLGLES2:
+ if (!InitializeDisplay(display, EGLDisplayPlatform(GetDC(nullptr)))) {
+ LOG(ERROR) << "GLDisplayEGL::Initialize failed.";
+ return nullptr;
}
+ if (auto d3d11_device = QueryD3D11DeviceObjectFromANGLE())
+ InitializeDirectComposition(std::move(d3d11_device));
+ break;
+ case kGLImplementationMockGL:
+ case kGLImplementationStubGL:
+ break;
+ default:
+ NOTREACHED();
}
-
- return false;
+ return display;
}
bool usingSoftwareDynamicGL()
{
+#if QT_CONFIG(opengl)
return QtWebEngineCore::usingSoftwareDynamicGL();
+#else
+ return false;
+#endif // QT_CONFIG(opengl)
}
scoped_refptr<GLSurface>
-CreateOffscreenGLSurfaceWithFormat(const gfx::Size& size, GLSurfaceFormat format)
+CreateOffscreenGLSurfaceWithFormat(GLDisplay *display, const gfx::Size& size, GLSurfaceFormat format)
{
scoped_refptr<GLSurface> surface;
switch (GetGLImplementation()) {
@@ -175,21 +142,10 @@ CreateOffscreenGLSurfaceWithFormat(const gfx::Size& size, GLSurfaceFormat format
}
case kGLImplementationEGLANGLE:
case kGLImplementationEGLGLES2: {
- surface = new GLSurfaceEGLQt(size);
- if (surface->Initialize(format))
- return surface;
-
- // Surfaceless context will be used ONLY if pseudo surfaceless context
- // is not available since some implementations of surfaceless context
- // have problems. (e.g. QTBUG-57290)
- if (GLSurfaceEGLQt::g_egl_surfaceless_context_supported) {
- surface = new GLSurfacelessQtEGL(size);
- if (surface->Initialize(format))
- return surface;
- }
- LOG(ERROR) << "eglCreatePbufferSurface failed and surfaceless context not available";
- LOG(WARNING) << "Failed to create offscreen GL surface";
- break;
+ GLDisplayEGL *display_egl = display->GetAs<gl::GLDisplayEGL>();
+ if (display_egl->IsEGLSurfacelessContextSupported() && size.width() == 0 && size.height() == 0)
+ return InitializeGLSurfaceWithFormat(new SurfacelessEGL(display_egl, size), format);
+ return InitializeGLSurfaceWithFormat(new PbufferGLSurfaceEGL(display_egl, size), format);
}
default:
break;
@@ -200,49 +156,13 @@ CreateOffscreenGLSurfaceWithFormat(const gfx::Size& size, GLSurfaceFormat format
}
scoped_refptr<GLSurface>
-CreateViewGLSurface(gfx::AcceleratedWidget window)
+CreateViewGLSurface(GLDisplay *display, gfx::AcceleratedWidget window)
{
- QT_NOT_USED
return nullptr;
}
} // namespace init
-#endif // defined(OS_WIN)
+#endif // BUILDFLAG(IS_WIN)
} // namespace gl
-#if defined(OS_WIN)
-namespace gpu {
-class GpuCommandBufferStub;
-class GpuChannelManager;
-scoped_refptr<gl::GLSurface> ImageTransportSurface::CreateNativeSurface(base::WeakPtr<ImageTransportSurfaceDelegate>,
- SurfaceHandle, gl::GLSurfaceFormat)
-{
- QT_NOT_USED
- return scoped_refptr<gl::GLSurface>();
-}
-} // namespace gpu
-
-namespace gl {
-
-bool DirectCompositionSurfaceWin::IsDirectCompositionSupported()
-{
- return false;
-}
-
-bool DirectCompositionSurfaceWin::IsDecodeSwapChainSupported()
-{
- return false;
-}
-
-bool DirectCompositionSurfaceWin::IsHDRSupported()
-{
- return false;
-}
-
-bool DirectCompositionSurfaceWin::IsSwapChainTearingSupported()
-{
- return false;
-}
-} // namespace gl
-#endif
-#endif // !defined(OS_MACOSX)
+#endif // !defined(Q_OS_MACOS)
diff --git a/src/core/ozone/gl_surface_qt.h b/src/core/ozone/gl_surface_qt.h
index cbdc8876a..1ae41a078 100644
--- a/src/core/ozone/gl_surface_qt.h
+++ b/src/core/ozone/gl_surface_qt.h
@@ -1,47 +1,11 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef GL_SURFACE_QT_H_
#define GL_SURFACE_QT_H_
+#include <string>
+
#include "ui/gfx/geometry/size.h"
#include "ui/gl/gl_surface.h"
@@ -54,10 +18,10 @@ public:
static bool HasEGLExtension(const char* name);
// Implement GLSurface.
- void *GetDisplay() override;
+ GLDisplay *GetGLDisplay() override;
void *GetConfig() override;
bool IsOffscreen() override;
- gfx::SwapResult SwapBuffers(PresentationCallback callback) override;
+ gfx::SwapResult SwapBuffers(PresentationCallback callback, gfx::FrameData data) override;
gfx::Size GetSize() override;
GLSurfaceFormat GetFormat() override;
@@ -70,13 +34,10 @@ protected:
public:
static void* g_config;
- static void* g_display;
- static const char* g_extensions;
-
-private:
- DISALLOW_COPY_AND_ASSIGN(GLSurfaceQt);
+ static GLDisplay *g_display;
+ static std::string g_extensions;
};
-}
+} // namespace gl
-#endif
+#endif // GL_SURFACE_QT_H_
diff --git a/src/core/ozone/gl_surface_wgl_qt.cpp b/src/core/ozone/gl_surface_wgl_qt.cpp
index ac27a9c20..db4aed884 100644
--- a/src/core/ozone/gl_surface_wgl_qt.cpp
+++ b/src/core/ozone/gl_surface_wgl_qt.cpp
@@ -1,45 +1,10 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "gl_surface_wgl_qt.h"
-#if defined(OS_WIN)
+#if BUILDFLAG(IS_WIN)
+#include "ui/gl/gl_display_manager.h"
#include "ui/gl/gl_surface_wgl.h"
namespace gl {
@@ -55,9 +20,12 @@ GLSurfaceWGLQt::~GLSurfaceWGLQt()
Destroy();
}
-bool GLSurfaceWGLQt::InitializeOneOff()
+gl::GLDisplay *GLSurfaceWGLQt::InitializeOneOff(gl::GpuPreference gpu_preference)
{
- return GLSurfaceWGL::InitializeOneOff();
+ if (GLSurfaceWGL::InitializeOneOff())
+ return GLDisplayManagerWGL::GetInstance()->GetDisplay(gpu_preference);
+
+ return nullptr;
}
bool GLSurfaceWGLQt::Initialize(GLSurfaceFormat format)
@@ -77,9 +45,9 @@ void *GLSurfaceWGLQt::GetHandle()
return m_surfaceBuffer->GetHandle();
}
-void *GLSurfaceWGLQt::GetDisplay()
+GLDisplay *GLSurfaceWGLQt::GetGLDisplay()
{
- return m_surfaceBuffer->GetDisplay();
+ return m_surfaceBuffer->GetGLDisplay();
}
void *GLSurfaceWGLQt::GetConfig()
@@ -89,4 +57,4 @@ void *GLSurfaceWGLQt::GetConfig()
} //namespace gl
-#endif // defined(OS_WIN)
+#endif // BUILDFLAG(IS_WIN)
diff --git a/src/core/ozone/gl_surface_wgl_qt.h b/src/core/ozone/gl_surface_wgl_qt.h
index 2b562b61b..6c590e46c 100644
--- a/src/core/ozone/gl_surface_wgl_qt.h
+++ b/src/core/ozone/gl_surface_wgl_qt.h
@@ -1,48 +1,12 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef GL_SURFACE_WGL_QT_H
#define GL_SURFACE_WGL_QT_H
#include "gl_surface_qt.h"
-#if defined(OS_WIN)
+#if BUILDFLAG(IS_WIN)
namespace gl {
@@ -52,12 +16,12 @@ class GLSurfaceWGLQt: public GLSurfaceQt {
public:
explicit GLSurfaceWGLQt(const gfx::Size& size);
- static bool InitializeOneOff();
+ static gl::GLDisplay *InitializeOneOff(gl::GpuPreference gpu_preference);
bool Initialize(GLSurfaceFormat format) override;
void Destroy() override;
void *GetHandle() override;
- void *GetDisplay() override;
+ GLDisplay *GetGLDisplay() override;
void *GetConfig() override;
protected:
@@ -65,10 +29,9 @@ protected:
private:
scoped_refptr<PbufferGLSurfaceWGL> m_surfaceBuffer;
- DISALLOW_COPY_AND_ASSIGN(GLSurfaceWGLQt);
};
}
-#endif // defined(OS_WIN)
+#endif // BUILDFLAG(IS_WIN)
#endif // GL_SURFACE_WGL_QT_H
diff --git a/src/core/ozone/ozone_extra.gni b/src/core/ozone/ozone_extra.gni
index a832f741a..191bb3787 100644
--- a/src/core/ozone/ozone_extra.gni
+++ b/src/core/ozone/ozone_extra.gni
@@ -17,3 +17,17 @@ ozone_external_platform_deps = []
# so that they get included into ozone_unittests.
# ozone_external_platform_test_deps = [ "platform/foo1:foo1_unitests", ... ]
ozone_external_platform_test_deps = []
+
+# If a platform has integration tests, the corresponding source_set can be
+# listed here so that they get included into ozone_integration_tests.
+ozone_external_platform_integration_test_deps = []
+
+# If a platform has test support files for ui, the corresponding source_set can
+# be listed here so that they get included into ui_test_support.
+# ozone_external_platform_ui_test_support_deps = [ "platform/foo1:ui_test_support", ... ]
+ozone_external_platform_ui_test_support_deps = []
+
+# If a platform has a test support for interactive_ui_tests, the corresponding
+# source_set can be listed here so that they can included into
+# interactive_ui_tests.
+ozone_external_interactive_ui_tests_deps = []
diff --git a/src/core/ozone/ozone_platform_qt.cpp b/src/core/ozone/ozone_platform_qt.cpp
index fb5af18c5..e8547fa87 100644
--- a/src/core/ozone/ozone_platform_qt.cpp
+++ b/src/core/ozone/ozone_platform_qt.cpp
@@ -1,61 +1,50 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "ozone_platform_qt.h"
#if defined(USE_OZONE)
+#include "base/no_destructor.h"
+#include "base/task/thread_pool.h"
+#include "media/gpu/buildflags.h"
+#include "ui/base/buildflags.h"
#include "ui/base/ime/input_method.h"
#include "ui/display/types/native_display_delegate.h"
-#include "ui/ozone/common/stub_client_native_pixmap_factory.h"
+#include "ui/events/ozone/layout/keyboard_layout_engine_manager.h"
+#include "ui/events/ozone/layout/stub/stub_keyboard_layout_engine.h"
+#include "ui/gfx/linux/client_native_pixmap_dmabuf.h"
+#include "ui/gfx/linux/client_native_pixmap_factory_dmabuf.h"
+#include "ui/ozone/common/bitmap_cursor_factory.h"
#include "ui/ozone/common/stub_overlay_manager.h"
-#include "ui/ozone/public/cursor_factory_ozone.h"
#include "ui/ozone/public/gpu_platform_support_host.h"
#include "ui/ozone/public/input_controller.h"
#include "ui/ozone/public/ozone_platform.h"
#include "ui/ozone/public/platform_screen.h"
#include "ui/ozone/public/system_input_injector.h"
+#include "ui/ozone/platform/wayland/gpu/wayland_gl_egl_utility.h"
#include "ui/platform_window/platform_window_delegate.h"
#include "ui/platform_window/platform_window_init_properties.h"
#include "surface_factory_qt.h"
#include "platform_window_qt.h"
+#if BUILDFLAG(USE_XKBCOMMON)
+#include "base/logging.h"
+#include "ui/events/ozone/layout/xkb/xkb_evdev_codes.h"
+#include "ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.h"
+
+#include <X11/XKBlib.h>
+#include <X11/extensions/XKBrules.h>
+#include <filesystem>
+#endif // BUILDFLAG(USE_XKBCOMMON)
+
+#if BUILDFLAG(OZONE_PLATFORM_X11)
+#include "ui/gfx/linux/gpu_memory_buffer_support_x11.h"
+#include "ui/ozone/platform/x11/gl_egl_utility_x11.h"
+
+extern void *GetQtXDisplay();
+#endif
+
namespace ui {
namespace {
@@ -66,27 +55,48 @@ public:
~OzonePlatformQt() override;
ui::SurfaceFactoryOzone* GetSurfaceFactoryOzone() override;
- ui::CursorFactoryOzone* GetCursorFactoryOzone() override;
+ ui::CursorFactory* GetCursorFactory() override;
GpuPlatformSupportHost* GetGpuPlatformSupportHost() override;
std::unique_ptr<PlatformWindow> CreatePlatformWindow(PlatformWindowDelegate* delegate, PlatformWindowInitProperties properties) override;
std::unique_ptr<display::NativeDisplayDelegate> CreateNativeDisplayDelegate() override;
ui::InputController* GetInputController() override;
std::unique_ptr<ui::SystemInputInjector> CreateSystemInputInjector() override;
ui::OverlayManagerOzone* GetOverlayManager() override;
- std::unique_ptr<InputMethod> CreateInputMethod(internal::InputMethodDelegate *delegate) override;
+ std::unique_ptr<InputMethod> CreateInputMethod(ImeKeyEventDispatcher *ime_key_event_dispatcher, gfx::AcceleratedWidget widget) override;
std::unique_ptr<ui::PlatformScreen> CreateScreen() override { return nullptr; }
+ const PlatformProperties &GetPlatformProperties() override;
+ PlatformGLEGLUtility *GetPlatformGLEGLUtility() override;
+
+ const PlatformRuntimeProperties &GetPlatformRuntimeProperties() override
+ {
+ static OzonePlatform::PlatformRuntimeProperties properties;
+ if (has_initialized_gpu()) {
+ // This property is set when the GetPlatformRuntimeProperties is
+ // called on the gpu process side.
+ properties.supports_native_pixmaps = surface_factory_ozone_->SupportsNativePixmaps();
+ }
+ return properties;
+ }
+ bool IsNativePixmapConfigSupported(gfx::BufferFormat format, gfx::BufferUsage usage) const override;
+
private:
- void InitializeUI(const ui::OzonePlatform::InitParams &) override;
+ bool InitializeUI(const ui::OzonePlatform::InitParams &) override;
void InitializeGPU(const ui::OzonePlatform::InitParams &) override;
+ void InitScreen(ui::PlatformScreen *) override {}
+
std::unique_ptr<QtWebEngineCore::SurfaceFactoryQt> surface_factory_ozone_;
- std::unique_ptr<CursorFactoryOzone> cursor_factory_ozone_;
+ std::unique_ptr<CursorFactory> cursor_factory_;
std::unique_ptr<GpuPlatformSupportHost> gpu_platform_support_host_;
std::unique_ptr<InputController> input_controller_;
std::unique_ptr<OverlayManagerOzone> overlay_manager_;
- DISALLOW_COPY_AND_ASSIGN(OzonePlatformQt);
+#if BUILDFLAG(USE_XKBCOMMON)
+ XkbEvdevCodes m_xkbEvdevCodeConverter;
+#endif
+ std::unique_ptr<KeyboardLayoutEngine> m_keyboardLayoutEngine;
+ std::unique_ptr<PlatformGLEGLUtility> gl_egl_utility_;
};
@@ -94,14 +104,29 @@ OzonePlatformQt::OzonePlatformQt() {}
OzonePlatformQt::~OzonePlatformQt() {}
+const ui::OzonePlatform::PlatformProperties &OzonePlatformQt::GetPlatformProperties()
+{
+ static base::NoDestructor<ui::OzonePlatform::PlatformProperties> properties;
+ static bool initialized = false;
+ if (!initialized) {
+ properties->fetch_buffer_formats_for_gmb_on_gpu = true;
+#if BUILDFLAG(USE_VAAPI)
+ properties->supports_vaapi = true;
+#endif
+ initialized = true;
+ }
+
+ return *properties;
+}
+
ui::SurfaceFactoryOzone* OzonePlatformQt::GetSurfaceFactoryOzone()
{
return surface_factory_ozone_.get();
}
-ui::CursorFactoryOzone* OzonePlatformQt::GetCursorFactoryOzone()
+ui::CursorFactory* OzonePlatformQt::GetCursorFactory()
{
- return cursor_factory_ozone_.get();
+ return cursor_factory_.get();
}
GpuPlatformSupportHost* OzonePlatformQt::GetGpuPlatformSupportHost()
@@ -135,32 +160,122 @@ std::unique_ptr<display::NativeDisplayDelegate> OzonePlatformQt::CreateNativeDis
return nullptr;
}
-void OzonePlatformQt::InitializeUI(const ui::OzonePlatform::InitParams &)
+#if BUILDFLAG(USE_XKBCOMMON)
+static std::string getCurrentKeyboardLayout()
{
+ Display *dpy = static_cast<Display *>(GetQtXDisplay());
+ if (dpy == nullptr)
+ return std::string();
+
+ int d;
+ if (!XkbQueryExtension(dpy, &d, &d, &d, &d, &d)) {
+ // no Xkb extension
+ return std::string();
+ }
+
+ XkbStateRec state;
+ if (XkbGetState(dpy, XkbUseCoreKbd, &state) != 0)
+ return std::string();
+
+ XkbRF_VarDefsRec vdr {}; // zero initialize it
+ struct Cleanup {
+ XkbRF_VarDefsRec &vdr;
+ Cleanup(XkbRF_VarDefsRec &vdr) : vdr(vdr) { }
+ ~Cleanup() {
+ free (vdr.model);
+ free (vdr.layout);
+ free (vdr.variant);
+ free (vdr.options);
+ }
+ } cleanup(vdr);
+ if (XkbRF_GetNamesProp(dpy, nullptr, &vdr) == 0)
+ return std::string();
+
+ if (!vdr.layout)
+ return std::string();
+
+ if (!vdr.variant)
+ return std::string(vdr.layout);
+
+ std::string layoutWithVariant = vdr.layout;
+ layoutWithVariant = layoutWithVariant.append("-");
+ layoutWithVariant = layoutWithVariant.append(vdr.variant);
+
+ return layoutWithVariant;
+}
+#endif // BUILDFLAG(USE_XKBCOMMON)
+
+bool OzonePlatformQt::InitializeUI(const ui::OzonePlatform::InitParams &)
+{
+#if BUILDFLAG(USE_XKBCOMMON)
+ std::string xkb_path("/usr/share/X11/xkb");
+ std::string layout = getCurrentKeyboardLayout();
+ if (layout.empty() || !std::filesystem::exists(xkb_path) || std::filesystem::is_empty(xkb_path)) {
+ LOG(WARNING) << "Failed to load keymap file, falling back to StubKeyboardLayoutEngine";
+ m_keyboardLayoutEngine = std::make_unique<StubKeyboardLayoutEngine>();
+ } else {
+ m_keyboardLayoutEngine = std::make_unique<XkbKeyboardLayoutEngine>(m_xkbEvdevCodeConverter);
+ m_keyboardLayoutEngine->SetCurrentLayoutByName(layout);
+ }
+#else
+ m_keyboardLayoutEngine = std::make_unique<StubKeyboardLayoutEngine>();
+#endif // BUILDFLAG(USE_XKBCOMMON)
+
+ KeyboardLayoutEngineManager::SetKeyboardLayoutEngine(m_keyboardLayoutEngine.get());
+
overlay_manager_.reset(new StubOverlayManager());
- cursor_factory_ozone_.reset(new CursorFactoryOzone());
- gpu_platform_support_host_.reset(ui::CreateStubGpuPlatformSupportHost());
input_controller_ = CreateStubInputController();
+ cursor_factory_.reset(new BitmapCursorFactory());
+ gpu_platform_support_host_.reset(ui::CreateStubGpuPlatformSupportHost());
+ return true;
}
-void OzonePlatformQt::InitializeGPU(const ui::OzonePlatform::InitParams &)
+void OzonePlatformQt::InitializeGPU(const ui::OzonePlatform::InitParams &params)
{
surface_factory_ozone_.reset(new QtWebEngineCore::SurfaceFactoryQt());
+
+#if BUILDFLAG(OZONE_PLATFORM_X11)
+ if (params.enable_native_gpu_memory_buffers) {
+ base::ThreadPool::PostTask(FROM_HERE,
+ base::BindOnce([]()
+ {
+ ui::GpuMemoryBufferSupportX11::GetInstance();
+ }));
+ }
+#endif
}
-std::unique_ptr<InputMethod> OzonePlatformQt::CreateInputMethod(internal::InputMethodDelegate *)
+std::unique_ptr<InputMethod> OzonePlatformQt::CreateInputMethod(ImeKeyEventDispatcher *, gfx::AcceleratedWidget)
{
NOTREACHED();
return nullptr;
}
+bool OzonePlatformQt::IsNativePixmapConfigSupported(gfx::BufferFormat format, gfx::BufferUsage usage) const
+{
+ return gfx::ClientNativePixmapDmaBuf::IsConfigurationSupported(format, usage);
+}
+
+PlatformGLEGLUtility *OzonePlatformQt::GetPlatformGLEGLUtility()
+{
+ if (!gl_egl_utility_) {
+#if BUILDFLAG(OZONE_PLATFORM_X11)
+ if (GetQtXDisplay())
+ gl_egl_utility_ = std::make_unique<GLEGLUtilityX11>();
+ else
+#endif
+ gl_egl_utility_ = std::make_unique<WaylandGLEGLUtility>();
+ }
+ return gl_egl_utility_.get();
+}
+
} // namespace
OzonePlatform* CreateOzonePlatformQt() { return new OzonePlatformQt; }
-gfx::ClientNativePixmapFactory* CreateClientNativePixmapFactoryQt()
+gfx::ClientNativePixmapFactory *CreateClientNativePixmapFactoryQt()
{
- return CreateStubClientNativePixmapFactory();
+ return gfx::CreateClientNativePixmapFactoryDmabuf();
}
} // namespace ui
diff --git a/src/core/ozone/ozone_platform_qt.h b/src/core/ozone/ozone_platform_qt.h
index dee66beb3..23629b2eb 100644
--- a/src/core/ozone/ozone_platform_qt.h
+++ b/src/core/ozone/ozone_platform_qt.h
@@ -1,55 +1,15 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef OZONE_PLATFORM_QT_H
#define OZONE_PLATFORM_QT_H
-#if defined(USE_OZONE)
-
-#include "ui/ozone/public/ozone_platform.h"
-
namespace ui {
+class OzonePlatform;
// Constructor hook for use in ozone_platform_list.cc
-OzonePlatform* CreateOzonePlatformQt();
+OzonePlatform *CreateOzonePlatformQt();
} // namespace ui
-#endif // defined(USE_OZONE)
#endif // OZONE_PLATFORM_QT_H
diff --git a/src/core/ozone/platform_window_qt.cpp b/src/core/ozone/platform_window_qt.cpp
index 757c042f0..4923f0f88 100644
--- a/src/core/ozone/platform_window_qt.cpp
+++ b/src/core/ozone/platform_window_qt.cpp
@@ -1,46 +1,11 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#if defined(USE_OZONE)
-#include "base/bind.h"
+#include "base/functional/bind.h"
#include "ozone/platform_window_qt.h"
+#include "ui/base/cursor/platform_cursor.h"
#include "ui/events/ozone/events_ozone.h"
#include "ui/events/platform/platform_event_source.h"
#include "ui/platform_window/platform_window_delegate.h"
@@ -59,17 +24,24 @@ PlatformWindowQt::~PlatformWindowQt()
ui::PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this);
}
-gfx::Rect PlatformWindowQt::GetBounds()
+gfx::Rect PlatformWindowQt::GetBoundsInPixels() const
{
return bounds_;
}
-void PlatformWindowQt::SetBounds(const gfx::Rect& bounds)
+void PlatformWindowQt::Close()
+{
+ delegate_->OnClosed();
+}
+
+void PlatformWindowQt::SetBoundsInPixels(const gfx::Rect& bounds)
{
if (bounds == bounds_)
return;
+ const bool origin_changed = (bounds_.origin() != bounds.origin());
+
bounds_ = bounds;
- delegate_->OnBoundsChanged(bounds);
+ delegate_->OnBoundsChanged({origin_changed});
}
bool PlatformWindowQt::CanDispatchEvent(const ui::PlatformEvent& /*ne*/)
@@ -77,11 +49,21 @@ bool PlatformWindowQt::CanDispatchEvent(const ui::PlatformEvent& /*ne*/)
return true;
}
+gfx::Rect PlatformWindowQt::GetBoundsInDIP() const
+{
+ return delegate_->ConvertRectToDIP(bounds_);
+}
+
+void PlatformWindowQt::SetBoundsInDIP(const gfx::Rect &bounds_in_dip)
+{
+ SetBoundsInPixels(delegate_->ConvertRectToPixels(bounds_in_dip));
+}
+
uint32_t PlatformWindowQt::DispatchEvent(const ui::PlatformEvent& native_event)
{
DispatchEventFromNativeUiEvent(
- native_event, base::Bind(&PlatformWindowDelegate::DispatchEvent,
- base::Unretained(delegate_)));
+ native_event, base::BindOnce(&PlatformWindowDelegate::DispatchEvent,
+ base::Unretained(delegate_)));
return ui::POST_DISPATCH_STOP_PROPAGATION;
}
diff --git a/src/core/ozone/platform_window_qt.h b/src/core/ozone/platform_window_qt.h
index b1021df9d..c025102bb 100644
--- a/src/core/ozone/platform_window_qt.h
+++ b/src/core/ozone/platform_window_qt.h
@@ -1,47 +1,12 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef PLATFORM_WINDOW_QT_H
#define PLATFORM_WINDOW_QT_H
#if defined(USE_OZONE)
+#include "ui/base/cursor/platform_cursor.h"
#include "ui/events/platform/platform_event_dispatcher.h"
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/rect.h"
@@ -56,26 +21,28 @@ public:
PlatformWindowQt(PlatformWindowDelegate* delegate, const gfx::Rect& bounds);
~PlatformWindowQt() override;
// PlatformWindow:
- gfx::Rect GetBounds() override;
- void SetBounds(const gfx::Rect& bounds) override;
+ gfx::Rect GetBoundsInPixels() const override;
+ void SetBoundsInPixels(const gfx::Rect& bounds) override;
+ gfx::Rect GetBoundsInDIP() const override;
+ void SetBoundsInDIP(const gfx::Rect& bounds) override;
void Show(bool inactive = false) override { }
void Hide() override { }
- void Close() override { }
- bool IsVisible() const { return true; }
- void SetTitle(const base::string16&) override { }
+ void Close() override;
+ bool IsVisible() const override { return true; }
+ void SetTitle(const std::u16string&) override { }
void SetCapture() override { }
void ReleaseCapture() override { }
bool HasCapture() const override { return false; }
- void ToggleFullscreen() override { }
+ void SetFullscreen(bool, int64_t) override { }
void Maximize() override { }
void Minimize() override { }
void Restore() override { }
PlatformWindowState GetPlatformWindowState() const override { return PlatformWindowState::kUnknown; }
- void SetCursor(PlatformCursor) override { }
+ void SetCursor(scoped_refptr<PlatformCursor>) override { }
void MoveCursorTo(const gfx::Point&) override { }
void ConfineCursorToBounds(const gfx::Rect&) override { }
- void SetRestoredBoundsInPixels(const gfx::Rect& bounds) override { }
- gfx::Rect GetRestoredBoundsInPixels() const override { return gfx::Rect(); }
+ void SetRestoredBoundsInDIP(const gfx::Rect& bounds) override { }
+ gfx::Rect GetRestoredBoundsInDIP() const override { return gfx::Rect(); }
void Activate() override { }
void Deactivate() override { }
void SetUseNativeFrame(bool use_native_frame) override { }
@@ -92,8 +59,6 @@ public:
private:
PlatformWindowDelegate* delegate_;
gfx::Rect bounds_;
-
- DISALLOW_COPY_AND_ASSIGN(PlatformWindowQt);
};
}
diff --git a/src/core/ozone/surface_factory_qt.cpp b/src/core/ozone/surface_factory_qt.cpp
index 5420b4809..204f4d62d 100644
--- a/src/core/ozone/surface_factory_qt.cpp
+++ b/src/core/ozone/surface_factory_qt.cpp
@@ -1,85 +1,260 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+#if defined(USE_OZONE)
#include "surface_factory_qt.h"
-#include "gl_context_qt.h"
-#include "gl_ozone_egl_qt.h"
-#if defined(USE_GLX)
-#include "gl_ozone_glx_qt.h"
-#endif
-#include "ui/gl/gl_surface.h"
-#include <QGuiApplication>
+#include "qtwebenginecoreglobal_p.h"
+#include "ozone/gl_context_qt.h"
+#include "ozone/gl_ozone_egl_qt.h"
-#if defined(USE_OZONE)
+#include "media/gpu/buildflags.h"
+#include "ui/gfx/linux/drm_util_linux.h"
+#include "ui/gfx/linux/gbm_buffer.h"
+#include "ui/gfx/linux/native_pixmap_dmabuf.h"
+#include "ui/gl/egl_util.h"
+#include "ui/ozone/buildflags.h"
+
+#include <QDebug>
+#include <QtGui/qtgui-config.h>
+
+#if BUILDFLAG(OZONE_PLATFORM_X11)
+#include "ozone/gl_ozone_glx_qt.h"
+
+#include "ui/gfx/linux/gpu_memory_buffer_support_x11.h"
+#endif
+
+#if QT_CONFIG(webengine_vulkan)
+#include "compositor/vulkan_implementation_qt.h"
+#endif
-#include "ozone/gl_ozone_egl_qt.h"
-#include "ozone/surface_factory_qt.h"
-#include "ui/gl/gl_surface.h"
namespace QtWebEngineCore {
SurfaceFactoryQt::SurfaceFactoryQt()
{
- Q_ASSERT(qApp);
-#if defined(USE_GLX)
- if (GLContextHelper::getGlXConfig()) {
- m_impl = gl::kGLImplementationDesktopGL;
+#if BUILDFLAG(OZONE_PLATFORM_X11)
+ if (GLContextHelper::getGlxPlatformInterface()) {
+ m_impl = { gl::GLImplementationParts(gl::kGLImplementationDesktopGL),
+ gl::GLImplementationParts(gl::kGLImplementationDisabled) };
m_ozone.reset(new ui::GLOzoneGLXQt());
} else
#endif
- if (GLContextHelper::getEGLConfig()) {
- m_impl = gl::kGLImplementationEGLGLES2;
+ if (GLContextHelper::getEglPlatformInterface()) {
+ m_impl = { gl::GLImplementationParts(gl::kGLImplementationEGLGLES2),
+ gl::GLImplementationParts(gl::kGLImplementationDesktopGL),
+ gl::GLImplementationParts(gl::kGLImplementationDisabled) };
m_ozone.reset(new ui::GLOzoneEGLQt());
} else {
- qFatal("No suitable graphics backend found\n");
+ m_impl = { gl::GLImplementationParts(gl::kGLImplementationDisabled) };
}
}
-std::vector<gl::GLImplementation> SurfaceFactoryQt::GetAllowedGLImplementations()
+std::vector<gl::GLImplementationParts> SurfaceFactoryQt::GetAllowedGLImplementations()
{
- return { m_impl };
+ return m_impl;
}
-ui::GLOzone* SurfaceFactoryQt::GetGLOzone(gl::GLImplementation implementation)
+ui::GLOzone *SurfaceFactoryQt::GetGLOzone(const gl::GLImplementationParts &implementation)
{
return m_ozone.get();
}
+#if BUILDFLAG(ENABLE_VULKAN)
+std::unique_ptr<gpu::VulkanImplementation>
+SurfaceFactoryQt::CreateVulkanImplementation(bool /*allow_protected_memory*/,
+ bool /*enforce_protected_memory*/)
+{
+#if QT_CONFIG(webengine_vulkan)
+ return std::make_unique<gpu::VulkanImplementationQt>();
+#else
+ return nullptr;
+#endif
+}
+#endif
+
+bool SurfaceFactoryQt::CanCreateNativePixmapForFormat(gfx::BufferFormat format)
+{
+#if BUILDFLAG(OZONE_PLATFORM_X11)
+ if (GLContextHelper::getGlxPlatformInterface())
+ return ui::GpuMemoryBufferSupportX11::GetInstance()->CanCreateNativePixmapForFormat(format);
+#endif
+
+ if (GLContextHelper::getEglPlatformInterface())
+ return ui::SurfaceFactoryOzone::CanCreateNativePixmapForFormat(format);
+
+ return false;
+}
+
+scoped_refptr<gfx::NativePixmap> SurfaceFactoryQt::CreateNativePixmap(
+ gfx::AcceleratedWidget widget,
+ gpu::VulkanDeviceQueue *device_queue,
+ gfx::Size size,
+ gfx::BufferFormat format,
+ gfx::BufferUsage usage,
+ absl::optional<gfx::Size> framebuffer_size)
+{
+ Q_ASSERT(SupportsNativePixmaps());
+
+#if QT_CONFIG(opengl)
+ if (framebuffer_size && !gfx::Rect(size).Contains(gfx::Rect(*framebuffer_size)))
+ return nullptr;
+
+ gfx::NativePixmapHandle handle;
+
+#if BUILDFLAG(OZONE_PLATFORM_X11)
+ if (GLContextHelper::getGlxPlatformInterface()) {
+ auto gbmBuffer =
+ ui::GpuMemoryBufferSupportX11::GetInstance()->CreateBuffer(format, size, usage);
+ if (!gbmBuffer)
+ qFatal("Failed to create GBM buffer for GLX.");
+ handle = gbmBuffer->ExportHandle();
+ }
+#endif
+
+ if (GLContextHelper::getEglPlatformInterface()) {
+ int fd = -1;
+ int stride;
+ int offset;
+ uint64_t modifiers;
+ EGLHelper::instance()->queryDmaBuf(size.width(), size.height(), &fd, &stride, &offset,
+ &modifiers);
+ if (fd == -1)
+ qFatal("Failed to query DRM FD for EGL.");
+
+ const uint64_t planeSize = uint64_t(size.width()) * size.height() * 4;
+ gfx::NativePixmapPlane plane(stride, offset, planeSize, base::ScopedFD(::dup(fd)));
+
+ handle.planes.push_back(std::move(plane));
+ handle.modifier = modifiers;
+ }
+
+ return base::MakeRefCounted<gfx::NativePixmapDmaBuf>(size, format, std::move(handle));
+#else
+ return nullptr;
+#endif // QT_CONFIG(opengl)
+}
+
+void SurfaceFactoryQt::CreateNativePixmapAsync(
+ gfx::AcceleratedWidget widget,
+ gpu::VulkanDeviceQueue *device_queue,
+ gfx::Size size,
+ gfx::BufferFormat format,
+ gfx::BufferUsage usage,
+ NativePixmapCallback callback)
+{
+ Q_ASSERT(SupportsNativePixmaps());
+ // CreateNativePixmap is non-blocking operation. Thus, it is safe to call it
+ // and return the result with the provided callback.
+ std::move(callback).Run(CreateNativePixmap(widget, device_queue, size, format, usage));
+}
+
+scoped_refptr<gfx::NativePixmap>
+SurfaceFactoryQt::CreateNativePixmapFromHandle(
+ gfx::AcceleratedWidget /*widget*/,
+ gfx::Size size,
+ gfx::BufferFormat format,
+ gfx::NativePixmapHandle handle)
+{
+ Q_ASSERT(SupportsNativePixmaps());
+
+#if QT_CONFIG(opengl)
+ gfx::NativePixmapHandle bufferHandle;
+
+#if BUILDFLAG(OZONE_PLATFORM_X11)
+ if (GLContextHelper::getGlxPlatformInterface()) {
+ auto gbmBuffer = ui::GpuMemoryBufferSupportX11::GetInstance()->CreateBufferFromHandle(
+ size, format, std::move(handle));
+ if (!gbmBuffer)
+ qFatal("Failed to create GBM buffer for GLX.");
+ bufferHandle = gbmBuffer->ExportHandle();
+ }
+#endif
+
+ if (GLContextHelper::getEglPlatformInterface()) {
+ const size_t numPlanes = handle.planes.size();
+ const uint32_t fourccFormat = ui::GetFourCCFormatFromBufferFormat(format);
+
+ std::vector<EGLAttrib> attrs;
+ attrs.push_back(EGL_WIDTH);
+ attrs.push_back(size.width());
+ attrs.push_back(EGL_HEIGHT);
+ attrs.push_back(size.height());
+ attrs.push_back(EGL_LINUX_DRM_FOURCC_EXT);
+ attrs.push_back(fourccFormat);
+ for (size_t planeIndex = 0; planeIndex < numPlanes; ++planeIndex) {
+ attrs.push_back(EGL_DMA_BUF_PLANE0_FD_EXT + planeIndex * 3);
+ attrs.push_back(handle.planes[planeIndex].fd.get());
+ attrs.push_back(EGL_DMA_BUF_PLANE0_OFFSET_EXT + planeIndex * 3);
+ attrs.push_back(handle.planes[planeIndex].offset);
+ attrs.push_back(EGL_DMA_BUF_PLANE0_PITCH_EXT + planeIndex * 3);
+ attrs.push_back(handle.planes[planeIndex].stride);
+ attrs.push_back(EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT + planeIndex * 2);
+ attrs.push_back(handle.modifier & 0xffffffff);
+ attrs.push_back(EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT + planeIndex * 2);
+ attrs.push_back(handle.modifier >> 32);
+ }
+ attrs.push_back(EGL_NONE);
+
+ EGLDisplay eglDisplay = GLContextHelper::getEGLDisplay();
+ EGLHelper *eglHelper = EGLHelper::instance();
+ auto *eglFun = eglHelper->functions();
+
+ EGLImage eglImage =
+ eglFun->eglCreateImage(eglDisplay, EGL_NO_CONTEXT, EGL_LINUX_DMA_BUF_EXT,
+ (EGLClientBuffer)NULL, attrs.data());
+ if (eglImage == EGL_NO_IMAGE_KHR) {
+ qFatal() << "Failed to import EGLImage:"
+ << ui::GetEGLErrorString(eglFun->eglGetError());
+ }
+
+ Q_ASSERT(numPlanes <= 3);
+ int fds[3];
+ int strides[3];
+ int offsets[3];
+ if (!eglFun->eglExportDMABUFImageMESA(eglDisplay, eglImage, fds, strides, offsets)) {
+ qFatal() << "Failed to export EGLImage:"
+ << ui::GetEGLErrorString(eglFun->eglGetError());
+ }
+
+ bufferHandle.modifier = handle.modifier;
+ for (size_t i = 0; i < numPlanes; ++i) {
+ int fd = fds[i];
+ int stride = strides[i];
+ int offset = offsets[i];
+ int size = handle.planes[i].size;
+
+ if (fd == -1) {
+ fd = fds[0];
+ stride = handle.planes[i].stride;
+ offset = handle.planes[i].offset;
+ }
+
+ gfx::NativePixmapPlane plane(stride, offset, size, base::ScopedFD(::dup(fd)));
+ bufferHandle.planes.push_back(std::move(plane));
+ }
+
+ eglFun->eglDestroyImage(eglDisplay, eglImage);
+ }
+
+ return base::MakeRefCounted<gfx::NativePixmapDmaBuf>(size, format, std::move(bufferHandle));
+#else
+ return nullptr;
+#endif // QT_CONFIG(opengl)
+}
+
+bool SurfaceFactoryQt::SupportsNativePixmaps() const
+{
+#if QT_CONFIG(opengl)
+#if BUILDFLAG(OZONE_PLATFORM_X11)
+ if (GLContextHelper::getGlxPlatformInterface())
+ return ui::GpuMemoryBufferSupportX11::GetInstance()->has_gbm_device();
+#endif // BUILDFLAG(OZONE_PLATFORM_X11)
+
+ if (GLContextHelper::getEglPlatformInterface())
+ return EGLHelper::instance()->isDmaBufSupported();
+#endif // QT_CONFIG(opengl)
+
+ return false;
+}
} // namespace QtWebEngineCore
#endif // defined(USE_OZONE)
diff --git a/src/core/ozone/surface_factory_qt.h b/src/core/ozone/surface_factory_qt.h
index dee41d948..07d7337ac 100644
--- a/src/core/ozone/surface_factory_qt.h
+++ b/src/core/ozone/surface_factory_qt.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef SURFACE_FACTORY_QT
#define SURFACE_FACTORY_QT
@@ -50,10 +14,36 @@ class SurfaceFactoryQt : public ui::SurfaceFactoryOzone
{
public:
SurfaceFactoryQt();
- std::vector<gl::GLImplementation> GetAllowedGLImplementations() override;
- ui::GLOzone* GetGLOzone(gl::GLImplementation implementation) override;
+ std::vector<gl::GLImplementationParts> GetAllowedGLImplementations() override;
+ ui::GLOzone *GetGLOzone(const gl::GLImplementationParts &implementation) override;
+#if BUILDFLAG(ENABLE_VULKAN)
+ std::unique_ptr<gpu::VulkanImplementation>
+ CreateVulkanImplementation(bool allow_protected_memory, bool enforce_protected_memory) override;
+#endif
+ bool CanCreateNativePixmapForFormat(gfx::BufferFormat format) override;
+ scoped_refptr<gfx::NativePixmap> CreateNativePixmap(
+ gfx::AcceleratedWidget widget,
+ gpu::VulkanDeviceQueue* device_queue,
+ gfx::Size size,
+ gfx::BufferFormat format,
+ gfx::BufferUsage usage,
+ absl::optional<gfx::Size> framebuffer_size = absl::nullopt) override;
+ void CreateNativePixmapAsync(gfx::AcceleratedWidget widget,
+ gpu::VulkanDeviceQueue* device_queue,
+ gfx::Size size,
+ gfx::BufferFormat format,
+ gfx::BufferUsage usage,
+ NativePixmapCallback callback) override;
+ scoped_refptr<gfx::NativePixmap> CreateNativePixmapFromHandle(
+ gfx::AcceleratedWidget widget,
+ gfx::Size size,
+ gfx::BufferFormat format,
+ gfx::NativePixmapHandle handle) override;
+
+ bool SupportsNativePixmaps() const;
+
private:
- gl::GLImplementation m_impl;
+ std::vector<gl::GLImplementationParts> m_impl;
std::unique_ptr<ui::GLOzone> m_ozone;
};
diff --git a/src/core/pdf_util_qt.cpp b/src/core/pdf_util_qt.cpp
new file mode 100644
index 000000000..9503f5910
--- /dev/null
+++ b/src/core/pdf_util_qt.cpp
@@ -0,0 +1,92 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+// Copyright 2021 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE.Chromium file.
+
+#include "pdf_util_qt.h"
+
+#include <QtGlobal>
+
+#include "base/check.h"
+#include "chrome/common/webui_url_constants.h"
+#include "content/public/browser/render_frame_host.h"
+#include "content/public/browser/render_process_host.h"
+#include "content/public/browser/web_contents.h"
+#include "extensions/buildflags/buildflags.h"
+#include "url/gurl.h"
+#include "url/origin.h"
+
+#if BUILDFLAG(ENABLE_EXTENSIONS)
+#include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h"
+#include "extensions/common/constants.h"
+#endif // BUILDFLAG(ENABLE_EXTENSIONS)
+
+namespace QtWebEngineCore {
+
+bool IsPdfExtensionOrigin(const url::Origin &origin)
+{
+#if BUILDFLAG(ENABLE_EXTENSIONS)
+ return origin.scheme() == extensions::kExtensionScheme
+ && origin.host() == extension_misc::kPdfExtensionId;
+#else
+ Q_UNUSED(origin);
+ return false;
+#endif
+}
+
+bool IsPdfInternalPluginAllowedOrigin(const url::Origin &origin)
+{
+ if (IsPdfExtensionOrigin(origin))
+ return true;
+
+ // Allow embedding the internal PDF plugin in chrome://print.
+ if (origin == url::Origin::Create(GURL(chrome::kChromeUIPrintURL)))
+ return true;
+
+ // Only allow the PDF plugin in the known, trustworthy origins that are
+ // allowlisted above. See also https://crbug.com/520422 and
+ // https://crbug.com/1027173.
+ return false;
+}
+
+content::RenderFrameHost *GetFullPagePlugin(content::WebContents *contents)
+{
+ content::RenderFrameHost *full_page_plugin = nullptr;
+#if BUILDFLAG(ENABLE_EXTENSIONS)
+ contents->ForEachRenderFrameHostWithAction([&full_page_plugin](content::RenderFrameHost *rfh) {
+ auto* guest_view = extensions::MimeHandlerViewGuest::FromRenderFrameHost(rfh);
+ if (guest_view && guest_view->is_full_page_plugin()) {
+ DCHECK_EQ(guest_view->GetGuestMainFrame(), rfh);
+ full_page_plugin = rfh;
+ return content::RenderFrameHost::FrameIterationAction::kStop;
+ }
+ return content::RenderFrameHost::FrameIterationAction::kContinue;
+ });
+#endif // BUILDFLAG(ENABLE_EXTENSIONS)
+ return full_page_plugin;
+}
+
+content::RenderFrameHost *FindPdfChildFrame(content::RenderFrameHost *rfh)
+{
+ if (!rfh)
+ return nullptr;
+
+ if (!IsPdfExtensionOrigin(rfh->GetLastCommittedOrigin()))
+ return nullptr;
+
+ content::RenderFrameHost *pdf_rfh = nullptr;
+ rfh->ForEachRenderFrameHost([&pdf_rfh](content::RenderFrameHost *rfh) {
+ if (!rfh->GetProcess()->IsPdf())
+ return;
+
+ DCHECK(IsPdfExtensionOrigin(rfh->GetParent()->GetLastCommittedOrigin()));
+ DCHECK(!pdf_rfh);
+ pdf_rfh = rfh;
+ });
+
+ return pdf_rfh;
+}
+
+} // namespace QtWebEngineCore
diff --git a/src/core/pdf_util_qt.h b/src/core/pdf_util_qt.h
new file mode 100644
index 000000000..5ee211800
--- /dev/null
+++ b/src/core/pdf_util_qt.h
@@ -0,0 +1,34 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+// Copyright 2021 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE.Chromium file.
+
+#ifndef PDF_UTIL_QT_H
+#define PDF_UTIL_QT_H
+
+namespace content {
+class RenderFrameHost;
+class WebContents;
+} // namespace content
+
+namespace url {
+class Origin;
+} // namespace url
+
+namespace QtWebEngineCore {
+
+// from chrome/common/pdf_util.cc:
+constexpr char kPDFMimeType[] = "application/pdf";
+
+bool IsPdfExtensionOrigin(const url::Origin &origin);
+bool IsPdfInternalPluginAllowedOrigin(const url::Origin &origin);
+
+// from chrome/browser/pdf/pdf_frame_util.cc:
+content::RenderFrameHost *GetFullPagePlugin(content::WebContents *contents);
+content::RenderFrameHost *FindPdfChildFrame(content::RenderFrameHost *rfh);
+
+} // namespace QtWebEngineCore
+
+#endif // PDF_UTIL_QT_H
diff --git a/src/core/permission_manager_qt.cpp b/src/core/permission_manager_qt.cpp
index 862a1c262..b6e727ef8 100644
--- a/src/core/permission_manager_qt.cpp
+++ b/src/core/permission_manager_qt.cpp
@@ -1,50 +1,14 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "permission_manager_qt.h"
#include "content/browser/renderer_host/render_view_host_delegate.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/public/browser/permission_controller.h"
-#include "content/public/browser/permission_type.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_view_host.h"
+#include "third_party/blink/public/common/permissions/permission_utils.h"
#include "type_conversion.h"
#include "web_contents_delegate_qt.h"
@@ -52,39 +16,48 @@
namespace QtWebEngineCore {
-static ProfileAdapter::PermissionType toQt(content::PermissionType type)
+static ProfileAdapter::PermissionType toQt(blink::PermissionType type)
{
switch (type) {
- case content::PermissionType::GEOLOCATION:
+ case blink::PermissionType::GEOLOCATION:
return ProfileAdapter::GeolocationPermission;
- case content::PermissionType::AUDIO_CAPTURE:
+ case blink::PermissionType::AUDIO_CAPTURE:
return ProfileAdapter::AudioCapturePermission;
- case content::PermissionType::VIDEO_CAPTURE:
+ case blink::PermissionType::VIDEO_CAPTURE:
return ProfileAdapter::VideoCapturePermission;
- case content::PermissionType::CLIPBOARD_READ:
- return ProfileAdapter::ClipboardRead;
- case content::PermissionType::CLIPBOARD_WRITE:
- return ProfileAdapter::ClipboardWrite;
- case content::PermissionType::NOTIFICATIONS:
+ // We treat these both as read/write since we do not currently have a
+ // ClipboardSanitizedWrite feature.
+ case blink::PermissionType::CLIPBOARD_READ_WRITE:
+ case blink::PermissionType::CLIPBOARD_SANITIZED_WRITE:
+ return ProfileAdapter::ClipboardReadWrite;
+ case blink::PermissionType::NOTIFICATIONS:
return ProfileAdapter::NotificationPermission;
- case content::PermissionType::ACCESSIBILITY_EVENTS:
+ case blink::PermissionType::LOCAL_FONTS:
+ return ProfileAdapter::LocalFontsPermission;
+ case blink::PermissionType::ACCESSIBILITY_EVENTS:
+ case blink::PermissionType::CAMERA_PAN_TILT_ZOOM:
+ case blink::PermissionType::WINDOW_MANAGEMENT:
return ProfileAdapter::UnsupportedPermission;
- case content::PermissionType::FLASH:
- case content::PermissionType::MIDI_SYSEX:
- case content::PermissionType::PROTECTED_MEDIA_IDENTIFIER:
- case content::PermissionType::MIDI:
- case content::PermissionType::DURABLE_STORAGE:
- case content::PermissionType::BACKGROUND_SYNC:
- case content::PermissionType::SENSORS:
- case content::PermissionType::PAYMENT_HANDLER:
- case content::PermissionType::BACKGROUND_FETCH:
- case content::PermissionType::IDLE_DETECTION:
- case content::PermissionType::PERIODIC_BACKGROUND_SYNC:
- case content::PermissionType::WAKE_LOCK_SCREEN:
- case content::PermissionType::WAKE_LOCK_SYSTEM:
- case content::PermissionType::NFC:
- case content::PermissionType::NUM:
- NOTIMPLEMENTED() << "Unsupported permission type: " << static_cast<int>(type);
+ case blink::PermissionType::MIDI_SYSEX:
+ case blink::PermissionType::PROTECTED_MEDIA_IDENTIFIER:
+ case blink::PermissionType::MIDI:
+ case blink::PermissionType::DURABLE_STORAGE:
+ case blink::PermissionType::BACKGROUND_SYNC:
+ case blink::PermissionType::SENSORS:
+ case blink::PermissionType::PAYMENT_HANDLER:
+ case blink::PermissionType::BACKGROUND_FETCH:
+ case blink::PermissionType::IDLE_DETECTION:
+ case blink::PermissionType::PERIODIC_BACKGROUND_SYNC:
+ case blink::PermissionType::WAKE_LOCK_SCREEN:
+ case blink::PermissionType::WAKE_LOCK_SYSTEM:
+ case blink::PermissionType::NFC:
+ case blink::PermissionType::AR:
+ case blink::PermissionType::VR:
+ case blink::PermissionType::STORAGE_ACCESS_GRANT:
+ case blink::PermissionType::DISPLAY_CAPTURE:
+ case blink::PermissionType::TOP_LEVEL_STORAGE_ACCESS:
+ case blink::PermissionType::NUM:
+ LOG(INFO) << "Unexpected unsupported permission type: " << static_cast<int>(type);
break;
}
return ProfileAdapter::UnsupportedPermission;
@@ -95,6 +68,8 @@ static bool canRequestPermissionFor(ProfileAdapter::PermissionType type)
switch (type) {
case ProfileAdapter::GeolocationPermission:
case ProfileAdapter::NotificationPermission:
+ case ProfileAdapter::ClipboardReadWrite:
+ case ProfileAdapter::LocalFontsPermission:
return true;
default:
break;
@@ -114,9 +89,22 @@ static blink::mojom::PermissionStatus toBlink(ProfileAdapter::PermissionState re
}
}
+static blink::mojom::PermissionStatus getStatusFromSettings(blink::PermissionType type, WebEngineSettings *settings)
+{
+ switch (type) {
+ case blink::PermissionType::CLIPBOARD_READ_WRITE:
+ case blink::PermissionType::CLIPBOARD_SANITIZED_WRITE:
+ if (settings->testAttribute(QWebEngineSettings::JavascriptCanPaste)
+ && settings->testAttribute(QWebEngineSettings::JavascriptCanAccessClipboard))
+ return blink::mojom::PermissionStatus::GRANTED;
+ return blink::mojom::PermissionStatus::ASK;
+ default:
+ return blink::mojom::PermissionStatus::ASK;
+ }
+}
+
PermissionManagerQt::PermissionManagerQt()
: m_requestIdCount(0)
- , m_subscriberIdCount(0)
{
}
@@ -126,8 +114,8 @@ PermissionManagerQt::~PermissionManagerQt()
void PermissionManagerQt::permissionRequestReply(const QUrl &url, ProfileAdapter::PermissionType type, ProfileAdapter::PermissionState reply)
{
- // Normalize the QUrl to GURL origin form.
- const GURL gorigin = toGurl(url).GetOrigin();
+ // Normalize the QUrl to Chromium origin form.
+ const GURL gorigin = toGurl(url).DeprecatedGetOriginAsURL();
const QUrl origin = gorigin.is_empty() ? url : toQt(gorigin);
if (origin.isEmpty())
return;
@@ -161,7 +149,7 @@ void PermissionManagerQt::permissionRequestReply(const QUrl &url, ProfileAdapter
bool answerable = true;
std::vector<blink::mojom::PermissionStatus> result;
result.reserve(it->types.size());
- for (content::PermissionType permission : it->types) {
+ for (blink::PermissionType permission : it->types) {
const ProfileAdapter::PermissionType permissionType = toQt(permission);
if (permissionType == ProfileAdapter::UnsupportedPermission) {
result.push_back(blink::mojom::PermissionStatus::DENIED);
@@ -194,84 +182,61 @@ bool PermissionManagerQt::checkPermission(const QUrl &origin, ProfileAdapter::Pe
return m_permissions.contains(key) && m_permissions[key];
}
-int PermissionManagerQt::RequestPermission(content::PermissionType permission,
- content::RenderFrameHost *frameHost,
- const GURL& requesting_origin,
- bool /*user_gesture*/,
- base::OnceCallback<void(blink::mojom::PermissionStatus)> callback)
+void PermissionManagerQt::RequestPermissions(content::RenderFrameHost *frameHost,
+ const content::PermissionRequestDescription &requestDescription,
+ base::OnceCallback<void(const std::vector<blink::mojom::PermissionStatus>&)> callback)
{
- WebContentsDelegateQt *contentsDelegate = static_cast<WebContentsDelegateQt *>(
- content::WebContents::FromRenderFrameHost(frameHost)->GetDelegate());
- Q_ASSERT(contentsDelegate);
-
- ProfileAdapter::PermissionType permissionType = toQt(permission);
- if (permissionType == ProfileAdapter::ClipboardRead) {
- WebEngineSettings *settings = contentsDelegate->webEngineSettings();
- if (settings->testAttribute(WebEngineSettings::JavascriptCanAccessClipboard)
- && settings->testAttribute(WebEngineSettings::JavascriptCanPaste))
- std::move(callback).Run(blink::mojom::PermissionStatus::GRANTED);
- else
- std::move(callback).Run(blink::mojom::PermissionStatus::DENIED);
- return content::PermissionController::kNoPendingOperation;
- } else if (!canRequestPermissionFor(permissionType)) {
- std::move(callback).Run(blink::mojom::PermissionStatus::DENIED);
- return content::PermissionController::kNoPendingOperation;
+ if (requestDescription.requesting_origin.is_empty()) {
+ std::move(callback).Run(std::vector<content::PermissionStatus>(requestDescription.permissions.size(), blink::mojom::PermissionStatus::DENIED));
+ return;
}
- int request_id = ++m_requestIdCount;
- auto requestOrigin = toQt(requesting_origin);
- m_requests.push_back({ request_id, permissionType, requestOrigin, std::move(callback) });
- contentsDelegate->requestFeaturePermission(permissionType, requestOrigin);
- return request_id;
-}
-
-int PermissionManagerQt::RequestPermissions(const std::vector<content::PermissionType>& permissions,
- content::RenderFrameHost* frameHost,
- const GURL& requesting_origin,
- bool /*user_gesture*/,
- base::OnceCallback<void(const std::vector<blink::mojom::PermissionStatus>&)> callback)
-{
WebContentsDelegateQt *contentsDelegate = static_cast<WebContentsDelegateQt *>(
content::WebContents::FromRenderFrameHost(frameHost)->GetDelegate());
Q_ASSERT(contentsDelegate);
bool answerable = true;
- std::vector<blink::mojom::PermissionStatus> result;
- result.reserve(permissions.size());
- for (content::PermissionType permission : permissions) {
+ std::vector<content::PermissionStatus> result;
+ result.reserve(requestDescription.permissions.size());
+ for (blink::PermissionType permission : requestDescription.permissions) {
const ProfileAdapter::PermissionType permissionType = toQt(permission);
- if (permissionType == ProfileAdapter::UnsupportedPermission)
+ if (permissionType == ProfileAdapter::UnsupportedPermission) {
result.push_back(blink::mojom::PermissionStatus::DENIED);
- else if (permissionType == ProfileAdapter::ClipboardRead) {
- WebEngineSettings *settings = contentsDelegate->webEngineSettings();
- if (settings->testAttribute(WebEngineSettings::JavascriptCanAccessClipboard)
- && settings->testAttribute(WebEngineSettings::JavascriptCanPaste))
- result.push_back(blink::mojom::PermissionStatus::GRANTED);
- else
- result.push_back(blink::mojom::PermissionStatus::DENIED);
- } else {
+ continue;
+ }
+
+ auto status = getStatusFromSettings(permission, contentsDelegate->webEngineSettings());
+ if (status == blink::mojom::PermissionStatus::ASK) {
answerable = false;
break;
- }
+ } else
+ result.push_back(status);
}
if (answerable) {
std::move(callback).Run(result);
- return content::PermissionController::kNoPendingOperation;
+ return;
}
int request_id = ++m_requestIdCount;
- auto requestOrigin = toQt(requesting_origin);
- m_multiRequests.push_back({ request_id, permissions, requestOrigin, std::move(callback) });
- for (content::PermissionType permission : permissions) {
+ auto requestOrigin = toQt(requestDescription.requesting_origin);
+ m_multiRequests.push_back({ request_id, requestDescription.permissions, requestOrigin, std::move(callback) });
+ for (blink::PermissionType permission : requestDescription.permissions) {
const ProfileAdapter::PermissionType permissionType = toQt(permission);
if (canRequestPermissionFor(permissionType))
contentsDelegate->requestFeaturePermission(permissionType, requestOrigin);
}
- return request_id;
+}
+
+void PermissionManagerQt::RequestPermissionsFromCurrentDocument(content::RenderFrameHost *frameHost,
+ const content::PermissionRequestDescription &requestDescription,
+ base::OnceCallback<void(const std::vector<blink::mojom::PermissionStatus>&)> callback)
+{
+
+ RequestPermissions(frameHost, requestDescription, std::move(callback));
}
blink::mojom::PermissionStatus PermissionManagerQt::GetPermissionStatus(
- content::PermissionType permission,
+ blink::PermissionType permission,
const GURL& requesting_origin,
const GURL& /*embedding_origin*/)
{
@@ -287,31 +252,56 @@ blink::mojom::PermissionStatus PermissionManagerQt::GetPermissionStatus(
return blink::mojom::PermissionStatus::DENIED;
}
-blink::mojom::PermissionStatus PermissionManagerQt::GetPermissionStatusForFrame(
- content::PermissionType permission,
- content::RenderFrameHost *render_frame_host,
- const GURL &requesting_origin)
+blink::mojom::PermissionStatus PermissionManagerQt::GetPermissionStatusForCurrentDocument(
+ blink::PermissionType permission,
+ content::RenderFrameHost *render_frame_host)
{
- if (permission == content::PermissionType::CLIPBOARD_READ ||
- permission == content::PermissionType::CLIPBOARD_WRITE) {
+ if (permission == blink::PermissionType::CLIPBOARD_READ_WRITE ||
+ permission == blink::PermissionType::CLIPBOARD_SANITIZED_WRITE) {
WebContentsDelegateQt *delegate = static_cast<WebContentsDelegateQt *>(
content::WebContents::FromRenderFrameHost(render_frame_host)->GetDelegate());
- if (!delegate->webEngineSettings()->testAttribute(WebEngineSettings::JavascriptCanAccessClipboard))
- return blink::mojom::PermissionStatus::DENIED;
- if (permission == content::PermissionType::CLIPBOARD_READ &&
- !delegate->webEngineSettings()->testAttribute(WebEngineSettings::JavascriptCanPaste))
- return blink::mojom::PermissionStatus::DENIED;
- return blink::mojom::PermissionStatus::GRANTED;
+ Q_ASSERT(delegate);
+ auto status = getStatusFromSettings(permission, delegate->webEngineSettings());
+ if (status != blink::mojom::PermissionStatus::ASK)
+ return status;
}
return GetPermissionStatus(
permission,
- requesting_origin,
- content::WebContents::FromRenderFrameHost(render_frame_host)->GetLastCommittedURL().GetOrigin());
+ render_frame_host->GetLastCommittedOrigin().GetURL(),
+ render_frame_host->GetLastCommittedOrigin().GetURL());
+}
+
+blink::mojom::PermissionStatus PermissionManagerQt::GetPermissionStatusForWorker(
+ blink::PermissionType permission,
+ content::RenderProcessHost *render_process_host,
+ const GURL &url)
+{
+ return GetPermissionStatus(permission, url, url);
+}
+
+blink::mojom::PermissionStatus PermissionManagerQt::GetPermissionStatusForEmbeddedRequester(
+ blink::PermissionType permission,
+ content::RenderFrameHost *render_frame_host,
+ const url::Origin &requesting_origin)
+{
+ return GetPermissionStatus(permission, requesting_origin.GetURL(),
+ render_frame_host->GetLastCommittedOrigin().GetURL());
+}
+
+content::PermissionResult PermissionManagerQt::GetPermissionResultForOriginWithoutContext(
+ blink::PermissionType permission,
+ const url::Origin &requesting_origin,
+ const url::Origin &embedding_origin)
+{
+ blink::mojom::PermissionStatus status =
+ GetPermissionStatus(permission, requesting_origin.GetURL(), embedding_origin.GetURL());
+
+ return content::PermissionResult(status, content::PermissionStatusSource::UNSPECIFIED);
}
void PermissionManagerQt::ResetPermission(
- content::PermissionType permission,
+ blink::PermissionType permission,
const GURL& requesting_origin,
const GURL& /*embedding_origin*/)
{
@@ -323,19 +313,20 @@ void PermissionManagerQt::ResetPermission(
m_permissions.remove(key);
}
-int PermissionManagerQt::SubscribePermissionStatusChange(
- content::PermissionType permission,
+content::PermissionControllerDelegate::SubscriptionId PermissionManagerQt::SubscribePermissionStatusChange(
+ blink::PermissionType permission,
+ content::RenderProcessHost * /*render_process_host*/,
content::RenderFrameHost * /* render_frame_host */,
const GURL& requesting_origin,
base::RepeatingCallback<void(blink::mojom::PermissionStatus)> callback)
{
- int subscriber_id = ++m_subscriberIdCount;
+ auto subscriber_id = subscription_id_generator_.GenerateNextId();
m_subscribers.insert( { subscriber_id,
Subscription { toQt(permission), toQt(requesting_origin), std::move(callback) } });
return subscriber_id;
}
-void PermissionManagerQt::UnsubscribePermissionStatusChange(int subscription_id)
+void PermissionManagerQt::UnsubscribePermissionStatusChange(content::PermissionControllerDelegate::SubscriptionId subscription_id)
{
if (!m_subscribers.erase(subscription_id))
LOG(WARNING) << "PermissionManagerQt::UnsubscribePermissionStatusChange called on unknown subscription id" << subscription_id;
diff --git a/src/core/permission_manager_qt.h b/src/core/permission_manager_qt.h
index e046174df..b91498d3d 100644
--- a/src/core/permission_manager_qt.h
+++ b/src/core/permission_manager_qt.h
@@ -1,46 +1,10 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef PERMISSION_MANAGER_QT_H
#define PERMISSION_MANAGER_QT_H
-#include "base/callback.h"
+#include "base/functional/callback.h"
#include "content/public/browser/permission_controller_delegate.h"
#include "profile_adapter.h"
@@ -49,8 +13,8 @@
namespace QtWebEngineCore {
-class PermissionManagerQt : public content::PermissionControllerDelegate {
-
+class PermissionManagerQt : public content::PermissionControllerDelegate
+{
public:
PermissionManagerQt();
~PermissionManagerQt();
@@ -59,43 +23,42 @@ public:
bool checkPermission(const QUrl &origin, ProfileAdapter::PermissionType type);
// content::PermissionManager implementation:
- int RequestPermission(
- content::PermissionType permission,
- content::RenderFrameHost* render_frame_host,
- const GURL& requesting_origin,
- bool user_gesture,
- base::OnceCallback<void(blink::mojom::PermissionStatus)> callback) override;
-
blink::mojom::PermissionStatus GetPermissionStatus(
- content::PermissionType permission,
+ blink::PermissionType permission,
const GURL& requesting_origin,
const GURL& embedding_origin) override;
- blink::mojom::PermissionStatus GetPermissionStatusForFrame(
- content::PermissionType permission,
- content::RenderFrameHost *render_frame_host,
- const GURL& requesting_origin) override;
+ blink::mojom::PermissionStatus GetPermissionStatusForCurrentDocument(blink::PermissionType, content::RenderFrameHost *) override;
+
+ blink::mojom::PermissionStatus GetPermissionStatusForWorker(blink::PermissionType, content::RenderProcessHost *, const GURL &) override;
+
+ blink::mojom::PermissionStatus GetPermissionStatusForEmbeddedRequester(blink::PermissionType, content::RenderFrameHost*, const url::Origin&) override;
+
+ content::PermissionResult GetPermissionResultForOriginWithoutContext(blink::PermissionType, const url::Origin&, const url::Origin&) override;
void ResetPermission(
- content::PermissionType permission,
+ blink::PermissionType permission,
const GURL& requesting_origin,
const GURL& embedding_origin) override;
- int RequestPermissions(
- const std::vector<content::PermissionType>& permission,
- content::RenderFrameHost* render_frame_host,
- const GURL& requesting_origin,
- bool user_gesture,
- base::OnceCallback<void(
- const std::vector<blink::mojom::PermissionStatus>&)> callback) override;
+ void RequestPermissions(
+ content::RenderFrameHost *render_frame_host,
+ const content::PermissionRequestDescription &request_description,
+ base::OnceCallback<void(const std::vector<blink::mojom::PermissionStatus>&)> callback) override;
+
+ void RequestPermissionsFromCurrentDocument(
+ content::RenderFrameHost *render_frame_host,
+ const content::PermissionRequestDescription &request_description,
+ base::OnceCallback<void(const std::vector<blink::mojom::PermissionStatus> &)> callback) override;
- int SubscribePermissionStatusChange(
- content::PermissionType permission,
+ content::PermissionControllerDelegate::SubscriptionId SubscribePermissionStatusChange(
+ blink::PermissionType permission,
+ content::RenderProcessHost* render_process_host,
content::RenderFrameHost* render_frame_host,
const GURL& requesting_origin,
const base::RepeatingCallback<void(blink::mojom::PermissionStatus)> callback) override;
- void UnsubscribePermissionStatusChange(int subscription_id) override;
+ void UnsubscribePermissionStatusChange(content::PermissionControllerDelegate::SubscriptionId subscription_id) override;
private:
QHash<QPair<QUrl, ProfileAdapter::PermissionType>, bool> m_permissions;
@@ -107,7 +70,7 @@ private:
};
struct MultiRequest {
int id;
- std::vector<content::PermissionType> types;
+ std::vector<blink::PermissionType> types;
QUrl origin;
base::OnceCallback<void(const std::vector<blink::mojom::PermissionStatus>&)> callback;
};
@@ -118,9 +81,9 @@ private:
};
std::vector<Request> m_requests;
std::vector<MultiRequest> m_multiRequests;
- std::map<int, Subscription> m_subscribers;
+ std::map<content::PermissionControllerDelegate::SubscriptionId, Subscription> m_subscribers;
+ content::PermissionControllerDelegate::SubscriptionId::Generator subscription_id_generator_;
int m_requestIdCount;
- int m_subscriberIdCount;
};
diff --git a/src/core/platform_notification_service_qt.cpp b/src/core/platform_notification_service_qt.cpp
index 5f3017dcf..182a5ad84 100644
--- a/src/core/platform_notification_service_qt.cpp
+++ b/src/core/platform_notification_service_qt.cpp
@@ -1,48 +1,11 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "platform_notification_service_qt.h"
#include "chrome/common/pref_names.h"
#include "components/prefs/pref_service.h"
#include "content/public/browser/browser_thread.h"
-#include "content/public/browser/permission_type.h"
#include "content/public/browser/notification_event_dispatcher.h"
#include "ui/message_center/public/cpp/notification_delegate.h"
@@ -50,7 +13,6 @@
#include "profile_adapter_client.h"
#include "profile_qt.h"
#include "user_notification_controller.h"
-#include "resource_context_qt.h"
#include "type_conversion.h"
#include <QSharedPointer>
@@ -90,7 +52,7 @@ struct PersistentNotificationDelegate : UserNotificationController::Delegate {
virtual void clicked() override {
Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
if (auto inst = content::NotificationEventDispatcher::GetInstance())
- inst->DispatchNotificationClickEvent(browser_context, notification_id, origin, base::nullopt, base::nullopt, base::DoNothing());
+ inst->DispatchNotificationClickEvent(browser_context, notification_id, origin, absl::nullopt, absl::nullopt, base::DoNothing());
}
virtual void closed(bool by_user) override {
@@ -114,6 +76,7 @@ PlatformNotificationServiceQt::~PlatformNotificationServiceQt() {}
void PlatformNotificationServiceQt::DisplayNotification(
const std::string &notification_id,
const GURL &origin,
+ const GURL &document_url,
const blink::PlatformNotificationData &notificationData,
const blink::NotificationResources &notificationResources)
{
diff --git a/src/core/platform_notification_service_qt.h b/src/core/platform_notification_service_qt.h
index 12aa2619b..bf8fcca04 100644
--- a/src/core/platform_notification_service_qt.h
+++ b/src/core/platform_notification_service_qt.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef PLATFORM_NOTIFICATION_SERVICE_QT_H
#define PLATFORM_NOTIFICATION_SERVICE_QT_H
@@ -58,6 +22,7 @@ public:
// |cancel_callback| argument. This method must be called on the UI thread.
void DisplayNotification(const std::string& notification_id,
const GURL& origin,
+ const GURL& document_url,
const blink::PlatformNotificationData& notificationData,
const blink::NotificationResources& notificationResources) override;
diff --git a/src/core/pointer_device_qt.cpp b/src/core/pointer_device_qt.cpp
new file mode 100644
index 000000000..a3d7f3d37
--- /dev/null
+++ b/src/core/pointer_device_qt.cpp
@@ -0,0 +1,102 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+// based on chromium/ui/base/pointer/pointer_device_linux.cc
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/base/pointer/pointer_device.h"
+
+#include <algorithm>
+#include <QPointingDevice>
+
+namespace ui {
+
+namespace {
+
+bool IsTouchScreen(const QInputDevice *device)
+{
+ return device->type() & QPointingDevice::DeviceType::TouchScreen;
+}
+
+bool IsMouseOrTouchpad(const QInputDevice *device)
+{
+ return device->type()
+ & (QPointingDevice::DeviceType::TouchPad | QPointingDevice::DeviceType::Mouse);
+}
+
+bool IsTouchDevicePresent()
+{
+ QList<const QInputDevice *> devices = QInputDevice::devices();
+ return std::any_of(devices.constBegin(), devices.constEnd(), IsTouchScreen);
+}
+
+bool IsMouseOrTouchpadPresent()
+{
+ QList<const QInputDevice *> devices = QInputDevice::devices();
+ return std::any_of(devices.constBegin(), devices.constEnd(), IsMouseOrTouchpad);
+}
+
+} // namespace
+
+int GetAvailablePointerTypes()
+{
+ int available_pointer_types = POINTER_TYPE_NONE;
+ if (IsMouseOrTouchpadPresent())
+ available_pointer_types |= POINTER_TYPE_FINE;
+
+ if (IsTouchDevicePresent())
+ available_pointer_types |= POINTER_TYPE_COARSE;
+
+ return available_pointer_types;
+}
+
+int GetAvailableHoverTypes()
+{
+ if (IsMouseOrTouchpadPresent())
+ return HOVER_TYPE_HOVER;
+
+ return HOVER_TYPE_NONE;
+}
+
+TouchScreensAvailability GetTouchScreensAvailability()
+{
+ if (!IsTouchDevicePresent())
+ return TouchScreensAvailability::NONE;
+
+ return TouchScreensAvailability::ENABLED;
+}
+
+int MaxTouchPoints()
+{
+ int max_touch = 0;
+ for (const auto *device : QInputDevice::devices()) {
+ if (IsTouchScreen(device)) {
+ int points = static_cast<const QPointingDevice *>(device)->maximumPoints();
+ max_touch = points > max_touch ? points : max_touch;
+ }
+ }
+
+ return max_touch;
+}
+
+PointerType GetPrimaryPointerType(int available_pointer_types)
+{
+ if (available_pointer_types & POINTER_TYPE_FINE)
+ return POINTER_TYPE_FINE;
+ if (available_pointer_types & POINTER_TYPE_COARSE)
+ return POINTER_TYPE_COARSE;
+ Q_ASSERT(available_pointer_types == POINTER_TYPE_NONE);
+ return POINTER_TYPE_NONE;
+}
+
+HoverType GetPrimaryHoverType(int available_hover_types)
+{
+ if (available_hover_types & HOVER_TYPE_HOVER)
+ return HOVER_TYPE_HOVER;
+ Q_ASSERT(available_hover_types == HOVER_TYPE_NONE);
+ return HOVER_TYPE_NONE;
+}
+
+} // namespace ui
diff --git a/src/core/pref_service_adapter.cpp b/src/core/pref_service_adapter.cpp
index 4ded70d07..544a84de1 100644
--- a/src/core/pref_service_adapter.cpp
+++ b/src/core/pref_service_adapter.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "pref_service_adapter.h"
@@ -43,8 +7,10 @@
#include "type_conversion.h"
#include "web_engine_context.h"
+#include "base/threading/thread_restrictions.h"
#include "chrome/browser/prefs/chrome_command_line_pref_store.h"
#include "content/public/browser/browser_thread.h"
+#include "components/autofill/core/common/autofill_prefs.h"
#include "components/language/core/browser/pref_names.h"
#include "components/prefs/pref_member.h"
#include "components/prefs/in_memory_pref_store.h"
@@ -52,12 +18,17 @@
#include "components/prefs/pref_service.h"
#include "components/prefs/pref_service_factory.h"
#include "components/prefs/pref_registry_simple.h"
+#include "components/signin/internal/identity_manager/account_tracker_service.h"
+#include "components/signin/public/base/signin_pref_names.h"
#include "components/user_prefs/user_prefs.h"
#include "components/proxy_config/pref_proxy_config_tracker_impl.h"
#include "chrome/common/pref_names.h"
#include "extensions/buildflags/buildflags.h"
#include "content/public/browser/browser_context.h"
+#include "components/pref_registry/pref_registry_syncable.h"
+#include "chrome/browser/devtools/devtools_settings.h"
+
#if QT_CONFIG(webengine_spellchecker)
#include "chrome/browser/spellchecker/spellcheck_service.h"
#include "components/spellcheck/browser/pref_names.h"
@@ -71,6 +42,10 @@
#include "extensions/common/constants.h"
#endif
+#if defined(Q_OS_WIN)
+#include "components/os_crypt/sync/os_crypt.h"
+#endif
+
namespace {
static const char kPrefMediaDeviceIDSalt[] = "qtwebengine.media_device_salt_id";
}
@@ -82,15 +57,16 @@ void PrefServiceAdapter::setup(const ProfileAdapter &profileAdapter)
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
PrefServiceFactory factory;
factory.set_command_line_prefs(base::MakeRefCounted<ChromeCommandLinePrefStore>(
- WebEngineContext::commandLine()));
+ base::CommandLine::ForCurrentProcess()));
QString userPrefStorePath = profileAdapter.dataPath();
- if (userPrefStorePath.isEmpty() || profileAdapter.isOffTheRecord()) {
- factory.set_user_prefs(new InMemoryPrefStore);
- } else {
+ if (!profileAdapter.isOffTheRecord() && !userPrefStorePath.isEmpty() &&
+ const_cast<ProfileAdapter *>(&profileAdapter)->ensureDataPathExists()) {
userPrefStorePath += QDir::separator();
userPrefStorePath += QStringLiteral("user_prefs.json");
factory.set_user_prefs(base::MakeRefCounted<JsonPrefStore>(toFilePath(userPrefStorePath)));
+ } else {
+ factory.set_user_prefs(new InMemoryPrefStore);
}
auto registry = base::MakeRefCounted<PrefRegistrySimple>();
@@ -101,7 +77,7 @@ void PrefServiceAdapter::setup(const ProfileAdapter &profileAdapter)
registry->RegisterStringPref(language::prefs::kAcceptLanguages, std::string());
registry->RegisterListPref(spellcheck::prefs::kSpellCheckDictionaries);
registry->RegisterListPref(spellcheck::prefs::kSpellCheckForcedDictionaries);
- registry->RegisterListPref(spellcheck::prefs::kSpellCheckBlacklistedDictionaries);
+ registry->RegisterListPref(spellcheck::prefs::kSpellCheckBlocklistedDictionaries);
registry->RegisterStringPref(spellcheck::prefs::kSpellCheckDictionary, std::string());
registry->RegisterBooleanPref(spellcheck::prefs::kSpellCheckEnable, false);
registry->RegisterBooleanPref(spellcheck::prefs::kSpellCheckUseSpellingService, false);
@@ -109,20 +85,33 @@ void PrefServiceAdapter::setup(const ProfileAdapter &profileAdapter)
registry->RegisterBooleanPref(prefs::kShowInternalAccessibilityTree, false);
registry->RegisterBooleanPref(prefs::kAccessibilityImageLabelsEnabled, false);
registry->RegisterIntegerPref(prefs::kNotificationNextPersistentId, 10000);
+ registry->RegisterDictionaryPref(prefs::kPushMessagingAppIdentifierMap);
+ registry->RegisterListPref(prefs::kAccountInfo);
+ registry->RegisterStringPref(prefs::kGoogleServicesLastUsername,
+ std::string());
+ registry->RegisterStringPref(prefs::kGoogleServicesAccountId, std::string());
+ registry->RegisterBooleanPref(prefs::kGoogleServicesConsentedToSync, false);
+ registry->RegisterBooleanPref(prefs::kAutologinEnabled, true);
+ registry->RegisterListPref(prefs::kReverseAutologinRejectedEmailList);
+ registry->RegisterBooleanPref(prefs::kSigninAllowed, true);
+ registry->RegisterBooleanPref(prefs::kSignedInWithCredentialProvider, false);
+#if defined(Q_OS_WIN)
+ OSCrypt::RegisterLocalPrefs(registry.get());
+#endif
#if BUILDFLAG(ENABLE_EXTENSIONS)
registry->RegisterDictionaryPref(extensions::pref_names::kExtensions);
registry->RegisterListPref(extensions::pref_names::kInstallAllowList);
registry->RegisterListPref(extensions::pref_names::kInstallDenyList);
registry->RegisterDictionaryPref(extensions::pref_names::kInstallForceList);
- registry->RegisterDictionaryPref(extensions::pref_names::kLoginScreenExtensions);
registry->RegisterListPref(extensions::pref_names::kAllowedTypes);
registry->RegisterBooleanPref(extensions::pref_names::kStorageGarbageCollect, false);
registry->RegisterListPref(extensions::pref_names::kAllowedInstallSites);
registry->RegisterStringPref(extensions::pref_names::kLastChromeVersion, std::string());
- registry->RegisterListPref(extensions::pref_names::kNativeMessagingBlacklist);
- registry->RegisterListPref(extensions::pref_names::kNativeMessagingWhitelist);
+ registry->RegisterListPref(extensions::pref_names::kNativeMessagingBlocklist);
+ registry->RegisterListPref(extensions::pref_names::kNativeMessagingAllowlist);
registry->RegisterBooleanPref(extensions::pref_names::kNativeMessagingUserLevelHosts, true);
+ registry->RegisterListPref(extensions::pref_names::kExtendedBackgroundLifetimeForPortConnectionsToUrls);
#endif // BUILDFLAG(ENABLE_EXTENSIONS)
// Media device salt id key
@@ -130,12 +119,28 @@ void PrefServiceAdapter::setup(const ProfileAdapter &profileAdapter)
// default value will be different. We'll need to initialize it later.
registry->RegisterStringPref(kPrefMediaDeviceIDSalt, std::string());
- m_prefService = factory.Create(registry);
-
- // Initialize salt value if none was stored before
- if (m_prefService->GetString(kPrefMediaDeviceIDSalt).empty()) {
- m_prefService->SetString(kPrefMediaDeviceIDSalt,
- content::BrowserContext::CreateRandomMediaDeviceIDSalt());
+ registry->RegisterBooleanPref(autofill::prefs::kAutofillEnabledDeprecated, false);
+ registry->RegisterBooleanPref(autofill::prefs::kAutofillProfileEnabled, false);
+ registry->RegisterBooleanPref(autofill::prefs::kAutofillCreditCardEnabled, false);
+ registry->RegisterBooleanPref(autofill::prefs::kAutofillCreditCardFidoAuthEnabled, false);
+
+ // devtools
+ registry->RegisterDictionaryPref(prefs::kDevToolsFileSystemPaths);
+ registry->RegisterDictionaryPref(prefs::kDevToolsEditedFiles);
+ registry->RegisterDictionaryPref(prefs::kDevToolsPreferences);
+ registry->RegisterBooleanPref(prefs::kDevToolsSyncPreferences, false);
+ // even if kDevToolsSyncPreferences is disabled, the js frontend tries to access
+ // these two. E.g.: 'clearPreferences', that is overridden by devtools_compatibility.js
+ registry->RegisterDictionaryPref(prefs::kDevToolsSyncedPreferencesSyncDisabled);
+ registry->RegisterDictionaryPref(prefs::kDevToolsSyncedPreferencesSyncEnabled);
+
+ registry->RegisterStringPref(prefs::kGoogleServicesSigninScopedDeviceId, std::string());
+ registry->RegisterStringPref(prefs::kGaiaCookieLastListAccountsData, std::string());
+ registry->RegisterStringPref(prefs::kGCMProductCategoryForSubtypes, std::string());
+
+ {
+ base::ScopedAllowBlocking allowBlock;
+ m_prefService = factory.Create(registry);
}
#if QT_CONFIG(webengine_spellchecker)
@@ -183,10 +188,9 @@ void PrefServiceAdapter::setSpellCheckLanguages(const QStringList &languages)
QStringList PrefServiceAdapter::spellCheckLanguages() const
{
QStringList spellcheck_dictionaries;
- for (const auto &value : *m_prefService->GetList(spellcheck::prefs::kSpellCheckDictionaries)) {
- std::string dictionary;
- if (value.GetAsString(&dictionary))
- spellcheck_dictionaries.append(QString::fromStdString(dictionary));
+ const auto &list = m_prefService->GetList(spellcheck::prefs::kSpellCheckDictionaries);
+ for (const auto &dictionary : list) {
+ spellcheck_dictionaries.append(QString::fromStdString(dictionary.GetString()));
}
return spellcheck_dictionaries;
diff --git a/src/core/pref_service_adapter.h b/src/core/pref_service_adapter.h
index 1c7c44a96..efa83a72c 100644
--- a/src/core/pref_service_adapter.h
+++ b/src/core/pref_service_adapter.h
@@ -1,42 +1,5 @@
-
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef PREF_SERVICE_ADAPTER_H
#define PREF_SERVICE_ADAPTER_H
@@ -44,12 +7,6 @@
#include "components/prefs/pref_service.h"
#include "qtwebenginecoreglobal_p.h"
-QT_BEGIN_NAMESPACE
-class QStringList;
-QT_END_NAMESPACE
-
-class ProfileAdapter;
-
namespace QtWebEngineCore {
class ProfileAdapter;
diff --git a/src/core/printing/pdf_document_helper_client_qt.cpp b/src/core/printing/pdf_document_helper_client_qt.cpp
new file mode 100644
index 000000000..be1cc2e4c
--- /dev/null
+++ b/src/core/printing/pdf_document_helper_client_qt.cpp
@@ -0,0 +1,33 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+// based on chrome/browser/ui/pdf/chrome_pdf_document_helper_client.cc:
+
+#include "pdf_document_helper_client_qt.h"
+
+#include "content/public/browser/render_process_host.h"
+#include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h"
+#include "extensions/common/constants.h"
+
+#include "pdf_util_qt.h"
+
+PDFDocumentHelperClientQt::PDFDocumentHelperClientQt() = default;
+PDFDocumentHelperClientQt::~PDFDocumentHelperClientQt() = default;
+
+content::RenderFrameHost *PDFDocumentHelperClientQt::FindPdfFrame(content::WebContents *contents)
+{
+ content::RenderFrameHost *main_frame = contents->GetPrimaryMainFrame();
+ content::RenderFrameHost *pdf_frame = QtWebEngineCore::FindPdfChildFrame(main_frame);
+ return pdf_frame ? pdf_frame : main_frame;
+}
+
+void PDFDocumentHelperClientQt::SetPluginCanSave(content::RenderFrameHost *render_frame_host, bool can_save)
+{
+ auto *guest_view = extensions::MimeHandlerViewGuest::FromRenderFrameHost(render_frame_host);
+ if (guest_view)
+ guest_view->SetPluginCanSave(can_save);
+}
+
+void PDFDocumentHelperClientQt::UpdateContentRestrictions(content::RenderFrameHost *, int)
+{
+}
diff --git a/src/core/printing/pdf_document_helper_client_qt.h b/src/core/printing/pdf_document_helper_client_qt.h
new file mode 100644
index 000000000..af58c7794
--- /dev/null
+++ b/src/core/printing/pdf_document_helper_client_qt.h
@@ -0,0 +1,27 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef PDF_DOCUMENT_HELPER_CLIENT_QT_H
+#define PDF_DOCUMENT_HELPER_CLIENT_QT_H
+
+#include "components/pdf/browser/pdf_document_helper_client.h"
+
+// based on chrome/browser/ui/pdf/chrome_pdf_document_helper_client.h:
+class PDFDocumentHelperClientQt : public pdf::PDFDocumentHelperClient // FIXME: rename
+{
+public:
+ PDFDocumentHelperClientQt();
+ PDFDocumentHelperClientQt(const PDFDocumentHelperClientQt&) = delete;
+ PDFDocumentHelperClientQt& operator=(const PDFDocumentHelperClientQt&) = delete;
+ ~PDFDocumentHelperClientQt() override;
+
+private:
+ // pdf::PDFDocumentHelperClient:
+ content::RenderFrameHost* FindPdfFrame(content::WebContents *contents) override;
+ void OnPDFHasUnsupportedFeature(content::WebContents *contents) override {}
+ void OnSaveURL(content::WebContents *contents) override {}
+ void SetPluginCanSave(content::RenderFrameHost *render_frame_host, bool can_save) override;
+ void UpdateContentRestrictions(content::RenderFrameHost *, int) override;
+};
+
+#endif // PDF_DOCUMENT_HELPER_CLIENT_QT_H
diff --git a/src/core/printing/pdf_stream_delegate_qt.cpp b/src/core/printing/pdf_stream_delegate_qt.cpp
new file mode 100644
index 000000000..8677c82bd
--- /dev/null
+++ b/src/core/printing/pdf_stream_delegate_qt.cpp
@@ -0,0 +1,99 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+// based on chrome/browser/pdf/chrome_pdf_stream_delegate.cc:
+
+#include "pdf_stream_delegate_qt.h"
+
+#include "base/no_destructor.h"
+#include "chrome/grit/pdf_resources.h"
+#include "content/public/browser/document_user_data.h"
+#include "content/public/browser/navigation_handle.h"
+#include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h"
+#include "extensions/common/constants.h"
+#include "ui/base/resource/resource_bundle.h"
+
+// Associates a `pdf::PdfStreamDelegate::StreamInfo` with the PDF extension's
+// or Print Preview's `blink::Document`.
+// `ChromePdfStreamDelegate::MapToOriginalUrl()` initializes this in
+// `PdfNavigationThrottle`, and then `ChromePdfStreamDelegate::GetStreamInfo()`
+// returns the stashed result to `PdfURLLoaderRequestInterceptor`.
+class StreamInfoHelper : public content::DocumentUserData<StreamInfoHelper>
+{
+public:
+ absl::optional<pdf::PdfStreamDelegate::StreamInfo> TakeStreamInfo()
+ { return std::move(stream_info_); }
+
+private:
+ friend class content::DocumentUserData<StreamInfoHelper>;
+ DOCUMENT_USER_DATA_KEY_DECL();
+
+ StreamInfoHelper(content::RenderFrameHost* embedder_frame,
+ pdf::PdfStreamDelegate::StreamInfo stream_info)
+ : content::DocumentUserData<StreamInfoHelper>(embedder_frame),
+ stream_info_(std::move(stream_info)) {}
+
+ absl::optional<pdf::PdfStreamDelegate::StreamInfo> stream_info_;
+};
+
+DOCUMENT_USER_DATA_KEY_IMPL(StreamInfoHelper);
+
+PdfStreamDelegateQt::PdfStreamDelegateQt() = default;
+PdfStreamDelegateQt::~PdfStreamDelegateQt() = default;
+
+absl::optional<GURL> PdfStreamDelegateQt::MapToOriginalUrl(content::NavigationHandle &navigation_handle)
+{
+ content::RenderFrameHost *embedder_frame = navigation_handle.GetParentFrame();
+ StreamInfoHelper *helper = StreamInfoHelper::GetForCurrentDocument(embedder_frame);
+ if (helper) {
+ // PDF viewer and Print Preview only do this once per WebContents.
+ return absl::nullopt;
+ }
+
+ GURL original_url;
+ StreamInfo info;
+
+ content::WebContents* contents = navigation_handle.GetWebContents();
+ extensions::MimeHandlerViewGuest *guest =
+ extensions::MimeHandlerViewGuest::FromWebContents(contents);
+ if (guest) {
+ base::WeakPtr<extensions::StreamContainer> stream = guest->GetStreamWeakPtr();
+ if (!stream || stream->extension_id() != extension_misc::kPdfExtensionId ||
+ stream->stream_url() != navigation_handle.GetURL() ||
+ !stream->pdf_plugin_attributes()) {
+ return absl::nullopt;
+ }
+
+ original_url = stream->original_url();
+ info.background_color = base::checked_cast<SkColor>(stream->pdf_plugin_attributes()->background_color);
+ info.full_frame = !stream->embedded();
+ info.allow_javascript = stream->pdf_plugin_attributes()->allow_javascript;
+ } else {
+ return absl::nullopt;
+ }
+
+ static const base::NoDestructor<std::string> injected_script(
+ ui::ResourceBundle::GetSharedInstance().LoadDataResourceString(
+ IDR_PDF_PDF_INTERNAL_PLUGIN_WRAPPER_ROLLUP_JS));
+
+ info.stream_url = navigation_handle.GetURL();
+ info.original_url = original_url;
+ info.injected_script = injected_script.get();
+ StreamInfoHelper::CreateForCurrentDocument(embedder_frame, std::move(info));
+ return original_url;
+}
+
+absl::optional<pdf::PdfStreamDelegate::StreamInfo>
+PdfStreamDelegateQt::GetStreamInfo(content::RenderFrameHost* embedder_frame)
+{
+ if (!embedder_frame)
+ return absl::nullopt;
+
+ StreamInfoHelper *helper = StreamInfoHelper::GetForCurrentDocument(embedder_frame);
+ if (!helper)
+ return absl::nullopt;
+
+ // Only the call immediately following `MapToOriginalUrl()` requires a valid
+ // `StreamInfo`; subsequent calls should just get nothing.
+ return helper->TakeStreamInfo();
+}
diff --git a/src/core/printing/pdf_stream_delegate_qt.h b/src/core/printing/pdf_stream_delegate_qt.h
new file mode 100644
index 000000000..fd279af72
--- /dev/null
+++ b/src/core/printing/pdf_stream_delegate_qt.h
@@ -0,0 +1,23 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef PDF_STREAM_DELEGATE_QT_H
+#define PDF_STREAM_DELEGATE_QT_H
+
+#include "components/pdf/browser/pdf_stream_delegate.h"
+
+// based on chrome/browser/pdf/chrome_pdf_stream_delegate.h:
+class PdfStreamDelegateQt : public pdf::PdfStreamDelegate
+{
+public:
+ PdfStreamDelegateQt();
+ PdfStreamDelegateQt(const PdfStreamDelegateQt &) = delete;
+ PdfStreamDelegateQt operator=(const PdfStreamDelegateQt &) = delete;
+ ~PdfStreamDelegateQt() override;
+
+ // pdf::PdfStreamDelegate:
+ absl::optional<GURL> MapToOriginalUrl(content::NavigationHandle &navigation_handle) override;
+ absl::optional<StreamInfo> GetStreamInfo(content::RenderFrameHost *embedder_frame) override;
+};
+
+#endif // PDF_STREAM_DELEGATE_QT_H
diff --git a/src/core/printing/pdfium_document_wrapper_qt.cpp b/src/core/printing/pdfium_document_wrapper_qt.cpp
index dae6ec44b..56588620d 100644
--- a/src/core/printing/pdfium_document_wrapper_qt.cpp
+++ b/src/core/printing/pdfium_document_wrapper_qt.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "pdfium_document_wrapper_qt.h"
#include <QtCore/qhash.h>
diff --git a/src/core/printing/pdfium_document_wrapper_qt.h b/src/core/printing/pdfium_document_wrapper_qt.h
index e0778c32b..feb34e36a 100644
--- a/src/core/printing/pdfium_document_wrapper_qt.h
+++ b/src/core/printing/pdfium_document_wrapper_qt.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
//
// W A R N I N G
@@ -57,7 +21,7 @@
namespace QtWebEngineCore {
-class Q_WEBENGINECORE_PRIVATE_EXPORT PdfiumDocumentWrapperQt
+class Q_WEBENGINECORE_EXPORT PdfiumDocumentWrapperQt
{
public:
PdfiumDocumentWrapperQt(const void *pdfData, size_t size, const char *password = nullptr);
diff --git a/src/core/printing/print_view_manager_base_qt.cpp b/src/core/printing/print_view_manager_base_qt.cpp
index 34c86e506..b2b8e34fc 100644
--- a/src/core/printing/print_view_manager_base_qt.cpp
+++ b/src/core/printing/print_view_manager_base_qt.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// This is based on chrome/browser/printing/print_view_manager_base.cc:
// Copyright 2013 The Chromium Authors. All rights reserved.
@@ -48,21 +12,21 @@
#include "web_engine_context.h"
#include "base/memory/ref_counted_memory.h"
-#include "base/message_loop/message_loop.h"
-#include "base/message_loop/message_loop_current.h"
#include "base/run_loop.h"
-#include "base/single_thread_task_runner.h"
-#include "base/task/post_task.h"
+#include "base/task/current_thread.h"
+#include "base/task/thread_pool.h"
#include "base/timer/timer.h"
#include "base/values.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/printing/print_job.h"
#include "chrome/browser/printing/print_job_manager.h"
#include "chrome/browser/printing/printer_query.h"
-#include "components/printing/common/print_messages.h"
+#include "components/printing/browser/print_manager_utils.h"
+#include "components/printing/common/print.mojom.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_frame_host.h"
+#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
@@ -72,16 +36,90 @@
namespace QtWebEngineCore {
+namespace {
+
+// Runs |callback| with |params| to reply to
+// mojom::PrintManagerHost::GetDefaultPrintSettings.
+void GetDefaultPrintSettingsReply(printing::mojom::PrintManagerHost::GetDefaultPrintSettingsCallback callback,
+ printing::mojom::PrintParamsPtr params)
+{
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ std::move(callback).Run(std::move(params));
+}
+
+void OnDidGetDefaultPrintSettings(scoped_refptr<printing::PrintQueriesQueue> queue,
+ std::unique_ptr<printing::PrinterQuery> printer_query,
+ printing::mojom::PrintManagerHost::GetDefaultPrintSettingsCallback callback)
+{
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ printing::mojom::PrintParamsPtr params = printing::mojom::PrintParams::New();
+ if (printer_query && printer_query->last_status() == printing::mojom::ResultCode::kSuccess) {
+ RenderParamsFromPrintSettings(printer_query->settings(), params.get());
+ params->document_cookie = printer_query->cookie();
+ }
+
+ GetDefaultPrintSettingsReply(std::move(callback), std::move(params));
+
+ // If printing was enabled.
+ if (printer_query) {
+ // If user hasn't cancelled.
+ if (printer_query->cookie() && printer_query->settings().dpi()) {
+ queue->QueuePrinterQuery(std::move(printer_query));
+ }
+ }
+}
+
+void OnDidUpdatePrintSettings(scoped_refptr<printing::PrintQueriesQueue> queue,
+ std::unique_ptr<printing::PrinterQuery> printer_query,
+ printing::mojom::PrintManagerHost::UpdatePrintSettingsCallback callback,
+ int process_id, int routing_id)
+{
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ DCHECK(printer_query);
+ auto params = printing::mojom::PrintPagesParams::New();
+ params->params = printing::mojom::PrintParams::New();
+ if (printer_query->last_status() == printing::mojom::ResultCode::kSuccess) {
+ RenderParamsFromPrintSettings(printer_query->settings(), params->params.get());
+ params->params->document_cookie = printer_query->cookie();
+ params->pages = printer_query->settings().ranges();
+ }
+
+ std::move(callback).Run(std::move(params));
+
+ if (printer_query->cookie() && printer_query->settings().dpi()) {
+ queue->QueuePrinterQuery(std::move(printer_query));
+ }
+}
+
+void OnDidScriptedPrint(scoped_refptr<printing::PrintQueriesQueue> queue,
+ std::unique_ptr<printing::PrinterQuery> printer_query,
+ printing::mojom::PrintManagerHost::ScriptedPrintCallback callback)
+{
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ auto params = printing::mojom::PrintPagesParams::New();
+ params->params = printing::mojom::PrintParams::New();
+ if (printer_query->last_status() == printing::mojom::ResultCode::kSuccess && printer_query->settings().dpi()) {
+ RenderParamsFromPrintSettings(printer_query->settings(), params->params.get());
+ params->params->document_cookie = printer_query->cookie();
+ params->pages = printer_query->settings().ranges();
+ }
+ bool has_valid_cookie = params->params->document_cookie;
+ bool has_dpi = !params->params->dpi.IsEmpty();
+ std::move(callback).Run(std::move(params));
+
+ if (has_dpi && has_valid_cookie) {
+ queue->QueuePrinterQuery(std::move(printer_query));
+ }
+}
+
+} // namespace
+
PrintViewManagerBaseQt::PrintViewManagerBaseQt(content::WebContents *contents)
: printing::PrintManager(contents)
- , m_isInsideInnerMessageLoop(false)
+ , m_printingRFH(nullptr)
, m_didPrintingSucceed(false)
, m_printerQueriesQueue(WebEngineContext::current()->getPrintJobManager()->queue())
- , m_printingRFH(nullptr)
{
- // FIXME: Check if this needs to be executed async:
- // TODO: Add isEnabled to profile
- PrintViewManagerBaseQt::UpdatePrintingEnabled();
}
PrintViewManagerBaseQt::~PrintViewManagerBaseQt()
@@ -96,16 +134,23 @@ void PrintViewManagerBaseQt::SetPrintingRFH(content::RenderFrameHost *rfh)
m_printingRFH = rfh;
}
-void PrintViewManagerBaseQt::UpdatePrintingEnabled()
-{
+void PrintViewManagerBaseQt::ScriptedPrintReply(ScriptedPrintCallback callback,
+ int process_id,
+ printing::mojom::PrintPagesParamsPtr params) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- bool enabled = false;
-#if QT_CONFIG(webengine_printing_and_pdf)
- enabled = true;
+
+#if BUILDFLAG(ENABLE_OOP_PRINTING)
+ // Finished getting all settings (defaults and from user), no further need
+ // to be registered as a system print client.
+ UnregisterSystemPrintClient();
#endif
- web_contents()->ForEachFrame(
- base::Bind(&PrintViewManagerBaseQt::SendPrintingEnabled,
- base::Unretained(this), enabled));
+ if (!content::RenderProcessHost::FromID(process_id)) {
+ // Early return if the renderer is not alive.
+ return;
+ }
+
+// set_cookie(params->params->document_cookie);
+ std::move(callback).Run(std::move(params));
}
void PrintViewManagerBaseQt::NavigationStopped()
@@ -114,53 +159,56 @@ void PrintViewManagerBaseQt::NavigationStopped()
TerminatePrintJob(true);
}
-base::string16 PrintViewManagerBaseQt::RenderSourceName()
+std::u16string PrintViewManagerBaseQt::RenderSourceName()
{
return toString16(QLatin1String(""));
}
-void PrintViewManagerBaseQt::PrintDocument(printing::PrintedDocument *document,
- const scoped_refptr<base::RefCountedMemory> &print_data,
+void PrintViewManagerBaseQt::PrintDocument(scoped_refptr<base::RefCountedMemory> print_data,
const gfx::Size &page_size,
const gfx::Rect &content_area,
const gfx::Point &offsets)
{
std::unique_ptr<printing::MetafileSkia> metafile =
std::make_unique<printing::MetafileSkia>();
- CHECK(metafile->InitFromData(print_data->front(), print_data->size()));
+ CHECK(metafile->InitFromData(*print_data));
// Update the rendered document. It will send notifications to the listener.
- document->SetDocument(std::move(metafile), page_size, content_area);
+ printing::PrintedDocument* document = m_printJob->document();
+ document->SetDocument(std::move(metafile));
ShouldQuitFromInnerMessageLoop();
}
-printing::PrintedDocument *PrintViewManagerBaseQt::GetDocument(int cookie)
+void PrintViewManagerBaseQt::DidGetPrintedPagesCount(int32_t cookie, uint32_t number_pages)
+{
+ PrintManager::DidGetPrintedPagesCount(cookie, number_pages);
+ OpportunisticallyCreatePrintJob(cookie);
+}
+
+bool PrintViewManagerBaseQt::PrintJobHasDocument(int cookie)
{
if (!OpportunisticallyCreatePrintJob(cookie))
- return nullptr;
+ return false;
+ // These checks may fail since we are completely asynchronous. Old spurious
+ // messages can be received if one of the processes is overloaded.
printing::PrintedDocument* document = m_printJob->document();
- if (!document || cookie != document->cookie()) {
- // Out of sync. It may happen since we are completely asynchronous. Old
- // spurious messages can be received if one of the processes is overloaded.
- return nullptr;
- }
- return document;
+ return document && document->cookie() == cookie;
}
-// IPC handlers
-void PrintViewManagerBaseQt::OnDidPrintDocument(content::RenderFrameHost* /*render_frame_host*/,
- const PrintHostMsg_DidPrintDocument_Params &params,
- std::unique_ptr<DelayedFrameDispatchHelper> helper)
+void PrintViewManagerBaseQt::DidPrintDocument(printing::mojom::DidPrintDocumentParamsPtr params,
+ DidPrintDocumentCallback callback)
{
- printing::PrintedDocument *document = GetDocument(params.document_cookie);
- if (!document)
+ if (!PrintJobHasDocument(params->document_cookie)) {
+ std::move(callback).Run(false);
return;
+ }
- const PrintHostMsg_DidPrintContent_Params &content = params.content;
+ const printing::mojom::DidPrintContentParams &content = *params->content;
if (!content.metafile_data_region.IsValid()) {
NOTREACHED() << "invalid memory handle";
web_contents()->Stop();
+ std::move(callback).Run(false);
return;
}
@@ -168,41 +216,91 @@ void PrintViewManagerBaseQt::OnDidPrintDocument(content::RenderFrameHost* /*rend
if (!data) {
NOTREACHED() << "couldn't map";
web_contents()->Stop();
+ std::move(callback).Run(false);
return;
}
- PrintDocument(document, data, params.page_size, params.content_area,
- params.physical_offsets);
- if (helper)
- helper->SendCompleted();
+ PrintDocument(data, params->page_size, params->content_area,
+ params->physical_offsets);
+ std::move(callback).Run(true);
}
-void PrintViewManagerBaseQt::OnGetDefaultPrintSettings(content::RenderFrameHost *render_frame_host,
- IPC::Message *reply_msg)
+void PrintViewManagerBaseQt::GetDefaultPrintSettings(GetDefaultPrintSettingsCallback callback)
{
- NOTREACHED() << "should be handled by printing::PrintingMessageFilter";
+ content::RenderFrameHost *render_frame_host =
+ print_manager_host_receivers_.GetCurrentTargetFrame();
+ content::RenderProcessHost *render_process_host =
+ render_frame_host->GetProcess();
+
+ auto callback_wrapper =
+ base::BindOnce(&GetDefaultPrintSettingsReply, std::move(callback));
+ std::unique_ptr<printing::PrinterQuery> printer_query = m_printerQueriesQueue->PopPrinterQuery(0);
+ if (!printer_query)
+ printer_query = m_printerQueriesQueue->CreatePrinterQuery(render_frame_host->GetGlobalId());
+
+ // Loads default settings. This is asynchronous, only the mojo message sender
+ // will hang until the settings are retrieved.
+ auto *printer_query_ptr = printer_query.get();
+ printer_query_ptr->GetDefaultSettings(
+ base::BindOnce(&OnDidGetDefaultPrintSettings, m_printerQueriesQueue,
+ std::move(printer_query), std::move(callback_wrapper)),
+ false,
+ !render_process_host->IsPdf());
}
-void PrintViewManagerBaseQt::OnScriptedPrint(content::RenderFrameHost *render_frame_host,
- const PrintHostMsg_ScriptedPrint_Params &params,
- IPC::Message *reply_msg)
+void PrintViewManagerBaseQt::PrintingFailed(int32_t cookie, printing::mojom::PrintFailureReason reason)
{
- NOTREACHED() << "should be handled by printing::PrintingMessageFilter";
-}
+ // Note: Not redundant with cookie checks in the same method in other parts of
+ // the class hierarchy.
+ if (!IsValidCookie(cookie))
+ return;
-void PrintViewManagerBaseQt::OnShowInvalidPrinterSettingsError()
+ PrintManager::PrintingFailed(cookie, reason);
+
+ ReleasePrinterQuery();
+}
+void PrintViewManagerBaseQt::IsPrintingEnabled(IsPrintingEnabledCallback callback)
{
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ bool enabled = false;
+#if QT_CONFIG(webengine_printing_and_pdf)
+ enabled = true;
+#endif
+ std::move(callback).Run(enabled);
}
-void PrintViewManagerBaseQt::DidStartLoading()
+void PrintViewManagerBaseQt::ScriptedPrint(printing::mojom::ScriptedPrintParamsPtr params,
+ printing::mojom::PrintManagerHost::ScriptedPrintCallback callback)
{
- UpdatePrintingEnabled();
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ content::RenderFrameHost *render_frame_host =
+ print_manager_host_receivers_.GetCurrentTargetFrame();
+ content::RenderProcessHost *render_process_host =
+ render_frame_host->GetProcess();
+
+ auto callback_wrapper = base::BindOnce(
+ &PrintViewManagerBaseQt::ScriptedPrintReply, weak_ptr_factory_.GetWeakPtr(),
+ std::move(callback), render_process_host->GetID());
+
+ std::unique_ptr<printing::PrinterQuery> printer_query =
+ m_printerQueriesQueue->PopPrinterQuery(params->cookie);
+ if (!printer_query)
+ printer_query = m_printerQueriesQueue->CreatePrinterQuery(render_frame_host->GetGlobalId());
+
+ auto *printer_query_ptr = printer_query.get();
+ printer_query_ptr->GetSettingsFromUser(
+ params->expected_pages_count, params->has_selection, params->margin_type,
+ params->is_scripted, !render_process_host->IsPdf(),
+ base::BindOnce(&OnDidScriptedPrint, m_printerQueriesQueue, std::move(printer_query), std::move(callback_wrapper)));
}
-// Note: In PrintViewManagerQt we always initiate printing with PrintMsg_InitiatePrintPreview
+// Note: In PrintViewManagerQt we always initiate printing with
+// printing::mojom::PrintRenderFrame::InitiatePrintPreview()
// so m_printingRFH is never set and used at the moment.
void PrintViewManagerBaseQt::RenderFrameDeleted(content::RenderFrameHost *render_frame_host)
{
+ PrintManager::RenderFrameDeleted(render_frame_host);
+
// Terminates or cancels the print job if one was pending.
if (render_frame_host != m_printingRFH)
return;
@@ -216,7 +314,7 @@ void PrintViewManagerBaseQt::RenderFrameDeleted(content::RenderFrameHost *render
return;
scoped_refptr<printing::PrintedDocument> document(m_printJob->document());
- if (document.get()) {
+ if (document) {
// If IsComplete() returns false, the document isn't completely rendered.
// Since our renderer is gone, there's nothing to do, cancel it. Otherwise,
// the print job may finish without problem.
@@ -224,73 +322,22 @@ void PrintViewManagerBaseQt::RenderFrameDeleted(content::RenderFrameHost *render
}
}
-bool PrintViewManagerBaseQt::OnMessageReceived(const IPC::Message& message,
- content::RenderFrameHost* render_frame_host)
+void PrintViewManagerBaseQt::OnDocDone(int /*job_id*/, printing::PrintedDocument * /*document*/)
{
- bool handled = true;
- IPC_BEGIN_MESSAGE_MAP(PrintViewManagerBaseQt, message)
- IPC_MESSAGE_HANDLER(PrintHostMsg_ShowInvalidPrinterSettingsError,
- OnShowInvalidPrinterSettingsError);
- IPC_MESSAGE_UNHANDLED(handled = false)
- IPC_END_MESSAGE_MAP()
- return handled || PrintManager::OnMessageReceived(message, render_frame_host);
}
-void PrintViewManagerBaseQt::Observe(int type,
- const content::NotificationSource& /*source*/,
- const content::NotificationDetails& details)
+void PrintViewManagerBaseQt::OnJobDone()
{
- DCHECK_EQ(chrome::NOTIFICATION_PRINT_JOB_EVENT, type);
- OnNotifyPrintJobEvent(*content::Details<printing::JobEventDetails>(details).ptr());
+ // Printing is done, we don't need it anymore.
+ // print_job_->is_job_pending() may still be true, depending on the order
+ // of object registration.
+ m_didPrintingSucceed = true;
+ ReleasePrintJob();
}
-void PrintViewManagerBaseQt::OnNotifyPrintJobEvent(const printing::JobEventDetails& event_details)
+void PrintViewManagerBaseQt::OnFailed()
{
- switch (event_details.type()) {
- case printing::JobEventDetails::FAILED: {
- TerminatePrintJob(true);
-
- content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_PRINT_JOB_RELEASED,
- content::Source<content::WebContents>(web_contents()),
- content::NotificationService::NoDetails());
- break;
- }
- case printing::JobEventDetails::USER_INIT_DONE:
- case printing::JobEventDetails::DEFAULT_INIT_DONE:
- case printing::JobEventDetails::USER_INIT_CANCELED: {
- NOTREACHED();
- break;
- }
- case printing::JobEventDetails::ALL_PAGES_REQUESTED: {
- ShouldQuitFromInnerMessageLoop();
- break;
- }
- case printing::JobEventDetails::NEW_DOC:
-#if defined(OS_WIN)
- case printing::JobEventDetails::PAGE_DONE:
-#endif
- case printing::JobEventDetails::DOC_DONE: {
- // Don't care about the actual printing process.
- break;
- }
- case printing::JobEventDetails::JOB_DONE: {
- // Printing is done, we don't need it anymore.
- // print_job_->is_job_pending() may still be true, depending on the order
- // of object registration.
- m_didPrintingSucceed = true;
- ReleasePrintJob();
-
- content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_PRINT_JOB_RELEASED,
- content::Source<content::WebContents>(web_contents()),
- content::NotificationService::NoDetails());
- break;
- }
- default:
- NOTREACHED();
- break;
- }
+ TerminatePrintJob(true);
}
// Requests the RenderView to render all the missing pages for the print job.
@@ -309,8 +356,8 @@ bool PrintViewManagerBaseQt::RenderAllMissingPagesNow()
// We can't print if there is no renderer.
if (!web_contents() ||
- !web_contents()->GetRenderViewHost() ||
- !web_contents()->GetRenderViewHost()->IsRenderViewLive()) {
+ !web_contents()->GetPrimaryMainFrame() ||
+ !web_contents()->GetPrimaryMainFrame()->IsRenderFrameLive()) {
return false;
}
@@ -319,11 +366,9 @@ bool PrintViewManagerBaseQt::RenderAllMissingPagesNow()
// pages in an hurry if a print_job_ is still pending. No need to wait for it
// to actually spool the pages, only to have the renderer generate them. Run
// a message loop until we get our signal that the print job is satisfied.
- // PrintJob will send a ALL_PAGES_REQUESTED after having received all the
- // pages it needs. MessageLoop::current()->Quit() will be called as soon as
- // print_job_->document()->IsComplete() is true on either ALL_PAGES_REQUESTED
- // or in DidPrintPage(). The check is done in
- // ShouldQuitFromInnerMessageLoop().
+ // |quit_inner_loop_| will be called as soon as
+ // print_job_->document()->IsComplete() is true in DidPrintDocument(). The
+ // check is done in ShouldQuitFromInnerMessageLoop().
// BLOCKS until all the pages are received. (Need to enable recursive task)
if (!RunInnerMessageLoop()) {
// This function is always called from DisconnectFromCurrentPrintJob() so we
@@ -333,36 +378,32 @@ bool PrintViewManagerBaseQt::RenderAllMissingPagesNow()
return true;
}
-// Quits the current message loop if these conditions hold true: a document is
-// loaded and is complete and waiting_for_pages_to_be_rendered_ is true. This
-// function is called in DidPrintPage() or on ALL_PAGES_REQUESTED
-// notification. The inner message loop is created was created by
-// RenderAllMissingPagesNow().
void PrintViewManagerBaseQt::ShouldQuitFromInnerMessageLoop()
{
// Look at the reason.
DCHECK(m_printJob->document());
- if (m_printJob->document() &&
- m_printJob->document()->IsComplete() &&
- m_isInsideInnerMessageLoop) {
- // We are in a message loop created by RenderAllMissingPagesNow. Quit from
- // it.
- base::RunLoop::QuitCurrentWhenIdleDeprecated();
- m_isInsideInnerMessageLoop = false;
+ if (m_printJob->document() && m_printJob->document()->IsComplete() && m_quitInnerLoop) {
+ // We are in a message loop created by RenderAllMissingPagesNow. Quit from
+ // it.
+ std::move(m_quitInnerLoop).Run();
}
}
bool PrintViewManagerBaseQt::CreateNewPrintJob(std::unique_ptr<printing::PrinterQuery> query)
{
- DCHECK(!m_isInsideInnerMessageLoop);
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ DCHECK(!m_quitInnerLoop);
DCHECK(query);
// Disconnect the current |m_printJob|.
+ auto weak_this = weak_ptr_factory_.GetWeakPtr();
DisconnectFromCurrentPrintJob();
+ if (!weak_this)
+ return false;
// We can't print if there is no renderer.
- if (!web_contents()->GetRenderViewHost() ||
- !web_contents()->GetRenderViewHost()->IsRenderViewLive()) {
+ if (!web_contents()->GetPrimaryMainFrame() ||
+ !web_contents()->GetPrimaryMainFrame()->IsRenderFrameLive()) {
return false;
}
@@ -370,10 +411,9 @@ bool PrintViewManagerBaseQt::CreateNewPrintJob(std::unique_ptr<printing::Printer
// view and switch to it, initialize the printer and show the print dialog.
DCHECK(!m_printJob.get());
- m_printJob = base::MakeRefCounted<printing::PrintJob>();
+ m_printJob = base::MakeRefCounted<printing::PrintJob>(nullptr /*g_browser_process->print_job_manager()*/);
m_printJob->Initialize(std::move(query), RenderSourceName(), number_pages_);
- m_registrar.Add(this, chrome::NOTIFICATION_PRINT_JOB_EVENT,
- content::Source<printing::PrintJob>(m_printJob.get()));
+ m_printJob->AddObserver(*this);
m_didPrintingSucceed = false;
return true;
}
@@ -405,9 +445,9 @@ void PrintViewManagerBaseQt::TerminatePrintJob(bool cancel)
if (cancel) {
// We don't need the metafile data anymore because the printing is canceled.
m_printJob->Cancel();
- m_isInsideInnerMessageLoop = false;
+ m_quitInnerLoop.Reset();
} else {
- DCHECK(!m_isInsideInnerMessageLoop);
+ DCHECK(!m_quitInnerLoop);
DCHECK(!m_printJob->document() || m_printJob->document()->IsComplete());
// WebContents is either dying or navigating elsewhere. We need to render
@@ -429,13 +469,14 @@ void PrintViewManagerBaseQt::ReleasePrintJob()
if (rfh)
GetPrintRenderFrame(rfh)->PrintingDone(m_didPrintingSucceed);
- m_registrar.Remove(this, chrome::NOTIFICATION_PRINT_JOB_EVENT,
- content::Source<printing::PrintJob>(m_printJob.get()));
+ m_printJob->RemoveObserver(*this);
+
// Don't close the worker thread.
m_printJob = nullptr;
}
-bool PrintViewManagerBaseQt::RunInnerMessageLoop() {
+bool PrintViewManagerBaseQt::RunInnerMessageLoop()
+{
// This value may actually be too low:
//
// - If we're looping because of printer settings initialization, the premise
@@ -451,23 +492,18 @@ bool PrintViewManagerBaseQt::RunInnerMessageLoop() {
base::OneShotTimer quit_timer;
base::RunLoop run_loop;
quit_timer.Start(FROM_HERE,
- base::TimeDelta::FromMilliseconds(kPrinterSettingsTimeout),
+ base::Milliseconds(kPrinterSettingsTimeout),
run_loop.QuitWhenIdleClosure());
- m_isInsideInnerMessageLoop = true;
+ m_quitInnerLoop = run_loop.QuitClosure();
- // Need to enable recursive task.
- {
- base::MessageLoopCurrent::ScopedNestableTaskAllower allow;
- run_loop.Run();
- }
+ auto weak_this = weak_ptr_factory_.GetWeakPtr();
+ run_loop.Run();
+ if (!weak_this)
+ return false;
- bool success = true;
- if (m_isInsideInnerMessageLoop) {
- // Ok we timed out. That's sad.
- m_isInsideInnerMessageLoop = false;
- success = false;
- }
+ bool success = !m_quitInnerLoop;
+ m_quitInnerLoop.Reset();
return success;
}
@@ -515,12 +551,8 @@ void PrintViewManagerBaseQt::ReleasePrinterQuery()
if (!printJobManager)
return;
- std::unique_ptr<printing::PrinterQuery> printerQuery;
- printerQuery = m_printerQueriesQueue->PopPrinterQuery(cookie);
- if (!printerQuery)
- return;
- base::PostTask(FROM_HERE, {content::BrowserThread::IO},
- base::BindOnce(&printing::PrinterQuery::StopWorker, std::move(printerQuery)));
+ std::unique_ptr<printing::PrinterQuery> printerQuery =
+ m_printerQueriesQueue->PopPrinterQuery(cookie);
}
// Originally from print_preview_message_handler.cc:
@@ -528,17 +560,31 @@ void PrintViewManagerBaseQt::StopWorker(int documentCookie)
{
if (documentCookie <= 0)
return;
- std::unique_ptr<printing::PrinterQuery> printer_query =
+ std::unique_ptr<printing::PrinterQuery> printerQuery =
m_printerQueriesQueue->PopPrinterQuery(documentCookie);
- if (printer_query.get()) {
- base::PostTask(FROM_HERE, {content::BrowserThread::IO},
- base::BindOnce(&printing::PrinterQuery::StopWorker, std::move(printer_query)));
- }
}
-void PrintViewManagerBaseQt::SendPrintingEnabled(bool enabled, content::RenderFrameHost* rfh)
+void PrintViewManagerBaseQt::UpdatePrintSettings(base::Value::Dict job_settings,
+ UpdatePrintSettingsCallback callback)
{
- GetPrintRenderFrame(rfh)->SetPrintingEnabled(enabled);
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+
+ if (!job_settings.FindInt(printing::kSettingPrinterType)) {
+ std::move(callback).Run(nullptr);
+ return;
+ }
+
+ content::RenderFrameHost *render_frame_host =
+ print_manager_host_receivers_.GetCurrentTargetFrame();
+ std::unique_ptr<printing::PrinterQuery> printer_query =
+ m_printerQueriesQueue->CreatePrinterQuery(content::GlobalRenderFrameHostId());
+
+ auto *printer_query_ptr = printer_query.get();
+ printer_query_ptr->SetSettings(
+ std::move(job_settings),
+ base::BindOnce(&OnDidUpdatePrintSettings,
+ m_printerQueriesQueue, std::move(printer_query), std::move(callback),
+ render_frame_host->GetProcess()->GetID(), render_frame_host->GetRoutingID()));
}
} // namespace QtWebEngineCore
diff --git a/src/core/printing/print_view_manager_base_qt.h b/src/core/printing/print_view_manager_base_qt.h
index 1217e8c11..d4b5bfe82 100644
--- a/src/core/printing/print_view_manager_base_qt.h
+++ b/src/core/printing/print_view_manager_base_qt.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
@@ -45,134 +9,138 @@
#define PRINT_VIEW_MANAGER_BASE_QT_H
#include "base/memory/ref_counted_memory.h"
-#include "base/strings/string16.h"
+#include "chrome/browser/printing/print_job.h"
#include "components/prefs/pref_member.h"
#include "components/printing/browser/print_manager.h"
+#include "components/printing/common/print.mojom-forward.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
-struct PrintHostMsg_DidPrintDocument_Params;
-
namespace base {
class RefCountedBytes;
}
namespace content {
class RenderFrameHost;
-class RenderViewHost;
}
namespace printing {
-class JobEventDetails;
-class MetafilePlayer;
-class PrintJob;
-class PrintJobWorkerOwner;
class PrintQueriesQueue;
-class PrintedDocument;
class PrinterQuery;
}
namespace QtWebEngineCore {
-class PrintViewManagerBaseQt : public content::NotificationObserver
- , public printing::PrintManager
+class PrintViewManagerBaseQt : public printing::PrintManager
+ , public printing::PrintJob::Observer
{
public:
~PrintViewManagerBaseQt() override;
- // Whether printing is enabled or not.
- void UpdatePrintingEnabled();
+ std::u16string RenderSourceName();
- virtual base::string16 RenderSourceName();
+ // mojom::PrintManagerHost:
+ void DidGetPrintedPagesCount(int32_t cookie, uint32_t number_pages) override;
+ void DidPrintDocument(printing::mojom::DidPrintDocumentParamsPtr params,
+ DidPrintDocumentCallback callback) override;
+ void GetDefaultPrintSettings(GetDefaultPrintSettingsCallback callback) override;
+ void UpdatePrintSettings(base::Value::Dict, UpdatePrintSettingsCallback) override;
+ void IsPrintingEnabled(IsPrintingEnabledCallback callback) override;
+ void ScriptedPrint(printing::mojom::ScriptedPrintParamsPtr,
+ printing::mojom::PrintManagerHost::ScriptedPrintCallback) override;
+ void PrintingFailed(int32_t cookie,
+ printing::mojom::PrintFailureReason reason) override;
protected:
explicit PrintViewManagerBaseQt(content::WebContents*);
void SetPrintingRFH(content::RenderFrameHost* rfh);
- // content::WebContentsObserver implementation.
// Cancels the print job.
void NavigationStopped() override;
// content::WebContentsObserver implementation.
void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override;
- bool OnMessageReceived(const IPC::Message& message,
- content::RenderFrameHost* render_frame_host) override;
-
- // printing::PrintManager implementation:
- void OnDidPrintDocument(content::RenderFrameHost *render_frame_host,
- const PrintHostMsg_DidPrintDocument_Params &params,
- std::unique_ptr<DelayedFrameDispatchHelper> helper) override;
- void OnGetDefaultPrintSettings(content::RenderFrameHost* render_frame_host,
- IPC::Message* reply_msg) override;
- void OnScriptedPrint(content::RenderFrameHost* render_frame_host,
- const PrintHostMsg_ScriptedPrint_Params& params,
- IPC::Message* reply_msg) override;
-
- void OnShowInvalidPrinterSettingsError();
-
- // Processes a NOTIFY_PRINT_JOB_EVENT notification.
- void OnNotifyPrintJobEvent(const printing::JobEventDetails& event_details);
-
- // content::NotificationObserver implementation.
- void Observe(int,
- const content::NotificationSource&,
- const content::NotificationDetails&) override;
- void StopWorker(int document_cookie);
- // In the case of Scripted Printing, where the renderer is controlling the
- // control flow, print_job_ is initialized whenever possible. No-op is
- // print_job_ is initialized.
- bool OpportunisticallyCreatePrintJob(int cookie);
+ // Creates a new empty print job. It has no settings loaded. If there is
+ // currently a print job, safely disconnect from it. Returns false if it is
+ // impossible to safely disconnect from the current print job or it is
+ // impossible to create a new print job.
+ virtual bool CreateNewPrintJob(std::unique_ptr<printing::PrinterQuery> query);
+
+ // Makes sure the current print_job_ has all its data before continuing, and
+ // disconnect from it.
+ void DisconnectFromCurrentPrintJob();
+ // PrintJob::Observer overrides:
+ void OnDocDone(int job_id, printing::PrintedDocument *document) override;
+ void OnJobDone() override;
+ void OnFailed() override;
+
+ void StopWorker(int documentCookie);
+
+private:
// Requests the RenderView to render all the missing pages for the print job.
// No-op if no print job is pending. Returns true if at least one page has
// been requested to the renderer.
bool RenderAllMissingPagesNow();
- // Checks that synchronization is correct and a print query exists for
- // |cookie|. If so, returns the document associated with the cookie.
- printing::PrintedDocument* GetDocument(int cookie);
+ // Runs `callback` with `params` to reply to ScriptedPrint().
+ void ScriptedPrintReply(ScriptedPrintCallback callback,
+ int process_id,
+ printing::mojom::PrintPagesParamsPtr params);
+
+ // Checks that synchronization is correct with |print_job_| based on |cookie|.
+ bool PrintJobHasDocument(int cookie);
- // Starts printing a document with data given in |print_data|. |print_data|
- // must successfully initialize a metafile. |document| is the printed
- // document associated with the print job. Returns true if successful.
- void PrintDocument(printing::PrintedDocument *document,
- const scoped_refptr<base::RefCountedMemory> &print_data,
+ // Starts printing the |document| in |print_job_| with the given |print_data|.
+ // This method assumes PrintJobHasDocument() has been called, and |print_data|
+ // contains valid data.
+ void PrintDocument(scoped_refptr<base::RefCountedMemory> print_data,
const gfx::Size &page_size,
const gfx::Rect &content_area,
const gfx::Point &offsets);
// Quits the current message loop if these conditions hold true: a document is
// loaded and is complete and waiting_for_pages_to_be_rendered_ is true. This
- // function is called in DidPrintDocument() or on ALL_PAGES_REQUESTED
- // notification. The inner message loop is created was created by
- // RenderAllMissingPagesNow().
+ // function is called in DidPrintDocument(). The inner message loop was
+ // created by RenderAllMissingPagesNow().
void ShouldQuitFromInnerMessageLoop();
- bool RunInnerMessageLoop();
-
+ // Terminates the print job. No-op if no print job has been created. If
+ // |cancel| is true, cancel it instead of waiting for the job to finish. Will
+ // call ReleasePrintJob().
void TerminatePrintJob(bool cancel);
- void DisconnectFromCurrentPrintJob();
- bool CreateNewPrintJob(std::unique_ptr<printing::PrinterQuery> query);
+ // Releases print_job_. Correctly deregisters from notifications. No-op if
+ // no print job has been created.
void ReleasePrintJob();
- void ReleasePrinterQuery();
-private:
- // Helper method for UpdatePrintingEnabled().
- void SendPrintingEnabled(bool enabled, content::RenderFrameHost* rfh);
- // content::WebContentsObserver implementation.
- void DidStartLoading() override;
+ // Runs an inner message loop. It will set inside_inner_message_loop_ to true
+ // while the blocking inner message loop is running. This is useful in cases
+ // where the RenderView is about to be destroyed while a printing job isn't
+ // finished.
+ bool RunInnerMessageLoop();
+
+ // In the case of Scripted Printing, where the renderer is controlling the
+ // control flow, print_job_ is initialized whenever possible. No-op is
+ // print_job_ is initialized.
+ bool OpportunisticallyCreatePrintJob(int cookie);
+
+ // Release the PrinterQuery associated with our |cookie_|.
+ void ReleasePrinterQuery();
private:
content::NotificationRegistrar m_registrar;
scoped_refptr<printing::PrintJob> m_printJob;
- bool m_isInsideInnerMessageLoop;
+ content::RenderFrameHost *m_printingRFH;
bool m_didPrintingSucceed;
+ // Set while running an inner message loop inside RenderAllMissingPagesNow().
+ // This means we are _blocking_ until all the necessary pages have been
+ // rendered or the print settings are being loaded.
+ base::OnceClosure m_quitInnerLoop;
scoped_refptr<printing::PrintQueriesQueue> m_printerQueriesQueue;
- // The current RFH that is printing with a system printing dialog.
- content::RenderFrameHost *m_printingRFH;
- DISALLOW_COPY_AND_ASSIGN(PrintViewManagerBaseQt);
+
+ base::WeakPtrFactory<PrintViewManagerBaseQt> weak_ptr_factory_{this};
};
} // namespace QtWebEngineCore
diff --git a/src/core/printing/print_view_manager_qt.cpp b/src/core/printing/print_view_manager_qt.cpp
index 79e92fd6a..1d21c2fb9 100644
--- a/src/core/printing/print_view_manager_qt.cpp
+++ b/src/core/printing/print_view_manager_qt.cpp
@@ -1,69 +1,36 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+// Loosely based on print_view_manager.cc and print_preview_message_handler.cc
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE.Chromium file.
#include "print_view_manager_qt.h"
+#include "pdf_util_qt.h"
#include "type_conversion.h"
#include "web_contents_adapter_client.h"
#include "web_contents_view_qt.h"
#include "web_engine_context.h"
#include <QtGui/qpagelayout.h>
+#include <QtGui/qpageranges.h>
#include <QtGui/qpagesize.h>
#include "base/values.h"
#include "base/memory/ref_counted_memory.h"
-#include "base/task/post_task.h"
+#include "base/task/thread_pool.h"
#include "chrome/browser/printing/print_job_manager.h"
#include "chrome/browser/printing/printer_query.h"
-#include "components/printing/common/print_messages.h"
+#include "components/printing/common/print.mojom.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_frame_host.h"
-#include "content/public/common/web_preferences.h"
#include "printing/metafile_skia.h"
+#include "printing/mojom/print.mojom-shared.h"
#include "printing/print_job_constants.h"
#include "printing/units.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
@@ -97,57 +64,57 @@ GetBytesFromHandle(const base::ReadOnlySharedMemoryRegion &handle)
// Write the PDF file to disk.
static void SavePdfFile(scoped_refptr<base::RefCountedBytes> data,
const base::FilePath &path,
- const QtWebEngineCore::PrintViewManagerQt::PrintToPDFFileCallback &saveCallback)
+ QtWebEngineCore::PrintViewManagerQt::PrintToPDFFileCallback saveCallback)
{
DCHECK_GT(data->size(), 0U);
printing::MetafileSkia metafile;
- metafile.InitFromData(static_cast<const void*>(data->front()), data->size());
+ metafile.InitFromData(base::as_bytes(base::make_span(data->front(), data->size())));
base::File file(path,
base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE);
bool success = file.IsValid() && metafile.SaveTo(&file);
- base::PostTask(FROM_HERE, {content::BrowserThread::UI},
- base::BindOnce(saveCallback, success));
+ content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
+ base::BindOnce(std::move(saveCallback), success));
}
-static base::DictionaryValue *createPrintSettings()
+static base::Value::Dict createPrintSettings()
{
- base::DictionaryValue *printSettings = new base::DictionaryValue();
+ base::Value::Dict printSettings;
// TO DO: Check if we can use the request ID from Qt here somehow.
static int internalRequestId = 0;
- printSettings->SetBoolean(printing::kIsFirstRequest, internalRequestId++ == 0);
- printSettings->SetInteger(printing::kPreviewRequestID, internalRequestId);
+ printSettings.Set(printing::kIsFirstRequest, internalRequestId++ == 0);
+ printSettings.Set(printing::kPreviewRequestID, internalRequestId);
// The following are standard settings that Chromium expects to be set.
- printSettings->SetInteger(printing::kSettingPrinterType, printing::kPdfPrinter);
+ printSettings.Set(printing::kSettingPrinterType, static_cast<int>(printing::mojom::PrinterType::kPdf));
- printSettings->SetInteger(printing::kSettingDpiHorizontal, printing::kPointsPerInch);
- printSettings->SetInteger(printing::kSettingDpiVertical, printing::kPointsPerInch);
+ printSettings.Set(printing::kSettingDpiHorizontal, printing::kPointsPerInch);
+ printSettings.Set(printing::kSettingDpiVertical, printing::kPointsPerInch);
- printSettings->SetInteger(printing::kSettingDuplexMode, printing::SIMPLEX);
- printSettings->SetInteger(printing::kSettingCopies, 1);
- printSettings->SetInteger(printing::kSettingPagesPerSheet, 1);
- printSettings->SetBoolean(printing::kSettingCollate, false);
+ printSettings.Set(printing::kSettingDuplexMode, static_cast<int>(printing::mojom::DuplexMode::kSimplex));
+ printSettings.Set(printing::kSettingCopies, 1);
+ printSettings.Set(printing::kSettingPagesPerSheet, 1);
+ printSettings.Set(printing::kSettingCollate, false);
// printSettings->SetBoolean(printing::kSettingGenerateDraftData, false);
- printSettings->SetBoolean(printing::kSettingPreviewModifiable, false);
+ printSettings.Set(printing::kSettingPreviewModifiable, false);
- printSettings->SetKey(printing::kSettingShouldPrintSelectionOnly, base::Value(false));
- printSettings->SetKey(printing::kSettingShouldPrintBackgrounds, base::Value(true));
- printSettings->SetKey(printing::kSettingHeaderFooterEnabled, base::Value(false));
- printSettings->SetKey(printing::kSettingRasterizePdf, base::Value(false));
- printSettings->SetInteger(printing::kSettingScaleFactor, 100);
- printSettings->SetString(printing::kSettingDeviceName, "");
- printSettings->SetInteger(printing::kPreviewUIID, 12345678);
+ printSettings.Set(printing::kSettingShouldPrintSelectionOnly, base::Value(false));
+ printSettings.Set(printing::kSettingShouldPrintBackgrounds, base::Value(true));
+ printSettings.Set(printing::kSettingHeaderFooterEnabled, base::Value(false));
+ printSettings.Set(printing::kSettingRasterizePdf, base::Value(false));
+ printSettings.Set(printing::kSettingScaleFactor, 100);
+ printSettings.Set(printing::kSettingDeviceName, "");
+ printSettings.Set(printing::kPreviewUIID, 12345678);
return printSettings;
}
-static base::DictionaryValue *createPrintSettingsFromQPageLayout(const QPageLayout &pageLayout,
+static base::Value::Dict createPrintSettingsFromQPageLayout(const QPageLayout &pageLayout,
bool useCustomMargins)
{
- base::DictionaryValue *printSettings = createPrintSettings();
+ base::Value::Dict printSettings = createPrintSettings();
QRectF pageSizeInMillimeter;
if (useCustomMargins) {
@@ -155,185 +122,154 @@ static base::DictionaryValue *createPrintSettingsFromQPageLayout(const QPageLayo
pageSizeInMillimeter = pageLayout.pageSize().rect(QPageSize::Millimeter);
QMargins pageMarginsInPoints = pageLayout.marginsPoints();
- std::unique_ptr<base::DictionaryValue> marginsDict(new base::DictionaryValue);
- marginsDict->SetInteger(printing::kSettingMarginTop, pageMarginsInPoints.top());
- marginsDict->SetInteger(printing::kSettingMarginBottom, pageMarginsInPoints.bottom());
- marginsDict->SetInteger(printing::kSettingMarginLeft, pageMarginsInPoints.left());
- marginsDict->SetInteger(printing::kSettingMarginRight, pageMarginsInPoints.right());
+ base::Value::Dict marginsDict;
+ marginsDict.Set(printing::kSettingMarginTop, pageMarginsInPoints.top());
+ marginsDict.Set(printing::kSettingMarginBottom, pageMarginsInPoints.bottom());
+ marginsDict.Set(printing::kSettingMarginLeft, pageMarginsInPoints.left());
+ marginsDict.Set(printing::kSettingMarginRight, pageMarginsInPoints.right());
- printSettings->Set(printing::kSettingMarginsCustom, std::move(marginsDict));
- printSettings->SetInteger(printing::kSettingMarginsType, printing::CUSTOM_MARGINS);
+ printSettings.Set(printing::kSettingMarginsCustom, std::move(marginsDict));
+ printSettings.Set(printing::kSettingMarginsType, (int)printing::mojom::MarginType::kCustomMargins);
// pageSizeInMillimeter is in portrait orientation. Transpose it if necessary.
- printSettings->SetBoolean(printing::kSettingLandscape, pageLayout.orientation() == QPageLayout::Landscape);
+ printSettings.Set(printing::kSettingLandscape, pageLayout.orientation() == QPageLayout::Landscape);
} else {
// QPrinter will handle margins
pageSizeInMillimeter = pageLayout.paintRect(QPageLayout::Millimeter);
- printSettings->SetInteger(printing::kSettingMarginsType, printing::NO_MARGINS);
+ printSettings.Set(printing::kSettingMarginsType, (int)printing::mojom::MarginType::kNoMargins);
// pageSizeInMillimeter already contains the orientation.
- printSettings->SetBoolean(printing::kSettingLandscape, false);
+ printSettings.Set(printing::kSettingLandscape, false);
}
//Set page size attributes, chromium expects these in micrometers
- std::unique_ptr<base::DictionaryValue> sizeDict(new base::DictionaryValue);
- sizeDict->SetInteger(printing::kSettingMediaSizeWidthMicrons, pageSizeInMillimeter.width() * kMicronsToMillimeter);
- sizeDict->SetInteger(printing::kSettingMediaSizeHeightMicrons, pageSizeInMillimeter.height() * kMicronsToMillimeter);
- printSettings->Set(printing::kSettingMediaSize, std::move(sizeDict));
+ base::Value::Dict sizeDict;
+ sizeDict.Set(printing::kSettingMediaSizeWidthMicrons, int(pageSizeInMillimeter.width() * kMicronsToMillimeter));
+ sizeDict.Set(printing::kSettingMediaSizeHeightMicrons, int(pageSizeInMillimeter.height() * kMicronsToMillimeter));
+ printSettings.Set(printing::kSettingMediaSize, std::move(sizeDict));
return printSettings;
}
+static base::Value::List createPageRangeSettings(const QList<QPageRanges::Range> &ranges)
+{
+ base::Value::List pageRangeArray;
+ for (int i = 0; i < ranges.count(); i++) {
+ base::Value::Dict pageRange;
+ pageRange.Set(printing::kSettingPageRangeFrom, ranges.at(i).from);
+ pageRange.Set(printing::kSettingPageRangeTo, ranges.at(i).to);
+ pageRangeArray.Append(std::move(pageRange));
+ }
+ return pageRangeArray;
+}
+
} // namespace
namespace QtWebEngineCore {
-struct PrintViewManagerQt::FrameDispatchHelper {
- PrintViewManagerQt* m_manager;
- content::RenderFrameHost* m_renderFrameHost;
-
- bool Send(IPC::Message* msg) {
- return m_renderFrameHost->Send(msg);
- }
-
- void OnSetupScriptedPrintPreview(IPC::Message* reply_msg) {
- m_manager->OnSetupScriptedPrintPreview(m_renderFrameHost, reply_msg);
- }
-};
-
PrintViewManagerQt::~PrintViewManagerQt()
{
}
void PrintViewManagerQt::PrintToPDFFileWithCallback(const QPageLayout &pageLayout,
+ const QPageRanges &pageRanges,
bool printInColor,
const QString &filePath,
- const PrintToPDFFileCallback& callback)
+ PrintToPDFFileCallback callback)
{
if (callback.is_null())
return;
- if (m_printSettings || !filePath.length()) {
- base::PostTask(FROM_HERE, {content::BrowserThread::UI},
- base::BindOnce(callback, false));
+ if (!m_printSettings.empty() || !filePath.length()) {
+ content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
+ base::BindOnce(std::move(callback), false));
return;
}
m_pdfOutputPath = toFilePath(filePath);
- m_pdfSaveCallback = callback;
- if (!PrintToPDFInternal(pageLayout, printInColor)) {
- base::PostTask(FROM_HERE, {content::BrowserThread::UI},
- base::BindOnce(callback, false));
+ m_pdfSaveCallback = std::move(callback);
+ if (!PrintToPDFInternal(pageLayout, pageRanges, printInColor)) {
+ content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
+ base::BindOnce(std::move(m_pdfSaveCallback), false));
resetPdfState();
}
}
void PrintViewManagerQt::PrintToPDFWithCallback(const QPageLayout &pageLayout,
+ const QPageRanges &pageRanges,
bool printInColor,
bool useCustomMargins,
- const PrintToPDFCallback& callback)
+ PrintToPDFCallback callback)
{
if (callback.is_null())
return;
// If there already is a pending print in progress, don't try starting another one.
- if (m_printSettings) {
- base::PostTask(FROM_HERE, {content::BrowserThread::UI},
- base::BindOnce(callback, QSharedPointer<QByteArray>()));
+ if (!m_printSettings.empty()) {
+ content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
+ base::BindOnce(std::move(callback), QSharedPointer<QByteArray>()));
return;
}
- m_pdfPrintCallback = callback;
- if (!PrintToPDFInternal(pageLayout, printInColor, useCustomMargins)) {
- base::PostTask(FROM_HERE, {content::BrowserThread::UI},
- base::BindOnce(callback, QSharedPointer<QByteArray>()));
+ m_pdfPrintCallback = std::move(callback);
+ if (!PrintToPDFInternal(pageLayout, pageRanges, printInColor, useCustomMargins)) {
+ content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
+ base::BindOnce(std::move(m_pdfPrintCallback), QSharedPointer<QByteArray>()));
resetPdfState();
}
}
bool PrintViewManagerQt::PrintToPDFInternal(const QPageLayout &pageLayout,
+ const QPageRanges &pageRanges,
const bool printInColor,
const bool useCustomMargins)
{
if (!pageLayout.isValid())
return false;
- m_printSettings.reset(createPrintSettingsFromQPageLayout(pageLayout, useCustomMargins));
- m_printSettings->SetBoolean(printing::kSettingShouldPrintBackgrounds,
- web_contents()->GetRenderViewHost()->
- GetWebkitPreferences().should_print_backgrounds);
- m_printSettings->SetInteger(printing::kSettingColor,
- printInColor ? printing::COLOR : printing::GRAYSCALE);
+ m_printSettings = createPrintSettingsFromQPageLayout(pageLayout, useCustomMargins);
+ m_printSettings.Set(printing::kSettingShouldPrintBackgrounds,
+ web_contents()->GetOrCreateWebPreferences().should_print_backgrounds);
+ m_printSettings.Set(printing::kSettingColor,
+ int(printInColor ? printing::mojom::ColorModel::kColor : printing::mojom::ColorModel::kGrayscale));
+ if (!pageRanges.isEmpty())
+ m_printSettings.Set(printing::kSettingPageRange, createPageRangeSettings(pageRanges.toRangeList()));
- if (web_contents()->ShowingInterstitialPage() || web_contents()->IsCrashed())
+ if (web_contents()->IsCrashed())
return false;
- content::RenderFrameHost* rfh = web_contents()->GetMainFrame();
- GetPrintRenderFrame(rfh)->InitiatePrintPreview(mojo::PendingAssociatedRemote<printing::mojom::PrintRenderer>(), false);
+ content::RenderFrameHost *rfh = web_contents()->GetPrimaryMainFrame();
+ // Use the plugin frame for printing if web_contents() is a PDF viewer guest
+ content::RenderFrameHost *full_page_plugin = GetFullPagePlugin(web_contents());
+ if (content::RenderFrameHost *pdf_rfh = FindPdfChildFrame(full_page_plugin ? full_page_plugin : rfh))
+ rfh = pdf_rfh;
+ GetPrintRenderFrame(rfh)->InitiatePrintPreview(false);
DCHECK(!m_printPreviewRfh);
m_printPreviewRfh = rfh;
return true;
}
-// PrintedPagesSource implementation.
-base::string16 PrintViewManagerQt::RenderSourceName()
-{
- return base::string16();
-}
-
PrintViewManagerQt::PrintViewManagerQt(content::WebContents *contents)
: PrintViewManagerBaseQt(contents)
+ , content::WebContentsUserData<PrintViewManagerQt>(*contents)
, m_printPreviewRfh(nullptr)
{
}
-// content::WebContentsObserver implementation.
-bool PrintViewManagerQt::OnMessageReceived(const IPC::Message& message,
- content::RenderFrameHost* render_frame_host)
-{
- FrameDispatchHelper helper = {this, render_frame_host};
- bool handled = true;
- IPC_BEGIN_MESSAGE_MAP_WITH_PARAM(PrintViewManagerQt, message, render_frame_host);
- IPC_MESSAGE_HANDLER(PrintHostMsg_DidShowPrintDialog, OnDidShowPrintDialog)
- IPC_MESSAGE_HANDLER(PrintHostMsg_RequestPrintPreview, OnRequestPrintPreview)
- IPC_MESSAGE_HANDLER(PrintHostMsg_MetafileReadyForPrinting, OnMetafileReadyForPrinting);
- IPC_MESSAGE_HANDLER(PrintHostMsg_DidPreviewPage, OnDidPreviewPage)
- IPC_MESSAGE_FORWARD_DELAY_REPLY(
- PrintHostMsg_SetupScriptedPrintPreview, &helper,
- FrameDispatchHelper::OnSetupScriptedPrintPreview)
- IPC_MESSAGE_HANDLER(PrintHostMsg_ShowScriptedPrintPreview,
- OnShowScriptedPrintPreview)
- IPC_MESSAGE_UNHANDLED(handled = false)
- IPC_END_MESSAGE_MAP()
- return handled || PrintViewManagerBaseQt::OnMessageReceived(message, render_frame_host);
-}
-
-void PrintViewManagerQt::RenderFrameDeleted(content::RenderFrameHost *render_frame_host)
+// static
+void PrintViewManagerQt::BindPrintManagerHost(mojo::PendingAssociatedReceiver<printing::mojom::PrintManagerHost> receiver,
+ content::RenderFrameHost *rfh)
{
- if (render_frame_host == m_printPreviewRfh)
- PrintPreviewDone();
- PrintViewManagerBaseQt::RenderFrameDeleted(render_frame_host);
- m_printRenderFrames.erase(render_frame_host);
-}
-
-const mojo::AssociatedRemote<printing::mojom::PrintRenderFrame> &PrintViewManagerQt::GetPrintRenderFrame(content::RenderFrameHost *rfh)
-{
- auto it = m_printRenderFrames.find(rfh);
- if (it == m_printRenderFrames.end()) {
- mojo::AssociatedRemote<printing::mojom::PrintRenderFrame> remote;
- rfh->GetRemoteAssociatedInterfaces()->GetInterface(&remote);
- it = m_printRenderFrames.insert(std::make_pair(rfh, std::move(remote))).first;
- } else if (it->second.is_bound() && !it->second.is_connected()) {
- // When print preview is closed, the remote is disconnected from the
- // receiver. Reset and bind the remote before using it again.
- it->second.reset();
- rfh->GetRemoteAssociatedInterfaces()->GetInterface(&it->second);
- }
-
- return it->second;
+ auto *web_contents = content::WebContents::FromRenderFrameHost(rfh);
+ if (!web_contents)
+ return;
+ auto *print_manager = PrintViewManagerQt::FromWebContents(web_contents);
+ if (!print_manager)
+ return;
+ print_manager->BindReceiver(std::move(receiver), rfh);
}
void PrintViewManagerQt::resetPdfState()
@@ -341,50 +277,14 @@ void PrintViewManagerQt::resetPdfState()
m_pdfOutputPath.clear();
m_pdfPrintCallback.Reset();
m_pdfSaveCallback.Reset();
- m_printSettings.reset();
-}
-
-// IPC handlers
-
-void PrintViewManagerQt::OnRequestPrintPreview(
- const PrintHostMsg_RequestPrintPreview_Params &/*params*/)
-{
- m_printPreviewRfh->Send(new PrintMsg_PrintPreview(m_printPreviewRfh->GetRoutingID(),
- *m_printSettings));
- PrintPreviewDone();
-}
-
-void PrintViewManagerQt::OnMetafileReadyForPrinting(content::RenderFrameHost* rfh,
- const PrintHostMsg_DidPreviewDocument_Params& params,
- const PrintHostMsg_PreviewIds &ids)
-{
- StopWorker(params.document_cookie);
-
- // Create local copies so we can reset the state and take a new pdf print job.
- PrintToPDFCallback pdf_print_callback = std::move(m_pdfPrintCallback);
- PrintToPDFFileCallback pdf_save_callback = std::move(m_pdfSaveCallback);
- base::FilePath pdfOutputPath = m_pdfOutputPath;
-
- resetPdfState();
-
- if (!pdf_print_callback.is_null()) {
- QSharedPointer<QByteArray> data_array = GetStdVectorFromHandle(params.content.metafile_data_region);
- base::PostTask(FROM_HERE, {content::BrowserThread::UI},
- base::BindOnce(pdf_print_callback, data_array));
- } else {
- scoped_refptr<base::RefCountedBytes> data_bytes = GetBytesFromHandle(params.content.metafile_data_region);
- base::PostTask(FROM_HERE, {base::ThreadPool(), base::MayBlock()},
- base::BindOnce(&SavePdfFile, data_bytes, pdfOutputPath, pdf_save_callback));
- }
+ m_printSettings.clear();
}
-void PrintViewManagerQt::OnDidShowPrintDialog()
-{
-}
-
-// content::WebContentsObserver implementation.
-void PrintViewManagerQt::DidStartLoading()
+void PrintViewManagerQt::PrintPreviewDone()
{
+ if (m_printPreviewRfh->IsRenderFrameLive() && IsPrintRenderFrameConnected(m_printPreviewRfh))
+ GetPrintRenderFrame(m_printPreviewRfh)->OnPrintPreviewDialogClosed();
+ m_printPreviewRfh = nullptr;
}
// content::WebContentsObserver implementation.
@@ -392,59 +292,116 @@ void PrintViewManagerQt::DidStartLoading()
void PrintViewManagerQt::NavigationStopped()
{
if (!m_pdfPrintCallback.is_null()) {
- base::PostTask(FROM_HERE, {content::BrowserThread::UI},
- base::BindOnce(m_pdfPrintCallback, QSharedPointer<QByteArray>()));
+ content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
+ base::BindOnce(std::move(m_pdfPrintCallback), QSharedPointer<QByteArray>()));
}
resetPdfState();
PrintViewManagerBaseQt::NavigationStopped();
}
-void PrintViewManagerQt::RenderProcessGone(base::TerminationStatus status)
+void PrintViewManagerQt::PrimaryMainFrameRenderProcessGone(base::TerminationStatus status)
{
- PrintViewManagerBaseQt::RenderProcessGone(status);
+ PrintViewManagerBaseQt::PrimaryMainFrameRenderProcessGone(status);
if (!m_pdfPrintCallback.is_null()) {
- base::PostTask(FROM_HERE, {content::BrowserThread::UI},
- base::BindOnce(m_pdfPrintCallback, QSharedPointer<QByteArray>()));
+ content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
+ base::BindOnce(std::move(m_pdfPrintCallback), QSharedPointer<QByteArray>()));
}
resetPdfState();
}
-void PrintViewManagerQt::OnDidPreviewPage(content::RenderFrameHost* rfh,
- const PrintHostMsg_DidPreviewPage_Params& params,
- const PrintHostMsg_PreviewIds& ids)
+void PrintViewManagerQt::RenderFrameDeleted(content::RenderFrameHost *render_frame_host)
{
- // just consume the message, this is just for sending 'page-preview-ready' for webui
+ if (render_frame_host == m_printPreviewRfh)
+ PrintPreviewDone();
+ PrintViewManagerBaseQt::RenderFrameDeleted(render_frame_host);
}
-void PrintViewManagerQt::OnSetupScriptedPrintPreview(content::RenderFrameHost* rfh,
- IPC::Message* reply_msg)
+// mojom::PrintManagerHost:
+void PrintViewManagerQt::SetupScriptedPrintPreview(SetupScriptedPrintPreviewCallback callback)
{
// ignore the scripted print
- rfh->Send(reply_msg);
+ std::move(callback).Run();
content::WebContentsView *view = static_cast<content::WebContentsImpl*>(web_contents())->GetView();
WebContentsAdapterClient *client = WebContentsViewQt::from(view)->client();
-
+ content::RenderFrameHost *rfh =
+ print_manager_host_receivers_.GetCurrentTargetFrame();
if (!client)
return;
// close preview
- GetPrintRenderFrame(rfh)->OnPrintPreviewDialogClosed();
+ if (rfh)
+ GetPrintRenderFrame(rfh)->OnPrintPreviewDialogClosed();
client->printRequested();
}
-void PrintViewManagerQt::OnShowScriptedPrintPreview(content::RenderFrameHost* rfh,
- bool source_is_modifiable)
+void PrintViewManagerQt::ShowScriptedPrintPreview(bool /*source_is_modifiable*/)
{
// ignore for now
}
-void PrintViewManagerQt::PrintPreviewDone() {
- GetPrintRenderFrame(m_printPreviewRfh)->OnPrintPreviewDialogClosed();
- m_printPreviewRfh = nullptr;
+void PrintViewManagerQt::RequestPrintPreview(printing::mojom::RequestPrintPreviewParamsPtr params)
+{
+ if (!m_printPreviewRfh && params->webnode_only) {
+ // The preview was requested by the print button of PDF viewer plugin. The code path ends up here, because
+ // Chromium automatically initiated a preview generation. We don't want that, just notify our embedder
+ // like we do in SetupScriptedPrintPreview() after window.print() and let them decide what to do.
+ content::WebContentsView *view = static_cast<content::WebContentsImpl*>(web_contents()->GetOutermostWebContents())->GetView();
+ if (WebContentsAdapterClient *client = WebContentsViewQt::from(view)->client())
+ client->printRequested();
+ return;
+ }
+
+ if (m_printSettings.empty()) {
+ PrintPreviewDone();
+ return;
+ }
+
+ mojo::AssociatedRemote<printing::mojom::PrintRenderFrame> printRenderFrame;
+ m_printPreviewRfh->GetRemoteAssociatedInterfaces()->GetInterface(&printRenderFrame);
+ printRenderFrame->PrintPreview(m_printSettings.Clone());
+ PrintPreviewDone();
+}
+
+void PrintViewManagerQt::CheckForCancel(int32_t preview_ui_id,
+ int32_t request_id,
+ CheckForCancelCallback callback)
+{
+ Q_UNUSED(preview_ui_id);
+ Q_UNUSED(request_id);
+ std::move(callback).Run(false);
+}
+
+void PrintViewManagerQt::SetAccessibilityTree(int32_t, const ui::AXTreeUpdate &)
+{
+ // FIXME!
+}
+
+void PrintViewManagerQt::MetafileReadyForPrinting(printing::mojom::DidPreviewDocumentParamsPtr params,
+ int32_t preview_ui_id)
+{
+ Q_UNUSED(preview_ui_id);
+ StopWorker(params->document_cookie);
+
+ // Create local copies so we can reset the state and take a new pdf print job.
+ PrintToPDFCallback pdf_print_callback = std::move(m_pdfPrintCallback);
+ PrintToPDFFileCallback pdf_save_callback = std::move(m_pdfSaveCallback);
+ base::FilePath pdfOutputPath = m_pdfOutputPath;
+
+ resetPdfState();
+
+ if (!pdf_print_callback.is_null()) {
+ QSharedPointer<QByteArray> data_array = GetStdVectorFromHandle(params->content->metafile_data_region);
+ content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
+ base::BindOnce(std::move(pdf_print_callback), data_array));
+ } else {
+ scoped_refptr<base::RefCountedBytes> data_bytes = GetBytesFromHandle(params->content->metafile_data_region);
+ base::ThreadPool::PostTask(FROM_HERE, { base::MayBlock() },
+ base::BindOnce(&SavePdfFile, data_bytes, pdfOutputPath, std::move(pdf_save_callback)));
+ }
}
-WEB_CONTENTS_USER_DATA_KEY_IMPL(PrintViewManagerQt)
+WEB_CONTENTS_USER_DATA_KEY_IMPL(PrintViewManagerQt);
} // namespace QtWebEngineCore
diff --git a/src/core/printing/print_view_manager_qt.h b/src/core/printing/print_view_manager_qt.h
index 06c2f47ea..956849ef9 100644
--- a/src/core/printing/print_view_manager_qt.h
+++ b/src/core/printing/print_view_manager_qt.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
@@ -49,35 +13,16 @@
#include "qtwebenginecoreglobal_p.h"
#include "base/memory/ref_counted.h"
-#include "base/strings/string16.h"
#include "components/prefs/pref_member.h"
-#include "components/printing/browser/print_manager.h"
#include "components/printing/common/print.mojom.h"
-#include "components/printing/common/print_messages.h"
-#include "content/public/browser/notification_observer.h"
-#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/web_contents_user_data.h"
#include "mojo/public/cpp/bindings/associated_remote.h"
#include <QSharedPointer>
-struct PrintHostMsg_RequestPrintPreview_Params;
-struct PrintHostMsg_DidPreviewDocument_Params;
-
-namespace content {
-class RenderViewHost;
-}
-
-namespace printing {
-class JobEventDetails;
-class MetafilePlayer;
-class PrintJob;
-class PrintJobWorkerOwner;
-class PrintQueriesQueue;
-}
-
QT_BEGIN_NAMESPACE
class QPageLayout;
+class QPageRanges;
class QString;
QT_END_NAMESPACE
@@ -88,60 +33,52 @@ class PrintViewManagerQt
{
public:
~PrintViewManagerQt() override;
- typedef base::Callback<void(QSharedPointer<QByteArray> result)> PrintToPDFCallback;
- typedef base::Callback<void(bool success)> PrintToPDFFileCallback;
+
+ static void BindPrintManagerHost(mojo::PendingAssociatedReceiver<printing::mojom::PrintManagerHost> receiver,
+ content::RenderFrameHost *rfh);
+
+ typedef base::OnceCallback<void(QSharedPointer<QByteArray> result)> PrintToPDFCallback;
+ typedef base::OnceCallback<void(bool success)> PrintToPDFFileCallback;
// Method to print a page to a Pdf document with page size \a pageSize in location \a filePath.
void PrintToPDFFileWithCallback(const QPageLayout &pageLayout,
+ const QPageRanges &pageRanges,
bool printInColor,
const QString &filePath,
- const PrintToPDFFileCallback& callback);
+ PrintToPDFFileCallback callback);
void PrintToPDFWithCallback(const QPageLayout &pageLayout,
+ const QPageRanges &pageRanges,
bool printInColor,
bool useCustomMargins,
- const PrintToPDFCallback &callback);
-
- base::string16 RenderSourceName() override;
+ PrintToPDFCallback callback);
protected:
explicit PrintViewManagerQt(content::WebContents*);
+ bool PrintToPDFInternal(const QPageLayout &, const QPageRanges &, bool printInColor, bool useCustomMargins = true);
+
// content::WebContentsObserver implementation.
// Cancels the print job.
void NavigationStopped() override;
// Terminates or cancels the print job if one was pending.
- void RenderProcessGone(base::TerminationStatus status) override;
+ void PrimaryMainFrameRenderProcessGone(base::TerminationStatus status) override;
- // content::WebContentsObserver implementation.
- bool OnMessageReceived(const IPC::Message& message,
- content::RenderFrameHost* render_frame_host) override;
void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override;
- // IPC handlers
- void OnDidShowPrintDialog();
- void OnRequestPrintPreview(const PrintHostMsg_RequestPrintPreview_Params&);
- void OnMetafileReadyForPrinting(content::RenderFrameHost* rfh,
- const PrintHostMsg_DidPreviewDocument_Params& params,
- const PrintHostMsg_PreviewIds &ids);
- void OnSetupScriptedPrintPreview(content::RenderFrameHost* rfh,
- IPC::Message* reply_msg);
- void OnDidPreviewPage(content::RenderFrameHost* rfh,
- const PrintHostMsg_DidPreviewPage_Params& params,
- const PrintHostMsg_PreviewIds& ids);
- void OnShowScriptedPrintPreview(content::RenderFrameHost* rfh,
- bool source_is_modifiable);
- bool PrintToPDFInternal(const QPageLayout &, bool printInColor, bool useCustomMargins = true);
-
+ // mojom::PrintManagerHost:
+ void SetupScriptedPrintPreview(SetupScriptedPrintPreviewCallback callback) override;
+ void ShowScriptedPrintPreview(bool source_is_modifiable) override;
+ void RequestPrintPreview(printing::mojom::RequestPrintPreviewParamsPtr params) override;
+ void CheckForCancel(int32_t preview_ui_id,
+ int32_t request_id,
+ CheckForCancelCallback callback) override;
+ void MetafileReadyForPrinting(printing::mojom::DidPreviewDocumentParamsPtr params,
+ int32_t preview_ui_id) override;
+ void SetAccessibilityTree(int32_t, const ui::AXTreeUpdate &) override;
private:
void resetPdfState();
- // Helper method to fetch the PrintRenderFrame associated remote interface
- // pointer.
- const mojo::AssociatedRemote<printing::mojom::PrintRenderFrame> &GetPrintRenderFrame(content::RenderFrameHost *rfh);
-
- // content::WebContentsObserver implementation.
- void DidStartLoading() override;
void PrintPreviewDone();
private:
@@ -150,13 +87,9 @@ private:
base::FilePath m_pdfOutputPath;
PrintToPDFCallback m_pdfPrintCallback;
PrintToPDFFileCallback m_pdfSaveCallback;
- std::unique_ptr<base::DictionaryValue> m_printSettings;
-
- std::map<content::RenderFrameHost*,mojo::AssociatedRemote<printing::mojom::PrintRenderFrame>> m_printRenderFrames;
+ base::Value::Dict m_printSettings;
friend class content::WebContentsUserData<PrintViewManagerQt>;
- DISALLOW_COPY_AND_ASSIGN(PrintViewManagerQt);
- struct FrameDispatchHelper;
};
} // namespace QtWebEngineCore
diff --git a/src/core/printing/printer_worker.cpp b/src/core/printing/printer_worker.cpp
new file mode 100644
index 000000000..6032f2211
--- /dev/null
+++ b/src/core/printing/printer_worker.cpp
@@ -0,0 +1,87 @@
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "printer_worker.h"
+
+#include "printing/pdfium_document_wrapper_qt.h"
+
+#include <QPainter>
+#include <QPagedPaintDevice>
+
+namespace QtWebEngineCore {
+
+PrinterWorker::PrinterWorker(QSharedPointer<QByteArray> data, QPagedPaintDevice *device)
+ : m_data(data), m_device(device)
+{
+}
+
+PrinterWorker::~PrinterWorker() { }
+
+void PrinterWorker::print()
+{
+ if (!m_data->size()) {
+ qWarning("Failed to print: Print result data is empty.");
+ Q_EMIT resultReady(false);
+ return;
+ }
+
+ PdfiumDocumentWrapperQt pdfiumWrapper(m_data->constData(), m_data->size());
+
+ const int fromPage = m_firstPageFirst ? 0 : pdfiumWrapper.pageCount() - 1;
+ const int toPage = m_firstPageFirst ? pdfiumWrapper.pageCount() : -1;
+
+ int pageCopies = 1;
+ if (m_collateCopies) {
+ pageCopies = m_documentCopies;
+ m_documentCopies = 1;
+ }
+
+ qreal resolution = m_deviceResolution / 72.0; // pdfium uses points so 1/72 inch
+
+ QPainter painter;
+
+ for (int printedDocuments = 0; printedDocuments < m_documentCopies; printedDocuments++) {
+ if (printedDocuments > 0)
+ m_device->newPage();
+
+ for (int i = fromPage; i != toPage; m_firstPageFirst ? i++ : i--) {
+ QSizeF documentSize = (pdfiumWrapper.pageSize(i) * resolution);
+ bool isLandscape = documentSize.width() > documentSize.height();
+ m_device->setPageOrientation(isLandscape ? QPageLayout::Landscape
+ : QPageLayout::Portrait);
+ QRectF paintRect = m_device->pageLayout().paintRectPixels(m_deviceResolution);
+ documentSize = documentSize.scaled(paintRect.size(), Qt::KeepAspectRatio);
+
+ // setPageOrientation has to be called before qpainter.begin() or before
+ // qprinter.newPage() so correct metrics is used, therefore call begin now for only
+ // first page
+ if (!painter.isActive() && !painter.begin(m_device)) {
+ qWarning("Failure to print on device: Could not open printer for painting.");
+ Q_EMIT resultReady(false);
+ return;
+ }
+
+ if (i != fromPage)
+ m_device->newPage();
+
+ for (int printedPages = 0; printedPages < pageCopies; printedPages++) {
+ if (printedPages > 0)
+ m_device->newPage();
+
+ QImage currentImage =
+ pdfiumWrapper.pageAsQImage(i, documentSize.width(), documentSize.height());
+ if (currentImage.isNull()) {
+ Q_EMIT resultReady(false);
+ return;
+ }
+ painter.drawImage(0, 0, currentImage);
+ }
+ }
+ }
+ painter.end();
+
+ Q_EMIT resultReady(true);
+ return;
+}
+
+} // namespace QtWebEngineCore
diff --git a/src/core/printing/printer_worker.h b/src/core/printing/printer_worker.h
new file mode 100644
index 000000000..0d2454fa0
--- /dev/null
+++ b/src/core/printing/printer_worker.h
@@ -0,0 +1,58 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#ifndef PRINTER_WORKER_H
+#define PRINTER_WORKER_H
+
+#include <QtWebEngineCore/private/qtwebenginecoreglobal_p.h>
+
+#include <QtCore/qobject.h>
+#include <QtCore/qsharedpointer.h>
+
+QT_BEGIN_NAMESPACE
+class QPagedPaintDevice;
+QT_END_NAMESPACE
+
+namespace QtWebEngineCore {
+
+class Q_WEBENGINECORE_EXPORT PrinterWorker : public QObject
+{
+ Q_OBJECT
+public:
+ PrinterWorker(QSharedPointer<QByteArray> data, QPagedPaintDevice *device);
+ virtual ~PrinterWorker();
+
+ int m_deviceResolution;
+ bool m_firstPageFirst;
+ int m_documentCopies;
+ bool m_collateCopies;
+
+public Q_SLOTS:
+ void print();
+
+Q_SIGNALS:
+ void resultReady(bool success);
+
+private:
+ Q_DISABLE_COPY(PrinterWorker)
+
+ QSharedPointer<QByteArray> m_data;
+ QPagedPaintDevice *m_device;
+};
+
+} // namespace QtWebEngineCore
+
+Q_DECLARE_METATYPE(QtWebEngineCore::PrinterWorker *)
+
+#endif // PRINTER_WORKER_H
diff --git a/src/core/printing/printing_message_filter_qt.cpp b/src/core/printing/printing_message_filter_qt.cpp
deleted file mode 100644
index 5b9228d20..000000000
--- a/src/core/printing/printing_message_filter_qt.cpp
+++ /dev/null
@@ -1,234 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-// Based on chrome/browser/printing/printing_message_filter.cc:
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE.Chromium file.
-
-#include "printing_message_filter_qt.h"
-
-#include "web_engine_context.h"
-
-#include <string>
-
-#include "base/bind.h"
-#include "chrome/browser/printing/print_job_manager.h"
-#include "chrome/browser/printing/printer_query.h"
-#include "components/printing/browser/print_manager_utils.h"
-#include "components/printing/common/print_messages.h"
-#include "content/public/browser/browser_thread.h"
-#include "content/public/browser/render_view_host.h"
-#include "content/public/browser/web_contents.h"
-#include "content/public/common/child_process_host.h"
-
-using content::BrowserThread;
-
-namespace QtWebEngineCore {
-
-PrintingMessageFilterQt::PrintingMessageFilterQt(int render_process_id)
- : BrowserMessageFilter(PrintMsgStart),
- render_process_id_(render_process_id),
- queue_(WebEngineContext::current()->getPrintJobManager()->queue()) {
- DCHECK(queue_.get());
-}
-
-PrintingMessageFilterQt::~PrintingMessageFilterQt() {
-}
-
-void PrintingMessageFilterQt::OverrideThreadForMessage(
- const IPC::Message& message, BrowserThread::ID* thread) {
-}
-
-bool PrintingMessageFilterQt::OnMessageReceived(const IPC::Message& message) {
- bool handled = true;
- IPC_BEGIN_MESSAGE_MAP(PrintingMessageFilterQt, message)
- IPC_MESSAGE_HANDLER_DELAY_REPLY(PrintHostMsg_GetDefaultPrintSettings,
- OnGetDefaultPrintSettings)
- IPC_MESSAGE_HANDLER_DELAY_REPLY(PrintHostMsg_ScriptedPrint, OnScriptedPrint)
- IPC_MESSAGE_HANDLER_DELAY_REPLY(PrintHostMsg_UpdatePrintSettings,
- OnUpdatePrintSettings)
- IPC_MESSAGE_HANDLER(PrintHostMsg_CheckForCancel, OnCheckForCancel)
- IPC_MESSAGE_UNHANDLED(handled = false)
- IPC_END_MESSAGE_MAP()
- return handled;
-}
-
-void PrintingMessageFilterQt::OnGetDefaultPrintSettings(IPC::Message* reply_msg) {
- DCHECK_CURRENTLY_ON(BrowserThread::IO);
- std::unique_ptr<printing::PrinterQuery> printer_query;
-
- printer_query = queue_->PopPrinterQuery(0);
- if (!printer_query) {
- printer_query =
- queue_->CreatePrinterQuery(render_process_id_, reply_msg->routing_id());
- }
-
- // Loads default settings. This is asynchronous, only the IPC message sender
- // will hang until the settings are retrieved.
- printer_query->GetSettings(
- printing::PrinterQuery::GetSettingsAskParam::DEFAULTS,
- 0,
- false,
- printing::DEFAULT_MARGINS,
- false,
- false,
- base::BindOnce(&PrintingMessageFilterQt::OnGetDefaultPrintSettingsReply,
- this,
- std::move(printer_query),
- reply_msg));
-}
-
-void PrintingMessageFilterQt::OnGetDefaultPrintSettingsReply(
- std::unique_ptr<printing::PrinterQuery> printer_query,
- IPC::Message* reply_msg) {
- PrintMsg_Print_Params params;
- if (!printer_query.get() ||
- printer_query->last_status() != printing::PrintingContext::OK) {
- params.Reset();
- } else {
- RenderParamsFromPrintSettings(printer_query->settings(), &params);
- params.document_cookie = printer_query->cookie();
- }
- PrintHostMsg_GetDefaultPrintSettings::WriteReplyParams(reply_msg, params);
- Send(reply_msg);
- // If printing was enabled.
- if (printer_query.get()) {
- // If user hasn't cancelled.
- if (printer_query->cookie() && printer_query->settings().dpi()) {
- queue_->QueuePrinterQuery(std::move(printer_query));
- } else {
- printer_query->StopWorker();
- }
- }
-}
-
-void PrintingMessageFilterQt::OnScriptedPrint(
- const PrintHostMsg_ScriptedPrint_Params& params,
- IPC::Message* reply_msg) {
- std::unique_ptr<printing::PrinterQuery> printer_query =
- queue_->PopPrinterQuery(params.cookie);
- if (!printer_query.get()) {
- printer_query =
- queue_->CreatePrinterQuery(render_process_id_, reply_msg->routing_id());
- }
- printer_query->GetSettings(
- printing::PrinterQuery::GetSettingsAskParam::ASK_USER,
- params.expected_pages_count,
- params.has_selection,
- params.margin_type,
- params.is_scripted,
- params.is_modifiable,
- base::BindOnce(&PrintingMessageFilterQt::OnScriptedPrintReply,
- this,
- std::move(printer_query),
- reply_msg));
-}
-
-void PrintingMessageFilterQt::OnScriptedPrintReply(
- std::unique_ptr<printing::PrinterQuery> printer_query,
- IPC::Message* reply_msg) {
- PrintMsg_PrintPages_Params params;
-
- if (printer_query->last_status() != printing::PrintingContext::OK ||
- !printer_query->settings().dpi()) {
- params.Reset();
- } else {
- RenderParamsFromPrintSettings(printer_query->settings(), &params.params);
- params.params.document_cookie = printer_query->cookie();
- params.pages = printing::PageRange::GetPages(printer_query->settings().ranges());
- }
- PrintHostMsg_ScriptedPrint::WriteReplyParams(reply_msg, params);
- Send(reply_msg);
- if (!params.params.dpi.IsEmpty() && params.params.document_cookie) {
- queue_->QueuePrinterQuery(std::move(printer_query));
- } else {
- printer_query->StopWorker();
- }
-}
-
-void PrintingMessageFilterQt::OnUpdatePrintSettings(int document_cookie,
- base::Value job_settings,
- IPC::Message* reply_msg) {
- std::unique_ptr<printing::PrinterQuery> printer_query;
- printer_query = queue_->PopPrinterQuery(document_cookie);
- if (!printer_query.get()) {
- printer_query = queue_->CreatePrinterQuery(
- content::ChildProcessHost::kInvalidUniqueID, MSG_ROUTING_NONE);
- }
- printer_query->SetSettings(
- std::move(job_settings),
- base::BindOnce(&PrintingMessageFilterQt::OnUpdatePrintSettingsReply, this,
- std::move(printer_query), reply_msg));
-}
-
-void PrintingMessageFilterQt::OnUpdatePrintSettingsReply(std::unique_ptr<printing::PrinterQuery> printer_query,
- IPC::Message* reply_msg) {
- PrintMsg_PrintPages_Params params;
- if (!printer_query.get() ||
- printer_query->last_status() != printing::PrintingContext::OK) {
- params.Reset();
- } else {
- RenderParamsFromPrintSettings(printer_query->settings(), &params.params);
- params.params.document_cookie = printer_query->cookie();
- params.pages = printing::PageRange::GetPages(printer_query->settings().ranges());
- }
-
- PrintHostMsg_UpdatePrintSettings::WriteReplyParams(
- reply_msg,
- params,
- printer_query.get() &&
- (printer_query->last_status() == printing::PrintingContext::CANCEL));
- Send(reply_msg);
- // If user hasn't cancelled.
- if (printer_query) {
- if (printer_query->cookie() && printer_query->settings().dpi()) {
- queue_->QueuePrinterQuery(std::move(printer_query));
- } else {
- printer_query->StopWorker();
- }
- }
-}
-
-void PrintingMessageFilterQt::OnCheckForCancel(const PrintHostMsg_PreviewIds& ids,
- bool* cancel) {
- *cancel = false;
-}
-
-} // namespace printing
diff --git a/src/core/printing/printing_message_filter_qt.h b/src/core/printing/printing_message_filter_qt.h
deleted file mode 100644
index 89e473dcf..000000000
--- a/src/core/printing/printing_message_filter_qt.h
+++ /dev/null
@@ -1,126 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE.Chromium file.
-
-#ifndef PRINTING_PRINTING_MESSAGE_FILTER_QT_H_
-#define PRINTING_PRINTING_MESSAGE_FILTER_QT_H_
-
-#include <string>
-
-#include "base/compiler_specific.h"
-#include "components/prefs/pref_member.h"
-#include "content/public/browser/browser_message_filter.h"
-
-struct PrintHostMsg_PreviewIds;
-struct PrintHostMsg_ScriptedPrint_Params;
-
-namespace base {
-class DictionaryValue;
-class FilePath;
-}
-
-namespace content {
-class WebContents;
-}
-
-namespace printing {
-class PrintJobManager;
-class PrintQueriesQueue;
-class PrinterQuery;
-}
-
-namespace QtWebEngineCore {
-// This class filters out incoming printing related IPC messages for the
-// renderer process on the IPC thread.
-class PrintingMessageFilterQt : public content::BrowserMessageFilter {
- public:
- PrintingMessageFilterQt(int render_process_id);
-
- // content::BrowserMessageFilter methods.
- void OverrideThreadForMessage(const IPC::Message& message,
- content::BrowserThread::ID* thread) override;
- bool OnMessageReceived(const IPC::Message& message) override;
-
- private:
- ~PrintingMessageFilterQt() override;
-
- // GetPrintSettingsForRenderView must be called via PostTask and
- // base::Bind. Collapse the settings-specific params into a
- // struct to avoid running into issues with too many params
- // to base::Bind.
- struct GetPrintSettingsForRenderViewParams;
-
- // Get the default print setting.
- void OnGetDefaultPrintSettings(IPC::Message* reply_msg);
- void OnGetDefaultPrintSettingsReply(std::unique_ptr<printing::PrinterQuery> printer_query,
- IPC::Message* reply_msg);
-
- // The renderer host have to show to the user the print dialog and returns
- // the selected print settings. The task is handled by the print worker
- // thread and the UI thread. The reply occurs on the IO thread.
- void OnScriptedPrint(const PrintHostMsg_ScriptedPrint_Params& params,
- IPC::Message* reply_msg);
- void OnScriptedPrintReply(std::unique_ptr<printing::PrinterQuery> printer_query,
- IPC::Message* reply_msg);
-
- // Modify the current print settings based on |job_settings|. The task is
- // handled by the print worker thread and the UI thread. The reply occurs on
- // the IO thread.
- void OnUpdatePrintSettings(int document_cookie,
- base::Value job_settings,
- IPC::Message* reply_msg);
- void OnUpdatePrintSettingsReply(std::unique_ptr<printing::PrinterQuery> printer_query,
- IPC::Message* reply_msg);
-
- // Check to see if print preview has been cancelled.
- void OnCheckForCancel(const PrintHostMsg_PreviewIds& ids, bool* cancel);
-
- const int render_process_id_;
-
- scoped_refptr<printing::PrintQueriesQueue> queue_;
-
- DISALLOW_COPY_AND_ASSIGN(PrintingMessageFilterQt);
-};
-
-} // namespace printing
-
-#endif // PRINTING_PRINTING_MESSAGE_FILTER_QT_H_
diff --git a/src/core/process_main.cpp b/src/core/process_main.cpp
index ade0f6e99..6a7d26ffd 100644
--- a/src/core/process_main.cpp
+++ b/src/core/process_main.cpp
@@ -1,70 +1,28 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "process_main.h"
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+#include "qtwebenginecoreglobal_p.h"
#include "content_main_delegate_qt.h"
#include "content/public/app/content_main.h"
-#if defined(OS_WIN)
+#if BUILDFLAG(IS_WIN)
#include "sandbox/win/src/sandbox_types.h"
#include "content/public/app/sandbox_helper_win.h"
-#elif defined(OS_MACOSX)
-#include "base/logging.h"
+#elif BUILDFLAG(IS_MAC)
#include "sandbox/mac/seatbelt_exec.h"
#endif
namespace QtWebEngineCore {
-#if defined(OS_WIN)
-extern sandbox::SandboxInterfaceInfo *staticSandboxInterfaceInfo(sandbox::SandboxInterfaceInfo *info = nullptr);
-#endif
-
/*! \internal */
int processMain(int argc, const char **argv)
{
ContentMainDelegateQt delegate;
content::ContentMainParams params(&delegate);
-#if defined(OS_WIN)
+#if BUILDFLAG(IS_WIN)
HINSTANCE instance_handle = NULL;
- params.sandbox_info = staticSandboxInterfaceInfo();
- sandbox::SandboxInterfaceInfo sandbox_info = {0};
+ params.sandbox_info = QtWebEngineSandbox::staticSandboxInterfaceInfo();
+ sandbox::SandboxInterfaceInfo sandbox_info = {nullptr};
if (!params.sandbox_info) {
content::InitializeSandboxInfo(&sandbox_info);
params.sandbox_info = &sandbox_info;
@@ -73,16 +31,15 @@ int processMain(int argc, const char **argv)
#else
params.argc = argc;
params.argv = argv;
-#endif // OS_WIN
-#if defined(OS_MACOSX)
+#endif // IS_WIN
+#if BUILDFLAG(IS_MAC)
sandbox::SeatbeltExecServer::CreateFromArgumentsResult seatbelt =
sandbox::SeatbeltExecServer::CreateFromArguments(argv[0], argc, const_cast<char**>(argv));
if (seatbelt.sandbox_required) {
CHECK(seatbelt.server->InitializeSandbox());
}
-#endif // defined(OS_MACOSX)
-
- return content::ContentMain(params);
+#endif // IS_MAC
+ return content::ContentMain(std::move(params));
}
} // namespace QtWebEngineCore
diff --git a/src/core/process_main.h b/src/core/process_main.h
deleted file mode 100644
index fed2f3064..000000000
--- a/src/core/process_main.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtWebEngineCore/private/qtwebenginecoreglobal_p.h>
-
-namespace QtWebEngineCore {
-
-Q_WEBENGINECORE_PRIVATE_EXPORT int processMain(int argc, const char **argv);
-
-} // namespace
diff --git a/src/core/profile_adapter.cpp b/src/core/profile_adapter.cpp
index 4557ad7a4..b26f9b1de 100644
--- a/src/core/profile_adapter.cpp
+++ b/src/core/profile_adapter.cpp
@@ -1,56 +1,29 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "profile_adapter.h"
+#include "base/files/file_util.h"
+#include "base/task/cancelable_task_tracker.h"
+#include "base/threading/thread_restrictions.h"
+#include "base/time/time_to_iso8601.h"
+#include "components/embedder_support/user_agent_utils.h"
+#include "components/favicon/core/favicon_service.h"
+#include "components/history/content/browser/history_database_helper.h"
+#include "components/history/core/browser/history_database_params.h"
+#include "components/history/core/browser/history_service.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/browsing_data_remover.h"
#include "content/public/browser/download_manager.h"
-#include "content/public/browser/shared_cors_origin_access_list.h"
#include "content/public/browser/storage_partition.h"
-#include "services/network/public/cpp/cors/origin_access_list.h"
+#include "services/network/public/mojom/network_context.mojom.h"
#include "url/url_util.h"
#include "api/qwebengineurlscheme.h"
#include "content_browser_client_qt.h"
#include "download_manager_delegate_qt.h"
+#include "favicon_service_factory_qt.h"
#include "permission_manager_qt.h"
#include "profile_adapter_client.h"
#include "profile_io_data_qt.h"
@@ -58,12 +31,8 @@
#include "renderer_host/user_resource_controller_host.h"
#include "type_conversion.h"
#include "visited_links_manager_qt.h"
-#include "web_engine_context.h"
#include "web_contents_adapter_client.h"
-
-#include "base/files/file_util.h"
-#include "base/time/time_to_iso8601.h"
-#include "components/keyed_service/content/browser_context_dependency_manager.h"
+#include "web_engine_context.h"
#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "extensions/browser/extension_system.h"
@@ -71,6 +40,8 @@
#include <QCoreApplication>
#include <QDir>
+#include <QJsonObject>
+#include <QSet>
#include <QString>
#include <QStandardPaths>
@@ -94,12 +65,13 @@ ProfileAdapter::ProfileAdapter(const QString &storageName):
, m_httpCacheType(DiskHttpCache)
, m_persistentCookiesPolicy(AllowPersistentCookies)
, m_visitedLinksPolicy(TrackVisitedLinksOnDisk)
+ , m_clientHintsEnabled(true)
+ , m_pushServiceEnabled(false)
, m_httpCacheMaxSize(0)
{
WebEngineContext::current()->addProfileAdapter(this);
// creation of profile requires webengine context
m_profile.reset(new ProfileQt(this));
- content::BrowserContext::Initialize(m_profile.data(), toFilePath(dataPath()));
// fixme: this should not be here
m_profile->m_profileIOData->initializeOnUIThread();
m_customUrlSchemeHandlers.insert(QByteArrayLiteral("qrc"), &m_qrcHandler);
@@ -107,32 +79,27 @@ ProfileAdapter::ProfileAdapter(const QString &storageName):
if (!storageName.isEmpty())
extensions::ExtensionSystem::Get(m_profile.data())->InitForRegularProfile(true);
#endif
+ m_cancelableTaskTracker.reset(new base::CancelableTaskTracker());
- // Allow XMLHttpRequests from qrc to file.
- // ### consider removing for Qt6
- url::Origin qrc = url::Origin::Create(GURL("qrc://"));
- auto pattern = network::mojom::CorsOriginPattern::New("file", "", 0,
- network::mojom::CorsDomainMatchMode::kAllowSubdomains,
- network::mojom::CorsPortMatchMode::kAllowAnyPort,
- network::mojom::CorsOriginAccessMatchPriority::kDefaultPriority);
- std::vector<network::mojom::CorsOriginPatternPtr> list;
- list.push_back(std::move(pattern));
- m_profile->GetSharedCorsOriginAccessList()->SetForOrigin(qrc, std::move(list), {}, base::BindOnce([]{}));
+ m_profile->DoFinalInit();
}
ProfileAdapter::~ProfileAdapter()
{
- while (!m_webContentsAdapterClients.isEmpty()) {
- m_webContentsAdapterClients.first()->releaseProfile();
- }
+ m_cancelableTaskTracker->TryCancelAll();
+ m_profile->NotifyWillBeDestroyed();
+ releaseAllWebContentsAdapterClients();
+
WebEngineContext::current()->removeProfileAdapter(this);
if (m_downloadManagerDelegate) {
- m_profile->GetDownloadManager(m_profile.data())->Shutdown();
+ m_profile->GetDownloadManager()->Shutdown();
m_downloadManagerDelegate.reset();
}
#if QT_CONFIG(ssl)
delete m_clientCertificateStore;
+ m_clientCertificateStore = nullptr;
#endif
+ WebEngineContext::flushMessages();
}
void ProfileAdapter::setStorageName(const QString &storageName)
@@ -146,6 +113,8 @@ void ProfileAdapter::setStorageName(const QString &storageName)
m_profile->m_profileIOData->resetNetworkContext();
if (m_visitedLinksManager)
resetVisitedLinksManager();
+
+ reinitializeHistoryService();
}
}
@@ -159,6 +128,14 @@ void ProfileAdapter::setOffTheRecord(bool offTheRecord)
m_profile->m_profileIOData->resetNetworkContext();
if (m_visitedLinksManager)
resetVisitedLinksManager();
+
+ if (offTheRecord) {
+ favicon::FaviconService *faviconService =
+ FaviconServiceFactoryQt::GetForBrowserContext(m_profile.data());
+ faviconService->SetHistoryService(nullptr);
+ } else if (!m_name.isEmpty()) {
+ reinitializeHistoryService();
+ }
}
ProfileQt *ProfileAdapter::profile()
@@ -166,6 +143,26 @@ ProfileQt *ProfileAdapter::profile()
return m_profile.data();
}
+bool ProfileAdapter::ensureDataPathExists()
+{
+ Q_ASSERT(!m_offTheRecord);
+ base::ScopedAllowBlocking allowBlock;
+ const base::FilePath &path = toFilePath(dataPath());
+ if (path.empty())
+ return false;
+ if (base::DirectoryExists(path))
+ return true;
+
+ base::File::Error error;
+ if (base::CreateDirectoryAndGetError(path, &error))
+ return true;
+
+ std::string errorstr = base::File::ErrorToString(error);
+ qWarning("Cannot create directory %s. Error: %s.", path.AsUTF8Unsafe().c_str(),
+ errorstr.c_str());
+ return false;
+}
+
VisitedLinksManagerQt *ProfileAdapter::visitedLinksManager()
{
if (!m_visitedLinksManager)
@@ -207,9 +204,9 @@ void ProfileAdapter::removeClient(ProfileAdapterClient *adapterClient)
m_clients.removeOne(adapterClient);
}
-void ProfileAdapter::cancelDownload(quint32 downloadId)
+bool ProfileAdapter::cancelDownload(quint32 downloadId)
{
- downloadManagerDelegate()->cancelDownload(downloadId);
+ return downloadManagerDelegate()->cancelDownload(downloadId);
}
void ProfileAdapter::pauseDownload(quint32 downloadId)
@@ -245,13 +242,17 @@ QObject* ProfileAdapter::globalQObjectRoot()
QString ProfileAdapter::dataPath() const
{
- if (m_offTheRecord)
- return QString();
if (!m_dataPath.isEmpty())
return m_dataPath;
- if (!m_name.isNull())
- return buildLocationFromStandardPath(QStandardPaths::writableLocation(QStandardPaths::DataLocation), m_name);
- return QString();
+ // And off-the-record or memory-only profile should not write to disk
+ // but Chromium often creates temporary directories anyway, so given them
+ // a location to do so.
+ QString name = m_name;
+ if (m_offTheRecord)
+ name = QStringLiteral("OffTheRecord");
+ else if (m_name.isEmpty())
+ name = QStringLiteral("UnknownProfile");
+ return buildLocationFromStandardPath(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation), name);
}
void ProfileAdapter::setDataPath(const QString &path)
@@ -259,13 +260,14 @@ void ProfileAdapter::setDataPath(const QString &path)
if (m_dataPath == path)
return;
m_dataPath = path;
- if (!m_offTheRecord) {
- m_profile->setupPrefService();
- if (!m_profile->m_profileIOData->isClearHttpCacheInProgress())
- m_profile->m_profileIOData->resetNetworkContext();
- if (m_visitedLinksManager)
- resetVisitedLinksManager();
- }
+ m_profile->setupPrefService();
+ if (!m_profile->m_profileIOData->isClearHttpCacheInProgress())
+ m_profile->m_profileIOData->resetNetworkContext();
+ if (!m_offTheRecord && m_visitedLinksManager)
+ resetVisitedLinksManager();
+
+ if (!m_offTheRecord)
+ reinitializeHistoryService();
}
void ProfileAdapter::setDownloadPath(const QString &path)
@@ -320,13 +322,16 @@ void ProfileAdapter::setHttpUserAgent(const QString &userAgent)
std::vector<content::WebContentsImpl *> list = content::WebContentsImpl::GetAllWebContents();
for (content::WebContentsImpl *web_contents : list)
- if (web_contents->GetBrowserContext() == m_profile.data())
- web_contents->SetUserAgentOverride(stdUserAgent, true);
+ if (web_contents->GetBrowserContext() == m_profile.data()) {
+ auto userAgentOverride = blink::UserAgentOverride::UserAgentOnly(stdUserAgent);
+ userAgentOverride.ua_metadata_override = m_profile->m_userAgentMetadata;
+ web_contents->SetUserAgentOverride(userAgentOverride, true);
+ }
- content::BrowserContext::ForEachStoragePartition(
- m_profile.get(), base::BindRepeating([](const std::string &user_agent, content::StoragePartition *storage_partition) {
- storage_partition->GetNetworkContext()->SetUserAgent(user_agent);
- }, stdUserAgent));
+ m_profile->ForEachLoadedStoragePartition(
+ base::BindRepeating([](const std::string &user_agent, content::StoragePartition *storage_partition) {
+ storage_partition->GetNetworkContext()->SetUserAgent(user_agent);
+ }, stdUserAgent));
}
ProfileAdapter::HttpCacheType ProfileAdapter::httpCacheType() const
@@ -346,14 +351,12 @@ void ProfileAdapter::setHttpCacheType(ProfileAdapter::HttpCacheType newhttpCache
return;
if (!m_offTheRecord && !m_profile->m_profileIOData->isClearHttpCacheInProgress()) {
m_profile->m_profileIOData->resetNetworkContext();
- if (m_httpCacheType == NoCache)
- clearHttpCache();
}
}
ProfileAdapter::PersistentCookiesPolicy ProfileAdapter::persistentCookiesPolicy() const
{
- if (isOffTheRecord() || dataPath().isEmpty())
+ if (isOffTheRecord() || m_name.isEmpty())
return NoPersistentCookies;
return m_persistentCookiesPolicy;
}
@@ -372,7 +375,7 @@ ProfileAdapter::VisitedLinksPolicy ProfileAdapter::visitedLinksPolicy() const
{
if (isOffTheRecord() || m_visitedLinksPolicy == DoNotTrackVisitedLinks)
return DoNotTrackVisitedLinks;
- if (dataPath().isEmpty())
+ if (m_name.isEmpty())
return TrackVisitedLinksInMemory;
return m_visitedLinksPolicy;
}
@@ -465,10 +468,10 @@ const QList<QByteArray> ProfileAdapter::customUrlSchemes() const
void ProfileAdapter::updateCustomUrlSchemeHandlers()
{
- content::BrowserContext::ForEachStoragePartition(
- m_profile.get(), base::BindRepeating([](content::StoragePartition *storage_partition) {
- storage_partition->ResetURLLoaderFactories();
- }));
+ m_profile->ForEachLoadedStoragePartition(
+ base::BindRepeating([](content::StoragePartition *storage_partition) {
+ storage_partition->ResetURLLoaderFactories();
+ }));
}
void ProfileAdapter::removeUrlSchemeHandler(QWebEngineUrlSchemeHandler *handler)
@@ -581,16 +584,120 @@ void ProfileAdapter::setHttpAcceptLanguage(const QString &httpAcceptLanguage)
std::vector<content::WebContentsImpl *> list = content::WebContentsImpl::GetAllWebContents();
for (content::WebContentsImpl *web_contents : list) {
if (web_contents->GetBrowserContext() == m_profile.data()) {
- blink::mojom::RendererPreferences *rendererPrefs = web_contents->GetMutableRendererPrefs();
+ blink::RendererPreferences *rendererPrefs = web_contents->GetMutableRendererPrefs();
rendererPrefs->accept_languages = http_accept_language;
web_contents->SyncRendererPrefs();
}
}
- content::BrowserContext::ForEachStoragePartition(
- m_profile.get(), base::BindRepeating([](std::string accept_language, content::StoragePartition *storage_partition) {
- storage_partition->GetNetworkContext()->SetAcceptLanguage(accept_language);
- }, http_accept_language));
+ m_profile->ForEachLoadedStoragePartition(
+ base::BindRepeating([](std::string accept_language, content::StoragePartition *storage_partition) {
+ storage_partition->GetNetworkContext()->SetAcceptLanguage(accept_language);
+ }, http_accept_language));
+}
+
+QVariant ProfileAdapter::clientHint(ClientHint clientHint) const
+{
+ blink::UserAgentMetadata &userAgentMetadata = m_profile->m_userAgentMetadata;
+ switch (clientHint) {
+ case ProfileAdapter::UAArchitecture:
+ return QVariant(toQString(userAgentMetadata.architecture));
+ case ProfileAdapter::UAPlatform:
+ return QVariant(toQString(userAgentMetadata.platform));
+ case ProfileAdapter::UAModel:
+ return QVariant(toQString(userAgentMetadata.model));
+ case ProfileAdapter::UAMobile:
+ return QVariant(userAgentMetadata.mobile);
+ case ProfileAdapter::UAFullVersion:
+ return QVariant(toQString(userAgentMetadata.full_version));
+ case ProfileAdapter::UAPlatformVersion:
+ return QVariant(toQString(userAgentMetadata.platform_version));
+ case ProfileAdapter::UABitness:
+ return QVariant(toQString(userAgentMetadata.bitness));
+ case ProfileAdapter::UAFullVersionList: {
+ QJsonObject ret;
+ for (const auto &value : userAgentMetadata.brand_full_version_list)
+ ret.insert(toQString(value.brand), QJsonValue(toQString(value.version)));
+ return QVariant(ret);
+ }
+ case ProfileAdapter::UAWOW64:
+ return QVariant(userAgentMetadata.wow64);
+ default:
+ return QVariant();
+ }
+}
+
+void ProfileAdapter::setClientHint(ClientHint clientHint, const QVariant &value)
+{
+ blink::UserAgentMetadata &userAgentMetadata = m_profile->m_userAgentMetadata;
+ switch (clientHint) {
+ case ProfileAdapter::UAArchitecture:
+ userAgentMetadata.architecture = value.toString().toStdString();
+ break;
+ case ProfileAdapter::UAPlatform:
+ userAgentMetadata.platform = value.toString().toStdString();
+ break;
+ case ProfileAdapter::UAModel:
+ userAgentMetadata.model = value.toString().toStdString();
+ break;
+ case ProfileAdapter::UAMobile:
+ userAgentMetadata.mobile = value.toBool();
+ break;
+ case ProfileAdapter::UAFullVersion:
+ userAgentMetadata.full_version = value.toString().toStdString();
+ break;
+ case ProfileAdapter::UAPlatformVersion:
+ userAgentMetadata.platform_version = value.toString().toStdString();
+ break;
+ case ProfileAdapter::UABitness:
+ userAgentMetadata.bitness = value.toString().toStdString();
+ break;
+ case ProfileAdapter::UAFullVersionList: {
+ userAgentMetadata.brand_full_version_list.clear();
+ QJsonObject fullVersionList = value.toJsonObject();
+ for (const QString &key : fullVersionList.keys())
+ userAgentMetadata.brand_full_version_list.push_back({
+ key.toStdString(),
+ fullVersionList.value(key).toString().toStdString()
+ });
+ break;
+ }
+ case ProfileAdapter::UAWOW64:
+ userAgentMetadata.wow64 = value.toBool();
+ break;
+ default:
+ break;
+ }
+
+ std::vector<content::WebContentsImpl *> list = content::WebContentsImpl::GetAllWebContents();
+ for (content::WebContentsImpl *web_contents : list) {
+ if (web_contents->GetBrowserContext() == m_profile.data()) {
+ web_contents->GetMutableRendererPrefs()->user_agent_override.ua_metadata_override = userAgentMetadata;
+ web_contents->SyncRendererPrefs();
+ }
+ }
+}
+
+bool ProfileAdapter::clientHintsEnabled()
+{
+ return m_clientHintsEnabled;
+}
+
+void ProfileAdapter::setClientHintsEnabled(bool enabled)
+{
+ m_clientHintsEnabled = enabled;
+}
+
+void ProfileAdapter::resetClientHints()
+{
+ m_profile->m_userAgentMetadata = embedder_support::GetUserAgentMetadata();
+ std::vector<content::WebContentsImpl *> list = content::WebContentsImpl::GetAllWebContents();
+ for (content::WebContentsImpl *web_contents : list) {
+ if (web_contents->GetBrowserContext() == m_profile.data()) {
+ web_contents->GetMutableRendererPrefs()->user_agent_override.ua_metadata_override = m_profile->m_userAgentMetadata;
+ web_contents->SyncRendererPrefs();
+ }
+ }
}
void ProfileAdapter::clearHttpCache()
@@ -630,6 +737,16 @@ bool ProfileAdapter::isSpellCheckEnabled() const
#endif
}
+bool ProfileAdapter::pushServiceEnabled() const
+{
+ return m_pushServiceEnabled;
+}
+
+void ProfileAdapter::setPushServiceEnabled(bool enabled)
+{
+ m_pushServiceEnabled = enabled;
+}
+
void ProfileAdapter::addWebContentsAdapterClient(WebContentsAdapterClient *client)
{
m_webContentsAdapterClients.append(client);
@@ -640,41 +757,30 @@ void ProfileAdapter::removeWebContentsAdapterClient(WebContentsAdapterClient *cl
m_webContentsAdapterClients.removeAll(client);
}
+void ProfileAdapter::releaseAllWebContentsAdapterClients()
+{
+ while (!m_webContentsAdapterClients.isEmpty())
+ m_webContentsAdapterClients.first()->releaseProfile();
+}
+
void ProfileAdapter::resetVisitedLinksManager()
{
m_visitedLinksManager.reset(new VisitedLinksManagerQt(m_profile.data(), persistVisitedLinks()));
}
-void ProfileAdapter::setUseForGlobalCertificateVerification(bool enable)
+void ProfileAdapter::reinitializeHistoryService()
{
- if (m_usedForGlobalCertificateVerification == enable)
- return;
-
- static QPointer<ProfileAdapter> profileForglobalCertificateVerification;
-
- m_usedForGlobalCertificateVerification = enable;
- if (enable) {
- if (profileForglobalCertificateVerification) {
- profileForglobalCertificateVerification->m_usedForGlobalCertificateVerification = false;
- if (!m_profile->m_profileIOData->isClearHttpCacheInProgress())
- profileForglobalCertificateVerification->m_profile->m_profileIOData->resetNetworkContext();
- for (auto *client : qAsConst(profileForglobalCertificateVerification->m_clients))
- client->useForGlobalCertificateVerificationChanged();
- }
- profileForglobalCertificateVerification = this;
+ Q_ASSERT(!m_offTheRecord);
+ if (ensureDataPathExists()) {
+ favicon::FaviconService *faviconService =
+ FaviconServiceFactoryQt::GetForBrowserContext(m_profile.data());
+ history::HistoryService *historyService = static_cast<history::HistoryService *>(
+ HistoryServiceFactoryQt::GetInstance()->GetForBrowserContext(m_profile.data()));
+ Q_ASSERT(historyService);
+ faviconService->SetHistoryService(historyService);
} else {
- Q_ASSERT(profileForglobalCertificateVerification);
- Q_ASSERT(profileForglobalCertificateVerification == this);
- profileForglobalCertificateVerification = nullptr;
+ qWarning("Favicon database is not available for this profile.");
}
-
- if (!m_profile->m_profileIOData->isClearHttpCacheInProgress())
- m_profile->m_profileIOData->resetNetworkContext();
-}
-
-bool ProfileAdapter::isUsedForGlobalCertificateVerification() const
-{
- return m_usedForGlobalCertificateVerification;
}
QString ProfileAdapter::determineDownloadPath(const QString &downloadDirectory, const QString &suggestedFilename, const time_t &startTime)
@@ -683,7 +789,11 @@ QString ProfileAdapter::determineDownloadPath(const QString &downloadDirectory,
QString suggestedFilePath = suggestedFile.absoluteFilePath();
base::FilePath tmpFilePath(toFilePath(suggestedFilePath).NormalizePathSeparatorsTo('/'));
- int uniquifier = base::GetUniquePathNumber(tmpFilePath);
+ int uniquifier = 0;
+ {
+ base::ScopedAllowBlocking allowBlock;
+ uniquifier = base::GetUniquePathNumber(tmpFilePath);
+ }
if (uniquifier > 0)
suggestedFilePath = toQt(tmpFilePath.InsertBeforeExtensionASCII(base::StringPrintf(" (%d)", uniquifier)).AsUTF8Unsafe());
else if (uniquifier == -1) {
@@ -707,4 +817,101 @@ QWebEngineClientCertificateStore *ProfileAdapter::clientCertificateStore()
}
#endif
+static void callbackOnIconAvailableForPageURL(std::function<void (const QIcon &, const QUrl &, const QUrl &)> iconAvailableCallback,
+ const QUrl &pageUrl,
+ const favicon_base::FaviconRawBitmapResult &result)
+{
+ if (!result.is_valid()) {
+ iconAvailableCallback(QIcon(), toQt(result.icon_url), pageUrl);
+ return;
+ }
+ QPixmap pixmap(toQt(result.pixel_size));
+ pixmap.loadFromData(result.bitmap_data->data(), result.bitmap_data->size());
+ iconAvailableCallback(QIcon(pixmap), toQt(result.icon_url), pageUrl);
+}
+
+void ProfileAdapter::requestIconForPageURL(const QUrl &pageUrl,
+ int desiredSizeInPixel,
+ bool touchIconsEnabled,
+ std::function<void (const QIcon &, const QUrl &, const QUrl &)> iconAvailableCallback)
+{
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ favicon::FaviconService *service = FaviconServiceFactoryQt::GetForBrowserContext(m_profile.data());
+
+ if (!service->HistoryService()) {
+ callbackOnIconAvailableForPageURL(iconAvailableCallback, pageUrl,
+ favicon_base::FaviconRawBitmapResult());
+ return;
+ }
+
+ favicon_base::IconTypeSet types = { favicon_base::IconType::kFavicon };
+ if (touchIconsEnabled) {
+ types.insert(favicon_base::IconType::kTouchIcon);
+ types.insert(favicon_base::IconType::kTouchPrecomposedIcon);
+ types.insert(favicon_base::IconType::kWebManifestIcon);
+ }
+ service->GetRawFaviconForPageURL(
+ toGurl(pageUrl), types, desiredSizeInPixel, true /* fallback_to_host */,
+ base::BindOnce(&callbackOnIconAvailableForPageURL, iconAvailableCallback, pageUrl),
+ m_cancelableTaskTracker.get());
+}
+
+static void callbackOnIconAvailableForIconURL(std::function<void (const QIcon &, const QUrl &)> iconAvailableCallback,
+ ProfileAdapter *profileAdapter,
+ const QUrl &iconUrl, int iconType,
+ int desiredSizeInPixel,
+ bool touchIconsEnabled,
+ const favicon_base::FaviconRawBitmapResult &result)
+{
+ if (!result.is_valid()) {
+ // If touch icons are disabled there is no need to try further icon types.
+ if (!touchIconsEnabled) {
+ iconAvailableCallback(QIcon(), iconUrl);
+ return;
+ }
+ if (static_cast<favicon_base::IconType>(iconType) != favicon_base::IconType::kMax) {
+ //Q_ASSERT(profileAdapter->profile());
+ favicon::FaviconService *service = FaviconServiceFactoryQt::GetForBrowserContext(profileAdapter->profile());
+ service->GetRawFavicon(toGurl(iconUrl),
+ static_cast<favicon_base::IconType>(iconType + 1),
+ desiredSizeInPixel,
+ base::BindOnce(&callbackOnIconAvailableForIconURL, iconAvailableCallback,
+ profileAdapter, iconUrl, iconType + 1, desiredSizeInPixel,
+ touchIconsEnabled),
+ profileAdapter->cancelableTaskTracker());
+ return;
+ }
+ iconAvailableCallback(QIcon(), iconUrl);
+ return;
+ }
+ QPixmap pixmap(toQt(result.pixel_size));
+ pixmap.loadFromData(result.bitmap_data->data(), result.bitmap_data->size());
+ iconAvailableCallback(QIcon(pixmap), toQt(result.icon_url));
+}
+
+void ProfileAdapter::requestIconForIconURL(const QUrl &iconUrl,
+ int desiredSizeInPixel,
+ bool touchIconsEnabled,
+ std::function<void (const QIcon &, const QUrl &)> iconAvailableCallback)
+{
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ favicon::FaviconService *service = FaviconServiceFactoryQt::GetForBrowserContext(m_profile.data());
+
+ if (!service->HistoryService()) {
+ callbackOnIconAvailableForIconURL(iconAvailableCallback,
+ this,
+ iconUrl,
+ static_cast<int>(favicon_base::IconType::kMax), 0,
+ touchIconsEnabled,
+ favicon_base::FaviconRawBitmapResult());
+ return;
+ }
+ service->GetRawFavicon(
+ toGurl(iconUrl), favicon_base::IconType::kFavicon, desiredSizeInPixel,
+ base::BindOnce(&callbackOnIconAvailableForIconURL, iconAvailableCallback, this, iconUrl,
+ static_cast<int>(favicon_base::IconType::kFavicon), desiredSizeInPixel,
+ touchIconsEnabled),
+ m_cancelableTaskTracker.get());
+}
+
} // namespace QtWebEngineCore
diff --git a/src/core/profile_adapter.h b/src/core/profile_adapter.h
index efd56e50e..4be0ea51e 100644
--- a/src/core/profile_adapter.h
+++ b/src/core/profile_adapter.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
//
// W A R N I N G
@@ -51,23 +15,27 @@
#ifndef PROFILE_ADAPTER_H
#define PROFILE_ADAPTER_H
-#include "qtwebenginecoreglobal_p.h"
+#include <QtWebEngineCore/private/qtwebenginecoreglobal_p.h>
-#include <QEnableSharedFromThis>
+#include <QHash>
#include <QList>
#include <QPointer>
#include <QScopedPointer>
+#include <QSharedPointer>
#include <QString>
-#include <QVector>
-#include "api/qwebengineclientcertificatestore.h"
-#include "api/qwebenginecookiestore.h"
-#include "api/qwebengineurlrequestinterceptor.h"
-#include "api/qwebengineurlschemehandler.h"
+#include <QtWebEngineCore/qwebengineclientcertificatestore.h>
+#include <QtWebEngineCore/qwebenginecookiestore.h>
+#include <QtWebEngineCore/qwebengineurlrequestinterceptor.h>
+#include <QtWebEngineCore/qwebengineurlschemehandler.h>
#include "net/qrc_url_scheme_handler.h"
QT_FORWARD_DECLARE_CLASS(QObject)
+namespace base {
+class CancelableTaskTracker;
+}
+
namespace QtWebEngineCore {
class UserNotificationController;
@@ -78,7 +46,7 @@ class UserResourceControllerHost;
class VisitedLinksManagerQt;
class WebContentsAdapterClient;
-class Q_WEBENGINECORE_PRIVATE_EXPORT ProfileAdapter : public QObject
+class Q_WEBENGINECORE_EXPORT ProfileAdapter : public QObject
{
public:
explicit ProfileAdapter(const QString &storagePrefix = QString());
@@ -100,12 +68,13 @@ public:
void addClient(ProfileAdapterClient *adapterClient);
void removeClient(ProfileAdapterClient *adapterClient);
- void cancelDownload(quint32 downloadId);
+ bool cancelDownload(quint32 downloadId);
void pauseDownload(quint32 downloadId);
void resumeDownload(quint32 downloadId);
void removeDownload(quint32 downloadId);
ProfileQt *profile();
+ bool ensureDataPathExists();
QString storageName() const { return m_name; }
void setStorageName(const QString &storageName);
@@ -132,8 +101,12 @@ public:
void setSpellCheckEnabled(bool enabled);
bool isSpellCheckEnabled() const;
+ bool pushServiceEnabled() const;
+ void setPushServiceEnabled(bool enabled);
+
void addWebContentsAdapterClient(WebContentsAdapterClient *client);
void removeWebContentsAdapterClient(WebContentsAdapterClient *client);
+ void releaseAllWebContentsAdapterClients();
// KEEP IN SYNC with API or add mapping layer
enum HttpCacheType {
@@ -160,8 +133,8 @@ public:
NotificationPermission = 2,
AudioCapturePermission = 3,
VideoCapturePermission = 4,
- ClipboardRead = 5,
- ClipboardWrite = 6,
+ ClipboardReadWrite = 5,
+ LocalFontsPermission = 6,
};
enum PermissionState {
@@ -170,6 +143,18 @@ public:
DeniedPermission = 2
};
+ enum ClientHint : uchar {
+ UAArchitecture,
+ UAPlatform,
+ UAModel,
+ UAMobile,
+ UAFullVersion,
+ UAPlatformVersion,
+ UABitness,
+ UAFullVersionList,
+ UAWOW64,
+ };
+
HttpCacheType httpCacheType() const;
void setHttpCacheType(ProfileAdapter::HttpCacheType);
@@ -200,10 +185,13 @@ public:
QString httpAcceptLanguage() const;
void setHttpAcceptLanguage(const QString &httpAcceptLanguage);
- void clearHttpCache();
+ QVariant clientHint(ClientHint clientHint) const;
+ void setClientHint(ClientHint clientHint, const QVariant &value);
+ bool clientHintsEnabled();
+ void setClientHintsEnabled(bool enabled);
+ void resetClientHints();
- void setUseForGlobalCertificateVerification(bool enable = true);
- bool isUsedForGlobalCertificateVerification() const;
+ void clearHttpCache();
#if QT_CONFIG(ssl)
QWebEngineClientCertificateStore *clientCertificateStore();
@@ -216,14 +204,20 @@ public:
QString determineDownloadPath(const QString &downloadDirectory, const QString &suggestedFilename, const time_t &startTime);
+ void requestIconForPageURL(const QUrl &pageUrl, int desiredSizeInPixel, bool touchIconsEnabled,
+ std::function<void (const QIcon &, const QUrl &, const QUrl &)> iconAvailableCallback);
+ void requestIconForIconURL(const QUrl &iconUrl, int desiredSizeInPixel, bool touchIconsEnabled,
+ std::function<void (const QIcon &, const QUrl &)> iconAvailableCallback);
+ base::CancelableTaskTracker *cancelableTaskTracker() { return m_cancelableTaskTracker.get(); }
+
private:
void updateCustomUrlSchemeHandlers();
void resetVisitedLinksManager();
bool persistVisitedLinks() const;
+ void reinitializeHistoryService();
QString m_name;
bool m_offTheRecord;
- bool m_usedForGlobalCertificateVerification = false;
QScopedPointer<ProfileQt> m_profile;
QScopedPointer<VisitedLinksManagerQt> m_visitedLinksManager;
QScopedPointer<DownloadManagerDelegateQt> m_downloadManagerDelegate;
@@ -245,11 +239,14 @@ private:
QHash<QByteArray, QPointer<QWebEngineUrlSchemeHandler>> m_customUrlSchemeHandlers;
QHash<QByteArray, QWeakPointer<UserNotificationController>> m_ephemeralNotifications;
QHash<QByteArray, QSharedPointer<UserNotificationController>> m_persistentNotifications;
+ bool m_clientHintsEnabled;
QList<ProfileAdapterClient*> m_clients;
- QVector<WebContentsAdapterClient *> m_webContentsAdapterClients;
+ QList<WebContentsAdapterClient *> m_webContentsAdapterClients;
+ bool m_pushServiceEnabled;
int m_httpCacheMaxSize;
QrcUrlSchemeHandler m_qrcHandler;
+ std::unique_ptr<base::CancelableTaskTracker> m_cancelableTaskTracker;
Q_DISABLE_COPY(ProfileAdapter)
};
diff --git a/src/core/profile_adapter_client.cpp b/src/core/profile_adapter_client.cpp
index 9aa084da9..b6a16c21a 100644
--- a/src/core/profile_adapter_client.cpp
+++ b/src/core/profile_adapter_client.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "profile_adapter_client.h"
#include "components/download/public/common/download_item.h"
diff --git a/src/core/profile_adapter_client.h b/src/core/profile_adapter_client.h
index 394f92270..06ac0de8b 100644
--- a/src/core/profile_adapter_client.h
+++ b/src/core/profile_adapter_client.h
@@ -1,41 +1,5 @@
- /****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
//
// W A R N I N G
@@ -51,7 +15,7 @@
#ifndef PROFILE_ADAPTER_CLIENT_H
#define PROFILE_ADAPTER_CLIENT_H
-#include "qtwebenginecoreglobal_p.h"
+#include "api/qtwebenginecoreglobal_p.h"
#include <QSharedPointer>
#include <QString>
#include <QUrl>
@@ -60,9 +24,10 @@
namespace QtWebEngineCore {
class WebContentsAdapterClient;
+class WebEngineSettings;
class UserNotificationController;
-class Q_WEBENGINECORE_PRIVATE_EXPORT ProfileAdapterClient
+class Q_WEBENGINECORE_EXPORT ProfileAdapterClient
{
public:
// Keep in sync with content::DownloadItem::DownloadState
@@ -85,13 +50,6 @@ public:
MimeHtmlSaveFormat
};
- enum DownloadType {
- Attachment = 0,
- DownloadAttribute,
- UserRequested,
- SavePage
- };
-
// Keep in sync with content::DownloadInterruptReason
enum DownloadInterruptReason {
NoReason = 0,
@@ -136,7 +94,7 @@ public:
bool accepted;
bool paused;
bool done;
- int downloadType;
+ bool isSavePageDownload;
int downloadInterruptReason;
WebContentsAdapterClient *page;
QString suggestedFileName;
@@ -147,11 +105,13 @@ public:
virtual void downloadRequested(DownloadItemInfo &info) = 0;
virtual void downloadUpdated(const DownloadItemInfo &info) = 0;
- virtual void useForGlobalCertificateVerificationChanged() {}
virtual void showNotification(QSharedPointer<UserNotificationController> &) { }
virtual void addWebContentsAdapterClient(WebContentsAdapterClient *adapter) = 0;
virtual void removeWebContentsAdapterClient(WebContentsAdapterClient *adapter) = 0;
+ virtual WebEngineSettings *coreSettings() const = 0;
+ virtual void clearHttpCacheCompleted() = 0;
+
static QString downloadInterruptReasonToString(DownloadInterruptReason reason);
};
diff --git a/src/core/profile_io_data_qt.cpp b/src/core/profile_io_data_qt.cpp
index ecebbdaa7..859aff8d4 100644
--- a/src/core/profile_io_data_qt.cpp
+++ b/src/core/profile_io_data_qt.cpp
@@ -1,65 +1,24 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "profile_io_data_qt.h"
-#include "base/task/post_task.h"
#include "content/browser/storage_partition_impl.h"
-#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/browsing_data_remover.h"
+#include "content/public/browser/resource_context.h"
#include "content/public/browser/shared_cors_origin_access_list.h"
-#include "content/public/common/content_features.h"
-#include "net/ssl/ssl_config_service_defaults.h"
+#include "services/cert_verifier/public/mojom/cert_verifier_service_factory.mojom.h"
#include "services/network/public/cpp/cors/origin_access_list.h"
-#include "net/client_cert_override.h"
+#include "net/client_cert_qt.h"
#include "net/client_cert_store_data.h"
#include "net/cookie_monster_delegate_qt.h"
#include "net/system_network_context_manager.h"
+#include "profile_adapter_client.h"
#include "profile_qt.h"
-#include "resource_context_qt.h"
#include "type_conversion.h"
-#include <QDebug>
-#include <mutex>
-
namespace QtWebEngineCore {
ProfileIODataQt::ProfileIODataQt(ProfileQt *profile)
@@ -97,6 +56,12 @@ void ProfileIODataQt::shutdownOnUIThread()
if (m_cookieDelegate)
m_cookieDelegate->unsetMojoCookieManager();
m_proxyConfigMonitor.reset();
+
+ if (m_clearHttpCacheState == Removing) {
+ m_clearHttpCacheState = Completed;
+ removeBrowsingDataRemoverObserver();
+ }
+
bool posted = content::BrowserThread::DeleteSoon(content::BrowserThread::IO, FROM_HERE, this);
if (!posted) {
qWarning() << "Could not delete ProfileIODataQt on io thread !";
@@ -126,7 +91,7 @@ void ProfileIODataQt::initializeOnUIThread()
{
m_profileAdapter = m_profile->profileAdapter();
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- m_resourceContext.reset(new ResourceContextQt(this));
+ m_resourceContext.reset(new content::ResourceContext());
m_cookieDelegate = new CookieMonsterDelegateQt();
m_cookieDelegate->setClient(m_profile->profileAdapter()->cookieStore());
m_proxyConfigMonitor.reset(new ProxyConfigMonitor(m_profile->GetPrefs()));
@@ -135,10 +100,10 @@ void ProfileIODataQt::initializeOnUIThread()
void ProfileIODataQt::clearHttpCache()
{
Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
- if (!m_clearHttpCacheInProgress) {
- m_clearHttpCacheInProgress = true;
+ if (m_clearHttpCacheState == Completed) {
+ m_clearHttpCacheState = Removing;
content::BrowsingDataRemover *remover =
- content::BrowserContext::GetBrowsingDataRemover(m_profileAdapter->profile());
+ m_profileAdapter->profile()->GetBrowsingDataRemover();
remover->AddObserver(&m_removerObserver);
remover->RemoveAndReply(base::Time(), base::Time::Max(),
content::BrowsingDataRemover::DATA_TYPE_CACHE,
@@ -151,7 +116,7 @@ void ProfileIODataQt::clearHttpCache()
void ProfileIODataQt::removeBrowsingDataRemoverObserver()
{
content::BrowsingDataRemover *remover =
- content::BrowserContext::GetBrowsingDataRemover(m_profileAdapter->profile());
+ m_profileAdapter->profile()->GetBrowsingDataRemover();
remover->RemoveObserver(&m_removerObserver);
}
@@ -160,11 +125,11 @@ BrowsingDataRemoverObserverQt::BrowsingDataRemoverObserverQt(ProfileIODataQt *pr
{
}
-void BrowsingDataRemoverObserverQt::OnBrowsingDataRemoverDone()
+void BrowsingDataRemoverObserverQt::OnBrowsingDataRemoverDone(uint64_t)
{
- Q_ASSERT(m_profileIOData->m_clearHttpCacheInProgress);
+ Q_ASSERT(m_profileIOData->m_clearHttpCacheState == ProfileIODataQt::Removing);
m_profileIOData->removeBrowsingDataRemoverObserver();
- m_profileIOData->m_clearHttpCacheInProgress = false;
+ m_profileIOData->m_clearHttpCacheState = ProfileIODataQt::Resetting;
m_profileIOData->resetNetworkContext();
}
@@ -177,20 +142,52 @@ void ProfileIODataQt::setFullConfiguration()
m_httpCacheType = m_profileAdapter->httpCacheType();
m_httpCachePath = m_profileAdapter->httpCachePath();
m_httpCacheMaxSize = m_profileAdapter->httpCacheMaxSize();
- m_useForGlobalCertificateVerification = m_profileAdapter->isUsedForGlobalCertificateVerification();
m_dataPath = m_profileAdapter->dataPath();
+ m_storageName = m_profileAdapter->storageName();
+ m_inMemoryOnly = m_profileAdapter->isOffTheRecord() || m_storageName.isEmpty();
}
void ProfileIODataQt::resetNetworkContext()
{
Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ Q_ASSERT(m_clearHttpCacheState != Removing);
setFullConfiguration();
- content::BrowserContext::ForEachStoragePartition(
- m_profile, base::BindRepeating([](content::StoragePartition *storage) {
+ m_profile->ForEachLoadedStoragePartition(
+ base::BindRepeating([](ProfileIODataQt *profileData,
+ content::StoragePartition *storage) {
+ storage->SetNetworkContextCreatedObserver(profileData);
+
auto storage_impl = static_cast<content::StoragePartitionImpl *>(storage);
storage_impl->ResetURLLoaderFactories();
storage_impl->ResetNetworkContext();
- }));
+ }, this));
+}
+
+void ProfileIODataQt::OnNetworkContextCreated(content::StoragePartition *storage)
+{
+ Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+
+ storage->SetNetworkContextCreatedObserver(nullptr);
+
+ if (m_clearHttpCacheState != Resetting)
+ return;
+
+ bool pendingReset = false;
+ m_profile->ForEachLoadedStoragePartition(
+ base::BindRepeating([](bool *pendingReset,
+ ProfileIODataQt *profileData,
+ content::StoragePartition *storage) {
+ if (storage->GetNetworkContextCreatedObserver() == profileData)
+ *pendingReset = true;
+ }, &pendingReset, this));
+
+ if (pendingReset)
+ return;
+
+ m_clearHttpCacheState = Completed;
+
+ for (ProfileAdapterClient *client : m_profileAdapter->clients())
+ client->clearHttpCacheCompleted();
}
bool ProfileIODataQt::canGetCookies(const QUrl &firstPartyUrl, const QUrl &url) const
@@ -208,20 +205,21 @@ ClientCertificateStoreData *ProfileIODataQt::clientCertificateStoreData()
std::unique_ptr<net::ClientCertStore> ProfileIODataQt::CreateClientCertStore()
{
#if QT_CONFIG(ssl)
- return std::unique_ptr<net::ClientCertStore>(new ClientCertOverrideStore(m_clientCertificateStoreData));
+ return std::unique_ptr<net::ClientCertStore>(new ClientCertStoreQt(m_clientCertificateStoreData));
#else
- return nullptr;
+ return std::unique_ptr<net::ClientCertStore>(new ClientCertStoreQt(nullptr));
#endif
}
-network::mojom::NetworkContextParamsPtr ProfileIODataQt::CreateNetworkContextParams()
+void ProfileIODataQt::ConfigureNetworkContextParams(bool in_memory,
+ const base::FilePath &relative_partition_path,
+ network::mojom::NetworkContextParams *network_context_params,
+ cert_verifier::mojom::CertVerifierCreationParams *cert_verifier_creation_params)
{
setFullConfiguration();
- network::mojom::NetworkContextParamsPtr network_context_params =
- SystemNetworkContextManager::GetInstance()->CreateDefaultNetworkContextParams();
+ SystemNetworkContextManager::GetInstance()->ConfigureDefaultNetworkContextParams(network_context_params, cert_verifier_creation_params);
- network_context_params->context_name = m_profile->profileAdapter()->storageName().toStdString();
network_context_params->user_agent = m_httpUserAgent.toStdString();
network_context_params->accept_language = m_httpAcceptLanguage.toStdString();
@@ -231,38 +229,31 @@ network::mojom::NetworkContextParamsPtr ProfileIODataQt::CreateNetworkContextPar
network_context_params->http_cache_enabled = m_httpCacheType != ProfileAdapter::NoCache;
network_context_params->http_cache_max_size = m_httpCacheMaxSize;
- if (m_httpCacheType == ProfileAdapter::DiskHttpCache && !m_httpCachePath.isEmpty())
- network_context_params->http_cache_path = toFilePath(m_httpCachePath);
- if (m_persistentCookiesPolicy != ProfileAdapter::NoPersistentCookies && !m_dataPath.isEmpty()) {
- base::FilePath cookie_path = toFilePath(m_dataPath);
- cookie_path = cookie_path.AppendASCII("Cookies");
- network_context_params->cookie_path = cookie_path;
-
- network_context_params->restore_old_session_cookies = m_persistentCookiesPolicy == ProfileAdapter::ForcePersistentCookies;
- network_context_params->persist_session_cookies = m_persistentCookiesPolicy != ProfileAdapter::NoPersistentCookies;
- }
- if (!m_dataPath.isEmpty()) {
- network_context_params->http_server_properties_path = toFilePath(m_dataPath).AppendASCII("Network Persistent State");
- network_context_params->transport_security_persister_path = toFilePath(m_dataPath);
+ network_context_params->persist_session_cookies = false;
+ if (!m_inMemoryOnly && !in_memory) {
+ network_context_params->file_paths =
+ network::mojom::NetworkContextFilePaths::New();
+ network_context_params->file_paths->data_directory = toFilePath(m_dataPath);
+ network_context_params->file_paths->http_server_properties_file_name = base::FilePath::FromASCII("Network Persistent State");
+ network_context_params->file_paths->transport_security_persister_file_name = base::FilePath::FromASCII("TransportSecurity");
+ network_context_params->file_paths->trust_token_database_name = base::FilePath::FromASCII("Trust Tokens");
+ if (m_httpCacheType == ProfileAdapter::DiskHttpCache && !m_httpCachePath.isEmpty())
+ network_context_params->file_paths->http_cache_directory = toFilePath(m_httpCachePath);
+ if (m_persistentCookiesPolicy != ProfileAdapter::NoPersistentCookies) {
+ network_context_params->file_paths->cookie_database_name = base::FilePath::FromASCII("Cookies");
+ network_context_params->restore_old_session_cookies = m_persistentCookiesPolicy == ProfileAdapter::ForcePersistentCookies;
+ network_context_params->persist_session_cookies = m_persistentCookiesPolicy != ProfileAdapter::NoPersistentCookies;
+ }
}
-#if !BUILDFLAG(DISABLE_FTP_SUPPORT)
- network_context_params->enable_ftp_url_support = true;
-#endif // !BUILDFLAG(DISABLE_FTP_SUPPORT)
-
-// network_context_params->enable_certificate_reporting = true;
-// network_context_params->enable_expect_ct_reporting = true;
network_context_params->enforce_chrome_ct_policy = false;
- network_context_params->primary_network_context = m_useForGlobalCertificateVerification;
// Should be initialized with existing per-profile CORS access lists.
network_context_params->cors_origin_access_list =
m_profile->GetSharedCorsOriginAccessList()->GetOriginAccessList().CreateCorsOriginAccessPatternsList();
- m_proxyConfigMonitor->AddToNetworkContextParams(network_context_params.get());
-
- return network_context_params;
+ m_proxyConfigMonitor->AddToNetworkContextParams(network_context_params);
}
// static
@@ -272,11 +263,4 @@ ProfileIODataQt *ProfileIODataQt::FromBrowserContext(content::BrowserContext *br
return static_cast<ProfileQt *>(browser_context)->m_profileIOData.get();
}
-// static
-ProfileIODataQt *ProfileIODataQt::FromResourceContext(content::ResourceContext *resource_context)
-{
- Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
- return static_cast<ResourceContextQt *>(resource_context)->m_io_data;
-}
-
} // namespace QtWebEngineCore
diff --git a/src/core/profile_io_data_qt.h b/src/core/profile_io_data_qt.h
index b0567dead..0d032e4dc 100644
--- a/src/core/profile_io_data_qt.h
+++ b/src/core/profile_io_data_qt.h
@@ -1,47 +1,11 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef PROFILE_IO_DATA_QT_H
#define PROFILE_IO_DATA_QT_H
#include "content/public/browser/browsing_data_remover.h"
-#include "chrome/browser/profiles/profile.h"
+#include "content/public/browser/storage_partition.h"
#include "extensions/buildflags/buildflags.h"
#include "net/proxy_config_monitor.h"
@@ -49,20 +13,29 @@
#include <QtCore/QString>
#include <QtCore/QPointer>
-#include <QtCore/QMutex>
+#include <QtCore/QRecursiveMutex>
-namespace net {
-class ClientCertStore;
-class URLRequestContext;
+namespace cert_verifier {
+namespace mojom {
+class CertVerifierCreationParams;
+}}
+
+namespace content {
+class ResourceContext;
}
namespace extensions {
class ExtensionSystemQt;
}
+namespace net {
+class ClientCertStore;
+}
+
namespace QtWebEngineCore {
struct ClientCertificateStoreData;
+class CookieMonsterDelegateQt;
class ProfileIODataQt;
class ProfileQt;
@@ -70,7 +43,7 @@ class BrowsingDataRemoverObserverQt : public content::BrowsingDataRemover::Obser
public:
BrowsingDataRemoverObserverQt(ProfileIODataQt *profileIOData);
- void OnBrowsingDataRemoverDone() override;
+ void OnBrowsingDataRemoverDone(uint64_t) override;
private:
ProfileIODataQt *m_profileIOData;
@@ -80,9 +53,15 @@ private:
// we still use shared memebers and use mutex which breaks
// idea for this object, but this is wip.
-class ProfileIODataQt {
+class ProfileIODataQt : public content::StoragePartition::NetworkContextCreatedObserver {
public:
+ enum ClearHttpCacheState {
+ Completed = 0,
+ Removing,
+ Resetting
+ };
+
ProfileIODataQt(ProfileQt *profile); // runs on ui thread
virtual ~ProfileIODataQt();
@@ -97,25 +76,30 @@ public:
bool canGetCookies(const QUrl &firstPartyUrl, const QUrl &url) const;
- // Used in NetworkDelegateQt::OnBeforeURLRequest.
void setFullConfiguration(); // runs on ui thread
void resetNetworkContext(); // runs on ui thread
+
void clearHttpCache(); // runs on ui thread
- bool isClearHttpCacheInProgress() { return m_clearHttpCacheInProgress; }
+ bool isClearHttpCacheInProgress() const { return m_clearHttpCacheState != Completed; }
- network::mojom::NetworkContextParamsPtr CreateNetworkContextParams();
+ void ConfigureNetworkContextParams(bool in_memory,
+ const base::FilePath &relative_partition_path,
+ network::mojom::NetworkContextParams *network_context_params,
+ cert_verifier::mojom::CertVerifierCreationParams *cert_verifier_creation_params);
#if QT_CONFIG(ssl)
ClientCertificateStoreData *clientCertificateStoreData();
#endif
std::unique_ptr<net::ClientCertStore> CreateClientCertStore();
static ProfileIODataQt *FromBrowserContext(content::BrowserContext *browser_context);
- static ProfileIODataQt *FromResourceContext(content::ResourceContext *resource_context);
base::WeakPtr<ProfileIODataQt> getWeakPtrOnIOThread();
CookieMonsterDelegateQt *cookieDelegate() const { return m_cookieDelegate.get(); }
+ // content::StoragePartition::NetworkContextCreatedObserver overrides:
+ void OnNetworkContextCreated(content::StoragePartition *storage) override; // runs on ui thread
+
private:
void removeBrowsingDataRemoverObserver();
@@ -133,19 +117,14 @@ private:
QString m_httpUserAgent;
ProfileAdapter::HttpCacheType m_httpCacheType;
QString m_httpCachePath;
-#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
- QMutex m_mutex{QMutex::Recursive};
- using QRecursiveMutex = QMutex;
-#else
+ QString m_storageName;
+ bool m_inMemoryOnly;
QRecursiveMutex m_mutex;
-#endif
int m_httpCacheMaxSize = 0;
- bool m_useForGlobalCertificateVerification = false;
BrowsingDataRemoverObserverQt m_removerObserver;
QString m_dataPath;
- bool m_clearHttpCacheInProgress = false;
+ ClearHttpCacheState m_clearHttpCacheState = Completed;
base::WeakPtrFactory<ProfileIODataQt> m_weakPtrFactory; // this should be always the last member
- DISALLOW_COPY_AND_ASSIGN(ProfileIODataQt);
friend class BrowsingDataRemoverObserverQt;
};
diff --git a/src/core/profile_qt.cpp b/src/core/profile_qt.cpp
index 748104312..293e8d557 100644
--- a/src/core/profile_qt.cpp
+++ b/src/core/profile_qt.cpp
@@ -1,84 +1,40 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "profile_qt.h"
#include "profile_adapter.h"
#include "browsing_data_remover_delegate_qt.h"
+#include "client_hints.h"
#include "download_manager_delegate_qt.h"
+#include "file_system_access/file_system_access_permission_context_factory_qt.h"
#include "net/ssl_host_state_delegate_qt.h"
#include "permission_manager_qt.h"
+#include "profile_io_data_qt.h"
#include "platform_notification_service_qt.h"
#include "qtwebenginecoreglobal_p.h"
#include "type_conversion.h"
#include "web_engine_library_info.h"
#include "web_engine_context.h"
-#include "base/barrier_closure.h"
-#include "base/time/time.h"
-#include "content/public/browser/browser_thread.h"
-#include "content/public/browser/cors_origin_pattern_setter.h"
-#include "content/public/browser/shared_cors_origin_access_list.h"
-#include "content/public/browser/storage_partition.h"
-
#include "base/base_paths.h"
+#include "base/files/file_util.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
-#include "components/prefs/pref_member.h"
#include "components/prefs/pref_service.h"
-#include "components/prefs/in_memory_pref_store.h"
-#include "components/prefs/json_pref_store.h"
-#include "components/prefs/pref_service.h"
-#include "components/prefs/pref_service_factory.h"
-#include "components/prefs/pref_registry_simple.h"
#include "components/user_prefs/user_prefs.h"
-#include "components/proxy_config/pref_proxy_config_tracker_impl.h"
-#include "chrome/common/pref_names.h"
-#if QT_CONFIG(webengine_spellchecker)
-#include "chrome/browser/spellchecker/spellcheck_service.h"
-#include "components/spellcheck/browser/pref_names.h"
-#endif
+#include "components/profile_metrics/browser_profile_type.h"
+#include "content/public/browser/browser_thread.h"
+#include "chrome/browser/push_messaging/push_messaging_app_identifier.h"
+#include "chrome/browser/push_messaging/push_messaging_service_factory.h"
+#include "chrome/browser/push_messaging/push_messaging_service_impl.h"
#if BUILDFLAG(ENABLE_EXTENSIONS)
+#include "base/command_line.h"
#include "components/guest_view/browser/guest_view_manager.h"
-#include "extensions/browser/pref_names.h"
-#include "extensions/browser/process_manager.h"
-#include "extensions/common/constants.h"
+#include "extensions/browser/extension_pref_value_map_factory.h"
+#include "extensions/browser/extension_prefs.h"
+#include "extensions/browser/extension_prefs_factory.h"
+#include "extensions/browser/extensions_browser_client.h"
#include "extensions/extension_system_qt.h"
#endif
@@ -86,13 +42,17 @@
namespace QtWebEngineCore {
ProfileQt::ProfileQt(ProfileAdapter *profileAdapter)
- : m_sharedCorsOriginAccessList(content::SharedCorsOriginAccessList::Create())
- , m_profileIOData(new ProfileIODataQt(this))
+ : m_profileIOData(new ProfileIODataQt(this))
, m_profileAdapter(profileAdapter)
+ , m_userAgentMetadata(embedder_support::GetUserAgentMetadata())
#if BUILDFLAG(ENABLE_EXTENSIONS)
, m_extensionSystem(nullptr)
#endif // BUILDFLAG(ENABLE_EXTENSIONS)
{
+ profile_metrics::SetBrowserProfileType(this, IsOffTheRecord()
+ ? profile_metrics::BrowserProfileType::kIncognito
+ : profile_metrics::BrowserProfileType::kRegular);
+
setupPrefService();
// Mark the context as live. This prevents the use-after-free DCHECK in
@@ -111,14 +71,21 @@ ProfileQt::~ProfileQt()
{
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
m_prefServiceAdapter.commit();
- content::BrowserContext::NotifyWillBeDestroyed(this);
BrowserContextDependencyManager::GetInstance()->DestroyBrowserContextServices(this);
+ // Remembering push subscriptions and not persisting notification permissions would
+ // confuse most of web applications.
+ PushMessagingAppIdentifier::DeleteAllFromPrefs(this);
ShutdownStoragePartitions();
m_profileIOData->shutdownOnUIThread();
//Should be deleted by IO Thread
m_profileIOData.release();
}
+void ProfileQt::DoFinalInit()
+{
+ PushMessagingServiceImpl::InitializeForProfile(this);
+}
+
PrefService* ProfileQt::GetPrefs()
{
return m_prefServiceAdapter.prefService();
@@ -129,6 +96,11 @@ const PrefService* ProfileQt::GetPrefs() const
return m_prefServiceAdapter.prefService();
}
+bool ProfileQt::IsNewProfile() const
+{
+ return GetPrefs()->GetInitializationStatus() == PrefService::INITIALIZATION_STATUS_CREATED_NEW_PREF_STORE;
+}
+
base::FilePath ProfileQt::GetPath()
{
return toFilePath(m_profileAdapter->dataPath());
@@ -171,7 +143,10 @@ storage::SpecialStoragePolicy *ProfileQt::GetSpecialStoragePolicy()
content::PushMessagingService *ProfileQt::GetPushMessagingService()
{
- return nullptr;
+ if (m_profileAdapter->pushServiceEnabled())
+ return PushMessagingServiceFactory::GetForProfile(this);
+ else
+ return nullptr;
}
content::SSLHostStateDelegate* ProfileQt::GetSSLHostStateDelegate()
@@ -212,7 +187,7 @@ content::PermissionControllerDelegate *ProfileQt::GetPermissionControllerDelegat
content::ClientHintsControllerDelegate *ProfileQt::GetClientHintsControllerDelegate()
{
- return nullptr;
+ return ClientHintsFactory::GetForBrowserContext(this);
}
content::StorageNotificationService *ProfileQt::GetStorageNotificationService()
@@ -220,32 +195,9 @@ content::StorageNotificationService *ProfileQt::GetStorageNotificationService()
return nullptr;
}
-void ProfileQt::SetCorsOriginAccessListForOrigin(const url::Origin &source_origin,
- std::vector<network::mojom::CorsOriginPatternPtr> allow_patterns,
- std::vector<network::mojom::CorsOriginPatternPtr> block_patterns,
- base::OnceClosure closure)
+content::ReduceAcceptLanguageControllerDelegate *ProfileQt::GetReduceAcceptLanguageControllerDelegate()
{
- auto barrier_closure = base::BarrierClosure(2, std::move(closure));
-
- // Keep profile storage partitions' NetworkContexts synchronized.
- auto profile_setter = base::MakeRefCounted<content::CorsOriginPatternSetter>(
- source_origin,
- content::CorsOriginPatternSetter::ClonePatterns(allow_patterns),
- content::CorsOriginPatternSetter::ClonePatterns(block_patterns),
- barrier_closure);
- ForEachStoragePartition(this,
- base::BindRepeating(&content::CorsOriginPatternSetter::SetLists,
- base::RetainedRef(profile_setter.get())));
-
- m_sharedCorsOriginAccessList->SetForOrigin(source_origin,
- std::move(allow_patterns),
- std::move(block_patterns),
- barrier_closure);
-}
-
-content::SharedCorsOriginAccessList *ProfileQt::GetSharedCorsOriginAccessList()
-{
- return m_sharedCorsOriginAccessList.get();
+ return nullptr;
}
#if QT_CONFIG(webengine_spellchecker)
@@ -269,16 +221,43 @@ std::string ProfileQt::GetMediaDeviceIDSalt()
return m_prefServiceAdapter.mediaDeviceIdSalt();
}
+content::FileSystemAccessPermissionContext *ProfileQt::GetFileSystemAccessPermissionContext()
+{
+ return FileSystemAccessPermissionContextFactoryQt::GetForProfile(this);
+}
+
void ProfileQt::setupPrefService()
{
+ const bool recreation = m_prefServiceAdapter.prefService() != nullptr;
+ profile_metrics::SetBrowserProfileType(this,
+ IsOffTheRecord()
+ ? profile_metrics::BrowserProfileType::kIncognito
+ : profile_metrics::BrowserProfileType::kRegular);
+
// Remove previous handler before we set a new one or we will assert
// TODO: Remove in Qt6
- if (m_prefServiceAdapter.prefService() != nullptr) {
+ if (recreation) {
user_prefs::UserPrefs::Remove(this);
m_prefServiceAdapter.commit();
}
m_prefServiceAdapter.setup(*m_profileAdapter);
user_prefs::UserPrefs::Set(this, m_prefServiceAdapter.prefService());
+
+#if BUILDFLAG(ENABLE_EXTENSIONS)
+ if (recreation) {
+ // Recreate ExtensionPrefs to update its pointer to the new PrefService
+ extensions::ExtensionsBrowserClient *client = extensions::ExtensionsBrowserClient::Get();
+ std::vector<extensions::EarlyExtensionPrefsObserver *> prefsObservers;
+ client->GetEarlyExtensionPrefsObservers(this, &prefsObservers);
+ auto extensionPrefs = extensions::ExtensionPrefs::Create(
+ this, client->GetPrefServiceForContext(this),
+ this->GetPath().AppendASCII(extensions::kInstallDirectoryName),
+ ExtensionPrefValueMapFactory::GetForBrowserContext(this),
+ client->AreExtensionsDisabled(*base::CommandLine::ForCurrentProcess(), this),
+ prefsObservers);
+ extensions::ExtensionPrefsFactory::GetInstance()->SetInstanceForTesting(this, std::move(extensionPrefs));
+ }
+#endif
}
PrefServiceAdapter &ProfileQt::prefServiceAdapter()
@@ -291,8 +270,12 @@ const PrefServiceAdapter &ProfileQt::prefServiceAdapter() const
return m_prefServiceAdapter;
}
+const blink::UserAgentMetadata &ProfileQt::userAgentMetadata()
+{
+ return m_userAgentMetadata;
+}
-content::PlatformNotificationService *ProfileQt::platformNotificationService()
+content::PlatformNotificationService *ProfileQt::GetPlatformNotificationService()
{
if (!m_platformNotificationService)
m_platformNotificationService = std::make_unique<PlatformNotificationServiceQt>(this);
diff --git a/src/core/profile_qt.h b/src/core/profile_qt.h
index 59f5a8c21..b5cd08db1 100644
--- a/src/core/profile_qt.h
+++ b/src/core/profile_qt.h
@@ -1,59 +1,20 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef PROFILE_QT_H
#define PROFILE_QT_H
#include "chrome/browser/profiles/profile.h"
-#include "content/public/browser/content_browser_client.h"
-#include "content/public/browser/resource_context.h"
+#include "components/embedder_support/user_agent_utils.h"
#include "extensions/buildflags/buildflags.h"
#include "pref_service_adapter.h"
-#include "profile_io_data_qt.h"
-#include <QtGlobal>
-QT_BEGIN_NAMESPACE
-class QStringList;
-QT_END_NAMESPACE
-class InMemoryPrefStore;
class PrefService;
+namespace content {
+class ResourceContext;
+}
+
namespace extensions {
class ExtensionSystemQt;
}
@@ -61,8 +22,9 @@ class ExtensionSystemQt;
namespace QtWebEngineCore {
class BrowsingDataRemoverDelegateQt;
-class ProfileAdapter;
class PermissionManagerQt;
+class ProfileAdapter;
+class ProfileIODataQt;
class SSLHostStateDelegateQt;
class ProfileQt : public Profile
@@ -92,21 +54,18 @@ public:
content::BrowsingDataRemoverDelegate *GetBrowsingDataRemoverDelegate() override;
content::ClientHintsControllerDelegate *GetClientHintsControllerDelegate() override;
content::StorageNotificationService *GetStorageNotificationService() override;
- void SetCorsOriginAccessListForOrigin(const url::Origin &source_origin,
- std::vector<network::mojom::CorsOriginPatternPtr> allow_patterns,
- std::vector<network::mojom::CorsOriginPatternPtr> block_patterns,
- base::OnceClosure closure) override;
- content::SharedCorsOriginAccessList *GetSharedCorsOriginAccessList() override;
- std::string GetMediaDeviceIDSalt() override;
+ content::PlatformNotificationService *GetPlatformNotificationService() override;
+ content::FileSystemAccessPermissionContext *GetFileSystemAccessPermissionContext() override;
+ content::ReduceAcceptLanguageControllerDelegate *GetReduceAcceptLanguageControllerDelegate() override;
// Profile implementation:
PrefService *GetPrefs() override;
const PrefService *GetPrefs() const override;
+ bool IsNewProfile() const override;
- void Initialize();
+ void DoFinalInit();
ProfileAdapter *profileAdapter() { return m_profileAdapter; }
-
- content::PlatformNotificationService *platformNotificationService();
+ std::string GetMediaDeviceIDSalt();
#if QT_CONFIG(webengine_spellchecker)
void FailedToLoadDictionary(const std::string &language) override;
@@ -120,29 +79,26 @@ public:
void setupPrefService();
PrefServiceAdapter &prefServiceAdapter();
-
const PrefServiceAdapter &prefServiceAdapter() const;
+ const blink::UserAgentMetadata &userAgentMetadata();
+
private:
- friend class ContentBrowserClientQt;
- friend class ProfileIODataQt;
- friend class WebContentsAdapter;
std::unique_ptr<BrowsingDataRemoverDelegateQt> m_removerDelegate;
std::unique_ptr<PermissionManagerQt> m_permissionManager;
std::unique_ptr<SSLHostStateDelegateQt> m_sslHostStateDelegate;
- scoped_refptr<content::SharedCorsOriginAccessList> m_sharedCorsOriginAccessList;
std::unique_ptr<ProfileIODataQt> m_profileIOData;
std::unique_ptr<content::PlatformNotificationService> m_platformNotificationService;
ProfileAdapter *m_profileAdapter;
PrefServiceAdapter m_prefServiceAdapter;
+ blink::UserAgentMetadata m_userAgentMetadata;
- friend class ProfileAdapter;
#if BUILDFLAG(ENABLE_EXTENSIONS)
extensions::ExtensionSystemQt *m_extensionSystem;
#endif //ENABLE_EXTENSIONS
- friend class BrowserContextAdapter;
- DISALLOW_COPY_AND_ASSIGN(ProfileQt);
+ friend class ProfileAdapter;
+ friend class ProfileIODataQt;
};
} // namespace QtWebEngineCore
diff --git a/src/core/qtwebengine.gni b/src/core/qtwebengine.gni
deleted file mode 100644
index a5628bb88..000000000
--- a/src/core/qtwebengine.gni
+++ /dev/null
@@ -1,75 +0,0 @@
-import("//build/config/ui.gni")
-import("//media/media_options.gni")
-import("//extensions/buildflags/buildflags.gni")
-import("//third_party/widevine/cdm/widevine.gni")
-import("//ui/ozone/ozone.gni")
-
-chromium_version = exec_script("//build/util/version.py", [ "-f", rebase_path("//chrome/VERSION"),
- "-t", "@MAJOR@.@MINOR@.@BUILD@.@PATCH@"],
- "list lines")
-
-include_dirs = [
- "//skia/config",
- "//third_party",
- "//third_party/boringssl/src/include",
- "//third_party/skia/include/core"
-]
-
-deps = [
- "//base",
- "//components/cdm/renderer",
- "//components/error_page/common",
- "//components/keyed_service/content",
- "//components/navigation_interception",
- "//components/network_hints/browser",
- "//components/network_hints/common:mojo_bindings",
- "//components/network_hints/renderer",
- "//components/visitedlink/browser",
- "//components/visitedlink/renderer",
- "//components/web_cache/browser",
- "//components/web_cache/renderer",
- "//components/spellcheck:buildflags",
- "//components/proxy_config",
- "//components/user_prefs",
- "//content/public/app:browser",
- "//content",
- "//media:media_buildflags",
- "//net",
- "//services/proxy_resolver:lib",
- "//skia",
- "//third_party/blink/public:blink",
- "//ui/accessibility",
- "//ui/gl",
- "//qtwebengine/browser:interfaces",
- "//qtwebengine/browser:service_manifests",
- "//qtwebengine/common:mojo_bindings",
- ":qtwebengine_sources",
- ":qtwebengine_resources",
-]
-
-if (enable_webrtc) {
- deps += [ "//third_party/webrtc_overrides:webrtc_component" ]
-}
-
-if (use_ozone) {
- _ozone_extra_directory = get_path_info(ozone_extra_path, "dir")
- deps += [ "$_ozone_extra_directory:qt" ]
-}
-
-if (use_xscrnsaver) {
- deps += [ "//ui/base/x" ]
-}
-
-if (enable_extensions) {
- deps += [
- ":qtwebengine_extensions_features"
- ]
-}
-
-if (is_win) {
- data_deps = [ ":qtwebengine_sandbox_win" ]
-}
-
-defines = [
- "CHROMIUM_VERSION=\"" + chromium_version[0] + "\""
-]
diff --git a/src/core/qtwebengine_resources.gni b/src/core/qtwebengine_resources.gni
deleted file mode 100644
index 4f6c51d81..000000000
--- a/src/core/qtwebengine_resources.gni
+++ /dev/null
@@ -1,140 +0,0 @@
-import("//tools/grit/repack.gni")
-import("//build/config/locales.gni")
-import("//chrome/chrome_repack_locales.gni")
-import("//extensions/buildflags/buildflags.gni")
-
-group("qtwebengine_resources") {
- deps = [
- "//chrome/app:generated_resources",
- "//chrome/browser:resources",
- "//chrome/browser/resources:component_extension_resources",
- "//chrome/common:resources",
- "//components/resources:components_resources",
- ":qtwebengine_repack_resources",
- ":qtwebengine_repack_resources_100",
- ":qtwebengine_repack_resources_200",
- ":qtwebengine_repack_resources_devtools",
- ":qtwebengine_repack_locales_pack"
- ]
-}
-
-repack("qtwebengine_repack_resources") {
- sources = [
- "$root_gen_dir/qtwebengine/qt_webengine_resources.pak",
- "$root_gen_dir/chrome/browser_resources.pak",
- "$root_gen_dir/chrome/common_resources.pak",
- "$root_gen_dir/chrome/quota_internals_resources.pak",
- "$root_gen_dir/components/components_resources.pak",
- "$root_gen_dir/content/browser/resources/media/media_internals_resources.pak",
- "$root_gen_dir/content/content_resources.pak",
- "$root_gen_dir/mojo/public/js/mojo_bindings_resources.pak",
- "$root_gen_dir/net/net_resources.pak",
- "$root_gen_dir/third_party/blink/public/resources/blink_resources.pak",
- "$root_gen_dir/ui/resources/webui_resources.pak",
- ]
- output = "$root_out_dir/qtwebengine_resources.pak"
- deps = [
- "//qtwebengine/browser:qt_webengine_resources",
- "//chrome/browser/resources/quota_internals:quota_internals_resources",
- "//chrome/browser:resources_grit",
- "//chrome/common:resources_grit",
- "//components/resources:components_resources_grit",
- "//content/browser/resources/media:media_internals_resources",
- "//content:resources_grit",
- "//mojo/public/js:resources",
- "//net:net_resources_grit",
- "//third_party/blink/public:resources_grit",
- "//ui/resources:webui_resources_grd_grit",
- ]
-
- if (enable_extensions) {
- sources += [
- "$root_gen_dir/chrome/component_extension_resources.pak",
- "$root_gen_dir/extensions/extensions_renderer_resources.pak",
- "$root_gen_dir/extensions/extensions_resources.pak",
- ]
- deps += [
- "//chrome/browser/resources:component_extension_resources_grit",
- "//extensions:extensions_renderer_resources_grit",
- "//extensions:extensions_resources_grd_grit",
- ]
- }
-
- if (enable_webrtc) {
- sources += [
- "$root_gen_dir/content/browser/webrtc/resources/webrtc_internals_resources.pak",
- ]
- deps += [
- "//content/browser/webrtc/resources",
- ]
- }
-}
-
-repack("qtwebengine_repack_resources_100") {
- sources = [
- "$root_gen_dir/components/components_resources_100_percent.pak",
- "$root_gen_dir/content/app/resources/content_resources_100_percent.pak",
- "$root_gen_dir/chrome/renderer_resources_100_percent.pak",
- "$root_gen_dir/third_party/blink/public/resources/blink_scaled_resources_100_percent.pak",
- "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
- ]
- output = "$root_out_dir/qtwebengine_resources_100p.pak"
- deps = [
- "//chrome/renderer:resources_grit",
- "//components/resources:components_scaled_resources_grit",
- "//content/app/resources:resources_grit",
- "//third_party/blink/public:scaled_resources_100_percent",
- "//ui/resources:ui_resources_grd_grit"
- ]
- if (enable_extensions) {
- sources += [
- "$root_gen_dir/extensions/extensions_browser_resources_100_percent.pak"
- ]
- deps += [
- "//extensions:extensions_browser_resources_grit"
- ]
- }
-}
-
-repack("qtwebengine_repack_resources_200") {
- sources = [
- "$root_gen_dir/components/components_resources_200_percent.pak",
- "$root_gen_dir/content/app/resources/content_resources_200_percent.pak",
- "$root_gen_dir/chrome/renderer_resources_200_percent.pak",
- "$root_gen_dir/third_party/blink/public/resources/blink_scaled_resources_200_percent.pak",
- "$root_gen_dir/ui/resources/ui_resources_200_percent.pak",
- ]
- output = "$root_out_dir/qtwebengine_resources_200p.pak"
- deps = [
- "//chrome/renderer:resources_grit",
- "//components/resources:components_scaled_resources_grit",
- "//content/app/resources:resources_grit",
- "//third_party/blink/public:scaled_resources_200_percent",
- "//ui/resources:ui_resources_grd_grit"
- ]
- if (enable_extensions) {
- sources += [
- "$root_gen_dir/extensions/extensions_browser_resources_200_percent.pak"
- ]
- deps += [
- "//extensions:extensions_browser_resources_grit"
- ]
- }
-}
-
-repack("qtwebengine_repack_resources_devtools") {
- sources = [
- "$root_gen_dir/content/browser/devtools/devtools_resources.pak",
- ]
- output = "$root_out_dir/qtwebengine_devtools_resources.pak"
- deps = [
- "//content/browser/devtools:devtools_resources_grit",
- ]
-}
-
-chrome_repack_locales("qtwebengine_repack_locales_pack") {
- input_locales = locales
- output_dir = "$root_out_dir/qtwebengine_locales"
- output_locales = locales
-}
-
diff --git a/src/core/qtwebengine_sources.gni b/src/core/qtwebengine_sources.gni
deleted file mode 100644
index 3a39455c3..000000000
--- a/src/core/qtwebengine_sources.gni
+++ /dev/null
@@ -1,194 +0,0 @@
-import("//build/config/features.gni")
-import("//build/config/ui.gni")
-import("//chrome/common/features.gni")
-import("//components/spellcheck/spellcheck_build_features.gni")
-import("//pdf/features.gni")
-import("//ppapi/buildflags/buildflags.gni")
-import("//printing/buildflags/buildflags.gni")
-import("//extensions/buildflags/buildflags.gni")
-
-source_set("qtwebengine_spellcheck_sources") {
- include_dirs = core_include_dirs
- configs += [
- "//third_party/boringssl:external_config",
- ]
- sources = [
- "//chrome/browser/spellchecker/spell_check_host_chrome_impl.cc",
- "//chrome/browser/spellchecker/spell_check_host_chrome_impl.h",
- "//chrome/browser/spellchecker/spellcheck_custom_dictionary.cc",
- "//chrome/browser/spellchecker/spellcheck_custom_dictionary.h",
- "//chrome/browser/spellchecker/spellcheck_factory.cc",
- "//chrome/browser/spellchecker/spellcheck_factory.h",
- "//chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc",
- "//chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h",
- "//chrome/browser/spellchecker/spellcheck_service.cc",
- "//chrome/browser/spellchecker/spellcheck_service.h",
- "//components/language/core/browser/pref_names.cc",
- "//components/language/core/browser/pref_names.h",
- ]
- deps = [
- "//components/spellcheck/browser",
- "//components/spellcheck/renderer",
- "//third_party/blink/public:blink",
- "//third_party/hunspell",
- ]
- if (is_mac && use_browser_spellchecker) {
- sources += [
- "//chrome/browser/spellchecker/spell_check_host_chrome_impl_mac.cc",
- ]
- }
-}
-
-source_set("qtwebengine_sources") {
- configs += [
- "//skia:skia_config",
- "//third_party/boringssl:external_config",
- ]
-
- deps = [
- "//build:branding_buildflags",
- "//chrome/browser/resources/quota_internals:quota_internals_resources",
- "//chrome/common:buildflags",
- "//components/nacl/common:buildflags",
- "//components/plugins/renderer/",
- "//extensions/buildflags:buildflags",
- "//rlz/buildflags:buildflags",
- "//third_party/blink/public/mojom:mojom_platform",
- ]
-
- sources = [
- "//chrome/browser/accessibility/accessibility_ui.cc",
- "//chrome/browser/accessibility/accessibility_ui.h",
- "//chrome/browser/custom_handlers/protocol_handler_registry.cc",
- "//chrome/browser/custom_handlers/protocol_handler_registry.h",
- "//chrome/browser/custom_handlers/protocol_handler_registry_factory.cc",
- "//chrome/browser/custom_handlers/protocol_handler_registry_factory.h",
- "//chrome/browser/media/webrtc/desktop_media_list.h",
- "//chrome/browser/net/chrome_mojo_proxy_resolver_factory.cc",
- "//chrome/browser/net/chrome_mojo_proxy_resolver_factory.h",
- "//chrome/browser/prefs/chrome_command_line_pref_store.cc",
- "//chrome/browser/prefs/chrome_command_line_pref_store.h",
- "//chrome/browser/profiles/profile.cc",
- "//chrome/browser/profiles/profile.h",
- "//chrome/browser/ui/webui/devtools_ui.cc",
- "//chrome/browser/ui/webui/devtools_ui.h",
- "//chrome/browser/ui/webui/devtools_ui_data_source.cc",
- "//chrome/browser/ui/webui/devtools_ui_data_source.h",
- "//chrome/browser/ui/webui/quota_internals/quota_internals_handler.cc",
- "//chrome/browser/ui/webui/quota_internals/quota_internals_handler.h",
- "//chrome/browser/ui/webui/quota_internals/quota_internals_proxy.cc",
- "//chrome/browser/ui/webui/quota_internals/quota_internals_proxy.h",
- "//chrome/browser/ui/webui/quota_internals/quota_internals_types.cc",
- "//chrome/browser/ui/webui/quota_internals/quota_internals_types.h",
- "//chrome/browser/ui/webui/quota_internals/quota_internals_ui.cc",
- "//chrome/browser/ui/webui/quota_internals/quota_internals_ui.h",
- "//chrome/common/custom_handlers/protocol_handler.cc",
- "//chrome/common/custom_handlers/protocol_handler.h",
- "//chrome/common/chrome_switches.cc",
- "//chrome/common/chrome_switches.h",
- "//chrome/common/pref_names.cc",
- "//chrome/common/pref_names.h",
- "//chrome/common/url_constants.cc",
- "//chrome/common/url_constants.h",
- "//chrome/common/webui_url_constants.cc",
- "//chrome/common/webui_url_constants.h",
- ]
-
- if (enable_extensions) {
- deps += [
- ":qtwebengine_extensions_features",
- "//chrome/app:generated_resources",
- "//chrome/browser/resources:component_extension_resources_grit",
- "//chrome/common/extensions/api",
- "//chrome/common/extensions/api:extensions_features",
- "//components/crx_file",
- "//components/crx_file:crx_creator",
- "//components/spellcheck:buildflags",
- "//extensions/buildflags:buildflags",
- "//extensions/common",
- "//extensions/common/api",
- "//extensions/common:core_api_provider",
- "//extensions/browser",
- "//extensions/browser/api",
- "//extensions/browser:core_api_provider",
- "//extensions/renderer",
- "//extensions:extensions_resources",
- "//extensions/strings",
- ]
- sources += [
- "//chrome/common/extensions/permissions/chrome_api_permissions.cc",
- "//chrome/common/extensions/permissions/chrome_api_permissions.h",
- "//chrome/common/extensions/permissions/chrome_permission_message_provider.cc",
- "//chrome/common/extensions/permissions/chrome_permission_message_provider.h",
- "//chrome/common/extensions/permissions/chrome_permission_message_rules.cc",
- "//chrome/common/extensions/permissions/chrome_permission_message_rules.h",
- ]
- } else {
- deps += [
- "//extensions/common:common_constants",
- ]
- sources += [
- "//extensions/common/url_pattern.cc",
- "//extensions/common/url_pattern.h",
- ]
- }
-
- if (is_linux) {
- sources += [
- "//chrome/browser/ui/webui/sandbox/sandbox_internals_ui.cc",
- "//chrome/browser/ui/webui/sandbox/sandbox_internals_ui.h",
- ]
- }
-
- if (enable_spellcheck) {
- deps += [
- ":qtwebengine_spellcheck_sources",
- "//chrome/tools/convert_dict",
- ]
- }
-
- if (enable_plugins) {
- sources += [
- "//chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.cc",
- "//chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.h",
- "//chrome/renderer/pepper/pepper_flash_font_file_host.cc",
- "//chrome/renderer/pepper/pepper_flash_font_file_host.h",
- "//chrome/renderer/pepper/pepper_shared_memory_message_filter.cc",
- "//chrome/renderer/pepper/pepper_shared_memory_message_filter.h",
- ]
- }
-
- if (enable_basic_printing || enable_print_preview) {
- sources += [
- "//chrome/browser/printing/printer_query.cc",
- "//chrome/browser/printing/printer_query.h",
- "//chrome/browser/printing/print_job.cc",
- "//chrome/browser/printing/print_job.h",
- "//chrome/browser/printing/print_job_manager.cc",
- "//chrome/browser/printing/print_job_manager.h",
- "//chrome/browser/printing/print_job_worker.cc",
- "//chrome/browser/printing/print_job_worker.h",
- ]
- deps += [
- "//printing/buildflags:buildflags",
- ]
- }
-
- if (enable_pdf) {
- deps += [
- "//pdf",
- "//pdf:buildflags",
- "//components/pdf/browser:browser",
- "//components/pdf/renderer:renderer",
- "//components/printing/browser",
- "//components/printing/renderer",
- ]
- }
-}
-
-if (is_win) {
- shared_library("qtwebengine_sandbox_win") {
- create_pri_file = true
- public_deps = [ "//sandbox/win:sandbox" ]
- }
-}
diff --git a/src/core/quota_permission_context_qt.cpp b/src/core/quota_permission_context_qt.cpp
deleted file mode 100644
index 94645b237..000000000
--- a/src/core/quota_permission_context_qt.cpp
+++ /dev/null
@@ -1,110 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "quota_permission_context_qt.h"
-
-#include "base/task/post_task.h"
-#include "content/browser/web_contents/web_contents_impl.h"
-#include "content/public/browser/browser_task_traits.h"
-#include "content/public/browser/browser_thread.h"
-#include "content/public/browser/render_frame_host.h"
-#include "quota_request_controller_impl.h"
-#include "qwebenginequotarequest.h"
-#include "web_contents_delegate_qt.h"
-#include "web_contents_view_qt.h"
-
-using content::QuotaPermissionContext;
-using content::RenderFrameHost;
-using content::StorageQuotaParams;
-using content::WebContents;
-
-namespace QtWebEngineCore {
-
-void QuotaPermissionContextQt::RequestQuotaPermission(const StorageQuotaParams &params, int render_process_id, const PermissionCallback &callback)
-{
- if (params.storage_type != blink::mojom::StorageType::kPersistent) {
- // For now we only support requesting quota with this interface
- // for Persistent storage type.
- callback.Run(QUOTA_PERMISSION_RESPONSE_DISALLOW);
- return;
- }
-
- if (!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) {
- base::PostTask(
- FROM_HERE, {content::BrowserThread::UI},
- base::BindOnce(&QuotaPermissionContextQt::RequestQuotaPermission, this,
- params, render_process_id, callback));
- return;
- }
-
- RenderFrameHost *renderFrameHost = RenderFrameHost::FromID(render_process_id, params.render_frame_id);
- if (!renderFrameHost)
- return;
-
- WebContents *webContents = WebContents::FromRenderFrameHost(renderFrameHost);
- if (!webContents)
- return;
-
- WebContentsAdapterClient *client = WebContentsViewQt::from(static_cast<content::WebContentsImpl *>(webContents)->GetView())->client();
- if (!client)
- return;
-
- QWebEngineQuotaRequest request(
- QSharedPointer<QuotaRequestControllerImpl>::create(this, params, callback));
- client->runQuotaRequest(std::move(request));
-}
-
-void QuotaPermissionContextQt::dispatchCallbackOnIOThread(const PermissionCallback &callback,
- QuotaPermissionContext::QuotaPermissionResponse response)
-{
- if (callback.is_null())
- return;
-
- if (!content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)) {
- base::PostTask(
- FROM_HERE, {content::BrowserThread::IO},
- base::BindOnce(&QuotaPermissionContextQt::dispatchCallbackOnIOThread,
- this, callback, response));
- return;
- }
-
- callback.Run(response);
-}
-
-} // namespace QtWebEngineCore
diff --git a/src/core/quota_permission_context_qt.h b/src/core/quota_permission_context_qt.h
deleted file mode 100644
index 99e07eec7..000000000
--- a/src/core/quota_permission_context_qt.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QUOTA_PERMISSION_CONTEXT_QT_H
-#define QUOTA_PERMISSION_CONTEXT_QT_H
-
-#include "content/public/browser/quota_permission_context.h"
-
-#include <QtCore/qcompilerdetection.h> // Needed for override
-
-namespace QtWebEngineCore {
-
-class QuotaPermissionContextQt : public content::QuotaPermissionContext {
-public:
- void RequestQuotaPermission(const content::StorageQuotaParams &params,
- int render_process_id,
- const PermissionCallback &callback) override;
-
- void dispatchCallbackOnIOThread(const PermissionCallback &callback,
- QuotaPermissionContext::QuotaPermissionResponse response);
-};
-
-} // namespace QtWebEngineCore
-
-#endif // QUOTA_PERMISSION_CONTEXT_QT_H
diff --git a/src/core/quota_request_controller.h b/src/core/quota_request_controller.h
deleted file mode 100644
index 0bb0cbff3..000000000
--- a/src/core/quota_request_controller.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QUOTA_REQUEST_CONTROLLER_H
-#define QUOTA_REQUEST_CONTROLLER_H
-
-#include "request_controller.h"
-
-namespace QtWebEngineCore {
-
-class QuotaRequestController : public RequestController {
-public:
- QuotaRequestController(QUrl origin, qint64 requestedSize)
- : RequestController(std::move(origin))
- , m_requestedSize(requestedSize)
- {}
-
- qint64 requestedSize() const { return m_requestedSize; }
-
-private:
- qint64 m_requestedSize;
-};
-
-} // namespace QtWebEngineCore
-
-#endif // QUOTA_REQUEST_CONTROLLER_H
diff --git a/src/core/quota_request_controller_impl.cpp b/src/core/quota_request_controller_impl.cpp
deleted file mode 100644
index a18ad761d..000000000
--- a/src/core/quota_request_controller_impl.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "quota_request_controller_impl.h"
-
-#include "type_conversion.h"
-
-namespace QtWebEngineCore {
-
-QuotaRequestControllerImpl::QuotaRequestControllerImpl(
- QuotaPermissionContextQt *context,
- const content::StorageQuotaParams &params,
- const content::QuotaPermissionContext::PermissionCallback &callback)
- : QuotaRequestController(
- toQt(params.origin_url),
- params.requested_size)
- , m_context(context)
- , m_callback(callback)
-{}
-
-QuotaRequestControllerImpl::~QuotaRequestControllerImpl()
-{
- reject();
-}
-
-void QuotaRequestControllerImpl::accepted()
-{
- m_context->dispatchCallbackOnIOThread(m_callback, QuotaPermissionContextQt::QUOTA_PERMISSION_RESPONSE_ALLOW);
-}
-
-void QuotaRequestControllerImpl::rejected()
-{
- m_context->dispatchCallbackOnIOThread(m_callback, QuotaPermissionContextQt::QUOTA_PERMISSION_RESPONSE_DISALLOW);
-}
-
-} // namespace QtWebEngineCore
diff --git a/src/core/quota_request_controller_impl.h b/src/core/quota_request_controller_impl.h
deleted file mode 100644
index 5814895f3..000000000
--- a/src/core/quota_request_controller_impl.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QUOTA_REQUEST_CONTROLLER_IMPL_H
-#define QUOTA_REQUEST_CONTROLLER_IMPL_H
-
-#include "quota_permission_context_qt.h"
-#include "quota_request_controller.h"
-
-namespace QtWebEngineCore {
-
-class QuotaRequestControllerImpl final : public QuotaRequestController {
-public:
- QuotaRequestControllerImpl(
- QuotaPermissionContextQt *context,
- const content::StorageQuotaParams &params,
- const content::QuotaPermissionContext::PermissionCallback &callback);
-
- ~QuotaRequestControllerImpl();
-
-protected:
- void accepted() override;
- void rejected() override;
-
-private:
- scoped_refptr<QuotaPermissionContextQt> m_context;
- content::QuotaPermissionContext::PermissionCallback m_callback;
-};
-
-} // namespace QtWebEngineCore
-
-#endif // QUOTA_REQUEST_CONTROLLER_IMPL_H
diff --git a/src/core/register_protocol_handler_request_controller.h b/src/core/register_protocol_handler_request_controller.h
deleted file mode 100644
index 2f9c9fc49..000000000
--- a/src/core/register_protocol_handler_request_controller.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef REGISTER_PROTOCOL_HANDLER_REQUEST_CONTROLLER_H
-#define REGISTER_PROTOCOL_HANDLER_REQUEST_CONTROLLER_H
-
-#include "request_controller.h"
-
-namespace QtWebEngineCore {
-
-class RegisterProtocolHandlerRequestController : public RequestController {
-public:
- RegisterProtocolHandlerRequestController(QUrl origin, QString scheme)
- : RequestController(std::move(origin))
- , m_scheme(std::move(scheme))
- {}
-
- QString scheme() const { return m_scheme; }
-
-private:
- QString m_scheme;
-};
-
-} // namespace QtWebEngineCore
-
-#endif // REGISTER_PROTOCOL_HANDLER_REQUEST_CONTROLLER_H
diff --git a/src/core/register_protocol_handler_request_controller_impl.cpp b/src/core/register_protocol_handler_request_controller_impl.cpp
deleted file mode 100644
index 0f24d8812..000000000
--- a/src/core/register_protocol_handler_request_controller_impl.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "register_protocol_handler_request_controller_impl.h"
-
-#include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h"
-#include "content/public/browser/web_contents.h"
-#include "type_conversion.h"
-
-namespace QtWebEngineCore {
-
-RegisterProtocolHandlerRequestControllerImpl::RegisterProtocolHandlerRequestControllerImpl(
- content::WebContents *webContents,
- ProtocolHandler handler)
- : RegisterProtocolHandlerRequestController(
- toQt(handler.url()),
- toQt(handler.protocol()))
- , content::WebContentsObserver(webContents)
- , m_handler(handler)
-{}
-
-RegisterProtocolHandlerRequestControllerImpl::~RegisterProtocolHandlerRequestControllerImpl()
-{
- reject();
-}
-
-ProtocolHandlerRegistry *RegisterProtocolHandlerRequestControllerImpl::protocolHandlerRegistry()
-{
- content::WebContents *webContents = web_contents();
- if (!webContents)
- return nullptr;
- content::BrowserContext *context = webContents->GetBrowserContext();
- return ProtocolHandlerRegistryFactory::GetForBrowserContext(context);
-}
-
-void RegisterProtocolHandlerRequestControllerImpl::accepted()
-{
- if (ProtocolHandlerRegistry *registry = protocolHandlerRegistry())
- registry->OnAcceptRegisterProtocolHandler(m_handler);
-}
-
-void RegisterProtocolHandlerRequestControllerImpl::rejected()
-{
- if (ProtocolHandlerRegistry *registry = protocolHandlerRegistry())
- registry->OnIgnoreRegisterProtocolHandler(m_handler);
-}
-
-} // namespace QtWebEngineCore
diff --git a/src/core/register_protocol_handler_request_controller_impl.h b/src/core/register_protocol_handler_request_controller_impl.h
deleted file mode 100644
index 64f229ac4..000000000
--- a/src/core/register_protocol_handler_request_controller_impl.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef REGISTER_PROTOCOL_HANDLER_REQUEST_CONTROLLER_IMPL_H
-#define REGISTER_PROTOCOL_HANDLER_REQUEST_CONTROLLER_IMPL_H
-
-#include "register_protocol_handler_request_controller.h"
-
-#include "chrome/browser/custom_handlers/protocol_handler_registry.h"
-#include "chrome/common/custom_handlers/protocol_handler.h"
-#include "content/public/browser/web_contents_observer.h"
-
-class ProtocolHandlerRegistry;
-
-namespace QtWebEngineCore {
-
-class RegisterProtocolHandlerRequestControllerImpl final : public RegisterProtocolHandlerRequestController,
- private content::WebContentsObserver {
-public:
- RegisterProtocolHandlerRequestControllerImpl(
- content::WebContents *webContents,
- ProtocolHandler handler);
-
- ~RegisterProtocolHandlerRequestControllerImpl();
-
-protected:
- void accepted() override;
- void rejected() override;
-
-private:
- ProtocolHandlerRegistry *protocolHandlerRegistry();
- ProtocolHandler m_handler;
-};
-
-} // namespace QtWebEngineCore
-
-#endif // REGISTER_PROTOCOL_HANDLER_REQUEST_CONTROLLER_IMPL_H
diff --git a/src/core/render_view_context_menu_qt.cpp b/src/core/render_view_context_menu_qt.cpp
index 4e182973c..b7aabfd5b 100644
--- a/src/core/render_view_context_menu_qt.cpp
+++ b/src/core/render_view_context_menu_qt.cpp
@@ -1,44 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include <QtCore/QCoreApplication>
#include "render_view_context_menu_qt.h"
+#include "qwebenginecontextmenurequest.h"
namespace QtWebEngineCore {
@@ -74,8 +39,8 @@ namespace QtWebEngineCore {
return QCoreApplication::translate("RenderViewContextMenuQt", qUtf8Printable(names[menuItem]));
}
- RenderViewContextMenuQt::RenderViewContextMenuQt(const WebEngineContextMenuData &data)
- : m_contextData(data)
+ RenderViewContextMenuQt::RenderViewContextMenuQt(QWebEngineContextMenuRequest *request)
+ : m_contextData(request)
{
}
@@ -86,41 +51,47 @@ namespace QtWebEngineCore {
appendSeparatorItem();
}
- if (m_contextData.isEditable() && !m_contextData.spellCheckerSuggestions().isEmpty()) {
+ if (m_contextData->isContentEditable()
+ && !m_contextData->spellCheckerSuggestions().isEmpty()) {
appendSpellingSuggestionItems();
appendSeparatorItem();
}
- if (m_contextData.linkText().isEmpty() && !m_contextData.linkUrl().isValid() && !m_contextData.mediaUrl().isValid()) {
- if (m_contextData.isEditable())
+ if (m_contextData->linkText().isEmpty() && !m_contextData->filteredLinkUrl().isValid()
+ && !m_contextData->mediaUrl().isValid()) {
+ if (m_contextData->isContentEditable())
appendEditableItems();
- else if (!m_contextData.selectedText().isEmpty())
+ else if (!m_contextData->selectedText().isEmpty())
appendCopyItem();
else
appendPageItems();
+ } else {
+ appendPageItems();
}
- if (m_contextData.linkUrl().isValid() || !m_contextData.unfilteredLinkUrl().isEmpty() || !m_contextData.linkUrl().isEmpty())
+ if (m_contextData->filteredLinkUrl().isValid()
+ || !m_contextData->linkUrl().isEmpty()
+ || !m_contextData->filteredLinkUrl().isEmpty())
appendLinkItems();
- if (m_contextData.mediaUrl().isValid()) {
- switch (m_contextData.mediaType()) {
- case WebEngineContextMenuData::MediaTypeImage:
+ if (m_contextData->mediaUrl().isValid()) {
+ switch (m_contextData->mediaType()) {
+ case QWebEngineContextMenuRequest::MediaTypeImage:
appendSeparatorItem();
appendImageItems();
break;
- case WebEngineContextMenuData::MediaTypeCanvas:
+ case QWebEngineContextMenuRequest::MediaTypeCanvas:
Q_UNREACHABLE(); // mediaUrl is invalid for canvases
break;
- case WebEngineContextMenuData::MediaTypeAudio:
- case WebEngineContextMenuData::MediaTypeVideo:
+ case QWebEngineContextMenuRequest::MediaTypeAudio:
+ case QWebEngineContextMenuRequest::MediaTypeVideo:
appendSeparatorItem();
appendMediaItems();
break;
default:
break;
}
- } else if (m_contextData.mediaType() == WebEngineContextMenuData::MediaTypeCanvas) {
+ } else if (m_contextData->mediaType() == QWebEngineContextMenuRequest::MediaTypeCanvas) {
appendSeparatorItem();
appendCanvasItems();
}
@@ -158,7 +129,7 @@ namespace QtWebEngineCore {
addMenuItem(RenderViewContextMenuQt::Cut);
addMenuItem(RenderViewContextMenuQt::Copy);
addMenuItem(RenderViewContextMenuQt::Paste);
- if (m_contextData.misspelledWord().isEmpty()) {
+ if (m_contextData->misspelledWord().isEmpty()) {
addMenuItem(RenderViewContextMenuQt::PasteAndMatchStyle);
addMenuItem(RenderViewContextMenuQt::SelectAll);
}
@@ -188,7 +159,7 @@ namespace QtWebEngineCore {
void RenderViewContextMenuQt::appendMediaItems()
{
addMenuItem(RenderViewContextMenuQt::ToggleMediaLoop);
- if (m_contextData.mediaFlags() & QtWebEngineCore::WebEngineContextMenuData::MediaCanToggleControls)
+ if (m_contextData->mediaFlags() & QWebEngineContextMenuRequest::MediaCanToggleControls)
addMenuItem(RenderViewContextMenuQt::ToggleMediaControls);
addMenuItem(RenderViewContextMenuQt::DownloadMediaToDisk);
addMenuItem(RenderViewContextMenuQt::CopyMediaUrlToClipboard);
@@ -215,10 +186,8 @@ namespace QtWebEngineCore {
bool RenderViewContextMenuQt::canViewSource()
{
- return m_contextData.linkText().isEmpty()
- && !m_contextData.linkUrl().isValid()
- && !m_contextData.mediaUrl().isValid()
- && !m_contextData.isEditable()
- && m_contextData.selectedText().isEmpty();
+ return m_contextData->linkText().isEmpty() && !m_contextData->filteredLinkUrl().isValid()
+ && !m_contextData->mediaUrl().isValid() && !m_contextData->isContentEditable()
+ && m_contextData->selectedText().isEmpty();
}
}
diff --git a/src/core/render_view_context_menu_qt.h b/src/core/render_view_context_menu_qt.h
index e1ee301fc..71901424c 100644
--- a/src/core/render_view_context_menu_qt.h
+++ b/src/core/render_view_context_menu_qt.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
//
// W A R N I N G
@@ -53,9 +17,11 @@
#include "web_contents_adapter_client.h"
+QT_FORWARD_DECLARE_CLASS(QWebEngineContextMenuRequest)
+
namespace QtWebEngineCore {
-class Q_WEBENGINECORE_PRIVATE_EXPORT RenderViewContextMenuQt
+class Q_WEBENGINECORE_EXPORT RenderViewContextMenuQt
{
public:
enum ContextMenuItem {
@@ -99,7 +65,7 @@ public:
static const QString getMenuItemName(RenderViewContextMenuQt::ContextMenuItem menuItem);
- RenderViewContextMenuQt(const WebEngineContextMenuData &data);
+ RenderViewContextMenuQt(QWebEngineContextMenuRequest *data);
void initMenu();
protected:
@@ -109,7 +75,7 @@ protected:
virtual void addMenuItem(ContextMenuItem menuItem) = 0;
virtual bool isMenuItemEnabled(ContextMenuItem menuItem) = 0;
- const WebEngineContextMenuData &m_contextData;
+ QWebEngineContextMenuRequest *m_contextData;
private:
void appendCanvasItems();
diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp
index 2eeb09b2e..888043fda 100644
--- a/src/core/render_widget_host_view_qt.cpp
+++ b/src/core/render_widget_host_view_qt.cpp
@@ -1,110 +1,64 @@
-
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "render_widget_host_view_qt.h"
-#include "browser_accessibility_manager_qt.h"
-#include "common/qt_messages.h"
-#include "compositor/compositor.h"
#include "qtwebenginecoreglobal_p.h"
#include "render_widget_host_view_qt_delegate.h"
-#include "touch_handle_drawable_client.h"
+#include "render_widget_host_view_qt_delegate_client.h"
#include "touch_selection_controller_client_qt.h"
-#include "touch_selection_menu_controller.h"
#include "type_conversion.h"
#include "web_contents_adapter.h"
#include "web_contents_adapter_client.h"
#include "web_event_factory.h"
-#include "base/threading/thread_task_runner_handle.h"
#include "components/viz/common/features.h"
#include "components/viz/common/frame_sinks/begin_frame_source.h"
#include "components/viz/common/surfaces/frame_sink_id_allocator.h"
#include "components/viz/host/host_frame_sink_manager.h"
-#include "content/browser/compositor/surface_utils.h"
-#include "content/browser/frame_host/frame_tree.h"
-#include "content/browser/frame_host/render_frame_host_impl.h"
+#include "content/browser/compositor/image_transport_factory.h"
+#include "content/browser/renderer_host/render_frame_host_impl.h"
+#include "content/browser/renderer_host/frame_tree.h"
+#include "content/browser/renderer_host/frame_tree_node.h"
+#include "content/browser/renderer_host/cursor_manager.h"
#include "content/browser/renderer_host/input/synthetic_gesture_target.h"
+#include "content/browser/renderer_host/render_frame_host_impl.h"
#include "content/browser/renderer_host/render_view_host_delegate.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
-#include "content/common/content_switches_internal.h"
#include "content/browser/renderer_host/render_widget_host_input_event_router.h"
+#include "content/browser/renderer_host/ui_events_helper.h"
+#include "content/common/content_switches_internal.h"
#include "content/common/cursors/webcursor.h"
-#include "content/common/input_messages.h"
+#include "content/public/browser/web_contents.h"
#include "third_party/skia/include/core/SkColor.h"
-#include "third_party/blink/public/platform/web_cursor_info.h"
+#include "ui/base/cursor/cursor.h"
+#include "ui/base/resource/resource_bundle.h"
+#include "ui/display/display_util.h"
#include "ui/events/blink/blink_event_util.h"
#include "ui/events/event.h"
#include "ui/events/gesture_detection/gesture_configuration.h"
#include "ui/events/gesture_detection/gesture_provider_config_helper.h"
-#include "ui/events/gesture_detection/motion_event.h"
+#include "ui/events/keycodes/dom/dom_keyboard_layout_map.h"
#include "ui/gfx/image/image_skia.h"
-#include "ui/touch_selection/touch_selection_controller.h"
#if defined(USE_OZONE)
#include "ui/base/clipboard/scoped_clipboard_writer.h"
#endif
#if defined(USE_AURA)
-#include "ui/base/cursor/cursor.h"
-#include "ui/base/cursor/cursors_aura.h"
-#include "ui/base/resource/resource_bundle.h"
+#include "ui/wm/core/cursor_util.h"
+#include "ui/base/cursor/cursor_size.h"
+#endif
+
+#if defined(Q_OS_MACOS)
+#include "ui/resources/grit/ui_resources.h"
#endif
-#include <private/qguiapplication_p.h>
-#include <qpa/qplatforminputcontext.h>
-#include <qpa/qplatformintegration.h>
-#include <QEvent>
-#include <QFocusEvent>
#include <QGuiApplication>
-#include <QInputMethodEvent>
-#include <QTextFormat>
-#include <QKeyEvent>
-#include <QMouseEvent>
#include <QPixmap>
+#include <QScopeGuard>
#include <QScreen>
-#include <QStyleHints>
-#include <QVariant>
-#include <QWheelEvent>
#include <QWindow>
-#include <QtGui/private/qinputcontrol_p.h>
namespace QtWebEngineCore {
@@ -127,50 +81,6 @@ static inline ui::LatencyInfo CreateLatencyInfo(const blink::WebInputEvent& even
return latency_info;
}
-static inline Qt::InputMethodHints toQtInputMethodHints(ui::TextInputType inputType)
-{
- switch (inputType) {
- case ui::TEXT_INPUT_TYPE_TEXT:
- return Qt::ImhPreferLowercase;
- case ui::TEXT_INPUT_TYPE_SEARCH:
- return Qt::ImhPreferLowercase | Qt::ImhNoAutoUppercase;
- case ui::TEXT_INPUT_TYPE_PASSWORD:
- return Qt::ImhSensitiveData | Qt::ImhNoPredictiveText | Qt::ImhNoAutoUppercase | Qt::ImhHiddenText;
- case ui::TEXT_INPUT_TYPE_EMAIL:
- return Qt::ImhEmailCharactersOnly;
- case ui::TEXT_INPUT_TYPE_NUMBER:
- return Qt::ImhFormattedNumbersOnly;
- case ui::TEXT_INPUT_TYPE_TELEPHONE:
- return Qt::ImhDialableCharactersOnly;
- case ui::TEXT_INPUT_TYPE_URL:
- return Qt::ImhUrlCharactersOnly | Qt::ImhNoPredictiveText | Qt::ImhNoAutoUppercase;
- case ui::TEXT_INPUT_TYPE_DATE_TIME:
- case ui::TEXT_INPUT_TYPE_DATE_TIME_LOCAL:
- case ui::TEXT_INPUT_TYPE_DATE_TIME_FIELD:
- return Qt::ImhDate | Qt::ImhTime;
- case ui::TEXT_INPUT_TYPE_DATE:
- case ui::TEXT_INPUT_TYPE_MONTH:
- case ui::TEXT_INPUT_TYPE_WEEK:
- return Qt::ImhDate;
- case ui::TEXT_INPUT_TYPE_TIME:
- return Qt::ImhTime;
- case ui::TEXT_INPUT_TYPE_TEXT_AREA:
- case ui::TEXT_INPUT_TYPE_CONTENT_EDITABLE:
- return Qt::ImhMultiLine | Qt::ImhPreferLowercase;
- default:
- return Qt::ImhNone;
- }
-}
-
-static inline int firstAvailableId(const QMap<int, int> &map)
-{
- ui::BitSet32 usedIds;
- QMap<int, int>::const_iterator end = map.end();
- for (QMap<int, int>::const_iterator it = map.begin(); it != end; ++it)
- usedIds.mark_bit(it.value());
- return usedIds.first_unmarked_bit();
-}
-
static inline ui::GestureProvider::Config QtGestureProviderConfig() {
ui::GestureProvider::Config config = ui::GetGestureProviderConfig(ui::GestureProviderConfigType::CURRENT_PLATFORM);
// Causes an assert in CreateWebGestureEventFromGestureEventData and we don't need them in Qt.
@@ -180,168 +90,98 @@ static inline ui::GestureProvider::Config QtGestureProviderConfig() {
return config;
}
-static inline bool compareTouchPoints(const QTouchEvent::TouchPoint &lhs, const QTouchEvent::TouchPoint &rhs)
-{
- // TouchPointPressed < TouchPointMoved < TouchPointReleased
- return lhs.state() < rhs.state();
-}
+extern display::Display toDisplayDisplay(int id, const QScreen *screen);
-static inline bool isCommonTextEditShortcut(const QKeyEvent *ke)
+static display::ScreenInfos screenInfosFromQtForUpdate(QScreen *currentScreen)
{
- return QInputControl::isCommonTextEditShortcut(ke);
-}
-
-static uint32_t s_eventId = 0;
-class MotionEventQt : public ui::MotionEvent {
-public:
- MotionEventQt(const QList<QTouchEvent::TouchPoint> &touchPoints, const base::TimeTicks &eventTime, Action action, const Qt::KeyboardModifiers modifiers, int index = -1)
- : touchPoints(touchPoints)
- , eventTime(eventTime)
- , action(action)
- , eventId(++s_eventId)
- , flags(flagsFromModifiers(modifiers))
- , index(index)
- {
- // ACTION_DOWN and ACTION_UP must be accesssed through pointer_index 0
- Q_ASSERT((action != Action::DOWN && action != Action::UP) || index == 0);
+ display::ScreenInfo screenInfo;
+ const auto &screens = qApp->screens();
+ if (screens.isEmpty()) {
+ screenInfo.device_scale_factor = qGuiApp->devicePixelRatio();
+ return display::ScreenInfos(screenInfo);
}
- uint32_t GetUniqueEventId() const override { return eventId; }
- Action GetAction() const override { return action; }
- int GetActionIndex() const override { return index; }
- size_t GetPointerCount() const override { return touchPoints.size(); }
- int GetPointerId(size_t pointer_index) const override { return touchPoints.at(pointer_index).id(); }
- float GetX(size_t pointer_index) const override { return touchPoints.at(pointer_index).pos().x(); }
- float GetY(size_t pointer_index) const override { return touchPoints.at(pointer_index).pos().y(); }
- float GetRawX(size_t pointer_index) const override { return touchPoints.at(pointer_index).screenPos().x(); }
- float GetRawY(size_t pointer_index) const override { return touchPoints.at(pointer_index).screenPos().y(); }
- float GetTouchMajor(size_t pointer_index) const override
- {
- QSizeF diams = touchPoints.at(pointer_index).ellipseDiameters();
- return std::max(diams.height(), diams.width());
- }
- float GetTouchMinor(size_t pointer_index) const override
- {
- QSizeF diams = touchPoints.at(pointer_index).ellipseDiameters();
- return std::min(diams.height(), diams.width());
+ Q_ASSERT(qApp->primaryScreen() == screens.first());
+ display::ScreenInfos result;
+ for (int i = 0; i < screens.length(); ++i) {
+ display::DisplayUtil::DisplayToScreenInfo(&screenInfo, toDisplayDisplay(i, screens.at(i)));
+ result.screen_infos.push_back(screenInfo);
+ if (currentScreen == screens.at(i))
+ result.current_display_id = i;
}
- float GetOrientation(size_t pointer_index) const override
+
+ Q_ASSERT(result.current_display_id != display::kInvalidDisplayId);
+
+ return result;
+}
+
+// An minimal override to support progressing flings
+class FlingingCompositor : public ui::Compositor
+{
+ RenderWidgetHostViewQt *m_rwhv;
+public:
+ FlingingCompositor(RenderWidgetHostViewQt *rwhv,
+ const viz::FrameSinkId &frame_sink_id,
+ ui::ContextFactory *context_factory,
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner,
+ bool enable_pixel_canvas,
+ bool use_external_begin_frame_control = false,
+ bool force_software_compositor = false)
+ : ui::Compositor(frame_sink_id, context_factory,
+ task_runner, enable_pixel_canvas,
+ use_external_begin_frame_control,
+ force_software_compositor)
+ , m_rwhv(rwhv)
+ {}
+
+ void BeginMainFrame(const viz::BeginFrameArgs &args) override
{
- return 0;
- }
- int GetFlags() const override { return flags; }
- float GetPressure(size_t pointer_index) const override { return touchPoints.at(pointer_index).pressure(); }
- float GetTiltX(size_t pointer_index) const override { return 0; }
- float GetTiltY(size_t pointer_index) const override { return 0; }
- float GetTwist(size_t) const override { return 0; }
- float GetTangentialPressure(size_t) const override { return 0; }
- base::TimeTicks GetEventTime() const override { return eventTime; }
-
- size_t GetHistorySize() const override { return 0; }
- base::TimeTicks GetHistoricalEventTime(size_t historical_index) const override { return base::TimeTicks(); }
- float GetHistoricalTouchMajor(size_t pointer_index, size_t historical_index) const override { return 0; }
- float GetHistoricalX(size_t pointer_index, size_t historical_index) const override { return 0; }
- float GetHistoricalY(size_t pointer_index, size_t historical_index) const override { return 0; }
- ToolType GetToolType(size_t pointer_index) const override {
- return (touchPoints.at(pointer_index).flags() & QTouchEvent::TouchPoint::InfoFlag::Pen) ? ui::MotionEvent::ToolType::STYLUS
- : ui::MotionEvent::ToolType::FINGER;
+ if (args.type != viz::BeginFrameArgs::MISSED && !m_rwhv->is_currently_scrolling_viewport())
+ m_rwhv->host()->ProgressFlingIfNeeded(args.frame_time);
+ ui::Compositor::BeginMainFrame(args);
}
- int GetButtonState() const override { return 0; }
-
-private:
- QList<QTouchEvent::TouchPoint> touchPoints;
- base::TimeTicks eventTime;
- Action action;
- const uint32_t eventId;
- int flags;
- int index;
};
-static content::ScreenInfo screenInfoFromQScreen(QScreen *screen)
-{
- content::ScreenInfo r;
- if (screen) {
- r.device_scale_factor = screen->devicePixelRatio();
- r.depth_per_component = 8;
- r.depth = screen->depth();
- r.is_monochrome = (r.depth == 1);
- r.rect = toGfx(screen->geometry());
- r.available_rect = toGfx(screen->availableGeometry());
- } else {
- r.device_scale_factor = qGuiApp->devicePixelRatio();
- }
- return r;
-}
-
RenderWidgetHostViewQt::RenderWidgetHostViewQt(content::RenderWidgetHost *widget)
: content::RenderWidgetHostViewBase::RenderWidgetHostViewBase(widget)
- , m_taskRunner(base::ThreadTaskRunnerHandle::Get())
+ , m_taskRunner(base::SingleThreadTaskRunner::GetCurrentDefault())
, m_gestureProvider(QtGestureProviderConfig(), this)
- , m_sendMotionActionDown(false)
- , m_touchMotionStarted(false)
- , m_enableViz(features::IsVizDisplayCompositorEnabled())
- , m_visible(false)
- , m_needsBeginFrames(false)
- , m_loadVisuallyCommittedState(NotCommitted)
- , m_adapterClient(0)
- , m_imeInProgress(false)
- , m_receivedEmptyImeEvent(false)
- , m_isMouseLocked(false)
- , m_imState(0)
- , m_anchorPositionWithinSelection(-1)
- , m_cursorPositionWithinSelection(-1)
- , m_cursorPosition(0)
- , m_emptyPreviousSelection(true)
- , m_wheelAckPending(false)
- , m_mouseWheelPhaseHandler(this)
, m_frameSinkId(host()->GetFrameSinkId())
+ , m_delegateClient(new RenderWidgetHostViewQtDelegateClient(this))
{
if (GetTextInputManager())
GetTextInputManager()->AddObserver(this);
- const QPlatformInputContext *context = QGuiApplicationPrivate::platformIntegration()->inputContext();
- m_imeHasHiddenTextCapability = context && context->hasCapability(QPlatformInputContext::HiddenTextCapability);
-
- if (m_enableViz) {
- m_rootLayer.reset(new ui::Layer(ui::LAYER_SOLID_COLOR));
- m_rootLayer->SetColor(SK_ColorTRANSPARENT);
-
- m_delegatedFrameHost.reset(new content::DelegatedFrameHost(
- host()->GetFrameSinkId(),
- &m_delegatedFrameHostClient,
- true /* should_register_frame_sink_id */));
-
- content::ImageTransportFactory *imageTransportFactory = content::ImageTransportFactory::GetInstance();
- ui::ContextFactory *contextFactory = imageTransportFactory->GetContextFactory();
- ui::ContextFactoryPrivate *contextFactoryPrivate = imageTransportFactory->GetContextFactoryPrivate();
- m_uiCompositor.reset(new ui::Compositor(
- contextFactoryPrivate->AllocateFrameSinkId(),
- contextFactory,
- contextFactoryPrivate,
- m_taskRunner,
- false /* enable_pixel_canvas */));
- m_uiCompositor->SetAcceleratedWidget(gfx::kNullAcceleratedWidget); // null means offscreen
- m_uiCompositor->SetRootLayer(m_rootLayer.get());
-
- m_displayFrameSink = DisplayFrameSink::findOrCreate(m_uiCompositor->frame_sink_id());
- m_displayFrameSink->connect(this);
- } else {
- m_compositor.reset(new Compositor(widget));
- }
+ m_rootLayer.reset(new ui::Layer(ui::LAYER_SOLID_COLOR));
+ m_rootLayer->SetColor(SK_ColorTRANSPARENT);
+
+ m_delegatedFrameHost.reset(new content::DelegatedFrameHost(
+ host()->GetFrameSinkId(),
+ &m_delegatedFrameHostClient,
+ true /* should_register_frame_sink_id */));
+
+ content::ImageTransportFactory *imageTransportFactory = content::ImageTransportFactory::GetInstance();
+ ui::ContextFactory *contextFactory = imageTransportFactory->GetContextFactory();
+ m_uiCompositor.reset(new FlingingCompositor(
+ this,
+ contextFactory->AllocateFrameSinkId(),
+ contextFactory,
+ m_taskRunner,
+ false /* enable_pixel_canvas */));
+ m_uiCompositor->SetAcceleratedWidget(gfx::kNullAcceleratedWidget); // null means offscreen
+ m_uiCompositor->SetRootLayer(m_rootLayer.get());
if (host()->delegate() && host()->delegate()->GetInputEventRouter())
host()->delegate()->GetInputEventRouter()->AddFrameSinkIdOwner(GetFrameSinkId(), this);
+ m_cursorManager.reset(new content::CursorManager(this));
+
m_touchSelectionControllerClient.reset(new TouchSelectionControllerClientQt(this));
- ui::TouchSelectionController::Config config;
- config.max_tap_duration = base::TimeDelta::FromMilliseconds(ui::GestureConfiguration::GetInstance()->long_press_time_in_ms());
- config.tap_slop = ui::GestureConfiguration::GetInstance()->max_touch_move_in_pixels_for_click();
- config.enable_longpress_drag_selection = false;
- m_touchSelectionController.reset(new ui::TouchSelectionController(m_touchSelectionControllerClient.get(), config));
+ resetTouchSelectionController();
+ host()->render_frame_metadata_provider()->AddObserver(this);
host()->render_frame_metadata_provider()->ReportAllFrameSubmissionsForTesting(true);
- // May call SetNeedsBeginFrames
host()->SetView(this);
}
@@ -351,14 +191,17 @@ RenderWidgetHostViewQt::~RenderWidgetHostViewQt()
QObject::disconnect(m_adapterClientDestroyedConnection);
- if (m_enableViz)
- m_displayFrameSink->disconnect(this);
-
if (text_input_manager_)
text_input_manager_->RemoveObserver(this);
+ if (host()->delegate())
+ m_touchSelectionControllerClient->resetControls();
+
m_touchSelectionController.reset();
m_touchSelectionControllerClient.reset();
+
+ host()->render_frame_metadata_provider()->RemoveObserver(this);
+ host()->ViewDestroyed();
}
void RenderWidgetHostViewQt::setDelegate(RenderWidgetHostViewQtDelegate* delegate)
@@ -368,7 +211,7 @@ void RenderWidgetHostViewQt::setDelegate(RenderWidgetHostViewQtDelegate* delegat
m_deferredShow = false;
Show();
}
- visualPropertiesChanged();
+ delegateClient()->visualPropertiesChanged();
}
void RenderWidgetHostViewQt::setAdapterClient(WebContentsAdapterClient *adapterClient)
@@ -382,27 +225,57 @@ void RenderWidgetHostViewQt::setAdapterClient(WebContentsAdapterClient *adapterC
m_adapterClient = nullptr; });
}
-void RenderWidgetHostViewQt::InitAsChild(gfx::NativeView)
+void RenderWidgetHostViewQt::OnInputEventAck(blink::mojom::InputEventResultSource,
+ blink::mojom::InputEventResultState state,
+ const blink::WebInputEvent &event)
{
+ if (event.GetType() == blink::WebInputEvent::Type::kMouseWheel)
+ WheelEventAck(static_cast<const blink::WebMouseWheelEvent &>(event), state);
}
-void RenderWidgetHostViewQt::InitAsPopup(content::RenderWidgetHostView*, const gfx::Rect& rect)
+// static
+// Called when new child/guest renderframes created.
+void RenderWidgetHostViewQt::registerInputEventObserver(content::WebContents *webContents,
+ content::RenderFrameHost *rfh)
{
- m_delegate->initAsPopup(toQt(rect));
+ if (static_cast<content::RenderFrameHostImpl *>(rfh)->is_local_root_subframe()) {
+ content::WebContents *parent = webContents->GetOutermostWebContents();
+ QtWebEngineCore::RenderWidgetHostViewQt *mainRwhv =
+ static_cast<QtWebEngineCore::RenderWidgetHostViewQt *>(
+ parent->GetRenderWidgetHostView());
+ // Child (originAgentCluster) or guest (pdf) frame that is embedded into the main frame
+ content::RenderWidgetHost *childFrame = rfh->GetRenderWidgetHost();
+ childFrame->AddInputEventObserver(mainRwhv);
+
+ if (webContents->IsInnerWebContentsForGuest()) {
+ // The frame which holds the actual PDF content inside the guest
+ content::RenderWidgetHost *guestFrame = webContents->GetRenderViewHost()->GetWidget();
+ guestFrame->AddInputEventObserver(mainRwhv);
+ }
+ }
}
-void RenderWidgetHostViewQt::InitAsFullscreen(content::RenderWidgetHostView*)
+void RenderWidgetHostViewQt::InitAsChild(gfx::NativeView)
+{
+}
+
+void RenderWidgetHostViewQt::InitAsPopup(content::RenderWidgetHostView*, const gfx::Rect& rect, const gfx::Rect& anchorRect)
{
+ Q_UNUSED(anchorRect);
+ m_delegate->initAsPopup(toQt(rect));
}
void RenderWidgetHostViewQt::SetSize(const gfx::Size &sizeInDips)
{
+ if (!m_delegate)
+ return;
+
m_delegate->resize(sizeInDips.width(), sizeInDips.height());
}
void RenderWidgetHostViewQt::SetBounds(const gfx::Rect &windowRectInDips)
{
- DCHECK(IsPopup());
+ DCHECK(isPopup());
m_delegate->move(toQt(windowRectInDips.origin()));
m_delegate->resize(windowRectInDips.width(), windowRectInDips.height());
}
@@ -418,28 +291,22 @@ gfx::NativeView RenderWidgetHostViewQt::GetNativeView()
return gfx::NativeView();
}
-gfx::NativeViewAccessible RenderWidgetHostViewQt::GetNativeViewAccessible()
+content::WebContentsAccessibility *RenderWidgetHostViewQt::GetWebContentsAccessibility()
{
- return 0;
+ if (!m_webContentsAccessibility)
+ m_webContentsAccessibility.reset(new WebContentsAccessibilityQt(this));
+ return m_webContentsAccessibility.get();
}
-content::BrowserAccessibilityManager* RenderWidgetHostViewQt::CreateBrowserAccessibilityManager(content::BrowserAccessibilityDelegate* delegate, bool for_root_frame)
+QObject *WebContentsAccessibilityQt::accessibilityParentObject() const
{
- Q_UNUSED(for_root_frame); // FIXME
-#if QT_CONFIG(accessibility)
- return new content::BrowserAccessibilityManagerQt(
- m_adapterClient->accessibilityParentObject(),
- content::BrowserAccessibilityManagerQt::GetEmptyDocument(),
- delegate);
-#else
- return 0;
-#endif // QT_CONFIG(accessibility)
+ return m_rwhv->m_adapterClient->accessibilityParentObject();
}
// Set focus to the associated View component.
void RenderWidgetHostViewQt::Focus()
{
- if (!IsPopup())
+ if (!isPopup())
m_delegate->setKeyboardFocus();
host()->Focus();
}
@@ -454,31 +321,26 @@ bool RenderWidgetHostViewQt::IsMouseLocked()
return m_isMouseLocked;
}
+viz::FrameSinkId RenderWidgetHostViewQt::GetRootFrameSinkId()
+{
+ return m_uiCompositor->frame_sink_id();
+}
+
bool RenderWidgetHostViewQt::IsSurfaceAvailableForCopy()
{
- if (m_enableViz)
- return m_delegatedFrameHost->CanCopyFromCompositingSurface();
- return true;
+ return m_delegatedFrameHost->CanCopyFromCompositingSurface();
}
void RenderWidgetHostViewQt::CopyFromSurface(const gfx::Rect &src_rect,
const gfx::Size &output_size,
base::OnceCallback<void(const SkBitmap &)> callback)
{
- if (m_enableViz) {
- m_delegatedFrameHost->CopyFromCompositingSurface(src_rect, output_size, std::move(callback));
- return;
- }
-
- QImage image;
- if (m_delegate->copySurface(toQt(src_rect), toQt(output_size), image))
- std::move(callback).Run(toSkBitmap(image));
- else
- std::move(callback).Run(SkBitmap());
+ m_delegatedFrameHost->CopyFromCompositingSurface(src_rect, output_size, std::move(callback));
}
-void RenderWidgetHostViewQt::Show()
+void RenderWidgetHostViewQt::ShowWithVisibility(content::PageVisibilityState page_visibility)
{
+ Q_ASSERT(page_visibility != content::PageVisibilityState::kHidden);
if (m_delegate)
m_delegate->show();
else
@@ -500,35 +362,46 @@ bool RenderWidgetHostViewQt::IsShowing()
// Retrieve the bounds of the View, in screen coordinates.
gfx::Rect RenderWidgetHostViewQt::GetViewBounds()
{
- return m_viewRectInDips;
+ return toGfx(delegateClient()->viewRectInDips());
}
void RenderWidgetHostViewQt::UpdateBackgroundColor()
{
+ if (!m_delegate)
+ return;
+
DCHECK(GetBackgroundColor());
SkColor color = *GetBackgroundColor();
m_delegate->setClearColor(toQt(color));
- if (m_enableViz) {
- bool opaque = SkColorGetA(color) == SK_AlphaOPAQUE;
- m_rootLayer->SetFillsBoundsOpaquely(opaque);
- m_rootLayer->SetColor(color);
- m_uiCompositor->SetBackgroundColor(color);
- }
+ bool opaque = SkColorGetA(color) == SK_AlphaOPAQUE;
+ m_rootLayer->SetFillsBoundsOpaquely(opaque);
+ m_rootLayer->SetColor(color);
+ m_uiCompositor->SetBackgroundColor(color);
- content::RenderViewHost *rvh = content::RenderViewHost::From(host());
- host()->Send(new RenderViewObserverQt_SetBackgroundColor(rvh->GetRoutingID(), color));
+ if (color == SK_ColorTRANSPARENT)
+ host()->owner_delegate()->SetBackgroundOpaque(false);
}
// Return value indicates whether the mouse is locked successfully or not.
-bool RenderWidgetHostViewQt::LockMouse(bool)
+blink::mojom::PointerLockResult RenderWidgetHostViewQt::LockMouse(bool request_unadjusted_movement)
{
- m_previousMousePosition = QCursor::pos();
+ if (request_unadjusted_movement)
+ return blink::mojom::PointerLockResult::kUnsupportedOptions;
+
+ delegateClient()->resetPreviousMousePosition();
m_delegate->lockMouse();
m_isMouseLocked = true;
qApp->setOverrideCursor(Qt::BlankCursor);
- return true;
+ return blink::mojom::PointerLockResult::kSuccess;
+}
+
+blink::mojom::PointerLockResult RenderWidgetHostViewQt::ChangeMouseLock(bool request_unadjusted_movement)
+{
+ if (request_unadjusted_movement)
+ return blink::mojom::PointerLockResult::kUnsupportedOptions;
+ return blink::mojom::PointerLockResult::kSuccess;
}
void RenderWidgetHostViewQt::UnlockMouse()
@@ -539,169 +412,199 @@ void RenderWidgetHostViewQt::UnlockMouse()
host()->LostMouseLock();
}
-void RenderWidgetHostViewQt::UpdateCursor(const content::WebCursor &webCursor)
+bool RenderWidgetHostViewQt::updateCursorFromResource(ui::mojom::CursorType type)
+{
+ int resourceId;
+ // GetCursorDataFor only knows hotspots for 1x and 2x cursor images, in physical pixels.
+ qreal hotspotDpr = GetScreenInfo().device_scale_factor <= 1.0f ? 1.0f : 2.0f;
+ qreal hotX;
+ qreal hotY;
+
+#if defined(USE_AURA)
+ gfx::Point hotspot;
+ if (!wm::GetCursorDataFor(ui::CursorSize::kNormal, type, hotspotDpr, &resourceId, &hotspot))
+ return false;
+ hotX = hotspot.x();
+ hotY = hotspot.y();
+#elif defined(Q_OS_MACOS)
+ // See chromium/content/common/cursors/webcursor_mac.mm
+ switch (type) {
+ case ui::mojom::CursorType::kVerticalText:
+ // TODO: [NSCursor IBeamCursorForVerticalLayout]
+ return false;
+ case ui::mojom::CursorType::kCell:
+ resourceId = IDR_CELL_CURSOR;
+ hotX = 7;
+ hotY = 7;
+ break;
+ case ui::mojom::CursorType::kContextMenu:
+ // TODO: [NSCursor contextualMenuCursor]
+ return false;
+ case ui::mojom::CursorType::kZoomIn:
+ resourceId = IDR_ZOOMIN_CURSOR;
+ hotX = 7;
+ hotY = 7;
+ break;
+ case ui::mojom::CursorType::kZoomOut:
+ resourceId = IDR_ZOOMOUT_CURSOR;
+ hotX = 7;
+ hotY = 7;
+ break;
+ default:
+ Q_UNREACHABLE();
+ return false;
+ }
+#else
+ Q_UNREACHABLE();
+ return false;
+#endif
+
+ const gfx::ImageSkia *imageSkia = ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(resourceId);
+ if (!imageSkia)
+ return false;
+
+ QImage imageQt = toQImage(imageSkia->GetRepresentation(GetScreenInfo().device_scale_factor));
+
+ // Convert hotspot coordinates into device-independent pixels.
+ hotX /= hotspotDpr;
+ hotY /= hotspotDpr;
+
+#if defined(Q_OS_LINUX)
+ // QTBUG-68571: On Linux (xcb, wayland, eglfs), hotspot coordinates must be in physical pixels.
+ qreal imageDpr = imageQt.devicePixelRatio();
+ hotX *= imageDpr;
+ hotY *= imageDpr;
+#endif
+
+ m_delegate->updateCursor(QCursor(QPixmap::fromImage(std::move(imageQt)), qRound(hotX), qRound(hotY)));
+ return true;
+}
+
+void RenderWidgetHostViewQt::UpdateCursor(const ui::Cursor &webCursor)
{
DisplayCursor(webCursor);
}
-void RenderWidgetHostViewQt::DisplayCursor(const content::WebCursor &webCursor)
+void RenderWidgetHostViewQt::DisplayCursor(const ui::Cursor &cursorInfo)
{
- const content::CursorInfo &cursorInfo = webCursor.info();
Qt::CursorShape shape = Qt::ArrowCursor;
-#if defined(USE_AURA)
- ui::CursorType auraType = ui::CursorType::kNull;
-#endif
- switch (cursorInfo.type) {
- case ui::CursorType::kNull:
- case ui::CursorType::kPointer:
+ switch (cursorInfo.type()) {
+ case ui::mojom::CursorType::kNull:
+ case ui::mojom::CursorType::kPointer:
shape = Qt::ArrowCursor;
break;
- case ui::CursorType::kCross:
+ case ui::mojom::CursorType::kCross:
shape = Qt::CrossCursor;
break;
- case ui::CursorType::kHand:
+ case ui::mojom::CursorType::kHand:
shape = Qt::PointingHandCursor;
break;
- case ui::CursorType::kIBeam:
+ case ui::mojom::CursorType::kIBeam:
shape = Qt::IBeamCursor;
break;
- case ui::CursorType::kWait:
+ case ui::mojom::CursorType::kWait:
shape = Qt::WaitCursor;
break;
- case ui::CursorType::kHelp:
+ case ui::mojom::CursorType::kHelp:
shape = Qt::WhatsThisCursor;
break;
- case ui::CursorType::kEastResize:
- case ui::CursorType::kWestResize:
- case ui::CursorType::kEastWestResize:
- case ui::CursorType::kEastPanning:
- case ui::CursorType::kWestPanning:
- case ui::CursorType::kMiddlePanningHorizontal:
+ case ui::mojom::CursorType::kEastResize:
+ case ui::mojom::CursorType::kWestResize:
+ case ui::mojom::CursorType::kEastWestResize:
+ case ui::mojom::CursorType::kEastPanning:
+ case ui::mojom::CursorType::kWestPanning:
+ case ui::mojom::CursorType::kMiddlePanningHorizontal:
shape = Qt::SizeHorCursor;
break;
- case ui::CursorType::kNorthResize:
- case ui::CursorType::kSouthResize:
- case ui::CursorType::kNorthSouthResize:
- case ui::CursorType::kNorthPanning:
- case ui::CursorType::kSouthPanning:
- case ui::CursorType::kMiddlePanningVertical:
+ case ui::mojom::CursorType::kNorthResize:
+ case ui::mojom::CursorType::kSouthResize:
+ case ui::mojom::CursorType::kNorthSouthResize:
+ case ui::mojom::CursorType::kNorthPanning:
+ case ui::mojom::CursorType::kSouthPanning:
+ case ui::mojom::CursorType::kMiddlePanningVertical:
shape = Qt::SizeVerCursor;
break;
- case ui::CursorType::kNorthEastResize:
- case ui::CursorType::kSouthWestResize:
- case ui::CursorType::kNorthEastSouthWestResize:
- case ui::CursorType::kNorthEastPanning:
- case ui::CursorType::kSouthWestPanning:
+ case ui::mojom::CursorType::kNorthEastResize:
+ case ui::mojom::CursorType::kSouthWestResize:
+ case ui::mojom::CursorType::kNorthEastSouthWestResize:
+ case ui::mojom::CursorType::kNorthEastPanning:
+ case ui::mojom::CursorType::kSouthWestPanning:
shape = Qt::SizeBDiagCursor;
break;
- case ui::CursorType::kNorthWestResize:
- case ui::CursorType::kSouthEastResize:
- case ui::CursorType::kNorthWestSouthEastResize:
- case ui::CursorType::kNorthWestPanning:
- case ui::CursorType::kSouthEastPanning:
+ case ui::mojom::CursorType::kNorthWestResize:
+ case ui::mojom::CursorType::kSouthEastResize:
+ case ui::mojom::CursorType::kNorthWestSouthEastResize:
+ case ui::mojom::CursorType::kNorthWestPanning:
+ case ui::mojom::CursorType::kSouthEastPanning:
shape = Qt::SizeFDiagCursor;
break;
- case ui::CursorType::kColumnResize:
+ case ui::mojom::CursorType::kColumnResize:
shape = Qt::SplitHCursor;
break;
- case ui::CursorType::kRowResize:
+ case ui::mojom::CursorType::kRowResize:
shape = Qt::SplitVCursor;
break;
- case ui::CursorType::kMiddlePanning:
- case ui::CursorType::kMove:
+ case ui::mojom::CursorType::kMiddlePanning:
+ case ui::mojom::CursorType::kMove:
shape = Qt::SizeAllCursor;
break;
- case ui::CursorType::kProgress:
+ case ui::mojom::CursorType::kProgress:
shape = Qt::BusyCursor;
break;
- case ui::CursorType::kDndNone:
- case ui::CursorType::kDndMove:
+ case ui::mojom::CursorType::kDndNone:
+ case ui::mojom::CursorType::kDndMove:
shape = Qt::DragMoveCursor;
break;
- case ui::CursorType::kDndCopy:
- case ui::CursorType::kCopy:
+ case ui::mojom::CursorType::kDndCopy:
+ case ui::mojom::CursorType::kCopy:
shape = Qt::DragCopyCursor;
break;
- case ui::CursorType::kDndLink:
- case ui::CursorType::kAlias:
+ case ui::mojom::CursorType::kDndLink:
+ case ui::mojom::CursorType::kAlias:
shape = Qt::DragLinkCursor;
break;
-#if defined(USE_AURA)
- case ui::CursorType::kVerticalText:
- auraType = ui::CursorType::kVerticalText;
- break;
- case ui::CursorType::kCell:
- auraType = ui::CursorType::kCell;
- break;
- case ui::CursorType::kContextMenu:
- auraType = ui::CursorType::kContextMenu;
- break;
- case ui::CursorType::kZoomIn:
- auraType = ui::CursorType::kZoomIn;
- break;
- case ui::CursorType::kZoomOut:
- auraType = ui::CursorType::kZoomOut;
- break;
-#else
- case ui::CursorType::kVerticalText:
- case ui::CursorType::kCell:
- case ui::CursorType::kContextMenu:
- case ui::CursorType::kZoomIn:
- case ui::CursorType::kZoomOut:
- // FIXME: Support on OS X
+ case ui::mojom::CursorType::kVerticalText:
+ case ui::mojom::CursorType::kCell:
+ case ui::mojom::CursorType::kContextMenu:
+ case ui::mojom::CursorType::kZoomIn:
+ case ui::mojom::CursorType::kZoomOut:
+ if (updateCursorFromResource(cursorInfo.type()))
+ return;
break;
-#endif
- case ui::CursorType::kNoDrop:
- case ui::CursorType::kNotAllowed:
+ case ui::mojom::CursorType::kEastWestNoResize:
+ case ui::mojom::CursorType::kNorthEastSouthWestNoResize:
+ case ui::mojom::CursorType::kNorthSouthNoResize:
+ case ui::mojom::CursorType::kNorthWestSouthEastNoResize:
+ // Use forbidden cursor matching webcursor_mac.mm and win_cursor_factory.cc
+ case ui::mojom::CursorType::kNoDrop:
+ case ui::mojom::CursorType::kNotAllowed:
shape = Qt::ForbiddenCursor;
break;
- case ui::CursorType::kNone:
+ case ui::mojom::CursorType::kNone:
shape = Qt::BlankCursor;
break;
- case ui::CursorType::kGrab:
+ case ui::mojom::CursorType::kGrab:
shape = Qt::OpenHandCursor;
break;
- case ui::CursorType::kGrabbing:
+ case ui::mojom::CursorType::kGrabbing:
shape = Qt::ClosedHandCursor;
break;
- case ui::CursorType::kCustom:
- if (cursorInfo.custom_image.colorType() == SkColorType::kN32_SkColorType) {
- QImage cursor = toQImage(cursorInfo.custom_image, QImage::Format_ARGB32);
- m_delegate->updateCursor(QCursor(QPixmap::fromImage(cursor), cursorInfo.hotspot.x(), cursorInfo.hotspot.y()));
+ case ui::mojom::CursorType::kCustom:
+ if (cursorInfo.custom_bitmap().colorType() == SkColorType::kN32_SkColorType) {
+ QImage cursor = toQImage(cursorInfo.custom_bitmap(), QImage::Format_ARGB32);
+ m_delegate->updateCursor(QCursor(QPixmap::fromImage(cursor), cursorInfo.custom_hotspot().x(), cursorInfo.custom_hotspot().y()));
return;
}
break;
}
-#if defined(USE_AURA)
- if (auraType != ui::CursorType::kNull) {
- int resourceId;
- gfx::Point hotspot;
- // GetCursorDataFor only knows hotspots for 1x and 2x cursor images, in physical pixels.
- qreal hotspotDpr = m_screenInfo.device_scale_factor <= 1.0f ? 1.0f : 2.0f;
- if (ui::GetCursorDataFor(ui::CursorSize::kNormal, auraType, hotspotDpr, &resourceId, &hotspot)) {
- if (const gfx::ImageSkia *imageSkia = ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(resourceId)) {
- QImage imageQt = toQImage(imageSkia->GetRepresentation(m_screenInfo.device_scale_factor));
-
- // Convert hotspot coordinates into device-independent pixels.
- qreal hotX = hotspot.x() / hotspotDpr;
- qreal hotY = hotspot.y() / hotspotDpr;
-
-#if defined(Q_OS_LINUX)
- // QTBUG-68571: On Linux (xcb, wayland, eglfs), hotspot coordinates must be in physical pixels.
- qreal imageDpr = imageQt.devicePixelRatio();
- hotX *= imageDpr;
- hotY *= imageDpr;
-#endif
-
- m_delegate->updateCursor(QCursor(QPixmap::fromImage(std::move(imageQt)), qRound(hotX), qRound(hotY)));
- return;
- }
- }
- }
-#endif
m_delegate->updateCursor(QCursor(shape));
}
+content::CursorManager *RenderWidgetHostViewQt::GetCursorManager()
+{
+ return m_cursorManager.get();
+}
+
void RenderWidgetHostViewQt::SetIsLoading(bool)
{
// We use WebContentsDelegateQt::LoadingStateChanged to notify about loading state.
@@ -712,7 +615,9 @@ void RenderWidgetHostViewQt::ImeCancelComposition()
qApp->inputMethod()->reset();
}
-void RenderWidgetHostViewQt::ImeCompositionRangeChanged(const gfx::Range&, const std::vector<gfx::Rect>&)
+void RenderWidgetHostViewQt::ImeCompositionRangeChanged(const gfx::Range &,
+ const absl::optional<std::vector<gfx::Rect>> &,
+ const absl::optional<std::vector<gfx::Rect>> &)
{
// FIXME: not implemented?
QT_NOT_YET_IMPLEMENTED
@@ -723,50 +628,37 @@ void RenderWidgetHostViewQt::RenderProcessGone()
Destroy();
}
-void RenderWidgetHostViewQt::Destroy()
+bool RenderWidgetHostViewQt::TransformPointToCoordSpaceForView(const gfx::PointF &point,
+ content::RenderWidgetHostViewBase *target_view,
+ gfx::PointF *transformed_point)
{
- delete this;
-}
-
-void RenderWidgetHostViewQt::SetTooltipText(const base::string16 &tooltip_text)
-{
- DisplayTooltipText(tooltip_text);
-}
+ if (target_view == this) {
+ *transformed_point = point;
+ return true;
+ }
-void RenderWidgetHostViewQt::DisplayTooltipText(const base::string16 &tooltip_text)
-{
- if (m_adapterClient)
- m_adapterClient->setToolTip(toQt(tooltip_text));
+ return target_view->TransformPointToLocalCoordSpace(point, GetCurrentSurfaceId(), transformed_point);
}
-void RenderWidgetHostViewQt::DidCreateNewRendererCompositorFrameSink(viz::mojom::CompositorFrameSinkClient *frameSinkClient)
+void RenderWidgetHostViewQt::Destroy()
{
- DCHECK(!m_enableViz);
- m_compositor->setFrameSinkClient(frameSinkClient);
+ delete this;
}
-void RenderWidgetHostViewQt::SubmitCompositorFrame(const viz::LocalSurfaceId &local_surface_id, viz::CompositorFrame frame, base::Optional<viz::HitTestRegionList> hit_test_region_list)
+void RenderWidgetHostViewQt::UpdateTooltipUnderCursor(const std::u16string &tooltip_text)
{
- DCHECK(!m_enableViz);
-
- // Force to process swap messages
- uint32_t frame_token = frame.metadata.frame_token;
- if (frame_token)
- OnFrameTokenChangedForView(frame_token);
-
- m_compositor->submitFrame(
- std::move(frame),
- base::BindOnce(&RenderWidgetHostViewQt::callUpdate, base::Unretained(this)));
+ UpdateTooltip(tooltip_text);
}
-void RenderWidgetHostViewQt::GetScreenInfo(content::ScreenInfo *results)
+void RenderWidgetHostViewQt::UpdateTooltip(const std::u16string &tooltip_text)
{
- *results = m_screenInfo;
+ if (host()->delegate() && m_adapterClient)
+ m_adapterClient->setToolTip(toQt(tooltip_text));
}
gfx::Rect RenderWidgetHostViewQt::GetBoundsInRootWindow()
{
- return m_windowRectInDips;
+ return toGfx(delegateClient()->windowRectInDips());
}
void RenderWidgetHostViewQt::OnUpdateTextInputStateCalled(content::TextInputManager *text_input_manager, RenderWidgetHostViewBase *updated_view, bool did_update_state)
@@ -775,29 +667,29 @@ void RenderWidgetHostViewQt::OnUpdateTextInputStateCalled(content::TextInputMana
Q_UNUSED(updated_view);
Q_UNUSED(did_update_state);
- const content::TextInputState *state = text_input_manager_->GetTextInputState();
+ const ui::mojom::TextInputState *state = text_input_manager_->GetTextInputState();
if (!state) {
- m_delegate->inputMethodStateChanged(false /*editorVisible*/, false /*passwordInput*/);
- m_delegate->setInputMethodHints(Qt::ImhNone);
+ // Do not reset input method state here because an editable node might be still focused and
+ // this would hide the virtual keyboard if a child of the focused node is removed.
return;
}
ui::TextInputType type = getTextInputType();
-#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
m_delegate->setInputMethodHints(toQtInputMethodHints(getTextInputType()) | Qt::ImhNoPredictiveText | Qt::ImhNoTextHandles | Qt::ImhNoEditMenu);
-#else
- m_delegate->setInputMethodHints(toQtInputMethodHints(getTextInputType()) | Qt::ImhNoPredictiveText);
-#endif
- m_surroundingText = toQt(state->value);
+ QString surroundingText = toQt(state->value);
// Remove IME composition text from the surrounding text
- if (state->composition_start != -1 && state->composition_end != -1)
- m_surroundingText.remove(state->composition_start, state->composition_end - state->composition_start);
+ if (state->composition.has_value())
+ surroundingText.remove(state->composition->start(),
+ state->composition->end() - state->composition->start());
+ delegateClient()->setSurroundingText(surroundingText);
// In case of text selection, the update is expected in RenderWidgetHostViewQt::selectionChanged().
if (GetSelectedText().empty()) {
- // At this point it is unknown whether the text input state has been updated due to a text selection.
- // Keep the cursor position updated for cursor movements too.
- m_cursorPosition = state->selection_start;
+ if (state->composition.has_value()) {
+ delegateClient()->setCursorPosition(state->composition->start());
+ } else {
+ delegateClient()->setCursorPosition(state->selection.start());
+ }
m_delegate->inputMethodStateChanged(type != ui::TEXT_INPUT_TYPE_NONE, type == ui::TEXT_INPUT_TYPE_PASSWORD);
}
@@ -807,14 +699,14 @@ void RenderWidgetHostViewQt::OnUpdateTextInputStateCalled(content::TextInputMana
}
// Ignore selection change triggered by ime composition unless it clears an actual text selection
- if (state->composition_start != -1 && m_emptyPreviousSelection) {
+ if (state->composition.has_value() && delegateClient()->isPreviousSelectionEmpty()) {
m_imState = 0;
return;
}
m_imState |= ImStateFlags::TextInputStateUpdated;
if (m_imState == ImStateFlags::AllFlags)
- selectionChanged();
+ delegateClient()->selectionChanged();
}
void RenderWidgetHostViewQt::OnSelectionBoundsChanged(content::TextInputManager *text_input_manager, RenderWidgetHostViewBase *updated_view)
@@ -825,7 +717,7 @@ void RenderWidgetHostViewQt::OnSelectionBoundsChanged(content::TextInputManager
m_imState |= ImStateFlags::TextSelectionBoundsUpdated;
if (m_imState == ImStateFlags::AllFlags
|| (m_imState == ImStateFlags::TextSelectionFlags && getTextInputType() == ui::TEXT_INPUT_TYPE_NONE)) {
- selectionChanged();
+ delegateClient()->selectionChanged();
}
}
@@ -834,95 +726,30 @@ void RenderWidgetHostViewQt::OnTextSelectionChanged(content::TextInputManager *t
Q_UNUSED(text_input_manager);
Q_UNUSED(updated_view);
- const content::TextInputManager::TextSelection *selection = GetTextInputManager()->GetTextSelection(updated_view);
- if (!selection)
- return;
+ // We obtain the TextSelection from focused RWH which is obtained from the
+ // frame tree.
+ content::RenderWidgetHostViewBase *focused_view =
+ GetFocusedWidget() ? GetFocusedWidget()->GetView() : nullptr;
+
+ if (!focused_view)
+ return;
#if defined(USE_OZONE)
- if (!selection->selected_text().empty() && selection->user_initiated()) {
- // Set the CLIPBOARD_TYPE_SELECTION to the ui::Clipboard.
- ui::ScopedClipboardWriter clipboard_writer(ui::ClipboardBuffer::kSelection);
- clipboard_writer.WriteText(selection->selected_text());
+ if (ui::Clipboard::IsSupportedClipboardBuffer(ui::ClipboardBuffer::kSelection)) {
+ const content::TextInputManager::TextSelection *selection = GetTextInputManager()->GetTextSelection(focused_view);
+ if (selection->selected_text().length() && selection->user_initiated()) {
+ // Set the ClipboardBuffer::kSelection to the ui::Clipboard.
+ ui::ScopedClipboardWriter clipboard_writer(ui::ClipboardBuffer::kSelection);
+ clipboard_writer.WriteText(selection->selected_text());
+ }
}
#endif // defined(USE_OZONE)
m_imState |= ImStateFlags::TextSelectionUpdated;
if (m_imState == ImStateFlags::AllFlags
|| (m_imState == ImStateFlags::TextSelectionFlags && getTextInputType() == ui::TEXT_INPUT_TYPE_NONE)) {
- selectionChanged();
- }
-}
-
-void RenderWidgetHostViewQt::selectionChanged()
-{
- // Reset input manager state
- m_imState = 0;
- ui::TextInputType type = getTextInputType();
-
- // Handle text selection out of an input field
- if (type == ui::TEXT_INPUT_TYPE_NONE) {
- if (GetSelectedText().empty() && m_emptyPreviousSelection)
- return;
-
- // Reset position values to emit selectionChanged signal when clearing text selection
- // by clicking into an input field. These values are intended to be used by inputMethodQuery
- // so they are not expected to be valid when selection is out of an input field.
- m_anchorPositionWithinSelection = -1;
- m_cursorPositionWithinSelection = -1;
-
- m_emptyPreviousSelection = GetSelectedText().empty();
- m_adapterClient->selectionChanged();
- return;
- }
-
- if (GetSelectedText().empty()) {
- // RenderWidgetHostViewQt::OnUpdateTextInputStateCalled() does not update the cursor position
- // if the selection is cleared because TextInputState changes before the TextSelection change.
- Q_ASSERT(text_input_manager_->GetTextInputState());
- m_cursorPosition = text_input_manager_->GetTextInputState()->selection_start;
- m_delegate->inputMethodStateChanged(true /*editorVisible*/, type == ui::TEXT_INPUT_TYPE_PASSWORD);
-
- m_anchorPositionWithinSelection = m_cursorPosition;
- m_cursorPositionWithinSelection = m_cursorPosition;
-
- if (!m_emptyPreviousSelection) {
- m_emptyPreviousSelection = true;
- m_adapterClient->selectionChanged();
- }
-
- return;
- }
-
- const content::TextInputManager::TextSelection *selection = text_input_manager_->GetTextSelection();
- if (!selection)
- return;
-
- if (!selection->range().IsValid())
- return;
-
- int newAnchorPositionWithinSelection = 0;
- int newCursorPositionWithinSelection = 0;
-
- if (text_input_manager_->GetSelectionRegion()->anchor.type() == gfx::SelectionBound::RIGHT) {
- newAnchorPositionWithinSelection = selection->range().GetMax() - selection->offset();
- newCursorPositionWithinSelection = selection->range().GetMin() - selection->offset();
- } else {
- newAnchorPositionWithinSelection = selection->range().GetMin() - selection->offset();
- newCursorPositionWithinSelection = selection->range().GetMax() - selection->offset();
+ delegateClient()->selectionChanged();
}
-
- if (m_anchorPositionWithinSelection == newAnchorPositionWithinSelection && m_cursorPositionWithinSelection == newCursorPositionWithinSelection)
- return;
-
- m_anchorPositionWithinSelection = newAnchorPositionWithinSelection;
- m_cursorPositionWithinSelection = newCursorPositionWithinSelection;
-
- if (!selection->selected_text().empty())
- m_cursorPosition = newCursorPositionWithinSelection;
-
- m_emptyPreviousSelection = selection->selected_text().empty();
- m_delegate->inputMethodStateChanged(true /*editorVisible*/, type == ui::TEXT_INPUT_TYPE_PASSWORD);
- m_adapterClient->selectionChanged();
}
void RenderWidgetHostViewQt::OnGestureEvent(const ui::GestureEventData& gesture)
@@ -938,16 +765,16 @@ void RenderWidgetHostViewQt::OnGestureEvent(const ui::GestureEventData& gesture)
if (m_touchSelectionController && m_touchSelectionControllerClient) {
switch (event.GetType()) {
- case blink::WebInputEvent::kGestureLongPress:
+ case blink::WebInputEvent::Type::kGestureLongPress:
m_touchSelectionController->HandleLongPressEvent(event.TimeStamp(), event.PositionInWidget());
break;
- case blink::WebInputEvent::kGestureTap:
+ case blink::WebInputEvent::Type::kGestureTap:
m_touchSelectionController->HandleTapEvent(event.PositionInWidget(), event.data.tap.tap_count);
break;
- case blink::WebInputEvent::kGestureScrollBegin:
+ case blink::WebInputEvent::Type::kGestureScrollBegin:
m_touchSelectionControllerClient->onScrollBegin();
break;
- case blink::WebInputEvent::kGestureScrollEnd:
+ case blink::WebInputEvent::Type::kGestureScrollEnd:
m_touchSelectionControllerClient->onScrollEnd();
break;
default:
@@ -955,7 +782,8 @@ void RenderWidgetHostViewQt::OnGestureEvent(const ui::GestureEventData& gesture)
}
}
- host()->ForwardGestureEvent(event);
+ if (host()->delegate() && host()->delegate()->GetInputEventRouter())
+ host()->delegate()->GetInputEventRouter()->RouteGestureEvent(this, &event, ui::LatencyInfo());
}
void RenderWidgetHostViewQt::DidStopFlinging()
@@ -973,281 +801,46 @@ viz::ScopedSurfaceIdAllocator RenderWidgetHostViewQt::DidUpdateVisualProperties(
void RenderWidgetHostViewQt::OnDidUpdateVisualPropertiesComplete(const cc::RenderFrameMetadata &metadata)
{
- synchronizeVisualProperties(metadata.local_surface_id_allocation);
-}
-
-void RenderWidgetHostViewQt::OnDidFirstVisuallyNonEmptyPaint()
-{
- if (m_loadVisuallyCommittedState == NotCommitted) {
- m_loadVisuallyCommittedState = DidFirstVisuallyNonEmptyPaint;
- } else if (m_loadVisuallyCommittedState == DidFirstCompositorFrameSwap) {
- m_adapterClient->loadVisuallyCommitted();
- m_loadVisuallyCommittedState = NotCommitted;
- }
-}
-
-void RenderWidgetHostViewQt::scheduleUpdate()
-{
- DCHECK(m_enableViz);
- m_taskRunner->PostTask(
- FROM_HERE,
- base::BindOnce(&RenderWidgetHostViewQt::callUpdate, m_weakPtrFactory.GetWeakPtr()));
-}
-
-void RenderWidgetHostViewQt::callUpdate()
-{
- m_delegate->update();
-
- if (m_loadVisuallyCommittedState == NotCommitted) {
- m_loadVisuallyCommittedState = DidFirstCompositorFrameSwap;
- } else if (m_loadVisuallyCommittedState == DidFirstVisuallyNonEmptyPaint) {
- m_adapterClient->loadVisuallyCommitted();
- m_loadVisuallyCommittedState = NotCommitted;
- }
+ synchronizeVisualProperties(metadata.local_surface_id);
}
-QSGNode *RenderWidgetHostViewQt::updatePaintNode(QSGNode *oldNode)
+Compositor::Id RenderWidgetHostViewQt::compositorId()
{
- if (m_enableViz)
- return m_displayFrameSink->updatePaintNode(oldNode, m_delegate.get());
- return m_compositor->updatePaintNode(oldNode, m_delegate.get());
+ return m_uiCompositor->frame_sink_id();
}
void RenderWidgetHostViewQt::notifyShown()
{
- if (m_enableViz) {
- // Handle possible frame eviction:
- if (!m_dfhLocalSurfaceIdAllocator.HasValidLocalSurfaceIdAllocation())
- m_dfhLocalSurfaceIdAllocator.GenerateId();
- if (m_visible)
- return;
- m_visible = true;
- }
+ // Handle possible frame eviction:
+ if (!m_dfhLocalSurfaceIdAllocator.HasValidLocalSurfaceId())
+ m_dfhLocalSurfaceIdAllocator.GenerateId();
+ if (m_visible)
+ return;
+ m_visible = true;
- host()->WasShown(base::nullopt);
+ host()->WasShown(nullptr);
- if (m_enableViz) {
- m_delegatedFrameHost->AttachToCompositor(m_uiCompositor.get());
- m_delegatedFrameHost->WasShown(GetLocalSurfaceIdAllocation().local_surface_id(),
- m_viewRectInDips.size(),
- base::nullopt);
- }
+ m_delegatedFrameHost->AttachToCompositor(m_uiCompositor.get());
+ m_delegatedFrameHost->WasShown(GetLocalSurfaceId(),
+ toGfx(delegateClient()->viewRectInDips().size()),
+ nullptr);
}
void RenderWidgetHostViewQt::notifyHidden()
{
- if (m_enableViz) {
- if (!m_visible)
- return;
- m_visible = false;
- host()->WasHidden();
- m_delegatedFrameHost->WasHidden(content::DelegatedFrameHost::HiddenCause::kOther);
- m_delegatedFrameHost->DetachFromCompositor();
- } else {
- host()->WasHidden();
- }
-}
-
-void RenderWidgetHostViewQt::visualPropertiesChanged()
-{
- if (!m_delegate)
+ if (!m_visible)
return;
-
- gfx::Rect oldViewRect = m_viewRectInDips;
- m_viewRectInDips = toGfx(m_delegate->viewGeometry().toAlignedRect());
-
- gfx::Rect oldWindowRect = m_windowRectInDips;
- m_windowRectInDips = toGfx(m_delegate->windowGeometry());
-
- QWindow *window = m_delegate->window();
- content::ScreenInfo oldScreenInfo = m_screenInfo;
- m_screenInfo = screenInfoFromQScreen(window ? window->screen() : nullptr);
-
- if (m_viewRectInDips != oldViewRect || m_windowRectInDips != oldWindowRect)
- host()->SendScreenRects();
-
- if (m_viewRectInDips.size() != oldViewRect.size() || m_screenInfo != oldScreenInfo)
- synchronizeVisualProperties(base::nullopt);
+ m_visible = false;
+ host()->WasHidden();
+ m_delegatedFrameHost->WasHidden(content::DelegatedFrameHost::HiddenCause::kOther);
+ m_delegatedFrameHost->DetachFromCompositor();
}
-bool RenderWidgetHostViewQt::forwardEvent(QEvent *event)
+void RenderWidgetHostViewQt::ProcessAckedTouchEvent(const content::TouchEventWithLatencyInfo &touch, blink::mojom::InputEventResultState ack_result)
{
- Q_ASSERT(host()->GetView());
-
- switch (event->type()) {
- case QEvent::ShortcutOverride: {
- QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
-
- auto acceptKeyOutOfInputField = [](QKeyEvent *keyEvent) -> bool {
-#ifdef Q_OS_MACOS
- // Check if a shortcut is registered for this key sequence.
- QKeySequence sequence = QKeySequence (
- (keyEvent->modifiers() | keyEvent->key()) &
- ~(Qt::KeypadModifier | Qt::GroupSwitchModifier));
- if (QGuiApplicationPrivate::instance()->shortcutMap.hasShortcutForKeySequence(sequence))
- return false;
-
- // The following shortcuts are handled out of input field too but
- // disabled on macOS to let the blinking menu handling to the
- // embedder application (see kKeyboardCodeKeyDownEntries in
- // third_party/WebKit/Source/core/editing/EditingBehavior.cpp).
- // Let them pass on macOS to generate the corresponding edit command.
- return keyEvent->matches(QKeySequence::Copy)
- || keyEvent->matches(QKeySequence::Paste)
- || keyEvent->matches(QKeySequence::Cut)
- || keyEvent->matches(QKeySequence::SelectAll);
-#else
- return false;
-#endif
- };
-
- if (!inputMethodQuery(Qt::ImEnabled).toBool() && !(inputMethodQuery(Qt::ImHints).toInt() & Qt::ImhHiddenText) && !acceptKeyOutOfInputField(keyEvent))
- return false;
-
- Q_ASSERT(m_editCommand.empty());
- if (WebEventFactory::getEditCommand(keyEvent, &m_editCommand)
- || isCommonTextEditShortcut(keyEvent)) {
- event->accept();
- return true;
- }
-
- return false;
- }
- case QEvent::MouseButtonPress:
- Focus();
- Q_FALLTHROUGH();
- case QEvent::MouseButtonRelease:
- case QEvent::MouseMove:
- // Skip second MouseMove event when a window is being adopted, so that Chromium
- // can properly handle further move events.
- // Also make sure the adapter client exists to prevent a null pointer dereference,
- // because it's possible for a QWebEnginePagePrivate (adapter) instance to be destroyed,
- // and then the OS (observed on Windows) might still send mouse move events to a still
- // existing popup RWHVQDW instance.
- if (m_adapterClient && m_adapterClient->isBeingAdopted())
- return false;
- handleMouseEvent(static_cast<QMouseEvent*>(event));
- break;
- case QEvent::KeyPress:
- case QEvent::KeyRelease:
- handleKeyEvent(static_cast<QKeyEvent*>(event));
- break;
- case QEvent::Wheel:
- handleWheelEvent(static_cast<QWheelEvent*>(event));
- break;
- case QEvent::TouchBegin:
- Focus();
- Q_FALLTHROUGH();
- case QEvent::TouchUpdate:
- case QEvent::TouchEnd:
- case QEvent::TouchCancel:
- handleTouchEvent(static_cast<QTouchEvent*>(event));
- break;
-#if QT_CONFIG(tabletevent)
- case QEvent::TabletPress:
- Focus();
- Q_FALLTHROUGH();
- case QEvent::TabletRelease:
- case QEvent::TabletMove:
- handleTabletEvent(static_cast<QTabletEvent*>(event));
- break;
-#endif
-#ifndef QT_NO_GESTURES
- case QEvent::NativeGesture:
- handleGestureEvent(static_cast<QNativeGestureEvent *>(event));
- break;
-#endif // QT_NO_GESTURES
- case QEvent::HoverMove:
- handleHoverEvent(static_cast<QHoverEvent*>(event));
- break;
- case QEvent::FocusIn:
- case QEvent::FocusOut:
- handleFocusEvent(static_cast<QFocusEvent*>(event));
- break;
- case QEvent::InputMethod:
- handleInputMethodEvent(static_cast<QInputMethodEvent*>(event));
- break;
- case QEvent::InputMethodQuery:
- handleInputMethodQueryEvent(static_cast<QInputMethodQueryEvent*>(event));
- break;
- case QEvent::Leave:
-#ifdef Q_OS_WIN
- if (m_mouseButtonPressed > 0)
- return false;
-#endif
- case QEvent::HoverLeave:
- host()->ForwardMouseEvent(WebEventFactory::toWebMouseEvent(event));
- break;
- default:
- return false;
- }
- return true;
-}
-
-QVariant RenderWidgetHostViewQt::inputMethodQuery(Qt::InputMethodQuery query)
-{
- switch (query) {
- case Qt::ImEnabled: {
- ui::TextInputType type = getTextInputType();
- bool editorVisible = type != ui::TEXT_INPUT_TYPE_NONE;
- // IME manager should disable composition on input fields with ImhHiddenText hint if supported
- if (m_imeHasHiddenTextCapability)
- return QVariant(editorVisible);
-
- bool passwordInput = type == ui::TEXT_INPUT_TYPE_PASSWORD;
- return QVariant(editorVisible && !passwordInput);
- }
- case Qt::ImFont:
- // TODO: Implement this
- return QVariant();
- case Qt::ImCursorRectangle: {
- if (text_input_manager_) {
- if (auto *region = text_input_manager_->GetSelectionRegion()) {
- if (region->focus.GetHeight() > 0) {
- gfx::Rect caretRect = gfx::RectBetweenSelectionBounds(region->anchor, region->focus);
- if (caretRect.width() == 0)
- caretRect.set_width(1); // IME API on Windows expects a width > 0
- return toQt(caretRect);
- }
- }
- }
- return QVariant();
- }
- case Qt::ImCursorPosition:
- return m_cursorPosition;
- case Qt::ImAnchorPosition:
- return GetSelectedText().empty() ? m_cursorPosition : m_anchorPositionWithinSelection;
- case Qt::ImSurroundingText:
- return m_surroundingText;
- case Qt::ImCurrentSelection:
- return toQt(GetSelectedText());
- case Qt::ImMaximumTextLength:
- // TODO: Implement this
- return QVariant(); // No limit.
- case Qt::ImHints:
-#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
- return int(toQtInputMethodHints(getTextInputType()) | Qt::ImhNoPredictiveText | Qt::ImhNoTextHandles | Qt::ImhNoEditMenu);
-#else
- return int(toQtInputMethodHints(getTextInputType()) | Qt::ImhNoPredictiveText);
-#endif
- default:
- return QVariant();
- }
-}
-
-void RenderWidgetHostViewQt::closePopup()
-{
- // We notify the popup to be closed by telling it that it lost focus. WebKit does the rest
- // (hiding the widget and automatic memory cleanup via
- // RenderWidget::CloseWidgetSoon() -> RenderWidgetHostImpl::ShutdownAndDestroyWidget(true).
- host()->SetActive(false);
- host()->LostFocus();
-}
-
-void RenderWidgetHostViewQt::ProcessAckedTouchEvent(const content::TouchEventWithLatencyInfo &touch, content::InputEventAckState ack_result) {
- Q_UNUSED(touch);
- const bool eventConsumed = ack_result == content::INPUT_EVENT_ACK_STATE_CONSUMED;
- m_gestureProvider.OnTouchEventAck(touch.event.unique_touch_event_id, eventConsumed, /*fixme: ?? */false);
+ const bool eventConsumed = (ack_result == blink::mojom::InputEventResultState::kConsumed);
+ const bool isSetBlocking = content::InputEventResultStateIsSetBlocking(ack_result);
+ m_gestureProvider.OnTouchEventAck(touch.event.unique_touch_event_id, eventConsumed, isSetBlocking);
}
void RenderWidgetHostViewQt::processMotionEvent(const ui::MotionEvent &motionEvent)
@@ -1255,287 +848,53 @@ void RenderWidgetHostViewQt::processMotionEvent(const ui::MotionEvent &motionEve
auto result = m_gestureProvider.OnTouchEvent(motionEvent);
if (!result.succeeded)
return;
-
blink::WebTouchEvent touchEvent = ui::CreateWebTouchEventFromMotionEvent(motionEvent,
result.moved_beyond_slop_region,
false /*hovering, FIXME ?*/);
- host()->ForwardTouchEventWithLatencyInfo(touchEvent, CreateLatencyInfo(touchEvent));
-}
-
-QList<QTouchEvent::TouchPoint> RenderWidgetHostViewQt::mapTouchPointIds(const QList<QTouchEvent::TouchPoint> &inputPoints)
-{
- QList<QTouchEvent::TouchPoint> outputPoints = inputPoints;
- for (int i = 0; i < outputPoints.size(); ++i) {
- QTouchEvent::TouchPoint &point = outputPoints[i];
-
- int qtId = point.id();
- QMap<int, int>::const_iterator it = m_touchIdMapping.find(qtId);
- if (it == m_touchIdMapping.end())
- it = m_touchIdMapping.insert(qtId, firstAvailableId(m_touchIdMapping));
- point.setId(it.value());
-
- if (point.state() == Qt::TouchPointReleased)
- m_touchIdMapping.remove(qtId);
- }
-
- return outputPoints;
+ if (host()->delegate() && host()->delegate()->GetInputEventRouter())
+ host()->delegate()->GetInputEventRouter()->RouteTouchEvent(this, &touchEvent, CreateLatencyInfo(touchEvent));
}
-bool RenderWidgetHostViewQt::IsPopup() const
+bool RenderWidgetHostViewQt::isPopup() const
{
return widget_type_ == content::WidgetType::kPopup;
}
-void RenderWidgetHostViewQt::handleMouseEvent(QMouseEvent* event)
-{
- if (event->type() == QEvent::MouseButtonPress)
- m_mouseButtonPressed++;
- if (event->type() == QEvent::MouseButtonRelease)
- m_mouseButtonPressed--;
-
- // Don't forward mouse events synthesized by the system, which are caused by genuine touch
- // events. Chromium would then process for e.g. a mouse click handler twice, once due to the
- // system synthesized mouse event, and another time due to a touch-to-gesture-to-mouse
- // transformation done by Chromium.
- if (event->source() == Qt::MouseEventSynthesizedBySystem)
- return;
- handlePointerEvent<QMouseEvent>(event);
-}
-
-void RenderWidgetHostViewQt::handleKeyEvent(QKeyEvent *ev)
-{
- if (IsMouseLocked() && ev->key() == Qt::Key_Escape && ev->type() == QEvent::KeyRelease)
- UnlockMouse();
-
- if (m_receivedEmptyImeEvent) {
- // IME composition was not finished with a valid commit string.
- // We're getting the composition result in a key event.
- if (ev->key() != 0) {
- // The key event is not a result of an IME composition. Cancel IME.
- host()->ImeCancelComposition();
- m_receivedEmptyImeEvent = false;
- } else {
- if (ev->type() == QEvent::KeyRelease) {
- host()->ImeCommitText(toString16(ev->text()),
- std::vector<ui::ImeTextSpan>(),
- gfx::Range::InvalidRange(),
- 0);
- m_receivedEmptyImeEvent = false;
- m_imeInProgress = false;
- }
- return;
- }
- }
-
- // Ignore autorepeating KeyRelease events so that the generated web events
- // conform to the spec, which requires autorepeat to result in a sequence of
- // keypress events and only one final keyup event:
- // https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Auto-repeat_handling
- // https://w3c.github.io/uievents/#dom-keyboardevent-repeat
- if (ev->type() == QEvent::KeyRelease && ev->isAutoRepeat())
- return;
-
- content::NativeWebKeyboardEvent webEvent = WebEventFactory::toWebKeyboardEvent(ev);
- if (webEvent.GetType() == blink::WebInputEvent::kRawKeyDown && !m_editCommand.empty()) {
- ui::LatencyInfo latency;
- latency.set_source_event_type(ui::SourceEventType::KEY_PRESS);
- content::EditCommands commands;
- commands.emplace_back(m_editCommand, "");
- m_editCommand.clear();
- host()->ForwardKeyboardEventWithCommands(webEvent, latency, &commands, nullptr);
- return;
- }
-
- bool keyDownTextInsertion = webEvent.GetType() == blink::WebInputEvent::kRawKeyDown && webEvent.text[0];
- webEvent.skip_in_browser = keyDownTextInsertion;
- host()->ForwardKeyboardEvent(webEvent);
-
- if (keyDownTextInsertion) {
- // Blink won't consume the RawKeyDown, but rather the Char event in this case.
- // The RawKeyDown is skipped on the way back (see above).
- // The same os_event will be set on both NativeWebKeyboardEvents.
- webEvent.skip_in_browser = false;
- webEvent.SetType(blink::WebInputEvent::kChar);
- host()->ForwardKeyboardEvent(webEvent);
- }
-}
-
-void RenderWidgetHostViewQt::handleInputMethodEvent(QInputMethodEvent *ev)
+bool RenderWidgetHostViewQt::updateScreenInfo()
{
- // Reset input manager state
- m_imState = 0;
-
- if (!host())
- return;
-
- QString commitString = ev->commitString();
- QString preeditString = ev->preeditString();
-
- int cursorPositionInPreeditString = -1;
- gfx::Range selectionRange = gfx::Range::InvalidRange();
-
- const QList<QInputMethodEvent::Attribute> &attributes = ev->attributes();
- std::vector<ui::ImeTextSpan> underlines;
- bool hasSelection = false;
-
- for (const auto &attribute : attributes) {
- switch (attribute.type) {
- case QInputMethodEvent::TextFormat: {
- if (preeditString.isEmpty())
- break;
-
- int start = qMin(attribute.start, (attribute.start + attribute.length));
- int end = qMax(attribute.start, (attribute.start + attribute.length));
-
- // Blink does not support negative position values. Adjust start and end positions
- // to non-negative values.
- if (start < 0) {
- start = 0;
- end = qMax(0, start + end);
- }
-
- underlines.push_back(ui::ImeTextSpan(ui::ImeTextSpan::Type::kComposition, start, end, ui::ImeTextSpan::Thickness::kThin, SK_ColorTRANSPARENT));
-
- QTextCharFormat format = qvariant_cast<QTextFormat>(attribute.value).toCharFormat();
- if (format.underlineStyle() != QTextCharFormat::NoUnderline)
- underlines.back().underline_color = toSk(format.underlineColor());
-
- break;
- }
- case QInputMethodEvent::Cursor:
- // Always set the position of the cursor, even if it's marked invisible by Qt, otherwise
- // there is no way the user will know which part of the composition string will be
- // changed, when performing an IME-specific action (like selecting a different word
- // suggestion).
- cursorPositionInPreeditString = attribute.start;
- break;
- case QInputMethodEvent::Selection:
- hasSelection = true;
-
- // Cancel IME composition
- if (preeditString.isEmpty() && attribute.start + attribute.length == 0) {
- selectionRange.set_start(0);
- selectionRange.set_end(0);
- break;
- }
-
- selectionRange.set_start(qMin(attribute.start, (attribute.start + attribute.length)));
- selectionRange.set_end(qMax(attribute.start, (attribute.start + attribute.length)));
- break;
- default:
- break;
- }
- }
- if (!selectionRange.IsValid()) {
- // We did not receive a valid selection range, hence the range is going to mark the
- // cursor position.
- int newCursorPosition =
- (cursorPositionInPreeditString < 0) ? preeditString.length()
- : cursorPositionInPreeditString;
- selectionRange.set_start(newCursorPosition);
- selectionRange.set_end(newCursorPosition);
- }
-
- if (hasSelection) {
- content::mojom::FrameInputHandler *frameInputHandler = getFrameInputHandler();
- if (frameInputHandler)
- frameInputHandler->SetEditableSelectionOffsets(selectionRange.start(), selectionRange.end());
- }
-
- int replacementLength = ev->replacementLength();
- gfx::Range replacementRange = gfx::Range::InvalidRange();
-
- if (replacementLength > 0)
- {
- int replacementStart = ev->replacementStart() < 0 ? m_cursorPosition + ev->replacementStart() : ev->replacementStart();
- if (replacementStart >= 0 && replacementStart < m_surroundingText.length())
- replacementRange = gfx::Range(replacementStart, replacementStart + replacementLength);
- }
-
- // There are so-far two known cases, when an empty QInputMethodEvent is received.
- // First one happens when backspace is used to remove the last character in the pre-edit
- // string, thus signaling the end of the composition.
- // The second one happens (on Windows) when a Korean char gets composed, but instead of
- // the event having a commit string, both strings are empty, and the actual char is received
- // as a QKeyEvent after the QInputMethodEvent is processed.
- // In lieu of the second case, we can't simply cancel the composition on an empty event,
- // and then add the Korean char when QKeyEvent is received, because that leads to text
- // flickering in the textarea (or any other element).
- // Instead we postpone the processing of the empty QInputMethodEvent by posting it
- // to the same focused object, and cancelling the composition on the next event loop tick.
- if (commitString.isEmpty() && preeditString.isEmpty() && replacementLength == 0) {
- if (!m_receivedEmptyImeEvent && m_imeInProgress && !hasSelection) {
- m_receivedEmptyImeEvent = true;
- QInputMethodEvent *eventCopy = new QInputMethodEvent(*ev);
- QGuiApplication::postEvent(qApp->focusObject(), eventCopy);
- } else {
- m_receivedEmptyImeEvent = false;
- if (m_imeInProgress) {
- m_imeInProgress = false;
- host()->ImeCancelComposition();
- }
- }
-
- return;
- }
-
- m_receivedEmptyImeEvent = false;
-
- // Finish compostion: insert or erase text.
- if (!commitString.isEmpty() || replacementLength > 0) {
- host()->ImeCommitText(toString16(commitString),
- underlines,
- replacementRange,
- 0);
- m_imeInProgress = false;
- }
+ QWindow *window = m_delegate->Window();
+ if (!window)
+ return false;
- // Update or start new composition.
- // Be aware of that, we might get a commit string and a pre-edit string in a single event and
- // this means a new composition.
- if (!preeditString.isEmpty()) {
- host()->ImeSetComposition(toString16(preeditString),
- underlines,
- replacementRange,
- selectionRange.start(),
- selectionRange.end());
- m_imeInProgress = true;
- }
-}
+ display::ScreenInfos newScreenInfos = screenInfosFromQtForUpdate(window->screen());
+ if (screen_infos_ == newScreenInfos)
+ return false;
-void RenderWidgetHostViewQt::handleInputMethodQueryEvent(QInputMethodQueryEvent *ev)
-{
- Qt::InputMethodQueries queries = ev->queries();
- for (uint i = 0; i < 32; ++i) {
- Qt::InputMethodQuery query = (Qt::InputMethodQuery)(int)(queries & (1<<i));
- if (query) {
- QVariant v = inputMethodQuery(query);
- ev->setValue(query, v);
- }
- }
- ev->accept();
+ screen_infos_ = std::move(newScreenInfos);
+ return true;
}
-void RenderWidgetHostViewQt::handleWheelEvent(QWheelEvent *ev)
+void RenderWidgetHostViewQt::handleWheelEvent(QWheelEvent *event)
{
if (!m_wheelAckPending) {
Q_ASSERT(m_pendingWheelEvents.isEmpty());
- blink::WebMouseWheelEvent webEvent = WebEventFactory::toWebWheelEvent(ev);
+ blink::WebMouseWheelEvent webEvent = WebEventFactory::toWebWheelEvent(event);
m_wheelAckPending = (webEvent.phase != blink::WebMouseWheelEvent::kPhaseEnded);
- m_mouseWheelPhaseHandler.AddPhaseIfNeededAndScheduleEndEvent(webEvent, false);
- host()->ForwardWheelEvent(webEvent);
+ GetMouseWheelPhaseHandler()->AddPhaseIfNeededAndScheduleEndEvent(webEvent, true);
+ if (host()->delegate() && host()->delegate()->GetInputEventRouter())
+ host()->delegate()->GetInputEventRouter()->RouteMouseWheelEvent(this, &webEvent, ui::LatencyInfo());
return;
}
if (!m_pendingWheelEvents.isEmpty()) {
// Try to combine with this wheel event with the last pending one.
- if (WebEventFactory::coalesceWebWheelEvent(m_pendingWheelEvents.last(), ev))
+ if (WebEventFactory::coalesceWebWheelEvent(m_pendingWheelEvents.last(), event))
return;
}
- m_pendingWheelEvents.append(WebEventFactory::toWebWheelEvent(ev));
+ m_pendingWheelEvents.append(WebEventFactory::toWebWheelEvent(event));
}
-void RenderWidgetHostViewQt::WheelEventAck(const blink::WebMouseWheelEvent &event, content::InputEventAckState /*ack_result*/)
+void RenderWidgetHostViewQt::WheelEventAck(const blink::WebMouseWheelEvent &event, blink::mojom::InputEventResultState /*ack_result*/)
{
if (event.phase == blink::WebMouseWheelEvent::kPhaseEnded)
return;
@@ -1544,19 +903,22 @@ void RenderWidgetHostViewQt::WheelEventAck(const blink::WebMouseWheelEvent &even
while (!m_pendingWheelEvents.isEmpty() && !m_wheelAckPending) {
blink::WebMouseWheelEvent webEvent = m_pendingWheelEvents.takeFirst();
m_wheelAckPending = (webEvent.phase != blink::WebMouseWheelEvent::kPhaseEnded);
- m_mouseWheelPhaseHandler.AddPhaseIfNeededAndScheduleEndEvent(webEvent, false);
- host()->ForwardWheelEvent(webEvent);
+ m_mouseWheelPhaseHandler.AddPhaseIfNeededAndScheduleEndEvent(webEvent, true);
+ if (host()->delegate() && host()->delegate()->GetInputEventRouter())
+ host()->delegate()->GetInputEventRouter()->RouteMouseWheelEvent(this, &webEvent, ui::LatencyInfo());
}
}
-void RenderWidgetHostViewQt::GestureEventAck(const blink::WebGestureEvent &event, content::InputEventAckState ack_result)
+void RenderWidgetHostViewQt::GestureEventAck(const blink::WebGestureEvent &event,
+ blink::mojom::InputEventResultState ack_result,
+ blink::mojom::ScrollResultDataPtr scroll_result_data)
{
// Forward unhandled scroll events back as wheel events
- if (event.GetType() != blink::WebInputEvent::kGestureScrollUpdate)
+ if (event.GetType() != blink::WebInputEvent::Type::kGestureScrollUpdate)
return;
switch (ack_result) {
- case content::INPUT_EVENT_ACK_STATE_NOT_CONSUMED:
- case content::INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS:
+ case blink::mojom::InputEventResultState::kNotConsumed:
+ case blink::mojom::InputEventResultState::kNoConsumerExists:
WebEventFactory::sendUnhandledWheelEvent(event, delegate());
break;
default:
@@ -1569,273 +931,13 @@ content::MouseWheelPhaseHandler *RenderWidgetHostViewQt::GetMouseWheelPhaseHandl
return &m_mouseWheelPhaseHandler;
}
-void RenderWidgetHostViewQt::clearPreviousTouchMotionState()
+blink::mojom::FrameWidgetInputHandler *RenderWidgetHostViewQt::getFrameWidgetInputHandler()
{
- m_previousTouchPoints.clear();
- m_touchMotionStarted = false;
-}
-
-#ifndef QT_NO_GESTURES
-void RenderWidgetHostViewQt::handleGestureEvent(QNativeGestureEvent *ev)
-{
- const Qt::NativeGestureType type = ev->gestureType();
- // These are the only supported gestures by Chromium so far.
- if (type == Qt::ZoomNativeGesture || type == Qt::SmartZoomNativeGesture) {
- host()->ForwardGestureEvent(WebEventFactory::toWebGestureEvent(ev));
- }
-}
-#endif
-
-void RenderWidgetHostViewQt::handleTouchEvent(QTouchEvent *ev)
-{
- // On macOS instead of handling touch events, we use the OS provided QNativeGestureEvents.
-#ifdef Q_OS_MACOS
- if (ev->spontaneous()) {
- return;
- } else {
- VLOG(1)
- << "Sending simulated touch events to Chromium does not work properly on macOS. "
- "Consider using QNativeGestureEvents or QMouseEvents.";
- }
-#endif
-
- // Chromium expects the touch event timestamps to be comparable to base::TimeTicks::Now().
- // Most importantly we also have to preserve the relative time distance between events.
- // Calculate a delta between event timestamps and Now() on the first received event, and
- // apply this delta to all successive events. This delta is most likely smaller than it
- // should by calculating it here but this will hopefully cause less than one frame of delay.
- base::TimeTicks eventTimestamp = base::TimeTicks() + base::TimeDelta::FromMilliseconds(ev->timestamp());
- if (m_eventsToNowDelta == base::TimeDelta())
- m_eventsToNowDelta = base::TimeTicks::Now() - eventTimestamp;
- eventTimestamp += m_eventsToNowDelta;
-
- QList<QTouchEvent::TouchPoint> touchPoints = mapTouchPointIds(ev->touchPoints());
- // Make sure that ACTION_POINTER_DOWN is delivered before ACTION_MOVE,
- // and ACTION_MOVE before ACTION_POINTER_UP.
- std::sort(touchPoints.begin(), touchPoints.end(), compareTouchPoints);
-
- // Check first if the touch event should be routed to the selectionController
- if (!touchPoints.isEmpty()) {
- ui::MotionEvent::Action action;
- switch (touchPoints[0].state()) {
- case Qt::TouchPointPressed:
- action = ui::MotionEvent::Action::DOWN;
- break;
- case Qt::TouchPointMoved:
- action = ui::MotionEvent::Action::MOVE;
- break;
- case Qt::TouchPointReleased:
- action = ui::MotionEvent::Action::UP;
- break;
- default:
- action = ui::MotionEvent::Action::NONE;
- break;
- }
-
- MotionEventQt motionEvent(touchPoints, eventTimestamp, action, ev->modifiers(), 0);
- if (m_touchSelectionController->WillHandleTouchEvent(motionEvent)) {
- m_previousTouchPoints = touchPoints;
- ev->accept();
- return;
- }
- } else {
- // An empty touchPoints always corresponds to a TouchCancel event.
- // We can't forward touch cancellations without a previously processed touch event,
- // as Chromium expects the previous touchPoints for Action::CANCEL.
- // If both are empty that means the TouchCancel was sent without an ongoing touch,
- // so there's nothing to cancel anyway.
- touchPoints = m_previousTouchPoints;
- if (touchPoints.isEmpty())
- return;
-
- MotionEventQt cancelEvent(touchPoints, eventTimestamp, ui::MotionEvent::Action::CANCEL, ev->modifiers());
- if (m_touchSelectionController->WillHandleTouchEvent(cancelEvent)) {
- m_previousTouchPoints.clear();
- ev->accept();
- return;
- }
- }
-
- switch (ev->type()) {
- case QEvent::TouchBegin:
- m_sendMotionActionDown = true;
- m_touchMotionStarted = true;
- m_touchSelectionControllerClient->onTouchDown();
- break;
- case QEvent::TouchUpdate:
- m_touchMotionStarted = true;
- break;
- case QEvent::TouchCancel:
- {
- // Only process TouchCancel events received following a TouchBegin or TouchUpdate event
- if (m_touchMotionStarted) {
- MotionEventQt cancelEvent(touchPoints, eventTimestamp, ui::MotionEvent::Action::CANCEL, ev->modifiers());
- processMotionEvent(cancelEvent);
- }
-
- clearPreviousTouchMotionState();
- return;
- }
- case QEvent::TouchEnd:
- clearPreviousTouchMotionState();
- m_touchSelectionControllerClient->onTouchUp();
- break;
- default:
- break;
- }
-
- if (m_imeInProgress && ev->type() == QEvent::TouchBegin) {
- m_imeInProgress = false;
- // Tell input method to commit the pre-edit string entered so far, and finish the
- // composition operation.
-#ifdef Q_OS_WIN
- // Yes the function name is counter-intuitive, but commit isn't actually implemented
- // by the Windows QPA, and reset does exactly what is necessary in this case.
- qApp->inputMethod()->reset();
-#else
- qApp->inputMethod()->commit();
-#endif
- }
-
- for (int i = 0; i < touchPoints.size(); ++i) {
- ui::MotionEvent::Action action;
- switch (touchPoints[i].state()) {
- case Qt::TouchPointPressed:
- if (m_sendMotionActionDown) {
- action = ui::MotionEvent::Action::DOWN;
- m_sendMotionActionDown = false;
- } else {
- action = ui::MotionEvent::Action::POINTER_DOWN;
- }
- break;
- case Qt::TouchPointMoved:
- action = ui::MotionEvent::Action::MOVE;
- break;
- case Qt::TouchPointReleased:
- action = touchPoints.size() > 1 ? ui::MotionEvent::Action::POINTER_UP :
- ui::MotionEvent::Action::UP;
- break;
- default:
- // Ignore Qt::TouchPointStationary
- continue;
- }
-
- MotionEventQt motionEvent(touchPoints, eventTimestamp, action, ev->modifiers(), i);
- processMotionEvent(motionEvent);
- }
-
- m_previousTouchPoints = touchPoints;
-}
-
-#if QT_CONFIG(tabletevent)
-void RenderWidgetHostViewQt::handleTabletEvent(QTabletEvent *event)
-{
- handlePointerEvent<QTabletEvent>(event);
-}
-#endif
-
-template<class T>
-void RenderWidgetHostViewQt::handlePointerEvent(T *event)
-{
- // Currently WebMouseEvent is a subclass of WebPointerProperties, so basically
- // tablet events are mouse events with extra properties.
- blink::WebMouseEvent webEvent = WebEventFactory::toWebMouseEvent(event);
- if ((webEvent.GetType() == blink::WebInputEvent::kMouseDown || webEvent.GetType() == blink::WebInputEvent::kMouseUp)
- && webEvent.button == blink::WebMouseEvent::Button::kNoButton) {
- // Blink can only handle the 3 main mouse-buttons and may assert when processing mouse-down for no button.
- LOG(INFO) << "Unhandled mouse button";
- return;
- }
-
- if (webEvent.GetType() == blink::WebInputEvent::kMouseDown) {
- if (event->button() != m_clickHelper.lastPressButton
- || (event->timestamp() - m_clickHelper.lastPressTimestamp > static_cast<ulong>(qGuiApp->styleHints()->mouseDoubleClickInterval()))
- || (event->pos() - m_clickHelper.lastPressPosition).manhattanLength() > qGuiApp->styleHints()->startDragDistance()
- || m_clickHelper.clickCounter >= 3)
- m_clickHelper.clickCounter = 0;
-
- m_clickHelper.lastPressTimestamp = event->timestamp();
- webEvent.click_count = ++m_clickHelper.clickCounter;
- m_clickHelper.lastPressButton = event->button();
- m_clickHelper.lastPressPosition = QPointF(event->pos()).toPoint();
- }
-
- webEvent.movement_x = event->globalX() - m_previousMousePosition.x();
- webEvent.movement_y = event->globalY() - m_previousMousePosition.y();
-
- if (IsMouseLocked())
- QCursor::setPos(m_previousMousePosition);
- else
- m_previousMousePosition = event->globalPos();
-
- if (m_imeInProgress && webEvent.GetType() == blink::WebInputEvent::kMouseDown) {
- m_imeInProgress = false;
- // Tell input method to commit the pre-edit string entered so far, and finish the
- // composition operation.
-#ifdef Q_OS_WIN
- // Yes the function name is counter-intuitive, but commit isn't actually implemented
- // by the Windows QPA, and reset does exactly what is necessary in this case.
- qApp->inputMethod()->reset();
-#else
- qApp->inputMethod()->commit();
-#endif
- }
-
- host()->ForwardMouseEvent(webEvent);
-}
-
-void RenderWidgetHostViewQt::handleHoverEvent(QHoverEvent *ev)
-{
- host()->ForwardMouseEvent(WebEventFactory::toWebMouseEvent(ev));
-}
-
-void RenderWidgetHostViewQt::handleFocusEvent(QFocusEvent *ev)
-{
- if (ev->gotFocus()) {
- host()->GotFocus();
- host()->SetActive(true);
- content::RenderViewHostImpl *viewHost = content::RenderViewHostImpl::From(host());
- Q_ASSERT(viewHost);
- if (ev->reason() == Qt::TabFocusReason)
- viewHost->SetInitialFocus(false);
- else if (ev->reason() == Qt::BacktabFocusReason)
- viewHost->SetInitialFocus(true);
- ev->accept();
-
- m_adapterClient->webContentsAdapter()->handlePendingMouseLockPermission();
- } else if (ev->lostFocus()) {
- host()->SetActive(false);
- host()->LostFocus();
- ev->accept();
- }
-}
-
-void RenderWidgetHostViewQt::SetNeedsBeginFrames(bool needs_begin_frames)
-{
- m_needsBeginFrames = needs_begin_frames;
- UpdateNeedsBeginFramesInternal();
-}
-
-content::RenderFrameHost *RenderWidgetHostViewQt::getFocusedFrameHost()
-{
- content::RenderViewHostImpl *viewHost = content::RenderViewHostImpl::From(host());
- if (!viewHost)
+ auto *focused_widget = GetFocusedWidget();
+ if (!focused_widget)
return nullptr;
- content::FrameTreeNode *focusedFrame = viewHost->GetDelegate()->GetFrameTree()->GetFocusedFrame();
- if (!focusedFrame)
- return nullptr;
-
- return focusedFrame->current_frame_host();
-}
-
-content::mojom::FrameInputHandler *RenderWidgetHostViewQt::getFrameInputHandler()
-{
- content::RenderFrameHostImpl *frameHost = static_cast<content::RenderFrameHostImpl *>(getFocusedFrameHost());
- if (!frameHost)
- return nullptr;
-
- return frameHost->GetFrameInputHandler();
+ return focused_widget->GetFrameWidgetInputHandler();
}
ui::TextInputType RenderWidgetHostViewQt::getTextInputType() const
@@ -1846,42 +948,42 @@ ui::TextInputType RenderWidgetHostViewQt::getTextInputType() const
return ui::TEXT_INPUT_TYPE_NONE;
}
-void RenderWidgetHostViewQt::SetWantsAnimateOnlyBeginFrames()
+viz::SurfaceId RenderWidgetHostViewQt::GetCurrentSurfaceId() const
{
- if (m_enableViz)
- m_delegatedFrameHost->SetWantsAnimateOnlyBeginFrames();
+ return m_delegatedFrameHost->GetCurrentSurfaceId();
}
-viz::SurfaceId RenderWidgetHostViewQt::GetCurrentSurfaceId() const
+const viz::FrameSinkId &RenderWidgetHostViewQt::GetFrameSinkId() const
{
- if (m_enableViz)
- return m_delegatedFrameHost->GetCurrentSurfaceId();
- return viz::SurfaceId();
+ return m_delegatedFrameHost->frame_sink_id();
}
-const viz::FrameSinkId &RenderWidgetHostViewQt::GetFrameSinkId() const
+const viz::LocalSurfaceId &RenderWidgetHostViewQt::GetLocalSurfaceId() const
{
- if (m_enableViz)
- return m_delegatedFrameHost->frame_sink_id();
- return m_frameSinkId;
+ return m_dfhLocalSurfaceIdAllocator.GetCurrentLocalSurfaceId();
+}
+
+void RenderWidgetHostViewQt::FocusedNodeChanged(bool is_editable_node, const gfx::Rect& node_bounds_in_screen)
+{
+ Q_UNUSED(node_bounds_in_screen);
+ if (!is_editable_node) {
+ m_delegate->inputMethodStateChanged(false /*editorVisible*/, false /*passwordInput*/);
+ m_delegate->setInputMethodHints(Qt::ImhNone);
+ }
}
-const viz::LocalSurfaceIdAllocation &RenderWidgetHostViewQt::GetLocalSurfaceIdAllocation() const
+base::flat_map<std::string, std::string> RenderWidgetHostViewQt::GetKeyboardLayoutMap()
{
- return m_dfhLocalSurfaceIdAllocator.GetCurrentLocalSurfaceIdAllocation();
+ return ui::GenerateDomKeyboardLayoutMap();
}
void RenderWidgetHostViewQt::TakeFallbackContentFrom(content::RenderWidgetHostView *view)
{
DCHECK(!static_cast<RenderWidgetHostViewBase*>(view)->IsRenderWidgetHostViewChildFrame());
RenderWidgetHostViewQt *viewQt = static_cast<RenderWidgetHostViewQt *>(view);
- base::Optional<SkColor> color = viewQt->GetBackgroundColor();
- if (color)
- SetBackgroundColor(*color);
- if (m_enableViz) {
- m_delegatedFrameHost->TakeFallbackContentFrom(viewQt->m_delegatedFrameHost.get());
- host()->GetContentRenderingTimeoutFrom(viewQt->host());
- }
+ CopyBackgroundColorIfPresentFrom(*viewQt);
+
+ m_delegatedFrameHost->TakeFallbackContentFrom(viewQt->m_delegatedFrameHost.get());
}
void RenderWidgetHostViewQt::EnsureSurfaceSynchronizedForWebTest()
@@ -1898,10 +1000,9 @@ void RenderWidgetHostViewQt::ResetFallbackToFirstNavigationSurface()
{
}
-void RenderWidgetHostViewQt::OnRenderFrameMetadataChangedAfterActivation()
+void RenderWidgetHostViewQt::OnRenderFrameMetadataChangedAfterActivation(base::TimeTicks activation_time)
{
- content::RenderWidgetHostViewBase::OnRenderFrameMetadataChangedAfterActivation();
-
+ Q_UNUSED(activation_time);
const cc::RenderFrameMetadata &metadata = host()->render_frame_metadata_provider()->LastRenderFrameMetadata();
if (metadata.selection.start != m_selectionStart || metadata.selection.end != m_selectionEnd) {
m_selectionStart = metadata.selection.start;
@@ -1909,41 +1010,55 @@ void RenderWidgetHostViewQt::OnRenderFrameMetadataChangedAfterActivation()
m_touchSelectionControllerClient->UpdateClientSelectionBounds(m_selectionStart, m_selectionEnd);
}
- gfx::Vector2dF scrollOffset = metadata.root_scroll_offset.value_or(gfx::Vector2dF());
- gfx::SizeF contentsSize = metadata.root_layer_size;
+ gfx::PointF scrollOffset = gfx::PointF();
+ if (metadata.root_scroll_offset.has_value())
+ scrollOffset = gfx::ScalePoint(metadata.root_scroll_offset.value(),
+ 1 / metadata.device_scale_factor);
std::swap(m_lastScrollOffset, scrollOffset);
- std::swap(m_lastContentsSize, contentsSize);
if (m_adapterClient && scrollOffset != m_lastScrollOffset)
m_adapterClient->updateScrollPosition(toQt(m_lastScrollOffset));
+
+ gfx::SizeF contentsSize =
+ gfx::ScaleSize(metadata.root_layer_size, 1 / metadata.device_scale_factor);
+ std::swap(m_lastContentsSize, contentsSize);
if (m_adapterClient && contentsSize != m_lastContentsSize)
m_adapterClient->updateContentsSize(toQt(m_lastContentsSize));
}
-void RenderWidgetHostViewQt::synchronizeVisualProperties(const base::Optional<viz::LocalSurfaceIdAllocation> &childSurfaceId)
+void RenderWidgetHostViewQt::synchronizeVisualProperties(const absl::optional<viz::LocalSurfaceId> &childSurfaceId)
{
if (childSurfaceId)
m_dfhLocalSurfaceIdAllocator.UpdateFromChild(*childSurfaceId);
else
m_dfhLocalSurfaceIdAllocator.GenerateId();
- if (m_enableViz) {
- gfx::Size viewSizeInDips = GetRequestedRendererSize();
- gfx::Size viewSizeInPixels = GetCompositorViewportPixelSize();
- m_rootLayer->SetBounds(gfx::Rect(gfx::Point(), viewSizeInPixels));
- m_uiCompositorLocalSurfaceIdAllocator.GenerateId();
- m_uiCompositor->SetScaleAndSize(
- m_screenInfo.device_scale_factor,
- viewSizeInPixels,
- m_uiCompositorLocalSurfaceIdAllocator.GetCurrentLocalSurfaceIdAllocation());
- m_delegatedFrameHost->EmbedSurface(
- m_dfhLocalSurfaceIdAllocator.GetCurrentLocalSurfaceIdAllocation().local_surface_id(),
- viewSizeInDips,
- cc::DeadlinePolicy::UseDefaultDeadline());
- }
+ gfx::Size viewSizeInDips = GetRequestedRendererSize();
+ gfx::Size viewSizeInPixels = GetCompositorViewportPixelSize();
+ m_rootLayer->SetBounds(gfx::Rect(gfx::Point(), viewSizeInPixels));
+ m_uiCompositorLocalSurfaceIdAllocator.GenerateId();
+ m_uiCompositor->SetScaleAndSize(
+ GetScreenInfo().device_scale_factor,
+ viewSizeInPixels,
+ m_uiCompositorLocalSurfaceIdAllocator.GetCurrentLocalSurfaceId());
+ m_delegatedFrameHost->EmbedSurface(
+ m_dfhLocalSurfaceIdAllocator.GetCurrentLocalSurfaceId(),
+ viewSizeInDips,
+ cc::DeadlinePolicy::UseDefaultDeadline());
host()->SynchronizeVisualProperties();
}
+void RenderWidgetHostViewQt::resetTouchSelectionController()
+{
+ Q_ASSERT(m_touchSelectionControllerClient);
+ m_touchSelectionControllerClient->resetControls();
+ ui::TouchSelectionController::Config config;
+ config.max_tap_duration = base::Milliseconds(ui::GestureConfiguration::GetInstance()->long_press_time_in_ms());
+ config.tap_slop = ui::GestureConfiguration::GetInstance()->max_touch_move_in_pixels_for_click();
+ config.enable_longpress_drag_selection = false;
+ m_touchSelectionController.reset(new ui::TouchSelectionController(m_touchSelectionControllerClient.get(), config));
+}
+
std::unique_ptr<content::SyntheticGestureTarget> RenderWidgetHostViewQt::CreateSyntheticGestureTarget()
{
return nullptr;
@@ -1954,12 +1069,14 @@ ui::Compositor *RenderWidgetHostViewQt::GetCompositor()
return m_uiCompositor.get();
}
-void RenderWidgetHostViewQt::UpdateNeedsBeginFramesInternal()
+absl::optional<content::DisplayFeature> RenderWidgetHostViewQt::GetDisplayFeature()
{
- if (m_enableViz)
- m_delegatedFrameHost->SetNeedsBeginFrames(m_needsBeginFrames);
- else
- m_compositor->setNeedsBeginFrames(m_needsBeginFrames);
+ return absl::nullopt;
+}
+
+void RenderWidgetHostViewQt::SetDisplayFeatureForTesting(const content::DisplayFeature *)
+{
+ NOTIMPLEMENTED();
}
} // namespace QtWebEngineCore
diff --git a/src/core/render_widget_host_view_qt.h b/src/core/render_widget_host_view_qt.h
index e12dbefb1..a55e04dd8 100644
--- a/src/core/render_widget_host_view_qt.h
+++ b/src/core/render_widget_host_view_qt.h
@@ -1,46 +1,10 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef RENDER_WIDGET_HOST_VIEW_QT_H
#define RENDER_WIDGET_HOST_VIEW_QT_H
-#include "compositor/display_frame_sink.h"
+#include "compositor/compositor.h"
#include "delegated_frame_host_client_qt.h"
#include "render_widget_host_view_qt_delegate.h"
@@ -48,29 +12,16 @@
#include "components/viz/common/resources/transferable_resource.h"
#include "components/viz/common/surfaces/parent_local_surface_id_allocator.h"
#include "components/viz/host/host_frame_sink_client.h"
-#include "content/browser/accessibility/browser_accessibility_manager.h"
+#include "content/browser/accessibility/web_contents_accessibility.h"
#include "content/browser/renderer_host/input/mouse_wheel_phase_handler.h"
#include "content/browser/renderer_host/render_widget_host_view_base.h"
#include "content/browser/renderer_host/text_input_manager.h"
-#include "content/public/browser/render_process_host_observer.h"
-#include "gpu/ipc/common/gpu_messages.h"
#include "ui/events/gesture_detection/filtered_gesture_provider.h"
-#include <QMap>
-#include <QPoint>
-#include <QtGlobal>
-#include <QtGui/QTouchEvent>
-
-QT_BEGIN_NAMESPACE
-class QAccessibleInterface;
-QT_END_NAMESPACE
-
namespace content {
class RenderFrameHost;
class RenderWidgetHostImpl;
-namespace mojom {
-class FrameInputHandler;
-}
+class WebContents;
}
namespace ui {
@@ -79,42 +30,21 @@ class TouchSelectionController;
namespace QtWebEngineCore {
-class Compositor;
-class TouchHandleDrawableClient;
+class RenderWidgetHostViewQtDelegateClient;
+class InputEventObserverQt;
class TouchSelectionControllerClientQt;
-class TouchSelectionMenuController;
-
-struct MultipleMouseClickHelper
-{
- QPoint lastPressPosition;
- Qt::MouseButton lastPressButton;
- int clickCounter;
- ulong lastPressTimestamp;
-
- MultipleMouseClickHelper()
- : lastPressPosition(QPoint())
- , lastPressButton(Qt::NoButton)
- , clickCounter(0)
- , lastPressTimestamp(0)
- {
- }
-};
+class WebContentsAccessibilityQt;
+class WebContentsAdapterClient;
class RenderWidgetHostViewQt
: public content::RenderWidgetHostViewBase
, public ui::GestureProviderClient
- , public RenderWidgetHostViewQtDelegateClient
, public base::SupportsWeakPtr<RenderWidgetHostViewQt>
, public content::TextInputManager::Observer
- , public DisplayConsumer
+ , public content::RenderFrameMetadataProvider::Observer
+ , public content::RenderWidgetHost::InputEventObserver
{
public:
- enum LoadVisuallyCommittedState {
- NotCommitted,
- DidFirstVisuallyNonEmptyPaint,
- DidFirstCompositorFrameSwap
- };
-
RenderWidgetHostViewQt(content::RenderWidgetHost* widget);
~RenderWidgetHostViewQt();
@@ -122,53 +52,65 @@ public:
void setDelegate(RenderWidgetHostViewQtDelegate *delegate);
WebContentsAdapterClient *adapterClient() { return m_adapterClient; }
void setAdapterClient(WebContentsAdapterClient *adapterClient);
+ RenderWidgetHostViewQtDelegateClient *delegateClient() const { return m_delegateClient.get(); }
+ // Overridden from RenderWidgetHostView:
void InitAsChild(gfx::NativeView) override;
- void InitAsPopup(content::RenderWidgetHostView*, const gfx::Rect&) override;
- void InitAsFullscreen(content::RenderWidgetHostView*) override;
+ void InitAsPopup(content::RenderWidgetHostView*, const gfx::Rect&, const gfx::Rect&) override;
void SetSize(const gfx::Size& size) override;
void SetBounds(const gfx::Rect&) override;
gfx::NativeView GetNativeView() override;
- gfx::NativeViewAccessible GetNativeViewAccessible() override;
+ gfx::NativeViewAccessible GetNativeViewAccessible() override { return nullptr; }
void Focus() override;
bool HasFocus() override;
bool IsMouseLocked() override;
+ viz::FrameSinkId GetRootFrameSinkId() override;
bool IsSurfaceAvailableForCopy() override;
void CopyFromSurface(const gfx::Rect &src_rect,
const gfx::Size &output_size,
base::OnceCallback<void(const SkBitmap &)> callback) override;
- void Show() override;
+ void ShowWithVisibility(content::PageVisibilityState page_visibility) override;
void Hide() override;
bool IsShowing() override;
gfx::Rect GetViewBounds() override;
void UpdateBackgroundColor() override;
- bool LockMouse(bool) override;
+ blink::mojom::PointerLockResult LockMouse(bool) override;
+ blink::mojom::PointerLockResult ChangeMouseLock(bool) override;
void UnlockMouse() override;
- void UpdateCursor(const content::WebCursor&) override;
- void DisplayCursor(const content::WebCursor&) override;
+ void UpdateCursor(const ui::Cursor&) override;
+ void DisplayCursor(const ui::Cursor&) override;
+ content::CursorManager *GetCursorManager() override;
void SetIsLoading(bool) override;
void ImeCancelComposition() override;
- void ImeCompositionRangeChanged(const gfx::Range&, const std::vector<gfx::Rect>&) override;
+ void ImeCompositionRangeChanged(const gfx::Range &,
+ const absl::optional<std::vector<gfx::Rect>> &,
+ const absl::optional<std::vector<gfx::Rect>> &) override;
void RenderProcessGone() override;
+ bool TransformPointToCoordSpaceForView(const gfx::PointF &point,
+ content::RenderWidgetHostViewBase *target_view,
+ gfx::PointF *transformed_point) override;
void Destroy() override;
- void SetTooltipText(const base::string16 &tooltip_text) override;
- void DisplayTooltipText(const base::string16& tooltip_text) override;
- void DidCreateNewRendererCompositorFrameSink(viz::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink) override;
- void SubmitCompositorFrame(const viz::LocalSurfaceId&, viz::CompositorFrame, base::Optional<viz::HitTestRegionList>) override;
- void WheelEventAck(const blink::WebMouseWheelEvent &event, content::InputEventAckState ack_result) override;
- void GestureEventAck(const blink::WebGestureEvent &event, content::InputEventAckState ack_result) override;
+ void UpdateTooltipUnderCursor(const std::u16string &tooltip_text) override;
+ void UpdateTooltip(const std::u16string& tooltip_text) override;
+ void WheelEventAck(const blink::WebMouseWheelEvent &event,
+ blink::mojom::InputEventResultState ack_result) override;
+ void GestureEventAck(const blink::WebGestureEvent &event,
+ blink::mojom::InputEventResultState ack_result,
+ blink::mojom::ScrollResultDataPtr scroll_result_data) override;
content::MouseWheelPhaseHandler *GetMouseWheelPhaseHandler() override;
viz::ScopedSurfaceIdAllocator DidUpdateVisualProperties(const cc::RenderFrameMetadata &metadata) override;
void OnDidUpdateVisualPropertiesComplete(const cc::RenderFrameMetadata &metadata);
- void GetScreenInfo(content::ScreenInfo *results) override;
+ // Overridden from RenderWidgetHostViewBase:
gfx::Rect GetBoundsInRootWindow() override;
- void ProcessAckedTouchEvent(const content::TouchEventWithLatencyInfo &touch, content::InputEventAckState ack_result) override;
- void SetNeedsBeginFrames(bool needs_begin_frames) override;
- void SetWantsAnimateOnlyBeginFrames() override;
+ void ProcessAckedTouchEvent(const content::TouchEventWithLatencyInfo &touch,
+ blink::mojom::InputEventResultState ack_result) override;
viz::SurfaceId GetCurrentSurfaceId() const override;
const viz::FrameSinkId &GetFrameSinkId() const override;
- const viz::LocalSurfaceIdAllocation &GetLocalSurfaceIdAllocation() const override;
+ const viz::LocalSurfaceId &GetLocalSurfaceId() const override;
+ void FocusedNodeChanged(bool is_editable_node, const gfx::Rect& node_bounds_in_screen) override;
+ base::flat_map<std::string, std::string> GetKeyboardLayoutMap() override;
+
void TakeFallbackContentFrom(content::RenderWidgetHostView *view) override;
void EnsureSurfaceSynchronizedForWebTest() override;
uint32_t GetCaptureSequenceNumber() const override;
@@ -176,151 +118,129 @@ public:
void DidStopFlinging() override;
std::unique_ptr<content::SyntheticGestureTarget> CreateSyntheticGestureTarget() override;
ui::Compositor *GetCompositor() override;
+ absl::optional<content::DisplayFeature> GetDisplayFeature() override;
+ void SetDisplayFeatureForTesting(const content::DisplayFeature*) override;
+ content::WebContentsAccessibility *GetWebContentsAccessibility() override;
+#if BUILDFLAG(IS_MAC)
+ void ShowSharePicker(
+ const std::string &title,
+ const std::string &text,
+ const std::string &url,
+ const std::vector<std::string> &file_paths,
+ blink::mojom::ShareService::ShareCallback callback) override { QT_NOT_YET_IMPLEMENTED }
+ void SetActive(bool active) override { QT_NOT_YET_IMPLEMENTED }
+ void SpeakSelection() override { QT_NOT_YET_IMPLEMENTED }
+ void ShowDefinitionForSelection() override { QT_NOT_YET_IMPLEMENTED }
+ void SetWindowFrameInScreen(const gfx::Rect&) override { QT_NOT_YET_IMPLEMENTED }
+#endif // BUILDFLAG(IS_MAC)
+ void NotifyHostAndDelegateOnWasShown(blink::mojom::RecordContentToVisibleTimeRequestPtr) override { QT_NOT_YET_IMPLEMENTED }
+ void RequestSuccessfulPresentationTimeFromHostOrDelegate(blink::mojom::RecordContentToVisibleTimeRequestPtr) override {}
+ void CancelSuccessfulPresentationTimeRequestForHostAndDelegate() override {}
+ void InvalidateLocalSurfaceIdAndAllocationGroup() override {}
// Overridden from ui::GestureProviderClient.
void OnGestureEvent(const ui::GestureEventData& gesture) override;
- // Overridden from RenderWidgetHostViewQtDelegateClient.
- QSGNode *updatePaintNode(QSGNode *) override;
- void notifyShown() override;
- void notifyHidden() override;
- void visualPropertiesChanged() override;
- bool forwardEvent(QEvent *) override;
- QVariant inputMethodQuery(Qt::InputMethodQuery query) override;
- void closePopup() override;
-
// Overridden from content::TextInputManager::Observer
void OnUpdateTextInputStateCalled(content::TextInputManager *text_input_manager, RenderWidgetHostViewBase *updated_view, bool did_update_state) override;
void OnSelectionBoundsChanged(content::TextInputManager *text_input_manager, RenderWidgetHostViewBase *updated_view) override;
void OnTextSelectionChanged(content::TextInputManager *text_input_manager, RenderWidgetHostViewBase *updated_view) override;
- void handleMouseEvent(QMouseEvent*);
- void handleKeyEvent(QKeyEvent*);
- void handleWheelEvent(QWheelEvent*);
- void handleTouchEvent(QTouchEvent*);
-#if QT_CONFIG(tabletevent)
- void handleTabletEvent(QTabletEvent *ev);
-#endif
-#ifndef QT_NO_GESTURES
- void handleGestureEvent(QNativeGestureEvent *);
-#endif
- void handleHoverEvent(QHoverEvent*);
- void handleFocusEvent(QFocusEvent*);
- void handleInputMethodEvent(QInputMethodEvent*);
- void handleInputMethodQueryEvent(QInputMethodQueryEvent*);
-
- template<class T> void handlePointerEvent(T*);
-
-#if defined(OS_MACOSX)
- void SetActive(bool active) override { QT_NOT_YET_IMPLEMENTED }
- void SpeakSelection() override { QT_NOT_YET_IMPLEMENTED }
- void ShowDefinitionForSelection() override { QT_NOT_YET_IMPLEMENTED }
-#endif // defined(OS_MACOSX)
-
- void UpdateNeedsBeginFramesInternal();
-
- // Overridden from content::BrowserAccessibilityDelegate
- content::BrowserAccessibilityManager* CreateBrowserAccessibilityManager(content::BrowserAccessibilityDelegate* delegate, bool for_root_frame) override;
-
- // Called from WebContentsDelegateQt
- void OnDidFirstVisuallyNonEmptyPaint();
-
// Overridden from content::RenderFrameMetadataProvider::Observer
- void OnRenderFrameMetadataChangedAfterActivation() override;
-
- // Overridden from DisplayConsumer
- void scheduleUpdate() override;
+ void OnRenderFrameMetadataChangedAfterActivation(base::TimeTicks activation_time) override;
+ void OnRenderFrameMetadataChangedBeforeActivation(const cc::RenderFrameMetadata &) override {}
+ void OnRenderFrameSubmission() override {}
+ void OnLocalSurfaceIdChanged(const cc::RenderFrameMetadata &) override {}
+
+ // Overridden from content::RenderWidgetHost::InputEventObserver
+ void OnInputEvent(const blink::WebInputEvent &) override { }
+ void OnInputEventAck(blink::mojom::InputEventResultSource,
+ blink::mojom::InputEventResultState state,
+ const blink::WebInputEvent &event) override;
+
+ static void registerInputEventObserver(content::WebContents *, content::RenderFrameHost *);
+
+ // Called from RenderWidgetHostViewQtDelegateClient.
+ Compositor::Id compositorId();
+ void notifyShown();
+ void notifyHidden();
+ bool updateScreenInfo();
+ void handleWheelEvent(QWheelEvent *);
+ void processMotionEvent(const ui::MotionEvent &motionEvent);
+ void resetInputManagerState() { m_imState = 0; }
+ // Called from WebContentsAdapter.
gfx::SizeF lastContentsSize() const { return m_lastContentsSize; }
- gfx::Vector2dF lastScrollOffset() const { return m_lastScrollOffset; }
+ gfx::PointF lastScrollOffset() const { return m_lastScrollOffset; }
ui::TouchSelectionController *getTouchSelectionController() const { return m_touchSelectionController.get(); }
TouchSelectionControllerClientQt *getTouchSelectionControllerClient() const { return m_touchSelectionControllerClient.get(); }
- content::mojom::FrameInputHandler *getFrameInputHandler();
+ blink::mojom::FrameWidgetInputHandler *getFrameWidgetInputHandler();
ui::TextInputType getTextInputType() const;
-private:
- friend class DelegatedFrameHostClientQt;
+ void synchronizeVisualProperties(
+ const absl::optional<viz::LocalSurfaceId> &childSurfaceId);
- void processMotionEvent(const ui::MotionEvent &motionEvent);
- void clearPreviousTouchMotionState();
- QList<QTouchEvent::TouchPoint> mapTouchPointIds(const QList<QTouchEvent::TouchPoint> &inputPoints);
-
- bool IsPopup() const;
-
- void selectionChanged();
- content::RenderFrameHost *getFocusedFrameHost();
+ void resetTouchSelectionController();
- void synchronizeVisualProperties(const base::Optional<viz::LocalSurfaceIdAllocation> &childSurfaceId);
+private:
+ friend class DelegatedFrameHostClientQt;
+ friend class WebContentsAccessibilityQt;
- void callUpdate();
+ bool isPopup() const;
- // Geometry of the view in screen DIPs.
- gfx::Rect m_viewRectInDips;
- // Geometry of the window, including frame, in screen DIPs.
- gfx::Rect m_windowRectInDips;
- content::ScreenInfo m_screenInfo;
+ bool updateCursorFromResource(ui::mojom::CursorType type);
scoped_refptr<base::SingleThreadTaskRunner> m_taskRunner;
+ std::unique_ptr<content::CursorManager> m_cursorManager;
+
ui::FilteredGestureProvider m_gestureProvider;
- base::TimeDelta m_eventsToNowDelta;
- bool m_sendMotionActionDown;
- bool m_touchMotionStarted;
- QMap<int, int> m_touchIdMapping;
- QList<QTouchEvent::TouchPoint> m_previousTouchPoints;
+
+ viz::FrameSinkId m_frameSinkId;
+ std::unique_ptr<RenderWidgetHostViewQtDelegateClient> m_delegateClient;
std::unique_ptr<RenderWidgetHostViewQtDelegate> m_delegate;
+ std::unique_ptr<WebContentsAccessibilityQt> m_webContentsAccessibility;
+ QMetaObject::Connection m_adapterClientDestroyedConnection;
+ WebContentsAdapterClient *m_adapterClient = nullptr;
- const bool m_enableViz;
- bool m_visible;
- bool m_needsBeginFrames;
+ bool m_isMouseLocked = false;
+ bool m_visible = false;
bool m_deferredShow = false;
- DelegatedFrameHostClientQt m_delegatedFrameHostClient{this};
+ gfx::PointF m_lastScrollOffset;
+ gfx::SizeF m_lastContentsSize;
+ DelegatedFrameHostClientQt m_delegatedFrameHostClient { this };
+
+ // VIZ
std::unique_ptr<content::DelegatedFrameHost> m_delegatedFrameHost;
std::unique_ptr<ui::Layer> m_rootLayer;
std::unique_ptr<ui::Compositor> m_uiCompositor;
- scoped_refptr<DisplayFrameSink> m_displayFrameSink;
- std::unique_ptr<Compositor> m_compositor;
- LoadVisuallyCommittedState m_loadVisuallyCommittedState;
-
- QMetaObject::Connection m_adapterClientDestroyedConnection;
- WebContentsAdapterClient *m_adapterClient;
- MultipleMouseClickHelper m_clickHelper;
-
- bool m_imeInProgress;
- bool m_receivedEmptyImeEvent;
- QPoint m_previousMousePosition;
- bool m_isMouseLocked;
-
- gfx::Vector2dF m_lastScrollOffset;
- gfx::SizeF m_lastContentsSize;
viz::ParentLocalSurfaceIdAllocator m_dfhLocalSurfaceIdAllocator;
viz::ParentLocalSurfaceIdAllocator m_uiCompositorLocalSurfaceIdAllocator;
- uint m_imState;
- int m_anchorPositionWithinSelection;
- int m_cursorPositionWithinSelection;
- uint m_cursorPosition;
- bool m_emptyPreviousSelection;
- QString m_surroundingText;
-
- bool m_imeHasHiddenTextCapability;
+ // IME
+ uint m_imState = 0;
- bool m_wheelAckPending;
+ // Wheel
+ bool m_wheelAckPending = false;
QList<blink::WebMouseWheelEvent> m_pendingWheelEvents;
- content::MouseWheelPhaseHandler m_mouseWheelPhaseHandler;
- viz::FrameSinkId m_frameSinkId;
-
- std::string m_editCommand;
+ content::MouseWheelPhaseHandler m_mouseWheelPhaseHandler { this };
+ // TouchSelection
std::unique_ptr<TouchSelectionControllerClientQt> m_touchSelectionControllerClient;
std::unique_ptr<ui::TouchSelectionController> m_touchSelectionController;
gfx::SelectionBound m_selectionStart;
gfx::SelectionBound m_selectionEnd;
- base::WeakPtrFactory<RenderWidgetHostViewQt> m_weakPtrFactory{this};
+ base::WeakPtrFactory<RenderWidgetHostViewQt> m_weakPtrFactory { this };
+};
- uint m_mouseButtonPressed = 0;
+class WebContentsAccessibilityQt : public content::WebContentsAccessibility
+{
+ RenderWidgetHostViewQt *m_rwhv;
+public:
+ WebContentsAccessibilityQt(RenderWidgetHostViewQt *rwhv) : m_rwhv(rwhv) {}
+ QObject *accessibilityParentObject() const;
};
} // namespace QtWebEngineCore
diff --git a/src/core/render_widget_host_view_qt_delegate.h b/src/core/render_widget_host_view_qt_delegate.h
index 46f1802a6..b1f33db7a 100644
--- a/src/core/render_widget_host_view_qt_delegate.h
+++ b/src/core/render_widget_host_view_qt_delegate.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
//
// W A R N I N G
@@ -51,42 +15,21 @@
#ifndef RENDER_WIDGET_HOST_VIEW_QT_DELEGATE_H
#define RENDER_WIDGET_HOST_VIEW_QT_DELEGATE_H
-#include "qtwebenginecoreglobal_p.h"
-
-#include <QRect>
-#include <QtGui/qwindowdefs.h>
+#include <QtWebEngineCore/private/qtwebenginecoreglobal_p.h>
+#include <QtCore/QRect>
+#include <QtGui/QColor>
+#include <QtGui/QCursor>
+#include <QtGui/QImage>
QT_BEGIN_NAMESPACE
-class QEvent;
-class QInputMethodEvent;
-class QSGLayer;
-class QSGNode;
-class QSGRectangleNode;
-class QSGTexture;
-class QVariant;
class QWheelEvent;
-
-class QSGImageNode;
-
+class QWindow;
QT_END_NAMESPACE
namespace QtWebEngineCore {
class WebContentsAdapterClient;
-
-class Q_WEBENGINECORE_PRIVATE_EXPORT RenderWidgetHostViewQtDelegateClient {
-public:
- virtual ~RenderWidgetHostViewQtDelegateClient() { }
- virtual QSGNode *updatePaintNode(QSGNode *) = 0;
- virtual void notifyShown() = 0;
- virtual void notifyHidden() = 0;
- virtual void visualPropertiesChanged() = 0;
- virtual bool forwardEvent(QEvent *) = 0;
- virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) = 0;
- virtual void closePopup() = 0;
-};
-
-class Q_WEBENGINECORE_PRIVATE_EXPORT RenderWidgetHostViewQtDelegate {
+class Q_WEBENGINECORE_EXPORT RenderWidgetHostViewQtDelegate {
public:
virtual ~RenderWidgetHostViewQtDelegate() { }
virtual void initAsPopup(const QRect&) = 0;
@@ -99,19 +42,15 @@ public:
virtual void show() = 0;
virtual void hide() = 0;
virtual bool isVisible() const = 0;
- virtual QWindow* window() const = 0;
- virtual QSGTexture *createTextureFromImage(const QImage &) = 0;
- virtual QSGLayer *createLayer() = 0;
- virtual QSGImageNode *createImageNode() = 0;
- virtual QSGRectangleNode *createRectangleNode() = 0;
- virtual void update() = 0;
+ virtual QWindow *Window() const = 0;
virtual void updateCursor(const QCursor &) = 0;
virtual void resize(int width, int height) = 0;
virtual void move(const QPoint &) = 0;
virtual void inputMethodStateChanged(bool editorVisible, bool passwordInput) = 0;
virtual void setInputMethodHints(Qt::InputMethodHints hints) = 0;
virtual void setClearColor(const QColor &color) = 0;
- virtual bool copySurface(const QRect &, const QSize &, QImage &) = 0;
+ virtual void adapterClientChanged(WebContentsAdapterClient *client) = 0;
+ virtual void updateAdapterClientIfNeeded(WebContentsAdapterClient *client) = 0;
virtual void unhandledWheelEvent(QWheelEvent *) {}
};
diff --git a/src/core/render_widget_host_view_qt_delegate_client.cpp b/src/core/render_widget_host_view_qt_delegate_client.cpp
new file mode 100644
index 000000000..3e8cad669
--- /dev/null
+++ b/src/core/render_widget_host_view_qt_delegate_client.cpp
@@ -0,0 +1,963 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "render_widget_host_view_qt_delegate_client.h"
+
+#include "render_widget_host_view_qt.h"
+#include "touch_selection_controller_client_qt.h"
+#include "type_conversion.h"
+#include "web_contents_adapter.h"
+#include "web_contents_adapter_client.h"
+#include "web_event_factory.h"
+
+#include "content/browser/renderer_host/render_view_host_impl.h"
+#include "content/browser/renderer_host/render_widget_host_input_event_router.h"
+#include "ui/touch_selection/touch_selection_controller.h"
+
+#include <QEvent>
+#include <QInputMethodEvent>
+#include <QSet>
+#include <QStyleHints>
+#include <QTextFormat>
+#include <QVariant>
+
+#include <QtGui/private/qguiapplication_p.h>
+#include <QtGui/private/qinputcontrol_p.h>
+
+namespace QtWebEngineCore {
+
+static inline int firstAvailableId(const QMap<int, int> &map)
+{
+ ui::BitSet32 usedIds;
+ QMap<int, int>::const_iterator end = map.end();
+ for (QMap<int, int>::const_iterator it = map.begin(); it != end; ++it)
+ usedIds.mark_bit(it.value());
+ return usedIds.first_unmarked_bit();
+}
+
+typedef QPair<int, QTouchEvent::TouchPoint> TouchPoint;
+QList<TouchPoint> RenderWidgetHostViewQtDelegateClient::mapTouchPointIds(const QList<QTouchEvent::TouchPoint> &input)
+{
+ QList<TouchPoint> output;
+ for (int i = 0; i < input.size(); ++i) {
+ const QTouchEvent::TouchPoint &point = input[i];
+
+ int qtId = point.id();
+ QMap<int, int>::const_iterator it = m_touchIdMapping.find(qtId);
+ if (it == m_touchIdMapping.end()) {
+ Q_ASSERT_X(m_touchIdMapping.size() <= 16, "", "Number of mapped ids can't exceed 16 for velocity tracker");
+ it = m_touchIdMapping.insert(qtId, firstAvailableId(m_touchIdMapping));
+ }
+
+ output.append(qMakePair(it.value(), point));
+ }
+
+ Q_ASSERT(output.size() == std::accumulate(output.cbegin(), output.cend(), QSet<int>(),
+ [] (QSet<int> s, const TouchPoint &p) { s.insert(p.second.id()); return s; }).size());
+
+ for (auto &&point : std::as_const(input))
+ if (point.state() == QEventPoint::Released)
+ m_touchIdMapping.remove(point.id());
+
+ return output;
+}
+
+static uint32_t s_eventId = 0;
+class MotionEventQt : public ui::MotionEvent
+{
+public:
+ MotionEventQt(const QList<TouchPoint> &touchPoints,
+ const base::TimeTicks &eventTime, Action action,
+ const Qt::KeyboardModifiers modifiers, int index = -1)
+ : touchPoints(touchPoints)
+ , eventTime(eventTime)
+ , action(action)
+ , eventId(++s_eventId)
+ , flags(flagsFromModifiers(modifiers))
+ , index(index)
+ {
+ // index is only valid for ACTION_DOWN and ACTION_UP and should correspond to the point causing it
+ // see blink_event_util.cc:ToWebTouchPointState for details
+ Q_ASSERT_X((action != Action::POINTER_DOWN && action != Action::POINTER_UP && index == -1)
+ || (action == Action::POINTER_DOWN && index >= 0 && touchPoint(index).state() == QEventPoint::Pressed)
+ || (action == Action::POINTER_UP && index >= 0 && touchPoint(index).state() == QEventPoint::Released),
+ "MotionEventQt", qPrintable(QString("action: %1, index: %2, state: %3").arg(int(action)).arg(index).arg(touchPoint(index).state())));
+ }
+
+ uint32_t GetUniqueEventId() const override { return eventId; }
+ Action GetAction() const override { return action; }
+ int GetActionIndex() const override { return index; }
+ size_t GetPointerCount() const override { return touchPoints.size(); }
+ int GetPointerId(size_t pointer_index) const override
+ {
+ return touchPoints[pointer_index].first;
+ }
+ float GetX(size_t pointer_index) const override
+ {
+ return touchPoint(pointer_index).position().x();
+ }
+ float GetY(size_t pointer_index) const override
+ {
+ return touchPoint(pointer_index).position().y();
+ }
+ float GetRawX(size_t pointer_index) const override
+ {
+ return touchPoint(pointer_index).globalPosition().x();
+ }
+ float GetRawY(size_t pointer_index) const override
+ {
+ return touchPoint(pointer_index).globalPosition().y();
+ }
+ float GetTouchMajor(size_t pointer_index) const override
+ {
+ QSizeF diams = touchPoint(pointer_index).ellipseDiameters();
+ return std::max(diams.height(), diams.width());
+ }
+ float GetTouchMinor(size_t pointer_index) const override
+ {
+ QSizeF diams = touchPoint(pointer_index).ellipseDiameters();
+ return std::min(diams.height(), diams.width());
+ }
+ float GetOrientation(size_t pointer_index) const override { return 0; }
+ int GetFlags() const override { return flags; }
+ float GetPressure(size_t pointer_index) const override
+ {
+ return touchPoint(pointer_index).pressure();
+ }
+ float GetTiltX(size_t pointer_index) const override { return 0; }
+ float GetTiltY(size_t pointer_index) const override { return 0; }
+ float GetTwist(size_t) const override { return 0; }
+ float GetTangentialPressure(size_t) const override { return 0; }
+ base::TimeTicks GetEventTime() const override { return eventTime; }
+
+ size_t GetHistorySize() const override { return 0; }
+ base::TimeTicks GetHistoricalEventTime(size_t historical_index) const override
+ {
+ return base::TimeTicks();
+ }
+ float GetHistoricalTouchMajor(size_t pointer_index, size_t historical_index) const override
+ {
+ return 0;
+ }
+ float GetHistoricalX(size_t pointer_index, size_t historical_index) const override { return 0; }
+ float GetHistoricalY(size_t pointer_index, size_t historical_index) const override { return 0; }
+ ToolType GetToolType(size_t pointer_index) const override
+ {
+ return ui::MotionEvent::ToolType::FINGER;
+ }
+
+ int GetButtonState() const override { return 0; }
+
+private:
+ QList<TouchPoint> touchPoints;
+ base::TimeTicks eventTime;
+ Action action;
+ const uint32_t eventId;
+ int flags;
+ int index;
+ const QTouchEvent::TouchPoint& touchPoint(size_t i) const { return touchPoints[i].second; }
+};
+
+RenderWidgetHostViewQtDelegateClient::RenderWidgetHostViewQtDelegateClient(
+ RenderWidgetHostViewQt *rwhv)
+ : m_rwhv(rwhv)
+{
+ Q_ASSERT(rwhv);
+}
+
+Compositor::Id RenderWidgetHostViewQtDelegateClient::compositorId()
+{
+ return m_rwhv->compositorId();
+}
+
+void RenderWidgetHostViewQtDelegateClient::notifyShown()
+{
+ m_rwhv->notifyShown();
+}
+
+void RenderWidgetHostViewQtDelegateClient::notifyHidden()
+{
+ m_rwhv->notifyHidden();
+}
+
+void RenderWidgetHostViewQtDelegateClient::visualPropertiesChanged()
+{
+ RenderWidgetHostViewQtDelegate *delegate = m_rwhv->delegate();
+ if (!delegate)
+ return;
+
+ QRect oldViewRect = m_viewRectInDips;
+ m_viewRectInDips = delegate->viewGeometry().toAlignedRect();
+
+ QRect oldWindowRect = m_windowRectInDips;
+ m_windowRectInDips = delegate->windowGeometry();
+
+ bool screenInfoChanged = m_rwhv->updateScreenInfo();
+
+ if (m_viewRectInDips != oldViewRect || m_windowRectInDips != oldWindowRect)
+ m_rwhv->host()->SendScreenRects();
+
+ if (m_viewRectInDips.size() != oldViewRect.size() || screenInfoChanged)
+ m_rwhv->synchronizeVisualProperties(absl::nullopt);
+}
+
+bool RenderWidgetHostViewQtDelegateClient::forwardEvent(QEvent *event)
+{
+ Q_ASSERT(m_rwhv->host()->GetView());
+
+ switch (event->type()) {
+ case QEvent::ShortcutOverride: {
+ QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
+ event->ignore();
+ auto acceptKeyOutOfInputField = [](QKeyEvent *keyEvent) -> bool {
+#ifdef Q_OS_MACOS
+ // Check if a shortcut is registered for this key sequence.
+ QKeySequence sequence = QKeySequence((keyEvent->modifiers() | keyEvent->key())
+ & ~(Qt::KeypadModifier | Qt::GroupSwitchModifier));
+ if (QGuiApplicationPrivate::instance()->shortcutMap.hasShortcutForKeySequence(sequence))
+ return false;
+
+ // The following shortcuts are handled out of input field too but
+ // disabled on macOS to let the blinking menu handling to the
+ // embedder application (see kKeyboardCodeKeyDownEntries in
+ // third_party/WebKit/Source/core/editing/EditingBehavior.cpp).
+ // Let them pass on macOS to generate the corresponding edit command.
+ return keyEvent->matches(QKeySequence::Copy) || keyEvent->matches(QKeySequence::Paste)
+ || keyEvent->matches(QKeySequence::Cut)
+ || keyEvent->matches(QKeySequence::SelectAll);
+#else
+ return false;
+#endif
+ };
+
+ if (!inputMethodQuery(Qt::ImEnabled).toBool()
+ && !(inputMethodQuery(Qt::ImHints).toInt() & Qt::ImhHiddenText)
+ && !acceptKeyOutOfInputField(keyEvent))
+ return false;
+
+ Q_ASSERT(m_editCommand.empty());
+ if (WebEventFactory::getEditCommand(keyEvent, &m_editCommand)
+ || QInputControl::isCommonTextEditShortcut(keyEvent)) {
+ event->accept();
+ return true;
+ }
+
+ return false;
+ }
+ case QEvent::MouseButtonPress:
+ m_rwhv->Focus();
+ Q_FALLTHROUGH();
+ case QEvent::MouseButtonRelease:
+ case QEvent::MouseMove:
+ // Skip second MouseMove event when a window is being adopted, so that Chromium
+ // can properly handle further move events.
+ // Also make sure the adapter client exists to prevent a null pointer dereference,
+ // because it's possible for a QWebEnginePagePrivate (adapter) instance to be destroyed,
+ // and then the OS (observed on Windows) might still send mouse move events to a still
+ // existing popup RWHVQDW instance.
+ if (m_rwhv->adapterClient() && m_rwhv->adapterClient()->isBeingAdopted())
+ return false;
+ handleMouseEvent(static_cast<QMouseEvent *>(event));
+ break;
+ case QEvent::KeyPress:
+ case QEvent::KeyRelease:
+ handleKeyEvent(static_cast<QKeyEvent *>(event));
+ break;
+ case QEvent::Wheel:
+ m_rwhv->handleWheelEvent(static_cast<QWheelEvent *>(event));
+ break;
+ case QEvent::TouchBegin:
+ m_rwhv->Focus();
+ Q_FALLTHROUGH();
+ case QEvent::TouchUpdate:
+ case QEvent::TouchEnd:
+ case QEvent::TouchCancel:
+ handleTouchEvent(static_cast<QTouchEvent *>(event));
+ break;
+#if QT_CONFIG(tabletevent)
+ case QEvent::TabletPress:
+ m_rwhv->Focus();
+ Q_FALLTHROUGH();
+ case QEvent::TabletRelease:
+ case QEvent::TabletMove:
+ handleTabletEvent(static_cast<QTabletEvent *>(event));
+ break;
+#endif
+#if QT_CONFIG(gestures)
+ case QEvent::NativeGesture:
+ handleGestureEvent(static_cast<QNativeGestureEvent *>(event));
+ break;
+#endif
+ case QEvent::HoverMove:
+ handleHoverEvent(static_cast<QHoverEvent *>(event));
+ break;
+ case QEvent::FocusIn:
+ case QEvent::FocusOut: {
+ // Focus in/out events for popup event do not mean 'parent' focus change
+ // and should not be handled by Chromium
+ QFocusEvent *e = static_cast<QFocusEvent *>(event);
+ if (e->reason() != Qt::PopupFocusReason)
+ handleFocusEvent(e);
+ } break;
+ case QEvent::InputMethod:
+ handleInputMethodEvent(static_cast<QInputMethodEvent *>(event));
+ break;
+ case QEvent::InputMethodQuery:
+ handleInputMethodQueryEvent(static_cast<QInputMethodQueryEvent *>(event));
+ break;
+ case QEvent::Leave:
+#ifdef Q_OS_WIN
+ if (m_mouseButtonPressed > 0)
+ return false;
+#endif
+ case QEvent::HoverLeave:
+ if (m_rwhv->host()->delegate() && m_rwhv->host()->delegate()->GetInputEventRouter()) {
+ auto webEvent = WebEventFactory::toWebMouseEvent(event);
+ m_rwhv->host()->delegate()->GetInputEventRouter()->RouteMouseEvent(m_rwhv, &webEvent, ui::LatencyInfo());
+ }
+ break;
+ default:
+ return false;
+ }
+ return true;
+}
+
+QVariant RenderWidgetHostViewQtDelegateClient::inputMethodQuery(Qt::InputMethodQuery query)
+{
+ switch (query) {
+ case Qt::ImEnabled:
+ return QVariant(m_rwhv->getTextInputType() != ui::TEXT_INPUT_TYPE_NONE);
+ case Qt::ImFont:
+ // TODO: Implement this
+ return QVariant();
+ case Qt::ImCursorRectangle: {
+ if (m_rwhv->GetTextInputManager()) {
+ if (auto *region = m_rwhv->GetTextInputManager()->GetSelectionRegion()) {
+ if (region->focus.GetHeight() > 0) {
+ gfx::Rect caretRect =
+ gfx::RectBetweenSelectionBounds(region->anchor, region->focus);
+ if (caretRect.width() == 0)
+ caretRect.set_width(1); // IME API on Windows expects a width > 0
+ return toQt(caretRect);
+ }
+ }
+ }
+ return QVariant();
+ }
+ case Qt::ImAbsolutePosition:
+ case Qt::ImCursorPosition:
+ return m_cursorPosition;
+ case Qt::ImAnchorPosition:
+ return m_rwhv->GetSelectedText().empty() ? m_cursorPosition
+ : m_anchorPositionWithinSelection;
+ case Qt::ImSurroundingText:
+ return m_surroundingText;
+ case Qt::ImCurrentSelection:
+ return toQt(m_rwhv->GetSelectedText());
+ case Qt::ImMaximumTextLength:
+ // TODO: Implement this
+ return QVariant(); // No limit.
+ case Qt::ImHints:
+ return int(toQtInputMethodHints(m_rwhv->getTextInputType()) | Qt::ImhNoPredictiveText
+ | Qt::ImhNoTextHandles | Qt::ImhNoEditMenu);
+ default:
+ return QVariant();
+ }
+}
+
+void RenderWidgetHostViewQtDelegateClient::closePopup()
+{
+ // We notify the popup to be closed by telling it that it lost focus. WebKit does the rest
+ // (hiding the widget and automatic memory cleanup via
+ // RenderWidget::CloseWidgetSoon() -> RenderWidgetHostImpl::ShutdownAndDestroyWidget(true).
+ m_rwhv->host()->SetActive(false);
+ m_rwhv->host()->LostFocus();
+}
+
+template<class T>
+void RenderWidgetHostViewQtDelegateClient::handlePointerEvent(T *event)
+{
+ // Currently WebMouseEvent is a subclass of WebPointerProperties, so basically
+ // tablet events are mouse events with extra properties.
+ blink::WebMouseEvent webEvent = WebEventFactory::toWebMouseEvent(event);
+ if ((webEvent.GetType() == blink::WebInputEvent::Type::kMouseDown
+ || webEvent.GetType() == blink::WebInputEvent::Type::kMouseUp)
+ && webEvent.button == blink::WebMouseEvent::Button::kNoButton) {
+ // Blink can only handle the 5 main mouse-buttons and may assert when processing mouse-down
+ // for no button.
+ LOG(INFO) << "Unhandled mouse button";
+ return;
+ }
+
+ if (webEvent.GetType() == blink::WebInputEvent::Type::kMouseDown) {
+ if (event->button() != m_clickHelper.lastPressButton
+ || (event->timestamp() - m_clickHelper.lastPressTimestamp
+ > static_cast<ulong>(qGuiApp->styleHints()->mouseDoubleClickInterval()))
+ || (event->position() - m_clickHelper.lastPressPosition).manhattanLength()
+ > qGuiApp->styleHints()->startDragDistance()
+ || m_clickHelper.clickCounter >= 3)
+ m_clickHelper.clickCounter = 0;
+
+ m_clickHelper.lastPressTimestamp = event->timestamp();
+ webEvent.click_count = ++m_clickHelper.clickCounter;
+ m_clickHelper.lastPressButton = event->button();
+ m_clickHelper.lastPressPosition = event->position().toPoint();
+ }
+
+ if (webEvent.GetType() == blink::WebInputEvent::Type::kMouseUp)
+ webEvent.click_count = m_clickHelper.clickCounter;
+
+ webEvent.movement_x = event->globalPosition().x() - m_previousMousePosition.x();
+ webEvent.movement_y = event->globalPosition().y() - m_previousMousePosition.y();
+ webEvent.is_raw_movement_event = true;
+
+ if (m_rwhv->IsMouseLocked())
+ QCursor::setPos(m_previousMousePosition);
+ else
+ m_previousMousePosition = event->globalPosition().toPoint();
+
+ if (m_imeInProgress && webEvent.GetType() == blink::WebInputEvent::Type::kMouseDown) {
+ m_imeInProgress = false;
+ // Tell input method to commit the pre-edit string entered so far, and finish the
+ // composition operation.
+#ifdef Q_OS_WIN
+ // Yes the function name is counter-intuitive, but commit isn't actually implemented
+ // by the Windows QPA, and reset does exactly what is necessary in this case.
+ qApp->inputMethod()->reset();
+#else
+ qApp->inputMethod()->commit();
+#endif
+ }
+
+ if (m_rwhv->host()->delegate() && m_rwhv->host()->delegate()->GetInputEventRouter())
+ m_rwhv->host()->delegate()->GetInputEventRouter()->RouteMouseEvent(m_rwhv, &webEvent, ui::LatencyInfo());
+}
+
+void RenderWidgetHostViewQtDelegateClient::handleMouseEvent(QMouseEvent *event)
+{
+ if (event->type() == QEvent::MouseButtonPress)
+ m_mouseButtonPressed++;
+ if (event->type() == QEvent::MouseButtonRelease)
+ m_mouseButtonPressed--;
+
+ handlePointerEvent<QMouseEvent>(event);
+}
+
+void RenderWidgetHostViewQtDelegateClient::handleKeyEvent(QKeyEvent *event)
+{
+ if (m_rwhv->IsMouseLocked() && event->key() == Qt::Key_Escape
+ && event->type() == QEvent::KeyRelease)
+ m_rwhv->UnlockMouse();
+
+ if (m_receivedEmptyImeEvent) {
+ // IME composition was not finished with a valid commit string.
+ // We're getting the composition result in a key event.
+ if (event->key() != 0) {
+ // The key event is not a result of an IME composition. Cancel IME.
+ m_rwhv->host()->ImeCancelComposition();
+ m_receivedEmptyImeEvent = false;
+ } else {
+ if (event->type() == QEvent::KeyRelease) {
+ m_rwhv->host()->ImeCommitText(toString16(event->text()),
+ std::vector<ui::ImeTextSpan>(),
+ gfx::Range::InvalidRange(), 0);
+ m_receivedEmptyImeEvent = false;
+ m_imeInProgress = false;
+ }
+ return;
+ }
+ }
+
+ // Ignore autorepeating KeyRelease events so that the generated web events
+ // conform to the spec, which requires autorepeat to result in a sequence of
+ // keypress events and only one final keyup event:
+ // https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Auto-repeat_handling
+ // https://w3c.github.io/uievents/#dom-keyboardevent-repeat
+ if (event->type() == QEvent::KeyRelease && event->isAutoRepeat())
+ return;
+
+ if (!m_rwhv->GetFocusedWidget())
+ return;
+
+ content::NativeWebKeyboardEvent webEvent = WebEventFactory::toWebKeyboardEvent(event);
+ if (webEvent.GetType() == blink::WebInputEvent::Type::kRawKeyDown && !m_editCommand.empty()) {
+ ui::LatencyInfo latency;
+ latency.set_source_event_type(ui::SourceEventType::KEY_PRESS);
+ std::vector<blink::mojom::EditCommandPtr> commands;
+ commands.emplace_back(blink::mojom::EditCommand::New(m_editCommand, ""));
+ m_editCommand.clear();
+ m_rwhv->GetFocusedWidget()->ForwardKeyboardEventWithCommands(webEvent, latency, std::move(commands), nullptr);
+ return;
+ }
+
+ bool keyDownTextInsertion =
+ webEvent.GetType() == blink::WebInputEvent::Type::kRawKeyDown && webEvent.text[0];
+ webEvent.skip_if_unhandled = keyDownTextInsertion;
+ m_rwhv->GetFocusedWidget()->ForwardKeyboardEvent(webEvent);
+
+ if (keyDownTextInsertion) {
+ // Blink won't consume the RawKeyDown, but rather the Char event in this case.
+ // The RawKeyDown is skipped on the way back (see above).
+ // The same os_event will be set on both NativeWebKeyboardEvents.
+ webEvent.skip_if_unhandled = false;
+ webEvent.SetType(blink::WebInputEvent::Type::kChar);
+ m_rwhv->GetFocusedWidget()->ForwardKeyboardEvent(webEvent);
+ }
+}
+
+void RenderWidgetHostViewQtDelegateClient::handleTouchEvent(QTouchEvent *event)
+{
+ // On macOS instead of handling touch events, we use the OS provided QNativeGestureEvents.
+#ifdef Q_OS_MACOS
+ if (event->spontaneous()) {
+ return;
+ } else {
+ VLOG(1) << "Sending simulated touch events to Chromium does not work properly on macOS. "
+ "Consider using QNativeGestureEvents or QMouseEvents.";
+ }
+#endif
+
+ // Chromium expects the touch event timestamps to be comparable to base::TimeTicks::Now().
+ // Most importantly we also have to preserve the relative time distance between events.
+ // Calculate a delta between event timestamps and Now() on the first received event, and
+ // apply this delta to all successive events. This delta is most likely smaller than it
+ // should by calculating it here but this will hopefully cause less than one frame of delay.
+ base::TimeTicks eventTimestamp = base::TimeTicks() + base::Milliseconds(event->timestamp());
+ if (m_eventsToNowDelta == 0)
+ m_eventsToNowDelta = (base::TimeTicks::Now() - eventTimestamp).InMicroseconds();
+ eventTimestamp += base::Microseconds(m_eventsToNowDelta);
+
+ auto touchPoints = mapTouchPointIds(event->points());
+ // Make sure that POINTER_DOWN action is delivered before MOVE, and MOVE before POINTER_UP
+ std::sort(touchPoints.begin(), touchPoints.end(), [] (const TouchPoint &l, const TouchPoint &r) {
+ return l.second.state() < r.second.state();
+ });
+
+ auto sc = qScopeGuard([&] () {
+ switch (event->type()) {
+ case QEvent::TouchCancel:
+ for (auto &&it : std::as_const(touchPoints))
+ m_touchIdMapping.remove(it.second.id());
+ Q_FALLTHROUGH();
+
+ case QEvent::TouchEnd:
+ m_previousTouchPoints.clear();
+ m_touchMotionStarted = false;
+ break;
+
+ default:
+ m_previousTouchPoints = touchPoints;
+ break;
+ }
+ });
+
+ ui::MotionEvent::Action action;
+ // Check first if the touch event should be routed to the selectionController
+ if (!touchPoints.isEmpty()) {
+ switch (touchPoints[0].second.state()) {
+ case QEventPoint::Pressed:
+ action = ui::MotionEvent::Action::DOWN;
+ break;
+ case QEventPoint::Updated:
+ action = ui::MotionEvent::Action::MOVE;
+ break;
+ case QEventPoint::Released:
+ action = ui::MotionEvent::Action::UP;
+ break;
+ default:
+ action = ui::MotionEvent::Action::NONE;
+ break;
+ }
+ } else {
+ // An empty touchPoints always corresponds to a TouchCancel event.
+ // We can't forward touch cancellations without a previously processed touch event,
+ // as Chromium expects the previous touchPoints for Action::CANCEL.
+ // If both are empty that means the TouchCancel was sent without an ongoing touch,
+ // so there's nothing to cancel anyway.
+ Q_ASSERT(event->type() == QEvent::TouchCancel);
+ touchPoints = m_previousTouchPoints;
+ if (touchPoints.isEmpty())
+ return;
+
+ action = ui::MotionEvent::Action::CANCEL;
+ }
+
+ MotionEventQt me(touchPoints, eventTimestamp, action, event->modifiers());
+ if (m_rwhv->getTouchSelectionController()->WillHandleTouchEvent(me))
+ return;
+
+ switch (event->type()) {
+ case QEvent::TouchBegin:
+ m_sendMotionActionDown = true;
+ m_touchMotionStarted = true;
+ m_rwhv->getTouchSelectionControllerClient()->onTouchDown();
+ break;
+ case QEvent::TouchUpdate:
+ m_touchMotionStarted = true;
+ break;
+ case QEvent::TouchCancel:
+ {
+ // Only process TouchCancel events received following a TouchBegin or TouchUpdate event
+ if (m_touchMotionStarted) {
+ MotionEventQt cancelEvent(touchPoints, eventTimestamp, ui::MotionEvent::Action::CANCEL, event->modifiers());
+ m_rwhv->processMotionEvent(cancelEvent);
+ }
+
+ return;
+ }
+ case QEvent::TouchEnd:
+ m_rwhv->getTouchSelectionControllerClient()->onTouchUp();
+ break;
+ default:
+ break;
+ }
+
+ if (m_imeInProgress && event->type() == QEvent::TouchBegin) {
+ m_imeInProgress = false;
+ // Tell input method to commit the pre-edit string entered so far, and finish the
+ // composition operation.
+#ifdef Q_OS_WIN
+ // Yes the function name is counter-intuitive, but commit isn't actually implemented
+ // by the Windows QPA, and reset does exactly what is necessary in this case.
+ qApp->inputMethod()->reset();
+#else
+ qApp->inputMethod()->commit();
+#endif
+ }
+
+ // MEMO for the basis of this logic look into:
+ // * blink_event_util.cc:ToWebTouchPointState: which is used later to forward touch event
+ // composed from motion event after gesture recognition
+ // * gesture_detector.cc:GestureDetector::OnTouchEvent: contains logic for every motion
+ // event action and corresponding gesture recognition routines
+ // * input_router_imp.cc:InputRouterImp::SetMovementXYForTouchPoints: expectation about
+ // touch event content like number of points for different states
+
+ int lastPressIndex = -1;
+ while ((lastPressIndex + 1) < touchPoints.size() && touchPoints[lastPressIndex + 1].second.state() == QEventPoint::Pressed)
+ ++lastPressIndex;
+
+ switch (event->type()) {
+ case QEvent::TouchBegin:
+ m_rwhv->processMotionEvent(MotionEventQt(touchPoints.mid(lastPressIndex),
+ eventTimestamp, ui::MotionEvent::Action::DOWN, event->modifiers()));
+ --lastPressIndex;
+ Q_FALLTHROUGH();
+
+ case QEvent::TouchUpdate:
+ for (; lastPressIndex >= 0; --lastPressIndex) {
+ Q_ASSERT(touchPoints[lastPressIndex].second.state() == QEventPoint::Pressed);
+ MotionEventQt me(touchPoints.mid(lastPressIndex), eventTimestamp, ui::MotionEvent::Action::POINTER_DOWN, event->modifiers(), 0);
+ m_rwhv->processMotionEvent(me);
+ }
+
+ if (event->touchPointStates() & Qt::TouchPointMoved)
+ m_rwhv->processMotionEvent(MotionEventQt(touchPoints, eventTimestamp, ui::MotionEvent::Action::MOVE, event->modifiers()));
+
+ Q_FALLTHROUGH();
+
+ case QEvent::TouchEnd:
+ while (!touchPoints.isEmpty() && touchPoints.back().second.state() == QEventPoint::Released) {
+ auto action = touchPoints.size() > 1 ? ui::MotionEvent::Action::POINTER_UP : ui::MotionEvent::Action::UP;
+ int index = action == ui::MotionEvent::Action::POINTER_UP ? touchPoints.size() - 1 : -1;
+ m_rwhv->processMotionEvent(MotionEventQt(touchPoints, eventTimestamp, action, event->modifiers(), index));
+ touchPoints.pop_back();
+ }
+ break;
+
+ default:
+ Q_ASSERT_X(false, __FUNCTION__, "Other event types are expected to be already handled.");
+ break;
+ }
+}
+
+#if QT_CONFIG(tabletevent)
+void RenderWidgetHostViewQtDelegateClient::handleTabletEvent(QTabletEvent *event)
+{
+ handlePointerEvent<QTabletEvent>(event);
+}
+#endif
+
+#if QT_CONFIG(gestures)
+void RenderWidgetHostViewQtDelegateClient::handleGestureEvent(QNativeGestureEvent *event)
+{
+ const Qt::NativeGestureType type = event->gestureType();
+ // These are the only supported gestures by Chromium so far.
+ if (type == Qt::ZoomNativeGesture || type == Qt::SmartZoomNativeGesture
+ || type == Qt::BeginNativeGesture || type == Qt::EndNativeGesture) {
+ auto *hostDelegate = m_rwhv->host()->delegate();
+ if (hostDelegate && hostDelegate->GetInputEventRouter()) {
+ auto webEvent = WebEventFactory::toWebGestureEvent(event);
+ hostDelegate->GetInputEventRouter()->RouteGestureEvent(m_rwhv, &webEvent, ui::LatencyInfo());
+ }
+ }
+}
+#endif
+
+void RenderWidgetHostViewQtDelegateClient::handleHoverEvent(QHoverEvent *event)
+{
+ auto *hostDelegate = m_rwhv->host()->delegate();
+ if (hostDelegate && hostDelegate->GetInputEventRouter()) {
+ auto webEvent = WebEventFactory::toWebMouseEvent(event);
+ hostDelegate->GetInputEventRouter()->RouteMouseEvent(m_rwhv, &webEvent, ui::LatencyInfo());
+ }
+}
+
+void RenderWidgetHostViewQtDelegateClient::handleFocusEvent(QFocusEvent *event)
+{
+ if (event->gotFocus()) {
+ m_rwhv->host()->GotFocus();
+ m_rwhv->host()->SetActive(true);
+ content::RenderViewHostImpl *rvh = content::RenderViewHostImpl::From(m_rwhv->host());
+ Q_ASSERT(rvh);
+ if (event->reason() == Qt::TabFocusReason)
+ rvh->SetInitialFocus(false);
+ else if (event->reason() == Qt::BacktabFocusReason)
+ rvh->SetInitialFocus(true);
+ event->accept();
+
+ m_rwhv->adapterClient()->webContentsAdapter()->handlePendingMouseLockPermission();
+ } else if (event->lostFocus()) {
+ m_rwhv->host()->SetActive(false);
+ m_rwhv->host()->LostFocus();
+ event->accept();
+ }
+}
+
+void RenderWidgetHostViewQtDelegateClient::handleInputMethodEvent(QInputMethodEvent *event)
+{
+ m_rwhv->resetInputManagerState();
+
+ if (!m_rwhv->host())
+ return;
+
+ QString commitString = event->commitString();
+ QString preeditString = event->preeditString();
+
+ int cursorPositionInPreeditString = -1;
+ gfx::Range selectionRange = gfx::Range::InvalidRange();
+
+ const QList<QInputMethodEvent::Attribute> &attributes = event->attributes();
+ std::vector<ui::ImeTextSpan> underlines;
+ bool hasSelection = false;
+
+ for (const auto &attribute : attributes) {
+ switch (attribute.type) {
+ case QInputMethodEvent::TextFormat: {
+ if (preeditString.isEmpty())
+ break;
+
+ int start = qMin(attribute.start, (attribute.start + attribute.length));
+ int end = qMax(attribute.start, (attribute.start + attribute.length));
+
+ // Blink does not support negative position values. Adjust start and end positions
+ // to non-negative values.
+ if (start < 0) {
+ start = 0;
+ end = qMax(0, start + end);
+ }
+
+ underlines.push_back(ui::ImeTextSpan(ui::ImeTextSpan::Type::kComposition, start, end,
+ ui::ImeTextSpan::Thickness::kThin,
+ ui::ImeTextSpan::UnderlineStyle::kSolid,
+ SK_ColorTRANSPARENT));
+
+ QTextCharFormat format = qvariant_cast<QTextFormat>(attribute.value).toCharFormat();
+ if (format.underlineStyle() != QTextCharFormat::NoUnderline)
+ underlines.back().underline_color = toSk(format.underlineColor());
+
+ break;
+ }
+ case QInputMethodEvent::Cursor:
+ // Always set the position of the cursor, even if it's marked invisible by Qt, otherwise
+ // there is no way the user will know which part of the composition string will be
+ // changed, when performing an IME-specific action (like selecting a different word
+ // suggestion).
+ cursorPositionInPreeditString = attribute.start;
+ break;
+ case QInputMethodEvent::Selection:
+ hasSelection = true;
+
+ // Cancel IME composition
+ if (preeditString.isEmpty() && attribute.start + attribute.length == 0) {
+ selectionRange.set_start(0);
+ selectionRange.set_end(0);
+ break;
+ }
+
+ selectionRange.set_start(qMin(attribute.start, (attribute.start + attribute.length)));
+ selectionRange.set_end(qMax(attribute.start, (attribute.start + attribute.length)));
+ break;
+ default:
+ break;
+ }
+ }
+
+ if (!selectionRange.IsValid()) {
+ // We did not receive a valid selection range, hence the range is going to mark the
+ // cursor position.
+ int newCursorPosition = (cursorPositionInPreeditString < 0) ? preeditString.length()
+ : cursorPositionInPreeditString;
+ selectionRange.set_start(newCursorPosition);
+ selectionRange.set_end(newCursorPosition);
+ }
+
+ if (hasSelection) {
+ if (auto *frameWidgetInputHandler = m_rwhv->getFrameWidgetInputHandler())
+ frameWidgetInputHandler->SetEditableSelectionOffsets(selectionRange.start(), selectionRange.end());
+ }
+
+ int replacementLength = event->replacementLength();
+ gfx::Range replacementRange = gfx::Range::InvalidRange();
+
+ if (replacementLength > 0) {
+ int replacementStart = event->replacementStart() < 0
+ ? m_cursorPosition + event->replacementStart()
+ : event->replacementStart();
+ if (replacementStart >= 0 && replacementStart < m_surroundingText.length())
+ replacementRange = gfx::Range(replacementStart, replacementStart + replacementLength);
+ }
+
+ // There are so-far two known cases, when an empty QInputMethodEvent is received.
+ // First one happens when backspace is used to remove the last character in the pre-edit
+ // string, thus signaling the end of the composition.
+ // The second one happens (on Windows) when a Korean char gets composed, but instead of
+ // the event having a commit string, both strings are empty, and the actual char is received
+ // as a QKeyEvent after the QInputMethodEvent is processed.
+ // In lieu of the second case, we can't simply cancel the composition on an empty event,
+ // and then add the Korean char when QKeyEvent is received, because that leads to text
+ // flickering in the textarea (or any other element).
+ // Instead we postpone the processing of the empty QInputMethodEvent by posting it
+ // to the same focused object, and cancelling the composition on the next event loop tick.
+ if (commitString.isEmpty() && preeditString.isEmpty() && replacementLength == 0) {
+ if (!m_receivedEmptyImeEvent && m_imeInProgress && !hasSelection) {
+ m_receivedEmptyImeEvent = true;
+ QGuiApplication::postEvent(qApp->focusObject(), event->clone());
+ } else {
+ m_receivedEmptyImeEvent = false;
+ if (m_imeInProgress) {
+ m_imeInProgress = false;
+ m_rwhv->host()->ImeCancelComposition();
+ }
+ }
+
+ return;
+ }
+
+ m_receivedEmptyImeEvent = false;
+
+ // Finish compostion: insert or erase text.
+ if (!commitString.isEmpty() || replacementLength > 0) {
+ m_rwhv->host()->ImeCommitText(toString16(commitString), underlines, replacementRange, 0);
+ m_imeInProgress = false;
+ }
+
+ // Update or start new composition.
+ // Be aware of that, we might get a commit string and a pre-edit string in a single event and
+ // this means a new composition.
+ if (!preeditString.isEmpty()) {
+ m_rwhv->host()->ImeSetComposition(toString16(preeditString), underlines, replacementRange,
+ selectionRange.start(), selectionRange.end());
+ m_imeInProgress = true;
+ }
+}
+
+void RenderWidgetHostViewQtDelegateClient::handleInputMethodQueryEvent(
+ QInputMethodQueryEvent *event)
+{
+ Qt::InputMethodQueries queries = event->queries();
+ for (uint i = 0; i < 32; ++i) {
+ Qt::InputMethodQuery query = (Qt::InputMethodQuery)(int)(queries & (1 << i));
+ if (query) {
+ QVariant v = inputMethodQuery(query);
+ event->setValue(query, v);
+ }
+ }
+ event->accept();
+}
+
+void RenderWidgetHostViewQtDelegateClient::clearPreviousTouchMotionState()
+{
+ m_previousTouchPoints.clear();
+ m_touchMotionStarted = false;
+}
+
+void RenderWidgetHostViewQtDelegateClient::selectionChanged()
+{
+ m_rwhv->resetInputManagerState();
+ ui::TextInputType type = m_rwhv->getTextInputType();
+ content::TextInputManager *text_input_manager = m_rwhv->GetTextInputManager();
+
+ // Handle text selection out of an input field
+ if (type == ui::TEXT_INPUT_TYPE_NONE) {
+ if (m_rwhv->GetSelectedText().empty() && m_emptyPreviousSelection)
+ return;
+
+ // Reset position values to emit selectionChanged signal when clearing text selection
+ // by clicking into an input field. These values are intended to be used by inputMethodQuery
+ // so they are not expected to be valid when selection is out of an input field.
+ m_anchorPositionWithinSelection = -1;
+ m_cursorPositionWithinSelection = -1;
+
+ m_emptyPreviousSelection = m_rwhv->GetSelectedText().empty();
+ m_rwhv->adapterClient()->selectionChanged();
+ return;
+ }
+
+ if (m_rwhv->GetSelectedText().empty()) {
+ // RenderWidgetHostViewQt::OnUpdateTextInputStateCalled() does not update the cursor
+ // position if the selection is cleared because TextInputState changes before the
+ // TextSelection change.
+ Q_ASSERT(text_input_manager->GetTextInputState());
+ m_cursorPosition = text_input_manager->GetTextInputState()->selection.start();
+ m_rwhv->delegate()->inputMethodStateChanged(true /*editorVisible*/,
+ type == ui::TEXT_INPUT_TYPE_PASSWORD);
+
+ m_anchorPositionWithinSelection = m_cursorPosition;
+ m_cursorPositionWithinSelection = m_cursorPosition;
+
+ if (!m_emptyPreviousSelection) {
+ m_emptyPreviousSelection = true;
+ m_rwhv->adapterClient()->selectionChanged();
+ }
+
+ return;
+ }
+
+ const content::TextInputManager::TextSelection *selection =
+ text_input_manager->GetTextSelection();
+ if (!selection)
+ return;
+
+ if (!selection->range().IsValid())
+ return;
+
+ int newAnchorPositionWithinSelection = 0;
+ int newCursorPositionWithinSelection = 0;
+
+ if (text_input_manager->GetSelectionRegion()->anchor.type() == gfx::SelectionBound::RIGHT) {
+ newAnchorPositionWithinSelection = selection->range().GetMax() - selection->offset();
+ newCursorPositionWithinSelection = selection->range().GetMin() - selection->offset();
+ } else {
+ newAnchorPositionWithinSelection = selection->range().GetMin() - selection->offset();
+ newCursorPositionWithinSelection = selection->range().GetMax() - selection->offset();
+ }
+
+ if (m_anchorPositionWithinSelection == newAnchorPositionWithinSelection
+ && m_cursorPositionWithinSelection == newCursorPositionWithinSelection) {
+ return;
+ }
+
+ m_anchorPositionWithinSelection = newAnchorPositionWithinSelection;
+ m_cursorPositionWithinSelection = newCursorPositionWithinSelection;
+
+ if (!selection->selected_text().empty())
+ m_cursorPosition = newCursorPositionWithinSelection;
+
+ m_emptyPreviousSelection = selection->selected_text().empty();
+ m_rwhv->delegate()->inputMethodStateChanged(true /*editorVisible*/,
+ type == ui::TEXT_INPUT_TYPE_PASSWORD);
+ m_rwhv->adapterClient()->selectionChanged();
+}
+
+} // namespace QtWebEngineCore
diff --git a/src/core/render_widget_host_view_qt_delegate_client.h b/src/core/render_widget_host_view_qt_delegate_client.h
new file mode 100644
index 000000000..57354f549
--- /dev/null
+++ b/src/core/render_widget_host_view_qt_delegate_client.h
@@ -0,0 +1,132 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#ifndef RENDER_WIDGET_HOST_VIEW_QT_DELEGATE_CLIENT_H
+#define RENDER_WIDGET_HOST_VIEW_QT_DELEGATE_CLIENT_H
+
+#include "compositor/compositor.h"
+
+#include <QMap>
+#include <QtGui/QCursor>
+#include <QtGui/QTouchEvent>
+
+QT_BEGIN_NAMESPACE
+class QEvent;
+class QVariant;
+class QMouseEvent;
+class QKeyEvent;
+class QTabletEvent;
+class QNativeGestureEvent;
+class QHoverEvent;
+class QFocusEvent;
+class QInputMethodEvent;
+class QInputMethodQueryEvent;
+QT_END_NAMESPACE
+
+namespace QtWebEngineCore {
+
+class RenderWidgetHostViewQt;
+
+struct MultipleMouseClickHelper
+{
+ QPoint lastPressPosition;
+ Qt::MouseButton lastPressButton = Qt::NoButton;
+ int clickCounter = 0;
+ ulong lastPressTimestamp = 0;
+};
+
+class Q_WEBENGINECORE_EXPORT RenderWidgetHostViewQtDelegateClient
+{
+public:
+ RenderWidgetHostViewQtDelegateClient(RenderWidgetHostViewQt *rwhv);
+
+ Compositor::Id compositorId();
+ void notifyShown();
+ void notifyHidden();
+ void visualPropertiesChanged();
+ bool forwardEvent(QEvent *);
+ QVariant inputMethodQuery(Qt::InputMethodQuery query);
+ void closePopup();
+
+private:
+ friend class RenderWidgetHostViewQt;
+
+ template<class T>
+ void handlePointerEvent(T *);
+ void handleMouseEvent(QMouseEvent *);
+ void handleKeyEvent(QKeyEvent *);
+ void handleTouchEvent(QTouchEvent *);
+#if QT_CONFIG(tabletevent)
+ void handleTabletEvent(QTabletEvent *);
+#endif
+#if QT_CONFIG(gestures)
+ void handleGestureEvent(QNativeGestureEvent *);
+#endif
+ void handleHoverEvent(QHoverEvent *);
+ void handleFocusEvent(QFocusEvent *);
+ void handleInputMethodEvent(QInputMethodEvent *);
+ void handleInputMethodQueryEvent(QInputMethodQueryEvent *);
+
+ QRect viewRectInDips() const { return m_viewRectInDips; }
+ QRect windowRectInDips() const { return m_windowRectInDips; }
+
+ // Mouse
+ void resetPreviousMousePosition() { m_previousMousePosition = QCursor::pos(); }
+
+ // Touch
+ void clearPreviousTouchMotionState();
+
+ // IME
+ void selectionChanged();
+ void setCursorPosition(uint pos) { m_cursorPosition = pos; }
+ void setSurroundingText(const QString &text) { m_surroundingText = text; }
+ bool isPreviousSelectionEmpty() const { return m_emptyPreviousSelection; }
+
+ RenderWidgetHostViewQt *m_rwhv;
+
+ // Mouse
+ uint m_mouseButtonPressed = 0;
+ QPoint m_previousMousePosition;
+ MultipleMouseClickHelper m_clickHelper;
+
+ // Key
+ std::string m_editCommand;
+
+ // Touch
+ typedef QPair<int, QTouchEvent::TouchPoint> TouchPoint;
+ QList<TouchPoint> mapTouchPointIds(const QList<QTouchEvent::TouchPoint> &input);
+ QMap<int, int> m_touchIdMapping;
+ QList<TouchPoint> m_previousTouchPoints;
+ bool m_touchMotionStarted = false;
+ bool m_sendMotionActionDown = false;
+ int64_t m_eventsToNowDelta = 0; // delta for first touch in microseconds
+
+ // IME
+ bool m_receivedEmptyImeEvent = false;
+ bool m_imeInProgress = false;
+ bool m_emptyPreviousSelection = true;
+ uint m_cursorPosition = 0;
+ int m_anchorPositionWithinSelection = -1;
+ int m_cursorPositionWithinSelection = -1;
+ QString m_surroundingText;
+
+ // Geometry of the view in screen DIPs.
+ QRect m_viewRectInDips;
+ // Geometry of the window, including frame, in screen DIPs.
+ QRect m_windowRectInDips;
+};
+
+} // namespace QtWebEngineCore
+
+#endif // RENDER_WIDGET_HOST_VIEW_QT_DELEGATE_CLIENT_H
diff --git a/src/core/render_widget_host_view_qt_delegate_item.cpp b/src/core/render_widget_host_view_qt_delegate_item.cpp
new file mode 100644
index 000000000..23e5bc935
--- /dev/null
+++ b/src/core/render_widget_host_view_qt_delegate_item.cpp
@@ -0,0 +1,455 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "render_widget_host_view_qt_delegate_item.h"
+
+#include "render_widget_host_view_qt_delegate_client.h"
+
+#include <QtGui/qevent.h>
+#include <QtGui/qguiapplication.h>
+#include <QtGui/qwindow.h>
+#include <QtQuick/qsgimagenode.h>
+
+#if QT_CONFIG(accessibility)
+#include <QtGui/qaccessible.h>
+#endif
+
+namespace QtWebEngineCore {
+
+RenderWidgetHostViewQtDelegateItem::RenderWidgetHostViewQtDelegateItem(RenderWidgetHostViewQtDelegateClient *client, bool isPopup)
+ : m_client(client)
+ , m_isPopup(isPopup)
+{
+ setFlag(ItemHasContents);
+ setAcceptedMouseButtons(Qt::AllButtons);
+ setKeepMouseGrab(true);
+ setAcceptHoverEvents(true);
+ setAcceptTouchEvents(true);
+ setKeepTouchGrab(true);
+ if (!isPopup) {
+ setFocus(true);
+ setActiveFocusOnTab(true);
+ }
+ bind(client->compositorId());
+}
+
+RenderWidgetHostViewQtDelegateItem::~RenderWidgetHostViewQtDelegateItem()
+{
+ releaseTextureResources();
+ if (m_widgetDelegate) {
+ m_widgetDelegate->Unbind();
+ m_widgetDelegate->Destroy();
+ }
+}
+
+void RenderWidgetHostViewQtDelegateItem::initAsPopup(const QRect &screenRect)
+{
+ Q_ASSERT(m_isPopup);
+ setSize(screenRect.size());
+ if (m_widgetDelegate)
+ m_widgetDelegate->InitAsPopup(screenRect);
+}
+
+QRectF RenderWidgetHostViewQtDelegateItem::viewGeometry() const
+{
+ // Transform the entire rect to find the correct top left corner.
+ const QPointF p1 = mapToGlobal(mapFromScene(QPointF(0, 0)));
+ const QPointF p2 = mapToGlobal(mapFromScene(QPointF(width(), height())));
+ QRectF geometry = QRectF(p1, p2).normalized();
+ // But keep the size untransformed to behave like other QQuickItems.
+ geometry.setSize(size());
+ return geometry;
+}
+
+QRect RenderWidgetHostViewQtDelegateItem::windowGeometry() const
+{
+ if (!Window())
+ return QRect();
+ return Window()->frameGeometry();
+}
+
+void RenderWidgetHostViewQtDelegateItem::setKeyboardFocus()
+{
+ setFocus(true);
+}
+
+bool RenderWidgetHostViewQtDelegateItem::hasKeyboardFocus()
+{
+ return hasActiveFocus();
+}
+
+void RenderWidgetHostViewQtDelegateItem::lockMouse()
+{
+ grabMouse();
+}
+
+void RenderWidgetHostViewQtDelegateItem::unlockMouse()
+{
+ ungrabMouse();
+}
+
+void RenderWidgetHostViewQtDelegateItem::show()
+{
+ if (isVisible())
+ m_client->notifyShown();
+ else
+ setVisible(true);
+}
+
+void RenderWidgetHostViewQtDelegateItem::hide()
+{
+ if (isVisible())
+ setVisible(false);
+ else
+ m_client->notifyHidden();
+}
+
+bool RenderWidgetHostViewQtDelegateItem::isVisible() const
+{
+ return QQuickItem::isVisible();
+}
+
+QWindow *RenderWidgetHostViewQtDelegateItem::Window() const
+{
+ if (m_widgetDelegate) {
+ if (auto *window = m_widgetDelegate->Window())
+ return window;
+ }
+ return QQuickItem::window();
+}
+
+void RenderWidgetHostViewQtDelegateItem::readyToSwap()
+{
+ // Call update() on UI thread.
+ QMetaObject::invokeMethod(this, &QQuickItem::update, Qt::QueuedConnection);
+}
+
+void RenderWidgetHostViewQtDelegateItem::updateCursor(const QCursor &cursor)
+{
+ setCursor(cursor);
+}
+
+void RenderWidgetHostViewQtDelegateItem::resize(int width, int height)
+{
+ setSize(QSizeF(width, height));
+ if (m_widgetDelegate)
+ m_widgetDelegate->Resize(width, height);
+}
+
+void RenderWidgetHostViewQtDelegateItem::move(const QPoint &point)
+{
+ if (m_widgetDelegate && m_isPopup)
+ m_widgetDelegate->MoveWindow(point);
+}
+
+void RenderWidgetHostViewQtDelegateItem::inputMethodStateChanged(bool editorVisible, bool passwordInput)
+{
+ setFlag(QQuickItem::ItemAcceptsInputMethod, editorVisible && !passwordInput);
+
+ if (parentItem())
+ parentItem()->setFlag(QQuickItem::ItemAcceptsInputMethod, editorVisible && !passwordInput);
+
+ if (m_widgetDelegate)
+ m_widgetDelegate->SetInputMethodEnabled(editorVisible && !passwordInput);
+
+ qApp->inputMethod()->update(Qt::ImQueryInput | Qt::ImEnabled | Qt::ImHints);
+ if (qApp->inputMethod()->isVisible() != editorVisible)
+ qApp->inputMethod()->setVisible(editorVisible);
+}
+
+void RenderWidgetHostViewQtDelegateItem::setWidgetDelegate(WidgetDelegate *delegate)
+{
+ Q_ASSERT(!m_widgetDelegate || !delegate);
+ m_widgetDelegate = delegate;
+ if (m_widgetDelegate) {
+ if (m_inputMethodHints)
+ m_widgetDelegate->SetInputMethodHints(m_inputMethodHints);
+ if (m_clearColor.isValid())
+ m_widgetDelegate->SetClearColor(m_clearColor);
+ if (flags().testFlag(QQuickItem::ItemAcceptsInputMethod))
+ m_widgetDelegate->SetInputMethodEnabled(true);
+ if (m_adapterClient)
+ m_widgetDelegate->Bind(m_adapterClient);
+ }
+}
+
+void RenderWidgetHostViewQtDelegateItem::setInputMethodHints(Qt::InputMethodHints hints)
+{
+ m_inputMethodHints = hints;
+ if (m_widgetDelegate)
+ m_widgetDelegate->SetInputMethodHints(hints);
+}
+
+void RenderWidgetHostViewQtDelegateItem::setClearColor(const QColor &color)
+{
+ m_clearColor = color;
+ if (m_widgetDelegate)
+ m_widgetDelegate->SetClearColor(color);
+}
+
+bool RenderWidgetHostViewQtDelegateItem::event(QEvent *event)
+{
+ if (event->type() == QEvent::ShortcutOverride)
+ return m_client->forwardEvent(event);
+
+#if QT_CONFIG(gestures)
+ if (event->type() == QEvent::NativeGesture)
+ return m_client->forwardEvent(event);
+#endif
+
+ return QQuickItem::event(event);
+}
+
+void RenderWidgetHostViewQtDelegateItem::focusInEvent(QFocusEvent *event)
+{
+#if QT_CONFIG(accessibility)
+ if (QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(this)) {
+ if (auto *focusChild = iface->focusChild()) {
+ QAccessibleEvent focusEvent(focusChild, QAccessible::Focus);
+ if (focusEvent.object())
+ focusEvent.setChild(-1);
+ QAccessible::updateAccessibility(&focusEvent);
+ }
+ }
+#endif // QT_CONFIG(accessibility)
+
+ m_client->forwardEvent(event);
+}
+
+void RenderWidgetHostViewQtDelegateItem::focusOutEvent(QFocusEvent *event)
+{
+ m_client->forwardEvent(event);
+}
+
+void RenderWidgetHostViewQtDelegateItem::mousePressEvent(QMouseEvent *event)
+{
+ if (!m_isPopup && m_widgetDelegate) {
+ if (m_widgetDelegate->ActiveFocusOnPress()) {
+ forceActiveFocus();
+ } else {
+ event->ignore();
+ return;
+ }
+ }
+ m_client->forwardEvent(event);
+}
+
+void RenderWidgetHostViewQtDelegateItem::mouseMoveEvent(QMouseEvent *event)
+{
+ if (!m_isPopup && m_widgetDelegate && !m_widgetDelegate->ActiveFocusOnPress()) {
+ event->ignore();
+ return;
+ }
+ m_client->forwardEvent(event);
+}
+
+void RenderWidgetHostViewQtDelegateItem::mouseReleaseEvent(QMouseEvent *event)
+{
+ if (!m_isPopup && m_widgetDelegate && !m_widgetDelegate->ActiveFocusOnPress()) {
+ event->ignore();
+ return;
+ }
+ m_client->forwardEvent(event);
+}
+
+void RenderWidgetHostViewQtDelegateItem::keyPressEvent(QKeyEvent *event)
+{
+ m_client->forwardEvent(event);
+}
+
+void RenderWidgetHostViewQtDelegateItem::keyReleaseEvent(QKeyEvent *event)
+{
+ m_client->forwardEvent(event);
+}
+
+void RenderWidgetHostViewQtDelegateItem::wheelEvent(QWheelEvent *event)
+{
+ m_client->forwardEvent(event);
+}
+
+void RenderWidgetHostViewQtDelegateItem::touchEvent(QTouchEvent *event)
+{
+ if (!m_isPopup && m_widgetDelegate) {
+ if (event->type() == QEvent::TouchBegin && m_widgetDelegate->ActiveFocusOnPress())
+ forceActiveFocus();
+
+ if (!m_widgetDelegate->ActiveFocusOnPress()) {
+ event->ignore();
+ return;
+ }
+ }
+ m_client->forwardEvent(event);
+}
+
+void RenderWidgetHostViewQtDelegateItem::hoverMoveEvent(QHoverEvent *event)
+{
+ event->ignore();
+ if ((!m_isPopup && m_widgetDelegate && !m_widgetDelegate->ActiveFocusOnPress())
+ || event->position() == event->oldPosF()) {
+ return;
+ }
+ m_client->forwardEvent(event);
+}
+
+void RenderWidgetHostViewQtDelegateItem::hoverLeaveEvent(QHoverEvent *event)
+{
+ event->ignore();
+ m_client->forwardEvent(event);
+}
+
+QVariant RenderWidgetHostViewQtDelegateItem::inputMethodQuery(Qt::InputMethodQuery query) const
+{
+ return m_client->inputMethodQuery(query);
+}
+
+void RenderWidgetHostViewQtDelegateItem::inputMethodEvent(QInputMethodEvent *event)
+{
+ m_client->forwardEvent(event);
+}
+
+void RenderWidgetHostViewQtDelegateItem::geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry)
+{
+ QQuickItem::geometryChange(newGeometry, oldGeometry);
+ m_client->visualPropertiesChanged();
+}
+
+void RenderWidgetHostViewQtDelegateItem::itemChange(ItemChange change, const ItemChangeData &value)
+{
+ QQuickItem::itemChange(change, value);
+ if (change == QQuickItem::ItemSceneChange) {
+ for (const QMetaObject::Connection &c : std::as_const(m_windowConnections))
+ disconnect(c);
+ m_windowConnections.clear();
+ if (value.window) {
+ m_windowConnections.append(connect(value.window, &QQuickWindow::beforeRendering,
+ this, &RenderWidgetHostViewQtDelegateItem::onBeforeRendering, Qt::DirectConnection));
+ m_windowConnections.append(connect(value.window, &QQuickWindow::afterFrameEnd, this,
+ &RenderWidgetHostViewQtDelegateItem::onAfterFrameEnd,
+ Qt::DirectConnection));
+ m_windowConnections.append(connect(value.window, SIGNAL(xChanged(int)), SLOT(onWindowPosChanged())));
+ m_windowConnections.append(
+ connect(value.window, SIGNAL(yChanged(int)), SLOT(onWindowPosChanged())));
+ m_windowConnections.append(
+ connect(value.window, &QQuickWindow::sceneGraphAboutToStop, this,
+ &RenderWidgetHostViewQtDelegateItem::releaseTextureResources,
+ Qt::DirectConnection));
+ if (!m_isPopup)
+ m_windowConnections.append(connect(value.window, SIGNAL(closing(QQuickCloseEvent *)), SLOT(onHide())));
+ }
+ m_client->visualPropertiesChanged();
+ } else if (change == QQuickItem::ItemVisibleHasChanged) {
+ if (value.boolValue) {
+ m_client->notifyShown();
+ } else {
+ m_client->notifyHidden();
+ if (!m_isPopup)
+ onHide();
+ }
+ }
+}
+
+QSGNode *RenderWidgetHostViewQtDelegateItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *)
+{
+ auto comp = compositor();
+ if (!comp)
+ return oldNode;
+
+ QQuickWindow *win = QQuickItem::window();
+
+ QSGImageNode *node = nullptr;
+ // Delete old node before swapFrame to decrement refcount of
+ // QImage in software mode.
+ if (comp->type() == Compositor::Type::Software)
+ delete oldNode;
+ else
+ node = static_cast<QSGImageNode*>(oldNode);
+
+ if (!node) {
+ node = win->createImageNode();
+ node->setOwnsTexture(true);
+ }
+
+ comp->swapFrame();
+
+ QSize texSize = comp->size();
+ QSizeF texSizeInDips = QSizeF(texSize) / comp->devicePixelRatio();
+ node->setRect(QRectF(QPointF(0, 0), texSizeInDips));
+
+ QQuickWindow::CreateTextureOptions texOpts;
+ if (comp->requiresAlphaChannel() || m_clearColor.alpha() < 255)
+ texOpts.setFlag(QQuickWindow::TextureHasAlphaChannel);
+ else
+ texOpts.setFlag(QQuickWindow::TextureIsOpaque);
+ QSGTexture *texture = comp->texture(win, texOpts);
+ if (texture) {
+ node->setTexture(texture);
+ if (comp->textureIsFlipped())
+ node->setTextureCoordinatesTransform(QSGImageNode::MirrorVertically);
+ } else {
+ if (!oldNode || comp->type() == Compositor::Type::Software) {
+ qDebug("Compositor returned null texture");
+ delete node;
+ return nullptr;
+ }
+ }
+
+ return node;
+}
+
+void RenderWidgetHostViewQtDelegateItem::onBeforeRendering()
+{
+ auto comp = compositor();
+ if (!comp || comp->type() == Compositor::Type::Software)
+ return;
+ comp->waitForTexture();
+}
+
+void RenderWidgetHostViewQtDelegateItem::onAfterFrameEnd()
+{
+ auto comp = compositor();
+ if (!comp || comp->type() != Compositor::Type::Native)
+ return;
+ comp->releaseTexture();
+}
+
+void RenderWidgetHostViewQtDelegateItem::onWindowPosChanged()
+{
+ m_client->visualPropertiesChanged();
+}
+
+void RenderWidgetHostViewQtDelegateItem::onHide()
+{
+ QFocusEvent event(QEvent::FocusOut, Qt::OtherFocusReason);
+ m_client->forwardEvent(&event);
+}
+
+void RenderWidgetHostViewQtDelegateItem::releaseTextureResources()
+{
+ auto comp = compositor();
+ if (!comp || comp->type() != Compositor::Type::Native)
+ return;
+
+ comp->releaseResources();
+}
+
+void RenderWidgetHostViewQtDelegateItem::adapterClientChanged(WebContentsAdapterClient *client)
+{
+ m_adapterClient = client;
+ if (m_widgetDelegate)
+ m_widgetDelegate->Bind(client);
+}
+
+void RenderWidgetHostViewQtDelegateItem::updateAdapterClientIfNeeded(WebContentsAdapterClient *client)
+{
+ if (client == m_adapterClient)
+ return;
+ adapterClientChanged(client);
+}
+
+void RenderWidgetHostViewQtDelegateItem::unhandledWheelEvent(QWheelEvent *ev)
+{
+ if (m_widgetDelegate)
+ m_widgetDelegate->unhandledWheelEvent(ev);
+}
+
+} // namespace QtWebEngineCore
diff --git a/src/core/render_widget_host_view_qt_delegate_item.h b/src/core/render_widget_host_view_qt_delegate_item.h
new file mode 100644
index 000000000..0da6b4948
--- /dev/null
+++ b/src/core/render_widget_host_view_qt_delegate_item.h
@@ -0,0 +1,125 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef RENDER_WIDGET_HOST_VIEW_QT_DELEGATE_ITEM_H
+#define RENDER_WIDGET_HOST_VIEW_QT_DELEGATE_ITEM_H
+
+#include "compositor/compositor.h"
+#include "render_widget_host_view_qt_delegate.h"
+
+#include <QtQuick/QQuickItem>
+
+QT_BEGIN_NAMESPACE
+class QQuickWebEngineViewPrivate;
+class QWebEngineViewPrivate;
+QT_END_NAMESPACE
+
+namespace QtWebEngineCore {
+
+class RenderWidgetHostViewQtDelegateClient;
+class WebContentsAdapterClient;
+class WebEngineQuickWidget;
+
+class WidgetDelegate
+{
+public:
+ virtual ~WidgetDelegate() = default;
+ virtual void InitAsPopup(const QRect &screenRect) = 0;
+ virtual void SetInputMethodEnabled(bool) { }
+ virtual void SetInputMethodHints(Qt::InputMethodHints) { }
+ virtual void SetClearColor(const QColor &) { }
+ virtual bool ActiveFocusOnPress() = 0;
+ virtual void MoveWindow(const QPoint & ) { }
+ virtual void Bind(WebContentsAdapterClient *) = 0;
+ virtual void Unbind() = 0;
+ virtual void Destroy() = 0;
+ virtual void Resize(int, int) { }
+ virtual QWindow *Window() { return nullptr; }
+ virtual void unhandledWheelEvent(QWheelEvent *) { }
+};
+
+// Useful information keyboard and mouse QEvent propagation.
+// A RenderWidgetHostViewQtDelegateItem instance initialized as a popup will receive
+// no keyboard focus (so all keyboard QEvents will be sent to the parent RWHVQD instance),
+// but will still receive mouse input (all mouse QEvent moves and clicks will be given to the popup
+// RWHVQD instance, and the mouse interaction area covers the surface of the whole parent
+// QWebEngineView, and not only the smaller surface that an HTML select popup would occupy).
+class Q_WEBENGINECORE_EXPORT RenderWidgetHostViewQtDelegateItem
+ : public QQuickItem
+ , public RenderWidgetHostViewQtDelegate
+ , public Compositor::Observer
+{
+ Q_OBJECT
+public:
+ RenderWidgetHostViewQtDelegateItem(RenderWidgetHostViewQtDelegateClient *client, bool isPopup);
+ ~RenderWidgetHostViewQtDelegateItem();
+
+ void initAsPopup(const QRect&) override;
+ QRectF viewGeometry() const override;
+ QRect windowGeometry() const override;
+ void setKeyboardFocus() override;
+ bool hasKeyboardFocus() override;
+ void lockMouse() override;
+ void unlockMouse() override;
+ void show() override;
+ void hide() override;
+ bool isVisible() const override;
+ QWindow *Window() const override;
+ void updateCursor(const QCursor &) override;
+ void resize(int width, int height) override;
+ void move(const QPoint &screenPos) override;
+ void inputMethodStateChanged(bool editorVisible, bool passwordInput) override;
+ void setInputMethodHints(Qt::InputMethodHints) override;
+ void setClearColor(const QColor &color) override;
+ void unhandledWheelEvent(QWheelEvent *ev) override;
+
+ void readyToSwap() override;
+
+ void setWidgetDelegate(WidgetDelegate *delegate);
+
+protected:
+ bool event(QEvent *event) override;
+ void focusInEvent(QFocusEvent *event) override;
+ void focusOutEvent(QFocusEvent *event) override;
+ void mousePressEvent(QMouseEvent *event) override;
+ void mouseMoveEvent(QMouseEvent *event) override;
+ void mouseReleaseEvent(QMouseEvent *event) override;
+ void keyPressEvent(QKeyEvent *event) override;
+ void keyReleaseEvent(QKeyEvent *event) override;
+ void wheelEvent(QWheelEvent *event) override;
+ void touchEvent(QTouchEvent *event) override;
+ void hoverMoveEvent(QHoverEvent *event) override;
+ void hoverLeaveEvent(QHoverEvent *event) override;
+ QVariant inputMethodQuery(Qt::InputMethodQuery query) const override;
+ void inputMethodEvent(QInputMethodEvent *event) override;
+ void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override;
+ void itemChange(ItemChange change, const ItemChangeData &value) override;
+ QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override;
+
+ void adapterClientChanged(WebContentsAdapterClient *client) override;
+ void updateAdapterClientIfNeeded(WebContentsAdapterClient *client) override;
+
+private Q_SLOTS:
+ void onBeforeRendering();
+ void onAfterFrameEnd();
+ void onWindowPosChanged();
+ void releaseTextureResources();
+ void onHide();
+
+private:
+ friend QWebEngineViewPrivate;
+ friend QQuickWebEngineViewPrivate;
+ friend WebEngineQuickWidget;
+
+ RenderWidgetHostViewQtDelegateClient *m_client;
+ bool m_isPopup;
+ QColor m_clearColor;
+ Qt::InputMethodHints m_inputMethodHints = {};
+ QList<QMetaObject::Connection> m_windowConnections;
+ WebContentsAdapterClient *m_adapterClient = nullptr;
+ WidgetDelegate *m_widgetDelegate = nullptr;
+};
+
+} // namespace QtWebEngineCore
+
+#endif // RENDER_WIDGET_HOST_VIEW_QT_DELEGATE_ITEM_H
diff --git a/src/core/renderer/content_renderer_client_qt.cpp b/src/core/renderer/content_renderer_client_qt.cpp
index b2138a82a..cc127e55f 100644
--- a/src/core/renderer/content_renderer_client_qt.cpp
+++ b/src/core/renderer/content_renderer_client_qt.cpp
@@ -1,91 +1,56 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "renderer/content_renderer_client_qt.h"
-#include "extensions/buildflags/buildflags.h"
-#include "printing/buildflags/buildflags.h"
#include "renderer/content_settings_observer_qt.h"
-#include "base/strings/string_split.h"
-#if QT_CONFIG(webengine_spellchecker)
-#include "components/spellcheck/renderer/spellcheck.h"
-#include "components/spellcheck/renderer/spellcheck_provider.h"
-#endif
-#include "components/cdm/renderer/external_clear_key_key_system_properties.h"
-#include "components/cdm/renderer/widevine_key_system_properties.h"
+#include "renderer/render_configuration.h"
+#include "renderer/render_frame_observer_qt.h"
+#include "renderer/user_resource_controller.h"
+#include "renderer/web_engine_page_render_frame.h"
+#include "web_engine_library_info.h"
+
+#include "base/task/sequenced_task_runner.h"
+#include "components/autofill/content/renderer/autofill_agent.h"
+#include "components/autofill/content/renderer/password_autofill_agent.h"
+#include "components/autofill/content/renderer/password_generation_agent.h"
+#include "components/cdm/renderer/external_clear_key_key_system_info.h"
+#include "components/cdm/renderer/widevine_key_system_info.h"
#include "components/error_page/common/error.h"
-#include "components/error_page/common/error_page_params.h"
#include "components/error_page/common/localized_error.h"
+#include "components/grit/components_resources.h"
#include "components/network_hints/renderer/web_prescient_networking_impl.h"
-#if QT_CONFIG(webengine_printing_and_pdf)
-#include "components/printing/renderer/print_render_frame_helper.h"
-#endif
#include "components/visitedlink/renderer/visitedlink_reader.h"
#include "components/web_cache/renderer/web_cache_impl.h"
#include "content/public/renderer/render_frame.h"
-#include "content/public/child/child_thread.h"
#include "content/public/common/url_constants.h"
#include "content/public/renderer/render_thread.h"
-#include "content/public/renderer/render_view.h"
-#include "media/base/key_system_properties.h"
+#include "extensions/buildflags/buildflags.h"
+#include "media/base/key_system_info.h"
+#include "media/cdm/cdm_capability.h"
#include "media/media_buildflags.h"
#include "mojo/public/cpp/bindings/binder_map.h"
#include "net/base/net_errors.h"
-#include "services/service_manager/public/cpp/connector.h"
-#include "services/service_manager/public/cpp/interface_provider.h"
+#include "ppapi/buildflags/buildflags.h"
+#include "printing/buildflags/buildflags.h"
+#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h"
#include "third_party/blink/public/platform/web_url_error.h"
-#include "third_party/blink/public/platform/web_url_request.h"
-#include "third_party/blink/public/web/web_security_policy.h"
-#include "third_party/blink/renderer/platform/weborigin/kurl.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/webui/jstemplate_builder.h"
-#include "content/public/common/web_preferences.h"
+
+#if QT_CONFIG(webengine_spellchecker)
+#include "components/spellcheck/renderer/spellcheck.h"
+#include "components/spellcheck/renderer/spellcheck_provider.h"
+#endif
#if QT_CONFIG(webengine_printing_and_pdf)
#include "renderer/print_web_view_helper_delegate_qt.h"
+
+#include "components/pdf/renderer/internal_plugin_renderer_helpers.h"
+#include "components/pdf/renderer/pdf_internal_plugin_delegate.h"
+#include "components/printing/renderer/print_render_frame_helper.h"
#endif
-#include "common/qt_messages.h"
-#include "renderer/render_frame_observer_qt.h"
-#include "renderer/render_view_observer_qt.h"
-#include "renderer/render_thread_observer_qt.h"
-#include "renderer/user_resource_controller.h"
#if QT_CONFIG(webengine_webchannel)
#include "renderer/web_channel_ipc_transport.h"
#endif
@@ -93,32 +58,36 @@
#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "common/extensions/extensions_client_qt.h"
#include "extensions/extensions_renderer_client_qt.h"
-#endif //ENABLE_EXTENSIONS
+
+#include "extensions/common/constants.h"
+#include "extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container_manager.h"
+#include "mojo/public/cpp/bindings/associated_remote.h"
+#include "services/service_manager/public/cpp/binder_registry.h"
+#include "third_party/blink/public/web/web_security_policy.h"
+#endif // ENABLE_EXTENSIONS
#if BUILDFLAG(ENABLE_PLUGINS)
+#include "content/renderer/render_frame_impl.h"
#include "plugins/loadable_plugin_placeholder_qt.h"
-#include "plugins/plugin_placeholder_qt.h"
-#include "content/common/frame_messages.h"
#endif // ENABLE_PLUGINS
-#include "services/service_manager/public/cpp/binder_registry.h"
-#include "services/service_manager/public/cpp/connector.h"
-#include "services/service_manager/public/cpp/service_binding.h"
-
-#include "components/grit/components_resources.h"
-
#if BUILDFLAG(ENABLE_LIBRARY_CDMS)
#include "base/feature_list.h"
#include "content/public/renderer/key_system_support.h"
#include "media/base/media_switches.h"
#include "media/base/video_codecs.h"
+#include "media/cdm/clear_key_cdm_common.h"
#include "third_party/widevine/cdm/buildflags.h"
+#if BUILDFLAG(ENABLE_WIDEVINE)
#include "third_party/widevine/cdm/widevine_cdm_common.h"
#endif
+#endif
-namespace QtWebEngineCore {
+#if QT_CONFIG(webengine_webrtc) && QT_CONFIG(webengine_extensions)
+#include "chrome/renderer/media/webrtc_logging_agent_impl.h"
+#endif
-static const char kHttpErrorDomain[] = "http";
+namespace QtWebEngineCore {
ContentRendererClientQt::ContentRendererClientQt()
{
@@ -132,31 +101,24 @@ ContentRendererClientQt::~ContentRendererClientQt() {}
void ContentRendererClientQt::RenderThreadStarted()
{
+ base::i18n::SetICUDefaultLocale(WebEngineLibraryInfo::getApplicationLocale());
content::RenderThread *renderThread = content::RenderThread::Get();
- m_renderThreadObserver.reset(new RenderThreadObserverQt());
+ m_renderConfiguration.reset(new RenderConfiguration());
+ m_userResourceController.reset(new UserResourceController());
m_visitedLinkReader.reset(new visitedlink::VisitedLinkReader);
m_webCacheImpl.reset(new web_cache::WebCacheImpl());
- renderThread->AddObserver(m_renderThreadObserver.data());
- renderThread->AddObserver(UserResourceController::instance());
+ renderThread->AddObserver(m_renderConfiguration.data());
+ renderThread->AddObserver(m_userResourceController.data());
#if QT_CONFIG(webengine_spellchecker)
if (!m_spellCheck)
InitSpellCheck();
#endif
- // Allow XMLHttpRequests from qrc to file.
- // ### consider removing for Qt6
- blink::WebURL qrc(blink::KURL("qrc:"));
- blink::WebString file(blink::WebString::FromASCII("file"));
- blink::WebSecurityPolicy::AddOriginAccessAllowListEntry(
- qrc, file, blink::WebString(), 0, network::mojom::CorsDomainMatchMode::kAllowSubdomains,
- network::mojom::CorsPortMatchMode::kAllowAnyPort,
- network::mojom::CorsOriginAccessMatchPriority::kDefaultPriority);
-
#if BUILDFLAG(ENABLE_EXTENSIONS)
// Allow the pdf viewer extension to access chrome resources
- blink::WebURL pdfViewerExtension(blink::KURL("chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai"));
+ blink::WebURL pdfViewerExtension(GURL("chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai"));
blink::WebString chromeResources(blink::WebString::FromASCII("chrome"));
blink::WebSecurityPolicy::AddOriginAccessAllowListEntry(
pdfViewerExtension, chromeResources, blink::WebString(), 0,
@@ -169,41 +131,49 @@ void ContentRendererClientQt::RenderThreadStarted()
void ContentRendererClientQt::ExposeInterfacesToBrowser(mojo::BinderMap* binders)
{
- binders->Add(m_visitedLinkReader->GetBindCallback(), base::SequencedTaskRunnerHandle::Get());
+ binders->Add<visitedlink::mojom::VisitedLinkNotificationSink>(
+ m_visitedLinkReader->GetBindCallback(), base::SingleThreadTaskRunner::GetCurrentDefault());
- binders->Add(base::BindRepeating(&web_cache::WebCacheImpl::BindReceiver,
- base::Unretained(m_webCacheImpl.get())),
- base::SequencedTaskRunnerHandle::Get());
+ binders->Add<web_cache::mojom::WebCache>(
+ base::BindRepeating(&web_cache::WebCacheImpl::BindReceiver,
+ base::Unretained(m_webCacheImpl.get())),
+ base::SingleThreadTaskRunner::GetCurrentDefault());
#if QT_CONFIG(webengine_spellchecker)
- binders->Add(base::BindRepeating(
+ binders->Add<spellcheck::mojom::SpellChecker>(
+ base::BindRepeating(
[](ContentRendererClientQt *client,
mojo::PendingReceiver<spellcheck::mojom::SpellChecker> receiver) {
if (!client->m_spellCheck)
client->InitSpellCheck();
client->m_spellCheck->BindReceiver(std::move(receiver));
}, this),
- base::SequencedTaskRunnerHandle::Get());
+ base::SingleThreadTaskRunner::GetCurrentDefault());
#endif
-}
-void ContentRendererClientQt::RenderViewCreated(content::RenderView *render_view)
-{
- // RenderViewObservers destroy themselves with their RenderView.
- new RenderViewObserverQt(render_view);
- UserResourceController::instance()->renderViewCreated(render_view);
+#if QT_CONFIG(webengine_webrtc) && QT_CONFIG(webengine_extensions)
+ binders->Add<chrome::mojom::WebRtcLoggingAgent>(
+ base::BindRepeating(
+ [](ContentRendererClientQt *client,
+ mojo::PendingReceiver<chrome::mojom::WebRtcLoggingAgent> receiver) {
+ client->GetWebRtcLoggingAgent()->AddReceiver(std::move(receiver));
+ }, this),
+ base::SingleThreadTaskRunner::GetCurrentDefault());
+#endif
}
void ContentRendererClientQt::RenderFrameCreated(content::RenderFrame *render_frame)
{
QtWebEngineCore::RenderFrameObserverQt *render_frame_observer =
new QtWebEngineCore::RenderFrameObserverQt(render_frame, m_webCacheImpl.data());
+ if (render_frame->IsMainFrame()) {
#if QT_CONFIG(webengine_webchannel)
- if (render_frame->IsMainFrame())
new WebChannelIPCTransport(render_frame);
#endif
+ new WebEnginePageRenderFrame(render_frame);
+ }
- UserResourceController::instance()->renderFrameCreated(render_frame);
+ m_userResourceController->renderFrameCreated(render_frame);
new QtWebEngineCore::ContentSettingsObserverQt(render_frame);
@@ -213,10 +183,37 @@ void ContentRendererClientQt::RenderFrameCreated(content::RenderFrame *render_fr
#if QT_CONFIG(webengine_printing_and_pdf)
new printing::PrintRenderFrameHelper(render_frame, base::WrapUnique(new PrintWebViewHelperDelegateQt()));
#endif // QT_CONFIG(webengine_printing_and_pdf)
+
+ blink::AssociatedInterfaceRegistry *associated_interfaces = render_frame_observer->associatedInterfaces();
+
#if BUILDFLAG(ENABLE_EXTENSIONS)
+ associated_interfaces->AddInterface<extensions::mojom::MimeHandlerViewContainerManager>(
+ base::BindRepeating(
+ &extensions::MimeHandlerViewContainerManager::BindReceiver,
+ render_frame->GetRoutingID()));
+
auto registry = std::make_unique<service_manager::BinderRegistry>();
ExtensionsRendererClientQt::GetInstance()->RenderFrameCreated(render_frame, render_frame_observer->registry());
#endif
+
+ autofill::PasswordAutofillAgent *password_autofill_agent =
+ new autofill::PasswordAutofillAgent(render_frame, associated_interfaces);
+ autofill::PasswordGenerationAgent *password_generation_agent =
+ new autofill::PasswordGenerationAgent(render_frame, password_autofill_agent,
+ associated_interfaces);
+
+ new autofill::AutofillAgent(render_frame, password_autofill_agent, password_generation_agent,
+ associated_interfaces);
+}
+
+void ContentRendererClientQt::WebViewCreated(blink::WebView *web_view,
+ bool was_created_by_renderer,
+ const url::Origin *outermost_origin)
+{
+ Q_UNUSED(was_created_by_renderer);
+#if BUILDFLAG(ENABLE_EXTENSIONS)
+ ExtensionsRendererClientQt::GetInstance()->WebViewCreated(web_view, outermost_origin);
+#endif
}
void ContentRendererClientQt::RunScriptsAtDocumentStart(content::RenderFrame *render_frame)
@@ -234,7 +231,7 @@ void ContentRendererClientQt::RunScriptsAtDocumentEnd(content::RenderFrame *rend
RenderFrameObserverQt *render_frame_observer = RenderFrameObserverQt::Get(render_frame);
if (render_frame_observer && !render_frame_observer->isFrameDetached())
- UserResourceController::instance()->RunScriptsAtDocumentEnd(render_frame);
+ m_userResourceController->RunScriptsAtDocumentEnd(render_frame);
#if BUILDFLAG(ENABLE_EXTENSIONS)
ExtensionsRendererClientQt::GetInstance()->RunScriptsAtDocumentEnd(render_frame);
@@ -250,40 +247,29 @@ void ContentRendererClientQt::RunScriptsAtDocumentIdle(content::RenderFrame *ren
#endif
}
-bool ContentRendererClientQt::HasErrorPage(int httpStatusCode)
-{
- // Use an internal error page, if we have one for the status code.
- if (!error_page::LocalizedError::HasStrings(error_page::Error::kHttpErrorDomain, httpStatusCode)) {
- return false;
- }
-
- return true;
-}
-
-bool ContentRendererClientQt::ShouldSuppressErrorPage(content::RenderFrame *frame, const GURL &)
-{
- return !(frame->GetWebkitPreferences().enable_error_page);
-}
-
// To tap into the chromium localized strings. Ripped from the chrome layer (highly simplified).
void ContentRendererClientQt::PrepareErrorPage(content::RenderFrame *renderFrame,
const blink::WebURLError &web_error,
const std::string &httpMethod,
+ content::mojom::AlternativeErrorPageOverrideInfoPtr alternative_error_page_info,
std::string *errorHtml)
{
GetNavigationErrorStringsInternal(
renderFrame, httpMethod,
- error_page::Error::NetError(web_error.url(), web_error.reason(), web_error.has_copy_in_cache()), errorHtml);
+ error_page::Error::NetError((GURL)web_error.url(), web_error.reason(), web_error.extended_reason(),
+ net::ResolveErrorInfo(), web_error.has_copy_in_cache()),
+ errorHtml);
}
void ContentRendererClientQt::PrepareErrorPageForHttpStatusError(content::RenderFrame *renderFrame,
- const GURL &unreachable_url,
+ const blink::WebURLError &error,
const std::string &httpMethod,
int http_status,
+ content::mojom::AlternativeErrorPageOverrideInfoPtr alternative_error_page_info,
std::string *errorHtml)
{
GetNavigationErrorStringsInternal(renderFrame, httpMethod,
- error_page::Error::HttpError(unreachable_url, http_status),
+ error_page::Error::HttpError(error.url(), http_status),
errorHtml);
}
@@ -292,7 +278,7 @@ void ContentRendererClientQt::GetNavigationErrorStringsInternal(content::RenderF
const error_page::Error &error,
std::string *errorHtml)
{
- Q_UNUSED(renderFrame)
+ Q_UNUSED(renderFrame);
const bool isPost = QByteArray::fromStdString(httpMethod) == QByteArrayLiteral("POST");
if (errorHtml) {
@@ -303,11 +289,12 @@ void ContentRendererClientQt::GetNavigationErrorStringsInternal(content::RenderF
// TODO(elproxy): We could potentially get better diagnostics here by first calling
// NetErrorHelper::GetErrorStringsForDnsProbe, but that one is harder to untangle.
+ base::Value::Dict error_page_params;
error_page::LocalizedError::PageState errorPageState =
- error_page::LocalizedError::GetPageState(
- error.reason(), error.domain(), error.url(), isPost,
- error.stale_copy_in_cache(), false, RenderThreadObserverQt::is_incognito_process(), false,
- false, locale, std::unique_ptr<error_page::ErrorPageParams>());
+ error_page::LocalizedError::GetPageState(
+ error.reason(), error.domain(), error.url(), isPost, false,
+ error.stale_copy_in_cache(), false,
+ RenderConfiguration::is_incognito_process(), false, false, false, locale, false, &error_page_params);
resourceId = IDR_NET_ERROR_HTML;
@@ -316,7 +303,7 @@ void ContentRendererClientQt::GetNavigationErrorStringsInternal(content::RenderF
if (template_html.empty())
NOTREACHED() << "unable to load template. ID: " << resourceId;
else // "t" is the id of the templates root node.
- *errorHtml = webui::GetTemplatesHtml(template_html, &errorPageState.strings, "t");
+ *errorHtml = webui::GetTemplatesHtml(template_html, errorPageState.strings, "t");
}
}
@@ -335,6 +322,92 @@ std::unique_ptr<blink::WebPrescientNetworking> ContentRendererClientQt::CreatePr
return std::make_unique<network_hints::WebPrescientNetworkingImpl>(render_frame);
}
+namespace {
+bool IsPdfExtensionOrigin(const url::Origin &origin)
+{
+#if BUILDFLAG(ENABLE_EXTENSIONS)
+ return origin.scheme() == extensions::kExtensionScheme &&
+ origin.host() == extension_misc::kPdfExtensionId;
+#else
+ return false;
+#endif
+}
+
+#if BUILDFLAG(ENABLE_PLUGINS)
+void AppendParams(const std::vector<content::WebPluginMimeType::Param> &additional_params,
+ blink::WebVector<blink::WebString> *existing_names,
+ blink::WebVector<blink::WebString> *existing_values)
+{
+ DCHECK(existing_names->size() == existing_values->size());
+ size_t existing_size = existing_names->size();
+ size_t total_size = existing_size + additional_params.size();
+
+ blink::WebVector<blink::WebString> names(total_size);
+ blink::WebVector<blink::WebString> values(total_size);
+
+ for (size_t i = 0; i < existing_size; ++i) {
+ names[i] = (*existing_names)[i];
+ values[i] = (*existing_values)[i];
+ }
+
+ for (size_t i = 0; i < additional_params.size(); ++i) {
+ names[existing_size + i] = blink::WebString::FromUTF16(additional_params[i].name);
+ values[existing_size + i] = blink::WebString::FromUTF16(additional_params[i].value);
+ }
+
+ existing_names->Swap(names);
+ existing_values->Swap(values);
+}
+#endif // BUILDFLAG(ENABLE_PLUGINS)
+
+#if QT_CONFIG(webengine_printing_and_pdf)
+// based on chrome/renderer/pdf/chrome_pdf_internal_plugin_delegate.cc:
+class PdfInternalPluginDelegateQt final
+ : public pdf::PdfInternalPluginDelegate
+{
+public:
+ PdfInternalPluginDelegateQt() = default;
+ PdfInternalPluginDelegateQt(const PdfInternalPluginDelegateQt &) = delete;
+ PdfInternalPluginDelegateQt& operator=(const PdfInternalPluginDelegateQt &) = delete;
+ ~PdfInternalPluginDelegateQt() override = default;
+
+ // `pdf::PdfInternalPluginDelegate`:
+ bool IsAllowedOrigin(const url::Origin &origin) const override;
+};
+
+bool PdfInternalPluginDelegateQt::IsAllowedOrigin(const url::Origin &origin) const
+{
+ return IsPdfExtensionOrigin(origin);
+}
+#endif
+} // namespace
+
+bool ContentRendererClientQt::IsPluginHandledExternally(content::RenderFrame *render_frame,
+ const blink::WebElement &plugin_element,
+ const GURL &original_url,
+ const std::string &original_mime_type)
+{
+#if BUILDFLAG(ENABLE_EXTENSIONS) && BUILDFLAG(ENABLE_PLUGINS)
+ bool found = false;
+ content::WebPluginInfo plugin_info;
+ std::string mime_type;
+
+ static_cast<content::RenderFrameImpl *>(render_frame)->GetPepperHost()->GetPluginInfo(
+ original_url, original_mime_type, &found, &plugin_info, &mime_type);
+ if (!found)
+ return false;
+ if (IsPdfExtensionOrigin(render_frame->GetWebFrame()->GetSecurityOrigin()))
+ return true;
+ return extensions::MimeHandlerViewContainerManager::Get(
+ content::RenderFrame::FromWebFrame(
+ plugin_element.GetDocument().GetFrame()),
+ true /* create_if_does_not_exist */)
+ ->CreateFrameContainer(plugin_element, original_url, mime_type, plugin_info);
+#else
+ return false;
+#endif
+}
+
bool ContentRendererClientQt::OverrideCreatePlugin(content::RenderFrame *render_frame,
const blink::WebPluginParams &params,
blink::WebPlugin **plugin)
@@ -342,56 +415,52 @@ bool ContentRendererClientQt::OverrideCreatePlugin(content::RenderFrame *render_
#if BUILDFLAG(ENABLE_EXTENSIONS)
if (!ExtensionsRendererClientQt::GetInstance()->OverrideCreatePlugin(render_frame, params))
return false;
-#endif //ENABLE_EXTENSIONS
+#endif // ENABLE_EXTENSIONS
#if BUILDFLAG(ENABLE_PLUGINS)
- chrome::mojom::PluginInfoPtr plugin_info = chrome::mojom::PluginInfo::New();
content::WebPluginInfo info;
std::string mime_type;
bool found = false;
- render_frame->Send(new FrameHostMsg_GetPluginInfo(render_frame->GetRoutingID(), params.url,
- render_frame->GetWebFrame()->Top()->GetSecurityOrigin(),
- params.mime_type.Utf8(), &found, &info, &mime_type));
+ static_cast<content::RenderFrameImpl *>(render_frame)->GetPepperHost()->GetPluginInfo(
+ params.url, params.mime_type.Utf8(), &found, &info, &mime_type);
if (!found) {
- *plugin = CreatePlugin(render_frame, params, *plugin_info);
+ *plugin = LoadablePluginPlaceholderQt::CreateLoadableMissingPlugin(render_frame, params)->plugin();
return true;
}
-#endif // BUILDFLAG(ENABLE_PLUGINS)
- return content::ContentRendererClient::OverrideCreatePlugin(render_frame, params, plugin);
-}
+ if (info.name == u"Chromium PDF Viewer") {
+ blink::WebPluginParams new_params(params);
+ for (const auto& mime_type : info.mime_types) {
+ if (mime_type.mime_type == params.mime_type.Utf8()) {
+ AppendParams(mime_type.additional_params, &new_params.attribute_names,
+ &new_params.attribute_values);
+ break;
+ }
+ }
-#if BUILDFLAG(ENABLE_PLUGINS)
-// static
-blink::WebPlugin* ContentRendererClientQt::CreatePlugin(content::RenderFrame* render_frame,
- const blink::WebPluginParams& original_params,
- const chrome::mojom::PluginInfo& plugin_info)
-{
- // If the browser plugin is to be enabled, this should be handled by the
- // renderer, so the code won't reach here due to the early exit in OverrideCreatePlugin.
- return LoadablePluginPlaceholderQt::CreateLoadableMissingPlugin(render_frame, original_params)->plugin();
+ *plugin = pdf::CreateInternalPlugin(std::move(new_params), render_frame, std::make_unique<PdfInternalPluginDelegateQt>());
+ return true;
+ }
+ *plugin = render_frame->CreatePlugin(info, params);
+#endif // BUILDFLAG(ENABLE_PLUGINS)
+ return true;
}
-#endif //BUILDFLAG(ENABLE_PLUGINS)
-content::BrowserPluginDelegate *ContentRendererClientQt::CreateBrowserPluginDelegate(content::RenderFrame *render_frame,
- const content::WebPluginInfo &info,
- const std::string &mime_type,
- const GURL &original_url)
+bool ContentRendererClientQt::IsOriginIsolatedPepperPlugin(const base::FilePath& plugin_path)
{
-#if BUILDFLAG(ENABLE_EXTENSIONS)
- return ExtensionsRendererClientQt::GetInstance()->CreateBrowserPluginDelegate(render_frame, info, mime_type,
- original_url);
-#else
- return nullptr;
-#endif
+ return plugin_path.value() == FILE_PATH_LITERAL("internal-pdf-viewer");
}
-void ContentRendererClientQt::BindReceiverOnMainThread(mojo::GenericPendingReceiver receiver)
+#if QT_CONFIG(webengine_webrtc) && QT_CONFIG(webengine_extensions)
+chrome::WebRtcLoggingAgentImpl *ContentRendererClientQt::GetWebRtcLoggingAgent()
{
- std::string interface_name = *receiver.interface_name();
- auto pipe = receiver.PassPipe();
- m_registry.TryBindInterface(interface_name, &pipe);
+ if (!m_webrtcLoggingAgentImpl) {
+ m_webrtcLoggingAgentImpl = std::make_unique<chrome::WebRtcLoggingAgentImpl>();
+ }
+
+ return m_webrtcLoggingAgentImpl.get();
}
+#endif // QT_CONFIG(webengine_webrtc) && QT_CONFIG(webengine_extensions)
void ContentRendererClientQt::GetInterface(const std::string &interface_name, mojo::ScopedMessagePipeHandle interface_pipe)
{
@@ -405,129 +474,125 @@ void ContentRendererClientQt::GetInterface(const std::string &interface_name, mo
#if BUILDFLAG(ENABLE_LIBRARY_CDMS)
// External Clear Key (used for testing).
-static void AddExternalClearKey(std::vector<std::unique_ptr<media::KeySystemProperties>> *concrete_key_systems)
-{
- // TODO(xhwang): Move these into an array so we can use a for loop to add
- // supported key systems below.
- static const char kExternalClearKeyKeySystem[] =
- "org.chromium.externalclearkey";
- static const char kExternalClearKeyDecryptOnlyKeySystem[] =
- "org.chromium.externalclearkey.decryptonly";
- static const char kExternalClearKeyMessageTypeTestKeySystem[] =
- "org.chromium.externalclearkey.messagetypetest";
- static const char kExternalClearKeyFileIOTestKeySystem[] =
- "org.chromium.externalclearkey.fileiotest";
- static const char kExternalClearKeyOutputProtectionTestKeySystem[] =
- "org.chromium.externalclearkey.outputprotectiontest";
- static const char kExternalClearKeyPlatformVerificationTestKeySystem[] =
- "org.chromium.externalclearkey.platformverificationtest";
- static const char kExternalClearKeyInitializeFailKeySystem[] =
- "org.chromium.externalclearkey.initializefail";
- static const char kExternalClearKeyCrashKeySystem[] =
- "org.chromium.externalclearkey.crash";
- static const char kExternalClearKeyVerifyCdmHostTestKeySystem[] =
- "org.chromium.externalclearkey.verifycdmhosttest";
- static const char kExternalClearKeyStorageIdTestKeySystem[] =
- "org.chromium.externalclearkey.storageidtest";
- static const char kExternalClearKeyDifferentGuidTestKeySystem[] =
- "org.chromium.externalclearkey.differentguid";
- static const char kExternalClearKeyCdmProxyTestKeySystem[] =
- "org.chromium.externalclearkey.cdmproxytest";
-
- media::mojom::KeySystemCapabilityPtr capability;
- if (!content::IsKeySystemSupported(kExternalClearKeyKeySystem, &capability)) {
- DVLOG(1) << "External Clear Key not supported";
+static void AddExternalClearKey(const media::mojom::KeySystemCapabilityPtr &capability,
+ media::KeySystemInfos* key_systems)
+{
+ Q_UNUSED(capability);
+ if (!base::FeatureList::IsEnabled(media::kExternalClearKeyForTesting)) {
+ DLOG(ERROR) << "ExternalClearKey supported despite not enabled.";
return;
}
- concrete_key_systems->emplace_back(
- new cdm::ExternalClearKeyProperties(kExternalClearKeyKeySystem));
-
- // Add support of decrypt-only mode in ClearKeyCdm.
- concrete_key_systems->emplace_back(
- new cdm::ExternalClearKeyProperties(kExternalClearKeyDecryptOnlyKeySystem));
-
- // A key system that triggers various types of messages in ClearKeyCdm.
- concrete_key_systems->emplace_back(
- new cdm::ExternalClearKeyProperties(kExternalClearKeyMessageTypeTestKeySystem));
-
- // A key system that triggers the FileIO test in ClearKeyCdm.
- concrete_key_systems->emplace_back(
- new cdm::ExternalClearKeyProperties(kExternalClearKeyFileIOTestKeySystem));
-
- // A key system that triggers the output protection test in ClearKeyCdm.
- concrete_key_systems->emplace_back(
- new cdm::ExternalClearKeyProperties(kExternalClearKeyOutputProtectionTestKeySystem));
-
- // A key system that triggers the platform verification test in ClearKeyCdm.
- concrete_key_systems->emplace_back(
- new cdm::ExternalClearKeyProperties(kExternalClearKeyPlatformVerificationTestKeySystem));
+ // TODO(xhwang): Actually use `capability` to determine capabilities.
+ key_systems->push_back(std::make_unique<cdm::ExternalClearKeyKeySystemInfo>());
+}
- // A key system that Chrome thinks is supported by ClearKeyCdm, but actually
- // will be refused by ClearKeyCdm. This is to test the CDM initialization
- // failure case.
- concrete_key_systems->emplace_back(
- new cdm::ExternalClearKeyProperties(kExternalClearKeyInitializeFailKeySystem));
+#if BUILDFLAG(ENABLE_WIDEVINE)
+media::SupportedCodecs GetVP9Codecs(const base::flat_set<media::VideoCodecProfile> &profiles)
+{
+ if (profiles.empty()) {
+ // If no profiles are specified, then all are supported.
+ return media::EME_CODEC_VP9_PROFILE0 | media::EME_CODEC_VP9_PROFILE2;
+ }
- // A key system that triggers a crash in ClearKeyCdm.
- concrete_key_systems->emplace_back(
- new cdm::ExternalClearKeyProperties(kExternalClearKeyCrashKeySystem));
+ media::SupportedCodecs supported_vp9_codecs = media::EME_CODEC_NONE;
+ for (const auto& profile : profiles) {
+ switch (profile) {
+ case media::VP9PROFILE_PROFILE0:
+ supported_vp9_codecs |= media::EME_CODEC_VP9_PROFILE0;
+ break;
+ case media::VP9PROFILE_PROFILE2:
+ supported_vp9_codecs |= media::EME_CODEC_VP9_PROFILE2;
+ break;
+ default:
+ DVLOG(1) << "Unexpected " << media::GetCodecName(media::VideoCodec::kVP9)
+ << " profile: " << media::GetProfileName(profile);
+ break;
+ }
+ }
- // A key system that triggers the verify host files test in ClearKeyCdm.
- concrete_key_systems->emplace_back(
- new cdm::ExternalClearKeyProperties(kExternalClearKeyVerifyCdmHostTestKeySystem));
+ return supported_vp9_codecs;
+}
- // A key system that fetches the Storage ID in ClearKeyCdm.
- concrete_key_systems->emplace_back(
- new cdm::ExternalClearKeyProperties(kExternalClearKeyStorageIdTestKeySystem));
+#if BUILDFLAG(ENABLE_PLATFORM_HEVC)
+media::SupportedCodecs GetHevcCodecs(const base::flat_set<media::VideoCodecProfile> &profiles)
+{
+ // If no profiles are specified, then all are supported.
+ if (profiles.empty()) {
+ return media::EME_CODEC_HEVC_PROFILE_MAIN |
+ media::EME_CODEC_HEVC_PROFILE_MAIN10;
+ }
- // A key system that is registered with a different CDM GUID.
- concrete_key_systems->emplace_back(
- new cdm::ExternalClearKeyProperties(kExternalClearKeyDifferentGuidTestKeySystem));
+ media::SupportedCodecs supported_hevc_codecs = media::EME_CODEC_NONE;
+ for (const auto& profile : profiles) {
+ switch (profile) {
+ case media::HEVCPROFILE_MAIN:
+ supported_hevc_codecs |= media::EME_CODEC_HEVC_PROFILE_MAIN;
+ break;
+ case media::HEVCPROFILE_MAIN10:
+ supported_hevc_codecs |= media::EME_CODEC_HEVC_PROFILE_MAIN10;
+ break;
+ default:
+ DVLOG(1) << "Unexpected " << media::GetCodecName(media::VideoCodec::kHEVC)
+ << " profile: " << media::GetProfileName(profile);
+ break;
+ }
+ }
- // A key system that triggers CDM Proxy test in ClearKeyCdm.
- concrete_key_systems->emplace_back(
- new cdm::ExternalClearKeyProperties(kExternalClearKeyCdmProxyTestKeySystem));
+ return supported_hevc_codecs;
}
+#endif // BUILDFLAG(ENABLE_PLATFORM_HEVC)
-#if BUILDFLAG(ENABLE_WIDEVINE)
-static media::SupportedCodecs GetSupportedCodecs(const std::vector<media::VideoCodec> &supported_video_codecs,
+static media::SupportedCodecs GetSupportedCodecs(const media::CdmCapability& capability,
bool is_secure)
{
media::SupportedCodecs supported_codecs = media::EME_CODEC_NONE;
- // Audio codecs are always supported because the CDM only does decrypt-only
- // for audio. The only exception is when |is_secure| is true and there's no
- // secure video decoder available, which is a signal that secure hardware
- // decryption is not available either.
- // TODO(sandersd): Distinguish these from those that are directly supported,
- // as those may offer a higher level of protection.
- if (!supported_video_codecs.empty() || !is_secure) {
- supported_codecs |= media::EME_CODEC_OPUS;
- supported_codecs |= media::EME_CODEC_VORBIS;
- supported_codecs |= media::EME_CODEC_FLAC;
+ for (const auto& codec : capability.audio_codecs) {
+ switch (codec) {
+ case media::AudioCodec::kOpus:
+ supported_codecs |= media::EME_CODEC_OPUS;
+ break;
+ case media::AudioCodec::kVorbis:
+ supported_codecs |= media::EME_CODEC_VORBIS;
+ break;
+ case media::AudioCodec::kFLAC:
+ supported_codecs |= media::EME_CODEC_FLAC;
+ break;
#if BUILDFLAG(USE_PROPRIETARY_CODECS)
- supported_codecs |= media::EME_CODEC_AAC;
-#endif // BUILDFLAG(USE_PROPRIETARY_CODECS)
+ case media::AudioCodec::kAAC:
+ supported_codecs |= media::EME_CODEC_AAC;
+ break;
+#endif // BUILDFLAG(USE_PROPRIETARY_CODECS)
+ default:
+ DVLOG(1) << "Unexpected supported codec: " << GetCodecName(codec);
+ break;
+ }
}
- // Video codecs are determined by what was registered for the CDM.
- for (const auto &codec : supported_video_codecs) {
- switch (codec) {
- case media::VideoCodec::kCodecVP8:
+ for (const auto &codec : capability.video_codecs) {
+ switch (codec.first) {
+ case media::VideoCodec::kVP8:
supported_codecs |= media::EME_CODEC_VP8;
break;
- case media::VideoCodec::kCodecVP9:
- supported_codecs |= media::EME_CODEC_VP9_PROFILE0;
- supported_codecs |= media::EME_CODEC_VP9_PROFILE2;
+ case media::VideoCodec::kVP9:
+ supported_codecs |= GetVP9Codecs(codec.second.supported_profiles);
+ break;
+ case media::VideoCodec::kAV1:
+ supported_codecs |= media::EME_CODEC_AV1;
break;
#if BUILDFLAG(USE_PROPRIETARY_CODECS)
- case media::VideoCodec::kCodecH264:
+ case media::VideoCodec::kH264:
supported_codecs |= media::EME_CODEC_AVC1;
break;
#endif // BUILDFLAG(USE_PROPRIETARY_CODECS)
+#if BUILDFLAG(ENABLE_PLATFORM_HEVC)
+ case media::VideoCodec::kHEVC:
+ supported_codecs |= GetHevcCodecs(codec.second.supported_profiles);
+ break;
+#endif // BUILDFLAG(ENABLE_PLATFORM_HEVC)
default:
- DVLOG(1) << "Unexpected supported codec: " << GetCodecName(codec);
+ DVLOG(1) << "Unexpected supported codec: " << GetCodecName(codec.first);
break;
}
}
@@ -535,23 +600,36 @@ static media::SupportedCodecs GetSupportedCodecs(const std::vector<media::VideoC
return supported_codecs;
}
-static void AddWidevine(std::vector<std::unique_ptr<media::KeySystemProperties>> *concrete_key_systems)
+static void AddWidevine(const media::mojom::KeySystemCapabilityPtr &capability,
+ media::KeySystemInfos *key_systems)
{
- media::mojom::KeySystemCapabilityPtr capability;
- if (!content::IsKeySystemSupported(kWidevineKeySystem, &capability)) {
- DVLOG(1) << "Widevine CDM is not currently available.";
- return;
+ // Codecs and encryption schemes.
+ media::SupportedCodecs codecs = media::EME_CODEC_NONE;
+ media::SupportedCodecs hw_secure_codecs = media::EME_CODEC_NONE;
+ base::flat_set<media::EncryptionScheme> encryption_schemes;
+ base::flat_set<media::EncryptionScheme> hw_secure_encryption_schemes;
+ base::flat_set<media::CdmSessionType> session_types;
+ base::flat_set<media::CdmSessionType> hw_secure_session_types;
+ if (capability->sw_secure_capability) {
+ codecs = GetSupportedCodecs(capability->sw_secure_capability.value(), /*is_secure=*/false);
+ encryption_schemes = capability->sw_secure_capability->encryption_schemes;
+ if (!base::Contains(capability->sw_secure_capability->session_types, media::CdmSessionType::kTemporary)) {
+ DVLOG(1) << "Temporary sessions must be supported.";
+ return;
+ }
}
- // Codecs and encryption schemes.
- auto codecs = GetSupportedCodecs(capability->video_codecs, /*is_secure=*/false);
- const auto &encryption_schemes = capability->encryption_schemes;
- auto hw_secure_codecs = GetSupportedCodecs(capability->hw_secure_video_codecs,
- /*is_secure=*/true);
- const auto &hw_secure_encryption_schemes = capability->hw_secure_encryption_schemes;
+ if (capability->hw_secure_capability) {
+ hw_secure_codecs = GetSupportedCodecs(capability->hw_secure_capability.value(), /*is_secure=*/true);
+ hw_secure_encryption_schemes = capability->hw_secure_capability->encryption_schemes;
+ if (!base::Contains(capability->hw_secure_capability->session_types, media::CdmSessionType::kTemporary)) {
+ DVLOG(1) << "Temporary sessions must be supported.";
+ return;
+ }
+ }
// Robustness.
- using Robustness = cdm::WidevineKeySystemProperties::Robustness;
+ using Robustness = cdm::WidevineKeySystemInfo::Robustness;
auto max_audio_robustness = Robustness::SW_SECURE_CRYPTO;
auto max_video_robustness = Robustness::SW_SECURE_DECODE;
@@ -560,40 +638,52 @@ static void AddWidevine(std::vector<std::unique_ptr<media::KeySystemProperties>>
max_video_robustness = Robustness::HW_SECURE_ALL;
}
- // Session types.
- bool cdm_supports_temporary_session = base::Contains(capability->session_types, media::CdmSessionType::kTemporary);
- if (!cdm_supports_temporary_session) {
- DVLOG(1) << "Temporary session must be supported.";
- return;
- }
-
- auto persistent_license_support = media::EmeSessionTypeSupport::NOT_SUPPORTED;
- auto persistent_usage_record_support = media::EmeSessionTypeSupport::NOT_SUPPORTED;
-
// Others.
auto persistent_state_support = media::EmeFeatureSupport::REQUESTABLE;
auto distinctive_identifier_support = media::EmeFeatureSupport::NOT_SUPPORTED;
- concrete_key_systems->emplace_back(new cdm::WidevineKeySystemProperties(
- codecs, encryption_schemes, hw_secure_codecs,
- hw_secure_encryption_schemes, max_audio_robustness, max_video_robustness,
- persistent_license_support, persistent_usage_record_support,
- persistent_state_support, distinctive_identifier_support));
+ key_systems->emplace_back(new cdm::WidevineKeySystemInfo(
+ codecs, std::move(encryption_schemes), std::move(session_types),
+ hw_secure_codecs, std::move(hw_secure_encryption_schemes),
+ std::move(hw_secure_session_types),
+ max_audio_robustness, max_video_robustness,
+ persistent_state_support,
+ distinctive_identifier_support));
}
#endif // BUILDFLAG(ENABLE_WIDEVINE)
#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
-void ContentRendererClientQt::AddSupportedKeySystems(std::vector<std::unique_ptr<media::KeySystemProperties>> *key_systems)
+void OnKeySystemSupportUpdated(media::GetSupportedKeySystemsCB cb,
+ content::KeySystemCapabilityPtrMap key_system_capabilities)
{
+ media::KeySystemInfos key_systems;
+ for (const auto &entry : key_system_capabilities) {
#if BUILDFLAG(ENABLE_LIBRARY_CDMS)
- if (base::FeatureList::IsEnabled(media::kExternalClearKeyForTesting))
- AddExternalClearKey(key_systems);
-
+ const auto &key_system = entry.first;
+ const auto &capability = entry.second;
#if BUILDFLAG(ENABLE_WIDEVINE)
- AddWidevine(key_systems);
+ if (key_system == kWidevineKeySystem) {
+ AddWidevine(capability, &key_systems);
+ continue;
+ }
#endif // BUILDFLAG(ENABLE_WIDEVINE)
+ if (key_system == media::kExternalClearKeyKeySystem) {
+ AddExternalClearKey(capability, &key_systems);
+ continue;
+ }
+
+ DLOG(ERROR) << "Unrecognized key system: " << key_system;
#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
+ }
+
+ cb.Run(std::move(key_systems));
+}
+
+void ContentRendererClientQt::GetSupportedKeySystems(media::GetSupportedKeySystemsCB cb)
+{
+ content::ObserveKeySystemSupportUpdate(
+ base::BindRepeating(&OnKeySystemSupportUpdated, std::move(cb)));
}
#if QT_CONFIG(webengine_spellchecker)
@@ -606,25 +696,16 @@ void ContentRendererClientQt::InitSpellCheck()
void ContentRendererClientQt::WillSendRequest(blink::WebLocalFrame *frame,
ui::PageTransition transition_type,
const blink::WebURL &url,
- const blink::WebURL &site_for_cookies,
+ const net::SiteForCookies &site_for_cookies,
const url::Origin *initiator_origin,
- GURL *new_url,
- bool *attach_same_site_cookies)
+ GURL *new_url)
{
#if BUILDFLAG(ENABLE_EXTENSIONS)
- ExtensionsRendererClientQt::GetInstance()->WillSendRequest(frame, transition_type, url, /*site_for_cookies,*/
- initiator_origin, new_url, attach_same_site_cookies);
+ ExtensionsRendererClientQt::GetInstance()->WillSendRequest(frame, transition_type, url, site_for_cookies,
+ initiator_origin, new_url);
if (!new_url->is_empty())
return;
#endif
}
-bool ContentRendererClientQt::RequiresWebComponentsV0(const GURL &url)
-{
- Q_UNUSED(url);
- // Google services still presents pages using these features
- // to Chromium 80 based browsers (YouTube in particular).
- return true;
-}
-
} // namespace QtWebEngineCore
diff --git a/src/core/renderer/content_renderer_client_qt.h b/src/core/renderer/content_renderer_client_qt.h
index f2e725453..b2231f00a 100644
--- a/src/core/renderer/content_renderer_client_qt.h
+++ b/src/core/renderer/content_renderer_client_qt.h
@@ -1,58 +1,24 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef CONTENT_RENDERER_CLIENT_QT_H
#define CONTENT_RENDERER_CLIENT_QT_H
#include "qtwebenginecoreglobal_p.h"
#include "content/public/renderer/content_renderer_client.h"
-#include "components/spellcheck/spellcheck_buildflags.h"
#include "services/service_manager/public/cpp/binder_registry.h"
#include "services/service_manager/public/cpp/local_interface_provider.h"
-#include "ppapi/buildflags/buildflags.h"
-
-#if BUILDFLAG(ENABLE_PLUGINS)
-#include "qtwebengine/browser/plugin.mojom.h"
-#include "third_party/blink/public/web/web_plugin_params.h"
-#endif
#include <QScopedPointer>
+namespace blink {
+class WebPlugin;
+struct WebPluginParams;
+}
+
+namespace chrome {
+class WebRtcLoggingAgentImpl;
+}
+
namespace error_page {
class Error;
}
@@ -69,14 +35,10 @@ class WebCacheImpl;
class SpellCheck;
#endif
-namespace content {
-struct WebPluginInfo;
-}
-
namespace QtWebEngineCore {
-class RenderThreadObserverQt;
-
+class UserResourceController;
+class RenderConfiguration;
class ContentRendererClientQt
: public content::ContentRendererClient
, public service_manager::LocalInterfaceProvider
@@ -88,56 +50,52 @@ public:
// content::ContentRendererClient:
void RenderThreadStarted() override;
void ExposeInterfacesToBrowser(mojo::BinderMap* binders) override;
- void RenderViewCreated(content::RenderView *render_view) override;
void RenderFrameCreated(content::RenderFrame *render_frame) override;
- bool ShouldSuppressErrorPage(content::RenderFrame *, const GURL &) override;
- bool HasErrorPage(int http_status_code) override;
+ void WebViewCreated(blink::WebView *web_view,
+ bool was_created_by_renderer,
+ const url::Origin *outermost_origin) override;
void PrepareErrorPage(content::RenderFrame *render_frame,
const blink::WebURLError &error,
const std::string &http_method,
+ content::mojom::AlternativeErrorPageOverrideInfoPtr alternative_error_page_info,
std::string *error_html) override;
void PrepareErrorPageForHttpStatusError(content::RenderFrame *render_frame,
- const GURL &unreachable_url,
+ const blink::WebURLError &error,
const std::string &http_method,
int http_status,
- std::string *error_html) override;
-
+ content::mojom::AlternativeErrorPageOverrideInfoPtr alternative_error_page_info,
+ std::string *error_html) override;
uint64_t VisitedLinkHash(const char *canonical_url, size_t length) override;
bool IsLinkVisited(uint64_t linkHash) override;
std::unique_ptr<blink::WebPrescientNetworking> CreatePrescientNetworking(content::RenderFrame *render_frame) override;
- void AddSupportedKeySystems(std::vector<std::unique_ptr<media::KeySystemProperties>> *key_systems) override;
-
+ void GetSupportedKeySystems(media::GetSupportedKeySystemsCB cb) override;
void RunScriptsAtDocumentStart(content::RenderFrame *render_frame) override;
void RunScriptsAtDocumentEnd(content::RenderFrame *render_frame) override;
void RunScriptsAtDocumentIdle(content::RenderFrame *render_frame) override;
+ bool IsPluginHandledExternally(content::RenderFrame *embedder_frame,
+ const blink::WebElement &plugin_element,
+ const GURL &original_url,
+ const std::string &original_mime_type) override;
bool OverrideCreatePlugin(content::RenderFrame *render_frame,
const blink::WebPluginParams &params,
blink::WebPlugin **plugin) override;
- content::BrowserPluginDelegate *CreateBrowserPluginDelegate(content::RenderFrame *render_frame,
- const content::WebPluginInfo &info,
- const std::string &mime_type,
- const GURL &original_url) override;
+ bool IsOriginIsolatedPepperPlugin(const base::FilePath& plugin_path) override;
void WillSendRequest(blink::WebLocalFrame *frame,
ui::PageTransition transition_type,
const blink::WebURL &url,
- const blink::WebURL &site_for_cookies,
+ const net::SiteForCookies &site_for_cookies,
const url::Origin *initiator_origin,
- GURL *new_url,
- bool *attach_same_site_cookies) override;
+ GURL *new_url) override;
- void BindReceiverOnMainThread(mojo::GenericPendingReceiver receiver) override;
- bool RequiresWebComponentsV0(const GURL &url) override;
-
-#if BUILDFLAG(ENABLE_PLUGINS)
- static blink::WebPlugin* CreatePlugin(content::RenderFrame* render_frame,
- const blink::WebPluginParams& params,
- const chrome::mojom::PluginInfo& plugin_info);
+#if QT_CONFIG(webengine_webrtc) && QT_CONFIG(webengine_extensions)
+ chrome::WebRtcLoggingAgentImpl *GetWebRtcLoggingAgent();
#endif
+
private:
-#if BUILDFLAG(ENABLE_SPELLCHECK)
+#if QT_CONFIG(webengine_spellchecker)
void InitSpellCheck();
#endif
// service_manager::LocalInterfaceProvider:
@@ -146,16 +104,16 @@ private:
void GetNavigationErrorStringsInternal(content::RenderFrame *renderFrame, const std::string &httpMethod,
const error_page::Error &error, std::string *errorHtml);
- QScopedPointer<RenderThreadObserverQt> m_renderThreadObserver;
+ QScopedPointer<RenderConfiguration> m_renderConfiguration;
+ QScopedPointer<UserResourceController> m_userResourceController;
QScopedPointer<visitedlink::VisitedLinkReader> m_visitedLinkReader;
QScopedPointer<web_cache::WebCacheImpl> m_webCacheImpl;
#if QT_CONFIG(webengine_spellchecker)
QScopedPointer<SpellCheck> m_spellCheck;
#endif
-
- service_manager::BinderRegistry m_registry;
-
- DISALLOW_COPY_AND_ASSIGN(ContentRendererClientQt);
+#if QT_CONFIG(webengine_webrtc) && QT_CONFIG(webengine_extensions)
+ std::unique_ptr<chrome::WebRtcLoggingAgentImpl> m_webrtcLoggingAgentImpl;
+#endif
};
} // namespace
diff --git a/src/core/renderer/content_settings_observer_qt.cpp b/src/core/renderer/content_settings_observer_qt.cpp
index df9b77037..3e3c159f5 100644
--- a/src/core/renderer/content_settings_observer_qt.cpp
+++ b/src/core/renderer/content_settings_observer_qt.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Based on chrome/renderer/content_settings_observer.cc:
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
@@ -46,15 +10,12 @@
#include "content/public/renderer/render_frame.h"
#include "third_party/blink/public/platform/web_security_origin.h"
-#include "third_party/blink/public/web/web_plugin_document.h"
+#include "third_party/blink/public/web/web_document.h"
#include "third_party/blink/public/web/web_local_frame.h"
#include "url/origin.h"
#include "common/qt_messages.h"
-using blink::WebSecurityOrigin;
-using blink::WebString;
-
namespace {
bool IsUniqueFrame(blink::WebFrame *frame)
@@ -82,21 +43,20 @@ bool ContentSettingsObserverQt::OnMessageReceived(const IPC::Message &message)
{
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(ContentSettingsObserverQt, message)
- IPC_MESSAGE_HANDLER(QtWebEngineMsg_RequestFileSystemAccessAsyncResponse, OnRequestFileSystemAccessAsyncResponse)
+ IPC_MESSAGE_HANDLER(QtWebEngineMsg_RequestStorageAccessAsyncResponse, OnRequestStorageAccessAsyncResponse)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
}
-void ContentSettingsObserverQt::DidCommitProvisionalLoad(bool is_same_document_navigation, ui::PageTransition /*transition*/)
+void ContentSettingsObserverQt::DidCommitProvisionalLoad(ui::PageTransition /*transition*/)
{
blink::WebLocalFrame *frame = render_frame()->GetWebFrame();
if (frame->Parent())
return; // Not a top-level navigation.
- if (!is_same_document_navigation)
- ClearBlockedContentSettings();
+ ClearBlockedContentSettings();
GURL url = frame->GetDocument().Url();
// If we start failing this DCHECK, please makes sure we don't regress
@@ -109,68 +69,51 @@ void ContentSettingsObserverQt::OnDestruct()
delete this;
}
-bool ContentSettingsObserverQt::AllowDatabase()
-{
- blink::WebFrame *frame = render_frame()->GetWebFrame();
- if (IsUniqueFrame(frame))
- return false;
-
- bool result = false;
- Send(new QtWebEngineHostMsg_AllowDatabase(routing_id(), url::Origin(frame->GetSecurityOrigin()).GetURL(),
- url::Origin(frame->Top()->GetSecurityOrigin()).GetURL(), &result));
- return result;
-}
-
-void ContentSettingsObserverQt::RequestFileSystemAccessAsync(base::OnceCallback<void(bool)> callback)
+void ContentSettingsObserverQt::AllowStorageAccess(StorageType storage_type,
+ base::OnceCallback<void(bool)> callback)
{
blink::WebFrame *frame = render_frame()->GetWebFrame();
if (IsUniqueFrame(frame)) {
std::move(callback).Run(false);
return;
}
+
++m_currentRequestId;
bool inserted = m_permissionRequests.insert(std::make_pair(m_currentRequestId, std::move(callback))).second;
// Verify there are no duplicate insertions.
DCHECK(inserted);
- Send(new QtWebEngineHostMsg_RequestFileSystemAccessAsync(routing_id(), m_currentRequestId,
- url::Origin(frame->GetSecurityOrigin()).GetURL(),
- url::Origin(frame->Top()->GetSecurityOrigin()).GetURL()));
+ Send(new QtWebEngineHostMsg_RequestStorageAccessAsync(routing_id(), m_currentRequestId,
+ url::Origin(frame->GetSecurityOrigin()).GetURL(),
+ url::Origin(frame->Top()->GetSecurityOrigin()).GetURL(),
+ int(storage_type)));
}
-bool ContentSettingsObserverQt::AllowIndexedDB()
-{
- blink::WebFrame *frame = render_frame()->GetWebFrame();
- if (IsUniqueFrame(frame))
- return false;
-
- bool result = false;
- Send(new QtWebEngineHostMsg_AllowIndexedDB(routing_id(),
- url::Origin(frame->GetSecurityOrigin()).GetURL(),
- url::Origin(frame->Top()->GetSecurityOrigin()).GetURL(), &result));
- return result;
-}
-
-bool ContentSettingsObserverQt::AllowStorage(bool local)
+bool ContentSettingsObserverQt::AllowStorageAccessSync(StorageType storage_type)
{
blink::WebLocalFrame *frame = render_frame()->GetWebFrame();
if (IsUniqueFrame(frame))
return false;
- StoragePermissionsKey key(url::Origin(frame->GetDocument().GetSecurityOrigin()).GetURL(), local);
- const auto permissions = m_cachedStoragePermissions.find(key);
- if (permissions != m_cachedStoragePermissions.end())
- return permissions->second;
+ bool sameOrigin = url::Origin(frame->Top()->GetSecurityOrigin()).IsSameOriginWith(url::Origin(frame->GetSecurityOrigin()));
+ StoragePermissionsKey key(url::Origin(frame->GetSecurityOrigin()).GetURL(), int(storage_type));
+ if (sameOrigin) {
+ const auto permissions = m_cachedStoragePermissions.find(key);
+ if (permissions != m_cachedStoragePermissions.end())
+ return permissions->second;
+ }
bool result = false;
- Send(new QtWebEngineHostMsg_AllowDOMStorage(routing_id(), url::Origin(frame->GetSecurityOrigin()).GetURL(),
- url::Origin(frame->Top()->GetSecurityOrigin()).GetURL(), local, &result));
- m_cachedStoragePermissions[key] = result;
+ Send(new QtWebEngineHostMsg_AllowStorageAccess(routing_id(), url::Origin(frame->GetSecurityOrigin()).GetURL(),
+ url::Origin(frame->Top()->GetSecurityOrigin()).GetURL(),
+ int(storage_type), &result));
+ if (sameOrigin)
+ m_cachedStoragePermissions[key] = result;
return result;
}
-void ContentSettingsObserverQt::OnRequestFileSystemAccessAsyncResponse(int request_id, bool allowed)
+void ContentSettingsObserverQt::OnRequestStorageAccessAsyncResponse(int request_id, bool allowed)
{
auto it = m_permissionRequests.find(request_id);
if (it == m_permissionRequests.end())
diff --git a/src/core/renderer/content_settings_observer_qt.h b/src/core/renderer/content_settings_observer_qt.h
index 0c69d289c..415d0b6b7 100644
--- a/src/core/renderer/content_settings_observer_qt.h
+++ b/src/core/renderer/content_settings_observer_qt.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
@@ -50,10 +14,6 @@
#include "third_party/blink/public/platform/web_content_settings_client.h"
#include "url/gurl.h"
-namespace blink {
-class WebSecurityOrigin;
-}
-
namespace QtWebEngineCore {
// Handles blocking content per content settings for each RenderFrame.
@@ -67,33 +27,30 @@ public:
~ContentSettingsObserverQt() override;
// blink::WebContentSettingsClient:
- bool AllowDatabase() override;
- void RequestFileSystemAccessAsync(base::OnceCallback<void(bool)> callback) override;
- bool AllowIndexedDB() override;
- bool AllowStorage(bool local) override;
+ void AllowStorageAccess(StorageType storage_type,
+ base::OnceCallback<void(bool)> callback) override;
+ bool AllowStorageAccessSync(StorageType storage_type) override;
private:
// RenderFrameObserver implementation:
bool OnMessageReceived(const IPC::Message &message) override;
- void DidCommitProvisionalLoad(bool is_same_document_navigation, ui::PageTransition transition) override;
+ void DidCommitProvisionalLoad(ui::PageTransition transition) override;
void OnDestruct() override;
// Message handlers.
- void OnRequestFileSystemAccessAsyncResponse(int request_id, bool allowed);
+ void OnRequestStorageAccessAsyncResponse(int request_id, bool allowed);
// Clears m_cachedStoragePermissions
void ClearBlockedContentSettings();
// Caches the result of AllowStorage.
- using StoragePermissionsKey = std::pair<GURL, bool>;
+ using StoragePermissionsKey = std::pair<GURL, int>;
base::flat_map<StoragePermissionsKey, bool> m_cachedStoragePermissions;
int m_currentRequestId;
base::flat_map<int, base::OnceCallback<void(bool)>> m_permissionRequests;
-
- DISALLOW_COPY_AND_ASSIGN(ContentSettingsObserverQt);
};
} // namespace QtWebEngineCore
-#endif // RENDERER_CONTENT_SETTINGS_OBSERVER_QT_H
+#endif // CONTENT_SETTINGS_OBSERVER_QT_H
diff --git a/src/core/renderer/extensions/extensions_dispatcher_delegate_qt.cpp b/src/core/renderer/extensions/extensions_dispatcher_delegate_qt.cpp
index 418429330..191e36d04 100644
--- a/src/core/renderer/extensions/extensions_dispatcher_delegate_qt.cpp
+++ b/src/core/renderer/extensions/extensions_dispatcher_delegate_qt.cpp
@@ -1,44 +1,11 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "extensions_dispatcher_delegate_qt.h"
+#include "chrome/grit/renderer_resources.h"
+#include "extensions/renderer/resource_bundle_source_map.h"
+
namespace QtWebEngineCore {
ExtensionsDispatcherDelegateQt::ExtensionsDispatcherDelegateQt()
@@ -49,4 +16,10 @@ ExtensionsDispatcherDelegateQt::~ExtensionsDispatcherDelegateQt()
{
}
+void ExtensionsDispatcherDelegateQt::PopulateSourceMap(extensions::ResourceBundleSourceMap *source_map)
+{
+ // Custom binding for hangout services extension.
+ source_map->RegisterSource("webrtcDesktopCapturePrivate", IDR_WEBRTC_DESKTOP_CAPTURE_PRIVATE_CUSTOM_BINDINGS_JS);
+}
+
} //namespace QtWebEngineCore
diff --git a/src/core/renderer/extensions/extensions_dispatcher_delegate_qt.h b/src/core/renderer/extensions/extensions_dispatcher_delegate_qt.h
index 25aa18e71..42ae165d1 100644
--- a/src/core/renderer/extensions/extensions_dispatcher_delegate_qt.h
+++ b/src/core/renderer/extensions/extensions_dispatcher_delegate_qt.h
@@ -1,46 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef EXTENSIONSDISPATCHERDELEGATEQT_H
#define EXTENSIONSDISPATCHERDELEGATEQT_H
-#include "base/macros.h"
#include "extensions/renderer/dispatcher_delegate.h"
namespace QtWebEngineCore {
@@ -52,7 +15,8 @@ public:
~ExtensionsDispatcherDelegateQt() override;
private:
- DISALLOW_COPY_AND_ASSIGN(ExtensionsDispatcherDelegateQt);
+ // extensions::DispatcherDelegate implementation.
+ void PopulateSourceMap(extensions::ResourceBundleSourceMap *source_map) override;
};
} // namespace QtWebEngineCore
diff --git a/src/core/renderer/extensions/extensions_renderer_client_qt.cpp b/src/core/renderer/extensions/extensions_renderer_client_qt.cpp
index 7d4c9a83c..b36ed9e8b 100644
--- a/src/core/renderer/extensions/extensions_renderer_client_qt.cpp
+++ b/src/core/renderer/extensions/extensions_renderer_client_qt.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// based on chrome/renderer/extensions/chrome_extensions_renderer_client.cc:
// Copyright (c) 2014 The Chromium Authors. All rights reserved.
@@ -45,12 +9,14 @@
#include "extensions_renderer_client_qt.h"
#include "extensions_dispatcher_delegate_qt.h"
-#include "renderer/render_thread_observer_qt.h"
+#include "renderer/render_configuration.h"
#include "renderer_permissions_policy_delegate_qt.h"
#include "resource_request_policy_qt.h"
#include "base/command_line.h"
#include "base/lazy_instance.h"
+#include "base/stl_util.h"
+#include "base/types/optional_util.h"
#include "content/public/common/content_constants.h"
#include "content/public/common/content_switches.h"
#include "content/public/renderer/render_frame.h"
@@ -61,10 +27,8 @@
#include "extensions/common/switches.h"
#include "extensions/renderer/dispatcher.h"
#include "extensions/renderer/extension_frame_helper.h"
+#include "extensions/renderer/extension_web_view_helper.h"
#include "extensions/renderer/extensions_render_frame_observer.h"
-#include "extensions/renderer/guest_view/extensions_guest_view_container.h"
-#include "extensions/renderer/guest_view/extensions_guest_view_container_dispatcher.h"
-#include "extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container.h"
#include "extensions/renderer/renderer_extension_registry.h"
#include "extensions/renderer/script_context.h"
#include "third_party/blink/public/platform/web_url.h"
@@ -72,7 +36,6 @@
namespace chrome {
const char kExtensionInvalidRequestURL[] = "chrome-extension://invalid/";
-const char kExtensionResourceInvalidRequestURL[] = "chrome-extension-resource://invalid/";
}
namespace QtWebEngineCore {
@@ -88,7 +51,7 @@ ExtensionsRendererClientQt::~ExtensionsRendererClientQt()
// Returns true if the current render process was launched incognito.
bool ExtensionsRendererClientQt::IsIncognitoProcess() const
{
- return RenderThreadObserverQt::is_incognito_process();
+ return RenderConfiguration::is_incognito_process();
}
// Returns the lowest isolated world ID available to extensions.
@@ -127,9 +90,6 @@ bool ExtensionsRendererClientQt::ExtensionAPIEnabledForServiceWorkerScript(const
if (!script_url.SchemeIs(extensions::kExtensionScheme))
return false;
- if (!extensions::ExtensionsClient::Get()->ExtensionAPIEnabledInExtensionServiceWorkers())
- return false;
-
const extensions::Extension* extension =
extensions::RendererExtensionRegistry::Get()->GetExtensionOrAppByURL(script_url);
@@ -147,17 +107,18 @@ bool ExtensionsRendererClientQt::ExtensionAPIEnabledForServiceWorkerScript(const
void ExtensionsRendererClientQt::RenderThreadStarted()
{
content::RenderThread *thread = content::RenderThread::Get();
- // ChromeRenderViewTest::SetUp() creates its own ExtensionDispatcher and
- // injects it using SetExtensionDispatcher(). Don't overwrite it.
if (!extension_dispatcher_)
extension_dispatcher_.reset(new extensions::Dispatcher(std::make_unique<ExtensionsDispatcherDelegateQt>()));
extension_dispatcher_->OnRenderThreadStarted(thread);
permissions_policy_delegate_.reset(new RendererPermissionsPolicyDelegateQt(extension_dispatcher_.get()));
resource_request_policy_.reset(new extensions::ResourceRequestPolicyQt(extension_dispatcher_.get()));
- guest_view_container_dispatcher_.reset(new extensions::ExtensionsGuestViewContainerDispatcher());
thread->AddObserver(extension_dispatcher_.get());
- thread->AddObserver(guest_view_container_dispatcher_.get());
+}
+
+void ExtensionsRendererClientQt::WebViewCreated(blink::WebView *web_view, const url::Origin *outermost_origin)
+{
+ new extensions::ExtensionWebViewHelper(web_view, outermost_origin);
}
void ExtensionsRendererClientQt::RenderFrameCreated(content::RenderFrame *render_frame,
@@ -181,12 +142,14 @@ bool ExtensionsRendererClientQt::OverrideCreatePlugin(content::RenderFrame *rend
void ExtensionsRendererClientQt::WillSendRequest(blink::WebLocalFrame *frame,
ui::PageTransition transition_type,
const blink::WebURL &url,
+ const net::SiteForCookies &site_for_cookies,
const url::Origin *initiator_origin,
- GURL *new_url,
- bool *attach_same_site_cookies)
+ GURL *new_url)
{
if (url.ProtocolIs(extensions::kExtensionScheme) &&
- !resource_request_policy_->CanRequestResource(url, frame, transition_type)) {
+ !resource_request_policy_->CanRequestResource(url, frame,
+ transition_type,
+ base::OptionalFromPtr(initiator_origin))) {
*new_url = GURL(chrome::kExtensionInvalidRequestURL);
}
}
@@ -200,16 +163,6 @@ bool ExtensionsRendererClientQt::ShouldFork(blink::WebLocalFrame *frame,
return false; // TODO: Fix this to a sensible value
}
-content::BrowserPluginDelegate *ExtensionsRendererClientQt::CreateBrowserPluginDelegate(content::RenderFrame *render_frame,
- const content::WebPluginInfo &info,
- const std::string &mime_type,
- const GURL &original_url)
-{
- if (mime_type == content::kBrowserPluginMimeType)
- return new extensions::ExtensionsGuestViewContainer(render_frame);
- return new extensions::MimeHandlerViewContainer(render_frame, info, mime_type, original_url);
-}
-
void ExtensionsRendererClientQt::RunScriptsAtDocumentStart(content::RenderFrame *render_frame)
{
extension_dispatcher_->RunScriptsAtDocumentStart(render_frame);
diff --git a/src/core/renderer/extensions/extensions_renderer_client_qt.h b/src/core/renderer/extensions/extensions_renderer_client_qt.h
index 87e324213..163819cbc 100644
--- a/src/core/renderer/extensions/extensions_renderer_client_qt.h
+++ b/src/core/renderer/extensions/extensions_renderer_client_qt.h
@@ -1,49 +1,11 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef EXTENSIONSRENDERERCLIENTQT_H
#define EXTENSIONSRENDERERCLIENTQT_H
#include <memory>
-#include <string>
-#include "base/macros.h"
#include "extensions/renderer/extensions_renderer_client.h"
#include "services/service_manager/public/cpp/binder_registry.h"
#include "ui/base/page_transition_types.h"
@@ -54,13 +16,15 @@ namespace blink {
class WebLocalFrame;
struct WebPluginParams;
class WebURL;
+class WebView;
}
namespace content {
-class BrowserPluginDelegate;
class RenderFrame;
-class RenderView;
-struct WebPluginInfo;
+}
+
+namespace net {
+class SiteForCookies;
}
namespace url {
@@ -69,7 +33,6 @@ class Origin;
namespace extensions {
class Dispatcher;
-class ExtensionsGuestViewContainerDispatcher;
class ResourceRequestPolicyQt;
}
@@ -93,25 +56,23 @@ public:
// Match ContentRendererClientQt's method names...
void RenderThreadStarted();
+ void WebViewCreated(blink::WebView *web_view,
+ const url::Origin *outermost_origin);
void RenderFrameCreated(content::RenderFrame *, service_manager::BinderRegistry *);
bool OverrideCreatePlugin(content::RenderFrame *render_frame,
const blink::WebPluginParams &params);
void WillSendRequest(blink::WebLocalFrame *frame,
ui::PageTransition transition_type,
const blink::WebURL &url,
+ const net::SiteForCookies &site_for_cookies,
const url::Origin *initiator_origin,
- GURL *new_url,
- bool *attach_same_site_cookies);
+ GURL *new_url);
static bool ShouldFork(blink::WebLocalFrame *frame,
const GURL &url,
bool is_initial_navigation,
bool is_server_redirect,
bool *send_referrer);
- static content::BrowserPluginDelegate *CreateBrowserPluginDelegate(content::RenderFrame *render_frame,
- const content::WebPluginInfo &info,
- const std::string &mime_type,
- const GURL &original_url);
bool ExtensionAPIEnabledForServiceWorkerScript(const GURL &scope, const GURL &script_url) const override;
@@ -128,7 +89,6 @@ private:
std::unique_ptr<ExtensionsDispatcherDelegateQt> extension_dispatcher_delegate_;
std::unique_ptr<RendererPermissionsPolicyDelegateQt> permissions_policy_delegate_;
std::unique_ptr<extensions::Dispatcher> extension_dispatcher_;
- std::unique_ptr<extensions::ExtensionsGuestViewContainerDispatcher> guest_view_container_dispatcher_;
std::unique_ptr<extensions::ResourceRequestPolicyQt> resource_request_policy_;
};
diff --git a/src/core/renderer/extensions/renderer_permissions_policy_delegate_qt.cpp b/src/core/renderer/extensions/renderer_permissions_policy_delegate_qt.cpp
index aef4903b7..fdfbe463b 100644
--- a/src/core/renderer/extensions/renderer_permissions_policy_delegate_qt.cpp
+++ b/src/core/renderer/extensions/renderer_permissions_policy_delegate_qt.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "renderer_permissions_policy_delegate_qt.h"
diff --git a/src/core/renderer/extensions/renderer_permissions_policy_delegate_qt.h b/src/core/renderer/extensions/renderer_permissions_policy_delegate_qt.h
index 385b7a4b0..23bfa8c88 100644
--- a/src/core/renderer/extensions/renderer_permissions_policy_delegate_qt.h
+++ b/src/core/renderer/extensions/renderer_permissions_policy_delegate_qt.h
@@ -1,46 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef RENDERERPERMISSIONSPOLICYDELEGATEQT_H
#define RENDERERPERMISSIONSPOLICYDELEGATEQT_H
-#include "base/macros.h"
#include "extensions/common/permissions/permissions_data.h"
namespace extensions {
@@ -56,9 +19,6 @@ public:
~RendererPermissionsPolicyDelegateQt() override;
bool IsRestrictedUrl(const GURL &, std::string *) override;
-
-private:
- DISALLOW_COPY_AND_ASSIGN(RendererPermissionsPolicyDelegateQt);
};
} // namespace QtWebEngineCore
diff --git a/src/core/renderer/extensions/resource_request_policy_qt.cpp b/src/core/renderer/extensions/resource_request_policy_qt.cpp
index efe44521d..a61e53310 100644
--- a/src/core/renderer/extensions/resource_request_policy_qt.cpp
+++ b/src/core/renderer/extensions/resource_request_policy_qt.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// based on chrome/renderer/extensions/resource_request_policy.cc:
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
@@ -63,8 +27,9 @@ ResourceRequestPolicyQt::ResourceRequestPolicyQt(Dispatcher *dispatcher)
void ResourceRequestPolicyQt::OnExtensionLoaded(const Extension &extension)
{
- if (WebAccessibleResourcesInfo::HasWebAccessibleResources(&extension)
- || WebviewInfo::HasWebviewAccessibleResources(extension, m_dispatcher->webview_partition_id())
+ if (WebAccessibleResourcesInfo::HasWebAccessibleResources(&extension) ||
+ WebviewInfo::HasWebviewAccessibleResources(extension,
+ m_dispatcher->webview_partition_id().value_or(std::string()))
// // Hosted app icons are accessible.
// // TODO(devlin): Should we incorporate this into
// // WebAccessibleResourcesInfo?
@@ -85,7 +50,8 @@ void ResourceRequestPolicyQt::OnExtensionUnloaded(const ExtensionId &extension_i
// than those triggered through UI.
bool ResourceRequestPolicyQt::CanRequestResource(const GURL &resource_url,
blink::WebLocalFrame *frame,
- ui::PageTransition transition_type)
+ ui::PageTransition transition_type,
+ const absl::optional<url::Origin>& initiator_origin)
{
CHECK(resource_url.SchemeIs(kExtensionScheme));
@@ -96,7 +62,7 @@ bool ResourceRequestPolicyQt::CanRequestResource(const GURL &resource_url,
// current extension or has a devtools scheme.
GURL page_origin = url::Origin(frame->Top()->GetSecurityOrigin()).GetURL();
- GURL extension_origin = resource_url.GetOrigin();
+ GURL extension_origin = resource_url.DeprecatedGetOriginAsURL();
// We always allow loads in the following cases, regardless of web accessible
// resources:
@@ -112,7 +78,7 @@ bool ResourceRequestPolicyQt::CanRequestResource(const GURL &resource_url,
// of the frame, to account for about:blank subframes being scripted by an
// extension parent (though we'll still need the frame origin check for
// sandboxed frames).
- if (frame_url.GetOrigin() == extension_origin || page_origin == extension_origin)
+ if (frame_url.DeprecatedGetOriginAsURL() == extension_origin || page_origin == extension_origin)
return true;
if (!ui::PageTransitionIsWebTriggerable(transition_type))
@@ -165,8 +131,10 @@ bool ResourceRequestPolicyQt::CanRequestResource(const GURL &resource_url,
// Disallow loading of extension resources which are not explicitly listed
// as web or WebView accessible if the manifest version is 2 or greater.
- if (!WebAccessibleResourcesInfo::IsResourceWebAccessible(extension, resource_url.path()) &&
- !WebviewInfo::IsResourceWebviewAccessible(extension, m_dispatcher->webview_partition_id(), resource_url.path()))
+ if (!WebAccessibleResourcesInfo::IsResourceWebAccessible(extension, resource_url.path(), initiator_origin) &&
+ !WebviewInfo::IsResourceWebviewAccessible(extension,
+ m_dispatcher->webview_partition_id().value_or(std::string()),
+ resource_url.path()))
{
std::string message = base::StringPrintf(
"Denying load of %s. Resources must be listed in the "
diff --git a/src/core/renderer/extensions/resource_request_policy_qt.h b/src/core/renderer/extensions/resource_request_policy_qt.h
index e6d4e79bb..ec108519f 100644
--- a/src/core/renderer/extensions/resource_request_policy_qt.h
+++ b/src/core/renderer/extensions/resource_request_policy_qt.h
@@ -1,50 +1,15 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef RESOURCEREQUESTPOLICYQT_H
#define RESOURCEREQUESTPOLICYQT_H
#include <set>
-#include "base/macros.h"
#include "extensions/common/extension_id.h"
+#include "third_party/abseil-cpp/absl/types/optional.h"
#include "ui/base/page_transition_types.h"
+#include "url/origin.h"
class GURL;
@@ -73,7 +38,8 @@ public:
// than those triggered through UI.
bool CanRequestResource(const GURL &resource_url,
blink::WebLocalFrame *frame,
- ui::PageTransition transition_type);
+ ui::PageTransition transition_type,
+ const absl::optional<url::Origin> &initiator_origin);
private:
Dispatcher *m_dispatcher;
@@ -81,8 +47,6 @@ private:
// The set of extension IDs with any potentially web- or webview-accessible
// resources.
std::set<ExtensionId> m_web_accessible_ids;
-
- DISALLOW_COPY_AND_ASSIGN(ResourceRequestPolicyQt);
};
} // namespace extensions
diff --git a/src/core/renderer/pepper/pepper_flash_renderer_host_qt.cpp b/src/core/renderer/pepper/pepper_flash_renderer_host_qt.cpp
deleted file mode 100644
index 9af05fd08..000000000
--- a/src/core/renderer/pepper/pepper_flash_renderer_host_qt.cpp
+++ /dev/null
@@ -1,432 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-// This is based on chrome/renderer/pepper/pepper_flash_renderer_host.cc:
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE.Chromium file.
-
-#include "pepper_flash_renderer_host_qt.h"
-
-#include <map>
-#include <vector>
-
-#include "base/lazy_instance.h"
-#include "base/macros.h"
-#include "base/metrics/histogram_macros.h"
-#include "base/strings/string_util.h"
-#include "content/public/renderer/pepper_plugin_instance.h"
-#include "content/public/renderer/render_thread.h"
-#include "content/public/renderer/renderer_ppapi_host.h"
-#include "ipc/ipc_message_macros.h"
-#include "net/http/http_util.h"
-#include "ppapi/c/pp_errors.h"
-#include "ppapi/c/trusted/ppb_browser_font_trusted.h"
-#include "ppapi/host/dispatch_host_message.h"
-#include "ppapi/proxy/host_dispatcher.h"
-#include "ppapi/proxy/ppapi_messages.h"
-#include "ppapi/proxy/resource_message_params.h"
-#include "ppapi/proxy/serialized_structs.h"
-#include "ppapi/thunk/enter.h"
-#include "ppapi/thunk/ppb_image_data_api.h"
-#include "skia/ext/platform_canvas.h"
-#include "third_party/skia/include/core/SkCanvas.h"
-#include "third_party/skia/include/core/SkMatrix.h"
-#include "third_party/skia/include/core/SkPaint.h"
-#include "third_party/skia/include/core/SkPoint.h"
-#include "third_party/skia/include/core/SkTextBlob.h"
-#include "third_party/skia/include/core/SkTypeface.h"
-#include "third_party/skia/include/private/SkTemplates.h"
-#include "ui/gfx/geometry/rect.h"
-#include "url/gurl.h"
-
-using ppapi::thunk::EnterResourceNoLock;
-using ppapi::thunk::PPB_ImageData_API;
-
-namespace {
-
-// Some non-simple HTTP request headers that Flash may set.
-// (Please see http://www.w3.org/TR/cors/#simple-header for the definition of
-// simple headers.)
-//
-// The list and the enum defined below are used to collect data about request
-// headers used in PPB_Flash.Navigate() calls, in order to understand the impact
-// of rejecting PPB_Flash.Navigate() requests with non-simple headers.
-//
-// TODO(yzshen): We should be able to remove the histogram recording code once
-// we get the answer.
-const char* const kRejectedHttpRequestHeaders[] = {
- "authorization", //
- "cache-control", //
- "content-encoding", //
- "content-md5", //
- "content-type", // If the media type is not one of those covered by the
- // simple header definition.
- "expires", //
- "from", //
- "if-match", //
- "if-none-match", //
- "if-range", //
- "if-unmodified-since", //
- "pragma", //
- "referer" //
-};
-
-// Please note that new entries should be added right above
-// FLASH_NAVIGATE_USAGE_ENUM_COUNT, and existing entries shouldn't be re-ordered
-// or removed, since this ordering is used in a histogram.
-enum FlashNavigateUsage {
- // This section must be in the same order as kRejectedHttpRequestHeaders.
- REJECT_AUTHORIZATION = 0,
- REJECT_CACHE_CONTROL,
- REJECT_CONTENT_ENCODING,
- REJECT_CONTENT_MD5,
- REJECT_CONTENT_TYPE,
- REJECT_EXPIRES,
- REJECT_FROM,
- REJECT_IF_MATCH,
- REJECT_IF_NONE_MATCH,
- REJECT_IF_RANGE,
- REJECT_IF_UNMODIFIED_SINCE,
- REJECT_PRAGMA,
- REJECT_REFERER,
-
- // The navigate request is rejected because of headers not listed above
- // (e.g., custom headers).
- REJECT_OTHER_HEADERS,
-
- // Total number of rejected navigate requests.
- TOTAL_REJECTED_NAVIGATE_REQUESTS,
-
- // Total number of navigate requests.
- TOTAL_NAVIGATE_REQUESTS,
- FLASH_NAVIGATE_USAGE_ENUM_COUNT
-};
-
-static base::LazyInstance<std::map<std::string, FlashNavigateUsage>>::
- DestructorAtExit g_rejected_headers = LAZY_INSTANCE_INITIALIZER;
-
-bool IsSimpleHeader(const std::string& lower_case_header_name,
- const std::string& header_value)
-{
- if (lower_case_header_name == "accept" ||
- lower_case_header_name == "accept-language" ||
- lower_case_header_name == "content-language")
- return true;
-
- if (lower_case_header_name == "content-type") {
- std::string lower_case_mime_type;
- std::string lower_case_charset;
- bool had_charset = false;
- net::HttpUtil::ParseContentType(header_value,
- &lower_case_mime_type,
- &lower_case_charset,
- &had_charset,
- NULL);
- return lower_case_mime_type == "application/x-www-form-urlencoded" ||
- lower_case_mime_type == "multipart/form-data" ||
- lower_case_mime_type == "text/plain";
- }
-
- return false;
-}
-
-void RecordFlashNavigateUsage(FlashNavigateUsage usage)
-{
- DCHECK_NE(FLASH_NAVIGATE_USAGE_ENUM_COUNT, usage);
- UMA_HISTOGRAM_ENUMERATION(
- "Plugin.FlashNavigateUsage",
- usage,
- FLASH_NAVIGATE_USAGE_ENUM_COUNT);
-}
-
-} // namespace
-
-namespace QtWebEngineCore {
-
-PepperFlashRendererHostQt::PepperFlashRendererHostQt(
- content::RendererPpapiHost* host,
- PP_Instance instance,
- PP_Resource resource)
- : ResourceHost(host->GetPpapiHost(), instance, resource),
- host_(host),
- weak_factory_(this)
-{
-}
-
-PepperFlashRendererHostQt::~PepperFlashRendererHostQt() {
- // This object may be destroyed in the middle of a sync message. If that is
- // the case, make sure we respond to all the pending navigate calls.
- std::vector<ppapi::host::ReplyMessageContext>::reverse_iterator it;
- for (it = navigate_replies_.rbegin(); it != navigate_replies_.rend(); ++it)
- SendReply(*it, IPC::Message());
-}
-
-int32_t PepperFlashRendererHostQt::OnResourceMessageReceived(
- const IPC::Message& msg,
- ppapi::host::HostMessageContext* context)
-{
- PPAPI_BEGIN_MESSAGE_MAP(PepperFlashRendererHostQt, msg)
- PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_Flash_GetProxyForURL,
- OnGetProxyForURL)
- PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_Flash_SetInstanceAlwaysOnTop,
- OnSetInstanceAlwaysOnTop)
- PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_Flash_DrawGlyphs,
- OnDrawGlyphs)
- PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_Flash_Navigate, OnNavigate)
- PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_Flash_IsRectTopmost,
- OnIsRectTopmost)
- PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(PpapiHostMsg_Flash_InvokePrinting,
- OnInvokePrinting)
- PPAPI_END_MESSAGE_MAP()
- return PP_ERROR_FAILED;
-}
-
-int32_t PepperFlashRendererHostQt::OnGetProxyForURL(
- ppapi::host::HostMessageContext* host_context,
- const std::string& url)
-{
- GURL gurl(url);
- if (!gurl.is_valid())
- return PP_ERROR_FAILED;
- std::string proxy;
- bool result = content::RenderThread::Get()->ResolveProxy(gurl, &proxy);
- if (!result)
- return PP_ERROR_FAILED;
- host_context->reply_msg = PpapiPluginMsg_Flash_GetProxyForURLReply(proxy);
- return PP_OK;
-}
-
-int32_t PepperFlashRendererHostQt::OnSetInstanceAlwaysOnTop(
- ppapi::host::HostMessageContext* host_context,
- bool on_top)
-{
- content::PepperPluginInstance* plugin_instance =
- host_->GetPluginInstance(pp_instance());
- if (plugin_instance)
- plugin_instance->SetAlwaysOnTop(on_top);
- return PP_OK;
-}
-
-int32_t PepperFlashRendererHostQt::OnDrawGlyphs(
- ppapi::host::HostMessageContext* host_context,
- ppapi::proxy::PPBFlash_DrawGlyphs_Params params)
-{
- if (params.glyph_indices.size() != params.glyph_advances.size() ||
- params.glyph_indices.empty())
- return PP_ERROR_FAILED;
-
- int weight = (params.font_desc.weight + 1) * 100;
- SkFontStyle::Slant slant = SkFontStyle::kUpright_Slant;
- if (params.font_desc.italic)
- slant = SkFontStyle::kItalic_Slant;
- SkFontStyle style(weight, SkFontStyle::kNormal_Width, slant);
- sk_sp<SkTypeface> typeface(
- SkTypeface::MakeFromName(params.font_desc.face.c_str(), style));
- if (!typeface)
- return PP_ERROR_FAILED;
-
- EnterResourceNoLock<PPB_ImageData_API> enter(params.image_data.host_resource(), true);
- if (enter.failed())
- return PP_ERROR_FAILED;
-
- PPB_ImageData_API* image = static_cast<PPB_ImageData_API*>(enter.object());
- SkCanvas* canvas = image->GetCanvas();
- bool needs_unmapping = false;
- if (!canvas) {
- needs_unmapping = true;
- image->Map();
- canvas = image->GetCanvas();
- if (!canvas)
- return PP_ERROR_FAILED; // Failure mapping.
- }
-
- SkAutoCanvasRestore acr(canvas, true);
-
- // Clip is applied in pixels before the transform.
- SkRect clip_rect = {
- SkIntToScalar(params.clip.point.x), SkIntToScalar(params.clip.point.y),
- SkIntToScalar(params.clip.point.x + params.clip.size.width),
- SkIntToScalar(params.clip.point.y + params.clip.size.height)};
- canvas->clipRect(clip_rect);
-
- SkMatrix matrix;
- matrix.set(SkMatrix::kMScaleX, SkFloatToScalar(params.transformation[0][0]));
- matrix.set(SkMatrix::kMSkewX, SkFloatToScalar(params.transformation[0][1]));
- matrix.set(SkMatrix::kMTransX, SkFloatToScalar(params.transformation[0][2]));
- matrix.set(SkMatrix::kMSkewY, SkFloatToScalar(params.transformation[1][0]));
- matrix.set(SkMatrix::kMScaleY, SkFloatToScalar(params.transformation[1][1]));
- matrix.set(SkMatrix::kMTransY, SkFloatToScalar(params.transformation[1][2]));
- matrix.set(SkMatrix::kMPersp0, SkFloatToScalar(params.transformation[2][0]));
- matrix.set(SkMatrix::kMPersp1, SkFloatToScalar(params.transformation[2][1]));
- matrix.set(SkMatrix::kMPersp2, SkFloatToScalar(params.transformation[2][2]));
- canvas->concat(matrix);
-
- SkPaint paint;
- paint.setColor(params.color);
-
- SkFont font(std::move(typeface), SkIntToScalar(params.font_desc.size));
- font.setHinting(SkFontHinting::kFull);
- if (params.allow_subpixel_aa) {
- font.setSubpixel(true);
- font.setEdging(SkFont::Edging::kSubpixelAntiAlias);
- }
-
- SkScalar x = SkIntToScalar(params.position.x);
- SkScalar y = SkIntToScalar(params.position.y);
-
- // Build up the skia advances.
- size_t glyph_count = params.glyph_indices.size();
- if (glyph_count) {
- SkTextBlobBuilder builder;
- auto rec = builder.allocRunPos(font, glyph_count);
- memcpy(rec.glyphs, &params.glyph_indices[0], glyph_count * 2);
- SkPoint* pos = reinterpret_cast<SkPoint*>(rec.pos);
- for (uint32_t i = 0; i < glyph_count; i++) {
- pos[i].set(x, y);
- x += SkFloatToScalar(params.glyph_advances[i].x);
- y += SkFloatToScalar(params.glyph_advances[i].y);
- }
- canvas->drawTextBlob(builder.make(), 0, 0, paint);
- }
-
- if (needs_unmapping)
- image->Unmap();
-
- return PP_OK;
-}
-
-// CAUTION: This code is subtle because Navigate is a sync call which may
-// cause re-entrancy or cause the instance to be destroyed. If the instance
-// is destroyed we need to ensure that we respond to all outstanding sync
-// messages so that the plugin process does not remain blocked.
-int32_t PepperFlashRendererHostQt::OnNavigate(
- ppapi::host::HostMessageContext* host_context,
- const ppapi::URLRequestInfoData& data,
- const std::string& target,
- bool from_user_action)
-{
- // If our PepperPluginInstance is already destroyed, just return a failure.
- content::PepperPluginInstance* plugin_instance =
- host_->GetPluginInstance(pp_instance());
- if (!plugin_instance)
- return PP_ERROR_FAILED;
-
- std::map<std::string, FlashNavigateUsage>& rejected_headers =
- g_rejected_headers.Get();
- if (rejected_headers.empty()) {
- for (size_t i = 0; i < base::size(kRejectedHttpRequestHeaders); ++i)
- rejected_headers[kRejectedHttpRequestHeaders[i]] =
- static_cast<FlashNavigateUsage>(i);
- }
-
- net::HttpUtil::HeadersIterator header_iter(
- data.headers.begin(), data.headers.end(), "\n\r");
- bool rejected = false;
- while (header_iter.GetNext()) {
- std::string lower_case_header_name =
- base::ToLowerASCII(header_iter.name());
- if (!IsSimpleHeader(lower_case_header_name, header_iter.values())) {
- rejected = true;
-
- std::map<std::string, FlashNavigateUsage>::const_iterator iter =
- rejected_headers.find(lower_case_header_name);
- FlashNavigateUsage usage =
- iter != rejected_headers.end() ? iter->second : REJECT_OTHER_HEADERS;
- RecordFlashNavigateUsage(usage);
- }
- }
-
- RecordFlashNavigateUsage(TOTAL_NAVIGATE_REQUESTS);
- if (rejected) {
- RecordFlashNavigateUsage(TOTAL_REJECTED_NAVIGATE_REQUESTS);
- return PP_ERROR_NOACCESS;
- }
-
- // Navigate may call into Javascript (e.g. with a "javascript:" URL),
- // or do things like navigate away from the page, either one of which will
- // need to re-enter into the plugin. It is safe, because it is essentially
- // equivalent to NPN_GetURL, where Flash would expect re-entrancy.
- ppapi::proxy::HostDispatcher* host_dispatcher =
- ppapi::proxy::HostDispatcher::GetForInstance(pp_instance());
- host_dispatcher->set_allow_plugin_reentrancy();
-
- // Grab a weak pointer to ourselves on the stack so we can check if we are
- // still alive.
- base::WeakPtr<PepperFlashRendererHostQt> weak_ptr = weak_factory_.GetWeakPtr();
- // Keep track of reply contexts in case we are destroyed during a Navigate
- // call. Even if we are destroyed, we still need to send these replies to
- // unblock the plugin process.
- navigate_replies_.push_back(host_context->MakeReplyMessageContext());
- plugin_instance->Navigate(data, target.c_str(), from_user_action);
- // This object might have been destroyed by this point. If it is destroyed
- // the reply will be sent in the destructor. Otherwise send the reply here.
- if (weak_ptr.get()) {
- SendReply(navigate_replies_.back(), IPC::Message());
- navigate_replies_.pop_back();
- }
-
- // Return PP_OK_COMPLETIONPENDING so that no reply is automatically sent.
- return PP_OK_COMPLETIONPENDING;
-}
-
-int32_t PepperFlashRendererHostQt::OnIsRectTopmost(
- ppapi::host::HostMessageContext* host_context,
- const PP_Rect& rect)
-{
- content::PepperPluginInstance* plugin_instance =
- host_->GetPluginInstance(pp_instance());
- if (plugin_instance &&
- plugin_instance->IsRectTopmost(
- gfx::Rect(
- rect.point.x,
- rect.point.y,
- rect.size.width,
- rect.size.height)))
- return PP_OK;
- return PP_ERROR_FAILED;
-}
-
-int32_t PepperFlashRendererHostQt::OnInvokePrinting(
- ppapi::host::HostMessageContext* host_context)
-{
- return PP_ERROR_FAILED;
-}
-
-} //QtWebEngineCore
diff --git a/src/core/renderer/pepper/pepper_flash_renderer_host_qt.h b/src/core/renderer/pepper/pepper_flash_renderer_host_qt.h
deleted file mode 100644
index ae6bc0876..000000000
--- a/src/core/renderer/pepper/pepper_flash_renderer_host_qt.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef PEPPER_FLASH_RENDERER_HOST_QT_H
-#define PEPPER_FLASH_RENDERER_HOST_QT_H
-
-#include <string>
-#include <vector>
-
-#include "base/memory/weak_ptr.h"
-#include "ppapi/host/host_message_context.h"
-#include "ppapi/host/resource_host.h"
-
-struct PP_Rect;
-
-namespace ppapi {
-struct URLRequestInfoData;
-}
-
-namespace ppapi {
-namespace proxy {
-struct PPBFlash_DrawGlyphs_Params;
-}
-}
-
-namespace content {
-class RendererPpapiHost;
-}
-
-namespace QtWebEngineCore {
-
-class PepperFlashRendererHostQt : public ppapi::host::ResourceHost {
-public:
- PepperFlashRendererHostQt(content::RendererPpapiHost* host,
- PP_Instance instance,
- PP_Resource resource);
- ~PepperFlashRendererHostQt() override;
-
- // ppapi::host::ResourceHost override.
- int32_t OnResourceMessageReceived(
- const IPC::Message& msg,
- ppapi::host::HostMessageContext* context) override;
-
-private:
- int32_t OnGetProxyForURL(ppapi::host::HostMessageContext* host_context,
- const std::string& url);
- int32_t OnSetInstanceAlwaysOnTop(
- ppapi::host::HostMessageContext* host_context,
- bool on_top);
- int32_t OnDrawGlyphs(ppapi::host::HostMessageContext* host_context,
- ppapi::proxy::PPBFlash_DrawGlyphs_Params params);
- int32_t OnNavigate(ppapi::host::HostMessageContext* host_context,
- const ppapi::URLRequestInfoData& data,
- const std::string& target,
- bool from_user_action);
- int32_t OnIsRectTopmost(ppapi::host::HostMessageContext* host_context,
- const PP_Rect& rect);
- int32_t OnInvokePrinting(ppapi::host::HostMessageContext* host_context);
-
- // A stack of ReplyMessageContexts to track Navigate() calls which have not
- // yet been replied to.
- std::vector<ppapi::host::ReplyMessageContext> navigate_replies_;
-
- content::RendererPpapiHost* host_;
- base::WeakPtrFactory<PepperFlashRendererHostQt> weak_factory_;
-
- DISALLOW_COPY_AND_ASSIGN(PepperFlashRendererHostQt);
-};
-
-} //QtWebEngineCore
-#endif // PEPPER_FLASH_RENDERER_HOST_QT_H
diff --git a/src/core/renderer/pepper/pepper_renderer_host_factory_qt.cpp b/src/core/renderer/pepper/pepper_renderer_host_factory_qt.cpp
index 33c744f13..d0daea8c2 100644
--- a/src/core/renderer/pepper/pepper_renderer_host_factory_qt.cpp
+++ b/src/core/renderer/pepper/pepper_renderer_host_factory_qt.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// This is based on chrome/renderer/pepper/chrome_renderer_pepper_host_factory.cc:
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
@@ -43,20 +7,12 @@
// found in the LICENSE.Chromium file.
#include "pepper_renderer_host_factory_qt.h"
-#include "pepper_flash_renderer_host_qt.h"
#include "qtwebenginecoreglobal_p.h"
-#include "base/memory/ptr_util.h"
-#include "chrome/renderer/pepper/pepper_flash_font_file_host.h"
-#if QT_CONFIG(webengine_printing_and_pdf)
-#include "components/pdf/renderer/pepper_pdf_host.h"
-#endif // QT_CONFIG(webengine_printing_and_pdf)
#include "content/public/renderer/renderer_ppapi_host.h"
#include "ppapi/host/ppapi_host.h"
#include "ppapi/host/resource_host.h"
#include "ppapi/proxy/ppapi_messages.h"
-#include "ppapi/proxy/ppapi_message_utils.h"
-#include "ppapi/shared_impl/ppapi_permissions.h"
namespace QtWebEngineCore {
@@ -81,52 +37,13 @@ std::unique_ptr<ppapi::host::ResourceHost> PepperRendererHostFactoryQt::CreateRe
if (!host_->IsValidInstance(instance))
return nullptr;
- if (host_->GetPpapiHost()->permissions().HasPermission(ppapi::PERMISSION_FLASH)) {
- switch (message.type()) {
- case PpapiHostMsg_Flash_Create::ID:
- return base::WrapUnique(new PepperFlashRendererHostQt(host_, instance, resource));
- case PpapiHostMsg_FlashMenu_Create::ID: {
- ppapi::host::ReplyMessageContext reply_context(
- ppapi::proxy::ResourceMessageReplyParams(resource, 0),
- NULL,
- MSG_ROUTING_NONE);
- reply_context.params.set_result(PP_ERROR_USERCANCEL);
- host_->GetPpapiHost()->SendReply(reply_context, PpapiPluginMsg_FlashMenu_ShowReply(-1));
- break;
- }
- case PpapiHostMsg_FlashFullscreen_Create::ID:
- // Not implemented
- break;
- }
+ // Create a default ResourceHost for this message type to suppress
+ // "Failed to create PPAPI resource host" console error message.
+ switch (message.type()) {
+ case PpapiHostMsg_UMA_Create::ID:
+ return std::make_unique<ppapi::host::ResourceHost>(host_->GetPpapiHost(), instance, resource);
}
- // TODO(raymes): PDF also needs access to the FlashFontFileHost currently.
- // We should either rename PPB_FlashFont_File to PPB_FontFile_Private or get
- // rid of its use in PDF if possible.
- if (host_->GetPpapiHost()->permissions().HasPermission(ppapi::PERMISSION_FLASH)
- || host_->GetPpapiHost()->permissions().HasPermission(ppapi::PERMISSION_PDF)) {
- switch (message.type()) {
- case PpapiHostMsg_FlashFontFile_Create::ID: {
- ppapi::proxy::SerializedFontDescription description;
- PP_PrivateFontCharset charset;
- if (ppapi::UnpackMessage<PpapiHostMsg_FlashFontFile_Create>(message, &description, &charset))
- return base::WrapUnique(new PepperFlashFontFileHost(host_, instance, resource, description, charset));
- break;
- }
- case PpapiHostMsg_FlashDRM_Create::ID:
- // Not implemented
- break;
- }
- }
-
-#if QT_CONFIG(webengine_printing_and_pdf)
- if (host_->GetPpapiHost()->permissions().HasPermission(ppapi::PERMISSION_PDF)) {
- switch (message.type()) {
- case PpapiHostMsg_PDF_Create::ID:
- return std::make_unique<pdf::PepperPDFHost>(host_, instance, resource);
- }
- }
-#endif // QT_CONFIG(webengine_printing_and_pdf)
return nullptr;
}
diff --git a/src/core/renderer/pepper/pepper_renderer_host_factory_qt.h b/src/core/renderer/pepper/pepper_renderer_host_factory_qt.h
index ec3440a08..c31aa23d7 100644
--- a/src/core/renderer/pepper/pepper_renderer_host_factory_qt.h
+++ b/src/core/renderer/pepper/pepper_renderer_host_factory_qt.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef PEPPER_RENDERER_HOST_FACTORY_QT_H
#define PEPPER_RENDERER_HOST_FACTORY_QT_H
@@ -65,8 +29,6 @@ public:
private:
// Not owned by this object.
content::RendererPpapiHost* host_;
-
- DISALLOW_COPY_AND_ASSIGN(PepperRendererHostFactoryQt);
};
} // namespace QtWebEngineCore
diff --git a/src/core/renderer/plugins/loadable_plugin_placeholder_qt.cpp b/src/core/renderer/plugins/loadable_plugin_placeholder_qt.cpp
index b43d9a24b..06fd4f71f 100644
--- a/src/core/renderer/plugins/loadable_plugin_placeholder_qt.cpp
+++ b/src/core/renderer/plugins/loadable_plugin_placeholder_qt.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
@@ -61,15 +25,12 @@ gin::WrapperInfo LoadablePluginPlaceholderQt::kWrapperInfo = {gin::kEmbedderNati
LoadablePluginPlaceholderQt::LoadablePluginPlaceholderQt(content::RenderFrame* render_frame,
const blink::WebPluginParams& params,
const std::string& html_data,
- const base::string16& title)
+ const std::u16string& title)
: plugins::LoadablePluginPlaceholder(render_frame, params, html_data)
- , context_menu_request_id_(0)
{}
LoadablePluginPlaceholderQt::~LoadablePluginPlaceholderQt()
{
- if (context_menu_request_id_ && render_frame())
- render_frame()->CancelContextMenu(context_menu_request_id_);
}
// TODO(bauerb): Move this method to NonLoadablePluginPlaceholder?
@@ -77,13 +38,13 @@ LoadablePluginPlaceholderQt::~LoadablePluginPlaceholderQt()
LoadablePluginPlaceholderQt* LoadablePluginPlaceholderQt::CreateLoadableMissingPlugin(content::RenderFrame* render_frame,
const blink::WebPluginParams& params)
{
- const base::StringPiece template_html(ui::ResourceBundle::GetSharedInstance().GetRawDataResource(IDR_BLOCKED_PLUGIN_HTML));
+ std::string template_html(ui::ResourceBundle::GetSharedInstance().LoadDataResourceString(IDR_BLOCKED_PLUGIN_HTML));
- base::DictionaryValue values;
- values.SetString("name", "");
- values.SetString("message", l10n_util::GetStringUTF8(IDS_PLUGIN_NOT_SUPPORTED));
+ base::Value::Dict values;
+ values.Set("name", "");
+ values.Set("message", l10n_util::GetStringUTF8(IDS_PLUGIN_NOT_SUPPORTED));
- const std::string html_data = webui::GetI18nTemplateHtml(template_html, &values);
+ const std::string html_data = webui::GetI18nTemplateHtml(template_html, std::move(values));
// Will destroy itself when its WebViewPlugin is going away.
return new LoadablePluginPlaceholderQt(render_frame, params, html_data, params.mime_type.Utf16());
diff --git a/src/core/renderer/plugins/loadable_plugin_placeholder_qt.h b/src/core/renderer/plugins/loadable_plugin_placeholder_qt.h
index 7bcad2d96..9b9d1bca8 100644
--- a/src/core/renderer/plugins/loadable_plugin_placeholder_qt.h
+++ b/src/core/renderer/plugins/loadable_plugin_placeholder_qt.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
@@ -44,7 +8,6 @@
#ifndef LOADALBLE_PLUGIN_PLACEHOLDER_QT_H
#define LOADALBLE_PLUGIN_PLACEHOLDER_QT_H
-#include "base/macros.h"
#include "components/plugins/renderer/loadable_plugin_placeholder.h"
namespace QtWebEngineCore {
@@ -63,20 +26,14 @@ private:
LoadablePluginPlaceholderQt(content::RenderFrame* render_frame,
const blink::WebPluginParams& params,
const std::string& html_data,
- const base::string16& title);
+ const std::u16string& title);
~LoadablePluginPlaceholderQt() override;
// content::LoadablePluginPlaceholder overrides.
blink::WebPlugin* CreatePlugin() override;
- void OnBlockedContent(content::RenderFrame::PeripheralContentStatus status,
- bool is_same_origin) override {}
// WebViewPlugin::Delegate (via PluginPlaceholder) methods:
v8::Local<v8::Value> GetV8Handle(v8::Isolate* isolate) override;
-
- int context_menu_request_id_; // Nonzero when request pending.
-
- DISALLOW_COPY_AND_ASSIGN(LoadablePluginPlaceholderQt);
};
} // namespace QtWebEngineCore
diff --git a/src/core/renderer/plugins/plugin_placeholder_qt.cpp b/src/core/renderer/plugins/plugin_placeholder_qt.cpp
deleted file mode 100644
index a72c29873..000000000
--- a/src/core/renderer/plugins/plugin_placeholder_qt.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "plugin_placeholder_qt.h"
-
-#include "content/public/renderer/render_frame.h"
-#include "content/public/renderer/v8_value_converter.h"
-#include "gin/object_template_builder.h"
-
-namespace QtWebEngineCore {
-
-// static
-gin::WrapperInfo PluginPlaceholderQt::kWrapperInfo = {gin::kEmbedderNativeGin};
-
-PluginPlaceholderQt::PluginPlaceholderQt(content::RenderFrame* render_frame,
- const blink::WebPluginParams& params,
- const std::string& html_data)
- : PluginPlaceholderBase(render_frame, params, html_data)
-{}
-
-PluginPlaceholderQt::~PluginPlaceholderQt() {}
-
-v8::Local<v8::Value> PluginPlaceholderQt::GetV8Handle(v8::Isolate* isolate)
-{
- return gin::CreateHandle(isolate, this).ToV8();
-}
-
-gin::ObjectTemplateBuilder PluginPlaceholderQt::GetObjectTemplateBuilder(v8::Isolate* isolate)
-{
- return gin::Wrappable<PluginPlaceholderQt>::GetObjectTemplateBuilder(isolate)
- .SetMethod<void (QtWebEngineCore::PluginPlaceholderQt::*)()>(
- "hide", &PluginPlaceholderQt::HideCallback);
-}
-
-} // namespace QtWebEngineCore
diff --git a/src/core/renderer/plugins/plugin_placeholder_qt.h b/src/core/renderer/plugins/plugin_placeholder_qt.h
deleted file mode 100644
index a99c0d045..000000000
--- a/src/core/renderer/plugins/plugin_placeholder_qt.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef PLUGIN_PLACEHOLDER_QT_H
-#define PLUGIN_PLACEHOLDER_QT_H
-
-#include "base/macros.h"
-#include "components/plugins/renderer/plugin_placeholder.h"
-#include "gin/handle.h"
-#include "gin/wrappable.h"
-#include "third_party/blink/public/web/web_plugin_params.h"
-
-namespace QtWebEngineCore {
-
-// A basic placeholder that supports only hiding.
-class PluginPlaceholderQt final : public plugins::PluginPlaceholderBase
- , public gin::Wrappable<PluginPlaceholderQt>
-{
-public:
- static gin::WrapperInfo kWrapperInfo;
-
- PluginPlaceholderQt(content::RenderFrame* render_frame,
- const blink::WebPluginParams& params,
- const std::string& html_data);
- ~PluginPlaceholderQt() override;
-
-private:
- // WebViewPlugin::Delegate methods:
- v8::Local<v8::Value> GetV8Handle(v8::Isolate* isolate) final;
-
- // gin::Wrappable method:
- gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
- v8::Isolate* isolate) override;
-};
-
-} // namespace QtWebEngineCore
-
-#endif // PLUGIN_PLACEHOLDER_QT_H
diff --git a/src/core/renderer/print_web_view_helper_delegate_qt.cpp b/src/core/renderer/print_web_view_helper_delegate_qt.cpp
index b85ff7249..f01568e65 100644
--- a/src/core/renderer/print_web_view_helper_delegate_qt.cpp
+++ b/src/core/renderer/print_web_view_helper_delegate_qt.cpp
@@ -1,74 +1,40 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE.Chromium file.
-#include "content/public/renderer/render_frame.h"
-#include "content/public/renderer/render_view.h"
+#include "extensions/buildflags/buildflags.h"
#include "extensions/common/constants.h"
-#include "third_party/blink/public/web/web_document.h"
#include "third_party/blink/public/web/web_element.h"
#include "third_party/blink/public/web/web_local_frame.h"
+#include "url/origin.h"
+#if BUILDFLAG(ENABLE_EXTENSIONS)
+#include "chrome/common/webui_url_constants.h"
+#include "extensions/common/constants.h"
+#include "third_party/blink/public/web/web_document.h"
+#include "extensions/renderer/guest_view/mime_handler_view/post_message_support.h"
+#endif // BUILDFLAG(ENABLE_EXTENSIONS)
+
+#include "pdf_util_qt.h"
#include "print_web_view_helper_delegate_qt.h"
#include "web_engine_library_info.h"
namespace QtWebEngineCore {
-PrintWebViewHelperDelegateQt::~PrintWebViewHelperDelegateQt() {}
-bool PrintWebViewHelperDelegateQt::CancelPrerender(content::RenderFrame *)
-{
- return false;
-}
+PrintWebViewHelperDelegateQt::~PrintWebViewHelperDelegateQt() {}
blink::WebElement PrintWebViewHelperDelegateQt::GetPdfElement(blink::WebLocalFrame *frame)
{
- GURL url = frame->GetDocument().Url();
- if (url.SchemeIs(extensions::kExtensionScheme) && url.host() == extension_misc::kPdfExtensionId) {
- // <object> with id="plugin" is created in
- // chrome/browser/resources/pdf/pdf.js.
- auto plugin_element = frame->GetDocument().GetElementById("plugin");
- CHECK(!plugin_element.IsNull());
+#if BUILDFLAG(ENABLE_EXTENSIONS)
+ if (frame->Parent() && IsPdfInternalPluginAllowedOrigin(frame->Parent()->GetSecurityOrigin())) {
+ auto plugin_element = frame->GetDocument().QuerySelector("embed");
+ DCHECK(!plugin_element.IsNull());
return plugin_element;
}
+#endif // BUILDFLAG(ENABLE_EXTENSIONS)
return blink::WebElement();
}
@@ -82,7 +48,7 @@ bool PrintWebViewHelperDelegateQt::OverridePrint(blink::WebLocalFrame *frame)
return false;
}
-}
+} // namespace QtWebEngineCore
namespace printing {
// std::string PrintingContextDelegate::GetAppLocale()
diff --git a/src/core/renderer/print_web_view_helper_delegate_qt.h b/src/core/renderer/print_web_view_helper_delegate_qt.h
index f02580b91..5c7dd2431 100644
--- a/src/core/renderer/print_web_view_helper_delegate_qt.h
+++ b/src/core/renderer/print_web_view_helper_delegate_qt.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
@@ -46,8 +10,8 @@
#include "components/printing/renderer/print_render_frame_helper.h"
-namespace content {
-class RenderView;
+namespace blink {
+class WebLocalFrame;
}
namespace QtWebEngineCore {
@@ -57,14 +21,13 @@ class PrintWebViewHelperDelegateQt : public printing::PrintRenderFrameHelper::De
public:
~PrintWebViewHelperDelegateQt() override;
- bool CancelPrerender(content::RenderFrame *render_frame) override;
-
blink::WebElement GetPdfElement(blink::WebLocalFrame *frame) override;
bool IsPrintPreviewEnabled() override;
bool OverridePrint(blink::WebLocalFrame *frame) override;
-}; // class PrintWebViewHelperDelegateQt
-}
+};
+
+} // namespace QtWebEngineCore
#endif // PRINT_WEB_VIEW_HELPER_DELEGATE_QT_H
diff --git a/src/core/renderer/render_configuration.cpp b/src/core/renderer/render_configuration.cpp
new file mode 100644
index 000000000..7b35cdd48
--- /dev/null
+++ b/src/core/renderer/render_configuration.cpp
@@ -0,0 +1,41 @@
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+// based on chrome/renderer/chrome_render_thread_observer.cc:
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "renderer/render_configuration.h"
+#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h"
+
+namespace QtWebEngineCore {
+
+bool RenderConfiguration::m_isIncognitoProcess = false;
+
+void RenderConfiguration::RegisterMojoInterfaces(
+ blink::AssociatedInterfaceRegistry *associated_interfaces)
+{
+ associated_interfaces->AddInterface<qtwebengine::mojom::RendererConfiguration>(
+ base::BindRepeating(&RenderConfiguration::OnRendererConfigurationAssociatedRequest,
+ base::Unretained(this)));
+}
+
+void RenderConfiguration::UnregisterMojoInterfaces(
+ blink::AssociatedInterfaceRegistry *associated_interfaces)
+{
+ associated_interfaces->RemoveInterface(qtwebengine::mojom::RendererConfiguration::Name_);
+}
+
+void RenderConfiguration::SetInitialConfiguration(bool is_incognito_process)
+{
+ m_isIncognitoProcess = is_incognito_process;
+}
+
+void RenderConfiguration::OnRendererConfigurationAssociatedRequest(
+ mojo::PendingAssociatedReceiver<qtwebengine::mojom::RendererConfiguration> receiver)
+{
+ m_rendererConfigurationReceivers.Add(this, std::move(receiver));
+}
+
+} // namespace
diff --git a/src/core/renderer/render_configuration.h b/src/core/renderer/render_configuration.h
new file mode 100644
index 000000000..d9c867e02
--- /dev/null
+++ b/src/core/renderer/render_configuration.h
@@ -0,0 +1,42 @@
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef RENDER_CONFIGURATION_H
+#define RENDER_CONFIGURATION_H
+
+#include "content/public/renderer/render_thread_observer.h"
+#include "mojo/public/cpp/bindings/associated_receiver_set.h"
+#include "mojo/public/cpp/bindings/pending_associated_receiver.h"
+#include "qtwebengine/common/renderer_configuration.mojom.h"
+
+namespace QtWebEngineCore {
+
+class RenderConfiguration : public content::RenderThreadObserver,
+ public qtwebengine::mojom::RendererConfiguration
+{
+public:
+ RenderConfiguration() = default;
+ ~RenderConfiguration() override = default;
+
+ static bool is_incognito_process() { return m_isIncognitoProcess; }
+
+private:
+ // content::RenderThreadObserver:
+ void RegisterMojoInterfaces(blink::AssociatedInterfaceRegistry *associated_interfaces) override;
+ void UnregisterMojoInterfaces(blink::AssociatedInterfaceRegistry *associated_interfaces) override;
+
+ // qtwebengine::mojom::RendererConfiguration:
+ void SetInitialConfiguration(bool is_incognito_process) override;
+
+ void OnRendererConfigurationAssociatedRequest(
+ mojo::PendingAssociatedReceiver<qtwebengine::mojom::RendererConfiguration> receiver);
+
+ static bool m_isIncognitoProcess;
+
+ mojo::AssociatedReceiverSet<qtwebengine::mojom::RendererConfiguration>
+ m_rendererConfigurationReceivers;
+};
+
+} // namespace QtWebEngineCore
+
+#endif // RENDER_CONFIGURATION_H
diff --git a/src/core/renderer/render_frame_observer_qt.cpp b/src/core/renderer/render_frame_observer_qt.cpp
index cc01acec6..e6489eefb 100644
--- a/src/core/renderer/render_frame_observer_qt.cpp
+++ b/src/core/renderer/render_frame_observer_qt.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// This is based on chrome/renderer/pepper/pepper_helper.cc:
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
@@ -44,14 +8,18 @@
#include "render_frame_observer_qt.h"
-#include "base/memory/ptr_util.h"
-#include "chrome/renderer/pepper/pepper_shared_memory_message_filter.h"
#include "components/web_cache/renderer/web_cache_impl.h"
#include "content/public/renderer/render_frame.h"
+#include "third_party/blink/public/web/web_document_loader.h"
+
+#if QT_CONFIG(webengine_pepper_plugins)
+#include "base/memory/ptr_util.h"
+#include "chrome/renderer/pepper/pepper_shared_memory_message_filter.h"
#include "content/public/renderer/renderer_ppapi_host.h"
#include "ppapi/host/ppapi_host.h"
#include "renderer/pepper/pepper_renderer_host_factory_qt.h"
+#endif
namespace QtWebEngineCore {
@@ -77,7 +45,13 @@ void RenderFrameObserverQt::DidCreatePepperPlugin(content::RendererPpapiHost *ho
}
#endif
-void RenderFrameObserverQt::FrameDetached()
+bool RenderFrameObserverQt::OnAssociatedInterfaceRequestForFrame(const std::string &interface_name,
+ mojo::ScopedInterfaceEndpointHandle *handle)
+{
+ return m_associated_interfaces.TryBindInterface(interface_name, handle);
+}
+
+void RenderFrameObserverQt::WillDetach()
{
m_isFrameDetached = true;
}
diff --git a/src/core/renderer/render_frame_observer_qt.h b/src/core/renderer/render_frame_observer_qt.h
index 6bdf4ad23..8cab3bd9a 100644
--- a/src/core/renderer/render_frame_observer_qt.h
+++ b/src/core/renderer/render_frame_observer_qt.h
@@ -1,51 +1,14 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef RENDER_FRAME_OBSERVER_QT_H
#define RENDER_FRAME_OBSERVER_QT_H
#include "qtwebenginecoreglobal_p.h"
-#include "base/compiler_specific.h"
#include "content/public/renderer/render_frame_observer.h"
#include "content/public/renderer/render_frame_observer_tracker.h"
-#include "ppapi/buildflags/buildflags.h"
#include "services/service_manager/public/cpp/binder_registry.h"
+#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h"
namespace content {
class RenderFrame;
@@ -67,20 +30,25 @@ public:
#if QT_CONFIG(webengine_pepper_plugins)
void DidCreatePepperPlugin(content::RendererPpapiHost *host) override;
#endif
+ bool OnAssociatedInterfaceRequestForFrame(
+ const std::string &interface_name,
+ mojo::ScopedInterfaceEndpointHandle *handle) override;
void OnDestruct() override;
- void FrameDetached() override;
+ void WillDetach() override;
bool isFrameDetached() const;
service_manager::BinderRegistry *registry() { return &registry_; }
+ blink::AssociatedInterfaceRegistry *associatedInterfaces() {
+ return &m_associated_interfaces;
+ }
private:
- DISALLOW_COPY_AND_ASSIGN(RenderFrameObserverQt);
-
void ReadyToCommitNavigation(blink::WebDocumentLoader *) override;
bool m_isFrameDetached;
service_manager::BinderRegistry registry_;
+ blink::AssociatedInterfaceRegistry m_associated_interfaces;
web_cache::WebCacheImpl *m_web_cache_impl;
};
diff --git a/src/core/renderer/render_thread_observer_qt.cpp b/src/core/renderer/render_thread_observer_qt.cpp
deleted file mode 100644
index 4912ebfc2..000000000
--- a/src/core/renderer/render_thread_observer_qt.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-// based on chrome/renderer/chrome_render_thread_observer.cc:
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "renderer/render_thread_observer_qt.h"
-
-#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h"
-
-namespace QtWebEngineCore {
-
-bool RenderThreadObserverQt::m_isIncognitoProcess = false;
-
-void RenderThreadObserverQt::RegisterMojoInterfaces(blink::AssociatedInterfaceRegistry *associated_interfaces)
-{
- associated_interfaces->AddInterface(
- base::Bind(&RenderThreadObserverQt::OnRendererConfigurationAssociatedRequest, base::Unretained(this)));
-}
-
-void RenderThreadObserverQt::UnregisterMojoInterfaces(blink::AssociatedInterfaceRegistry *associated_interfaces)
-{
- associated_interfaces->RemoveInterface(qtwebengine::mojom::RendererConfiguration::Name_);
-}
-
-void RenderThreadObserverQt::SetInitialConfiguration(bool is_incognito_process)
-{
- m_isIncognitoProcess = is_incognito_process;
-}
-
-void RenderThreadObserverQt::OnRendererConfigurationAssociatedRequest(
- mojo::PendingAssociatedReceiver<qtwebengine::mojom::RendererConfiguration> receiver)
-{
- m_rendererConfigurationReceivers.Add(this, std::move(receiver));
-}
-
-} // namespace
diff --git a/src/core/renderer/render_thread_observer_qt.h b/src/core/renderer/render_thread_observer_qt.h
deleted file mode 100644
index 05372049b..000000000
--- a/src/core/renderer/render_thread_observer_qt.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef RENDER_THREAD_OBSERVER_QT_H
-#define RENDER_THREAD_OBSERVER_QT_H
-
-#include "content/public/renderer/render_thread_observer.h"
-#include "mojo/public/cpp/bindings/associated_receiver_set.h"
-#include "mojo/public/cpp/bindings/pending_associated_receiver.h"
-#include "qtwebengine/common/renderer_configuration.mojom.h"
-
-namespace QtWebEngineCore {
-
-class RenderThreadObserverQt
- : public content::RenderThreadObserver
- , public qtwebengine::mojom::RendererConfiguration
-{
-public:
- RenderThreadObserverQt() = default;
- ~RenderThreadObserverQt() override = default;
-
- static bool is_incognito_process() { return m_isIncognitoProcess; }
-
-private:
- // content::RenderThreadObserver:
- void RegisterMojoInterfaces(blink::AssociatedInterfaceRegistry *associated_interfaces) override;
- void UnregisterMojoInterfaces(blink::AssociatedInterfaceRegistry *associated_interfaces) override;
-
- // qtwebengine::mojom::RendererConfiguration:
- void SetInitialConfiguration(bool is_incognito_process) override;
-
- void OnRendererConfigurationAssociatedRequest(
- mojo::PendingAssociatedReceiver<qtwebengine::mojom::RendererConfiguration> receiver);
-
- static bool m_isIncognitoProcess;
-
- mojo::AssociatedReceiverSet<qtwebengine::mojom::RendererConfiguration> m_rendererConfigurationReceivers;
-
- DISALLOW_COPY_AND_ASSIGN(RenderThreadObserverQt);
-};
-
-} // namespace QtWebEngineCore
-
-#endif // RENDER_THREAD_OBSERVER_QT_H
diff --git a/src/core/renderer/render_view_observer_qt.cpp b/src/core/renderer/render_view_observer_qt.cpp
deleted file mode 100644
index 5b0b9a77d..000000000
--- a/src/core/renderer/render_view_observer_qt.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "renderer/render_view_observer_qt.h"
-
-#include "common/qt_messages.h"
-
-#include "content/public/renderer/render_view.h"
-#include "third_party/blink/public/web/web_document.h"
-#include "third_party/blink/public/web/web_element.h"
-#include "third_party/blink/public/web/web_frame.h"
-#include "third_party/blink/public/web/web_frame_content_dumper.h"
-#include "third_party/blink/public/web/web_frame_widget.h"
-#include "third_party/blink/public/web/web_local_frame.h"
-#include "third_party/blink/public/web/web_view.h"
-
-RenderViewObserverQt::RenderViewObserverQt(content::RenderView *render_view) : content::RenderViewObserver(render_view)
-{}
-
-void RenderViewObserverQt::onFetchDocumentMarkup(quint64 requestId)
-{
- blink::WebString markup;
- if (render_view()->GetWebView()->MainFrame()->IsWebLocalFrame())
- markup = blink::WebFrameContentDumper::DumpAsMarkup(
- static_cast<blink::WebLocalFrame *>(render_view()->GetWebView()->MainFrame()));
- Send(new RenderViewObserverHostQt_DidFetchDocumentMarkup(routing_id(), requestId, markup.Utf16()));
-}
-
-void RenderViewObserverQt::onFetchDocumentInnerText(quint64 requestId)
-{
- blink::WebString text;
- if (render_view()->GetWebView()->MainFrame()->IsWebLocalFrame())
- text = blink::WebFrameContentDumper::DumpWebViewAsText(render_view()->GetWebView(),
- std::numeric_limits<std::size_t>::max());
- Send(new RenderViewObserverHostQt_DidFetchDocumentInnerText(routing_id(), requestId, text.Utf16()));
-}
-
-void RenderViewObserverQt::onSetBackgroundColor(quint32 color)
-{
- render_view()->GetWebView()->SetBaseBackgroundColorOverride(color);
-}
-
-void RenderViewObserverQt::OnDestruct()
-{
- delete this;
-}
-
-bool RenderViewObserverQt::OnMessageReceived(const IPC::Message &message)
-{
- bool handled = true;
- IPC_BEGIN_MESSAGE_MAP(RenderViewObserverQt, message)
- IPC_MESSAGE_HANDLER(RenderViewObserverQt_FetchDocumentMarkup, onFetchDocumentMarkup)
- IPC_MESSAGE_HANDLER(RenderViewObserverQt_FetchDocumentInnerText, onFetchDocumentInnerText)
- IPC_MESSAGE_HANDLER(RenderViewObserverQt_SetBackgroundColor, onSetBackgroundColor)
- IPC_MESSAGE_UNHANDLED(handled = false)
- IPC_END_MESSAGE_MAP()
- return handled;
-}
diff --git a/src/core/renderer/render_view_observer_qt.h b/src/core/renderer/render_view_observer_qt.h
deleted file mode 100644
index 5c555b222..000000000
--- a/src/core/renderer/render_view_observer_qt.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef RENDER_VIEW_OBSERVER_QT_H
-#define RENDER_VIEW_OBSERVER_QT_H
-
-#include "content/public/renderer/render_view_observer.h"
-
-#include <QtGlobal>
-
-class RenderViewObserverQt : public content::RenderViewObserver
-{
-public:
- RenderViewObserverQt(content::RenderView *render_view);
-
-private:
- void onFetchDocumentMarkup(quint64 requestId);
- void onFetchDocumentInnerText(quint64 requestId);
- void onSetBackgroundColor(quint32 color);
-
- void OnDestruct() override;
-
- bool OnMessageReceived(const IPC::Message &message) override;
-
- DISALLOW_COPY_AND_ASSIGN(RenderViewObserverQt);
-};
-
-#endif // RENDER_VIEW_OBSERVER_QT_H
diff --git a/src/core/renderer/user_resource_controller.cpp b/src/core/renderer/user_resource_controller.cpp
index 5c1bd301f..eff304981 100644
--- a/src/core/renderer/user_resource_controller.cpp
+++ b/src/core/renderer/user_resource_controller.cpp
@@ -1,60 +1,20 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "user_resource_controller.h"
#include "base/memory/weak_ptr.h"
-#include "base/pending_task.h"
#include "base/strings/pattern.h"
+#include "base/task/single_thread_task_runner.h"
#include "content/public/renderer/render_frame.h"
-#include "content/public/renderer/render_view.h"
#include "content/public/renderer/render_frame_observer.h"
-#include "content/public/renderer/render_view_observer.h"
#include "extensions/common/url_pattern.h"
-#include "third_party/blink/public/web/web_document.h"
#include "third_party/blink/public/web/web_local_frame.h"
#include "third_party/blink/public/web/web_script_source.h"
-#include "third_party/blink/public/web/web_view.h"
-#include "v8/include/v8.h"
+#include "mojo/public/cpp/bindings/associated_receiver.h"
+#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h"
-#include "common/qt_messages.h"
-#include "common/user_script_data.h"
+#include "qtwebengine/userscript/user_script_data.h"
#include "type_conversion.h"
#include "user_script.h"
@@ -62,9 +22,9 @@
#include <bitset>
-Q_GLOBAL_STATIC(UserResourceController, qt_webengine_userResourceController)
+namespace QtWebEngineCore {
-static content::RenderView *const globalScriptsIndex = nullptr;
+static content::RenderFrame *const globalScriptsIndex = nullptr;
// Scripts meant to run after the load event will be run 500ms after DOMContentLoaded if the load event doesn't come within that delay.
static const int afterLoadTimeout = 500;
@@ -97,7 +57,7 @@ static bool includeRuleMatchesURL(const std::string &pat, const GURL &url)
return false;
}
-static bool scriptMatchesURL(const UserScriptData &scriptData, const GURL &url)
+static bool scriptMatchesURL(const QtWebEngineCore::UserScriptData &scriptData, const GURL &url)
{
// Logic taken from Chromium (extensions/common/user_script.cc)
bool matchFound;
@@ -132,26 +92,34 @@ static bool scriptMatchesURL(const UserScriptData &scriptData, const GURL &url)
return true;
}
-class UserResourceController::RenderFrameObserverHelper : public content::RenderFrameObserver
+// using UserScriptDataPtr = mojo::StructPtr<qtwebengine::mojom::UserScriptData>;
+
+class UserResourceController::RenderFrameObserverHelper
+ : public content::RenderFrameObserver,
+ public qtwebengine::mojom::UserResourceControllerRenderFrame
{
public:
- RenderFrameObserverHelper(content::RenderFrame *render_frame);
+ RenderFrameObserverHelper(content::RenderFrame *render_frame,
+ UserResourceController *controller);
+ void BindReceiver(
+ mojo::PendingAssociatedReceiver<qtwebengine::mojom::UserResourceControllerRenderFrame>
+ receiver);
private:
// RenderFrameObserver implementation.
- void DidCommitProvisionalLoad(bool is_same_document_navigation, ui::PageTransition transition) override;
- void DidFinishDocumentLoad() override;
+ void DidCommitProvisionalLoad(ui::PageTransition transition) override;
+ void DidDispatchDOMContentLoadedEvent() override;
void DidFinishLoad() override;
- void FrameDetached() override;
+ void WillDetach() override;
void OnDestruct() override;
- bool OnMessageReceived(const IPC::Message &message) override;
-
- void onUserScriptAdded(const UserScriptData &);
- void onUserScriptRemoved(const UserScriptData &);
- void onScriptsCleared();
+ void AddScript(const QtWebEngineCore::UserScriptData &data) override;
+ void RemoveScript(const QtWebEngineCore::UserScriptData &data) override;
+ void ClearScripts() override;
class Runner;
QScopedPointer<Runner> m_runner;
+ mojo::AssociatedReceiver<qtwebengine::mojom::UserResourceControllerRenderFrame> m_binding;
+ UserResourceController *m_userResourceController;
};
// Helper class to create WeakPtrs so the AfterLoad tasks can be canceled and to
@@ -159,13 +127,16 @@ private:
class UserResourceController::RenderFrameObserverHelper::Runner : public base::SupportsWeakPtr<Runner>
{
public:
- explicit Runner(blink::WebLocalFrame *frame) : m_frame(frame) {}
+ explicit Runner(blink::WebLocalFrame *frame, UserResourceController *controller)
+ : m_frame(frame), m_userResourceController(controller)
+ {
+ }
- void run(UserScriptData::InjectionPoint p)
+ void run(QtWebEngineCore::UserScriptData::InjectionPoint p)
{
DCHECK_LT(p, m_ran.size());
if (!m_ran[p]) {
- UserResourceController::instance()->runScripts(p, m_frame);
+ m_userResourceController->runScripts(p, m_frame);
m_ran[p] = true;
}
}
@@ -173,42 +144,29 @@ public:
private:
blink::WebLocalFrame *m_frame;
std::bitset<3> m_ran;
+ UserResourceController *m_userResourceController;
};
-// Used only for script cleanup on RenderView destruction.
-class UserResourceController::RenderViewObserverHelper : public content::RenderViewObserver
-{
-public:
- RenderViewObserverHelper(content::RenderView *render_view);
-
-private:
- // RenderViewObserver implementation.
- void OnDestruct() override;
-};
-
-void UserResourceController::runScripts(UserScriptData::InjectionPoint p, blink::WebLocalFrame *frame)
+void UserResourceController::runScripts(QtWebEngineCore::UserScriptData::InjectionPoint p,
+ blink::WebLocalFrame *frame)
{
content::RenderFrame *renderFrame = content::RenderFrame::FromWebFrame(frame);
if (!renderFrame)
return;
const bool isMainFrame = renderFrame->IsMainFrame();
- content::RenderView *renderView = renderFrame->GetRenderView();
- if (!renderView)
- return;
-
- QList<uint64_t> scriptsToRun = m_viewUserScriptMap.value(0).toList();
- scriptsToRun.append(m_viewUserScriptMap.value(renderView).toList());
+ QList<uint64_t> scriptsToRun = m_frameUserScriptMap.value(globalScriptsIndex);
+ scriptsToRun.append(m_frameUserScriptMap.value(renderFrame));
- for (uint64_t id : qAsConst(scriptsToRun)) {
- const UserScriptData &script = m_scripts.value(id);
+ for (uint64_t id : std::as_const(scriptsToRun)) {
+ const QtWebEngineCore::UserScriptData &script = m_scripts.value(id);
if (script.injectionPoint != p || (!script.injectForSubframes && !isMainFrame))
continue;
if (!scriptMatchesURL(script, frame->GetDocument().Url()))
continue;
blink::WebScriptSource source(blink::WebString::FromUTF8(script.source), script.url);
if (script.worldId)
- frame->ExecuteScriptInIsolatedWorld(script.worldId, source);
+ frame->ExecuteScriptInIsolatedWorld(script.worldId, source, blink::BackForwardCacheAware::kAllow); // FIXME, check
else
frame->ExecuteScript(source);
}
@@ -216,119 +174,103 @@ void UserResourceController::runScripts(UserScriptData::InjectionPoint p, blink:
void UserResourceController::RunScriptsAtDocumentEnd(content::RenderFrame *render_frame)
{
- runScripts(UserScriptData::DocumentLoadFinished, render_frame->GetWebFrame());
+ runScripts(QtWebEngineCore::UserScriptData::DocumentLoadFinished, render_frame->GetWebFrame());
}
-UserResourceController::RenderFrameObserverHelper::RenderFrameObserverHelper(content::RenderFrame *render_frame)
+UserResourceController::RenderFrameObserverHelper::RenderFrameObserverHelper(
+ content::RenderFrame *render_frame, UserResourceController *controller)
: content::RenderFrameObserver(render_frame)
-{}
+ , m_binding(this)
+ , m_userResourceController(controller)
+{
+ render_frame->GetAssociatedInterfaceRegistry()->AddInterface<qtwebengine::mojom::UserResourceControllerRenderFrame>(
+ base::BindRepeating(&UserResourceController::RenderFrameObserverHelper::BindReceiver,
+ base::Unretained(this)));
+}
-UserResourceController::RenderViewObserverHelper::RenderViewObserverHelper(content::RenderView *render_view)
- : content::RenderViewObserver(render_view)
-{}
-void UserResourceController::RenderFrameObserverHelper::DidCommitProvisionalLoad(bool is_same_document_navigation,
- ui::PageTransition /*transitionbool*/)
+void UserResourceController::RenderFrameObserverHelper::BindReceiver(
+ mojo::PendingAssociatedReceiver<qtwebengine::mojom::UserResourceControllerRenderFrame>
+ receiver)
{
- if (is_same_document_navigation)
- return;
+ m_binding.Bind(std::move(receiver));
+}
+void UserResourceController::RenderFrameObserverHelper::DidCommitProvisionalLoad(ui::PageTransition /*transition*/)
+{
// We are almost ready to run scripts. We still have to wait until the host
// process has been notified of the DidCommitProvisionalLoad event to ensure
// that the WebChannelTransportHost is ready to receive messages.
- m_runner.reset(new Runner(render_frame()->GetWebFrame()));
+ m_runner.reset(new Runner(render_frame()->GetWebFrame(), m_userResourceController));
- base::ThreadTaskRunnerHandle::Get()->PostTask(
- FROM_HERE, base::BindOnce(&Runner::run, m_runner->AsWeakPtr(), UserScriptData::DocumentElementCreation));
+ base::SingleThreadTaskRunner::GetCurrentDefault()->PostTask(
+ FROM_HERE,
+ base::BindOnce(&Runner::run, m_runner->AsWeakPtr(),
+ QtWebEngineCore::UserScriptData::DocumentElementCreation));
}
-void UserResourceController::RenderFrameObserverHelper::DidFinishDocumentLoad()
+void UserResourceController::RenderFrameObserverHelper::DidDispatchDOMContentLoadedEvent()
{
// Don't run scripts if provisional load failed (DidFailProvisionalLoad
// called instead of DidCommitProvisionalLoad).
if (m_runner)
- base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
- FROM_HERE, base::BindOnce(&Runner::run, m_runner->AsWeakPtr(), UserScriptData::AfterLoad),
- base::TimeDelta::FromMilliseconds(afterLoadTimeout));
+ base::SingleThreadTaskRunner::GetCurrentDefault()->PostDelayedTask(
+ FROM_HERE,
+ base::BindOnce(&Runner::run, m_runner->AsWeakPtr(),
+ QtWebEngineCore::UserScriptData::AfterLoad),
+ base::Milliseconds(afterLoadTimeout));
}
void UserResourceController::RenderFrameObserverHelper::DidFinishLoad()
{
if (m_runner)
- base::ThreadTaskRunnerHandle::Get()->PostTask(
- FROM_HERE, base::BindOnce(&Runner::run, m_runner->AsWeakPtr(), UserScriptData::AfterLoad));
+ base::SingleThreadTaskRunner::GetCurrentDefault()->PostTask(
+ FROM_HERE,
+ base::BindOnce(&Runner::run, m_runner->AsWeakPtr(),
+ QtWebEngineCore::UserScriptData::AfterLoad));
}
-void UserResourceController::RenderFrameObserverHelper::FrameDetached()
+void UserResourceController::RenderFrameObserverHelper::WillDetach()
{
m_runner.reset();
}
void UserResourceController::RenderFrameObserverHelper::OnDestruct()
{
+ if (content::RenderFrame *frame = render_frame()) {
+ m_userResourceController->renderFrameDestroyed(frame);
+ }
delete this;
}
-void UserResourceController::RenderViewObserverHelper::OnDestruct()
-{
- // Remove all scripts associated with the render view.
- if (content::RenderView *view = render_view())
- UserResourceController::instance()->renderViewDestroyed(view);
- delete this;
-}
-
-bool UserResourceController::RenderFrameObserverHelper::OnMessageReceived(const IPC::Message &message)
-{
- bool handled = true;
- IPC_BEGIN_MESSAGE_MAP(UserResourceController::RenderFrameObserverHelper, message)
- IPC_MESSAGE_HANDLER(RenderFrameObserverHelper_AddScript, onUserScriptAdded)
- IPC_MESSAGE_HANDLER(RenderFrameObserverHelper_RemoveScript, onUserScriptRemoved)
- IPC_MESSAGE_HANDLER(RenderFrameObserverHelper_ClearScripts, onScriptsCleared)
- IPC_MESSAGE_UNHANDLED(handled = false)
- IPC_END_MESSAGE_MAP()
- return handled;
-}
-
-void UserResourceController::RenderFrameObserverHelper::onUserScriptAdded(const UserScriptData &script)
+void UserResourceController::RenderFrameObserverHelper::AddScript(
+ const QtWebEngineCore::UserScriptData &script)
{
if (content::RenderFrame *frame = render_frame())
- if (content::RenderView *view = frame->GetRenderView())
- UserResourceController::instance()->addScriptForView(script, view);
+ m_userResourceController->addScriptForFrame(script, frame);
}
-void UserResourceController::RenderFrameObserverHelper::onUserScriptRemoved(const UserScriptData &script)
+void UserResourceController::RenderFrameObserverHelper::RemoveScript(
+ const QtWebEngineCore::UserScriptData &script)
{
if (content::RenderFrame *frame = render_frame())
- if (content::RenderView *view = frame->GetRenderView())
- UserResourceController::instance()->removeScriptForView(script, view);
+ m_userResourceController->removeScriptForFrame(script, frame);
}
-void UserResourceController::RenderFrameObserverHelper::onScriptsCleared()
+void UserResourceController::RenderFrameObserverHelper::ClearScripts()
{
if (content::RenderFrame *frame = render_frame())
- if (content::RenderView *view = frame->GetRenderView())
- UserResourceController::instance()->clearScriptsForView(view);
+ m_userResourceController->clearScriptsForFrame(frame);
}
-UserResourceController *UserResourceController::instance()
+void UserResourceController::BindReceiver(
+ mojo::PendingAssociatedReceiver<qtwebengine::mojom::UserResourceController> receiver)
{
- return qt_webengine_userResourceController();
+ m_binding.Bind(std::move(receiver));
}
-bool UserResourceController::OnControlMessageReceived(const IPC::Message &message)
-{
- bool handled = true;
- IPC_BEGIN_MESSAGE_MAP(UserResourceController, message)
- IPC_MESSAGE_HANDLER(UserResourceController_AddScript, onAddScript)
- IPC_MESSAGE_HANDLER(UserResourceController_RemoveScript, onRemoveScript)
- IPC_MESSAGE_HANDLER(UserResourceController_ClearScripts, onClearScripts)
- IPC_MESSAGE_UNHANDLED(handled = false)
- IPC_END_MESSAGE_MAP()
- return handled;
-}
-
-UserResourceController::UserResourceController()
+UserResourceController::UserResourceController() : m_binding(this)
{
#if !defined(QT_NO_DEBUG) || defined(QT_FORCE_ASSERTS)
static bool onlyCalledOnce = true;
@@ -340,68 +282,85 @@ UserResourceController::UserResourceController()
void UserResourceController::renderFrameCreated(content::RenderFrame *renderFrame)
{
// Will destroy itself when the RenderFrame is destroyed.
- new RenderFrameObserverHelper(renderFrame);
+ new RenderFrameObserverHelper(renderFrame, this);
}
-void UserResourceController::renderViewCreated(content::RenderView *renderView)
+void UserResourceController::renderFrameDestroyed(content::RenderFrame *renderFrame)
{
- // Will destroy itself when the RenderView is destroyed.
- new RenderViewObserverHelper(renderView);
+ FrameUserScriptMap::iterator it = m_frameUserScriptMap.find(renderFrame);
+ if (it == m_frameUserScriptMap.end()) // ASSERT maybe?
+ return;
+ if (renderFrame->IsMainFrame()) {
+ for (uint64_t id : std::as_const(it.value()))
+ m_scripts.remove(id);
+ }
+ m_frameUserScriptMap.erase(it);
}
-void UserResourceController::renderViewDestroyed(content::RenderView *renderView)
+void UserResourceController::addScriptForFrame(const QtWebEngineCore::UserScriptData &script,
+ content::RenderFrame *frame)
{
- ViewUserScriptMap::iterator it = m_viewUserScriptMap.find(renderView);
- if (it == m_viewUserScriptMap.end()) // ASSERT maybe?
- return;
- for (uint64_t id : qAsConst(it.value())) {
- m_scripts.remove(id);
- }
- m_viewUserScriptMap.remove(renderView);
+ FrameUserScriptMap::iterator it = m_frameUserScriptMap.find(frame);
+ if (it == m_frameUserScriptMap.end())
+ it = m_frameUserScriptMap.insert(frame, UserScriptList());
+
+ if (!(*it).contains(script.scriptId))
+ (*it).append(script.scriptId);
+ if (!frame || frame->IsMainFrame())
+ m_scripts.insert(script.scriptId, script);
}
-void UserResourceController::addScriptForView(const UserScriptData &script, content::RenderView *view)
+void UserResourceController::removeScriptForFrame(const QtWebEngineCore::UserScriptData &script,
+ content::RenderFrame *frame)
{
- ViewUserScriptMap::iterator it = m_viewUserScriptMap.find(view);
- if (it == m_viewUserScriptMap.end())
- it = m_viewUserScriptMap.insert(view, UserScriptSet());
+ FrameUserScriptMap::iterator it = m_frameUserScriptMap.find(frame);
+ if (it == m_frameUserScriptMap.end())
+ return;
- (*it).insert(script.scriptId);
- m_scripts.insert(script.scriptId, script);
+ (*it).removeOne(script.scriptId);
+ if (!frame || frame->IsMainFrame())
+ m_scripts.remove(script.scriptId);
}
-void UserResourceController::removeScriptForView(const UserScriptData &script, content::RenderView *view)
+void UserResourceController::clearScriptsForFrame(content::RenderFrame *frame)
{
- ViewUserScriptMap::iterator it = m_viewUserScriptMap.find(view);
- if (it == m_viewUserScriptMap.end())
+ FrameUserScriptMap::iterator it = m_frameUserScriptMap.find(frame);
+ if (it == m_frameUserScriptMap.end())
return;
+ if (!frame || frame->IsMainFrame()) {
+ for (uint64_t id : std::as_const(it.value()))
+ m_scripts.remove(id);
+ }
- (*it).remove(script.scriptId);
- m_scripts.remove(script.scriptId);
+ m_frameUserScriptMap.remove(frame);
}
-void UserResourceController::clearScriptsForView(content::RenderView *view)
+void UserResourceController::AddScript(const QtWebEngineCore::UserScriptData &script)
{
- ViewUserScriptMap::iterator it = m_viewUserScriptMap.find(view);
- if (it == m_viewUserScriptMap.end())
- return;
- for (uint64_t id : qAsConst(it.value()))
- m_scripts.remove(id);
+ addScriptForFrame(script, globalScriptsIndex);
+}
- m_viewUserScriptMap.remove(view);
+void UserResourceController::RemoveScript(const QtWebEngineCore::UserScriptData &script)
+{
+ removeScriptForFrame(script, globalScriptsIndex);
}
-void UserResourceController::onAddScript(const UserScriptData &script)
+void UserResourceController::ClearScripts()
{
- addScriptForView(script, globalScriptsIndex);
+ clearScriptsForFrame(globalScriptsIndex);
}
-void UserResourceController::onRemoveScript(const UserScriptData &script)
+void UserResourceController::RegisterMojoInterfaces(
+ blink::AssociatedInterfaceRegistry *associated_interfaces)
{
- removeScriptForView(script, globalScriptsIndex);
+ associated_interfaces->AddInterface<qtwebengine::mojom::UserResourceController>(
+ base::BindRepeating(&UserResourceController::BindReceiver, base::Unretained(this)));
}
-void UserResourceController::onClearScripts()
+void UserResourceController::UnregisterMojoInterfaces(
+ blink::AssociatedInterfaceRegistry *associated_interfaces)
{
- clearScriptsForView(globalScriptsIndex);
+ associated_interfaces->RemoveInterface(qtwebengine::mojom::UserResourceController::Name_);
}
+
+} // namespace
diff --git a/src/core/renderer/user_resource_controller.h b/src/core/renderer/user_resource_controller.h
index 3a493b9b7..a5dab73f1 100644
--- a/src/core/renderer/user_resource_controller.h
+++ b/src/core/renderer/user_resource_controller.h
@@ -1,51 +1,16 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef USER_RESOURCE_CONTROLLER_H
#define USER_RESOURCE_CONTROLLER_H
#include "content/public/renderer/render_thread_observer.h"
-
-#include "common/user_script_data.h"
+#include "qtwebengine/userscript/userscript.mojom.h"
+#include "qtwebengine/userscript/user_script_data.h"
+#include "mojo/public/cpp/bindings/associated_receiver.h"
#include <QtCore/QHash>
-#include <QtCore/QSet>
+#include <QtCore/QList>
namespace blink {
class WebLocalFrame;
@@ -53,45 +18,48 @@ class WebLocalFrame;
namespace content {
class RenderFrame;
-class RenderView;
}
-class UserResourceController : public content::RenderThreadObserver
+namespace QtWebEngineCore {
+
+class UserResourceController : public content::RenderThreadObserver,
+ qtwebengine::mojom::UserResourceController
{
public:
- static UserResourceController *instance();
UserResourceController();
void renderFrameCreated(content::RenderFrame *);
- void renderViewCreated(content::RenderView *);
- void renderViewDestroyed(content::RenderView *renderView);
- void addScriptForView(const UserScriptData &, content::RenderView *);
- void removeScriptForView(const UserScriptData &, content::RenderView *);
- void clearScriptsForView(content::RenderView *);
+ void renderFrameDestroyed(content::RenderFrame *);
+ void addScriptForFrame(const QtWebEngineCore::UserScriptData &, content::RenderFrame *);
+ void removeScriptForFrame(const QtWebEngineCore::UserScriptData &, content::RenderFrame *);
+ void clearScriptsForFrame(content::RenderFrame *);
void RunScriptsAtDocumentEnd(content::RenderFrame *render_frame);
+ void BindReceiver(
+ mojo::PendingAssociatedReceiver<qtwebengine::mojom::UserResourceController> receiver);
private:
Q_DISABLE_COPY(UserResourceController)
- class RenderFrameObserverHelper;
- class RenderViewObserverHelper;
+ // content::RenderThreadObserver:
+ void RegisterMojoInterfaces(blink::AssociatedInterfaceRegistry *associated_interfaces) override;
+ void UnregisterMojoInterfaces(blink::AssociatedInterfaceRegistry *associated_interfaces) override;
- // RenderProcessObserver implementation.
- bool OnControlMessageReceived(const IPC::Message &message) override;
-
- void onAddScript(const UserScriptData &);
- void onRemoveScript(const UserScriptData &);
- void onClearScripts();
+ class RenderFrameObserverHelper;
- void runScripts(UserScriptData::InjectionPoint, blink::WebLocalFrame *);
+ void AddScript(const QtWebEngineCore::UserScriptData &data) override;
+ void RemoveScript(const QtWebEngineCore::UserScriptData &data) override;
+ void ClearScripts() override;
- typedef QSet<uint64_t> UserScriptSet;
- typedef QHash<const content::RenderView *, UserScriptSet> ViewUserScriptMap;
- ViewUserScriptMap m_viewUserScriptMap;
- QHash<uint64_t, UserScriptData> m_scripts;
+ void runScripts(QtWebEngineCore::UserScriptData::InjectionPoint, blink::WebLocalFrame *);
+ typedef QList<uint64_t> UserScriptList;
+ typedef QHash<const content::RenderFrame *, UserScriptList> FrameUserScriptMap;
+ FrameUserScriptMap m_frameUserScriptMap;
+ QHash<uint64_t, QtWebEngineCore::UserScriptData> m_scripts;
+ mojo::AssociatedReceiver<qtwebengine::mojom::UserResourceController> m_binding;
friend class RenderFrameObserverHelper;
};
+} // namespace QtWebEngineCore
#endif // USER_RESOURCE_CONTROLLER_H
diff --git a/src/core/renderer/web_channel_ipc_transport.cpp b/src/core/renderer/web_channel_ipc_transport.cpp
index 1fb3bc678..89b20c7d1 100644
--- a/src/core/renderer/web_channel_ipc_transport.cpp
+++ b/src/core/renderer/web_channel_ipc_transport.cpp
@@ -1,49 +1,11 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE.Chromium file.
#include "renderer/web_channel_ipc_transport.h"
-#include "common/qt_messages.h"
-
#include "content/public/renderer/render_frame.h"
#include "gin/arguments.h"
#include "gin/handle.h"
@@ -54,11 +16,8 @@
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h"
#include "v8/include/v8.h"
-#include "services/service_manager/public/cpp/interface_provider.h"
#include "qtwebengine/browser/qtwebchannel.mojom.h"
-#include <QJsonDocument>
-
namespace QtWebEngineCore {
class WebChannelTransport : public gin::Wrappable<WebChannelTransport>
@@ -74,8 +33,8 @@ private:
// gin::WrappableBase
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(v8::Isolate *isolate) override;
-
- DISALLOW_COPY_AND_ASSIGN(WebChannelTransport);
+ mojo::AssociatedRemote<qtwebchannel::mojom::WebChannelTransportHost> m_remote;
+ content::RenderFrame *m_renderFrame = nullptr;
};
gin::WrapperInfo WebChannelTransport::kWrapperInfo = { gin::kEmbedderNativeGin };
@@ -89,23 +48,23 @@ void WebChannelTransport::Install(blink::WebLocalFrame *frame, uint worldId)
context = frame->MainWorldScriptContext();
else
context = frame->IsolatedWorldScriptContext(worldId);
+ if (context.IsEmpty())
+ return;
v8::Context::Scope contextScope(context);
gin::Handle<WebChannelTransport> transport = gin::CreateHandle(isolate, new WebChannelTransport);
+ if (transport.IsEmpty())
+ return;
v8::Local<v8::Object> global = context->Global();
- v8::MaybeLocal<v8::Value> qtObjectValue = global->Get(context, gin::StringToV8(isolate, "qt"));
v8::Local<v8::Object> qtObject;
- if (qtObjectValue.IsEmpty() || !qtObjectValue.ToLocalChecked()->IsObject()) {
- qtObject = v8::Object::New(isolate);
- auto whocares = global->Set(context, gin::StringToV8(isolate, "qt"), qtObject);
- // FIXME: Perhaps error out, but the return value is V8 internal...
- Q_UNUSED(whocares);
- } else {
- qtObject = v8::Local<v8::Object>::Cast(qtObjectValue.ToLocalChecked());
- }
- auto whocares = qtObject->Set(context, gin::StringToV8(isolate, "webChannelTransport"), transport.ToV8());
- Q_UNUSED(whocares);
+ qtObject = v8::Object::New(isolate);
+ global->CreateDataProperty(context,
+ gin::StringToSymbol(isolate, "qt"),
+ qtObject).Check();
+ qtObject->CreateDataProperty(context,
+ gin::StringToSymbol(isolate, "webChannelTransport"),
+ transport.ToV8()).Check();
}
void WebChannelTransport::Uninstall(blink::WebLocalFrame *frame, uint worldId)
@@ -117,16 +76,16 @@ void WebChannelTransport::Uninstall(blink::WebLocalFrame *frame, uint worldId)
context = frame->MainWorldScriptContext();
else
context = frame->IsolatedWorldScriptContext(worldId);
+ if (context.IsEmpty())
+ return;
v8::Context::Scope contextScope(context);
v8::Local<v8::Object> global(context->Global());
- v8::MaybeLocal<v8::Value> qtObjectValue = global->Get(context, gin::StringToV8(isolate, "qt"));
- if (qtObjectValue.IsEmpty() || !qtObjectValue.ToLocalChecked()->IsObject())
+ v8::Local<v8::Value> qtObjectValue;
+ if (!global->Get(context, gin::StringToV8(isolate, "qt")).ToLocal(&qtObjectValue) || !qtObjectValue->IsObject())
return;
- v8::Local<v8::Object> qtObject = v8::Local<v8::Object>::Cast(qtObjectValue.ToLocalChecked());
- // FIXME: We can't do anything about a failure, so why the .. is it nodiscard?
- auto whocares = qtObject->Delete(context, gin::StringToV8(isolate, "webChannelTransport"));
- Q_UNUSED(whocares);
+ v8::Local<v8::Object> qtObject = v8::Local<v8::Object>::Cast(qtObjectValue);
+ qtObject->Delete(context, gin::StringToV8(isolate, "webChannelTransport")).Check();
}
void WebChannelTransport::NativeQtSendMessage(gin::Arguments *args)
@@ -152,22 +111,17 @@ void WebChannelTransport::NativeQtSendMessage(gin::Arguments *args)
return;
}
v8::Local<v8::String> jsonString = v8::Local<v8::String>::Cast(jsonValue);
+ std::vector<uint8_t> json(jsonString->Utf8Length(isolate), 0);
+ jsonString->WriteUtf8(isolate, reinterpret_cast<char *>(json.data()), json.size(), nullptr,
+ v8::String::REPLACE_INVALID_UTF8);
- QByteArray json(jsonString->Utf8Length(isolate), 0);
- jsonString->WriteUtf8(isolate, json.data(), json.size(), nullptr, v8::String::REPLACE_INVALID_UTF8);
-
- QJsonParseError error;
- QJsonDocument doc = QJsonDocument::fromJson(json, &error);
- if (error.error != QJsonParseError::NoError) {
- args->ThrowTypeError("Invalid JSON");
- return;
+ if (!m_remote) {
+ renderFrame->GetRemoteAssociatedInterfaces()->GetInterface(&m_remote);
+ m_renderFrame = renderFrame;
}
+ DCHECK(renderFrame == m_renderFrame);
- int size = 0;
- const char *rawData = doc.rawData(&size);
- mojo::AssociatedRemote<qtwebchannel::mojom::WebChannelTransportHost> webChannelTransport;
- renderFrame->GetRemoteAssociatedInterfaces()->GetInterface(&webChannelTransport);
- webChannelTransport->DispatchWebChannelMessage(std::vector<uint8_t>(rawData, rawData + size));
+ m_remote->DispatchWebChannelMessage(json);
}
gin::ObjectTemplateBuilder WebChannelTransport::GetObjectTemplateBuilder(v8::Isolate *isolate)
@@ -177,16 +131,19 @@ gin::ObjectTemplateBuilder WebChannelTransport::GetObjectTemplateBuilder(v8::Iso
}
WebChannelIPCTransport::WebChannelIPCTransport(content::RenderFrame *renderFrame)
- : content::RenderFrameObserver(renderFrame), m_worldId(0), m_worldInitialized(false)
+ : content::RenderFrameObserver(renderFrame)
+ , m_worldId(0)
+ , m_worldInitialized(false)
+ , m_binding(this)
{
- renderFrame->GetAssociatedInterfaceRegistry()->AddInterface(
+ renderFrame->GetAssociatedInterfaceRegistry()->AddInterface<qtwebchannel::mojom::WebChannelTransportRender>(
base::BindRepeating(&WebChannelIPCTransport::BindReceiver, base::Unretained(this)));
}
void WebChannelIPCTransport::BindReceiver(
mojo::PendingAssociatedReceiver<qtwebchannel::mojom::WebChannelTransportRender> receiver)
{
- m_receivers.Add(this, std::move(receiver));
+ m_binding.Bind(std::move(receiver));
}
void WebChannelIPCTransport::SetWorldId(uint32_t worldId)
@@ -213,18 +170,14 @@ void WebChannelIPCTransport::ResetWorldId()
m_worldId = 0;
}
-void WebChannelIPCTransport::DispatchWebChannelMessage(const std::vector<uint8_t> &binaryJson, uint32_t worldId)
+void WebChannelIPCTransport::DispatchWebChannelMessage(const std::vector<uint8_t> &json,
+ uint32_t worldId)
{
DCHECK(m_worldId == worldId);
if (!m_canUseContext)
return;
- QJsonDocument doc = QJsonDocument::fromRawData(reinterpret_cast<const char *>(binaryJson.data()), binaryJson.size(),
- QJsonDocument::BypassValidation);
- DCHECK(doc.isObject());
- QByteArray json = doc.toJson(QJsonDocument::Compact);
-
blink::WebLocalFrame *frame = render_frame()->GetWebFrame();
v8::Isolate *isolate = blink::MainThreadIsolate();
v8::HandleScope handleScope(isolate);
@@ -236,17 +189,18 @@ void WebChannelIPCTransport::DispatchWebChannelMessage(const std::vector<uint8_t
v8::Context::Scope contextScope(context);
v8::Local<v8::Object> global(context->Global());
- v8::MaybeLocal<v8::Value> qtObjectValue(global->Get(context, gin::StringToV8(isolate, "qt")));
- if (qtObjectValue.IsEmpty() || !qtObjectValue.ToLocalChecked()->IsObject())
+ v8::Local<v8::Value> qtObjectValue;
+ if (!global->Get(context, gin::StringToV8(isolate, "qt")).ToLocal(&qtObjectValue) || !qtObjectValue->IsObject())
return;
- v8::Local<v8::Object> qtObject = v8::Local<v8::Object>::Cast(qtObjectValue.ToLocalChecked());
- v8::MaybeLocal<v8::Value> webChannelObjectValue(
- qtObject->Get(context, gin::StringToV8(isolate, "webChannelTransport")));
- if (webChannelObjectValue.IsEmpty() || !webChannelObjectValue.ToLocalChecked()->IsObject())
+ v8::Local<v8::Object> qtObject = v8::Local<v8::Object>::Cast(qtObjectValue);
+ v8::Local<v8::Value> webChannelObjectValue;
+ if (!qtObject->Get(context, gin::StringToV8(isolate, "webChannelTransport")).ToLocal(&webChannelObjectValue)
+ || !webChannelObjectValue->IsObject())
return;
- v8::Local<v8::Object> webChannelObject = v8::Local<v8::Object>::Cast(webChannelObjectValue.ToLocalChecked());
- v8::MaybeLocal<v8::Value> callbackValue(webChannelObject->Get(context, gin::StringToV8(isolate, "onmessage")));
- if (callbackValue.IsEmpty() || !callbackValue.ToLocalChecked()->IsFunction()) {
+ v8::Local<v8::Object> webChannelObject = v8::Local<v8::Object>::Cast(webChannelObjectValue);
+ v8::Local<v8::Value> callbackValue;
+ if (!webChannelObject->Get(context, gin::StringToV8(isolate, "onmessage")).ToLocal(&callbackValue)
+ || !callbackValue->IsFunction()) {
LOG(WARNING) << "onmessage is not a callable property of qt.webChannelTransport. Some things might not work as "
"expected.";
return;
@@ -255,30 +209,32 @@ void WebChannelIPCTransport::DispatchWebChannelMessage(const std::vector<uint8_t
v8::Local<v8::Object> messageObject(v8::Object::New(isolate));
v8::Maybe<bool> wasSet = messageObject->DefineOwnProperty(
context, v8::String::NewFromUtf8(isolate, "data").ToLocalChecked(),
- v8::String::NewFromUtf8(isolate, json.constData(), v8::NewStringType::kNormal, json.size()).ToLocalChecked(),
+ v8::String::NewFromUtf8(isolate, reinterpret_cast<const char *>(json.data()),
+ v8::NewStringType::kNormal, json.size())
+ .ToLocalChecked(),
v8::PropertyAttribute(v8::ReadOnly | v8::DontDelete));
DCHECK(!wasSet.IsNothing() && wasSet.FromJust());
- v8::Local<v8::Function> callback = v8::Local<v8::Function>::Cast(callbackValue.ToLocalChecked());
+ v8::Local<v8::Function> callback = v8::Local<v8::Function>::Cast(callbackValue);
v8::Local<v8::Value> argv[] = { messageObject };
frame->CallFunctionEvenIfScriptDisabled(callback, webChannelObject, 1, argv);
}
-void WebChannelIPCTransport::WillReleaseScriptContext(v8::Local<v8::Context> context, int worldId)
-{
- if (static_cast<uint>(worldId) == m_worldId)
- m_canUseContext = false;
-}
-
-void WebChannelIPCTransport::DidClearWindowObject()
+void WebChannelIPCTransport::DidCreateScriptContext(v8::Local<v8::Context> context, int32_t worldId)
{
- if (!m_canUseContext) {
+ if (static_cast<uint>(worldId) == m_worldId && !m_canUseContext) {
m_canUseContext = true;
if (m_worldInitialized)
WebChannelTransport::Install(render_frame()->GetWebFrame(), m_worldId);
}
}
+void WebChannelIPCTransport::WillReleaseScriptContext(v8::Local<v8::Context> context, int worldId)
+{
+ if (static_cast<uint>(worldId) == m_worldId)
+ m_canUseContext = false;
+}
+
void WebChannelIPCTransport::OnDestruct()
{
delete this;
diff --git a/src/core/renderer/web_channel_ipc_transport.h b/src/core/renderer/web_channel_ipc_transport.h
index 15778a7bc..95aa39850 100644
--- a/src/core/renderer/web_channel_ipc_transport.h
+++ b/src/core/renderer/web_channel_ipc_transport.h
@@ -1,48 +1,12 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef WEB_CHANNEL_IPC_TRANSPORT_H
#define WEB_CHANNEL_IPC_TRANSPORT_H
#include "content/public/renderer/render_frame_observer.h"
-#include "services/service_manager/public/cpp/binder_registry.h"
-#include "mojo/public/cpp/bindings/associated_receiver_set.h"
+#include "mojo/public/cpp/bindings/associated_receiver.h"
+#include "mojo/public/cpp/bindings/associated_remote.h"
#include "mojo/public/cpp/bindings/pending_associated_receiver.h"
#include "qtwebengine/browser/qtwebchannel.mojom.h"
@@ -61,11 +25,11 @@ private:
// qtwebchannel::mojom::WebChannelTransportRender
void SetWorldId(uint32_t worldId) override;
void ResetWorldId() override;
- void DispatchWebChannelMessage(const std::vector<uint8_t> &binaryJson, uint32_t worldId) override;
+ void DispatchWebChannelMessage(const std::vector<uint8_t> &json, uint32_t worldId) override;
// RenderFrameObserver
+ void DidCreateScriptContext(v8::Local<v8::Context> context, int32_t worldId) override;
void WillReleaseScriptContext(v8::Local<v8::Context> context, int worldId) override;
- void DidClearWindowObject() override;
void OnDestruct() override;
void BindReceiver(mojo::PendingAssociatedReceiver<qtwebchannel::mojom::WebChannelTransportRender> receiver);
@@ -76,7 +40,7 @@ private:
bool m_worldInitialized;
// True means it's currently OK to manipulate the frame's script context.
bool m_canUseContext = false;
- mojo::AssociatedReceiverSet<qtwebchannel::mojom::WebChannelTransportRender> m_receivers;
+ mojo::AssociatedReceiver<qtwebchannel::mojom::WebChannelTransportRender> m_binding;
};
} // namespace
diff --git a/src/core/renderer/web_engine_page_render_frame.cpp b/src/core/renderer/web_engine_page_render_frame.cpp
new file mode 100644
index 000000000..1e7ac62fc
--- /dev/null
+++ b/src/core/renderer/web_engine_page_render_frame.cpp
@@ -0,0 +1,66 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "renderer/web_engine_page_render_frame.h"
+#include "content/public/renderer/render_frame.h"
+#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h"
+
+#include "third_party/blink/public/platform/web_string.h"
+#include "third_party/blink/public/web/web_frame_content_dumper.h"
+#include "third_party/blink/public/web/web_local_frame.h"
+#include "third_party/blink/public/web/web_view.h"
+
+namespace QtWebEngineCore {
+
+WebEnginePageRenderFrame::WebEnginePageRenderFrame(content::RenderFrame *render_frame)
+ : content::RenderFrameObserver(render_frame), m_binding(this), m_ready(false)
+{
+ render_frame->GetAssociatedInterfaceRegistry()->AddInterface<qtwebenginepage::mojom::WebEnginePageRenderFrame>(
+ base::BindRepeating(&WebEnginePageRenderFrame::BindReceiver, base::Unretained(this)));
+}
+
+void WebEnginePageRenderFrame::BindReceiver(
+ mojo::PendingAssociatedReceiver<qtwebenginepage::mojom::WebEnginePageRenderFrame> receiver)
+{
+ m_binding.Bind(std::move(receiver));
+}
+
+void WebEnginePageRenderFrame::FetchDocumentMarkup(uint64_t requestId,
+ FetchDocumentMarkupCallback callback)
+{
+ blink::WebLocalFrame *frame = render_frame()->GetWebFrame();
+ blink::WebString markup;
+ if (m_ready)
+ markup = blink::WebFrameContentDumper::DumpAsMarkup(frame);
+ else
+ markup = blink::WebString::FromUTF8("<html><head></head><body></body></html>");
+ std::move(callback).Run(requestId, markup.Utf8());
+}
+
+void WebEnginePageRenderFrame::FetchDocumentInnerText(uint64_t requestId,
+ FetchDocumentInnerTextCallback callback)
+{
+ blink::WebLocalFrame *frame = render_frame()->GetWebFrame();
+ blink::WebString text;
+ if (m_ready) {
+ text = blink::WebFrameContentDumper::DumpFrameTreeAsText(
+ frame, std::numeric_limits<int32_t>::max());
+ }
+ std::move(callback).Run(requestId, text.Utf8());
+}
+
+void WebEnginePageRenderFrame::SetBackgroundColor(uint32_t color)
+{
+ render_frame()->GetWebFrame()->View()->SetBaseBackgroundColorOverrideForInspector(color);
+}
+
+void WebEnginePageRenderFrame::OnDestruct()
+{
+ delete this;
+}
+
+void WebEnginePageRenderFrame::DidFinishLoad()
+{
+ m_ready = true;
+}
+}
diff --git a/src/core/renderer/web_engine_page_render_frame.h b/src/core/renderer/web_engine_page_render_frame.h
new file mode 100644
index 000000000..7d0e25267
--- /dev/null
+++ b/src/core/renderer/web_engine_page_render_frame.h
@@ -0,0 +1,41 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+#ifndef WEB_ENGINE_PAGE_RENDER_FRAME_H
+#define WEB_ENGINE_PAGE_RENDER_FRAME_H
+
+#include "content/public/renderer/render_frame_observer.h"
+#include "mojo/public/cpp/bindings/associated_receiver.h"
+#include "qtwebengine/browser/qtwebenginepage.mojom.h"
+
+namespace content {
+class RenderFrame;
+}
+
+namespace QtWebEngineCore {
+
+class WebEnginePageRenderFrame : private content::RenderFrameObserver,
+ public qtwebenginepage::mojom::WebEnginePageRenderFrame
+{
+public:
+ WebEnginePageRenderFrame(content::RenderFrame *render_frame);
+ WebEnginePageRenderFrame(const WebEnginePageRenderFrame &) = delete;
+ WebEnginePageRenderFrame &operator=(const WebEnginePageRenderFrame &) = delete;
+
+private:
+ void FetchDocumentMarkup(uint64_t requestId, FetchDocumentMarkupCallback callback) override;
+ void FetchDocumentInnerText(uint64_t requestId,
+ FetchDocumentInnerTextCallback callback) override;
+ void SetBackgroundColor(uint32_t color) override;
+ void OnDestruct() override;
+ void DidFinishLoad() override;
+ void
+ BindReceiver(mojo::PendingAssociatedReceiver<qtwebenginepage::mojom::WebEnginePageRenderFrame>
+ receiver);
+
+private:
+ mojo::AssociatedReceiver<qtwebenginepage::mojom::WebEnginePageRenderFrame> m_binding;
+ bool m_ready;
+};
+} // namespace QtWebEngineCore
+
+#endif // WEB_ENGINE_PAGE_RENDER_FRAME_H
diff --git a/src/core/renderer_host/pepper/pepper_flash_browser_host_qt.cpp b/src/core/renderer_host/pepper/pepper_flash_browser_host_qt.cpp
deleted file mode 100644
index d54a9cdf2..000000000
--- a/src/core/renderer_host/pepper/pepper_flash_browser_host_qt.cpp
+++ /dev/null
@@ -1,137 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-// This is based on chrome/browser/renderer_host/pepper/pepper_flash_browser_host.cc:
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE.Chromium file.
-
-#include "pepper_flash_browser_host_qt.h"
-
-#include "base/time/time.h"
-#include "content/public/browser/browser_context.h"
-#include "content/public/browser/browser_ppapi_host.h"
-#include "content/public/browser/browser_thread.h"
-#include "content/public/browser/render_process_host.h"
-#include "ipc/ipc_message_macros.h"
-#include "ppapi/c/pp_errors.h"
-#include "ppapi/c/private/ppb_flash.h"
-#include "ppapi/host/dispatch_host_message.h"
-#include "ppapi/proxy/ppapi_messages.h"
-#include "ppapi/proxy/resource_message_params.h"
-#include "ppapi/shared_impl/time_conversion.h"
-#include "qtwebenginecoreglobal_p.h"
-#include "url/gurl.h"
-
-#if defined(OS_WIN)
-#include <windows.h>
-#elif defined(OS_MACOSX)
-#include <CoreServices/CoreServices.h>
-#endif
-
-using content::BrowserPpapiHost;
-using content::BrowserThread;
-using content::RenderProcessHost;
-
-namespace QtWebEngineCore {
-
-PepperFlashBrowserHostQt::PepperFlashBrowserHostQt(BrowserPpapiHost* host,
- PP_Instance instance,
- PP_Resource resource)
- : ResourceHost(host->GetPpapiHost(), instance, resource),
- host_(host),
- weak_factory_(this)
-{
- int unused;
- host->GetRenderFrameIDsForInstance(instance, &render_process_id_, &unused);
-}
-
-PepperFlashBrowserHostQt::~PepperFlashBrowserHostQt() {}
-
-int32_t PepperFlashBrowserHostQt::OnResourceMessageReceived(
- const IPC::Message& msg,
- ppapi::host::HostMessageContext* context)
-{
- PPAPI_BEGIN_MESSAGE_MAP(PepperFlashBrowserHostQt, msg)
- PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(PpapiHostMsg_Flash_UpdateActivity,
- OnUpdateActivity)
- PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_Flash_GetLocalTimeZoneOffset,
- OnGetLocalTimeZoneOffset)
- PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(PpapiHostMsg_Flash_GetLocalDataRestrictions,
- OnGetLocalDataRestrictions)
- PPAPI_END_MESSAGE_MAP()
- return PP_ERROR_FAILED;
-}
-
-int32_t PepperFlashBrowserHostQt::OnUpdateActivity(ppapi::host::HostMessageContext* host_context)
-{
-#if defined(OS_WIN)
- // Reading then writing back the same value to the screensaver timeout system
- // setting resets the countdown which prevents the screensaver from turning
- // on "for a while". As long as the plugin pings us with this message faster
- // than the screensaver timeout, it won't go on.
- int value = 0;
- if (SystemParametersInfo(SPI_GETSCREENSAVETIMEOUT, 0, &value, 0))
- SystemParametersInfo(SPI_SETSCREENSAVETIMEOUT, value, NULL, 0);
-#elif defined(OS_MACOSX)
- UpdateSystemActivity(OverallAct);
-#endif
- return PP_OK;
-}
-
-int32_t PepperFlashBrowserHostQt::OnGetLocalTimeZoneOffset(
- ppapi::host::HostMessageContext* host_context,
- const base::Time& t)
-{
- // The reason for this processing being in the browser process is that on
- // Linux, the localtime calls require filesystem access prohibited by the
- // sandbox.
- host_context->reply_msg = PpapiPluginMsg_Flash_GetLocalTimeZoneOffsetReply(
- ppapi::PPGetLocalTimeZoneOffset(t));
- return PP_OK;
-}
-
-int32_t PepperFlashBrowserHostQt::OnGetLocalDataRestrictions(
- ppapi::host::HostMessageContext* context)
-{
- QT_NOT_YET_IMPLEMENTED
- return PP_OK;
-}
-
-} // namespace QtWebEngineCore
diff --git a/src/core/renderer_host/pepper/pepper_flash_browser_host_qt.h b/src/core/renderer_host/pepper/pepper_flash_browser_host_qt.h
deleted file mode 100644
index 5d1107dfb..000000000
--- a/src/core/renderer_host/pepper/pepper_flash_browser_host_qt.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef PEPPER_FLASH_BROWSER_HOST_QT_H
-#define PEPPER_FLASH_BROWSER_HOST_QT_H
-
-#include "base/memory/ref_counted.h"
-#include "base/memory/weak_ptr.h"
-#include "ppapi/host/host_message_context.h"
-#include "ppapi/host/resource_host.h"
-
-namespace base {
-class Time;
-}
-
-namespace content {
-class BrowserPpapiHost;
-class ResourceContext;
-}
-
-class GURL;
-
-namespace QtWebEngineCore {
-
-class PepperFlashBrowserHostQt : public ppapi::host::ResourceHost {
-public:
- PepperFlashBrowserHostQt(content::BrowserPpapiHost* host,
- PP_Instance instance,
- PP_Resource resource);
- ~PepperFlashBrowserHostQt() override;
-
- // ppapi::host::ResourceHost override.
- int32_t OnResourceMessageReceived(
- const IPC::Message& msg,
- ppapi::host::HostMessageContext* context) override;
-
-private:
- int32_t OnUpdateActivity(ppapi::host::HostMessageContext* host_context);
- int32_t OnGetLocalTimeZoneOffset(
- ppapi::host::HostMessageContext* host_context,
- const base::Time& t);
- int32_t OnGetLocalDataRestrictions(ppapi::host::HostMessageContext* context);
-
- void GetLocalDataRestrictions(ppapi::host::ReplyMessageContext reply_context,
- const GURL& document_url,
- const GURL& plugin_url);
-
- content::BrowserPpapiHost* host_;
- int render_process_id_;
- base::WeakPtrFactory<PepperFlashBrowserHostQt> weak_factory_;
-
- DISALLOW_COPY_AND_ASSIGN(PepperFlashBrowserHostQt);
-};
-
-} // namespace QtWebEngineCore
-
-#endif // PEPPER_FLASH_BROWSER_HOST_QT_H
diff --git a/src/core/renderer_host/pepper/pepper_host_factory_qt.cpp b/src/core/renderer_host/pepper/pepper_host_factory_qt.cpp
deleted file mode 100644
index 00ab4963b..000000000
--- a/src/core/renderer_host/pepper/pepper_host_factory_qt.cpp
+++ /dev/null
@@ -1,113 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-// This is based on chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory.cc:
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE.Chromium file.
-
-#include "pepper_host_factory_qt.h"
-
-#include "base/memory/ptr_util.h"
-#include "build/build_config.h"
-#include "chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.h"
-#include "content/public/browser/browser_ppapi_host.h"
-#include "ppapi/host/message_filter_host.h"
-#include "ppapi/host/ppapi_host.h"
-#include "ppapi/host/resource_host.h"
-#include "ppapi/proxy/ppapi_messages.h"
-#include "ppapi/shared_impl/ppapi_permissions.h"
-
-#include "pepper_flash_browser_host_qt.h"
-#include "pepper_isolated_file_system_message_filter.h"
-
-using ppapi::host::MessageFilterHost;
-using ppapi::host::ResourceMessageFilter;
-
-namespace QtWebEngineCore {
-
-PepperHostFactoryQt::PepperHostFactoryQt(content::BrowserPpapiHost* host)
- : host_(host)
-{
-}
-
-PepperHostFactoryQt::~PepperHostFactoryQt() {}
-
-std::unique_ptr<ppapi::host::ResourceHost> PepperHostFactoryQt::CreateResourceHost(ppapi::host::PpapiHost* host,
- PP_Resource resource,
- PP_Instance instance,
- const IPC::Message& message)
-{
- DCHECK(host == host_->GetPpapiHost());
-
-
- if (!host_->IsValidInstance(instance))
- return nullptr;
-
- // Flash interfaces.
- if (host_->GetPpapiHost()->permissions().HasPermission(ppapi::PERMISSION_FLASH)) {
- switch (message.type()) {
- case PpapiHostMsg_Flash_Create::ID:
- return base::WrapUnique(new PepperFlashBrowserHostQt(host_, instance, resource));
- case PpapiHostMsg_FlashClipboard_Create::ID: {
- scoped_refptr<ResourceMessageFilter> clipboard_filter(new PepperFlashClipboardMessageFilter);
- return base::WrapUnique(new MessageFilterHost(
- host_->GetPpapiHost(), instance, resource, clipboard_filter));
- }
- }
- }
-
- // Permissions for the following interfaces will be checked at the
- // time of the corresponding instance's methods calls (because
- // permission check can be performed only on the UI
- // thread). Currently these interfaces are available only for
- // whitelisted apps which may not have access to the other private
- // interfaces.
- if (message.type() == PpapiHostMsg_IsolatedFileSystem_Create::ID) {
- PepperIsolatedFileSystemMessageFilter* isolated_fs_filter = PepperIsolatedFileSystemMessageFilter::Create(instance, host_);
- if (!isolated_fs_filter)
- return nullptr;
- return base::WrapUnique(
- new MessageFilterHost(host_->GetPpapiHost(), instance, resource, isolated_fs_filter));
- }
-
- return nullptr;
-}
-
-} // namespace QtWebEngineCore
diff --git a/src/core/renderer_host/pepper/pepper_host_factory_qt.h b/src/core/renderer_host/pepper/pepper_host_factory_qt.h
deleted file mode 100644
index 0446cf9e3..000000000
--- a/src/core/renderer_host/pepper/pepper_host_factory_qt.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef PEPPER_HOST_FACTORY_QT_H
-#define PEPPER_HOST_FACTORY_QT_H
-
-#include "base/compiler_specific.h"
-#include "ppapi/host/host_factory.h"
-#include "ppapi/host/resource_host.h"
-#include "ppapi/host/ppapi_host.h"
-
-namespace content {
-class BrowserPpapiHost;
-} // namespace content
-
-namespace QtWebEngineCore {
-
-class PepperHostFactoryQt final : public ppapi::host::HostFactory {
-public:
- // Non-owning pointer to the filter must outlive this class.
- explicit PepperHostFactoryQt(content::BrowserPpapiHost* host);
- ~PepperHostFactoryQt() override;
-
- virtual std::unique_ptr<ppapi::host::ResourceHost> CreateResourceHost(
- ppapi::host::PpapiHost* host,
- PP_Resource resource,
- PP_Instance instance,
- const IPC::Message& message) override;
-private:
- // Non-owning pointer.
- content::BrowserPpapiHost* host_;
-
- DISALLOW_COPY_AND_ASSIGN(PepperHostFactoryQt);
-};
-} // namespace QtWebEngineCore
-
-#endif // PEPPER_HOST_FACTORY_QT_H
diff --git a/src/core/renderer_host/pepper/pepper_isolated_file_system_message_filter.cpp b/src/core/renderer_host/pepper/pepper_isolated_file_system_message_filter.cpp
deleted file mode 100644
index 6e9efb5ad..000000000
--- a/src/core/renderer_host/pepper/pepper_isolated_file_system_message_filter.cpp
+++ /dev/null
@@ -1,135 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-// This is based on chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.cc:
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE.Chromium file.
-
-#include "pepper_isolated_file_system_message_filter.h"
-
-#include "base/macros.h"
-#include "base/task/post_task.h"
-#include "chrome/common/chrome_switches.h"
-#include "content/public/browser/browser_ppapi_host.h"
-#include "content/public/browser/browser_task_traits.h"
-#include "content/public/browser/browser_thread.h"
-#include "content/public/browser/child_process_security_policy.h"
-#include "content/public/browser/render_view_host.h"
-#include "ppapi/c/pp_errors.h"
-#include "ppapi/host/dispatch_host_message.h"
-#include "ppapi/host/host_message_context.h"
-#include "ppapi/host/ppapi_host.h"
-#include "ppapi/proxy/ppapi_messages.h"
-#include "ppapi/shared_impl/file_system_util.h"
-#include "storage/browser/file_system/isolated_context.h"
-
-namespace QtWebEngineCore {
-
-// static
-PepperIsolatedFileSystemMessageFilter* PepperIsolatedFileSystemMessageFilter::Create(PP_Instance instance, content::BrowserPpapiHost *host)
-{
- int render_process_id;
- int unused_render_frame_id;
- if (!host->GetRenderFrameIDsForInstance(instance, &render_process_id, &unused_render_frame_id))
- return nullptr;
- return new PepperIsolatedFileSystemMessageFilter(render_process_id, host->GetPpapiHost());
-}
-
-PepperIsolatedFileSystemMessageFilter::PepperIsolatedFileSystemMessageFilter(int render_process_id,
- ppapi::host::PpapiHost *ppapi_host)
- : m_render_process_id(render_process_id),
- m_ppapi_host(ppapi_host)
-{}
-
-PepperIsolatedFileSystemMessageFilter::~PepperIsolatedFileSystemMessageFilter()
-{}
-
-scoped_refptr<base::TaskRunner> PepperIsolatedFileSystemMessageFilter::OverrideTaskRunnerForMessage(const IPC::Message &)
-{
- // In order to reach ExtensionSystem, we need to get ProfileManager first.
- // ProfileManager lives in UI thread, so we need to do this in UI thread.
- return base::CreateSingleThreadTaskRunner({content::BrowserThread::UI});
-}
-
-int32_t PepperIsolatedFileSystemMessageFilter::OnResourceMessageReceived(const IPC::Message& msg, ppapi::host::HostMessageContext *context)
-{
- PPAPI_BEGIN_MESSAGE_MAP(PepperIsolatedFileSystemMessageFilter, msg)
- PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_IsolatedFileSystem_BrowserOpen, OnOpenFileSystem)
- PPAPI_END_MESSAGE_MAP()
- return PP_ERROR_FAILED;
-}
-
-int32_t PepperIsolatedFileSystemMessageFilter::OnOpenFileSystem(ppapi::host::HostMessageContext *context,
- PP_IsolatedFileSystemType_Private type)
-{
- switch (type) {
- case PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_INVALID:
- break;
- case PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_CRX:
- return PP_ERROR_NOTSUPPORTED;
- case PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_PLUGINPRIVATE:
- return OpenPluginPrivateFileSystem(context);
- }
- NOTREACHED();
- context->reply_msg = PpapiPluginMsg_IsolatedFileSystem_BrowserOpenReply(std::string());
- return PP_ERROR_FAILED;
-}
-
-int32_t PepperIsolatedFileSystemMessageFilter::OpenPluginPrivateFileSystem(ppapi::host::HostMessageContext *context)
-{
- DCHECK(m_ppapi_host);
- // Only plugins with private permission can open the filesystem.
- if (!m_ppapi_host->permissions().HasPermission(ppapi::PERMISSION_PRIVATE))
- return PP_ERROR_NOACCESS;
-
- const std::string& root_name = ppapi::IsolatedFileSystemTypeToRootName(PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_PLUGINPRIVATE);
- const std::string& fsid =
- storage::IsolatedContext::GetInstance()->RegisterFileSystemForVirtualPath(
- storage::kFileSystemTypePluginPrivate, root_name, base::FilePath());
-
- // Grant full access of isolated filesystem to renderer process.
- content::ChildProcessSecurityPolicy* policy = content::ChildProcessSecurityPolicy::GetInstance();
- policy->GrantCreateReadWriteFileSystem(m_render_process_id, fsid);
-
- context->reply_msg = PpapiPluginMsg_IsolatedFileSystem_BrowserOpenReply(fsid);
- return PP_OK;
-}
-
-} // namespace chrome
diff --git a/src/core/renderer_host/pepper/pepper_isolated_file_system_message_filter.h b/src/core/renderer_host/pepper/pepper_isolated_file_system_message_filter.h
deleted file mode 100644
index 750f7cea0..000000000
--- a/src/core/renderer_host/pepper/pepper_isolated_file_system_message_filter.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef PEPPER_ISOLATED_FILE_SYSTEM_MESSAGE_FILTER_H
-#define PEPPER_ISOLATED_FILE_SYSTEM_MESSAGE_FILTER_H
-
-#include "base/macros.h"
-#include "ppapi/c/pp_instance.h"
-#include "ppapi/c/pp_resource.h"
-#include "ppapi/c/private/ppb_isolated_file_system_private.h"
-#include "ppapi/host/resource_host.h"
-#include "ppapi/host/resource_message_filter.h"
-
-namespace content {
-class BrowserPpapiHost;
-}
-
-namespace ppapi {
-namespace host {
-struct HostMessageContext;
-} // namespace host
-} // namespace ppapi
-
-namespace QtWebEngineCore {
-
-class PepperIsolatedFileSystemMessageFilter : public ppapi::host::ResourceMessageFilter {
-public:
- static PepperIsolatedFileSystemMessageFilter *Create(PP_Instance instance, content::BrowserPpapiHost *host);
-
- // ppapi::host::ResourceMessageFilter implementation.
- scoped_refptr<base::TaskRunner> OverrideTaskRunnerForMessage(const IPC::Message &msg) override;
- int32_t OnResourceMessageReceived(const IPC::Message &msg, ppapi::host::HostMessageContext *context) override;
-
-private:
- PepperIsolatedFileSystemMessageFilter(int render_process_id, ppapi::host::PpapiHost *ppapi_host);
-
- ~PepperIsolatedFileSystemMessageFilter() override;
-
-
- int32_t OnOpenFileSystem(ppapi::host::HostMessageContext *context, PP_IsolatedFileSystemType_Private type);
- int32_t OpenPluginPrivateFileSystem(ppapi::host::HostMessageContext *context);
-
- const int m_render_process_id;
-
- // Not owned by this object.
- ppapi::host::PpapiHost* m_ppapi_host;
-
- DISALLOW_COPY_AND_ASSIGN(PepperIsolatedFileSystemMessageFilter);
-};
-
-} // namespace QtWebEngineCore
-
-#endif // PEPPER_ISOLATED_FILE_SYSTEM_MESSAGE_FILTER_H
diff --git a/src/core/renderer_host/render_view_observer_host_qt.cpp b/src/core/renderer_host/render_view_observer_host_qt.cpp
deleted file mode 100644
index 165a9d86a..000000000
--- a/src/core/renderer_host/render_view_observer_host_qt.cpp
+++ /dev/null
@@ -1,95 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "render_view_observer_host_qt.h"
-
-#include "common/qt_messages.h"
-#include "content/public/browser/render_view_host.h"
-#include "content/public/browser/web_contents.h"
-
-#include "render_widget_host_view_qt.h"
-#include "type_conversion.h"
-#include "web_contents_adapter_client.h"
-
-namespace QtWebEngineCore {
-
-RenderViewObserverHostQt::RenderViewObserverHostQt(content::WebContents *webContents, WebContentsAdapterClient *adapterClient)
- : content::WebContentsObserver(webContents)
- , m_adapterClient(adapterClient)
-{
-}
-
-void RenderViewObserverHostQt::fetchDocumentMarkup(quint64 requestId)
-{
- web_contents()->GetRenderViewHost()->Send(
- new RenderViewObserverQt_FetchDocumentMarkup(
- web_contents()->GetRenderViewHost()->GetRoutingID(), requestId));
-}
-
-void RenderViewObserverHostQt::fetchDocumentInnerText(quint64 requestId)
-{
- web_contents()->GetRenderViewHost()->Send(
- new RenderViewObserverQt_FetchDocumentInnerText(
- web_contents()->GetRenderViewHost()->GetRoutingID(), requestId));
-}
-
-bool RenderViewObserverHostQt::OnMessageReceived(const IPC::Message &message)
-{
- bool handled = true;
- IPC_BEGIN_MESSAGE_MAP(RenderViewObserverHostQt, message)
- IPC_MESSAGE_HANDLER(RenderViewObserverHostQt_DidFetchDocumentMarkup,
- onDidFetchDocumentMarkup)
- IPC_MESSAGE_HANDLER(RenderViewObserverHostQt_DidFetchDocumentInnerText,
- onDidFetchDocumentInnerText)
- IPC_MESSAGE_UNHANDLED(handled = false)
- IPC_END_MESSAGE_MAP()
- return handled;
-}
-
-void RenderViewObserverHostQt::onDidFetchDocumentMarkup(quint64 requestId, const base::string16 &markup)
-{
- m_adapterClient->didFetchDocumentMarkup(requestId, toQt(markup));
-}
-
-void RenderViewObserverHostQt::onDidFetchDocumentInnerText(quint64 requestId, const base::string16 &innerText)
-{
- m_adapterClient->didFetchDocumentInnerText(requestId, toQt(innerText));
-}
-
-} // namespace QtWebEngineCore
diff --git a/src/core/renderer_host/render_view_observer_host_qt.h b/src/core/renderer_host/render_view_observer_host_qt.h
deleted file mode 100644
index 8590ecbc5..000000000
--- a/src/core/renderer_host/render_view_observer_host_qt.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef RENDER_VIEW_OBSERVER_HOST_QT_H
-#define RENDER_VIEW_OBSERVER_HOST_QT_H
-
-#include "content/public/browser/web_contents_observer.h"
-
-#include <QtGlobal>
-
-namespace content {
-class WebContents;
-}
-
-namespace QtWebEngineCore {
-
-class WebContentsAdapterClient;
-
-class RenderViewObserverHostQt : public content::WebContentsObserver
-{
-public:
- RenderViewObserverHostQt(content::WebContents *, WebContentsAdapterClient *adapterClient);
- void fetchDocumentMarkup(quint64 requestId);
- void fetchDocumentInnerText(quint64 requestId);
-
-private:
- bool OnMessageReceived(const IPC::Message &message) override;
- void onDidFetchDocumentMarkup(quint64 requestId, const base::string16 &markup);
- void onDidFetchDocumentInnerText(quint64 requestId, const base::string16 &innerText);
-
- WebContentsAdapterClient *m_adapterClient;
-};
-
-} // namespace QtWebEngineCore
-
-#endif // RENDER_VIEW_OBSERVER_HOST_QT_H
diff --git a/src/core/renderer_host/user_resource_controller_host.cpp b/src/core/renderer_host/user_resource_controller_host.cpp
index 6b9bb63fe..f2a00fc72 100644
--- a/src/core/renderer_host/user_resource_controller_host.cpp
+++ b/src/core/renderer_host/user_resource_controller_host.cpp
@@ -1,53 +1,20 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "user_resource_controller_host.h"
-#include "common/qt_messages.h"
#include "type_conversion.h"
#include "web_contents_adapter.h"
+
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_process_host_observer.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h"
+#include "ipc/ipc_channel_proxy.h"
+#include "qtwebengine/userscript/userscript.mojom.h"
+#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
namespace QtWebEngineCore {
@@ -59,6 +26,7 @@ public:
// WebContentsObserver overrides:
void RenderFrameCreated(content::RenderFrameHost *renderFrameHost) override;
void RenderFrameHostChanged(content::RenderFrameHost *oldHost, content::RenderFrameHost *newHost) override;
+ void RenderFrameDeleted(content::RenderFrameHost *render_frame_host) override;
void WebContentsDestroyed() override;
private:
@@ -75,16 +43,25 @@ UserResourceControllerHost::WebContentsObserverHelper::WebContentsObserverHelper
void UserResourceControllerHost::WebContentsObserverHelper::RenderFrameCreated(content::RenderFrameHost *renderFrameHost)
{
content::WebContents *contents = web_contents();
+ auto &remote = m_controllerHost->GetUserResourceControllerRenderFrame(renderFrameHost);
const QList<UserScript> scripts = m_controllerHost->m_perContentsScripts.value(contents);
for (const UserScript &script : scripts)
- renderFrameHost->Send(new RenderFrameObserverHelper_AddScript(renderFrameHost->GetRoutingID(), script.data()));
+ remote->AddScript(script.data());
}
void UserResourceControllerHost::WebContentsObserverHelper::RenderFrameHostChanged(content::RenderFrameHost *oldHost,
content::RenderFrameHost *newHost)
{
- if (oldHost)
- oldHost->Send(new RenderFrameObserverHelper_ClearScripts(oldHost->GetRoutingID()));
+ if (oldHost) {
+ auto &remote = m_controllerHost->GetUserResourceControllerRenderFrame(oldHost);
+ remote->ClearScripts();
+ }
+}
+
+void UserResourceControllerHost::WebContentsObserverHelper::RenderFrameDeleted(
+ content::RenderFrameHost *render_frame_host)
+{
+ m_controllerHost->m_renderFrames.erase(render_frame_host);
}
void UserResourceControllerHost::WebContentsObserverHelper::WebContentsDestroyed()
@@ -111,20 +88,19 @@ UserResourceControllerHost::RenderProcessObserverHelper::RenderProcessObserverHe
void UserResourceControllerHost::RenderProcessObserverHelper::RenderProcessHostDestroyed(content::RenderProcessHost *renderer)
{
Q_ASSERT(m_controllerHost);
+ delete m_controllerHost->m_observedProcesses[renderer];
m_controllerHost->m_observedProcesses.remove(renderer);
}
void UserResourceControllerHost::addUserScript(const UserScript &script, WebContentsAdapter *adapter)
{
- if (script.isNull())
- return;
// Global scripts should be dispatched to all our render processes.
const bool isProfileWideScript = !adapter;
if (isProfileWideScript) {
if (!m_profileWideScripts.contains(script)) {
m_profileWideScripts.append(script);
- for (content::RenderProcessHost *renderer : qAsConst(m_observedProcesses))
- renderer->Send(new UserResourceController_AddScript(script.data()));
+ for (auto controller : m_observedProcesses.values())
+ (*controller)->AddScript(script.data());
}
} else {
content::WebContents *contents = adapter->webContents();
@@ -141,24 +117,20 @@ void UserResourceControllerHost::addUserScript(const UserScript &script, WebCont
m_perContentsScripts.insert(contents, currentScripts);
}
}
- contents->GetRenderViewHost()->Send(
- new RenderFrameObserverHelper_AddScript(
- contents->GetRenderViewHost()->GetMainFrame()->GetRoutingID(),
- script.data()));
+ GetUserResourceControllerRenderFrame(contents->GetPrimaryMainFrame())
+ ->AddScript(script.data());
}
}
bool UserResourceControllerHost::removeUserScript(const UserScript &script, WebContentsAdapter *adapter)
{
- if (script.isNull())
- return false;
const bool isProfileWideScript = !adapter;
if (isProfileWideScript) {
QList<UserScript>::iterator it = std::find(m_profileWideScripts.begin(), m_profileWideScripts.end(), script);
if (it == m_profileWideScripts.end())
return false;
- for (content::RenderProcessHost *renderer : qAsConst(m_observedProcesses))
- renderer->Send(new UserResourceController_RemoveScript((*it).data()));
+ for (auto controller : m_observedProcesses.values())
+ (*controller)->RemoveScript((*it).data());
m_profileWideScripts.erase(it);
} else {
content::WebContents *contents = adapter->webContents();
@@ -168,8 +140,8 @@ bool UserResourceControllerHost::removeUserScript(const UserScript &script, WebC
QList<UserScript>::iterator it = std::find(list.begin(), list.end(), script);
if (it == list.end())
return false;
- contents->GetRenderViewHost()->Send(
- new RenderFrameObserverHelper_RemoveScript(contents->GetMainFrame()->GetRoutingID(), (*it).data()));
+ GetUserResourceControllerRenderFrame(contents->GetPrimaryMainFrame())
+ ->RemoveScript((*it).data());
list.erase(it);
}
return true;
@@ -180,13 +152,15 @@ void UserResourceControllerHost::clearAllScripts(WebContentsAdapter *adapter)
const bool isProfileWideScript = !adapter;
if (isProfileWideScript) {
m_profileWideScripts.clear();
- for (content::RenderProcessHost *renderer : qAsConst(m_observedProcesses))
- renderer->Send(new UserResourceController_ClearScripts);
+ for (auto controller : m_observedProcesses.values())
+ (*controller)->ClearScripts();
} else {
content::WebContents *contents = adapter->webContents();
m_perContentsScripts.remove(contents);
- contents->GetRenderViewHost()->Send(
- new RenderFrameObserverHelper_ClearScripts(contents->GetMainFrame()->GetRoutingID()));
+ mojo::AssociatedRemote<qtwebengine::mojom::UserResourceControllerRenderFrame>
+ userResourceController;
+ GetUserResourceControllerRenderFrame(contents->GetPrimaryMainFrame())
+ ->ClearScripts();
}
}
@@ -201,15 +175,18 @@ void UserResourceControllerHost::reserve(WebContentsAdapter *adapter, int count)
void UserResourceControllerHost::renderProcessStartedWithHost(content::RenderProcessHost *renderer)
{
- if (m_observedProcesses.contains(renderer))
+ if (m_observedProcesses.keys().contains(renderer))
return;
if (m_renderProcessObserver.isNull())
m_renderProcessObserver.reset(new RenderProcessObserverHelper(this));
renderer->AddObserver(m_renderProcessObserver.data());
- m_observedProcesses.insert(renderer);
- for (const UserScript &script : qAsConst(m_profileWideScripts))
- renderer->Send(new UserResourceController_AddScript(script.data()));
+ auto userResourceController = new UserResourceControllerRemote;
+ renderer->GetChannel()->GetRemoteAssociatedInterface(userResourceController);
+ m_observedProcesses.insert(renderer, userResourceController);
+ for (const UserScript &script : std::as_const(m_profileWideScripts)) {
+ (*userResourceController)->AddScript(script.data());
+ }
}
void UserResourceControllerHost::webContentsDestroyed(content::WebContents *contents)
@@ -223,8 +200,26 @@ UserResourceControllerHost::UserResourceControllerHost()
UserResourceControllerHost::~UserResourceControllerHost()
{
- for (content::RenderProcessHost *renderer : qAsConst(m_observedProcesses))
+ for (content::RenderProcessHost *renderer : m_observedProcesses.keys()) {
renderer->RemoveObserver(m_renderProcessObserver.data());
+ delete m_observedProcesses[renderer];
+ }
+}
+
+const UserResourceControllerRenderFrameRemote &
+UserResourceControllerHost::GetUserResourceControllerRenderFrame(content::RenderFrameHost *rfh)
+{
+ auto it = m_renderFrames.find(rfh);
+ if (it == m_renderFrames.end()) {
+ UserResourceControllerRenderFrameRemote remote;
+ rfh->GetRemoteAssociatedInterfaces()->GetInterface(remote.BindNewEndpointAndPassReceiver());
+ it = m_renderFrames.insert(std::make_pair(rfh, std::move(remote))).first;
+ } else if (it->second.is_bound() && !it->second.is_connected()) {
+ it->second.reset();
+ rfh->GetRemoteAssociatedInterfaces()->GetInterface(&it->second);
+ }
+
+ return it->second;
}
} // namespace
diff --git a/src/core/renderer_host/user_resource_controller_host.h b/src/core/renderer_host/user_resource_controller_host.h
index 7b89cb893..eb4404879 100644
--- a/src/core/renderer_host/user_resource_controller_host.h
+++ b/src/core/renderer_host/user_resource_controller_host.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
//
// W A R N I N G
@@ -53,20 +17,37 @@
#include "qtwebenginecoreglobal_p.h"
-#include <QtCore/QSet>
+#include <QtCore/QHash>
#include <QtCore/QScopedPointer>
+#include <map>
#include "user_script.h"
namespace content {
class RenderProcessHost;
class WebContents;
+class RenderFrameHost;
+}
+
+namespace mojo {
+template <typename Type>
+class AssociatedRemote;
+}
+
+namespace qtwebengine {
+namespace mojom {
+class UserResourceController;
+class UserResourceControllerRenderFrame;
+}
}
namespace QtWebEngineCore {
+class UserScript;
+using UserResourceControllerRemote = mojo::AssociatedRemote<qtwebengine::mojom::UserResourceController>;
+using UserResourceControllerRenderFrameRemote = mojo::AssociatedRemote<qtwebengine::mojom::UserResourceControllerRenderFrame>;
class WebContentsAdapter;
-class Q_WEBENGINECORE_PRIVATE_EXPORT UserResourceControllerHost
+class Q_WEBENGINECORE_EXPORT UserResourceControllerHost
{
public:
@@ -86,12 +67,15 @@ private:
class RenderProcessObserverHelper;
void webContentsDestroyed(content::WebContents *);
+ const UserResourceControllerRenderFrameRemote &
+ GetUserResourceControllerRenderFrame(content::RenderFrameHost *rfh);
QList<UserScript> m_profileWideScripts;
typedef QHash<content::WebContents *, QList<UserScript>> ContentsScriptsMap;
ContentsScriptsMap m_perContentsScripts;
- QSet<content::RenderProcessHost *> m_observedProcesses;
+ QHash<content::RenderProcessHost *, UserResourceControllerRemote *> m_observedProcesses;
QScopedPointer<RenderProcessObserverHelper> m_renderProcessObserver;
+ std::map<content::RenderFrameHost *, UserResourceControllerRenderFrameRemote> m_renderFrames;
};
} // namespace
diff --git a/src/core/renderer_host/web_channel_ipc_transport_host.cpp b/src/core/renderer_host/web_channel_ipc_transport_host.cpp
index 9ed3749ad..0824ed56d 100644
--- a/src/core/renderer_host/web_channel_ipc_transport_host.cpp
+++ b/src/core/renderer_host/web_channel_ipc_transport_host.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "web_channel_ipc_transport_host.h"
@@ -46,7 +10,6 @@
#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h"
#include "services/service_manager/public/cpp/interface_provider.h"
#include "qtwebengine/browser/qtwebchannel.mojom.h"
-#include "common/qt_messages.h"
#include <QJsonDocument>
#include <QJsonObject>
@@ -61,23 +24,15 @@ inline QDebug operator<<(QDebug stream, content::RenderFrameHost *frame)
return stream << "frame " << frame->GetRoutingID() << " in process " << frame->GetProcess()->GetID();
}
-template<class T>
-inline QDebug operator<<(QDebug stream, const base::Optional<T> &opt)
-{
- if (opt)
- return stream << *opt;
- else
- return stream << "nullopt";
-}
-
WebChannelIPCTransportHost::WebChannelIPCTransportHost(content::WebContents *contents, uint worldId, QObject *parent)
: QWebChannelAbstractTransport(parent)
, content::WebContentsObserver(contents)
, m_worldId(worldId)
, m_receiver(contents, this)
{
- for (content::RenderFrameHost *frame : contents->GetAllFrames())
- setWorldId(frame, worldId);
+ contents->ForEachRenderFrameHost([this, worldId](content::RenderFrameHost *frame) {
+ setWorldId(frame, worldId);
+ });
}
WebChannelIPCTransportHost::~WebChannelIPCTransportHost()
@@ -93,21 +48,20 @@ uint WebChannelIPCTransportHost::worldId() const
void WebChannelIPCTransportHost::sendMessage(const QJsonObject &message)
{
QJsonDocument doc(message);
- int size = 0;
- const char *rawData = doc.rawData(&size);
- content::RenderFrameHost *frame = web_contents()->GetMainFrame();
- mojo::AssociatedRemote<qtwebchannel::mojom::WebChannelTransportRender> webChannelTransport;
- frame->GetRemoteAssociatedInterfaces()->GetInterface(&webChannelTransport);
+ QByteArray json = doc.toJson(QJsonDocument::Compact);
+ content::RenderFrameHost *frame = web_contents()->GetPrimaryMainFrame();
qCDebug(log).nospace() << "sending webchannel message to " << frame << ": " << doc;
- webChannelTransport->DispatchWebChannelMessage(std::vector<uint8_t>(rawData, rawData + size), m_worldId);
+ GetWebChannelIPCTransportRemote(frame)->DispatchWebChannelMessage(
+ std::vector<uint8_t>(json.begin(), json.end()), m_worldId);
}
void WebChannelIPCTransportHost::setWorldId(uint32_t worldId)
{
if (m_worldId == worldId)
return;
- for (content::RenderFrameHost *frame : web_contents()->GetAllFrames())
- setWorldId(frame, worldId);
+ web_contents()->ForEachRenderFrameHost([this, worldId](content::RenderFrameHost *frame) {
+ setWorldId(frame, worldId);
+ });
m_worldId = worldId;
}
@@ -116,31 +70,28 @@ void WebChannelIPCTransportHost::setWorldId(content::RenderFrameHost *frame, uin
if (!frame->IsRenderFrameLive())
return;
qCDebug(log).nospace() << "sending setWorldId(" << worldId << ") message to " << frame;
- mojo::AssociatedRemote<qtwebchannel::mojom::WebChannelTransportRender> webChannelTransport;
- frame->GetRemoteAssociatedInterfaces()->GetInterface(&webChannelTransport);
- webChannelTransport->SetWorldId(worldId);
+ GetWebChannelIPCTransportRemote(frame)->SetWorldId(worldId);
}
void WebChannelIPCTransportHost::resetWorldId()
{
- for (content::RenderFrameHost *frame : web_contents()->GetAllFrames()) {
+ web_contents()->ForEachRenderFrameHost([this] (content::RenderFrameHost *frame) {
if (!frame->IsRenderFrameLive())
return;
- mojo::AssociatedRemote<qtwebchannel::mojom::WebChannelTransportRender> webChannelTransport;
- frame->GetRemoteAssociatedInterfaces()->GetInterface(&webChannelTransport);
- webChannelTransport->ResetWorldId();
- }
+ GetWebChannelIPCTransportRemote(frame)->ResetWorldId();
+ });
}
-void WebChannelIPCTransportHost::DispatchWebChannelMessage(const std::vector<uint8_t> &binaryJson)
+void WebChannelIPCTransportHost::DispatchWebChannelMessage(const std::vector<uint8_t> &json)
{
- content::RenderFrameHost *frame = web_contents()->GetMainFrame();
+ content::RenderFrameHost *frame = web_contents()->GetPrimaryMainFrame();
if (m_receiver.GetCurrentTargetFrame() != frame) {
return;
}
- QJsonDocument doc = QJsonDocument::fromRawData(reinterpret_cast<const char *>(binaryJson.data()), binaryJson.size());
+ QJsonDocument doc = QJsonDocument::fromJson(
+ QByteArray(reinterpret_cast<const char *>(json.data()), json.size()));
if (!doc.isObject()) {
qCCritical(log).nospace() << "received invalid webchannel message from " << frame;
@@ -156,4 +107,33 @@ void WebChannelIPCTransportHost::RenderFrameCreated(content::RenderFrameHost *fr
setWorldId(frame, m_worldId);
}
+void WebChannelIPCTransportHost::RenderFrameDeleted(content::RenderFrameHost *rfh)
+{
+ m_renderFrames.erase(rfh);
+}
+
+void WebChannelIPCTransportHost::BindReceiver(
+ mojo::PendingAssociatedReceiver<qtwebchannel::mojom::WebChannelTransportHost> receiver,
+ content::RenderFrameHost *rfh)
+{
+ m_receiver.Bind(rfh, std::move(receiver));
+}
+
+
+const mojo::AssociatedRemote<qtwebchannel::mojom::WebChannelTransportRender> &
+WebChannelIPCTransportHost::GetWebChannelIPCTransportRemote(content::RenderFrameHost *rfh)
+{
+ auto it = m_renderFrames.find(rfh);
+ if (it == m_renderFrames.end()) {
+ mojo::AssociatedRemote<qtwebchannel::mojom::WebChannelTransportRender> remote;
+ rfh->GetRemoteAssociatedInterfaces()->GetInterface(remote.BindNewEndpointAndPassReceiver());
+ it = m_renderFrames.insert(std::make_pair(rfh, std::move(remote))).first;
+ } else if (it->second.is_bound() && !it->second.is_connected()) {
+ it->second.reset();
+ rfh->GetRemoteAssociatedInterfaces()->GetInterface(&it->second);
+ }
+
+ return it->second;
+}
+
} // namespace QtWebEngineCore
diff --git a/src/core/renderer_host/web_channel_ipc_transport_host.h b/src/core/renderer_host/web_channel_ipc_transport_host.h
index a1575355a..9e003c222 100644
--- a/src/core/renderer_host/web_channel_ipc_transport_host.h
+++ b/src/core/renderer_host/web_channel_ipc_transport_host.h
@@ -1,52 +1,17 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef WEB_CHANNEL_IPC_TRANSPORT_H
#define WEB_CHANNEL_IPC_TRANSPORT_H
#include "qtwebenginecoreglobal.h"
+#include "content/public/browser/render_frame_host_receiver_set.h"
#include "content/public/browser/web_contents_observer.h"
-#include "content/public/browser/web_contents_receiver_set.h"
#include "qtwebengine/browser/qtwebchannel.mojom.h"
#include <QWebChannelAbstractTransport>
+#include <map>
QT_FORWARD_DECLARE_CLASS(QString)
@@ -67,21 +32,31 @@ public:
// QWebChannelAbstractTransport
void sendMessage(const QJsonObject &message) override;
+ void BindReceiver(
+ mojo::PendingAssociatedReceiver<qtwebchannel::mojom::WebChannelTransportHost> receiver,
+ content::RenderFrameHost *rfh);
+
private:
void setWorldId(content::RenderFrameHost *frame, uint32_t worldId);
void resetWorldId();
- void onWebChannelMessage(const std::vector<char> &message);
+
+ const mojo::AssociatedRemote<qtwebchannel::mojom::WebChannelTransportRender> &
+ GetWebChannelIPCTransportRemote(content::RenderFrameHost *rfh);
// WebContentsObserver
void RenderFrameCreated(content::RenderFrameHost *frame) override;
+ void RenderFrameDeleted(content::RenderFrameHost *render_frame_host) override;
// qtwebchannel::mojom::WebChannelTransportHost
- void DispatchWebChannelMessage(const std::vector<uint8_t> &binaryJson) override;
+ void DispatchWebChannelMessage(const std::vector<uint8_t> &json) override;
// Empty only during construction/destruction. Synchronized to all the
// WebChannelIPCTransports/RenderFrames in the observed WebContents.
uint32_t m_worldId;
- content::WebContentsFrameReceiverSet<qtwebchannel::mojom::WebChannelTransportHost> m_receiver;
+ content::RenderFrameHostReceiverSet<qtwebchannel::mojom::WebChannelTransportHost> m_receiver;
+ std::map<content::RenderFrameHost *,
+ mojo::AssociatedRemote<qtwebchannel::mojom::WebChannelTransportRender>>
+ m_renderFrames;
};
} // namespace
diff --git a/src/core/renderer_host/web_engine_page_host.cpp b/src/core/renderer_host/web_engine_page_host.cpp
new file mode 100644
index 000000000..ea9b363ea
--- /dev/null
+++ b/src/core/renderer_host/web_engine_page_host.cpp
@@ -0,0 +1,76 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "web_engine_page_host.h"
+
+#include "qtwebengine/browser/qtwebenginepage.mojom.h"
+#include "content/public/browser/web_contents.h"
+
+#include "render_widget_host_view_qt.h"
+#include "type_conversion.h"
+#include "web_contents_adapter_client.h"
+#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
+
+namespace QtWebEngineCore {
+
+WebEnginePageHost::WebEnginePageHost(content::WebContents *webContents,
+ WebContentsAdapterClient *adapterClient)
+ : content::WebContentsObserver(webContents), m_adapterClient(adapterClient)
+{
+}
+
+void WebEnginePageHost::FetchDocumentMarkup(uint64_t requestId)
+{
+ auto &remote = GetWebEnginePageRenderFrame(web_contents()->GetPrimaryMainFrame());
+ remote->FetchDocumentMarkup(
+ requestId,
+ base::BindOnce(&WebEnginePageHost::OnDidFetchDocumentMarkup, base::Unretained(this)));
+}
+
+void WebEnginePageHost::FetchDocumentInnerText(uint64_t requestId)
+{
+ auto &remote = GetWebEnginePageRenderFrame(web_contents()->GetPrimaryMainFrame());
+ remote->FetchDocumentInnerText(requestId,
+ base::BindOnce(&WebEnginePageHost::OnDidFetchDocumentInnerText,
+ base::Unretained(this)));
+}
+
+void WebEnginePageHost::OnDidFetchDocumentMarkup(uint64_t requestId, const std::string &markup)
+{
+ m_adapterClient->didFetchDocumentMarkup(requestId, toQt(markup));
+}
+
+void WebEnginePageHost::OnDidFetchDocumentInnerText(uint64_t requestId,
+ const std::string &innerText)
+{
+ m_adapterClient->didFetchDocumentInnerText(requestId, toQt(innerText));
+}
+
+void WebEnginePageHost::RenderFrameDeleted(content::RenderFrameHost *render_frame)
+{
+ m_renderFrames.erase(render_frame);
+}
+
+void WebEnginePageHost::SetBackgroundColor(uint32_t color)
+{
+ auto &remote = GetWebEnginePageRenderFrame(web_contents()->GetPrimaryMainFrame());
+ remote->SetBackgroundColor(color);
+}
+
+const WebEnginePageRenderFrameRemote &
+WebEnginePageHost::GetWebEnginePageRenderFrame(content::RenderFrameHost *rfh)
+{
+ auto it = m_renderFrames.find(rfh);
+ if (it == m_renderFrames.end()) {
+ WebEnginePageRenderFrameRemote remote;
+ rfh->GetRemoteAssociatedInterfaces()->GetInterface(remote.BindNewEndpointAndPassReceiver());
+ it = m_renderFrames.insert(std::make_pair(rfh, std::move(remote))).first;
+ } else if (it->second.is_bound() && !it->second.is_connected()) {
+ it->second.reset();
+ rfh->GetRemoteAssociatedInterfaces()->GetInterface(&it->second);
+ }
+
+ return it->second;
+}
+
+} // namespace QtWebEngineCore
diff --git a/src/core/renderer_host/web_engine_page_host.h b/src/core/renderer_host/web_engine_page_host.h
new file mode 100644
index 000000000..20b9145b2
--- /dev/null
+++ b/src/core/renderer_host/web_engine_page_host.h
@@ -0,0 +1,54 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef WEB_ENGINE_PAGE_HOST_H
+#define WEB_ENGINE_PAGE_HOST_H
+
+#include "content/public/browser/web_contents_observer.h"
+
+#include <QtGlobal>
+
+namespace content {
+class WebContents;
+}
+
+namespace mojo {
+template<typename Type>
+class AssociatedRemote;
+}
+
+namespace qtwebenginepage {
+namespace mojom {
+class WebEnginePageRenderFrame;
+}
+}
+
+namespace QtWebEngineCore {
+
+using WebEnginePageRenderFrameRemote = mojo::AssociatedRemote<qtwebenginepage::mojom::WebEnginePageRenderFrame>;
+
+class WebContentsAdapterClient;
+
+class WebEnginePageHost : public content::WebContentsObserver
+{
+public:
+ WebEnginePageHost(content::WebContents *, WebContentsAdapterClient *adapterClient);
+ void FetchDocumentMarkup(uint64_t requestId);
+ void FetchDocumentInnerText(uint64_t requestId);
+ void RenderFrameDeleted(content::RenderFrameHost *render_frame) override;
+ void SetBackgroundColor(uint32_t color);
+
+private:
+ void OnDidFetchDocumentMarkup(uint64_t requestId, const std::string &markup);
+ void OnDidFetchDocumentInnerText(uint64_t requestId, const std::string &innerText);
+ const WebEnginePageRenderFrameRemote &
+ GetWebEnginePageRenderFrame(content::RenderFrameHost *rfh);
+
+private:
+ WebContentsAdapterClient *m_adapterClient;
+ std::map<content::RenderFrameHost *, WebEnginePageRenderFrameRemote> m_renderFrames;
+};
+
+} // namespace QtWebEngineCore
+
+#endif // WEB_ENGINE_PAGE_HOST_H
diff --git a/src/core/request_controller.h b/src/core/request_controller.h
index ffcf9edac..8008b2edb 100644
--- a/src/core/request_controller.h
+++ b/src/core/request_controller.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef REQUEST_CONTROLLER_H
#define REQUEST_CONTROLLER_H
diff --git a/src/core/resource_bundle_qt.cpp b/src/core/resource_bundle_qt.cpp
index 61b0f3021..693d1291f 100644
--- a/src/core/resource_bundle_qt.cpp
+++ b/src/core/resource_bundle_qt.cpp
@@ -1,46 +1,13 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "base/command_line.h"
+#include "base/files/file_util.h"
+#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
+#include "base/notreached.h"
#include "content/public/common/content_switches.h"
-#include "services/service_manager/sandbox/switches.h"
+#include "sandbox/policy/switches.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/data_pack.h"
#include "ui/base/resource/resource_bundle.h"
@@ -48,7 +15,7 @@
#include "web_engine_library_info.h"
-#if defined(OS_LINUX)
+#if BUILDFLAG(IS_LINUX)
#include "base/posix/global_descriptors.h"
#include "global_descriptors_qt.h"
#endif
@@ -58,10 +25,10 @@ namespace ui {
void ResourceBundle::LoadCommonResources()
{
// We repacked the resources we need and installed them. now let chromium mmap that file.
- AddDataPackFromPath(WebEngineLibraryInfo::getPath(QT_RESOURCES_PAK), SCALE_FACTOR_NONE);
- AddDataPackFromPath(WebEngineLibraryInfo::getPath(QT_RESOURCES_100P_PAK), SCALE_FACTOR_100P);
- AddDataPackFromPath(WebEngineLibraryInfo::getPath(QT_RESOURCES_200P_PAK), SCALE_FACTOR_200P);
- AddOptionalDataPackFromPath(WebEngineLibraryInfo::getPath(QT_RESOURCES_DEVTOOLS_PAK), SCALE_FACTOR_NONE);
+ AddDataPackFromPath(WebEngineLibraryInfo::getPath(QT_RESOURCES_100P_PAK), ui::k100Percent);
+ AddDataPackFromPath(WebEngineLibraryInfo::getPath(QT_RESOURCES_200P_PAK), ui::k200Percent);
+ AddDataPackFromPath(WebEngineLibraryInfo::getPath(QT_RESOURCES_PAK), ui::kScaleFactorNone);
+ AddOptionalDataPackFromPath(WebEngineLibraryInfo::getPath(QT_RESOURCES_DEVTOOLS_PAK), ui::kScaleFactorNone);
}
gfx::Image& ResourceBundle::GetNativeImageNamed(int resource_id)
@@ -72,10 +39,10 @@ gfx::Image& ResourceBundle::GetNativeImageNamed(int resource_id)
// static
bool ResourceBundle::LocaleDataPakExists(const std::string& locale)
{
-#if defined(OS_LINUX)
+#if BUILDFLAG(IS_LINUX)
base::CommandLine *parsed_command_line = base::CommandLine::ForCurrentProcess();
std::string process_type = parsed_command_line->GetSwitchValueASCII(switches::kProcessType);
- bool no_sandbox = parsed_command_line->HasSwitch(service_manager::switches::kNoSandbox);
+ bool no_sandbox = parsed_command_line->HasSwitch(sandbox::policy::switches::kNoSandbox);
if (process_type == switches::kRendererProcess && !no_sandbox) {
// The Renderer Process is sandboxed thus only one locale is available in it.
// The particular one is passed by the --lang command line option.
@@ -87,21 +54,22 @@ bool ResourceBundle::LocaleDataPakExists(const std::string& locale)
}
#endif
- return !GetLocaleFilePath(locale).empty();
+ const auto path = GetLocaleFilePath(locale);
+ return !path.empty() && base::PathExists(path);
}
-std::string ResourceBundle::LoadLocaleResources(const std::string& pref_locale)
+std::string ResourceBundle::LoadLocaleResources(const std::string &pref_locale, bool /*crash_on_failure*/)
{
DCHECK(!locale_resources_data_.get()) << "locale.pak already loaded";
- std::string app_locale = l10n_util::GetApplicationLocale(pref_locale);
+ std::string app_locale = l10n_util::GetApplicationLocale(pref_locale, false /* set_icu_locale */);
-#if defined(OS_LINUX)
+#if BUILDFLAG(IS_LINUX)
int locale_fd = base::GlobalDescriptors::GetInstance()->MaybeGet(kWebEngineLocale);
if (locale_fd > -1) {
- std::unique_ptr<DataPack> data_pack(new DataPack(SCALE_FACTOR_100P));
+ std::unique_ptr<DataPack> data_pack(new DataPack(ui::k100Percent));
data_pack->LoadFromFile(base::File(locale_fd));
- locale_resources_data_.reset(data_pack.release());
+ locale_resources_data_ = std::move(data_pack);
return app_locale;
}
#endif
@@ -116,7 +84,7 @@ std::string ResourceBundle::LoadLocaleResources(const std::string& pref_locale)
return std::string();
}
- std::unique_ptr<DataPack> data_pack(new DataPack(SCALE_FACTOR_100P));
+ std::unique_ptr<DataPack> data_pack(new DataPack(ui::k100Percent));
if (!data_pack->LoadFromPath(locale_file_path)) {
UMA_HISTOGRAM_ENUMERATION("ResourceBundle.LoadLocaleResourcesError",
logging::GetLastSystemErrorCode(), 16000);
@@ -125,7 +93,7 @@ std::string ResourceBundle::LoadLocaleResources(const std::string& pref_locale)
return std::string();
}
- locale_resources_data_.reset(data_pack.release());
+ locale_resources_data_ = std::move(data_pack);
return app_locale;
}
diff --git a/src/core/resource_context_qt.cpp b/src/core/resource_context_qt.cpp
deleted file mode 100644
index 79c105956..000000000
--- a/src/core/resource_context_qt.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "resource_context_qt.h"
-
-namespace QtWebEngineCore {
-
-ResourceContextQt::ResourceContextQt(ProfileIODataQt *io_data)
- : m_io_data(io_data)
-{
-}
-
-} // namespace QtWebEngineCore
diff --git a/src/core/resource_context_qt.h b/src/core/resource_context_qt.h
deleted file mode 100644
index 4107e7c24..000000000
--- a/src/core/resource_context_qt.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef RESOURCE_CONTEXT_QT_H
-#define RESOURCE_CONTEXT_QT_H
-
-#include "content/public/browser/resource_context.h"
-
-#include "extensions/buildflags/buildflags.h"
-
-namespace net {
-class URLRequestContext;
-class URLRequestContextGetter;
-}
-
-#if BUILDFLAG(ENABLE_EXTENSIONS)
-namespace extensions {
-class ExtensionSystemQt;
-}
-#endif // BUILDFLAG(ENABLE_EXTENSIONS)
-
-class GURL;
-
-namespace QtWebEngineCore {
-
-class ProfileIODataQt;
-
-class ResourceContextQt : public content::ResourceContext
-{
-public:
- ResourceContextQt(ProfileIODataQt *io_data);
-private:
- friend class ProfileIODataQt;
- ProfileIODataQt* m_io_data;
- DISALLOW_COPY_AND_ASSIGN(ResourceContextQt);
-};
-
-} // namespace QtWebEngineCore
-
-#endif // RESOURCE_CONTEXT_QT_H
diff --git a/src/core/sandbox_win.cpp b/src/core/sandbox_win.cpp
new file mode 100644
index 000000000..bc70bced7
--- /dev/null
+++ b/src/core/sandbox_win.cpp
@@ -0,0 +1,46 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qtwebenginecoreglobal_p.h"
+#include "sandbox/win/src/process_mitigations.h"
+#include "sandbox/win/src/sandbox_factory.h"
+
+#ifndef NDEBUG
+#include "base/command_line.h"
+#include "base/logging.h"
+#endif
+
+namespace QtWebEngineSandbox {
+// A duplicate of the function by same name in sandbox_helper_win.cc
+static void InitializeSandboxInfo(sandbox::SandboxInterfaceInfo *info)
+{
+ info->broker_services = sandbox::SandboxFactory::GetBrokerServices();
+ if (!info->broker_services) {
+ info->target_services = sandbox::SandboxFactory::GetTargetServices();
+ } else {
+ // Ensure the proper mitigations are enforced for the browser process.
+ info->broker_services->RatchetDownSecurityMitigations(
+ sandbox::MITIGATION_DEP | sandbox::MITIGATION_DEP_NO_ATL_THUNK |
+ sandbox::MITIGATION_HARDEN_TOKEN_IL_POLICY);
+ // Note: these mitigations are "post-startup". Some mitigations that need
+ // to be enabled sooner (e.g. MITIGATION_EXTENSION_POINT_DISABLE) are done
+ // so in Chrome_ELF.
+ }
+}
+
+// Initializes the staticlib copy of //base and //sandbox used for Windows sandboxing
+void initializeStaticCopy(int argc, const char **argv)
+{
+#ifndef NDEBUG
+ // Initialize //base for debugging
+ base::CommandLine::Init(argc, argv);
+ logging::LoggingSettings settings;
+ settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
+ logging::InitLogging(settings);
+#endif
+ sandbox::SandboxInterfaceInfo *info = new sandbox::SandboxInterfaceInfo();
+ memset(info, 0, sizeof(sandbox::SandboxInterfaceInfo));
+ InitializeSandboxInfo(info);
+ QtWebEngineSandbox::staticSandboxInterfaceInfo(info);
+}
+} // namespace QtWebEngineSandbox
diff --git a/src/core/select_file_dialog_factory_qt.cpp b/src/core/select_file_dialog_factory_qt.cpp
new file mode 100644
index 000000000..1f897a805
--- /dev/null
+++ b/src/core/select_file_dialog_factory_qt.cpp
@@ -0,0 +1,149 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "select_file_dialog_factory_qt.h"
+
+#include "content/browser/web_contents/web_contents_impl.h"
+#include "file_picker_controller.h"
+#include "type_conversion.h"
+#include "ui/shell_dialogs/select_file_dialog.h"
+#include "web_contents_adapter_client.h"
+#include "web_contents_view_qt.h"
+
+#include <QSharedPointer>
+#include <QTimer>
+
+namespace QtWebEngineCore {
+
+SelectFilePolicyQt::SelectFilePolicyQt(content::WebContents *source_contents)
+ : m_webContents(source_contents)
+{
+}
+
+SelectFilePolicyQt::~SelectFilePolicyQt() { }
+
+bool SelectFilePolicyQt::CanOpenSelectFileDialog()
+{
+ return true;
+}
+
+void SelectFilePolicyQt::SelectFileDenied() { }
+
+content::WebContents *SelectFilePolicyQt::webContents()
+{
+ return m_webContents;
+}
+
+static FilePickerController::FileChooserMode toFileChooserMode(ui::SelectFileDialog::Type type)
+{
+ switch (type) {
+ case ui::SelectFileDialog::Type::SELECT_FOLDER:
+ case ui::SelectFileDialog::Type::SELECT_UPLOAD_FOLDER:
+ case ui::SelectFileDialog::Type::SELECT_EXISTING_FOLDER:
+ return FilePickerController::FileChooserMode::UploadFolder;
+ case ui::SelectFileDialog::Type::SELECT_SAVEAS_FILE:
+ return FilePickerController::FileChooserMode::Save;
+ case ui::SelectFileDialog::Type::SELECT_OPEN_FILE:
+ return FilePickerController::FileChooserMode::Open;
+ case ui::SelectFileDialog::Type::SELECT_OPEN_MULTI_FILE:
+ case ui::SelectFileDialog::Type::SELECT_NONE:
+ default:
+ return FilePickerController::FileChooserMode::OpenMultiple;
+ break;
+ }
+}
+
+class SelectFileDialogQt : public ui::SelectFileDialog
+{
+public:
+ SelectFileDialogQt(Listener *, std::unique_ptr<ui::SelectFilePolicy>,
+ WebContentsAdapterClient *);
+
+ // ui::SelectFileDialog implementation:
+ bool IsRunning(gfx::NativeWindow) const override;
+ void ListenerDestroyed() override;
+ void SelectFileImpl(Type type, const std::u16string &title, const base::FilePath &default_path,
+ const FileTypeInfo *file_types, int file_type_index,
+ const base::FilePath::StringType &default_extension,
+ gfx::NativeWindow owning_window, void *params, const GURL *) override;
+
+ bool HasMultipleFileTypeChoicesImpl() override;
+
+private:
+ WebContentsAdapterClient *m_client;
+ QSharedPointer<FilePickerController> m_filePickerController;
+};
+
+SelectFileDialogQt::SelectFileDialogQt(Listener *listener,
+ std::unique_ptr<ui::SelectFilePolicy> policy,
+ WebContentsAdapterClient *client)
+ : SelectFileDialog(listener, std::move(policy)), m_client(client)
+{
+}
+
+bool SelectFileDialogQt::IsRunning(gfx::NativeWindow) const
+{
+ return listener_;
+}
+
+void SelectFileDialogQt::ListenerDestroyed()
+{
+ listener_ = nullptr;
+}
+
+bool SelectFileDialogQt::HasMultipleFileTypeChoicesImpl()
+{
+ return false;
+}
+
+extern FilePickerController *createFilePickerController(FilePickerController::FileChooserMode mode,
+ ui::SelectFileDialog::Listener *listener,
+ const QString &defaultFileName,
+ const QStringList &acceptedMimeTypes,
+ QObject *parent = nullptr);
+
+void SelectFileDialogQt::SelectFileImpl(Type type, const std::u16string &title,
+ const base::FilePath &default_path,
+ const FileTypeInfo *file_types, int file_type_index,
+ const base::FilePath::StringType &default_extension,
+ gfx::NativeWindow owning_window, void *params, const GURL *caller)
+{
+ Q_UNUSED(title);
+ Q_UNUSED(file_type_index);
+ Q_UNUSED(default_extension);
+ Q_UNUSED(owning_window);
+ Q_UNUSED(params);
+ Q_UNUSED(caller);
+
+ QStringList acceptedSuffixes;
+ if (file_types) {
+ for (const auto &type : file_types->extensions) {
+ for (const auto &extension : type)
+ acceptedSuffixes.append("." + toQt(extension));
+ }
+ }
+
+ m_filePickerController.reset(createFilePickerController(
+ toFileChooserMode(type), listener_, toQt(default_path.value()), acceptedSuffixes));
+ QTimer::singleShot(0, [this]() { m_client->runFileChooser(m_filePickerController); });
+}
+
+SelectFileDialogFactoryQt::SelectFileDialogFactoryQt() = default;
+
+SelectFileDialogFactoryQt::~SelectFileDialogFactoryQt() = default;
+
+ui::SelectFileDialog *
+SelectFileDialogFactoryQt::Create(ui::SelectFileDialog::Listener *listener,
+ std::unique_ptr<ui::SelectFilePolicy> policy)
+{
+ content::WebContents *webContents =
+ static_cast<SelectFilePolicyQt *>(policy.get())->webContents()->GetOutermostWebContents();
+ WebContentsAdapterClient *client =
+ WebContentsViewQt::from(static_cast<content::WebContentsImpl *>(webContents)->GetView())
+ ->client();
+ if (!client)
+ return nullptr;
+ return new SelectFileDialogQt(listener, std::move(policy), client);
+}
+
+} // namespace QtWebEngineCore
diff --git a/src/core/select_file_dialog_factory_qt.h b/src/core/select_file_dialog_factory_qt.h
new file mode 100644
index 000000000..8036995f1
--- /dev/null
+++ b/src/core/select_file_dialog_factory_qt.h
@@ -0,0 +1,46 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef SELECT_FILE_DIALOG_FACTORY_QT_H_
+#define SELECT_FILE_DIALOG_FACTORY_QT_H_
+
+#include "ui/shell_dialogs/select_file_dialog_factory.h"
+#include "ui/shell_dialogs/select_file_policy.h"
+
+namespace content {
+class WebContents;
+}
+
+namespace QtWebEngineCore {
+
+class SelectFilePolicyQt : public ui::SelectFilePolicy
+{
+public:
+ explicit SelectFilePolicyQt(content::WebContents *source_contents);
+ ~SelectFilePolicyQt() override;
+
+ // Overridden from ui::SelectFilePolicy:
+ bool CanOpenSelectFileDialog() override;
+ void SelectFileDenied() override;
+
+ content::WebContents *webContents();
+
+private:
+ content::WebContents *m_webContents;
+};
+
+// Implements a file Open / Save dialog for File System Access API.
+class SelectFileDialogFactoryQt : public ui::SelectFileDialogFactory
+{
+public:
+ SelectFileDialogFactoryQt();
+ ~SelectFileDialogFactoryQt() override;
+
+ // Overridden from ui::SelectFileDialogFactory:
+ ui::SelectFileDialog *Create(ui::SelectFileDialog::Listener *listener,
+ std::unique_ptr<ui::SelectFilePolicy> policy) override;
+};
+
+} // namespace QtWebEngineCore
+
+#endif // SELECT_FILE_DIALOG_FACTORY_QT_H_
diff --git a/src/core/tools/qwebengine_convert_dict/CMakeLists.txt b/src/core/tools/qwebengine_convert_dict/CMakeLists.txt
new file mode 100644
index 000000000..5e8a1de14
--- /dev/null
+++ b/src/core/tools/qwebengine_convert_dict/CMakeLists.txt
@@ -0,0 +1,37 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+if(QT_FEATURE_webengine_spellchecker AND NOT CMAKE_CROSSCOMPILING)
+ qt_get_tool_target_name(dict_target_name qwebengine_convert_dict)
+ qt_internal_add_tool(${dict_target_name}
+ TARGET_DESCRIPTION "QtWebEngine Dictionary Conversion Tool"
+ INSTALL_DIR ${INSTALL_LIBEXECDIR}
+ TOOLS_TARGET WebEngineCore
+ SOURCES main.cpp
+ INCLUDE_DIRECTORIES
+ ../../../3rdparty/chromium/third_party/abseil-cpp
+ )
+ if(COMMAND qt_internal_return_unless_building_tools)
+ qt_internal_return_unless_building_tools()
+ endif()
+ qt_skip_warnings_are_errors(${dict_target_name})
+ add_dependencies(${dict_target_name} WebEngineCore)
+ qt_internal_extend_target(${dict_target_name} CONDITION WIN32
+ DEFINES WIN32_LEAN_AND_MEAN
+ )
+ qt_internal_extend_target(${dict_target_name} CONDITION GCC OR CLANG
+ COMPILE_OPTIONS -Wno-unused-parameter
+ )
+ set_target_properties(${dict_target_name} PROPERTIES CXX_STANDARD 20)
+ if(NOT QT_FEATURE_webengine_system_icu AND QT_WILL_INSTALL)
+ # tool can be called durig build so copy icu file
+ get_target_property(icuFile WebEngineCore ICUDTL_FILE)
+ addCopyCommand(${dict_target_name} "${icuFile}"
+ "${QT_BUILD_DIR}/${INSTALL_LIBEXECDIR}")
+ endif()
+ qt_internal_extend_target(${dict_target_name}
+ CONDITION NOT QT_FEATURE_webengine_system_icu
+ DEFINES USE_ICU_FILE
+ )
+endif()
+
diff --git a/src/core/tools/qwebengine_convert_dict/main.cpp b/src/core/tools/qwebengine_convert_dict/main.cpp
new file mode 100644
index 000000000..a82947ddc
--- /dev/null
+++ b/src/core/tools/qwebengine_convert_dict/main.cpp
@@ -0,0 +1,254 @@
+/******************************************************************************
+** This is just slightly modified version of convert_dict.cc
+** chromium/chrome/tools/convert_dict/convert_dict.cc
+**
+** Original work:
+** Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+** Modified work:
+** Copyright (C) 2016 The Qt Company Ltd.
+**
+** SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+**
+** This tool converts Hunspell .aff/.dic pairs to a combined binary dictionary
+** format (.bdic). This format is more compact, and can be more efficiently
+** read by the client application.
+**
+******************************************************************************/
+
+#include <base/at_exit.h>
+#include <base/containers/span.h>
+#include <base/files/file_path.h>
+#include <base/files/file_util.h>
+#include <base/i18n/icu_util.h>
+#include <build/build_config.h>
+#include <chrome/tools/convert_dict/aff_reader.h>
+#include <chrome/tools/convert_dict/dic_reader.h>
+#include <third_party/hunspell/google/bdict_reader.h>
+#include <third_party/hunspell/google/bdict_writer.h>
+#include <base/path_service.h>
+
+#include <QTextStream>
+#include <QLibraryInfo>
+#include <QDir>
+#include <QCoreApplication>
+
+// see also src/core/type_conversion.h
+inline base::FilePath::StringType toFilePathString(const QString &str)
+{
+#if defined(Q_OS_WIN)
+ return QDir::toNativeSeparators(str).toStdWString();
+#else
+ return str.toStdString();
+#endif
+}
+
+inline base::FilePath toFilePath(const QString &str)
+{
+ return base::FilePath(toFilePathString(str));
+}
+
+#if defined(Q_OS_WIN)
+inline QString toQt(const std::wstring &string)
+{
+ return QString::fromStdWString(string);
+}
+#endif
+
+inline QString toQt(const std::u16string &string)
+{
+ return QString::fromStdU16String(string);
+}
+
+inline QString toQt(const std::string &string)
+{
+ return QString::fromStdString(string);
+}
+
+template<class T>
+QTextStream &operator<<(QTextStream &out, base::span<T> span)
+{
+ out << '[';
+ QString prefix;
+ for (const auto &element : span) {
+ out << prefix;
+ out << element;
+ prefix = QStringLiteral(",");
+ }
+ out << ']';
+ return out;
+}
+
+// Compares the given word list with the serialized trie to make sure they
+// are the same.
+inline bool VerifyWords(const convert_dict::DicReader::WordList& org_words,
+ const std::string& serialized, QTextStream& out)
+{
+ hunspell::BDictReader reader;
+ if (!reader.Init(reinterpret_cast<const unsigned char*>(serialized.data()),
+ serialized.size())) {
+ out << "BDict is invalid\n";
+ return false;
+ }
+ hunspell::WordIterator iter = reader.GetAllWordIterator();
+
+ int affix_ids[hunspell::BDict::MAX_AFFIXES_PER_WORD];
+
+ static const int buf_size = 128;
+ char buf[buf_size];
+ for (size_t i = 0; i < org_words.size(); i++) {
+ int affix_matches = iter.Advance(buf, buf_size, affix_ids);
+ if (affix_matches == 0) {
+ out << "Found the end before we expected\n";
+ return false;
+ }
+
+ if (org_words[i].first != buf) {
+ out << "Word does not match!\n"
+ << " Index: " << i << "\n"
+ << " Expected: " << QString::fromStdString(org_words[i].first) << "\n"
+ << " Actual: " << QString::fromUtf8(buf) << "\n";
+ return false;
+ }
+
+ base::span<const int> expectedAffixes(org_words[i].second);
+ base::span<const int> actualAffixes(affix_ids, (size_t)affix_matches);
+
+ if (!std::equal(expectedAffixes.begin(), expectedAffixes.end(),
+ actualAffixes.begin(), actualAffixes.end(),
+ [](int a, int b) { return a == b; })) {
+ out << "Affixes do not match!\n"
+ << " Index: " << i << "\n"
+ << " Word: " << QString::fromUtf8(buf) << "\n"
+ << " Expected: " << expectedAffixes << "\n"
+ << " Actual: " << actualAffixes << "\n";
+ return false;
+ }
+ }
+
+ return true;
+}
+
+#if defined(Q_OS_DARWIN) && defined(QT_MAC_FRAMEWORK_BUILD)
+QString frameworkIcuDataPath()
+{
+ return QLibraryInfo::location(QLibraryInfo::LibrariesPath) +
+ QStringLiteral("/QtWebEngineCore.framework/Resources/");
+}
+#endif
+
+int main(int argc, char *argv[])
+{
+ // Required only for making QLibraryInfo::location() return a valid path, when the application
+ // picks up a qt.conf file (which is the case for official Qt packages).
+ QCoreApplication app(argc, argv);
+ Q_UNUSED(app);
+
+ QTextStream out(stdout);
+
+ if (argc != 3) {
+ QTextStream out(stdout);
+ out << "Usage: qwebengine_convert_dict <dic file> <bdic file>\n\nExample:\n"
+ "qwebengine_convert_dict ./en-US.dic ./en-US.bdic\nwill read en-US.dic, "
+ "en-US.dic_delta, and en-US.aff from the current directory and generate "
+ "en-US.bdic\n\n";
+ return 1;
+ }
+#if defined(USE_ICU_FILE)
+ bool icuDataDirFound = false;
+ QString icuDataDir = QLibraryInfo::path(QLibraryInfo::DataPath)
+ % QLatin1String("/resources");
+
+ // Try to look up the path to the ICU data directory via an environment variable
+ // (e.g. for the case when the tool is ran during build phase, and regular installed
+ // ICU data file is not available).
+ const QString icuPossibleEnvDataDir = qEnvironmentVariable("QT_WEBENGINE_ICU_DATA_DIR");
+ const QString appPath = QCoreApplication::applicationDirPath();
+ QLatin1String icuDataFilePath("/icudtl.dat");
+ if (!icuPossibleEnvDataDir.isEmpty() && QFileInfo::exists(icuPossibleEnvDataDir)) {
+ icuDataDir = icuPossibleEnvDataDir;
+ icuDataDirFound = true;
+ }
+#if defined(Q_OS_DARWIN) && defined(QT_MAC_FRAMEWORK_BUILD)
+ // In a macOS Qt framework build, the resources are inside the QtWebEngineCore framework
+ // Resources directory, rather than in the Qt install location.
+ else if (QFileInfo::exists(frameworkIcuDataPath())) {
+ icuDataDir = frameworkIcuDataPath();
+ icuDataDirFound = true;
+ }
+#endif
+ // Try to find the ICU data directory in the installed Qt location.
+ else if (QFileInfo::exists(icuDataDir + icuDataFilePath)) {
+ icuDataDirFound = true;
+ } else if (QFileInfo::exists(appPath + icuDataFilePath)) {
+ // during build icudtl file can be simply in application directory
+ icuDataDir = appPath;
+ icuDataDirFound = true;
+ }
+ if (icuDataDirFound) {
+ base::PathService::Override(base::DIR_QT_LIBRARY_DATA, toFilePath(icuDataDir));
+ } else {
+ QTextStream out(stdout);
+ out << "Couldn't find ICU data directory. Please check that the following path exists: "
+ << icuDataDir
+ << "\nAlternatively provide the directory path via the QT_WEBENGINE_ICU_DATA_DIR "
+ "environment variable.\n\n";
+ return 1;
+ }
+#endif // USE_ICU_FILE
+
+ base::i18n::InitializeICU();
+
+ base::FilePath file_in_path = toFilePath(argv[1]);
+ base::FilePath file_out_path = toFilePath(argv[2]);
+ base::FilePath aff_path = file_in_path.ReplaceExtension(FILE_PATH_LITERAL(".aff"));
+
+ out << "Reading " << toQt(aff_path.value()) << "\n";
+ convert_dict::AffReader aff_reader(aff_path);
+
+ if (!aff_reader.Read()) {
+ out << "Unable to read the aff file.\n";
+ return 1;
+ }
+
+ base::FilePath dic_path = file_in_path.ReplaceExtension(FILE_PATH_LITERAL(".dic"));
+ out << "Reading " << toQt(dic_path.value()) << "\n";
+
+ // DicReader will also read the .dic_delta file.
+ convert_dict::DicReader dic_reader(dic_path);
+ if (!dic_reader.Read(&aff_reader)) {
+ out << "Unable to read the dic file.\n";
+ return 1;
+ }
+
+ hunspell::BDictWriter writer;
+ writer.SetComment(aff_reader.comments());
+ writer.SetAffixRules(aff_reader.affix_rules());
+ writer.SetAffixGroups(aff_reader.GetAffixGroups());
+ writer.SetReplacements(aff_reader.replacements());
+ writer.SetOtherCommands(aff_reader.other_commands());
+ writer.SetWords(dic_reader.words());
+
+ out << "Serializing...\n";
+
+ std::string serialized = writer.GetBDict();
+
+ out << "Verifying...\n";
+
+ if (!VerifyWords(dic_reader.words(), serialized, out)) {
+ out << "ERROR converting, the dictionary does not check out OK.\n";
+ return 1;
+ }
+
+ out << "Writing " << toQt(file_out_path.value()) << "\n";
+ FILE *out_file = base::OpenFile(file_out_path, "wb");
+ if (!out_file) {
+ out << "ERROR writing file\n";
+ return 1;
+ }
+ size_t written = fwrite(&serialized[0], 1, serialized.size(), out_file);
+ Q_ASSERT(written == serialized.size());
+ base::CloseFile(out_file);
+ out << "Success. Dictionary converted.\n";
+ return 0;
+}
+
diff --git a/src/core/tools/webenginedriver/CMakeLists.txt b/src/core/tools/webenginedriver/CMakeLists.txt
new file mode 100644
index 000000000..b20311980
--- /dev/null
+++ b/src/core/tools/webenginedriver/CMakeLists.txt
@@ -0,0 +1,57 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+if(WIN32)
+ set(WEBENGINEDRIVER_EXECUTABLE webenginedriver.exe)
+else()
+ set(WEBENGINEDRIVER_EXECUTABLE webenginedriver)
+endif()
+set(WEBENGINEDRIVER_EXECUTABLE ${WEBENGINEDRIVER_EXECUTABLE} PARENT_SCOPE)
+
+if(QT_FEATURE_webenginedriver)
+ get_install_config(config)
+ get_architectures(archs)
+ list(GET archs 0 arch)
+
+ ##
+ # DOCS
+ ##
+ add_code_attributions_target(
+ TARGET generate_webenginedriver_attributions
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/webenginedriver_attributions.qdoc
+ GN_TARGET //chrome/test/chromedriver:chromedriver_server
+ EXTRA_THIRD_PARTY_DIRS
+ third_party/selenium-atoms/sizzle
+ third_party/selenium-atoms/wgxpath
+ third_party/selenium-atoms/closure-lib
+ FILE_TEMPLATE ../../doc/about_credits.tmpl
+ ENTRY_TEMPLATE ../../doc/about_credits_entry.tmpl
+ BUILDDIR ${buildDir}/${config}/${arch}
+ )
+ add_dependencies(generate_webenginedriver_attributions run_core_GnDone)
+ add_dependencies(prepare_docs_WebEngineCore generate_webenginedriver_attributions)
+
+ ##
+ # INSTALL
+ ##
+ install(
+ PROGRAMS ${buildDir}/${config}/${arch}/${WEBENGINEDRIVER_EXECUTABLE}
+ CONFIGURATIONS ${config}
+ RUNTIME DESTINATION "${INSTALL_LIBEXECDIR}"
+ )
+ if(NOT QT_WILL_INSTALL)
+ add_custom_target(copy-webenginedriver
+ ALL
+ DEPENDS ${QT_BUILD_DIR}/${INSTALL_LIBEXECDIR}/${WEBENGINEDRIVER_EXECUTABLE}
+ )
+ add_custom_command(
+ OUTPUT ${QT_BUILD_DIR}/${INSTALL_LIBEXECDIR}/${WEBENGINEDRIVER_EXECUTABLE}
+ COMMAND ${CMAKE_COMMAND} -E copy ${buildDir}/${config}/${arch}/${WEBENGINEDRIVER_EXECUTABLE}
+ ${QT_BUILD_DIR}/${INSTALL_LIBEXECDIR}
+ DEPENDS
+ WebEngineCore
+ ${buildDir}/${config}/${arch}/${WEBENGINEDRIVER_EXECUTABLE}
+ USES_TERMINAL
+ )
+ endif()
+endif()
diff --git a/src/core/touch_handle_drawable_client.h b/src/core/touch_handle_drawable_client.h
index a2c87948a..ddfaa9f57 100644
--- a/src/core/touch_handle_drawable_client.h
+++ b/src/core/touch_handle_drawable_client.h
@@ -1,53 +1,17 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef TOUCH_HANDLE_DRAWABLE_CLIENT_H
#define TOUCH_HANDLE_DRAWABLE_CLIENT_H
-#include "qtwebenginecoreglobal_p.h"
+#include <QtWebEngineCore/private/qtwebenginecoreglobal_p.h>
#include <QRect>
namespace QtWebEngineCore {
-class Q_WEBENGINECORE_PRIVATE_EXPORT TouchHandleDrawableClient {
+class Q_WEBENGINECORE_EXPORT TouchHandleDrawableDelegate {
public:
- virtual ~TouchHandleDrawableClient() { }
+ virtual ~TouchHandleDrawableDelegate() { }
virtual void setImage(int orientation) = 0;
virtual void setBounds(const QRect &bounds) = 0;
diff --git a/src/core/touch_handle_drawable_qt.cpp b/src/core/touch_handle_drawable_qt.cpp
index 66b1cf40e..1e979fa03 100644
--- a/src/core/touch_handle_drawable_qt.cpp
+++ b/src/core/touch_handle_drawable_qt.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
@@ -49,7 +13,6 @@
#include "type_conversion.h"
#include "web_contents_adapter_client.h"
-#include "ui/gfx/image/image.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/resources/grit/ui_resources.h"
@@ -68,27 +31,6 @@ const int kSelectionHandlePadding = 0;
// Epsilon value used to compare float values to zero.
const float kEpsilon = 1e-8f;
-// Returns the appropriate handle image based on the handle orientation.
-gfx::Image* GetHandleImage(ui::TouchHandleOrientation orientation)
-{
- int resource_id = 0;
- switch (orientation) {
- case ui::TouchHandleOrientation::LEFT:
- resource_id = IDR_TEXT_SELECTION_HANDLE_LEFT;
- break;
- case ui::TouchHandleOrientation::CENTER:
- resource_id = IDR_TEXT_SELECTION_HANDLE_CENTER;
- break;
- case ui::TouchHandleOrientation::RIGHT:
- resource_id = IDR_TEXT_SELECTION_HANDLE_RIGHT;
- break;
- case ui::TouchHandleOrientation::UNDEFINED:
- NOTREACHED() << "Invalid touch handle bound type.";
- return nullptr;
- };
- return &ui::ResourceBundle::GetSharedInstance().GetImageNamed(resource_id);
-}
-
bool IsNearlyZero(float value)
{
return std::abs(value) < kEpsilon;
@@ -96,21 +38,12 @@ bool IsNearlyZero(float value)
} // namespace
-TouchHandleDrawableQt::TouchHandleDrawableQt(RenderWidgetHostViewQt *rwhv)
- : m_rwhv(rwhv)
+TouchHandleDrawableQt::TouchHandleDrawableQt(TouchHandleDrawableDelegate *delegate)
+ : m_delegate(delegate)
, m_enabled(false)
, m_alpha(0)
, m_orientation(ui::TouchHandleOrientation::UNDEFINED)
{
- QMap<int, QImage> images;
- for (int orientation = 0; orientation < static_cast<int>(ui::TouchHandleOrientation::UNDEFINED); ++orientation) {
- gfx::Image* image = GetHandleImage(static_cast<ui::TouchHandleOrientation>(orientation));
- images.insert(orientation, toQImage(image->AsBitmap()));
- }
-
- Q_ASSERT(m_rwhv);
- Q_ASSERT(m_rwhv->adapterClient());
- m_client.reset(m_rwhv->adapterClient()->createTouchHandle(images));
}
TouchHandleDrawableQt::~TouchHandleDrawableQt()
@@ -119,12 +52,12 @@ TouchHandleDrawableQt::~TouchHandleDrawableQt()
void TouchHandleDrawableQt::UpdateBounds()
{
- if (!m_client)
+ if (!m_delegate)
return;
gfx::RectF newBounds = m_relativeBounds;
newBounds.Offset(m_originPosition.x(), m_originPosition.y());
- m_client->setBounds(toQt(gfx::ToEnclosingRect(newBounds)));
+ m_delegate->setBounds(toQt(gfx::ToEnclosingRect(newBounds)));
}
bool TouchHandleDrawableQt::IsVisible() const
@@ -134,19 +67,19 @@ bool TouchHandleDrawableQt::IsVisible() const
void TouchHandleDrawableQt::SetEnabled(bool enabled)
{
- if (!m_client)
+ if (!m_delegate)
return;
if (enabled == m_enabled)
return;
m_enabled = enabled;
- m_client->setVisible(enabled);
+ m_delegate->setVisible(enabled);
}
void TouchHandleDrawableQt::SetOrientation(ui::TouchHandleOrientation orientation, bool mirror_vertical, bool mirror_horizontal)
{
- if (!m_client)
+ if (!m_delegate)
return;
// TODO: Implement adaptive handle orientation logic
@@ -157,7 +90,7 @@ void TouchHandleDrawableQt::SetOrientation(ui::TouchHandleOrientation orientatio
return;
m_orientation = orientation;
gfx::Image* image = GetHandleImage(orientation);
- m_client->setImage(static_cast<int>(orientation));
+ m_delegate->setImage(static_cast<int>(orientation));
// Calculate the relative bounds.
gfx::Size image_size = image->Size();
@@ -178,15 +111,15 @@ void TouchHandleDrawableQt::SetOrigin(const gfx::PointF& position)
void TouchHandleDrawableQt::SetAlpha(float alpha)
{
- if (!m_client)
+ if (!m_delegate)
return;
if (alpha == m_alpha)
return;
m_alpha = alpha;
- m_client->setOpacity(m_alpha);
- m_client->setVisible(IsVisible());
+ m_delegate->setOpacity(m_alpha);
+ m_delegate->setVisible(IsVisible());
}
gfx::RectF TouchHandleDrawableQt::GetVisibleBounds() const
@@ -195,10 +128,11 @@ gfx::RectF TouchHandleDrawableQt::GetVisibleBounds() const
bounds.Offset(m_originPosition.x(), m_originPosition.y());
gfx::RectF visibleBounds(bounds);
- visibleBounds.Inset(kSelectionHandlePadding,
- kSelectionHandlePadding + kSelectionHandleVerticalVisualOffset,
- kSelectionHandlePadding,
- kSelectionHandlePadding);
+ visibleBounds.Inset(gfx::InsetsF::TLBR(
+ kSelectionHandlePadding,
+ kSelectionHandlePadding + kSelectionHandleVerticalVisualOffset,
+ kSelectionHandlePadding,
+ kSelectionHandlePadding));
return visibleBounds;
}
@@ -208,4 +142,25 @@ float TouchHandleDrawableQt::GetDrawableHorizontalPaddingRatio() const
return 0.0;
}
+// Returns the appropriate handle image based on the handle orientation.
+gfx::Image *TouchHandleDrawableQt::GetHandleImage(ui::TouchHandleOrientation orientation)
+{
+ int resource_id = 0;
+ switch (orientation) {
+ case ui::TouchHandleOrientation::LEFT:
+ resource_id = IDR_TEXT_SELECTION_HANDLE_LEFT;
+ break;
+ case ui::TouchHandleOrientation::CENTER:
+ resource_id = IDR_TEXT_SELECTION_HANDLE_CENTER;
+ break;
+ case ui::TouchHandleOrientation::RIGHT:
+ resource_id = IDR_TEXT_SELECTION_HANDLE_RIGHT;
+ break;
+ case ui::TouchHandleOrientation::UNDEFINED:
+ NOTREACHED() << "Invalid touch handle bound type.";
+ return nullptr;
+ };
+ return &ui::ResourceBundle::GetSharedInstance().GetImageNamed(resource_id);
+}
+
} // namespace QtWebEngineCore
diff --git a/src/core/touch_handle_drawable_qt.h b/src/core/touch_handle_drawable_qt.h
index 46fa217b7..1738e68e9 100644
--- a/src/core/touch_handle_drawable_qt.h
+++ b/src/core/touch_handle_drawable_qt.h
@@ -1,60 +1,25 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef TOUCH_HANDLE_DRAWABLE_QT_H
#define TOUCH_HANDLE_DRAWABLE_QT_H
#include "ui/touch_selection/touch_handle.h"
#include "ui/touch_selection/touch_handle_orientation.h"
+#include "ui/gfx/image/image.h"
#include <QtCore/QScopedPointer>
namespace QtWebEngineCore {
-class RenderWidgetHostViewQt;
-class TouchHandleDrawableClient;
+class TouchHandleDrawableDelegate;
class TouchHandleDrawableQt : public ui::TouchHandleDrawable
{
public:
- explicit TouchHandleDrawableQt(RenderWidgetHostViewQt *rwhv);
+ explicit TouchHandleDrawableQt(TouchHandleDrawableDelegate *delegate);
~TouchHandleDrawableQt() override;
+ static gfx::Image *GetHandleImage(ui::TouchHandleOrientation orientation);
private:
void UpdateBounds();
@@ -71,15 +36,13 @@ private:
float GetDrawableHorizontalPaddingRatio() const override;
RenderWidgetHostViewQt *m_rwhv;
- QScopedPointer<TouchHandleDrawableClient> m_client;
+ QScopedPointer<TouchHandleDrawableDelegate> m_delegate;
bool m_enabled;
float m_alpha;
ui::TouchHandleOrientation m_orientation;
gfx::RectF m_relativeBounds;
gfx::PointF m_originPosition;
-
- DISALLOW_COPY_AND_ASSIGN(TouchHandleDrawableQt);
};
} // namespace QtWebEngineCore
diff --git a/src/core/touch_selection_controller_client_qt.cpp b/src/core/touch_selection_controller_client_qt.cpp
index 0f44210d1..befee6aaf 100644
--- a/src/core/touch_selection_controller_client_qt.cpp
+++ b/src/core/touch_selection_controller_client_qt.cpp
@@ -1,51 +1,16 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "render_widget_host_view_qt.h"
#include "touch_handle_drawable_qt.h"
+#include "touch_handle_drawable_client.h"
#include "touch_selection_controller_client_qt.h"
#include "touch_selection_menu_controller.h"
#include "type_conversion.h"
#include "web_contents_adapter.h"
#include "web_contents_adapter_client.h"
-#include "content/browser/frame_host/render_frame_host_impl.h"
+#include "content/browser/renderer_host/render_frame_host_impl.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "ui/gfx/geometry/size_conversions.h"
@@ -229,29 +194,29 @@ void TouchSelectionControllerClientQt::SetNeedsAnimate()
void TouchSelectionControllerClientQt::MoveCaret(const gfx::PointF& position)
{
- content::mojom::FrameInputHandler *frameInputHandler = m_rwhv->getFrameInputHandler();
- if (!frameInputHandler)
+ auto *frameWidgetInputHandler = m_rwhv->getFrameWidgetInputHandler();
+ if (!frameWidgetInputHandler)
return;
- frameInputHandler->MoveCaret(gfx::ToRoundedPoint(position));
+ frameWidgetInputHandler->MoveCaret(gfx::ToRoundedPoint(position));
}
void TouchSelectionControllerClientQt::MoveRangeSelectionExtent(const gfx::PointF& extent)
{
- content::mojom::FrameInputHandler *frameInputHandler = m_rwhv->getFrameInputHandler();
- if (!frameInputHandler)
+ auto *frameWidgetInputHandler = m_rwhv->getFrameWidgetInputHandler();
+ if (!frameWidgetInputHandler)
return;
- frameInputHandler->MoveRangeSelectionExtent(gfx::ToRoundedPoint(extent));
+ frameWidgetInputHandler->MoveRangeSelectionExtent(gfx::ToRoundedPoint(extent));
}
void TouchSelectionControllerClientQt::SelectBetweenCoordinates(const gfx::PointF& base, const gfx::PointF& extent)
{
- content::mojom::FrameInputHandler *frameInputHandler = m_rwhv->getFrameInputHandler();
- if (!frameInputHandler)
+ auto *frameWidgetInputHandler = m_rwhv->getFrameWidgetInputHandler();
+ if (!frameWidgetInputHandler)
return;
- frameInputHandler->SelectRange(gfx::ToRoundedPoint(base), gfx::ToRoundedPoint(extent));
+ frameWidgetInputHandler->SelectRange(gfx::ToRoundedPoint(base), gfx::ToRoundedPoint(extent));
}
void TouchSelectionControllerClientQt::OnSelectionEvent(ui::SelectionEventType event)
@@ -285,20 +250,39 @@ void TouchSelectionControllerClientQt::OnSelectionEvent(ui::SelectionEventType e
updateMenu();
}
-void TouchSelectionControllerClientQt::OnDragUpdate(const gfx::PointF& position)
+void TouchSelectionControllerClientQt::OnDragUpdate(const ui::TouchSelectionDraggable::Type type, const gfx::PointF& position)
{
+ Q_UNUSED(type);
Q_UNUSED(position);
}
std::unique_ptr<ui::TouchHandleDrawable> TouchSelectionControllerClientQt::CreateDrawable()
{
- return std::unique_ptr<ui::TouchHandleDrawable>(new TouchHandleDrawableQt(m_rwhv));
+ Q_ASSERT(m_rwhv);
+ Q_ASSERT(m_rwhv->adapterClient());
+ QMap<int, QImage> images;
+ for (int orientation = 0; orientation < static_cast<int>(ui::TouchHandleOrientation::UNDEFINED);
+ ++orientation) {
+ gfx::Image *image = TouchHandleDrawableQt::GetHandleImage(
+ static_cast<ui::TouchHandleOrientation>(orientation));
+ images.insert(orientation, toQImage(image->AsBitmap()));
+ }
+ auto delegate = m_rwhv->adapterClient()->createTouchHandleDelegate(images);
+ return std::unique_ptr<ui::TouchHandleDrawable>(new TouchHandleDrawableQt(delegate));
}
void TouchSelectionControllerClientQt::DidScroll()
{
}
+void TouchSelectionControllerClientQt::resetControls()
+{
+ if (m_menuShowing) {
+ hideMenu();
+ GetTouchSelectionController()->HideAndDisallowShowingAutomatically();
+ }
+}
+
void TouchSelectionControllerClientQt::showMenu()
{
gfx::RectF rect = GetTouchSelectionController()->GetRectBetweenBounds();
diff --git a/src/core/touch_selection_controller_client_qt.h b/src/core/touch_selection_controller_client_qt.h
index 0d8dcf696..3fdca7922 100644
--- a/src/core/touch_selection_controller_client_qt.h
+++ b/src/core/touch_selection_controller_client_qt.h
@@ -1,47 +1,11 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef TOUCH_SELECTION_CONTROLLER_CLIENT_QT_H
#define TOUCH_SELECTION_CONTROLLER_CLIENT_QT_H
+#include "content/public/browser/context_menu_params.h"
#include "content/public/browser/touch_selection_controller_client_manager.h"
-#include "content/public/common/context_menu_params.h"
#include "ui/touch_selection/touch_selection_controller.h"
#include "ui/touch_selection/touch_selection_menu_runner.h"
@@ -51,6 +15,7 @@ namespace QtWebEngineCore {
class RenderWidgetHostViewQt;
class TouchSelectionMenuController;
+class TouchHandleDrawableDelegate;
class TouchSelectionControllerClientQt
: public ui::TouchSelectionControllerClient
@@ -74,7 +39,7 @@ public:
void ExecuteCommand(int command_id, int event_flags) override;
void RunContextMenu() override;
bool ShouldShowQuickMenu() override { return false; }
- base::string16 GetSelectedText() override { return base::string16(); }
+ std::u16string GetSelectedText() override { return std::u16string(); }
// content::TouchSelectionControllerClientManager overrides
void DidStopFlinging() override;
@@ -86,6 +51,9 @@ public:
ui::TouchSelectionController* GetTouchSelectionController() override;
void AddObserver(Observer* observer) override;
void RemoveObserver(Observer* observer) override;
+ void OnSwipeToMoveCursorBegin() override {}
+ void OnSwipeToMoveCursorEnd() override {}
+ void OnClientHitTestRegionUpdated(ui::TouchSelectionControllerClient *) override {}
// ui::TouchSelectionControllerClient overrides
bool SupportsAnimation() const override;
@@ -94,10 +62,12 @@ public:
void MoveRangeSelectionExtent(const gfx::PointF& extent) override;
void SelectBetweenCoordinates(const gfx::PointF& base, const gfx::PointF& extent) override;
void OnSelectionEvent(ui::SelectionEventType event) override;
- void OnDragUpdate(const gfx::PointF& position) override;
+ void OnDragUpdate(const ui::TouchSelectionDraggable::Type type, const gfx::PointF& position) override;
std::unique_ptr<ui::TouchHandleDrawable> CreateDrawable() override;
void DidScroll() override;
+ void resetControls();
+
private:
void showMenu();
void hideMenu();
diff --git a/src/core/touch_selection_menu_controller.cpp b/src/core/touch_selection_menu_controller.cpp
index cdec9a064..98481baf0 100644
--- a/src/core/touch_selection_menu_controller.cpp
+++ b/src/core/touch_selection_menu_controller.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "touch_selection_controller_client_qt.h"
#include "touch_selection_menu_controller.h"
@@ -53,17 +17,11 @@ TouchSelectionMenuController::~TouchSelectionMenuController()
int TouchSelectionMenuController::buttonCount()
{
- int buttonCount = 1;
-
- for (int commandId = 0; commandId <= static_cast<int>(Paste); ++commandId) {
- if (m_touchSelectionControllerClient->IsCommandIdEnabled(commandId))
- buttonCount++;
- }
-
- return buttonCount;
+ // Context menu should be always available
+ return qPopulationCount(static_cast<quint8>(availableActions())) + 1;
}
-bool TouchSelectionMenuController::isCommandEnabled(TouchSelectionCommand command)
+bool TouchSelectionMenuController::isCommandEnabled(TouchSelectionMenuController::TouchSelectionCommandFlag command)
{
return m_touchSelectionControllerClient->IsCommandIdEnabled(static_cast<int>(command));
}
@@ -88,4 +46,21 @@ void TouchSelectionMenuController::runContextMenu()
return m_touchSelectionControllerClient->RunContextMenu();
}
+TouchSelectionMenuController::TouchSelectionCommandFlags TouchSelectionMenuController::availableActions()
+{
+ TouchSelectionCommandFlags availableActions;
+
+ if (m_touchSelectionControllerClient->IsCommandIdEnabled(Cut)) {
+ availableActions |= TouchSelectionMenuController::Cut;
+ }
+ if (m_touchSelectionControllerClient->IsCommandIdEnabled(Copy)) {
+ availableActions |= TouchSelectionMenuController::Copy;
+ }
+ if (m_touchSelectionControllerClient->IsCommandIdEnabled(Paste)) {
+ availableActions |= TouchSelectionMenuController::Paste;
+ }
+
+ return availableActions;
+}
+
} // namespace QtWebEngineCore
diff --git a/src/core/touch_selection_menu_controller.h b/src/core/touch_selection_menu_controller.h
index 34137b05b..6a1fc1960 100644
--- a/src/core/touch_selection_menu_controller.h
+++ b/src/core/touch_selection_menu_controller.h
@@ -1,65 +1,32 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef TOUCH_SELECTION_MENU_CONTROLLER_H
#define TOUCH_SELECTION_MENU_CONTROLLER_H
-#include "qtwebenginecoreglobal_p.h"
+#include <QtWebEngineCore/private/qtwebenginecoreglobal_p.h>
#include <QtCore/QObject>
namespace QtWebEngineCore {
class TouchSelectionControllerClientQt;
-class Q_WEBENGINECORE_PRIVATE_EXPORT TouchSelectionMenuController : public QObject {
+class Q_WEBENGINECORE_EXPORT TouchSelectionMenuController : public QObject {
Q_OBJECT
public:
- enum TouchSelectionCommand {
- Cut,
- Copy,
- Paste
+ enum TouchSelectionCommandFlag {
+ Cut = 0x1,
+ Copy = 0x2,
+ Paste = 0x4
};
+ Q_DECLARE_FLAGS(TouchSelectionCommandFlags, TouchSelectionCommandFlag)
+ Q_FLAG(TouchSelectionCommandFlag)
TouchSelectionMenuController(TouchSelectionControllerClientQt *touchSelectionControllerClient);
~TouchSelectionMenuController();
int buttonCount();
- bool isCommandEnabled(TouchSelectionCommand);
+ bool isCommandEnabled(TouchSelectionCommandFlag);
+ TouchSelectionCommandFlags availableActions();
public Q_SLOTS:
void cut();
diff --git a/src/core/type_conversion.cpp b/src/core/type_conversion.cpp
index 403125784..2d4fb323d 100644
--- a/src/core/type_conversion.cpp
+++ b/src/core/type_conversion.cpp
@@ -1,52 +1,19 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "type_conversion.h"
-#include <content/public/common/favicon_url.h>
+#include "base/containers/contains.h"
+#include <components/favicon_base/favicon_util.h>
#include <net/cert/x509_certificate.h>
#include <net/cert/x509_util.h>
#include <ui/events/event_constants.h>
-#include <ui/gfx/image/image_skia.h>
+#include "ui/gfx/image/image.h"
+#include "ui/gfx/image/image_skia.h"
+#include "ui/gfx/image/image_skia_rep.h"
+#include "third_party/blink/public/mojom/favicon/favicon_url.mojom.h"
#include <QtCore/qcoreapplication.h>
-#include <QtGui/qmatrix4x4.h>
#include <QtNetwork/qsslcertificate.h>
namespace QtWebEngineCore {
@@ -64,6 +31,7 @@ QImage toQImage(const SkBitmap &bitmap)
case kA16_unorm_SkColorType:
case kR16G16_float_SkColorType:
case kR16G16_unorm_SkColorType:
+ case kR8_unorm_SkColorType:
qWarning("Unknown or unsupported skia image format");
break;
case kAlpha_8_SkColorType:
@@ -86,6 +54,7 @@ QImage toQImage(const SkBitmap &bitmap)
break;
}
break;
+ case kSRGBA_8888_SkColorType:
case kRGB_888x_SkColorType:
case kRGBA_8888_SkColorType:
switch (bitmap.alphaType()) {
@@ -133,6 +102,22 @@ QImage toQImage(const SkBitmap &bitmap)
break;
}
break;
+ case kBGR_101010x_SkColorType:
+ case kBGR_101010x_XR_SkColorType:
+ case kBGRA_1010102_SkColorType:
+ switch (bitmap.alphaType()) {
+ case kUnknown_SkAlphaType:
+ break;
+ case kUnpremul_SkAlphaType:
+ // not supported - treat as opaque
+ case kOpaque_SkAlphaType:
+ image = toQImage(bitmap, QImage::Format_BGR30);
+ break;
+ case kPremul_SkAlphaType:
+ image = toQImage(bitmap, QImage::Format_A2BGR30_Premultiplied);
+ break;
+ }
+ break;
case kGray_8_SkColorType:
image = toQImage(bitmap, QImage::Format_Grayscale8);
break;
@@ -201,6 +186,23 @@ SkBitmap toSkBitmap(const QImage &image)
return bitmapCopy;
}
+QIcon toQIcon(const gfx::Image &image)
+{
+ // Based on ExtractSkBitmapsToStore in chromium/components/favicon/core/favicon_service_impl.cc
+ gfx::ImageSkia image_skia = image.AsImageSkia();
+ image_skia.EnsureRepsForSupportedScales();
+ const std::vector<gfx::ImageSkiaRep> &image_reps = image_skia.image_reps();
+ std::vector<SkBitmap> bitmaps;
+ const std::vector<float> favicon_scales = favicon_base::GetFaviconScales();
+ for (size_t i = 0; i < image_reps.size(); ++i) {
+ // Don't save if the scale isn't one of supported favicon scales.
+ if (!base::Contains(favicon_scales, image_reps[i].scale()))
+ continue;
+ bitmaps.push_back(image_reps[i].GetBitmap());
+ }
+ return toQIcon(bitmaps);
+}
+
QIcon toQIcon(const std::vector<SkBitmap> &bitmaps)
{
if (!bitmaps.size())
@@ -242,44 +244,6 @@ int flagsFromModifiers(Qt::KeyboardModifiers modifiers)
return modifierFlags;
}
-FaviconInfo::FaviconTypeFlags toQt(content::FaviconURL::IconType type)
-{
- switch (type) {
- case content::FaviconURL::IconType::kFavicon:
- return FaviconInfo::Favicon;
- case content::FaviconURL::IconType::kTouchIcon:
- return FaviconInfo::TouchIcon;
- case content::FaviconURL::IconType::kTouchPrecomposedIcon:
- return FaviconInfo::TouchPrecomposedIcon;
- case content::FaviconURL::IconType::kInvalid:
- return FaviconInfo::InvalidIcon;
- }
- Q_UNREACHABLE();
- return FaviconInfo::InvalidIcon;
-}
-
-FaviconInfo toFaviconInfo(const content::FaviconURL &favicon_url)
-{
- FaviconInfo info;
- info.url = toQt(favicon_url.icon_url);
- info.type = toQt(favicon_url.icon_type);
- // TODO: Add support for rel sizes attribute (favicon_url.icon_sizes):
- // http://www.w3schools.com/tags/att_link_sizes.asp
- info.size = QSize(0, 0);
- return info;
-}
-
-void convertToQt(const SkMatrix44 &m, QMatrix4x4 &c)
-{
- QMatrix4x4 qtMatrix(
- m.get(0, 0), m.get(0, 1), m.get(0, 2), m.get(0, 3),
- m.get(1, 0), m.get(1, 1), m.get(1, 2), m.get(1, 3),
- m.get(2, 0), m.get(2, 1), m.get(2, 2), m.get(2, 3),
- m.get(3, 0), m.get(3, 1), m.get(3, 2), m.get(3, 3));
- qtMatrix.optimize();
- c = qtMatrix;
-}
-
static QSslCertificate toCertificate(CRYPTO_BUFFER *buffer)
{
auto derCert = net::x509_util::CryptoBufferAsStringPiece(buffer);
@@ -296,4 +260,40 @@ QList<QSslCertificate> toCertificateChain(net::X509Certificate *certificate)
return chain;
}
+Qt::InputMethodHints toQtInputMethodHints(ui::TextInputType inputType)
+{
+ switch (inputType) {
+ case ui::TEXT_INPUT_TYPE_TEXT:
+ return Qt::ImhPreferLowercase;
+ case ui::TEXT_INPUT_TYPE_SEARCH:
+ return Qt::ImhPreferLowercase | Qt::ImhNoAutoUppercase;
+ case ui::TEXT_INPUT_TYPE_PASSWORD:
+ return Qt::ImhSensitiveData | Qt::ImhNoPredictiveText | Qt::ImhNoAutoUppercase
+ | Qt::ImhHiddenText;
+ case ui::TEXT_INPUT_TYPE_EMAIL:
+ return Qt::ImhEmailCharactersOnly;
+ case ui::TEXT_INPUT_TYPE_NUMBER:
+ return Qt::ImhFormattedNumbersOnly;
+ case ui::TEXT_INPUT_TYPE_TELEPHONE:
+ return Qt::ImhDialableCharactersOnly;
+ case ui::TEXT_INPUT_TYPE_URL:
+ return Qt::ImhUrlCharactersOnly | Qt::ImhNoPredictiveText | Qt::ImhNoAutoUppercase;
+ case ui::TEXT_INPUT_TYPE_DATE_TIME:
+ case ui::TEXT_INPUT_TYPE_DATE_TIME_LOCAL:
+ case ui::TEXT_INPUT_TYPE_DATE_TIME_FIELD:
+ return Qt::ImhDate | Qt::ImhTime;
+ case ui::TEXT_INPUT_TYPE_DATE:
+ case ui::TEXT_INPUT_TYPE_MONTH:
+ case ui::TEXT_INPUT_TYPE_WEEK:
+ return Qt::ImhDate;
+ case ui::TEXT_INPUT_TYPE_TIME:
+ return Qt::ImhTime;
+ case ui::TEXT_INPUT_TYPE_TEXT_AREA:
+ case ui::TEXT_INPUT_TYPE_CONTENT_EDITABLE:
+ return Qt::ImhMultiLine | Qt::ImhPreferLowercase;
+ default:
+ return Qt::ImhNone;
+ }
+}
+
} // namespace QtWebEngineCore
diff --git a/src/core/type_conversion.h b/src/core/type_conversion.h
index 2275ae82e..0da8a6931 100644
--- a/src/core/type_conversion.h
+++ b/src/core/type_conversion.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef TYPE_CONVERSION_H
#define TYPE_CONVERSION_H
@@ -49,28 +13,23 @@
#include <QRect>
#include <QString>
#include <QUrl>
-#include <base/strings/nullable_string16.h>
#include "base/files/file_path.h"
#include "base/time/time.h"
-#include "content/public/common/file_chooser_file_info.h"
-#include "favicon_manager.h"
#include "net/cookies/canonical_cookie.h"
+#include "third_party/blink/public/mojom/favicon/favicon_url.mojom-forward.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/skia/include/core/SkPixelRef.h"
-#include "third_party/skia/include/core/SkMatrix44.h"
+#include "ui/base/ime/text_input_type.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/rect_f.h"
#include "url/gurl.h"
+#include "url/origin.h"
-QT_FORWARD_DECLARE_CLASS(QMatrix4x4)
QT_FORWARD_DECLARE_CLASS(QSslCertificate)
-namespace content {
-struct FaviconURL;
-}
-
namespace gfx {
+class Image;
class ImageSkiaRep;
}
@@ -80,13 +39,28 @@ class X509Certificate;
namespace QtWebEngineCore {
-inline QString toQt(const base::string16 &string)
+#if defined(Q_OS_WIN)
+inline QString toQt(const std::wstring &string)
{
-#if defined(OS_WIN)
- return QString::fromStdWString(string.data());
-#else
- return QString::fromUtf16(string.data());
+ return QString::fromStdWString(string);
+}
#endif
+
+inline QString toQt(const std::u16string &string)
+{
+ return QString::fromStdU16String(string);
+}
+
+inline QString toQt(const absl::optional<std::u16string> &string)
+{
+ if (!string.has_value())
+ return QString();
+ return QString::fromStdU16String(*string);
+}
+
+inline QString toQString(const base::StringPiece &string)
+{
+ return QString::fromUtf8(string.data(), string.size());
}
inline QString toQString(const std::string &string)
@@ -94,6 +68,11 @@ inline QString toQString(const std::string &string)
return QString::fromStdString(string);
}
+inline QByteArray toQByteArray(const base::StringPiece &string)
+{
+ return QByteArray(string.data(), string.size());
+}
+
inline QByteArray toQByteArray(const std::string &string)
{
return QByteArray::fromStdString(string);
@@ -105,18 +84,16 @@ inline QString toQt(const std::string &string)
return toQString(string);
}
-inline base::string16 toString16(const QString &qString)
+inline std::u16string toString16(const QString &qString)
{
-#if defined(OS_WIN)
- return base::string16(qString.toStdWString());
-#else
- return base::string16(qString.utf16());
-#endif
+ return qString.toStdU16String();
}
-inline base::NullableString16 toNullableString16(const QString &qString)
+inline absl::optional<std::u16string> toOptionalString16(const QString &qString)
{
- return base::NullableString16(toString16(qString), qString.isNull());
+ if (qString.isNull())
+ return absl::nullopt;
+ return absl::make_optional(qString.toStdU16String());
}
inline QUrl toQt(const GURL &url)
@@ -132,11 +109,26 @@ inline GURL toGurl(const QUrl& url)
return GURL(url.toEncoded().toStdString());
}
+inline QUrl toQt(const url::Origin &origin)
+{
+ return QUrl::fromEncoded(toQByteArray(origin.Serialize()));
+}
+
+inline url::Origin toOrigin(const QUrl &url)
+{
+ return url::Origin::Create(toGurl(url));
+}
+
inline QPoint toQt(const gfx::Point &point)
{
return QPoint(point.x(), point.y());
}
+inline QPointF toQt(const gfx::PointF &point)
+{
+ return QPointF(point.x(), point.y());
+}
+
inline QPointF toQt(const gfx::Vector2dF &point)
{
return QPointF(point.x(), point.y());
@@ -187,6 +179,11 @@ inline QSizeF toQt(const gfx::SizeF &size)
return QSizeF(size.width(), size.height());
}
+inline QSize toQt(const SkISize &size)
+{
+ return QSize(size.width(), size.height());
+}
+
inline QColor toQt(const SkColor &c)
{
return QColor(SkColorGetR(c), SkColorGetG(c), SkColorGetB(c), SkColorGetA(c));
@@ -207,10 +204,9 @@ QImage toQImage(const SkBitmap &bitmap);
QImage toQImage(const gfx::ImageSkiaRep &imageSkiaRep);
SkBitmap toSkBitmap(const QImage &image);
+QIcon toQIcon(const gfx::Image &image);
QIcon toQIcon(const std::vector<SkBitmap> &bitmaps);
-void convertToQt(const SkMatrix44 &m, QMatrix4x4 &c);
-
inline QDateTime toQt(base::Time time)
{
return QDateTime::fromMSecsSinceEpoch(time.ToJavaTime());
@@ -234,7 +230,7 @@ inline QNetworkCookie toQt(const net::CanonicalCookie & cookie)
inline base::FilePath::StringType toFilePathString(const QString &str)
{
-#if defined(OS_WIN)
+#if defined(Q_OS_WIN)
return QDir::toNativeSeparators(str).toStdWString();
#else
return str.toStdString();
@@ -246,46 +242,9 @@ inline base::FilePath toFilePath(const QString &str)
return base::FilePath(toFilePathString(str));
}
-template <typename T>
-inline T fileListingHelper(const QString &)
-// Clang is still picky about this though it should be supported eventually.
-// See http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#941
-#ifndef Q_CC_CLANG
-= delete;
-#else
-{ return T(); }
-#endif
-
-template <>
-inline content::FileChooserFileInfo fileListingHelper<content::FileChooserFileInfo>(const QString &file)
-{
- content::FileChooserFileInfo choose_file;
- base::FilePath fp(toFilePath(file));
- choose_file.file_path = fp;
- choose_file.display_name = fp.BaseName().value();
- return choose_file;
-}
-
-template <>
-inline base::FilePath fileListingHelper<base::FilePath>(const QString &file)
-{
- return base::FilePath(toFilePathString(file));
-}
-
-
-template <typename T>
-inline std::vector<T> toVector(const QStringList &fileList)
-{
- std::vector<T> selectedFiles;
- selectedFiles.reserve(fileList.size());
- for (const QString &file : fileList)
- selectedFiles.push_back(fileListingHelper<T>(file));
- return selectedFiles;
-}
-
int flagsFromModifiers(Qt::KeyboardModifiers modifiers);
-inline QStringList fromVector(const std::vector<base::string16> &vector)
+inline QStringList fromVector(const std::vector<std::u16string> &vector)
{
QStringList result;
for (auto s: vector) {
@@ -294,10 +253,10 @@ inline QStringList fromVector(const std::vector<base::string16> &vector)
return result;
}
-FaviconInfo toFaviconInfo(const content::FaviconURL &);
-
QList<QSslCertificate> toCertificateChain(net::X509Certificate *certificate);
+Qt::InputMethodHints toQtInputMethodHints(ui::TextInputType inputType);
+
} // namespace QtWebEngineCore
#endif // TYPE_CONVERSION_H
diff --git a/src/core/user_notification_controller.cpp b/src/core/user_notification_controller.cpp
index f94605a55..9c1122cca 100644
--- a/src/core/user_notification_controller.cpp
+++ b/src/core/user_notification_controller.cpp
@@ -1,48 +1,10 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "user_notification_controller.h"
#include "type_conversion.h"
-#include "base/callback.h"
-#include "content/public/browser/notification_event_dispatcher.h"
#include "third_party/blink/public/mojom/notifications/notification.mojom-shared.h"
#include "third_party/blink/public/common/notifications/notification_resources.h"
#include "third_party/blink/public/common/notifications/platform_notification_data.h"
diff --git a/src/core/user_notification_controller.h b/src/core/user_notification_controller.h
index bab85c7ec..21d9fc653 100644
--- a/src/core/user_notification_controller.h
+++ b/src/core/user_notification_controller.h
@@ -1,50 +1,14 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef DESKTOP_NOTIFICATION_CONTROLLER_H
#define DESKTOP_NOTIFICATION_CONTROLLER_H
-#include "qtwebenginecoreglobal.h"
+#include <QtWebEngineCore/qtwebenginecoreglobal.h>
-#include <QtCore/QSharedPointer>
-#include <QtCore/QUrl>
-#include <QtGui/QIcon>
+#include <QtCore/qsharedpointer.h>
+#include <QtCore/qurl.h>
+#include <QtGui/qimage.h>
class GURL;
diff --git a/src/core/user_script.cpp b/src/core/user_script.cpp
index 7ccb6e10a..c33fb9081 100644
--- a/src/core/user_script.cpp
+++ b/src/core/user_script.cpp
@@ -1,43 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "common/user_script_data.h"
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "base/strings/string_util.h"
+
+#include "qtwebengine/userscript/user_script_data.h"
#include "user_script.h"
#include "type_conversion.h"
@@ -54,7 +20,7 @@ bool GetDeclarationValue(const base::StringPiece& line,
std::string temp(line.data() + index + prefix.length(),
line.length() - index - prefix.length());
- if (temp.empty() || !base::IsUnicodeWhitespace(temp[0]))
+ if (temp.empty() || !base::IsWhitespace(temp[0]))
return false;
base::TrimWhitespaceASCII(temp, base::TRIM_ALL, value);
@@ -72,30 +38,19 @@ ASSERT_ENUMS_MATCH(UserScript::DocumentElementCreation, UserScriptData::Document
UserScript::UserScript()
: QSharedData()
{
+ static uint64_t idCount = 0;
+ m_scriptData.scriptId = idCount++;
}
-UserScript::UserScript(const UserScript &other)
- : QSharedData(other)
-{
- if (other.isNull())
- return;
- scriptData.reset(new UserScriptData(*other.scriptData));
- m_name = other.m_name;
-}
+UserScript::UserScript(const UserScript &other) = default;
-UserScript::~UserScript()
-{
-}
+UserScript::~UserScript() = default;
UserScript &UserScript::operator=(const UserScript &other)
{
- if (other.isNull()) {
- scriptData.reset();
- m_name = QString();
- return *this;
- }
- scriptData.reset(new UserScriptData(*other.scriptData));
+ m_scriptData = other.m_scriptData;
m_name = other.m_name;
+ m_url = other.m_url;
return *this;
}
@@ -107,101 +62,82 @@ QString UserScript::name() const
void UserScript::setName(const QString &name)
{
m_name = name;
- initData();
- scriptData->url = GURL(QStringLiteral("userScript:%1").arg(name).toStdString());
+ m_scriptData.url = GURL(QStringLiteral("userScript:%1").arg(name).toStdString());
}
QString UserScript::sourceCode() const
{
- if (isNull())
- return QString();
- return toQt(scriptData->source);
+ return toQt(m_scriptData.source);
}
void UserScript::setSourceCode(const QString &source)
{
- initData();
- scriptData->source = source.toStdString();
+ m_scriptData.source = source.toStdString();
parseMetadataHeader();
}
-UserScript::InjectionPoint UserScript::injectionPoint() const
+QUrl UserScript::sourceUrl() const
{
- if (isNull())
- return UserScript::AfterLoad;
- return static_cast<UserScript::InjectionPoint>(scriptData->injectionPoint);
+ return m_url;
}
-void UserScript::setInjectionPoint(UserScript::InjectionPoint p)
+void UserScript::setSourceUrl(const QUrl &url)
{
- initData();
- scriptData->injectionPoint = p;
+ m_url = url;
}
-uint UserScript::worldId() const
+UserScript::InjectionPoint UserScript::injectionPoint() const
{
- if (isNull())
- return 1;
- return scriptData->worldId;
+ return static_cast<UserScript::InjectionPoint>(m_scriptData.injectionPoint);
}
-void UserScript::setWorldId(uint id)
+void UserScript::setInjectionPoint(UserScript::InjectionPoint p)
{
- initData();
- scriptData->worldId = id;
+ m_scriptData.injectionPoint = p;
}
-bool UserScript::runsOnSubFrames() const
+quint32 UserScript::worldId() const
{
- if (isNull())
- return false;
- return scriptData->injectForSubframes;
+ return m_scriptData.worldId;
}
-void UserScript::setRunsOnSubFrames(bool on)
+void UserScript::setWorldId(quint32 id)
{
- initData();
- scriptData->injectForSubframes = on;
+ m_scriptData.worldId = id;
}
-bool UserScript::operator==(const UserScript &other) const
+bool UserScript::runsOnSubFrames() const
{
- if (isNull() != other.isNull())
- return false;
- if (isNull()) // neither is valid
- return true;
- return worldId() == other.worldId()
- && runsOnSubFrames() == other.runsOnSubFrames()
- && injectionPoint() == other.injectionPoint()
- && name() == other.name() && sourceCode() == other.sourceCode();
+ return m_scriptData.injectForSubframes;
}
-void UserScript::initData()
+void UserScript::setRunsOnSubFrames(bool on)
{
- if (scriptData.isNull())
- scriptData.reset(new UserScriptData);
+ m_scriptData.injectForSubframes = on;
}
-bool UserScript::isNull() const
+const UserScriptData &UserScript::data() const
{
- return scriptData.isNull();
+ return m_scriptData;
}
-UserScriptData &UserScript::data() const
+bool UserScript::operator==(const UserScript &other) const
{
- return *(scriptData.data());
+ return worldId() == other.worldId() && runsOnSubFrames() == other.runsOnSubFrames()
+ && injectionPoint() == other.injectionPoint() && name() == other.name()
+ && sourceCode() == other.sourceCode() && sourceUrl() == other.sourceUrl();
}
void UserScript::parseMetadataHeader()
{
// Clear previous values
- scriptData->globs.clear();
- scriptData->excludeGlobs.clear();
- scriptData->urlPatterns.clear();
+ m_scriptData.globs.clear();
+ m_scriptData.excludeGlobs.clear();
+ m_scriptData.urlPatterns.clear();
// Logic taken from Chromium (extensions/browser/user_script_loader.cc)
// http://wiki.greasespot.net/Metadata_block
- const std::string &script_text = scriptData->source;
+ const std::string &script_text = m_scriptData.source;
base::StringPiece line;
size_t line_start = 0;
size_t line_end = line_start;
@@ -228,13 +164,13 @@ void UserScript::parseMetadataHeader()
if (line_end == std::string::npos)
line_end = script_text.length() - 1;
- line.set(script_text.data() + line_start, line_end - line_start);
+ line = base::StringPiece(script_text.data() + line_start, line_end - line_start);
if (!in_metadata) {
- if (line.starts_with(kUserScriptBegin))
+ if (base::StartsWith(line, kUserScriptBegin))
in_metadata = true;
} else {
- if (line.starts_with(kUserScriptEnd))
+ if (base::StartsWith(line, kUserScriptEnd))
break;
std::string value;
@@ -247,7 +183,7 @@ void UserScript::parseMetadataHeader()
base::ReplaceSubstringsAfterOffset(&value, 0, "\\", "\\\\");
base::ReplaceSubstringsAfterOffset(&value, 0, "?", "\\?");
}
- scriptData->globs.push_back(value);
+ m_scriptData.globs.push_back(value);
} else if (GetDeclarationValue(line, kExcludeDeclaration, &value)) {
if (value.front() != '/' || value.back() != '/') {
// The greasemonkey spec only allows for wildcards (*), so
@@ -255,16 +191,16 @@ void UserScript::parseMetadataHeader()
base::ReplaceSubstringsAfterOffset(&value, 0, "\\", "\\\\");
base::ReplaceSubstringsAfterOffset(&value, 0, "?", "\\?");
}
- scriptData->excludeGlobs.push_back(value);
+ m_scriptData.excludeGlobs.push_back(value);
} else if (GetDeclarationValue(line, kMatchDeclaration, &value)) {
- scriptData->urlPatterns.push_back(value);
+ m_scriptData.urlPatterns.push_back(value);
} else if (GetDeclarationValue(line, kRunAtDeclaration, &value)) {
if (value == kRunAtDocumentStartValue)
- scriptData->injectionPoint = DocumentElementCreation;
+ m_scriptData.injectionPoint = DocumentElementCreation;
else if (value == kRunAtDocumentEndValue)
- scriptData->injectionPoint = DocumentLoadFinished;
+ m_scriptData.injectionPoint = DocumentLoadFinished;
else if (value == kRunAtDocumentIdleValue)
- scriptData->injectionPoint = AfterLoad;
+ m_scriptData.injectionPoint = AfterLoad;
}
}
@@ -273,8 +209,8 @@ void UserScript::parseMetadataHeader()
// If no patterns were specified, default to @include *. This is what
// Greasemonkey does.
- if (scriptData->globs.empty() && scriptData->urlPatterns.empty())
- scriptData->globs.push_back("*");
+ if (m_scriptData.globs.empty() && m_scriptData.urlPatterns.empty())
+ m_scriptData.globs.push_back("*");
}
} // namespace QtWebEngineCore
diff --git a/src/core/user_script.h b/src/core/user_script.h
index 8f65f4b74..fdc7782b8 100644
--- a/src/core/user_script.h
+++ b/src/core/user_script.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
//
// W A R N I N G
@@ -53,17 +17,19 @@
#include "qtwebenginecoreglobal_p.h"
+#include "qtwebengine/userscript/user_script_data.h"
+
#include <QtCore/QScopedPointer>
#include <QtCore/QSharedData>
#include <QtCore/QString>
+#include <QtCore/QUrl>
-struct UserScriptData;
namespace QtWebEngineCore {
-
class UserResourceControllerHost;
-class Q_WEBENGINECORE_PRIVATE_EXPORT UserScript : public QSharedData {
+class UserScript : public QSharedData
+{
public:
enum InjectionPoint {
AfterLoad,
@@ -76,19 +42,20 @@ public:
~UserScript();
UserScript &operator=(const UserScript &other);
- bool isNull() const;
-
QString name() const;
void setName(const QString &);
QString sourceCode() const;
void setSourceCode(const QString &);
+ QUrl sourceUrl() const;
+ void setSourceUrl(const QUrl &);
+
InjectionPoint injectionPoint() const;
void setInjectionPoint(InjectionPoint);
- uint worldId() const;
- void setWorldId(uint id);
+ quint32 worldId() const;
+ void setWorldId(quint32 id);
bool runsOnSubFrames() const;
void setRunsOnSubFrames(bool on);
@@ -96,13 +63,13 @@ public:
bool operator==(const UserScript &) const;
private:
- void initData();
- UserScriptData &data() const;
+ const UserScriptData &data() const;
void parseMetadataHeader();
friend class UserResourceControllerHost;
- QScopedPointer<UserScriptData> scriptData;
+ UserScriptData m_scriptData;
QString m_name;
+ QUrl m_url;
};
} // namespace QtWebEngineCore
diff --git a/src/core/visited_links_manager_qt.cpp b/src/core/visited_links_manager_qt.cpp
index 37343cc39..9e1bd7a32 100644
--- a/src/core/visited_links_manager_qt.cpp
+++ b/src/core/visited_links_manager_qt.cpp
@@ -1,45 +1,10 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "visited_links_manager_qt.h"
#include "content_browser_client_qt.h"
+#include "profile_adapter.h"
#include "profile_qt.h"
#include "type_conversion.h"
@@ -53,8 +18,8 @@ namespace {
class BasicUrlIterator : public visitedlink::VisitedLinkWriter::URLIterator {
public:
BasicUrlIterator(const QList<QUrl> &urls) : m_urls(urls) {}
- virtual const GURL& NextURL() { m_currentUrl = toGurl(m_urls.takeFirst()); return m_currentUrl; }
- virtual bool HasNextURL() const { return !m_urls.isEmpty(); }
+ const GURL &NextURL() override { m_currentUrl = toGurl(m_urls.takeFirst()); return m_currentUrl; }
+ bool HasNextURL() const override { return !m_urls.isEmpty(); }
private:
QList<QUrl> m_urls;
GURL m_currentUrl;
@@ -71,7 +36,7 @@ class VisitedLinkDelegateQt : public visitedlink::VisitedLinkDelegate
{
public:
~VisitedLinkDelegateQt() {}
- void RebuildTable(const scoped_refptr<URLEnumerator>& enumerator) { enumerator->OnComplete(true); }
+ void RebuildTable(const scoped_refptr<URLEnumerator> &enumerator) override { enumerator->OnComplete(true); }
};
void VisitedLinksManagerQt::deleteAllVisitedLinkData()
@@ -90,27 +55,12 @@ bool VisitedLinksManagerQt::containsUrl(const QUrl &url) const
return m_visitedLinkWriter->IsVisited(toGurl(url));
}
-static void ensureDirectoryExists(const base::FilePath &path)
-{
- if (base::PathExists(path))
- return;
-
- base::File::Error error;
- if (base::CreateDirectoryAndGetError(path, &error))
- return;
-
- std::string errorstr = base::File::ErrorToString(error);
- qWarning("Cannot create directory %s. Error: %s.",
- path.AsUTF8Unsafe().c_str(),
- errorstr.c_str());
-}
-
VisitedLinksManagerQt::VisitedLinksManagerQt(ProfileQt *profile, bool persistVisitedLinks)
: m_delegate(new VisitedLinkDelegateQt)
{
Q_ASSERT(profile);
if (persistVisitedLinks)
- ensureDirectoryExists(profile->GetPath());
+ profile->profileAdapter()->ensureDataPathExists();
m_visitedLinkWriter.reset(new visitedlink::VisitedLinkWriter(profile, m_delegate.data(), persistVisitedLinks));
m_visitedLinkWriter->Init();
}
diff --git a/src/core/visited_links_manager_qt.h b/src/core/visited_links_manager_qt.h
index c4e24ce1f..7bcf32d52 100644
--- a/src/core/visited_links_manager_qt.h
+++ b/src/core/visited_links_manager_qt.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
//
// W A R N I N G
@@ -55,9 +19,7 @@
#include <QList>
#include <QScopedPointer>
-QT_BEGIN_NAMESPACE
-class QUrl;
-QT_END_NAMESPACE
+QT_FORWARD_DECLARE_CLASS(QUrl)
namespace visitedlink {
class VisitedLinkWriter;
@@ -70,7 +32,7 @@ namespace QtWebEngineCore {
class ProfileQt;
class VisitedLinkDelegateQt;
-class Q_WEBENGINECORE_PRIVATE_EXPORT VisitedLinksManagerQt {
+class Q_WEBENGINECORE_EXPORT VisitedLinksManagerQt {
public:
virtual~VisitedLinksManagerQt();
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index ef482ef08..7ffeaaa5b 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
@@ -43,17 +7,19 @@
#include "web_contents_adapter.h"
+#include "autofill_client_qt.h"
+#include "content_browser_client_qt.h"
#include "devtools_frontend_qt.h"
#include "download_manager_delegate_qt.h"
+#include "favicon_driver_qt.h"
+#include "favicon_service_factory_qt.h"
+#include "find_text_helper.h"
#include "media_capture_devices_dispatcher.h"
-#if QT_CONFIG(webengine_printing_and_pdf)
-#include "printing/print_view_manager_qt.h"
-#endif
-#include "profile_adapter_client.h"
+#include "pdf_util_qt.h"
#include "profile_adapter.h"
#include "profile_qt.h"
-#include "qwebenginecallback_p.h"
-#include "renderer_host/render_view_observer_host_qt.h"
+#include "qwebengineloadinginfo.h"
+#include "renderer_host/web_engine_page_host.h"
#include "render_widget_host_view_qt.h"
#include "type_conversion.h"
#include "web_contents_view_qt.h"
@@ -61,39 +27,62 @@
#include "web_engine_settings.h"
#include "base/command_line.h"
-#include "base/run_loop.h"
-#include "base/task/post_task.h"
+#include "base/metrics/user_metrics.h"
+#include "base/task/current_thread.h"
#include "base/task/sequence_manager/sequence_manager_impl.h"
#include "base/task/sequence_manager/thread_controller_with_message_pump_impl.h"
#include "base/values.h"
+#include "chrome/browser/tab_contents/form_interaction_tab_helper.h"
+#include "components/autofill/core/browser/autofill_manager.h"
+#include "components/autofill/content/browser/content_autofill_driver_factory.h"
+#include "components/embedder_support/user_agent_utils.h"
+#include "components/favicon/core/favicon_service.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/renderer_host/text_input_manager.h"
#include "content/browser/web_contents/web_contents_impl.h"
-#include "content/public/browser/browser_task_traits.h"
-#include "content/public/browser/child_process_security_policy.h"
#include "content/public/browser/devtools_agent_host.h"
#include "content/public/browser/download_manager.h"
#include "content/public/browser/download_request_utils.h"
#include "content/public/browser/host_zoom_map.h"
#include "content/public/browser/navigation_entry.h"
+#include "content/public/browser/navigation_entry_restore_context.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/favicon_status.h"
-#include "content/public/common/content_constants.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/drop_data.h"
-#include "content/public/common/page_state.h"
-#include "content/public/common/page_zoom.h"
#include "content/public/common/url_constants.h"
-#include "content/public/common/web_preferences.h"
#include "extensions/buildflags/buildflags.h"
-#include "third_party/blink/public/common/media/media_player_action.h"
#include "third_party/blink/public/common/page/page_zoom.h"
+#include "third_party/blink/public/common/page_state/page_state.h"
#include "third_party/blink/public/common/peerconnection/webrtc_ip_handling_policy.h"
-#include "printing/buildflags/buildflags.h"
-#include "ui/base/clipboard/clipboard.h"
+#include "third_party/blink/public/common/web_preferences/web_preferences.h"
+#include "third_party/blink/public/mojom/frame/media_player_action.mojom.h"
#include "ui/base/clipboard/clipboard_constants.h"
#include "ui/base/clipboard/custom_data_helper.h"
#include "ui/gfx/font_render_params.h"
+#include "ui/native_theme/native_theme.h"
+#include "qtwebengine/browser/qtwebenginepage.mojom.h"
+
+#include <QtCore/QVariant>
+#include <QtCore/QElapsedTimer>
+#include <QtCore/QMimeData>
+#include <QtCore/QTemporaryDir>
+#include <QtGui/QDrag>
+#include <QtGui/QDragEnterEvent>
+#include <QtGui/QGuiApplication>
+#include <QtGui/QPageLayout>
+#include <QtGui/QPixmap>
+#include <QtGui/QStyleHints>
+
+#if QT_CONFIG(accessibility)
+#include "browser_accessibility_qt.h"
+#include "content/browser/accessibility/browser_accessibility_manager.h"
+#include <QtGui/qaccessible.h>
+#endif
+
+#if QT_CONFIG(webengine_printing_and_pdf)
+#include "printing/print_view_manager_qt.h"
+#endif
#if QT_CONFIG(webengine_webchannel)
#include "renderer_host/web_channel_ipc_transport_host.h"
@@ -104,38 +93,18 @@
#include "extensions/extension_web_contents_observer_qt.h"
#endif
-#include <QDir>
-#include <QGuiApplication>
-#include <QPageLayout>
-#include <QStringList>
-#include <QStyleHints>
-#include <QTimer>
-#include <QVariant>
-#include <QtCore/qelapsedtimer.h>
-#include <QtCore/qmimedata.h>
-#include <QtCore/qtemporarydir.h>
-#include <QtGui/qdrag.h>
-#include <QtGui/qpixmap.h>
-
-// Can't include headers as qaccessible.h conflicts with Chromium headers.
-namespace content {
-extern QAccessibleInterface *toQAccessibleInterface(BrowserAccessibility *acc);
-}
-
namespace QtWebEngineCore {
#define CHECK_INITIALIZED(return_value) \
if (!isInitialized()) \
return return_value
-#define CHECK_VALID_RENDER_WIDGET_HOST_VIEW(render_view_host) \
- if (!render_view_host->IsRenderViewLive() && render_view_host->GetWidget()->GetView()) { \
+#define CHECK_VALID_RENDER_WIDGET_HOST_VIEW(render_frame_host) \
+ if (!render_frame_host->IsRenderFrameLive() && render_frame_host->GetView()) { \
LOG(WARNING) << "Ignore navigation due to terminated render process with invalid RenderWidgetHostView."; \
return; \
}
-static const int kTestWindowWidth = 800;
-static const int kTestWindowHeight = 600;
static const int kHistoryStreamVersion = 4;
static QVariant fromJSValue(const base::Value *result)
@@ -146,57 +115,48 @@ static QVariant fromJSValue(const base::Value *result)
break;
case base::Value::Type::BOOLEAN:
{
- bool out;
- if (result->GetAsBoolean(&out))
- ret.setValue(out);
+ if (auto out = result->GetIfBool())
+ ret.setValue(*out);
break;
}
case base::Value::Type::INTEGER:
{
- int out;
- if (result->GetAsInteger(&out))
- ret.setValue(out);
+ if (auto out = result->GetIfInt())
+ ret.setValue(*out);
break;
}
case base::Value::Type::DOUBLE:
{
- double out;
- if (result->GetAsDouble(&out))
- ret.setValue(out);
+ if (auto out = result->GetIfDouble())
+ ret.setValue(*out);
break;
}
case base::Value::Type::STRING:
{
- base::string16 out;
- if (result->GetAsString(&out))
- ret.setValue(toQt(out));
+ if (auto out = result->GetIfString())
+ ret.setValue(toQt(*out));
break;
}
case base::Value::Type::LIST:
{
- const base::ListValue *out;
- if (result->GetAsList(&out)) {
+ if (const auto out = result->GetIfList()) {
+ size_t size = out->size();
QVariantList list;
- list.reserve(out->GetSize());
- for (size_t i = 0; i < out->GetSize(); ++i) {
- const base::Value *outVal = 0;
- if (out->Get(i, &outVal) && outVal)
- list.insert(i, fromJSValue(outVal));
+ list.reserve(size);
+ for (size_t i = 0; i < size; ++i) {
+ auto &outVal = (*out)[i];
+ list.insert(i, fromJSValue(&outVal));
}
ret.setValue(list);
}
break;
}
- case base::Value::Type::DICTIONARY:
+ case base::Value::Type::DICT:
{
- const base::DictionaryValue *out;
- if (result->GetAsDictionary(&out)) {
+ if (const auto dict = result->GetIfDict()) {
QVariantMap map;
- base::DictionaryValue::Iterator it(*out);
- while (!it.IsAtEnd()) {
- map.insert(toQt(it.key()), fromJSValue(&it.value()));
- it.Advance();
- }
+ for (const auto pair : *dict)
+ map.insert(toQt(pair.first), fromJSValue(&pair.second));
ret.setValue(map);
}
break;
@@ -240,7 +200,6 @@ static void callbackOnPdfSavingFinished(WebContentsAdapterClient *adapterClient,
static std::unique_ptr<content::WebContents> createBlankWebContents(WebContentsAdapterClient *adapterClient, content::BrowserContext *browserContext)
{
content::WebContents::CreateParams create_params(browserContext, nullptr);
- create_params.routing_id = MSG_ROUTING_NONE;
create_params.initially_hidden = true;
std::unique_ptr<content::WebContents> webContents = content::WebContents::Create(create_params);
@@ -250,10 +209,28 @@ static std::unique_ptr<content::WebContents> createBlankWebContents(WebContentsA
return webContents;
}
+static int navigationListSize(content::NavigationController &controller) {
+ // If we're currently on the initial NavigationEntry, no navigation has
+ // committed, so the initial NavigationEntry should not be part of the
+ // "Navigation List", and we should return 0 as the navigation list size.
+ if (controller.GetLastCommittedEntry()->IsInitialEntry())
+ return 0;
+ return controller.GetEntryCount();
+}
+
+static int navigationListCurrentIndex(content::NavigationController &controller) {
+ // If we're currently on the initial NavigationEntry, no navigation has
+ // committed, so the initial NavigationEntry should not be part of the
+ // "Navigation List", and we should return -1 as the current index.
+ if (controller.GetLastCommittedEntry()->IsInitialEntry())
+ return -1;
+ return controller.GetCurrentEntryIndex();
+}
+
static void serializeNavigationHistory(content::NavigationController &controller, QDataStream &output)
{
- const int currentIndex = controller.GetCurrentEntryIndex();
- const int count = controller.GetEntryCount();
+ const int currentIndex = navigationListCurrentIndex(controller);
+ const int count = navigationListSize(controller);
const int pendingIndex = controller.GetPendingEntryIndex();
output << kHistoryStreamVersion;
@@ -302,6 +279,8 @@ static void deserializeNavigationHistory(QDataStream &input, int *currentIndex,
int count;
input >> count >> *currentIndex;
+ std::unique_ptr<content::NavigationEntryRestoreContext> context = content::NavigationEntryRestoreContext::Create();
+
entries->reserve(count);
// Logic taken from SerializedNavigationEntry::ReadFromPickle and ToNavigationEntries.
for (int i = 0; i < count; ++i) {
@@ -341,7 +320,8 @@ static void deserializeNavigationHistory(QDataStream &input, int *currentIndex,
std::unique_ptr<content::NavigationEntry> entry = content::NavigationController::CreateNavigationEntry(
toGurl(virtualUrl),
content::Referrer(toGurl(referrerUrl), static_cast<network::mojom::ReferrerPolicy>(referrerPolicy)),
- base::nullopt, // optional initiator_origin
+ absl::nullopt, // optional initiator_origin
+ absl::nullopt, // optional initiator_base_url
// Use a transition type of reload so that we don't incorrectly
// increase the typed count.
ui::PAGE_TRANSITION_RELOAD,
@@ -352,7 +332,7 @@ static void deserializeNavigationHistory(QDataStream &input, int *currentIndex,
nullptr);
entry->SetTitle(toString16(title));
- entry->SetPageState(content::PageState::CreateFromEncodedData(std::string(pageState.data(), pageState.size())));
+ entry->SetPageState(blink::PageState::CreateFromEncodedData(std::string(pageState.data(), pageState.size())), context.get());
entry->SetHasPostData(hasPostData);
entry->SetOriginalRequestURL(toGurl(originalRequestUrl));
entry->SetIsOverridingUserAgent(isOverridingUserAgent);
@@ -370,15 +350,18 @@ static void deserializeNavigationHistory(QDataStream &input, int *currentIndex,
}
}
-static void Navigate(WebContentsAdapter *adapter, const content::NavigationController::LoadURLParams &params)
+namespace {
+
+void Navigate(WebContentsAdapter *adapter, const content::NavigationController::LoadURLParams &params)
{
Q_ASSERT(adapter);
adapter->webContents()->GetController().LoadURLWithParams(params);
adapter->focusIfNecessary();
adapter->resetSelection();
+ adapter->findTextHelper()->stopFinding();
}
-static void NavigateTask(QWeakPointer<WebContentsAdapter> weakAdapter, const content::NavigationController::LoadURLParams &params)
+void NavigateTask(QWeakPointer<WebContentsAdapter> weakAdapter, const content::NavigationController::LoadURLParams &params)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
const auto adapter = weakAdapter.toStrongRef();
@@ -387,7 +370,6 @@ static void NavigateTask(QWeakPointer<WebContentsAdapter> weakAdapter, const con
Navigate(adapter.get(), params);
}
-namespace {
static QList<WebContentsAdapter *> recursive_guard_loading_adapters;
class LoadRecursionGuard {
@@ -423,52 +405,30 @@ QSharedPointer<WebContentsAdapter> WebContentsAdapter::createFromSerializedNavig
// Unlike WebCore, Chromium only supports Restoring to a new WebContents instance.
std::unique_ptr<content::WebContents> newWebContents = createBlankWebContents(adapterClient, adapterClient->profileAdapter()->profile());
content::NavigationController &controller = newWebContents->GetController();
- controller.Restore(currentIndex, content::RestoreType::LAST_SESSION_EXITED_CLEANLY, &entries);
-
- if (controller.GetActiveEntry()) {
- // Set up the file access rights for the selected navigation entry.
- // TODO(joth): This is duplicated from chrome/.../session_restore.cc and
- // should be shared e.g. in NavigationController. http://crbug.com/68222
- const int id = newWebContents->GetMainFrame()->GetProcess()->GetID();
- const content::PageState& pageState = controller.GetActiveEntry()->GetPageState();
- const std::vector<base::FilePath>& filePaths = pageState.GetReferencedFiles();
- for (std::vector<base::FilePath>::const_iterator file = filePaths.begin(); file != filePaths.end(); ++file)
- content::ChildProcessSecurityPolicy::GetInstance()->GrantReadFile(id, *file);
- }
+ controller.Restore(currentIndex, content::RestoreType::kRestored, &entries);
return QSharedPointer<WebContentsAdapter>::create(std::move(newWebContents));
}
-WebContentsAdapter::WebContentsAdapter()
+WebContentsAdapter::WebContentsAdapter(std::unique_ptr<content::WebContents> webContents)
: m_profileAdapter(nullptr)
- , m_webContents(nullptr)
+ , m_webContents(std::move(webContents))
#if QT_CONFIG(webengine_webchannel)
, m_webChannel(nullptr)
, m_webChannelWorld(0)
#endif
, m_adapterClient(nullptr)
- , m_nextRequestId(CallbackDirectory::ReservedCallbackIdsEnd)
- , m_currentDropAction(blink::kWebDragOperationNone)
+ , m_nextRequestId(1)
+ , m_currentDropAction(blink::kDragOperationNone)
, m_devToolsFrontend(nullptr)
{
// This has to be the first thing we create, and the last we destroy.
WebEngineContext::current();
}
-WebContentsAdapter::WebContentsAdapter(std::unique_ptr<content::WebContents> webContents)
- : m_profileAdapter(nullptr)
- , m_webContents(std::move(webContents))
-#if QT_CONFIG(webengine_webchannel)
- , m_webChannel(nullptr)
- , m_webChannelWorld(0)
-#endif
- , m_adapterClient(nullptr)
- , m_nextRequestId(CallbackDirectory::ReservedCallbackIdsEnd)
- , m_currentDropAction(blink::kWebDragOperationNone)
- , m_devToolsFrontend(nullptr)
+WebContentsAdapter::WebContentsAdapter()
+ : WebContentsAdapter(nullptr)
{
- // This has to be the first thing we create, and the last we destroy.
- WebEngineContext::current();
}
WebContentsAdapter::~WebContentsAdapter()
@@ -486,7 +446,7 @@ void WebContentsAdapter::setClient(WebContentsAdapterClient *adapterClient)
Q_ASSERT(m_profileAdapter);
// This might replace any adapter that has been initialized with this WebEngineSettings.
- adapterClient->webEngineSettings()->setWebContentsAdapter(this);
+ WebEngineSettings::get(adapterClient->webEngineSettings())->setWebContentsAdapter(this);
}
bool WebContentsAdapter::isInitialized() const
@@ -494,6 +454,10 @@ bool WebContentsAdapter::isInitialized() const
return (bool)m_webContentsDelegate;
}
+ui::NativeTheme::PreferredColorScheme toWeb(Qt::ColorScheme colorScheme) {
+ return colorScheme == Qt::ColorScheme::Dark ? ui::NativeTheme::PreferredColorScheme::kDark : ui::NativeTheme::PreferredColorScheme::kLight;
+}
+
void WebContentsAdapter::initialize(content::SiteInstance *site)
{
Q_ASSERT(m_adapterClient);
@@ -510,7 +474,7 @@ void WebContentsAdapter::initialize(content::SiteInstance *site)
// Create and attach observers to the WebContents.
m_webContentsDelegate.reset(new WebContentsDelegateQt(m_webContents.get(), m_adapterClient));
- m_renderViewObserverHost.reset(new RenderViewObserverHostQt(m_webContents.get(), m_adapterClient));
+ m_pageHost.reset(new WebEnginePageHost(m_webContents.get(), m_adapterClient));
// Let the WebContent's view know about the WebContentsAdapterClient.
WebContentsViewQt* contentsView = static_cast<WebContentsViewQt*>(static_cast<content::WebContentsImpl*>(m_webContents.get())->GetView());
@@ -526,6 +490,12 @@ void WebContentsAdapter::initialize(content::SiteInstance *site)
extensions::ExtensionWebContentsObserverQt::CreateForWebContents(webContents());
#endif
+ content::BrowserContext *context = webContents()->GetBrowserContext();
+ FaviconDriverQt::CreateForWebContents(
+ webContents(), FaviconServiceFactoryQt::GetForBrowserContext(context), m_adapterClient);
+
+ AutofillClientQt::CreateForWebContents(webContents());
+
// Create an instance of WebEngineVisitedLinksManager to catch the first
// content::NOTIFICATION_RENDERER_PROCESS_CREATED event. This event will
// force to initialize visited links in VisitedLinkSlave.
@@ -535,24 +505,32 @@ void WebContentsAdapter::initialize(content::SiteInstance *site)
// Create a RenderView with the initial empty document
content::RenderViewHost *rvh = m_webContents->GetRenderViewHost();
Q_ASSERT(rvh);
- if (!rvh->IsRenderViewLive())
- static_cast<content::WebContentsImpl*>(m_webContents.get())->CreateRenderViewForRenderManager(rvh, MSG_ROUTING_NONE, MSG_ROUTING_NONE, base::UnguessableToken::Create(), content::FrameReplicationState());
+ if (!m_webContents->GetPrimaryMainFrame()->IsRenderFrameLive())
+ static_cast<content::WebContentsImpl*>(m_webContents.get())->CreateRenderViewForRenderManager(
+ rvh, absl::nullopt, nullptr);
m_webContentsDelegate->RenderViewHostChanged(nullptr, rvh);
+ // Make sure the system theme's light/dark mode is propagated to webpages
+ QObject::connect(QGuiApplication::styleHints(), &QStyleHints::colorSchemeChanged, [](Qt::ColorScheme colorScheme){
+ ui::NativeTheme::GetInstanceForWeb()->set_preferred_color_scheme(toWeb(colorScheme));
+ });
+ ui::NativeTheme::GetInstanceForWeb()->set_preferred_color_scheme(toWeb(QGuiApplication::styleHints()->colorScheme()));
+
m_adapterClient->initializationFinished();
}
void WebContentsAdapter::initializeRenderPrefs()
{
- blink::mojom::RendererPreferences *rendererPrefs = m_webContents->GetMutableRendererPrefs();
+ blink::RendererPreferences *rendererPrefs = m_webContents->GetMutableRendererPrefs();
rendererPrefs->use_custom_colors = true;
// Qt returns a flash time (the whole cycle) in ms, chromium expects just the interval in
// seconds
const int qtCursorFlashTime = QGuiApplication::styleHints()->cursorFlashTime();
rendererPrefs->caret_blink_interval =
- base::TimeDelta::FromMillisecondsD(0.5 * static_cast<double>(qtCursorFlashTime));
- rendererPrefs->user_agent_override = m_profileAdapter->httpUserAgent().toStdString();
+ base::Milliseconds(0.5 * static_cast<double>(qtCursorFlashTime));
+ rendererPrefs->user_agent_override = blink::UserAgentOverride::UserAgentOnly(m_profileAdapter->httpUserAgent().toStdString());
+ rendererPrefs->user_agent_override.ua_metadata_override = profile()->userAgentMetadata();
rendererPrefs->accept_languages = m_profileAdapter->httpAcceptLanguageWithoutQualities().toStdString();
#if QT_CONFIG(webengine_webrtc)
base::CommandLine* commandLine = base::CommandLine::ForCurrentProcess();
@@ -561,10 +539,13 @@ void WebContentsAdapter::initializeRenderPrefs()
commandLine->GetSwitchValueASCII(switches::kForceWebRtcIPHandlingPolicy);
else
rendererPrefs->webrtc_ip_handling_policy =
- m_adapterClient->webEngineSettings()->testAttribute(WebEngineSettings::WebRTCPublicInterfacesOnly)
+ m_adapterClient->webEngineSettings()->testAttribute(
+ QWebEngineSettings::WebRTCPublicInterfacesOnly)
? blink::kWebRTCIPHandlingDefaultPublicInterfaceOnly
: blink::kWebRTCIPHandlingDefault;
#endif
+ rendererPrefs->can_accept_load_drops = m_adapterClient->webEngineSettings()->testAttribute(QWebEngineSettings::NavigateOnDropEnabled);
+
// Set web-contents font settings to the default font settings as Chromium constantly overrides
// the global font defaults with the font settings of the latest web-contents created.
static const gfx::FontRenderParams params = gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(), nullptr);
@@ -598,8 +579,9 @@ bool WebContentsAdapter::canGoToOffset(int offset) const
void WebContentsAdapter::stop()
{
CHECK_INITIALIZED();
- content::NavigationController& controller = m_webContents->GetController();
+ base::RecordAction(base::UserMetricsAction("Stop"));
+ content::NavigationController& controller = m_webContents->GetController();
int index = controller.GetPendingEntryIndex();
if (index != -1)
controller.RemoveEntryAtIndex(index);
@@ -611,10 +593,12 @@ void WebContentsAdapter::stop()
void WebContentsAdapter::reload()
{
CHECK_INITIALIZED();
+ base::RecordAction(base::UserMetricsAction("Reload"));
+
bool wasDiscarded = (m_lifecycleState == LifecycleState::Discarded);
setLifecycleState(LifecycleState::Active);
- CHECK_VALID_RENDER_WIDGET_HOST_VIEW(m_webContents->GetRenderViewHost());
- WebEngineSettings *settings = m_adapterClient->webEngineSettings();
+ CHECK_VALID_RENDER_WIDGET_HOST_VIEW(m_webContents->GetPrimaryMainFrame());
+ WebEngineSettings *settings = WebEngineSettings::get(m_adapterClient->webEngineSettings());
settings->doApply();
if (!wasDiscarded) // undiscard() already triggers a reload
m_webContents->GetController().Reload(content::ReloadType::NORMAL, /*checkRepost = */false);
@@ -624,10 +608,12 @@ void WebContentsAdapter::reload()
void WebContentsAdapter::reloadAndBypassCache()
{
CHECK_INITIALIZED();
+ base::RecordAction(base::UserMetricsAction("ReloadBypassingCache"));
+
bool wasDiscarded = (m_lifecycleState == LifecycleState::Discarded);
setLifecycleState(LifecycleState::Active);
- CHECK_VALID_RENDER_WIDGET_HOST_VIEW(m_webContents->GetRenderViewHost());
- WebEngineSettings *settings = m_adapterClient->webEngineSettings();
+ CHECK_VALID_RENDER_WIDGET_HOST_VIEW(m_webContents->GetPrimaryMainFrame());
+ WebEngineSettings *settings = WebEngineSettings::get(m_adapterClient->webEngineSettings());
settings->doApply();
if (!wasDiscarded) // undiscard() already triggers a reload
m_webContents->GetController().Reload(content::ReloadType::BYPASSING_CACHE, /*checkRepost = */false);
@@ -648,6 +634,7 @@ void WebContentsAdapter::load(const QUrl &url)
void WebContentsAdapter::load(const QWebEngineHttpRequest &request)
{
+ base::RecordAction(base::UserMetricsAction("LoadURL"));
GURL gurl = toGurl(request.url());
if (!isInitialized()) {
scoped_refptr<content::SiteInstance> site =
@@ -657,10 +644,9 @@ void WebContentsAdapter::load(const QWebEngineHttpRequest &request)
setLifecycleState(LifecycleState::Active);
}
- CHECK_VALID_RENDER_WIDGET_HOST_VIEW(m_webContents->GetRenderViewHost());
+ CHECK_VALID_RENDER_WIDGET_HOST_VIEW(m_webContents->GetPrimaryMainFrame());
- WebEngineSettings *settings = m_adapterClient->webEngineSettings();
- settings->doApply();
+ WebEngineSettings::get(m_adapterClient->webEngineSettings())->doApply();
// The situation can occur when relying on the editingFinished signal in QML to set the url
// of the WebView.
@@ -701,10 +687,11 @@ void WebContentsAdapter::load(const QWebEngineHttpRequest &request)
params.load_type = content::NavigationController::LOAD_TYPE_HTTP_POST;
// chromium accepts LOAD_TYPE_HTTP_POST only for the HTTP and HTTPS protocols
if (!params.url.SchemeIsHTTPOrHTTPS()) {
- m_adapterClient->loadFinished(false, request.url(), false,
- net::ERR_DISALLOWED_URL_SCHEME,
- QCoreApplication::translate("WebContentsAdapter",
- "HTTP-POST data can only be sent over HTTP(S) protocol"));
+ m_adapterClient->loadFinished(QWebEngineLoadingInfo(
+ request.url(), QWebEngineLoadingInfo::LoadFailedStatus, false,
+ QCoreApplication::translate("WebContentsAdapter",
+ "HTTP-POST data can only be sent over HTTP(S) protocol"),
+ net::ERR_DISALLOWED_URL_SCHEME));
return;
}
params.post_data = network::ResourceRequestBody::CreateFromBytes(
@@ -714,8 +701,8 @@ void WebContentsAdapter::load(const QWebEngineHttpRequest &request)
}
// convert the custom headers into the format that chromium expects
- QVector<QByteArray> headers = request.headers();
- for (QVector<QByteArray>::const_iterator it = headers.cbegin(); it != headers.cend(); ++it) {
+ QList<QByteArray> headers = request.headers();
+ for (QList<QByteArray>::const_iterator it = headers.cbegin(); it != headers.cend(); ++it) {
if (params.extra_headers.length() > 0)
params.extra_headers += '\n';
params.extra_headers += (*it).toStdString() + ": " + request.header(*it).toStdString();
@@ -731,7 +718,7 @@ void WebContentsAdapter::load(const QWebEngineHttpRequest &request)
if (resizeNeeded) {
// Schedule navigation on the event loop.
- base::PostTask(FROM_HERE, {content::BrowserThread::UI},
+ content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
base::BindOnce(&NavigateTask, sharedFromThis().toWeakRef(), std::move(params)));
} else {
Navigate(this, params);
@@ -745,10 +732,9 @@ void WebContentsAdapter::setContent(const QByteArray &data, const QString &mimeT
else
setLifecycleState(LifecycleState::Active);
- CHECK_VALID_RENDER_WIDGET_HOST_VIEW(m_webContents->GetRenderViewHost());
+ CHECK_VALID_RENDER_WIDGET_HOST_VIEW(m_webContents->GetPrimaryMainFrame());
- WebEngineSettings *settings = m_adapterClient->webEngineSettings();
- settings->doApply();
+ WebEngineSettings::get(m_adapterClient->webEngineSettings())->doApply();
QByteArray encodedData = data.toPercentEncoding();
std::string urlString;
@@ -760,7 +746,8 @@ void WebContentsAdapter::setContent(const QByteArray &data, const QString &mimeT
GURL dataUrlToLoad(urlString);
if (dataUrlToLoad.spec().size() > url::kMaxURLChars) {
- m_adapterClient->loadFinished(false, baseUrl, false, net::ERR_ABORTED);
+ m_adapterClient->loadFinished(QWebEngineLoadingInfo(baseUrl, QWebEngineLoadingInfo::LoadFailedStatus,
+ false, QString(), net::ERR_ABORTED));
return;
}
content::NavigationController::LoadURLParams params((dataUrlToLoad));
@@ -776,7 +763,8 @@ void WebContentsAdapter::setContent(const QByteArray &data, const QString &mimeT
void WebContentsAdapter::save(const QString &filePath, int savePageFormat)
{
CHECK_INITIALIZED();
- m_webContentsDelegate->setSavePageInfo(SavePageInfo(filePath, savePageFormat));
+ base::RecordAction(base::UserMetricsAction("SavePage"));
+ m_webContentsDelegate->setSavePageInfo(new SavePageInfo(filePath, savePageFormat));
m_webContents->OnSavePage();
}
@@ -805,12 +793,15 @@ QUrl WebContentsAdapter::requestedUrl() const
QUrl WebContentsAdapter::iconUrl() const
{
CHECK_INITIALIZED(QUrl());
- if (content::NavigationEntry* entry = m_webContents->GetController().GetVisibleEntry()) {
- content::FaviconStatus &favicon = entry->GetFavicon();
- if (favicon.valid)
- return toQt(favicon.url);
- }
- return QUrl();
+ FaviconDriverQt *driver = FaviconDriverQt::FromWebContents(webContents());
+ return toQt(driver->GetFaviconURL());
+}
+
+QIcon WebContentsAdapter::icon() const
+{
+ CHECK_INITIALIZED(QIcon());
+ FaviconDriverQt *driver = FaviconDriverQt::FromWebContents(webContents());
+ return toQIcon(driver->GetFavicon());
}
QString WebContentsAdapter::pageTitle() const
@@ -830,42 +821,49 @@ QString WebContentsAdapter::selectedText() const
void WebContentsAdapter::undo()
{
CHECK_INITIALIZED();
+ base::RecordAction(base::UserMetricsAction("Undo"));
m_webContents->Undo();
}
void WebContentsAdapter::redo()
{
CHECK_INITIALIZED();
+ base::RecordAction(base::UserMetricsAction("Redo"));
m_webContents->Redo();
}
void WebContentsAdapter::cut()
{
CHECK_INITIALIZED();
+ base::RecordAction(base::UserMetricsAction("Cut"));
m_webContents->Cut();
}
void WebContentsAdapter::copy()
{
CHECK_INITIALIZED();
+ base::RecordAction(base::UserMetricsAction("Copy"));
m_webContents->Copy();
}
void WebContentsAdapter::paste()
{
CHECK_INITIALIZED();
+ base::RecordAction(base::UserMetricsAction("Paste"));
m_webContents->Paste();
}
void WebContentsAdapter::pasteAndMatchStyle()
{
CHECK_INITIALIZED();
+ base::RecordAction(base::UserMetricsAction("PasteAndMatchStyle"));
m_webContents->PasteAndMatchStyle();
}
void WebContentsAdapter::selectAll()
{
CHECK_INITIALIZED();
+ base::RecordAction(base::UserMetricsAction("SelectAll"));
m_webContents->SelectAll();
}
@@ -884,7 +882,8 @@ void WebContentsAdapter::unselect()
void WebContentsAdapter::navigateBack()
{
CHECK_INITIALIZED();
- CHECK_VALID_RENDER_WIDGET_HOST_VIEW(m_webContents->GetRenderViewHost());
+ base::RecordAction(base::UserMetricsAction("Back"));
+ CHECK_VALID_RENDER_WIDGET_HOST_VIEW(m_webContents->GetPrimaryMainFrame());
if (!m_webContents->GetController().CanGoBack())
return;
m_webContents->GetController().GoBack();
@@ -894,7 +893,8 @@ void WebContentsAdapter::navigateBack()
void WebContentsAdapter::navigateForward()
{
CHECK_INITIALIZED();
- CHECK_VALID_RENDER_WIDGET_HOST_VIEW(m_webContents->GetRenderViewHost());
+ base::RecordAction(base::UserMetricsAction("Forward"));
+ CHECK_VALID_RENDER_WIDGET_HOST_VIEW(m_webContents->GetPrimaryMainFrame());
if (!m_webContents->GetController().CanGoForward())
return;
m_webContents->GetController().GoForward();
@@ -904,7 +904,7 @@ void WebContentsAdapter::navigateForward()
void WebContentsAdapter::navigateToIndex(int offset)
{
CHECK_INITIALIZED();
- CHECK_VALID_RENDER_WIDGET_HOST_VIEW(m_webContents->GetRenderViewHost());
+ CHECK_VALID_RENDER_WIDGET_HOST_VIEW(m_webContents->GetPrimaryMainFrame());
m_webContents->GetController().GoToIndex(offset);
focusIfNecessary();
}
@@ -912,7 +912,7 @@ void WebContentsAdapter::navigateToIndex(int offset)
void WebContentsAdapter::navigateToOffset(int offset)
{
CHECK_INITIALIZED();
- CHECK_VALID_RENDER_WIDGET_HOST_VIEW(m_webContents->GetRenderViewHost());
+ CHECK_VALID_RENDER_WIDGET_HOST_VIEW(m_webContents->GetPrimaryMainFrame());
m_webContents->GetController().GoToOffset(offset);
focusIfNecessary();
}
@@ -920,13 +920,13 @@ void WebContentsAdapter::navigateToOffset(int offset)
int WebContentsAdapter::navigationEntryCount()
{
CHECK_INITIALIZED(0);
- return m_webContents->GetController().GetEntryCount();
+ return navigationListSize(m_webContents->GetController());
}
int WebContentsAdapter::currentNavigationEntryIndex()
{
CHECK_INITIALIZED(0);
- return m_webContents->GetController().GetCurrentEntryIndex();
+ return navigationListCurrentIndex(m_webContents->GetController());
}
QUrl WebContentsAdapter::getNavigationEntryOriginalUrl(int index)
@@ -990,9 +990,8 @@ void WebContentsAdapter::setZoomFactor(qreal factor)
content::HostZoomMap *zoomMap = content::HostZoomMap::GetForWebContents(m_webContents.get());
if (zoomMap) {
- int render_process_id = m_webContents->GetMainFrame()->GetProcess()->GetID();
- int render_view_id = m_webContents->GetRenderViewHost()->GetRoutingID();
- zoomMap->SetTemporaryZoomLevel(render_process_id, render_view_id, zoomLevel);
+ const content::GlobalRenderFrameHostId global_id = m_webContents->GetPrimaryMainFrame()->GetGlobalId();
+ zoomMap->SetTemporaryZoomLevel(global_id, zoomLevel);
}
}
@@ -1028,15 +1027,13 @@ QWebEngineUrlRequestInterceptor* WebContentsAdapter::requestInterceptor() const
QAccessibleInterface *WebContentsAdapter::browserAccessible()
{
CHECK_INITIALIZED(nullptr);
- content::RenderViewHost *rvh = m_webContents->GetRenderViewHost();
- Q_ASSERT(rvh);
- content::RenderFrameHostImpl *rfh = static_cast<content::RenderFrameHostImpl *>(rvh->GetMainFrame());
+ content::RenderFrameHostImpl *rfh = static_cast<content::RenderFrameHostImpl *>(m_webContents->GetPrimaryMainFrame());
if (!rfh)
return nullptr;
content::BrowserAccessibilityManager *manager = rfh->GetOrCreateBrowserAccessibilityManager();
if (!manager) // FIXME!
return nullptr;
- content::BrowserAccessibility *acc = manager->GetRoot();
+ content::BrowserAccessibility *acc = manager->GetFromAXNode(manager->GetRoot());
return content::toQAccessibleInterface(acc);
}
@@ -1045,58 +1042,63 @@ QAccessibleInterface *WebContentsAdapter::browserAccessible()
void WebContentsAdapter::runJavaScript(const QString &javaScript, quint32 worldId)
{
CHECK_INITIALIZED();
- content::RenderViewHost *rvh = m_webContents->GetRenderViewHost();
- Q_ASSERT(rvh);
-// static_cast<content::RenderFrameHostImpl *>(rvh->GetMainFrame())->NotifyUserActivation();
- if (worldId == 0) {
- rvh->GetMainFrame()->ExecuteJavaScript(toString16(javaScript), base::NullCallback());
+ content::RenderFrameHost *rfh = m_webContents->GetPrimaryMainFrame();
+ Q_ASSERT(rfh);
+ if (!static_cast<content::RenderFrameHostImpl*>(rfh)->GetAssociatedLocalFrame()) {
+ qWarning() << "Local frame is gone, not running script";
return;
}
-
- content::RenderFrameHost::JavaScriptResultCallback callback = base::BindOnce(&callbackOnEvaluateJS, m_adapterClient, CallbackDirectory::NoCallbackId);
- rvh->GetMainFrame()->ExecuteJavaScriptInIsolatedWorld(toString16(javaScript), std::move(callback), worldId);
+ if (worldId == 0)
+ rfh->ExecuteJavaScript(toString16(javaScript), base::NullCallback());
+ else
+ rfh->ExecuteJavaScriptInIsolatedWorld(toString16(javaScript), base::NullCallback(), worldId);
}
quint64 WebContentsAdapter::runJavaScriptCallbackResult(const QString &javaScript, quint32 worldId)
{
CHECK_INITIALIZED(0);
- content::RenderViewHost *rvh = m_webContents->GetRenderViewHost();
- Q_ASSERT(rvh);
-// static_cast<content::RenderFrameHostImpl *>(rvh->GetMainFrame())->NotifyUserActivation();
+ content::RenderFrameHost *rfh = m_webContents->GetPrimaryMainFrame();
+ Q_ASSERT(rfh);
+ if (!static_cast<content::RenderFrameHostImpl*>(rfh)->GetAssociatedLocalFrame()) {
+ qWarning() << "Local frame is gone, not running script";
+ return 0;
+ }
content::RenderFrameHost::JavaScriptResultCallback callback = base::BindOnce(&callbackOnEvaluateJS, m_adapterClient, m_nextRequestId);
if (worldId == 0)
- rvh->GetMainFrame()->ExecuteJavaScript(toString16(javaScript), std::move(callback));
+ rfh->ExecuteJavaScript(toString16(javaScript), std::move(callback));
else
- rvh->GetMainFrame()->ExecuteJavaScriptInIsolatedWorld(toString16(javaScript), std::move(callback), worldId);
+ rfh->ExecuteJavaScriptInIsolatedWorld(toString16(javaScript), std::move(callback), worldId);
return m_nextRequestId++;
}
quint64 WebContentsAdapter::fetchDocumentMarkup()
{
CHECK_INITIALIZED(0);
- m_renderViewObserverHost->fetchDocumentMarkup(m_nextRequestId);
+ m_pageHost->FetchDocumentMarkup(m_nextRequestId);
return m_nextRequestId++;
}
quint64 WebContentsAdapter::fetchDocumentInnerText()
{
CHECK_INITIALIZED(0);
- m_renderViewObserverHost->fetchDocumentInnerText(m_nextRequestId);
+ m_pageHost->FetchDocumentInnerText(m_nextRequestId);
return m_nextRequestId++;
}
-void WebContentsAdapter::updateWebPreferences(const content::WebPreferences & webPreferences)
+void WebContentsAdapter::updateWebPreferences(const blink::web_pref::WebPreferences &webPreferences)
{
CHECK_INITIALIZED();
- m_webContents->GetRenderViewHost()->UpdateWebkitPreferences(webPreferences);
+ m_webContents->SetWebPreferences(webPreferences);
// In case of updating preferences during navigation, there might be a pending RVH what will
// be active on successful navigation.
- content::RenderFrameHost *pendingRFH = (static_cast<content::WebContentsImpl*>(m_webContents.get()))->GetPendingMainFrame();
+ content::RenderFrameHost *pendingRFH =
+ (static_cast<content::WebContentsImpl*>(m_webContents.get()))
+ ->GetPrimaryFrameTree().root()->render_manager()->speculative_frame_host();
if (pendingRFH) {
content::RenderViewHost *pendingRVH = pendingRFH->GetRenderViewHost();
Q_ASSERT(pendingRVH);
- pendingRVH->UpdateWebkitPreferences(webPreferences);
+ static_cast<content::RenderViewHostImpl*>(pendingRVH)->SendWebPreferencesToRenderer();
}
}
@@ -1106,13 +1108,12 @@ void WebContentsAdapter::download(const QUrl &url, const QString &suggestedFileN
{
CHECK_INITIALIZED();
content::BrowserContext *bctx = m_webContents->GetBrowserContext();
- content::DownloadManager *dlm = content::BrowserContext::GetDownloadManager(bctx);
+ content::DownloadManager *dlm = bctx->GetDownloadManager();
DownloadManagerDelegateQt *dlmd = m_profileAdapter->downloadManagerDelegate();
if (!dlm)
return;
- dlmd->markNextDownloadAsUserRequested();
dlm->SetDelegate(dlmd);
net::NetworkTrafficAnnotationTag traffic_annotation =
@@ -1172,7 +1173,7 @@ qint64 WebContentsAdapter::renderProcessPid() const
{
CHECK_INITIALIZED(0);
- content::RenderProcessHost *renderProcessHost = m_webContents->GetMainFrame()->GetProcess();
+ content::RenderProcessHost *renderProcessHost = m_webContents->GetPrimaryMainFrame()->GetProcess();
const base::Process &process = renderProcessHost->GetProcess();
if (!process.IsValid())
return 0;
@@ -1182,25 +1183,25 @@ qint64 WebContentsAdapter::renderProcessPid() const
void WebContentsAdapter::copyImageAt(const QPoint &location)
{
CHECK_INITIALIZED();
- m_webContents->GetRenderViewHost()->GetMainFrame()->CopyImageAt(location.x(), location.y());
+ m_webContents->GetPrimaryMainFrame()->CopyImageAt(location.x(), location.y());
}
-static blink::MediaPlayerAction::Type toBlinkMediaPlayerActionType(WebContentsAdapter::MediaPlayerAction action)
+static blink::mojom::MediaPlayerActionType toBlinkMediaPlayerActionType(WebContentsAdapter::MediaPlayerAction action)
{
switch (action) {
case WebContentsAdapter::MediaPlayerPlay:
- return blink::MediaPlayerAction::Type::kPlay;
+ return blink::mojom::MediaPlayerActionType::kPlay;
case WebContentsAdapter::MediaPlayerMute:
- return blink::MediaPlayerAction::Type::kMute;
+ return blink::mojom::MediaPlayerActionType::kMute;
case WebContentsAdapter::MediaPlayerLoop:
- return blink::MediaPlayerAction::Type::kLoop;
+ return blink::mojom::MediaPlayerActionType::kLoop;
case WebContentsAdapter::MediaPlayerControls:
- return blink::MediaPlayerAction::Type::kControls;
+ return blink::mojom::MediaPlayerActionType::kControls;
case WebContentsAdapter::MediaPlayerNoAction:
break;
}
NOTREACHED();
- return (blink::MediaPlayerAction::Type)-1;
+ return (blink::mojom::MediaPlayerActionType)-1;
}
void WebContentsAdapter::executeMediaPlayerActionAt(const QPoint &location, MediaPlayerAction action, bool enable)
@@ -1208,8 +1209,8 @@ void WebContentsAdapter::executeMediaPlayerActionAt(const QPoint &location, Medi
CHECK_INITIALIZED();
if (action == MediaPlayerNoAction)
return;
- blink::MediaPlayerAction blinkAction(toBlinkMediaPlayerActionType(action), enable);
- m_webContents->GetRenderViewHost()->GetMainFrame()->ExecuteMediaPlayerActionAtLocation(toGfx(location), blinkAction);
+ blink::mojom::MediaPlayerAction blinkAction(toBlinkMediaPlayerActionType(action), enable);
+ m_webContents->GetPrimaryMainFrame()->ExecuteMediaPlayerActionAtLocation(toGfx(location), blinkAction);
}
void WebContentsAdapter::inspectElementAt(const QPoint &location)
@@ -1260,7 +1261,10 @@ void WebContentsAdapter::openDevToolsFrontend(QSharedPointer<WebContentsAdapter>
setLifecycleState(LifecycleState::Active);
- m_devToolsFrontend = DevToolsFrontendQt::Show(frontendAdapter, m_webContents.get());
+ content::WebContents *webContents = m_webContents.get();
+ if (content::WebContents *guest = guestWebContents())
+ webContents = guest;
+ m_devToolsFrontend = DevToolsFrontendQt::Show(frontendAdapter, webContents);
updateRecommendedState();
}
@@ -1280,15 +1284,22 @@ void WebContentsAdapter::devToolsFrontendDestroyed(DevToolsFrontendQt *frontend)
updateRecommendedState();
}
+QString WebContentsAdapter::devToolsId()
+{
+ return QString::fromStdString(DevToolsFrontendQt::GetId(m_webContents.get()));
+}
+
void WebContentsAdapter::exitFullScreen()
{
CHECK_INITIALIZED();
+ base::RecordAction(base::UserMetricsAction("ToggleFullscreen"));
m_webContents->ExitFullscreen(false);
}
void WebContentsAdapter::changedFullScreen()
{
CHECK_INITIALIZED();
+ base::RecordAction(base::UserMetricsAction("ToggleFullscreen"));
m_webContents->NotifyFullscreenChanged(false);
}
@@ -1304,33 +1315,42 @@ void WebContentsAdapter::wasHidden()
m_webContents->WasHidden();
}
-void WebContentsAdapter::printToPDF(const QPageLayout &pageLayout, const QString &filePath)
+void WebContentsAdapter::printToPDF(const QPageLayout &pageLayout, const QPageRanges &pageRanges, const QString &filePath)
{
#if QT_CONFIG(webengine_printing_and_pdf)
CHECK_INITIALIZED();
- PrintViewManagerQt::PrintToPDFFileCallback callback = base::Bind(&callbackOnPdfSavingFinished,
- m_adapterClient,
- filePath);
- PrintViewManagerQt::FromWebContents(m_webContents.get())->PrintToPDFFileWithCallback(pageLayout,
- true,
- filePath,
- callback);
+ PrintViewManagerQt::PrintToPDFFileCallback callback = base::BindOnce(&callbackOnPdfSavingFinished,
+ m_adapterClient,
+ filePath);
+ content::WebContents *webContents = m_webContents.get();
+ if (content::WebContents *guest = guestWebContents())
+ webContents = guest;
+ PrintViewManagerQt::FromWebContents(webContents)->PrintToPDFFileWithCallback(pageLayout,
+ pageRanges,
+ true,
+ filePath,
+ std::move(callback));
#endif // QT_CONFIG(webengine_printing_and_pdf)
}
quint64 WebContentsAdapter::printToPDFCallbackResult(const QPageLayout &pageLayout,
+ const QPageRanges &pageRanges,
bool colorMode,
bool useCustomMargins)
{
#if QT_CONFIG(webengine_printing_and_pdf)
CHECK_INITIALIZED(0);
- PrintViewManagerQt::PrintToPDFCallback callback = base::Bind(&callbackOnPrintingFinished,
- m_adapterClient,
- m_nextRequestId);
- PrintViewManagerQt::FromWebContents(m_webContents.get())->PrintToPDFWithCallback(pageLayout,
- colorMode,
- useCustomMargins,
- callback);
+ PrintViewManagerQt::PrintToPDFCallback callback = base::BindOnce(&callbackOnPrintingFinished,
+ m_adapterClient,
+ m_nextRequestId);
+ content::WebContents *webContents = m_webContents.get();
+ if (content::WebContents *guest = guestWebContents())
+ webContents = guest;
+ PrintViewManagerQt::FromWebContents(webContents)->PrintToPDFWithCallback(pageLayout,
+ pageRanges,
+ colorMode,
+ useCustomMargins,
+ std::move(callback));
return m_nextRequestId++;
#else
Q_UNUSED(pageLayout);
@@ -1375,7 +1395,7 @@ void WebContentsAdapter::grantFeaturePermission(const QUrl &securityOrigin, Prof
void WebContentsAdapter::grantMouseLockPermission(const QUrl &securityOrigin, bool granted)
{
CHECK_INITIALIZED();
- if (securityOrigin != toQt(m_webContents->GetLastCommittedURL().GetOrigin()))
+ if (securityOrigin != toQt(m_webContents->GetLastCommittedURL().DeprecatedGetOriginAsURL()))
return;
if (granted) {
@@ -1393,15 +1413,17 @@ void WebContentsAdapter::grantMouseLockPermission(const QUrl &securityOrigin, bo
granted = false;
}
- m_webContents->GotResponseToLockMouseRequest(granted);
+ m_webContents->GotResponseToLockMouseRequest(granted ? blink::mojom::PointerLockResult::kSuccess
+ : blink::mojom::PointerLockResult::kPermissionDenied);
}
void WebContentsAdapter::handlePendingMouseLockPermission()
{
CHECK_INITIALIZED();
- auto it = m_pendingMouseLockPermissions.find(toQt(m_webContents->GetLastCommittedURL().GetOrigin()));
+ auto it = m_pendingMouseLockPermissions.find(toQt(m_webContents->GetLastCommittedURL().DeprecatedGetOriginAsURL()));
if (it != m_pendingMouseLockPermissions.end()) {
- m_webContents->GotResponseToLockMouseRequest(it.value());
+ m_webContents->GotResponseToLockMouseRequest(it.value() ? blink::mojom::PointerLockResult::kSuccess
+ : blink::mojom::PointerLockResult::kPermissionDenied);
m_pendingMouseLockPermissions.erase(it);
}
}
@@ -1409,8 +1431,13 @@ void WebContentsAdapter::handlePendingMouseLockPermission()
void WebContentsAdapter::setBackgroundColor(const QColor &color)
{
CHECK_INITIALIZED();
- if (content::RenderWidgetHostView *rwhv = m_webContents->GetRenderWidgetHostView())
- rwhv->SetBackgroundColor(toSk(color));
+ SkColor c = toSk(color);
+ if (content::RenderWidgetHostView *rwhv = m_webContents->GetRenderWidgetHostView()) {
+ rwhv->SetBackgroundColor(c);
+ ((content::RenderWidgetHostViewBase *)rwhv)->SetContentBackgroundColor(c);
+ }
+ if (color != Qt::transparent)
+ m_pageHost->SetBackgroundColor(c);
}
content::WebContents *WebContentsAdapter::webContents() const
@@ -1418,6 +1445,12 @@ content::WebContents *WebContentsAdapter::webContents() const
return m_webContents.get();
}
+content::WebContents *WebContentsAdapter::guestWebContents() const
+{
+ std::vector<content::WebContents *> innerWebContents = m_webContents->GetInnerWebContents();
+ return !innerWebContents.empty() ? innerWebContents[0] : nullptr;
+}
+
#if QT_CONFIG(webengine_webchannel)
QWebChannel *WebContentsAdapter::webChannel() const
{
@@ -1454,12 +1487,14 @@ void WebContentsAdapter::setWebChannel(QWebChannel *channel, uint worldId)
static QMimeData *mimeDataFromDropData(const content::DropData &dropData)
{
QMimeData *mimeData = new QMimeData();
- if (!dropData.text.is_null())
- mimeData->setText(toQt(dropData.text.string()));
- if (!dropData.html.is_null())
- mimeData->setHtml(toQt(dropData.html.string()));
- if (dropData.url.is_valid())
+ if (dropData.text.has_value())
+ mimeData->setText(toQt(*dropData.text));
+ if (dropData.html.has_value())
+ mimeData->setHtml(toQt(*dropData.html));
+ if (dropData.url.is_valid()) {
mimeData->setUrls(QList<QUrl>() << toQt(dropData.url));
+ mimeData->setText(toQt(dropData.url_title));
+ }
if (!dropData.custom_data.empty()) {
base::Pickle pickle;
ui::WriteCustomDataToPickle(dropData.custom_data, &pickle);
@@ -1468,16 +1503,16 @@ static QMimeData *mimeDataFromDropData(const content::DropData &dropData)
return mimeData;
}
-static blink::WebDragOperationsMask toWeb(const Qt::DropActions action)
+static blink::DragOperationsMask toWeb(const Qt::DropActions action)
{
- int result = blink::kWebDragOperationNone;
+ int result = blink::kDragOperationNone;
if (action & Qt::CopyAction)
- result |= blink::kWebDragOperationCopy;
+ result |= blink::kDragOperationCopy;
if (action & Qt::LinkAction)
- result |= blink::kWebDragOperationLink;
+ result |= blink::kDragOperationLink;
if (action & Qt::MoveAction)
- result |= blink::kWebDragOperationMove;
- return static_cast<blink::WebDragOperationsMask>(result);
+ result |= blink::kDragOperationMove;
+ return static_cast<blink::DragOperationsMask>(result);
}
void WebContentsAdapter::startDragging(QObject *dragSource, const content::DropData &dropData,
@@ -1496,7 +1531,7 @@ void WebContentsAdapter::startDragging(QObject *dragSource, const content::DropD
m_currentDropData->file_contents.clear();
m_currentDropData->file_contents_content_disposition.clear();
- m_currentDropAction = blink::kWebDragOperationNone;
+ m_currentDropAction = blink::kDragOperationNone;
QDrag *drag = new QDrag(dragSource); // will be deleted by Qt's DnD implementation
bool dValid = true;
QMetaObject::Connection onDestroyed = QObject::connect(dragSource, &QObject::destroyed, [&dValid](){
@@ -1514,18 +1549,26 @@ void WebContentsAdapter::startDragging(QObject *dragSource, const content::DropD
}
{
- base::MessageLoopCurrent::ScopedNestableTaskAllower allow;
+ base::CurrentThread::ScopedAllowApplicationTasksInNativeNestedLoop allow;
drag->exec(allowedActions);
}
QObject::disconnect(onDestroyed);
if (dValid) {
if (m_webContents) {
- content::RenderViewHost *rvh = m_webContents->GetRenderViewHost();
+ // This is the quickest and (at the moment) the most safe solution to not break guest views when
+ // dropping data into them. We don't even try to support dropping into PDF input fields,
+ // since it's not working in Chrome right now.
+ content::WebContents *targetWebContents = m_webContents.get();
+ if (content::WebContents *guest = guestWebContents())
+ targetWebContents = guest;
+
+ content::RenderViewHost *rvh = targetWebContents->GetRenderViewHost();
if (rvh) {
rvh->GetWidget()->DragSourceEndedAt(gfx::PointF(m_lastDragClientPos.x(), m_lastDragClientPos.y()),
gfx::PointF(m_lastDragScreenPos.x(), m_lastDragScreenPos.y()),
- blink::WebDragOperation(m_currentDropAction));
+ ui::mojom::DragOperation(m_currentDropAction),
+ base::DoNothing());
rvh->GetWidget()->DragSourceSystemDragEnded();
}
}
@@ -1576,23 +1619,28 @@ static void fillDropDataFromMimeData(content::DropData *dropData, const QMimeDat
}
if (!dropData->filenames.empty())
return;
+ if (!urls.empty()) {
+ dropData->url = toGurl(urls.first());
+ if (mimeData->hasText())
+ dropData->url_title = toString16(mimeData->text());
+ }
if (mimeData->hasHtml())
- dropData->html = toNullableString16(mimeData->html());
+ dropData->html = toOptionalString16(mimeData->html());
if (mimeData->hasText())
- dropData->text = toNullableString16(mimeData->text());
+ dropData->text = toOptionalString16(mimeData->text());
if (mimeData->hasFormat(QLatin1String(ui::kMimeTypeWebCustomData))) {
QByteArray customData = mimeData->data(QLatin1String(ui::kMimeTypeWebCustomData));
ui::ReadCustomDataIntoMap(customData.constData(), customData.length(), &dropData->custom_data);
}
}
-Qt::DropAction toQt(blink::WebDragOperation op)
+Qt::DropAction toQt(ui::mojom::DragOperation op)
{
- if (op & blink::kWebDragOperationCopy)
+ if (int(op) & int(ui::mojom::DragOperation::kCopy))
return Qt::CopyAction;
- if (op & blink::kWebDragOperationLink)
+ if (int(op) & int(ui::mojom::DragOperation::kLink))
return Qt::LinkAction;
- if (op & blink::kWebDragOperationMove || op & blink::kWebDragOperationDelete)
+ if (int(op) & int(ui::mojom::DragOperation::kMove))
return Qt::MoveAction;
return Qt::IgnoreAction;
}
@@ -1635,21 +1683,22 @@ void WebContentsAdapter::enterDrag(QDragEnterEvent *e, const QPointF &screenPos)
content::RenderViewHost *rvh = m_webContents->GetRenderViewHost();
rvh->GetWidget()->FilterDropData(m_currentDropData.get());
- rvh->GetWidget()->DragTargetDragEnter(*m_currentDropData, toGfx(e->posF()), toGfx(screenPos),
+ rvh->GetWidget()->DragTargetDragEnter(*m_currentDropData, toGfx(e->position()), toGfx(screenPos),
toWeb(e->possibleActions()),
- toWeb(e->mouseButtons()) | toWeb(e->keyboardModifiers()));
+ toWeb(e->buttons()) | toWeb(e->modifiers()),
+ base::DoNothing());
}
Qt::DropAction WebContentsAdapter::updateDragPosition(QDragMoveEvent *e, const QPointF &screenPos)
{
CHECK_INITIALIZED(Qt::DropAction());
content::RenderViewHost *rvh = m_webContents->GetRenderViewHost();
- m_lastDragClientPos = e->posF();
+ m_lastDragClientPos = e->position();
m_lastDragScreenPos = screenPos;
rvh->GetWidget()->DragTargetDragOver(toGfx(m_lastDragClientPos), toGfx(m_lastDragScreenPos), toWeb(e->possibleActions()),
- toWeb(e->mouseButtons()) | toWeb(e->keyboardModifiers()));
+ toWeb(e->buttons()) | toWeb(e->modifiers()), base::DoNothing());
waitForUpdateDragActionCalled();
- return toQt(blink::WebDragOperation(m_currentDropAction));
+ return toQt(ui::mojom::DragOperation(m_currentDropAction));
}
void WebContentsAdapter::waitForUpdateDragActionCalled()
@@ -1658,7 +1707,7 @@ void WebContentsAdapter::waitForUpdateDragActionCalled()
const qint64 timeout = 3000;
QElapsedTimer t;
t.start();
- auto seqMan = base::MessageLoopCurrent::GetCurrentSequenceManagerImpl();
+ auto seqMan = base::CurrentThread::GetCurrentSequenceManagerImpl();
base::MessagePump::Delegate *delegate =
static_cast<base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl *>(
seqMan->controller_.get());
@@ -1666,7 +1715,7 @@ void WebContentsAdapter::waitForUpdateDragActionCalled()
DCHECK(delegate);
m_updateDragActionCalled = false;
for (;;) {
- while (delegate->DoWork() && !m_updateDragActionCalled) {}
+ while (delegate->DoWork().is_immediate() && !m_updateDragActionCalled) {}
if (m_updateDragActionCalled)
break;
if (t.hasExpired(timeout)) {
@@ -1674,7 +1723,7 @@ void WebContentsAdapter::waitForUpdateDragActionCalled()
static_cast<int>(timeout));
return;
}
- base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(1));
+ base::PlatformThread::Sleep(base::Milliseconds(1));
}
}
@@ -1682,7 +1731,7 @@ void WebContentsAdapter::updateDragAction(int action)
{
CHECK_INITIALIZED();
m_updateDragActionCalled = true;
- m_currentDropAction = static_cast<blink::WebDragOperation>(action);
+ m_currentDropAction = action;
}
void WebContentsAdapter::endDragging(QDropEvent *e, const QPointF &screenPos)
@@ -1690,10 +1739,10 @@ void WebContentsAdapter::endDragging(QDropEvent *e, const QPointF &screenPos)
CHECK_INITIALIZED();
content::RenderViewHost *rvh = m_webContents->GetRenderViewHost();
rvh->GetWidget()->FilterDropData(m_currentDropData.get());
- m_lastDragClientPos = e->posF();
+ m_lastDragClientPos = e->position();
m_lastDragScreenPos = screenPos;
rvh->GetWidget()->DragTargetDrop(*m_currentDropData, toGfx(m_lastDragClientPos), toGfx(m_lastDragScreenPos),
- toWeb(e->mouseButtons()) | toWeb(e->keyboardModifiers()));
+ toWeb(e->buttons()) | toWeb(e->modifiers()), base::DoNothing());
m_currentDropData.reset();
}
@@ -1718,8 +1767,8 @@ void WebContentsAdapter::replaceMisspelling(const QString &word)
void WebContentsAdapter::focusIfNecessary()
{
CHECK_INITIALIZED();
- const WebEngineSettings *settings = m_adapterClient->webEngineSettings();
- bool focusOnNavigation = settings->testAttribute(WebEngineSettings::FocusOnNavigationEnabled);
+ const QWebEngineSettings *settings = m_adapterClient->webEngineSettings();
+ bool focusOnNavigation = settings->testAttribute(QWebEngineSettings::FocusOnNavigationEnabled);
if (focusOnNavigation)
m_webContents->Focus();
}
@@ -1737,7 +1786,29 @@ void WebContentsAdapter::resetSelection()
if (auto rwhv = static_cast<RenderWidgetHostViewQt *>(m_webContents->GetRenderWidgetHostView())) {
if (auto mgr = rwhv->GetTextInputManager())
if (auto selection = const_cast<content::TextInputManager::TextSelection *>(mgr->GetTextSelection(rwhv)))
- selection->SetSelection(base::string16(), 0, gfx::Range(), false);
+ selection->SetSelection(std::u16string(), 0, gfx::Range(), false);
+ }
+}
+
+void WebContentsAdapter::resetTouchSelectionController()
+{
+ CHECK_INITIALIZED();
+ unselect();
+ if (auto rwhv = static_cast<RenderWidgetHostViewQt *>(m_webContents->GetRenderWidgetHostView()))
+ rwhv->resetTouchSelectionController();
+}
+
+void WebContentsAdapter::changeTextDirection(bool leftToRight)
+{
+ CHECK_INITIALIZED();
+ if (auto rwhv = static_cast<RenderWidgetHostViewQt *>(m_webContents->GetRenderWidgetHostView())) {
+ auto textInputManager = rwhv->GetTextInputManager();
+ if (!textInputManager)
+ return;
+ if (auto activeWidget = textInputManager->GetActiveWidget()) {
+ activeWidget->UpdateTextDirection(leftToRight ? base::i18n::TextDirection::LEFT_TO_RIGHT : base::i18n::TextDirection::RIGHT_TO_LEFT);
+ activeWidget->NotifyTextDirection();
+ }
}
}
@@ -1749,18 +1820,20 @@ WebContentsAdapterClient::renderProcessExitStatus(int terminationStatus) {
status = WebContentsAdapterClient::NormalTerminationStatus;
break;
case base::TERMINATION_STATUS_ABNORMAL_TERMINATION:
+ case base::TERMINATION_STATUS_LAUNCH_FAILED:
status = WebContentsAdapterClient::AbnormalTerminationStatus;
break;
case base::TERMINATION_STATUS_PROCESS_WAS_KILLED:
-#if defined(OS_CHROMEOS)
- case base::TERMINATION_STATUS_PROCESS_WAS_KILLED_BY_OOM:
-#endif
+ case base::TERMINATION_STATUS_OOM:
status = WebContentsAdapterClient::KilledTerminationStatus;
break;
case base::TERMINATION_STATUS_PROCESS_CRASHED:
-#if defined(OS_ANDROID)
+#if BUILDFLAG(IS_ANDROID)
case base::TERMINATION_STATUS_OOM_PROTECTED:
#endif
+#if BUILDFLAG(IS_WIN)
+ case base::TERMINATION_STATUS_INTEGRITY_FAILURE:
+#endif
status = WebContentsAdapterClient::CrashedTerminationStatus;
break;
case base::TERMINATION_STATUS_STILL_RUNNING:
@@ -1772,12 +1845,6 @@ WebContentsAdapterClient::renderProcessExitStatus(int terminationStatus) {
return status;
}
-FaviconManager *WebContentsAdapter::faviconManager()
-{
- CHECK_INITIALIZED(nullptr);
- return m_webContentsDelegate->faviconManager();
-}
-
FindTextHelper *WebContentsAdapter::findTextHelper()
{
CHECK_INITIALIZED(nullptr);
@@ -1787,7 +1854,8 @@ FindTextHelper *WebContentsAdapter::findTextHelper()
void WebContentsAdapter::viewSource()
{
CHECK_INITIALIZED();
- m_webContents->GetMainFrame()->ViewSource();
+ base::RecordAction(base::UserMetricsAction("ViewSource"));
+ m_webContents->GetPrimaryMainFrame()->ViewSource();
}
bool WebContentsAdapter::canViewSource()
@@ -1893,13 +1961,13 @@ WebContentsAdapter::LifecycleState WebContentsAdapter::determineRecommendedState
return LifecycleState::Frozen;
// Form input is not saved.
- if (m_webContents->GetPageImportanceSignals().had_form_interaction)
+ if (FormInteractionTabHelper::FromWebContents(m_webContents.get())->had_form_interaction())
return LifecycleState::Frozen;
// Do not discard PDFs as they might contain entry that is not saved and they
// don't remember their scrolling positions. See crbug.com/547286 and
// crbug.com/65244.
- if (m_webContents->GetContentsMimeType() == "application/pdf")
+ if (m_webContents->GetContentsMimeType() == kPDFMimeType)
return LifecycleState::Frozen;
return LifecycleState::Discarded;
@@ -1959,6 +2027,7 @@ void WebContentsAdapter::discard()
if (m_webContents->IsLoading()) {
m_webContentsDelegate->didFailLoad(m_webContentsDelegate->url(webContents()), net::Error::ERR_ABORTED,
QStringLiteral("Discarded"));
+ m_webContentsDelegate->DidStopLoading();
}
content::WebContents::CreateParams createParams(m_profileAdapter->profile());
@@ -1973,7 +2042,7 @@ void WebContentsAdapter::discard()
nullContents->SetWasDiscarded(true);
// Kill render process if this is the only page it's got.
- content::RenderProcessHost *renderProcessHost = m_webContents->GetMainFrame()->GetProcess();
+ content::RenderProcessHost *renderProcessHost = m_webContents->GetPrimaryMainFrame()->GetProcess();
renderProcessHost->FastShutdownIfPossible(/* page_count */ 1u,
/* skip_unload_handlers */ false);
@@ -1984,14 +2053,14 @@ void WebContentsAdapter::discard()
m_webChannel = nullptr;
m_webChannelWorld = 0;
#endif
- m_renderViewObserverHost.reset();
+ m_pageHost.reset();
m_webContentsDelegate.reset();
m_webContents.reset();
m_webContents = std::move(nullContents);
initializeRenderPrefs();
m_webContentsDelegate = std::move(nullDelegate);
- m_renderViewObserverHost.reset(new RenderViewObserverHostQt(m_webContents.get(), m_adapterClient));
+ m_pageHost.reset(new WebEnginePageHost(m_webContents.get(), m_adapterClient));
WebContentsViewQt *contentsView =
static_cast<WebContentsViewQt *>(static_cast<content::WebContentsImpl *>(m_webContents.get())->GetView());
contentsView->setClient(m_adapterClient);
@@ -2010,11 +2079,9 @@ void WebContentsAdapter::undiscard()
// Create a RenderView with the initial empty document
content::RenderViewHost *rvh = m_webContents->GetRenderViewHost();
Q_ASSERT(rvh);
- if (!rvh->IsRenderViewLive())
+ if (!m_webContents->GetPrimaryMainFrame()->IsRenderFrameLive())
static_cast<content::WebContentsImpl *>(m_webContents.get())
- ->CreateRenderViewForRenderManager(rvh, MSG_ROUTING_NONE, MSG_ROUTING_NONE,
- base::UnguessableToken::Create(),
- content::FrameReplicationState());
+ ->CreateRenderViewForRenderManager(rvh, absl::nullopt, nullptr);
m_webContentsDelegate->RenderViewHostChanged(nullptr, rvh);
m_adapterClient->initializationFinished();
m_adapterClient->selectionChanged();
@@ -2037,9 +2104,9 @@ ASSERT_ENUMS_MATCH(ReferrerPolicy::NoReferrerWhenDowngrade, network::mojom::Refe
ASSERT_ENUMS_MATCH(ReferrerPolicy::Never, network::mojom::ReferrerPolicy::kNever)
ASSERT_ENUMS_MATCH(ReferrerPolicy::Origin, network::mojom::ReferrerPolicy::kOrigin)
ASSERT_ENUMS_MATCH(ReferrerPolicy::OriginWhenCrossOrigin, network::mojom::ReferrerPolicy::kOriginWhenCrossOrigin)
-ASSERT_ENUMS_MATCH(ReferrerPolicy::NoReferrerWhenDowngradeOriginWhenCrossOrigin, network::mojom::ReferrerPolicy::kNoReferrerWhenDowngradeOriginWhenCrossOrigin)
+//ASSERT_ENUMS_MATCH(ReferrerPolicy::NoReferrerWhenDowngradeOriginWhenCrossOrigin, network::mojom::ReferrerPolicy::kNoReferrerWhenDowngradeOriginWhenCrossOrigin)
ASSERT_ENUMS_MATCH(ReferrerPolicy::SameOrigin, network::mojom::ReferrerPolicy::kSameOrigin)
ASSERT_ENUMS_MATCH(ReferrerPolicy::StrictOrigin, network::mojom::ReferrerPolicy::kStrictOrigin)
-ASSERT_ENUMS_MATCH(ReferrerPolicy::Last, network::mojom::ReferrerPolicy::kLast)
+ASSERT_ENUMS_MATCH(ReferrerPolicy::Last, network::mojom::ReferrerPolicy::kMaxValue)
} // namespace QtWebEngineCore
diff --git a/src/core/web_contents_adapter.h b/src/core/web_contents_adapter.h
index d833314f2..62c3f087c 100644
--- a/src/core/web_contents_adapter.h
+++ b/src/core/web_contents_adapter.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
//
// W A R N I N G
@@ -51,22 +15,27 @@
#ifndef WEB_CONTENTS_ADAPTER_H
#define WEB_CONTENTS_ADAPTER_H
-#include "qtwebenginecoreglobal_p.h"
-#include "web_contents_adapter_client.h"
-#include <memory>
+#include <QtCore/QSharedPointer>
+#include <QtCore/QString>
+#include <QtCore/QUrl>
+#include <QtCore/QPointer>
#include <QtGui/qtgui-config.h>
+#include <QtWebEngineCore/private/qtwebenginecoreglobal_p.h>
+#include <QtWebEngineCore/qwebenginecontextmenurequest.h>
#include <QtWebEngineCore/qwebenginehttprequest.h>
-#include <QScopedPointer>
-#include <QSharedPointer>
-#include <QString>
-#include <QUrl>
-#include <QPointer>
+#include "web_contents_adapter_client.h"
+
+#include <memory>
+
+namespace blink {
+namespace web_pref {
+struct WebPreferences;
+}
+}
namespace content {
class WebContents;
-struct WebPreferences;
-struct OpenURLParams;
class SiteInstance;
}
@@ -77,7 +46,7 @@ class QDragMoveEvent;
class QDropEvent;
class QMimeData;
class QPageLayout;
-class QString;
+class QPageRanges;
class QTemporaryDir;
class QWebChannel;
class QWebEngineUrlRequestInterceptor;
@@ -86,15 +55,12 @@ QT_END_NAMESPACE
namespace QtWebEngineCore {
class DevToolsFrontendQt;
-class FaviconManager;
class FindTextHelper;
-class MessagePassingInterface;
class ProfileQt;
-class RenderViewObserverHostQt;
+class WebEnginePageHost;
class WebChannelIPCTransportHost;
-class WebEngineContext;
-class Q_WEBENGINECORE_PRIVATE_EXPORT WebContentsAdapter : public QEnableSharedFromThis<WebContentsAdapter> {
+class Q_WEBENGINECORE_EXPORT WebContentsAdapter : public QEnableSharedFromThis<WebContentsAdapter> {
public:
static QSharedPointer<WebContentsAdapter> createFromSerializedNavigationHistory(QDataStream &input, WebContentsAdapterClient *adapterClient);
WebContentsAdapter();
@@ -132,6 +98,7 @@ public:
QString pageTitle() const;
QString selectedText() const;
QUrl iconUrl() const;
+ QIcon icon() const;
void undo();
void redo();
@@ -161,7 +128,7 @@ public:
quint64 runJavaScriptCallbackResult(const QString &javaScript, quint32 worldId);
quint64 fetchDocumentMarkup();
quint64 fetchDocumentInnerText();
- void updateWebPreferences(const content::WebPreferences &webPreferences);
+ void updateWebPreferences(const blink::web_pref::WebPreferences &webPreferences);
void download(const QUrl &url, const QString &suggestedFileName,
const QUrl &referrerUrl = QUrl(),
ReferrerPolicy referrerPolicy = ReferrerPolicy::Default);
@@ -192,6 +159,7 @@ public:
void openDevToolsFrontend(QSharedPointer<WebContentsAdapter> devtoolsFrontend);
void closeDevToolsFrontend();
void devToolsFrontendDestroyed(DevToolsFrontendQt *frontend);
+ QString devToolsId();
void grantMediaAccessPermission(const QUrl &securityOrigin, WebContentsAdapterClient::MediaRequestFlags flags);
void grantMouseLockPermission(const QUrl &securityOrigin, bool granted);
@@ -205,8 +173,8 @@ public:
#if QT_CONFIG(webengine_webchannel)
QWebChannel *webChannel() const;
void setWebChannel(QWebChannel *, uint worldId);
+ WebChannelIPCTransportHost *webChannelTransport() { return m_webChannelTransport.get(); }
#endif
- FaviconManager *faviconManager();
FindTextHelper *findTextHelper();
QPointF lastScrollOffset() const;
@@ -221,8 +189,8 @@ public:
void endDragging(QDropEvent *e, const QPointF &screenPos);
void leaveDrag();
#endif // QT_CONFIG(draganddrop)
- void printToPDF(const QPageLayout&, const QString&);
- quint64 printToPDFCallbackResult(const QPageLayout &,
+ void printToPDF(const QPageLayout&, const QPageRanges &, const QString&);
+ quint64 printToPDFCallbackResult(const QPageLayout &, const QPageRanges &,
bool colorMode = true,
bool useCustomMargins = true);
@@ -233,10 +201,13 @@ public:
bool isFindTextInProgress() const;
bool hasFocusedFrame() const;
void resetSelection();
+ void resetTouchSelectionController();
+ void changeTextDirection(bool leftToRight);
// meant to be used within WebEngineCore only
void initialize(content::SiteInstance *site);
content::WebContents *webContents() const;
+ content::WebContents *guestWebContents() const;
void updateRecommendedState();
void setRequestInterceptor(QWebEngineUrlRequestInterceptor *interceptor);
QWebEngineUrlRequestInterceptor* requestInterceptor() const;
@@ -261,7 +232,7 @@ private:
ProfileAdapter *m_profileAdapter;
std::unique_ptr<content::WebContents> m_webContents;
std::unique_ptr<WebContentsDelegateQt> m_webContentsDelegate;
- std::unique_ptr<RenderViewObserverHostQt> m_renderViewObserverHost;
+ std::unique_ptr<WebEnginePageHost> m_pageHost;
#if QT_CONFIG(webengine_webchannel)
std::unique_ptr<WebChannelIPCTransportHost> m_webChannelTransport;
QWebChannel *m_webChannel;
diff --git a/src/core/web_contents_adapter_client.h b/src/core/web_contents_adapter_client.h
index 04df99f0e..1a1474644 100644
--- a/src/core/web_contents_adapter_client.h
+++ b/src/core/web_contents_adapter_client.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
//
// W A R N I N G
@@ -51,26 +15,28 @@
#ifndef WEB_CONTENTS_ADAPTER_CLIENT_H
#define WEB_CONTENTS_ADAPTER_CLIENT_H
-#include "qtwebenginecoreglobal_p.h"
+#include <QtWebEngineCore/private/qtwebenginecoreglobal_p.h>
#include "profile_adapter.h"
#include <QFlags>
#include <QRect>
-#include <QSharedPointer>
#include <QString>
#include <QStringList>
#include <QUrl>
-QT_FORWARD_DECLARE_CLASS(CertificateErrorController)
-QT_FORWARD_DECLARE_CLASS(ClientCertSelectController)
QT_FORWARD_DECLARE_CLASS(QKeyEvent)
QT_FORWARD_DECLARE_CLASS(QVariant)
+QT_FORWARD_DECLARE_CLASS(QWebEngineFileSystemAccessRequest)
QT_FORWARD_DECLARE_CLASS(QWebEngineFindTextResult)
-QT_FORWARD_DECLARE_CLASS(QWebEngineQuotaRequest)
+QT_FORWARD_DECLARE_CLASS(QWebEngineLoadingInfo)
QT_FORWARD_DECLARE_CLASS(QWebEngineRegisterProtocolHandlerRequest)
QT_FORWARD_DECLARE_CLASS(QWebEngineUrlRequestInfo)
QT_FORWARD_DECLARE_CLASS(QWebEngineUrlRequestInterceptor)
+QT_FORWARD_DECLARE_CLASS(QWebEngineContextMenuRequest)
+QT_FORWARD_DECLARE_CLASS(QWebEngineCertificateError)
+QT_FORWARD_DECLARE_CLASS(QWebEngineSettings)
+QT_FORWARD_DECLARE_CLASS(QWebEngineWebAuthUxRequest)
namespace content {
struct DropData;
@@ -78,293 +44,24 @@ struct DropData;
namespace QtWebEngineCore {
+class AutofillPopupController;
+class CertificateErrorController;
+class ClientCertSelectController;
class AuthenticationDialogController;
class ColorChooserController;
+class DesktopMediaController;
class FilePickerController;
class JavaScriptDialogController;
class RenderWidgetHostViewQt;
class RenderWidgetHostViewQtDelegate;
class RenderWidgetHostViewQtDelegateClient;
-class TouchHandleDrawableClient;
+class TouchHandleDrawableDelegate;
class TouchSelectionMenuController;
class WebContentsAdapter;
class WebContentsDelegateQt;
class WebEngineSettings;
-// Must match blink::WebReferrerPolicy
-enum class ReferrerPolicy {
- Always,
- Default,
- NoReferrerWhenDowngrade,
- Never,
- Origin,
- OriginWhenCrossOrigin,
- NoReferrerWhenDowngradeOriginWhenCrossOrigin,
- SameOrigin,
- StrictOrigin,
- Last = StrictOrigin,
-};
-
-class WebEngineContextMenuSharedData : public QSharedData {
-
-public:
- WebEngineContextMenuSharedData()
- : hasImageContent(false)
- , isEditable(false)
- , isSpellCheckerEnabled(false)
- , mediaType(0)
- , mediaFlags(0)
- , editFlags(0)
- {
- }
- bool hasImageContent;
- bool isEditable;
- bool isSpellCheckerEnabled;
- uint mediaType;
- uint mediaFlags;
- uint editFlags;
- QPoint pos;
- QUrl linkUrl;
- QUrl unfilteredLinkUrl;
- QUrl mediaUrl;
- QString altText;
- QString linkText;
- QString titleText;
- QString selectedText;
- QString suggestedFileName;
- QString misspelledWord;
- QStringList spellCheckerSuggestions;
- QUrl pageUrl;
- QUrl frameUrl;
- ReferrerPolicy referrerPolicy = ReferrerPolicy::Default;
- // Some likely candidates for future additions as we add support for the related actions:
- // bool isImageBlocked;
- // <enum tbd> mediaType;
- // ...
-};
-
-class WebEngineContextMenuData {
-public:
- // Must match blink::WebContextMenuData::MediaType:
- enum MediaType {
- // No special node is in context.
- MediaTypeNone = 0x0,
- // An image node is selected.
- MediaTypeImage,
- // A video node is selected.
- MediaTypeVideo,
- // An audio node is selected.
- MediaTypeAudio,
- // A canvas node is selected.
- MediaTypeCanvas,
- // A file node is selected.
- MediaTypeFile,
- // A plugin node is selected.
- MediaTypePlugin,
- MediaTypeLast = MediaTypePlugin
- };
- // Must match blink::WebContextMenuData::MediaFlags:
- enum MediaFlags {
- MediaNone = 0x0,
- MediaInError = 0x1,
- MediaPaused = 0x2,
- MediaMuted = 0x4,
- MediaLoop = 0x8,
- MediaCanSave = 0x10,
- MediaHasAudio = 0x20,
- MediaCanToggleControls = 0x40,
- MediaControls = 0x80,
- MediaCanPrint = 0x100,
- MediaCanRotate = 0x200,
- };
-
- // Must match blink::WebContextMenuData::EditFlags:
- enum EditFlags {
- CanDoNone = 0x0,
- CanUndo = 0x1,
- CanRedo = 0x2,
- CanCut = 0x4,
- CanCopy = 0x8,
- CanPaste = 0x10,
- CanDelete = 0x20,
- CanSelectAll = 0x40,
- CanTranslate = 0x80,
- CanEditRichly = 0x100,
- };
-
- WebEngineContextMenuData():d(new WebEngineContextMenuSharedData) {
- }
-
- void setPosition(const QPoint &pos) {
- d->pos = pos;
- }
-
- QPoint position() const {
- return d->pos;
- }
-
- void setLinkUrl(const QUrl &url) {
- d->linkUrl = url;
- }
-
- QUrl linkUrl() const {
- return d->linkUrl;
- }
-
- void setUnfilteredLinkUrl(const QUrl &url) {
- d->unfilteredLinkUrl = url;
- }
-
- QUrl unfilteredLinkUrl() const {
- return d->unfilteredLinkUrl;
- }
-
- void setAltText(const QString &text) {
- d->altText = text;
- }
-
- QString altText() const {
- return d->altText;
- }
-
- void setLinkText(const QString &text) {
- d->linkText = text;
- }
-
- QString linkText() const {
- return d->linkText;
- }
-
- void setTitleText(const QString &text) {
- d->titleText = text;
- }
-
- QString titleText() const {
- return d->titleText;
- }
-
- void setSelectedText(const QString &text) {
- d->selectedText = text;
- }
-
- QString selectedText() const {
- return d->selectedText;
- }
-
- void setMediaUrl(const QUrl &url) {
- d->mediaUrl = url;
- }
-
- QUrl mediaUrl() const {
- return d->mediaUrl;
- }
-
- void setMediaType(MediaType type) {
- d->mediaType = type;
- }
-
- MediaType mediaType() const {
- return MediaType(d->mediaType);
- }
-
- void setHasImageContent(bool imageContent) {
- d->hasImageContent = imageContent;
- }
-
- bool hasImageContent() const {
- return d->hasImageContent;
- }
-
- void setMediaFlags(MediaFlags flags) {
- d->mediaFlags = flags;
- }
-
- MediaFlags mediaFlags() const {
- return MediaFlags(d->mediaFlags);
- }
-
- void setEditFlags(EditFlags flags) {
- d->editFlags = flags;
- }
-
- EditFlags editFlags() const {
- return EditFlags(d->editFlags);
- }
-
- void setSuggestedFileName(const QString &filename) {
- d->suggestedFileName = filename;
- }
-
- QString suggestedFileName() const {
- return d->suggestedFileName;
- }
-
- void setIsEditable(bool editable) {
- d->isEditable = editable;
- }
-
- bool isEditable() const {
- return d->isEditable;
- }
-
- void setIsSpellCheckerEnabled(bool spellCheckerEnabled) {
- d->isSpellCheckerEnabled = spellCheckerEnabled;
- }
-
- bool isSpellCheckerEnabled() const {
- return d->isSpellCheckerEnabled;
- }
-
- void setMisspelledWord(const QString &word) {
- d->misspelledWord = word;
- }
-
- QString misspelledWord() const {
- return d->misspelledWord;
- }
-
- void setSpellCheckerSuggestions(const QStringList &suggestions) {
- d->spellCheckerSuggestions = suggestions;
- }
-
- QStringList spellCheckerSuggestions() const {
- return d->spellCheckerSuggestions;
- }
-
- void setFrameUrl(const QUrl &url) {
- d->frameUrl = url;
- }
-
- QUrl frameUrl() const {
- return d->frameUrl;
- }
-
- void setPageUrl(const QUrl &url) {
- d->pageUrl = url;
- }
-
- QUrl pageUrl() const {
- return d->pageUrl;
- }
-
- QUrl referrerUrl() const {
- return !d->frameUrl.isEmpty() ? d->frameUrl : d->pageUrl;
- }
-
- void setReferrerPolicy(ReferrerPolicy referrerPolicy) {
- d->referrerPolicy = referrerPolicy;
- }
-
- ReferrerPolicy referrerPolicy() const {
- return d->referrerPolicy;
- }
-
-private:
- QSharedDataPointer<WebEngineContextMenuSharedData> d;
-};
-
-
-class Q_WEBENGINECORE_PRIVATE_EXPORT WebContentsAdapterClient {
+class Q_WEBENGINECORE_EXPORT WebContentsAdapterClient {
public:
// This must match window_open_disposition_list.h.
enum WindowOpenDisposition {
@@ -390,12 +87,6 @@ public:
InternalAuthorizationDialog = 0x10,
};
- enum NavigationRequestAction {
- AcceptRequest,
- // Make room in the valid range of the enum for extra actions exposed in Experimental.
- IgnoreRequest = 0xFF
- };
-
enum NavigationType {
LinkNavigation,
TypedNavigation,
@@ -459,14 +150,14 @@ public:
virtual void loadProgressChanged(int progress) = 0;
virtual void didUpdateTargetURL(const QUrl&) = 0;
virtual void selectionChanged() = 0;
+ virtual void zoomUpdateIsNeeded() = 0;
virtual void recentlyAudibleChanged(bool recentlyAudible) = 0;
virtual void renderProcessPidChanged(qint64 pid) = 0;
virtual QRectF viewportRect() const = 0;
virtual QColor backgroundColor() const = 0;
- virtual void loadStarted(const QUrl &provisionalUrl, bool isErrorPage = false) = 0;
+ virtual void loadStarted(QWebEngineLoadingInfo info) = 0;
virtual void loadCommitted() = 0;
- virtual void loadVisuallyCommitted() = 0;
- virtual void loadFinished(bool success, const QUrl &url, bool isErrorPage = false, int errorCode = 0, const QString &errorDescription = QString()) = 0;
+ virtual void loadFinished(QWebEngineLoadingInfo info) = 0;
virtual void focusContainer() = 0;
virtual void unhandledKeyEvent(QKeyEvent *event) = 0;
virtual QSharedPointer<WebContentsAdapter>
@@ -476,8 +167,9 @@ public:
virtual bool isBeingAdopted() = 0;
virtual void close() = 0;
virtual void windowCloseRejected() = 0;
- virtual void contextMenuRequested(const WebEngineContextMenuData &) = 0;
- virtual void navigationRequested(int navigationType, const QUrl &url, int &navigationRequestAction, bool isMainFrame) = 0;
+ virtual void contextMenuRequested(QWebEngineContextMenuRequest *request) = 0;
+ virtual void desktopMediaRequested(DesktopMediaController *) = 0;
+ virtual void navigationRequested(int navigationType, const QUrl &url, bool &accepted, bool isMainFrame) = 0;
virtual void requestFullScreenMode(const QUrl &origin, bool fullscreen) = 0;
virtual bool isFullScreenMode() const = 0;
virtual void javascriptDialog(QSharedPointer<JavaScriptDialogController>) = 0;
@@ -497,35 +189,36 @@ public:
virtual void runFeaturePermissionRequest(ProfileAdapter::PermissionType, const QUrl &securityOrigin) = 0;
virtual void runMediaAccessPermissionRequest(const QUrl &securityOrigin, MediaRequestFlags requestFlags) = 0;
virtual void runMouseLockPermissionRequest(const QUrl &securityOrigin) = 0;
- virtual void runQuotaRequest(QWebEngineQuotaRequest) = 0;
virtual void runRegisterProtocolHandlerRequest(QWebEngineRegisterProtocolHandlerRequest) = 0;
- virtual WebEngineSettings *webEngineSettings() const = 0;
+ virtual void runFileSystemAccessRequest(QWebEngineFileSystemAccessRequest) = 0;
+ virtual QWebEngineSettings *webEngineSettings() const = 0;
RenderProcessTerminationStatus renderProcessExitStatus(int);
virtual void renderProcessTerminated(RenderProcessTerminationStatus terminationStatus, int exitCode) = 0;
virtual void requestGeometryChange(const QRect &geometry, const QRect &frameGeometry) = 0;
- virtual void allowCertificateError(const QSharedPointer<CertificateErrorController> &errorController) = 0;
+ virtual void allowCertificateError(const QWebEngineCertificateError &error) = 0;
virtual void selectClientCert(const QSharedPointer<ClientCertSelectController> &selectController) = 0;
virtual void updateScrollPosition(const QPointF &position) = 0;
virtual void updateContentsSize(const QSizeF &size) = 0;
virtual void updateNavigationActions() = 0;
virtual void updateEditActions() = 0;
- virtual void startDragging(const content::DropData &dropData, Qt::DropActions allowedActions,
- const QPixmap &pixmap, const QPoint &offset) = 0;
- virtual bool supportsDragging() const = 0;
+ virtual QObject *dragSource() const = 0;
virtual bool isEnabled() const = 0;
virtual const QObject *holdingQObject() const = 0;
virtual void setToolTip(const QString& toolTipText) = 0;
virtual ClientType clientType() = 0;
virtual void printRequested() = 0;
- virtual void widgetChanged(RenderWidgetHostViewQtDelegate *newWidget) = 0;
- virtual TouchHandleDrawableClient *createTouchHandle(const QMap<int, QImage> &images) = 0;
+ virtual TouchHandleDrawableDelegate * createTouchHandleDelegate(const QMap<int, QImage> &images) = 0;
virtual void showTouchSelectionMenu(TouchSelectionMenuController *menuController, const QRect &bounds, const QSize &handleSize) = 0;
virtual void hideTouchSelectionMenu() = 0;
virtual void findTextFinished(const QWebEngineFindTextResult &result) = 0;
+ virtual void showAutofillPopup(AutofillPopupController *controller, const QRect &bounds,
+ bool autoselectFirstSuggestion) = 0;
+ virtual void hideAutofillPopup() = 0;
virtual ProfileAdapter *profileAdapter() = 0;
virtual WebContentsAdapter* webContentsAdapter() = 0;
virtual void releaseProfile() = 0;
+ virtual void showWebAuthDialog(QWebEngineWebAuthUxRequest *request) = 0;
};
} // namespace QtWebEngineCore
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp
index 54ae4937a..194274fcb 100644
--- a/src/core/web_contents_delegate_qt.cpp
+++ b/src/core/web_contents_delegate_qt.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
@@ -43,15 +7,22 @@
#include "web_contents_delegate_qt.h"
-#include "profile_adapter.h"
+#include "certificate_error_controller.h"
#include "color_chooser_controller.h"
#include "color_chooser_qt.h"
-#include "favicon_manager.h"
+#include "custom_handlers/protocol_handler_registry_factory.h"
+#include "custom_handlers/register_protocol_handler_request_controller_impl.h"
+#include "desktop_media_controller.h"
+#include "desktop_media_controller_p.h"
#include "file_picker_controller.h"
+#include "find_text_helper.h"
+#include "javascript_dialog_manager_qt.h"
#include "media_capture_devices_dispatcher.h"
+#include "native_web_keyboard_event_qt.h"
+#include "profile_adapter.h"
#include "profile_qt.h"
+#include "qwebengineloadinginfo.h"
#include "qwebengineregisterprotocolhandlerrequest.h"
-#include "register_protocol_handler_request_controller_impl.h"
#include "render_widget_host_view_qt.h"
#include "type_conversion.h"
#include "visited_links_manager_qt.h"
@@ -59,28 +30,28 @@
#include "web_contents_adapter.h"
#include "web_contents_view_qt.h"
#include "web_engine_context.h"
+#include "web_engine_error.h"
#include "web_engine_settings.h"
+#include "certificate_error_controller.h"
-#include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h"
+#include "components/custom_handlers/protocol_handler_registry.h"
#include "components/web_cache/browser/web_cache_manager.h"
-#include "content/browser/frame_host/render_frame_host_impl.h"
-#include "content/browser/renderer_host/render_widget_host_impl.h"
+#include "content/browser/renderer_host/render_frame_host_impl.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/file_select_listener.h"
#include "content/public/browser/invalidate_type.h"
+#include "content/public/browser/media_stream_request.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h"
-#include "content/public/common/favicon_url.h"
-#include "content/public/common/frame_navigate_params.h"
#include "content/public/common/url_constants.h"
-#include "content/public/common/web_preferences.h"
#include "net/base/data_url.h"
#include "net/base/url_util.h"
+#include "third_party/blink/public/mojom/mediastream/media_stream.mojom.h"
#include <QDesktopServices>
#include <QTimer>
@@ -103,11 +74,8 @@ static WebContentsAdapterClient::JavaScriptConsoleMessageLevel mapToJavascriptCo
WebContentsDelegateQt::WebContentsDelegateQt(content::WebContents *webContents, WebContentsAdapterClient *adapterClient)
: m_viewClient(adapterClient)
- , m_faviconManager(new FaviconManager(webContents, adapterClient))
, m_findTextHelper(new FindTextHelper(webContents, adapterClient))
- , m_lastLoadProgress(-1)
, m_loadingState(determineLoadingState(webContents))
- , m_didStartLoadingSeen(m_loadingState == LoadingState::Loading)
, m_frameFocusedObserver(adapterClient)
{
webContents->SetDelegate(this);
@@ -127,7 +95,7 @@ content::WebContents *WebContentsDelegateQt::OpenURLFromTab(content::WebContents
content::SiteInstance *target_site_instance = params.source_site_instance.get();
content::Referrer referrer = params.referrer;
if (params.disposition != WindowOpenDisposition::CURRENT_TAB) {
- QSharedPointer<WebContentsAdapter> targetAdapter = createWindow(0, params.disposition, gfx::Rect(), params.user_gesture);
+ QSharedPointer<WebContentsAdapter> targetAdapter = createWindow(nullptr, params.disposition, gfx::Rect(), toQt(params.url), params.user_gesture);
if (targetAdapter) {
if (targetAdapter->profile() != source->GetBrowserContext()) {
target_site_instance = nullptr;
@@ -136,11 +104,15 @@ content::WebContents *WebContentsDelegateQt::OpenURLFromTab(content::WebContents
if (!targetAdapter->isInitialized())
targetAdapter->initialize(target_site_instance);
target = targetAdapter->webContents();
+ } else {
+ return target;
}
}
Q_ASSERT(target);
content::NavigationController::LoadURLParams load_url_params(params.url);
+ load_url_params.initiator_frame_token = params.initiator_frame_token;
+ load_url_params.initiator_process_id = params.initiator_process_id;
load_url_params.initiator_origin = params.initiator_origin;
load_url_params.source_site_instance = target_site_instance;
load_url_params.referrer = referrer;
@@ -156,6 +128,7 @@ content::WebContents *WebContentsDelegateQt::OpenURLFromTab(content::WebContents
load_url_params.override_user_agent = content::NavigationController::UA_OVERRIDE_TRUE;
load_url_params.href_translate = params.href_translate;
load_url_params.reload_type = params.reload_type;
+ load_url_params.impression = params.impression;
if (params.post_data) {
load_url_params.load_type = content::NavigationController::LOAD_TYPE_HTTP_POST;
load_url_params.post_data = params.post_data;
@@ -177,6 +150,10 @@ static bool shouldUseActualURL(content::NavigationEntry *entry)
if (entry->GetPageType() != content::PAGE_TYPE_NORMAL)
return false;
+ // Show the virtual URL based on custom base, if present
+ if (!entry->GetBaseURLForDataURL().is_empty())
+ return false;
+
// Show invalid data URL
std::string mime_type, charset, data;
if (!net::DataURL::Parse(entry->GetURL(), &mime_type, &charset, &data))
@@ -212,8 +189,8 @@ void WebContentsDelegateQt::NavigationStateChanged(content::WebContents* source,
}
}
-QUrl WebContentsDelegateQt::url(content::WebContents* source) const {
-
+QUrl WebContentsDelegateQt::url(content::WebContents *source) const
+{
content::NavigationEntry *entry = source->GetController().GetVisibleEntry();
QUrl newUrl;
if (entry) {
@@ -224,22 +201,25 @@ QUrl WebContentsDelegateQt::url(content::WebContents* source) const {
GURL strippedUrl = net::SimplifyUrlForRequest(url);
newUrl = QUrl(QString("%1:%2").arg(content::kViewSourceScheme, QString::fromStdString(strippedUrl.spec())));
}
- // If there is a visible entry there are special cases when we dont wan't to use the actual URL
+ // If there is a visible entry there are special cases where we dont wan't to use the actual URL
if (newUrl.isEmpty())
newUrl = shouldUseActualURL(entry) ? toQt(url) : toQt(entry->GetVirtualURL());
}
m_pendingUrlUpdate = false;
return newUrl;
}
-void WebContentsDelegateQt::AddNewContents(content::WebContents* source, std::unique_ptr<content::WebContents> new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, bool user_gesture, bool* was_blocked)
+void WebContentsDelegateQt::AddNewContents(content::WebContents *source, std::unique_ptr<content::WebContents> new_contents, const GURL &target_url,
+ WindowOpenDisposition disposition, const blink::mojom::WindowFeatures &window_features, bool user_gesture, bool *was_blocked)
{
Q_UNUSED(source)
- QSharedPointer<WebContentsAdapter> newAdapter = createWindow(std::move(new_contents), disposition, initial_pos, user_gesture);
+ QSharedPointer<WebContentsAdapter> newAdapter = createWindow(std::move(new_contents), disposition, window_features.bounds, toQt(target_url), user_gesture);
// Chromium can forget to pass user-agent override settings to new windows (see QTBUG-61774 and QTBUG-76249),
// so set it here. Note the actual value doesn't really matter here. Only the second value does, but we try
// to give the correct user-agent anyway.
if (newAdapter)
- newAdapter->webContents()->SetUserAgentOverride(newAdapter->profileAdapter()->httpUserAgent().toStdString(), true);
+ newAdapter->webContents()->SetUserAgentOverride(
+ blink::UserAgentOverride::UserAgentOnly(newAdapter->profileAdapter()->httpUserAgent().toStdString()),
+ true);
if (newAdapter && !newAdapter->isInitialized())
newAdapter->loadDefault();
if (was_blocked)
@@ -255,20 +235,21 @@ void WebContentsDelegateQt::CloseContents(content::WebContents *source)
void WebContentsDelegateQt::LoadProgressChanged(double progress)
{
- if (!m_loadingErrorFrameList.isEmpty())
+ if (!m_loadingInfo.isLoading()) // suppress signals that aren't between loadStarted and loadFinished
return;
- if (m_lastLoadProgress < 0) // suppress signals that aren't between loadStarted and loadFinished
- return;
- m_lastLoadProgress = qMax(m_lastLoadProgress, qRound(progress * 100)); // ensure monotonicity
- m_lastLoadProgress = qMin(m_lastLoadProgress, 100);
- m_viewClient->loadProgressChanged(m_lastLoadProgress);
+
+ int p = qMin(qRound(progress * 100), 100);
+ if (p > m_loadingInfo.progress) { // ensure strict monotonic increase
+ m_loadingInfo.progress = p;
+ m_viewClient->loadProgressChanged(p);
+ }
}
bool WebContentsDelegateQt::HandleKeyboardEvent(content::WebContents *, const content::NativeWebKeyboardEvent &event)
{
- Q_ASSERT(!event.skip_in_browser);
+ Q_ASSERT(!event.skip_if_unhandled);
if (event.os_event)
- m_viewClient->unhandledKeyEvent(reinterpret_cast<QKeyEvent *>(event.os_event));
+ m_viewClient->unhandledKeyEvent(ToKeyEvent(event.os_event));
// FIXME: ?
return true;
}
@@ -277,14 +258,13 @@ void WebContentsDelegateQt::RenderFrameCreated(content::RenderFrameHost *render_
{
content::FrameTreeNode *node = static_cast<content::RenderFrameHostImpl *>(render_frame_host)->frame_tree_node();
m_frameFocusedObserver.addNode(node);
-}
-void WebContentsDelegateQt::RenderFrameDeleted(content::RenderFrameHost *render_frame_host)
-{
- m_loadingErrorFrameList.removeOne(render_frame_host->GetRoutingID());
+ // If it's a child frame (render_widget_host_view_child_frame) install an InputEventObserver on
+ // it. Note that it is only needed for WheelEventAck.
+ RenderWidgetHostViewQt::registerInputEventObserver(web_contents(), render_frame_host);
}
-void WebContentsDelegateQt::RenderProcessGone(base::TerminationStatus status)
+void WebContentsDelegateQt::PrimaryMainFrameRenderProcessGone(base::TerminationStatus status)
{
// RenderProcessHost::FastShutdownIfPossible results in TERMINATION_STATUS_STILL_RUNNING
if (status != base::TERMINATION_STATUS_STILL_RUNNING) {
@@ -299,6 +279,7 @@ void WebContentsDelegateQt::RenderProcessGone(base::TerminationStatus status)
|| status == base::TERMINATION_STATUS_STILL_RUNNING) {
return;
}
+ LOG(INFO) << "ProcessGone: " << int(status) << " (" << web_contents()->GetCrashedErrorCode() << ")";
setLoadingState(LoadingState::Unloaded);
}
@@ -318,8 +299,10 @@ void WebContentsDelegateQt::RenderFrameHostChanged(content::RenderFrameHost *old
if (new_host->GetFrameOwnerElementType() == blink::FrameOwnerElementType::kNone) {
content::RenderProcessHost *renderProcessHost = new_host->GetProcess();
const base::Process &process = renderProcessHost->GetProcess();
- if (process.IsValid())
+ if (process.IsValid()) {
m_viewClient->renderProcessPidChanged(process.Pid());
+ m_viewClient->zoomUpdateIsNeeded();
+ }
}
}
}
@@ -328,44 +311,91 @@ void WebContentsDelegateQt::RenderViewHostChanged(content::RenderViewHost *, con
{
if (newHost && newHost->GetWidget() && newHost->GetWidget()->GetView()) {
auto rwhv = static_cast<RenderWidgetHostViewQt *>(newHost->GetWidget()->GetView());
- m_viewClient->widgetChanged(rwhv->delegate());
+ Q_ASSERT(rwhv->delegate());
+ rwhv->delegate()->adapterClientChanged(m_viewClient);
+ m_viewClient->zoomUpdateIsNeeded();
+ auto backgroundColor = m_viewClient->backgroundColor();
+ if (backgroundColor != Qt::white)
+ m_viewClient->webContentsAdapter()->setBackgroundColor(backgroundColor);
}
}
-void WebContentsDelegateQt::EmitLoadStarted(const QUrl &url, bool isErrorPage)
+void WebContentsDelegateQt::RenderViewReady()
{
- if (m_lastLoadProgress >= 0 && m_lastLoadProgress < 100) // already running
+ // The render view might have returned after a crash without us getting a RenderViewHostChanged call
+ content::RenderWidgetHostView *newHostView = web_contents()->GetRenderWidgetHostView();
+ if (newHostView) {
+ auto *rwhv = static_cast<RenderWidgetHostViewQt *>(newHostView);
+ Q_ASSERT(rwhv->delegate());
+ rwhv->delegate()->updateAdapterClientIfNeeded(m_viewClient);
+ }
+}
+
+void WebContentsDelegateQt::emitLoadStarted(bool isErrorPage)
+{
+ for (auto &&wc : m_certificateErrorControllers)
+ if (auto controller = wc.lock())
+ controller->deactivate();
+ m_certificateErrorControllers.clear();
+
+ // only report first ever load start or separate one for error page only
+ if (!isErrorPage && m_loadingInfo.isLoading()) // already running
return;
- m_viewClient->loadStarted(url, isErrorPage);
- m_viewClient->updateNavigationActions();
- m_viewClient->loadProgressChanged(0);
- m_lastLoadProgress = 0;
+
+ m_isDocumentEmpty = true; // reset to default which may only be overridden on actual resource load complete
+ if (!isErrorPage) {
+ m_loadingInfo.progress = 0;
+ m_viewClient->loadStarted(QWebEngineLoadingInfo(m_loadingInfo.url, QWebEngineLoadingInfo::LoadStartedStatus));
+ m_viewClient->updateNavigationActions();
+ m_viewClient->loadProgressChanged(0);
+ }
}
void WebContentsDelegateQt::DidStartNavigation(content::NavigationHandle *navigation_handle)
{
- if (!navigation_handle->IsInMainFrame())
- return;
+ if (!webEngineSettings()->testAttribute(QWebEngineSettings::ErrorPageEnabled))
+ navigation_handle->SetSilentlyIgnoreErrors();
- // Error-pages are not reported as separate started navigations.
- Q_ASSERT(!navigation_handle->IsErrorPage());
+ if (!navigation_handle->IsInMainFrame() || navigation_handle->IsSameDocument())
+ return;
- m_loadingErrorFrameList.clear();
- m_faviconManager->resetCandidates();
- EmitLoadStarted(toQt(navigation_handle->GetURL()));
+ m_loadingInfo.url = toQt(navigation_handle->GetURL());
+ // IsErrorPage is only set after navigation commit, so check it otherwise: error page shouldn't have navigation entry
+ bool isErrorPage = m_loadingInfo.triggersErrorPage && !navigation_handle->GetNavigationEntry();
+ emitLoadStarted(isErrorPage);
}
-void WebContentsDelegateQt::EmitLoadFinished(bool success, const QUrl &url, bool isErrorPage, int errorCode, const QString &errorDescription)
+void WebContentsDelegateQt::emitLoadFinished(bool isErrorPage)
{
- if (m_lastLoadProgress < 0) // not currently running
+ if (!m_loadingInfo.isLoading()) // not currently running
+ return;
+
+ Q_ASSERT(!isErrorPage || webEngineSettings()->testAttribute(QWebEngineSettings::ErrorPageEnabled));
+ Q_ASSERT((m_loadingInfo.triggersErrorPage && webEngineSettings()->testAttribute(QWebEngineSettings::ErrorPageEnabled)) || !m_loadingInfo.triggersErrorPage);
+
+ if (isErrorPage) {
+ m_loadingInfo.isErrorPage = isErrorPage;
return;
- m_lastLoadProgress = -1;
- m_viewClient->loadProgressChanged(100);
- m_viewClient->loadFinished(success, url, isErrorPage, errorCode, errorDescription);
+ }
+
+ if (m_loadingInfo.progress < 100) {
+ m_loadingInfo.progress = 100;
+ m_viewClient->loadProgressChanged(100);
+ }
+
+ auto loadStatus = m_loadingInfo.success
+ ? QWebEngineLoadingInfo::LoadSucceededStatus
+ : (m_loadingInfo.errorCode == WebEngineError::UserAbortedError
+ ? QWebEngineLoadingInfo::LoadStoppedStatus : QWebEngineLoadingInfo::LoadFailedStatus);
+ QWebEngineLoadingInfo info(m_loadingInfo.url, loadStatus, m_loadingInfo.isErrorPage,
+ m_loadingInfo.errorDescription, m_loadingInfo.errorCode,
+ QWebEngineLoadingInfo::ErrorDomain(m_loadingInfo.errorDomain),
+ m_loadingInfo.responseHeaders);
+ m_viewClient->loadFinished(std::move(info));
m_viewClient->updateNavigationActions();
}
-void WebContentsDelegateQt::EmitLoadCommitted()
+void WebContentsDelegateQt::emitLoadCommitted()
{
m_findTextHelper->handleLoadCommitted();
m_viewClient->loadCommitted();
@@ -385,58 +415,56 @@ void WebContentsDelegateQt::DidFinishNavigation(content::NavigationHandle *navig
profileAdapter->visitedLinksManager()->addUrl(url);
}
- EmitLoadCommitted();
+ emitLoadCommitted();
+ }
+
+ const net::HttpResponseHeaders * const responseHeaders = navigation_handle->GetResponseHeaders();
+ if (responseHeaders != nullptr) {
+ m_loadingInfo.responseHeaders.clear();
+ std::size_t iter = 0;
+ std::string headerName;
+ std::string headerValue;
+ while (responseHeaders->EnumerateHeaderLines(&iter, &headerName, &headerValue)) {
+ m_loadingInfo.responseHeaders.insert(
+ QByteArray::fromStdString(headerName),
+ QByteArray::fromStdString(headerValue)
+ );
+ }
}
+
// Success is reported by DidFinishLoad, but DidFailLoad is now dead code and needs to be handled below
if (navigation_handle->GetNetErrorCode() == net::OK)
return;
// WebContentsObserver::DidFailLoad is not called any longer so we have to report the failure here.
- const net::Error error_code = navigation_handle->GetNetErrorCode();
- const std::string error_description = net::ErrorToString(error_code);
- didFailLoad(toQt(navigation_handle->GetURL()), error_code, toQt(error_description));
+ int error_code = navigation_handle->GetNetErrorCode();
+ if (error_code == net::ERR_HTTP_RESPONSE_CODE_FAILURE)
+ if (auto entry = web_contents()->GetController().GetActiveEntry())
+ error_code = entry->GetHttpStatusCode();
+ didFailLoad(toQt(navigation_handle->GetURL()), error_code, WebEngineError::toQtErrorDescription(error_code));
// The load will succede as an error-page load later, and we reported the original error above
if (navigation_handle->IsErrorPage()) {
// Now report we are starting to load an error-page.
- m_loadingErrorFrameList.append(navigation_handle->GetRenderFrameHost()->GetRoutingID());
- m_faviconManager->resetCandidates();
- EmitLoadStarted(toQt(GURL(content::kUnreachableWebDataURL)), true);
// If it is already committed we will not see another DidFinishNavigation call or a DidFinishLoad call.
if (navigation_handle->HasCommitted())
- EmitLoadCommitted();
+ emitLoadCommitted();
}
}
-void WebContentsDelegateQt::DidStartLoading()
+void WebContentsDelegateQt::PrimaryPageChanged(content::Page &)
{
- // Based on TabLoadTracker::DidStartLoading
+ // Based on TabLoadTracker::PrimaryPageChanged
- if (!web_contents()->IsLoadingToDifferentDocument())
+ if (!web_contents()->ShouldShowLoadingUI())
return;
- if (m_loadingState == LoadingState::Loading) {
- DCHECK(m_didStartLoadingSeen);
- return;
- }
- m_didStartLoadingSeen = true;
-}
-
-void WebContentsDelegateQt::DidReceiveResponse()
-{
- // Based on TabLoadTracker::DidReceiveResponse
-
- if (m_loadingState == LoadingState::Loading) {
- DCHECK(m_didStartLoadingSeen);
- return;
- }
// A transition to loading requires both DidStartLoading (navigation
// committed) and DidReceiveResponse (data has been transmitted over the
// network) events to occur. This is because NavigationThrottles can block
// actual network requests, but not the rest of the state machinery.
- if (m_didStartLoadingSeen)
- setLoadingState(LoadingState::Loading);
+ setLoadingState(LoadingState::Loading);
}
void WebContentsDelegateQt::DidStopLoading()
@@ -445,47 +473,52 @@ void WebContentsDelegateQt::DidStopLoading()
// NOTE: PageAlmostIdle feature not implemented
- if (m_loadingState == LoadingState::Loading)
- setLoadingState(LoadingState::Loaded);
+ setLoadingState(LoadingState::Loaded);
+
+ emitLoadFinished();
+ m_loadingInfo.clear();
}
void WebContentsDelegateQt::didFailLoad(const QUrl &url, int errorCode, const QString &errorDescription)
{
m_viewClient->iconChanged(QUrl());
- EmitLoadFinished(false /* success */ , url, false /* isErrorPage */, errorCode, errorDescription);
+ bool errorPageEnabled = webEngineSettings()->testAttribute(QWebEngineSettings::ErrorPageEnabled);
+ // Delay notifying failure until the error-page is done loading.
+ // Error-pages are not loaded on failures due to abort.
+ bool aborted = (errorCode == -3 /* ERR_ABORTED*/ );
+ m_loadingInfo.success = false;
+ m_loadingInfo.url = url;
+ m_loadingInfo.errorCode = errorCode;
+ m_loadingInfo.errorDomain = WebEngineError::toQtErrorDomain(errorCode);
+ m_loadingInfo.errorDescription = errorDescription;
+ m_loadingInfo.triggersErrorPage = errorPageEnabled && !aborted;
}
-void WebContentsDelegateQt::DidFailLoad(content::RenderFrameHost* render_frame_host, const GURL& validated_url, int error_code, const base::string16& error_description)
+void WebContentsDelegateQt::DidFailLoad(content::RenderFrameHost* render_frame_host, const GURL& validated_url, int error_code)
{
- if (m_loadingState == LoadingState::Loading)
- setLoadingState(LoadingState::Loaded);
+ setLoadingState(LoadingState::Loaded);
- if (render_frame_host != web_contents()->GetMainFrame())
+ if (render_frame_host != web_contents()->GetPrimaryMainFrame())
return;
if (validated_url.spec() == content::kUnreachableWebDataURL) {
// error-pages should only ever fail due to abort:
Q_ASSERT(error_code == -3 /* ERR_ABORTED */);
- m_loadingErrorFrameList.removeOne(render_frame_host->GetRoutingID());
m_viewClient->iconChanged(QUrl());
-
- EmitLoadFinished(false /* success */, toQt(validated_url), true /* isErrorPage */);
+ emitLoadFinished(/* isErrorPage = */true);
return;
}
-
- didFailLoad(toQt(validated_url), error_code, toQt(error_description));
+ didFailLoad(toQt(validated_url), error_code, WebEngineError::toQtErrorDescription(error_code));
}
void WebContentsDelegateQt::DidFinishLoad(content::RenderFrameHost* render_frame_host, const GURL& validated_url)
{
Q_ASSERT(validated_url.is_valid());
if (validated_url.spec() == content::kUnreachableWebDataURL) {
- m_loadingErrorFrameList.removeOne(render_frame_host->GetRoutingID());
-
// Trigger LoadFinished signal for main frame's error page only.
if (!render_frame_host->GetParent()) {
m_viewClient->iconChanged(QUrl());
- EmitLoadFinished(true /* success */, toQt(validated_url), true /* isErrorPage */);
+ emitLoadFinished(/* isErrorPage = */true);
}
return;
@@ -496,45 +529,32 @@ void WebContentsDelegateQt::DidFinishLoad(content::RenderFrameHost* render_frame
return;
}
- if (!m_faviconManager->hasCandidate())
- m_viewClient->iconChanged(QUrl());
-
content::NavigationEntry *entry = web_contents()->GetController().GetActiveEntry();
- int http_statuscode = 0;
- if (entry)
- http_statuscode = entry->GetHttpStatusCode();
- EmitLoadFinished(true /* success */ , toQt(validated_url), false /* isErrorPage */, http_statuscode);
-}
-
-void WebContentsDelegateQt::DidUpdateFaviconURL(const std::vector<content::FaviconURL> &candidates)
-{
- QList<FaviconInfo> faviconCandidates;
- faviconCandidates.reserve(static_cast<int>(candidates.size()));
- for (const content::FaviconURL &candidate : candidates) {
- // Store invalid candidates too for later debugging via API
- faviconCandidates.append(toFaviconInfo(candidate));
- }
+ int http_statuscode = entry ? entry->GetHttpStatusCode() : 0;
+ bool errorPageEnabled = webEngineSettings()->testAttribute(QWebEngineSettings::ErrorPageEnabled);
+ bool triggersErrorPage = errorPageEnabled && (http_statuscode >= 400) && m_isDocumentEmpty;
- // Favicon URL can be changed from JavaScript too. Thus we need to reset
- // the current candidate icon list to not handle previous icon as a candidate.
- m_faviconManager->resetCandidates();
- m_faviconManager->update(faviconCandidates);
+ m_loadingInfo.success = http_statuscode < 400;
+ m_loadingInfo.url = toQt(validated_url);
+ m_loadingInfo.errorCode = http_statuscode;
+ m_loadingInfo.errorDomain = WebEngineError::toQtErrorDomain(http_statuscode);
+ m_loadingInfo.errorDescription = WebEngineError::toQtErrorDescription(http_statuscode);
+ m_loadingInfo.triggersErrorPage = triggersErrorPage;
}
void WebContentsDelegateQt::WebContentsCreated(content::WebContents * /*source_contents*/,
int /*opener_render_process_id*/, int /*opener_render_frame_id*/,
const std::string &/*frame_name*/,
- const GURL &target_url, content::WebContents *newContents)
+ const GURL &/*target_url*/, content::WebContents *newContents)
{
- m_initialTargetUrl = toQt(target_url);
if (auto *view = static_cast<content::WebContentsImpl *>(newContents)->GetView())
static_cast<WebContentsViewQt *>(view)->setFactoryClient(m_viewClient);
}
-content::ColorChooser *WebContentsDelegateQt::OpenColorChooser(content::WebContents *source, SkColor color, const std::vector<blink::mojom::ColorSuggestionPtr> &suggestion)
+std::unique_ptr<content::ColorChooser> WebContentsDelegateQt::OpenColorChooser(content::WebContents *source, SkColor color, const std::vector<blink::mojom::ColorSuggestionPtr> &suggestion)
{
Q_UNUSED(suggestion);
- ColorChooserQt *colorChooser = new ColorChooserQt(source, toQt(color));
+ auto colorChooser = std::make_unique<ColorChooserQt>(source, toQt(color));
m_viewClient->showColorDialog(colorChooser->controller());
return colorChooser;
@@ -544,17 +564,17 @@ content::JavaScriptDialogManager *WebContentsDelegateQt::GetJavaScriptDialogMana
return JavaScriptDialogManagerQt::GetInstance();
}
-void WebContentsDelegateQt::EnterFullscreenModeForTab(content::WebContents *web_contents, const GURL& origin, const blink::mojom::FullscreenOptions &)
+void WebContentsDelegateQt::EnterFullscreenModeForTab(content::RenderFrameHost *requesting_frame, const blink::mojom::FullscreenOptions &options)
{
- Q_UNUSED(web_contents);
+ Q_UNUSED(options);
if (!m_viewClient->isFullScreenMode())
- m_viewClient->requestFullScreenMode(toQt(origin), true);
+ m_viewClient->requestFullScreenMode(toQt(requesting_frame->GetLastCommittedURL().DeprecatedGetOriginAsURL()), true);
}
void WebContentsDelegateQt::ExitFullscreenModeForTab(content::WebContents *web_contents)
{
if (m_viewClient->isFullScreenMode())
- m_viewClient->requestFullScreenMode(toQt(web_contents->GetLastCommittedURL().GetOrigin()), false);
+ m_viewClient->requestFullScreenMode(toQt(web_contents->GetLastCommittedURL().DeprecatedGetOriginAsURL()), false);
}
bool WebContentsDelegateQt::IsFullscreenForTabOrPending(const content::WebContents* web_contents)
@@ -568,17 +588,19 @@ ASSERT_ENUMS_MATCH(FilePickerController::OpenMultiple, blink::mojom::FileChooser
ASSERT_ENUMS_MATCH(FilePickerController::UploadFolder, blink::mojom::FileChooserParams::Mode::kUploadFolder)
ASSERT_ENUMS_MATCH(FilePickerController::Save, blink::mojom::FileChooserParams::Mode::kSave)
+extern FilePickerController *createFilePickerController(FilePickerController::FileChooserMode mode, scoped_refptr<content::FileSelectListener> listener, const QString &defaultFileName, const QStringList &acceptedMimeTypes, QObject *parent = nullptr);
+
void WebContentsDelegateQt::RunFileChooser(content::RenderFrameHost * /*frameHost*/,
- std::unique_ptr<content::FileSelectListener> listener,
+ scoped_refptr<content::FileSelectListener> listener,
const blink::mojom::FileChooserParams& params)
{
QStringList acceptedMimeTypes;
acceptedMimeTypes.reserve(params.accept_types.size());
- for (std::vector<base::string16>::const_iterator it = params.accept_types.begin(); it < params.accept_types.end(); ++it)
+ for (std::vector<std::u16string>::const_iterator it = params.accept_types.begin(); it < params.accept_types.end(); ++it)
acceptedMimeTypes.append(toQt(*it));
- m_filePickerController.reset(new FilePickerController(static_cast<FilePickerController::FileChooserMode>(params.mode),
- std::move(listener), toQt(params.default_file_name.value()), acceptedMimeTypes));
+ m_filePickerController.reset(createFilePickerController(static_cast<FilePickerController::FileChooserMode>(params.mode),
+ listener, toQt(params.default_file_name.value()), acceptedMimeTypes));
// Defer the call to not block base::MessageLoop::RunTask with modal dialogs.
QTimer::singleShot(0, [this] () {
@@ -587,9 +609,9 @@ void WebContentsDelegateQt::RunFileChooser(content::RenderFrameHost * /*frameHos
}
bool WebContentsDelegateQt::DidAddMessageToConsole(content::WebContents *source, blink::mojom::ConsoleMessageLevel log_level,
- const base::string16 &message, int32_t line_no, const base::string16 &source_id)
+ const std::u16string &message, int32_t line_no, const std::u16string &source_id)
{
- Q_UNUSED(source)
+ Q_UNUSED(source);
m_viewClient->javaScriptConsoleMessage(mapToJavascriptConsoleMessageLevel(log_level), toQt(message), static_cast<int>(line_no), toQt(source_id));
return false;
}
@@ -599,9 +621,45 @@ void WebContentsDelegateQt::FindReply(content::WebContents *source, int request_
m_findTextHelper->handleFindReply(source, request_id, number_of_matches, selection_rect, active_match_ordinal, final_update);
}
+static void processMediaAccessRequest(content::WebContents *webContents,
+ const content::MediaStreamRequest &request,
+ content::MediaResponseCallback callback,
+ content::DesktopMediaID id)
+{
+ MediaCaptureDevicesDispatcher::GetInstance()->processMediaAccessRequest(
+ webContents, request, std::move(callback), id);
+}
+
+static inline bool needsPickerDialog(const content::MediaStreamRequest &request)
+{
+ return (request.requested_video_device_id.empty() && // device already selected in chooseDesktopMedia
+ (request.video_type == blink::mojom::MediaStreamType::GUM_DESKTOP_VIDEO_CAPTURE
+ || request.video_type == blink::mojom::MediaStreamType::DISPLAY_VIDEO_CAPTURE));
+}
+
void WebContentsDelegateQt::RequestMediaAccessPermission(content::WebContents *web_contents, const content::MediaStreamRequest &request, content::MediaResponseCallback callback)
{
- MediaCaptureDevicesDispatcher::GetInstance()->processMediaAccessRequest(m_viewClient, web_contents, request, std::move(callback));
+ if (needsPickerDialog(request)) {
+#if QT_CONFIG(webengine_webrtc)
+ base::OnceCallback<void(content::DesktopMediaID)> cb = base::BindOnce(
+ &processMediaAccessRequest, web_contents, std::move(request), std::move(callback));
+ // ownership is taken by the request
+ auto *controller = new DesktopMediaController(
+ new DesktopMediaControllerPrivate(std::move(cb)));
+ QObject::connect(controller, &DesktopMediaController::mediaListsInitialized, [controller, delegate = AsWeakPtr()]() {
+ if (delegate)
+ delegate->adapterClient()->desktopMediaRequested(controller);
+ else
+ controller->deleteLater();
+ });
+#else
+ // To keep the old behavior return the default screen even if webrtc is disabled
+ processMediaAccessRequest(web_contents, std::move(request), std::move(callback),
+ content::DesktopMediaID(content::DesktopMediaID::TYPE_SCREEN, 0));
+#endif // QT_CONFIG(webengine_webrtc)
+ } else {
+ processMediaAccessRequest(web_contents, std::move(request), std::move(callback), {});
+ }
}
void WebContentsDelegateQt::SetContentsBounds(content::WebContents *source, const gfx::Rect &bounds)
@@ -612,37 +670,22 @@ void WebContentsDelegateQt::SetContentsBounds(content::WebContents *source, cons
QRect frameGeometry(toQt(bounds));
QRect geometry;
if (RenderWidgetHostViewQt *rwhv = static_cast<RenderWidgetHostViewQt*>(web_contents()->GetRenderWidgetHostView())) {
- if (rwhv->delegate() && rwhv->delegate()->window())
- geometry = frameGeometry.marginsRemoved(rwhv->delegate()->window()->frameMargins());
+ if (rwhv->delegate() && rwhv->delegate()->Window())
+ geometry = frameGeometry.marginsRemoved(rwhv->delegate()->Window()->frameMargins());
}
m_viewClient->requestGeometryChange(geometry, frameGeometry);
}
void WebContentsDelegateQt::UpdateTargetURL(content::WebContents* source, const GURL& url)
{
- Q_UNUSED(source)
+ Q_UNUSED(source);
m_viewClient->didUpdateTargetURL(toQt(url));
}
-void WebContentsDelegateQt::OnVisibilityChanged(content::Visibility visibility)
-{
- if (visibility != content::Visibility::HIDDEN)
- web_cache::WebCacheManager::GetInstance()->ObserveActivity(web_contents()->GetMainFrame()->GetProcess()->GetID());
-}
-
-void WebContentsDelegateQt::DidFirstVisuallyNonEmptyPaint()
-{
- RenderWidgetHostViewQt *rwhv = static_cast<RenderWidgetHostViewQt*>(web_contents()->GetRenderWidgetHostView());
- if (!rwhv)
- return;
-
- rwhv->OnDidFirstVisuallyNonEmptyPaint();
-}
-
void WebContentsDelegateQt::ActivateContents(content::WebContents* contents)
{
- WebEngineSettings *settings = m_viewClient->webEngineSettings();
- if (settings->testAttribute(settings->Attribute::AllowWindowActivationFromJavaScript))
+ QWebEngineSettings *settings = m_viewClient->webEngineSettings();
+ if (settings->testAttribute(QWebEngineSettings::AllowWindowActivationFromJavaScript))
contents->Focus();
}
@@ -651,19 +694,19 @@ void WebContentsDelegateQt::RequestToLockMouse(content::WebContents *web_content
Q_UNUSED(user_gesture);
if (last_unlocked_by_target)
- web_contents->GotResponseToLockMouseRequest(true);
+ web_contents->GotResponseToLockMouseRequest(blink::mojom::PointerLockResult::kSuccess);
else
- m_viewClient->runMouseLockPermissionRequest(toQt(web_contents->GetLastCommittedURL().GetOrigin()));
+ m_viewClient->runMouseLockPermissionRequest(toQt(web_contents->GetLastCommittedURL().DeprecatedGetOriginAsURL()));
}
-void WebContentsDelegateQt::overrideWebPreferences(content::WebContents *webContents, content::WebPreferences *webPreferences)
+void WebContentsDelegateQt::overrideWebPreferences(content::WebContents *webContents, blink::web_pref::WebPreferences *webPreferences)
{
- m_viewClient->webEngineSettings()->overrideWebPreferences(webContents, webPreferences);
+ WebEngineSettings::get(m_viewClient->webEngineSettings())->overrideWebPreferences(webContents, webPreferences);
}
QSharedPointer<WebContentsAdapter>
WebContentsDelegateQt::createWindow(std::unique_ptr<content::WebContents> new_contents,
- WindowOpenDisposition disposition, const gfx::Rect &initial_pos,
+ WindowOpenDisposition disposition, const gfx::Rect &initial_pos, const QUrl &url,
bool user_gesture)
{
QSharedPointer<WebContentsAdapter> newAdapter = QSharedPointer<WebContentsAdapter>::create(std::move(new_contents));
@@ -671,12 +714,18 @@ WebContentsDelegateQt::createWindow(std::unique_ptr<content::WebContents> new_co
return m_viewClient->adoptNewWindow(
std::move(newAdapter),
static_cast<WebContentsAdapterClient::WindowOpenDisposition>(disposition), user_gesture,
- toQt(initial_pos), m_initialTargetUrl);
+ toQt(initial_pos), url);
}
-void WebContentsDelegateQt::allowCertificateError(const QSharedPointer<CertificateErrorController> &errorController)
+void WebContentsDelegateQt::allowCertificateError(
+ const QSharedPointer<CertificateErrorController> &controller)
{
- m_viewClient->allowCertificateError(errorController);
+ QWebEngineCertificateError error(controller);
+ m_viewClient->allowCertificateError(error);
+ if (!error.isOverridable() || (!controller->deferred() && !controller->answered()))
+ error.rejectCertificate();
+ else
+ m_certificateErrorControllers.append(controller);
}
void WebContentsDelegateQt::selectClientCert(const QSharedPointer<ClientCertSelectController> &selectController)
@@ -693,17 +742,17 @@ extern WebContentsAdapterClient::NavigationType pageTransitionToNavigationType(u
void WebContentsDelegateQt::launchExternalURL(const QUrl &url, ui::PageTransition page_transition, bool is_main_frame, bool has_user_gesture)
{
- WebEngineSettings *settings = m_viewClient->webEngineSettings();
+ QWebEngineSettings *settings = m_viewClient->webEngineSettings();
bool navigationAllowedByPolicy = false;
bool navigationRequestAccepted = true;
switch (settings->unknownUrlSchemePolicy()) {
- case WebEngineSettings::DisallowUnknownUrlSchemes:
+ case QWebEngineSettings::DisallowUnknownUrlSchemes:
break;
- case WebEngineSettings::AllowUnknownUrlSchemesFromUserInteraction:
+ case QWebEngineSettings::AllowUnknownUrlSchemesFromUserInteraction:
navigationAllowedByPolicy = has_user_gesture;
break;
- case WebEngineSettings::AllowAllUnknownUrlSchemes:
+ case QWebEngineSettings::AllowAllUnknownUrlSchemes:
navigationAllowedByPolicy = true;
break;
default:
@@ -711,10 +760,8 @@ void WebContentsDelegateQt::launchExternalURL(const QUrl &url, ui::PageTransitio
}
if (navigationAllowedByPolicy) {
- int navigationRequestAction = WebContentsAdapterClient::AcceptRequest;
- m_viewClient->navigationRequested(pageTransitionToNavigationType(page_transition), url, navigationRequestAction, is_main_frame);
- navigationRequestAccepted = navigationRequestAction == WebContentsAdapterClient::AcceptRequest;
-#ifndef QT_NO_DESKTOPSERVICES
+ m_viewClient->navigationRequested(pageTransitionToNavigationType(page_transition), url, navigationRequestAccepted, is_main_frame);
+#if QT_CONFIG(desktopservices)
if (navigationRequestAccepted)
QDesktopServices::openUrl(url);
#endif
@@ -725,7 +772,7 @@ void WebContentsDelegateQt::launchExternalURL(const QUrl &url, ui::PageTransitio
if (!navigationAllowedByPolicy)
errorDescription = QStringLiteral("Launching external protocol forbidden by WebEngineSettings::UnknownUrlSchemePolicy");
else
- errorDescription = QStringLiteral("Launching external protocol suppressed by WebContentsAdapterClient::navigationRequested");
+ errorDescription = QStringLiteral("Launching external protocol suppressed by 'navigationRequested' API");
didFailLoad(url, net::Error::ERR_ABORTED, errorDescription);
}
}
@@ -739,12 +786,6 @@ void WebContentsDelegateQt::BeforeUnloadFired(content::WebContents *tab, bool pr
m_viewClient->windowCloseRejected();
}
-void WebContentsDelegateQt::BeforeUnloadFired(bool proceed, const base::TimeTicks &proceed_time)
-{
- Q_UNUSED(proceed);
- Q_UNUSED(proceed_time);
-}
-
bool WebContentsDelegateQt::CheckMediaAccessPermission(content::RenderFrameHost *, const GURL& security_origin, blink::mojom::MediaStreamType type)
{
switch (type) {
@@ -754,40 +795,36 @@ bool WebContentsDelegateQt::CheckMediaAccessPermission(content::RenderFrameHost
return m_viewClient->profileAdapter()->checkPermission(toQt(security_origin), ProfileAdapter::VideoCapturePermission);
default:
LOG(INFO) << "WebContentsDelegateQt::CheckMediaAccessPermission: "
- << "Unsupported media stream type checked" << type;
+ << "Unsupported media stream type checked " << type;
return false;
}
}
-void WebContentsDelegateQt::RegisterProtocolHandler(content::WebContents *webContents, const std::string &protocol, const GURL &url, bool)
+void WebContentsDelegateQt::RegisterProtocolHandler(content::RenderFrameHost *frameHost, const std::string &protocol, const GURL &url, bool)
{
- content::BrowserContext *context = webContents->GetBrowserContext();
- if (context->IsOffTheRecord())
- return;
+ content::BrowserContext *context = frameHost->GetBrowserContext();
- ProtocolHandler handler =
- ProtocolHandler::CreateProtocolHandler(protocol, url);
+ custom_handlers::ProtocolHandler handler =
+ custom_handlers::ProtocolHandler::CreateProtocolHandler(protocol, url);
- ProtocolHandlerRegistry *registry =
+ custom_handlers::ProtocolHandlerRegistry *registry =
ProtocolHandlerRegistryFactory::GetForBrowserContext(context);
if (registry->SilentlyHandleRegisterHandlerRequest(handler))
return;
QWebEngineRegisterProtocolHandlerRequest request(
- QSharedPointer<RegisterProtocolHandlerRequestControllerImpl>::create(webContents, handler));
+ QSharedPointer<RegisterProtocolHandlerRequestControllerImpl>::create(content::WebContents::FromRenderFrameHost(frameHost), handler));
m_viewClient->runRegisterProtocolHandlerRequest(std::move(request));
}
-void WebContentsDelegateQt::UnregisterProtocolHandler(content::WebContents *webContents, const std::string &protocol, const GURL &url, bool)
+void WebContentsDelegateQt::UnregisterProtocolHandler(content::RenderFrameHost *frameHost, const std::string &protocol, const GURL &url, bool)
{
- content::BrowserContext* context = webContents->GetBrowserContext();
- if (context->IsOffTheRecord())
- return;
+ content::BrowserContext* context = frameHost->GetBrowserContext();
- ProtocolHandler handler =
- ProtocolHandler::CreateProtocolHandler(protocol, url);
+ custom_handlers::ProtocolHandler handler =
+ custom_handlers::ProtocolHandler::CreateProtocolHandler(protocol, url);
- ProtocolHandlerRegistry* registry =
+ custom_handlers::ProtocolHandlerRegistry* registry =
ProtocolHandlerRegistryFactory::GetForBrowserContext(context);
registry->RemoveHandler(handler);
}
@@ -807,9 +844,25 @@ void WebContentsDelegateQt::ContentsZoomChange(bool zoom_in)
adapter->setZoomFactor(adapter->currentZoomFactor() - 0.1f);
}
-FaviconManager *WebContentsDelegateQt::faviconManager()
+void WebContentsDelegateQt::ResourceLoadComplete(content::RenderFrameHost* render_frame_host,
+ const content::GlobalRequestID& request_id,
+ const blink::mojom::ResourceLoadInfo& resource_load_info)
{
- return m_faviconManager.data();
+ Q_UNUSED(render_frame_host);
+ Q_UNUSED(request_id);
+
+ if (resource_load_info.request_destination == network::mojom::RequestDestination::kDocument) {
+ m_isDocumentEmpty = (resource_load_info.raw_body_bytes == 0);
+ }
+}
+
+void WebContentsDelegateQt::InnerWebContentsAttached(content::WebContents *inner_web_contents,
+ content::RenderFrameHost *render_frame_host,
+ bool is_full_page)
+{
+ blink::web_pref::WebPreferences guestPrefs = inner_web_contents->GetOrCreateWebPreferences();
+ webEngineSettings()->overrideWebPreferences(inner_web_contents, &guestPrefs);
+ inner_web_contents->SetWebPreferences(guestPrefs);
}
FindTextHelper *WebContentsDelegateQt::findTextHelper()
@@ -818,7 +871,7 @@ FindTextHelper *WebContentsDelegateQt::findTextHelper()
}
WebEngineSettings *WebContentsDelegateQt::webEngineSettings() const {
- return m_viewClient->webEngineSettings();
+ return WebEngineSettings::get(m_viewClient->webEngineSettings());
}
WebContentsAdapter *WebContentsDelegateQt::webContentsAdapter() const
@@ -830,14 +883,13 @@ void WebContentsDelegateQt::copyStateFrom(WebContentsDelegateQt *source)
{
m_title = source->m_title;
NavigationStateChanged(web_contents(), content::INVALIDATE_TYPE_URL);
- m_faviconManager->copyStateFrom(source->m_faviconManager.data());
}
WebContentsDelegateQt::LoadingState WebContentsDelegateQt::determineLoadingState(content::WebContents *contents)
{
// Based on TabLoadTracker::DetermineLoadingState
- if (contents->IsLoadingToDifferentDocument() && !contents->IsWaitingForResponse())
+ if (contents->ShouldShowLoadingUI() && !contents->IsWaitingForResponse())
return LoadingState::Loading;
content::NavigationController &controller = contents->GetController();
@@ -875,6 +927,8 @@ int &WebContentsDelegateQt::streamCount(blink::mojom::MediaStreamType type)
case blink::mojom::MediaStreamType::GUM_DESKTOP_AUDIO_CAPTURE:
case blink::mojom::MediaStreamType::DISPLAY_VIDEO_CAPTURE:
case blink::mojom::MediaStreamType::DISPLAY_AUDIO_CAPTURE:
+ case blink::mojom::MediaStreamType::DISPLAY_VIDEO_CAPTURE_THIS_TAB:
+ case blink::mojom::MediaStreamType::DISPLAY_VIDEO_CAPTURE_SET:
return m_desktopStreamCount;
case blink::mojom::MediaStreamType::NO_SERVICE:
@@ -886,22 +940,36 @@ int &WebContentsDelegateQt::streamCount(blink::mojom::MediaStreamType type)
return m_videoStreamCount;
}
-void WebContentsDelegateQt::addDevices(const blink::MediaStreamDevices &devices)
+void WebContentsDelegateQt::addDevices(const blink::mojom::StreamDevices &devices)
{
- for (const auto &device : devices)
- ++streamCount(device.type);
+ if (devices.audio_device.has_value())
+ addDevice(devices.audio_device.value());
+ if (devices.video_device.has_value())
+ addDevice(devices.video_device.value());
webContentsAdapter()->updateRecommendedState();
}
-void WebContentsDelegateQt::removeDevices(const blink::MediaStreamDevices &devices)
+void WebContentsDelegateQt::removeDevices(const blink::mojom::StreamDevices &devices)
{
- for (const auto &device : devices)
- ++streamCount(device.type);
+ if (devices.audio_device.has_value())
+ removeDevice(devices.audio_device.value());
+ if (devices.video_device.has_value())
+ removeDevice(devices.video_device.value());
webContentsAdapter()->updateRecommendedState();
}
+void WebContentsDelegateQt::addDevice(const blink::MediaStreamDevice &device)
+{
+ ++streamCount(device.type);
+}
+
+void WebContentsDelegateQt::removeDevice(const blink::MediaStreamDevice &device)
+{
+ --streamCount(device.type);
+}
+
FrameFocusedObserver::FrameFocusedObserver(WebContentsAdapterClient *adapterClient)
: m_viewClient(adapterClient)
{}
diff --git a/src/core/web_contents_delegate_qt.h b/src/core/web_contents_delegate_qt.h
index bfef9a1df..51004878d 100644
--- a/src/core/web_contents_delegate_qt.h
+++ b/src/core/web_contents_delegate_qt.h
@@ -1,74 +1,35 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef WEB_CONTENTS_DELEGATE_QT_H
#define WEB_CONTENTS_DELEGATE_QT_H
-#include "content/browser/frame_host/frame_tree_node.h"
-#include "content/public/browser/media_capture_devices.h"
+#include "content/browser/renderer_host/frame_tree_node.h"
#include "content/public/browser/web_contents_delegate.h"
#include "content/public/browser/web_contents_observer.h"
#include "third_party/skia/include/core/SkColor.h"
-#include "base/callback.h"
+#include "web_contents_adapter_client.h"
-#include "color_chooser_controller.h"
-#include "favicon_manager.h"
-#include "find_text_helper.h"
-#include "javascript_dialog_manager_qt.h"
+#include <QtCore/qlist.h>
+#include <QtCore/qmap.h>
-#include <QtCore/qvector.h>
-
-QT_FORWARD_DECLARE_CLASS(CertificateErrorController)
-QT_FORWARD_DECLARE_CLASS(ClientCertSelectController)
+namespace blink {
+ namespace web_pref {
+ struct WebPreferences;
+ }
+}
namespace content {
- class ColorChooser;
- class SiteInstance;
- class JavaScriptDialogManager;
- class WebContents;
- struct WebPreferences;
- struct ColorSuggestion;
+class ColorChooser;
+class JavaScriptDialogManager;
+class WebContents;
+struct MediaStreamRequest;
}
namespace QtWebEngineCore {
+class FindTextHelper;
class WebContentsAdapter;
class WebContentsAdapterClient;
class WebEngineSettings;
@@ -87,7 +48,7 @@ protected:
private:
WebContentsAdapterClient *m_viewClient;
- QVector<content::FrameTreeNode *> m_observedNodes;
+ QList<content::FrameTreeNode *> m_observedNodes;
};
class SavePageInfo
@@ -120,22 +81,23 @@ public:
// WebContentsDelegate overrides
content::WebContents *OpenURLFromTab(content::WebContents *source, const content::OpenURLParams &params) override;
void NavigationStateChanged(content::WebContents* source, content::InvalidateTypes changed_flags) override;
- void AddNewContents(content::WebContents *source, std::unique_ptr<content::WebContents> new_contents, WindowOpenDisposition disposition, const gfx::Rect &initial_pos, bool user_gesture, bool *was_blocked) override;
+ void AddNewContents(content::WebContents *source, std::unique_ptr<content::WebContents> new_contents, const GURL &target_url,
+ WindowOpenDisposition disposition, const blink::mojom::WindowFeatures &window_features, bool user_gesture, bool *was_blocked) override;
void CloseContents(content::WebContents *source) override;
void LoadProgressChanged(double progress) override;
bool HandleKeyboardEvent(content::WebContents *source, const content::NativeWebKeyboardEvent &event) override;
- content::ColorChooser* OpenColorChooser(content::WebContents *source, SkColor color, const std::vector<blink::mojom::ColorSuggestionPtr> &suggestions) override;
+ std::unique_ptr<content::ColorChooser> OpenColorChooser(content::WebContents *source, SkColor color, const std::vector<blink::mojom::ColorSuggestionPtr> &suggestions) override;
void WebContentsCreated(content::WebContents *source_contents, int opener_render_process_id, int opener_render_frame_id,
const std::string &frame_name, const GURL &target_url, content::WebContents *new_contents) override;
content::JavaScriptDialogManager *GetJavaScriptDialogManager(content::WebContents *source) override;
- void EnterFullscreenModeForTab(content::WebContents *web_contents, const GURL &origin, const blink::mojom::FullscreenOptions &options) override;
+ void EnterFullscreenModeForTab(content::RenderFrameHost *requesting_frame, const blink::mojom::FullscreenOptions &options) override;
void ExitFullscreenModeForTab(content::WebContents*) override;
bool IsFullscreenForTabOrPending(const content::WebContents* web_contents) override;
void RunFileChooser(content::RenderFrameHost* render_frame_host,
- std::unique_ptr<content::FileSelectListener> listener,
+ scoped_refptr<content::FileSelectListener> listener,
const blink::mojom::FileChooserParams& params) override;
bool DidAddMessageToConsole(content::WebContents *source, blink::mojom::ConsoleMessageLevel log_level,
- const base::string16 &message, int32_t line_no, const base::string16 &source_id) override;
+ const std::u16string &message, int32_t line_no, const std::u16string &source_id) override;
void FindReply(content::WebContents *source, int request_id, int number_of_matches, const gfx::Rect& selection_rect, int active_match_ordinal, bool final_update) override;
void RequestMediaAccessPermission(content::WebContents *web_contents,
const content::MediaStreamRequest &request,
@@ -145,41 +107,41 @@ public:
void RequestToLockMouse(content::WebContents *web_contents, bool user_gesture, bool last_unlocked_by_target) override;
void BeforeUnloadFired(content::WebContents* tab, bool proceed, bool* proceed_to_fire_unload) override;
bool CheckMediaAccessPermission(content::RenderFrameHost* render_frame_host, const GURL& security_origin, blink::mojom::MediaStreamType type) override;
- void RegisterProtocolHandler(content::WebContents* web_contents, const std::string& protocol, const GURL& url, bool user_gesture) override;
- void UnregisterProtocolHandler(content::WebContents* web_contents, const std::string& protocol, const GURL& url, bool user_gesture) override;
+ void RegisterProtocolHandler(content::RenderFrameHost* frame_host, const std::string& protocol, const GURL& url, bool user_gesture) override;
+ void UnregisterProtocolHandler(content::RenderFrameHost* frame_host, const std::string& protocol, const GURL& url, bool user_gesture) override;
bool TakeFocus(content::WebContents *source, bool reverse) override;
void ContentsZoomChange(bool zoom_in) override;
// WebContentsObserver overrides
void RenderFrameCreated(content::RenderFrameHost *render_frame_host) override;
- void RenderFrameDeleted(content::RenderFrameHost *render_frame_host) override;
- void RenderProcessGone(base::TerminationStatus status) override;
+ void PrimaryMainFrameRenderProcessGone(base::TerminationStatus status) override;
void RenderFrameHostChanged(content::RenderFrameHost *old_host, content::RenderFrameHost *new_host) override;
void RenderViewHostChanged(content::RenderViewHost *old_host, content::RenderViewHost *new_host) override;
+ void RenderViewReady() override;
void DidStartNavigation(content::NavigationHandle *navigation_handle) override;
void DidFinishNavigation(content::NavigationHandle *navigation_handle) override;
- void DidStartLoading() override;
- void DidReceiveResponse() override;
+ void PrimaryPageChanged(content::Page &page) override;
void DidStopLoading() override;
- void DidFailLoad(content::RenderFrameHost* render_frame_host, const GURL& validated_url, int error_code, const base::string16& error_description) override;
+ void DidFailLoad(content::RenderFrameHost* render_frame_host, const GURL& validated_url, int error_code) override;
void DidFinishLoad(content::RenderFrameHost *render_frame_host, const GURL &validated_url) override;
- void BeforeUnloadFired(bool proceed, const base::TimeTicks& proceed_time) override;
- void DidUpdateFaviconURL(const std::vector<content::FaviconURL> &candidates) override;
- void OnVisibilityChanged(content::Visibility visibility) override;
- void DidFirstVisuallyNonEmptyPaint() override;
void ActivateContents(content::WebContents* contents) override;
+ void ResourceLoadComplete(content::RenderFrameHost* render_frame_host,
+ const content::GlobalRequestID& request_id,
+ const blink::mojom::ResourceLoadInfo& resource_load_info) override;
+ void InnerWebContentsAttached(content::WebContents *inner_web_contents,
+ content::RenderFrameHost *render_frame_host,
+ bool is_full_page) override;
void didFailLoad(const QUrl &url, int errorCode, const QString &errorDescription);
- void overrideWebPreferences(content::WebContents *, content::WebPreferences*);
+ void overrideWebPreferences(content::WebContents *, blink::web_pref::WebPreferences*);
void allowCertificateError(const QSharedPointer<CertificateErrorController> &);
void selectClientCert(const QSharedPointer<ClientCertSelectController> &);
void requestFeaturePermission(ProfileAdapter::PermissionType feature, const QUrl &requestingOrigin);
void launchExternalURL(const QUrl &url, ui::PageTransition page_transition, bool is_main_frame, bool has_user_gesture);
- FaviconManager *faviconManager();
FindTextHelper *findTextHelper();
- void setSavePageInfo(const SavePageInfo &spi) { m_savePageInfo = spi; }
- const SavePageInfo &savePageInfo() { return m_savePageInfo; }
+ void setSavePageInfo(SavePageInfo *spi) { m_savePageInfo.reset(spi); }
+ SavePageInfo *savePageInfo() { return m_savePageInfo.get(); }
WebEngineSettings *webEngineSettings() const;
WebContentsAdapter *webContentsAdapter() const;
@@ -190,8 +152,10 @@ public:
using LoadingState = WebContentsAdapterClient::LoadingState;
LoadingState loadingState() const { return m_loadingState; }
- void addDevices(const blink::MediaStreamDevices &devices);
- void removeDevices(const blink::MediaStreamDevices &devices);
+ void addDevices(const blink::mojom::StreamDevices &devices);
+ void removeDevices(const blink::mojom::StreamDevices &devices);
+ void addDevice(const blink::MediaStreamDevice &device);
+ void removeDevice(const blink::MediaStreamDevice &device);
bool isCapturingAudio() const { return m_audioStreamCount > 0; }
bool isCapturingVideo() const { return m_videoStreamCount > 0; }
@@ -204,10 +168,11 @@ private:
QSharedPointer<WebContentsAdapter>
createWindow(std::unique_ptr<content::WebContents> new_contents,
WindowOpenDisposition disposition, const gfx::Rect &initial_pos,
+ const QUrl &url,
bool user_gesture);
- void EmitLoadStarted(const QUrl &url, bool isErrorPage = false);
- void EmitLoadFinished(bool success, const QUrl &url, bool isErrorPage = false, int errorCode = 0, const QString &errorDescription = QString());
- void EmitLoadCommitted();
+ void emitLoadStarted(bool isErrorPage = false);
+ void emitLoadFinished(bool isErrorPage = false);
+ void emitLoadCommitted();
LoadingState determineLoadingState(content::WebContents *contents);
void setLoadingState(LoadingState state);
@@ -215,15 +180,10 @@ private:
int &streamCount(blink::mojom::MediaStreamType type);
WebContentsAdapterClient *m_viewClient;
- QVector<int64_t> m_loadingErrorFrameList;
- QScopedPointer<FaviconManager> m_faviconManager;
QScopedPointer<FindTextHelper> m_findTextHelper;
- SavePageInfo m_savePageInfo;
+ std::unique_ptr<SavePageInfo> m_savePageInfo;
QSharedPointer<FilePickerController> m_filePickerController;
- QUrl m_initialTargetUrl;
- int m_lastLoadProgress;
LoadingState m_loadingState;
- bool m_didStartLoadingSeen;
FrameFocusedObserver m_frameFocusedObserver;
QString m_title;
@@ -233,7 +193,22 @@ private:
int m_desktopStreamCount = 0;
mutable bool m_pendingUrlUpdate = false;
+ struct LoadingInfo {
+ bool success = false;
+ int progress = -1;
+ bool isLoading() const { return progress >= 0; }
+ QUrl url;
+ bool isErrorPage = false;
+ int errorCode = 0, errorDomain = 0;
+ QString errorDescription;
+ bool triggersErrorPage = false;
+ QMultiMap<QByteArray, QByteArray> responseHeaders;
+ void clear() { *this = LoadingInfo(); }
+ } m_loadingInfo;
+
+ bool m_isDocumentEmpty = true;
base::WeakPtrFactory<WebContentsDelegateQt> m_weakPtrFactory { this };
+ QList<QWeakPointer<CertificateErrorController>> m_certificateErrorControllers;
};
} // namespace QtWebEngineCore
diff --git a/src/core/web_contents_view_qt.cpp b/src/core/web_contents_view_qt.cpp
index 7f6bfe34f..023f9e99f 100644
--- a/src/core/web_contents_view_qt.cpp
+++ b/src/core/web_contents_view_qt.cpp
@@ -1,70 +1,38 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "web_contents_view_qt.h"
-#include "profile_adapter.h"
-#include "content_browser_client_qt.h"
#include "render_widget_host_view_qt.h"
#include "render_widget_host_view_qt_delegate.h"
-#include "render_widget_host_view_qt.h"
#include "touch_selection_controller_client_qt.h"
#include "type_conversion.h"
-#include "web_contents_adapter_client.h"
#include "web_contents_adapter.h"
-#include "web_engine_context.h"
-#include "web_contents_delegate_qt.h"
+#include "web_contents_adapter_client.h"
-#include "components/spellcheck/spellcheck_buildflags.h"
-#include "content/browser/renderer_host/render_view_host_impl.h"
-#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/browser/web_contents/web_contents_impl.h"
+#include "content/public/browser/context_menu_params.h"
#include "content/public/browser/web_contents_delegate.h"
-#include "content/public/common/context_menu_params.h"
+#include "third_party/blink/public/common/context_menu_data/context_menu_data.h"
#include "third_party/blink/public/common/context_menu_data/edit_flags.h"
-#include "third_party/blink/public/common/context_menu_data/media_type.h"
+#include "third_party/blink/public/mojom/context_menu/context_menu.mojom.h"
+
#include "ui/gfx/image/image_skia.h"
-#include <QtGui/qpixmap.h>
+#include <QtGui/QPixmap>
+#include <QtWebEngineCore/private/qwebenginecontextmenurequest_p.h>
namespace QtWebEngineCore {
+WebContentsViewQt::WebContentsViewQt(content::WebContents *webContents)
+ : m_webContents(webContents)
+ , m_client(nullptr)
+ , m_factoryClient(nullptr)
+ , m_contextMenuRequest(
+ new QWebEngineContextMenuRequest(new QWebEngineContextMenuRequestPrivate()))
+{
+}
+
void WebContentsViewQt::setFactoryClient(WebContentsAdapterClient* client)
{
if (m_factoryClient)
@@ -73,7 +41,7 @@ void WebContentsViewQt::setFactoryClient(WebContentsAdapterClient* client)
// Check if a RWHV was created before the pre-initialization.
if (auto view = static_cast<RenderWidgetHostViewQt *>(m_webContents->GetRenderWidgetHostView())) {
- view->setDelegate(m_factoryClient->CreateRenderWidgetHostViewQtDelegate(view));
+ view->setDelegate(m_factoryClient->CreateRenderWidgetHostViewQtDelegate(view->delegateClient()));
}
}
@@ -94,7 +62,7 @@ content::RenderWidgetHostViewBase* WebContentsViewQt::CreateViewForWidget(conten
RenderWidgetHostViewQt *view = new RenderWidgetHostViewQt(render_widget_host);
if (m_factoryClient) {
- view->setDelegate(m_factoryClient->CreateRenderWidgetHostViewQtDelegate(view));
+ view->setDelegate(m_factoryClient->CreateRenderWidgetHostViewQtDelegate(view->delegateClient()));
if (m_client)
view->setAdapterClient(m_client);
}
@@ -107,7 +75,7 @@ content::RenderWidgetHostViewBase* WebContentsViewQt::CreateViewForChildWidget(c
RenderWidgetHostViewQt *view = new RenderWidgetHostViewQt(render_widget_host);
Q_ASSERT(m_client);
- view->setDelegate(m_client->CreateRenderWidgetHostViewQtDelegateForPopup(view));
+ view->setDelegate(m_client->CreateRenderWidgetHostViewQtDelegateForPopup(view->delegateClient()));
view->setAdapterClient(m_client);
return view;
@@ -122,12 +90,13 @@ gfx::NativeView WebContentsViewQt::GetNativeView() const
return nullptr;
}
-void WebContentsViewQt::GetContainerBounds(gfx::Rect* out) const
+gfx::Rect WebContentsViewQt::GetContainerBounds() const
{
if (m_client) {
const QRectF r(m_client->viewportRect());
- *out = gfx::Rect(r.x(), r.y(), r.width(), r.height());
+ return gfx::Rect(r.x(), r.y(), r.width(), r.height());
}
+ return gfx::Rect();
}
void WebContentsViewQt::Focus()
@@ -147,85 +116,79 @@ void WebContentsViewQt::SetInitialFocus()
void WebContentsViewQt::FocusThroughTabTraversal(bool reverse)
{
content::WebContentsImpl *web_contents = static_cast<content::WebContentsImpl*>(m_webContents);
- if (web_contents->ShowingInterstitialPage()) {
- web_contents->GetInterstitialPage()->FocusThroughTabTraversal(reverse);
- return;
- }
- content::RenderWidgetHostView *fullscreen_view = web_contents->GetFullscreenRenderWidgetHostView();
- if (fullscreen_view) {
- fullscreen_view->Focus();
- return;
- }
web_contents->GetRenderViewHost()->SetInitialFocus(reverse);
}
-
-ASSERT_ENUMS_MATCH(WebEngineContextMenuData::MediaTypeNone, blink::ContextMenuDataMediaType::kNone)
-ASSERT_ENUMS_MATCH(WebEngineContextMenuData::MediaTypeImage, blink::ContextMenuDataMediaType::kImage)
-ASSERT_ENUMS_MATCH(WebEngineContextMenuData::MediaTypeVideo, blink::ContextMenuDataMediaType::kVideo)
-ASSERT_ENUMS_MATCH(WebEngineContextMenuData::MediaTypeAudio, blink::ContextMenuDataMediaType::kAudio)
-ASSERT_ENUMS_MATCH(WebEngineContextMenuData::MediaTypeCanvas, blink::ContextMenuDataMediaType::kCanvas)
-ASSERT_ENUMS_MATCH(WebEngineContextMenuData::MediaTypeFile, blink::ContextMenuDataMediaType::kFile)
-ASSERT_ENUMS_MATCH(WebEngineContextMenuData::MediaTypePlugin, blink::ContextMenuDataMediaType::kPlugin)
-
-ASSERT_ENUMS_MATCH(WebEngineContextMenuData::MediaNone, blink::WebContextMenuData::kMediaNone)
-ASSERT_ENUMS_MATCH(WebEngineContextMenuData::MediaInError, blink::WebContextMenuData::kMediaInError)
-ASSERT_ENUMS_MATCH(WebEngineContextMenuData::MediaPaused, blink::WebContextMenuData::kMediaPaused)
-ASSERT_ENUMS_MATCH(WebEngineContextMenuData::MediaMuted, blink::WebContextMenuData::kMediaMuted)
-ASSERT_ENUMS_MATCH(WebEngineContextMenuData::MediaLoop, blink::WebContextMenuData::kMediaLoop)
-ASSERT_ENUMS_MATCH(WebEngineContextMenuData::MediaCanSave, blink::WebContextMenuData::kMediaCanSave)
-ASSERT_ENUMS_MATCH(WebEngineContextMenuData::MediaHasAudio, blink::WebContextMenuData::kMediaHasAudio)
-ASSERT_ENUMS_MATCH(WebEngineContextMenuData::MediaCanToggleControls, blink::WebContextMenuData::kMediaCanToggleControls)
-ASSERT_ENUMS_MATCH(WebEngineContextMenuData::MediaControls, blink::WebContextMenuData::kMediaControls)
-ASSERT_ENUMS_MATCH(WebEngineContextMenuData::MediaCanPrint, blink::WebContextMenuData::kMediaCanPrint)
-ASSERT_ENUMS_MATCH(WebEngineContextMenuData::MediaCanRotate, blink::WebContextMenuData::kMediaCanRotate)
-
-ASSERT_ENUMS_MATCH(WebEngineContextMenuData::CanDoNone, blink::kCanDoNone)
-ASSERT_ENUMS_MATCH(WebEngineContextMenuData::CanUndo, blink::kCanUndo)
-ASSERT_ENUMS_MATCH(WebEngineContextMenuData::CanRedo, blink::kCanRedo)
-ASSERT_ENUMS_MATCH(WebEngineContextMenuData::CanCut, blink::kCanCut)
-ASSERT_ENUMS_MATCH(WebEngineContextMenuData::CanCopy, blink::kCanCopy)
-ASSERT_ENUMS_MATCH(WebEngineContextMenuData::CanPaste, blink::kCanPaste)
-ASSERT_ENUMS_MATCH(WebEngineContextMenuData::CanDelete, blink::kCanDelete)
-ASSERT_ENUMS_MATCH(WebEngineContextMenuData::CanSelectAll, blink::kCanSelectAll)
-ASSERT_ENUMS_MATCH(WebEngineContextMenuData::CanTranslate, blink::kCanTranslate)
-ASSERT_ENUMS_MATCH(WebEngineContextMenuData::CanEditRichly, blink::kCanEditRichly)
-
-static inline WebEngineContextMenuData fromParams(const content::ContextMenuParams &params)
+ASSERT_ENUMS_MATCH(QWebEngineContextMenuRequest::MediaTypeNone,
+ blink::mojom::ContextMenuDataMediaType::kNone)
+ASSERT_ENUMS_MATCH(QWebEngineContextMenuRequest::MediaTypeImage,
+ blink::mojom::ContextMenuDataMediaType::kImage)
+ASSERT_ENUMS_MATCH(QWebEngineContextMenuRequest::MediaTypeVideo,
+ blink::mojom::ContextMenuDataMediaType::kVideo)
+ASSERT_ENUMS_MATCH(QWebEngineContextMenuRequest::MediaTypeAudio,
+ blink::mojom::ContextMenuDataMediaType::kAudio)
+ASSERT_ENUMS_MATCH(QWebEngineContextMenuRequest::MediaTypeCanvas,
+ blink::mojom::ContextMenuDataMediaType::kCanvas)
+ASSERT_ENUMS_MATCH(QWebEngineContextMenuRequest::MediaTypeFile,
+ blink::mojom::ContextMenuDataMediaType::kFile)
+ASSERT_ENUMS_MATCH(QWebEngineContextMenuRequest::MediaTypePlugin,
+ blink::mojom::ContextMenuDataMediaType::kPlugin)
+
+ASSERT_ENUMS_MATCH(QWebEngineContextMenuRequest::MediaInError,
+ blink::ContextMenuData::kMediaInError)
+ASSERT_ENUMS_MATCH(QWebEngineContextMenuRequest::MediaPaused,
+ blink::ContextMenuData::kMediaPaused)
+ASSERT_ENUMS_MATCH(QWebEngineContextMenuRequest::MediaMuted, blink::ContextMenuData::kMediaMuted)
+ASSERT_ENUMS_MATCH(QWebEngineContextMenuRequest::MediaLoop, blink::ContextMenuData::kMediaLoop)
+ASSERT_ENUMS_MATCH(QWebEngineContextMenuRequest::MediaCanSave,
+ blink::ContextMenuData::kMediaCanSave)
+ASSERT_ENUMS_MATCH(QWebEngineContextMenuRequest::MediaHasAudio,
+ blink::ContextMenuData::kMediaHasAudio)
+ASSERT_ENUMS_MATCH(QWebEngineContextMenuRequest::MediaCanToggleControls,
+ blink::ContextMenuData::kMediaCanToggleControls)
+ASSERT_ENUMS_MATCH(QWebEngineContextMenuRequest::MediaControls,
+ blink::ContextMenuData::kMediaControls)
+ASSERT_ENUMS_MATCH(QWebEngineContextMenuRequest::MediaCanPrint,
+ blink::ContextMenuData::kMediaCanPrint)
+ASSERT_ENUMS_MATCH(QWebEngineContextMenuRequest::MediaCanRotate,
+ blink::ContextMenuData::kMediaCanRotate)
+
+ASSERT_ENUMS_MATCH(QWebEngineContextMenuRequest::CanUndo, blink::kCanUndo)
+ASSERT_ENUMS_MATCH(QWebEngineContextMenuRequest::CanRedo, blink::kCanRedo)
+ASSERT_ENUMS_MATCH(QWebEngineContextMenuRequest::CanCut, blink::kCanCut)
+ASSERT_ENUMS_MATCH(QWebEngineContextMenuRequest::CanCopy, blink::kCanCopy)
+ASSERT_ENUMS_MATCH(QWebEngineContextMenuRequest::CanPaste, blink::kCanPaste)
+ASSERT_ENUMS_MATCH(QWebEngineContextMenuRequest::CanDelete, blink::kCanDelete)
+ASSERT_ENUMS_MATCH(QWebEngineContextMenuRequest::CanSelectAll, blink::kCanSelectAll)
+ASSERT_ENUMS_MATCH(QWebEngineContextMenuRequest::CanTranslate, blink::kCanTranslate)
+ASSERT_ENUMS_MATCH(QWebEngineContextMenuRequest::CanEditRichly, blink::kCanEditRichly)
+
+// static
+void WebContentsViewQt::update(QWebEngineContextMenuRequest *request,
+ const content::ContextMenuParams &params, bool spellcheckEnabled)
{
- WebEngineContextMenuData ret;
- ret.setPosition(QPoint(params.x, params.y));
- ret.setLinkUrl(toQt(params.link_url));
- ret.setLinkText(toQt(params.link_text.data()));
- ret.setAltText(toQt(params.alt_text.data()));
- ret.setTitleText(toQt(params.title_text.data()));
- ret.setUnfilteredLinkUrl(toQt(params.unfiltered_link_url));
- ret.setSelectedText(toQt(params.selection_text.data()));
- ret.setMediaUrl(toQt(params.src_url));
- ret.setMediaType((WebEngineContextMenuData::MediaType)params.media_type);
- ret.setHasImageContent(params.has_image_contents);
- ret.setMediaFlags((WebEngineContextMenuData::MediaFlags)params.media_flags);
- ret.setEditFlags((WebEngineContextMenuData::EditFlags)params.edit_flags);
- ret.setSuggestedFileName(toQt(params.suggested_filename.data()));
- ret.setIsEditable(params.is_editable);
+ auto *re = request->d.data();
+ re->m_position = QPoint(params.x, params.y);
+ re->m_filteredLinkUrl = toQt(params.link_url);
+ re->m_linkText = toQt(params.link_text);
+ re->m_altText = toQt(params.alt_text);
+ re->m_titleText = toQt(params.title_text);
+ re->m_unfilteredLinkUrl = toQt(params.unfiltered_link_url);
+ re->m_selectedText = toQt(params.selection_text);
+ re->m_mediaUrl = toQt(params.src_url);
+ re->m_mediaType = (QWebEngineContextMenuRequest::MediaType)params.media_type;
+ re->m_hasImageContent = params.has_image_contents;
+ re->m_mediaFlags = (QWebEngineContextMenuRequest::MediaFlags)params.media_flags;
+ re->m_editFlags = (QWebEngineContextMenuRequest::EditFlags)params.edit_flags;
+ re->m_suggestedFileName = toQt(params.suggested_filename);
+ re->m_isEditable = params.is_editable;
#if QT_CONFIG(webengine_spellchecker)
- ret.setMisspelledWord(toQt(params.misspelled_word));
- ret.setSpellCheckerSuggestions(fromVector(params.dictionary_suggestions));
+ re->m_misspelledWord = toQt(params.misspelled_word);
+ re->m_spellCheckerSuggestions = fromVector(params.dictionary_suggestions);
#endif
- ret.setFrameUrl(toQt(params.frame_url));
- ret.setPageUrl(toQt(params.page_url));
- ret.setReferrerPolicy((ReferrerPolicy)params.referrer_policy);
- return ret;
-}
-
-void WebContentsViewQt::ShowContextMenu(content::RenderFrameHost *, const content::ContextMenuParams &params)
-{
- if (auto rwhv = static_cast<RenderWidgetHostViewQt *>(m_webContents->GetRenderWidgetHostView())) {
- if (rwhv && rwhv->getTouchSelectionControllerClient()->handleContextMenu(params))
- return;
- }
-
- WebEngineContextMenuData contextMenuData(fromParams(params));
+ re->m_frameUrl = toQt(params.frame_url);
+ re->m_pageUrl = toQt(params.page_url);
+ re->m_referrerPolicy = (ReferrerPolicy)params.referrer_policy;
#if QT_CONFIG(webengine_spellchecker)
// Do not use params.spellcheck_enabled, since it is never
// correctly initialized for chrome asynchronous spellchecking.
@@ -234,34 +197,48 @@ void WebContentsViewQt::ShowContextMenu(content::RenderFrameHost *, const conten
// must be initialized to true due to the way how the initialization sequence
// in SpellCheck works ie. typing the first word triggers the creation
// of the SpellcheckService. Use user preference store instead.
- contextMenuData.setIsSpellCheckerEnabled(m_client->profileAdapter()->isSpellCheckEnabled());
+ re->m_isSpellCheckerEnabled = spellcheckEnabled;
#endif
- m_client->contextMenuRequested(contextMenuData);
}
-Qt::DropActions toQtDropActions(blink::WebDragOperationsMask ops)
+void WebContentsViewQt::ShowContextMenu(content::RenderFrameHost &,
+ const content::ContextMenuParams &params)
+{
+ if (auto rwhv =
+ static_cast<RenderWidgetHostViewQt *>(m_webContents->GetRenderWidgetHostView())) {
+ if (rwhv && rwhv->getTouchSelectionControllerClient()->handleContextMenu(params))
+ return;
+ }
+ const bool spellcheckEnabled = m_client->profileAdapter()->isSpellCheckEnabled();
+ update(m_contextMenuRequest.get(), params, spellcheckEnabled);
+ m_client->contextMenuRequested(m_contextMenuRequest.get());
+}
+
+static Qt::DropActions toQtDropActions(blink::DragOperationsMask ops)
{
Qt::DropActions result;
- if (ops & blink::kWebDragOperationCopy)
+ if (ops & blink::kDragOperationCopy)
result |= Qt::CopyAction;
- if (ops & blink::kWebDragOperationLink)
+ if (ops & blink::kDragOperationLink)
result |= Qt::LinkAction;
- if (ops & blink::kWebDragOperationMove || ops & blink::kWebDragOperationDelete)
+ if (ops & blink::kDragOperationMove)
result |= Qt::MoveAction;
return result;
}
void WebContentsViewQt::StartDragging(const content::DropData &drop_data,
- blink::WebDragOperationsMask allowed_ops,
+ blink::DragOperationsMask allowed_ops,
const gfx::ImageSkia &image,
const gfx::Vector2d &image_offset,
- const content::DragEventSourceInfo &event_info,
- content::RenderWidgetHostImpl* source_rwh)
+ const gfx::Rect &drag_obj_rect,
+ const blink::mojom::DragEventSourceInfo &event_info,
+ content::RenderWidgetHostImpl *source_rwh)
{
#if QT_CONFIG(draganddrop)
Q_UNUSED(event_info);
- if (!m_client->supportsDragging()) {
+ QObject *dragSource = m_client->dragSource();
+ if (!dragSource) {
if (source_rwh)
source_rwh->DragSourceSystemDragEnded();
return;
@@ -275,14 +252,14 @@ void WebContentsViewQt::StartDragging(const content::DropData &drop_data,
hotspot.setY(image_offset.y());
}
- m_client->startDragging(drop_data, toQtDropActions(allowed_ops), pixmap, hotspot);
+ m_client->webContentsAdapter()->startDragging(dragSource, drop_data, toQtDropActions(allowed_ops), pixmap, hotspot);
#endif // QT_CONFIG(draganddrop)
}
-void WebContentsViewQt::UpdateDragCursor(blink::WebDragOperation dragOperation)
+void WebContentsViewQt::UpdateDragCursor(ui::mojom::DragOperation dragOperation)
{
#if QT_CONFIG(draganddrop)
- m_client->webContentsAdapter()->updateDragAction(dragOperation);
+ m_client->webContentsAdapter()->updateDragAction(int(dragOperation));
#endif // QT_CONFIG(draganddrop)
}
diff --git a/src/core/web_contents_view_qt.h b/src/core/web_contents_view_qt.h
index 3dcb648bf..8754250e6 100644
--- a/src/core/web_contents_view_qt.h
+++ b/src/core/web_contents_view_qt.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef WEB_CONTENTS_VIEW_QT_H
#define WEB_CONTENTS_VIEW_QT_H
@@ -43,7 +7,13 @@
#include "content/browser/renderer_host/render_view_host_delegate_view.h"
#include "content/browser/web_contents/web_contents_view.h"
-#include "api/qtwebenginecoreglobal_p.h"
+#include <QtWebEngineCore/private/qtwebenginecoreglobal_p.h>
+
+QT_FORWARD_DECLARE_CLASS(QWebEngineContextMenuRequest)
+
+namespace extensions {
+class MimeHandlerViewGuestDelegateQt;
+}
namespace content {
class WebContents;
@@ -59,11 +29,7 @@ class WebContentsViewQt
public:
static inline WebContentsViewQt *from(WebContentsView *view) { return static_cast<WebContentsViewQt*>(view); }
- WebContentsViewQt(content::WebContents* webContents)
- : m_webContents(webContents)
- , m_client(nullptr)
- , m_factoryClient(nullptr)
- { }
+ WebContentsViewQt(content::WebContents* webContents);
void setFactoryClient(WebContentsAdapterClient* client);
void setClient(WebContentsAdapterClient* client);
@@ -76,9 +42,7 @@ public:
content::RenderWidgetHostViewBase *CreateViewForChildWidget(content::RenderWidgetHost* render_widget_host) override;
- void SetPageTitle(const base::string16& title) override { }
-
- void RenderViewCreated(content::RenderViewHost* host) override { }
+ void SetPageTitle(const std::u16string& title) override { }
void RenderViewReady() override { }
@@ -92,9 +56,7 @@ public:
gfx::NativeWindow GetTopLevelNativeWindow() const override { return nullptr; }
- void GetContainerBounds(gfx::Rect* out) const override;
-
- void SizeContents(const gfx::Size& size) override { }
+ gfx::Rect GetContainerBounds() const override;
void Focus() override;
@@ -109,29 +71,40 @@ public:
gfx::Rect GetViewBounds() const override { return gfx::Rect(); }
void FocusThroughTabTraversal(bool reverse) override;
+ void OnCapturerCountChanged() override { QT_NOT_YET_IMPLEMENTED }
+ void FullscreenStateChanged(bool) override { }
+ void UpdateWindowControlsOverlay(const gfx::Rect &) override { QT_NOT_YET_IMPLEMENTED }
-#if defined(OS_MACOSX)
+#if BUILDFLAG(IS_MAC)
bool CloseTabAfterEventTrackingIfNeeded() override { QT_NOT_YET_IMPLEMENTED return false; }
-#endif // defined(OS_MACOSX)
+#endif
// content::RenderViewHostDelegateView overrides:
- void StartDragging(const content::DropData& drop_data, blink::WebDragOperationsMask allowed_ops,
+ void StartDragging(const content::DropData& drop_data, blink::DragOperationsMask allowed_ops,
const gfx::ImageSkia& image, const gfx::Vector2d& image_offset,
- const content::DragEventSourceInfo& event_info,
- content::RenderWidgetHostImpl* source_rwh) override;
+ const gfx::Rect& drag_obj_rect,
+ const blink::mojom::DragEventSourceInfo &event_info,
+ content::RenderWidgetHostImpl *source_rwh) override;
- void UpdateDragCursor(blink::WebDragOperation dragOperation) override;
+ void UpdateDragCursor(ui::mojom::DragOperation dragOperation) override;
- void ShowContextMenu(content::RenderFrameHost *, const content::ContextMenuParams &params) override;
+ void ShowContextMenu(content::RenderFrameHost &, const content::ContextMenuParams &params) override;
void GotFocus(content::RenderWidgetHostImpl *render_widget_host) override;
void LostFocus(content::RenderWidgetHostImpl *render_widget_host) override;
void TakeFocus(bool reverse) override;
private:
+ static void update(QWebEngineContextMenuRequest *request,
+ const content::ContextMenuParams &params, bool spellcheckEnabled);
+
+private:
content::WebContents *m_webContents;
WebContentsAdapterClient *m_client;
WebContentsAdapterClient *m_factoryClient;
+ std::unique_ptr<QWebEngineContextMenuRequest> m_contextMenuRequest;
+
+ friend class extensions::MimeHandlerViewGuestDelegateQt;
};
} // namespace QtWebEngineCore
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index a28e469a3..94110d51c 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -1,109 +1,89 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "web_engine_context.h"
#include <math.h>
+#include <QtGui/private/qrhi_p.h>
#include "base/base_switches.h"
+#include "base/functional/bind.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
+#include "base/power_monitor/power_monitor.h"
+#include "base/power_monitor/power_monitor_device_source.h"
#include "base/run_loop.h"
-#include "base/task/post_task.h"
+#include "base/strings/string_split.h"
#include "base/task/sequence_manager/thread_controller_with_message_pump_impl.h"
#include "base/task/thread_pool/thread_pool_instance.h"
#include "base/threading/thread_restrictions.h"
#include "cc/base/switches.h"
+#if QT_CONFIG(webengine_webrtc) && QT_CONFIG(webengine_extensions)
+#include "chrome/browser/media/webrtc/webrtc_log_uploader.h"
+#endif
#include "chrome/common/chrome_switches.h"
+#include "content/common/process_visibility_tracker.h"
#include "content/gpu/gpu_child_thread.h"
#include "content/browser/compositor/surface_utils.h"
#include "content/browser/compositor/viz_process_transport_factory.h"
#include "components/viz/host/host_frame_sink_manager.h"
#if QT_CONFIG(webengine_printing_and_pdf)
#include "chrome/browser/printing/print_job_manager.h"
-#include "components/printing/browser/features.h"
#endif
#include "components/discardable_memory/service/discardable_shared_memory_manager.h"
+#include "components/download/public/common/download_task_runner.h"
#include "components/viz/common/features.h"
#include "components/web_cache/browser/web_cache_manager.h"
-#include "content/app/service_manager_environment.h"
+#include "content/app/mojo_ipc_support.h"
#include "content/browser/devtools/devtools_http_handler.h"
+#include "content/browser/gpu/gpu_main_thread_factory.h"
+#include "content/browser/renderer_host/render_process_host_impl.h"
#include "content/browser/scheduler/browser_task_executor.h"
#include "content/browser/startup_data_impl.h"
#include "content/browser/startup_helper.h"
+#include "content/browser/utility_process_host.h"
+#include "content/gpu/in_process_gpu_thread.h"
#include "content/public/app/content_main.h"
#include "content/public/app/content_main_runner.h"
#include "content/public/browser/browser_main_runner.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
+#if QT_CONFIG(webengine_pepper_plugins)
#include "content/public/browser/plugin_service.h"
+#endif
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/common/content_features.h"
#include "content/public/common/content_paths.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/main_function_params.h"
-#include "content/public/common/network_service_util.h"
+#include "content/renderer/in_process_renderer_thread.h"
+#include "content/utility/in_process_utility_thread.h"
#include "gpu/command_buffer/service/gpu_switches.h"
-#include "gpu/command_buffer/service/sync_point_manager.h"
+#include "gpu/config/gpu_finch_features.h"
#include "media/audio/audio_manager.h"
#include "media/base/media_switches.h"
#include "mojo/core/embedder/embedder.h"
#include "net/base/port_util.h"
-#include "ppapi/buildflags/buildflags.h"
+#include "sandbox/policy/switches.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/cpp/network_switches.h"
#include "services/network/public/mojom/network_context.mojom.h"
-#include "services/service_manager/sandbox/switches.h"
#include "services/tracing/public/cpp/trace_startup.h"
#include "services/tracing/public/cpp/tracing_features.h"
#include "third_party/blink/public/common/features.h"
+#include "ui/base/ui_base_features.h"
#include "ui/events/event_switches.h"
#include "ui/native_theme/native_theme_features.h"
+#include "ui/gl/gl_utils.h"
#include "ui/gl/gl_switches.h"
-#if defined(OS_WIN)
+#if defined(Q_OS_WIN)
#include "sandbox/win/src/sandbox_types.h"
#include "content/public/app/sandbox_helper_win.h"
-#endif // OS_WIN
+#endif // Q_OS_WIN
#if defined(Q_OS_MACOS)
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#endif
#if QT_CONFIG(accessibility)
@@ -126,17 +106,18 @@
#include <QMutex>
#include <QOffscreenSurface>
#if QT_CONFIG(opengl)
-# include <QOpenGLContext>
+#include <QOpenGLContext>
+#include <qopenglcontext_platform.h>
#endif
#include <QQuickWindow>
+#include <QRegularExpression>
#include <QStringList>
#include <QSurfaceFormat>
-#include <QVector>
#include <QNetworkProxy>
#include <QtGui/qpa/qplatformintegration.h>
#include <QtGui/private/qguiapplication_p.h>
-
-using namespace QtWebEngineCore;
+#include <QtQuick/private/qsgrhisupport_p.h>
+#include <QLoggingCategory>
#if QT_CONFIG(opengl)
QT_BEGIN_NAMESPACE
@@ -144,25 +125,24 @@ Q_GUI_EXPORT QOpenGLContext *qt_gl_global_share_context();
QT_END_NAMESPACE
#endif
-namespace {
+#define STRINGIFY_LITERAL(x) #x
+#define STRINGIFY_EXPANDED(x) STRINGIFY_LITERAL(x)
-#if QT_CONFIG(opengl)
-bool usingANGLE()
-{
-#if defined(Q_OS_WIN)
- if (qt_gl_global_share_context())
- return qt_gl_global_share_context()->isOpenGLES();
- return QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGLES;
-#else
- return false;
-#endif
-}
+namespace QtWebEngineCore {
+
+Q_LOGGING_CATEGORY(webEngineContextLog, "qt.webenginecontext")
-bool usingDefaultSGBackend()
+static bool usingSupportedSGBackend()
{
+ if (QQuickWindow::graphicsApi() != QSGRendererInterface::OpenGL
+ && QQuickWindow::graphicsApi() != QSGRendererInterface::Vulkan
+ && QQuickWindow::graphicsApi() != QSGRendererInterface::Metal
+ && QQuickWindow::graphicsApi() != QSGRendererInterface::Direct3D11)
+ return false;
+
const QStringList args = QGuiApplication::arguments();
- //folow logic from contextFactory in src/quick/scenegraph/qsgcontextplugin.cpp
+ // follow the logic from contextFactory in src/quick/scenegraph/qsgcontextplugin.cpp
QString device = QQuickWindow::sceneGraphBackend();
for (int index = 0; index < args.count(); ++index) {
@@ -173,92 +153,292 @@ bool usingDefaultSGBackend()
}
if (device.isEmpty())
- device = QString::fromLocal8Bit(qgetenv("QT_QUICK_BACKEND"));
+ device = qEnvironmentVariable("QT_QUICK_BACKEND");
if (device.isEmpty())
- device = QString::fromLocal8Bit(qgetenv("QMLSCENE_DEVICE"));
+ device = qEnvironmentVariable("QMLSCENE_DEVICE");
- return device.isEmpty();
+ return device.isEmpty() || device == QLatin1String("rhi");
}
-#endif // QT_CONFIG(opengl)
-#if QT_CONFIG(webengine_pepper_plugins)
-void dummyGetPluginCallback(const std::vector<content::WebPluginInfo>&)
+
+#if QT_CONFIG(opengl)
+bool usingSoftwareDynamicGL()
{
-}
+ const char openGlVar[] = "QT_OPENGL";
+ if (QCoreApplication::testAttribute(Qt::AA_UseSoftwareOpenGL))
+ return true;
+
+ if (qEnvironmentVariableIsSet(openGlVar)) {
+ const QByteArray requested = qgetenv(openGlVar);
+ if (requested == "software")
+ return true;
+ }
+#if defined(Q_OS_WIN)
+ HMODULE handle = QNativeInterface::QWGLContext::openGLModuleHandle();
+ wchar_t path[MAX_PATH];
+ DWORD size = GetModuleFileName(handle, path, MAX_PATH);
+ QFileInfo openGLModule(QString::fromWCharArray(path, size));
+ return openGLModule.fileName().contains(QLatin1String("opengl32sw"),Qt::CaseInsensitive);
+#else
+ return false;
#endif
+}
-} // namespace
+static bool openGLPlatformSupport()
+{
+ return QGuiApplicationPrivate::platformIntegration()->hasCapability(
+ QPlatformIntegration::OpenGL);
+}
-namespace QtWebEngineCore {
+static std::string getGLType(bool enableGLSoftwareRendering, bool disableGpu)
+{
+ const bool tryGL =
+ usingSupportedSGBackend() && !usingSoftwareDynamicGL() && openGLPlatformSupport();
+ if (disableGpu || (!tryGL && !enableGLSoftwareRendering))
+ return gl::kGLImplementationDisabledName;
+#if defined(Q_OS_MACOS)
+ return gl::kGLImplementationANGLEName;
+#else
#if defined(Q_OS_WIN)
-sandbox::SandboxInterfaceInfo *staticSandboxInterfaceInfo(sandbox::SandboxInterfaceInfo *info)
+ if (QQuickWindow::graphicsApi() == QSGRendererInterface::Direct3D11
+ || QQuickWindow::graphicsApi() == QSGRendererInterface::Vulkan) {
+ return gl::kGLImplementationANGLEName;
+ }
+#endif
+
+ if (!qt_gl_global_share_context() || !qt_gl_global_share_context()->isValid()) {
+ qWarning("WebEngineContext is used before QtWebEngineQuick::initialize() or OpenGL context "
+ "creation failed.");
+ return gl::kGLImplementationDisabledName;
+ }
+
+ const QSurfaceFormat sharedFormat = qt_gl_global_share_context()->format();
+
+ switch (sharedFormat.renderableType()) {
+ case QSurfaceFormat::OpenGL:
+ if (sharedFormat.profile() == QSurfaceFormat::CoreProfile) {
+ qWarning("An OpenGL Core Profile was requested, but it is not supported "
+ "on the current platform. Falling back to a non-Core profile. "
+ "Note that this might cause rendering issues.");
+ }
+ return gl::kGLImplementationDesktopName;
+ case QSurfaceFormat::OpenGLES:
+ return gl::kGLImplementationEGLName;
+ case QSurfaceFormat::OpenVG:
+ case QSurfaceFormat::DefaultRenderableType:
+ default:
+ // Shared contex created but no rederable type set.
+ qWarning("Unsupported rendering surface format. Please open bug report at "
+ "https://bugreports.qt.io");
+ }
+
+ return gl::kGLImplementationDisabledName;
+#endif // defined(Q_OS_MACOS)
+}
+#else
+static std::string getGLType(bool /*enableGLSoftwareRendering*/, bool disableGpu)
{
- static sandbox::SandboxInterfaceInfo *g_info = nullptr;
- if (info) {
- Q_ASSERT(g_info == nullptr);
- g_info = info;
+ if (disableGpu)
+ return gl::kGLImplementationDisabledName;
+#if defined(Q_OS_MACOS)
+ return gl::kGLImplementationANGLEName;
+#elif defined(Q_OS_WIN)
+ if (QQuickWindow::graphicsApi() == QSGRendererInterface::Direct3D11
+ || QQuickWindow::graphicsApi() == QSGRendererInterface::Vulkan) {
+ return gl::kGLImplementationANGLEName;
}
- return g_info;
+#endif
+ return gl::kGLImplementationDisabledName;
}
+#endif // QT_CONFIG(opengl)
+
+static std::string getVulkanType(base::CommandLine *cmd)
+{
+#if QT_CONFIG(webengine_vulkan)
+ if (cmd->HasSwitch(switches::kUseVulkan))
+ return cmd->GetSwitchValueASCII(switches::kUseVulkan);
#endif
-extern std::unique_ptr<base::MessagePump> messagePumpFactory();
+ return "disabled";
+}
-bool usingSoftwareDynamicGL()
+static std::string getAngleType(const std::string &glType, base::CommandLine *cmd)
{
- if (QCoreApplication::testAttribute(Qt::AA_UseSoftwareOpenGL))
- return true;
-#if defined(Q_OS_WIN) && QT_CONFIG(opengl)
- HMODULE handle = static_cast<HMODULE>(QOpenGLContext::openGLModuleHandle());
- wchar_t path[MAX_PATH];
- DWORD size = GetModuleFileName(handle, path, MAX_PATH);
- QFileInfo openGLModule(QString::fromWCharArray(path, size));
- return openGLModule.fileName() == QLatin1String("opengl32sw.dll");
+ if (glType == gl::kGLImplementationANGLEName) {
+ if (cmd->HasSwitch(switches::kUseANGLE))
+ return cmd->GetSwitchValueASCII(switches::kUseANGLE);
+
+#if defined(Q_OS_WIN)
+ return gl::kANGLEImplementationD3D11Name;
+#elif defined(Q_OS_MACOS)
+ return gl::kANGLEImplementationMetalName;
#else
- return false;
+ return gl::kANGLEImplementationDefaultName;
+#endif
+ }
+
+ return "disabled";
+}
+
+static quint64 getGPUVendorId()
+{
+#if QT_CONFIG(webengine_vulkan)
+ QVulkanInstance vulkanInstance;
+ vulkanInstance.setApiVersion(QVersionNumber(1, 1));
+ if (vulkanInstance.create()) {
+ QRhiVulkanInitParams params;
+ params.inst = &vulkanInstance;
+ QScopedPointer<QRhi> rhi(QRhi::create(QRhi::Vulkan, &params, QRhi::Flags(), nullptr));
+ return rhi->driverInfo().vendorId;
+ }
#endif
+
+ return 0;
}
-void setupProxyPac(base::CommandLine *commandLine){
+#if defined(Q_OS_WIN)
+static QString getAdapterLuid() {
+ static const bool preferSoftwareDevice = qEnvironmentVariableIntValue("QSG_RHI_PREFER_SOFTWARE_RENDERER");
+ QRhiD3D11InitParams rhiParams;
+ QRhi::Flags flags;
+ if (preferSoftwareDevice) {
+ flags |= QRhi::PreferSoftwareRenderer;
+ }
+ QScopedPointer<QRhi> rhi(QRhi::create(QRhi::D3D11,&rhiParams,flags,nullptr));
+ // mimic what QSGRhiSupport and QBackingStoreRhi does
+ if (!rhi && !preferSoftwareDevice) {
+ flags |= QRhi::PreferSoftwareRenderer;
+ rhi.reset(QRhi::create(QRhi::D3D11, &rhiParams, flags));
+ }
+ if (rhi) {
+ const QRhiD3D11NativeHandles *handles =
+ static_cast<const QRhiD3D11NativeHandles *>(rhi->nativeHandles());
+ Q_ASSERT(handles);
+ return QString("%1,%2").arg(handles->adapterLuidHigh).arg(handles->adapterLuidLow);
+ } else {
+ return QString();
+ }
+}
+#endif
+
+#if QT_CONFIG(webengine_pepper_plugins)
+void dummyGetPluginCallback(const std::vector<content::WebPluginInfo>&)
+{
+}
+#endif
+
+static void logContext(const std::string &glType, base::CommandLine *cmd)
+{
+ if (Q_UNLIKELY(webEngineContextLog().isDebugEnabled())) {
+ QStringList log;
+ log << "\n";
+
+ log << "Chromium GL Backend:" << glType.c_str() << "\n";
+ log << "Chromium ANGLE Backend:" << getAngleType(glType, cmd).c_str() << "\n";
+ log << "Chromium Vulkan Backend:" << getVulkanType(cmd).c_str() << "\n";
+ log << "\n";
+
+ log << "QSG RHI Backend:" << QSGRhiSupport::instance()->rhiBackendName() << "\n";
+ log << "QSG RHI Backend Supported:" << (usingSupportedSGBackend() ? "yes" : "no") << "\n";
+ log << "GPU Vendor:";
+ if (quint64 vendorId = getGPUVendorId()) {
+ switch (vendorId) {
+ case 0x1002:
+ log << "AMD";
+ break;
+ case 0x10DE:
+ log << "NVIDIA";
+ break;
+ case 0x8086:
+ log << "Intel";
+ break;
+ case 0x1010:
+ log << "ImgTec";
+ break;
+ case 0x13B5:
+ log << "ARM";
+ break;
+ case 0x5143:
+ log << "Qualcomm";
+ break;
+ default:
+ break;
+ }
+ log << QString("(0x%1)\n").arg(vendorId, 0, 16);
+ } else {
+ log << "Unable to detect\n";
+ }
+ log << "\n";
+
+#if QT_CONFIG(opengl)
+#if defined(USE_OZONE)
+ log << "Using GLX:" << (GLContextHelper::getGlxPlatformInterface() ? "yes" : "no") << "\n";
+ log << "Using EGL:" << (GLContextHelper::getEglPlatformInterface() ? "yes" : "no") << "\n";
+#endif
+ log << "Using Shared GL:" << (qt_gl_global_share_context() ? "yes" : "no") << "\n";
+ if (qt_gl_global_share_context()) {
+ log << "Using Software Dynamic GL:" << (usingSoftwareDynamicGL() ? "yes" : "no")
+ << "\n";
+
+ const QSurfaceFormat sharedFormat = qt_gl_global_share_context()
+ ? qt_gl_global_share_context()->format()
+ : QSurfaceFormat::defaultFormat();
+ const auto profile =
+ QMetaEnum::fromType<QSurfaceFormat::OpenGLContextProfile>().valueToKey(
+ sharedFormat.profile());
+ const auto type = QMetaEnum::fromType<QSurfaceFormat::RenderableType>().valueToKey(
+ sharedFormat.renderableType());
+ log << "Surface Type:" << type << "\n";
+ log << "Surface Profile:" << profile << "\n";
+ log << "Surface Version:"
+ << QString("%1.%2")
+ .arg(sharedFormat.majorVersion())
+ .arg(sharedFormat.minorVersion())
+ << "\n";
+ }
+ log << "\n";
+#endif // QT_CONFIG(opengl)
+
+ log << "Init Parameters:\n";
+ const base::CommandLine::SwitchMap switchMap = cmd->GetSwitches();
+ for (const auto &pair : switchMap)
+ log << " * " << toQt(pair.first) << toQt(pair.second) << "\n";
+
+ qCDebug(webEngineContextLog) << qPrintable(log.join(" "));
+ }
+}
+
+extern std::unique_ptr<base::MessagePump> messagePumpFactory();
+
+static void setupProxyPac(base::CommandLine *commandLine)
+{
if (commandLine->HasSwitch(switches::kProxyPacUrl)) {
QUrl pac_url(toQt(commandLine->GetSwitchValueASCII(switches::kProxyPacUrl)));
if (pac_url.isValid() && (pac_url.isLocalFile() ||
- !pac_url.scheme().compare(QLatin1String("qrc"), Qt::CaseInsensitive))) {
+ !pac_url.scheme().compare(QLatin1String("qrc"), Qt::CaseInsensitive))) {
QFile file;
if (pac_url.isLocalFile())
- file.setFileName(pac_url.toLocalFile());
+ file.setFileName(pac_url.toLocalFile());
else
- file.setFileName(pac_url.path().prepend(QChar(':')));
+ file.setFileName(pac_url.path().prepend(QChar(':')));
if (file.exists() && file.open(QIODevice::ReadOnly | QIODevice::Text)) {
- QByteArray ba = file.readAll();
- commandLine->RemoveSwitch(switches::kProxyPacUrl);
- commandLine->AppendSwitchASCII(switches::kProxyPacUrl,
- ba.toBase64().prepend("data:application/x-javascript-config;base64,").toStdString());
+ QByteArray ba = file.readAll();
+ commandLine->RemoveSwitch(switches::kProxyPacUrl);
+ commandLine->AppendSwitchASCII(switches::kProxyPacUrl,
+ ba.toBase64().prepend("data:application/x-javascript-config;base64,").toStdString());
}
}
}
}
-static bool waitForViz = false;
-static void completeVizCleanup()
-{
- waitForViz = false;
-}
-
static void cleanupVizProcess()
{
auto gpuChildThread = content::GpuChildThread::instance();
if (!gpuChildThread)
return;
- auto vizMain = gpuChildThread->viz_main();
- auto vizCompositorThreadRunner = vizMain->viz_compositor_thread_runner();
- if (!vizCompositorThreadRunner)
- return;
- waitForViz = true;
content::GetHostFrameSinkManager()->SetConnectionLostCallback(base::DoNothing());
auto factory = static_cast<content::VizProcessTransportFactory*>(content::ImageTransportFactory::GetInstance());
factory->PrepareForShutDown();
- vizCompositorThreadRunner->CleanupForShutdown(base::BindOnce(&completeVizCleanup));
}
static QStringList parseEnvCommandLine(const QString &cmdLine)
@@ -309,7 +489,7 @@ static QStringList parseEnvCommandLine(const QString &cmdLine)
scoped_refptr<QtWebEngineCore::WebEngineContext> WebEngineContext::m_handle;
bool WebEngineContext::m_destroyed = false;
-
+bool WebEngineContext::m_closingDown = false;
void WebEngineContext::destroyProfileAdapter()
{
if (content::RenderProcessHost::run_renderer_in_process()) {
@@ -324,7 +504,7 @@ void WebEngineContext::addProfileAdapter(ProfileAdapter *profileAdapter)
{
Q_ASSERT(!m_profileAdapters.contains(profileAdapter));
const QString path = profileAdapter->dataPath();
- if (!path.isEmpty()) {
+ if (!profileAdapter->isOffTheRecord() && !profileAdapter->storageName().isEmpty()) {
for (auto profileAdapter : m_profileAdapters) {
if (profileAdapter->dataPath() == path) {
// QTBUG-66068
@@ -348,28 +528,31 @@ void WebEngineContext::removeProfileAdapter(ProfileAdapter *profileAdapter)
m_profileAdapters.removeAll(profileAdapter);
}
+void WebEngineContext::flushMessages()
+{
+ if (!m_destroyed) {
+ base::MessagePump::Delegate *delegate = static_cast<
+ base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl *>(
+ WebEngineContext::current()->m_runLoop->delegate_);
+ while (delegate->DoWork().is_immediate()) { }
+ }
+}
void WebEngineContext::destroy()
{
if (m_devtoolsServer)
m_devtoolsServer->stop();
+#if QT_CONFIG(webengine_webrtc) && QT_CONFIG(webengine_extensions)
+ if (m_webrtcLogUploader)
+ m_webrtcLogUploader->Shutdown();
+#endif
- base::MessagePump::Delegate *delegate =
- static_cast<base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl *>(
- m_runLoop->delegate_);
// Normally the GPU thread is shut down when the GpuProcessHost is destroyed
// on IO thread (triggered by ~BrowserMainRunner). But by that time the UI
// task runner is not working anymore so we need to do this earlier.
- if (features::IsVizDisplayCompositorEnabled()) {
- cleanupVizProcess();
- while (waitForViz) {
- while (delegate->DoWork()){}
- QThread::msleep(50);
- }
- }
- destroyGpuProcess();
+ cleanupVizProcess();
// Flush the UI message loop before quitting.
- while (delegate->DoWork()) { }
+ flushMessages();
#if QT_CONFIG(webengine_printing_and_pdf)
// Kill print job manager early as it has a content::NotificationRegistrar
@@ -391,7 +574,7 @@ void WebEngineContext::destroy()
// Handle any events posted by browser-context shutdown.
// This should deliver all nessesery calls of DeleteSoon from PostTask
- while (delegate->DoWork()) { }
+ flushMessages();
m_devtoolsServer.reset();
m_runLoop->AfterRun();
@@ -402,8 +585,7 @@ void WebEngineContext::destroy()
GLContextHelper::destroy();
// These would normally be in the content-runner, but we allocated them separately:
- m_startupData.reset();
- m_serviceManagerEnvironment.reset();
+ m_mojoIpcSupport.reset();
m_discardableSharedMemoryManager.reset();
// Destroying content-runner will force Chromium at_exit calls to run, and
@@ -412,6 +594,10 @@ void WebEngineContext::destroy()
// Drop the false reference.
m_handle->Release();
+
+#if QT_CONFIG(webengine_webrtc) && QT_CONFIG(webengine_extensions)
+ m_webrtcLogUploader.reset();
+#endif
}
WebEngineContext::~WebEngineContext()
@@ -421,7 +607,6 @@ WebEngineContext::~WebEngineContext()
Q_ASSERT(!m_devtoolsServer);
Q_ASSERT(!m_browserRunner);
Q_ASSERT(m_profileAdapters.isEmpty());
- delete s_syncPointManager.fetchAndStoreRelaxed(nullptr);
}
WebEngineContext *WebEngineContext::current()
@@ -442,7 +627,7 @@ ProfileAdapter *WebEngineContext::createDefaultProfileAdapter()
{
Q_ASSERT(!m_destroyed);
if (!m_defaultProfileAdapter) {
- ProfileAdapter *profile = new ProfileAdapter(QStringLiteral("Default"));
+ ProfileAdapter *profile = new ProfileAdapter();
// profile when added to m_profileAdapters might be set default
// profile in case of single-process
if (!m_defaultProfileAdapter)
@@ -466,6 +651,7 @@ void WebEngineContext::destroyContextPostRoutine()
// Destroy WebEngineContext before its static pointer is zeroed and destructor called.
// Before destroying MessageLoop via destroying BrowserMainRunner destructor
// WebEngineContext's pointer is used.
+ m_closingDown = true;
m_handle->destroy();
#if !defined(NDEBUG)
if (!m_handle->HasOneRef())
@@ -494,25 +680,48 @@ ProxyAuthentication WebEngineContext::qProxyNetworkAuthentication(QString host,
const static char kChromiumFlagsEnv[] = "QTWEBENGINE_CHROMIUM_FLAGS";
const static char kDisableSandboxEnv[] = "QTWEBENGINE_DISABLE_SANDBOX";
-const static char kDisableInProcGpuThread[] = "QTWEBENGINE_DISABLE_GPU_THREAD";
-static void appendToFeatureList(std::string &featureList, const char *feature)
+static void initializeFeatureList(base::CommandLine *commandLine, std::vector<std::string> enableFeatures, std::vector<std::string> disableFeatures)
{
- if (featureList.empty())
- featureList = feature;
- else
- featureList = featureList + "," + feature;
-}
+ std::string enableFeaturesString = base::JoinString(enableFeatures, ",");
+ if (commandLine->HasSwitch(switches::kEnableFeatures)) {
+ std::string commandLineEnableFeatures = commandLine->GetSwitchValueASCII(switches::kEnableFeatures);
-static void appendToFeatureSwitch(base::CommandLine *commandLine, const char *featureSwitch, std::string feature)
-{
- if (!commandLine->HasSwitch(featureSwitch)) {
- commandLine->AppendSwitchASCII(featureSwitch, feature);
- } else {
- std::string featureList = commandLine->GetSwitchValueASCII(featureSwitch);
- featureList = featureList + "," + feature;
- commandLine->AppendSwitchASCII(featureSwitch, featureList);
+ for (const std::string &enableFeature : base::SplitString(commandLineEnableFeatures, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY)) {
+ auto it = std::find(disableFeatures.begin(), disableFeatures.end(), enableFeature);
+ if (it == disableFeatures.end())
+ continue;
+
+ qWarning("An unsupported feature has been enabled from command line: %s\n"
+ "The feature is enabled but there is no guarantee that it will work or not break QtWebEngine.", enableFeature.c_str());
+
+ // If a feature is disabled and enabled at the same time, then it will be disabled.
+ // Remove feature from the disable list to make it possible to override from command line.
+ disableFeatures.erase(it);
+ }
+
+ enableFeaturesString = enableFeaturesString + "," + commandLineEnableFeatures;
+ }
+
+ std::string disableFeaturesString = base::JoinString(disableFeatures, ",");
+ if (commandLine->HasSwitch(switches::kDisableFeatures)) {
+ std::string commandLineDisableFeatures = commandLine->GetSwitchValueASCII(switches::kDisableFeatures);
+
+ for (const std::string &disableFeature : base::SplitString(commandLineDisableFeatures, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY)) {
+ auto it = std::find(enableFeatures.begin(), enableFeatures.end(), disableFeature);
+ if (it == enableFeatures.end())
+ continue;
+
+ qWarning("An essential feature has been disabled from command line: %s\n"
+ "The feature is disabled but there is no guarantee that it will not break QtWebEngine.", disableFeature.c_str());
+ }
+
+ disableFeaturesString = disableFeaturesString + "," + commandLineDisableFeatures;
}
+
+ commandLine->AppendSwitchASCII(switches::kEnableFeatures, enableFeaturesString);
+ commandLine->AppendSwitchASCII(switches::kDisableFeatures, disableFeaturesString);
+ base::FeatureList::InitializeInstance(enableFeaturesString, disableFeaturesString);
}
WebEngineContext::WebEngineContext()
@@ -522,11 +731,11 @@ WebEngineContext::WebEngineContext()
#if defined(Q_OS_MACOS)
// The bundled handling is currently both completely broken in Chromium,
// and unnecessary for us.
- base::mac::SetOverrideAmIBundled(false);
+ base::apple::SetOverrideAmIBundled(false);
#endif
base::ThreadPoolInstance::Create("Browser");
- m_contentRunner.reset(content::ContentMainRunner::Create());
+ m_contentRunner = content::ContentMainRunner::Create();
m_browserRunner = content::BrowserMainRunner::Create();
#ifdef Q_OS_LINUX
@@ -539,7 +748,6 @@ WebEngineContext::WebEngineContext()
// User might have registered "qrc" already with different options.
QWebEngineUrlScheme qrcScheme(QByteArrayLiteral("qrc"));
qrcScheme.setFlags(QWebEngineUrlScheme::SecureScheme
- | QWebEngineUrlScheme::LocalAccessAllowed
| QWebEngineUrlScheme::ViewSourceAllowed);
QWebEngineUrlScheme::registerScheme(qrcScheme);
}
@@ -549,266 +757,191 @@ WebEngineContext::WebEngineContext()
// Allow us to inject javascript like any webview toolkit.
content::RenderFrameHost::AllowInjectingJavaScript();
- QStringList appArgs = QCoreApplication::arguments();
-
- // If user requested GL support instead of using Skia rendering to
- // bitmaps, use software rendering via software OpenGL. This might be less
- // performant, but at least provides WebGL support.
- // TODO(miklocek), check if this still works with latest chromium
- bool enableGLSoftwareRendering = appArgs.contains(QStringLiteral("--enable-webgl-software-rendering"));
-
bool useEmbeddedSwitches = false;
-#if defined(QTWEBENGINE_EMBEDDED_SWITCHES)
- useEmbeddedSwitches = !appArgs.contains(QStringLiteral("--disable-embedded-switches"));
-#else
- useEmbeddedSwitches = appArgs.contains(QStringLiteral("--enable-embedded-switches"));
-#endif
+ bool enableGLSoftwareRendering = false;
+ base::CommandLine *parsedCommandLine =
+ initCommandLine(useEmbeddedSwitches, enableGLSoftwareRendering);
- base::CommandLine* parsedCommandLine = commandLine();
setupProxyPac(parsedCommandLine);
parsedCommandLine->AppendSwitchPath(switches::kBrowserSubprocessPath, WebEngineLibraryInfo::getPath(content::CHILD_PROCESS_EXE));
+ parsedCommandLine->AppendSwitchASCII(switches::kApplicationName, QCoreApplication::applicationName().toUtf8().toPercentEncoding().toStdString());
+
// Enable sandboxing on OS X and Linux (Desktop / Embedded) by default.
bool disable_sandbox = qEnvironmentVariableIsSet(kDisableSandboxEnv);
if (!disable_sandbox) {
#if defined(Q_OS_LINUX)
- parsedCommandLine->AppendSwitch(service_manager::switches::kDisableSetuidSandbox);
+ parsedCommandLine->AppendSwitch(sandbox::policy::switches::kDisableSetuidSandbox);
#endif
} else {
- parsedCommandLine->AppendSwitch(service_manager::switches::kNoSandbox);
+ parsedCommandLine->AppendSwitch(sandbox::policy::switches::kNoSandbox);
qInfo() << "Sandboxing disabled by user.";
}
- parsedCommandLine->AppendSwitch(switches::kEnableThreadedCompositing);
+ // Do not advertise a feature we have removed at compile time
+ parsedCommandLine->AppendSwitch(switches::kDisableSpeechAPI);
-#if defined(Q_OS_WIN)
- // This switch is used in Chromium's gl_context_wgl.cc file to determine whether to create
- // an OpenGL Core Profile context. If the switch is not set, it would always try to create a
- // Core Profile context, even if Qt uses a legacy profile, which causes
- // "Could not share GL contexts" warnings, because it's not possible to share between Core and
- // legacy profiles. See GLContextWGL::Initialize().
- // Given that Desktop GL Core profile is not currently supported on Windows anyway, pass this
- // switch to get rid of the warnings.
- //
- // The switch is also used to determine which version of OpenGL ES to use (2 or 3) when using
- // ANGLE.
- // If the switch is not set, Chromium will always try to create an ES3 context, even if Qt uses
- // an ES2 context, which causes resource sharing issues (black screen),
- // see gpu::gles2::GenerateGLContextAttribs().
- // Make sure to disable ES3 context creation when using ES2.
- const bool isGLES2Context = qt_gl_global_share_context()
- && qt_gl_global_share_context()->isOpenGLES()
- && qt_gl_global_share_context()->format().majorVersion() == 2;
- const bool isDesktopGLOrSoftware = !usingANGLE();
-
- if (isDesktopGLOrSoftware || isGLES2Context)
- parsedCommandLine->AppendSwitch(switches::kDisableES3GLContext);
-#endif
- bool threadedGpu = false;
-#if QT_CONFIG(opengl)
- threadedGpu = QOpenGLContext::supportsThreadedOpenGL();
-#if defined(Q_OS_MACOS)
- // QtBase disabled it when building on 10.14+, unfortunately we still need it
- // until we have fixed single-threaded viz-display-compositor.
- threadedGpu = true;
-#endif
-#endif
- threadedGpu = threadedGpu && !qEnvironmentVariableIsSet(kDisableInProcGpuThread);
-
- bool enableViz = !parsedCommandLine->HasSwitch("disable-viz-display-compositor");
- parsedCommandLine->RemoveSwitch("disable-viz-display-compositor");
+ std::vector<std::string> disableFeatures;
+ std::vector<std::string> enableFeatures;
- std::string disableFeatures;
- std::string enableFeatures;
- // Needed to allow navigations within pages that were set using setHtml(). One example is
- // tst_QWebEnginePage::acceptNavigationRequest.
- // This is deprecated behavior, and will be removed in a future Chromium version, as per
- // upstream Chromium commit ba52f56207a4b9d70b34880fbff2352e71a06422.
- appendToFeatureList(enableFeatures, features::kAllowContentInitiatedDataUrlNavigations.name);
+ enableFeatures.push_back(features::kNetworkServiceInProcess.name);
+ enableFeatures.push_back(features::kTracingServiceInProcess.name);
- appendToFeatureList(enableFeatures, features::kTracingServiceInProcess.name);
-
- // The video-capture service is not functioning at this moment (since 69)
- appendToFeatureList(disableFeatures, features::kMojoVideoCapture.name);
-
-#if defined(Q_OS_LINUX)
- // broken and crashy (even upstream):
- appendToFeatureList(disableFeatures, features::kFontSrcLocalMatching.name);
-#endif
-
- // We don't support the skia renderer (enabled by default on Linux since 80)
- appendToFeatureList(disableFeatures, features::kUseSkiaRenderer.name);
+ // When enabled, event.movement is calculated in blink instead of in browser.
+ disableFeatures.push_back(features::kConsolidatedMovementXY.name);
- appendToFeatureList(disableFeatures, network::features::kDnsOverHttpsUpgrade.name);
+ // Avoid crashing when websites tries using this feature (since 83)
+ disableFeatures.push_back(features::kInstalledApp.name);
- // When enabled, event.movement is calculated in blink instead of in browser.
- appendToFeatureList(disableFeatures, features::kConsolidatedMovementXY.name);
+ // Not implemented but it overrides the devtools eyedropper
+ // Should be sync with kEyeDropper base::Feature
+ parsedCommandLine->AppendSwitchASCII(switches::kDisableBlinkFeatures, "EyeDropperAPI");
+ disableFeatures.push_back(features::kEyeDropper.name);
// Explicitly tell Chromium about default-on features we do not support
- appendToFeatureList(disableFeatures, features::kBackgroundFetch.name);
- appendToFeatureList(disableFeatures, features::kSmsReceiver.name);
- appendToFeatureList(disableFeatures, features::kWebAuth.name);
- appendToFeatureList(disableFeatures, features::kWebAuthCable.name);
- appendToFeatureList(disableFeatures, features::kWebPayments.name);
- appendToFeatureList(disableFeatures, features::kWebUsb.name);
- appendToFeatureList(disableFeatures, media::kPictureInPicture.name);
+ disableFeatures.push_back(features::kBackgroundFetch.name);
+ disableFeatures.push_back(features::kWebOTP.name);
+ disableFeatures.push_back(features::kWebPayments.name);
+ disableFeatures.push_back(features::kWebUsb.name);
if (useEmbeddedSwitches) {
// embedded switches are based on the switches for Android, see content/browser/android/content_startup_flags.cc
- appendToFeatureList(enableFeatures, features::kOverlayScrollbar.name);
+ enableFeatures.push_back(features::kOverlayScrollbar.name);
parsedCommandLine->AppendSwitch(switches::kEnableViewport);
- parsedCommandLine->AppendSwitch(switches::kMainFrameResizesAreOrientationChanges);
parsedCommandLine->AppendSwitch(cc::switches::kDisableCompositedAntialiasing);
}
- if (!enableViz) {
- // These are currently only default on OS X, and we don't support them:
- parsedCommandLine->AppendSwitch(switches::kDisableZeroCopy);
- parsedCommandLine->AppendSwitch(switches::kDisableGpuMemoryBufferCompositorResources);
-
- // Enabled on OS X and Linux but currently not working. It worked in 5.7 on OS X.
- parsedCommandLine->AppendSwitch(switches::kDisableGpuMemoryBufferVideoFrames);
-
-#if defined(Q_OS_MACOS)
- // Accelerated decoding currently does not work on macOS due to issues with OpenGL Rectangle
- // texture support. See QTBUG-60002.
- parsedCommandLine->AppendSwitch(switches::kDisableAcceleratedVideoDecode);
- // Same problem with Pepper using OpenGL images.
- parsedCommandLine->AppendSwitch(switches::kDisablePepper3DImageChromium);
-#endif
+#if QT_CONFIG(webengine_vulkan) && defined(USE_OZONE)
+ if (QQuickWindow::graphicsApi() == QSGRendererInterface::Vulkan) {
+ enableFeatures.push_back(features::kVulkan.name);
+ parsedCommandLine->AppendSwitchASCII(switches::kUseVulkan,
+ switches::kVulkanImplementationNameNative);
+ const char deviceExtensionsVar[] = "QT_VULKAN_DEVICE_EXTENSIONS";
+ QByteArrayList requiredDeviceExtensions = { "VK_KHR_external_memory_fd",
+ "VK_EXT_external_memory_dma_buf",
+ "VK_EXT_image_drm_format_modifier" };
+ if (qEnvironmentVariableIsSet(deviceExtensionsVar)) {
+ QByteArrayList envExtList = qgetenv(deviceExtensionsVar).split(';');
+ int found = 0;
+ for (const QByteArray &ext : requiredDeviceExtensions) {
+ if (envExtList.contains(ext))
+ found++;
+ }
+ if (found != requiredDeviceExtensions.size()) {
+ qWarning().nospace()
+ << "Vulkan rendering may fail because " << deviceExtensionsVar
+ << " environment variable is already set but it doesn't contain"
+ << " some of the required Vulkan device extensions:\n"
+ << qPrintable(requiredDeviceExtensions.join('\n'));
+ }
+ } else {
+ qputenv(deviceExtensionsVar, requiredDeviceExtensions.join(';'));
+ }
+ }
+#endif // QT_CONFIG(webengine_vulkan) && defined(USE_OZONE)
- // Viz Display Compositor is enabled by default since 73. Doesn't work for us (also implies SurfaceSynchronization)
- appendToFeatureList(disableFeatures, features::kVizDisplayCompositor.name);
- // VideoSurfaceLayer is enabled by default since 75. We don't support it.
- appendToFeatureList(enableFeatures, media::kDisableSurfaceLayerForVideo.name);
+#if defined(Q_OS_WIN)
+ if (QQuickWindow::graphicsApi() == QSGRendererInterface::Direct3D11
+ || QQuickWindow::graphicsApi() == QSGRendererInterface::Vulkan) {
+ const QString luid = getAdapterLuid();
+ if (!luid.isEmpty())
+ parsedCommandLine->AppendSwitchASCII(switches::kUseAdapterLuid, luid.toStdString());
}
+#endif
- appendToFeatureSwitch(parsedCommandLine, switches::kDisableFeatures, disableFeatures);
- appendToFeatureSwitch(parsedCommandLine, switches::kEnableFeatures, enableFeatures);
- base::FeatureList::InitializeInstance(
- parsedCommandLine->GetSwitchValueASCII(switches::kEnableFeatures),
- parsedCommandLine->GetSwitchValueASCII(switches::kDisableFeatures));
+ initializeFeatureList(parsedCommandLine, enableFeatures, disableFeatures);
GLContextHelper::initialize();
- const char *glType = 0;
-#if QT_CONFIG(opengl)
-
- const bool tryGL = (usingDefaultSGBackend() && !usingSoftwareDynamicGL() &&
- QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::OpenGL))
- || enableGLSoftwareRendering;
- if (tryGL) {
- if (qt_gl_global_share_context() && qt_gl_global_share_context()->isValid()) {
- // If the native handle is QEGLNativeContext try to use GL ES/2.
- // If there is no native handle, assume we are using wayland and try GL ES/2.
- // If we are using ANGLE on Windows, use OpenGL ES (2 or 3).
- if (qt_gl_global_share_context()->nativeHandle().isNull()
- || !strcmp(qt_gl_global_share_context()->nativeHandle().typeName(),
- "QEGLNativeContext")
- || usingANGLE())
- {
- if (qt_gl_global_share_context()->isOpenGLES()) {
- glType = usingANGLE() ? gl::kGLImplementationANGLEName : gl::kGLImplementationEGLName;
- } else {
- QOpenGLContext context;
- QSurfaceFormat format;
-
- format.setRenderableType(QSurfaceFormat::OpenGL);
- format.setVersion(2, 0);
-
- context.setFormat(format);
- context.setShareContext(qt_gl_global_share_context());
- if (context.create()) {
- QOffscreenSurface surface;
-
- surface.setFormat(format);
- surface.create();
-
- if (context.makeCurrent(&surface)) {
- if (context.hasExtension("GL_ARB_ES2_compatibility"))
- glType = gl::kGLImplementationEGLName;
-
- context.doneCurrent();
- }
-
- surface.destroy();
- }
- }
- } else {
- if (!qt_gl_global_share_context()->isOpenGLES()) {
- // Default to Desktop non-Core profile OpenGL.
- glType = gl::kGLImplementationDesktopName;
-
- // Check if Core profile was requested and is supported.
- QSurfaceFormat globalSharedFormat = qt_gl_global_share_context()->format();
- if (globalSharedFormat.profile() == QSurfaceFormat::CoreProfile) {
-#ifdef Q_OS_MACOS
- glType = gl::kGLImplementationCoreProfileName;
-#else
- qWarning("An OpenGL Core Profile was requested, but it is not supported "
- "on the current platform. Falling back to a non-Core profile. "
- "Note that this might cause rendering issues.");
-#endif
- }
- }
- }
- if (qt_gl_global_share_context()->format().profile() == QSurfaceFormat::CompatibilityProfile)
- parsedCommandLine->AppendSwitch(switches::kCreateDefaultGLContext);
- } else {
- qWarning("WebEngineContext used before QtWebEngine::initialize() or OpenGL context creation failed.");
- }
+ // If user requested GL support instead of using Skia rendering to
+ // bitmaps, use software rendering via software OpenGL. This might be less
+ // performant, but at least provides WebGL support.
+ // TODO(miklocek), check if this still works with latest chromium
+ const bool disableGpu = parsedCommandLine->HasSwitch(switches::kDisableGpu);
+ std::string glType;
+ if (parsedCommandLine->HasSwitch(switches::kUseGL))
+ glType = parsedCommandLine->GetSwitchValueASCII(switches::kUseGL);
+ else {
+ glType = getGLType(enableGLSoftwareRendering, disableGpu);
+ parsedCommandLine->AppendSwitchASCII(switches::kUseGL, glType);
}
-#endif // QT_CONFIG(opengl)
- if (glType) {
- parsedCommandLine->AppendSwitchASCII(switches::kUseGL, glType);
- parsedCommandLine->AppendSwitch(switches::kInProcessGPU);
+ parsedCommandLine->AppendSwitch(switches::kInProcessGPU);
+
+ if (glType != gl::kGLImplementationDisabledName) {
if (enableGLSoftwareRendering) {
parsedCommandLine->AppendSwitch(switches::kDisableGpuRasterization);
- parsedCommandLine->AppendSwitch(switches::kIgnoreGpuBlacklist);
+ parsedCommandLine->AppendSwitch(switches::kIgnoreGpuBlocklist);
}
- } else {
+#if QT_CONFIG(opengl)
+ if (glType != gl::kGLImplementationANGLEName) {
+ QOpenGLContext *shareContext = QOpenGLContext::globalShareContext();
+ Q_ASSERT(shareContext);
+ const QSurfaceFormat sharedFormat = shareContext->format();
+ if (sharedFormat.profile() == QSurfaceFormat::CompatibilityProfile)
+ parsedCommandLine->AppendSwitch(switches::kCreateDefaultGLContext);
+#if defined(Q_OS_WIN)
+ // This switch is used in Chromium's gl_context_wgl.cc file to determine whether to create
+ // an OpenGL Core Profile context. If the switch is not set, it would always try to create a
+ // Core Profile context, even if Qt uses a legacy profile, which causes
+ // "Could not share GL contexts" warnings, because it's not possible to share between Core and
+ // legacy profiles. See GLContextWGL::Initialize().
+ if (sharedFormat.renderableType() == QSurfaceFormat::OpenGL
+ && sharedFormat.profile() != QSurfaceFormat::CoreProfile) {
+ gl::GlWorkarounds workarounds = gl::GetGlWorkarounds();
+ workarounds.disable_es3gl_context = true;
+ gl::SetGlWorkarounds(workarounds);
+ }
+#endif
+ }
+#endif //QT_CONFIG(opengl)
+ } else if (!disableGpu) {
parsedCommandLine->AppendSwitch(switches::kDisableGpu);
}
- registerMainThreadFactories(threadedGpu);
+ logContext(glType, parsedCommandLine);
- SetContentClient(new ContentClientQt);
+ registerMainThreadFactories();
content::ContentMainParams contentMainParams(m_mainDelegate.get());
-#if defined(OS_WIN)
- contentMainParams.sandbox_info = staticSandboxInterfaceInfo();
- sandbox::SandboxInterfaceInfo sandbox_info = {0};
+ contentMainParams.setup_signal_handlers = false;
+#if defined(Q_OS_WIN)
+ contentMainParams.sandbox_info = QtWebEngineSandbox::staticSandboxInterfaceInfo();
+ sandbox::SandboxInterfaceInfo sandbox_info = {nullptr};
if (!contentMainParams.sandbox_info) {
content::InitializeSandboxInfo(&sandbox_info);
contentMainParams.sandbox_info = &sandbox_info;
}
#endif
- m_contentRunner->Initialize(contentMainParams);
+ m_contentRunner->Initialize(std::move(contentMainParams));
mojo::core::Configuration mojoConfiguration;
mojoConfiguration.is_broker_process = true;
mojo::core::Init(mojoConfiguration);
- // This block mirrors ContentMainRunnerImpl::RunServiceManager():
- m_mainDelegate->PreCreateMainMessageLoop();
+ // This block mirrors ContentMainRunnerImpl::RunBrowser():
+ m_mainDelegate->PreBrowserMain();
base::MessagePump::OverrideMessagePumpForUIFactory(messagePumpFactory);
content::BrowserTaskExecutor::Create();
- m_mainDelegate->PostEarlyInitialization(false);
+ m_mainDelegate->PostEarlyInitialization({});
content::StartBrowserThreadPool();
content::BrowserTaskExecutor::PostFeatureListSetup();
- tracing::InitTracingPostThreadPoolStartAndFeatureList();
+ tracing::InitTracingPostThreadPoolStartAndFeatureList(false);
+ base::PowerMonitor::Initialize(std::make_unique<base::PowerMonitorDeviceSource>());
+ content::ProcessVisibilityTracker::GetInstance();
m_discardableSharedMemoryManager = std::make_unique<discardable_memory::DiscardableSharedMemoryManager>();
- m_serviceManagerEnvironment = std::make_unique<content::ServiceManagerEnvironment>(content::BrowserTaskExecutor::CreateIOThread());
- m_startupData = m_serviceManagerEnvironment->CreateBrowserStartupData();
+
+ m_mojoIpcSupport = std::make_unique<content::MojoIpcSupport>(content::BrowserTaskExecutor::CreateIOThread());
+ download::SetIOTaskRunner(m_mojoIpcSupport->io_thread()->task_runner());
+ std::unique_ptr<content::StartupData> startupData = m_mojoIpcSupport->CreateBrowserStartupData();
// Once the MessageLoop has been created, attach a top-level RunLoop.
m_runLoop.reset(new base::RunLoop);
m_runLoop->BeforeRun();
- content::MainFunctionParams mainParams(*base::CommandLine::ForCurrentProcess());
- mainParams.startup_data = m_startupData.get();
- m_browserRunner->Initialize(mainParams);
+ content::MainFunctionParams mainParams(base::CommandLine::ForCurrentProcess());
+ mainParams.startup_data = std::move(startupData);
+ m_browserRunner->Initialize(std::move(mainParams));
m_devtoolsServer.reset(new DevToolsServerQt());
m_devtoolsServer->start();
@@ -820,14 +953,7 @@ WebEngineContext::WebEngineContext()
// Initialize WebCacheManager here to ensure its subscription to render process creation events.
web_cache::WebCacheManager::GetInstance();
- base::ThreadRestrictions::SetIOAllowed(true);
-
- if (parsedCommandLine->HasSwitch(network::switches::kExplicitlyAllowedPorts)) {
- std::string allowedPorts = parsedCommandLine->GetSwitchValueASCII(network::switches::kExplicitlyAllowedPorts);
- net::SetExplicitlyAllowedPorts(allowedPorts);
- }
-
-#if defined(OS_LINUX)
+#if defined(Q_OS_LINUX)
media::AudioManager::SetGlobalAppName(QCoreApplication::applicationName().toStdString());
#endif
@@ -838,7 +964,7 @@ WebEngineContext::WebEngineContext()
// be created from the FILE thread, and that GetPluginInfoArray is synchronous, it
// can't loads plugins synchronously from the IO thread to serve the render process' request
// and we need to make sure that it happened beforehand.
- content::PluginService::GetInstance()->GetPlugins(base::Bind(&dummyGetPluginCallback));
+ content::PluginService::GetInstance()->GetPlugins(base::BindOnce(&dummyGetPluginCallback));
#endif
#if QT_CONFIG(webengine_printing_and_pdf)
@@ -859,47 +985,116 @@ printing::PrintJobManager* WebEngineContext::getPrintJobManager()
}
#endif
-static QMutex s_spmMutex;
-QAtomicPointer<gpu::SyncPointManager> WebEngineContext::s_syncPointManager;
-
-gpu::SyncPointManager *WebEngineContext::syncPointManager()
+#if QT_CONFIG(webengine_webrtc) && QT_CONFIG(webengine_extensions)
+WebRtcLogUploader *WebEngineContext::webRtcLogUploader()
{
- if (gpu::SyncPointManager *spm = s_syncPointManager.loadAcquire())
- return spm;
- QMutexLocker lock(&s_spmMutex);
- if (!s_syncPointManager)
- s_syncPointManager.store(new gpu::SyncPointManager());
- return s_syncPointManager.load();
+ if (!m_webrtcLogUploader)
+ m_webrtcLogUploader = std::make_unique<WebRtcLogUploader>();
+ return m_webrtcLogUploader.get();
}
+#endif
-base::CommandLine* WebEngineContext::commandLine() {
- if (base::CommandLine::CreateEmpty()) {
- base::CommandLine* parsedCommandLine = base::CommandLine::ForCurrentProcess();
- QStringList appArgs = QCoreApplication::arguments();
- if (qEnvironmentVariableIsSet(kChromiumFlagsEnv)) {
- appArgs = appArgs.mid(0, 1); // Take application name and drop the rest
- appArgs.append(parseEnvCommandLine(QString::fromLocal8Bit(qgetenv(kChromiumFlagsEnv))));
+
+base::CommandLine *WebEngineContext::initCommandLine(bool &useEmbeddedSwitches,
+ bool &enableGLSoftwareRendering)
+{
+ if (!base::CommandLine::CreateEmpty())
+ qFatal("base::CommandLine has been initialized unexpectedly.");
+
+ QStringList appArgs = QCoreApplication::arguments();
+ if (appArgs.empty()) {
+ qFatal("Argument list is empty, the program name is not passed to QCoreApplication. "
+ "base::CommandLine cannot be properly initialized.");
+ }
+
+ base::CommandLine *parsedCommandLine = base::CommandLine::ForCurrentProcess();
+ int index = appArgs.indexOf(QRegularExpression(QLatin1String("--webEngineArgs"),
+ QRegularExpression::CaseInsensitiveOption));
+ if (qEnvironmentVariableIsSet(kChromiumFlagsEnv)) {
+ appArgs = appArgs.mid(0, 1); // Take application name and drop the rest
+ appArgs.append(parseEnvCommandLine(qEnvironmentVariable(kChromiumFlagsEnv)));
+ if (index > -1)
+ qWarning("Note 'webEngineArgs' are overridden by QTWEBENGINE_CHROMIUM_FLAGS");
+ } else {
+ if (index > -1) {
+ appArgs.erase(appArgs.begin() + 1, appArgs.begin() + index + 1);
+ } else {
+ appArgs = appArgs.mid(0, 1);
}
-#ifdef Q_OS_WIN
- appArgs.removeAll(QStringLiteral("--enable-webgl-software-rendering"));
+ }
+#if defined(QTWEBENGINE_EMBEDDED_SWITCHES)
+ useEmbeddedSwitches = !appArgs.contains(QStringLiteral("--disable-embedded-switches"));
+#else
+ useEmbeddedSwitches = appArgs.contains(QStringLiteral("--enable-embedded-switches"));
#endif
- appArgs.removeAll(QStringLiteral("--disable-embedded-switches"));
- appArgs.removeAll(QStringLiteral("--enable-embedded-switches"));
+ enableGLSoftwareRendering =
+ appArgs.removeAll(QStringLiteral("--enable-webgl-software-rendering"));
+ appArgs.removeAll(QStringLiteral("--disable-embedded-switches"));
+ appArgs.removeAll(QStringLiteral("--enable-embedded-switches"));
+
+ bool isRemoteDebugPort =
+ (-1
+ != appArgs.indexOf(QRegularExpression(QStringLiteral("--remote-debugging-port=.*"),
+ QRegularExpression::CaseInsensitiveOption)))
+ || !qEnvironmentVariable("QTWEBENGINE_REMOTE_DEBUGGING").isEmpty();
+ bool isRemoteAllowOrigins =
+ (-1
+ != appArgs.indexOf(QRegularExpression(QStringLiteral("--remote-allow-origins=.*"),
+ QRegularExpression::CaseInsensitiveOption)));
+
+ if (isRemoteDebugPort && !isRemoteAllowOrigins) {
+ appArgs.append(QStringLiteral("--remote-allow-origins=*"));
+ qWarning("Added {--remote-allow-origins=*} to command-line arguments "
+ "to avoid web socket connection errors during remote debugging.");
+ }
- base::CommandLine::StringVector argv;
- argv.resize(appArgs.size());
+ base::CommandLine::StringVector argv;
+ argv.resize(appArgs.size());
#if defined(Q_OS_WIN)
- for (int i = 0; i < appArgs.size(); ++i)
- argv[i] = toString16(appArgs[i]);
+ for (int i = 0; i < appArgs.size(); ++i)
+ argv[i] = appArgs[i].toStdWString();
#else
- for (int i = 0; i < appArgs.size(); ++i)
- argv[i] = appArgs[i].toStdString();
+ for (int i = 0; i < appArgs.size(); ++i)
+ argv[i] = appArgs[i].toStdString();
#endif
- parsedCommandLine->InitFromArgv(argv);
- return parsedCommandLine;
- } else {
- return base::CommandLine::ForCurrentProcess();
- }
+ parsedCommandLine->InitFromArgv(argv);
+
+ return parsedCommandLine;
+}
+
+bool WebEngineContext::closingDown()
+{
+ return m_closingDown;
+}
+
+void WebEngineContext::registerMainThreadFactories()
+{
+ content::UtilityProcessHost::RegisterUtilityMainThreadFactory(content::CreateInProcessUtilityThread);
+ content::RenderProcessHostImpl::RegisterRendererMainThreadFactory(content::CreateInProcessRendererThread);
+ content::RegisterGpuMainThreadFactory(content::CreateInProcessGpuThread);
}
} // namespace
+
+QT_BEGIN_NAMESPACE
+const char *qWebEngineVersion() noexcept
+{
+ return STRINGIFY_EXPANDED(QTWEBENGINECORE_VERSION_STR);
+}
+
+const char *qWebEngineProcessName() noexcept
+{
+ return STRINGIFY_EXPANDED(QTWEBENGINEPROCESS_NAME);
+}
+
+const char *qWebEngineChromiumVersion() noexcept
+{
+ return STRINGIFY_EXPANDED(CHROMIUM_VERSION);
+}
+
+const char *qWebEngineChromiumSecurityPatchVersion() noexcept
+{
+ return "122.0.6261.128"; // FIXME: Remember to update
+}
+
+QT_END_NAMESPACE
diff --git a/src/core/web_engine_context.h b/src/core/web_engine_context.h
index 6cbd5c8e5..50b080db1 100644
--- a/src/core/web_engine_context.h
+++ b/src/core/web_engine_context.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef WEB_ENGINE_CONTEXT_H
#define WEB_ENGINE_CONTEXT_H
@@ -47,7 +11,7 @@
#include "base/values.h"
#include <QtGui/qtgui-config.h>
-#include <QVector>
+#include <QList>
namespace base {
class RunLoop;
@@ -57,11 +21,9 @@ class CommandLine;
namespace content {
class BrowserMainRunner;
class ContentMainRunner;
-class GpuProcess;
class GpuThreadController;
class InProcessChildThreadParams;
-class ServiceManagerEnvironment;
-struct StartupData;
+class MojoIpcSupport;
}
namespace discardable_memory {
@@ -70,7 +32,6 @@ class DiscardableSharedMemoryManager;
namespace gpu {
struct GpuPreferences;
-class SyncPointManager;
}
#if QT_CONFIG(webengine_printing_and_pdf)
@@ -86,6 +47,7 @@ struct SandboxInterfaceInfo;
#endif
QT_FORWARD_DECLARE_CLASS(QObject)
+class WebRtcLogUploader;
namespace QtWebEngineCore {
@@ -96,10 +58,6 @@ class ProfileAdapter;
bool usingSoftwareDynamicGL();
-#ifdef Q_OS_WIN
-Q_WEBENGINECORE_PRIVATE_EXPORT sandbox::SandboxInterfaceInfo *staticSandboxInterfaceInfo(sandbox::SandboxInterfaceInfo *info = nullptr);
-#endif
-
typedef std::tuple<bool, QString, QString> ProxyAuthentication;
class WebEngineContext : public base::RefCounted<WebEngineContext> {
@@ -107,7 +65,8 @@ public:
static WebEngineContext *current();
static void destroyContextPostRoutine();
static ProxyAuthentication qProxyNetworkAuthentication(QString host, int port);
-
+ static void flushMessages();
+ static bool closingDown();
ProfileAdapter *createDefaultProfileAdapter();
ProfileAdapter *defaultProfileAdapter();
@@ -115,13 +74,15 @@ public:
#if QT_CONFIG(webengine_printing_and_pdf)
printing::PrintJobManager* getPrintJobManager();
#endif
+#if QT_CONFIG(webengine_webrtc) && QT_CONFIG(webengine_extensions)
+ WebRtcLogUploader *webRtcLogUploader();
+#endif
void destroyProfileAdapter();
void addProfileAdapter(ProfileAdapter *profileAdapter);
void removeProfileAdapter(ProfileAdapter *profileAdapter);
void destroy();
- static base::CommandLine* commandLine();
-
- static gpu::SyncPointManager *syncPointManager();
+ static base::CommandLine *initCommandLine(bool &useEmbeddedSwitches,
+ bool &enableGLSoftwareRendering);
private:
friend class base::RefCounted<WebEngineContext>;
@@ -129,20 +90,18 @@ private:
WebEngineContext();
~WebEngineContext();
- static void registerMainThreadFactories(bool threaded);
- static void destroyGpuProcess();
+ static void registerMainThreadFactories();
std::unique_ptr<base::RunLoop> m_runLoop;
std::unique_ptr<ContentMainDelegateQt> m_mainDelegate;
std::unique_ptr<content::ContentMainRunner> m_contentRunner;
std::unique_ptr<content::BrowserMainRunner> m_browserRunner;
std::unique_ptr<discardable_memory::DiscardableSharedMemoryManager> m_discardableSharedMemoryManager;
- std::unique_ptr<content::StartupData> m_startupData;
- std::unique_ptr<content::ServiceManagerEnvironment> m_serviceManagerEnvironment;
+ std::unique_ptr<content::MojoIpcSupport> m_mojoIpcSupport;
std::unique_ptr<QObject> m_globalQObject;
std::unique_ptr<ProfileAdapter> m_defaultProfileAdapter;
std::unique_ptr<DevToolsServerQt> m_devtoolsServer;
- QVector<ProfileAdapter*> m_profileAdapters;
+ QList<ProfileAdapter*> m_profileAdapters;
#if QT_CONFIG(accessibility)
std::unique_ptr<AccessibilityActivationObserver> m_accessibilityActivationObserver;
#endif
@@ -150,9 +109,12 @@ private:
#if QT_CONFIG(webengine_printing_and_pdf)
std::unique_ptr<printing::PrintJobManager> m_printJobManager;
#endif
+#if QT_CONFIG(webengine_webrtc) && QT_CONFIG(webengine_extensions)
+ std::unique_ptr<WebRtcLogUploader> m_webrtcLogUploader;
+#endif
static scoped_refptr<QtWebEngineCore::WebEngineContext> m_handle;
static bool m_destroyed;
- static QAtomicPointer<gpu::SyncPointManager> s_syncPointManager;
+ static bool m_closingDown;
};
} // namespace
diff --git a/src/core/web_engine_context_threads.cpp b/src/core/web_engine_context_threads.cpp
deleted file mode 100644
index ba3e18499..000000000
--- a/src/core/web_engine_context_threads.cpp
+++ /dev/null
@@ -1,138 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "web_engine_context.h"
-
-#include "base/bind.h"
-#include "base/task/post_task.h"
-#include "base/threading/platform_thread.h"
-#include "base/threading/thread_restrictions.h"
-#include "content/browser/gpu/gpu_main_thread_factory.h"
-#include "content/browser/renderer_host/render_process_host_impl.h"
-#include "content/browser/utility_process_host.h"
-#include "content/gpu/gpu_child_thread.h"
-#include "content/gpu/gpu_process.h"
-#include "content/gpu/in_process_gpu_thread.h"
-#include "content/public/browser/browser_task_traits.h"
-#include "content/public/browser/browser_thread.h"
-#include "content/renderer/in_process_renderer_thread.h"
-#include "content/utility/in_process_utility_thread.h"
-#include "gpu/ipc/service/gpu_init.h"
-
-#include <memory>
-
-#include <QEventLoop>
-
-namespace QtWebEngineCore {
-
-struct GpuThreadControllerQt : content::GpuThreadController
-{
- GpuThreadControllerQt(const content::InProcessChildThreadParams &params, const gpu::GpuPreferences &gpuPreferences)
- {
- base::PostTask(
- FROM_HERE, { content::BrowserThread::UI },
- base::BindOnce(&GpuThreadControllerQt::createGpuProcess, params, gpuPreferences));
- }
- ~GpuThreadControllerQt() override
- {
- base::PostTask(
- FROM_HERE, { content::BrowserThread::UI },
- base::BindOnce(&GpuThreadControllerQt::destroyGpuProcess));
- }
-
- static void createGpuProcess(
- const content::InProcessChildThreadParams &params,
- const gpu::GpuPreferences &gpuPreferences)
- {
- DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- if (s_gpuProcessDestroyed)
- return;
-
- s_gpuProcess = std::make_unique<content::GpuProcess>(base::ThreadPriority::DISPLAY);
- auto gpuInit = std::make_unique<gpu::GpuInit>();
- gpuInit->InitializeInProcess(base::CommandLine::ForCurrentProcess(), gpuPreferences);
- auto childThread = new content::GpuChildThread(params, std::move(gpuInit));
- childThread->Init(base::Time::Now());
- s_gpuProcess->set_main_thread(childThread);
- }
-
- static void destroyGpuProcess()
- {
- DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- if (s_gpuProcessDestroyed)
- return;
-
- // viz::GpuServiceImpl::~GpuServiceImpl waits for io task.
- base::ScopedAllowBaseSyncPrimitivesForTesting allow;
- s_gpuProcess.reset();
- s_gpuProcessDestroyed = true;
- }
-
- static std::unique_ptr<content::GpuProcess> s_gpuProcess;
- static bool s_gpuProcessDestroyed;
-};
-
-std::unique_ptr<content::GpuProcess> GpuThreadControllerQt::s_gpuProcess;
-bool GpuThreadControllerQt::s_gpuProcessDestroyed = false;
-
-static std::unique_ptr<content::GpuThreadController> createGpuThreadController(
- const content::InProcessChildThreadParams &params,
- const gpu::GpuPreferences &gpuPreferences)
-{
- return std::make_unique<GpuThreadControllerQt>(params, gpuPreferences);
-}
-
-// static
-void WebEngineContext::destroyGpuProcess()
-{
- GpuThreadControllerQt::destroyGpuProcess();
-}
-
-// static
-void WebEngineContext::registerMainThreadFactories(bool threaded)
-{
- content::UtilityProcessHost::RegisterUtilityMainThreadFactory(content::CreateInProcessUtilityThread);
- content::RenderProcessHostImpl::RegisterRendererMainThreadFactory(content::CreateInProcessRendererThread);
- if (threaded)
- content::RegisterGpuMainThreadFactory(content::CreateInProcessGpuThread);
- else
- content::RegisterGpuMainThreadFactory(createGpuThreadController);
-}
-
-} // namespace QtWebEngineCore
diff --git a/src/core/web_engine_error.cpp b/src/core/web_engine_error.cpp
index 0d326473b..c18dfef8c 100644
--- a/src/core/web_engine_error.cpp
+++ b/src/core/web_engine_error.cpp
@@ -1,55 +1,26 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "web_engine_error.h"
+
+#include "components/error_page/common/error.h"
+#include "components/error_page/common/localized_error.h"
#include "net/base/net_errors.h"
+#include "type_conversion.h"
+
+#include <QString>
+
+using namespace QtWebEngineCore;
+
const int WebEngineError::UserAbortedError = net::ERR_ABORTED;
namespace {
const int noError = 0;
-const int systemRelatedErrors = -1;
const int connectionRelatedErrors = -100;
const int certificateErrors = -200;
const int httpErrors = -300;
const int cacheErrors = -400;
-const int internalErrors = -500;
const int ftpErrors = -600;
const int certificateManagerErrors = -700;
const int dnsResolverErrors = -800;
@@ -58,6 +29,10 @@ const int endErrors = -900;
WebEngineError::ErrorDomain WebEngineError::toQtErrorDomain(int error_code)
{
+ // net errors are always negative values, and https response codes are positive
+ if (error_code > 0)
+ return HttpStatusCodeDomain;
+
// Chromium's ranges from net/base/net_error_list.h:
// 0 No error
// 1- 99 System related errors
@@ -86,3 +61,13 @@ WebEngineError::ErrorDomain WebEngineError::toQtErrorDomain(int error_code)
else
return WebEngineError::InternalErrorDomain;
}
+
+QString WebEngineError::toQtErrorDescription(int errorCode)
+{
+ if (errorCode < 0)
+ return toQt(net::ErrorToString(errorCode));
+ else if (errorCode > 0)
+ return toQt(error_page::LocalizedError::GetErrorDetails(
+ error_page::Error::kHttpErrorDomain, errorCode, false, false));
+ return QString();
+}
diff --git a/src/core/web_engine_error.h b/src/core/web_engine_error.h
index cda9e4625..b43678ad2 100644
--- a/src/core/web_engine_error.h
+++ b/src/core/web_engine_error.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
//
// W A R N I N G
@@ -51,9 +15,9 @@
#ifndef WEB_ENGINE_ERROR_H
#define WEB_ENGINE_ERROR_H
-#include "qtwebenginecoreglobal_p.h"
+#include <QtWebEngineCore/private/qtwebenginecoreglobal_p.h>
-class Q_WEBENGINECORE_PRIVATE_EXPORT WebEngineError
+class Q_WEBENGINECORE_EXPORT WebEngineError
{
public:
@@ -64,13 +28,14 @@ public:
CertificateErrorDomain,
HttpErrorDomain,
FtpErrorDomain,
- DnsErrorDomain
+ DnsErrorDomain,
+ HttpStatusCodeDomain
};
static const int UserAbortedError;
static ErrorDomain toQtErrorDomain(int error_code);
-
+ static QString toQtErrorDescription(int errorCode);
};
#endif // WEB_ENGINE_ERROR_H
diff --git a/src/core/web_engine_library_info.cpp b/src/core/web_engine_library_info.cpp
index 1c8316430..e71153899 100644
--- a/src/core/web_engine_library_info.cpp
+++ b/src/core/web_engine_library_info.cpp
@@ -1,43 +1,8 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 BlackBerry Limited. All rights reserved.
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2013 BlackBerry Limited. All rights reserved.
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+#include "qtwebenginecoreglobal_p.h"
#include "web_engine_library_info.h"
#include "base/base_paths.h"
@@ -45,8 +10,11 @@
#include "base/files/file_util.h"
#include "components/spellcheck/spellcheck_buildflags.h"
#include "content/public/common/content_paths.h"
+#include "sandbox/policy/switches.h"
+#include "ui/base/l10n/l10n_util.h"
#include "ui/base/ui_base_paths.h"
#include "ui/base/ui_base_switches.h"
+
#include "type_conversion.h"
#include <QByteArray>
@@ -55,8 +23,12 @@
#include <QFileInfo>
#include <QLibraryInfo>
#include <QLocale>
+#include <QLoggingCategory>
#include <QStandardPaths>
-#include <QString>
+
+#if defined(Q_OS_WIN)
+#include <windows.h>
+#endif
#ifndef QTWEBENGINEPROCESS_NAME
#error "No name defined for QtWebEngine's process"
@@ -64,6 +36,8 @@
using namespace QtWebEngineCore;
+Q_LOGGING_CATEGORY(webEngineLibraryInfoLog, "qt.webengine.libraryinfo")
+
namespace {
QString fallbackDir() {
@@ -71,19 +45,19 @@ QString fallbackDir() {
return directory;
}
-#if defined(OS_MACOSX) && defined(QT_MAC_FRAMEWORK_BUILD)
+#if defined(Q_OS_DARWIN) && defined(QT_MAC_FRAMEWORK_BUILD)
static inline CFBundleRef frameworkBundle()
{
- return CFBundleGetBundleWithIdentifier(CFSTR("org.qt-project.Qt.QtWebEngineCore"));
+ return CFBundleGetBundleWithIdentifier(CFSTR("org.qt-project.QtWebEngineCore"));
}
-static QString getPath(CFBundleRef frameworkBundle)
+static QString getBundlePath(CFBundleRef frameworkBundle)
{
QString path;
// The following is a fix for QtWebEngineProcess crashes on OS X 10.7 and before.
// We use it for the other OS X versions as well to make sure it works and because
// the directory structure should be the same.
- if (qApp->applicationName() == QLatin1String(QTWEBENGINEPROCESS_NAME)) {
+ if (qApp->applicationName() == QLatin1String(qWebEngineProcessName())) {
path = QDir::cleanPath(qApp->applicationDirPath() % QLatin1String("/../../../.."));
} else if (frameworkBundle) {
CFURLRef bundleUrl = CFBundleCopyBundleURL(frameworkBundle);
@@ -101,12 +75,12 @@ static QString getResourcesPath(CFBundleRef frameworkBundle)
// The following is a fix for QtWebEngineProcess crashes on OS X 10.7 and before.
// We use it for the other OS X versions as well to make sure it works and because
// the directory structure should be the same.
- if (qApp->applicationName() == QLatin1String(QTWEBENGINEPROCESS_NAME)) {
- path = getPath(frameworkBundle) % QLatin1String("/Resources");
+ if (qApp->applicationName() == QLatin1String(qWebEngineProcessName())) {
+ path = getBundlePath(frameworkBundle) % QLatin1String("/Resources");
} else if (frameworkBundle) {
CFURLRef resourcesRelativeUrl = CFBundleCopyResourcesDirectoryURL(frameworkBundle);
CFStringRef resourcesRelativePath = CFURLCopyFileSystemPath(resourcesRelativeUrl, kCFURLPOSIXPathStyle);
- path = getPath(frameworkBundle) % QLatin1Char('/') % QString::fromCFString(resourcesRelativePath);
+ path = getBundlePath(frameworkBundle) % QLatin1Char('/') % QString::fromCFString(resourcesRelativePath);
CFRelease(resourcesRelativePath);
CFRelease(resourcesRelativeUrl);
}
@@ -114,7 +88,7 @@ static QString getResourcesPath(CFBundleRef frameworkBundle)
}
#endif
-#if defined(OS_MACOSX)
+#if defined(Q_OS_DARWIN)
static QString getMainApplicationResourcesPath()
{
QString resourcesPath;
@@ -146,37 +120,62 @@ QString subProcessPath()
{
static QString processPath;
if (processPath.isEmpty()) {
-#if defined(OS_WIN)
- const QString processBinary = QLatin1String(QTWEBENGINEPROCESS_NAME) % QLatin1String(".exe");
+#if defined(Q_OS_WIN)
+ const QString processBinary = QLatin1String(qWebEngineProcessName()) % QLatin1String(".exe");
#else
- const QString processBinary = QLatin1String(QTWEBENGINEPROCESS_NAME);
+ const QString processBinary = QLatin1String(qWebEngineProcessName());
#endif
QStringList candidatePaths;
- const QByteArray fromEnv = qgetenv("QTWEBENGINEPROCESS_PATH");
+ const QString fromEnv = qEnvironmentVariable("QTWEBENGINEPROCESS_PATH");
if (!fromEnv.isEmpty()) {
// Only search in QTWEBENGINEPROCESS_PATH if set
- candidatePaths << QString::fromLocal8Bit(fromEnv);
+ candidatePaths << fromEnv;
} else {
-#if defined(OS_MACOSX) && defined(QT_MAC_FRAMEWORK_BUILD)
- candidatePaths << getPath(frameworkBundle())
- % QStringLiteral("/Helpers/" QTWEBENGINEPROCESS_NAME ".app/Contents/MacOS/" QTWEBENGINEPROCESS_NAME);
+#if defined(Q_OS_DARWIN) && defined(QT_MAC_FRAMEWORK_BUILD)
+ candidatePaths << getBundlePath(frameworkBundle()) % QStringLiteral("/Helpers/")
+ % qWebEngineProcessName() % QStringLiteral(".app/Contents/MacOS/")
+ % qWebEngineProcessName();
#else
- candidatePaths << QLibraryInfo::location(QLibraryInfo::LibraryExecutablesPath)
+ candidatePaths << QLibraryInfo::path(QLibraryInfo::LibraryExecutablesPath)
+ % QLatin1Char('/') % processBinary;
+ candidatePaths << QLibraryInfo::path(QLibraryInfo::BinariesPath)
% QLatin1Char('/') % processBinary;
#endif
candidatePaths << QCoreApplication::applicationDirPath()
% QLatin1Char('/') % processBinary;
}
- for (const QString &candidate : qAsConst(candidatePaths)) {
+ for (const QString &candidate : std::as_const(candidatePaths)) {
if (QFileInfo::exists(candidate)) {
processPath = candidate;
+ qCDebug(webEngineLibraryInfoLog, "Qt WebEngine process path: %s",
+ qPrintable(candidate));
break;
}
}
- if (processPath.isEmpty())
- qFatal("Could not find %s", processBinary.toUtf8().constData());
+ if (processPath.isEmpty()) {
+ QStringList errorMessage;
+ errorMessage.append(
+ QStringLiteral("The following paths were searched for Qt WebEngine Process:"));
+ for (const QString &candidate : std::as_const(candidatePaths))
+ errorMessage.append(QStringLiteral(" ") % candidate);
+ errorMessage.append(QStringLiteral("but could not find it."));
+ if (fromEnv.isEmpty()) {
+ errorMessage.append(
+ QStringLiteral("You may override the default search path by using "
+ "QTWEBENGINEPROCESS_PATH environment variable."));
+ }
+ qFatal("%s", qPrintable(errorMessage.join('\n')));
+ }
+
+#if defined(Q_OS_WIN)
+ base::CommandLine *parsedCommandLine = base::CommandLine::ForCurrentProcess();
+ if (!parsedCommandLine->HasSwitch(sandbox::policy::switches::kNoSandbox)) {
+ if (WebEngineLibraryInfo::isUNCPath(processPath) || WebEngineLibraryInfo::isRemoteDrivePath(processPath))
+ qCritical("Can not launch QtWebEngineProcess from network path if sandbox is enabled: %s.", processPath.toUtf8().constData());
+ }
+#endif
}
@@ -186,23 +185,55 @@ QString subProcessPath()
QString localesPath()
{
- static bool initialized = false;
- static QString potentialLocalesPath =
-#if defined(OS_MACOSX) && defined(QT_MAC_FRAMEWORK_BUILD)
- getResourcesPath(frameworkBundle()) % QLatin1String("/qtwebengine_locales");
+ static QString potentialLocalesPath;
+ if (potentialLocalesPath.isEmpty()) {
+ QStringList candidatePaths;
+ const QString translationPakFilename =
+#if QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)
+ QLatin1String(WebEngineLibraryInfo::getResolvedLocale() + ".pak");
#else
- QLibraryInfo::location(QLibraryInfo::TranslationsPath) % QDir::separator() % QLatin1String("qtwebengine_locales");
+ QLatin1String((WebEngineLibraryInfo::getResolvedLocale() + ".pak").c_str());
+#endif
+ const QString fromEnv = qEnvironmentVariable("QTWEBENGINE_LOCALES_PATH");
+ if (!fromEnv.isEmpty()) {
+ // Only search in QTWEBENGINE_LOCALES_PATH if set
+ candidatePaths << fromEnv;
+ } else {
+#if defined(Q_OS_DARWIN) && defined(QT_MAC_FRAMEWORK_BUILD)
+ candidatePaths << getResourcesPath(frameworkBundle()) % QDir::separator()
+ % QLatin1String("qtwebengine_locales");
#endif
+ candidatePaths << QLibraryInfo::path(QLibraryInfo::TranslationsPath) % QDir::separator()
+ % QLatin1String("qtwebengine_locales");
+ candidatePaths << fallbackDir();
+ }
- if (!initialized) {
- initialized = true;
- if (!QFileInfo::exists(potentialLocalesPath)) {
- qWarning("Installed Qt WebEngine locales directory not found at location %s. Trying application directory...", qPrintable(potentialLocalesPath));
- potentialLocalesPath = QCoreApplication::applicationDirPath() % QDir::separator() % QLatin1String("qtwebengine_locales");
+ for (const QString &candidate : std::as_const(candidatePaths)) {
+ if (QFileInfo::exists(candidate % QDir::separator() % translationPakFilename)) {
+ potentialLocalesPath = candidate;
+ qCDebug(webEngineLibraryInfoLog, "Qt WebEngine locales path: %s",
+ qPrintable(candidate));
+ break;
+ }
}
- if (!QFileInfo::exists(potentialLocalesPath)) {
- qWarning("Qt WebEngine locales directory not found at location %s. Trying fallback directory... Translations MAY NOT not be correct.", qPrintable(potentialLocalesPath));
- potentialLocalesPath = fallbackDir();
+
+ if (potentialLocalesPath.isEmpty()) {
+ QStringList warningMessage;
+ warningMessage.append(
+ QStringLiteral("The following paths were searched for Qt WebEngine locales:"));
+ for (const QString &candidate : std::as_const(candidatePaths))
+ warningMessage.append(QStringLiteral(" ") % candidate);
+ warningMessage.append(
+ QStringLiteral(
+ "but could not find the translation file for the current locale: ")
+ % translationPakFilename);
+ if (fromEnv.isEmpty()) {
+ warningMessage.append(
+ QStringLiteral("You may override the default search paths by using "
+ "QTWEBENGINE_LOCALES_PATH environment variable."));
+ }
+ warningMessage.append(QStringLiteral("Translations WILL NOT be correct."));
+ qWarning("%s", qPrintable(warningMessage.join('\n')));
}
}
@@ -218,13 +249,13 @@ QString dictionariesPath()
if (!initialized) {
initialized = true;
- const QByteArray fromEnv = qgetenv("QTWEBENGINE_DICTIONARIES_PATH");
+ const QString fromEnv = qEnvironmentVariable("QTWEBENGINE_DICTIONARIES_PATH");
if (!fromEnv.isEmpty()) {
// Only search in QTWEBENGINE_DICTIONARIES_PATH if set
- candidatePaths << QString::fromLocal8Bit(fromEnv);
+ candidatePaths << fromEnv;
} else {
// First try to find dictionaries near the application.
-#ifdef OS_MACOSX
+#ifdef Q_OS_DARWIN
QString resourcesDictionariesPath = getMainApplicationResourcesPath()
% QDir::separator() % QLatin1String("qtwebengine_dictionaries");
candidatePaths << resourcesDictionariesPath;
@@ -234,51 +265,80 @@ QString dictionariesPath()
candidatePaths << applicationDictionariesPath;
// Then try to find dictionaries near the installed library.
-#if defined(OS_MACOSX) && defined(QT_MAC_FRAMEWORK_BUILD)
+#if defined(Q_OS_DARWIN) && defined(QT_MAC_FRAMEWORK_BUILD)
QString frameworkDictionariesPath = getResourcesPath(frameworkBundle())
% QLatin1String("/qtwebengine_dictionaries");
candidatePaths << frameworkDictionariesPath;
#endif
- QString libraryDictionariesPath = QLibraryInfo::location(QLibraryInfo::DataPath)
+ QString libraryDictionariesPath = QLibraryInfo::path(QLibraryInfo::DataPath)
% QDir::separator() % QLatin1String("qtwebengine_dictionaries");
candidatePaths << libraryDictionariesPath;
}
- for (const QString &candidate : qAsConst(candidatePaths)) {
+ for (const QString &candidate : std::as_const(candidatePaths)) {
if (QFileInfo::exists(candidate)) {
potentialDictionariesPath = candidate;
+ qCDebug(webEngineLibraryInfoLog, "Qt WebEngine dictionaries path: %s",
+ qPrintable(candidate));
break;
}
}
+
+ if (potentialDictionariesPath.isEmpty()) {
+ // return path for error message
+ potentialDictionariesPath = QCoreApplication::applicationDirPath() % QDir::separator()
+ % QLatin1String("qtwebengine_dictionaries");
+ }
}
return potentialDictionariesPath;
}
#endif // QT_CONFIG(webengine_spellchecker)
-QString resourcesDataPath()
+QString resourcesPath()
{
- static bool initialized = false;
- static QString potentialResourcesPath =
-#if defined(OS_MACOSX) && defined(QT_MAC_FRAMEWORK_BUILD)
- getResourcesPath(frameworkBundle());
-#else
- QLibraryInfo::location(QLibraryInfo::DataPath) % QLatin1String("/resources");
+ static QString potentialResourcesPath;
+ if (potentialResourcesPath.isEmpty()) {
+ QStringList candidatePaths;
+ const QString resourcesPakFilename = QLatin1String("qtwebengine_resources.pak");
+ const QString fromEnv = qEnvironmentVariable("QTWEBENGINE_RESOURCES_PATH");
+ if (!fromEnv.isEmpty()) {
+ // Only search in QTWEBENGINE_RESOURCES_PATH if set
+ candidatePaths << fromEnv;
+ } else {
+#if defined(Q_OS_DARWIN) && defined(QT_MAC_FRAMEWORK_BUILD)
+ candidatePaths << getResourcesPath(frameworkBundle());
#endif
- if (!initialized) {
- initialized = true;
- if (!QFileInfo::exists(potentialResourcesPath % QLatin1String("/qtwebengine_resources.pak"))) {
- qWarning("Qt WebEngine resources not found at %s. Trying parent directory...", qPrintable(potentialResourcesPath));
- potentialResourcesPath = QLibraryInfo::location(QLibraryInfo::DataPath);
+ candidatePaths << QLibraryInfo::path(QLibraryInfo::DataPath) % QDir::separator()
+ % QLatin1String("resources");
+ candidatePaths << QLibraryInfo::path(QLibraryInfo::DataPath);
+ candidatePaths << QCoreApplication::applicationDirPath();
+ candidatePaths << fallbackDir();
}
- if (!QFileInfo::exists(potentialResourcesPath % QLatin1String("/qtwebengine_resources.pak"))) {
- qWarning("Qt WebEngine resources not found at %s. Trying application directory...", qPrintable(potentialResourcesPath));
- potentialResourcesPath = QCoreApplication::applicationDirPath();
+
+ for (const QString &candidate : std::as_const(candidatePaths)) {
+ if (QFileInfo::exists(candidate % QDir::separator() % resourcesPakFilename)) {
+ potentialResourcesPath = candidate;
+ qCDebug(webEngineLibraryInfoLog, "Qt WebEngine resources path: %s",
+ qPrintable(candidate));
+ break;
+ }
}
- if (!QFileInfo::exists(potentialResourcesPath % QLatin1String("/qtwebengine_resources.pak"))) {
- qWarning("Qt WebEngine resources not found at %s. Trying fallback directory... The application MAY NOT work.", qPrintable(potentialResourcesPath));
- potentialResourcesPath = fallbackDir();
+
+ if (potentialResourcesPath.isEmpty()) {
+ QStringList errorMessage;
+ errorMessage.append(QStringLiteral(
+ "The following paths were searched for Qt WebEngine resources:"));
+ for (const QString &candidate : std::as_const(candidatePaths))
+ errorMessage.append(QStringLiteral(" ") % candidate);
+ errorMessage.append(QStringLiteral("but could not find any."));
+ if (fromEnv.isEmpty()) {
+ errorMessage.append(
+ QStringLiteral("You may override the default search paths by using "
+ "QTWEBENGINE_RESOURCES_PATH environment variable."));
+ }
+ qFatal("%s", qPrintable(errorMessage.join('\n')));
}
}
@@ -291,17 +351,21 @@ base::FilePath WebEngineLibraryInfo::getPath(int key)
QString directory;
switch (key) {
case QT_RESOURCES_PAK:
- return toFilePath(resourcesDataPath() % QLatin1String("/qtwebengine_resources.pak"));
+ return toFilePath(resourcesPath() % QLatin1String("/qtwebengine_resources.pak"));
case QT_RESOURCES_100P_PAK:
- return toFilePath(resourcesDataPath() % QLatin1String("/qtwebengine_resources_100p.pak"));
+ return toFilePath(resourcesPath() % QLatin1String("/qtwebengine_resources_100p.pak"));
case QT_RESOURCES_200P_PAK:
- return toFilePath(resourcesDataPath() % QLatin1String("/qtwebengine_resources_200p.pak"));
+ return toFilePath(resourcesPath() % QLatin1String("/qtwebengine_resources_200p.pak"));
case QT_RESOURCES_DEVTOOLS_PAK:
- return toFilePath(resourcesDataPath() % QLatin1String("/qtwebengine_devtools_resources.pak"));
+ return toFilePath(resourcesPath() % QLatin1String("/qtwebengine_devtools_resources.pak"));
+#if defined(Q_OS_DARWIN) && defined(QT_MAC_FRAMEWORK_BUILD)
+ case QT_FRAMEWORK_BUNDLE:
+ return toFilePath(getBundlePath(frameworkBundle()));
+#endif
case base::FILE_EXE:
case content::CHILD_PROCESS_EXE:
return toFilePath(subProcessPath());
-#if defined(OS_POSIX)
+#if BUILDFLAG(IS_POSIX)
case base::DIR_CACHE:
directory = QStandardPaths::writableLocation(QStandardPaths::CacheLocation);
break;
@@ -313,13 +377,15 @@ base::FilePath WebEngineLibraryInfo::getPath(int key)
directory = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
break;
case base::DIR_QT_LIBRARY_DATA:
- return toFilePath(resourcesDataPath());
+ return toFilePath(resourcesPath());
case ui::DIR_LOCALES:
return toFilePath(localesPath());
#if QT_CONFIG(webengine_spellchecker)
case base::DIR_APP_DICTIONARIES:
return toFilePath(dictionariesPath());
#endif
+ case base::DIR_ASSETS:
+ return toFilePath(resourcesPath());
default:
// Note: the path system expects this function to override the default
// behavior. So no need to log an error if we don't support a given
@@ -330,24 +396,49 @@ base::FilePath WebEngineLibraryInfo::getPath(int key)
return toFilePath(directory.isEmpty() ? fallbackDir() : directory);
}
-base::string16 WebEngineLibraryInfo::getApplicationName()
+std::u16string WebEngineLibraryInfo::getApplicationName()
{
return toString16(qApp->applicationName());
}
-std::string WebEngineLibraryInfo::getApplicationLocale()
+std::string WebEngineLibraryInfo::getResolvedLocale()
{
base::CommandLine *parsedCommandLine = base::CommandLine::ForCurrentProcess();
- if (!parsedCommandLine->HasSwitch(switches::kLang)) {
- const QString &locale = QLocale().bcp47Name();
+ std::string locale;
+ if (parsedCommandLine->HasSwitch(switches::kLang))
+ locale = parsedCommandLine->GetSwitchValueASCII(switches::kLang);
+ else
+ locale = QLocale().bcp47Name().toStdString();
- // QLocale::bcp47Name returns "en" for American English locale. Chromium requires the "US" suffix
- // to clarify the dialect and ignores the shorter version.
- if (locale == "en")
- return "en-US";
+ std::string resolvedLocale;
+ if (l10n_util::CheckAndResolveLocale(locale, &resolvedLocale))
+ return resolvedLocale;
- return locale.toStdString();
- }
+ return "en-US";
+}
+
+std::string WebEngineLibraryInfo::getApplicationLocale()
+{
+ base::CommandLine *parsedCommandLine = base::CommandLine::ForCurrentProcess();
+ return parsedCommandLine->HasSwitch(switches::kLang)
+ ? parsedCommandLine->GetSwitchValueASCII(switches::kLang)
+ : QLocale().bcp47Name().toStdString();
+}
- return parsedCommandLine->GetSwitchValueASCII(switches::kLang);
+#if defined(Q_OS_WIN)
+bool WebEngineLibraryInfo::isRemoteDrivePath(const QString &path)
+{
+ WCHAR wDriveLetter[4] = { 0 };
+ swprintf(wDriveLetter, L"%S", path.mid(0, 3).toStdString().c_str());
+ return GetDriveType(wDriveLetter) == DRIVE_REMOTE;
+}
+
+bool WebEngineLibraryInfo::isUNCPath(const QString &path)
+{
+ return (base::FilePath::IsSeparator(path.at(0).toLatin1())
+ && base::FilePath::IsSeparator(path.at(1).toLatin1())
+ && path.at(2) != QLatin1Char('.') && path.at(2) != QLatin1Char('?')
+ && path.at(2).isLetter() && path.at(3) != QLatin1Char(':'));
}
+
+#endif
diff --git a/src/core/web_engine_library_info.h b/src/core/web_engine_library_info.h
index a5cd914d3..b7503f2df 100644
--- a/src/core/web_engine_library_info.h
+++ b/src/core/web_engine_library_info.h
@@ -1,61 +1,32 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 BlackBerry Limited. All rights reserved.
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2013 BlackBerry Limited. All rights reserved.
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef WEB_ENGINE_LIBRARY_INFO_H
#define WEB_ENGINE_LIBRARY_INFO_H
#include "base/files/file_path.h"
-#include "base/strings/string16.h"
+#include <QString>
+
enum {
QT_RESOURCES_PAK = 5000,
QT_RESOURCES_100P_PAK = 5001,
QT_RESOURCES_200P_PAK = 5002,
- QT_RESOURCES_DEVTOOLS_PAK = 5003
+ QT_RESOURCES_DEVTOOLS_PAK = 5003,
+ QT_FRAMEWORK_BUNDLE = 5004
};
class WebEngineLibraryInfo {
public:
static base::FilePath getPath(int key);
// Called by localized_error in our custom chrome layer
- static base::string16 getApplicationName();
+ static std::u16string getApplicationName();
+ static std::string getResolvedLocale();
static std::string getApplicationLocale();
+#if defined(Q_OS_WIN)
+ static bool isRemoteDrivePath(const QString &path);
+ static bool isUNCPath(const QString &path);
+#endif
};
diff --git a/src/core/web_engine_settings.cpp b/src/core/web_engine_settings.cpp
index b9aa941a1..e302998f0 100644
--- a/src/core/web_engine_settings.cpp
+++ b/src/core/web_engine_settings.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "web_engine_settings.h"
@@ -45,28 +9,27 @@
#include "base/command_line.h"
#include "chrome/common/chrome_switches.h"
-#include "components/viz/common/features.h"
-#include "content/browser/gpu/gpu_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_switches.h"
-#include "content/public/common/web_preferences.h"
#include "media/base/media_switches.h"
+#include "third_party/abseil-cpp/absl/types/optional.h"
#include "third_party/blink/public/common/peerconnection/webrtc_ip_handling_policy.h"
-#include "third_party/blink/public/mojom/renderer_preferences.mojom.h"
+#include "third_party/blink/public/common/renderer_preferences/renderer_preferences.h"
+#include "third_party/blink/public/common/web_preferences/web_preferences.h"
#include "ui/base/ui_base_switches.h"
+#include "ui/base/pointer/pointer_device.h"
#include "ui/events/event_switches.h"
#include "ui/native_theme/native_theme.h"
#include <QFont>
#include <QTimer>
-#include <QTouchDevice>
namespace QtWebEngineCore {
-QHash<WebEngineSettings::Attribute, bool> WebEngineSettings::s_defaultAttributes;
-QHash<WebEngineSettings::FontFamily, QString> WebEngineSettings::s_defaultFontFamilies;
-QHash<WebEngineSettings::FontSize, int> WebEngineSettings::s_defaultFontSizes;
+QHash<QWebEngineSettings::WebAttribute, bool> WebEngineSettings::s_defaultAttributes;
+QHash<QWebEngineSettings::FontFamily, QString> WebEngineSettings::s_defaultFontFamilies;
+QHash<QWebEngineSettings::FontSize, int> WebEngineSettings::s_defaultFontSizes;
static const int batchTimerTimeout = 0;
@@ -93,14 +56,30 @@ static inline bool isTouchEventsAPIEnabled() {
return touchEventsAPIEnabled;
}
+blink::mojom::ImageAnimationPolicy
+toBlinkImageAnimationPolicy(QWebEngineSettings::ImageAnimationPolicy policy)
+{
+ switch (policy) {
+ case QWebEngineSettings::AllowImageAnimation:
+ return blink::mojom::ImageAnimationPolicy::kImageAnimationPolicyAllowed;
+ case QWebEngineSettings::AnimateImageOnce:
+ return blink::mojom::ImageAnimationPolicy::kImageAnimationPolicyAnimateOnce;
+ case QWebEngineSettings::DisallowImageAnimation:
+ return blink::mojom::ImageAnimationPolicy::kImageAnimationPolicyNoAnimation;
+ }
+ return blink::mojom::ImageAnimationPolicy::kImageAnimationPolicyAllowed;
+}
+
WebEngineSettings::WebEngineSettings(WebEngineSettings *_parentSettings)
- : m_adapter(0)
+ : m_adapter(nullptr)
, parentSettings(_parentSettings)
- , m_unknownUrlSchemePolicy(WebEngineSettings::InheritedUnknownUrlSchemePolicy)
+ , m_unknownUrlSchemePolicy(QWebEngineSettings::InheritedUnknownUrlSchemePolicy)
+ , m_imageAnimationPolicy(QWebEngineSettings::InheritedImageAnimationPolicy)
{
if (parentSettings)
parentSettings->childSettings.insert(this);
-
+ else
+ initDefaults();
m_batchTimer.setSingleShot(true);
m_batchTimer.setInterval(batchTimerTimeout);
QObject::connect(&m_batchTimer, &QTimer::timeout, [this]() {
@@ -113,12 +92,11 @@ WebEngineSettings::~WebEngineSettings()
if (parentSettings)
parentSettings->childSettings.remove(this);
// In QML the profile and its settings may be garbage collected before the page and its settings.
- for (WebEngineSettings *settings : qAsConst(childSettings)) {
- settings->parentSettings = 0;
- }
+ for (WebEngineSettings *settings : std::as_const(childSettings))
+ settings->parentSettings = nullptr;
}
-void WebEngineSettings::overrideWebPreferences(content::WebContents *webContents, content::WebPreferences *prefs)
+void WebEngineSettings::overrideWebPreferences(content::WebContents *webContents, blink::web_pref::WebPreferences *prefs)
{
// Apply our settings on top of those.
applySettingsToWebPreferences(prefs);
@@ -126,7 +104,7 @@ void WebEngineSettings::overrideWebPreferences(content::WebContents *webContents
// as the host process already overides some of the default WebPreferences values
// before we get here (e.g. number_of_cpu_cores).
if (webPreferences.isNull())
- webPreferences.reset(new content::WebPreferences(*prefs));
+ webPreferences.reset(new blink::web_pref::WebPreferences(*prefs));
if (webContents
&& applySettingsToRendererPreferences(webContents->GetMutableRendererPrefs())) {
@@ -134,22 +112,26 @@ void WebEngineSettings::overrideWebPreferences(content::WebContents *webContents
}
}
-void WebEngineSettings::setAttribute(WebEngineSettings::Attribute attr, bool on)
+void WebEngineSettings::setAttribute(QWebEngineSettings::WebAttribute attr, bool on)
{
m_attributes.insert(attr, on);
scheduleApplyRecursively();
}
-bool WebEngineSettings::testAttribute(WebEngineSettings::Attribute attr) const
+bool WebEngineSettings::testAttribute(QWebEngineSettings::WebAttribute attr) const
{
- if (!parentSettings) {
- Q_ASSERT(s_defaultAttributes.contains(attr));
- return m_attributes.value(attr, s_defaultAttributes.value(attr));
- }
- return m_attributes.value(attr, parentSettings->testAttribute(attr));
+ auto it = m_attributes.constFind(attr);
+ if (it != m_attributes.constEnd())
+ return *it;
+
+ if (parentSettings)
+ return parentSettings->testAttribute(attr);
+
+ Q_ASSERT(s_defaultAttributes.contains(attr));
+ return s_defaultAttributes.value(attr);
}
-bool WebEngineSettings::isAttributeExplicitlySet(Attribute attr) const
+bool WebEngineSettings::isAttributeExplicitlySet(QWebEngineSettings::WebAttribute attr) const
{
if (m_attributes.contains(attr))
return true;
@@ -160,19 +142,19 @@ bool WebEngineSettings::isAttributeExplicitlySet(Attribute attr) const
return false;
}
-void WebEngineSettings::resetAttribute(WebEngineSettings::Attribute attr)
+void WebEngineSettings::resetAttribute(QWebEngineSettings::WebAttribute attr)
{
m_attributes.remove(attr);
scheduleApplyRecursively();
}
-void WebEngineSettings::setFontFamily(WebEngineSettings::FontFamily which, const QString &family)
+void WebEngineSettings::setFontFamily(QWebEngineSettings::FontFamily which, const QString &family)
{
m_fontFamilies.insert(which, family);
scheduleApplyRecursively();
}
-QString WebEngineSettings::fontFamily(WebEngineSettings::FontFamily which)
+QString WebEngineSettings::fontFamily(QWebEngineSettings::FontFamily which)
{
if (!parentSettings) {
Q_ASSERT(s_defaultFontFamilies.contains(which));
@@ -181,19 +163,19 @@ QString WebEngineSettings::fontFamily(WebEngineSettings::FontFamily which)
return m_fontFamilies.value(which, parentSettings->fontFamily(which));
}
-void WebEngineSettings::resetFontFamily(WebEngineSettings::FontFamily which)
+void WebEngineSettings::resetFontFamily(QWebEngineSettings::FontFamily which)
{
m_fontFamilies.remove(which);
scheduleApplyRecursively();
}
-void WebEngineSettings::setFontSize(WebEngineSettings::FontSize type, int size)
+void WebEngineSettings::setFontSize(QWebEngineSettings::FontSize type, int size)
{
m_fontSizes.insert(type, size);
scheduleApplyRecursively();
}
-int WebEngineSettings::fontSize(WebEngineSettings::FontSize type) const
+int WebEngineSettings::fontSize(QWebEngineSettings::FontSize type) const
{
if (!parentSettings) {
Q_ASSERT(s_defaultFontSizes.contains(type));
@@ -202,7 +184,7 @@ int WebEngineSettings::fontSize(WebEngineSettings::FontSize type) const
return m_fontSizes.value(type, parentSettings->fontSize(type));
}
-void WebEngineSettings::resetFontSize(WebEngineSettings::FontSize type)
+void WebEngineSettings::resetFontSize(QWebEngineSettings::FontSize type)
{
m_fontSizes.remove(type);
scheduleApplyRecursively();
@@ -221,42 +203,60 @@ QString WebEngineSettings::defaultTextEncoding() const
return m_defaultEncoding.isEmpty()? parentSettings->defaultTextEncoding() : m_defaultEncoding;
}
-void WebEngineSettings::setUnknownUrlSchemePolicy(WebEngineSettings::UnknownUrlSchemePolicy policy)
+void WebEngineSettings::setUnknownUrlSchemePolicy(QWebEngineSettings::UnknownUrlSchemePolicy policy)
{
m_unknownUrlSchemePolicy = policy;
+ scheduleApplyRecursively();
}
-WebEngineSettings::UnknownUrlSchemePolicy WebEngineSettings::unknownUrlSchemePolicy() const
+void WebEngineSettings::setImageAnimationPolicy(QWebEngineSettings::ImageAnimationPolicy policy)
+{
+ m_imageAnimationPolicy = policy;
+ scheduleApplyRecursively();
+}
+
+QWebEngineSettings::ImageAnimationPolicy WebEngineSettings::imageAnimationPolicy() const
+{
+ if (m_imageAnimationPolicy != QWebEngineSettings::InheritedImageAnimationPolicy)
+ return m_imageAnimationPolicy;
+
+ if (parentSettings)
+ return parentSettings->imageAnimationPolicy();
+
+ return QWebEngineSettings::AllowImageAnimation;
+}
+
+QWebEngineSettings::UnknownUrlSchemePolicy WebEngineSettings::unknownUrlSchemePolicy() const
{
// value InheritedUnknownUrlSchemePolicy means it is taken from parent, if possible. If there
// is no parent, then AllowUnknownUrlSchemesFromUserInteraction (the default behavior) is used.
- if (m_unknownUrlSchemePolicy != InheritedUnknownUrlSchemePolicy)
+ if (m_unknownUrlSchemePolicy != QWebEngineSettings::InheritedUnknownUrlSchemePolicy)
return m_unknownUrlSchemePolicy;
if (parentSettings)
return parentSettings->unknownUrlSchemePolicy();
- return AllowUnknownUrlSchemesFromUserInteraction;
+ return QWebEngineSettings::AllowUnknownUrlSchemesFromUserInteraction;
}
void WebEngineSettings::initDefaults()
{
if (s_defaultAttributes.isEmpty()) {
// Initialize the default settings.
- s_defaultAttributes.insert(AutoLoadImages, true);
- s_defaultAttributes.insert(JavascriptEnabled, true);
- s_defaultAttributes.insert(JavascriptCanOpenWindows, true);
- s_defaultAttributes.insert(JavascriptCanAccessClipboard, false);
- s_defaultAttributes.insert(LinksIncludedInFocusChain, true);
- s_defaultAttributes.insert(LocalStorageEnabled, true);
- s_defaultAttributes.insert(LocalContentCanAccessRemoteUrls, false);
- s_defaultAttributes.insert(XSSAuditingEnabled, false);
- s_defaultAttributes.insert(SpatialNavigationEnabled, false);
- s_defaultAttributes.insert(LocalContentCanAccessFileUrls, true);
- s_defaultAttributes.insert(HyperlinkAuditingEnabled, false);
- s_defaultAttributes.insert(ErrorPageEnabled, true);
- s_defaultAttributes.insert(PluginsEnabled, false);
- s_defaultAttributes.insert(FullScreenSupportEnabled, false);
- s_defaultAttributes.insert(ScreenCaptureEnabled, false);
- s_defaultAttributes.insert(ShowScrollBars, true);
+ s_defaultAttributes.insert(QWebEngineSettings::AutoLoadImages, true);
+ s_defaultAttributes.insert(QWebEngineSettings::JavascriptEnabled, true);
+ s_defaultAttributes.insert(QWebEngineSettings::JavascriptCanOpenWindows, true);
+ s_defaultAttributes.insert(QWebEngineSettings::JavascriptCanAccessClipboard, false);
+ s_defaultAttributes.insert(QWebEngineSettings::LinksIncludedInFocusChain, true);
+ s_defaultAttributes.insert(QWebEngineSettings::LocalStorageEnabled, true);
+ s_defaultAttributes.insert(QWebEngineSettings::LocalContentCanAccessRemoteUrls, false);
+ s_defaultAttributes.insert(QWebEngineSettings::XSSAuditingEnabled, false);
+ s_defaultAttributes.insert(QWebEngineSettings::SpatialNavigationEnabled, false);
+ s_defaultAttributes.insert(QWebEngineSettings::LocalContentCanAccessFileUrls, true);
+ s_defaultAttributes.insert(QWebEngineSettings::HyperlinkAuditingEnabled, false);
+ s_defaultAttributes.insert(QWebEngineSettings::ErrorPageEnabled, true);
+ s_defaultAttributes.insert(QWebEngineSettings::PluginsEnabled, false);
+ s_defaultAttributes.insert(QWebEngineSettings::FullScreenSupportEnabled, false);
+ s_defaultAttributes.insert(QWebEngineSettings::ScreenCaptureEnabled, false);
+ s_defaultAttributes.insert(QWebEngineSettings::ShowScrollBars, true);
// The following defaults matches logic in render_view_host_impl.cc
// But first we must ensure the WebContext has been initialized
QtWebEngineCore::WebEngineContext::current();
@@ -268,60 +268,72 @@ void WebEngineSettings::initDefaults()
bool accelerated2dCanvas =
!commandLine->HasSwitch(switches::kDisableAccelerated2dCanvas);
bool allowRunningInsecureContent = commandLine->HasSwitch(switches::kAllowRunningInsecureContent);
- s_defaultAttributes.insert(ScrollAnimatorEnabled, smoothScrolling);
- s_defaultAttributes.insert(WebGLEnabled, webGL);
- s_defaultAttributes.insert(Accelerated2dCanvasEnabled, accelerated2dCanvas);
- s_defaultAttributes.insert(AutoLoadIconsForPage, true);
- s_defaultAttributes.insert(TouchIconsEnabled, false);
- s_defaultAttributes.insert(FocusOnNavigationEnabled, false);
- s_defaultAttributes.insert(PrintElementBackgrounds, true);
- s_defaultAttributes.insert(AllowRunningInsecureContent, allowRunningInsecureContent);
- s_defaultAttributes.insert(AllowGeolocationOnInsecureOrigins, false);
- s_defaultAttributes.insert(AllowWindowActivationFromJavaScript, false);
+ s_defaultAttributes.insert(QWebEngineSettings::ScrollAnimatorEnabled, smoothScrolling);
+ s_defaultAttributes.insert(QWebEngineSettings::WebGLEnabled, webGL);
+ s_defaultAttributes.insert(QWebEngineSettings::Accelerated2dCanvasEnabled,
+ accelerated2dCanvas);
+ s_defaultAttributes.insert(QWebEngineSettings::AutoLoadIconsForPage, true);
+ s_defaultAttributes.insert(QWebEngineSettings::TouchIconsEnabled, false);
+ s_defaultAttributes.insert(QWebEngineSettings::FocusOnNavigationEnabled, false);
+ s_defaultAttributes.insert(QWebEngineSettings::PrintElementBackgrounds, true);
+ s_defaultAttributes.insert(QWebEngineSettings::AllowRunningInsecureContent,
+ allowRunningInsecureContent);
+ s_defaultAttributes.insert(QWebEngineSettings::AllowGeolocationOnInsecureOrigins, false);
+ s_defaultAttributes.insert(QWebEngineSettings::AllowWindowActivationFromJavaScript, false);
bool playbackRequiresUserGesture = false;
if (commandLine->HasSwitch(switches::kAutoplayPolicy))
playbackRequiresUserGesture = (commandLine->GetSwitchValueASCII(switches::kAutoplayPolicy) != switches::autoplay::kNoUserGestureRequiredPolicy);
- s_defaultAttributes.insert(PlaybackRequiresUserGesture, playbackRequiresUserGesture);
- s_defaultAttributes.insert(WebRTCPublicInterfacesOnly, false);
- s_defaultAttributes.insert(JavascriptCanPaste, false);
- s_defaultAttributes.insert(DnsPrefetchEnabled, false);
-#if QT_CONFIG(webengine_extensions)
- s_defaultAttributes.insert(PdfViewerEnabled, true);
+ s_defaultAttributes.insert(QWebEngineSettings::PlaybackRequiresUserGesture,
+ playbackRequiresUserGesture);
+ s_defaultAttributes.insert(QWebEngineSettings::WebRTCPublicInterfacesOnly, false);
+ s_defaultAttributes.insert(QWebEngineSettings::JavascriptCanPaste, false);
+ s_defaultAttributes.insert(QWebEngineSettings::DnsPrefetchEnabled, false);
+#if QT_CONFIG(webengine_extensions) && QT_CONFIG(webengine_printing_and_pdf)
+ s_defaultAttributes.insert(QWebEngineSettings::PdfViewerEnabled, true);
#else
- s_defaultAttributes.insert(PdfViewerEnabled, false);
+ s_defaultAttributes.insert(QWebEngineSettings::PdfViewerEnabled, false);
#endif
+ s_defaultAttributes.insert(QWebEngineSettings::NavigateOnDropEnabled, true);
+ bool noReadingFromCanvas =
+ commandLine->HasSwitch(switches::kDisableReadingFromCanvas);
+ s_defaultAttributes.insert(QWebEngineSettings::ReadingFromCanvasEnabled, !noReadingFromCanvas);
+ bool forceDarkMode = commandLine->HasSwitch(switches::kForceDarkMode);
+ s_defaultAttributes.insert(QWebEngineSettings::ForceDarkMode, forceDarkMode);
}
if (s_defaultFontFamilies.isEmpty()) {
// Default fonts
QFont defaultFont;
defaultFont.setStyleHint(QFont::Serif);
- s_defaultFontFamilies.insert(StandardFont, defaultFont.defaultFamily());
- s_defaultFontFamilies.insert(SerifFont, defaultFont.defaultFamily());
- s_defaultFontFamilies.insert(PictographFont, defaultFont.defaultFamily());
+ s_defaultFontFamilies.insert(QWebEngineSettings::StandardFont, defaultFont.defaultFamily());
+ s_defaultFontFamilies.insert(QWebEngineSettings::SerifFont, defaultFont.defaultFamily());
+ s_defaultFontFamilies.insert(QWebEngineSettings::PictographFont,
+ defaultFont.defaultFamily());
defaultFont.setStyleHint(QFont::Fantasy);
- s_defaultFontFamilies.insert(FantasyFont, defaultFont.defaultFamily());
+ s_defaultFontFamilies.insert(QWebEngineSettings::FantasyFont, defaultFont.defaultFamily());
defaultFont.setStyleHint(QFont::Cursive);
- s_defaultFontFamilies.insert(CursiveFont, defaultFont.defaultFamily());
+ s_defaultFontFamilies.insert(QWebEngineSettings::CursiveFont, defaultFont.defaultFamily());
defaultFont.setStyleHint(QFont::SansSerif);
- s_defaultFontFamilies.insert(SansSerifFont, defaultFont.defaultFamily());
+ s_defaultFontFamilies.insert(QWebEngineSettings::SansSerifFont,
+ defaultFont.defaultFamily());
defaultFont.setStyleHint(QFont::Monospace);
- s_defaultFontFamilies.insert(FixedFont, defaultFont.defaultFamily());
+ s_defaultFontFamilies.insert(QWebEngineSettings::FixedFont, defaultFont.defaultFamily());
}
if (s_defaultFontSizes.isEmpty()) {
- s_defaultFontSizes.insert(MinimumFontSize, 0);
- s_defaultFontSizes.insert(MinimumLogicalFontSize, 6);
- s_defaultFontSizes.insert(DefaultFixedFontSize, 13);
- s_defaultFontSizes.insert(DefaultFontSize, 16);
+ s_defaultFontSizes.insert(QWebEngineSettings::MinimumFontSize, 0);
+ s_defaultFontSizes.insert(QWebEngineSettings::MinimumLogicalFontSize, 6);
+ s_defaultFontSizes.insert(QWebEngineSettings::DefaultFixedFontSize, 13);
+ s_defaultFontSizes.insert(QWebEngineSettings::DefaultFontSize, 16);
}
m_defaultEncoding = QStringLiteral("ISO-8859-1");
- m_unknownUrlSchemePolicy = InheritedUnknownUrlSchemePolicy;
+ m_unknownUrlSchemePolicy = QWebEngineSettings::InheritedUnknownUrlSchemePolicy;
+ m_imageAnimationPolicy = QWebEngineSettings::InheritedImageAnimationPolicy;
}
void WebEngineSettings::scheduleApply()
@@ -345,91 +357,97 @@ void WebEngineSettings::doApply()
m_adapter->webContents()->SyncRendererPrefs();
}
-void WebEngineSettings::applySettingsToWebPreferences(content::WebPreferences *prefs)
+void WebEngineSettings::applySettingsToWebPreferences(blink::web_pref::WebPreferences *prefs)
{
+ // Not supported
+ prefs->picture_in_picture_enabled = false;
+
// Override for now
prefs->touch_event_feature_detection_enabled = isTouchEventsAPIEnabled();
#if !QT_CONFIG(webengine_embedded_build)
- prefs->available_hover_types = ui::HOVER_TYPE_HOVER;
- prefs->primary_hover_type = ui::HOVER_TYPE_HOVER;
+ prefs->available_hover_types = (int)blink::mojom::HoverType::kHoverHoverType;
+ prefs->primary_hover_type = blink::mojom::HoverType::kHoverHoverType;
#endif
if (prefs->viewport_enabled) {
// We need to enable the viewport options together as it doesn't really work
// to enable them separately. With viewport-enabled we match Android defaults.
prefs->viewport_meta_enabled = true;
prefs->shrinks_viewport_contents_to_fit = true;
+ prefs->main_frame_resizes_are_orientation_changes = true;
}
// Attributes mapping.
- prefs->loads_images_automatically = testAttribute(AutoLoadImages);
- prefs->javascript_enabled = testAttribute(JavascriptEnabled);
- prefs->javascript_can_access_clipboard = testAttribute(JavascriptCanAccessClipboard);
- prefs->tabs_to_links = testAttribute(LinksIncludedInFocusChain);
- prefs->local_storage_enabled = testAttribute(LocalStorageEnabled);
- prefs->databases_enabled = testAttribute(LocalStorageEnabled);
- prefs->allow_universal_access_from_file_urls = testAttribute(LocalContentCanAccessRemoteUrls);
- prefs->spatial_navigation_enabled = testAttribute(SpatialNavigationEnabled);
- prefs->allow_file_access_from_file_urls = testAttribute(LocalContentCanAccessFileUrls);
- prefs->hyperlink_auditing_enabled = testAttribute(HyperlinkAuditingEnabled);
- prefs->enable_scroll_animator = testAttribute(ScrollAnimatorEnabled);
- prefs->enable_error_page = testAttribute(ErrorPageEnabled);
- prefs->plugins_enabled = testAttribute(PluginsEnabled);
- prefs->fullscreen_supported = testAttribute(FullScreenSupportEnabled);
- prefs->accelerated_2d_canvas_enabled = testAttribute(Accelerated2dCanvasEnabled);
- prefs->webgl1_enabled = prefs->webgl2_enabled = testAttribute(WebGLEnabled);
- prefs->should_print_backgrounds = testAttribute(PrintElementBackgrounds);
- prefs->allow_running_insecure_content = testAttribute(AllowRunningInsecureContent);
- prefs->allow_geolocation_on_insecure_origins = testAttribute(AllowGeolocationOnInsecureOrigins);
- prefs->hide_scrollbars = !testAttribute(ShowScrollBars);
- if (isAttributeExplicitlySet(PlaybackRequiresUserGesture)) {
- prefs->autoplay_policy = testAttribute(PlaybackRequiresUserGesture)
- ? content::AutoplayPolicy::kUserGestureRequired
- : content::AutoplayPolicy::kNoUserGestureRequired;
- }
- prefs->dom_paste_enabled = testAttribute(JavascriptCanPaste);
- prefs->dns_prefetching_enabled = testAttribute(DnsPrefetchEnabled);
-
- if (!features::IsVizDisplayCompositorEnabled()) {
- prefs->accelerated_2d_canvas_enabled = false;
- prefs->disable_features_depending_on_viz = true;
+ prefs->loads_images_automatically = testAttribute(QWebEngineSettings::AutoLoadImages);
+ prefs->javascript_enabled = testAttribute(QWebEngineSettings::JavascriptEnabled);
+ prefs->javascript_can_access_clipboard =
+ testAttribute(QWebEngineSettings::JavascriptCanAccessClipboard);
+ prefs->tabs_to_links = testAttribute(QWebEngineSettings::LinksIncludedInFocusChain);
+ prefs->local_storage_enabled = testAttribute(QWebEngineSettings::LocalStorageEnabled);
+ prefs->databases_enabled = testAttribute(QWebEngineSettings::LocalStorageEnabled);
+ prefs->allow_remote_access_from_local_urls =
+ testAttribute(QWebEngineSettings::LocalContentCanAccessRemoteUrls);
+ prefs->spatial_navigation_enabled = testAttribute(QWebEngineSettings::SpatialNavigationEnabled);
+ prefs->allow_file_access_from_file_urls =
+ testAttribute(QWebEngineSettings::LocalContentCanAccessFileUrls);
+ prefs->hyperlink_auditing_enabled = testAttribute(QWebEngineSettings::HyperlinkAuditingEnabled);
+ prefs->enable_scroll_animator = testAttribute(QWebEngineSettings::ScrollAnimatorEnabled);
+ prefs->enable_error_page = testAttribute(QWebEngineSettings::ErrorPageEnabled);
+ prefs->plugins_enabled = testAttribute(QWebEngineSettings::PluginsEnabled);
+ prefs->fullscreen_supported = testAttribute(QWebEngineSettings::FullScreenSupportEnabled);
+ prefs->accelerated_2d_canvas_enabled =
+ testAttribute(QWebEngineSettings::Accelerated2dCanvasEnabled);
+ prefs->force_dark_mode_enabled = testAttribute(QWebEngineSettings::ForceDarkMode);
+ prefs->webgl1_enabled = prefs->webgl2_enabled = testAttribute(QWebEngineSettings::WebGLEnabled);
+ prefs->should_print_backgrounds = testAttribute(QWebEngineSettings::PrintElementBackgrounds);
+ prefs->allow_running_insecure_content =
+ testAttribute(QWebEngineSettings::AllowRunningInsecureContent);
+ prefs->allow_geolocation_on_insecure_origins =
+ testAttribute(QWebEngineSettings::AllowGeolocationOnInsecureOrigins);
+ prefs->hide_scrollbars = !testAttribute(QWebEngineSettings::ShowScrollBars);
+ if (isAttributeExplicitlySet(QWebEngineSettings::PlaybackRequiresUserGesture)) {
+ prefs->autoplay_policy = testAttribute(QWebEngineSettings::PlaybackRequiresUserGesture)
+ ? blink::mojom::AutoplayPolicy::kUserGestureRequired
+ : blink::mojom::AutoplayPolicy::kNoUserGestureRequired;
}
+ prefs->dom_paste_enabled = testAttribute(QWebEngineSettings::JavascriptCanPaste);
+ prefs->dns_prefetching_enabled = testAttribute(QWebEngineSettings::DnsPrefetchEnabled);
+ prefs->disable_reading_from_canvas = !testAttribute(QWebEngineSettings::ReadingFromCanvasEnabled);
+ prefs->animation_policy = toBlinkImageAnimationPolicy(imageAnimationPolicy());
// Fonts settings.
- prefs->standard_font_family_map[content::kCommonScript] = toString16(fontFamily(StandardFont));
- prefs->fixed_font_family_map[content::kCommonScript] = toString16(fontFamily(FixedFont));
- prefs->serif_font_family_map[content::kCommonScript] = toString16(fontFamily(SerifFont));
- prefs->sans_serif_font_family_map[content::kCommonScript] = toString16(fontFamily(SansSerifFont));
- prefs->cursive_font_family_map[content::kCommonScript] = toString16(fontFamily(CursiveFont));
- prefs->fantasy_font_family_map[content::kCommonScript] = toString16(fontFamily(FantasyFont));
- prefs->pictograph_font_family_map[content::kCommonScript] = toString16(fontFamily(PictographFont));
- prefs->default_font_size = fontSize(DefaultFontSize);
- prefs->default_fixed_font_size = fontSize(DefaultFixedFontSize);
- prefs->minimum_font_size = fontSize(MinimumFontSize);
- prefs->minimum_logical_font_size = fontSize(MinimumLogicalFontSize);
+ prefs->standard_font_family_map[blink::web_pref::kCommonScript] =
+ toString16(fontFamily(QWebEngineSettings::StandardFont));
+ prefs->fixed_font_family_map[blink::web_pref::kCommonScript] =
+ toString16(fontFamily(QWebEngineSettings::FixedFont));
+ prefs->serif_font_family_map[blink::web_pref::kCommonScript] =
+ toString16(fontFamily(QWebEngineSettings::SerifFont));
+ prefs->sans_serif_font_family_map[blink::web_pref::kCommonScript] =
+ toString16(fontFamily(QWebEngineSettings::SansSerifFont));
+ prefs->cursive_font_family_map[blink::web_pref::kCommonScript] =
+ toString16(fontFamily(QWebEngineSettings::CursiveFont));
+ prefs->fantasy_font_family_map[blink::web_pref::kCommonScript] =
+ toString16(fontFamily(QWebEngineSettings::FantasyFont));
+ prefs->default_font_size = fontSize(QWebEngineSettings::DefaultFontSize);
+ prefs->default_fixed_font_size = fontSize(QWebEngineSettings::DefaultFixedFontSize);
+ prefs->minimum_font_size = fontSize(QWebEngineSettings::MinimumFontSize);
+ prefs->minimum_logical_font_size = fontSize(QWebEngineSettings::MinimumLogicalFontSize);
prefs->default_encoding = defaultTextEncoding().toStdString();
// Set the theme colors. Based on chrome_content_browser_client.cc:
const ui::NativeTheme *webTheme = ui::NativeTheme::GetInstanceForWeb();
- // WebPreferences::preferred_color_scheme was deleted in Chromium 80, but it
- // will make a comeback in Chromium 82...
- //
- // See also: https://chromium-review.googlesource.com/c/chromium/src/+/2079192
- //
- // if (webTheme) {
- // switch (webTheme->GetPreferredColorScheme()) {
- // case ui::NativeTheme::PreferredColorScheme::kDark:
- // prefs->preferred_color_scheme = blink::PreferredColorScheme::kDark;
- // break;
- // case ui::NativeTheme::PreferredColorScheme::kLight:
- // prefs->preferred_color_scheme = blink::PreferredColorScheme::kLight;
- // break;
- // case ui::NativeTheme::PreferredColorScheme::kNoPreference:
- // prefs->preferred_color_scheme = blink::PreferredColorScheme::kNoPreference;
- // }
- // }
+ if (webTheme) {
+ switch (webTheme->GetPreferredColorScheme()) {
+ case ui::NativeTheme::PreferredColorScheme::kDark:
+ prefs->preferred_color_scheme = blink::mojom::PreferredColorScheme::kDark;
+ break;
+ case ui::NativeTheme::PreferredColorScheme::kLight:
+ prefs->preferred_color_scheme = blink::mojom::PreferredColorScheme::kLight;
+ break;
+ }
+ }
// Apply native CaptionStyle parameters.
- base::Optional<ui::CaptionStyle> style;
+ absl::optional<ui::CaptionStyle> style;
if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kForceCaptionStyle)) {
style = ui::CaptionStyle::FromSpec(
base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kForceCaptionStyle));
@@ -447,39 +465,44 @@ void WebEngineSettings::applySettingsToWebPreferences(content::WebPreferences *p
prefs->text_track_font_family = style->font_family;
prefs->text_track_font_variant = style->font_variant;
prefs->text_track_window_color = style->window_color;
- prefs->text_track_window_padding = style->window_padding;
prefs->text_track_window_radius = style->window_radius;
}
}
-bool WebEngineSettings::applySettingsToRendererPreferences(blink::mojom::RendererPreferences *prefs)
+bool WebEngineSettings::applySettingsToRendererPreferences(blink::RendererPreferences *prefs)
{
bool changed = false;
#if QT_CONFIG(webengine_webrtc)
if (!base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kForceWebRtcIPHandlingPolicy)) {
- std::string webrtc_ip_handling_policy = testAttribute(WebEngineSettings::WebRTCPublicInterfacesOnly)
- ? blink::kWebRTCIPHandlingDefaultPublicInterfaceOnly
- : blink::kWebRTCIPHandlingDefault;
+ std::string webrtc_ip_handling_policy =
+ testAttribute(QWebEngineSettings::WebRTCPublicInterfacesOnly)
+ ? blink::kWebRTCIPHandlingDefaultPublicInterfaceOnly
+ : blink::kWebRTCIPHandlingDefault;
if (prefs->webrtc_ip_handling_policy != webrtc_ip_handling_policy) {
prefs->webrtc_ip_handling_policy = webrtc_ip_handling_policy;
changed = true;
}
}
#endif
+ bool canNavigateOnDrop = testAttribute(QWebEngineSettings::NavigateOnDropEnabled);
+ if (canNavigateOnDrop != prefs->can_accept_load_drops) {
+ prefs->can_accept_load_drops = canNavigateOnDrop;
+ changed = true;
+ }
return changed;
}
void WebEngineSettings::scheduleApplyRecursively()
{
scheduleApply();
- for (WebEngineSettings *settings : qAsConst(childSettings)) {
+ for (WebEngineSettings *settings : std::as_const(childSettings)) {
settings->scheduleApply();
}
}
bool WebEngineSettings::getJavaScriptCanOpenWindowsAutomatically()
{
- return testAttribute(JavascriptCanOpenWindows);
+ return testAttribute(QWebEngineSettings::JavascriptCanOpenWindows);
}
void WebEngineSettings::setParentSettings(WebEngineSettings *_parentSettings)
@@ -489,6 +512,7 @@ void WebEngineSettings::setParentSettings(WebEngineSettings *_parentSettings)
parentSettings = _parentSettings;
if (parentSettings)
parentSettings->childSettings.insert(this);
+ scheduleApplyRecursively();
}
} // namespace QtWebEngineCore
diff --git a/src/core/web_engine_settings.h b/src/core/web_engine_settings.h
index 95eea669f..2bfc5949d 100644
--- a/src/core/web_engine_settings.h
+++ b/src/core/web_engine_settings.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
//
// W A R N I N G
@@ -51,8 +15,8 @@
#ifndef WEB_ENGINE_SETTINGS_H
#define WEB_ENGINE_SETTINGS_H
-#include "qtwebenginecoreglobal_p.h"
-
+#include <QtWebEngineCore/private/qtwebenginecoreglobal_p.h>
+#include <QtWebEngineCore/qwebenginesettings.h>
#include <QScopedPointer>
#include <QHash>
#include <QUrl>
@@ -61,109 +25,51 @@
namespace content {
class WebContents;
-struct WebPreferences;
}
+
namespace blink {
-namespace mojom {
-class RendererPreferences;
+struct RendererPreferences;
+namespace web_pref {
+struct WebPreferences;
}
}
namespace QtWebEngineCore {
class WebContentsAdapter;
-class Q_WEBENGINECORE_PRIVATE_EXPORT WebEngineSettings {
+class WebEngineSettings {
public:
- // Attributes. Names match the ones from the public widgets API.
- enum Attribute {
- UnsupportedInCoreSettings = -1,
- AutoLoadImages,
- JavascriptEnabled,
- JavascriptCanOpenWindows,
- JavascriptCanAccessClipboard,
- LinksIncludedInFocusChain,
- LocalStorageEnabled,
- LocalContentCanAccessRemoteUrls,
- XSSAuditingEnabled,
- SpatialNavigationEnabled,
- LocalContentCanAccessFileUrls,
- HyperlinkAuditingEnabled,
- ScrollAnimatorEnabled,
- ErrorPageEnabled,
- PluginsEnabled,
- FullScreenSupportEnabled,
- ScreenCaptureEnabled,
- WebGLEnabled,
- Accelerated2dCanvasEnabled,
- AutoLoadIconsForPage,
- TouchIconsEnabled,
- FocusOnNavigationEnabled,
- PrintElementBackgrounds,
- AllowRunningInsecureContent,
- AllowGeolocationOnInsecureOrigins,
- AllowWindowActivationFromJavaScript,
- ShowScrollBars,
- PlaybackRequiresUserGesture,
- WebRTCPublicInterfacesOnly,
- JavascriptCanPaste,
- DnsPrefetchEnabled,
- PdfViewerEnabled,
- };
-
- // Must match the values from the public API in qwebenginesettings.h.
- enum FontFamily {
- StandardFont,
- FixedFont,
- SerifFont,
- SansSerifFont,
- CursiveFont,
- FantasyFont,
- PictographFont
- };
-
- // Must match the values from the public API in qwebenginesettings.h.
- enum FontSize {
- MinimumFontSize,
- MinimumLogicalFontSize,
- DefaultFontSize,
- DefaultFixedFontSize
- };
-
- // Must match the values from the public API in qwebenginesettings.h.
- enum UnknownUrlSchemePolicy {
- InheritedUnknownUrlSchemePolicy = 0,
- DisallowUnknownUrlSchemes = 1,
- AllowUnknownUrlSchemesFromUserInteraction,
- AllowAllUnknownUrlSchemes
- };
-
- explicit WebEngineSettings(WebEngineSettings *parentSettings = 0);
+ static WebEngineSettings* get(QWebEngineSettings *settings) { return settings->d_ptr.data(); }
+
+ explicit WebEngineSettings(WebEngineSettings *parentSettings = nullptr);
~WebEngineSettings();
void setParentSettings(WebEngineSettings *parentSettings);
- void overrideWebPreferences(content::WebContents *webContents, content::WebPreferences *prefs);
+ void overrideWebPreferences(content::WebContents *webContents, blink::web_pref::WebPreferences *prefs);
- void setAttribute(Attribute, bool on);
- bool testAttribute(Attribute) const;
- void resetAttribute(Attribute);
- bool isAttributeExplicitlySet(Attribute) const;
+ void setAttribute(QWebEngineSettings::WebAttribute, bool on);
+ bool testAttribute(QWebEngineSettings::WebAttribute) const;
+ void resetAttribute(QWebEngineSettings::WebAttribute);
+ bool isAttributeExplicitlySet(QWebEngineSettings::WebAttribute) const;
- void setFontFamily(FontFamily, const QString &);
- QString fontFamily(FontFamily);
- void resetFontFamily(FontFamily);
+ void setFontFamily(QWebEngineSettings::FontFamily, const QString &);
+ QString fontFamily(QWebEngineSettings::FontFamily);
+ void resetFontFamily(QWebEngineSettings::FontFamily);
- void setFontSize(FontSize type, int size);
- int fontSize(FontSize type) const;
- void resetFontSize(FontSize type);
+ void setFontSize(QWebEngineSettings::FontSize type, int size);
+ int fontSize(QWebEngineSettings::FontSize type) const;
+ void resetFontSize(QWebEngineSettings::FontSize type);
void setDefaultTextEncoding(const QString &encoding);
QString defaultTextEncoding() const;
- void setUnknownUrlSchemePolicy(UnknownUrlSchemePolicy policy);
- UnknownUrlSchemePolicy unknownUrlSchemePolicy() const;
+ void setUnknownUrlSchemePolicy(QWebEngineSettings::UnknownUrlSchemePolicy policy);
+ QWebEngineSettings::UnknownUrlSchemePolicy unknownUrlSchemePolicy() const;
+
+ void setImageAnimationPolicy(QWebEngineSettings::ImageAnimationPolicy policy);
+ QWebEngineSettings::ImageAnimationPolicy imageAnimationPolicy() const;
- void initDefaults();
void scheduleApply();
void scheduleApplyRecursively();
@@ -171,26 +77,28 @@ public:
bool getJavaScriptCanOpenWindowsAutomatically();
private:
+ void initDefaults();
void doApply();
- void applySettingsToWebPreferences(content::WebPreferences *);
- bool applySettingsToRendererPreferences(blink::mojom::RendererPreferences *);
+ void applySettingsToWebPreferences(blink::web_pref::WebPreferences *);
+ bool applySettingsToRendererPreferences(blink::RendererPreferences *);
void setWebContentsAdapter(WebContentsAdapter *adapter) { m_adapter = adapter; }
WebContentsAdapter* m_adapter;
- QHash<Attribute, bool> m_attributes;
- QHash<FontFamily, QString> m_fontFamilies;
- QHash<FontSize, int> m_fontSizes;
+ QHash<QWebEngineSettings::WebAttribute, bool> m_attributes;
+ QHash<QWebEngineSettings::FontFamily, QString> m_fontFamilies;
+ QHash<QWebEngineSettings::FontSize, int> m_fontSizes;
QString m_defaultEncoding;
- QScopedPointer<content::WebPreferences> webPreferences;
+ QScopedPointer<blink::web_pref::WebPreferences> webPreferences;
QTimer m_batchTimer;
WebEngineSettings *parentSettings;
QSet<WebEngineSettings *> childSettings;
- static QHash<Attribute, bool> s_defaultAttributes;
- static QHash<FontFamily, QString> s_defaultFontFamilies;
- static QHash<FontSize, int> s_defaultFontSizes;
- UnknownUrlSchemePolicy m_unknownUrlSchemePolicy;
+ static QHash<QWebEngineSettings::WebAttribute, bool> s_defaultAttributes;
+ static QHash<QWebEngineSettings::FontFamily, QString> s_defaultFontFamilies;
+ static QHash<QWebEngineSettings::FontSize, int> s_defaultFontSizes;
+ QWebEngineSettings::UnknownUrlSchemePolicy m_unknownUrlSchemePolicy;
+ QWebEngineSettings::ImageAnimationPolicy m_imageAnimationPolicy;
friend class WebContentsAdapter;
};
diff --git a/src/core/web_event_factory.cpp b/src/core/web_event_factory.cpp
index e1db69b16..617eea2d0 100644
--- a/src/core/web_event_factory.cpp
+++ b/src/core/web_event_factory.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
/*
* Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
@@ -71,6 +35,7 @@
#include "ui/events/keycodes/dom/keycode_converter.h"
#include "ui/events/keycodes/keyboard_code_conversion.h"
+#include "native_web_keyboard_event_qt.h"
#include "render_widget_host_view_qt_delegate.h"
#include <QtGui/private/qtgui-config_p.h>
@@ -82,7 +47,7 @@
#include <QMouseEvent>
#include <QStyleHints>
#if QT_CONFIG(tabletevent)
-#include <QTabletEvent>
+#include <QPointingDevice>
#endif
#include <QWheelEvent>
@@ -205,10 +170,20 @@ static quint32 nativeKeyCodeForKeyEvent(const QKeyEvent *ev)
// Cygwin/X, etc). Also evdev key codes are *not* supported for the same
// reason.
#if defined(Q_OS_WINDOWS)
- return keyboardDriver() == KeyboardDriver::Windows ? ev->nativeScanCode() : 0;
+ if (keyboardDriver() == KeyboardDriver::Windows) {
+ // see GetScanCodeFromLParam in events_win_utils.cc:
+ quint32 scancode = ev->nativeScanCode() & 0xff;
+ if (ev->nativeScanCode() & 0x100)
+ scancode |= 0xe000;
+ return scancode;
+ }
+ return 0;
#elif defined(Q_OS_MACOS)
return keyboardDriver() == KeyboardDriver::Cocoa ? ev->nativeVirtualKey() : 0;
#elif defined(Q_OS_LINUX)
+ // Do not set native code to menu key if it was mapped to something else.
+ if (ev->nativeScanCode() == 135 && ev->key() != Qt::Key_Menu)
+ return 0;
return keyboardDriver() == KeyboardDriver::Xkb ? ev->nativeScanCode() : 0;
#else
return 0; // 0 means unknown, KeyboardEvent.code will be empty string.
@@ -584,6 +559,8 @@ static int windowsKeyCodeForQtKey(int qtKey, bool isKeypad)
case Qt::Key_QuoteDbl:
return VK_OEM_7; // case '\'': case '"': return 0xDE;
// VK_OEM_8 (DF) Used for miscellaneous characters; it can vary by keyboard.
+ case Qt::Key_AltGr:
+ return 0xE1; // (E1) VK_OEM_AX = ui::VKEY_ALTGR see ui/events/keycodes/keyboard_codes_win.h
// VK_OEM_102 (E2) Windows 2000/XP: Either the angle bracket key or the backslash key on the RT 102-key keyboard
case Qt::Key_AudioRewind:
@@ -940,7 +917,6 @@ static ui::DomKey domKeyForQtKey(int qtKey)
return ui::DomKey::ZENKAKU;
case Qt::Key_Zenkaku_Hankaku:
return ui::DomKey::ZENKAKU_HANKAKU;
-#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
// Dead keys (ui/events/keycodes/keyboard_code_conversion_xkb.cc)
case Qt::Key_Dead_Grave:
return ui::DomKey::DeadKeyFromCombiningCharacter(0x0300);
@@ -1008,7 +984,6 @@ static ui::DomKey domKeyForQtKey(int qtKey)
return ui::DomKey::DeadKeyFromCombiningCharacter(0x00A4);
case Qt::Key_Dead_Greek:
return ui::DomKey::DeadKeyFromCombiningCharacter(0x037E);
-#endif
// General-Purpose Function Keys
case Qt::Key_F1:
return ui::DomKey::F1;
@@ -1227,8 +1202,12 @@ static WebMouseEvent::Button mouseButtonForEvent(T *event)
return WebMouseEvent::Button::kLeft;
else if (event->button() == Qt::RightButton)
return WebMouseEvent::Button::kRight;
- else if (event->button() == Qt::MidButton)
+ else if (event->button() == Qt::MiddleButton)
return WebMouseEvent::Button::kMiddle;
+ else if (event->button() == Qt::BackButton)
+ return WebMouseEvent::Button::kBack;
+ else if (event->button() == Qt::ForwardButton)
+ return WebMouseEvent::Button::kForward;
if (event->type() != QEvent::MouseMove && event->type() != QEvent::TabletMove)
return WebMouseEvent::Button::kNoButton;
@@ -1239,8 +1218,12 @@ static WebMouseEvent::Button mouseButtonForEvent(T *event)
return WebMouseEvent::Button::kLeft;
else if (event->buttons() & Qt::RightButton)
return WebMouseEvent::Button::kRight;
- else if (event->buttons() & Qt::MidButton)
+ else if (event->buttons() & Qt::MiddleButton)
return WebMouseEvent::Button::kMiddle;
+ else if (event->buttons() & Qt::BackButton)
+ return WebMouseEvent::Button::kBack;
+ else if (event->buttons() & Qt::ForwardButton)
+ return WebMouseEvent::Button::kForward;
return WebMouseEvent::Button::kNoButton;
}
@@ -1253,11 +1236,38 @@ static unsigned mouseButtonsModifiersForEvent(const T* event)
ret |= WebInputEvent::kLeftButtonDown;
if (event->buttons() & Qt::RightButton)
ret |= WebInputEvent::kRightButtonDown;
- if (event->buttons() & Qt::MidButton)
+ if (event->buttons() & Qt::MiddleButton)
ret |= WebInputEvent::kMiddleButtonDown;
+ if (event->buttons() & Qt::BackButton)
+ ret |= WebInputEvent::kBackButtonDown;
+ if (event->buttons() & Qt::ForwardButton)
+ ret |= WebInputEvent::kForwardButtonDown;
return ret;
}
+static WebInputEvent::Modifiers lockKeyModifiers(const quint32 nativeModifiers)
+{
+ unsigned result = 0;
+ if (keyboardDriver() == KeyboardDriver::Xkb) {
+ if (nativeModifiers & 0x42) /* Caps_Lock */
+ result |= WebInputEvent::kCapsLockOn;
+ if (nativeModifiers & 0x4d) /* Num_Lock */
+ result |= WebInputEvent::kNumLockOn;
+ } else if (keyboardDriver() == KeyboardDriver::Windows) {
+ if (nativeModifiers & 0x100) /* CapsLock */
+ result |= WebInputEvent::kCapsLockOn;
+ if (nativeModifiers & 0x200) /* NumLock */
+ result |= WebInputEvent::kNumLockOn;
+ if (nativeModifiers & 0x400) /* ScrollLock */
+ result |= WebInputEvent::kScrollLockOn;
+ } else if (keyboardDriver() == KeyboardDriver::Cocoa) {
+ if (nativeModifiers & 0x10000) /* NSEventModifierFlagCapsLock */
+ result |= WebInputEvent::kCapsLockOn;
+ }
+
+ return static_cast<WebInputEvent::Modifiers>(result);
+}
+
// If only a modifier key is pressed, Qt only reports the key code.
// But Chromium also expects the modifier being set.
static inline WebInputEvent::Modifiers modifierForKeyCode(int key)
@@ -1306,13 +1316,14 @@ static inline WebInputEvent::Modifiers modifiersForEvent(const QInputEvent* even
if (keyEvent->isAutoRepeat())
result |= WebInputEvent::kIsAutoRepeat;
result |= modifierForKeyCode(qtKeyForKeyEvent(keyEvent));
+ result |= lockKeyModifiers(keyEvent->nativeModifiers());
break;
}
default:
break;
}
- return (WebInputEvent::Modifiers)result;
+ return static_cast<WebInputEvent::Modifiers>(result);
}
static inline Qt::KeyboardModifiers keyboardModifiersForModifier(unsigned int modifier)
@@ -1348,6 +1359,10 @@ static inline Qt::MouseButtons mouseButtonsForModifier(unsigned int modifier)
buttons |= Qt::RightButton;
if (modifier & WebInputEvent::kMiddleButtonDown)
buttons |= Qt::MiddleButton;
+ if (modifier & WebInputEvent::kBackButtonDown)
+ buttons |= Qt::BackButton;
+ if (modifier & WebInputEvent::kForwardButtonDown)
+ buttons |= Qt::ForwardButton;
return buttons;
}
@@ -1356,36 +1371,36 @@ static WebInputEvent::Type webEventTypeForEvent(const QEvent* event)
switch (event->type()) {
case QEvent::MouseButtonPress:
case QEvent::TabletPress:
- return WebInputEvent::kMouseDown;
+ return WebInputEvent::Type::kMouseDown;
case QEvent::MouseButtonRelease:
case QEvent::TabletRelease:
- return WebInputEvent::kMouseUp;
+ return WebInputEvent::Type::kMouseUp;
case QEvent::Enter:
- return WebInputEvent::kMouseEnter;
+ return WebInputEvent::Type::kMouseEnter;
case QEvent::Leave:
- return WebInputEvent::kMouseLeave;
+ return WebInputEvent::Type::kMouseLeave;
case QEvent::MouseMove:
case QEvent::TabletMove:
- return WebInputEvent::kMouseMove;
+ return WebInputEvent::Type::kMouseMove;
case QEvent::Wheel:
- return WebInputEvent::kMouseWheel;
+ return WebInputEvent::Type::kMouseWheel;
case QEvent::KeyPress:
- return WebInputEvent::kRawKeyDown;
+ return WebInputEvent::Type::kRawKeyDown;
case QEvent::KeyRelease:
- return WebInputEvent::kKeyUp;
+ return WebInputEvent::Type::kKeyUp;
case QEvent::HoverMove:
- return WebInputEvent::kMouseMove;
+ return WebInputEvent::Type::kMouseMove;
case QEvent::TouchBegin:
- return WebInputEvent::kTouchStart;
+ return WebInputEvent::Type::kTouchStart;
case QEvent::TouchUpdate:
- return WebInputEvent::kTouchMove;
+ return WebInputEvent::Type::kTouchMove;
case QEvent::TouchEnd:
- return WebInputEvent::kTouchEnd;
+ return WebInputEvent::Type::kTouchEnd;
case QEvent::TouchCancel:
- return WebInputEvent::kTouchCancel;
+ return WebInputEvent::Type::kTouchCancel;
default:
Q_ASSERT(false);
- return WebInputEvent::kMouseMove;
+ return WebInputEvent::Type::kMouseMove;
}
}
@@ -1393,12 +1408,14 @@ static WebInputEvent::Type webEventTypeForEvent(const QEvent* event)
static WebPointerProperties::PointerType pointerTypeForTabletEvent(const QTabletEvent *ev)
{
switch (ev->pointerType()) {
- case QTabletEvent::UnknownPointer:
+ case QPointingDevice::PointerType::Unknown:
return WebPointerProperties::PointerType::kUnknown;
- case QTabletEvent::Pen:
+ case QPointingDevice::PointerType::Pen:
return WebPointerProperties::PointerType::kPen;
- case QTabletEvent::Eraser:
+ case QPointingDevice::PointerType::Eraser:
return WebPointerProperties::PointerType::kEraser;
+ case QPointingDevice::PointerType::Finger:
+ return WebPointerProperties::PointerType::kTouch;
default:
return WebPointerProperties::PointerType::kMouse;
}
@@ -1408,8 +1425,8 @@ static WebPointerProperties::PointerType pointerTypeForTabletEvent(const QTablet
WebMouseEvent WebEventFactory::toWebMouseEvent(QMouseEvent *ev)
{
WebMouseEvent webKitEvent(webEventTypeForEvent(ev),
- WebFloatPoint(ev->x(), ev->y()),
- WebFloatPoint(ev->globalX(), ev->globalY()),
+ gfx::PointF(ev->position().x(), ev->position().y()),
+ gfx::PointF(ev->globalPosition().x(), ev->globalPosition().y()),
mouseButtonForEvent<QMouseEvent>(ev),
0,
modifiersForEvent(ev),
@@ -1427,9 +1444,11 @@ WebMouseEvent WebEventFactory::toWebMouseEvent(QHoverEvent *ev)
webKitEvent.SetModifiers(modifiersForEvent(ev));
webKitEvent.SetType(webEventTypeForEvent(ev));
- webKitEvent.SetPositionInWidget(ev->pos().x(), ev->pos().y());
- webKitEvent.movement_x = ev->pos().x() - ev->oldPos().x();
- webKitEvent.movement_y = ev->pos().y() - ev->oldPos().y();
+ webKitEvent.SetPositionInWidget(ev->position().x(), ev->position().y());
+ webKitEvent.SetPositionInScreen(ev->globalPosition().x(), ev->globalPosition().y());
+ webKitEvent.movement_x = ev->position().x() - ev->oldPos().x();
+ webKitEvent.movement_y = ev->position().y() - ev->oldPos().y();
+ webKitEvent.is_raw_movement_event = true;
webKitEvent.pointer_type = WebPointerProperties::PointerType::kMouse;
return webKitEvent;
@@ -1439,8 +1458,8 @@ WebMouseEvent WebEventFactory::toWebMouseEvent(QHoverEvent *ev)
WebMouseEvent WebEventFactory::toWebMouseEvent(QTabletEvent *ev)
{
WebMouseEvent webKitEvent(webEventTypeForEvent(ev),
- WebFloatPoint(ev->x(), ev->y()),
- WebFloatPoint(ev->globalX(), ev->globalY()),
+ gfx::PointF(ev->position().x(), ev->position().y()),
+ gfx::PointF(ev->globalPosition().x(), ev->globalPosition().y()),
mouseButtonForEvent<QTabletEvent>(ev),
0,
modifiersForEvent(ev),
@@ -1462,42 +1481,48 @@ WebMouseEvent WebEventFactory::toWebMouseEvent(QEvent *ev)
WebMouseEvent webKitEvent;
webKitEvent.SetTimeStamp(base::TimeTicks::Now());
- webKitEvent.SetType(WebInputEvent::kMouseLeave);
+ webKitEvent.SetType(WebInputEvent::Type::kMouseLeave);
return webKitEvent;
}
-#ifndef QT_NO_GESTURES
+#if QT_CONFIG(gestures)
WebGestureEvent WebEventFactory::toWebGestureEvent(QNativeGestureEvent *ev)
{
WebGestureEvent webKitEvent;
webKitEvent.SetTimeStamp(base::TimeTicks::Now());
webKitEvent.SetModifiers(modifiersForEvent(ev));
- webKitEvent.SetPositionInWidget(WebFloatPoint(ev->localPos().x(),
- ev->localPos().y()));
+ webKitEvent.SetPositionInWidget(gfx::PointF(ev->position().x(),
+ ev->position().y()));
- webKitEvent.SetPositionInScreen(WebFloatPoint(ev->screenPos().x(),
- ev->screenPos().y()));
+ webKitEvent.SetPositionInScreen(gfx::PointF(ev->globalPosition().x(),
+ ev->globalPosition().y()));
webKitEvent.SetSourceDevice(blink::WebGestureDevice::kTouchpad);
Qt::NativeGestureType gestureType = ev->gestureType();
switch (gestureType) {
case Qt::ZoomNativeGesture:
- webKitEvent.SetType(WebInputEvent::kGesturePinchUpdate);
+ webKitEvent.SetType(WebInputEvent::Type::kGesturePinchUpdate);
webKitEvent.data.pinch_update.scale = static_cast<float>(ev->value() + 1.0);
break;
case Qt::SmartZoomNativeGesture:
- webKitEvent.SetType(WebInputEvent::kGestureDoubleTap);
+ webKitEvent.SetType(WebInputEvent::Type::kGestureDoubleTap);
webKitEvent.data.tap.tap_count = 1;
break;
case Qt::BeginNativeGesture:
+ webKitEvent.SetType(WebInputEvent::Type::kGesturePinchBegin);
+ webKitEvent.SetNeedsWheelEvent(true);
+ break;
case Qt::EndNativeGesture:
+ webKitEvent.SetType(WebInputEvent::Type::kGesturePinchEnd);
+ webKitEvent.SetNeedsWheelEvent(true);
+ break;
case Qt::RotateNativeGesture:
case Qt::PanNativeGesture:
case Qt::SwipeNativeGesture:
// Not implemented by Chromium for now.
- webKitEvent.SetType(blink::WebInputEvent::kUndefined);
+ webKitEvent.SetType(blink::WebInputEvent::Type::kUndefined);
break;
}
@@ -1520,20 +1545,19 @@ static QPoint getWheelEventDelta(const blink::WebGestureEvent &webEvent)
{
static const float cDefaultQtScrollStep = 20.f;
static const int wheelScrollLines = QGuiApplication::styleHints()->wheelScrollLines();
- return QPoint(webEvent.data.scroll_update.delta_x * QWheelEvent::DefaultDeltasPerStep / (wheelScrollLines * cDefaultQtScrollStep),
- webEvent.data.scroll_update.delta_y * QWheelEvent::DefaultDeltasPerStep / (wheelScrollLines * cDefaultQtScrollStep));
+ static const float deltasPerStep = static_cast<float>(QWheelEvent::DefaultDeltasPerStep);
+ return QPoint(webEvent.data.scroll_update.delta_x * deltasPerStep / (wheelScrollLines * cDefaultQtScrollStep),
+ webEvent.data.scroll_update.delta_y * deltasPerStep / (wheelScrollLines * cDefaultQtScrollStep));
}
blink::WebMouseWheelEvent::Phase toBlinkPhase(QWheelEvent *ev)
{
switch (ev->phase()) {
case Qt::NoScrollPhase:
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0))
case Qt::ScrollMomentum:
-#endif
return blink::WebMouseWheelEvent::kPhaseNone;
case Qt::ScrollBegin:
- return ev->angleDelta().isNull() ? blink::WebMouseWheelEvent::kPhaseMayBegin : blink::WebMouseWheelEvent::kPhaseBegan;
+ return blink::WebMouseWheelEvent::kPhaseBegan;
case Qt::ScrollUpdate:
return blink::WebMouseWheelEvent::kPhaseChanged;
case Qt::ScrollEnd:
@@ -1543,29 +1567,41 @@ blink::WebMouseWheelEvent::Phase toBlinkPhase(QWheelEvent *ev)
return blink::WebMouseWheelEvent::kPhaseNone;
}
+blink::WebMouseWheelEvent::Phase getMomentumPhase(QWheelEvent *ev)
+{
+ switch (ev->phase()) {
+ case Qt::ScrollMomentum:
+ return blink::WebMouseWheelEvent::kPhaseBegan;
+ case Qt::ScrollEnd:
+ return blink::WebMouseWheelEvent::kPhaseEnded;
+ case Qt::NoScrollPhase:
+ case Qt::ScrollBegin:
+ case Qt::ScrollUpdate:
+ return blink::WebMouseWheelEvent::kPhaseNone;
+ }
+ Q_UNREACHABLE();
+ return blink::WebMouseWheelEvent::kPhaseNone;
+}
+
blink::WebMouseWheelEvent WebEventFactory::toWebWheelEvent(QWheelEvent *ev)
{
WebMouseWheelEvent webEvent;
webEvent.SetType(webEventTypeForEvent(ev));
webEvent.SetModifiers(modifiersForEvent(ev));
webEvent.SetTimeStamp(base::TimeTicks::Now());
-#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
- webEvent.SetPositionInWidget(ev->x(), ev->y());
- webEvent.SetPositionInScreen(ev->globalX(), ev->globalY());
-#else
webEvent.SetPositionInWidget(static_cast<float>(ev->position().x()),
static_cast<float>(ev->position().y()));
webEvent.SetPositionInScreen(static_cast<float>(ev->globalPosition().x()),
static_cast<float>(ev->globalPosition().y()));
-#endif
- webEvent.wheel_ticks_x = static_cast<float>(ev->angleDelta().x()) / QWheelEvent::DefaultDeltasPerStep;
- webEvent.wheel_ticks_y = static_cast<float>(ev->angleDelta().y()) / QWheelEvent::DefaultDeltasPerStep;
+ webEvent.wheel_ticks_x = ev->angleDelta().x() / static_cast<float>(QWheelEvent::DefaultDeltasPerStep);
+ webEvent.wheel_ticks_y = ev->angleDelta().y() / static_cast<float>(QWheelEvent::DefaultDeltasPerStep);
webEvent.phase = toBlinkPhase(ev);
#if defined(Q_OS_DARWIN)
// PrecisePixel is a macOS term meaning it is a system scroll gesture, see qnsview_mouse.mm
+ webEvent.momentum_phase = getMomentumPhase(ev);
if (ev->source() == Qt::MouseEventSynthesizedBySystem)
- webEvent.delta_units = ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
+ webEvent.delta_units = ui::ScrollGranularity::kScrollByPrecisePixel;
#endif
setBlinkWheelEventDelta(webEvent);
@@ -1582,38 +1618,36 @@ bool WebEventFactory::coalesceWebWheelEvent(blink::WebMouseWheelEvent &webEvent,
if (toBlinkPhase(ev) != webEvent.phase)
return false;
#if defined(Q_OS_DARWIN)
- if ((webEvent.delta_units == ui::input_types::ScrollGranularity::kScrollByPrecisePixel)
+ if (getMomentumPhase(ev) != webEvent.momentum_phase)
+ return false;
+
+ if ((webEvent.delta_units == ui::ScrollGranularity::kScrollByPrecisePixel)
!= (ev->source() == Qt::MouseEventSynthesizedBySystem))
return false;
#endif
webEvent.SetTimeStamp(base::TimeTicks::Now());
-#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
- webEvent.SetPositionInWidget(ev->x(), ev->y());
- webEvent.SetPositionInScreen(ev->globalX(), ev->globalY());
-#else
webEvent.SetPositionInWidget(static_cast<float>(ev->position().x()),
static_cast<float>(ev->position().y()));
webEvent.SetPositionInScreen(static_cast<float>(ev->globalPosition().x()),
static_cast<float>(ev->globalPosition().y()));
-#endif
- webEvent.wheel_ticks_x += static_cast<float>(ev->angleDelta().x()) / QWheelEvent::DefaultDeltasPerStep;
- webEvent.wheel_ticks_y += static_cast<float>(ev->angleDelta().y()) / QWheelEvent::DefaultDeltasPerStep;
+ webEvent.wheel_ticks_x = ev->angleDelta().x() / static_cast<float>(QWheelEvent::DefaultDeltasPerStep);
+ webEvent.wheel_ticks_y = ev->angleDelta().y() / static_cast<float>(QWheelEvent::DefaultDeltasPerStep);
setBlinkWheelEventDelta(webEvent);
return true;
}
-static QPointF toQt(blink::WebFloatPoint p)
+static QPointF toQt(gfx::PointF p)
{
- return QPointF(p.x, p.y);
+ return QPointF(p.x(), p.y());
}
void WebEventFactory::sendUnhandledWheelEvent(const blink::WebGestureEvent &event,
RenderWidgetHostViewQtDelegate *delegate)
{
- Q_ASSERT(event.GetType() == blink::WebInputEvent::kGestureScrollUpdate);
+ Q_ASSERT(event.GetType() == blink::WebInputEvent::Type::kGestureScrollUpdate);
QWheelEvent ev(toQt(event.PositionInWidget()),
toQt(event.PositionInScreen()),
@@ -1627,13 +1661,17 @@ void WebEventFactory::sendUnhandledWheelEvent(const blink::WebGestureEvent &even
content::NativeWebKeyboardEvent WebEventFactory::toWebKeyboardEvent(QKeyEvent *ev)
{
- content::NativeWebKeyboardEvent webKitEvent(reinterpret_cast<gfx::NativeEvent>(ev));
+ content::NativeWebKeyboardEvent webKitEvent(ToNativeEvent(ev));
webKitEvent.SetTimeStamp(base::TimeTicks::Now());
- webKitEvent.SetModifiers(modifiersForEvent(ev));
+ bool isBackTabWithoutModifier =
+ ev->key() == Qt::Key_Backtab && ev->modifiers() == Qt::NoModifier;
+ webKitEvent.SetModifiers(isBackTabWithoutModifier ? WebInputEvent::kShiftKey
+ : modifiersForEvent(ev));
webKitEvent.SetType(webEventTypeForEvent(ev));
int qtKey = qtKeyForKeyEvent(ev);
- Qt::KeyboardModifiers qtModifiers = qtModifiersForEvent(ev);
+ Qt::KeyboardModifiers qtModifiers =
+ isBackTabWithoutModifier ? Qt::ShiftModifier : qtModifiersForEvent(ev);
QString qtText = qtTextForKeyEvent(ev, qtKey, qtModifiers);
webKitEvent.native_key_code = nativeKeyCodeForKeyEvent(ev);
@@ -1668,10 +1706,12 @@ content::NativeWebKeyboardEvent WebEventFactory::toWebKeyboardEvent(QKeyEvent *e
ui::DomCodeToUsLayoutKeyboardCode(static_cast<ui::DomCode>(webKitEvent.dom_code));
const ushort* text = qtText.utf16();
- size_t textSize = std::min(sizeof(webKitEvent.text), size_t(qtText.length() * 2));
- memcpy(&webKitEvent.text, text, textSize);
- memcpy(&webKitEvent.unmodified_text, text, textSize);
-
+ size_t size = std::char_traits<char16_t>::length((char16_t *)text);
+ if (size <= blink::WebKeyboardEvent::kTextLengthCap - 1) { // should be null terminated
+ size_t textSize = std::min(sizeof(webKitEvent.text), size * sizeof(char16_t));
+ memcpy(&webKitEvent.text, text, textSize);
+ memcpy(&webKitEvent.unmodified_text, text, textSize);
+ }
if (webKitEvent.windows_key_code == VK_RETURN) {
// This is the same behavior as GTK:
// We need to treat the enter key as a key press of character \r. This
diff --git a/src/core/web_event_factory.h b/src/core/web_event_factory.h
index 390502a9d..53ebfb509 100644
--- a/src/core/web_event_factory.h
+++ b/src/core/web_event_factory.h
@@ -1,64 +1,28 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef WEB_EVENT_FACTORY_H
#define WEB_EVENT_FACTORY_H
-#include "content/public/browser/native_web_keyboard_event.h"
-#ifndef QT_NO_GESTURES
-#include "third_party/blink/public/platform/web_gesture_event.h"
-#endif
-#include "third_party/blink/public/platform/web_mouse_event.h"
-#include "third_party/blink/public/platform/web_mouse_wheel_event.h"
+#include "QtGui/qtguiglobal.h"
-#include <QtGlobal>
+#include "content/public/common/input/native_web_keyboard_event.h"
+#if QT_CONFIG(gestures)
+#include "third_party/blink/public/common/input/web_gesture_event.h"
+#endif
+#include "third_party/blink/public/common/input/web_mouse_event.h"
+#include "third_party/blink/public/common/input/web_mouse_wheel_event.h"
QT_BEGIN_NAMESPACE
class QEvent;
class QHoverEvent;
class QKeyEvent;
class QMouseEvent;
-#ifndef QT_NO_TABLETEVENT
+#if QT_CONFIG(tabletevent)
class QTabletEvent;
#endif
class QWheelEvent;
-#ifndef QT_NO_GESTURES
+#if QT_CONFIG(gestures)
class QNativeGestureEvent;
#endif
QT_END_NAMESPACE
@@ -72,11 +36,11 @@ class WebEventFactory {
public:
static blink::WebMouseEvent toWebMouseEvent(QMouseEvent *);
static blink::WebMouseEvent toWebMouseEvent(QHoverEvent *);
-#ifndef QT_NO_TABLETEVENT
+#if QT_CONFIG(tabletevent)
static blink::WebMouseEvent toWebMouseEvent(QTabletEvent *);
#endif
static blink::WebMouseEvent toWebMouseEvent(QEvent *);
-#ifndef QT_NO_GESTURES
+#if QT_CONFIG(gestures)
static blink::WebGestureEvent toWebGestureEvent(QNativeGestureEvent *);
#endif
static blink::WebMouseWheelEvent toWebWheelEvent(QWheelEvent *);
diff --git a/src/core/web_usb_detector_qt.cpp b/src/core/web_usb_detector_qt.cpp
new file mode 100644
index 000000000..511ac6801
--- /dev/null
+++ b/src/core/web_usb_detector_qt.cpp
@@ -0,0 +1,45 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+// based on chrome/browser/usb/web_usb_detector.cc
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "web_usb_detector_qt.h"
+
+#include "qtwebenginecoreglobal_p.h"
+
+#include "content/public/browser/device_service.h"
+#include "device/base/features.h"
+#include "services/device/public/mojom/usb_device.mojom.h"
+
+WebUsbDetectorQt::WebUsbDetectorQt() = default;
+
+WebUsbDetectorQt::~WebUsbDetectorQt() = default;
+
+void WebUsbDetectorQt::Initialize()
+{
+ if (!m_deviceManager) {
+ // Receive mojo::Remote<UsbDeviceManager> from DeviceService.
+ content::GetDeviceService().BindUsbDeviceManager(
+ m_deviceManager.BindNewPipeAndPassReceiver());
+ }
+ DCHECK(m_deviceManager);
+
+ // Listen for added/removed device events.
+ DCHECK(!m_clientReceiver.is_bound());
+ m_deviceManager->SetClient(m_clientReceiver.BindNewEndpointAndPassRemote());
+}
+
+void WebUsbDetectorQt::OnDeviceAdded(device::mojom::UsbDeviceInfoPtr device_info)
+{
+ Q_UNUSED(device_info);
+ QT_NOT_YET_IMPLEMENTED
+}
+
+void WebUsbDetectorQt::OnDeviceRemoved(device::mojom::UsbDeviceInfoPtr device_info)
+{
+ Q_UNUSED(device_info);
+ QT_NOT_YET_IMPLEMENTED
+}
diff --git a/src/core/web_usb_detector_qt.h b/src/core/web_usb_detector_qt.h
new file mode 100644
index 000000000..b9ab5e4bb
--- /dev/null
+++ b/src/core/web_usb_detector_qt.h
@@ -0,0 +1,34 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef WEB_USB_DETECTOR_QT_H
+#define WEB_USB_DETECTOR_QT_H
+
+#include "mojo/public/cpp/bindings/associated_receiver.h"
+#include "mojo/public/cpp/bindings/pending_remote.h"
+#include "mojo/public/cpp/bindings/remote.h"
+#include "services/device/public/mojom/usb_manager.mojom.h"
+#include "services/device/public/mojom/usb_manager_client.mojom.h"
+#include "url/gurl.h"
+
+class WebUsbDetectorQt : public device::mojom::UsbDeviceManagerClient
+{
+public:
+ WebUsbDetectorQt();
+ ~WebUsbDetectorQt() override;
+
+ void Initialize();
+
+private:
+ // device::mojom::UsbDeviceManagerClient implementation.
+ void OnDeviceAdded(device::mojom::UsbDeviceInfoPtr device_info) override;
+ void OnDeviceRemoved(device::mojom::UsbDeviceInfoPtr device_info) override;
+
+ // Connection to |device_manager_instance_|.
+ mojo::Remote<device::mojom::UsbDeviceManager> m_deviceManager;
+ mojo::AssociatedReceiver<device::mojom::UsbDeviceManagerClient> m_clientReceiver { this };
+
+ base::WeakPtrFactory<WebUsbDetectorQt> m_weakFactory { this };
+};
+
+#endif // WEB_USB_DETECTOR_QT_H
diff --git a/src/gn/CMakeLists.txt b/src/gn/CMakeLists.txt
new file mode 100644
index 000000000..0fe3e4e05
--- /dev/null
+++ b/src/gn/CMakeLists.txt
@@ -0,0 +1,80 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+
+cmake_minimum_required(VERSION 3.19)
+
+project(Gn
+ DESCRIPTION "Meta-build system"
+ HOMEPAGE_URL "https://gn.googlesource.com/gn/"
+ LANGUAGES CXX C
+)
+
+if(NOT DEFINED WEBENGINE_ROOT_SOURCE_DIR)
+ set(path_mode REALPATH)
+ if(APPLE AND QT_ALLOW_SYMLINK_IN_PATHS)
+ set(path_mode ABSOLUTE)
+ endif()
+
+ get_filename_component(WEBENGINE_ROOT_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../.." ${path_mode})
+endif()
+
+include(${WEBENGINE_ROOT_SOURCE_DIR}/.cmake.conf)
+
+set(GN_SOURCE_DIR ${WEBENGINE_ROOT_SOURCE_DIR}/src/3rdparty/gn)
+set(GN_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
+set(GN_LINKER ${CMAKE_CXX_COMPILER})
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${WEBENGINE_ROOT_SOURCE_DIR}/cmake")
+
+find_package(Python3 REQUIRED)
+find_package(Ninja 1.7.2 REQUIRED)
+
+if(WIN32)
+ set(GN_EXECUTABLE gn.exe)
+ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND NOT MINGW)
+ # Use lld-link instead of clang-cl.
+ set(GN_LINKER ${CMAKE_LINKER})
+ endif()
+else()
+ set(GN_EXECUTABLE gn)
+endif()
+
+file(MAKE_DIRECTORY ${GN_BINARY_DIR})
+
+if((UNIX AND NOT APPLE) AND
+ (CMAKE_CXX_COMPILER_ID STREQUAL GNU OR
+ CMAKE_CXX_COMPILER_ID STREQUAL Clang))
+ set(platform linux)
+elseif(MSVC)
+ set(platform msvc)
+elseif(MINGW)
+ set(platform mingw)
+elseif(APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL AppleClang)
+ set(platform darwin)
+else()
+ message(FATAL_ERROR "Unsupported gn platform !")
+endif()
+
+add_custom_command(
+ OUTPUT ${GN_EXECUTABLE}
+ WORKING_DIRECTORY ${GN_BINARY_DIR}
+ COMMAND ${Python3_EXECUTABLE} ${GN_SOURCE_DIR}/build/gen.py
+ --no-last-commit-position
+ --out-path ${GN_BINARY_DIR}/$<CONFIG>
+ --cc ${CMAKE_C_COMPILER}
+ --cxx ${CMAKE_CXX_COMPILER}
+ --ld ${GN_LINKER}
+ --platform ${platform}
+ --ar ${CMAKE_AR}
+ --qt-version "${QT_REPO_MODULE_VERSION}.qtwebengine.qt.io"
+ $<$<PLATFORM_ID:Darwin>:--isysroot>
+ $<$<PLATFORM_ID:Darwin>:${CMAKE_OSX_SYSROOT}>
+ COMMAND Ninja::ninja -C ${GN_BINARY_DIR}/$<CONFIG> ${GN_EXECUTABLE}
+ VERBATIM
+ USES_TERMINAL
+ COMMAND_EXPAND_LISTS
+)
+add_custom_target(Gn ALL DEPENDS ${GN_EXECUTABLE})
+install(PROGRAMS ${GN_BINARY_DIR}/$<CONFIG>/${GN_EXECUTABLE}
+ DESTINATION bin
+)
diff --git a/src/host/BUILD.toolchain.gn.in b/src/host/BUILD.toolchain.gn.in
new file mode 100644
index 000000000..1beb9ee6d
--- /dev/null
+++ b/src/host/BUILD.toolchain.gn.in
@@ -0,0 +1,18 @@
+import("//build/config/sysroot.gni")
+import("//build/toolchain/gcc_toolchain.gni")
+gcc_toolchain("@GN_TOOLCHAIN@") {
+ cc = "@CMAKE_C_COMPILER@"
+ cxx = "@CMAKE_CXX_COMPILER@"
+ ld = "@CMAKE_CXX_COMPILER@"
+ ar = "@CMAKE_AR@"
+ nm = "@CMAKE_NM@"
+ extra_cppflags = ""
+ toolchain_args = {
+ current_os = "@GN_OS@"
+ current_cpu = "@GN_CPU@"
+ v8_current_cpu = "@GN_V8_CPU@"
+ is_clang = @GN_IS_CLANG@
+ is_mingw = @GN_IS_MINGW@
+ use_gold = false
+ }
+}
diff --git a/src/host/CMakeLists.txt b/src/host/CMakeLists.txt
new file mode 100644
index 000000000..d40275217
--- /dev/null
+++ b/src/host/CMakeLists.txt
@@ -0,0 +1,68 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.19)
+
+if(NOT DEFINED WEBENGINE_ROOT_SOURCE_DIR)
+ get_filename_component(WEBENGINE_ROOT_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../.." REALPATH)
+endif()
+if (NOT DEFINED WEBENGINE_ROOT_BUILD_DIR)
+ get_filename_component(WEBENGINE_ROOT_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/../.." REALPATH)
+endif()
+
+include(${WEBENGINE_ROOT_SOURCE_DIR}/.cmake.conf)
+include(${WEBENGINE_ROOT_SOURCE_DIR}/cmake/Functions.cmake)
+
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${WEBENGINE_ROOT_SOURCE_DIR}/cmake")
+
+project(QtWebEngineConfigure
+ VERSION "${QT_REPO_MODULE_VERSION}"
+ LANGUAGES CXX C)
+
+find_package(Qt6 6.5 CONFIG REQUIRED COMPONENTS BuildInternals Core)
+qt_internal_project_setup()
+get_gn_arch(target_arch ${GN_TARGET_CPU})
+get_gn_arch(host_arch ${TEST_architecture_arch})
+get_v8_arch(v8_arch ${target_arch} ${host_arch})
+
+set(buildDir ${CMAKE_CURRENT_BINARY_DIR})
+configure_gn_toolchain(host ${host_arch} ${host_arch}
+ ${WEBENGINE_ROOT_SOURCE_DIR}/src/host/BUILD.toolchain.gn.in
+ ${buildDir}/host_toolchain
+)
+configure_gn_toolchain(v8 ${v8_arch} ${target_arch}
+ ${WEBENGINE_ROOT_SOURCE_DIR}/src/host/BUILD.toolchain.gn.in
+ ${buildDir}/v8_toolchain)
+
+if(QT_FEATURE_qtwebengine_build)
+ install(FILES ${buildDir}/host_toolchain/BUILD.gn
+ DESTINATION ${WEBENGINE_ROOT_BUILD_DIR}/src/core/host_toolchain
+ )
+ install(FILES ${buildDir}/v8_toolchain/BUILD.gn
+ DESTINATION ${WEBENGINE_ROOT_BUILD_DIR}/src/core/v8_toolchain
+ )
+endif()
+if(QT_FEATURE_qtpdf_build)
+ install(FILES ${buildDir}/host_toolchain/BUILD.gn
+ DESTINATION ${WEBENGINE_ROOT_BUILD_DIR}/src/pdf/host_toolchain
+ )
+ install(FILES ${buildDir}/v8_toolchain/BUILD.gn
+ DESTINATION ${WEBENGINE_ROOT_BUILD_DIR}/src/pdf/v8_toolchain
+ )
+endif()
+
+# TODO: this could be run as part of main configure with execute_process
+# Skip for qtpdf(android)
+
+if(CMAKE_CXX_COMPILER_ID STREQUAL GNU AND TEST_architecture_arch STREQUAL "x86_64"
+ AND GN_TARGET_CPU STREQUAL "arm" AND NOT MINGW AND NOT ANDROID)
+ try_compile(
+ has32HostCompiler
+ "${CMAKE_CURRENT_BINARY_DIR}/config.tests/hostcompiler"
+ "${CMAKE_CURRENT_SOURCE_DIR}/config.tests/hostcompiler"
+ hostcompiler
+ )
+ if(NOT has32HostCompiler)
+ MESSAGE(FATAL_ERROR "Compiler does not support 32bit compilation")
+ endif()
+endif()
diff --git a/src/host/config.tests/hostcompiler/CMakeLists.txt b/src/host/config.tests/hostcompiler/CMakeLists.txt
new file mode 100644
index 000000000..f36886d0a
--- /dev/null
+++ b/src/host/config.tests/hostcompiler/CMakeLists.txt
@@ -0,0 +1,11 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+project(arch LANGUAGES CXX)
+
+add_executable(host_compiler_test)
+set_property(TARGET host_compiler_test PROPERTY MACOSX_BUNDLE FALSE)
+target_sources(host_compiler_test PRIVATE main.cpp)
+target_compile_options(host_compiler_test PRIVATE -m32)
+target_link_options(host_compiler_test PRIVATE -m32)
diff --git a/src/host/config.tests/hostcompiler/main.cpp b/src/host/config.tests/hostcompiler/main.cpp
new file mode 100644
index 000000000..9cd16a2e3
--- /dev/null
+++ b/src/host/config.tests/hostcompiler/main.cpp
@@ -0,0 +1,9 @@
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: BSD-3-Clause
+
+#include <stdio.h>
+int main()
+{
+ printf("This works\n");
+ return 0;
+}
diff --git a/src/ninja/CMakeLists.txt b/src/ninja/CMakeLists.txt
new file mode 100644
index 000000000..0258b3da9
--- /dev/null
+++ b/src/ninja/CMakeLists.txt
@@ -0,0 +1,40 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+
+cmake_minimum_required(VERSION 3.19)
+
+project(Ninja
+ DESCRIPTION "Ninja Build Tool"
+ HOMEPAGE_URL "https://ninja-build.org/"
+ LANGUAGES CXX C
+)
+
+set(NINJA_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../3rdparty/ninja)
+set(NINJA_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
+
+find_package(Python3 REQUIRED)
+
+if(WIN32)
+ set(NINJA_EXECUTABLE ninja.exe)
+else()
+ set(NINJA_EXECUTABLE ninja)
+endif()
+
+file(MAKE_DIRECTORY ${NINJA_BINARY_DIR})
+
+add_custom_command(
+ OUTPUT ${NINJA_EXECUTABLE}
+ WORKING_DIRECTORY ${NINJA_BINARY_DIR}
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${NINJA_BINARY_DIR}/$<CONFIG>
+ COMMAND ${CMAKE_COMMAND} -E chdir ${NINJA_BINARY_DIR}/$<CONFIG>
+ ${Python3_EXECUTABLE} ${NINJA_SOURCE_DIR}/configure.py --bootstrap
+ USES_TERMINAL
+ VERBATIM
+)
+add_custom_target(Ninja ALL DEPENDS ${NINJA_EXECUTABLE})
+install(FILES ${NINJA_BINARY_DIR}/$<CONFIG>/${NINJA_EXECUTABLE}
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
+ DESTINATION bin
+)
+
diff --git a/src/pdf/CMakeLists.txt b/src/pdf/CMakeLists.txt
new file mode 100644
index 000000000..4a54b816e
--- /dev/null
+++ b/src/pdf/CMakeLists.txt
@@ -0,0 +1,260 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.19)
+find_package(Ninja 1.7.2 REQUIRED)
+find_package(Nodejs 14.19 REQUIRED)
+find_package(PkgConfig)
+if(PkgConfig_FOUND)
+ create_pkg_config_host_wrapper(${CMAKE_CURRENT_BINARY_DIR})
+endif()
+
+set(buildDir "${CMAKE_CURRENT_BINARY_DIR}")
+
+##
+# PDF MODULE
+##
+
+qt_internal_add_module(Pdf
+ SOURCES
+ qpdfbookmarkmodel.cpp qpdfbookmarkmodel.h
+ qpdfdocument.cpp qpdfdocument.h qpdfdocument_p.h
+ qpdfdocumentrenderoptions.h
+ qpdffile.cpp qpdffile_p.h
+ qpdflink.cpp qpdflink.h qpdflink_p.h
+ qpdflinkmodel.cpp qpdflinkmodel.h qpdflinkmodel_p.h
+ qpdfpagenavigator.cpp qpdfpagenavigator.h
+ qpdfpagerenderer.cpp qpdfpagerenderer.h
+ qpdfsearchmodel.cpp qpdfsearchmodel.h qpdfsearchmodel_p.h
+ qpdfselection.cpp qpdfselection.h qpdfselection_p.h
+ qtpdfglobal.h
+ INCLUDE_DIRECTORIES
+ ../3rdparty/chromium
+ DEFINES
+ QT_BUILD_PDF_LIB
+ LIBRARIES
+ Qt::CorePrivate
+ Qt::Network
+ PUBLIC_LIBRARIES
+ Qt::Core
+ Qt::Gui
+ GENERATE_CPP_EXPORTS
+)
+
+add_subdirectory(plugins/imageformats/pdf)
+
+get_install_config(config)
+get_architectures(archs)
+list(GET archs 0 arch)
+
+##
+# PDF DOCS
+##
+
+qt_internal_add_docs(Pdf
+ doc/qtpdf.qdocconf
+)
+
+add_code_attributions_target(
+ TARGET generate_pdf_attributions
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/pdf_attributions.qdoc
+ GN_TARGET :QtPdf
+ FILE_TEMPLATE doc/about_credits.tmpl
+ ENTRY_TEMPLATE doc/about_credits_entry.tmpl
+ BUILDDIR ${buildDir}/${config}/${arch}
+)
+add_dependencies(generate_pdf_attributions run_pdf_GnDone)
+add_dependencies(prepare_docs_Pdf generate_pdf_attributions)
+
+##
+# TOOLCHAIN SETUP
+##
+
+if(LINUX OR MINGW OR ANDROID)
+ setup_toolchains()
+endif()
+
+##
+# GN BUILD SETUP
+##
+
+addSyncTargets(pdf)
+
+get_configs(configs)
+get_architectures(archs)
+foreach(arch ${archs})
+ foreach(config ${configs})
+
+ ##
+ # BULID.gn SETUP
+ ##
+
+ set(buildGn pdf_${config}_${arch})
+ add_gn_target(${buildGn} ${config} ${arch}
+ SOURCES DEFINES CXX_COMPILE_OPTIONS C_COMPILE_OPTIONS
+ INCLUDES MOC_PATH PNG_INCLUDES JPEG_INCLUDES HARFBUZZ_INCLUDES
+ FREETYPE_INCLUDES ZLIB_INCLUDES
+ )
+ resolve_target_includes(gnIncludes Pdf)
+ get_forward_declaration_macro(forwardDeclarationMacro)
+
+ extend_gn_target(${buildGn}
+ INCLUDES
+ ${gnIncludes}
+ )
+
+ ##
+ # GN PARAMETERS
+ ##
+
+ unset(gnArgArg)
+ append_build_type_setup(gnArgArg)
+ append_compiler_linker_sdk_setup(gnArgArg)
+ append_sanitizer_setup(gnArgArg)
+ append_toolchain_setup(gnArgArg)
+ append_pkg_config_setup(gnArgArg)
+
+ list(APPEND gnArgArg
+ qtwebengine_target="${buildDir}/${config}/${arch}:QtPdf"
+ qt_libpng_config="${buildDir}/${config}/${arch}:qt_libpng_config"
+ qt_libjpeg_config="${buildDir}/${config}/${arch}:qt_libjpeg_config"
+ qt_harfbuzz_config="${buildDir}/${config}/${arch}:qt_harfbuzz_config"
+ qt_freetype_config="${buildDir}/${config}/${arch}:qt_freetype_config"
+ enable_swiftshader=false
+ enable_swiftshader_vulkan=false
+ angle_enable_swiftshader=false
+ dawn_use_swiftshader=false
+ use_dawn=false
+ build_dawn_tests=false
+ enable_ipc_fuzzer=false
+ enable_remoting=false
+ enable_resource_allowlist_generation=false
+ enable_vr=false
+ enable_web_speech=false
+ chrome_pgo_phase=0
+ strip_absolute_paths_from_debug_symbols=false
+ use_perfetto_client_library=false
+ v8_enable_webassembly=false
+ )
+
+ if(LINUX OR ANDROID)
+ list(APPEND gnArgArg
+ is_cfi=false
+ ozone_auto_platforms=false
+ enable_arcore=false
+ use_ml_inliner=false
+ )
+ extend_gn_list(gnArgArg
+ ARGS use_system_icu
+ CONDITION QT_FEATURE_webengine_system_icu
+ )
+ extend_gn_list(gnArgArg
+ ARGS use_system_libopenjpeg2
+ CONDITION QT_FEATURE_webengine_system_libopenjpeg2
+ )
+ endif()
+ if(MACOS)
+ list(APPEND gnArgArg angle_enable_vulkan=false)
+ endif()
+ if(IOS)
+ list(APPEND gnArgArg enable_base_tracing=false)
+ extend_gn_list(gnArgArg
+ ARGS enable_ios_bitcode
+ CONDITION QT_FEATURE_pdf_bitcode
+ )
+ endif()
+ if(WIN32 OR ANDROID)
+ list(APPEND gnArgArg
+ ninja_use_custom_environment_files=false
+ safe_browsing_mode=0
+ )
+ extend_gn_list(gnArgArg
+ ARGS qt_uses_static_runtime
+ CONDITION QT_FEATURE_pdf_static_runtime
+ )
+ endif()
+
+ extend_gn_list(gnArgArg
+ ARGS pdf_enable_v8
+ CONDITION QT_FEATURE_pdf_v8
+ )
+ extend_gn_list(gnArgArg
+ ARGS pdf_enable_xfa
+ CONDITION QT_FEATURE_pdf_xfa
+ )
+ extend_gn_list(gnArgArg
+ ARGS pdf_enable_xfa_bmp
+ CONDITION QT_FEATURE_pdf_xfa_bmp
+ )
+ extend_gn_list(gnArgArg
+ ARGS pdf_enable_xfa_gif
+ CONDITION QT_FEATURE_pdf_xfa_gif
+ )
+ extend_gn_list(gnArgArg
+ ARGS pdf_enable_xfa_png
+ CONDITION QT_FEATURE_pdf_xfa_png
+ )
+ extend_gn_list(gnArgArg
+ ARGS pdf_enable_xfa_tiff
+ CONDITION QT_FEATURE_pdf_xfa_tiff
+ )
+ extend_gn_list(gnArgArg
+ ARGS pdfium_use_system_zlib use_system_zlib
+ CONDITION QT_FEATURE_webengine_system_zlib
+ )
+ extend_gn_list(gnArgArg
+ ARGS pdfium_use_system_libpng use_system_libpng
+ CONDITION QT_FEATURE_webengine_system_libpng
+ )
+ extend_gn_list(gnArgArg
+ ARGS pdfium_use_qt_libpng
+ CONDITION QT_FEATURE_webengine_qt_libpng
+ )
+ extend_gn_list(gnArgArg
+ ARGS pdfium_use_system_libtiff
+ CONDITION QT_FEATURE_webengine_system_libtiff
+ )
+ extend_gn_list(gnArgArg
+ ARGS use_qt_libjpeg
+ CONDITION QT_FEATURE_webengine_qt_libjpeg
+ )
+ extend_gn_list(gnArgArg
+ ARGS use_qt_harfbuzz
+ CONDITION QT_FEATURE_webengine_qt_harfbuzz
+ )
+ extend_gn_list(gnArgArg
+ ARGS use_qt_freetype
+ CONDITION QT_FEATURE_webengine_qt_freetype
+ )
+
+ add_gn_command(
+ CMAKE_TARGET Pdf
+ NINJA_TARGETS QtPdf
+ GN_TARGET ${buildGn}
+ GN_ARGS ${gnArgArg}
+ BUILDDIR ${buildDir}/${config}/${arch}
+ MODULE pdf
+ )
+
+ endforeach()
+ create_cxx_configs(Pdf ${arch})
+endforeach()
+
+
+##
+# PDF SETUP
+##
+
+get_architectures(archs)
+list(GET archs 0 arch)
+target_include_directories(Pdf PRIVATE ${buildDir}/$<CONFIG>/${arch}/gen)
+add_gn_build_artifacts_to_target(
+ CMAKE_TARGET Pdf
+ NINJA_TARGET QtPdf
+ MODULE pdf
+ BUILDDIR ${buildDir}
+ COMPLETE_STATIC TRUE
+ NINJA_STAMP QtPdf.stamp
+)
+add_dependencies(Pdf run_pdf_NinjaDone)
+
diff --git a/src/pdf/api/qpdfbookmarkmodel.h b/src/pdf/api/qpdfbookmarkmodel.h
deleted file mode 100644
index 8e06a1547..000000000
--- a/src/pdf/api/qpdfbookmarkmodel.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QPDFBOOKMARKMODEL_H
-#define QPDFBOOKMARKMODEL_H
-
-#include <QtPdf/qtpdfglobal.h>
-#include <QtCore/qabstractitemmodel.h>
-
-QT_BEGIN_NAMESPACE
-
-class QPdfDocument;
-class QPdfBookmarkModelPrivate;
-
-class Q_PDF_EXPORT QPdfBookmarkModel : public QAbstractItemModel
-{
- Q_OBJECT
-
- Q_PROPERTY(QPdfDocument* document READ document WRITE setDocument NOTIFY documentChanged)
- Q_PROPERTY(StructureMode structureMode READ structureMode WRITE setStructureMode NOTIFY structureModeChanged)
-
-public:
- enum StructureMode
- {
- TreeMode,
- ListMode
- };
- Q_ENUM(StructureMode)
-
- enum Role
- {
- TitleRole = Qt::DisplayRole,
- LevelRole = Qt::UserRole,
- PageNumberRole
- };
- Q_ENUM(Role)
-
- explicit QPdfBookmarkModel(QObject *parent = nullptr);
-
- QPdfDocument* document() const;
- void setDocument(QPdfDocument *document);
-
- StructureMode structureMode() const;
- void setStructureMode(StructureMode mode);
-
- QVariant data(const QModelIndex &index, int role) const override;
- QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
- QModelIndex parent(const QModelIndex &index) const override;
- int rowCount(const QModelIndex &parent = QModelIndex()) const override;
- int columnCount(const QModelIndex &parent = QModelIndex()) const override;
- QHash<int, QByteArray> roleNames() const override;
-
-Q_SIGNALS:
- void documentChanged(QPdfDocument *document);
- void structureModeChanged(QPdfBookmarkModel::StructureMode structureMode);
-
-private:
- Q_DECLARE_PRIVATE(QPdfBookmarkModel)
-
- Q_PRIVATE_SLOT(d_func(), void _q_documentStatusChanged())
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/pdf/api/qpdfdestination.h b/src/pdf/api/qpdfdestination.h
deleted file mode 100644
index f9c186ff6..000000000
--- a/src/pdf/api/qpdfdestination.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QPDFDESTINATION_H
-#define QPDFDESTINATION_H
-
-#include <QtPdf/qtpdfglobal.h>
-#include <QtCore/qdebug.h>
-#include <QtCore/qobject.h>
-#include <QtCore/qpoint.h>
-#include <QtCore/qshareddata.h>
-
-QT_BEGIN_NAMESPACE
-
-class QPdfDestinationPrivate;
-
-class Q_PDF_EXPORT QPdfDestination
-{
- Q_GADGET
- Q_PROPERTY(bool valid READ isValid)
- Q_PROPERTY(int page READ page)
- Q_PROPERTY(QPointF location READ location)
- Q_PROPERTY(qreal zoom READ zoom)
-
-public:
- ~QPdfDestination();
- QPdfDestination(const QPdfDestination &other);
- QPdfDestination &operator=(const QPdfDestination &other);
- QPdfDestination(QPdfDestination &&other) noexcept;
- QPdfDestination &operator=(QPdfDestination &&other) noexcept { swap(other); return *this; }
- void swap(QPdfDestination &other) noexcept { d.swap(other.d); }
- bool isValid() const;
- int page() const;
- QPointF location() const;
- qreal zoom() const;
-
-protected:
- QPdfDestination();
- QPdfDestination(int page, QPointF location, qreal zoom);
- QPdfDestination(QPdfDestinationPrivate *d);
- friend class QPdfDocument;
- friend class QQuickPdfNavigationStack;
-
-protected:
- QExplicitlySharedDataPointer<QPdfDestinationPrivate> d;
-};
-
-Q_PDF_EXPORT QDebug operator<<(QDebug, const QPdfDestination &);
-
-QT_END_NAMESPACE
-
-#endif // QPDFDESTINATION_H
diff --git a/src/pdf/api/qpdfdestination_p.h b/src/pdf/api/qpdfdestination_p.h
deleted file mode 100644
index 3520fb795..000000000
--- a/src/pdf/api/qpdfdestination_p.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QPDFDESTINATION_P_H
-#define QPDFDESTINATION_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QPointF>
-
-QT_BEGIN_NAMESPACE
-
-class QPdfDestinationPrivate : public QSharedData
-{
-public:
- QPdfDestinationPrivate() = default;
- QPdfDestinationPrivate(int page, QPointF location, qreal zoom)
- : page(page),
- location(location),
- zoom(zoom) { }
-
- int page = -1;
- QPointF location;
- qreal zoom = 1;
-};
-
-QT_END_NAMESPACE
-
-#endif // QPDFDESTINATION_P_H
diff --git a/src/pdf/api/qpdfdocument.h b/src/pdf/api/qpdfdocument.h
deleted file mode 100644
index 54ca687fa..000000000
--- a/src/pdf/api/qpdfdocument.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QPDFDOCUMENT_H
-#define QPDFDOCUMENT_H
-
-#include <QtPdf/qtpdfglobal.h>
-
-#include <QtCore/qobject.h>
-#include <QtGui/qimage.h>
-#include <QtPdf/qpdfdocumentrenderoptions.h>
-#include <QtPdf/qpdfselection.h>
-
-QT_BEGIN_NAMESPACE
-
-class QPdfDocumentPrivate;
-class QNetworkReply;
-
-class Q_PDF_EXPORT QPdfDocument : public QObject
-{
- Q_OBJECT
-
- Q_PROPERTY(int pageCount READ pageCount NOTIFY pageCountChanged FINAL)
- Q_PROPERTY(QString password READ password WRITE setPassword NOTIFY passwordChanged FINAL)
- Q_PROPERTY(Status status READ status NOTIFY statusChanged FINAL)
-
-public:
- enum Status {
- Null,
- Loading,
- Ready,
- Unloading,
- Error
- };
- Q_ENUM(Status)
-
- enum DocumentError {
- NoError,
- UnknownError,
- DataNotYetAvailableError,
- FileNotFoundError,
- InvalidFileFormatError,
- IncorrectPasswordError,
- UnsupportedSecuritySchemeError
- };
- Q_ENUM(DocumentError)
-
- enum MetaDataField {
- Title,
- Subject,
- Author,
- Keywords,
- Producer,
- Creator,
- CreationDate,
- ModificationDate
- };
- Q_ENUM(MetaDataField)
-
- explicit QPdfDocument(QObject *parent = nullptr);
- ~QPdfDocument();
-
- DocumentError load(const QString &fileName);
-
- Status status() const;
-
- void load(QIODevice *device);
- void setPassword(const QString &password);
- QString password() const;
-
- QVariant metaData(MetaDataField field) const;
-
- DocumentError error() const;
-
- void close();
-
- int pageCount() const;
-
- QSizeF pageSize(int page) const;
-
- QImage render(int page, QSize imageSize, QPdfDocumentRenderOptions options = QPdfDocumentRenderOptions());
-
- Q_INVOKABLE QPdfSelection getSelection(int page, QPointF start, QPointF end);
- Q_INVOKABLE QPdfSelection getSelectionAtIndex(int page, int startIndex, int maxLength);
- Q_INVOKABLE QPdfSelection getAllText(int page);
-
-Q_SIGNALS:
- void passwordChanged();
- void passwordRequired();
- void statusChanged(QPdfDocument::Status status);
- void pageCountChanged(int pageCount);
-
-private:
- friend class QPdfBookmarkModelPrivate;
- friend class QPdfLinkModelPrivate;
- friend class QPdfSearchModel;
- friend class QPdfSearchModelPrivate;
- friend class QQuickPdfSelection;
-
- Q_PRIVATE_SLOT(d, void _q_tryLoadingWithSizeFromContentHeader())
- Q_PRIVATE_SLOT(d, void _q_copyFromSequentialSourceDevice())
- QScopedPointer<QPdfDocumentPrivate> d;
-};
-
-QT_END_NAMESPACE
-
-#endif // QPDFDOCUMENT_H
diff --git a/src/pdf/api/qpdfdocument_p.h b/src/pdf/api/qpdfdocument_p.h
deleted file mode 100644
index 9a737766b..000000000
--- a/src/pdf/api/qpdfdocument_p.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QPDFDOCUMENT_P_H
-#define QPDFDOCUMENT_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "qpdfdocument.h"
-
-#include "third_party/pdfium/public/fpdfview.h"
-#include "third_party/pdfium/public/fpdf_dataavail.h"
-
-#include <QtCore/qbuffer.h>
-#include <QtCore/qmutex.h>
-#include <QtCore/qpointer.h>
-#include <QtNetwork/qnetworkreply.h>
-
-QT_BEGIN_NAMESPACE
-
-class QPdfMutexLocker : public QMutexLocker
-{
-public:
- QPdfMutexLocker();
-};
-
-class Q_PDF_PRIVATE_EXPORT QPdfDocumentPrivate: public FPDF_FILEACCESS, public FX_FILEAVAIL, public FX_DOWNLOADHINTS
-{
-public:
- QPdfDocumentPrivate();
- ~QPdfDocumentPrivate();
-
- QPdfDocument *q;
-
- FPDF_AVAIL avail;
- FPDF_DOCUMENT doc;
- bool loadComplete;
-
- QPointer<QIODevice> device;
- QScopedPointer<QIODevice> ownDevice;
- QBuffer asyncBuffer;
- QPointer<QIODevice> sequentialSourceDevice;
- QByteArray password;
-
- QPdfDocument::Status status;
- QPdfDocument::DocumentError lastError;
- int pageCount;
-
- void clear();
-
- void load(QIODevice *device, bool ownDevice);
- void loadAsync(QIODevice *device);
-
- void _q_tryLoadingWithSizeFromContentHeader();
- void initiateAsyncLoadWithTotalSizeKnown(quint64 totalSize);
- void _q_copyFromSequentialSourceDevice();
- void tryLoadDocument();
- void checkComplete();
- bool checkPageComplete(int page);
- void setStatus(QPdfDocument::Status status);
-
- static FPDF_BOOL fpdf_IsDataAvail(struct _FX_FILEAVAIL* pThis, size_t offset, size_t size);
- static int fpdf_GetBlock(void* param, unsigned long position, unsigned char* pBuf, unsigned long size);
- static void fpdf_AddSegment(struct _FX_DOWNLOADHINTS* pThis, size_t offset, size_t size);
- void updateLastError();
- QString getText(FPDF_TEXTPAGE textPage, int startIndex, int count);
- QPointF getCharPosition(FPDF_TEXTPAGE textPage, double pageHeight, int charIndex);
- QRectF getCharBox(FPDF_TEXTPAGE textPage, double pageHeight, int charIndex);
-
- struct TextPosition {
- QPointF position;
- qreal height = 0;
- int charIndex = -1;
- };
- TextPosition hitTest(int page, QPointF position);
-};
-
-QT_END_NAMESPACE
-
-#endif // QPDFDOCUMENT_P_H
diff --git a/src/pdf/api/qpdfdocumentrenderoptions.h b/src/pdf/api/qpdfdocumentrenderoptions.h
deleted file mode 100644
index cafb4716f..000000000
--- a/src/pdf/api/qpdfdocumentrenderoptions.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias König <tobias.koenig@kdab.com>
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QPDFDOCUMENTRENDEROPTIONS_H
-#define QPDFDOCUMENTRENDEROPTIONS_H
-
-#include <QtPdf/qpdfnamespace.h>
-#include <QtCore/qobject.h>
-#include <QtCore/qrect.h>
-
-QT_BEGIN_NAMESPACE
-
-class QPdfDocumentRenderOptions
-{
-public:
- Q_DECL_CONSTEXPR QPdfDocumentRenderOptions() noexcept : m_renderFlags(0), m_rotation(0), m_reserved(0) {}
-
- Q_DECL_CONSTEXPR QPdf::Rotation rotation() const noexcept { return static_cast<QPdf::Rotation>(m_rotation); }
- Q_DECL_RELAXED_CONSTEXPR void setRotation(QPdf::Rotation r) noexcept { m_rotation = r; }
-
- Q_DECL_CONSTEXPR QPdf::RenderFlags renderFlags() const noexcept { return static_cast<QPdf::RenderFlags>(m_renderFlags); }
- Q_DECL_RELAXED_CONSTEXPR void setRenderFlags(QPdf::RenderFlags r) noexcept { m_renderFlags = r; }
-
- Q_DECL_CONSTEXPR QRect scaledClipRect() const noexcept { return m_clipRect; }
- Q_DECL_RELAXED_CONSTEXPR void setScaledClipRect(const QRect &r) noexcept { m_clipRect = r; }
-
- Q_DECL_CONSTEXPR QSize scaledSize() const noexcept { return m_scaledSize; }
- Q_DECL_RELAXED_CONSTEXPR void setScaledSize(const QSize &s) noexcept { m_scaledSize = s; }
-
-private:
- friend Q_DECL_CONSTEXPR inline bool operator==(QPdfDocumentRenderOptions lhs, QPdfDocumentRenderOptions rhs) noexcept;
-
- QRect m_clipRect;
- QSize m_scaledSize;
-
- quint32 m_renderFlags : 8;
- quint32 m_rotation : 3;
- quint32 m_reserved : 21;
- quint32 m_reserved2 = 0;
-};
-
-Q_DECLARE_TYPEINFO(QPdfDocumentRenderOptions, Q_PRIMITIVE_TYPE);
-
-Q_DECL_CONSTEXPR inline bool operator==(QPdfDocumentRenderOptions lhs, QPdfDocumentRenderOptions rhs) noexcept
-{
- return lhs.m_clipRect == rhs.m_clipRect && lhs.m_scaledSize == rhs.m_scaledSize &&
- lhs.m_renderFlags == rhs.m_renderFlags && lhs.m_rotation == rhs.m_rotation &&
- lhs.m_reserved == rhs.m_reserved && lhs.m_reserved2 == rhs.m_reserved2; // fix -Wunused-private-field
-}
-
-Q_DECL_CONSTEXPR inline bool operator!=(QPdfDocumentRenderOptions lhs, QPdfDocumentRenderOptions rhs) noexcept
-{
- return !operator==(lhs, rhs);
-}
-
-QT_END_NAMESPACE
-
-Q_DECLARE_METATYPE(QPdfDocumentRenderOptions)
-
-#endif // QPDFDOCUMENTRENDEROPTIONS_H
diff --git a/src/pdf/api/qpdflinkmodel_p.h b/src/pdf/api/qpdflinkmodel_p.h
deleted file mode 100644
index cf9c0aad4..000000000
--- a/src/pdf/api/qpdflinkmodel_p.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QPDFLINKMODEL_P_H
-#define QPDFLINKMODEL_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "qtpdfglobal.h"
-#include "qpdfdocument.h"
-
-#include <QObject>
-#include <QAbstractListModel>
-
-QT_BEGIN_NAMESPACE
-
-class QPdfLinkModelPrivate;
-
-class Q_PDF_EXPORT QPdfLinkModel : public QAbstractListModel
-{
- Q_OBJECT
- Q_PROPERTY(QPdfDocument *document READ document WRITE setDocument NOTIFY documentChanged)
- Q_PROPERTY(int page READ page WRITE setPage NOTIFY pageChanged)
-
-public:
- enum class Role : int {
- Rect = Qt::UserRole,
- Url,
- Page,
- Location,
- Zoom,
- _Count
- };
- Q_ENUM(Role)
- explicit QPdfLinkModel(QObject *parent = nullptr);
- ~QPdfLinkModel();
-
- QPdfDocument *document() const;
-
- QHash<int, QByteArray> roleNames() const override;
- int rowCount(const QModelIndex &parent) const override;
- QVariant data(const QModelIndex &index, int role) const override;
-
- int page() const;
-
-public Q_SLOTS:
- void setDocument(QPdfDocument *document);
- void setPage(int page);
-
-Q_SIGNALS:
- void documentChanged();
- void pageChanged(int page);
-
-private Q_SLOTS:
- void onStatusChanged(QPdfDocument::Status status);
-
-private:
- QHash<int, QByteArray> m_roleNames;
- Q_DECLARE_PRIVATE(QPdfLinkModel)
-};
-
-QT_END_NAMESPACE
-
-#endif // QPDFLINKMODEL_P_H
diff --git a/src/pdf/api/qpdflinkmodel_p_p.h b/src/pdf/api/qpdflinkmodel_p_p.h
deleted file mode 100644
index 0454d6755..000000000
--- a/src/pdf/api/qpdflinkmodel_p_p.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QPDFLINKMODEL_P_P_H
-#define QPDFLINKMODEL_P_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "qpdflinkmodel_p.h"
-#include <private/qabstractitemmodel_p.h>
-
-#include "third_party/pdfium/public/fpdfview.h"
-
-#include <QUrl>
-
-QT_BEGIN_NAMESPACE
-
-class QPdfLinkModelPrivate: public QAbstractItemModelPrivate
-{
- Q_DECLARE_PUBLIC(QPdfLinkModel)
-
-public:
- QPdfLinkModelPrivate();
-
- void update();
-
- struct Link {
- // where it is on the current page
- QRectF rect;
- int textStart = -1;
- int textCharCount = 0;
- // destination inside PDF
- int page = -1; // -1 means look at the url instead
- QPointF location;
- qreal zoom = 0; // 0 means no specified zoom: don't change when clicking
- // web destination
- QUrl url;
-
- QString toString() const;
- };
-
- QPdfDocument *document = nullptr;
- QVector<Link> links;
- int page = 0;
-};
-
-QT_END_NAMESPACE
-
-#endif // QPDFLINKMODEL_P_P_H
diff --git a/src/pdf/api/qpdfnamespace.h b/src/pdf/api/qpdfnamespace.h
deleted file mode 100644
index e76d0abd9..000000000
--- a/src/pdf/api/qpdfnamespace.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias König <tobias.koenig@kdab.com>
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QPDFNAMESPACE_H
-#define QPDFNAMESPACE_H
-
-#include <QtCore/qobject.h>
-
-QT_BEGIN_NAMESPACE
-
-namespace QPdf {
- Q_NAMESPACE
-
- enum Rotation {
- Rotate0,
- Rotate90,
- Rotate180,
- Rotate270
- };
- Q_ENUM_NS(Rotation)
-
- enum RenderFlag {
- NoRenderFlags = 0x000,
- RenderAnnotations = 0x001,
- RenderOptimizedForLcd = 0x002,
- RenderGrayscale = 0x004,
- RenderForceHalftone = 0x008,
- RenderTextAliased = 0x010,
- RenderImageAliased = 0x020,
- RenderPathAliased = 0x040
- };
- Q_FLAG_NS(RenderFlag)
- Q_DECLARE_FLAGS(RenderFlags, RenderFlag)
-}
-
-Q_DECLARE_OPERATORS_FOR_FLAGS(QPdf::RenderFlags)
-
-QT_END_NAMESPACE
-#endif
diff --git a/src/pdf/api/qpdfpagenavigation.h b/src/pdf/api/qpdfpagenavigation.h
deleted file mode 100644
index 0f416bf77..000000000
--- a/src/pdf/api/qpdfpagenavigation.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias König <tobias.koenig@kdab.com>
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QPDFPAGENAVIGATION_H
-#define QPDFPAGENAVIGATION_H
-
-#include <QtPdf/qtpdfglobal.h>
-#include <QtCore/qobject.h>
-
-QT_BEGIN_NAMESPACE
-
-class QPdfDocument;
-class QPdfPageNavigationPrivate;
-
-class Q_PDF_EXPORT QPdfPageNavigation : public QObject
-{
- Q_OBJECT
-
- Q_PROPERTY(QPdfDocument* document READ document WRITE setDocument NOTIFY documentChanged)
-
- Q_PROPERTY(int currentPage READ currentPage WRITE setCurrentPage NOTIFY currentPageChanged)
- Q_PROPERTY(int pageCount READ pageCount NOTIFY pageCountChanged)
- Q_PROPERTY(bool canGoToPreviousPage READ canGoToPreviousPage NOTIFY canGoToPreviousPageChanged)
- Q_PROPERTY(bool canGoToNextPage READ canGoToNextPage NOTIFY canGoToNextPageChanged)
-
-public:
- explicit QPdfPageNavigation(QObject *parent = nullptr);
- ~QPdfPageNavigation();
-
- QPdfDocument* document() const;
- void setDocument(QPdfDocument *document);
-
- int currentPage() const;
- void setCurrentPage(int currentPage);
-
- int pageCount() const;
-
- bool canGoToPreviousPage() const;
- bool canGoToNextPage() const;
-
-public Q_SLOTS:
- void goToPreviousPage();
- void goToNextPage();
-
-Q_SIGNALS:
- void documentChanged(QPdfDocument *document);
- void currentPageChanged(int currentPage);
- void pageCountChanged(int pageCount);
- void canGoToPreviousPageChanged(bool canGo);
- void canGoToNextPageChanged(bool canGo);
-
-private:
- Q_DECLARE_PRIVATE(QPdfPageNavigation)
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/pdf/api/qpdfpagerenderer.h b/src/pdf/api/qpdfpagerenderer.h
deleted file mode 100644
index c7b8de0df..000000000
--- a/src/pdf/api/qpdfpagerenderer.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias König <tobias.koenig@kdab.com>
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QPDFPAGERENDERER_H
-#define QPDFPAGERENDERER_H
-
-#include <QtPdf/qtpdfglobal.h>
-
-#include <QtCore/qobject.h>
-#include <QtCore/qsize.h>
-#include <QtPdf/qpdfdocumentrenderoptions.h>
-
-QT_BEGIN_NAMESPACE
-
-class QPdfDocument;
-class QPdfPageRendererPrivate;
-
-class Q_PDF_EXPORT QPdfPageRenderer : public QObject
-{
- Q_OBJECT
-
- Q_PROPERTY(QPdfDocument* document READ document WRITE setDocument NOTIFY documentChanged)
- Q_PROPERTY(RenderMode renderMode READ renderMode WRITE setRenderMode NOTIFY renderModeChanged)
-
-public:
- enum class RenderMode
- {
- MultiThreaded,
- SingleThreaded
- };
- Q_ENUM(RenderMode)
-
- explicit QPdfPageRenderer(QObject *parent = nullptr);
- ~QPdfPageRenderer() override;
-
- RenderMode renderMode() const;
- void setRenderMode(RenderMode mode);
-
- QPdfDocument* document() const;
- void setDocument(QPdfDocument *document);
-
- quint64 requestPage(int pageNumber, QSize imageSize,
- QPdfDocumentRenderOptions options = QPdfDocumentRenderOptions());
-
-Q_SIGNALS:
- void documentChanged(QPdfDocument *document);
- void renderModeChanged(RenderMode renderMode);
-
- void pageRendered(int pageNumber, QSize imageSize, const QImage &image,
- QPdfDocumentRenderOptions options, quint64 requestId);
-
-private:
- Q_DECLARE_PRIVATE(QPdfPageRenderer)
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/pdf/api/qpdfsearchmodel.h b/src/pdf/api/qpdfsearchmodel.h
deleted file mode 100644
index eb0fb831f..000000000
--- a/src/pdf/api/qpdfsearchmodel.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QPDFSEARCHMODEL_H
-#define QPDFSEARCHMODEL_H
-
-#include <QtPdf/qtpdfglobal.h>
-
-#include <QtCore/qabstractitemmodel.h>
-#include <QtPdf/qpdfdocument.h>
-#include <QtPdf/qpdfsearchresult.h>
-
-QT_BEGIN_NAMESPACE
-
-class QPdfSearchModelPrivate;
-
-class Q_PDF_EXPORT QPdfSearchModel : public QAbstractListModel
-{
- Q_OBJECT
- Q_PROPERTY(QPdfDocument *document READ document WRITE setDocument NOTIFY documentChanged)
- Q_PROPERTY(QString searchString READ searchString WRITE setSearchString NOTIFY searchStringChanged)
-
-public:
- enum class Role : int {
- Page = Qt::UserRole,
- IndexOnPage,
- Location,
- ContextBefore,
- ContextAfter,
- _Count
- };
- Q_ENUM(Role)
- explicit QPdfSearchModel(QObject *parent = nullptr);
- ~QPdfSearchModel();
-
- QVector<QPdfSearchResult> resultsOnPage(int page) const;
- QPdfSearchResult resultAtIndex(int index) const;
-
- QPdfDocument *document() const;
- QString searchString() const;
-
- QHash<int, QByteArray> roleNames() const override;
- int rowCount(const QModelIndex &parent) const override;
- QVariant data(const QModelIndex &index, int role) const override;
-
-public Q_SLOTS:
- void setSearchString(QString searchString);
- void setDocument(QPdfDocument *document);
-
-Q_SIGNALS:
- void documentChanged();
- void searchStringChanged();
-
-protected:
- void updatePage(int page);
- void timerEvent(QTimerEvent *event) override;
-
-private:
- QHash<int, QByteArray> m_roleNames;
- Q_DECLARE_PRIVATE(QPdfSearchModel)
-};
-
-QT_END_NAMESPACE
-
-#endif // QPDFSEARCHMODEL_H
diff --git a/src/pdf/api/qpdfsearchmodel_p.h b/src/pdf/api/qpdfsearchmodel_p.h
deleted file mode 100644
index 2a23706b2..000000000
--- a/src/pdf/api/qpdfsearchmodel_p.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QPDFSEARCHMODEL_P_H
-#define QPDFSEARCHMODEL_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "qpdfsearchmodel.h"
-#include "qpdfsearchresult_p.h"
-#include <private/qabstractitemmodel_p.h>
-
-#include "third_party/pdfium/public/fpdfview.h"
-
-QT_BEGIN_NAMESPACE
-
-class QPdfSearchModelPrivate : public QAbstractItemModelPrivate
-{
- Q_DECLARE_PUBLIC(QPdfSearchModel)
-
-public:
- QPdfSearchModelPrivate();
- void clearResults();
- bool doSearch(int page);
-
- struct PageAndIndex {
- int page;
- int index;
- };
- PageAndIndex pageAndIndexForResult(int resultIndex);
- int rowsBeforePage(int page);
-
- QPdfDocument *document = nullptr;
- QString searchString;
- QVector<bool> pagesSearched;
- QVector<QVector<QPdfSearchResult>> searchResults;
- int rowCountSoFar = 0;
- int updateTimerId = -1;
- int nextPageToUpdate = 0;
-};
-
-QT_END_NAMESPACE
-
-#endif // QPDFSEARCHMODEL_P_H
diff --git a/src/pdf/api/qpdfsearchresult.h b/src/pdf/api/qpdfsearchresult.h
deleted file mode 100644
index 2dfca2dc4..000000000
--- a/src/pdf/api/qpdfsearchresult.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QPDFSEARCHRESULT_H
-#define QPDFSEARCHRESULT_H
-
-#include <QtCore/qdebug.h>
-#include <QtCore/qrect.h>
-#include <QtCore/qvector.h>
-#include <QtPdf/qpdfdestination.h>
-
-QT_BEGIN_NAMESPACE
-
-class QPdfSearchResultPrivate;
-
-class Q_PDF_EXPORT QPdfSearchResult : public QPdfDestination
-{
- Q_GADGET
- Q_PROPERTY(QString contextBefore READ contextBefore)
- Q_PROPERTY(QString contextAfter READ contextAfter)
- Q_PROPERTY(QVector<QRectF> rectangles READ rectangles)
-
-public:
- QPdfSearchResult();
- ~QPdfSearchResult() {}
-
- QString contextBefore() const;
- QString contextAfter() const;
- QVector<QRectF> rectangles() const;
-
-private:
- QPdfSearchResult(int page, QVector<QRectF> rects, QString contextBefore, QString contextAfter);
- QPdfSearchResult(QPdfSearchResultPrivate *d);
- friend class QPdfDocument;
- friend class QPdfSearchModelPrivate;
- friend class QQuickPdfNavigationStack;
-};
-
-Q_PDF_EXPORT QDebug operator<<(QDebug, const QPdfSearchResult &);
-
-QT_END_NAMESPACE
-
-#endif // QPDFSEARCHRESULT_H
diff --git a/src/pdf/api/qpdfsearchresult_p.h b/src/pdf/api/qpdfsearchresult_p.h
deleted file mode 100644
index 615dce4e0..000000000
--- a/src/pdf/api/qpdfsearchresult_p.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QPDFSEARCHRESULT_P_H
-#define QPDFSEARCHRESULT_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "qpdfdestination_p.h"
-
-QT_BEGIN_NAMESPACE
-
-class QPdfSearchResultPrivate : public QPdfDestinationPrivate
-{
-public:
- QPdfSearchResultPrivate() = default;
- QPdfSearchResultPrivate(int page, QVector<QRectF> rects, QString contextBefore, QString contextAfter) :
- QPdfDestinationPrivate(page, rects.first().topLeft(), 0),
- contextBefore(contextBefore),
- contextAfter(contextAfter),
- rects(rects) {}
-
- QString contextBefore;
- QString contextAfter;
- QVector<QRectF> rects;
-};
-
-QT_END_NAMESPACE
-
-#endif // QPDFSEARCHRESULT_P_H
diff --git a/src/pdf/api/qpdfselection.h b/src/pdf/api/qpdfselection.h
deleted file mode 100644
index 9d91d46c7..000000000
--- a/src/pdf/api/qpdfselection.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QPDFSELECTION_H
-#define QPDFSELECTION_H
-
-#include <QtPdf/qtpdfglobal.h>
-
-#include <QtCore/qobject.h>
-#include <QtCore/qshareddata.h>
-#include <QtGui/qclipboard.h>
-#include <QtGui/qpolygon.h>
-
-QT_BEGIN_NAMESPACE
-
-class QPdfSelectionPrivate;
-
-class Q_PDF_EXPORT QPdfSelection
-{
- Q_GADGET
- Q_PROPERTY(bool valid READ isValid)
- Q_PROPERTY(QVector<QPolygonF> bounds READ bounds)
- Q_PROPERTY(QRectF boundingRectangle READ boundingRectangle)
- Q_PROPERTY(QString text READ text)
- Q_PROPERTY(int startIndex READ startIndex)
- Q_PROPERTY(int endIndex READ endIndex)
-
-public:
- ~QPdfSelection();
- QPdfSelection(const QPdfSelection &other);
- QPdfSelection &operator=(const QPdfSelection &other);
- QPdfSelection(QPdfSelection &&other) noexcept;
- QPdfSelection &operator=(QPdfSelection &&other) noexcept { swap(other); return *this; }
- void swap(QPdfSelection &other) noexcept { d.swap(other.d); }
- bool isValid() const;
- QVector<QPolygonF> bounds() const;
- QString text() const;
- QRectF boundingRectangle() const;
- int startIndex() const;
- int endIndex() const;
-#if QT_CONFIG(clipboard)
- void copyToClipboard(QClipboard::Mode mode = QClipboard::Clipboard) const;
-#endif
-
-private:
- QPdfSelection();
- QPdfSelection(const QString &text, QVector<QPolygonF> bounds, QRectF boundingRect, int startIndex, int endIndex);
- QPdfSelection(QPdfSelectionPrivate *d);
- friend class QPdfDocument;
- friend class QQuickPdfSelection;
-
-private:
- QExplicitlySharedDataPointer<QPdfSelectionPrivate> d;
-};
-
-QT_END_NAMESPACE
-
-#endif // QPDFSELECTION_H
diff --git a/src/pdf/api/qpdfselection_p.h b/src/pdf/api/qpdfselection_p.h
deleted file mode 100644
index 0577e5a31..000000000
--- a/src/pdf/api/qpdfselection_p.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QPDFSELECTION_P_H
-#define QPDFSELECTION_P_H
-
-#include <QPolygonF>
-#include <QVector>
-
-QT_BEGIN_NAMESPACE
-
-class QPdfSelectionPrivate : public QSharedData
-{
-public:
- QPdfSelectionPrivate() = default;
- QPdfSelectionPrivate(const QString &text, QVector<QPolygonF> bounds, QRectF boundingRect, int startIndex, int endIndex)
- : text(text),
- bounds(bounds),
- boundingRect(boundingRect),
- startIndex(startIndex),
- endIndex(endIndex) { }
-
- QString text;
- QVector<QPolygonF> bounds;
- QRectF boundingRect;
- int startIndex;
- int endIndex;
-};
-
-QT_END_NAMESPACE
-
-#endif // QPDFSELECTION_P_H
diff --git a/src/pdf/api/qtpdfglobal.h b/src/pdf/api/qtpdfglobal.h
deleted file mode 100644
index 8b4b0c206..000000000
--- a/src/pdf/api/qtpdfglobal.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QTPDFGLOBAL_H
-#define QTPDFGLOBAL_H
-
-#include <QtCore/qglobal.h>
-
-QT_BEGIN_NAMESPACE
-
-#ifndef Q_PDF_EXPORT
-# ifndef QT_STATIC
-# if defined(QT_BUILD_PDF_LIB)
-# define Q_PDF_EXPORT Q_DECL_EXPORT
-# else
-# define Q_PDF_EXPORT Q_DECL_IMPORT
-# endif
-# else
-# define Q_PDF_EXPORT
-# endif
-#endif
-
-#define Q_PDF_PRIVATE_EXPORT Q_PDF_EXPORT
-
-QT_END_NAMESPACE
-
-#endif // QTPDFGLOBAL_H
-
diff --git a/src/pdf/config/common.pri b/src/pdf/config/common.pri
deleted file mode 100644
index dd5bfa293..000000000
--- a/src/pdf/config/common.pri
+++ /dev/null
@@ -1,38 +0,0 @@
-include($$QTWEBENGINE_OUT_ROOT/src/pdf/qtpdf-config.pri)
-QT_FOR_CONFIG += pdf-private
-
-qtConfig(pdf-v8) {
- gn_args += pdf_enable_v8=true
-} else {
- gn_args += pdf_enable_v8=false
-}
-
-qtConfig(pdf-xfa) {
- gn_args += pdf_enable_xfa=true
-} else {
- gn_args += pdf_enable_xfa=false
-}
-
-qtConfig(pdf-xfa-bmp) {
- gn_args += pdf_enable_xfa_bmp=true
-} else {
- gn_args += pdf_enable_xfa_bmp=false
-}
-
-qtConfig(pdf-xfa-gif) {
- gn_args += pdf_enable_xfa_gif=true
-} else {
- gn_args += pdf_enable_xfa_gif=false
-}
-
-qtConfig(pdf-xfa-png) {
- gn_args += pdf_enable_xfa_png=true
-} else {
- gn_args += pdf_enable_xfa_png=false
-}
-
-qtConfig(pdf-xfa-tiff) {
- gn_args += pdf_enable_xfa_tiff=true
-} else {
- gn_args += pdf_enable_xfa_tiff=false
-}
diff --git a/src/pdf/config/ios.pri b/src/pdf/config/ios.pri
deleted file mode 100644
index 5dc7faf9d..000000000
--- a/src/pdf/config/ios.pri
+++ /dev/null
@@ -1,66 +0,0 @@
-load(functions)
-
-include($$QTWEBENGINE_OUT_ROOT/src/buildtools/qtbuildtools-config.pri)
-include($$QTWEBENGINE_OUT_ROOT/src/pdf/qtpdf-config.pri)
-QT_FOR_CONFIG += buildtools-private pdf-private
-
-clang_dir = $$which($${QMAKE_CXX})
-clang_dir = $$clean_path("$$dirname(clang_dir)/../")
-
-gn_args += \
-use_qt=true \
-closure_compile=false \
-is_component_build=false \
-is_shared=true \
-is_debug=true \
-enable_message_center=false \
-enable_nacl=false \
-enable_remoting=false \
-enable_reporting=false \
-enable_resource_whitelist_generation=false \
-enable_swiftshader=false \
-enable_web_speech=false \
-has_native_accessibility=false \
-enable_debugallocation=false \
-use_allocator_shim=false \
-use_allocator=\"none\" \
-use_custom_libcxx=false \
-v8_use_external_startup_data=false \
-v8_use_snapshot=false \
-toolkit_views=false \
-treat_warnings_as_errors=false \
-safe_browsing_mode=0 \
-optimize_webui=false \
-forbid_non_component_debug_builds=false \
-clang_use_chrome_plugins=false \
-use_xcode_clang=true \
-clang_base_path=\"$${clang_dir}\" \
-ios_enable_code_signing=false \
-target_os=\"ios\" \
-ios_deployment_target=\"$${QMAKE_IOS_DEPLOYMENT_TARGET}\" \
-enable_ios_bitcode=true \
-use_jumbo_build=false
-
-device:simulator {
- # we do fat libray
- gn_args+= \
- target_cpu=\"$${QMAKE_APPLE_DEVICE_ARCHS}\" \
- use_qt_fat_lib=true \
- arm_use_neon=false\
- # note this adds one arch of simulator at the moment, see also additional_target_cpus
- target_sysroot=\"$$xcodeSDKInfo(Path, $$device.sdk)\" \
- additional_target_sysroot=[\"$$xcodeSDKInfo(Path, $$simulator.sdk)\"]
-} else {
- simulator {
- equals(QMAKE_APPLE_SIMULATOR_ARCHS,"x86_64") {
- gn_args+=target_cpu=\"x64\"
- } else {
- gn_args+=target_cpu=\"$${QMAKE_APPLE_SIMULATOR_ARCHS}\"
- }
- gn_args+=target_sysroot=\"$$xcodeSDKInfo(Path, $$simulator.sdk)\"
- }
- device {
- gn_args+=target_cpu=\"$${QMAKE_APPLE_DEVICE_ARCHS}\"
- gn_args+=target_sysroot=\"$$xcodeSDKInfo(Path, $$device.sdk)\"
- }
-}
diff --git a/src/pdf/configure.cmake b/src/pdf/configure.cmake
new file mode 100644
index 000000000..ac4e4e25f
--- /dev/null
+++ b/src/pdf/configure.cmake
@@ -0,0 +1,54 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_feature("pdf-v8" PRIVATE
+ LABEL "Support V8"
+ PURPOSE "Enables javascript support."
+ AUTODETECT FALSE
+ CONDITION NOT IOS
+)
+qt_feature("pdf-xfa" PRIVATE
+ LABEL "Support XFA"
+ PURPOSE "Enables XFA support."
+ CONDITION QT_FEATURE_pdf_v8
+)
+qt_feature("pdf-xfa-bmp" PRIVATE
+ LABEL "Support XFA-BMP"
+ PURPOSE "Enables XFA-BMP support."
+ CONDITION QT_FEATURE_pdf_xfa
+)
+qt_feature("pdf-xfa-gif" PRIVATE
+ LABEL "Support XFA-GIF"
+ PURPOSE "Enables XFA-GIF support."
+ CONDITION QT_FEATURE_pdf_xfa
+)
+qt_feature("pdf-xfa-png" PRIVATE
+ LABEL "Support XFA-PNG"
+ PURPOSE "Enables XFA-PNG support."
+ CONDITION QT_FEATURE_pdf_xfa
+)
+qt_feature("pdf-xfa-tiff" PRIVATE
+ LABEL "Support XFA-TIFF"
+ PURPOSE "Enables XFA-TIFF support."
+ CONDITION QT_FEATURE_pdf_xfa
+)
+qt_feature("pdf-bitcode" PRIVATE
+ LABEL "Bitcode support"
+ PURPOSE "Enables bitcode"
+ CONDITION IOS
+)
+qt_feature("pdf-static-runtime" PRIVATE
+ LABEL "Use static runtime"
+ PURPOSE "Enables static runtime"
+ CONDITION WIN32 AND QT_FEATURE_static AND QT_FEATURE_static_runtime
+)
+qt_configure_add_summary_section(NAME "Qt PDF")
+qt_configure_add_summary_entry(ARGS "pdf-v8")
+qt_configure_add_summary_entry(ARGS "pdf-xfa")
+qt_configure_add_summary_entry(ARGS "pdf-xfa-bmp")
+qt_configure_add_summary_entry(ARGS "pdf-xfa-gif")
+qt_configure_add_summary_entry(ARGS "pdf-xfa-png")
+qt_configure_add_summary_entry(ARGS "pdf-xfa-tiff")
+qt_configure_add_summary_entry(ARGS "pdf-bitcode")
+qt_configure_add_summary_entry(ARGS "pdf-static-runtime")
+qt_configure_end_summary_section()
diff --git a/src/pdf/configure.json b/src/pdf/configure.json
deleted file mode 100644
index ddc0e99dc..000000000
--- a/src/pdf/configure.json
+++ /dev/null
@@ -1,64 +0,0 @@
-{
- "module": "pdf",
- "depends" : [ "buildtools-private" ],
- "testDir": "../../config.tests",
- "condition": "features.build-qtpdf && features.webengine-qtpdf-support",
- "libraries": {
- },
- "tests": {
- },
- "features": {
- "pdf-v8": {
- "label": "Support V8",
- "purpose": "Enables javascript support.",
- "autoDetect": "false",
- "condition": "!config.ios",
- "output": ["privateFeature" ]
- },
- "pdf-xfa": {
- "label": "Support XFA",
- "purpose": "Enables XFA support.",
- "condition": "features.pdf-v8",
- "output": ["privateFeature" ]
- },
- "pdf-xfa-bmp": {
- "label": "Support XFA-BMP",
- "purpose": "Enables XFA-BMP support.",
- "condition": "features.pdf-xfa",
- "output": ["privateFeature" ]
- },
- "pdf-xfa-gif": {
- "label": "Support XFA-GIF",
- "purpose": "Enables XFA-GIF support.",
- "condition": "features.pdf-xfa",
- "output": ["privateFeature" ]
- },
- "pdf-xfa-png": {
- "label": "Support XFA-PNG",
- "purpose": "Enables XFA-PNG support.",
- "condition": "features.pdf-xfa",
- "output": ["privateFeature" ]
- },
- "pdf-xfa-tiff": {
- "label": "Support XFA-TIFF",
- "purpose": "Enables XFA-TIFF support.",
- "condition": "features.pdf-xfa",
- "output": ["privateFeature" ]
- }
- },
- "report": [
- ],
- "summary": [
- {
- "section": "Qt PDF",
- "entries": [
- "pdf-v8",
- "pdf-xfa",
- "pdf-xfa-bmp",
- "pdf-xfa-gif",
- "pdf-xfa-png",
- "pdf-xfa-tiff"
- ]
- }
- ]
-}
diff --git a/src/pdf/configure/BUILD.root.gn.in b/src/pdf/configure/BUILD.root.gn.in
new file mode 100644
index 000000000..e9f54ed6d
--- /dev/null
+++ b/src/pdf/configure/BUILD.root.gn.in
@@ -0,0 +1,73 @@
+import("//build/config/features.gni")
+
+config("qt_libpng_config") {
+ include_dirs = [ @GN_PNG_INCLUDES@ ]
+ defines = [ "USE_SYSTEM_LIBPNG" ]
+}
+config ("qt_libjpeg_config") {
+ include_dirs = [ @GN_JPEG_INCLUDES@ ]
+}
+config("qt_harfbuzz_config") {
+ visibility = [
+ "//third_party:freetype_harfbuzz",
+ "//third_party/freetype:freetype_source",
+ ]
+ include_dirs = [ @GN_HARFBUZZ_INCLUDES@ ]
+}
+config("qt_freetype_config") {
+ visibility = [
+ "//build/config/freetype:freetype",
+ "//third_party:freetype_harfbuzz",
+ "//third_party/harfbuzz-ng:harfbuzz_source",
+ ]
+ include_dirs = [ @GN_FREETYPE_INCLUDES@ ]
+}
+
+config("QtPdf_config") {
+ cflags = [
+ @GN_CFLAGS_C@,
+ ]
+ cflags_cc = [
+ @GN_CFLAGS_CC@,
+ ]
+ defines = [
+ @GN_DEFINES@,
+ ]
+ include_dirs = [
+ @GN_INCLUDE_DIRS@,
+ rebase_path("${target_gen_dir}/.moc/")
+ ]
+}
+
+config("cpp20_config") {
+ # Chromium headers now use concepts and requires c++20
+ if (is_win) {
+ cflags_cc = [ "/std:c++20" ]
+ } else {
+ cflags_cc = [ "-std=c++20" ]
+ }
+}
+
+static_library("QtPdf") {
+ complete_static_lib = true
+ rsp_types = [ "objects", "archives", "libs", "ldir" ]
+ configs += [
+ ":cpp20_config",
+ ":QtPdf_config"
+ ]
+ deps = [
+ "//third_party/pdfium"
+ ]
+ if (is_msvc) {
+ libs = [
+ "dloadhelper.lib",
+ "winmm.lib",
+ "usp10.lib",
+ ]
+ }
+ if (is_mingw) {
+ libs = [
+ "winmm",
+ ]
+ }
+}
diff --git a/src/pdf/doc/about_credits.tmpl b/src/pdf/doc/about_credits.tmpl
new file mode 100644
index 000000000..57fae9e78
--- /dev/null
+++ b/src/pdf/doc/about_credits.tmpl
@@ -0,0 +1 @@
+{{entries}}
diff --git a/src/pdf/doc/about_credits_entry.tmpl b/src/pdf/doc/about_credits_entry.tmpl
new file mode 100644
index 000000000..294198709
--- /dev/null
+++ b/src/pdf/doc/about_credits_entry.tmpl
@@ -0,0 +1,13 @@
+/*!
+\page qtpdf-3rdparty-{{name-sanitized}}.html
+\attribution
+\ingroup qtpdf-licensing
+\brief {{license-type}}
+\title {{name}}
+
+\l{{{url}}}{Project Homepage}
+
+\badcode
+{{license}}
+\endcode
+*/
diff --git a/src/pdf/doc/images/multipageviewer.png b/src/pdf/doc/images/multipageviewer.png
new file mode 100644
index 000000000..2f0bb62a2
--- /dev/null
+++ b/src/pdf/doc/images/multipageviewer.png
Binary files differ
diff --git a/src/pdf/doc/images/pdfviewer.png b/src/pdf/doc/images/pdfviewer.png
new file mode 100644
index 000000000..ac8a31ac0
--- /dev/null
+++ b/src/pdf/doc/images/pdfviewer.png
Binary files differ
diff --git a/src/pdf/doc/images/search-results.png b/src/pdf/doc/images/search-results.png
new file mode 100644
index 000000000..91ee53b83
--- /dev/null
+++ b/src/pdf/doc/images/search-results.png
Binary files differ
diff --git a/src/pdf/doc/images/singlepageviewer.webp b/src/pdf/doc/images/singlepageviewer.webp
new file mode 100644
index 000000000..e429cb818
--- /dev/null
+++ b/src/pdf/doc/images/singlepageviewer.webp
Binary files differ
diff --git a/src/pdf/doc/images/wrapping-search-result.png b/src/pdf/doc/images/wrapping-search-result.png
new file mode 100644
index 000000000..108ec0444
--- /dev/null
+++ b/src/pdf/doc/images/wrapping-search-result.png
Binary files differ
diff --git a/src/pdf/doc/qtpdf.qdocconf b/src/pdf/doc/qtpdf.qdocconf
index 7a77105c9..d0340fe83 100644
--- a/src/pdf/doc/qtpdf.qdocconf
+++ b/src/pdf/doc/qtpdf.qdocconf
@@ -1,4 +1,5 @@
include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
+include($QT_INSTALL_DOCS/config/exampleurl-qtwebengine.qdocconf)
project = QtPdf
description = Qt Pdf Reference Documentation
@@ -12,10 +13,6 @@ qhp.QtPdf.virtualFolder = qtpdf
qhp.QtPdf.indexTitle = Qt PDF
qhp.QtPdf.indexRoot =
-qhp.QtPdf.filterAttributes = qtpdf $QT_VERSION qtrefdoc
-qhp.QtPdf.customFilters.Qt.name = QtPdf $QT_VERSION
-qhp.QtPdf.customFilters.Qt.filterAttributes = qtpdf $QT_VERSION
-
qhp.QtPdf.subprojects = classes qmltypes examples
qhp.QtPdf.subprojects.classes.title = C++ Classes
@@ -33,6 +30,8 @@ qhp.QtPdf.subprojects.examples.indexTitle = Qt PDF Examples
qhp.QtPdf.subprojects.examples.selectors = doc:example
qhp.QtPdf.subprojects.examples.sortPages = true
+manifestmeta.highlighted.names += "QtPdf/PDF Multipage Viewer Example"
+
depends += qtcore \
qtwidgets \
qtgui \
@@ -40,19 +39,29 @@ depends += qtcore \
qmake \
qtdesigner \
qtquick \
- qtcmake
+ qtquickcontrols \
+ qtcmake \
+ qtsvg
-headerdirs += ../api \
- ../quick
+headerdirs += ../ \
+ ../../pdfwidgets
-sourcedirs += .. \
- ../quick
+sourcedirs += ../ \
+ ../../pdfquick \
+ ../../pdfwidgets
exampledirs += ../../../examples/pdfwidgets \
+ ../../../examples/pdf \
snippets/
+# add a generic thumbnail for an example that has no \image in its doc
+manifestmeta.thumbnail.names = "QtPdf/PDF Viewer Example"
+
imagedirs += images
navigation.landingpage = "Qt PDF"
navigation.cppclassespage = "Qt PDF C++ Classes"
-navigation.qmltypespage = "Qt WebEngine QML Types"
+navigation.qmltypespage = "Qt Quick PDF QML Types"
+
+# Enforce zero documentation warnings
+warninglimit = 0
diff --git a/src/pdf/doc/snippets/multipageview.qml b/src/pdf/doc/snippets/multipageview.qml
new file mode 100644
index 000000000..113444165
--- /dev/null
+++ b/src/pdf/doc/snippets/multipageview.qml
@@ -0,0 +1,11 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+//! [0]
+import QtQuick
+import QtQuick.Pdf
+
+PdfMultiPageView {
+ document: PdfDocument { source: "my.pdf" }
+}
+//! [0]
diff --git a/src/pdf/doc/snippets/qtpdf-build.cmake b/src/pdf/doc/snippets/qtpdf-build.cmake
index d46b9c3ee..b4372d411 100644
--- a/src/pdf/doc/snippets/qtpdf-build.cmake
+++ b/src/pdf/doc/snippets/qtpdf-build.cmake
@@ -1,2 +1,2 @@
-find_package(Qt5 COMPONENTS Pdf REQUIRED)
-target_link_libraries(mytarget Qt5::Pdf)
+find_package(Qt6 REQUIRED COMPONENTS Pdf)
+target_link_libraries(mytarget Qt6::Pdf)
diff --git a/src/pdf/doc/snippets/qtpdf_build_snippet.qdoc b/src/pdf/doc/snippets/qtpdf_build_snippet.qdoc
index 25593b1ee..7d30ccdfd 100644
--- a/src/pdf/doc/snippets/qtpdf_build_snippet.qdoc
+++ b/src/pdf/doc/snippets/qtpdf_build_snippet.qdoc
@@ -1,35 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
//! [0]
QT += pdf
//! [0]
-
-
-//! [1]
-#include <QtPdf>
-//! [1]
diff --git a/src/pdf/doc/src/qtpdf-examples.qdoc b/src/pdf/doc/src/qtpdf-examples.qdoc
index 9daa0e7f8..02dc23dc2 100644
--- a/src/pdf/doc/src/qtpdf-examples.qdoc
+++ b/src/pdf/doc/src/qtpdf-examples.qdoc
@@ -1,33 +1,8 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\group qtpdf-examples
- \ingroup all-examples
\title Qt PDF Examples
\brief Using the classes and types in the Qt PDF module.
diff --git a/src/pdf/doc/src/qtpdf-index.qdoc b/src/pdf/doc/src/qtpdf-index.qdoc
index b32787eb5..b72619fbf 100644
--- a/src/pdf/doc/src/qtpdf-index.qdoc
+++ b/src/pdf/doc/src/qtpdf-index.qdoc
@@ -1,29 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\page qtpdf-index.html
@@ -36,8 +12,34 @@
and renders pages from it according to the options provided by
the \l QPdfDocumentRenderOptions class. The \l QPdfPageRenderer
class manages a queue that collects all render requests. The
- \l QPdfPageNavigation class handles the navigation through a
- PDF document.
+ \l QPdfPageNavigator class handles the navigation through a
+ PDF document. The \l QPdfSearchModel class searches for a string
+ and holds the search results. The QPdfBookmarkModel class holds the
+ table of contents, if present. The QPdfLinkModel holds information
+ about hyperlinks on a page. The \l QPdfView widget is a complete
+ PDF viewer, and the \l {PDF Viewer Widget Example} shows how to use it.
+
+ For Qt Quick applications, three kinds of full-featured viewer
+ components are provided. \l PdfMultiPageView should be your
+ first choice for the most common user experience: flicking
+ through the pages in the entire document.
+ \l PdfScrollablePageView shows one page at a time, with scrolling;
+ and \l PdfPageView shows one full page at a time, without scrolling.
+
+ The full-featured viewer components are composed of lower-level
+ QML components that can be used separately if you need to write a
+ more customized PDF viewing application: \l PdfDocument,
+ \l PdfPageImage, \l PdfPageNavigator, \l PdfSelection,
+ \l PdfSearchModel, \l PdfLinkModel, and \l PdfBookmarkModel.
+
+ If you only need to render page images, without features such as
+ text selection, search and navigation, this module includes a
+ \l QImageIOHandler plugin that treats PDF as a scalable
+ \l {Qt Image Formats}{image format}, similar to \l {Qt SVG}{SVG}.
+ You can simply use \l Image, and set the
+ \l {Image::currentFrame}{currentFrame} property to the page index
+ that you wish to display. If the PDF file does not render its own
+ background, the image has a transparent background.
\include module-use.qdocinc using qt module
\quotefile qtpdf-build.cmake
@@ -46,21 +48,10 @@
\section2 Building with qmake
- To include the definitions of the module's classes, use the
- following directive:
-
- \snippet qtpdf_build_snippet.qdoc 1
-
To link against the module, add this line to your qmake project file:
\snippet qtpdf_build_snippet.qdoc 0
- \section1 Articles and Guides
-
- \list
- \li \l{Qt PDF Overview}
- \endlist
-
\section1 Examples
\list
@@ -73,4 +64,17 @@
\li \l{Qt PDF C++ Classes}
\li \l{Qt Quick PDF QML Types}
\endlist
+
+ \section1 Articles and Guides
+ \list
+ \li {Qt PDF Platform Notes} {Platform Notes}
+ \endlist
+
+ \section1 Licenses and Attributions
+
+ Qt PDF is available under commercial licenses from \l{The Qt Company}.
+ In addition, it is available under the
+ \l{GNU Lesser General Public License, version 3}, or
+ the \l{GNU General Public License, version 2}.
+ See \l{Qt PDF Licensing} for further details about this module.
*/
diff --git a/src/pdf/doc/src/qtpdf-licensing.qdoc b/src/pdf/doc/src/qtpdf-licensing.qdoc
new file mode 100644
index 000000000..190ee8331
--- /dev/null
+++ b/src/pdf/doc/src/qtpdf-licensing.qdoc
@@ -0,0 +1,18 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+ \group qtpdf-licensing
+ \title Qt PDF Licensing
+
+ Qt PDF is available under commercial licenses from \l{The Qt Company}.
+ In addition, it is available under the
+ \l{GNU Lesser General Public License, version 3}, or
+ the \l{GNU General Public License, version 2}.
+ See \l{Qt Licensing} for further details.
+
+ The module includes a snapshot of PDFium. As such, users need to respect
+ the licenses of PDFium and third-party code included in it.
+
+ Third party licenses included in the sources are:
+*/
diff --git a/src/pdf/doc/src/qtpdf-module.qdoc b/src/pdf/doc/src/qtpdf-module.qdoc
index 4170deb38..e2ca8e4ce 100644
--- a/src/pdf/doc/src/qtpdf-module.qdoc
+++ b/src/pdf/doc/src/qtpdf-module.qdoc
@@ -1,29 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
@@ -37,11 +13,6 @@
The Qt PDF module contains classes and functions for rendering
PDF documents.
- To include the definitions of the module's classes, use the
- following directive:
-
- \snippet qtpdf_build_snippet.qdoc 1
-
\if !defined(qtforpython)
To link against the module, add this line to your qmake project file:
diff --git a/src/pdf/doc/src/qtpdf-platformnotes.qdoc b/src/pdf/doc/src/qtpdf-platformnotes.qdoc
new file mode 100644
index 000000000..f50be120d
--- /dev/null
+++ b/src/pdf/doc/src/qtpdf-platformnotes.qdoc
@@ -0,0 +1,11 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+ \page qtpdf-platformnotes.html
+ \title Qt PDF Platform Notes
+
+ Building Qt PDF for Android is currently
+ \l{https://bugreports.qt.io/browse/QTBUG-83459} {not supported} on Windows host platforms.
+*/
+
diff --git a/src/pdf/gn_run.pro b/src/pdf/gn_run.pro
deleted file mode 100644
index 70ee582a9..000000000
--- a/src/pdf/gn_run.pro
+++ /dev/null
@@ -1,69 +0,0 @@
-include($$QTWEBENGINE_OUT_ROOT/src/buildtools/qtbuildtools-config.pri)
-QT_FOR_CONFIG += buildtools-private
-
-TEMPLATE = aux
-
-qtConfig(debug_and_release): CONFIG += debug_and_release
-qtConfig(build_all): CONFIG += build_all
-
-qtConfig(webengine-system-ninja) {
- QT_TOOL.ninja.binary = ninja
-} else {
- QT_TOOL.ninja.binary = $$shell_quote($$shell_path($$ninjaPath()))
-}
-
-win32 {
- # Add the gnuwin32/bin subdir of qt5.git to PATH. Needed for calling bison and friends.
- gnuwin32path.name = PATH
- gnuwin32path.value = $$shell_path($$clean_path($$QTWEBENGINE_ROOT/../gnuwin32/bin))
- gnuwin32path.CONFIG += prepend
- exists($$gnuwin32path.value): QT_TOOL_ENV = gnuwin32path
-}
-
-qtPrepareTool(NINJA, ninja)
-QT_TOOL_ENV =
-
-build_pass|!debug_and_release {
- gn_binary = gn
-
- runninja.target = run_ninja
-
- # fixme: refine args
- gn_args = $$gnPdfArgs()
-
- # fixme: qtwebengine_target
- gn_args += "qtwebengine_target=\"$$system_path($$OUT_PWD/$$getConfigDir()):QtPdf\""
-
- # fixme:
- !qtConfig(webengine-system-gn) {
- gn_binary = $$system_quote($$system_path($$gnPath()))
- }
-
- gn_args = $$system_quote($$gn_args)
- gn_src_root = $$system_quote($$system_path($$QTWEBENGINE_ROOT/$$getChromiumSrcDir()))
- gn_build_root = $$system_quote($$system_path($$OUT_PWD/$$getConfigDir()))
- gn_python = "--script-executable=$$pythonPathForSystem()"
- gn_run = $$gn_binary gen $$gn_build_root $$gn_python --args=$$gn_args --root=$$gn_src_root
-
- message("Running: $$gn_run ")
- !system($$gn_run) {
- error("GN run error!")
- }
-
- ninjaflags = $$(NINJAFLAGS)
- isEmpty(ninjaflags):!silent: ninjaflags = "-v"
-
- runninja.commands = $$NINJA $$ninjaflags -C $$gn_build_root QtPdf
- QMAKE_EXTRA_TARGETS += runninja
-
- build_pass:build_all: default_target.target = all
- else: default_target.target = first
- default_target.depends = runninja
- QMAKE_EXTRA_TARGETS += default_target
-}
-
-!build_pass:debug_and_release {
- # Special GNU make target for the meta Makefile that ensures that our debug and release Makefiles won't both run ninja in parallel.
- notParallel.target = .NOTPARALLEL
- QMAKE_EXTRA_TARGETS += notParallel
-}
diff --git a/src/pdf/jsbridge.cpp b/src/pdf/jsbridge.cpp
deleted file mode 100644
index 33d3b2465..000000000
--- a/src/pdf/jsbridge.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "fpdfsdk/javascript/JS_Runtime_Stub.cpp"
-
diff --git a/src/pdf/pdf.pro b/src/pdf/pdf.pro
deleted file mode 100644
index fcdfafab5..000000000
--- a/src/pdf/pdf.pro
+++ /dev/null
@@ -1,29 +0,0 @@
-include($$QTWEBENGINE_OUT_ROOT/src/buildtools/qtbuildtools-config.pri)
-QT_FOR_CONFIG += buildtools-private
-TEMPLATE = subdirs
-pdfcore.file = pdfcore.pro
-pdfcore_generator.file = pdfcore_generator.pro
-gn_run.file = gn_run.pro
-
-gn_run.depends = pdfcore_generator
-pdfcore.depends = gn_run
-quick.depends = pdfcore
-
-!qtConfig(webengine-qtpdf-support):qtConfig(build-qtpdf)::!build_pass {
- !qtwebengine_makeCheckPdfError() {
- errorbuild.commands = @echo $$shell_quote("QtPdf will not be built. $${skipBuildReason}")
- } else {
- errorbuild.commands = @echo $$shell_quote("QtPdf module will not be built for unknown reason, please open a bug report at https://bugreports.qt.io")
- }
- errorbuild.CONFIG = phony
- QMAKE_EXTRA_TARGETS += errorbuild
- first.depends += errorbuild
- QMAKE_EXTRA_TARGETS += first
-} else {
- SUBDIRS += \
- pdfcore_generator \
- gn_run \
- pdfcore \
- quick
-}
-
diff --git a/src/pdf/pdfcore.pro b/src/pdf/pdfcore.pro
deleted file mode 100644
index c87722b7e..000000000
--- a/src/pdf/pdfcore.pro
+++ /dev/null
@@ -1,93 +0,0 @@
-TARGET = QtPdf
-MODULE = pdf
-
-QT += gui core core-private
-QT_PRIVATE += network
-
-TEMPLATE = lib
-
-INCLUDEPATH += $$QTWEBENGINE_ROOT/src/pdf
-CHROMIUM_SRC_DIR = $$QTWEBENGINE_ROOT/$$getChromiumSrcDir()
-CHROMIUM_GEN_DIR = $$OUT_PWD/../$$getConfigDir()/gen
-INCLUDEPATH += $$QTWEBENGINE_ROOT/src/pdf \
- $$CHROMIUM_GEN_DIR \
- $$CHROMIUM_SRC_DIR \
- api
-
-DEFINES += QT_BUILD_PDF_LIB
-win32: DEFINES += NOMINMAX
-
-linking_pri = $$OUT_PWD/$$getConfigDir()/$${TARGET}.pri
-!include($$linking_pri) {
- error("Could not find the linking information that gn should have generated.")
-}
-
-isEmpty(NINJA_OBJECTS): error("Missing object files from QtPdf linking pri.")
-isEmpty(NINJA_LFLAGS): error("Missing linker flags from QtPdf linking pri")
-isEmpty(NINJA_LIBS): error("Missing library files from QtPdf linking pri")
-
-NINJA_OBJECTS = $$eval($$list($$NINJA_OBJECTS))
-RSP_FILE = $$OUT_PWD/$$getConfigDir()/$${TARGET}.rsp
-for(object, NINJA_OBJECTS): RSP_CONTENT += $$object
-write_file($$RSP_FILE, RSP_CONTENT)
-
-macos:LIBS_PRIVATE += -Wl,-filelist,$$shell_quote($$RSP_FILE)
-linux:LIBS_PRIVATE += @$$RSP_FILE
-
-# QTBUG-58710 add main rsp file on windows
-win32:QMAKE_LFLAGS += @$$RSP_FILE
-
-!isEmpty(NINJA_ARCHIVES) {
- linux: LIBS_PRIVATE += -Wl,--start-group $$NINJA_ARCHIVES -Wl,--end-group
- else: LIBS_PRIVATE += $$NINJA_ARCHIVES
-}
-
-LIBS_PRIVATE += $$NINJA_LIB_DIRS $$NINJA_LIBS
-
-QMAKE_DOCS = $$PWD/doc/qtpdf.qdocconf
-
-gcc {
- QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-parameter
-}
-
-msvc {
- QMAKE_CXXFLAGS_WARN_ON += -wd"4100"
-}
-
-ios: OBJECTS += $$NINJA_OBJECTS
-
-SOURCES += \
- qpdfbookmarkmodel.cpp \
- qpdfdestination.cpp \
- qpdfdocument.cpp \
- qpdflinkmodel.cpp \
- qpdfpagenavigation.cpp \
- qpdfpagerenderer.cpp \
- qpdfsearchmodel.cpp \
- qpdfsearchresult.cpp \
- qpdfselection.cpp \
-
-# all "public" headers must be in "api" for sync script and to hide auto generated headers
-# by Chromium in case of in-source build
-
-HEADERS += \
- api/qpdfbookmarkmodel.h \
- api/qpdfdestination.h \
- api/qpdfdestination_p.h \
- api/qpdfdocument.h \
- api/qpdfdocument_p.h \
- api/qpdfdocumentrenderoptions.h \
- api/qtpdfglobal.h \
- api/qpdflinkmodel_p.h \
- api/qpdflinkmodel_p_p.h \
- api/qpdfnamespace.h \
- api/qpdfpagenavigation.h \
- api/qpdfpagerenderer.h \
- api/qpdfsearchmodel.h \
- api/qpdfsearchmodel_p.h \
- api/qpdfsearchresult.h \
- api/qpdfsearchresult_p.h \
- api/qpdfselection.h \
- api/qpdfselection_p.h \
-
-load(qt_module)
diff --git a/src/pdf/pdfcore_generator.pro b/src/pdf/pdfcore_generator.pro
deleted file mode 100644
index e5c7258b7..000000000
--- a/src/pdf/pdfcore_generator.pro
+++ /dev/null
@@ -1,15 +0,0 @@
-qtConfig(debug_and_release): CONFIG += debug_and_release
-
-TARGET = QtPdf
-TEMPLATE = lib
-CONFIG = gn_generator $$CONFIG
-CONFIG -=static # note we still do static when linking
-GN_SRC_DIR = $$PWD
-GN_FILE = $$OUT_PWD/$$getConfigDir()/BUILD.gn
-GN_FIND_MOCABLES_SCRIPT = $$shell_path($$QTWEBENGINE_ROOT/tools/scripts/gn_find_mocables.py)
-GN_RUN_BINARY_SCRIPT = $$shell_path($$QTWEBENGINE_ROOT/tools/scripts/gn_run_binary.py)
-GN_IMPORTS = $$PWD/qtpdf.gni
-GN_CREATE_PRI = true
-QMAKE_INTERNAL_INCLUDED_FILES = $$GN_IMPORTS $$GN_INCLUDES $$GN_FILE
-
-
diff --git a/src/pdf/plugins/imageformats/pdf/CMakeLists.txt b/src/pdf/plugins/imageformats/pdf/CMakeLists.txt
new file mode 100644
index 000000000..73a0b3144
--- /dev/null
+++ b/src/pdf/plugins/imageformats/pdf/CMakeLists.txt
@@ -0,0 +1,13 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_plugin(QPdfPlugin
+ OUTPUT_NAME qpdf
+ PLUGIN_TYPE imageformats
+ SOURCES
+ main.cpp
+ qpdfiohandler.cpp qpdfiohandler_p.h
+ LIBRARIES
+ Qt::PdfPrivate
+)
+
diff --git a/src/pdf/plugins/imageformats/pdf/main.cpp b/src/pdf/plugins/imageformats/pdf/main.cpp
new file mode 100644
index 000000000..cb69c4ca1
--- /dev/null
+++ b/src/pdf/plugins/imageformats/pdf/main.cpp
@@ -0,0 +1,41 @@
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qpdfiohandler_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class QPdfPlugin : public QImageIOPlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID QImageIOHandlerFactoryInterface_iid FILE "pdf.json")
+
+public:
+ Capabilities capabilities(QIODevice *device, const QByteArray &format) const override;
+ QImageIOHandler *create(QIODevice *device, const QByteArray &format = QByteArray()) const override;
+};
+
+QImageIOPlugin::Capabilities QPdfPlugin::capabilities(QIODevice *device, const QByteArray &format) const
+{
+ if (format == "pdf")
+ return Capabilities(CanRead);
+ if (!format.isEmpty())
+ return {};
+
+ Capabilities cap;
+ if (device->isReadable() && QPdfIOHandler::canRead(device))
+ cap |= CanRead;
+ return cap;
+}
+
+QImageIOHandler *QPdfPlugin::create(QIODevice *device, const QByteArray &format) const
+{
+ QPdfIOHandler *hand = new QPdfIOHandler();
+ hand->setDevice(device);
+ hand->setFormat(format);
+ return hand;
+}
+
+QT_END_NAMESPACE
+
+#include "main.moc"
diff --git a/src/plugins/imageformats/pdf/pdf.json b/src/pdf/plugins/imageformats/pdf/pdf.json
index 1f5268ca1..1f5268ca1 100644
--- a/src/plugins/imageformats/pdf/pdf.json
+++ b/src/pdf/plugins/imageformats/pdf/pdf.json
diff --git a/src/pdf/plugins/imageformats/pdf/qpdfiohandler.cpp b/src/pdf/plugins/imageformats/pdf/qpdfiohandler.cpp
new file mode 100644
index 000000000..bb3e7c929
--- /dev/null
+++ b/src/pdf/plugins/imageformats/pdf/qpdfiohandler.cpp
@@ -0,0 +1,225 @@
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qpdfiohandler_p.h"
+#include <QLoggingCategory>
+#include <QPainter>
+#include <QtPdf/private/qpdffile_p.h>
+
+QT_BEGIN_NAMESPACE
+
+Q_LOGGING_CATEGORY(qLcPdf, "qt.imageformat.pdf")
+
+QPdfIOHandler::QPdfIOHandler()
+{
+}
+
+QPdfIOHandler::~QPdfIOHandler()
+{
+ if (m_ownsDocument)
+ delete m_doc;
+}
+
+bool QPdfIOHandler::canRead() const
+{
+ if (!device())
+ return false;
+ if (m_loaded)
+ return true;
+ if (QPdfIOHandler::canRead(device())) {
+ setFormat("pdf");
+ return true;
+ }
+ return false;
+}
+
+bool QPdfIOHandler::canRead(QIODevice *device)
+{
+ char buf[6];
+ device->peek(buf, 6);
+ return (!qstrncmp(buf, "%PDF-", 5) || Q_UNLIKELY(!qstrncmp(buf, "\012%PDF-", 6)));
+}
+
+int QPdfIOHandler::currentImageNumber() const
+{
+ return m_page;
+}
+
+QRect QPdfIOHandler::currentImageRect() const
+{
+ return QRect(QPoint(0, 0), m_doc->pagePointSize(m_page).toSize());
+}
+
+int QPdfIOHandler::imageCount() const
+{
+ int ret = 0;
+ if (const_cast<QPdfIOHandler *>(this)->load(device()))
+ ret = m_doc->pageCount();
+ qCDebug(qLcPdf) << ret;
+ return ret;
+}
+
+bool QPdfIOHandler::read(QImage *image)
+{
+ if (load(device())) {
+ if (m_doc.isNull() || m_page >= m_doc->pageCount())
+ return false;
+ if (m_page < 0)
+ m_page = 0;
+ const bool xform = (m_clipRect.isValid() || m_scaledSize.isValid() || m_scaledClipRect.isValid());
+ QSize pageSize = m_doc->pagePointSize(m_page).toSize();
+ QSize finalSize = pageSize;
+ QRectF bounds;
+ if (xform && !finalSize.isEmpty()) {
+ bounds = QRectF(QPointF(0,0), QSizeF(finalSize));
+ QPoint tr1, tr2;
+ QSizeF sc(1, 1);
+ if (m_clipRect.isValid()) {
+ tr1 = -m_clipRect.topLeft();
+ finalSize = m_clipRect.size();
+ }
+ if (m_scaledSize.isValid()) {
+ sc = QSizeF(qreal(m_scaledSize.width()) / finalSize.width(),
+ qreal(m_scaledSize.height()) / finalSize.height());
+ finalSize = m_scaledSize;
+ pageSize = m_scaledSize;
+ }
+ if (m_scaledClipRect.isValid()) {
+ tr2 = -m_scaledClipRect.topLeft();
+ finalSize = m_scaledClipRect.size();
+ }
+ QTransform t;
+ t.translate(tr2.x(), tr2.y());
+ t.scale(sc.width(), sc.height());
+ t.translate(tr1.x(), tr1.y());
+ bounds = t.mapRect(bounds);
+ }
+ qCDebug(qLcPdf) << m_page << finalSize;
+ if (image->size() != finalSize || !image->reinterpretAsFormat(QImage::Format_ARGB32_Premultiplied)) {
+ *image = QImage(finalSize, QImage::Format_ARGB32_Premultiplied);
+ if (!finalSize.isEmpty() && image->isNull()) {
+ // avoid QTBUG-68229
+ qWarning("QPdfIOHandler: QImage allocation failed (size %i x %i)", finalSize.width(), finalSize.height());
+ return false;
+ }
+ }
+ if (!finalSize.isEmpty()) {
+ QPdfDocumentRenderOptions options;
+ if (m_scaledClipRect.isValid())
+ options.setScaledClipRect(m_scaledClipRect);
+ options.setScaledSize(pageSize);
+ image->fill(m_backColor.rgba());
+ QPainter p(image);
+ if (!m_doc.isNull()) {
+ QImage pageImage = m_doc->render(m_page, finalSize, options);
+ p.drawImage(0, 0, pageImage);
+ p.end();
+ }
+ }
+ return true;
+ }
+
+ return false;
+}
+
+QVariant QPdfIOHandler::option(ImageOption option) const
+{
+ switch (option) {
+ case ImageFormat:
+ return QImage::Format_ARGB32_Premultiplied;
+ case Size:
+ const_cast<QPdfIOHandler *>(this)->load(device());
+ return m_doc->pagePointSize(qMax(0, m_page));
+ case ClipRect:
+ return m_clipRect;
+ case ScaledSize:
+ return m_scaledSize;
+ case ScaledClipRect:
+ return m_scaledClipRect;
+ case BackgroundColor:
+ return m_backColor;
+ case Name:
+ return m_doc->metaData(QPdfDocument::MetaDataField::Title);
+ default:
+ break;
+ }
+ return QVariant();
+}
+
+void QPdfIOHandler::setOption(ImageOption option, const QVariant & value)
+{
+ switch (option) {
+ case ClipRect:
+ m_clipRect = value.toRect();
+ break;
+ case ScaledSize:
+ m_scaledSize = value.toSize();
+ break;
+ case ScaledClipRect:
+ m_scaledClipRect = value.toRect();
+ break;
+ case BackgroundColor:
+ m_backColor = value.value<QColor>();
+ break;
+ default:
+ break;
+ }
+}
+
+bool QPdfIOHandler::supportsOption(ImageOption option) const
+{
+ switch (option)
+ {
+ case ImageFormat:
+ case Size:
+ case ClipRect:
+ case ScaledSize:
+ case ScaledClipRect:
+ case BackgroundColor:
+ case Name:
+ return true;
+ default:
+ break;
+ }
+ return false;
+}
+
+bool QPdfIOHandler::jumpToImage(int frame)
+{
+ qCDebug(qLcPdf) << frame;
+ if (frame < 0 || frame >= imageCount())
+ return false;
+ m_page = frame;
+ return true;
+}
+
+bool QPdfIOHandler::jumpToNextImage()
+{
+ return jumpToImage(m_page + 1);
+}
+
+bool QPdfIOHandler::load(QIODevice *device)
+{
+ if (m_loaded)
+ return true;
+ if (format().isEmpty())
+ if (!canRead())
+ return false;
+
+ QPdfFile *pdfFile = qobject_cast<QPdfFile *>(device);
+ if (pdfFile) {
+ m_doc = pdfFile->document();
+ m_ownsDocument = false;
+ qCDebug(qLcPdf) << "loading via QPdfFile, reusing document instance" << m_doc;
+ } else {
+ m_doc = new QPdfDocument();
+ m_ownsDocument = true;
+ m_doc->load(device);
+ qCDebug(qLcPdf) << "loading via new document instance" << m_doc;
+ }
+ m_loaded = (m_doc->error() == QPdfDocument::Error::None);
+
+ return m_loaded;
+}
+
+QT_END_NAMESPACE
diff --git a/src/pdf/plugins/imageformats/pdf/qpdfiohandler_p.h b/src/pdf/plugins/imageformats/pdf/qpdfiohandler_p.h
new file mode 100644
index 000000000..c4d8e0f9a
--- /dev/null
+++ b/src/pdf/plugins/imageformats/pdf/qpdfiohandler_p.h
@@ -0,0 +1,57 @@
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QPDFIOHANDLER_H
+#define QPDFIOHANDLER_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtGui/qimageiohandler.h>
+#include <QtPdf/QPdfDocument>
+
+QT_BEGIN_NAMESPACE
+
+class QPdfIOHandler : public QImageIOHandler
+{
+public:
+ QPdfIOHandler();
+ ~QPdfIOHandler() override;
+ bool canRead() const override;
+ static bool canRead(QIODevice *device);
+ int currentImageNumber() const override;
+ QRect currentImageRect() const override;
+ int imageCount() const override;
+ bool read(QImage *image) override;
+ QVariant option(ImageOption option) const override;
+ void setOption(ImageOption option, const QVariant & value) override;
+ bool supportsOption(ImageOption option) const override;
+ bool jumpToImage(int frame) override;
+ bool jumpToNextImage() override;
+
+private:
+ bool load(QIODevice *device);
+
+private:
+ QPointer<QPdfDocument> m_doc;
+ int m_page = -1;
+
+ QRect m_clipRect;
+ QSize m_scaledSize;
+ QRect m_scaledClipRect;
+ QColor m_backColor = Qt::transparent;
+ bool m_loaded = false;
+ bool m_ownsDocument = false;
+};
+
+QT_END_NAMESPACE
+
+#endif // QPDFIOHANDLER_H
diff --git a/src/pdf/qpdfbookmarkmodel.cpp b/src/pdf/qpdfbookmarkmodel.cpp
index c9c365568..93dbf5d1f 100644
--- a/src/pdf/qpdfbookmarkmodel.cpp
+++ b/src/pdf/qpdfbookmarkmodel.cpp
@@ -1,38 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qpdfbookmarkmodel.h"
@@ -42,19 +9,21 @@
#include "third_party/pdfium/public/fpdf_doc.h"
#include "third_party/pdfium/public/fpdfview.h"
+#include <QLoggingCategory>
+#include <QMetaEnum>
#include <QPointer>
#include <QScopedPointer>
#include <private/qabstractitemmodel_p.h>
QT_BEGIN_NAMESPACE
+Q_LOGGING_CATEGORY(qLcBM, "qt.pdf.bookmarks")
+
class BookmarkNode
{
public:
explicit BookmarkNode(BookmarkNode *parentNode = nullptr)
: m_parentNode(parentNode)
- , m_level(0)
- , m_pageNumber(0)
{
}
@@ -81,7 +50,7 @@ public:
int childCount() const
{
- return m_childNodes.count();
+ return m_childNodes.size();
}
int row() const
@@ -127,32 +96,49 @@ public:
m_pageNumber = pageNumber;
}
+ QPointF location() const
+ {
+ return m_location;
+ }
+
+ void setLocation(qreal x, qreal y)
+ {
+ m_location = QPointF(x, y);
+ }
+
+ qreal zoom() const
+ {
+ return m_zoom;
+ }
+
+ void setZoom(qreal zoom)
+ {
+ m_zoom = zoom;
+ }
+
private:
- QVector<BookmarkNode*> m_childNodes;
+ QList<BookmarkNode*> m_childNodes;
BookmarkNode *m_parentNode;
QString m_title;
- int m_level;
- int m_pageNumber;
+ int m_level = 0;
+ int m_pageNumber = 0;
+ QPointF m_location;
+ qreal m_zoom = 0;
};
-class QPdfBookmarkModelPrivate : public QAbstractItemModelPrivate
+struct QPdfBookmarkModelPrivate
{
-public:
QPdfBookmarkModelPrivate()
- : QAbstractItemModelPrivate()
- , m_rootNode(new BookmarkNode(nullptr))
+ : m_rootNode(new BookmarkNode(nullptr))
, m_document(nullptr)
- , m_structureMode(QPdfBookmarkModel::TreeMode)
{
}
void rebuild()
{
- Q_Q(QPdfBookmarkModel);
-
- const bool documentAvailable = (m_document && m_document->status() == QPdfDocument::Ready);
+ const bool documentAvailable = (m_document && m_document->status() == QPdfDocument::Status::Ready);
if (documentAvailable) {
q->beginResetModel();
@@ -179,21 +165,29 @@ public:
while (bookmark) {
BookmarkNode *childBookmarkNode = nullptr;
- if (m_structureMode == QPdfBookmarkModel::TreeMode) {
- childBookmarkNode = new BookmarkNode(parentBookmarkNode);
- parentBookmarkNode->appendChild(childBookmarkNode);
- } else if (m_structureMode == QPdfBookmarkModel::ListMode) {
- childBookmarkNode = new BookmarkNode(m_rootNode.data());
- m_rootNode->appendChild(childBookmarkNode);
- }
+ childBookmarkNode = new BookmarkNode(parentBookmarkNode);
+ parentBookmarkNode->appendChild(childBookmarkNode);
+ Q_ASSERT(childBookmarkNode);
const int titleLength = int(FPDFBookmark_GetTitle(bookmark, nullptr, 0));
- QVector<ushort> titleBuffer(titleLength);
- FPDFBookmark_GetTitle(bookmark, titleBuffer.data(), quint32(titleBuffer.length()));
+ QList<char16_t> titleBuffer(titleLength);
+ FPDFBookmark_GetTitle(bookmark, titleBuffer.data(), quint32(titleBuffer.size()));
const FPDF_DEST dest = FPDFBookmark_GetDest(document, bookmark);
const int pageNumber = FPDFDest_GetDestPageIndex(document, dest);
+ const qreal pageHeight = m_document->pagePointSize(pageNumber).height();
+ FPDF_BOOL hasX, hasY, hasZoom;
+ FS_FLOAT x, y, zoom;
+ bool ok = FPDFDest_GetLocationInPage(dest, &hasX, &hasY, &hasZoom, &x, &y, &zoom);
+ if (ok) {
+ if (hasX && hasY)
+ childBookmarkNode->setLocation(x, pageHeight - y);
+ if (hasZoom)
+ childBookmarkNode->setZoom(zoom);
+ } else {
+ qCWarning(qLcBM) << "bookmark with invalid location and/or zoom" << x << y << zoom;
+ }
childBookmarkNode->setTitle(QString::fromUtf16(titleBuffer.data()));
childBookmarkNode->setLevel(level);
@@ -211,30 +205,67 @@ public:
rebuild();
}
- Q_DECLARE_PUBLIC(QPdfBookmarkModel)
+ QPdfBookmarkModel *q = nullptr;
QScopedPointer<BookmarkNode> m_rootNode;
QPointer<QPdfDocument> m_document;
- QPdfBookmarkModel::StructureMode m_structureMode;
+ QHash<int, QByteArray> m_roleNames;
};
+/*!
+ \class QPdfBookmarkModel
+ \since 5.10
+ \inmodule QtPdf
+ \inherits QAbstractItemModel
+
+ \brief The QPdfBookmarkModel class holds a tree of of links (anchors)
+ within a PDF document, such as the table of contents.
+
+ This is used in the \l {Model/View Programming} paradigm to display a
+ table of contents in the form of a tree or list.
+*/
+
+/*!
+ \enum QPdfBookmarkModel::Role
+
+ \value Title The name of the bookmark for display.
+ \value Level The level of indentation.
+ \value Page The page number of the destination (int).
+ \value Location The position of the destination (QPointF).
+ \value Zoom The suggested zoom level (qreal).
+ \omitvalue NRoles
+*/
+
+/*!
+ Constructs a new bookmark model with parent object \a parent.
+*/
QPdfBookmarkModel::QPdfBookmarkModel(QObject *parent)
- : QAbstractItemModel(*new QPdfBookmarkModelPrivate, parent)
+ : QAbstractItemModel(parent), d(new QPdfBookmarkModelPrivate)
{
+ d->q = this;
+ d->m_roleNames = QAbstractItemModel::roleNames();
+ QMetaEnum rolesMetaEnum = metaObject()->enumerator(metaObject()->indexOfEnumerator("Role"));
+ for (int r = Qt::UserRole; r < int(Role::NRoles); ++r)
+ d->m_roleNames.insert(r, QByteArray(rolesMetaEnum.valueToKey(r)).toLower());
}
+/*!
+ Destroys the model.
+*/
+QPdfBookmarkModel::~QPdfBookmarkModel() = default;
+
QPdfDocument* QPdfBookmarkModel::document() const
{
- Q_D(const QPdfBookmarkModel);
-
return d->m_document;
}
+/*!
+ \property QPdfBookmarkModel::document
+ \brief the PDF document in which bookmarks are to be found.
+*/
void QPdfBookmarkModel::setDocument(QPdfDocument *document)
{
- Q_D(QPdfBookmarkModel);
-
if (d->m_document == document)
return;
@@ -250,64 +281,56 @@ void QPdfBookmarkModel::setDocument(QPdfDocument *document)
d->rebuild();
}
-QPdfBookmarkModel::StructureMode QPdfBookmarkModel::structureMode() const
-{
- Q_D(const QPdfBookmarkModel);
-
- return d->m_structureMode;
-}
-
-void QPdfBookmarkModel::setStructureMode(StructureMode mode)
-{
- Q_D(QPdfBookmarkModel);
-
- if (d->m_structureMode == mode)
- return;
-
- d->m_structureMode = mode;
- emit structureModeChanged(d->m_structureMode);
-
- d->rebuild();
-}
-
+/*!
+ \reimp
+*/
int QPdfBookmarkModel::columnCount(const QModelIndex &parent) const
{
+ Q_UNUSED(parent);
return 1;
}
+/*!
+ \reimp
+*/
QHash<int, QByteArray> QPdfBookmarkModel::roleNames() const
{
- QHash<int, QByteArray> names;
-
- names[TitleRole] = "title";
- names[LevelRole] = "level";
- names[PageNumberRole] = "pageNumber";
-
- return names;
+ return d->m_roleNames;
}
+/*!
+ \reimp
+*/
QVariant QPdfBookmarkModel::data(const QModelIndex &index, int role) const
{
if (!index.isValid())
return QVariant();
const BookmarkNode *node = static_cast<BookmarkNode*>(index.internalPointer());
- switch (role) {
- case TitleRole:
+ switch (Role(role)) {
+ case Role::Title:
return node->title();
- case LevelRole:
+ case Role::Level:
return node->level();
- case PageNumberRole:
+ case Role::Page:
return node->pageNumber();
- default:
- return QVariant();
+ case Role::Location:
+ return node->location();
+ case Role::Zoom:
+ return node->zoom();
+ case Role::NRoles:
+ break;
}
+ if (role == Qt::DisplayRole)
+ return node->title();
+ return QVariant();
}
+/*!
+ \reimp
+*/
QModelIndex QPdfBookmarkModel::index(int row, int column, const QModelIndex &parent) const
{
- Q_D(const QPdfBookmarkModel);
-
if (!hasIndex(row, column, parent))
return QModelIndex();
@@ -325,10 +348,11 @@ QModelIndex QPdfBookmarkModel::index(int row, int column, const QModelIndex &par
return QModelIndex();
}
+/*!
+ \reimp
+*/
QModelIndex QPdfBookmarkModel::parent(const QModelIndex &index) const
{
- Q_D(const QPdfBookmarkModel);
-
if (!index.isValid())
return QModelIndex();
@@ -341,10 +365,11 @@ QModelIndex QPdfBookmarkModel::parent(const QModelIndex &index) const
return createIndex(parentNode->row(), 0, parentNode);
}
+/*!
+ \reimp
+*/
int QPdfBookmarkModel::rowCount(const QModelIndex &parent) const
{
- Q_D(const QPdfBookmarkModel);
-
if (parent.column() > 0)
return 0;
diff --git a/src/pdf/qpdfbookmarkmodel.h b/src/pdf/qpdfbookmarkmodel.h
new file mode 100644
index 000000000..5a3c24f84
--- /dev/null
+++ b/src/pdf/qpdfbookmarkmodel.h
@@ -0,0 +1,60 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QPDFBOOKMARKMODEL_H
+#define QPDFBOOKMARKMODEL_H
+
+#include <QtPdf/qtpdfglobal.h>
+#include <QtCore/qabstractitemmodel.h>
+
+QT_BEGIN_NAMESPACE
+
+class QPdfDocument;
+struct QPdfBookmarkModelPrivate;
+
+class Q_PDF_EXPORT QPdfBookmarkModel : public QAbstractItemModel
+{
+ Q_OBJECT
+
+ Q_PROPERTY(QPdfDocument* document READ document WRITE setDocument NOTIFY documentChanged)
+
+public:
+ enum class Role : int
+ {
+ Title = Qt::UserRole,
+ Level,
+ Page,
+ Location,
+ Zoom,
+ NRoles
+ };
+ Q_ENUM(Role)
+
+ QPdfBookmarkModel() : QPdfBookmarkModel(nullptr) {}
+ explicit QPdfBookmarkModel(QObject *parent);
+ ~QPdfBookmarkModel() override;
+
+ QPdfDocument* document() const;
+ void setDocument(QPdfDocument *document);
+
+ QVariant data(const QModelIndex &index, int role) const override;
+ QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
+ QModelIndex parent(const QModelIndex &index) const override;
+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
+ int columnCount(const QModelIndex &parent = QModelIndex()) const override;
+ QHash<int, QByteArray> roleNames() const override;
+
+Q_SIGNALS:
+ void documentChanged(QPdfDocument *document);
+
+private:
+ std::unique_ptr<QPdfBookmarkModelPrivate> d;
+
+ Q_PRIVATE_SLOT(d, void _q_documentStatusChanged())
+
+ friend struct QPdfBookmarkModelPrivate;
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/pdf/qpdfdestination.cpp b/src/pdf/qpdfdestination.cpp
deleted file mode 100644
index b70e031ca..000000000
--- a/src/pdf/qpdfdestination.cpp
+++ /dev/null
@@ -1,145 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qpdfdestination.h"
-#include "qpdfdestination_p.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QPdfDestination
- \since 5.15
- \inmodule QtPdf
-
- \brief The QPdfDestination class defines a location on a page in a PDF
- document, and a suggested zoom level at which it is intended to be viewed.
-*/
-
-/*!
- Constructs an invalid Destination.
-
- \sa valid
-*/
-QPdfDestination::QPdfDestination()
- : d(new QPdfDestinationPrivate())
-{
-}
-
-QPdfDestination::QPdfDestination(int page, QPointF location, qreal zoom)
- : d(new QPdfDestinationPrivate(page, location, zoom))
-{
-}
-
-QPdfDestination::QPdfDestination(QPdfDestinationPrivate *d)
- : d(d)
-{
-}
-
-QPdfDestination::QPdfDestination(const QPdfDestination &other)
- : d(other.d)
-{
-}
-
-QPdfDestination::QPdfDestination(QPdfDestination &&other) noexcept
- : d(std::move(other.d))
-{
-}
-
-QPdfDestination::~QPdfDestination()
-{
-}
-
-QPdfDestination &QPdfDestination::operator=(const QPdfDestination &other)
-{
- d = other.d;
- return *this;
-}
-
-/*!
- \property QPdfDestination::valid
-
- This property holds whether the destination is valid.
-*/
-bool QPdfDestination::isValid() const
-{
- return d->page >= 0;
-}
-
-/*!
- \property QPdfDestination::page
-
- This property holds the page number.
-*/
-int QPdfDestination::page() const
-{
- return d->page;
-}
-
-/*!
- \property QPdfDestination::location
-
- This property holds the location on the page, in units of points.
-*/
-QPointF QPdfDestination::location() const
-{
- return d->location;
-}
-
-/*!
- \property QPdfDestination::zoom
-
- This property holds the suggested magnification level, where 1.0 means default scale
- (1 pixel = 1 point).
-*/
-qreal QPdfDestination::zoom() const
-{
- return d->zoom;
-}
-
-QDebug operator<<(QDebug dbg, const QPdfDestination& dest)
-{
- QDebugStateSaver saver(dbg);
- dbg.nospace();
- dbg << "QPdfDestination(page=" << dest.page()
- << " location=" << dest.location()
- << " zoom=" << dest.zoom();
- dbg << ')';
- return dbg;
-}
-
-QT_END_NAMESPACE
-
-#include "moc_qpdfdestination.cpp"
diff --git a/src/pdf/qpdfdocument.cpp b/src/pdf/qpdfdocument.cpp
index e4ec363ce..17fdb29b9 100644
--- a/src/pdf/qpdfdocument.cpp
+++ b/src/pdf/qpdfdocument.cpp
@@ -1,38 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qpdfdocument.h"
#include "qpdfdocument_p.h"
@@ -46,28 +13,102 @@
#include <QFile>
#include <QHash>
#include <QLoggingCategory>
+#include <QMetaEnum>
#include <QMutex>
+#include <QPixmap>
#include <QVector2D>
+#include <QtCore/private/qtools_p.h>
+
QT_BEGIN_NAMESPACE
-// The library is not thread-safe at all, it has a lot of global variables.
-Q_GLOBAL_STATIC_WITH_ARGS(QMutex, pdfMutex, (QMutex::Recursive));
+Q_GLOBAL_STATIC(QRecursiveMutex, pdfMutex)
static int libraryRefCount;
static const double CharacterHitTolerance = 16.0;
Q_LOGGING_CATEGORY(qLcDoc, "qt.pdf.document")
QPdfMutexLocker::QPdfMutexLocker()
- : QMutexLocker(pdfMutex())
+ : std::unique_lock<QRecursiveMutex>(*pdfMutex())
{
}
+class Q_PDF_EXPORT QPdfPageModel : public QAbstractListModel
+{
+ Q_OBJECT
+public:
+ QPdfPageModel(QPdfDocument *doc) : QAbstractListModel(doc)
+ {
+ m_roleNames = QAbstractItemModel::roleNames();
+ QMetaEnum rolesMetaEnum = doc->metaObject()->enumerator(doc->metaObject()->indexOfEnumerator("PageModelRole"));
+ for (int r = Qt::UserRole; r < int(QPdfDocument::PageModelRole::NRoles); ++r) {
+ auto name = QByteArray(rolesMetaEnum.valueToKey(r));
+ name[0] = QtMiscUtils::toAsciiLower(name[0]);
+ m_roleNames.insert(r, name);
+ }
+ connect(doc, &QPdfDocument::statusChanged, this, [this](QPdfDocument::Status s) {
+ if (s == QPdfDocument::Status::Loading)
+ beginResetModel();
+ else if (s == QPdfDocument::Status::Ready)
+ endResetModel();
+ });
+ }
+
+ QVariant data(const QModelIndex &index, int role) const override
+ {
+ if (!index.isValid())
+ return QVariant();
+
+ switch (QPdfDocument::PageModelRole(role)) {
+ case QPdfDocument::PageModelRole::Label:
+ return document()->pageLabel(index.row());
+ case QPdfDocument::PageModelRole::PointSize:
+ return document()->pagePointSize(index.row());
+ case QPdfDocument::PageModelRole::NRoles:
+ break;
+ }
+
+ switch (role) {
+ case Qt::DecorationRole:
+ return pageThumbnail(index.row());
+ case Qt::DisplayRole:
+ return document()->pageLabel(index.row());
+ }
+
+ return QVariant();
+ }
+
+ int rowCount(const QModelIndex & = QModelIndex()) const override { return document()->pageCount(); }
+
+ QHash<int, QByteArray> roleNames() const override { return m_roleNames; }
+
+private:
+ QPdfDocument *document() const { return static_cast<QPdfDocument *>(parent()); }
+ QPixmap pageThumbnail(int page) const
+ {
+ auto it = m_thumbnails.constFind(page);
+ if (it == m_thumbnails.constEnd()) {
+ auto doc = document();
+ auto size = doc->pagePointSize(page);
+ size.scale(128, 128, Qt::KeepAspectRatio);
+ // TODO use QPdfPageRenderer for threading?
+ auto image = document()->render(page, size.toSize());
+ QPixmap ret = QPixmap::fromImage(image);
+ m_thumbnails.insert(page, ret);
+ return ret;
+ }
+ return it.value();
+ }
+
+ QHash<int, QByteArray> m_roleNames;
+ mutable QHash<int, QPixmap> m_thumbnails;
+};
+
QPdfDocumentPrivate::QPdfDocumentPrivate()
: avail(nullptr)
, doc(nullptr)
, loadComplete(false)
- , status(QPdfDocument::Null)
- , lastError(QPdfDocument::NoError)
+ , status(QPdfDocument::Status::Null)
+ , lastError(QPdfDocument::Error::None)
, pageCount(0)
{
asyncBuffer.setData(QByteArray());
@@ -75,8 +116,12 @@ QPdfDocumentPrivate::QPdfDocumentPrivate()
const QPdfMutexLocker lock;
- if (libraryRefCount == 0)
+ if (libraryRefCount == 0) {
+ QElapsedTimer timer;
+ timer.start();
FPDF_InitLibrary();
+ qCDebug(qLcDoc) << "FPDF_InitLibrary took" << timer.elapsed() << "ms";
+ }
++libraryRefCount;
// FPDF_FILEACCESS setup
@@ -98,8 +143,10 @@ QPdfDocumentPrivate::~QPdfDocumentPrivate()
const QPdfMutexLocker lock;
- if (!--libraryRefCount)
+ if (!--libraryRefCount) {
+ qCDebug(qLcDoc) << "FPDF_DestroyLibrary";
FPDF_DestroyLibrary();
+ }
}
void QPdfDocumentPrivate::clear()
@@ -118,6 +165,7 @@ void QPdfDocumentPrivate::clear()
if (pageCount != 0) {
pageCount = 0;
emit q->pageCountChanged(pageCount);
+ emit q->pageModelChanged();
}
loadComplete = false;
@@ -133,7 +181,7 @@ void QPdfDocumentPrivate::clear()
void QPdfDocumentPrivate::updateLastError()
{
if (doc) {
- lastError = QPdfDocument::NoError;
+ lastError = QPdfDocument::Error::None;
return;
}
@@ -142,15 +190,17 @@ void QPdfDocumentPrivate::updateLastError()
lock.unlock();
switch (error) {
- case FPDF_ERR_SUCCESS: lastError = QPdfDocument::NoError; break;
- case FPDF_ERR_UNKNOWN: lastError = QPdfDocument::UnknownError; break;
- case FPDF_ERR_FILE: lastError = QPdfDocument::FileNotFoundError; break;
- case FPDF_ERR_FORMAT: lastError = QPdfDocument::InvalidFileFormatError; break;
- case FPDF_ERR_PASSWORD: lastError = QPdfDocument::IncorrectPasswordError; break;
- case FPDF_ERR_SECURITY: lastError = QPdfDocument::UnsupportedSecuritySchemeError; break;
+ case FPDF_ERR_SUCCESS: lastError = QPdfDocument::Error::None; break;
+ case FPDF_ERR_UNKNOWN: lastError = QPdfDocument::Error::Unknown; break;
+ case FPDF_ERR_FILE: lastError = QPdfDocument::Error::FileNotFound; break;
+ case FPDF_ERR_FORMAT: lastError = QPdfDocument::Error::InvalidFileFormat; break;
+ case FPDF_ERR_PASSWORD: lastError = QPdfDocument::Error::IncorrectPassword; break;
+ case FPDF_ERR_SECURITY: lastError = QPdfDocument::Error::UnsupportedSecurityScheme; break;
default:
Q_UNREACHABLE();
}
+ if (lastError != QPdfDocument::Error::None)
+ qCDebug(qLcDoc) << "FPDF error" << error << "->" << lastError;
}
void QPdfDocumentPrivate::load(QIODevice *newDevice, bool transferDeviceOwnership)
@@ -166,19 +216,19 @@ void QPdfDocumentPrivate::load(QIODevice *newDevice, bool transferDeviceOwnershi
QNetworkReply *reply = qobject_cast<QNetworkReply*>(sequentialSourceDevice);
if (!reply) {
- setStatus(QPdfDocument::Error);
+ setStatus(QPdfDocument::Status::Error);
qWarning() << "QPdfDocument: Loading from sequential devices only supported with QNetworkAccessManager.";
return;
}
if (reply->isFinished() && reply->error() != QNetworkReply::NoError) {
- setStatus(QPdfDocument::Error);
+ setStatus(QPdfDocument::Status::Error);
return;
}
QObject::connect(reply, &QNetworkReply::finished, q, [this, reply](){
if (reply->error() != QNetworkReply::NoError || reply->bytesAvailable() == 0) {
- this->setStatus(QPdfDocument::Error);
+ this->setStatus(QPdfDocument::Status::Error);
}
});
@@ -190,7 +240,7 @@ void QPdfDocumentPrivate::load(QIODevice *newDevice, bool transferDeviceOwnershi
device = newDevice;
initiateAsyncLoadWithTotalSizeKnown(device->size());
if (!avail) {
- setStatus(QPdfDocument::Error);
+ setStatus(QPdfDocument::Status::Error);
return;
}
@@ -199,7 +249,7 @@ void QPdfDocumentPrivate::load(QIODevice *newDevice, bool transferDeviceOwnershi
if (!doc) {
updateLastError();
- setStatus(QPdfDocument::Error);
+ setStatus(QPdfDocument::Status::Error);
return;
}
@@ -209,15 +259,16 @@ void QPdfDocumentPrivate::load(QIODevice *newDevice, bool transferDeviceOwnershi
if (newPageCount != pageCount) {
pageCount = newPageCount;
emit q->pageCountChanged(pageCount);
+ emit q->pageModelChanged();
}
// If it's a local file, and the first couple of pages are available,
// probably the whole document is available.
if (checkPageComplete(0) && (pageCount < 2 || checkPageComplete(1))) {
- setStatus(QPdfDocument::Ready);
+ setStatus(QPdfDocument::Status::Ready);
} else {
updateLastError();
- setStatus(QPdfDocument::Error);
+ setStatus(QPdfDocument::Status::Error);
}
}
}
@@ -229,13 +280,13 @@ void QPdfDocumentPrivate::_q_tryLoadingWithSizeFromContentHeader()
const QNetworkReply *networkReply = qobject_cast<QNetworkReply*>(sequentialSourceDevice);
if (!networkReply) {
- setStatus(QPdfDocument::Error);
+ setStatus(QPdfDocument::Status::Error);
return;
}
const QVariant contentLength = networkReply->header(QNetworkRequest::ContentLengthHeader);
if (!contentLength.isValid()) {
- setStatus(QPdfDocument::Error);
+ setStatus(QPdfDocument::Status::Error);
return;
}
@@ -281,11 +332,10 @@ void QPdfDocumentPrivate::tryLoadDocument()
break;
case PDF_DATA_NOTAVAIL:
qCDebug(qLcDoc) << "data not yet available";
- lastError = QPdfDocument::DataNotYetAvailableError;
- setStatus(QPdfDocument::Error);
+ lastError = QPdfDocument::Error::DataNotYetAvailable;
break;
case PDF_DATA_AVAIL:
- // all good
+ lastError = QPdfDocument::Error::None;
break;
}
@@ -295,12 +345,14 @@ void QPdfDocumentPrivate::tryLoadDocument()
lock.unlock();
updateLastError();
+ if (lastError != QPdfDocument::Error::None)
+ setStatus(QPdfDocument::Status::Error);
- if (lastError == QPdfDocument::IncorrectPasswordError) {
+ if (lastError == QPdfDocument::Error::IncorrectPassword) {
FPDF_CloseDocument(doc);
doc = nullptr;
- setStatus(QPdfDocument::Error);
+ setStatus(QPdfDocument::Status::Error);
emit q->passwordRequired();
}
}
@@ -337,9 +389,10 @@ void QPdfDocumentPrivate::checkComplete()
if (newPageCount != pageCount) {
pageCount = newPageCount;
emit q->pageCountChanged(pageCount);
+ emit q->pageModelChanged();
}
- setStatus(QPdfDocument::Ready);
+ setStatus(QPdfDocument::Status::Ready);
}
}
@@ -393,46 +446,98 @@ void QPdfDocumentPrivate::fpdf_AddSegment(_FX_DOWNLOADHINTS *pThis, size_t offse
Q_UNUSED(size);
}
-QString QPdfDocumentPrivate::getText(FPDF_TEXTPAGE textPage, int startIndex, int count)
+QString QPdfDocumentPrivate::getText(FPDF_TEXTPAGE textPage, int startIndex, int count) const
{
- QVector<ushort> buf(count + 1);
+ QList<ushort> buf(count + 1);
// TODO is that enough space in case one unicode character is more than one in utf-16?
int len = FPDFText_GetText(textPage, startIndex, count, buf.data());
Q_ASSERT(len - 1 <= count); // len is number of characters written, including the terminator
- return QString::fromUtf16(buf.constData(), len - 1);
+ return QString::fromUtf16(reinterpret_cast<const char16_t *>(buf.constData()), len - 1);
}
-QPointF QPdfDocumentPrivate::getCharPosition(FPDF_TEXTPAGE textPage, double pageHeight, int charIndex)
+QPointF QPdfDocumentPrivate::getCharPosition(FPDF_PAGE pdfPage, FPDF_TEXTPAGE textPage, int charIndex) const
{
double x, y;
- int count = FPDFText_CountChars(textPage);
- bool ok = FPDFText_GetCharOrigin(textPage, qMin(count - 1, charIndex), &x, &y);
- if (!ok)
- return QPointF();
- return QPointF(x, pageHeight - y);
+ const int count = FPDFText_CountChars(textPage);
+ if (FPDFText_GetCharOrigin(textPage, qMin(count - 1, charIndex), &x, &y))
+ return mapPageToView(pdfPage, x, y);
+ return {};
}
-QRectF QPdfDocumentPrivate::getCharBox(FPDF_TEXTPAGE textPage, double pageHeight, int charIndex)
+QRectF QPdfDocumentPrivate::getCharBox(FPDF_PAGE pdfPage, FPDF_TEXTPAGE textPage, int charIndex) const
{
double l, t, r, b;
- bool ok = FPDFText_GetCharBox(textPage, charIndex, &l, &r, &b, &t);
- if (!ok)
- return QRectF();
- return QRectF(l, pageHeight - t, r - l, t - b);
+ if (FPDFText_GetCharBox(textPage, charIndex, &l, &r, &b, &t))
+ return mapPageToView(pdfPage, l, t, r, b);
+ return {};
+}
+
+/*! \internal
+ Convert the point \a x , \a y to the usual 1x (pixels = points)
+ 4th-quadrant "view" coordinate system relative to the top-left corner of
+ the rendered page. Some PDF files have internal transforms that make this
+ coordinate system different from "page coordinates", so we cannot just
+ subtract from page height to invert the y coordinates, in general.
+ */
+QPointF QPdfDocumentPrivate::mapPageToView(FPDF_PAGE pdfPage, double x, double y) const
+{
+ const auto pageHeight = FPDF_GetPageHeight(pdfPage);
+ const auto pageWidth = FPDF_GetPageWidth(pdfPage);
+ int rx, ry;
+ if (FPDF_PageToDevice(pdfPage, 0, 0, qRound(pageWidth), qRound(pageHeight), 0, x, y, &rx, &ry))
+ return QPointF(rx, ry);
+ return {};
+}
+
+/*! \internal
+ Convert the bounding box defined by \a left \a top \a right and \a bottom
+ to the usual 1x (pixels = points) 4th-quadrant "view" coordinate system
+ that we use for rendering things on top of the page image.
+ Some PDF files have internal transforms that make this coordinate
+ system different from "page coordinates", so we cannot just
+ subtract from page height to invert the y coordinates, in general.
+ */
+QRectF QPdfDocumentPrivate::mapPageToView(FPDF_PAGE pdfPage, double left, double top, double right, double bottom) const
+{
+ const auto pageHeight = FPDF_GetPageHeight(pdfPage);
+ const auto pageWidth = FPDF_GetPageWidth(pdfPage);
+ int xfmLeft, xfmTop, xfmRight, xfmBottom;
+ if ( FPDF_PageToDevice(pdfPage, 0, 0, qRound(pageWidth), qRound(pageHeight), 0, left, top, &xfmLeft, &xfmTop) &&
+ FPDF_PageToDevice(pdfPage, 0, 0, qRound(pageWidth), qRound(pageHeight), 0, right, bottom, &xfmRight, &xfmBottom) )
+ return QRectF(xfmLeft, xfmTop, xfmRight - xfmLeft, xfmBottom - xfmTop);
+ return {};
+}
+
+/*! \internal
+ Convert the point \a x , \a y \a from the usual 1x (pixels = points)
+ 4th-quadrant "view" coordinate system relative to the top-left corner of
+ the rendered page, to "page coordinates" suited to the given \a pdfPage,
+ which may have arbitrary internal transforms.
+ */
+QPointF QPdfDocumentPrivate::mapViewToPage(FPDF_PAGE pdfPage, QPointF position) const
+{
+ const auto pageHeight = FPDF_GetPageHeight(pdfPage);
+ const auto pageWidth = FPDF_GetPageWidth(pdfPage);
+ double rx, ry;
+ if (FPDF_DeviceToPage(pdfPage, 0, 0, qRound(pageWidth), qRound(pageHeight), 0, position.x(), position.y(), &rx, &ry))
+ return QPointF(rx, ry);
+ return {};
}
QPdfDocumentPrivate::TextPosition QPdfDocumentPrivate::hitTest(int page, QPointF position)
{
const QPdfMutexLocker lock;
+
+ TextPosition result;
FPDF_PAGE pdfPage = FPDF_LoadPage(doc, page);
- double pageHeight = FPDF_GetPageHeight(pdfPage);
FPDF_TEXTPAGE textPage = FPDFText_LoadPage(pdfPage);
- int hitIndex = FPDFText_GetCharIndexAtPos(textPage, position.x(), pageHeight - position.y(),
+ const QPointF pagePos = mapViewToPage(pdfPage, position);
+ int hitIndex = FPDFText_GetCharIndexAtPos(textPage, pagePos.x(), pagePos.y(),
CharacterHitTolerance, CharacterHitTolerance);
if (hitIndex >= 0) {
- QPointF charPos = getCharPosition(textPage, pageHeight, hitIndex);
+ QPointF charPos = getCharPosition(pdfPage, textPage, hitIndex);
if (!charPos.isNull()) {
- QRectF charBox = getCharBox(textPage, pageHeight, hitIndex);
+ QRectF charBox = getCharBox(pdfPage, textPage, hitIndex);
// If the given position is past the end of the line, i.e. if the right edge of the found character's
// bounding box is closer to it than the left edge is, we say that we "hit" the next character index after
if (qAbs(charBox.right() - position.x()) < qAbs(charPos.x() - position.x())) {
@@ -440,10 +545,14 @@ QPdfDocumentPrivate::TextPosition QPdfDocumentPrivate::hitTest(int page, QPointF
++hitIndex;
}
qCDebug(qLcDoc) << "on page" << page << "@" << position << "got char position" << charPos << "index" << hitIndex;
- return { charPos, charBox.height(), hitIndex };
+ result = { charPos, charBox.height(), hitIndex };
}
}
- return {};
+
+ FPDFText_ClosePage(textPage);
+ FPDF_ClosePage(pdfPage);
+
+ return result;
}
/*!
@@ -471,24 +580,39 @@ QPdfDocument::~QPdfDocument()
{
}
-QPdfDocument::DocumentError QPdfDocument::load(const QString &fileName)
+/*!
+ Loads the document contents from \a fileName.
+*/
+QPdfDocument::Error QPdfDocument::load(const QString &fileName)
{
qCDebug(qLcDoc) << "loading" << fileName;
close();
- d->setStatus(QPdfDocument::Loading);
+ d->setStatus(QPdfDocument::Status::Loading);
- QScopedPointer<QFile> f(new QFile(fileName));
+ std::unique_ptr<QFile> f(new QFile(fileName));
if (!f->open(QIODevice::ReadOnly)) {
- d->lastError = FileNotFoundError;
- d->setStatus(QPdfDocument::Error);
+ d->lastError = Error::FileNotFound;
+ d->setStatus(QPdfDocument::Status::Error);
} else {
- d->load(f.take(), /*transfer ownership*/true);
+ d->load(f.release(), /*transfer ownership*/true);
}
return d->lastError;
}
+/*! \internal
+ Returns the filename of the document that has been opened,
+ or an empty string if no document is open.
+*/
+QString QPdfDocument::fileName() const
+{
+ const QFile *f = qobject_cast<QFile *>(d->device.data());
+ if (f)
+ return f->fileName();
+ return QString();
+}
+
/*!
\enum QPdfDocument::Status
@@ -505,22 +629,35 @@ QPdfDocument::DocumentError QPdfDocument::load(const QString &fileName)
*/
/*!
- Returns the current status of the document.
+ \property QPdfDocument::status
+
+ This property holds the current status of the document.
*/
QPdfDocument::Status QPdfDocument::status() const
{
return d->status;
}
+/*!
+ Loads the document contents from \a device.
+*/
void QPdfDocument::load(QIODevice *device)
{
close();
- d->setStatus(QPdfDocument::Loading);
+ d->setStatus(QPdfDocument::Status::Loading);
d->load(device, /*transfer ownership*/false);
}
+/*!
+ \property QPdfDocument::password
+
+ This property holds the document password.
+
+ If the document is protected by a password, the user must provide it, and
+ the application must set this property. Otherwise, it's not needed.
+*/
void QPdfDocument::setPassword(const QString &password)
{
const QByteArray newPassword = password.toUtf8();
@@ -565,53 +702,36 @@ QVariant QPdfDocument::metaData(MetaDataField field) const
if (!d->doc)
return QString();
+ static QMetaEnum fieldsMetaEnum = metaObject()->enumerator(metaObject()->indexOfEnumerator("MetaDataField"));
QByteArray fieldName;
switch (field) {
- case Title:
- fieldName = "Title";
- break;
- case Subject:
- fieldName = "Subject";
- break;
- case Author:
- fieldName = "Author";
- break;
- case Keywords:
- fieldName = "Keywords";
- break;
- case Producer:
- fieldName = "Producer";
- break;
- case Creator:
- fieldName = "Creator";
- break;
- case CreationDate:
- fieldName = "CreationDate";
- break;
- case ModificationDate:
+ case MetaDataField::ModificationDate:
fieldName = "ModDate";
break;
+ default:
+ fieldName = QByteArray(fieldsMetaEnum.valueToKey(int(field)));
+ break;
}
QPdfMutexLocker lock;
const unsigned long len = FPDF_GetMetaText(d->doc, fieldName.constData(), nullptr, 0);
- QVector<ushort> buf(len);
- FPDF_GetMetaText(d->doc, fieldName.constData(), buf.data(), buf.length());
+ QList<ushort> buf(len);
+ FPDF_GetMetaText(d->doc, fieldName.constData(), buf.data(), buf.size());
lock.unlock();
- QString text = QString::fromUtf16(buf.data());
+ QString text = QString::fromUtf16(reinterpret_cast<const char16_t *>(buf.data()));
switch (field) {
- case Title: // fall through
- case Subject:
- case Author:
- case Keywords:
- case Producer:
- case Creator:
+ case MetaDataField::Title: // fall through
+ case MetaDataField::Subject:
+ case MetaDataField::Author:
+ case MetaDataField::Keywords:
+ case MetaDataField::Producer:
+ case MetaDataField::Creator:
return text;
- case CreationDate: // fall through
- case ModificationDate:
+ case MetaDataField::CreationDate: // fall through
+ case MetaDataField::ModificationDate:
// convert a "D:YYYYMMDDHHmmSSOHH'mm'" into "YYYY-MM-DDTHH:mm:ss+HH:mm"
if (text.startsWith(QLatin1String("D:")))
text = text.mid(2);
@@ -630,20 +750,40 @@ QVariant QPdfDocument::metaData(MetaDataField field) const
return QVariant();
}
-QPdfDocument::DocumentError QPdfDocument::error() const
+/*!
+ \enum QPdfDocument::Error
+
+ This enum describes the error while attempting the last operation on the document.
+
+ \value None No error occurred.
+ \value Unknown Unknown type of error.
+ \value DataNotYetAvailable The document is still loading, it's too early to attempt the operation.
+ \value FileNotFound The file given to load() was not found.
+ \value InvalidFileFormat The file given to load() is not a valid PDF file.
+ \value IncorrectPassword The password given to setPassword() is not correct for this file.
+ \value UnsupportedSecurityScheme QPdfDocument is not able to unlock this kind of PDF file.
+
+ \sa QPdfDocument::error()
+*/
+
+/*!
+ Returns the type of error if \l status is \c Error, or \c NoError if there
+ is no error.
+*/
+QPdfDocument::Error QPdfDocument::error() const
{
return d->lastError;
}
/*!
- Closes the document.
+ Closes the document.
*/
void QPdfDocument::close()
{
if (!d->doc)
return;
- d->setStatus(Unloading);
+ d->setStatus(Status::Unloading);
d->clear();
@@ -652,19 +792,24 @@ void QPdfDocument::close()
emit passwordChanged();
}
- d->setStatus(Null);
+ d->setStatus(Status::Null);
}
/*!
- Returns the amount of pages for the loaded document or \c 0 if
- no document is loaded.
+ \property QPdfDocument::pageCount
+
+ This property holds the number of pages in the loaded document or \c 0 if
+ no document is loaded.
*/
int QPdfDocument::pageCount() const
{
return d->pageCount;
}
-QSizeF QPdfDocument::pageSize(int page) const
+/*!
+ Returns the size of page \a page in points (1/72 of an inch).
+*/
+QSizeF QPdfDocument::pagePointSize(int page) const
{
QSizeF result;
if (!d->doc || !d->checkPageComplete(page))
@@ -677,6 +822,74 @@ QSizeF QPdfDocument::pageSize(int page) const
}
/*!
+ \enum QPdfDocument::PageModelRole
+
+ Roles in pageModel().
+
+ \value Label The page number to be used for display purposes (QString).
+ \value PointSize The page size in points (1/72 of an inch) (QSizeF).
+ \omitvalue NRoles
+*/
+
+/*!
+ \property QPdfDocument::pageModel
+
+ This property holds an instance of QAbstractListModel to provide
+ page-specific metadata, containing one row for each page in the document.
+
+ \sa QPdfDocument::PageModelRole
+*/
+QAbstractListModel *QPdfDocument::pageModel()
+{
+ if (!d->pageModel)
+ d->pageModel = new QPdfPageModel(this);
+ return d->pageModel;
+}
+
+/*!
+ Returns the \a page number to be used for display purposes.
+
+ For example, a document may have multiple sections with different numbering.
+ Perhaps the preface uses roman numerals, the body starts on page 1, and the
+ appendix starts at A1. Whenever a PDF viewer shows a page number, to avoid
+ confusing the user it should be the same "number" as is printed on the
+ corner of the page, rather than the zero-based page index that we use in
+ APIs (assuming the document author has made the page labels match the
+ printed numbers).
+
+ If the document does not have custom page numbering, this function returns
+ \c {page + 1}.
+
+ \sa pageIndexForLabel()
+*/
+QString QPdfDocument::pageLabel(int page)
+{
+ const unsigned long len = FPDF_GetPageLabel(d->doc, page, nullptr, 0);
+ if (len == 0)
+ return QString::number(page + 1);
+ QList<char16_t> buf(len);
+ QPdfMutexLocker lock;
+ FPDF_GetPageLabel(d->doc, page, buf.data(), len);
+ lock.unlock();
+ return QString::fromUtf16(buf.constData());
+}
+
+/*!
+ Returns the index of the page that has the \a label, or \c -1 if not found.
+
+ \sa pageLabel()
+ \since 6.6
+*/
+int QPdfDocument::pageIndexForLabel(const QString &label)
+{
+ for (int i = 0; i < d->pageCount; ++i) {
+ if (pageLabel(i) == label)
+ return i;
+ }
+ return -1;
+}
+
+/*!
Renders the \a page into a QImage of size \a imageSize according to the
provided \a renderOptions.
@@ -704,37 +917,21 @@ QImage QPdfDocument::render(int page, QSize imageSize, QPdfDocumentRenderOptions
result.fill(Qt::transparent);
FPDF_BITMAP bitmap = FPDFBitmap_CreateEx(result.width(), result.height(), FPDFBitmap_BGRA, result.bits(), result.bytesPerLine());
- int rotation = 0;
- switch (renderOptions.rotation()) {
- case QPdf::Rotate0:
- rotation = 0;
- break;
- case QPdf::Rotate90:
- rotation = 1;
- break;
- case QPdf::Rotate180:
- rotation = 2;
- break;
- case QPdf::Rotate270:
- rotation = 3;
- break;
- }
-
- const QPdf::RenderFlags renderFlags = renderOptions.renderFlags();
+ const QPdfDocumentRenderOptions::RenderFlags renderFlags = renderOptions.renderFlags();
int flags = 0;
- if (renderFlags & QPdf::RenderAnnotations)
+ if (renderFlags & QPdfDocumentRenderOptions::RenderFlag::Annotations)
flags |= FPDF_ANNOT;
- if (renderFlags & QPdf::RenderOptimizedForLcd)
+ if (renderFlags & QPdfDocumentRenderOptions::RenderFlag::OptimizedForLcd)
flags |= FPDF_LCD_TEXT;
- if (renderFlags & QPdf::RenderGrayscale)
+ if (renderFlags & QPdfDocumentRenderOptions::RenderFlag::Grayscale)
flags |= FPDF_GRAYSCALE;
- if (renderFlags & QPdf::RenderForceHalftone)
+ if (renderFlags & QPdfDocumentRenderOptions::RenderFlag::ForceHalftone)
flags |= FPDF_RENDER_FORCEHALFTONE;
- if (renderFlags & QPdf::RenderTextAliased)
+ if (renderFlags & QPdfDocumentRenderOptions::RenderFlag::TextAliased)
flags |= FPDF_RENDER_NO_SMOOTHTEXT;
- if (renderFlags & QPdf::RenderImageAliased)
+ if (renderFlags & QPdfDocumentRenderOptions::RenderFlag::ImageAliased)
flags |= FPDF_RENDER_NO_SMOOTHIMAGE;
- if (renderFlags & QPdf::RenderPathAliased)
+ if (renderFlags & QPdfDocumentRenderOptions::RenderFlag::PathAliased)
flags |= FPDF_RENDER_NO_SMOOTHPATH;
if (renderOptions.scaledClipRect().isValid()) {
@@ -747,7 +944,7 @@ QImage QPdfDocument::render(int page, QSize imageSize, QPdfDocumentRenderOptions
float y1 = clipRect.bottom();
float x2 = clipRect.right();
float y2 = clipRect.top();
- QSizeF origSize = pageSize(page);
+ QSizeF origSize = pagePointSize(page);
QVector2D pageScale(1, 1);
if (!renderOptions.scaledSize().isNull()) {
pageScale = QVector2D(renderOptions.scaledSize().width() / float(origSize.width()),
@@ -765,6 +962,7 @@ QImage QPdfDocument::render(int page, QSize imageSize, QPdfDocumentRenderOptions
qCDebug(qLcDoc) << "page" << page << "region" << renderOptions.scaledClipRect()
<< "size" << imageSize << "took" << timer.elapsed() << "ms";
} else {
+ const auto rotation = QPdfDocumentPrivate::toFPDFRotation(renderOptions.rotation());
FPDF_RenderPageBitmap(bitmap, pdfPage, 0, 0, result.width(), result.height(), rotation, flags);
qCDebug(qLcDoc) << "page" << page << "size" << imageSize << "took" << timer.elapsed() << "ms";
}
@@ -783,31 +981,35 @@ QPdfSelection QPdfDocument::getSelection(int page, QPointF start, QPointF end)
{
const QPdfMutexLocker lock;
FPDF_PAGE pdfPage = FPDF_LoadPage(d->doc, page);
- double pageHeight = FPDF_GetPageHeight(pdfPage);
+ const QPointF pageStart = d->mapViewToPage(pdfPage, start);
+ const QPointF pageEnd = d->mapViewToPage(pdfPage, end);
FPDF_TEXTPAGE textPage = FPDFText_LoadPage(pdfPage);
- int startIndex = FPDFText_GetCharIndexAtPos(textPage, start.x(), pageHeight - start.y(),
+ int startIndex = FPDFText_GetCharIndexAtPos(textPage, pageStart.x(), pageStart.y(),
CharacterHitTolerance, CharacterHitTolerance);
- int endIndex = FPDFText_GetCharIndexAtPos(textPage, end.x(), pageHeight - end.y(),
+ int endIndex = FPDFText_GetCharIndexAtPos(textPage, pageEnd.x(), pageEnd.y(),
CharacterHitTolerance, CharacterHitTolerance);
+
+ QPdfSelection result;
+
if (startIndex >= 0 && endIndex != startIndex) {
if (startIndex > endIndex)
qSwap(startIndex, endIndex);
// If the given end position is past the end of the line, i.e. if the right edge of the last character's
// bounding box is closer to it than the left edge is, then extend the char range by one
- QRectF endCharBox = d->getCharBox(textPage, pageHeight, endIndex);
+ QRectF endCharBox = d->getCharBox(pdfPage, textPage, endIndex);
if (qAbs(endCharBox.right() - end.x()) < qAbs(endCharBox.x() - end.x()))
++endIndex;
int count = endIndex - startIndex;
QString text = d->getText(textPage, startIndex, count);
- QVector<QPolygonF> bounds;
+ QList<QPolygonF> bounds;
QRectF hull;
int rectCount = FPDFText_CountRects(textPage, startIndex, endIndex - startIndex);
for (int i = 0; i < rectCount; ++i) {
double l, r, b, t;
FPDFText_GetRect(textPage, i, &l, &t, &r, &b);
- QRectF rect(l, pageHeight - t, r - l, t - b);
+ const QRectF rect = d->mapPageToView(pdfPage, l, t, r, b);
if (hull.isNull())
hull = rect;
else
@@ -815,16 +1017,20 @@ QPdfSelection QPdfDocument::getSelection(int page, QPointF start, QPointF end)
bounds << QPolygonF(rect);
}
qCDebug(qLcDoc) << page << start << "->" << end << "found" << startIndex << "->" << endIndex << text;
- return QPdfSelection(text, bounds, hull, startIndex, endIndex);
+ result = QPdfSelection(text, bounds, hull, startIndex, endIndex);
+ } else {
+ qCDebug(qLcDoc) << page << start << "->" << end << "nothing found";
}
- qCDebug(qLcDoc) << page << start << "->" << end << "nothing found";
- return QPdfSelection();
+ FPDFText_ClosePage(textPage);
+ FPDF_ClosePage(pdfPage);
+
+ return result;
}
/*!
Returns information about the text on the given \a page that can be found
- beginning at the given \a startIndex with at most \l maxLength characters.
+ beginning at the given \a startIndex with at most \a maxLength characters.
*/
QPdfSelection QPdfDocument::getSelectionAtIndex(int page, int startIndex, int maxLength)
{
@@ -833,22 +1039,21 @@ QPdfSelection QPdfDocument::getSelectionAtIndex(int page, int startIndex, int ma
return {};
const QPdfMutexLocker lock;
FPDF_PAGE pdfPage = FPDF_LoadPage(d->doc, page);
- double pageHeight = FPDF_GetPageHeight(pdfPage);
FPDF_TEXTPAGE textPage = FPDFText_LoadPage(pdfPage);
int pageCount = FPDFText_CountChars(textPage);
if (startIndex >= pageCount)
return QPdfSelection();
- QVector<QPolygonF> bounds;
+ QList<QPolygonF> bounds;
QRectF hull;
int rectCount = 0;
QString text;
if (maxLength > 0) {
text = d->getText(textPage, startIndex, maxLength);
- rectCount = FPDFText_CountRects(textPage, startIndex, text.length());
+ rectCount = FPDFText_CountRects(textPage, startIndex, text.size());
for (int i = 0; i < rectCount; ++i) {
double l, r, b, t;
FPDFText_GetRect(textPage, i, &l, &t, &r, &b);
- QRectF rect(l, pageHeight - t, r - l, t - b);
+ const QRectF rect = d->mapPageToView(pdfPage, l, t, r, b);
if (hull.isNull())
hull = rect;
else
@@ -857,10 +1062,14 @@ QPdfSelection QPdfDocument::getSelectionAtIndex(int page, int startIndex, int ma
}
}
if (bounds.isEmpty())
- hull = QRectF(d->getCharPosition(textPage, pageHeight, startIndex), QSizeF());
+ hull = QRectF(d->getCharPosition(pdfPage, textPage, startIndex), QSizeF());
qCDebug(qLcDoc) << "on page" << page << "at index" << startIndex << "maxLength" << maxLength
- << "got" << text.length() << "chars," << rectCount << "rects within" << hull;
- return QPdfSelection(text, bounds, hull, startIndex, startIndex + text.length());
+ << "got" << text.size() << "chars," << rectCount << "rects within" << hull;
+
+ FPDFText_ClosePage(textPage);
+ FPDF_ClosePage(pdfPage);
+
+ return QPdfSelection(text, bounds, hull, startIndex, startIndex + text.size());
}
/*!
@@ -870,19 +1079,18 @@ QPdfSelection QPdfDocument::getAllText(int page)
{
const QPdfMutexLocker lock;
FPDF_PAGE pdfPage = FPDF_LoadPage(d->doc, page);
- double pageHeight = FPDF_GetPageHeight(pdfPage);
FPDF_TEXTPAGE textPage = FPDFText_LoadPage(pdfPage);
int count = FPDFText_CountChars(textPage);
if (count < 1)
return QPdfSelection();
QString text = d->getText(textPage, 0, count);
- QVector<QPolygonF> bounds;
+ QList<QPolygonF> bounds;
QRectF hull;
int rectCount = FPDFText_CountRects(textPage, 0, count);
for (int i = 0; i < rectCount; ++i) {
double l, r, b, t;
FPDFText_GetRect(textPage, i, &l, &t, &r, &b);
- QRectF rect(l, pageHeight - t, r - l, t - b);
+ const QRectF rect = d->mapPageToView(pdfPage, l, t, r, b);
if (hull.isNull())
hull = rect;
else
@@ -890,9 +1098,14 @@ QPdfSelection QPdfDocument::getAllText(int page)
bounds << QPolygonF(rect);
}
qCDebug(qLcDoc) << "on page" << page << "got" << count << "chars," << rectCount << "rects within" << hull;
+
+ FPDFText_ClosePage(textPage);
+ FPDF_ClosePage(pdfPage);
+
return QPdfSelection(text, bounds, hull, 0, count);
}
QT_END_NAMESPACE
+#include "qpdfdocument.moc"
#include "moc_qpdfdocument.cpp"
diff --git a/src/pdf/qpdfdocument.h b/src/pdf/qpdfdocument.h
new file mode 100644
index 000000000..8355246ae
--- /dev/null
+++ b/src/pdf/qpdfdocument.h
@@ -0,0 +1,127 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QPDFDOCUMENT_H
+#define QPDFDOCUMENT_H
+
+#include <QtPdf/qtpdfglobal.h>
+
+#include <QtCore/qobject.h>
+#include <QtCore/QAbstractListModel>
+#include <QtGui/qimage.h>
+#include <QtPdf/qpdfdocumentrenderoptions.h>
+#include <QtPdf/qpdfselection.h>
+
+QT_BEGIN_NAMESPACE
+
+class QPdfDocumentPrivate;
+class QNetworkReply;
+
+class Q_PDF_EXPORT QPdfDocument : public QObject
+{
+ Q_OBJECT
+
+ Q_PROPERTY(int pageCount READ pageCount NOTIFY pageCountChanged FINAL)
+ Q_PROPERTY(QString password READ password WRITE setPassword NOTIFY passwordChanged FINAL)
+ Q_PROPERTY(Status status READ status NOTIFY statusChanged FINAL)
+ Q_PROPERTY(QAbstractListModel* pageModel READ pageModel NOTIFY pageModelChanged FINAL)
+
+public:
+ enum class Status {
+ Null,
+ Loading,
+ Ready,
+ Unloading,
+ Error
+ };
+ Q_ENUM(Status)
+
+ enum class Error {
+ None,
+ Unknown,
+ DataNotYetAvailable,
+ FileNotFound,
+ InvalidFileFormat,
+ IncorrectPassword,
+ UnsupportedSecurityScheme
+ };
+ Q_ENUM(Error)
+
+ enum class MetaDataField {
+ Title,
+ Subject,
+ Author,
+ Keywords,
+ Producer,
+ Creator,
+ CreationDate,
+ ModificationDate
+ };
+ Q_ENUM(MetaDataField)
+
+ enum class PageModelRole {
+ Label = Qt::UserRole,
+ PointSize,
+ NRoles
+ };
+ Q_ENUM(PageModelRole)
+
+ QPdfDocument() : QPdfDocument(nullptr) {}
+ explicit QPdfDocument(QObject *parent);
+ ~QPdfDocument() override;
+
+ Error load(const QString &fileName);
+
+ Status status() const;
+
+ void load(QIODevice *device);
+ void setPassword(const QString &password);
+ QString password() const;
+
+ QVariant metaData(MetaDataField field) const;
+
+ Error error() const;
+
+ void close();
+
+ int pageCount() const;
+
+ Q_INVOKABLE QSizeF pagePointSize(int page) const;
+
+ Q_INVOKABLE QString pageLabel(int page);
+ Q_INVOKABLE int pageIndexForLabel(const QString &label);
+
+ QAbstractListModel *pageModel();
+
+ QImage render(int page, QSize imageSize, QPdfDocumentRenderOptions options = QPdfDocumentRenderOptions());
+
+ Q_INVOKABLE QPdfSelection getSelection(int page, QPointF start, QPointF end);
+ Q_INVOKABLE QPdfSelection getSelectionAtIndex(int page, int startIndex, int maxLength);
+ Q_INVOKABLE QPdfSelection getAllText(int page);
+
+Q_SIGNALS:
+ void passwordChanged();
+ void passwordRequired();
+ void statusChanged(QPdfDocument::Status status);
+ void pageCountChanged(int pageCount);
+ void pageModelChanged();
+
+private:
+ friend struct QPdfBookmarkModelPrivate;
+ friend class QPdfFile;
+ friend class QPdfLinkModelPrivate;
+ friend class QPdfPageModel;
+ friend class QPdfSearchModel;
+ friend class QPdfSearchModelPrivate;
+ friend class QQuickPdfSelection;
+
+ QString fileName() const;
+
+ Q_PRIVATE_SLOT(d, void _q_tryLoadingWithSizeFromContentHeader())
+ Q_PRIVATE_SLOT(d, void _q_copyFromSequentialSourceDevice())
+ QScopedPointer<QPdfDocumentPrivate> d;
+};
+
+QT_END_NAMESPACE
+
+#endif // QPDFDOCUMENT_H
diff --git a/src/pdf/qpdfdocument_p.h b/src/pdf/qpdfdocument_p.h
new file mode 100644
index 000000000..cdb76d16f
--- /dev/null
+++ b/src/pdf/qpdfdocument_p.h
@@ -0,0 +1,123 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QPDFDOCUMENT_P_H
+#define QPDFDOCUMENT_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qpdfdocument.h"
+#include "qtpdfexports.h"
+
+#include "third_party/pdfium/public/fpdfview.h"
+#include "third_party/pdfium/public/fpdf_dataavail.h"
+
+#include <QtCore/qbuffer.h>
+#include <QtCore/qmutex.h>
+#include <QtCore/qpointer.h>
+#include <QtNetwork/qnetworkreply.h>
+
+#include <mutex>
+
+QT_BEGIN_NAMESPACE
+
+class QPdfMutexLocker : public std::unique_lock<QRecursiveMutex>
+{
+public:
+ QPdfMutexLocker();
+};
+
+class QPdfPageModel;
+
+class Q_PDF_EXPORT QPdfDocumentPrivate: public FPDF_FILEACCESS, public FX_FILEAVAIL, public FX_DOWNLOADHINTS
+{
+public:
+ QPdfDocumentPrivate();
+ ~QPdfDocumentPrivate();
+
+ QPdfDocument *q;
+ QPdfPageModel *pageModel = nullptr;
+
+ FPDF_AVAIL avail;
+ FPDF_DOCUMENT doc;
+ bool loadComplete;
+
+ QPointer<QIODevice> device;
+ QScopedPointer<QIODevice> ownDevice;
+ QBuffer asyncBuffer;
+ QPointer<QIODevice> sequentialSourceDevice;
+ QByteArray password;
+
+ QPdfDocument::Status status;
+ QPdfDocument::Error lastError;
+ int pageCount;
+
+ void clear();
+
+ void load(QIODevice *device, bool ownDevice);
+ void loadAsync(QIODevice *device);
+
+ void _q_tryLoadingWithSizeFromContentHeader();
+ void initiateAsyncLoadWithTotalSizeKnown(quint64 totalSize);
+ void _q_copyFromSequentialSourceDevice();
+ void tryLoadDocument();
+ void checkComplete();
+ bool checkPageComplete(int page);
+ void setStatus(QPdfDocument::Status status);
+
+ static FPDF_BOOL fpdf_IsDataAvail(struct _FX_FILEAVAIL* pThis, size_t offset, size_t size);
+ static int fpdf_GetBlock(void* param, unsigned long position, unsigned char* pBuf, unsigned long size);
+ static void fpdf_AddSegment(struct _FX_DOWNLOADHINTS* pThis, size_t offset, size_t size);
+ void updateLastError();
+ QString getText(FPDF_TEXTPAGE textPage, int startIndex, int count) const;
+ QPointF getCharPosition(FPDF_PAGE pdfPage, FPDF_TEXTPAGE textPage, int charIndex) const;
+ QRectF getCharBox(FPDF_PAGE pdfPage, FPDF_TEXTPAGE textPage, int charIndex) const;
+ QPointF mapPageToView(FPDF_PAGE pdfPage, double x, double y) const;
+ QRectF mapPageToView(FPDF_PAGE pdfPage, double left, double top, double right, double bottom) const;
+ QPointF mapViewToPage(FPDF_PAGE pdfPage, QPointF position) const;
+
+ // FPDF takes the rotation parameter as an int.
+ // This enum is mapping the int values defined in fpdfview.h:956.
+ // (not using enum class to ensure int convertability)
+ enum QFPDFRotation {
+ Normal = 0,
+ ClockWise90 = 1,
+ ClockWise180 = 2,
+ CounterClockWise90 = 3
+ };
+
+ static constexpr QFPDFRotation toFPDFRotation(QPdfDocumentRenderOptions::Rotation rotation)
+ {
+ switch (rotation) {
+ case QPdfDocumentRenderOptions::Rotation::None:
+ return QFPDFRotation::Normal;
+ case QPdfDocumentRenderOptions::Rotation::Clockwise90:
+ return QFPDFRotation::ClockWise90;
+ case QPdfDocumentRenderOptions::Rotation::Clockwise180:
+ return QFPDFRotation::ClockWise180;
+ case QPdfDocumentRenderOptions::Rotation::Clockwise270:
+ return QFPDFRotation::CounterClockWise90;
+ }
+ Q_UNREACHABLE();
+ }
+
+ struct TextPosition {
+ QPointF position;
+ qreal height = 0;
+ int charIndex = -1;
+ };
+ TextPosition hitTest(int page, QPointF position);
+};
+
+QT_END_NAMESPACE
+
+#endif // QPDFDOCUMENT_P_H
diff --git a/src/pdf/qpdfdocumentrenderoptions.h b/src/pdf/qpdfdocumentrenderoptions.h
new file mode 100644
index 000000000..af074d976
--- /dev/null
+++ b/src/pdf/qpdfdocumentrenderoptions.h
@@ -0,0 +1,81 @@
+// Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias König <tobias.koenig@kdab.com>
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QPDFDOCUMENTRENDEROPTIONS_H
+#define QPDFDOCUMENTRENDEROPTIONS_H
+
+#include <QtPdf/qtpdfglobal.h>
+#include <QtCore/qobject.h>
+#include <QtCore/qrect.h>
+
+QT_BEGIN_NAMESPACE
+
+class QPdfDocumentRenderOptions
+{
+public:
+ enum class Rotation {
+ None,
+ Clockwise90,
+ Clockwise180,
+ Clockwise270
+ };
+
+ enum class RenderFlag {
+ None = 0x000,
+ Annotations = 0x001,
+ OptimizedForLcd = 0x002,
+ Grayscale = 0x004,
+ ForceHalftone = 0x008,
+ TextAliased = 0x010,
+ ImageAliased = 0x020,
+ PathAliased = 0x040
+ };
+ Q_DECLARE_FLAGS(RenderFlags, RenderFlag)
+
+ constexpr QPdfDocumentRenderOptions() noexcept : m_renderFlags(0), m_rotation(0), m_reserved(0) {}
+
+ constexpr Rotation rotation() const noexcept { return static_cast<Rotation>(m_rotation); }
+ constexpr void setRotation(Rotation r) noexcept { m_rotation = quint32(r); }
+
+ constexpr RenderFlags renderFlags() const noexcept { return static_cast<RenderFlags>(m_renderFlags); }
+ constexpr void setRenderFlags(RenderFlags r) noexcept { m_renderFlags = quint32(r.toInt()); }
+
+ constexpr QRect scaledClipRect() const noexcept { return m_clipRect; }
+ constexpr void setScaledClipRect(const QRect &r) noexcept { m_clipRect = r; }
+
+ constexpr QSize scaledSize() const noexcept { return m_scaledSize; }
+ constexpr void setScaledSize(const QSize &s) noexcept { m_scaledSize = s; }
+
+private:
+ friend constexpr inline bool operator==(const QPdfDocumentRenderOptions &lhs, const QPdfDocumentRenderOptions &rhs) noexcept;
+
+ QRect m_clipRect;
+ QSize m_scaledSize;
+
+ quint32 m_renderFlags : 8;
+ quint32 m_rotation : 3;
+ quint32 m_reserved : 21;
+ quint32 m_reserved2 = 0;
+};
+
+Q_DECLARE_TYPEINFO(QPdfDocumentRenderOptions, Q_PRIMITIVE_TYPE);
+Q_DECLARE_OPERATORS_FOR_FLAGS(QPdfDocumentRenderOptions::RenderFlags)
+
+constexpr inline bool operator==(const QPdfDocumentRenderOptions &lhs, const QPdfDocumentRenderOptions &rhs) noexcept
+{
+ return lhs.m_clipRect == rhs.m_clipRect && lhs.m_scaledSize == rhs.m_scaledSize &&
+ lhs.m_renderFlags == rhs.m_renderFlags && lhs.m_rotation == rhs.m_rotation &&
+ lhs.m_reserved == rhs.m_reserved && lhs.m_reserved2 == rhs.m_reserved2; // fix -Wunused-private-field
+}
+
+constexpr inline bool operator!=(const QPdfDocumentRenderOptions &lhs, const QPdfDocumentRenderOptions &rhs) noexcept
+{
+ return !operator==(lhs, rhs);
+}
+
+QT_END_NAMESPACE
+
+Q_DECLARE_METATYPE(QPdfDocumentRenderOptions)
+
+#endif // QPDFDOCUMENTRENDEROPTIONS_H
diff --git a/src/pdf/qpdfdocumentrenderoptions.qdoc b/src/pdf/qpdfdocumentrenderoptions.qdoc
index cc5083f9d..ad8e7bfdb 100644
--- a/src/pdf/qpdfdocumentrenderoptions.qdoc
+++ b/src/pdf/qpdfdocumentrenderoptions.qdoc
@@ -1,38 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias König <tobias.koenig@kdab.com>
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias König <tobias.koenig@kdab.com>
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qpdfdocumentrenderoptions.h"
@@ -49,13 +16,42 @@ QT_BEGIN_NAMESPACE
*/
/*!
+ \enum QPdfDocumentRenderOptions::Rotation
+
+ This enum describes the rotation of the page for rendering.
+
+ \value None Do not rotate (the default)
+ \value Clockwise90 Rotate 90 degrees clockwise
+ \value Clockwise180 Rotate 180 degrees
+ \value Clockwise270 Rotate 270 degrees clockwise
+
+ \sa QPdfDocument::render()
+*/
+/*!
+ \enum QPdfDocumentRenderOptions::RenderFlag
+
+ This enum is used to describe how a page should be rendered.
+
+ \value None The default value, representing no flags.
+ \value Annotations The page is rendered with annotations.
+ \value OptimizedForLcd The text of the page is rendered optimized for LCD display.
+ \value Grayscale The page is rendered grayscale.
+ \value ForceHalftone Always use halftones for rendering if the output image is stretched.
+ \value TextAliased Anti-aliasing is disabled for rendering text.
+ \value ImageAliased Anti-aliasing is disabled for rendering images.
+ \value PathAliased Anti-aliasing is disabled for rendering paths.
+
+ \sa QPdfDocument::render()
+*/
+
+/*!
\fn QPdfDocumentRenderOptions::QPdfDocumentRenderOptions()
Constructs a QPdfDocumentRenderOptions object.
*/
/*!
- \fn QPdf::Rotation QPdfDocumentRenderOptions::rotation() const
+ \fn QPdfDocumentRenderOptions::Rotation QPdfDocumentRenderOptions::rotation() const
Returns the rotation used for rendering a page from a PDF document.
@@ -63,7 +59,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn void QPdfDocumentRenderOptions::setRotation(QPdf::Rotation rotation)
+ \fn void QPdfDocumentRenderOptions::setRotation(QPdfDocumentRenderOptions::Rotation rotation)
Sets the \a rotation used for rendering a page from a PDF document.
@@ -71,7 +67,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn QPdf::RenderFlags QPdfDocumentRenderOptions::renderFlags() const
+ \fn QPdfDocumentRenderOptions::RenderFlags QPdfDocumentRenderOptions::renderFlags() const
Returns the special flags used for rendering a page from a PDF document.
@@ -79,7 +75,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn void QPdfDocumentRenderOptions::setRenderFlags(QPdf::RenderFlags flags)
+ \fn void QPdfDocumentRenderOptions::setRenderFlags(QPdfDocumentRenderOptions::RenderFlags flags)
Sets the special \a flags used for rendering a page from a PDF document.
@@ -96,10 +92,10 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn void QPdfDocumentRenderOptions::setScaledClipRect(QRect rect)
+ \fn void QPdfDocumentRenderOptions::setScaledClipRect(const QRect &r)
- Sets the region \a rect to be clipped from the page after having been
- scaled to \l scaledSize().
+ Sets the rectangle region (\a r) to be clipped from the page after having
+ been scaled to \l scaledSize().
\sa scaledClipRect()
*/
@@ -107,15 +103,15 @@ QT_BEGIN_NAMESPACE
/*!
\fn QRect QPdfDocumentRenderOptions::scaledSize() const
- Returns the \a size of the page to be rendered, in pixels.
+ Returns the size of the page to be rendered, in pixels.
\sa setScaledSize()
*/
/*!
- \fn void QPdfDocumentRenderOptions::setScaledSize(QSize size)
+ \fn void QPdfDocumentRenderOptions::setScaledSize(const QSize &s)
- Sets the \a size of the page to be rendered, in pixels.
+ Sets the size (\a s) of the page to be rendered, in pixels.
\sa scaledSize()
*/
diff --git a/src/pdf/qpdffile.cpp b/src/pdf/qpdffile.cpp
new file mode 100644
index 000000000..a54f6a568
--- /dev/null
+++ b/src/pdf/qpdffile.cpp
@@ -0,0 +1,28 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qpdffile_p.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \internal
+ \class QPdfFile
+ \inmodule QtPdf
+
+ QPdfFile is a means of passing a PDF file along with the associated
+ QPdfDocument together into QPdfIOHandler::load(QIODevice *device) so that
+ QPdfIOHandler does not need to construct its own redundant QPdfDocument
+ instance. If it succeeds in casting the QIODevice to a QPdfFile, it is
+ expected to use the QPdfDocument operations for all I/O, and thus the
+ normal QFile I/O functions are not needed for that use case.
+*/
+
+QPdfFile::QPdfFile(QPdfDocument *doc)
+ : QFile(doc->fileName()), m_document(doc)
+{
+}
+
+QT_END_NAMESPACE
+
+//#include "moc_qpdffile_p.cpp"
diff --git a/src/pdf/qpdffile_p.h b/src/pdf/qpdffile_p.h
new file mode 100644
index 000000000..f678cdcdc
--- /dev/null
+++ b/src/pdf/qpdffile_p.h
@@ -0,0 +1,37 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QPDFFILE_P_H
+#define QPDFFILE_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qpdfdocument.h"
+
+#include <QtCore/qfile.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_PDF_EXPORT QPdfFile : public QFile
+{
+ Q_OBJECT
+public:
+ QPdfFile(QPdfDocument *doc);
+ QPdfDocument *document() { return m_document; }
+
+private:
+ QPdfDocument *m_document;
+};
+
+QT_END_NAMESPACE
+
+#endif // QPDFFILE_P_H
diff --git a/src/pdf/qpdflink.cpp b/src/pdf/qpdflink.cpp
new file mode 100644
index 000000000..0c2867086
--- /dev/null
+++ b/src/pdf/qpdflink.cpp
@@ -0,0 +1,189 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qpdflink.h"
+#include "qpdflink_p.h"
+#include "qpdflinkmodel_p.h"
+#include <QGuiApplication>
+#include <QDebug>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QPdfLink
+ \since 6.4
+ \inmodule QtPdf
+
+ \brief The QPdfLink class defines a link between a region on a page
+ (such as a hyperlink or a search result) and a destination
+ (page, location on the page, and zoom level at which to view it).
+*/
+
+/*!
+ Constructs an invalid Destination.
+
+ \sa valid
+*/
+QPdfLink::QPdfLink() :
+ QPdfLink(new QPdfLinkPrivate()) { }
+
+QPdfLink::QPdfLink(int page, QPointF location, qreal zoom)
+ : QPdfLink(new QPdfLinkPrivate(page, location, zoom))
+{
+}
+
+QPdfLink::QPdfLink(int page, QList<QRectF> rects,
+ QString contextBefore, QString contextAfter)
+ : QPdfLink(new QPdfLinkPrivate(page, std::move(rects),
+ std::move(contextBefore),
+ std::move(contextAfter)))
+{
+}
+
+QPdfLink::QPdfLink(QPdfLinkPrivate *d) : d(d) {}
+
+QPdfLink::~QPdfLink() = default;
+QPdfLink::QPdfLink(const QPdfLink &other) noexcept = default;
+QPdfLink::QPdfLink(QPdfLink &&other) noexcept = default;
+QPdfLink &QPdfLink::operator=(const QPdfLink &other) = default;
+
+/*!
+ \property QPdfLink::valid
+
+ This property holds whether the link is valid.
+*/
+bool QPdfLink::isValid() const
+{
+ return d->page >= 0;
+}
+
+/*!
+ \property QPdfLink::page
+
+ This property holds the page number.
+ If the link is a search result, it is the page number on which the result is found;
+ if the link is a hyperlink, it is the destination page number.
+*/
+int QPdfLink::page() const
+{
+ return d->page;
+}
+
+/*!
+ \property QPdfLink::location
+
+ This property holds the location on the \l page, in units of points.
+ If the link is a search result, it is the location where the result is found;
+ if the link is a hyperlink, it is the destination location.
+*/
+QPointF QPdfLink::location() const
+{
+ return d->location;
+}
+
+/*!
+ \property QPdfLink::zoom
+
+ This property holds the suggested magnification level, where 1.0 means default scale
+ (1 pixel = 1 point). If the link is a search result, this value is not used.
+*/
+qreal QPdfLink::zoom() const
+{
+ return d->zoom;
+}
+
+/*!
+ \property QPdfLink::url
+
+ This property holds the destination URL if the link is an external hyperlink;
+ otherwise, it's empty.
+*/
+QUrl QPdfLink::url() const
+{
+ return d->url;
+}
+
+/*!
+ \property QPdfLink::contextBefore
+
+ This property holds adjacent text found on the page before the search string.
+ If the link is a hyperlink, this string is empty.
+
+ \sa QPdfSearchModel::resultsOnPage(), QPdfSearchModel::resultAtIndex()
+*/
+QString QPdfLink::contextBefore() const
+{
+ return d->contextBefore;
+}
+
+/*!
+ \property QPdfLink::contextAfter
+
+ This property holds adjacent text found on the page after the search string.
+ If the link is a hyperlink, this string is empty.
+
+ \sa QPdfSearchModel::resultsOnPage(), QPdfSearchModel::resultAtIndex()
+*/
+QString QPdfLink::contextAfter() const
+{
+ return d->contextAfter;
+}
+
+/*!
+ \property QPdfLink::rectangles
+
+ This property holds the region (set of rectangles) occupied by the link or
+ search result on the page where it was found. If the text wraps around to
+ multiple lines on the page, there may be multiple rectangles:
+
+ \image wrapping-search-result.png
+
+ \sa QPdfSearchModel::resultsOnPage(), QPdfSearchModel::resultAtIndex()
+*/
+QList<QRectF> QPdfLink::rectangles() const
+{
+ return d->rects;
+}
+
+/*!
+ Returns a translated representation for display.
+
+ \sa copyToClipboard()
+*/
+QString QPdfLink::toString() const
+{
+ if (d->page <= 0)
+ return d->url.toString();
+ return QPdfLinkModel::tr("Page %1 location %2, %3 zoom %4")
+ .arg(d->page).arg(d->location.x(), 0, 'f', 1).arg(d->location.y(), 0, 'f', 1)
+ .arg(d->zoom, 0, 'f', 0);
+}
+
+/*!
+ Copies the toString() representation of the link to the
+ \l {QGuiApplication::clipboard()}{system clipboard} depending on the \a mode given.
+*/
+void QPdfLink::copyToClipboard(QClipboard::Mode mode) const
+{
+ QGuiApplication::clipboard()->setText(toString(), mode);
+}
+
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug dbg, const QPdfLink &link)
+{
+ QDebugStateSaver saver(dbg);
+ dbg.nospace();
+ dbg << "QPdfLink(page=" << link.page()
+ << " location=" << link.location()
+ << " zoom=" << link.zoom()
+ << " contextBefore=" << link.contextBefore()
+ << " contextAfter=" << link.contextAfter()
+ << " rects=" << link.rectangles();
+ dbg << ')';
+ return dbg;
+}
+#endif
+
+QT_END_NAMESPACE
+
+#include "moc_qpdflink.cpp"
diff --git a/src/pdf/qpdflink.h b/src/pdf/qpdflink.h
new file mode 100644
index 000000000..63389afe6
--- /dev/null
+++ b/src/pdf/qpdflink.h
@@ -0,0 +1,78 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QPDFLINK_H
+#define QPDFLINK_H
+
+#include <QtPdf/qtpdfglobal.h>
+#include <QtCore/qlist.h>
+#include <QtCore/qobject.h>
+#include <QtCore/qpoint.h>
+#include <QtCore/qrect.h>
+#include <QtCore/qshareddata.h>
+#include <QtGui/qclipboard.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDebug;
+class QPdfLinkPrivate;
+
+class QPdfLink
+{
+ Q_GADGET_EXPORT(Q_PDF_EXPORT)
+ Q_PROPERTY(bool valid READ isValid)
+ Q_PROPERTY(int page READ page)
+ Q_PROPERTY(QPointF location READ location)
+ Q_PROPERTY(qreal zoom READ zoom)
+ Q_PROPERTY(QUrl url READ url)
+ Q_PROPERTY(QString contextBefore READ contextBefore)
+ Q_PROPERTY(QString contextAfter READ contextAfter)
+ Q_PROPERTY(QList<QRectF> rectangles READ rectangles)
+
+public:
+ Q_PDF_EXPORT QPdfLink();
+ Q_PDF_EXPORT ~QPdfLink();
+ Q_PDF_EXPORT QPdfLink &operator=(const QPdfLink &other);
+
+ Q_PDF_EXPORT QPdfLink(const QPdfLink &other) noexcept;
+ Q_PDF_EXPORT QPdfLink(QPdfLink &&other) noexcept;
+ QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(QPdfLink)
+
+ void swap(QPdfLink &other) noexcept { d.swap(other.d); }
+
+ Q_PDF_EXPORT bool isValid() const;
+ Q_PDF_EXPORT int page() const;
+ Q_PDF_EXPORT QPointF location() const;
+ Q_PDF_EXPORT qreal zoom() const;
+ Q_PDF_EXPORT QUrl url() const;
+ Q_PDF_EXPORT QString contextBefore() const;
+ Q_PDF_EXPORT QString contextAfter() const;
+ Q_PDF_EXPORT QList<QRectF> rectangles() const;
+ Q_PDF_EXPORT Q_INVOKABLE QString toString() const;
+ Q_PDF_EXPORT Q_INVOKABLE void copyToClipboard(QClipboard::Mode mode = QClipboard::Clipboard) const;
+
+private: // methods
+ QPdfLink(int page, QPointF location, qreal zoom);
+ QPdfLink(int page, QList<QRectF> rects, QString contextBefore, QString contextAfter);
+ QPdfLink(QPdfLinkPrivate *d);
+ friend class QPdfDocument;
+ friend class QPdfLinkModelPrivate;
+ friend class QPdfSearchModelPrivate;
+ friend class QPdfPageNavigator;
+ friend class QQuickPdfPageNavigator;
+
+private: // storage
+ QExplicitlySharedDataPointer<QPdfLinkPrivate> d;
+
+};
+Q_DECLARE_SHARED(QPdfLink)
+
+#ifndef QT_NO_DEBUG_STREAM
+Q_PDF_EXPORT QDebug operator<<(QDebug, const QPdfLink &);
+#endif
+
+QT_END_NAMESPACE
+
+Q_DECLARE_METATYPE(QPdfLink)
+
+#endif // QPDFLINK_H
diff --git a/src/pdf/qpdflink_p.h b/src/pdf/qpdflink_p.h
new file mode 100644
index 000000000..fa82f47c3
--- /dev/null
+++ b/src/pdf/qpdflink_p.h
@@ -0,0 +1,53 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QPDFLINK_P_H
+#define QPDFLINK_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qpdflink.h"
+
+#include <QPointF>
+#include <QRectF>
+#include <QUrl>
+
+QT_BEGIN_NAMESPACE
+
+class QPdfLinkPrivate : public QSharedData
+{
+public:
+ QPdfLinkPrivate() = default;
+ QPdfLinkPrivate(int page, QPointF location, qreal zoom)
+ : page(page),
+ location(location),
+ zoom(zoom) { }
+ QPdfLinkPrivate(int page, QList<QRectF> rects, QString contextBefore, QString contextAfter)
+ : page(page),
+ location(rects.first().topLeft()),
+ zoom(0),
+ contextBefore{std::move(contextBefore)},
+ contextAfter{std::move(contextAfter)},
+ rects{std::move(rects)} {}
+
+ int page = -1;
+ QPointF location;
+ qreal zoom = 1;
+ QString contextBefore;
+ QString contextAfter;
+ QUrl url;
+ QList<QRectF> rects;
+};
+
+QT_END_NAMESPACE
+
+#endif // QPDFLINK_P_H
diff --git a/src/pdf/qpdflinkmodel.cpp b/src/pdf/qpdflinkmodel.cpp
index 900d3cd9e..0a8b1e812 100644
--- a/src/pdf/qpdflinkmodel.cpp
+++ b/src/pdf/qpdflinkmodel.cpp
@@ -1,41 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+#include "qpdflink_p.h"
+#include "qpdflinkmodel.h"
#include "qpdflinkmodel_p.h"
-#include "qpdflinkmodel_p_p.h"
#include "qpdfdocument_p.h"
#include "third_party/pdfium/public/fpdf_doc.h"
@@ -48,44 +16,85 @@ QT_BEGIN_NAMESPACE
Q_LOGGING_CATEGORY(qLcLink, "qt.pdf.links")
+/*!
+ \class QPdfLinkModel
+ \since 6.6
+ \inmodule QtPdf
+ \inherits QAbstractListModel
+
+ \brief The QPdfLinkModel class holds the geometry and the destination for
+ each link that the specified \l page contains.
+
+ This is used in PDF viewers to implement the hyperlink mechanism.
+*/
+
+/*!
+ \enum QPdfLinkModel::Role
+
+ \value Link A QPdfLink object.
+ \value Rectangle Bounding rectangle around the link.
+ \value Url If the link is a web link, the URL for that; otherwise an empty URL.
+ \value Page If the link is an internal link, the page number to which the link should jump; otherwise \c {-1}.
+ \value Location If the link is an internal link, the location on the page to which the link should jump.
+ \value Zoom If the link is an internal link, the suggested zoom level on the destination page.
+ \omitvalue NRoles
+*/
+
+/*!
+ Constructs a new link model with parent object \a parent.
+*/
QPdfLinkModel::QPdfLinkModel(QObject *parent)
- : QAbstractListModel(*(new QPdfLinkModelPrivate()), parent)
+ : QAbstractListModel(parent),
+ d_ptr{std::make_unique<QPdfLinkModelPrivate>(this)}
{
+ Q_D(QPdfLinkModel);
QMetaEnum rolesMetaEnum = metaObject()->enumerator(metaObject()->indexOfEnumerator("Role"));
- for (int r = Qt::UserRole; r < int(Role::_Count); ++r)
- m_roleNames.insert(r, QByteArray(rolesMetaEnum.valueToKey(r)).toLower());
+ for (int r = Qt::UserRole; r < int(Role::NRoles); ++r)
+ d->roleNames.insert(r, QByteArray(rolesMetaEnum.valueToKey(r)).toLower());
}
+/*!
+ Destroys the model.
+*/
QPdfLinkModel::~QPdfLinkModel() {}
QHash<int, QByteArray> QPdfLinkModel::roleNames() const
{
- return m_roleNames;
+ Q_D(const QPdfLinkModel);
+ return d->roleNames;
}
+/*!
+ \reimp
+*/
int QPdfLinkModel::rowCount(const QModelIndex &parent) const
{
Q_D(const QPdfLinkModel);
- Q_UNUSED(parent)
- return d->links.count();
+ Q_UNUSED(parent);
+ return d->links.size();
}
+/*!
+ \reimp
+*/
QVariant QPdfLinkModel::data(const QModelIndex &index, int role) const
{
Q_D(const QPdfLinkModel);
- const QPdfLinkModelPrivate::Link &link = d->links.at(index.row());
+ const auto &link = d->links.at(index.row());
switch (Role(role)) {
- case Role::Rect:
- return link.rect;
+ case Role::Link:
+ return QVariant::fromValue(link);
+ case Role::Rectangle:
+ return link.rectangles().empty() ? QVariant() : link.rectangles().constFirst();
case Role::Url:
- return link.url;
+ return link.url();
case Role::Page:
- return link.page;
+ return link.page();
case Role::Location:
- return link.location;
+ return link.location();
case Role::Zoom:
- return link.zoom;
- case Role::_Count:
+ return link.zoom();
+ case Role::NRoles:
break;
}
if (role == Qt::DisplayRole)
@@ -93,6 +102,10 @@ QVariant QPdfLinkModel::data(const QModelIndex &index, int role) const
return QVariant();
}
+/*!
+ \property QPdfLinkModel::document
+ \brief The document to load links from.
+*/
QPdfDocument *QPdfLinkModel::document() const
{
Q_D(const QPdfLinkModel);
@@ -115,6 +128,10 @@ void QPdfLinkModel::setDocument(QPdfDocument *document)
d->update();
}
+/*!
+ \property QPdfLinkModel::page
+ \brief The page to load links from.
+*/
int QPdfLinkModel::page() const
{
Q_D(const QPdfLinkModel);
@@ -132,8 +149,22 @@ void QPdfLinkModel::setPage(int page)
d->update();
}
-QPdfLinkModelPrivate::QPdfLinkModelPrivate() : QAbstractItemModelPrivate()
+/*!
+ Returns a \l {QPdfLink::isValid()}{valid} link if found under the \a point
+ (given in units of points, 1/72 of an inch), or an invalid link if it is
+ not found. In other words, this function is useful for picking, to handle
+ mouse click or hover.
+*/
+QPdfLink QPdfLinkModel::linkAt(QPointF point) const
{
+ Q_D(const QPdfLinkModel);
+ for (const auto &link : std::as_const(d->links)) {
+ for (const auto &rect : link.rectangles()) {
+ if (rect.contains(point))
+ return link;
+ }
+ }
+ return {};
}
void QPdfLinkModelPrivate::update()
@@ -148,7 +179,6 @@ void QPdfLinkModelPrivate::update()
qCWarning(qLcLink) << "failed to load page" << page;
return;
}
- double pageHeight = FPDF_GetPageHeight(pdfPage);
q->beginResetModel();
links.clear();
@@ -166,42 +196,68 @@ void QPdfLinkModelPrivate::update()
qCWarning(qLcLink) << "skipping link with invalid bounding box";
continue; // while enumerating links
}
- Link linkData;
- linkData.rect = QRectF(rect.left, pageHeight - rect.top,
- rect.right - rect.left, rect.top - rect.bottom);
+ // In case horizontal/vertical coordinates are flipped, swap them.
+ if (rect.right < rect.left)
+ std::swap(rect.right, rect.left);
+ if (rect.bottom > rect.top)
+ std::swap(rect.bottom, rect.top);
+
+ QPdfLink linkData;
+ // Use quad points if present; otherwise use the rect.
+ if (int quadPointsCount = FPDFLink_CountQuadPoints(linkAnnot) > 0) {
+ for (int i = 0; i < quadPointsCount; ++i) {
+ FS_QUADPOINTSF point;
+ if (FPDFLink_GetQuadPoints(linkAnnot, i, &point)) {
+ // Quadpoints are counter clockwise from bottom left (x1, y1)
+ QPolygonF poly;
+ poly << QPointF(point.x1, point.y1);
+ poly << QPointF(point.x2, point.y2);
+ poly << QPointF(point.x3, point.y3);
+ poly << QPointF(point.x4, point.y4);
+ QRectF bounds = poly.boundingRect();
+ bounds = document->d->mapPageToView(pdfPage, bounds.left(), bounds.top(), bounds.right(), bounds.bottom());
+ qCDebug(qLcLink) << "quadpoints" << i << "of" << quadPointsCount << ":" << poly << "mapped bounds" << bounds;
+ linkData.d->rects << bounds;
+ // QPdfLink could store polygons rather than rects, to get the benefit of quadpoints;
+ // so far we didn't bother. It would be an API change, and we'd need to use Shapes in PdfLinkDelegate.qml
+ }
+ }
+ } else {
+ linkData.d->rects << document->d->mapPageToView(pdfPage, rect.left, rect.top, rect.right, rect.bottom);
+ }
FPDF_DEST dest = FPDFLink_GetDest(doc, linkAnnot);
FPDF_ACTION action = FPDFLink_GetAction(linkAnnot);
switch (FPDFAction_GetType(action)) {
case PDFACTION_UNSUPPORTED: // this happens with valid links in some PDFs
case PDFACTION_GOTO: {
- linkData.page = FPDFDest_GetDestPageIndex(doc, dest);
- if (linkData.page < 0) {
- qCWarning(qLcLink) << "skipping link with invalid page number";
+ linkData.d->page = FPDFDest_GetDestPageIndex(doc, dest);
+ if (linkData.d->page < 0) {
+ qCWarning(qLcLink) << "skipping link with invalid page number" << linkData.d->page;
continue; // while enumerating links
}
FPDF_BOOL hasX, hasY, hasZoom;
FS_FLOAT x, y, zoom;
ok = FPDFDest_GetLocationInPage(dest, &hasX, &hasY, &hasZoom, &x, &y, &zoom);
if (!ok) {
- qCWarning(qLcLink) << "link with invalid location and/or zoom @" << linkData.rect;
+ qCWarning(qLcLink) << "link with invalid location and/or zoom @" << linkData.d->rects;
break; // at least we got a page number, so the link will jump there
}
if (hasX && hasY)
- linkData.location = QPointF(x, pageHeight - y);
+ linkData.d->location = document->d->mapPageToView(pdfPage, x, y);
if (hasZoom)
- linkData.zoom = zoom;
+ linkData.d->zoom = zoom;
break;
}
case PDFACTION_URI: {
unsigned long len = FPDFAction_GetURIPath(doc, action, nullptr, 0);
if (len < 1) {
- qCWarning(qLcLink) << "skipping link with empty URI @" << linkData.rect;
+ qCWarning(qLcLink) << "skipping link with empty URI @" << linkData.d->rects;
continue; // while enumerating links
} else {
QByteArray buf(len, 0);
unsigned long got = FPDFAction_GetURIPath(doc, action, buf.data(), len);
Q_ASSERT(got == len);
- linkData.url = QString::fromLatin1(buf.data(), got - 1);
+ linkData.d->url = QString::fromLatin1(buf.data(), got - 1);
}
break;
}
@@ -209,13 +265,13 @@ void QPdfLinkModelPrivate::update()
case PDFACTION_REMOTEGOTO: {
unsigned long len = FPDFAction_GetFilePath(action, nullptr, 0);
if (len < 1) {
- qCWarning(qLcLink) << "skipping link with empty file path @" << linkData.rect;
+ qCWarning(qLcLink) << "skipping link with empty file path @" << linkData.d->rects;
continue; // while enumerating links
} else {
QByteArray buf(len, 0);
unsigned long got = FPDFAction_GetFilePath(action, buf.data(), len);
Q_ASSERT(got == len);
- linkData.url = QUrl::fromLocalFile(QString::fromLatin1(buf.data(), got - 1)).toString();
+ linkData.d->url = QUrl::fromLocalFile(QString::fromLatin1(buf.data(), got - 1)).toString();
// Unfortunately, according to comments in fpdf_doc.h, if it's PDFACTION_REMOTEGOTO,
// we can't get the page and location without first opening the linked document
@@ -234,23 +290,23 @@ void QPdfLinkModelPrivate::update()
if (webLinks) {
int count = FPDFLink_CountWebLinks(webLinks);
for (int i = 0; i < count; ++i) {
- Link linkData;
+ QPdfLink linkData;
int len = FPDFLink_GetURL(webLinks, i, nullptr, 0);
if (len < 1) {
qCWarning(qLcLink) << "skipping link" << i << "with empty URL";
} else {
- QVector<unsigned short> buf(len);
+ QList<unsigned short> buf(len);
int got = FPDFLink_GetURL(webLinks, i, buf.data(), len);
Q_ASSERT(got == len);
- linkData.url = QString::fromUtf16(buf.data(), got - 1);
+ linkData.d->url = QString::fromUtf16(
+ reinterpret_cast<const char16_t *>(buf.data()), got - 1);
}
- FPDFLink_GetTextRange(webLinks, i, &linkData.textStart, &linkData.textCharCount);
len = FPDFLink_CountRects(webLinks, i);
for (int r = 0; r < len; ++r) {
double left, top, right, bottom;
bool success = FPDFLink_GetRect(webLinks, i, r, &left, &top, &right, &bottom);
if (success) {
- linkData.rect = QRectF(left, pageHeight - top, right - left, top - bottom);
+ linkData.d->rects << document->d->mapPageToView(pdfPage, left, top, right, bottom);
links << linkData;
}
}
@@ -263,8 +319,8 @@ void QPdfLinkModelPrivate::update()
// All done
FPDF_ClosePage(pdfPage);
if (Q_UNLIKELY(qLcLink().isDebugEnabled())) {
- for (const Link &l : links)
- qCDebug(qLcLink) << l.rect << l.toString();
+ for (const auto &l : links)
+ qCDebug(qLcLink) << l;
}
q->endResetModel();
}
@@ -273,21 +329,10 @@ void QPdfLinkModel::onStatusChanged(QPdfDocument::Status status)
{
Q_D(QPdfLinkModel);
qCDebug(qLcLink) << "sees document statusChanged" << status;
- if (status == QPdfDocument::Ready)
+ if (status == QPdfDocument::Status::Ready)
d->update();
}
-QString QPdfLinkModelPrivate::Link::toString() const
-{
- QString ret;
- if (page >= 0)
- return QLatin1String("page ") + QString::number(page) +
- QLatin1String(" location ") + QString::number(location.x()) + QLatin1Char(',') + QString::number(location.y()) +
- QLatin1String(" zoom ") + QString::number(zoom);
- else
- return url.toString();
-}
-
QT_END_NAMESPACE
#include "moc_qpdflinkmodel_p.cpp"
diff --git a/src/pdf/qpdflinkmodel.h b/src/pdf/qpdflinkmodel.h
new file mode 100644
index 000000000..be2ce890c
--- /dev/null
+++ b/src/pdf/qpdflinkmodel.h
@@ -0,0 +1,67 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QPDFLINKMODEL_H
+#define QPDFLINKMODEL_H
+
+#include <QtPdf/qtpdfglobal.h>
+#include <QtPdf/qpdfdocument.h>
+#include <QtPdf/qpdflink.h>
+
+#include <QtCore/QAbstractListModel>
+
+#include <memory>
+
+QT_BEGIN_NAMESPACE
+
+class QPdfLinkModelPrivate;
+
+class Q_PDF_EXPORT QPdfLinkModel : public QAbstractListModel
+{
+ Q_OBJECT
+ Q_PROPERTY(QPdfDocument *document READ document WRITE setDocument NOTIFY documentChanged)
+ Q_PROPERTY(int page READ page WRITE setPage NOTIFY pageChanged)
+
+public:
+ enum class Role {
+ Link = Qt::UserRole,
+ Rectangle,
+ Url,
+ Page,
+ Location,
+ Zoom,
+ NRoles
+ };
+ Q_ENUM(Role)
+ explicit QPdfLinkModel(QObject *parent = nullptr);
+ ~QPdfLinkModel() override;
+
+ QPdfDocument *document() const;
+
+ QHash<int, QByteArray> roleNames() const override;
+ int rowCount(const QModelIndex &parent) const override;
+ QVariant data(const QModelIndex &index, int role) const override;
+
+ int page() const;
+
+ QPdfLink linkAt(QPointF point) const;
+
+public Q_SLOTS:
+ void setDocument(QPdfDocument *document);
+ void setPage(int page);
+
+Q_SIGNALS:
+ void documentChanged();
+ void pageChanged(int page);
+
+private Q_SLOTS:
+ void onStatusChanged(QPdfDocument::Status status);
+
+private:
+ Q_DECLARE_PRIVATE(QPdfLinkModel)
+ const std::unique_ptr<QPdfLinkModelPrivate> d_ptr;
+};
+
+QT_END_NAMESPACE
+
+#endif // QPDFLINKMODEL_H
diff --git a/src/pdf/qpdflinkmodel_p.h b/src/pdf/qpdflinkmodel_p.h
new file mode 100644
index 000000000..ba46a6e00
--- /dev/null
+++ b/src/pdf/qpdflinkmodel_p.h
@@ -0,0 +1,42 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QPDFLINKMODEL_P_H
+#define QPDFLINKMODEL_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qpdflinkmodel.h"
+#include <private/qabstractitemmodel_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QPdfLinkModelPrivate
+{
+ QPdfLinkModel *q_ptr;
+ Q_DECLARE_PUBLIC(QPdfLinkModel)
+
+public:
+ explicit QPdfLinkModelPrivate(QPdfLinkModel *qq)
+ : q_ptr(qq) {}
+
+ void update();
+
+ QHash<int, QByteArray> roleNames;
+ QPdfDocument *document = nullptr;
+ QList<QPdfLink> links;
+ int page = 0;
+};
+
+QT_END_NAMESPACE
+
+#endif // QPDFLINKMODEL_P_H
diff --git a/src/pdf/qpdfnamespace.qdoc b/src/pdf/qpdfnamespace.qdoc
deleted file mode 100644
index 96bb090e9..000000000
--- a/src/pdf/qpdfnamespace.qdoc
+++ /dev/null
@@ -1,74 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias König <tobias.koenig@kdab.com>
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \namespace QPdf
- \inmodule QtPdf
- \keyword QPdf Namespace
-
- \brief The QPdf namespace contains miscellaneous identifiers
- used throughout the QtPdf module.
-*/
-
-/*!
- \enum QPdf::Rotation
-
- This enum describes the rotation of the page for rendering.
-
- \value Rotate0 Do not rotate (the default)
- \value Rotate90 Rotate 90 degrees clockwise
- \value Rotate180 Rotate 180 degrees
- \value Rotate270 Rotate 270 degrees clockwise
-
- \sa QPdfDocument::render()
-*/
-/*!
- \enum QPdf::RenderFlag
-
- This enum is used to describe how a page should be rendered.
-
- \value NoRenderFlags The default value, representing no flags.
- \value RenderAnnotations The page is rendered with annotations.
- \value RenderOptimizedForLcd The text of the page is rendered optimized for LCD display.
- \value RenderGrayscale The page is rendered grayscale.
- \value RenderForceHalftone Always use halftones for rendering if the output image is stretched.
- \value RenderTextAliased Anti-aliasing is disabled for rendering text.
- \value RenderImageAliased Anti-aliasing is disabled for rendering images.
- \value RenderPathAliased Anti-aliasing is disabled for rendering paths.
-
- \sa QPdfDocument::render()
-*/
-
diff --git a/src/pdf/qpdfpagenavigation.cpp b/src/pdf/qpdfpagenavigation.cpp
deleted file mode 100644
index 497c1c2eb..000000000
--- a/src/pdf/qpdfpagenavigation.cpp
+++ /dev/null
@@ -1,314 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias König <tobias.koenig@kdab.com>
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qpdfpagenavigation.h"
-
-#include "qpdfdocument.h"
-
-#include <private/qobject_p.h>
-
-#include <QPointer>
-
-QT_BEGIN_NAMESPACE
-
-class QPdfPageNavigationPrivate : public QObjectPrivate
-{
-public:
- QPdfPageNavigationPrivate()
- : QObjectPrivate()
- {
- }
-
- void update()
- {
- Q_Q(QPdfPageNavigation);
-
- const bool documentAvailable = m_document && m_document->status() == QPdfDocument::Ready;
-
- if (documentAvailable) {
- const int newPageCount = m_document->pageCount();
- if (m_pageCount != newPageCount) {
- m_pageCount = newPageCount;
- emit q->pageCountChanged(m_pageCount);
- }
- } else {
- if (m_pageCount != 0) {
- m_pageCount = 0;
- emit q->pageCountChanged(m_pageCount);
- }
- }
-
- if (m_currentPage != 0) {
- m_currentPage = 0;
- emit q->currentPageChanged(m_currentPage);
- }
-
- updatePrevNext();
- }
-
- void updatePrevNext()
- {
- Q_Q(QPdfPageNavigation);
-
- const bool hasPreviousPage = m_currentPage > 0;
- const bool hasNextPage = m_currentPage < (m_pageCount - 1);
-
- if (m_canGoToPreviousPage != hasPreviousPage) {
- m_canGoToPreviousPage = hasPreviousPage;
- emit q->canGoToPreviousPageChanged(m_canGoToPreviousPage);
- }
-
- if (m_canGoToNextPage != hasNextPage) {
- m_canGoToNextPage = hasNextPage;
- emit q->canGoToNextPageChanged(m_canGoToNextPage);
- }
- }
-
- void documentStatusChanged()
- {
- update();
- }
-
- Q_DECLARE_PUBLIC(QPdfPageNavigation)
-
- QPointer<QPdfDocument> m_document = nullptr;
- int m_currentPage = 0;
- int m_pageCount = 0;
- bool m_canGoToPreviousPage = false;
- bool m_canGoToNextPage = false;
-
- QMetaObject::Connection m_documentStatusChangedConnection;
-};
-
-/*!
- \class QPdfPageNavigation
- \since 5.10
- \inmodule QtPdf
-
- \brief The QPdfPageNavigation class handles the navigation through a PDF document.
-
- \sa QPdfDocument
-*/
-
-
-/*!
- Constructs a page navigation object with parent object \a parent.
-*/
-QPdfPageNavigation::QPdfPageNavigation(QObject *parent)
- : QObject(*new QPdfPageNavigationPrivate, parent)
-{
-}
-
-/*!
- Destroys the page navigation object.
-*/
-QPdfPageNavigation::~QPdfPageNavigation()
-{
-}
-
-/*!
- \property QPdfPageNavigation::document
- \brief The document instance on which this object navigates.
-
- By default, this property is \c nullptr.
-
- \sa document(), setDocument(), QPdfDocument
-*/
-
-/*!
- Returns the document on which this object navigates, or a \c nullptr
- if none has set before.
-
- \sa QPdfDocument
-*/
-QPdfDocument* QPdfPageNavigation::document() const
-{
- Q_D(const QPdfPageNavigation);
-
- return d->m_document;
-}
-
-/*!
- Sets the \a document this object navigates on.
-
- After a new document has been set, the currentPage will be \c 0.
-
- \sa QPdfDocument
-*/
-void QPdfPageNavigation::setDocument(QPdfDocument *document)
-{
- Q_D(QPdfPageNavigation);
-
- if (d->m_document == document)
- return;
-
- if (d->m_document)
- disconnect(d->m_documentStatusChangedConnection);
-
- d->m_document = document;
- emit documentChanged(d->m_document);
-
- if (d->m_document)
- d->m_documentStatusChangedConnection = connect(d->m_document.data(), &QPdfDocument::statusChanged, this, [d](){ d->documentStatusChanged(); });
-
- d->update();
-}
-
-/*!
- \property QPdfPageNavigation::currentPage
- \brief The current page number in the document.
-
- \sa currentPage(), setCurrentPage()
-*/
-
-/*!
- Returns the current page number or \c 0 if there is no document set.
-
- After a document has been loaded, the currentPage will always be \c 0.
-*/
-int QPdfPageNavigation::currentPage() const
-{
- Q_D(const QPdfPageNavigation);
-
- return d->m_currentPage;
-}
-
-/*!
- \fn void QPdfPageNavigation::setCurrentPage(int page)
-
- Sets the current \a page number.
-*/
-void QPdfPageNavigation::setCurrentPage(int newPage)
-{
- Q_D(QPdfPageNavigation);
-
- if (newPage < 0 || newPage >= d->m_pageCount)
- return;
-
- if (d->m_currentPage == newPage)
- return;
-
- d->m_currentPage = newPage;
- emit currentPageChanged(d->m_currentPage);
-
- d->updatePrevNext();
-}
-
-/*!
- \property QPdfPageNavigation::pageCount
- \brief The number of pages in the document.
-
- \sa pageCount()
-*/
-
-/*!
- Returns the number of pages in the document or \c 0 if there
- is no document set.
-*/
-int QPdfPageNavigation::pageCount() const
-{
- Q_D(const QPdfPageNavigation);
-
- return d->m_pageCount;
-}
-
-/*!
- \property QPdfPageNavigation::canGoToPreviousPage
- \brief Indicates whether there is a page before the current page.
-
- \sa canGoToPreviousPage(), goToPreviousPage()
-*/
-
-/*!
- Returns whether there is a page before the current one.
-*/
-bool QPdfPageNavigation::canGoToPreviousPage() const
-{
- Q_D(const QPdfPageNavigation);
-
- return d->m_canGoToPreviousPage;
-}
-
-/*!
- \property QPdfPageNavigation::canGoToNextPage
- \brief Indicates whether there is a page after the current page.
-
- \sa canGoToNextPage(), goToNextPage()
-*/
-
-/*!
- Returns whether there is a page after the current one.
-*/
-bool QPdfPageNavigation::canGoToNextPage() const
-{
- Q_D(const QPdfPageNavigation);
-
- return d->m_canGoToNextPage;
-}
-
-/*!
- Changes the current page to the previous page.
-
- If there is no previous page in the document, nothing happens.
-
- \sa canGoToPreviousPage
-*/
-void QPdfPageNavigation::goToPreviousPage()
-{
- Q_D(QPdfPageNavigation);
-
- if (d->m_currentPage > 0)
- setCurrentPage(d->m_currentPage - 1);
-}
-
-/*!
- Changes the current page to the next page.
-
- If there is no next page in the document, nothing happens.
-
- \sa canGoToNextPage
-*/
-void QPdfPageNavigation::goToNextPage()
-{
- Q_D(QPdfPageNavigation);
-
- if (d->m_currentPage < d->m_pageCount - 1)
- setCurrentPage(d->m_currentPage + 1);
-}
-
-QT_END_NAMESPACE
-
-#include "moc_qpdfpagenavigation.cpp"
diff --git a/src/pdf/qpdfpagenavigator.cpp b/src/pdf/qpdfpagenavigator.cpp
new file mode 100644
index 000000000..e077e2184
--- /dev/null
+++ b/src/pdf/qpdfpagenavigator.cpp
@@ -0,0 +1,362 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qpdfpagenavigator.h"
+#include "qpdfdocument.h"
+#include "qpdflink_p.h"
+
+#include <QtCore/qloggingcategory.h>
+#include <QtCore/qpointer.h>
+
+QT_BEGIN_NAMESPACE
+
+Q_LOGGING_CATEGORY(qLcNav, "qt.pdf.pagenavigator")
+
+struct QPdfPageNavigatorPrivate
+{
+ QPdfPageNavigator *q = nullptr;
+
+ QList<QExplicitlySharedDataPointer<QPdfLinkPrivate>> pageHistory;
+ int currentHistoryIndex = 0;
+ bool changing = false;
+};
+
+/*!
+ \class QPdfPageNavigator
+ \since 6.4
+ \inmodule QtPdf
+ \brief Navigation history within a PDF document.
+
+ The QPdfPageNavigator class remembers which destinations the user
+ has visited in a PDF document, and provides the ability to traverse
+ backward and forward. It is used to implement back and forward actions
+ similar to the back and forward buttons in a web browser.
+
+ \sa QPdfDocument
+*/
+
+/*!
+ Constructs a page navigation stack with parent object \a parent.
+*/
+QPdfPageNavigator::QPdfPageNavigator(QObject *parent)
+ : QObject(parent), d(new QPdfPageNavigatorPrivate)
+{
+ d->q = this;
+ clear();
+}
+
+/*!
+ Destroys the page navigation stack.
+*/
+QPdfPageNavigator::~QPdfPageNavigator()
+{
+}
+
+/*!
+ Goes back to the page, location and zoom level that was being viewed before
+ back() was called, and then emits the \l jumped() signal.
+
+ If a new destination was pushed since the last time \l back() was called,
+ the forward() function does nothing, because there is a branch in the
+ timeline which causes the "future" to be lost.
+*/
+void QPdfPageNavigator::forward()
+{
+ if (d->currentHistoryIndex >= d->pageHistory.size() - 1)
+ return;
+ const bool backAvailableWas = backAvailable();
+ const bool forwardAvailableWas = forwardAvailable();
+ QPointF currentLocationWas = currentLocation();
+ qreal currentZoomWas = currentZoom();
+ ++d->currentHistoryIndex;
+ d->changing = true;
+ emit jumped(currentLink());
+ if (currentZoomWas != currentZoom())
+ emit currentZoomChanged(currentZoom());
+ emit currentPageChanged(currentPage());
+ if (currentLocationWas != currentLocation())
+ emit currentLocationChanged(currentLocation());
+ if (!backAvailableWas)
+ emit backAvailableChanged(backAvailable());
+ if (forwardAvailableWas != forwardAvailable())
+ emit forwardAvailableChanged(forwardAvailable());
+ d->changing = false;
+ qCDebug(qLcNav) << "forward: index" << d->currentHistoryIndex << "page" << currentPage()
+ << "@" << currentLocation() << "zoom" << currentZoom();
+}
+
+/*!
+ Pops the stack, updates the \l currentPage, \l currentLocation and
+ \l currentZoom properties to the most-recently-viewed destination, and then
+ emits the \l jumped() signal.
+*/
+void QPdfPageNavigator::back()
+{
+ if (d->currentHistoryIndex <= 0)
+ return;
+ const bool backAvailableWas = backAvailable();
+ const bool forwardAvailableWas = forwardAvailable();
+ QPointF currentLocationWas = currentLocation();
+ qreal currentZoomWas = currentZoom();
+ --d->currentHistoryIndex;
+ d->changing = true;
+ emit jumped(currentLink());
+ if (currentZoomWas != currentZoom())
+ emit currentZoomChanged(currentZoom());
+ emit currentPageChanged(currentPage());
+ if (currentLocationWas != currentLocation())
+ emit currentLocationChanged(currentLocation());
+ if (backAvailableWas != backAvailable())
+ emit backAvailableChanged(backAvailable());
+ if (!forwardAvailableWas)
+ emit forwardAvailableChanged(forwardAvailable());
+ d->changing = false;
+ qCDebug(qLcNav) << "back: index" << d->currentHistoryIndex << "page" << currentPage()
+ << "@" << currentLocation() << "zoom" << currentZoom();
+}
+/*!
+ \property QPdfPageNavigator::currentPage
+
+ This property holds the current page that is being viewed.
+ The default is \c 0.
+*/
+int QPdfPageNavigator::currentPage() const
+{
+ if (d->currentHistoryIndex < 0 || d->currentHistoryIndex >= d->pageHistory.size())
+ return -1; // only until ctor or clear() runs
+ return d->pageHistory.at(d->currentHistoryIndex)->page;
+}
+
+/*!
+ \property QPdfPageNavigator::currentLocation
+
+ This property holds the current location on the page that is being viewed
+ (the location that was last given to jump() or update()). The default is
+ \c {0, 0}.
+*/
+QPointF QPdfPageNavigator::currentLocation() const
+{
+ if (d->currentHistoryIndex < 0 || d->currentHistoryIndex >= d->pageHistory.size())
+ return QPointF();
+ return d->pageHistory.at(d->currentHistoryIndex)->location;
+}
+
+/*!
+ \property QPdfPageNavigator::currentZoom
+
+ This property holds the magnification scale (1 logical pixel = 1 point)
+ on the page that is being viewed. The default is \c 1.
+*/
+qreal QPdfPageNavigator::currentZoom() const
+{
+ if (d->currentHistoryIndex < 0 || d->currentHistoryIndex >= d->pageHistory.size())
+ return 1;
+ return d->pageHistory.at(d->currentHistoryIndex)->zoom;
+}
+
+QPdfLink QPdfPageNavigator::currentLink() const
+{
+ if (d->currentHistoryIndex < 0 || d->currentHistoryIndex >= d->pageHistory.size())
+ return QPdfLink();
+ return QPdfLink(d->pageHistory.at(d->currentHistoryIndex).data());
+}
+
+/*!
+ Clear the history and restore \l currentPage, \l currentLocation and
+ \l currentZoom to their default values.
+*/
+void QPdfPageNavigator::clear()
+{
+ d->pageHistory.clear();
+ d->currentHistoryIndex = 0;
+ // Begin with an implicit jump to page 0, so that
+ // backAvailable() will become true after jump() is called one more time.
+ d->pageHistory.append(QExplicitlySharedDataPointer<QPdfLinkPrivate>(new QPdfLinkPrivate(0, {}, 1)));
+}
+
+/*!
+ Adds the given \a destination to the history of visited locations.
+
+ In this case, PDF views respond to the \l jumped signal by scrolling to
+ place \c destination.rectangles in the viewport, as opposed to placing
+ \c destination.location in the viewport. So it's appropriate to call this
+ method to jump to a search result from QPdfSearchModel (because the
+ rectangles cover the region of text found). To jump to a hyperlink
+ destination, call jump(page, location, zoom) instead, because in that
+ case the QPdfLink object's \c rectangles cover the hyperlink origin
+ location rather than the destination.
+*/
+void QPdfPageNavigator::jump(QPdfLink destination)
+{
+ const bool zoomChange = !qFuzzyCompare(destination.zoom(), currentZoom());
+ const bool pageChange = (destination.page() != currentPage());
+ const bool locationChange = (destination.location() != currentLocation());
+ const bool backAvailableWas = backAvailable();
+ const bool forwardAvailableWas = forwardAvailable();
+ if (!d->changing) {
+ if (d->currentHistoryIndex >= 0 && forwardAvailableWas)
+ d->pageHistory.remove(d->currentHistoryIndex + 1, d->pageHistory.size() - d->currentHistoryIndex - 1);
+ d->pageHistory.append(destination.d);
+ d->currentHistoryIndex = d->pageHistory.size() - 1;
+ }
+ if (zoomChange)
+ emit currentZoomChanged(currentZoom());
+ if (pageChange)
+ emit currentPageChanged(currentPage());
+ if (locationChange)
+ emit currentLocationChanged(currentLocation());
+ if (d->changing)
+ return;
+ if (backAvailableWas != backAvailable())
+ emit backAvailableChanged(backAvailable());
+ if (forwardAvailableWas != forwardAvailable())
+ emit forwardAvailableChanged(forwardAvailable());
+ emit jumped(currentLink());
+ qCDebug(qLcNav) << "push: index" << d->currentHistoryIndex << destination << "-> history" <<
+ [this]() {
+ QStringList ret;
+ for (auto d : d->pageHistory)
+ ret << QString::number(d->page);
+ return ret.join(QLatin1Char(','));
+ }();
+}
+
+/*!
+ Adds the given destination, consisting of \a page, \a location, and \a zoom,
+ to the history of visited locations.
+
+ The \a zoom argument represents magnification (where \c 1 is the default
+ scale, 1 logical pixel = 1 point). If \a zoom is not given or is \c 0,
+ currentZoom keeps its existing value, and currentZoomChanged is not emitted.
+
+ The \a location should be the same as QPdfLink::location() if the user is
+ following a link; and since that is specified as the upper-left corner of
+ the destination, it is best for consistency to always use the location
+ visible in the upper-left corner of the viewport, in points.
+
+ If forwardAvailable is \c true, calling this function represents a branch
+ in the timeline which causes the "future" to be lost, and therefore
+ forwardAvailable will change to \c false.
+*/
+void QPdfPageNavigator::jump(int page, const QPointF &location, qreal zoom)
+{
+ if (page == currentPage() && location == currentLocation() && zoom == currentZoom())
+ return;
+ if (qFuzzyIsNull(zoom))
+ zoom = currentZoom();
+ const bool zoomChange = !qFuzzyCompare(zoom, currentZoom());
+ const bool pageChange = (page != currentPage());
+ const bool locationChange = (location != currentLocation());
+ const bool backAvailableWas = backAvailable();
+ const bool forwardAvailableWas = forwardAvailable();
+ if (!d->changing) {
+ if (d->currentHistoryIndex >= 0 && forwardAvailableWas)
+ d->pageHistory.remove(d->currentHistoryIndex + 1, d->pageHistory.size() - d->currentHistoryIndex - 1);
+ d->pageHistory.append(QExplicitlySharedDataPointer<QPdfLinkPrivate>(new QPdfLinkPrivate(page, location, zoom)));
+ d->currentHistoryIndex = d->pageHistory.size() - 1;
+ }
+ if (zoomChange)
+ emit currentZoomChanged(currentZoom());
+ if (pageChange)
+ emit currentPageChanged(currentPage());
+ if (locationChange)
+ emit currentLocationChanged(currentLocation());
+ if (d->changing)
+ return;
+ if (backAvailableWas != backAvailable())
+ emit backAvailableChanged(backAvailable());
+ if (forwardAvailableWas != forwardAvailable())
+ emit forwardAvailableChanged(forwardAvailable());
+ emit jumped(currentLink());
+ qCDebug(qLcNav) << "push: index" << d->currentHistoryIndex << "page" << page
+ << "@" << location << "zoom" << zoom << "-> history" <<
+ [this]() {
+ QStringList ret;
+ for (auto d : d->pageHistory)
+ ret << QString::number(d->page);
+ return ret.join(QLatin1Char(','));
+ }();
+}
+
+/*!
+ Modifies the current destination, consisting of \a page, \a location and \a zoom.
+
+ This can be called periodically while the user is manually moving around
+ the document, so that after back() is called, forward() will jump back to
+ the most-recently-viewed destination rather than the destination that was
+ last specified by push().
+
+ The \c currentZoomChanged, \c currentPageChanged and \c currentLocationChanged
+ signals will be emitted if the respective properties are actually changed.
+ The \l jumped signal is not emitted, because this operation represents
+ smooth movement rather than a navigational jump.
+*/
+void QPdfPageNavigator::update(int page, const QPointF &location, qreal zoom)
+{
+ if (d->currentHistoryIndex < 0 || d->currentHistoryIndex >= d->pageHistory.size())
+ return;
+ int currentPageWas = currentPage();
+ QPointF currentLocationWas = currentLocation();
+ qreal currentZoomWas = currentZoom();
+ if (page == currentPageWas && location == currentLocationWas && zoom == currentZoomWas)
+ return;
+ d->pageHistory[d->currentHistoryIndex]->page = page;
+ d->pageHistory[d->currentHistoryIndex]->location = location;
+ d->pageHistory[d->currentHistoryIndex]->zoom = zoom;
+ if (currentZoomWas != zoom)
+ emit currentZoomChanged(currentZoom());
+ if (currentPageWas != page)
+ emit currentPageChanged(currentPage());
+ if (currentLocationWas != location)
+ emit currentLocationChanged(currentLocation());
+ qCDebug(qLcNav) << "update: index" << d->currentHistoryIndex << "page" << page
+ << "@" << location << "zoom" << zoom << "-> history" <<
+ [this]() {
+ QStringList ret;
+ for (auto d : d->pageHistory)
+ ret << QString::number(d->page);
+ return ret.join(QLatin1Char(','));
+ }();
+}
+
+/*!
+ \property QPdfPageNavigator::backAvailable
+ \readonly
+
+ Holds \c true if a \e back destination is available in the history:
+ that is, if push() or forward() has been called.
+*/
+bool QPdfPageNavigator::backAvailable() const
+{
+ return d->currentHistoryIndex > 0;
+}
+
+/*!
+ \property QPdfPageNavigator::forwardAvailable
+ \readonly
+
+ Holds \c true if a \e forward destination is available in the history:
+ that is, if back() has been previously called.
+*/
+bool QPdfPageNavigator::forwardAvailable() const
+{
+ return d->currentHistoryIndex < d->pageHistory.size() - 1;
+}
+
+/*!
+ \fn void QPdfPageNavigator::jumped(QPdfLink current)
+
+ This signal is emitted when an abrupt jump occurs, to the \a current
+ page index, location on the page, and zoom level; but \e not when simply
+ scrolling through the document one page at a time. That is, jump(),
+ forward() and back() emit this signal, but update() does not.
+
+ If \c {current.rectangles.length > 0}, they are rectangles that cover
+ a specific destination area: a search result that should be made
+ visible; otherwise, \c {current.location} is the destination location on
+ the \c page (a hyperlink destination, or during forward/back navigation).
+*/
+
+QT_END_NAMESPACE
+
+#include "moc_qpdfpagenavigator.cpp"
diff --git a/src/pdf/qpdfpagenavigator.h b/src/pdf/qpdfpagenavigator.h
new file mode 100644
index 000000000..cec89ef5a
--- /dev/null
+++ b/src/pdf/qpdfpagenavigator.h
@@ -0,0 +1,62 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QPDFPAGENAVIGATOR_H
+#define QPDFPAGENAVIGATOR_H
+
+#include <QtPdf/qtpdfglobal.h>
+#include <QtPdf/qpdflink.h>
+#include <QtCore/qobject.h>
+
+QT_BEGIN_NAMESPACE
+
+struct QPdfPageNavigatorPrivate;
+
+class Q_PDF_EXPORT QPdfPageNavigator : public QObject
+{
+ Q_OBJECT
+
+ Q_PROPERTY(int currentPage READ currentPage NOTIFY currentPageChanged)
+ Q_PROPERTY(QPointF currentLocation READ currentLocation NOTIFY currentLocationChanged)
+ Q_PROPERTY(qreal currentZoom READ currentZoom NOTIFY currentZoomChanged)
+ Q_PROPERTY(bool backAvailable READ backAvailable NOTIFY backAvailableChanged)
+ Q_PROPERTY(bool forwardAvailable READ forwardAvailable NOTIFY forwardAvailableChanged)
+
+public:
+ QPdfPageNavigator() : QPdfPageNavigator(nullptr) {}
+ explicit QPdfPageNavigator(QObject *parent);
+ ~QPdfPageNavigator() override;
+
+ int currentPage() const;
+ QPointF currentLocation() const;
+ qreal currentZoom() const;
+
+ bool backAvailable() const;
+ bool forwardAvailable() const;
+
+public Q_SLOTS:
+ void clear();
+ void jump(QPdfLink destination);
+ void jump(int page, const QPointF &location, qreal zoom = 0);
+ void update(int page, const QPointF &location, qreal zoom);
+ void forward();
+ void back();
+
+Q_SIGNALS:
+ void currentPageChanged(int page);
+ void currentLocationChanged(QPointF location);
+ void currentZoomChanged(qreal zoom);
+ void backAvailableChanged(bool available);
+ void forwardAvailableChanged(bool available);
+ void jumped(QPdfLink current);
+
+protected:
+ QPdfLink currentLink() const;
+
+private:
+ QScopedPointer<QPdfPageNavigatorPrivate> d;
+};
+
+QT_END_NAMESPACE
+
+#endif // QPDFPAGENAVIGATOR_H
diff --git a/src/pdf/qpdfpagerenderer.cpp b/src/pdf/qpdfpagerenderer.cpp
index 31d9f4e1e..771fc67ef 100644
--- a/src/pdf/qpdfpagerenderer.cpp
+++ b/src/pdf/qpdfpagerenderer.cpp
@@ -1,44 +1,10 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias König <tobias.koenig@kdab.com>
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias König <tobias.koenig@kdab.com>
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qpdfpagerenderer.h"
#include <private/qobject_p.h>
#include <QMutex>
-#include <QPdfDocument>
#include <QPointer>
#include <QThread>
@@ -67,10 +33,8 @@ private:
QMutex m_mutex;
};
-class QPdfPageRendererPrivate : public QObjectPrivate
+class QPdfPageRendererPrivate
{
- Q_DECLARE_PUBLIC(QPdfPageRenderer)
-
public:
QPdfPageRendererPrivate();
~QPdfPageRendererPrivate();
@@ -90,8 +54,8 @@ public:
QPdfDocumentRenderOptions options;
};
- QVector<PageRequest> m_requests;
- QVector<PageRequest> m_pendingRequests;
+ QList<PageRequest> m_requests;
+ QList<PageRequest> m_pendingRequests;
quint64 m_requestIdCounter = 1;
QThread *m_renderThread = nullptr;
@@ -125,7 +89,7 @@ void RenderWorker::requestPage(quint64 requestId, int pageNumber, QSize imageSiz
{
const QMutexLocker locker(&m_mutex);
- if (!m_document || m_document->status() != QPdfDocument::Ready)
+ if (!m_document || m_document->status() != QPdfDocument::Status::Ready)
return;
const QImage image = m_document->render(pageNumber, imageSize, options);
@@ -133,12 +97,7 @@ void RenderWorker::requestPage(quint64 requestId, int pageNumber, QSize imageSiz
emit pageRendered(pageNumber, imageSize, image, options, requestId);
}
-
-QPdfPageRendererPrivate::QPdfPageRendererPrivate()
- : QObjectPrivate()
- , m_renderWorker(new RenderWorker)
-{
-}
+QPdfPageRendererPrivate::QPdfPageRendererPrivate() : m_renderWorker(new RenderWorker) { }
QPdfPageRendererPrivate::~QPdfPageRendererPrivate()
{
@@ -194,18 +153,17 @@ void QPdfPageRendererPrivate::requestFinished(int page, QSize imageSize, const Q
Constructs a page renderer object with parent object \a parent.
*/
QPdfPageRenderer::QPdfPageRenderer(QObject *parent)
- : QObject(*new QPdfPageRendererPrivate(), parent)
+ : QObject(parent), d_ptr(new QPdfPageRendererPrivate)
{
- Q_D(QPdfPageRenderer);
-
qRegisterMetaType<QPdfDocumentRenderOptions>();
- connect(d->m_renderWorker.data(), &RenderWorker::pageRendered, this,
- [this,d](int page, QSize imageSize, const QImage &image, QPdfDocumentRenderOptions options, quint64 requestId) {
- d->requestFinished(page, imageSize, image, options, requestId);
+ connect(d_ptr->m_renderWorker.data(), &RenderWorker::pageRendered, this,
+ [this](int page, QSize imageSize, const QImage &image,
+ QPdfDocumentRenderOptions options, quint64 requestId) {
+ d_ptr->requestFinished(page, imageSize, image, options, requestId);
emit pageRendered(page, imageSize, image, options, requestId);
- d->handleNextRequest();
- });
+ d_ptr->handleNextRequest();
+ });
}
/*!
@@ -242,9 +200,7 @@ QPdfPageRenderer::~QPdfPageRenderer()
*/
QPdfPageRenderer::RenderMode QPdfPageRenderer::renderMode() const
{
- Q_D(const QPdfPageRenderer);
-
- return d->m_renderMode;
+ return d_ptr->m_renderMode;
}
/*!
@@ -254,26 +210,24 @@ QPdfPageRenderer::RenderMode QPdfPageRenderer::renderMode() const
*/
void QPdfPageRenderer::setRenderMode(RenderMode mode)
{
- Q_D(QPdfPageRenderer);
-
- if (d->m_renderMode == mode)
+ if (d_ptr->m_renderMode == mode)
return;
- d->m_renderMode = mode;
- emit renderModeChanged(d->m_renderMode);
+ d_ptr->m_renderMode = mode;
+ emit renderModeChanged(d_ptr->m_renderMode);
- if (d->m_renderMode == RenderMode::MultiThreaded) {
- d->m_renderThread = new QThread;
- d->m_renderWorker->moveToThread(d->m_renderThread);
- d->m_renderThread->start();
+ if (d_ptr->m_renderMode == RenderMode::MultiThreaded) {
+ d_ptr->m_renderThread = new QThread;
+ d_ptr->m_renderWorker->moveToThread(d_ptr->m_renderThread);
+ d_ptr->m_renderThread->start();
} else {
- d->m_renderThread->quit();
- d->m_renderThread->wait();
- delete d->m_renderThread;
- d->m_renderThread = nullptr;
+ d_ptr->m_renderThread->quit();
+ d_ptr->m_renderThread->wait();
+ delete d_ptr->m_renderThread;
+ d_ptr->m_renderThread = nullptr;
// pulling the object from another thread should be fine, once that thread is deleted
- d->m_renderWorker->moveToThread(this->thread());
+ d_ptr->m_renderWorker->moveToThread(this->thread());
}
}
@@ -294,9 +248,7 @@ void QPdfPageRenderer::setRenderMode(RenderMode mode)
*/
QPdfDocument* QPdfPageRenderer::document() const
{
- Q_D(const QPdfPageRenderer);
-
- return d->m_document;
+ return d_ptr->m_document;
}
/*!
@@ -306,15 +258,13 @@ QPdfDocument* QPdfPageRenderer::document() const
*/
void QPdfPageRenderer::setDocument(QPdfDocument *document)
{
- Q_D(QPdfPageRenderer);
-
- if (d->m_document == document)
+ if (d_ptr->m_document == document)
return;
- d->m_document = document;
- emit documentChanged(d->m_document);
+ d_ptr->m_document = document;
+ emit documentChanged(d_ptr->m_document);
- d->m_renderWorker->setDocument(d->m_document);
+ d_ptr->m_renderWorker->setDocument(d_ptr->m_document);
}
/*!
@@ -329,19 +279,17 @@ void QPdfPageRenderer::setDocument(QPdfDocument *document)
quint64 QPdfPageRenderer::requestPage(int pageNumber, QSize imageSize,
QPdfDocumentRenderOptions options)
{
- Q_D(QPdfPageRenderer);
-
- if (!d->m_document || d->m_document->status() != QPdfDocument::Ready)
+ if (!d_ptr->m_document || d_ptr->m_document->status() != QPdfDocument::Status::Ready)
return 0;
- for (const auto &request : qAsConst(d->m_pendingRequests)) {
+ for (const auto &request : std::as_const(d_ptr->m_pendingRequests)) {
if (request.pageNumber == pageNumber
&& request.imageSize == imageSize
&& request.options == options)
return request.id;
}
- const auto id = d->m_requestIdCounter++;
+ const auto id = d_ptr->m_requestIdCounter++;
QPdfPageRendererPrivate::PageRequest request;
request.id = id;
@@ -349,9 +297,9 @@ quint64 QPdfPageRenderer::requestPage(int pageNumber, QSize imageSize,
request.imageSize = imageSize;
request.options = options;
- d->m_requests.append(request);
+ d_ptr->m_requests.append(request);
- d->handleNextRequest();
+ d_ptr->handleNextRequest();
return id;
}
@@ -359,3 +307,4 @@ quint64 QPdfPageRenderer::requestPage(int pageNumber, QSize imageSize,
QT_END_NAMESPACE
#include "qpdfpagerenderer.moc"
+#include "moc_qpdfpagerenderer.cpp"
diff --git a/src/pdf/qpdfpagerenderer.h b/src/pdf/qpdfpagerenderer.h
new file mode 100644
index 000000000..cb9be06fe
--- /dev/null
+++ b/src/pdf/qpdfpagerenderer.h
@@ -0,0 +1,60 @@
+// Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias König <tobias.koenig@kdab.com>
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QPDFPAGERENDERER_H
+#define QPDFPAGERENDERER_H
+
+#include <QtPdf/qtpdfglobal.h>
+
+#include <QtCore/qobject.h>
+#include <QtCore/qsize.h>
+#include <QtPdf/qpdfdocument.h>
+#include <QtPdf/qpdfdocumentrenderoptions.h>
+
+QT_BEGIN_NAMESPACE
+
+class QPdfPageRendererPrivate;
+
+class Q_PDF_EXPORT QPdfPageRenderer : public QObject
+{
+ Q_OBJECT
+
+ Q_PROPERTY(QPdfDocument* document READ document WRITE setDocument NOTIFY documentChanged)
+ Q_PROPERTY(RenderMode renderMode READ renderMode WRITE setRenderMode NOTIFY renderModeChanged)
+
+public:
+ enum class RenderMode
+ {
+ MultiThreaded,
+ SingleThreaded
+ };
+ Q_ENUM(RenderMode)
+
+ QPdfPageRenderer() : QPdfPageRenderer(nullptr) {}
+ explicit QPdfPageRenderer(QObject *parent);
+ ~QPdfPageRenderer() override;
+
+ RenderMode renderMode() const;
+ void setRenderMode(RenderMode mode);
+
+ QPdfDocument* document() const;
+ void setDocument(QPdfDocument *document);
+
+ quint64 requestPage(int pageNumber, QSize imageSize,
+ QPdfDocumentRenderOptions options = QPdfDocumentRenderOptions());
+
+Q_SIGNALS:
+ void documentChanged(QPdfDocument *document);
+ void renderModeChanged(QPdfPageRenderer::RenderMode renderMode);
+
+ void pageRendered(int pageNumber, QSize imageSize, const QImage &image,
+ QPdfDocumentRenderOptions options, quint64 requestId);
+
+private:
+ QScopedPointer<QPdfPageRendererPrivate> d_ptr;
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/pdf/qpdfsearchmodel.cpp b/src/pdf/qpdfsearchmodel.cpp
index 27b7833fc..a81ae77dc 100644
--- a/src/pdf/qpdfsearchmodel.cpp
+++ b/src/pdf/qpdfsearchmodel.cpp
@@ -1,47 +1,13 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qpdfdestination.h"
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
#include "qpdfdocument_p.h"
+#include "qpdflink.h"
#include "qpdfsearchmodel.h"
#include "qpdfsearchmodel_p.h"
-#include "qpdfsearchresult_p.h"
-#include "third_party/pdfium/public/fpdf_doc.h"
#include "third_party/pdfium/public/fpdf_text.h"
+#include "third_party/pdfium/public/fpdfview.h"
#include <QtCore/qelapsedtimer.h>
#include <QtCore/qloggingcategory.h>
@@ -53,35 +19,85 @@ Q_LOGGING_CATEGORY(qLcS, "qt.pdf.search")
static const int UpdateTimerInterval = 100;
static const int ContextChars = 64;
-static const double CharacterHitTolerance = 6.0;
+/*!
+ \class QPdfSearchModel
+ \since 5.15
+ \inmodule QtPdf
+ \inherits QAbstractListModel
+
+ \brief The QPdfSearchModel class searches for a string in a PDF document
+ and holds the results.
+
+ This is used in the \l {Model/View Programming} paradigm to display
+ a list of search results, to highlight them on the rendered PDF pages,
+ and to iterate through them using the "search forward" / "search backward"
+ buttons and shortcuts that would be found in a typical document-viewing UI:
+
+ \image search-results.png
+*/
+
+/*!
+ \enum QPdfSearchModel::Role
+
+ \value Page The page number where the search result is found (int).
+ \value IndexOnPage The index of the search result on the page (int).
+ \value Location The position of the search result on the page (QPointF).
+ \value ContextBefore The adjacent text on the page, before the search string (QString).
+ \value ContextAfter The adjacent text on the page, after the search string (QString).
+ \omitvalue NRoles
+
+ \sa QPdfLink
+*/
+
+/*!
+ Constructs a new search model with parent object \a parent.
+*/
QPdfSearchModel::QPdfSearchModel(QObject *parent)
: QAbstractListModel(*(new QPdfSearchModelPrivate()), parent)
{
QMetaEnum rolesMetaEnum = metaObject()->enumerator(metaObject()->indexOfEnumerator("Role"));
- for (int r = Qt::UserRole; r < int(Role::_Count); ++r) {
+ for (int r = Qt::UserRole; r < int(Role::NRoles); ++r) {
QByteArray roleName = QByteArray(rolesMetaEnum.valueToKey(r));
if (roleName.isEmpty())
continue;
roleName[0] = QChar::toLower(roleName[0]);
m_roleNames.insert(r, roleName);
}
+ connect(this, &QAbstractListModel::dataChanged, this, &QPdfSearchModel::countChanged);
+ connect(this, &QAbstractListModel::modelReset, this, &QPdfSearchModel::countChanged);
+ connect(this, &QAbstractListModel::rowsRemoved, this, &QPdfSearchModel::countChanged);
+ connect(this, &QAbstractListModel::rowsInserted, this, &QPdfSearchModel::countChanged);
}
+/*!
+ Destroys the model.
+*/
QPdfSearchModel::~QPdfSearchModel() {}
+/*!
+ \reimp
+*/
QHash<int, QByteArray> QPdfSearchModel::roleNames() const
{
return m_roleNames;
}
+/*!
+ \reimp
+
+ The number of rows in the model is equal to the number of search results found.
+*/
int QPdfSearchModel::rowCount(const QModelIndex &parent) const
{
Q_D(const QPdfSearchModel);
- Q_UNUSED(parent)
+ Q_UNUSED(parent);
return d->rowCountSoFar;
}
+/*!
+ \reimp
+*/
QVariant QPdfSearchModel::data(const QModelIndex &index, int role) const
{
Q_D(const QPdfSearchModel);
@@ -99,7 +115,7 @@ QVariant QPdfSearchModel::data(const QModelIndex &index, int role) const
return d->searchResults[pi.page][pi.index].contextBefore();
case Role::ContextAfter:
return d->searchResults[pi.page][pi.index].contextAfter();
- case Role::_Count:
+ case Role::NRoles:
break;
}
if (role == Qt::DisplayRole) {
@@ -111,19 +127,33 @@ QVariant QPdfSearchModel::data(const QModelIndex &index, int role) const
return QVariant();
}
+/*!
+ \since 6.8
+ \property QPdfSearchModel::count
+ \brief the number of search results found
+*/
+int QPdfSearchModel::count() const
+{
+ return rowCount(QModelIndex());
+}
+
void QPdfSearchModel::updatePage(int page)
{
Q_D(QPdfSearchModel);
d->doSearch(page);
}
+/*!
+ \property QPdfSearchModel::searchString
+ \brief the string to search for
+*/
QString QPdfSearchModel::searchString() const
{
Q_D(const QPdfSearchModel);
return d->searchString;
}
-void QPdfSearchModel::setSearchString(QString searchString)
+void QPdfSearchModel::setSearchString(const QString &searchString)
{
Q_D(QPdfSearchModel);
if (d->searchString == searchString)
@@ -136,24 +166,35 @@ void QPdfSearchModel::setSearchString(QString searchString)
endResetModel();
}
-QVector<QPdfSearchResult> QPdfSearchModel::resultsOnPage(int page) const
+/*!
+ Returns the list of all results found on the given \a page.
+*/
+QList<QPdfLink> QPdfSearchModel::resultsOnPage(int page) const
{
Q_D(const QPdfSearchModel);
const_cast<QPdfSearchModelPrivate *>(d)->doSearch(page);
- if (d->searchResults.count() <= page)
+ if (d->searchResults.size() <= page)
return {};
return d->searchResults[page];
}
-QPdfSearchResult QPdfSearchModel::resultAtIndex(int index) const
+/*!
+ Returns a result found by \a index in the \l document, regardless of the
+ page on which it was found. \a index must be less than \l rowCount.
+*/
+QPdfLink QPdfSearchModel::resultAtIndex(int index) const
{
Q_D(const QPdfSearchModel);
const auto pi = const_cast<QPdfSearchModelPrivate*>(d)->pageAndIndexForResult(index);
- if (pi.page < 0)
- return QPdfSearchResult();
+ if (pi.page < 0 || index < 0)
+ return {};
return d->searchResults[pi.page][pi.index];
}
+/*!
+ \property QPdfSearchModel::document
+ \brief the document to search
+*/
QPdfDocument *QPdfSearchModel::document() const
{
Q_D(const QPdfSearchModel);
@@ -166,6 +207,10 @@ void QPdfSearchModel::setDocument(QPdfDocument *document)
if (d->document == document)
return;
+ disconnect(d->documentConnection);
+ d->documentConnection = connect(document, &QPdfDocument::pageCountChanged, this,
+ [this]() { d_func()->clearResults(); });
+
d->document = document;
d->clearResults();
emit documentChanged();
@@ -178,7 +223,7 @@ void QPdfSearchModel::timerEvent(QTimerEvent *event)
return;
if (!d->document || d->nextPageToUpdate >= d->document->pageCount()) {
if (d->document)
- qCDebug(qLcS, "done updating search results on %d pages", d->searchResults.count());
+ qCDebug(qLcS) << "done updating search results on" << d->searchResults.size() << "pages";
killTimer(d->updateTimerId);
d->updateTimerId = -1;
}
@@ -198,9 +243,6 @@ void QPdfSearchModelPrivate::clearResults()
if (document) {
searchResults.resize(document->pageCount());
pagesSearched.resize(document->pageCount());
- } else {
- searchResults.resize(0);
- pagesSearched.resize(0);
}
nextPageToUpdate = 0;
updateTimerId = q->startTimer(UpdateTimerInterval);
@@ -208,7 +250,7 @@ void QPdfSearchModelPrivate::clearResults()
bool QPdfSearchModelPrivate::doSearch(int page)
{
- if (page < 0 || page >= pagesSearched.count() || searchString.isEmpty())
+ if (page < 0 || page >= pagesSearched.size() || searchString.isEmpty())
return false;
if (pagesSearched[page])
return true;
@@ -222,7 +264,6 @@ bool QPdfSearchModelPrivate::doSearch(int page)
qWarning() << "failed to load page" << page;
return false;
}
- double pageHeight = FPDF_GetPageHeight(pdfPage);
FPDF_TEXTPAGE textPage = FPDFText_LoadPage(pdfPage);
if (!textPage) {
qWarning() << "failed to load text of page" << page;
@@ -230,18 +271,22 @@ bool QPdfSearchModelPrivate::doSearch(int page)
return false;
}
FPDF_SCHHANDLE sh = FPDFText_FindStart(textPage, searchString.utf16(), 0, 0);
- QVector<QPdfSearchResult> newSearchResults;
+ QList<QPdfLink> newSearchResults;
+ constexpr double CharacterHitTolerance = 6.0;
while (FPDFText_FindNext(sh)) {
int idx = FPDFText_GetSchResultIndex(sh);
int count = FPDFText_GetSchCount(sh);
int rectCount = FPDFText_CountRects(textPage, idx, count);
- QVector<QRectF> rects;
+ QList<QRectF> rects;
int startIndex = -1;
int endIndex = -1;
for (int r = 0; r < rectCount; ++r) {
+ // get bounding box of search result in page coordinates
double left, top, right, bottom;
FPDFText_GetRect(textPage, r, &left, &top, &right, &bottom);
- rects << QRectF(left, pageHeight - top, right - left, top - bottom);
+ // deal with any internal PDF transforms and
+ // convert to the 1x (pixels = points) 4th-quadrant coordinate system
+ rects << document->d->mapPageToView(pdfPage, left, top, right, bottom);
if (r == 0) {
startIndex = FPDFText_GetCharIndexAtPos(textPage, left, top,
CharacterHitTolerance, CharacterHitTolerance);
@@ -250,7 +295,8 @@ bool QPdfSearchModelPrivate::doSearch(int page)
endIndex = FPDFText_GetCharIndexAtPos(textPage, right, top,
CharacterHitTolerance, CharacterHitTolerance);
}
- qCDebug(qLcS) << rects.last() << "char idx" << startIndex << "->" << endIndex;
+ qCDebug(qLcS) << rects.last() << "char idx" << startIndex << "->" << endIndex
+ << "from page rect" << left << top << right << bottom;
}
QString contextBefore, contextAfter;
if (startIndex >= 0 || endIndex >= 0) {
@@ -258,10 +304,11 @@ bool QPdfSearchModelPrivate::doSearch(int page)
endIndex += ContextChars;
int count = endIndex - startIndex + 1;
if (count > 0) {
- QVector<ushort> buf(count + 1);
+ QList<ushort> buf(count + 1);
int len = FPDFText_GetText(textPage, startIndex, count, buf.data());
Q_ASSERT(len - 1 <= count); // len is number of characters written, including the terminator
- QString context = QString::fromUtf16(buf.constData(), len - 1);
+ QString context = QString::fromUtf16(
+ reinterpret_cast<const char16_t *>(buf.constData()), len - 1);
context = context.replace(QLatin1Char('\n'), QStringLiteral("\u23CE"));
context = context.remove(QLatin1Char('\r'));
// try to find the search string near the middle of the context if possible
@@ -271,25 +318,25 @@ bool QPdfSearchModelPrivate::doSearch(int page)
if (si < 0)
qWarning() << "search string" << searchString << "not found in context" << context;
contextBefore = context.mid(0, si);
- contextAfter = context.mid(si + searchString.length());
+ contextAfter = context.mid(si + searchString.size());
}
}
if (!rects.isEmpty())
- newSearchResults << QPdfSearchResult(page, rects, contextBefore, contextAfter);
+ newSearchResults << QPdfLink(page, rects, contextBefore, contextAfter);
}
FPDFText_FindClose(sh);
FPDFText_ClosePage(textPage);
FPDF_ClosePage(pdfPage);
qCDebug(qLcS) << searchString << "took" << timer.elapsed() << "ms to find"
- << newSearchResults.count() << "results on page" << page;
+ << newSearchResults.size() << "results on page" << page;
pagesSearched[page] = true;
searchResults[page] = newSearchResults;
- if (newSearchResults.count() > 0) {
+ if (newSearchResults.size() > 0) {
int rowsBefore = rowsBeforePage(page);
- qCDebug(qLcS) << "from row" << rowsBefore << "rowCount" << rowCountSoFar << "increasing by" << newSearchResults.count();
- rowCountSoFar += newSearchResults.count();
- q->beginInsertRows(QModelIndex(), rowsBefore, rowsBefore + newSearchResults.count() - 1);
+ qCDebug(qLcS) << "from row" << rowsBefore << "rowCount" << rowCountSoFar << "increasing by" << newSearchResults.size();
+ rowCountSoFar += newSearchResults.size();
+ q->beginInsertRows(QModelIndex(), rowsBefore, rowsBefore + newSearchResults.size() - 1);
q->endInsertRows();
}
return true;
@@ -297,13 +344,15 @@ bool QPdfSearchModelPrivate::doSearch(int page)
QPdfSearchModelPrivate::PageAndIndex QPdfSearchModelPrivate::pageAndIndexForResult(int resultIndex)
{
+ if (pagesSearched.isEmpty())
+ return {-1, -1};
const int pageCount = document->pageCount();
int totalSoFar = 0;
int previousTotalSoFar = 0;
for (int page = 0; page < pageCount; ++page) {
if (!pagesSearched[page])
doSearch(page);
- totalSoFar += searchResults[page].count();
+ totalSoFar += searchResults[page].size();
if (totalSoFar > resultIndex)
return {page, resultIndex - previousTotalSoFar};
previousTotalSoFar = totalSoFar;
@@ -315,7 +364,7 @@ int QPdfSearchModelPrivate::rowsBeforePage(int page)
{
int ret = 0;
for (int i = 0; i < page; ++i)
- ret += searchResults[i].count();
+ ret += searchResults[i].size();
return ret;
}
diff --git a/src/pdf/qpdfsearchmodel.h b/src/pdf/qpdfsearchmodel.h
new file mode 100644
index 000000000..04f8b9140
--- /dev/null
+++ b/src/pdf/qpdfsearchmodel.h
@@ -0,0 +1,70 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QPDFSEARCHMODEL_H
+#define QPDFSEARCHMODEL_H
+
+#include <QtPdf/qtpdfglobal.h>
+
+#include <QtCore/qabstractitemmodel.h>
+#include <QtPdf/qpdfdocument.h>
+#include <QtPdf/qpdflink.h>
+
+QT_BEGIN_NAMESPACE
+
+class QPdfSearchModelPrivate;
+
+class Q_PDF_EXPORT QPdfSearchModel : public QAbstractListModel
+{
+ Q_OBJECT
+ Q_PROPERTY(QPdfDocument *document READ document WRITE setDocument NOTIFY documentChanged)
+ Q_PROPERTY(QString searchString READ searchString WRITE setSearchString NOTIFY searchStringChanged)
+ Q_PROPERTY(int count READ count NOTIFY countChanged REVISION(6, 8) FINAL)
+
+public:
+ enum class Role : int {
+ Page = Qt::UserRole,
+ IndexOnPage,
+ Location,
+ ContextBefore,
+ ContextAfter,
+ NRoles
+ };
+ Q_ENUM(Role)
+ QPdfSearchModel() : QPdfSearchModel(nullptr) {}
+ explicit QPdfSearchModel(QObject *parent);
+ ~QPdfSearchModel() override;
+
+ QList<QPdfLink> resultsOnPage(int page) const;
+ QPdfLink resultAtIndex(int index) const;
+
+ QPdfDocument *document() const;
+ QString searchString() const;
+
+ QHash<int, QByteArray> roleNames() const override;
+ int rowCount(const QModelIndex &parent) const override;
+ QVariant data(const QModelIndex &index, int role) const override;
+
+ int count() const;
+
+public Q_SLOTS:
+ void setSearchString(const QString &searchString);
+ void setDocument(QPdfDocument *document);
+
+Q_SIGNALS:
+ void documentChanged();
+ void searchStringChanged();
+ Q_REVISION(6, 8) void countChanged();
+
+protected:
+ void updatePage(int page);
+ void timerEvent(QTimerEvent *event) override;
+
+private:
+ QHash<int, QByteArray> m_roleNames;
+ Q_DECLARE_PRIVATE(QPdfSearchModel)
+};
+
+QT_END_NAMESPACE
+
+#endif // QPDFSEARCHMODEL_H
diff --git a/src/pdf/qpdfsearchmodel_p.h b/src/pdf/qpdfsearchmodel_p.h
new file mode 100644
index 000000000..5ffa08f5d
--- /dev/null
+++ b/src/pdf/qpdfsearchmodel_p.h
@@ -0,0 +1,54 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QPDFSEARCHMODEL_P_H
+#define QPDFSEARCHMODEL_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qpdfsearchmodel.h"
+#include <private/qabstractitemmodel_p.h>
+
+#include "third_party/pdfium/public/fpdfview.h"
+
+QT_BEGIN_NAMESPACE
+
+class QPdfSearchModelPrivate : public QAbstractItemModelPrivate
+{
+ Q_DECLARE_PUBLIC(QPdfSearchModel)
+
+public:
+ QPdfSearchModelPrivate();
+ void clearResults();
+ bool doSearch(int page);
+
+ struct PageAndIndex {
+ int page;
+ int index;
+ };
+ PageAndIndex pageAndIndexForResult(int resultIndex);
+ int rowsBeforePage(int page);
+
+ QPdfDocument *document = nullptr;
+ QString searchString;
+ QList<bool> pagesSearched;
+ QList<QList<QPdfLink>> searchResults;
+ int rowCountSoFar = 0;
+ int updateTimerId = -1;
+ int nextPageToUpdate = 0;
+
+ QMetaObject::Connection documentConnection;
+};
+
+QT_END_NAMESPACE
+
+#endif // QPDFSEARCHMODEL_P_H
diff --git a/src/pdf/qpdfsearchresult.cpp b/src/pdf/qpdfsearchresult.cpp
deleted file mode 100644
index 53da1c165..000000000
--- a/src/pdf/qpdfsearchresult.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qpdfsearchresult.h"
-#include "qpdfsearchresult_p.h"
-
-QT_BEGIN_NAMESPACE
-
-QPdfSearchResult::QPdfSearchResult() :
- QPdfSearchResult(new QPdfSearchResultPrivate()) { }
-
-QPdfSearchResult::QPdfSearchResult(int page, QVector<QRectF> rects, QString contextBefore, QString contextAfter) :
- QPdfSearchResult(new QPdfSearchResultPrivate(page, rects, contextBefore, contextAfter)) { }
-
-QPdfSearchResult::QPdfSearchResult(QPdfSearchResultPrivate *d) :
- QPdfDestination(static_cast<QPdfDestinationPrivate *>(d)) { }
-
-QString QPdfSearchResult::contextBefore() const
-{
- return static_cast<QPdfSearchResultPrivate *>(d.data())->contextBefore;
-}
-
-QString QPdfSearchResult::contextAfter() const
-{
- return static_cast<QPdfSearchResultPrivate *>(d.data())->contextAfter;
-}
-
-QVector<QRectF> QPdfSearchResult::rectangles() const
-{
- return static_cast<QPdfSearchResultPrivate *>(d.data())->rects;
-}
-
-QDebug operator<<(QDebug dbg, const QPdfSearchResult &searchResult)
-{
- QDebugStateSaver saver(dbg);
- dbg.nospace();
- dbg << "QPdfSearchResult(page=" << searchResult.page()
- << " contextBefore=" << searchResult.contextBefore()
- << " contextAfter=" << searchResult.contextAfter()
- << " rects=" << searchResult.rectangles();
- dbg << ')';
- return dbg;
-}
-
-QT_END_NAMESPACE
-
-#include "moc_qpdfsearchresult.cpp"
diff --git a/src/pdf/qpdfselection.cpp b/src/pdf/qpdfselection.cpp
index 5f0ee3b20..df30eb353 100644
--- a/src/pdf/qpdfselection.cpp
+++ b/src/pdf/qpdfselection.cpp
@@ -1,38 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qpdfselection.h"
#include "qpdfselection_p.h"
@@ -67,7 +34,7 @@ QPdfSelection::QPdfSelection()
\a text string, and which take up space on the page within the polygon
regions given in \a bounds.
*/
-QPdfSelection::QPdfSelection(const QString &text, QVector<QPolygonF> bounds, QRectF boundingRect, int startIndex, int endIndex)
+QPdfSelection::QPdfSelection(const QString &text, QList<QPolygonF> bounds, QRectF boundingRect, int startIndex, int endIndex)
: d(new QPdfSelectionPrivate(text, bounds, boundingRect, startIndex, endIndex))
{
}
@@ -77,25 +44,10 @@ QPdfSelection::QPdfSelection(QPdfSelectionPrivate *d)
{
}
-QPdfSelection::QPdfSelection(const QPdfSelection &other)
- : d(other.d)
-{
-}
-
-QPdfSelection::QPdfSelection(QPdfSelection &&other) noexcept
- : d(std::move(other.d))
-{
-}
-
-QPdfSelection::~QPdfSelection()
-{
-}
-
-QPdfSelection &QPdfSelection::operator=(const QPdfSelection &other)
-{
- d = other.d;
- return *this;
-}
+QPdfSelection::~QPdfSelection() = default;
+QPdfSelection::QPdfSelection(const QPdfSelection &other) = default;
+QPdfSelection::QPdfSelection(QPdfSelection &&other) noexcept = default;
+QPdfSelection &QPdfSelection::operator=(const QPdfSelection &other) = default;
/*!
\property QPdfSelection::valid
@@ -119,7 +71,7 @@ bool QPdfSelection::isValid() const
are always rectangles; but in the future it may be possible to represent
more complex regions.
*/
-QVector<QPolygonF> QPdfSelection::bounds() const
+QList<QPolygonF> QPdfSelection::bounds() const
{
return d->bounds;
}
@@ -135,7 +87,7 @@ QString QPdfSelection::text() const
}
/*!
- \property rect QPdfSelection::boundingRectangle
+ \property QPdfSelection::boundingRectangle
This property holds the overall bounding rectangle (convex hull) around \l bounds.
*/
@@ -145,7 +97,7 @@ QRectF QPdfSelection::boundingRectangle() const
}
/*!
- \property int QPdfSelection::startIndex
+ \property QPdfSelection::startIndex
This property holds the index at the beginning of \l text within the full text on the page.
*/
@@ -155,7 +107,7 @@ int QPdfSelection::startIndex() const
}
/*!
- \property int QPdfSelection::endIndex
+ \property QPdfSelection::endIndex
This property holds the index at the end of \l text within the full text on the page.
*/
@@ -166,7 +118,8 @@ int QPdfSelection::endIndex() const
#if QT_CONFIG(clipboard)
/*!
- Copies \l text to the \l {QGuiApplication::clipboard()}{system clipboard}.
+ Copies \l text to the \l {QGuiApplication::clipboard()}{system clipboard}
+ depending on the \a mode selected.
*/
void QPdfSelection::copyToClipboard(QClipboard::Mode mode) const
{
diff --git a/src/pdf/qpdfselection.h b/src/pdf/qpdfselection.h
new file mode 100644
index 000000000..8fcfaf2d8
--- /dev/null
+++ b/src/pdf/qpdfselection.h
@@ -0,0 +1,62 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QPDFSELECTION_H
+#define QPDFSELECTION_H
+
+#include <QtPdf/qtpdfglobal.h>
+
+#include <QtCore/qobject.h>
+#include <QtCore/qshareddata.h>
+#include <QtGui/qclipboard.h>
+#include <QtGui/qpolygon.h>
+
+QT_BEGIN_NAMESPACE
+
+class QPdfSelectionPrivate;
+
+class QPdfSelection
+{
+ Q_GADGET_EXPORT(Q_PDF_EXPORT)
+ Q_PROPERTY(bool valid READ isValid)
+ Q_PROPERTY(QList<QPolygonF> bounds READ bounds)
+ Q_PROPERTY(QRectF boundingRectangle READ boundingRectangle)
+ Q_PROPERTY(QString text READ text)
+ Q_PROPERTY(int startIndex READ startIndex)
+ Q_PROPERTY(int endIndex READ endIndex)
+
+public:
+ Q_PDF_EXPORT ~QPdfSelection();
+ Q_PDF_EXPORT QPdfSelection(const QPdfSelection &other);
+ Q_PDF_EXPORT QPdfSelection &operator=(const QPdfSelection &other);
+
+ Q_PDF_EXPORT QPdfSelection(QPdfSelection &&other) noexcept;
+ QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(QPdfSelection)
+
+ void swap(QPdfSelection &other) noexcept { d.swap(other.d); }
+
+ Q_PDF_EXPORT bool isValid() const;
+ Q_PDF_EXPORT QList<QPolygonF> bounds() const;
+ Q_PDF_EXPORT QString text() const;
+ Q_PDF_EXPORT QRectF boundingRectangle() const;
+ Q_PDF_EXPORT int startIndex() const;
+ Q_PDF_EXPORT int endIndex() const;
+#if QT_CONFIG(clipboard)
+ Q_PDF_EXPORT void copyToClipboard(QClipboard::Mode mode = QClipboard::Clipboard) const;
+#endif
+
+private:
+ QPdfSelection();
+ QPdfSelection(const QString &text, QList<QPolygonF> bounds, QRectF boundingRect, int startIndex, int endIndex);
+ QPdfSelection(QPdfSelectionPrivate *d);
+ friend class QPdfDocument;
+ friend class QQuickPdfSelection;
+
+private:
+ QExplicitlySharedDataPointer<QPdfSelectionPrivate> d;
+};
+Q_DECLARE_SHARED(QPdfSelection)
+
+QT_END_NAMESPACE
+
+#endif // QPDFSELECTION_H
diff --git a/src/pdf/qpdfselection_p.h b/src/pdf/qpdfselection_p.h
new file mode 100644
index 000000000..541480746
--- /dev/null
+++ b/src/pdf/qpdfselection_p.h
@@ -0,0 +1,45 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QPDFSELECTION_P_H
+#define QPDFSELECTION_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qpdfselection.h"
+
+#include <QList>
+#include <QPolygonF>
+
+QT_BEGIN_NAMESPACE
+
+class QPdfSelectionPrivate : public QSharedData
+{
+public:
+ QPdfSelectionPrivate() = default;
+ QPdfSelectionPrivate(const QString &text, QList<QPolygonF> bounds, QRectF boundingRect, int startIndex, int endIndex)
+ : text(text),
+ bounds(bounds),
+ boundingRect(boundingRect),
+ startIndex(startIndex),
+ endIndex(endIndex) { }
+
+ QString text;
+ QList<QPolygonF> bounds;
+ QRectF boundingRect;
+ int startIndex;
+ int endIndex;
+};
+
+QT_END_NAMESPACE
+
+#endif // QPDFSELECTION_P_H
diff --git a/src/pdf/qtpdf.gni b/src/pdf/qtpdf.gni
deleted file mode 100644
index c31f3e9a0..000000000
--- a/src/pdf/qtpdf.gni
+++ /dev/null
@@ -1,7 +0,0 @@
-include_dirs = [
-]
-
-deps = [
- "//third_party/pdfium"
-]
-
diff --git a/src/pdf/qtpdfglobal.h b/src/pdf/qtpdfglobal.h
new file mode 100644
index 000000000..2d0900029
--- /dev/null
+++ b/src/pdf/qtpdfglobal.h
@@ -0,0 +1,11 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QTPDFGLOBAL_H
+#define QTPDFGLOBAL_H
+
+#include <QtCore/qglobal.h>
+#include <QtPdf/qtpdfexports.h>
+
+#endif // QTPDFGLOBAL_H
+
diff --git a/src/pdf/quick/plugin.cpp b/src/pdf/quick/plugin.cpp
deleted file mode 100644
index b082fcb4a..000000000
--- a/src/pdf/quick/plugin.cpp
+++ /dev/null
@@ -1,103 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtQml/qqml.h>
-#include <QtQml/qqmlcomponent.h>
-#include <QtQml/qqmlengine.h>
-#include <QtQml/qqmlextensionplugin.h>
-#include "qquickpdfdocument_p.h"
-#include "qquickpdflinkmodel_p.h"
-#include "qquickpdfnavigationstack_p.h"
-#include "qquickpdfsearchmodel_p.h"
-#include "qquickpdfselection_p.h"
-#include "qquicktableviewextra_p.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \qmlmodule QtQuick.Pdf 5.15
- \title Qt Quick PDF QML Types
- \ingroup qmlmodules
- \brief Provides QML types for handling PDF documents.
-
- This QML module contains types for handling PDF documents.
-
- To use the types in this module, import the module with the following line:
-
- \code
- import QtQuick.Pdf 5.15
- \endcode
-*/
-
-class QtQuick2PdfPlugin : public QQmlExtensionPlugin
-{
- Q_OBJECT
- Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
-
-public:
- QtQuick2PdfPlugin() : QQmlExtensionPlugin() { }
-
- void initializeEngine(QQmlEngine *engine, const char *uri) override {
- Q_UNUSED(uri);
-#ifdef QT_STATIC
- Q_UNUSED(engine);
-#else
- engine->addImportPath(QStringLiteral("qrc:/"));
-#endif
- }
-
- void registerTypes(const char *uri) override {
- Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuick.Pdf"));
-
- // Register the latest version, even if there are no new types or new revisions for existing types yet.
- qmlRegisterModule(uri, 2, QT_VERSION_MINOR);
-
- qmlRegisterType<QQuickPdfDocument>(uri, 5, 15, "PdfDocument");
- qmlRegisterType<QQuickPdfLinkModel>(uri, 5, 15, "PdfLinkModel");
- qmlRegisterType<QQuickPdfNavigationStack>(uri, 5, 15, "PdfNavigationStack");
- qmlRegisterType<QQuickPdfSearchModel>(uri, 5, 15, "PdfSearchModel");
- qmlRegisterType<QQuickPdfSelection>(uri, 5, 15, "PdfSelection");
- qmlRegisterType<QQuickTableViewExtra>(uri, 5, 15, "TableViewExtra");
-
- qmlRegisterType(QUrl("qrc:/qt-project.org/qtpdf/qml/PdfPageView.qml"), uri, 5, 15, "PdfPageView");
- qmlRegisterType(QUrl("qrc:/qt-project.org/qtpdf/qml/PdfMultiPageView.qml"), uri, 5, 15, "PdfMultiPageView");
- qmlRegisterType(QUrl("qrc:/qt-project.org/qtpdf/qml/PdfScrollablePageView.qml"), uri, 5, 15, "PdfScrollablePageView");
- }
-};
-
-QT_END_NAMESPACE
-
-#include "plugin.moc"
diff --git a/src/pdf/quick/plugins.qmltypes b/src/pdf/quick/plugins.qmltypes
deleted file mode 100644
index a30361d33..000000000
--- a/src/pdf/quick/plugins.qmltypes
+++ /dev/null
@@ -1,52 +0,0 @@
-import QtQuick.tooling 1.2
-
-// This file describes the plugin-supplied types contained in the library.
-// It is used for QML tooling purposes only.
-//
-// This file was auto-generated by:
-// 'qmlplugindump -nonrelocatable QtQuick.Pdf 5.14'
-
-Module {
- dependencies: [
- "QtGraphicalEffects 1.12",
- "QtQuick 2.14",
- "QtQuick.Controls 2.14",
- "QtQuick.Controls.Fusion 2.14",
- "QtQuick.Controls.Fusion.impl 2.14",
- "QtQuick.Controls.Imagine 2.14",
- "QtQuick.Controls.Imagine.impl 2.14",
- "QtQuick.Controls.Material 2.14",
- "QtQuick.Controls.Material.impl 2.14",
- "QtQuick.Controls.Universal 2.14",
- "QtQuick.Controls.Universal.impl 2.12",
- "QtQuick.Controls.impl 2.14",
- "QtQuick.Shapes 1.14",
- "QtQuick.Templates 2.14",
- "QtQuick.Window 2.2"
- ]
- Component {
- name: "QQuickPdfDocument"
- prototype: "QObject"
- exports: ["QtQuick.Pdf/PdfDocument 5.14"]
- exportMetaObjectRevisions: [0]
- Property { name: "source"; type: "QUrl" }
- Property { name: "pageCount"; type: "int"; isReadonly: true }
- Property { name: "password"; type: "string" }
- Property { name: "status"; type: "QPdfDocument::Status"; isReadonly: true }
- Property { name: "title"; type: "string"; isReadonly: true }
- Property { name: "subject"; type: "string"; isReadonly: true }
- Property { name: "author"; type: "string"; isReadonly: true }
- Property { name: "keywords"; type: "string"; isReadonly: true }
- Property { name: "producer"; type: "string"; isReadonly: true }
- Property { name: "creator"; type: "string"; isReadonly: true }
- Property { name: "creationDate"; type: "QDateTime"; isReadonly: true }
- Property { name: "modificationDate"; type: "QDateTime"; isReadonly: true }
- Signal { name: "passwordRequired" }
- Signal { name: "metaDataLoaded" }
- Method {
- name: "pagePointSize"
- type: "QSizeF"
- Parameter { name: "page"; type: "int" }
- }
- }
-}
diff --git a/src/pdf/quick/qml/+material/PdfStyle.qml b/src/pdf/quick/qml/+material/PdfStyle.qml
deleted file mode 100644
index 12df30466..000000000
--- a/src/pdf/quick/qml/+material/PdfStyle.qml
+++ /dev/null
@@ -1,54 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-import QtQml 2.14
-import QtQuick.Controls 2.14
-import QtQuick.Controls.Material 2.14
-import QtQuick.Shapes 1.14
-
-QtObject {
- property Control prototypeControl: Control { }
- function withAlpha(color, alpha) {
- return Qt.hsla(color.hslHue, color.hslSaturation, color.hslLightness, alpha)
- }
- property color selectionColor: withAlpha(prototypeControl.palette.highlight, 0.5)
- property color pageSearchResultsColor: withAlpha(Qt.lighter(Material.accentColor, 1.5), 0.5)
- property color currentSearchResultStrokeColor: Material.accentColor
- property real currentSearchResultStrokeWidth: 2
- property color linkUnderscoreColor: prototypeControl.palette.link
- property real linkUnderscoreStrokeWidth: 1
- property var linkUnderscoreStrokeStyle: ShapePath.DashLine
- property var linkUnderscoreDashPattern: [ 1, 4 ]
-}
diff --git a/src/pdf/quick/qml/+universal/PdfStyle.qml b/src/pdf/quick/qml/+universal/PdfStyle.qml
deleted file mode 100644
index e92f2a080..000000000
--- a/src/pdf/quick/qml/+universal/PdfStyle.qml
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-import QtQml 2.14
-import QtQuick 2.14
-import QtQuick.Controls 2.14
-import QtQuick.Controls.Universal 2.14
-import QtQuick.Shapes 1.14
-
-QtObject {
- property Control prototypeControl: Control { }
- function withAlpha(color, alpha) {
- return Qt.hsla(color.hslHue, color.hslSaturation, color.hslLightness, alpha)
- }
- property color selectionColor: withAlpha(prototypeControl.palette.highlight, 0.5)
- property color pageSearchResultsColor: withAlpha(Qt.lighter(Universal.accent, 1.5), 0.5)
- property color currentSearchResultStrokeColor: Universal.accent
- property real currentSearchResultStrokeWidth: 2
- property color linkUnderscoreColor: prototypeControl.palette.link
- property real linkUnderscoreStrokeWidth: 1
- property var linkUnderscoreStrokeStyle: ShapePath.DashLine
- property var linkUnderscoreDashPattern: [ 1, 4 ]
-}
diff --git a/src/pdf/quick/qml/PdfMultiPageView.qml b/src/pdf/quick/qml/PdfMultiPageView.qml
deleted file mode 100644
index 71485c214..000000000
--- a/src/pdf/quick/qml/PdfMultiPageView.qml
+++ /dev/null
@@ -1,434 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-import QtQuick 2.14
-import QtQuick.Controls 2.14
-import QtQuick.Layouts 1.14
-import QtQuick.Pdf 5.15
-import QtQuick.Shapes 1.14
-import QtQuick.Window 2.14
-
-Item {
- // public API
- // TODO 5.15: required property
- property var document: undefined
- property bool debug: false
-
- property string selectedText
- function selectAll() {
- var currentItem = tableHelper.itemAtCell(tableHelper.cellAtPos(root.width / 2, root.height / 2))
- if (currentItem)
- currentItem.selection.selectAll()
- }
- function copySelectionToClipboard() {
- var currentItem = tableHelper.itemAtCell(tableHelper.cellAtPos(root.width / 2, root.height / 2))
- if (debug)
- console.log("currentItem", currentItem, "sel", currentItem.selection.text)
- if (currentItem)
- currentItem.selection.copyToClipboard()
- }
-
- // page navigation
- property alias currentPage: navigationStack.currentPage
- property alias backEnabled: navigationStack.backAvailable
- property alias forwardEnabled: navigationStack.forwardAvailable
- function back() { navigationStack.back() }
- function forward() { navigationStack.forward() }
- function goToPage(page) {
- if (page === navigationStack.currentPage)
- return
- goToLocation(page, Qt.point(-1, -1), 0)
- }
- function goToLocation(page, location, zoom) {
- if (zoom > 0) {
- navigationStack.jumping = true // don't call navigationStack.update() because we will push() instead
- root.renderScale = zoom
- tableView.forceLayout() // but do ensure that the table layout is correct before we try to jump
- navigationStack.jumping = false
- }
- navigationStack.push(page, location, zoom) // actually jump
- }
- property vector2d jumpLocationMargin: Qt.vector2d(10, 10) // px from top-left corner
- property int currentPageRenderingStatus: Image.Null
-
- // page scaling
- property real renderScale: 1
- property real pageRotation: 0
- function resetScale() { root.renderScale = 1 }
- function scaleToWidth(width, height) {
- root.renderScale = width / (tableView.rot90 ? tableView.firstPagePointSize.height : tableView.firstPagePointSize.width)
- }
- function scaleToPage(width, height) {
- var windowAspect = width / height
- var pageAspect = tableView.firstPagePointSize.width / tableView.firstPagePointSize.height
- if (tableView.rot90) {
- if (windowAspect > pageAspect) {
- root.renderScale = height / tableView.firstPagePointSize.width
- } else {
- root.renderScale = width / tableView.firstPagePointSize.height
- }
- } else {
- if (windowAspect > pageAspect) {
- root.renderScale = height / tableView.firstPagePointSize.height
- } else {
- root.renderScale = width / tableView.firstPagePointSize.width
- }
- }
- }
-
- // text search
- property alias searchModel: searchModel
- property alias searchString: searchModel.searchString
- function searchBack() { --searchModel.currentResult }
- function searchForward() { ++searchModel.currentResult }
-
- id: root
- PdfStyle { id: style }
- TableView {
- id: tableView
- anchors.fill: parent
- anchors.leftMargin: 2
- model: modelInUse && root.document !== undefined ? root.document.pageCount : 0
- // workaround to make TableView do scheduleRebuildTable(RebuildOption::All) in cases when forceLayout() doesn't
- property bool modelInUse: true
- function rebuild() {
- modelInUse = false
- modelInUse = true
- }
- // end workaround
- rowSpacing: 6
- property real rotationNorm: Math.round((360 + (root.pageRotation % 360)) % 360)
- property bool rot90: rotationNorm == 90 || rotationNorm == 270
- onRot90Changed: forceLayout()
- property size firstPagePointSize: document === undefined ? Qt.size(0, 0) : document.pagePointSize(0)
- property real pageHolderWidth: Math.max(root.width, document === undefined ? 0 :
- (rot90 ? document.maxPageHeight : document.maxPageWidth) * root.renderScale)
- contentWidth: document === undefined ? 0 : pageHolderWidth + vscroll.width + 2
- rowHeightProvider: function(row) { return (rot90 ? document.pagePointSize(row).width : document.pagePointSize(row).height) * root.renderScale }
- TableViewExtra {
- id: tableHelper
- tableView: tableView
- }
- delegate: Rectangle {
- id: pageHolder
- color: root.debug ? "beige" : "transparent"
- Text {
- visible: root.debug
- anchors { right: parent.right; verticalCenter: parent.verticalCenter }
- rotation: -90; text: pageHolder.width.toFixed(1) + "x" + pageHolder.height.toFixed(1) + "\n" +
- image.width.toFixed(1) + "x" + image.height.toFixed(1)
- }
- implicitWidth: tableView.pageHolderWidth
- implicitHeight: tableView.rot90 ? image.width : image.height
- property alias selection: selection
- Rectangle {
- id: paper
- width: image.width
- height: image.height
- rotation: root.pageRotation
- anchors.centerIn: pinch.active ? undefined : parent
- property size pagePointSize: document.pagePointSize(index)
- property real pageScale: image.paintedWidth / pagePointSize.width
- Image {
- id: image
- source: document.source
- currentFrame: index
- asynchronous: true
- fillMode: Image.PreserveAspectFit
- width: paper.pagePointSize.width * root.renderScale
- height: paper.pagePointSize.height * root.renderScale
- property real renderScale: root.renderScale
- property real oldRenderScale: 1
- onRenderScaleChanged: {
- image.sourceSize.width = paper.pagePointSize.width * renderScale
- image.sourceSize.height = 0
- paper.scale = 1
- searchHighlights.update()
- }
- onStatusChanged: {
- if (index === navigationStack.currentPage)
- root.currentPageRenderingStatus = status
- }
- }
- Shape {
- anchors.fill: parent
- visible: image.status === Image.Ready
- onVisibleChanged: searchHighlights.update()
- ShapePath {
- strokeWidth: -1
- fillColor: style.pageSearchResultsColor
- scale: Qt.size(paper.pageScale, paper.pageScale)
- PathMultiline {
- id: searchHighlights
- function update() {
- // paths could be a binding, but we need to be able to "kick" it sometimes
- paths = searchModel.boundingPolygonsOnPage(index)
- }
- }
- }
- Connections {
- target: searchModel
- // whenever the highlights on the _current_ page change, they actually need to change on _all_ pages
- // (usually because the search string has changed)
- function onCurrentPageBoundingPolygonsChanged() { searchHighlights.update() }
- }
- ShapePath {
- strokeWidth: -1
- fillColor: style.selectionColor
- scale: Qt.size(paper.pageScale, paper.pageScale)
- PathMultiline {
- paths: selection.geometry
- }
- }
- }
- Shape {
- anchors.fill: parent
- visible: image.status === Image.Ready && searchModel.currentPage === index
- ShapePath {
- strokeWidth: style.currentSearchResultStrokeWidth
- strokeColor: style.currentSearchResultStrokeColor
- fillColor: "transparent"
- scale: Qt.size(paper.pageScale, paper.pageScale)
- PathMultiline {
- paths: searchModel.currentResultBoundingPolygons
- }
- }
- }
- PinchHandler {
- id: pinch
- minimumScale: 0.1
- maximumScale: root.renderScale < 4 ? 2 : 1
- minimumRotation: root.pageRotation
- maximumRotation: root.pageRotation
- enabled: image.sourceSize.width < 5000
- onActiveChanged:
- if (active) {
- paper.z = 10
- } else {
- paper.z = 0
- var centroidInPoints = Qt.point(pinch.centroid.position.x / root.renderScale,
- pinch.centroid.position.y / root.renderScale)
- var centroidInFlickable = tableView.mapFromItem(paper, pinch.centroid.position.x, pinch.centroid.position.y)
- var newSourceWidth = image.sourceSize.width * paper.scale
- var ratio = newSourceWidth / image.sourceSize.width
- if (root.debug)
- console.log("pinch ended on page", index, "with centroid", pinch.centroid.position, centroidInPoints, "wrt flickable", centroidInFlickable,
- "page at", pageHolder.x.toFixed(2), pageHolder.y.toFixed(2),
- "contentX/Y were", tableView.contentX.toFixed(2), tableView.contentY.toFixed(2))
- if (ratio > 1.1 || ratio < 0.9) {
- var centroidOnPage = Qt.point(centroidInPoints.x * root.renderScale * ratio, centroidInPoints.y * root.renderScale * ratio)
- paper.scale = 1
- paper.x = 0
- paper.y = 0
- root.renderScale *= ratio
- tableView.forceLayout()
- if (tableView.rotationNorm == 0) {
- tableView.contentX = pageHolder.x + tableView.originX + centroidOnPage.x - centroidInFlickable.x
- tableView.contentY = pageHolder.y + tableView.originY + centroidOnPage.y - centroidInFlickable.y
- } else if (tableView.rotationNorm == 90) {
- tableView.contentX = pageHolder.x + tableView.originX + image.height - centroidOnPage.y - centroidInFlickable.x
- tableView.contentY = pageHolder.y + tableView.originY + centroidOnPage.x - centroidInFlickable.y
- } else if (tableView.rotationNorm == 180) {
- tableView.contentX = pageHolder.x + tableView.originX + image.width - centroidOnPage.x - centroidInFlickable.x
- tableView.contentY = pageHolder.y + tableView.originY + image.height - centroidOnPage.y - centroidInFlickable.y
- } else if (tableView.rotationNorm == 270) {
- tableView.contentX = pageHolder.x + tableView.originX + centroidOnPage.y - centroidInFlickable.x
- tableView.contentY = pageHolder.y + tableView.originY + image.width - centroidOnPage.x - centroidInFlickable.y
- }
- if (root.debug)
- console.log("contentX/Y adjusted to", tableView.contentX.toFixed(2), tableView.contentY.toFixed(2), "y @top", pageHolder.y)
- tableView.returnToBounds()
- }
- }
- grabPermissions: PointerHandler.CanTakeOverFromAnything
- }
- DragHandler {
- id: textSelectionDrag
- acceptedDevices: PointerDevice.Mouse | PointerDevice.Stylus
- target: null
- }
- TapHandler {
- id: mouseClickHandler
- acceptedDevices: PointerDevice.Mouse | PointerDevice.Stylus
- }
- TapHandler {
- id: touchTapHandler
- acceptedDevices: PointerDevice.TouchScreen
- onTapped: {
- selection.clear()
- selection.forceActiveFocus()
- }
- }
- Repeater {
- model: PdfLinkModel {
- id: linkModel
- document: root.document
- page: image.currentFrame
- }
- delegate: Shape {
- x: rect.x * paper.pageScale
- y: rect.y * paper.pageScale
- width: rect.width * paper.pageScale
- height: rect.height * paper.pageScale
- visible: image.status === Image.Ready
- ShapePath {
- strokeWidth: style.linkUnderscoreStrokeWidth
- strokeColor: style.linkUnderscoreColor
- strokeStyle: style.linkUnderscoreStrokeStyle
- dashPattern: style.linkUnderscoreDashPattern
- startX: 0; startY: height
- PathLine { x: width; y: height }
- }
- MouseArea { // TODO switch to TapHandler / HoverHandler in 5.15
- id: linkMA
- anchors.fill: parent
- cursorShape: Qt.PointingHandCursor
- hoverEnabled: true
- onClicked: {
- if (page >= 0)
- root.goToLocation(page, location, zoom)
- else
- Qt.openUrlExternally(url)
- }
- }
- ToolTip {
- visible: linkMA.containsMouse
- delay: 1000
- text: page >= 0 ?
- ("page " + (page + 1) +
- " location " + location.x.toFixed(1) + ", " + location.y.toFixed(1) +
- " zoom " + zoom) : url
- }
- }
- }
- PdfSelection {
- id: selection
- anchors.fill: parent
- document: root.document
- page: image.currentFrame
- renderScale: image.renderScale
- fromPoint: textSelectionDrag.centroid.pressPosition
- toPoint: textSelectionDrag.centroid.position
- hold: !textSelectionDrag.active && !mouseClickHandler.pressed
- onTextChanged: root.selectedText = text
- focus: true
- }
- }
- }
- ScrollBar.vertical: ScrollBar {
- id: vscroll
- property bool moved: false
- onPositionChanged: moved = true
- onActiveChanged: {
- var cell = tableHelper.cellAtPos(root.width / 2, root.height / 2)
- var currentItem = tableHelper.itemAtCell(cell)
- var currentLocation = Qt.point(0, 0)
- if (currentItem) { // maybe the delegate wasn't loaded yet
- currentLocation = Qt.point((tableView.contentX - currentItem.x + jumpLocationMargin.x) / root.renderScale,
- (tableView.contentY - currentItem.y + jumpLocationMargin.y) / root.renderScale)
- }
- if (active) {
- moved = false
- // emitJumped false to avoid interrupting a pinch if TableView thinks it should scroll at the same time
- navigationStack.push(cell.y, currentLocation, root.renderScale, false)
- } else if (moved) {
- navigationStack.update(cell.y, currentLocation, root.renderScale)
- }
- }
- }
- ScrollBar.horizontal: ScrollBar { }
- }
- onRenderScaleChanged: {
- // if navigationStack.jumped changes the scale, don't turn around and update the stack again;
- // and don't force layout either, because positionViewAtCell() will do that
- if (navigationStack.jumping)
- return
- // make TableView rebuild from scratch, because otherwise it doesn't know the delegates are changing size
- tableView.rebuild()
- var cell = tableHelper.cellAtPos(root.width / 2, root.height / 2)
- var currentItem = tableHelper.itemAtCell(cell)
- if (currentItem) {
- var currentLocation = Qt.point((tableView.contentX - currentItem.x + jumpLocationMargin.x) / root.renderScale,
- (tableView.contentY - currentItem.y + jumpLocationMargin.y) / root.renderScale)
- navigationStack.update(cell.y, currentLocation, renderScale)
- }
- }
- PdfNavigationStack {
- id: navigationStack
- property bool jumping: false
- property int previousPage: 0
- onJumped: {
- jumping = true
- root.renderScale = zoom
- if (location.y < 0) {
- // invalid to indicate that a specific location was not needed,
- // so attempt to position the new page just as the current page is
- var currentYOffset = 0
- var previousPageDelegate = tableHelper.itemAtCell(0, previousPage)
- if (previousPageDelegate)
- currentYOffset = tableView.contentY - previousPageDelegate.y
- tableHelper.positionViewAtRow(page, Qt.AlignTop, currentYOffset)
- if (root.debug) {
- console.log("going from page", previousPage, "to", page, "offset", currentYOffset,
- "ended up @", tableView.contentX.toFixed(1) + ", " + tableView.contentY.toFixed(1))
- }
- } else {
- // jump to a page and position the given location relative to the top-left corner of the viewport
- var pageSize = root.document.pagePointSize(page)
- pageSize.width *= root.renderScale
- pageSize.height *= root.renderScale
- var xOffsetLimit = Math.max(0, pageSize.width - root.width) / 2
- var offset = Qt.point(Math.max(-xOffsetLimit, Math.min(xOffsetLimit,
- location.x * root.renderScale - jumpLocationMargin.x)),
- Math.max(0, location.y * root.renderScale - jumpLocationMargin.y))
- tableHelper.positionViewAtCell(0, page, Qt.AlignLeft | Qt.AlignTop, offset)
- if (root.debug) {
- console.log("going to zoom", zoom, "loc", location, "on page", page,
- "ended up @", tableView.contentX.toFixed(1) + ", " + tableView.contentY.toFixed(1))
- }
- }
- jumping = false
- previousPage = page
- }
- onCurrentPageChanged: searchModel.currentPage = currentPage
- }
- PdfSearchModel {
- id: searchModel
- document: root.document === undefined ? null : root.document
- // TODO maybe avoid jumping if the result is already fully visible in the viewport
- onCurrentResultBoundingRectChanged: root.goToLocation(currentPage,
- Qt.point(currentResultBoundingRect.x, currentResultBoundingRect.y), 0)
- }
-}
diff --git a/src/pdf/quick/qml/PdfPageView.qml b/src/pdf/quick/qml/PdfPageView.qml
deleted file mode 100644
index b90ad2d7f..000000000
--- a/src/pdf/quick/qml/PdfPageView.qml
+++ /dev/null
@@ -1,276 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-import QtQuick 2.14
-import QtQuick.Controls 2.14
-import QtQuick.Pdf 5.15
-import QtQuick.Shapes 1.14
-import Qt.labs.animation 1.0
-
-Rectangle {
- // public API
- // TODO 5.15: required property
- property var document: undefined
- property alias status: image.status
-
- property alias selectedText: selection.text
- function selectAll() {
- selection.selectAll()
- }
- function copySelectionToClipboard() {
- selection.copyToClipboard()
- }
-
- // page navigation
- property alias currentPage: navigationStack.currentPage
- property alias backEnabled: navigationStack.backAvailable
- property alias forwardEnabled: navigationStack.forwardAvailable
- function back() { navigationStack.back() }
- function forward() { navigationStack.forward() }
- function goToPage(page) { goToLocation(page, Qt.point(0, 0), 0) }
- function goToLocation(page, location, zoom) {
- if (zoom > 0)
- root.renderScale = zoom
- navigationStack.push(page, location, zoom)
- }
-
- // page scaling
- property real renderScale: 1
- property alias sourceSize: image.sourceSize
- function resetScale() {
- image.sourceSize.width = 0
- image.sourceSize.height = 0
- root.x = 0
- root.y = 0
- root.scale = 1
- }
- function scaleToWidth(width, height) {
- var halfRotation = Math.abs(root.rotation % 180)
- image.sourceSize = Qt.size((halfRotation > 45 && halfRotation < 135) ? height : width, 0)
- root.x = 0
- root.y = 0
- image.centerInSize = Qt.size(width, height)
- image.centerOnLoad = true
- image.vCenterOnLoad = (halfRotation > 45 && halfRotation < 135)
- root.scale = 1
- }
- function scaleToPage(width, height) {
- var windowAspect = width / height
- var halfRotation = Math.abs(root.rotation % 180)
- var pagePointSize = document.pagePointSize(navigationStack.currentPage)
- if (halfRotation > 45 && halfRotation < 135) {
- // rotated 90 or 270º
- var pageAspect = pagePointSize.height / pagePointSize.width
- if (windowAspect > pageAspect) {
- image.sourceSize = Qt.size(height, 0)
- } else {
- image.sourceSize = Qt.size(0, width)
- }
- } else {
- var pageAspect = pagePointSize.width / pagePointSize.height
- if (windowAspect > pageAspect) {
- image.sourceSize = Qt.size(0, height)
- } else {
- image.sourceSize = Qt.size(width, 0)
- }
- }
- image.centerInSize = Qt.size(width, height)
- image.centerOnLoad = true
- image.vCenterOnLoad = true
- root.scale = 1
- }
-
- // text search
- property alias searchModel: searchModel
- property alias searchString: searchModel.searchString
- function searchBack() { --searchModel.currentResult }
- function searchForward() { ++searchModel.currentResult }
-
- // implementation
- id: root
- width: image.width
- height: image.height
-
- PdfSelection {
- id: selection
- document: root.document
- page: navigationStack.currentPage
- fromPoint: Qt.point(textSelectionDrag.centroid.pressPosition.x / image.pageScale, textSelectionDrag.centroid.pressPosition.y / image.pageScale)
- toPoint: Qt.point(textSelectionDrag.centroid.position.x / image.pageScale, textSelectionDrag.centroid.position.y / image.pageScale)
- hold: !textSelectionDrag.active && !tapHandler.pressed
- }
-
- PdfSearchModel {
- id: searchModel
- document: root.document === undefined ? null : root.document
- onCurrentPageChanged: root.goToPage(currentPage)
- }
-
- PdfNavigationStack {
- id: navigationStack
- onCurrentPageChanged: searchModel.currentPage = currentPage
- // TODO onCurrentLocationChanged: position currentLocation.x and .y in middle // currentPageChanged() MUST occur first!
- onCurrentZoomChanged: root.renderScale = currentZoom
- // TODO deal with horizontal location (need WheelHandler or Flickable probably)
- }
-
- Image {
- id: image
- currentFrame: navigationStack.currentPage
- source: document.status === PdfDocument.Ready ? document.source : ""
- asynchronous: true
- fillMode: Image.PreserveAspectFit
- property bool centerOnLoad: false
- property bool vCenterOnLoad: false
- property size centerInSize
- property real pageScale: image.paintedWidth / document.pagePointSize(navigationStack.currentPage).width
- function reRenderIfNecessary() {
- var newSourceWidth = image.sourceSize.width * root.scale
- var ratio = newSourceWidth / image.sourceSize.width
- if (ratio > 1.1 || ratio < 0.9) {
- image.sourceSize.width = newSourceWidth
- image.sourceSize.height = 0
- root.scale = 1
- }
- }
- onStatusChanged:
- if (status == Image.Ready && centerOnLoad) {
- root.x = (centerInSize.width - image.implicitWidth) / 2
- root.y = vCenterOnLoad ? (centerInSize.height - image.implicitHeight) / 2 : 0
- centerOnLoad = false
- vCenterOnLoad = false
- }
- }
- onRenderScaleChanged: {
- image.sourceSize.width = document.pagePointSize(navigationStack.currentPage).width * renderScale
- image.sourceSize.height = 0
- root.scale = 1
- }
-
- Shape {
- anchors.fill: parent
- opacity: 0.25
- visible: image.status === Image.Ready
- ShapePath {
- strokeWidth: 1
- strokeColor: "cyan"
- fillColor: "steelblue"
- scale: Qt.size(image.pageScale, image.pageScale)
- PathMultiline {
- paths: searchModel.currentPageBoundingPolygons
- }
- }
- ShapePath {
- strokeWidth: 1
- strokeColor: "orange"
- fillColor: "cyan"
- scale: Qt.size(image.pageScale, image.pageScale)
- PathMultiline {
- paths: searchModel.currentResultBoundingPolygons
- }
- }
- ShapePath {
- fillColor: "orange"
- scale: Qt.size(image.pageScale, image.pageScale)
- PathMultiline {
- paths: selection.geometry
- }
- }
- }
-
- Repeater {
- model: PdfLinkModel {
- id: linkModel
- document: root.document
- page: navigationStack.currentPage
- }
- delegate: Rectangle {
- color: "transparent"
- border.color: "lightgrey"
- x: rect.x * image.pageScale
- y: rect.y * image.pageScale
- width: rect.width * image.pageScale
- height: rect.height * image.pageScale
- MouseArea { // TODO switch to TapHandler / HoverHandler in 5.15
- anchors.fill: parent
- cursorShape: Qt.PointingHandCursor
- onClicked: {
- if (page >= 0)
- navigationStack.push(page, Qt.point(0, 0), root.renderScale)
- else
- Qt.openUrlExternally(url)
- }
- }
- }
- }
-
- PinchHandler {
- id: pinch
- minimumScale: 0.1
- maximumScale: 10
- minimumRotation: 0
- maximumRotation: 0
- onActiveChanged: if (!active) image.reRenderIfNecessary()
- grabPermissions: PinchHandler.TakeOverForbidden // don't allow takeover if pinch has started
- }
- DragHandler {
- id: pageMovingTouchDrag
- acceptedDevices: PointerDevice.TouchScreen
- }
- DragHandler {
- id: pageMovingMiddleMouseDrag
- acceptedDevices: PointerDevice.Mouse | PointerDevice.Stylus
- acceptedButtons: Qt.MiddleButton
- snapMode: DragHandler.NoSnap
- }
- DragHandler {
- id: textSelectionDrag
- acceptedDevices: PointerDevice.Mouse | PointerDevice.Stylus
- target: null
- }
- TapHandler {
- id: tapHandler
- acceptedDevices: PointerDevice.Mouse | PointerDevice.Stylus
- }
- // prevent it from being scrolled out of view
- BoundaryRule on x {
- minimum: 100 - root.width
- maximum: root.parent.width - 100
- }
- BoundaryRule on y {
- minimum: 100 - root.height
- maximum: root.parent.height - 100
- }
-}
diff --git a/src/pdf/quick/qml/PdfScrollablePageView.qml b/src/pdf/quick/qml/PdfScrollablePageView.qml
deleted file mode 100644
index 51d9e530d..000000000
--- a/src/pdf/quick/qml/PdfScrollablePageView.qml
+++ /dev/null
@@ -1,307 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-import QtQuick 2.14
-import QtQuick.Controls 2.14
-import QtQuick.Pdf 5.15
-import QtQuick.Shapes 1.14
-import Qt.labs.animation 1.0
-
-Flickable {
- // public API
- // TODO 5.15: required property
- property var document: undefined
- property bool debug: false
- property alias status: image.status
-
- property alias selectedText: selection.text
- function selectAll() {
- selection.selectAll()
- }
- function copySelectionToClipboard() {
- selection.copyToClipboard()
- }
-
- // page navigation
- property alias currentPage: navigationStack.currentPage
- property alias backEnabled: navigationStack.backAvailable
- property alias forwardEnabled: navigationStack.forwardAvailable
- function back() { navigationStack.back() }
- function forward() { navigationStack.forward() }
- function goToPage(page) {
- if (page === navigationStack.currentPage)
- return
- goToLocation(page, Qt.point(0, 0), 0)
- }
- function goToLocation(page, location, zoom) {
- if (zoom > 0)
- root.renderScale = zoom
- navigationStack.push(page, location, zoom)
- }
-
- // page scaling
- property real renderScale: 1
- property real pageRotation: 0
- property alias sourceSize: image.sourceSize
- function resetScale() {
- paper.scale = 1
- root.renderScale = 1
- }
- function scaleToWidth(width, height) {
- var pagePointSize = document.pagePointSize(navigationStack.currentPage)
- root.renderScale = root.width / (paper.rot90 ? pagePointSize.height : pagePointSize.width)
- if (debug)
- console.log("scaling", pagePointSize, "to fit", root.width, "rotated?", paper.rot90, "scale", root.renderScale)
- root.contentX = 0
- root.contentY = 0
- }
- function scaleToPage(width, height) {
- var pagePointSize = document.pagePointSize(navigationStack.currentPage)
- root.renderScale = Math.min(
- root.width / (paper.rot90 ? pagePointSize.height : pagePointSize.width),
- root.height / (paper.rot90 ? pagePointSize.width : pagePointSize.height) )
- root.contentX = 0
- root.contentY = 0
- }
-
- // text search
- property alias searchModel: searchModel
- property alias searchString: searchModel.searchString
- function searchBack() { --searchModel.currentResult }
- function searchForward() { ++searchModel.currentResult }
-
- // implementation
- id: root
- PdfStyle { id: style }
- contentWidth: paper.width
- contentHeight: paper.height
- ScrollBar.vertical: ScrollBar {
- onActiveChanged:
- if (!active ) {
- var currentLocation = Qt.point((root.contentX + root.width / 2) / root.renderScale,
- (root.contentY + root.height / 2) / root.renderScale)
- navigationStack.update(navigationStack.currentPage, currentLocation, root.renderScale)
- }
- }
- ScrollBar.horizontal: ScrollBar {
- onActiveChanged:
- if (!active ) {
- var currentLocation = Qt.point((root.contentX + root.width / 2) / root.renderScale,
- (root.contentY + root.height / 2) / root.renderScale)
- navigationStack.update(navigationStack.currentPage, currentLocation, root.renderScale)
- }
- }
-
- onRenderScaleChanged: {
- image.sourceSize.width = document.pagePointSize(navigationStack.currentPage).width * renderScale
- image.sourceSize.height = 0
- paper.scale = 1
- var currentLocation = Qt.point((root.contentX + root.width / 2) / root.renderScale,
- (root.contentY + root.height / 2) / root.renderScale)
- navigationStack.update(navigationStack.currentPage, currentLocation, root.renderScale)
- }
-
- PdfSearchModel {
- id: searchModel
- document: root.document === undefined ? null : root.document
- // TODO maybe avoid jumping if the result is already fully visible in the viewport
- onCurrentResultBoundingRectChanged: root.goToLocation(currentPage,
- Qt.point(currentResultBoundingRect.x, currentResultBoundingRect.y), 0)
- }
-
- PdfNavigationStack {
- id: navigationStack
- onJumped: {
- root.renderScale = zoom
- var dx = Math.max(0, location.x * root.renderScale - root.width / 2) - root.contentX
- var dy = Math.max(0, location.y * root.renderScale - root.height / 2) - root.contentY
- // don't jump if location is in the viewport already, i.e. if the "error" between desired and actual contentX/Y is small
- if (Math.abs(dx) > root.width / 3)
- root.contentX += dx
- if (Math.abs(dy) > root.height / 3)
- root.contentY += dy
- if (root.debug) {
- console.log("going to zoom", zoom, "loc", location,
- "on page", page, "ended up @", root.contentX + ", " + root.contentY)
- }
- }
- onCurrentPageChanged: searchModel.currentPage = currentPage
- }
-
- Rectangle {
- id: paper
- width: rot90 ? image.height : image.width
- height: rot90 ? image.width : image.height
- property real rotationModulus: Math.abs(root.pageRotation % 180)
- property bool rot90: rotationModulus > 45 && rotationModulus < 135
-
- Image {
- id: image
- currentFrame: navigationStack.currentPage
- source: document.status === PdfDocument.Ready ? document.source : ""
- asynchronous: true
- fillMode: Image.PreserveAspectFit
- rotation: root.pageRotation
- anchors.centerIn: parent
- property real pageScale: image.paintedWidth / document.pagePointSize(navigationStack.currentPage).width
-
- Shape {
- anchors.fill: parent
- visible: image.status === Image.Ready
- ShapePath {
- strokeWidth: -1
- fillColor: style.pageSearchResultsColor
- scale: Qt.size(image.pageScale, image.pageScale)
- PathMultiline {
- paths: searchModel.currentPageBoundingPolygons
- }
- }
- ShapePath {
- strokeWidth: style.currentSearchResultStrokeWidth
- strokeColor: style.currentSearchResultStrokeColor
- fillColor: "transparent"
- scale: Qt.size(image.pageScale, image.pageScale)
- PathMultiline {
- paths: searchModel.currentResultBoundingPolygons
- }
- }
- ShapePath {
- fillColor: style.selectionColor
- scale: Qt.size(image.pageScale, image.pageScale)
- PathMultiline {
- paths: selection.geometry
- }
- }
- }
-
- Repeater {
- model: PdfLinkModel {
- id: linkModel
- document: root.document
- page: navigationStack.currentPage
- }
- delegate: Shape {
- x: rect.x * image.pageScale
- y: rect.y * image.pageScale
- width: rect.width * image.pageScale
- height: rect.height * image.pageScale
- ShapePath {
- strokeWidth: style.linkUnderscoreStrokeWidth
- strokeColor: style.linkUnderscoreColor
- strokeStyle: style.linkUnderscoreStrokeStyle
- dashPattern: style.linkUnderscoreDashPattern
- startX: 0; startY: height
- PathLine { x: width; y: height }
- }
- MouseArea { // TODO switch to TapHandler / HoverHandler in 5.15
- anchors.fill: parent
- cursorShape: Qt.PointingHandCursor
- onClicked: {
- if (page >= 0)
- navigationStack.push(page, Qt.point(0, 0), root.renderScale)
- else
- Qt.openUrlExternally(url)
- }
- }
- }
- }
- DragHandler {
- id: textSelectionDrag
- acceptedDevices: PointerDevice.Mouse | PointerDevice.Stylus
- target: null
- }
- TapHandler {
- id: mouseClickHandler
- acceptedDevices: PointerDevice.Mouse | PointerDevice.Stylus
- }
- TapHandler {
- id: touchTapHandler
- acceptedDevices: PointerDevice.TouchScreen
- onTapped: {
- selection.clear()
- selection.focus = true
- }
- }
- }
-
- PdfSelection {
- id: selection
- anchors.fill: parent
- document: root.document
- page: navigationStack.currentPage
- renderScale: image.pageScale
- fromPoint: textSelectionDrag.centroid.pressPosition
- toPoint: textSelectionDrag.centroid.position
- hold: !textSelectionDrag.active && !mouseClickHandler.pressed
- focus: true
- }
-
- PinchHandler {
- id: pinch
- minimumScale: 0.1
- maximumScale: root.renderScale < 4 ? 2 : 1
- minimumRotation: 0
- maximumRotation: 0
- enabled: image.sourceSize.width < 5000
- onActiveChanged:
- if (!active) {
- var centroidInPoints = Qt.point(pinch.centroid.position.x / root.renderScale,
- pinch.centroid.position.y / root.renderScale)
- var centroidInFlickable = root.mapFromItem(paper, pinch.centroid.position.x, pinch.centroid.position.y)
- var newSourceWidth = image.sourceSize.width * paper.scale
- var ratio = newSourceWidth / image.sourceSize.width
- if (root.debug)
- console.log("pinch ended with centroid", pinch.centroid.position, centroidInPoints, "wrt flickable", centroidInFlickable,
- "page at", paper.x.toFixed(2), paper.y.toFixed(2),
- "contentX/Y were", root.contentX.toFixed(2), root.contentY.toFixed(2))
- if (ratio > 1.1 || ratio < 0.9) {
- var centroidOnPage = Qt.point(centroidInPoints.x * root.renderScale * ratio, centroidInPoints.y * root.renderScale * ratio)
- paper.scale = 1
- paper.x = 0
- paper.y = 0
- root.contentX = centroidOnPage.x - centroidInFlickable.x
- root.contentY = centroidOnPage.y - centroidInFlickable.y
- root.renderScale *= ratio // onRenderScaleChanged calls navigationStack.update() so we don't need to here
- if (root.debug)
- console.log("contentX/Y adjusted to", root.contentX.toFixed(2), root.contentY.toFixed(2))
- } else {
- paper.x = 0
- paper.y = 0
- }
- }
- grabPermissions: PointerHandler.CanTakeOverFromAnything
- }
- }
-}
diff --git a/src/pdf/quick/qml/PdfStyle.qml b/src/pdf/quick/qml/PdfStyle.qml
deleted file mode 100644
index 090465ce6..000000000
--- a/src/pdf/quick/qml/PdfStyle.qml
+++ /dev/null
@@ -1,54 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-import QtQml 2.14
-import QtQuick 2.14
-import QtQuick.Controls 2.14
-import QtQuick.Shapes 1.14
-
-QtObject {
- property Control prototypeControl: Control { }
- function withAlpha(color, alpha) {
- return Qt.hsla(color.hslHue, color.hslSaturation, color.hslLightness, alpha)
- }
- property color selectionColor: withAlpha(prototypeControl.palette.highlight, 0.5)
- property color pageSearchResultsColor: "#80B0C4DE"
- property color currentSearchResultStrokeColor: "cyan"
- property real currentSearchResultStrokeWidth: 2
- property color linkUnderscoreColor: prototypeControl.palette.link
- property real linkUnderscoreStrokeWidth: 1
- property var linkUnderscoreStrokeStyle: ShapePath.DashLine
- property var linkUnderscoreDashPattern: [ 1, 4 ]
-}
diff --git a/src/pdf/quick/qmldir b/src/pdf/quick/qmldir
deleted file mode 100644
index 65fa95cda..000000000
--- a/src/pdf/quick/qmldir
+++ /dev/null
@@ -1,4 +0,0 @@
-module QtQuick.Pdf
-plugin pdfplugin
-classname QtQuick2PdfPlugin
-typeinfo plugins.qmltypes
diff --git a/src/pdf/quick/qquickpdfdocument.cpp b/src/pdf/quick/qquickpdfdocument.cpp
deleted file mode 100644
index ab5910523..000000000
--- a/src/pdf/quick/qquickpdfdocument.cpp
+++ /dev/null
@@ -1,305 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickpdfdocument_p.h"
-#include <QQuickItem>
-#include <QQmlEngine>
-#include <QStandardPaths>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \qmltype PdfDocument
- \instantiates QQuickPdfDocument
- \inqmlmodule QtQuick.Pdf
- \ingroup pdf
- \brief A representation of a PDF document.
- \since 5.15
-
- PdfDocument provides access to PDF document meta-information.
- It is not necessary for rendering, as it is enough to use an
- \l Image with source set to the URL of the PDF.
-*/
-
-/*!
- Constructs a PDF document.
-*/
-QQuickPdfDocument::QQuickPdfDocument(QObject *parent)
- : QObject(parent)
-{
- connect(&m_doc, &QPdfDocument::passwordChanged, this, &QQuickPdfDocument::passwordChanged);
- connect(&m_doc, &QPdfDocument::passwordRequired, this, &QQuickPdfDocument::passwordRequired);
- connect(&m_doc, &QPdfDocument::statusChanged, [=] (QPdfDocument::Status status) {
- emit statusChanged();
- if (status == QPdfDocument::Ready)
- emit metaDataChanged();
- });
- connect(&m_doc, &QPdfDocument::pageCountChanged, this, &QQuickPdfDocument::pageCountChanged);
-}
-
-void QQuickPdfDocument::componentComplete()
-{
- if (m_doc.error() == QPdfDocument::IncorrectPasswordError)
- emit passwordRequired();
-}
-
-/*!
- \qmlproperty url PdfDocument::source
-
- This property holds a URL pointing to the PDF file to be loaded.
-
- \note At this time, only local filesystem URLs are supported.
-*/
-void QQuickPdfDocument::setSource(QUrl source)
-{
- if (m_source == source)
- return;
-
- m_source = source;
- m_maxPageWidthHeight = QSizeF();
- emit sourceChanged();
- if (source.scheme() == QLatin1String("qrc"))
- m_doc.load(QLatin1Char(':') + source.path());
- else
- m_doc.load(source.path());
-}
-
-/*!
- \qmlproperty string PdfDocument::error
-
- This property holds a translated string representation of the current
- error, if any.
-
- \sa status
-*/
-QString QQuickPdfDocument::error() const
-{
- switch (m_doc.error()) {
- case QPdfDocument::NoError:
- return tr("no error");
- break;
- case QPdfDocument::UnknownError:
- break;
- case QPdfDocument::DataNotYetAvailableError:
- return tr("data not yet available");
- break;
- case QPdfDocument::FileNotFoundError:
- return tr("file not found");
- break;
- case QPdfDocument::InvalidFileFormatError:
- return tr("invalid file format");
- break;
- case QPdfDocument::IncorrectPasswordError:
- return tr("incorrect password");
- break;
- case QPdfDocument::UnsupportedSecuritySchemeError:
- return tr("unsupported security scheme");
- break;
- }
- return tr("unknown error");
-}
-
-/*!
- \qmlproperty bool PdfDocument::password
-
- This property holds the document password. If the passwordRequired()
- signal is emitted, the UI should prompt the user and then set this
- property so that document opening can continue.
-*/
-void QQuickPdfDocument::setPassword(const QString &password)
-{
- if (m_doc.password() == password)
- return;
- m_doc.setPassword(password);
- if (source().isValid() && source().isLocalFile())
- m_doc.load(source().path());
-}
-
-/*!
- \qmlproperty int PdfDocument::pageCount
-
- This property holds the number of pages the PDF contains.
-*/
-
-/*!
- \qmlsignal PdfDocument::passwordRequired()
-
- This signal is emitted when the PDF requires a password in order to open.
- The UI in a typical PDF viewer should prompt the user for the password
- and then set the password property when the user has provided it.
-*/
-
-/*!
- \qmlmethod size PdfDocument::pagePointSize(int page)
-
- Returns the size of the given \a page in points.
-*/
-QSizeF QQuickPdfDocument::pagePointSize(int page) const
-{
- return m_doc.pageSize(page);
-}
-
-qreal QQuickPdfDocument::maxPageWidth() const
-{
- const_cast<QQuickPdfDocument *>(this)->updateMaxPageSize();
- return m_maxPageWidthHeight.width();
-}
-
-qreal QQuickPdfDocument::maxPageHeight() const
-{
- const_cast<QQuickPdfDocument *>(this)->updateMaxPageSize();
- return m_maxPageWidthHeight.height();
-}
-
-/*!
- \internal
- \qmlmethod size PdfDocument::heightSumBeforePage(int page)
-
- Returns the sum of the heights, in points, of all sets of \a facingPages
- pages from 0 to the given \a page, exclusive.
-
- That is, if the pages were laid out end-to-end in adjacent sets of
- \a facingPages, what would be the distance in points from the top of the
- first page to the top of the given page.
-*/
-// Workaround for lack of something analogous to ListView.positionViewAtIndex() in TableView
-qreal QQuickPdfDocument::heightSumBeforePage(int page, qreal spacing, int facingPages) const
-{
- qreal ret = 0;
- for (int i = 0; i < page; i+= facingPages) {
- if (i + facingPages > page)
- break;
- qreal facingPagesHeight = 0;
- for (int j = i; j < i + facingPages; ++j)
- facingPagesHeight = qMax(facingPagesHeight, pagePointSize(j).height());
- ret += facingPagesHeight + spacing;
- }
- return ret;
-}
-
-void QQuickPdfDocument::updateMaxPageSize()
-{
- if (m_maxPageWidthHeight.isValid())
- return;
- qreal w = 0;
- qreal h = 0;
- const int count = pageCount();
- for (int i = 0; i < count; ++i) {
- auto size = pagePointSize(i);
- w = qMax(w, size.width());
- h = qMax(w, size.height());
- }
- m_maxPageWidthHeight = QSizeF(w, h);
-}
-
-/*!
- \qmlproperty real PdfDocument::maxPageWidth
-
- This property holds the width of the widest page in the document, in points.
-*/
-
-/*!
- \qmlproperty real PdfDocument::maxPageHeight
-
- This property holds the height of the tallest page in the document, in points.
-*/
-
-/*!
- \qmlproperty string PdfDocument::title
-
- This property holds the document's title. A typical viewer UI can bind this
- to the \c Window.title property.
-*/
-
-/*!
- \qmlproperty string PdfDocument::author
-
- This property holds the name of the person who created the document.
-*/
-
-/*!
- \qmlproperty string PdfDocument::subject
-
- This property holds the subject of the document.
-*/
-
-/*!
- \qmlproperty string PdfDocument::keywords
-
- This property holds the keywords associated with the document.
-*/
-
-/*!
- \qmlproperty string PdfDocument::creator
-
- If the document was converted to PDF from another format, this property
- holds the name of the software that created the original document.
-*/
-
-/*!
- \qmlproperty string PdfDocument::producer
-
- If the document was converted to PDF from another format, this property
- holds the name of the software that converted it to PDF.
-*/
-
-/*!
- \qmlproperty string PdfDocument::creationDate
-
- This property holds the date and time the document was created.
-*/
-
-/*!
- \qmlproperty string PdfDocument::modificationDate
-
- This property holds the date and time the document was most recently
- modified.
-*/
-
-/*!
- \qmlproperty enum PdfDocument::status
-
- This property tells the current status of the document. The possible values are:
-
- \value PdfDocument.Null The initial status after the document has been created or after it has been closed.
- \value PdfDocument.Loading The status after load() has been called and before the document is fully loaded.
- \value PdfDocument.Ready The status when the document is fully loaded and its data can be accessed.
- \value PdfDocument.Unloading The status after close() has been called on an open document.
- At this point the document is still valid and all its data can be accessed.
- \value PdfDocument.Error The status after Loading, if loading has failed.
-*/
-
-QT_END_NAMESPACE
diff --git a/src/pdf/quick/qquickpdfdocument_p.h b/src/pdf/quick/qquickpdfdocument_p.h
deleted file mode 100644
index cefa4f756..000000000
--- a/src/pdf/quick/qquickpdfdocument_p.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKPDFDOCUMENT_P_H
-#define QQUICKPDFDOCUMENT_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtPdf/QPdfDocument>
-#include <QDateTime>
-#include <QJSValue>
-#include <QQmlParserStatus>
-#include <QUrl>
-#include <QVariant>
-
-QT_BEGIN_NAMESPACE
-
-class QQuickPdfDocument : public QObject, public QQmlParserStatus
-{
- Q_OBJECT
- Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
- Q_PROPERTY(int pageCount READ pageCount NOTIFY pageCountChanged FINAL)
- Q_PROPERTY(qreal maxPageWidth READ maxPageWidth NOTIFY metaDataChanged)
- Q_PROPERTY(qreal maxPageHeight READ maxPageHeight NOTIFY metaDataChanged)
- Q_PROPERTY(QString password READ password WRITE setPassword NOTIFY passwordChanged FINAL)
- Q_PROPERTY(QPdfDocument::Status status READ status NOTIFY statusChanged FINAL)
- Q_PROPERTY(QString error READ error NOTIFY statusChanged FINAL)
-
- Q_PROPERTY(QString title READ title NOTIFY metaDataChanged)
- Q_PROPERTY(QString subject READ subject NOTIFY metaDataChanged)
- Q_PROPERTY(QString author READ author NOTIFY metaDataChanged)
- Q_PROPERTY(QString keywords READ keywords NOTIFY metaDataChanged)
- Q_PROPERTY(QString producer READ producer NOTIFY metaDataChanged)
- Q_PROPERTY(QString creator READ creator NOTIFY metaDataChanged)
- Q_PROPERTY(QDateTime creationDate READ creationDate NOTIFY metaDataChanged)
- Q_PROPERTY(QDateTime modificationDate READ modificationDate NOTIFY metaDataChanged)
-
-public:
- explicit QQuickPdfDocument(QObject *parent = nullptr);
-
- void classBegin() override {}
- void componentComplete() override;
-
- QUrl source() const { return m_source; }
- void setSource(QUrl source);
-
- int pageCount() const { return m_doc.pageCount(); }
- QPdfDocument::Status status() const { return m_doc.status(); }
-
- QString error() const;
-
- QString password() const { return m_doc.password(); }
- void setPassword(const QString &password);
-
- QString title() { return m_doc.metaData(QPdfDocument::Title).toString(); }
- QString author() { return m_doc.metaData(QPdfDocument::Author).toString(); }
- QString subject() { return m_doc.metaData(QPdfDocument::Subject).toString(); }
- QString keywords() { return m_doc.metaData(QPdfDocument::Keywords).toString(); }
- QString producer() { return m_doc.metaData(QPdfDocument::Producer).toString(); }
- QString creator() { return m_doc.metaData(QPdfDocument::Creator).toString(); }
- QDateTime creationDate() { return m_doc.metaData(QPdfDocument::CreationDate).toDateTime(); }
- QDateTime modificationDate() { return m_doc.metaData(QPdfDocument::ModificationDate).toDateTime(); }
-
- Q_INVOKABLE QSizeF pagePointSize(int page) const;
- qreal maxPageWidth() const;
- qreal maxPageHeight() const;
- Q_INVOKABLE qreal heightSumBeforePage(int page, qreal spacing = 0, int facingPages = 1) const;
-
-Q_SIGNALS:
- void sourceChanged();
- void passwordChanged();
- void passwordRequired();
- void statusChanged();
- void pageCountChanged();
- void metaDataChanged();
-
-private:
- QPdfDocument &document() { return m_doc; }
- void updateMaxPageSize();
-
-private:
- QUrl m_source;
- QPdfDocument m_doc;
- QSizeF m_maxPageWidthHeight;
-
- friend class QQuickPdfLinkModel;
- friend class QQuickPdfSearchModel;
- friend class QQuickPdfSelection;
-
- Q_DISABLE_COPY(QQuickPdfDocument)
-};
-
-QT_END_NAMESPACE
-
-#endif // QQUICKPDFDOCUMENT_P_H
diff --git a/src/pdf/quick/qquickpdflinkmodel.cpp b/src/pdf/quick/qquickpdflinkmodel.cpp
deleted file mode 100644
index 4f3958337..000000000
--- a/src/pdf/quick/qquickpdflinkmodel.cpp
+++ /dev/null
@@ -1,131 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickpdflinkmodel_p.h"
-#include <QQuickItem>
-#include <QQmlEngine>
-#include <QStandardPaths>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \qmltype PdfLinkModel
- \instantiates QQuickPdfLinkModel
- \inqmlmodule QtQuick.Pdf
- \ingroup pdf
- \brief A representation of links within a PDF document.
- \since 5.15
-
- PdfLinkModel provides the geometry and the destination for each link
- that the specified \l page contains.
-
- The available model roles are:
-
- \value rect
- Bounding rectangle around the link.
- \value url
- If the link is a web link, the URL for that; otherwise an empty URL.
- \value page
- If the link is an internal link, the page number to which the link should jump; otherwise \c {-1}.
- \value location
- If the link is an internal link, the location on the page to which the link should jump.
- \value zoom
- If the link is an internal link, the intended zoom level on the destination page.
-
- Normally it will be used with \l {QtQuick::Repeater}{Repeater} to visualize
- the links and provide the ability to click them:
-
- \qml
- Repeater {
- model: PdfLinkModel {
- document: root.document
- page: image.currentFrame
- }
- delegate: Rectangle {
- color: "transparent"
- border.color: "lightgrey"
- x: rect.x
- y: rect.y
- width: rect.width
- height: rect.height
- HoverHandler { cursorShape: Qt.PointingHandCursor }
- TapHandler {
- onTapped: {
- if (page >= 0)
- image.currentFrame = page
- else
- Qt.openUrlExternally(url)
- }
- }
- }
- }
- \endqml
-
- \note General-purpose PDF viewing capabilities are provided by
- \l PdfScrollablePageView and \l PdfMultiPageView. PdfLinkModel is only needed
- when building PDF view components from scratch.
-*/
-
-QQuickPdfLinkModel::QQuickPdfLinkModel(QObject *parent)
- : QPdfLinkModel(parent)
-{
-}
-
-/*!
- \qmlproperty PdfDocument PdfLinkModel::document
-
- This property holds the PDF document in which links are to be found.
-*/
-QQuickPdfDocument *QQuickPdfLinkModel::document() const
-{
- return m_quickDocument;
-}
-
-void QQuickPdfLinkModel::setDocument(QQuickPdfDocument *document)
-{
- if (document == m_quickDocument)
- return;
- m_quickDocument = document;
- QPdfLinkModel::setDocument(&document->m_doc);
-}
-
-/*!
- \qmlproperty int PdfLinkModel::page
-
- This property holds the page number on which links are to be found.
-*/
-
-QT_END_NAMESPACE
diff --git a/src/pdf/quick/qquickpdflinkmodel_p.h b/src/pdf/quick/qquickpdflinkmodel_p.h
deleted file mode 100644
index 23ad6c8c1..000000000
--- a/src/pdf/quick/qquickpdflinkmodel_p.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKPDFLINKMODEL_P_H
-#define QQUICKPDFLINKMODEL_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "qquickpdfdocument_p.h"
-#include "../api/qpdflinkmodel_p.h"
-
-#include <QVariant>
-#include <QtQml/qqml.h>
-
-QT_BEGIN_NAMESPACE
-
-class QQuickPdfLinkModel : public QPdfLinkModel
-{
- Q_OBJECT
- Q_PROPERTY(QQuickPdfDocument *document READ document WRITE setDocument NOTIFY documentChanged)
-
-public:
- explicit QQuickPdfLinkModel(QObject *parent = nullptr);
-
- QQuickPdfDocument *document() const;
- void setDocument(QQuickPdfDocument *document);
-
-signals:
- void documentChanged();
-
-private:
- void updateResults();
-
-private:
- QQuickPdfDocument *m_quickDocument;
- QVector<QPolygonF> m_linksGeometry;
-
- Q_DISABLE_COPY(QQuickPdfLinkModel)
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QQuickPdfLinkModel)
-
-#endif // QQUICKPDFLINKMODEL_P_H
diff --git a/src/pdf/quick/qquickpdfnavigationstack.cpp b/src/pdf/quick/qquickpdfnavigationstack.cpp
deleted file mode 100644
index 044023ef6..000000000
--- a/src/pdf/quick/qquickpdfnavigationstack.cpp
+++ /dev/null
@@ -1,272 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickpdfnavigationstack_p.h"
-#include <QLoggingCategory>
-
-QT_BEGIN_NAMESPACE
-
-Q_LOGGING_CATEGORY(qLcNav, "qt.pdf.navigationstack")
-
-/*!
- \qmltype PdfNavigationStack
- \instantiates QQuickPdfNavigationStack
- \inqmlmodule QtQuick.Pdf
- \ingroup pdf
- \brief History of the destinations visited within a PDF Document.
- \since 5.15
-
- PdfNavigationStack remembers which destinations the user has visited in a PDF
- document, and provides the ability to traverse backward and forward.
-*/
-
-QQuickPdfNavigationStack::QQuickPdfNavigationStack(QObject *parent)
- : QObject(parent)
-{
- push(0, QPointF(), 1);
-}
-
-/*!
- \qmlmethod void PdfNavigationStack::forward()
-
- Goes back to the page, location and zoom level that was being viewed before
- back() was called, and then emits the \l jumped() signal.
-
- If a new destination was pushed since the last time \l back() was called,
- the forward() function does nothing, because there is a branch in the
- timeline which causes the "future" to be lost.
-*/
-void QQuickPdfNavigationStack::forward()
-{
- if (m_currentHistoryIndex >= m_pageHistory.count() - 1)
- return;
- bool backAvailableWas = backAvailable();
- bool forwardAvailableWas = forwardAvailable();
- QPointF currentLocationWas = currentLocation();
- qreal currentZoomWas = currentZoom();
- ++m_currentHistoryIndex;
- m_changing = true;
- emit jumped(currentPage(), currentLocation(), currentZoom());
- if (currentZoomWas != currentZoom())
- emit currentZoomChanged();
- emit currentPageChanged();
- if (currentLocationWas != currentLocation())
- emit currentLocationChanged();
- if (!backAvailableWas)
- emit backAvailableChanged();
- if (forwardAvailableWas != forwardAvailable())
- emit forwardAvailableChanged();
- m_changing = false;
- qCDebug(qLcNav) << "forward: index" << m_currentHistoryIndex << "page" << currentPage()
- << "@" << currentLocation() << "zoom" << currentZoom();
-}
-
-/*!
- \qmlmethod void PdfNavigationStack::back()
-
- Pops the stack, updates the \l currentPage, \l currentLocation and
- \l currentZoom properties to the most-recently-viewed destination, and then
- emits the \l jumped() signal.
-*/
-void QQuickPdfNavigationStack::back()
-{
- if (m_currentHistoryIndex <= 0)
- return;
- bool backAvailableWas = backAvailable();
- bool forwardAvailableWas = forwardAvailable();
- QPointF currentLocationWas = currentLocation();
- qreal currentZoomWas = currentZoom();
- --m_currentHistoryIndex;
- m_changing = true;
- emit jumped(currentPage(), currentLocation(), currentZoom());
- if (currentZoomWas != currentZoom())
- emit currentZoomChanged();
- emit currentPageChanged();
- if (currentLocationWas != currentLocation())
- emit currentLocationChanged();
- if (backAvailableWas != backAvailable())
- emit backAvailableChanged();
- if (!forwardAvailableWas)
- emit forwardAvailableChanged();
- m_changing = false;
- qCDebug(qLcNav) << "back: index" << m_currentHistoryIndex << "page" << currentPage()
- << "@" << currentLocation() << "zoom" << currentZoom();
-}
-
-/*!
- \qmlproperty int PdfNavigationStack::currentPage
-
- This property holds the current page that is being viewed.
- If there is no current page, it holds \c -1.
-*/
-int QQuickPdfNavigationStack::currentPage() const
-{
- if (m_currentHistoryIndex < 0 || m_currentHistoryIndex >= m_pageHistory.count())
- return -1;
- return m_pageHistory.at(m_currentHistoryIndex)->page;
-}
-
-/*!
- \qmlproperty point PdfNavigationStack::currentLocation
-
- This property holds the current location on the page that is being viewed.
-*/
-QPointF QQuickPdfNavigationStack::currentLocation() const
-{
- if (m_currentHistoryIndex < 0 || m_currentHistoryIndex >= m_pageHistory.count())
- return QPointF();
- return m_pageHistory.at(m_currentHistoryIndex)->location;
-}
-
-/*!
- \qmlproperty real PdfNavigationStack::currentZoom
-
- This property holds the magnification scale on the page that is being viewed.
-*/
-qreal QQuickPdfNavigationStack::currentZoom() const
-{
- if (m_currentHistoryIndex < 0 || m_currentHistoryIndex >= m_pageHistory.count())
- return 1;
- return m_pageHistory.at(m_currentHistoryIndex)->zoom;
-}
-
-/*!
- \qmlmethod void PdfNavigationStack::push(int page, point location, qreal zoom)
-
- Adds the given destination, consisting of \a page, \a location and \a zoom,
- to the history of visited locations. If \a emitJumped is \c false, the
- \l jumped() signal will not be emitted.
-
- If forwardAvailable is \c true, calling this function represents a branch
- in the timeline which causes the "future" to be lost, and therefore
- forwardAvailable will change to \c false.
-*/
-void QQuickPdfNavigationStack::push(int page, QPointF location, qreal zoom, bool emitJumped)
-{
- if (page == currentPage() && location == currentLocation() && zoom == currentZoom())
- return;
- if (qFuzzyIsNull(zoom))
- zoom = currentZoom();
- bool backAvailableWas = backAvailable();
- bool forwardAvailableWas = forwardAvailable();
- if (!m_changing) {
- if (m_currentHistoryIndex >= 0 && forwardAvailableWas)
- m_pageHistory.remove(m_currentHistoryIndex + 1, m_pageHistory.count() - m_currentHistoryIndex - 1);
- m_pageHistory.append(QExplicitlySharedDataPointer<QPdfDestinationPrivate>(new QPdfDestinationPrivate(page, location, zoom)));
- m_currentHistoryIndex = m_pageHistory.count() - 1;
- }
- emit currentZoomChanged();
- emit currentPageChanged();
- emit currentLocationChanged();
- if (m_changing)
- return;
- if (!backAvailableWas)
- emit backAvailableChanged();
- if (forwardAvailableWas)
- emit forwardAvailableChanged();
- if (emitJumped)
- emit jumped(page, location, zoom);
- qCDebug(qLcNav) << "push: index" << m_currentHistoryIndex << "page" << page
- << "@" << location << "zoom" << zoom << "-> history" <<
- [this]() {
- QStringList ret;
- for (auto d : m_pageHistory)
- ret << QString::number(d->page);
- return ret.join(',');
- }();
-}
-
-/*!
- \qmlmethod void PdfNavigationStack::update(int page, point location, qreal zoom)
-
- Modifies the current destination, consisting of \a page, \a location and \a zoom.
-
- This can be called periodically while the user is manually moving around
- the document, so that after back() is called, forward() will jump back to
- the most-recently-viewed destination rather than the destination that was
- last specified by push().
-
- The \c currentZoomChanged, \c currentPageChanged and \c currentLocationChanged
- signals will be emitted if the respective properties are actually changed.
- The \l jumped signal is not emitted, because this operation
- represents smooth movement rather than a navigational jump.
-*/
-void QQuickPdfNavigationStack::update(int page, QPointF location, qreal zoom)
-{
- if (m_currentHistoryIndex < 0 || m_currentHistoryIndex >= m_pageHistory.count())
- return;
- int currentPageWas = currentPage();
- QPointF currentLocationWas = currentLocation();
- qreal currentZoomWas = currentZoom();
- if (page == currentPageWas && location == currentLocationWas && zoom == currentZoomWas)
- return;
- m_pageHistory[m_currentHistoryIndex]->page = page;
- m_pageHistory[m_currentHistoryIndex]->location = location;
- m_pageHistory[m_currentHistoryIndex]->zoom = zoom;
- if (currentZoomWas != zoom)
- emit currentZoomChanged();
- if (currentPageWas != page)
- emit currentPageChanged();
- if (currentLocationWas != location)
- emit currentLocationChanged();
- qCDebug(qLcNav) << "update: index" << m_currentHistoryIndex << "page" << page
- << "@" << location << "zoom" << zoom << "-> history" <<
- [this]() {
- QStringList ret;
- for (auto d : m_pageHistory)
- ret << QString::number(d->page);
- return ret.join(',');
- }();
-}
-
-bool QQuickPdfNavigationStack::backAvailable() const
-{
- return m_currentHistoryIndex > 0;
-}
-
-bool QQuickPdfNavigationStack::forwardAvailable() const
-{
- return m_currentHistoryIndex < m_pageHistory.count() - 1;
-}
-
-/*!
- \qmlsignal PdfNavigationStack::jumped(int page, point location, qreal zoom)
-
- This signal is emitted when forward(), back() or push() is called, but not
- when update() is called.
-*/
-
-QT_END_NAMESPACE
diff --git a/src/pdf/quick/qquickpdfnavigationstack_p.h b/src/pdf/quick/qquickpdfnavigationstack_p.h
deleted file mode 100644
index 0d88d62fd..000000000
--- a/src/pdf/quick/qquickpdfnavigationstack_p.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKPDFNAVIGATIONSTACK_P_H
-#define QQUICKPDFNAVIGATIONSTACK_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "qquickpdfdocument_p.h"
-#include "../api/qpdfdestination_p.h"
-
-#include <QtQml/qqml.h>
-
-QT_BEGIN_NAMESPACE
-
-class QQuickPdfNavigationStack : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(int currentPage READ currentPage NOTIFY currentPageChanged)
- Q_PROPERTY(QPointF currentLocation READ currentLocation NOTIFY currentLocationChanged)
- Q_PROPERTY(qreal currentZoom READ currentZoom NOTIFY currentZoomChanged)
- Q_PROPERTY(bool backAvailable READ backAvailable NOTIFY backAvailableChanged)
- Q_PROPERTY(bool forwardAvailable READ forwardAvailable NOTIFY forwardAvailableChanged)
-
-public:
- explicit QQuickPdfNavigationStack(QObject *parent = nullptr);
-
- Q_INVOKABLE void push(int page, QPointF location, qreal zoom, bool emitJumped = true);
- Q_INVOKABLE void update(int page, QPointF location, qreal zoom);
- Q_INVOKABLE void forward();
- Q_INVOKABLE void back();
-
- int currentPage() const;
- QPointF currentLocation() const;
- qreal currentZoom() const;
-
- bool backAvailable() const;
- bool forwardAvailable() const;
-
-Q_SIGNALS:
- void currentPageChanged();
- void currentLocationChanged();
- void currentZoomChanged();
- void backAvailableChanged();
- void forwardAvailableChanged();
- void jumped(int page, QPointF location, qreal zoom);
-
-private:
- QVector<QExplicitlySharedDataPointer<QPdfDestinationPrivate>> m_pageHistory;
- int m_currentHistoryIndex = 0;
- bool m_changing = false;
-
- Q_DISABLE_COPY(QQuickPdfNavigationStack)
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QQuickPdfNavigationStack)
-
-#endif // QQUICKPDFNAVIGATIONSTACK_P_H
diff --git a/src/pdf/quick/qquickpdfsearchmodel.cpp b/src/pdf/quick/qquickpdfsearchmodel.cpp
deleted file mode 100644
index 1f62fbad0..000000000
--- a/src/pdf/quick/qquickpdfsearchmodel.cpp
+++ /dev/null
@@ -1,301 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickpdfsearchmodel_p.h"
-#include <QtCore/qloggingcategory.h>
-
-QT_BEGIN_NAMESPACE
-
-Q_LOGGING_CATEGORY(qLcS, "qt.pdf.search")
-
-/*!
- \qmltype PdfSearchModel
- \instantiates QQuickPdfSearchModel
- \inqmlmodule QtQuick.Pdf
- \ingroup pdf
- \brief A representation of text search results within a PDF Document.
- \since 5.15
-
- PdfSearchModel provides the ability to search for text strings within a
- document and get the geometric locations of matches on each page.
-*/
-
-QQuickPdfSearchModel::QQuickPdfSearchModel(QObject *parent)
- : QPdfSearchModel(parent)
-{
- connect(this, &QPdfSearchModel::searchStringChanged,
- this, &QQuickPdfSearchModel::onResultsChanged);
-}
-
-QQuickPdfDocument *QQuickPdfSearchModel::document() const
-{
- return m_quickDocument;
-}
-
-void QQuickPdfSearchModel::setDocument(QQuickPdfDocument *document)
-{
- if (document == m_quickDocument || !document)
- return;
-
- m_quickDocument = document;
- QPdfSearchModel::setDocument(&document->m_doc);
-}
-
-/*!
- \qmlproperty list<list<point>> PdfSearchModel::currentResultBoundingPolygons
-
- A set of paths in a form that can be bound to the \c paths property of a
- \l {QtQuick::PathMultiline}{PathMultiline} instance to render a batch of
- rectangles around the regions comprising the search result \l currentResult
- on \l currentPage. This is normally used to highlight one search result
- at a time, in a UI that allows stepping through the results:
-
- \qml
- PdfDocument {
- id: doc
- }
- PdfSearchModel {
- id: searchModel
- document: doc
- currentPage: view.currentPage
- currentResult: ...
- }
- Shape {
- ShapePath {
- PathMultiline {
- paths: searchModel.currentResultBoundingPolygons
- }
- }
- }
- \endqml
-
- \sa PathMultiline
-*/
-QVector<QPolygonF> QQuickPdfSearchModel::currentResultBoundingPolygons() const
-{
- QVector<QPolygonF> ret;
- const auto &results = const_cast<QQuickPdfSearchModel *>(this)->resultsOnPage(m_currentPage);
- if (m_currentResult < 0 || m_currentResult >= results.count())
- return ret;
- const auto result = results[m_currentResult];
- for (auto rect : result.rectangles())
- ret << QPolygonF(rect);
- return ret;
-}
-
-/*!
- \qmlproperty point PdfSearchModel::currentResultBoundingRect
-
- The bounding box containing all \l currentResultBoundingPolygons.
-
- When this property changes, a scrollable view should automatically scroll
- itself in such a way as to ensure that this region is visible; for example,
- it could try to position the upper-left corner near the upper-left of its
- own viewport, subject to the constraints of the scrollable area.
-*/
-QRectF QQuickPdfSearchModel::currentResultBoundingRect() const
-{
- QRectF ret;
- const auto &results = const_cast<QQuickPdfSearchModel *>(this)->resultsOnPage(m_currentPage);
- if (m_currentResult < 0 || m_currentResult >= results.count())
- return ret;
- auto rects = results[m_currentResult].rectangles();
- ret = rects.takeFirst();
- for (auto rect : rects)
- ret = ret.united(rect);
- return ret;
-}
-
-void QQuickPdfSearchModel::onResultsChanged()
-{
- emit currentPageBoundingPolygonsChanged();
- emit currentResultBoundingPolygonsChanged();
-}
-
-/*!
- \qmlproperty list<list<point>> PdfSearchModel::currentPageBoundingPolygons
-
- A set of paths in a form that can be bound to the \c paths property of a
- \l {QtQuick::PathMultiline}{PathMultiline} instance to render a batch of
- rectangles around all the regions where search results are found on
- \l currentPage:
-
- \qml
- PdfDocument {
- id: doc
- }
- PdfSearchModel {
- id: searchModel
- document: doc
- }
- Shape {
- ShapePath {
- PathMultiline {
- paths: searchModel.matchGeometry(view.currentPage)
- }
- }
- }
- \endqml
-
- \sa PathMultiline
-*/
-QVector<QPolygonF> QQuickPdfSearchModel::currentPageBoundingPolygons() const
-{
- return const_cast<QQuickPdfSearchModel *>(this)->boundingPolygonsOnPage(m_currentPage);
-}
-
-/*!
- \qmlfunction list<list<point>> PdfSearchModel::boundingPolygonsOnPage(int page)
-
- Returns a set of paths in a form that can be bound to the \c paths property of a
- \l {QtQuick::PathMultiline}{PathMultiline} instance to render a batch of
- rectangles around all the locations where search results are found:
-
- \qml
- PdfDocument {
- id: doc
- }
- PdfSearchModel {
- id: searchModel
- document: doc
- }
- Shape {
- ShapePath {
- PathMultiline {
- paths: searchModel.matchGeometry(view.currentPage)
- }
- }
- }
- \endqml
-
- \sa PathMultiline
-*/
-QVector<QPolygonF> QQuickPdfSearchModel::boundingPolygonsOnPage(int page)
-{
- if (!document() || searchString().isEmpty() || page < 0 || page > document()->pageCount())
- return {};
-
- updatePage(page);
-
- QVector<QPolygonF> ret;
- auto m = QPdfSearchModel::resultsOnPage(page);
- for (auto result : m) {
- for (auto rect : result.rectangles())
- ret << QPolygonF(rect);
- }
-
- return ret;
-}
-
-/*!
- \qmlproperty int PdfSearchModel::currentPage
-
- The page on which \l currentMatchGeometry should provide filtered search results.
-*/
-void QQuickPdfSearchModel::setCurrentPage(int currentPage)
-{
- if (m_currentPage == currentPage)
- return;
-
- if (currentPage < 0)
- currentPage = document()->pageCount() - 1;
- else if (currentPage >= document()->pageCount())
- currentPage = 0;
-
- m_currentPage = currentPage;
- if (!m_suspendSignals) {
- emit currentPageChanged();
- onResultsChanged();
- }
-}
-
-/*!
- \qmlproperty int PdfSearchModel::currentResult
-
- The result index on \l currentPage for which \l currentResultBoundingPolygons
- should provide the regions to highlight.
-*/
-void QQuickPdfSearchModel::setCurrentResult(int currentResult)
-{
- if (m_currentResult == currentResult)
- return;
-
- int currentResultWas = currentResult;
- int currentPageWas = m_currentPage;
- if (currentResult < 0) {
- setCurrentPage(m_currentPage - 1);
- while (resultsOnPage(m_currentPage).count() == 0 && m_currentPage != currentPageWas) {
- m_suspendSignals = true;
- setCurrentPage(m_currentPage - 1);
- }
- if (m_suspendSignals) {
- emit currentPageChanged();
- m_suspendSignals = false;
- }
- const auto results = resultsOnPage(m_currentPage);
- currentResult = results.count() - 1;
- } else {
- const auto results = resultsOnPage(m_currentPage);
- if (currentResult >= results.count()) {
- setCurrentPage(m_currentPage + 1);
- while (resultsOnPage(m_currentPage).count() == 0 && m_currentPage != currentPageWas) {
- m_suspendSignals = true;
- setCurrentPage(m_currentPage + 1);
- }
- if (m_suspendSignals) {
- emit currentPageChanged();
- m_suspendSignals = false;
- }
- currentResult = 0;
- }
- }
- qCDebug(qLcS) << "currentResult was" << m_currentResult
- << "requested" << currentResultWas << "on page" << currentPageWas
- << "->" << currentResult << "on page" << m_currentPage;
-
- m_currentResult = currentResult;
- emit currentResultChanged();
- emit currentResultBoundingPolygonsChanged();
- emit currentResultBoundingRectChanged();
-}
-
-/*!
- \qmlproperty string PdfSearchModel::searchString
-
- The string to search for.
-*/
-
-QT_END_NAMESPACE
diff --git a/src/pdf/quick/qquickpdfsearchmodel_p.h b/src/pdf/quick/qquickpdfsearchmodel_p.h
deleted file mode 100644
index 66fc583d9..000000000
--- a/src/pdf/quick/qquickpdfsearchmodel_p.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKPDFSEARCHMODEL_P_H
-#define QQUICKPDFSEARCHMODEL_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "qquickpdfdocument_p.h"
-#include "../api/qpdfsearchmodel.h"
-
-#include <QtCore/qvariant.h>
-#include <QtQml/qqml.h>
-
-QT_BEGIN_NAMESPACE
-
-class QQuickPdfSearchModel : public QPdfSearchModel
-{
- Q_OBJECT
- Q_PROPERTY(QQuickPdfDocument *document READ document WRITE setDocument NOTIFY documentChanged)
- Q_PROPERTY(int currentPage READ currentPage WRITE setCurrentPage NOTIFY currentPageChanged)
- Q_PROPERTY(int currentResult READ currentResult WRITE setCurrentResult NOTIFY currentResultChanged)
- Q_PROPERTY(QVector<QPolygonF> currentPageBoundingPolygons READ currentPageBoundingPolygons NOTIFY currentPageBoundingPolygonsChanged)
- Q_PROPERTY(QVector<QPolygonF> currentResultBoundingPolygons READ currentResultBoundingPolygons NOTIFY currentResultBoundingPolygonsChanged)
- Q_PROPERTY(QRectF currentResultBoundingRect READ currentResultBoundingRect NOTIFY currentResultBoundingRectChanged)
-
-public:
- explicit QQuickPdfSearchModel(QObject *parent = nullptr);
-
- QQuickPdfDocument *document() const;
- void setDocument(QQuickPdfDocument * document);
-
- Q_INVOKABLE QVector<QPolygonF> boundingPolygonsOnPage(int page);
-
- int currentPage() const { return m_currentPage; }
- void setCurrentPage(int currentPage);
-
- int currentResult() const { return m_currentResult; }
- void setCurrentResult(int currentResult);
-
- QVector<QPolygonF> currentPageBoundingPolygons() const;
- QVector<QPolygonF> currentResultBoundingPolygons() const;
- QRectF currentResultBoundingRect() const;
-
-signals:
- void documentChanged();
- void currentPageChanged();
- void currentResultChanged();
- void currentPageBoundingPolygonsChanged();
- void currentResultBoundingPolygonsChanged();
- void currentResultBoundingRectChanged();
-
-private:
- void updateResults();
- void onResultsChanged();
-
-private:
- QQuickPdfDocument *m_quickDocument = nullptr;
- int m_currentPage = 0;
- int m_currentResult = 0;
- bool m_suspendSignals = false;
-
- Q_DISABLE_COPY(QQuickPdfSearchModel)
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QQuickPdfSearchModel)
-QML_DECLARE_TYPE(QPdfSelection)
-
-#endif // QQUICKPDFSEARCHMODEL_P_H
diff --git a/src/pdf/quick/qquickpdfselection.cpp b/src/pdf/quick/qquickpdfselection.cpp
deleted file mode 100644
index 23fbb80b9..000000000
--- a/src/pdf/quick/qquickpdfselection.cpp
+++ /dev/null
@@ -1,541 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickpdfselection_p.h"
-#include "qquickpdfdocument_p.h"
-#include <QClipboard>
-#include <QGuiApplication>
-#include <QLoggingCategory>
-#include <QQuickItem>
-#include <QQmlEngine>
-#include <QRegularExpression>
-#include <QStandardPaths>
-#include <QtPdf/private/qpdfdocument_p.h>
-
-Q_LOGGING_CATEGORY(qLcIm, "qt.pdf.im")
-
-QT_BEGIN_NAMESPACE
-
-static const QRegularExpression WordDelimiter("\\s");
-
-/*!
- \qmltype PdfSelection
- \instantiates QQuickPdfSelection
- \inqmlmodule QtQuick.Pdf
- \ingroup pdf
- \brief A representation of a text selection within a PDF Document.
- \since 5.15
-
- PdfSelection provides the text string and its geometry within a bounding box
- from one point to another.
-
- To modify the selection using the mouse, bind \l fromPoint and \l toPoint
- to the suitable properties of an input handler so that they will be set to
- the positions where the drag gesture begins and ends, respectively; and
- bind the \l hold property so that it will be set to \c true during the drag
- gesture and \c false when the gesture ends.
-
- PdfSelection also directly handles Input Method queries so that text
- selection handles can be used on platforms such as iOS. For this purpose,
- it must have keyboard focus.
-*/
-
-/*!
- Constructs a SearchModel.
-*/
-QQuickPdfSelection::QQuickPdfSelection(QQuickItem *parent)
- : QQuickItem(parent)
-{
-#if QT_CONFIG(im)
- setFlags(ItemIsFocusScope | ItemAcceptsInputMethod);
- // workaround to get Copy instead of Paste on the popover menu (QTBUG-83811)
- setProperty("qt_im_readonly", QVariant(true));
-#endif
-}
-
-QQuickPdfDocument *QQuickPdfSelection::document() const
-{
- return m_document;
-}
-
-void QQuickPdfSelection::setDocument(QQuickPdfDocument *document)
-{
- if (m_document == document)
- return;
-
- if (m_document) {
- disconnect(m_document, &QQuickPdfDocument::sourceChanged,
- this, &QQuickPdfSelection::resetPoints);
- }
- m_document = document;
- emit documentChanged();
- resetPoints();
- connect(m_document, &QQuickPdfDocument::sourceChanged,
- this, &QQuickPdfSelection::resetPoints);
-}
-
-/*!
- \qmlproperty list<list<point>> PdfSelection::geometry
-
- A set of paths in a form that can be bound to the \c paths property of a
- \l {QtQuick::PathMultiline}{PathMultiline} instance to render a batch of
- rectangles around the text regions that are included in the selection:
-
- \qml
- PdfDocument {
- id: doc
- }
- PdfSelection {
- id: selection
- document: doc
- fromPoint: textSelectionDrag.centroid.pressPosition
- toPoint: textSelectionDrag.centroid.position
- hold: !textSelectionDrag.active
- }
- Shape {
- ShapePath {
- PathMultiline {
- paths: selection.geometry
- }
- }
- }
- DragHandler {
- id: textSelectionDrag
- acceptedDevices: PointerDevice.Mouse | PointerDevice.Stylus
- target: null
- }
- \endqml
-
- \sa PathMultiline
-*/
-QVector<QPolygonF> QQuickPdfSelection::geometry() const
-{
- return m_geometry;
-}
-
-void QQuickPdfSelection::clear()
-{
- m_hitPoint = QPointF();
- m_fromPoint = QPointF();
- m_toPoint = QPointF();
- m_heightAtAnchor = 0;
- m_heightAtCursor = 0;
- m_fromCharIndex = -1;
- m_toCharIndex = -1;
- m_text.clear();
- m_geometry.clear();
- emit fromPointChanged();
- emit toPointChanged();
- emit textChanged();
- emit selectedAreaChanged();
- QGuiApplication::inputMethod()->update(Qt::ImQueryInput);
-}
-
-void QQuickPdfSelection::selectAll()
-{
- QPdfSelection sel = m_document->m_doc.getAllText(m_page);
- if (sel.text() != m_text) {
- m_text = sel.text();
- if (QGuiApplication::clipboard()->supportsSelection())
- sel.copyToClipboard(QClipboard::Selection);
- emit textChanged();
- }
-
- if (sel.bounds() != m_geometry) {
- m_geometry = sel.bounds();
- emit selectedAreaChanged();
- }
-#if QT_CONFIG(im)
- m_fromCharIndex = sel.startIndex();
- m_toCharIndex = sel.endIndex();
- if (sel.bounds().isEmpty()) {
- m_fromPoint = QPointF();
- m_toPoint = QPointF();
- } else {
- m_fromPoint = sel.bounds().first().boundingRect().topLeft() * m_renderScale;
- m_toPoint = sel.bounds().last().boundingRect().bottomRight() * m_renderScale - QPointF(0, m_heightAtCursor);
- }
-
- QGuiApplication::inputMethod()->update(Qt::ImCursorRectangle | Qt::ImAnchorRectangle);
-#endif
-}
-
-#if QT_CONFIG(im)
-void QQuickPdfSelection::keyReleaseEvent(QKeyEvent *ev)
-{
- qCDebug(qLcIm) << "release" << ev;
- const auto &allText = pageText();
- if (ev == QKeySequence::MoveToPreviousWord) {
- // iOS sends MoveToPreviousWord first to get to the beginning of the word,
- // and then SelectNextWord to select the whole word.
- int i = allText.lastIndexOf(WordDelimiter, m_fromCharIndex - allText.length());
- if (i < 0)
- i = 0;
- else
- i += 1; // don't select the space before the word
- auto sel = m_document->m_doc.getSelectionAtIndex(m_page, i, m_text.length() + m_fromCharIndex - i);
- update(sel);
- QGuiApplication::inputMethod()->update(Qt::ImAnchorRectangle);
- } else if (ev == QKeySequence::SelectNextWord) {
- int i = allText.indexOf(WordDelimiter, m_toCharIndex);
- if (i < 0)
- i = allText.length(); // go to the end of m_textAfter
- auto sel = m_document->m_doc.getSelectionAtIndex(m_page, m_fromCharIndex, m_text.length() + i - m_toCharIndex);
- update(sel);
- QGuiApplication::inputMethod()->update(Qt::ImCursorRectangle);
- } else if (ev == QKeySequence::Copy) {
- copyToClipboard();
- }
-}
-
-void QQuickPdfSelection::inputMethodEvent(QInputMethodEvent *event)
-{
- for (auto attr : event->attributes()) {
- switch (attr.type) {
- case QInputMethodEvent::Cursor:
- qCDebug(qLcIm) << "QInputMethodEvent::Cursor: moved to" << attr.start << "len" << attr.length;
- break;
- case QInputMethodEvent::Selection: {
- auto sel = m_document->m_doc.getSelectionAtIndex(m_page, attr.start, attr.length);
- update(sel);
- qCDebug(qLcIm) << "QInputMethodEvent::Selection: from" << attr.start << "len" << attr.length
- << "result:" << m_fromCharIndex << "->" << m_toCharIndex << sel.boundingRectangle();
- // the iOS plugin decided that it wanted to change the selection, but still has to be told to move the handles (!?)
- QGuiApplication::inputMethod()->update(Qt::ImCursorRectangle | Qt::ImAnchorRectangle);
- break;
- }
- case QInputMethodEvent::Language:
- case QInputMethodEvent::Ruby:
- case QInputMethodEvent::TextFormat:
- break;
- }
- }
-}
-
-QVariant QQuickPdfSelection::inputMethodQuery(Qt::InputMethodQuery query, const QVariant &argument) const
-{
- if (!argument.isNull()) {
- qCDebug(qLcIm) << "IM query" << query << "with arg" << argument;
- if (query == Qt::ImCursorPosition) {
- // If it didn't move since last time, return the same result.
- if (m_hitPoint == argument.toPointF())
- return inputMethodQuery(query);
- m_hitPoint = argument.toPointF();
- auto tp = m_document->m_doc.d->hitTest(m_page, m_hitPoint / m_renderScale);
- qCDebug(qLcIm) << "ImCursorPosition hit testing in px" << m_hitPoint << "pt" << (m_hitPoint / m_renderScale)
- << "got char index" << tp.charIndex << "@" << tp.position << "pt," << tp.position * m_renderScale << "px";
- if (tp.charIndex >= 0) {
- m_toCharIndex = tp.charIndex;
- m_toPoint = tp.position * m_renderScale - QPointF(0, m_heightAtCursor);
- m_heightAtCursor = tp.height * m_renderScale;
- if (qFuzzyIsNull(m_heightAtAnchor))
- m_heightAtAnchor = m_heightAtCursor;
- }
- }
- }
- return inputMethodQuery(query);
-}
-
-QVariant QQuickPdfSelection::inputMethodQuery(Qt::InputMethodQuery query) const
-{
- QVariant ret;
- switch (query) {
- case Qt::ImEnabled:
- ret = true;
- break;
- case Qt::ImHints:
- ret = QVariant(Qt::ImhMultiLine | Qt::ImhNoPredictiveText);
- break;
- case Qt::ImInputItemClipRectangle:
- ret = boundingRect();
- break;
- case Qt::ImAnchorPosition:
- ret = m_fromCharIndex;
- break;
- case Qt::ImAbsolutePosition:
- ret = m_toCharIndex;
- break;
- case Qt::ImCursorPosition:
- ret = m_toCharIndex;
- break;
- case Qt::ImAnchorRectangle:
- ret = QRectF(m_fromPoint, QSizeF(1, m_heightAtAnchor));
- break;
- case Qt::ImCursorRectangle:
- ret = QRectF(m_toPoint, QSizeF(1, m_heightAtCursor));
- break;
- case Qt::ImSurroundingText:
- ret = QVariant(pageText());
- break;
- case Qt::ImTextBeforeCursor:
- ret = QVariant(pageText().mid(0, m_toCharIndex));
- break;
- case Qt::ImTextAfterCursor:
- ret = QVariant(pageText().mid(m_toCharIndex));
- break;
- case Qt::ImCurrentSelection:
- ret = QVariant(m_text);
- break;
- case Qt::ImEnterKeyType:
- break;
- case Qt::ImFont: {
- QFont font = QGuiApplication::font();
- font.setPointSizeF(m_heightAtCursor);
- ret = font;
- break;
- }
- case Qt::ImMaximumTextLength:
- break;
- case Qt::ImPreferredLanguage:
- break;
- case Qt::ImPlatformData:
- break;
- case Qt::ImQueryInput:
- case Qt::ImQueryAll:
- qWarning() << "unexpected composite query";
- break;
- }
- qCDebug(qLcIm) << "IM query" << query << "returns" << ret;
- return ret;
-}
-#endif // QT_CONFIG(im)
-
-const QString &QQuickPdfSelection::pageText() const
-{
- if (m_pageTextDirty) {
- m_pageText = m_document->m_doc.getAllText(m_page).text();
- m_pageTextDirty = false;
- }
- return m_pageText;
-}
-
-void QQuickPdfSelection::resetPoints()
-{
- bool wasHolding = m_hold;
- m_hold = false;
- setFromPoint(QPointF());
- setToPoint(QPointF());
- m_hold = wasHolding;
-}
-
-/*!
- \qmlproperty int PdfSelection::page
-
- The page number on which to search.
-
- \sa QtQuick::Image::currentFrame
-*/
-int QQuickPdfSelection::page() const
-{
- return m_page;
-}
-
-void QQuickPdfSelection::setPage(int page)
-{
- if (m_page == page)
- return;
-
- m_page = page;
- m_pageTextDirty = true;
- emit pageChanged();
- resetPoints();
-}
-
-/*!
- \qmlproperty real PdfSelection::renderScale
- \brief The ratio from points to pixels at which the page is rendered.
-
- This is used to scale \l fromPoint and \l toPoint to find ranges of
- selected characters in the document, because positions within the document
- are always given in points.
-*/
-qreal QQuickPdfSelection::renderScale() const
-{
- return m_renderScale;
-}
-
-void QQuickPdfSelection::setRenderScale(qreal scale)
-{
- if (qFuzzyCompare(scale, m_renderScale))
- return;
-
- m_renderScale = scale;
- emit renderScaleChanged();
- updateResults();
-}
-
-/*!
- \qmlproperty point PdfSelection::fromPoint
-
- The beginning location, in pixels from the upper-left corner of the page,
- from which to find selected text. This can be bound to the
- \c centroid.pressPosition of a \l DragHandler to begin selecting text from
- the position where the user presses the mouse button and begins dragging,
- for example.
-*/
-QPointF QQuickPdfSelection::fromPoint() const
-{
- return m_fromPoint;
-}
-
-void QQuickPdfSelection::setFromPoint(QPointF fromPoint)
-{
- if (m_hold || m_fromPoint == fromPoint)
- return;
-
- m_fromPoint = fromPoint;
- emit fromPointChanged();
- updateResults();
-}
-
-/*!
- \qmlproperty point PdfSelection::toPoint
-
- The ending location, in pixels from the upper-left corner of the page,
- from which to find selected text. This can be bound to the
- \c centroid.position of a \l DragHandler to end selection of text at the
- position where the user is currently dragging the mouse, for example.
-*/
-QPointF QQuickPdfSelection::toPoint() const
-{
- return m_toPoint;
-}
-
-void QQuickPdfSelection::setToPoint(QPointF toPoint)
-{
- if (m_hold || m_toPoint == toPoint)
- return;
-
- m_toPoint = toPoint;
- emit toPointChanged();
- updateResults();
-}
-
-/*!
- \qmlproperty bool PdfSelection::hold
-
- Controls whether to hold the existing selection regardless of changes to
- \l fromPoint and \l toPoint. This property can be set to \c true when the mouse
- or touchpoint is released, so that the selection is not lost due to the
- point bindings changing.
-*/
-bool QQuickPdfSelection::hold() const
-{
- return m_hold;
-}
-
-void QQuickPdfSelection::setHold(bool hold)
-{
- if (m_hold == hold)
- return;
-
- m_hold = hold;
- emit holdChanged();
-}
-
-/*!
- \qmlproperty string PdfSelection::string
-
- The string found.
-*/
-QString QQuickPdfSelection::text() const
-{
- return m_text;
-}
-
-#if QT_CONFIG(clipboard)
-/*!
- \qmlmethod void PdfSelection::copyToClipboard()
-
- Copies plain text from the \l string property to the system clipboard.
-*/
-void QQuickPdfSelection::copyToClipboard() const
-{
- QGuiApplication::clipboard()->setText(m_text);
-}
-#endif
-
-void QQuickPdfSelection::updateResults()
-{
- if (!m_document)
- return;
- QPdfSelection sel = m_document->document().getSelection(m_page,
- m_fromPoint / m_renderScale, m_toPoint / m_renderScale);
- update(sel, true);
-}
-
-void QQuickPdfSelection::update(const QPdfSelection &sel, bool textAndGeometryOnly)
-{
- if (sel.text() != m_text) {
- m_text = sel.text();
- if (QGuiApplication::clipboard()->supportsSelection())
- sel.copyToClipboard(QClipboard::Selection);
- emit textChanged();
- }
-
- if (sel.bounds() != m_geometry) {
- m_geometry = sel.bounds();
- emit selectedAreaChanged();
- }
-
- if (textAndGeometryOnly)
- return;
-
- m_fromCharIndex = sel.startIndex();
- m_toCharIndex = sel.endIndex();
- if (sel.bounds().isEmpty()) {
- m_fromPoint = sel.boundingRectangle().topLeft() * m_renderScale;
- m_toPoint = m_fromPoint;
- } else {
- Qt::InputMethodQueries toUpdate = {};
- QRectF firstLineBounds = sel.bounds().first().boundingRect();
- m_fromPoint = firstLineBounds.topLeft() * m_renderScale;
- if (!qFuzzyCompare(m_heightAtAnchor, firstLineBounds.height())) {
- m_heightAtAnchor = firstLineBounds.height() * m_renderScale;
- toUpdate.setFlag(Qt::ImAnchorRectangle);
- }
- QRectF lastLineBounds = sel.bounds().last().boundingRect();
- if (!qFuzzyCompare(m_heightAtCursor, lastLineBounds.height())) {
- m_heightAtCursor = lastLineBounds.height() * m_renderScale;
- toUpdate.setFlag(Qt::ImCursorRectangle);
- }
- m_toPoint = lastLineBounds.topRight() * m_renderScale;
- if (toUpdate)
- QGuiApplication::inputMethod()->update(toUpdate);
- }
-}
-
-QT_END_NAMESPACE
diff --git a/src/pdf/quick/qquickpdfselection_p.h b/src/pdf/quick/qquickpdfselection_p.h
deleted file mode 100644
index fb5b2901b..000000000
--- a/src/pdf/quick/qquickpdfselection_p.h
+++ /dev/null
@@ -1,148 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKPDFSELECTION_P_H
-#define QQUICKPDFSELECTION_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QPointF>
-#include <QPolygonF>
-#include <QVariant>
-#include <QtQml/qqml.h>
-#include <QtQuick/qquickitem.h>
-
-QT_BEGIN_NAMESPACE
-
-class QPdfSelection;
-class QQuickPdfDocument;
-
-class QQuickPdfSelection : public QQuickItem
-{
- Q_OBJECT
- Q_PROPERTY(QQuickPdfDocument *document READ document WRITE setDocument NOTIFY documentChanged)
- Q_PROPERTY(int page READ page WRITE setPage NOTIFY pageChanged)
- Q_PROPERTY(qreal renderScale READ renderScale WRITE setRenderScale NOTIFY renderScaleChanged)
- Q_PROPERTY(QPointF fromPoint READ fromPoint WRITE setFromPoint NOTIFY fromPointChanged)
- Q_PROPERTY(QPointF toPoint READ toPoint WRITE setToPoint NOTIFY toPointChanged)
- Q_PROPERTY(bool hold READ hold WRITE setHold NOTIFY holdChanged)
-
- Q_PROPERTY(QString text READ text NOTIFY textChanged)
- Q_PROPERTY(QVector<QPolygonF> geometry READ geometry NOTIFY selectedAreaChanged)
-
-public:
- explicit QQuickPdfSelection(QQuickItem *parent = nullptr);
-
- QQuickPdfDocument *document() const;
- void setDocument(QQuickPdfDocument * document);
- int page() const;
- void setPage(int page);
- qreal renderScale() const;
- void setRenderScale(qreal scale);
- QPointF fromPoint() const;
- void setFromPoint(QPointF fromPoint);
- QPointF toPoint() const;
- void setToPoint(QPointF toPoint);
- bool hold() const;
- void setHold(bool hold);
-
- QString text() const;
- QVector<QPolygonF> geometry() const;
-
- Q_INVOKABLE void clear();
- Q_INVOKABLE void selectAll();
-#if QT_CONFIG(clipboard)
- Q_INVOKABLE void copyToClipboard() const;
-#endif
-
-signals:
- void documentChanged();
- void pageChanged();
- void renderScaleChanged();
- void fromPointChanged();
- void toPointChanged();
- void holdChanged();
- void textChanged();
- void selectedAreaChanged();
-
-protected:
-#if QT_CONFIG(im)
- void keyReleaseEvent(QKeyEvent *ev) override;
- void inputMethodEvent(QInputMethodEvent *event) override;
- Q_INVOKABLE QVariant inputMethodQuery(Qt::InputMethodQuery query, const QVariant &argument) const;
- QVariant inputMethodQuery(Qt::InputMethodQuery query) const override;
-#endif
-
-private:
- void resetPoints();
- void updateResults();
- void update(const QPdfSelection &sel, bool textAndGeometryOnly = false);
- const QString &pageText() const;
-
-private:
- QQuickPdfDocument *m_document = nullptr;
- mutable QPointF m_hitPoint;
- QPointF m_fromPoint;
- mutable QPointF m_toPoint;
- qreal m_renderScale = 1;
- mutable qreal m_heightAtAnchor = 0;
- mutable qreal m_heightAtCursor = 0;
- QString m_text; // selected text
- mutable QString m_pageText; // all text on the page
- QVector<QPolygonF> m_geometry;
- int m_page = 0;
- int m_fromCharIndex = -1; // same as anchor position
- mutable int m_toCharIndex = -1; // same as cursor position
- bool m_hold = false;
- mutable bool m_pageTextDirty = true;
-
- Q_DISABLE_COPY(QQuickPdfSelection)
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QQuickPdfSelection)
-
-#endif // QQUICKPDFSELECTION_P_H
diff --git a/src/pdf/quick/qquicktableviewextra.cpp b/src/pdf/quick/qquicktableviewextra.cpp
deleted file mode 100644
index 601dfff7b..000000000
--- a/src/pdf/quick/qquicktableviewextra.cpp
+++ /dev/null
@@ -1,194 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquicktableviewextra_p.h"
-#include <QtQml>
-#include <QQmlContext>
-#include <QtQuick/private/qquicktableview_p.h>
-
-Q_LOGGING_CATEGORY(qLcTVE, "qt.pdf.tableextra")
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \internal
- \qmltype TableViewExtra
- \instantiates QQuickTableViewExtra
- \inqmlmodule QtQuick.Pdf
- \ingroup pdf
- \brief A helper class with missing TableView functions
- \since 5.15
-
- TableViewExtra provides equivalents for some functions that will be added
- to TableView in Qt 6.
-*/
-
-QQuickTableViewExtra::QQuickTableViewExtra(QObject *parent) : QObject(parent)
-{
-}
-
-QPoint QQuickTableViewExtra::cellAtPos(qreal x, qreal y) const
-{
- QPointF position(x, y);
-#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
- return m_tableView->cellAtPos(position);
-#else
- if (!m_tableView->boundingRect().contains(position))
- return QPoint(-1, -1);
-
- const QQuickItem *contentItem = m_tableView->contentItem();
-
- for (const QQuickItem *child : contentItem->childItems()) {
- const QPointF posInChild = m_tableView->mapToItem(child, position);
- if (child->boundingRect().contains(posInChild)) {
- const auto context = qmlContext(child);
- const int column = context->contextProperty("column").toInt();
- const int row = context->contextProperty("row").toInt();
- return QPoint(column, row);
- }
- }
-
- return QPoint(-1, -1);
-#endif
-}
-
-QQuickItem *QQuickTableViewExtra::itemAtCell(const QPoint &cell) const
-{
-#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
- return m_tableView->itemAtCell(cell);
-#else
- const QQuickItem *contentItem = m_tableView->contentItem();
-
- for (QQuickItem *child : contentItem->childItems()) {
- const auto context = qmlContext(child);
- const int column = context->contextProperty("column").toInt();
- const int row = context->contextProperty("row").toInt();
- if (QPoint(column, row) == cell)
- return child;
- }
-
- return nullptr;
-#endif
-}
-
-void QQuickTableViewExtra::positionViewAtCell(const QPoint &cell, Qt::Alignment alignment, const QPointF &offset)
-{
-#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
- m_tableView->positionViewAtCell(cell, alignment, offset);
-#else
- // Note: this fallback implementation assumes all cells to be of the same size!
-
- if (cell.x() < 0 || cell.x() > m_tableView->columns() - 1)
- return;
- if (cell.y() < 0 || cell.y() > m_tableView->rows() - 1)
- return;
-
- Qt::Alignment verticalAlignment = alignment & (Qt::AlignTop | Qt::AlignVCenter | Qt::AlignBottom);
- Qt::Alignment horizontalAlignment = alignment & (Qt::AlignLeft | Qt::AlignHCenter | Qt::AlignRight);
-
- const QQuickItem *contentItem = m_tableView->contentItem();
- const QQuickItem *randomChild = contentItem->childItems().first();
- const qreal cellWidth = randomChild->width();
- const qreal cellHeight = randomChild->height();
-
- if (!verticalAlignment && !horizontalAlignment) {
- qmlWarning(this) << "No valid alignment specified";
- return;
- }
-
- if (horizontalAlignment) {
- qreal newPosX = 0;
- const qreal columnPosLeft = int(cell.x() * (cellWidth + m_tableView->columnSpacing()));
- m_tableView->setContentX(0);
- m_tableView->forceLayout();
- m_tableView->setContentX(columnPosLeft);
- m_tableView->forceLayout();
-
- switch (horizontalAlignment) {
- case Qt::AlignLeft:
- newPosX = m_tableView->contentX() + offset.x();
- break;
- case Qt::AlignHCenter:
- newPosX = m_tableView->contentX()
- - m_tableView->width() / 2
- + (cellWidth / 2)
- + offset.x();
- break;
- case Qt::AlignRight:
- newPosX = m_tableView->contentX()
- - m_tableView->width()
- + cellWidth
- + offset.x();
- break;
- }
-
- m_tableView->setContentX(newPosX);
- m_tableView->forceLayout();
- }
-
- if (verticalAlignment) {
- qreal newPosY = 0;
- const qreal rowPosTop = int(cell.y() * (cellHeight + m_tableView->rowSpacing()));
- m_tableView->setContentY(0);
- m_tableView->forceLayout();
- m_tableView->setContentY(rowPosTop);
- m_tableView->forceLayout();
-
- switch (verticalAlignment) {
- case Qt::AlignTop:
- newPosY = m_tableView->contentY() + offset.y();
- break;
- case Qt::AlignVCenter:
- newPosY = m_tableView->contentY()
- - m_tableView->height() / 2
- + (cellHeight / 2)
- + offset.y();
- break;
- case Qt::AlignBottom:
- newPosY = m_tableView->contentY()
- - m_tableView->height()
- + cellHeight
- + offset.y();
- break;
- }
-
- m_tableView->setContentY(newPosY);
- m_tableView->forceLayout();
- }
-#endif
-}
-
-QT_END_NAMESPACE
diff --git a/src/pdf/quick/qquicktableviewextra_p.h b/src/pdf/quick/qquicktableviewextra_p.h
deleted file mode 100644
index cd3035be5..000000000
--- a/src/pdf/quick/qquicktableviewextra_p.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKTABLEVIEWEXTRA_P_H
-#define QQUICKTABLEVIEWEXTRA_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QPointF>
-#include <QPolygonF>
-#include <QVariant>
-#include <QtQml/qqml.h>
-#include <QtQuick/qquickitem.h>
-
-QT_BEGIN_NAMESPACE
-
-class QQuickTableView;
-
-class QQuickTableViewExtra : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(QQuickTableView *tableView READ tableView WRITE setTableView)
-
-public:
- QQuickTableViewExtra(QObject *parent = nullptr);
-
- QQuickTableView * tableView() const { return m_tableView; }
- void setTableView(QQuickTableView * tableView) { m_tableView = tableView; }
-
- Q_INVOKABLE QPoint cellAtPos(qreal x, qreal y) const;
- Q_INVOKABLE QQuickItem *itemAtCell(int column, int row) const {
- return itemAtCell(QPoint(column, row));
- }
- Q_INVOKABLE QQuickItem *itemAtCell(const QPoint &cell) const;
- Q_INVOKABLE void positionViewAtCell(int column, int row, Qt::Alignment alignment, const QPointF &offset = QPointF()) {
- positionViewAtCell(QPoint(column, row), alignment, offset);
- }
- Q_INVOKABLE void positionViewAtCell(const QPoint &cell, Qt::Alignment alignment, const QPointF &offset);
- Q_INVOKABLE void positionViewAtRow(int row, Qt::Alignment alignment, qreal offset = 0) {
- positionViewAtCell(QPoint(0, row), alignment & Qt::AlignVertical_Mask, QPointF(0, offset));
- }
-
-private:
- QQuickTableView *m_tableView = nullptr;
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QQuickTableViewExtra)
-
-#endif // QQUICKTABLEVIEWEXTRA_P_H
diff --git a/src/pdf/quick/quick.pro b/src/pdf/quick/quick.pro
deleted file mode 100644
index bd6bc8827..000000000
--- a/src/pdf/quick/quick.pro
+++ /dev/null
@@ -1,40 +0,0 @@
-CXX_MODULE = qml
-TARGET = pdfplugin
-TARGETPATH = QtQuick/Pdf
-IMPORT_VERSION = 1.0
-
-# qpdfdocument_p.h includes pdfium headers which we must find in order to use private API
-CHROMIUM_SRC_DIR = $$QTWEBENGINE_ROOT/$$getChromiumSrcDir()
-INCLUDEPATH += $$CHROMIUM_SRC_DIR
-
-#QMAKE_DOCS = $$PWD/doc/qtquickpdf.qdocconf
-
-PDF_QML_FILES = \
- qml/PdfMultiPageView.qml \
- qml/PdfPageView.qml \
- qml/PdfScrollablePageView.qml \
-
-QML_FILES += $$PDF_QML_FILES qmldir
-
-RESOURCES += resources.qrc
-
-SOURCES += \
- plugin.cpp \
- qquickpdfdocument.cpp \
- qquickpdflinkmodel.cpp \
- qquickpdfnavigationstack.cpp \
- qquickpdfsearchmodel.cpp \
- qquickpdfselection.cpp \
- qquicktableviewextra.cpp \
-
-HEADERS += \
- qquickpdfdocument_p.h \
- qquickpdflinkmodel_p.h \
- qquickpdfnavigationstack_p.h \
- qquickpdfsearchmodel_p.h \
- qquickpdfselection_p.h \
- qquicktableviewextra_p.h \
-
-QT += pdf pdf-private gui core qml quick quick-private
-
-load(qml_plugin)
diff --git a/src/pdf/quick/resources.qrc b/src/pdf/quick/resources.qrc
deleted file mode 100644
index 8270a2028..000000000
--- a/src/pdf/quick/resources.qrc
+++ /dev/null
@@ -1,10 +0,0 @@
-<RCC>
- <qresource prefix="/qt-project.org/qtpdf">
- <file>qml/+material/PdfStyle.qml</file>
- <file>qml/+universal/PdfStyle.qml</file>
- <file>qml/PdfStyle.qml</file>
- <file>qml/PdfMultiPageView.qml</file>
- <file>qml/PdfPageView.qml</file>
- <file>qml/PdfScrollablePageView.qml</file>
- </qresource>
-</RCC>
diff --git a/src/pdfquick/+Material/PdfStyle.qml b/src/pdfquick/+Material/PdfStyle.qml
new file mode 100644
index 000000000..0728616a2
--- /dev/null
+++ b/src/pdfquick/+Material/PdfStyle.qml
@@ -0,0 +1,15 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+import QtQuick
+import QtQuick.Controls.Material
+
+QtObject {
+ property SystemPalette palette: SystemPalette { }
+ function withAlpha(color, alpha) {
+ return Qt.hsla(color.hslHue, color.hslSaturation, color.hslLightness, alpha)
+ }
+ property color selectionColor: withAlpha(palette.highlight, 0.5)
+ property color pageSearchResultsColor: withAlpha(Qt.lighter(Material.accentColor, 1.5), 0.5)
+ property color currentSearchResultStrokeColor: Material.accentColor
+ property real currentSearchResultStrokeWidth: 2
+}
diff --git a/src/pdfquick/+Universal/PdfStyle.qml b/src/pdfquick/+Universal/PdfStyle.qml
new file mode 100644
index 000000000..4c559f068
--- /dev/null
+++ b/src/pdfquick/+Universal/PdfStyle.qml
@@ -0,0 +1,15 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+import QtQuick
+import QtQuick.Controls.Universal
+
+QtObject {
+ property SystemPalette palette: SystemPalette { }
+ function withAlpha(color, alpha) {
+ return Qt.hsla(color.hslHue, color.hslSaturation, color.hslLightness, alpha)
+ }
+ property color selectionColor: withAlpha(palette.highlight, 0.5)
+ property color pageSearchResultsColor: withAlpha(Qt.lighter(Universal.accent, 1.5), 0.5)
+ property color currentSearchResultStrokeColor: Universal.accent
+ property real currentSearchResultStrokeWidth: 2
+}
diff --git a/src/pdfquick/CMakeLists.txt b/src/pdfquick/CMakeLists.txt
new file mode 100644
index 000000000..d57ce04aa
--- /dev/null
+++ b/src/pdfquick/CMakeLists.txt
@@ -0,0 +1,41 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS Core Gui Qml Quick)
+
+set(qml_files
+ "+Material/PdfStyle.qml"
+ "+Universal/PdfStyle.qml"
+ "PdfLinkDelegate.qml"
+ "PdfMultiPageView.qml"
+ "PdfPageView.qml"
+ "PdfScrollablePageView.qml"
+ "PdfStyle.qml"
+)
+
+qt_internal_add_qml_module(PdfQuick
+ URI "QtQuick.Pdf"
+ VERSION "${PROJECT_VERSION}"
+ PAST_MAJOR_VERSIONS 5
+ QML_FILES ${qml_files}
+ DEPENDENCIES QtQuick/auto
+ SOURCES
+ qquickpdfbookmarkmodel.cpp qquickpdfbookmarkmodel_p.h
+ qquickpdfdocument.cpp qquickpdfdocument_p.h
+ qquickpdflinkmodel.cpp qquickpdflinkmodel_p.h
+ qquickpdfpagenavigator.cpp qquickpdfpagenavigator_p.h
+ qquickpdfpageimage.cpp qquickpdfpageimage_p.h
+ qquickpdfsearchmodel.cpp qquickpdfsearchmodel_p.h
+ qquickpdfselection.cpp qquickpdfselection_p.h
+ qtpdfquickglobal_p.h
+ INCLUDE_DIRECTORIES
+ ../3rdparty/chromium
+ PUBLIC_LIBRARIES
+ Qt::QuickPrivate
+ Qt::PdfPrivate
+ Qt::Core
+ Qt::Gui
+ Qt::Qml
+ NO_GENERATE_CPP_EXPORTS
+)
+
diff --git a/src/pdfquick/PdfLinkDelegate.qml b/src/pdfquick/PdfLinkDelegate.qml
new file mode 100644
index 000000000..4ac54d161
--- /dev/null
+++ b/src/pdfquick/PdfLinkDelegate.qml
@@ -0,0 +1,74 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+import QtQuick
+import QtQuick.Controls
+
+/*!
+ \qmltype PdfLinkDelegate
+ \inqmlmodule QtQuick.Pdf
+ \brief A component to decorate hyperlinks on a PDF page.
+
+ PdfLinkDelegate provides the component that QML-based PDF viewers
+ instantiate on top of each hyperlink that is found on each PDF page.
+
+ This component does not provide any visual decoration, because often the
+ hyperlinks will already be formatted in a distinctive way; but when the
+ mouse cursor hovers, it changes to Qt::PointingHandCursor, and a tooltip
+ appears after a delay. Clicking emits the goToLocation() signal if the link
+ is internal, or calls Qt.openUrlExternally() if the link contains a URL.
+
+ \sa PdfPageView, PdfScrollablePageView, PdfMultiPageView
+*/
+Item {
+ id: root
+ required property var link
+ required property rect rectangle
+ required property url url
+ required property int page
+ required property point location
+ required property real zoom
+
+ /*!
+ \qmlsignal PdfLinkDelegate::tapped(link)
+
+ Emitted on mouse click or touch tap. The \a link argument is an
+ instance of QPdfLink with information about the hyperlink.
+ */
+ signal tapped(var link)
+
+ /*!
+ \qmlsignal PdfLinkDelegate::contextMenuRequested(link)
+
+ Emitted on mouse right-click or touch long-press. The \a link argument
+ is an instance of QPdfLink with information about the hyperlink.
+ */
+ signal contextMenuRequested(var link)
+
+ HoverHandler {
+ id: linkHH
+ cursorShape: Qt.PointingHandCursor
+ }
+ TapHandler {
+ gesturePolicy: TapHandler.ReleaseWithinBounds
+ onTapped: root.tapped(root.link)
+ }
+ TapHandler {
+ acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad | PointerDevice.Stylus
+ acceptedButtons: Qt.RightButton
+ gesturePolicy: TapHandler.ReleaseWithinBounds
+ onTapped: root.contextMenuRequested(root.link)
+ }
+ TapHandler {
+ acceptedDevices: PointerDevice.TouchScreen
+ onLongPressed: root.contextMenuRequested(root.link)
+ }
+ ToolTip {
+ visible: linkHH.hovered
+ delay: 1000
+ property string destFormat: qsTr("Page %1 location %2, %3 zoom %4")
+ text: root.page >= 0 ?
+ destFormat.arg(root.page + 1).arg(root.location.x.toFixed(1))
+ .arg(root.location.y.toFixed(1)).arg(root.zoom) :
+ root.url
+ }
+}
diff --git a/src/pdfquick/PdfMultiPageView.qml b/src/pdfquick/PdfMultiPageView.qml
new file mode 100644
index 000000000..194d7866e
--- /dev/null
+++ b/src/pdfquick/PdfMultiPageView.qml
@@ -0,0 +1,623 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+pragma ComponentBehavior: Bound
+
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Pdf
+import QtQuick.Shapes
+
+/*!
+ \qmltype PdfMultiPageView
+ \inqmlmodule QtQuick.Pdf
+ \brief A complete PDF viewer component for scrolling through multiple pages.
+
+ PdfMultiPageView provides a PDF viewer component that offers a user
+ experience similar to many common PDF viewer applications. It supports
+ flicking through the pages in the entire document, with narrow gaps between
+ the page images.
+
+ PdfMultiPageView also supports selecting text and copying it to the
+ clipboard, zooming in and out, clicking an internal link to jump to another
+ section in the document, rotating the view, and searching for text. The
+ \l {PDF Multipage Viewer Example} demonstrates how to use these features
+ in an application.
+
+ The implementation is a QML assembly of smaller building blocks that are
+ available separately. In case you want to make changes in your own version
+ of this component, you can copy the QML, which is installed into the
+ \c QtQuick/Pdf/qml module directory, and modify it as needed.
+
+ \sa PdfPageView, PdfScrollablePageView, PdfStyle
+*/
+Item {
+ /*!
+ \qmlproperty PdfDocument PdfMultiPageView::document
+
+ A PdfDocument object with a valid \c source URL is required:
+
+ \snippet multipageview.qml 0
+ */
+ required property PdfDocument document
+
+ /*!
+ \qmlproperty PdfDocument PdfMultiPageView::selectedText
+
+ The selected text.
+ */
+ property string selectedText
+
+ /*!
+ \qmlmethod void PdfMultiPageView::selectAll()
+
+ Selects all the text on the \l {currentPage}{current page}, and makes it
+ available as the system \l {QClipboard::Selection}{selection} on systems
+ that support that feature.
+
+ \sa copySelectionToClipboard()
+ */
+ function selectAll() {
+ const currentItem = tableView.itemAtCell(tableView.cellAtPos(root.width / 2, root.height / 2))
+ const pdfSelection = currentItem?.selection as PdfSelection
+ pdfSelection?.selectAll()
+ }
+
+ /*!
+ \qmlmethod void PdfMultiPageView::copySelectionToClipboard()
+
+ Copies the selected text (if any) to the
+ \l {QClipboard::Clipboard}{system clipboard}.
+
+ \sa selectAll()
+ */
+ function copySelectionToClipboard() {
+ const currentItem = tableView.itemAtCell(tableView.cellAtPos(root.width / 2, root.height / 2))
+ const pdfSelection = currentItem?.selection as PdfSelection
+ console.log(lcMPV, "currentItem", currentItem, "sel", pdfSelection?.text)
+ pdfSelection?.copyToClipboard()
+ }
+
+ // --------------------------------
+ // page navigation
+
+ /*!
+ \qmlproperty int PdfMultiPageView::currentPage
+ \readonly
+
+ This property holds the zero-based page number of the page visible in the
+ scrollable view. If there is no current page, it holds -1.
+
+ This property is read-only, and is typically used in a binding (or
+ \c onCurrentPageChanged script) to update the part of the user interface
+ that shows the current page number, such as a \l SpinBox.
+
+ \sa PdfPageNavigator::currentPage
+ */
+ property alias currentPage: pageNavigator.currentPage
+
+ /*!
+ \qmlproperty bool PdfMultiPageView::backEnabled
+ \readonly
+
+ This property indicates if it is possible to go back in the navigation
+ history to a previous-viewed page.
+
+ \sa PdfPageNavigator::backAvailable, back()
+ */
+ property alias backEnabled: pageNavigator.backAvailable
+
+ /*!
+ \qmlproperty bool PdfMultiPageView::forwardEnabled
+ \readonly
+
+ This property indicates if it is possible to go to next location in the
+ navigation history.
+
+ \sa PdfPageNavigator::forwardAvailable, forward()
+ */
+ property alias forwardEnabled: pageNavigator.forwardAvailable
+
+ /*!
+ \qmlmethod void PdfMultiPageView::back()
+
+ Scrolls the view back to the previous page that the user visited most
+ recently; or does nothing if there is no previous location on the
+ navigation stack.
+
+ \sa PdfPageNavigator::back(), currentPage, backEnabled
+ */
+ function back() { pageNavigator.back() }
+
+ /*!
+ \qmlmethod void PdfMultiPageView::forward()
+
+ Scrolls the view to the page that the user was viewing when the back()
+ method was called; or does nothing if there is no "next" location on the
+ navigation stack.
+
+ \sa PdfPageNavigator::forward(), currentPage
+ */
+ function forward() { pageNavigator.forward() }
+
+ /*!
+ \qmlmethod void PdfMultiPageView::goToPage(int page)
+
+ Scrolls the view to the given \a page number, if possible.
+
+ \sa PdfPageNavigator::jump(), currentPage
+ */
+ function goToPage(page) {
+ if (page === pageNavigator.currentPage)
+ return
+ goToLocation(page, Qt.point(-1, -1), 0)
+ }
+
+ /*!
+ \qmlmethod void PdfMultiPageView::goToLocation(int page, point location, real zoom)
+
+ Scrolls the view to the \a location on the \a page, if possible,
+ and sets the \a zoom level.
+
+ \sa PdfPageNavigator::jump(), currentPage
+ */
+ function goToLocation(page, location, zoom) {
+ if (tableView.rows === 0) {
+ // save this request for later
+ tableView.pendingRow = page
+ tableView.pendingLocation = location
+ tableView.pendingZoom = zoom
+ return
+ }
+ if (zoom > 0) {
+ pageNavigator.jumping = true // don't call pageNavigator.update() because we will jump() instead
+ root.renderScale = zoom
+ pageNavigator.jumping = false
+ }
+ pageNavigator.jump(page, location, zoom) // actually jump
+ }
+
+ /*!
+ \qmlproperty int PdfMultiPageView::currentPageRenderingStatus
+
+ This property holds the \l {QtQuick::Image::status}{rendering status} of
+ the \l {currentPage}{current page}.
+ */
+ property int currentPageRenderingStatus: Image.Null
+
+ // --------------------------------
+ // page scaling
+
+ /*!
+ \qmlproperty real PdfMultiPageView::renderScale
+
+ This property holds the ratio of pixels to points. The default is \c 1,
+ meaning one point (1/72 of an inch) equals 1 logical pixel.
+ */
+ property real renderScale: 1
+
+ /*!
+ \qmlproperty real PdfMultiPageView::pageRotation
+
+ This property holds the clockwise rotation of the pages.
+
+ The default value is \c 0 degrees (that is, no rotation relative to the
+ orientation of the pages as stored in the PDF file).
+ */
+ property real pageRotation: 0
+
+ /*!
+ \qmlmethod void PdfMultiPageView::resetScale()
+
+ Sets \l renderScale back to its default value of \c 1.
+ */
+ function resetScale() { root.renderScale = 1 }
+
+ /*!
+ \qmlmethod void PdfMultiPageView::scaleToWidth(real width, real height)
+
+ Sets \l renderScale such that the width of the first page will fit into a
+ viewport with the given \a width and \a height. If the page is not rotated,
+ it will be scaled so that its width fits \a width. If it is rotated +/- 90
+ degrees, it will be scaled so that its width fits \a height.
+ */
+ function scaleToWidth(width, height) {
+ root.renderScale = width / (tableView.rot90 ? tableView.firstPagePointSize.height : tableView.firstPagePointSize.width)
+ }
+
+ /*!
+ \qmlmethod void PdfMultiPageView::scaleToPage(real width, real height)
+
+ Sets \l renderScale such that the whole first page will fit into a viewport
+ with the given \a width and \a height. The resulting \l renderScale depends
+ on \l pageRotation: the page will fit into the viewport at a larger size if
+ it is first rotated to have a matching aspect ratio.
+ */
+ function scaleToPage(width, height) {
+ const windowAspect = width / height
+ const pageAspect = tableView.firstPagePointSize.width / tableView.firstPagePointSize.height
+ if (tableView.rot90) {
+ if (windowAspect > pageAspect) {
+ root.renderScale = height / tableView.firstPagePointSize.width
+ } else {
+ root.renderScale = width / tableView.firstPagePointSize.height
+ }
+ } else {
+ if (windowAspect > pageAspect) {
+ root.renderScale = height / tableView.firstPagePointSize.height
+ } else {
+ root.renderScale = width / tableView.firstPagePointSize.width
+ }
+ }
+ }
+
+ // --------------------------------
+ // text search
+
+ /*!
+ \qmlproperty PdfSearchModel PdfMultiPageView::searchModel
+
+ This property holds a PdfSearchModel containing the list of search results
+ for a given \l searchString.
+
+ \sa PdfSearchModel
+ */
+ property alias searchModel: searchModel
+
+ /*!
+ \qmlproperty string PdfMultiPageView::searchString
+
+ This property holds the search string that the user may choose to search
+ for. It is typically used in a binding to the \c text property of a
+ TextField.
+
+ \sa searchModel
+ */
+ property alias searchString: searchModel.searchString
+
+ /*!
+ \qmlmethod void PdfMultiPageView::searchBack()
+
+ Decrements the
+ \l{PdfSearchModel::currentResult}{searchModel's current result}
+ so that the view will jump to the previous search result.
+ */
+ function searchBack() { --searchModel.currentResult }
+
+ /*!
+ \qmlmethod void PdfMultiPageView::searchForward()
+
+ Increments the
+ \l{PdfSearchModel::currentResult}{searchModel's current result}
+ so that the view will jump to the next search result.
+ */
+ function searchForward() { ++searchModel.currentResult }
+
+ LoggingCategory {
+ id: lcMPV
+ name: "qt.pdf.multipageview"
+ }
+
+ id: root
+ PdfStyle { id: style }
+ TableView {
+ id: tableView
+ property bool debug: false
+ property real minScale: 0.1
+ property real maxScale: 10
+ property point jumpLocationMargin: Qt.point(10, 10) // px away from viewport edges
+ anchors.fill: parent
+ anchors.leftMargin: 2
+ model: root.document ? root.document.pageCount : 0
+ rowSpacing: 6
+ property real rotationNorm: Math.round((360 + (root.pageRotation % 360)) % 360)
+ property bool rot90: rotationNorm == 90 || rotationNorm == 270
+ onRot90Changed: forceLayout()
+ onHeightChanged: forceLayout()
+ onWidthChanged: forceLayout()
+ property size firstPagePointSize: root.document?.status === PdfDocument.Ready ? root.document.pagePointSize(0) : Qt.size(1, 1)
+ property real pageHolderWidth: Math.max(root.width, ((rot90 ? root.document?.maxPageHeight : root.document?.maxPageWidth) ?? 0) * root.renderScale)
+ columnWidthProvider: function(col) { return root.document ? pageHolderWidth + vscroll.width + 2 : 0 }
+ rowHeightProvider: function(row) { return (rot90 ? root.document.pagePointSize(row).width : root.document.pagePointSize(row).height) * root.renderScale }
+
+ // delayed-jump feature in case the user called goToPage() or goToLocation() too early
+ property int pendingRow: -1
+ property point pendingLocation
+ property real pendingZoom: -1
+ onRowsChanged: {
+ if (rows > 0 && tableView.pendingRow >= 0) {
+ console.log(lcMPV, "initiating delayed jump to page", tableView.pendingRow, "loc", tableView.pendingLocation, "zoom", tableView.pendingZoom)
+ root.goToLocation(tableView.pendingRow, tableView.pendingLocation, tableView.pendingZoom)
+ tableView.pendingRow = -1
+ tableView.pendingLocation = Qt.point(-1, -1)
+ tableView.pendingZoom = -1
+ }
+ }
+
+ delegate: Rectangle {
+ id: pageHolder
+ required property int index
+ color: tableView.debug ? "beige" : "transparent"
+ Text {
+ visible: tableView.debug
+ anchors { right: parent.right; verticalCenter: parent.verticalCenter }
+ rotation: -90; text: pageHolder.width.toFixed(1) + "x" + pageHolder.height.toFixed(1) + "\n" +
+ image.width.toFixed(1) + "x" + image.height.toFixed(1)
+ }
+ property alias selection: selection
+ Rectangle {
+ id: paper
+ width: image.width
+ height: image.height
+ rotation: root.pageRotation
+ anchors.centerIn: pinch.active ? undefined : parent
+ property size pagePointSize: root.document.pagePointSize(pageHolder.index)
+ property real pageScale: image.paintedWidth / pagePointSize.width
+ PdfPageImage {
+ id: image
+ document: root.document
+ currentFrame: pageHolder.index
+ asynchronous: true
+ fillMode: Image.PreserveAspectFit
+ width: paper.pagePointSize.width * root.renderScale
+ height: paper.pagePointSize.height * root.renderScale
+ property real renderScale: root.renderScale
+ property real oldRenderScale: 1
+ onRenderScaleChanged: {
+ image.sourceSize.width = paper.pagePointSize.width * renderScale * Screen.devicePixelRatio
+ image.sourceSize.height = 0
+ paper.scale = 1
+ searchHighlights.update()
+ }
+ onStatusChanged: {
+ if (pageHolder.index === pageNavigator.currentPage)
+ root.currentPageRenderingStatus = status
+ }
+ }
+ Shape {
+ anchors.fill: parent
+ visible: image.status === Image.Ready
+ onVisibleChanged: searchHighlights.update()
+ ShapePath {
+ strokeWidth: -1
+ fillColor: style.pageSearchResultsColor
+ scale: Qt.size(paper.pageScale, paper.pageScale)
+ PathMultiline {
+ id: searchHighlights
+ function update() {
+ // paths could be a binding, but we need to be able to "kick" it sometimes
+ paths = searchModel.boundingPolygonsOnPage(pageHolder.index)
+ }
+ }
+ }
+ Connections {
+ target: searchModel
+ // whenever the highlights on the _current_ page change, they actually need to change on _all_ pages
+ // (usually because the search string has changed)
+ function onCurrentPageBoundingPolygonsChanged() { searchHighlights.update() }
+ }
+ ShapePath {
+ strokeWidth: -1
+ fillColor: style.selectionColor
+ scale: Qt.size(paper.pageScale, paper.pageScale)
+ PathMultiline {
+ paths: selection.geometry
+ }
+ }
+ }
+ Shape {
+ anchors.fill: parent
+ visible: image.status === Image.Ready && searchModel.currentPage === pageHolder.index
+ ShapePath {
+ strokeWidth: style.currentSearchResultStrokeWidth
+ strokeColor: style.currentSearchResultStrokeColor
+ fillColor: "transparent"
+ scale: Qt.size(paper.pageScale, paper.pageScale)
+ PathMultiline {
+ paths: searchModel.currentResultBoundingPolygons
+ }
+ }
+ }
+ PinchHandler {
+ id: pinch
+ minimumScale: tableView.minScale / root.renderScale
+ maximumScale: Math.max(1, tableView.maxScale / root.renderScale)
+ minimumRotation: root.pageRotation
+ maximumRotation: root.pageRotation
+ onActiveChanged:
+ if (active) {
+ paper.z = 10
+ } else {
+ paper.z = 0
+ const centroidInPoints = Qt.point(pinch.centroid.position.x / root.renderScale,
+ pinch.centroid.position.y / root.renderScale)
+ const centroidInFlickable = tableView.mapFromItem(paper, pinch.centroid.position.x, pinch.centroid.position.y)
+ const newSourceWidth = image.sourceSize.width * paper.scale
+ const ratio = newSourceWidth / image.sourceSize.width
+ console.log(lcMPV, "pinch ended on page", pageHolder.index,
+ "with scale", paper.scale.toFixed(3), "ratio", ratio.toFixed(3),
+ "centroid", pinch.centroid.position, centroidInPoints,
+ "wrt flickable", centroidInFlickable,
+ "page at", pageHolder.x.toFixed(2), pageHolder.y.toFixed(2),
+ "contentX/Y were", tableView.contentX.toFixed(2), tableView.contentY.toFixed(2))
+ if (ratio > 1.1 || ratio < 0.9) {
+ const centroidOnPage = Qt.point(centroidInPoints.x * root.renderScale * ratio, centroidInPoints.y * root.renderScale * ratio)
+ paper.scale = 1
+ pinch.persistentScale = 1
+ paper.x = 0
+ paper.y = 0
+ root.renderScale *= ratio
+ tableView.forceLayout()
+ if (tableView.rotationNorm == 0) {
+ tableView.contentX = pageHolder.x + tableView.originX + centroidOnPage.x - centroidInFlickable.x
+ tableView.contentY = pageHolder.y + tableView.originY + centroidOnPage.y - centroidInFlickable.y
+ } else if (tableView.rotationNorm == 90) {
+ tableView.contentX = pageHolder.x + tableView.originX + image.height - centroidOnPage.y - centroidInFlickable.x
+ tableView.contentY = pageHolder.y + tableView.originY + centroidOnPage.x - centroidInFlickable.y
+ } else if (tableView.rotationNorm == 180) {
+ tableView.contentX = pageHolder.x + tableView.originX + image.width - centroidOnPage.x - centroidInFlickable.x
+ tableView.contentY = pageHolder.y + tableView.originY + image.height - centroidOnPage.y - centroidInFlickable.y
+ } else if (tableView.rotationNorm == 270) {
+ tableView.contentX = pageHolder.x + tableView.originX + centroidOnPage.y - centroidInFlickable.x
+ tableView.contentY = pageHolder.y + tableView.originY + image.width - centroidOnPage.x - centroidInFlickable.y
+ }
+ console.log(lcMPV, "contentX/Y adjusted to", tableView.contentX.toFixed(2), tableView.contentY.toFixed(2), "y @top", pageHolder.y)
+ tableView.returnToBounds()
+ }
+ }
+ grabPermissions: PointerHandler.CanTakeOverFromAnything
+ }
+ DragHandler {
+ id: textSelectionDrag
+ acceptedDevices: PointerDevice.Mouse | PointerDevice.Stylus
+ target: null
+ }
+ TapHandler {
+ id: mouseClickHandler
+ acceptedDevices: PointerDevice.Mouse | PointerDevice.Stylus
+ }
+ TapHandler {
+ id: touchTapHandler
+ acceptedDevices: PointerDevice.TouchScreen
+ onTapped: {
+ selection.clear()
+ selection.forceActiveFocus()
+ }
+ }
+ Repeater {
+ model: PdfLinkModel {
+ id: linkModel
+ document: root.document
+ page: image.currentFrame
+ }
+ delegate: PdfLinkDelegate {
+ x: rectangle.x * paper.pageScale
+ y: rectangle.y * paper.pageScale
+ width: rectangle.width * paper.pageScale
+ height: rectangle.height * paper.pageScale
+ visible: image.status === Image.Ready
+ onTapped:
+ (link) => {
+ if (link.page >= 0)
+ root.goToLocation(link.page, link.location, link.zoom)
+ else
+ Qt.openUrlExternally(url)
+ }
+ }
+ }
+ PdfSelection {
+ id: selection
+ anchors.fill: parent
+ document: root.document
+ page: image.currentFrame
+ renderScale: image.renderScale
+ from: textSelectionDrag.centroid.pressPosition
+ to: textSelectionDrag.centroid.position
+ hold: !textSelectionDrag.active && !mouseClickHandler.pressed
+ onTextChanged: root.selectedText = text
+ focus: true
+ }
+ }
+ }
+ ScrollBar.vertical: ScrollBar {
+ id: vscroll
+ property bool moved: false
+ onPositionChanged: moved = true
+ onPressedChanged: if (pressed) {
+ // When the user starts scrolling, push the location where we came from so the user can go "back" there
+ const cell = tableView.cellAtPos(root.width / 2, root.height / 2)
+ const currentItem = tableView.itemAtCell(cell)
+ const currentLocation = currentItem
+ ? Qt.point((tableView.contentX - currentItem.x + tableView.jumpLocationMargin.x) / root.renderScale,
+ (tableView.contentY - currentItem.y + tableView.jumpLocationMargin.y) / root.renderScale)
+ : Qt.point(0, 0) // maybe the delegate wasn't loaded yet
+ pageNavigator.jump(cell.y, currentLocation, root.renderScale)
+ }
+ onActiveChanged: if (!active ) {
+ // When the scrollbar stops moving, tell navstack where we are, so as to update currentPage etc.
+ const cell = tableView.cellAtPos(root.width / 2, root.height / 2)
+ const currentItem = tableView.itemAtCell(cell)
+ const currentLocation = currentItem
+ ? Qt.point((tableView.contentX - currentItem.x + tableView.jumpLocationMargin.x) / root.renderScale,
+ (tableView.contentY - currentItem.y + tableView.jumpLocationMargin.y) / root.renderScale)
+ : Qt.point(0, 0) // maybe the delegate wasn't loaded yet
+ pageNavigator.update(cell.y, currentLocation, root.renderScale)
+ }
+ }
+ ScrollBar.horizontal: ScrollBar { }
+ }
+ onRenderScaleChanged: {
+ // if pageNavigator.jumped changes the scale, don't turn around and update the stack again;
+ // and don't force layout either, because positionViewAtCell() will do that
+ if (pageNavigator.jumping)
+ return
+ // page size changed: TableView needs to redo layout to avoid overlapping delegates or gaps between them
+ tableView.forceLayout()
+ const cell = tableView.cellAtPos(root.width / 2, root.height / 2)
+ const currentItem = tableView.itemAtCell(cell)
+ if (currentItem) {
+ const currentLocation = Qt.point((tableView.contentX - currentItem.x + tableView.jumpLocationMargin.x) / root.renderScale,
+ (tableView.contentY - currentItem.y + tableView.jumpLocationMargin.y) / root.renderScale)
+ pageNavigator.update(cell.y, currentLocation, renderScale)
+ }
+ }
+ PdfPageNavigator {
+ id: pageNavigator
+ property bool jumping: false
+ property int previousPage: 0
+ onJumped: function(current) {
+ jumping = true
+ if (current.zoom > 0)
+ root.renderScale = current.zoom
+ const pageSize = root.document.pagePointSize(current.page)
+ if (current.location.y < 0) {
+ // invalid to indicate that a specific location was not needed,
+ // so attempt to position the new page just as the current page is
+ const previousPageDelegate = tableView.itemAtCell(0, previousPage)
+ const currentYOffset = previousPageDelegate
+ ? tableView.contentY - previousPageDelegate.y
+ : 0
+ tableView.positionViewAtRow(current.page, Qt.AlignTop, currentYOffset)
+ console.log(lcMPV, "going from page", previousPage, "to", current.page, "offset", currentYOffset,
+ "ended up @", tableView.contentX.toFixed(1) + ", " + tableView.contentY.toFixed(1))
+ } else if (current.rectangles.length > 0) {
+ // jump to a search result and position the covered area within the viewport
+ pageSize.width *= root.renderScale
+ pageSize.height *= root.renderScale
+ const rectPts = current.rectangles[0]
+ const rectPx = Qt.rect(rectPts.x * root.renderScale - tableView.jumpLocationMargin.x,
+ rectPts.y * root.renderScale - tableView.jumpLocationMargin.y,
+ rectPts.width * root.renderScale + tableView.jumpLocationMargin.x * 2,
+ rectPts.height * root.renderScale + tableView.jumpLocationMargin.y * 2)
+ tableView.positionViewAtCell(0, current.page, TableView.Contain, Qt.point(0, 0), rectPx)
+ console.log(lcMPV, "going to zoom", root.renderScale, "rect", rectPx, "on page", current.page,
+ "ended up @", tableView.contentX.toFixed(1) + ", " + tableView.contentY.toFixed(1))
+ } else {
+ // jump to a page and position the given location relative to the top-left corner of the viewport
+ pageSize.width *= root.renderScale
+ pageSize.height *= root.renderScale
+ const rectPx = Qt.rect(current.location.x * root.renderScale - tableView.jumpLocationMargin.x,
+ current.location.y * root.renderScale - tableView.jumpLocationMargin.y,
+ tableView.jumpLocationMargin.x * 2, tableView.jumpLocationMargin.y * 2)
+ tableView.positionViewAtCell(0, current.page, TableView.AlignLeft | TableView.AlignTop, Qt.point(0, 0), rectPx)
+ console.log(lcMPV, "going to zoom", root.renderScale, "loc", current.location, "on page", current.page,
+ "ended up @", tableView.contentX.toFixed(1) + ", " + tableView.contentY.toFixed(1))
+ }
+ jumping = false
+ previousPage = current.page
+ }
+
+ property url documentSource: root.document.source
+ onDocumentSourceChanged: {
+ pageNavigator.clear()
+ root.resetScale()
+ tableView.contentX = 0
+ tableView.contentY = 0
+ }
+ }
+ PdfSearchModel {
+ id: searchModel
+ document: root.document === undefined ? null : root.document
+ onCurrentResultChanged: pageNavigator.jump(currentResultLink)
+ }
+}
diff --git a/src/pdfquick/PdfPageView.qml b/src/pdfquick/PdfPageView.qml
new file mode 100644
index 000000000..290570f2b
--- /dev/null
+++ b/src/pdfquick/PdfPageView.qml
@@ -0,0 +1,439 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+pragma ComponentBehavior: Bound
+
+import QtQuick
+import QtQuick.Pdf
+import QtQuick.Shapes
+
+/*!
+ \qmltype PdfPageView
+ \inqmlmodule QtQuick.Pdf
+ \brief A PDF viewer component to show one page a time.
+
+ PdfPageView provides a PDF viewer component that shows one whole page at a
+ time, without scrolling. It supports selecting text and copying it to the
+ clipboard, zooming in and out, clicking an internal link to jump to another
+ section in the document, rotating the view, and searching for text.
+
+ The implementation is a QML assembly of smaller building blocks that are
+ available separately. In case you want to make changes in your own version
+ of this component, you can copy the QML, which is installed into the
+ \c QtQuick/Pdf/qml module directory, and modify it as needed.
+
+ \sa PdfScrollablePageView, PdfMultiPageView, PdfStyle
+*/
+Rectangle {
+ /*!
+ \qmlproperty PdfDocument PdfPageView::document
+
+ A PdfDocument object with a valid \c source URL is required:
+
+ \snippet multipageview.qml 0
+ */
+ required property PdfDocument document
+
+ /*!
+ \qmlproperty int PdfPageView::status
+
+ This property holds the \l {QtQuick::Image::status}{rendering status} of
+ the \l {currentPage}{current page}.
+ */
+ property alias status: image.status
+
+ /*!
+ \qmlproperty PdfDocument PdfPageView::selectedText
+
+ The selected text.
+ */
+ property alias selectedText: selection.text
+
+ /*!
+ \qmlmethod void PdfPageView::selectAll()
+
+ Selects all the text on the \l {currentPage}{current page}, and makes it
+ available as the system \l {QClipboard::Selection}{selection} on systems
+ that support that feature.
+
+ \sa copySelectionToClipboard()
+ */
+ function selectAll() {
+ selection.selectAll()
+ }
+
+ /*!
+ \qmlmethod void PdfPageView::copySelectionToClipboard()
+
+ Copies the selected text (if any) to the
+ \l {QClipboard::Clipboard}{system clipboard}.
+
+ \sa selectAll()
+ */
+ function copySelectionToClipboard() {
+ selection.copyToClipboard()
+ }
+
+ // --------------------------------
+ // page navigation
+
+ /*!
+ \qmlproperty int PdfPageView::currentPage
+ \readonly
+
+ This property holds the zero-based page number of the page visible in the
+ scrollable view. If there is no current page, it holds -1.
+
+ This property is read-only, and is typically used in a binding (or
+ \c onCurrentPageChanged script) to update the part of the user interface
+ that shows the current page number, such as a \l SpinBox.
+
+ \sa PdfPageNavigator::currentPage
+ */
+ property alias currentPage: pageNavigator.currentPage
+
+ /*!
+ \qmlproperty bool PdfPageView::backEnabled
+ \readonly
+
+ This property indicates if it is possible to go back in the navigation
+ history to a previous-viewed page.
+
+ \sa PdfPageNavigator::backAvailable, back()
+ */
+ property alias backEnabled: pageNavigator.backAvailable
+
+ /*!
+ \qmlproperty bool PdfPageView::forwardEnabled
+ \readonly
+
+ This property indicates if it is possible to go to next location in the
+ navigation history.
+
+ \sa PdfPageNavigator::forwardAvailable, forward()
+ */
+ property alias forwardEnabled: pageNavigator.forwardAvailable
+
+ /*!
+ \qmlmethod void PdfPageView::back()
+
+ Scrolls the view back to the previous page that the user visited most
+ recently; or does nothing if there is no previous location on the
+ navigation stack.
+
+ \sa PdfPageNavigator::back(), currentPage, backEnabled
+ */
+ function back() { pageNavigator.back() }
+
+ /*!
+ \qmlmethod void PdfPageView::forward()
+
+ Scrolls the view to the page that the user was viewing when the back()
+ method was called; or does nothing if there is no "next" location on the
+ navigation stack.
+
+ \sa PdfPageNavigator::forward(), currentPage
+ */
+ function forward() { pageNavigator.forward() }
+
+ /*!
+ \qmlmethod void PdfPageView::goToPage(int page)
+
+ Changes the view to the \a page, if possible.
+
+ \sa PdfPageNavigator::jump(), currentPage
+ */
+ function goToPage(page) { goToLocation(page, Qt.point(0, 0), 0) }
+
+ /*!
+ \qmlmethod void PdfPageView::goToLocation(int page, point location, real zoom)
+
+ Scrolls the view to the \a location on the \a page, if possible,
+ and sets the \a zoom level.
+
+ \sa PdfPageNavigator::jump(), currentPage
+ */
+ function goToLocation(page, location, zoom) {
+ if (zoom > 0)
+ root.renderScale = zoom
+ pageNavigator.jump(page, location, zoom)
+ }
+
+ // --------------------------------
+ // page scaling
+
+ /*!
+ \qmlproperty bool PdfPageView::zoomEnabled
+
+ This property holds whether the user can use the pinch gesture or
+ Control + mouse wheel to zoom. The default is \c true.
+
+ When the user zooms the page, the size of PdfPageView changes.
+ */
+ property bool zoomEnabled: true
+
+ /*!
+ \qmlproperty real PdfPageView::renderScale
+
+ This property holds the ratio of pixels to points. The default is \c 1,
+ meaning one point (1/72 of an inch) equals 1 logical pixel.
+ */
+ property real renderScale: 1
+
+ /*!
+ \qmlproperty size PdfPageView::sourceSize
+
+ This property holds the scaled width and height of the full-frame image.
+
+ \sa {QtQuick::Image::sourceSize}{Image.sourceSize}
+ */
+ property alias sourceSize: image.sourceSize
+
+ /*!
+ \qmlmethod void PdfPageView::resetScale()
+
+ Sets \l renderScale back to its default value of \c 1.
+ */
+ function resetScale() {
+ image.sourceSize.width = 0
+ image.sourceSize.height = 0
+ root.scale = 1
+ }
+
+ /*!
+ \qmlmethod void PdfPageView::scaleToWidth(real width, real height)
+
+ Sets \l renderScale such that the width of the first page will fit into a
+ viewport with the given \a width and \a height. If the page is not rotated,
+ it will be scaled so that its width fits \a width. If it is rotated +/- 90
+ degrees, it will be scaled so that its width fits \a height.
+ */
+ function scaleToWidth(width, height) {
+ const halfRotation = Math.abs(root.rotation % 180)
+ image.sourceSize = Qt.size((halfRotation > 45 && halfRotation < 135) ? height : width, 0)
+ image.centerInSize = Qt.size(width, height)
+ image.centerOnLoad = true
+ image.vCenterOnLoad = (halfRotation > 45 && halfRotation < 135)
+ root.scale = 1
+ }
+
+ /*!
+ \qmlmethod void PdfPageView::scaleToPage(real width, real height)
+
+ Sets \l renderScale such that the whole first page will fit into a viewport
+ with the given \a width and \a height. The resulting \l renderScale depends
+ on page rotation: the page will fit into the viewport at a larger size if it
+ is first rotated to have a matching aspect ratio.
+ */
+ function scaleToPage(width, height) {
+ const windowAspect = width / height
+ const halfRotation = Math.abs(root.rotation % 180)
+ const pagePointSize = document.pagePointSize(pageNavigator.currentPage)
+ const pageAspect = pagePointSize.height / pagePointSize.width
+ if (halfRotation > 45 && halfRotation < 135) {
+ // rotated 90 or 270º
+ if (windowAspect > pageAspect) {
+ image.sourceSize = Qt.size(height, 0)
+ } else {
+ image.sourceSize = Qt.size(0, width)
+ }
+ } else {
+ if (windowAspect > pageAspect) {
+ image.sourceSize = Qt.size(0, height)
+ } else {
+ image.sourceSize = Qt.size(width, 0)
+ }
+ }
+ image.centerInSize = Qt.size(width, height)
+ image.centerOnLoad = true
+ image.vCenterOnLoad = true
+ root.scale = 1
+ }
+
+ // --------------------------------
+ // text search
+
+ /*!
+ \qmlproperty PdfSearchModel PdfPageView::searchModel
+
+ This property holds a PdfSearchModel containing the list of search results
+ for a given \l searchString.
+
+ \sa PdfSearchModel
+ */
+ property alias searchModel: searchModel
+
+ /*!
+ \qmlproperty string PdfPageView::searchString
+
+ This property holds the search string that the user may choose to search
+ for. It is typically used in a binding to the \c text property of a
+ TextField.
+
+ \sa searchModel
+ */
+ property alias searchString: searchModel.searchString
+
+ /*!
+ \qmlmethod void PdfPageView::searchBack()
+
+ Decrements the
+ \l{PdfSearchModel::currentResult}{searchModel's current result}
+ so that the view will jump to the previous search result.
+ */
+ function searchBack() { --searchModel.currentResult }
+
+ /*!
+ \qmlmethod void PdfPageView::searchForward()
+
+ Increments the
+ \l{PdfSearchModel::currentResult}{searchModel's current result}
+ so that the view will jump to the next search result.
+ */
+ function searchForward() { ++searchModel.currentResult }
+
+ // --------------------------------
+ // implementation
+ id: root
+ width: image.width
+ height: image.height
+
+ PdfSelection {
+ id: selection
+ document: root.document
+ page: pageNavigator.currentPage
+ from: Qt.point(textSelectionDrag.centroid.pressPosition.x / image.pageScale, textSelectionDrag.centroid.pressPosition.y / image.pageScale)
+ to: Qt.point(textSelectionDrag.centroid.position.x / image.pageScale, textSelectionDrag.centroid.position.y / image.pageScale)
+ hold: !textSelectionDrag.active && !tapHandler.pressed
+ }
+
+ PdfSearchModel {
+ id: searchModel
+ document: root.document === undefined ? null : root.document
+ onCurrentPageChanged: root.goToPage(currentPage)
+ }
+
+ PdfPageNavigator {
+ id: pageNavigator
+ onCurrentPageChanged: searchModel.currentPage = currentPage
+ onCurrentZoomChanged: root.renderScale = currentZoom
+
+ property url documentSource: root.document.source
+ onDocumentSourceChanged: {
+ pageNavigator.clear()
+ root.goToPage(0)
+ }
+ }
+
+ PdfPageImage {
+ id: image
+ document: root.document
+ currentFrame: pageNavigator.currentPage
+ asynchronous: true
+ fillMode: Image.PreserveAspectFit
+ property bool centerOnLoad: false
+ property bool vCenterOnLoad: false
+ property size centerInSize
+ property real pageScale: image.paintedWidth / document.pagePointSize(pageNavigator.currentPage).width
+ function reRenderIfNecessary() {
+ const newSourceWidth = image.sourceSize.width * root.scale * Screen.devicePixelRatio
+ const ratio = newSourceWidth / image.sourceSize.width
+ if (ratio > 1.1 || ratio < 0.9) {
+ image.sourceSize.width = newSourceWidth
+ image.sourceSize.height = 0
+ root.scale = 1
+ }
+ }
+ onStatusChanged:
+ if (status == Image.Ready && centerOnLoad) {
+ root.x = (centerInSize.width - image.implicitWidth) / 2
+ root.y = vCenterOnLoad ? (centerInSize.height - image.implicitHeight) / 2 : 0
+ centerOnLoad = false
+ vCenterOnLoad = false
+ }
+ }
+ onRenderScaleChanged: {
+ image.sourceSize.width = document.pagePointSize(pageNavigator.currentPage).width * renderScale
+ image.sourceSize.height = 0
+ root.scale = 1
+ }
+
+ Shape {
+ anchors.fill: parent
+ opacity: 0.25
+ visible: image.status === Image.Ready
+ ShapePath {
+ strokeWidth: 1
+ strokeColor: "cyan"
+ fillColor: "steelblue"
+ scale: Qt.size(image.pageScale, image.pageScale)
+ PathMultiline {
+ paths: searchModel.currentPageBoundingPolygons
+ }
+ }
+ ShapePath {
+ strokeWidth: 1
+ strokeColor: "orange"
+ fillColor: "cyan"
+ scale: Qt.size(image.pageScale, image.pageScale)
+ PathMultiline {
+ paths: searchModel.currentResultBoundingPolygons
+ }
+ }
+ ShapePath {
+ fillColor: "orange"
+ scale: Qt.size(image.pageScale, image.pageScale)
+ PathMultiline {
+ paths: selection.geometry
+ }
+ }
+ }
+
+ Repeater {
+ model: PdfLinkModel {
+ id: linkModel
+ document: root.document
+ page: pageNavigator.currentPage
+ }
+ delegate: PdfLinkDelegate {
+ x: rectangle.x * image.pageScale
+ y: rectangle.y * image.pageScale
+ width: rectangle.width * image.pageScale
+ height: rectangle.height * image.pageScale
+ visible: image.status === Image.Ready
+ onTapped:
+ (link) => {
+ if (link.page >= 0)
+ pageNavigator.jump(link)
+ else
+ Qt.openUrlExternally(url)
+ }
+ }
+ }
+
+ PinchHandler {
+ id: pinch
+ enabled: root.zoomEnabled && root.scale * root.renderScale <= 10 && root.scale * root.renderScale >= 0.1
+ minimumScale: 0.1
+ maximumScale: 10
+ minimumRotation: 0
+ maximumRotation: 0
+ onActiveChanged: if (!active) image.reRenderIfNecessary()
+ grabPermissions: PinchHandler.TakeOverForbidden // don't allow takeover if pinch has started
+ }
+ WheelHandler {
+ enabled: pinch.enabled
+ acceptedModifiers: Qt.ControlModifier
+ property: "scale"
+ onActiveChanged: if (!active) image.reRenderIfNecessary()
+ }
+ DragHandler {
+ id: textSelectionDrag
+ acceptedDevices: PointerDevice.Mouse | PointerDevice.Stylus
+ target: null
+ }
+ TapHandler {
+ id: tapHandler
+ acceptedDevices: PointerDevice.Mouse | PointerDevice.Stylus
+ }
+}
diff --git a/src/pdfquick/PdfScrollablePageView.qml b/src/pdfquick/PdfScrollablePageView.qml
new file mode 100644
index 000000000..9fa0547c6
--- /dev/null
+++ b/src/pdfquick/PdfScrollablePageView.qml
@@ -0,0 +1,487 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+pragma ComponentBehavior: Bound
+
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Pdf
+import QtQuick.Shapes
+
+/*!
+ \qmltype PdfScrollablePageView
+ \inqmlmodule QtQuick.Pdf
+ \brief A complete PDF viewer component to show one page a time, with scrolling.
+
+ PdfScrollablePageView provides a PDF viewer component that shows one page
+ at a time, with scrollbars to move around the page. It also supports
+ selecting text and copying it to the clipboard, zooming in and out,
+ clicking an internal link to jump to another section in the document,
+ rotating the view, and searching for text. The pdfviewer example
+ demonstrates how to use these features in an application.
+
+ The implementation is a QML assembly of smaller building blocks that are
+ available separately. In case you want to make changes in your own version
+ of this component, you can copy the QML, which is installed into the
+ \c QtQuick/Pdf/qml module directory, and modify it as needed.
+
+ \sa PdfPageView, PdfMultiPageView, PdfStyle
+*/
+Flickable {
+ /*!
+ \qmlproperty PdfDocument PdfScrollablePageView::document
+
+ A PdfDocument object with a valid \c source URL is required:
+
+ \snippet multipageview.qml 0
+ */
+ required property PdfDocument document
+
+ /*!
+ \qmlproperty int PdfScrollablePageView::status
+
+ This property holds the \l {QtQuick::Image::status}{rendering status} of
+ the \l {currentPage}{current page}.
+ */
+ property alias status: image.status
+
+ /*!
+ \qmlproperty PdfDocument PdfScrollablePageView::selectedText
+
+ The selected text.
+ */
+ property alias selectedText: selection.text
+
+ /*!
+ \qmlmethod void PdfScrollablePageView::selectAll()
+
+ Selects all the text on the \l {currentPage}{current page}, and makes it
+ available as the system \l {QClipboard::Selection}{selection} on systems
+ that support that feature.
+
+ \sa copySelectionToClipboard()
+ */
+ function selectAll() {
+ selection.selectAll()
+ }
+
+ /*!
+ \qmlmethod void PdfScrollablePageView::copySelectionToClipboard()
+
+ Copies the selected text (if any) to the
+ \l {QClipboard::Clipboard}{system clipboard}.
+
+ \sa selectAll()
+ */
+ function copySelectionToClipboard() {
+ selection.copyToClipboard()
+ }
+
+ // --------------------------------
+ // page navigation
+
+ /*!
+ \qmlproperty int PdfScrollablePageView::currentPage
+ \readonly
+
+ This property holds the zero-based page number of the page visible in the
+ scrollable view. If there is no current page, it holds -1.
+
+ This property is read-only, and is typically used in a binding (or
+ \c onCurrentPageChanged script) to update the part of the user interface
+ that shows the current page number, such as a \l SpinBox.
+
+ \sa PdfPageNavigator::currentPage
+ */
+ property alias currentPage: pageNavigator.currentPage
+
+ /*!
+ \qmlproperty bool PdfScrollablePageView::backEnabled
+ \readonly
+
+ This property indicates if it is possible to go back in the navigation
+ history to a previous-viewed page.
+
+ \sa PdfPageNavigator::backAvailable, back()
+ */
+ property alias backEnabled: pageNavigator.backAvailable
+
+ /*!
+ \qmlproperty bool PdfScrollablePageView::forwardEnabled
+ \readonly
+
+ This property indicates if it is possible to go to next location in the
+ navigation history.
+
+ \sa PdfPageNavigator::forwardAvailable, forward()
+ */
+ property alias forwardEnabled: pageNavigator.forwardAvailable
+
+ /*!
+ \qmlmethod void PdfScrollablePageView::back()
+
+ Scrolls the view back to the previous page that the user visited most
+ recently; or does nothing if there is no previous location on the
+ navigation stack.
+
+ \sa PdfPageNavigator::back(), currentPage, backEnabled
+ */
+ function back() { pageNavigator.back() }
+
+ /*!
+ \qmlmethod void PdfScrollablePageView::forward()
+
+ Scrolls the view to the page that the user was viewing when the back()
+ method was called; or does nothing if there is no "next" location on the
+ navigation stack.
+
+ \sa PdfPageNavigator::forward(), currentPage
+ */
+ function forward() { pageNavigator.forward() }
+
+ /*!
+ \qmlmethod void PdfScrollablePageView::goToPage(int page)
+
+ Changes the view to the \a page, if possible.
+
+ \sa PdfPageNavigator::jump(), currentPage
+ */
+ function goToPage(page) {
+ if (page === pageNavigator.currentPage)
+ return
+ goToLocation(page, Qt.point(0, 0), 0)
+ }
+
+ /*!
+ \qmlmethod void PdfScrollablePageView::goToLocation(int page, point location, real zoom)
+
+ Scrolls the view to the \a location on the \a page, if possible,
+ and sets the \a zoom level.
+
+ \sa PdfPageNavigator::jump(), currentPage
+ */
+ function goToLocation(page, location, zoom) {
+ if (zoom > 0)
+ root.renderScale = zoom
+ pageNavigator.jump(page, location, zoom)
+ }
+
+ // --------------------------------
+ // page scaling
+
+ /*!
+ \qmlproperty real PdfScrollablePageView::renderScale
+
+ This property holds the ratio of pixels to points. The default is \c 1,
+ meaning one point (1/72 of an inch) equals 1 logical pixel.
+ */
+ property real renderScale: 1
+
+ /*!
+ \qmlproperty real PdfScrollablePageView::pageRotation
+
+ This property holds the clockwise rotation of the pages.
+
+ The default value is \c 0 degrees (that is, no rotation relative to the
+ orientation of the pages as stored in the PDF file).
+ */
+ property real pageRotation: 0
+
+ /*!
+ \qmlproperty size PdfScrollablePageView::sourceSize
+
+ This property holds the scaled width and height of the full-frame image.
+
+ \sa {QtQuick::Image::sourceSize}{Image.sourceSize}
+ */
+ property alias sourceSize: image.sourceSize
+
+ /*!
+ \qmlmethod void PdfScrollablePageView::resetScale()
+
+ Sets \l renderScale back to its default value of \c 1.
+ */
+ function resetScale() {
+ paper.scale = 1
+ root.renderScale = 1
+ }
+
+ /*!
+ \qmlmethod void PdfScrollablePageView::scaleToWidth(real width, real height)
+
+ Sets \l renderScale such that the width of the first page will fit into a
+ viewport with the given \a width and \a height. If the page is not rotated,
+ it will be scaled so that its width fits \a width. If it is rotated +/- 90
+ degrees, it will be scaled so that its width fits \a height.
+ */
+ function scaleToWidth(width, height) {
+ const pagePointSize = document.pagePointSize(pageNavigator.currentPage)
+ root.renderScale = root.width / (paper.rot90 ? pagePointSize.height : pagePointSize.width)
+ console.log(lcSPV, "scaling", pagePointSize, "to fit", root.width, "rotated?", paper.rot90, "scale", root.renderScale)
+ root.contentX = 0
+ root.contentY = 0
+ }
+
+ /*!
+ \qmlmethod void PdfScrollablePageView::scaleToPage(real width, real height)
+
+ Sets \l renderScale such that the whole first page will fit into a viewport
+ with the given \a width and \a height. The resulting \l renderScale depends
+ on \l pageRotation: the page will fit into the viewport at a larger size if
+ it is first rotated to have a matching aspect ratio.
+ */
+ function scaleToPage(width, height) {
+ const pagePointSize = document.pagePointSize(pageNavigator.currentPage)
+ root.renderScale = Math.min(
+ root.width / (paper.rot90 ? pagePointSize.height : pagePointSize.width),
+ root.height / (paper.rot90 ? pagePointSize.width : pagePointSize.height) )
+ root.contentX = 0
+ root.contentY = 0
+ }
+
+ // --------------------------------
+ // text search
+
+ /*!
+ \qmlproperty PdfSearchModel PdfScrollablePageView::searchModel
+
+ This property holds a PdfSearchModel containing the list of search results
+ for a given \l searchString.
+
+ \sa PdfSearchModel
+ */
+ property alias searchModel: searchModel
+
+ /*!
+ \qmlproperty string PdfScrollablePageView::searchString
+
+ This property holds the search string that the user may choose to search
+ for. It is typically used in a binding to the \c text property of a
+ TextField.
+
+ \sa searchModel
+ */
+ property alias searchString: searchModel.searchString
+
+ /*!
+ \qmlmethod void PdfScrollablePageView::searchBack()
+
+ Decrements the
+ \l{PdfSearchModel::currentResult}{searchModel's current result}
+ so that the view will jump to the previous search result.
+ */
+ function searchBack() { --searchModel.currentResult }
+
+ /*!
+ \qmlmethod void PdfScrollablePageView::searchForward()
+
+ Increments the
+ \l{PdfSearchModel::currentResult}{searchModel's current result}
+ so that the view will jump to the next search result.
+ */
+ function searchForward() { ++searchModel.currentResult }
+
+ // --------------------------------
+ // implementation
+ id: root
+ PdfStyle { id: style }
+ contentWidth: paper.width
+ contentHeight: paper.height
+ ScrollBar.vertical: ScrollBar {
+ onActiveChanged:
+ if (!active ) {
+ const currentLocation = Qt.point((root.contentX + root.width / 2) / root.renderScale,
+ (root.contentY + root.height / 2) / root.renderScale)
+ pageNavigator.update(pageNavigator.currentPage, currentLocation, root.renderScale)
+ }
+ }
+ ScrollBar.horizontal: ScrollBar {
+ onActiveChanged:
+ if (!active ) {
+ const currentLocation = Qt.point((root.contentX + root.width / 2) / root.renderScale,
+ (root.contentY + root.height / 2) / root.renderScale)
+ pageNavigator.update(pageNavigator.currentPage, currentLocation, root.renderScale)
+ }
+ }
+
+ onRenderScaleChanged: {
+ paper.scale = 1
+ const currentLocation = Qt.point((root.contentX + root.width / 2) / root.renderScale,
+ (root.contentY + root.height / 2) / root.renderScale)
+ pageNavigator.update(pageNavigator.currentPage, currentLocation, root.renderScale)
+ }
+
+ PdfSearchModel {
+ id: searchModel
+ document: root.document === undefined ? null : root.document
+ onCurrentResultChanged: pageNavigator.jump(currentResultLink)
+ }
+
+ PdfPageNavigator {
+ id: pageNavigator
+ onJumped: function(current) {
+ root.renderScale = current.zoom
+ const dx = Math.max(0, current.location.x * root.renderScale - root.width / 2) - root.contentX
+ const dy = Math.max(0, current.location.y * root.renderScale - root.height / 2) - root.contentY
+ // don't jump if location is in the viewport already, i.e. if the "error" between desired and actual contentX/Y is small
+ if (Math.abs(dx) > root.width / 3)
+ root.contentX += dx
+ if (Math.abs(dy) > root.height / 3)
+ root.contentY += dy
+ console.log(lcSPV, "going to zoom", current.zoom, "loc", current.location,
+ "on page", current.page, "ended up @", root.contentX + ", " + root.contentY)
+ }
+ onCurrentPageChanged: searchModel.currentPage = currentPage
+
+ property url documentSource: root.document.source
+ onDocumentSourceChanged: {
+ pageNavigator.clear()
+ root.resetScale()
+ root.contentX = 0
+ root.contentY = 0
+ }
+ }
+
+ LoggingCategory {
+ id: lcSPV
+ name: "qt.pdf.singlepageview"
+ }
+
+ Rectangle {
+ id: paper
+ width: rot90 ? image.height : image.width
+ height: rot90 ? image.width : image.height
+ property real rotationModulus: Math.abs(root.pageRotation % 180)
+ property bool rot90: rotationModulus > 45 && rotationModulus < 135
+ property real minScale: 0.1
+ property real maxScale: 10
+
+ PdfPageImage {
+ id: image
+ document: root.document
+ currentFrame: pageNavigator.currentPage
+ asynchronous: true
+ fillMode: Image.PreserveAspectFit
+ rotation: root.pageRotation
+ anchors.centerIn: parent
+ property real pageScale: image.paintedWidth / document.pagePointSize(pageNavigator.currentPage).width
+ width: document.pagePointSize(pageNavigator.currentPage).width * root.renderScale
+ height: document.pagePointSize(pageNavigator.currentPage).height * root.renderScale
+ sourceSize.width: width * Screen.devicePixelRatio
+ sourceSize.height: 0
+
+ Shape {
+ anchors.fill: parent
+ visible: image.status === Image.Ready
+ ShapePath {
+ strokeWidth: -1
+ fillColor: style.pageSearchResultsColor
+ scale: Qt.size(image.pageScale, image.pageScale)
+ PathMultiline {
+ paths: searchModel.currentPageBoundingPolygons
+ }
+ }
+ ShapePath {
+ strokeWidth: style.currentSearchResultStrokeWidth
+ strokeColor: style.currentSearchResultStrokeColor
+ fillColor: "transparent"
+ scale: Qt.size(image.pageScale, image.pageScale)
+ PathMultiline {
+ paths: searchModel.currentResultBoundingPolygons
+ }
+ }
+ ShapePath {
+ fillColor: style.selectionColor
+ scale: Qt.size(image.pageScale, image.pageScale)
+ PathMultiline {
+ paths: selection.geometry
+ }
+ }
+ }
+
+ Repeater {
+ model: PdfLinkModel {
+ id: linkModel
+ document: root.document
+ page: pageNavigator.currentPage
+ }
+ delegate: PdfLinkDelegate {
+ x: rectangle.x * image.pageScale
+ y: rectangle.y * image.pageScale
+ width: rectangle.width * image.pageScale
+ height: rectangle.height * image.pageScale
+ visible: image.status === Image.Ready
+ onTapped:
+ (link) => {
+ if (link.page >= 0)
+ pageNavigator.jump(link.page, link.location, link.zoom)
+ else
+ Qt.openUrlExternally(url)
+ }
+ }
+ }
+ DragHandler {
+ id: textSelectionDrag
+ acceptedDevices: PointerDevice.Mouse | PointerDevice.Stylus
+ target: null
+ }
+ TapHandler {
+ id: mouseClickHandler
+ acceptedDevices: PointerDevice.Mouse | PointerDevice.Stylus
+ }
+ TapHandler {
+ id: touchTapHandler
+ acceptedDevices: PointerDevice.TouchScreen
+ onTapped: {
+ selection.clear()
+ selection.focus = true
+ }
+ }
+ }
+
+ PdfSelection {
+ id: selection
+ anchors.fill: parent
+ document: root.document
+ page: pageNavigator.currentPage
+ renderScale: image.pageScale == 0 ? 1.0 : image.pageScale
+ from: textSelectionDrag.centroid.pressPosition
+ to: textSelectionDrag.centroid.position
+ hold: !textSelectionDrag.active && !mouseClickHandler.pressed
+ focus: true
+ }
+
+ PinchHandler {
+ id: pinch
+ minimumScale: paper.minScale / root.renderScale
+ maximumScale: Math.max(1, paper.maxScale / root.renderScale)
+ minimumRotation: 0
+ maximumRotation: 0
+ onActiveChanged:
+ if (!active) {
+ const centroidInPoints = Qt.point(pinch.centroid.position.x / root.renderScale,
+ pinch.centroid.position.y / root.renderScale)
+ const centroidInFlickable = root.mapFromItem(paper, pinch.centroid.position.x, pinch.centroid.position.y)
+ const newSourceWidth = image.sourceSize.width * paper.scale
+ const ratio = newSourceWidth / image.sourceSize.width
+ console.log(lcSPV, "pinch ended with centroid", pinch.centroid.position, centroidInPoints, "wrt flickable", centroidInFlickable,
+ "page at", paper.x.toFixed(2), paper.y.toFixed(2),
+ "contentX/Y were", root.contentX.toFixed(2), root.contentY.toFixed(2))
+ if (ratio > 1.1 || ratio < 0.9) {
+ const centroidOnPage = Qt.point(centroidInPoints.x * root.renderScale * ratio, centroidInPoints.y * root.renderScale * ratio)
+ paper.scale = 1
+ paper.x = 0
+ paper.y = 0
+ root.contentX = centroidOnPage.x - centroidInFlickable.x
+ root.contentY = centroidOnPage.y - centroidInFlickable.y
+ root.renderScale *= ratio // onRenderScaleChanged calls pageNavigator.update() so we don't need to here
+ console.log(lcSPV, "contentX/Y adjusted to", root.contentX.toFixed(2), root.contentY.toFixed(2))
+ } else {
+ paper.x = 0
+ paper.y = 0
+ }
+ }
+ grabPermissions: PointerHandler.CanTakeOverFromAnything
+ }
+ }
+}
diff --git a/src/pdfquick/PdfStyle.qml b/src/pdfquick/PdfStyle.qml
new file mode 100644
index 000000000..a22276143
--- /dev/null
+++ b/src/pdfquick/PdfStyle.qml
@@ -0,0 +1,71 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+import QtQuick
+
+/*!
+ \qmltype PdfStyle
+ \inqmlmodule QtQuick.Pdf
+ \brief A styling interface for the PDF viewer components.
+
+ PdfStyle provides properties to modify the appearance of PdfMultiPageView,
+ PdfScrollablePageView, and PdfPageView.
+
+ Default styles are provided to match the
+ \l {Styling Qt Quick Controls}{styles in Qt Quick Controls}.
+ \l {Using File Selectors with Qt Quick Controls}{File selectors}
+ are used to load the PDF style corresponding to the Controls style in use.
+ Custom styles are possible, using different \l {QFileSelector}{file selectors}.
+*/
+QtObject {
+ /*! \internal
+ \qmlproperty SystemPalette PdfStyle::palette
+ */
+ property SystemPalette palette: SystemPalette { }
+
+ /*! \internal
+ \qmlmethod color PdfStyle::withAlpha()
+ */
+ function withAlpha(color, alpha) {
+ return Qt.hsla(color.hslHue, color.hslSaturation, color.hslLightness, alpha)
+ }
+
+ /*!
+ \qmlproperty color PdfStyle::selectionColor
+
+ The color of translucent rectangles that are overlaid on
+ \l {PdfMultiPageView::selectedText}{selected text}.
+
+ \sa PdfSelection
+ */
+ property color selectionColor: withAlpha(palette.highlight, 0.5)
+
+ /*!
+ \qmlproperty color PdfStyle::pageSearchResultsColor
+
+ The color of translucent rectangles that are overlaid on text that
+ matches the \l {PdfMultiPageView::searchString}{search string}.
+
+ \sa PdfSearchModel
+ */
+ property color pageSearchResultsColor: "#80B0C4DE"
+
+ /*!
+ \qmlproperty color PdfStyle::currentSearchResultStrokeColor
+
+ The color of the box outline around the
+ \l {PdfSearchModel::currentResult}{current search result}.
+
+ \sa PdfMultiPageView::searchBack(), PdfMultiPageView::searchForward(), PdfSearchModel::currentResult
+ */
+ property color currentSearchResultStrokeColor: "cyan"
+
+ /*!
+ \qmlproperty real PdfStyle::currentSearchResultStrokeWidth
+
+ The line width of the box outline around the
+ \l {PdfSearchModel::currentResult}{current search result}.
+
+ \sa PdfMultiPageView::searchBack(), PdfMultiPageView::searchForward(), PdfSearchModel::currentResult
+ */
+ property real currentSearchResultStrokeWidth: 2
+}
diff --git a/src/pdfquick/doc/src/qtquickpdf-module.qdoc b/src/pdfquick/doc/src/qtquickpdf-module.qdoc
new file mode 100644
index 000000000..a4ca0d9e8
--- /dev/null
+++ b/src/pdfquick/doc/src/qtquickpdf-module.qdoc
@@ -0,0 +1,18 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+ \qmlmodule QtQuick.Pdf
+ \title Qt Quick PDF QML Types
+ \ingroup qmlmodules
+ \brief Provides QML types for handling PDF documents.
+ \since 5.14
+
+ This QML module contains types for handling PDF documents.
+
+ To use the types in this module, import the module with the following line:
+
+ \qml
+ import QtQuick.Pdf
+ \endqml
+*/
diff --git a/src/pdfquick/qquickpdfbookmarkmodel.cpp b/src/pdfquick/qquickpdfbookmarkmodel.cpp
new file mode 100644
index 000000000..81f8547ae
--- /dev/null
+++ b/src/pdfquick/qquickpdfbookmarkmodel.cpp
@@ -0,0 +1,55 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qquickpdfbookmarkmodel_p.h"
+#include <QLoggingCategory>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \qmltype PdfBookmarkModel
+//! \instantiates QQuickPdfBookmarkModel
+ \inqmlmodule QtQuick.Pdf
+ \ingroup pdf
+ \brief A tree of links (anchors) within a PDF document, such as the table of contents.
+ \since 6.4
+
+ A PDF document can contain a hierarchy of link destinations, usually
+ representing the table of contents, to be shown in a sidebar in a PDF
+ viewer, so that the user can quickly jump to those locations in the
+ document. This QAbstractItemModel holds the information in a form
+ suitable for display with TreeView, ListView, QTreeView or QListView.
+*/
+
+QQuickPdfBookmarkModel::QQuickPdfBookmarkModel(QObject *parent)
+ : QPdfBookmarkModel(parent)
+{
+}
+
+/*!
+ \internal
+*/
+QQuickPdfBookmarkModel::~QQuickPdfBookmarkModel() = default;
+
+/*!
+ \qmlproperty PdfDocument PdfBookmarkModel::document
+
+ This property holds the PDF document in which bookmarks are to be found.
+*/
+QQuickPdfDocument *QQuickPdfBookmarkModel::document() const
+{
+ return m_quickDocument;
+}
+
+void QQuickPdfBookmarkModel::setDocument(QQuickPdfDocument *document)
+{
+ if (document == m_quickDocument)
+ return;
+ m_quickDocument = document;
+ QPdfBookmarkModel::setDocument(document->document());
+ emit documentChanged();
+}
+
+QT_END_NAMESPACE
+
+#include "moc_qquickpdfbookmarkmodel_p.cpp"
diff --git a/src/pdfquick/qquickpdfbookmarkmodel_p.h b/src/pdfquick/qquickpdfbookmarkmodel_p.h
new file mode 100644
index 000000000..1276be058
--- /dev/null
+++ b/src/pdfquick/qquickpdfbookmarkmodel_p.h
@@ -0,0 +1,53 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QQUICKPDFBOOKMARKMODEL_P_H
+#define QQUICKPDFBOOKMARKMODEL_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtPdfQuick/private/qtpdfquickglobal_p.h>
+#include <QtPdfQuick/private/qquickpdfdocument_p.h>
+#include <QtPdf/qpdfbookmarkmodel.h>
+
+#include <QQmlEngine>
+
+QT_BEGIN_NAMESPACE
+
+class Q_PDFQUICK_EXPORT QQuickPdfBookmarkModel : public QPdfBookmarkModel
+{
+ Q_OBJECT
+ Q_PROPERTY(QQuickPdfDocument* document READ document WRITE setDocument NOTIFY documentChanged)
+ QML_NAMED_ELEMENT(PdfBookmarkModel)
+ QML_ADDED_IN_VERSION(6, 4)
+
+public:
+ explicit QQuickPdfBookmarkModel(QObject *parent = nullptr);
+ ~QQuickPdfBookmarkModel() override;
+
+ QQuickPdfDocument *document() const;
+ void setDocument(QQuickPdfDocument *document);
+
+Q_SIGNALS:
+ void documentChanged();
+
+private:
+ QQuickPdfDocument *m_quickDocument;
+
+ Q_DISABLE_COPY(QQuickPdfBookmarkModel)
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QQuickPdfBookmarkModel)
+
+#endif // QQUICKPDFBOOKMARKMODEL_P_H
diff --git a/src/pdfquick/qquickpdfdocument.cpp b/src/pdfquick/qquickpdfdocument.cpp
new file mode 100644
index 000000000..9770900db
--- /dev/null
+++ b/src/pdfquick/qquickpdfdocument.cpp
@@ -0,0 +1,271 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qquickpdfdocument_p.h"
+#include <private/qpdffile_p.h>
+#include <QtCore/qmetatype.h>
+#include <QtCore/qstandardpaths.h>
+#include <QtQml/qqmlcontext.h>
+#include <QtQml/qqmlengine.h>
+#include <QtQuick/qquickitem.h>
+#include <QtQml/qqmlfile.h>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \qmltype PdfDocument
+//! \instantiates QQuickPdfDocument
+ \inqmlmodule QtQuick.Pdf
+ \ingroup pdf
+ \brief A representation of a PDF document.
+ \since 5.15
+
+ PdfDocument provides access to PDF document meta-information.
+ It is not necessary for rendering, as it is enough to use an
+ \l Image with source set to the URL of the PDF.
+*/
+
+/*
+ Constructs a PDF document.
+*/
+QQuickPdfDocument::QQuickPdfDocument(QObject *parent)
+ : QObject(parent)
+{
+}
+
+/*!
+ \internal
+*/
+QQuickPdfDocument::~QQuickPdfDocument()
+{
+ delete m_carrierFile;
+};
+
+void QQuickPdfDocument::classBegin()
+{
+ m_doc = static_cast<QPdfDocument *>(qmlExtendedObject(this));
+ Q_ASSERT(m_doc);
+ connect(m_doc, &QPdfDocument::passwordChanged, this, [this]() -> void {
+ if (resolvedSource().isValid())
+ m_doc->load(QQmlFile::urlToLocalFileOrQrc(resolvedSource()));
+ });
+ connect(m_doc, &QPdfDocument::statusChanged, this, [this] (QPdfDocument::Status status) {
+ emit errorChanged();
+ if (status == QPdfDocument::Status::Ready)
+ emit metaDataChanged();
+ });
+ if (m_doc->error() == QPdfDocument::Error::IncorrectPassword)
+ emit m_doc->passwordRequired();
+}
+
+/*!
+ \qmlproperty url PdfDocument::source
+
+ This property holds a URL pointing to the PDF file to be loaded.
+
+ \note At this time, only local filesystem URLs are supported.
+*/
+void QQuickPdfDocument::setSource(QUrl source)
+{
+ if (m_source == source)
+ return;
+
+ m_source = source;
+ m_maxPageWidthHeight = QSizeF();
+ if (m_carrierFile)
+ m_carrierFile->deleteLater();
+ m_carrierFile = nullptr;
+ emit sourceChanged();
+ const QQmlContext *context = qmlContext(this);
+ m_resolvedSource = context ? context->resolvedUrl(source) : source;
+ if (m_resolvedSource.isValid())
+ m_doc->load(QQmlFile::urlToLocalFileOrQrc(m_resolvedSource));
+}
+
+/*!
+ \qmlproperty string PdfDocument::error
+
+ This property holds a translated string representation of the current
+ error, if any.
+
+ \sa status
+*/
+QString QQuickPdfDocument::error() const
+{
+ switch (m_doc->error()) {
+ case QPdfDocument::Error::None:
+ return tr("no error");
+ break;
+ case QPdfDocument::Error::Unknown:
+ break;
+ case QPdfDocument::Error::DataNotYetAvailable:
+ return tr("data not yet available");
+ break;
+ case QPdfDocument::Error::FileNotFound:
+ return tr("file not found");
+ break;
+ case QPdfDocument::Error::InvalidFileFormat:
+ return tr("invalid file format");
+ break;
+ case QPdfDocument::Error::IncorrectPassword:
+ return tr("incorrect password");
+ break;
+ case QPdfDocument::Error::UnsupportedSecurityScheme:
+ return tr("unsupported security scheme");
+ break;
+ }
+ return tr("unknown error");
+}
+
+/*!
+ \qmlproperty string PdfDocument::password
+
+ This property holds the document password. If the passwordRequired()
+ signal is emitted, the UI should prompt the user and then set this
+ property so that document opening can continue.
+*/
+
+/*!
+ \qmlproperty int PdfDocument::pageCount
+
+ This property holds the number of pages the PDF contains.
+*/
+
+/*!
+ \qmlsignal PdfDocument::passwordRequired()
+
+ This signal is emitted when the PDF requires a password in order to open.
+ The UI in a typical PDF viewer should prompt the user for the password
+ and then set the password property when the user has provided it.
+*/
+
+/*!
+ \qmlmethod size PdfDocument::pagePointSize(int page)
+
+ Returns the size of the given \a page in points.
+*/
+
+qreal QQuickPdfDocument::maxPageWidth() const
+{
+ updateMaxPageSize();
+ return m_maxPageWidthHeight.width();
+}
+
+qreal QQuickPdfDocument::maxPageHeight() const
+{
+ updateMaxPageSize();
+ return m_maxPageWidthHeight.height();
+}
+
+QPdfDocument *QQuickPdfDocument::document() const
+{
+ return m_doc;
+}
+
+/*!
+ \internal
+ Returns a QPdfFile instance that can carry this document down into
+ QPdfIOHandler::load(QIODevice *). It should not be used for other purposes.
+*/
+QPdfFile *QQuickPdfDocument::carrierFile()
+{
+ if (!m_carrierFile)
+ m_carrierFile = new QPdfFile(m_doc);
+ return m_carrierFile;
+}
+
+void QQuickPdfDocument::updateMaxPageSize() const
+{
+ if (m_maxPageWidthHeight.isValid())
+ return;
+ qreal w = 0;
+ qreal h = 0;
+ const int count = m_doc->pageCount();
+ for (int i = 0; i < count; ++i) {
+ auto size = m_doc->pagePointSize(i);
+ w = qMax(w, size.width());
+ h = qMax(w, size.height());
+ }
+ m_maxPageWidthHeight = QSizeF(w, h);
+}
+
+/*!
+ \qmlproperty real PdfDocument::maxPageWidth
+
+ This property holds the width of the widest page in the document, in points.
+*/
+
+/*!
+ \qmlproperty real PdfDocument::maxPageHeight
+
+ This property holds the height of the tallest page in the document, in points.
+*/
+
+/*!
+ \qmlproperty string PdfDocument::title
+
+ This property holds the document's title. A typical viewer UI can bind this
+ to the \c Window.title property.
+*/
+
+/*!
+ \qmlproperty string PdfDocument::author
+
+ This property holds the name of the person who created the document.
+*/
+
+/*!
+ \qmlproperty string PdfDocument::subject
+
+ This property holds the subject of the document.
+*/
+
+/*!
+ \qmlproperty string PdfDocument::keywords
+
+ This property holds the keywords associated with the document.
+*/
+
+/*!
+ \qmlproperty string PdfDocument::creator
+
+ If the document was converted to PDF from another format, this property
+ holds the name of the software that created the original document.
+*/
+
+/*!
+ \qmlproperty string PdfDocument::producer
+
+ If the document was converted to PDF from another format, this property
+ holds the name of the software that converted it to PDF.
+*/
+
+/*!
+ \qmlproperty date PdfDocument::creationDate
+
+ This property holds the date and time the document was created.
+*/
+
+/*!
+ \qmlproperty date PdfDocument::modificationDate
+
+ This property holds the date and time the document was most recently
+ modified.
+*/
+
+/*!
+ \qmlproperty enum PdfDocument::status
+
+ This property tells the current status of the document. The possible values are:
+
+ \value PdfDocument.Null The initial status after the document has been created or after it has been closed.
+ \value PdfDocument.Loading The status after load() has been called and before the document is fully loaded.
+ \value PdfDocument.Ready The status when the document is fully loaded and its data can be accessed.
+ \value PdfDocument.Unloading The status after close() has been called on an open document.
+ At this point the document is still valid and all its data can be accessed.
+ \value PdfDocument.Error The status after Loading, if loading has failed.
+*/
+
+QT_END_NAMESPACE
+
+#include "moc_qquickpdfdocument_p.cpp"
diff --git a/src/pdfquick/qquickpdfdocument_p.h b/src/pdfquick/qquickpdfdocument_p.h
new file mode 100644
index 000000000..95ded7f8b
--- /dev/null
+++ b/src/pdfquick/qquickpdfdocument_p.h
@@ -0,0 +1,105 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QQUICKPDFDOCUMENT_P_H
+#define QQUICKPDFDOCUMENT_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtPdfQuick/private/qtpdfquickglobal_p.h>
+#include <QtPdf/QPdfDocument>
+
+#include <QtQml/QQmlEngine>
+#include <QtQml/QQmlParserStatus>
+#include <QtCore/QDateTime>
+#include <QtCore/QUrl>
+
+QT_BEGIN_NAMESPACE
+
+class QPdfFile;
+
+class Q_PDFQUICK_EXPORT QQuickPdfDocument : public QObject, public QQmlParserStatus
+{
+ Q_OBJECT
+ Q_INTERFACES(QQmlParserStatus)
+
+ Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged FINAL)
+ Q_PROPERTY(qreal maxPageWidth READ maxPageWidth NOTIFY metaDataChanged FINAL)
+ Q_PROPERTY(qreal maxPageHeight READ maxPageHeight NOTIFY metaDataChanged FINAL)
+ Q_PROPERTY(QString error READ error NOTIFY errorChanged FINAL)
+
+ Q_PROPERTY(QString title READ title NOTIFY metaDataChanged FINAL)
+ Q_PROPERTY(QString subject READ subject NOTIFY metaDataChanged FINAL)
+ Q_PROPERTY(QString author READ author NOTIFY metaDataChanged FINAL)
+ Q_PROPERTY(QString keywords READ keywords NOTIFY metaDataChanged FINAL)
+ Q_PROPERTY(QString producer READ producer NOTIFY metaDataChanged FINAL)
+ Q_PROPERTY(QString creator READ creator NOTIFY metaDataChanged FINAL)
+ Q_PROPERTY(QDateTime creationDate READ creationDate NOTIFY metaDataChanged FINAL)
+ Q_PROPERTY(QDateTime modificationDate READ modificationDate NOTIFY metaDataChanged FINAL)
+ QML_NAMED_ELEMENT(PdfDocument)
+ QML_EXTENDED(QPdfDocument)
+ QML_ADDED_IN_VERSION(5, 15)
+
+public:
+ explicit QQuickPdfDocument(QObject *parent = nullptr);
+ ~QQuickPdfDocument() override;
+
+ void classBegin() override;
+ void componentComplete() override {}
+
+ QUrl source() const { return m_source; }
+ void setSource(QUrl source);
+ QUrl resolvedSource() const { return m_resolvedSource; }
+
+ QString error() const;
+
+ QString title() { return m_doc->metaData(QPdfDocument::MetaDataField::Title).toString(); }
+ QString author() { return m_doc->metaData(QPdfDocument::MetaDataField::Author).toString(); }
+ QString subject() { return m_doc->metaData(QPdfDocument::MetaDataField::Subject).toString(); }
+ QString keywords() { return m_doc->metaData(QPdfDocument::MetaDataField::Keywords).toString(); }
+ QString producer() { return m_doc->metaData(QPdfDocument::MetaDataField::Producer).toString(); }
+ QString creator() { return m_doc->metaData(QPdfDocument::MetaDataField::Creator).toString(); }
+ QDateTime creationDate() { return m_doc->metaData(QPdfDocument::MetaDataField::CreationDate).toDateTime(); }
+ QDateTime modificationDate() { return m_doc->metaData(QPdfDocument::MetaDataField::ModificationDate).toDateTime(); }
+
+ qreal maxPageWidth() const;
+ qreal maxPageHeight() const;
+
+Q_SIGNALS:
+ void sourceChanged();
+ void errorChanged();
+ void metaDataChanged();
+
+private:
+ QPdfDocument *document() const;
+ QPdfFile *carrierFile();
+ void updateMaxPageSize() const;
+
+private:
+ QUrl m_source;
+ QUrl m_resolvedSource;
+ QPdfDocument *m_doc = nullptr;
+ QPdfFile *m_carrierFile = nullptr;
+ mutable QSizeF m_maxPageWidthHeight;
+
+ friend class QQuickPdfBookmarkModel;
+ friend class QQuickPdfLinkModel;
+ friend class QQuickPdfPageImage;
+ friend class QQuickPdfSearchModel;
+ friend class QQuickPdfSelection;
+
+ Q_DISABLE_COPY(QQuickPdfDocument)
+};
+
+QT_END_NAMESPACE
+
+#endif // QQUICKPDFDOCUMENT_P_H
diff --git a/src/pdfquick/qquickpdflinkmodel.cpp b/src/pdfquick/qquickpdflinkmodel.cpp
new file mode 100644
index 000000000..469d13faf
--- /dev/null
+++ b/src/pdfquick/qquickpdflinkmodel.cpp
@@ -0,0 +1,109 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qquickpdflinkmodel_p.h"
+#include <QQuickItem>
+#include <QQmlEngine>
+#include <QStandardPaths>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \qmltype PdfLinkModel
+//! \instantiates QQuickPdfLinkModel
+ \inqmlmodule QtQuick.Pdf
+ \ingroup pdf
+ \brief A representation of links within a PDF document.
+ \since 5.15
+
+ PdfLinkModel provides the geometry and the destination for each link
+ that the specified \l page contains.
+
+ The available model roles are:
+
+ \value rectangle
+ Bounding rectangle around the link.
+ \value url
+ If the link is a web link, the URL for that; otherwise an empty URL.
+ \value page
+ If the link is an internal link, the page number to which the link should jump; otherwise \c {-1}.
+ \value location
+ If the link is an internal link, the location on the page to which the link should jump.
+ \value zoom
+ If the link is an internal link, the intended zoom level on the destination page.
+
+ Normally it will be used with \l {QtQuick::Repeater}{Repeater} to visualize
+ the links and provide the ability to click them:
+
+ \qml
+ Repeater {
+ model: PdfLinkModel {
+ document: root.document
+ page: image.currentFrame
+ }
+ delegate: Rectangle {
+ required property rect rectangle
+ required property url url
+ required property int page
+ color: "transparent"
+ border.color: "lightgrey"
+ x: rectangle.x
+ y: rectangle.y
+ width: rectangle.width
+ height: rectangle.height
+ HoverHandler { cursorShape: Qt.PointingHandCursor }
+ TapHandler {
+ onTapped: {
+ if (page >= 0)
+ image.currentFrame = page
+ else
+ Qt.openUrlExternally(url)
+ }
+ }
+ }
+ }
+ \endqml
+
+ \note General-purpose PDF viewing capabilities are provided by
+ \c PdfScrollablePageView and \c PdfMultiPageView. PdfLinkModel is only needed
+ when building PDF view components from scratch.
+*/
+
+QQuickPdfLinkModel::QQuickPdfLinkModel(QObject *parent)
+ : QPdfLinkModel(parent)
+{
+}
+
+/*!
+ \internal
+*/
+QQuickPdfLinkModel::~QQuickPdfLinkModel() = default;
+
+/*!
+ \qmlproperty PdfDocument PdfLinkModel::document
+
+ This property holds the PDF document in which links are to be found.
+*/
+QQuickPdfDocument *QQuickPdfLinkModel::document() const
+{
+ return m_quickDocument;
+}
+
+void QQuickPdfLinkModel::setDocument(QQuickPdfDocument *document)
+{
+ if (document == m_quickDocument)
+ return;
+ m_quickDocument = document;
+ if (document)
+ QPdfLinkModel::setDocument(document->document());
+}
+
+/*!
+ \qmlproperty int PdfLinkModel::page
+
+ This property holds the page number on which links are to be found.
+*/
+
+QT_END_NAMESPACE
+
+#include "moc_qquickpdflinkmodel_p.cpp"
diff --git a/src/pdfquick/qquickpdflinkmodel_p.h b/src/pdfquick/qquickpdflinkmodel_p.h
new file mode 100644
index 000000000..44314b2b1
--- /dev/null
+++ b/src/pdfquick/qquickpdflinkmodel_p.h
@@ -0,0 +1,49 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QQUICKPDFLINKMODEL_P_H
+#define QQUICKPDFLINKMODEL_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtPdfQuick/private/qtpdfquickglobal_p.h>
+#include <QtPdfQuick/private/qquickpdfdocument_p.h>
+#include <QtPdf/private/qpdflinkmodel_p.h>
+
+#include <QtQml/QQmlEngine>
+
+QT_BEGIN_NAMESPACE
+
+class Q_PDFQUICK_EXPORT QQuickPdfLinkModel : public QPdfLinkModel
+{
+ Q_OBJECT
+ Q_PROPERTY(QQuickPdfDocument *document READ document WRITE setDocument NOTIFY documentChanged)
+ QML_NAMED_ELEMENT(PdfLinkModel)
+ QML_ADDED_IN_VERSION(5, 15)
+
+public:
+ explicit QQuickPdfLinkModel(QObject *parent = nullptr);
+ ~QQuickPdfLinkModel() override;
+
+ QQuickPdfDocument *document() const;
+ void setDocument(QQuickPdfDocument *document);
+
+private:
+ QQuickPdfDocument *m_quickDocument;
+ Q_DISABLE_COPY(QQuickPdfLinkModel)
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QQuickPdfLinkModel)
+
+#endif // QQUICKPDFLINKMODEL_P_H
diff --git a/src/pdfquick/qquickpdfpageimage.cpp b/src/pdfquick/qquickpdfpageimage.cpp
new file mode 100644
index 000000000..f2da067f1
--- /dev/null
+++ b/src/pdfquick/qquickpdfpageimage.cpp
@@ -0,0 +1,141 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qquickpdfpageimage_p.h"
+#include "qquickpdfdocument_p.h"
+#include <private/qpdffile_p.h>
+#include <QtQuick/private/qquickimage_p_p.h>
+
+QT_BEGIN_NAMESPACE
+
+Q_LOGGING_CATEGORY(qLcImg, "qt.pdf.image")
+
+/*!
+ \qmltype PdfPageImage
+//! \instantiates QQuickPdfPageImage
+ \inqmlmodule QtQuick.Pdf
+ \ingroup pdf
+ \inherits Image
+ \brief Displays one page from a PDF document.
+ \since 6.4
+
+ The PdfPageImage type is an Image specialized to render a page from a PDF document.
+*/
+
+class QQuickPdfPageImagePrivate: public QQuickImagePrivate
+{
+public:
+ QQuickPdfPageImagePrivate() : QQuickImagePrivate() {}
+
+ QQuickPdfDocument *doc = nullptr;
+};
+
+QQuickPdfPageImage::QQuickPdfPageImage(QQuickItem *parent)
+ : QQuickImage(*(new QQuickPdfPageImagePrivate), parent)
+{
+}
+
+/*!
+ \internal
+*/
+QQuickPdfPageImage::~QQuickPdfPageImage()
+{
+ Q_D(QQuickPdfPageImage);
+ // cancel any async rendering job that is running on my behalf
+ d->pix.clear();
+}
+
+/*!
+ \qmlproperty PdfDocument PdfPageImage::document
+
+ This property holds the PDF document from which to render an image.
+*/
+void QQuickPdfPageImage::setDocument(QQuickPdfDocument *document)
+{
+ Q_D(QQuickPdfPageImage);
+ if (d->doc == document)
+ return;
+
+ if (d->doc)
+ disconnect(d->doc->document(), &QPdfDocument::statusChanged, this, &QQuickPdfPageImage::documentStatusChanged);
+ d->doc = document;
+ if (document) {
+ connect(document->document(), &QPdfDocument::statusChanged, this, &QQuickPdfPageImage::documentStatusChanged);
+ if (document->document()->status() == QPdfDocument::Status::Ready)
+ setSource(document->resolvedSource()); // calls load()
+ }
+ emit documentChanged();
+}
+
+QQuickPdfDocument *QQuickPdfPageImage::document() const
+{
+ Q_D(const QQuickPdfPageImage);
+ return d->doc;
+}
+
+void QQuickPdfPageImage::load()
+{
+ Q_D(QQuickPdfPageImage);
+ QUrl url = source();
+ if (!d->doc || !d->doc->carrierFile()) {
+ if (!url.isEmpty()) {
+ qmlWarning(this) << "document property not set: falling back to inefficient loading of " << url;
+ QQuickImageBase::load();
+ }
+ return;
+ }
+ if (url != d->doc->resolvedSource()) {
+ url = d->doc->resolvedSource();
+ qmlWarning(this) << "document and source properties in conflict: preferring document source " << url;
+ }
+ auto carrierFile = d->doc->carrierFile();
+ static int thisRequestProgress = -1;
+ static int thisRequestFinished = -1;
+ if (thisRequestProgress == -1) {
+ thisRequestProgress =
+ QQuickImageBase::staticMetaObject.indexOfSlot("requestProgress(qint64,qint64)");
+ thisRequestFinished =
+ QQuickImageBase::staticMetaObject.indexOfSlot("requestFinished()");
+ }
+
+ d->pix.loadImageFromDevice(qmlEngine(this), carrierFile, url,
+ d->sourceClipRect.toRect(), d->sourcesize * d->devicePixelRatio,
+ QQuickImageProviderOptions(), d->currentFrame, d->frameCount);
+
+ qCDebug(qLcImg) << "loading page" << d->currentFrame << "of" << d->frameCount
+ << "from" << carrierFile->fileName() << "status" << d->pix.status();
+
+ switch (d->pix.status()) {
+ case QQuickPixmap::Ready:
+ pixmapChange();
+ break;
+ case QQuickPixmap::Loading:
+ d->pix.connectFinished(this, thisRequestFinished);
+ d->pix.connectDownloadProgress(this, thisRequestProgress);
+ if (d->progress != 0.0) {
+ d->progress = 0.0;
+ emit progressChanged(d->progress);
+ }
+ if (d->status != Loading) {
+ d->status = Loading;
+ emit statusChanged(d->status);
+ }
+ break;
+ default:
+ qCDebug(qLcImg) << "unexpected status" << d->pix.status();
+ break;
+ }
+}
+
+void QQuickPdfPageImage::documentStatusChanged()
+{
+ Q_D(QQuickPdfPageImage);
+ const auto status = d->doc->document()->status();
+ qCDebug(qLcImg) << "document status" << status;
+ if (status == QPdfDocument::Status::Ready)
+ setSource(d->doc->resolvedSource()); // calls load()
+}
+
+QT_END_NAMESPACE
+
+#include "moc_qquickpdfpageimage_p.cpp"
diff --git a/src/pdfquick/qquickpdfpageimage_p.h b/src/pdfquick/qquickpdfpageimage_p.h
new file mode 100644
index 000000000..daff052ac
--- /dev/null
+++ b/src/pdfquick/qquickpdfpageimage_p.h
@@ -0,0 +1,52 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QQUICKPDFPAGEIMAGE_P_H
+#define QQUICKPDFPAGEIMAGE_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtPdfQuick/private/qtpdfquickglobal_p.h>
+#include <QtQuick/private/qquickimage_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQuickPdfDocument;
+class QQuickPdfPageImagePrivate;
+class Q_PDFQUICK_EXPORT QQuickPdfPageImage : public QQuickImage
+{
+ Q_OBJECT
+ Q_PROPERTY(QQuickPdfDocument* document READ document WRITE setDocument NOTIFY documentChanged FINAL)
+ QML_NAMED_ELEMENT(PdfPageImage)
+ QML_ADDED_IN_VERSION(6, 4)
+
+public:
+ QQuickPdfPageImage(QQuickItem *parent = nullptr);
+ ~QQuickPdfPageImage() override;
+
+ void setDocument(QQuickPdfDocument *document);
+ QQuickPdfDocument *document() const;
+
+signals:
+ void documentChanged();
+
+protected:
+ void load() override;
+ void documentStatusChanged();
+
+private:
+ Q_DECLARE_PRIVATE(QQuickPdfPageImage)
+};
+
+QT_END_NAMESPACE
+
+#endif // QQUICKPDFPAGEIMAGE_P_H
diff --git a/src/pdfquick/qquickpdfpagenavigator.cpp b/src/pdfquick/qquickpdfpagenavigator.cpp
new file mode 100644
index 000000000..939d928e9
--- /dev/null
+++ b/src/pdfquick/qquickpdfpagenavigator.cpp
@@ -0,0 +1,130 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qquickpdfpagenavigator_p.h"
+#include <QLoggingCategory>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \qmltype PdfPageNavigator
+//! \instantiates QQuickPdfPageNavigator
+ \inqmlmodule QtQuick.Pdf
+ \ingroup pdf
+ \brief History of the destinations visited within a PDF Document.
+ \since 5.15
+
+ PdfPageNavigator remembers which destinations the user has visited in a PDF
+ document, and provides the ability to traverse backward and forward.
+*/
+
+QQuickPdfPageNavigator::QQuickPdfPageNavigator(QObject *parent)
+ : QObject(parent)
+{
+}
+
+/*!
+ \internal
+*/
+QQuickPdfPageNavigator::~QQuickPdfPageNavigator() = default;
+
+/*!
+ \internal
+*/
+QPdfPageNavigator *QQuickPdfPageNavigator::navStack()
+{
+ return static_cast<QPdfPageNavigator *>(qmlExtendedObject(this));
+}
+
+/*!
+ \qmlmethod void PdfPageNavigator::forward()
+
+ Goes back to the page, location and zoom level that was being viewed before
+ back() was called, and then emits the \l jumped() signal.
+
+ If a new destination was pushed since the last time \l back() was called,
+ the forward() function does nothing, because there is a branch in the
+ timeline which causes the "future" to be lost.
+*/
+
+/*!
+ \qmlmethod void PdfPageNavigator::back()
+
+ Pops the stack, updates the \l currentPage, \l currentLocation and
+ \l currentZoom properties to the most-recently-viewed destination, and then
+ emits the \l jumped() signal.
+*/
+
+/*!
+ \qmlproperty int PdfPageNavigator::currentPage
+
+ This property holds the current page that is being viewed.
+ If there is no current page, it holds \c -1.
+*/
+
+/*!
+ \qmlproperty point PdfPageNavigator::currentLocation
+
+ This property holds the current location on the page that is being viewed.
+*/
+
+/*!
+ \qmlproperty real PdfPageNavigator::currentZoom
+
+ This property holds the magnification scale on the page that is being viewed.
+*/
+
+/*!
+ \qmlmethod void PdfPageNavigator::jump(int page, point location, qreal zoom, bool emitJumped)
+
+ Adds the given destination, consisting of \a page, \a location, and \a zoom,
+ to the history of visited locations. If \a emitJumped is \c false, the
+ \l jumped() signal will not be emitted.
+
+ If forwardAvailable is \c true, calling this function represents a branch
+ in the timeline which causes the "future" to be lost, and therefore
+ forwardAvailable will change to \c false.
+*/
+
+/*!
+ \qmlmethod void PdfPageNavigator::update(int page, point location, qreal zoom)
+
+ Modifies the current destination, consisting of \a page, \a location and \a zoom.
+
+ This can be called periodically while the user is manually moving around
+ the document, so that after back() is called, forward() will jump back to
+ the most-recently-viewed destination rather than the destination that was
+ last specified by jump().
+
+ The \c currentZoomChanged, \c currentPageChanged and \c currentLocationChanged
+ signals will be emitted if the respective properties are actually changed.
+ The \l jumped signal is not emitted, because this operation
+ represents smooth movement rather than a navigational jump.
+*/
+
+/*!
+ \qmlproperty bool PdfPageNavigator::backAvailable
+ \readonly
+
+ Holds \c true if a \e back destination is available in the history.
+*/
+
+/*!
+ \qmlproperty bool PdfPageNavigator::forwardAvailable
+ \readonly
+
+ Holds \c true if a \e forward destination is available in the history.
+*/
+
+/*!
+ \qmlsignal PdfPageNavigator::jumped(int page, point location, qreal zoom)
+
+ This signal is emitted when an abrupt jump occurs, to the specified \a page
+ index, \a location on the page, and \a zoom level; but \e not when simply
+ scrolling through the document one page at a time. That is, forward(),
+ back() and jump() always emit this signal; update() does not.
+*/
+
+QT_END_NAMESPACE
+
+#include "moc_qquickpdfpagenavigator_p.cpp"
diff --git a/src/pdfquick/qquickpdfpagenavigator_p.h b/src/pdfquick/qquickpdfpagenavigator_p.h
new file mode 100644
index 000000000..2a2d92d6b
--- /dev/null
+++ b/src/pdfquick/qquickpdfpagenavigator_p.h
@@ -0,0 +1,55 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QQUICKPDFPAGENAVIGATOR_P_H
+#define QQUICKPDFPAGENAVIGATOR_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtPdfQuick/private/qtpdfquickglobal_p.h>
+#include <QtPdf/qpdfpagenavigator.h>
+#include <QtPdf/private/qpdflink_p.h>
+
+#include <QQmlEngine>
+
+QT_BEGIN_NAMESPACE
+
+struct Q_PDFQUICK_EXPORT QPdfLinkForeign
+{
+ Q_GADGET
+ QML_FOREIGN(QPdfLink)
+ QML_VALUE_TYPE(pdfLink)
+ QML_ADDED_IN_VERSION(6, 4)
+};
+
+class Q_PDFQUICK_EXPORT QQuickPdfPageNavigator : public QObject
+{
+ Q_OBJECT
+ QML_EXTENDED(QPdfPageNavigator)
+ QML_NAMED_ELEMENT(PdfPageNavigator)
+ QML_ADDED_IN_VERSION(5, 15)
+
+public:
+ explicit QQuickPdfPageNavigator(QObject *parent = nullptr);
+ ~QQuickPdfPageNavigator() override;
+
+private:
+ QPdfPageNavigator *navStack();
+
+ Q_DISABLE_COPY(QQuickPdfPageNavigator)
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QQuickPdfPageNavigator)
+
+#endif // QQUICKPDFPAGENAVIGATOR_P_H
diff --git a/src/pdfquick/qquickpdfsearchmodel.cpp b/src/pdfquick/qquickpdfsearchmodel.cpp
new file mode 100644
index 000000000..896584ad7
--- /dev/null
+++ b/src/pdfquick/qquickpdfsearchmodel.cpp
@@ -0,0 +1,282 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qquickpdfsearchmodel_p.h"
+#include <QtCore/qloggingcategory.h>
+
+QT_BEGIN_NAMESPACE
+
+Q_LOGGING_CATEGORY(qLcSearch, "qt.pdf.search")
+
+/*!
+ \qmltype PdfSearchModel
+//! \instantiates QQuickPdfSearchModel
+ \inqmlmodule QtQuick.Pdf
+ \ingroup pdf
+ \brief A representation of text search results within a PDF Document.
+ \since 5.15
+
+ PdfSearchModel provides the ability to search for text strings within a
+ document and get the geometric locations of matches on each page.
+*/
+
+QQuickPdfSearchModel::QQuickPdfSearchModel(QObject *parent)
+ : QPdfSearchModel(parent)
+{
+ connect(this, &QPdfSearchModel::searchStringChanged,
+ this, &QQuickPdfSearchModel::onResultsChanged);
+}
+
+/*!
+ \internal
+*/
+QQuickPdfSearchModel::~QQuickPdfSearchModel() = default;
+
+QQuickPdfDocument *QQuickPdfSearchModel::document() const
+{
+ return m_quickDocument;
+}
+
+void QQuickPdfSearchModel::setDocument(QQuickPdfDocument *document)
+{
+ if (document == m_quickDocument || !document)
+ return;
+
+ m_quickDocument = document;
+ QPdfSearchModel::setDocument(document->document());
+}
+
+/*!
+ \qmlproperty list<list<point>> PdfSearchModel::currentResultBoundingPolygons
+
+ A set of paths in a form that can be bound to the \c paths property of a
+ \l {QtQuick::PathMultiline}{PathMultiline} instance to render a batch of
+ rectangles around the regions comprising the search result \l currentResult
+ on \l currentPage. This is normally used to highlight one search result
+ at a time, in a UI that allows stepping through the results:
+
+ \qml
+ PdfDocument {
+ id: doc
+ }
+ PdfSearchModel {
+ id: searchModel
+ document: doc
+ currentPage: view.currentPage
+ currentResult: ...
+ }
+ Shape {
+ ShapePath {
+ PathMultiline {
+ paths: searchModel.currentResultBoundingPolygons
+ }
+ }
+ }
+ \endqml
+
+ It becomes empty whenever \c {currentPage != currentResultLink.page}.
+
+ \sa PathMultiline
+*/
+QList<QPolygonF> QQuickPdfSearchModel::currentResultBoundingPolygons() const
+{
+ QList<QPolygonF> ret;
+ const auto result = currentResultLink();
+ if (result.page() != m_currentPage)
+ return ret;
+ for (auto rect : result.rectangles())
+ ret << QPolygonF(rect);
+ return ret;
+}
+
+/*!
+ \qmlproperty point PdfSearchModel::currentResultBoundingRect
+
+ The bounding box containing all \l currentResultBoundingPolygons,
+ if \c {currentPage == currentResultLink.page}; otherwise, an invalid rectangle.
+*/
+QRectF QQuickPdfSearchModel::currentResultBoundingRect() const
+{
+ QRectF ret;
+ const auto result = currentResultLink();
+ if (result.page() != m_currentPage)
+ return ret;
+ auto rects = result.rectangles();
+ if (!rects.isEmpty()) {
+ ret = rects.takeFirst();
+ for (auto rect : rects)
+ ret = ret.united(rect);
+ }
+ return ret;
+}
+
+void QQuickPdfSearchModel::onResultsChanged()
+{
+ emit currentPageBoundingPolygonsChanged();
+ emit currentResultBoundingPolygonsChanged();
+}
+
+/*!
+ \qmlproperty list<list<point>> PdfSearchModel::currentPageBoundingPolygons
+
+ A set of paths in a form that can be bound to the \c paths property of a
+ \l {QtQuick::PathMultiline}{PathMultiline} instance to render a batch of
+ rectangles around all the regions where search results are found on
+ \l currentPage:
+
+ \qml
+ PdfDocument {
+ id: doc
+ }
+ PdfSearchModel {
+ id: searchModel
+ document: doc
+ }
+ Shape {
+ ShapePath {
+ PathMultiline {
+ paths: searchModel.matchGeometry(view.currentPage)
+ }
+ }
+ }
+ \endqml
+
+ \sa PathMultiline
+*/
+QList<QPolygonF> QQuickPdfSearchModel::currentPageBoundingPolygons() const
+{
+ return const_cast<QQuickPdfSearchModel *>(this)->boundingPolygonsOnPage(m_currentPage);
+}
+
+/*!
+ \qmlmethod list<list<point>> PdfSearchModel::boundingPolygonsOnPage(int page)
+
+ Returns a set of paths in a form that can be bound to the \c paths property of a
+ \l {QtQuick::PathMultiline}{PathMultiline} instance, which is used to render a
+ batch of rectangles around all the matching locations on the \a page:
+
+ \qml
+ PdfDocument {
+ id: doc
+ }
+ PdfSearchModel {
+ id: searchModel
+ document: doc
+ }
+ Shape {
+ ShapePath {
+ PathMultiline {
+ paths: searchModel.matchGeometry(view.currentPage)
+ }
+ }
+ }
+ \endqml
+
+ \sa PathMultiline
+*/
+QList<QPolygonF> QQuickPdfSearchModel::boundingPolygonsOnPage(int page)
+{
+ if (!document() || searchString().isEmpty() || page < 0 || page > document()->document()->pageCount())
+ return {};
+
+ updatePage(page);
+
+ QList<QPolygonF> ret;
+ const auto m = QPdfSearchModel::resultsOnPage(page);
+ for (const auto &result : m) {
+ for (const auto &rect : result.rectangles())
+ ret << QPolygonF(rect);
+ }
+
+ return ret;
+}
+
+/*!
+ \qmlproperty int PdfSearchModel::currentPage
+
+ The page on which \l currentResultBoundingPolygons should provide filtered
+ search results.
+*/
+void QQuickPdfSearchModel::setCurrentPage(int currentPage)
+{
+ if (m_currentPage == currentPage || !document())
+ return;
+
+ const auto pageCount = document()->document()->pageCount();
+ if (currentPage < 0)
+ currentPage = pageCount - 1;
+ else if (currentPage >= pageCount)
+ currentPage = 0;
+
+ m_currentPage = currentPage;
+ if (!m_suspendSignals) {
+ emit currentPageChanged();
+ onResultsChanged();
+ }
+}
+
+/*!
+ \qmlproperty int PdfSearchModel::currentResult
+
+ The result index within the whole set of search results, for which
+ \l currentResultBoundingPolygons should provide the regions to highlight
+ if currentPage matches \c currentResultLink.page.
+*/
+void QQuickPdfSearchModel::setCurrentResult(int currentResult)
+{
+ if (m_currentResult == currentResult)
+ return;
+
+ const int currentResultWas = m_currentResult;
+ const int currentPageWas = m_currentPage;
+ const int resultCount = rowCount({});
+
+ // wrap around at the ends
+ if (currentResult >= resultCount) {
+ currentResult = 0;
+ } else if (currentResult < 0) {
+ currentResult = resultCount - 1;
+ }
+
+ const QPdfLink link = resultAtIndex(currentResult);
+ if (link.isValid()) {
+ setCurrentPage(link.page());
+ m_currentResult = currentResult;
+ emit currentResultChanged();
+ emit currentResultLinkChanged();
+ emit currentResultBoundingPolygonsChanged();
+ emit currentResultBoundingRectChanged();
+ qCDebug(qLcSearch) << "currentResult was" << currentResultWas
+ << "requested" << currentResult << "on page" << currentPageWas
+ << "->" << m_currentResult << "on page" << m_currentPage;
+ } else {
+ qWarning() << "failed to find result" << currentResult << "in range 0 ->" << resultCount;
+ }
+}
+
+/*!
+ \qmlproperty QPdfLink PdfSearchModel::currentResultLink
+
+ The result at index \l currentResult.
+*/
+QPdfLink QQuickPdfSearchModel::currentResultLink() const
+{
+ return resultAtIndex(m_currentResult);
+}
+
+/*!
+ \qmlproperty string PdfSearchModel::searchString
+
+ The string to search for.
+*/
+
+/*!
+ \since 6.8
+ \qmlproperty int PdfSearchModel::count
+
+ The number of search results found.
+*/
+
+QT_END_NAMESPACE
+
+#include "moc_qquickpdfsearchmodel_p.cpp"
diff --git a/src/pdfquick/qquickpdfsearchmodel_p.h b/src/pdfquick/qquickpdfsearchmodel_p.h
new file mode 100644
index 000000000..699cd719f
--- /dev/null
+++ b/src/pdfquick/qquickpdfsearchmodel_p.h
@@ -0,0 +1,85 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QQUICKPDFSEARCHMODEL_P_H
+#define QQUICKPDFSEARCHMODEL_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtPdfQuick/private/qtpdfquickglobal_p.h>
+#include <QtPdfQuick/private/qquickpdfdocument_p.h>
+
+#include <QtPdf/qpdfsearchmodel.h>
+#include <QtQml/QQmlEngine>
+
+QT_BEGIN_NAMESPACE
+
+class Q_PDFQUICK_EXPORT QQuickPdfSearchModel : public QPdfSearchModel
+{
+ Q_OBJECT
+ Q_PROPERTY(QQuickPdfDocument *document READ document WRITE setDocument NOTIFY documentChanged)
+ Q_PROPERTY(int currentPage READ currentPage WRITE setCurrentPage NOTIFY currentPageChanged)
+ Q_PROPERTY(int currentResult READ currentResult WRITE setCurrentResult NOTIFY currentResultChanged)
+ Q_PROPERTY(QPdfLink currentResultLink READ currentResultLink NOTIFY currentResultLinkChanged)
+ Q_PROPERTY(QList<QPolygonF> currentPageBoundingPolygons READ currentPageBoundingPolygons NOTIFY currentPageBoundingPolygonsChanged)
+ Q_PROPERTY(QList<QPolygonF> currentResultBoundingPolygons READ currentResultBoundingPolygons NOTIFY currentResultBoundingPolygonsChanged)
+ Q_PROPERTY(QRectF currentResultBoundingRect READ currentResultBoundingRect NOTIFY currentResultBoundingRectChanged)
+ QML_NAMED_ELEMENT(PdfSearchModel)
+ QML_ADDED_IN_VERSION(5, 15)
+
+public:
+ explicit QQuickPdfSearchModel(QObject *parent = nullptr);
+ ~QQuickPdfSearchModel() override;
+
+ QQuickPdfDocument *document() const;
+ void setDocument(QQuickPdfDocument * document);
+
+ Q_INVOKABLE QList<QPolygonF> boundingPolygonsOnPage(int page);
+
+ int currentPage() const { return m_currentPage; }
+ void setCurrentPage(int currentPage);
+
+ int currentResult() const { return m_currentResult; }
+ void setCurrentResult(int currentResult);
+
+ QPdfLink currentResultLink() const;
+ QList<QPolygonF> currentPageBoundingPolygons() const;
+ QList<QPolygonF> currentResultBoundingPolygons() const;
+ QRectF currentResultBoundingRect() const;
+
+signals:
+ void currentPageChanged();
+ void currentResultChanged();
+ void currentResultLinkChanged();
+ void currentPageBoundingPolygonsChanged();
+ void currentResultBoundingPolygonsChanged();
+ void currentResultBoundingRectChanged();
+
+private:
+ void updateResults();
+ void onResultsChanged();
+
+private:
+ QQuickPdfDocument *m_quickDocument = nullptr;
+ int m_currentPage = 0;
+ int m_currentResult = 0;
+ bool m_suspendSignals = false;
+
+ Q_DISABLE_COPY(QQuickPdfSearchModel)
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QQuickPdfSearchModel)
+QML_DECLARE_TYPE(QPdfSelection)
+
+#endif // QQUICKPDFSEARCHMODEL_P_H
diff --git a/src/pdfquick/qquickpdfselection.cpp b/src/pdfquick/qquickpdfselection.cpp
new file mode 100644
index 000000000..4776cb8b4
--- /dev/null
+++ b/src/pdfquick/qquickpdfselection.cpp
@@ -0,0 +1,546 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qquickpdfselection_p.h"
+#include "qquickpdfdocument_p.h"
+#include <QClipboard>
+#include <QGuiApplication>
+#include <QLoggingCategory>
+#include <QQuickItem>
+#include <QQmlEngine>
+#include <QRegularExpression>
+#include <QStandardPaths>
+#include <QtPdf/private/qpdfdocument_p.h>
+
+Q_LOGGING_CATEGORY(qLcIm, "qt.pdf.im")
+
+QT_BEGIN_NAMESPACE
+
+static const QRegularExpression WordDelimiter(QStringLiteral("\\s"));
+
+/*!
+ \qmltype PdfSelection
+//! \instantiates QQuickPdfSelection
+ \inqmlmodule QtQuick.Pdf
+ \ingroup pdf
+ \inherits Item
+ \brief A representation of a text selection within a PDF Document.
+ \since 5.15
+
+ PdfSelection provides the text string and its geometry within a bounding box
+ from one point to another.
+
+ To modify the selection using the mouse, bind \l from and \l to
+ to the suitable properties of an input handler so that they will be set to
+ the positions where the drag gesture begins and ends, respectively; and
+ bind the \l hold property so that it will be set to \c true during the drag
+ gesture and \c false when the gesture ends.
+
+ PdfSelection also directly handles Input Method queries so that text
+ selection handles can be used on platforms such as iOS. For this purpose,
+ it must have keyboard focus.
+*/
+
+QQuickPdfSelection::QQuickPdfSelection(QQuickItem *parent)
+ : QQuickItem(parent)
+{
+#if QT_CONFIG(im)
+ setFlags(ItemIsFocusScope | ItemAcceptsInputMethod);
+#endif
+}
+
+/*!
+ \internal
+*/
+QQuickPdfSelection::~QQuickPdfSelection() = default;
+
+/*!
+ \qmlproperty PdfDocument PdfSelection::document
+
+ This property holds the PDF document in which to select text.
+*/
+QQuickPdfDocument *QQuickPdfSelection::document() const
+{
+ return m_document;
+}
+
+void QQuickPdfSelection::setDocument(QQuickPdfDocument *document)
+{
+ if (m_document == document)
+ return;
+
+ if (m_document) {
+ disconnect(m_document, &QQuickPdfDocument::sourceChanged,
+ this, &QQuickPdfSelection::resetPoints);
+ }
+ m_document = document;
+ emit documentChanged();
+ resetPoints();
+ connect(m_document, &QQuickPdfDocument::sourceChanged,
+ this, &QQuickPdfSelection::resetPoints);
+}
+
+/*!
+ \qmlproperty list<list<point>> PdfSelection::geometry
+
+ A set of paths in a form that can be bound to the \c paths property of a
+ \l {QtQuick::PathMultiline}{PathMultiline} instance to render a batch of
+ rectangles around the text regions that are included in the selection:
+
+ \qml
+ PdfDocument {
+ id: doc
+ }
+ PdfSelection {
+ id: selection
+ document: doc
+ from: textSelectionDrag.centroid.pressPosition
+ to: textSelectionDrag.centroid.position
+ hold: !textSelectionDrag.active
+ }
+ Shape {
+ ShapePath {
+ PathMultiline {
+ paths: selection.geometry
+ }
+ }
+ }
+ DragHandler {
+ id: textSelectionDrag
+ acceptedDevices: PointerDevice.Mouse | PointerDevice.Stylus
+ target: null
+ }
+ \endqml
+
+ \sa PathMultiline
+*/
+QList<QPolygonF> QQuickPdfSelection::geometry() const
+{
+ return m_geometry;
+}
+
+/*!
+ \qmlmethod void PdfSelection::clear()
+
+ Clears the current selection.
+*/
+void QQuickPdfSelection::clear()
+{
+ m_hitPoint = QPointF();
+ m_from = QPointF();
+ m_to = QPointF();
+ m_heightAtAnchor = 0;
+ m_heightAtCursor = 0;
+ m_fromCharIndex = -1;
+ m_toCharIndex = -1;
+ m_text.clear();
+ m_geometry.clear();
+ emit fromChanged();
+ emit toChanged();
+ emit textChanged();
+ emit selectedAreaChanged();
+ QGuiApplication::inputMethod()->update(Qt::ImQueryInput);
+}
+
+/*!
+ \qmlmethod void PdfSelection::selectAll()
+
+ Selects all text on the current \l page.
+*/
+void QQuickPdfSelection::selectAll()
+{
+ if (!m_document)
+ return;
+ QPdfSelection sel = m_document->document()->getAllText(m_page);
+ if (sel.text() != m_text) {
+ m_text = sel.text();
+ if (QGuiApplication::clipboard()->supportsSelection())
+ sel.copyToClipboard(QClipboard::Selection);
+ emit textChanged();
+ }
+
+ if (sel.bounds() != m_geometry) {
+ m_geometry = sel.bounds();
+ emit selectedAreaChanged();
+ }
+#if QT_CONFIG(im)
+ m_fromCharIndex = sel.startIndex();
+ m_toCharIndex = sel.endIndex();
+ if (sel.bounds().isEmpty()) {
+ m_from = QPointF();
+ m_to = QPointF();
+ } else {
+ m_from = sel.bounds().first().boundingRect().topLeft() * m_renderScale;
+ m_to = sel.bounds().last().boundingRect().bottomRight() * m_renderScale - QPointF(0, m_heightAtCursor);
+ }
+
+ QGuiApplication::inputMethod()->update(Qt::ImCursorRectangle | Qt::ImAnchorRectangle);
+#endif
+}
+
+#if QT_CONFIG(im)
+void QQuickPdfSelection::keyReleaseEvent(QKeyEvent *ev)
+{
+ qCDebug(qLcIm) << "release" << ev;
+ const auto &allText = pageText();
+ if (ev == QKeySequence::MoveToPreviousWord) {
+ if (!m_document)
+ return;
+ // iOS sends MoveToPreviousWord first to get to the beginning of the word,
+ // and then SelectNextWord to select the whole word.
+ int i = allText.lastIndexOf(WordDelimiter, m_fromCharIndex - allText.size());
+ if (i < 0)
+ i = 0;
+ else
+ i += 1; // don't select the space before the word
+ auto sel = m_document->document()->getSelectionAtIndex(m_page, i, m_text.size() + m_fromCharIndex - i);
+ update(sel);
+ QGuiApplication::inputMethod()->update(Qt::ImAnchorRectangle);
+ } else if (ev == QKeySequence::SelectNextWord) {
+ if (!m_document)
+ return;
+ int i = allText.indexOf(WordDelimiter, m_toCharIndex);
+ if (i < 0)
+ i = allText.size(); // go to the end of m_textAfter
+ auto sel = m_document->document()->getSelectionAtIndex(m_page, m_fromCharIndex, m_text.size() + i - m_toCharIndex);
+ update(sel);
+ QGuiApplication::inputMethod()->update(Qt::ImCursorRectangle);
+ } else if (ev == QKeySequence::Copy) {
+ copyToClipboard();
+ }
+}
+
+void QQuickPdfSelection::inputMethodEvent(QInputMethodEvent *event)
+{
+ for (auto attr : event->attributes()) {
+ switch (attr.type) {
+ case QInputMethodEvent::Cursor:
+ qCDebug(qLcIm) << "QInputMethodEvent::Cursor: moved to" << attr.start << "len" << attr.length;
+ break;
+ case QInputMethodEvent::Selection: {
+ if (!m_document)
+ return;
+ auto sel = m_document->document()->getSelectionAtIndex(m_page, attr.start, attr.length);
+ update(sel);
+ qCDebug(qLcIm) << "QInputMethodEvent::Selection: from" << attr.start << "len" << attr.length
+ << "result:" << m_fromCharIndex << "->" << m_toCharIndex << sel.boundingRectangle();
+ // the iOS plugin decided that it wanted to change the selection, but still has to be told to move the handles (!?)
+ QGuiApplication::inputMethod()->update(Qt::ImCursorRectangle | Qt::ImAnchorRectangle);
+ break;
+ }
+ case QInputMethodEvent::Language:
+ case QInputMethodEvent::Ruby:
+ case QInputMethodEvent::TextFormat:
+ break;
+ }
+ }
+}
+
+QVariant QQuickPdfSelection::inputMethodQuery(Qt::InputMethodQuery query, const QVariant &argument) const
+{
+ if (!argument.isNull()) {
+ qCDebug(qLcIm) << "IM query" << query << "with arg" << argument;
+ if (query == Qt::ImCursorPosition) {
+ if (!m_document)
+ return {};
+ // If it didn't move since last time, return the same result.
+ if (m_hitPoint == argument.toPointF())
+ return inputMethodQuery(query);
+ m_hitPoint = argument.toPointF();
+ auto tp = m_document->document()->d->hitTest(m_page, m_hitPoint / m_renderScale);
+ qCDebug(qLcIm) << "ImCursorPosition hit testing in px" << m_hitPoint << "pt" << (m_hitPoint / m_renderScale)
+ << "got char index" << tp.charIndex << "@" << tp.position << "pt," << tp.position * m_renderScale << "px";
+ if (tp.charIndex >= 0) {
+ m_toCharIndex = tp.charIndex;
+ m_to = tp.position * m_renderScale - QPointF(0, m_heightAtCursor);
+ m_heightAtCursor = tp.height * m_renderScale;
+ if (qFuzzyIsNull(m_heightAtAnchor))
+ m_heightAtAnchor = m_heightAtCursor;
+ }
+ }
+ }
+ return inputMethodQuery(query);
+}
+
+QVariant QQuickPdfSelection::inputMethodQuery(Qt::InputMethodQuery query) const
+{
+ QVariant ret;
+ switch (query) {
+ case Qt::ImEnabled:
+ ret = true;
+ break;
+ case Qt::ImHints:
+ ret = QVariant(Qt::ImhMultiLine | Qt::ImhNoPredictiveText);
+ break;
+ case Qt::ImInputItemClipRectangle:
+ ret = boundingRect();
+ break;
+ case Qt::ImAnchorPosition:
+ ret = m_fromCharIndex;
+ break;
+ case Qt::ImAbsolutePosition:
+ ret = m_toCharIndex;
+ break;
+ case Qt::ImCursorPosition:
+ ret = m_toCharIndex;
+ break;
+ case Qt::ImAnchorRectangle:
+ ret = QRectF(m_from, QSizeF(1, m_heightAtAnchor));
+ break;
+ case Qt::ImCursorRectangle:
+ ret = QRectF(m_to, QSizeF(1, m_heightAtCursor));
+ break;
+ case Qt::ImSurroundingText:
+ ret = QVariant(pageText());
+ break;
+ case Qt::ImTextBeforeCursor:
+ ret = QVariant(pageText().mid(0, m_toCharIndex));
+ break;
+ case Qt::ImTextAfterCursor:
+ ret = QVariant(pageText().mid(m_toCharIndex));
+ break;
+ case Qt::ImCurrentSelection:
+ ret = QVariant(m_text);
+ break;
+ case Qt::ImEnterKeyType:
+ break;
+ case Qt::ImFont: {
+ QFont font = QGuiApplication::font();
+ font.setPointSizeF(m_heightAtCursor);
+ ret = font;
+ break;
+ }
+ case Qt::ImMaximumTextLength:
+ break;
+ case Qt::ImPreferredLanguage:
+ break;
+ case Qt::ImPlatformData:
+ break;
+ case Qt::ImReadOnly:
+ ret = true;
+ break;
+ case Qt::ImQueryInput:
+ case Qt::ImQueryAll:
+ qWarning() << "unexpected composite query";
+ break;
+ }
+ qCDebug(qLcIm) << "IM query" << query << "returns" << ret;
+ return ret;
+}
+#endif // QT_CONFIG(im)
+
+const QString &QQuickPdfSelection::pageText() const
+{
+ if (m_pageTextDirty) {
+ if (!m_document)
+ return m_pageText;
+ m_pageText = m_document->document()->getAllText(m_page).text();
+ m_pageTextDirty = false;
+ }
+ return m_pageText;
+}
+
+void QQuickPdfSelection::resetPoints()
+{
+ bool wasHolding = m_hold;
+ m_hold = false;
+ setFrom(QPointF());
+ setTo(QPointF());
+ m_hold = wasHolding;
+}
+
+/*!
+ \qmlproperty int PdfSelection::page
+
+ The page number on which to search.
+
+ \sa QtQuick::Image::currentFrame
+*/
+int QQuickPdfSelection::page() const
+{
+ return m_page;
+}
+
+void QQuickPdfSelection::setPage(int page)
+{
+ if (m_page == page)
+ return;
+
+ m_page = page;
+ m_pageTextDirty = true;
+ emit pageChanged();
+ resetPoints();
+}
+
+/*!
+ \qmlproperty real PdfSelection::renderScale
+ \brief The ratio from points to pixels at which the page is rendered.
+
+ This is used to scale \l from and \l to to find ranges of
+ selected characters in the document, because positions within the document
+ are always given in points.
+*/
+qreal QQuickPdfSelection::renderScale() const
+{
+ return m_renderScale;
+}
+
+void QQuickPdfSelection::setRenderScale(qreal scale)
+{
+ if (qFuzzyIsNull(scale)) {
+ qWarning() << "PdfSelection.renderScale cannot be set to 0.";
+ return;
+ }
+
+ if (qFuzzyCompare(scale, m_renderScale))
+ return;
+
+ m_renderScale = scale;
+ emit renderScaleChanged();
+ updateResults();
+}
+
+/*!
+ \qmlproperty point PdfSelection::from
+
+ The beginning location, in pixels from the upper-left corner of the page,
+ from which to find selected text. This can be bound to the
+ \c centroid.pressPosition of a \l DragHandler to begin selecting text from
+ the position where the user presses the mouse button and begins dragging,
+ for example.
+*/
+QPointF QQuickPdfSelection::from() const
+{
+ return m_from;
+}
+
+void QQuickPdfSelection::setFrom(QPointF from)
+{
+ if (m_hold || m_from == from)
+ return;
+
+ m_from = from;
+ emit fromChanged();
+ updateResults();
+}
+
+/*!
+ \qmlproperty point PdfSelection::to
+
+ The ending location, in pixels from the upper-left corner of the page,
+ from which to find selected text. This can be bound to the
+ \c centroid.position of a \l DragHandler to end selection of text at the
+ position where the user is currently dragging the mouse, for example.
+*/
+QPointF QQuickPdfSelection::to() const
+{
+ return m_to;
+}
+
+void QQuickPdfSelection::setTo(QPointF to)
+{
+ if (m_hold || m_to == to)
+ return;
+
+ m_to = to;
+ emit toChanged();
+ updateResults();
+}
+
+/*!
+ \qmlproperty bool PdfSelection::hold
+
+ Controls whether to hold the existing selection regardless of changes to
+ \l from and \l to. This property can be set to \c true when the mouse
+ or touchpoint is released, so that the selection is not lost due to the
+ point bindings changing.
+*/
+bool QQuickPdfSelection::hold() const
+{
+ return m_hold;
+}
+
+void QQuickPdfSelection::setHold(bool hold)
+{
+ if (m_hold == hold)
+ return;
+
+ m_hold = hold;
+ emit holdChanged();
+}
+
+/*!
+ \qmlproperty string PdfSelection::string
+
+ The string found.
+*/
+QString QQuickPdfSelection::text() const
+{
+ return m_text;
+}
+
+#if QT_CONFIG(clipboard)
+/*!
+ \qmlmethod void PdfSelection::copyToClipboard()
+
+ Copies plain text from the \l string property to the system clipboard.
+*/
+void QQuickPdfSelection::copyToClipboard() const
+{
+ QGuiApplication::clipboard()->setText(m_text);
+}
+#endif
+
+void QQuickPdfSelection::updateResults()
+{
+ if (!m_document)
+ return;
+ QPdfSelection sel = m_document->document()->getSelection(m_page,
+ m_from / m_renderScale, m_to / m_renderScale);
+ update(sel, true);
+}
+
+void QQuickPdfSelection::update(const QPdfSelection &sel, bool textAndGeometryOnly)
+{
+ if (sel.text() != m_text) {
+ m_text = sel.text();
+ if (QGuiApplication::clipboard()->supportsSelection())
+ sel.copyToClipboard(QClipboard::Selection);
+ emit textChanged();
+ }
+
+ if (sel.bounds() != m_geometry) {
+ m_geometry = sel.bounds();
+ emit selectedAreaChanged();
+ }
+
+ if (textAndGeometryOnly)
+ return;
+
+ m_fromCharIndex = sel.startIndex();
+ m_toCharIndex = sel.endIndex();
+ if (sel.bounds().isEmpty()) {
+ m_from = sel.boundingRectangle().topLeft() * m_renderScale;
+ m_to = m_from;
+ } else {
+ Qt::InputMethodQueries toUpdate = {};
+ QRectF firstLineBounds = sel.bounds().first().boundingRect();
+ m_from = firstLineBounds.topLeft() * m_renderScale;
+ if (!qFuzzyCompare(m_heightAtAnchor, firstLineBounds.height())) {
+ m_heightAtAnchor = firstLineBounds.height() * m_renderScale;
+ toUpdate.setFlag(Qt::ImAnchorRectangle);
+ }
+ QRectF lastLineBounds = sel.bounds().last().boundingRect();
+ if (!qFuzzyCompare(m_heightAtCursor, lastLineBounds.height())) {
+ m_heightAtCursor = lastLineBounds.height() * m_renderScale;
+ toUpdate.setFlag(Qt::ImCursorRectangle);
+ }
+ m_to = lastLineBounds.topRight() * m_renderScale;
+ if (toUpdate)
+ QGuiApplication::inputMethod()->update(toUpdate);
+ }
+}
+
+QT_END_NAMESPACE
+
+#include "moc_qquickpdfselection_p.cpp"
diff --git a/src/pdfquick/qquickpdfselection_p.h b/src/pdfquick/qquickpdfselection_p.h
new file mode 100644
index 000000000..4f633a467
--- /dev/null
+++ b/src/pdfquick/qquickpdfselection_p.h
@@ -0,0 +1,119 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QQUICKPDFSELECTION_P_H
+#define QQUICKPDFSELECTION_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtPdfQuick/private/qtpdfquickglobal_p.h>
+#include <QtPdfQuick/private/qquickpdfdocument_p.h>
+
+#include <QtCore/QPointF>
+#include <QtCore/QVariant>
+#include <QtGui/QPolygonF>
+#include <QtQml/QQmlEngine>
+#include <QtQuick/QQuickItem>
+
+QT_BEGIN_NAMESPACE
+class QPdfSelection;
+
+class Q_PDFQUICK_EXPORT QQuickPdfSelection : public QQuickItem
+{
+ Q_OBJECT
+ Q_PROPERTY(QQuickPdfDocument *document READ document WRITE setDocument NOTIFY documentChanged)
+ Q_PROPERTY(int page READ page WRITE setPage NOTIFY pageChanged)
+ Q_PROPERTY(qreal renderScale READ renderScale WRITE setRenderScale NOTIFY renderScaleChanged)
+ Q_PROPERTY(QPointF from READ from WRITE setFrom NOTIFY fromChanged)
+ Q_PROPERTY(QPointF to READ to WRITE setTo NOTIFY toChanged)
+ Q_PROPERTY(bool hold READ hold WRITE setHold NOTIFY holdChanged)
+
+ Q_PROPERTY(QString text READ text NOTIFY textChanged)
+ Q_PROPERTY(QList<QPolygonF> geometry READ geometry NOTIFY selectedAreaChanged)
+ QML_NAMED_ELEMENT(PdfSelection)
+ QML_ADDED_IN_VERSION(5, 15)
+
+public:
+ explicit QQuickPdfSelection(QQuickItem *parent = nullptr);
+ ~QQuickPdfSelection() override;
+
+ QQuickPdfDocument *document() const;
+ void setDocument(QQuickPdfDocument * document);
+ int page() const;
+ void setPage(int page);
+ qreal renderScale() const;
+ void setRenderScale(qreal scale);
+ QPointF from() const;
+ void setFrom(QPointF from);
+ QPointF to() const;
+ void setTo(QPointF to);
+ bool hold() const;
+ void setHold(bool hold);
+
+ QString text() const;
+ QList<QPolygonF> geometry() const;
+
+ Q_INVOKABLE void clear();
+ Q_INVOKABLE void selectAll();
+#if QT_CONFIG(clipboard)
+ Q_INVOKABLE void copyToClipboard() const;
+#endif
+
+signals:
+ void documentChanged();
+ void pageChanged();
+ void renderScaleChanged();
+ void fromChanged();
+ void toChanged();
+ void holdChanged();
+ void textChanged();
+ void selectedAreaChanged();
+
+protected:
+#if QT_CONFIG(im)
+ void keyReleaseEvent(QKeyEvent *ev) override;
+ void inputMethodEvent(QInputMethodEvent *event) override;
+ Q_INVOKABLE QVariant inputMethodQuery(Qt::InputMethodQuery query, const QVariant &argument) const;
+ QVariant inputMethodQuery(Qt::InputMethodQuery query) const override;
+#endif
+
+private:
+ void resetPoints();
+ void updateResults();
+ void update(const QPdfSelection &sel, bool textAndGeometryOnly = false);
+ const QString &pageText() const;
+
+private:
+ QQuickPdfDocument *m_document = nullptr;
+ mutable QPointF m_hitPoint;
+ QPointF m_from;
+ mutable QPointF m_to;
+ qreal m_renderScale = 1;
+ mutable qreal m_heightAtAnchor = 0;
+ mutable qreal m_heightAtCursor = 0;
+ QString m_text; // selected text
+ mutable QString m_pageText; // all text on the page
+ QList<QPolygonF> m_geometry;
+ int m_page = 0;
+ int m_fromCharIndex = -1; // same as anchor position
+ mutable int m_toCharIndex = -1; // same as cursor position
+ bool m_hold = false;
+ mutable bool m_pageTextDirty = true;
+
+ Q_DISABLE_COPY(QQuickPdfSelection)
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QQuickPdfSelection)
+
+#endif // QQUICKPDFSELECTION_P_H
diff --git a/src/pdfquick/qtpdfquickglobal_p.h b/src/pdfquick/qtpdfquickglobal_p.h
new file mode 100644
index 000000000..7b5d629ed
--- /dev/null
+++ b/src/pdfquick/qtpdfquickglobal_p.h
@@ -0,0 +1,34 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QTPDFQUICKGLOBAL_H
+#define QTPDFQUICKGLOBAL_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qglobal.h>
+
+QT_BEGIN_NAMESPACE
+
+#ifndef QT_STATIC
+# if defined(QT_BUILD_PDFQUICK_LIB)
+# define Q_PDFQUICK_EXPORT Q_DECL_EXPORT
+# else
+# define Q_PDFQUICK_EXPORT Q_DECL_IMPORT
+# endif
+#else
+# define Q_PDFQUICK_EXPORT
+#endif
+
+QT_END_NAMESPACE
+
+#endif // QTPDFQUICKGLOBAL_H
diff --git a/src/pdfwidgets/CMakeLists.txt b/src/pdfwidgets/CMakeLists.txt
new file mode 100644
index 000000000..41af017c0
--- /dev/null
+++ b/src/pdfwidgets/CMakeLists.txt
@@ -0,0 +1,19 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS Core Gui Widgets)
+
+qt_internal_add_module(PdfWidgets
+ SOURCES
+ qpdfpageselector.cpp qpdfpageselector.h qpdfpageselector_p.h
+ qpdfview.cpp qpdfview.h qpdfview_p.h
+ qtpdfwidgetsglobal.h
+ LIBRARIES
+ Qt::WidgetsPrivate
+ PUBLIC_LIBRARIES
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+ Qt::Pdf
+ NO_GENERATE_CPP_EXPORTS
+)
diff --git a/src/pdfwidgets/configure.json b/src/pdfwidgets/configure.json
deleted file mode 100644
index b33f08555..000000000
--- a/src/pdfwidgets/configure.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "module": "pdfwidgets",
- "condition": "module.pdf && features.pdf-widgets",
- "depends": [
- "pdf-private"
- ],
- "commandline": {
- "options": {
- "pdf-widgets": "boolean"
- }
- },
- "features": {
- "pdf-widgets": {
- "label": "Support Qt PDF Widgets",
- "purpose": "Provides Qt PDF Widgets support.",
- "condition": "module.widgets",
- "output": [ "privateFeature" ]
- }
- },
- "summary": [
- {
- "section": "Qt PDF Widgets",
- "entries": [
- "pdf-widgets"
- ]
- }
- ]
-}
diff --git a/src/pdfwidgets/pdfwidgets.pro b/src/pdfwidgets/pdfwidgets.pro
deleted file mode 100644
index cf221be03..000000000
--- a/src/pdfwidgets/pdfwidgets.pro
+++ /dev/null
@@ -1,12 +0,0 @@
-TARGET = QtPdfWidgets
-QT = core gui widgets widgets-private pdf
-
-SOURCES += \
- qpdfview.cpp
-
-HEADERS += \
- qpdfview.h \
- qpdfview_p.h \
- qtpdfwidgetsglobal.h
-
-load(qt_module)
diff --git a/src/pdfwidgets/qpdfpageselector.cpp b/src/pdfwidgets/qpdfpageselector.cpp
new file mode 100644
index 000000000..66b781ed3
--- /dev/null
+++ b/src/pdfwidgets/qpdfpageselector.cpp
@@ -0,0 +1,171 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qpdfpageselector.h"
+#include "qpdfpageselector_p.h"
+
+#include <QPdfDocument>
+
+#include <QtWidgets/qboxlayout.h>
+
+using namespace Qt::StringLiterals;
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QPdfPageSelector
+ \inmodule QtPdf
+ \since 6.6
+ \brief A widget for selecting a PDF page.
+
+ QPdfPageSelector is a widget for selecting a page label from a
+ QPdfDocument.
+
+ \sa QPdfDocument::pageLabel()
+*/
+
+/*!
+ Constructs a PDF page selector with parent widget \a parent.
+*/
+QPdfPageSelector::QPdfPageSelector(QWidget *parent)
+ : QWidget(parent), d_ptr(new QPdfPageSelectorPrivate)
+{
+ Q_D(QPdfPageSelector);
+ d->spinBox = new QPdfPageSelectorSpinBox(this);
+ d->spinBox->setObjectName(u"_q_spinBox"_s);
+ auto vlay = new QVBoxLayout(this);
+ vlay->setContentsMargins({});
+ vlay->addWidget(d->spinBox);
+
+ connect(d->spinBox, &QPdfPageSelectorSpinBox::_q_documentChanged,
+ this, &QPdfPageSelector::documentChanged);
+ connect(d->spinBox, &QSpinBox::valueChanged, this, &QPdfPageSelector::currentPageChanged);
+ connect(d->spinBox, &QSpinBox::textChanged, this, &QPdfPageSelector::currentPageLabelChanged);
+}
+
+/*!
+ Destroys the page selector.
+*/
+QPdfPageSelector::~QPdfPageSelector()
+ = default;
+
+/*!
+ \property QPdfPageSelector::document
+
+ This property holds the document to be viewed.
+*/
+
+void QPdfPageSelector::setDocument(QPdfDocument *doc)
+{
+ Q_D(QPdfPageSelector);
+ d->spinBox->setDocument(doc);
+}
+
+QPdfDocument *QPdfPageSelector::document() const
+{
+ Q_D(const QPdfPageSelector);
+ return d->spinBox->document();
+}
+
+/*!
+ \property QPdfPageSelector::currentPage
+
+ This property holds the index (\c{0}-based) of the current page in the
+ document.
+*/
+
+int QPdfPageSelector::currentPage() const
+{
+ Q_D(const QPdfPageSelector);
+ return d->spinBox->value();
+}
+
+void QPdfPageSelector::setCurrentPage(int index)
+{
+ Q_D(QPdfPageSelector);
+ d->spinBox->setValue(index);
+}
+
+/*!
+ \property QPdfPageSelector::currentPageLabel
+
+ This property holds the page label corresponding to the current page
+ in the document.
+
+ This is the text presented to the user.
+
+ \sa QPdfDocument::pageLabel()
+*/
+
+QString QPdfPageSelector::currentPageLabel() const
+{
+ Q_D(const QPdfPageSelector);
+ return d->spinBox->text();
+}
+
+//
+// QPdfPageSelectorSpinBox:
+//
+
+void QPdfPageSelectorSpinBox::documentStatusChanged()
+{
+ if (m_document && m_document->status() == QPdfDocument::Status::Ready) {
+ setMaximum(m_document->pageCount());
+ setValue(0);
+ }
+}
+
+void QPdfPageSelectorSpinBox::setDocument(QPdfDocument *document)
+{
+ if (m_document == document)
+ return;
+
+ if (m_document)
+ disconnect(m_documentStatusChangedConnection);
+
+ m_document = document;
+ emit _q_documentChanged(document);
+
+ if (m_document) {
+ m_documentStatusChangedConnection =
+ connect(m_document.get(), &QPdfDocument::statusChanged,
+ this, &QPdfPageSelectorSpinBox::documentStatusChanged);
+ }
+
+ documentStatusChanged();
+}
+
+QPdfPageSelectorSpinBox::QPdfPageSelectorSpinBox(QWidget *parent)
+ : QSpinBox(parent)
+{
+}
+
+QPdfPageSelectorSpinBox::~QPdfPageSelectorSpinBox()
+ = default;
+
+int QPdfPageSelectorSpinBox::valueFromText(const QString &text) const
+{
+ if (!m_document)
+ return 0;
+
+ return m_document->pageIndexForLabel(text.trimmed());
+}
+
+QString QPdfPageSelectorSpinBox::textFromValue(int value) const
+{
+ if (!m_document)
+ return {};
+
+ return m_document->pageLabel(value);
+}
+
+QValidator::State QPdfPageSelectorSpinBox::validate(QString &text, int &pos) const
+{
+ Q_UNUSED(pos);
+ return valueFromText(text) >= 0 ? QValidator::Acceptable : QValidator::Intermediate;
+}
+
+QT_END_NAMESPACE
+
+#include "moc_qpdfpageselector_p.cpp"
+#include "moc_qpdfpageselector.cpp"
diff --git a/src/pdfwidgets/qpdfpageselector.h b/src/pdfwidgets/qpdfpageselector.h
new file mode 100644
index 000000000..d779f54cd
--- /dev/null
+++ b/src/pdfwidgets/qpdfpageselector.h
@@ -0,0 +1,51 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QPDFPAGESELECTOR_H
+#define QPDFPAGESELECTOR_H
+
+#include <QtPdfWidgets/qtpdfwidgetsglobal.h>
+
+#include <QtWidgets/qwidget.h>
+
+#include <memory>
+
+QT_BEGIN_NAMESPACE
+
+class QPdfDocument;
+class QPdfPageSelectorPrivate;
+
+class Q_PDF_WIDGETS_EXPORT QPdfPageSelector : public QWidget
+{
+ Q_OBJECT
+
+ Q_PROPERTY(QPdfDocument* document READ document WRITE setDocument NOTIFY documentChanged)
+ Q_PROPERTY(int currentPage READ currentPage WRITE setCurrentPage NOTIFY currentPageChanged USER true)
+ Q_PROPERTY(QString currentPageLabel READ currentPageLabel NOTIFY currentPageLabelChanged)
+public:
+ QPdfPageSelector() : QPdfPageSelector(nullptr) {}
+ explicit QPdfPageSelector(QWidget *parent);
+ ~QPdfPageSelector() override;
+
+ void setDocument(QPdfDocument *document);
+ QPdfDocument *document() const;
+
+ int currentPage() const;
+ QString currentPageLabel() const;
+
+public Q_SLOTS:
+ void setCurrentPage(int index);
+
+Q_SIGNALS:
+ void documentChanged(QPdfDocument *document);
+ void currentPageChanged(int index);
+ void currentPageLabelChanged(const QString &label);
+
+private:
+ Q_DECLARE_PRIVATE(QPdfPageSelector)
+ const std::unique_ptr<QPdfPageSelectorPrivate> d_ptr;
+};
+
+QT_END_NAMESPACE
+
+#endif // QPDFPAGESELECTOR_H
diff --git a/src/pdfwidgets/qpdfpageselector_p.h b/src/pdfwidgets/qpdfpageselector_p.h
new file mode 100644
index 000000000..8e961f1d2
--- /dev/null
+++ b/src/pdfwidgets/qpdfpageselector_p.h
@@ -0,0 +1,60 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QPDFPAGESELECTOR_P_H
+#define QPDFPAGESELECTOR_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qpdfpageselector.h"
+
+#include <QtWidgets/qspinbox.h>
+
+#include <QPointer>
+
+QT_BEGIN_NAMESPACE
+
+class QPdfPageSelectorSpinBox : public QSpinBox
+{
+ Q_OBJECT
+public:
+ QPdfPageSelectorSpinBox() : QPdfPageSelectorSpinBox(nullptr) {}
+ explicit QPdfPageSelectorSpinBox(QWidget *parent);
+ ~QPdfPageSelectorSpinBox();
+
+ void setDocument(QPdfDocument *document);
+ QPdfDocument *document() const { return m_document.get(); }
+
+Q_SIGNALS:
+ void _q_documentChanged(QPdfDocument *document);
+
+protected:
+ int valueFromText(const QString &text) const override;
+ QString textFromValue(int value) const override;
+ QValidator::State validate(QString &text, int &pos) const override;
+
+private:
+ void documentStatusChanged();
+private:
+ QPointer<QPdfDocument> m_document;
+ QMetaObject::Connection m_documentStatusChangedConnection;
+};
+
+class QPdfPageSelectorPrivate
+{
+public:
+ QPdfPageSelectorSpinBox *spinBox;
+};
+
+QT_END_NAMESPACE
+
+#endif // QPDFPAGESELECTOR_P_H
diff --git a/src/pdfwidgets/qpdfview.cpp b/src/pdfwidgets/qpdfview.cpp
index 35e368633..a67667fed 100644
--- a/src/pdfwidgets/qpdfview.cpp
+++ b/src/pdfwidgets/qpdfview.cpp
@@ -1,38 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias König <tobias.koenig@kdab.com>
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias König <tobias.koenig@kdab.com>
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qpdfview.h"
#include "qpdfview_p.h"
@@ -40,21 +8,31 @@
#include "qpdfpagerenderer.h"
#include <QGuiApplication>
+#include <QLoggingCategory>
+#include <QPainter>
+#include <QPaintEvent>
#include <QPdfDocument>
-#include <QPdfPageNavigation>
+#include <QPdfPageNavigator>
+#include <QPdfSearchModel>
#include <QScreen>
#include <QScrollBar>
-#include <QScroller>
QT_BEGIN_NAMESPACE
-QPdfViewPrivate::QPdfViewPrivate()
- : QAbstractScrollAreaPrivate()
+Q_LOGGING_CATEGORY(qLcLink, "qt.pdf.links")
+//#define DEBUG_LINKS
+
+static const QColor SearchResultHighlight("#80B0C4DE");
+static const QColor CurrentSearchResultHighlight(Qt::cyan);
+static const int CurrentSearchResultWidth(2);
+
+QPdfViewPrivate::QPdfViewPrivate(QPdfView *q)
+ : q_ptr(q)
, m_document(nullptr)
- , m_pageNavigation(nullptr)
+ , m_pageNavigator(nullptr)
, m_pageRenderer(nullptr)
- , m_pageMode(QPdfView::SinglePage)
- , m_zoomMode(QPdfView::CustomZoom)
+ , m_pageMode(QPdfView::PageMode::SinglePage)
+ , m_zoomMode(QPdfView::ZoomMode::Custom)
, m_zoomFactor(1.0)
, m_pageSpacing(3)
, m_documentMargins(6, 6, 6, 6)
@@ -68,7 +46,7 @@ void QPdfViewPrivate::init()
{
Q_Q(QPdfView);
- m_pageNavigation = new QPdfPageNavigation(q);
+ m_pageNavigator = new QPdfPageNavigator(q);
m_pageRenderer = new QPdfPageRenderer(q);
m_pageRenderer->setRenderMode(QPdfPageRenderer::RenderMode::MultiThreaded);
}
@@ -88,7 +66,7 @@ void QPdfViewPrivate::currentPageChanged(int currentPage)
q->verticalScrollBar()->setValue(yPositionForPage(currentPage));
- if (m_pageMode == QPdfView::SinglePage)
+ if (m_pageMode == QPdfView::PageMode::SinglePage)
invalidateDocumentLayout();
}
@@ -116,29 +94,31 @@ void QPdfViewPrivate::setViewport(QRect viewport)
if (oldSize != m_viewport.size()) {
updateDocumentLayout();
- if (m_zoomMode != QPdfView::CustomZoom) {
+ if (m_zoomMode != QPdfView::ZoomMode::Custom) {
invalidatePageCache();
}
}
- if (m_pageMode == QPdfView::MultiPage) {
+ if (m_pageMode == QPdfView::PageMode::MultiPage) {
// An imaginary, 2px height line at the upper half of the viewport, which is used to
// determine which page is currently located there -> we propagate that as 'current' page
- // to the QPdfPageNavigation object
+ // to the QPdfPageNavigator object
const QRect currentPageLine(m_viewport.x(), m_viewport.y() + m_viewport.height() * 0.4, m_viewport.width(), 2);
int currentPage = 0;
- for (auto it = m_documentLayout.pageGeometries.cbegin(); it != m_documentLayout.pageGeometries.cend(); ++it) {
- const QRect pageGeometry = it.value();
+ for (auto it = m_documentLayout.pageGeometryAndScale.cbegin();
+ it != m_documentLayout.pageGeometryAndScale.cend(); ++it) {
+ const QRect pageGeometry = it.value().first;
if (pageGeometry.intersects(currentPageLine)) {
currentPage = it.key();
break;
}
}
- if (currentPage != m_pageNavigation->currentPage()) {
+ if (currentPage != m_pageNavigator->currentPage()) {
m_blockPageScrolling = true;
- m_pageNavigation->setCurrentPage(currentPage);
+ // ΤODO give location on the page
+ m_pageNavigator->jump(currentPage, {}, m_zoomFactor);
m_blockPageScrolling = false;
}
}
@@ -161,11 +141,11 @@ void QPdfViewPrivate::pageRendered(int pageNumber, QSize imageSize, const QImage
{
Q_Q(QPdfView);
- Q_UNUSED(imageSize)
- Q_UNUSED(requestId)
+ Q_UNUSED(imageSize);
+ Q_UNUSED(requestId);
if (!m_cachedPagesLRU.contains(pageNumber)) {
- if (m_cachedPagesLRU.length() > m_pageCacheLimit)
+ if (m_cachedPagesLRU.size() > m_pageCacheLimit)
m_pageCache.remove(m_cachedPagesLRU.takeFirst());
m_cachedPagesLRU.append(pageNumber);
@@ -200,37 +180,43 @@ QPdfViewPrivate::DocumentLayout QPdfViewPrivate::calculateDocumentLayout() const
DocumentLayout documentLayout;
- if (!m_document || m_document->status() != QPdfDocument::Ready)
+ if (!m_document || m_document->status() != QPdfDocument::Status::Ready)
return documentLayout;
- QHash<int, QRect> pageGeometries;
+ QHash<int, QPair<QRect, qreal>> pageGeometryAndScale;
const int pageCount = m_document->pageCount();
int totalWidth = 0;
- const int startPage = (m_pageMode == QPdfView::SinglePage ? m_pageNavigation->currentPage() : 0);
- const int endPage = (m_pageMode == QPdfView::SinglePage ? m_pageNavigation->currentPage() + 1 : pageCount);
+ const int startPage = (m_pageMode == QPdfView::PageMode::SinglePage ? m_pageNavigator->currentPage() : 0);
+ const int endPage = (m_pageMode == QPdfView::PageMode::SinglePage ? m_pageNavigator->currentPage() + 1 : pageCount);
// calculate page sizes
for (int page = startPage; page < endPage; ++page) {
QSize pageSize;
- if (m_zoomMode == QPdfView::CustomZoom) {
- pageSize = QSizeF(m_document->pageSize(page) * m_screenResolution * m_zoomFactor).toSize();
- } else if (m_zoomMode == QPdfView::FitToWidth) {
- pageSize = QSizeF(m_document->pageSize(page) * m_screenResolution).toSize();
- const qreal factor = (qreal(m_viewport.width() - m_documentMargins.left() - m_documentMargins.right()) / qreal(pageSize.width()));
- pageSize *= factor;
- } else if (m_zoomMode == QPdfView::FitInView) {
- const QSize viewportSize(m_viewport.size() + QSize(-m_documentMargins.left() - m_documentMargins.right(), -m_pageSpacing));
-
- pageSize = QSizeF(m_document->pageSize(page) * m_screenResolution).toSize();
- pageSize = pageSize.scaled(viewportSize, Qt::KeepAspectRatio);
+ qreal pageScale = m_zoomFactor;
+ if (m_zoomMode == QPdfView::ZoomMode::Custom) {
+ pageSize = QSizeF(m_document->pagePointSize(page) * m_screenResolution * m_zoomFactor).toSize();
+ } else if (m_zoomMode == QPdfView::ZoomMode::FitToWidth) {
+ pageSize = QSizeF(m_document->pagePointSize(page) * m_screenResolution).toSize();
+ pageScale = (qreal(m_viewport.width() - m_documentMargins.left() - m_documentMargins.right()) /
+ qreal(pageSize.width()));
+ pageSize *= pageScale;
+ } else if (m_zoomMode == QPdfView::ZoomMode::FitInView) {
+ const QSize viewportSize(m_viewport.size() +
+ QSize(-m_documentMargins.left() - m_documentMargins.right(), -m_pageSpacing));
+
+ pageSize = QSizeF(m_document->pagePointSize(page) * m_screenResolution).toSize();
+ QSize scaledSize = pageSize.scaled(viewportSize, Qt::KeepAspectRatio);
+ // because of KeepAspectRatio, the ratio of widths should be the same as the ratio of heights
+ pageScale = qreal(scaledSize.width()) / qreal(pageSize.width());
+ pageSize = scaledSize;
}
totalWidth = qMax(totalWidth, pageSize.width());
- pageGeometries[page] = QRect(QPoint(0, 0), pageSize);
+ pageGeometryAndScale[page] = {QRect(QPoint(0, 0), pageSize), pageScale};
}
totalWidth += m_documentMargins.left() + m_documentMargins.right();
@@ -239,19 +225,19 @@ QPdfViewPrivate::DocumentLayout QPdfViewPrivate::calculateDocumentLayout() const
// calculate page positions
for (int page = startPage; page < endPage; ++page) {
- const QSize pageSize = pageGeometries[page].size();
+ const QSize pageSize = pageGeometryAndScale[page].first.size();
// center horizontal inside the viewport
const int pageX = (qMax(totalWidth, m_viewport.width()) - pageSize.width()) / 2;
- pageGeometries[page].moveTopLeft(QPoint(pageX, pageY));
+ pageGeometryAndScale[page].first.moveTopLeft(QPoint(pageX, pageY));
pageY += pageSize.height() + m_pageSpacing;
}
pageY += m_documentMargins.bottom();
- documentLayout.pageGeometries = pageGeometries;
+ documentLayout.pageGeometryAndScale = pageGeometryAndScale;
// calculate overall document size
documentLayout.documentSize = QSize(totalWidth, pageY);
@@ -261,11 +247,26 @@ QPdfViewPrivate::DocumentLayout QPdfViewPrivate::calculateDocumentLayout() const
qreal QPdfViewPrivate::yPositionForPage(int pageNumber) const
{
- const auto it = m_documentLayout.pageGeometries.constFind(pageNumber);
- if (it == m_documentLayout.pageGeometries.cend())
+ const auto it = m_documentLayout.pageGeometryAndScale.constFind(pageNumber);
+ if (it == m_documentLayout.pageGeometryAndScale.cend())
return 0.0;
- return (*it).y();
+ return (*it).first.y();
+}
+
+QTransform QPdfViewPrivate::screenScaleTransform(int page) const
+{
+ qreal scale = m_screenResolution * m_zoomFactor;
+ switch (m_zoomMode) {
+ case QPdfView::ZoomMode::FitToWidth:
+ case QPdfView::ZoomMode::FitInView:
+ scale = m_screenResolution * m_documentLayout.pageGeometryAndScale[page].second;
+ break;
+ default:
+ break;
+ }
+
+ return QTransform::fromScale(scale, scale);
}
void QPdfViewPrivate::updateDocumentLayout()
@@ -275,39 +276,55 @@ void QPdfViewPrivate::updateDocumentLayout()
updateScrollBars();
}
+/*!
+ \class QPdfView
+ \inmodule QtPdf
+ \brief A PDF viewer widget.
+
+ QPdfView is a PDF viewer widget that offers a user experience similar to
+ many common PDF viewer applications, with two \l {pageMode}{modes}.
+ In the \c MultiPage mode, it supports flicking through the pages in the
+ entire document, with narrow gaps between the page images.
+ In the \c SinglePage mode, it shows one page at a time.
+*/
+/*!
+ Constructs a PDF viewer with parent widget \a parent.
+*/
QPdfView::QPdfView(QWidget *parent)
- : QAbstractScrollArea(*new QPdfViewPrivate(), parent)
+ : QAbstractScrollArea(parent)
+ , d_ptr(new QPdfViewPrivate(this))
{
Q_D(QPdfView);
d->init();
- connect(d->m_pageNavigation, &QPdfPageNavigation::currentPageChanged, this, [d](int page){ d->currentPageChanged(page); });
+ connect(d->m_pageNavigator, &QPdfPageNavigator::currentPageChanged, this,
+ [d](int page){ d->currentPageChanged(page); });
- connect(d->m_pageRenderer, &QPdfPageRenderer::pageRendered,
- this, [d](int pageNumber, QSize imageSize, const QImage &image, QPdfDocumentRenderOptions, quint64 requestId){ d->pageRendered(pageNumber, imageSize, image, requestId); });
+ connect(d->m_pageRenderer, &QPdfPageRenderer::pageRendered, this,
+ [d](int pageNumber, QSize imageSize, const QImage &image, QPdfDocumentRenderOptions, quint64 requestId) {
+ d->pageRendered(pageNumber, imageSize, image, requestId); });
verticalScrollBar()->setSingleStep(20);
horizontalScrollBar()->setSingleStep(20);
- QScroller::grabGesture(this);
-
+ setMouseTracking(true);
d->calculateViewport();
}
/*!
- \internal
+ Destroys the PDF viewer.
*/
-QPdfView::QPdfView(QPdfViewPrivate &dd, QWidget *parent)
- : QAbstractScrollArea(dd, parent)
-{
-}
-
QPdfView::~QPdfView()
{
}
+/*!
+ \property QPdfView::document
+
+ This property holds the document to be viewed.
+*/
void QPdfView::setDocument(QPdfDocument *document)
{
Q_D(QPdfView);
@@ -322,10 +339,12 @@ void QPdfView::setDocument(QPdfDocument *document)
emit documentChanged(d->m_document);
if (d->m_document)
- d->m_documentStatusChangedConnection = connect(d->m_document.data(), &QPdfDocument::statusChanged, this, [d](){ d->documentStatusChanged(); });
+ d->m_documentStatusChangedConnection =
+ connect(d->m_document.data(), &QPdfDocument::statusChanged, this,
+ [d](){ d->documentStatusChanged(); });
- d->m_pageNavigation->setDocument(d->m_document);
d->m_pageRenderer->setDocument(d->m_document);
+ d->m_linkModel.setDocument(d->m_document);
d->documentStatusChanged();
}
@@ -337,13 +356,94 @@ QPdfDocument *QPdfView::document() const
return d->m_document;
}
-QPdfPageNavigation *QPdfView::pageNavigation() const
+/*!
+ \since 6.6
+ \property QPdfView::searchModel
+
+ If this property is set, QPdfView draws highlight rectangles over the
+ search results provided by \l QPdfSearchModel::resultsOnPage(). By default
+ it is \c nullptr.
+*/
+void QPdfView::setSearchModel(QPdfSearchModel *searchModel)
+{
+ Q_D(QPdfView);
+ if (d->m_searchModel == searchModel)
+ return;
+
+ if (d->m_searchModel)
+ d->m_searchModel->disconnect(this);
+
+ d->m_searchModel = searchModel;
+ emit searchModelChanged(searchModel);
+
+ if (searchModel) {
+ connect(searchModel, &QPdfSearchModel::dataChanged, this,
+ [this](const QModelIndex &, const QModelIndex &, const QList<int> &) { update(); });
+ }
+ setCurrentSearchResultIndex(-1);
+}
+
+QPdfSearchModel *QPdfView::searchModel() const
+{
+ Q_D(const QPdfView);
+ return d->m_searchModel;
+}
+
+/*!
+ \since 6.6
+ \property QPdfView::currentSearchResultIndex
+
+ If this property is set to a positive number, and \l searchModel is set,
+ QPdfView draws a frame around the search result provided by
+ \l QPdfSearchModel at the given index. For example, if QPdfSearchModel is
+ used as the model for a QListView, you can keep this property updated by
+ connecting QItemSelectionModel::currentChanged() from
+ QListView::selectionModel() to a function that will in turn call this function.
+
+ By default it is \c -1, so that no search results are framed.
+*/
+void QPdfView::setCurrentSearchResultIndex(int currentResult)
+{
+ Q_D(QPdfView);
+ if (d->m_currentSearchResultIndex == currentResult)
+ return;
+
+ d->m_currentSearchResultIndex = currentResult;
+ emit currentSearchResultIndexChanged(currentResult);
+ viewport()->update(); //update();
+}
+
+int QPdfView::currentSearchResultIndex() const
+{
+ Q_D(const QPdfView);
+ return d->m_currentSearchResultIndex;
+}
+
+/*!
+ This accessor returns the navigation stack that will handle back/forward navigation.
+*/
+QPdfPageNavigator *QPdfView::pageNavigator() const
{
Q_D(const QPdfView);
- return d->m_pageNavigation;
+ return d->m_pageNavigator;
}
+/*!
+ \enum QPdfView::PageMode
+
+ This enum describes the overall behavior of the PDF viewer:
+
+ \value SinglePage Show one page at a time.
+ \value MultiPage Allow scrolling through all pages in the document.
+*/
+
+/*!
+ \property QPdfView::pageMode
+
+ This property holds whether to show one page at a time, or all pages in the
+ document. The default is \c SinglePage.
+*/
QPdfView::PageMode QPdfView::pageMode() const
{
Q_D(const QPdfView);
@@ -364,6 +464,24 @@ void QPdfView::setPageMode(PageMode mode)
emit pageModeChanged(d->m_pageMode);
}
+/*!
+ \enum QPdfView::ZoomMode
+
+ This enum describes the magnification behavior of the PDF viewer:
+
+ \value Custom Use \l zoomFactor only.
+ \value FitToWidth Automatically choose a zoom factor so that
+ the width of the page fits in the view.
+ \value FitInView Automatically choose a zoom factor so that
+ the entire page fits in the view.
+*/
+
+/*!
+ \property QPdfView::zoomMode
+
+ This property indicates whether to use a custom size for the page(s),
+ or zoom them to fit to the view. The default is \c CustomZoom.
+*/
QPdfView::ZoomMode QPdfView::zoomMode() const
{
Q_D(const QPdfView);
@@ -384,6 +502,12 @@ void QPdfView::setZoomMode(ZoomMode mode)
emit zoomModeChanged(d->m_zoomMode);
}
+/*!
+ \property QPdfView::zoomFactor
+
+ This property holds the ratio of pixels to points. The default is \c 1,
+ meaning one point (1/72 of an inch) equals 1 logical pixel.
+*/
qreal QPdfView::zoomFactor() const
{
Q_D(const QPdfView);
@@ -404,6 +528,12 @@ void QPdfView::setZoomFactor(qreal factor)
emit zoomFactorChanged(d->m_zoomFactor);
}
+/*!
+ \property QPdfView::pageSpacing
+
+ This property holds the size of the padding between pages in the \l MultiPage
+ \l {pageMode}{mode}.
+*/
int QPdfView::pageSpacing() const
{
Q_D(const QPdfView);
@@ -424,6 +554,11 @@ void QPdfView::setPageSpacing(int spacing)
emit pageSpacingChanged(d->m_pageSpacing);
}
+/*!
+ \property QPdfView::documentMargins
+
+ This property holds the margins around the page view.
+*/
QMargins QPdfView::documentMargins() const
{
Q_D(const QPdfView);
@@ -452,8 +587,9 @@ void QPdfView::paintEvent(QPaintEvent *event)
painter.fillRect(event->rect(), palette().brush(QPalette::Dark));
painter.translate(-d->m_viewport.x(), -d->m_viewport.y());
- for (auto it = d->m_documentLayout.pageGeometries.cbegin(); it != d->m_documentLayout.pageGeometries.cend(); ++it) {
- const QRect pageGeometry = it.value();
+ for (auto it = d->m_documentLayout.pageGeometryAndScale.cbegin();
+ it != d->m_documentLayout.pageGeometryAndScale.cend(); ++it) {
+ const QRect pageGeometry = it.value().first;
if (pageGeometry.intersects(d->m_viewport)) { // page needs to be painted
painter.fillRect(pageGeometry, Qt::white);
@@ -461,9 +597,47 @@ void QPdfView::paintEvent(QPaintEvent *event)
const auto pageIt = d->m_pageCache.constFind(page);
if (pageIt != d->m_pageCache.cend()) {
const QImage &img = pageIt.value();
- painter.drawImage(pageGeometry.topLeft(), img);
+ painter.drawImage(pageGeometry, img);
} else {
- d->m_pageRenderer->requestPage(page, pageGeometry.size());
+ d->m_pageRenderer->requestPage(page, pageGeometry.size() * devicePixelRatioF());
+ }
+
+ const QTransform scaleTransform = d->screenScaleTransform(page);
+#ifdef DEBUG_LINKS
+ const QString fmt = u"page %1 @ %2, %3"_s;
+ d->m_linkModel.setPage(page);
+ const int linkCount = d->m_linkModel.rowCount({});
+ for (int i = 0; i < linkCount; ++i) {
+ const QRectF linkBounds = scaleTransform.mapRect(
+ d->m_linkModel.data(d->m_linkModel.index(i),
+ int(QPdfLinkModel::Role::Rect)).toRectF())
+ .translated(pageGeometry.topLeft());
+ painter.setPen(Qt::blue);
+ painter.drawRect(linkBounds);
+ painter.setPen(Qt::red);
+ const QPoint loc = d->m_linkModel.data(d->m_linkModel.index(i),
+ int(QPdfLinkModel::Role::Location)).toPoint();
+ // TODO maybe draw destination URL if that's what it is
+ painter.drawText(linkBounds.bottomLeft() + QPoint(2, -2),
+ fmt.arg(d->m_linkModel.data(d->m_linkModel.index(i),
+ int(QPdfLinkModel::Role::Page)).toInt())
+ .arg(loc.x()).arg(loc.y()));
+ }
+#endif
+ if (d->m_searchModel) {
+ for (const QPdfLink &result : d->m_searchModel->resultsOnPage(page)) {
+ for (const QRectF &rect : result.rectangles())
+ painter.fillRect(scaleTransform.mapRect(rect).translated(pageGeometry.topLeft()), SearchResultHighlight);
+ }
+
+ if (d->m_currentSearchResultIndex >= 0 && d->m_currentSearchResultIndex < d->m_searchModel->rowCount({})) {
+ const QPdfLink &cur = d->m_searchModel->resultAtIndex(d->m_currentSearchResultIndex);
+ if (cur.page() == page) {
+ painter.setPen({CurrentSearchResultHighlight, CurrentSearchResultWidth});
+ for (const auto &rect : cur.rectangles())
+ painter.drawRect(scaleTransform.mapRect(rect).translated(pageGeometry.topLeft()));
+ }
+ }
}
}
}
@@ -488,6 +662,52 @@ void QPdfView::scrollContentsBy(int dx, int dy)
d->calculateViewport();
}
+void QPdfView::mousePressEvent(QMouseEvent *event)
+{
+ Q_ASSERT(event->isAccepted());
+}
+
+void QPdfView::mouseMoveEvent(QMouseEvent *event)
+{
+ Q_D(QPdfView);
+ for (auto it = d->m_documentLayout.pageGeometryAndScale.cbegin();
+ it != d->m_documentLayout.pageGeometryAndScale.cend(); ++it) {
+ const int page = it.key();
+ const QTransform screenInvTransform = d->screenScaleTransform(page).inverted();
+ const QRect pageGeometry = it.value().first;
+ if (pageGeometry.contains(event->position().toPoint())) {
+ const QPointF posInPoints = screenInvTransform.map(event->position() - pageGeometry.topLeft());
+ d->m_linkModel.setPage(page);
+ auto dest = d->m_linkModel.linkAt(posInPoints);
+ setCursor(dest.isValid() ? Qt::PointingHandCursor : Qt::ArrowCursor);
+ if (dest.isValid())
+ qCDebug(qLcLink) << event->position() << ":" << posInPoints << "pt ->" << dest;
+ }
+ }
+}
+
+void QPdfView::mouseReleaseEvent(QMouseEvent *event)
+{
+ Q_D(QPdfView);
+ for (auto it = d->m_documentLayout.pageGeometryAndScale.cbegin();
+ it != d->m_documentLayout.pageGeometryAndScale.cend(); ++it) {
+ const int page = it.key();
+ const QTransform screenInvTransform = d->screenScaleTransform(page).inverted();
+ const QRect pageGeometry = it.value().first;
+ if (pageGeometry.contains(event->position().toPoint())) {
+ const QPointF posInPoints = screenInvTransform.map(event->position() - pageGeometry.topLeft());
+ d->m_linkModel.setPage(page);
+ auto dest = d->m_linkModel.linkAt(posInPoints);
+ if (dest.isValid()) {
+ qCDebug(qLcLink) << event << ": jumping to" << dest;
+ d->m_pageNavigator->jump(dest.page(), dest.location(), dest.zoom());
+ // TODO scroll and zoom to where the link tells us to
+ }
+ return;
+ }
+ }
+}
+
QT_END_NAMESPACE
#include "moc_qpdfview.cpp"
diff --git a/src/pdfwidgets/qpdfview.h b/src/pdfwidgets/qpdfview.h
index cee1cb64c..7f1d014de 100644
--- a/src/pdfwidgets/qpdfview.h
+++ b/src/pdfwidgets/qpdfview.h
@@ -1,38 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias König <tobias.koenig@kdab.com>
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias König <tobias.koenig@kdab.com>
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QPDFVIEW_H
#define QPDFVIEW_H
@@ -43,7 +11,8 @@
QT_BEGIN_NAMESPACE
class QPdfDocument;
-class QPdfPageNavigation;
+class QPdfPageNavigator;
+class QPdfSearchModel;
class QPdfViewPrivate;
class Q_PDF_WIDGETS_EXPORT QPdfView : public QAbstractScrollArea
@@ -59,29 +28,38 @@ class Q_PDF_WIDGETS_EXPORT QPdfView : public QAbstractScrollArea
Q_PROPERTY(int pageSpacing READ pageSpacing WRITE setPageSpacing NOTIFY pageSpacingChanged)
Q_PROPERTY(QMargins documentMargins READ documentMargins WRITE setDocumentMargins NOTIFY documentMarginsChanged)
+ Q_PROPERTY(QPdfSearchModel* searchModel READ searchModel WRITE setSearchModel NOTIFY searchModelChanged)
+ Q_PROPERTY(int currentSearchResultIndex READ currentSearchResultIndex WRITE setCurrentSearchResultIndex NOTIFY currentSearchResultIndexChanged)
+
public:
- enum PageMode
+ enum class PageMode
{
SinglePage,
MultiPage
};
Q_ENUM(PageMode)
- enum ZoomMode
+ enum class ZoomMode
{
- CustomZoom,
+ Custom,
FitToWidth,
FitInView
};
Q_ENUM(ZoomMode)
- explicit QPdfView(QWidget *parent = nullptr);
+ QPdfView() : QPdfView(nullptr) {}
+ explicit QPdfView(QWidget *parent);
~QPdfView();
void setDocument(QPdfDocument *document);
QPdfDocument *document() const;
- QPdfPageNavigation *pageNavigation() const;
+ QPdfSearchModel *searchModel() const;
+ void setSearchModel(QPdfSearchModel *searchModel);
+
+ int currentSearchResultIndex() const;
+
+ QPdfPageNavigator *pageNavigator() const;
PageMode pageMode() const;
ZoomMode zoomMode() const;
@@ -94,27 +72,32 @@ public:
void setDocumentMargins(QMargins margins);
public Q_SLOTS:
- void setPageMode(PageMode mode);
- void setZoomMode(ZoomMode mode);
+ void setPageMode(QPdfView::PageMode mode);
+ void setZoomMode(QPdfView::ZoomMode mode);
void setZoomFactor(qreal factor);
+ void setCurrentSearchResultIndex(int currentResult);
Q_SIGNALS:
void documentChanged(QPdfDocument *document);
- void pageModeChanged(PageMode pageMode);
- void zoomModeChanged(ZoomMode zoomMode);
+ void pageModeChanged(QPdfView::PageMode pageMode);
+ void zoomModeChanged(QPdfView::ZoomMode zoomMode);
void zoomFactorChanged(qreal zoomFactor);
void pageSpacingChanged(int pageSpacing);
void documentMarginsChanged(QMargins documentMargins);
+ void searchModelChanged(QPdfSearchModel *searchModel);
+ void currentSearchResultIndexChanged(int currentResult);
protected:
- explicit QPdfView(QPdfViewPrivate &, QWidget *);
-
void paintEvent(QPaintEvent *event) override;
void resizeEvent(QResizeEvent *event) override;
void scrollContentsBy(int dx, int dy) override;
+ void mousePressEvent(QMouseEvent *event) override;
+ void mouseMoveEvent(QMouseEvent *event) override;
+ void mouseReleaseEvent(QMouseEvent *event) override;
private:
Q_DECLARE_PRIVATE(QPdfView)
+ QScopedPointer<QPdfViewPrivate> d_ptr;
};
QT_END_NAMESPACE
diff --git a/src/pdfwidgets/qpdfview_p.h b/src/pdfwidgets/qpdfview_p.h
index 9fd54b4b6..d349cc2ee 100644
--- a/src/pdfwidgets/qpdfview_p.h
+++ b/src/pdfwidgets/qpdfview_p.h
@@ -1,38 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias König <tobias.koenig@kdab.com>
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias König <tobias.koenig@kdab.com>
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QPDFVIEW_P_H
#define QPDFVIEW_P_H
@@ -49,20 +16,22 @@
//
#include "qpdfview.h"
+#include "qpdfdocument.h"
+#include "qpdflinkmodel.h"
+#include <QHash>
#include <QPointer>
-#include <QtWidgets/private/qabstractscrollarea_p.h>
QT_BEGIN_NAMESPACE
class QPdfPageRenderer;
-class QPdfViewPrivate : public QAbstractScrollAreaPrivate
+class QPdfViewPrivate
{
Q_DECLARE_PUBLIC(QPdfView)
public:
- QPdfViewPrivate();
+ QPdfViewPrivate(QPdfView *q);
void init();
void documentStatusChanged();
@@ -77,23 +46,30 @@ public:
qreal yPositionForPage(int page) const;
+ QTransform screenScaleTransform(int page) const; // points to pixels
+
struct DocumentLayout
{
QSize documentSize;
- QHash<int, QRect> pageGeometries;
+ QHash<int, QPair<QRect, qreal>> pageGeometryAndScale;
};
DocumentLayout calculateDocumentLayout() const;
void updateDocumentLayout();
+ QPdfView *q_ptr;
QPointer<QPdfDocument> m_document;
- QPdfPageNavigation* m_pageNavigation;
+ QPointer<QPdfSearchModel> m_searchModel;
+ QPdfPageNavigator* m_pageNavigator;
QPdfPageRenderer *m_pageRenderer;
+ QPdfLinkModel m_linkModel;
QPdfView::PageMode m_pageMode;
QPdfView::ZoomMode m_zoomMode;
qreal m_zoomFactor;
+ int m_currentSearchResultIndex = -1;
+
int m_pageSpacing;
QMargins m_documentMargins;
@@ -104,7 +80,7 @@ public:
QRect m_viewport;
QHash<int, QImage> m_pageCache;
- QVector<int> m_cachedPagesLRU;
+ QList<int> m_cachedPagesLRU;
int m_pageCacheLimit;
DocumentLayout m_documentLayout;
@@ -112,7 +88,7 @@ public:
qreal m_screenResolution; // pixels per point
};
-Q_DECLARE_TYPEINFO(QPdfViewPrivate::DocumentLayout, Q_MOVABLE_TYPE);
+Q_DECLARE_TYPEINFO(QPdfViewPrivate::DocumentLayout, Q_RELOCATABLE_TYPE);
QT_END_NAMESPACE
diff --git a/src/pdfwidgets/qtpdfwidgetsglobal.h b/src/pdfwidgets/qtpdfwidgetsglobal.h
index 6c73a34f6..83133e38c 100644
--- a/src/pdfwidgets/qtpdfwidgetsglobal.h
+++ b/src/pdfwidgets/qtpdfwidgetsglobal.h
@@ -1,38 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QTPDFWIDGETSGLOBAL_H
#define QTPDFWIDGETSGLOBAL_H
diff --git a/src/plugins/imageformats/imageformats.pro b/src/plugins/imageformats/imageformats.pro
deleted file mode 100644
index c3b9cb3a4..000000000
--- a/src/plugins/imageformats/imageformats.pro
+++ /dev/null
@@ -1,2 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS += pdf
diff --git a/src/plugins/imageformats/pdf/main.cpp b/src/plugins/imageformats/pdf/main.cpp
deleted file mode 100644
index b4d59353c..000000000
--- a/src/plugins/imageformats/pdf/main.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qpdfiohandler_p.h"
-
-QT_BEGIN_NAMESPACE
-
-class QPdfPlugin : public QImageIOPlugin
-{
- Q_OBJECT
- Q_PLUGIN_METADATA(IID QImageIOHandlerFactoryInterface_iid FILE "pdf.json")
-
-public:
- Capabilities capabilities(QIODevice *device, const QByteArray &format) const override;
- QImageIOHandler *create(QIODevice *device, const QByteArray &format = QByteArray()) const override;
-};
-
-QImageIOPlugin::Capabilities QPdfPlugin::capabilities(QIODevice *device, const QByteArray &format) const
-{
- if (format == "pdf")
- return Capabilities(CanRead);
- if (!format.isEmpty())
- return {};
-
- Capabilities cap;
- if (device->isReadable() && QPdfIOHandler::canRead(device))
- cap |= CanRead;
- return cap;
-}
-
-QImageIOHandler *QPdfPlugin::create(QIODevice *device, const QByteArray &format) const
-{
- QPdfIOHandler *hand = new QPdfIOHandler();
- hand->setDevice(device);
- hand->setFormat(format);
- return hand;
-}
-
-QT_END_NAMESPACE
-
-#include "main.moc"
diff --git a/src/plugins/imageformats/pdf/pdf.pro b/src/plugins/imageformats/pdf/pdf.pro
deleted file mode 100644
index b820ae7d5..000000000
--- a/src/plugins/imageformats/pdf/pdf.pro
+++ /dev/null
@@ -1,11 +0,0 @@
-TARGET = qpdf
-
-PLUGIN_TYPE = imageformats
-PLUGIN_EXTENDS = pdf
-PLUGIN_CLASS_NAME = QPdfPlugin
-load(qt_plugin)
-
-HEADERS += qpdfiohandler_p.h
-SOURCES += main.cpp \
- qpdfiohandler.cpp
-QT += pdf
diff --git a/src/plugins/imageformats/pdf/qpdfiohandler.cpp b/src/plugins/imageformats/pdf/qpdfiohandler.cpp
deleted file mode 100644
index 98e4f4663..000000000
--- a/src/plugins/imageformats/pdf/qpdfiohandler.cpp
+++ /dev/null
@@ -1,239 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qpdfiohandler_p.h"
-#include <QLoggingCategory>
-#include <QPainter>
-
-QT_BEGIN_NAMESPACE
-
-Q_LOGGING_CATEGORY(qLcPdf, "qt.imageformat.pdf")
-
-QPdfIOHandler::QPdfIOHandler()
-{
-}
-
-bool QPdfIOHandler::canRead() const
-{
- if (!device())
- return false;
- if (m_loaded)
- return true;
- if (QPdfIOHandler::canRead(device())) {
- setFormat("pdf");
- return true;
- }
- return false;
-}
-
-bool QPdfIOHandler::canRead(QIODevice *device)
-{
- char buf[6];
- device->peek(buf, 6);
- return (!qstrncmp(buf, "%PDF-", 5) || Q_UNLIKELY(!qstrncmp(buf, "\012%PDF-", 6)));
-}
-
-int QPdfIOHandler::currentImageNumber() const
-{
- return m_page;
-}
-
-QRect QPdfIOHandler::currentImageRect() const
-{
- return QRect(QPoint(0, 0), m_doc.pageSize(m_page).toSize());
-}
-
-int QPdfIOHandler::imageCount() const
-{
- int ret = 0;
- if (const_cast<QPdfIOHandler *>(this)->load(device()))
- ret = m_doc.pageCount();
- qCDebug(qLcPdf) << "imageCount" << ret;
- return ret;
-}
-
-bool QPdfIOHandler::read(QImage *image)
-{
- if (load(device())) {
- if (m_page >= m_doc.pageCount())
- return false;
- if (m_page < 0)
- m_page = 0;
- const bool xform = (m_clipRect.isValid() || m_scaledSize.isValid() || m_scaledClipRect.isValid());
- QSize pageSize = m_doc.pageSize(m_page).toSize();
- QSize finalSize = pageSize;
- QRectF bounds;
- if (xform && !finalSize.isEmpty()) {
- bounds = QRectF(QPointF(0,0), QSizeF(finalSize));
- QPoint tr1, tr2;
- QSizeF sc(1, 1);
- if (m_clipRect.isValid()) {
- tr1 = -m_clipRect.topLeft();
- finalSize = m_clipRect.size();
- }
- if (m_scaledSize.isValid()) {
- sc = QSizeF(qreal(m_scaledSize.width()) / finalSize.width(),
- qreal(m_scaledSize.height()) / finalSize.height());
- finalSize = m_scaledSize;
- pageSize = m_scaledSize;
- }
- if (m_scaledClipRect.isValid()) {
- tr2 = -m_scaledClipRect.topLeft();
- finalSize = m_scaledClipRect.size();
- }
- QTransform t;
- t.translate(tr2.x(), tr2.y());
- t.scale(sc.width(), sc.height());
- t.translate(tr1.x(), tr1.y());
- bounds = t.mapRect(bounds);
- }
- qCDebug(qLcPdf) << Q_FUNC_INFO << m_page << finalSize;
- if (image->size() != finalSize || !image->reinterpretAsFormat(QImage::Format_ARGB32_Premultiplied)) {
- *image = QImage(finalSize, QImage::Format_ARGB32_Premultiplied);
- if (!finalSize.isEmpty() && image->isNull()) {
- // avoid QTBUG-68229
- qWarning("QPdfIOHandler: QImage allocation failed (size %i x %i)", finalSize.width(), finalSize.height());
- return false;
- }
- }
- if (!finalSize.isEmpty()) {
- QPdfDocumentRenderOptions options;
- if (m_scaledClipRect.isValid())
- options.setScaledClipRect(m_scaledClipRect);
- options.setScaledSize(pageSize);
- image->fill(m_backColor.rgba());
- QPainter p(image);
- QImage pageImage = m_doc.render(m_page, finalSize, options);
- p.drawImage(0, 0, pageImage);
- p.end();
- }
- return true;
- }
-
- return false;
-}
-
-QVariant QPdfIOHandler::option(ImageOption option) const
-{
- switch (option) {
- case ImageFormat:
- return QImage::Format_ARGB32_Premultiplied;
- case Size:
- const_cast<QPdfIOHandler *>(this)->load(device());
- return m_doc.pageSize(qMax(0, m_page));
- case ClipRect:
- return m_clipRect;
- case ScaledSize:
- return m_scaledSize;
- case ScaledClipRect:
- return m_scaledClipRect;
- case BackgroundColor:
- return m_backColor;
- case Name:
- return m_doc.metaData(QPdfDocument::Title);
- default:
- break;
- }
- return QVariant();
-}
-
-void QPdfIOHandler::setOption(ImageOption option, const QVariant & value)
-{
- switch (option) {
- case ClipRect:
- m_clipRect = value.toRect();
- break;
- case ScaledSize:
- m_scaledSize = value.toSize();
- break;
- case ScaledClipRect:
- m_scaledClipRect = value.toRect();
- break;
- case BackgroundColor:
- m_backColor = value.value<QColor>();
- break;
- default:
- break;
- }
-}
-
-bool QPdfIOHandler::supportsOption(ImageOption option) const
-{
- switch (option)
- {
- case ImageFormat:
- case Size:
- case ClipRect:
- case ScaledSize:
- case ScaledClipRect:
- case BackgroundColor:
- case Name:
- return true;
- default:
- break;
- }
- return false;
-}
-
-bool QPdfIOHandler::jumpToImage(int frame)
-{
- qCDebug(qLcPdf) << Q_FUNC_INFO << frame;
- if (frame < 0 || frame >= m_doc.pageCount())
- return false;
- m_page = frame;
- return true;
-}
-
-bool QPdfIOHandler::jumpToNextImage()
-{
- return jumpToImage(m_page + 1);
-}
-
-bool QPdfIOHandler::load(QIODevice *device)
-{
- if (m_loaded)
- return true;
- if (format().isEmpty())
- if (!canRead())
- return false;
-
- m_doc.load(device);
- m_loaded = (m_doc.error() == QPdfDocument::DocumentError::NoError);
-
- return m_loaded;
-}
-
-QT_END_NAMESPACE
diff --git a/src/plugins/imageformats/pdf/qpdfiohandler_p.h b/src/plugins/imageformats/pdf/qpdfiohandler_p.h
deleted file mode 100644
index 99a91154c..000000000
--- a/src/plugins/imageformats/pdf/qpdfiohandler_p.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QPDFIOHANDLER_H
-#define QPDFIOHANDLER_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtGui/qimageiohandler.h>
-#include <QtPdf/QPdfDocument>
-
-QT_BEGIN_NAMESPACE
-
-class QPdfIOHandler : public QImageIOHandler
-{
-public:
- QPdfIOHandler();
- bool canRead() const override;
- static bool canRead(QIODevice *device);
- int currentImageNumber() const override;
- QRect currentImageRect() const override;
- int imageCount() const override;
- bool read(QImage *image) override;
- QVariant option(ImageOption option) const override;
- void setOption(ImageOption option, const QVariant & value) override;
- bool supportsOption(ImageOption option) const override;
- bool jumpToImage(int frame) override;
- bool jumpToNextImage() override;
-
-private:
- bool load(QIODevice *device);
-
-private:
- QPdfDocument m_doc;
- int m_page = -1;
-
- QRect m_clipRect;
- QSize m_scaledSize;
- QRect m_scaledClipRect;
- QColor m_backColor = Qt::transparent;
- bool m_loaded = false;
-};
-
-QT_END_NAMESPACE
-
-#endif // QPDFIOHANDLER_H
diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro
deleted file mode 100644
index 50181aa19..000000000
--- a/src/plugins/plugins.pro
+++ /dev/null
@@ -1,3 +0,0 @@
-TEMPLATE = subdirs
-qtHaveModule(webenginewidgets): qtHaveModule(designer): SUBDIRS += qwebengineview
-qtHaveModule(pdf): qtConfig(imageformatplugin): SUBDIRS += imageformats
diff --git a/src/plugins/qwebengineview/qwebengineview.pro b/src/plugins/qwebengineview/qwebengineview.pro
deleted file mode 100644
index c18b6fe94..000000000
--- a/src/plugins/qwebengineview/qwebengineview.pro
+++ /dev/null
@@ -1,11 +0,0 @@
-TARGET = qwebengineview
-QT += designer webenginewidgets
-
-PLUGIN_CLASS_NAME = QWebEngineViewPlugin
-PLUGIN_TYPE = designer
-CONFIG += tool_plugin
-load(qt_plugin)
-
-SOURCES += qwebengineview_plugin.cpp
-HEADERS += qwebengineview_plugin.h
-RESOURCES += qwebengineview_plugin.qrc
diff --git a/src/plugins/qwebengineview/qwebengineview_plugin.cpp b/src/plugins/qwebengineview/qwebengineview_plugin.cpp
deleted file mode 100644
index dff041800..000000000
--- a/src/plugins/qwebengineview/qwebengineview_plugin.cpp
+++ /dev/null
@@ -1,137 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qwebengineview_plugin.h"
-
-#include <QtDesigner/QExtensionFactory>
-#include <QtDesigner/QExtensionManager>
-
-#include <QtCore/qplugin.h>
-#include <QWebEngineView>
-
-QT_BEGIN_NAMESPACE
-
-static const char toolTipC[] =
- QT_TRANSLATE_NOOP(QWebEngineViewPlugin,
- "A widget for displaying a web page, from the Qt WebEngineWidgets module");
-
-QWebEngineViewPlugin::QWebEngineViewPlugin(QObject *parent) :
- QObject(parent),
- m_initialized(false)
-{
-}
-
-QString QWebEngineViewPlugin::name() const
-{
- return QStringLiteral("QWebEngineView");
-}
-
-QString QWebEngineViewPlugin::group() const
-{
- return QStringLiteral("Display Widgets");
-}
-
-QString QWebEngineViewPlugin::toolTip() const
-{
- return tr(toolTipC);
-}
-
-QString QWebEngineViewPlugin::whatsThis() const
-{
- return tr(toolTipC);
-}
-
-QString QWebEngineViewPlugin::includeFile() const
-{
- return QStringLiteral("<QtWebEngineWidgets/QWebEngineView>");
-}
-
-QIcon QWebEngineViewPlugin::icon() const
-{
- return QIcon(QStringLiteral(":/qt-project.org/qwebengineview/images/qwebengineview.png"));
-}
-
-bool QWebEngineViewPlugin::isContainer() const
-{
- return false;
-}
-
-QWidget *QWebEngineViewPlugin::createWidget(QWidget *parent)
-{
- if (parent)
- return new QWebEngineView(parent);
- return new fake::QWebEngineView;
-}
-
-bool QWebEngineViewPlugin::isInitialized() const
-{
- return m_initialized;
-}
-
-void QWebEngineViewPlugin::initialize(QDesignerFormEditorInterface * /*core*/)
-{
- if (m_initialized)
- return;
-
- m_initialized = true;
-}
-
-QString QWebEngineViewPlugin::domXml() const
-{
- return QStringLiteral("\
- <ui language=\"c++\">\
- <widget class=\"QWebEngineView\" name=\"webEngineView\">\
- <property name=\"url\">\
- <url>\
- <string>about:blank</string>\
- </url>\
- </property>\
- <property name=\"geometry\">\
- <rect>\
- <x>0</x>\
- <y>0</y>\
- <width>300</width>\
- <height>200</height>\
- </rect>\
- </property>\
- </widget>\
- </ui>");
-}
-
-QT_END_NAMESPACE
diff --git a/src/plugins/qwebengineview/qwebengineview_plugin.h b/src/plugins/qwebengineview/qwebengineview_plugin.h
deleted file mode 100644
index dd7d38a72..000000000
--- a/src/plugins/qwebengineview/qwebengineview_plugin.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWEBENGINEVIEW_PLUGIN_H
-#define QWEBENGINEVIEW_PLUGIN_H
-
-#include <QtUiPlugin/QDesignerCustomWidgetInterface>
-#include <QtWidgets/QWidget>
-#include <QtGui/QIcon>
-#include <QtCore/QUrl>
-
-QT_BEGIN_NAMESPACE
-
-namespace fake {
-// A lightweight "fake" QWebEngineView class that is returned when Qt Designer
-// queries the default property values by calling
-// QDesignerCustomWidgetInterface::createWidget() with 0 parent, preventing
-// crashes during QWebEngine initialization (QTBUG-53984).
-// The property list needs to be kept in sync with QWebEngineView.
-class QWebEngineView : public QWidget {
- Q_OBJECT
- Q_PROPERTY(QString title READ title)
- Q_PROPERTY(QUrl url READ url WRITE setUrl) // Designable
- Q_PROPERTY(QUrl iconUrl READ iconUrl)
- Q_PROPERTY(QIcon icon READ icon)
- Q_PROPERTY(QString selectedText READ selectedText)
- Q_PROPERTY(bool hasSelection READ hasSelection)
- Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor) // Designable
-
-public:
- explicit QWebEngineView(QWidget *parent = Q_NULLPTR) : QWidget(parent) {}
-
- QString title() const { return QString(); }
- QUrl url() const { return QUrl(); }
- void setUrl(const QUrl &) {}
- QUrl iconUrl() const { return QUrl(); }
- QIcon icon() const { return QIcon(); }
- QString selectedText() { return QString(); }
- bool hasSelection() { return false; }
- qreal zoomFactor() const { return 1; }
- void setZoomFactor(qreal) {}
-};
-} // namespace fake
-
-class QWebEngineViewPlugin: public QObject, public QDesignerCustomWidgetInterface
-{
- Q_OBJECT
- Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDesignerCustomWidgetInterface")
- Q_INTERFACES(QDesignerCustomWidgetInterface)
-public:
- explicit QWebEngineViewPlugin(QObject *parent = Q_NULLPTR);
-
- QString name() const override;
- QString group() const override;
- QString toolTip() const override;
- QString whatsThis() const override;
- QString includeFile() const override;
- QIcon icon() const override;
- bool isContainer() const override;
- QWidget *createWidget(QWidget *parent) override;
- bool isInitialized() const override;
- void initialize(QDesignerFormEditorInterface *core) override;
- QString domXml() const override;
-
-private:
- bool m_initialized;
-};
-
-QT_END_NAMESPACE
-
-#endif // QWEBENGINEVIEW_PLUGIN_H
diff --git a/src/plugins/qwebengineview/qwebengineview_plugin.qrc b/src/plugins/qwebengineview/qwebengineview_plugin.qrc
deleted file mode 100644
index 181625c48..000000000
--- a/src/plugins/qwebengineview/qwebengineview_plugin.qrc
+++ /dev/null
@@ -1,5 +0,0 @@
-<RCC>
- <qresource prefix="/qt-project.org/qwebengineview">
- <file>images/qwebengineview.png</file>
- </qresource>
-</RCC>
diff --git a/src/process/CMakeLists.txt b/src/process/CMakeLists.txt
new file mode 100644
index 000000000..630ba42a8
--- /dev/null
+++ b/src/process/CMakeLists.txt
@@ -0,0 +1,105 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+if(NOT DEFINED WEBENGINE_ROOT_SOURCE_DIR)
+ qt_internal_get_filename_path_mode(path_mode)
+
+ get_filename_component(WEBENGINE_ROOT_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../.." ${path_mode})
+endif()
+include(${WEBENGINE_ROOT_SOURCE_DIR}/cmake/Functions.cmake)
+
+find_package(Qt6 COMPONENTS Gui)
+
+get_target_property(qtWebEngineProcessName WebEngineCore QTWEBENGINEPROCESS_NAME)
+get_target_property(isFramework WebEngineCore FRAMEWORK)
+
+qt_internal_add_executable(${qtWebEngineProcessName}
+ NO_INSTALL
+ SOURCES main.cpp
+)
+
+if(WIN32)
+ target_sources(${qtWebEngineProcessName} PRIVATE support_win.cpp)
+ target_sources(${qtWebEngineProcessName} PRIVATE QtWebEngineProcess.exe.manifest)
+ target_link_libraries(${qtWebEngineProcessName} PRIVATE WebEngineCoreSandbox)
+ set_property(TARGET ${qtWebEngineProcessName} PROPERTY WIN32_EXECUTABLE TRUE)
+ # get libs rsp file, since cmake is not aware of PUBLIC libs for WebEngineCore
+ get_target_property(libs_rsp WebEngineCore LIBS_RSP)
+ target_link_options(${qtWebEngineProcessName} PRIVATE "@${libs_rsp}" "/STACK:0x800000")
+endif()
+
+if(MACOS)
+ set_target_properties(${qtWebEngineProcessName}
+ PROPERTIES MACOSX_BUNDLE_GUI_IDENTIFIER "org.qt-project.Qt.QtWebEngineProcess"
+ )
+endif()
+
+qt_internal_extend_target(${qtWebEngineProcessName}
+ PUBLIC_LIBRARIES
+ Qt::Gui
+ Qt::WebEngineCore
+ LIBRARIES
+ Qt::CorePrivate
+ Qt::WebEngineCorePrivate
+)
+
+target_include_directories(${qtWebEngineProcessName} PRIVATE ../core)
+
+qt_get_cmake_configurations(configs)
+
+foreach(config ${configs})
+ string(TOUPPER "${config}" config_upper)
+ if(isFramework)
+ set(outputPath
+ "${QT_BUILD_DIR}/${INSTALL_LIBDIR}/QtWebEngineCore.framework/Versions/A/Helpers"
+ )
+ else()
+ set(outputPath "${QT_BUILD_DIR}/${INSTALL_LIBEXECDIR}")
+ endif()
+ set_target_properties(${qtWebEngineProcessName} PROPERTIES
+ RUNTIME_OUTPUT_DIRECTORY_${config_upper} "${outputPath}"
+ )
+
+ if("${config}" STREQUAL "Debug")
+ set_target_properties(${qtWebEngineProcessName} PROPERTIES
+ OUTPUT_NAME_DEBUG ${qtWebEngineProcessName}${CMAKE_DEBUG_POSTFIX}
+ )
+ endif()
+endforeach()
+
+if(isFramework)
+ set_target_properties(${qtWebEngineProcessName} PROPERTIES
+ MACOSX_BUNDLE TRUE
+ INSTALL_RPATH "@loader_path/../../../../../../../"
+ MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info_mac.plist.in"
+ )
+
+ target_sources(${qtWebEngineProcessName} PRIVATE QtWebEngineProcess.entitlements)
+ set_source_files_properties(QtWebEngineProcess.entitlements PROPERTIES
+ MACOSX_PACKAGE_LOCATION Resources
+ )
+ add_custom_command(TARGET ${qtWebEngineProcessName} POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E make_directory
+ "$<TARGET_BUNDLE_DIR:WebEngineCore>/Versions/A/Helpers/${qtWebEngineProcessName}.app"
+ COMMAND ${CMAKE_COMMAND} -E create_symlink "Versions/Current/Helpers"
+ "$<TARGET_BUNDLE_DIR:WebEngineCore>/Helpers"
+ USES_TERMINAL
+ )
+ install(TARGETS ${qtWebEngineProcessName}
+ BUNDLE DESTINATION "${INSTALL_LIBDIR}/QtWebEngineCore.framework/Versions/A/Helpers"
+ COMPONENT Runtime
+ )
+ qt_enable_separate_debug_info(${qtWebEngineProcessName}
+ "${INSTALL_LIBDIR}" QT_EXECUTABLE
+ DSYM_OUTPUT_DIR "${CMAKE_BINARY_DIR}/${INSTALL_LIBDIR}"
+ )
+else()
+ qt_apply_rpaths(TARGET ${qtWebEngineProcessName} INSTALL_PATH "${INSTALL_LIBEXECDIR}" RELATIVE_RPATH)
+ install(TARGETS ${qtWebEngineProcessName}
+ CONFIGURATIONS ${configs}
+ RUNTIME DESTINATION "${INSTALL_LIBEXECDIR}"
+ )
+ qt_enable_separate_debug_info(${qtWebEngineProcessName} "${INSTALL_LIBEXECDIR}" QT_EXECUTABLE)
+ qt_internal_install_pdb_files(${qtWebEngineProcessName} "${INSTALL_LIBEXECDIR}")
+endif()
+
diff --git a/src/process/Info_mac.plist b/src/process/Info_mac.plist
deleted file mode 100644
index dcadc2e8f..000000000
--- a/src/process/Info_mac.plist
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>NSPrincipalClass</key>
- <string>NSApplication</string>
- <key>CFBundleIconFile</key>
- <string>@ICON@</string>
- <key>CFBundlePackageType</key>
- <string>APPL</string>
- <key>CFBundleGetInfoString</key>
- <string>Created by Qt/QMake</string>
- <key>CFBundleSignature</key>
- <string>@TYPEINFO@</string>
- <key>CFBundleExecutable</key>
- <string>@EXECUTABLE@</string>
- <key>CFBundleIdentifier</key>
- <string>org.qt-project.Qt.QtWebEngineProcess</string>
- <key>LSUIElement</key>
- <string>1</string>
-</dict>
-</plist>
diff --git a/src/process/Info_mac.plist.in b/src/process/Info_mac.plist.in
new file mode 100644
index 000000000..22c8c026d
--- /dev/null
+++ b/src/process/Info_mac.plist.in
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+
+ <key>CFBundleName</key>
+ <string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
+ <key>CFBundleExecutable</key>
+ <string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
+
+ <key>CFBundleVersion</key>
+ <string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
+ <key>CFBundleShortVersionString</key>
+ <string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
+
+ <key>LSMinimumSystemVersion</key>
+ <string>${CMAKE_OSX_DEPLOYMENT_TARGET}</string>
+
+ <key>NSHumanReadableCopyright</key>
+ <string>${MACOSX_BUNDLE_COPYRIGHT}</string>
+
+ <key>CFBundleIconFile</key>
+ <string>${MACOSX_BUNDLE_ICON_FILE}</string>
+
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleAllowMixedLocalizations</key>
+ <true/>
+
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+
+ <key>NSSupportsAutomaticGraphicsSwitching</key>
+ <true/>
+ <key>LSUIElement</key>
+ <true/>
+</dict>
+</plist>
diff --git a/src/process/QtWebEngineProcess.entitlements b/src/process/QtWebEngineProcess.entitlements
index f2fbabddb..59a4b6c15 100644
--- a/src/process/QtWebEngineProcess.entitlements
+++ b/src/process/QtWebEngineProcess.entitlements
@@ -8,5 +8,7 @@
<true/>
<key>com.apple.security.cs.allow-jit</key>
<true/>
+ <key>com.apple.security.cs.disable-executable-page-protection</key>
+ <true/>
</dict>
</plist>
diff --git a/src/process/process.exe.manifest b/src/process/QtWebEngineProcess.exe.manifest
index 181a0e13e..181a0e13e 100644
--- a/src/process/process.exe.manifest
+++ b/src/process/QtWebEngineProcess.exe.manifest
diff --git a/src/process/main.cpp b/src/process/main.cpp
index 53596d0ee..d71ab128e 100644
--- a/src/process/main.cpp
+++ b/src/process/main.cpp
@@ -1,44 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "process_main.h"
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+#include <QtWebEngineCore/private/qtwebenginecoreglobal_p.h>
#include <QCoreApplication>
#include <stdio.h>
#include <memory>
@@ -86,19 +49,18 @@ struct tm* localtime64_r_proxy(const time_t* timep, struct tm* result)
return sandbox::localtime64_r_override(timep, result);
}
-#endif // defined(OS_LINUX)
+#endif // defined(Q_OS_LINUX)
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN32)
namespace QtWebEngineProcess {
void initDpiAwareness();
-void initializeStaticCopy(int argc, const char **argv);
-} // namespace
-#endif // defined(Q_OS_WIN)
+}
+#endif // defined(Q_OS_WIN32)
int main(int argc, const char **argv)
{
-#ifdef Q_OS_WIN
- QtWebEngineProcess::initializeStaticCopy(argc, argv);
+#if defined(Q_OS_WIN32)
+ QtWebEngineSandbox::initializeStaticCopy(argc, argv);
QtWebEngineProcess::initDpiAwareness();
#endif
@@ -127,6 +89,12 @@ int main(int argc, const char **argv)
QCoreApplication qtApplication(argc, argv_.get());
- return QtWebEngineCore::processMain(argc, argv);
+ if (argc == 1) {
+ qInfo("%s(%s/%s)", qPrintable(qtApplication.applicationName()), qWebEngineVersion(),
+ qWebEngineChromiumVersion());
+ return 0;
+ } else {
+ return QtWebEngineCore::processMain(argc, argv);
+ }
}
diff --git a/src/process/process.pro b/src/process/process.pro
deleted file mode 100644
index 66fdf9797..000000000
--- a/src/process/process.pro
+++ /dev/null
@@ -1,75 +0,0 @@
-TARGET = $$QTWEBENGINEPROCESS_NAME
-
-# Needed to set LSUIElement=1
-QMAKE_INFO_PLIST = Info_mac.plist
-
-QT_PRIVATE += core-private webenginecore-private
-
-INCLUDEPATH += ../core
-
-SOURCES = main.cpp
-
-CONFIG -= ltcg
-
-# On windows we need to statically link to the windows sandbox code
-win32 {
- # The Chromium headers we include are not clean
- CONFIG -= warnings_are_errors
-
- # Look for linking information produced by GN
- linking_pri = $$OUT_PWD/../core/$$getConfigDir()/qtwebengine_sandbox_win.pri
-
- !include($$linking_pri) {
- error("Could not find the linking information that gn should have generated.")
- }
- isEmpty(NINJA_OBJECTS): error("//sandbox/win:sandbox linking changed, update process.pro")
- isEmpty(NINJA_ARCHIVES): error("//sandbox/win:sandbox linking changed, update process.pro")
-
- LIBS_PRIVATE += $$NINJA_LIB_DIRS $$NINJA_LIBS $$NINJA_ARCHIVES $$NINJA_OBJECTS
- QMAKE_LFLAGS += $$NINJA_LFLAGS
- POST_TARGETDEPS += $$eval($$NINJA_TARGETDEPS)
-
- CHROMIUM_SRC_DIR = $$QTWEBENGINE_ROOT/$$getChromiumSrcDir()
- INCLUDEPATH += $$CHROMIUM_SRC_DIR \
- $$OUT_PWD/../core/$$getConfigDir()/gen
-
- SOURCES += \
- support_win.cpp
-
- msvc: QMAKE_LFLAGS += /MANIFESTINPUT:$$PWD/process.exe.manifest
-}
-
-TEMPLATE = app
-
-load(qt_build_paths)
-
-!build_pass:qtConfig(debug_and_release): CONFIG += release
-CONFIG += relative_qt_rpath
-
-qtConfig(build_all): CONFIG += build_all
-
-qtConfig(framework) {
- # Deploy the QtWebEngineProcess app bundle into the QtWebEngineCore framework.
- DESTDIR = $$MODULE_BASE_OUTDIR/lib/QtWebEngineCore.framework/Versions/5/Helpers
-
- # Deploy the entitlements file so macdeployqt can use it.
- entitlements.files = QtWebEngineProcess.entitlements
- entitlements.path = Contents/Resources/
- QMAKE_BUNDLE_DATA += entitlements
-} else {
- CONFIG -= app_bundle
- win32: DESTDIR = $$MODULE_BASE_OUTDIR/bin
- else: DESTDIR = $$MODULE_BASE_OUTDIR/libexec
-}
-msvc: QMAKE_LFLAGS *= /LARGEADDRESSAWARE
-
-qtConfig(framework) {
- target.path = $$[QT_INSTALL_LIBS]/QtWebEngineCore.framework/Versions/5/Helpers
-} else {
- target.path = $$[QT_INSTALL_LIBEXECS]
-}
-
-load(qt_targets)
-load(qt_common)
-
-INSTALLS += target
diff --git a/src/process/support_win.cpp b/src/process/support_win.cpp
index 4fe69b7a9..ab4436b47 100644
--- a/src/process/support_win.cpp
+++ b/src/process/support_win.cpp
@@ -1,53 +1,11 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include <qlibrary.h>
#include <qoperatingsystemversion.h>
#include <qsysinfo.h>
#include <qt_windows.h>
#include <TlHelp32.h>
-#include "../3rdparty/chromium/sandbox/win/src/process_mitigations.h"
-#include "../3rdparty/chromium/sandbox/win/src/sandbox_factory.h"
-
-#ifndef NDEBUG
-#include "../3rdparty/chromium/base/command_line.h"
-#endif
class User32DLL {
public:
@@ -140,45 +98,8 @@ static DWORD getParentProcessId()
return parentPid;
}
-namespace QtWebEngineCore {
-extern __declspec(dllimport) sandbox::SandboxInterfaceInfo *staticSandboxInterfaceInfo(sandbox::SandboxInterfaceInfo *info = nullptr);
-}
-
namespace QtWebEngineProcess {
-// A duplicate of the function by same name in startup_helper_win.cc
-static void InitializeSandboxInfo(sandbox::SandboxInterfaceInfo *info)
-{
- info->broker_services = sandbox::SandboxFactory::GetBrokerServices();
- if (!info->broker_services) {
- info->target_services = sandbox::SandboxFactory::GetTargetServices();
- } else {
- // Ensure the proper mitigations are enforced for the browser process.
- sandbox::ApplyProcessMitigationsToCurrentProcess(
- sandbox::MITIGATION_DEP | sandbox::MITIGATION_DEP_NO_ATL_THUNK |
- sandbox::MITIGATION_HARDEN_TOKEN_IL_POLICY);
- // Note: these mitigations are "post-startup". Some mitigations that need
- // to be enabled sooner (e.g. MITIGATION_EXTENSION_POINT_DISABLE) are done
- // so in Chrome_ELF.
- }
-}
-
-// Initializes the staticlib copy of //base and //sandbox used for Windows sandboxing
-void initializeStaticCopy(int argc, const char **argv)
-{
-#ifndef NDEBUG
- // Initialize //base for debugging
- base::CommandLine::Init(argc, argv);
- logging::LoggingSettings settings;
- settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
- logging::InitLogging(settings);
-#endif
- sandbox::SandboxInterfaceInfo *info = new sandbox::SandboxInterfaceInfo();
- memset(info, 0, sizeof(sandbox::SandboxInterfaceInfo));
- InitializeSandboxInfo(info);
- QtWebEngineCore::staticSandboxInterfaceInfo(info);
-}
-
void initDpiAwareness()
{
ShcoreDLL shcore;
diff --git a/src/src.pro b/src/src.pro
deleted file mode 100644
index 6f8bc2fe4..000000000
--- a/src/src.pro
+++ /dev/null
@@ -1,64 +0,0 @@
-load(functions)
-
-include($$QTWEBENGINE_OUT_ROOT/src/buildtools/qtbuildtools-config.pri)
-include($$QTWEBENGINE_OUT_ROOT/src/core/qtwebenginecore-config.pri)
-include($$QTWEBENGINE_OUT_ROOT/src/webengine/qtwebengine-config.pri)
-include($$QTWEBENGINE_OUT_ROOT/src/webenginewidgets/qtwebenginewidgets-config.pri)
-include($$QTWEBENGINE_OUT_ROOT/src/pdf/qtpdf-config.pri)
-include($$QTWEBENGINE_OUT_ROOT/src/pdfwidgets/qtpdfwidgets-config.pri)
-
-QT_FOR_CONFIG += \
- buildtools-private \
- webenginecore \
- webenginecore-private \
- webengine-private \
- webenginewidgets-private \
- pdf-private \
- pdfwidgets-private
-
-TEMPLATE = subdirs
-
-qtConfig(build-qtwebengine-core):qtConfig(webengine-core-support) {
- core.depends = buildtools
- process.depends = core
- webengine.depends = core
- webenginewidgets.depends = core webengine
- webengine_plugin.subdir = webengine/plugin
- webengine_plugin.target = sub-webengine-plugin
- webengine_plugin.depends = webengine
-
- SUBDIRS += buildtools core process
-
- qtConfig(webengine-spellchecker):!qtConfig(webengine-native-spellchecker):!cross_compile {
- SUBDIRS += qwebengine_convert_dict
- qwebengine_convert_dict.subdir = tools/qwebengine_convert_dict
- qwebengine_convert_dict.depends = core
- }
-
- qtConfig(webengine-qml) {
- SUBDIRS += webengine
- }
-
- qtConfig(webengine-widgets) {
- SUBDIRS += plugins webenginewidgets
- plugins.depends = webenginewidgets
- }
-}
-
-qtConfig(build-qtpdf):qtConfig(webengine-qtpdf-support) {
- pdf.depends = buildtools
- qtConfig(build-qtwebengine-core):qtConfig(webengine-core-support): pdf.depends += core
- !contains(SUBDIRS, buildtools): SUBDIRS += buildtools
- !contains(SUBDIRS, plugins): SUBDIRS += plugins
- SUBDIRS += pdf
- plugins.depends += pdf
- qtConfig(pdf-widgets) {
- pdfwidgets.depends = pdf
- SUBDIRS += pdfwidgets
- }
-}
-
-# this needs to be last line for qmake -r
-qtConfig(build-qtwebengine-core):!contains(SUBDIRS, core): SUBDIRS += core
-qtConfig(build-qtpdf):!contains(SUBDIRS, pdf): SUBDIRS += pdf
-
diff --git a/src/tools/qwebengine_convert_dict/main.cpp b/src/tools/qwebengine_convert_dict/main.cpp
deleted file mode 100644
index 5c95f6d69..000000000
--- a/src/tools/qwebengine_convert_dict/main.cpp
+++ /dev/null
@@ -1,248 +0,0 @@
-/******************************************************************************
-** This is just slightly modified version of convert_dict.cc
-** chromium/chrome/tools/convert_dict/convert_dict.cc
-**
-** Original work:
-** Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
-** Modified work:
-** Copyright (C) 2016 The Qt Company Ltd.
-**
-** Use of this source code is governed by a BSD-style license that can be
-** found in the LICENSE.Chromium file.
-**
-** This tool converts Hunspell .aff/.dic pairs to a combined binary dictionary
-** format (.bdic). This format is more compact, and can be more efficiently
-** read by the client application.
-**
-******************************************************************************/
-
-#include <base/at_exit.h>
-#include <base/containers/span.h>
-#include <base/files/file_path.h>
-#include <base/files/file_util.h>
-#include <base/i18n/icu_util.h>
-#include <build/build_config.h>
-#include <chrome/tools/convert_dict/aff_reader.h>
-#include <chrome/tools/convert_dict/dic_reader.h>
-#include <third_party/hunspell/google/bdict_reader.h>
-#include <third_party/hunspell/google/bdict_writer.h>
-#include <base/path_service.h>
-
-#include <QTextStream>
-#include <QLibraryInfo>
-#include <QDir>
-#include <QCoreApplication>
-
-// see also src/core/type_conversion.h
-inline base::FilePath::StringType toFilePathString(const QString &str)
-{
-#if defined(Q_OS_WIN)
- return QDir::toNativeSeparators(str).toStdWString();
-#else
- return str.toStdString();
-#endif
-}
-
-inline base::FilePath toFilePath(const QString &str)
-{
- return base::FilePath(toFilePathString(str));
-}
-
-inline QString toQt(const base::string16 &string)
-{
-#if defined(OS_WIN)
- return QString::fromStdWString(string.data());
-#else
- return QString::fromUtf16(string.data());
-#endif
-}
-
-inline QString toQt(const std::string &string)
-{
- return QString::fromStdString(string);
-}
-
-template<class T>
-QTextStream &operator<<(QTextStream &out, base::span<T> span)
-{
- out << '[';
- QString prefix;
- for (const auto &element : span) {
- out << prefix;
- out << element;
- prefix = QStringLiteral(",");
- }
- out << ']';
- return out;
-}
-
-// Compares the given word list with the serialized trie to make sure they
-// are the same.
-inline bool VerifyWords(const convert_dict::DicReader::WordList& org_words,
- const std::string& serialized, QTextStream& out)
-{
- hunspell::BDictReader reader;
- if (!reader.Init(reinterpret_cast<const unsigned char*>(serialized.data()),
- serialized.size())) {
- out << "BDict is invalid\n";
- return false;
- }
- hunspell::WordIterator iter = reader.GetAllWordIterator();
-
- int affix_ids[hunspell::BDict::MAX_AFFIXES_PER_WORD];
-
- static const int buf_size = 128;
- char buf[buf_size];
- for (size_t i = 0; i < org_words.size(); i++) {
- int affix_matches = iter.Advance(buf, buf_size, affix_ids);
- if (affix_matches == 0) {
- out << "Found the end before we expected\n";
- return false;
- }
-
- if (org_words[i].first != buf) {
- out << "Word does not match!\n"
- << " Index: " << i << "\n"
- << " Expected: " << QString::fromStdString(org_words[i].first) << "\n"
- << " Actual: " << QString::fromUtf8(buf) << "\n";
- return false;
- }
-
- base::span<const int> expectedAffixes(org_words[i].second);
- base::span<const int> actualAffixes(affix_ids, affix_matches);
-
- if (!std::equal(expectedAffixes.begin(), expectedAffixes.end(),
- actualAffixes.begin(), actualAffixes.end(),
- [](int a, int b) { return a == b; })) {
- out << "Affixes do not match!\n"
- << " Index: " << i << "\n"
- << " Word: " << QString::fromUtf8(buf) << "\n"
- << " Expected: " << expectedAffixes << "\n"
- << " Actual: " << actualAffixes << "\n";
- return false;
- }
- }
-
- return true;
-}
-
-#if defined(OS_MACOSX) && defined(QT_MAC_FRAMEWORK_BUILD)
-QString frameworkIcuDataPath()
-{
- return QLibraryInfo::location(QLibraryInfo::LibrariesPath) +
- QStringLiteral("/QtWebEngineCore.framework/Resources/");
-}
-#endif
-
-int main(int argc, char *argv[])
-{
- // Required only for making QLibraryInfo::location() return a valid path, when the application
- // picks up a qt.conf file (which is the case for official Qt packages).
- QCoreApplication app(argc, argv);
- Q_UNUSED(app);
-
- QTextStream out(stdout);
-
- if (argc != 3) {
- QTextStream out(stdout);
- out << "Usage: qwebengine_convert_dict <dic file> <bdic file>\n\nExample:\n"
- "qwebengine_convert_dict ./en-US.dic ./en-US.bdic\nwill read en-US.dic, "
- "en-US.dic_delta, and en-US.aff from the current directory and generate "
- "en-US.bdic\n\n";
- return 1;
- }
-
- bool icuDataDirFound = false;
- QString icuDataDir = QLibraryInfo::location(QLibraryInfo::DataPath)
- % QLatin1String("/resources");
-
- // Try to look up the path to the ICU data directory via an environment variable
- // (e.g. for the case when the tool is ran during build phase, and regular installed
- // ICU data file is not available).
- QString icuPossibleEnvDataDir = QString::fromLatin1(qgetenv("QT_WEBENGINE_ICU_DATA_DIR"));
- if (!icuPossibleEnvDataDir.isEmpty() && QFileInfo::exists(icuPossibleEnvDataDir)) {
- icuDataDir = icuPossibleEnvDataDir;
- icuDataDirFound = true;
- }
-#if defined(OS_MACOSX) && defined(QT_MAC_FRAMEWORK_BUILD)
- // In a macOS Qt framework build, the resources are inside the QtWebEngineCore framework
- // Resources directory, rather than in the Qt install location.
- else if (QFileInfo::exists(frameworkIcuDataPath())) {
- icuDataDir = frameworkIcuDataPath();
- icuDataDirFound = true;
- }
-#endif
- // Try to find the ICU data directory in the installed Qt location.
- else if (QFileInfo::exists(icuDataDir)) {
- icuDataDirFound = true;
- }
-
- if (icuDataDirFound) {
- base::PathService::Override(base::DIR_QT_LIBRARY_DATA, toFilePath(icuDataDir));
- } else {
- QTextStream out(stdout);
- out << "Couldn't find ICU data directory. Please check that the following path exists: "
- << icuDataDir
- << "\nAlternatively provide the directory path via the QT_WEBENGINE_ICU_DAT_DIR "
- "environment variable.\n\n";
- return 1;
- }
-
-
- base::AtExitManager exit_manager;
- base::i18n::InitializeICU();
-
- base::FilePath file_in_path = toFilePath(argv[1]);
- base::FilePath file_out_path = toFilePath(argv[2]);
- base::FilePath aff_path = file_in_path.ReplaceExtension(FILE_PATH_LITERAL(".aff"));
-
- out << "Reading " << toQt(aff_path.value()) << "\n";
- convert_dict::AffReader aff_reader(aff_path);
-
- if (!aff_reader.Read()) {
- out << "Unable to read the aff file.\n";
- return 1;
- }
-
- base::FilePath dic_path = file_in_path.ReplaceExtension(FILE_PATH_LITERAL(".dic"));
- out << "Reading " << toQt(dic_path.value()) << "\n";
-
- // DicReader will also read the .dic_delta file.
- convert_dict::DicReader dic_reader(dic_path);
- if (!dic_reader.Read(&aff_reader)) {
- out << "Unable to read the dic file.\n";
- return 1;
- }
-
- hunspell::BDictWriter writer;
- writer.SetComment(aff_reader.comments());
- writer.SetAffixRules(aff_reader.affix_rules());
- writer.SetAffixGroups(aff_reader.GetAffixGroups());
- writer.SetReplacements(aff_reader.replacements());
- writer.SetOtherCommands(aff_reader.other_commands());
- writer.SetWords(dic_reader.words());
-
- out << "Serializing...\n";
-
- std::string serialized = writer.GetBDict();
-
- out << "Verifying...\n";
-
- if (!VerifyWords(dic_reader.words(), serialized, out)) {
- out << "ERROR converting, the dictionary does not check out OK.\n";
- return 1;
- }
-
- out << "Writing " << toQt(file_out_path.value()) << "\n";
- FILE *out_file = base::OpenFile(file_out_path, "wb");
- if (!out_file) {
- out << "ERROR writing file\n";
- return 1;
- }
- size_t written = fwrite(&serialized[0], 1, serialized.size(), out_file);
- Q_ASSERT(written == serialized.size());
- base::CloseFile(out_file);
- out << "Success. Dictionary converted.\n";
- return 0;
-}
-
diff --git a/src/tools/qwebengine_convert_dict/qwebengine_convert_dict.pro b/src/tools/qwebengine_convert_dict/qwebengine_convert_dict.pro
deleted file mode 100644
index 57f79f582..000000000
--- a/src/tools/qwebengine_convert_dict/qwebengine_convert_dict.pro
+++ /dev/null
@@ -1,55 +0,0 @@
-option(host_build)
-
-# Look for linking information produced by gyp for our target according to core_generated.gyp
-linking_pri = $$OUT_PWD/../../core/$$getConfigDir()/convert_dict.pri
-
-!include($$linking_pri) {
- error("Could not find the linking information that gn should have generated.")
-}
-
-isEmpty(NINJA_OBJECTS): error("Missing object files from QtWebEngineCore linking pri.")
-isEmpty(NINJA_LFLAGS): error("Missing linker flags from QtWebEngineCore linking pri")
-isEmpty(NINJA_ARCHIVES): error("Missing archive files from QtWebEngineCore linking pri")
-isEmpty(NINJA_LIBS): error("Missing library files from QtWebEngineCore linking pri")
-OBJECTS = $$eval($$list($$NINJA_OBJECTS))
-linux {
- LIBS_PRIVATE = -Wl,--start-group $$NINJA_ARCHIVES -Wl,--end-group
-} else {
- LIBS_PRIVATE = $$NINJA_ARCHIVES
-}
-LIBS_PRIVATE += $$NINJA_LIB_DIRS $$NINJA_LIBS
-QMAKE_LFLAGS += $$NINJA_LFLAGS
-POST_TARGETDEPS += $$NINJA_TARGETDEPS
-
-# Fixme: -Werror=unused-parameter in core
-QMAKE_CXXFLAGS_WARN_ON =
-
-# Disable MSVC2015 warning C4577 ('noexcept' used with no exception handling mode specified)
-win32: QMAKE_CXXFLAGS_WARN_ON = -wd4577
-
-# Issue with some template compliation, smb smart should look at it
-win32: DEFINES += NOMINMAX
-
-# To avoid conflict between windows.h and BoringSSL headers
-win32: DEFINES += WIN32_LEAN_AND_MEAN
-
-CHROMIUM_SRC_DIR = $$QTWEBENGINE_ROOT/$$getChromiumSrcDir()
-INCLUDEPATH += $$CHROMIUM_SRC_DIR \
- $$CHROMIUM_SRC_DIR/third_party/boringssl/src/include \
- $$OUT_PWD/../../core/$$getConfigDir()/gen
-
-SOURCES += \
- main.cpp
-
-QMAKE_TARGET_DESCRIPTION = "Qt WebEngine Dictionary Converter"
-
-CONFIG += c++14
-
-# Support converting dictionaries in a prefix build, by supplying
-# the path to the ICU data file located in the Qt build path, rather
-# than the install path (which is not present at build time).
-icu_data_dir.name = QT_WEBENGINE_ICU_DATA_DIR
-icu_data_dir.value = $$OUT_PWD/../../../src/core/$$getConfigDir()
-QT_TOOL_ENV = icu_data_dir
-load(qt_tool)
-QT_TOOL_ENV =
diff --git a/src/webengine/api/qquickwebengineaction.cpp b/src/webengine/api/qquickwebengineaction.cpp
deleted file mode 100644
index 77ac8d340..000000000
--- a/src/webengine/api/qquickwebengineaction.cpp
+++ /dev/null
@@ -1,173 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-#include "qquickwebengineaction_p.h"
-#include "qquickwebengineaction_p_p.h"
-#include "qquickwebengineview_p.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \qmltype WebEngineAction
- \instantiates QQuickWebEngineAction
- \inqmlmodule QtWebEngine
- \since QtWebEngine 1.8
-
- \brief An action that represents a \l WebEngineView::WebAction.
-
- A WebEngineAction is returned by the \l WebEngineView::action()
- method. It provides information about the action, such as
- whether it is \l enabled.
-
- The following code uses the \l WebEngineView::action() method to check if the
- the copy action is enabled:
-
- \code
- var copyAction = webEngineView.action(WebEngineView.Copy);
- if (copyAction.enabled)
- console.log("Copy is enabled.");
- else
- console.log("Copy is disabled.");
- \endcode
-*/
-
-QQuickWebEngineActionPrivate::QQuickWebEngineActionPrivate(const QVariant &data, const QString &text, const QString &iconName, bool enabled)
- : m_data(data)
- , m_text(text)
- , m_iconName(iconName)
- , m_enabled(enabled)
-{
-}
-
-QQuickWebEngineActionPrivate::~QQuickWebEngineActionPrivate()
-{
-}
-
-void QQuickWebEngineActionPrivate::setEnabled(bool enabled)
-{
- Q_Q(QQuickWebEngineAction);
- if (m_enabled == enabled)
- return;
- m_enabled = enabled;
- emit q->enabledChanged();
-}
-
-QVariant QQuickWebEngineActionPrivate::data() const
-{
- return m_data;
-}
-
-void QQuickWebEngineActionPrivate::trigger()
-{
- Q_Q(QQuickWebEngineAction);
- if (QQuickWebEngineView *view = static_cast<QQuickWebEngineView*>(q->parent())) {
- view->triggerWebAction(static_cast<QQuickWebEngineView::WebAction>(data().toInt()));
- }
-}
-
-QQuickWebEngineAction::QQuickWebEngineAction(const QVariant &data, const QString &text, const QString &iconName, bool enabled, QObject *parent)
- : QObject(parent)
- , d_ptr(new QQuickWebEngineActionPrivate(data, text, iconName, enabled))
-{
- d_ptr->q_ptr = this;
-}
-
-QQuickWebEngineAction::QQuickWebEngineAction(QObject *parent)
- : QObject(parent)
- , d_ptr(new QQuickWebEngineActionPrivate(-1, QStringLiteral(""), QStringLiteral(""), false))
-{
- d_ptr->q_ptr = this;
-}
-
-QQuickWebEngineAction::~QQuickWebEngineAction()
-{
-}
-
-/*!
- \qmlproperty int WebEngineAction::text
-
- This property holds a textual description of the action.
-*/
-QString QQuickWebEngineAction::text() const
-{
- Q_D(const QQuickWebEngineAction);
- return d->m_text;
-}
-
-/*!
- \qmlproperty string WebEngineAction::iconName
-
- This property holds the name of the icon for the action. This name
- can be used to pick the icon from a theme.
-*/
-QString QQuickWebEngineAction::iconName() const
-{
- Q_D(const QQuickWebEngineAction);
- return d->m_iconName;
-}
-
-/*!
- \qmlproperty bool WebEngineAction::enabled
-
- This property holds whether the action is enabled.
-*/
-bool QQuickWebEngineAction::isEnabled() const
-{
- Q_D(const QQuickWebEngineAction);
- return d->m_enabled;
-}
-
-/*!
- \qmlmethod void WebEngineAction::trigger()
-
- Triggers the action.
-*/
-void QQuickWebEngineAction::trigger()
-{
- Q_D(QQuickWebEngineAction);
- if (!isEnabled())
- return;
-
- d->trigger();
- emit triggered();
-}
-
-QT_END_NAMESPACE
-
diff --git a/src/webengine/api/qquickwebengineaction_p.h b/src/webengine/api/qquickwebengineaction_p.h
deleted file mode 100644
index 8f5f3386c..000000000
--- a/src/webengine/api/qquickwebengineaction_p.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKWEBENGINEACTION_P_H
-#define QQUICKWEBENGINEACTION_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QObject>
-#include <QtQml/qqml.h>
-#include "qtwebengineglobal_p.h"
-#include <QVariant>
-
-namespace QtWebEngineCore {
- class UIDelegatesManager;
- class UI2DelegatesManager;
-}
-
-QT_BEGIN_NAMESPACE
-
-class QQuickWebEngineActionPrivate;
-
-class Q_WEBENGINE_EXPORT QQuickWebEngineAction : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(QString text READ text CONSTANT FINAL)
- Q_PROPERTY(QString iconName READ iconName CONSTANT FINAL)
- Q_PROPERTY(bool enabled READ isEnabled NOTIFY enabledChanged FINAL)
-
-public:
- QQuickWebEngineAction(const QVariant &data, const QString &text, const QString &iconName, bool enabled, QObject *parent);
- QQuickWebEngineAction(QObject *parent);
- ~QQuickWebEngineAction();
-
- QString text() const;
- QString iconName() const;
- bool isEnabled() const;
-
-public Q_SLOTS:
- Q_INVOKABLE void trigger();
-
-Q_SIGNALS:
- void triggered();
- void enabledChanged();
-
-private:
- Q_DECLARE_PRIVATE(QQuickWebEngineAction)
- friend class QQuickWebEngineView;
- friend class QQuickWebEngineViewPrivate;
- friend class QtWebEngineCore::UIDelegatesManager;
- friend class QtWebEngineCore::UI2DelegatesManager;
- friend class QQuickContextMenuBuilder;
-
- QScopedPointer<QQuickWebEngineActionPrivate> d_ptr;
-};
-
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QQuickWebEngineAction)
-
-#endif // QQUICKWEBENGINEACTION_P_H
diff --git a/src/webengine/api/qquickwebengineaction_p_p.h b/src/webengine/api/qquickwebengineaction_p_p.h
deleted file mode 100644
index d2ead30e9..000000000
--- a/src/webengine/api/qquickwebengineaction_p_p.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKWEBENGINEACTION_P_P_H
-#define QQUICKWEBENGINEACTION_P_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QObject>
-#include "qtwebengineglobal_p.h"
-#include <QVariant>
-
-QT_BEGIN_NAMESPACE
-
-class QQuickWebEngineAction;
-
-class QQuickWebEngineActionPrivate
-{
-public:
- Q_DECLARE_PUBLIC(QQuickWebEngineAction)
- QQuickWebEngineActionPrivate(const QVariant &data, const QString &text, const QString &iconName, bool enabled);
- ~QQuickWebEngineActionPrivate();
-
- void setEnabled(bool enabled);
-
- QVariant data() const;
-
- void trigger();
-
- QVariant m_data;
- QString m_text;
- QString m_iconName;
- bool m_enabled;
-
-private:
- QQuickWebEngineAction *q_ptr;
-};
-
-QT_END_NAMESPACE
-
-#endif // QQUICKWEBENGINEACTION_P_P_H
diff --git a/src/webengine/api/qquickwebenginecertificateerror.cpp b/src/webengine/api/qquickwebenginecertificateerror.cpp
deleted file mode 100644
index 63beb1bae..000000000
--- a/src/webengine/api/qquickwebenginecertificateerror.cpp
+++ /dev/null
@@ -1,251 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <qquickwebenginecertificateerror_p.h>
-#include "certificate_error_controller.h"
-QT_BEGIN_NAMESPACE
-
-class QQuickWebEngineCertificateErrorPrivate {
-public:
- QQuickWebEngineCertificateErrorPrivate(const QSharedPointer<CertificateErrorController> &controller)
- : weakRefCertErrorController(controller),
- error(static_cast<QQuickWebEngineCertificateError::Error>(static_cast<int>(controller->error()))),
- description(controller->errorString()),
- overridable(controller->overridable()),
- async(false),
- answered(false)
- {
- }
-
- const QWeakPointer<CertificateErrorController> weakRefCertErrorController;
- QQuickWebEngineCertificateError::Error error;
- QString description;
- bool overridable;
- bool async;
- bool answered;
-};
-
-/*!
- \qmltype WebEngineCertificateError
- \instantiates QQuickWebEngineCertificateError
- \inqmlmodule QtWebEngine
- \since QtWebEngine 1.1
-
- \brief A utility type for ignoring certificate errors or rejecting erroneous certificates.
-
- This QML type contains information about a certificate error that occurred. The \l error
- property holds the reason that the error occurred and the \l description property holds a
- short localized description of the error. The \l url property holds the URL that triggered
- the error.
-
- The certificate can be rejected by calling \l rejectCertificate, which will stop loading the
- web engine request. By default, an invalid certificate will be automatically rejected.
-
- The certificate error can be ignored by calling \l ignoreCertificateError, which will
- resume loading the request.
-
- It is possible to defer the decision of rejecting a certificate by calling \l defer,
- which is useful when waiting for user input.
-
- \sa WebEngineView::certificateError
-*/
-QQuickWebEngineCertificateError::QQuickWebEngineCertificateError(const QSharedPointer<CertificateErrorController> &controller, QObject *parent)
- : QObject(parent)
- , d_ptr(new QQuickWebEngineCertificateErrorPrivate(controller))
-{
-}
-
-QQuickWebEngineCertificateError::~QQuickWebEngineCertificateError()
-{
- Q_D(QQuickWebEngineCertificateError);
- if (!d->answered)
- rejectCertificate();
-}
-
-
-/*!
- \qmlmethod void WebEngineCertificateError::defer()
-
- This function should be called when there is a need to postpone the decision whether to ignore a
- certificate error, for example, while waiting for user input. When called, the function pauses the
- URL request until WebEngineCertificateError::ignoreCertificateError() or
- WebEngineCertificateError::rejectCertificate() is called.
- */
-void QQuickWebEngineCertificateError::defer()
-{
- Q_D(QQuickWebEngineCertificateError);
- d->async = true;
-}
-/*!
- \qmlmethod void WebEngineCertificateError::ignoreCertificateError()
-
- The certificate error is ignored, and the web engine view continues to load the requested URL.
- */
-void QQuickWebEngineCertificateError::ignoreCertificateError()
-{
- Q_D(QQuickWebEngineCertificateError);
-
- d->answered = true;
-
- QSharedPointer<CertificateErrorController> strongRefCert = d->weakRefCertErrorController.toStrongRef();
- if (strongRefCert)
- strongRefCert->accept(true);
-}
-
-/*!
- \qmlmethod void WebEngineCertificateError::rejectCertificate()
-
- The certificate is rejected, and the web engine view stops loading the requested URL.
- */
-void QQuickWebEngineCertificateError::rejectCertificate()
-{
- Q_D(QQuickWebEngineCertificateError);
-
- d->answered = true;
-
- QSharedPointer<CertificateErrorController> strongRefCert = d->weakRefCertErrorController.toStrongRef();
- if (strongRefCert)
- strongRefCert->accept(false);
-}
-
-/*!
- \qmlproperty url WebEngineCertificateError::url
- \readonly
-
- The URL that triggered the error.
- */
-QUrl QQuickWebEngineCertificateError::url() const
-{
- Q_D(const QQuickWebEngineCertificateError);
- QSharedPointer<CertificateErrorController> strongRefCert = d->weakRefCertErrorController.toStrongRef();
- if (strongRefCert)
- return strongRefCert->url();
- return QUrl();
-}
-
-/*!
- \qmlproperty enumeration WebEngineCertificateError::error
- \readonly
-
- The type of the error.
-
- \value WebEngineCertificateError.SslPinnedKeyNotInCertificateChain
- The certificate did not match the built-in public keys pinned for
- the host name.
- \value WebEngineCertificateError.CertificateCommonNameInvalid
- The certificate's common name did not match the host name.
- \value WebEngineCertificateError.CertificateDateInvalid
- The certificate is not valid at the current date and time.
- \value WebEngineCertificateError.CertificateAuthorityInvalid
- The certificate is not signed by a trusted authority.
- \value WebEngineCertificateError.CertificateContainsErrors
- The certificate contains errors.
- \value WebEngineCertificateError.CertificateNoRevocationMechanism
- The certificate has no mechanism for determining if it has been
- revoked.
- \value WebEngineCertificateError.CertificateUnableToCheckRevocation
- Revocation information for the certificate is not available.
- \value WebEngineCertificateError.CertificateRevoked
- The certificate has been revoked.
- \value WebEngineCertificateError.CertificateInvalid
- The certificate is invalid.
- \value WebEngineCertificateError.CertificateWeakSignatureAlgorithm
- The certificate is signed using a weak signature algorithm.
- \value WebEngineCertificateError.CertificateNonUniqueName
- The host name specified in the certificate is not unique.
- \value WebEngineCertificateError.CertificateWeakKey
- The certificate contains a weak key.
- \value WebEngineCertificateError.CertificateNameConstraintViolation
- The certificate claimed DNS names that are in violation of name
- constraints.
- \value WebEngineCertificateError.CertificateValidityTooLong
- The certificate has a validity period that is too long.
- (Added in 5.7)
- \value WebEngineCertificateError.CertificateTransparencyRequired
- Certificate Transparency was required for this connection, but the server
- did not provide CT information that complied with the policy. (Added in 5.8)
- \value WebEngineCertificateError.CertificateKnownInterceptionBlocked
- The certificate is known to be used for interception by an entity other
- the device owner. (Added in 5.15)
-
-*/
-QQuickWebEngineCertificateError::Error QQuickWebEngineCertificateError::error() const
-{
- Q_D(const QQuickWebEngineCertificateError);
- return d->error;
-}
-
-/*!
- \qmlproperty string WebEngineCertificateError::description
- \readonly
-
- A short localized human-readable description of the error.
-*/
-QString QQuickWebEngineCertificateError::description() const
-{
- Q_D(const QQuickWebEngineCertificateError);
- return d->description;
-}
-
-/*!
- \qmlproperty bool WebEngineCertificateError::overridable
- \readonly
-
- A boolean that indicates whether the certificate error can be overridden and ignored.
-*/
-bool QQuickWebEngineCertificateError::overridable() const
-{
- Q_D(const QQuickWebEngineCertificateError);
- return d->overridable;
-}
-
-bool QQuickWebEngineCertificateError::deferred() const
-{
- Q_D(const QQuickWebEngineCertificateError);
- return d->async;
-}
-
-bool QQuickWebEngineCertificateError::answered() const
-{
- Q_D(const QQuickWebEngineCertificateError);
- return d->answered;
-}
-
-QT_END_NAMESPACE
-
diff --git a/src/webengine/api/qquickwebenginecertificateerror_p.h b/src/webengine/api/qquickwebenginecertificateerror_p.h
deleted file mode 100644
index 4a8ef6ae0..000000000
--- a/src/webengine/api/qquickwebenginecertificateerror_p.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKWEBENGINECERTIFICATEERROR_P_H
-#define QQUICKWEBENGINECERTIFICATEERROR_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QObject>
-#include "qquickwebengineview_p.h"
-
-QT_BEGIN_NAMESPACE
-
-class QQuickWebEngineCertificateErrorPrivate;
-class CertificateErrorController;
-
-class Q_WEBENGINE_EXPORT QQuickWebEngineCertificateError : public QObject {
- Q_OBJECT
- Q_PROPERTY(QUrl url READ url CONSTANT FINAL)
- Q_PROPERTY(Error error READ error CONSTANT FINAL)
- Q_PROPERTY(QString description READ description CONSTANT FINAL)
- Q_PROPERTY(bool overridable READ overridable CONSTANT FINAL)
-
-public:
-
- // Keep this identical to CertificateErrorController::CertificateError, or add mapping layer.
- enum Error {
- SslPinnedKeyNotInCertificateChain = -150,
- CertificateCommonNameInvalid = -200,
- CertificateDateInvalid = -201,
- CertificateAuthorityInvalid = -202,
- CertificateContainsErrors = -203,
- CertificateNoRevocationMechanism = -204,
- CertificateUnableToCheckRevocation = -205,
- CertificateRevoked = -206,
- CertificateInvalid = -207,
- CertificateWeakSignatureAlgorithm = -208,
- CertificateNonUniqueName = -210,
- CertificateWeakKey = -211,
- CertificateNameConstraintViolation = -212,
- CertificateValidityTooLong = -213,
- CertificateTransparencyRequired = -214,
- CertificateKnownInterceptionBlocked = -217,
- };
- Q_ENUM(Error)
-
- QQuickWebEngineCertificateError(const QSharedPointer<CertificateErrorController> &controller, QObject *parent = 0);
- ~QQuickWebEngineCertificateError();
-
- Q_INVOKABLE void defer();
- Q_INVOKABLE void ignoreCertificateError();
- Q_INVOKABLE void rejectCertificate();
- QUrl url() const;
- Error error() const;
- QString description() const;
- bool overridable() const;
- bool deferred() const;
- bool answered() const;
-
-private:
- Q_DISABLE_COPY(QQuickWebEngineCertificateError)
- Q_DECLARE_PRIVATE(QQuickWebEngineCertificateError)
- QScopedPointer<QQuickWebEngineCertificateErrorPrivate> d_ptr;
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QQuickWebEngineCertificateError)
-
-#endif // QQUICKWEBENGINECERTIFICATEERROR_P_H
diff --git a/src/webengine/api/qquickwebengineclientcertificateselection.cpp b/src/webengine/api/qquickwebengineclientcertificateselection.cpp
deleted file mode 100644
index c48a59887..000000000
--- a/src/webengine/api/qquickwebengineclientcertificateselection.cpp
+++ /dev/null
@@ -1,226 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickwebengineclientcertificateselection_p.h"
-
-#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
-
-#include "client_cert_select_controller.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \qmltype WebEngineClientCertificateOption
- \instantiates QQuickWebEngineClientCertificateOption
- \inqmlmodule QtWebEngine
- \since QtWebEngine 1.9
- \brief Represents a client certificate option.
-
- \sa {WebEngineClientCertificateSelection::certificates} {WebEngineClientCertificateSelection.certificates}
-*/
-
-QQuickWebEngineClientCertificateOption::QQuickWebEngineClientCertificateOption(QQuickWebEngineClientCertificateSelection *selection, int index)
- : QObject(selection), m_selection(selection), m_index(index)
-{}
-
-/*!
- \qmlproperty string WebEngineClientCertificateOption::issuer
- \brief The issuer of the certificate.
-*/
-
-QString QQuickWebEngineClientCertificateOption::issuer() const
-{
- return m_selection->d_ptr->certificates().at(m_index).issuerDisplayName();
-}
-
-/*!
- \qmlproperty string WebEngineClientCertificateOption::subject
- \brief The subject of the certificate.
-*/
-QString QQuickWebEngineClientCertificateOption::subject() const
-{
- return m_selection->d_ptr->certificates().at(m_index).subjectDisplayName();
-}
-
-/*!
- \qmlproperty datetime WebEngineClientCertificateOption::effectiveDate
- \brief The date and time when the certificate becomes valid.
-*/
-QDateTime QQuickWebEngineClientCertificateOption::effectiveDate() const
-{
- return m_selection->d_ptr->certificates().at(m_index).effectiveDate();
-}
-
-/*!
- \qmlproperty datetime WebEngineClientCertificateOption::expiryDate
- \brief The date and time when the certificate becomes invalid.
-*/
-QDateTime QQuickWebEngineClientCertificateOption::expiryDate() const
-{
- return m_selection->d_ptr->certificates().at(m_index).expiryDate();
-}
-
-/*!
- \qmlproperty bool WebEngineClientCertificateOption::isSelfSigned
- \brief Whether the certificate is only self-signed.
-*/
-bool QQuickWebEngineClientCertificateOption::isSelfSigned() const
-{
- return m_selection->d_ptr->certificates().at(m_index).isSelfSigned();
-}
-
-/*!
- \qmlmethod void WebEngineClientCertificateOption::select()
-
- Selects this client certificate option.
-*/
-void QQuickWebEngineClientCertificateOption::select()
-{
- m_selection->select(m_index);
-}
-
-/*!
- \qmltype WebEngineClientCertificateSelection
- \instantiates QQuickWebEngineClientCertificateSelection
- \inqmlmodule QtWebEngine
- \since QtWebEngine 1.9
- \brief Provides a selection of client certificates.
-
- When a web site requests an SSL client certificate, and one or more certificates
- are found in the system's client certificate store, this type provides access to
- the certificates to choose from, as well as a method for selecting one.
-
- The selection is asynchronous. If no certificate is selected and no copy of the
- object is kept alive, loading will continue without a certificate.
-
- \sa {WebEngineView::selectClientCertificate}{WebEngineView.selectClientCertificate}
-*/
-
-QQuickWebEngineClientCertificateSelection::QQuickWebEngineClientCertificateSelection(QSharedPointer<ClientCertSelectController> selectController)
- : QObject(), d_ptr(selectController)
-{}
-
-int QQuickWebEngineClientCertificateSelection::certificates_count(
- QQmlListProperty<QQuickWebEngineClientCertificateOption> *p)
-{
- Q_ASSERT(p && p->object);
- QQuickWebEngineClientCertificateSelection *d = static_cast<QQuickWebEngineClientCertificateSelection *>(p->object);
- return d->m_certificates.size();
-}
-
-QQuickWebEngineClientCertificateOption *QQuickWebEngineClientCertificateSelection::certificates_at(
- QQmlListProperty<QQuickWebEngineClientCertificateOption> *p, int idx)
-{
- Q_ASSERT(p && p->object);
- QQuickWebEngineClientCertificateSelection *d = static_cast<QQuickWebEngineClientCertificateSelection *>(p->object);
- if (idx < 0 || idx >= d->m_certificates.size())
- return nullptr;
- return d->m_certificates[idx];
-}
-
-/*!
- \qmlproperty list<WebEngineClientCertificateOption> WebEngineClientCertificateSelection::certificates
- \brief The client certificates available to choose from.
-*/
-
-QQmlListProperty<QQuickWebEngineClientCertificateOption> QQuickWebEngineClientCertificateSelection::certificates()
-{
- if (m_certificates.empty()) {
- QVector<QSslCertificate> certificates = d_ptr->certificates();
- for (int i = 0; i < certificates.count(); ++i)
- m_certificates.push_back(new QQuickWebEngineClientCertificateOption(this, i));
- }
-
- return QQmlListProperty<QQuickWebEngineClientCertificateOption>(
- this, nullptr,
- certificates_count,
- certificates_at);
-}
-
-/*!
- \qmlmethod void WebEngineClientCertificateSelection::select(WebEngineClientCertificateOption certificate)
-
- Selects the client certificate \a certificate. The certificate must be one
- of the offered certificates.
-
- \sa selectNone()
-*/
-void QQuickWebEngineClientCertificateSelection::select(const QQuickWebEngineClientCertificateOption *certificate)
-{
- select(certificate->m_index);
-}
-
-/*!
- \qmlmethod void WebEngineClientCertificateSelection::select(int index)
-
- Selects the client certificate at the index \a index in the list of offered certificates.
-
- \sa selectNone()
-*/
-void QQuickWebEngineClientCertificateSelection::select(int index)
-{
- d_ptr->select(index);
-}
-
-/*!
- \qmlmethod void WebEngineClientCertificateSelection::selectNone()
-
- Continues without using any of the offered certificates. This is the same
- action as taken when destroying the last copy of this object if no
- selection has been made.
-
- \sa select()
-*/
-void QQuickWebEngineClientCertificateSelection::selectNone()
-{
- d_ptr->selectNone();
-}
-
-/*!
- \qmlproperty url WebEngineClientCertificateSelection::host
- \brief The host and port of the server requesting the client certificate.
-*/
-QUrl QQuickWebEngineClientCertificateSelection::host() const
-{
- return d_ptr->hostAndPort();
-}
-
-QT_END_NAMESPACE
-
-#endif // QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
diff --git a/src/webengine/api/qquickwebengineclientcertificateselection_p.h b/src/webengine/api/qquickwebengineclientcertificateselection_p.h
deleted file mode 100644
index adf8b5f7c..000000000
--- a/src/webengine/api/qquickwebengineclientcertificateselection_p.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKWEBENGINECERTSELECTION_P_H
-#define QQUICKWEBENGINECERTSELECTION_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtWebEngine/private/qtwebengineglobal_p.h>
-
-#include <QtCore/QDateTime>
-#include <QtCore/QObject>
-#include <QtCore/QSharedPointer>
-#include <QtCore/QUrl>
-#include <QtCore/QVector>
-#include <QtQml/QQmlListProperty>
-
-#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
-
-QT_BEGIN_NAMESPACE
-
-class ClientCertSelectController;
-class QQuickWebEngineClientCertificateSelection;
-
-class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineClientCertificateOption : public QObject {
- Q_OBJECT
- Q_PROPERTY(QString issuer READ issuer CONSTANT FINAL)
- Q_PROPERTY(QString subject READ subject CONSTANT FINAL)
- Q_PROPERTY(QDateTime effectiveDate READ effectiveDate CONSTANT FINAL)
- Q_PROPERTY(QDateTime expiryDate READ expiryDate CONSTANT FINAL)
- Q_PROPERTY(bool isSelfSigned READ isSelfSigned CONSTANT FINAL)
-
-public:
- QString issuer() const;
- QString subject() const;
- QDateTime effectiveDate() const;
- QDateTime expiryDate() const;
- bool isSelfSigned() const;
-
- Q_INVOKABLE void select();
-
-private:
- friend class QQuickWebEngineClientCertificateSelection;
- QQuickWebEngineClientCertificateOption(QQuickWebEngineClientCertificateSelection *selection, int index);
-
- QQuickWebEngineClientCertificateSelection *m_selection;
- int m_index;
-};
-
-class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineClientCertificateSelection : public QObject {
- Q_OBJECT
- Q_PROPERTY(QUrl host READ host CONSTANT FINAL)
- Q_PROPERTY(QQmlListProperty<QQuickWebEngineClientCertificateOption> certificates READ certificates CONSTANT FINAL)
-
-public:
- QQuickWebEngineClientCertificateSelection() = default;
-
- QUrl host() const;
-
- Q_INVOKABLE void select(int idx);
- Q_INVOKABLE void select(const QQuickWebEngineClientCertificateOption *certificate);
- Q_INVOKABLE void selectNone();
- QQmlListProperty<QQuickWebEngineClientCertificateOption> certificates();
-
-private:
- friend class QQuickWebEngineViewPrivate;
- friend class QQuickWebEngineClientCertificateOption;
-
- static int certificates_count(QQmlListProperty<QQuickWebEngineClientCertificateOption> *p);
- static QQuickWebEngineClientCertificateOption *certificates_at(QQmlListProperty<QQuickWebEngineClientCertificateOption> *p, int idx);
-
- explicit QQuickWebEngineClientCertificateSelection(QSharedPointer<ClientCertSelectController>);
-
- mutable QVector<QQuickWebEngineClientCertificateOption *> m_certificates;
- QSharedPointer<ClientCertSelectController> d_ptr;
-};
-
-QT_END_NAMESPACE
-
-Q_DECLARE_METATYPE(QQuickWebEngineClientCertificateOption *)
-Q_DECLARE_METATYPE(QQmlListProperty<QQuickWebEngineClientCertificateOption>)
-Q_DECLARE_METATYPE(QQuickWebEngineClientCertificateSelection *)
-
-#endif
-
-#endif // QQUICKWEBENGINECERTSELECTION_P_H
diff --git a/src/webengine/api/qquickwebenginecontextmenurequest.cpp b/src/webengine/api/qquickwebenginecontextmenurequest.cpp
deleted file mode 100644
index e1ebd4c8c..000000000
--- a/src/webengine/api/qquickwebenginecontextmenurequest.cpp
+++ /dev/null
@@ -1,383 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickwebenginecontextmenurequest_p.h"
-#include "web_contents_adapter_client.h"
-
-QT_BEGIN_NAMESPACE
-
-// Match MediaType enum
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypeNone,
- QQuickWebEngineContextMenuRequest::MediaTypeNone)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypeImage,
- QQuickWebEngineContextMenuRequest::MediaTypeImage)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypeAudio,
- QQuickWebEngineContextMenuRequest::MediaTypeAudio)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypeVideo,
- QQuickWebEngineContextMenuRequest::MediaTypeVideo)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypeCanvas,
- QQuickWebEngineContextMenuRequest::MediaTypeCanvas)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypeFile,
- QQuickWebEngineContextMenuRequest::MediaTypeFile)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypePlugin,
- QQuickWebEngineContextMenuRequest::MediaTypePlugin)
-
-// Match MediaFlag enum
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaInError,
- QQuickWebEngineContextMenuRequest::MediaInError)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaPaused,
- QQuickWebEngineContextMenuRequest::MediaPaused)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaMuted,
- QQuickWebEngineContextMenuRequest::MediaMuted)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaLoop,
- QQuickWebEngineContextMenuRequest::MediaLoop)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaCanSave,
- QQuickWebEngineContextMenuRequest::MediaCanSave)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaHasAudio,
- QQuickWebEngineContextMenuRequest::MediaHasAudio)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaCanToggleControls,
- QQuickWebEngineContextMenuRequest::MediaCanToggleControls)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaControls,
- QQuickWebEngineContextMenuRequest::MediaControls)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaCanPrint,
- QQuickWebEngineContextMenuRequest::MediaCanPrint)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaCanRotate,
- QQuickWebEngineContextMenuRequest::MediaCanRotate)
-
-// Match EditFlag enum
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::CanUndo,
- QQuickWebEngineContextMenuRequest::CanUndo)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::CanRedo,
- QQuickWebEngineContextMenuRequest::CanRedo)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::CanCut,
- QQuickWebEngineContextMenuRequest::CanCut)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::CanCopy,
- QQuickWebEngineContextMenuRequest::CanCopy)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::CanPaste,
- QQuickWebEngineContextMenuRequest::CanPaste)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::CanDelete,
- QQuickWebEngineContextMenuRequest::CanDelete)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::CanSelectAll,
- QQuickWebEngineContextMenuRequest::CanSelectAll)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::CanTranslate,
- QQuickWebEngineContextMenuRequest::CanTranslate)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::CanEditRichly,
- QQuickWebEngineContextMenuRequest::CanEditRichly)
-
-/*!
- \qmltype ContextMenuRequest
- \instantiates QQuickWebEngineContextMenuRequest
- \inqmlmodule QtWebEngine
- \since QtWebEngine 1.4
-
- \brief A request for showing a context menu.
-
- A ContextMenuRequest is passed as an argument of the
- WebEngineView::contextMenuRequested signal. It provides further
- information about the context of the request. The position of the
- request origin can be found via the \l x and \l y properties.
-
- The \l accepted property of the request indicates whether the request
- is handled by the user code or the default context menu should
- be displayed.
-
- The following code uses a custom menu to handle the request:
-
- \code
- WebEngineView {
- id: view
- // ...
- onContextMenuRequested: function(request) {
- request.accepted = true;
- myMenu.x = request.x;
- myMenu.y = request.y;
- myMenu.trigger.connect(view.triggerWebAction);
- myMenu.popup();
- }
- // ...
- }
- \endcode
-*/
-
-QQuickWebEngineContextMenuRequest::QQuickWebEngineContextMenuRequest(
- const QtWebEngineCore::WebEngineContextMenuData &data, QObject *parent):
- QObject(parent)
- , m_data(new QtWebEngineCore::WebEngineContextMenuData(data))
- , m_accepted(false)
-{
-}
-
-QQuickWebEngineContextMenuRequest::~QQuickWebEngineContextMenuRequest()
-{
-}
-
-/*!
- \qmlproperty int ContextMenuRequest::x
- \readonly
-
- The x coordinate of the user action from where the context
- menu request originates.
-*/
-
-int QQuickWebEngineContextMenuRequest::x() const
-{
- return m_data->position().x();
-}
-
-/*!
- \qmlproperty int ContextMenuRequest::y
- \readonly
-
- The y coordinate of the user action from where the context
- menu request originates.
-*/
-
-int QQuickWebEngineContextMenuRequest::y() const
-{
- return m_data->position().y();
-}
-
-/*!
- \qmlproperty string ContextMenuRequest::selectedText
- \readonly
-
- The selected text the context menu was created for.
-*/
-
-QString QQuickWebEngineContextMenuRequest::selectedText() const
-{
- return m_data->selectedText();
-}
-
-/*!
- \qmlproperty string ContextMenuRequest::linkText
- \readonly
-
- The text of the link if the context menu was requested for a link.
-*/
-
-QString QQuickWebEngineContextMenuRequest::linkText() const
-{
- return m_data->linkText();
-}
-
-/*!
- \qmlproperty url ContextMenuRequest::linkUrl
- \readonly
-
- The URL of the link if the selected web page content is a link.
- It is not guaranteed to be a valid URL.
-*/
-
-QUrl QQuickWebEngineContextMenuRequest::linkUrl() const
-{
- return m_data->unfilteredLinkUrl();
-}
-
-/*!
- \qmlproperty url ContextMenuRequest::mediaUrl
- \readonly
-
- The URL of media if the selected web content is a media element.
-*/
-
-QUrl QQuickWebEngineContextMenuRequest::mediaUrl() const
-{
- return m_data->mediaUrl();
-}
-
-/*!
- \qmlproperty enumeration ContextMenuRequest::mediaType
- \readonly
-
- The type of the media element or \c MediaTypeNone if
- the selected web page content is not a media element.
-
- \value ContextMenuRequest.MediaTypeNone
- Not a media.
- \value ContextMenuRequest.MediaTypeImage
- An image.
- \value ContextMenuRequest.MediaTypeVideo
- A video.
- \value ContextMenuRequest.MediaTypeAudio
- An audio element.
- \value ContextMenuRequest.MediaTypeCanvas
- A canvas.
- \value ContextMenuRequest.MediaTypeFile
- A file.
- \value ContextMenuRequest.MediaTypePlugin
- A plugin.
-*/
-
-QQuickWebEngineContextMenuRequest::MediaType QQuickWebEngineContextMenuRequest::mediaType() const
-{
- return static_cast<QQuickWebEngineContextMenuRequest::MediaType>(m_data->mediaType());
-}
-
-/*!
- \qmlproperty bool ContextMenuRequest::isContentEditable
- \readonly
-
- Indicates whether the selected web content is editable.
-*/
-
-bool QQuickWebEngineContextMenuRequest::isContentEditable() const
-{
- return m_data->isEditable();
-}
-
-/*!
- \qmlproperty string ContextMenuRequest::misspelledWord
- \readonly
-
- If the context is a word considered misspelled by the spell-checker,
- returns the misspelled word.
-*/
-
-QString QQuickWebEngineContextMenuRequest::misspelledWord() const
-{
- return m_data->misspelledWord();
-}
-
-/*!
- \qmlproperty stringlist ContextMenuRequest::spellCheckerSuggestions
- \readonly
-
- If the context is a word considered misspelled by the spell-checker,
- returns a list of suggested replacements.
-*/
-
-QStringList QQuickWebEngineContextMenuRequest::spellCheckerSuggestions() const
-{
- return m_data->spellCheckerSuggestions();
-}
-
-/*!
- \qmlproperty bool ContextMenuRequest::accepted
-
- Indicates whether the context menu request has been
- handled by the signal handler.
-
- If the property is \c false after any signal handlers
- for WebEngineView::contextMenuRequested have been executed,
- a default context menu will be shown.
- To prevent this, set \c{request.accepted} to \c true.
-
- The default is \c false.
-
- \note The default content of the context menu depends on the
- web element for which the request was actually generated.
-*/
-
-bool QQuickWebEngineContextMenuRequest::isAccepted() const
-{
- return m_accepted;
-}
-
-void QQuickWebEngineContextMenuRequest::setAccepted(bool accepted)
-{
- m_accepted = accepted;
-}
-
-/*!
- \qmlproperty flags ContextMenuRequest::mediaFlags
- \readonly
- \since QtWebEngine 1.7
-
- The current media element's status and its available operations.
- \c MediaNone if the selected web page content is not a media element.
-
- \value ContextMenuRequest.MediaInError
- An error occurred.
- \value ContextMenuRequest.MediaPaused
- Media is paused.
- \value ContextMenuRequest.MediaMuted
- Media is muted.
- \value ContextMenuRequest.MediaLoop
- Media can be looped.
- \value ContextMenuRequest.MediaCanSave
- Media can be saved.
- \value ContextMenuRequest.MediaHasAudio
- Media has audio.
- \value ContextMenuRequest.MediaCanToggleControls
- Media can show controls.
- \value ContextMenuRequest.MediaControls
- Media controls are shown.
- \value ContextMenuRequest.MediaCanPrint
- Media is printable.
- \value ContextMenuRequest.MediaCanRotate
- Media is rotatable.
-*/
-QQuickWebEngineContextMenuRequest::MediaFlags QQuickWebEngineContextMenuRequest::mediaFlags() const
-{
- return static_cast<QQuickWebEngineContextMenuRequest::MediaFlags>(m_data->mediaFlags());
-}
-
-/*!
- \qmlproperty flags ContextMenuRequest::editFlags
- \readonly
- \since QtWebEngine 1.7
-
- The available edit operations in the current context or \c CanDoNone if no actions are available.
-
- \value ContextMenuRequest.CanUndo
- Undo is available.
- \value ContextMenuRequest.CanRedo
- Redo is available.
- \value ContextMenuRequest.CanCut
- Cut is available.
- \value ContextMenuRequest.CanCopy
- Copy is available.
- \value ContextMenuRequest.CanPaste
- Paste is available.
- \value ContextMenuRequest.CanDelete
- Delete is available.
- \value ContextMenuRequest.CanSelectAll
- Select All is available.
- \value ContextMenuRequest.CanTranslate
- Translate is available.
- \value ContextMenuRequest.CanEditRichly
- Context is richly editable.
-*/
-QQuickWebEngineContextMenuRequest::EditFlags QQuickWebEngineContextMenuRequest::editFlags() const
-{
- return static_cast<QQuickWebEngineContextMenuRequest::EditFlags>(m_data->editFlags());
-}
-
-QT_END_NAMESPACE
diff --git a/src/webengine/api/qquickwebenginecontextmenurequest_p.h b/src/webengine/api/qquickwebenginecontextmenurequest_p.h
deleted file mode 100644
index bc50eccb8..000000000
--- a/src/webengine/api/qquickwebenginecontextmenurequest_p.h
+++ /dev/null
@@ -1,150 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKWEBENGINECONTEXTMENUREQUEST_H
-#define QQUICKWEBENGINECONTEXTMENUREQUEST_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-
-#include <QtWebEngine/private/qtwebengineglobal_p.h>
-#include <QtCore/QScopedPointer>
-#include <QtCore/QObject>
-#include <QtCore/QUrl>
-
-namespace QtWebEngineCore {
- class WebEngineContextMenuData;
-}
-
-QT_BEGIN_NAMESPACE
-
-class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineContextMenuRequest: public QObject {
- Q_OBJECT
-public:
- enum MediaType {
- MediaTypeNone,
- MediaTypeImage,
- MediaTypeVideo,
- MediaTypeAudio,
- MediaTypeCanvas,
- MediaTypeFile,
- MediaTypePlugin
- };
- Q_ENUM(MediaType)
-
- // Must match QWebEngineCore::WebEngineContextMenuData::MediaFlags:
- enum MediaFlag {
- MediaInError = 0x1,
- MediaPaused = 0x2,
- MediaMuted = 0x4,
- MediaLoop = 0x8,
- MediaCanSave = 0x10,
- MediaHasAudio = 0x20,
- MediaCanToggleControls = 0x40,
- MediaControls = 0x80,
- MediaCanPrint = 0x100,
- MediaCanRotate = 0x200,
- };
- Q_DECLARE_FLAGS(MediaFlags, MediaFlag)
- Q_FLAG(MediaFlags)
-
- // Must match QWebEngineCore::WebEngineContextMenuData::EditFlags:
- enum EditFlag {
- CanUndo = 0x1,
- CanRedo = 0x2,
- CanCut = 0x4,
- CanCopy = 0x8,
- CanPaste = 0x10,
- CanDelete = 0x20,
- CanSelectAll = 0x40,
- CanTranslate = 0x80,
- CanEditRichly = 0x100,
- };
- Q_DECLARE_FLAGS(EditFlags, EditFlag)
- Q_FLAG(EditFlags)
-
- Q_PROPERTY(int x READ x CONSTANT FINAL)
- Q_PROPERTY(int y READ y CONSTANT FINAL)
- Q_PROPERTY(QString selectedText READ selectedText CONSTANT FINAL)
- Q_PROPERTY(QString linkText READ linkText CONSTANT FINAL)
- Q_PROPERTY(QUrl linkUrl READ linkUrl CONSTANT FINAL)
- Q_PROPERTY(QUrl mediaUrl READ mediaUrl CONSTANT FINAL)
- Q_PROPERTY(MediaType mediaType READ mediaType CONSTANT FINAL)
- Q_PROPERTY(bool isContentEditable READ isContentEditable CONSTANT FINAL)
- Q_PROPERTY(QString misspelledWord READ misspelledWord CONSTANT FINAL)
- Q_PROPERTY(QStringList spellCheckerSuggestions READ spellCheckerSuggestions CONSTANT FINAL)
- Q_PROPERTY(bool accepted READ isAccepted WRITE setAccepted FINAL)
- Q_PROPERTY(MediaFlags mediaFlags READ mediaFlags CONSTANT FINAL REVISION 1)
- Q_PROPERTY(EditFlags editFlags READ editFlags CONSTANT FINAL REVISION 1)
-
- ~QQuickWebEngineContextMenuRequest();
- int x() const;
- int y() const;
- QString selectedText() const;
- QString linkText() const;
- QUrl linkUrl() const;
- QUrl mediaUrl() const;
- MediaType mediaType() const;
- bool isContentEditable() const;
- QString misspelledWord() const;
- QStringList spellCheckerSuggestions() const;
- bool isAccepted() const;
- void setAccepted(bool accepted);
- MediaFlags mediaFlags() const;
- EditFlags editFlags() const;
-
-private:
- QQuickWebEngineContextMenuRequest(const QtWebEngineCore::WebEngineContextMenuData &data, QObject *parent = nullptr);
- QScopedPointer<QtWebEngineCore::WebEngineContextMenuData> m_data;
- bool m_accepted;
- friend class QQuickWebEngineView;
- friend class QQuickWebEngineViewPrivate;
- Q_DISABLE_COPY(QQuickWebEngineContextMenuRequest)
-};
-
-QT_END_NAMESPACE
-
-#endif // QQUICKWEBENGINECONTEXTMENUREQUEST_H
diff --git a/src/webengine/api/qquickwebenginedialogrequests.cpp b/src/webengine/api/qquickwebenginedialogrequests.cpp
deleted file mode 100644
index da1aecaf6..000000000
--- a/src/webengine/api/qquickwebenginedialogrequests.cpp
+++ /dev/null
@@ -1,936 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickwebenginedialogrequests_p.h"
-#include "authentication_dialog_controller.h"
-#include "javascript_dialog_controller.h"
-#include "color_chooser_controller.h"
-#include "file_picker_controller.h"
-#include "web_contents_adapter_client.h"
-
-#include <QCursor>
-#include <QQuickItem>
-
-QT_BEGIN_NAMESPACE
-
-using namespace QtWebEngineCore;
-
-ASSERT_ENUMS_MATCH(WebContentsAdapterClient::AlertDialog,
- QQuickWebEngineJavaScriptDialogRequest::DialogTypeAlert)
-ASSERT_ENUMS_MATCH(WebContentsAdapterClient::ConfirmDialog,
- QQuickWebEngineJavaScriptDialogRequest::DialogTypeConfirm)
-ASSERT_ENUMS_MATCH(WebContentsAdapterClient::PromptDialog,
- QQuickWebEngineJavaScriptDialogRequest::DialogTypePrompt)
-ASSERT_ENUMS_MATCH(WebContentsAdapterClient::UnloadDialog,
- QQuickWebEngineJavaScriptDialogRequest::DialogTypeBeforeUnload)
-
-ASSERT_ENUMS_MATCH(FilePickerController::Open,
- QQuickWebEngineFileDialogRequest::FileModeOpen)
-ASSERT_ENUMS_MATCH(FilePickerController::OpenMultiple,
- QQuickWebEngineFileDialogRequest::FileModeOpenMultiple)
-ASSERT_ENUMS_MATCH(FilePickerController::UploadFolder,
- QQuickWebEngineFileDialogRequest::FileModeUploadFolder)
-ASSERT_ENUMS_MATCH(FilePickerController::Save,
- QQuickWebEngineFileDialogRequest::FileModeSave)
-
-/*!
- \qmltype AuthenticationDialogRequest
- \instantiates QQuickWebEngineAuthenticationDialogRequest
- \inqmlmodule QtWebEngine
- \since QtWebEngine 1.4
-
- \brief A request for providing authentication credentials required
- by proxies or HTTP servers.
-
- An AuthenticationDialogRequest is passed as an argument of the
- WebEngineView::authenticationDialogRequested signal. It is generated
- when basic HTTP or proxy authentication is required. The type
- of authentication can be checked with the \l type property.
-
- The \l accepted property of the request indicates whether the request
- is handled by the user code or the default dialog should be displayed.
- If you set the \l accepted property to \c true, make sure to call
- either \l dialogAccept() or \l dialogReject() afterwards.
-
- The following code uses a custom dialog to handle the request:
- \code
-
- WebEngineView {
- // ...
- onAuthenticationDialogRequested: function(request) {
- request.accepted = true;
- myDialog.request = request // keep the reference to the request
- myDialog.accept.connect(request.dialogAccept);
- myDialog.reject.connect(request.dialogReject);
- myDialog.visible = true;
- }
- // ...
- }
-
- \endcode
-*/
-
-QQuickWebEngineAuthenticationDialogRequest::QQuickWebEngineAuthenticationDialogRequest(
- QSharedPointer<AuthenticationDialogController> controller,
- QObject *parent):
- QObject(parent)
- , m_controller(controller.toWeakRef())
- , m_url(controller->url())
- , m_realm(controller->realm())
- , m_type(controller->isProxy() ? AuthenticationTypeProxy
- : AuthenticationTypeHTTP)
- , m_host(controller->host())
- , m_accepted(false)
-{
-
-}
-
-QQuickWebEngineAuthenticationDialogRequest::~QQuickWebEngineAuthenticationDialogRequest()
-{
-}
-
-/*!
- \qmlproperty url AuthenticationDialogRequest::url
- \readonly
-
- The URL of the HTTP request for which authentication was requested.
- In case of proxy authentication, this is a request URL which is proxied
- via host.
-
- \sa proxyHost
-*/
-
-QUrl QQuickWebEngineAuthenticationDialogRequest::url() const
-{
- return m_url;
-}
-
-/*!
- \qmlproperty string AuthenticationDialogRequest::realm
- \readonly
-
- The HTTP authentication realm attribute value of the \c WWW-Authenticate
- header. Empty if \l type is AuthenticationTypeProxy.
-*/
-
-QString QQuickWebEngineAuthenticationDialogRequest::realm() const
-{
- return m_realm;
-}
-
-/*!
- \qmlproperty string AuthenticationDialogRequest::proxyHost
- \readonly
-
- The hostname of the authentication proxy.
- Empty if \l type is AuthenticationTypeHTTP.
-*/
-
-QString QQuickWebEngineAuthenticationDialogRequest::proxyHost() const
-{
- return m_host;
-}
-
-/*!
- \qmlproperty enumeration AuthenticationDialogRequest::type
- \readonly
-
- The type of the authentication request.
-
- \value WebEngineAuthenticationDialogRequest.AuthenticationTypeHTTP
- HTTP authentication.
- \value WebEngineAuthenticationDialogRequest.AuthenticationTypeProxy
- Proxy authentication.
-*/
-
-QQuickWebEngineAuthenticationDialogRequest::AuthenticationType
-QQuickWebEngineAuthenticationDialogRequest::type() const
-{
- return m_type;
-}
-
-/*!
- \qmlproperty bool AuthenticationDialogRequest::accepted
-
- Indicates whether the authentication dialog request has been
- accepted by the signal handler.
-
- If the property is \c false after any signal handlers
- for WebEngineView::authenticationDialogRequested have been executed,
- a default authentication dialog will be shown.
- To prevent this, set \c{request.accepted} to \c true.
-
- The default is \c false.
-*/
-
-bool QQuickWebEngineAuthenticationDialogRequest::isAccepted() const
-{
- return m_accepted;
-}
-
-void QQuickWebEngineAuthenticationDialogRequest::setAccepted(bool accepted)
-{
- m_accepted = accepted;
-}
-
-/*!
- \qmlmethod void AuthenticationDialogRequest::dialogAccept(string username, string password)
-
- This function notifies the engine that the user accepted the dialog,
- providing the \a username and the \a password required for authentication.
-*/
-
-void QQuickWebEngineAuthenticationDialogRequest::dialogAccept(const QString &user,
- const QString &password)
-{
- m_accepted = true;
- QSharedPointer<AuthenticationDialogController> controller
- = m_controller.toStrongRef();
- if (controller)
- controller->accept(user,password);
-}
-
-/*!
- \qmlmethod void AuthenticationDialogRequest::dialogReject()
-
- This function notifies the engine that the user rejected the dialog and the
- authentication shall not proceed.
-*/
-
-void QQuickWebEngineAuthenticationDialogRequest::dialogReject()
-{
- m_accepted = true;
- QSharedPointer<AuthenticationDialogController> controller
- = m_controller.toStrongRef();
- if (controller)
- controller->reject();
-}
-
-///////////////////////////////////////////////////////////////////////////////
-
-/*!
- \qmltype JavaScriptDialogRequest
- \instantiates QQuickWebEngineJavaScriptDialogRequest
- \inqmlmodule QtWebEngine
- \since QtWebEngine 1.4
-
- \brief A request for showing an alert, a confirmation, or a prompt dialog
- from within JavaScript to the user.
-
- A JavaScriptDialogRequest is passed as an argument of the
- WebEngineView::javaScriptDialogRequested signal. The request is emitted
- if JavaScript on the page calls HTML5's
- \l{https://www.w3.org/TR/html5/webappapis.html#simple-dialogs}{Simple Dialogs}
- API, or in response to HTML5's
- \l {https://www.w3.org/TR/html5/browsers.html#beforeunloadevent}{BeforeUnloadEvent}.
- The type of a particular dialog can be checked with the \l type property.
-
- The \l accepted property of the request indicates whether the request
- is handled by the user code or the default dialog should be displayed.
- If you set the \l accepted property to \c true, make sure to call either
- \l dialogAccept() or \l dialogReject() afterwards. The JavaScript call
- causing the request will be blocked until then.
-
- The following code uses a custom dialog to handle the request:
-
- \code
- WebEngineView {
- // ...
- onJavaScriptDialogRequested: function(request) {
- request.accepted = true;
- myDialog.request = request // keep the reference to the request
- myDialog.accept.connect(request.dialogAccept);
- myDialog.reject.connect(request.dialogReject);
- myDialog.visible = true;
- }
- // ...
- }
- \endcode
-*/
-
-QQuickWebEngineJavaScriptDialogRequest::QQuickWebEngineJavaScriptDialogRequest(
- QSharedPointer<JavaScriptDialogController> controller, QObject *parent):
- QObject(parent)
- , m_controller(controller.toWeakRef())
- , m_message(controller->message())
- , m_defaultPrompt(controller->defaultPrompt())
- , m_title(controller->title())
- , m_type(static_cast<QQuickWebEngineJavaScriptDialogRequest::DialogType>(controller->type()))
- , m_securityOrigin(controller->securityOrigin())
- , m_accepted(false)
-{
-}
-
-QQuickWebEngineJavaScriptDialogRequest::~QQuickWebEngineJavaScriptDialogRequest()
-{
-
-}
-
-/*!
- \qmlproperty string JavaScriptDialogRequest::message
- \readonly
-
- The message to be shown to the user.
-*/
-
-QString QQuickWebEngineJavaScriptDialogRequest::message() const
-{
- return m_message;
-}
-
-/*!
- \qmlproperty string JavaScriptDialogRequest::defaultText
- \readonly
-
- The default prompt text, if the requested dialog is a prompt.
-*/
-
-
-QString QQuickWebEngineJavaScriptDialogRequest::defaultText() const
-{
- return m_defaultPrompt;
-}
-
-/*!
- \qmlproperty string JavaScriptDialogRequest::title
- \readonly
-
- A default title for the dialog.
-*/
-
-QString QQuickWebEngineJavaScriptDialogRequest::title() const
-{
- return m_title;
-}
-
-/*!
- \qmlproperty enumeration JavaScriptDialogRequest::type
- \readonly
-
- Returns the type of the requested dialog box. For more information, see
- HTML5's
- \l{https://www.w3.org/TR/html5/webappapis.html#simple-dialogs}{Simple Dialogs}.
-
- \value JavaScriptDialogRequest.DialogTypeAlert
- A JavaScript alert dialog.
- \value JavaScriptDialogRequest.DialogTypeConfirm
- A JavaScript confirmation dialog.
- \value JavaScriptDialogRequest.DialogTypePrompt
- A JavaScript prompt dialog.
- \value JavaScriptDialogRequest.DialogTypeBeforeUnload
- The users should be asked if they want to leave the page.
-*/
-
-QQuickWebEngineJavaScriptDialogRequest::DialogType QQuickWebEngineJavaScriptDialogRequest::type() const
-{
- return m_type;
-}
-
-/*!
- \qmlproperty url JavaScriptDialogRequest::securityOrigin
- \readonly
-
- The URL of the security origin.
-*/
-
-QUrl QQuickWebEngineJavaScriptDialogRequest::securityOrigin() const
-{
- return m_securityOrigin;
-}
-
-/*!
- \qmlproperty bool JavaScriptDialogRequest::accepted
-
- Indicates whether the JavaScript dialog request has been
- accepted by the signal handler.
-
- If the property is \c false after any signal handlers
- for WebEngineView::javaScriptDialogRequested have been executed,
- a default dialog will be shown.
- To prevent this, set \c{request.accepted} to \c true.
-
- The default is \c false.
-*/
-
-bool QQuickWebEngineJavaScriptDialogRequest::isAccepted() const
-{
- return m_accepted;
-}
-
-void QQuickWebEngineJavaScriptDialogRequest::setAccepted(bool accepted)
-{
- m_accepted = accepted;
-}
-
-/*!
- \qmlmethod void JavaScriptDialogRequest::dialogAccept()
-
- This function notifies the engine that the user accepted the dialog.
-*/
-
-/*!
- \qmlmethod void JavaScriptDialogRequest::dialogAccept(string text)
-
- This function notifies the engine that the user accepted the dialog,
- providing the \a text in case of a prompt message box.
-*/
-
-void QQuickWebEngineJavaScriptDialogRequest::dialogAccept(const QString& text)
-{
- m_accepted = true;
- QSharedPointer<JavaScriptDialogController> controller
- = m_controller.toStrongRef();
- if (controller) {
- controller->textProvided(text);
- controller->accept();
- }
-}
-
-/*!
- \qmlmethod void JavaScriptDialogRequest::dialogReject()
-
- This function notifies the engine that the user rejected the dialog.
-*/
-
-void QQuickWebEngineJavaScriptDialogRequest::dialogReject()
-{
- m_accepted = true;
- QSharedPointer<JavaScriptDialogController> controller
- = m_controller.toStrongRef();
- if (controller)
- controller->reject();
-}
-
-///////////////////////////////////////////////////////////////////////////////
-
-/*!
- \qmltype ColorDialogRequest
- \instantiates QQuickWebEngineColorDialogRequest
- \inqmlmodule QtWebEngine
- \since QtWebEngine 1.4
-
- \brief A request for selecting a color by the user.
-
- A ColorDialogRequest is passed as an argument of the
- WebEngineView::colorDialogRequested signal. It is generated when
- a color picker dialog is requested. See
- \l { https://www.w3.org/TR/html5/forms.html#color-state-(type=color)}
- {HTML5 Color State}.
-
- The \l accepted property of the request indicates whether the request
- is handled by the user code or the default dialog should be displayed.
- If you set the \l accepted property to \c true, make sure to call either
- \l dialogAccept() or \l dialogReject() afterwards.
-
- The following code uses a custom dialog to handle the request:
-
- \code
- WebEngineView {
- // ...
- onColorDialogRequested: function(request) {
- request.accepted = true;
- myDialog.request = request // keep the reference to the request
- myDialog.accept.connect(request.dialogAccept);
- myDialog.reject.connect(request.dialogReject);
- myDialog.visible = true;
- }
- // ...
- }
- \endcode
-*/
-
-QQuickWebEngineColorDialogRequest::QQuickWebEngineColorDialogRequest(
- QSharedPointer<ColorChooserController> controller, QObject *parent):
- QObject(parent)
- , m_controller(controller.toWeakRef())
- , m_color(controller->initialColor())
- , m_accepted(false)
-{
-
-}
-
-QQuickWebEngineColorDialogRequest::~QQuickWebEngineColorDialogRequest()
-{
-
-}
-
-/*!
- \qmlproperty color ColorDialogRequest::color
- \readonly
-
- The default color to be selected in the dialog.
-*/
-
-QColor QQuickWebEngineColorDialogRequest::color() const
-{
- return m_color;
-}
-
-/*!
- \qmlproperty bool ColorDialogRequest::accepted
-
- Indicates whether the color picker dialog request has been
- accepted by the signal handler.
-
- If the property is \c false after any signal handlers
- for WebEngineView::colorDialogRequested have been executed,
- a default color picker dialog will be shown.
- To prevent this, set \c{request.accepted} to \c true.
-
- The default is \c false.
-*/
-
-bool QQuickWebEngineColorDialogRequest::isAccepted() const
-{
- return m_accepted;
-}
-
-void QQuickWebEngineColorDialogRequest::setAccepted(bool accepted)
-{
- m_accepted = accepted;
-}
-
-
-/*!
- \qmlmethod void ColorDialogRequest::dialogAccept(color color)
-
- This function notifies the engine that the user accepted the dialog,
- providing the \a color.
-*/
-
-void QQuickWebEngineColorDialogRequest::dialogAccept(const QColor &color)
-{
- m_accepted = true;
- QSharedPointer<ColorChooserController> controller = m_controller.toStrongRef();
- if (controller)
- controller->accept(color);
-}
-
-/*!
- \qmlmethod void ColorDialogRequest::dialogReject()
-
- This function notifies the engine that the user rejected the dialog.
-*/
-
-void QQuickWebEngineColorDialogRequest::dialogReject()
-{
- m_accepted = true;
- QSharedPointer<ColorChooserController> controller = m_controller.toStrongRef();
- if (controller)
- controller->reject();
-}
-
-///////////////////////////////////////////////////////////////////////////////
-
-/*!
- \qmltype FileDialogRequest
- \instantiates QQuickWebEngineFileDialogRequest
- \inqmlmodule QtWebEngine
- \since QtWebEngine 1.4
-
- \brief A request for letting the user choose a (new or existing) file or
- directory.
-
- A FileDialogRequest is passed as an argument of the
- WebEngineView::fileDialogRequested signal. It is generated
- when the file dialog is requested by the input element.
- See \l {https://www.w3.org/TR/html5/forms.html#file-upload-state-(type=file)}{File Upload state}.
-
- The \l accepted property of the request indicates whether the request
- is handled by the user code or the default dialog should be displayed.
- If you set the \l accepted property to \c true, make sure to call either
- \l dialogAccept() or \l dialogReject() afterwards.
-
- The following code uses a custom dialog to handle the request:
-
- \code
- WebEngineView {
- // ...
- onFileDialogRequested: function(request) {
- request.accepted = true;
- myDialog.request = request // keep the reference to the request
- myDialog.accept.connect(request.dialogAccept);
- myDialog.reject.connect(request.dialogReject);
- myDialog.visible = true;
- }
- // ...
- }
- \endcode
-*/
-
-QQuickWebEngineFileDialogRequest::QQuickWebEngineFileDialogRequest(
- QSharedPointer<FilePickerController> controller, QObject *parent):
- QObject(parent)
- , m_controller(controller.toWeakRef())
- , m_filename(controller->defaultFileName())
- , m_acceptedMimeTypes(controller->acceptedMimeTypes())
- , m_mode(static_cast<QQuickWebEngineFileDialogRequest::FileMode>(controller->mode()))
- , m_accepted(false)
-{
-
-}
-
-QQuickWebEngineFileDialogRequest::~QQuickWebEngineFileDialogRequest()
-{
-
-}
-
-/*!
- \qmlproperty stringlist FileDialogRequest::acceptedMimeTypes
- \readonly
-
- A list of MIME types specified in the input element. The selection
- should be restricted to only these types of files.
-*/
-
-QStringList QQuickWebEngineFileDialogRequest::acceptedMimeTypes() const
-{
- return m_acceptedMimeTypes;
-}
-
-/*!
- \qmlproperty string FileDialogRequest::defaultFileName
- \readonly
-
- The default name of the file to be selected in the dialog.
-*/
-
-QString QQuickWebEngineFileDialogRequest::defaultFileName() const
-{
- return m_filename;
-}
-
-/*!
- \qmlproperty enumeration FileDialogRequest::mode
- \readonly
-
- The mode of the file dialog.
-
- \value FileDialogRequest.FileModeOpen
- Allows users to specify a single existing file.
- \value FileDialogRequest.FileModeOpenMultiple
- Allows users to specify multiple existing files.
- \value FileDialogRequest.FileModeUploadFolder
- Allows users to specify a single existing folder for upload.
- \value FileDialogRequest.FileModeSave
- Allows users to specify a non-existing file. If an existing file
- is selected, the users should be informed that the file is going
- to be overwritten.
-*/
-
-QQuickWebEngineFileDialogRequest::FileMode QQuickWebEngineFileDialogRequest::mode() const
-{
- return m_mode;
-}
-
-/*!
- \qmlproperty bool FileDialogRequest::accepted
-
- Indicates whether the file picker dialog request has been
- handled by the signal handler.
-
- If the property is \c false after any signal handlers
- for WebEngineView::fileDialogRequested have been executed,
- a default file picker dialog will be shown.
- To prevent this, set \c{request.accepted} to \c true.
-
- The default is \c false.
-*/
-
-bool QQuickWebEngineFileDialogRequest::isAccepted() const
-{
- return m_accepted;
-}
-
-void QQuickWebEngineFileDialogRequest::setAccepted(bool accepted)
-{
- m_accepted = accepted;
-}
-
-/*!
- \qmlmethod void FileDialogRequest::dialogAccept(stringlist files)
-
- This function needs to be called when the user accepted the dialog with
- \a files.
-*/
-
-void QQuickWebEngineFileDialogRequest::dialogAccept(const QStringList &files)
-{
- m_accepted = true;
- QSharedPointer<FilePickerController> controller = m_controller.toStrongRef();
- if (controller)
- controller->accepted(files);
-}
-
-/*!
- \qmlmethod void FileDialogRequest::dialogReject()
-
- This function needs to be called when the user did not accepted the dialog.
-*/
-
-void QQuickWebEngineFileDialogRequest::dialogReject()
-{
- m_accepted = true;
- QSharedPointer<FilePickerController> controller = m_controller.toStrongRef();
- if (controller)
- controller->rejected();
-}
-
-///////////////////////////////////////////////////////////////////////////////
-
-/*!
- \qmltype FormValidationMessageRequest
- \instantiates QQuickWebEngineFormValidationMessageRequest
- \inqmlmodule QtWebEngine
- \since QtWebEngine 1.4
- \obsolete
-
- \brief A request for showing a HTML5 form validation message to the user.
-
- No longer used since 5.11, as Blink now renders Validation messages internally.
-*/
-
-QQuickWebEngineFormValidationMessageRequest::QQuickWebEngineFormValidationMessageRequest(
- QQuickWebEngineFormValidationMessageRequest::RequestType type, const QRect& anchor,
- const QString &mainText, const QString &subText, QObject *parent):
- QObject(parent)
- , m_anchor(anchor)
- , m_mainText(mainText)
- , m_subText(subText)
- , m_type(type)
- , m_accepted(false)
-{
-
-}
-
-QQuickWebEngineFormValidationMessageRequest::~QQuickWebEngineFormValidationMessageRequest()
-{
-
-}
-
-/*!
- \qmlproperty rectangle FormValidationMessageRequest::anchor
- \readonly
-
- An anchor of an element in the viewport for which the form
- validation message should be displayed.
-*/
-
-QRect QQuickWebEngineFormValidationMessageRequest::anchor() const
-{
- return m_anchor;
-}
-
-/*!
- \qmlproperty bool FormValidationMessageRequest::text
- \readonly
-
- The text of the form validation message.
-*/
-
-
-QString QQuickWebEngineFormValidationMessageRequest::text() const
-{
- return m_mainText;
-}
-
-/*!
- \qmlproperty bool FormValidationMessageRequest::subText
- \readonly
-
- The subtext of the form validation message.
-*/
-
-
-QString QQuickWebEngineFormValidationMessageRequest::subText() const
-{
- return m_subText;
-}
-
-/*!
- \qmlproperty enumeration FormValidationMessageRequest::type
- \readonly
-
- The type of the form validation message request.
-
- \value ValidationMessageRequest.Show
- The form validation message should be shown.
- \value ValidationMessageRequest.Hide
- The form validation message should be hidden.
- \value ValidationMessageRequest.Move
- The form validation message should be moved.
-*/
-
-QQuickWebEngineFormValidationMessageRequest::RequestType QQuickWebEngineFormValidationMessageRequest::type() const
-{
- return m_type;
-}
-
-/*!
- \qmlproperty bool FormValidationMessageRequest::accepted
-
- Indicates whether the form validation request has been
- accepted by the signal handler.
-
- If the property is \c false after any signal handlers
- for WebEngineView::validationMessageRequested have been executed,
- a default file validation message will be shown.
- To prevent this, set \c {request.accepted} to \c true.
-
- The default is \c false.
-*/
-
-bool QQuickWebEngineFormValidationMessageRequest::isAccepted() const
-{
- return m_accepted;
-}
-
-void QQuickWebEngineFormValidationMessageRequest::setAccepted(bool accepted)
-{
- m_accepted = accepted;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-
-/*!
- \qmltype TooltipRequest
- \instantiates QQuickWebEngineTooltipRequest
- \inqmlmodule QtWebEngine
- \since QtWebEngine 1.10
-
- \brief A request for showing a tooltip to the user.
-*/
-
-QQuickWebEngineTooltipRequest::QQuickWebEngineTooltipRequest(
- const QString &text, QObject *parent):
- QObject(parent)
- , m_text(text)
- , m_type(text.isEmpty() ? RequestType::Hide : RequestType::Show)
- , m_accepted(false)
-{
- Q_ASSERT(parent);
- if (QQuickItem *view = qobject_cast<QQuickItem *>(parent))
- m_position = view->mapFromGlobal(view->cursor().pos()).toPoint();
-}
-
-QQuickWebEngineTooltipRequest::~QQuickWebEngineTooltipRequest()
-{
-
-}
-
-/*!
- \qmlproperty int TooltipRequest::x
- \readonly
-
- The x coordinate of the top-left corner of the requested tooltip.
-*/
-
-int QQuickWebEngineTooltipRequest::x() const
-{
- return m_position.x();
-}
-
-/*!
- \qmlproperty int TooltipRequest::y
- \readonly
-
- The y coordinate of the top-left corner of the requested tooltip.
-*/
-
-int QQuickWebEngineTooltipRequest::y() const
-{
- return m_position.y();
-}
-
-/*!
- \qmlproperty bool TooltipRequest::text
- \readonly
-
- The text of the tooltip. It contains an empty string when the
- tooltip should be hidden.
-*/
-
-
-QString QQuickWebEngineTooltipRequest::text() const
-{
- return m_text;
-}
-
-/*!
- \qmlproperty enumeration TooltipRequest::type
- \readonly
-
- The type of the tooltip request.
-
- \value TooltipRequest.Show
- The tooltip should be shown.
- \value TooltipRequest.Hide
- The tooltip should be hidden.
-*/
-
-QQuickWebEngineTooltipRequest::RequestType QQuickWebEngineTooltipRequest::type() const
-{
- return m_type;
-}
-
-/*!
- \qmlproperty bool TooltipRequest::accepted
-
- Indicates whether the tooltip request has been accepted
- by the signal handler.
-
- If the property is \c false after any signal handlers
- for WebEngineView::tooltipRequested have been executed,
- a default tooltip will be shown.
- To prevent this, set \c {request.accepted} to \c true.
-
- The default is \c false.
-*/
-
-bool QQuickWebEngineTooltipRequest::isAccepted() const
-{
- return m_accepted;
-}
-
-void QQuickWebEngineTooltipRequest::setAccepted(bool accepted)
-{
- m_accepted = accepted;
-}
-
-QT_END_NAMESPACE
diff --git a/src/webengine/api/qquickwebenginedialogrequests_p.h b/src/webengine/api/qquickwebenginedialogrequests_p.h
deleted file mode 100644
index 5e3f7c547..000000000
--- a/src/webengine/api/qquickwebenginedialogrequests_p.h
+++ /dev/null
@@ -1,298 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKWEBENGINDIALOGREQUESTS_H
-#define QQUICKWEBENGINDIALOGREQUESTS_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtWebEngine/private/qtwebengineglobal_p.h>
-#include <QtCore/QUrl>
-#include <QtCore/QWeakPointer>
-#include <QtCore/QRect>
-#include <QtGui/QColor>
-
-namespace QtWebEngineCore {
- class AuthenticationDialogController;
- class ColorChooserController;
- class FilePickerController;
- class JavaScriptDialogController;
-}
-
-QT_BEGIN_NAMESPACE
-
-class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineAuthenticationDialogRequest : public QObject {
- Q_OBJECT
-public:
-
- enum AuthenticationType {
- AuthenticationTypeHTTP,
- AuthenticationTypeProxy
- };
-
- Q_ENUM(AuthenticationType)
-
- Q_PROPERTY(QUrl url READ url CONSTANT FINAL)
- Q_PROPERTY(QString realm READ realm CONSTANT FINAL)
- Q_PROPERTY(QString proxyHost READ proxyHost CONSTANT FINAL)
- Q_PROPERTY(AuthenticationType type READ type CONSTANT FINAL)
- Q_PROPERTY(bool accepted READ isAccepted WRITE setAccepted FINAL)
-
- ~QQuickWebEngineAuthenticationDialogRequest();
-
- QUrl url() const;
- QString realm() const;
- QString proxyHost() const;
- AuthenticationType type() const;
- bool isAccepted() const;
- void setAccepted(bool accepted);
-
-public slots:
- void dialogAccept(const QString &user, const QString &password);
- void dialogReject();
-
-private:
- QQuickWebEngineAuthenticationDialogRequest(QSharedPointer<QtWebEngineCore::AuthenticationDialogController> controller,
- QObject *parent = nullptr);
- QWeakPointer<QtWebEngineCore::AuthenticationDialogController> m_controller;
- QUrl m_url;
- QString m_realm;
- AuthenticationType m_type;
- QString m_host;
- bool m_accepted;
- friend class QQuickWebEngineViewPrivate;
- Q_DISABLE_COPY(QQuickWebEngineAuthenticationDialogRequest)
-};
-
-class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineJavaScriptDialogRequest : public QObject {
- Q_OBJECT
-public:
-
- enum DialogType {
- DialogTypeAlert,
- DialogTypeConfirm,
- DialogTypePrompt,
- DialogTypeBeforeUnload,
- };
- Q_ENUM(DialogType)
-
- Q_PROPERTY(QString message READ message CONSTANT FINAL)
- Q_PROPERTY(QString defaultText READ defaultText CONSTANT FINAL)
- Q_PROPERTY(QString title READ title CONSTANT FINAL)
- Q_PROPERTY(DialogType type READ type CONSTANT FINAL)
- Q_PROPERTY(QUrl securityOrigin READ securityOrigin CONSTANT FINAL)
- Q_PROPERTY(bool accepted READ isAccepted WRITE setAccepted FINAL)
-
- ~QQuickWebEngineJavaScriptDialogRequest();
-
- QString message() const;
- QString defaultText() const;
- QString title() const;
- DialogType type() const;
- QUrl securityOrigin() const;
- bool isAccepted() const;
- void setAccepted(bool accepted);
-
-public slots:
- void dialogAccept(const QString& text = QString());
- void dialogReject();
-
-private:
- QQuickWebEngineJavaScriptDialogRequest(QSharedPointer<QtWebEngineCore::JavaScriptDialogController> controller,
- QObject *parent = nullptr);
- QWeakPointer<QtWebEngineCore::JavaScriptDialogController> m_controller;
- QString m_message;
- QString m_defaultPrompt;
- QString m_title;
- DialogType m_type;
- QUrl m_securityOrigin;
- bool m_accepted;
- friend class QQuickWebEngineViewPrivate;
- Q_DISABLE_COPY(QQuickWebEngineJavaScriptDialogRequest)
-};
-
-class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineColorDialogRequest : public QObject {
- Q_OBJECT
-public:
-
- Q_PROPERTY(QColor color READ color CONSTANT FINAL)
- Q_PROPERTY(bool accepted READ isAccepted WRITE setAccepted FINAL)
-
- ~QQuickWebEngineColorDialogRequest();
-
- QColor color() const;
- bool isAccepted() const;
- void setAccepted(bool accepted);
-
-public slots:
- void dialogAccept(const QColor &color);
- void dialogReject();
-
-private:
- QQuickWebEngineColorDialogRequest(QSharedPointer<QtWebEngineCore::ColorChooserController> controller,
- QObject *parent = nullptr);
- QWeakPointer<QtWebEngineCore::ColorChooserController> m_controller;
- QColor m_color;
- bool m_accepted;
- friend class QQuickWebEngineViewPrivate;
- Q_DISABLE_COPY(QQuickWebEngineColorDialogRequest)
-};
-
-class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineFileDialogRequest : public QObject {
- Q_OBJECT
-public:
-
- enum FileMode {
- FileModeOpen,
- FileModeOpenMultiple,
- FileModeUploadFolder,
- FileModeSave
- };
- Q_ENUM(FileMode)
-
- Q_PROPERTY(QString defaultFileName READ defaultFileName CONSTANT FINAL)
- Q_PROPERTY(QStringList acceptedMimeTypes READ acceptedMimeTypes CONSTANT FINAL)
- Q_PROPERTY(FileMode mode READ mode CONSTANT FINAL)
- Q_PROPERTY(bool accepted READ isAccepted WRITE setAccepted FINAL)
-
- ~QQuickWebEngineFileDialogRequest();
-
- QStringList acceptedMimeTypes() const;
- QString defaultFileName() const;
- FileMode mode() const;
- bool isAccepted() const;
- void setAccepted(bool accepted);
-
-public slots:
- void dialogAccept(const QStringList &files);
- void dialogReject();
-
-private:
- QQuickWebEngineFileDialogRequest(QSharedPointer<QtWebEngineCore::FilePickerController> controller,
- QObject *parent = nullptr);
- QWeakPointer<QtWebEngineCore::FilePickerController> m_controller;
- QString m_filename;
- QStringList m_acceptedMimeTypes;
- FileMode m_mode;
- bool m_accepted;
- friend class QQuickWebEngineViewPrivate;
- Q_DISABLE_COPY(QQuickWebEngineFileDialogRequest)
-};
-
-class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineFormValidationMessageRequest : public QObject {
- Q_OBJECT
-public:
- enum RequestType {
- Show,
- Hide,
- Move,
- };
- Q_ENUM(RequestType)
- Q_PROPERTY(QRect anchor READ anchor CONSTANT FINAL)
- Q_PROPERTY(QString text READ text CONSTANT FINAL)
- Q_PROPERTY(QString subText READ subText CONSTANT FINAL)
- Q_PROPERTY(RequestType type READ type CONSTANT FINAL)
- Q_PROPERTY(bool accepted READ isAccepted WRITE setAccepted FINAL)
-
- ~QQuickWebEngineFormValidationMessageRequest();
- QRect anchor() const;
- QString text() const;
- QString subText() const;
- RequestType type() const;
- bool isAccepted() const;
- void setAccepted(bool accepted);
-
-private:
- QQuickWebEngineFormValidationMessageRequest(RequestType type, const QRect &anchor = QRect(),
- const QString &mainText = QString(),
- const QString &subText = QString(),
- QObject *parent = nullptr);
- QRect m_anchor;
- QString m_mainText;
- QString m_subText;
- RequestType m_type;
- bool m_accepted;
- friend class QQuickWebEngineViewPrivate;
-};
-
-class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineTooltipRequest : public QObject {
- Q_OBJECT
-public:
- enum RequestType {
- Show,
- Hide,
- };
- Q_ENUM(RequestType)
- Q_PROPERTY(int x READ x CONSTANT FINAL)
- Q_PROPERTY(int y READ y CONSTANT FINAL)
- Q_PROPERTY(QString text READ text CONSTANT FINAL)
- Q_PROPERTY(RequestType type READ type CONSTANT FINAL)
- Q_PROPERTY(bool accepted READ isAccepted WRITE setAccepted FINAL)
-
- ~QQuickWebEngineTooltipRequest();
- int x() const;
- int y() const;
- QString text() const;
- RequestType type() const;
- bool isAccepted() const;
- void setAccepted(bool accepted);
-
-private:
- QQuickWebEngineTooltipRequest(const QString &text = QString(),
- QObject *parent = nullptr);
- QPoint m_position;
- QString m_text;
- RequestType m_type;
- bool m_accepted;
- friend class QQuickWebEngineViewPrivate;
- Q_DISABLE_COPY(QQuickWebEngineTooltipRequest)
-};
-
-QT_END_NAMESPACE
-
-#endif // QQUICKWEBENGINDIALOGREQUESTS_H
diff --git a/src/webengine/api/qquickwebenginedownloaditem.cpp b/src/webengine/api/qquickwebenginedownloaditem.cpp
deleted file mode 100644
index 767ada58f..000000000
--- a/src/webengine/api/qquickwebenginedownloaditem.cpp
+++ /dev/null
@@ -1,789 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickwebenginedownloaditem_p.h"
-#include "qquickwebenginedownloaditem_p_p.h"
-
-#include "profile_adapter.h"
-#include "qquickwebengineprofile_p.h"
-
-#include <QDir>
-#include "QFileInfo"
-
-using QtWebEngineCore::ProfileAdapterClient;
-
-QT_BEGIN_NAMESPACE
-
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::NoReason, QQuickWebEngineDownloadItem::NoReason)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::FileFailed, QQuickWebEngineDownloadItem::FileFailed)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::FileAccessDenied, QQuickWebEngineDownloadItem::FileAccessDenied)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::FileNoSpace, QQuickWebEngineDownloadItem::FileNoSpace)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::FileNameTooLong, QQuickWebEngineDownloadItem::FileNameTooLong)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::FileTooLarge, QQuickWebEngineDownloadItem::FileTooLarge)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::FileVirusInfected, QQuickWebEngineDownloadItem::FileVirusInfected)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::FileTransientError, QQuickWebEngineDownloadItem::FileTransientError)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::FileBlocked, QQuickWebEngineDownloadItem::FileBlocked)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::FileSecurityCheckFailed, QQuickWebEngineDownloadItem::FileSecurityCheckFailed)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::FileTooShort, QQuickWebEngineDownloadItem::FileTooShort)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::FileHashMismatch, QQuickWebEngineDownloadItem::FileHashMismatch)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::NetworkFailed, QQuickWebEngineDownloadItem::NetworkFailed)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::NetworkTimeout, QQuickWebEngineDownloadItem::NetworkTimeout)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::NetworkDisconnected, QQuickWebEngineDownloadItem::NetworkDisconnected)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::NetworkServerDown, QQuickWebEngineDownloadItem::NetworkServerDown)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::NetworkInvalidRequest, QQuickWebEngineDownloadItem::NetworkInvalidRequest)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::ServerFailed, QQuickWebEngineDownloadItem::ServerFailed)
-//ASSERT_ENUMS_MATCH(ProfileAdapterClient::ServerNoRange, QQuickWebEngineDownloadItem::ServerNoRange)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::ServerBadContent, QQuickWebEngineDownloadItem::ServerBadContent)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::ServerUnauthorized, QQuickWebEngineDownloadItem::ServerUnauthorized)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::ServerCertProblem, QQuickWebEngineDownloadItem::ServerCertProblem)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::ServerForbidden, QQuickWebEngineDownloadItem::ServerForbidden)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::ServerUnreachable, QQuickWebEngineDownloadItem::ServerUnreachable)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::UserCanceled, QQuickWebEngineDownloadItem::UserCanceled)
-//ASSERT_ENUMS_MATCH(ProfileAdapterClient::UserShutdown, QQuickWebEngineDownloadItem::UserShutdown)
-//ASSERT_ENUMS_MATCH(ProfileAdapterClient::Crash, QQuickWebEngineDownloadItem::Crash)
-
-static inline QQuickWebEngineDownloadItem::DownloadState toDownloadState(int state) {
- switch (state) {
- case ProfileAdapterClient::DownloadInProgress:
- return QQuickWebEngineDownloadItem::DownloadInProgress;
- case ProfileAdapterClient::DownloadCompleted:
- return QQuickWebEngineDownloadItem::DownloadCompleted;
- case ProfileAdapterClient::DownloadCancelled:
- return QQuickWebEngineDownloadItem::DownloadCancelled;
- case ProfileAdapterClient::DownloadInterrupted:
- return QQuickWebEngineDownloadItem::DownloadInterrupted;
- default:
- Q_UNREACHABLE();
- return QQuickWebEngineDownloadItem::DownloadCancelled;
- }
-}
-
-static inline QQuickWebEngineDownloadItem::DownloadInterruptReason toDownloadInterruptReason(int reason)
-{
- return static_cast<QQuickWebEngineDownloadItem::DownloadInterruptReason>(reason);
-}
-
-QQuickWebEngineDownloadItemPrivate::QQuickWebEngineDownloadItemPrivate(QQuickWebEngineProfile *p, const QUrl &url)
- : profile(p)
- , downloadId(-1)
- , downloadState(QQuickWebEngineDownloadItem::DownloadCancelled)
- , savePageFormat(QQuickWebEngineDownloadItem::UnknownSaveFormat)
- , type(QQuickWebEngineDownloadItem::Attachment)
- , interruptReason(QQuickWebEngineDownloadItem::NoReason)
- , totalBytes(-1)
- , receivedBytes(0)
- , downloadFinished(false)
- , downloadPaused(false)
- , view(nullptr)
- , downloadUrl(url)
- , isCustomFileName(false)
-{
-}
-
-QQuickWebEngineDownloadItemPrivate::~QQuickWebEngineDownloadItemPrivate()
-{
- if (profile)
- profile->d_ptr->downloadDestroyed(downloadId);
-}
-
-/*!
- \qmltype WebEngineDownloadItem
- \instantiates QQuickWebEngineDownloadItem
- \inqmlmodule QtWebEngine
- \since QtWebEngine 1.1
- \brief Provides information about a download.
-
- WebEngineDownloadItem models a download throughout its life cycle, starting
- with a pending download request and finishing with a completed download. It
- can be used, for example, to get information about new downloads, to monitor
- progress, and to pause, resume, and cancel downloads.
-
- Downloads are usually triggered by user interaction on a web page. It is the
- WebEngineProfile's responsibility to notify the application of new download
- requests, which it does by emitting the
- \l{WebEngineProfile::downloadRequested}{downloadRequested} signal together
- with a newly created WebEngineDownloadItem. The application can then examine
- this item and decide whether to accept it or not. A signal handler must
- explicitly call accept() on the item for \QWE to actually start
- downloading and writing data to disk. If no signal handler calls accept(),
- then the download request will be automatically rejected and nothing will be
- written to disk.
-
- \note Some properties, like the \l path under which the file will be saved,
- can only be changed before calling accept().
-
- \section2 Object Life Cycle
-
- All items are guaranteed to be valid during the emission of the
- \l{WebEngineProfile::downloadRequested}{downloadRequested} signal. If
- accept() is \e not called by any signal handler, then the item will be
- deleted \e immediately after signal emission. This means that the
- application \b{must not} keep references to rejected download items.
-
- \section2 Web Page Downloads
-
- In addition to normal file downloads, which consist simply of retrieving
- some raw bytes from the network and writing them to disk, \QWE also
- supports saving complete web pages, which involves parsing the page's HTML,
- downloading any dependent resources, and potentially packaging everything
- into a special file format (\l savePageFormat). To check if a download is
- for a file or a web page, use \l isSavePageDownload.
-
- \sa WebEngineProfile, WebEngineProfile::downloadRequested,
- WebEngineProfile::downloadFinished
-*/
-
-void QQuickWebEngineDownloadItemPrivate::update(const ProfileAdapterClient::DownloadItemInfo &info)
-{
- Q_Q(QQuickWebEngineDownloadItem);
-
- updateState(toDownloadState(info.state));
-
- if (toDownloadInterruptReason(info.downloadInterruptReason) != interruptReason) {
- interruptReason = toDownloadInterruptReason(info.downloadInterruptReason);
- Q_EMIT q->interruptReasonChanged();
- }
-
- if (info.receivedBytes != receivedBytes) {
- receivedBytes = info.receivedBytes;
- Q_EMIT q->receivedBytesChanged();
- }
-
- if (info.totalBytes != totalBytes) {
- totalBytes = info.totalBytes;
- Q_EMIT q->totalBytesChanged();
- }
-
- if (info.done)
- setFinished();
-
- if (info.paused != downloadPaused) {
- downloadPaused = info.paused;
- Q_EMIT q->isPausedChanged();
- }
-}
-
-void QQuickWebEngineDownloadItemPrivate::updateState(QQuickWebEngineDownloadItem::DownloadState newState)
-{
- Q_Q(QQuickWebEngineDownloadItem);
-
- if (downloadState != newState) {
- downloadState = newState;
- Q_EMIT q->stateChanged();
- }
-}
-
-void QQuickWebEngineDownloadItemPrivate::setFinished()
-{
- Q_Q(QQuickWebEngineDownloadItem);
-
- if (downloadFinished)
- return;
-
- downloadFinished = true;
- Q_EMIT q->isFinishedChanged();
-}
-
-/*!
- \qmlmethod void WebEngineDownloadItem::accept()
-
- Accepts the download request, which will start the download.
-
- If the item is in the \c DownloadRequested state, then it will transition
- into the \c DownloadInProgress state and the downloading will begin. If the
- item is in any other state, then nothing will happen.
-
- \sa state
-*/
-
-void QQuickWebEngineDownloadItem::accept()
-{
- Q_D(QQuickWebEngineDownloadItem);
-
- if (d->downloadState != QQuickWebEngineDownloadItem::DownloadRequested)
- return;
-
- d->updateState(QQuickWebEngineDownloadItem::DownloadInProgress);
-}
-
-/*!
- \qmlmethod void WebEngineDownloadItem::cancel()
-
- Cancels the download.
-
- If the item is in the \c DownloadInProgress state, then it will transition
- into the \c DownloadCancelled state, the downloading will stop, and
- partially downloaded files will be deleted from disk.
-
- If the item is in the \c DownloadCompleted state, then nothing will happen.
- If the item is in any other state, then it will transition into the \c
- DownloadCancelled state without further effect.
-
- \sa state
-*/
-
-void QQuickWebEngineDownloadItem::cancel()
-{
- Q_D(QQuickWebEngineDownloadItem);
-
- QQuickWebEngineDownloadItem::DownloadState state = d->downloadState;
-
- if (state == QQuickWebEngineDownloadItem::DownloadCompleted
- || state == QQuickWebEngineDownloadItem::DownloadCancelled)
- return;
-
- d->updateState(QQuickWebEngineDownloadItem::DownloadCancelled);
- d->setFinished();
-
- // We directly cancel the download if the user cancels before
- // it even started, so no need to notify the profile here.
- if (state == QQuickWebEngineDownloadItem::DownloadInProgress) {
- if (d->profile)
- d->profile->d_ptr->cancelDownload(d->downloadId);
- }
-}
-
-
-/*!
- \qmlmethod void WebEngineDownloadItem::pause()
- \since QtWebEngine 1.6
-
- Pauses the download.
-
- Has no effect if the state is not \c DownloadInProgress. Does not change the
- state.
-
- \sa resume, isPaused
-*/
-
-void QQuickWebEngineDownloadItem::pause()
-{
- Q_D(QQuickWebEngineDownloadItem);
-
- QQuickWebEngineDownloadItem::DownloadState state = d->downloadState;
-
- if (state != QQuickWebEngineDownloadItem::DownloadInProgress)
- return;
-
- if (d->profile)
- d->profile->d_ptr->profileAdapter()->pauseDownload(d->downloadId);
-}
-
-/*!
- \qmlmethod void WebEngineDownloadItem::resume()
- \since QtWebEngine 1.6
-
- Resumes the download if it was paused or interrupted.
-
- Has no effect if the state is not \c DownloadInProgress or \c
- DownloadInterrupted. Does not change the state.
-
- \sa pause, isPaused
-*/
-void QQuickWebEngineDownloadItem::resume()
-{
- Q_D(QQuickWebEngineDownloadItem);
-
- QQuickWebEngineDownloadItem::DownloadState state = d->downloadState;
-
- if (d->downloadFinished || (state != QQuickWebEngineDownloadItem::DownloadInProgress && state != QQuickWebEngineDownloadItem::DownloadInterrupted))
- return;
-
- if (d->profile)
- d->profile->d_ptr->profileAdapter()->resumeDownload(d->downloadId);
-}
-
-/*!
- \qmlproperty int WebEngineDownloadItem::id
-
- Holds the download item's ID.
-*/
-
-quint32 QQuickWebEngineDownloadItem::id() const
-{
- Q_D(const QQuickWebEngineDownloadItem);
- return d->downloadId;
-}
-
-/*!
- \qmlproperty enumeration WebEngineDownloadItem::state
-
- Describes the state of the download:
-
- \value WebEngineDownloadItem.DownloadRequested
- Download has been requested, but it has not been accepted yet.
- \value WebEngineDownloadItem.DownloadInProgress
- Download is in progress.
- \value WebEngineDownloadItem.DownloadCompleted
- Download completed successfully.
- \value WebEngineDownloadItem.DownloadCancelled
- Download was cancelled by the user.
- \value WebEngineDownloadItem.DownloadInterrupted
- Download has been interrupted (by the server or because of lost connectivity).
-*/
-
-QQuickWebEngineDownloadItem::DownloadState QQuickWebEngineDownloadItem::state() const
-{
- Q_D(const QQuickWebEngineDownloadItem);
- return d->downloadState;
-}
-
-/*!
- \qmlproperty int WebEngineDownloadItem::totalBytes
-
- Holds the total amount of data to download in bytes.
-
- \c -1 means the total size is unknown.
-*/
-
-qint64 QQuickWebEngineDownloadItem::totalBytes() const
-{
- Q_D(const QQuickWebEngineDownloadItem);
- return d->totalBytes;
-}
-
-/*!
- \qmlproperty int WebEngineDownloadItem::receivedBytes
-
- Holds the amount of data in bytes that has been downloaded so far.
-*/
-
-qint64 QQuickWebEngineDownloadItem::receivedBytes() const
-{
- Q_D(const QQuickWebEngineDownloadItem);
- return d->receivedBytes;
-}
-
-/*!
- \qmlproperty url WebEngineDownloadItem::url
- \readonly
- \since QtWebEngine 1.10
-
- Returns the download's origin URL.
-*/
-
-QUrl QQuickWebEngineDownloadItem::url() const
-{
- Q_D(const QQuickWebEngineDownloadItem);
- return d->downloadUrl;
-}
-
-/*!
- \qmlproperty string WebEngineDownloadItem::mimeType
- \since QtWebEngine 1.2
-
- Holds the MIME type of the download.
-*/
-
-QString QQuickWebEngineDownloadItem::mimeType() const
-{
- Q_D(const QQuickWebEngineDownloadItem);
- return d->mimeType;
-}
-
-/*!
- \qmlproperty string WebEngineDownloadItem::path
- \obsolete
-
- Use \l suggestedFileName, \l downloadDirectory, and
- \l downloadFileName instead.
-
- Holds the full target path where data is being downloaded to.
-
- The path includes the file name. The default suggested path is the standard
- download location and file name is deduced not to overwrite already existing files.
-
- The download path can only be set in the
- \l{WebEngineProfile::downloadRequested}{downloadRequested} handler before
- the download is accepted.
-
- \sa WebEngineProfile::downloadRequested(), accept()
-*/
-
-QString QQuickWebEngineDownloadItem::path() const
-{
- Q_D(const QQuickWebEngineDownloadItem);
- return QDir::cleanPath(QDir(d->downloadDirectory).filePath(d->downloadFileName));
-}
-
-void QQuickWebEngineDownloadItem::setPath(QString path)
-{
- Q_D(QQuickWebEngineDownloadItem);
- if (d->downloadState != QQuickWebEngineDownloadItem::DownloadRequested) {
- qWarning("Setting the download path is not allowed after the download has been accepted.");
- return;
- }
- if (QDir(d->downloadDirectory).filePath(d->downloadFileName) != path) {
- if (QFileInfo(path).fileName().isEmpty()) {
- qWarning("The download path does not include file name.");
- return;
- }
-
- if (QFileInfo(path).isDir()) {
- qWarning("The download path matches with an already existing directory path.");
- return;
- }
-
- QString newDirectory;
- QString newFileName;
-
- if (QFileInfo(path).fileName() == path) {
- newDirectory = QStringLiteral("");
- newFileName = path;
- } else {
- newDirectory = QFileInfo(path).path();
- newFileName = QFileInfo(path).fileName();
- }
-
- if (d->downloadDirectory != newDirectory) {
- d->downloadDirectory = newDirectory;
- Q_EMIT pathChanged();
- Q_EMIT downloadDirectoryChanged();
- }
-
- if (d->downloadFileName != newFileName) {
- d->downloadFileName = newFileName;
- Q_EMIT pathChanged();
- Q_EMIT downloadFileNameChanged();
- }
- }
-}
-
-/*!
- \qmlproperty string WebEngineDownloadItem::downloadDirectory
- \since QtWebEngine 1.10
-
- Holds the full target path without file name where data is being downloaded to.
-
- The download directory can only be set in the
- \l{WebEngineProfile::downloadRequested}{downloadRequested} handler before
- the download is accepted.
-
- \sa WebEngineProfile::downloadRequested(), accept()
-*/
-
-QString QQuickWebEngineDownloadItem::downloadDirectory() const
-{
- Q_D(const QQuickWebEngineDownloadItem);
- return d->downloadDirectory;
-}
-
-void QQuickWebEngineDownloadItem::setDownloadDirectory(const QString &directory)
-{
- Q_D(QQuickWebEngineDownloadItem);
- if (d->downloadState != QQuickWebEngineDownloadItem::DownloadRequested) {
- qWarning("Setting the download directory is not allowed after the download has been accepted.");
- return;
- }
-
- bool isPathChanged = false;
- QString changeDirectory = d->downloadDirectory;
- if (!directory.isEmpty() && changeDirectory != directory) {
- changeDirectory = directory;
-
- if (d->downloadDirectory != changeDirectory) {
- d->downloadDirectory = changeDirectory;
- Q_EMIT downloadDirectoryChanged();
- isPathChanged = true;
- }
-
- if (!d->isCustomFileName) {
- QString newFileName = QFileInfo(d->profile->d_ptr->profileAdapter()->determineDownloadPath(d->downloadDirectory,
- d->suggestedFileName,
- d->startTime)).fileName();
- if (d->downloadFileName != newFileName) {
- d->downloadFileName = newFileName;
- Q_EMIT downloadFileNameChanged();
- isPathChanged = true;
- }
- }
- }
-
- if (isPathChanged)
- Q_EMIT pathChanged();
-}
-
-/*!
- \qmlproperty string WebEngineDownloadItem::downloadFileName
- \since QtWebEngine 1.10
-
- Holds the name of the file to which data is being downloaded.
-
- The download file name can only be set in the
- \l{WebEngineProfile::downloadRequested}{downloadRequested} handler before
- the download is accepted.
-
- \sa WebEngineProfile::downloadRequested(), accept()
-*/
-
-QString QQuickWebEngineDownloadItem::downloadFileName() const
-{
- Q_D(const QQuickWebEngineDownloadItem);
- return d->downloadFileName;
-}
-
-void QQuickWebEngineDownloadItem::setDownloadFileName(const QString &fileName)
-{
- Q_D(QQuickWebEngineDownloadItem);
- if (d->downloadState != QQuickWebEngineDownloadItem::DownloadRequested) {
- qWarning("Setting the download file name is not allowed after the download has been accepted.");
- return;
- }
-
- if (d->downloadFileName != fileName && !fileName.isEmpty()) {
- d->downloadFileName = fileName;
- d->isCustomFileName = true;
- Q_EMIT downloadFileNameChanged();
- Q_EMIT pathChanged();
- }
-}
-
-/*!
- \qmlproperty string WebEngineDownloadItem::suggestedFileName
- \since QtWebEngine 1.10
-
- Returns the suggested file name.
-*/
-
-QString QQuickWebEngineDownloadItem::suggestedFileName() const
-{
- Q_D(const QQuickWebEngineDownloadItem);
- return d->suggestedFileName;
-}
-
-/*!
- \qmlproperty enumeration WebEngineDownloadItem::savePageFormat
- \since QtWebEngine 1.3
-
- Describes the format that is used to save a web page.
-
- \value WebEngineDownloadItem.UnknownSaveFormat
- This is not a request for downloading a complete web page.
- \value WebEngineDownloadItem.SingleHtmlSaveFormat
- The page is saved as a single HTML page. Resources such as images
- are not saved.
- \value WebEngineDownloadItem.CompleteHtmlSaveFormat
- The page is saved as a complete HTML page, for example a directory
- containing the single HTML page and the resources.
- \value WebEngineDownloadItem.MimeHtmlSaveFormat
- The page is saved as a complete web page in the MIME HTML format.
-*/
-
-QQuickWebEngineDownloadItem::SavePageFormat QQuickWebEngineDownloadItem::savePageFormat() const
-{
- Q_D(const QQuickWebEngineDownloadItem);
- return d->savePageFormat;
-}
-
-void QQuickWebEngineDownloadItem::setSavePageFormat(QQuickWebEngineDownloadItem::SavePageFormat format)
-{
- Q_D(QQuickWebEngineDownloadItem);
- if (d->savePageFormat != format) {
- d->savePageFormat = format;
- Q_EMIT savePageFormatChanged();
- }
-}
-
-/*!
- \qmlproperty enumeration WebEngineDownloadItem::type
- \readonly
- \since QtWebEngine 1.4
- \obsolete
-
- Describes the requested download's type.
-
- \note This property works unreliably, except for \c SavePage
- downloads. Use \l isSavePageDownload instead.
-
- \value WebEngineDownloadItem.Attachment The web server's response includes a
- \c Content-Disposition header with the \c attachment directive. If \c Content-Disposition
- is present in the reply, the web server is indicating that the client should prompt the
- user to save the content regardless of the content type.
- See \l {RFC 2616 section 19.5.1} for details.
- \value WebEngineDownloadItem.DownloadAttribute The user clicked a link with the \c download
- attribute.
- \value WebEngineDownloadItem.UserRequested The user initiated the download, for example by
- selecting a web action.
- \value WebEngineDownloadItem.SavePage Saving of the current page was requested (for example by
- the \l{WebEngineView::WebAction}{WebEngineView.SavePage} web action).
-
-*/
-
-QQuickWebEngineDownloadItem::DownloadType QQuickWebEngineDownloadItem::type() const
-{
- Q_D(const QQuickWebEngineDownloadItem);
- return d->type;
-}
-
-/*!
- \qmlproperty bool WebEngineDownloadItem::isSavePageDownload
- \readonly
- \since QtWebEngine 1.7
-
- Whether this is a download request for saving a web page or a file.
-
- \sa savePageFormat
-*/
-bool QQuickWebEngineDownloadItem::isSavePageDownload() const
-{
- Q_D(const QQuickWebEngineDownloadItem);
- return d->type == QQuickWebEngineDownloadItem::SavePage;
-}
-
-/*!
- \qmlproperty enumeration WebEngineDownloadItem::interruptReason
- \readonly
- \since QtWebEngine 1.5
-
- Returns the reason why the download was interrupted:
-
- \value WebEngineDownloadItem.NoReason Unknown reason or not interrupted.
- \value WebEngineDownloadItem.FileFailed General file operation failure.
- \value WebEngineDownloadItem.FileAccessDenied The file cannot be written locally, due to access restrictions.
- \value WebEngineDownloadItem.FileNoSpace Insufficient space on the target drive.
- \value WebEngineDownloadItem.FileNameTooLong The directory or file name is too long.
- \value WebEngineDownloadItem.FileTooLarge The file size exceeds the file system limitation.
- \value WebEngineDownloadItem.FileVirusInfected The file is infected with a virus.
- \value WebEngineDownloadItem.FileTransientError Temporary problem (for example the file is in use,
- out of memory, or too many files are opened at once).
- \value WebEngineDownloadItem.FileBlocked The file was blocked due to local policy.
- \value WebEngineDownloadItem.FileSecurityCheckFailed An attempt to check the safety of the download
- failed due to unexpected reasons.
- \value WebEngineDownloadItem.FileTooShort An attempt was made to seek past the end of a file when
- opening a file (as part of resuming a previously interrupted download).
- \value WebEngineDownloadItem.FileHashMismatch The partial file did not match the expected hash.
-
- \value WebEngineDownloadItem.NetworkFailed General network failure.
- \value WebEngineDownloadItem.NetworkTimeout The network operation has timed out.
- \value WebEngineDownloadItem.NetworkDisconnected The network connection has been terminated.
- \value WebEngineDownloadItem.NetworkServerDown The server has gone down.
- \value WebEngineDownloadItem.NetworkInvalidRequest The network request was invalid (for example, the
- original or redirected URL is invalid, has an unsupported scheme, or is disallowed by policy).
-
- \value WebEngineDownloadItem.ServerFailed General server failure.
- \value WebEngineDownloadItem.ServerBadContent The server does not have the requested data.
- \value WebEngineDownloadItem.ServerUnauthorized The server did not authorize access to the resource.
- \value WebEngineDownloadItem.ServerCertProblem A problem with the server certificate occurred.
- \value WebEngineDownloadItem.ServerForbidden Access forbidden by the server.
- \value WebEngineDownloadItem.ServerUnreachable Unexpected server response (might indicate that
- the responding server may not be the intended server).
- \value WebEngineDownloadItem.UserCanceled The user canceled the download.
-
- \sa interruptReasonString
-*/
-
-QQuickWebEngineDownloadItem::DownloadInterruptReason QQuickWebEngineDownloadItem::interruptReason() const
-{
- Q_D(const QQuickWebEngineDownloadItem);
- return d->interruptReason;
-}
-
-/*!
- \qmlproperty string WebEngineDownloadItem::interruptReasonString
- Returns a human-readable description of the reason for interrupting the download.
- \since QtWebEngine 1.5
-
- \sa interruptReason
-*/
-QString QQuickWebEngineDownloadItem::interruptReasonString() const
-{
- return ProfileAdapterClient::downloadInterruptReasonToString(
- static_cast<ProfileAdapterClient::DownloadInterruptReason>(interruptReason()));
-}
-
-/*!
- \qmlproperty bool WebEngineDownloadItem::isFinished
- \readonly
- \since QtWebEngine 1.6
-
- Whether this download is finished (completed, cancelled, or non-resumable interrupted state).
- */
-
-bool QQuickWebEngineDownloadItem::isFinished() const
-{
- Q_D(const QQuickWebEngineDownloadItem);
- return d->downloadFinished;
-}
-
-/*!
- \qmlproperty bool WebEngineDownloadItem::isPaused
- \readonly
- \since QtWebEngine 1.6
-
- Whether this download is paused.
-
- \sa pause, resume
- */
-
-bool QQuickWebEngineDownloadItem::isPaused() const
-{
- Q_D(const QQuickWebEngineDownloadItem);
- return d->downloadPaused;
-}
-
-/*!
- \qmlproperty WebEngineView WebEngineDownloadItem::view
- \readonly
- \since QtWebEngine 1.8
-
- Returns the view the download was requested on. If the download was not triggered by content in a view,
- \c nullptr is returned.
-
- \sa WebEngineView
-*/
-QQuickWebEngineView *QQuickWebEngineDownloadItem::view() const
-{
- Q_D(const QQuickWebEngineDownloadItem);
- return d->view;
-}
-
-QQuickWebEngineDownloadItem::QQuickWebEngineDownloadItem(QQuickWebEngineDownloadItemPrivate *p, QObject *parent)
- : QObject(parent)
- , d_ptr(p)
-{
- p->q_ptr = this;
-}
-
-QQuickWebEngineDownloadItem::~QQuickWebEngineDownloadItem()
-{
- if (!isFinished())
- cancel();
-}
-
-QT_END_NAMESPACE
diff --git a/src/webengine/api/qquickwebenginedownloaditem_p.h b/src/webengine/api/qquickwebenginedownloaditem_p.h
deleted file mode 100644
index e1b1b9040..000000000
--- a/src/webengine/api/qquickwebenginedownloaditem_p.h
+++ /dev/null
@@ -1,199 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKWEBENGINEDOWNLOADITEM_P_H
-#define QQUICKWEBENGINEDOWNLOADITEM_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtWebEngine/private/qtwebengineglobal_p.h>
-#include <QObject>
-#include <QScopedPointer>
-#include <QString>
-#include <QUrl>
-
-QT_BEGIN_NAMESPACE
-
-class QQuickWebEngineDownloadItemPrivate;
-class QQuickWebEngineProfilePrivate;
-class QQuickWebEngineView;
-
-class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineDownloadItem: public QObject {
- Q_OBJECT
-public:
- ~QQuickWebEngineDownloadItem();
- enum DownloadState {
- DownloadRequested,
- DownloadInProgress,
- DownloadCompleted,
- DownloadCancelled,
- DownloadInterrupted
- };
- Q_ENUM(DownloadState)
-
- enum SavePageFormat {
- UnknownSaveFormat = -1,
- SingleHtmlSaveFormat,
- CompleteHtmlSaveFormat,
- MimeHtmlSaveFormat
- };
- Q_ENUM(SavePageFormat)
-
- enum DownloadInterruptReason {
- NoReason = 0,
- FileFailed = 1,
- FileAccessDenied = 2,
- FileNoSpace = 3,
- FileNameTooLong = 5,
- FileTooLarge = 6,
- FileVirusInfected = 7,
- FileTransientError = 10,
- FileBlocked = 11,
- FileSecurityCheckFailed = 12,
- FileTooShort = 13,
- FileHashMismatch = 14,
- NetworkFailed = 20,
- NetworkTimeout = 21,
- NetworkDisconnected = 22,
- NetworkServerDown = 23,
- NetworkInvalidRequest = 24,
- ServerFailed = 30,
- //ServerNoRange = 31,
- ServerBadContent = 33,
- ServerUnauthorized = 34,
- ServerCertProblem = 35,
- ServerForbidden = 36,
- ServerUnreachable = 37,
- UserCanceled = 40,
- //UserShutdown = 41,
- //Crash = 50
- };
- Q_ENUM(DownloadInterruptReason)
-
- enum DownloadType {
- Attachment = 0,
- DownloadAttribute,
- UserRequested,
- SavePage
- };
- Q_ENUM(DownloadType)
-
- Q_PROPERTY(quint32 id READ id CONSTANT FINAL)
- Q_PROPERTY(DownloadState state READ state NOTIFY stateChanged FINAL)
- Q_PROPERTY(SavePageFormat savePageFormat READ savePageFormat WRITE setSavePageFormat NOTIFY savePageFormatChanged REVISION 2 FINAL)
- Q_PROPERTY(qint64 totalBytes READ totalBytes NOTIFY totalBytesChanged FINAL)
- Q_PROPERTY(qint64 receivedBytes READ receivedBytes NOTIFY receivedBytesChanged FINAL)
- Q_PROPERTY(QString mimeType READ mimeType NOTIFY mimeTypeChanged REVISION 1 FINAL)
- Q_PROPERTY(QString path READ path WRITE setPath NOTIFY pathChanged FINAL)
- Q_PROPERTY(DownloadType type READ type NOTIFY typeChanged REVISION 3 FINAL)
- Q_PROPERTY(DownloadInterruptReason interruptReason READ interruptReason NOTIFY interruptReasonChanged REVISION 4 FINAL)
- Q_PROPERTY(QString interruptReasonString READ interruptReasonString NOTIFY interruptReasonChanged REVISION 4 FINAL)
- Q_PROPERTY(bool isFinished READ isFinished NOTIFY isFinishedChanged REVISION 5 FINAL)
- Q_PROPERTY(bool isPaused READ isPaused NOTIFY isPausedChanged REVISION 5 FINAL)
- Q_PROPERTY(bool isSavePageDownload READ isSavePageDownload CONSTANT REVISION 6 FINAL)
- Q_PROPERTY(QQuickWebEngineView *view READ view CONSTANT REVISION 7 FINAL)
- Q_PROPERTY(QUrl url READ url CONSTANT REVISION 10 FINAL)
- Q_PROPERTY(QString suggestedFileName READ suggestedFileName CONSTANT REVISION 10 FINAL)
- Q_PROPERTY(QString downloadDirectory READ downloadDirectory WRITE setDownloadDirectory NOTIFY downloadDirectoryChanged REVISION 10 FINAL)
- Q_PROPERTY(QString downloadFileName READ downloadFileName WRITE setDownloadFileName NOTIFY downloadFileNameChanged REVISION 10 FINAL)
-
- Q_INVOKABLE void accept();
- Q_INVOKABLE void cancel();
- Q_INVOKABLE void pause();
- Q_INVOKABLE void resume();
-
- quint32 id() const;
- DownloadState state() const;
- qint64 totalBytes() const;
- qint64 receivedBytes() const;
- QString mimeType() const;
- QString path() const;
- void setPath(QString path);
- SavePageFormat savePageFormat() const;
- void setSavePageFormat(SavePageFormat format);
- DownloadType Q_DECL_DEPRECATED type() const;
- DownloadInterruptReason interruptReason() const;
- QString interruptReasonString() const;
- bool isFinished() const;
- bool isPaused() const;
- bool isSavePageDownload() const;
- QQuickWebEngineView *view() const;
- QUrl url() const;
- QString suggestedFileName() const;
- QString downloadDirectory() const;
- void setDownloadDirectory(const QString &directory);
- QString downloadFileName() const;
- void setDownloadFileName(const QString &fileName);
- bool isCustomFileName;
-
-Q_SIGNALS:
- void stateChanged();
- Q_REVISION(2) void savePageFormatChanged();
- void receivedBytesChanged();
- void totalBytesChanged();
- Q_REVISION(1) void mimeTypeChanged();
- void pathChanged();
- Q_REVISION(3) void typeChanged();
- Q_REVISION(4) void interruptReasonChanged();
- Q_REVISION(5) void isFinishedChanged();
- Q_REVISION(5) void isPausedChanged();
- Q_REVISION(10) void downloadDirectoryChanged();
- Q_REVISION(10) void downloadFileNameChanged();
-
-private:
- QQuickWebEngineDownloadItem(QQuickWebEngineDownloadItemPrivate*, QObject *parent = 0);
- Q_DISABLE_COPY(QQuickWebEngineDownloadItem)
- Q_DECLARE_PRIVATE(QQuickWebEngineDownloadItem)
- friend class QQuickWebEngineProfilePrivate;
-
- QScopedPointer<QQuickWebEngineDownloadItemPrivate> d_ptr;
-};
-
-QT_END_NAMESPACE
-
-#endif // QQUICKWEBENGINEDOWNLOADITEM_P_H
diff --git a/src/webengine/api/qquickwebenginedownloaditem_p_p.h b/src/webengine/api/qquickwebenginedownloaditem_p_p.h
deleted file mode 100644
index acd7fe806..000000000
--- a/src/webengine/api/qquickwebenginedownloaditem_p_p.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKWEBENGINEDOWNLOADITEM_P_P_H
-#define QQUICKWEBENGINEDOWNLOADITEM_P_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "profile_adapter_client.h"
-#include "qquickwebenginedownloaditem_p.h"
-#include "qquickwebengineprofile.h"
-#include <QString>
-#include <QPointer>
-
-QT_BEGIN_NAMESPACE
-class QQuickWebEngineProfilePrivate;
-class QQuickWebEngineView;
-
-class QQuickWebEngineDownloadItemPrivate {
- QQuickWebEngineDownloadItem *q_ptr;
- QPointer<QQuickWebEngineProfile> profile;
- friend class QQuickWebEngineProfilePrivate;
-public:
- Q_DECLARE_PUBLIC(QQuickWebEngineDownloadItem)
- QQuickWebEngineDownloadItemPrivate(QQuickWebEngineProfile *p, const QUrl &url);
- ~QQuickWebEngineDownloadItemPrivate();
-
- quint32 downloadId;
- qint64 startTime;
- QQuickWebEngineDownloadItem::DownloadState downloadState;
- QQuickWebEngineDownloadItem::SavePageFormat savePageFormat;
- QQuickWebEngineDownloadItem::DownloadType type;
- QQuickWebEngineDownloadItem::DownloadInterruptReason interruptReason;
- qint64 totalBytes;
- qint64 receivedBytes;
- QString mimeType;
- QString downloadPath;
- bool downloadFinished;
- bool downloadPaused;
- QQuickWebEngineView *view;
- QUrl downloadUrl;
- QString suggestedFileName;
- QString downloadDirectory;
- QString downloadFileName;
- bool isCustomFileName;
-
- void update(const QtWebEngineCore::ProfileAdapterClient::DownloadItemInfo &info);
- void updateState(QQuickWebEngineDownloadItem::DownloadState newState);
- void setFinished();
-};
-
-QT_END_NAMESPACE
-
-#endif // QQUICKWEBENGINEDOWNLOADITEM_P_P_H
diff --git a/src/webengine/api/qquickwebenginefaviconprovider.cpp b/src/webengine/api/qquickwebenginefaviconprovider.cpp
deleted file mode 100644
index 3255f22be..000000000
--- a/src/webengine/api/qquickwebenginefaviconprovider.cpp
+++ /dev/null
@@ -1,191 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickwebenginefaviconprovider_p_p.h"
-
-#include "favicon_manager.h"
-#include "qquickwebengineview_p.h"
-#include "qquickwebengineview_p_p.h"
-#include "web_contents_adapter.h"
-
-#include <QtGui/QIcon>
-#include <QtGui/QPixmap>
-
-QT_BEGIN_NAMESPACE
-
-using QtWebEngineCore::FaviconInfo;
-using QtWebEngineCore::FaviconManager;
-
-static inline unsigned area(const QSize &size)
-{
- return size.width() * size.height();
-}
-
-QString QQuickWebEngineFaviconProvider::identifier()
-{
- return QStringLiteral("favicon");
-}
-
-QUrl QQuickWebEngineFaviconProvider::faviconProviderUrl(const QUrl &url)
-{
- if (url.isEmpty())
- return url;
-
- QUrl providerUrl;
- providerUrl.setScheme(QStringLiteral("image"));
- providerUrl.setHost(identifier());
- providerUrl.setPath(QStringLiteral("/%1").arg(url.toString(QUrl::RemoveQuery | QUrl::RemoveFragment)));
- if (url.hasQuery())
- providerUrl.setQuery(url.query(QUrl::FullyDecoded));
- if (url.hasFragment())
- providerUrl.setFragment(url.fragment(QUrl::FullyDecoded));
-
- return providerUrl;
-}
-
-QQuickWebEngineFaviconProvider::QQuickWebEngineFaviconProvider()
- : QQuickImageProvider(QQuickImageProvider::Pixmap)
- , m_latestView(0)
-{
-}
-
-QQuickWebEngineFaviconProvider::~QQuickWebEngineFaviconProvider()
-{
- qDeleteAll(m_iconUrlMap);
-}
-
-QUrl QQuickWebEngineFaviconProvider::attach(QQuickWebEngineView *view, const QUrl &iconUrl)
-{
- if (iconUrl.isEmpty())
- return QUrl();
-
- m_latestView = view;
-
- if (!m_iconUrlMap.contains(view))
- m_iconUrlMap.insert(view, new QList<QUrl>());
-
- QList<QUrl> *iconUrls = m_iconUrlMap[view];
- if (!iconUrls->contains(iconUrl))
- iconUrls->append(iconUrl);
-
- return faviconProviderUrl(iconUrl);
-}
-
-void QQuickWebEngineFaviconProvider::detach(QQuickWebEngineView *view)
-{
- QList<QUrl> *iconUrls = m_iconUrlMap.take(view);
- delete iconUrls;
-}
-
-QPixmap QQuickWebEngineFaviconProvider::requestPixmap(const QString &id, QSize *size, const QSize &requestedSize)
-{
- Q_UNUSED(size);
- Q_UNUSED(requestedSize);
-
- QUrl iconUrl(id);
- QQuickWebEngineView *view = viewForIconUrl(iconUrl);
-
- if (!view || iconUrl.isEmpty())
- return QPixmap();
-
- FaviconManager *faviconManager = view->d_ptr->adapter->faviconManager();
-
- Q_ASSERT(faviconManager);
- const FaviconInfo &faviconInfo = faviconManager->getFaviconInfo(iconUrl);
- const QIcon &icon = faviconManager->getIcon(faviconInfo.candidate ? QUrl() : iconUrl);
-
- Q_ASSERT(!icon.isNull());
- const QSize &bestSize = faviconInfo.size;
-
- // If source size is not specified, use the best quality
- if (!requestedSize.isValid()) {
- if (size)
- *size = bestSize;
-
- return icon.pixmap(bestSize).copy();
- }
-
- const QSize &fitSize = findFitSize(icon.availableSizes(), requestedSize, bestSize);
- const QPixmap &iconPixmap = icon.pixmap(fitSize);
-
- if (size)
- *size = iconPixmap.size();
-
- return iconPixmap.scaled(requestedSize, Qt::KeepAspectRatio, Qt::SmoothTransformation).copy();
-}
-
-QQuickWebEngineView *QQuickWebEngineFaviconProvider::viewForIconUrl(const QUrl &iconUrl) const
-{
- // The most common use case is that the requested iconUrl belongs to the
- // latest WebEngineView which was raised an iconChanged signal.
- if (m_latestView) {
- QList<QUrl> *iconUrls = m_iconUrlMap[m_latestView];
- if (iconUrls && iconUrls->contains(iconUrl))
- return m_latestView;
- }
-
- for (auto it = m_iconUrlMap.cbegin(), end = m_iconUrlMap.cend(); it != end; ++it) {
- if (it.value()->contains(iconUrl))
- return it.key();
- }
-
- return 0;
-}
-
-QSize QQuickWebEngineFaviconProvider::findFitSize(const QList<QSize> &availableSizes,
- const QSize &requestedSize,
- const QSize &bestSize) const
-{
- Q_ASSERT(availableSizes.count());
- if (availableSizes.count() == 1 || area(requestedSize) >= area(bestSize))
- return bestSize;
-
- QSize fitSize = bestSize;
- for (const QSize &size : availableSizes) {
- if (area(size) == area(requestedSize))
- return size;
-
- if (area(requestedSize) < area(size) && area(size) < area(fitSize))
- fitSize = size;
- }
-
- return fitSize;
-}
-
-QT_END_NAMESPACE
diff --git a/src/webengine/api/qquickwebenginefaviconprovider_p_p.h b/src/webengine/api/qquickwebenginefaviconprovider_p_p.h
deleted file mode 100644
index 18b6d61c8..000000000
--- a/src/webengine/api/qquickwebenginefaviconprovider_p_p.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKWEBENGINEFAVICONPROVIDER_P_P_H
-#define QQUICKWEBENGINEFAVICONPROVIDER_P_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtWebEngine/private/qtwebengineglobal_p.h>
-#include <QtQuick/QQuickImageProvider>
-
-#include <QtCore/QMap>
-
-QT_BEGIN_NAMESPACE
-
-class QQuickWebEngineView;
-
-class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineFaviconProvider : public QQuickImageProvider {
-public:
- static QString identifier();
- static QUrl faviconProviderUrl(const QUrl &);
-
- QQuickWebEngineFaviconProvider();
- ~QQuickWebEngineFaviconProvider();
-
- QUrl attach(QQuickWebEngineView *, const QUrl &);
- void detach(QQuickWebEngineView *);
-
-
- virtual QPixmap requestPixmap(const QString &, QSize *, const QSize &);
-
-private:
- QQuickWebEngineView *viewForIconUrl(const QUrl &) const;
- QSize findFitSize(const QList<QSize> &, const QSize &, const QSize &) const;
-
- QMap<QQuickWebEngineView *, QList<QUrl> *> m_iconUrlMap;
- QQuickWebEngineView *m_latestView;
-};
-
-QT_END_NAMESPACE
-
-#endif // QQUICKWEBENGINEFAVICONPROVIDER_P_P_H
diff --git a/src/webengine/api/qquickwebenginehistory.cpp b/src/webengine/api/qquickwebenginehistory.cpp
deleted file mode 100644
index e77974a0f..000000000
--- a/src/webengine/api/qquickwebenginehistory.cpp
+++ /dev/null
@@ -1,356 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickwebenginehistory_p.h"
-#include "qquickwebenginehistory_p_p.h"
-
-#include "qquickwebenginefaviconprovider_p_p.h"
-#include "qquickwebengineloadrequest_p.h"
-#include "qquickwebengineview_p_p.h"
-#include "web_contents_adapter.h"
-
-QT_BEGIN_NAMESPACE
-
-QQuickWebEngineHistoryListModelPrivate::QQuickWebEngineHistoryListModelPrivate(QQuickWebEngineViewPrivate *view)
- : view(view)
-{
-}
-
-QQuickWebEngineHistoryListModelPrivate::~QQuickWebEngineHistoryListModelPrivate()
-{
-}
-
-int QQuickWebEngineHistoryListModelPrivate::count() const
-{
- return adapter()->navigationEntryCount();
-}
-
-int QQuickWebEngineHistoryListModelPrivate::index(int index) const
-{
- return index;
-}
-
-int QQuickWebEngineHistoryListModelPrivate::offsetForIndex(int index) const
-{
- return index - adapter()->currentNavigationEntryIndex();
-}
-
-QtWebEngineCore::WebContentsAdapter *QQuickWebEngineHistoryListModelPrivate::adapter() const
-{
- return view->adapter.data();
-}
-
-QQuickWebEngineBackHistoryListModelPrivate::QQuickWebEngineBackHistoryListModelPrivate(QQuickWebEngineViewPrivate *view)
- : QQuickWebEngineHistoryListModelPrivate(view)
-{
-}
-
-int QQuickWebEngineBackHistoryListModelPrivate::count() const
-{
- return adapter()->currentNavigationEntryIndex();
-}
-
-int QQuickWebEngineBackHistoryListModelPrivate::index(int i) const
-{
- Q_ASSERT(i >= 0 && i < count());
- return count() - 1 - i;
-}
-
-int QQuickWebEngineBackHistoryListModelPrivate::offsetForIndex(int index) const
-{
- return - index - 1;
-}
-
-QQuickWebEngineForwardHistoryListModelPrivate::QQuickWebEngineForwardHistoryListModelPrivate(QQuickWebEngineViewPrivate *view)
- : QQuickWebEngineHistoryListModelPrivate(view)
-{
-}
-
-int QQuickWebEngineForwardHistoryListModelPrivate::count() const
-{
- if (!adapter()->isInitialized())
- return 0;
- return adapter()->navigationEntryCount() - adapter()->currentNavigationEntryIndex() - 1;
-}
-
-int QQuickWebEngineForwardHistoryListModelPrivate::index(int i) const
-{
- return adapter()->currentNavigationEntryIndex() + i + 1;
-}
-
-int QQuickWebEngineForwardHistoryListModelPrivate::offsetForIndex(int index) const
-{
- return index + 1;
-}
-
-/*!
- \qmltype WebEngineHistoryListModel
- \instantiates QQuickWebEngineHistoryListModel
- \inqmlmodule QtWebEngine
- \since QtWebEngine 1.1
-
- \brief A data model that represents the history of a web engine page.
-
- The WebEngineHistoryListModel type exposes the \e title, \e url, \e icon, and \e offset roles.
- The \e title, \e url and \e icon specify the title, URL, and favicon of the visited page.
- The \e offset specifies
- the position of the page in respect to the current page (0). A positive number indicates that
- the page was visited after the current page, whereas a negative number indicates that the page
- was visited before the current page.
-
- This type is uncreatable, but it can be accessed by using the
- \l{WebEngineView::navigationHistory}{WebEngineView.navigationHistory} property.
-
- \sa WebEngineHistory
-*/
-
-QQuickWebEngineHistoryListModel::QQuickWebEngineHistoryListModel()
- : QAbstractListModel()
-{
-}
-
-QQuickWebEngineHistoryListModel::QQuickWebEngineHistoryListModel(QQuickWebEngineHistoryListModelPrivate *d)
- : QAbstractListModel()
- , d_ptr(d)
-{
-}
-
-QQuickWebEngineHistoryListModel::~QQuickWebEngineHistoryListModel()
-{
-}
-
-QHash<int, QByteArray> QQuickWebEngineHistoryListModel::roleNames() const
-{
- QHash<int, QByteArray> roles;
- roles[QQuickWebEngineHistory::UrlRole] = "url";
- roles[QQuickWebEngineHistory::TitleRole] = "title";
- roles[QQuickWebEngineHistory::OffsetRole] = "offset";
- roles[QQuickWebEngineHistory::IconUrlRole] = "icon";
- return roles;
-}
-
-int QQuickWebEngineHistoryListModel::rowCount(const QModelIndex &index) const
-{
- Q_UNUSED(index);
- Q_D(const QQuickWebEngineHistoryListModel);
- return d->count();
-}
-
-QVariant QQuickWebEngineHistoryListModel::data(const QModelIndex &index, int role) const
-{
- Q_D(const QQuickWebEngineHistoryListModel);
-
- if (!index.isValid())
- return QVariant();
-
- if (role < QQuickWebEngineHistory::UrlRole || role > QQuickWebEngineHistory::IconUrlRole)
- return QVariant();
-
- if (role == QQuickWebEngineHistory::UrlRole)
- return QUrl(d->adapter()->getNavigationEntryUrl(d->index(index.row())));
-
- if (role == QQuickWebEngineHistory::TitleRole)
- return QString(d->adapter()->getNavigationEntryTitle(d->index(index.row())));
-
- if (role == QQuickWebEngineHistory::OffsetRole)
- return d->offsetForIndex(index.row());
-
- if (role == QQuickWebEngineHistory::IconUrlRole) {
- QUrl iconUrl = QUrl(d->adapter()->getNavigationEntryIconUrl(d->index(index.row())));
- return QQuickWebEngineFaviconProvider::faviconProviderUrl(iconUrl);
- }
-
- return QVariant();
-}
-
-void QQuickWebEngineHistoryListModel::reset()
-{
- beginResetModel();
- endResetModel();
-}
-
-QQuickWebEngineHistoryPrivate::QQuickWebEngineHistoryPrivate(QQuickWebEngineViewPrivate *view)
- : m_view(view)
-{
-}
-
-QQuickWebEngineHistoryPrivate::~QQuickWebEngineHistoryPrivate()
-{
-}
-
-/*!
- \qmltype WebEngineHistory
- \instantiates QQuickWebEngineHistory
- \inqmlmodule QtWebEngine
- \since QtWebEngine 1.1
-
- \brief Provides data models that represent the history of a web engine page.
-
- The WebEngineHistory type can be accessed by using the
- \l{WebEngineView::navigationHistory}{WebEngineView.navigationHistory} property.
-
- The WebEngineHistory type provides the following WebEngineHistoryListModel data model objects:
-
- \list
- \li \c backItems, which contains the URLs of visited pages.
- \li \c forwardItems, which contains the URLs of the pages that were visited after visiting
- the current page.
- \li \c items, which contains the URLs of the back and forward items, as well as the URL of
- the current page.
- \endlist
-
- The easiest way to use these models is to use them in a ListView as illustrated by the
- following code snippet:
-
- \code
- ListView {
- id: historyItemsList
- anchors.fill: parent
- model: webEngineView.navigationHistory.items
- delegate:
- Text {
- color: "black"
- text: model.title + " - " + model.url + " (" + model.offset + ")"
- }
- }
- \endcode
-
- The ListView shows the content of the corresponding model. The delegate is responsible for the
- format of the list items. The appearance of each item of the list in the delegate can be defined
- separately (it is not web engine specific).
-
- The model roles \e title, \e url, and \e icon specify the title, URL, and favicon of the
- visited page. The \e offset
- role specifies the position of the page in respect to the current page (0). A positive number
- indicates that the page was visited after the current page, whereas a negative number indicates
- that the page was visited before the current page.
-
- The data models can also be used to create a menu, as illustrated by the following code
- snippet:
-
- \quotefromfile webengine/quicknanobrowser/BrowserWindow.qml
- \skipto ToolBar
- \printuntil onObjectRemoved
- \printuntil }
- \printuntil }
- \printuntil }
-
- For the complete example, see \l{WebEngine Quick Nano Browser}.
-
- \sa WebEngineHistoryListModel
-*/
-
-QQuickWebEngineHistory::QQuickWebEngineHistory(QQuickWebEngineViewPrivate *view)
- : d_ptr(new QQuickWebEngineHistoryPrivate(view))
-{
-}
-
-QQuickWebEngineHistory::~QQuickWebEngineHistory()
-{
-}
-
-/*!
- \qmlproperty WebEngineHistoryListModel WebEngineHistory::items
- \readonly
-
- URLs of back items, forward items, and the current item in the history.
-*/
-QQuickWebEngineHistoryListModel *QQuickWebEngineHistory::items() const
-{
- Q_D(const QQuickWebEngineHistory);
- if (!d->m_navigationModel)
- d->m_navigationModel.reset(new QQuickWebEngineHistoryListModel(new QQuickWebEngineHistoryListModelPrivate(d->m_view)));
- return d->m_navigationModel.data();
-}
-
-/*!
- \qmlproperty WebEngineHistoryListModel WebEngineHistory::backItems
- \readonly
-
- URLs of visited pages.
-*/
-QQuickWebEngineHistoryListModel *QQuickWebEngineHistory::backItems() const
-{
- Q_D(const QQuickWebEngineHistory);
- if (!d->m_backNavigationModel)
- d->m_backNavigationModel.reset(new QQuickWebEngineHistoryListModel(new QQuickWebEngineBackHistoryListModelPrivate(d->m_view)));
- return d->m_backNavigationModel.data();
-}
-
-/*!
- \qmlproperty WebEngineHistoryListModel WebEngineHistory::forwardItems
- \readonly
-
- URLs of the pages that were visited after visiting the current page.
-*/
-QQuickWebEngineHistoryListModel *QQuickWebEngineHistory::forwardItems() const
-{
- Q_D(const QQuickWebEngineHistory);
- if (!d->m_forwardNavigationModel)
- d->m_forwardNavigationModel.reset(new QQuickWebEngineHistoryListModel(new QQuickWebEngineForwardHistoryListModelPrivate(d->m_view)));
- return d->m_forwardNavigationModel.data();
-}
-
-/*!
- \qmlmethod void WebEngineHistory::clear()
- \since QtWebEngine 1.11
-
- Clears the history.
-*/
-void QQuickWebEngineHistory::clear()
-{
- Q_D(QQuickWebEngineHistory);
- d->m_view->adapter->clearNavigationHistory();
- d->m_view->updateNavigationActions();
- reset();
-}
-
-void QQuickWebEngineHistory::reset()
-{
- Q_D(QQuickWebEngineHistory);
- if (d->m_navigationModel)
- d->m_navigationModel->reset();
- if (d->m_backNavigationModel)
- d->m_backNavigationModel->reset();
- if (d->m_forwardNavigationModel)
- d->m_forwardNavigationModel->reset();
-}
-
-
-QT_END_NAMESPACE
diff --git a/src/webengine/api/qquickwebenginehistory_p.h b/src/webengine/api/qquickwebenginehistory_p.h
deleted file mode 100644
index 5d4783e96..000000000
--- a/src/webengine/api/qquickwebenginehistory_p.h
+++ /dev/null
@@ -1,125 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKWEBENGINEHISTORY_P_H
-#define QQUICKWEBENGINEHISTORY_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtWebEngine/qtwebengineglobal.h>
-#include <QAbstractListModel>
-#include <QtCore/qshareddata.h>
-#include <QQuickItem>
-#include <QUrl>
-#include <QVariant>
-
-QT_BEGIN_NAMESPACE
-
-class QQuickWebEngineHistory;
-class QQuickWebEngineHistoryPrivate;
-class QQuickWebEngineHistoryListModelPrivate;
-class QQuickWebEngineLoadRequest;
-class QQuickWebEngineViewPrivate;
-
-class Q_WEBENGINE_EXPORT QQuickWebEngineHistoryListModel : public QAbstractListModel {
- Q_OBJECT
-
-public:
- QQuickWebEngineHistoryListModel(QQuickWebEngineHistoryListModelPrivate*);
- virtual ~QQuickWebEngineHistoryListModel();
-
- int rowCount(const QModelIndex& parent = QModelIndex()) const;
- QVariant data(const QModelIndex& index, int role) const;
- QHash<int, QByteArray> roleNames() const;
- void reset();
-
-private:
- QQuickWebEngineHistoryListModel();
-
- Q_DECLARE_PRIVATE(QQuickWebEngineHistoryListModel)
- QScopedPointer<QQuickWebEngineHistoryListModelPrivate> d_ptr;
-
- friend class QQuickWebEngineHistory;
-};
-
-class Q_WEBENGINE_EXPORT QQuickWebEngineHistory : public QQuickItem {
- Q_OBJECT
- Q_PROPERTY(QQuickWebEngineHistoryListModel *items READ items CONSTANT FINAL)
- Q_PROPERTY(QQuickWebEngineHistoryListModel *backItems READ backItems CONSTANT FINAL)
- Q_PROPERTY(QQuickWebEngineHistoryListModel *forwardItems READ forwardItems CONSTANT FINAL)
-
-public:
- QQuickWebEngineHistory(QQuickWebEngineViewPrivate*);
- virtual ~QQuickWebEngineHistory();
-
- enum NavigationHistoryRoles {
- UrlRole = Qt::UserRole + 1,
- TitleRole = Qt::UserRole + 2,
- OffsetRole = Qt::UserRole + 3,
- IconUrlRole = Qt::UserRole + 4,
- };
-
- QQuickWebEngineHistoryListModel *items() const;
- QQuickWebEngineHistoryListModel *backItems() const;
- QQuickWebEngineHistoryListModel *forwardItems() const;
- Q_REVISION(1) Q_INVOKABLE void clear();
-
- void reset();
-
-private:
- QQuickWebEngineHistory();
-
- Q_DECLARE_PRIVATE(QQuickWebEngineHistory)
- QScopedPointer<QQuickWebEngineHistoryPrivate> d_ptr;
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QQuickWebEngineHistory)
-
-#endif // QQUICKWEBENGINEHISTORY_P_H
diff --git a/src/webengine/api/qquickwebenginehistory_p_p.h b/src/webengine/api/qquickwebenginehistory_p_p.h
deleted file mode 100644
index 019c6f0ad..000000000
--- a/src/webengine/api/qquickwebenginehistory_p_p.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKWEBENGINEHISTORY_P_P_H
-#define QQUICKWEBENGINEHISTORY_P_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-namespace QtWebEngineCore {
-class WebContentsAdapter;
-}
-
-QT_BEGIN_NAMESPACE
-class QQuickWebEngineHistoryListModel;
-class QQuickWebEngineViewPrivate;
-
-class QQuickWebEngineHistoryListModelPrivate {
-public:
- QQuickWebEngineHistoryListModelPrivate(QQuickWebEngineViewPrivate*);
- virtual ~QQuickWebEngineHistoryListModelPrivate();
-
- virtual int count() const;
- virtual int index(int) const;
- virtual int offsetForIndex(int) const;
-
- QtWebEngineCore::WebContentsAdapter *adapter() const;
-
- QQuickWebEngineViewPrivate *view;
-};
-
-class QQuickWebEngineBackHistoryListModelPrivate : public QQuickWebEngineHistoryListModelPrivate {
-public:
- QQuickWebEngineBackHistoryListModelPrivate(QQuickWebEngineViewPrivate*);
-
- int count() const override;
- int index(int) const override;
- int offsetForIndex(int) const override;
-};
-
-class QQuickWebEngineForwardHistoryListModelPrivate : public QQuickWebEngineHistoryListModelPrivate {
-public:
- QQuickWebEngineForwardHistoryListModelPrivate(QQuickWebEngineViewPrivate*);
-
- int count() const override;
- int index(int) const override;
- int offsetForIndex(int) const override;
-};
-
-class QQuickWebEngineHistoryPrivate {
-public:
- QQuickWebEngineHistoryPrivate(QQuickWebEngineViewPrivate*);
- ~QQuickWebEngineHistoryPrivate();
-
- QQuickWebEngineViewPrivate *m_view;
- mutable QScopedPointer<QQuickWebEngineHistoryListModel> m_navigationModel;
- mutable QScopedPointer<QQuickWebEngineHistoryListModel> m_backNavigationModel;
- mutable QScopedPointer<QQuickWebEngineHistoryListModel> m_forwardNavigationModel;
-};
-
-QT_END_NAMESPACE
-
-#endif // QQUICKWEBENGINEHISTORY_P_P_H
diff --git a/src/webengine/api/qquickwebengineloadrequest.cpp b/src/webengine/api/qquickwebengineloadrequest.cpp
deleted file mode 100644
index 5ad99ea2e..000000000
--- a/src/webengine/api/qquickwebengineloadrequest.cpp
+++ /dev/null
@@ -1,159 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <qquickwebengineloadrequest_p.h>
-
-QT_BEGIN_NAMESPACE
-
-class QQuickWebEngineLoadRequestPrivate {
-public:
- QQuickWebEngineLoadRequestPrivate(const QUrl& url, QQuickWebEngineView::LoadStatus status, const QString& errorString, int errorCode, QQuickWebEngineView::ErrorDomain errorDomain)
- : url(url)
- , status(status)
- , errorString(errorString)
- , errorCode(errorCode)
- , errorDomain(errorDomain)
- {
- }
-
- QUrl url;
- QQuickWebEngineView::LoadStatus status;
- QString errorString;
- int errorCode;
- QQuickWebEngineView::ErrorDomain errorDomain;
-};
-
-/*!
- \qmltype WebEngineLoadRequest
- \instantiates QQuickWebEngineLoadRequest
- \inqmlmodule QtWebEngine
- \since QtWebEngine 1.0
-
- \brief A utility type for the WebEngineView::loadingChanged signal.
-
- Contains information about a request for loading a web page, such as the URL and
- current loading status (started, succeeded, failed).
-
- \sa WebEngineView::loadingChanged
-*/
-QQuickWebEngineLoadRequest::QQuickWebEngineLoadRequest(const QUrl& url, QQuickWebEngineView::LoadStatus status, const QString& errorString, int errorCode, QQuickWebEngineView::ErrorDomain errorDomain, QObject* parent)
- : QObject(parent)
- , d_ptr(new QQuickWebEngineLoadRequestPrivate(url, status, errorString, errorCode, errorDomain))
-{
-}
-
-QQuickWebEngineLoadRequest::~QQuickWebEngineLoadRequest()
-{
-}
-
-/*!
- \qmlproperty url WebEngineLoadRequest::url
- \brief Holds the URL of the load request.
- */
-QUrl QQuickWebEngineLoadRequest::url() const
-{
- Q_D(const QQuickWebEngineLoadRequest);
- return d->url;
-}
-
-/*!
- \qmlproperty enumeration WebEngineLoadRequest::status
-
- This enumeration represents the load status of a web page load request:
-
- \value WebEngineLoadRequest.LoadStartedStatus Page is currently loading.
- \value WebEngineLoadRequest.LoadSucceededStatus
- Page has been loaded with success.
- \value WebEngineLoadRequest.LoadFailedStatus Page could not be loaded.
-
- \sa WebEngineView::loadingChanged
-*/
-QQuickWebEngineView::LoadStatus QQuickWebEngineLoadRequest::status() const
-{
- Q_D(const QQuickWebEngineLoadRequest);
- return d->status;
-}
-
-/*!
- \qmlproperty string WebEngineLoadRequest::errorString
- \brief Holds the error message.
-*/
-QString QQuickWebEngineLoadRequest::errorString() const
-{
- Q_D(const QQuickWebEngineLoadRequest);
- return d->errorString;
-}
-
-/*!
- \qmlproperty enumeration WebEngineLoadRequest::errorDomain
- This enumeration holds the type of a load request error:
-
- \value WebEngineView.NoErrorDomain
- Error type is not known.
- \value WebEngineView.InternalErrorDomain
- Content cannot be interpreted by \QWE.
- \value WebEngineView.ConnectionErrorDomain
- Error results from a faulty network connection.
- \value WebEngineView.CertificateErrorDomain
- Error is related to the SSL/TLS certificate.
- \value WebEngineView.HttpErrorDomain
- Error is related to the HTTP connection.
- \value WebEngineView.FtpErrorDomain
- Error is related to the FTP connection.
- \value WebEngineView.DnsErrorDomain
- Error is related to the DNS connection.
-*/
-
-QQuickWebEngineView::ErrorDomain QQuickWebEngineLoadRequest::errorDomain() const
-{
- Q_D(const QQuickWebEngineLoadRequest);
- return d->errorDomain;
-}
-
-/*!
- \qmlproperty int WebEngineLoadRequest::errorCode
- \brief Holds the error code.
-*/
-int QQuickWebEngineLoadRequest::errorCode() const
-{
- Q_D(const QQuickWebEngineLoadRequest);
- return d->errorCode;
-}
-
-QT_END_NAMESPACE
diff --git a/src/webengine/api/qquickwebengineloadrequest_p.h b/src/webengine/api/qquickwebengineloadrequest_p.h
deleted file mode 100644
index 6d8dd8061..000000000
--- a/src/webengine/api/qquickwebengineloadrequest_p.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKWEBENGINELOADREQUEST_P_H
-#define QQUICKWEBENGINELOADREQUEST_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtWebEngine/private/qtwebengineglobal_p.h>
-#include "qquickwebengineview_p.h"
-
-QT_BEGIN_NAMESPACE
-
-class QQuickWebEngineLoadRequestPrivate;
-
-class Q_WEBENGINE_EXPORT QQuickWebEngineLoadRequest : public QObject {
- Q_OBJECT
- Q_PROPERTY(QUrl url READ url CONSTANT FINAL)
- Q_PROPERTY(QQuickWebEngineView::LoadStatus status READ status CONSTANT FINAL)
- Q_PROPERTY(QString errorString READ errorString CONSTANT FINAL)
- Q_PROPERTY(QQuickWebEngineView::ErrorDomain errorDomain READ errorDomain CONSTANT FINAL)
- Q_PROPERTY(int errorCode READ errorCode CONSTANT FINAL)
-
-public:
- QQuickWebEngineLoadRequest(const QUrl& url, QQuickWebEngineView::LoadStatus status, const QString& errorString = QString(), int errorCode = 0, QQuickWebEngineView::ErrorDomain errorDomain = QQuickWebEngineView::NoErrorDomain, QObject* parent = 0);
- ~QQuickWebEngineLoadRequest();
- QUrl url() const;
- QQuickWebEngineView::LoadStatus status() const;
- QString errorString() const;
- QQuickWebEngineView::ErrorDomain errorDomain() const;
- int errorCode() const;
-
-private:
- Q_DECLARE_PRIVATE(QQuickWebEngineLoadRequest)
- QScopedPointer<QQuickWebEngineLoadRequestPrivate> d_ptr;
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QQuickWebEngineLoadRequest)
-
-#endif // QQUICKWEBENGINELOADREQUEST_P_H
diff --git a/src/webengine/api/qquickwebenginenavigationrequest.cpp b/src/webengine/api/qquickwebenginenavigationrequest.cpp
deleted file mode 100644
index 03c1d3d78..000000000
--- a/src/webengine/api/qquickwebenginenavigationrequest.cpp
+++ /dev/null
@@ -1,171 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickwebenginenavigationrequest_p.h"
-
-#include "qquickwebengineview_p.h"
-
-QT_BEGIN_NAMESPACE
-
-class QQuickWebEngineNavigationRequestPrivate {
-public:
- QQuickWebEngineNavigationRequestPrivate(const QUrl& url, QQuickWebEngineView::NavigationType navigationType, bool mainFrame)
- : url(url)
- , action(QQuickWebEngineView::AcceptRequest)
- , navigationType(navigationType)
- , isMainFrame(mainFrame)
- {
- }
-
- ~QQuickWebEngineNavigationRequestPrivate()
- {
- }
-
- QUrl url;
- QQuickWebEngineView::NavigationRequestAction action;
- QQuickWebEngineView::NavigationType navigationType;
- bool isMainFrame;
-};
-
-/*!
- \qmltype WebEngineNavigationRequest
- \instantiates QQuickWebEngineNavigationRequest
- \inqmlmodule QtWebEngine
- \since QtWebEngine 1.0
-
- \brief Represents a request for navigating to a web page as part of
- \l{WebEngineView::navigationRequested()}.
-
- To accept or reject a request, set \l action to
- \c WebEngineNavigationRequest.AcceptRequest or
- \c WebEngineNavigationRequest.IgnoreRequest.
-*/
-
-QQuickWebEngineNavigationRequest::QQuickWebEngineNavigationRequest(const QUrl& url, QQuickWebEngineView::NavigationType navigationType, bool mainFrame, QObject* parent)
- : QObject(parent)
- , d_ptr(new QQuickWebEngineNavigationRequestPrivate(url, navigationType, mainFrame))
-{
-}
-
-QQuickWebEngineNavigationRequest::~QQuickWebEngineNavigationRequest()
-{
-}
-
-/*!
- \qmlproperty enumeration WebEngineNavigationRequest::action
-
- Whether to accept or ignore the navigation request.
-
- \value WebEngineNavigationRequest.AcceptRequest
- Accepts a navigation request.
- \value WebEngineNavigationRequest.IgnoreRequest
- Ignores a navigation request.
-*/
-
-void QQuickWebEngineNavigationRequest::setAction(QQuickWebEngineView::NavigationRequestAction action)
-{
- Q_D(QQuickWebEngineNavigationRequest);
- if (d->action == action)
- return;
-
- d->action = action;
- emit actionChanged();
-}
-
-/*!
- \qmlproperty url WebEngineNavigationRequest::url
- \readonly
-
- The URL of the web page to go to.
-*/
-
-QUrl QQuickWebEngineNavigationRequest::url() const
-{
- Q_D(const QQuickWebEngineNavigationRequest);
- return d->url;
-}
-
-QQuickWebEngineView::NavigationRequestAction QQuickWebEngineNavigationRequest::action() const
-{
- Q_D(const QQuickWebEngineNavigationRequest);
- return d->action;
-}
-
-/*!
- \qmlproperty enumeration WebEngineNavigationRequest::navigationType
- \readonly
-
- The method used to navigate to a web page.
-
- \value WebEngineNavigationRequest.LinkClickedNavigation
- Clicking a link.
- \value WebEngineNavigationRequest.TypedNavigation
- Entering an URL on the address bar.
- \value WebEngineNavigationRequest.FormSubmittedNavigation
- Submitting a form.
- \value WebEngineNavigationRequest.BackForwardNavigation
- Using navigation history to go to the previous or next page.
- \value WebEngineNavigationRequest.ReloadNavigation
- Reloading the page.
- \value WebEngineNavigationRequest.RedirectNavigation
- Page content or server triggered a redirection or page refresh.
- \value WebEngineNavigationRequest.OtherNavigation
- Using some other method to go to a page.
-*/
-
-QQuickWebEngineView::NavigationType QQuickWebEngineNavigationRequest::navigationType() const
-{
- Q_D(const QQuickWebEngineNavigationRequest);
- return d->navigationType;
-}
-
-/*!
- \qmlproperty bool WebEngineNavigationRequest::isMainFrame
- \readonly
-
- Whether the navigation issue is requested for a top level page.
-*/
-
-bool QQuickWebEngineNavigationRequest::isMainFrame() const
-{
- Q_D(const QQuickWebEngineNavigationRequest);
- return d->isMainFrame;
-}
-
-QT_END_NAMESPACE
diff --git a/src/webengine/api/qquickwebenginenavigationrequest_p.h b/src/webengine/api/qquickwebenginenavigationrequest_p.h
deleted file mode 100644
index 55e3ca673..000000000
--- a/src/webengine/api/qquickwebenginenavigationrequest_p.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKWEBENGINENAVIGATIONREQUEST_P_H
-#define QQUICKWEBENGINENAVIGATIONREQUEST_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "qquickwebengineview_p.h"
-
-#include <QtCore/QObject>
-#include <QtCore/QUrl>
-
-QT_BEGIN_NAMESPACE
-
-class QQuickWebEngineNavigationRequestPrivate;
-
-class Q_WEBENGINE_EXPORT QQuickWebEngineNavigationRequest : public QObject {
- Q_OBJECT
- Q_PROPERTY(QUrl url READ url CONSTANT FINAL)
- Q_PROPERTY(bool isMainFrame READ isMainFrame CONSTANT FINAL)
- Q_PROPERTY(QQuickWebEngineView::NavigationRequestAction action READ action WRITE setAction NOTIFY actionChanged FINAL)
- Q_PROPERTY(QQuickWebEngineView::NavigationType navigationType READ navigationType CONSTANT FINAL)
-
-public:
- QQuickWebEngineNavigationRequest(const QUrl& url, QQuickWebEngineView::NavigationType navigationType, bool mainFrame, QObject* parent = 0);
- ~QQuickWebEngineNavigationRequest();
-
- QUrl url() const;
- bool isMainFrame() const;
- QQuickWebEngineView::NavigationRequestAction action() const;
-
- void setAction(QQuickWebEngineView::NavigationRequestAction action);
- QQuickWebEngineView::NavigationType navigationType() const;
-
-Q_SIGNALS:
- void actionChanged();
-
-private:
- Q_DECLARE_PRIVATE(QQuickWebEngineNavigationRequest)
- QScopedPointer<QQuickWebEngineNavigationRequestPrivate> d_ptr;
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QQuickWebEngineNavigationRequest)
-
-#endif // QQUICKWEBENGINENAVIGATIONREQUEST_P_H
diff --git a/src/webengine/api/qquickwebenginenewviewrequest.cpp b/src/webengine/api/qquickwebenginenewviewrequest.cpp
deleted file mode 100644
index 0af943de8..000000000
--- a/src/webengine/api/qquickwebenginenewviewrequest.cpp
+++ /dev/null
@@ -1,121 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickwebenginenewviewrequest_p.h"
-
-#include "qquickwebengineview_p_p.h"
-#include "web_contents_adapter.h"
-
-/*!
- \qmltype WebEngineNewViewRequest
- \instantiates QQuickWebEngineNewViewRequest
- \inqmlmodule QtWebEngine
- \since QtWebEngine 1.1
-
- \brief A utility type for the WebEngineView::newViewRequested signal.
-
- Contains information about a request to load a page in a separate web engine view.
-
- \sa WebEngineView::newViewRequested
-*/
-QQuickWebEngineNewViewRequest::QQuickWebEngineNewViewRequest()
-{
-}
-
-QQuickWebEngineNewViewRequest::~QQuickWebEngineNewViewRequest()
-{
-}
-
-/*!
- \qmlproperty WebEngineView::NewViewDestination WebEngineNewViewRequest::destination
- The type of the view that is requested by the page.
- */
-QQuickWebEngineView::NewViewDestination QQuickWebEngineNewViewRequest::destination() const
-{
- return m_destination;
-}
-
-/*!
- \qmlproperty QUrl WebEngineNewViewRequest::requestedUrl
- The URL that is requested by the page.
- \since QtWebEngine 1.5
- */
-QUrl QQuickWebEngineNewViewRequest::requestedUrl() const
-{
- return m_requestedUrl;
-}
-
-/*!
- \qmlproperty bool WebEngineNewViewRequest::userInitiated
- Whether this window request was directly triggered as the result of a keyboard or mouse event.
-
- Use this property to block possibly unwanted \e popups.
- */
-bool QQuickWebEngineNewViewRequest::isUserInitiated() const
-{
- return m_isUserInitiated;
-}
-
-/*!
- \qmlmethod WebEngineNewViewRequest::openIn(WebEngineView view)
-
- Opens the requested page in the new web engine view \a view. State and history of the
- view and the page possibly loaded in it will be lost.
-
- \sa WebEngineView::newViewRequested
- */
-void QQuickWebEngineNewViewRequest::openIn(QQuickWebEngineView *view)
-{
- if (!m_adapter && !m_requestedUrl.isValid()) {
- qWarning("Trying to open an empty request, it was either already used or was invalidated."
- "\nYou must complete the request synchronously within the newViewRequested signal handler."
- " If a view hasn't been adopted before returning, the request will be invalidated.");
- return;
- }
-
- if (!view) {
- qWarning("Trying to open a WebEngineNewViewRequest in an invalid WebEngineView.");
- return;
- }
- if (m_adapter)
- view->d_func()->adoptWebContents(m_adapter.data());
- else
- view->setUrl(m_requestedUrl);
- m_adapter.reset();
-}
diff --git a/src/webengine/api/qquickwebenginenewviewrequest_p.h b/src/webengine/api/qquickwebenginenewviewrequest_p.h
deleted file mode 100644
index e21f76111..000000000
--- a/src/webengine/api/qquickwebenginenewviewrequest_p.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKWEBENGINENEWVIEWREQUEST_P_H
-#define QQUICKWEBENGINENEWVIEWREQUEST_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtWebEngine/private/qtwebengineglobal_p.h>
-#include "qquickwebengineview_p.h"
-
-namespace QtWebEngineCore {
-class WebContentsAdapter;
-}
-
-QT_BEGIN_NAMESPACE
-
-class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineNewViewRequest : public QObject {
- Q_OBJECT
- Q_PROPERTY(QQuickWebEngineView::NewViewDestination destination READ destination CONSTANT FINAL)
- Q_PROPERTY(QUrl requestedUrl READ requestedUrl CONSTANT REVISION 1 FINAL)
- Q_PROPERTY(bool userInitiated READ isUserInitiated CONSTANT FINAL)
-public:
- ~QQuickWebEngineNewViewRequest();
-
- QQuickWebEngineView::NewViewDestination destination() const;
- QUrl requestedUrl() const;
- bool isUserInitiated() const;
- Q_INVOKABLE void openIn(QQuickWebEngineView *view);
-
-private:
- QQuickWebEngineNewViewRequest();
- QQuickWebEngineView::NewViewDestination m_destination;
- bool m_isUserInitiated;
- QSharedPointer<QtWebEngineCore::WebContentsAdapter> m_adapter;
- QUrl m_requestedUrl;
- friend class QQuickWebEngineView;
- friend class QQuickWebEngineViewPrivate;
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QQuickWebEngineNewViewRequest)
-
-#endif // QQUICKWEBENGINENEWVIEWREQUEST_P_H
diff --git a/src/webengine/api/qquickwebengineprofile.cpp b/src/webengine/api/qquickwebengineprofile.cpp
deleted file mode 100644
index 834bb6a05..000000000
--- a/src/webengine/api/qquickwebengineprofile.cpp
+++ /dev/null
@@ -1,1106 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickwebengineprofile.h"
-
-#include "qquickwebenginedownloaditem_p.h"
-#include "qquickwebenginedownloaditem_p_p.h"
-#include "qquickwebengineprofile_p.h"
-#include "qquickwebenginescript_p.h"
-#include "qquickwebenginesettings_p.h"
-#include "qquickwebengineview_p_p.h"
-#include "qwebenginecookiestore.h"
-#include "qwebenginenotification.h"
-
-#include <QFileInfo>
-#include <QDir>
-#include <QQmlEngine>
-
-#include "profile_adapter.h"
-#include "renderer_host/user_resource_controller_host.h"
-#include "web_engine_settings.h"
-
-#include <QtWebEngineCore/qwebengineurlscheme.h>
-
-using QtWebEngineCore::ProfileAdapter;
-
-QT_BEGIN_NAMESPACE
-
-ASSERT_ENUMS_MATCH(QQuickWebEngineDownloadItem::UnknownSaveFormat, QtWebEngineCore::ProfileAdapterClient::UnknownSavePageFormat)
-ASSERT_ENUMS_MATCH(QQuickWebEngineDownloadItem::SingleHtmlSaveFormat, QtWebEngineCore::ProfileAdapterClient::SingleHtmlSaveFormat)
-ASSERT_ENUMS_MATCH(QQuickWebEngineDownloadItem::CompleteHtmlSaveFormat, QtWebEngineCore::ProfileAdapterClient::CompleteHtmlSaveFormat)
-ASSERT_ENUMS_MATCH(QQuickWebEngineDownloadItem::MimeHtmlSaveFormat, QtWebEngineCore::ProfileAdapterClient::MimeHtmlSaveFormat)
-
-/*!
- \class QQuickWebEngineProfile
- \brief The QQuickWebEngineProfile class provides a web engine profile shared by multiple pages.
- \since 5.6
-
- \inmodule QtWebEngine
-
- A web engine profile contains settings, scripts, persistent cookie policy, and the list of
- visited links shared by all web engine pages that belong to the profile.
-
- Information about visited links is stored together with persistent cookies
- and other persistent data in a storage determined by the storageName
- property. Persistent data is stored in a subdirectory determined by the
- persistentStoragePath property and the cache in a subdirectory determined by
- the cachePath property. The httpCacheType property describes the type of the
- cache: \e in-memory or \e on-disk. If only the storageName property is set,
- the other values are generated automatically based on it. If you specify
- any of the values manually, you should do it before creating any pages that
- belong to the profile.
-
- Profiles can be used to isolate pages from each other. A typical use case is a dedicated
- \e {off-the-record profile} for a \e {private browsing} mode. An off-the-record profile forces
- cookies, the HTTP cache, and other normally persistent data to be stored only in memory. The
- offTheRecord property holds whether a profile is off-the-record.
-
- The default profile can be accessed by defaultProfile(). It is a built-in profile that all
- web pages not specifically created with another profile belong to.
-
- A WebEngineProfile instance can be created and accessed from C++ through the
- QQuickWebEngineProfile class, which exposes further functionality in C++. This allows Qt Quick
- applications to intercept URL requests (QQuickWebEngineProfile::setRequestInterceptor), or
- register custom URL schemes (QQuickWebEngineProfile::installUrlSchemeHandler).
-
- Spellchecking HTML form fields can be enabled per profile by setting the \l spellCheckEnabled
- property and the current languages used for spellchecking can be set by using the
- \l spellCheckLanguages property.
-*/
-
-/*!
- \enum QQuickWebEngineProfile::HttpCacheType
-
- This enum describes the HTTP cache type:
-
- \value MemoryHttpCache Use an in-memory cache. This is the default if
- \c off-the-record is set.
- \value DiskHttpCache Use a disk cache. This is the default if \c off-the-record
- is not set. Falls back to \c MemoryHttpCache if \c off-the-record is set.
- \value NoCache Disable both in-memory and disk caching. (Added in Qt 5.7)
-*/
-
-/*!
- \enum QQuickWebEngineProfile::PersistentCookiesPolicy
-
- This enum describes policy for cookie persistency:
-
- \value NoPersistentCookies
- Both session and persistent cookies are stored in memory. This is the only setting
- possible if \c off-the-record is set or no persistent data path is available.
- \value AllowPersistentCookies
- Cookies marked persistent are saved to and restored from disk, whereas session cookies
- are only stored to disk for crash recovery. This is the default setting.
- \value ForcePersistentCookies
- Both session and persistent cookies are saved to and restored from disk.
-*/
-
-/*!
- \fn QQuickWebEngineProfile::downloadRequested(QQuickWebEngineDownloadItem *download)
-
- This signal is emitted whenever a download has been triggered.
- The \a download argument holds the state of the download.
- The download has to be explicitly accepted with
- \c{QQuickWebEngineDownloadItem::accept()} or it will be
- cancelled by default.
- The download item is parented by the profile. If it is not accepted, it
- will be deleted immediately after the signal emission.
- This signal cannot be used with a queued connection.
-*/
-
-/*!
- \fn QQuickWebEngineProfile::downloadFinished(QQuickWebEngineDownloadItem *download)
-
- This signal is emitted whenever downloading stops, because it finished successfully, was
- cancelled, or was interrupted (for example, because connectivity was lost).
- The \a download argument holds the state of the finished download instance.
-*/
-
-/*!
- \fn QQuickWebEngineProfile::presentNotification(QWebEngineNotification *notification)
-
- This signal is emitted whenever there is a newly created user notification.
- The \a notification argument holds the \l {QWebEngineNotification} instance
- to query data and interact with.
-
- \sa WebEngineProfile::presentNotification
-*/
-
-QQuickWebEngineProfilePrivate::QQuickWebEngineProfilePrivate(ProfileAdapter *profileAdapter)
- : m_settings(new QQuickWebEngineSettings())
- , m_profileAdapter(profileAdapter)
-{
- profileAdapter->addClient(this);
- m_settings->d_ptr->initDefaults();
- // Fullscreen API was implemented before the supported setting, so we must
- // make it default true to avoid change in default API behavior.
- m_settings->d_ptr->setAttribute(QtWebEngineCore::WebEngineSettings::FullScreenSupportEnabled, true);
-}
-
-QQuickWebEngineProfilePrivate::~QQuickWebEngineProfilePrivate()
-{
- if (m_profileAdapter) {
- // In the case the user sets this profile as the parent of the interceptor
- // it can be deleted before the browser-context still referencing it is.
- m_profileAdapter->setRequestInterceptor(nullptr);
- m_profileAdapter->removeClient(this);
- }
-
- if (m_profileAdapter != QtWebEngineCore::ProfileAdapter::defaultProfileAdapter())
- delete m_profileAdapter;
-}
-
-void QQuickWebEngineProfilePrivate::addWebContentsAdapterClient(QtWebEngineCore::WebContentsAdapterClient *adapter)
-{
- Q_ASSERT(m_profileAdapter);
- m_profileAdapter->addWebContentsAdapterClient(adapter);
-}
-
-void QQuickWebEngineProfilePrivate::removeWebContentsAdapterClient(QtWebEngineCore::WebContentsAdapterClient*adapter)
-{
- Q_ASSERT(m_profileAdapter);
- m_profileAdapter->removeWebContentsAdapterClient(adapter);
-}
-
-QtWebEngineCore::ProfileAdapter *QQuickWebEngineProfilePrivate::profileAdapter() const
-{
- return m_profileAdapter;
-}
-
-QQuickWebEngineSettings *QQuickWebEngineProfilePrivate::settings() const
-{
- return m_settings.data();
-}
-
-void QQuickWebEngineProfilePrivate::cancelDownload(quint32 downloadId)
-{
- if (m_profileAdapter)
- m_profileAdapter->cancelDownload(downloadId);
-}
-
-void QQuickWebEngineProfilePrivate::downloadDestroyed(quint32 downloadId)
-{
- m_ongoingDownloads.remove(downloadId);
- if (m_profileAdapter)
- m_profileAdapter->removeDownload(downloadId);
-}
-
-void QQuickWebEngineProfilePrivate::cleanDownloads()
-{
- for (auto download : m_ongoingDownloads.values()) {
- if (!download)
- continue;
-
- if (!download->isFinished())
- download->cancel();
-
- if (m_profileAdapter)
- m_profileAdapter->removeDownload(download->id());
- }
- m_ongoingDownloads.clear();
-}
-
-void QQuickWebEngineProfilePrivate::downloadRequested(DownloadItemInfo &info)
-{
- Q_Q(QQuickWebEngineProfile);
-
- Q_ASSERT(!m_ongoingDownloads.contains(info.id));
- QQuickWebEngineDownloadItemPrivate *itemPrivate = new QQuickWebEngineDownloadItemPrivate(q, info.url);
- itemPrivate->downloadId = info.id;
- itemPrivate->downloadState = QQuickWebEngineDownloadItem::DownloadRequested;
- itemPrivate->startTime = info.startTime;
- itemPrivate->totalBytes = info.totalBytes;
- itemPrivate->mimeType = info.mimeType;
- itemPrivate->downloadDirectory = QFileInfo(info.path).path();
- itemPrivate->downloadFileName = QFileInfo(info.path).fileName();
- itemPrivate->suggestedFileName = info.suggestedFileName;
- itemPrivate->savePageFormat = static_cast<QQuickWebEngineDownloadItem::SavePageFormat>(
- info.savePageFormat);
- itemPrivate->type = static_cast<QQuickWebEngineDownloadItem::DownloadType>(info.downloadType);
- if (info.page && info.page->clientType() == QtWebEngineCore::WebContentsAdapterClient::QmlClient)
- itemPrivate->view = static_cast<QQuickWebEngineViewPrivate *>(info.page)->q_ptr;
- else
- itemPrivate->view = nullptr;
-
- QQuickWebEngineDownloadItem *download = new QQuickWebEngineDownloadItem(itemPrivate, q);
-
- m_ongoingDownloads.insert(info.id, download);
- QObject::connect(download, &QQuickWebEngineDownloadItem::destroyed, q, [id = info.id, this] () { downloadDestroyed(id); });
-
- QQmlEngine::setObjectOwnership(download, QQmlEngine::JavaScriptOwnership);
- Q_EMIT q->downloadRequested(download);
-
- QQuickWebEngineDownloadItem::DownloadState state = download->state();
- info.path = QDir(download->downloadDirectory()).filePath(download->downloadFileName());
- info.savePageFormat = itemPrivate->savePageFormat;
- info.accepted = state != QQuickWebEngineDownloadItem::DownloadCancelled
- && state != QQuickWebEngineDownloadItem::DownloadRequested;
-
- if (state == QQuickWebEngineDownloadItem::DownloadRequested) {
- // Delete unaccepted downloads.
- info.accepted = false;
- delete download;
- }
-}
-
-void QQuickWebEngineProfilePrivate::downloadUpdated(const DownloadItemInfo &info)
-{
- if (!m_ongoingDownloads.contains(info.id))
- return;
-
- Q_Q(QQuickWebEngineProfile);
-
- QQuickWebEngineDownloadItem* download = m_ongoingDownloads.value(info.id).data();
-
- if (!download) {
- downloadDestroyed(info.id);
- return;
- }
-
- download->d_func()->update(info);
-
- if (info.state != ProfileAdapterClient::DownloadInProgress) {
- Q_EMIT q->downloadFinished(download);
- }
-}
-
-void QQuickWebEngineProfilePrivate::useForGlobalCertificateVerificationChanged()
-{
- Q_Q(QQuickWebEngineProfile);
- Q_EMIT q->useForGlobalCertificateVerificationChanged();
-}
-
-void QQuickWebEngineProfilePrivate::showNotification(QSharedPointer<QtWebEngineCore::UserNotificationController> &controller)
-{
- Q_Q(QQuickWebEngineProfile);
- auto notification = new QWebEngineNotification(controller);
- QQmlEngine::setObjectOwnership(notification, QQmlEngine::JavaScriptOwnership);
- Q_EMIT q->presentNotification(notification);
-}
-
-void QQuickWebEngineProfilePrivate::userScripts_append(QQmlListProperty<QQuickWebEngineScript> *p, QQuickWebEngineScript *script)
-{
- Q_ASSERT(p && p->data);
- QQuickWebEngineProfilePrivate *d = static_cast<QQuickWebEngineProfilePrivate *>(p->data);
- QtWebEngineCore::UserResourceControllerHost *resourceController = d->profileAdapter()->userResourceController();
- d->m_userScripts.append(script);
- script->d_func()->bind(resourceController);
-}
-
-int QQuickWebEngineProfilePrivate::userScripts_count(QQmlListProperty<QQuickWebEngineScript> *p)
-{
- Q_ASSERT(p && p->data);
- QQuickWebEngineProfilePrivate *d = static_cast<QQuickWebEngineProfilePrivate *>(p->data);
- return d->m_userScripts.count();
-}
-
-QQuickWebEngineScript *QQuickWebEngineProfilePrivate::userScripts_at(QQmlListProperty<QQuickWebEngineScript> *p, int idx)
-{
- Q_ASSERT(p && p->data);
- QQuickWebEngineProfilePrivate *d = static_cast<QQuickWebEngineProfilePrivate *>(p->data);
- return d->m_userScripts.at(idx);
-}
-
-void QQuickWebEngineProfilePrivate::userScripts_clear(QQmlListProperty<QQuickWebEngineScript> *p)
-{
- Q_ASSERT(p && p->data);
- QQuickWebEngineProfilePrivate *d = static_cast<QQuickWebEngineProfilePrivate *>(p->data);
- QtWebEngineCore::UserResourceControllerHost *resourceController = d->profileAdapter()->userResourceController();
- resourceController->clearAllScripts(NULL);
- d->m_userScripts.clear();
-}
-
-/*!
- \qmltype WebEngineProfile
- \instantiates QQuickWebEngineProfile
- \inqmlmodule QtWebEngine
- \since QtWebEngine 1.1
- \brief Contains settings, scripts, and visited links common to multiple web engine views.
-
- WebEngineProfile contains settings, scripts, and the list of visited links shared by all
- views that belong to the profile.
-
- Information about visited links is stored together with persistent cookies
- and other persistent data in a storage determined by the storageName
- property. Persistent data is stored in a subdirectory determined by the
- persistentStoragePath property and the cache in a subdirectory determined by
- the cachePath property. The httpCacheType property describes the type of the
- cache: \e in-memory or \e on-disk. If only the storageName property is set,
- the other values are generated automatically based on it. If you specify
- any of the values manually, you should do it before creating any pages that
- belong to the profile.
-
- Profiles can be used to isolate pages from each other. A typical use case is
- a dedicated \e {off-the-record profile} for a \e {private browsing} mode. An
- off-the-record profile forces cookies, the HTTP cache, and other normally
- persistent data to be stored only in memory. The offTheRecord property holds
- whether a profile is off-the-record.
-
- Each web engine view has an associated profile. Views that do not have a specific profile set
- share a common default one.
-*/
-
-/*!
- \qmlsignal WebEngineProfile::downloadRequested(WebEngineDownloadItem download)
-
- This signal is emitted whenever a download has been triggered.
- The \a download argument holds the state of the download.
- The download has to be explicitly accepted with WebEngineDownloadItem::accept() or the
- download will be cancelled by default.
-*/
-
-/*!
- \qmlsignal WebEngineProfile::downloadFinished(WebEngineDownloadItem download)
-
- This signal is emitted whenever downloading stops, because it finished successfully, was
- cancelled, or was interrupted (for example, because connectivity was lost).
- The \a download argument holds the state of the finished download instance.
-*/
-
-/*!
- \qmlsignal WebEngineProfile::presentNotification(WebEngineNotification notification)
- \since QtWebEngine 1.9
-
- This signal is emitted whenever there is a newly created user notification.
- The \a notification argument holds the \l {WebEngineNotification} instance
- to query data and interact with.
-*/
-
-/*!
- Constructs a new profile with the parent \a parent.
-*/
-QQuickWebEngineProfile::QQuickWebEngineProfile(QObject *parent)
- : QObject(parent),
- d_ptr(new QQuickWebEngineProfilePrivate(new QtWebEngineCore::ProfileAdapter()))
-{
- d_ptr->q_ptr = this;
-}
-
-QQuickWebEngineProfile::QQuickWebEngineProfile(QQuickWebEngineProfilePrivate *privatePtr, QObject *parent)
- : QObject(parent)
- , d_ptr(privatePtr)
-{
- d_ptr->q_ptr = this;
-}
-
-/*!
- \internal
-*/
-QQuickWebEngineProfile::~QQuickWebEngineProfile()
-{
- d_ptr->cleanDownloads();
-}
-
-/*!
- \qmlproperty string WebEngineProfile::storageName
-
- The storage name that is used to create separate subdirectories for each profile that uses
- the disk for storing persistent data and cache.
-
- \sa WebEngineProfile::persistentStoragePath, WebEngineProfile::cachePath
-*/
-
-/*!
- \property QQuickWebEngineProfile::storageName
-
- The storage name that is used to create separate subdirectories for each profile that uses
- the disk for storing persistent data and cache.
-
- \sa persistentStoragePath, cachePath
-*/
-
-QString QQuickWebEngineProfile::storageName() const
-{
- const Q_D(QQuickWebEngineProfile);
- return d->profileAdapter()->storageName();
-}
-
-void QQuickWebEngineProfile::setStorageName(const QString &name)
-{
- Q_D(QQuickWebEngineProfile);
- if (d->profileAdapter()->storageName() == name)
- return;
- ProfileAdapter::HttpCacheType oldCacheType = d->profileAdapter()->httpCacheType();
- ProfileAdapter::PersistentCookiesPolicy oldPolicy = d->profileAdapter()->persistentCookiesPolicy();
- d->profileAdapter()->setStorageName(name);
- emit storageNameChanged();
- emit persistentStoragePathChanged();
- emit cachePathChanged();
- if (d->profileAdapter()->httpCacheType() != oldCacheType)
- emit httpCacheTypeChanged();
- if (d->profileAdapter()->persistentCookiesPolicy() != oldPolicy)
- emit persistentCookiesPolicyChanged();
-}
-
-/*!
- \qmlproperty bool WebEngineProfile::offTheRecord
-
- Whether the web engine profile is \e off-the-record.
- An off-the-record profile forces cookies, the HTTP cache, and other normally persistent data
- to be stored only in memory.
-*/
-
-
-/*!
- \property QQuickWebEngineProfile::offTheRecord
-
- Whether the web engine profile is \e off-the-record.
- An off-the-record profile forces cookies, the HTTP cache, and other normally persistent data
- to be stored only in memory.
-*/
-
-bool QQuickWebEngineProfile::isOffTheRecord() const
-{
- const Q_D(QQuickWebEngineProfile);
- return d->profileAdapter()->isOffTheRecord();
-}
-
-void QQuickWebEngineProfile::setOffTheRecord(bool offTheRecord)
-{
- Q_D(QQuickWebEngineProfile);
- if (d->profileAdapter()->isOffTheRecord() == offTheRecord)
- return;
- ProfileAdapter::HttpCacheType oldCacheType = d->profileAdapter()->httpCacheType();
- ProfileAdapter::PersistentCookiesPolicy oldPolicy = d->profileAdapter()->persistentCookiesPolicy();
- d->profileAdapter()->setOffTheRecord(offTheRecord);
- emit offTheRecordChanged();
- if (d->profileAdapter()->httpCacheType() != oldCacheType)
- emit httpCacheTypeChanged();
- if (d->profileAdapter()->persistentCookiesPolicy() != oldPolicy)
- emit persistentCookiesPolicyChanged();
-}
-
-/*!
- \qmlproperty string WebEngineProfile::persistentStoragePath
-
- The path to the location where the persistent data for the browser and web content are
- stored. Persistent data includes persistent cookies, HTML5 local storage, and visited links.
-
- By default, the storage is located below
- QStandardPaths::writableLocation(QStandardPaths::DataLocation) in a directory named using
- storageName.
-*/
-
-/*!
- \property QQuickWebEngineProfile::persistentStoragePath
-
- The path to the location where the persistent data for the browser and web content are
- stored. Persistent data includes persistent cookies, HTML5 local storage, and visited links.
-
- By default, the storage is located below
- QStandardPaths::writableLocation(QStandardPaths::DataLocation) in a directory named using
- storageName.
-*/
-
-QString QQuickWebEngineProfile::persistentStoragePath() const
-{
- const Q_D(QQuickWebEngineProfile);
- return d->profileAdapter()->dataPath();
-}
-
-void QQuickWebEngineProfile::setPersistentStoragePath(const QString &path)
-{
- Q_D(QQuickWebEngineProfile);
- if (persistentStoragePath() == path)
- return;
- d->profileAdapter()->setDataPath(path);
- emit persistentStoragePathChanged();
-}
-
-/*!
- \qmlproperty string WebEngineProfile::cachePath
-
- The path to the location where the profile's caches are stored, in particular the HTTP cache.
-
- By default, the caches are stored
- below QStandardPaths::writableLocation(QStandardPaths::CacheLocation) in a directory named using
- storageName.
-*/
-
-/*!
- \property QQuickWebEngineProfile::cachePath
-
- The path to the location where the profile's caches are stored, in particular the HTTP cache.
-
- By default, the caches are stored
- below QStandardPaths::writableLocation(QStandardPaths::CacheLocation) in a directory named using
- storageName.
-*/
-
-QString QQuickWebEngineProfile::cachePath() const
-{
- const Q_D(QQuickWebEngineProfile);
- return d->profileAdapter()->cachePath();
-}
-
-void QQuickWebEngineProfile::setCachePath(const QString &path)
-{
- Q_D(QQuickWebEngineProfile);
- if (cachePath() == path)
- return;
- d->profileAdapter()->setCachePath(path);
- emit cachePathChanged();
-}
-
-/*!
- \qmlproperty string WebEngineProfile::httpUserAgent
-
- The user-agent string sent with HTTP to identify the browser.
-
- \note On Windows 8.1 and newer, the default user agent will always report
- "Windows NT 6.2" (Windows 8), unless the application does contain a manifest
- that declares newer Windows versions as supported.
-*/
-
-/*!
- \property QQuickWebEngineProfile::httpUserAgent
-
- The user-agent string sent with HTTP to identify the browser.
-*/
-
-QString QQuickWebEngineProfile::httpUserAgent() const
-{
- const Q_D(QQuickWebEngineProfile);
- return d->profileAdapter()->httpUserAgent();
-}
-
-void QQuickWebEngineProfile::setHttpUserAgent(const QString &userAgent)
-{
- Q_D(QQuickWebEngineProfile);
- if (d->profileAdapter()->httpUserAgent() == userAgent)
- return;
- d->profileAdapter()->setHttpUserAgent(userAgent);
- emit httpUserAgentChanged();
-}
-
-
-/*!
- \qmlproperty enumeration WebEngineProfile::httpCacheType
-
- This enumeration describes the type of the HTTP cache:
-
- \value WebEngineProfile.MemoryHttpCache
- Uses an in-memory cache. This is the only setting possible if offTheRecord is set or
- no persistentStoragePath is available.
- \value WebEngineProfile.DiskHttpCache
- Uses a disk cache. This is the default value.
- \value WebEngineProfile.NoCache
- Disables caching. (Added in 5.7)
-*/
-
-/*!
- \property QQuickWebEngineProfile::httpCacheType
-
- This enumeration describes the type of the HTTP cache.
-
- If the profile is off-the-record, MemoryHttpCache is returned.
-*/
-
-QQuickWebEngineProfile::HttpCacheType QQuickWebEngineProfile::httpCacheType() const
-{
- const Q_D(QQuickWebEngineProfile);
- return QQuickWebEngineProfile::HttpCacheType(d->profileAdapter()->httpCacheType());
-}
-
-void QQuickWebEngineProfile::setHttpCacheType(QQuickWebEngineProfile::HttpCacheType httpCacheType)
-{
- Q_D(QQuickWebEngineProfile);
- ProfileAdapter::HttpCacheType oldCacheType = d->profileAdapter()->httpCacheType();
- d->profileAdapter()->setHttpCacheType(ProfileAdapter::HttpCacheType(httpCacheType));
- if (d->profileAdapter()->httpCacheType() != oldCacheType)
- emit httpCacheTypeChanged();
-}
-
-/*!
- \qmlproperty enumeration WebEngineProfile::persistentCookiesPolicy
-
- This enumeration describes the policy of cookie persistency:
-
- \value WebEngineProfile.NoPersistentCookies
- Both session and persistent cookies are stored in memory. This is the only setting
- possible if offTheRecord is set or no persistentStoragePath is available.
- \value WebEngineProfile.AllowPersistentCookies
- Cookies marked persistent are saved to and restored from disk, whereas session cookies
- are only stored to disk for crash recovery. This is the default setting.
- \value WebEngineProfile.ForcePersistentCookies
- Both session and persistent cookies are saved to and restored from disk.
-*/
-
-/*!
- \property QQuickWebEngineProfile::persistentCookiesPolicy
-
- This enumeration describes the policy of cookie persistency.
- If the profile is off-the-record, NoPersistentCookies is returned.
-*/
-
-QQuickWebEngineProfile::PersistentCookiesPolicy QQuickWebEngineProfile::persistentCookiesPolicy() const
-{
- const Q_D(QQuickWebEngineProfile);
- return QQuickWebEngineProfile::PersistentCookiesPolicy(d->profileAdapter()->persistentCookiesPolicy());
-}
-
-void QQuickWebEngineProfile::setPersistentCookiesPolicy(QQuickWebEngineProfile::PersistentCookiesPolicy newPersistentCookiesPolicy)
-{
- Q_D(QQuickWebEngineProfile);
- ProfileAdapter::PersistentCookiesPolicy oldPolicy = d->profileAdapter()->persistentCookiesPolicy();
- d->profileAdapter()->setPersistentCookiesPolicy(ProfileAdapter::PersistentCookiesPolicy(newPersistentCookiesPolicy));
- if (d->profileAdapter()->persistentCookiesPolicy() != oldPolicy)
- emit persistentCookiesPolicyChanged();
-}
-
-/*!
- \qmlproperty int WebEngineProfile::httpCacheMaximumSize
-
- The maximum size of the HTTP cache. If \c 0, the size will be controlled automatically by
- QtWebEngine. The default value is \c 0.
-
- \sa httpCacheType
-*/
-
-/*!
- \property QQuickWebEngineProfile::httpCacheMaximumSize
-
- The maximum size of the HTTP cache. If \c 0, the size will be controlled automatically by
- QtWebEngine. The default value is \c 0.
-
- \sa httpCacheType
-*/
-
-int QQuickWebEngineProfile::httpCacheMaximumSize() const
-{
- const Q_D(QQuickWebEngineProfile);
- return d->profileAdapter()->httpCacheMaxSize();
-}
-
-void QQuickWebEngineProfile::setHttpCacheMaximumSize(int maximumSize)
-{
- Q_D(QQuickWebEngineProfile);
- if (d->profileAdapter()->httpCacheMaxSize() == maximumSize)
- return;
- d->profileAdapter()->setHttpCacheMaxSize(maximumSize);
- emit httpCacheMaximumSizeChanged();
-}
-
-/*!
- \qmlproperty string WebEngineProfile::httpAcceptLanguage
-
- The value of the Accept-Language HTTP request-header field.
-
- \since QtWebEngine 1.2
-*/
-
-/*!
- \property QQuickWebEngineProfile::httpAcceptLanguage
-
- The value of the Accept-Language HTTP request-header field.
-*/
-
-QString QQuickWebEngineProfile::httpAcceptLanguage() const
-{
- Q_D(const QQuickWebEngineProfile);
- return d->profileAdapter()->httpAcceptLanguage();
-}
-
-void QQuickWebEngineProfile::setHttpAcceptLanguage(const QString &httpAcceptLanguage)
-{
- Q_D(QQuickWebEngineProfile);
- if (d->profileAdapter()->httpAcceptLanguage() == httpAcceptLanguage)
- return;
- d->profileAdapter()->setHttpAcceptLanguage(httpAcceptLanguage);
- emit httpAcceptLanguageChanged();
-}
-
-/*!
- Returns the default profile.
-
- The default profile uses the storage name "Default".
-
- \sa storageName()
-*/
-QQuickWebEngineProfile *QQuickWebEngineProfile::defaultProfile()
-{
- static QQuickWebEngineProfile *profile = new QQuickWebEngineProfile(
- new QQuickWebEngineProfilePrivate(ProfileAdapter::createDefaultProfileAdapter()),
- ProfileAdapter::globalQObjectRoot());
- return profile;
-}
-
-/*!
- \property QQuickWebEngineProfile::spellCheckLanguages
- \brief The languages used by the spell checker.
-
- \since QtWebEngine 1.4
-*/
-
-/*!
- \qmlproperty list<string> WebEngineProfile::spellCheckLanguages
-
- This property holds the list of languages used by the spell checker.
- Each language should match the name of the \c .bdic dictionary.
- For example, the language \c en-US will load the \c en-US.bdic
- dictionary file.
-
- See the \l {Spellchecker}{Spellchecker feature documentation} for how
- dictionary files are searched.
-
- For more information about how to compile \c .bdic dictionaries, see the
- \l{WebEngine Widgets Spellchecker Example}{Spellchecker Example}.
-
- \since QtWebEngine 1.4
-*/
-void QQuickWebEngineProfile::setSpellCheckLanguages(const QStringList &languages)
-{
- Q_D(QQuickWebEngineProfile);
- if (languages != d->profileAdapter()->spellCheckLanguages()) {
- d->profileAdapter()->setSpellCheckLanguages(languages);
- emit spellCheckLanguagesChanged();
- }
-}
-
-/*!
- \since 5.8
-
- Returns the list of languages used by the spell checker.
-*/
-QStringList QQuickWebEngineProfile::spellCheckLanguages() const
-{
- const Q_D(QQuickWebEngineProfile);
- return d->profileAdapter()->spellCheckLanguages();
-}
-
-/*!
- \property QQuickWebEngineProfile::spellCheckEnabled
- \brief whether the web engine spell checker is enabled.
-
- \since QtWebEngine 1.4
-*/
-
-/*!
- \qmlproperty bool WebEngineProfile::spellCheckEnabled
-
- This property holds whether the web engine spell checker is enabled.
-
- \since QtWebEngine 1.4
-*/
-void QQuickWebEngineProfile::setSpellCheckEnabled(bool enable)
-{
- Q_D(QQuickWebEngineProfile);
- if (enable != isSpellCheckEnabled()) {
- d->profileAdapter()->setSpellCheckEnabled(enable);
- emit spellCheckEnabledChanged();
- }
-}
-
-bool QQuickWebEngineProfile::isSpellCheckEnabled() const
-{
- const Q_D(QQuickWebEngineProfile);
- return d->profileAdapter()->isSpellCheckEnabled();
-}
-
-/*!
- \property QQuickWebEngineProfile::useForGlobalCertificateVerification
- \since 5.13
-
- This property holds whether this profile is used for downloading and
- caching during global certificate verification when using the online
- certificate status protocol (OCSP), certificate revokation lists (CRLs),
- and authority information access (AIA), for example.
-
- As long as one profile has this option enabled, all other profiles will be
- able to use it for certificate verification. Only one profile at a time can
- have this option enabled. It is recommended that the profile has a disk HTTP
- cache to avoid needlessly re-downloading.
-
- By default, no profile has this property enabled.
-
- Currently, only affects Linux/NSS installations, where having a profile with
- this role enables OCSP.
-*/
-
-/*!
- \qmlproperty bool WebEngineProfile::useForGlobalCertificateVerification
- \since QtWebEngine 1.9
-
- This property holds whether this profile is used for downloading and
- caching during global certificate verification when using the online
- certificate status protocol (OCSP), certificate revokation lists (CRLs),
- and authority information access (AIA), for example.
-
- As long as one profile has this option enabled, all other profiles will be
- able to use it for certificate verification. Only one profile at a time can
- have this option enabled. It is recommended that the profile has a disk HTTP
- cache to avoid needlessly re-downloading.
-
- By default, no profile has this property enabled.
-
- Currently, only affects Linux/NSS installations, where having a profile with
- this role enables OCSP.
-*/
-
-void QQuickWebEngineProfile::setUseForGlobalCertificateVerification(bool enable)
-{
- Q_D(QQuickWebEngineProfile);
- if (enable != d->profileAdapter()->isUsedForGlobalCertificateVerification()) {
- d->profileAdapter()->setUseForGlobalCertificateVerification(enable);
- emit useForGlobalCertificateVerificationChanged();
- }
-}
-
-bool QQuickWebEngineProfile::isUsedForGlobalCertificateVerification() const
-{
- const Q_D(QQuickWebEngineProfile);
- return d->profileAdapter()->isUsedForGlobalCertificateVerification();
-}
-
-/*!
- \qmlproperty string WebEngineProfile::downloadPath
- \since QtWebEngine 1.9
-
- The path to the location where the downloaded files are stored.
-
- Overrides the default path used for download location.
-
- If set to an empty string, the default path is restored.
-
- \note By default, the download path is QStandardPaths::DownloadLocation.
-*/
-
-/*!
- \property QQuickWebEngineProfile::downloadPath
- \since QtWebEngine 1.9
-
- The path to the location where the downloaded files are stored.
-
- Overrides the default path used for download location, setting it to \a path.
-
- If set to an empty string, the default path is restored.
-
- \note By default, the download path is QStandardPaths::DownloadLocation.
-*/
-
-void QQuickWebEngineProfile::setDownloadPath(const QString &path)
-{
- Q_D(QQuickWebEngineProfile);
- if (downloadPath() == path)
- return;
- d->profileAdapter()->setDownloadPath(path);
- emit downloadPathChanged();
-}
-
-QString QQuickWebEngineProfile::downloadPath() const
-{
- const Q_D(QQuickWebEngineProfile);
- return d->profileAdapter()->downloadPath();
-}
-
-/*!
-
- Returns the cookie store for this profile.
-*/
-QWebEngineCookieStore *QQuickWebEngineProfile::cookieStore() const
-{
- const Q_D(QQuickWebEngineProfile);
- return d->profileAdapter()->cookieStore();
-}
-
-/*!
- \qmlmethod void WebEngineProfile::clearHttpCache()
- \since QtWebEngine 1.3
-
- Removes the profile's cache entries.
-
- \sa WebEngineProfile::cachePath
-*/
-
-/*!
- \since 5.7
-
- Removes the profile's cache entries.
-
- \sa WebEngineProfile::clearHttpCache
-*/
-void QQuickWebEngineProfile::clearHttpCache()
-{
- Q_D(QQuickWebEngineProfile);
- d->profileAdapter()->clearHttpCache();
-}
-
-#if QT_DEPRECATED_SINCE(5, 13)
-/*!
- Registers a request interceptor singleton \a interceptor to intercept URL requests.
-
- The profile does not take ownership of the pointer.
-
- \obsolete
-
- Interceptors installed with this method will call
- QWebEngineUrlRequestInterceptor::interceptRequest on the I/O thread. Therefore
- the user has to provide thread-safe interaction with the other user classes.
- Use setUrlRequestInterceptor instead.
-
- \sa QWebEngineUrlRequestInterceptor
-
-*/
-void QQuickWebEngineProfile::setRequestInterceptor(QWebEngineUrlRequestInterceptor *interceptor)
-{
- Q_D(QQuickWebEngineProfile);
- interceptor->setProperty("deprecated", true);
- d->profileAdapter()->setRequestInterceptor(interceptor);
- qWarning("Use of deprecated not tread-safe setter, use setUrlRequestInterceptor instead.");
-}
-#endif
-
-/*!
- Registers a request interceptor singleton \a interceptor to intercept URL requests.
-
- The profile does not take ownership of the pointer.
-
- \sa QWebEngineUrlRequestInfo QWebEngineUrlRequestInterceptor
-*/
-void QQuickWebEngineProfile::setUrlRequestInterceptor(QWebEngineUrlRequestInterceptor *interceptor)
-{
- Q_D(QQuickWebEngineProfile);
- d->profileAdapter()->setRequestInterceptor(interceptor);
-}
-
-
-/*!
- Returns the custom URL scheme handler register for the URL scheme \a scheme.
-*/
-const QWebEngineUrlSchemeHandler *QQuickWebEngineProfile::urlSchemeHandler(const QByteArray &scheme) const
-{
- const Q_D(QQuickWebEngineProfile);
- return d->profileAdapter()->urlSchemeHandler(scheme);
-}
-
-/*!
- Registers a handler \a handler for custom URL scheme \a scheme in the profile.
-
- It is necessary to first register the scheme with \l
- QWebEngineUrlScheme::registerScheme at application startup.
-*/
-void QQuickWebEngineProfile::installUrlSchemeHandler(const QByteArray &scheme, QWebEngineUrlSchemeHandler *handler)
-{
- Q_D(QQuickWebEngineProfile);
- d->profileAdapter()->installUrlSchemeHandler(scheme, handler);
-}
-
-/*!
- Removes the custom URL scheme handler \a handler from the profile.
-
- \sa removeUrlScheme()
-*/
-void QQuickWebEngineProfile::removeUrlSchemeHandler(QWebEngineUrlSchemeHandler *handler)
-{
- Q_D(QQuickWebEngineProfile);
- d->profileAdapter()->removeUrlSchemeHandler(handler);
-}
-
-/*!
- Removes the custom URL scheme \a scheme from the profile.
-
- \sa removeUrlSchemeHandler()
-*/
-void QQuickWebEngineProfile::removeUrlScheme(const QByteArray &scheme)
-{
- Q_D(QQuickWebEngineProfile);
- d->profileAdapter()->removeUrlScheme(scheme);
-}
-
-/*!
- Removes all custom URL scheme handlers installed in the profile.
-*/
-void QQuickWebEngineProfile::removeAllUrlSchemeHandlers()
-{
- Q_D(QQuickWebEngineProfile);
- d->profileAdapter()->removeAllUrlSchemeHandlers();
-}
-
-QQuickWebEngineSettings *QQuickWebEngineProfile::settings() const
-{
- const Q_D(QQuickWebEngineProfile);
- return d->settings();
-}
-
-/*!
- \qmlproperty list<WebEngineScript> WebEngineProfile::userScripts
- \since 1.5
-
- Returns the collection of WebEngineScripts that are injected into all pages that share
- this profile.
-
- \sa WebEngineScript
-*/
-
-/*!
- \property QQuickWebEngineProfile::userScripts
- \since 5.9
-
- \brief The collection of scripts that are injected into all pages that share
- this profile.
-
- \sa QQuickWebEngineScript, QQmlListReference
-*/
-QQmlListProperty<QQuickWebEngineScript> QQuickWebEngineProfile::userScripts()
-{
- Q_D(QQuickWebEngineProfile);
- return QQmlListProperty<QQuickWebEngineScript>(this, d,
- d->userScripts_append,
- d->userScripts_count,
- d->userScripts_at,
- d->userScripts_clear);
-}
-
-/*!
- \since 5.13
-
- Returns the profile's client certificate store.
-*/
-QWebEngineClientCertificateStore *QQuickWebEngineProfile::clientCertificateStore()
-{
-#if QT_CONFIG(ssl)
- Q_D(QQuickWebEngineProfile);
- return d->profileAdapter()->clientCertificateStore();
-#else
- return nullptr;
-#endif
-}
-
-QT_END_NAMESPACE
diff --git a/src/webengine/api/qquickwebengineprofile.h b/src/webengine/api/qquickwebengineprofile.h
deleted file mode 100644
index e5f7ff713..000000000
--- a/src/webengine/api/qquickwebengineprofile.h
+++ /dev/null
@@ -1,197 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKWEBENGINEPROFILE_H
-#define QQUICKWEBENGINEPROFILE_H
-
-
-#include <QtWebEngine/qtwebengineglobal.h>
-
-#include <QtCore/QObject>
-#include <QtCore/QScopedPointer>
-#include <QtCore/QString>
-#include <QtQml/QQmlListProperty>
-
-QT_BEGIN_NAMESPACE
-
-class QQuickWebEngineDownloadItem;
-class QQuickWebEngineProfilePrivate;
-class QQuickWebEngineScript;
-class QQuickWebEngineSettings;
-class QWebEngineClientCertificateStore;
-class QWebEngineCookieStore;
-class QWebEngineNotification;
-class QWebEngineUrlRequestInterceptor;
-class QWebEngineUrlSchemeHandler;
-
-class Q_WEBENGINE_EXPORT QQuickWebEngineProfile : public QObject {
- Q_OBJECT
- Q_PROPERTY(QString storageName READ storageName WRITE setStorageName NOTIFY storageNameChanged FINAL)
- Q_PROPERTY(bool offTheRecord READ isOffTheRecord WRITE setOffTheRecord NOTIFY offTheRecordChanged FINAL)
- Q_PROPERTY(QString persistentStoragePath READ persistentStoragePath WRITE setPersistentStoragePath NOTIFY persistentStoragePathChanged FINAL)
- Q_PROPERTY(QString cachePath READ cachePath WRITE setCachePath NOTIFY cachePathChanged FINAL)
- Q_PROPERTY(QString httpUserAgent READ httpUserAgent WRITE setHttpUserAgent NOTIFY httpUserAgentChanged FINAL)
- Q_PROPERTY(HttpCacheType httpCacheType READ httpCacheType WRITE setHttpCacheType NOTIFY httpCacheTypeChanged FINAL)
- Q_PROPERTY(QString httpAcceptLanguage READ httpAcceptLanguage WRITE setHttpAcceptLanguage NOTIFY httpAcceptLanguageChanged FINAL REVISION 1)
- Q_PROPERTY(PersistentCookiesPolicy persistentCookiesPolicy READ persistentCookiesPolicy WRITE setPersistentCookiesPolicy NOTIFY persistentCookiesPolicyChanged FINAL)
- Q_PROPERTY(int httpCacheMaximumSize READ httpCacheMaximumSize WRITE setHttpCacheMaximumSize NOTIFY httpCacheMaximumSizeChanged FINAL)
- Q_PROPERTY(QStringList spellCheckLanguages READ spellCheckLanguages WRITE setSpellCheckLanguages NOTIFY spellCheckLanguagesChanged FINAL REVISION 3)
- Q_PROPERTY(bool spellCheckEnabled READ isSpellCheckEnabled WRITE setSpellCheckEnabled NOTIFY spellCheckEnabledChanged FINAL REVISION 3)
- Q_PROPERTY(QQmlListProperty<QQuickWebEngineScript> userScripts READ userScripts FINAL REVISION 4)
- Q_PROPERTY(bool useForGlobalCertificateVerification
- READ isUsedForGlobalCertificateVerification
- WRITE setUseForGlobalCertificateVerification
- NOTIFY useForGlobalCertificateVerificationChanged
- FINAL REVISION 5)
- Q_PROPERTY(QString downloadPath READ downloadPath WRITE setDownloadPath NOTIFY downloadPathChanged FINAL REVISION 5)
-
-public:
- QQuickWebEngineProfile(QObject *parent = Q_NULLPTR);
- ~QQuickWebEngineProfile();
-
- enum HttpCacheType {
- MemoryHttpCache,
- DiskHttpCache,
- NoCache
- };
- Q_ENUM(HttpCacheType)
-
- enum PersistentCookiesPolicy {
- NoPersistentCookies,
- AllowPersistentCookies,
- ForcePersistentCookies
- };
- Q_ENUM(PersistentCookiesPolicy)
-
- QString storageName() const;
- void setStorageName(const QString &name);
-
- bool isOffTheRecord() const;
- void setOffTheRecord(bool offTheRecord);
-
- QString persistentStoragePath() const;
- void setPersistentStoragePath(const QString &path);
-
- QString cachePath() const;
- void setCachePath(const QString &path);
-
- QString httpUserAgent() const;
- void setHttpUserAgent(const QString &userAgent);
-
- HttpCacheType httpCacheType() const;
- void setHttpCacheType(QQuickWebEngineProfile::HttpCacheType);
-
- PersistentCookiesPolicy persistentCookiesPolicy() const;
- void setPersistentCookiesPolicy(QQuickWebEngineProfile::PersistentCookiesPolicy);
-
- int httpCacheMaximumSize() const;
- void setHttpCacheMaximumSize(int maxSize);
-
- QString httpAcceptLanguage() const;
- void setHttpAcceptLanguage(const QString &httpAcceptLanguage);
-
- QWebEngineCookieStore *cookieStore() const;
-
-#if QT_DEPRECATED_SINCE(5, 13)
- void setRequestInterceptor(QWebEngineUrlRequestInterceptor *interceptor);
-#endif
- void setUrlRequestInterceptor(QWebEngineUrlRequestInterceptor *interceptor);
-
- const QWebEngineUrlSchemeHandler *urlSchemeHandler(const QByteArray &) const;
- void installUrlSchemeHandler(const QByteArray &scheme, QWebEngineUrlSchemeHandler *);
- void removeUrlScheme(const QByteArray &scheme);
- void removeUrlSchemeHandler(QWebEngineUrlSchemeHandler *);
- void removeAllUrlSchemeHandlers();
-
- Q_REVISION(2) Q_INVOKABLE void clearHttpCache();
-
- void setSpellCheckLanguages(const QStringList &languages);
- QStringList spellCheckLanguages() const;
- void setSpellCheckEnabled(bool enabled);
- bool isSpellCheckEnabled() const;
-
- QQmlListProperty<QQuickWebEngineScript> userScripts();
-
- void setUseForGlobalCertificateVerification(bool b);
- bool isUsedForGlobalCertificateVerification() const;
-
- QString downloadPath() const;
- void setDownloadPath(const QString &path);
-
- QWebEngineClientCertificateStore *clientCertificateStore();
-
- static QQuickWebEngineProfile *defaultProfile();
-
-Q_SIGNALS:
- void storageNameChanged();
- void offTheRecordChanged();
- void persistentStoragePathChanged();
- void cachePathChanged();
- void httpUserAgentChanged();
- void httpCacheTypeChanged();
- void persistentCookiesPolicyChanged();
- void httpCacheMaximumSizeChanged();
- Q_REVISION(1) void httpAcceptLanguageChanged();
- Q_REVISION(3) void spellCheckLanguagesChanged();
- Q_REVISION(3) void spellCheckEnabledChanged();
- Q_REVISION(5) void useForGlobalCertificateVerificationChanged();
- Q_REVISION(5) void downloadPathChanged();
-
- void downloadRequested(QQuickWebEngineDownloadItem *download);
- void downloadFinished(QQuickWebEngineDownloadItem *download);
-
- Q_REVISION(5) void presentNotification(QWebEngineNotification *notification);
-
-private:
- Q_DECLARE_PRIVATE(QQuickWebEngineProfile)
- QQuickWebEngineProfile(QQuickWebEngineProfilePrivate *, QObject *parent = Q_NULLPTR);
- QQuickWebEngineSettings *settings() const;
-
- friend class QQuickWebEngineSettings;
- friend class QQuickWebEngineSingleton;
- friend class QQuickWebEngineViewPrivate;
- friend class QQuickWebEngineDownloadItem;
- friend class QQuickWebEngineDownloadItemPrivate;
- friend class QQuickWebEngineView;
- QScopedPointer<QQuickWebEngineProfilePrivate> d_ptr;
-};
-
-QT_END_NAMESPACE
-
-#endif // QQUICKWEBENGINEPROFILE_H
diff --git a/src/webengine/api/qquickwebengineprofile_p.h b/src/webengine/api/qquickwebengineprofile_p.h
deleted file mode 100644
index c6d412ab3..000000000
--- a/src/webengine/api/qquickwebengineprofile_p.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKWEBENGINEPROFILE_P_H
-#define QQUICKWEBENGINEPROFILE_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "profile_adapter_client.h"
-#include "profile_adapter.h"
-#include "qquickwebengineprofile.h"
-
-#include <QExplicitlySharedDataPointer>
-#include <QMap>
-#include <QPointer>
-#include <QSharedPointer>
-
-QT_BEGIN_NAMESPACE
-
-class QQuickWebEngineDownloadItem;
-class QQuickWebEngineSettings;
-class QQuickWebEngineViewPrivate;
-
-class QQuickWebEngineProfilePrivate : public QtWebEngineCore::ProfileAdapterClient {
-public:
- Q_DECLARE_PUBLIC(QQuickWebEngineProfile)
- QQuickWebEngineProfilePrivate(QtWebEngineCore::ProfileAdapter *profileAdapter);
- ~QQuickWebEngineProfilePrivate();
- void addWebContentsAdapterClient(QtWebEngineCore::WebContentsAdapterClient *adapter) override;
- void removeWebContentsAdapterClient(QtWebEngineCore::WebContentsAdapterClient *adapter) override;
-
- QtWebEngineCore::ProfileAdapter* profileAdapter() const;
- QQuickWebEngineSettings *settings() const;
-
- void cancelDownload(quint32 downloadId);
- void downloadDestroyed(quint32 downloadId);
-
- void cleanDownloads();
-
- void downloadRequested(DownloadItemInfo &info) override;
- void downloadUpdated(const DownloadItemInfo &info) override;
-
- void useForGlobalCertificateVerificationChanged() override;
-
- void showNotification(QSharedPointer<QtWebEngineCore::UserNotificationController> &controller) override;
-
- // QQmlListPropertyHelpers
- static void userScripts_append(QQmlListProperty<QQuickWebEngineScript> *p, QQuickWebEngineScript *script);
- static int userScripts_count(QQmlListProperty<QQuickWebEngineScript> *p);
- static QQuickWebEngineScript *userScripts_at(QQmlListProperty<QQuickWebEngineScript> *p, int idx);
- static void userScripts_clear(QQmlListProperty<QQuickWebEngineScript> *p);
-
-private:
- friend class QQuickWebEngineView;
- QQuickWebEngineProfile *q_ptr;
- QScopedPointer<QQuickWebEngineSettings> m_settings;
- QPointer<QtWebEngineCore::ProfileAdapter> m_profileAdapter;
- QMap<quint32, QPointer<QQuickWebEngineDownloadItem> > m_ongoingDownloads;
- QList<QQuickWebEngineScript *> m_userScripts;
-};
-
-QT_END_NAMESPACE
-
-#endif // QQUICKWEBENGINEPROFILE_P_H
diff --git a/src/webengine/api/qquickwebenginescript.cpp b/src/webengine/api/qquickwebenginescript.cpp
deleted file mode 100644
index ab7aee4cb..000000000
--- a/src/webengine/api/qquickwebenginescript.cpp
+++ /dev/null
@@ -1,446 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickwebenginescript.h"
-#include "qquickwebenginescript_p.h"
-
-#include <QQmlFile>
-#include <QtCore/QDebug>
-#include <QtCore/QFile>
-#include <QtCore/QTimerEvent>
-#include "renderer_host/user_resource_controller_host.h"
-
-using QtWebEngineCore::UserScript;
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QQuickWebEngineScript
- \brief Enables the injection of scripts in the JavaScript engine.
- \inmodule QtWebEngine
- \since 5.9
-
- The QQuickWebEngineScript type enables the programmatic injection of so called \e {user scripts} in
- the JavaScript engine at different points, determined by injectionPoint, during the loading of
- web content.
-
- Scripts can be executed either in the main JavaScript \e world, along with the rest of the
- JavaScript coming from the web contents, or in their own isolated world. While the DOM of the
- page can be accessed from any world, JavaScript variables of a function defined in one world are
- not accessible from a different one. The worldId property provides some predefined IDs for this
- purpose.
-*/
-
-/*!
- \enum QQuickWebEngineScript::InjectionPoint
-
- The point in the loading process at which the script will be executed.
-
- \value DocumentCreation
- The script will be executed as soon as the document is created. This is not suitable for
- any DOM operation.
- \value DocumentReady
- The script will run as soon as the DOM is ready. This is equivalent to the
- \c DOMContentLoaded event firing in JavaScript.
- \value Deferred
- The script will run when the page load finishes, or 500 ms after the document is ready,
- whichever comes first.
-*/
-
-/*!
- \enum QQuickWebEngineScript::ScriptWorldId
-
- The world ID defining which isolated world the script is executed in. Besides these predefined
- IDs custom IDs can be used, but must be integers between \c 0 and \c 256.
-
- \value MainWorld
- The world used by the page's web contents. It can be useful in order to expose custom
- functionality to web contents in certain scenarios.
- \value ApplicationWorld
- The default isolated world used for application level functionality implemented in
- JavaScript.
- \value UserWorld
- The first isolated world to be used by scripts set by users if the application is not
- making use of more worlds. As a rule of thumb, if that functionality is exposed to the
- application users, each individual script should probably get its own isolated world.
-*/
-
-/*!
- \qmltype WebEngineScript
- \instantiates QQuickWebEngineScript
- \inqmlmodule QtWebEngine
- \since QtWebEngine 1.1
- \brief Enables the programmatic injection of scripts in the JavaScript engine.
-
- The WebEngineScript type enables the programmatic injection of so called \e {user scripts} in
- the JavaScript engine at different points, determined by injectionPoint, during the loading of
- web content.
-
- Scripts can be executed either in the main JavaScript \e world, along with the rest of the
- JavaScript coming from the web contents, or in their own isolated world. While the DOM of the
- page can be accessed from any world, JavaScript variables of a function defined in one world are
- not accessible from a different one. The worldId property provides some predefined IDs for this
- purpose.
-
- The following \l Greasemonkey attributes are supported since Qt 5.8:
- \c @exclude, \c @include, \c @name, \c @match, and \c @run-at.
-
- Use \l{WebEngineView::userScripts}{WebEngineView.userScripts} to access a list of scripts
- attached to the web view.
-*/
-
-/*!
- Constructs a new QQuickWebEngineScript with the parent \a parent.
-*/
-QQuickWebEngineScript::QQuickWebEngineScript(QObject *parent)
- : QObject(parent)
- , d_ptr(new QQuickWebEngineScriptPrivate)
-{
- d_ptr->q_ptr = this;
-}
-
-/*!
- \internal
-*/
-QQuickWebEngineScript::~QQuickWebEngineScript()
-{
-}
-
-/*!
- Returns the script object as string.
-*/
-QString QQuickWebEngineScript::toString() const
-{
- Q_D(const QQuickWebEngineScript);
- if (d->coreScript.isNull())
- return QStringLiteral("QWebEngineScript()");
- QString ret = QStringLiteral("QWebEngineScript(") % d->coreScript.name() % QStringLiteral(", ");
- switch (d->coreScript.injectionPoint()) {
- case UserScript::DocumentElementCreation:
- ret.append(QStringLiteral("WebEngineScript::DocumentCreation, "));
- break;
- case UserScript::DocumentLoadFinished:
- ret.append(QStringLiteral("WebEngineScript::DocumentReady, "));
- break;
- case UserScript::AfterLoad:
- ret.append(QStringLiteral("WebEngineScript::Deferred, "));
- break;
- }
- ret.append(QString::number(d->coreScript.worldId()) % QStringLiteral(", ")
- % (d->coreScript.runsOnSubFrames() ? QStringLiteral("true") : QStringLiteral("false"))
- % QStringLiteral(", ") % d->coreScript.sourceCode() % QLatin1Char(')'));
- return ret;
-}
-
-/*!
- \property QQuickWebEngineScript::name
- \brief The name of the script.
-
- Can be useful to retrieve a particular script from
- QQuickWebEngineProfile::userScripts.
-*/
-
-/*!
- \qmlproperty string WebEngineScript::name
-
- The name of the script. Can be useful to retrieve a particular script from
- \l{WebEngineView::userScripts}{WebEngineView.userScripts}.
-*/
-QString QQuickWebEngineScript::name() const
-{
- Q_D(const QQuickWebEngineScript);
- return d->coreScript.name();
-}
-
-/*!
- \property QQuickWebEngineScript::sourceUrl
- \brief The remote source location of the user script (if any).
-
- Unlike \l sourceCode, this property allows referring to user scripts that
- are not already loaded in memory, for instance, when stored on disk.
-
- Setting this property will change the \l sourceCode of the script.
-
- \note At present, only file-based sources are supported.
-
- \sa QQuickWebEngineScript::sourceCode
-*/
-
-/*!
- \qmlproperty url WebEngineScript::sourceUrl
-
- This property holds the remote source location of the user script (if any).
-
- Unlike \l sourceCode, this property allows referring to user scripts that
- are not already loaded in memory, for instance, when stored on disk.
-
- Setting this property will change the \l sourceCode of the script.
-
- \note At present, only file-based sources are supported.
-
- \sa sourceCode
-*/
-QUrl QQuickWebEngineScript::sourceUrl() const
-{
- Q_D(const QQuickWebEngineScript);
- return d->m_sourceUrl;
-}
-
-/*!
- \property QQuickWebEngineScript::sourceCode
- \brief The JavaScript source code of the user script.
-
- \sa QQuickWebEngineScript::sourceUrl
-*/
-
-/*!
- \qmlproperty string WebEngineScript::sourceCode
-
- This property holds the JavaScript source code of the user script.
-
- \sa sourceUrl
-*/
-QString QQuickWebEngineScript::sourceCode() const
-{
- Q_D(const QQuickWebEngineScript);
- return d->coreScript.sourceCode();
-}
-
-ASSERT_ENUMS_MATCH(QQuickWebEngineScript::Deferred, UserScript::AfterLoad)
-ASSERT_ENUMS_MATCH(QQuickWebEngineScript::DocumentReady, UserScript::DocumentLoadFinished)
-ASSERT_ENUMS_MATCH(QQuickWebEngineScript::DocumentCreation, UserScript::DocumentElementCreation)
-
-/*!
- \property QQuickWebEngineScript::injectionPoint
- \brief The point in the loading process at which the script will be executed.
-
- The default value is \c Deferred.
-*/
-
-/*!
- \qmlproperty enumeration WebEngineScript::injectionPoint
-
- The point in the loading process at which the script will be executed.
- The default value is \c Deferred.
-
- \value WebEngineScript.DocumentCreation
- The script will be executed as soon as the document is created. This is not suitable for
- any DOM operation.
- \value WebEngineScript.DocumentReady
- The script will run as soon as the DOM is ready. This is equivalent to the
- \c DOMContentLoaded event firing in JavaScript.
- \value WebEngineScript.Deferred
- The script will run when the page load finishes, or 500 ms after the document is ready,
- whichever comes first.
-*/
-QQuickWebEngineScript::InjectionPoint QQuickWebEngineScript::injectionPoint() const
-{
- Q_D(const QQuickWebEngineScript);
- return static_cast<QQuickWebEngineScript::InjectionPoint>(d->coreScript.injectionPoint());
-}
-
-/*!
- \property QQuickWebEngineScript::worldId
- \brief The world ID defining which isolated world the script is executed in.
-*/
-
-/*!
- \qmlproperty enumeration WebEngineScript::worldId
-
- The world ID defining which isolated world the script is executed in.
-
- \value WebEngineScript.MainWorld
- The world used by the page's web contents. It can be useful in order to expose custom
- functionality to web contents in certain scenarios.
- \value WebEngineScript.ApplicationWorld
- The default isolated world used for application level functionality implemented in
- JavaScript.
- \value WebEngineScript.UserWorld
- The first isolated world to be used by scripts set by users if the application is not
- making use of more worlds. As a rule of thumb, if that functionality is exposed to the
- application users, each individual script should probably get its own isolated world.
-*/
-QQuickWebEngineScript::ScriptWorldId QQuickWebEngineScript::worldId() const
-{
- Q_D(const QQuickWebEngineScript);
- return static_cast<QQuickWebEngineScript::ScriptWorldId>(d->coreScript.worldId());
-}
-
-/*!
- \property QQuickWebEngineScript::runOnSubframes
- \brief Whether the script is executed on every frame or only on the main frame.
-
- Set this property to \c true if the script is executed on every frame in the page, or \c false
- if it is only run for the main frame.
- The default value is \c{false}.
-*/
-
-/*!
- \qmlproperty int WebEngineScript::runOnSubframes
-
- Set this property to \c true if the script is executed on every frame in the page, or \c false
- if it is only ran for the main frame.
- The default value is \c{false}.
- */
-bool QQuickWebEngineScript::runOnSubframes() const
-{
- Q_D(const QQuickWebEngineScript);
- return d->coreScript.runsOnSubFrames();
-}
-
-void QQuickWebEngineScript::setName(const QString &name)
-{
- Q_D(QQuickWebEngineScript);
- if (name == QQuickWebEngineScript::name())
- return;
- d->aboutToUpdateUnderlyingScript();
- d->coreScript.setName(name);
- Q_EMIT nameChanged(name);
-}
-
-void QQuickWebEngineScript::setSourceCode(const QString &code)
-{
- Q_D(QQuickWebEngineScript);
- if (code == sourceCode())
- return;
-
- // setting the source directly resets the sourceUrl
- if (d->m_sourceUrl != QUrl()) {
- d->m_sourceUrl = QUrl();
- Q_EMIT sourceUrlChanged(d->m_sourceUrl);
- }
-
- d->aboutToUpdateUnderlyingScript();
- d->coreScript.setSourceCode(code);
- Q_EMIT sourceCodeChanged(code);
-}
-
-void QQuickWebEngineScript::setSourceUrl(const QUrl &url)
-{
- Q_D(QQuickWebEngineScript);
- if (url == sourceUrl())
- return;
-
- d->m_sourceUrl = url;
- Q_EMIT sourceUrlChanged(d->m_sourceUrl);
-
- QFile f(QQmlFile::urlToLocalFileOrQrc(url));
- if (!f.open(QIODevice::ReadOnly)) {
- qWarning() << "Can't open user script " << url;
- return;
- }
-
- d->aboutToUpdateUnderlyingScript();
- QString source = QString::fromUtf8(f.readAll());
- d->coreScript.setSourceCode(source);
- Q_EMIT sourceCodeChanged(source);
-}
-
-void QQuickWebEngineScript::setInjectionPoint(QQuickWebEngineScript::InjectionPoint injectionPoint)
-{
- Q_D(QQuickWebEngineScript);
- if (injectionPoint == QQuickWebEngineScript::injectionPoint())
- return;
- d->aboutToUpdateUnderlyingScript();
- d->coreScript.setInjectionPoint(static_cast<UserScript::InjectionPoint>(injectionPoint));
- Q_EMIT injectionPointChanged(injectionPoint);
-}
-
-
-void QQuickWebEngineScript::setWorldId(QQuickWebEngineScript::ScriptWorldId scriptWorldId)
-{
- Q_D(QQuickWebEngineScript);
- if (scriptWorldId == worldId())
- return;
- d->aboutToUpdateUnderlyingScript();
- d->coreScript.setWorldId(scriptWorldId);
- Q_EMIT worldIdChanged(scriptWorldId);
-}
-
-
-void QQuickWebEngineScript::setRunOnSubframes(bool on)
-{
- Q_D(QQuickWebEngineScript);
- if (on == runOnSubframes())
- return;
- d->aboutToUpdateUnderlyingScript();
- d->coreScript.setRunsOnSubFrames(on);
- Q_EMIT runOnSubframesChanged(on);
-}
-
-/*!
- \internal
-*/
-void QQuickWebEngineScript::timerEvent(QTimerEvent *e)
-{
- Q_D(QQuickWebEngineScript);
- if (e->timerId() != d->m_basicTimer.timerId()) {
- QObject::timerEvent(e);
- return;
- }
- if (!d->m_controllerHost)
- return;
- d->m_basicTimer.stop();
- d->m_controllerHost->addUserScript(d->coreScript, d->m_adapter);
-}
-
-void QQuickWebEngineScriptPrivate::bind(QtWebEngineCore::UserResourceControllerHost *resourceController, QtWebEngineCore::WebContentsAdapter *adapter)
-{
- aboutToUpdateUnderlyingScript();
- m_adapter = adapter;
- m_controllerHost = resourceController;
-}
-
-QQuickWebEngineScriptPrivate::QQuickWebEngineScriptPrivate()
- :m_controllerHost(0)
- , m_adapter(0)
-
-{
-}
-
-void QQuickWebEngineScriptPrivate::aboutToUpdateUnderlyingScript()
-{
- Q_Q(QQuickWebEngineScript);
- if (m_controllerHost)
- m_controllerHost->removeUserScript(coreScript, m_adapter);
- // Defer updates to the next event loop
- m_basicTimer.start(0, q);
-}
-
-QT_END_NAMESPACE
diff --git a/src/webengine/api/qquickwebenginescript.h b/src/webengine/api/qquickwebenginescript.h
deleted file mode 100644
index d5c4310db..000000000
--- a/src/webengine/api/qquickwebenginescript.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKWEBENGINESCRIPT_H
-#define QQUICKWEBENGINESCRIPT_H
-
-#include <QtCore/qobject.h>
-#include <QtCore/qurl.h>
-#include <QtWebEngine/qtwebengineglobal.h>
-
-QT_BEGIN_NAMESPACE
-class QQuickWebEngineScriptPrivate;
-class QQuickWebEngineView;
-
-class Q_WEBENGINE_EXPORT QQuickWebEngineScript : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged FINAL)
- Q_PROPERTY(QUrl sourceUrl READ sourceUrl WRITE setSourceUrl NOTIFY sourceUrlChanged FINAL)
- Q_PROPERTY(QString sourceCode READ sourceCode WRITE setSourceCode NOTIFY sourceCodeChanged FINAL)
- Q_PROPERTY(InjectionPoint injectionPoint READ injectionPoint WRITE setInjectionPoint NOTIFY injectionPointChanged FINAL)
- Q_PROPERTY(ScriptWorldId worldId READ worldId WRITE setWorldId NOTIFY worldIdChanged FINAL)
- Q_PROPERTY(bool runOnSubframes READ runOnSubframes WRITE setRunOnSubframes NOTIFY runOnSubframesChanged FINAL)
-
-
-public:
- enum InjectionPoint {
- Deferred,
- DocumentReady,
- DocumentCreation
- };
- Q_ENUM(InjectionPoint)
-
- enum ScriptWorldId {
- MainWorld = 0,
- ApplicationWorld,
- UserWorld
- };
- Q_ENUM(ScriptWorldId)
-
- explicit QQuickWebEngineScript(QObject *parent = Q_NULLPTR);
- ~QQuickWebEngineScript();
- Q_INVOKABLE QString toString() const;
-
- QString name() const;
- QUrl sourceUrl() const;
- QString sourceCode() const;
- InjectionPoint injectionPoint() const;
- ScriptWorldId worldId() const;
- bool runOnSubframes() const;
-
- Q_INVOKABLE void setName(const QString &name);
- Q_INVOKABLE void setSourceUrl(const QUrl &url);
- Q_INVOKABLE void setSourceCode(const QString &code);
- Q_INVOKABLE void setInjectionPoint(InjectionPoint injectionPoint);
- Q_INVOKABLE void setWorldId(ScriptWorldId scriptWorldId);
- Q_INVOKABLE void setRunOnSubframes(bool on);
-
-Q_SIGNALS:
- void nameChanged(const QString &name);
- void sourceUrlChanged(const QUrl &url);
- void sourceCodeChanged(const QString &code);
- void injectionPointChanged(InjectionPoint injectionPoint);
- void worldIdChanged(ScriptWorldId scriptWorldId);
- void runOnSubframesChanged(bool on);
-
-protected:
- void timerEvent(QTimerEvent *e) override;
-
-private:
- friend class QQuickWebEngineProfilePrivate;
- friend class QQuickWebEngineViewPrivate;
- Q_DECLARE_PRIVATE(QQuickWebEngineScript)
- QScopedPointer<QQuickWebEngineScriptPrivate> d_ptr;
-};
-QT_END_NAMESPACE
-
-#endif // QQUICKWEBENGINESCRIPT_H
diff --git a/src/webengine/api/qquickwebenginescript_p.h b/src/webengine/api/qquickwebenginescript_p.h
deleted file mode 100644
index 30b47a654..000000000
--- a/src/webengine/api/qquickwebenginescript_p.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKWEBENGINESCRIPT_P_H
-#define QQUICKWEBENGINESCRIPT_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "qquickwebenginescript.h"
-
-#include <QtCore/QBasicTimer>
-#include "user_script.h"
-#include "web_contents_adapter.h"
-
-namespace QtWebEngineCore {
-class UserResourceControllerHost;
-class WebContentsAdapter;
-} // namespace
-
-QT_BEGIN_NAMESPACE
-
-class QQuickWebEngineScriptPrivate {
-public:
- Q_DECLARE_PUBLIC(QQuickWebEngineScript)
- QQuickWebEngineScriptPrivate();
- void aboutToUpdateUnderlyingScript();
- void bind(QtWebEngineCore::UserResourceControllerHost *, QtWebEngineCore::WebContentsAdapter * = 0);
-
- QtWebEngineCore::UserScript coreScript;
- QBasicTimer m_basicTimer;
- QtWebEngineCore::UserResourceControllerHost *m_controllerHost;
- QtWebEngineCore::WebContentsAdapter *m_adapter;
- QUrl m_sourceUrl;
-
-private:
- QQuickWebEngineScript *q_ptr;
-
-};
-
-QT_END_NAMESPACE
-
-#endif // QQUICKWEBENGINESCRIPT_P_H
diff --git a/src/webengine/api/qquickwebenginesettings.cpp b/src/webengine/api/qquickwebenginesettings.cpp
deleted file mode 100644
index 78fbe16e8..000000000
--- a/src/webengine/api/qquickwebenginesettings.cpp
+++ /dev/null
@@ -1,766 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickwebenginesettings_p.h"
-
-#include "web_engine_settings.h"
-
-#include <QtWebEngine/QQuickWebEngineProfile>
-#include <QtCore/QList>
-
-QT_BEGIN_NAMESPACE
-
-using QtWebEngineCore::WebEngineSettings;
-
-QQuickWebEngineSettings::QQuickWebEngineSettings(QQuickWebEngineSettings *parentSettings)
- : d_ptr(new WebEngineSettings(parentSettings ? parentSettings->d_ptr.data() : 0))
-{ }
-
-/*!
- \qmltype WebEngineSettings
- \instantiates QQuickWebEngineSettings
- \inqmlmodule QtWebEngine
- \since QtWebEngine 1.1
- \brief Allows configuration of browser properties and attributes.
-
- The WebEngineSettings type can be used to configure browser properties and generic
- attributes, such as JavaScript support, focus behavior, and access to remote content. This type
- is uncreatable, but the default settings for all web engine views can be accessed by using
- the \l [QML] {WebEngine::settings}{WebEngine.settings} property.
-
- Each web engine view can have individual settings that can be accessed by using the
- \l{WebEngineView::settings}{WebEngineView.settings} property.
-*/
-
-
-QQuickWebEngineSettings::~QQuickWebEngineSettings()
-{ }
-
-/*!
- \enum QQuickWebEngineSettings::UnknownUrlSchemePolicy
- \since WebEngine 1.7
-
- This enum describes how navigation requests to URLs with unknown schemes are handled.
-
- \value DisallowUnknownUrlSchemes
- Disallows all navigation requests to URLs with unknown schemes.
- \value AllowUnknownUrlSchemesFromUserInteraction
- Allows navigation requests to URLs with unknown schemes that are issued from
- user-interaction (like a mouse-click), whereas other navigation requests (for example
- from JavaScript) are suppressed.
- \value AllowAllUnknownUrlSchemes
- Allows all navigation requests to URLs with unknown schemes.
-*/
-
-/*!
- \qmlproperty bool WebEngineSettings::autoLoadImages
-
- Automatically loads images on web pages.
-
- Enabled by default.
-*/
-bool QQuickWebEngineSettings::autoLoadImages() const
-{
- return d_ptr->testAttribute(WebEngineSettings::AutoLoadImages);
-}
-
-/*!
- \qmlproperty bool WebEngineSettings::javascriptEnabled
-
- Enables the running of JavaScript programs.
-
- Enabled by default.
-*/
-bool QQuickWebEngineSettings::javascriptEnabled() const
-{
- return d_ptr->testAttribute(WebEngineSettings::JavascriptEnabled);
-}
-
-/*!
- \qmlproperty bool WebEngineSettings::javascriptCanOpenWindows
-
- Allows JavaScript programs to open popup windows without user interaction.
-
- Enabled by default.
-*/
-bool QQuickWebEngineSettings::javascriptCanOpenWindows() const
-{
- return d_ptr->testAttribute(WebEngineSettings::JavascriptCanOpenWindows);
-}
-
-/*!
- \qmlproperty bool WebEngineSettings::javascriptCanAccessClipboard
-
- Allows JavaScript programs to read from or write to the clipboard.
- Writing to the clipboard is always allowed if it is specifically requested by the user.
-
- To enable also the pasting of clipboard content from JavaScript,
- use javascriptCanPaste.
-
- Disabled by default.
-*/
-bool QQuickWebEngineSettings::javascriptCanAccessClipboard() const
-{
- return d_ptr->testAttribute(WebEngineSettings::JavascriptCanAccessClipboard);
-}
-
-/*!
- \qmlproperty bool WebEngineSettings::linksIncludedInFocusChain
-
- Includes hyperlinks in the keyboard focus chain.
-
- Enabled by default.
-*/
-bool QQuickWebEngineSettings::linksIncludedInFocusChain() const
-{
- return d_ptr->testAttribute(WebEngineSettings::LinksIncludedInFocusChain);
-}
-
-/*!
- \qmlproperty bool WebEngineSettings::localStorageEnabled
-
- Enables support for the HTML 5 local storage feature.
-
- Enabled by default.
-*/
-bool QQuickWebEngineSettings::localStorageEnabled() const
-{
- return d_ptr->testAttribute(WebEngineSettings::LocalStorageEnabled);
-}
-
-/*!
- \qmlproperty bool WebEngineSettings::localContentCanAccessRemoteUrls
-
- Allows locally loaded documents to access remote URLs.
-
- Disabled by default.
-*/
-bool QQuickWebEngineSettings::localContentCanAccessRemoteUrls() const
-{
- return d_ptr->testAttribute(WebEngineSettings::LocalContentCanAccessRemoteUrls);
-}
-
-/*!
- \qmlproperty bool WebEngineSettings::spatialNavigationEnabled
-
- Enables the Spatial Navigation feature, which means the ability to navigate between focusable
- elements, such as hyperlinks and form controls, on a web page by using the Left, Right, Up and
- Down arrow keys.
-
- For example, if a user presses the Right key, heuristics determine whether there is an element
- they might be trying to reach towards the right and which element they probably want.
-
- Disabled by default.
-
-*/
-bool QQuickWebEngineSettings::spatialNavigationEnabled() const
-{
- return d_ptr->testAttribute(WebEngineSettings::SpatialNavigationEnabled);
-}
-
-/*!
- \qmlproperty bool WebEngineSettings::localContentCanAccessFileUrls
-
- Allows locally loaded documents to access other local URLs.
-
- Enabled by default.
-*/
-bool QQuickWebEngineSettings::localContentCanAccessFileUrls() const
-{
- return d_ptr->testAttribute(WebEngineSettings::LocalContentCanAccessFileUrls);
-}
-
-/*!
- \qmlproperty bool WebEngineSettings::hyperlinkAuditingEnabled
-
- Enables support for the \c ping attribute for hyperlinks.
-
- Disabled by default.
-*/
-bool QQuickWebEngineSettings::hyperlinkAuditingEnabled() const
-{
- return d_ptr->testAttribute(WebEngineSettings::HyperlinkAuditingEnabled);
-}
-
-/*!
- \qmlproperty bool WebEngineSettings::errorPageEnabled
-
- Enables displaying the built-in error pages of Chromium.
-
- Enabled by default.
-*/
-bool QQuickWebEngineSettings::errorPageEnabled() const
-{
- return d_ptr->testAttribute(WebEngineSettings::ErrorPageEnabled);
-}
-
-/*!
- \qmlproperty bool WebEngineSettings::pluginsEnabled
-
- Enables support for Pepper plugins, such as the Flash player.
-
- Disabled by default.
-
- \sa {Pepper Plugin API}
-*/
-bool QQuickWebEngineSettings::pluginsEnabled() const
-{
- return d_ptr->testAttribute(WebEngineSettings::PluginsEnabled);
-}
-
-/*!
- \qmlproperty bool WebEngineSettings::fullscreenSupportEnabled
- \since QtWebEngine 1.2
-
- Tells the web engine whether fullscreen is supported in this application or not.
-
- Disabled by default.
-*/
-bool QQuickWebEngineSettings::fullScreenSupportEnabled() const
-{
- return d_ptr->testAttribute(WebEngineSettings::FullScreenSupportEnabled);
-}
-
-/*!
- \qmlproperty bool WebEngineSettings::screenCaptureEnabled
- \since QtWebEngine 1.3
-
- Tells the web engine whether screen capture is supported in this application or not.
-
- Disabled by default.
-*/
-bool QQuickWebEngineSettings::screenCaptureEnabled() const
-{
- return d_ptr->testAttribute(WebEngineSettings::ScreenCaptureEnabled);
-}
-
-/*!
- \qmlproperty bool WebEngineSettings::webGLEnabled
- \since QtWebEngine 1.3
-
- Enables support for HTML 5 WebGL.
-
- Enabled by default if available.
-*/
-bool QQuickWebEngineSettings::webGLEnabled() const
-{
- return d_ptr->testAttribute(WebEngineSettings::WebGLEnabled);
-}
-
-/*!
- \qmlproperty bool WebEngineSettings::accelerated2dCanvasEnabled
- \since QtWebEngine 1.3
-
- Specifies whether the HTML 5 2D canvas should be an OpenGL framebuffer.
- This makes many painting operations faster, but slows down pixel access.
-
- Enabled by default if available.
-*/
-bool QQuickWebEngineSettings::accelerated2dCanvasEnabled() const
-{
- return d_ptr->testAttribute(WebEngineSettings::Accelerated2dCanvasEnabled);
-}
-
-/*!
- \qmlproperty bool WebEngineSettings::autoLoadIconsForPage
- \since QtWebEngine 1.3
-
- Automatically downloads icons for web pages.
-
- Enabled by default.
-*/
-bool QQuickWebEngineSettings::autoLoadIconsForPage() const
-{
- return d_ptr->testAttribute(WebEngineSettings::AutoLoadIconsForPage);
-}
-
-/*!
- \qmlproperty bool WebEngineSettings::touchIconsEnabled
- \since QtWebEngine 1.3
-
- Enables support for touch icons and precomposed touch icons.
-
- Disabled by default.
-*/
-bool QQuickWebEngineSettings::touchIconsEnabled() const
-{
- return d_ptr->testAttribute(WebEngineSettings::TouchIconsEnabled);
-}
-
-/*!
- \qmlproperty bool WebEngineSettings::focusOnNavigationEnabled
- \since QtWebEngine 1.4
-
- Focus is given to the view whenever a navigation operation occurs
- (load, stop, reload, reload and bypass cache, forward, backward, set content, and so on).
-
- Disabled by default.
-*/
-bool QQuickWebEngineSettings::focusOnNavigationEnabled() const
-{
- return d_ptr->testAttribute(WebEngineSettings::FocusOnNavigationEnabled);
-}
-
-/*!
- \qmlproperty bool WebEngineSettings::printElementBackgrounds
- \since QtWebEngine 1.4
-
- Turns on printing of CSS backgrounds when printing a web page.
-
- Enabled by default.
-*/
-bool QQuickWebEngineSettings::printElementBackgrounds() const
-{
- return d_ptr->testAttribute(WebEngineSettings::PrintElementBackgrounds);
-}
-
-/*!
- \qmlproperty bool WebEngineSettings::allowRunningInsecureContent
- \since QtWebEngine 1.4
-
- By default, HTTPS pages cannot run JavaScript, CSS, plugins or
- web-sockets from HTTP URLs. This used to be possible and this
- provides an override to get the old behavior.
-
- Disabled by default.
-*/
-bool QQuickWebEngineSettings::allowRunningInsecureContent() const
-{
- return d_ptr->testAttribute(WebEngineSettings::AllowRunningInsecureContent);
-}
-
-/*!
- \qmlproperty bool WebEngineSettings::allowGeolocationOnInsecureOrigins
- \since QtWebEngine 1.5
-
- Since Qt 5.7, only secure origins such as HTTPS have been able to request
- Geolocation features. This provides an override to allow non secure
- origins to access Geolocation again.
-
- Disabled by default.
-*/
-bool QQuickWebEngineSettings::allowGeolocationOnInsecureOrigins() const
-{
- return d_ptr->testAttribute(WebEngineSettings::AllowGeolocationOnInsecureOrigins);
-}
-
-/*!
- \qmlproperty bool WebEngineSettings::allowWindowActivationFromJavaScript
- \since QtWebEngine 1.6
- Allows the window.focus() method in JavaScript. Disallowed by default.
-*/
-bool QQuickWebEngineSettings::allowWindowActivationFromJavaScript() const
-{
- return d_ptr->testAttribute(WebEngineSettings::AllowWindowActivationFromJavaScript);
-}
-
-/*!
- \qmlproperty bool WebEngineSettings::showScrollBars
- \since QtWebEngine 1.6
- Shows scroll bars. Enabled by default.
-*/
-bool QQuickWebEngineSettings::showScrollBars() const
-{
- return d_ptr->testAttribute(WebEngineSettings::ShowScrollBars);
-}
-
-/*!
- \qmlproperty bool WebEngineSettings::playbackRequiresUserGesture
- \since QtWebEngine 1.7
- Inhibits playback of media content until the user interacts with
- the page.
-
- By default, Qt WebEngine uses Chromium settings, as described in
- \l {Autoplay Policy Changes}. To overwrite the default behavior,
- this property must be set to \c false.
-
- \note The behavior is similar to Chrome on Android when enabled,
- and similar to Chrome on desktops when disabled.
-*/
-bool QQuickWebEngineSettings::playbackRequiresUserGesture() const
-{
- return d_ptr->testAttribute(WebEngineSettings::PlaybackRequiresUserGesture);
-}
-
-/*!
- \qmlproperty bool WebEngineSettings::webRTCPublicInterfacesOnly
- \since QtWebEngine 1.7
- Limits WebRTC to public IP addresses only. When disabled WebRTC may also use
- local network IP addresses, but remote hosts can also see your local network
- IP address.
-
- Disabled by default.
-*/
-bool QQuickWebEngineSettings::webRTCPublicInterfacesOnly() const
-{
- return d_ptr->testAttribute(WebEngineSettings::WebRTCPublicInterfacesOnly);
-}
-
-/*!
- \qmlproperty bool WebEngineSettings::javascriptCanPaste
- \since QtWebEngine 1.7
-
- Enables JavaScript \c{execCommand("paste")}.
- This also requires enabling javascriptCanAccessClipboard.
-
- Disabled by default.
-*/
-bool QQuickWebEngineSettings::javascriptCanPaste() const
-{
- return d_ptr->testAttribute(WebEngineSettings::JavascriptCanPaste);
-}
-
-/*!
- \qmlproperty bool WebEngineSettings::dnsPrefetchEnabled
- \since QtWebEngine 1.8
-
- Enables speculative prefetching of DNS records for HTML links before
- they are activated.
-
- Disabled by default.
-*/
-bool QQuickWebEngineSettings::dnsPrefetchEnabled() const
-{
- return d_ptr->testAttribute(WebEngineSettings::DnsPrefetchEnabled);
-}
-
-/*!
- \qmlproperty bool WebEngineSettings::pdfViewerEnabled
- \since QtWebEngine 1.9
-
- Specifies that PDF documents will be opened in the internal PDF viewer
- instead of being downloaded.
-
- Enabled by default.
-*/
-bool QQuickWebEngineSettings::pdfViewerEnabled() const
-{
- return d_ptr->testAttribute(WebEngineSettings::PdfViewerEnabled);
-}
-
-/*!
- \qmlproperty string WebEngineSettings::defaultTextEncoding
- \since QtWebEngine 1.2
-
- Sets the default encoding. The value must be a string describing an encoding such as "utf-8" or
- "iso-8859-1".
-
- If left empty, a default value will be used.
-*/
-QString QQuickWebEngineSettings::defaultTextEncoding() const
-{
- return d_ptr->defaultTextEncoding();
-}
-
-ASSERT_ENUMS_MATCH(QQuickWebEngineSettings::DisallowUnknownUrlSchemes, WebEngineSettings::DisallowUnknownUrlSchemes)
-ASSERT_ENUMS_MATCH(QQuickWebEngineSettings::AllowUnknownUrlSchemesFromUserInteraction, WebEngineSettings::AllowUnknownUrlSchemesFromUserInteraction)
-ASSERT_ENUMS_MATCH(QQuickWebEngineSettings::AllowAllUnknownUrlSchemes, WebEngineSettings::AllowAllUnknownUrlSchemes)
-
-/*!
- \qmlproperty WebEngineSettings::UnknownUrlSchemePolicy WebEngineSettings::unknownUrlSchemePolicy
- \since QtWebEngine 1.7
- Specifies how navigation requests to URLs with unknown schemes are handled.
-
- Default is \l{QWebEngineSettings::UnknownUrlSchemePolicy}{WebEngineSettings.AllowUnknownUrlSchemesFromUserInteraction}.
-*/
-QQuickWebEngineSettings::UnknownUrlSchemePolicy QQuickWebEngineSettings::unknownUrlSchemePolicy() const
-{
- return static_cast<QQuickWebEngineSettings::UnknownUrlSchemePolicy>(d_ptr->unknownUrlSchemePolicy());
-}
-
-void QQuickWebEngineSettings::setAutoLoadImages(bool on)
-{
- bool wasOn = d_ptr->testAttribute(WebEngineSettings::AutoLoadImages);
- // Set unconditionally as it sets the override for the current settings while the current setting
- // could be from the fallback and is prone to changing later on.
- d_ptr->setAttribute(WebEngineSettings::AutoLoadImages, on);
- if (wasOn != on)
- Q_EMIT autoLoadImagesChanged();
-}
-
-void QQuickWebEngineSettings::setJavascriptEnabled(bool on)
-{
- bool wasOn = d_ptr->testAttribute(WebEngineSettings::JavascriptEnabled);
- d_ptr->setAttribute(WebEngineSettings::JavascriptEnabled, on);
- if (wasOn != on)
- Q_EMIT javascriptEnabledChanged();
-}
-
-void QQuickWebEngineSettings::setJavascriptCanOpenWindows(bool on)
-{
- bool wasOn = d_ptr->testAttribute(WebEngineSettings::JavascriptCanOpenWindows);
- d_ptr->setAttribute(WebEngineSettings::JavascriptCanOpenWindows, on);
- if (wasOn != on)
- Q_EMIT javascriptCanOpenWindowsChanged();
-}
-
-void QQuickWebEngineSettings::setJavascriptCanAccessClipboard(bool on)
-{
- bool wasOn = d_ptr->testAttribute(WebEngineSettings::JavascriptCanAccessClipboard);
- d_ptr->setAttribute(WebEngineSettings::JavascriptCanAccessClipboard, on);
- if (wasOn != on)
- Q_EMIT javascriptCanAccessClipboardChanged();
-}
-
-void QQuickWebEngineSettings::setLinksIncludedInFocusChain(bool on)
-{
- bool wasOn = d_ptr->testAttribute(WebEngineSettings::LinksIncludedInFocusChain);
- d_ptr->setAttribute(WebEngineSettings::LinksIncludedInFocusChain, on);
- if (wasOn != on)
- Q_EMIT linksIncludedInFocusChainChanged();
-}
-
-void QQuickWebEngineSettings::setLocalStorageEnabled(bool on)
-{
- bool wasOn = d_ptr->testAttribute(WebEngineSettings::LocalStorageEnabled);
- d_ptr->setAttribute(WebEngineSettings::LocalStorageEnabled, on);
- if (wasOn != on)
- Q_EMIT localStorageEnabledChanged();
-}
-
-void QQuickWebEngineSettings::setLocalContentCanAccessRemoteUrls(bool on)
-{
- bool wasOn = d_ptr->testAttribute(WebEngineSettings::LocalContentCanAccessRemoteUrls);
- d_ptr->setAttribute(WebEngineSettings::LocalContentCanAccessRemoteUrls, on);
- if (wasOn != on)
- Q_EMIT localContentCanAccessRemoteUrlsChanged();
-}
-
-
-void QQuickWebEngineSettings::setSpatialNavigationEnabled(bool on)
-{
- bool wasOn = d_ptr->testAttribute(WebEngineSettings::SpatialNavigationEnabled);
- d_ptr->setAttribute(WebEngineSettings::SpatialNavigationEnabled, on);
- if (wasOn != on)
- Q_EMIT spatialNavigationEnabledChanged();
-}
-
-void QQuickWebEngineSettings::setLocalContentCanAccessFileUrls(bool on)
-{
- bool wasOn = d_ptr->testAttribute(WebEngineSettings::LocalContentCanAccessFileUrls);
- d_ptr->setAttribute(WebEngineSettings::LocalContentCanAccessFileUrls, on);
- if (wasOn != on)
- Q_EMIT localContentCanAccessFileUrlsChanged();
-}
-
-void QQuickWebEngineSettings::setHyperlinkAuditingEnabled(bool on)
-{
- bool wasOn = d_ptr->testAttribute(WebEngineSettings::HyperlinkAuditingEnabled);
- d_ptr->setAttribute(WebEngineSettings::HyperlinkAuditingEnabled, on);
- if (wasOn != on)
- Q_EMIT hyperlinkAuditingEnabledChanged();
-}
-
-void QQuickWebEngineSettings::setErrorPageEnabled(bool on)
-{
- bool wasOn = d_ptr->testAttribute(WebEngineSettings::ErrorPageEnabled);
- d_ptr->setAttribute(WebEngineSettings::ErrorPageEnabled, on);
- if (wasOn != on)
- Q_EMIT errorPageEnabledChanged();
-}
-
-void QQuickWebEngineSettings::setPluginsEnabled(bool on)
-{
- bool wasOn = d_ptr->testAttribute(WebEngineSettings::PluginsEnabled);
- d_ptr->setAttribute(WebEngineSettings::PluginsEnabled, on);
- if (wasOn != on)
- Q_EMIT pluginsEnabledChanged();
-}
-
-void QQuickWebEngineSettings::setFullScreenSupportEnabled(bool on)
-{
- bool wasOn = d_ptr->testAttribute(WebEngineSettings::FullScreenSupportEnabled);
- d_ptr->setAttribute(WebEngineSettings::FullScreenSupportEnabled, on);
- if (wasOn != on)
- Q_EMIT fullScreenSupportEnabledChanged();
-}
-
-void QQuickWebEngineSettings::setScreenCaptureEnabled(bool on)
-{
- bool wasOn = d_ptr->testAttribute(WebEngineSettings::ScreenCaptureEnabled);
- d_ptr->setAttribute(WebEngineSettings::ScreenCaptureEnabled, on);
- if (wasOn != on)
- Q_EMIT screenCaptureEnabledChanged();
-}
-
-void QQuickWebEngineSettings::setWebGLEnabled(bool on)
-{
- bool wasOn = d_ptr->testAttribute(WebEngineSettings::WebGLEnabled);
- d_ptr->setAttribute(WebEngineSettings::WebGLEnabled, on);
- if (wasOn != on)
- Q_EMIT webGLEnabledChanged();
-}
-
-void QQuickWebEngineSettings::setAccelerated2dCanvasEnabled(bool on)
-{
- bool wasOn = d_ptr->testAttribute(WebEngineSettings::Accelerated2dCanvasEnabled);
- d_ptr->setAttribute(WebEngineSettings::Accelerated2dCanvasEnabled, on);
- if (wasOn != on)
- Q_EMIT accelerated2dCanvasEnabledChanged();
-}
-
-void QQuickWebEngineSettings::setAutoLoadIconsForPage(bool on)
-{
- bool wasOn = d_ptr->testAttribute(WebEngineSettings::AutoLoadIconsForPage);
- d_ptr->setAttribute(WebEngineSettings::AutoLoadIconsForPage, on);
- if (wasOn != on)
- Q_EMIT autoLoadIconsForPageChanged();
-}
-
-void QQuickWebEngineSettings::setTouchIconsEnabled(bool on)
-{
- bool wasOn = d_ptr->testAttribute(WebEngineSettings::TouchIconsEnabled);
- d_ptr->setAttribute(WebEngineSettings::TouchIconsEnabled, on);
- if (wasOn != on)
- Q_EMIT touchIconsEnabledChanged();
-}
-
-void QQuickWebEngineSettings::setPrintElementBackgrounds(bool on)
-{
- bool wasOn = d_ptr->testAttribute(WebEngineSettings::PrintElementBackgrounds);
- d_ptr->setAttribute(WebEngineSettings::PrintElementBackgrounds, on);
- if (wasOn != on)
- Q_EMIT printElementBackgroundsChanged();
-}
-
-void QQuickWebEngineSettings::setDefaultTextEncoding(QString encoding)
-{
- const QString oldDefaultTextEncoding = d_ptr->defaultTextEncoding();
- d_ptr->setDefaultTextEncoding(encoding);
- if (oldDefaultTextEncoding.compare(encoding))
- Q_EMIT defaultTextEncodingChanged();
-}
-
-void QQuickWebEngineSettings::setFocusOnNavigationEnabled(bool on)
-{
- bool wasOn = d_ptr->testAttribute(WebEngineSettings::FocusOnNavigationEnabled);
- d_ptr->setAttribute(WebEngineSettings::FocusOnNavigationEnabled, on);
- if (wasOn != on)
- Q_EMIT focusOnNavigationEnabledChanged();
-}
-
-
-void QQuickWebEngineSettings::setAllowRunningInsecureContent(bool on)
-{
- bool wasOn = d_ptr->testAttribute(WebEngineSettings::AllowRunningInsecureContent);
- d_ptr->setAttribute(WebEngineSettings::AllowRunningInsecureContent, on);
- if (wasOn != on)
- Q_EMIT allowRunningInsecureContentChanged();
-}
-
-void QQuickWebEngineSettings::setAllowGeolocationOnInsecureOrigins(bool on)
-{
- bool wasOn = d_ptr->testAttribute(WebEngineSettings::AllowGeolocationOnInsecureOrigins);
- d_ptr->setAttribute(WebEngineSettings::AllowGeolocationOnInsecureOrigins, on);
- if (wasOn != on)
- Q_EMIT allowGeolocationOnInsecureOriginsChanged();
-}
-
-void QQuickWebEngineSettings::setAllowWindowActivationFromJavaScript(bool on)
-{
- bool wasOn = d_ptr->testAttribute(WebEngineSettings::AllowWindowActivationFromJavaScript);
- d_ptr->setAttribute(WebEngineSettings::AllowWindowActivationFromJavaScript, on);
- if (wasOn != on)
- Q_EMIT allowWindowActivationFromJavaScriptChanged();
-}
-
-void QQuickWebEngineSettings::setShowScrollBars(bool on)
-{
- bool wasOn = d_ptr->testAttribute(WebEngineSettings::ShowScrollBars);
- d_ptr->setAttribute(WebEngineSettings::ShowScrollBars, on);
- if (wasOn != on)
- Q_EMIT showScrollBarsChanged();
-}
-
-void QQuickWebEngineSettings::setPlaybackRequiresUserGesture(bool on)
-{
- bool wasOn = d_ptr->testAttribute(WebEngineSettings::PlaybackRequiresUserGesture);
- d_ptr->setAttribute(WebEngineSettings::PlaybackRequiresUserGesture, on);
- if (wasOn != on)
- Q_EMIT playbackRequiresUserGestureChanged();
-}
-
-void QQuickWebEngineSettings::setJavascriptCanPaste(bool on)
-{
- bool wasOn = d_ptr->testAttribute(WebEngineSettings::JavascriptCanPaste);
- d_ptr->setAttribute(WebEngineSettings::JavascriptCanPaste, on);
- if (wasOn != on)
- Q_EMIT javascriptCanPasteChanged();
-}
-
-void QQuickWebEngineSettings::setDnsPrefetchEnabled(bool on)
-{
- bool wasOn = d_ptr->testAttribute(WebEngineSettings::DnsPrefetchEnabled);
- d_ptr->setAttribute(WebEngineSettings::DnsPrefetchEnabled, on);
- if (wasOn != on)
- Q_EMIT dnsPrefetchEnabledChanged();
-}
-
-void QQuickWebEngineSettings::setPdfViewerEnabled(bool on)
-{
- bool wasOn = d_ptr->testAttribute(WebEngineSettings::PdfViewerEnabled);
- d_ptr->setAttribute(WebEngineSettings::PdfViewerEnabled, on);
- if (wasOn != on)
- Q_EMIT pdfViewerEnabledChanged();
-}
-
-void QQuickWebEngineSettings::setUnknownUrlSchemePolicy(QQuickWebEngineSettings::UnknownUrlSchemePolicy policy)
-{
- WebEngineSettings::UnknownUrlSchemePolicy oldPolicy = d_ptr->unknownUrlSchemePolicy();
- WebEngineSettings::UnknownUrlSchemePolicy newPolicy = static_cast<WebEngineSettings::UnknownUrlSchemePolicy>(policy);
- d_ptr->setUnknownUrlSchemePolicy(newPolicy);
- if (oldPolicy != newPolicy)
- Q_EMIT unknownUrlSchemePolicyChanged();
-}
-
-void QQuickWebEngineSettings::setWebRTCPublicInterfacesOnly(bool on)
-{
- bool wasOn = d_ptr->testAttribute(WebEngineSettings::WebRTCPublicInterfacesOnly);
- d_ptr->setAttribute(WebEngineSettings::WebRTCPublicInterfacesOnly, on);
- if (wasOn != on)
- Q_EMIT webRTCPublicInterfacesOnlyChanged();
-}
-
-void QQuickWebEngineSettings::setParentSettings(QQuickWebEngineSettings *parentSettings)
-{
- d_ptr->setParentSettings(parentSettings->d_ptr.data());
- d_ptr->scheduleApplyRecursively();
-}
-
-QT_END_NAMESPACE
diff --git a/src/webengine/api/qquickwebenginesettings_p.h b/src/webengine/api/qquickwebenginesettings_p.h
deleted file mode 100644
index ce43e0e9c..000000000
--- a/src/webengine/api/qquickwebenginesettings_p.h
+++ /dev/null
@@ -1,219 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKWEBENGINESETTINGS_P_H
-#define QQUICKWEBENGINESETTINGS_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtWebEngine/private/qtwebengineglobal_p.h>
-#include <QObject>
-#include <QScopedPointer>
-
-namespace QtWebEngineCore {
-class WebEngineSettings;
-}
-
-QT_BEGIN_NAMESPACE
-
-class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineSettings : public QObject {
- Q_OBJECT
- Q_PROPERTY(bool autoLoadImages READ autoLoadImages WRITE setAutoLoadImages NOTIFY autoLoadImagesChanged FINAL)
- Q_PROPERTY(bool javascriptEnabled READ javascriptEnabled WRITE setJavascriptEnabled NOTIFY javascriptEnabledChanged FINAL)
- Q_PROPERTY(bool javascriptCanOpenWindows READ javascriptCanOpenWindows WRITE setJavascriptCanOpenWindows NOTIFY javascriptCanOpenWindowsChanged FINAL)
- Q_PROPERTY(bool javascriptCanAccessClipboard READ javascriptCanAccessClipboard WRITE setJavascriptCanAccessClipboard NOTIFY javascriptCanAccessClipboardChanged FINAL)
- Q_PROPERTY(bool linksIncludedInFocusChain READ linksIncludedInFocusChain WRITE setLinksIncludedInFocusChain NOTIFY linksIncludedInFocusChainChanged FINAL)
- Q_PROPERTY(bool localStorageEnabled READ localStorageEnabled WRITE setLocalStorageEnabled NOTIFY localStorageEnabledChanged FINAL)
- Q_PROPERTY(bool localContentCanAccessRemoteUrls READ localContentCanAccessRemoteUrls WRITE setLocalContentCanAccessRemoteUrls NOTIFY localContentCanAccessRemoteUrlsChanged FINAL)
- Q_PROPERTY(bool spatialNavigationEnabled READ spatialNavigationEnabled WRITE setSpatialNavigationEnabled NOTIFY spatialNavigationEnabledChanged FINAL)
- Q_PROPERTY(bool localContentCanAccessFileUrls READ localContentCanAccessFileUrls WRITE setLocalContentCanAccessFileUrls NOTIFY localContentCanAccessFileUrlsChanged FINAL)
- Q_PROPERTY(bool hyperlinkAuditingEnabled READ hyperlinkAuditingEnabled WRITE setHyperlinkAuditingEnabled NOTIFY hyperlinkAuditingEnabledChanged FINAL)
- Q_PROPERTY(bool errorPageEnabled READ errorPageEnabled WRITE setErrorPageEnabled NOTIFY errorPageEnabledChanged FINAL)
- Q_PROPERTY(bool pluginsEnabled READ pluginsEnabled WRITE setPluginsEnabled NOTIFY pluginsEnabledChanged FINAL)
- Q_PROPERTY(bool fullScreenSupportEnabled READ fullScreenSupportEnabled WRITE setFullScreenSupportEnabled NOTIFY fullScreenSupportEnabledChanged REVISION 1 FINAL)
- Q_PROPERTY(QString defaultTextEncoding READ defaultTextEncoding WRITE setDefaultTextEncoding NOTIFY defaultTextEncodingChanged FINAL)
- Q_PROPERTY(bool screenCaptureEnabled READ screenCaptureEnabled WRITE setScreenCaptureEnabled NOTIFY screenCaptureEnabledChanged REVISION 2 FINAL)
- Q_PROPERTY(bool webGLEnabled READ webGLEnabled WRITE setWebGLEnabled NOTIFY webGLEnabledChanged REVISION 2 FINAL)
- Q_PROPERTY(bool accelerated2dCanvasEnabled READ accelerated2dCanvasEnabled WRITE setAccelerated2dCanvasEnabled NOTIFY accelerated2dCanvasEnabledChanged REVISION 2 FINAL)
- Q_PROPERTY(bool autoLoadIconsForPage READ autoLoadIconsForPage WRITE setAutoLoadIconsForPage NOTIFY autoLoadIconsForPageChanged REVISION 2 FINAL)
- Q_PROPERTY(bool touchIconsEnabled READ touchIconsEnabled WRITE setTouchIconsEnabled NOTIFY touchIconsEnabledChanged REVISION 2 FINAL)
- Q_PROPERTY(bool focusOnNavigationEnabled READ focusOnNavigationEnabled WRITE setFocusOnNavigationEnabled NOTIFY focusOnNavigationEnabledChanged REVISION 3 FINAL)
- Q_PROPERTY(bool printElementBackgrounds READ printElementBackgrounds WRITE setPrintElementBackgrounds NOTIFY printElementBackgroundsChanged REVISION 3 FINAL)
- Q_PROPERTY(bool allowRunningInsecureContent READ allowRunningInsecureContent WRITE setAllowRunningInsecureContent NOTIFY allowRunningInsecureContentChanged REVISION 3 FINAL)
- Q_PROPERTY(bool allowGeolocationOnInsecureOrigins READ allowGeolocationOnInsecureOrigins WRITE setAllowGeolocationOnInsecureOrigins NOTIFY allowGeolocationOnInsecureOriginsChanged REVISION 4 FINAL)
- Q_PROPERTY(bool allowWindowActivationFromJavaScript READ allowWindowActivationFromJavaScript WRITE setAllowWindowActivationFromJavaScript NOTIFY allowWindowActivationFromJavaScriptChanged REVISION 5 FINAL)
- Q_PROPERTY(bool showScrollBars READ showScrollBars WRITE setShowScrollBars NOTIFY showScrollBarsChanged REVISION 5 FINAL)
- Q_PROPERTY(UnknownUrlSchemePolicy unknownUrlSchemePolicy READ unknownUrlSchemePolicy WRITE setUnknownUrlSchemePolicy NOTIFY unknownUrlSchemePolicyChanged REVISION 6 FINAL)
- Q_PROPERTY(bool playbackRequiresUserGesture READ playbackRequiresUserGesture WRITE setPlaybackRequiresUserGesture NOTIFY playbackRequiresUserGestureChanged REVISION 6 FINAL)
- Q_PROPERTY(bool webRTCPublicInterfacesOnly READ webRTCPublicInterfacesOnly WRITE setWebRTCPublicInterfacesOnly NOTIFY webRTCPublicInterfacesOnlyChanged REVISION 6 FINAL)
- Q_PROPERTY(bool javascriptCanPaste READ javascriptCanPaste WRITE setJavascriptCanPaste NOTIFY javascriptCanPasteChanged REVISION 6 FINAL)
- Q_PROPERTY(bool dnsPrefetchEnabled READ dnsPrefetchEnabled WRITE setDnsPrefetchEnabled NOTIFY dnsPrefetchEnabledChanged REVISION 7 FINAL)
- Q_PROPERTY(bool pdfViewerEnabled READ pdfViewerEnabled WRITE setPdfViewerEnabled NOTIFY pdfViewerEnabledChanged REVISION 8 FINAL)
-
-public:
- enum UnknownUrlSchemePolicy {
- DisallowUnknownUrlSchemes = 1,
- AllowUnknownUrlSchemesFromUserInteraction,
- AllowAllUnknownUrlSchemes
- };
-
- Q_ENUM(UnknownUrlSchemePolicy)
-
- ~QQuickWebEngineSettings();
-
- bool autoLoadImages() const;
- bool javascriptEnabled() const;
- bool javascriptCanOpenWindows() const;
- bool javascriptCanAccessClipboard() const;
- bool linksIncludedInFocusChain() const;
- bool localStorageEnabled() const;
- bool localContentCanAccessRemoteUrls() const;
- bool spatialNavigationEnabled() const;
- bool localContentCanAccessFileUrls() const;
- bool hyperlinkAuditingEnabled() const;
- bool errorPageEnabled() const;
- bool pluginsEnabled() const;
- bool fullScreenSupportEnabled() const;
- QString defaultTextEncoding() const;
- bool screenCaptureEnabled() const;
- bool webGLEnabled() const;
- bool accelerated2dCanvasEnabled() const;
- bool autoLoadIconsForPage() const;
- bool touchIconsEnabled() const;
- bool focusOnNavigationEnabled() const;
- bool printElementBackgrounds() const;
- bool allowRunningInsecureContent() const;
- bool allowGeolocationOnInsecureOrigins() const;
- bool allowWindowActivationFromJavaScript() const;
- bool showScrollBars() const;
- UnknownUrlSchemePolicy unknownUrlSchemePolicy() const;
- bool playbackRequiresUserGesture() const;
- bool webRTCPublicInterfacesOnly() const;
- bool javascriptCanPaste() const;
- bool dnsPrefetchEnabled() const;
- bool pdfViewerEnabled() const;
-
- void setAutoLoadImages(bool on);
- void setJavascriptEnabled(bool on);
- void setJavascriptCanOpenWindows(bool on);
- void setJavascriptCanAccessClipboard(bool on);
- void setLinksIncludedInFocusChain(bool on);
- void setLocalStorageEnabled(bool on);
- void setLocalContentCanAccessRemoteUrls(bool on);
- void setSpatialNavigationEnabled(bool on);
- void setLocalContentCanAccessFileUrls(bool on);
- void setHyperlinkAuditingEnabled(bool on);
- void setErrorPageEnabled(bool on);
- void setPluginsEnabled(bool on);
- void setFullScreenSupportEnabled(bool on);
- void setDefaultTextEncoding(QString encoding);
- void setScreenCaptureEnabled(bool on);
- void setWebGLEnabled(bool on);
- void setAccelerated2dCanvasEnabled(bool on);
- void setAutoLoadIconsForPage(bool on);
- void setTouchIconsEnabled(bool on);
- void setFocusOnNavigationEnabled(bool on);
- void setPrintElementBackgrounds(bool on);
- void setAllowRunningInsecureContent(bool on);
- void setAllowGeolocationOnInsecureOrigins(bool on);
- void setAllowWindowActivationFromJavaScript(bool on);
- void setShowScrollBars(bool on);
- void setUnknownUrlSchemePolicy(UnknownUrlSchemePolicy policy);
- void setPlaybackRequiresUserGesture(bool on);
- void setWebRTCPublicInterfacesOnly(bool on);
- void setJavascriptCanPaste(bool on);
- void setDnsPrefetchEnabled(bool on);
- void setPdfViewerEnabled(bool on);
-
-signals:
- void autoLoadImagesChanged();
- void javascriptEnabledChanged();
- void javascriptCanOpenWindowsChanged();
- void javascriptCanAccessClipboardChanged();
- void linksIncludedInFocusChainChanged();
- void localStorageEnabledChanged();
- void localContentCanAccessRemoteUrlsChanged();
- void spatialNavigationEnabledChanged();
- void localContentCanAccessFileUrlsChanged();
- void hyperlinkAuditingEnabledChanged();
- void errorPageEnabledChanged();
- void pluginsEnabledChanged();
- Q_REVISION(1) void fullScreenSupportEnabledChanged();
- void defaultTextEncodingChanged();
- Q_REVISION(2) void screenCaptureEnabledChanged();
- Q_REVISION(2) void webGLEnabledChanged();
- Q_REVISION(2) void accelerated2dCanvasEnabledChanged();
- Q_REVISION(2) void autoLoadIconsForPageChanged();
- Q_REVISION(2) void touchIconsEnabledChanged();
- Q_REVISION(3) void focusOnNavigationEnabledChanged();
- Q_REVISION(3) void printElementBackgroundsChanged();
- Q_REVISION(3) void allowRunningInsecureContentChanged();
- Q_REVISION(4) void allowGeolocationOnInsecureOriginsChanged();
- Q_REVISION(5) void allowWindowActivationFromJavaScriptChanged();
- Q_REVISION(5) void showScrollBarsChanged();
- Q_REVISION(6) void unknownUrlSchemePolicyChanged();
- Q_REVISION(6) void playbackRequiresUserGestureChanged();
- Q_REVISION(6) void webRTCPublicInterfacesOnlyChanged();
- Q_REVISION(6) void javascriptCanPasteChanged();
- Q_REVISION(7) void dnsPrefetchEnabledChanged();
- Q_REVISION(8) void pdfViewerEnabledChanged();
-
-private:
- explicit QQuickWebEngineSettings(QQuickWebEngineSettings *parentSettings = 0);
- Q_DISABLE_COPY(QQuickWebEngineSettings)
- friend class QQuickWebEngineProfilePrivate;
- friend class QQuickWebEngineViewPrivate;
- friend class QQuickWebEngineView;
- void setParentSettings(QQuickWebEngineSettings *parentSettings);
-
- QScopedPointer<QtWebEngineCore::WebEngineSettings> d_ptr;
-};
-
-QT_END_NAMESPACE
-
-#endif // QQUICKWEBENGINESETTINGS_P_H
diff --git a/src/webengine/api/qquickwebenginesingleton.cpp b/src/webengine/api/qquickwebenginesingleton.cpp
deleted file mode 100644
index 3e84f5cf0..000000000
--- a/src/webengine/api/qquickwebenginesingleton.cpp
+++ /dev/null
@@ -1,93 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickwebenginesingleton_p.h"
-
-#include "qquickwebenginesettings_p.h"
-#include <QtWebEngine/QQuickWebEngineProfile>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \qmltype WebEngine
- \instantiates QQuickWebEngineSingleton
- \inqmlmodule QtWebEngine
- \since QtWebEngine 1.1
- \brief Provides access to the default settings and profiles shared by all web engine views.
-
- The WebEngine singleton type provides access to the default profile and the default settings
- shared by all web engine views. It can be used to change settings globally, as illustrated by
- the following code snippet:
-
- \code
- Component.onCompleted: {
- WebEngine.settings.pluginsEnabled = true;
- }
- \endcode
-*/
-
-/*!
- \qmlproperty WebEngineSettings WebEngine::settings
- \readonly
- \since QtWebEngine 1.1
-
- Default settings for all web engine views.
-
- \sa WebEngineSettings
-*/
-QQuickWebEngineSettings *QQuickWebEngineSingleton::settings() const
-{
- return defaultProfile()->settings();
-}
-
-/*!
- \qmlproperty WebEngineProfile WebEngine::defaultProfile
- \readonly
- \since QtWebEngine 1.1
-
- Default profile for all web engine views.
-
- \sa WebEngineProfile
-*/
-QQuickWebEngineProfile *QQuickWebEngineSingleton::defaultProfile() const
-{
- return QQuickWebEngineProfile::defaultProfile();
-}
-
-QT_END_NAMESPACE
diff --git a/src/webengine/api/qquickwebenginesingleton_p.h b/src/webengine/api/qquickwebenginesingleton_p.h
deleted file mode 100644
index ba63382e5..000000000
--- a/src/webengine/api/qquickwebenginesingleton_p.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKWEBENGINESINGLETON_P_H
-#define QQUICKWEBENGINESINGLETON_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtWebEngine/private/qtwebengineglobal_p.h>
-#include <QObject>
-
-QT_BEGIN_NAMESPACE
-class QQuickWebEngineProfile;
-class QQuickWebEngineSettings;
-class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineSingleton : public QObject {
- Q_OBJECT
- Q_PROPERTY(QQuickWebEngineSettings* settings READ settings CONSTANT FINAL)
- Q_PROPERTY(QQuickWebEngineProfile* defaultProfile READ defaultProfile CONSTANT FINAL REVISION 1)
-
-public:
- QQuickWebEngineSettings *settings() const;
- QQuickWebEngineProfile *defaultProfile() const;
-};
-
-QT_END_NAMESPACE
-
-#endif // QQUICKWEBENGINESINGLETON_P_H
diff --git a/src/webengine/api/qquickwebenginetestsupport.cpp b/src/webengine/api/qquickwebenginetestsupport.cpp
deleted file mode 100644
index bef87160e..000000000
--- a/src/webengine/api/qquickwebenginetestsupport.cpp
+++ /dev/null
@@ -1,193 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickwebenginetestsupport_p.h"
-
-#include "qquickwebengineloadrequest_p.h"
-#include <QQuickWindow>
-#include <QtTest/qtest.h>
-#include <QtCore/QTimer>
-
-QT_BEGIN_NAMESPACE
-
-namespace QTest {
- int Q_TESTLIB_EXPORT defaultMouseDelay();
-}
-
-QQuickWebEngineErrorPage::QQuickWebEngineErrorPage()
-{
-}
-
-void QQuickWebEngineErrorPage::loadFinished(bool success, const QUrl &url)
-{
- Q_UNUSED(success);
- QTimer::singleShot(0, this, [this, url]() {
- QQuickWebEngineLoadRequest loadRequest(url, QQuickWebEngineView::LoadSucceededStatus);
- emit loadingChanged(&loadRequest);
- });
-}
-
-void QQuickWebEngineErrorPage::loadStarted(const QUrl &provisionalUrl)
-{
- QTimer::singleShot(0, this, [this, provisionalUrl]() {
- QQuickWebEngineLoadRequest loadRequest(provisionalUrl, QQuickWebEngineView::LoadStartedStatus);
- emit loadingChanged(&loadRequest);
- });
-}
-
-QQuickWebEngineTestInputContext::QQuickWebEngineTestInputContext()
- : m_visible(false)
-{
-}
-
-QQuickWebEngineTestInputContext::~QQuickWebEngineTestInputContext()
-{
- release();
-}
-
-void QQuickWebEngineTestInputContext::create()
-{
- QInputMethodPrivate *inputMethodPrivate = QInputMethodPrivate::get(qApp->inputMethod());
- inputMethodPrivate->testContext = this;
-}
-
-void QQuickWebEngineTestInputContext::release()
-{
- QInputMethodPrivate *inputMethodPrivate = QInputMethodPrivate::get(qApp->inputMethod());
- inputMethodPrivate->testContext = 0;
-}
-
-void QQuickWebEngineTestInputContext::showInputPanel()
-{
- m_visible = true;
-}
-
-void QQuickWebEngineTestInputContext::hideInputPanel()
-{
- m_visible = false;
-}
-
-bool QQuickWebEngineTestInputContext::isInputPanelVisible() const
-{
- return m_visible;
-}
-
-
-QQuickWebEngineTestEvent::QQuickWebEngineTestEvent()
-{
-}
-
-bool QQuickWebEngineTestEvent::mouseMultiClick(QObject *item, qreal x, qreal y, int clickCount)
-{
- QTEST_ASSERT(item);
-
- QWindow *view = eventWindow(item);
- if (!view)
- return false;
-
- for (int i = 0; i < clickCount; ++i) {
- mouseEvent(QMouseEvent::MouseButtonPress, view, item, QPointF(x, y));
- mouseEvent(QMouseEvent::MouseButtonRelease, view, item, QPointF(x, y));
- }
- QTest::lastMouseTimestamp += QTest::mouseDoubleClickInterval;
-
- return true;
-}
-
-QWindow *QQuickWebEngineTestEvent::eventWindow(QObject *item)
-{
- QWindow *window = qobject_cast<QWindow *>(item);
- if (window)
- return window;
-
- QQuickItem *quickItem = qobject_cast<QQuickItem *>(item);
- if (quickItem)
- return quickItem->window();
-
- QQuickItem *testParentItem = qobject_cast<QQuickItem *>(parent());
- if (testParentItem)
- return testParentItem->window();
-
- return nullptr;
-}
-
-void QQuickWebEngineTestEvent::mouseEvent(QEvent::Type type, QWindow *window, QObject *item, const QPointF &_pos)
-{
- QTest::qWait(QTest::defaultMouseDelay());
- QTest::lastMouseTimestamp += QTest::defaultMouseDelay();
-
- QPoint pos;
- QQuickItem *sgitem = qobject_cast<QQuickItem *>(item);
- if (sgitem)
- pos = sgitem->mapToScene(_pos).toPoint();
-
- QMouseEvent me(type, pos, window->mapFromGlobal(pos), Qt::LeftButton, Qt::LeftButton, {});
- me.setTimestamp(++QTest::lastMouseTimestamp);
-
- QSpontaneKeyEvent::setSpontaneous(&me);
- if (!qApp->notify(window, &me))
- QTest::qWarn("Mouse click event not accepted by receiving window");
-}
-
-
-QQuickWebEngineTestSupport::QQuickWebEngineTestSupport()
- : m_errorPage(new QQuickWebEngineErrorPage)
- , m_testInputContext(new QQuickWebEngineTestInputContext)
- , m_testEvent(new QQuickWebEngineTestEvent)
-{
-}
-
-QQuickWebEngineErrorPage *QQuickWebEngineTestSupport::errorPage() const
-{
- return m_errorPage.data();
-}
-
-QQuickWebEngineTestInputContext *QQuickWebEngineTestSupport::testInputContext() const
-{
- return m_testInputContext.data();
-}
-
-QQuickWebEngineTestEvent * QQuickWebEngineTestSupport::testEvent() const
-{
- return m_testEvent.data();
-}
-
-QT_END_NAMESPACE
-
-#include "moc_qquickwebenginetestsupport_p.cpp"
diff --git a/src/webengine/api/qquickwebenginetestsupport_p.h b/src/webengine/api/qquickwebenginetestsupport_p.h
deleted file mode 100644
index 30e6ee5c4..000000000
--- a/src/webengine/api/qquickwebenginetestsupport_p.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKWEBENGINETESTSUPPORT_P_H
-#define QQUICKWEBENGINETESTSUPPORT_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtGui/private/qinputmethod_p.h>
-#include <QtWebEngine/private/qtwebengineglobal_p.h>
-
-#include <QEvent>
-#include <QObject>
-#include <QUrl>
-
-QT_BEGIN_NAMESPACE
-
-class QQuickWebEngineLoadRequest;
-class QWindow;
-
-class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineErrorPage : public QObject {
- Q_OBJECT
-
-public:
- QQuickWebEngineErrorPage();
-
- void loadFinished(bool success, const QUrl &url);
- void loadStarted(const QUrl &provisionalUrl);
-
-Q_SIGNALS:
- void loadingChanged(QQuickWebEngineLoadRequest *loadRequest);
-};
-
-class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineTestInputContext : public QPlatformInputContext {
- Q_OBJECT
-
-public:
- QQuickWebEngineTestInputContext();
- ~QQuickWebEngineTestInputContext();
-
- Q_INVOKABLE void create();
- Q_INVOKABLE void release();
-
- virtual void showInputPanel();
- virtual void hideInputPanel();
- virtual bool isInputPanelVisible() const;
-
-private:
- bool m_visible;
-};
-
-class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineTestEvent : public QObject {
- Q_OBJECT
-
-public:
- QQuickWebEngineTestEvent();
-
-public Q_SLOTS:
- bool mouseMultiClick(QObject *item, qreal x, qreal y, int clickCount);
-
-private:
- QWindow *eventWindow(QObject *item = 0);
- void mouseEvent(QEvent::Type type, QWindow *window, QObject *item, const QPointF &_pos);
-};
-
-class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineTestSupport : public QObject {
- Q_OBJECT
- Q_PROPERTY(QQuickWebEngineErrorPage *errorPage READ errorPage CONSTANT FINAL)
- Q_PROPERTY(QQuickWebEngineTestInputContext *testInputContext READ testInputContext CONSTANT FINAL)
- Q_PROPERTY(QQuickWebEngineTestEvent *testEvent READ testEvent CONSTANT FINAL)
-
-public:
- QQuickWebEngineTestSupport();
- QQuickWebEngineErrorPage *errorPage() const;
- QQuickWebEngineTestInputContext *testInputContext() const;
- QQuickWebEngineTestEvent *testEvent() const;
-
-Q_SIGNALS:
- void windowCloseRejected();
- void loadVisuallyCommitted();
-
-private:
- QScopedPointer<QQuickWebEngineErrorPage> m_errorPage;
- QScopedPointer<QQuickWebEngineTestInputContext> m_testInputContext;
- QScopedPointer<QQuickWebEngineTestEvent> m_testEvent;
-};
-
-QT_END_NAMESPACE
-
-#endif // QQUICKWEBENGINETESTSUPPORT_P_H
diff --git a/src/webengine/api/qquickwebenginetouchhandleprovider.cpp b/src/webengine/api/qquickwebenginetouchhandleprovider.cpp
deleted file mode 100644
index 80f4727b6..000000000
--- a/src/webengine/api/qquickwebenginetouchhandleprovider.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickwebenginetouchhandleprovider_p_p.h"
-
-// static
-QString QQuickWebEngineTouchHandleProvider::identifier()
-{
- return QStringLiteral("touchhandle");
-}
-
-// static
-QUrl QQuickWebEngineTouchHandleProvider::url(int orientation)
-{
- return QUrl(QStringLiteral("image://%1/%2").arg(identifier(), QString::number(orientation)));
-}
-
-QQuickWebEngineTouchHandleProvider::QQuickWebEngineTouchHandleProvider()
- : QQuickImageProvider(QQuickImageProvider::Image)
-{
-}
-
-QQuickWebEngineTouchHandleProvider::~QQuickWebEngineTouchHandleProvider()
-{
-}
-
-void QQuickWebEngineTouchHandleProvider::init(const QMap<int, QImage> &images)
-{
- if (!m_touchHandleMap.empty()) {
- Q_ASSERT(images.size() == m_touchHandleMap.size());
- return;
- }
-
- m_touchHandleMap.unite(images);
-}
-
-QImage QQuickWebEngineTouchHandleProvider::requestImage(const QString &id, QSize *size, const QSize &requestedSize)
-{
- Q_UNUSED(size);
- Q_UNUSED(requestedSize);
-
- Q_ASSERT(m_touchHandleMap.contains(id.toInt()));
- return m_touchHandleMap.value(id.toInt());
-}
diff --git a/src/webengine/api/qquickwebenginetouchhandleprovider_p_p.h b/src/webengine/api/qquickwebenginetouchhandleprovider_p_p.h
deleted file mode 100644
index 277436289..000000000
--- a/src/webengine/api/qquickwebenginetouchhandleprovider_p_p.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKWEBENGINETOUCHHANDLEPROVIDER_P_P_H
-#define QQUICKWEBENGINETOUCHHANDLEPROVIDER_P_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtQuick/QQuickImageProvider>
-#include <QtWebEngine/private/qtwebengineglobal_p.h>
-
-QT_BEGIN_NAMESPACE
-
-class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineTouchHandleProvider : public QQuickImageProvider {
-public:
- static QString identifier();
- static QUrl url(int orientation);
-
- QQuickWebEngineTouchHandleProvider();
- ~QQuickWebEngineTouchHandleProvider();
-
- void init(const QMap<int, QImage> &images);
- virtual QImage requestImage(const QString &id, QSize *size, const QSize &requestedSize);
-
-private:
- QMap<int, QImage> m_touchHandleMap;
-};
-
-
-QT_END_NAMESPACE
-
-#endif // QQUICKWEBENGINETOUCHHANDLEPROVIDER_P_P_H
diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp
deleted file mode 100644
index aeb202c6a..000000000
--- a/src/webengine/api/qquickwebengineview.cpp
+++ /dev/null
@@ -1,2496 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickwebengineview_p.h"
-#include "qquickwebengineview_p_p.h"
-#include "authentication_dialog_controller.h"
-#include "profile_adapter.h"
-#include "certificate_error_controller.h"
-#include "file_picker_controller.h"
-#include "find_text_helper.h"
-#include "javascript_dialog_controller.h"
-#include "touch_selection_menu_controller.h"
-
-#include "qquickwebengineaction_p.h"
-#include "qquickwebengineaction_p_p.h"
-#include "qquickwebenginehistory_p.h"
-#include "qquickwebenginecertificateerror_p.h"
-#include "qquickwebengineclientcertificateselection_p.h"
-#include "qquickwebenginecontextmenurequest_p.h"
-#include "qquickwebenginedialogrequests_p.h"
-#include "qquickwebenginefaviconprovider_p_p.h"
-#include "qquickwebengineloadrequest_p.h"
-#include "qquickwebenginenavigationrequest_p.h"
-#include "qquickwebenginenewviewrequest_p.h"
-#include "qquickwebengineprofile_p.h"
-#include "qquickwebenginesettings_p.h"
-#include "qquickwebenginescript_p.h"
-#include "qquickwebenginetouchhandleprovider_p_p.h"
-#include "qwebenginefindtextresult.h"
-#include "qwebenginequotarequest.h"
-#include "qwebengineregisterprotocolhandlerrequest.h"
-
-#if QT_CONFIG(webengine_testsupport)
-#include "qquickwebenginetestsupport_p.h"
-#endif
-
-#include "render_widget_host_view_qt_delegate_quick.h"
-#include "render_widget_host_view_qt_delegate_quickwindow.h"
-#include "renderer_host/user_resource_controller_host.h"
-#include "ui_delegates_manager.h"
-#include "web_contents_adapter.h"
-#include "web_engine_error.h"
-#include "web_engine_settings.h"
-
-#include <QClipboard>
-#include <QGuiApplication>
-#include <QLoggingCategory>
-#include <QMarginsF>
-#include <QMimeData>
-#include <QPageLayout>
-#include <QPageSize>
-#include <QQmlComponent>
-#include <QQmlContext>
-#include <QQmlEngine>
-#include <QQmlProperty>
-#if QT_CONFIG(webengine_webchannel)
-#include <QQmlWebChannel>
-#endif
-#include <QQuickWebEngineProfile>
-#include <QScreen>
-#include <QUrl>
-#include <QTimer>
-#include <QtGui/private/qguiapplication_p.h>
-#include <QtGui/qpa/qplatformintegration.h>
-
-QT_BEGIN_NAMESPACE
-using namespace QtWebEngineCore;
-
-#ifndef QT_NO_ACCESSIBILITY
-static QAccessibleInterface *webAccessibleFactory(const QString &, QObject *object)
-{
- if (QQuickWebEngineView *v = qobject_cast<QQuickWebEngineView*>(object))
- return new QQuickWebEngineViewAccessible(v);
- return 0;
-}
-#endif // QT_NO_ACCESSIBILITY
-
-static QLatin1String defaultMimeType("text/html;charset=UTF-8");
-
-QQuickWebEngineViewPrivate::QQuickWebEngineViewPrivate()
- : m_profile(nullptr)
- , adapter(QSharedPointer<WebContentsAdapter>::create())
- , m_history(new QQuickWebEngineHistory(this))
-#if QT_CONFIG(webengine_testsupport)
- , m_testSupport(0)
-#endif
- , contextMenuExtraItems(0)
- , faviconProvider(0)
- , loadProgress(0)
- , m_fullscreenMode(false)
- , isLoading(false)
- , m_activeFocusOnPress(true)
- , devicePixelRatio(QGuiApplication::primaryScreen()->devicePixelRatio())
- , m_webChannel(0)
- , m_webChannelWorld(0)
- , m_defaultAudioMuted(false)
- , m_isBeingAdopted(false)
- , m_backgroundColor(Qt::white)
- , m_zoomFactor(1.0)
- , m_ui2Enabled(false)
- , m_profileInitialized(false)
-{
- memset(actions, 0, sizeof(actions));
-
- QString platform = qApp->platformName().toLower();
- if (platform == QLatin1String("eglfs"))
- m_ui2Enabled = true;
-
- const QByteArray dialogSet = qgetenv("QTWEBENGINE_DIALOG_SET");
-
- if (!dialogSet.isEmpty()) {
- if (dialogSet == QByteArrayLiteral("QtQuickControls2")) {
- m_ui2Enabled = true;
- } else if (dialogSet == QByteArrayLiteral("QtQuickControls1")
- && m_ui2Enabled) {
- m_ui2Enabled = false;
- qWarning("QTWEBENGINE_DIALOG_SET=QtQuickControls1 forces use of Qt Quick Controls 1 "
- "on an eglfs backend. This can crash your application!");
- } else {
- qWarning("Ignoring QTWEBENGINE_DIALOG_SET environment variable set to %s. Accepted "
- "values are \"QtQuickControls1\" and \"QtQuickControls2\"", dialogSet.data());
- }
- }
-
-#ifndef QT_NO_ACCESSIBILITY
- QAccessible::installFactory(&webAccessibleFactory);
-#endif // QT_NO_ACCESSIBILITY
-}
-
-QQuickWebEngineViewPrivate::~QQuickWebEngineViewPrivate()
-{
- Q_ASSERT(m_profileInitialized);
- m_profile->d_ptr->removeWebContentsAdapterClient(this);
- if (faviconProvider)
- faviconProvider->detach(q_ptr);
- // q_ptr->d_ptr might be null due to destroy()
- if (q_ptr->d_ptr)
- bindViewAndWidget(q_ptr, nullptr);
-}
-
-void QQuickWebEngineViewPrivate::initializeProfile()
-{
- if (!m_profileInitialized) {
- Q_ASSERT(!adapter->isInitialized());
- m_profileInitialized = true;
- if (!m_profile)
- m_profile = QQuickWebEngineProfile::defaultProfile();
- m_profile->d_ptr->addWebContentsAdapterClient(this);
- m_settings.reset(new QQuickWebEngineSettings(m_profile->settings()));
- adapter->setClient(this);
- }
-}
-
-bool QQuickWebEngineViewPrivate::profileInitialized() const
-{
- return m_profileInitialized;
-}
-
-void QQuickWebEngineViewPrivate::releaseProfile()
-{
- // The profile for this web contents is about to be
- // garbage collected, delete WebContents first and
- // let the QQuickWebEngineView be collected later by gc.
- bindViewAndWidget(q_ptr, nullptr);
- delete q_ptr->d_ptr.take();
-}
-
-UIDelegatesManager *QQuickWebEngineViewPrivate::ui()
-{
- Q_Q(QQuickWebEngineView);
- if (m_uIDelegatesManager.isNull())
- m_uIDelegatesManager.reset(m_ui2Enabled ? new UI2DelegatesManager(q) : new UIDelegatesManager(q));
- return m_uIDelegatesManager.data();
-}
-
-RenderWidgetHostViewQtDelegate *QQuickWebEngineViewPrivate::CreateRenderWidgetHostViewQtDelegate(RenderWidgetHostViewQtDelegateClient *client)
-{
- return new RenderWidgetHostViewQtDelegateQuick(client, /*isPopup = */ false);
-}
-
-RenderWidgetHostViewQtDelegate *QQuickWebEngineViewPrivate::CreateRenderWidgetHostViewQtDelegateForPopup(RenderWidgetHostViewQtDelegateClient *client)
-{
- Q_Q(QQuickWebEngineView);
- const bool hasWindowCapability = QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::MultipleWindows);
- RenderWidgetHostViewQtDelegateQuick *quickDelegate = new RenderWidgetHostViewQtDelegateQuick(client, /*isPopup = */ true);
- if (hasWindowCapability) {
- RenderWidgetHostViewQtDelegateQuickWindow *wrapperWindow = new RenderWidgetHostViewQtDelegateQuickWindow(quickDelegate);
- wrapperWindow->setVirtualParent(q);
- quickDelegate->setParentItem(wrapperWindow->contentItem());
- return wrapperWindow;
- }
- quickDelegate->setParentItem(q);
- return quickDelegate;
-}
-
-void QQuickWebEngineViewPrivate::contextMenuRequested(const WebEngineContextMenuData &data)
-{
- Q_Q(QQuickWebEngineView);
-
- m_contextMenuData = data;
-
- QQuickWebEngineContextMenuRequest *request = new QQuickWebEngineContextMenuRequest(data);
- QQmlEngine *engine = qmlEngine(q);
-
- // TODO: this is a workaround for QTBUG-65044
- if (!engine)
- return;
-
- // mark the object for gc by creating temporary jsvalue
- engine->newQObject(request);
- Q_EMIT q->contextMenuRequested(request);
-
- if (request->isAccepted())
- return;
-
- // Assign the WebEngineView as the parent of the menu, so mouse events are properly propagated
- // on OSX.
- QObject *menu = ui()->addMenu(q, QString(), data.position());
- if (!menu)
- return;
-
- QQuickContextMenuBuilder contextMenuBuilder(data, q, menu);
-
- // Populate our menu
- contextMenuBuilder.initMenu();
-
- // FIXME: expose the context menu data as an attached property to make this more useful
- if (contextMenuExtraItems)
- contextMenuBuilder.appendExtraItems(engine);
-
- // Now fire the popup() method on the top level menu
- ui()->showMenu(menu);
-}
-
-void QQuickWebEngineViewPrivate::navigationRequested(int navigationType, const QUrl &url, int &navigationRequestAction, bool isMainFrame)
-{
- Q_Q(QQuickWebEngineView);
- QQuickWebEngineNavigationRequest navigationRequest(url, static_cast<QQuickWebEngineView::NavigationType>(navigationType), isMainFrame);
- Q_EMIT q->navigationRequested(&navigationRequest);
-
- navigationRequestAction = navigationRequest.action();
- if ((navigationRequestAction == WebContentsAdapterClient::AcceptRequest) && adapter->findTextHelper()->isFindTextInProgress())
- adapter->findTextHelper()->stopFinding();
-}
-
-void QQuickWebEngineViewPrivate::javascriptDialog(QSharedPointer<JavaScriptDialogController> dialog)
-{
- Q_Q(QQuickWebEngineView);
- QQuickWebEngineJavaScriptDialogRequest *request = new QQuickWebEngineJavaScriptDialogRequest(dialog);
- // mark the object for gc by creating temporary jsvalue
- qmlEngine(q)->newQObject(request);
- Q_EMIT q->javaScriptDialogRequested(request);
- if (!request->isAccepted())
- ui()->showDialog(dialog);
-}
-
-void QQuickWebEngineViewPrivate::allowCertificateError(const QSharedPointer<CertificateErrorController> &errorController)
-{
- Q_Q(QQuickWebEngineView);
-
- QQuickWebEngineCertificateError *quickController = new QQuickWebEngineCertificateError(errorController);
- // mark the object for gc by creating temporary jsvalue
- qmlEngine(q)->newQObject(quickController);
- Q_EMIT q->certificateError(quickController);
- if (!quickController->overridable() || (!quickController->deferred() && !quickController->answered()))
- quickController->rejectCertificate();
- else
- m_certificateErrorControllers.append(errorController);
-}
-
-void QQuickWebEngineViewPrivate::selectClientCert(const QSharedPointer<ClientCertSelectController> &controller)
-{
-#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
- Q_Q(QQuickWebEngineView);
- QQuickWebEngineClientCertificateSelection *certSelection = new QQuickWebEngineClientCertificateSelection(controller);
- // mark the object for gc by creating temporary jsvalue
- qmlEngine(q)->newQObject(certSelection);
- Q_EMIT q->selectClientCertificate(certSelection);
-#else
- Q_UNUSED(controller);
-#endif
-}
-
-static QQuickWebEngineView::Feature toFeature(QtWebEngineCore::ProfileAdapter::PermissionType type)
-{
- switch (type) {
- case QtWebEngineCore::ProfileAdapter::NotificationPermission:
- return QQuickWebEngineView::Notifications;
- case QtWebEngineCore::ProfileAdapter::GeolocationPermission:
- return QQuickWebEngineView::Geolocation;
- default:
- break;
- }
- Q_UNREACHABLE();
- return QQuickWebEngineView::Feature(-1);
-}
-
-
-void QQuickWebEngineViewPrivate::runFeaturePermissionRequest(QtWebEngineCore::ProfileAdapter::PermissionType permission, const QUrl &url)
-{
- Q_Q(QQuickWebEngineView);
- Q_EMIT q->featurePermissionRequested(url, toFeature(permission));
-}
-
-void QQuickWebEngineViewPrivate::showColorDialog(QSharedPointer<ColorChooserController> controller)
-{
- Q_Q(QQuickWebEngineView);
- QQuickWebEngineColorDialogRequest *request = new QQuickWebEngineColorDialogRequest(controller);
- // mark the object for gc by creating temporary jsvalue
- qmlEngine(q)->newQObject(request);
- Q_EMIT q->colorDialogRequested(request);
- if (!request->isAccepted())
- ui()->showColorDialog(controller);
-}
-
-void QQuickWebEngineViewPrivate::runFileChooser(QSharedPointer<FilePickerController> controller)
-{
- Q_Q(QQuickWebEngineView);
- QQuickWebEngineFileDialogRequest *request = new QQuickWebEngineFileDialogRequest(controller);
- // mark the object for gc by creating temporary jsvalue
- qmlEngine(q)->newQObject(request);
- Q_EMIT q->fileDialogRequested(request);
- if (!request->isAccepted())
- ui()->showFilePicker(controller);
-}
-
-bool QQuickWebEngineViewPrivate::passOnFocus(bool reverse)
-{
- Q_Q(QQuickWebEngineView);
- // The child delegate currently has focus, find the next one from there and give it focus.
- QQuickItem *next = q->scopedFocusItem()->nextItemInFocusChain(!reverse);
- if (next) {
- next->forceActiveFocus(reverse ? Qt::BacktabFocusReason : Qt::TabFocusReason);
- return true;
- }
- return false;
-}
-
-void QQuickWebEngineViewPrivate::titleChanged(const QString &title)
-{
- Q_Q(QQuickWebEngineView);
- Q_UNUSED(title);
- Q_EMIT q->titleChanged();
-}
-
-void QQuickWebEngineViewPrivate::urlChanged()
-{
- Q_Q(QQuickWebEngineView);
- QUrl url = adapter->activeUrl();
- if (m_url != url) {
- m_url = url;
- Q_EMIT q->urlChanged();
- }
-}
-
-void QQuickWebEngineViewPrivate::iconChanged(const QUrl &url)
-{
- Q_Q(QQuickWebEngineView);
-
- if (iconUrl == QQuickWebEngineFaviconProvider::faviconProviderUrl(url))
- return;
-
- if (!faviconProvider) {
- QQmlEngine *engine = qmlEngine(q);
-
- // TODO: this is a workaround for QTBUG-65044
- if (!engine)
- return;
-
- Q_ASSERT(engine);
- faviconProvider = static_cast<QQuickWebEngineFaviconProvider *>(
- engine->imageProvider(QQuickWebEngineFaviconProvider::identifier()));
- Q_ASSERT(faviconProvider);
- }
-
- iconUrl = faviconProvider->attach(q, url);
- m_history->reset();
- QTimer::singleShot(0, q, &QQuickWebEngineView::iconChanged);
-}
-
-void QQuickWebEngineViewPrivate::loadProgressChanged(int progress)
-{
- Q_Q(QQuickWebEngineView);
- loadProgress = progress;
- QTimer::singleShot(0, q, &QQuickWebEngineView::loadProgressChanged);
-}
-
-void QQuickWebEngineViewPrivate::didUpdateTargetURL(const QUrl &hoveredUrl)
-{
- Q_Q(QQuickWebEngineView);
- Q_EMIT q->linkHovered(hoveredUrl);
-}
-
-void QQuickWebEngineViewPrivate::selectionChanged()
-{
- updateEditActions();
-}
-
-void QQuickWebEngineViewPrivate::recentlyAudibleChanged(bool recentlyAudible)
-{
- Q_Q(QQuickWebEngineView);
- Q_EMIT q->recentlyAudibleChanged(recentlyAudible);
-}
-
-void QQuickWebEngineViewPrivate::renderProcessPidChanged(qint64 pid)
-{
- Q_Q(QQuickWebEngineView);
- Q_EMIT q->renderProcessPidChanged(pid);
-}
-
-QRectF QQuickWebEngineViewPrivate::viewportRect() const
-{
- Q_Q(const QQuickWebEngineView);
- return QRectF(q->x(), q->y(), q->width(), q->height());
-}
-
-QColor QQuickWebEngineViewPrivate::backgroundColor() const
-{
- return m_backgroundColor;
-}
-
-void QQuickWebEngineViewPrivate::loadStarted(const QUrl &provisionalUrl, bool isErrorPage)
-{
- Q_Q(QQuickWebEngineView);
- if (isErrorPage) {
-#if QT_CONFIG(webengine_testsupport)
- if (m_testSupport)
- m_testSupport->errorPage()->loadStarted(provisionalUrl);
-#endif
- return;
- }
-
- isLoading = true;
- m_history->reset();
- m_certificateErrorControllers.clear();
-
- QTimer::singleShot(0, q, [q, provisionalUrl]() {
- QQuickWebEngineLoadRequest loadRequest(provisionalUrl, QQuickWebEngineView::LoadStartedStatus);
-
- emit q->loadingChanged(&loadRequest);
- });
-}
-
-void QQuickWebEngineViewPrivate::loadCommitted()
-{
- m_history->reset();
-}
-
-void QQuickWebEngineViewPrivate::loadVisuallyCommitted()
-{
-#if QT_CONFIG(webengine_testsupport)
- if (m_testSupport)
- Q_EMIT m_testSupport->loadVisuallyCommitted();
-#endif
-}
-
-Q_STATIC_ASSERT(static_cast<int>(WebEngineError::NoErrorDomain) == static_cast<int>(QQuickWebEngineView::NoErrorDomain));
-Q_STATIC_ASSERT(static_cast<int>(WebEngineError::CertificateErrorDomain) == static_cast<int>(QQuickWebEngineView::CertificateErrorDomain));
-Q_STATIC_ASSERT(static_cast<int>(WebEngineError::DnsErrorDomain) == static_cast<int>(QQuickWebEngineView::DnsErrorDomain));
-
-void QQuickWebEngineViewPrivate::loadFinished(bool success, const QUrl &url, bool isErrorPage, int errorCode, const QString &errorDescription)
-{
- Q_Q(QQuickWebEngineView);
-
- if (isErrorPage) {
-#if QT_CONFIG(webengine_testsupport)
- if (m_testSupport)
- m_testSupport->errorPage()->loadFinished(success, url);
-#endif
- return;
- }
-
- isLoading = false;
- m_history->reset();
- if (errorCode == WebEngineError::UserAbortedError) {
- QTimer::singleShot(0, q, [q, url]() {
- QQuickWebEngineLoadRequest loadRequest(url, QQuickWebEngineView::LoadStoppedStatus);
- emit q->loadingChanged(&loadRequest);
- });
- return;
- }
- if (success) {
- QTimer::singleShot(0, q, [q, url, errorDescription, errorCode]() {
- QQuickWebEngineLoadRequest loadRequest(url, QQuickWebEngineView::LoadSucceededStatus, errorDescription, errorCode);
- emit q->loadingChanged(&loadRequest);
- });
- return;
- }
-
- Q_ASSERT(errorCode);
- QQuickWebEngineView::ErrorDomain errorDomain = static_cast<QQuickWebEngineView::ErrorDomain>(WebEngineError::toQtErrorDomain(errorCode));
- QTimer::singleShot(0, q, [q, url, errorDescription, errorCode, errorDomain]() {
- QQuickWebEngineLoadRequest loadRequest(url, QQuickWebEngineView::LoadFailedStatus,errorDescription, errorCode, errorDomain);
- emit q->loadingChanged(&loadRequest);
- });
- return;
-}
-
-void QQuickWebEngineViewPrivate::focusContainer()
-{
- Q_Q(QQuickWebEngineView);
- QQuickWindow *window = q->window();
- if (window)
- window->requestActivate();
- q->forceActiveFocus();
-}
-
-void QQuickWebEngineViewPrivate::unhandledKeyEvent(QKeyEvent *event)
-{
- Q_Q(QQuickWebEngineView);
- if (q->parentItem())
- QCoreApplication::sendEvent(q->parentItem(), event);
-}
-
-QSharedPointer<WebContentsAdapter>
-QQuickWebEngineViewPrivate::adoptNewWindow(QSharedPointer<WebContentsAdapter> newWebContents,
- WindowOpenDisposition disposition, bool userGesture,
- const QRect &, const QUrl &targetUrl)
-{
- Q_Q(QQuickWebEngineView);
- QQuickWebEngineNewViewRequest request;
- request.m_adapter = newWebContents;
- request.m_isUserInitiated = userGesture;
- request.m_requestedUrl = targetUrl;
-
- switch (disposition) {
- case WebContentsAdapterClient::NewForegroundTabDisposition:
- request.m_destination = QQuickWebEngineView::NewViewInTab;
- break;
- case WebContentsAdapterClient::NewBackgroundTabDisposition:
- request.m_destination = QQuickWebEngineView::NewViewInBackgroundTab;
- break;
- case WebContentsAdapterClient::NewPopupDisposition:
- request.m_destination = QQuickWebEngineView::NewViewInDialog;
- break;
- case WebContentsAdapterClient::NewWindowDisposition:
- request.m_destination = QQuickWebEngineView::NewViewInWindow;
- break;
- default:
- Q_UNREACHABLE();
- }
-
- Q_EMIT q->newViewRequested(&request);
-
- return newWebContents;
-}
-
-bool QQuickWebEngineViewPrivate::isBeingAdopted()
-{
- return false;
-}
-
-void QQuickWebEngineViewPrivate::close()
-{
- Q_Q(QQuickWebEngineView);
- emit q->windowCloseRequested();
-}
-
-void QQuickWebEngineViewPrivate::windowCloseRejected()
-{
-#if QT_CONFIG(webengine_testsupport)
- if (m_testSupport)
- Q_EMIT m_testSupport->windowCloseRejected();
-#endif
-}
-
-void QQuickWebEngineViewPrivate::requestFullScreenMode(const QUrl &origin, bool fullscreen)
-{
- Q_Q(QQuickWebEngineView);
- QQuickWebEngineFullScreenRequest request(this, origin, fullscreen);
- Q_EMIT q->fullScreenRequested(request);
-}
-
-bool QQuickWebEngineViewPrivate::isFullScreenMode() const
-{
- return m_fullscreenMode;
-}
-
-void QQuickWebEngineViewPrivate::javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString& message, int lineNumber, const QString& sourceID)
-{
- Q_Q(QQuickWebEngineView);
- if (q->receivers(SIGNAL(javaScriptConsoleMessage(JavaScriptConsoleMessageLevel,QString,int,QString))) > 0) {
- Q_EMIT q->javaScriptConsoleMessage(static_cast<QQuickWebEngineView::JavaScriptConsoleMessageLevel>(level), message, lineNumber, sourceID);
- return;
- }
-
- static QLoggingCategory loggingCategory("js", QtWarningMsg);
- const QByteArray file = sourceID.toUtf8();
- QMessageLogger logger(file.constData(), lineNumber, nullptr, loggingCategory.categoryName());
-
- switch (level) {
- case JavaScriptConsoleMessageLevel::Info:
- if (loggingCategory.isInfoEnabled())
- logger.info().noquote() << message;
- break;
- case JavaScriptConsoleMessageLevel::Warning:
- if (loggingCategory.isWarningEnabled())
- logger.warning().noquote() << message;
- break;
- case JavaScriptConsoleMessageLevel::Error:
- if (loggingCategory.isCriticalEnabled())
- logger.critical().noquote() << message;
- break;
- }
-}
-
-void QQuickWebEngineViewPrivate::authenticationRequired(QSharedPointer<AuthenticationDialogController> controller)
-{
- Q_Q(QQuickWebEngineView);
- QQuickWebEngineAuthenticationDialogRequest *request = new QQuickWebEngineAuthenticationDialogRequest(controller);
- // mark the object for gc by creating temporary jsvalue
- qmlEngine(q)->newQObject(request);
- Q_EMIT q->authenticationDialogRequested(request);
- if (!request->isAccepted())
- ui()->showDialog(controller);
-}
-
-void QQuickWebEngineViewPrivate::runMediaAccessPermissionRequest(const QUrl &securityOrigin, WebContentsAdapterClient::MediaRequestFlags requestFlags)
-{
- Q_Q(QQuickWebEngineView);
- if (!requestFlags)
- return;
- QQuickWebEngineView::Feature feature;
- if (requestFlags.testFlag(WebContentsAdapterClient::MediaAudioCapture) && requestFlags.testFlag(WebContentsAdapterClient::MediaVideoCapture))
- feature = QQuickWebEngineView::MediaAudioVideoCapture;
- else if (requestFlags.testFlag(WebContentsAdapterClient::MediaAudioCapture))
- feature = QQuickWebEngineView::MediaAudioCapture;
- else if (requestFlags.testFlag(WebContentsAdapterClient::MediaVideoCapture))
- feature = QQuickWebEngineView::MediaVideoCapture;
- else if (requestFlags.testFlag(WebContentsAdapterClient::MediaDesktopAudioCapture) &&
- requestFlags.testFlag(WebContentsAdapterClient::MediaDesktopVideoCapture))
- feature = QQuickWebEngineView::DesktopAudioVideoCapture;
- else // if (requestFlags.testFlag(WebContentsAdapterClient::MediaDesktopVideoCapture))
- feature = QQuickWebEngineView::DesktopVideoCapture;
- Q_EMIT q->featurePermissionRequested(securityOrigin, feature);
-}
-
-void QQuickWebEngineViewPrivate::runMouseLockPermissionRequest(const QUrl &securityOrigin)
-{
- // TODO: Add mouse lock support
- adapter->grantMouseLockPermission(securityOrigin, false);
-}
-
-void QQuickWebEngineViewPrivate::runQuotaRequest(QWebEngineQuotaRequest request)
-{
- Q_Q(QQuickWebEngineView);
- Q_EMIT q->quotaRequested(request);
-}
-
-void QQuickWebEngineViewPrivate::runRegisterProtocolHandlerRequest(QWebEngineRegisterProtocolHandlerRequest request)
-{
- Q_Q(QQuickWebEngineView);
- Q_EMIT q->registerProtocolHandlerRequested(request);
-}
-
-QObject *QQuickWebEngineViewPrivate::accessibilityParentObject()
-{
- Q_Q(QQuickWebEngineView);
- return q;
-}
-
-ProfileAdapter *QQuickWebEngineViewPrivate::profileAdapter()
-{
- return m_profile->d_ptr->profileAdapter();
-}
-
-WebContentsAdapter *QQuickWebEngineViewPrivate::webContentsAdapter()
-{
- return adapter.data();
-}
-
-void QQuickWebEngineViewPrivate::printRequested()
-{
- Q_Q(QQuickWebEngineView);
- QTimer::singleShot(0, q, [q]() {
- Q_EMIT q->printRequested();
- });
-}
-
-void QQuickWebEngineViewPrivate::widgetChanged(RenderWidgetHostViewQtDelegate *newWidgetBase)
-{
- Q_Q(QQuickWebEngineView);
- bindViewAndWidget(q, static_cast<RenderWidgetHostViewQtDelegateQuick *>(newWidgetBase));
-}
-
-void QQuickWebEngineViewPrivate::findTextFinished(const QWebEngineFindTextResult &result)
-{
- Q_Q(QQuickWebEngineView);
- Q_EMIT q->findTextFinished(result);
-}
-
-WebEngineSettings *QQuickWebEngineViewPrivate::webEngineSettings() const
-{
- return m_settings->d_ptr.data();
-}
-
-const QObject *QQuickWebEngineViewPrivate::holdingQObject() const
-{
- Q_Q(const QQuickWebEngineView);
- return q;
-}
-
-void QQuickWebEngineViewPrivate::lifecycleStateChanged(LifecycleState state)
-{
- Q_Q(QQuickWebEngineView);
- Q_EMIT q->lifecycleStateChanged(static_cast<QQuickWebEngineView::LifecycleState>(state));
-}
-
-void QQuickWebEngineViewPrivate::recommendedStateChanged(LifecycleState state)
-{
- Q_Q(QQuickWebEngineView);
- QTimer::singleShot(0, q, [q, state]() {
- Q_EMIT q->recommendedStateChanged(static_cast<QQuickWebEngineView::LifecycleState>(state));
- });
-}
-
-void QQuickWebEngineViewPrivate::visibleChanged(bool visible)
-{
- Q_UNUSED(visible);
-}
-
-#ifndef QT_NO_ACCESSIBILITY
-QQuickWebEngineViewAccessible::QQuickWebEngineViewAccessible(QQuickWebEngineView *o)
- : QAccessibleObject(o)
-{}
-
-bool QQuickWebEngineViewAccessible::isValid() const
-{
- if (!QAccessibleObject::isValid())
- return false;
-
- if (!engineView() || !engineView()->d_func())
- return false;
-
- return true;
-}
-
-QAccessibleInterface *QQuickWebEngineViewAccessible::parent() const
-{
- QQuickItem *parent = engineView()->parentItem();
- QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(parent);
- if (!iface)
- return QAccessible::queryAccessibleInterface(engineView()->window());
- return iface;
-}
-
-QAccessibleInterface *QQuickWebEngineViewAccessible::focusChild() const
-{
- if (child(0) && child(0)->focusChild())
- return child(0)->focusChild();
- return const_cast<QQuickWebEngineViewAccessible *>(this);
-}
-
-int QQuickWebEngineViewAccessible::childCount() const
-{
- return child(0) ? 1 : 0;
-}
-
-QAccessibleInterface *QQuickWebEngineViewAccessible::child(int index) const
-{
- if (index == 0 && isValid())
- return engineView()->d_func()->adapter->browserAccessible();
- return nullptr;
-}
-
-int QQuickWebEngineViewAccessible::indexOfChild(const QAccessibleInterface *c) const
-{
- if (child(0) && c == child(0))
- return 0;
- return -1;
-}
-
-QString QQuickWebEngineViewAccessible::text(QAccessible::Text) const
-{
- return QString();
-}
-
-QAccessible::Role QQuickWebEngineViewAccessible::role() const
-{
- return QAccessible::Client;
-}
-
-QAccessible::State QQuickWebEngineViewAccessible::state() const
-{
- QAccessible::State s;
- return s;
-}
-#endif // QT_NO_ACCESSIBILITY
-
-class WebContentsAdapterOwner : public QObject
-{
-public:
- typedef QSharedPointer<QtWebEngineCore::WebContentsAdapter> AdapterPtr;
- WebContentsAdapterOwner(const AdapterPtr &ptr)
- : adapter(ptr)
- {}
-
-private:
- AdapterPtr adapter;
-};
-
-void QQuickWebEngineViewPrivate::adoptWebContents(WebContentsAdapter *webContents)
-{
- if (!webContents) {
- qWarning("Trying to open an empty request, it was either already used or was invalidated."
- "\nYou must complete the request synchronously within the newViewRequested signal handler."
- " If a view hasn't been adopted before returning, the request will be invalidated.");
- return;
- }
-
- if (webContents->profileAdapter() && profileAdapter() != webContents->profileAdapter()) {
- qWarning("Can not adopt content from a different WebEngineProfile.");
- return;
- }
-
- m_isBeingAdopted = true;
-
- // This throws away the WebContentsAdapter that has been used until now.
- // All its states, particularly the loading URL, are replaced by the adopted WebContentsAdapter.
- WebContentsAdapterOwner *adapterOwner = new WebContentsAdapterOwner(adapter->sharedFromThis());
- adapterOwner->deleteLater();
-
- adapter = webContents->sharedFromThis();
- adapter->setClient(this);
-}
-
-QQuickWebEngineView::QQuickWebEngineView(QQuickItem *parent)
- : QQuickItem(parent)
- , d_ptr(new QQuickWebEngineViewPrivate)
-{
- Q_D(QQuickWebEngineView);
- d->q_ptr = this;
- this->setActiveFocusOnTab(true);
- this->setFlags(QQuickItem::ItemIsFocusScope | QQuickItem::ItemAcceptsDrops);
-}
-
-QQuickWebEngineView::~QQuickWebEngineView()
-{
-}
-
-void QQuickWebEngineViewPrivate::ensureContentsAdapter()
-{
- initializeProfile();
- if (!adapter->isInitialized()) {
- if (!m_html.isEmpty())
- adapter->setContent(m_html.toUtf8(), defaultMimeType, m_url);
- else if (m_url.isValid())
- adapter->load(m_url);
- else
- adapter->loadDefault();
- }
-}
-
-void QQuickWebEngineViewPrivate::initializationFinished()
-{
- Q_Q(QQuickWebEngineView);
-
- Q_ASSERT(m_profileInitialized);
- if (m_backgroundColor != Qt::white) {
- adapter->setBackgroundColor(m_backgroundColor);
- emit q->backgroundColorChanged();
- }
-
- if (!qFuzzyCompare(adapter->currentZoomFactor(), m_zoomFactor)) {
- adapter->setZoomFactor(m_zoomFactor);
- emit q->zoomFactorChanged(m_zoomFactor);
- }
-
-#if QT_CONFIG(webengine_webchannel)
- if (m_webChannel)
- adapter->setWebChannel(m_webChannel, m_webChannelWorld);
-#endif
-
- if (m_defaultAudioMuted != adapter->isAudioMuted())
- adapter->setAudioMuted(m_defaultAudioMuted);
-
- if (devToolsView && devToolsView->d_ptr->adapter)
- adapter->openDevToolsFrontend(devToolsView->d_ptr->adapter);
-
- for (QQuickWebEngineScript *script : qAsConst(m_userScripts))
- script->d_func()->bind(profileAdapter()->userResourceController(), adapter.data());
-
- if (q->window())
- adapter->setVisible(q->isVisible());
-
- if (!m_isBeingAdopted)
- return;
-
- // Ideally these would only be emitted if something actually changed.
- emit q->titleChanged();
- emit q->urlChanged();
- emit q->iconChanged();
- QQuickWebEngineLoadRequest loadRequest(m_url, QQuickWebEngineView::LoadSucceededStatus);
- emit q->loadingChanged(&loadRequest);
- emit q->loadProgressChanged();
-
- m_isBeingAdopted = false;
-}
-
-void QQuickWebEngineViewPrivate::setFullScreenMode(bool fullscreen)
-{
- Q_Q(QQuickWebEngineView);
- if (m_fullscreenMode != fullscreen) {
- m_fullscreenMode = fullscreen;
- adapter->changedFullScreen();
- Q_EMIT q->isFullScreenChanged();
- }
-}
-
-void QQuickWebEngineViewPrivate::bindViewAndWidget(QQuickWebEngineView *view,
- RenderWidgetHostViewQtDelegateQuick *widget)
-{
- auto oldWidget = view ? view->d_func()->widget : nullptr;
- auto oldView = widget ? widget->m_view : nullptr;
-
- // Change pointers first.
-
- if (widget && oldView != view) {
- if (oldView)
- oldView->d_func()->widget = nullptr;
- widget->m_view = view;
- }
-
- if (view && oldWidget != widget) {
- if (oldWidget)
- oldWidget->m_view = nullptr;
- view->d_func()->widget = widget;
- }
-
- // Then notify.
-
- if (widget && oldView != view && oldView)
- oldView->d_func()->widgetChanged(widget, nullptr);
-
- if (view && oldWidget != widget)
- view->d_func()->widgetChanged(oldWidget, widget);
-}
-
-void QQuickWebEngineViewPrivate::widgetChanged(RenderWidgetHostViewQtDelegateQuick *oldWidget,
- RenderWidgetHostViewQtDelegateQuick *newWidget)
-{
- Q_Q(QQuickWebEngineView);
-
- if (oldWidget) {
- oldWidget->setParentItem(nullptr);
-#if QT_CONFIG(accessibility)
- QAccessible::deleteAccessibleInterface(QAccessible::uniqueId(QAccessible::queryAccessibleInterface(oldWidget)));
-#endif
- }
-
- if (newWidget) {
-#if QT_CONFIG(accessibility)
- QAccessible::registerAccessibleInterface(new QtWebEngineCore::RenderWidgetHostViewQtDelegateQuickAccessible(newWidget, q));
-#endif
- newWidget->setParentItem(q);
- newWidget->setSize(q->boundingRect().size());
- // Focus on creation if the view accepts it
- if (q->activeFocusOnPress())
- newWidget->setFocus(true);
- }
-}
-
-void QQuickWebEngineViewPrivate::updateAction(QQuickWebEngineView::WebAction action) const
-{
- QQuickWebEngineAction *a = actions[action];
- if (!a)
- return;
-
- bool enabled = true;
-
- switch (action) {
- case QQuickWebEngineView::Back:
- enabled = adapter->canGoBack();
- break;
- case QQuickWebEngineView::Forward:
- enabled = adapter->canGoForward();
- break;
- case QQuickWebEngineView::Stop:
- enabled = isLoading;
- break;
- case QQuickWebEngineView::Reload:
- case QQuickWebEngineView::ReloadAndBypassCache:
- enabled = !isLoading;
- break;
- case QQuickWebEngineView::ViewSource:
- enabled = adapter->canViewSource();
- break;
- case QQuickWebEngineView::Cut:
- case QQuickWebEngineView::Copy:
- case QQuickWebEngineView::Unselect:
- enabled = adapter->hasFocusedFrame() && !adapter->selectedText().isEmpty();
- break;
- case QQuickWebEngineView::Paste:
- case QQuickWebEngineView::Undo:
- case QQuickWebEngineView::Redo:
- case QQuickWebEngineView::SelectAll:
- case QQuickWebEngineView::PasteAndMatchStyle:
- enabled = adapter->hasFocusedFrame();
- break;
- default:
- break;
- }
-
- a->d_ptr->setEnabled(enabled);
-}
-
-void QQuickWebEngineViewPrivate::updateNavigationActions()
-{
- updateAction(QQuickWebEngineView::Back);
- updateAction(QQuickWebEngineView::Forward);
- updateAction(QQuickWebEngineView::Stop);
- updateAction(QQuickWebEngineView::Reload);
- updateAction(QQuickWebEngineView::ReloadAndBypassCache);
- updateAction(QQuickWebEngineView::ViewSource);
-}
-
-void QQuickWebEngineViewPrivate::updateEditActions()
-{
- updateAction(QQuickWebEngineView::Cut);
- updateAction(QQuickWebEngineView::Copy);
- updateAction(QQuickWebEngineView::Paste);
- updateAction(QQuickWebEngineView::Undo);
- updateAction(QQuickWebEngineView::Redo);
- updateAction(QQuickWebEngineView::SelectAll);
- updateAction(QQuickWebEngineView::PasteAndMatchStyle);
- updateAction(QQuickWebEngineView::Unselect);
-}
-
-QUrl QQuickWebEngineView::url() const
-{
- Q_D(const QQuickWebEngineView);
- return d->m_url;
-}
-
-void QQuickWebEngineView::setUrl(const QUrl& url)
-{
- Q_D(QQuickWebEngineView);
- if (url.isEmpty())
- return;
-
- if (d->m_url != url) {
- d->m_url = url;
- d->m_html.clear();
- emit urlChanged();
- }
-
- if (d->adapter->isInitialized()) {
- d->adapter->load(url);
- }
-}
-
-QUrl QQuickWebEngineView::icon() const
-{
- Q_D(const QQuickWebEngineView);
- return d->iconUrl;
-}
-
-void QQuickWebEngineView::loadHtml(const QString &html, const QUrl &baseUrl)
-{
- Q_D(QQuickWebEngineView);
- d->m_url = baseUrl;
- d->m_html = html;
- if (d->adapter->isInitialized()) {
- d->adapter->setContent(html.toUtf8(), defaultMimeType, baseUrl);
- return;
- }
-}
-
-void QQuickWebEngineView::goBack()
-{
- Q_D(QQuickWebEngineView);
- d->adapter->navigateBack();
-}
-
-void QQuickWebEngineView::goForward()
-{
- Q_D(QQuickWebEngineView);
- d->adapter->navigateForward();
-}
-
-void QQuickWebEngineView::reload()
-{
- Q_D(QQuickWebEngineView);
- d->adapter->reload();
-}
-
-void QQuickWebEngineView::reloadAndBypassCache()
-{
- Q_D(QQuickWebEngineView);
- d->adapter->reloadAndBypassCache();
-}
-
-void QQuickWebEngineView::stop()
-{
- Q_D(QQuickWebEngineView);
- d->adapter->stop();
-}
-
-void QQuickWebEngineView::setZoomFactor(qreal arg)
-{
- Q_D(QQuickWebEngineView);
- if (d->adapter->isInitialized() && !qFuzzyCompare(d->m_zoomFactor, d->adapter->currentZoomFactor())) {
- d->adapter->setZoomFactor(arg);
- emit zoomFactorChanged(arg);
- } else {
- d->m_zoomFactor = arg;
- }
-}
-
-QQuickWebEngineProfile *QQuickWebEngineView::profile()
-{
- Q_D(QQuickWebEngineView);
- d->initializeProfile();
- return d->m_profile;
-}
-
-void QQuickWebEngineView::setProfile(QQuickWebEngineProfile *profile)
-{
- Q_D(QQuickWebEngineView);
-
- if (d->m_profile == profile)
- return;
-
- if (!d->profileInitialized()) {
- d->m_profile = profile;
- return;
- }
-
- if (d->m_profile)
- d->m_profile->d_ptr->removeWebContentsAdapterClient(d);
-
- d->m_profile = profile;
- d->m_profile->d_ptr->addWebContentsAdapterClient(d);
- d->m_settings->setParentSettings(profile->settings());
-
- d->updateAdapter();
- Q_EMIT profileChanged();
-}
-
-QQuickWebEngineSettings *QQuickWebEngineView::settings()
-{
- Q_D(QQuickWebEngineView);
- d->initializeProfile();
- return d->m_settings.data();
-}
-
-QQmlListProperty<QQuickWebEngineScript> QQuickWebEngineView::userScripts()
-{
- Q_D(QQuickWebEngineView);
- return QQmlListProperty<QQuickWebEngineScript>(this, d,
- d->userScripts_append,
- d->userScripts_count,
- d->userScripts_at,
- d->userScripts_clear);
-}
-
-void QQuickWebEngineViewPrivate::updateAdapter()
-{
- // When the profile changes we need to create a new WebContentAdapter and reload the active URL.
- bool wasInitialized = adapter->isInitialized();
- adapter = QSharedPointer<WebContentsAdapter>::create();
- adapter->setClient(this);
- if (wasInitialized) {
- if (!m_html.isEmpty())
- adapter->setContent(m_html.toUtf8(), defaultMimeType, m_url);
- else if (m_url.isValid())
- adapter->load(m_url);
- else
- adapter->loadDefault();
- }
-}
-
-#if QT_CONFIG(webengine_testsupport)
-QQuickWebEngineTestSupport *QQuickWebEngineView::testSupport() const
-{
- Q_D(const QQuickWebEngineView);
- return d->m_testSupport;
-}
-
-void QQuickWebEngineView::setTestSupport(QQuickWebEngineTestSupport *testSupport)
-{
- Q_D(QQuickWebEngineView);
- d->m_testSupport = testSupport;
- Q_EMIT testSupportChanged();
-}
-#endif
-
-bool QQuickWebEngineView::activeFocusOnPress() const
-{
- Q_D(const QQuickWebEngineView);
- return d->m_activeFocusOnPress;
-}
-
-void QQuickWebEngineViewPrivate::didRunJavaScript(quint64 requestId, const QVariant &result)
-{
- Q_Q(QQuickWebEngineView);
- QJSValue callback = m_callbacks.take(requestId);
- QJSValueList args;
- args.append(qmlEngine(q)->toScriptValue(result));
- callback.call(args);
-}
-
-void QQuickWebEngineViewPrivate::didPrintPage(quint64 requestId, QSharedPointer<QByteArray> result)
-{
- Q_Q(QQuickWebEngineView);
- QJSValue callback = m_callbacks.take(requestId);
- QJSValueList args;
- args.append(qmlEngine(q)->toScriptValue(*(result.data())));
- callback.call(args);
-}
-
-void QQuickWebEngineViewPrivate::didPrintPageToPdf(const QString &filePath, bool success)
-{
- Q_Q(QQuickWebEngineView);
- Q_EMIT q->pdfPrintingFinished(filePath, success);
-}
-
-void QQuickWebEngineViewPrivate::updateScrollPosition(const QPointF &position)
-{
- Q_Q(QQuickWebEngineView);
- Q_EMIT q->scrollPositionChanged(position);
-}
-
-void QQuickWebEngineViewPrivate::updateContentsSize(const QSizeF &size)
-{
- Q_Q(QQuickWebEngineView);
- Q_EMIT q->contentsSizeChanged(size);
-}
-
-void QQuickWebEngineViewPrivate::renderProcessTerminated(
- RenderProcessTerminationStatus terminationStatus, int exitCode)
-{
- Q_Q(QQuickWebEngineView);
- Q_EMIT q->renderProcessTerminated(static_cast<QQuickWebEngineView::RenderProcessTerminationStatus>(
- renderProcessExitStatus(terminationStatus)), exitCode);
-}
-
-void QQuickWebEngineViewPrivate::requestGeometryChange(const QRect &geometry, const QRect &frameGeometry)
-{
- Q_Q(QQuickWebEngineView);
- Q_EMIT q->geometryChangeRequested(geometry, frameGeometry);
-}
-
-void QQuickWebEngineViewPrivate::startDragging(const content::DropData &dropData,
- Qt::DropActions allowedActions,
- const QPixmap &pixmap, const QPoint &offset)
-{
-#if !QT_CONFIG(draganddrop)
- Q_UNUSED(dropData);
- Q_UNUSED(allowedActions);
- Q_UNUSED(pixmap);
- Q_UNUSED(offset);
-#else
- adapter->startDragging(q_ptr->window(), dropData, allowedActions, pixmap, offset);
-#endif // QT_CONFIG(draganddrop)
-}
-
-bool QQuickWebEngineViewPrivate::supportsDragging() const
-{
- // QTBUG-57516
- // Fixme: This is just a band-aid workaround.
- return QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::MultipleWindows);
-}
-
-bool QQuickWebEngineViewPrivate::isEnabled() const
-{
- const Q_Q(QQuickWebEngineView);
- return q->isEnabled();
-}
-
-void QQuickWebEngineViewPrivate::setToolTip(const QString &toolTipText)
-{
- Q_Q(QQuickWebEngineView);
- QQuickWebEngineTooltipRequest *request = new QQuickWebEngineTooltipRequest(toolTipText, q);
- // mark the object for gc by creating temporary jsvalue
- qmlEngine(q)->newQObject(request);
- Q_EMIT q->tooltipRequested(request);
- if (!request->isAccepted())
- ui()->showToolTip(toolTipText);
-}
-
-QtWebEngineCore::TouchHandleDrawableClient *QQuickWebEngineViewPrivate::createTouchHandle(const QMap<int, QImage> &images)
-{
- return new QQuickWebEngineTouchHandle(ui(), images);
-}
-
-void QQuickWebEngineViewPrivate::showTouchSelectionMenu(QtWebEngineCore::TouchSelectionMenuController *menuController, const QRect &selectionBounds, const QSize &handleSize)
-{
- Q_UNUSED(handleSize);
-
- const int kSpacingBetweenButtons = 2;
- const int kMenuButtonMinWidth = 63;
- const int kMenuButtonMinHeight = 38;
-
- int buttonCount = menuController->buttonCount();
- if (buttonCount == 1) {
- menuController->runContextMenu();
- return;
- }
-
- int width = (kSpacingBetweenButtons * (buttonCount + 1)) + (kMenuButtonMinWidth * buttonCount);
- int height = kMenuButtonMinHeight + kSpacingBetweenButtons;
- int x = (selectionBounds.x() + selectionBounds.x() + selectionBounds.width() - width) / 2;
- int y = selectionBounds.y() - height - 2;
-
- QRect bounds(x, y, width, height);
- ui()->showTouchSelectionMenu(menuController, bounds, kSpacingBetweenButtons);
-}
-
-void QQuickWebEngineViewPrivate::hideTouchSelectionMenu()
-{
- ui()->hideTouchSelectionMenu();
-}
-
-bool QQuickWebEngineView::isLoading() const
-{
- Q_D(const QQuickWebEngineView);
- return d->isLoading;
-}
-
-int QQuickWebEngineView::loadProgress() const
-{
- Q_D(const QQuickWebEngineView);
- return d->loadProgress;
-}
-
-QString QQuickWebEngineView::title() const
-{
- Q_D(const QQuickWebEngineView);
- return d->adapter->pageTitle();
-}
-
-bool QQuickWebEngineView::canGoBack() const
-{
- Q_D(const QQuickWebEngineView);
- return d->adapter->canGoBack();
-}
-
-bool QQuickWebEngineView::canGoForward() const
-{
- Q_D(const QQuickWebEngineView);
- return d->adapter->canGoForward();
-}
-
-void QQuickWebEngineView::runJavaScript(const QString &script, const QJSValue &callback)
-{
- runJavaScript(script, QQuickWebEngineScript::MainWorld, callback);
-}
-
-void QQuickWebEngineView::runJavaScript(const QString &script, quint32 worldId, const QJSValue &callback)
-{
- Q_D(QQuickWebEngineView);
- d->ensureContentsAdapter();
- if (!callback.isUndefined()) {
- quint64 requestId = d_ptr->adapter->runJavaScriptCallbackResult(script, worldId);
- d->m_callbacks.insert(requestId, callback);
- } else
- d->adapter->runJavaScript(script, worldId);
-}
-
-qreal QQuickWebEngineView::zoomFactor() const
-{
- Q_D(const QQuickWebEngineView);
- if (!d->adapter->isInitialized())
- return d->m_zoomFactor;
- return d->adapter->currentZoomFactor();
-}
-
-QColor QQuickWebEngineView::backgroundColor() const
-{
- Q_D(const QQuickWebEngineView);
- return d->m_backgroundColor;
-}
-
-void QQuickWebEngineView::setBackgroundColor(const QColor &color)
-{
- Q_D(QQuickWebEngineView);
- if (color == d->m_backgroundColor)
- return;
- d->m_backgroundColor = color;
- if (d->adapter->isInitialized()) {
- d->adapter->setBackgroundColor(color);
- emit backgroundColorChanged();
- }
-}
-
-/*!
- \property QQuickWebEngineView::audioMuted
- \brief The state of whether the current page audio is muted.
- \since 5.7
-
- The default value is false.
-*/
-bool QQuickWebEngineView::isAudioMuted() const
-{
- const Q_D(QQuickWebEngineView);
- if (d->adapter->isInitialized())
- return d->adapter->isAudioMuted();
- return d->m_defaultAudioMuted;
-}
-
-void QQuickWebEngineView::setAudioMuted(bool muted)
-{
- Q_D(QQuickWebEngineView);
- bool wasAudioMuted = isAudioMuted();
- d->m_defaultAudioMuted = muted;
- d->adapter->setAudioMuted(muted);
- if (wasAudioMuted != isAudioMuted())
- Q_EMIT audioMutedChanged(muted);
-}
-
-bool QQuickWebEngineView::recentlyAudible() const
-{
- const Q_D(QQuickWebEngineView);
- return d->adapter->recentlyAudible();
-}
-
-qint64 QQuickWebEngineView::renderProcessPid() const
-{
- const Q_D(QQuickWebEngineView);
- return d->adapter->renderProcessPid();
-}
-
-void QQuickWebEngineView::printToPdf(const QString& filePath, PrintedPageSizeId pageSizeId, PrintedPageOrientation orientation)
-{
-#if QT_CONFIG(webengine_printing_and_pdf)
- Q_D(QQuickWebEngineView);
- QPageSize layoutSize(static_cast<QPageSize::PageSizeId>(pageSizeId));
- QPageLayout::Orientation layoutOrientation = static_cast<QPageLayout::Orientation>(orientation);
- QPageLayout pageLayout(layoutSize, layoutOrientation, QMarginsF(0.0, 0.0, 0.0, 0.0));
- d->ensureContentsAdapter();
- d->adapter->printToPDF(pageLayout, filePath);
-#else
- Q_UNUSED(filePath);
- Q_UNUSED(pageSizeId);
- Q_UNUSED(orientation);
-#endif
-}
-
-void QQuickWebEngineView::printToPdf(const QJSValue &callback, PrintedPageSizeId pageSizeId, PrintedPageOrientation orientation)
-{
-#if QT_CONFIG(webengine_printing_and_pdf)
- Q_D(QQuickWebEngineView);
- QPageSize layoutSize(static_cast<QPageSize::PageSizeId>(pageSizeId));
- QPageLayout::Orientation layoutOrientation = static_cast<QPageLayout::Orientation>(orientation);
- QPageLayout pageLayout(layoutSize, layoutOrientation, QMarginsF(0.0, 0.0, 0.0, 0.0));
-
- if (callback.isUndefined())
- return;
-
- d->ensureContentsAdapter();
- quint64 requestId = d->adapter->printToPDFCallbackResult(pageLayout);
- d->m_callbacks.insert(requestId, callback);
-#else
- Q_UNUSED(pageSizeId);
- Q_UNUSED(orientation);
-
- // Call back with null result.
- QJSValueList args;
- args.append(QJSValue(QByteArray().data()));
- QJSValue callbackCopy = callback;
- callbackCopy.call(args);
-#endif
-}
-
-void QQuickWebEngineView::replaceMisspelledWord(const QString &replacement)
-{
- Q_D(QQuickWebEngineView);
- d->adapter->replaceMisspelling(replacement);
-}
-
-bool QQuickWebEngineView::isFullScreen() const
-{
- Q_D(const QQuickWebEngineView);
- return d->m_fullscreenMode;
-}
-
-void QQuickWebEngineView::findText(const QString &subString, FindFlags options, const QJSValue &callback)
-{
- Q_D(QQuickWebEngineView);
- if (!d->adapter->isInitialized())
- return;
-
- d->adapter->findTextHelper()->startFinding(subString, options & FindCaseSensitively, options & FindBackward, callback);
-}
-
-QQuickWebEngineHistory *QQuickWebEngineView::navigationHistory() const
-{
- Q_D(const QQuickWebEngineView);
- return d->m_history.data();
-}
-
-QQmlWebChannel *QQuickWebEngineView::webChannel()
-{
-#if QT_CONFIG(webengine_webchannel)
- Q_D(QQuickWebEngineView);
- if (!d->m_webChannel) {
- d->m_webChannel = new QQmlWebChannel(this);
- }
- return d->m_webChannel;
-#endif
- qWarning("WebEngine compiled without webchannel support");
- return nullptr;
-}
-
-void QQuickWebEngineView::setWebChannel(QQmlWebChannel *webChannel)
-{
-#if QT_CONFIG(webengine_webchannel)
- Q_D(QQuickWebEngineView);
- if (d->m_webChannel == webChannel)
- return;
- d->m_webChannel = webChannel;
- if (d->profileInitialized())
- d->adapter->setWebChannel(webChannel, d->m_webChannelWorld);
- Q_EMIT webChannelChanged();
-#else
- Q_UNUSED(webChannel)
- qWarning("WebEngine compiled without webchannel support");
-#endif
-}
-
-uint QQuickWebEngineView::webChannelWorld() const
-{
- Q_D(const QQuickWebEngineView);
- return d->m_webChannelWorld;
-}
-
-void QQuickWebEngineView::setWebChannelWorld(uint webChannelWorld)
-{
-#if QT_CONFIG(webengine_webchannel)
- Q_D(QQuickWebEngineView);
- if (d->m_webChannelWorld == webChannelWorld)
- return;
- d->m_webChannelWorld = webChannelWorld;
- if (d->profileInitialized())
- d->adapter->setWebChannel(d->m_webChannel, d->m_webChannelWorld);
- Q_EMIT webChannelWorldChanged(webChannelWorld);
-#else
- Q_UNUSED(webChannelWorld)
- qWarning("WebEngine compiled without webchannel support");
-#endif
-}
-
-QQuickWebEngineView *QQuickWebEngineView::inspectedView() const
-{
- Q_D(const QQuickWebEngineView);
- return d->inspectedView;
-}
-
-void QQuickWebEngineView::setInspectedView(QQuickWebEngineView *view)
-{
- Q_D(QQuickWebEngineView);
- if (d->inspectedView == view)
- return;
- QQuickWebEngineView *oldView = d->inspectedView;
- d->inspectedView = nullptr;
- if (oldView)
- oldView->setDevToolsView(nullptr);
- d->inspectedView = view;
- if (view)
- view->setDevToolsView(this);
- Q_EMIT inspectedViewChanged();
-}
-
-QQuickWebEngineView *QQuickWebEngineView::devToolsView() const
-{
- Q_D(const QQuickWebEngineView);
- return d->devToolsView;
-}
-
-
-void QQuickWebEngineView::setDevToolsView(QQuickWebEngineView *devToolsView)
-{
- Q_D(QQuickWebEngineView);
- if (d->devToolsView == devToolsView)
- return;
- QQuickWebEngineView *oldView = d->devToolsView;
- d->devToolsView = nullptr;
- if (oldView)
- oldView->setInspectedView(nullptr);
- d->devToolsView = devToolsView;
- if (devToolsView)
- devToolsView->setInspectedView(this);
- if (d->profileInitialized() && d->adapter->isInitialized()) {
- if (devToolsView)
- d->adapter->openDevToolsFrontend(devToolsView->d_ptr->adapter);
- else
- d->adapter->closeDevToolsFrontend();
- }
- Q_EMIT devToolsViewChanged();
-}
-
-void QQuickWebEngineView::grantFeaturePermission(const QUrl &securityOrigin, QQuickWebEngineView::Feature feature, bool granted)
-{
- if (!granted && ((feature >= MediaAudioCapture && feature <= MediaAudioVideoCapture) ||
- (feature >= DesktopVideoCapture && feature <= DesktopAudioVideoCapture))) {
- d_ptr->adapter->grantMediaAccessPermission(securityOrigin, WebContentsAdapterClient::MediaNone);
- return;
- }
-
- switch (feature) {
- case MediaAudioCapture:
- d_ptr->adapter->grantMediaAccessPermission(securityOrigin, WebContentsAdapterClient::MediaAudioCapture);
- break;
- case MediaVideoCapture:
- d_ptr->adapter->grantMediaAccessPermission(securityOrigin, WebContentsAdapterClient::MediaVideoCapture);
- break;
- case MediaAudioVideoCapture:
- d_ptr->adapter->grantMediaAccessPermission(securityOrigin, WebContentsAdapterClient::MediaRequestFlags(WebContentsAdapterClient::MediaAudioCapture | WebContentsAdapterClient::MediaVideoCapture));
- break;
- case DesktopVideoCapture:
- d_ptr->adapter->grantMediaAccessPermission(securityOrigin, WebContentsAdapterClient::MediaDesktopVideoCapture);
- break;
- case DesktopAudioVideoCapture:
- d_ptr->adapter->grantMediaAccessPermission(
- securityOrigin,
- WebContentsAdapterClient::MediaRequestFlags(
- WebContentsAdapterClient::MediaDesktopAudioCapture |
- WebContentsAdapterClient::MediaDesktopVideoCapture));
- break;
- case Geolocation:
- d_ptr->adapter->grantFeaturePermission(securityOrigin, ProfileAdapter::GeolocationPermission,
- granted ? ProfileAdapter::AllowedPermission : ProfileAdapter::DeniedPermission);
- break;
- case Notifications:
- d_ptr->adapter->grantFeaturePermission(securityOrigin, ProfileAdapter::NotificationPermission,
- granted ? ProfileAdapter::AllowedPermission : ProfileAdapter::DeniedPermission);
- break;
- default:
- Q_UNREACHABLE();
- }
-}
-
-void QQuickWebEngineView::setActiveFocusOnPress(bool arg)
-{
- Q_D(QQuickWebEngineView);
- if (d->m_activeFocusOnPress == arg)
- return;
-
- d->m_activeFocusOnPress = arg;
- emit activeFocusOnPressChanged(arg);
-}
-
-void QQuickWebEngineView::goBackOrForward(int offset)
-{
- Q_D(QQuickWebEngineView);
- const int current = d->adapter->currentNavigationEntryIndex();
- const int count = d->adapter->navigationEntryCount();
- const int index = current + offset;
-
- if (index < 0 || index >= count)
- return;
-
- d->adapter->navigateToIndex(index);
-}
-
-void QQuickWebEngineView::fullScreenCancelled()
-{
- Q_D(QQuickWebEngineView);
- d->adapter->exitFullScreen();
-}
-
-void QQuickWebEngineView::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)
-{
- QQuickItem::geometryChanged(newGeometry, oldGeometry);
- Q_D(QQuickWebEngineView);
- if (d->widget)
- d->widget->setSize(newGeometry.size());
-}
-
-void QQuickWebEngineView::itemChange(ItemChange change, const ItemChangeData &value)
-{
- Q_D(QQuickWebEngineView);
- if (d && d->profileInitialized() && d->adapter->isInitialized()
- && (change == ItemSceneChange || change == ItemVisibleHasChanged)) {
- if (window())
- d->adapter->setVisible(isVisible());
- }
- QQuickItem::itemChange(change, value);
-}
-
-#if QT_CONFIG(draganddrop)
-static QPoint mapToScreen(const QQuickItem *item, const QPoint &clientPos)
-{
- return item->window()->position() + item->mapToScene(clientPos).toPoint();
-}
-
-void QQuickWebEngineView::dragEnterEvent(QDragEnterEvent *e)
-{
- Q_D(QQuickWebEngineView);
- e->accept();
- d->adapter->enterDrag(e, mapToScreen(this, e->pos()));
-}
-
-void QQuickWebEngineView::dragLeaveEvent(QDragLeaveEvent *e)
-{
- Q_D(QQuickWebEngineView);
- e->accept();
- d->adapter->leaveDrag();
-}
-
-void QQuickWebEngineView::dragMoveEvent(QDragMoveEvent *e)
-{
- Q_D(QQuickWebEngineView);
- Qt::DropAction dropAction = d->adapter->updateDragPosition(e, mapToScreen(this, e->pos()));
- if (Qt::IgnoreAction == dropAction) {
- e->ignore();
- } else {
- e->setDropAction(dropAction);
- e->accept();
- }
-}
-
-void QQuickWebEngineView::dropEvent(QDropEvent *e)
-{
- Q_D(QQuickWebEngineView);
- e->accept();
- d->adapter->endDragging(e, mapToScreen(this, e->pos()));
-}
-#endif // QT_CONFIG(draganddrop)
-
-void QQuickWebEngineView::triggerWebAction(WebAction action)
-{
- Q_D(QQuickWebEngineView);
- switch (action) {
- case Back:
- d->adapter->navigateBack();
- break;
- case Forward:
- d->adapter->navigateForward();
- break;
- case Stop:
- d->adapter->stop();
- break;
- case Reload:
- d->adapter->reload();
- break;
- case ReloadAndBypassCache:
- d->adapter->reloadAndBypassCache();
- break;
- case Cut:
- d->adapter->cut();
- break;
- case Copy:
- d->adapter->copy();
- break;
- case Paste:
- d->adapter->paste();
- break;
- case Undo:
- d->adapter->undo();
- break;
- case Redo:
- d->adapter->redo();
- break;
- case SelectAll:
- d->adapter->selectAll();
- break;
- case PasteAndMatchStyle:
- d->adapter->pasteAndMatchStyle();
- break;
- case Unselect:
- d->adapter->unselect();
- break;
- case OpenLinkInThisWindow:
- if (d->m_contextMenuData.linkUrl().isValid())
- setUrl(d->m_contextMenuData.linkUrl());
- break;
- case OpenLinkInNewWindow:
- if (d->m_contextMenuData.linkUrl().isValid()) {
- QQuickWebEngineNewViewRequest request;
- request.m_requestedUrl = d->m_contextMenuData.linkUrl();
- request.m_isUserInitiated = true;
- request.m_destination = NewViewInWindow;
- Q_EMIT newViewRequested(&request);
- }
- break;
- case OpenLinkInNewTab:
- if (d->m_contextMenuData.linkUrl().isValid()) {
- QQuickWebEngineNewViewRequest request;
- request.m_requestedUrl = d->m_contextMenuData.linkUrl();
- request.m_isUserInitiated = true;
- request.m_destination = NewViewInBackgroundTab;
- Q_EMIT newViewRequested(&request);
- }
- break;
- case CopyLinkToClipboard:
- if (!d->m_contextMenuData.unfilteredLinkUrl().isEmpty()) {
- QString urlString = d->m_contextMenuData.unfilteredLinkUrl().toString(QUrl::FullyEncoded);
- QString linkText = d->m_contextMenuData.linkText().toHtmlEscaped();
- QString title = d->m_contextMenuData.titleText();
- if (!title.isEmpty())
- title = QStringLiteral(" title=\"%1\"").arg(title.toHtmlEscaped());
- QMimeData *data = new QMimeData();
- data->setText(urlString);
- QString html = QStringLiteral("<a href=\"") + urlString + QStringLiteral("\"") + title + QStringLiteral(">")
- + linkText + QStringLiteral("</a>");
- data->setHtml(html);
- data->setUrls(QList<QUrl>() << d->m_contextMenuData.unfilteredLinkUrl());
- qApp->clipboard()->setMimeData(data);
- }
- break;
- case DownloadLinkToDisk:
- if (d->m_contextMenuData.linkUrl().isValid())
- d->adapter->download(d->m_contextMenuData.linkUrl(), d->m_contextMenuData.suggestedFileName(),
- d->m_contextMenuData.referrerUrl(), d->m_contextMenuData.referrerPolicy());
- break;
- case CopyImageToClipboard:
- if (d->m_contextMenuData.hasImageContent() &&
- (d->m_contextMenuData.mediaType() == WebEngineContextMenuData::MediaTypeImage ||
- d->m_contextMenuData.mediaType() == WebEngineContextMenuData::MediaTypeCanvas))
- {
- d->adapter->copyImageAt(d->m_contextMenuData.position());
- }
- break;
- case CopyImageUrlToClipboard:
- if (d->m_contextMenuData.mediaUrl().isValid() && d->m_contextMenuData.mediaType() == WebEngineContextMenuData::MediaTypeImage) {
- QString urlString = d->m_contextMenuData.mediaUrl().toString(QUrl::FullyEncoded);
- QString alt = d->m_contextMenuData.altText();
- if (!alt.isEmpty())
- alt = QStringLiteral(" alt=\"%1\"").arg(alt.toHtmlEscaped());
- QString title = d->m_contextMenuData.titleText();
- if (!title.isEmpty())
- title = QStringLiteral(" title=\"%1\"").arg(title.toHtmlEscaped());
- QMimeData *data = new QMimeData();
- data->setText(urlString);
- QString html = QStringLiteral("<img src=\"") + urlString + QStringLiteral("\"") + title + alt + QStringLiteral("></img>");
- data->setHtml(html);
- data->setUrls(QList<QUrl>() << d->m_contextMenuData.mediaUrl());
- qApp->clipboard()->setMimeData(data);
- }
- break;
- case DownloadImageToDisk:
- case DownloadMediaToDisk:
- if (d->m_contextMenuData.mediaUrl().isValid())
- d->adapter->download(d->m_contextMenuData.mediaUrl(), d->m_contextMenuData.suggestedFileName(),
- d->m_contextMenuData.referrerUrl(), d->m_contextMenuData.referrerPolicy());
- break;
- case CopyMediaUrlToClipboard:
- if (d->m_contextMenuData.mediaUrl().isValid() &&
- (d->m_contextMenuData.mediaType() == WebEngineContextMenuData::MediaTypeAudio ||
- d->m_contextMenuData.mediaType() == WebEngineContextMenuData::MediaTypeVideo))
- {
- QString urlString = d->m_contextMenuData.mediaUrl().toString(QUrl::FullyEncoded);
- QString title = d->m_contextMenuData.titleText();
- if (!title.isEmpty())
- title = QStringLiteral(" title=\"%1\"").arg(title.toHtmlEscaped());
- QMimeData *data = new QMimeData();
- data->setText(urlString);
- if (d->m_contextMenuData.mediaType() == WebEngineContextMenuData::MediaTypeAudio)
- data->setHtml(QStringLiteral("<audio src=\"") + urlString + QStringLiteral("\"") + title +
- QStringLiteral("></audio>"));
- else
- data->setHtml(QStringLiteral("<video src=\"") + urlString + QStringLiteral("\"") + title +
- QStringLiteral("></video>"));
- data->setUrls(QList<QUrl>() << d->m_contextMenuData.mediaUrl());
- qApp->clipboard()->setMimeData(data);
- }
- break;
- case ToggleMediaControls:
- if (d->m_contextMenuData.mediaUrl().isValid() && d->m_contextMenuData.mediaFlags() & WebEngineContextMenuData::MediaCanToggleControls) {
- bool enable = !(d->m_contextMenuData.mediaFlags() & WebEngineContextMenuData::MediaControls);
- d->adapter->executeMediaPlayerActionAt(d->m_contextMenuData.position(), WebContentsAdapter::MediaPlayerControls, enable);
- }
- break;
- case ToggleMediaLoop:
- if (d->m_contextMenuData.mediaUrl().isValid() &&
- (d->m_contextMenuData.mediaType() == WebEngineContextMenuData::MediaTypeAudio ||
- d->m_contextMenuData.mediaType() == WebEngineContextMenuData::MediaTypeVideo))
- {
- bool enable = !(d->m_contextMenuData.mediaFlags() & WebEngineContextMenuData::MediaLoop);
- d->adapter->executeMediaPlayerActionAt(d->m_contextMenuData.position(), WebContentsAdapter::MediaPlayerLoop, enable);
- }
- break;
- case ToggleMediaPlayPause:
- if (d->m_contextMenuData.mediaUrl().isValid() &&
- (d->m_contextMenuData.mediaType() == WebEngineContextMenuData::MediaTypeAudio ||
- d->m_contextMenuData.mediaType() == WebEngineContextMenuData::MediaTypeVideo))
- {
- bool enable = (d->m_contextMenuData.mediaFlags() & WebEngineContextMenuData::MediaPaused);
- d->adapter->executeMediaPlayerActionAt(d->m_contextMenuData.position(), WebContentsAdapter::MediaPlayerPlay, enable);
- }
- break;
- case ToggleMediaMute:
- if (d->m_contextMenuData.mediaUrl().isValid() && d->m_contextMenuData.mediaFlags() & WebEngineContextMenuData::MediaHasAudio) {
- bool enable = !(d->m_contextMenuData.mediaFlags() & WebEngineContextMenuData::MediaMuted);
- d->adapter->executeMediaPlayerActionAt(d->m_contextMenuData.position(), WebContentsAdapter::MediaPlayerMute, enable);
- }
- break;
- case InspectElement:
- d->adapter->inspectElementAt(d->m_contextMenuData.position());
- break;
- case ExitFullScreen:
- d->adapter->exitFullScreen();
- break;
- case RequestClose:
- d->adapter->requestClose();
- break;
- case SavePage:
- d->adapter->save();
- break;
- case ViewSource:
- d->adapter->viewSource();
- break;
- case ToggleBold:
- runJavaScript(QStringLiteral("document.execCommand('bold');"), QQuickWebEngineScript::ApplicationWorld);
- break;
- case ToggleItalic:
- runJavaScript(QStringLiteral("document.execCommand('italic');"), QQuickWebEngineScript::ApplicationWorld);
- break;
- case ToggleUnderline:
- runJavaScript(QStringLiteral("document.execCommand('underline');"), QQuickWebEngineScript::ApplicationWorld);
- break;
- case ToggleStrikethrough:
- runJavaScript(QStringLiteral("document.execCommand('strikethrough');"), QQuickWebEngineScript::ApplicationWorld);
- break;
- case AlignLeft:
- runJavaScript(QStringLiteral("document.execCommand('justifyLeft');"), QQuickWebEngineScript::ApplicationWorld);
- break;
- case AlignCenter:
- runJavaScript(QStringLiteral("document.execCommand('justifyCenter');"), QQuickWebEngineScript::ApplicationWorld);
- break;
- case AlignRight:
- runJavaScript(QStringLiteral("document.execCommand('justifyRight');"), QQuickWebEngineScript::ApplicationWorld);
- break;
- case AlignJustified:
- runJavaScript(QStringLiteral("document.execCommand('justifyFull');"), QQuickWebEngineScript::ApplicationWorld);
- break;
- case Indent:
- runJavaScript(QStringLiteral("document.execCommand('indent');"), QQuickWebEngineScript::ApplicationWorld);
- break;
- case Outdent:
- runJavaScript(QStringLiteral("document.execCommand('outdent');"), QQuickWebEngineScript::ApplicationWorld);
- break;
- case InsertOrderedList:
- runJavaScript(QStringLiteral("document.execCommand('insertOrderedList');"), QQuickWebEngineScript::ApplicationWorld);
- break;
- case InsertUnorderedList:
- runJavaScript(QStringLiteral("document.execCommand('insertUnorderedList');"), QQuickWebEngineScript::ApplicationWorld);
- break;
- default:
- Q_UNREACHABLE();
- }
-}
-
-QQuickWebEngineAction *QQuickWebEngineView::action(WebAction action)
-{
- Q_D(QQuickWebEngineView);
- if (action == QQuickWebEngineView::NoWebAction)
- return nullptr;
- if (d->actions[action]) {
- d->updateAction(action);
- return d->actions[action];
- }
-
- QString text;
- QString iconName;
-
- switch (action) {
- case Back:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Back);
- iconName = QStringLiteral("go-previous");
- break;
- case Forward:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Forward);
- iconName = QStringLiteral("go-next");
- break;
- case Stop:
- text = tr("Stop");
- iconName = QStringLiteral("process-stop");
- break;
- case Reload:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Reload);
- iconName = QStringLiteral("view-refresh");
- break;
- case ReloadAndBypassCache:
- text = tr("Reload and Bypass Cache");
- iconName = QStringLiteral("view-refresh");
- break;
- case Cut:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Cut);
- iconName = QStringLiteral("edit-cut");
- break;
- case Copy:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Copy);
- iconName = QStringLiteral("edit-copy");
- break;
- case Paste:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Paste);
- iconName = QStringLiteral("edit-paste");
- break;
- case Undo:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Undo);
- iconName = QStringLiteral("edit-undo");
- break;
- case Redo:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Redo);
- iconName = QStringLiteral("edit-redo");
- break;
- case SelectAll:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::SelectAll);
- iconName = QStringLiteral("edit-select-all");
- break;
- case PasteAndMatchStyle:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::PasteAndMatchStyle);
- iconName = QStringLiteral("edit-paste");
- break;
- case OpenLinkInThisWindow:
- text = tr("Open link in this window");
- break;
- case OpenLinkInNewWindow:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::OpenLinkInNewWindow);
- break;
- case OpenLinkInNewTab:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::OpenLinkInNewTab);
- break;
- case CopyLinkToClipboard:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::CopyLinkToClipboard);
- break;
- case DownloadLinkToDisk:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::DownloadLinkToDisk);
- break;
- case CopyImageToClipboard:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::CopyImageToClipboard);
- break;
- case CopyImageUrlToClipboard:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::CopyImageUrlToClipboard);
- break;
- case DownloadImageToDisk:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::DownloadImageToDisk);
- break;
- case CopyMediaUrlToClipboard:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::CopyMediaUrlToClipboard);
- break;
- case ToggleMediaControls:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::ToggleMediaControls);
- break;
- case ToggleMediaLoop:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::ToggleMediaLoop);
- break;
- case ToggleMediaPlayPause:
- text = tr("Toggle Play/Pause");
- iconName = QStringLiteral("media-playback-start");
- break;
- case ToggleMediaMute:
- text = tr("Toggle Mute");
- iconName = QStringLiteral("audio-volume-muted");
- break;
- case DownloadMediaToDisk:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::DownloadMediaToDisk);
- break;
- case InspectElement:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::InspectElement);
- break;
- case ExitFullScreen:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::ExitFullScreen);
- iconName = QStringLiteral("view-fullscreen");
- break;
- case RequestClose:
- text = tr("Close Page");
- iconName = QStringLiteral("window-close");
- break;
- case Unselect:
- text = tr("Unselect");
- iconName = QStringLiteral("edit-select-none");
- break;
- case SavePage:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::SavePage);
- iconName = QStringLiteral("document-save");
- break;
- case ViewSource:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::ViewSource);
- break;
- case ToggleBold:
- text = tr("&Bold");
- iconName = QStringLiteral("format-text-bold");
- break;
- case ToggleItalic:
- text = tr("&Italic");
- iconName = QStringLiteral("format-text-italic");
- break;
- case ToggleUnderline:
- text = tr("&Underline");
- iconName = QStringLiteral("format-text-underline");
- break;
- case ToggleStrikethrough:
- text = tr("&Strikethrough");
- iconName = QStringLiteral("format-text-strikethrough");
- break;
- case AlignLeft:
- text = tr("Align &Left");
- break;
- case AlignCenter:
- text = tr("Align &Center");
- break;
- case AlignRight:
- text = tr("Align &Right");
- break;
- case AlignJustified:
- text = tr("Align &Justified");
- break;
- case Indent:
- text = tr("&Indent");
- iconName = QStringLiteral("format-indent-more");
- break;
- case Outdent:
- text = tr("&Outdent");
- iconName = QStringLiteral("format-indent-less");
- break;
- case InsertOrderedList:
- text = tr("Insert &Ordered List");
- break;
- case InsertUnorderedList:
- text = tr("Insert &Unordered List");
- break;
- case NoWebAction:
- case WebActionCount:
- Q_UNREACHABLE();
- break;
- }
-
- QQuickWebEngineAction *retVal = new QQuickWebEngineAction(action, text, iconName, false, this);
-
- d->actions[action] = retVal;
- d->updateAction(action);
- return retVal;
-}
-
-QSizeF QQuickWebEngineView::contentsSize() const
-{
- Q_D(const QQuickWebEngineView);
- return d->adapter->lastContentsSize();
-}
-
-QPointF QQuickWebEngineView::scrollPosition() const
-{
- Q_D(const QQuickWebEngineView);
- return d->adapter->lastScrollOffset();
-}
-
-void QQuickWebEngineViewPrivate::userScripts_append(QQmlListProperty<QQuickWebEngineScript> *p, QQuickWebEngineScript *script)
-{
- Q_ASSERT(p && p->data);
- QQuickWebEngineViewPrivate *d = static_cast<QQuickWebEngineViewPrivate*>(p->data);
- d->m_userScripts.append(script);
- // If the adapter hasn't been initialized, we'll bind the scripts in initializationFinished()
- if (!d->adapter->isInitialized())
- return;
- UserResourceControllerHost *resourceController = d->profileAdapter()->userResourceController();
- script->d_func()->bind(resourceController, d->adapter.data());
-}
-
-int QQuickWebEngineViewPrivate::userScripts_count(QQmlListProperty<QQuickWebEngineScript> *p)
-{
- Q_ASSERT(p && p->data);
- QQuickWebEngineViewPrivate *d = static_cast<QQuickWebEngineViewPrivate*>(p->data);
- return d->m_userScripts.count();
-}
-
-QQuickWebEngineScript *QQuickWebEngineViewPrivate::userScripts_at(QQmlListProperty<QQuickWebEngineScript> *p, int idx)
-{
- Q_ASSERT(p && p->data);
- QQuickWebEngineViewPrivate *d = static_cast<QQuickWebEngineViewPrivate*>(p->data);
- return d->m_userScripts.at(idx);
-}
-
-void QQuickWebEngineViewPrivate::userScripts_clear(QQmlListProperty<QQuickWebEngineScript> *p)
-{
- Q_ASSERT(p && p->data);
- QQuickWebEngineViewPrivate *d = static_cast<QQuickWebEngineViewPrivate*>(p->data);
- d->m_userScripts.clear();
- if (!d->adapter->isInitialized())
- return;
- UserResourceControllerHost *resourceController = d->profileAdapter()->userResourceController();
- resourceController->clearAllScripts(d->adapter.data());
-}
-
-void QQuickWebEngineView::componentComplete()
-{
- QQuickItem::componentComplete();
- Q_D(QQuickWebEngineView);
- d->initializeProfile();
-#ifndef QT_NO_ACCESSIBILITY
- // Enable accessibility via a dynamic QQmlProperty, instead of using private API call
- // QQuickAccessibleAttached::qmlAttachedProperties(this). The qmlContext is required, otherwise
- // it is not possible to reference attached properties.
- QQmlContext *qmlContext = QQmlEngine::contextForObject(this);
- QQmlProperty role(this, QStringLiteral("Accessible.role"), qmlContext);
- role.write(QAccessible::Grouping);
-#endif // QT_NO_ACCESSIBILITY
-
- QTimer::singleShot(0, this, &QQuickWebEngineView::lazyInitialize);
-}
-
-void QQuickWebEngineView::lazyInitialize()
-{
- Q_D(QQuickWebEngineView);
- d->ensureContentsAdapter();
-}
-
-QQuickWebEngineView::LifecycleState QQuickWebEngineView::lifecycleState() const
-{
- Q_D(const QQuickWebEngineView);
- return static_cast<LifecycleState>(d->adapter->lifecycleState());
-}
-
-void QQuickWebEngineView::setLifecycleState(LifecycleState state)
-{
- Q_D(QQuickWebEngineView);
- d->adapter->setLifecycleState(static_cast<WebContentsAdapterClient::LifecycleState>(state));
-}
-
-QQuickWebEngineView::LifecycleState QQuickWebEngineView::recommendedState() const
-{
- Q_D(const QQuickWebEngineView);
- return static_cast<LifecycleState>(d->adapter->recommendedState());
-}
-
-QQuickWebEngineFullScreenRequest::QQuickWebEngineFullScreenRequest()
- : m_viewPrivate(0)
- , m_toggleOn(false)
-{
-}
-
-QQuickWebEngineFullScreenRequest::QQuickWebEngineFullScreenRequest(QQuickWebEngineViewPrivate *viewPrivate, const QUrl &origin, bool toggleOn)
- : m_viewPrivate(viewPrivate)
- , m_origin(origin)
- , m_toggleOn(toggleOn)
-{
-}
-
-void QQuickWebEngineFullScreenRequest::accept()
-{
- if (m_viewPrivate)
- m_viewPrivate->setFullScreenMode(m_toggleOn);
-}
-
-void QQuickWebEngineFullScreenRequest::reject()
-{
- if (m_viewPrivate)
- m_viewPrivate->setFullScreenMode(!m_toggleOn);
-}
-
-QQuickContextMenuBuilder::QQuickContextMenuBuilder(const QtWebEngineCore::WebEngineContextMenuData &data,
- QQuickWebEngineView *view,
- QObject *menu)
- : QtWebEngineCore::RenderViewContextMenuQt(data)
- , m_view(view)
- , m_menu(menu)
-{
-}
-
-void QQuickContextMenuBuilder::appendExtraItems(QQmlEngine *engine)
-{
- m_view->d_ptr->ui()->addMenuSeparator(m_menu);
- if (QObject *menuExtras = m_view->d_ptr->contextMenuExtraItems->create(qmlContext(m_view))) {
- menuExtras->setParent(m_menu);
- QQmlListReference entries(m_menu, defaultPropertyName(m_menu), engine);
- if (entries.isValid())
- entries.append(menuExtras);
- }
-}
-
-bool QQuickContextMenuBuilder::hasInspector()
-{
- return m_view->d_ptr->adapter->hasInspector();
-}
-
-bool QQuickContextMenuBuilder::isFullScreenMode()
-{
- return m_view->d_ptr->isFullScreenMode();
-}
-
-void QQuickContextMenuBuilder::addMenuItem(ContextMenuItem menuItem)
-{
- QQuickWebEngineAction *action = nullptr;
-
- switch (menuItem) {
- case ContextMenuItem::Back:
- action = m_view->action(QQuickWebEngineView::Back);
- break;
- case ContextMenuItem::Forward:
- action = m_view->action(QQuickWebEngineView::Forward);
- break;
- case ContextMenuItem::Reload:
- action = m_view->action(QQuickWebEngineView::Reload);
- break;
- case ContextMenuItem::Cut:
- action = m_view->action(QQuickWebEngineView::Cut);
- break;
- case ContextMenuItem::Copy:
- action = m_view->action(QQuickWebEngineView::Copy);
- break;
- case ContextMenuItem::Paste:
- action = m_view->action(QQuickWebEngineView::Paste);
- break;
- case ContextMenuItem::Undo:
- action = m_view->action(QQuickWebEngineView::Undo);
- break;
- case ContextMenuItem::Redo:
- action = m_view->action(QQuickWebEngineView::Redo);
- break;
- case ContextMenuItem::SelectAll:
- action = m_view->action(QQuickWebEngineView::SelectAll);
- break;
- case ContextMenuItem::PasteAndMatchStyle:
- action = m_view->action(QQuickWebEngineView::PasteAndMatchStyle);
- break;
- case ContextMenuItem::OpenLinkInNewWindow:
- action = m_view->action(QQuickWebEngineView::OpenLinkInNewWindow);
- break;
- case ContextMenuItem::OpenLinkInNewTab:
- action = m_view->action(QQuickWebEngineView::OpenLinkInNewTab);
- break;
- case ContextMenuItem::CopyLinkToClipboard:
- action = m_view->action(QQuickWebEngineView::CopyLinkToClipboard);
- break;
- case ContextMenuItem::DownloadLinkToDisk:
- action = m_view->action(QQuickWebEngineView::DownloadLinkToDisk);
- break;
- case ContextMenuItem::CopyImageToClipboard:
- action = m_view->action(QQuickWebEngineView::CopyImageToClipboard);
- break;
- case ContextMenuItem::CopyImageUrlToClipboard:
- action = m_view->action(QQuickWebEngineView::CopyImageUrlToClipboard);
- break;
- case ContextMenuItem::DownloadImageToDisk:
- action = m_view->action(QQuickWebEngineView::DownloadImageToDisk);
- break;
- case ContextMenuItem::CopyMediaUrlToClipboard:
- action = m_view->action(QQuickWebEngineView::CopyMediaUrlToClipboard);
- break;
- case ContextMenuItem::ToggleMediaControls:
- action = m_view->action(QQuickWebEngineView::ToggleMediaControls);
- break;
- case ContextMenuItem::ToggleMediaLoop:
- action = m_view->action(QQuickWebEngineView::ToggleMediaLoop);
- break;
- case ContextMenuItem::DownloadMediaToDisk:
- action = m_view->action(QQuickWebEngineView::DownloadMediaToDisk);
- break;
- case ContextMenuItem::InspectElement:
- action = m_view->action(QQuickWebEngineView::InspectElement);
- break;
- case ContextMenuItem::ExitFullScreen:
- action = m_view->action(QQuickWebEngineView::ExitFullScreen);
- break;
- case ContextMenuItem::SavePage:
- action = m_view->action(QQuickWebEngineView::SavePage);
- break;
- case ContextMenuItem::ViewSource:
- action = m_view->action(QQuickWebEngineView::ViewSource);
- break;
- case ContextMenuItem::SpellingSuggestions:
- {
- QPointer<QQuickWebEngineView> thisRef(m_view);
- for (int i=0; i < m_contextData.spellCheckerSuggestions().count() && i < 4; i++) {
- action = new QQuickWebEngineAction(m_menu);
- QString replacement = m_contextData.spellCheckerSuggestions().at(i);
- QObject::connect(action, &QQuickWebEngineAction::triggered, [thisRef, replacement] { thisRef->replaceMisspelledWord(replacement); });
- m_view->d_ptr->ui()->addMenuItem(action, m_menu);
- }
- return;
- }
- case ContextMenuItem::Separator:
- m_view->d_ptr->ui()->addMenuSeparator(m_menu);
- return;
- }
- // Set enabled property directly with avoiding binding loops caused by its notifier signal.
- action->d_ptr->m_enabled = isMenuItemEnabled(menuItem);
- m_view->d_ptr->ui()->addMenuItem(action, m_menu);
-}
-
-bool QQuickContextMenuBuilder::isMenuItemEnabled(ContextMenuItem menuItem)
-{
- switch (menuItem) {
- case ContextMenuItem::Back:
- return m_view->canGoBack();
- case ContextMenuItem::Forward:
- return m_view->canGoForward();
- case ContextMenuItem::Reload:
- return true;
- case ContextMenuItem::Cut:
- return m_contextData.editFlags() & QtWebEngineCore::WebEngineContextMenuData::CanCut;
- case ContextMenuItem::Copy:
- return m_contextData.editFlags() & QtWebEngineCore::WebEngineContextMenuData::CanCopy;
- case ContextMenuItem::Paste:
- return m_contextData.editFlags() & QtWebEngineCore::WebEngineContextMenuData::CanPaste;
- case ContextMenuItem::Undo:
- return m_contextData.editFlags() & QtWebEngineCore::WebEngineContextMenuData::CanUndo;
- case ContextMenuItem::Redo:
- return m_contextData.editFlags() & QtWebEngineCore::WebEngineContextMenuData::CanRedo;
- case ContextMenuItem::SelectAll:
- return m_contextData.editFlags() & QtWebEngineCore::WebEngineContextMenuData::CanSelectAll;
- case ContextMenuItem::PasteAndMatchStyle:
- return m_contextData.editFlags() & QtWebEngineCore::WebEngineContextMenuData::CanPaste;
- case ContextMenuItem::OpenLinkInNewWindow:
- case ContextMenuItem::OpenLinkInNewTab:
- case ContextMenuItem::CopyLinkToClipboard:
- case ContextMenuItem::DownloadLinkToDisk:
- case ContextMenuItem::CopyImageToClipboard:
- case ContextMenuItem::CopyImageUrlToClipboard:
- case ContextMenuItem::DownloadImageToDisk:
- case ContextMenuItem::CopyMediaUrlToClipboard:
- case ContextMenuItem::ToggleMediaControls:
- case ContextMenuItem::ToggleMediaLoop:
- case ContextMenuItem::DownloadMediaToDisk:
- case ContextMenuItem::InspectElement:
- case ContextMenuItem::ExitFullScreen:
- case ContextMenuItem::SavePage:
- return true;
- case ContextMenuItem::ViewSource:
- return m_view->d_ptr->adapter->canViewSource();
- case ContextMenuItem::SpellingSuggestions:
- case ContextMenuItem::Separator:
- return true;
- }
- Q_UNREACHABLE();
-}
-
-
-QQuickWebEngineTouchHandle::QQuickWebEngineTouchHandle(QtWebEngineCore::UIDelegatesManager *ui, const QMap<int, QImage> &images)
-{
- Q_ASSERT(ui);
- m_item.reset(ui->createTouchHandle());
-
- QQmlEngine *engine = qmlEngine(m_item.data());
- Q_ASSERT(engine);
- QQuickWebEngineTouchHandleProvider *touchHandleProvider =
- static_cast<QQuickWebEngineTouchHandleProvider *>(engine->imageProvider(QQuickWebEngineTouchHandleProvider::identifier()));
- Q_ASSERT(touchHandleProvider);
- touchHandleProvider->init(images);
-}
-
-void QQuickWebEngineTouchHandle::setImage(int orientation)
-{
- QUrl url = QQuickWebEngineTouchHandleProvider::url(orientation);
- m_item->setProperty("source", url);
-}
-
-void QQuickWebEngineTouchHandle::setBounds(const QRect &bounds)
-{
- m_item->setProperty("x", bounds.x());
- m_item->setProperty("y", bounds.y());
- m_item->setProperty("width", bounds.width());
- m_item->setProperty("height", bounds.height());
-}
-
-void QQuickWebEngineTouchHandle::setVisible(bool visible)
-{
- m_item->setProperty("visible", visible);
-}
-
-void QQuickWebEngineTouchHandle::setOpacity(float opacity)
-{
- m_item->setProperty("opacity", opacity);
-}
-
-QT_END_NAMESPACE
-
diff --git a/src/webengine/api/qquickwebengineview_p.h b/src/webengine/api/qquickwebengineview_p.h
deleted file mode 100644
index ab84b2600..000000000
--- a/src/webengine/api/qquickwebengineview_p.h
+++ /dev/null
@@ -1,616 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKWEBENGINEVIEW_P_H
-#define QQUICKWEBENGINEVIEW_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtWebEngine/private/qtwebengineglobal_p.h>
-#include <QQuickItem>
-#include <QtGui/qcolor.h>
-
-#include "qquickwebenginescript.h"
-
-QT_BEGIN_NAMESPACE
-
-class QQmlWebChannel;
-class QQuickContextMenuBuilder;
-class QQuickWebEngineAction;
-class QQuickWebEngineAuthenticationDialogRequest;
-class QQuickWebEngineCertificateError;
-class QQuickWebEngineClientCertificateSelection;
-class QQuickWebEngineColorDialogRequest;
-class QQuickWebEngineContextMenuRequest;
-class QQuickWebEngineFaviconProvider;
-class QQuickWebEngineFileDialogRequest;
-class QQuickWebEngineHistory;
-class QQuickWebEngineJavaScriptDialogRequest;
-class QQuickWebEngineLoadRequest;
-class QQuickWebEngineNavigationRequest;
-class QQuickWebEngineNewViewRequest;
-class QQuickWebEngineProfile;
-class QQuickWebEngineSettings;
-class QQuickWebEngineTooltipRequest;
-class QQuickWebEngineFormValidationMessageRequest;
-class QQuickWebEngineViewPrivate;
-class QWebEngineFindTextResult;
-class QWebEngineQuotaRequest;
-class QWebEngineRegisterProtocolHandlerRequest;
-
-#if QT_CONFIG(webengine_testsupport)
-class QQuickWebEngineTestSupport;
-#endif
-
-class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineFullScreenRequest {
- Q_GADGET
- Q_PROPERTY(QUrl origin READ origin CONSTANT FINAL)
- Q_PROPERTY(bool toggleOn READ toggleOn CONSTANT FINAL)
-public:
- QQuickWebEngineFullScreenRequest();
- QQuickWebEngineFullScreenRequest(QQuickWebEngineViewPrivate *viewPrivate, const QUrl &origin, bool toggleOn);
-
- Q_INVOKABLE void accept();
- Q_INVOKABLE void reject();
- QUrl origin() const { return m_origin; }
- bool toggleOn() const { return m_toggleOn; }
-
-private:
- QQuickWebEngineViewPrivate *m_viewPrivate;
- const QUrl m_origin;
- const bool m_toggleOn;
-};
-
-#define LATEST_WEBENGINEVIEW_REVISION 10
-
-class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineView : public QQuickItem {
- Q_OBJECT
- Q_CLASSINFO("RegisterEnumClassesUnscoped", "false")
- Q_PROPERTY(QUrl url READ url WRITE setUrl NOTIFY urlChanged FINAL)
- Q_PROPERTY(QUrl icon READ icon NOTIFY iconChanged FINAL)
- Q_PROPERTY(bool loading READ isLoading NOTIFY loadingChanged FINAL)
- Q_PROPERTY(int loadProgress READ loadProgress NOTIFY loadProgressChanged FINAL)
- Q_PROPERTY(QString title READ title NOTIFY titleChanged FINAL)
- Q_PROPERTY(bool canGoBack READ canGoBack NOTIFY urlChanged FINAL)
- Q_PROPERTY(bool canGoForward READ canGoForward NOTIFY urlChanged FINAL)
- Q_PROPERTY(bool isFullScreen READ isFullScreen NOTIFY isFullScreenChanged REVISION 1 FINAL)
- Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor NOTIFY zoomFactorChanged REVISION 1 FINAL)
- Q_PROPERTY(QQuickWebEngineProfile *profile READ profile WRITE setProfile NOTIFY profileChanged FINAL REVISION 1)
- Q_PROPERTY(QQuickWebEngineSettings *settings READ settings REVISION 1 CONSTANT FINAL)
- Q_PROPERTY(QQuickWebEngineHistory *navigationHistory READ navigationHistory CONSTANT FINAL REVISION 1)
- Q_PROPERTY(QQmlWebChannel *webChannel READ webChannel WRITE setWebChannel NOTIFY webChannelChanged REVISION 1 FINAL)
- Q_PROPERTY(QQmlListProperty<QQuickWebEngineScript> userScripts READ userScripts FINAL REVISION 1)
- Q_PROPERTY(bool activeFocusOnPress READ activeFocusOnPress WRITE setActiveFocusOnPress NOTIFY activeFocusOnPressChanged REVISION 2 FINAL)
- Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor NOTIFY backgroundColorChanged REVISION 2 FINAL)
- Q_PROPERTY(QSizeF contentsSize READ contentsSize NOTIFY contentsSizeChanged FINAL REVISION 3)
- Q_PROPERTY(QPointF scrollPosition READ scrollPosition NOTIFY scrollPositionChanged FINAL REVISION 3)
- Q_PROPERTY(bool audioMuted READ isAudioMuted WRITE setAudioMuted NOTIFY audioMutedChanged FINAL REVISION 3)
- Q_PROPERTY(bool recentlyAudible READ recentlyAudible NOTIFY recentlyAudibleChanged FINAL REVISION 3)
- Q_PROPERTY(uint webChannelWorld READ webChannelWorld WRITE setWebChannelWorld NOTIFY webChannelWorldChanged REVISION 3 FINAL)
-
- Q_PROPERTY(QQuickWebEngineView *inspectedView READ inspectedView WRITE setInspectedView NOTIFY inspectedViewChanged REVISION 7 FINAL)
- Q_PROPERTY(QQuickWebEngineView *devToolsView READ devToolsView WRITE setDevToolsView NOTIFY devToolsViewChanged REVISION 7 FINAL)
-#if QT_CONFIG(webengine_testsupport)
- Q_PROPERTY(QQuickWebEngineTestSupport *testSupport READ testSupport WRITE setTestSupport NOTIFY testSupportChanged FINAL)
-#endif
-
- Q_PROPERTY(LifecycleState lifecycleState READ lifecycleState WRITE setLifecycleState NOTIFY lifecycleStateChanged REVISION 10 FINAL)
- Q_PROPERTY(LifecycleState recommendedState READ recommendedState NOTIFY recommendedStateChanged REVISION 10 FINAL)
-
- Q_PROPERTY(qint64 renderProcessPid READ renderProcessPid NOTIFY renderProcessPidChanged FINAL REVISION 11)
-
-public:
- QQuickWebEngineView(QQuickItem *parent = 0);
- ~QQuickWebEngineView();
-
- QUrl url() const;
- void setUrl(const QUrl&);
- QUrl icon() const;
- bool isLoading() const;
- int loadProgress() const;
- QString title() const;
- bool canGoBack() const;
- bool canGoForward() const;
- bool isFullScreen() const;
- qreal zoomFactor() const;
- void setZoomFactor(qreal arg);
- QColor backgroundColor() const;
- void setBackgroundColor(const QColor &color);
- QSizeF contentsSize() const;
- QPointF scrollPosition() const;
-
- // must match WebContentsAdapterClient::NavigationRequestAction
- enum NavigationRequestAction {
- AcceptRequest,
- // Make room in the valid range of the enum so
- // we can expose extra actions.
- IgnoreRequest = 0xFF
- };
- Q_ENUM(NavigationRequestAction)
-
- // must match WebContentsAdapterClient::NavigationType
- enum NavigationType {
- LinkClickedNavigation,
- TypedNavigation,
- FormSubmittedNavigation,
- BackForwardNavigation,
- ReloadNavigation,
- OtherNavigation,
- RedirectNavigation,
- };
- Q_ENUM(NavigationType)
-
- enum LoadStatus {
- LoadStartedStatus,
- LoadStoppedStatus,
- LoadSucceededStatus,
- LoadFailedStatus
- };
- Q_ENUM(LoadStatus)
-
- enum ErrorDomain {
- NoErrorDomain,
- InternalErrorDomain,
- ConnectionErrorDomain,
- CertificateErrorDomain,
- HttpErrorDomain,
- FtpErrorDomain,
- DnsErrorDomain
- };
- Q_ENUM(ErrorDomain)
-
- enum NewViewDestination {
- NewViewInWindow,
- NewViewInTab,
- NewViewInDialog,
- NewViewInBackgroundTab
- };
- Q_ENUM(NewViewDestination)
-
- enum Feature {
- MediaAudioCapture,
- MediaVideoCapture,
- MediaAudioVideoCapture,
- Geolocation,
- DesktopVideoCapture,
- DesktopAudioVideoCapture,
- Notifications,
- };
- Q_ENUM(Feature)
-
- enum WebAction {
- NoWebAction = - 1,
- Back,
- Forward,
- Stop,
- Reload,
-
- Cut,
- Copy,
- Paste,
-
- Undo,
- Redo,
- SelectAll,
- ReloadAndBypassCache,
-
- PasteAndMatchStyle,
-
- OpenLinkInThisWindow,
- OpenLinkInNewWindow,
- OpenLinkInNewTab,
- CopyLinkToClipboard,
- DownloadLinkToDisk,
-
- CopyImageToClipboard,
- CopyImageUrlToClipboard,
- DownloadImageToDisk,
-
- CopyMediaUrlToClipboard,
- ToggleMediaControls,
- ToggleMediaLoop,
- ToggleMediaPlayPause,
- ToggleMediaMute,
- DownloadMediaToDisk,
-
- InspectElement,
- ExitFullScreen,
- RequestClose,
- Unselect,
- SavePage,
- ViewSource,
-
- ToggleBold,
- ToggleItalic,
- ToggleUnderline,
- ToggleStrikethrough,
-
- AlignLeft,
- AlignCenter,
- AlignRight,
- AlignJustified,
- Indent,
- Outdent,
-
- InsertOrderedList,
- InsertUnorderedList,
-
- WebActionCount
- };
- Q_ENUM(WebAction)
-
- // must match WebContentsAdapterClient::JavaScriptConsoleMessageLevel
- enum JavaScriptConsoleMessageLevel {
- InfoMessageLevel = 0,
- WarningMessageLevel,
- ErrorMessageLevel
- };
- Q_ENUM(JavaScriptConsoleMessageLevel)
-
- // must match WebContentsAdapterClient::RenderProcessTerminationStatus
- enum RenderProcessTerminationStatus {
- NormalTerminationStatus = 0,
- AbnormalTerminationStatus,
- CrashedTerminationStatus,
- KilledTerminationStatus
- };
- Q_ENUM(RenderProcessTerminationStatus)
-
- enum FindFlag {
- FindBackward = 1,
- FindCaseSensitively = 2,
- };
- Q_DECLARE_FLAGS(FindFlags, FindFlag)
- Q_FLAG(FindFlags)
-
- // must match QPageSize::PageSizeId
- enum PrintedPageSizeId {
- // Existing Qt sizes
- A4,
- B5,
- Letter,
- Legal,
- Executive,
- A0,
- A1,
- A2,
- A3,
- A5,
- A6,
- A7,
- A8,
- A9,
- B0,
- B1,
- B10,
- B2,
- B3,
- B4,
- B6,
- B7,
- B8,
- B9,
- C5E,
- Comm10E,
- DLE,
- Folio,
- Ledger,
- Tabloid,
- Custom,
-
- // New values derived from PPD standard
- A10,
- A3Extra,
- A4Extra,
- A4Plus,
- A4Small,
- A5Extra,
- B5Extra,
-
- JisB0,
- JisB1,
- JisB2,
- JisB3,
- JisB4,
- JisB5,
- JisB6,
- JisB7,
- JisB8,
- JisB9,
- JisB10,
-
- // AnsiA = Letter,
- // AnsiB = Ledger,
- AnsiC,
- AnsiD,
- AnsiE,
- LegalExtra,
- LetterExtra,
- LetterPlus,
- LetterSmall,
- TabloidExtra,
-
- ArchA,
- ArchB,
- ArchC,
- ArchD,
- ArchE,
-
- Imperial7x9,
- Imperial8x10,
- Imperial9x11,
- Imperial9x12,
- Imperial10x11,
- Imperial10x13,
- Imperial10x14,
- Imperial12x11,
- Imperial15x11,
-
- ExecutiveStandard,
- Note,
- Quarto,
- Statement,
- SuperA,
- SuperB,
- Postcard,
- DoublePostcard,
- Prc16K,
- Prc32K,
- Prc32KBig,
-
- FanFoldUS,
- FanFoldGerman,
- FanFoldGermanLegal,
-
- EnvelopeB4,
- EnvelopeB5,
- EnvelopeB6,
- EnvelopeC0,
- EnvelopeC1,
- EnvelopeC2,
- EnvelopeC3,
- EnvelopeC4,
- // EnvelopeC5 = C5E,
- EnvelopeC6,
- EnvelopeC65,
- EnvelopeC7,
- // EnvelopeDL = DLE,
-
- Envelope9,
- // Envelope10 = Comm10E,
- Envelope11,
- Envelope12,
- Envelope14,
- EnvelopeMonarch,
- EnvelopePersonal,
-
- EnvelopeChou3,
- EnvelopeChou4,
- EnvelopeInvite,
- EnvelopeItalian,
- EnvelopeKaku2,
- EnvelopeKaku3,
- EnvelopePrc1,
- EnvelopePrc2,
- EnvelopePrc3,
- EnvelopePrc4,
- EnvelopePrc5,
- EnvelopePrc6,
- EnvelopePrc7,
- EnvelopePrc8,
- EnvelopePrc9,
- EnvelopePrc10,
- EnvelopeYou4,
-
- // Last item, with commonly used synynoms from QPagedPrintEngine / QPrinter
- LastPageSize = EnvelopeYou4,
- NPageSize = LastPageSize,
- NPaperSize = LastPageSize,
-
- // Convenience overloads for naming consistency
- AnsiA = Letter,
- AnsiB = Ledger,
- EnvelopeC5 = C5E,
- EnvelopeDL = DLE,
- Envelope10 = Comm10E
- };
- Q_ENUM(PrintedPageSizeId)
-
- // must match QPageLayout::Orientation
- enum PrintedPageOrientation {
- Portrait,
- Landscape
- };
- Q_ENUM(PrintedPageOrientation)
-
- // must match WebContentsAdapterClient::LifecycleState
- enum class LifecycleState {
- Active,
- Frozen,
- Discarded,
- };
- Q_ENUM(LifecycleState)
-
- // QmlParserStatus
- void componentComplete() override;
-
- QQuickWebEngineProfile *profile();
- void setProfile(QQuickWebEngineProfile *);
- QQmlListProperty<QQuickWebEngineScript> userScripts();
-
- QQuickWebEngineSettings *settings();
- QQmlWebChannel *webChannel();
- void setWebChannel(QQmlWebChannel *);
- QQuickWebEngineHistory *navigationHistory() const;
- uint webChannelWorld() const;
- void setWebChannelWorld(uint);
- Q_REVISION(8) Q_INVOKABLE QQuickWebEngineAction *action(WebAction action);
-
- bool isAudioMuted() const;
- void setAudioMuted(bool muted);
- bool recentlyAudible() const;
-
- qint64 renderProcessPid() const;
-
-#if QT_CONFIG(webengine_testsupport)
- QQuickWebEngineTestSupport *testSupport() const;
- void setTestSupport(QQuickWebEngineTestSupport *testSupport);
-#endif
-
- bool activeFocusOnPress() const;
-
- void setInspectedView(QQuickWebEngineView *);
- QQuickWebEngineView *inspectedView() const;
- void setDevToolsView(QQuickWebEngineView *);
- QQuickWebEngineView *devToolsView() const;
-
- LifecycleState lifecycleState() const;
- void setLifecycleState(LifecycleState state);
-
- LifecycleState recommendedState() const;
-
-public Q_SLOTS:
- void runJavaScript(const QString&, const QJSValue & = QJSValue());
- Q_REVISION(3) void runJavaScript(const QString&, quint32 worldId, const QJSValue & = QJSValue());
- void loadHtml(const QString &html, const QUrl &baseUrl = QUrl());
- void goBack();
- void goForward();
- Q_REVISION(1) void goBackOrForward(int index);
- void reload();
- Q_REVISION(1) void reloadAndBypassCache();
- void stop();
- Q_REVISION(1) void findText(const QString &subString, FindFlags options = { }, const QJSValue &callback = QJSValue());
- Q_REVISION(1) void fullScreenCancelled();
- Q_REVISION(1) void grantFeaturePermission(const QUrl &securityOrigin, Feature, bool granted);
- Q_REVISION(2) void setActiveFocusOnPress(bool arg);
- Q_REVISION(2) void triggerWebAction(WebAction action);
- Q_REVISION(3) void printToPdf(const QString &filePath, PrintedPageSizeId pageSizeId = PrintedPageSizeId::A4, PrintedPageOrientation orientation = PrintedPageOrientation::Portrait);
- Q_REVISION(3) void printToPdf(const QJSValue &callback, PrintedPageSizeId pageSizeId = PrintedPageSizeId::A4, PrintedPageOrientation orientation = PrintedPageOrientation::Portrait);
- Q_REVISION(4) void replaceMisspelledWord(const QString &replacement);
-
-private Q_SLOTS:
- void lazyInitialize();
-
-Q_SIGNALS:
- void titleChanged();
- void urlChanged();
- void iconChanged();
- void loadingChanged(QQuickWebEngineLoadRequest *loadRequest);
- void loadProgressChanged();
- void linkHovered(const QUrl &hoveredUrl);
- void navigationRequested(QQuickWebEngineNavigationRequest *request);
- void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString &message, int lineNumber, const QString &sourceID);
- Q_REVISION(1) void certificateError(QQuickWebEngineCertificateError *error);
- Q_REVISION(1) void fullScreenRequested(const QQuickWebEngineFullScreenRequest &request);
- Q_REVISION(1) void isFullScreenChanged();
- Q_REVISION(1) void featurePermissionRequested(const QUrl &securityOrigin, Feature feature);
- Q_REVISION(1) void newViewRequested(QQuickWebEngineNewViewRequest *request);
- Q_REVISION(1) void zoomFactorChanged(qreal arg);
- Q_REVISION(1) void profileChanged();
- Q_REVISION(1) void webChannelChanged();
- Q_REVISION(2) void activeFocusOnPressChanged(bool);
- Q_REVISION(2) void backgroundColorChanged();
- Q_REVISION(2) void renderProcessTerminated(RenderProcessTerminationStatus terminationStatus, int exitCode);
- Q_REVISION(2) void windowCloseRequested();
- Q_REVISION(3) void contentsSizeChanged(const QSizeF& size);
- Q_REVISION(3) void scrollPositionChanged(const QPointF& position);
- Q_REVISION(3) void audioMutedChanged(bool muted);
- Q_REVISION(3) void recentlyAudibleChanged(bool recentlyAudible);
- Q_REVISION(3) void webChannelWorldChanged(uint);
- Q_REVISION(4) void contextMenuRequested(QQuickWebEngineContextMenuRequest *request);
- Q_REVISION(4) void authenticationDialogRequested(QQuickWebEngineAuthenticationDialogRequest *request);
- Q_REVISION(4) void javaScriptDialogRequested(QQuickWebEngineJavaScriptDialogRequest *request);
- Q_REVISION(4) void colorDialogRequested(QQuickWebEngineColorDialogRequest *request);
- Q_REVISION(4) void fileDialogRequested(QQuickWebEngineFileDialogRequest *request);
- Q_REVISION(4) void formValidationMessageRequested(QQuickWebEngineFormValidationMessageRequest *request);
- Q_REVISION(5) void pdfPrintingFinished(const QString &filePath, bool success);
- Q_REVISION(7) void quotaRequested(const QWebEngineQuotaRequest &request);
- Q_REVISION(7) void geometryChangeRequested(const QRect &geometry, const QRect &frameGeometry);
- Q_REVISION(7) void inspectedViewChanged();
- Q_REVISION(7) void devToolsViewChanged();
- Q_REVISION(7) void registerProtocolHandlerRequested(const QWebEngineRegisterProtocolHandlerRequest &request);
- Q_REVISION(8) void printRequested();
- Q_REVISION(9) void selectClientCertificate(QQuickWebEngineClientCertificateSelection *clientCertSelection);
- Q_REVISION(10) void tooltipRequested(QQuickWebEngineTooltipRequest *request);
- Q_REVISION(10) void lifecycleStateChanged(LifecycleState state);
- Q_REVISION(10) void recommendedStateChanged(LifecycleState state);
- Q_REVISION(10) void findTextFinished(const QWebEngineFindTextResult &result);
- Q_REVISION(11) void renderProcessPidChanged(qint64 pid);
-
-#if QT_CONFIG(webengine_testsupport)
- void testSupportChanged();
-#endif
-
-protected:
- void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override;
- void itemChange(ItemChange, const ItemChangeData &) override;
-#if QT_CONFIG(draganddrop)
- void dragEnterEvent(QDragEnterEvent *e) override;
- void dragLeaveEvent(QDragLeaveEvent *e) override;
- void dragMoveEvent(QDragMoveEvent *e) override;
- void dropEvent(QDropEvent *e) override;
-#endif // QT_CONFIG(draganddrop)
-
-private:
- Q_DECLARE_PRIVATE(QQuickWebEngineView)
- QScopedPointer<QQuickWebEngineViewPrivate> d_ptr;
-
- friend class QQuickContextMenuBuilder;
- friend class QQuickWebEngineNewViewRequest;
- friend class QQuickWebEngineFaviconProvider;
-#ifndef QT_NO_ACCESSIBILITY
- friend class QQuickWebEngineViewAccessible;
-#endif // QT_NO_ACCESSIBILITY
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QQuickWebEngineView)
-Q_DECLARE_METATYPE(QQuickWebEngineFullScreenRequest)
-
-#endif // QQUICKWEBENGINEVIEW_P_H
diff --git a/src/webengine/api/qquickwebengineview_p_p.h b/src/webengine/api/qquickwebengineview_p_p.h
deleted file mode 100644
index 68d65410a..000000000
--- a/src/webengine/api/qquickwebengineview_p_p.h
+++ /dev/null
@@ -1,286 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKWEBENGINEVIEW_P_P_H
-#define QQUICKWEBENGINEVIEW_P_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "qquickwebengineview_p.h"
-#include "render_view_context_menu_qt.h"
-#include "touch_handle_drawable_client.h"
-#include "web_contents_adapter_client.h"
-
-#include <QPointer>
-#include <QScopedPointer>
-#include <QSharedData>
-#include <QString>
-#include <QtCore/qcompilerdetection.h>
-#include <QtGui/qaccessibleobject.h>
-
-namespace QtWebEngineCore {
-class RenderWidgetHostViewQtDelegateQuick;
-class TouchHandleDrawableClient;
-class TouchSelectionMenuController;
-class UIDelegatesManager;
-class WebContentsAdapter;
-}
-
-QT_BEGIN_NAMESPACE
-class QQuickWebEngineView;
-class QQmlComponent;
-class QQmlContext;
-class QQuickWebEngineContextMenuRequest;
-class QQuickWebEngineSettings;
-class QQuickWebEngineFaviconProvider;
-class QQuickWebEngineProfilePrivate;
-class QQuickWebEngineTouchHandleProvider;
-class QWebEngineFindTextResult;
-
-#if QT_CONFIG(webengine_testsupport)
-class QQuickWebEngineTestSupport;
-#endif
-
-class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineViewPrivate : public QtWebEngineCore::WebContentsAdapterClient
-{
-public:
- Q_DECLARE_PUBLIC(QQuickWebEngineView)
- QQuickWebEngineView *q_ptr;
- QQuickWebEngineViewPrivate();
- ~QQuickWebEngineViewPrivate();
- void releaseProfile() override;
- void initializeProfile();
- QtWebEngineCore::UIDelegatesManager *ui();
-
- QtWebEngineCore::RenderWidgetHostViewQtDelegate* CreateRenderWidgetHostViewQtDelegate(QtWebEngineCore::RenderWidgetHostViewQtDelegateClient *client) override;
- QtWebEngineCore::RenderWidgetHostViewQtDelegate* CreateRenderWidgetHostViewQtDelegateForPopup(QtWebEngineCore::RenderWidgetHostViewQtDelegateClient *client) override;
- void initializationFinished() override;
- void lifecycleStateChanged(LifecycleState state) override;
- void recommendedStateChanged(LifecycleState state) override;
- void visibleChanged(bool visible) override;
- void titleChanged(const QString&) override;
- void urlChanged() override;
- void iconChanged(const QUrl&) override;
- void loadProgressChanged(int progress) override;
- void didUpdateTargetURL(const QUrl&) override;
- void selectionChanged() override;
- void recentlyAudibleChanged(bool recentlyAudible) override;
- void renderProcessPidChanged(qint64 pid) override;
- QRectF viewportRect() const override;
- QColor backgroundColor() const override;
- void loadStarted(const QUrl &provisionalUrl, bool isErrorPage = false) override;
- void loadCommitted() override;
- void loadVisuallyCommitted() override;
- void loadFinished(bool success, const QUrl &url, bool isErrorPage = false, int errorCode = 0, const QString &errorDescription = QString()) override;
- void focusContainer() override;
- void unhandledKeyEvent(QKeyEvent *event) override;
- QSharedPointer<QtWebEngineCore::WebContentsAdapter>
- adoptNewWindow(QSharedPointer<QtWebEngineCore::WebContentsAdapter> newWebContents,
- WindowOpenDisposition disposition, bool userGesture, const QRect &,
- const QUrl &targetUrl) override;
- bool isBeingAdopted() override;
- void close() override;
- void windowCloseRejected() override;
- void requestFullScreenMode(const QUrl &origin, bool fullscreen) override;
- bool isFullScreenMode() const override;
- void contextMenuRequested(const QtWebEngineCore::WebEngineContextMenuData &) override;
- void navigationRequested(int navigationType, const QUrl &url, int &navigationRequestAction, bool isMainFrame) override;
- void javascriptDialog(QSharedPointer<QtWebEngineCore::JavaScriptDialogController>) override;
- void runFileChooser(QSharedPointer<QtWebEngineCore::FilePickerController>) override;
- void showColorDialog(QSharedPointer<QtWebEngineCore::ColorChooserController>) override;
- void didRunJavaScript(quint64, const QVariant&) override;
- void didFetchDocumentMarkup(quint64, const QString&) override { }
- void didFetchDocumentInnerText(quint64, const QString&) override { }
- void didPrintPage(quint64 requestId, QSharedPointer<QByteArray>) override;
- void didPrintPageToPdf(const QString &filePath, bool success) override;
- bool passOnFocus(bool reverse) override;
- void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString& message, int lineNumber, const QString& sourceID) override;
- void authenticationRequired(QSharedPointer<QtWebEngineCore::AuthenticationDialogController>) override;
- void runMediaAccessPermissionRequest(const QUrl &securityOrigin, MediaRequestFlags requestFlags) override;
- void runMouseLockPermissionRequest(const QUrl &securityOrigin) override;
- void runQuotaRequest(QWebEngineQuotaRequest) override;
- void runRegisterProtocolHandlerRequest(QWebEngineRegisterProtocolHandlerRequest) override;
- QObject *accessibilityParentObject() override;
- QtWebEngineCore::WebEngineSettings *webEngineSettings() const override;
- void allowCertificateError(const QSharedPointer<CertificateErrorController> &errorController) override;
- void selectClientCert(const QSharedPointer<ClientCertSelectController> &selectController) override;
- void runFeaturePermissionRequest(QtWebEngineCore::ProfileAdapter::PermissionType permission, const QUrl &securityOrigin) override;
- void renderProcessTerminated(RenderProcessTerminationStatus terminationStatus, int exitCode) override;
- void requestGeometryChange(const QRect &geometry, const QRect &frameGeometry) override;
- void updateScrollPosition(const QPointF &position) override;
- void updateContentsSize(const QSizeF &size) override;
- void updateNavigationActions() override;
- void updateEditActions() override;
- void startDragging(const content::DropData &dropData, Qt::DropActions allowedActions,
- const QPixmap &pixmap, const QPoint &offset) override;
- bool supportsDragging() const override;
- bool isEnabled() const override;
- void setToolTip(const QString &toolTipText) override;
- QtWebEngineCore::TouchHandleDrawableClient *createTouchHandle(const QMap<int, QImage> &images) override;
- void showTouchSelectionMenu(QtWebEngineCore::TouchSelectionMenuController *, const QRect &, const QSize &) override;
- void hideTouchSelectionMenu() override;
- const QObject *holdingQObject() const override;
- ClientType clientType() override { return QtWebEngineCore::WebContentsAdapterClient::QmlClient; }
-
- QtWebEngineCore::ProfileAdapter *profileAdapter() override;
- QtWebEngineCore::WebContentsAdapter *webContentsAdapter() override;
- void printRequested() override;
- void widgetChanged(QtWebEngineCore::RenderWidgetHostViewQtDelegate *newWidgetBase) override;
- void findTextFinished(const QWebEngineFindTextResult &result) override;
-
- void updateAction(QQuickWebEngineView::WebAction) const;
- void adoptWebContents(QtWebEngineCore::WebContentsAdapter *webContents);
- void setProfile(QQuickWebEngineProfile *profile);
- void updateAdapter();
- void ensureContentsAdapter();
- void setFullScreenMode(bool);
-
- static void bindViewAndWidget(QQuickWebEngineView *view, QtWebEngineCore::RenderWidgetHostViewQtDelegateQuick *widget);
- void widgetChanged(QtWebEngineCore::RenderWidgetHostViewQtDelegateQuick *oldWidget,
- QtWebEngineCore::RenderWidgetHostViewQtDelegateQuick *newWidget);
-
- // QQmlListPropertyHelpers
- static void userScripts_append(QQmlListProperty<QQuickWebEngineScript> *p, QQuickWebEngineScript *script);
- static int userScripts_count(QQmlListProperty<QQuickWebEngineScript> *p);
- static QQuickWebEngineScript *userScripts_at(QQmlListProperty<QQuickWebEngineScript> *p, int idx);
- static void userScripts_clear(QQmlListProperty<QQuickWebEngineScript> *p);
-
- QQuickWebEngineProfile *m_profile;
- QSharedPointer<QtWebEngineCore::WebContentsAdapter> adapter;
- QScopedPointer<QQuickWebEngineHistory> m_history;
- QScopedPointer<QQuickWebEngineSettings> m_settings;
-#if QT_CONFIG(webengine_testsupport)
- QQuickWebEngineTestSupport *m_testSupport;
-#endif
- QQmlComponent *contextMenuExtraItems;
- QtWebEngineCore::WebEngineContextMenuData m_contextMenuData;
- QUrl m_url;
- QString m_html;
- QUrl iconUrl;
- QQuickWebEngineFaviconProvider *faviconProvider;
- int loadProgress;
- bool m_fullscreenMode;
- bool isLoading;
- bool m_activeFocusOnPress;
- bool m_navigationActionTriggered;
- qreal devicePixelRatio;
- QMap<quint64, QJSValue> m_callbacks;
- QList<QSharedPointer<CertificateErrorController> > m_certificateErrorControllers;
- QQmlWebChannel *m_webChannel;
- QPointer<QQuickWebEngineView> inspectedView;
- QPointer<QQuickWebEngineView> devToolsView;
- uint m_webChannelWorld;
- bool m_defaultAudioMuted;
- bool m_isBeingAdopted;
- mutable QQuickWebEngineAction *actions[QQuickWebEngineView::WebActionCount];
- QtWebEngineCore::RenderWidgetHostViewQtDelegateQuick *widget = nullptr;
-
- bool profileInitialized() const;
-
-private:
- QScopedPointer<QtWebEngineCore::UIDelegatesManager> m_uIDelegatesManager;
- QList<QQuickWebEngineScript *> m_userScripts;
- QColor m_backgroundColor;
- qreal m_zoomFactor;
- bool m_ui2Enabled;
- bool m_profileInitialized;
-};
-
-#ifndef QT_NO_ACCESSIBILITY
-class QQuickWebEngineViewAccessible : public QAccessibleObject
-{
-public:
- QQuickWebEngineViewAccessible(QQuickWebEngineView *o);
- bool isValid() const override;
- QAccessibleInterface *parent() const override;
- QAccessibleInterface *focusChild() const override;
- int childCount() const override;
- QAccessibleInterface *child(int index) const override;
- int indexOfChild(const QAccessibleInterface*) const override;
- QString text(QAccessible::Text) const override;
- QAccessible::Role role() const override;
- QAccessible::State state() const override;
-
-private:
- QQuickWebEngineView *engineView() const { return static_cast<QQuickWebEngineView*>(object()); }
-};
-#endif // QT_NO_ACCESSIBILITY
-
-class QQuickContextMenuBuilder : public QtWebEngineCore::RenderViewContextMenuQt
-{
-public:
- QQuickContextMenuBuilder(const QtWebEngineCore::WebEngineContextMenuData &data, QQuickWebEngineView *view, QObject *menu);
- void appendExtraItems(QQmlEngine *engine);
-
-private:
- virtual bool hasInspector() override;
- virtual bool isFullScreenMode() override;
-
- virtual void addMenuItem(ContextMenuItem menuItem) override;
- virtual bool isMenuItemEnabled(ContextMenuItem menuItem) override;
-
- QQuickWebEngineView *m_view;
- QObject *m_menu;
-};
-
-class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineTouchHandle : public QtWebEngineCore::TouchHandleDrawableClient {
-public:
- QQuickWebEngineTouchHandle(QtWebEngineCore::UIDelegatesManager *ui, const QMap<int, QImage> &images);
-
- void setImage(int orientation) override;
- void setBounds(const QRect &bounds) override;
- void setVisible(bool visible) override;
- void setOpacity(float opacity) override;
-
-private:
- QScopedPointer<QQuickItem> m_item;
-};
-
-QT_END_NAMESPACE
-
-#endif // QQUICKWEBENGINEVIEW_P_P_H
diff --git a/src/webengine/api/qtwebengineglobal.cpp b/src/webengine/api/qtwebengineglobal.cpp
deleted file mode 100644
index 4346832c9..000000000
--- a/src/webengine/api/qtwebengineglobal.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qtwebengineglobal.h"
-#include <QCoreApplication>
-
-namespace QtWebEngineCore
-{
- extern void initialize();
-}
-
-QT_BEGIN_NAMESPACE
-
-namespace QtWebEngine {
-
-/*!
- \namespace QtWebEngine
- \inmodule QtWebEngine
- \ingroup qtwebengine-namespaces
- \keyword QtWebEngine Namespace
-
- \brief Helper functions for the \QWE (Qt Quick) module.
-
- The \l[CPP]{QtWebEngine} namespace is part of the \QWE module.
-*/
-
-/*!
- \fn QtWebEngine::initialize()
-
- Sets up an OpenGL Context that can be shared between threads. This has to be done before
- QGuiApplication is created and before window's QPlatformOpenGLContext is created.
-
- This has the same effect as setting the Qt::AA_ShareOpenGLContexts
- attribute with QCoreApplication::setAttribute before constructing
- QGuiApplication.
-*/
-void initialize()
-{
- QCoreApplication *app = QCoreApplication::instance();
- if (app) {
- qWarning("QtWebEngine::initialize() called with QCoreApplication object already created and should be call before. "\
- "This is depreciated and may fail in the future.");
- QtWebEngineCore::initialize();
- return;
- }
- // call initialize the same way as widgets do
- qAddPreRoutine(QtWebEngineCore::initialize);
-}
-} // namespace QtWebEngine
-
-QT_END_NAMESPACE
diff --git a/src/webengine/api/qtwebengineglobal.h b/src/webengine/api/qtwebengineglobal.h
deleted file mode 100644
index c2b33778a..000000000
--- a/src/webengine/api/qtwebengineglobal.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QTWEBENGINEGLOBAL_H
-#define QTWEBENGINEGLOBAL_H
-
-#include <QtCore/qglobal.h>
-#include <QtWebEngine/qtwebengine-config.h>
-
-QT_BEGIN_NAMESPACE
-
-#ifndef QT_STATIC
-# if defined(QT_BUILD_WEBENGINE_LIB)
-# define Q_WEBENGINE_EXPORT Q_DECL_EXPORT
-# else
-# define Q_WEBENGINE_EXPORT Q_DECL_IMPORT
-# endif
-#else
-# define Q_WEBENGINE_EXPORT
-#endif
-
-namespace QtWebEngine
-{
- Q_WEBENGINE_EXPORT void initialize();
-}
-
-QT_END_NAMESPACE
-
-#endif // QTWEBENGINEGLOBAL_H
diff --git a/src/webengine/api/qtwebengineglobal_p.h b/src/webengine/api/qtwebengineglobal_p.h
deleted file mode 100644
index 2d30f75b0..000000000
--- a/src/webengine/api/qtwebengineglobal_p.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QTWEBENGINEGLOBAL_P_H
-#define QTWEBENGINEGLOBAL_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtWebEngine/qtwebengineglobal.h>
-#include <QtCore/private/qglobal_p.h>
-#include <QtWebEngine/private/qtwebengine-config_p.h>
-
-QT_BEGIN_NAMESPACE
-
-#define Q_WEBENGINE_PRIVATE_EXPORT Q_WEBENGINE_EXPORT
-
-QT_END_NAMESPACE
-
-#endif // QTWEBENGINEGLOBAL_P_H
diff --git a/src/webengine/configure.json b/src/webengine/configure.json
deleted file mode 100644
index ebe1ddb2b..000000000
--- a/src/webengine/configure.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "module": "webengine",
- "condition": "module.webenginecore && features.webengine-qml",
- "depends": [
- "webenginecore-private"
- ],
- "commandline": {
- "options": {
- "webengine-qml": "boolean"
- }
- },
- "features": {
- "webengine-qml": {
- "label": "Support Qt WebEngine Qml",
- "purpose": "Provides WebEngine Qml support.",
- "output": [ "privateFeature" ]
- },
- "webengine-ui-delegates": {
- "label": "UI Delegates",
- "section": "WebEngine",
- "output": [ "privateFeature" ]
- },
- "webengine-testsupport": {
- "label": "Test Support",
- "autoDetect": "features.private_tests || call.isTestsInBuildParts",
- "output": [ "privateFeature" ]
- }
- },
- "summary": [
- {
- "section": "Qt WebEngineQml",
- "entries": [
- "webengine-qml",
- "webengine-ui-delegates",
- "webengine-testsupport"
- ]
- }
- ]
-}
-
diff --git a/src/webengine/doc/QtWebEngineDoc b/src/webengine/doc/QtWebEngineDoc
deleted file mode 100644
index 0737885f1..000000000
--- a/src/webengine/doc/QtWebEngineDoc
+++ /dev/null
@@ -1,2 +0,0 @@
-#include <QtWebEngine/QtWebEngine>
-#include <QtWebEngineWidgets/QtWebEngineWidgets>
diff --git a/src/webengine/doc/qtwebengine.qdocconf b/src/webengine/doc/qtwebengine.qdocconf
deleted file mode 100644
index be5db9c19..000000000
--- a/src/webengine/doc/qtwebengine.qdocconf
+++ /dev/null
@@ -1,90 +0,0 @@
-include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
-include($QT_INSTALL_DOCS/config/exampleurl-qtwebengine.qdocconf)
-
-project = QtWebEngine
-description = Qt WebEngine Reference Documentation
-version = $QT_VERSION
-
-qhp.projects = QtWebEngine
-
-qhp.QtWebEngine.file = qtwebengine.qhp
-qhp.QtWebEngine.namespace = org.qt-project.qtwebengine.$QT_VERSION_TAG
-qhp.QtWebEngine.virtualFolder = qtwebengine
-qhp.QtWebEngine.indexTitle = Qt WebEngine
-qhp.QtWebEngine.indexRoot =
-
-qhp.QtWebEngine.filterAttributes = qtwebengine $QT_VERSION qtrefdoc
-qhp.QtWebEngine.customFilters.Qt.name = QtWebEngine $QT_VERSION
-qhp.QtWebEngine.customFilters.Qt.filterAttributes = qtwebengine $QT_VERSION
-
-qhp.QtWebEngine.subprojects = classes qmltypes examples
-
-qhp.QtWebEngine.subprojects.classes.title = C++ Classes and Namespaces
-qhp.QtWebEngine.subprojects.classes.indexTitle = Qt WebEngine C++ Classes and Namespaces
-qhp.QtWebEngine.subprojects.classes.selectors = class group:qtwebengine-namespaces doc:headerfile
-qhp.QtWebEngine.subprojects.classes.sortPages = true
-
-qhp.QtWebEngine.subprojects.qmltypes.title = QML Types
-qhp.QtWebEngine.subprojects.qmltypes.indexTitle = Qt WebEngine QML Types
-qhp.QtWebEngine.subprojects.qmltypes.selectors = qmltype
-qhp.QtWebEngine.subprojects.qmltypes.sortPages = true
-
-qhp.QtWebEngine.subprojects.examples.title = Examples
-qhp.QtWebEngine.subprojects.examples.indexTitle = Qt WebEngine Examples
-qhp.QtWebEngine.subprojects.examples.selectors = doc:example
-qhp.QtWebEngine.subprojects.examples.sortPages = true
-
-manifestmeta.highlighted.names += "QtWebEngine/WebEngine Widgets Simple Browser Example" \
- "QtWebEngine/WebEngine Quick Nano Browser"
-
-tagfile = ../../../doc/qtwebengine/qtwebengine.tags
-
-# Custom module header for clang that pulls in also QtWebEngineWidgets
-moduleheader = QtWebEngineDoc
-
-# Additional include paths for clang
-includepaths = -I .
-
-depends += qtcore \
- qtgui \
- qtlocation \
- qtnetwork \
- qtplatformheaders \
- qtprintsupport \
- qtpositioning \
- qtqml \
- qtquick \
- qtquickcontrols \
- qtdoc \
- qtwebchannel \
- qtwebview \
- qtwidgets
-
-headerdirs += .. \
- ../../core/api \
- ../../webenginewidgets/api
-
-sourcedirs += .. \
- ../../core/api \
- ../../core/doc \
- ../../webenginewidgets/api \
- ../../webenginewidgets/doc
-
-exampledirs += . \
- ../../../examples \
- snippets \
- ../../core/doc/snippets \
- ../../webenginewidgets/doc/snippets
-
-examples.fileextensions += *.aff *.dic *.html
-
-imagedirs += images
-
-navigation.landingpage = "Qt WebEngine"
-navigation.cppclassespage = "Qt WebEngine C++ Classes and Namespaces"
-navigation.qmltypespage = "Qt WebEngine QML Types"
-
-# \QWE macro expands to 'Qt WebEngine' without auto-linking anywhere.
-macro.QWE = "Qt \\WebEngine"
-
-Cpp.ignoretokens += Q_WEBENGINE_EXPORT Q_WEBENGINECORE_EXPORT QWEBENGINEWIDGETS_EXPORT
diff --git a/src/webengine/doc/snippets/qtwebengine_build_snippet.qdoc b/src/webengine/doc/snippets/qtwebengine_build_snippet.qdoc
deleted file mode 100644
index 35bc480bb..000000000
--- a/src/webengine/doc/snippets/qtwebengine_build_snippet.qdoc
+++ /dev/null
@@ -1,35 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//! [0]
-QT += webengine
-//! [0]
-
-
-//! [1]
-#include <QtWebEngine>
-//! [1]
diff --git a/src/webengine/doc/snippets/qtwebengine_webengineview_newviewrequested.qml b/src/webengine/doc/snippets/qtwebengine_webengineview_newviewrequested.qml
deleted file mode 100644
index e7e6790f2..000000000
--- a/src/webengine/doc/snippets/qtwebengine_webengineview_newviewrequested.qml
+++ /dev/null
@@ -1,84 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtQuick.Window 2.1
-import QtWebEngine 1.1
-
-//! [0]
-QtObject {
- id: windowParent
- // Create the initial browsing windows and open the startup page.
- Component.onCompleted: {
- var firstWindow = windowComponent.createObject(windowParent);
- firstWindow.webView.loadHtml('<input type="button" value="Click!" onclick="window.open(&quot;http://qt.io&quot;)">');
- }
-
- property Component windowComponent: Window {
- // Destroy on close to release the Window's QML resources.
- // Because it was created with a parent, it won't be garbage-collected.
- onClosing: destroy()
- visible: true
-
- property WebEngineView webView: webView_
- WebEngineView {
- id: webView_
- anchors.fill: parent
-
- // Handle the signal. Dynamically create the window and
- // use its WebEngineView as the destination of our request.
- onNewViewRequested: function(request) {
- var newWindow = windowComponent.createObject(windowParent);
- request.openIn(newWindow.webView);
- }
- }
- }
-}
-//! [0]
diff --git a/src/webengine/doc/src/external-resources.qdoc b/src/webengine/doc/src/external-resources.qdoc
deleted file mode 100644
index 7878ed9f8..000000000
--- a/src/webengine/doc/src/external-resources.qdoc
+++ /dev/null
@@ -1,146 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \externalpage http://www.chromium.org
- \title Chromium Project
-*/
-
-/*!
- \externalpage https://developers.google.com/web/tools/chrome-devtools
- \title Chrome DevTools
-*/
-
-/*!
- \externalpage https://developers.google.com/web/tools/javascript/console/console-write
- \title Chrome console API
-*/
-
-/*!
- \externalpage http://ffmpeg.org/
- \title FFmpeg
-*/
-
-/*!
- \externalpage http://www.openh264.org/
- \title OpenH264 Project Homepage
-*/
-
-/*!
- \externalpage http://html5demos.com/drag
- \title HTML5 Demos - Drag and Drop
-*/
-
-/*!
- \externalpage http://html5demos.com/drag-anything
- \title HTML5 Demos - Simple Drag and Drop
-*/
-
-/*!
- \externalpage http://html5demos.com/dnd-upload
- \title HTML5 Demos - Drag and Drop, Automatic Upload
-*/
-
-/*!
- \externalpage http://html5demos.com/file-api
- \title HTML5 Demos - File API
-*/
-
-/*!
- \externalpage http://www.widevine.com
- \title Widevine CDM
-*/
-
-/*!
- \externalpage http://demo.castlabs.com/
- \title castLabs
-*/
-
-/*!
- \externalpage http://ssdemo04.swankmp.net/
- \title Swank Motion Pictures, Inc.
-*/
-
-/*!
- \externalpage https://bitmovin.com/demos/drm
- \title Bitmovin Player
-*/
-
-/*!
- \externalpage https://sourceforge.net/projects/hunspell/
- \title Hunspell Project
-*/
-
-/*!
- \externalpage https://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1
- \title RFC 2616 section 19.5.1
-*/
-
-/*!
- \externalpage https://www.iana.org/assignments/uri-schemes/prov/view-source
- \title view-source URI scheme
-*/
-
-/*!
- \externalpage https://wiki.greasespot.net/Metadata_Block
- \title Greasemonkey
-*/
-
-/*!
- \externalpage https://http2.github.io/
- \title HTTP/2
-*/
-
-/*!
- \externalpage https://http2.akamai.com/demo
- \title Akamai HTTP/2 Demo
-*/
-
-/*!
- \externalpage https://www.chromium.org/developers/design-documents/user-scripts
- \title User Scripts
-*/
-
-/*!
- \externalpage https://wiki.greasespot.net/Metadata_Block#.40name
- \title Metadata Block
-*/
-
-/*!
- \externalpage https://developer.mozilla.org/en-US/docs/Web/API/Navigator/registerProtocolHandler
- \title registerProtocolHandler
-*/
-
-/*!
- \externalpage https://www.w3.org/TR/notifications
- \title Web Notifications API
-*/
-
-/*!
- \externalpage https://developers.google.com/web/updates/2017/09/autoplay-policy-changes
- \title Autoplay Policy Changes
-*/
diff --git a/src/webengine/doc/src/qtwebengine-debugging.qdoc b/src/webengine/doc/src/qtwebengine-debugging.qdoc
deleted file mode 100644
index 0db35c85c..000000000
--- a/src/webengine/doc/src/qtwebengine-debugging.qdoc
+++ /dev/null
@@ -1,117 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \page qtwebengine-debugging.html
- \title Qt WebEngine Debugging and Profiling
-
- \section1 Console Logging
-
- JavaScript executed inside \QWE can use the
- \l{Chrome console API} to log information to a console. The logging messages
- are forwarded to Qt's logging facilities inside a \c js
- \l{QLoggingCategory}{logging category}. However, only warning and fatal
- messages are printed by default. To change this, you either have to set custom
- rules for the \c js category, or provide custom message handlers
- by reimplementing \l{QWebEnginePage::javaScriptConsoleMessage()}, or
- connecting to \l{WebEngineView::javaScriptConsoleMessage()}.
-
- All messages can also be accessed through the \QWE developer
- tools.
-
- \section1 Qt WebEngine Developer Tools
-
- The \QWE module provides web developer tools that make it easy
- to inspect and debug layout and performance issues of any web content.
-
- The developer tools are accessed as a local web page using a Chromium or
- \QWE based browser, such as the Chrome browser.
-
- To activate the developer tools, start an application that uses \QWE
- with the command-line arguments:
-
- \badcode
- --remote-debugging-port=<port_number>
- \endcode
-
- Where \c <port_number> refers to a local network port. The web developer
- tools can then be accessed by launching a browser at the address
- \c http://localhost:<port_number>.
-
- Alternatively, the environment variable QTWEBENGINE_REMOTE_DEBUGGING
- can be set. It can be set as either just a port working similarly to
- \c --remote-debugging-port or given both a host address and a port. The
- latter can be used to control which network interface to export the
- interface on, so that you can access the developer tools from a remote
- device.
-
- For a detailed explanation of the capabilities of developer tools, see the
- \l {Chrome DevTools} page.
-
- \section1 Using Command-Line Arguments
-
- You can use the following command-line arguments while debugging to provide
- input for bug reports:
-
- \list
- \li \c {--disable-gpu} disables GPU hardware acceleration. This is
- useful when diagnosing OpenGL problems.
- \li \c {--disable-logging} disables console logging, which might be
- useful for debug builds.
- \li \c {--enable-logging --log-level=0} enables console logging and sets
- the logging level to 0, which means that messages of the severity
- \c info and above are recorded in the log. This is the default for
- debug builds. Other possible log levels are \c 1 for warnings, \c 2
- for errors, and \c 3 for fatal errors.
- \li \c {--v=1} Increases the logging level beyond what \c {--log-level}
- can, and enables logging debug messages up to verbosity level \c 1.
- A higher number further increases verbosity, but may result in a
- large number of logged messages. Default is \c 0 (no debug messages).
- \li \c {--no-sandbox} disables the sandbox for the renderer and plugin
- processes. Keep in mind that disabling the sandbox might present a
- security risk.
- \li \c {--single-process} runs the renderer and plugins in the same
- process as the browser. This is useful for getting stack traces for
- renderer crashes.
- \li \c {--enable-features=NetworkServiceInProcess} runs networking in
- the main process. This may help firewall management, since only the
- application executable will need to be whitelisted and
- not QtWebEngineProcess. It means losing the security of
- sandboxing of the network service though.
- \endlist
-
- Alternatively, the environment variable QTWEBENGINE_CHROMIUM_FLAGS can be
- set. For example, the following value could be set to disable logging while
- debugging an application called \e mybrowser:
-
- \code
- QTWEBENGINE_CHROMIUM_FLAGS="--disable-logging" mybrowser
- \endcode
-
- QTWEBENGINE_CHROMIUM_FLAGS can also be set using {qputenv} from within the
- application if called before QtWebEngine::initialize().
-*/
diff --git a/src/webengine/doc/src/qtwebengine-deploying.qdoc b/src/webengine/doc/src/qtwebengine-deploying.qdoc
deleted file mode 100644
index 7b9f3fd4a..000000000
--- a/src/webengine/doc/src/qtwebengine-deploying.qdoc
+++ /dev/null
@@ -1,158 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \page qtwebengine-deploying.html
- \title Deploying Qt WebEngine Applications
-
- The way to package and deploy applications varies between operating systems.
- For Windows and \macos, \l{The Windows Deployment Tool}{windeployqt} and
- \l{Deploying Applications on macOS}{macdeployqt} automate the steps to
- generate a stand-alone application package.
-
- When manually deploying applications that depend on \QWE, all the
- files that are required to run the application have to be included:
- libraries, QML imports, plugins, and translations.
-
- For more information, see \l {Deploying Qt Applications}.
-
- \section1 Target Platforms
-
- \QWE does try to support all \l{Supported Platforms} of Qt. However,
- due to different requirements of Chromium this is not always possible. Known
- limitations are:
-
- \list
- \li \QWE currently supports only Windows, Linux, and \macos.
-
- \li On Windows, \QWE only supports Windows Vista or newer as
- target platform. Due to use of newer API in Chromium, Windows XP is
- not supported. WinRT is not supported, either.
- \endlist
-
- \section1 Deploying Applications Manually
-
- When manually deploying applications that depend on \QWE, the
- following files might have to be deployed:
-
- \list
- \li Libraries
- \li QML imports
- \li \QWE process
- \li Resources
- \li Translations
- \li Audio and video codecs
- \endlist
-
- \section2 Deploying Libraries
-
- The following libraries must be deployed with applications that depend on
- \QWE:
-
- \list
- \li QtWebEngineCore library
- \li QtWebEngineWidgets or QtWebEngine libraries, depending on
- application type
- \endlist
-
- \section2 Deploying QML Imports
-
- If Qt Quick integration is used in the application, the QtWebEngine import
- directory needs to be deployed.
-
- \section2 Deploying \QWE Processes
-
- \QWE takes advantage of the multi-process model that the Chromium
- project offers. The multi-process model requires that the \QWE
- Process executable be deployed alongside your application.
-
- The WebEngine process is executed for each QWebEngineView or WebEngineView
- instance. For example, a browser application
- with two tabs open should have two separate instances of the process
- running. This is a common approach used by most modern web engines to
- provide a stable browsing experience.
-
- At runtime, \QWE looks for the \c QtWebEngineProcess executable in
- the directory that
- QLibraryInfo::location(QLibraryInfo::LibraryExecutablesPath) returns.
- For Qt installations, this is \c QTDIR/libexec (Linux) or \c QTDIR\bin
- (Windows). The path can be changed by defining a \c qt.conf file, for
- example. Alternatively, an executable path can be set as a value of the
- \c QTWEBENGINEPROCESS_PATH environment variable. On \macos, \QWE
- looks for the executable in \c .app/Helpers/QtWebEngineProcess.
-
- \section2 Deploying Resources
-
- \QWE requires the following resource files:
-
- \list
- \li \c qtwebengine_resources.pak contains the resources needed by
- Chromium.
- \li \c qtwebengine_devtools_resources.pak contains tools for remote
- debugging.
- \li \c qtwebengine_resources_100p.pak contains images suitable for low
- resolution displays.
- \li \c qtwebengine_resources_200p.pak contains images suitable for high
- DPI displays.
- \li \c icudtl.dat provides support for International Components for
- Unicode (ICU). It is the Chromium version of ICU, which is not
- needed if \QWE was configured to use the system ICU.
- \endlist
-
- Resources are searched from the following locations:
-
- \list
- \li On Linux and Windows: the \c resources directory in the directory
- specified by QLibraryInfo::location(QLibraryInfo::DataPath)
- \li On \macos: \c .app/Content/Resources
- \endlist
-
- \section2 Translations
-
- Locale data (such as \c en-US.pak) is searched form the following locations:
-
- \list
- \li On \macos: \c .app/Content/Resources
- \li On Linux and Windows: \c qtwebengine_locales directory in the
- directory specified by
- QLibraryInfo::location(QLibraryInfo::TranslationsPath)
- \endlist
-
- \section2 JavaScript Files in Qt Resource Files
-
- If your WebEngine application is built using the Qt Quick Compiler, and the application ships
- JavaScript files inside .qrc resources, and these files are supposed to be loaded from inside
- HTML pages, make sure to specify the resource files in a \c QTQUICK_COMPILER_SKIPPED_RESOURCES
- qmake variable inside your project. This prevents the Qt Quick Compiler from trying to generate
- C++ code for the corresponding JavaScript code, as well as removing the original JavaScript code
- from the Qt resources file, which would lead to broken HTML pages. For example:
-
- \code
- QTQUICK_COMPILER_SKIPPED_RESOURCES += resources/my_resource.qrc
- \endcode
-
-*/
diff --git a/src/webengine/doc/src/qtwebengine-examples.qdoc b/src/webengine/doc/src/qtwebengine-examples.qdoc
deleted file mode 100644
index d31895078..000000000
--- a/src/webengine/doc/src/qtwebengine-examples.qdoc
+++ /dev/null
@@ -1,40 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \group webengine-examples
- \title Qt WebEngine Examples
- \brief Examples demonstrating the \QWE usage.
- \ingroup all-examples
-
- These examples and demonstrations show a range of different uses for \l{Qt WebEngine},
- from displaying Web pages within a QML user interface to an implementation of
- a basic function Web browser.
-
- For widget-based applications, Qt provides an integrated Web browser component based on
- Chromium, the popular open source browser engine.
-*/
diff --git a/src/webengine/doc/src/qtwebengine-features.qdoc b/src/webengine/doc/src/qtwebengine-features.qdoc
deleted file mode 100644
index 431367765..000000000
--- a/src/webengine/doc/src/qtwebengine-features.qdoc
+++ /dev/null
@@ -1,644 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \page qtwebengine-features.html
- \title Qt WebEngine Features
-
- \brief Summarizes \QWE features.
-
- \QWE supports the following features:
-
- \list
- \li \l{Audio and Video Codecs}
- \li \l{Chromium DevTools}
- \li \l{Client Certificates}
- \li \l{Custom Schemes}
- \li \l{Drag and Drop}
- \li \l{Fullscreen}
- \li \l{HTML5 DRM}
- \li \l{HTML5 Geolocation}
- \li \l{HTTP/2 Protocol}
- \li \l{Native Dialogs}
- \li \l{Pepper Plugin API}
- \li \l{PDF File Viewing}
- \li \l{Page Lifecycle API}
- \li \l{Print to PDF}
- \li \l{Process Models}
- \li \l{Spellchecker}
- \li \l{Touch}
- \li \l{View Source}
- \li \l{webrtc_feature}{WebRTC}
- \li \l{Web Notifications}
- \endlist
-
- \section1 Audio and Video Codecs
-
- \QWE supports the MPEG-4 Part 14 (MP4) file format only if the
- required proprietary audio and video codecs, such as H.264 and MPEG layer-3
- (MP3), have been enabled. Proprietary codecs can be enabled by passing the
- following option to the \c configure tool when configuring Qt:
-
- \code
- -webengine-proprietary-codecs
- \endcode
-
- For example, the following option could be passed when configuring Qt for
- building it at the top level:
-
- \code
- configure -webengine-proprietary-codecs
- \endcode
-
- For more information, see \l{Qt Configure Options}.
-
- When using qmake to build just the \QWE module, the following
- command can be used (in this example, the \QWE source code is
- located in \c {C:\qt\qtwebengine}):
-
- \code
- qmake C:\qt\qtwebengine -- -webengine-proprietary-codecs
- \endcode
-
- \warning When distributing proprietary codec libraries, you must acquire
- licenses for them.
-
- \l FFmpeg is a cross-platform solution to record, convert, and stream audio
- and video. It can be configured for use with several codecs, which rises
- licensing issues during distribution with the codec libraries. For some
- codecs, open source implementations, such as \l{OpenH264 Project Homepage}
- {OpenH264}, are available.
-
- \section1 Chromium DevTools
-
- The Chromium DevTools provide the ability to inspect and debug layout and
- performance issues of any web content.
-
- This feature can be tested by launching a \QWE application with the
- command line option \c {--remote-debugging-port=[your-port]} or by setting
- the environment variable \c QTWEBENGINE_REMOTE_DEBUGGING, and then using a
- Chromium based browser (such as \l{WebEngine Widgets Simple Browser Example}
- {Simple Browser} or \l{WebEngine Quick Nano Browser}{Nano Browser}) to connect
- to \c {http://localhost:[your-port]}.
-
- The Chromium DevTools page can also be shown within the application. To set
- this up, you can call either QWebEnginePage::setInspectedPage() to the page
- to be inspected, which implicitly loads the DevTools into the \c this page,
- or QWebEnginePage::setDevToolsPage() to let the \c this page be inspected.
-
- The respective QML properties are \l{WebEngineView::devToolsView}
- {WebEngineView.devToolsView} and \l{WebEngineView::inspectedView}
- {WebEngineView.inspectedView}.
-
- For more information, see \l {Qt WebEngine Debugging and Profiling}.
-
- \section1 Client Certificates
-
- Some web servers, in particular many intranet sites, require the client to
- authenticate itself with a certificate, called a \e {client certificate}. \QWE
- will read the client certificates installed in the system settings in macOS and
- Windows, and on Linux those installed into the NSS database. Certificates can
- be installed into the NSS database using the \c pk12util tool.
-
- By default, \QWE will not offer any client certificates to servers, as doing
- so uniquely identifies the user and might violate privacy expectations.
-
- To activate support for client certificates, an application needs to listen to
- the QWebEnginePage::selectClientCertificate or
- \l{WebEngineView::selectClientCertificate}{WebEngineView.selectClientCertificate}
- signals and select one of the offered
- certificates. For applications that can navigate to untrusted web sites, it is
- recommended to always give the user a choice before uniquely identifying them
- to a remote server.
-
- \section1 Custom Schemes
-
- \QWE makes it possible for the application to define its own custom
- URL schemes with specialized security policies and transport mechanisms.
-
- Custom schemes can be used to implement alternative network protocols with
- all the usual web security policies, privileged internal schemes for
- displaying user interface compoments or debugging information, sandboxed
- schemes with extra restrictions, and so on.
-
- For more information, see \l QWebEngineUrlScheme and \l
- QWebEngineUrlSchemeHandler.
-
- \section1 Drag and Drop
-
- \QWE supports HTML5 drag and drop.
-
- This feature can be tested by opening an HTML5 drag and drop demo, such as
- \l{HTML5 Demos - Drag and Drop}, \l{HTML5 Demos - Simple Drag and Drop}, or
- \l{HTML5 Demos - Drag and Drop, Automatic Upload}, in \l{WebEngine Widgets
- Simple Browser Example}{Simple Browser} or \l{WebEngine Quick Nano Browser}
- {Nano Browser}.
-
- Dragging files into the browser is not actually part of HTML5, but it is
- supported. It can be tested by opening \l{HTML5 Demos - File API}.
-
- Support for this feature was added in Qt 5.7.0.
-
- \section1 Fullscreen
-
- \QWE supports viewing web content in fullscreen mode. For more
- information, see \l{WebEngineSettings::fullscreenSupportEnabled}
- {WebEngineSettings.fullscreenSupportEnabled},
- \l{WebEngineView::fullScreenRequested}{WebEngineView.fullScreenRequested},
- QWebEngineSettings::FullScreenSupportEnabled, and
- QWebEnginePage::fullScreenRequested.
-
- This feature can be tested by playing a video from YouTube in \l{WebEngine
- Widgets Video Player Example}{Video Player} or \l{WebEngine Quick Nano Browser}
- {Nano Browser}, and clicking the full screen icon to go into fullscreen
- mode.
-
- Support for this feature was added in Qt 5.6.0.
-
- \section1 HTML5 DRM
-
- \QWE supports viewing DRM protected videos if the \l{Widevine CDM} plugin has been installed.
- CDM plugin is a replacement of Flash based plugins for displaying DRM-protected content.
- It comes only in a binary format, so it can hide DRM decryption implementation details.
- It can be obtained from a third party or from a Google Chrome installation.
-
- \QWE on startup looks for the \l{Widevine CDM} plugin in well know locations, like
- default Google Chrome installation directory or Linux distro specific paths. However, plugin
- location can be also passed with \c {QTWEBENGINE_CHROMIUM_FLAGS} using \c {widevine-path}.
-
- On Windows:
- \code
- set QTWEBENGINE_CHROMIUM_FLAGS=--widevine-path="C:/some path/widevinecdm.dll"
- \endcode
-
- On Linux:
- \code
- export QTWEBENGINE_CHROMIUM_FLAGS=--widevine-path="/some path/libwidevinecdm.so"
- \endcode
-
- On macOS:
- \code
- export QTWEBENGINE_CHROMIUM_FLAGS=--widevine-path="/some path/libwidevinecdm.dylib"
- \endcode
-
-
- The video format most commonly used by DRM services, H.264, requires
- proprietary audio and video codecs. For more information about enabling the
- codecs, see \l{Audio and Video Codecs}.
-
- This feature can be tested by playing a video in \l{WebEngine Widgets Simple Browser
- Example}{Simple Browser} or \l{WebEngine Quick Nano Browser}{Nano Browser}
- from \l{castLabs}, \l{Swank Motion Pictures, Inc.}, or \l{Bitmovin Player}.
-
- Support for this feature was added in Qt 5.7.0.
-
- \section1 HTML5 Geolocation
-
- \QWE supports JavaScript Geolocation API with \l {Qt Location} as a
- backend. The application has to explicitly allow the feature by using
- QWebEnginePage::Geolocation or \l{WebEngineView::Feature}
- {WebEngineView.Feature}.
-
- If Qt Location has been built before \QWE then this feature can be
- tested by using \l{WebEngine Widgets Maps Example}{Maps} and allowing it to
- find the current position of the user. Note that on Windows an external GPS
- receiver must be connected to the application. For more information, see
- \l{Qt Positioning}.
-
- Support for this feature was added in Qt 5.5.0.
-
- \section1 HTTP/2 Protocol
-
- \QWE supports the Chromium implementation of the \l{HTTP/2}
- protocol.
-
- This feature can be tested by opening an HTTP/2 demo, such as the
- \l{Akamai HTTP/2 Demo}, in \l{WebEngine Widgets Simple Browser Example}
- {Simple Browser} or \l{WebEngine Quick Nano Browser}{Nano Browser}.
-
- \section1 Native Dialogs
-
- A web page might request dialogs for the following functions:
-
- \list
- \li Entering user credentials for HTTP and proxy authentication
- \li Displaying JavaScript alerts, confirmation dialogs, and prompts
- \li Picking colors
- \li Selecting files
- \li Displaying form validation messages
- \endlist
-
- \QWE provides standard dialogs for these functions. In widget-based
- applications, the standard dialogs are based on QDialog, whereas in Qt Quick
- applications, they can be based either on Qt Quick Controls 1 or Qt Quick
- Controls 2 (since Qt 5.8). The latter are used only on \c eglfs platforms.
-
- To explicitly force either dialogs based on Qt Quick Controls 1 or Qt Quick
- Controls 2, set the \c QTWEBENGINE_DIALOG_SET environment variable to either
- \c{QtQuickControls1} or \c{QtQuickControls2}.
-
- \QWE Widgets dialogs can be customized by reimplementing the
- QWebEnginePage::chooseFiles(), QWebEnginePage::javaScriptAlert(),
- QWebEnginePage::javaScriptConfirm(), and QWebEnginePage::javaScriptPrompt()
- functions.
-
- Since Qt 5.8, Qt Quick dialogs can be customized by connecting to the
- WebEngineView::authenticationDialogRequested(),
- WebEngineView::javaScriptDialogRequested(),
- WebEngineView::colorDialogRequested(),
- WebEngineView::fileDialogRequested(), and
- WebEngineView::formValidationMessageRequested() signals. For an example,
- see \l{WebEngine Qt Quick Custom Dialogs Example}.
-
- \section1 Pepper Plugin API
-
- \QWE supports loading Pepper Plugin API (PPAPI) plugins if
- WebEngineSettings::pluginsEnabled or QWebEngineSettings::PluginsEnabled
- is set.
-
- Except for the Adobe Flash Player plugin, the plugins must be loaded
- manually using the Chromium command line syntax with the
- \c --register-pepper-plugins argument. The argument value is a list of
- entries, separated by commas, that contain the file path and one or several
- MIME types, separated by semicolons:
-
- \code
- <file-path-plugin1>;<mime-type-plugin1>,<file-path-plugin2>;<mime-type1-plugin2>;<mime-type2-plugin2>
- \endcode
-
- For example:
-
- \code
- --register-pepper-plugins="libppapi_example.so;application/x-ppapi-example"
- \endcode
-
- The MIME type is important because it determines which embeds the plugin is
- used for.
-
- Support for this feature was added in Qt 5.6.0.
-
- \section2 Pepper Flash Player Plugin Support
-
- The Pepper Flash player plugin can be loaded automatically if it is
- installed in one of the following locations, depending on the platform:
-
- \list
- \li Windows
- \code
- C:\Windows\SysWOW64\Macromed\Flash\pepflashplayer*.dll
- C:\Windows\System32\Macromed\Flash\pepflashplayer*.dll
- \endcode
- \li OS X
- \code
- /Library/Internet Plug-Ins/PepperFlashPlayer/PepperFlashPlayer.plugin
- \endcode
- \li Linux
- \code
- /usr/lib/pepperflashplugin-nonfree/libpepflashplayer.so
- /usr/lib/adobe-flashplugin/libpepflashplayer.so
- /usr/lib/PepperFlash/libpepflashplayer.so
- /usr/lib64/chromium/PepperFlash/libpepflashplayer.so
- \endcode
- \endlist
-
- You can also load the Pepper Flash player from a specific location by using
- command line arguments:
-
- \code
- --ppapi-flash-path=./libpepflashplayer.so
- \endcode
-
- By default, the Flash version is set to \c{11.2.999.999}. You can use the
- \c{ppapi-flash-version=} argument to set another Flash version in the
- format \c{major.minor.build.revision}:
-
- \code
- --ppapi-flash-version=16.0.0.235
- \endcode
-
- This feature can be tested in \l{WebEngine Widgets Simple Browser Example}{Simple Browser}
- or \l{WebEngine Quick Nano Browser}{Nano Browser} if the Adobe Flash PPAPI
- plugin is installed and plugins are enabled in the browser. To test the
- feature, the \c https://helpx.adobe.com/flash-player.html page can be opened
- in the browser.
-
- \section1 PDF File Viewing
-
- \QWE supports viewing PDF documents by navigating to them. This feature uses the Chromium
- extensions API and PDF viewer plugin to display the PDF documents.
- It can be tested in \l{WebEngine Widgets Simple Browser Example}{Simple Browser} or
- \l{WebEngine Quick Nano Browser}{Nano Browser}.
-
- Loading plugins needs to be enabled using QWebEngineSettings::PluginsEnabled or
- WebEngineSettings::pluginsEnabled in order to use this feature.
-
- This feature can be turned on (default) or off via the QWebEngineSettings::PdfViewerEnabled or
- WebEngineSettings::pdfViewerEnabled setting.
-
- Support for this feature was added in Qt 5.13.0.
-
- \section1 Page Lifecycle API
-
- \QWE supports the \l {https://wicg.github.io/page-lifecycle/spec.html}{Page
- Lifecycle API specification}, a work-in-progress extension to the HTML
- standard for allowing user agents to reduce their resource consumption by
- freezing or discarding background pages. The feature is exposed both in the
- Widgets and QML APIs.
-
- For an example of the QML API in use, see the \l {WebEngine Lifecycle
- Example}.
-
- Support for this feature was added in Qt 5.14.0.
-
- \section2 Overview of Lifecycle States
-
- Each \l {WebEngineView} item (or \l {QWebEnginePage} object) can be in one
- of three \e {lifecycle states}: active, frozen, or discarded. These states,
- like the sleep states of a CPU, control the resource usage of web views.
-
- The \e {active} state is the normal, unrestricted state of a web view. All
- visible web views are always in the active state, as are all web views that
- have not yet finished loading. Only invisible, idle web views can be
- transitioned to other lifecycle states.
-
- The \e {frozen} state is a low CPU usage state. In this state, most HTML
- task sources are suspended (frozen) and, as a result, most DOM event
- processing and JavaScript execution will also be suspended. The web view
- must be invisible in order to be frozen as rendering is not possible in this
- state.
-
- The \e {discarded} state is an extreme resource-saving state. In this state,
- the browsing context of the web view will be discarded and the corresponding
- renderer subprocess shut down. CPU and memory usage in this state is reduced
- virtually to zero. On exiting this state the web page will be automatically
- reloaded. The process of entering and exiting the discarded state is similar
- to serializing the browsing history of the web view and destroying the view,
- then creating a new view and restoring its history.
-
- See also \l {WebEngineView::LifecycleState}. The equivalent in the Widgets
- API is \l {QWebEnginePage::LifecycleState}.
-
- \section2 The \c {lifecycleState} and \c {recommendedState} Properties
-
- The \l {WebEngineView::}{lifecycleState} property of the \l {WebEngineView}
- type is a read-write property that controls the current lifecycle state of
- the web view. This property is designed to place as few restrictions as
- possible on what states can be transitioned to. For example, it is allowed
- to freeze a web view that is currently playing music in the background,
- stopping the music. In order to implement a less aggressive resource-saving
- strategy that avoids interrupting user-visible background activity, the \l
- {WebEngineView::} {recommendedState} property must be used.
-
- The \l {WebEngineView::}{recommendedState} property of the \l
- {WebEngineView} type is a read-only property that calculates a safe limit on
- the \l {WebEngineView::}{lifecycleState} property, taking into account the
- current activity of the web view. So, in the example of a web view playing
- music in the background, the recommended state will be \c {Active} since a
- more aggressive state would stop the music. If the application wants to
- avoid interrupting background activity, then it should avoid putting the web
- view into a more aggressively resource-saving lifecycle state than what's
- given by \l {WebEngineView::}{recommendedState}.
-
- See also \l {WebEngineView::lifecycleState} and \l
- {WebEngineView::recommendedState}. The equivalents in the Widgets API are \l
- {QWebEnginePage::lifecycleState} and \l {QWebEnginePage::recommendedState}.
-
- \section2 The DOM Extensions
-
- The \l {WebEngineView::}{lifecycleState} property is connected to the \l
- {https://wicg.github.io/page-lifecycle/spec.html}{Page Lifecycle API
- specification}, which specifies two new DOM events, \c {freeze} and \c
- {resume}, and adds a new \c {Document.wasDiscarded} boolean property. The \c
- {freeze} and \c {resume} events are fired when transitioning from the \c
- {Active} to the \c {Frozen state}, and vice-versa. The \c
- {Document.wasDiscarded} property is set to \c {true} when transitioning from
- the \c {Discarded} state to the \c {Active} state.
-
- \section1 Print to PDF
-
- \QWE supports printing a web page to a PDF file. For more
- information, see QWebEnginePage::printToPdf() and
- \l{WebEngineView::printToPdf}{WebEngineView.printToPdf}.
-
- This feature can be tested using \l{WebEngine Widgets Html2Pdf Example}
- {Html2Pdf}.
-
- Support for this feature was added in Qt 5.7.0.
-
- \section1 Process Models
-
- \QWE uses multiple OS processes to isolate web sites from each other
- and from the client application, improving security and robustness. The
- following process models, or ways to divide web sites between OS processes,
- are supported:
-
- \list
- \li \l{Process per Site Instance}
- \li \l{Process per Site}
- \li \l{Single Process}
- \endlist
-
- \section2 Process per Site Instance
-
- This is the default model. Pages from separate sites are put into separate
- processes and separate visits to the same site are also isolated.
-
- Two web pages are considered as belonging to the same site if they originate
- from the same registered domain name (for example, \c wikipedia.org) and
- scheme (for example, \c https). This is similar to the same-origin policy
- but subdomains are ignored. For example, both \c{https://en.wikipedia.org/}
- and \c{https://de.wikipedia.org/} would belong to the same site.
-
- A site instance is a collection of web pages belonging to the same site.
- When the application explicitly loads a URL into \QWE (via \l
- QWebEnginePage::setUrl, for example), a new site instance is created for the
- page. However, when the user clicks same-site links on the page, the
- existing site instance is merely extended with more pages.
-
- For instance, in the \l{WebEngine Widgets Simple Browser Example}{Simple
- Browser} example, when a user opens two tabs and explicitly enters
- \c{https://en.wikipedia.org/} into the URL bars, both tabs will have their
- own separate OS processes (because explicitly entering a URL creates a new
- site instance). However, when the user then middle-clicks some same-site
- links to open more tabs, these new tabs will share the same OS process
- (because user interaction extends the existing site instance).
-
- \section2 Process per Site
-
- Pages from separate sites are put into separate processes. Unlike Process
- per Site Instance, all visits to the same site will share an OS process.
-
- The benefit of this model is reduced memory consumption, because more web
- pages will share processes. The drawbacks include reduced security,
- robustness, and responsiveness.
-
- To enable this model, use the command-line argument \c{--process-per-site}.
- See \l{Using Command-Line Arguments}.
-
- \section2 Single Process
-
- For debugging purposes only, a single process mode can be enabled using the
- command-line argument \c{--single-process}. See \l{Using Command-Line
- Arguments} and \l{Qt WebEngine Debugging and Profiling}.
-
- \section1 Spellchecker
-
- \QWE supports integrating spellchecking support into HTML forms to
- enable users to submit spellchecked messages. When the user clicks on
- an underlined misspelled word, the default context menu displays up to four
- suggestions. Selecting one will replace the misspelled word.
-
- To be able to check the spelling, the spellchecker needs dictionaries. It
- supports dictionaries from the \l{Hunspell project}, but they have to be
- compiled into a special binary format. A Hunspell dictionary consists of two
- files:
-
- \list
-
- \li A \c .dic file that is a dictionary containing words for the
- language
- \li An \c .aff file that defines the meaning of special flags in the
- dictionary
- \endlist
-
- These two files can be converted into the \c bdic format by using the
- \c qwebengine_convert_dict tool that is shipped together with Qt.
- When the \QWE spellchecker initializes, it will try to load the
- \c bdict dictionaries and to check them for consistency.
-
- If \c QTWEBENGINE_DICTIONARIES_PATH is set, the spellchecker uses the
- dictionaries in the specified directory without looking anywere else.
- Otherwise, it uses the \e qtwebengine_dictionaries directory relative to the
- executable if it exists. If it does not exist, it will look in \c
- QT_INSTALL_PREFIX/qtwebengine_dictionaries.
-
- On macOS, depending on how \QWE is configured at build time, there
- are two possibilities how spellchecking data is found:
-
- \list
- \li Hunspell dictionaries (default) - .bdic dictionaries are used, just
- like on other platforms
- \li Native dictionaries - the macOS spellchecking APIs are used (which
- means the results will depend on the installed OS dictionaries)
- \endlist
-
- Thus, in the macOS Hunspell case, \QWE will look in the \e
- qtwebengine_dictionaries subdirectory located inside the application bundle
- \c Resources directory, and also in the \c Resources directory located
- inside the Qt framework bundle.
-
- To summarize, in case of Hunspell usage, the following paths are considered:
-
- \list
- \li \c QTWEBENGINE_DICTIONARIES_PATH, if set
- \li QCoreApplication::applicationDirPath()/qtwebengine_dictionaries
- or QCoreApplication::applicationDirPath()/../Contents/Resources/qtwebengine_dictionaries
- (on macOS)
- \li [QLibraryInfo::DataPath]/qtwebengine_dictionaries
- or path/to/QtWebEngineCore.framework/Resources/qtwebengine_dictionaries (Qt framework
- bundle on macOS)
- \endlist
-
- Spellchecking is disabled by default and can be enabled per profile by
- using the QWebEngineProfile::setSpellCheckEnabled() method in widget-based
- applications and the \l {QQuickWebEngineProfile::spellCheckEnabled}
- {WebEngineProfile.spellCheckEnabled} property in Qt Quick applications.
-
- The current language used for spellchecking is defined per profile, and can
- be set using the QWebEngineProfile::setSpellCheckLanguages() method or the
- \l {QQuickWebEngineProfile::spellCheckLanguages}
- {WebEngineProfile.spellCheckLanguages} property.
-
- This feature can be tested by building and running the
- \l{WebEngine Widgets Spellchecker Example}{Spellchecker Example}.
-
- Support for this feature was added in Qt 5.8.0.
-
- \section1 Touch
-
- \QWE supports touch devices for navigating and interacting with web pages.
-
- Applications can prohibit the use of touch events in the following ways:
-
- \list
- \li Passing the flag \c --touch-events=disabled on the command line will disable touch event
- support in JavaScript API (meaning \c ontouchstart and related handlers will not be present
- in the \c document.window object). Touch events will still be delivered to web pages.
-
- \li Installing an event filter object using \l {QObject::installEventFilter} on the WebEngine
- view focus proxy object, and filtering out all touch events.
-
- \endlist
-
- \section1 View Source
-
- \QWE supports viewing the HTML source of a web page.
-
- This feature can be used from custom menus or assigned to custom events.
- For more information, see WebEngineView::WebAction, and QWebEnginePage::WebAction.
-
- This feature can be tested by opening a web page in \l{WebEngine Widgets
- Simple Browser Example}{Simple Browser} or \l{WebEngine Quick Nano Browser}
- {Nano Browser}, and then selecting \c{Page Source} in the context menu. The
- \c{Page Source} context menu entry opens the source view in a new tab.
-
- For opening the source view in the current tab, URLs with \l{view-source URI scheme}
- are also supported. For example, you can type the following URL to the URL bar
- to view the HTML source of the qt.io web page:
- \code
- view-source:https://www.qt.io/
- \endcode
-
- Auto-completion of incomplete URLs with \l{view-source URI scheme} makes the usage of
- this feature more comfortable. For example, the following incomplete URL also loads
- the source view of the qt.io web page:
- \code
- view-source:qt.io
- \endcode
-
- Support for this feature was added in Qt 5.8.0.
-
- \target webrtc_feature
- \section1 WebRTC
-
- WebRTC provides browsers with Real-Time Communications (RTC) capabilities
- via simple APIs. For more information, see \l{WebEngineView::Feature}
- {WebEngineView.Feature} and QWebEnginePage::Feature.
-
- This feature can be tested by setting up a webcam or microphone and then
- opening \c https://test.webrtc.org/ in \l{WebEngine Widgets Simple Browser
- Example}{Simple Browser} or \l{WebEngine Quick Nano Browser}{Nano Browser}.
-
- \section1 Web Notifications
-
- Qt WebEngine supports JavaScript \l{Web Notifications API}.
- The application has to explicitly allow the feature by using
- QWebEnginePage::Notifications or \l{WebEngineView::Feature}
- {WebEngineView.Notifications}.
-
- Support for this feature was added in Qt 5.13.0.
-*/
diff --git a/src/webengine/doc/src/qtwebengine-index.qdoc b/src/webengine/doc/src/qtwebengine-index.qdoc
deleted file mode 100644
index f668cf87b..000000000
--- a/src/webengine/doc/src/qtwebengine-index.qdoc
+++ /dev/null
@@ -1,65 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \page qtwebengine-index.html
- \title Qt WebEngine
-
- \brief Provides functionality for rendering regions of dynamic web content.
-
- \QWE provides functionality for rendering regions of dynamic web content.
-
- The functionality in \QWE is divided into the following modules:
-
- \annotatedlist qtwebengine-modules
-
- \section1 Articles and Guides
-
- \list
- \li \l{Qt WebEngine Overview}
- \li \l{Qt WebEngine Features}
- \li \l{Qt WebEngine Platform Notes}
- \li \l{Qt WebEngine Licensing}
- \li \l{Qt WebEngine Debugging and Profiling}
- \li \l{Deploying Qt WebEngine Applications}
- \li \l{Porting from Qt WebKit to Qt WebEngine}
- \endlist
-
- \section1 Examples
-
- \list
- \li \l{Qt WebEngine Examples}
- \li \l{Qt WebEngine Widgets Examples}
- \endlist
-
- \section1 API References
-
- \list
- \li \l{Qt WebEngine C++ Classes and Namespaces}
- \li \l{Qt WebEngine QML Types}
- \endlist
-*/
diff --git a/src/webengine/doc/src/qtwebengine-module.qdoc b/src/webengine/doc/src/qtwebengine-module.qdoc
deleted file mode 100644
index 5554bd519..000000000
--- a/src/webengine/doc/src/qtwebengine-module.qdoc
+++ /dev/null
@@ -1,46 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \module QtWebEngine
- \title Qt WebEngine C++ Classes
- \brief Exposes C++ functionality to Qt Quick.
- \ingroup modules
-
- The \QWE module exposes C++ functionality to Qt Quick.
-
- To include the definitions of the module's classes, use the
- following directive:
-
- \snippet qtwebengine_build_snippet.qdoc 1
-
- \if !defined(qtforpython)
- To link against the module, add the following to your qmake project file:
-
- \snippet qtwebengine_build_snippet.qdoc 0
- \endif
-*/
diff --git a/src/webengine/doc/src/qtwebengine-modules.qdoc b/src/webengine/doc/src/qtwebengine-modules.qdoc
deleted file mode 100644
index 7b8ced728..000000000
--- a/src/webengine/doc/src/qtwebengine-modules.qdoc
+++ /dev/null
@@ -1,48 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \page qtwebengine-modules.html
- \title Qt WebEngine C++ Classes and Namespaces
- \brief Provides functionality for rendering regions of dynamic web content.
-
- \e {Qt WebEngine} provides functionality for rendering regions of dynamic web content.
-
- \section1 Namespaces
- \annotatedlist qtwebengine-namespaces
-
- \section1 Classes
-
- \section2 Qt WebEngineCore Module
- \generatelist {classesbymodule QtWebEngineCore}
-
- \section2 Qt WebEngineWidgets Module
- \generatelist {classesbymodule QtWebEngineWidgets}
-
- \section2 Qt WebEngine Module
- \generatelist {classesbymodule QtWebEngine}
-*/
diff --git a/src/webengine/doc/src/qtwebengine-overview.qdoc b/src/webengine/doc/src/qtwebengine-overview.qdoc
deleted file mode 100644
index 1c30f9858..000000000
--- a/src/webengine/doc/src/qtwebengine-overview.qdoc
+++ /dev/null
@@ -1,315 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \page qtwebengine-overview.html
- \title Qt WebEngine Overview
-
- The \QWE module provides a web browser engine that makes it easy to embed content from
- the World Wide Web into your Qt application on platforms that do not have a native web engine.
-
- \QWE provides C++ classes and QML types for rendering HTML, XHTML, and SVG documents,
- styled using Cascading Style Sheets (CSS) and scripted with JavaScript. HTML documents can be
- made fully editable by the user through the use of the \c{contenteditable} attribute on HTML
- elements.
-
- \section1 Qt WebEngine Architecture
-
- \image qtwebengine-architecture.png
-
- The functionality in \QWE is divided into the following modules:
-
- \list
- \li \l{Qt WebEngine Widgets Module} for creating widget-based web applications
- \li \l{Qt WebEngine Module} for creating Qt Quick based web applications
- \li \l{Qt WebEngine Core Module} for interacting with Chromium
- \endlist
-
- Page rendering and JavaScript execution are separated from the GUI process into the \QWE
- Process. It is a library that must be shipped with the application if the Qt libraries are
- bundled into the application.
-
- \section2 Qt WebEngine Widgets Module
-
- \image qtwebenginewidgets-model.png
-
- A \e {web engine view} is the main widget component of the \QWE module. It can be used
- in various applications to load web content. Within a view, a \e {web engine page} holds a main
- frame that is responsible for web content, the \e history of navigated links, and \e actions.
- The view and page are quite similar, as they provide a set of common functions.
-
- All pages belong to a \e {web engine profile} that contains shared \e settings, \e scripts, and
- \e cookies. Profiles can be used to isolate pages from each other. A typical use case is a
- dedicated profile for a \e {private browsing} mode, where no information is permanently saved.
-
- \note The \QWE Widgets module uses the \l{Qt Quick Scene Graph}{Qt Quick scene graph}
- to compose the elements of a web page into one view. This means that the UI process
- requires OpenGL ES 2.0 or OpenGL 2.0 for its rendering.
-
- \section2 Qt WebEngine Module
-
- \image qtwebengine-model.png
-
- The \QWE QML implementation contains the same elements as the \QWE Widgets
- implementation, except that there is no separately accessible web engine page.
- The supported page functionality is integrated into the web engine view.
-
- \section2 Qt WebEngine Core Module
-
- The \QWE core is based on the \l {Chromium Project}. Chromium provides its own network
- and painting engines and is developed tightly together with its dependent modules.
-
- \note \QWE is based on Chromium, but does not contain or use any services
- or add-ons that might be part of the Chrome browser that is built and delivered by Google.
- You can find more detailed information about the differences between Chromium and Chrome in this
- \l{https://chromium.googlesource.com/chromium/src/+/master/docs/chromium_browser_vs_google_chrome.md}{overview}
- that is part of the documentation in the \l {Chromium Project} upstream source tree.
-
- This version of \QWE is based on Chromium version 80.0.3987, with additional security
- fixes from newer versions.
-
- \section2 Qt WebEngine Process
-
- The \QWE Process is a separate executable that is used to render web pages and
- execute JavaScript. This mitigates security issues and isolates crashes caused by specific
- content.
-
- \section1 Embedding Web Content into Widget Based Applications
-
- Use the QWebEngineView class to display web pages in the simplest way. Because it is a widget,
- you can embed QWebEngineView into your forms and use its convenience functions to download and
- display web sites.
-
- \code
- QWebEngineView *view = new QWebEngineView(parent);
- view->load(QUrl("http://www.qt.io/"));
- view->show();
- \endcode
-
- An instance of QWebEngineView has one QWebEnginePage. QWebEnginePage can have a
- QWebEngineHistory that provides access to the page's navigation history and several QAction
- objects that apply actions on the web page. In addition, a QWebEnginePage has the ability to
- run JavaScript code in the context of the page's main frame and to enable customization of
- handlers for specific events like showing custom authentication dialogs.
-
- Each QWebEnginePage belongs to a QWebEngineProfile that can have a QWebEngineSettings
- for specifying page settings, a QWebEngineScriptCollection for running scripts on the page, and
- a QWebEngineCookieStore for accessing the HTTP cookies of Chromium. A QWebEnginePage can also
- directly point to a script collection.
-
- For a widget based application, the web engine is automatically initialized, unless it is
- placed in a plugin. In that case, it must be initialized in the application main source file
- by using \l QtWebEngine::initialize, as illustrated by the following code snippet:
-
- \code
- int main(int argc, char **argv)
- {
- QApplication app(argc, argv);
-
- QtWebEngine::initialize();
-
- QMainWindow window;
- window.show();
-
- return app.exec();
- }
- \endcode
-
- \section1 Embedding Web Content into Qt Quick Applications
-
- The WebEngineView QML type allows Qt Quick applications to render regions of dynamic web
- content. A \e{WebEngineView} type may share the screen with other QML types or encompass the
- full screen as specified within the Qt Quick application.
-
- To make sure that OpenGL context can be shared between the GUI and render processes, the web
- engine must be initialized by using \l QtWebEngine::initialize in the application main source
- file, as illustrated by the following code snippet:
-
- \code
- int main(int argc, char *argv[])
- {
- QGuiApplication app(argc, argv);
-
- QtWebEngine::initialize();
-
- QQmlApplicationEngine engine;
- engine.load(QUrl("qrc:/main.qml"));
-
- return app.exec();
- }
- \endcode
-
- An application can load pages into the WebEngineView, using either an URL or HTML string, and
- navigate within session history. By default, links to different pages load within the same
- WebEngineView object, but web sites may request them to be opened as a new tab, window, or
- dialog.
-
- The following sample QML application loads a web page using the \l{WebEngineView::}{url}
- property:
-
- \quotefromfile webengine/minimal/main.qml
- \skipto import
- \printuntil /^\}/
-
- \section1 Script Injection
-
- \QWE does not allow direct access to the document object model (DOM) of a page.
- However, the DOM can be inspected and adapted by injecting scripts.
-
- The DOM of a page is constructed when the document is ready, typically
- when the page is completely loaded. Therefore, executing scripts as soon as a document is
- created is not suitable for DOM operations, where one has to wait until the DOM is ready.
-
- In addition, an injected script shares the same \e world as the other scripts executed on the
- page, which might lead to conflicts. To avoid this, the QWebEngineScript class and the
- WebEngineScript QML type provide implementations of the Chromium API for
- \e{Content Script Extensions}. They specify the
- script to run, the injection point, and the world where the script is run. This enables
- accessing the DOM to manipulate it within a world.
-
- Since Qt 5.8, \QWE supports augmenting a script by using the
- following \l{Metadata Block}{Greasemonkey-like attributes}:
-
- \list
- \li \c {@exclude <regexp>}
- \li \c {@include <regexp>}
- \li \c {@match <regexp>}
- \li \c {@name <free text>}
- \li \c {@run-at [document-start|document-end|document-idle]}
- \endlist
-
- The attributes determine if and when a \l {User Scripts}{user script} is
- run. They must be placed immediately in the beginning of the script, inside
- a \c ==UserScript== comment:
-
- \code
- // ==UserScript==
- // @include http://*.qt.io/*
- // @exclude http://wiki.qt.io/*
- // ==/UserScript==
-
- window.alert("Page is from qt.io, but not wiki.qt.io");
- \endcode
-
- If your WebEngine application is built using the Qt Quick Compiler, and the application ships
- JavaScript files inside .qrc resources, consider reading the section
- \l{JavaScript Files in Qt Resource Files}.
-
- \section1 Managing Certificates
-
- \QWE uses its own network stack, and therefore QSslConfiguration is not used to
- open SSL connections. Instead, \QWE uses the root CA certificates from the operating
- system to validate the peer's certificate.
-
- The \l{WebEngineCertificateError::error} and \l{QWebEngineCertificateError::Error} enumerations
- provide information about the types of certificate errors that might occur. The errors can be
- handled by using the WebEngineView::certificateError QML method or by reimplementing the
- QWebEnginePage::certificateError function.
-
- \section1 Proxy Support
-
- \QWE uses the proxy settings from \l{Qt Network}, and forwards them to Chromium's
- networking stack. If QNetworkProxy::applicationProxy is set, it will also be used for \QWE.
- If QNetworkProxyFactory::usesSystemConfiguration() is enabled, the proxy settings
- are automatically retrieved from the system. Settings from an installed QNetworkProxyFactory
- will be ignored, though.
-
- In case QNetworkProxy::user() and QNetworkProxy::password() are set, these credentials
- will be automatically used for proxy authentication. It is up to the user to provide valid
- credentials, since there is no error handling callback.
-
- If no credentials are set with QNetworkProxy, but the proxy requires authentication,
- QWebEnginePage::proxyAuthenticationRequired is emitted.
- For Qt Quick, a dialog is shown.
-
- Not all properties of QNetworkProxy are supported by \QWE. That is,
- QNetworkProxy::type(), QNetworkProxy::hostName() and QNetworkProxy::port() are taken into
- account. All other proxy settings such as QNetworkProxy::rawHeader() are ignored.
-
- \section1 High DPI Support
-
- To support High DPI devices, it is recommended that the application attribute
- Qt::AA_EnableHighDpiScaling is set to enable automatic scaling based on the
- pixel density of the monitor. In \QWE applications, the scaling
- affects the default zooming factor and scrollbar size.
-
- For example:
-
- \code
- int main(int argc, char *argv[])
- {
- QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
- QApplication app(argc, argv);
- // ...
- }
- \endcode
-
- \QWE bundles images for normal and high-dpi resolutions into
- \e qtwebengine_resources_100p.pak and \e qtwebengine_resources_200p.pak
- files. Depending on the target resolutions, one or both of these files need
- to be deployed.
-
- For more information, see \l{High DPI Displays}.
-
- \section1 Using WebEngine Core
-
- \QWE Core provides an API shared by \QWE and \QWE Widgets for handling
- URL requests issued for the networking stack of Chromium and for accessing its HTTP cookies.
-
- Implementing the QWebEngineUrlRequestInterceptor interface and installing the interceptor on a
- profile enables intercepting, blocking, and modifying URL requests (QWebEngineUrlRequestInfo)
- before they reach the networking stack of Chromium.
-
- A QWebEngineUrlSchemeHandler can be registered for a profile to add support for custom URL
- schemes. Requests for the scheme are then issued to QWebEngineUrlSchemeHandler::requestStarted()
- as QWebEngineUrlRequestJob objects.
-
- The QWebEngineCookieStore class provides functions for accessing HTTP cookies of Chromium.
- The functions can be used to synchronize cookies with QNetworkAccessManager, as well as to set,
- delete, and intercept cookies during navigation.
-
- \section1 Platform Notes
-
- \QWE currently supports only Windows, Linux, and \macos. Due to Chromium build
- requirements it also often requires a newer compiler than the rest of Qt. See
- \l{Qt WebEngine Platform Notes} for further details.
-
- \section1 Related Modules
-
- \QWE supersedes the \l{http://doc.qt.io/archives/qt-5.3/qtwebkit-index.html}{Qt WebKit}
- module, which is based on the
- WebKit project, but has not been actively synchronized with the upstream WebKit code since
- Qt 5.2 and has been deprecated in Qt 5.5. For tips on how to change a Qt \WebKit widgets
- application to use \QWE widgets, see \l{Porting from Qt WebKit to Qt WebEngine}.
-
- The \l{Qt WebView} module allows to use a native web browser on platforms where one is
- available.
-
- The \l{Qt WebChannel} module can be used to create a bi-directional communication channel
- between QObject objects on the C++ side and JavaScript on the QML side.
-
-*/
diff --git a/src/webengine/doc/src/qtwebengine-platform-notes.qdoc b/src/webengine/doc/src/qtwebengine-platform-notes.qdoc
deleted file mode 100644
index cbb12a0bd..000000000
--- a/src/webengine/doc/src/qtwebengine-platform-notes.qdoc
+++ /dev/null
@@ -1,237 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \page qtwebengine-platform-notes.html
- \title Qt WebEngine Platform Notes
-
- \brief Contains information about issues that are specific to the \QWE module.
-
- \section1 Building \QWE from Source
-
- Static builds are not supported.
-
- The requirements for building Qt 5 modules from source are listed separately for each supported
- platform:
-
- \list
- \li \l{Qt for Windows - Requirements}
- \li \l{Qt for X11 Requirements}
- \li \l{Qt for macOS - Building from Source}
- \endlist
-
- In addition, the following tools are required for building the \l {Qt WebEngine} module:
-
- \list
- \li \l {All Platforms}
- \li \l {Windows}
- \li \l {Linux}
- \li \l {macOS}
- \endlist
-
- The tests for skipping the \QWE build are located in the
- \c qtwebengine repository, in the \c tools\qmake\mkspecs subdirectory.
- They can be found by searching for \c skipBuild.
-
- \section2 All Platforms
-
- On all platforms, the following tools are required:
-
- \list
- \li \l Python 2.7.5 or later. Python 3 is not supported.
- \li Bison, Flex
- \li GPerf
- \endlist
-
- \section2 Windows
-
- On Windows, the following additional tools are required:
-
- \list
- \li Visual Studio 2017 version 15.8 or later
- \li Active Template Library (ATL), usually included in the Visual Studio
- installation
- \li Windows 10 SDK version 10.0.18362 or later
- \endlist
-
- \QWE can only be built on 64-bit Windows, with a x64-bit toolchain.
- For building \QWE for x86 applications, you need to configure
- and compile Qt with the Visual Studio 2017 x64 to x86 cross-compile
- toolchain. This toolchain can be set up on the command line by running
- \c{vcvarsall.bat amd64_x86}.
-
- \section2 Linux
-
- On Linux, Clang or GCC version 5 or later is required.
- Supported configurations are \c linux-g++, \c{linux-clang} and \c{linux-clang-libc++}
-
- \QWE requires \c pkg-config to detect most of its dependencies. The
- following \c pkg-config files are required:
-
- \list
- \li \c dbus-1
- \li \c fontconfig
- \endlist
-
- If Qt was configured for \c xcb, the following \c pkg-config files are also
- required:
-
- \list
- \li \c libdrm
- \li \c xcomposite
- \li \c xcursor
- \li \c xi
- \li \c xrandr
- \li \c xscrnsaver
- \li \c xtst
- \endlist
-
- Further, development packages for \c khr and \c libcap need to be installed.
-
- \section2 \macos
-
- On \macos, the following are required:
-
- \list
- \li \macos 10.13 or later
- \li Xcode 10.0 or later
- \li \macos 10.13 SDK or later
- \endlist
-
- \note \QWE cannot be built for the 32-bit mode of \macos (using the
- \c macx-clang-32 \c mkspec).
-
- \section1 Using Earlier Qt Versions to Build \QWE
-
- Building \QWE with earlier Qt versions (down to the last LTS
- version) is supported. It means that \QWE 5.15 can be built with
- Qt 5.12.x, Qt 5.14.x, and Qt 5.15.
-
- To use an earlier Qt version to build Qt Webengine:
-
- \list 1
- \li Download the qtwebengine sources.
- \li From the earlier Qt version, run
- \c {qmake && make (&& make install)}.
- \endlist
-
- \section1 Mac App Store Compatibility
-
- Applications using \QWE are not compatible with the Mac App Store, because:
-
- \list
- \li The Chromium part of the code uses several private API methods, which are prohibited by
- the App Store.
- \li Applications submitted to the App Store must be code-signed with the App Sandbox feature
- enabled. The App Sandbox feature interferes with Chromium's own sandbox
- initialization, which results in Chromium not being properly initialized. This also
- ties in with the private API usage. Furthermore, standalone Chromium itself is not
- officially tested with the App Sandbox enabled, and even if work is done to bypass
- the App Store's restrictions, that would not guarantee correct behavior of the library.
-
- \endlist
-
- \section1 macOS Airplay Support on MacBooks with Dual GPUs
-
- To make \QWE work correctly when streaming to an AppleTV from a MacBook that supports
- GPU switching, it is important to add the \c NSSupportsAutomaticGraphicsSwitching option to the
- application Info.plist file, with the value set to \c YES. Otherwise rendering issues might
- occur when creating new web engine view instances after Airplay is switched on or off.
-
- \section1 Default QSurfaceFormat OpenGL Profile Support
-
- If a new default QSurfaceFormat with a modified OpenGL profile has to be set, it should be set
- before the application instance is declared, to make sure that all created OpenGL contexts use
- the same OpenGL profile.
-
- On \macos, if the default QSurfaceFormat is set after the application instance, the application
- will exit with qFatal(), and print a message that the default QSurfaceFormat should be set
- before the application instance.
-
- \section1 Sandboxing Support
-
- \QWE provides out-of-the-box sandboxing support for Chromium render
- processes.
-
- On Linux, note the following restrictions:
-
- \list
- \li The kernel has to support the anonymous namespaces feature
- (kernel version 3.8 or later). However, on Debian, Ubuntu,
- and other Debian-derived distributions, this feature is off
- by default. It can be turned on by setting
- \c /proc/sys/kernel/unprivileged_userns_clone to 1.
- \li The kernel has to support the \c seccomp-bpf feature (kernel
- version 3.5 or later).
- \li Setuid sandboxes are not supported and are thus disabled.
- \endlist
-
- To explicitly disable sandboxing, use one of the following options:
-
- \list
- \li Set the \c QTWEBENGINE_DISABLE_SANDBOX environment variable to 1.
- \li Pass the \c{--no-sandbox} command line argument to the user
- application executable.
- \li Set \c QTWEBENGINE_CHROMIUM_FLAGS to \c{--no-sandbox}.
- \endlist
-
- For more information, see \l{Using Command-Line Arguments}.
-
- \section1 Memory Requirements in Docker Environment
-
- When running Qt Web Engine examples in a Docker container and browsing
- content-heavy sites, BUS errors (SIGBUS) might be reported. Typically,
- this is caused by Docker running a container with a too small memory space
- (such as 64MB). To fix this problem, increase the memory space size.
-
- \section1 Accessibility and Performance
-
- \QWE enables accessibility support for web pages when the following conditions
- are met:
-
- \list
- \li Qt Core is configured and built with accessibility support enabled.
- \li The QPA plugin is notified by the operating system that accessibility should be
- activated. This happens for example when using a screen reader application on Windows
- or VoiceOver on \macos.
- \endlist
-
- Due to some limitations, the Linux QPA plugin almost always reports that accessibility should
- be activated. On big HTML pages, this can cause a significant slowdown in rendering speed.
-
- Because of that, from Qt 5.9 onwards, \QWE accessibility support is disabled by default
- on Linux.
- It can be re-enabled by setting the \c QTWEBENGINE_ENABLE_LINUX_ACCESSIBILITY environment
- variable to a non-empty value.
-
- \section1 Popups in Fullscreen Applications on Windows
- Because of a limitation in the Windows compositor, applications that show a fullscreen web
- engine view will not properly display popups or other top-level windows. The reason and
- workaround for the issue can be found at \l {Fullscreen OpenGL Based Windows} and
- \l {QWindowsWindowFunctions::setHasBorderInFullScreen}.
-
-*/
diff --git a/src/webengine/doc/src/qtwebengine-qmlmodule.qdoc b/src/webengine/doc/src/qtwebengine-qmlmodule.qdoc
deleted file mode 100644
index 4fd7e3a3b..000000000
--- a/src/webengine/doc/src/qtwebengine-qmlmodule.qdoc
+++ /dev/null
@@ -1,48 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \qmlmodule QtWebEngine 1.10
- \title Qt WebEngine QML Types
- \brief Provides QML types for rendering web content within a QML application.
- \ingroup qtwebengine-modules
- \ingroup qmlmodules
-
- The QML types can be imported into your application using the following import statements in
- your .qml file:
-
- \qml
- import QtWebEngine 1.10
- \endqml
-
- To link against the module, add the following QT variable to your qmake .pro
- file:
-
- \badcode
- QT += webengine
- \endcode
-*/
diff --git a/src/webengine/doc/src/qwebengine-licensing.qdoc b/src/webengine/doc/src/qwebengine-licensing.qdoc
deleted file mode 100644
index f6a0a6c32..000000000
--- a/src/webengine/doc/src/qwebengine-licensing.qdoc
+++ /dev/null
@@ -1,53 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
-\group qtwebengine-licensing
-\title Qt WebEngine Licensing
-
-The Qt specific parts of the \QWE module are dual-licensed
-under Commercial and GNU Lesser General Public License (LGPLv3).
-In addition, the module contains code licensed under LGPLv2.
-
-The module includes a snapshot of Chromium. As such, users need to
-respect the licenses of Chromium, and third-party code included in
-Chromium. The arguably most restrictive license to be respected by
-all users is LGPLv2.1.
-
-Third party licenses included in the sources are:
-*/
-
-/*!
-\page qtwebengine-3rdparty-chromium-global.html attribution
-\ingroup qtwebengine-licensing
-\title Chromium License
-\brief BSD
-
-The Google-authored portion of Chromium is released under a BSD license:
-
-\quotefile ../../../3rdparty/chromium/LICENSE
-*/
diff --git a/src/webengine/doc/src/webengineview_lgpl.qdoc b/src/webengine/doc/src/webengineview_lgpl.qdoc
deleted file mode 100644
index 0cd8441cf..000000000
--- a/src/webengine/doc/src/webengineview_lgpl.qdoc
+++ /dev/null
@@ -1,1640 +0,0 @@
-/*
- * Copyright (C) 2019 The Qt Company Ltd.
- * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
- * Copyright (c) 2012 Hewlett-Packard Development Company, L.P.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this program; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-// The documentation in this file was imported from QtWebKit and is thus constrained
-// by its LGPL license.
-
-/*!
- \qmltype WebEngineView
- \instantiates QQuickWebEngineView
- \inherits Item
- \inqmlmodule QtWebEngine
- \since QtWebEngine 1.0
- \brief A WebEngineView renders web content within a QML application.
-
- The WebEngineView type enables QML applications to render regions of dynamic web content. It
- may share the screen with other QML types, such as a TabView, or fill the screen, as specified
- within the QML application.
-
- \section2 Initializing Web Engine
-
- For the web engine view to be rendered, the web engine must be initialized by using
- \l QtWebEngine::initialize in the application main source file, as illustrated by the
- following code snippet:
-
- \quotefromfile webengine/minimal/main.cpp
- \skipto main
- \printuntil }
-
- \section2 Loading Web Pages
-
- An application can load pages into the WebEngineView, using either the \l url property or the
- \l loadHtml method and navigate within the view's session history. The GET
- method is always used to load URLs.
-
- The history is represented by a WebEngineHistory data model that is held by
- the \l navigationHistory property.
-
- The following sample QML application loads a web page using the \c url property:
-
- \quotefromfile webengine/minimal/main.qml
- \skipto import
- \printuntil /^\}/
-
- The \l loading property holds whether an HTML page is currently loading.
- The \l loadingChanged() signal is emitted when loading the page begins, ends, or fails.
-
- The title of an HTML page can be accessed with the \l title property. Additionally, a web
- page may specify an icon, which can be accessed using the \l icon property. The \l zoomFactor
- property enables zooming the contents of the web page by a scale factor.
-
- If a certificate error is raised while loading a web page, the \l certificateError() signal is
- emitted. Certificate errors are handled by using the methods of the WebEngineCertificateError
- type.
-
- \section2 Interaction
-
- By default, links to different pages load within the same WebEngineView object, but web sites
- may request them to be opened as a new tab, window, or dialog. The \l newViewRequested() signal
- is emitted when a request to load the page in a separate web engine view is issued. The
- NewViewDestination property describes how the new view should be opened. In addition, the
- WebEngineNewViewRequest utility type can be used to load web pages in separate web engine views.
-
- The \l findText() method can be used to search for a string on a web page, using the options
- described by \l FindFlags.
-
- The \l setActiveFocusOnPress() method can be used to create a UI element that should not get
- focus on press. This can be useful in a hybrid UI.
-
- The \l {WebEngineSettings::focusOnNavigationEnabled} {focusOnNavigationEnabled} setting can be
- used to make the view automatically receive focus when a navigation operation occurs
- (like loading or reloading a page or navigating through history).
-
- The \l linkHovered() signal is emitted when a mouse pointer passes over a link and thus
- corresponds to the \c{mouseover} DOM event.
-
- Actions, such as selecting and editing content, can be performed on a web page by using the
- \l triggerWebAction() method. The available actions are described by the \l WebAction property.
-
- The \l backgroundColorChanged() signal is emitted when the web page background color changes.
-
- \section2 User Scripts
-
- During the loading of a page, so called \e {user scripts} can be injected in the JavaScript
- engine at different points. The script objects attached to the web engine view are held by the
- \l userScripts property and injected by using the WebEngineScript type. Scripts can also be run
- by using the runJavaScript() method in the same world as other scripts that are part of the
- loaded site.
-
- The \l webChannel property can be used to expose a WebChannel instance in the JavaScript context
- of the page it is rendering as \c qt.webChannelTransport.
-
- \section2 Fullscreen Mode
-
- A web page can request through the JavaScript API to be loaded in fullscreen mode. The
- \l fullScreenRequested() signal is emitted when the web page issues the request. The
- FullScreenRequest utility type can be used to toggle fullscreen requests. The
- \l fullScreenCancelled method can be used to notify the browser engine when the windowing
- system forces the application to leave fullscreen mode.
-
- \section2 Profiles
-
- Web engine views can be isolated from each other by using the WebEngineProfile type. A profile
- contains settings, scripts, and the list of visited links shared by all views that belong to the
- profile. For example, a dedicated profile could be created for a \e {private browsing} mode. The
- current profile for the view is held by the \l profile property and the current settings are
- held by the \l settings property. The settings are specified by using the WebEngineSettings
- type.
-
- \section2 Platform Features
-
- Web pages can request access to platform features, such as geolocation or audio and video
- capture devices. The \l featurePermissionRequested() signal is emitted when a web page requests
- to make use of a resource. The supported platform features are described by the \l Feature
- property. If users grant the permission, the \l grantFeaturePermission() method is used to set
- it to \e granted.
-
- \section2 Rendering to OpenGL Surface
-
- When using a QQuickRenderControl to render a Qt Quick user interface to an OpenGL surface, the
- WebEngineView type is not rendered correctly. The web engine view attempts to use a global
- OpenGL context created by \l QtWebEngine::initialize, but there is no public API for accessing
- that context in order to share it with the \c QQuickRenderControl context.
-
- To have the web engine view rendered correctly, it is possible to manually create a new
- offscreen context that is shared with the \c QQuickRenderControl and to call the non-public
- function \c qt_gl_set_global_share_context(), rather than calling \c initialize().
- If \c initialize() is called after setting a global context, it will do nothing.
-*/
-
-/*!
- \qmlmethod void WebEngineView::goBack()
-
- Go backward within the browser's session history, if possible.
- This function is equivalent to the \c{window.history.back()} DOM method.
-
- \sa canGoBack
-*/
-
-/*!
- \qmlmethod void WebEngineView::goForward()
-
- Go forward within the browser's session history, if possible.
- This function is equivalent to the \c{window.history.forward()} DOM method.
-*/
-
-/*!
- \qmlmethod void WebEngineView::goBackOrForward(int offset)
- \since QtWebEngine 1.1
-
- If \a offset is positive, goes forward the specified number of offset
- pages in the current session history. If offset is negative, it goes
- back. If the offset is invalid, the page is not changed.
-
- \sa goBack(), goForward()
-*/
-
-/*!
- \qmlmethod void WebEngineView::stop()
-
- Stops loading the current page.
-*/
-
-/*!
- \qmlmethod void WebEngineView::reload()
-
- Reloads the current page. This function is equivalent to the
- \c{window.location.reload()} DOM method.
-
- \sa reloadAndBypassCache()
-*/
-
-/*!
- \qmlmethod void WebEngineView::reloadAndBypassCache()
- \since QtWebEngine 1.1
-
- Reloads the current page, ignoring any cached content.
-
- \sa reload()
-*/
-
-/*!
- \qmlproperty url WebEngineView::url
-
- The location of the currently displayed HTML page. This writable
- property offers the main interface to load a page into a web view.
- It functions the same as the \c{window.location} DOM property.
-
- \sa loadHtml()
-*/
-
-/*!
- \qmlproperty url WebEngineView::icon
- \readonly
-
- An internal URL for accessing the currently displayed web site icon,
- also known as favicon or shortcut icon. The icon is already downloaded
- and stored by the \QWE's favicon manager.
- This read-only URL corresponds to the image used within a mobile browser
- application to represent a bookmarked page on the device's home screen.
-
- The following snippet uses the \c{icon} property to build an \c{Image}
- component:
-
- \qml
- Image {
- id: appIcon
- sourceSize: Qt.size(32, 32)
- source: webView.icon != "" ? webView.icon : "fallbackFavicon.png";
- // ...
- }
- \endqml
-
- Specifying the \c{sourceSize} property of the \c{Image} element informs
- the \QWE's favicon provider about the requested size. The
- favicon provider tries to find the best fit among the web page candidate
- icons. If \c{sourceSize} property is not specified, the provider provides
- the icon with the largest resolution.
-*/
-
-/*!
- \qmlproperty int WebEngineView::loadProgress
- \readonly
-
- The amount of data from the page that has been loaded, expressed
- as an integer percentage in the range from \c{0} to \c{100}.
-*/
-
-/*!
- \qmlproperty bool WebEngineView::canGoBack
- \readonly
-
- Returns \c{true} if there are prior session history entries, \c{false}
- otherwise.
-*/
-
-/*!
- \qmlproperty bool WebEngineView::canGoForward
- \readonly
-
- Returns \c{true} if there are subsequent session history entries,
- \c{false} otherwise.
-*/
-
-/*!
- \qmlproperty bool WebEngineView::loading
- \readonly
-
- Returns \c{true} if the HTML page is currently loading, \c{false} otherwise.
-*/
-
-/*!
- \qmlproperty string WebEngineView::title
- \readonly
-
- The title of the currently displayed HTML page. This is a
- read-only value that reflects the contents of the \c{<title>} tag.
-*/
-
-/*!
- \qmlproperty bool WebEngineView::isFullScreen
- \since QtWebEngine 1.1
- \readonly
-
- Returns \c{true} if the web view is in fullscreen mode, \c{false} otherwise.
-
- \sa fullScreenRequested(), fullScreenCancelled()
-*/
-
-/*!
- \qmlproperty WebEngineHistory WebEngineView::navigationHistory
- \since QtWebEngine 1.1
- \readonly
-
- The navigation history of the current view.
-
- \sa WebEngineHistory
-*/
-
-/*!
- \qmlproperty QQmlWebChannel WebEngineView::webChannel
- \since QtWebEngine 1.1
-
- The web channel instance used by this view.
- This channel is automatically using the internal QtWebEngine transport mechanism over Chromium IPC,
- and exposed in the javascript context of the page it is rendering as \c qt.webChannelTransport.
- This transport object is used when instantiating the JavaScript counterpart of QWebChannel using
- the \l{Qt WebChannel JavaScript API}.
-
- \note The view does not take ownership for an assigned webChannel object.
-*/
-
-/*!
- \qmlproperty WebEngineProfile WebEngineView::profile
- \since QtWebEngine 1.1
-
- The current profile used for the view.
-
- \sa WebEngineProfile
-*/
-
-/*!
- \qmlproperty WebEngineSettings WebEngineView::settings
- \readonly
- \since QtWebEngine 1.1
-
- Settings used by this view.
-
- \sa WebEngineSettings
-*/
-
-
-/*!
- \qmlproperty list<WebEngineScript> WebEngineView::userScripts
- \readonly
- \since QtWebEngine 1.1
-
- List of script objects attached to the view.
-
- \sa WebEngineScript
-*/
-
-/*!
- \qmlproperty real WebEngineView::zoomFactor
- \since QtWebEngine 1.1
-
- Zoom factor for the view. Valid values are within the range from \c{0.25}
- to \c{5.0}. The default factor is \c{1.0}.
-*/
-
-/*!
- \qmlproperty size WebEngineView::contentsSize
- \since QtWebEngine 1.3
-
- Size of the page contents.
-*/
-
-/*!
- \qmlproperty point WebEngineView::scrollPosition
- \since QtWebEngine 1.3
-
- Scroll position of the page contents.
-*/
-
-/*!
- \qmlproperty int WebEngineView::webChannelWorld
- \since QtWebEngine 1.3
-
- JavaScript world that the web channel instance used by this view is
- installed in. The world must be a number between \c 0 and \c 256.
-*/
-
-/*!
- \qmlmethod void WebEngineView::loadHtml(string html, url baseUrl)
- Loads the specified \a html as the content of the web view.
-
- This method offers a lower-level alternative to the \c{url} property,
- which references HTML pages via URL.
-
- External objects, such as stylesheets or images referenced in the HTML
- document, should be located relative to \a baseUrl. For external objects to
- be loaded, \c baseUrl cannot be empty. For example, if \a html
- is retrieved from \c http://www.example.com/documents/overview.html, which
- is the base URL, then an image referenced with the relative URL, \c diagram.png,
- should be at \c{http://www.example.com/documents/diagram.png}.
-
- \sa url
-*/
-
-/*!
- \qmlmethod void WebEngineView::runJavaScript(string script, variant callback)
- Runs the specified \a script in the content of the web view.
-
- The \a callback parameter is optional. If a callback function is provided,
- it will be invoked after the script finishes running.
-
- \code
- runJavaScript("document.title", function(result) { console.log(result); });
- \endcode
-
- Only plain data can be returned from JavaScript as the result value.
- Supported data types include all of the JSON data types as well as, for
- example, \c{Date} and \c{ArrayBuffer}. Unsupported data types include, for
- example, \c{Function} and \c{Promise}.
-
- The script will run in the same \e world as other scripts that are
- part of the loaded site.
-
- \warning Do not execute lengthy routines in the callback function, because it might block the
- rendering of the web content.
-
- For more information about injecting scripts, see \l {Script Injection}.
- For an alternative way to inject scripts, see WebEngineView::userScripts.
-*/
-
-/*!
- \qmlmethod void WebEngineView::findText(string subString)
- \since QtWebEngine 1.1
- Finds the specified string, \a subString, in the page.
- The findTextFinished() signal is emitted when a string search is completed.
-
- To clear the search highlight, just pass an empty string.
-
- \sa findTextFinished()
-*/
-
-/*!
- \qmlmethod void WebEngineView::findText(string subString, FindFlags options)
- \since QtWebEngine 1.1
- Finds the specified string, \a subString, in the page, using the given \a options.
- The findTextFinished() signal is emitted when a string search is completed.
-
- To clear the search highlight, just pass an empty string.
-
- \code
- findText("Qt", WebEngineView.FindBackward | WebEngineView.FindCaseSensitively);
- \endcode
-
- \sa findTextFinished()
-*/
-
-/*!
- \qmlmethod void WebEngineView::findText(string subString, FindFlags options, variant resultCallback)
- \since QtWebEngine 1.1
- Finds the specified string, \a subString, in the page, using the given \a options.
- The findTextFinished() signal is emitted when a string search is completed.
-
- To clear the search highlight, just pass an empty string.
-
- The \a resultCallback must take an integer parameter. It will be called with
- the number of found occurrences of the \a subString.
-
- \code
- findText("Qt", WebEngineView.FindCaseSensitively, function(matchCount) {
- if (matchCount > 0)
- console.log("'Qt' tokens found:", matchCount);
- });
- \endcode
-
- \sa findTextFinished()
-*/
-
-/*!
- \qmlmethod void WebEngineView::grantFeaturePermission(url securityOrigin, Feature feature, bool granted)
- \since QtWebEngine 1.1
-
- Sets or unsets the permission, depending on \a granted, for the web site
- identified by \a securityOrigin to use \a feature.
-
- \sa featurePermissionRequested()
-*/
-
-
-/*!
- \qmlmethod void WebEngineView::fullScreenCancelled()
- \since QtWebEngine 1.1
-
- Immediately sets \c{isFullScreen} property to \c{false}. It can be used to notify the
- browser engine when the windowing system forces the application to leave fullscreen mode.
-
- \qml
- ApplicationWindow {
- onVisibilityChanged: {
- if (webEngineView.isFullScreen && visibility != Window.FullScreen)
- webEngineView.fullScreenCancelled()
- }
-
- WebEngineView {
- id: webEngineView
- // ...
- }
- }
- \endqml
-
- \sa isFullScreen, fullScreenRequested()
-*/
-
-/*!
- \qmlmethod void WebEngineView::setActiveFocusOnPress(bool arg)
- \since QtWebEngine 1.2
-
- Sets active focus to a clicked web engine view if \a arg is \c true. By setting it to \c false,
- a web engine view can be used to create a UI element that should not get focus. This can be
- useful in a hybrid UI.
-
- \sa activeFocusOnPress, activeFocusOnPressChanged,
- WebEngineSettings::focusOnNavigationEnabled
-*/
-
-/*!
- \qmlmethod void WebEngineView::triggerWebAction(WebAction action)
- \since QtWebEngine 1.2
-
- Triggers the web action \a action.
-
- \sa WebAction
-*/
-
-/*!
- \qmlsignal WebEngineView::featurePermissionRequested(url securityOrigin, Feature feature)
- \since QtWebEngine 1.1
-
- This signal is emitted when the web site identified by \a securityOrigin requests
- to make use of the resource or device identified by \a feature.
-
- \sa grantFeaturePermission()
-*/
-
-/*!
- \qmlsignal WebEngineView::loadingChanged(WebEngineLoadRequest loadRequest)
-
- This signal is emitted when a page load begins, ends, or fails.
-
- When handling the signal with \c onLoadingChanged, various read-only
- parameters are available on the WebEngineLoadRequest specified by
- \a loadRequest.
-
- \sa loading, LoadStatus, ErrorDomain
-*/
-
-/*!
- \qmlsignal WebEngineView::certificateError(WebEngineCertificateError error)
- \since QtWebEngine 1.1
-
- This signal is emitted when an invalid certificate error, \a error, is
- raised while loading a given request.
-
- The certificate error can be handled by using the methods of the WebEngineCertificateError
- type.
-*/
-
-/*!
- \qmlsignal WebEngineView::linkHovered(url hoveredUrl)
-
- Within a mouse-driven interface, this signal is emitted when a mouse
- pointer passes over a link, corresponding to the \c{mouseover} DOM
- event. This event may also occur in touch interfaces for \c{mouseover}
- events that are not cancelled with \c{preventDefault()}. \a{hoveredUrl}
- provides the link's location.
-*/
-
-/*!
- \qmlsignal WebEngineView::javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, string message, int lineNumber, string sourceID)
- This signal is emitted when a JavaScript program tries to print a \a message to the web browser's console.
-
- For example, in case of evaluation errors the source URL may be provided in \a sourceID as well
- as the \a lineNumber.
-
- \a level indicates the severity of the event that triggered the message, that is, whether it
- was triggered by an error or a less severe event.
-
- If no handler is specified, the view will log the messages into a \c js
- \l{QLoggingCategory}{logging category}.
-
- \sa{Console Logging}
-*/
-
-/*!
- \qmlsignal WebEngineView::newViewRequested(WebEngineNewViewRequest request)
- \since QtWebEngine 1.1
-
- This signal is emitted when \a request is issued to load a page in a separate
- web engine view. This can either be because the current page requested it explicitly
- through a JavaScript call to \c window.open, or because the user clicked on a link
- while holding Shift, Ctrl, or a built-in combination that triggers the page to open
- in a new window.
-
- If this signal is not handled, the requested load will fail.
-
- An example implementation:
-
- \snippet snippets/qtwebengine_webengineview_newviewrequested.qml 0
-
- \sa NewViewDestination, {WebEngine Quick Nano Browser}
-*/
-
-/*!
- \qmlsignal WebEngineView::fullScreenRequested(FullScreenRequest request)
- \since QtWebEngine 1.1
-
- This signal is emitted when the web page issues the \a request for
- fullscreen mode through the JavaScript API.
-
- \sa isFullScreen
-*/
-
-/*!
- \qmlsignal WebEngineView::activeFocusOnPressChanged(bool activeFocusOnPress)
- \since QtWebEngine 1.2
-
- This signal is emitted when the value of \a activeFocusOnPress changes.
- It specifies whether the view should gain active focus when pressed.
-
- \sa activeFocusOnPress, setActiveFocusOnPress()
-*/
-
-/*!
- \qmlsignal WebEngineView::backgroundColorChanged()
- \since QtWebEngine 1.2
-
- This signal is emitted when the web engine view background color changes.
-*/
-
-/*!
- \qmlsignal WebEngineView::renderProcessTerminated(RenderProcessTerminationStatus terminationStatus, int exitCode)
-
- \since QtWebEngine 1.2
-
- This signal is emitted when the render process is terminated with a non-zero exit status.
- \a terminationStatus is the termination status of the process and \a exitCode is the status code
- with which the process terminated.
-
- \sa RenderProcessTerminationStatus
-*/
-
-/*!
- \qmlsignal WebEngineView::windowCloseRequested()
- \since QtWebEngine 1.2
-
- This signal is emitted whenever the page requests the web browser window to be closed,
- for example through the JavaScript \c{window.close()} call.
-*/
-
-/*!
- \qmlproperty enumeration WebEngineView::ErrorDomain
-
- Describes various high-level error types:
-
- \value WebEngineView.NoErrorDomain
- \value WebEngineView.InternalErrorDomain
- Content fails to be interpreted by \QWE.
- \value WebEngineView.ConnectionErrorDomain
- Error results from faulty network connection.
- \value WebEngineView.CertificateErrorDomain
- Error related to the SSL/TLS certificate.
- \value WebEngineView.HttpErrorDomain
- Error related to the HTTP connection.
- \value WebEngineView.FtpErrorDomain
- Error related to the FTP connection.
- \value WebEngineView.DnsErrorDomain
- Error related to the DNS connection.
-*/
-
-/*!
- \qmlproperty enumeration WebEngineView::JavaScriptConsoleMessageLevel
-
- Indicates the severity of a JavaScript console message:
-
- \value WebEngineView.InfoMessageLevel
- Message is purely informative and can safely be ignored.
- \value WebEngineView.WarningMessageLevel
- Message indicates there might be a problem that may need attention.
- \value WebEngineView.ErrorMessageLevel
- Message indicates there has been an error.
-*/
-
-/*!
- \qmlproperty enumeration WebEngineView::LoadStatus
-
- Reflects a page's load status:
-
- \value WebEngineView.LoadStartedStatus
- Page is currently loading.
- \value WebEngineView.LoadStoppedStatus
- Loading the page was stopped by the stop() method or by the loader
- code or network stack in Chromium.
- \value WebEngineView.LoadSucceededStatus
- Page has successfully loaded, and is not currently loading.
- \value WebEngineView.LoadFailedStatus
- Page has failed to load, and is not currently loading.
-*/
-
-/*!
- \qmlproperty enumeration WebEngineView::NewViewDestination
-
- Describes how to open a new view:
-
- \value WebEngineView.NewViewInWindow
- In a separate Window.
- \value WebEngineView.NewViewInTab
- In a tab of the same window.
- \value WebEngineView.NewViewInDialog
- In a Window without a tab bar, toolbar, or URL bar.
- \value WebEngineView.NewViewInBackgroundTab
- In a tab of the same window, without hiding the currently visible web engine view.
-
- \sa {WebEngineNewViewRequest::destination}{WebEngineNewViewRequest.destination}
-*/
-
-/*!
- \qmlproperty enumeration WebEngineView::FindFlags
-
- Describes the options available to the findText() function. The options
- can be OR-ed together from the following list:
-
- \value WebEngineView.FindBackward
- Searches backwards instead of forwards.
- \value WebEngineView.FindFlags FindCaseSensitively
- By default findText() works case insensitive. Specifying
- this option changes the behavior to a case sensitive find operation.
-
- \sa findText()
-*/
-
-/*!
- \qmlproperty enumeration WebEngineView::RenderProcessTerminationStatus
- \since QtWebEngine 1.2
-
- Describes the status with which the render process terminated:
-
- \value WebEngineView.NormalTerminationStatus
- The render process terminated normally.
- \value WebEngineView.AbnormalTerminationStatus
- The render process terminated with a non-zero exit status.
- \value WebEngineView.CrashedTerminationStatus
- The render process crashed, for example because of a segmentation fault.
- \value WebEngineView.KilledTerminationStatus
- The render process was killed, for example by \c SIGKILL or task manager kill.
-*/
-
-/*!
- \qmlproperty enumeration WebEngineView::WebAction
- \since QtWebEngine 1.2
-
- Describes the types of action that can be performed on a web page:
-
- \value WebEngineView.NoWebAction
- No action is triggered.
- \value WebEngineView.Back
- Navigate back in the history of navigated links.
- \value WebEngineView.Forward
- Navigate forward in the history of navigated links.
- \value WebEngineView.Stop
- Stop loading the current page.
- \value WebEngineView.Reload
- Reload the current page.
- \value WebEngineView.ReloadAndBypassCache
- Reload the current page, but do not use any local cache.
- \value WebEngineView.Cut
- Cut the content currently selected into the clipboard.
- \value WebEngineView.Copy
- Copy the content currently selected into the clipboard.
- \value WebEngineView.Paste
- Paste content from the clipboard.
- \value WebEngineView.Undo
- Undo the last editing action.
- \value WebEngineView.Redo
- Redo the last editing action.
- \value WebEngineView.SelectAll
- Select all content.
- This action is only enabled when the page's content is focused.
- The focus can be forced by the JavaScript \c{window.focus()} call, or the
- \l{WebEngineSettings::focusOnNavigationEnabled} {focusOnNavigationEnabled} setting
- should be enabled to get automatic focus.
- \value WebEngineView.PasteAndMatchStyle
- Paste content from the clipboard with current style.
- \value WebEngineView.OpenLinkInThisWindow
- Open the current link in the current window. (Added in Qt 5.6)
- \value WebEngineView.OpenLinkInNewWindow
- Open the current link in a new window. Requires a handler for the
- \l newViewRequested() signal. (Added in Qt 5.6)
- \value WebEngineView.OpenLinkInNewTab
- Open the current link in a new tab. Requires a handler for the
- \l newViewRequested() signal. (Added in Qt 5.6)
- \value WebEngineView.CopyLinkToClipboard
- Copy the current link to the clipboard. (Added in Qt 5.6)
- \value WebEngineView.CopyImageToClipboard
- Copy the clicked image to the clipboard. (Added in Qt 5.6)
- \value WebEngineView.CopyImageUrlToClipboard
- Copy the clicked image's URL to the clipboard. (Added in Qt 5.6)
- \value WebEngineView.CopyMediaUrlToClipboard
- Copy the hovered audio or video's URL to the clipboard. (Added in Qt 5.6)
- \value WebEngineView.ToggleMediaControls
- Toggle between showing and hiding the controls for the hovered audio or video element.
- (Added in Qt 5.6)
- \value WebEngineView.ToggleMediaLoop
- Toggle whether the hovered audio or video should loop on completetion or not.
- (Added in Qt 5.6)
- \value WebEngineView.ToggleMediaPlayPause
- Toggle the play/pause state of the hovered audio or video element. (Added in Qt 5.6)
- \value WebEngineView.ToggleMediaMute
- Mute or unmute the hovered audio or video element. (Added in Qt 5.6)
- \value WebEngineView.DownloadLinkToDisk
- Download the current link to the disk. To implement download
- actions, connect to the \l {QQuickWebEngineProfile::downloadRequested}
- {WebEngineProfile.downloadRequested} signal. (Added in Qt 5.6)
- \value WebEngineView.DownloadImageToDisk
- Download the highlighted image to the disk. (Added in Qt 5.6)
- \value WebEngineView.DownloadMediaToDisk
- Download the hovered audio or video to the disk. (Added in Qt 5.6)
- \value WebEngineView.InspectElement
- Trigger any attached Web Inspector to inspect the highlighed element.
- (Added in Qt 5.6)
- \value WebEngineView.ExitFullScreen
- Exit the fullscreen mode. (Added in Qt 5.6)
- \value WebEngineView.SavePage
- Save the current web page to disk. (Added in Qt 5.7)
- \value WebEngineView.ViewSource
- Show the source of the current page in a new tab. Requires a handler for the
- \l newViewRequested() signal. (Added in Qt 5.8)
-
- \value WebEngineView.ToggleBold
- Toggles boldness for the selection or at the cursor position.
- Requires \c contenteditable="true". (Added in Qt 5.10)
- \value WebEngineView.ToggleItalic
- Toggles italics for the selection or at the cursor position.
- Requires \c contenteditable="true". (Added in Qt 5.10)
- \value WebEngineView.ToggleUnderline
- Toggles underlining of the selection or at the cursor position.
- Requires \c contenteditable="true". (Added in Qt 5.10)
- \value WebEngineView.ToggleStrikethrough
- Toggles striking through the selection or at the cursor position.
- Requires \c contenteditable="true". (Added in Qt 5.10)
-
- \value WebEngineView.AlignLeft
- Aligns the lines containing the selection or the cursor to the left.
- Requires \c contenteditable="true". (Added in Qt 5.10)
- \value WebEngineView.AlignCenter
- Aligns the lines containing the selection or the cursor at the center.
- Requires \c contenteditable="true". (Added in Qt 5.10)
- \value WebEngineView.AlignRight
- Aligns the lines containing the selection or the cursor to the right.
- Requires \c contenteditable="true". (Added in Qt 5.10)
- \value WebEngineView.AlignJustified
- Stretches the lines containing the selection or the cursor so that each
- line has equal width.
- Requires \c contenteditable="true". (Added in Qt 5.10)
- \value WebEngineView.Indent
- Indents the lines containing the selection or the cursor.
- Requires \c contenteditable="true". (Added in Qt 5.10)
- \value WebEngineView.Outdent
- Outdents the lines containing the selection or the cursor.
- Requires \c contenteditable="true". (Added in Qt 5.10)
-
- \value WebEngineView.InsertOrderedList
- Inserts an ordered list at the current cursor position, deleting the current selection.
- Requires \c contenteditable="true". (Added in Qt 5.10)
- \value WebEngineView.InsertUnorderedList
- Inserts an unordered list at the current cursor position,
- deleting the current selection.
- Requires \c contenteditable="true". (Added in Qt 5.10)
- \omitvalue WebActionCount
-*/
-
-/*!
- \qmlproperty enumeration WebEngineView::Feature
-
- Describes the platform feature access categories that the user may be asked to grant or deny
- access to:
-
- \value WebEngineView.Geolocation
- Location hardware or service.
- \value WebEngineView.MediaAudioCapture
- Audio capture devices, such as microphones.
- \value WebEngineView.MediaVideoCapture
- Video devices, such as cameras.
- \value WebEngineView.MediaAudioVideoCapture
- Both audio and video capture devices.
- \value DesktopVideoCapture
- Video output capture, that is, the capture of the user's display.
- (Added in Qt 5.10)
- \value DesktopAudioVideoCapture
- Both audio and video output capture. (Added in Qt 5.10)
- \value WebEnginView.Notifications
- Web notifications for the end-user.
-
- \sa featurePermissionRequested(), grantFeaturePermission()
-*/
-
-/*!
- \qmlproperty enumeration WebEngineView::PrintedPageSizeId
- \since QtWebEngine 1.3
-
- This enum type lists the available page sizes as defined in the Postscript
- PPD standard.
-
- The enumeration values are mapped from and must match QPageSize::PageSizeId. They are also
- duplicated in QPagedPaintDevice and QPrinter.
-
- The defined sizes are:
-
- \value WebEngineView.A0 841 x 1189 mm
- \value WebEngineView.A1 594 x 841 mm
- \value WebEngineView.A2 420 x 594 mm
- \value WebEngineView.A3 297 x 420 mm
- \value WebEngineView.A4 210 x 297 mm, 8.26 x 11.69 inches
- \value WebEngineView.A5 148 x 210 mm
- \value WebEngineView.A6 105 x 148 mm
- \value WebEngineView.A7 74 x 105 mm
- \value WebEngineView.A8 52 x 74 mm
- \value WebEngineView.A9 37 x 52 mm
- \value WebEngineView.B0 1000 x 1414 mm
- \value WebEngineView.B1 707 x 1000 mm
- \value WebEngineView.B2 500 x 707 mm
- \value WebEngineView.B3 353 x 500 mm
- \value WebEngineView.B4 250 x 353 mm
- \value WebEngineView.B5 176 x 250 mm, 6.93 x 9.84 inches
- \value WebEngineView.B6 125 x 176 mm
- \value WebEngineView.B7 88 x 125 mm
- \value WebEngineView.B8 62 x 88 mm
- \value WebEngineView.B9 44 x 62 mm
- \value WebEngineView.B10 31 x 44 mm
- \value WebEngineView.C5E 163 x 229 mm
- \value WebEngineView.Comm10E 105 x 241 mm, U.S. Common 10 Envelope
- \value WebEngineView.DLE 110 x 220 mm
- \value WebEngineView.Executive 7.5 x 10 inches, 190.5 x 254 mm
- \value WebEngineView.Folio 210 x 330 mm
- \value WebEngineView.Ledger 431.8 x 279.4 mm
- \value WebEngineView.Legal 8.5 x 14 inches, 215.9 x 355.6 mm
- \value WebEngineView.Letter 8.5 x 11 inches, 215.9 x 279.4 mm
- \value WebEngineView.Tabloid 279.4 x 431.8 mm
- \value WebEngineView.Custom Unknown, or a user defined size.
- \value WebEngineView.A10
- \value WebEngineView.A3Extra
- \value WebEngineView.A4Extra
- \value WebEngineView.A4Plus
- \value WebEngineView.A4Small
- \value WebEngineView.A5Extra
- \value WebEngineView.B5Extra
- \value WebEngineView.JisB0
- \value WebEngineView.JisB1
- \value WebEngineView.JisB2
- \value WebEngineView.JisB3
- \value WebEngineView.JisB4
- \value WebEngineView.JisB5
- \value WebEngineView.JisB6
- \value WebEngineView.JisB7
- \value WebEngineView.JisB8
- \value WebEngineView.JisB9
- \value WebEngineView.JisB10
- \value WebEngineView.AnsiA = \c Letter
- \value WebEngineView.AnsiB = \c Ledger
- \value WebEngineView.AnsiC
- \value WebEngineView.AnsiD
- \value WebEngineView.AnsiE
- \value WebEngineView.LegalExtra
- \value WebEngineView.LetterExtra
- \value WebEngineView.LetterPlus
- \value WebEngineView.LetterSmall
- \value WebEngineView.TabloidExtra
- \value WebEngineView.ArchA
- \value WebEngineView.ArchB
- \value WebEngineView.ArchC
- \value WebEngineView.ArchD
- \value WebEngineView.ArchE
- \value WebEngineView.Imperial7x9
- \value WebEngineView.Imperial8x10
- \value WebEngineView.Imperial9x11
- \value WebEngineView.Imperial9x12
- \value WebEngineView.Imperial10x11
- \value WebEngineView.Imperial10x13
- \value WebEngineView.Imperial10x14
- \value WebEngineView.Imperial12x11
- \value WebEngineView.Imperial15x11
- \value WebEngineView.ExecutiveStandard
- \value WebEngineView.Note
- \value WebEngineView.Quarto
- \value WebEngineView.Statement
- \value WebEngineView.SuperA
- \value WebEngineView.SuperB
- \value WebEngineView.Postcard
- \value WebEngineView.DoublePostcard
- \value WebEngineView.Prc16K
- \value WebEngineView.Prc32K
- \value WebEngineView.Prc32KBig
- \value WebEngineView.FanFoldUS
- \value WebEngineView.FanFoldGerman
- \value WebEngineView.FanFoldGermanLegal
- \value WebEngineView.EnvelopeB4
- \value WebEngineView.EnvelopeB5
- \value WebEngineView.EnvelopeB6
- \value WebEngineView.EnvelopeC0
- \value WebEngineView.EnvelopeC1
- \value WebEngineView.EnvelopeC2
- \value WebEngineView.EnvelopeC3
- \value WebEngineView.EnvelopeC4
- \value WebEngineView.EnvelopeC5 = \c C5E
- \value WebEngineView.EnvelopeC6
- \value WebEngineView.EnvelopeC65
- \value WebEngineView.EnvelopeC7
- \value WebEngineView.EnvelopeDL = \c DLE
- \value WebEngineView.Envelope9
- \value WebEngineView.Envelope10 = \c Comm10E
- \value WebEngineView.Envelope11
- \value WebEngineView.Envelope12
- \value WebEngineView.Envelope14
- \value WebEngineView.EnvelopeMonarch
- \value WebEngineView.EnvelopePersonal
- \value WebEngineView.EnvelopeChou3
- \value WebEngineView.EnvelopeChou4
- \value WebEngineView.EnvelopeInvite
- \value WebEngineView.EnvelopeItalian
- \value WebEngineView.EnvelopeKaku2
- \value WebEngineView.EnvelopeKaku3
- \value WebEngineView.EnvelopePrc1
- \value WebEngineView.EnvelopePrc2
- \value WebEngineView.EnvelopePrc3
- \value WebEngineView.EnvelopePrc4
- \value WebEngineView.EnvelopePrc5
- \value WebEngineView.EnvelopePrc6
- \value WebEngineView.EnvelopePrc7
- \value WebEngineView.EnvelopePrc8
- \value WebEngineView.EnvelopePrc9
- \value WebEngineView.EnvelopePrc10
- \value WebEngineView.EnvelopeYou4
- \value WebEngineView.LastPageSize = \c EnvelopeYou4
- \omitvalue NPageSize
- \omitvalue NPaperSize
-
- \sa WebEngineView::printToPdf()
-*/
-
-/*!
- \qmlproperty enumeration WebEngineView::PrintedPageOrientation
- \since QtWebEngine 1.3
-
- Describes the orientation of a PDF document that gets created from the WebEngineView's contents.
- The enumeration values are mapped from and must match QPageLayout::Orientation.
-
- \value WebEngineView.Portrait
- The document will be created using portrait orientation.
-
- \value WebEngineView.Landscape
- The document will be created using landscape orientation.
-
- \sa WebEngineView::printToPdf()
-*/
-
-/*!
- \qmlproperty bool WebEngineView::activeFocusOnPress
- \since QtWebEngine 1.2
-
- Specifies whether the view should gain active focus when pressed.
- The default value is \c true.
-*/
-
-/*!
- \qmlproperty bool WebEngineView::backgroundColor
- \since QtWebEngine 1.2
-
- Changes the color of the WebEngineView's background, behind the document's
- body. Can be set to \c "transparent" or to a translucent color to see
- through the document or to match the web content in a hybrid app to prevent
- the white flashes that may appear during loading.
-
- The default value is white.
-*/
-
-/*!
- \qmltype FullScreenRequest
- \instantiates QQuickWebEngineFullScreenRequest
- \inqmlmodule QtWebEngine
- \since QtWebEngine 1.1
-
- \brief A utility type for the WebEngineView::fullScreenRequested() signal.
-
- \sa WebEngineView::fullScreenRequested()
-*/
-
-/*!
- \qmlproperty url FullScreenRequest::origin
- \readonly
- The URL of the web page that issued the fullscreen request.
-*/
-
-/*!
- \qmlproperty bool FullScreenRequest::toggleOn
- \readonly
-
- Returns \c{true} if the application should toggle fullscreen mode on, \c{false} otherwise.
-
- \sa accept()
-*/
-
-/*!
- \qmlmethod void FullScreenRequest::accept()
-
- Call this method to accept the fullscreen request. It sets the WebEngineView::isFullScreen
- property to be equal to toggleOn.
-
- \qml
- ApplicationWindow {
- id: window
- WebEngineView {
- onFullScreenRequested: function(request) {
- if (request.toggleOn)
- window.showFullScreen()
- else
- window.showNormal()
- request.accept()
- }
- }
- }
- \endqml
-
- \sa toggleOn
-*/
-
-/*!
- \qmlmethod void FullScreenRequest::reject()
- Rejects a fullscreen request.
-*/
-
-/*!
- \qmlproperty bool WebEngineView::audioMuted
- \brief The state of whether the current page audio is muted.
- \since QtWebEngine 1.3
- \sa recentlyAudible
-*/
-
-/*!
- \qmlsignal WebEngineView::audioMutedChanged(bool muted)
- \since QtWebEngine 1.3
-
- This signal is emitted when the value of \a muted changes. The value is
- specified using the \l audioMuted property.
- \note Not to be confused with a specific HTML5 audio / video element being muted.
-
- \sa audioMuted, recentlyAudibleChanged
-*/
-
-/*!
- \qmlproperty bool WebEngineView::recentlyAudible
- \brief Returns the current page's audible state (audio was recently played, or not).
- \since QtWebEngine 1.3
- \readonly
- \sa audioMuted, recentlyAudibleChanged
-*/
-
-/*!
- \qmlsignal WebEngineView::recentlyAudibleChanged(bool recentlyAudible)
- \since QtWebEngine 1.3
-
- This signal is emitted when the page's audible state, specified by
- \a recentlyAudible, is changed, due to audio being played or stopped.
-
- \note The signal is also emitted when the \l audioMuted property changes.
- Also if the audio is paused, this signal is emitted with an approximate \b{two-second
- delay}, from the moment the audio is paused.
-
- This signal is also emitted for Flash plugin audio.
-
- If a web page contains two videos that are started in sequence, this signal
- gets emitted only once, for the first video to generate sound. After both
- videos are stopped, the signal is emitted upon the last sound generated.
- This means that the signal is emitted both when any kind of sound is
- generated and when everything is completely silent within a web page,
- regardless of the number of audio streams.
-
- Spurious signal emissions might also happen. For example, when sound is
- stopped, this signal gets emitted first with a value of \c true, and then
- with a value of \c false. Further, when audio starts playing, the signal is
- emitted twice with a value of \c true.
-
- \sa recentlyAudible
-*/
-
-/*!
- \qmlsignal WebEngineView::pdfPrintingFinished(string filePath, bool success)
- \since QtWebEngine 1.5
-
- This signal is emitted when printing the web page into a PDF file has
- finished.
- \a filePath will contain the path the file was requested to be created
- at, and \a success will be \c true if the file was successfully created and
- \c false otherwise.
-
- \sa printToPdf()
-*/
-
-/*!
- \qmlmethod void WebEngineView::printToPdf(const string filePath, PrintedPageSizeId pageSizeId, PrintedPageOrientation orientation)
- \since QtWebEngine 1.3
-
- Prints the WebEngineView's current content to a PDF document and stores it
- under \a filePath. The document's size will be determined by the value of
- \a pageSizeId and its orientation will be determined using \a orientation.
-
- This method issues an asynchronous request for printing the web page into a
- PDF and returns immediately. To be informed about the result of the
- request, connect to the signal pdfPrintingFinished().
-
- If you leave out \a pageSizeId, it defaults to \c A4. If you leave out
- \a orientation, it defaults to \c Portrait.
-
- \sa pdfPrintingFinished()
-*/
-
-/*!
- \qmlmethod void WebEngineView::printToPdf(variant resultCallback, PrintedPageSizeId pageSizeId, PrintedPageOrientation orientation)
- \since QtWebEngine 1.3
-
- Prints the WebEngineView's current content to a PDF document and returns it in a byte array. The document's size will be determined
- by the value of \a pageSizeId and its orientation will be determined using \a orientation.
-
- The \a resultCallback must take a string parameter. This string will contain the document's data upon successful printing and an empty
- string otherwise.
-
- If you leave out \a pageSizeId, it defaults to \c A4. If you leave out
- \a orientation, it defaults to \c Portrait.
-*/
-
-/*!
- \qmlmethod void WebEngineView::replaceMisspelledWord(const QString &replacement)
- \since QtWebEngine 1.3
-
- Replace the current misspelled word with \a replacement.
-*/
-
-/*!
- \qmlsignal WebEngineView::wasRecentlyAudibleChanged(bool wasRecentlyAudible)
- \since QtWebEngine 1.3
-
- This signal is emitted when the page's audible state, specified by
- \a wasRecentlyAudible, is changed, due to audio being played or stopped.
-
- \note The signal is also emitted when calling the setAudioMuted method.
- Also if the audio is paused, this signal is emitted with an approximate \b{2 second
- delay}, from the moment the audio is paused.
-*/
-
-/*!
- \qmlsignal WebEngineView::authenticationDialogRequested(AuthenticationDialogRequest request)
- \since QtWebEngine 1.4
-
- This signal is emitted when an authentication dialog is requested.
-
- The \a request can be handled by using the methods of the AuthenticationDialogRequest
- type.
-
- \note Signal handlers need to call \c{request.accepted = true} to prevent a
- default dialog from showing up. Make sure to call either
- AuthenticationDialogRequest::dialogAccept() or AuthenticationDialogRequest::dialogReject()
- afterwards.
-*/
-
-/*!
- \qmlsignal WebEngineView::javaScriptDialogRequested(JavaScriptDialogRequest request)
- \since QtWebEngine 1.4
-
- This signal is emitted when a JavaScript dialog is requested.
-
- The \a request can be handled by using the methods of the JavaScriptDialogRequest
- type.
-
- \note Signal handlers need to call \c{request.accepted = true} to prevent a
- default dialog from showing up. Make sure to call either
- JavaScriptDialogRequest::dialogAccept() or JavaScriptDialogRequest::dialogReject()
- afterwards.
-*/
-
-/*!
- \qmlsignal WebEngineView::colorDialogRequested(ColorDialogRequest request)
- \since QtWebEngine 1.4
-
- This signal is emitted when a color picker dialog is requested.
-
- The \a request can be handled by using the methods of the ColorDialogRequest
- type.
-
- \note Signal handlers need to call \c{request.accepted = true} to prevent a
- default dialog from showing up. Make sure to call either
- ColorDialogRequest::dialogAccept() or ColorDialogRequest::dialogReject() afterwards.
-*/
-
-/*!
- \qmlsignal WebEngineView::fileDialogRequested(FileDialogRequest request)
- \since QtWebEngine 1.4
-
- This signal is emitted when a file picker dialog is requested.
-
- The \a request can be handled by using the methods of the FileDialogRequest
- type.
-
- \note Signal handlers need to call \c{request.accepted = true} to prevent a
- default dialog from showing up. Make sure to call either FileDialogRequest::dialogAccept()
- or FileDialogRequest::dialogReject() afterwards.
-*/
-
-/*!
- \qmlsignal WebEngineView::formValidationMessageRequested(FormValidationMessageRequest request)
- \since QtWebEngine 1.4
- \obsolete
-
- No longer used since 5.11, as Blink now renders Validation messages internally.
-*/
-
-/*!
- \qmlsignal WebEngineView::contextMenuRequested(ContextMenuRequest request)
- \since QtWebEngine 1.4
-
- This signal is emitted when a context menu is requested.
-
- The \a request can be handled by using the properties of the ContextMenuRequest
- type.
-
- \note Signal handlers need to call \c{request.accepted = true} to prevent a
- default context menu from showing up.
-*/
-
-/*! \qmlsignal WebEngineView::navigationRequested(WebEngineNavigationRequest request)
- This signal is emitted when the navigation request \a request is issued.
-*/
-
-/*!
- \qmlsignal WebEngineView::quotaRequested(QuotaRequest request)
- \since QtWebEngine 1.7
-
- This signal is emitted when the web page issues a \a request for a larger persistent storage
- than the application's current allocation in File System API. The default quota
- is 0 bytes.
-
- \sa QuotaRequest
-*/
-
-/*!
- \qmltype QuotaRequest
- \instantiates QWebEngineQuotaRequest
- \inqmlmodule QtWebEngine
- \since QtWebEngine 1.7
-
- \brief A utility type for the WebEngineView::quotaRequested() signal.
-
- \sa WebEngineView::quotaRequested()
-*/
-
-/*!
- \qmlproperty url QuotaRequest::origin
- \readonly
-
- The URL of the web page that issued the quota request.
-*/
-
-/*!
- \qmlproperty qint64 QuotaRequest::requestedSize
- \readonly
-
- Contains the size of the requested disk space in bytes.
-*/
-
-/*!
- \qmlmethod void QuotaRequest::accept()
-
- Accepts the quota request.
-
- \qml
- WebEngineView {
- onQuotaRequested: function(request) {
- if (request.requestedSize <= 5 * 1024 * 1024)
- request.accept();
- else
- request.reject();
- }
- }
- \endqml
-*/
-
-/*!
- \qmlmethod void QuotaRequest::reject()
- Rejects the quota request.
-*/
-
-/*!
- \qmlsignal WebEngineView::registerProtocolHandlerRequested(RegisterProtocolHandlerRequest request)
- \since QtWebEngine 1.7
-
- This signal is emitted when the web page tries to register a custom protocol
- by issuing a \l registerProtocolHandler \a request.
-
- \sa RegisterProtocolHandlerRequest
-*/
-
-/*!
- \qmltype RegisterProtocolHandlerRequest
- \instantiates QWebEngineRegisterProtocolHandlerRequest
- \inqmlmodule QtWebEngine
- \since QtWebEngine 1.7
- \brief The RegisterProtocolHandlerRequest type enables accepting
- or rejecting requests from the \l registerProtocolHandler API.
-
- \sa WebEngineView::registerProtocolHandlerRequested()
-*/
-
-/*!
- \qmlproperty url RegisterProtocolHandlerRequest::origin
- \brief The URL template for the protocol handler.
-
- This is the second parameter from the \l registerProtocolHandler call.
-*/
-
-/*!
- \qmlproperty string RegisterProtocolHandlerRequest::scheme
- \brief The URL scheme for the protocol handler.
-
- This is the first parameter from the \l registerProtocolHandler call.
-*/
-
-/*!
- \qmlmethod void RegisterProtocolHandlerRequest::accept()
- \brief Accepts the request.
-
- Subsequent calls to accept() and reject() are ignored.
-*/
-
-/*!
- \qmlmethod void RegisterProtocolHandlerRequest::reject()
- \brief Accepts the request.
-
- Subsequent calls to accept() and reject() are ignored.
-*/
-
-/*!
- \qmlsignal WebEngineView::geometryChangeRequested(rect geometry, rect frameGeometry)
- \since QtWebEngine 1.7
-
- This signal is emitted whenever the document wants to change the position and size of the
- page to \a frameGeometry. This can happen for example through JavaScript.
-
- While \a frameGeometry includes, \a geometry excludes the size of frame margins.
-
- \note Geometry related properties of QML Window expect a size excluding the window
- decoration. You have to use \a geometry to handle this signal correctly.
-
- \qml
- onGeometryChangeRequested: {
- window.x = geometry.x
- window.y = geometry.y
- window.width = geometry.width
- window.height = geometry.height
- }
- \endqml
-*/
-
-/*!
- \qmlproperty WebEngineView WebEngineView::inspectedView
- \since QtWebEngine 1.7
-
- The view this view is currently inspecting, if any. Setting it
- will navigate to an internal URL with the developer tools of
- the view set.
-
- It is recommended to unset this property when developer tools
- are not visible; otherwise some debug information may appear
- in the inspected WebEngineView.
-
- \sa devToolsView
-*/
-
-/*!
- \qmlproperty WebEngineView WebEngineView::devToolsView
- \since QtWebEngine 1.7
-
- The view currently hosting the developer tools for this view.
- Setting it to a new view will navigate that view to an internal
- URL with the developer tools, and bind it to this view.
-
- \sa inspectedView
-*/
-
-/*!
- \qmlmethod WebEngineAction WebEngineView::action(WebAction action)
- \since 5.12
-
- Returns a \l WebEngineAction for the specified \l WebAction \a action.
- WebEngineView also takes care of implementing the action,
- so that upon triggering the corresponding action is performed on the view.
-
- \code
- var copyAction = webEngineView.action(WebEngineView.Copy);
- \endcode
-
- \sa WebEngineAction
-*/
-
-/*!
- \qmlsignal WebEngineView::printRequest
- \since QtWebEngine 1.8
-
- This signal is emitted when the JavaScript \c{window.print()} method is called.
- Typically, the signal handler can simply call printToPdf().
-
- \sa printToPdf
-*/
-
-/*!
- \qmlsignal WebEngineView::selectClientCertificate(WebEngineClientCertificateSelection clientCertificateSelection)
- \since QtWebEngine 1.9
-
- This signal is emitted when a web site requests an SSL client certificate, and one or more were
- found in the system's client certificate store.
-
- Handling the signal is asynchronous, and loading will be waiting until a certificate is selected,
- or the last copy of \a clientCertificateSelection is destroyed.
-
- If the signal is not handled, \a clientCertificateSelection is automatically destroyed, and loading
- will continue without a client certificate.
-
- \sa WebEngineClientCertificateSelection
-*/
-
-/*!
- \qmlsignal WebEngineView::tooltipRequested(TooltipRequest request)
- \since QtWebEngine 1.10
-
- This signal is emitted when the web page sends a \a request to show a tooltip at
- a specified position.
-
- \note Signal handlers need to call \c{request.accepted = true} to prevent a default tooltip from showing up.
-
- \sa TooltipRequest
-*/
-
-/*!
- \qmlproperty enumeration WebEngineView::LifecycleState
- \since QtWebEngine 1.10
-
- This enum describes the lifecycle state of the page:
-
- \value WebEngineView.LifecycleState.Active
- Normal state.
- \value WebEngineView.LifecycleState.Frozen
- Low CPU usage state where most HTML task sources are suspended.
- \value WebEngineView.LifecycleState.Discarded
- Very low resource usage state where the entire browsing context is discarded.
-
- \sa lifecycleState, {Page Lifecycle API}, {WebEngine Lifecycle Example}
-*/
-
-/*!
- \qmlproperty LifecycleState WebEngineView::lifecycleState
- \since QtWebEngine 1.10
-
- \brief The current lifecycle state of the page.
-
- The following restrictions are enforced by the setter:
-
- \list
- \li A visible page must remain in the \c{Active} state.
- \li If the page is being inspected by a \l{devToolsView} then both pages must
- remain in the \c{Active} states.
- \li A page in the \c{Discarded} state can only transition to the \c{Active}
- state. This will cause a reload of the page.
- \endlist
-
- These are the only hard limits on the lifecycle state, but see also
- \l{recommendedState} for the recommended soft limits.
-
- \sa recommendedState, {Page Lifecycle API}, {WebEngine Lifecycle Example}
-*/
-
-/*!
- \qmlproperty LifecycleState WebEngineView::recommendedState
- \since QtWebEngine 1.10
-
- \brief The recommended limit for the lifecycle state of the page.
-
- Setting the lifecycle state to a lower resource usage state than the
- recommended state may cause side-effects such as stopping background audio
- playback or loss of HTML form input. Setting the lifecycle state to a higher
- resource state is however completely safe.
-
- \sa lifecycleState, {Page Lifecycle API}, {WebEngine Lifecycle Example}
-*/
-
-/*!
- \qmltype FindTextResult
- \instantiates QWebEngineFindTextResult
- \inqmlmodule QtWebEngine
- \since QtWebEngine 1.10
-
- \brief A utility type for encapsulating the result of a string search on a page.
-
- \sa WebEngineView::findTextFinished()
-*/
-
-/*!
- \qmlproperty int FindTextResult::numberOfMatches
- \readonly
-
- \brief The number of matches found.
-*/
-
-/*!
- \qmlproperty int FindTextResult::activeMatch
- \readonly
-
- \brief The index of the currently highlighted match.
-*/
-
-/*!
- \qmlsignal WebEngineView::findTextFinished(FindTextResult result)
- \since QtWebEngine 1.10
-
- This signal is emitted when a string search on a page is completed. \a result is
- the result of the string search.
-
- \sa findText(), FindTextResult
-*/
-
-/*!
- \qmlproperty qint64 WebEngineView::renderProcessPid
- \brief Returns the process ID (PID) of the render process assigned to the
- current page's main frame.
- \since QtWebEngine 1.11
- \readonly
-
- If no render process is available yet, \c 0 is returned.
-
- \sa renderProcessPidChanged
-*/
-
-/*!
- \qmlsignal WebEngineView::renderProcessPidChanged(qint64 pid)
- \since QtWebEngine 1.11
- \readonly
-
- If no render process is available yet, \c 0 is returned.
- This signal is emitted when the PID (process ID) of the page's underlying
- render process changed.
-
- \sa renderProcessPid
-*/
diff --git a/src/webengine/module.pro b/src/webengine/module.pro
deleted file mode 100644
index 49a1086b2..000000000
--- a/src/webengine/module.pro
+++ /dev/null
@@ -1,94 +0,0 @@
-include($$QTWEBENGINE_OUT_ROOT/src/webengine/qtwebengine-config.pri)
-QT_FOR_CONFIG += webengine-private
-
-TARGET = QtWebEngine
-MODULE = webengine
-
-# For our export macros
-DEFINES += QT_BUILD_WEBENGINE_LIB
-
-QT += qml quick webenginecore
-QT_PRIVATE += quick-private gui-private core-private webenginecore-private
-
-QMAKE_DOCS = $$PWD/doc/qtwebengine.qdocconf
-
-INCLUDEPATH += $$PWD api ../core ../core/api
-
-SOURCES = \
- api/qquickwebengineaction.cpp \
- api/qquickwebenginecertificateerror.cpp \
- api/qquickwebengineclientcertificateselection.cpp \
- api/qquickwebenginecontextmenurequest.cpp \
- api/qquickwebenginedialogrequests.cpp \
- api/qquickwebenginedownloaditem.cpp \
- api/qquickwebenginehistory.cpp \
- api/qquickwebenginefaviconprovider.cpp \
- api/qquickwebengineloadrequest.cpp \
- api/qquickwebenginenavigationrequest.cpp \
- api/qquickwebenginenewviewrequest.cpp \
- api/qquickwebengineprofile.cpp \
- api/qquickwebenginescript.cpp \
- api/qquickwebenginesettings.cpp \
- api/qquickwebenginesingleton.cpp \
- api/qquickwebenginetouchhandleprovider.cpp \
- api/qquickwebengineview.cpp \
- api/qtwebengineglobal.cpp \
- render_widget_host_view_qt_delegate_quick.cpp \
- render_widget_host_view_qt_delegate_quickwindow.cpp \
- ui_delegates_manager.cpp
-
-HEADERS = \
- api/qtwebengineglobal.h \
- api/qtwebengineglobal_p.h \
- api/qquickwebengineaction_p.h \
- api/qquickwebengineaction_p_p.h \
- api/qquickwebenginecertificateerror_p.h \
- api/qquickwebengineclientcertificateselection_p.h \
- api/qquickwebenginecontextmenurequest_p.h \
- api/qquickwebenginedialogrequests_p.h \
- api/qquickwebenginedownloaditem_p.h \
- api/qquickwebenginedownloaditem_p_p.h \
- api/qquickwebenginehistory_p.h \
- api/qquickwebenginefaviconprovider_p_p.h \
- api/qquickwebengineloadrequest_p.h \
- api/qquickwebenginenavigationrequest_p.h \
- api/qquickwebenginenewviewrequest_p.h \
- api/qquickwebengineprofile.h \
- api/qquickwebengineprofile_p.h \
- api/qquickwebenginescript.h \
- api/qquickwebenginescript_p.h \
- api/qquickwebenginesettings_p.h \
- api/qquickwebenginesingleton_p.h \
- api/qquickwebenginetouchhandleprovider_p_p.h \
- api/qquickwebengineview_p.h \
- api/qquickwebengineview_p_p.h \
- render_widget_host_view_qt_delegate_quick.h \
- render_widget_host_view_qt_delegate_quickwindow.h \
- ui_delegates_manager.h
-
-qtConfig(webengine-testsupport) {
- QT_PRIVATE += testlib
- SOURCES += api/qquickwebenginetestsupport.cpp
- HEADERS += api/qquickwebenginetestsupport_p.h
-}
-
-!build_pass {
- python = $$pythonPathForShell()
- chromium_attributions.commands = \
- cd $$shell_quote($$shell_path($$PWD/../3rdparty)) && \
- $$python chromium/tools/licenses.py \
- --file-template ../../tools/about_credits.tmpl \
- --entry-template ../../tools/about_credits_entry.tmpl credits \
- $$shell_quote($$shell_path($$OUT_PWD/chromium_attributions.qdoc))
- chromium_attributions.CONFIG += phony
-
- QMAKE_EXTRA_TARGETS += chromium_attributions
-
- prepare_docs {
- prepare_docs.depends += chromium_attributions
- } else {
- html_docs.depends += chromium_attributions
- }
-}
-
-load(qt_module)
diff --git a/src/webengine/plugin/dependencies.json b/src/webengine/plugin/dependencies.json
deleted file mode 100644
index ef26b3617..000000000
--- a/src/webengine/plugin/dependencies.json
+++ /dev/null
@@ -1,7 +0,0 @@
-[
- {
- "name": "QtQuick",
- "type": "module",
- "version": "2.8"
- }
-]
diff --git a/src/webengine/plugin/plugin.cpp b/src/webengine/plugin/plugin.cpp
deleted file mode 100644
index a74373b23..000000000
--- a/src/webengine/plugin/plugin.cpp
+++ /dev/null
@@ -1,190 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtQml/qqmlextensionplugin.h>
-#include <QtWebEngine/QQuickWebEngineProfile>
-
-#include <QtWebEngine/private/qquickwebenginecertificateerror_p.h>
-#include <QtWebEngine/private/qquickwebengineclientcertificateselection_p.h>
-#include <QtWebEngine/private/qquickwebenginecontextmenurequest_p.h>
-#include <QtWebEngine/private/qquickwebenginedialogrequests_p.h>
-#include <QtWebEngine/private/qquickwebenginedownloaditem_p.h>
-#include <QtWebEngine/private/qquickwebenginehistory_p.h>
-#include <QtWebEngine/private/qquickwebenginefaviconprovider_p_p.h>
-#include <QtWebEngine/private/qquickwebengineloadrequest_p.h>
-#include <QtWebEngine/private/qquickwebenginenavigationrequest_p.h>
-#include <QtWebEngine/private/qquickwebenginenewviewrequest_p.h>
-#include <QtWebEngine/private/qquickwebenginesettings_p.h>
-#include <QtWebEngine/private/qquickwebenginesingleton_p.h>
-#include <QtWebEngine/private/qquickwebenginetouchhandleprovider_p_p.h>
-#include <QtWebEngine/private/qquickwebengineview_p.h>
-#include <QtWebEngine/private/qquickwebengineaction_p.h>
-#include <QtWebEngineCore/qwebenginefindtextresult.h>
-#include <QtWebEngineCore/qwebenginenotification.h>
-#include <QtWebEngineCore/qwebenginequotarequest.h>
-#include <QtWebEngineCore/qwebengineregisterprotocolhandlerrequest.h>
-
-QT_BEGIN_NAMESPACE
-
-static QObject *webEngineSingletonProvider(QQmlEngine *, QJSEngine *)
-{
- return new QQuickWebEngineSingleton;
-}
-
-class QtWebEnginePlugin : public QQmlExtensionPlugin
-{
- Q_OBJECT
- Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
-public:
- void initializeEngine(QQmlEngine *engine, const char *uri) override
- {
- Q_UNUSED(uri);
- engine->addImageProvider(QQuickWebEngineFaviconProvider::identifier(), new QQuickWebEngineFaviconProvider);
- engine->addImageProvider(QQuickWebEngineTouchHandleProvider::identifier(), new QQuickWebEngineTouchHandleProvider);
- }
-
- void registerTypes(const char *uri) override
- {
- Q_ASSERT(QLatin1String(uri) == QLatin1String("QtWebEngine"));
-
- qmlRegisterType<QQuickWebEngineView>(uri, 1, 0, "WebEngineView");
- qmlRegisterUncreatableType<QQuickWebEngineLoadRequest>(uri, 1, 0, "WebEngineLoadRequest", msgUncreatableType("WebEngineLoadRequest"));
- qmlRegisterUncreatableType<QQuickWebEngineNavigationRequest>(uri, 1, 0, "WebEngineNavigationRequest", msgUncreatableType("WebEngineNavigationRequest"));
-
- qmlRegisterType<QQuickWebEngineView, 1>(uri, 1, 1, "WebEngineView");
- qmlRegisterType<QQuickWebEngineView, 2>(uri, 1, 2, "WebEngineView");
- qmlRegisterType<QQuickWebEngineView, 3>(uri, 1, 3, "WebEngineView");
- qmlRegisterType<QQuickWebEngineView, 4>(uri, 1, 4, "WebEngineView");
- qmlRegisterType<QQuickWebEngineView, 5>(uri, 1, 5, "WebEngineView");
- qmlRegisterType<QQuickWebEngineView, 6>(uri, 1, 6, "WebEngineView");
- qmlRegisterType<QQuickWebEngineView, 7>(uri, 1, 7, "WebEngineView");
- qmlRegisterType<QQuickWebEngineView, 8>(uri, 1, 8, "WebEngineView");
- qmlRegisterType<QQuickWebEngineView, 9>(uri, 1, 9, "WebEngineView");
- qmlRegisterType<QQuickWebEngineView, 10>(uri, 1, 10, "WebEngineView");
- qmlRegisterType<QQuickWebEngineView, 11>(uri, 1, 11, "WebEngineView");
- qmlRegisterType<QQuickWebEngineProfile>(uri, 1, 1, "WebEngineProfile");
- qmlRegisterType<QQuickWebEngineProfile, 1>(uri, 1, 2, "WebEngineProfile");
- qmlRegisterType<QQuickWebEngineProfile, 2>(uri, 1, 3, "WebEngineProfile");
- qmlRegisterType<QQuickWebEngineProfile, 3>(uri, 1, 4, "WebEngineProfile");
- qmlRegisterType<QQuickWebEngineProfile, 4>(uri, 1, 5, "WebEngineProfile");
- qmlRegisterType<QQuickWebEngineProfile, 5>(uri, 1, 9, "WebEngineProfile");
- qmlRegisterType<QQuickWebEngineScript>(uri, 1, 1, "WebEngineScript");
- qmlRegisterUncreatableType<QQuickWebEngineCertificateError>(uri, 1, 1, "WebEngineCertificateError", msgUncreatableType("WebEngineCertificateError"));
- qmlRegisterUncreatableType<QQuickWebEngineDownloadItem>(uri, 1, 1, "WebEngineDownloadItem",
- msgUncreatableType("WebEngineDownloadItem"));
- qmlRegisterUncreatableType<QQuickWebEngineDownloadItem, 1>(uri, 1, 2, "WebEngineDownloadItem",
- msgUncreatableType("WebEngineDownloadItem"));
- qmlRegisterUncreatableType<QQuickWebEngineDownloadItem, 2>(uri, 1, 3, "WebEngineDownloadItem",
- msgUncreatableType("WebEngineDownloadItem"));
- qmlRegisterUncreatableType<QQuickWebEngineDownloadItem, 3>(uri, 1, 4, "WebEngineDownloadItem",
- msgUncreatableType("WebEngineDownloadItem"));
- qmlRegisterUncreatableType<QQuickWebEngineDownloadItem, 4>(uri, 1, 5, "WebEngineDownloadItem",
- msgUncreatableType("WebEngineDownloadItem"));
- qmlRegisterUncreatableType<QQuickWebEngineDownloadItem, 5>(uri, 1, 6, "WebEngineDownloadItem",
- msgUncreatableType("WebEngineDownloadItem"));
- qmlRegisterUncreatableType<QQuickWebEngineDownloadItem, 6>(uri, 1, 7, "WebEngineDownloadItem",
- msgUncreatableType("WebEngineDownloadItem"));
- qmlRegisterUncreatableType<QQuickWebEngineDownloadItem, 7>(uri, 1, 8, "WebEngineDownloadItem",
- msgUncreatableType("WebEngineDownloadItem"));
- qmlRegisterUncreatableType<QQuickWebEngineDownloadItem, 10>(uri, 1, 10, "WebEngineDownloadItem",
- msgUncreatableType("WebEngineDownloadItem"));
- qmlRegisterUncreatableType<QQuickWebEngineNewViewRequest>(uri, 1, 1, "WebEngineNewViewRequest", msgUncreatableType("WebEngineNewViewRequest"));
- qmlRegisterUncreatableType<QQuickWebEngineNewViewRequest, 1>(uri, 1, 5, "WebEngineNewViewRequest", tr("Cannot create separate instance of WebEngineNewViewRequest"));
- qmlRegisterUncreatableType<QQuickWebEngineSettings>(uri, 1, 1, "WebEngineSettings", msgUncreatableType("WebEngineSettings"));
- qmlRegisterUncreatableType<QQuickWebEngineSettings, 1>(uri, 1, 2, "WebEngineSettings", msgUncreatableType("WebEngineSettings"));
- qmlRegisterUncreatableType<QQuickWebEngineSettings, 2>(uri, 1, 3, "WebEngineSettings", msgUncreatableType("WebEngineSettings"));
- qmlRegisterUncreatableType<QQuickWebEngineSettings, 3>(uri, 1, 4, "WebEngineSettings", msgUncreatableType("WebEngineSettings"));
- qmlRegisterUncreatableType<QQuickWebEngineSettings, 4>(uri, 1, 5, "WebEngineSettings", msgUncreatableType("WebEngineSettings"));
- qmlRegisterUncreatableType<QQuickWebEngineSettings, 5>(uri, 1, 6, "WebEngineSettings", msgUncreatableType("WebEngineSettings"));
- qmlRegisterUncreatableType<QQuickWebEngineSettings, 6>(uri, 1, 7, "WebEngineSettings", msgUncreatableType("WebEngineSettings"));
- qmlRegisterUncreatableType<QQuickWebEngineSettings, 7>(uri, 1, 8, "WebEngineSettings", msgUncreatableType("WebEngineSettings"));
- qmlRegisterUncreatableType<QQuickWebEngineSettings, 8>(uri, 1, 9, "WebEngineSettings", msgUncreatableType("WebEngineSettings"));
- qmlRegisterSingletonType<QQuickWebEngineSingleton>(uri, 1, 1, "WebEngine", webEngineSingletonProvider);
- qmlRegisterUncreatableType<QQuickWebEngineHistory>(uri, 1, 1, "NavigationHistory",
- msgUncreatableType("NavigationHistory"));
- qmlRegisterUncreatableType<QQuickWebEngineHistory, 1>(uri, 1, 11, "NavigationHistory", msgUncreatableType("NavigationHistory"));
- qmlRegisterUncreatableType<QQuickWebEngineHistoryListModel>(uri, 1, 1, "NavigationHistoryListModel",
- msgUncreatableType("NavigationHistory"));
- qmlRegisterUncreatableType<QQuickWebEngineFullScreenRequest>(uri, 1, 1, "FullScreenRequest",
- msgUncreatableType("FullScreenRequest"));
-
- qmlRegisterUncreatableType<QQuickWebEngineContextMenuRequest>(uri, 1, 4, "ContextMenuRequest",
- msgUncreatableType("ContextMenuRequest"));
- qmlRegisterUncreatableType<QQuickWebEngineContextMenuRequest, 1>(uri, 1, 7, "ContextMenuRequest",
- msgUncreatableType("ContextMenuRequest"));
- qmlRegisterUncreatableType<QQuickWebEngineAuthenticationDialogRequest>(uri, 1, 4, "AuthenticationDialogRequest",
- msgUncreatableType("AuthenticationDialogRequest"));
- qmlRegisterUncreatableType<QQuickWebEngineJavaScriptDialogRequest>(uri, 1, 4, "JavaScriptDialogRequest",
- msgUncreatableType("JavaScriptDialogRequest"));
- qmlRegisterUncreatableType<QQuickWebEngineColorDialogRequest>(uri, 1, 4, "ColorDialogRequest",
- msgUncreatableType("ColorDialogRequest"));
- qmlRegisterUncreatableType<QQuickWebEngineFileDialogRequest>(uri, 1, 4, "FileDialogRequest",
- msgUncreatableType("FileDialogRequest"));
- qmlRegisterUncreatableType<QQuickWebEngineFormValidationMessageRequest>(uri, 1, 4, "FormValidationMessageRequest",
- msgUncreatableType("FormValidationMessageRequest"));
- qRegisterMetaType<QWebEngineQuotaRequest>();
- qmlRegisterUncreatableType<QWebEngineQuotaRequest>(uri, 1, 7, "QuotaRequest",
- msgUncreatableType("QuotaRequest"));
- qRegisterMetaType<QWebEngineRegisterProtocolHandlerRequest>();
- qmlRegisterUncreatableType<QWebEngineRegisterProtocolHandlerRequest>(uri, 1, 7, "RegisterProtocolHandlerRequest",
- msgUncreatableType("RegisterProtocolHandlerRequest"));
- qmlRegisterUncreatableType<QQuickWebEngineAction>(uri, 1, 8, "WebEngineAction", msgUncreatableType("WebEngineAction"));
-#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
- qmlRegisterUncreatableType<QQuickWebEngineClientCertificateSelection>(uri, 1, 9, "WebEngineClientCertificateSelection",
- msgUncreatableType("WebEngineClientCertificateSelection"));
- qmlRegisterUncreatableType<QQuickWebEngineClientCertificateOption>(uri, 1, 9, "WebEngineClientCertificateOption",
- msgUncreatableType("WebEngineClientCertificateOption"));
-#endif
- qmlRegisterUncreatableType<QWebEngineNotification>(uri, 1, 9, "WebEngineNotification", msgUncreatableType("WebEngineNotification"));
- qmlRegisterUncreatableType<QQuickWebEngineTooltipRequest>(uri, 1, 10, "TooltipRequest",
- msgUncreatableType("TooltipRequest"));
- qRegisterMetaType<QWebEngineFindTextResult>();
- qmlRegisterUncreatableType<QWebEngineFindTextResult>(uri, 1, 10, "FindTextResult", msgUncreatableType("FindTextResult"));
- }
-
-private:
- static QString msgUncreatableType(const char *className)
- {
- return tr("Cannot create separate instance of %1").arg(QLatin1String(className));
- }
-};
-
-QT_END_NAMESPACE
-
-#include "plugin.moc"
diff --git a/src/webengine/plugin/plugin.pro b/src/webengine/plugin/plugin.pro
deleted file mode 100644
index 3b30bece2..000000000
--- a/src/webengine/plugin/plugin.pro
+++ /dev/null
@@ -1,12 +0,0 @@
-CXX_MODULE = qml
-TARGET = qtwebengineplugin
-TARGETPATH = QtWebEngine
-IMPORT_VERSION = 1.10
-
-QT += qml quick
-QT_PRIVATE += core-private webenginecore-private webengine-private
-
-SOURCES = plugin.cpp
-
-QMAKE_QMLPLUGINDUMP_FLAGS = -defaultplatform
-load(qml_plugin)
diff --git a/src/webengine/plugin/plugins.qmltypes b/src/webengine/plugin/plugins.qmltypes
deleted file mode 100644
index 24b073290..000000000
--- a/src/webengine/plugin/plugins.qmltypes
+++ /dev/null
@@ -1,1705 +0,0 @@
-import QtQuick.tooling 1.2
-
-// This file describes the plugin-supplied types contained in the library.
-// It is used for QML tooling purposes only.
-//
-// This file was auto-generated by:
-// 'qmlplugindump -nonrelocatable -defaultplatform -dependencies dependencies.json QtWebEngine 1.10'
-
-Module {
- dependencies: ["QtQuick 2.8"]
- Component {
- name: "QAbstractItemModel"
- prototype: "QObject"
- Enum {
- name: "LayoutChangeHint"
- values: {
- "NoLayoutChangeHint": 0,
- "VerticalSortHint": 1,
- "HorizontalSortHint": 2
- }
- }
- Enum {
- name: "CheckIndexOption"
- values: {
- "NoOption": 0,
- "IndexIsValid": 1,
- "DoNotUseParent": 2,
- "ParentIsInvalid": 4
- }
- }
- Signal {
- name: "dataChanged"
- Parameter { name: "topLeft"; type: "QModelIndex" }
- Parameter { name: "bottomRight"; type: "QModelIndex" }
- Parameter { name: "roles"; type: "QVector<int>" }
- }
- Signal {
- name: "dataChanged"
- Parameter { name: "topLeft"; type: "QModelIndex" }
- Parameter { name: "bottomRight"; type: "QModelIndex" }
- }
- Signal {
- name: "headerDataChanged"
- Parameter { name: "orientation"; type: "Qt::Orientation" }
- Parameter { name: "first"; type: "int" }
- Parameter { name: "last"; type: "int" }
- }
- Signal {
- name: "layoutChanged"
- Parameter { name: "parents"; type: "QList<QPersistentModelIndex>" }
- Parameter { name: "hint"; type: "QAbstractItemModel::LayoutChangeHint" }
- }
- Signal {
- name: "layoutChanged"
- Parameter { name: "parents"; type: "QList<QPersistentModelIndex>" }
- }
- Signal { name: "layoutChanged" }
- Signal {
- name: "layoutAboutToBeChanged"
- Parameter { name: "parents"; type: "QList<QPersistentModelIndex>" }
- Parameter { name: "hint"; type: "QAbstractItemModel::LayoutChangeHint" }
- }
- Signal {
- name: "layoutAboutToBeChanged"
- Parameter { name: "parents"; type: "QList<QPersistentModelIndex>" }
- }
- Signal { name: "layoutAboutToBeChanged" }
- Signal {
- name: "rowsAboutToBeInserted"
- Parameter { name: "parent"; type: "QModelIndex" }
- Parameter { name: "first"; type: "int" }
- Parameter { name: "last"; type: "int" }
- }
- Signal {
- name: "rowsInserted"
- Parameter { name: "parent"; type: "QModelIndex" }
- Parameter { name: "first"; type: "int" }
- Parameter { name: "last"; type: "int" }
- }
- Signal {
- name: "rowsAboutToBeRemoved"
- Parameter { name: "parent"; type: "QModelIndex" }
- Parameter { name: "first"; type: "int" }
- Parameter { name: "last"; type: "int" }
- }
- Signal {
- name: "rowsRemoved"
- Parameter { name: "parent"; type: "QModelIndex" }
- Parameter { name: "first"; type: "int" }
- Parameter { name: "last"; type: "int" }
- }
- Signal {
- name: "columnsAboutToBeInserted"
- Parameter { name: "parent"; type: "QModelIndex" }
- Parameter { name: "first"; type: "int" }
- Parameter { name: "last"; type: "int" }
- }
- Signal {
- name: "columnsInserted"
- Parameter { name: "parent"; type: "QModelIndex" }
- Parameter { name: "first"; type: "int" }
- Parameter { name: "last"; type: "int" }
- }
- Signal {
- name: "columnsAboutToBeRemoved"
- Parameter { name: "parent"; type: "QModelIndex" }
- Parameter { name: "first"; type: "int" }
- Parameter { name: "last"; type: "int" }
- }
- Signal {
- name: "columnsRemoved"
- Parameter { name: "parent"; type: "QModelIndex" }
- Parameter { name: "first"; type: "int" }
- Parameter { name: "last"; type: "int" }
- }
- Signal { name: "modelAboutToBeReset" }
- Signal { name: "modelReset" }
- Signal {
- name: "rowsAboutToBeMoved"
- Parameter { name: "sourceParent"; type: "QModelIndex" }
- Parameter { name: "sourceStart"; type: "int" }
- Parameter { name: "sourceEnd"; type: "int" }
- Parameter { name: "destinationParent"; type: "QModelIndex" }
- Parameter { name: "destinationRow"; type: "int" }
- }
- Signal {
- name: "rowsMoved"
- Parameter { name: "parent"; type: "QModelIndex" }
- Parameter { name: "start"; type: "int" }
- Parameter { name: "end"; type: "int" }
- Parameter { name: "destination"; type: "QModelIndex" }
- Parameter { name: "row"; type: "int" }
- }
- Signal {
- name: "columnsAboutToBeMoved"
- Parameter { name: "sourceParent"; type: "QModelIndex" }
- Parameter { name: "sourceStart"; type: "int" }
- Parameter { name: "sourceEnd"; type: "int" }
- Parameter { name: "destinationParent"; type: "QModelIndex" }
- Parameter { name: "destinationColumn"; type: "int" }
- }
- Signal {
- name: "columnsMoved"
- Parameter { name: "parent"; type: "QModelIndex" }
- Parameter { name: "start"; type: "int" }
- Parameter { name: "end"; type: "int" }
- Parameter { name: "destination"; type: "QModelIndex" }
- Parameter { name: "column"; type: "int" }
- }
- Method { name: "submit"; type: "bool" }
- Method { name: "revert" }
- Method {
- name: "hasIndex"
- type: "bool"
- Parameter { name: "row"; type: "int" }
- Parameter { name: "column"; type: "int" }
- Parameter { name: "parent"; type: "QModelIndex" }
- }
- Method {
- name: "hasIndex"
- type: "bool"
- Parameter { name: "row"; type: "int" }
- Parameter { name: "column"; type: "int" }
- }
- Method {
- name: "index"
- type: "QModelIndex"
- Parameter { name: "row"; type: "int" }
- Parameter { name: "column"; type: "int" }
- Parameter { name: "parent"; type: "QModelIndex" }
- }
- Method {
- name: "index"
- type: "QModelIndex"
- Parameter { name: "row"; type: "int" }
- Parameter { name: "column"; type: "int" }
- }
- Method {
- name: "parent"
- type: "QModelIndex"
- Parameter { name: "child"; type: "QModelIndex" }
- }
- Method {
- name: "sibling"
- type: "QModelIndex"
- Parameter { name: "row"; type: "int" }
- Parameter { name: "column"; type: "int" }
- Parameter { name: "idx"; type: "QModelIndex" }
- }
- Method {
- name: "rowCount"
- type: "int"
- Parameter { name: "parent"; type: "QModelIndex" }
- }
- Method { name: "rowCount"; type: "int" }
- Method {
- name: "columnCount"
- type: "int"
- Parameter { name: "parent"; type: "QModelIndex" }
- }
- Method { name: "columnCount"; type: "int" }
- Method {
- name: "hasChildren"
- type: "bool"
- Parameter { name: "parent"; type: "QModelIndex" }
- }
- Method { name: "hasChildren"; type: "bool" }
- Method {
- name: "data"
- type: "QVariant"
- Parameter { name: "index"; type: "QModelIndex" }
- Parameter { name: "role"; type: "int" }
- }
- Method {
- name: "data"
- type: "QVariant"
- Parameter { name: "index"; type: "QModelIndex" }
- }
- Method {
- name: "setData"
- type: "bool"
- Parameter { name: "index"; type: "QModelIndex" }
- Parameter { name: "value"; type: "QVariant" }
- Parameter { name: "role"; type: "int" }
- }
- Method {
- name: "setData"
- type: "bool"
- Parameter { name: "index"; type: "QModelIndex" }
- Parameter { name: "value"; type: "QVariant" }
- }
- Method {
- name: "headerData"
- type: "QVariant"
- Parameter { name: "section"; type: "int" }
- Parameter { name: "orientation"; type: "Qt::Orientation" }
- Parameter { name: "role"; type: "int" }
- }
- Method {
- name: "headerData"
- type: "QVariant"
- Parameter { name: "section"; type: "int" }
- Parameter { name: "orientation"; type: "Qt::Orientation" }
- }
- Method {
- name: "fetchMore"
- Parameter { name: "parent"; type: "QModelIndex" }
- }
- Method {
- name: "canFetchMore"
- type: "bool"
- Parameter { name: "parent"; type: "QModelIndex" }
- }
- Method {
- name: "flags"
- type: "Qt::ItemFlags"
- Parameter { name: "index"; type: "QModelIndex" }
- }
- Method {
- name: "match"
- type: "QModelIndexList"
- Parameter { name: "start"; type: "QModelIndex" }
- Parameter { name: "role"; type: "int" }
- Parameter { name: "value"; type: "QVariant" }
- Parameter { name: "hits"; type: "int" }
- Parameter { name: "flags"; type: "Qt::MatchFlags" }
- }
- Method {
- name: "match"
- type: "QModelIndexList"
- Parameter { name: "start"; type: "QModelIndex" }
- Parameter { name: "role"; type: "int" }
- Parameter { name: "value"; type: "QVariant" }
- Parameter { name: "hits"; type: "int" }
- }
- Method {
- name: "match"
- type: "QModelIndexList"
- Parameter { name: "start"; type: "QModelIndex" }
- Parameter { name: "role"; type: "int" }
- Parameter { name: "value"; type: "QVariant" }
- }
- }
- Component { name: "QAbstractListModel"; prototype: "QAbstractItemModel" }
- Component {
- name: "QQuickWebEngineAction"
- prototype: "QObject"
- exports: ["QtWebEngine/WebEngineAction 1.8"]
- isCreatable: false
- exportMetaObjectRevisions: [0]
- Property { name: "text"; type: "string"; isReadonly: true }
- Property { name: "iconName"; type: "string"; isReadonly: true }
- Property { name: "enabled"; type: "bool"; isReadonly: true }
- Signal { name: "triggered" }
- Method { name: "trigger" }
- }
- Component {
- name: "QQuickWebEngineAuthenticationDialogRequest"
- prototype: "QObject"
- exports: ["QtWebEngine/AuthenticationDialogRequest 1.4"]
- isCreatable: false
- exportMetaObjectRevisions: [0]
- Enum {
- name: "AuthenticationType"
- values: {
- "AuthenticationTypeHTTP": 0,
- "AuthenticationTypeProxy": 1
- }
- }
- Property { name: "url"; type: "QUrl"; isReadonly: true }
- Property { name: "realm"; type: "string"; isReadonly: true }
- Property { name: "proxyHost"; type: "string"; isReadonly: true }
- Property { name: "type"; type: "AuthenticationType"; isReadonly: true }
- Property { name: "accepted"; type: "bool" }
- Method {
- name: "dialogAccept"
- Parameter { name: "user"; type: "string" }
- Parameter { name: "password"; type: "string" }
- }
- Method { name: "dialogReject" }
- }
- Component {
- name: "QQuickWebEngineCertificateError"
- prototype: "QObject"
- exports: ["QtWebEngine/WebEngineCertificateError 1.1"]
- isCreatable: false
- exportMetaObjectRevisions: [0]
- Enum {
- name: "Error"
- values: {
- "SslPinnedKeyNotInCertificateChain": -150,
- "CertificateCommonNameInvalid": -200,
- "CertificateDateInvalid": -201,
- "CertificateAuthorityInvalid": -202,
- "CertificateContainsErrors": -203,
- "CertificateNoRevocationMechanism": -204,
- "CertificateUnableToCheckRevocation": -205,
- "CertificateRevoked": -206,
- "CertificateInvalid": -207,
- "CertificateWeakSignatureAlgorithm": -208,
- "CertificateNonUniqueName": -210,
- "CertificateWeakKey": -211,
- "CertificateNameConstraintViolation": -212,
- "CertificateValidityTooLong": -213,
- "CertificateTransparencyRequired": -214
- }
- }
- Property { name: "url"; type: "QUrl"; isReadonly: true }
- Property { name: "error"; type: "Error"; isReadonly: true }
- Property { name: "description"; type: "string"; isReadonly: true }
- Property { name: "overridable"; type: "bool"; isReadonly: true }
- Method { name: "defer" }
- Method { name: "ignoreCertificateError" }
- Method { name: "rejectCertificate" }
- }
- Component {
- name: "QQuickWebEngineClientCertificateOption"
- prototype: "QObject"
- exports: ["QtWebEngine/WebEngineClientCertificateOption 1.9"]
- isCreatable: false
- exportMetaObjectRevisions: [0]
- Property { name: "issuer"; type: "string"; isReadonly: true }
- Property { name: "subject"; type: "string"; isReadonly: true }
- Property { name: "effectiveDate"; type: "QDateTime"; isReadonly: true }
- Property { name: "expiryDate"; type: "QDateTime"; isReadonly: true }
- Property { name: "isSelfSigned"; type: "bool"; isReadonly: true }
- Method { name: "select" }
- }
- Component {
- name: "QQuickWebEngineClientCertificateSelection"
- prototype: "QObject"
- exports: ["QtWebEngine/WebEngineClientCertificateSelection 1.9"]
- isCreatable: false
- exportMetaObjectRevisions: [0]
- Property { name: "host"; type: "QUrl"; isReadonly: true }
- Property {
- name: "certificates"
- type: "QQuickWebEngineClientCertificateOption"
- isList: true
- isReadonly: true
- }
- Method {
- name: "select"
- Parameter { name: "idx"; type: "int" }
- }
- Method {
- name: "select"
- Parameter {
- name: "certificate"
- type: "const QQuickWebEngineClientCertificateOption"
- isPointer: true
- }
- }
- Method { name: "selectNone" }
- }
- Component {
- name: "QQuickWebEngineColorDialogRequest"
- prototype: "QObject"
- exports: ["QtWebEngine/ColorDialogRequest 1.4"]
- isCreatable: false
- exportMetaObjectRevisions: [0]
- Property { name: "color"; type: "QColor"; isReadonly: true }
- Property { name: "accepted"; type: "bool" }
- Method {
- name: "dialogAccept"
- Parameter { name: "color"; type: "QColor" }
- }
- Method { name: "dialogReject" }
- }
- Component {
- name: "QQuickWebEngineContextMenuRequest"
- prototype: "QObject"
- exports: [
- "QtWebEngine/ContextMenuRequest 1.4",
- "QtWebEngine/ContextMenuRequest 1.7"
- ]
- isCreatable: false
- exportMetaObjectRevisions: [0, 1]
- Enum {
- name: "MediaType"
- values: {
- "MediaTypeNone": 0,
- "MediaTypeImage": 1,
- "MediaTypeVideo": 2,
- "MediaTypeAudio": 3,
- "MediaTypeCanvas": 4,
- "MediaTypeFile": 5,
- "MediaTypePlugin": 6
- }
- }
- Enum {
- name: "MediaFlags"
- values: {
- "MediaInError": 1,
- "MediaPaused": 2,
- "MediaMuted": 4,
- "MediaLoop": 8,
- "MediaCanSave": 16,
- "MediaHasAudio": 32,
- "MediaCanToggleControls": 64,
- "MediaControls": 128,
- "MediaCanPrint": 256,
- "MediaCanRotate": 512
- }
- }
- Enum {
- name: "EditFlags"
- values: {
- "CanUndo": 1,
- "CanRedo": 2,
- "CanCut": 4,
- "CanCopy": 8,
- "CanPaste": 16,
- "CanDelete": 32,
- "CanSelectAll": 64,
- "CanTranslate": 128,
- "CanEditRichly": 256
- }
- }
- Property { name: "x"; type: "int"; isReadonly: true }
- Property { name: "y"; type: "int"; isReadonly: true }
- Property { name: "selectedText"; type: "string"; isReadonly: true }
- Property { name: "linkText"; type: "string"; isReadonly: true }
- Property { name: "linkUrl"; type: "QUrl"; isReadonly: true }
- Property { name: "mediaUrl"; type: "QUrl"; isReadonly: true }
- Property { name: "mediaType"; type: "MediaType"; isReadonly: true }
- Property { name: "isContentEditable"; type: "bool"; isReadonly: true }
- Property { name: "misspelledWord"; type: "string"; isReadonly: true }
- Property { name: "spellCheckerSuggestions"; type: "QStringList"; isReadonly: true }
- Property { name: "accepted"; type: "bool" }
- Property { name: "mediaFlags"; revision: 1; type: "MediaFlags"; isReadonly: true }
- Property { name: "editFlags"; revision: 1; type: "EditFlags"; isReadonly: true }
- }
- Component {
- name: "QQuickWebEngineDownloadItem"
- prototype: "QObject"
- exports: [
- "QtWebEngine/WebEngineDownloadItem 1.1",
- "QtWebEngine/WebEngineDownloadItem 1.10",
- "QtWebEngine/WebEngineDownloadItem 1.2",
- "QtWebEngine/WebEngineDownloadItem 1.3",
- "QtWebEngine/WebEngineDownloadItem 1.4",
- "QtWebEngine/WebEngineDownloadItem 1.5",
- "QtWebEngine/WebEngineDownloadItem 1.6",
- "QtWebEngine/WebEngineDownloadItem 1.7",
- "QtWebEngine/WebEngineDownloadItem 1.8"
- ]
- isCreatable: false
- exportMetaObjectRevisions: [0, 10, 1, 2, 3, 4, 5, 6, 7]
- Enum {
- name: "DownloadState"
- values: {
- "DownloadRequested": 0,
- "DownloadInProgress": 1,
- "DownloadCompleted": 2,
- "DownloadCancelled": 3,
- "DownloadInterrupted": 4
- }
- }
- Enum {
- name: "SavePageFormat"
- values: {
- "UnknownSaveFormat": -1,
- "SingleHtmlSaveFormat": 0,
- "CompleteHtmlSaveFormat": 1,
- "MimeHtmlSaveFormat": 2
- }
- }
- Enum {
- name: "DownloadInterruptReason"
- values: {
- "NoReason": 0,
- "FileFailed": 1,
- "FileAccessDenied": 2,
- "FileNoSpace": 3,
- "FileNameTooLong": 5,
- "FileTooLarge": 6,
- "FileVirusInfected": 7,
- "FileTransientError": 10,
- "FileBlocked": 11,
- "FileSecurityCheckFailed": 12,
- "FileTooShort": 13,
- "FileHashMismatch": 14,
- "NetworkFailed": 20,
- "NetworkTimeout": 21,
- "NetworkDisconnected": 22,
- "NetworkServerDown": 23,
- "NetworkInvalidRequest": 24,
- "ServerFailed": 30,
- "ServerBadContent": 33,
- "ServerUnauthorized": 34,
- "ServerCertProblem": 35,
- "ServerForbidden": 36,
- "ServerUnreachable": 37,
- "UserCanceled": 40
- }
- }
- Enum {
- name: "DownloadType"
- values: {
- "Attachment": 0,
- "DownloadAttribute": 1,
- "UserRequested": 2,
- "SavePage": 3
- }
- }
- Property { name: "id"; type: "uint"; isReadonly: true }
- Property { name: "state"; type: "DownloadState"; isReadonly: true }
- Property { name: "savePageFormat"; revision: 2; type: "SavePageFormat" }
- Property { name: "totalBytes"; type: "qlonglong"; isReadonly: true }
- Property { name: "receivedBytes"; type: "qlonglong"; isReadonly: true }
- Property { name: "mimeType"; revision: 1; type: "string"; isReadonly: true }
- Property { name: "path"; type: "string" }
- Property { name: "type"; revision: 3; type: "DownloadType"; isReadonly: true }
- Property {
- name: "interruptReason"
- revision: 4
- type: "DownloadInterruptReason"
- isReadonly: true
- }
- Property { name: "interruptReasonString"; revision: 4; type: "string"; isReadonly: true }
- Property { name: "isFinished"; revision: 5; type: "bool"; isReadonly: true }
- Property { name: "isPaused"; revision: 5; type: "bool"; isReadonly: true }
- Property { name: "isSavePageDownload"; revision: 6; type: "bool"; isReadonly: true }
- Property {
- name: "view"
- revision: 7
- type: "QQuickWebEngineView"
- isReadonly: true
- isPointer: true
- }
- Property { name: "url"; revision: 10; type: "QUrl"; isReadonly: true }
- Property { name: "suggestedFileName"; revision: 10; type: "string"; isReadonly: true }
- Property { name: "downloadDirectory"; revision: 10; type: "string" }
- Property { name: "downloadFileName"; revision: 10; type: "string" }
- Signal { name: "savePageFormatChanged"; revision: 2 }
- Signal { name: "mimeTypeChanged"; revision: 1 }
- Signal { name: "typeChanged"; revision: 3 }
- Signal { name: "interruptReasonChanged"; revision: 4 }
- Signal { name: "isFinishedChanged"; revision: 5 }
- Signal { name: "isPausedChanged"; revision: 5 }
- Signal { name: "downloadDirectoryChanged"; revision: 10 }
- Signal { name: "downloadFileNameChanged"; revision: 10 }
- Method { name: "accept" }
- Method { name: "cancel" }
- Method { name: "pause" }
- Method { name: "resume" }
- }
- Component {
- name: "QQuickWebEngineFileDialogRequest"
- prototype: "QObject"
- exports: ["QtWebEngine/FileDialogRequest 1.4"]
- isCreatable: false
- exportMetaObjectRevisions: [0]
- Enum {
- name: "FileMode"
- values: {
- "FileModeOpen": 0,
- "FileModeOpenMultiple": 1,
- "FileModeUploadFolder": 2,
- "FileModeSave": 3
- }
- }
- Property { name: "defaultFileName"; type: "string"; isReadonly: true }
- Property { name: "acceptedMimeTypes"; type: "QStringList"; isReadonly: true }
- Property { name: "mode"; type: "FileMode"; isReadonly: true }
- Property { name: "accepted"; type: "bool" }
- Method {
- name: "dialogAccept"
- Parameter { name: "files"; type: "QStringList" }
- }
- Method { name: "dialogReject" }
- }
- Component {
- name: "QQuickWebEngineFormValidationMessageRequest"
- prototype: "QObject"
- exports: ["QtWebEngine/FormValidationMessageRequest 1.4"]
- isCreatable: false
- exportMetaObjectRevisions: [0]
- Enum {
- name: "RequestType"
- values: {
- "Show": 0,
- "Hide": 1,
- "Move": 2
- }
- }
- Property { name: "anchor"; type: "QRect"; isReadonly: true }
- Property { name: "text"; type: "string"; isReadonly: true }
- Property { name: "subText"; type: "string"; isReadonly: true }
- Property { name: "type"; type: "RequestType"; isReadonly: true }
- Property { name: "accepted"; type: "bool" }
- }
- Component {
- name: "QQuickWebEngineFullScreenRequest"
- exports: ["QtWebEngine/FullScreenRequest 1.1"]
- isCreatable: false
- exportMetaObjectRevisions: [0]
- Property { name: "origin"; type: "QUrl"; isReadonly: true }
- Property { name: "toggleOn"; type: "bool"; isReadonly: true }
- Method { name: "accept" }
- Method { name: "reject" }
- }
- Component {
- name: "QQuickWebEngineHistory"
- defaultProperty: "data"
- prototype: "QQuickItem"
- exports: ["QtWebEngine/NavigationHistory 1.1"]
- isCreatable: false
- exportMetaObjectRevisions: [0]
- Property {
- name: "items"
- type: "QQuickWebEngineHistoryListModel"
- isReadonly: true
- isPointer: true
- }
- Property {
- name: "backItems"
- type: "QQuickWebEngineHistoryListModel"
- isReadonly: true
- isPointer: true
- }
- Property {
- name: "forwardItems"
- type: "QQuickWebEngineHistoryListModel"
- isReadonly: true
- isPointer: true
- }
- }
- Component {
- name: "QQuickWebEngineHistoryListModel"
- prototype: "QAbstractListModel"
- exports: ["QtWebEngine/NavigationHistoryListModel 1.1"]
- isCreatable: false
- exportMetaObjectRevisions: [0]
- }
- Component {
- name: "QQuickWebEngineJavaScriptDialogRequest"
- prototype: "QObject"
- exports: ["QtWebEngine/JavaScriptDialogRequest 1.4"]
- isCreatable: false
- exportMetaObjectRevisions: [0]
- Enum {
- name: "DialogType"
- values: {
- "DialogTypeAlert": 0,
- "DialogTypeConfirm": 1,
- "DialogTypePrompt": 2,
- "DialogTypeBeforeUnload": 3
- }
- }
- Property { name: "message"; type: "string"; isReadonly: true }
- Property { name: "defaultText"; type: "string"; isReadonly: true }
- Property { name: "title"; type: "string"; isReadonly: true }
- Property { name: "type"; type: "DialogType"; isReadonly: true }
- Property { name: "securityOrigin"; type: "QUrl"; isReadonly: true }
- Property { name: "accepted"; type: "bool" }
- Method {
- name: "dialogAccept"
- Parameter { name: "text"; type: "string" }
- }
- Method { name: "dialogAccept" }
- Method { name: "dialogReject" }
- }
- Component {
- name: "QQuickWebEngineLoadRequest"
- prototype: "QObject"
- exports: ["QtWebEngine/WebEngineLoadRequest 1.0"]
- isCreatable: false
- exportMetaObjectRevisions: [0]
- Property { name: "url"; type: "QUrl"; isReadonly: true }
- Property { name: "status"; type: "QQuickWebEngineView::LoadStatus"; isReadonly: true }
- Property { name: "errorString"; type: "string"; isReadonly: true }
- Property { name: "errorDomain"; type: "QQuickWebEngineView::ErrorDomain"; isReadonly: true }
- Property { name: "errorCode"; type: "int"; isReadonly: true }
- }
- Component {
- name: "QQuickWebEngineNavigationRequest"
- prototype: "QObject"
- exports: ["QtWebEngine/WebEngineNavigationRequest 1.0"]
- isCreatable: false
- exportMetaObjectRevisions: [0]
- Property { name: "url"; type: "QUrl"; isReadonly: true }
- Property { name: "isMainFrame"; type: "bool"; isReadonly: true }
- Property { name: "action"; type: "QQuickWebEngineView::NavigationRequestAction" }
- Property {
- name: "navigationType"
- type: "QQuickWebEngineView::NavigationType"
- isReadonly: true
- }
- }
- Component {
- name: "QQuickWebEngineNewViewRequest"
- prototype: "QObject"
- exports: [
- "QtWebEngine/WebEngineNewViewRequest 1.1",
- "QtWebEngine/WebEngineNewViewRequest 1.5"
- ]
- isCreatable: false
- exportMetaObjectRevisions: [0, 1]
- Property {
- name: "destination"
- type: "QQuickWebEngineView::NewViewDestination"
- isReadonly: true
- }
- Property { name: "requestedUrl"; revision: 1; type: "QUrl"; isReadonly: true }
- Property { name: "userInitiated"; type: "bool"; isReadonly: true }
- Method {
- name: "openIn"
- Parameter { name: "view"; type: "QQuickWebEngineView"; isPointer: true }
- }
- }
- Component {
- name: "QQuickWebEngineProfile"
- prototype: "QObject"
- exports: [
- "QtWebEngine/WebEngineProfile 1.1",
- "QtWebEngine/WebEngineProfile 1.2",
- "QtWebEngine/WebEngineProfile 1.3",
- "QtWebEngine/WebEngineProfile 1.4",
- "QtWebEngine/WebEngineProfile 1.5",
- "QtWebEngine/WebEngineProfile 1.9"
- ]
- exportMetaObjectRevisions: [0, 1, 2, 3, 4, 5]
- Enum {
- name: "HttpCacheType"
- values: {
- "MemoryHttpCache": 0,
- "DiskHttpCache": 1,
- "NoCache": 2
- }
- }
- Enum {
- name: "PersistentCookiesPolicy"
- values: {
- "NoPersistentCookies": 0,
- "AllowPersistentCookies": 1,
- "ForcePersistentCookies": 2
- }
- }
- Property { name: "storageName"; type: "string" }
- Property { name: "offTheRecord"; type: "bool" }
- Property { name: "persistentStoragePath"; type: "string" }
- Property { name: "cachePath"; type: "string" }
- Property { name: "httpUserAgent"; type: "string" }
- Property { name: "httpCacheType"; type: "HttpCacheType" }
- Property { name: "httpAcceptLanguage"; revision: 1; type: "string" }
- Property { name: "persistentCookiesPolicy"; type: "PersistentCookiesPolicy" }
- Property { name: "httpCacheMaximumSize"; type: "int" }
- Property { name: "spellCheckLanguages"; revision: 3; type: "QStringList" }
- Property { name: "spellCheckEnabled"; revision: 3; type: "bool" }
- Property {
- name: "userScripts"
- revision: 4
- type: "QQuickWebEngineScript"
- isList: true
- isReadonly: true
- }
- Property { name: "useForGlobalCertificateVerification"; revision: 5; type: "bool" }
- Property { name: "downloadPath"; revision: 5; type: "string" }
- Signal { name: "httpAcceptLanguageChanged"; revision: 1 }
- Signal { name: "spellCheckLanguagesChanged"; revision: 3 }
- Signal { name: "spellCheckEnabledChanged"; revision: 3 }
- Signal { name: "useForGlobalCertificateVerificationChanged"; revision: 5 }
- Signal { name: "downloadPathChanged"; revision: 5 }
- Signal {
- name: "downloadRequested"
- Parameter { name: "download"; type: "QQuickWebEngineDownloadItem"; isPointer: true }
- }
- Signal {
- name: "downloadFinished"
- Parameter { name: "download"; type: "QQuickWebEngineDownloadItem"; isPointer: true }
- }
- Signal {
- name: "presentNotification"
- revision: 5
- Parameter { name: "notification"; type: "QWebEngineNotification"; isPointer: true }
- }
- Method { name: "clearHttpCache"; revision: 2 }
- }
- Component {
- name: "QQuickWebEngineScript"
- prototype: "QObject"
- exports: ["QtWebEngine/WebEngineScript 1.1"]
- exportMetaObjectRevisions: [0]
- Enum {
- name: "InjectionPoint"
- values: {
- "Deferred": 0,
- "DocumentReady": 1,
- "DocumentCreation": 2
- }
- }
- Enum {
- name: "ScriptWorldId"
- values: {
- "MainWorld": 0,
- "ApplicationWorld": 1,
- "UserWorld": 2
- }
- }
- Property { name: "name"; type: "string" }
- Property { name: "sourceUrl"; type: "QUrl" }
- Property { name: "sourceCode"; type: "string" }
- Property { name: "injectionPoint"; type: "InjectionPoint" }
- Property { name: "worldId"; type: "ScriptWorldId" }
- Property { name: "runOnSubframes"; type: "bool" }
- Signal {
- name: "nameChanged"
- Parameter { name: "name"; type: "string" }
- }
- Signal {
- name: "sourceUrlChanged"
- Parameter { name: "url"; type: "QUrl" }
- }
- Signal {
- name: "sourceCodeChanged"
- Parameter { name: "code"; type: "string" }
- }
- Signal {
- name: "injectionPointChanged"
- Parameter { name: "injectionPoint"; type: "InjectionPoint" }
- }
- Signal {
- name: "worldIdChanged"
- Parameter { name: "scriptWorldId"; type: "ScriptWorldId" }
- }
- Signal {
- name: "runOnSubframesChanged"
- Parameter { name: "on"; type: "bool" }
- }
- Method { name: "toString"; type: "string" }
- Method {
- name: "setName"
- Parameter { name: "name"; type: "string" }
- }
- Method {
- name: "setSourceUrl"
- Parameter { name: "url"; type: "QUrl" }
- }
- Method {
- name: "setSourceCode"
- Parameter { name: "code"; type: "string" }
- }
- Method {
- name: "setInjectionPoint"
- Parameter { name: "injectionPoint"; type: "InjectionPoint" }
- }
- Method {
- name: "setWorldId"
- Parameter { name: "scriptWorldId"; type: "ScriptWorldId" }
- }
- Method {
- name: "setRunOnSubframes"
- Parameter { name: "on"; type: "bool" }
- }
- }
- Component {
- name: "QQuickWebEngineSettings"
- prototype: "QObject"
- exports: [
- "QtWebEngine/WebEngineSettings 1.1",
- "QtWebEngine/WebEngineSettings 1.2",
- "QtWebEngine/WebEngineSettings 1.3",
- "QtWebEngine/WebEngineSettings 1.4",
- "QtWebEngine/WebEngineSettings 1.5",
- "QtWebEngine/WebEngineSettings 1.6",
- "QtWebEngine/WebEngineSettings 1.7",
- "QtWebEngine/WebEngineSettings 1.8",
- "QtWebEngine/WebEngineSettings 1.9"
- ]
- isCreatable: false
- exportMetaObjectRevisions: [0, 1, 2, 3, 4, 5, 6, 7, 8]
- Enum {
- name: "UnknownUrlSchemePolicy"
- values: {
- "DisallowUnknownUrlSchemes": 1,
- "AllowUnknownUrlSchemesFromUserInteraction": 2,
- "AllowAllUnknownUrlSchemes": 3
- }
- }
- Property { name: "autoLoadImages"; type: "bool" }
- Property { name: "javascriptEnabled"; type: "bool" }
- Property { name: "javascriptCanOpenWindows"; type: "bool" }
- Property { name: "javascriptCanAccessClipboard"; type: "bool" }
- Property { name: "linksIncludedInFocusChain"; type: "bool" }
- Property { name: "localStorageEnabled"; type: "bool" }
- Property { name: "localContentCanAccessRemoteUrls"; type: "bool" }
- Property { name: "spatialNavigationEnabled"; type: "bool" }
- Property { name: "localContentCanAccessFileUrls"; type: "bool" }
- Property { name: "hyperlinkAuditingEnabled"; type: "bool" }
- Property { name: "errorPageEnabled"; type: "bool" }
- Property { name: "pluginsEnabled"; type: "bool" }
- Property { name: "fullScreenSupportEnabled"; revision: 1; type: "bool" }
- Property { name: "defaultTextEncoding"; type: "string" }
- Property { name: "screenCaptureEnabled"; revision: 2; type: "bool" }
- Property { name: "webGLEnabled"; revision: 2; type: "bool" }
- Property { name: "accelerated2dCanvasEnabled"; revision: 2; type: "bool" }
- Property { name: "autoLoadIconsForPage"; revision: 2; type: "bool" }
- Property { name: "touchIconsEnabled"; revision: 2; type: "bool" }
- Property { name: "focusOnNavigationEnabled"; revision: 3; type: "bool" }
- Property { name: "printElementBackgrounds"; revision: 3; type: "bool" }
- Property { name: "allowRunningInsecureContent"; revision: 3; type: "bool" }
- Property { name: "allowGeolocationOnInsecureOrigins"; revision: 4; type: "bool" }
- Property { name: "allowWindowActivationFromJavaScript"; revision: 5; type: "bool" }
- Property { name: "showScrollBars"; revision: 5; type: "bool" }
- Property { name: "unknownUrlSchemePolicy"; revision: 6; type: "UnknownUrlSchemePolicy" }
- Property { name: "playbackRequiresUserGesture"; revision: 6; type: "bool" }
- Property { name: "webRTCPublicInterfacesOnly"; revision: 6; type: "bool" }
- Property { name: "javascriptCanPaste"; revision: 6; type: "bool" }
- Property { name: "dnsPrefetchEnabled"; revision: 7; type: "bool" }
- Property { name: "pdfViewerEnabled"; revision: 8; type: "bool" }
- Signal { name: "fullScreenSupportEnabledChanged"; revision: 1 }
- Signal { name: "screenCaptureEnabledChanged"; revision: 2 }
- Signal { name: "webGLEnabledChanged"; revision: 2 }
- Signal { name: "accelerated2dCanvasEnabledChanged"; revision: 2 }
- Signal { name: "autoLoadIconsForPageChanged"; revision: 2 }
- Signal { name: "touchIconsEnabledChanged"; revision: 2 }
- Signal { name: "focusOnNavigationEnabledChanged"; revision: 3 }
- Signal { name: "printElementBackgroundsChanged"; revision: 3 }
- Signal { name: "allowRunningInsecureContentChanged"; revision: 3 }
- Signal { name: "allowGeolocationOnInsecureOriginsChanged"; revision: 4 }
- Signal { name: "allowWindowActivationFromJavaScriptChanged"; revision: 5 }
- Signal { name: "showScrollBarsChanged"; revision: 5 }
- Signal { name: "unknownUrlSchemePolicyChanged"; revision: 6 }
- Signal { name: "playbackRequiresUserGestureChanged"; revision: 6 }
- Signal { name: "webRTCPublicInterfacesOnlyChanged"; revision: 6 }
- Signal { name: "javascriptCanPasteChanged"; revision: 6 }
- Signal { name: "dnsPrefetchEnabledChanged"; revision: 7 }
- Signal { name: "pdfViewerEnabledChanged"; revision: 8 }
- }
- Component {
- name: "QQuickWebEngineSingleton"
- prototype: "QObject"
- exports: ["QtWebEngine/WebEngine 1.1"]
- isCreatable: false
- isSingleton: true
- exportMetaObjectRevisions: [0]
- Property { name: "settings"; type: "QQuickWebEngineSettings"; isReadonly: true; isPointer: true }
- Property {
- name: "defaultProfile"
- revision: 1
- type: "QQuickWebEngineProfile"
- isReadonly: true
- isPointer: true
- }
- }
- Component {
- name: "QQuickWebEngineTooltipRequest"
- prototype: "QObject"
- exports: ["QtWebEngine/TooltipRequest 1.10"]
- isCreatable: false
- exportMetaObjectRevisions: [0]
- Enum {
- name: "RequestType"
- values: {
- "Show": 0,
- "Hide": 1
- }
- }
- Property { name: "x"; type: "int"; isReadonly: true }
- Property { name: "y"; type: "int"; isReadonly: true }
- Property { name: "text"; type: "string"; isReadonly: true }
- Property { name: "type"; type: "RequestType"; isReadonly: true }
- Property { name: "accepted"; type: "bool" }
- }
- Component {
- name: "QQuickWebEngineView"
- defaultProperty: "data"
- prototype: "QQuickItem"
- exports: [
- "QtWebEngine/WebEngineView 1.0",
- "QtWebEngine/WebEngineView 1.1",
- "QtWebEngine/WebEngineView 1.10",
- "QtWebEngine/WebEngineView 1.2",
- "QtWebEngine/WebEngineView 1.3",
- "QtWebEngine/WebEngineView 1.4",
- "QtWebEngine/WebEngineView 1.5",
- "QtWebEngine/WebEngineView 1.6",
- "QtWebEngine/WebEngineView 1.7",
- "QtWebEngine/WebEngineView 1.8",
- "QtWebEngine/WebEngineView 1.9"
- ]
- exportMetaObjectRevisions: [0, 1, 10, 2, 3, 4, 5, 6, 7, 8, 9]
- Enum {
- name: "NavigationRequestAction"
- values: {
- "AcceptRequest": 0,
- "IgnoreRequest": 255
- }
- }
- Enum {
- name: "NavigationType"
- values: {
- "LinkClickedNavigation": 0,
- "TypedNavigation": 1,
- "FormSubmittedNavigation": 2,
- "BackForwardNavigation": 3,
- "ReloadNavigation": 4,
- "OtherNavigation": 5,
- "RedirectNavigation": 6
- }
- }
- Enum {
- name: "LoadStatus"
- values: {
- "LoadStartedStatus": 0,
- "LoadStoppedStatus": 1,
- "LoadSucceededStatus": 2,
- "LoadFailedStatus": 3
- }
- }
- Enum {
- name: "ErrorDomain"
- values: {
- "NoErrorDomain": 0,
- "InternalErrorDomain": 1,
- "ConnectionErrorDomain": 2,
- "CertificateErrorDomain": 3,
- "HttpErrorDomain": 4,
- "FtpErrorDomain": 5,
- "DnsErrorDomain": 6
- }
- }
- Enum {
- name: "NewViewDestination"
- values: {
- "NewViewInWindow": 0,
- "NewViewInTab": 1,
- "NewViewInDialog": 2,
- "NewViewInBackgroundTab": 3
- }
- }
- Enum {
- name: "Feature"
- values: {
- "MediaAudioCapture": 0,
- "MediaVideoCapture": 1,
- "MediaAudioVideoCapture": 2,
- "Geolocation": 3,
- "DesktopVideoCapture": 4,
- "DesktopAudioVideoCapture": 5,
- "Notifications": 6
- }
- }
- Enum {
- name: "WebAction"
- values: {
- "NoWebAction": -1,
- "Back": 0,
- "Forward": 1,
- "Stop": 2,
- "Reload": 3,
- "Cut": 4,
- "Copy": 5,
- "Paste": 6,
- "Undo": 7,
- "Redo": 8,
- "SelectAll": 9,
- "ReloadAndBypassCache": 10,
- "PasteAndMatchStyle": 11,
- "OpenLinkInThisWindow": 12,
- "OpenLinkInNewWindow": 13,
- "OpenLinkInNewTab": 14,
- "CopyLinkToClipboard": 15,
- "DownloadLinkToDisk": 16,
- "CopyImageToClipboard": 17,
- "CopyImageUrlToClipboard": 18,
- "DownloadImageToDisk": 19,
- "CopyMediaUrlToClipboard": 20,
- "ToggleMediaControls": 21,
- "ToggleMediaLoop": 22,
- "ToggleMediaPlayPause": 23,
- "ToggleMediaMute": 24,
- "DownloadMediaToDisk": 25,
- "InspectElement": 26,
- "ExitFullScreen": 27,
- "RequestClose": 28,
- "Unselect": 29,
- "SavePage": 30,
- "ViewSource": 31,
- "ToggleBold": 32,
- "ToggleItalic": 33,
- "ToggleUnderline": 34,
- "ToggleStrikethrough": 35,
- "AlignLeft": 36,
- "AlignCenter": 37,
- "AlignRight": 38,
- "AlignJustified": 39,
- "Indent": 40,
- "Outdent": 41,
- "InsertOrderedList": 42,
- "InsertUnorderedList": 43,
- "WebActionCount": 44
- }
- }
- Enum {
- name: "JavaScriptConsoleMessageLevel"
- values: {
- "InfoMessageLevel": 0,
- "WarningMessageLevel": 1,
- "ErrorMessageLevel": 2
- }
- }
- Enum {
- name: "RenderProcessTerminationStatus"
- values: {
- "NormalTerminationStatus": 0,
- "AbnormalTerminationStatus": 1,
- "CrashedTerminationStatus": 2,
- "KilledTerminationStatus": 3
- }
- }
- Enum {
- name: "FindFlags"
- values: {
- "FindBackward": 1,
- "FindCaseSensitively": 2
- }
- }
- Enum {
- name: "PrintedPageSizeId"
- values: {
- "A4": 0,
- "B5": 1,
- "Letter": 2,
- "Legal": 3,
- "Executive": 4,
- "A0": 5,
- "A1": 6,
- "A2": 7,
- "A3": 8,
- "A5": 9,
- "A6": 10,
- "A7": 11,
- "A8": 12,
- "A9": 13,
- "B0": 14,
- "B1": 15,
- "B10": 16,
- "B2": 17,
- "B3": 18,
- "B4": 19,
- "B6": 20,
- "B7": 21,
- "B8": 22,
- "B9": 23,
- "C5E": 24,
- "Comm10E": 25,
- "DLE": 26,
- "Folio": 27,
- "Ledger": 28,
- "Tabloid": 29,
- "Custom": 30,
- "A10": 31,
- "A3Extra": 32,
- "A4Extra": 33,
- "A4Plus": 34,
- "A4Small": 35,
- "A5Extra": 36,
- "B5Extra": 37,
- "JisB0": 38,
- "JisB1": 39,
- "JisB2": 40,
- "JisB3": 41,
- "JisB4": 42,
- "JisB5": 43,
- "JisB6": 44,
- "JisB7": 45,
- "JisB8": 46,
- "JisB9": 47,
- "JisB10": 48,
- "AnsiC": 49,
- "AnsiD": 50,
- "AnsiE": 51,
- "LegalExtra": 52,
- "LetterExtra": 53,
- "LetterPlus": 54,
- "LetterSmall": 55,
- "TabloidExtra": 56,
- "ArchA": 57,
- "ArchB": 58,
- "ArchC": 59,
- "ArchD": 60,
- "ArchE": 61,
- "Imperial7x9": 62,
- "Imperial8x10": 63,
- "Imperial9x11": 64,
- "Imperial9x12": 65,
- "Imperial10x11": 66,
- "Imperial10x13": 67,
- "Imperial10x14": 68,
- "Imperial12x11": 69,
- "Imperial15x11": 70,
- "ExecutiveStandard": 71,
- "Note": 72,
- "Quarto": 73,
- "Statement": 74,
- "SuperA": 75,
- "SuperB": 76,
- "Postcard": 77,
- "DoublePostcard": 78,
- "Prc16K": 79,
- "Prc32K": 80,
- "Prc32KBig": 81,
- "FanFoldUS": 82,
- "FanFoldGerman": 83,
- "FanFoldGermanLegal": 84,
- "EnvelopeB4": 85,
- "EnvelopeB5": 86,
- "EnvelopeB6": 87,
- "EnvelopeC0": 88,
- "EnvelopeC1": 89,
- "EnvelopeC2": 90,
- "EnvelopeC3": 91,
- "EnvelopeC4": 92,
- "EnvelopeC6": 93,
- "EnvelopeC65": 94,
- "EnvelopeC7": 95,
- "Envelope9": 96,
- "Envelope11": 97,
- "Envelope12": 98,
- "Envelope14": 99,
- "EnvelopeMonarch": 100,
- "EnvelopePersonal": 101,
- "EnvelopeChou3": 102,
- "EnvelopeChou4": 103,
- "EnvelopeInvite": 104,
- "EnvelopeItalian": 105,
- "EnvelopeKaku2": 106,
- "EnvelopeKaku3": 107,
- "EnvelopePrc1": 108,
- "EnvelopePrc2": 109,
- "EnvelopePrc3": 110,
- "EnvelopePrc4": 111,
- "EnvelopePrc5": 112,
- "EnvelopePrc6": 113,
- "EnvelopePrc7": 114,
- "EnvelopePrc8": 115,
- "EnvelopePrc9": 116,
- "EnvelopePrc10": 117,
- "EnvelopeYou4": 118,
- "LastPageSize": 118,
- "NPageSize": 118,
- "NPaperSize": 118,
- "AnsiA": 2,
- "AnsiB": 28,
- "EnvelopeC5": 24,
- "EnvelopeDL": 26,
- "Envelope10": 25
- }
- }
- Enum {
- name: "PrintedPageOrientation"
- values: {
- "Portrait": 0,
- "Landscape": 1
- }
- }
- Enum {
- name: "LifecycleState"
- values: {
- "Active": 0,
- "Frozen": 1,
- "Discarded": 2
- }
- }
- Property { name: "url"; type: "QUrl" }
- Property { name: "icon"; type: "QUrl"; isReadonly: true }
- Property { name: "loading"; type: "bool"; isReadonly: true }
- Property { name: "loadProgress"; type: "int"; isReadonly: true }
- Property { name: "title"; type: "string"; isReadonly: true }
- Property { name: "canGoBack"; type: "bool"; isReadonly: true }
- Property { name: "canGoForward"; type: "bool"; isReadonly: true }
- Property { name: "isFullScreen"; revision: 1; type: "bool"; isReadonly: true }
- Property { name: "zoomFactor"; revision: 1; type: "double" }
- Property { name: "profile"; revision: 1; type: "QQuickWebEngineProfile"; isPointer: true }
- Property {
- name: "settings"
- revision: 1
- type: "QQuickWebEngineSettings"
- isReadonly: true
- isPointer: true
- }
- Property {
- name: "navigationHistory"
- revision: 1
- type: "QQuickWebEngineHistory"
- isReadonly: true
- isPointer: true
- }
- Property { name: "webChannel"; revision: 1; type: "QQmlWebChannel"; isPointer: true }
- Property {
- name: "userScripts"
- revision: 1
- type: "QQuickWebEngineScript"
- isList: true
- isReadonly: true
- }
- Property { name: "activeFocusOnPress"; revision: 2; type: "bool" }
- Property { name: "backgroundColor"; revision: 2; type: "QColor" }
- Property { name: "contentsSize"; revision: 3; type: "QSizeF"; isReadonly: true }
- Property { name: "scrollPosition"; revision: 3; type: "QPointF"; isReadonly: true }
- Property { name: "audioMuted"; revision: 3; type: "bool" }
- Property { name: "recentlyAudible"; revision: 3; type: "bool"; isReadonly: true }
- Property { name: "webChannelWorld"; revision: 3; type: "uint" }
- Property { name: "inspectedView"; revision: 7; type: "QQuickWebEngineView"; isPointer: true }
- Property { name: "devToolsView"; revision: 7; type: "QQuickWebEngineView"; isPointer: true }
- Property { name: "lifecycleState"; revision: 10; type: "LifecycleState" }
- Property { name: "recommendedState"; revision: 10; type: "LifecycleState"; isReadonly: true }
- Property { name: "renderProcessId"; revision: 11; type: "qint64"; isReadonly: true }
- Signal {
- name: "loadingChanged"
- Parameter { name: "loadRequest"; type: "QQuickWebEngineLoadRequest"; isPointer: true }
- }
- Signal {
- name: "linkHovered"
- Parameter { name: "hoveredUrl"; type: "QUrl" }
- }
- Signal {
- name: "navigationRequested"
- Parameter { name: "request"; type: "QQuickWebEngineNavigationRequest"; isPointer: true }
- }
- Signal {
- name: "javaScriptConsoleMessage"
- Parameter { name: "level"; type: "JavaScriptConsoleMessageLevel" }
- Parameter { name: "message"; type: "string" }
- Parameter { name: "lineNumber"; type: "int" }
- Parameter { name: "sourceID"; type: "string" }
- }
- Signal {
- name: "certificateError"
- revision: 1
- Parameter { name: "error"; type: "QQuickWebEngineCertificateError"; isPointer: true }
- }
- Signal {
- name: "fullScreenRequested"
- revision: 1
- Parameter { name: "request"; type: "QQuickWebEngineFullScreenRequest" }
- }
- Signal { name: "isFullScreenChanged"; revision: 1 }
- Signal {
- name: "featurePermissionRequested"
- revision: 1
- Parameter { name: "securityOrigin"; type: "QUrl" }
- Parameter { name: "feature"; type: "Feature" }
- }
- Signal {
- name: "newViewRequested"
- revision: 1
- Parameter { name: "request"; type: "QQuickWebEngineNewViewRequest"; isPointer: true }
- }
- Signal {
- name: "zoomFactorChanged"
- revision: 1
- Parameter { name: "arg"; type: "double" }
- }
- Signal { name: "profileChanged"; revision: 1 }
- Signal { name: "webChannelChanged"; revision: 1 }
- Signal {
- name: "activeFocusOnPressChanged"
- revision: 2
- Parameter { type: "bool" }
- }
- Signal { name: "backgroundColorChanged"; revision: 2 }
- Signal {
- name: "renderProcessTerminated"
- revision: 2
- Parameter { name: "terminationStatus"; type: "RenderProcessTerminationStatus" }
- Parameter { name: "exitCode"; type: "int" }
- }
- Signal { name: "windowCloseRequested"; revision: 2 }
- Signal {
- name: "contentsSizeChanged"
- revision: 3
- Parameter { name: "size"; type: "QSizeF" }
- }
- Signal {
- name: "scrollPositionChanged"
- revision: 3
- Parameter { name: "position"; type: "QPointF" }
- }
- Signal {
- name: "audioMutedChanged"
- revision: 3
- Parameter { name: "muted"; type: "bool" }
- }
- Signal {
- name: "recentlyAudibleChanged"
- revision: 3
- Parameter { name: "recentlyAudible"; type: "bool" }
- }
- Signal {
- name: "webChannelWorldChanged"
- revision: 3
- Parameter { type: "uint" }
- }
- Signal {
- name: "contextMenuRequested"
- revision: 4
- Parameter { name: "request"; type: "QQuickWebEngineContextMenuRequest"; isPointer: true }
- }
- Signal {
- name: "authenticationDialogRequested"
- revision: 4
- Parameter {
- name: "request"
- type: "QQuickWebEngineAuthenticationDialogRequest"
- isPointer: true
- }
- }
- Signal {
- name: "javaScriptDialogRequested"
- revision: 4
- Parameter { name: "request"; type: "QQuickWebEngineJavaScriptDialogRequest"; isPointer: true }
- }
- Signal {
- name: "colorDialogRequested"
- revision: 4
- Parameter { name: "request"; type: "QQuickWebEngineColorDialogRequest"; isPointer: true }
- }
- Signal {
- name: "fileDialogRequested"
- revision: 4
- Parameter { name: "request"; type: "QQuickWebEngineFileDialogRequest"; isPointer: true }
- }
- Signal {
- name: "formValidationMessageRequested"
- revision: 4
- Parameter {
- name: "request"
- type: "QQuickWebEngineFormValidationMessageRequest"
- isPointer: true
- }
- }
- Signal {
- name: "pdfPrintingFinished"
- revision: 5
- Parameter { name: "filePath"; type: "string" }
- Parameter { name: "success"; type: "bool" }
- }
- Signal {
- name: "quotaRequested"
- revision: 7
- Parameter { name: "request"; type: "QWebEngineQuotaRequest" }
- }
- Signal {
- name: "geometryChangeRequested"
- revision: 7
- Parameter { name: "geometry"; type: "QRect" }
- Parameter { name: "frameGeometry"; type: "QRect" }
- }
- Signal { name: "inspectedViewChanged"; revision: 7 }
- Signal { name: "devToolsViewChanged"; revision: 7 }
- Signal {
- name: "registerProtocolHandlerRequested"
- revision: 7
- Parameter { name: "request"; type: "QWebEngineRegisterProtocolHandlerRequest" }
- }
- Signal { name: "printRequested"; revision: 8 }
- Signal {
- name: "selectClientCertificate"
- revision: 9
- Parameter {
- name: "clientCertSelection"
- type: "QQuickWebEngineClientCertificateSelection"
- isPointer: true
- }
- }
- Signal {
- name: "tooltipRequested"
- revision: 10
- Parameter { name: "request"; type: "QQuickWebEngineTooltipRequest"; isPointer: true }
- }
- Signal {
- name: "lifecycleStateChanged"
- revision: 10
- Parameter { name: "state"; type: "LifecycleState" }
- }
- Signal {
- name: "recommendedStateChanged"
- revision: 10
- Parameter { name: "state"; type: "LifecycleState" }
- }
- Signal {
- name: "findTextFinished"
- revision: 10
- Parameter { name: "result"; type: "QWebEngineFindTextResult" }
- }
- Signal {
- name: "renderProcessPidChanged"
- revision: 11
- Parameter { name: "pid"; type: "qint64" }
- }
- Method {
- name: "runJavaScript"
- Parameter { type: "string" }
- Parameter { type: "QJSValue" }
- }
- Method {
- name: "runJavaScript"
- Parameter { type: "string" }
- }
- Method {
- name: "runJavaScript"
- revision: 3
- Parameter { type: "string" }
- Parameter { name: "worldId"; type: "uint" }
- Parameter { type: "QJSValue" }
- }
- Method {
- name: "runJavaScript"
- revision: 3
- Parameter { type: "string" }
- Parameter { name: "worldId"; type: "uint" }
- }
- Method {
- name: "loadHtml"
- Parameter { name: "html"; type: "string" }
- Parameter { name: "baseUrl"; type: "QUrl" }
- }
- Method {
- name: "loadHtml"
- Parameter { name: "html"; type: "string" }
- }
- Method { name: "goBack" }
- Method { name: "goForward" }
- Method {
- name: "goBackOrForward"
- revision: 1
- Parameter { name: "index"; type: "int" }
- }
- Method { name: "reload" }
- Method { name: "reloadAndBypassCache"; revision: 1 }
- Method { name: "stop" }
- Method {
- name: "findText"
- revision: 1
- Parameter { name: "subString"; type: "string" }
- Parameter { name: "options"; type: "FindFlags" }
- Parameter { name: "callback"; type: "QJSValue" }
- }
- Method {
- name: "findText"
- revision: 1
- Parameter { name: "subString"; type: "string" }
- Parameter { name: "options"; type: "FindFlags" }
- }
- Method {
- name: "findText"
- revision: 1
- Parameter { name: "subString"; type: "string" }
- }
- Method { name: "fullScreenCancelled"; revision: 1 }
- Method {
- name: "grantFeaturePermission"
- revision: 1
- Parameter { name: "securityOrigin"; type: "QUrl" }
- Parameter { type: "Feature" }
- Parameter { name: "granted"; type: "bool" }
- }
- Method {
- name: "setActiveFocusOnPress"
- revision: 2
- Parameter { name: "arg"; type: "bool" }
- }
- Method {
- name: "triggerWebAction"
- revision: 2
- Parameter { name: "action"; type: "WebAction" }
- }
- Method {
- name: "printToPdf"
- revision: 3
- Parameter { name: "filePath"; type: "string" }
- Parameter { name: "pageSizeId"; type: "PrintedPageSizeId" }
- Parameter { name: "orientation"; type: "PrintedPageOrientation" }
- }
- Method {
- name: "printToPdf"
- revision: 3
- Parameter { name: "filePath"; type: "string" }
- Parameter { name: "pageSizeId"; type: "PrintedPageSizeId" }
- }
- Method {
- name: "printToPdf"
- revision: 3
- Parameter { name: "filePath"; type: "string" }
- }
- Method {
- name: "printToPdf"
- revision: 3
- Parameter { name: "callback"; type: "QJSValue" }
- Parameter { name: "pageSizeId"; type: "PrintedPageSizeId" }
- Parameter { name: "orientation"; type: "PrintedPageOrientation" }
- }
- Method {
- name: "printToPdf"
- revision: 3
- Parameter { name: "callback"; type: "QJSValue" }
- Parameter { name: "pageSizeId"; type: "PrintedPageSizeId" }
- }
- Method {
- name: "printToPdf"
- revision: 3
- Parameter { name: "callback"; type: "QJSValue" }
- }
- Method {
- name: "replaceMisspelledWord"
- revision: 4
- Parameter { name: "replacement"; type: "string" }
- }
- Method {
- name: "action"
- revision: 8
- type: "QQuickWebEngineAction*"
- Parameter { name: "action"; type: "WebAction" }
- }
- }
- Component {
- name: "QWebEngineFindTextResult"
- exports: ["QtWebEngine/FindTextResult 1.10"]
- isCreatable: false
- exportMetaObjectRevisions: [0]
- Property { name: "numberOfMatches"; type: "int"; isReadonly: true }
- Property { name: "activeMatchOrdinal"; type: "int"; isReadonly: true }
- }
- Component {
- name: "QWebEngineNotification"
- prototype: "QObject"
- exports: ["QtWebEngine/WebEngineNotification 1.9"]
- isCreatable: false
- exportMetaObjectRevisions: [0]
- Property { name: "origin"; type: "QUrl"; isReadonly: true }
- Property { name: "title"; type: "string"; isReadonly: true }
- Property { name: "message"; type: "string"; isReadonly: true }
- Property { name: "tag"; type: "string"; isReadonly: true }
- Property { name: "language"; type: "string"; isReadonly: true }
- Property { name: "direction"; type: "Qt::LayoutDirection"; isReadonly: true }
- Signal { name: "closed" }
- Method { name: "show" }
- Method { name: "click" }
- Method { name: "close" }
- }
- Component {
- name: "QWebEngineQuotaRequest"
- exports: ["QtWebEngine/QuotaRequest 1.7"]
- isCreatable: false
- exportMetaObjectRevisions: [0]
- Property { name: "origin"; type: "QUrl"; isReadonly: true }
- Property { name: "requestedSize"; type: "qlonglong"; isReadonly: true }
- Method { name: "accept" }
- Method { name: "reject" }
- }
- Component {
- name: "QWebEngineRegisterProtocolHandlerRequest"
- exports: ["QtWebEngine/RegisterProtocolHandlerRequest 1.7"]
- isCreatable: false
- exportMetaObjectRevisions: [0]
- Property { name: "origin"; type: "QUrl"; isReadonly: true }
- Property { name: "scheme"; type: "string"; isReadonly: true }
- Method { name: "accept" }
- Method { name: "reject" }
- }
-}
diff --git a/src/webengine/plugin/qmldir b/src/webengine/plugin/qmldir
deleted file mode 100644
index 8970dc9c1..000000000
--- a/src/webengine/plugin/qmldir
+++ /dev/null
@@ -1,4 +0,0 @@
-module QtWebEngine
-plugin qtwebengineplugin
-classname QtWebEnginePlugin
-typeinfo plugins.qmltypes
diff --git a/src/webengine/render_widget_host_view_qt_delegate_quick.cpp b/src/webengine/render_widget_host_view_qt_delegate_quick.cpp
deleted file mode 100644
index 6a5bef16d..000000000
--- a/src/webengine/render_widget_host_view_qt_delegate_quick.cpp
+++ /dev/null
@@ -1,444 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "render_widget_host_view_qt_delegate_quick.h"
-
-#include "qquickwebengineview_p.h"
-#include "qquickwebengineview_p_p.h"
-#include <QGuiApplication>
-#include <QQuickPaintedItem>
-#include <QQuickWindow>
-#include <QSurfaceFormat>
-#include <QVariant>
-#include <QWindow>
-#include <QtQuick/private/qquickwindow_p.h>
-
-namespace QtWebEngineCore {
-
-RenderWidgetHostViewQtDelegateQuick::RenderWidgetHostViewQtDelegateQuick(RenderWidgetHostViewQtDelegateClient *client, bool isPopup)
- : m_client(client)
- , m_isPopup(isPopup)
-{
- setFlag(ItemHasContents);
- setAcceptedMouseButtons(Qt::AllButtons);
- setAcceptHoverEvents(true);
- if (isPopup)
- return;
- setFocus(true);
- setActiveFocusOnTab(true);
-
-#if defined(Q_OS_MACOS) && QT_CONFIG(opengl)
- // Check that the default QSurfaceFormat OpenGL profile is compatible with the global OpenGL
- // shared context profile, otherwise this could lead to a nasty crash.
- QOpenGLContext *globalSharedContext = QOpenGLContext::globalShareContext();
- if (globalSharedContext) {
- QSurfaceFormat sharedFormat = globalSharedContext->format();
- QSurfaceFormat defaultFormat = QSurfaceFormat::defaultFormat();
-
- if (defaultFormat.profile() != sharedFormat.profile()
- && defaultFormat.profile() == QSurfaceFormat::CoreProfile
- && defaultFormat.version() >= qMakePair(3, 2)) {
- qFatal("QWebEngine: Default QSurfaceFormat OpenGL profile is not compatible with the "
- "global shared context OpenGL profile. Please make sure you set a compatible "
- "QSurfaceFormat before the QtGui application instance is created.");
- }
- }
-#endif
-
-}
-
-RenderWidgetHostViewQtDelegateQuick::~RenderWidgetHostViewQtDelegateQuick()
-{
- QQuickWebEngineViewPrivate::bindViewAndWidget(nullptr, this);
-}
-
-void RenderWidgetHostViewQtDelegateQuick::initAsPopup(const QRect &r)
-{
- Q_ASSERT(m_isPopup && parentItem());
- QRectF rect(parentItem()->mapRectFromScene(r));
- setX(rect.x());
- setY(rect.y());
- setWidth(rect.width());
- setHeight(rect.height());
- setVisible(true);
-}
-
-QRectF RenderWidgetHostViewQtDelegateQuick::viewGeometry() const
-{
- // Transform the entire rect to find the correct top left corner.
- const QPointF p1 = mapToGlobal(mapFromScene(QPointF(0, 0)));
- const QPointF p2 = mapToGlobal(mapFromScene(QPointF(width(), height())));
- QRectF geometry = QRectF(p1, p2).normalized();
- // But keep the size untransformed to behave like other QQuickItems.
-#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
- geometry.setSize(size());
-#else
- geometry.setSize(QSizeF(width(), height()));
-#endif
- return geometry;
-}
-
-QRect RenderWidgetHostViewQtDelegateQuick::windowGeometry() const
-{
- if (!window())
- return QRect();
- return window()->frameGeometry();
-}
-
-void RenderWidgetHostViewQtDelegateQuick::setKeyboardFocus()
-{
- setFocus(true);
-}
-
-bool RenderWidgetHostViewQtDelegateQuick::hasKeyboardFocus()
-{
- return hasActiveFocus();
-}
-
-void RenderWidgetHostViewQtDelegateQuick::lockMouse()
-{
- grabMouse();
-}
-
-void RenderWidgetHostViewQtDelegateQuick::unlockMouse()
-{
- ungrabMouse();
-}
-
-void RenderWidgetHostViewQtDelegateQuick::show()
-{
- setVisible(true);
- m_client->notifyShown();
-}
-
-void RenderWidgetHostViewQtDelegateQuick::hide()
-{
- setVisible(false);
- m_client->notifyHidden();
-}
-
-bool RenderWidgetHostViewQtDelegateQuick::isVisible() const
-{
- return QQuickItem::isVisible();
-}
-
-QWindow* RenderWidgetHostViewQtDelegateQuick::window() const
-{
- return QQuickItem::window();
-}
-
-QSGTexture *RenderWidgetHostViewQtDelegateQuick::createTextureFromImage(const QImage &image)
-{
- return QQuickItem::window()->createTextureFromImage(image, QQuickWindow::TextureCanUseAtlas);
-}
-
-QSGLayer *RenderWidgetHostViewQtDelegateQuick::createLayer()
-{
- QSGRenderContext *renderContext = QQuickWindowPrivate::get(QQuickItem::window())->context;
- return renderContext->sceneGraphContext()->createLayer(renderContext);
-}
-
-QSGImageNode *RenderWidgetHostViewQtDelegateQuick::createImageNode()
-{
- return QQuickItem::window()->createImageNode();
-}
-
-QSGRectangleNode *RenderWidgetHostViewQtDelegateQuick::createRectangleNode()
-{
- return QQuickItem::window()->createRectangleNode();
-}
-
-void RenderWidgetHostViewQtDelegateQuick::update()
-{
- QQuickItem::update();
-}
-
-void RenderWidgetHostViewQtDelegateQuick::updateCursor(const QCursor &cursor)
-{
- setCursor(cursor);
-}
-
-void RenderWidgetHostViewQtDelegateQuick::resize(int width, int height)
-{
- setSize(QSizeF(width, height));
-}
-
-void RenderWidgetHostViewQtDelegateQuick::inputMethodStateChanged(bool editorVisible, bool passwordInput)
-{
- setFlag(QQuickItem::ItemAcceptsInputMethod, editorVisible && !passwordInput);
-
- if (parentItem())
- parentItem()->setFlag(QQuickItem::ItemAcceptsInputMethod, editorVisible && !passwordInput);
-
- qApp->inputMethod()->update(Qt::ImQueryInput | Qt::ImEnabled | Qt::ImHints);
- if (qApp->inputMethod()->isVisible() != editorVisible)
- qApp->inputMethod()->setVisible(editorVisible);
-}
-
-bool RenderWidgetHostViewQtDelegateQuick::event(QEvent *event)
-{
- if (event->type() == QEvent::ShortcutOverride)
- return m_client->forwardEvent(event);
-
-#ifndef QT_NO_GESTURES
- if (event->type() == QEvent::NativeGesture)
- return m_client->forwardEvent(event);
-#endif
-
- return QQuickItem::event(event);
-}
-
-void RenderWidgetHostViewQtDelegateQuick::focusInEvent(QFocusEvent *event)
-{
-#if QT_CONFIG(accessibility)
- if (QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(this)->focusChild()) {
- QAccessibleEvent focusEvent(iface, QAccessible::Focus);
- QAccessible::updateAccessibility(&focusEvent);
- }
-#endif // QT_CONFIG(accessibility)
-
- m_client->forwardEvent(event);
-}
-
-void RenderWidgetHostViewQtDelegateQuick::focusOutEvent(QFocusEvent *event)
-{
- m_client->forwardEvent(event);
-}
-
-void RenderWidgetHostViewQtDelegateQuick::mousePressEvent(QMouseEvent *event)
-{
- QQuickItem *parent = parentItem();
- if (!m_isPopup && (parent && parent->property("activeFocusOnPress").toBool()))
- forceActiveFocus();
- if (!m_isPopup && parent && !parent->property("activeFocusOnPress").toBool() && !parent->hasActiveFocus()) {
- event->ignore();
- return;
- }
- m_client->forwardEvent(event);
-}
-
-void RenderWidgetHostViewQtDelegateQuick::mouseMoveEvent(QMouseEvent *event)
-{
- QQuickItem *parent = parentItem();
- if (parent && !parent->property("activeFocusOnPress").toBool() && !parent->hasActiveFocus()) {
- event->ignore();
- return;
- }
- m_client->forwardEvent(event);
-}
-
-void RenderWidgetHostViewQtDelegateQuick::mouseReleaseEvent(QMouseEvent *event)
-{
- QQuickItem *parent = parentItem();
- if (!m_isPopup && parent && !parent->property("activeFocusOnPress").toBool() && !parent->hasActiveFocus()) {
- event->ignore();
- return;
- }
- m_client->forwardEvent(event);
-}
-
-void RenderWidgetHostViewQtDelegateQuick::keyPressEvent(QKeyEvent *event)
-{
- m_client->forwardEvent(event);
-}
-
-void RenderWidgetHostViewQtDelegateQuick::keyReleaseEvent(QKeyEvent *event)
-{
- m_client->forwardEvent(event);
-}
-
-void RenderWidgetHostViewQtDelegateQuick::wheelEvent(QWheelEvent *event)
-{
- m_client->forwardEvent(event);
-}
-
-void RenderWidgetHostViewQtDelegateQuick::touchEvent(QTouchEvent *event)
-{
- QQuickItem *parent = parentItem();
- if (event->type() == QEvent::TouchBegin && !m_isPopup
- && (parent && parent->property("activeFocusOnPress").toBool()))
- forceActiveFocus();
- if (parent && !parent->property("activeFocusOnPress").toBool() && !parent->hasActiveFocus()) {
- event->ignore();
- return;
- }
- m_client->forwardEvent(event);
-}
-
-void RenderWidgetHostViewQtDelegateQuick::hoverMoveEvent(QHoverEvent *event)
-{
- QQuickItem *parent = parentItem();
- if ((!m_isPopup && parent && !parent->property("activeFocusOnPress").toBool()
- && !parent->hasActiveFocus()) || event->posF() == event->oldPosF()) {
- event->ignore();
- return;
- }
- m_client->forwardEvent(event);
-}
-
-void RenderWidgetHostViewQtDelegateQuick::hoverLeaveEvent(QHoverEvent *event)
-{
- m_client->forwardEvent(event);
-}
-
-QVariant RenderWidgetHostViewQtDelegateQuick::inputMethodQuery(Qt::InputMethodQuery query) const
-{
- return m_client->inputMethodQuery(query);
-}
-
-void RenderWidgetHostViewQtDelegateQuick::inputMethodEvent(QInputMethodEvent *event)
-{
- m_client->forwardEvent(event);
-}
-
-void RenderWidgetHostViewQtDelegateQuick::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)
-{
- QQuickItem::geometryChanged(newGeometry, oldGeometry);
- m_client->visualPropertiesChanged();
-}
-
-void RenderWidgetHostViewQtDelegateQuick::itemChange(ItemChange change, const ItemChangeData &value)
-{
- QQuickItem::itemChange(change, value);
- if (change == QQuickItem::ItemSceneChange) {
- for (const QMetaObject::Connection &c : qAsConst(m_windowConnections))
- disconnect(c);
- m_windowConnections.clear();
- if (value.window) {
- m_windowConnections.append(connect(value.window, SIGNAL(xChanged(int)), SLOT(onWindowPosChanged())));
- m_windowConnections.append(connect(value.window, SIGNAL(yChanged(int)), SLOT(onWindowPosChanged())));
- if (!m_isPopup)
- m_windowConnections.append(connect(value.window, SIGNAL(closing(QQuickCloseEvent *)), SLOT(onHide())));
- }
- m_client->visualPropertiesChanged();
- } else if (change == QQuickItem::ItemVisibleHasChanged) {
- if (!m_isPopup && !value.boolValue)
- onHide();
- }
-}
-
-QSGNode *RenderWidgetHostViewQtDelegateQuick::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *)
-{
- return m_client->updatePaintNode(oldNode);
-}
-
-void RenderWidgetHostViewQtDelegateQuick::onWindowPosChanged()
-{
- m_client->visualPropertiesChanged();
-}
-
-void RenderWidgetHostViewQtDelegateQuick::onHide()
-{
- QFocusEvent event(QEvent::FocusOut, Qt::OtherFocusReason);
- m_client->forwardEvent(&event);
-}
-
-bool RenderWidgetHostViewQtDelegateQuick::copySurface(const QRect &rect, const QSize &size, QImage &image)
-{
- image = QQuickItem::window()->grabWindow();
- if (image.isNull())
- return false;
- QRect subrect = !rect.isEmpty() ? rect : image.rect();
- image = image.copy(subrect);
- image = image.scaled(size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
- return true;
-}
-
-#if QT_CONFIG(accessibility)
-RenderWidgetHostViewQtDelegateQuickAccessible::RenderWidgetHostViewQtDelegateQuickAccessible(RenderWidgetHostViewQtDelegateQuick *o, QQuickWebEngineView *view)
- : QAccessibleObject(o)
- , m_view(view)
-{
-}
-
-bool RenderWidgetHostViewQtDelegateQuickAccessible::isValid() const
-{
- if (!viewAccessible() || !viewAccessible()->isValid())
- return false;
-
- return QAccessibleObject::isValid();
-}
-
-QAccessibleInterface *RenderWidgetHostViewQtDelegateQuickAccessible::parent() const
-{
- return viewAccessible()->parent();
-}
-
-QString RenderWidgetHostViewQtDelegateQuickAccessible::text(QAccessible::Text) const
-{
- return QString();
-}
-
-QAccessible::Role RenderWidgetHostViewQtDelegateQuickAccessible::role() const
-{
- return QAccessible::Client;
-}
-
-QAccessible::State RenderWidgetHostViewQtDelegateQuickAccessible::state() const
-{
- return viewAccessible()->state();
-}
-
-QAccessibleInterface *RenderWidgetHostViewQtDelegateQuickAccessible::focusChild() const
-{
- return viewAccessible()->focusChild();
-}
-
-int RenderWidgetHostViewQtDelegateQuickAccessible::childCount() const
-{
- return viewAccessible()->childCount();
-}
-
-QAccessibleInterface *RenderWidgetHostViewQtDelegateQuickAccessible::child(int index) const
-{
- return viewAccessible()->child(index);
-}
-
-int RenderWidgetHostViewQtDelegateQuickAccessible::indexOfChild(const QAccessibleInterface *c) const
-{
- return viewAccessible()->indexOfChild(c);
-}
-
-QQuickWebEngineViewAccessible *RenderWidgetHostViewQtDelegateQuickAccessible::viewAccessible() const
-{
- return static_cast<QQuickWebEngineViewAccessible *>(QAccessible::queryAccessibleInterface(m_view));
-}
-#endif // QT_CONFIG(accessibility)
-
-} // namespace QtWebEngineCore
diff --git a/src/webengine/render_widget_host_view_qt_delegate_quick.h b/src/webengine/render_widget_host_view_qt_delegate_quick.h
deleted file mode 100644
index f70de50d7..000000000
--- a/src/webengine/render_widget_host_view_qt_delegate_quick.h
+++ /dev/null
@@ -1,145 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef RENDER_WIDGET_HOST_VIEW_QT_DELEGATE_QUICK_H
-#define RENDER_WIDGET_HOST_VIEW_QT_DELEGATE_QUICK_H
-
-#include "render_widget_host_view_qt_delegate.h"
-
-#include <QAccessibleObject>
-#include <QQuickItem>
-
-QT_BEGIN_NAMESPACE
-class QQuickWebEngineView;
-class QQuickWebEngineViewAccessible;
-class QQuickWebEngineViewPrivate;
-QT_END_NAMESPACE
-
-namespace QtWebEngineCore {
-
-class RenderWidgetHostViewQtDelegateQuick : public QQuickItem, public RenderWidgetHostViewQtDelegate
-{
- Q_OBJECT
-public:
- RenderWidgetHostViewQtDelegateQuick(RenderWidgetHostViewQtDelegateClient *client, bool isPopup);
- ~RenderWidgetHostViewQtDelegateQuick();
-
- void initAsPopup(const QRect&) override;
- QRectF viewGeometry() const override;
- QRect windowGeometry() const override;
- void setKeyboardFocus() override;
- bool hasKeyboardFocus() override;
- void lockMouse() override;
- void unlockMouse() override;
- void show() override;
- void hide() override;
- bool isVisible() const override;
- QWindow* window() const override;
- QSGTexture *createTextureFromImage(const QImage &) override;
- QSGLayer *createLayer() override;
- QSGImageNode *createImageNode() override;
- QSGRectangleNode *createRectangleNode() override;
- void update() override;
- void updateCursor(const QCursor &) override;
- void resize(int width, int height) override;
- void move(const QPoint&) override { }
- void inputMethodStateChanged(bool editorVisible, bool isPasswordInput) override;
- void setInputMethodHints(Qt::InputMethodHints) override { }
- // The QtQuick view doesn't have a backbuffer of its own and doesn't need this
- void setClearColor(const QColor &) override { }
- bool copySurface(const QRect &rect, const QSize &size, QImage &image) override;
-
-protected:
- bool event(QEvent *event) override;
- void focusInEvent(QFocusEvent *event) override;
- void focusOutEvent(QFocusEvent *event) override;
- void mousePressEvent(QMouseEvent *event) override;
- void mouseMoveEvent(QMouseEvent *event) override;
- void mouseReleaseEvent(QMouseEvent *event) override;
- void keyPressEvent(QKeyEvent *event) override;
- void keyReleaseEvent(QKeyEvent *event) override;
- void wheelEvent(QWheelEvent *event) override;
- void touchEvent(QTouchEvent *event) override;
- void hoverMoveEvent(QHoverEvent *event) override;
- void hoverLeaveEvent(QHoverEvent *event) override;
- QVariant inputMethodQuery(Qt::InputMethodQuery query) const override;
- void inputMethodEvent(QInputMethodEvent *event) override;
- void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override;
- void itemChange(ItemChange change, const ItemChangeData &value) override;
- QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override;
-
-private slots:
- void onWindowPosChanged();
- void onHide();
-
-private:
- friend QQuickWebEngineViewPrivate;
-
- RenderWidgetHostViewQtDelegateClient *m_client;
- QList<QMetaObject::Connection> m_windowConnections;
- bool m_isPopup;
- QQuickWebEngineView *m_view = nullptr;
-};
-
-#if QT_CONFIG(accessibility)
-class RenderWidgetHostViewQtDelegateQuickAccessible : public QAccessibleObject
-{
-public:
- RenderWidgetHostViewQtDelegateQuickAccessible(RenderWidgetHostViewQtDelegateQuick *o, QQuickWebEngineView *view);
-
- bool isValid() const override;
- QAccessibleInterface *parent() const override;
- QString text(QAccessible::Text t) const override;
- QAccessible::Role role() const override;
- QAccessible::State state() const override;
-
- QAccessibleInterface *focusChild() const override;
- int childCount() const override;
- QAccessibleInterface *child(int index) const override;
- int indexOfChild(const QAccessibleInterface *) const override;
-
-private:
- QQuickWebEngineViewAccessible *viewAccessible() const;
- QQuickWebEngineView *m_view;
-};
-#endif // QT_CONFIG(accessibility)
-
-} // namespace QtWebEngineCore
-
-#endif
diff --git a/src/webengine/render_widget_host_view_qt_delegate_quickwindow.cpp b/src/webengine/render_widget_host_view_qt_delegate_quickwindow.cpp
deleted file mode 100644
index 1de4d8835..000000000
--- a/src/webengine/render_widget_host_view_qt_delegate_quickwindow.cpp
+++ /dev/null
@@ -1,171 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "render_widget_host_view_qt_delegate_quickwindow.h"
-
-#include "qquickwebengineview_p_p.h"
-#include <QQuickItem>
-
-namespace QtWebEngineCore {
-
-RenderWidgetHostViewQtDelegateQuickWindow::RenderWidgetHostViewQtDelegateQuickWindow(RenderWidgetHostViewQtDelegateQuick *realDelegate)
- : m_realDelegate(realDelegate)
- , m_virtualParent(nullptr)
-{
- setFlags(Qt::Tool | Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::WindowDoesNotAcceptFocus);
-}
-
-RenderWidgetHostViewQtDelegateQuickWindow::~RenderWidgetHostViewQtDelegateQuickWindow()
-{
-}
-
-void RenderWidgetHostViewQtDelegateQuickWindow::setVirtualParent(QQuickItem *virtualParent)
-{
- Q_ASSERT(virtualParent);
- m_virtualParent = virtualParent;
-}
-
-static inline QRectF mapRectToGlobal(const QQuickItem *item, const QRectF &rect)
-{
- const QPointF p1 = item->mapToGlobal(rect.topLeft());
- const QPointF p2 = item->mapToGlobal(rect.bottomRight());
- return QRectF(p1, p2).normalized();
-}
-
-static inline QRectF mapRectFromGlobal(const QQuickItem *item, const QRectF &rect)
-{
- const QPointF p1 = item->mapFromGlobal(rect.topLeft());
- const QPointF p2 = item->mapFromGlobal(rect.bottomRight());
- return QRectF(p1, p2).normalized();
-}
-
-void RenderWidgetHostViewQtDelegateQuickWindow::initAsPopup(const QRect &screenRect)
-{
- QRectF popupRect(screenRect);
- popupRect = mapRectFromGlobal(m_virtualParent, popupRect);
- popupRect = m_virtualParent->mapRectToScene(popupRect);
- popupRect = mapRectToGlobal(m_virtualParent, popupRect);
-
- m_realDelegate->initAsPopup(QRect(QPoint(0, 0), popupRect.size().toSize()));
- popupRect.setSize(screenRect.size());
- setGeometry(popupRect.toAlignedRect());
- raise();
- show();
-}
-
-QRectF RenderWidgetHostViewQtDelegateQuickWindow::viewGeometry() const
-{
- return geometry();
-}
-
-QRect RenderWidgetHostViewQtDelegateQuickWindow::windowGeometry() const
-{
- return frameGeometry();
-}
-
-void RenderWidgetHostViewQtDelegateQuickWindow::show()
-{
- QQuickWindow::show();
- m_realDelegate->show();
-}
-
-void RenderWidgetHostViewQtDelegateQuickWindow::hide()
-{
- QQuickWindow::hide();
- m_realDelegate->hide();
-}
-
-bool RenderWidgetHostViewQtDelegateQuickWindow::isVisible() const
-{
- return QQuickWindow::isVisible();
-}
-
-QWindow *RenderWidgetHostViewQtDelegateQuickWindow::window() const
-{
- return const_cast<RenderWidgetHostViewQtDelegateQuickWindow*>(this);
-}
-
-QSGTexture *RenderWidgetHostViewQtDelegateQuickWindow::createTextureFromImage(const QImage &image)
-{
- return m_realDelegate->createTextureFromImage(image);
-}
-
-QSGLayer *RenderWidgetHostViewQtDelegateQuickWindow::createLayer()
-{
- return m_realDelegate->createLayer();
-}
-
-QSGImageNode *RenderWidgetHostViewQtDelegateQuickWindow::createImageNode()
-{
- return m_realDelegate->createImageNode();
-}
-
-QSGRectangleNode *RenderWidgetHostViewQtDelegateQuickWindow::createRectangleNode()
-{
- return m_realDelegate->createRectangleNode();
-}
-
-void RenderWidgetHostViewQtDelegateQuickWindow::update()
-{
- QQuickWindow::update();
- m_realDelegate->update();
-}
-
-void RenderWidgetHostViewQtDelegateQuickWindow::updateCursor(const QCursor &cursor)
-{
- setCursor(cursor);
-}
-
-void RenderWidgetHostViewQtDelegateQuickWindow::resize(int width, int height)
-{
- QQuickWindow::resize(width, height);
- m_realDelegate->resize(width, height);
-}
-
-void RenderWidgetHostViewQtDelegateQuickWindow::move(const QPoint &screenPos)
-{
- QRectF popupRect(screenPos, size());
- popupRect = mapRectFromGlobal(m_virtualParent, popupRect);
- popupRect = m_virtualParent->mapRectToScene(popupRect);
- popupRect = mapRectToGlobal(m_virtualParent, popupRect);
-
- QQuickWindow::setPosition(popupRect.topLeft().toPoint());
-}
-
-} // namespace QtWebEngineCore
diff --git a/src/webengine/render_widget_host_view_qt_delegate_quickwindow.h b/src/webengine/render_widget_host_view_qt_delegate_quickwindow.h
deleted file mode 100644
index bebbfa439..000000000
--- a/src/webengine/render_widget_host_view_qt_delegate_quickwindow.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef RENDER_WIDGET_HOST_VIEW_QT_DELEGATE_QUICKWINDOW_H
-#define RENDER_WIDGET_HOST_VIEW_QT_DELEGATE_QUICKWINDOW_H
-
-#include "render_widget_host_view_qt_delegate.h"
-
-#include "render_widget_host_view_qt_delegate_quick.h"
-
-#include <QQuickWindow>
-#include <QScopedPointer>
-
-namespace QtWebEngineCore {
-
-class RenderWidgetHostViewQtDelegateQuickWindow : public QQuickWindow , public RenderWidgetHostViewQtDelegate {
-
-public:
- RenderWidgetHostViewQtDelegateQuickWindow(RenderWidgetHostViewQtDelegateQuick *realDelegate);
- ~RenderWidgetHostViewQtDelegateQuickWindow();
-
- void initAsPopup(const QRect&) override;
- QRectF viewGeometry() const override;
- QRect windowGeometry() const override;
- void setKeyboardFocus() override {}
- bool hasKeyboardFocus() override { return false; }
- void lockMouse() override {}
- void unlockMouse() override {}
- void show() override;
- void hide() override;
- bool isVisible() const override;
- QWindow* window() const override;
- QSGTexture *createTextureFromImage(const QImage &) override;
- QSGLayer *createLayer() override;
- QSGImageNode *createImageNode() override;
- QSGRectangleNode *createRectangleNode() override;
- void update() override;
- void updateCursor(const QCursor &) override;
- void resize(int width, int height) override;
- void move(const QPoint &screenPos) override;
- void inputMethodStateChanged(bool, bool) override {}
- void setInputMethodHints(Qt::InputMethodHints) override { }
- void setClearColor(const QColor &) override { }
- bool copySurface(const QRect &, const QSize &, QImage &) override { return false; }
-
- void setVirtualParent(QQuickItem *virtualParent);
-
-private:
- QScopedPointer<RenderWidgetHostViewQtDelegateQuick> m_realDelegate;
- QQuickItem *m_virtualParent;
-};
-
-} // namespace QtWebEngineCore
-
-#endif // RENDER_WIDGET_HOST_VIEW_QT_DELEGATE_QUICKWINDOW_H
diff --git a/src/webengine/testsupport/plugin.cpp b/src/webengine/testsupport/plugin.cpp
deleted file mode 100644
index 7a1e73d8b..000000000
--- a/src/webengine/testsupport/plugin.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtQml>
-
-#include <QtWebEngine/private/qquickwebenginetestsupport_p.h>
-
-QT_BEGIN_NAMESPACE
-
-class QtWebEngineTestSupportPlugin : public QQmlExtensionPlugin
-{
- Q_OBJECT
- Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
-public:
- virtual void registerTypes(const char *uri)
- {
- qWarning("\nWARNING: This project is using the testsupport QML API extensions for QtWebEngine and is therefore tied to a specific QtWebEngine release.\n"
- "WARNING: The testsupport API will change from version to version, or even be removed. You have been warned!\n");
-
- Q_ASSERT(QLatin1String(uri) == QLatin1String("QtWebEngine.testsupport"));
-
- qmlRegisterType<QQuickWebEngineTestSupport>(uri, 1, 0, "WebEngineTestSupport");
- qmlRegisterUncreatableType<QQuickWebEngineErrorPage>(uri, 1, 0, "WebEngineErrorPage",
- tr("Cannot create a separate instance of WebEngineErrorPage"));
- qmlRegisterUncreatableType<QQuickWebEngineTestInputContext>(uri, 1, 0, "TestInputContext",
- tr("Cannot create a separate instance of WebEngineErrorPage"));
- qmlRegisterUncreatableType<QQuickWebEngineTestEvent>(uri, 1, 0, "WebEngineTestEvent",
- tr("Cannot create a separate instance of WebEngineTestEvent"));
- }
-};
-
-QT_END_NAMESPACE
-
-#include "plugin.moc"
diff --git a/src/webengine/testsupport/plugins.qmltypes b/src/webengine/testsupport/plugins.qmltypes
deleted file mode 100644
index 12c763724..000000000
--- a/src/webengine/testsupport/plugins.qmltypes
+++ /dev/null
@@ -1,73 +0,0 @@
-import QtQuick.tooling 1.2
-
-// This file describes the plugin-supplied types contained in the library.
-// It is used for QML tooling purposes only.
-//
-// This file was auto-generated by:
-// 'qmlplugindump -nonrelocatable QtWebEngine.testsupport 1.0'
-
-Module {
- dependencies: ["QtQuick 2.0"]
- Component { name: "QPlatformInputContext"; prototype: "QObject" }
- Component {
- name: "QQuickWebEngineErrorPage"
- prototype: "QObject"
- exports: ["QtWebEngine.testsupport/WebEngineErrorPage 1.0"]
- isCreatable: false
- exportMetaObjectRevisions: [0]
- Signal {
- name: "loadingChanged"
- Parameter { name: "loadRequest"; type: "QQuickWebEngineLoadRequest"; isPointer: true }
- }
- }
- Component {
- name: "QQuickWebEngineTestEvent"
- prototype: "QObject"
- exports: ["QtWebEngine.testsupport/WebEngineTestEvent 1.0"]
- isCreatable: false
- exportMetaObjectRevisions: [0]
- Method {
- name: "mouseMultiClick"
- type: "bool"
- Parameter { name: "item"; type: "QObject"; isPointer: true }
- Parameter { name: "x"; type: "double" }
- Parameter { name: "y"; type: "double" }
- Parameter { name: "clickCount"; type: "int" }
- }
- }
- Component {
- name: "QQuickWebEngineTestInputContext"
- prototype: "QPlatformInputContext"
- exports: ["QtWebEngine.testsupport/TestInputContext 1.0"]
- isCreatable: false
- exportMetaObjectRevisions: [0]
- Method { name: "create" }
- Method { name: "release" }
- }
- Component {
- name: "QQuickWebEngineTestSupport"
- prototype: "QObject"
- exports: ["QtWebEngine.testsupport/WebEngineTestSupport 1.0"]
- exportMetaObjectRevisions: [0]
- Property {
- name: "errorPage"
- type: "QQuickWebEngineErrorPage"
- isReadonly: true
- isPointer: true
- }
- Property {
- name: "testInputContext"
- type: "QQuickWebEngineTestInputContext"
- isReadonly: true
- isPointer: true
- }
- Property {
- name: "testEvent"
- type: "QQuickWebEngineTestEvent"
- isReadonly: true
- isPointer: true
- }
- Signal { name: "windowCloseRejected" }
- Signal { name: "loadVisuallyCommitted" }
- }
-}
diff --git a/src/webengine/testsupport/qmldir b/src/webengine/testsupport/qmldir
deleted file mode 100644
index 7fff80251..000000000
--- a/src/webengine/testsupport/qmldir
+++ /dev/null
@@ -1,4 +0,0 @@
-module QtWebEngine.testsupport
-plugin qtwebenginetestsupportplugin
-classname QtWebEngineTestSupportPlugin
-typeinfo plugins.qmltypes
diff --git a/src/webengine/testsupport/testsupport.pro b/src/webengine/testsupport/testsupport.pro
deleted file mode 100644
index a24796675..000000000
--- a/src/webengine/testsupport/testsupport.pro
+++ /dev/null
@@ -1,11 +0,0 @@
-CXX_MODULE = qml
-TARGET = qtwebenginetestsupportplugin
-TARGETPATH = QtWebEngine/testsupport
-IMPORT_VERSION = 1.0
-
-QT += qml quick
-QT_PRIVATE += webengine-private gui-private
-
-SOURCES = plugin.cpp
-
-load(qml_plugin)
diff --git a/src/webengine/ui/AlertDialog.qml b/src/webengine/ui/AlertDialog.qml
deleted file mode 100644
index 07f2d7df5..000000000
--- a/src/webengine/ui/AlertDialog.qml
+++ /dev/null
@@ -1,44 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick.Dialogs 1.2
-
-MessageDialog {
- icon: StandardIcon.Information
-}
diff --git a/src/webengine/ui/AuthenticationDialog.qml b/src/webengine/ui/AuthenticationDialog.qml
deleted file mode 100644
index a7eedd14d..000000000
--- a/src/webengine/ui/AuthenticationDialog.qml
+++ /dev/null
@@ -1,131 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-// FIXME: authentication missing in Qt Quick Dialogs atm. Make our own for now.
-import QtQuick 2.5
-import QtQuick.Controls 1.4
-import QtQuick.Layouts 1.0
-import QtQuick.Window 2.2
-
-Window {
- signal accepted(string user, string password)
- signal rejected
- property alias text: message.text
-
- title: qsTr("Authentication Required")
- flags: Qt.Dialog
- modality: Qt.WindowModal
-
- width: minimumWidth
- height: minimumHeight
- minimumWidth: rootLayout.implicitWidth + rootLayout.doubleMargins
- minimumHeight: rootLayout.implicitHeight + rootLayout.doubleMargins
-
- SystemPalette { id: palette; colorGroup: SystemPalette.Active }
- color: palette.window
-
- function open() {
- show();
- }
-
- function acceptDialog() {
- accepted(userField.text, passwordField.text);
- close();
- }
-
- ColumnLayout {
- id: rootLayout
- anchors.fill: parent
- anchors.margins: 4
- property int doubleMargins: anchors.margins * 2
- Text {
- id: message
- color: palette.windowText
- }
- GridLayout {
- columns: 2
- Label {
- text: qsTr("Username:")
- color: palette.windowText
- }
- TextField {
- id: userField
- focus: true
- Layout.fillWidth: true
- onAccepted: {
- if (userField.text && passwordField.text)
- acceptDialog();
- }
- }
- Label {
- text: qsTr("Password:")
- color: palette.windowText
- }
- TextField {
- id: passwordField
- Layout.fillWidth: true
- echoMode: TextInput.Password
- onAccepted: {
- if (userField.text && passwordField.text)
- acceptDialog();
- }
- }
- }
- Item {
- Layout.fillHeight: true
- }
- RowLayout {
- Layout.alignment: Qt.AlignRight
- spacing: 8
- Button {
- id: cancelButton
- text: qsTr("&Cancel")
- onClicked: {
- rejected();
- close();
- }
- }
- Button {
- text: qsTr("&Log In")
- isDefault: true
- onClicked: acceptDialog()
- }
- }
- }
-}
diff --git a/src/webengine/ui/ColorDialog.qml b/src/webengine/ui/ColorDialog.qml
deleted file mode 100644
index b74fd2cd7..000000000
--- a/src/webengine/ui/ColorDialog.qml
+++ /dev/null
@@ -1,50 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick.Dialogs 1.2
-
-ColorDialog {
- id: colorDialog
-
- signal selectedColor(var color)
-
- onAccepted: {
- selectedColor(colorDialog.currentColor);
- }
-}
diff --git a/src/webengine/ui/ConfirmDialog.qml b/src/webengine/ui/ConfirmDialog.qml
deleted file mode 100644
index aab4db04a..000000000
--- a/src/webengine/ui/ConfirmDialog.qml
+++ /dev/null
@@ -1,45 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick.Dialogs 1.1
-
-MessageDialog {
- icon: StandardIcon.Question
- standardButtons: StandardButton.Ok | StandardButton.Cancel
-}
diff --git a/src/webengine/ui/FilePicker.qml b/src/webengine/ui/FilePicker.qml
deleted file mode 100644
index e6af977ba..000000000
--- a/src/webengine/ui/FilePicker.qml
+++ /dev/null
@@ -1,49 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick.Dialogs 1.1
-
-FileDialog {
-
- signal filesSelected(var fileList)
-
- onAccepted: {
- filesSelected(fileUrls);
- }
-}
diff --git a/src/webengine/ui/Menu.qml b/src/webengine/ui/Menu.qml
deleted file mode 100644
index 36efa7680..000000000
--- a/src/webengine/ui/Menu.qml
+++ /dev/null
@@ -1,57 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.5
-import QtQuick.Controls 1.4 as Controls
-
-Controls.Menu {
- id: menu
- signal done()
-
- // Use private API for now
- onAboutToHide: doneTimer.start()
-
- // WORKAROUND On Mac the Menu may be destroyed before the MenuItem
- // is actually triggered (see qtbase commit 08cc9b9991ae9ab51)
- Timer {
- id: doneTimer
- interval: 100
- onTriggered: menu.done()
- }
-}
diff --git a/src/webengine/ui/MenuItem.qml b/src/webengine/ui/MenuItem.qml
deleted file mode 100644
index e61f4c230..000000000
--- a/src/webengine/ui/MenuItem.qml
+++ /dev/null
@@ -1,44 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.5
-import QtQuick.Controls 1.4 as Controls
-
-Controls.MenuItem { }
-
diff --git a/src/webengine/ui/MenuSeparator.qml b/src/webengine/ui/MenuSeparator.qml
deleted file mode 100644
index 8427865cb..000000000
--- a/src/webengine/ui/MenuSeparator.qml
+++ /dev/null
@@ -1,43 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.5
-import QtQuick.Controls 1.4 as Controls
-
-Controls.MenuSeparator { }
diff --git a/src/webengine/ui/PromptDialog.qml b/src/webengine/ui/PromptDialog.qml
deleted file mode 100644
index c4dcd6b98..000000000
--- a/src/webengine/ui/PromptDialog.qml
+++ /dev/null
@@ -1,98 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-// FIXME: prompt missing in Qt Quick Dialogs atm. Make our own for now.
-import QtQuick.Controls 1.4
-import QtQuick.Layouts 1.0
-import QtQuick 2.5
-
-ApplicationWindow {
- signal input(string text)
- signal accepted
- signal rejected
- property alias text: message.text
- property alias prompt: field.text
-
- width: 350
- height: 100
- flags: Qt.Dialog
-
- onClosing: {
- rejected();
- }
-
- function open() {
- show();
- }
-
- ColumnLayout {
- anchors.fill: parent
- anchors.margins: 4
- Text {
- id: message
- Layout.fillWidth: true
- }
- TextField {
- id:field
- Layout.fillWidth: true
- }
- RowLayout {
- Layout.alignment: Qt.AlignRight
- spacing: 8
- Button {
- text: qsTr("OK")
- onClicked: {
- input(field.text);
- accepted();
- close();
- destroy();
- }
- }
- Button {
- text: qsTr("Cancel")
- onClicked: {
- rejected();
- close();
- destroy();
- }
- }
- }
- }
-
-}
diff --git a/src/webengine/ui/ToolTip.qml b/src/webengine/ui/ToolTip.qml
deleted file mode 100644
index 2bfe9eaf5..000000000
--- a/src/webengine/ui/ToolTip.qml
+++ /dev/null
@@ -1,93 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.5
-
-Item {
- id: toolTipContainer
- z: 9999
- width: content.width
- height: content.height
- visible: false
-
- property alias text: toolTip.text
- property int delayTimerInterval: 500
- property int hideTimerInterval: 10000
- property int toolTipMaxWidth: 400
-
- Timer {
- id: delayTimer
- interval: delayTimerInterval
- onTriggered: {
- toolTipContainer.visible = true
- hideTimer.start()
- }
- }
-
- Timer {
- id: hideTimer
- interval: hideTimerInterval
- onTriggered: toolTipContainer.visible = false
- }
-
- Rectangle {
- id: content
- color: "#f8eabf"
- border.color: "black"
- anchors.centerIn: parent
- width: toolTip.contentWidth + 10
- height: toolTip.contentHeight + 10
- radius: 3
-
- Text {
- id: toolTip
- anchors {fill: parent; margins: 5}
- wrapMode: Text.Wrap
- width: Math.min(toolTipMaxWidth, (toolTip.text.length +1) * 8)
- }
- }
-
- function open() {
- delayTimer.start();
- }
-
- function hide() {
- hideTimer.start();
- }
-}
diff --git a/src/webengine/ui/TouchHandle.qml b/src/webengine/ui/TouchHandle.qml
deleted file mode 100644
index 76a93829e..000000000
--- a/src/webengine/ui/TouchHandle.qml
+++ /dev/null
@@ -1,42 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.5
-
-Image { }
diff --git a/src/webengine/ui/TouchSelectionMenu.qml b/src/webengine/ui/TouchSelectionMenu.qml
deleted file mode 100644
index 7cf16b554..000000000
--- a/src/webengine/ui/TouchSelectionMenu.qml
+++ /dev/null
@@ -1,175 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.5
-import QtQuick.Layouts 1.3
-
-Rectangle {
- id: menu
-
- signal cutTriggered
- signal copyTriggered
- signal pasteTriggered
- signal contextMenuTriggered
-
- property bool isCutEnabled: false
- property bool isCopyEnabled: false
- property bool isPasteEnabled: false
-
- property color borderColor: "darkGray"
- property color bgColor: "white"
-
- radius: 4
- border.color: borderColor
- color: borderColor
- antialiasing: true
-
- RowLayout {
- anchors.fill: parent
- spacing: parent.border.width
- anchors.margins: parent.border.width
-
- Rectangle {
- Layout.fillHeight: true
- Layout.fillWidth: true
- radius: menu.radius
- color: bgColor
- visible: isCutEnabled
-
- Text {
- id: cutText
- anchors.centerIn: parent
- text: "Cut"
- }
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- parent.color = borderColor;
- cutText.color = "white";
- }
- onReleased: {
- parent.color = bgColor;
- cutText.color = "black";
- cutTriggered();
- }
- }
- }
-
- Rectangle {
- Layout.fillHeight: true
- Layout.fillWidth: true
- radius: menu.radius
- color: bgColor
- visible: isCopyEnabled
-
- Text {
- id: copyText
- anchors.centerIn: parent
- text: "Copy"
- }
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- parent.color = borderColor;
- copyText.color = "white";
- }
- onReleased: {
- parent.color = bgColor;
- copyText.color = "black";
- copyTriggered();
- }
- }
- }
-
- Rectangle {
- Layout.fillHeight: true
- Layout.fillWidth: true
- radius: menu.radius
- color: bgColor
- visible: isPasteEnabled
-
- Text {
- id: pasteText
- anchors.centerIn: parent
- text: "Paste"
- }
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- parent.color = borderColor;
- pasteText.color = "white";
- }
- onReleased: {
- parent.color = bgColor;
- pasteText.color = "black";
- pasteTriggered();
- }
- }
- }
-
- Rectangle {
- Layout.fillHeight: true
- Layout.fillWidth: true
- radius: menu.radius
- color: bgColor
-
- Text {
- id: contextMenuText
- anchors.centerIn: parent
- text: "..."
- }
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- parent.color = borderColor;
- contextMenuText.color = "white";
- }
- onReleased: {
- parent.color = bgColor;
- contextMenuText.color = "black";
- contextMenuTriggered();
- }
- }
- }
- }
-}
diff --git a/src/webengine/ui/qmldir b/src/webengine/ui/qmldir
deleted file mode 100644
index e23b972be..000000000
--- a/src/webengine/ui/qmldir
+++ /dev/null
@@ -1,8 +0,0 @@
-module QtWebEngine.Controls1Delegates
-AlertDialog 1.0 AlertDialog.qml
-ConfirmDialog 1.0 ConfirmDialog.qml
-FilePicker 1.0 FilePicker.qml
-PromptDialog 1.0 PromptDialog.qml
-Menu 1.0 Menu.qml
-MenuItem 1.0 MenuItem.qml
-MenuSeparator 1.0 MenuSeparator.qml
diff --git a/src/webengine/ui/ui.pro b/src/webengine/ui/ui.pro
deleted file mode 100644
index 69f754e0c..000000000
--- a/src/webengine/ui/ui.pro
+++ /dev/null
@@ -1,20 +0,0 @@
-TARGETPATH = QtWebEngine/Controls1Delegates
-
-QML_FILES += \
- # Authentication Dialog
- AuthenticationDialog.qml \
- # JS Dialogs
- AlertDialog.qml \
- ColorDialog.qml \
- ConfirmDialog.qml \
- FilePicker.qml \
- PromptDialog.qml \
- # Menus. Based on Qt Quick Controls
- Menu.qml \
- MenuItem.qml \
- MenuSeparator.qml \
- ToolTip.qml \
- TouchHandle.qml \
- TouchSelectionMenu.qml
-
-load(qml_module)
diff --git a/src/webengine/ui2/AlertDialog.qml b/src/webengine/ui2/AlertDialog.qml
deleted file mode 100644
index 4f63c5b70..000000000
--- a/src/webengine/ui2/AlertDialog.qml
+++ /dev/null
@@ -1,98 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.5
-import QtQuick.Controls 2.0 as Controls
-import QtQuick.Dialogs 1.2
-import QtQuick.Layouts 1.0
-
-Dialog {
- property alias text: message.text
- property bool handled: false
- signal accepted()
- signal rejected()
- title: qsTr("Alert Dialog")
- modality: Qt.NonModal
-
- //handle the case where users simply closes the dialog
- onVisibilityChanged: {
- if (visible == false && handled == false) {
- handled = true;
- rejected();
- } else {
- handled = false;
- }
- }
-
- function acceptDialog() {
- accepted();
- handled = true;
- close();
- }
-
- contentItem: ColumnLayout {
- id: rootLayout
- anchors.fill: parent
- anchors.margins: 4
- property int minimumWidth: rootLayout.implicitWidth + rootLayout.doubleMargins
- property int minimumHeight: rootLayout.implicitHeight + rootLayout.doubleMargins
- property int doubleMargins: anchors.margins * 2
- SystemPalette { id: palette; colorGroup: SystemPalette.Active }
- RowLayout {
- Layout.alignment: Qt.AlignRight
- spacing: 8
- Image {
- source: "information.png"
- }
- Text {
- id: message
- Layout.fillWidth: true
- color: palette.windowText
- }
- }
- Item {
- Layout.fillHeight: true
- }
- Controls.Button {
- Layout.alignment: Qt.AlignHCenter
- text: qsTr("OK")
- onClicked: acceptDialog()
- }
- }
-}
diff --git a/src/webengine/ui2/AuthenticationDialog.qml b/src/webengine/ui2/AuthenticationDialog.qml
deleted file mode 100644
index 52fcce3f1..000000000
--- a/src/webengine/ui2/AuthenticationDialog.qml
+++ /dev/null
@@ -1,135 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.5
-import QtQuick.Controls 2.0 as Controls
-import QtQuick.Dialogs 1.2
-import QtQuick.Layouts 1.0
-
-Dialog {
- property alias text: message.text
- property bool handled: false
- signal accepted(string user, string password)
- signal rejected()
- title: qsTr("Authentication Required")
- modality: Qt.NonModal
-
- //handle the case where users simply closes the dialog
- onVisibilityChanged: {
- if (visible == false && handled == false) {
- handled = true;
- rejected();
- } else {
- handled = false;
- }
- }
-
- function acceptDialog() {
- accepted(userField.text, passwordField.text);
- handled = true;
- close();
- }
-
- function rejectDialog() {
- rejected();
- handled = true;
- close();
- }
-
- contentItem: ColumnLayout {
- id: rootLayout
- anchors.fill: parent
- anchors.margins: 4
- property int minimumWidth: rootLayout.implicitWidth + rootLayout.doubleMargins
- property int minimumHeight: rootLayout.implicitHeight + rootLayout.doubleMargins
-
- property int doubleMargins: anchors.margins * 2
-
- SystemPalette { id: palette; colorGroup: SystemPalette.Active }
- Text {
- id: message
- color: palette.windowText
- }
- GridLayout {
- columns: 2
- Controls.Label {
- text: qsTr("Username:")
- color: palette.windowText
- }
- Controls.TextField {
- id: userField
- focus: true
- Layout.fillWidth: true
- onAccepted: {
- if (userField.text && passwordField.text)
- acceptDialog();
- }
- }
- Controls.Label {
- text: qsTr("Password:")
- color: palette.windowText
- }
- Controls.TextField {
- id: passwordField
- Layout.fillWidth: true
- echoMode: TextInput.Password
- onAccepted: {
- if (userField.text && passwordField.text)
- acceptDialog();
- }
- }
- }
- Item {
- Layout.fillHeight: true
- }
- RowLayout {
- Layout.alignment: Qt.AlignRight
- spacing: 8
- Controls.Button {
- id: cancelButton
- text: qsTr("Cancel")
- onClicked: rejectDialog()
- }
- Controls.Button {
- text: qsTr("Log In")
- onClicked: acceptDialog()
- }
- }
- }
-}
diff --git a/src/webengine/ui2/ConfirmDialog.qml b/src/webengine/ui2/ConfirmDialog.qml
deleted file mode 100644
index 0649d3654..000000000
--- a/src/webengine/ui2/ConfirmDialog.qml
+++ /dev/null
@@ -1,111 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.5
-import QtQuick.Controls 2.0 as Controls
-import QtQuick.Dialogs 1.2
-import QtQuick.Layouts 1.0
-
-Dialog {
- property alias text: message.text
- property bool handled: false
- signal accepted()
- signal rejected()
- title: qsTr("Alert Dialog")
- modality: Qt.NonModal
-
- //handle the case where users simply closes the dialog
- onVisibilityChanged: {
- if (visible == false && handled == false) {
- handled = true;
- rejected();
- } else {
- handled = false;
- }
- }
-
- function acceptDialog() {
- accepted();
- handled = true;
- close();
- }
-
- function rejectDialog() {
- rejected();
- handled = true;
- close();
- }
-
- contentItem: ColumnLayout {
- id: rootLayout
- anchors.fill: parent
- anchors.margins: 4
- property int minimumWidth: rootLayout.implicitWidth + rootLayout.doubleMargins
- property int minimumHeight: rootLayout.implicitHeight + rootLayout.doubleMargins
- property int doubleMargins: anchors.margins * 2
- SystemPalette { id: palette; colorGroup: SystemPalette.Active }
- RowLayout {
- Layout.alignment: Qt.AlignRight
- spacing: 8
- Image {
- source: "question.png"
- }
- Text {
- id: message
- Layout.fillWidth: true
- color: palette.windowText
- }
- }
- Item {
- Layout.fillHeight: true
- }
- RowLayout {
- Layout.alignment: Qt.AlignRight
- spacing: 8
- Controls.Button {
- text: qsTr("OK")
- onClicked: acceptDialog()
- }
- Controls.Button {
- text: qsTr("Cancel")
- onClicked: rejectDialog()
- }
- }
- }
-}
diff --git a/src/webengine/ui2/Menu.qml b/src/webengine/ui2/Menu.qml
deleted file mode 100644
index 0e7b869f5..000000000
--- a/src/webengine/ui2/Menu.qml
+++ /dev/null
@@ -1,57 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.5
-import QtQuick.Controls 2.0 as Controls
-
-Controls.Menu {
- id: menu
- signal done()
-
- // Use private API for now
- onAboutToHide: doneTimer.start()
-
- // WORKAROUND On Mac the Menu may be destroyed before the MenuItem
- // is actually triggered (see qtbase commit 08cc9b9991ae9ab51)
- Timer {
- id: doneTimer
- interval: 100
- onTriggered: menu.done()
- }
-}
diff --git a/src/webengine/ui2/MenuItem.qml b/src/webengine/ui2/MenuItem.qml
deleted file mode 100644
index 9bf8aac5e..000000000
--- a/src/webengine/ui2/MenuItem.qml
+++ /dev/null
@@ -1,44 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.5
-import QtQuick.Controls 2.0 as Controls
-
-Controls.MenuItem { }
-
diff --git a/src/webengine/ui2/MenuSeparator.qml b/src/webengine/ui2/MenuSeparator.qml
deleted file mode 100644
index 0c664084a..000000000
--- a/src/webengine/ui2/MenuSeparator.qml
+++ /dev/null
@@ -1,42 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.5
-
-Item { id: dummy }
diff --git a/src/webengine/ui2/PromptDialog.qml b/src/webengine/ui2/PromptDialog.qml
deleted file mode 100644
index 880213e36..000000000
--- a/src/webengine/ui2/PromptDialog.qml
+++ /dev/null
@@ -1,114 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.5
-import QtQuick.Controls 2.0 as Controls
-import QtQuick.Layouts 1.0
-import QtQuick.Dialogs 1.2
-
-Dialog {
- property alias text: message.text
- property alias prompt: field.text
- property bool handled: false
- signal input(string text)
- signal accepted()
- signal rejected()
- title: qsTr("Prompt Dialog")
- modality: Qt.NonModal
-
- //handle the case where users simply closes the dialog
- onVisibilityChanged: {
- if (visible == false && handled == false) {
- handled = true;
- rejected();
- } else {
- handled = false;
- }
- }
-
- function acceptDialog() {
- input(field.text);
- accepted();
- handled = true;
- close();
- }
-
- function rejectDialog() {
- rejected();
- handled = true;
- close();
- }
-
- contentItem: ColumnLayout {
- id: rootLayout
- anchors.fill: parent
- anchors.margins: 4
- property int minimumWidth: rootLayout.implicitWidth + rootLayout.doubleMargins
- property int minimumHeight: rootLayout.implicitHeight + rootLayout.doubleMargins
- property int doubleMargins: anchors.margins * 2
- SystemPalette { id: palette; colorGroup: SystemPalette.Active }
- Text {
- id: message
- Layout.fillWidth: true
- color: palette.windowText
- }
- Controls.TextField {
- id:field
- focus: true
- Layout.fillWidth: true
- onAccepted: acceptDialog()
- }
- Item {
- Layout.fillHeight: true
- }
- RowLayout {
- Layout.alignment: Qt.AlignRight
- spacing: 8
- Controls.Button {
- text: qsTr("OK")
- onClicked: acceptDialog()
- }
- Controls.Button {
- text: qsTr("Cancel")
- onClicked: rejectDialog()
- }
- }
- }
-
-}
diff --git a/src/webengine/ui2/ToolTip.qml b/src/webengine/ui2/ToolTip.qml
deleted file mode 100644
index 91645a0f4..000000000
--- a/src/webengine/ui2/ToolTip.qml
+++ /dev/null
@@ -1,45 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick.Controls 2.0
-
-ToolTip {
- delay: 1000
- timeout: 1500
-}
diff --git a/src/webengine/ui2/qmldir b/src/webengine/ui2/qmldir
deleted file mode 100644
index 8ab0d3671..000000000
--- a/src/webengine/ui2/qmldir
+++ /dev/null
@@ -1,2 +0,0 @@
-# Internal module
-module QtWebEngine/Controls2Delegates
diff --git a/src/webengine/ui2/ui2.pro b/src/webengine/ui2/ui2.pro
deleted file mode 100644
index 4628d40b5..000000000
--- a/src/webengine/ui2/ui2.pro
+++ /dev/null
@@ -1,18 +0,0 @@
-TARGETPATH = QtWebEngine/Controls2Delegates
-
-QML_FILES += \
- # Authentication Dialog
- AuthenticationDialog.qml \
- # JS Dialogs
- AlertDialog.qml \
- ConfirmDialog.qml \
- PromptDialog.qml \
- # Menus. Based on Qt Quick Controls
- Menu.qml \
- MenuItem.qml \
- MenuSeparator.qml \
- ToolTip.qml \
- information.png \
- question.png
-
-load(qml_module)
diff --git a/src/webengine/ui_delegates_manager.cpp b/src/webengine/ui_delegates_manager.cpp
deleted file mode 100644
index 756b3429e..000000000
--- a/src/webengine/ui_delegates_manager.cpp
+++ /dev/null
@@ -1,740 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "ui_delegates_manager.h"
-
-#include "api/qquickwebengineview_p.h"
-#include <authentication_dialog_controller.h>
-#include <color_chooser_controller.h>
-#include <file_picker_controller.h>
-#include <javascript_dialog_controller.h>
-#include <touch_selection_menu_controller.h>
-#include <web_contents_adapter_client.h>
-
-#include <QFileInfo>
-#include <QQmlContext>
-#include <QQmlEngine>
-#include <QQmlProperty>
-#include <QQuickWindow>
-#include <QCursor>
-#include <QList>
-#include <QScreen>
-#include <QTimer>
-#include <QGuiApplication>
-
-// Uncomment for QML debugging
-//#define UI_DELEGATES_DEBUG
-
-namespace QtWebEngineCore {
-
-#define NO_SEPARATOR
-#if defined(Q_CC_MSVC) && !defined(Q_CC_CLANG)
-#define FILE_NAME_CASE_STATEMENT(TYPE, COMPONENT) \
- case UIDelegatesManager::TYPE:\
- return QString::fromLatin1(#TYPE ##".qml");
-#else
-#define FILE_NAME_CASE_STATEMENT(TYPE, COMPONENT) \
- case UIDelegatesManager::TYPE:\
- return QStringLiteral(#TYPE".qml");
-#endif
-
-static QString fileNameForComponent(UIDelegatesManager::ComponentType type)
-{
- switch (type) {
- FOR_EACH_COMPONENT_TYPE(FILE_NAME_CASE_STATEMENT, NO_SEPARATOR)
- default:
- Q_UNREACHABLE();
- }
- return QString();
-}
-
-static QPoint calculateToolTipPosition(QPoint &position, QSize &toolTip) {
- QRect screen;
- const QList<QScreen *> screens = QGuiApplication::screens();
- for (const QScreen *src : screens)
- if (src->availableGeometry().contains(position))
- screen = src->availableGeometry();
-
- position += QPoint(2, 16);
-
- if (position.x() + toolTip.width() > screen.x() + screen.width())
- position.rx() -= 4 + toolTip.width();
- if (position.y() + toolTip.height() > screen.y() + screen.height())
- position.ry() -= 24 + toolTip.height();
- if (position.y() < screen.y())
- position.setY(screen.y());
- if (position.x() + toolTip.width() > screen.x() + screen.width())
- position.setX(screen.x() + screen.width() - toolTip.width());
- if (position.x() < screen.x())
- position.setX(screen.x());
- if (position.y() + toolTip.height() > screen.y() + screen.height())
- position.setY(screen.y() + screen.height() - toolTip.height());
-
- return position;
-}
-
-const char *defaultPropertyName(QObject *obj)
-{
- const QMetaObject *metaObject = obj->metaObject();
-
- int idx = metaObject->indexOfClassInfo("DefaultProperty");
- if (-1 == idx)
- return 0;
-
- QMetaClassInfo info = metaObject->classInfo(idx);
- return info.value();
-}
-
-#define COMPONENT_MEMBER_INIT(TYPE, COMPONENT) \
- , COMPONENT##Component(0)
-
-UIDelegatesManager::UIDelegatesManager(QQuickWebEngineView *view)
- : m_view(view)
- , m_toolTip(nullptr)
- , m_touchSelectionMenu(nullptr)
- FOR_EACH_COMPONENT_TYPE(COMPONENT_MEMBER_INIT, NO_SEPARATOR)
-{
-}
-
-UIDelegatesManager::~UIDelegatesManager()
-{
-}
-
-#define COMPONENT_MEMBER_CASE_STATEMENT(TYPE, COMPONENT) \
- case TYPE: \
- component = &COMPONENT##Component; \
- break;
-
-bool UIDelegatesManager::initializeImportDirs(QStringList &dirs, QQmlEngine *engine)
-{
- const QStringList paths = engine->importPathList();
- for (const QString &path : paths) {
- QString importPath = path % QLatin1String("/QtWebEngine/Controls1Delegates/");
-
- // resource paths have to be tested using the ":/" prefix
- if (importPath.startsWith(QLatin1String("qrc:/")))
- importPath.remove(0, 3);
-
- QFileInfo fi(importPath);
- if (fi.exists())
- dirs << fi.absolutePath();
- }
- return !dirs.isEmpty();
-}
-
-bool UIDelegatesManager::ensureComponentLoaded(ComponentType type)
-{
- QQmlEngine* engine = qmlEngine(m_view);
- if (m_importDirs.isEmpty() && !initializeImportDirs(m_importDirs, engine))
- return false;
-
- QQmlComponent **component;
- switch (type) {
- FOR_EACH_COMPONENT_TYPE(COMPONENT_MEMBER_CASE_STATEMENT, NO_SEPARATOR)
- default:
- Q_UNREACHABLE();
- return false;
- }
- QString fileName(fileNameForComponent(type));
-#ifndef UI_DELEGATES_DEBUG
- if (*component)
- return true;
-#else // Unconditionally reload the components each time.
- fprintf(stderr, "%s: %s\n", Q_FUNC_INFO, qPrintable(fileName));
-#endif
- if (!engine)
- return false;
-
- for (const QString &importDir : qAsConst(m_importDirs)) {
- const QString componentFilePath = importDir % QLatin1Char('/') % fileName;
-
- if (!QFileInfo(componentFilePath).exists())
- continue;
-
- // FIXME: handle async loading
- *component = (new QQmlComponent(engine,
- importDir.startsWith(QLatin1String(":/")) ? QUrl(QLatin1String("qrc") + componentFilePath)
- : QUrl::fromLocalFile(componentFilePath),
- QQmlComponent::PreferSynchronous, m_view));
-
- if ((*component)->status() != QQmlComponent::Ready) {
- const QList<QQmlError> errs = (*component)->errors();
- for (const QQmlError &err : errs)
- qWarning("QtWebEngine: component error: %s\n", qPrintable(err.toString()));
- delete *component;
- *component = nullptr;
- return false;
- }
- return true;
- }
- return false;
-}
-
-#define CHECK_QML_SIGNAL_PROPERTY(prop, location) \
- if (!prop.isSignalProperty()) \
- qWarning("%s is missing %s signal property.\n", qPrintable(location.toString()), qPrintable(prop.name()));
-
-void UIDelegatesManager::addMenuItem(QQuickWebEngineAction *action, QObject *menu, bool checkable, bool checked)
-{
- Q_ASSERT(action);
- if (!ensureComponentLoaded(MenuItem))
- return;
- QObject *it = menuItemComponent->beginCreate(qmlContext(m_view));
-
- QQmlProperty(it, QStringLiteral("text")).write(action->text());
- QQmlProperty(it, QStringLiteral("iconName")).write(action->iconName());
- QQmlProperty(it, QStringLiteral("enabled")).write(action->isEnabled());
- QQmlProperty(it, QStringLiteral("checkable")).write(checkable);
- QQmlProperty(it, QStringLiteral("checked")).write(checked);
-
- QQmlProperty signal(it, QStringLiteral("onTriggered"));
- CHECK_QML_SIGNAL_PROPERTY(signal, menuItemComponent->url());
- const QMetaObject *actionMeta = action->metaObject();
- QObject::connect(it, signal.method(), action, actionMeta->method(actionMeta->indexOfSlot("trigger()")));
- menuItemComponent->completeCreate();
-
- it->setParent(menu);
-
- QQmlListReference entries(menu, defaultPropertyName(menu), qmlEngine(m_view));
- if (entries.isValid())
- entries.append(it);
-}
-
-void UIDelegatesManager::addMenuSeparator(QObject *menu)
-{
- if (!ensureComponentLoaded(MenuSeparator))
- return;
-
- QQmlContext *itemContext = qmlContext(m_view);
- QObject *sep = menuSeparatorComponent->create(itemContext);
- sep->setParent(menu);
-
- QQmlListReference entries(menu, defaultPropertyName(menu), qmlEngine(m_view));
- if (entries.isValid() && entries.count() > 0)
- entries.append(sep);
-}
-
-QObject *UIDelegatesManager::addMenu(QObject *parentMenu, const QString &title, const QPoint& pos)
-{
- Q_ASSERT(parentMenu);
- if (!ensureComponentLoaded(Menu))
- return nullptr;
- QQmlContext *context = qmlContext(m_view);
- QObject *menu = menuComponent->beginCreate(context);
- // set visual parent for non-Window-based menus
- if (QQuickItem *item = qobject_cast<QQuickItem*>(menu))
- item->setParentItem(m_view);
-
- if (!title.isEmpty())
- QQmlProperty(menu, QStringLiteral("title")).write(title);
- if (!pos.isNull())
- menu->setProperty("pos", pos);
-
- menu->setParent(parentMenu);
-
- QQmlProperty doneSignal(menu, QStringLiteral("onDone"));
- static int deleteLaterIndex = menu->metaObject()->indexOfSlot("deleteLater()");
- CHECK_QML_SIGNAL_PROPERTY(doneSignal, menuComponent->url());
- QObject::connect(menu, doneSignal.method(), menu, menu->metaObject()->method(deleteLaterIndex));
-
- QQmlListReference entries(parentMenu, defaultPropertyName(parentMenu), qmlEngine(m_view));
- if (entries.isValid())
- entries.append(menu);
-
- menuComponent->completeCreate();
- return menu;
-}
-
-#define ASSIGN_DIALOG_COMPONENT_DATA_CASE_STATEMENT(TYPE, COMPONENT) \
- case TYPE:\
- dialogComponent = COMPONENT##Component; \
- break;
-
-
-void UIDelegatesManager::showDialog(QSharedPointer<JavaScriptDialogController> dialogController)
-{
- Q_ASSERT(!dialogController.isNull());
- ComponentType dialogComponentType = Invalid;
- QString title;
- switch (dialogController->type()) {
- case WebContentsAdapterClient::AlertDialog:
- dialogComponentType = AlertDialog;
- title = tr("Javascript Alert - %1").arg(m_view->url().toString());
- break;
- case WebContentsAdapterClient::ConfirmDialog:
- dialogComponentType = ConfirmDialog;
- title = tr("Javascript Confirm - %1").arg(m_view->url().toString());
- break;
- case WebContentsAdapterClient::PromptDialog:
- dialogComponentType = PromptDialog;
- title = tr("Javascript Prompt - %1").arg(m_view->url().toString());
- break;
- case WebContentsAdapterClient::UnloadDialog:
- dialogComponentType = ConfirmDialog;
- title = tr("Are you sure you want to leave this page?");
- break;
- case WebContentsAdapterClient::InternalAuthorizationDialog:
- dialogComponentType = ConfirmDialog;
- title = dialogController->title();
- break;
- default:
- Q_UNREACHABLE();
- }
-
- if (!ensureComponentLoaded(dialogComponentType)) {
- // Let the controller know it couldn't be loaded
- qWarning("Failed to load dialog, rejecting.");
- dialogController->reject();
- return;
- }
-
- QQmlComponent *dialogComponent = nullptr;
- switch (dialogComponentType) {
- FOR_EACH_COMPONENT_TYPE(ASSIGN_DIALOG_COMPONENT_DATA_CASE_STATEMENT, NO_SEPARATOR)
- default:
- Q_UNREACHABLE();
- }
-
- QQmlContext *context = qmlContext(m_view);
- QObject *dialog = dialogComponent->beginCreate(context);
- // set visual parent for non-Window-based dialogs
- if (QQuickItem *item = qobject_cast<QQuickItem*>(dialog))
- item->setParentItem(m_view);
- dialog->setParent(m_view);
- QQmlProperty textProp(dialog, QStringLiteral("text"));
- if (dialogController->type() == WebContentsAdapterClient::UnloadDialog)
- textProp.write(tr("Changes that you made may not be saved."));
- else
- textProp.write(dialogController->message());
-
- QQmlProperty titleProp(dialog, QStringLiteral("title"));
- titleProp.write(title);
-
- QQmlProperty acceptSignal(dialog, QStringLiteral("onAccepted"));
- QQmlProperty rejectSignal(dialog, QStringLiteral("onRejected"));
- CHECK_QML_SIGNAL_PROPERTY(acceptSignal, dialogComponent->url());
- CHECK_QML_SIGNAL_PROPERTY(rejectSignal, dialogComponent->url());
-
- static int acceptIndex = dialogController->metaObject()->indexOfSlot("accept()");
- QObject::connect(dialog, acceptSignal.method(), dialogController.data(), dialogController->metaObject()->method(acceptIndex));
- static int rejectIndex = dialogController->metaObject()->indexOfSlot("reject()");
- QObject::connect(dialog, rejectSignal.method(), dialogController.data(), dialogController->metaObject()->method(rejectIndex));
-
- if (dialogComponentType == PromptDialog) {
- QQmlProperty promptProp(dialog, QStringLiteral("prompt"));
- promptProp.write(dialogController->defaultPrompt());
- QQmlProperty inputSignal(dialog, QStringLiteral("onInput"));
- CHECK_QML_SIGNAL_PROPERTY(inputSignal, dialogComponent->url());
- static int setTextIndex = dialogController->metaObject()->indexOfSlot("textProvided(QString)");
- QObject::connect(dialog, inputSignal.method(), dialogController.data(), dialogController->metaObject()->method(setTextIndex));
- }
-
- dialogComponent->completeCreate();
-
- QObject::connect(dialogController.data(), &JavaScriptDialogController::dialogCloseRequested, dialog, &QObject::deleteLater);
-
- QMetaObject::invokeMethod(dialog, "open");
-}
-
-void UIDelegatesManager::showColorDialog(QSharedPointer<ColorChooserController> controller)
-{
- if (!ensureComponentLoaded(ColorDialog)) {
- // Let the controller know it couldn't be loaded
- qWarning("Failed to load dialog, rejecting.");
- controller->reject();
- return;
- }
-
- QQmlContext *context = qmlContext(m_view);
- QObject *colorDialog = colorDialogComponent->beginCreate(context);
- if (QQuickItem *item = qobject_cast<QQuickItem*>(colorDialog))
- item->setParentItem(m_view);
- colorDialog->setParent(m_view);
-
- if (controller->initialColor().isValid())
- colorDialog->setProperty("color", controller->initialColor());
-
- QQmlProperty selectedColorSignal(colorDialog, QStringLiteral("onSelectedColor"));
- CHECK_QML_SIGNAL_PROPERTY(selectedColorSignal, colorDialogComponent->url());
- QQmlProperty rejectedSignal(colorDialog, QStringLiteral("onRejected"));
- CHECK_QML_SIGNAL_PROPERTY(rejectedSignal, colorDialogComponent->url());
-
- static int acceptIndex = controller->metaObject()->indexOfSlot("accept(QVariant)");
- QObject::connect(colorDialog, selectedColorSignal.method(), controller.data(), controller->metaObject()->method(acceptIndex));
- static int rejectIndex = controller->metaObject()->indexOfSlot("reject()");
- QObject::connect(colorDialog, rejectedSignal.method(), controller.data(), controller->metaObject()->method(rejectIndex));
-
- // delete later
- static int deleteLaterIndex = colorDialog->metaObject()->indexOfSlot("deleteLater()");
- QObject::connect(colorDialog, selectedColorSignal.method(), colorDialog, colorDialog->metaObject()->method(deleteLaterIndex));
- QObject::connect(colorDialog, rejectedSignal.method(), colorDialog, colorDialog->metaObject()->method(deleteLaterIndex));
-
- colorDialogComponent->completeCreate();
- QMetaObject::invokeMethod(colorDialog, "open");
-}
-
-void UIDelegatesManager::showDialog(QSharedPointer<AuthenticationDialogController> dialogController)
-{
- Q_ASSERT(!dialogController.isNull());
-
- if (!ensureComponentLoaded(AuthenticationDialog)) {
- // Let the controller know it couldn't be loaded
- qWarning("Failed to load authentication dialog, rejecting.");
- dialogController->reject();
- return;
- }
-
- QQmlContext *context = qmlContext(m_view);
- QObject *authenticationDialog = authenticationDialogComponent->beginCreate(context);
- // set visual parent for non-Window-based dialogs
- if (QQuickItem *item = qobject_cast<QQuickItem*>(authenticationDialog))
- item->setParentItem(m_view);
- authenticationDialog->setParent(m_view);
-
- QString introMessage;
- if (dialogController->isProxy()) {
- introMessage = tr("Connect to proxy \"%1\" using:");
- introMessage = introMessage.arg(dialogController->host().toHtmlEscaped());
- } else {
- const QUrl url = dialogController->url();
- introMessage = tr("Enter username and password for \"%1\" at %2://%3");
- introMessage = introMessage.arg(dialogController->realm(), url.scheme(), url.host());
- }
- QQmlProperty textProp(authenticationDialog, QStringLiteral("text"));
- textProp.write(introMessage);
-
- QQmlProperty acceptSignal(authenticationDialog, QStringLiteral("onAccepted"));
- QQmlProperty rejectSignal(authenticationDialog, QStringLiteral("onRejected"));
- CHECK_QML_SIGNAL_PROPERTY(acceptSignal, authenticationDialogComponent->url());
- CHECK_QML_SIGNAL_PROPERTY(rejectSignal, authenticationDialogComponent->url());
-
- static int acceptIndex = dialogController->metaObject()->indexOfSlot("accept(QString,QString)");
- static int deleteLaterIndex = authenticationDialog->metaObject()->indexOfSlot("deleteLater()");
- QObject::connect(authenticationDialog, acceptSignal.method(), dialogController.data(), dialogController->metaObject()->method(acceptIndex));
- QObject::connect(authenticationDialog, acceptSignal.method(), authenticationDialog, authenticationDialog->metaObject()->method(deleteLaterIndex));
- static int rejectIndex = dialogController->metaObject()->indexOfSlot("reject()");
- QObject::connect(authenticationDialog, rejectSignal.method(), dialogController.data(), dialogController->metaObject()->method(rejectIndex));
- QObject::connect(authenticationDialog, rejectSignal.method(), authenticationDialog, authenticationDialog->metaObject()->method(deleteLaterIndex));
-
- authenticationDialogComponent->completeCreate();
- QMetaObject::invokeMethod(authenticationDialog, "open");
-}
-
-void UIDelegatesManager::showFilePicker(QSharedPointer<FilePickerController> controller)
-{
-
- if (!ensureComponentLoaded(FilePicker))
- return;
-
- QQmlContext *context = qmlContext(m_view);
- QObject *filePicker = filePickerComponent->beginCreate(context);
- if (QQuickItem *item = qobject_cast<QQuickItem*>(filePicker))
- item->setParentItem(m_view);
- filePicker->setParent(m_view);
- filePickerComponent->completeCreate();
-
- // Fine-tune some properties depending on the mode.
- switch (controller->mode()) {
- case FilePickerController::Open:
- break;
- case FilePickerController::Save:
- filePicker->setProperty("selectExisting", false);
- break;
- case FilePickerController::OpenMultiple:
- filePicker->setProperty("selectMultiple", true);
- break;
- case FilePickerController::UploadFolder:
- filePicker->setProperty("selectFolder", true);
- break;
- default:
- Q_UNREACHABLE();
- }
-
- filePicker->setProperty("nameFilters", FilePickerController::nameFilters(controller->acceptedMimeTypes()));
-
- QQmlProperty filesPickedSignal(filePicker, QStringLiteral("onFilesSelected"));
- CHECK_QML_SIGNAL_PROPERTY(filesPickedSignal, filePickerComponent->url());
- QQmlProperty rejectSignal(filePicker, QStringLiteral("onRejected"));
- CHECK_QML_SIGNAL_PROPERTY(rejectSignal, filePickerComponent->url());
- static int acceptedIndex = controller->metaObject()->indexOfSlot("accepted(QVariant)");
- QObject::connect(filePicker, filesPickedSignal.method(), controller.data(), controller->metaObject()->method(acceptedIndex));
- static int rejectedIndex = controller->metaObject()->indexOfSlot("rejected()");
- QObject::connect(filePicker, rejectSignal.method(), controller.data(), controller->metaObject()->method(rejectedIndex));
-
- // delete when done.
- static int deleteLaterIndex = filePicker->metaObject()->indexOfSlot("deleteLater()");
- QObject::connect(filePicker, filesPickedSignal.method(), filePicker, filePicker->metaObject()->method(deleteLaterIndex));
- QObject::connect(filePicker, rejectSignal.method(), filePicker, filePicker->metaObject()->method(deleteLaterIndex));
-
- QMetaObject::invokeMethod(filePicker, "open");
-}
-
-class TemporaryCursorMove
-{
-public:
- TemporaryCursorMove(const QQuickItem *item, const QPoint &pos)
- {
- if (pos.isNull() || !item->contains(pos))
- return;
- const QPoint oldPos = QCursor::pos();
- const QPoint globalPos = item->mapToGlobal(QPointF(pos)).toPoint();
- if (oldPos == globalPos)
- return;
- m_oldCursorPos = oldPos;
- QCursor::setPos(globalPos);
- }
-
- ~TemporaryCursorMove()
- {
- if (!m_oldCursorPos.isNull())
- QCursor::setPos(m_oldCursorPos);
- }
-
-private:
- QPoint m_oldCursorPos;
-};
-
-void UIDelegatesManager::showMenu(QObject *menu)
-{
- // QtQuick.Controls.Menu.popup() always shows the menu under the mouse cursor, i.e. the menu's
- // position we set above is ignored. Work around the problem by moving the mouse cursor
- // temporarily to the right position.
- TemporaryCursorMove tcm(m_view, menu->property("pos").toPoint());
- QMetaObject::invokeMethod(menu, "popup");
-}
-
-void UIDelegatesManager::showToolTip(const QString &text)
-{
- if (text.isEmpty()) {
- m_toolTip.reset();
- return;
- }
-
- if (!ensureComponentLoaded(ToolTip))
- return;
-
- if (!m_toolTip.isNull())
- return;
-
- QQmlContext *context = qmlContext(m_view);
- m_toolTip.reset(toolTipComponent->beginCreate(context));
- if (QQuickItem *item = qobject_cast<QQuickItem *>(m_toolTip.data()))
- item->setParentItem(m_view);
- m_toolTip->setParent(m_view);
- toolTipComponent->completeCreate();
-
- QQmlProperty(m_toolTip.data(), QStringLiteral("text")).write(text);
-
- int height = QQmlProperty(m_toolTip.data(), QStringLiteral("height")).read().toInt();
- int width = QQmlProperty(m_toolTip.data(), QStringLiteral("width")).read().toInt();
- QSize toolTipSize(width, height);
- QPoint position = m_view->cursor().pos();
- position = m_view->mapFromGlobal(calculateToolTipPosition(position, toolTipSize)).toPoint();
-
- QQmlProperty(m_toolTip.data(), QStringLiteral("x")).write(position.x());
- QQmlProperty(m_toolTip.data(), QStringLiteral("y")).write(position.y());
-
- QMetaObject::invokeMethod(m_toolTip.data(), "open");
-}
-
-QQuickItem *UIDelegatesManager::createTouchHandle()
-{
- if (!ensureComponentLoaded(TouchHandle))
- return nullptr;
-
- QQmlContext *context = qmlContext(m_view);
- QObject *touchHandle = touchHandleComponent->beginCreate(context);
- QQuickItem *item = qobject_cast<QQuickItem *>(touchHandle);
- Q_ASSERT(item);
- item->setParentItem(m_view);
- touchHandleComponent->completeCreate();
-
- return item;
-}
-
-void UIDelegatesManager::showTouchSelectionMenu(QtWebEngineCore::TouchSelectionMenuController *menuController, const QRect &bounds, const int spacing)
-{
- if (!ensureComponentLoaded(TouchSelectionMenu))
- return;
-
- QQmlContext *context = qmlContext(m_view);
- m_touchSelectionMenu.reset(touchSelectionMenuComponent->beginCreate(context));
- if (QQuickItem *item = qobject_cast<QQuickItem *>(m_touchSelectionMenu.data()))
- item->setParentItem(m_view);
- m_touchSelectionMenu->setParent(m_view);
-
- QQmlProperty(m_touchSelectionMenu.data(), QStringLiteral("width")).write(bounds.width());
- QQmlProperty(m_touchSelectionMenu.data(), QStringLiteral("height")).write(bounds.height());
- QQmlProperty(m_touchSelectionMenu.data(), QStringLiteral("x")).write(bounds.x());
- QQmlProperty(m_touchSelectionMenu.data(), QStringLiteral("y")).write(bounds.y());
- QQmlProperty(m_touchSelectionMenu.data(), QStringLiteral("border.width")).write(spacing);
-
- // Cut button
- bool cutEnabled = menuController->isCommandEnabled(TouchSelectionMenuController::Cut);
- QQmlProperty(m_touchSelectionMenu.data(), QStringLiteral("isCutEnabled")).write(cutEnabled);
- if (cutEnabled) {
- QQmlProperty cutSignal(m_touchSelectionMenu.data(), QStringLiteral("onCutTriggered"));
- CHECK_QML_SIGNAL_PROPERTY(cutSignal, touchSelectionMenuComponent->url());
- int cutIndex = menuController->metaObject()->indexOfSlot("cut()");
- QObject::connect(m_touchSelectionMenu.data(), cutSignal.method(), menuController, menuController->metaObject()->method(cutIndex));
- }
-
- // Copy button
- bool copyEnabled = menuController->isCommandEnabled(TouchSelectionMenuController::Copy);
- QQmlProperty(m_touchSelectionMenu.data(), QStringLiteral("isCopyEnabled")).write(copyEnabled);
- if (copyEnabled) {
- QQmlProperty copySignal(m_touchSelectionMenu.data(), QStringLiteral("onCopyTriggered"));
- CHECK_QML_SIGNAL_PROPERTY(copySignal, touchSelectionMenuComponent->url());
- int copyIndex = menuController->metaObject()->indexOfSlot("copy()");
- QObject::connect(m_touchSelectionMenu.data(), copySignal.method(), menuController, menuController->metaObject()->method(copyIndex));
- }
-
- // Paste button
- bool pasteEnabled = menuController->isCommandEnabled(TouchSelectionMenuController::Paste);
- QQmlProperty(m_touchSelectionMenu.data(), QStringLiteral("isPasteEnabled")).write(pasteEnabled);
- if (pasteEnabled) {
- QQmlProperty pasteSignal(m_touchSelectionMenu.data(), QStringLiteral("onPasteTriggered"));
- CHECK_QML_SIGNAL_PROPERTY(pasteSignal, touchSelectionMenuComponent->url());
- int pasteIndex = menuController->metaObject()->indexOfSlot("paste()");
- QObject::connect(m_touchSelectionMenu.data(), pasteSignal.method(), menuController, menuController->metaObject()->method(pasteIndex));
- }
-
- // Context menu button
- QQmlProperty contextMenuSignal(m_touchSelectionMenu.data(), QStringLiteral("onContextMenuTriggered"));
- CHECK_QML_SIGNAL_PROPERTY(contextMenuSignal, touchSelectionMenuComponent->url());
- int contextMenuIndex = menuController->metaObject()->indexOfSlot("runContextMenu()");
- QObject::connect(m_touchSelectionMenu.data(), contextMenuSignal.method(), menuController, menuController->metaObject()->method(contextMenuIndex));
-
- touchSelectionMenuComponent->completeCreate();
-}
-
-void UIDelegatesManager::hideTouchSelectionMenu()
-{
- QTimer::singleShot(0, m_view, [this] { m_touchSelectionMenu.reset(); });
-}
-
-UI2DelegatesManager::UI2DelegatesManager(QQuickWebEngineView *view) : UIDelegatesManager(view)
-{
-
-}
-
-bool UI2DelegatesManager::initializeImportDirs(QStringList &dirs, QQmlEngine *engine)
-{
- const QStringList paths = engine->importPathList();
- for (const QString &path : paths) {
- QString controls2ImportPath = path % QLatin1String("/QtWebEngine/Controls2Delegates/");
- QString controls1ImportPath = path % QLatin1String("/QtWebEngine/Controls1Delegates/");
-
- // resource paths have to be tested using the ":/" prefix
- if (controls2ImportPath.startsWith(QLatin1String("qrc:/"))) {
- controls2ImportPath.remove(0, 3);
- controls1ImportPath.remove(0, 3);
- }
-
- QFileInfo fi2(controls2ImportPath);
- if (fi2.exists())
- dirs << fi2.absolutePath();
-
- QFileInfo fi1(controls1ImportPath);
- if (fi1.exists())
- dirs << fi1.absolutePath();
- }
- return !dirs.isEmpty();
-}
-
-QObject *UI2DelegatesManager::addMenu(QObject *parentMenu, const QString &title, const QPoint &pos)
-{
- Q_ASSERT(parentMenu);
- if (!ensureComponentLoaded(Menu))
- return nullptr;
- QQmlContext *context = qmlContext(m_view);
- QObject *menu = menuComponent->beginCreate(context);
-
- // set visual parent for non-Window-based menus
- if (QQuickItem *item = qobject_cast<QQuickItem*>(menu))
- item->setParentItem(m_view);
-
- if (!title.isEmpty())
- menu->setProperty("title", title);
- if (!pos.isNull()) {
- menu->setProperty("x", pos.x());
- menu->setProperty("y", pos.y());
- }
-
- menu->setParent(parentMenu);
- QQmlProperty doneSignal(menu, QStringLiteral("onDone"));
- CHECK_QML_SIGNAL_PROPERTY(doneSignal, menuComponent->url())
- static int deleteLaterIndex = menu->metaObject()->indexOfSlot("deleteLater()");
- QObject::connect(menu, doneSignal.method(), menu, menu->metaObject()->method(deleteLaterIndex));
- menuComponent->completeCreate();
- return menu;
-}
-
-void UI2DelegatesManager::addMenuItem(QQuickWebEngineAction *action, QObject *menu, bool checkable, bool checked)
-{
- Q_ASSERT(action);
- if (!ensureComponentLoaded(MenuItem))
- return;
-
- QObject *it = menuItemComponent->beginCreate(qmlContext(m_view));
-
- it->setProperty("text", action->text());
- it->setProperty("enabled", action->isEnabled());
- it->setProperty("checked", checked);
- it->setProperty("checkable", checkable);
-
- QQmlProperty signal(it, QStringLiteral("onTriggered"));
- CHECK_QML_SIGNAL_PROPERTY(signal, menuItemComponent->url());
- const QMetaObject *actionMeta = action->metaObject();
- QObject::connect(it, signal.method(), action, actionMeta->method(actionMeta->indexOfSlot("trigger()")));
- menuItemComponent->completeCreate();
-
- it->setParent(menu);
-
- QQmlListReference entries(menu, defaultPropertyName(menu), qmlEngine(m_view));
- if (entries.isValid())
- entries.append(it);
-}
-
-void UI2DelegatesManager::showMenu(QObject *menu)
-{
- QMetaObject::invokeMethod(menu, "open");
-}
-
-} // namespace QtWebEngineCore
diff --git a/src/webengine/ui_delegates_manager.h b/src/webengine/ui_delegates_manager.h
deleted file mode 100644
index 4b6e291b2..000000000
--- a/src/webengine/ui_delegates_manager.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef UI_DELEGATES_MANAGER_H
-#define UI_DELEGATES_MANAGER_H
-
-#include "api/qquickwebengineaction_p.h"
-#include "qglobal.h"
-#include "web_contents_adapter.h"
-#include "web_contents_adapter_client.h"
-
-#include <QCoreApplication>
-#include <QExplicitlySharedDataPointer>
-#include <QPoint>
-#include <QSharedPointer>
-
-#define FOR_EACH_COMPONENT_TYPE(F, SEPARATOR) \
- F(Menu, menu) SEPARATOR \
- F(MenuItem, menuItem) SEPARATOR \
- F(MenuSeparator, menuSeparator) SEPARATOR \
- F(AlertDialog, alertDialog) SEPARATOR \
- F(ColorDialog, colorDialog) SEPARATOR \
- F(ConfirmDialog, confirmDialog) SEPARATOR \
- F(PromptDialog, promptDialog) SEPARATOR \
- F(FilePicker, filePicker) SEPARATOR \
- F(AuthenticationDialog, authenticationDialog) SEPARATOR \
- F(ToolTip, toolTip) SEPARATOR \
- F(TouchHandle, touchHandle) SEPARATOR \
- F(TouchSelectionMenu, touchSelectionMenu) SEPARATOR \
-
-#define COMMA_SEPARATOR ,
-#define SEMICOLON_SEPARATOR ;
-#define ENUM_DECLARATION(TYPE, COMPONENT) \
- TYPE
-#define MEMBER_DECLARATION(TYPE, COMPONENT) \
- QQmlComponent *COMPONENT##Component
-
-QT_BEGIN_NAMESPACE
-class QQmlContext;
-class QQmlComponent;
-class QQuickItem;
-class QQuickWebEngineView;
-class QQmlEngine;
-QT_END_NAMESPACE
-
-namespace QtWebEngineCore {
-class AuthenticationDialogController;
-class JavaScriptDialogController;
-class FilePickerController;
-class TouchSelectionMenuController;
-
-const char *defaultPropertyName(QObject *obj);
-
-class UIDelegatesManager
-{
- Q_DECLARE_TR_FUNCTIONS(UIDelegatesManager)
-public:
- enum ComponentType {
- Invalid = -1,
- FOR_EACH_COMPONENT_TYPE(ENUM_DECLARATION, COMMA_SEPARATOR)
- ComponentTypeCount
- };
-
- UIDelegatesManager(QQuickWebEngineView *);
- virtual ~UIDelegatesManager();
-
- virtual bool initializeImportDirs(QStringList &dirs, QQmlEngine *engine);
- virtual void addMenuItem(QQuickWebEngineAction *action, QObject *menu,
- bool checkable = false, bool checked = true);
- void addMenuSeparator(QObject *menu);
- virtual QObject *addMenu(QObject *parentMenu, const QString &title,
- const QPoint &pos = QPoint());
- QQmlContext *creationContextForComponent(QQmlComponent *);
- void showColorDialog(QSharedPointer<ColorChooserController>);
- void showDialog(QSharedPointer<JavaScriptDialogController>);
- void showDialog(QSharedPointer<AuthenticationDialogController>);
- void showFilePicker(QSharedPointer<FilePickerController>);
- virtual void showMenu(QObject *menu);
- void showToolTip(const QString &text);
- QQuickItem *createTouchHandle();
- void showTouchSelectionMenu(TouchSelectionMenuController *, const QRect &, const int spacing);
- void hideTouchSelectionMenu();
-
-protected:
- bool ensureComponentLoaded(ComponentType);
-
- QQuickWebEngineView *m_view;
- QScopedPointer<QObject> m_toolTip;
- QStringList m_importDirs;
- QScopedPointer<QObject> m_touchSelectionMenu;
-
- FOR_EACH_COMPONENT_TYPE(MEMBER_DECLARATION, SEMICOLON_SEPARATOR)
-
- Q_DISABLE_COPY(UIDelegatesManager)
-
-};
-
-// delegate manager for qtquickcontrols2 with fallback to qtquickcontrols1
-
-class UI2DelegatesManager : public UIDelegatesManager
-{
-public:
- UI2DelegatesManager(QQuickWebEngineView *);
- bool initializeImportDirs(QStringList &dirs, QQmlEngine *engine) override;
- QObject *addMenu(QObject *parentMenu, const QString &title,
- const QPoint &pos = QPoint()) override;
- void addMenuItem(QQuickWebEngineAction *action, QObject *menu,
- bool checkable = false, bool checked = false) override;
- void showMenu(QObject *menu) override;
- Q_DISABLE_COPY(UI2DelegatesManager)
-
-};
-
-} // namespace QtWebEngineCore
-
-#endif // UI_DELEGATES_MANAGER_H
diff --git a/src/webengine/webengine.pro b/src/webengine/webengine.pro
deleted file mode 100644
index 23668229e..000000000
--- a/src/webengine/webengine.pro
+++ /dev/null
@@ -1,19 +0,0 @@
-TEMPLATE = subdirs
-
-qml_module.file = module.pro
-qml_plugin.file = plugin/plugin.pro
-
-qml_plugin.depends = qml_module
-
-SUBDIRS += qml_module qml_plugin
-
-qtConfig(webengine-testsupport) {
- testsupport_plugin.file = testsupport/testsupport.pro
- testsupport_plugin.depends = qml_module
- SUBDIRS += testsupport_plugin
-}
-
-qtConfig(webengine-ui-delegates) {
- SUBDIRS += ui \
- ui2
-}
diff --git a/src/webenginequick/CMakeLists.txt b/src/webenginequick/CMakeLists.txt
new file mode 100644
index 000000000..5f8344f08
--- /dev/null
+++ b/src/webenginequick/CMakeLists.txt
@@ -0,0 +1,78 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+add_subdirectory(ui)
+
+qt_internal_add_qml_module(WebEngineQuick
+ URI "QtWebEngine"
+ VERSION "${PROJECT_VERSION}"
+ CLASS_NAME QtWebEnginePlugin
+ DEPENDENCIES
+ QtQuick/auto
+ QtWebChannel/auto
+ PLUGIN_TARGET qtwebenginequickplugin
+ NO_GENERATE_PLUGIN_SOURCE
+ NO_PLUGIN_OPTIONAL
+ SOURCES
+ api/qquickwebengineaction.cpp api/qquickwebengineaction_p.h
+ api/qquickwebengineaction_p_p.h
+ api/qquickwebengineclientcertificateselection.cpp api/qquickwebengineclientcertificateselection_p.h
+ api/qquickwebenginedialogrequests.cpp api/qquickwebenginedialogrequests_p.h
+ api/qquickwebenginedownloadrequest.cpp api/qquickwebenginedownloadrequest_p.h
+ api/qquickwebenginefaviconprovider.cpp
+ api/qquickwebenginefaviconprovider_p_p.h
+ api/qquickwebenginenewwindowrequest.cpp api/qquickwebenginenewwindowrequest_p.h
+ api/qquickwebengineprofile.cpp api/qquickwebengineprofile.h api/qquickwebengineprofile_p.h
+ api/qquickwebenginescriptcollection.cpp api/qquickwebenginescriptcollection_p.h api/qquickwebenginescriptcollection_p_p.h
+ api/qquickwebenginesettings.cpp api/qquickwebenginesettings_p.h
+ api/qquickwebenginesingleton.cpp api/qquickwebenginesingleton_p.h
+ api/qquickwebenginetouchhandleprovider.cpp
+ api/qquickwebenginetouchhandleprovider_p_p.h
+ api/qquickwebenginetouchhandle.cpp api/qquickwebenginetouchhandle_p.h
+ api/qquickwebenginetouchselectionmenurequest.cpp
+ api/qquickwebenginetouchselectionmenurequest_p.h
+ api/qquickwebenginetouchselectionmenurequest_p_p.h
+ api/qquickwebengineview.cpp api/qquickwebengineview_p.h
+ api/qquickwebengineview_p_p.h
+ api/qquickwebengineforeigntypes_p.h
+ api/qtwebenginequickglobal.cpp api/qtwebenginequickglobal.h
+ api/qtwebenginequickglobal_p.h
+ render_widget_host_view_qt_delegate_quickwindow.cpp render_widget_host_view_qt_delegate_quickwindow.h
+ ui_delegates_manager.cpp ui_delegates_manager.h
+ DEFINES
+ QT_BUILD_WEBENGINE_LIB
+ INCLUDE_DIRECTORIES
+ ../core
+ api
+ LIBRARIES
+ Qt::CorePrivate
+ Qt::GuiPrivate
+ Qt::QuickPrivate
+ Qt::WebEngineCorePrivate
+ PUBLIC_LIBRARIES
+ Qt::Core
+ Qt::Gui
+ Qt::Qml
+ Qt::Quick
+ Qt::WebEngineCore
+ NO_GENERATE_CPP_EXPORTS
+)
+
+qt_internal_extend_target(WebEngineQuick CONDITION QT_FEATURE_webengine_webchannel
+ PUBLIC_LIBRARIES
+ Qt::WebChannelQuick
+)
+
+qt_internal_extend_target(WebEngineQuick CONDITION QT_FEATURE_accessibility
+ SOURCES
+ qquickwebengine_accessible.cpp qquickwebengine_accessible.h
+)
+
+qt_internal_extend_target(qtwebenginequickplugin
+ SOURCES
+ plugin.cpp
+ LIBRARIES
+ Qt::CorePrivate
+ Qt::WebEngineQuickPrivate
+)
+
diff --git a/src/webenginequick/api/qquickwebengineaction.cpp b/src/webenginequick/api/qquickwebengineaction.cpp
new file mode 100644
index 000000000..006715c70
--- /dev/null
+++ b/src/webenginequick/api/qquickwebengineaction.cpp
@@ -0,0 +1,146 @@
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+
+#include "qquickwebengineaction_p.h"
+#include "qquickwebengineaction_p_p.h"
+#include "qquickwebengineview_p.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \qmltype WebEngineAction
+ \instantiates QQuickWebEngineAction
+ \inqmlmodule QtWebEngine
+ \since QtWebEngine 1.8
+
+ \brief An action that represents a \l WebEngineView::WebAction.
+
+ A WebEngineAction is returned by the \l WebEngineView::action()
+ method. It provides information about the action, such as
+ whether it is \l enabled.
+
+ The following code uses the \l WebEngineView::action() method to check if
+ the copy action is enabled:
+
+ \code
+ var copyAction = webEngineView.action(WebEngineView.Copy);
+ if (copyAction.enabled)
+ console.log("Copy is enabled.");
+ else
+ console.log("Copy is disabled.");
+ \endcode
+
+ A \l ToolButton can be connected to a WebEngineAction as follows:
+
+ \snippet qtwebengine_webengineaction.qml 0
+
+ A context menu could be implemented like this:
+
+ \snippet qtwebengine_webengineaction.qml 1
+*/
+
+QQuickWebEngineActionPrivate::QQuickWebEngineActionPrivate(const QVariant &data, const QString &text, const QString &iconName, bool enabled)
+ : m_data(data)
+ , m_text(text)
+ , m_iconName(iconName)
+ , m_enabled(enabled)
+{
+}
+
+QQuickWebEngineActionPrivate::~QQuickWebEngineActionPrivate()
+{
+}
+
+void QQuickWebEngineActionPrivate::setEnabled(bool enabled)
+{
+ Q_Q(QQuickWebEngineAction);
+ if (m_enabled == enabled)
+ return;
+ m_enabled = enabled;
+ emit q->enabledChanged();
+}
+
+QVariant QQuickWebEngineActionPrivate::data() const
+{
+ return m_data;
+}
+
+void QQuickWebEngineActionPrivate::trigger()
+{
+ Q_Q(QQuickWebEngineAction);
+ if (QQuickWebEngineView *view = static_cast<QQuickWebEngineView*>(q->parent())) {
+ view->triggerWebAction(static_cast<QQuickWebEngineView::WebAction>(data().toInt()));
+ }
+}
+
+QQuickWebEngineAction::QQuickWebEngineAction(const QVariant &data, const QString &text, const QString &iconName, bool enabled, QObject *parent)
+ : QObject(parent)
+ , d_ptr(new QQuickWebEngineActionPrivate(data, text, iconName, enabled))
+{
+ d_ptr->q_ptr = this;
+}
+
+QQuickWebEngineAction::QQuickWebEngineAction(QObject *parent)
+ : QObject(parent)
+ , d_ptr(new QQuickWebEngineActionPrivate(-1, QStringLiteral(""), QStringLiteral(""), false))
+{
+ d_ptr->q_ptr = this;
+}
+
+QQuickWebEngineAction::~QQuickWebEngineAction()
+{
+}
+
+/*!
+ \qmlproperty int WebEngineAction::text
+
+ This property holds a textual description of the action.
+*/
+QString QQuickWebEngineAction::text() const
+{
+ Q_D(const QQuickWebEngineAction);
+ return d->m_text;
+}
+
+/*!
+ \qmlproperty string WebEngineAction::iconName
+
+ This property holds the name of the icon for the action. This name
+ can be used to pick the icon from a theme.
+*/
+QString QQuickWebEngineAction::iconName() const
+{
+ Q_D(const QQuickWebEngineAction);
+ return d->m_iconName;
+}
+
+/*!
+ \qmlproperty bool WebEngineAction::enabled
+
+ This property holds whether the action is enabled.
+*/
+bool QQuickWebEngineAction::isEnabled() const
+{
+ Q_D(const QQuickWebEngineAction);
+ return d->m_enabled;
+}
+
+/*!
+ \qmlmethod void WebEngineAction::trigger()
+
+ Triggers the action.
+*/
+void QQuickWebEngineAction::trigger()
+{
+ Q_D(QQuickWebEngineAction);
+ if (!isEnabled())
+ return;
+
+ d->trigger();
+ emit triggered();
+}
+
+QT_END_NAMESPACE
+
+#include "moc_qquickwebengineaction_p.cpp"
diff --git a/src/webenginequick/api/qquickwebengineaction_p.h b/src/webenginequick/api/qquickwebengineaction_p.h
new file mode 100644
index 000000000..fcada7773
--- /dev/null
+++ b/src/webenginequick/api/qquickwebengineaction_p.h
@@ -0,0 +1,72 @@
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QQUICKWEBENGINEACTION_P_H
+#define QQUICKWEBENGINEACTION_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qtwebenginequickglobal_p.h"
+#include <QtCore/qobject.h>
+#include <QtCore/qvariant.h>
+#include <QtQml/qqml.h>
+#include <QtQml/qqmlregistration.h>
+
+namespace QtWebEngineCore {
+ class UIDelegatesManager;
+}
+
+QT_BEGIN_NAMESPACE
+
+class QQuickWebEngineActionPrivate;
+
+class Q_WEBENGINEQUICK_EXPORT QQuickWebEngineAction : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QString text READ text CONSTANT FINAL)
+ Q_PROPERTY(QString iconName READ iconName CONSTANT FINAL)
+ Q_PROPERTY(bool enabled READ isEnabled NOTIFY enabledChanged FINAL)
+ QML_NAMED_ELEMENT(WebEngineAction)
+ QML_ADDED_IN_VERSION(1, 8)
+ QML_EXTRA_VERSION(2, 0)
+ QML_UNCREATABLE("")
+
+public:
+ QQuickWebEngineAction(const QVariant &data, const QString &text, const QString &iconName, bool enabled, QObject *parent);
+ QQuickWebEngineAction(QObject *parent);
+ ~QQuickWebEngineAction();
+
+ QString text() const;
+ QString iconName() const;
+ bool isEnabled() const;
+
+public Q_SLOTS:
+ Q_INVOKABLE void trigger();
+
+Q_SIGNALS:
+ void triggered();
+ void enabledChanged();
+
+private:
+ Q_DECLARE_PRIVATE(QQuickWebEngineAction)
+ friend class QQuickWebEngineViewPrivate;
+ friend class QQuickContextMenuBuilder;
+
+ QScopedPointer<QQuickWebEngineActionPrivate> d_ptr;
+};
+
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QQuickWebEngineAction)
+
+#endif // QQUICKWEBENGINEACTION_P_H
diff --git a/src/webenginequick/api/qquickwebengineaction_p_p.h b/src/webenginequick/api/qquickwebengineaction_p_p.h
new file mode 100644
index 000000000..7cbd69a79
--- /dev/null
+++ b/src/webenginequick/api/qquickwebengineaction_p_p.h
@@ -0,0 +1,50 @@
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QQUICKWEBENGINEACTION_P_P_H
+#define QQUICKWEBENGINEACTION_P_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qtwebenginequickglobal_p.h"
+#include <QtCore/qstring.h>
+#include <QtCore/qvariant.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQuickWebEngineAction;
+
+class QQuickWebEngineActionPrivate
+{
+public:
+ Q_DECLARE_PUBLIC(QQuickWebEngineAction)
+ QQuickWebEngineActionPrivate(const QVariant &data, const QString &text, const QString &iconName, bool enabled);
+ ~QQuickWebEngineActionPrivate();
+
+ void setEnabled(bool enabled);
+
+ QVariant data() const;
+
+ void trigger();
+
+ QVariant m_data;
+ QString m_text;
+ QString m_iconName;
+ bool m_enabled;
+
+private:
+ QQuickWebEngineAction *q_ptr;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQUICKWEBENGINEACTION_P_P_H
diff --git a/src/webenginequick/api/qquickwebengineclientcertificateselection.cpp b/src/webenginequick/api/qquickwebengineclientcertificateselection.cpp
new file mode 100644
index 000000000..46e531716
--- /dev/null
+++ b/src/webenginequick/api/qquickwebengineclientcertificateselection.cpp
@@ -0,0 +1,189 @@
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qquickwebengineclientcertificateselection_p.h"
+
+#include "client_cert_select_controller.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \qmltype WebEngineClientCertificateOption
+ //! \instantiates QQuickWebEngineClientCertificateOption
+ \inqmlmodule QtWebEngine
+ \since QtWebEngine 1.9
+ \brief Represents a client certificate option.
+
+ \sa {WebEngineClientCertificateSelection::certificates} {WebEngineClientCertificateSelection.certificates}
+*/
+
+QQuickWebEngineClientCertificateOption::QQuickWebEngineClientCertificateOption(QQuickWebEngineClientCertificateSelection *selection, int index)
+ : QObject(selection), m_selection(selection), m_index(index)
+{}
+
+/*!
+ \qmlproperty string WebEngineClientCertificateOption::issuer
+ \brief The issuer of the certificate.
+*/
+
+QString QQuickWebEngineClientCertificateOption::issuer() const
+{
+ return m_selection->d_ptr->certificates().at(m_index).issuerDisplayName();
+}
+
+/*!
+ \qmlproperty string WebEngineClientCertificateOption::subject
+ \brief The subject of the certificate.
+*/
+QString QQuickWebEngineClientCertificateOption::subject() const
+{
+ return m_selection->d_ptr->certificates().at(m_index).subjectDisplayName();
+}
+
+/*!
+ \qmlproperty datetime WebEngineClientCertificateOption::effectiveDate
+ \brief The date and time when the certificate becomes valid.
+*/
+QDateTime QQuickWebEngineClientCertificateOption::effectiveDate() const
+{
+ return m_selection->d_ptr->certificates().at(m_index).effectiveDate();
+}
+
+/*!
+ \qmlproperty datetime WebEngineClientCertificateOption::expiryDate
+ \brief The date and time when the certificate becomes invalid.
+*/
+QDateTime QQuickWebEngineClientCertificateOption::expiryDate() const
+{
+ return m_selection->d_ptr->certificates().at(m_index).expiryDate();
+}
+
+/*!
+ \qmlproperty bool WebEngineClientCertificateOption::isSelfSigned
+ \brief Whether the certificate is only self-signed.
+*/
+bool QQuickWebEngineClientCertificateOption::isSelfSigned() const
+{
+ return m_selection->d_ptr->certificates().at(m_index).isSelfSigned();
+}
+
+/*!
+ \qmlmethod void WebEngineClientCertificateOption::select()
+
+ Selects this client certificate option.
+*/
+void QQuickWebEngineClientCertificateOption::select()
+{
+ m_selection->select(m_index);
+}
+
+/*!
+ \qmltype WebEngineClientCertificateSelection
+ //! \instantiates QQuickWebEngineClientCertificateSelection
+ \inqmlmodule QtWebEngine
+ \since QtWebEngine 1.9
+ \brief Provides a selection of client certificates.
+
+ When a web site requests an SSL client certificate, and one or more certificates
+ are found in the system's client certificate store, this type provides access to
+ the certificates to choose from, as well as a method for selecting one.
+
+ The selection is asynchronous. If no certificate is selected and no copy of the
+ object is kept alive, loading will continue without a certificate.
+
+ \sa {WebEngineView::selectClientCertificate}{WebEngineView.selectClientCertificate}
+*/
+
+QQuickWebEngineClientCertificateSelection::QQuickWebEngineClientCertificateSelection(
+ QSharedPointer<QtWebEngineCore::ClientCertSelectController> selectController)
+ : QObject(), d_ptr(selectController)
+{}
+
+qsizetype QQuickWebEngineClientCertificateSelection::certificates_count(
+ QQmlListProperty<QQuickWebEngineClientCertificateOption> *p)
+{
+ Q_ASSERT(p && p->object);
+ QQuickWebEngineClientCertificateSelection *d = static_cast<QQuickWebEngineClientCertificateSelection *>(p->object);
+ return d->m_certificates.size();
+}
+
+QQuickWebEngineClientCertificateOption *QQuickWebEngineClientCertificateSelection::certificates_at(
+ QQmlListProperty<QQuickWebEngineClientCertificateOption> *p, qsizetype idx)
+{
+ Q_ASSERT(p && p->object);
+ QQuickWebEngineClientCertificateSelection *d = static_cast<QQuickWebEngineClientCertificateSelection *>(p->object);
+ if (idx < 0 || idx >= d->m_certificates.size())
+ return nullptr;
+ return d->m_certificates[idx];
+}
+
+/*!
+ \qmlproperty list<WebEngineClientCertificateOption> WebEngineClientCertificateSelection::certificates
+ \brief The client certificates available to choose from.
+*/
+
+QQmlListProperty<QQuickWebEngineClientCertificateOption> QQuickWebEngineClientCertificateSelection::certificates()
+{
+ if (m_certificates.empty()) {
+ QList<QSslCertificate> certificates = d_ptr->certificates();
+ for (int i = 0; i < certificates.size(); ++i)
+ m_certificates.push_back(new QQuickWebEngineClientCertificateOption(this, i));
+ }
+
+ return QQmlListProperty<QQuickWebEngineClientCertificateOption>(
+ this, nullptr,
+ certificates_count,
+ certificates_at);
+}
+
+/*!
+ \qmlmethod void WebEngineClientCertificateSelection::select(WebEngineClientCertificateOption certificate)
+
+ Selects the client certificate \a certificate. The certificate must be one
+ of the offered certificates.
+
+ \sa selectNone()
+*/
+void QQuickWebEngineClientCertificateSelection::select(const QQuickWebEngineClientCertificateOption *certificate)
+{
+ select(certificate->m_index);
+}
+
+/*!
+ \qmlmethod void WebEngineClientCertificateSelection::select(int index)
+
+ Selects the client certificate at the index \a index in the list of offered certificates.
+
+ \sa selectNone()
+*/
+void QQuickWebEngineClientCertificateSelection::select(int index)
+{
+ d_ptr->select(index);
+}
+
+/*!
+ \qmlmethod void WebEngineClientCertificateSelection::selectNone()
+
+ Continues without using any of the offered certificates. This is the same
+ action as taken when destroying the last copy of this object if no
+ selection has been made.
+
+ \sa select()
+*/
+void QQuickWebEngineClientCertificateSelection::selectNone()
+{
+ d_ptr->selectNone();
+}
+
+/*!
+ \qmlproperty url WebEngineClientCertificateSelection::host
+ \brief The host and port of the server requesting the client certificate.
+*/
+QUrl QQuickWebEngineClientCertificateSelection::host() const
+{
+ return d_ptr->hostAndPort();
+}
+
+QT_END_NAMESPACE
+
+#include "moc_qquickwebengineclientcertificateselection_p.cpp"
diff --git a/src/webenginequick/api/qquickwebengineclientcertificateselection_p.h b/src/webenginequick/api/qquickwebengineclientcertificateselection_p.h
new file mode 100644
index 000000000..2e0450f8e
--- /dev/null
+++ b/src/webenginequick/api/qquickwebengineclientcertificateselection_p.h
@@ -0,0 +1,104 @@
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QQUICKWEBENGINECERTSELECTION_P_H
+#define QQUICKWEBENGINECERTSELECTION_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtWebEngineQuick/private/qtwebenginequickglobal_p.h>
+
+#include <QtCore/qdatetime.h>
+#include <QtCore/qlist.h>
+#include <QtCore/qobject.h>
+#include <QtCore/qsharedpointer.h>
+#include <QtCore/qurl.h>
+#include <QtQml/qqmllist.h>
+#include <QtQml/qqmlregistration.h>
+
+namespace QtWebEngineCore {
+class ClientCertSelectController;
+}
+
+QT_BEGIN_NAMESPACE
+
+class QQuickWebEngineClientCertificateSelection;
+
+class Q_WEBENGINEQUICK_EXPORT QQuickWebEngineClientCertificateOption : public QObject {
+ Q_OBJECT
+ Q_PROPERTY(QString issuer READ issuer CONSTANT FINAL)
+ Q_PROPERTY(QString subject READ subject CONSTANT FINAL)
+ Q_PROPERTY(QDateTime effectiveDate READ effectiveDate CONSTANT FINAL)
+ Q_PROPERTY(QDateTime expiryDate READ expiryDate CONSTANT FINAL)
+ Q_PROPERTY(bool isSelfSigned READ isSelfSigned CONSTANT FINAL)
+ QML_NAMED_ELEMENT(WebEngineClientCertificateOption)
+ QML_ADDED_IN_VERSION(1, 9)
+ QML_EXTRA_VERSION(2, 0)
+ QML_UNCREATABLE("")
+
+public:
+ QString issuer() const;
+ QString subject() const;
+ QDateTime effectiveDate() const;
+ QDateTime expiryDate() const;
+ bool isSelfSigned() const;
+
+ Q_INVOKABLE void select();
+
+private:
+ friend class QQuickWebEngineClientCertificateSelection;
+ QQuickWebEngineClientCertificateOption(QQuickWebEngineClientCertificateSelection *selection, int index);
+
+ QQuickWebEngineClientCertificateSelection *m_selection;
+ int m_index;
+};
+
+class Q_WEBENGINEQUICK_EXPORT QQuickWebEngineClientCertificateSelection : public QObject {
+ Q_OBJECT
+ Q_PROPERTY(QUrl host READ host CONSTANT FINAL)
+ Q_PROPERTY(QQmlListProperty<QQuickWebEngineClientCertificateOption> certificates READ certificates CONSTANT FINAL)
+ QML_NAMED_ELEMENT(WebEngineClientCertificateSelection)
+ QML_ADDED_IN_VERSION(1, 9)
+ QML_EXTRA_VERSION(2, 0)
+ QML_UNCREATABLE("")
+
+public:
+ QQuickWebEngineClientCertificateSelection() = default;
+
+ QUrl host() const;
+
+ Q_INVOKABLE void select(int idx);
+ Q_INVOKABLE void select(const QQuickWebEngineClientCertificateOption *certificate);
+ Q_INVOKABLE void selectNone();
+ QQmlListProperty<QQuickWebEngineClientCertificateOption> certificates();
+
+private:
+ friend class QQuickWebEngineViewPrivate;
+ friend class QQuickWebEngineClientCertificateOption;
+
+ static qsizetype certificates_count(QQmlListProperty<QQuickWebEngineClientCertificateOption> *p);
+ static QQuickWebEngineClientCertificateOption *certificates_at(QQmlListProperty<QQuickWebEngineClientCertificateOption> *p, qsizetype idx);
+
+ explicit QQuickWebEngineClientCertificateSelection(
+ QSharedPointer<QtWebEngineCore::ClientCertSelectController>);
+
+ mutable QList<QQuickWebEngineClientCertificateOption *> m_certificates;
+ QSharedPointer<QtWebEngineCore::ClientCertSelectController> d_ptr;
+};
+
+QT_END_NAMESPACE
+
+Q_DECLARE_METATYPE(QQuickWebEngineClientCertificateOption *)
+Q_DECLARE_METATYPE(QQmlListProperty<QQuickWebEngineClientCertificateOption>)
+Q_DECLARE_METATYPE(QQuickWebEngineClientCertificateSelection *)
+
+#endif // QQUICKWEBENGINECERTSELECTION_P_H
diff --git a/src/webenginequick/api/qquickwebenginedialogrequests.cpp b/src/webenginequick/api/qquickwebenginedialogrequests.cpp
new file mode 100644
index 000000000..d49f17397
--- /dev/null
+++ b/src/webenginequick/api/qquickwebenginedialogrequests.cpp
@@ -0,0 +1,817 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qquickwebenginedialogrequests_p.h"
+#include "authentication_dialog_controller.h"
+#include "javascript_dialog_controller.h"
+#include "color_chooser_controller.h"
+#include "file_picker_controller.h"
+#include "web_contents_adapter_client.h"
+
+#include <QCursor>
+#include <QQuickItem>
+
+QT_BEGIN_NAMESPACE
+
+using namespace QtWebEngineCore;
+
+ASSERT_ENUMS_MATCH(WebContentsAdapterClient::AlertDialog,
+ QQuickWebEngineJavaScriptDialogRequest::DialogTypeAlert)
+ASSERT_ENUMS_MATCH(WebContentsAdapterClient::ConfirmDialog,
+ QQuickWebEngineJavaScriptDialogRequest::DialogTypeConfirm)
+ASSERT_ENUMS_MATCH(WebContentsAdapterClient::PromptDialog,
+ QQuickWebEngineJavaScriptDialogRequest::DialogTypePrompt)
+ASSERT_ENUMS_MATCH(WebContentsAdapterClient::UnloadDialog,
+ QQuickWebEngineJavaScriptDialogRequest::DialogTypeBeforeUnload)
+
+ASSERT_ENUMS_MATCH(FilePickerController::Open,
+ QQuickWebEngineFileDialogRequest::FileModeOpen)
+ASSERT_ENUMS_MATCH(FilePickerController::OpenMultiple,
+ QQuickWebEngineFileDialogRequest::FileModeOpenMultiple)
+ASSERT_ENUMS_MATCH(FilePickerController::UploadFolder,
+ QQuickWebEngineFileDialogRequest::FileModeUploadFolder)
+ASSERT_ENUMS_MATCH(FilePickerController::Save,
+ QQuickWebEngineFileDialogRequest::FileModeSave)
+
+/*!
+ \qmltype AuthenticationDialogRequest
+ //! \instantiates QQuickWebEngineAuthenticationDialogRequest
+ \inqmlmodule QtWebEngine
+ \since QtWebEngine 1.4
+
+ \brief A request for providing authentication credentials required
+ by proxies or HTTP servers.
+
+ An AuthenticationDialogRequest is passed as an argument of the
+ WebEngineView::authenticationDialogRequested signal. It is generated
+ when basic HTTP or proxy authentication is required. The type
+ of authentication can be checked with the \l type property.
+
+ The \l accepted property of the request indicates whether the request
+ is handled by the user code or the default dialog should be displayed.
+ If you set the \l accepted property to \c true, make sure to call
+ either \l dialogAccept() or \l dialogReject() afterwards.
+
+ The following code uses a custom dialog to handle the request:
+ \code
+
+ WebEngineView {
+ // ...
+ onAuthenticationDialogRequested: function(request) {
+ request.accepted = true;
+ myDialog.request = request // keep the reference to the request
+ myDialog.accept.connect(request.dialogAccept);
+ myDialog.reject.connect(request.dialogReject);
+ myDialog.visible = true;
+ }
+ // ...
+ }
+
+ \endcode
+*/
+
+QQuickWebEngineAuthenticationDialogRequest::QQuickWebEngineAuthenticationDialogRequest(
+ QSharedPointer<AuthenticationDialogController> controller,
+ QObject *parent):
+ QObject(parent)
+ , m_controller(controller.toWeakRef())
+ , m_url(controller->url())
+ , m_realm(controller->realm())
+ , m_type(controller->isProxy() ? AuthenticationTypeProxy
+ : AuthenticationTypeHTTP)
+ , m_host(controller->host())
+ , m_accepted(false)
+{
+
+}
+
+QQuickWebEngineAuthenticationDialogRequest::~QQuickWebEngineAuthenticationDialogRequest()
+{
+}
+
+/*!
+ \qmlproperty url AuthenticationDialogRequest::url
+ \readonly
+
+ The URL of the HTTP request for which authentication was requested.
+ In case of proxy authentication, this is a request URL which is proxied
+ via host.
+
+ \sa proxyHost
+*/
+
+QUrl QQuickWebEngineAuthenticationDialogRequest::url() const
+{
+ return m_url;
+}
+
+/*!
+ \qmlproperty string AuthenticationDialogRequest::realm
+ \readonly
+
+ The HTTP authentication realm attribute value of the \c WWW-Authenticate
+ header. Empty if \l type is AuthenticationTypeProxy.
+*/
+
+QString QQuickWebEngineAuthenticationDialogRequest::realm() const
+{
+ return m_realm;
+}
+
+/*!
+ \qmlproperty string AuthenticationDialogRequest::proxyHost
+ \readonly
+
+ The hostname of the authentication proxy.
+ Empty if \l type is AuthenticationTypeHTTP.
+*/
+
+QString QQuickWebEngineAuthenticationDialogRequest::proxyHost() const
+{
+ return m_host;
+}
+
+/*!
+ \qmlproperty enumeration AuthenticationDialogRequest::type
+ \readonly
+
+ The type of the authentication request.
+
+ \value WebEngineAuthenticationDialogRequest.AuthenticationTypeHTTP
+ HTTP authentication.
+ \value WebEngineAuthenticationDialogRequest.AuthenticationTypeProxy
+ Proxy authentication.
+*/
+
+QQuickWebEngineAuthenticationDialogRequest::AuthenticationType
+QQuickWebEngineAuthenticationDialogRequest::type() const
+{
+ return m_type;
+}
+
+/*!
+ \qmlproperty bool AuthenticationDialogRequest::accepted
+
+ Indicates whether the authentication dialog request has been
+ accepted by the signal handler.
+
+ If the property is \c false after any signal handlers
+ for WebEngineView::authenticationDialogRequested have been executed,
+ a default authentication dialog will be shown.
+ To prevent this, set \c{request.accepted} to \c true.
+
+ The default is \c false.
+*/
+
+bool QQuickWebEngineAuthenticationDialogRequest::isAccepted() const
+{
+ return m_accepted;
+}
+
+void QQuickWebEngineAuthenticationDialogRequest::setAccepted(bool accepted)
+{
+ m_accepted = accepted;
+}
+
+/*!
+ \qmlmethod void AuthenticationDialogRequest::dialogAccept(string username, string password)
+
+ This function notifies the engine that the user accepted the dialog,
+ providing the \a username and the \a password required for authentication.
+*/
+
+void QQuickWebEngineAuthenticationDialogRequest::dialogAccept(const QString &user,
+ const QString &password)
+{
+ m_accepted = true;
+ QSharedPointer<AuthenticationDialogController> controller
+ = m_controller.toStrongRef();
+ if (controller)
+ controller->accept(user,password);
+}
+
+/*!
+ \qmlmethod void AuthenticationDialogRequest::dialogReject()
+
+ This function notifies the engine that the user rejected the dialog and the
+ authentication shall not proceed.
+*/
+
+void QQuickWebEngineAuthenticationDialogRequest::dialogReject()
+{
+ m_accepted = true;
+ QSharedPointer<AuthenticationDialogController> controller
+ = m_controller.toStrongRef();
+ if (controller)
+ controller->reject();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+/*!
+ \qmltype JavaScriptDialogRequest
+ //! \instantiates QQuickWebEngineJavaScriptDialogRequest
+ \inqmlmodule QtWebEngine
+ \since QtWebEngine 1.4
+
+ \brief A request for showing an alert, a confirmation, or a prompt dialog
+ from within JavaScript to the user.
+
+ A JavaScriptDialogRequest is passed as an argument of the
+ WebEngineView::javaScriptDialogRequested signal. The request is emitted
+ if JavaScript on the page calls HTML5's
+ \l{https://www.w3.org/TR/html5/webappapis.html#simple-dialogs}{Simple Dialogs}
+ API, or in response to HTML5's
+ \l {https://www.w3.org/TR/html5/browsers.html#beforeunloadevent}{BeforeUnloadEvent}.
+ The type of a particular dialog can be checked with the \l type property.
+
+ The \l accepted property of the request indicates whether the request
+ is handled by the user code or the default dialog should be displayed.
+ If you set the \l accepted property to \c true, make sure to call either
+ \l dialogAccept() or \l dialogReject() afterwards. The JavaScript call
+ causing the request will be blocked until then.
+
+ The following code uses a custom dialog to handle the request:
+
+ \code
+ WebEngineView {
+ // ...
+ onJavaScriptDialogRequested: function(request) {
+ request.accepted = true;
+ myDialog.request = request // keep the reference to the request
+ myDialog.accept.connect(request.dialogAccept);
+ myDialog.reject.connect(request.dialogReject);
+ myDialog.visible = true;
+ }
+ // ...
+ }
+ \endcode
+*/
+
+QQuickWebEngineJavaScriptDialogRequest::QQuickWebEngineJavaScriptDialogRequest(
+ QSharedPointer<JavaScriptDialogController> controller, QObject *parent):
+ QObject(parent)
+ , m_controller(controller.toWeakRef())
+ , m_message(controller->message())
+ , m_defaultPrompt(controller->defaultPrompt())
+ , m_title(controller->title())
+ , m_type(static_cast<QQuickWebEngineJavaScriptDialogRequest::DialogType>(controller->type()))
+ , m_securityOrigin(controller->securityOrigin())
+ , m_accepted(false)
+{
+}
+
+QQuickWebEngineJavaScriptDialogRequest::~QQuickWebEngineJavaScriptDialogRequest()
+{
+
+}
+
+/*!
+ \qmlproperty string JavaScriptDialogRequest::message
+ \readonly
+
+ The message to be shown to the user.
+*/
+
+QString QQuickWebEngineJavaScriptDialogRequest::message() const
+{
+ return m_message;
+}
+
+/*!
+ \qmlproperty string JavaScriptDialogRequest::defaultText
+ \readonly
+
+ The default prompt text, if the requested dialog is a prompt.
+*/
+
+
+QString QQuickWebEngineJavaScriptDialogRequest::defaultText() const
+{
+ return m_defaultPrompt;
+}
+
+/*!
+ \qmlproperty string JavaScriptDialogRequest::title
+ \readonly
+
+ A default title for the dialog.
+*/
+
+QString QQuickWebEngineJavaScriptDialogRequest::title() const
+{
+ return m_title;
+}
+
+/*!
+ \qmlproperty enumeration JavaScriptDialogRequest::type
+ \readonly
+
+ Returns the type of the requested dialog box. For more information, see
+ HTML5's
+ \l{https://www.w3.org/TR/html5/webappapis.html#simple-dialogs}{Simple Dialogs}.
+
+ \value JavaScriptDialogRequest.DialogTypeAlert
+ A JavaScript alert dialog.
+ \value JavaScriptDialogRequest.DialogTypeConfirm
+ A JavaScript confirmation dialog.
+ \value JavaScriptDialogRequest.DialogTypePrompt
+ A JavaScript prompt dialog.
+ \value JavaScriptDialogRequest.DialogTypeBeforeUnload
+ The users should be asked if they want to leave the page.
+*/
+
+QQuickWebEngineJavaScriptDialogRequest::DialogType QQuickWebEngineJavaScriptDialogRequest::type() const
+{
+ return m_type;
+}
+
+/*!
+ \qmlproperty url JavaScriptDialogRequest::securityOrigin
+ \readonly
+
+ The URL of the security origin.
+*/
+
+QUrl QQuickWebEngineJavaScriptDialogRequest::securityOrigin() const
+{
+ return m_securityOrigin;
+}
+
+/*!
+ \qmlproperty bool JavaScriptDialogRequest::accepted
+
+ Indicates whether the JavaScript dialog request has been
+ accepted by the signal handler.
+
+ If the property is \c false after any signal handlers
+ for WebEngineView::javaScriptDialogRequested have been executed,
+ a default dialog will be shown.
+ To prevent this, set \c{request.accepted} to \c true.
+
+ The default is \c false.
+*/
+
+bool QQuickWebEngineJavaScriptDialogRequest::isAccepted() const
+{
+ return m_accepted;
+}
+
+void QQuickWebEngineJavaScriptDialogRequest::setAccepted(bool accepted)
+{
+ m_accepted = accepted;
+}
+
+/*!
+ \qmlmethod void JavaScriptDialogRequest::dialogAccept()
+
+ This function notifies the engine that the user accepted the dialog.
+*/
+
+/*!
+ \qmlmethod void JavaScriptDialogRequest::dialogAccept(string text)
+
+ This function notifies the engine that the user accepted the dialog,
+ providing the \a text in case of a prompt message box.
+*/
+
+void QQuickWebEngineJavaScriptDialogRequest::dialogAccept(const QString& text)
+{
+ m_accepted = true;
+ QSharedPointer<JavaScriptDialogController> controller
+ = m_controller.toStrongRef();
+ if (controller) {
+ controller->textProvided(text);
+ controller->accept();
+ }
+}
+
+/*!
+ \qmlmethod void JavaScriptDialogRequest::dialogReject()
+
+ This function notifies the engine that the user rejected the dialog.
+*/
+
+void QQuickWebEngineJavaScriptDialogRequest::dialogReject()
+{
+ m_accepted = true;
+ QSharedPointer<JavaScriptDialogController> controller
+ = m_controller.toStrongRef();
+ if (controller)
+ controller->reject();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+/*!
+ \qmltype ColorDialogRequest
+ //! \instantiates QQuickWebEngineColorDialogRequest
+ \inqmlmodule QtWebEngine
+ \since QtWebEngine 1.4
+
+ \brief A request for selecting a color by the user.
+
+ A ColorDialogRequest is passed as an argument of the
+ WebEngineView::colorDialogRequested signal. It is generated when
+ a color picker dialog is requested. See
+ \l { https://www.w3.org/TR/html5/forms.html#color-state-(type=color)}
+ {HTML5 Color State}.
+
+ The \l accepted property of the request indicates whether the request
+ is handled by the user code or the default dialog should be displayed.
+ If you set the \l accepted property to \c true, make sure to call either
+ \l dialogAccept() or \l dialogReject() afterwards.
+
+ The following code uses a custom dialog to handle the request:
+
+ \code
+ WebEngineView {
+ // ...
+ onColorDialogRequested: function(request) {
+ request.accepted = true;
+ myDialog.request = request // keep the reference to the request
+ myDialog.accept.connect(request.dialogAccept);
+ myDialog.reject.connect(request.dialogReject);
+ myDialog.visible = true;
+ }
+ // ...
+ }
+ \endcode
+*/
+
+QQuickWebEngineColorDialogRequest::QQuickWebEngineColorDialogRequest(
+ QSharedPointer<ColorChooserController> controller, QObject *parent):
+ QObject(parent)
+ , m_controller(controller.toWeakRef())
+ , m_color(controller->initialColor())
+ , m_accepted(false)
+{
+
+}
+
+QQuickWebEngineColorDialogRequest::~QQuickWebEngineColorDialogRequest()
+{
+
+}
+
+/*!
+ \qmlproperty color ColorDialogRequest::color
+ \readonly
+
+ The default color to be selected in the dialog.
+*/
+
+QColor QQuickWebEngineColorDialogRequest::color() const
+{
+ return m_color;
+}
+
+/*!
+ \qmlproperty bool ColorDialogRequest::accepted
+
+ Indicates whether the color picker dialog request has been
+ accepted by the signal handler.
+
+ If the property is \c false after any signal handlers
+ for WebEngineView::colorDialogRequested have been executed,
+ a default color picker dialog will be shown.
+ To prevent this, set \c{request.accepted} to \c true.
+
+ The default is \c false.
+*/
+
+bool QQuickWebEngineColorDialogRequest::isAccepted() const
+{
+ return m_accepted;
+}
+
+void QQuickWebEngineColorDialogRequest::setAccepted(bool accepted)
+{
+ m_accepted = accepted;
+}
+
+
+/*!
+ \qmlmethod void ColorDialogRequest::dialogAccept(color color)
+
+ This function notifies the engine that the user accepted the dialog,
+ providing the \a color.
+*/
+
+void QQuickWebEngineColorDialogRequest::dialogAccept(const QColor &color)
+{
+ m_accepted = true;
+ QSharedPointer<ColorChooserController> controller = m_controller.toStrongRef();
+ if (controller)
+ controller->accept(color);
+}
+
+/*!
+ \qmlmethod void ColorDialogRequest::dialogReject()
+
+ This function notifies the engine that the user rejected the dialog.
+*/
+
+void QQuickWebEngineColorDialogRequest::dialogReject()
+{
+ m_accepted = true;
+ QSharedPointer<ColorChooserController> controller = m_controller.toStrongRef();
+ if (controller)
+ controller->reject();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+/*!
+ \qmltype FileDialogRequest
+ //! \instantiates QQuickWebEngineFileDialogRequest
+ \inqmlmodule QtWebEngine
+ \since QtWebEngine 1.4
+
+ \brief A request for letting the user choose a (new or existing) file or
+ directory.
+
+ A FileDialogRequest is passed as an argument of the
+ WebEngineView::fileDialogRequested signal. It is generated
+ when the file dialog is requested by the input element.
+ See \l {https://www.w3.org/TR/html5/forms.html#file-upload-state-(type=file)}{File Upload state}.
+
+ The \l accepted property of the request indicates whether the request
+ is handled by the user code or the default dialog should be displayed.
+ If you set the \l accepted property to \c true, make sure to call either
+ \l dialogAccept() or \l dialogReject() afterwards.
+
+ The following code uses a custom dialog to handle the request:
+
+ \code
+ WebEngineView {
+ // ...
+ onFileDialogRequested: function(request) {
+ request.accepted = true;
+ myDialog.request = request // keep the reference to the request
+ myDialog.accept.connect(request.dialogAccept);
+ myDialog.reject.connect(request.dialogReject);
+ myDialog.visible = true;
+ }
+ // ...
+ }
+ \endcode
+*/
+
+QQuickWebEngineFileDialogRequest::QQuickWebEngineFileDialogRequest(
+ QSharedPointer<FilePickerController> controller, QObject *parent):
+ QObject(parent)
+ , m_controller(controller.toWeakRef())
+ , m_filename(controller->defaultFileName())
+ , m_acceptedMimeTypes(controller->acceptedMimeTypes())
+ , m_mode(static_cast<QQuickWebEngineFileDialogRequest::FileMode>(controller->mode()))
+ , m_accepted(false)
+{
+
+}
+
+QQuickWebEngineFileDialogRequest::~QQuickWebEngineFileDialogRequest()
+{
+
+}
+
+/*!
+ \qmlproperty stringlist FileDialogRequest::acceptedMimeTypes
+ \readonly
+
+ A list of MIME types specified in the input element. The selection
+ should be restricted to only these types of files.
+*/
+
+QStringList QQuickWebEngineFileDialogRequest::acceptedMimeTypes() const
+{
+ return m_acceptedMimeTypes;
+}
+
+/*!
+ \qmlproperty string FileDialogRequest::defaultFileName
+ \readonly
+
+ The default name of the file to be selected in the dialog.
+*/
+
+QString QQuickWebEngineFileDialogRequest::defaultFileName() const
+{
+ return m_filename;
+}
+
+/*!
+ \qmlproperty enumeration FileDialogRequest::mode
+ \readonly
+
+ The mode of the file dialog.
+
+ \value FileDialogRequest.FileModeOpen
+ Allows users to specify a single existing file.
+ \value FileDialogRequest.FileModeOpenMultiple
+ Allows users to specify multiple existing files.
+ \value FileDialogRequest.FileModeUploadFolder
+ Allows users to specify a single existing folder for upload.
+ \value FileDialogRequest.FileModeSave
+ Allows users to specify a non-existing file. If an existing file
+ is selected, the users should be informed that the file is going
+ to be overwritten.
+*/
+
+QQuickWebEngineFileDialogRequest::FileMode QQuickWebEngineFileDialogRequest::mode() const
+{
+ return m_mode;
+}
+
+/*!
+ \qmlproperty bool FileDialogRequest::accepted
+
+ Indicates whether the file picker dialog request has been
+ handled by the signal handler.
+
+ If the property is \c false after any signal handlers
+ for WebEngineView::fileDialogRequested have been executed,
+ a default file picker dialog will be shown.
+ To prevent this, set \c{request.accepted} to \c true.
+
+ The default is \c false.
+*/
+
+bool QQuickWebEngineFileDialogRequest::isAccepted() const
+{
+ return m_accepted;
+}
+
+void QQuickWebEngineFileDialogRequest::setAccepted(bool accepted)
+{
+ m_accepted = accepted;
+}
+
+/*!
+ \qmlmethod void FileDialogRequest::dialogAccept(stringlist files)
+
+ This function needs to be called when the user accepted the dialog with
+ \a files.
+*/
+
+void QQuickWebEngineFileDialogRequest::dialogAccept(const QStringList &files)
+{
+ m_accepted = true;
+ QSharedPointer<FilePickerController> controller = m_controller.toStrongRef();
+ if (controller)
+ controller->accepted(files);
+}
+
+/*!
+ \qmlmethod void FileDialogRequest::dialogReject()
+
+ This function needs to be called when the user did not accepted the dialog.
+*/
+
+void QQuickWebEngineFileDialogRequest::dialogReject()
+{
+ m_accepted = true;
+ QSharedPointer<FilePickerController> controller = m_controller.toStrongRef();
+ if (controller)
+ controller->rejected();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+/*!
+ \qmltype TooltipRequest
+ //! \instantiates QQuickWebEngineTooltipRequest
+ \inqmlmodule QtWebEngine
+ \since QtWebEngine 1.10
+
+ \brief A request for showing a tooltip to the user.
+
+ A TooltipRequest is a request object that is passed as a
+ parameter of the WebEngineView::tooltipRequested signal. Use the
+ \c onTooltipRequested signal handler to handle requests for
+ custom tooltip menus at specific positions.
+
+ The \l accepted property of the request indicates whether the request
+ is handled by the user code or the default tooltip should
+ be displayed.
+
+ The following code uses a custom tooltip to handle the request:
+
+ \code
+ WebEngineView {
+ // ...
+ onTooltipRequested: function(request) {
+ if (request.type == TooltipRequest.Show) {
+ tooltip.visible = true;
+ tooltip.x = request.x;
+ tooltip.y = request.y;
+ tooltip.text = request.text;
+ } else {
+ tooltip.visible = false;
+ }
+ request.accepted = true;
+ }
+ // ...
+ }
+ \endcode
+*/
+
+QQuickWebEngineTooltipRequest::QQuickWebEngineTooltipRequest(
+ const QString &text, QObject *parent):
+ QObject(parent)
+ , m_text(text)
+ , m_type(text.isEmpty() ? RequestType::Hide : RequestType::Show)
+ , m_accepted(false)
+{
+ Q_ASSERT(parent);
+ if (QQuickItem *view = qobject_cast<QQuickItem *>(parent))
+ m_position = view->mapFromGlobal(view->cursor().pos()).toPoint();
+}
+
+QQuickWebEngineTooltipRequest::~QQuickWebEngineTooltipRequest()
+{
+
+}
+
+/*!
+ \qmlproperty int TooltipRequest::x
+ \readonly
+
+ The x coordinate of the top-left corner of the requested tooltip.
+*/
+
+int QQuickWebEngineTooltipRequest::x() const
+{
+ return m_position.x();
+}
+
+/*!
+ \qmlproperty int TooltipRequest::y
+ \readonly
+
+ The y coordinate of the top-left corner of the requested tooltip.
+*/
+
+int QQuickWebEngineTooltipRequest::y() const
+{
+ return m_position.y();
+}
+
+/*!
+ \qmlproperty bool TooltipRequest::text
+ \readonly
+
+ The text of the tooltip. It contains an empty string when the
+ tooltip should be hidden.
+*/
+
+
+QString QQuickWebEngineTooltipRequest::text() const
+{
+ return m_text;
+}
+
+/*!
+ \qmlproperty enumeration TooltipRequest::type
+ \readonly
+
+ The type of the tooltip request.
+
+ \value TooltipRequest.Show
+ The tooltip should be shown.
+ \value TooltipRequest.Hide
+ The tooltip should be hidden.
+*/
+
+QQuickWebEngineTooltipRequest::RequestType QQuickWebEngineTooltipRequest::type() const
+{
+ return m_type;
+}
+
+/*!
+ \qmlproperty bool TooltipRequest::accepted
+
+ Indicates whether the tooltip request has been accepted
+ by the signal handler.
+
+ If the property is \c false after any signal handlers
+ for WebEngineView::tooltipRequested have been executed,
+ a default tooltip will be shown.
+ To prevent this, set \c {request.accepted} to \c true.
+
+ The default is \c false.
+*/
+
+bool QQuickWebEngineTooltipRequest::isAccepted() const
+{
+ return m_accepted;
+}
+
+void QQuickWebEngineTooltipRequest::setAccepted(bool accepted)
+{
+ m_accepted = accepted;
+}
+
+QT_END_NAMESPACE
+
+#include "moc_qquickwebenginedialogrequests_p.cpp"
diff --git a/src/webenginequick/api/qquickwebenginedialogrequests_p.h b/src/webenginequick/api/qquickwebenginedialogrequests_p.h
new file mode 100644
index 000000000..d33a14df4
--- /dev/null
+++ b/src/webenginequick/api/qquickwebenginedialogrequests_p.h
@@ -0,0 +1,248 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QQUICKWEBENGINDIALOGREQUESTS_P_H
+#define QQUICKWEBENGINDIALOGREQUESTS_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtWebEngineQuick/private/qtwebenginequickglobal_p.h>
+#include <QtCore/qobject.h>
+#include <QtCore/qpoint.h>
+#include <QtCore/qsharedpointer.h>
+#include <QtCore/qurl.h>
+#include <QtGui/qcolor.h>
+#include <QtQml/qqmlregistration.h>
+
+namespace QtWebEngineCore {
+ class AuthenticationDialogController;
+ class ColorChooserController;
+ class FilePickerController;
+ class JavaScriptDialogController;
+}
+
+QT_BEGIN_NAMESPACE
+
+class Q_WEBENGINEQUICK_EXPORT QQuickWebEngineAuthenticationDialogRequest : public QObject {
+ Q_OBJECT
+public:
+
+ enum AuthenticationType {
+ AuthenticationTypeHTTP,
+ AuthenticationTypeProxy
+ };
+
+ Q_ENUM(AuthenticationType)
+
+ Q_PROPERTY(QUrl url READ url CONSTANT FINAL)
+ Q_PROPERTY(QString realm READ realm CONSTANT FINAL)
+ Q_PROPERTY(QString proxyHost READ proxyHost CONSTANT FINAL)
+ Q_PROPERTY(AuthenticationType type READ type CONSTANT FINAL)
+ Q_PROPERTY(bool accepted READ isAccepted WRITE setAccepted FINAL)
+ QML_NAMED_ELEMENT(AuthenticationDialogRequest)
+ QML_ADDED_IN_VERSION(1, 4)
+ QML_EXTRA_VERSION(2, 0)
+ QML_UNCREATABLE("")
+
+ ~QQuickWebEngineAuthenticationDialogRequest();
+
+ QUrl url() const;
+ QString realm() const;
+ QString proxyHost() const;
+ AuthenticationType type() const;
+ bool isAccepted() const;
+ void setAccepted(bool accepted);
+
+public slots:
+ void dialogAccept(const QString &user, const QString &password);
+ void dialogReject();
+
+private:
+ QQuickWebEngineAuthenticationDialogRequest(QSharedPointer<QtWebEngineCore::AuthenticationDialogController> controller,
+ QObject *parent = nullptr);
+ QWeakPointer<QtWebEngineCore::AuthenticationDialogController> m_controller;
+ QUrl m_url;
+ QString m_realm;
+ AuthenticationType m_type;
+ QString m_host;
+ bool m_accepted;
+ friend class QQuickWebEngineViewPrivate;
+ Q_DISABLE_COPY(QQuickWebEngineAuthenticationDialogRequest)
+};
+
+class Q_WEBENGINEQUICK_EXPORT QQuickWebEngineJavaScriptDialogRequest : public QObject {
+ Q_OBJECT
+public:
+
+ enum DialogType {
+ DialogTypeAlert,
+ DialogTypeConfirm,
+ DialogTypePrompt,
+ DialogTypeBeforeUnload,
+ };
+ Q_ENUM(DialogType)
+
+ Q_PROPERTY(QString message READ message CONSTANT FINAL)
+ Q_PROPERTY(QString defaultText READ defaultText CONSTANT FINAL)
+ Q_PROPERTY(QString title READ title CONSTANT FINAL)
+ Q_PROPERTY(DialogType type READ type CONSTANT FINAL)
+ Q_PROPERTY(QUrl securityOrigin READ securityOrigin CONSTANT FINAL)
+ Q_PROPERTY(bool accepted READ isAccepted WRITE setAccepted FINAL)
+ QML_NAMED_ELEMENT(JavaScriptDialogRequest)
+ QML_ADDED_IN_VERSION(1, 4)
+ QML_EXTRA_VERSION(2, 0)
+ QML_UNCREATABLE("")
+
+ ~QQuickWebEngineJavaScriptDialogRequest();
+
+ QString message() const;
+ QString defaultText() const;
+ QString title() const;
+ DialogType type() const;
+ QUrl securityOrigin() const;
+ bool isAccepted() const;
+ void setAccepted(bool accepted);
+
+public slots:
+ void dialogAccept(const QString& text = QString());
+ void dialogReject();
+
+private:
+ QQuickWebEngineJavaScriptDialogRequest(QSharedPointer<QtWebEngineCore::JavaScriptDialogController> controller,
+ QObject *parent = nullptr);
+ QWeakPointer<QtWebEngineCore::JavaScriptDialogController> m_controller;
+ QString m_message;
+ QString m_defaultPrompt;
+ QString m_title;
+ DialogType m_type;
+ QUrl m_securityOrigin;
+ bool m_accepted;
+ friend class QQuickWebEngineViewPrivate;
+ Q_DISABLE_COPY(QQuickWebEngineJavaScriptDialogRequest)
+};
+
+class Q_WEBENGINEQUICK_EXPORT QQuickWebEngineColorDialogRequest : public QObject {
+ Q_OBJECT
+public:
+
+ Q_PROPERTY(QColor color READ color CONSTANT FINAL)
+ Q_PROPERTY(bool accepted READ isAccepted WRITE setAccepted FINAL)
+ QML_NAMED_ELEMENT(ColorDialogRequest)
+ QML_ADDED_IN_VERSION(1, 4)
+ QML_EXTRA_VERSION(2, 0)
+ QML_UNCREATABLE("")
+
+ ~QQuickWebEngineColorDialogRequest();
+
+ QColor color() const;
+ bool isAccepted() const;
+ void setAccepted(bool accepted);
+
+public slots:
+ void dialogAccept(const QColor &color);
+ void dialogReject();
+
+private:
+ QQuickWebEngineColorDialogRequest(QSharedPointer<QtWebEngineCore::ColorChooserController> controller,
+ QObject *parent = nullptr);
+ QWeakPointer<QtWebEngineCore::ColorChooserController> m_controller;
+ QColor m_color;
+ bool m_accepted;
+ friend class QQuickWebEngineViewPrivate;
+ Q_DISABLE_COPY(QQuickWebEngineColorDialogRequest)
+};
+
+class Q_WEBENGINEQUICK_EXPORT QQuickWebEngineFileDialogRequest : public QObject {
+ Q_OBJECT
+public:
+
+ enum FileMode {
+ FileModeOpen,
+ FileModeOpenMultiple,
+ FileModeUploadFolder,
+ FileModeSave
+ };
+ Q_ENUM(FileMode)
+
+ Q_PROPERTY(QString defaultFileName READ defaultFileName CONSTANT FINAL)
+ Q_PROPERTY(QStringList acceptedMimeTypes READ acceptedMimeTypes CONSTANT FINAL)
+ Q_PROPERTY(FileMode mode READ mode CONSTANT FINAL)
+ Q_PROPERTY(bool accepted READ isAccepted WRITE setAccepted FINAL)
+ QML_NAMED_ELEMENT(FileDialogRequest)
+ QML_ADDED_IN_VERSION(1, 4)
+ QML_EXTRA_VERSION(2, 0)
+ QML_UNCREATABLE("")
+
+ ~QQuickWebEngineFileDialogRequest();
+
+ QStringList acceptedMimeTypes() const;
+ QString defaultFileName() const;
+ FileMode mode() const;
+ bool isAccepted() const;
+ void setAccepted(bool accepted);
+
+public slots:
+ void dialogAccept(const QStringList &files);
+ void dialogReject();
+
+private:
+ QQuickWebEngineFileDialogRequest(QSharedPointer<QtWebEngineCore::FilePickerController> controller,
+ QObject *parent = nullptr);
+ QWeakPointer<QtWebEngineCore::FilePickerController> m_controller;
+ QString m_filename;
+ QStringList m_acceptedMimeTypes;
+ FileMode m_mode;
+ bool m_accepted;
+ friend class QQuickWebEngineViewPrivate;
+ Q_DISABLE_COPY(QQuickWebEngineFileDialogRequest)
+};
+
+class Q_WEBENGINEQUICK_EXPORT QQuickWebEngineTooltipRequest : public QObject {
+ Q_OBJECT
+public:
+ enum RequestType {
+ Show,
+ Hide,
+ };
+ Q_ENUM(RequestType)
+ Q_PROPERTY(int x READ x CONSTANT FINAL)
+ Q_PROPERTY(int y READ y CONSTANT FINAL)
+ Q_PROPERTY(QString text READ text CONSTANT FINAL)
+ Q_PROPERTY(RequestType type READ type CONSTANT FINAL)
+ Q_PROPERTY(bool accepted READ isAccepted WRITE setAccepted FINAL)
+ QML_NAMED_ELEMENT(TooltipRequest)
+ QML_ADDED_IN_VERSION(1, 10)
+ QML_EXTRA_VERSION(2, 0)
+ QML_UNCREATABLE("")
+
+ ~QQuickWebEngineTooltipRequest();
+ int x() const;
+ int y() const;
+ QString text() const;
+ RequestType type() const;
+ bool isAccepted() const;
+ void setAccepted(bool accepted);
+
+private:
+ QQuickWebEngineTooltipRequest(const QString &text = QString(),
+ QObject *parent = nullptr);
+ QPoint m_position;
+ QString m_text;
+ RequestType m_type;
+ bool m_accepted;
+ friend class QQuickWebEngineViewPrivate;
+ Q_DISABLE_COPY(QQuickWebEngineTooltipRequest)
+};
+
+QT_END_NAMESPACE
+
+#endif // QQUICKWEBENGINDIALOGREQUESTS_P_H
diff --git a/src/webenginequick/api/qquickwebenginedownloadrequest.cpp b/src/webenginequick/api/qquickwebenginedownloadrequest.cpp
new file mode 100644
index 000000000..f745ba3b3
--- /dev/null
+++ b/src/webenginequick/api/qquickwebenginedownloadrequest.cpp
@@ -0,0 +1,32 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qquickwebenginedownloadrequest_p.h"
+#include "QtWebEngineCore/private/qwebenginedownloadrequest_p.h"
+
+#include "web_contents_adapter_client.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \internal
+*/
+QQuickWebEngineDownloadRequest::QQuickWebEngineDownloadRequest(QWebEngineDownloadRequestPrivate *p, QObject *parent)
+ : QWebEngineDownloadRequest(p, parent)
+{
+}
+
+/*!
+ \internal
+ Returns the WebEngineView the download was requested on. If the download was not triggered by content in a WebEngineView,
+ \c nullptr is returned.
+*/
+QQuickWebEngineView *QQuickWebEngineDownloadRequest::view() const
+{
+ Q_ASSERT(d_ptr->adapterClient->clientType() == QtWebEngineCore::WebContentsAdapterClient::QmlClient);
+ return const_cast<QQuickWebEngineView *>(static_cast<const QQuickWebEngineView *>(d_ptr->adapterClient->holdingQObject()));
+}
+
+QT_END_NAMESPACE
+
+#include "moc_qquickwebenginedownloadrequest_p.cpp"
diff --git a/src/webenginequick/api/qquickwebenginedownloadrequest_p.h b/src/webenginequick/api/qquickwebenginedownloadrequest_p.h
new file mode 100644
index 000000000..42a0d88ba
--- /dev/null
+++ b/src/webenginequick/api/qquickwebenginedownloadrequest_p.h
@@ -0,0 +1,46 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QQUICKWEBENGINEDOWNLOADREQUEST_P_H
+#define QQUICKWEBENGINEDOWNLOADREQUEST_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtWebEngineQuick/private/qtwebenginequickglobal_p.h>
+#include <QtWebEngineQuick/private/qquickwebengineview_p.h>
+#include <QtWebEngineCore/qwebenginedownloadrequest.h>
+#include <QtQml/qqmlregistration.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQuickWebEngineProfilePrivate;
+
+class Q_WEBENGINEQUICK_EXPORT QQuickWebEngineDownloadRequest : public QWebEngineDownloadRequest
+{
+ Q_OBJECT
+public:
+ Q_PROPERTY(QQuickWebEngineView *view READ view CONSTANT FINAL)
+ QML_NAMED_ELEMENT(WebEngineDownloadRequest)
+ QML_ADDED_IN_VERSION(1, 1)
+ QML_EXTRA_VERSION(2, 0)
+ QML_UNCREATABLE("")
+
+ QQuickWebEngineView *view() const;
+private:
+ Q_DISABLE_COPY(QQuickWebEngineDownloadRequest)
+ friend class QQuickWebEngineProfilePrivate;
+ QQuickWebEngineDownloadRequest(QWebEngineDownloadRequestPrivate *, QObject *parent = nullptr);
+};
+
+QT_END_NAMESPACE
+
+#endif // QQUICKWEBENGINEDOWNLOADREQUEST_P_H
diff --git a/src/webenginequick/api/qquickwebenginefaviconprovider.cpp b/src/webenginequick/api/qquickwebenginefaviconprovider.cpp
new file mode 100644
index 000000000..56bbb97ac
--- /dev/null
+++ b/src/webenginequick/api/qquickwebenginefaviconprovider.cpp
@@ -0,0 +1,257 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qquickwebenginefaviconprovider_p_p.h"
+
+#include "qquickwebengineprofile.h"
+#include "qquickwebenginesettings_p.h"
+#include "qquickwebengineview_p_p.h"
+
+#include "profile_adapter.h"
+#include "web_contents_adapter.h"
+
+#include <QtCore/qmimedatabase.h>
+#include <QtCore/qtimer.h>
+#include <QtGui/qicon.h>
+#include <QtGui/qpixmap.h>
+
+QT_BEGIN_NAMESPACE
+
+static inline unsigned area(const QSize &size)
+{
+ return size.width() * size.height();
+}
+
+static QSize largestSize(const QList<QSize> &availableSizes)
+{
+ QSize result;
+ for (const QSize &size : availableSizes) {
+ if (area(size) > area(result))
+ result = size;
+ }
+
+ return result;
+}
+
+static QSize fitSize(const QList<QSize> &availableSizes, const QSize &requestedSize)
+{
+ Q_ASSERT(availableSizes.size());
+ QSize result = largestSize(availableSizes);
+ if (availableSizes.size() == 1 || area(requestedSize) >= area(result))
+ return result;
+
+ for (const QSize &size : availableSizes) {
+ if (area(size) == area(requestedSize))
+ return size;
+
+ if (area(requestedSize) < area(size) && area(size) < area(result))
+ result = size;
+ }
+
+ return result;
+}
+
+static QPixmap extractPixmap(const QIcon &icon, const QSize &requestedSize)
+{
+ Q_ASSERT(!icon.isNull());
+
+ // If source size is not specified, use the largest icon
+ if (!requestedSize.isValid())
+ return icon.pixmap(largestSize(icon.availableSizes()), 1.0).copy();
+
+ const QSize &size = fitSize(icon.availableSizes(), requestedSize);
+ const QPixmap &iconPixmap = icon.pixmap(size, 1.0);
+ return iconPixmap.scaled(requestedSize, Qt::KeepAspectRatio, Qt::SmoothTransformation).copy();
+}
+
+static bool isIconURL(const QUrl &url)
+{
+ QMimeType mimeType = QMimeDatabase().mimeTypeForFile(url.path(), QMimeDatabase::MatchExtension);
+
+ // Check file extension.
+ if (mimeType.name().startsWith(QLatin1String("image")))
+ return true;
+
+ // Check if it is an image data: URL.
+ if (url.scheme() == QLatin1String("data") && url.path().startsWith(QLatin1String("image")))
+ return true;
+
+ return false;
+}
+
+static QQuickWebEngineView *findViewById(const QString &id, QList<QQuickWebEngineView *> *views)
+{
+ QQuickWebEngineView *result = nullptr;
+ for (QQuickWebEngineView *view : *views) {
+ if (isIconURL(QUrl(id))) {
+ if (view->icon() == QQuickWebEngineFaviconProvider::faviconProviderUrl(QUrl(id))) {
+ result = view;
+ break;
+ }
+ } else if (view->url() == QUrl(id)) {
+ result = view;
+ break;
+ }
+ }
+
+ return result;
+}
+
+FaviconImageResponseRunnable::FaviconImageResponseRunnable(const QString &id,
+ const QSize &requestedSize,
+ QList<QQuickWebEngineView *> *views)
+ : m_id(id), m_requestedSize(requestedSize), m_views(views)
+{
+}
+
+void FaviconImageResponseRunnable::run()
+{
+ if (tryNextView() == -1) {
+ // There is no non-otr view to access icon database.
+ Q_EMIT done(QPixmap());
+ }
+}
+
+void FaviconImageResponseRunnable::iconRequestDone(const QIcon &icon)
+{
+ if (icon.isNull()) {
+ if (tryNextView() == -1) {
+ // Ran out of views.
+ Q_EMIT done(QPixmap());
+ }
+ return;
+ }
+
+ Q_EMIT done(extractPixmap(icon, m_requestedSize).copy());
+}
+
+int FaviconImageResponseRunnable::tryNextView()
+{
+ for (; m_nextViewIndex < m_views->size(); ++m_nextViewIndex) {
+ QQuickWebEngineView *view = m_views->at(m_nextViewIndex);
+ if (view->profile()->isOffTheRecord())
+ continue;
+
+ requestIconOnUIThread(view);
+
+ return m_nextViewIndex++;
+ }
+
+ return -1;
+}
+
+void FaviconImageResponseRunnable::requestIconOnUIThread(QQuickWebEngineView *view)
+{
+ QTimer *timer = new QTimer();
+ timer->moveToThread(qApp->thread());
+ timer->setSingleShot(true);
+ QObject::connect(timer, &QTimer::timeout, [this, view, timer]() {
+ QtWebEngineCore::ProfileAdapter *profileAdapter = view->d_ptr->profileAdapter();
+ bool touchIconsEnabled = view->profile()->settings()->touchIconsEnabled();
+ if (isIconURL(QUrl(m_id))) {
+ profileAdapter->requestIconForIconURL(QUrl(m_id),
+ qMax(m_requestedSize.width(), m_requestedSize.height()),
+ touchIconsEnabled,
+ [this](const QIcon &icon, const QUrl &) { iconRequestDone(icon); });
+ } else {
+ profileAdapter->requestIconForPageURL(QUrl(m_id),
+ qMax(m_requestedSize.width(), m_requestedSize.height()),
+ touchIconsEnabled,
+ [this](const QIcon &icon, const QUrl &, const QUrl &) { iconRequestDone(icon); });
+ }
+ timer->deleteLater();
+ });
+ QMetaObject::invokeMethod(timer, "start", Qt::QueuedConnection, Q_ARG(int, 0));
+}
+
+FaviconImageResponse::FaviconImageResponse()
+{
+ Q_EMIT finished();
+}
+
+FaviconImageResponse::FaviconImageResponse(const QString &id, const QSize &requestedSize,
+ QList<QQuickWebEngineView *> *views, QThreadPool *pool)
+{
+ if (QQuickWebEngineView *view = findViewById(id, views)) {
+ QTimer *timer = new QTimer();
+ timer->moveToThread(qApp->thread());
+ timer->setSingleShot(true);
+ QObject::connect(timer, &QTimer::timeout, [this, id, requestedSize, views, pool, view, timer]() {
+ QIcon icon = view->d_ptr->adapter->icon();
+ if (icon.isNull())
+ startRunnable(id, requestedSize, views, pool);
+ else
+ handleDone(extractPixmap(icon, requestedSize).copy());
+ timer->deleteLater();
+ });
+ QMetaObject::invokeMethod(timer, "start", Qt::QueuedConnection, Q_ARG(int, 0));
+ } else {
+ startRunnable(id, requestedSize, views, pool);
+ }
+}
+
+FaviconImageResponse::~FaviconImageResponse() { }
+
+void FaviconImageResponse::handleDone(QPixmap pixmap)
+{
+ if (m_runnable)
+ delete m_runnable;
+ m_image = pixmap.toImage();
+ Q_EMIT finished();
+}
+
+QQuickTextureFactory *FaviconImageResponse::textureFactory() const
+{
+ return QQuickTextureFactory::textureFactoryForImage(m_image);
+}
+
+void FaviconImageResponse::startRunnable(const QString &id, const QSize &requestedSize,
+ QList<QQuickWebEngineView *> *views, QThreadPool *pool)
+{
+ m_runnable = new FaviconImageResponseRunnable(id, requestedSize, views);
+ m_runnable->setAutoDelete(false);
+ connect(m_runnable, &FaviconImageResponseRunnable::done, this,
+ &FaviconImageResponse::handleDone);
+ pool->start(m_runnable);
+}
+
+QString QQuickWebEngineFaviconProvider::identifier()
+{
+ return QStringLiteral("favicon");
+}
+
+QUrl QQuickWebEngineFaviconProvider::faviconProviderUrl(const QUrl &url)
+{
+ if (url.isEmpty())
+ return url;
+
+ QUrl providerUrl;
+ providerUrl.setScheme(QStringLiteral("image"));
+ providerUrl.setHost(identifier());
+ providerUrl.setPath(
+ QStringLiteral("/%1").arg(url.toString(QUrl::RemoveQuery | QUrl::RemoveFragment)));
+ if (url.hasQuery())
+ providerUrl.setQuery(url.query(QUrl::FullyDecoded));
+ if (url.hasFragment())
+ providerUrl.setFragment(url.fragment(QUrl::FullyDecoded));
+
+ return providerUrl;
+}
+
+QQuickWebEngineFaviconProvider::QQuickWebEngineFaviconProvider() { }
+
+QQuickWebEngineFaviconProvider::~QQuickWebEngineFaviconProvider() { }
+
+QQuickImageResponse *
+QQuickWebEngineFaviconProvider::requestImageResponse(const QString &id, const QSize &requestedSize)
+{
+ if (m_views.empty())
+ return new FaviconImageResponse;
+
+ FaviconImageResponse *response = new FaviconImageResponse(id, requestedSize, &m_views, &m_pool);
+ return response;
+}
+
+QT_END_NAMESPACE
+
+#include "moc_qquickwebenginefaviconprovider_p_p.cpp"
diff --git a/src/webenginequick/api/qquickwebenginefaviconprovider_p_p.h b/src/webenginequick/api/qquickwebenginefaviconprovider_p_p.h
new file mode 100644
index 000000000..89bfb6e73
--- /dev/null
+++ b/src/webenginequick/api/qquickwebenginefaviconprovider_p_p.h
@@ -0,0 +1,92 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QQUICKWEBENGINEFAVICONPROVIDER_P_P_H
+#define QQUICKWEBENGINEFAVICONPROVIDER_P_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtWebEngineQuick/private/qtwebenginequickglobal_p.h>
+#include <QtCore/qlist.h>
+#include <QtCore/qrunnable.h>
+#include <QtCore/qthreadpool.h>
+#include <QtGui/qimage.h>
+#include <QtQuick/qquickimageprovider.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQuickWebEngineView;
+
+class FaviconImageResponseRunnable : public QObject, public QRunnable
+{
+ Q_OBJECT
+
+public:
+ FaviconImageResponseRunnable(const QString &id, const QSize &requestedSize,
+ QList<QQuickWebEngineView *> *views);
+ void run() override;
+ void iconRequestDone(const QIcon &icon);
+
+signals:
+ void done(QPixmap pixmap);
+
+private:
+ int tryNextView();
+ void requestIconOnUIThread(QQuickWebEngineView *view);
+
+ QString m_id;
+ QSize m_requestedSize;
+ QList<QQuickWebEngineView *> *m_views;
+ int m_nextViewIndex = 0;
+};
+
+class FaviconImageResponse : public QQuickImageResponse
+{
+public:
+ FaviconImageResponse();
+ FaviconImageResponse(const QString &id, const QSize &requestedSize,
+ QList<QQuickWebEngineView *> *views, QThreadPool *pool);
+ ~FaviconImageResponse();
+ void handleDone(QPixmap pixmap);
+ QQuickTextureFactory *textureFactory() const override;
+
+private:
+ void startRunnable(const QString &id, const QSize &requestedSize,
+ QList<QQuickWebEngineView *> *views, QThreadPool *pool);
+
+ FaviconImageResponseRunnable *m_runnable = nullptr;
+ QImage m_image;
+};
+
+class Q_WEBENGINEQUICK_EXPORT QQuickWebEngineFaviconProvider : public QQuickAsyncImageProvider
+{
+public:
+ static QString identifier();
+ static QUrl faviconProviderUrl(const QUrl &);
+
+ QQuickWebEngineFaviconProvider();
+ ~QQuickWebEngineFaviconProvider();
+
+ void attach(QQuickWebEngineView *view) { m_views.append(view); }
+ void detach(QQuickWebEngineView *view) { m_views.removeAll(view); }
+
+ QQuickImageResponse *requestImageResponse(const QString &id,
+ const QSize &requestedSize) override;
+
+private:
+ QThreadPool m_pool;
+ QList<QQuickWebEngineView *> m_views;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQUICKWEBENGINEFAVICONPROVIDER_P_P_H
diff --git a/src/webenginequick/api/qquickwebengineforeigntypes_p.h b/src/webenginequick/api/qquickwebengineforeigntypes_p.h
new file mode 100644
index 000000000..2d205254e
--- /dev/null
+++ b/src/webenginequick/api/qquickwebengineforeigntypes_p.h
@@ -0,0 +1,236 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+
+#ifndef QQUICKWEBENGINEFOREIGNTYPES_H
+#define QQUICKWEBENGINEFOREIGNTYPES_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQml/qqml.h>
+#include <QtWebEngineCore/qwebenginedownloadrequest.h>
+#include <QtWebEngineCore/qwebenginenavigationrequest.h>
+#include <QtWebEngineCore/qwebenginescript.h>
+#include <QtWebEngineCore/qwebenginenewwindowrequest.h>
+#include <QtWebEngineCore/qwebengineloadinginfo.h>
+#include <QtWebEngineCore/qwebenginehistory.h>
+#include <QtWebEngineCore/qwebenginequotarequest.h>
+#include <QtWebEngineCore/qwebenginenotification.h>
+#include <QtWebEngineCore/qwebenginefindtextresult.h>
+#include <QtWebEngineCore/qwebenginecertificateerror.h>
+#include <QtWebEngineCore/qwebenginefullscreenrequest.h>
+#include <QtWebEngineCore/qwebenginecontextmenurequest.h>
+#include <QtWebEngineCore/qwebengineregisterprotocolhandlerrequest.h>
+#include <QtWebEngineCore/qwebenginefilesystemaccessrequest.h>
+#include <QtWebEngineCore/qwebenginewebauthuxrequest.h>
+
+QT_BEGIN_NAMESPACE
+
+// To prevent the same type from being exported twice into qmltypes
+// (for value type and for the enums)
+struct QWebEngineLoadingInfoDerived : public QWebEngineLoadingInfo
+{
+ Q_GADGET
+};
+
+namespace ForeignWebEngineLoadingInfoNamespace
+{
+ Q_NAMESPACE
+ QML_FOREIGN_NAMESPACE(QWebEngineLoadingInfoDerived)
+ QML_NAMED_ELEMENT(WebEngineLoadingInfo)
+ QML_ADDED_IN_VERSION(1, 1)
+ QML_EXTRA_VERSION(2, 0)
+}
+
+struct ForeignWebEngineLoadingInfo
+{
+ Q_GADGET
+ QML_FOREIGN(QWebEngineLoadingInfo)
+ QML_NAMED_ELEMENT(webEngineLoadingInfo)
+ QML_ADDED_IN_VERSION(1, 1)
+ QML_EXTRA_VERSION(2, 0)
+ QML_UNCREATABLE("")
+};
+
+// To prevent the same type from being exported twice into qmltypes
+// (for value type and for the enums)
+struct QWebEngineCertificateErrorDerived : public QWebEngineCertificateError
+{
+ Q_GADGET
+};
+
+namespace ForeignWebEngineCertificateErrorNamespace
+{
+ Q_NAMESPACE
+ QML_FOREIGN_NAMESPACE(QWebEngineCertificateErrorDerived)
+ QML_NAMED_ELEMENT(WebEngineCertificateError)
+ QML_ADDED_IN_VERSION(1, 1)
+ QML_EXTRA_VERSION(2, 0)
+}
+
+struct ForeignWebEngineCertificateError
+{
+ Q_GADGET
+ QML_FOREIGN(QWebEngineCertificateError)
+ QML_NAMED_ELEMENT(webEngineCertificateError)
+ QML_ADDED_IN_VERSION(1, 1)
+ QML_EXTRA_VERSION(2, 0)
+ QML_UNCREATABLE("")
+};
+
+struct ForeignWebEngineNavigationRequest
+{
+ Q_GADGET
+ QML_FOREIGN(QWebEngineNavigationRequest)
+ QML_NAMED_ELEMENT(WebEngineNavigationRequest)
+ QML_ADDED_IN_VERSION(1, 0)
+ QML_EXTRA_VERSION(2, 0)
+ QML_UNCREATABLE("")
+};
+
+namespace ForeignWebEngineScriptNamespace
+{
+ Q_NAMESPACE
+ QML_FOREIGN_NAMESPACE(QWebEngineScript)
+ QML_NAMED_ELEMENT(WebEngineScript)
+ QML_ADDED_IN_VERSION(1, 1)
+ QML_EXTRA_VERSION(2, 0)
+}
+
+struct ForeignWebEngineScript
+{
+ Q_GADGET
+ QML_FOREIGN(QWebEngineScript)
+ QML_NAMED_ELEMENT(webEngineScript)
+ QML_ADDED_IN_VERSION(1, 1)
+ QML_EXTRA_VERSION(2, 0)
+ QML_UNCREATABLE("")
+};
+
+struct ForeignWebEngineHistory
+{
+ Q_GADGET
+ QML_FOREIGN(QWebEngineHistory)
+ QML_NAMED_ELEMENT(WebEngineHistory)
+ QML_ADDED_IN_VERSION(1, 1)
+ QML_EXTRA_VERSION(2, 0)
+ QML_UNCREATABLE("")
+};
+
+struct ForeignWebEngineHistoryModel
+{
+ Q_GADGET
+ QML_FOREIGN(QWebEngineHistoryModel)
+ QML_NAMED_ELEMENT(WebEngineHistoryModel)
+ QML_ADDED_IN_VERSION(1, 1)
+ QML_EXTRA_VERSION(2, 0)
+ QML_UNCREATABLE("")
+};
+
+struct ForeignWebEngineFullScreenRequest
+{
+ Q_GADGET
+ QML_FOREIGN(QWebEngineFullScreenRequest)
+ QML_NAMED_ELEMENT(fullScreenRequest)
+ QML_ADDED_IN_VERSION(1, 1)
+ QML_EXTRA_VERSION(2, 0)
+ QML_UNCREATABLE("")
+};
+
+struct ForeignWebEngineContextMenuRequest
+{
+ Q_GADGET
+ QML_FOREIGN(QWebEngineContextMenuRequest)
+ QML_NAMED_ELEMENT(ContextMenuRequest)
+ QML_ADDED_IN_VERSION(1, 7)
+ QML_EXTRA_VERSION(2, 0)
+ QML_UNCREATABLE("")
+};
+
+#if QT_DEPRECATED_SINCE(6, 5)
+struct ForeignWebEngineQuotaRequest
+{
+ Q_GADGET
+ QML_FOREIGN(QWebEngineQuotaRequest)
+ QML_NAMED_ELEMENT(webEngineQuotaRequest)
+ QML_ADDED_IN_VERSION(1, 7)
+ QML_EXTRA_VERSION(2, 0)
+ QML_UNCREATABLE("")
+};
+#endif
+
+struct ForeignWebEngineRegisterProtocolHandlerRequest
+{
+ Q_GADGET
+ QML_FOREIGN(QWebEngineRegisterProtocolHandlerRequest)
+ QML_NAMED_ELEMENT(registerProtocolHandlerRequest)
+ QML_ADDED_IN_VERSION(1, 7)
+ QML_EXTRA_VERSION(2, 0)
+ QML_UNCREATABLE("")
+};
+
+struct ForeignWebEngineNotification
+{
+ Q_GADGET
+ QML_FOREIGN(QWebEngineNotification)
+ QML_NAMED_ELEMENT(WebEngineNotification)
+ QML_ADDED_IN_VERSION(1, 9)
+ QML_EXTRA_VERSION(2, 0)
+ QML_UNCREATABLE("")
+};
+
+struct ForeignWebEngineFindTextResult
+{
+ Q_GADGET
+ QML_FOREIGN(QWebEngineFindTextResult)
+ QML_NAMED_ELEMENT(findTextResult)
+ QML_ADDED_IN_VERSION(1, 10)
+ QML_EXTRA_VERSION(2, 0)
+ QML_UNCREATABLE("")
+};
+
+struct ForeginWebEngineFileSystemAccessRequest
+{
+ Q_GADGET
+ QML_FOREIGN(QWebEngineFileSystemAccessRequest)
+ QML_NAMED_ELEMENT(webEngineFileSystemAccessRequest)
+ QML_ADDED_IN_VERSION(6, 4)
+ QML_UNCREATABLE("")
+};
+
+// To prevent the same type from being exported twice into qmltypes
+// (for value type and for the enums)
+struct QWebEngineFileSystemAccessRequestDerived : public QWebEngineFileSystemAccessRequest
+{
+ Q_GADGET
+};
+
+namespace ForeginWebEngineFileSystemAccessRequestNamespace
+{
+ Q_NAMESPACE
+ QML_FOREIGN_NAMESPACE(QWebEngineFileSystemAccessRequestDerived)
+ QML_NAMED_ELEMENT(WebEngineFileSystemAccessRequest)
+ QML_ADDED_IN_VERSION(6, 4)
+};
+
+struct ForeignWebEngineWebAuthUxRequest
+{
+ Q_GADGET
+ QML_FOREIGN(QWebEngineWebAuthUxRequest)
+ QML_NAMED_ELEMENT(WebEngineWebAuthUxRequest)
+ QML_ADDED_IN_VERSION(6, 7)
+ QML_UNCREATABLE("")
+};
+
+QT_END_NAMESPACE
+
+#endif // QQUICKWEBENGINEFOREIGNTYPES_H
diff --git a/src/webenginequick/api/qquickwebenginenewwindowrequest.cpp b/src/webenginequick/api/qquickwebenginenewwindowrequest.cpp
new file mode 100644
index 000000000..ecacb1e8f
--- /dev/null
+++ b/src/webenginequick/api/qquickwebenginenewwindowrequest.cpp
@@ -0,0 +1,43 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qquickwebenginenewwindowrequest_p.h"
+#include "qquickwebengineview_p.h"
+
+#include "web_contents_adapter_client.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \internal
+*/
+QQuickWebEngineNewWindowRequest::QQuickWebEngineNewWindowRequest(DestinationType dest, const QRect &rect, const QUrl &url,
+ bool user,
+ QSharedPointer<QtWebEngineCore::WebContentsAdapter> adapter,
+ QObject *parent)
+ : QWebEngineNewWindowRequest(dest, rect, url, user, adapter, parent)
+{
+}
+
+/*!
+ \qmlmethod WebEngineNewWindowRequest::openIn(WebEngineView view)
+ Opens the requested page in the new web engine view \a view. State and history of the
+ view and the page possibly loaded in it will be lost.
+ \sa WebEngineView::newWindowRequested
+*/
+
+/*!
+ \internal
+*/
+void QQuickWebEngineNewWindowRequest::openIn(QQuickWebEngineView *view)
+{
+ if (!view) {
+ qWarning("Trying to open a WebEngineNewWindowRequest in an invalid WebEngineView.");
+ return;
+ }
+ view->acceptAsNewWindow(this);
+}
+
+QT_END_NAMESPACE
+
+#include "moc_qquickwebenginenewwindowrequest_p.cpp"
diff --git a/src/webenginequick/api/qquickwebenginenewwindowrequest_p.h b/src/webenginequick/api/qquickwebenginenewwindowrequest_p.h
new file mode 100644
index 000000000..f170fa0c6
--- /dev/null
+++ b/src/webenginequick/api/qquickwebenginenewwindowrequest_p.h
@@ -0,0 +1,48 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QQUICKWEBENGINENEWVIEWREQUEST_P_H
+#define QQUICKWEBENGINENEWVIEWREQUEST_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtWebEngineQuick/private/qtwebenginequickglobal_p.h>
+#include <QtWebEngineCore/qwebenginenewwindowrequest.h>
+#include <QtQml/qqmlregistration.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQuickWebEngineView;
+
+class Q_WEBENGINEQUICK_EXPORT QQuickWebEngineNewWindowRequest : public QWebEngineNewWindowRequest
+{
+ Q_OBJECT
+public:
+ QML_NAMED_ELEMENT(WebEngineNewWindowRequest)
+ QML_ADDED_IN_VERSION(1, 1)
+ QML_EXTRA_VERSION(2, 0)
+ QML_UNCREATABLE("")
+
+ Q_INVOKABLE void openIn(QQuickWebEngineView *);
+
+private:
+ QQuickWebEngineNewWindowRequest(DestinationType, const QRect &, const QUrl &, bool,
+ QSharedPointer<QtWebEngineCore::WebContentsAdapter>,
+ QObject * = nullptr);
+
+ friend class QQuickWebEngineView;
+ friend class QQuickWebEngineViewPrivate;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQUICKWEBENGINENEWVIEWREQUEST_P_H
diff --git a/src/webenginequick/api/qquickwebengineprofile.cpp b/src/webenginequick/api/qquickwebengineprofile.cpp
new file mode 100644
index 000000000..7c3d11fcf
--- /dev/null
+++ b/src/webenginequick/api/qquickwebengineprofile.cpp
@@ -0,0 +1,1049 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qquickwebengineprofile.h"
+#include "qquickwebengineprofile_p.h"
+#include "qquickwebenginedownloadrequest_p.h"
+#include "qquickwebenginesettings_p.h"
+#include "qquickwebenginescriptcollection_p.h"
+#include "qquickwebenginescriptcollection_p_p.h"
+#include "qquickwebengineview_p_p.h"
+
+#include "profile_adapter.h"
+#include "web_engine_settings.h"
+
+#include <QtWebEngineCore/qwebenginescriptcollection.h>
+#include <QtWebEngineCore/private/qwebenginescriptcollection_p.h>
+#include <QtWebEngineCore/qwebengineclienthints.h>
+#include <QtWebEngineCore/qwebenginecookiestore.h>
+#include <QtWebEngineCore/qwebenginenotification.h>
+#include <QtWebEngineCore/private/qwebenginedownloadrequest_p.h>
+#include <QtWebEngineCore/qwebengineurlscheme.h>
+
+#include <QtCore/qdir.h>
+#include <QtCore/qfileinfo.h>
+#include <QtQml/qqmlcontext.h>
+#include <QtQml/qqmlengine.h>
+
+using QtWebEngineCore::ProfileAdapter;
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QQuickWebEngineProfile
+ \brief The QQuickWebEngineProfile class provides a web engine profile shared by multiple pages.
+ \since 5.6
+
+ \inmodule QtWebEngineQuick
+
+ A web engine profile contains settings, scripts, persistent cookie policy, and the list of
+ visited links shared by all web engine pages that belong to the profile.
+
+ Information about visited links is stored together with persistent cookies
+ and other persistent data in a storage determined by the storageName
+ property. Persistent data is stored in a subdirectory determined by the
+ persistentStoragePath property and the cache in a subdirectory determined by
+ the cachePath property. The httpCacheType property describes the type of the
+ cache: \e in-memory or \e on-disk. If only the storageName property is set,
+ the other values are generated automatically based on it. If you specify
+ any of the values manually, you should do it before creating any pages that
+ belong to the profile.
+
+ Profiles can be used to isolate pages from each other. A typical use case is a dedicated
+ \e {off-the-record profile} for a \e {private browsing} mode. An off-the-record profile forces
+ cookies, the HTTP cache, and other normally persistent data to be stored only in memory. The
+ offTheRecord property holds whether a profile is off-the-record.
+
+ The default profile can be accessed by defaultProfile(). It is a built-in profile that all
+ web pages not specifically created with another profile belong to.
+
+ A WebEngineProfile instance can be created and accessed from C++ through the
+ QQuickWebEngineProfile class, which exposes further functionality in C++. This allows Qt Quick
+ applications to intercept URL requests (QQuickWebEngineProfile::setRequestInterceptor), or
+ register custom URL schemes (QQuickWebEngineProfile::installUrlSchemeHandler).
+
+ Spellchecking HTML form fields can be enabled per profile by setting the \l spellCheckEnabled
+ property and the current languages used for spellchecking can be set by using the
+ \l spellCheckLanguages property.
+*/
+
+/*!
+ \enum QQuickWebEngineProfile::HttpCacheType
+
+ This enum describes the HTTP cache type:
+
+ \value MemoryHttpCache Use an in-memory cache. This is the default if
+ \c off-the-record is set.
+ \value DiskHttpCache Use a disk cache. This is the default if \c off-the-record
+ is not set. Falls back to \c MemoryHttpCache if \c off-the-record is set.
+ \value NoCache Disable both in-memory and disk caching. (Added in Qt 5.7)
+*/
+
+/*!
+ \enum QQuickWebEngineProfile::PersistentCookiesPolicy
+
+ This enum describes policy for cookie persistency:
+
+ \value NoPersistentCookies
+ Both session and persistent cookies are stored in memory. This is the only setting
+ possible if \c off-the-record is set or no persistent data path is available.
+ \value AllowPersistentCookies
+ Cookies marked persistent are saved to and restored from disk, whereas session cookies
+ are only stored to disk for crash recovery. This is the default setting.
+ \value ForcePersistentCookies
+ Both session and persistent cookies are saved to and restored from disk.
+*/
+
+/*!
+ \fn QQuickWebEngineProfile::downloadRequested(QQuickWebEngineDownloadRequest *download)
+
+ This signal is emitted whenever a download has been triggered.
+ The \a download argument holds the state of the download.
+ The download has to be explicitly accepted with
+ \c{QWebEngineDownloadRequest::accept()} or it will be
+ cancelled by default.
+ The download item is parented by the profile. If it is not accepted, it
+ will be deleted immediately after the signal emission.
+ This signal cannot be used with a queued connection.
+*/
+
+/*!
+ \fn QQuickWebEngineProfile::downloadFinished(QQuickWebEngineDownloadRequest *download)
+
+ This signal is emitted whenever downloading stops, because it finished successfully, was
+ cancelled, or was interrupted (for example, because connectivity was lost).
+ The \a download argument holds the state of the finished download instance.
+*/
+
+/*!
+ \fn QQuickWebEngineProfile::presentNotification(QWebEngineNotification *notification)
+
+ This signal is emitted whenever there is a newly created user notification.
+ The \a notification argument holds the \l {QWebEngineNotification} instance
+ to query data and interact with.
+
+ \sa WebEngineProfile::presentNotification
+*/
+
+/*!
+ \fn QQuickWebEngineProfile::clearHttpCacheCompleted()
+ \since 6.7
+
+ This signal is emitted when the clearHttpCache() operation is completed.
+
+ \sa clearHttpCache()
+*/
+
+QQuickWebEngineProfilePrivate::QQuickWebEngineProfilePrivate(ProfileAdapter *profileAdapter)
+ : m_settings(new QQuickWebEngineSettings())
+ , m_clientHints(new QWebEngineClientHints(profileAdapter))
+ , m_profileAdapter(profileAdapter)
+{
+ profileAdapter->addClient(this);
+ // Fullscreen API was implemented before the supported setting, so we must
+ // make it default true to avoid change in default API behavior.
+ m_settings->d_ptr->setAttribute(QWebEngineSettings::FullScreenSupportEnabled, true);
+}
+
+QQuickWebEngineProfilePrivate::~QQuickWebEngineProfilePrivate()
+{
+ if (m_profileAdapter) {
+ // In the case the user sets this profile as the parent of the interceptor
+ // it can be deleted before the browser-context still referencing it is.
+ m_profileAdapter->setRequestInterceptor(nullptr);
+ m_profileAdapter->removeClient(this);
+ }
+
+ if (m_profileAdapter != QtWebEngineCore::ProfileAdapter::defaultProfileAdapter())
+ delete m_profileAdapter;
+ else if (m_profileAdapter)
+ m_profileAdapter->releaseAllWebContentsAdapterClients();
+}
+
+void QQuickWebEngineProfilePrivate::addWebContentsAdapterClient(QtWebEngineCore::WebContentsAdapterClient *adapter)
+{
+ Q_ASSERT(m_profileAdapter);
+ m_profileAdapter->addWebContentsAdapterClient(adapter);
+}
+
+void QQuickWebEngineProfilePrivate::removeWebContentsAdapterClient(QtWebEngineCore::WebContentsAdapterClient*adapter)
+{
+ Q_ASSERT(m_profileAdapter);
+ m_profileAdapter->removeWebContentsAdapterClient(adapter);
+}
+
+QtWebEngineCore::ProfileAdapter *QQuickWebEngineProfilePrivate::profileAdapter() const
+{
+ return m_profileAdapter;
+}
+
+QQuickWebEngineSettings *QQuickWebEngineProfilePrivate::settings() const
+{
+ return m_settings.data();
+}
+
+QtWebEngineCore::WebEngineSettings *QQuickWebEngineProfilePrivate::coreSettings() const
+{
+ return QtWebEngineCore::WebEngineSettings::get(m_settings->d_ptr.data());
+}
+
+void QQuickWebEngineProfilePrivate::cancelDownload(quint32 downloadId)
+{
+ if (m_profileAdapter)
+ m_profileAdapter->cancelDownload(downloadId);
+}
+
+void QQuickWebEngineProfilePrivate::downloadDestroyed(quint32 downloadId)
+{
+ m_ongoingDownloads.remove(downloadId);
+ if (m_profileAdapter)
+ m_profileAdapter->removeDownload(downloadId);
+}
+
+void QQuickWebEngineProfilePrivate::cleanDownloads()
+{
+ for (auto download : m_ongoingDownloads.values()) {
+ if (!download)
+ continue;
+
+ if (!download->isFinished())
+ download->cancel();
+
+ if (m_profileAdapter)
+ m_profileAdapter->removeDownload(download->id());
+ }
+ m_ongoingDownloads.clear();
+}
+
+void QQuickWebEngineProfilePrivate::downloadRequested(DownloadItemInfo &info)
+{
+ Q_Q(QQuickWebEngineProfile);
+
+ Q_ASSERT(!m_ongoingDownloads.contains(info.id));
+ QWebEngineDownloadRequestPrivate *itemPrivate =
+ new QWebEngineDownloadRequestPrivate(m_profileAdapter);
+ itemPrivate->downloadId = info.id;
+ itemPrivate->downloadState = info.accepted ? QWebEngineDownloadRequest::DownloadInProgress
+ : QWebEngineDownloadRequest::DownloadRequested;
+ itemPrivate->startTime = info.startTime;
+ itemPrivate->downloadUrl = info.url;
+ itemPrivate->totalBytes = info.totalBytes;
+ itemPrivate->mimeType = info.mimeType;
+ itemPrivate->downloadDirectory = QFileInfo(info.path).path();
+ itemPrivate->downloadFileName = QFileInfo(info.path).fileName();
+ itemPrivate->suggestedFileName = info.suggestedFileName;
+ itemPrivate->savePageFormat = static_cast<QWebEngineDownloadRequest::SavePageFormat>(
+ info.savePageFormat);
+ itemPrivate->isSavePageDownload = info.isSavePageDownload;
+ if (info.page && info.page->clientType() == QtWebEngineCore::WebContentsAdapterClient::QmlClient)
+ itemPrivate->adapterClient = info.page;
+ else
+ itemPrivate->adapterClient = nullptr;
+
+ QQuickWebEngineDownloadRequest *download = new QQuickWebEngineDownloadRequest(itemPrivate, q);
+
+ m_ongoingDownloads.insert(info.id, download);
+ QObject::connect(download, &QObject::destroyed, q, [id = info.id, this] () { downloadDestroyed(id); });
+
+ QQmlEngine::setObjectOwnership(download, QQmlEngine::JavaScriptOwnership);
+ Q_EMIT q->downloadRequested(download);
+
+ QWebEngineDownloadRequest::DownloadState state = download->state();
+ info.path = QDir(download->downloadDirectory()).filePath(download->downloadFileName());
+ info.savePageFormat = itemPrivate->savePageFormat;
+ info.accepted = state != QWebEngineDownloadRequest::DownloadCancelled
+ && state != QWebEngineDownloadRequest::DownloadRequested;
+
+ if (state == QWebEngineDownloadRequest::DownloadRequested) {
+ // Delete unaccepted downloads.
+ info.accepted = false;
+ delete download;
+ }
+}
+
+void QQuickWebEngineProfilePrivate::downloadUpdated(const DownloadItemInfo &info)
+{
+ if (!m_ongoingDownloads.contains(info.id))
+ return;
+
+ Q_Q(QQuickWebEngineProfile);
+
+ QQuickWebEngineDownloadRequest* download = m_ongoingDownloads.value(info.id).data();
+
+ if (!download) {
+ downloadDestroyed(info.id);
+ return;
+ }
+
+ download->d_ptr->update(info);
+
+ if (info.state != ProfileAdapterClient::DownloadInProgress) {
+ Q_EMIT q->downloadFinished(download);
+ }
+}
+
+void QQuickWebEngineProfilePrivate::showNotification(QSharedPointer<QtWebEngineCore::UserNotificationController> &controller)
+{
+ Q_Q(QQuickWebEngineProfile);
+ auto notification = new QWebEngineNotification(controller);
+ QQmlEngine::setObjectOwnership(notification, QQmlEngine::JavaScriptOwnership);
+ Q_EMIT q->presentNotification(notification);
+}
+
+void QQuickWebEngineProfilePrivate::clearHttpCacheCompleted()
+{
+ Q_Q(QQuickWebEngineProfile);
+ Q_EMIT q->clearHttpCacheCompleted();
+}
+
+QQuickWebEngineScriptCollection *QQuickWebEngineProfilePrivate::getUserScripts()
+{
+ Q_Q(QQuickWebEngineProfile);
+ if (!m_scriptCollection)
+ m_scriptCollection.reset(
+ new QQuickWebEngineScriptCollection(
+ new QQuickWebEngineScriptCollectionPrivate(
+ new QWebEngineScriptCollectionPrivate(
+ m_profileAdapter->userResourceController()))));
+
+ if (!m_scriptCollection->qmlEngine())
+ m_scriptCollection->setQmlEngine(qmlEngine(q));
+
+ return m_scriptCollection.data();
+}
+/*!
+ \qmltype WebEngineProfile
+ \instantiates QQuickWebEngineProfile
+ \inqmlmodule QtWebEngine
+ \since QtWebEngine 1.1
+ \brief Contains settings, scripts, and visited links common to multiple web engine views.
+
+ WebEngineProfile contains settings, scripts, and the list of visited links shared by all
+ views that belong to the profile.
+
+ Information about visited links is stored together with persistent cookies
+ and other persistent data in a storage determined by the storageName
+ property. Persistent data is stored in a subdirectory determined by the
+ persistentStoragePath property and the cache in a subdirectory determined by
+ the cachePath property. The httpCacheType property describes the type of the
+ cache: \e in-memory or \e on-disk. If only the storageName property is set,
+ the other values are generated automatically based on it. If you specify
+ any of the values manually, you should do it before creating any pages that
+ belong to the profile.
+
+ Profiles can be used to isolate pages from each other. A typical use case is
+ a dedicated \e {off-the-record profile} for a \e {private browsing} mode. An
+ off-the-record profile forces cookies, the HTTP cache, and other normally
+ persistent data to be stored only in memory. The offTheRecord property holds
+ whether a profile is off-the-record.
+
+ Each web engine view has an associated profile. Views that do not have a specific profile set
+ share a common default one.
+*/
+
+/*!
+ \qmlsignal WebEngineProfile::downloadRequested(WebEngineDownloadRequest download)
+
+ This signal is emitted whenever a download has been triggered.
+ The \a download argument holds the state of the download.
+ The download has to be explicitly accepted with WebEngineDownloadRequest::accept() or the
+ download will be cancelled by default.
+*/
+
+/*!
+ \qmlsignal WebEngineProfile::downloadFinished(WebEngineDownloadRequest download)
+
+ This signal is emitted whenever downloading stops, because it finished successfully, was
+ cancelled, or was interrupted (for example, because connectivity was lost).
+ The \a download argument holds the state of the finished download instance.
+*/
+
+/*!
+ \qmlsignal WebEngineProfile::presentNotification(WebEngineNotification notification)
+ \since QtWebEngine 1.9
+
+ This signal is emitted whenever there is a newly created user notification.
+ The \a notification argument holds the \l {WebEngineNotification} instance
+ to query data and interact with.
+*/
+
+/*!
+ \qmlsignal WebEngineProfile::clearHttpCacheCompleted()
+ \since QtWebEngine 6.7
+
+ This signal is emitted when the clearHttpCache() operation is completed.
+
+ \sa clearHttpCache()
+*/
+
+/*!
+ Constructs a new profile with the parent \a parent.
+*/
+QQuickWebEngineProfile::QQuickWebEngineProfile(QObject *parent)
+ : QObject(parent),
+ d_ptr(new QQuickWebEngineProfilePrivate(new QtWebEngineCore::ProfileAdapter()))
+{
+ d_ptr->q_ptr = this;
+}
+
+QQuickWebEngineProfile::QQuickWebEngineProfile(QQuickWebEngineProfilePrivate *privatePtr, QObject *parent)
+ : QObject(parent)
+ , d_ptr(privatePtr)
+{
+ d_ptr->q_ptr = this;
+}
+
+/*!
+ \internal
+*/
+QQuickWebEngineProfile::~QQuickWebEngineProfile()
+{
+ d_ptr->cleanDownloads();
+}
+
+/*!
+ \qmlproperty string WebEngineProfile::storageName
+
+ The storage name that is used to create separate subdirectories for each profile that uses
+ the disk for storing persistent data and cache.
+
+ \sa WebEngineProfile::persistentStoragePath, WebEngineProfile::cachePath
+*/
+
+/*!
+ \property QQuickWebEngineProfile::storageName
+
+ The storage name that is used to create separate subdirectories for each profile that uses
+ the disk for storing persistent data and cache.
+
+ \sa persistentStoragePath, cachePath
+*/
+
+QString QQuickWebEngineProfile::storageName() const
+{
+ const Q_D(QQuickWebEngineProfile);
+ return d->profileAdapter()->storageName();
+}
+
+void QQuickWebEngineProfile::setStorageName(const QString &name)
+{
+ Q_D(QQuickWebEngineProfile);
+ if (d->profileAdapter()->storageName() == name)
+ return;
+ ProfileAdapter::HttpCacheType oldCacheType = d->profileAdapter()->httpCacheType();
+ ProfileAdapter::PersistentCookiesPolicy oldPolicy = d->profileAdapter()->persistentCookiesPolicy();
+ d->profileAdapter()->setStorageName(name);
+ emit storageNameChanged();
+ emit persistentStoragePathChanged();
+ emit cachePathChanged();
+ if (d->profileAdapter()->httpCacheType() != oldCacheType)
+ emit httpCacheTypeChanged();
+ if (d->profileAdapter()->persistentCookiesPolicy() != oldPolicy)
+ emit persistentCookiesPolicyChanged();
+}
+
+/*!
+ \qmlproperty bool WebEngineProfile::offTheRecord
+
+ Whether the web engine profile is \e off-the-record.
+ An off-the-record profile forces cookies, the HTTP cache, and other normally persistent data
+ to be stored only in memory. Profile is off-the-record by default.
+*/
+
+
+/*!
+ \property QQuickWebEngineProfile::offTheRecord
+
+ Whether the web engine profile is \e off-the-record.
+ An off-the-record profile forces cookies, the HTTP cache, and other normally persistent data
+ to be stored only in memory. Profile is off-the-record by default.
+*/
+
+bool QQuickWebEngineProfile::isOffTheRecord() const
+{
+ const Q_D(QQuickWebEngineProfile);
+ return d->profileAdapter()->isOffTheRecord();
+}
+
+void QQuickWebEngineProfile::setOffTheRecord(bool offTheRecord)
+{
+ Q_D(QQuickWebEngineProfile);
+ if (d->profileAdapter()->isOffTheRecord() == offTheRecord)
+ return;
+ ProfileAdapter::HttpCacheType oldCacheType = d->profileAdapter()->httpCacheType();
+ ProfileAdapter::PersistentCookiesPolicy oldPolicy = d->profileAdapter()->persistentCookiesPolicy();
+ d->profileAdapter()->setOffTheRecord(offTheRecord);
+ emit offTheRecordChanged();
+ if (d->profileAdapter()->httpCacheType() != oldCacheType)
+ emit httpCacheTypeChanged();
+ if (d->profileAdapter()->persistentCookiesPolicy() != oldPolicy)
+ emit persistentCookiesPolicyChanged();
+}
+
+/*!
+ \qmlproperty string WebEngineProfile::persistentStoragePath
+
+ The path to the location where the persistent data for the browser and web content are
+ stored. Persistent data includes persistent cookies, HTML5 local storage, and visited links.
+
+ By default, the storage is located below
+ QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) in a directory named using
+ storageName.
+*/
+
+/*!
+ \property QQuickWebEngineProfile::persistentStoragePath
+
+ The path to the location where the persistent data for the browser and web content are
+ stored. Persistent data includes persistent cookies, HTML5 local storage, and visited links.
+
+ By default, the storage is located below
+ QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) in a directory named using
+ storageName.
+*/
+
+QString QQuickWebEngineProfile::persistentStoragePath() const
+{
+ const Q_D(QQuickWebEngineProfile);
+ return d->profileAdapter()->dataPath();
+}
+
+void QQuickWebEngineProfile::setPersistentStoragePath(const QString &path)
+{
+ Q_D(QQuickWebEngineProfile);
+ if (persistentStoragePath() == path)
+ return;
+ d->profileAdapter()->setDataPath(path);
+ emit persistentStoragePathChanged();
+}
+
+/*!
+ \qmlproperty string WebEngineProfile::cachePath
+
+ The path to the location where the profile's caches are stored, in particular the HTTP cache.
+
+ By default, the caches are stored
+ below QStandardPaths::writableLocation(QStandardPaths::CacheLocation) in a directory named using
+ storageName.
+*/
+
+/*!
+ \property QQuickWebEngineProfile::cachePath
+
+ The path to the location where the profile's caches are stored, in particular the HTTP cache.
+
+ By default, the caches are stored
+ below QStandardPaths::writableLocation(QStandardPaths::CacheLocation) in a directory named using
+ storageName.
+*/
+
+QString QQuickWebEngineProfile::cachePath() const
+{
+ const Q_D(QQuickWebEngineProfile);
+ return d->profileAdapter()->cachePath();
+}
+
+void QQuickWebEngineProfile::setCachePath(const QString &path)
+{
+ Q_D(QQuickWebEngineProfile);
+ if (cachePath() == path)
+ return;
+ d->profileAdapter()->setCachePath(path);
+ emit cachePathChanged();
+}
+
+/*!
+ \qmlproperty string WebEngineProfile::httpUserAgent
+
+ The user-agent string sent with HTTP to identify the browser.
+
+ \note On Windows 8.1 and newer, the default user agent will always report
+ "Windows NT 6.2" (Windows 8), unless the application does contain a manifest
+ that declares newer Windows versions as supported.
+*/
+
+/*!
+ \property QQuickWebEngineProfile::httpUserAgent
+
+ The user-agent string sent with HTTP to identify the browser.
+*/
+
+QString QQuickWebEngineProfile::httpUserAgent() const
+{
+ const Q_D(QQuickWebEngineProfile);
+ return d->profileAdapter()->httpUserAgent();
+}
+
+void QQuickWebEngineProfile::setHttpUserAgent(const QString &userAgent)
+{
+ Q_D(QQuickWebEngineProfile);
+ if (d->profileAdapter()->httpUserAgent() == userAgent)
+ return;
+ d->profileAdapter()->setHttpUserAgent(userAgent);
+ emit httpUserAgentChanged();
+}
+
+
+/*!
+ \qmlproperty enumeration WebEngineProfile::httpCacheType
+
+ This enumeration describes the type of the HTTP cache:
+
+ \value WebEngineProfile.MemoryHttpCache
+ Uses an in-memory cache. This is the only setting possible if offTheRecord is set or
+ no storageName is available, which is the default.
+ \value WebEngineProfile.DiskHttpCache
+ Uses a disk cache. This is the default value for non off-the-record profile with storageName.
+ \value WebEngineProfile.NoCache
+ Disables caching. (Added in 5.7)
+*/
+
+/*!
+ \property QQuickWebEngineProfile::httpCacheType
+
+ This enumeration describes the type of the HTTP cache.
+
+ If the profile is off-the-record or has no storageName set, MemoryHttpCache is returned.
+*/
+
+QQuickWebEngineProfile::HttpCacheType QQuickWebEngineProfile::httpCacheType() const
+{
+ const Q_D(QQuickWebEngineProfile);
+ return QQuickWebEngineProfile::HttpCacheType(d->profileAdapter()->httpCacheType());
+}
+
+void QQuickWebEngineProfile::setHttpCacheType(QQuickWebEngineProfile::HttpCacheType httpCacheType)
+{
+ Q_D(QQuickWebEngineProfile);
+ ProfileAdapter::HttpCacheType oldCacheType = d->profileAdapter()->httpCacheType();
+ d->profileAdapter()->setHttpCacheType(ProfileAdapter::HttpCacheType(httpCacheType));
+ if (d->profileAdapter()->httpCacheType() != oldCacheType)
+ emit httpCacheTypeChanged();
+}
+
+/*!
+ \qmlproperty enumeration WebEngineProfile::persistentCookiesPolicy
+
+ This enumeration describes the policy of cookie persistency:
+
+ \value WebEngineProfile.NoPersistentCookies
+ Both session and persistent cookies are stored in memory. This is the only setting
+ possible if offTheRecord is set or no storageName is available, which is the default.
+ \value WebEngineProfile.AllowPersistentCookies
+ Cookies marked persistent are saved to and restored from disk, whereas session cookies
+ are only stored to disk for crash recovery.
+ This is the default value for non off-the-record profile with storageName.
+ \value WebEngineProfile.ForcePersistentCookies
+ Both session and persistent cookies are saved to and restored from disk.
+*/
+
+/*!
+ \property QQuickWebEngineProfile::persistentCookiesPolicy
+
+ This enumeration describes the policy of cookie persistency.
+ If the profile is off-the-record, NoPersistentCookies is returned.
+*/
+
+QQuickWebEngineProfile::PersistentCookiesPolicy QQuickWebEngineProfile::persistentCookiesPolicy() const
+{
+ const Q_D(QQuickWebEngineProfile);
+ return QQuickWebEngineProfile::PersistentCookiesPolicy(d->profileAdapter()->persistentCookiesPolicy());
+}
+
+void QQuickWebEngineProfile::setPersistentCookiesPolicy(QQuickWebEngineProfile::PersistentCookiesPolicy newPersistentCookiesPolicy)
+{
+ Q_D(QQuickWebEngineProfile);
+ ProfileAdapter::PersistentCookiesPolicy oldPolicy = d->profileAdapter()->persistentCookiesPolicy();
+ d->profileAdapter()->setPersistentCookiesPolicy(ProfileAdapter::PersistentCookiesPolicy(newPersistentCookiesPolicy));
+ if (d->profileAdapter()->persistentCookiesPolicy() != oldPolicy)
+ emit persistentCookiesPolicyChanged();
+}
+
+/*!
+ \qmlproperty int WebEngineProfile::httpCacheMaximumSize
+
+ The maximum size of the HTTP cache. If \c 0, the size will be controlled automatically by
+ QtWebEngine. The default value is \c 0.
+
+ \sa httpCacheType
+*/
+
+/*!
+ \property QQuickWebEngineProfile::httpCacheMaximumSize
+
+ The maximum size of the HTTP cache. If \c 0, the size will be controlled automatically by
+ QtWebEngine. The default value is \c 0.
+
+ \sa httpCacheType
+*/
+
+int QQuickWebEngineProfile::httpCacheMaximumSize() const
+{
+ const Q_D(QQuickWebEngineProfile);
+ return d->profileAdapter()->httpCacheMaxSize();
+}
+
+void QQuickWebEngineProfile::setHttpCacheMaximumSize(int maximumSize)
+{
+ Q_D(QQuickWebEngineProfile);
+ if (d->profileAdapter()->httpCacheMaxSize() == maximumSize)
+ return;
+ d->profileAdapter()->setHttpCacheMaxSize(maximumSize);
+ emit httpCacheMaximumSizeChanged();
+}
+
+/*!
+ \qmlproperty string WebEngineProfile::httpAcceptLanguage
+
+ The value of the Accept-Language HTTP request-header field.
+
+ \since QtWebEngine 1.2
+*/
+
+/*!
+ \property QQuickWebEngineProfile::httpAcceptLanguage
+
+ The value of the Accept-Language HTTP request-header field.
+*/
+
+QString QQuickWebEngineProfile::httpAcceptLanguage() const
+{
+ Q_D(const QQuickWebEngineProfile);
+ return d->profileAdapter()->httpAcceptLanguage();
+}
+
+void QQuickWebEngineProfile::setHttpAcceptLanguage(const QString &httpAcceptLanguage)
+{
+ Q_D(QQuickWebEngineProfile);
+ if (d->profileAdapter()->httpAcceptLanguage() == httpAcceptLanguage)
+ return;
+ d->profileAdapter()->setHttpAcceptLanguage(httpAcceptLanguage);
+ emit httpAcceptLanguageChanged();
+}
+
+/*!
+ Returns the default profile.
+
+ The default profile is off-the-record.
+
+ \sa storageName()
+*/
+QQuickWebEngineProfile *QQuickWebEngineProfile::defaultProfile()
+{
+ static QQuickWebEngineProfile *profile = new QQuickWebEngineProfile(
+ new QQuickWebEngineProfilePrivate(ProfileAdapter::createDefaultProfileAdapter()),
+ ProfileAdapter::globalQObjectRoot());
+ return profile;
+}
+
+/*!
+ \property QQuickWebEngineProfile::spellCheckLanguages
+ \brief The languages used by the spell checker.
+
+ \since QtWebEngine 1.4
+*/
+
+/*!
+ \qmlproperty list<string> WebEngineProfile::spellCheckLanguages
+
+ This property holds the list of languages used by the spell checker.
+ Each language should match the name of the \c .bdic dictionary.
+ For example, the language \c en-US will load the \c en-US.bdic
+ dictionary file.
+
+ See the \l {Spellchecker}{Spellchecker feature documentation} for how
+ dictionary files are searched.
+
+ For more information about how to compile \c .bdic dictionaries, see the
+ \l{WebEngine Widgets Spellchecker Example}{Spellchecker Example}.
+
+ \since QtWebEngine 1.4
+*/
+void QQuickWebEngineProfile::setSpellCheckLanguages(const QStringList &languages)
+{
+ Q_D(QQuickWebEngineProfile);
+ if (languages != d->profileAdapter()->spellCheckLanguages()) {
+ d->profileAdapter()->setSpellCheckLanguages(languages);
+ emit spellCheckLanguagesChanged();
+ }
+}
+
+/*!
+ \since 5.8
+
+ Returns the list of languages used by the spell checker.
+*/
+QStringList QQuickWebEngineProfile::spellCheckLanguages() const
+{
+ const Q_D(QQuickWebEngineProfile);
+ return d->profileAdapter()->spellCheckLanguages();
+}
+
+/*!
+ \property QQuickWebEngineProfile::spellCheckEnabled
+ \brief whether the web engine spell checker is enabled.
+
+ \since QtWebEngine 1.4
+*/
+
+/*!
+ \qmlproperty bool WebEngineProfile::spellCheckEnabled
+
+ This property holds whether the web engine spell checker is enabled.
+
+ \since QtWebEngine 1.4
+*/
+void QQuickWebEngineProfile::setSpellCheckEnabled(bool enable)
+{
+ Q_D(QQuickWebEngineProfile);
+ if (enable != isSpellCheckEnabled()) {
+ d->profileAdapter()->setSpellCheckEnabled(enable);
+ emit spellCheckEnabledChanged();
+ }
+}
+
+bool QQuickWebEngineProfile::isSpellCheckEnabled() const
+{
+ const Q_D(QQuickWebEngineProfile);
+ return d->profileAdapter()->isSpellCheckEnabled();
+}
+
+/*!
+ \qmlproperty string WebEngineProfile::downloadPath
+ \since QtWebEngine 1.9
+
+ The path to the location where the downloaded files are stored.
+
+ Overrides the default path used for download location.
+
+ If set to an empty string, the default path is restored.
+
+ \note By default, the download path is QStandardPaths::DownloadLocation.
+*/
+
+/*!
+ \property QQuickWebEngineProfile::downloadPath
+ \since QtWebEngine 1.9
+
+ The path to the location where the downloaded files are stored.
+
+ Overrides the default path used for download location, setting it to \a path.
+
+ If set to an empty string, the default path is restored.
+
+ \note By default, the download path is QStandardPaths::DownloadLocation.
+*/
+
+void QQuickWebEngineProfile::setDownloadPath(const QString &path)
+{
+ Q_D(QQuickWebEngineProfile);
+ if (downloadPath() == path)
+ return;
+ d->profileAdapter()->setDownloadPath(path);
+ emit downloadPathChanged();
+}
+
+QString QQuickWebEngineProfile::downloadPath() const
+{
+ const Q_D(QQuickWebEngineProfile);
+ return d->profileAdapter()->downloadPath();
+}
+
+/*!
+ \qmlproperty bool WebEngineProfile::isPushServiceEnabled
+ \since QtWebEngine 6.5
+
+ Whether the push messaging service is enabled.
+ \note By default the push messaging service is disabled.
+ \note \QWE uses the \l {https://firebase.google.com}{Firebase Cloud Messaging (FCM)} as a browser push service.
+ Therefore, all push messages will go through the Google push service and its respective servers.
+*/
+
+/*!
+ \property QQuickWebEngineProfile::isPushServiceEnabled
+ \since QtWebEngine 6.5
+
+ Whether the push messaging service is enabled.
+ \note By default the push messaging service is disabled.
+ \note \QWE uses the \l {https://firebase.google.com}{Firebase Cloud Messaging (FCM)} as a browser push service.
+ Therefore, all push messages will go through the Google push service and its respective servers.
+*/
+
+bool QQuickWebEngineProfile::isPushServiceEnabled() const
+{
+ const Q_D(QQuickWebEngineProfile);
+ return d->profileAdapter()->pushServiceEnabled();
+}
+
+void QQuickWebEngineProfile::setPushServiceEnabled(bool enabled)
+{
+ Q_D(QQuickWebEngineProfile);
+ if (isPushServiceEnabled() == enabled)
+ return;
+ d->profileAdapter()->setPushServiceEnabled(enabled);
+ emit pushServiceEnabledChanged();
+}
+
+/*!
+
+ Returns the cookie store for this profile.
+*/
+QWebEngineCookieStore *QQuickWebEngineProfile::cookieStore() const
+{
+ const Q_D(QQuickWebEngineProfile);
+ return d->profileAdapter()->cookieStore();
+}
+
+/*!
+ \qmlmethod void WebEngineProfile::clearHttpCache()
+ \since QtWebEngine 1.3
+
+ Removes the profile's cache entries.
+
+ \note Make sure that you do not start new navigation or any operation on the profile while
+ the clear operation is in progress. The clearHttpCacheCompleted() signal notifies about the
+ completion.
+
+ \sa WebEngineProfile::cachePath clearHttpCacheCompleted()
+*/
+
+/*!
+ \since 5.7
+
+ Removes the profile's cache entries.
+
+ \note Make sure that you do not start new navigation or any operation on the profile while
+ the clear operation is in progress. The clearHttpCacheCompleted() signal notifies about the
+ completion.
+
+ \sa WebEngineProfile::clearHttpCache() clearHttpCacheCompleted()
+*/
+void QQuickWebEngineProfile::clearHttpCache()
+{
+ Q_D(QQuickWebEngineProfile);
+ d->profileAdapter()->clearHttpCache();
+}
+
+/*!
+ Registers a request interceptor singleton \a interceptor to intercept URL requests.
+
+ The profile does not take ownership of the pointer.
+
+ \sa QWebEngineUrlRequestInfo QWebEngineUrlRequestInterceptor
+*/
+void QQuickWebEngineProfile::setUrlRequestInterceptor(QWebEngineUrlRequestInterceptor *interceptor)
+{
+ Q_D(QQuickWebEngineProfile);
+ d->profileAdapter()->setRequestInterceptor(interceptor);
+}
+
+
+/*!
+ Returns the custom URL scheme handler register for the URL scheme \a scheme.
+*/
+const QWebEngineUrlSchemeHandler *QQuickWebEngineProfile::urlSchemeHandler(const QByteArray &scheme) const
+{
+ const Q_D(QQuickWebEngineProfile);
+ return d->profileAdapter()->urlSchemeHandler(scheme);
+}
+
+/*!
+ Registers a handler \a handler for custom URL scheme \a scheme in the profile.
+
+ It is necessary to first register the scheme with \l
+ QWebEngineUrlScheme::registerScheme at application startup.
+*/
+void QQuickWebEngineProfile::installUrlSchemeHandler(const QByteArray &scheme, QWebEngineUrlSchemeHandler *handler)
+{
+ Q_D(QQuickWebEngineProfile);
+ d->profileAdapter()->installUrlSchemeHandler(scheme, handler);
+}
+
+/*!
+ Removes the custom URL scheme handler \a handler from the profile.
+
+ \sa removeUrlScheme()
+*/
+void QQuickWebEngineProfile::removeUrlSchemeHandler(QWebEngineUrlSchemeHandler *handler)
+{
+ Q_D(QQuickWebEngineProfile);
+ d->profileAdapter()->removeUrlSchemeHandler(handler);
+}
+
+/*!
+ Removes the custom URL scheme \a scheme from the profile.
+
+ \sa removeUrlSchemeHandler()
+*/
+void QQuickWebEngineProfile::removeUrlScheme(const QByteArray &scheme)
+{
+ Q_D(QQuickWebEngineProfile);
+ d->profileAdapter()->removeUrlScheme(scheme);
+}
+
+/*!
+ Removes all custom URL scheme handlers installed in the profile.
+*/
+void QQuickWebEngineProfile::removeAllUrlSchemeHandlers()
+{
+ Q_D(QQuickWebEngineProfile);
+ d->profileAdapter()->removeAllUrlSchemeHandlers();
+}
+
+QQuickWebEngineSettings *QQuickWebEngineProfile::settings() const
+{
+ const Q_D(QQuickWebEngineProfile);
+ return d->settings();
+}
+
+/*!
+ \qmlproperty WebEngineScriptCollection WebEngineProfile::userScripts
+ \since 1.5
+
+ Returns the collection of WebEngineScript objects that are injected into
+ all pages that share this profile.
+*/
+
+QQuickWebEngineScriptCollection *QQuickWebEngineProfile::userScripts() const
+{
+ return d_ptr->getUserScripts();
+}
+
+/*!
+ \since 5.13
+
+ Returns the profile's client certificate store.
+*/
+QWebEngineClientCertificateStore *QQuickWebEngineProfile::clientCertificateStore()
+{
+#if QT_CONFIG(ssl)
+ Q_D(QQuickWebEngineProfile);
+ return d->profileAdapter()->clientCertificateStore();
+#else
+ return nullptr;
+#endif
+}
+
+/*!
+ Return the Client Hints settings associated with this browsing context.
+
+ \since 6.8
+ \sa QWebEngineClientHints
+*/
+QWebEngineClientHints *QQuickWebEngineProfile::clientHints() const
+{
+ Q_D(const QQuickWebEngineProfile);
+ return d->m_clientHints.data();
+}
+
+void QQuickWebEngineProfile::ensureQmlContext(const QObject *object)
+{
+ if (!qmlContext(this)) {
+ auto engine = qmlEngine(object);
+ QQmlEngine::setContextForObject(this, new QQmlContext(engine, engine));
+ }
+}
+
+QT_END_NAMESPACE
+
+#include "moc_qquickwebengineprofile.cpp"
diff --git a/src/webenginequick/api/qquickwebengineprofile.h b/src/webenginequick/api/qquickwebengineprofile.h
new file mode 100644
index 000000000..088a971e0
--- /dev/null
+++ b/src/webenginequick/api/qquickwebengineprofile.h
@@ -0,0 +1,156 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QQUICKWEBENGINEPROFILE_H
+#define QQUICKWEBENGINEPROFILE_H
+
+#include <QtWebEngineQuick/qtwebenginequickglobal.h>
+#include <QtCore/qobject.h>
+#include <QtCore/qscopedpointer.h>
+#include <QtCore/qstring.h>
+#include <QtQml/qqmlregistration.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQuickWebEngineDownloadRequest;
+class QQuickWebEngineSettings;
+class QWebEngineClientCertificateStore;
+class QWebEngineClientHints;
+class QWebEngineCookieStore;
+class QWebEngineNotification;
+class QWebEngineUrlRequestInterceptor;
+class QWebEngineUrlSchemeHandler;
+class QQuickWebEngineScriptCollection;
+class QQuickWebEngineProfilePrivate;
+
+class Q_WEBENGINEQUICK_EXPORT QQuickWebEngineProfile : public QObject {
+ Q_OBJECT
+ Q_PROPERTY(QString storageName READ storageName WRITE setStorageName NOTIFY storageNameChanged FINAL)
+ Q_PROPERTY(bool offTheRecord READ isOffTheRecord WRITE setOffTheRecord NOTIFY offTheRecordChanged FINAL)
+ Q_PROPERTY(QString persistentStoragePath READ persistentStoragePath WRITE setPersistentStoragePath NOTIFY persistentStoragePathChanged FINAL)
+ Q_PROPERTY(QString cachePath READ cachePath WRITE setCachePath NOTIFY cachePathChanged FINAL)
+ Q_PROPERTY(QString httpUserAgent READ httpUserAgent WRITE setHttpUserAgent NOTIFY httpUserAgentChanged FINAL)
+ Q_PROPERTY(HttpCacheType httpCacheType READ httpCacheType WRITE setHttpCacheType NOTIFY httpCacheTypeChanged FINAL)
+ Q_PROPERTY(QString httpAcceptLanguage READ httpAcceptLanguage WRITE setHttpAcceptLanguage NOTIFY httpAcceptLanguageChanged FINAL REVISION(1,1))
+ Q_PROPERTY(PersistentCookiesPolicy persistentCookiesPolicy READ persistentCookiesPolicy WRITE setPersistentCookiesPolicy NOTIFY persistentCookiesPolicyChanged FINAL)
+ Q_PROPERTY(int httpCacheMaximumSize READ httpCacheMaximumSize WRITE setHttpCacheMaximumSize NOTIFY httpCacheMaximumSizeChanged FINAL)
+ Q_PROPERTY(QStringList spellCheckLanguages READ spellCheckLanguages WRITE setSpellCheckLanguages NOTIFY spellCheckLanguagesChanged FINAL REVISION(1,3))
+ Q_PROPERTY(bool spellCheckEnabled READ isSpellCheckEnabled WRITE setSpellCheckEnabled NOTIFY spellCheckEnabledChanged FINAL REVISION(1,3))
+ Q_PROPERTY(QQuickWebEngineScriptCollection *userScripts READ userScripts)
+ Q_PROPERTY(QString downloadPath READ downloadPath WRITE setDownloadPath NOTIFY downloadPathChanged FINAL REVISION(1,5))
+ Q_PROPERTY(bool isPushServiceEnabled READ isPushServiceEnabled WRITE setPushServiceEnabled NOTIFY pushServiceEnabledChanged FINAL REVISION(6,5))
+ QML_NAMED_ELEMENT(WebEngineProfile)
+ QML_ADDED_IN_VERSION(1, 1)
+ QML_EXTRA_VERSION(2, 0)
+
+public:
+ QQuickWebEngineProfile(QObject *parent = nullptr);
+ ~QQuickWebEngineProfile();
+
+ enum HttpCacheType {
+ MemoryHttpCache,
+ DiskHttpCache,
+ NoCache
+ };
+ Q_ENUM(HttpCacheType)
+
+ enum PersistentCookiesPolicy {
+ NoPersistentCookies,
+ AllowPersistentCookies,
+ ForcePersistentCookies
+ };
+ Q_ENUM(PersistentCookiesPolicy)
+
+ QString storageName() const;
+ void setStorageName(const QString &name);
+
+ bool isOffTheRecord() const;
+ void setOffTheRecord(bool offTheRecord);
+
+ QString persistentStoragePath() const;
+ void setPersistentStoragePath(const QString &path);
+
+ QString cachePath() const;
+ void setCachePath(const QString &path);
+
+ QString httpUserAgent() const;
+ void setHttpUserAgent(const QString &userAgent);
+
+ HttpCacheType httpCacheType() const;
+ void setHttpCacheType(QQuickWebEngineProfile::HttpCacheType);
+
+ PersistentCookiesPolicy persistentCookiesPolicy() const;
+ void setPersistentCookiesPolicy(QQuickWebEngineProfile::PersistentCookiesPolicy);
+
+ int httpCacheMaximumSize() const;
+ void setHttpCacheMaximumSize(int maxSize);
+
+ QString httpAcceptLanguage() const;
+ void setHttpAcceptLanguage(const QString &httpAcceptLanguage);
+
+ QWebEngineCookieStore *cookieStore() const;
+
+ void setUrlRequestInterceptor(QWebEngineUrlRequestInterceptor *interceptor);
+
+ const QWebEngineUrlSchemeHandler *urlSchemeHandler(const QByteArray &) const;
+ void installUrlSchemeHandler(const QByteArray &scheme, QWebEngineUrlSchemeHandler *);
+ void removeUrlScheme(const QByteArray &scheme);
+ void removeUrlSchemeHandler(QWebEngineUrlSchemeHandler *);
+ void removeAllUrlSchemeHandlers();
+
+ Q_REVISION(1,2) Q_INVOKABLE void clearHttpCache();
+
+ void setSpellCheckLanguages(const QStringList &languages);
+ QStringList spellCheckLanguages() const;
+ void setSpellCheckEnabled(bool enabled);
+ bool isSpellCheckEnabled() const;
+
+ QQuickWebEngineScriptCollection *userScripts() const;
+
+ QString downloadPath() const;
+ void setDownloadPath(const QString &path);
+
+ bool isPushServiceEnabled() const;
+ void setPushServiceEnabled(bool enable);
+
+ QWebEngineClientCertificateStore *clientCertificateStore();
+ QWebEngineClientHints *clientHints() const;
+
+ static QQuickWebEngineProfile *defaultProfile();
+
+Q_SIGNALS:
+ void storageNameChanged();
+ void offTheRecordChanged();
+ void persistentStoragePathChanged();
+ void cachePathChanged();
+ void httpUserAgentChanged();
+ void httpCacheTypeChanged();
+ void persistentCookiesPolicyChanged();
+ void httpCacheMaximumSizeChanged();
+ Q_REVISION(1,1) void httpAcceptLanguageChanged();
+ Q_REVISION(1,3) void spellCheckLanguagesChanged();
+ Q_REVISION(1,3) void spellCheckEnabledChanged();
+ Q_REVISION(1,5) void downloadPathChanged();
+ Q_REVISION(6,5) void pushServiceEnabledChanged();
+ Q_REVISION(6,7) void clearHttpCacheCompleted();
+ void downloadRequested(QQuickWebEngineDownloadRequest *download);
+ void downloadFinished(QQuickWebEngineDownloadRequest *download);
+
+ Q_REVISION(1,5) void presentNotification(QWebEngineNotification *notification);
+
+private:
+ Q_DECLARE_PRIVATE(QQuickWebEngineProfile)
+ QQuickWebEngineProfile(QQuickWebEngineProfilePrivate *, QObject *parent = nullptr);
+ QQuickWebEngineSettings *settings() const;
+ void ensureQmlContext(const QObject *object);
+
+ friend class FaviconImageResponseRunnable;
+ friend class QQuickWebEngineSingleton;
+ friend class QQuickWebEngineViewPrivate;
+ friend class QQuickWebEngineView;
+ QScopedPointer<QQuickWebEngineProfilePrivate> d_ptr;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQUICKWEBENGINEPROFILE_H
diff --git a/src/webenginequick/api/qquickwebengineprofile_p.h b/src/webenginequick/api/qquickwebengineprofile_p.h
new file mode 100644
index 000000000..477936f98
--- /dev/null
+++ b/src/webenginequick/api/qquickwebengineprofile_p.h
@@ -0,0 +1,72 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QQUICKWEBENGINEPROFILE_P_H
+#define QQUICKWEBENGINEPROFILE_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "profile_adapter_client.h"
+#include "qquickwebengineprofile.h"
+
+#include <QtCore/qmap.h>
+#include <QtCore/qpointer.h>
+#include <QtCore/qsharedpointer.h>
+
+namespace QtWebEngineCore {
+class ProfileAdapter;
+}
+
+QT_BEGIN_NAMESPACE
+
+class QWebEngineClientHints;
+class QQuickWebEngineDownloadRequest;
+class QQuickWebEngineSettings;
+class QQuickWebEngineScriptCollection;
+
+class QQuickWebEngineProfilePrivate : public QtWebEngineCore::ProfileAdapterClient {
+public:
+ Q_DECLARE_PUBLIC(QQuickWebEngineProfile)
+ QQuickWebEngineProfilePrivate(QtWebEngineCore::ProfileAdapter *profileAdapter);
+ ~QQuickWebEngineProfilePrivate();
+ void addWebContentsAdapterClient(QtWebEngineCore::WebContentsAdapterClient *adapter) override;
+ void removeWebContentsAdapterClient(QtWebEngineCore::WebContentsAdapterClient *adapter) override;
+
+ QtWebEngineCore::ProfileAdapter* profileAdapter() const;
+ QQuickWebEngineSettings *settings() const;
+ QtWebEngineCore::WebEngineSettings *coreSettings() const override;
+
+ void cancelDownload(quint32 downloadId);
+ void downloadDestroyed(quint32 downloadId);
+
+ void cleanDownloads();
+
+ void downloadRequested(DownloadItemInfo &info) override;
+ void downloadUpdated(const DownloadItemInfo &info) override;
+
+ void showNotification(QSharedPointer<QtWebEngineCore::UserNotificationController> &controller) override;
+ void clearHttpCacheCompleted() override;
+
+private:
+ QQuickWebEngineProfile *q_ptr;
+ QScopedPointer<QQuickWebEngineSettings> m_settings;
+ QScopedPointer<QWebEngineClientHints> m_clientHints;
+ QPointer<QtWebEngineCore::ProfileAdapter> m_profileAdapter;
+ QMap<quint32, QPointer<QQuickWebEngineDownloadRequest> > m_ongoingDownloads;
+
+ QScopedPointer<QQuickWebEngineScriptCollection> m_scriptCollection;
+ QQuickWebEngineScriptCollection *getUserScripts();
+};
+
+QT_END_NAMESPACE
+
+#endif // QQUICKWEBENGINEPROFILE_P_H
diff --git a/src/webenginequick/api/qquickwebenginescriptcollection.cpp b/src/webenginequick/api/qquickwebenginescriptcollection.cpp
new file mode 100644
index 000000000..a58d97832
--- /dev/null
+++ b/src/webenginequick/api/qquickwebenginescriptcollection.cpp
@@ -0,0 +1,244 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qquickwebenginescriptcollection_p.h"
+#include "qquickwebenginescriptcollection_p_p.h"
+#include "qwebenginescriptcollection.h"
+#include <QtWebEngineCore/private/qwebenginescriptcollection_p.h>
+#include <QtQml/qqmlinfo.h>
+#include <QtQml/private/qqmlengine_p.h>
+#include <QtQml/private/qv4scopedvalue_p.h>
+#include <QtQml/private/qv4arrayobject_p.h>
+
+/*!
+ \qmltype WebEngineScriptCollection
+ \brief Manages a collection of user scripts.
+ \since QtWebEngine 6.2
+
+ \inqmlmodule QtWebEngine
+
+ WebEngineScriptCollection handles a user scripts collection, which
+ is injected in the JavaScript engine during the loading of web content.
+
+ Use \l{WebEngineView::userScripts}{WebEgineView.userScripts} and
+ \l{WebEngineProfile::userScripts}{WebEngineProfile.userScripts} to access
+ the collection of scripts associated with a single page or number of pages
+ sharing the same profile.
+
+ The collection of user script objects in QML can be created for a set of
+ user script objects by simple assignment to
+ \l{WebEngineScriptCollection::collection}{WebEngineScriptCollection.collection}
+ property or by WebEngineScriptCollection methods.
+
+ \note The new user script can be instantiated with JavaScript dictionaries when using
+ \e collection property.
+
+ See the following code snippets demonstrating the usage:
+
+ \list
+ \li \e collection property with JavaScript dictionaries
+ \code
+ var scriptFoo = { name: "Foo",
+ sourceUrl: Qt.resolvedUrl("foo.js"),
+ injectionPoint: WebEngineScript.DocumentReady }
+
+ webEngineView.userScripts.collection = [ scriptFoo, scriptBar ];
+ \endcode
+ \li \e collection property with user script object as value type
+ \code
+ var script = WebEngine.script()
+ script.name = "FOO"
+ webEngineView.userScripts.collection = [ script ]
+ \endcode
+ \li user script collection \e insert method can be used only with value type
+ or list of value types
+ \code
+ var script = WebEngine.script()
+ script.name = "FOO"
+ webEngineView.userScripts.insert(script)
+
+ var list = [ script ]
+ webEngineView.userScripts.insert(list)
+ \endcode
+ \endlist
+ \sa WebEngineScript WebEngineScriptCollection
+
+*/
+
+QWebEngineScript parseScript(const QJSValue &value, bool *ok)
+{
+ QWebEngineScript s;
+ if (ok)
+ *ok = false;
+
+ if (value.isObject()) {
+
+ if (value.hasProperty(QStringLiteral("name")))
+ s.setName(value.property(QStringLiteral("name")).toString());
+
+ if (value.hasProperty(QStringLiteral("sourceUrl")))
+ s.setSourceUrl(value.property(QStringLiteral("sourceUrl")).toString());
+
+ if (value.hasProperty(QStringLiteral("injectionPoint")))
+ s.setInjectionPoint(QWebEngineScript::InjectionPoint(
+ value.property(QStringLiteral("injectionPoint")).toUInt()));
+
+ if (value.hasProperty(QStringLiteral("sourceCode")))
+ s.setSourceCode(value.property(QStringLiteral("sourceCode")).toString());
+
+ if (value.hasProperty(QStringLiteral("worldId")))
+ s.setWorldId(QWebEngineScript::ScriptWorldId(
+ value.property(QStringLiteral("worldId")).toUInt()));
+
+ if (value.hasProperty(QStringLiteral("runOnSubframes")))
+ s.setRunsOnSubFrames(value.property(QStringLiteral("runOnSubframes")).toBool());
+
+ if (ok)
+ *ok = true;
+ }
+ return s;
+}
+
+QQuickWebEngineScriptCollectionPrivate::QQuickWebEngineScriptCollectionPrivate(QWebEngineScriptCollectionPrivate *p)
+ : QWebEngineScriptCollection(p)
+{
+
+}
+
+QQuickWebEngineScriptCollectionPrivate::~QQuickWebEngineScriptCollectionPrivate()
+{
+}
+
+QQuickWebEngineScriptCollection::QQuickWebEngineScriptCollection(QQuickWebEngineScriptCollectionPrivate *p)
+ : d(p)
+{
+}
+
+QQuickWebEngineScriptCollection::~QQuickWebEngineScriptCollection() { }
+
+/*!
+ \qmlmethod void WebEngineScriptCollection::contains(WebEngineScript script)
+ \since QtWebEngine 6.2
+ Checks if the specified \a script is in the collection.
+ \sa find()
+*/
+
+bool QQuickWebEngineScriptCollection::contains(const QWebEngineScript &value) const
+{
+ return d->contains(value);
+}
+
+/*!
+ \qmlmethod list<WebEngineScript> WebEngineScriptCollection::find(string name)
+ \since QtWebEngine 6.2
+ Returns a list of all user script objects with the given \a name.
+ \sa find()
+*/
+QList<QWebEngineScript> QQuickWebEngineScriptCollection::find(const QString &name) const
+{
+ return d->find(name);
+}
+
+/*!
+ \qmlmethod void WebEngineScriptCollection::insert(WebEngineScript script)
+ \since QtWebEngine 6.2
+ Inserts a single \a script into the collection.
+ \sa find()
+*/
+void QQuickWebEngineScriptCollection::insert(const QWebEngineScript &s)
+{
+ d->insert(s);
+}
+
+/*!
+ \qmlmethod void WebEngineScriptCollection::insert(list<WebEngineScript> list)
+ \since QtWebEngine 6.2
+ Inserts a \a list of WebEngineScript values into the user script collection.
+ \sa find()
+*/
+void QQuickWebEngineScriptCollection::insert(const QList<QWebEngineScript> &list)
+{
+ d->insert(list);
+}
+
+/*!
+ \qmlmethod bool WebEngineScriptCollection::remove(WebEngineScript script)
+ \since QtWebEngine 6.2
+ Returns \c true if a given \a script is removed from the collection.
+ \sa insert()
+*/
+bool QQuickWebEngineScriptCollection::remove(const QWebEngineScript &script)
+{
+ return d->remove(script);
+}
+
+/*!
+ \qmlmethod void WebEngineScriptCollection::clear()
+ \since QtWebEngine 6.2
+ Removes all script objects from this collection.
+*/
+void QQuickWebEngineScriptCollection::clear()
+{
+ d->clear();
+}
+
+/*!
+ \qmlproperty list<WebEngineScript> WebEngineScriptCollection::collection
+ \since QtWebEngine 6.2
+
+ This property holds a JavaScript array of user script objects. The array can
+ take WebEngineScript basic type or a JavaScript dictionary as values.
+*/
+QJSValue QQuickWebEngineScriptCollection::collection() const
+{
+ if (!d->m_qmlEngine) {
+ qmlWarning(this) << "Scripts collection doesn't have QML engine set! Undefined value is returned.";
+ return QJSValue();
+ }
+
+ const QList<QWebEngineScript> &list = d->toList();
+ QV4::ExecutionEngine *v4 = QQmlEnginePrivate::getV4Engine(d->m_qmlEngine);
+ QV4::Scope scope(v4);
+ QV4::Scoped<QV4::ArrayObject> scriptArray(scope, v4->newArrayObject(list.size()));
+ int i = 0;
+ for (const auto &val : list) {
+ QV4::ScopedValue sv(scope, v4->fromVariant(QVariant::fromValue(val)));
+ scriptArray->put(i++, sv);
+ }
+ return QJSValuePrivate::fromReturnedValue(scriptArray.asReturnedValue());
+}
+
+void QQuickWebEngineScriptCollection::setCollection(const QJSValue &scripts)
+{
+ if (!scripts.isArray())
+ return;
+
+ QList<QWebEngineScript> scriptList;
+ quint32 length = scripts.property(QStringLiteral("length")).toUInt();
+ for (quint32 i = 0; i < length; ++i) {
+ bool ok;
+ QWebEngineScript s = parseScript(scripts.property(i), &ok);
+ if (!ok) {
+ qmlWarning(this) << "Unsupported script type";
+ return;
+ }
+ scriptList.append(s);
+ }
+ if (scriptList != d->toList()) {
+ clear();
+ insert(scriptList);
+ Q_EMIT collectionChanged();
+ }
+}
+
+QQmlEngine* QQuickWebEngineScriptCollection::qmlEngine()
+{
+ return d->m_qmlEngine;
+}
+
+void QQuickWebEngineScriptCollection::setQmlEngine(QQmlEngine *engine)
+{
+ Q_ASSERT(engine);
+ d->m_qmlEngine = engine;
+}
+#include "moc_qquickwebenginescriptcollection_p.cpp"
diff --git a/src/webenginequick/api/qquickwebenginescriptcollection_p.h b/src/webenginequick/api/qquickwebenginescriptcollection_p.h
new file mode 100644
index 000000000..fbcc8dde7
--- /dev/null
+++ b/src/webenginequick/api/qquickwebenginescriptcollection_p.h
@@ -0,0 +1,63 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QQUICKWEBENGINESCRIPTCOLLECTION_H
+#define QQUICKWEBENGINESCRIPTCOLLECTION_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qlist.h>
+#include <QtCore/qobject.h>
+#include <QtCore/qscopedpointer.h>
+#include <QtQml/qjsvalue.h>
+#include <QtWebEngineCore/qwebenginescript.h>
+#include <QtWebEngineQuick/private/qtwebenginequickglobal_p.h>
+
+QT_BEGIN_NAMESPACE
+class QQmlEngine;
+class QQuickWebEngineScriptCollectionPrivate;
+
+class Q_WEBENGINEQUICK_EXPORT QQuickWebEngineScriptCollection : public QObject
+{
+ Q_OBJECT
+public:
+ Q_PROPERTY(QJSValue collection READ collection WRITE setCollection NOTIFY collectionChanged)
+ ~QQuickWebEngineScriptCollection();
+
+ Q_INVOKABLE bool contains(const QWebEngineScript &value) const;
+ Q_INVOKABLE QList<QWebEngineScript> find(const QString &name) const;
+ Q_INVOKABLE void insert(const QWebEngineScript &);
+ Q_INVOKABLE void insert(const QList<QWebEngineScript> &list);
+ Q_INVOKABLE bool remove(const QWebEngineScript &);
+ Q_INVOKABLE void clear();
+
+ QJSValue collection() const;
+ void setCollection(const QJSValue &scripts);
+
+Q_SIGNALS:
+ void collectionChanged();
+
+private:
+ Q_DISABLE_COPY(QQuickWebEngineScriptCollection)
+ QQuickWebEngineScriptCollection(QQuickWebEngineScriptCollectionPrivate *d);
+ QScopedPointer<QQuickWebEngineScriptCollectionPrivate> d;
+ friend class QQuickWebEngineProfilePrivate;
+ friend class QQuickWebEngineViewPrivate;
+ QQmlEngine* qmlEngine();
+ void setQmlEngine(QQmlEngine *engine);
+};
+
+QT_END_NAMESPACE
+
+Q_DECLARE_METATYPE(QQuickWebEngineScriptCollection *)
+
+#endif // QWEBENGINESCRIPTCOLLECTION_H
diff --git a/src/webenginequick/api/qquickwebenginescriptcollection_p_p.h b/src/webenginequick/api/qquickwebenginescriptcollection_p_p.h
new file mode 100644
index 000000000..54a9bc16d
--- /dev/null
+++ b/src/webenginequick/api/qquickwebenginescriptcollection_p_p.h
@@ -0,0 +1,38 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QQUICKWEBENGINESCRIPTCOLLECTIONPRIVATE_H
+#define QQUICKWEBENGINESCRIPTCOLLECTIONPRIVATE_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtWebEngineCore/qwebenginescriptcollection.h>
+
+#include <QPointer>
+
+QT_BEGIN_NAMESPACE
+
+class QQmlEngine;
+
+class QQuickWebEngineScriptCollectionPrivate : public QWebEngineScriptCollection
+{
+public:
+ QQuickWebEngineScriptCollectionPrivate(QWebEngineScriptCollectionPrivate *d);
+ ~QQuickWebEngineScriptCollectionPrivate();
+
+ Q_DISABLE_COPY(QQuickWebEngineScriptCollectionPrivate)
+ QPointer<QQmlEngine> m_qmlEngine;
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/webenginequick/api/qquickwebenginesettings.cpp b/src/webenginequick/api/qquickwebenginesettings.cpp
new file mode 100644
index 000000000..31ed7a661
--- /dev/null
+++ b/src/webenginequick/api/qquickwebenginesettings.cpp
@@ -0,0 +1,854 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qquickwebengineprofile.h"
+#include "qquickwebenginesettings_p.h"
+
+#include "web_engine_settings.h"
+
+QT_BEGIN_NAMESPACE
+
+QQuickWebEngineSettings::QQuickWebEngineSettings(QQuickWebEngineSettings *parentSettings)
+ : d_ptr(new QWebEngineSettings(parentSettings ? parentSettings->d_ptr.data() : nullptr))
+{ }
+
+/*!
+ \qmltype WebEngineSettings
+ //! \instantiates QQuickWebEngineSettings
+ \inqmlmodule QtWebEngine
+ \since QtWebEngine 1.1
+ \brief Allows configuration of browser properties and attributes.
+
+ The WebEngineSettings type can be used to configure browser properties and generic
+ attributes, such as JavaScript support, focus behavior, and access to remote content. This type
+ is uncreatable, but the default settings for all web engine views can be accessed by using
+ the \l [QML] {WebEngine::settings}{WebEngine.settings} property.
+
+ Each web engine view can have individual settings that can be accessed by using the
+ \l{WebEngineView::settings}{WebEngineView.settings} property.
+*/
+
+
+QQuickWebEngineSettings::~QQuickWebEngineSettings()
+{ }
+
+/*!
+ \qmlproperty bool WebEngineSettings::autoLoadImages
+
+ Automatically loads images on web pages.
+
+ Enabled by default.
+*/
+bool QQuickWebEngineSettings::autoLoadImages() const
+{
+ return d_ptr->testAttribute(QWebEngineSettings::AutoLoadImages);
+}
+
+/*!
+ \qmlproperty bool WebEngineSettings::javascriptEnabled
+
+ Enables the running of JavaScript programs.
+
+ Enabled by default.
+*/
+bool QQuickWebEngineSettings::javascriptEnabled() const
+{
+ return d_ptr->testAttribute(QWebEngineSettings::JavascriptEnabled);
+}
+
+/*!
+ \qmlproperty bool WebEngineSettings::javascriptCanOpenWindows
+
+ Allows JavaScript programs to open popup windows without user interaction.
+
+ Enabled by default.
+*/
+bool QQuickWebEngineSettings::javascriptCanOpenWindows() const
+{
+ return d_ptr->testAttribute(QWebEngineSettings::JavascriptCanOpenWindows);
+}
+
+/*!
+ \qmlproperty bool WebEngineSettings::javascriptCanAccessClipboard
+
+ Allows JavaScript programs to read from or write to the clipboard.
+ Writing to the clipboard is always allowed if it is specifically requested by the user.
+
+ To enable also the pasting of clipboard content from JavaScript,
+ use javascriptCanPaste.
+
+ Since unrestricted clipboard access is a potential security concern, it is
+ recommended that applications leave this disabled and instead respond to
+ \l{WebEngineView::ClipboardReadWrite}{ClipboardReadWrite} feature permission requests.
+
+ Disabled by default.
+*/
+bool QQuickWebEngineSettings::javascriptCanAccessClipboard() const
+{
+ return d_ptr->testAttribute(QWebEngineSettings::JavascriptCanAccessClipboard);
+}
+
+/*!
+ \qmlproperty bool WebEngineSettings::linksIncludedInFocusChain
+
+ Includes hyperlinks in the keyboard focus chain.
+
+ Enabled by default.
+*/
+bool QQuickWebEngineSettings::linksIncludedInFocusChain() const
+{
+ return d_ptr->testAttribute(QWebEngineSettings::LinksIncludedInFocusChain);
+}
+
+/*!
+ \qmlproperty bool WebEngineSettings::localStorageEnabled
+
+ Enables support for the HTML 5 local storage feature.
+
+ Enabled by default.
+*/
+bool QQuickWebEngineSettings::localStorageEnabled() const
+{
+ return d_ptr->testAttribute(QWebEngineSettings::LocalStorageEnabled);
+}
+
+/*!
+ \qmlproperty bool WebEngineSettings::localContentCanAccessRemoteUrls
+
+ Allows locally loaded documents to access remote URLs.
+
+ Disabled by default.
+*/
+bool QQuickWebEngineSettings::localContentCanAccessRemoteUrls() const
+{
+ return d_ptr->testAttribute(QWebEngineSettings::LocalContentCanAccessRemoteUrls);
+}
+
+/*!
+ \qmlproperty bool WebEngineSettings::spatialNavigationEnabled
+
+ Enables the Spatial Navigation feature, which means the ability to navigate between focusable
+ elements, such as hyperlinks and form controls, on a web page by using the Left, Right, Up and
+ Down arrow keys.
+
+ For example, if a user presses the Right key, heuristics determine whether there is an element
+ they might be trying to reach towards the right and which element they probably want.
+
+ Disabled by default.
+
+*/
+bool QQuickWebEngineSettings::spatialNavigationEnabled() const
+{
+ return d_ptr->testAttribute(QWebEngineSettings::SpatialNavigationEnabled);
+}
+
+/*!
+ \qmlproperty bool WebEngineSettings::localContentCanAccessFileUrls
+
+ Allows locally loaded documents to access other local URLs.
+
+ Enabled by default.
+*/
+bool QQuickWebEngineSettings::localContentCanAccessFileUrls() const
+{
+ return d_ptr->testAttribute(QWebEngineSettings::LocalContentCanAccessFileUrls);
+}
+
+/*!
+ \qmlproperty bool WebEngineSettings::hyperlinkAuditingEnabled
+
+ Enables support for the \c ping attribute for hyperlinks.
+
+ Disabled by default.
+*/
+bool QQuickWebEngineSettings::hyperlinkAuditingEnabled() const
+{
+ return d_ptr->testAttribute(QWebEngineSettings::HyperlinkAuditingEnabled);
+}
+
+/*!
+ \qmlproperty bool WebEngineSettings::errorPageEnabled
+
+ Enables displaying the built-in error pages of Chromium.
+
+ Enabled by default.
+*/
+bool QQuickWebEngineSettings::errorPageEnabled() const
+{
+ return d_ptr->testAttribute(QWebEngineSettings::ErrorPageEnabled);
+}
+
+/*!
+ \qmlproperty bool WebEngineSettings::pluginsEnabled
+
+ Enables support for Pepper plugins, such as the Flash player.
+
+ Disabled by default.
+
+ \sa {Pepper Plugin API}
+*/
+bool QQuickWebEngineSettings::pluginsEnabled() const
+{
+ return d_ptr->testAttribute(QWebEngineSettings::PluginsEnabled);
+}
+
+/*!
+ \qmlproperty bool WebEngineSettings::fullscreenSupportEnabled
+ \since QtWebEngine 1.2
+
+ Tells the web engine whether fullscreen is supported in this application or not.
+
+ Disabled by default.
+*/
+bool QQuickWebEngineSettings::fullScreenSupportEnabled() const
+{
+ return d_ptr->testAttribute(QWebEngineSettings::FullScreenSupportEnabled);
+}
+
+/*!
+ \qmlproperty bool WebEngineSettings::screenCaptureEnabled
+ \since QtWebEngine 1.3
+
+ Tells the web engine whether screen capture is supported in this application or not.
+
+ Disabled by default.
+*/
+bool QQuickWebEngineSettings::screenCaptureEnabled() const
+{
+ return d_ptr->testAttribute(QWebEngineSettings::ScreenCaptureEnabled);
+}
+
+/*!
+ \qmlproperty bool WebEngineSettings::webGLEnabled
+ \since QtWebEngine 1.3
+
+ Enables support for HTML 5 WebGL.
+
+ Enabled by default if available.
+*/
+bool QQuickWebEngineSettings::webGLEnabled() const
+{
+ return d_ptr->testAttribute(QWebEngineSettings::WebGLEnabled);
+}
+
+/*!
+ \qmlproperty bool WebEngineSettings::accelerated2dCanvasEnabled
+ \since QtWebEngine 1.3
+
+ Specifies whether the HTML 5 2D canvas should be an OpenGL framebuffer.
+ This makes many painting operations faster, but slows down pixel access.
+
+ Enabled by default if available.
+*/
+bool QQuickWebEngineSettings::accelerated2dCanvasEnabled() const
+{
+ return d_ptr->testAttribute(QWebEngineSettings::Accelerated2dCanvasEnabled);
+}
+
+/*!
+ \qmlproperty bool WebEngineSettings::autoLoadIconsForPage
+ \since QtWebEngine 1.3
+
+ Automatically downloads icons for web pages.
+
+ Enabled by default.
+*/
+bool QQuickWebEngineSettings::autoLoadIconsForPage() const
+{
+ return d_ptr->testAttribute(QWebEngineSettings::AutoLoadIconsForPage);
+}
+
+/*!
+ \qmlproperty bool WebEngineSettings::touchIconsEnabled
+ \since QtWebEngine 1.3
+
+ Enables support for touch icons and precomposed touch icons.
+
+ Disabled by default.
+*/
+bool QQuickWebEngineSettings::touchIconsEnabled() const
+{
+ return d_ptr->testAttribute(QWebEngineSettings::TouchIconsEnabled);
+}
+
+/*!
+ \qmlproperty bool WebEngineSettings::focusOnNavigationEnabled
+ \since QtWebEngine 1.4
+
+ Focus is given to the view whenever a navigation operation occurs
+ (load, stop, reload, reload and bypass cache, forward, backward, set content, and so on).
+
+ Disabled by default.
+*/
+bool QQuickWebEngineSettings::focusOnNavigationEnabled() const
+{
+ return d_ptr->testAttribute(QWebEngineSettings::FocusOnNavigationEnabled);
+}
+
+/*!
+ \qmlproperty bool WebEngineSettings::printElementBackgrounds
+ \since QtWebEngine 1.4
+
+ Turns on printing of CSS backgrounds when printing a web page.
+
+ Enabled by default.
+*/
+bool QQuickWebEngineSettings::printElementBackgrounds() const
+{
+ return d_ptr->testAttribute(QWebEngineSettings::PrintElementBackgrounds);
+}
+
+/*!
+ \qmlproperty bool WebEngineSettings::allowRunningInsecureContent
+ \since QtWebEngine 1.4
+
+ By default, HTTPS pages cannot run JavaScript, CSS, plugins or
+ web-sockets from HTTP URLs. This used to be possible and this
+ provides an override to get the old behavior.
+
+ Disabled by default.
+*/
+bool QQuickWebEngineSettings::allowRunningInsecureContent() const
+{
+ return d_ptr->testAttribute(QWebEngineSettings::AllowRunningInsecureContent);
+}
+
+/*!
+ \qmlproperty bool WebEngineSettings::allowGeolocationOnInsecureOrigins
+ \since QtWebEngine 1.5
+
+ Since Qt 5.7, only secure origins such as HTTPS have been able to request
+ Geolocation features. This provides an override to allow non secure
+ origins to access Geolocation again.
+
+ Disabled by default.
+*/
+bool QQuickWebEngineSettings::allowGeolocationOnInsecureOrigins() const
+{
+ return d_ptr->testAttribute(QWebEngineSettings::AllowGeolocationOnInsecureOrigins);
+}
+
+/*!
+ \qmlproperty bool WebEngineSettings::allowWindowActivationFromJavaScript
+ \since QtWebEngine 1.6
+ Allows the window.focus() method in JavaScript. Disallowed by default.
+*/
+bool QQuickWebEngineSettings::allowWindowActivationFromJavaScript() const
+{
+ return d_ptr->testAttribute(QWebEngineSettings::AllowWindowActivationFromJavaScript);
+}
+
+/*!
+ \qmlproperty bool WebEngineSettings::showScrollBars
+ \since QtWebEngine 1.6
+ Shows scroll bars. Enabled by default.
+*/
+bool QQuickWebEngineSettings::showScrollBars() const
+{
+ return d_ptr->testAttribute(QWebEngineSettings::ShowScrollBars);
+}
+
+/*!
+ \qmlproperty bool WebEngineSettings::playbackRequiresUserGesture
+ \since QtWebEngine 1.7
+ Inhibits playback of media content until the user interacts with
+ the page.
+
+ By default, Qt WebEngine uses Chromium settings, as described in
+ \l {Autoplay Policy Changes}. To overwrite the default behavior,
+ this property must be set to \c false.
+
+ \note The behavior is similar to Chrome on Android when enabled,
+ and similar to Chrome on desktops when disabled.
+*/
+bool QQuickWebEngineSettings::playbackRequiresUserGesture() const
+{
+ return d_ptr->testAttribute(QWebEngineSettings::PlaybackRequiresUserGesture);
+}
+
+/*!
+ \qmlproperty bool WebEngineSettings::webRTCPublicInterfacesOnly
+ \since QtWebEngine 1.7
+ Limits WebRTC to public IP addresses only. When disabled WebRTC may also use
+ local network IP addresses, but remote hosts can also see your local network
+ IP address.
+
+ Disabled by default.
+*/
+bool QQuickWebEngineSettings::webRTCPublicInterfacesOnly() const
+{
+ return d_ptr->testAttribute(QWebEngineSettings::WebRTCPublicInterfacesOnly);
+}
+
+/*!
+ \qmlproperty bool WebEngineSettings::javascriptCanPaste
+ \since QtWebEngine 1.7
+
+ Enables JavaScript \c{execCommand("paste")}.
+ This also requires enabling javascriptCanAccessClipboard.
+
+ Since unrestricted clipboard access is a potential security concern, it is
+ recommended that applications leave this disabled and instead respond to
+ \l{WebEngineView::ClipboardReadWrite}{ClipboardReadWrite} feature permission requests.
+
+ Disabled by default.
+*/
+bool QQuickWebEngineSettings::javascriptCanPaste() const
+{
+ return d_ptr->testAttribute(QWebEngineSettings::JavascriptCanPaste);
+}
+
+/*!
+ \qmlproperty bool WebEngineSettings::dnsPrefetchEnabled
+ \since QtWebEngine 1.8
+
+ Enables speculative prefetching of DNS records for HTML links before
+ they are activated.
+
+ Disabled by default.
+*/
+bool QQuickWebEngineSettings::dnsPrefetchEnabled() const
+{
+ return d_ptr->testAttribute(QWebEngineSettings::DnsPrefetchEnabled);
+}
+
+/*!
+ \qmlproperty bool WebEngineSettings::pdfViewerEnabled
+ \since QtWebEngine 1.9
+
+ Specifies that PDF documents will be opened in the internal PDF viewer
+ instead of being downloaded.
+
+ Enabled by default.
+*/
+bool QQuickWebEngineSettings::pdfViewerEnabled() const
+{
+ return d_ptr->testAttribute(QWebEngineSettings::PdfViewerEnabled);
+}
+
+/*!
+ \qmlproperty bool WebEngineSettings::navigateOnDropEnabled
+ \since QtWebEngine 6.4
+
+ Specifies that navigations can be triggered by dropping URLs on
+ the view.
+
+ Enabled by default.
+*/
+bool QQuickWebEngineSettings::navigateOnDropEnabled() const
+{
+ return d_ptr->testAttribute(QWebEngineSettings::NavigateOnDropEnabled);
+}
+
+/*!
+ \qmlproperty bool WebEngineSettings::readingFromCanvasEnabled
+ \since QtWebEngine 6.6
+
+ Specifies that reading from all canvas elements is enabled.
+
+ This setting will have impact on all HTML5 canvas elements irrespective of origin, and can be disabled
+ to prevent canvas fingerprinting.
+
+ Enabled by default.
+ */
+bool QQuickWebEngineSettings::readingFromCanvasEnabled() const
+{
+ return d_ptr->testAttribute(QWebEngineSettings::ReadingFromCanvasEnabled);
+}
+
+/*!
+ \qmlproperty bool WebEngineSettings::forceDarkMode
+ \since QtWebEngine 6.7
+
+ Automatically render all web contents using a dark theme.
+
+ Disabled by default.
+ */
+bool QQuickWebEngineSettings::forceDarkMode() const
+{
+ return d_ptr->testAttribute(QWebEngineSettings::ForceDarkMode);
+}
+
+/*!
+ \qmlproperty bool WebEngineSettings::scrollAnimatorEnabled
+ \since QtWebEngine 6.8
+
+ Enables animated scrolling.
+
+ Disabled by default.
+ */
+bool QQuickWebEngineSettings::scrollAnimatorEnabled() const
+{
+ return d_ptr->testAttribute(QWebEngineSettings::ScrollAnimatorEnabled);
+}
+
+/*!
+ \qmlproperty string WebEngineSettings::defaultTextEncoding
+ \since QtWebEngine 1.2
+
+ Sets the default encoding. The value must be a string describing an encoding such as "utf-8" or
+ "iso-8859-1".
+
+ If left empty, a default value will be used.
+*/
+QString QQuickWebEngineSettings::defaultTextEncoding() const
+{
+ return d_ptr->defaultTextEncoding();
+}
+
+ASSERT_ENUMS_MATCH(QQuickWebEngineSettings::AllowImageAnimation,
+ QWebEngineSettings::AllowImageAnimation)
+ASSERT_ENUMS_MATCH(QQuickWebEngineSettings::AnimateImageOnce, QWebEngineSettings::AnimateImageOnce)
+ASSERT_ENUMS_MATCH(QQuickWebEngineSettings::DisallowImageAnimation,
+ QWebEngineSettings::DisallowImageAnimation)
+/*!
+ \qmlproperty enumeration WebEngineSettings::imageAnimationPolicy
+ \since QtWebEngine 6.8
+
+ Specifies how an image animation should be handled when the image frames
+ are rendered for animation.
+
+ \value WebEngineSettings.AllowImageAnimation
+ Allows all image animations when the image frames are rendered.
+ \value WebEngineSettings.AnimateImageOnce
+ Animate the image once when the image frames are rendered.
+ \value WebEngineSettings.DisallowImageAnimation
+ Disallows all image animations when the image frames are rendered.
+
+ Default value is \c {WebEngineSettings.AllowImageAnimation}.
+*/
+QQuickWebEngineSettings::ImageAnimationPolicy QQuickWebEngineSettings::imageAnimationPolicy() const
+{
+ return static_cast<QQuickWebEngineSettings::ImageAnimationPolicy>(
+ d_ptr->imageAnimationPolicy());
+}
+
+ASSERT_ENUMS_MATCH(QQuickWebEngineSettings::DisallowUnknownUrlSchemes, QWebEngineSettings::DisallowUnknownUrlSchemes)
+ASSERT_ENUMS_MATCH(QQuickWebEngineSettings::AllowUnknownUrlSchemesFromUserInteraction, QWebEngineSettings::AllowUnknownUrlSchemesFromUserInteraction)
+ASSERT_ENUMS_MATCH(QQuickWebEngineSettings::AllowAllUnknownUrlSchemes, QWebEngineSettings::AllowAllUnknownUrlSchemes)
+
+/*!
+ \qmlproperty enumeration WebEngineSettings::unknownUrlSchemePolicy
+ \since QtWebEngine 1.7
+ Specifies how navigation requests to URLs with unknown schemes are handled.
+
+ \value WebEngineSettings.DisallowUnknownUrlSchemes
+ Disallows all navigation requests to URLs with unknown schemes.
+ \value WebEngineSettings.AllowUnknownUrlSchemesFromUserInteraction
+ Allows navigation requests to URLs with unknown schemes that are issued from
+ user-interaction (like a mouse-click), whereas other navigation requests (for example
+ from JavaScript) are suppressed.
+ \value WebEngineSettings.AllowAllUnknownUrlSchemes
+ Allows all navigation requests to URLs with unknown schemes.
+
+ Default value is \c {WebEngineSettings.AllowUnknownUrlSchemesFromUserInteraction}.
+*/
+QQuickWebEngineSettings::UnknownUrlSchemePolicy QQuickWebEngineSettings::unknownUrlSchemePolicy() const
+{
+ return static_cast<QQuickWebEngineSettings::UnknownUrlSchemePolicy>(d_ptr->unknownUrlSchemePolicy());
+}
+
+void QQuickWebEngineSettings::setAutoLoadImages(bool on)
+{
+ bool wasOn = d_ptr->testAttribute(QWebEngineSettings::AutoLoadImages);
+ // Set unconditionally as it sets the override for the current settings while the current setting
+ // could be from the fallback and is prone to changing later on.
+ d_ptr->setAttribute(QWebEngineSettings::AutoLoadImages, on);
+ if (wasOn != on)
+ Q_EMIT autoLoadImagesChanged();
+}
+
+void QQuickWebEngineSettings::setJavascriptEnabled(bool on)
+{
+ bool wasOn = d_ptr->testAttribute(QWebEngineSettings::JavascriptEnabled);
+ d_ptr->setAttribute(QWebEngineSettings::JavascriptEnabled, on);
+ if (wasOn != on)
+ Q_EMIT javascriptEnabledChanged();
+}
+
+void QQuickWebEngineSettings::setJavascriptCanOpenWindows(bool on)
+{
+ bool wasOn = d_ptr->testAttribute(QWebEngineSettings::JavascriptCanOpenWindows);
+ d_ptr->setAttribute(QWebEngineSettings::JavascriptCanOpenWindows, on);
+ if (wasOn != on)
+ Q_EMIT javascriptCanOpenWindowsChanged();
+}
+
+void QQuickWebEngineSettings::setJavascriptCanAccessClipboard(bool on)
+{
+ bool wasOn = d_ptr->testAttribute(QWebEngineSettings::JavascriptCanAccessClipboard);
+ d_ptr->setAttribute(QWebEngineSettings::JavascriptCanAccessClipboard, on);
+ if (wasOn != on)
+ Q_EMIT javascriptCanAccessClipboardChanged();
+}
+
+void QQuickWebEngineSettings::setLinksIncludedInFocusChain(bool on)
+{
+ bool wasOn = d_ptr->testAttribute(QWebEngineSettings::LinksIncludedInFocusChain);
+ d_ptr->setAttribute(QWebEngineSettings::LinksIncludedInFocusChain, on);
+ if (wasOn != on)
+ Q_EMIT linksIncludedInFocusChainChanged();
+}
+
+void QQuickWebEngineSettings::setLocalStorageEnabled(bool on)
+{
+ bool wasOn = d_ptr->testAttribute(QWebEngineSettings::LocalStorageEnabled);
+ d_ptr->setAttribute(QWebEngineSettings::LocalStorageEnabled, on);
+ if (wasOn != on)
+ Q_EMIT localStorageEnabledChanged();
+}
+
+void QQuickWebEngineSettings::setLocalContentCanAccessRemoteUrls(bool on)
+{
+ bool wasOn = d_ptr->testAttribute(QWebEngineSettings::LocalContentCanAccessRemoteUrls);
+ d_ptr->setAttribute(QWebEngineSettings::LocalContentCanAccessRemoteUrls, on);
+ if (wasOn != on)
+ Q_EMIT localContentCanAccessRemoteUrlsChanged();
+}
+
+
+void QQuickWebEngineSettings::setSpatialNavigationEnabled(bool on)
+{
+ bool wasOn = d_ptr->testAttribute(QWebEngineSettings::SpatialNavigationEnabled);
+ d_ptr->setAttribute(QWebEngineSettings::SpatialNavigationEnabled, on);
+ if (wasOn != on)
+ Q_EMIT spatialNavigationEnabledChanged();
+}
+
+void QQuickWebEngineSettings::setLocalContentCanAccessFileUrls(bool on)
+{
+ bool wasOn = d_ptr->testAttribute(QWebEngineSettings::LocalContentCanAccessFileUrls);
+ d_ptr->setAttribute(QWebEngineSettings::LocalContentCanAccessFileUrls, on);
+ if (wasOn != on)
+ Q_EMIT localContentCanAccessFileUrlsChanged();
+}
+
+void QQuickWebEngineSettings::setHyperlinkAuditingEnabled(bool on)
+{
+ bool wasOn = d_ptr->testAttribute(QWebEngineSettings::HyperlinkAuditingEnabled);
+ d_ptr->setAttribute(QWebEngineSettings::HyperlinkAuditingEnabled, on);
+ if (wasOn != on)
+ Q_EMIT hyperlinkAuditingEnabledChanged();
+}
+
+void QQuickWebEngineSettings::setErrorPageEnabled(bool on)
+{
+ bool wasOn = d_ptr->testAttribute(QWebEngineSettings::ErrorPageEnabled);
+ d_ptr->setAttribute(QWebEngineSettings::ErrorPageEnabled, on);
+ if (wasOn != on)
+ Q_EMIT errorPageEnabledChanged();
+}
+
+void QQuickWebEngineSettings::setPluginsEnabled(bool on)
+{
+ bool wasOn = d_ptr->testAttribute(QWebEngineSettings::PluginsEnabled);
+ d_ptr->setAttribute(QWebEngineSettings::PluginsEnabled, on);
+ if (wasOn != on)
+ Q_EMIT pluginsEnabledChanged();
+}
+
+void QQuickWebEngineSettings::setFullScreenSupportEnabled(bool on)
+{
+ bool wasOn = d_ptr->testAttribute(QWebEngineSettings::FullScreenSupportEnabled);
+ d_ptr->setAttribute(QWebEngineSettings::FullScreenSupportEnabled, on);
+ if (wasOn != on)
+ Q_EMIT fullScreenSupportEnabledChanged();
+}
+
+void QQuickWebEngineSettings::setScreenCaptureEnabled(bool on)
+{
+ bool wasOn = d_ptr->testAttribute(QWebEngineSettings::ScreenCaptureEnabled);
+ d_ptr->setAttribute(QWebEngineSettings::ScreenCaptureEnabled, on);
+ if (wasOn != on)
+ Q_EMIT screenCaptureEnabledChanged();
+}
+
+void QQuickWebEngineSettings::setWebGLEnabled(bool on)
+{
+ bool wasOn = d_ptr->testAttribute(QWebEngineSettings::WebGLEnabled);
+ d_ptr->setAttribute(QWebEngineSettings::WebGLEnabled, on);
+ if (wasOn != on)
+ Q_EMIT webGLEnabledChanged();
+}
+
+void QQuickWebEngineSettings::setAccelerated2dCanvasEnabled(bool on)
+{
+ bool wasOn = d_ptr->testAttribute(QWebEngineSettings::Accelerated2dCanvasEnabled);
+ d_ptr->setAttribute(QWebEngineSettings::Accelerated2dCanvasEnabled, on);
+ if (wasOn != on)
+ Q_EMIT accelerated2dCanvasEnabledChanged();
+}
+
+void QQuickWebEngineSettings::setAutoLoadIconsForPage(bool on)
+{
+ bool wasOn = d_ptr->testAttribute(QWebEngineSettings::AutoLoadIconsForPage);
+ d_ptr->setAttribute(QWebEngineSettings::AutoLoadIconsForPage, on);
+ if (wasOn != on)
+ Q_EMIT autoLoadIconsForPageChanged();
+}
+
+void QQuickWebEngineSettings::setTouchIconsEnabled(bool on)
+{
+ bool wasOn = d_ptr->testAttribute(QWebEngineSettings::TouchIconsEnabled);
+ d_ptr->setAttribute(QWebEngineSettings::TouchIconsEnabled, on);
+ if (wasOn != on)
+ Q_EMIT touchIconsEnabledChanged();
+}
+
+void QQuickWebEngineSettings::setPrintElementBackgrounds(bool on)
+{
+ bool wasOn = d_ptr->testAttribute(QWebEngineSettings::PrintElementBackgrounds);
+ d_ptr->setAttribute(QWebEngineSettings::PrintElementBackgrounds, on);
+ if (wasOn != on)
+ Q_EMIT printElementBackgroundsChanged();
+}
+
+void QQuickWebEngineSettings::setDefaultTextEncoding(QString encoding)
+{
+ const QString oldDefaultTextEncoding = d_ptr->defaultTextEncoding();
+ d_ptr->setDefaultTextEncoding(encoding);
+ if (oldDefaultTextEncoding.compare(encoding))
+ Q_EMIT defaultTextEncodingChanged();
+}
+
+void QQuickWebEngineSettings::setFocusOnNavigationEnabled(bool on)
+{
+ bool wasOn = d_ptr->testAttribute(QWebEngineSettings::FocusOnNavigationEnabled);
+ d_ptr->setAttribute(QWebEngineSettings::FocusOnNavigationEnabled, on);
+ if (wasOn != on)
+ Q_EMIT focusOnNavigationEnabledChanged();
+}
+
+
+void QQuickWebEngineSettings::setAllowRunningInsecureContent(bool on)
+{
+ bool wasOn = d_ptr->testAttribute(QWebEngineSettings::AllowRunningInsecureContent);
+ d_ptr->setAttribute(QWebEngineSettings::AllowRunningInsecureContent, on);
+ if (wasOn != on)
+ Q_EMIT allowRunningInsecureContentChanged();
+}
+
+void QQuickWebEngineSettings::setAllowGeolocationOnInsecureOrigins(bool on)
+{
+ bool wasOn = d_ptr->testAttribute(QWebEngineSettings::AllowGeolocationOnInsecureOrigins);
+ d_ptr->setAttribute(QWebEngineSettings::AllowGeolocationOnInsecureOrigins, on);
+ if (wasOn != on)
+ Q_EMIT allowGeolocationOnInsecureOriginsChanged();
+}
+
+void QQuickWebEngineSettings::setAllowWindowActivationFromJavaScript(bool on)
+{
+ bool wasOn = d_ptr->testAttribute(QWebEngineSettings::AllowWindowActivationFromJavaScript);
+ d_ptr->setAttribute(QWebEngineSettings::AllowWindowActivationFromJavaScript, on);
+ if (wasOn != on)
+ Q_EMIT allowWindowActivationFromJavaScriptChanged();
+}
+
+void QQuickWebEngineSettings::setShowScrollBars(bool on)
+{
+ bool wasOn = d_ptr->testAttribute(QWebEngineSettings::ShowScrollBars);
+ d_ptr->setAttribute(QWebEngineSettings::ShowScrollBars, on);
+ if (wasOn != on)
+ Q_EMIT showScrollBarsChanged();
+}
+
+void QQuickWebEngineSettings::setPlaybackRequiresUserGesture(bool on)
+{
+ bool wasOn = d_ptr->testAttribute(QWebEngineSettings::PlaybackRequiresUserGesture);
+ d_ptr->setAttribute(QWebEngineSettings::PlaybackRequiresUserGesture, on);
+ if (wasOn != on)
+ Q_EMIT playbackRequiresUserGestureChanged();
+}
+
+void QQuickWebEngineSettings::setJavascriptCanPaste(bool on)
+{
+ bool wasOn = d_ptr->testAttribute(QWebEngineSettings::JavascriptCanPaste);
+ d_ptr->setAttribute(QWebEngineSettings::JavascriptCanPaste, on);
+ if (wasOn != on)
+ Q_EMIT javascriptCanPasteChanged();
+}
+
+void QQuickWebEngineSettings::setDnsPrefetchEnabled(bool on)
+{
+ bool wasOn = d_ptr->testAttribute(QWebEngineSettings::DnsPrefetchEnabled);
+ d_ptr->setAttribute(QWebEngineSettings::DnsPrefetchEnabled, on);
+ if (wasOn != on)
+ Q_EMIT dnsPrefetchEnabledChanged();
+}
+
+void QQuickWebEngineSettings::setPdfViewerEnabled(bool on)
+{
+ bool wasOn = d_ptr->testAttribute(QWebEngineSettings::PdfViewerEnabled);
+ d_ptr->setAttribute(QWebEngineSettings::PdfViewerEnabled, on);
+ if (wasOn != on)
+ Q_EMIT pdfViewerEnabledChanged();
+}
+
+void QQuickWebEngineSettings::setNavigateOnDropEnabled(bool on)
+{
+ bool wasOn = d_ptr->testAttribute(QWebEngineSettings::NavigateOnDropEnabled);
+ d_ptr->setAttribute(QWebEngineSettings::NavigateOnDropEnabled, on);
+ if (wasOn != on)
+ Q_EMIT navigateOnDropEnabledChanged();
+}
+
+void QQuickWebEngineSettings::setReadingFromCanvasEnabled(bool on)
+{
+ bool wasOn = d_ptr->testAttribute(QWebEngineSettings::ReadingFromCanvasEnabled);
+ d_ptr->setAttribute(QWebEngineSettings::ReadingFromCanvasEnabled, on);
+ if (wasOn != on)
+ Q_EMIT readingFromCanvasEnabledChanged();
+}
+
+void QQuickWebEngineSettings::setForceDarkMode(bool on)
+{
+ bool wasOn = d_ptr->testAttribute(QWebEngineSettings::ForceDarkMode);
+ d_ptr->setAttribute(QWebEngineSettings::ForceDarkMode, on);
+ if (wasOn != on)
+ Q_EMIT forceDarkModeChanged();
+}
+
+void QQuickWebEngineSettings::setScrollAnimatorEnabled(bool on)
+{
+ bool wasOn = d_ptr->testAttribute(QWebEngineSettings::ScrollAnimatorEnabled);
+ d_ptr->setAttribute(QWebEngineSettings::ScrollAnimatorEnabled, on);
+ if (wasOn != on)
+ Q_EMIT scrollAnimatorEnabledChanged();
+}
+
+void QQuickWebEngineSettings::setUnknownUrlSchemePolicy(QQuickWebEngineSettings::UnknownUrlSchemePolicy policy)
+{
+ QWebEngineSettings::UnknownUrlSchemePolicy oldPolicy = d_ptr->unknownUrlSchemePolicy();
+ QWebEngineSettings::UnknownUrlSchemePolicy newPolicy = static_cast<QWebEngineSettings::UnknownUrlSchemePolicy>(policy);
+ d_ptr->setUnknownUrlSchemePolicy(newPolicy);
+ if (oldPolicy != newPolicy)
+ Q_EMIT unknownUrlSchemePolicyChanged();
+}
+
+void QQuickWebEngineSettings::setWebRTCPublicInterfacesOnly(bool on)
+{
+ bool wasOn = d_ptr->testAttribute(QWebEngineSettings::WebRTCPublicInterfacesOnly);
+ d_ptr->setAttribute(QWebEngineSettings::WebRTCPublicInterfacesOnly, on);
+ if (wasOn != on)
+ Q_EMIT webRTCPublicInterfacesOnlyChanged();
+}
+
+void QQuickWebEngineSettings::setParentSettings(QQuickWebEngineSettings *parentSettings)
+{
+ d_ptr->setParentSettings(parentSettings->d_ptr.data());
+}
+
+void QQuickWebEngineSettings::setImageAnimationPolicy(
+ QQuickWebEngineSettings::ImageAnimationPolicy policy)
+{
+ QWebEngineSettings::ImageAnimationPolicy oldPolicy = d_ptr->imageAnimationPolicy();
+ QWebEngineSettings::ImageAnimationPolicy newPolicy =
+ static_cast<QWebEngineSettings::ImageAnimationPolicy>(policy);
+ d_ptr->setImageAnimationPolicy(newPolicy);
+ if (oldPolicy != newPolicy)
+ Q_EMIT imageAnimationPolicyChanged();
+}
+
+QT_END_NAMESPACE
+
+#include "moc_qquickwebenginesettings_p.cpp"
diff --git a/src/webenginequick/api/qquickwebenginesettings_p.h b/src/webenginequick/api/qquickwebenginesettings_p.h
new file mode 100644
index 000000000..ed3c77884
--- /dev/null
+++ b/src/webenginequick/api/qquickwebenginesettings_p.h
@@ -0,0 +1,212 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QQUICKWEBENGINESETTINGS_P_H
+#define QQUICKWEBENGINESETTINGS_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qobject.h>
+#include <QtCore/qscopedpointer.h>
+#include <QtQml/qqmlregistration.h>
+#include <QtWebEngineQuick/private/qtwebenginequickglobal_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QWebEngineSettings;
+class Q_WEBENGINEQUICK_EXPORT QQuickWebEngineSettings : public QObject {
+ Q_OBJECT
+ Q_PROPERTY(bool autoLoadImages READ autoLoadImages WRITE setAutoLoadImages NOTIFY autoLoadImagesChanged FINAL)
+ Q_PROPERTY(bool javascriptEnabled READ javascriptEnabled WRITE setJavascriptEnabled NOTIFY javascriptEnabledChanged FINAL)
+ Q_PROPERTY(bool javascriptCanOpenWindows READ javascriptCanOpenWindows WRITE setJavascriptCanOpenWindows NOTIFY javascriptCanOpenWindowsChanged FINAL)
+ Q_PROPERTY(bool javascriptCanAccessClipboard READ javascriptCanAccessClipboard WRITE setJavascriptCanAccessClipboard NOTIFY javascriptCanAccessClipboardChanged FINAL)
+ Q_PROPERTY(bool linksIncludedInFocusChain READ linksIncludedInFocusChain WRITE setLinksIncludedInFocusChain NOTIFY linksIncludedInFocusChainChanged FINAL)
+ Q_PROPERTY(bool localStorageEnabled READ localStorageEnabled WRITE setLocalStorageEnabled NOTIFY localStorageEnabledChanged FINAL)
+ Q_PROPERTY(bool localContentCanAccessRemoteUrls READ localContentCanAccessRemoteUrls WRITE setLocalContentCanAccessRemoteUrls NOTIFY localContentCanAccessRemoteUrlsChanged FINAL)
+ Q_PROPERTY(bool spatialNavigationEnabled READ spatialNavigationEnabled WRITE setSpatialNavigationEnabled NOTIFY spatialNavigationEnabledChanged FINAL)
+ Q_PROPERTY(bool localContentCanAccessFileUrls READ localContentCanAccessFileUrls WRITE setLocalContentCanAccessFileUrls NOTIFY localContentCanAccessFileUrlsChanged FINAL)
+ Q_PROPERTY(bool hyperlinkAuditingEnabled READ hyperlinkAuditingEnabled WRITE setHyperlinkAuditingEnabled NOTIFY hyperlinkAuditingEnabledChanged FINAL)
+ Q_PROPERTY(bool errorPageEnabled READ errorPageEnabled WRITE setErrorPageEnabled NOTIFY errorPageEnabledChanged FINAL)
+ Q_PROPERTY(bool pluginsEnabled READ pluginsEnabled WRITE setPluginsEnabled NOTIFY pluginsEnabledChanged FINAL)
+ Q_PROPERTY(bool fullScreenSupportEnabled READ fullScreenSupportEnabled WRITE setFullScreenSupportEnabled NOTIFY fullScreenSupportEnabledChanged REVISION(1,1) FINAL)
+ Q_PROPERTY(QString defaultTextEncoding READ defaultTextEncoding WRITE setDefaultTextEncoding NOTIFY defaultTextEncodingChanged FINAL)
+ Q_PROPERTY(bool screenCaptureEnabled READ screenCaptureEnabled WRITE setScreenCaptureEnabled NOTIFY screenCaptureEnabledChanged REVISION(1,2) FINAL)
+ Q_PROPERTY(bool webGLEnabled READ webGLEnabled WRITE setWebGLEnabled NOTIFY webGLEnabledChanged REVISION(1,2) FINAL)
+ Q_PROPERTY(bool accelerated2dCanvasEnabled READ accelerated2dCanvasEnabled WRITE setAccelerated2dCanvasEnabled NOTIFY accelerated2dCanvasEnabledChanged REVISION(1,2) FINAL)
+ Q_PROPERTY(bool autoLoadIconsForPage READ autoLoadIconsForPage WRITE setAutoLoadIconsForPage NOTIFY autoLoadIconsForPageChanged REVISION(1,2) FINAL)
+ Q_PROPERTY(bool touchIconsEnabled READ touchIconsEnabled WRITE setTouchIconsEnabled NOTIFY touchIconsEnabledChanged REVISION(1,2) FINAL)
+ Q_PROPERTY(bool focusOnNavigationEnabled READ focusOnNavigationEnabled WRITE setFocusOnNavigationEnabled NOTIFY focusOnNavigationEnabledChanged REVISION(1,3) FINAL)
+ Q_PROPERTY(bool printElementBackgrounds READ printElementBackgrounds WRITE setPrintElementBackgrounds NOTIFY printElementBackgroundsChanged REVISION(1,3) FINAL)
+ Q_PROPERTY(bool allowRunningInsecureContent READ allowRunningInsecureContent WRITE setAllowRunningInsecureContent NOTIFY allowRunningInsecureContentChanged REVISION(1,3) FINAL)
+ Q_PROPERTY(bool allowGeolocationOnInsecureOrigins READ allowGeolocationOnInsecureOrigins WRITE setAllowGeolocationOnInsecureOrigins NOTIFY allowGeolocationOnInsecureOriginsChanged REVISION(1,4) FINAL)
+ Q_PROPERTY(bool allowWindowActivationFromJavaScript READ allowWindowActivationFromJavaScript WRITE setAllowWindowActivationFromJavaScript NOTIFY allowWindowActivationFromJavaScriptChanged REVISION(1,5) FINAL)
+ Q_PROPERTY(bool showScrollBars READ showScrollBars WRITE setShowScrollBars NOTIFY showScrollBarsChanged REVISION(1,5) FINAL)
+ Q_PROPERTY(UnknownUrlSchemePolicy unknownUrlSchemePolicy READ unknownUrlSchemePolicy WRITE setUnknownUrlSchemePolicy NOTIFY unknownUrlSchemePolicyChanged REVISION(1,6) FINAL)
+ Q_PROPERTY(bool playbackRequiresUserGesture READ playbackRequiresUserGesture WRITE setPlaybackRequiresUserGesture NOTIFY playbackRequiresUserGestureChanged REVISION(1,6) FINAL)
+ Q_PROPERTY(bool webRTCPublicInterfacesOnly READ webRTCPublicInterfacesOnly WRITE setWebRTCPublicInterfacesOnly NOTIFY webRTCPublicInterfacesOnlyChanged REVISION(1,6) FINAL)
+ Q_PROPERTY(bool javascriptCanPaste READ javascriptCanPaste WRITE setJavascriptCanPaste NOTIFY javascriptCanPasteChanged REVISION(1,6) FINAL)
+ Q_PROPERTY(bool dnsPrefetchEnabled READ dnsPrefetchEnabled WRITE setDnsPrefetchEnabled NOTIFY dnsPrefetchEnabledChanged REVISION(1,7) FINAL)
+ Q_PROPERTY(bool pdfViewerEnabled READ pdfViewerEnabled WRITE setPdfViewerEnabled NOTIFY pdfViewerEnabledChanged REVISION(1,8) FINAL)
+ Q_PROPERTY(bool navigateOnDropEnabled READ navigateOnDropEnabled WRITE setNavigateOnDropEnabled NOTIFY navigateOnDropEnabledChanged REVISION(6,4) FINAL)
+ Q_PROPERTY(bool readingFromCanvasEnabled READ readingFromCanvasEnabled WRITE setReadingFromCanvasEnabled NOTIFY readingFromCanvasEnabledChanged REVISION(6,6) FINAL)
+ Q_PROPERTY(bool forceDarkMode READ forceDarkMode WRITE setForceDarkMode NOTIFY forceDarkModeChanged REVISION(6,7) FINAL)
+ Q_PROPERTY(bool scrollAnimatorEnabled READ scrollAnimatorEnabled WRITE setScrollAnimatorEnabled NOTIFY scrollAnimatorEnabledChanged REVISION(6,8) FINAL)
+ Q_PROPERTY(ImageAnimationPolicy imageAnimationPolicy READ imageAnimationPolicy WRITE setImageAnimationPolicy NOTIFY imageAnimationPolicyChanged REVISION(6,8) FINAL)
+ QML_NAMED_ELEMENT(WebEngineSettings)
+ QML_ADDED_IN_VERSION(1, 1)
+ QML_EXTRA_VERSION(2, 0)
+ QML_UNCREATABLE("")
+public:
+ enum UnknownUrlSchemePolicy {
+ DisallowUnknownUrlSchemes = 1,
+ AllowUnknownUrlSchemesFromUserInteraction,
+ AllowAllUnknownUrlSchemes
+ };
+
+ Q_ENUM(UnknownUrlSchemePolicy)
+
+ enum ImageAnimationPolicy {
+ AllowImageAnimation = 1,
+ AnimateImageOnce,
+ DisallowImageAnimation
+ };
+
+ Q_ENUM(ImageAnimationPolicy)
+
+ ~QQuickWebEngineSettings();
+
+ bool autoLoadImages() const;
+ bool javascriptEnabled() const;
+ bool javascriptCanOpenWindows() const;
+ bool javascriptCanAccessClipboard() const;
+ bool linksIncludedInFocusChain() const;
+ bool localStorageEnabled() const;
+ bool localContentCanAccessRemoteUrls() const;
+ bool spatialNavigationEnabled() const;
+ bool localContentCanAccessFileUrls() const;
+ bool hyperlinkAuditingEnabled() const;
+ bool errorPageEnabled() const;
+ bool pluginsEnabled() const;
+ bool fullScreenSupportEnabled() const;
+ QString defaultTextEncoding() const;
+ bool screenCaptureEnabled() const;
+ bool webGLEnabled() const;
+ bool accelerated2dCanvasEnabled() const;
+ bool autoLoadIconsForPage() const;
+ bool touchIconsEnabled() const;
+ bool focusOnNavigationEnabled() const;
+ bool printElementBackgrounds() const;
+ bool allowRunningInsecureContent() const;
+ bool allowGeolocationOnInsecureOrigins() const;
+ bool allowWindowActivationFromJavaScript() const;
+ bool showScrollBars() const;
+ UnknownUrlSchemePolicy unknownUrlSchemePolicy() const;
+ bool playbackRequiresUserGesture() const;
+ bool webRTCPublicInterfacesOnly() const;
+ bool javascriptCanPaste() const;
+ bool dnsPrefetchEnabled() const;
+ bool pdfViewerEnabled() const;
+ bool navigateOnDropEnabled() const;
+ bool readingFromCanvasEnabled() const;
+ bool forceDarkMode() const;
+ bool scrollAnimatorEnabled() const;
+ ImageAnimationPolicy imageAnimationPolicy() const;
+
+ void setAutoLoadImages(bool on);
+ void setJavascriptEnabled(bool on);
+ void setJavascriptCanOpenWindows(bool on);
+ void setJavascriptCanAccessClipboard(bool on);
+ void setLinksIncludedInFocusChain(bool on);
+ void setLocalStorageEnabled(bool on);
+ void setLocalContentCanAccessRemoteUrls(bool on);
+ void setSpatialNavigationEnabled(bool on);
+ void setLocalContentCanAccessFileUrls(bool on);
+ void setHyperlinkAuditingEnabled(bool on);
+ void setErrorPageEnabled(bool on);
+ void setPluginsEnabled(bool on);
+ void setFullScreenSupportEnabled(bool on);
+ void setDefaultTextEncoding(QString encoding);
+ void setScreenCaptureEnabled(bool on);
+ void setWebGLEnabled(bool on);
+ void setAccelerated2dCanvasEnabled(bool on);
+ void setAutoLoadIconsForPage(bool on);
+ void setTouchIconsEnabled(bool on);
+ void setFocusOnNavigationEnabled(bool on);
+ void setPrintElementBackgrounds(bool on);
+ void setAllowRunningInsecureContent(bool on);
+ void setAllowGeolocationOnInsecureOrigins(bool on);
+ void setAllowWindowActivationFromJavaScript(bool on);
+ void setShowScrollBars(bool on);
+ void setUnknownUrlSchemePolicy(UnknownUrlSchemePolicy policy);
+ void setPlaybackRequiresUserGesture(bool on);
+ void setWebRTCPublicInterfacesOnly(bool on);
+ void setJavascriptCanPaste(bool on);
+ void setDnsPrefetchEnabled(bool on);
+ void setPdfViewerEnabled(bool on);
+ void setNavigateOnDropEnabled(bool on);
+ void setReadingFromCanvasEnabled(bool on);
+ void setForceDarkMode(bool on);
+ void setScrollAnimatorEnabled(bool on);
+ void setImageAnimationPolicy(ImageAnimationPolicy policy);
+
+signals:
+ void autoLoadImagesChanged();
+ void javascriptEnabledChanged();
+ void javascriptCanOpenWindowsChanged();
+ void javascriptCanAccessClipboardChanged();
+ void linksIncludedInFocusChainChanged();
+ void localStorageEnabledChanged();
+ void localContentCanAccessRemoteUrlsChanged();
+ void spatialNavigationEnabledChanged();
+ void localContentCanAccessFileUrlsChanged();
+ void hyperlinkAuditingEnabledChanged();
+ void errorPageEnabledChanged();
+ void pluginsEnabledChanged();
+ Q_REVISION(1,1) void fullScreenSupportEnabledChanged();
+ void defaultTextEncodingChanged();
+ Q_REVISION(1,2) void screenCaptureEnabledChanged();
+ Q_REVISION(1,2) void webGLEnabledChanged();
+ Q_REVISION(1,2) void accelerated2dCanvasEnabledChanged();
+ Q_REVISION(1,2) void autoLoadIconsForPageChanged();
+ Q_REVISION(1,2) void touchIconsEnabledChanged();
+ Q_REVISION(1,3) void focusOnNavigationEnabledChanged();
+ Q_REVISION(1,3) void printElementBackgroundsChanged();
+ Q_REVISION(1,3) void allowRunningInsecureContentChanged();
+ Q_REVISION(1,4) void allowGeolocationOnInsecureOriginsChanged();
+ Q_REVISION(1,5) void allowWindowActivationFromJavaScriptChanged();
+ Q_REVISION(1,5) void showScrollBarsChanged();
+ Q_REVISION(1,6) void unknownUrlSchemePolicyChanged();
+ Q_REVISION(1,6) void playbackRequiresUserGestureChanged();
+ Q_REVISION(1,6) void webRTCPublicInterfacesOnlyChanged();
+ Q_REVISION(1,6) void javascriptCanPasteChanged();
+ Q_REVISION(1,7) void dnsPrefetchEnabledChanged();
+ Q_REVISION(1,8) void pdfViewerEnabledChanged();
+ Q_REVISION(6,4) void navigateOnDropEnabledChanged();
+ Q_REVISION(6,6) void readingFromCanvasEnabledChanged();
+ Q_REVISION(6,7) void forceDarkModeChanged();
+ Q_REVISION(6,8) void scrollAnimatorEnabledChanged();
+ Q_REVISION(6,8) void imageAnimationPolicyChanged();
+
+private:
+ explicit QQuickWebEngineSettings(QQuickWebEngineSettings *parentSettings = nullptr);
+ Q_DISABLE_COPY(QQuickWebEngineSettings)
+ friend class QQuickWebEngineProfilePrivate;
+ friend class QQuickWebEngineViewPrivate;
+ friend class QQuickWebEngineView;
+ void setParentSettings(QQuickWebEngineSettings *parentSettings);
+
+ QScopedPointer<QWebEngineSettings> d_ptr;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQUICKWEBENGINESETTINGS_P_H
diff --git a/src/webenginequick/api/qquickwebenginesingleton.cpp b/src/webenginequick/api/qquickwebenginesingleton.cpp
new file mode 100644
index 000000000..a51d2aca4
--- /dev/null
+++ b/src/webenginequick/api/qquickwebenginesingleton.cpp
@@ -0,0 +1,87 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qquickwebengineprofile.h"
+#include "qquickwebenginesettings_p.h"
+#include "qquickwebenginesingleton_p.h"
+
+#include <QtQml/qqmlcontext.h>
+#include <QtQml/qqmlengine.h>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \qmltype WebEngine
+ //! \instantiates QQuickWebEngineSingleton
+ \inqmlmodule QtWebEngine
+ \since QtWebEngine 1.1
+ \brief Provides access to the default settings and profiles shared by all web engine views.
+
+ The WebEngine singleton type provides access to the default profile and the default settings
+ shared by all web engine views. It can be used to change settings globally, as illustrated by
+ the following code snippet:
+
+ \code
+ Component.onCompleted: {
+ WebEngine.settings.pluginsEnabled = true;
+ }
+ \endcode
+*/
+
+/*!
+ \qmlproperty WebEngineSettings WebEngine::settings
+ \readonly
+ \since QtWebEngine 1.1
+
+ Default settings for all web engine views.
+
+ \sa WebEngineSettings
+*/
+
+QQuickWebEngineSettings *QQuickWebEngineSingleton::settings() const
+{
+ return defaultProfile()->settings();
+}
+
+/*!
+ \qmlproperty WebEngineProfile WebEngine::defaultProfile
+ \readonly
+ \since QtWebEngine 1.1
+
+ Default profile for all web engine views.
+
+ \sa WebEngineProfile
+*/
+QQuickWebEngineProfile *QQuickWebEngineSingleton::defaultProfile() const
+{
+ auto profile = QQuickWebEngineProfile::defaultProfile();
+
+ // MEMO first ever call to default profile will create one without context
+ // it needs something to get qml engine from (WebEngine singleton is created in qml land)
+ profile->ensureQmlContext(this);
+
+ return profile;
+}
+
+/*!
+ \qmlmethod WebEngineScript WebEngine::script
+ //! \instantiates QWebEngineScript
+ \since QtWebEngine 6.2
+
+ Constructs WebEngineScript, which can be set up and inserted into user scripts' collection
+ for \l{WebEngineView::userScripts}{WebEngineView.userScripts} or
+ \l{WebEngineProfile::userScripts}{WebEngineProfile.userScripts}
+ using \l{WebEngineScriptCollection}.
+
+ \sa WebEngineScript WebEngineScriptCollection
+*/
+
+QWebEngineScript QQuickWebEngineSingleton::script() const
+{
+ return QWebEngineScript();
+}
+
+QT_END_NAMESPACE
+
+#include "moc_qquickwebenginesingleton_p.cpp"
+
diff --git a/src/webenginequick/api/qquickwebenginesingleton_p.h b/src/webenginequick/api/qquickwebenginesingleton_p.h
new file mode 100644
index 000000000..b05daecd6
--- /dev/null
+++ b/src/webenginequick/api/qquickwebenginesingleton_p.h
@@ -0,0 +1,44 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QQUICKWEBENGINESINGLETON_P_H
+#define QQUICKWEBENGINESINGLETON_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qobject.h>
+#include <QtQml/qqml.h>
+#include <QtWebEngineCore/qwebenginescript.h>
+#include <QtWebEngineQuick/private/qtwebenginequickglobal_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQuickWebEngineSettings;
+class QQuickWebEngineProfile;
+
+class Q_WEBENGINEQUICK_EXPORT QQuickWebEngineSingleton : public QObject {
+ Q_OBJECT
+ Q_PROPERTY(QQuickWebEngineSettings* settings READ settings CONSTANT FINAL)
+ Q_PROPERTY(QQuickWebEngineProfile* defaultProfile READ defaultProfile CONSTANT FINAL REVISION(1,1))
+ QML_SINGLETON
+ QML_NAMED_ELEMENT(WebEngine)
+ QML_ADDED_IN_VERSION(1, 1)
+ QML_EXTRA_VERSION(2, 0)
+public:
+ QQuickWebEngineSettings *settings() const;
+ QQuickWebEngineProfile *defaultProfile() const;
+ Q_INVOKABLE QWebEngineScript script() const;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQUICKWEBENGINESINGLETON_P_H
diff --git a/src/webenginequick/api/qquickwebenginetouchhandle.cpp b/src/webenginequick/api/qquickwebenginetouchhandle.cpp
new file mode 100644
index 000000000..473463fa3
--- /dev/null
+++ b/src/webenginequick/api/qquickwebenginetouchhandle.cpp
@@ -0,0 +1,45 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qquickwebenginetouchhandle_p.h"
+#include "qquickwebenginetouchhandleprovider_p_p.h"
+#include "web_contents_adapter_client.h"
+#include <QtQuick/qquickitem.h>
+
+QT_BEGIN_NAMESPACE
+
+QQuickWebEngineTouchHandle::QQuickWebEngineTouchHandle() : QObject(nullptr), m_hasImage(false) { }
+
+void QQuickWebEngineTouchHandle::setBounds(const QRect &bounds)
+{
+ m_item->setX(bounds.x());
+ m_item->setY(bounds.y());
+ m_item->setWidth(bounds.width());
+ m_item->setHeight(bounds.height());
+}
+
+void QQuickWebEngineTouchHandle::setOpacity(float opacity)
+{
+ m_item->setOpacity(opacity);
+}
+
+void QQuickWebEngineTouchHandle::setImage(int orientation)
+{
+ if (m_hasImage) {
+ QUrl url = QQuickWebEngineTouchHandleProvider::url(orientation);
+ m_item->setProperty("source", url);
+ }
+}
+
+void QQuickWebEngineTouchHandle::setVisible(bool visible)
+{
+ m_item->setVisible(visible);
+}
+
+void QQuickWebEngineTouchHandle::setItem(QQuickItem *item, bool hasImage)
+{
+ m_hasImage = hasImage;
+ m_item.reset(item);
+}
+
+QT_END_NAMESPACE
diff --git a/src/webenginequick/api/qquickwebenginetouchhandle_p.h b/src/webenginequick/api/qquickwebenginetouchhandle_p.h
new file mode 100644
index 000000000..d1deceae3
--- /dev/null
+++ b/src/webenginequick/api/qquickwebenginetouchhandle_p.h
@@ -0,0 +1,47 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QQUICKWEBENGINETOUCHHANDLE_P_H
+#define QQUICKWEBENGINETOUCHHANDLE_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+#include "touch_handle_drawable_client.h"
+#include <QtQml/qqmlregistration.h>
+#include <QtCore/qrect.h>
+#include <QtCore/qobject.h>
+
+namespace QtWebEngineCore {
+class WebContentsAdapterClient;
+}
+
+QT_BEGIN_NAMESPACE
+
+class QQuickItem;
+class QQuickWebEngineTouchHandle : public QtWebEngineCore::TouchHandleDrawableDelegate,
+ public QObject
+{
+public:
+ QQuickWebEngineTouchHandle();
+ void setImage(int orintation) override;
+ void setBounds(const QRect &bounds) override;
+ void setVisible(bool visible) override;
+ void setOpacity(float opacity) override;
+ void setItem(QQuickItem *item, bool hasImage);
+
+private:
+ QScopedPointer<QQuickItem> m_item;
+ bool m_hasImage;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQUICKWEBENGINETOUCHHANDLE_P_H
diff --git a/src/webenginequick/api/qquickwebenginetouchhandleprovider.cpp b/src/webenginequick/api/qquickwebenginetouchhandleprovider.cpp
new file mode 100644
index 000000000..099fa8876
--- /dev/null
+++ b/src/webenginequick/api/qquickwebenginetouchhandleprovider.cpp
@@ -0,0 +1,44 @@
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qquickwebenginetouchhandleprovider_p_p.h"
+
+// static
+QString QQuickWebEngineTouchHandleProvider::identifier()
+{
+ return QStringLiteral("touchhandle");
+}
+
+// static
+QUrl QQuickWebEngineTouchHandleProvider::url(int orientation)
+{
+ return QUrl(QStringLiteral("image://%1/%2").arg(identifier(), QString::number(orientation)));
+}
+
+QQuickWebEngineTouchHandleProvider::QQuickWebEngineTouchHandleProvider()
+ : QQuickImageProvider(QQuickImageProvider::Image)
+{
+}
+
+QQuickWebEngineTouchHandleProvider::~QQuickWebEngineTouchHandleProvider()
+{
+}
+
+void QQuickWebEngineTouchHandleProvider::init(const QMap<int, QImage> &images)
+{
+ if (!m_touchHandleMap.empty()) {
+ Q_ASSERT(images.size() == m_touchHandleMap.size());
+ return;
+ }
+
+ m_touchHandleMap = images;
+}
+
+QImage QQuickWebEngineTouchHandleProvider::requestImage(const QString &id, QSize *size, const QSize &requestedSize)
+{
+ Q_UNUSED(size);
+ Q_UNUSED(requestedSize);
+
+ Q_ASSERT(m_touchHandleMap.contains(id.toInt()));
+ return m_touchHandleMap.value(id.toInt());
+}
diff --git a/src/webenginequick/api/qquickwebenginetouchhandleprovider_p_p.h b/src/webenginequick/api/qquickwebenginetouchhandleprovider_p_p.h
new file mode 100644
index 000000000..92a13b08e
--- /dev/null
+++ b/src/webenginequick/api/qquickwebenginetouchhandleprovider_p_p.h
@@ -0,0 +1,41 @@
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QQUICKWEBENGINETOUCHHANDLEPROVIDER_P_P_H
+#define QQUICKWEBENGINETOUCHHANDLEPROVIDER_P_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQuick/qquickimageprovider.h>
+#include <QtWebEngineQuick/private/qtwebenginequickglobal_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_WEBENGINEQUICK_EXPORT QQuickWebEngineTouchHandleProvider : public QQuickImageProvider {
+public:
+ static QString identifier();
+ static QUrl url(int orientation);
+
+ QQuickWebEngineTouchHandleProvider();
+ ~QQuickWebEngineTouchHandleProvider();
+
+ void init(const QMap<int, QImage> &images);
+ QImage requestImage(const QString &id, QSize *size, const QSize &requestedSize) override;
+
+private:
+ QMap<int, QImage> m_touchHandleMap;
+};
+
+
+QT_END_NAMESPACE
+
+#endif // QQUICKWEBENGINETOUCHHANDLEPROVIDER_P_P_H
diff --git a/src/webenginequick/api/qquickwebenginetouchselectionmenurequest.cpp b/src/webenginequick/api/qquickwebenginetouchselectionmenurequest.cpp
new file mode 100644
index 000000000..70519525d
--- /dev/null
+++ b/src/webenginequick/api/qquickwebenginetouchselectionmenurequest.cpp
@@ -0,0 +1,108 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qquickwebenginetouchselectionmenurequest_p.h"
+#include "qquickwebenginetouchselectionmenurequest_p_p.h"
+#include "touch_selection_menu_controller.h"
+
+QT_BEGIN_NAMESPACE
+
+ASSERT_ENUMS_MATCH(QQuickWebEngineTouchSelectionMenuRequest::Cut,
+ QtWebEngineCore::TouchSelectionMenuController::TouchSelectionCommandFlag::Cut)
+ASSERT_ENUMS_MATCH(QQuickWebEngineTouchSelectionMenuRequest::Copy,
+ QtWebEngineCore::TouchSelectionMenuController::TouchSelectionCommandFlag::Copy)
+ASSERT_ENUMS_MATCH(QQuickWebEngineTouchSelectionMenuRequest::Paste,
+ QtWebEngineCore::TouchSelectionMenuController::TouchSelectionCommandFlag::Paste)
+
+/*!
+ \class QQuickWebEngineTouchSelectionMenuRequest
+ \since 6.3
+ \brief The QQuickWebEngineTouchSelectionMenuRequest class provides request for a touch selection menu.
+ \inmodule QtWebEngineQuick
+ QQuickWebEngineTouchSelectionMenuRequest is returned after a touch selection event,
+ and contains information about where the bounding box of touch selection is and what
+ actions are available.
+
+ \internal
+*/
+
+/*!
+ \enum QQuickWebEngineTouchSelectionMenuRequest::TouchSelectionCommandFlag
+ \readonly
+ \since 6.3
+
+ The available operations in the current touch selection menu request.
+
+ \value Cut Cut is available.
+ \value Copy Copy is available.
+ \value Paste Paste is available.
+*/
+QQuickWebEngineTouchSelectionMenuRequest::QQuickWebEngineTouchSelectionMenuRequest(
+ QRect bounds, QtWebEngineCore::TouchSelectionMenuController *touchSelectionMenuController)
+ : d(new QQuickWebEngineTouchSelectionMenuRequestPrivate(bounds, touchSelectionMenuController))
+{
+}
+
+QQuickWebEngineTouchSelectionMenuRequestPrivate::QQuickWebEngineTouchSelectionMenuRequestPrivate(
+ QRect bounds, QtWebEngineCore::TouchSelectionMenuController *touchSelectionMenuController)
+{
+ selectionBounds = bounds;
+ buttonCount = touchSelectionMenuController->buttonCount();
+ touchSelectionCommandFlags = touchSelectionMenuController->availableActions();
+}
+
+/*!
+ Destroys the touch selection menu request.
+*/
+QQuickWebEngineTouchSelectionMenuRequest::~QQuickWebEngineTouchSelectionMenuRequest()
+{
+}
+
+/*!
+ Returns the number of buttons that must be displayed, based on the available actions.
+*/
+int QQuickWebEngineTouchSelectionMenuRequest::buttonCount()
+{
+ return d->buttonCount;
+}
+
+/*!
+ Indicates whether the touch selection menu request has been
+ accepted by the signal handler.
+
+ If the property is \c false after any signal handlers
+ for WebEngineView::touchSelectionMenuRequested have been executed,
+ a default touch selection menu will be shown.
+ To prevent this, set \c{request.accepted} to \c true.
+
+ The default is \c false.
+*/
+bool QQuickWebEngineTouchSelectionMenuRequest::isAccepted() const
+{
+ return d->accepted;
+}
+
+void QQuickWebEngineTouchSelectionMenuRequest::setAccepted(bool accepted)
+{
+ d->accepted = accepted;
+}
+
+/*!
+ Returns the bound rectangle of text selection.
+*/
+QRect QQuickWebEngineTouchSelectionMenuRequest::selectionBounds()
+{
+ return d->selectionBounds;
+}
+
+/*!
+ Returns the available operations in the current context.
+*/
+QQuickWebEngineTouchSelectionMenuRequest::TouchSelectionCommandFlags QQuickWebEngineTouchSelectionMenuRequest::touchSelectionCommandFlags() const
+{
+ return static_cast<QQuickWebEngineTouchSelectionMenuRequest::TouchSelectionCommandFlags>(d->touchSelectionCommandFlags);
+}
+
+QT_END_NAMESPACE
+
+#include "moc_qquickwebenginetouchselectionmenurequest_p.cpp"
diff --git a/src/webenginequick/api/qquickwebenginetouchselectionmenurequest_p.h b/src/webenginequick/api/qquickwebenginetouchselectionmenurequest_p.h
new file mode 100644
index 000000000..c7decafe1
--- /dev/null
+++ b/src/webenginequick/api/qquickwebenginetouchselectionmenurequest_p.h
@@ -0,0 +1,66 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QQUICKWEBENGINETOUCHSELECTIONMENUREQUEST_P_H
+#define QQUICKWEBENGINETOUCHSELECTIONMENUREQUEST_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtWebEngineQuick/qtwebenginequickglobal.h>
+#include <QtCore/qobject.h>
+#include <QtCore/qscopedpointer.h>
+#include <QtQml/qqmlregistration.h>
+
+namespace QtWebEngineCore {
+class TouchSelectionMenuController;
+}
+
+QT_BEGIN_NAMESPACE
+
+class QQuickWebEngineTouchSelectionMenuRequestPrivate;
+
+class Q_WEBENGINEQUICK_EXPORT QQuickWebEngineTouchSelectionMenuRequest : public QObject
+{
+ Q_OBJECT
+public:
+ enum TouchSelectionCommandFlag {
+ Cut = 0x1,
+ Copy = 0x2,
+ Paste = 0x4
+ };
+
+ Q_DECLARE_FLAGS(TouchSelectionCommandFlags, TouchSelectionCommandFlag)
+ Q_FLAG(TouchSelectionCommandFlags)
+ Q_PROPERTY(bool accepted READ isAccepted WRITE setAccepted FINAL)
+ Q_PROPERTY(QRect selectionBounds READ selectionBounds CONSTANT FINAL REVISION(1))
+ Q_PROPERTY(TouchSelectionCommandFlags touchSelectionCommandFlags READ touchSelectionCommandFlags CONSTANT FINAL REVISION(1))
+ QML_NAMED_ELEMENT(TouchSelectionMenuRequest)
+ QML_ADDED_IN_VERSION(6, 3)
+ QML_UNCREATABLE("")
+
+ QQuickWebEngineTouchSelectionMenuRequest(QRect bounds,
+ QtWebEngineCore::TouchSelectionMenuController *touchSelectionMenuController);
+ ~QQuickWebEngineTouchSelectionMenuRequest();
+
+ int buttonCount();
+ bool isAccepted() const;
+ void setAccepted(bool accepted);
+ QRect selectionBounds();
+ TouchSelectionCommandFlags touchSelectionCommandFlags() const;
+
+private:
+ QScopedPointer<QQuickWebEngineTouchSelectionMenuRequestPrivate> d;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQUICKWEBENGINETOUCHSELECTIONMENUREQUEST_P_H
diff --git a/src/webenginequick/api/qquickwebenginetouchselectionmenurequest_p_p.h b/src/webenginequick/api/qquickwebenginetouchselectionmenurequest_p_p.h
new file mode 100644
index 000000000..f8eba652e
--- /dev/null
+++ b/src/webenginequick/api/qquickwebenginetouchselectionmenurequest_p_p.h
@@ -0,0 +1,43 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QQUICKWEBENGINETOUCHSELECTIONMENUREQUEST_P_P_H
+#define QQUICKWEBENGINETOUCHSELECTIONMENUREQUEST_P_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtWebEngineQuick/private/qquickwebengineview_p.h>
+#include "qquickwebenginetouchselectionmenurequest_p.h"
+
+namespace QtWebEngineCore {
+class TouchSelectionMenuController;
+}
+
+QT_BEGIN_NAMESPACE
+
+class QQuickWebEngineTouchSelectionMenuRequest;
+
+class QQuickWebEngineTouchSelectionMenuRequestPrivate
+{
+public:
+ QQuickWebEngineTouchSelectionMenuRequestPrivate(
+ QRect bounds, QtWebEngineCore::TouchSelectionMenuController *touchSelectionMenuController);
+
+ bool accepted = false;
+ QRect selectionBounds;
+ uint touchSelectionCommandFlags;
+ int buttonCount;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQUICKWEBENGINETOUCHSELECTIONMENUREQUEST_P_P_H
diff --git a/src/webenginequick/api/qquickwebengineview.cpp b/src/webenginequick/api/qquickwebengineview.cpp
new file mode 100644
index 000000000..31e5d572e
--- /dev/null
+++ b/src/webenginequick/api/qquickwebengineview.cpp
@@ -0,0 +1,2542 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qquickwebengineaction_p.h"
+#include "qquickwebengineaction_p_p.h"
+#include "qquickwebengineclientcertificateselection_p.h"
+#include "qquickwebenginedialogrequests_p.h"
+#include "qquickwebenginefaviconprovider_p_p.h"
+#include "qquickwebenginenewwindowrequest_p.h"
+#include "qquickwebengineprofile.h"
+#include "qquickwebengineprofile_p.h"
+#include "qquickwebenginescriptcollection_p.h"
+#include "qquickwebenginescriptcollection_p_p.h"
+#include "qquickwebenginesettings_p.h"
+#include "qquickwebenginetouchhandleprovider_p_p.h"
+#include "qquickwebenginetouchhandle_p.h"
+#include "qquickwebenginetouchselectionmenurequest_p.h"
+#include "qquickwebengineview_p.h"
+#include "qquickwebengineview_p_p.h"
+
+#include "authentication_dialog_controller.h"
+#include "autofill_popup_controller.h"
+#include "profile_adapter.h"
+#include "file_picker_controller.h"
+#include "find_text_helper.h"
+#include "javascript_dialog_controller.h"
+#include "render_widget_host_view_qt_delegate_item.h"
+#include "render_widget_host_view_qt_delegate_quickwindow.h"
+#include "touch_selection_menu_controller.h"
+#include "ui_delegates_manager.h"
+#include "web_contents_adapter.h"
+
+#include <QtWebEngineCore/qwebenginecertificateerror.h>
+#include <QtWebEngineCore/qwebenginedesktopmediarequest.h>
+#include <QtWebEngineCore/qwebenginefilesystemaccessrequest.h>
+#include <QtWebEngineCore/qwebenginefindtextresult.h>
+#include <QtWebEngineCore/qwebenginefullscreenrequest.h>
+#include <QtWebEngineCore/qwebengineloadinginfo.h>
+#include <QtWebEngineCore/qwebenginenavigationrequest.h>
+#include <QtWebEngineCore/qwebenginepage.h>
+#include <QtWebEngineCore/qwebengineregisterprotocolhandlerrequest.h>
+#include <QtWebEngineCore/qwebenginescriptcollection.h>
+#include <QtWebEngineCore/qwebenginewebauthuxrequest.h>
+#include <QtWebEngineCore/private/qwebenginecontextmenurequest_p.h>
+#include <QtWebEngineCore/private/qwebenginedesktopmediarequest_p.h>
+#include <QtWebEngineCore/private/qwebenginehistory_p.h>
+#include <QtWebEngineCore/private/qwebenginenewwindowrequest_p.h>
+#include <QtWebEngineCore/private/qwebenginescriptcollection_p.h>
+#include <QtWebEngineCore/private/qwebenginepage_p.h>
+#include <QtWebEngineCore/private/qtwebenginecoreglobal_p.h>
+
+#include <QtCore/qloggingcategory.h>
+#include <QtCore/qmimedata.h>
+#include <QtCore/qurl.h>
+#include <QtCore/qtimer.h>
+#include <QtGui/qclipboard.h>
+#include <QtGui/qguiapplication.h>
+#include <QtGui/private/qguiapplication_p.h>
+#include <QtGui/qpa/qplatformintegration.h>
+#include <QtQml/qqmlcomponent.h>
+#include <QtQml/qqmlcontext.h>
+#include <QtQml/qqmlengine.h>
+#include <QtQml/qqmlproperty.h>
+
+#if QT_CONFIG(accessibility)
+#include "qquickwebengine_accessible.h"
+
+#include <QtGui/qaccessible.h>
+#endif
+
+#if QT_CONFIG(webengine_printing_and_pdf)
+#include <QtCore/qmargins.h>
+#include <QtGui/qpagelayout.h>
+#include <QtGui/qpageranges.h>
+#include <QtGui/qpagesize.h>
+#endif
+
+#if QT_CONFIG(webengine_webchannel)
+#include <QtWebChannelQuick/qqmlwebchannel.h>
+#endif
+
+QT_BEGIN_NAMESPACE
+using namespace QtWebEngineCore;
+
+Q_STATIC_ASSERT(int(QQuickWebEngineView::WebActionCount) == int(QWebEnginePage::WebActionCount));
+using LoadStatus = QWebEngineLoadingInfo::LoadStatus;
+using ErrorDomain = QWebEngineLoadingInfo::ErrorDomain;
+#if QT_DEPRECATED_SINCE(6, 2)
+QT_WARNING_PUSH QT_WARNING_DISABLE_DEPRECATED
+Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::AcceptRequest) == static_cast<int>(QWebEngineNavigationRequest::AcceptRequest));
+Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::IgnoreRequest) == static_cast<int>(QWebEngineNavigationRequest::IgnoreRequest));
+Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::LinkClickedNavigation) == static_cast<int>(QWebEngineNavigationRequest::LinkClickedNavigation));
+Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::TypedNavigation) == static_cast<int>(QWebEngineNavigationRequest::TypedNavigation));
+Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::FormSubmittedNavigation) == static_cast<int>(QWebEngineNavigationRequest::FormSubmittedNavigation));
+Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::BackForwardNavigation) == static_cast<int>(QWebEngineNavigationRequest::BackForwardNavigation));
+Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::ReloadNavigation) == static_cast<int>(QWebEngineNavigationRequest::ReloadNavigation));
+Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::OtherNavigation) == static_cast<int>(QWebEngineNavigationRequest::OtherNavigation));
+Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::RedirectNavigation) == static_cast<int>(QWebEngineNavigationRequest::RedirectNavigation));
+Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::NewViewInWindow) == static_cast<int>(QWebEngineNewWindowRequest::InNewWindow));
+Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::NewViewInTab) == static_cast<int>(QWebEngineNewWindowRequest::InNewTab));
+Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::NewViewInDialog) == static_cast<int>(QWebEngineNewWindowRequest::InNewDialog));
+Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::NewViewInBackgroundTab) == static_cast<int>(QWebEngineNewWindowRequest::InNewBackgroundTab));
+Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::NoErrorDomain) == static_cast<int>(ErrorDomain::NoErrorDomain));
+Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::InternalErrorDomain) == static_cast<int>(ErrorDomain::InternalErrorDomain));
+Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::ConnectionErrorDomain) == static_cast<int>(ErrorDomain::ConnectionErrorDomain));
+Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::CertificateErrorDomain) == static_cast<int>(ErrorDomain::CertificateErrorDomain));
+Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::HttpErrorDomain) == static_cast<int>(ErrorDomain::HttpErrorDomain));
+Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::FtpErrorDomain) == static_cast<int>(ErrorDomain::FtpErrorDomain));
+Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::DnsErrorDomain) == static_cast<int>(ErrorDomain::DnsErrorDomain));
+Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::LoadStartedStatus) == static_cast<int>(LoadStatus::LoadStartedStatus));
+Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::LoadStoppedStatus) == static_cast<int>(LoadStatus::LoadStoppedStatus));
+Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::LoadFailedStatus) == static_cast<int>(LoadStatus::LoadFailedStatus));
+Q_STATIC_ASSERT(static_cast<int>(QQuickWebEngineView::LoadSucceededStatus) == static_cast<int>(LoadStatus::LoadSucceededStatus));
+QT_WARNING_POP
+#endif
+
+#if QT_CONFIG(webengine_printing_and_pdf)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Letter, QQuickWebEngineView::PrintedPageSizeId::Letter)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Legal, QQuickWebEngineView::PrintedPageSizeId::Legal)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Executive, QQuickWebEngineView::PrintedPageSizeId::Executive)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A0, QQuickWebEngineView::PrintedPageSizeId::A0)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A1, QQuickWebEngineView::PrintedPageSizeId::A1)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A2, QQuickWebEngineView::PrintedPageSizeId::A2)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A3, QQuickWebEngineView::PrintedPageSizeId::A3)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A4, QQuickWebEngineView::PrintedPageSizeId::A4)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A5, QQuickWebEngineView::PrintedPageSizeId::A5)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A6, QQuickWebEngineView::PrintedPageSizeId::A6)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A7, QQuickWebEngineView::PrintedPageSizeId::A7)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A8, QQuickWebEngineView::PrintedPageSizeId::A8)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A9, QQuickWebEngineView::PrintedPageSizeId::A9)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A10, QQuickWebEngineView::PrintedPageSizeId::A10)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::B0, QQuickWebEngineView::PrintedPageSizeId::B0)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::B1, QQuickWebEngineView::PrintedPageSizeId::B1)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::B2, QQuickWebEngineView::PrintedPageSizeId::B2)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::B3, QQuickWebEngineView::PrintedPageSizeId::B3)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::B4, QQuickWebEngineView::PrintedPageSizeId::B4)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::B5, QQuickWebEngineView::PrintedPageSizeId::B5)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::B6, QQuickWebEngineView::PrintedPageSizeId::B6)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::B7, QQuickWebEngineView::PrintedPageSizeId::B7)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::B8, QQuickWebEngineView::PrintedPageSizeId::B8)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::B9, QQuickWebEngineView::PrintedPageSizeId::B9)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::B10, QQuickWebEngineView::PrintedPageSizeId::B10)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::C5E, QQuickWebEngineView::PrintedPageSizeId::C5E)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Comm10E, QQuickWebEngineView::PrintedPageSizeId::Comm10E)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::DLE, QQuickWebEngineView::PrintedPageSizeId::DLE)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Folio, QQuickWebEngineView::PrintedPageSizeId::Folio)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Ledger, QQuickWebEngineView::PrintedPageSizeId::Ledger)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Tabloid, QQuickWebEngineView::PrintedPageSizeId::Tabloid)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Custom, QQuickWebEngineView::PrintedPageSizeId::Custom)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A3Extra, QQuickWebEngineView::PrintedPageSizeId::A3Extra)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A4Extra, QQuickWebEngineView::PrintedPageSizeId::A4Extra)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A4Plus, QQuickWebEngineView::PrintedPageSizeId::A4Plus)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A4Small, QQuickWebEngineView::PrintedPageSizeId::A4Small)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::A5Extra, QQuickWebEngineView::PrintedPageSizeId::A5Extra)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::B5Extra, QQuickWebEngineView::PrintedPageSizeId::B5Extra)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::JisB0, QQuickWebEngineView::PrintedPageSizeId::JisB0)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::JisB1, QQuickWebEngineView::PrintedPageSizeId::JisB1)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::JisB2, QQuickWebEngineView::PrintedPageSizeId::JisB2)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::JisB3, QQuickWebEngineView::PrintedPageSizeId::JisB3)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::JisB4, QQuickWebEngineView::PrintedPageSizeId::JisB4)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::JisB5, QQuickWebEngineView::PrintedPageSizeId::JisB5)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::JisB6, QQuickWebEngineView::PrintedPageSizeId::JisB6)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::JisB7, QQuickWebEngineView::PrintedPageSizeId::JisB7)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::JisB8, QQuickWebEngineView::PrintedPageSizeId::JisB8)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::JisB9, QQuickWebEngineView::PrintedPageSizeId::JisB9)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::JisB10, QQuickWebEngineView::PrintedPageSizeId::JisB10)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::AnsiC, QQuickWebEngineView::PrintedPageSizeId::AnsiC)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::AnsiD, QQuickWebEngineView::PrintedPageSizeId::AnsiD)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::AnsiE, QQuickWebEngineView::PrintedPageSizeId::AnsiE)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::LegalExtra, QQuickWebEngineView::PrintedPageSizeId::LegalExtra)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::LetterExtra, QQuickWebEngineView::PrintedPageSizeId::LetterExtra)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::LetterPlus, QQuickWebEngineView::PrintedPageSizeId::LetterPlus)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::LetterSmall, QQuickWebEngineView::PrintedPageSizeId::LetterSmall)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::TabloidExtra, QQuickWebEngineView::PrintedPageSizeId::TabloidExtra)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::ArchA, QQuickWebEngineView::PrintedPageSizeId::ArchA)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::ArchB, QQuickWebEngineView::PrintedPageSizeId::ArchB)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::ArchC, QQuickWebEngineView::PrintedPageSizeId::ArchC)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::ArchD, QQuickWebEngineView::PrintedPageSizeId::ArchD)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::ArchE, QQuickWebEngineView::PrintedPageSizeId::ArchE)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Imperial7x9, QQuickWebEngineView::PrintedPageSizeId::Imperial7x9)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Imperial8x10, QQuickWebEngineView::PrintedPageSizeId::Imperial8x10)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Imperial9x11, QQuickWebEngineView::PrintedPageSizeId::Imperial9x11)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Imperial9x12, QQuickWebEngineView::PrintedPageSizeId::Imperial9x12)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Imperial10x11, QQuickWebEngineView::PrintedPageSizeId::Imperial10x11)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Imperial10x13, QQuickWebEngineView::PrintedPageSizeId::Imperial10x13)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Imperial10x14, QQuickWebEngineView::PrintedPageSizeId::Imperial10x14)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Imperial12x11, QQuickWebEngineView::PrintedPageSizeId::Imperial12x11)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Imperial15x11, QQuickWebEngineView::PrintedPageSizeId::Imperial15x11)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::ExecutiveStandard, QQuickWebEngineView::PrintedPageSizeId::ExecutiveStandard)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Note, QQuickWebEngineView::PrintedPageSizeId::Note)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Quarto, QQuickWebEngineView::PrintedPageSizeId::Quarto)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Statement, QQuickWebEngineView::PrintedPageSizeId::Statement)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::SuperA, QQuickWebEngineView::PrintedPageSizeId::SuperA)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::SuperB, QQuickWebEngineView::PrintedPageSizeId::SuperB)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Postcard, QQuickWebEngineView::PrintedPageSizeId::Postcard)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::DoublePostcard, QQuickWebEngineView::PrintedPageSizeId::DoublePostcard)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Prc16K, QQuickWebEngineView::PrintedPageSizeId::Prc16K)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Prc32K, QQuickWebEngineView::PrintedPageSizeId::Prc32K)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Prc32KBig, QQuickWebEngineView::PrintedPageSizeId::Prc32KBig)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::FanFoldUS, QQuickWebEngineView::PrintedPageSizeId::FanFoldUS)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::FanFoldGerman, QQuickWebEngineView::PrintedPageSizeId::FanFoldGerman)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::FanFoldGermanLegal, QQuickWebEngineView::PrintedPageSizeId::FanFoldGermanLegal)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeB4, QQuickWebEngineView::PrintedPageSizeId::EnvelopeB4)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeB5, QQuickWebEngineView::PrintedPageSizeId::EnvelopeB5)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeB6, QQuickWebEngineView::PrintedPageSizeId::EnvelopeB6)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeC0, QQuickWebEngineView::PrintedPageSizeId::EnvelopeC0)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeC1, QQuickWebEngineView::PrintedPageSizeId::EnvelopeC1)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeC2, QQuickWebEngineView::PrintedPageSizeId::EnvelopeC2)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeC3, QQuickWebEngineView::PrintedPageSizeId::EnvelopeC3)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeC4, QQuickWebEngineView::PrintedPageSizeId::EnvelopeC4)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeC6, QQuickWebEngineView::PrintedPageSizeId::EnvelopeC6)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeC65, QQuickWebEngineView::PrintedPageSizeId::EnvelopeC65)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeC7, QQuickWebEngineView::PrintedPageSizeId::EnvelopeC7)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Envelope9, QQuickWebEngineView::PrintedPageSizeId::Envelope9)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Envelope11, QQuickWebEngineView::PrintedPageSizeId::Envelope11)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Envelope12, QQuickWebEngineView::PrintedPageSizeId::Envelope12)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Envelope14, QQuickWebEngineView::PrintedPageSizeId::Envelope14)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeMonarch, QQuickWebEngineView::PrintedPageSizeId::EnvelopeMonarch)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopePersonal, QQuickWebEngineView::PrintedPageSizeId::EnvelopePersonal)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeChou3, QQuickWebEngineView::PrintedPageSizeId::EnvelopeChou3)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeChou4, QQuickWebEngineView::PrintedPageSizeId::EnvelopeChou4)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeInvite, QQuickWebEngineView::PrintedPageSizeId::EnvelopeInvite)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeItalian, QQuickWebEngineView::PrintedPageSizeId::EnvelopeItalian)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeKaku2, QQuickWebEngineView::PrintedPageSizeId::EnvelopeKaku2)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeKaku3, QQuickWebEngineView::PrintedPageSizeId::EnvelopeKaku3)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopePrc1, QQuickWebEngineView::PrintedPageSizeId::EnvelopePrc1)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopePrc2, QQuickWebEngineView::PrintedPageSizeId::EnvelopePrc2)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopePrc3, QQuickWebEngineView::PrintedPageSizeId::EnvelopePrc3)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopePrc4, QQuickWebEngineView::PrintedPageSizeId::EnvelopePrc4)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopePrc5, QQuickWebEngineView::PrintedPageSizeId::EnvelopePrc5)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopePrc6, QQuickWebEngineView::PrintedPageSizeId::EnvelopePrc6)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopePrc7, QQuickWebEngineView::PrintedPageSizeId::EnvelopePrc7)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopePrc8, QQuickWebEngineView::PrintedPageSizeId::EnvelopePrc8)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopePrc9, QQuickWebEngineView::PrintedPageSizeId::EnvelopePrc9)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopePrc10, QQuickWebEngineView::PrintedPageSizeId::EnvelopePrc10)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeYou4, QQuickWebEngineView::PrintedPageSizeId::EnvelopeYou4)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::LastPageSize, QQuickWebEngineView::PrintedPageSizeId::LastPageSize)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::AnsiA, QQuickWebEngineView::PrintedPageSizeId::AnsiA)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::AnsiB, QQuickWebEngineView::PrintedPageSizeId::AnsiB)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeC5, QQuickWebEngineView::PrintedPageSizeId::EnvelopeC5)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::EnvelopeDL, QQuickWebEngineView::PrintedPageSizeId::EnvelopeDL)
+ASSERT_ENUMS_MATCH(QPageSize::PageSizeId::Envelope10, QQuickWebEngineView::PrintedPageSizeId::Envelope10)
+#endif
+
+class WebEngineQuickWidgetDelegate : public QtWebEngineCore::WidgetDelegate
+{
+public:
+ WebEngineQuickWidgetDelegate(QtWebEngineCore::RenderWidgetHostViewQtDelegateItem *item, QQuickWebEngineView *parent)
+ : m_contentItem(item)
+ , m_parentView(parent)
+ {
+ }
+
+ ~WebEngineQuickWidgetDelegate() override
+ {
+ if (m_contentItem)
+ m_contentItem->setWidgetDelegate(nullptr);
+ }
+
+ void InitAsPopup(const QRect &screenRect) override
+ {
+ Q_UNUSED(screenRect);
+ Q_UNREACHABLE();
+ }
+
+ void Bind(WebContentsAdapterClient *client) override
+ {
+ QQuickWebEngineViewPrivate::bindViewAndDelegateItem(
+ static_cast<QQuickWebEngineViewPrivate *>(client), m_contentItem);
+ }
+
+ void Unbind() override
+ {
+ QQuickWebEngineViewPrivate::bindViewAndDelegateItem(nullptr, m_contentItem);
+ }
+
+ void Destroy() override
+ {
+ delete this;
+ }
+
+ bool ActiveFocusOnPress() override
+ {
+ return m_parentView->property("activeFocusOnPress").toBool() || m_parentView->hasActiveFocus();
+ }
+
+private:
+ QPointer<RenderWidgetHostViewQtDelegateItem> m_contentItem; // deleted by core
+ QPointer<QQuickWebEngineView> m_parentView;
+};
+
+#if QT_CONFIG(accessibility)
+static QAccessibleInterface *webAccessibleFactory(const QString &, QObject *object)
+{
+ if (QQuickWebEngineView *v = qobject_cast<QQuickWebEngineView*>(object))
+ return new QQuickWebEngineViewAccessible(v);
+ return nullptr;
+}
+#endif // QT_CONFIG(accessibility)
+
+static QLatin1String defaultMimeType("text/html;charset=UTF-8");
+
+QQuickWebEngineViewPrivate::QQuickWebEngineViewPrivate()
+ : m_profile(nullptr)
+ , adapter(QSharedPointer<WebContentsAdapter>::create())
+ , m_history(new QWebEngineHistory(new QWebEngineHistoryPrivate(this, [] (const QUrl &url) {
+ return QQuickWebEngineFaviconProvider::faviconProviderUrl(url);
+ })))
+ , contextMenuExtraItems(nullptr)
+ , loadProgress(0)
+ , m_fullscreenMode(false)
+ , isLoading(false)
+ , m_activeFocusOnPress(true)
+ , m_webChannel(nullptr)
+ , m_webChannelWorld(0)
+ , m_defaultAudioMuted(false)
+ , m_isBeingAdopted(false)
+ , m_backgroundColor(Qt::white)
+ , m_zoomFactor(1.0)
+ , m_profileInitialized(false)
+ , m_contextMenuRequest(nullptr)
+ , m_touchHandleDelegate(nullptr)
+{
+ memset(actions, 0, sizeof(actions));
+
+#if QT_CONFIG(accessibility)
+ QAccessible::installFactory(&webAccessibleFactory);
+#endif // QT_CONFIG(accessibility)
+}
+
+QQuickWebEngineViewPrivate::~QQuickWebEngineViewPrivate()
+{
+ Q_ASSERT(m_profileInitialized);
+ m_profile->d_ptr->removeWebContentsAdapterClient(this);
+ if (m_faviconProvider)
+ m_faviconProvider->detach(q_ptr);
+ bindViewAndDelegateItem(this, nullptr);
+}
+
+void QQuickWebEngineViewPrivate::initializeProfile()
+{
+ if (!m_profileInitialized) {
+ Q_ASSERT(!adapter->isInitialized());
+ m_profileInitialized = true;
+
+ if (!m_profile) {
+ m_profile = QQuickWebEngineProfile::defaultProfile();
+
+ // MEMO first ever call to default profile will create one without context
+ // it needs something to get qml engine from (and view is created in qml land)
+ m_profile->ensureQmlContext(q_ptr);
+ }
+
+ m_profile->d_ptr->addWebContentsAdapterClient(this);
+ m_settings.reset(new QQuickWebEngineSettings(m_profile->settings()));
+ adapter->setClient(this);
+ }
+}
+
+bool QQuickWebEngineViewPrivate::profileInitialized() const
+{
+ return m_profileInitialized;
+}
+
+void QQuickWebEngineViewPrivate::releaseProfile()
+{
+ // The profile for this web contents is about to be
+ // garbage collected, delete WebContents first and
+ // let the QQuickWebEngineView be collected later by gc.
+ bindViewAndDelegateItem(this, nullptr);
+ q_ptr->d_ptr.reset();
+}
+
+UIDelegatesManager *QQuickWebEngineViewPrivate::ui()
+{
+ Q_Q(QQuickWebEngineView);
+ if (m_uIDelegatesManager.isNull())
+ m_uIDelegatesManager.reset(new UIDelegatesManager(q));
+ return m_uIDelegatesManager.data();
+}
+
+RenderWidgetHostViewQtDelegate *QQuickWebEngineViewPrivate::CreateRenderWidgetHostViewQtDelegate(RenderWidgetHostViewQtDelegateClient *client)
+{
+ Q_Q(QQuickWebEngineView);
+ auto *item = new RenderWidgetHostViewQtDelegateItem(client, /*isPopup = */ false);
+ item->setWidgetDelegate(new WebEngineQuickWidgetDelegate(item, q));
+ return item;
+}
+
+RenderWidgetHostViewQtDelegate *QQuickWebEngineViewPrivate::CreateRenderWidgetHostViewQtDelegateForPopup(RenderWidgetHostViewQtDelegateClient *client)
+{
+ Q_Q(QQuickWebEngineView);
+ const bool hasWindowCapability = QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::MultipleWindows);
+ RenderWidgetHostViewQtDelegateItem *quickDelegate = new RenderWidgetHostViewQtDelegateItem(client, /*isPopup = */ true);
+ if (hasWindowCapability) {
+ RenderWidgetHostViewQtDelegateQuickWindow *wrapperWindow =
+ new RenderWidgetHostViewQtDelegateQuickWindow(quickDelegate, q->window());
+ quickDelegate->setWidgetDelegate(wrapperWindow);
+ wrapperWindow->setVirtualParent(q);
+ return quickDelegate;
+ }
+ quickDelegate->setParentItem(q);
+ quickDelegate->setWidgetDelegate(new WebEngineQuickWidgetDelegate(quickDelegate, q));
+ quickDelegate->show();
+ return quickDelegate;
+}
+
+void QQuickWebEngineViewPrivate::contextMenuRequested(QWebEngineContextMenuRequest *request)
+{
+ Q_Q(QQuickWebEngineView);
+
+ m_contextMenuRequest = request;
+
+ QQmlEngine *engine = qmlEngine(q);
+
+ // TODO: this is a workaround for QTBUG-65044
+ if (!engine)
+ return;
+
+ // mark the object for gc by creating temporary jsvalue
+ // FIXME: we most likely do not need to make any copy here
+ auto *r = new QWebEngineContextMenuRequest(
+ new QWebEngineContextMenuRequestPrivate(*request->d.data()));
+ engine->newQObject(r);
+ Q_EMIT q->contextMenuRequested(r);
+
+ if (r->isAccepted())
+ return;
+
+ // Assign the WebEngineView as the parent of the menu, so mouse events are properly propagated
+ // on OSX.
+ QObject *menu = ui()->addMenu(q, QString(), r->position());
+ if (!menu)
+ return;
+
+ QQuickContextMenuBuilder contextMenuBuilder(r, q, menu);
+
+ // Populate our menu
+ contextMenuBuilder.initMenu();
+
+ // FIXME: expose the context menu data as an attached property to make this more useful
+ if (contextMenuExtraItems)
+ contextMenuBuilder.appendExtraItems(engine);
+
+ // Now fire the popup() method on the top level menu
+ ui()->showMenu(menu);
+}
+
+void QQuickWebEngineViewPrivate::navigationRequested(int navigationType, const QUrl &url, bool &accepted, bool isMainFrame)
+{
+ Q_Q(QQuickWebEngineView);
+ auto request = new QWebEngineNavigationRequest(url, static_cast<QWebEngineNavigationRequest::NavigationType>(navigationType), isMainFrame);
+ qmlEngine(q)->newQObject(request);
+ Q_EMIT q->navigationRequested(request);
+
+ accepted = request->isAccepted();
+ if (accepted && adapter->findTextHelper()->isFindTextInProgress())
+ adapter->findTextHelper()->stopFinding();
+}
+
+void QQuickWebEngineViewPrivate::javascriptDialog(QSharedPointer<JavaScriptDialogController> dialog)
+{
+ Q_Q(QQuickWebEngineView);
+ QQuickWebEngineJavaScriptDialogRequest *request = new QQuickWebEngineJavaScriptDialogRequest(dialog);
+ // mark the object for gc by creating temporary jsvalue
+ qmlEngine(q)->newQObject(request);
+ Q_EMIT q->javaScriptDialogRequested(request);
+ if (!request->isAccepted())
+ ui()->showDialog(dialog);
+}
+
+void QQuickWebEngineViewPrivate::allowCertificateError(const QWebEngineCertificateError &error)
+{
+ Q_Q(QQuickWebEngineView);
+ Q_EMIT q->certificateError(error);
+}
+
+void QQuickWebEngineViewPrivate::selectClientCert(
+ const QSharedPointer<QtWebEngineCore::ClientCertSelectController> &controller)
+{
+ Q_Q(QQuickWebEngineView);
+ QQuickWebEngineClientCertificateSelection *certSelection = new QQuickWebEngineClientCertificateSelection(controller);
+ // mark the object for gc by creating temporary jsvalue
+ qmlEngine(q)->newQObject(certSelection);
+ Q_EMIT q->selectClientCertificate(certSelection);
+}
+
+static QQuickWebEngineView::Feature toFeature(QtWebEngineCore::ProfileAdapter::PermissionType type)
+{
+ switch (type) {
+ case QtWebEngineCore::ProfileAdapter::NotificationPermission:
+ return QQuickWebEngineView::Notifications;
+ case QtWebEngineCore::ProfileAdapter::GeolocationPermission:
+ return QQuickWebEngineView::Geolocation;
+ case QtWebEngineCore::ProfileAdapter::ClipboardReadWrite:
+ return QQuickWebEngineView::ClipboardReadWrite;
+ case QtWebEngineCore::ProfileAdapter::LocalFontsPermission:
+ return QQuickWebEngineView::LocalFontsAccess;
+ default:
+ break;
+ }
+ Q_UNREACHABLE();
+ return QQuickWebEngineView::Feature(-1);
+}
+
+
+void QQuickWebEngineViewPrivate::runFeaturePermissionRequest(QtWebEngineCore::ProfileAdapter::PermissionType permission, const QUrl &url)
+{
+ Q_Q(QQuickWebEngineView);
+ Q_EMIT q->featurePermissionRequested(url, toFeature(permission));
+}
+
+void QQuickWebEngineViewPrivate::showColorDialog(QSharedPointer<ColorChooserController> controller)
+{
+ Q_Q(QQuickWebEngineView);
+ QQuickWebEngineColorDialogRequest *request = new QQuickWebEngineColorDialogRequest(controller);
+ // mark the object for gc by creating temporary jsvalue
+ qmlEngine(q)->newQObject(request);
+ Q_EMIT q->colorDialogRequested(request);
+ if (!request->isAccepted())
+ ui()->showColorDialog(controller);
+}
+
+void QQuickWebEngineViewPrivate::runFileChooser(QSharedPointer<FilePickerController> controller)
+{
+ Q_Q(QQuickWebEngineView);
+ QQuickWebEngineFileDialogRequest *request = new QQuickWebEngineFileDialogRequest(controller);
+ // mark the object for gc by creating temporary jsvalue
+ qmlEngine(q)->newQObject(request);
+ Q_EMIT q->fileDialogRequested(request);
+ if (!request->isAccepted())
+ ui()->showFilePicker(controller);
+}
+
+bool QQuickWebEngineViewPrivate::passOnFocus(bool reverse)
+{
+ Q_Q(QQuickWebEngineView);
+ // The child delegate currently has focus, find the next one from there and give it focus.
+ QQuickItem *next = q->scopedFocusItem()->nextItemInFocusChain(!reverse);
+ if (next) {
+ next->forceActiveFocus(reverse ? Qt::BacktabFocusReason : Qt::TabFocusReason);
+ return true;
+ }
+ return false;
+}
+
+void QQuickWebEngineViewPrivate::titleChanged(const QString &title)
+{
+ Q_Q(QQuickWebEngineView);
+ Q_UNUSED(title);
+ Q_EMIT q->titleChanged();
+}
+
+void QQuickWebEngineViewPrivate::urlChanged()
+{
+ Q_Q(QQuickWebEngineView);
+ QUrl url = adapter->activeUrl();
+ if (m_url != url) {
+ m_url = url;
+ Q_EMIT q->urlChanged();
+ }
+}
+
+void QQuickWebEngineViewPrivate::iconChanged(const QUrl &url)
+{
+ Q_Q(QQuickWebEngineView);
+
+ if (iconUrl == QQuickWebEngineFaviconProvider::faviconProviderUrl(url))
+ return;
+
+ iconUrl = QQuickWebEngineFaviconProvider::faviconProviderUrl(url);
+ m_history->reset();
+ QTimer::singleShot(0, q, &QQuickWebEngineView::iconChanged);
+}
+
+void QQuickWebEngineViewPrivate::loadProgressChanged(int progress)
+{
+ Q_Q(QQuickWebEngineView);
+ loadProgress = progress;
+ QTimer::singleShot(0, q, &QQuickWebEngineView::loadProgressChanged);
+}
+
+void QQuickWebEngineViewPrivate::didUpdateTargetURL(const QUrl &hoveredUrl)
+{
+ Q_Q(QQuickWebEngineView);
+ Q_EMIT q->linkHovered(hoveredUrl);
+}
+
+void QQuickWebEngineViewPrivate::selectionChanged()
+{
+ updateEditActions();
+}
+
+void QQuickWebEngineViewPrivate::zoomUpdateIsNeeded()
+{
+ Q_Q(QQuickWebEngineView);
+ q->setZoomFactor(m_zoomFactor);
+}
+
+void QQuickWebEngineViewPrivate::recentlyAudibleChanged(bool recentlyAudible)
+{
+ Q_Q(QQuickWebEngineView);
+ Q_EMIT q->recentlyAudibleChanged(recentlyAudible);
+}
+
+void QQuickWebEngineViewPrivate::renderProcessPidChanged(qint64 pid)
+{
+ Q_Q(QQuickWebEngineView);
+ Q_EMIT q->renderProcessPidChanged(pid);
+}
+
+QRectF QQuickWebEngineViewPrivate::viewportRect() const
+{
+ Q_Q(const QQuickWebEngineView);
+ return QRectF(q->x(), q->y(), q->width(), q->height());
+}
+
+QColor QQuickWebEngineViewPrivate::backgroundColor() const
+{
+ return m_backgroundColor;
+}
+
+void QQuickWebEngineViewPrivate::loadStarted(QWebEngineLoadingInfo info)
+{
+ Q_Q(QQuickWebEngineView);
+ isLoading = true;
+ m_history->reset();
+ QTimer::singleShot(0, q, [q, info] () {
+ emit q->loadingChanged(info);
+ });
+}
+
+void QQuickWebEngineViewPrivate::loadCommitted()
+{
+ m_history->reset();
+}
+
+void QQuickWebEngineViewPrivate::loadFinished(QWebEngineLoadingInfo info)
+{
+ Q_Q(QQuickWebEngineView);
+ isLoading = false;
+ m_history->reset();
+ QTimer::singleShot(0, q, [q, info] () {
+ emit q->loadingChanged(info);
+ });
+ return;
+}
+
+void QQuickWebEngineViewPrivate::focusContainer()
+{
+ Q_Q(QQuickWebEngineView);
+ QQuickWindow *window = q->window();
+ if (window)
+ window->requestActivate();
+ q->forceActiveFocus();
+}
+
+void QQuickWebEngineViewPrivate::unhandledKeyEvent(QKeyEvent *event)
+{
+ Q_Q(QQuickWebEngineView);
+ if (q->parentItem())
+ QCoreApplication::sendEvent(q->parentItem(), event);
+}
+
+static QWebEngineNewWindowRequest::DestinationType toDestinationType(WebContentsAdapterClient::WindowOpenDisposition disposition)
+{
+ switch (disposition) {
+ case WebContentsAdapterClient::NewForegroundTabDisposition:
+ return QWebEngineNewWindowRequest::InNewTab;
+ case WebContentsAdapterClient::NewBackgroundTabDisposition:
+ return QWebEngineNewWindowRequest::InNewBackgroundTab;
+ case WebContentsAdapterClient::NewPopupDisposition:
+ return QWebEngineNewWindowRequest::InNewDialog;
+ case WebContentsAdapterClient::NewWindowDisposition:
+ return QWebEngineNewWindowRequest::InNewWindow;
+ default:
+ Q_UNREACHABLE();
+ }
+}
+
+QSharedPointer<WebContentsAdapter>
+QQuickWebEngineViewPrivate::adoptNewWindow(QSharedPointer<WebContentsAdapter> newWebContents,
+ WindowOpenDisposition disposition, bool userGesture,
+ const QRect &geometry, const QUrl &targetUrl)
+{
+ Q_Q(QQuickWebEngineView);
+ Q_ASSERT(newWebContents);
+ QQuickWebEngineNewWindowRequest request(toDestinationType(disposition), geometry,
+ targetUrl, userGesture, newWebContents);
+
+ Q_EMIT q->newWindowRequested(&request);
+
+ if (request.d_ptr->isRequestHandled)
+ return newWebContents;
+ return nullptr;
+}
+
+bool QQuickWebEngineViewPrivate::isBeingAdopted()
+{
+ return false;
+}
+
+void QQuickWebEngineViewPrivate::close()
+{
+ Q_Q(QQuickWebEngineView);
+ emit q->windowCloseRequested();
+}
+
+void QQuickWebEngineViewPrivate::windowCloseRejected()
+{
+ Q_Q(QQuickWebEngineView);
+
+ if (Q_UNLIKELY(q->metaObject()->indexOfMethod("windowCloseRejected()") != -1))
+ QMetaObject::invokeMethod(q, "windowCloseRejected");
+}
+
+void QQuickWebEngineViewPrivate::desktopMediaRequested(
+ QtWebEngineCore::DesktopMediaController *controller)
+{
+ Q_Q(QQuickWebEngineView);
+ QTimer::singleShot(0, q, [q, controller]() {
+ Q_EMIT q->desktopMediaRequested(QWebEngineDesktopMediaRequest(controller));
+ });
+}
+
+void QQuickWebEngineViewPrivate::requestFullScreenMode(const QUrl &origin, bool fullscreen)
+{
+ Q_Q(QQuickWebEngineView);
+ QWebEngineFullScreenRequest request(origin, fullscreen, [q = QPointer(q)] (bool toggleOn) { if (q) q->d_ptr->setFullScreenMode(toggleOn); });
+ Q_EMIT q->fullScreenRequested(request);
+}
+
+bool QQuickWebEngineViewPrivate::isFullScreenMode() const
+{
+ return m_fullscreenMode;
+}
+
+void QQuickWebEngineViewPrivate::javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString& message, int lineNumber, const QString& sourceID)
+{
+ Q_Q(QQuickWebEngineView);
+ if (q->receivers(SIGNAL(javaScriptConsoleMessage(QQuickWebEngineView::JavaScriptConsoleMessageLevel,QString,int,QString))) > 0) {
+ Q_EMIT q->javaScriptConsoleMessage(static_cast<QQuickWebEngineView::JavaScriptConsoleMessageLevel>(level), message, lineNumber, sourceID);
+ return;
+ }
+
+ static QLoggingCategory loggingCategory("js", QtWarningMsg);
+ const QByteArray file = sourceID.toUtf8();
+ QMessageLogger logger(file.constData(), lineNumber, nullptr, loggingCategory.categoryName());
+
+ switch (level) {
+ case JavaScriptConsoleMessageLevel::Info:
+ if (loggingCategory.isInfoEnabled())
+ logger.info().noquote() << message;
+ break;
+ case JavaScriptConsoleMessageLevel::Warning:
+ if (loggingCategory.isWarningEnabled())
+ logger.warning().noquote() << message;
+ break;
+ case JavaScriptConsoleMessageLevel::Error:
+ if (loggingCategory.isCriticalEnabled())
+ logger.critical().noquote() << message;
+ break;
+ }
+}
+
+void QQuickWebEngineViewPrivate::authenticationRequired(QSharedPointer<AuthenticationDialogController> controller)
+{
+ Q_Q(QQuickWebEngineView);
+ QQuickWebEngineAuthenticationDialogRequest *request = new QQuickWebEngineAuthenticationDialogRequest(controller);
+ // mark the object for gc by creating temporary jsvalue
+ qmlEngine(q)->newQObject(request);
+ Q_EMIT q->authenticationDialogRequested(request);
+ if (!request->isAccepted())
+ ui()->showDialog(controller);
+}
+
+void QQuickWebEngineViewPrivate::runMediaAccessPermissionRequest(const QUrl &securityOrigin, WebContentsAdapterClient::MediaRequestFlags requestFlags)
+{
+ Q_Q(QQuickWebEngineView);
+ if (!requestFlags)
+ return;
+ QQuickWebEngineView::Feature feature;
+ if (requestFlags.testFlag(WebContentsAdapterClient::MediaAudioCapture) && requestFlags.testFlag(WebContentsAdapterClient::MediaVideoCapture))
+ feature = QQuickWebEngineView::MediaAudioVideoCapture;
+ else if (requestFlags.testFlag(WebContentsAdapterClient::MediaAudioCapture))
+ feature = QQuickWebEngineView::MediaAudioCapture;
+ else if (requestFlags.testFlag(WebContentsAdapterClient::MediaVideoCapture))
+ feature = QQuickWebEngineView::MediaVideoCapture;
+ else if (requestFlags.testFlag(WebContentsAdapterClient::MediaDesktopAudioCapture) &&
+ requestFlags.testFlag(WebContentsAdapterClient::MediaDesktopVideoCapture))
+ feature = QQuickWebEngineView::DesktopAudioVideoCapture;
+ else // if (requestFlags.testFlag(WebContentsAdapterClient::MediaDesktopVideoCapture))
+ feature = QQuickWebEngineView::DesktopVideoCapture;
+ Q_EMIT q->featurePermissionRequested(securityOrigin, feature);
+}
+
+void QQuickWebEngineViewPrivate::runMouseLockPermissionRequest(const QUrl &securityOrigin)
+{
+ // TODO: Add mouse lock support
+ adapter->grantMouseLockPermission(securityOrigin, false);
+}
+
+void QQuickWebEngineViewPrivate::runRegisterProtocolHandlerRequest(QWebEngineRegisterProtocolHandlerRequest request)
+{
+ Q_Q(QQuickWebEngineView);
+ Q_EMIT q->registerProtocolHandlerRequested(request);
+}
+
+void QQuickWebEngineViewPrivate::runFileSystemAccessRequest(
+ QWebEngineFileSystemAccessRequest request)
+{
+ Q_Q(QQuickWebEngineView);
+ Q_EMIT q->fileSystemAccessRequested(request);
+}
+
+QObject *QQuickWebEngineViewPrivate::accessibilityParentObject()
+{
+ Q_Q(QQuickWebEngineView);
+ return q;
+}
+
+ProfileAdapter *QQuickWebEngineViewPrivate::profileAdapter()
+{
+ return m_profile->d_ptr->profileAdapter();
+}
+
+WebContentsAdapter *QQuickWebEngineViewPrivate::webContentsAdapter()
+{
+ return adapter.data();
+}
+
+void QQuickWebEngineViewPrivate::printRequested()
+{
+ Q_Q(QQuickWebEngineView);
+ QTimer::singleShot(0, q, [q]() {
+ Q_EMIT q->printRequested();
+ });
+}
+
+void QQuickWebEngineViewPrivate::findTextFinished(const QWebEngineFindTextResult &result)
+{
+ Q_Q(QQuickWebEngineView);
+ Q_EMIT q->findTextFinished(result);
+}
+
+void QQuickWebEngineViewPrivate::showAutofillPopup(
+ QtWebEngineCore::AutofillPopupController *controller, const QRect &bounds,
+ bool autoselectFirstSuggestion)
+{
+ ui()->showAutofillPopup(controller, bounds.bottomLeft(), bounds.width() + 2,
+ autoselectFirstSuggestion);
+}
+
+void QQuickWebEngineViewPrivate::hideAutofillPopup()
+{
+ ui()->hideAutofillPopup();
+}
+
+QWebEngineSettings *QQuickWebEngineViewPrivate::webEngineSettings() const
+{
+ return m_settings->d_ptr.data();
+}
+
+const QObject *QQuickWebEngineViewPrivate::holdingQObject() const
+{
+ Q_Q(const QQuickWebEngineView);
+ return q;
+}
+
+void QQuickWebEngineViewPrivate::lifecycleStateChanged(LifecycleState state)
+{
+ Q_Q(QQuickWebEngineView);
+ Q_EMIT q->lifecycleStateChanged(static_cast<QQuickWebEngineView::LifecycleState>(state));
+}
+
+void QQuickWebEngineViewPrivate::recommendedStateChanged(LifecycleState state)
+{
+ Q_Q(QQuickWebEngineView);
+ QTimer::singleShot(0, q, [q, state]() {
+ Q_EMIT q->recommendedStateChanged(static_cast<QQuickWebEngineView::LifecycleState>(state));
+ });
+}
+
+void QQuickWebEngineViewPrivate::visibleChanged(bool visible)
+{
+ Q_UNUSED(visible);
+}
+
+class WebContentsAdapterOwner : public QObject
+{
+public:
+ typedef QSharedPointer<QtWebEngineCore::WebContentsAdapter> AdapterPtr;
+ WebContentsAdapterOwner(const AdapterPtr &ptr)
+ : adapter(ptr)
+ {}
+
+private:
+ AdapterPtr adapter;
+};
+
+bool QQuickWebEngineViewPrivate::adoptWebContents(WebContentsAdapter *webContents)
+{
+ Q_ASSERT(webContents);
+ if (webContents->profileAdapter() && profileAdapter() != webContents->profileAdapter()) {
+ qWarning("Can not adopt content from a different WebEngineProfile.");
+ return false;
+ }
+
+ m_isBeingAdopted = true;
+
+ // This throws away the WebContentsAdapter that has been used until now.
+ // All its states, particularly the loading URL, are replaced by the adopted WebContentsAdapter.
+ WebContentsAdapterOwner *adapterOwner = new WebContentsAdapterOwner(adapter->sharedFromThis());
+ adapterOwner->deleteLater();
+
+ adapter = webContents->sharedFromThis();
+ adapter->setClient(this);
+ return true;
+}
+
+QQuickWebEngineView::QQuickWebEngineView(QQuickItem *parent)
+ : QQuickItem(parent)
+ , d_ptr(new QQuickWebEngineViewPrivate)
+{
+ Q_D(QQuickWebEngineView);
+ d->q_ptr = this;
+ this->setActiveFocusOnTab(true);
+ this->setFlags(QQuickItem::ItemIsFocusScope | QQuickItem::ItemAcceptsDrops);
+
+ connect(action(WebAction::Back), &QQuickWebEngineAction::enabledChanged,
+ this, &QQuickWebEngineView::canGoBackChanged);
+ connect(action(WebAction::Forward), &QQuickWebEngineAction::enabledChanged,
+ this, &QQuickWebEngineView::canGoForwardChanged);
+}
+
+QQuickWebEngineView::~QQuickWebEngineView()
+{
+ if (hasFocus())
+ setFocus(false);
+}
+
+void QQuickWebEngineViewPrivate::ensureContentsAdapter()
+{
+ initializeProfile();
+ if (!adapter->isInitialized()) {
+ if (!m_html.isEmpty())
+ adapter->setContent(m_html.toUtf8(), defaultMimeType, m_url);
+ else if (m_url.isValid())
+ adapter->load(m_url);
+ else
+ adapter->loadDefault();
+ }
+
+ if (!m_faviconProvider) {
+ QQmlEngine *engine = qmlEngine(q_ptr);
+ // TODO: this is a workaround for QTBUG-65044
+ if (!engine)
+ return;
+ m_faviconProvider = static_cast<QQuickWebEngineFaviconProvider *>(
+ engine->imageProvider(QQuickWebEngineFaviconProvider::identifier()));
+ m_faviconProvider->attach(q_ptr);
+ Q_ASSERT(m_faviconProvider);
+ }
+}
+
+void QQuickWebEngineViewPrivate::initializationFinished()
+{
+ Q_Q(QQuickWebEngineView);
+
+ Q_ASSERT(m_profileInitialized);
+ if (m_backgroundColor != Qt::white) {
+ adapter->setBackgroundColor(m_backgroundColor);
+ emit q->backgroundColorChanged();
+ }
+
+ // apply if it was set before first ever navigation already
+ q->setZoomFactor(m_zoomFactor);
+
+#if QT_CONFIG(webengine_webchannel)
+ if (m_webChannel)
+ adapter->setWebChannel(m_webChannel, m_webChannelWorld);
+#endif
+
+ if (m_defaultAudioMuted != adapter->isAudioMuted())
+ adapter->setAudioMuted(m_defaultAudioMuted);
+
+ if (devToolsView && devToolsView->d_ptr->adapter)
+ adapter->openDevToolsFrontend(devToolsView->d_ptr->adapter);
+
+ if (m_scriptCollection)
+ m_scriptCollection->d->d->initializationFinished(adapter);
+
+ if (q->window())
+ adapter->setVisible(q->isVisible());
+
+ if (!m_isBeingAdopted)
+ return;
+
+ // Ideally these would only be emitted if something actually changed.
+ emit q->titleChanged();
+ emit q->urlChanged();
+ emit q->iconChanged();
+ emit q->loadingChanged(QWebEngineLoadingInfo(m_url, LoadStatus::LoadSucceededStatus));
+ emit q->loadProgressChanged();
+
+ m_isBeingAdopted = false;
+}
+
+void QQuickWebEngineViewPrivate::setFullScreenMode(bool fullscreen)
+{
+ Q_Q(QQuickWebEngineView);
+ if (m_fullscreenMode != fullscreen) {
+ m_fullscreenMode = fullscreen;
+ adapter->changedFullScreen();
+ Q_EMIT q->isFullScreenChanged();
+ }
+}
+
+// static
+void QQuickWebEngineViewPrivate::bindViewAndDelegateItem(QQuickWebEngineViewPrivate *viewPrivate,
+ RenderWidgetHostViewQtDelegateItem *delegateItem)
+{
+ auto oldDelegateItem = viewPrivate ? viewPrivate->delegateItem : nullptr;
+ auto oldAdapterClient = delegateItem ? delegateItem->m_adapterClient : nullptr;
+
+ auto *oldViewPrivate = static_cast<QQuickWebEngineViewPrivate *>(oldAdapterClient);
+
+ // Change pointers first.
+
+ if (delegateItem && oldViewPrivate != viewPrivate) {
+ if (oldViewPrivate)
+ oldViewPrivate->delegateItem = nullptr;
+ delegateItem->m_adapterClient = viewPrivate;
+ }
+
+ if (viewPrivate && oldDelegateItem != delegateItem) {
+ if (oldDelegateItem)
+ oldDelegateItem->m_adapterClient = nullptr;
+ viewPrivate->delegateItem = delegateItem;
+ }
+
+ // Then notify.
+
+ if (oldViewPrivate && oldViewPrivate != viewPrivate)
+ oldViewPrivate->delegateItemChanged(delegateItem, nullptr);
+
+ if (viewPrivate && oldDelegateItem != delegateItem)
+ viewPrivate->delegateItemChanged(oldDelegateItem, delegateItem);
+}
+
+void QQuickWebEngineViewPrivate::delegateItemChanged(QtWebEngineCore::RenderWidgetHostViewQtDelegateItem *oldDelegateItem,
+ QtWebEngineCore::RenderWidgetHostViewQtDelegateItem *newDelegateItem)
+{
+ Q_Q(QQuickWebEngineView);
+
+ if (oldDelegateItem) {
+ oldDelegateItem->setParentItem(nullptr);
+#if QT_CONFIG(accessibility)
+ if (!QtWebEngineCore::closingDown()) {
+ if (auto iface = QAccessible::queryAccessibleInterface(oldDelegateItem))
+ QAccessible::deleteAccessibleInterface(QAccessible::uniqueId(iface));
+ }
+#endif
+ }
+
+ if (newDelegateItem) {
+ Q_ASSERT(!QtWebEngineCore::closingDown());
+#if QT_CONFIG(accessibility)
+ QAccessible::registerAccessibleInterface(new QtWebEngineCore::RenderWidgetHostViewQtDelegateQuickAccessible(newDelegateItem, q));
+#endif
+ newDelegateItem->setParentItem(q);
+ newDelegateItem->setSize(q->boundingRect().size());
+ // Focus on creation if the view accepts it
+ if (q->activeFocusOnPress())
+ newDelegateItem->setFocus(true);
+ }
+}
+
+void QQuickWebEngineViewPrivate::updateAction(QQuickWebEngineView::WebAction action) const
+{
+ QQuickWebEngineAction *a = actions[action];
+ if (!a)
+ return;
+
+ bool enabled = true;
+
+ switch (action) {
+ case QQuickWebEngineView::Back:
+ enabled = adapter->canGoBack();
+ break;
+ case QQuickWebEngineView::Forward:
+ enabled = adapter->canGoForward();
+ break;
+ case QQuickWebEngineView::Stop:
+ enabled = isLoading;
+ break;
+ case QQuickWebEngineView::Reload:
+ case QQuickWebEngineView::ReloadAndBypassCache:
+ enabled = !isLoading;
+ break;
+ case QQuickWebEngineView::ViewSource:
+ enabled = adapter->canViewSource();
+ break;
+ case QQuickWebEngineView::Cut:
+ case QQuickWebEngineView::Copy:
+ case QQuickWebEngineView::Unselect:
+ enabled = adapter->hasFocusedFrame() && !adapter->selectedText().isEmpty();
+ break;
+ case QQuickWebEngineView::Paste:
+ case QQuickWebEngineView::Undo:
+ case QQuickWebEngineView::Redo:
+ case QQuickWebEngineView::SelectAll:
+ case QQuickWebEngineView::PasteAndMatchStyle:
+ enabled = adapter->hasFocusedFrame();
+ break;
+ default:
+ break;
+ }
+
+ a->d_ptr->setEnabled(enabled);
+}
+
+void QQuickWebEngineViewPrivate::updateNavigationActions()
+{
+ updateAction(QQuickWebEngineView::Back);
+ updateAction(QQuickWebEngineView::Forward);
+ updateAction(QQuickWebEngineView::Stop);
+ updateAction(QQuickWebEngineView::Reload);
+ updateAction(QQuickWebEngineView::ReloadAndBypassCache);
+ updateAction(QQuickWebEngineView::ViewSource);
+}
+
+void QQuickWebEngineViewPrivate::updateEditActions()
+{
+ updateAction(QQuickWebEngineView::Cut);
+ updateAction(QQuickWebEngineView::Copy);
+ updateAction(QQuickWebEngineView::Paste);
+ updateAction(QQuickWebEngineView::Undo);
+ updateAction(QQuickWebEngineView::Redo);
+ updateAction(QQuickWebEngineView::SelectAll);
+ updateAction(QQuickWebEngineView::PasteAndMatchStyle);
+ updateAction(QQuickWebEngineView::Unselect);
+}
+
+QQuickWebEngineScriptCollection *QQuickWebEngineViewPrivate::getUserScripts()
+{
+ Q_Q(QQuickWebEngineView);
+ if (!m_scriptCollection)
+ m_scriptCollection.reset(
+ new QQuickWebEngineScriptCollection(
+ new QQuickWebEngineScriptCollectionPrivate(
+ new QWebEngineScriptCollectionPrivate(
+ profileAdapter()->userResourceController(), adapter))));
+
+ if (!m_scriptCollection->qmlEngine())
+ m_scriptCollection->setQmlEngine(qmlEngine(q));
+
+ return m_scriptCollection.data();
+}
+
+QUrl QQuickWebEngineView::url() const
+{
+ Q_D(const QQuickWebEngineView);
+ return d->m_url;
+}
+
+void QQuickWebEngineView::setUrl(const QUrl& url)
+{
+ Q_D(QQuickWebEngineView);
+ if (url.isEmpty())
+ return;
+
+ if (d->m_url != url) {
+ d->m_url = url;
+ d->m_html.clear();
+ emit urlChanged();
+ }
+
+ if (d->adapter->isInitialized()) {
+ d->adapter->load(url);
+ }
+}
+
+QUrl QQuickWebEngineView::icon() const
+{
+ Q_D(const QQuickWebEngineView);
+ return d->iconUrl;
+}
+
+void QQuickWebEngineView::loadHtml(const QString &html, const QUrl &baseUrl)
+{
+ Q_D(QQuickWebEngineView);
+ d->m_url = baseUrl;
+ d->m_html = html;
+ if (d->adapter->isInitialized()) {
+ d->adapter->setContent(html.toUtf8(), defaultMimeType, baseUrl);
+ return;
+ }
+}
+
+void QQuickWebEngineView::goBack()
+{
+ Q_D(QQuickWebEngineView);
+ d->adapter->navigateBack();
+}
+
+void QQuickWebEngineView::goForward()
+{
+ Q_D(QQuickWebEngineView);
+ d->adapter->navigateForward();
+}
+
+void QQuickWebEngineView::reload()
+{
+ Q_D(QQuickWebEngineView);
+ d->adapter->reload();
+}
+
+void QQuickWebEngineView::reloadAndBypassCache()
+{
+ Q_D(QQuickWebEngineView);
+ d->adapter->reloadAndBypassCache();
+}
+
+void QQuickWebEngineView::stop()
+{
+ Q_D(QQuickWebEngineView);
+ d->adapter->stop();
+}
+
+void QQuickWebEngineView::setZoomFactor(qreal arg)
+{
+ Q_D(QQuickWebEngineView);
+ if (d->adapter->isInitialized() && !qFuzzyCompare(arg, zoomFactor())) {
+ d->adapter->setZoomFactor(arg);
+ // MEMO: should reset if factor was not applied due to being invalid
+ d->m_zoomFactor = zoomFactor();
+ emit zoomFactorChanged(d->m_zoomFactor);
+ } else {
+ d->m_zoomFactor = arg;
+ }
+}
+
+QQuickWebEngineProfile *QQuickWebEngineView::profile()
+{
+ Q_D(QQuickWebEngineView);
+ d->initializeProfile();
+ return d->m_profile;
+}
+
+void QQuickWebEngineView::setProfile(QQuickWebEngineProfile *profile)
+{
+ Q_D(QQuickWebEngineView);
+
+ if (d->m_profile == profile)
+ return;
+
+ if (!d->profileInitialized()) {
+ d->m_profile = profile;
+ return;
+ }
+
+ if (d->m_profile)
+ d->m_profile->d_ptr->removeWebContentsAdapterClient(d);
+
+ d->m_profile = profile;
+ d->m_profile->d_ptr->addWebContentsAdapterClient(d);
+ d->m_settings->setParentSettings(profile->settings());
+
+ d->updateAdapter();
+ Q_EMIT profileChanged();
+}
+
+QQuickWebEngineSettings *QQuickWebEngineView::settings()
+{
+ Q_D(QQuickWebEngineView);
+ d->initializeProfile();
+ return d->m_settings.data();
+}
+
+QQuickWebEngineScriptCollection *QQuickWebEngineView::userScripts()
+{
+ Q_D(QQuickWebEngineView);
+ return d->getUserScripts();
+}
+
+void QQuickWebEngineViewPrivate::updateAdapter()
+{
+ // When the profile changes we need to create a new WebContentAdapter and reload the active URL.
+ bool wasInitialized = adapter->isInitialized();
+ adapter = QSharedPointer<WebContentsAdapter>::create();
+ adapter->setClient(this);
+ if (wasInitialized) {
+ if (!m_html.isEmpty())
+ adapter->setContent(m_html.toUtf8(), defaultMimeType, m_url);
+ else if (m_url.isValid())
+ adapter->load(m_url);
+ else
+ adapter->loadDefault();
+ }
+}
+
+bool QQuickWebEngineView::activeFocusOnPress() const
+{
+ Q_D(const QQuickWebEngineView);
+ return d->m_activeFocusOnPress;
+}
+
+void QQuickWebEngineViewPrivate::didRunJavaScript(quint64 requestId, const QVariant &result)
+{
+ Q_Q(QQuickWebEngineView);
+ QJSValue callback = m_callbacks.take(requestId);
+ QJSValueList args;
+ args.append(qmlEngine(q)->toScriptValue(result));
+ callback.call(args);
+}
+
+void QQuickWebEngineViewPrivate::didPrintPage(quint64 requestId, QSharedPointer<QByteArray> result)
+{
+ Q_Q(QQuickWebEngineView);
+ QJSValue callback = m_callbacks.take(requestId);
+ QJSValueList args;
+ args.append(qmlEngine(q)->toScriptValue(*(result.data())));
+ callback.call(args);
+}
+
+void QQuickWebEngineViewPrivate::didPrintPageToPdf(const QString &filePath, bool success)
+{
+ Q_Q(QQuickWebEngineView);
+ Q_EMIT q->pdfPrintingFinished(filePath, success);
+}
+
+void QQuickWebEngineViewPrivate::updateScrollPosition(const QPointF &position)
+{
+ Q_Q(QQuickWebEngineView);
+ Q_EMIT q->scrollPositionChanged(position);
+}
+
+void QQuickWebEngineViewPrivate::updateContentsSize(const QSizeF &size)
+{
+ Q_Q(QQuickWebEngineView);
+ Q_EMIT q->contentsSizeChanged(size);
+}
+
+void QQuickWebEngineViewPrivate::renderProcessTerminated(
+ RenderProcessTerminationStatus terminationStatus, int exitCode)
+{
+ Q_Q(QQuickWebEngineView);
+ Q_EMIT q->renderProcessTerminated(static_cast<QQuickWebEngineView::RenderProcessTerminationStatus>(
+ renderProcessExitStatus(terminationStatus)), exitCode);
+}
+
+void QQuickWebEngineViewPrivate::requestGeometryChange(const QRect &geometry, const QRect &frameGeometry)
+{
+ Q_Q(QQuickWebEngineView);
+ Q_EMIT q->geometryChangeRequested(geometry, frameGeometry);
+}
+
+QObject *QQuickWebEngineViewPrivate::dragSource() const
+{
+ // QTBUG-57516
+ // Fixme: This is just a band-aid workaround.
+#if QT_CONFIG(draganddrop)
+ return QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::MultipleWindows) ?
+ q_ptr : nullptr;
+#else
+ return nullptr;
+#endif
+}
+
+bool QQuickWebEngineViewPrivate::isEnabled() const
+{
+ const Q_Q(QQuickWebEngineView);
+ return q->isEnabled();
+}
+
+void QQuickWebEngineViewPrivate::setToolTip(const QString &toolTipText)
+{
+ Q_Q(QQuickWebEngineView);
+ QQuickWebEngineTooltipRequest *request = new QQuickWebEngineTooltipRequest(toolTipText, q);
+ // mark the object for gc by creating temporary jsvalue
+ qmlEngine(q)->newQObject(request);
+ Q_EMIT q->tooltipRequested(request);
+ if (!request->isAccepted())
+ ui()->showToolTip(toolTipText);
+}
+
+QtWebEngineCore::TouchHandleDrawableDelegate *
+QQuickWebEngineViewPrivate::createTouchHandleDelegate(const QMap<int, QImage> &images)
+{
+ Q_Q(QQuickWebEngineView);
+ // lifecycle managed by Chromium's TouchHandleDrawable
+ QQuickWebEngineTouchHandle *handle = new QQuickWebEngineTouchHandle();
+ if (m_touchHandleDelegate) {
+ QQmlContext *qmlContext = QQmlEngine::contextForObject(q);
+ QQmlContext *context = new QQmlContext(qmlContext, handle);
+ context->setContextObject(handle);
+ QObject *delegate = m_touchHandleDelegate->create(context);
+ Q_ASSERT(delegate);
+ QQuickItem *item = qobject_cast<QQuickItem *>(delegate);
+ item->setParentItem(q);
+ handle->setItem(item, false);
+ } else {
+ QQuickItem *item = ui()->createTouchHandle();
+ Q_ASSERT(item);
+ QQmlEngine *engine = qmlEngine(item);
+ Q_ASSERT(engine);
+ QQuickWebEngineTouchHandleProvider *touchHandleProvider =
+ static_cast<QQuickWebEngineTouchHandleProvider *>(
+ engine->imageProvider(QQuickWebEngineTouchHandleProvider::identifier()));
+ Q_ASSERT(touchHandleProvider);
+ touchHandleProvider->init(images);
+ handle->setItem(item, true);
+ }
+ return handle;
+}
+
+void QQuickWebEngineViewPrivate::showTouchSelectionMenu(QtWebEngineCore::TouchSelectionMenuController *menuController, const QRect &selectionBounds, const QSize &handleSize)
+{
+ Q_UNUSED(handleSize);
+ Q_Q(QQuickWebEngineView);
+
+ const int kSpacingBetweenButtons = 2;
+ const int kMenuButtonMinWidth = 63;
+ const int kMenuButtonMinHeight = 38;
+
+ QQuickWebEngineTouchSelectionMenuRequest *request = new QQuickWebEngineTouchSelectionMenuRequest(
+ selectionBounds, menuController);
+ qmlEngine(q)->newQObject(request);
+ Q_EMIT q->touchSelectionMenuRequested(request);
+
+ if (request->isAccepted()) {
+ return;
+ }
+
+ int buttonCount = menuController->buttonCount();
+ if (buttonCount == 1) {
+ menuController->runContextMenu();
+ return;
+ }
+
+ int width = (kSpacingBetweenButtons * (buttonCount + 1)) + (kMenuButtonMinWidth * buttonCount);
+ int height = kMenuButtonMinHeight + kSpacingBetweenButtons;
+ int x = (selectionBounds.x() + selectionBounds.x() + selectionBounds.width() - width) / 2;
+ int y = selectionBounds.y() - height - 2;
+
+ QRect bounds(x, y, width, height);
+ ui()->showTouchSelectionMenu(menuController, bounds, kSpacingBetweenButtons);
+}
+
+void QQuickWebEngineViewPrivate::hideTouchSelectionMenu()
+{
+ ui()->hideTouchSelectionMenu();
+}
+
+void QQuickWebEngineViewPrivate::showWebAuthDialog(QWebEngineWebAuthUxRequest *request)
+{
+ Q_Q(QQuickWebEngineView);
+ Q_EMIT q->webAuthUxRequested(request);
+}
+
+bool QQuickWebEngineView::isLoading() const
+{
+ Q_D(const QQuickWebEngineView);
+ return d->isLoading;
+}
+
+int QQuickWebEngineView::loadProgress() const
+{
+ Q_D(const QQuickWebEngineView);
+ return d->loadProgress;
+}
+
+QString QQuickWebEngineView::title() const
+{
+ Q_D(const QQuickWebEngineView);
+ return d->adapter->pageTitle();
+}
+
+bool QQuickWebEngineView::canGoBack() const
+{
+ Q_D(const QQuickWebEngineView);
+ return d->adapter->canGoBack();
+}
+
+bool QQuickWebEngineView::canGoForward() const
+{
+ Q_D(const QQuickWebEngineView);
+ return d->adapter->canGoForward();
+}
+
+void QQuickWebEngineView::runJavaScript(const QString &script, const QJSValue &callback)
+{
+ runJavaScript(script, QWebEngineScript::MainWorld, callback);
+}
+
+void QQuickWebEngineView::runJavaScript(const QString &script, quint32 worldId, const QJSValue &callback)
+{
+ Q_D(QQuickWebEngineView);
+ d->ensureContentsAdapter();
+ if (!callback.isUndefined()) {
+ quint64 requestId = d_ptr->adapter->runJavaScriptCallbackResult(script, worldId);
+ if (requestId) {
+ d->m_callbacks.insert(requestId, callback);
+ } else {
+ callback.call();
+ }
+ } else
+ d->adapter->runJavaScript(script, worldId);
+}
+
+qreal QQuickWebEngineView::zoomFactor() const
+{
+ Q_D(const QQuickWebEngineView);
+ if (!d->adapter->isInitialized())
+ return d->m_zoomFactor;
+ return d->adapter->currentZoomFactor();
+}
+
+QColor QQuickWebEngineView::backgroundColor() const
+{
+ Q_D(const QQuickWebEngineView);
+ return d->m_backgroundColor;
+}
+
+void QQuickWebEngineView::setBackgroundColor(const QColor &color)
+{
+ Q_D(QQuickWebEngineView);
+ if (color == d->m_backgroundColor)
+ return;
+ d->m_backgroundColor = color;
+ if (d->adapter->isInitialized()) {
+ d->adapter->setBackgroundColor(color);
+ emit backgroundColorChanged();
+ }
+}
+
+/*!
+ \property QQuickWebEngineView::audioMuted
+ \brief The state of whether the current page audio is muted.
+ \since 5.7
+
+ The default value is false.
+*/
+bool QQuickWebEngineView::isAudioMuted() const
+{
+ const Q_D(QQuickWebEngineView);
+ if (d->adapter->isInitialized())
+ return d->adapter->isAudioMuted();
+ return d->m_defaultAudioMuted;
+}
+
+void QQuickWebEngineView::setAudioMuted(bool muted)
+{
+ Q_D(QQuickWebEngineView);
+ bool wasAudioMuted = isAudioMuted();
+ d->m_defaultAudioMuted = muted;
+ d->adapter->setAudioMuted(muted);
+ if (wasAudioMuted != isAudioMuted())
+ Q_EMIT audioMutedChanged(muted);
+}
+
+bool QQuickWebEngineView::recentlyAudible() const
+{
+ const Q_D(QQuickWebEngineView);
+ return d->adapter->recentlyAudible();
+}
+
+qint64 QQuickWebEngineView::renderProcessPid() const
+{
+ const Q_D(QQuickWebEngineView);
+ return d->adapter->renderProcessPid();
+}
+
+void QQuickWebEngineView::printToPdf(const QString& filePath, PrintedPageSizeId pageSizeId, PrintedPageOrientation orientation)
+{
+#if QT_CONFIG(webengine_printing_and_pdf)
+ Q_D(QQuickWebEngineView);
+ QPageSize layoutSize(static_cast<QPageSize::PageSizeId>(pageSizeId));
+ QPageLayout::Orientation layoutOrientation = static_cast<QPageLayout::Orientation>(orientation);
+ QPageLayout pageLayout(layoutSize, layoutOrientation, QMarginsF(0.0, 0.0, 0.0, 0.0));
+ QPageRanges ranges;
+ d->ensureContentsAdapter();
+ d->adapter->printToPDF(pageLayout, ranges, filePath);
+#else
+ Q_UNUSED(filePath);
+ Q_UNUSED(pageSizeId);
+ Q_UNUSED(orientation);
+#endif
+}
+
+void QQuickWebEngineView::printToPdf(const QJSValue &callback, PrintedPageSizeId pageSizeId, PrintedPageOrientation orientation)
+{
+#if QT_CONFIG(webengine_printing_and_pdf)
+ Q_D(QQuickWebEngineView);
+ QPageSize layoutSize(static_cast<QPageSize::PageSizeId>(pageSizeId));
+ QPageLayout::Orientation layoutOrientation = static_cast<QPageLayout::Orientation>(orientation);
+ QPageLayout pageLayout(layoutSize, layoutOrientation, QMarginsF(0.0, 0.0, 0.0, 0.0));
+ QPageRanges ranges;
+
+ if (callback.isUndefined())
+ return;
+
+ d->ensureContentsAdapter();
+ quint64 requestId = d->adapter->printToPDFCallbackResult(pageLayout, ranges);
+ d->m_callbacks.insert(requestId, callback);
+#else
+ Q_UNUSED(pageSizeId);
+ Q_UNUSED(orientation);
+
+ // Call back with null result.
+ QJSValueList args;
+ args.append(QJSValue(QByteArray().data()));
+ QJSValue callbackCopy = callback;
+ callbackCopy.call(args);
+#endif
+}
+
+void QQuickWebEngineView::replaceMisspelledWord(const QString &replacement)
+{
+ Q_D(QQuickWebEngineView);
+ d->adapter->replaceMisspelling(replacement);
+}
+
+bool QQuickWebEngineView::isFullScreen() const
+{
+ Q_D(const QQuickWebEngineView);
+ return d->m_fullscreenMode;
+}
+
+void QQuickWebEngineView::findText(const QString &subString, FindFlags options, const QJSValue &callback)
+{
+ Q_D(QQuickWebEngineView);
+ if (!d->adapter->isInitialized())
+ return;
+
+ d->adapter->findTextHelper()->startFinding(subString, options & FindCaseSensitively, options & FindBackward, callback);
+}
+
+QWebEngineHistory *QQuickWebEngineView::history() const
+{
+ Q_D(const QQuickWebEngineView);
+ return d->m_history.data();
+}
+
+QQmlWebChannel *QQuickWebEngineView::webChannel()
+{
+#if QT_CONFIG(webengine_webchannel)
+ Q_D(QQuickWebEngineView);
+ if (!d->m_webChannel) {
+ d->m_webChannel = new QQmlWebChannel(this);
+ }
+ return d->m_webChannel;
+#endif
+ qWarning("WebEngine compiled without webchannel support");
+ return nullptr;
+}
+
+void QQuickWebEngineView::setWebChannel(QQmlWebChannel *webChannel)
+{
+#if QT_CONFIG(webengine_webchannel)
+ Q_D(QQuickWebEngineView);
+ if (d->m_webChannel == webChannel)
+ return;
+ d->m_webChannel = webChannel;
+ if (d->profileInitialized())
+ d->adapter->setWebChannel(webChannel, d->m_webChannelWorld);
+ Q_EMIT webChannelChanged();
+#else
+ Q_UNUSED(webChannel);
+ qWarning("WebEngine compiled without webchannel support");
+#endif
+}
+
+uint QQuickWebEngineView::webChannelWorld() const
+{
+ Q_D(const QQuickWebEngineView);
+ return d->m_webChannelWorld;
+}
+
+void QQuickWebEngineView::setWebChannelWorld(uint webChannelWorld)
+{
+#if QT_CONFIG(webengine_webchannel)
+ Q_D(QQuickWebEngineView);
+ if (d->m_webChannelWorld == webChannelWorld)
+ return;
+ d->m_webChannelWorld = webChannelWorld;
+ if (d->profileInitialized())
+ d->adapter->setWebChannel(d->m_webChannel, d->m_webChannelWorld);
+ Q_EMIT webChannelWorldChanged(webChannelWorld);
+#else
+ Q_UNUSED(webChannelWorld);
+ qWarning("WebEngine compiled without webchannel support");
+#endif
+}
+
+QQuickWebEngineView *QQuickWebEngineView::inspectedView() const
+{
+ Q_D(const QQuickWebEngineView);
+ return d->inspectedView;
+}
+
+void QQuickWebEngineView::setInspectedView(QQuickWebEngineView *view)
+{
+ Q_D(QQuickWebEngineView);
+ if (d->inspectedView == view)
+ return;
+ QQuickWebEngineView *oldView = d->inspectedView;
+ d->inspectedView = nullptr;
+ if (oldView)
+ oldView->setDevToolsView(nullptr);
+ d->inspectedView = view;
+ if (view)
+ view->setDevToolsView(this);
+ Q_EMIT inspectedViewChanged();
+}
+
+QQuickWebEngineView *QQuickWebEngineView::devToolsView() const
+{
+ Q_D(const QQuickWebEngineView);
+ return d->devToolsView;
+}
+
+QString QQuickWebEngineView::devToolsId()
+{
+ Q_D(QQuickWebEngineView);
+ d->ensureContentsAdapter();
+ return d->adapter->devToolsId();
+}
+
+void QQuickWebEngineView::setDevToolsView(QQuickWebEngineView *devToolsView)
+{
+ Q_D(QQuickWebEngineView);
+ if (d->devToolsView == devToolsView)
+ return;
+ QQuickWebEngineView *oldView = d->devToolsView;
+ d->devToolsView = nullptr;
+ if (oldView)
+ oldView->setInspectedView(nullptr);
+ d->devToolsView = devToolsView;
+ if (devToolsView)
+ devToolsView->setInspectedView(this);
+ if (d->profileInitialized() && d->adapter->isInitialized()) {
+ if (devToolsView)
+ d->adapter->openDevToolsFrontend(devToolsView->d_ptr->adapter);
+ else
+ d->adapter->closeDevToolsFrontend();
+ }
+ Q_EMIT devToolsViewChanged();
+}
+
+void QQuickWebEngineView::grantFeaturePermission(const QUrl &securityOrigin, QQuickWebEngineView::Feature feature, bool granted)
+{
+ if (!granted && ((feature >= MediaAudioCapture && feature <= MediaAudioVideoCapture) ||
+ (feature >= DesktopVideoCapture && feature <= DesktopAudioVideoCapture))) {
+ d_ptr->adapter->grantMediaAccessPermission(securityOrigin, WebContentsAdapterClient::MediaNone);
+ return;
+ }
+
+ switch (feature) {
+ case MediaAudioCapture:
+ d_ptr->adapter->grantMediaAccessPermission(securityOrigin, WebContentsAdapterClient::MediaAudioCapture);
+ break;
+ case MediaVideoCapture:
+ d_ptr->adapter->grantMediaAccessPermission(securityOrigin, WebContentsAdapterClient::MediaVideoCapture);
+ break;
+ case MediaAudioVideoCapture:
+ d_ptr->adapter->grantMediaAccessPermission(securityOrigin, WebContentsAdapterClient::MediaRequestFlags(WebContentsAdapterClient::MediaAudioCapture | WebContentsAdapterClient::MediaVideoCapture));
+ break;
+ case DesktopVideoCapture:
+ d_ptr->adapter->grantMediaAccessPermission(securityOrigin, WebContentsAdapterClient::MediaDesktopVideoCapture);
+ break;
+ case DesktopAudioVideoCapture:
+ d_ptr->adapter->grantMediaAccessPermission(
+ securityOrigin,
+ WebContentsAdapterClient::MediaRequestFlags(
+ WebContentsAdapterClient::MediaDesktopAudioCapture |
+ WebContentsAdapterClient::MediaDesktopVideoCapture));
+ break;
+ case Geolocation:
+ d_ptr->adapter->grantFeaturePermission(securityOrigin, ProfileAdapter::GeolocationPermission,
+ granted ? ProfileAdapter::AllowedPermission : ProfileAdapter::DeniedPermission);
+ break;
+ case Notifications:
+ d_ptr->adapter->grantFeaturePermission(securityOrigin, ProfileAdapter::NotificationPermission,
+ granted ? ProfileAdapter::AllowedPermission : ProfileAdapter::DeniedPermission);
+ break;
+ case ClipboardReadWrite:
+ d_ptr->adapter->grantFeaturePermission(securityOrigin, ProfileAdapter::ClipboardReadWrite,
+ granted ? ProfileAdapter::AllowedPermission
+ : ProfileAdapter::DeniedPermission);
+ break;
+ case LocalFontsAccess:
+ d_ptr->adapter->grantFeaturePermission(securityOrigin, ProfileAdapter::LocalFontsPermission,
+ granted ? ProfileAdapter::AllowedPermission : ProfileAdapter::DeniedPermission);
+ break;
+ default:
+ Q_UNREACHABLE();
+ }
+}
+
+void QQuickWebEngineView::setActiveFocusOnPress(bool arg)
+{
+ Q_D(QQuickWebEngineView);
+ if (d->m_activeFocusOnPress == arg)
+ return;
+
+ d->m_activeFocusOnPress = arg;
+ emit activeFocusOnPressChanged(arg);
+}
+
+void QQuickWebEngineView::goBackOrForward(int offset)
+{
+ Q_D(QQuickWebEngineView);
+ const int current = d->adapter->currentNavigationEntryIndex();
+ const int count = d->adapter->navigationEntryCount();
+ const int index = current + offset;
+
+ if (index < 0 || index >= count)
+ return;
+
+ d->adapter->navigateToIndex(index);
+}
+
+void QQuickWebEngineView::fullScreenCancelled()
+{
+ Q_D(QQuickWebEngineView);
+ d->adapter->exitFullScreen();
+}
+
+void QQuickWebEngineView::geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry)
+{
+ QQuickItem::geometryChange(newGeometry, oldGeometry);
+ Q_D(QQuickWebEngineView);
+ if (d->delegateItem)
+ d->delegateItem->setSize(newGeometry.size());
+}
+
+void QQuickWebEngineView::itemChange(ItemChange change, const ItemChangeData &value)
+{
+ Q_D(QQuickWebEngineView);
+ if (d && d->profileInitialized() && d->adapter->isInitialized()
+ && (change == ItemSceneChange || change == ItemVisibleHasChanged)) {
+ if (window())
+ d->adapter->setVisible(isVisible());
+ }
+ QQuickItem::itemChange(change, value);
+}
+
+void QQuickWebEngineView::acceptAsNewWindow(QWebEngineNewWindowRequest *request)
+{
+ Q_D(QQuickWebEngineView);
+ if (!request || (!request->d_ptr->adapter && !request->requestedUrl().isValid())
+ || request->d_ptr->isRequestHandled) {
+ qWarning("Trying to open an empty request, it was either already used or was invalidated."
+ "\nYou must complete the request synchronously within the newWindowRequested signal handler."
+ " If a view hasn't been adopted before returning, the request will be invalidated.");
+ return;
+ }
+
+ auto adapter = request->d_ptr->adapter;
+ if (!adapter)
+ setUrl(request->requestedUrl());
+ else if (!d->adoptWebContents(adapter.data()))
+ return;
+
+ request->d_ptr->setHandled();
+}
+
+#if QT_CONFIG(draganddrop)
+static QPointF mapToScreen(const QQuickItem *item, const QPointF &clientPos)
+{
+ return item->window()->position() + item->mapToScene(clientPos);
+}
+
+void QQuickWebEngineView::dragEnterEvent(QDragEnterEvent *e)
+{
+ Q_D(QQuickWebEngineView);
+ e->accept();
+ d->adapter->enterDrag(e, mapToScreen(this, e->position()));
+}
+
+void QQuickWebEngineView::dragLeaveEvent(QDragLeaveEvent *e)
+{
+ Q_D(QQuickWebEngineView);
+ e->accept();
+ d->adapter->leaveDrag();
+}
+
+void QQuickWebEngineView::dragMoveEvent(QDragMoveEvent *e)
+{
+ Q_D(QQuickWebEngineView);
+ Qt::DropAction dropAction = d->adapter->updateDragPosition(e, mapToScreen(this, e->position()));
+ if (Qt::IgnoreAction == dropAction) {
+ e->ignore();
+ } else {
+ e->setDropAction(dropAction);
+ e->accept();
+ }
+}
+
+void QQuickWebEngineView::dropEvent(QDropEvent *e)
+{
+ Q_D(QQuickWebEngineView);
+ e->accept();
+ d->adapter->endDragging(e, mapToScreen(this, e->position()));
+}
+#endif // QT_CONFIG(draganddrop)
+
+void QQuickWebEngineView::triggerWebAction(WebAction action)
+{
+ Q_D(QQuickWebEngineView);
+ switch (action) {
+ case Back:
+ d->adapter->navigateBack();
+ break;
+ case Forward:
+ d->adapter->navigateForward();
+ break;
+ case Stop:
+ d->adapter->stop();
+ break;
+ case Reload:
+ d->adapter->reload();
+ break;
+ case ReloadAndBypassCache:
+ d->adapter->reloadAndBypassCache();
+ break;
+ case Cut:
+ d->adapter->cut();
+ break;
+ case Copy:
+ d->adapter->copy();
+ break;
+ case Paste:
+ d->adapter->paste();
+ break;
+ case Undo:
+ d->adapter->undo();
+ break;
+ case Redo:
+ d->adapter->redo();
+ break;
+ case SelectAll:
+ d->adapter->selectAll();
+ break;
+ case PasteAndMatchStyle:
+ d->adapter->pasteAndMatchStyle();
+ break;
+ case Unselect:
+ d->adapter->unselect();
+ break;
+ case OpenLinkInThisWindow:
+ if (d->m_contextMenuRequest->filteredLinkUrl().isValid())
+ setUrl(d->m_contextMenuRequest->filteredLinkUrl());
+ break;
+ case OpenLinkInNewWindow:
+ if (d->m_contextMenuRequest->filteredLinkUrl().isValid()) {
+ QQuickWebEngineNewWindowRequest request(QWebEngineNewWindowRequest::InNewWindow, QRect(),
+ d->m_contextMenuRequest->filteredLinkUrl(), true, nullptr);
+ Q_EMIT newWindowRequested(&request);
+ }
+ break;
+ case OpenLinkInNewTab:
+ if (d->m_contextMenuRequest->filteredLinkUrl().isValid()) {
+ QQuickWebEngineNewWindowRequest request(QWebEngineNewWindowRequest::InNewBackgroundTab, QRect(),
+ d->m_contextMenuRequest->filteredLinkUrl(), true, nullptr);
+ Q_EMIT newWindowRequested(&request);
+ }
+ break;
+ case CopyLinkToClipboard:
+ if (!d->m_contextMenuRequest->linkUrl().isEmpty()) {
+ QString urlString =
+ d->m_contextMenuRequest->linkUrl().toString(QUrl::FullyEncoded);
+ QString linkText = d->m_contextMenuRequest->linkText().toHtmlEscaped();
+ QString title = d->m_contextMenuRequest->titleText();
+ if (!title.isEmpty())
+ title = QStringLiteral(" title=\"%1\"").arg(title.toHtmlEscaped());
+ QMimeData *data = new QMimeData();
+ data->setText(urlString);
+ QString html = QStringLiteral("<a href=\"") + urlString + QStringLiteral("\"") + title + QStringLiteral(">")
+ + linkText + QStringLiteral("</a>");
+ data->setHtml(html);
+ data->setUrls(QList<QUrl>() << d->m_contextMenuRequest->linkUrl());
+ qApp->clipboard()->setMimeData(data);
+ }
+ break;
+ case DownloadLinkToDisk:
+ if (d->m_contextMenuRequest->filteredLinkUrl().isValid())
+ d->adapter->download(d->m_contextMenuRequest->filteredLinkUrl(),
+ d->m_contextMenuRequest->suggestedFileName(),
+ d->m_contextMenuRequest->referrerUrl(),
+ d->m_contextMenuRequest->referrerPolicy());
+ break;
+ case CopyImageToClipboard:
+ if (d->m_contextMenuRequest->hasImageContent()
+ && (d->m_contextMenuRequest->mediaType() == QWebEngineContextMenuRequest::MediaTypeImage
+ || d->m_contextMenuRequest->mediaType()
+ == QWebEngineContextMenuRequest::MediaTypeCanvas)) {
+ d->adapter->copyImageAt(d->m_contextMenuRequest->position());
+ }
+ break;
+ case CopyImageUrlToClipboard:
+ if (d->m_contextMenuRequest->mediaUrl().isValid()
+ && d->m_contextMenuRequest->mediaType()
+ == QWebEngineContextMenuRequest::MediaTypeImage) {
+ QString urlString = d->m_contextMenuRequest->mediaUrl().toString(QUrl::FullyEncoded);
+ QString alt = d->m_contextMenuRequest->altText();
+ if (!alt.isEmpty())
+ alt = QStringLiteral(" alt=\"%1\"").arg(alt.toHtmlEscaped());
+ QString title = d->m_contextMenuRequest->titleText();
+ if (!title.isEmpty())
+ title = QStringLiteral(" title=\"%1\"").arg(title.toHtmlEscaped());
+ QMimeData *data = new QMimeData();
+ data->setText(urlString);
+ QString html = QStringLiteral("<img src=\"") + urlString + QStringLiteral("\"") + title + alt + QStringLiteral("></img>");
+ data->setHtml(html);
+ data->setUrls(QList<QUrl>() << d->m_contextMenuRequest->mediaUrl());
+ qApp->clipboard()->setMimeData(data);
+ }
+ break;
+ case DownloadImageToDisk:
+ case DownloadMediaToDisk:
+ if (d->m_contextMenuRequest->mediaUrl().isValid())
+ d->adapter->download(d->m_contextMenuRequest->mediaUrl(),
+ d->m_contextMenuRequest->suggestedFileName(),
+ d->m_contextMenuRequest->referrerUrl(),
+ d->m_contextMenuRequest->referrerPolicy());
+ break;
+ case CopyMediaUrlToClipboard:
+ if (d->m_contextMenuRequest->mediaUrl().isValid()
+ && (d->m_contextMenuRequest->mediaType() == QWebEngineContextMenuRequest::MediaTypeAudio
+ || d->m_contextMenuRequest->mediaType()
+ == QWebEngineContextMenuRequest::MediaTypeVideo)) {
+ QString urlString = d->m_contextMenuRequest->mediaUrl().toString(QUrl::FullyEncoded);
+ QString title = d->m_contextMenuRequest->titleText();
+ if (!title.isEmpty())
+ title = QStringLiteral(" title=\"%1\"").arg(title.toHtmlEscaped());
+ QMimeData *data = new QMimeData();
+ data->setText(urlString);
+ if (d->m_contextMenuRequest->mediaType()
+ == QWebEngineContextMenuRequest::MediaTypeAudio)
+ data->setHtml(QStringLiteral("<audio src=\"") + urlString + QStringLiteral("\"") + title +
+ QStringLiteral("></audio>"));
+ else
+ data->setHtml(QStringLiteral("<video src=\"") + urlString + QStringLiteral("\"") + title +
+ QStringLiteral("></video>"));
+ data->setUrls(QList<QUrl>() << d->m_contextMenuRequest->mediaUrl());
+ qApp->clipboard()->setMimeData(data);
+ }
+ break;
+ case ToggleMediaControls:
+ if (d->m_contextMenuRequest->mediaUrl().isValid()
+ && d->m_contextMenuRequest->mediaFlags()
+ & QWebEngineContextMenuRequest::MediaCanToggleControls) {
+ bool enable = !(d->m_contextMenuRequest->mediaFlags()
+ & QWebEngineContextMenuRequest::MediaControls);
+ d->adapter->executeMediaPlayerActionAt(d->m_contextMenuRequest->position(),
+ WebContentsAdapter::MediaPlayerControls, enable);
+ }
+ break;
+ case ToggleMediaLoop:
+ if (d->m_contextMenuRequest->mediaUrl().isValid()
+ && (d->m_contextMenuRequest->mediaType() == QWebEngineContextMenuRequest::MediaTypeAudio
+ || d->m_contextMenuRequest->mediaType()
+ == QWebEngineContextMenuRequest::MediaTypeVideo)) {
+ bool enable = !(d->m_contextMenuRequest->mediaFlags()
+ & QWebEngineContextMenuRequest::MediaLoop);
+ d->adapter->executeMediaPlayerActionAt(d->m_contextMenuRequest->position(),
+ WebContentsAdapter::MediaPlayerLoop, enable);
+ }
+ break;
+ case ToggleMediaPlayPause:
+ if (d->m_contextMenuRequest->mediaUrl().isValid()
+ && (d->m_contextMenuRequest->mediaType() == QWebEngineContextMenuRequest::MediaTypeAudio
+ || d->m_contextMenuRequest->mediaType()
+ == QWebEngineContextMenuRequest::MediaTypeVideo)) {
+ bool enable = (d->m_contextMenuRequest->mediaFlags()
+ & QWebEngineContextMenuRequest::MediaPaused);
+ d->adapter->executeMediaPlayerActionAt(d->m_contextMenuRequest->position(),
+ WebContentsAdapter::MediaPlayerPlay, enable);
+ }
+ break;
+ case ToggleMediaMute:
+ if (d->m_contextMenuRequest->mediaUrl().isValid()
+ && d->m_contextMenuRequest->mediaFlags()
+ & QWebEngineContextMenuRequest::MediaHasAudio) {
+ bool enable = !(d->m_contextMenuRequest->mediaFlags()
+ & QWebEngineContextMenuRequest::MediaMuted);
+ d->adapter->executeMediaPlayerActionAt(d->m_contextMenuRequest->position(),
+ WebContentsAdapter::MediaPlayerMute, enable);
+ }
+ break;
+ case InspectElement:
+ d->adapter->inspectElementAt(d->m_contextMenuRequest->position());
+ break;
+ case ExitFullScreen:
+ d->adapter->exitFullScreen();
+ break;
+ case RequestClose:
+ d->adapter->requestClose();
+ break;
+ case SavePage:
+ d->adapter->save();
+ break;
+ case ViewSource:
+ d->adapter->viewSource();
+ break;
+ case ToggleBold:
+ runJavaScript(QStringLiteral("document.execCommand('bold');"), QWebEngineScript::ApplicationWorld);
+ break;
+ case ToggleItalic:
+ runJavaScript(QStringLiteral("document.execCommand('italic');"), QWebEngineScript::ApplicationWorld);
+ break;
+ case ToggleUnderline:
+ runJavaScript(QStringLiteral("document.execCommand('underline');"), QWebEngineScript::ApplicationWorld);
+ break;
+ case ToggleStrikethrough:
+ runJavaScript(QStringLiteral("document.execCommand('strikethrough');"), QWebEngineScript::ApplicationWorld);
+ break;
+ case AlignLeft:
+ runJavaScript(QStringLiteral("document.execCommand('justifyLeft');"), QWebEngineScript::ApplicationWorld);
+ break;
+ case AlignCenter:
+ runJavaScript(QStringLiteral("document.execCommand('justifyCenter');"), QWebEngineScript::ApplicationWorld);
+ break;
+ case AlignRight:
+ runJavaScript(QStringLiteral("document.execCommand('justifyRight');"), QWebEngineScript::ApplicationWorld);
+ break;
+ case AlignJustified:
+ runJavaScript(QStringLiteral("document.execCommand('justifyFull');"), QWebEngineScript::ApplicationWorld);
+ break;
+ case Indent:
+ runJavaScript(QStringLiteral("document.execCommand('indent');"), QWebEngineScript::ApplicationWorld);
+ break;
+ case Outdent:
+ runJavaScript(QStringLiteral("document.execCommand('outdent');"), QWebEngineScript::ApplicationWorld);
+ break;
+ case InsertOrderedList:
+ runJavaScript(QStringLiteral("document.execCommand('insertOrderedList');"), QWebEngineScript::ApplicationWorld);
+ break;
+ case InsertUnorderedList:
+ runJavaScript(QStringLiteral("document.execCommand('insertUnorderedList');"), QWebEngineScript::ApplicationWorld);
+ break;
+ case ChangeTextDirectionLTR:
+ d->adapter->changeTextDirection(true /*left to right*/);
+ break;
+ case ChangeTextDirectionRTL:
+ d->adapter->changeTextDirection(false /*left to right*/);
+ break;
+ default:
+ // Reachable when a spell checker replacement word has been selected
+ break;
+ }
+}
+
+QQuickWebEngineAction *QQuickWebEngineView::action(WebAction action)
+{
+ Q_D(QQuickWebEngineView);
+ if (action == QQuickWebEngineView::NoWebAction)
+ return nullptr;
+ if (d->actions[action]) {
+ d->updateAction(action);
+ return d->actions[action];
+ }
+
+ const QString text = QWebEnginePagePrivate::actionText(action);
+ QString iconName;
+
+ switch (action) {
+ case Back:
+ iconName = QStringLiteral("go-previous");
+ break;
+ case Forward:
+ iconName = QStringLiteral("go-next");
+ break;
+ case Stop:
+ iconName = QStringLiteral("process-stop");
+ break;
+ case Reload:
+ iconName = QStringLiteral("view-refresh");
+ break;
+ case ReloadAndBypassCache:
+ iconName = QStringLiteral("view-refresh");
+ break;
+ case Cut:
+ iconName = QStringLiteral("edit-cut");
+ break;
+ case Copy:
+ iconName = QStringLiteral("edit-copy");
+ break;
+ case Paste:
+ iconName = QStringLiteral("edit-paste");
+ break;
+ case Undo:
+ iconName = QStringLiteral("edit-undo");
+ break;
+ case Redo:
+ iconName = QStringLiteral("edit-redo");
+ break;
+ case SelectAll:
+ iconName = QStringLiteral("edit-select-all");
+ break;
+ case PasteAndMatchStyle:
+ iconName = QStringLiteral("edit-paste");
+ break;
+ case OpenLinkInThisWindow:
+ case OpenLinkInNewWindow:
+ case OpenLinkInNewTab:
+ case CopyLinkToClipboard:
+ case DownloadLinkToDisk:
+ case CopyImageToClipboard:
+ case CopyImageUrlToClipboard:
+ case DownloadImageToDisk:
+ case CopyMediaUrlToClipboard:
+ case ToggleMediaControls:
+ case ToggleMediaLoop:
+ break;
+ case ToggleMediaPlayPause:
+ iconName = QStringLiteral("media-playback-start");
+ break;
+ case ToggleMediaMute:
+ iconName = QStringLiteral("audio-volume-muted");
+ break;
+ case DownloadMediaToDisk:
+ case InspectElement:
+ break;
+ case ExitFullScreen:
+ iconName = QStringLiteral("view-fullscreen");
+ break;
+ case RequestClose:
+ iconName = QStringLiteral("window-close");
+ break;
+ case Unselect:
+ iconName = QStringLiteral("edit-select-none");
+ break;
+ case SavePage:
+ iconName = QStringLiteral("document-save");
+ break;
+ case OpenLinkInNewBackgroundTab:
+ break;
+ case ViewSource:
+ break;
+ case ToggleBold:
+ iconName = QStringLiteral("format-text-bold");
+ break;
+ case ToggleItalic:
+ iconName = QStringLiteral("format-text-italic");
+ break;
+ case ToggleUnderline:
+ iconName = QStringLiteral("format-text-underline");
+ break;
+ case ToggleStrikethrough:
+ iconName = QStringLiteral("format-text-strikethrough");
+ break;
+ case AlignLeft:
+ break;
+ case AlignCenter:
+ break;
+ case AlignRight:
+ break;
+ case AlignJustified:
+ break;
+ case Indent:
+ iconName = QStringLiteral("format-indent-more");
+ break;
+ case Outdent:
+ iconName = QStringLiteral("format-indent-less");
+ break;
+ case InsertOrderedList:
+ case InsertUnorderedList:
+ case ChangeTextDirectionLTR:
+ case ChangeTextDirectionRTL:
+ break;
+ case NoWebAction:
+ case WebActionCount:
+ Q_UNREACHABLE();
+ break;
+ }
+
+ QQuickWebEngineAction *retVal = new QQuickWebEngineAction(action, text, iconName, false, this);
+
+ d->actions[action] = retVal;
+ d->updateAction(action);
+ return retVal;
+}
+
+QSizeF QQuickWebEngineView::contentsSize() const
+{
+ Q_D(const QQuickWebEngineView);
+ return d->adapter->lastContentsSize();
+}
+
+QPointF QQuickWebEngineView::scrollPosition() const
+{
+ Q_D(const QQuickWebEngineView);
+ return d->adapter->lastScrollOffset();
+}
+
+void QQuickWebEngineView::componentComplete()
+{
+ QQuickItem::componentComplete();
+ Q_D(QQuickWebEngineView);
+ d->initializeProfile();
+#if QT_CONFIG(accessibility)
+ // Enable accessibility via a dynamic QQmlProperty, instead of using private API call
+ // QQuickAccessibleAttached::qmlAttachedProperties(this). The qmlContext is required, otherwise
+ // it is not possible to reference attached properties.
+ QQmlContext *qmlContext = QQmlEngine::contextForObject(this);
+ QQmlProperty role(this, QStringLiteral("Accessible.role"), qmlContext);
+ role.write(QAccessible::Grouping);
+#endif // QT_CONFIG(accessibility)
+
+ QTimer::singleShot(0, this, &QQuickWebEngineView::lazyInitialize);
+}
+
+void QQuickWebEngineView::lazyInitialize()
+{
+ Q_D(QQuickWebEngineView);
+ d->ensureContentsAdapter();
+}
+
+QQuickWebEngineView::LifecycleState QQuickWebEngineView::lifecycleState() const
+{
+ Q_D(const QQuickWebEngineView);
+ return static_cast<LifecycleState>(d->adapter->lifecycleState());
+}
+
+void QQuickWebEngineView::setLifecycleState(LifecycleState state)
+{
+ Q_D(QQuickWebEngineView);
+ d->adapter->setLifecycleState(static_cast<WebContentsAdapterClient::LifecycleState>(state));
+}
+
+QQuickWebEngineView::LifecycleState QQuickWebEngineView::recommendedState() const
+{
+ Q_D(const QQuickWebEngineView);
+ return static_cast<LifecycleState>(d->adapter->recommendedState());
+}
+
+QQuickContextMenuBuilder::QQuickContextMenuBuilder(QWebEngineContextMenuRequest *request,
+ QQuickWebEngineView *view, QObject *menu)
+ : QtWebEngineCore::RenderViewContextMenuQt(request), m_view(view), m_menu(menu)
+{
+}
+
+void QQuickContextMenuBuilder::appendExtraItems(QQmlEngine *engine)
+{
+ Q_UNUSED(engine);
+ m_view->d_ptr->ui()->addMenuSeparator(m_menu);
+ if (QObject *menuExtras = m_view->d_ptr->contextMenuExtraItems->create(qmlContext(m_view))) {
+ menuExtras->setParent(m_menu);
+ QQmlListReference entries(m_menu, defaultPropertyName(m_menu));
+ if (entries.isValid())
+ entries.append(menuExtras);
+ }
+}
+
+bool QQuickContextMenuBuilder::hasInspector()
+{
+ return m_view->d_ptr->adapter->hasInspector();
+}
+
+bool QQuickContextMenuBuilder::isFullScreenMode()
+{
+ return m_view->d_ptr->isFullScreenMode();
+}
+
+void QQuickContextMenuBuilder::addMenuItem(ContextMenuItem menuItem)
+{
+ QQuickWebEngineAction *action = nullptr;
+
+ switch (menuItem) {
+ case ContextMenuItem::Back:
+ action = m_view->action(QQuickWebEngineView::Back);
+ break;
+ case ContextMenuItem::Forward:
+ action = m_view->action(QQuickWebEngineView::Forward);
+ break;
+ case ContextMenuItem::Reload:
+ action = m_view->action(QQuickWebEngineView::Reload);
+ break;
+ case ContextMenuItem::Cut:
+ action = m_view->action(QQuickWebEngineView::Cut);
+ break;
+ case ContextMenuItem::Copy:
+ action = m_view->action(QQuickWebEngineView::Copy);
+ break;
+ case ContextMenuItem::Paste:
+ action = m_view->action(QQuickWebEngineView::Paste);
+ break;
+ case ContextMenuItem::Undo:
+ action = m_view->action(QQuickWebEngineView::Undo);
+ break;
+ case ContextMenuItem::Redo:
+ action = m_view->action(QQuickWebEngineView::Redo);
+ break;
+ case ContextMenuItem::SelectAll:
+ action = m_view->action(QQuickWebEngineView::SelectAll);
+ break;
+ case ContextMenuItem::PasteAndMatchStyle:
+ action = m_view->action(QQuickWebEngineView::PasteAndMatchStyle);
+ break;
+ case ContextMenuItem::OpenLinkInNewWindow:
+ action = m_view->action(QQuickWebEngineView::OpenLinkInNewWindow);
+ break;
+ case ContextMenuItem::OpenLinkInNewTab:
+ action = m_view->action(QQuickWebEngineView::OpenLinkInNewTab);
+ break;
+ case ContextMenuItem::CopyLinkToClipboard:
+ action = m_view->action(QQuickWebEngineView::CopyLinkToClipboard);
+ break;
+ case ContextMenuItem::DownloadLinkToDisk:
+ action = m_view->action(QQuickWebEngineView::DownloadLinkToDisk);
+ break;
+ case ContextMenuItem::CopyImageToClipboard:
+ action = m_view->action(QQuickWebEngineView::CopyImageToClipboard);
+ break;
+ case ContextMenuItem::CopyImageUrlToClipboard:
+ action = m_view->action(QQuickWebEngineView::CopyImageUrlToClipboard);
+ break;
+ case ContextMenuItem::DownloadImageToDisk:
+ action = m_view->action(QQuickWebEngineView::DownloadImageToDisk);
+ break;
+ case ContextMenuItem::CopyMediaUrlToClipboard:
+ action = m_view->action(QQuickWebEngineView::CopyMediaUrlToClipboard);
+ break;
+ case ContextMenuItem::ToggleMediaControls:
+ action = m_view->action(QQuickWebEngineView::ToggleMediaControls);
+ break;
+ case ContextMenuItem::ToggleMediaLoop:
+ action = m_view->action(QQuickWebEngineView::ToggleMediaLoop);
+ break;
+ case ContextMenuItem::DownloadMediaToDisk:
+ action = m_view->action(QQuickWebEngineView::DownloadMediaToDisk);
+ break;
+ case ContextMenuItem::InspectElement:
+ action = m_view->action(QQuickWebEngineView::InspectElement);
+ break;
+ case ContextMenuItem::ExitFullScreen:
+ action = m_view->action(QQuickWebEngineView::ExitFullScreen);
+ break;
+ case ContextMenuItem::SavePage:
+ action = m_view->action(QQuickWebEngineView::SavePage);
+ break;
+ case ContextMenuItem::ViewSource:
+ action = m_view->action(QQuickWebEngineView::ViewSource);
+ break;
+ case ContextMenuItem::SpellingSuggestions:
+ {
+ QPointer<QQuickWebEngineView> thisRef(m_view);
+ for (int i = 0; i < m_contextData->spellCheckerSuggestions().size() && i < 4; i++) {
+ action = new QQuickWebEngineAction(m_menu);
+ QString replacement = m_contextData->spellCheckerSuggestions().at(i);
+ QObject::connect(action, &QQuickWebEngineAction::triggered, [thisRef, replacement] { thisRef->replaceMisspelledWord(replacement); });
+ action->d_ptr->m_text = replacement;
+ action->d_ptr->m_enabled = true;
+ m_view->d_ptr->ui()->addMenuItem(action, m_menu);
+ }
+ return;
+ }
+ case ContextMenuItem::Separator:
+ m_view->d_ptr->ui()->addMenuSeparator(m_menu);
+ return;
+ }
+ // Set enabled property directly with avoiding binding loops caused by its notifier signal.
+ action->d_ptr->m_enabled = isMenuItemEnabled(menuItem);
+ m_view->d_ptr->ui()->addMenuItem(action, m_menu);
+}
+
+bool QQuickContextMenuBuilder::isMenuItemEnabled(ContextMenuItem menuItem)
+{
+ switch (menuItem) {
+ case ContextMenuItem::Back:
+ return m_view->canGoBack();
+ case ContextMenuItem::Forward:
+ return m_view->canGoForward();
+ case ContextMenuItem::Reload:
+ return true;
+ case ContextMenuItem::Cut:
+ return m_contextData->editFlags() & QWebEngineContextMenuRequest::CanCut;
+ case ContextMenuItem::Copy:
+ return m_contextData->editFlags() & QWebEngineContextMenuRequest::CanCopy;
+ case ContextMenuItem::Paste:
+ return m_contextData->editFlags() & QWebEngineContextMenuRequest::CanPaste;
+ case ContextMenuItem::Undo:
+ return m_contextData->editFlags() & QWebEngineContextMenuRequest::CanUndo;
+ case ContextMenuItem::Redo:
+ return m_contextData->editFlags() & QWebEngineContextMenuRequest::CanRedo;
+ case ContextMenuItem::SelectAll:
+ return m_contextData->editFlags() & QWebEngineContextMenuRequest::CanSelectAll;
+ case ContextMenuItem::PasteAndMatchStyle:
+ return m_contextData->editFlags() & QWebEngineContextMenuRequest::CanPaste;
+ case ContextMenuItem::OpenLinkInNewWindow:
+ case ContextMenuItem::OpenLinkInNewTab:
+ case ContextMenuItem::CopyLinkToClipboard:
+ case ContextMenuItem::DownloadLinkToDisk:
+ case ContextMenuItem::CopyImageToClipboard:
+ case ContextMenuItem::CopyImageUrlToClipboard:
+ case ContextMenuItem::DownloadImageToDisk:
+ case ContextMenuItem::CopyMediaUrlToClipboard:
+ case ContextMenuItem::ToggleMediaControls:
+ case ContextMenuItem::ToggleMediaLoop:
+ case ContextMenuItem::DownloadMediaToDisk:
+ case ContextMenuItem::InspectElement:
+ case ContextMenuItem::ExitFullScreen:
+ case ContextMenuItem::SavePage:
+ return true;
+ case ContextMenuItem::ViewSource:
+ return m_view->d_ptr->adapter->canViewSource();
+ case ContextMenuItem::SpellingSuggestions:
+ case ContextMenuItem::Separator:
+ return true;
+ }
+ Q_UNREACHABLE();
+}
+
+void QQuickWebEngineView::setTouchHandleDelegate(QQmlComponent *delegate)
+{
+ if (d_ptr->m_touchHandleDelegate != delegate) {
+ d_ptr->m_touchHandleDelegate = delegate;
+ d_ptr->webContentsAdapter()->resetTouchSelectionController();
+ emit touchHandleDelegateChanged();
+ }
+}
+
+QQmlComponent *QQuickWebEngineView::touchHandleDelegate() const
+{
+ return d_ptr->m_touchHandleDelegate;
+}
+
+void QQuickWebEngineView::save(const QString &filePath,
+ QWebEngineDownloadRequest::SavePageFormat format) const
+{
+ Q_D(const QQuickWebEngineView);
+ d->adapter->save(filePath, format);
+}
+
+QT_END_NAMESPACE
+
+#include "moc_qquickwebengineview_p.cpp"
+#include "moc_qquickwebengineforeigntypes_p.cpp"
diff --git a/src/webenginequick/api/qquickwebengineview_p.h b/src/webenginequick/api/qquickwebengineview_p.h
new file mode 100644
index 000000000..0fdd9f787
--- /dev/null
+++ b/src/webenginequick/api/qquickwebengineview_p.h
@@ -0,0 +1,586 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QQUICKWEBENGINEVIEW_P_H
+#define QQUICKWEBENGINEVIEW_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtWebEngineCore/qtwebenginecoreglobal.h>
+#include <QtWebEngineCore/qwebenginequotarequest.h>
+#include <QtWebEngineCore/qwebenginedesktopmediarequest.h>
+#include <QtWebEngineCore/qwebenginedownloadrequest.h>
+#include <QtWebEngineQuick/private/qtwebenginequickglobal_p.h>
+#include <QtGui/qcolor.h>
+#include <QtQml/qqmlregistration.h>
+#include <QtQuick/qquickitem.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQmlWebChannel;
+class QQmlComponent;
+class QQuickContextMenuBuilder;
+class QQuickWebEngineAction;
+class QQuickWebEngineAuthenticationDialogRequest;
+class QQuickWebEngineClientCertificateSelection;
+class QQuickWebEngineColorDialogRequest;
+class QQuickWebEngineFileDialogRequest;
+class QQuickWebEngineJavaScriptDialogRequest;
+class QQuickWebEngineNewWindowRequest;
+class QQuickWebEngineProfile;
+class QQuickWebEngineSettings;
+class QQuickWebEngineTooltipRequest;
+class QQuickWebEngineViewPrivate;
+class QWebEngineCertificateError;
+class QWebEngineContextMenuRequest;
+class QWebEngineFileSystemAccessRequest;
+class QWebEngineFindTextResult;
+class QWebEngineFullScreenRequest;
+class QWebEngineHistory;
+class QWebEngineLoadingInfo;
+class QWebEngineNavigationRequest;
+class QWebEngineNewWindowRequest;
+class QWebEngineRegisterProtocolHandlerRequest;
+class QQuickWebEngineScriptCollection;
+class QQuickWebEngineTouchSelectionMenuRequest;
+class QWebEngineWebAuthUxRequest;
+
+class Q_WEBENGINEQUICK_EXPORT QQuickWebEngineView : public QQuickItem {
+ Q_OBJECT
+ Q_CLASSINFO("RegisterEnumClassesUnscoped", "false")
+ Q_PROPERTY(QUrl url READ url WRITE setUrl NOTIFY urlChanged FINAL)
+ Q_PROPERTY(QUrl icon READ icon NOTIFY iconChanged FINAL)
+ Q_PROPERTY(bool loading READ isLoading NOTIFY loadingChanged FINAL)
+ Q_PROPERTY(int loadProgress READ loadProgress NOTIFY loadProgressChanged FINAL)
+ Q_PROPERTY(QString title READ title NOTIFY titleChanged FINAL)
+ Q_PROPERTY(bool canGoBack READ canGoBack NOTIFY canGoBackChanged FINAL)
+ Q_PROPERTY(bool canGoForward READ canGoForward NOTIFY canGoForwardChanged FINAL)
+ Q_PROPERTY(bool isFullScreen READ isFullScreen NOTIFY isFullScreenChanged REVISION(1,1) FINAL)
+ Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor NOTIFY zoomFactorChanged REVISION(1,1) FINAL)
+ Q_PROPERTY(QQuickWebEngineProfile *profile READ profile WRITE setProfile NOTIFY profileChanged FINAL REVISION(1,1))
+ Q_PROPERTY(QQuickWebEngineSettings *settings READ settings REVISION(1,1) CONSTANT FINAL)
+ Q_PROPERTY(QWebEngineHistory *history READ history CONSTANT FINAL REVISION(1,1))
+#if QT_CONFIG(webengine_webchannel)
+ Q_PROPERTY(QQmlWebChannel *webChannel READ webChannel WRITE setWebChannel NOTIFY webChannelChanged REVISION(1,1) FINAL)
+#endif
+ Q_PROPERTY(QQuickWebEngineScriptCollection *userScripts READ userScripts FINAL REVISION(1,1))
+ Q_PROPERTY(bool activeFocusOnPress READ activeFocusOnPress WRITE setActiveFocusOnPress NOTIFY activeFocusOnPressChanged REVISION(1,2) FINAL)
+ Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor NOTIFY backgroundColorChanged REVISION(1,2) FINAL)
+ Q_PROPERTY(QSizeF contentsSize READ contentsSize NOTIFY contentsSizeChanged FINAL REVISION(1,3))
+ Q_PROPERTY(QPointF scrollPosition READ scrollPosition NOTIFY scrollPositionChanged FINAL REVISION(1,3))
+ Q_PROPERTY(bool audioMuted READ isAudioMuted WRITE setAudioMuted NOTIFY audioMutedChanged FINAL REVISION(1,3))
+ Q_PROPERTY(bool recentlyAudible READ recentlyAudible NOTIFY recentlyAudibleChanged FINAL REVISION(1,3))
+ Q_PROPERTY(uint webChannelWorld READ webChannelWorld WRITE setWebChannelWorld NOTIFY webChannelWorldChanged REVISION(1,3) FINAL)
+
+ Q_PROPERTY(QQuickWebEngineView *inspectedView READ inspectedView WRITE setInspectedView NOTIFY inspectedViewChanged REVISION(1,7) FINAL)
+ Q_PROPERTY(QQuickWebEngineView *devToolsView READ devToolsView WRITE setDevToolsView NOTIFY devToolsViewChanged REVISION(1,7) FINAL)
+ Q_PROPERTY(QString devToolsId READ devToolsId CONSTANT REVISION(6,6) FINAL)
+
+ Q_PROPERTY(LifecycleState lifecycleState READ lifecycleState WRITE setLifecycleState NOTIFY lifecycleStateChanged REVISION(1,10) FINAL)
+ Q_PROPERTY(LifecycleState recommendedState READ recommendedState NOTIFY recommendedStateChanged REVISION(1,10) FINAL)
+
+ Q_PROPERTY(qint64 renderProcessPid READ renderProcessPid NOTIFY renderProcessPidChanged FINAL REVISION(1,11))
+ Q_PROPERTY(QQmlComponent *touchHandleDelegate READ touchHandleDelegate WRITE
+ setTouchHandleDelegate NOTIFY touchHandleDelegateChanged REVISION(0) FINAL)
+ QML_NAMED_ELEMENT(WebEngineView)
+ QML_ADDED_IN_VERSION(1, 0)
+ QML_EXTRA_VERSION(2, 0)
+
+public:
+ QQuickWebEngineView(QQuickItem *parent = nullptr);
+ ~QQuickWebEngineView();
+
+ QUrl url() const;
+ void setUrl(const QUrl&);
+ QUrl icon() const;
+ bool isLoading() const;
+ int loadProgress() const;
+ QString title() const;
+ bool canGoBack() const;
+ bool canGoForward() const;
+ bool isFullScreen() const;
+ qreal zoomFactor() const;
+ void setZoomFactor(qreal arg);
+ QColor backgroundColor() const;
+ void setBackgroundColor(const QColor &color);
+ QSizeF contentsSize() const;
+ QPointF scrollPosition() const;
+
+#if QT_DEPRECATED_SINCE(6, 2)
+QT_WARNING_PUSH QT_WARNING_DISABLE_DEPRECATED
+ enum QT_DEPRECATED NavigationRequestAction {
+ AcceptRequest,
+ // Make room in the valid range of the enum so
+ // we can expose extra actions.
+ IgnoreRequest = 0xFF
+ };
+ Q_ENUM(NavigationRequestAction)
+
+ enum QT_DEPRECATED NavigationType {
+ LinkClickedNavigation,
+ TypedNavigation,
+ FormSubmittedNavigation,
+ BackForwardNavigation,
+ ReloadNavigation,
+ OtherNavigation,
+ RedirectNavigation,
+ };
+ Q_ENUM(NavigationType)
+
+ enum QT_DEPRECATED LoadStatus {
+ LoadStartedStatus,
+ LoadStoppedStatus,
+ LoadSucceededStatus,
+ LoadFailedStatus
+ };
+ Q_ENUM(LoadStatus)
+
+ enum QT_DEPRECATED ErrorDomain {
+ NoErrorDomain,
+ InternalErrorDomain,
+ ConnectionErrorDomain,
+ CertificateErrorDomain,
+ HttpErrorDomain,
+ FtpErrorDomain,
+ DnsErrorDomain
+ };
+ Q_ENUM(ErrorDomain)
+
+ enum QT_DEPRECATED NewViewDestination {
+ NewViewInWindow,
+ NewViewInTab,
+ NewViewInDialog,
+ NewViewInBackgroundTab
+ };
+ Q_ENUM(NewViewDestination)
+QT_WARNING_POP
+#endif
+
+ enum Feature {
+ MediaAudioCapture,
+ MediaVideoCapture,
+ MediaAudioVideoCapture,
+ Geolocation,
+ DesktopVideoCapture,
+ DesktopAudioVideoCapture,
+ Notifications,
+ ClipboardReadWrite,
+ LocalFontsAccess,
+ };
+ Q_ENUM(Feature)
+
+ enum WebAction {
+ NoWebAction = - 1,
+ Back,
+ Forward,
+ Stop,
+ Reload,
+
+ Cut,
+ Copy,
+ Paste,
+
+ Undo,
+ Redo,
+ SelectAll,
+ ReloadAndBypassCache,
+
+ PasteAndMatchStyle,
+
+ OpenLinkInThisWindow,
+ OpenLinkInNewWindow,
+ OpenLinkInNewTab,
+ CopyLinkToClipboard,
+ DownloadLinkToDisk,
+
+ CopyImageToClipboard,
+ CopyImageUrlToClipboard,
+ DownloadImageToDisk,
+
+ CopyMediaUrlToClipboard,
+ ToggleMediaControls,
+ ToggleMediaLoop,
+ ToggleMediaPlayPause,
+ ToggleMediaMute,
+ DownloadMediaToDisk,
+
+ InspectElement,
+ ExitFullScreen,
+ RequestClose,
+ Unselect,
+ SavePage,
+ OpenLinkInNewBackgroundTab, // Not supported in QML
+ ViewSource,
+
+ ToggleBold,
+ ToggleItalic,
+ ToggleUnderline,
+ ToggleStrikethrough,
+
+ AlignLeft,
+ AlignCenter,
+ AlignRight,
+ AlignJustified,
+ Indent,
+ Outdent,
+
+ InsertOrderedList,
+ InsertUnorderedList,
+
+ ChangeTextDirectionLTR,
+ ChangeTextDirectionRTL,
+
+ WebActionCount
+ };
+ Q_ENUM(WebAction)
+
+ // must match WebContentsAdapterClient::JavaScriptConsoleMessageLevel
+ enum JavaScriptConsoleMessageLevel {
+ InfoMessageLevel = 0,
+ WarningMessageLevel,
+ ErrorMessageLevel
+ };
+ Q_ENUM(JavaScriptConsoleMessageLevel)
+
+ // must match WebContentsAdapterClient::RenderProcessTerminationStatus
+ enum RenderProcessTerminationStatus {
+ NormalTerminationStatus = 0,
+ AbnormalTerminationStatus,
+ CrashedTerminationStatus,
+ KilledTerminationStatus
+ };
+ Q_ENUM(RenderProcessTerminationStatus)
+
+ enum FindFlag {
+ FindBackward = 1,
+ FindCaseSensitively = 2,
+ };
+ Q_DECLARE_FLAGS(FindFlags, FindFlag)
+ Q_FLAG(FindFlags)
+
+ // must match QPageSize::PageSizeId
+ enum PrintedPageSizeId {
+ // Existing Qt sizes
+ Letter,
+ Legal,
+ Executive,
+ A0,
+ A1,
+ A2,
+ A3,
+ A4,
+ A5,
+ A6,
+ A7,
+ A8,
+ A9,
+ A10,
+ B0,
+ B1,
+ B2,
+ B3,
+ B4,
+ B5,
+ B6,
+ B7,
+ B8,
+ B9,
+ B10,
+ C5E,
+ Comm10E,
+ DLE,
+ Folio,
+ Ledger,
+ Tabloid,
+ Custom,
+
+ // New values derived from PPD standard
+ A3Extra,
+ A4Extra,
+ A4Plus,
+ A4Small,
+ A5Extra,
+ B5Extra,
+
+ JisB0,
+ JisB1,
+ JisB2,
+ JisB3,
+ JisB4,
+ JisB5,
+ JisB6,
+ JisB7,
+ JisB8,
+ JisB9,
+ JisB10,
+
+ // AnsiA = Letter,
+ // AnsiB = Ledger,
+ AnsiC,
+ AnsiD,
+ AnsiE,
+ LegalExtra,
+ LetterExtra,
+ LetterPlus,
+ LetterSmall,
+ TabloidExtra,
+
+ ArchA,
+ ArchB,
+ ArchC,
+ ArchD,
+ ArchE,
+
+ Imperial7x9,
+ Imperial8x10,
+ Imperial9x11,
+ Imperial9x12,
+ Imperial10x11,
+ Imperial10x13,
+ Imperial10x14,
+ Imperial12x11,
+ Imperial15x11,
+
+ ExecutiveStandard,
+ Note,
+ Quarto,
+ Statement,
+ SuperA,
+ SuperB,
+ Postcard,
+ DoublePostcard,
+ Prc16K,
+ Prc32K,
+ Prc32KBig,
+
+ FanFoldUS,
+ FanFoldGerman,
+ FanFoldGermanLegal,
+
+ EnvelopeB4,
+ EnvelopeB5,
+ EnvelopeB6,
+ EnvelopeC0,
+ EnvelopeC1,
+ EnvelopeC2,
+ EnvelopeC3,
+ EnvelopeC4,
+ // EnvelopeC5 = C5E,
+ EnvelopeC6,
+ EnvelopeC65,
+ EnvelopeC7,
+ // EnvelopeDL = DLE,
+
+ Envelope9,
+ // Envelope10 = Comm10E,
+ Envelope11,
+ Envelope12,
+ Envelope14,
+ EnvelopeMonarch,
+ EnvelopePersonal,
+
+ EnvelopeChou3,
+ EnvelopeChou4,
+ EnvelopeInvite,
+ EnvelopeItalian,
+ EnvelopeKaku2,
+ EnvelopeKaku3,
+ EnvelopePrc1,
+ EnvelopePrc2,
+ EnvelopePrc3,
+ EnvelopePrc4,
+ EnvelopePrc5,
+ EnvelopePrc6,
+ EnvelopePrc7,
+ EnvelopePrc8,
+ EnvelopePrc9,
+ EnvelopePrc10,
+ EnvelopeYou4,
+
+ // Last item
+ LastPageSize = EnvelopeYou4,
+
+ // Convenience overloads for naming consistency
+ AnsiA = Letter,
+ AnsiB = Ledger,
+ EnvelopeC5 = C5E,
+ EnvelopeDL = DLE,
+ Envelope10 = Comm10E
+ };
+ Q_ENUM(PrintedPageSizeId)
+
+ // must match QPageLayout::Orientation
+ enum PrintedPageOrientation {
+ Portrait,
+ Landscape
+ };
+ Q_ENUM(PrintedPageOrientation)
+
+ // must match WebContentsAdapterClient::LifecycleState
+ enum class LifecycleState {
+ Active,
+ Frozen,
+ Discarded,
+ };
+ Q_ENUM(LifecycleState)
+
+ // QmlParserStatus
+ void componentComplete() override;
+
+ QQuickWebEngineProfile *profile();
+ void setProfile(QQuickWebEngineProfile *);
+ QQuickWebEngineScriptCollection *userScripts();
+
+ QQuickWebEngineSettings *settings();
+ QQmlWebChannel *webChannel();
+ void setWebChannel(QQmlWebChannel *);
+ QWebEngineHistory *history() const;
+ uint webChannelWorld() const;
+ void setWebChannelWorld(uint);
+ Q_REVISION(1,8) Q_INVOKABLE QQuickWebEngineAction *action(WebAction action);
+
+ Q_INVOKABLE void acceptAsNewWindow(QWebEngineNewWindowRequest *request);
+
+ bool isAudioMuted() const;
+ void setAudioMuted(bool muted);
+ bool recentlyAudible() const;
+
+ qint64 renderProcessPid() const;
+
+ bool activeFocusOnPress() const;
+
+ void setInspectedView(QQuickWebEngineView *);
+ QQuickWebEngineView *inspectedView() const;
+ void setDevToolsView(QQuickWebEngineView *);
+ QQuickWebEngineView *devToolsView() const;
+ QString devToolsId();
+
+ LifecycleState lifecycleState() const;
+ void setLifecycleState(LifecycleState state);
+
+ LifecycleState recommendedState() const;
+
+ QQmlComponent *touchHandleDelegate() const;
+ void setTouchHandleDelegate(QQmlComponent *delegagte);
+
+public Q_SLOTS:
+ void runJavaScript(const QString&, const QJSValue & = QJSValue());
+ Q_REVISION(1,3) void runJavaScript(const QString&, quint32 worldId, const QJSValue & = QJSValue());
+ void loadHtml(const QString &html, const QUrl &baseUrl = QUrl());
+ void goBack();
+ void goForward();
+ Q_REVISION(1,1) void goBackOrForward(int index);
+ void reload();
+ Q_REVISION(1,1) void reloadAndBypassCache();
+ void stop();
+ Q_REVISION(1,1) void findText(const QString &subString, FindFlags options = { }, const QJSValue &callback = QJSValue());
+ Q_REVISION(1,1) void fullScreenCancelled();
+ Q_REVISION(1,1) void grantFeaturePermission(const QUrl &securityOrigin, QQuickWebEngineView::Feature, bool granted);
+ Q_REVISION(1,2) void setActiveFocusOnPress(bool arg);
+ Q_REVISION(1,2) void triggerWebAction(WebAction action);
+ Q_REVISION(1,3) void printToPdf(const QString &filePath, PrintedPageSizeId pageSizeId = PrintedPageSizeId::A4, PrintedPageOrientation orientation = PrintedPageOrientation::Portrait);
+ Q_REVISION(1,3) void printToPdf(const QJSValue &callback, PrintedPageSizeId pageSizeId = PrintedPageSizeId::A4, PrintedPageOrientation orientation = PrintedPageOrientation::Portrait);
+ Q_REVISION(1,4) void replaceMisspelledWord(const QString &replacement);
+ Q_REVISION(6, 6) void save(const QString &filePath,
+ QWebEngineDownloadRequest::SavePageFormat format =
+ QWebEngineDownloadRequest::MimeHtmlSaveFormat) const;
+
+private Q_SLOTS:
+ void lazyInitialize();
+
+Q_SIGNALS:
+ void titleChanged();
+ void urlChanged();
+ void iconChanged();
+ void loadingChanged(const QWebEngineLoadingInfo &loadingInfo);
+ void loadProgressChanged();
+ void linkHovered(const QUrl &hoveredUrl);
+ void navigationRequested(QWebEngineNavigationRequest *request);
+ void javaScriptConsoleMessage(QQuickWebEngineView::JavaScriptConsoleMessageLevel level,
+ const QString &message, int lineNumber, const QString &sourceID);
+ Q_REVISION(1,1) void certificateError(const QWebEngineCertificateError &error);
+ Q_REVISION(1,1) void fullScreenRequested(const QWebEngineFullScreenRequest &request);
+ Q_REVISION(1,1) void isFullScreenChanged();
+ Q_REVISION(1, 1)
+ void featurePermissionRequested(const QUrl &securityOrigin,
+ QQuickWebEngineView::Feature feature);
+ Q_REVISION(1,1) void zoomFactorChanged(qreal arg);
+ Q_REVISION(1,1) void profileChanged();
+ Q_REVISION(1,1) void webChannelChanged();
+ Q_REVISION(1,2) void activeFocusOnPressChanged(bool);
+ Q_REVISION(1,2) void backgroundColorChanged();
+ Q_REVISION(1, 2)
+ void renderProcessTerminated(QQuickWebEngineView::RenderProcessTerminationStatus terminationStatus,
+ int exitCode);
+ Q_REVISION(1,2) void windowCloseRequested();
+ Q_REVISION(1,3) void contentsSizeChanged(const QSizeF& size);
+ Q_REVISION(1,3) void scrollPositionChanged(const QPointF& position);
+ Q_REVISION(1,3) void audioMutedChanged(bool muted);
+ Q_REVISION(1,3) void recentlyAudibleChanged(bool recentlyAudible);
+ Q_REVISION(1,3) void webChannelWorldChanged(uint);
+ Q_REVISION(1,4) void contextMenuRequested(QWebEngineContextMenuRequest *request);
+ Q_REVISION(1,4) void authenticationDialogRequested(QQuickWebEngineAuthenticationDialogRequest *request);
+ Q_REVISION(1,4) void javaScriptDialogRequested(QQuickWebEngineJavaScriptDialogRequest *request);
+ Q_REVISION(1,4) void colorDialogRequested(QQuickWebEngineColorDialogRequest *request);
+ Q_REVISION(1,4) void fileDialogRequested(QQuickWebEngineFileDialogRequest *request);
+ Q_REVISION(1,5) void pdfPrintingFinished(const QString &filePath, bool success);
+#if QT_DEPRECATED_SINCE(6, 5)
+ QT_DEPRECATED_VERSION_X_6_5("Requesting host quota is no longer supported.")
+ Q_REVISION(1, 7) void quotaRequested(const QWebEngineQuotaRequest &request);
+#endif
+ Q_REVISION(1,7) void geometryChangeRequested(const QRect &geometry, const QRect &frameGeometry);
+ Q_REVISION(1,7) void inspectedViewChanged();
+ Q_REVISION(1,7) void devToolsViewChanged();
+ Q_REVISION(1,7) void registerProtocolHandlerRequested(const QWebEngineRegisterProtocolHandlerRequest &request);
+ Q_REVISION(1,8) void printRequested();
+ Q_REVISION(1,9) void selectClientCertificate(QQuickWebEngineClientCertificateSelection *clientCertSelection);
+ Q_REVISION(1,10) void tooltipRequested(QQuickWebEngineTooltipRequest *request);
+ Q_REVISION(1, 10) void lifecycleStateChanged(QQuickWebEngineView::LifecycleState state);
+ Q_REVISION(1, 10) void recommendedStateChanged(QQuickWebEngineView::LifecycleState state);
+ Q_REVISION(1,10) void findTextFinished(const QWebEngineFindTextResult &result);
+ Q_REVISION(1,11) void renderProcessPidChanged(qint64 pid);
+ Q_REVISION(1,11) void canGoBackChanged();
+ Q_REVISION(1,11) void canGoForwardChanged();
+ Q_REVISION(1,12) void newWindowRequested(QQuickWebEngineNewWindowRequest *request);
+ Q_REVISION(6,3) void touchSelectionMenuRequested(QQuickWebEngineTouchSelectionMenuRequest *request);
+ Q_REVISION(6,4) void touchHandleDelegateChanged();
+ Q_REVISION(6,4) void fileSystemAccessRequested(const QWebEngineFileSystemAccessRequest &request);
+ Q_REVISION(6, 7) void webAuthUxRequested(QWebEngineWebAuthUxRequest *request);
+ Q_REVISION(6,7) void desktopMediaRequested(const QWebEngineDesktopMediaRequest &request);
+
+protected:
+ void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override;
+ void itemChange(ItemChange, const ItemChangeData &) override;
+#if QT_CONFIG(draganddrop)
+ void dragEnterEvent(QDragEnterEvent *e) override;
+ void dragLeaveEvent(QDragLeaveEvent *e) override;
+ void dragMoveEvent(QDragMoveEvent *e) override;
+ void dropEvent(QDropEvent *e) override;
+#endif // QT_CONFIG(draganddrop)
+
+private:
+ Q_DECLARE_PRIVATE(QQuickWebEngineView)
+ QScopedPointer<QQuickWebEngineViewPrivate> d_ptr;
+
+ friend class QQuickContextMenuBuilder;
+ friend class FaviconImageResponse;
+ friend class FaviconImageResponseRunnable;
+#if QT_CONFIG(accessibility)
+ friend class QQuickWebEngineViewAccessible;
+#endif // QT_CONFIG(accessibility)
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QQuickWebEngineView)
+
+#endif // QQUICKWEBENGINEVIEW_P_H
diff --git a/src/webenginequick/api/qquickwebengineview_p_p.h b/src/webenginequick/api/qquickwebengineview_p_p.h
new file mode 100644
index 000000000..ee7da99b9
--- /dev/null
+++ b/src/webenginequick/api/qquickwebengineview_p_p.h
@@ -0,0 +1,205 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QQUICKWEBENGINEVIEW_P_P_H
+#define QQUICKWEBENGINEVIEW_P_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qquickwebenginetouchhandle_p.h"
+#include "qquickwebengineview_p.h"
+#include "render_view_context_menu_qt.h"
+#include "touch_handle_drawable_client.h"
+#include "ui_delegates_manager.h"
+#include "web_contents_adapter_client.h"
+
+#include <QtCore/qcompilerdetection.h>
+#include <QtCore/qpointer.h>
+#include <QtCore/qscopedpointer.h>
+#include <QtCore/qsharedpointer.h>
+#include <QtCore/qstring.h>
+
+namespace QtWebEngineCore {
+class RenderWidgetHostViewQtDelegateItem;
+class TouchSelectionMenuController;
+class UIDelegatesManager;
+class WebContentsAdapter;
+}
+
+QT_BEGIN_NAMESPACE
+class QQmlComponent;
+class QQuickWebEngineFaviconProvider;
+class QQuickWebEngineScriptCollection;
+class QQuickWebEngineSettings;
+class QQuickWebEngineView;
+class QWebEngineContextMenuRequest;
+class QWebEngineFindTextResult;
+class QWebEngineHistory;
+
+class Q_WEBENGINEQUICK_EXPORT QQuickWebEngineViewPrivate : public QtWebEngineCore::WebContentsAdapterClient
+{
+public:
+ Q_DECLARE_PUBLIC(QQuickWebEngineView)
+ QQuickWebEngineView *q_ptr;
+ QQuickWebEngineViewPrivate();
+ ~QQuickWebEngineViewPrivate();
+ void releaseProfile() override;
+ void initializeProfile();
+ QtWebEngineCore::UIDelegatesManager *ui();
+
+ QtWebEngineCore::RenderWidgetHostViewQtDelegate* CreateRenderWidgetHostViewQtDelegate(QtWebEngineCore::RenderWidgetHostViewQtDelegateClient *client) override;
+ QtWebEngineCore::RenderWidgetHostViewQtDelegate* CreateRenderWidgetHostViewQtDelegateForPopup(QtWebEngineCore::RenderWidgetHostViewQtDelegateClient *client) override;
+ void initializationFinished() override;
+ void lifecycleStateChanged(LifecycleState state) override;
+ void recommendedStateChanged(LifecycleState state) override;
+ void visibleChanged(bool visible) override;
+ void titleChanged(const QString&) override;
+ void urlChanged() override;
+ void iconChanged(const QUrl&) override;
+ void loadProgressChanged(int progress) override;
+ void didUpdateTargetURL(const QUrl&) override;
+ void selectionChanged() override;
+ void zoomUpdateIsNeeded() override;
+ void recentlyAudibleChanged(bool recentlyAudible) override;
+ void renderProcessPidChanged(qint64 pid) override;
+ QRectF viewportRect() const override;
+ QColor backgroundColor() const override;
+ void loadStarted(QWebEngineLoadingInfo info) override;
+ void loadCommitted() override;
+ void loadFinished(QWebEngineLoadingInfo info) override;
+ void focusContainer() override;
+ void unhandledKeyEvent(QKeyEvent *event) override;
+ QSharedPointer<QtWebEngineCore::WebContentsAdapter>
+ adoptNewWindow(QSharedPointer<QtWebEngineCore::WebContentsAdapter> newWebContents,
+ WindowOpenDisposition disposition, bool userGesture, const QRect &,
+ const QUrl &targetUrl) override;
+ bool isBeingAdopted() override;
+ void close() override;
+ void windowCloseRejected() override;
+ void requestFullScreenMode(const QUrl &origin, bool fullscreen) override;
+ bool isFullScreenMode() const override;
+ void contextMenuRequested(QWebEngineContextMenuRequest *request) override;
+ void navigationRequested(int navigationType, const QUrl &url, bool &accepted, bool isMainFrame) override;
+ void javascriptDialog(QSharedPointer<QtWebEngineCore::JavaScriptDialogController>) override;
+ void runFileChooser(QSharedPointer<QtWebEngineCore::FilePickerController>) override;
+ void desktopMediaRequested(QtWebEngineCore::DesktopMediaController *) override;
+ void showColorDialog(QSharedPointer<QtWebEngineCore::ColorChooserController>) override;
+ void didRunJavaScript(quint64, const QVariant&) override;
+ void didFetchDocumentMarkup(quint64, const QString&) override { }
+ void didFetchDocumentInnerText(quint64, const QString&) override { }
+ void didPrintPage(quint64 requestId, QSharedPointer<QByteArray>) override;
+ void didPrintPageToPdf(const QString &filePath, bool success) override;
+ bool passOnFocus(bool reverse) override;
+ void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString& message, int lineNumber, const QString& sourceID) override;
+ void authenticationRequired(QSharedPointer<QtWebEngineCore::AuthenticationDialogController>) override;
+ void runMediaAccessPermissionRequest(const QUrl &securityOrigin, MediaRequestFlags requestFlags) override;
+ void runMouseLockPermissionRequest(const QUrl &securityOrigin) override;
+ void runRegisterProtocolHandlerRequest(QWebEngineRegisterProtocolHandlerRequest) override;
+ void runFileSystemAccessRequest(QWebEngineFileSystemAccessRequest) override;
+ QObject *accessibilityParentObject() override;
+ QWebEngineSettings *webEngineSettings() const override;
+ void allowCertificateError(const QWebEngineCertificateError &error) override;
+ void selectClientCert(const QSharedPointer<QtWebEngineCore::ClientCertSelectController>
+ &selectController) override;
+ void runFeaturePermissionRequest(QtWebEngineCore::ProfileAdapter::PermissionType permission, const QUrl &securityOrigin) override;
+ void renderProcessTerminated(RenderProcessTerminationStatus terminationStatus, int exitCode) override;
+ void requestGeometryChange(const QRect &geometry, const QRect &frameGeometry) override;
+ void updateScrollPosition(const QPointF &position) override;
+ void updateContentsSize(const QSizeF &size) override;
+ void updateNavigationActions() override;
+ void updateEditActions() override;
+ QObject *dragSource() const override;
+ bool isEnabled() const override;
+ void setToolTip(const QString &toolTipText) override;
+ QtWebEngineCore::TouchHandleDrawableDelegate *createTouchHandleDelegate(const QMap<int, QImage> &images) override;
+ void showTouchSelectionMenu(QtWebEngineCore::TouchSelectionMenuController *, const QRect &, const QSize &) override;
+ void hideTouchSelectionMenu() override;
+ const QObject *holdingQObject() const override;
+ ClientType clientType() override { return QtWebEngineCore::WebContentsAdapterClient::QmlClient; }
+
+ QtWebEngineCore::ProfileAdapter *profileAdapter() override;
+ QtWebEngineCore::WebContentsAdapter *webContentsAdapter() override;
+ void printRequested() override;
+ void findTextFinished(const QWebEngineFindTextResult &result) override;
+ void showAutofillPopup(QtWebEngineCore::AutofillPopupController *controller,
+ const QRect &bounds, bool autoselectFirstSuggestion) override;
+ void hideAutofillPopup() override;
+ void showWebAuthDialog(QWebEngineWebAuthUxRequest *request) override;
+
+ void updateAction(QQuickWebEngineView::WebAction) const;
+ bool adoptWebContents(QtWebEngineCore::WebContentsAdapter *webContents);
+ void setProfile(QQuickWebEngineProfile *profile);
+ void updateAdapter();
+ void ensureContentsAdapter();
+ void setFullScreenMode(bool);
+
+ static void bindViewAndDelegateItem(QQuickWebEngineViewPrivate *viewPrivate, QtWebEngineCore::RenderWidgetHostViewQtDelegateItem *delegateItem);
+ void delegateItemChanged(QtWebEngineCore::RenderWidgetHostViewQtDelegateItem *oldDelegateItem,
+ QtWebEngineCore::RenderWidgetHostViewQtDelegateItem *newDelegateItem);
+
+ QQuickWebEngineProfile *m_profile;
+ QSharedPointer<QtWebEngineCore::WebContentsAdapter> adapter;
+ QScopedPointer<QWebEngineHistory> m_history;
+ QScopedPointer<QQuickWebEngineSettings> m_settings;
+ QQmlComponent *contextMenuExtraItems;
+ QUrl m_url;
+ QString m_html;
+ QUrl iconUrl;
+ int loadProgress;
+ bool m_fullscreenMode;
+ bool isLoading;
+ bool m_activeFocusOnPress;
+ QMap<quint64, QJSValue> m_callbacks;
+ QQmlWebChannel *m_webChannel;
+ QPointer<QQuickWebEngineView> inspectedView;
+ QPointer<QQuickWebEngineView> devToolsView;
+ uint m_webChannelWorld;
+ bool m_defaultAudioMuted;
+ bool m_isBeingAdopted;
+ mutable QQuickWebEngineAction *actions[QQuickWebEngineView::WebActionCount];
+ QtWebEngineCore::RenderWidgetHostViewQtDelegateItem *delegateItem = nullptr;
+
+ bool profileInitialized() const;
+ QQuickWebEngineScriptCollection *getUserScripts();
+
+private:
+ QScopedPointer<QtWebEngineCore::UIDelegatesManager> m_uIDelegatesManager;
+ QColor m_backgroundColor;
+ qreal m_zoomFactor;
+ bool m_profileInitialized;
+ QWebEngineContextMenuRequest *m_contextMenuRequest;
+ QScopedPointer<QQuickWebEngineScriptCollection> m_scriptCollection;
+ QPointer<QQuickWebEngineFaviconProvider> m_faviconProvider;
+ QQmlComponent *m_touchHandleDelegate;
+};
+
+class QQuickContextMenuBuilder : public QtWebEngineCore::RenderViewContextMenuQt
+{
+public:
+ QQuickContextMenuBuilder(QWebEngineContextMenuRequest *data, QQuickWebEngineView *view,
+ QObject *menu);
+ void appendExtraItems(QQmlEngine *engine);
+
+private:
+ virtual bool hasInspector() override;
+ virtual bool isFullScreenMode() override;
+
+ virtual void addMenuItem(ContextMenuItem menuItem) override;
+ virtual bool isMenuItemEnabled(ContextMenuItem menuItem) override;
+
+ QQuickWebEngineView *m_view;
+ QObject *m_menu;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQUICKWEBENGINEVIEW_P_P_H
diff --git a/src/webenginequick/api/qtwebenginequickglobal.cpp b/src/webenginequick/api/qtwebenginequickglobal.cpp
new file mode 100644
index 000000000..e24ef643b
--- /dev/null
+++ b/src/webenginequick/api/qtwebenginequickglobal.cpp
@@ -0,0 +1,59 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include <QtCore/qcoreapplication.h>
+#include <QtQuick/qquickwindow.h>
+#include <QtWebEngineQuick/qtwebenginequickglobal.h>
+
+namespace QtWebEngineCore
+{
+ extern void initialize();
+}
+
+QT_BEGIN_NAMESPACE
+
+namespace QtWebEngineQuick {
+
+/*!
+ \namespace QtWebEngineQuick
+ \inmodule QtWebEngineQuick
+ \ingroup qtwebengine-namespaces
+ \keyword QtWebEngine Namespace
+
+ \brief Helper functions for the \QWE (Qt Quick) module.
+
+ The \l[CPP]{QtWebEngineQuick} namespace is part of the \QWE module.
+*/
+
+/*!
+ \fn QtWebEngineQuick::initialize()
+
+ Sets up an OpenGL Context that can be shared between threads. This has to be done before
+ QGuiApplication is created and before window's QPlatformOpenGLContext is created.
+
+ This has the same effect as setting the Qt::AA_ShareOpenGLContexts
+ attribute with QCoreApplication::setAttribute before constructing
+ QGuiApplication.
+*/
+void initialize()
+{
+ auto api = QQuickWindow::graphicsApi();
+ if (!QCoreApplication::startingUp()) {
+ if (api == QSGRendererInterface::OpenGL || (api != QSGRendererInterface::Vulkan
+ && api != QSGRendererInterface::Metal && api != QSGRendererInterface::Direct3D11)) {
+ qWarning("QtWebEngineQuick::initialize() called with QCoreApplication object already created and should be call before. "\
+ "This is depreciated and may fail in the future.");
+ }
+ QtWebEngineCore::initialize();
+ return;
+ }
+
+ // call initialize the same way as widgets do
+ qAddPreRoutine(QtWebEngineCore::initialize);
+ if (api != QSGRendererInterface::OpenGL && api != QSGRendererInterface::Vulkan
+ && api != QSGRendererInterface::Metal && api != QSGRendererInterface::Direct3D11)
+ QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL);
+}
+} // namespace QtWebEngineQuick
+
+QT_END_NAMESPACE
diff --git a/src/webenginequick/api/qtwebenginequickglobal.h b/src/webenginequick/api/qtwebenginequickglobal.h
new file mode 100644
index 000000000..1580bf6db
--- /dev/null
+++ b/src/webenginequick/api/qtwebenginequickglobal.h
@@ -0,0 +1,29 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QTWEBENGINEQUICKGLOBAL_H
+#define QTWEBENGINEQUICKGLOBAL_H
+
+#include <QtCore/qglobal.h>
+#include <QtWebEngineQuick/qtwebenginequick-config.h>
+
+QT_BEGIN_NAMESPACE
+
+#ifndef QT_STATIC
+# if defined(QT_BUILD_WEBENGINE_LIB)
+# define Q_WEBENGINEQUICK_EXPORT Q_DECL_EXPORT
+# else
+# define Q_WEBENGINEQUICK_EXPORT Q_DECL_IMPORT
+# endif
+#else
+# define Q_WEBENGINEQUICK_EXPORT
+#endif
+
+namespace QtWebEngineQuick
+{
+ Q_WEBENGINEQUICK_EXPORT void initialize();
+}
+
+QT_END_NAMESPACE
+
+#endif // QTWEBENGINEQUICKGLOBAL_H
diff --git a/src/webenginequick/api/qtwebenginequickglobal_p.h b/src/webenginequick/api/qtwebenginequickglobal_p.h
new file mode 100644
index 000000000..256bcd590
--- /dev/null
+++ b/src/webenginequick/api/qtwebenginequickglobal_p.h
@@ -0,0 +1,22 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QTWEBENGINEQUICKGLOBAL_P_H
+#define QTWEBENGINEQUICKGLOBAL_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtWebEngineQuick/qtwebenginequickglobal.h>
+#include <QtCore/private/qglobal_p.h>
+#include <QtWebEngineQuick/private/qtwebenginequick-config_p.h>
+
+#endif // QTWEBENGINEQUICKGLOBAL_P_H
diff --git a/src/webenginequick/configure.cmake b/src/webenginequick/configure.cmake
new file mode 100644
index 000000000..b256e5a1d
--- /dev/null
+++ b/src/webenginequick/configure.cmake
@@ -0,0 +1,10 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_feature("webenginequick-ui-delegates" PRIVATE
+ SECTION "WebEngine"
+ LABEL "UI Delegates"
+)
+qt_configure_add_summary_section(NAME "Qt WebEngineQuick")
+qt_configure_add_summary_entry(ARGS "webenginequick-ui-delegates")
+qt_configure_end_summary_section()
diff --git a/src/webengine/doc/images/qtwebengine-architecture.png b/src/webenginequick/doc/images/qtwebengine-architecture.png
index 979a0ad3f..979a0ad3f 100644
--- a/src/webengine/doc/images/qtwebengine-architecture.png
+++ b/src/webenginequick/doc/images/qtwebengine-architecture.png
Binary files differ
diff --git a/src/webengine/doc/images/qtwebengine-model.png b/src/webenginequick/doc/images/qtwebengine-model.png
index 0bbd556f1..0bbd556f1 100644
--- a/src/webengine/doc/images/qtwebengine-model.png
+++ b/src/webenginequick/doc/images/qtwebengine-model.png
Binary files differ
diff --git a/src/webengine/doc/images/qtwebengine-model.qmodel b/src/webenginequick/doc/images/qtwebengine-model.qmodel
index f3d5cb52b..f3d5cb52b 100644
--- a/src/webengine/doc/images/qtwebengine-model.qmodel
+++ b/src/webenginequick/doc/images/qtwebengine-model.qmodel
diff --git a/src/webengine/doc/images/qtwebengine-modules-model.qmodel b/src/webenginequick/doc/images/qtwebengine-modules-model.qmodel
index c1d64b617..c1d64b617 100644
--- a/src/webengine/doc/images/qtwebengine-modules-model.qmodel
+++ b/src/webenginequick/doc/images/qtwebengine-modules-model.qmodel
diff --git a/src/webengine/doc/images/qtwebenginewidgets-model.png b/src/webenginequick/doc/images/qtwebenginewidgets-model.png
index c334b84c9..c334b84c9 100644
--- a/src/webengine/doc/images/qtwebenginewidgets-model.png
+++ b/src/webenginequick/doc/images/qtwebenginewidgets-model.png
Binary files differ
diff --git a/src/webengine/doc/images/qtwebenginewidgets-model.qmodel b/src/webenginequick/doc/images/qtwebenginewidgets-model.qmodel
index aa59f7b8f..aa59f7b8f 100644
--- a/src/webengine/doc/images/qtwebenginewidgets-model.qmodel
+++ b/src/webenginequick/doc/images/qtwebenginewidgets-model.qmodel
diff --git a/src/webenginequick/doc/snippets/minimal/main.cpp b/src/webenginequick/doc/snippets/minimal/main.cpp
new file mode 100644
index 000000000..e17493a36
--- /dev/null
+++ b/src/webenginequick/doc/snippets/minimal/main.cpp
@@ -0,0 +1,18 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+//! [Minimal Example]
+#include <QGuiApplication>
+#include <QQmlApplicationEngine>
+#include <QtWebEngineQuick/qtwebenginequickglobal.h>
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
+ QtWebEngineQuick::initialize();
+ QGuiApplication app(argc, argv);
+ QQmlApplicationEngine engine;
+ engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
+ return app.exec();
+}
+//! [Minimal Example]
diff --git a/src/webenginequick/doc/snippets/minimal/main.qml b/src/webenginequick/doc/snippets/minimal/main.qml
new file mode 100644
index 000000000..87a8757df
--- /dev/null
+++ b/src/webenginequick/doc/snippets/minimal/main.qml
@@ -0,0 +1,18 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+//! [Minimal Example]
+import QtQuick
+import QtQuick.Window
+import QtWebEngine
+
+Window {
+ width: 1024
+ height: 750
+ visible: true
+ WebEngineView {
+ anchors.fill: parent
+ url: "https://www.qt.io"
+ }
+}
+//! [Minimal Example]
diff --git a/src/webenginequick/doc/snippets/qtwebengine_build_snippet.qdoc b/src/webenginequick/doc/snippets/qtwebengine_build_snippet.qdoc
new file mode 100644
index 000000000..f8fbbd669
--- /dev/null
+++ b/src/webenginequick/doc/snippets/qtwebengine_build_snippet.qdoc
@@ -0,0 +1,11 @@
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+//! [0]
+QT += webenginequick
+//! [0]
+
+//! [2]
+find_package(Qt6 REQUIRED COMPONENTS WebEngineQuick)
+target_link_libraries(target PRIVATE Qt6::WebEngineQuick)
+//! [2]
diff --git a/src/webenginequick/doc/snippets/qtwebengine_webengineaction.qml b/src/webenginequick/doc/snippets/qtwebengine_webengineaction.qml
new file mode 100644
index 000000000..2fd5f490b
--- /dev/null
+++ b/src/webenginequick/doc/snippets/qtwebengine_webengineaction.qml
@@ -0,0 +1,123 @@
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtQuick.Window
+import QtWebEngine
+import QtQuick.Controls
+import QtQuick.Layouts
+
+ApplicationWindow {
+ id: window
+ visible: true
+ width: 800
+ height: 600
+ title: qsTr("WebEngineAction Example")
+
+ header: ToolBar {
+ RowLayout {
+ anchors.fill: parent
+//! [0]
+ ToolButton {
+ property int itemAction: WebEngineView.Back
+ text: webEngineView.action(itemAction).text
+ enabled: webEngineView.action(itemAction).enabled
+ onClicked: webEngineView.action(itemAction).trigger()
+ icon.name: webEngineView.action(itemAction).iconName
+ display: AbstractButton.TextUnderIcon
+ }
+//! [0]
+ ToolButton {
+ property int itemAction: WebEngineView.Forward
+ text: webEngineView.action(itemAction).text
+ enabled: webEngineView.action(itemAction).enabled
+ onClicked: webEngineView.action(itemAction).trigger()
+ icon.name: webEngineView.action(itemAction).iconName
+ display: AbstractButton.TextUnderIcon
+ }
+
+ ToolButton {
+ property int itemAction: webEngineView.loading ? WebEngineView.Stop : WebEngineView.Reload
+ text: webEngineView.action(itemAction).text
+ enabled: webEngineView.action(itemAction).enabled
+ onClicked: webEngineView.action(itemAction).trigger()
+ icon.name: webEngineView.action(itemAction).iconName
+ display: AbstractButton.TextUnderIcon
+ }
+
+ TextField {
+ Layout.fillWidth: true
+
+ text: webEngineView.url
+ selectByMouse: true
+ onEditingFinished: webEngineView.url = utils.fromUserInput(text)
+ }
+
+ ToolButton {
+ id: settingsButton
+ text: "Settings"
+ icon.name: "settings-configure"
+ display: AbstractButton.TextUnderIcon
+ onClicked: settingsMenu.open()
+ checked: settingsMenu.visible
+
+ Menu {
+ id: settingsMenu
+ y: settingsButton.height
+
+ MenuItem {
+ id: customContextMenuOption
+ checkable: true
+ checked: true
+
+ text: "Custom context menu"
+ }
+ }
+ }
+ }
+ }
+
+ WebEngineView {
+ id: webEngineView
+ url: "https://qt.io"
+ anchors.fill: parent
+
+ Component.onCompleted: {
+ profile.downloadRequested.connect(function(download){
+ download.accept();
+ })
+ }
+
+//! [1]
+ property Menu contextMenu: Menu {
+ Repeater {
+ model: [
+ WebEngineView.Back,
+ WebEngineView.Forward,
+ WebEngineView.Reload,
+ WebEngineView.SavePage,
+ WebEngineView.Copy,
+ WebEngineView.Paste,
+ WebEngineView.Cut,
+ WebEngineView.ChangeTextDirectionLTR,
+ WebEngineView.ChangeTextDirectionRTL,
+ ]
+ MenuItem {
+ text: webEngineView.action(modelData).text
+ enabled: webEngineView.action(modelData).enabled
+ onClicked: webEngineView.action(modelData).trigger()
+ icon.name: webEngineView.action(modelData).iconName
+ display: MenuItem.TextBesideIcon
+ }
+ }
+ }
+
+ onContextMenuRequested: function(request) {
+ if (customContextMenuOption.checked) {
+ request.accepted = true;
+ contextMenu.popup();
+ }
+ }
+//! [1]
+ }
+}
diff --git a/src/webenginequick/doc/snippets/qtwebengine_webengineview_newviewrequested.qml b/src/webenginequick/doc/snippets/qtwebengine_webengineview_newviewrequested.qml
new file mode 100644
index 000000000..6b10df752
--- /dev/null
+++ b/src/webenginequick/doc/snippets/qtwebengine_webengineview_newviewrequested.qml
@@ -0,0 +1,37 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtQuick.Window
+import QtWebEngine
+
+//! [0]
+QtObject {
+ id: windowParent
+ // Create the initial browsing windows and open the startup page.
+ Component.onCompleted: {
+ var firstWindow = windowComponent.createObject(windowParent);
+ firstWindow.webView.loadHtml('<input type="button" value="Click!" onclick="window.open(&quot;http://qt.io&quot;)">');
+ }
+
+ property Component windowComponent: Window {
+ // Destroy on close to release the Window's QML resources.
+ // Because it was created with a parent, it won't be garbage-collected.
+ onClosing: destroy()
+ visible: true
+
+ property WebEngineView webView: webView_
+ WebEngineView {
+ id: webView_
+ anchors.fill: parent
+
+ // Handle the signal. Dynamically create the window and
+ // use its WebEngineView as the destination of our request.
+ onNewWindowRequested: function(request) {
+ var newWindow = windowComponent.createObject(windowParent);
+ newWindow.webView.acceptAsNewWindow(request);
+ }
+ }
+ }
+}
+//! [0]
diff --git a/src/webenginequick/doc/src/context_menu_request.qdoc b/src/webenginequick/doc/src/context_menu_request.qdoc
new file mode 100644
index 000000000..e7d732d5e
--- /dev/null
+++ b/src/webenginequick/doc/src/context_menu_request.qdoc
@@ -0,0 +1,194 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+ \qmltype ContextMenuRequest
+ //! \instantiates QQuickWebEngineContextMenuRequest
+ \inqmlmodule QtWebEngine
+ \since QtWebEngine 1.4
+
+ \brief A request for showing a context menu.
+
+ A ContextMenuRequest is passed as an argument of the
+ WebEngineView::contextMenuRequested signal. It provides further
+ information about the context of the request. The \l position
+ property provides the origin of the request.
+
+ The \l accepted property of the request indicates whether the request
+ is handled by the user code or the default context menu should
+ be displayed.
+
+ The following code uses a custom menu to handle the request:
+
+ \code
+ WebEngineView {
+ id: view
+ // ...
+ onContextMenuRequested: function(request) {
+ request.accepted = true;
+ myMenu.x = request.x;
+ myMenu.y = request.y;
+ myMenu.trigger.connect(view.triggerWebAction);
+ myMenu.popup();
+ }
+ // ...
+ }
+ \endcode
+*/
+
+/*!
+ \qmlproperty point ContextMenuRequest::position
+ \readonly
+
+ The position of the user action from where the context
+ menu request originates.
+*/
+
+/*!
+ \qmlproperty string ContextMenuRequest::selectedText
+ \readonly
+
+ The selected text the context menu was created for.
+*/
+
+/*!
+ \qmlproperty string ContextMenuRequest::linkText
+ \readonly
+
+ The text of the link if the context menu was requested for a link.
+*/
+
+/*!
+ \qmlproperty url ContextMenuRequest::linkUrl
+ \readonly
+
+ The URL of the link if the selected web page content is a link.
+ It is not guaranteed to be a valid URL.
+*/
+
+/*!
+ \qmlproperty url ContextMenuRequest::mediaUrl
+ \readonly
+
+ The URL of media if the selected web content is a media element.
+*/
+
+/*!
+ \qmlproperty enumeration ContextMenuRequest::mediaType
+ \readonly
+
+ The type of the media element or \c MediaTypeNone if
+ the selected web page content is not a media element.
+
+ \value ContextMenuRequest.MediaTypeNone
+ Not a media.
+ \value ContextMenuRequest.MediaTypeImage
+ An image.
+ \value ContextMenuRequest.MediaTypeVideo
+ A video.
+ \value ContextMenuRequest.MediaTypeAudio
+ An audio element.
+ \value ContextMenuRequest.MediaTypeCanvas
+ A canvas.
+ \value ContextMenuRequest.MediaTypeFile
+ A file.
+ \value ContextMenuRequest.MediaTypePlugin
+ A plugin.
+*/
+
+/*!
+ \qmlproperty bool ContextMenuRequest::isContentEditable
+ \readonly
+
+ Indicates whether the selected web content is editable.
+*/
+
+/*!
+ \qmlproperty string ContextMenuRequest::misspelledWord
+ \readonly
+
+ If the context is a word considered misspelled by the spell-checker,
+ returns the misspelled word.
+*/
+
+/*!
+ \qmlproperty stringlist ContextMenuRequest::spellCheckerSuggestions
+ \readonly
+
+ If the context is a word considered misspelled by the spell-checker,
+ returns a list of suggested replacements.
+*/
+
+/*!
+ \qmlproperty bool ContextMenuRequest::accepted
+
+ Indicates whether the context menu request has been
+ handled by the signal handler.
+
+ If the property is \c false after any signal handlers
+ for WebEngineView::contextMenuRequested have been executed,
+ a default context menu will be shown.
+ To prevent this, set \c{request.accepted} to \c true.
+
+ The default is \c false.
+
+ \note The default content of the context menu depends on the
+ web element for which the request was actually generated.
+*/
+
+/*!
+ \qmlproperty flags ContextMenuRequest::mediaFlags
+ \readonly
+ \since QtWebEngine 1.7
+
+ The current media element's status and its available operations.
+ \c MediaNone if the selected web page content is not a media element.
+
+ \value ContextMenuRequest.MediaInError
+ An error occurred.
+ \value ContextMenuRequest.MediaPaused
+ Media is paused.
+ \value ContextMenuRequest.MediaMuted
+ Media is muted.
+ \value ContextMenuRequest.MediaLoop
+ Media can be looped.
+ \value ContextMenuRequest.MediaCanSave
+ Media can be saved.
+ \value ContextMenuRequest.MediaHasAudio
+ Media has audio.
+ \value ContextMenuRequest.MediaCanToggleControls
+ Media can show controls.
+ \value ContextMenuRequest.MediaControls
+ Media controls are shown.
+ \value ContextMenuRequest.MediaCanPrint
+ Media is printable.
+ \value ContextMenuRequest.MediaCanRotate
+ Media is rotatable.
+*/
+
+/*!
+ \qmlproperty flags ContextMenuRequest::editFlags
+ \readonly
+ \since QtWebEngine 1.7
+
+ The available edit operations in the current context or \c CanDoNone if no actions are available.
+
+ \value ContextMenuRequest.CanUndo
+ Undo is available.
+ \value ContextMenuRequest.CanRedo
+ Redo is available.
+ \value ContextMenuRequest.CanCut
+ Cut is available.
+ \value ContextMenuRequest.CanCopy
+ Copy is available.
+ \value ContextMenuRequest.CanPaste
+ Paste is available.
+ \value ContextMenuRequest.CanDelete
+ Delete is available.
+ \value ContextMenuRequest.CanSelectAll
+ Select All is available.
+ \value ContextMenuRequest.CanTranslate
+ Translate is available.
+ \value ContextMenuRequest.CanEditRichly
+ Context is richly editable.
+*/
diff --git a/src/webenginequick/doc/src/fullscreen_request.qdoc b/src/webenginequick/doc/src/fullscreen_request.qdoc
new file mode 100644
index 000000000..60da2748c
--- /dev/null
+++ b/src/webenginequick/doc/src/fullscreen_request.qdoc
@@ -0,0 +1,58 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+ \qmltype FullScreenRequest
+ \instantiates QWebEngineFullScreenRequest
+ \inqmlmodule QtWebEngine
+ \since QtWebEngine 1.1
+
+ \brief A utility type for the WebEngineView::fullScreenRequested() signal.
+
+ \sa WebEngineView::fullScreenRequested()
+*/
+
+/*!
+ \qmlproperty url FullScreenRequest::origin
+ \readonly
+ The URL of the web page that issued the fullscreen request.
+*/
+
+/*!
+ \qmlproperty bool FullScreenRequest::toggleOn
+ \readonly
+
+ Returns \c{true} if the application should toggle fullscreen mode on, \c{false} otherwise.
+
+ \sa accept()
+*/
+
+/*!
+ \qmlmethod void FullScreenRequest::accept()
+
+ Call this method to accept the fullscreen request. It sets the WebEngineView::isFullScreen
+ property to be equal to toggleOn.
+
+ \qml
+ ApplicationWindow {
+ id: window
+ WebEngineView {
+ onFullScreenRequested: function(request) {
+ if (request.toggleOn)
+ window.showFullScreen()
+ else
+ window.showNormal()
+ request.accept()
+ }
+ }
+ }
+ \endqml
+
+ \sa toggleOn
+*/
+
+/*!
+ \qmlmethod void FullScreenRequest::reject()
+ Rejects a fullscreen request.
+*/
+
diff --git a/src/webenginequick/doc/src/loading_info.qdoc b/src/webenginequick/doc/src/loading_info.qdoc
new file mode 100644
index 000000000..c97799e24
--- /dev/null
+++ b/src/webenginequick/doc/src/loading_info.qdoc
@@ -0,0 +1,64 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+ \qmltype WebEngineLoadingInfo
+ \instantiates QWebEngineLoadingInfo
+ \inqmlmodule QtWebEngine
+ \since QtWebEngine 1.0
+
+ \brief A utility type for the WebEngineView::loadingChanged signal.
+
+ Contains information about a request for loading a web page, such as the URL and
+ current loading status (started, succeeded, failed).
+
+ \sa WebEngineView::loadingChanged
+*/
+/*!
+ \qmlproperty url WebEngineLoadingInfo::url
+ \brief Holds the URL of the load request.
+ */
+/*!
+ \qmlproperty enumeration WebEngineLoadingInfo::status
+
+ This enumeration represents the load status of a web page load request:
+
+ \value WebEngineView.LoadStartedStatus Page is currently loading.
+ \value WebEngineView.LoadStoppedStatus
+ Loading the page was stopped by the stop() method or by the loader
+ code or network stack in Chromium.
+ \value WebEngineView.LoadSucceededStatus
+ Page has been loaded with success.
+ \value WebEngineView.LoadFailedStatus Page could not be loaded.
+
+ \sa WebEngineView::loadingChanged
+*/
+/*!
+ \qmlproperty string WebEngineLoadingInfo::errorString
+ \brief Holds the error message.
+*/
+/*!
+ \qmlproperty enumeration WebEngineLoadingInfo::errorDomain
+ This enumeration holds the type of a load request error:
+
+ \value WebEngineLoadingInfo.NoErrorDomain
+ Error type is not known.
+ \value WebEngineLoadingInfo.InternalErrorDomain
+ Content cannot be interpreted by \QWE.
+ \value WebEngineLoadingInfo.ConnectionErrorDomain
+ Error results from a faulty network connection.
+ \value WebEngineLoadingInfo.CertificateErrorDomain
+ Error is related to the SSL/TLS certificate.
+ \value WebEngineLoadingInfo.HttpErrorDomain
+ Error is related to the HTTP connection.
+ \value WebEngineLoadingInfo.FtpErrorDomain
+ Error is related to the FTP connection.
+ \value WebEngineLoadingInfo.DnsErrorDomain
+ Error is related to the DNS connection.
+ \value WebEngineLoadingInfo.HttpStatusCodeDomain
+ Error is the HTTP response status code, even in case of success e.g. the server replied with status 200.
+*/
+/*!
+ \qmlproperty int WebEngineLoadingInfo::errorCode
+ \brief Holds the error code.
+*/
diff --git a/src/webenginequick/doc/src/navigation_history.qdoc b/src/webenginequick/doc/src/navigation_history.qdoc
new file mode 100644
index 000000000..94876799d
--- /dev/null
+++ b/src/webenginequick/doc/src/navigation_history.qdoc
@@ -0,0 +1,113 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+ \qmltype WebEngineHistoryModel
+ \instantiates QWebEngineHistoryModel
+ \inqmlmodule QtWebEngine
+ \since QtWebEngine 1.1
+
+ \brief A data model that represents the history of a web engine page.
+
+ The WebEngineHistoryModel type exposes the \e title, \e url, \e icon, and \e offset roles.
+ The \e title, \e url and \e icon specify the title, URL, and favicon of the visited page.
+ The \e offset specifies
+ the position of the page in respect to the current page (0). A positive number indicates that
+ the page was visited after the current page, whereas a negative number indicates that the page
+ was visited before the current page.
+
+ This type is uncreatable, but it can be accessed by using the
+ \l{WebEngineView::history}{WebEngineView.history} property.
+
+ \sa WebEngineHistory
+*/
+
+/*!
+ \qmltype WebEngineHistory
+ \instantiates QWebEngineHistory
+ \inqmlmodule QtWebEngine
+ \since QtWebEngine 1.1
+
+ \brief Provides data models that represent the history of a web engine page.
+
+ The WebEngineHistory type can be accessed by using the
+ \l{WebEngineView::history}{WebEngineView.history} property.
+
+ The WebEngineHistory type provides the following WebEngineHistoryModel data model objects:
+
+ \list
+ \li \c backItems, which contains the URLs of visited pages.
+ \li \c forwardItems, which contains the URLs of the pages that were visited after visiting
+ the current page.
+ \li \c items, which contains the URLs of the back and forward items, as well as the URL of
+ the current page.
+ \endlist
+
+ The easiest way to use these models is to use them in a ListView as illustrated by the
+ following code snippet:
+
+ \code
+ ListView {
+ id: historyItemsList
+ anchors.fill: parent
+ model: webEngineView.history.items
+ delegate:
+ Text {
+ color: "black"
+ text: model.title + " - " + model.url + " (" + model.offset + ")"
+ }
+ }
+ \endcode
+
+ The ListView shows the content of the corresponding model. The delegate is responsible for the
+ format of the list items. The appearance of each item of the list in the delegate can be defined
+ separately (it is not web engine specific).
+
+ The model roles \e title, \e url, and \e icon specify the title, URL, and favicon of the
+ visited page. The \e offset
+ role specifies the position of the page in respect to the current page (0). A positive number
+ indicates that the page was visited after the current page, whereas a negative number indicates
+ that the page was visited before the current page.
+
+ The data models can also be used to create a menu, as illustrated by the following code
+ snippet:
+
+ \quotefromfile webenginequick/quicknanobrowser/BrowserWindow.qml
+ \skipto ToolBar
+ \printuntil onObjectRemoved
+ \printuntil }
+ \printuntil }
+ \printuntil }
+
+ For the complete example, see \l{WebEngine Quick Nano Browser}.
+
+ \sa WebEngineHistoryModel
+*/
+
+/*!
+ \qmlproperty WebEngineHistoryModel WebEngineHistory::items
+ \readonly
+
+ URLs of back items, forward items, and the current item in the history.
+*/
+
+/*!
+ \qmlproperty WebEngineHistoryModel WebEngineHistory::backItems
+ \readonly
+
+ URLs of visited pages.
+*/
+
+/*!
+ \qmlproperty WebEngineHistoryModel WebEngineHistory::forwardItems
+ \readonly
+
+ URLs of the pages that were visited after visiting the current page.
+*/
+
+/*!
+ \qmlmethod void WebEngineHistory::clear()
+ \since QtWebEngine 1.11
+
+ Clears the history.
+*/
diff --git a/src/webenginequick/doc/src/qtwebengine-examples.qdoc b/src/webenginequick/doc/src/qtwebengine-examples.qdoc
new file mode 100644
index 000000000..eebf18ba1
--- /dev/null
+++ b/src/webenginequick/doc/src/qtwebengine-examples.qdoc
@@ -0,0 +1,15 @@
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+ \group webengine-examples
+ \title Qt WebEngine Quick Examples
+ \brief Examples demonstrating the \QWE usage.
+
+ These examples and demonstrations show a range of different uses for \l{Qt WebEngine},
+ from displaying Web pages within a QML user interface to an implementation of
+ a basic function Web browser.
+
+ For widget-based applications, Qt provides an integrated Web browser component based on
+ Chromium, the popular open source browser engine.
+*/
diff --git a/src/webenginequick/doc/src/qtwebengine-module.qdoc b/src/webenginequick/doc/src/qtwebengine-module.qdoc
new file mode 100644
index 000000000..6f50cc2f4
--- /dev/null
+++ b/src/webenginequick/doc/src/qtwebengine-module.qdoc
@@ -0,0 +1,25 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+ \module QtWebEngineQuick
+ \title Qt WebEngine Quick C++ Classes
+ \brief Exposes C++ functionality to Qt Quick.
+ \ingroup modules
+ \ingroup qtwebengine-modules
+ \qtvariable webenginequick
+ \qtcmakepackage WebEngineQuick
+
+ The \QWE Quick module exposes C++ functionality to Qt Quick.
+
+ \if !defined(qtforpython)
+ To link against the module, add the following to your qmake project file:
+
+ \snippet qtwebengine_build_snippet.qdoc 0
+
+ For build with CMake use the \c find_package() command to locate the needed module components
+ in the Qt6 package and \c target_link_libraries() to link against the module:
+
+ \snippet qtwebengine_build_snippet.qdoc 2
+ \endif
+*/
diff --git a/src/webenginequick/doc/src/qtwebengine-qmlmodule.qdoc b/src/webenginequick/doc/src/qtwebengine-qmlmodule.qdoc
new file mode 100644
index 000000000..ecf3a4a6e
--- /dev/null
+++ b/src/webenginequick/doc/src/qtwebengine-qmlmodule.qdoc
@@ -0,0 +1,29 @@
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+ \qmlmodule QtWebEngine
+ \title Qt WebEngine QML Types
+ \brief Provides QML types for rendering web content within a QML application.
+ \ingroup qtwebengine-modules
+ \ingroup qmlmodules
+
+ To link against the module using build with qmake,
+ add the following QT variable to your qmake .pro file:
+
+ \snippet qtwebengine_build_snippet.qdoc 0
+
+ For build with CMake use the \c find_package() command to locate the needed module components
+ in the Qt6 package and \c target_link_libraries() to link against the module:
+
+ \snippet qtwebengine_build_snippet.qdoc 2
+
+ The minimal amount of code needed to load and display an HTML page using the QML engine
+ requires a proper initialization:
+
+ \snippet minimal/main.cpp Minimal Example
+
+ Where the content of main.qml is simply:
+
+ \snippet minimal/main.qml Minimal Example
+*/
diff --git a/src/webenginequick/doc/src/quota_request.qdoc b/src/webenginequick/doc/src/quota_request.qdoc
new file mode 100644
index 000000000..01f4ec286
--- /dev/null
+++ b/src/webenginequick/doc/src/quota_request.qdoc
@@ -0,0 +1,36 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+ \qmltype QuotaRequest
+ \instantiates QWebEngineQuotaRequest
+ \inqmlmodule QtWebEngine
+ \since QtWebEngine 1.7
+ \deprecated [6.5] Requesting host quota is no longer supported by Chromium.
+
+ The behavior of navigator.webkitPersistentStorage
+ is identical to navigator.webkitTemporaryStorage.
+
+ For further details, see https://crbug.com/1233525
+
+ \sa WebEngineView::quotaRequested()
+*/
+
+/*!
+ \qmlproperty url QuotaRequest::origin
+ \readonly
+*/
+
+/*!
+ \qmlproperty qint64 QuotaRequest::requestedSize
+ \readonly
+*/
+
+/*!
+ \qmlmethod void QuotaRequest::accept()
+*/
+
+/*!
+ \qmlmethod void QuotaRequest::reject()
+*/
+
diff --git a/src/webenginequick/doc/src/register_protocol_handler_request.qdoc b/src/webenginequick/doc/src/register_protocol_handler_request.qdoc
new file mode 100644
index 000000000..d69f4d264
--- /dev/null
+++ b/src/webenginequick/doc/src/register_protocol_handler_request.qdoc
@@ -0,0 +1,42 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+ \qmltype RegisterProtocolHandlerRequest
+ \instantiates QWebEngineRegisterProtocolHandlerRequest
+ \inqmlmodule QtWebEngine
+ \since QtWebEngine 1.7
+ \brief The RegisterProtocolHandlerRequest type enables accepting
+ or rejecting requests from the \l registerProtocolHandler API.
+
+ \sa WebEngineView::registerProtocolHandlerRequested()
+*/
+
+/*!
+ \qmlproperty url RegisterProtocolHandlerRequest::origin
+ \brief The URL template for the protocol handler.
+
+ This is the second parameter from the \l registerProtocolHandler call.
+*/
+
+/*!
+ \qmlproperty string RegisterProtocolHandlerRequest::scheme
+ \brief The URL scheme for the protocol handler.
+
+ This is the first parameter from the \l registerProtocolHandler call.
+*/
+
+/*!
+ \qmlmethod void RegisterProtocolHandlerRequest::accept()
+ \brief Accepts the request.
+
+ Subsequent calls to accept() and reject() are ignored.
+*/
+
+/*!
+ \qmlmethod void RegisterProtocolHandlerRequest::reject()
+ \brief Accepts the request.
+
+ Subsequent calls to accept() and reject() are ignored.
+*/
+
diff --git a/src/webenginequick/doc/src/touch_selection_menu_request.qdoc b/src/webenginequick/doc/src/touch_selection_menu_request.qdoc
new file mode 100644
index 000000000..9ca6ed36b
--- /dev/null
+++ b/src/webenginequick/doc/src/touch_selection_menu_request.qdoc
@@ -0,0 +1,79 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+ \qmltype TouchSelectionMenuRequest
+ //! \instantiates QQuickWebEngineTouchSelectionMenuRequest
+ \inqmlmodule QtWebEngine
+ \since QtWebEngine 6.3
+
+ \brief A request for showing a touch selection menu.
+
+ A TouchSelectionMenuRequest is passed as an argument of the
+ WebEngineView::touchSelectionMenuRequest signal. It provides further
+ information about the context of the request. The \l selectionBounds
+ property provides the origin of the request.
+
+ The \l accepted property of the request indicates whether the request
+ is handled by the user code or the default touch selection menu should
+ be displayed.
+
+ The following code uses a custom menu to handle the request:
+
+ \code
+ WebEngineView {
+ id: view
+ // ...
+ onTouchSelectionMenuRequested: function(request) {
+ request.accepted = true;
+ myMenu.x = request.selectionBounds.x;
+ myMenu.y = request.selectionBounds.y;
+ myMenu.trigger.connect(view.triggerWebAction);
+ myMenu.popup();
+ }
+ // ...
+ }
+ \endcode
+*/
+
+/*!
+ \qmlproperty rect TouchSelectionMenuRequest::selectionBounds
+ \readonly
+
+ The position of the bound rectangle from the touch text
+ selection.
+*/
+
+/*!
+ \qmlproperty bool TouchSelectionMenuRequest::accepted
+
+ Indicates whether the touch selection menu request has
+ been handled by the signal handler.
+
+ If the property is \c false after any signal handlers
+ for WebEngineView::touchSelectionMenuRequested have been executed,
+ a default touch selection menu will be shown.
+ To prevent this, set \c{request.accepted} to \c true.
+
+ The default is \c false.
+
+ \note The default content of the touch selection menu depends
+ on the web element for which the request was actually generated.
+*/
+
+
+/*!
+ \qmlproperty flags QQuickWebEngineTouchSelectionMenuRequest::touchSelectionCommandFlags
+ \readonly
+ \since QtWebEngine 6.3
+
+ \note In the default touch selection menu, showing the context menu
+ is always available as a separate action.
+
+ \value QQuickWebEngineTouchSelectionMenuRequest.Cut
+ Cut is available.
+ \value QQuickWebEngineTouchSelectionMenuRequest.Copy
+ Copy is available.
+ \value QQuickWebEngineTouchSelectionMenuRequest.Paste
+ Paste is available.
+*/
diff --git a/src/webenginequick/doc/src/webengine_certificate_error.qdoc b/src/webenginequick/doc/src/webengine_certificate_error.qdoc
new file mode 100644
index 000000000..93bad9fb1
--- /dev/null
+++ b/src/webenginequick/doc/src/webengine_certificate_error.qdoc
@@ -0,0 +1,108 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+ \qmltype WebEngineCertificateError
+ \instantiates QWebEngineCertificateError
+ \inqmlmodule QtWebEngine
+ \since QtWebEngine 1.1
+
+ \brief A utility type for ignoring certificate errors or rejecting erroneous certificates.
+
+ This QML type contains information about a certificate error that occurred. The \l type
+ property holds the reason that the error occurred and the \l description property holds a
+ short localized description of the error. The \l url property holds the URL that triggered
+ the error.
+
+ The certificate can be rejected by calling \l rejectCertificate(), which will stop loading the
+ web engine request. By default, an invalid certificate will be automatically rejected.
+
+ The certificate error can be ignored by calling \l acceptCertificate(), which will
+ resume loading the request.
+
+ It is possible to defer the decision of rejecting a certificate by calling \l defer(),
+ which is useful when waiting for user input.
+
+ \sa WebEngineView::certificateError
+*/
+/*!
+ \qmlmethod void WebEngineCertificateError::defer()
+
+ This function should be called when there is a need to postpone the decision whether to ignore a
+ certificate error, for example, while waiting for user input. When called, the function pauses the
+ URL request until acceptCertificate() or rejectCertificate() is called.
+ */
+/*!
+ \qmlmethod void WebEngineCertificateError::acceptCertificate()
+
+ The certificate error is ignored, and the web engine view continues to load the requested URL.
+ */
+/*!
+ \qmlmethod void WebEngineCertificateError::rejectCertificate()
+
+ The certificate is rejected, and the web engine view stops loading the requested URL.
+ */
+/*!
+ \qmlproperty url WebEngineCertificateError::url
+ \readonly
+
+ The URL that triggered the error.
+ */
+/*!
+ \qmlproperty enumeration WebEngineCertificateError::type
+ \readonly
+
+ The type of the error.
+
+ \value WebEngineCertificateError.SslPinnedKeyNotInCertificateChain
+ The certificate did not match the built-in public keys pinned for
+ the host name.
+ \value WebEngineCertificateError.CertificateCommonNameInvalid
+ The certificate's common name did not match the host name.
+ \value WebEngineCertificateError.CertificateDateInvalid
+ The certificate is not valid at the current date and time.
+ \value WebEngineCertificateError.CertificateAuthorityInvalid
+ The certificate is not signed by a trusted authority.
+ \value WebEngineCertificateError.CertificateContainsErrors
+ The certificate contains errors.
+ \value WebEngineCertificateError.CertificateNoRevocationMechanism
+ The certificate has no mechanism for determining if it has been
+ revoked.
+ \value WebEngineCertificateError.CertificateUnableToCheckRevocation
+ Revocation information for the certificate is not available.
+ \value WebEngineCertificateError.CertificateRevoked
+ The certificate has been revoked.
+ \value WebEngineCertificateError.CertificateInvalid
+ The certificate is invalid.
+ \value WebEngineCertificateError.CertificateWeakSignatureAlgorithm
+ The certificate is signed using a weak signature algorithm.
+ \value WebEngineCertificateError.CertificateNonUniqueName
+ The host name specified in the certificate is not unique.
+ \value WebEngineCertificateError.CertificateWeakKey
+ The certificate contains a weak key.
+ \value WebEngineCertificateError.CertificateNameConstraintViolation
+ The certificate claimed DNS names that are in violation of name
+ constraints.
+ \value WebEngineCertificateError.CertificateValidityTooLong
+ The certificate has a validity period that is too long.
+ (Added in 5.7)
+ \value WebEngineCertificateError.CertificateTransparencyRequired
+ Certificate Transparency was required for this connection, but the server
+ did not provide CT information that complied with the policy. (Added in 5.8)
+ \value WebEngineCertificateError.CertificateKnownInterceptionBlocked
+ The certificate is known to be used for interception by an entity other
+ the device owner. (Added in 5.15)
+
+*/
+/*!
+ \qmlproperty string WebEngineCertificateError::description
+ \readonly
+
+ A short localized human-readable description of the error.
+*/
+/*!
+ \qmlproperty bool WebEngineCertificateError::overridable
+ \readonly
+
+ A boolean that indicates whether the certificate error can be overridden and ignored.
+*/
diff --git a/src/webenginequick/doc/src/webengine_download_request.qdoc b/src/webenginequick/doc/src/webengine_download_request.qdoc
new file mode 100644
index 000000000..96d84e0a3
--- /dev/null
+++ b/src/webenginequick/doc/src/webengine_download_request.qdoc
@@ -0,0 +1,278 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+ \qmltype WebEngineDownloadRequest
+ \instantiates QWebEngineDownloadRequest
+ \inqmlmodule QtWebEngine
+ \brief Provides information about a download.
+
+ WebEngineDownloadRequest models a download throughout its life cycle, starting
+ with a pending download request and finishing with a completed download. It
+ can be used, for example, to get information about new downloads, to monitor
+ progress, and to pause, resume, and cancel downloads.
+
+ Downloads are usually triggered by user interaction on a web page. It is the
+ WebEngineProfile's responsibility to notify the application of new download
+ requests, which it does by emitting the
+ \l{WebEngineProfile::downloadRequested}{downloadRequested} signal together
+ with a newly created WebEngineDownloadRequest. The application can then examine
+ this item and decide whether to accept it or not. A signal handler must
+ explicitly call accept() on the item for \QWE to actually start
+ downloading and writing data to disk. If no signal handler calls accept(),
+ then the download request will be automatically rejected and nothing will be
+ written to disk.
+
+ \note Some properties, like the \l path under which the file will be saved,
+ can only be changed before calling accept().
+
+ \section2 Object Life Cycle
+
+ All items are guaranteed to be valid during the emission of the
+ \l{WebEngineProfile::downloadRequested}{downloadRequested} signal. If
+ accept() is \e not called by any signal handler, then the item will be
+ deleted \e immediately after signal emission. This means that the
+ application \b{must not} keep references to rejected download items.
+
+ \section2 Web Page Downloads
+
+ In addition to normal file downloads, which consist simply of retrieving
+ some raw bytes from the network and writing them to disk, \QWE also
+ supports saving complete web pages, which involves parsing the page's HTML,
+ downloading any dependent resources, and potentially packaging everything
+ into a special file format (\l savePageFormat). To check if a download is
+ for a file or a web page, use \l isSavePageDownload.
+
+ \sa WebEngineProfile, WebEngineProfile::downloadRequested,
+ WebEngineProfile::downloadFinished
+*/
+
+/*!
+ \qmlmethod void WebEngineDownloadRequest::accept()
+
+ Accepts the download request, which will start the download.
+
+ If the item is in the \c DownloadRequested state, then it will transition
+ into the \c DownloadInProgress state and the downloading will begin. If the
+ item is in any other state, then nothing will happen.
+
+ \sa state
+*/
+
+/*!
+ \qmlmethod void WebEngineDownloadRequest::cancel()
+
+ Cancels the download.
+
+ If the item is in the \c DownloadInProgress state, then it will transition
+ into the \c DownloadCancelled state, the downloading will stop, and
+ partially downloaded files will be deleted from disk.
+
+ If the item is in the \c DownloadCompleted state, then nothing will happen.
+ If the item is in any other state, then it will transition into the \c
+ DownloadCancelled state without further effect.
+
+ \sa state
+*/
+
+/*!
+ \qmlmethod void WebEngineDownloadRequest::pause()
+
+ Pauses the download.
+
+ Has no effect if the state is not \c DownloadInProgress. Does not change the
+ state.
+
+ \sa resume, isPaused
+*/
+
+/*!
+ \qmlmethod void WebEngineDownloadRequest::resume()
+
+ Resumes the download if it was paused or interrupted.
+
+ Has no effect if the state is not \c DownloadInProgress or \c
+ DownloadInterrupted. Does not change the state.
+
+ \sa pause, isPaused
+*/
+
+/*!
+ \qmlproperty int WebEngineDownloadRequest::id
+
+ Holds the download item's ID.
+*/
+
+/*!
+ \qmlproperty enumeration WebEngineDownloadRequest::state
+
+ Describes the state of the download:
+
+ \value WebEngineDownloadRequest.DownloadRequested
+ Download has been requested, but it has not been accepted yet.
+ \value WebEngineDownloadRequest.DownloadInProgress
+ Download is in progress.
+ \value WebEngineDownloadRequest.DownloadCompleted
+ Download completed successfully.
+ \value WebEngineDownloadRequest.DownloadCancelled
+ Download was cancelled by the user.
+ \value WebEngineDownloadRequest.DownloadInterrupted
+ Download has been interrupted (by the server or because of lost connectivity).
+*/
+
+/*!
+ \qmlproperty int WebEngineDownloadRequest::totalBytes
+
+ Holds the total amount of data to download in bytes.
+
+ \c -1 means the total size is unknown.
+*/
+
+/*!
+ \qmlproperty int WebEngineDownloadRequest::receivedBytes
+
+ Holds the amount of data in bytes that has been downloaded so far.
+*/
+
+/*!
+ \qmlproperty url WebEngineDownloadRequest::url
+ \readonly
+
+ Returns the download's origin URL.
+*/
+
+/*!
+ \qmlproperty string WebEngineDownloadRequest::mimeType
+
+ Holds the MIME type of the download.
+*/
+
+/*!
+ \qmlproperty string WebEngineDownloadRequest::downloadDirectory
+
+ Holds the full target path without file name where data is being downloaded to.
+
+ The download directory can only be set in the
+ \l{WebEngineProfile::downloadRequested}{downloadRequested} handler before
+ the download is accepted.
+
+ \sa WebEngineProfile::downloadRequested(), accept()
+*/
+
+/*!
+ \qmlproperty string WebEngineDownloadRequest::downloadFileName
+
+ Holds the name of the file to which data is being downloaded.
+
+ The download file name can only be set in the
+ \l{WebEngineProfile::downloadRequested}{downloadRequested} handler before
+ the download is accepted.
+
+ \sa WebEngineProfile::downloadRequested(), accept()
+*/
+
+/*!
+ \qmlproperty string WebEngineDownloadRequest::suggestedFileName
+
+ Returns the suggested file name.
+*/
+
+/*!
+ \qmlproperty enumeration WebEngineDownloadRequest::savePageFormat
+
+ Describes the format that is used to save a web page.
+
+ \value WebEngineDownloadRequest.UnknownSaveFormat
+ This is not a request for downloading a complete web page.
+ \value WebEngineDownloadRequest.SingleHtmlSaveFormat
+ The page is saved as a single HTML page. Resources such as images
+ are not saved.
+ \value WebEngineDownloadRequest.CompleteHtmlSaveFormat
+ The page is saved as a complete HTML page, for example a directory
+ containing the single HTML page and the resources.
+ \value WebEngineDownloadRequest.MimeHtmlSaveFormat
+ The page is saved as a complete web page in the MIME HTML format.
+*/
+
+/*!
+ \qmlproperty bool WebEngineDownloadRequest::isSavePageDownload
+ \readonly
+
+ Whether this is a download request for saving a web page or a file.
+
+ \sa savePageFormat
+*/
+
+/*!
+ \qmlproperty enumeration WebEngineDownloadRequest::interruptReason
+ \readonly
+
+ Returns the reason why the download was interrupted:
+
+ \value WebEngineDownloadRequest.NoReason Unknown reason or not interrupted.
+ \value WebEngineDownloadRequest.FileFailed General file operation failure.
+ \value WebEngineDownloadRequest.FileAccessDenied The file cannot be written locally, due to access restrictions.
+ \value WebEngineDownloadRequest.FileNoSpace Insufficient space on the target drive.
+ \value WebEngineDownloadRequest.FileNameTooLong The directory or file name is too long.
+ \value WebEngineDownloadRequest.FileTooLarge The file size exceeds the file system limitation.
+ \value WebEngineDownloadRequest.FileVirusInfected The file is infected with a virus.
+ \value WebEngineDownloadRequest.FileTransientError Temporary problem (for example the file is in use,
+ out of memory, or too many files are opened at once).
+ \value WebEngineDownloadRequest.FileBlocked The file was blocked due to local policy.
+ \value WebEngineDownloadRequest.FileSecurityCheckFailed An attempt to check the safety of the download
+ failed due to unexpected reasons.
+ \value WebEngineDownloadRequest.FileTooShort An attempt was made to seek past the end of a file when
+ opening a file (as part of resuming a previously interrupted download).
+ \value WebEngineDownloadRequest.FileHashMismatch The partial file did not match the expected hash.
+
+ \value WebEngineDownloadRequest.NetworkFailed General network failure.
+ \value WebEngineDownloadRequest.NetworkTimeout The network operation has timed out.
+ \value WebEngineDownloadRequest.NetworkDisconnected The network connection has been terminated.
+ \value WebEngineDownloadRequest.NetworkServerDown The server has gone down.
+ \value WebEngineDownloadRequest.NetworkInvalidRequest The network request was invalid (for example, the
+ original or redirected URL is invalid, has an unsupported scheme, or is disallowed by policy).
+
+ \value WebEngineDownloadRequest.ServerFailed General server failure.
+ \value WebEngineDownloadRequest.ServerBadContent The server does not have the requested data.
+ \value WebEngineDownloadRequest.ServerUnauthorized The server did not authorize access to the resource.
+ \value WebEngineDownloadRequest.ServerCertProblem A problem with the server certificate occurred.
+ \value WebEngineDownloadRequest.ServerForbidden Access forbidden by the server.
+ \value WebEngineDownloadRequest.ServerUnreachable Unexpected server response (might indicate that
+ the responding server may not be the intended server).
+ \value WebEngineDownloadRequest.UserCanceled The user canceled the download.
+
+ \sa interruptReasonString
+*/
+
+/*!
+ \qmlproperty string WebEngineDownloadRequest::interruptReasonString
+ Returns a human-readable description of the reason for interrupting the download.
+
+ \sa interruptReason
+*/
+
+/*!
+ \qmlproperty bool WebEngineDownloadRequest::isFinished
+ \readonly
+
+ Whether this download is finished (completed, cancelled, or non-resumable interrupted state).
+ */
+
+/*!
+ \qmlproperty bool WebEngineDownloadRequest::isPaused
+ \readonly
+
+ Whether this download is paused.
+
+ \sa pause, resume
+ */
+
+/*!
+ \qmlproperty WebEngineView WebEngineDownloadRequest::view
+ \readonly
+
+ Returns the view the download was requested on. If the download was not triggered by content in a view,
+ \c nullptr is returned.
+
+ \sa WebEngineView
+*/
diff --git a/src/webenginequick/doc/src/webenginescript.qdoc b/src/webenginequick/doc/src/webenginescript.qdoc
new file mode 100644
index 000000000..9708ffbf8
--- /dev/null
+++ b/src/webenginequick/doc/src/webenginescript.qdoc
@@ -0,0 +1,98 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+ \qmltype WebEngineScript
+ \instantiates QWebEngineScript
+ \brief Enables the programmatic injection of scripts in the JavaScript engine.
+ \since QtWebEngine 1.1
+ \ingroup qmlvaluetypes
+ \inqmlmodule QtWebEngine
+
+ The WebEngineScript type enables the programmatic injection of so called \e {user scripts} in
+ the JavaScript engine at different points, determined by injectionPoint, during the loading of
+ web content.
+
+ Scripts can be executed either in the main JavaScript \e world, along with the rest of the
+ JavaScript coming from the web contents, or in their own isolated world. While the DOM of the
+ page can be accessed from any world, JavaScript variables of a function defined in one world are
+ not accessible from a different one. The worldId property provides some predefined IDs for this
+ purpose.
+
+ The following \l Greasemonkey attributes are supported:
+ \c @exclude, \c @include, \c @name, \c @match, and \c @run-at.
+
+ Use \l{WebEngineScriptCollection} to access a list of scripts attached to the web view.
+*/
+
+/*!
+ \qmlproperty string WebEngineScript::name
+
+ The name of the script. Can be useful to retrieve a particular script from
+ \l{WebEngineScriptCollection::find}{WebEngineScriptCollection.find} method.
+*/
+
+/*!
+ \qmlproperty url WebEngineScript::sourceUrl
+
+ This property holds the remote source location of the user script (if any).
+
+ Unlike \l sourceCode, this property allows referring to user scripts that
+ are not already loaded in memory, for instance, when stored on disk.
+
+ Setting this property will change the \l sourceCode of the script.
+
+ \note At present, only file-based sources are supported.
+
+ \sa sourceCode
+*/
+
+/*!
+ \qmlproperty string WebEngineScript::sourceCode
+
+ This property holds the JavaScript source code of the user script.
+
+ \sa sourceUrl
+*/
+
+/*!
+ \qmlproperty enumeration WebEngineScript::injectionPoint
+
+ The point in the loading process at which the script will be executed.
+ The default value is \c Deferred.
+
+ \value WebEngineScript.DocumentCreation
+ The script will be executed as soon as the document is created. This is not suitable for
+ any DOM operation.
+ \value WebEngineScript.DocumentReady
+ The script will run as soon as the DOM is ready. This is equivalent to the
+ \c DOMContentLoaded event firing in JavaScript.
+ \value WebEngineScript.Deferred
+ The script will run when the page load finishes, or 500 ms after the document is ready,
+ whichever comes first.
+*/
+
+/*!
+ \qmlproperty enumeration WebEngineScript::worldId
+
+ The world ID defining which isolated world the script is executed in.
+
+ \value WebEngineScript.MainWorld
+ The world used by the page's web contents. It can be useful in order to expose custom
+ functionality to web contents in certain scenarios.
+ \value WebEngineScript.ApplicationWorld
+ The default isolated world used for application level functionality implemented in
+ JavaScript.
+ \value WebEngineScript.UserWorld
+ The first isolated world to be used by scripts set by users if the application is not
+ making use of more worlds. As a rule of thumb, if that functionality is exposed to the
+ application users, each individual script should probably get its own isolated world.
+*/
+
+/*!
+ \qmlproperty int WebEngineScript::runOnSubframes
+
+ Set this property to \c true if the script is executed on every frame in the page, or \c false
+ if it is only ran for the main frame.
+ The default value is \c{false}.
+*/
diff --git a/src/webenginequick/doc/src/webengineview_lgpl.qdoc b/src/webenginequick/doc/src/webengineview_lgpl.qdoc
new file mode 100644
index 000000000..eeae34dcc
--- /dev/null
+++ b/src/webenginequick/doc/src/webengineview_lgpl.qdoc
@@ -0,0 +1,1585 @@
+// Copyright (C) 2019 The Qt Company Ltd.
+// Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
+// Copyright (c) 2012 Hewlett-Packard Development Company, L.P.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+// The documentation in this file was imported from QtWebKit and is thus constrained
+// by its LGPL license.
+
+/*!
+ \qmltype WebEngineView
+ \instantiates QQuickWebEngineView
+ \inherits Item
+ \inqmlmodule QtWebEngine
+ \since QtWebEngine 1.0
+ \brief A WebEngineView renders web content within a QML application.
+
+ The WebEngineView type enables QML applications to render regions of dynamic web content. It
+ may share the screen with other QML types, such as a TabView, or fill the screen, as specified
+ within the QML application.
+
+ \section2 Initializing Web Engine
+
+ For the web engine view to be rendered, the web engine must be initialized by using
+ \l QtWebEngineQuick::initialize in the application main source file, as illustrated by the
+ following code snippet:
+
+ \quotefromfile minimal/main.cpp
+ \skipto main
+ \printuntil }
+
+ \section2 Loading Web Pages
+
+ An application can load pages into the WebEngineView, using either the \l url property or the
+ \l loadHtml method and navigate within the view's session history. The GET
+ method is always used to load URLs.
+
+ The history is represented by a WebEngineHistory data model that is held by
+ the \l history property.
+
+ The following sample QML application loads a web page using the \c url property:
+
+ \quotefromfile minimal/main.qml
+ \skipto import
+ \printuntil /^\}/
+
+ The \l loading property holds whether an HTML page is currently loading.
+ The \l loadingChanged() signal is emitted when loading the page begins, ends, or fails.
+
+ The title of an HTML page can be accessed with the \l title property. Additionally, a web
+ page may specify an icon, which can be accessed using the \l icon property. The \l zoomFactor
+ property enables zooming the contents of the web page by a scale factor.
+
+ If a certificate error is raised while loading a web page, the \l certificateError() signal is
+ emitted. Certificate errors are handled by using the methods of the WebEngineCertificateError
+ type.
+
+ \section2 Interaction
+
+ By default, links to different pages load within the same WebEngineView object, but web sites
+ may request them to be opened as a new tab, window, or dialog. The \l newWindowRequested() signal
+ is emitted when a request to load the page in a separate web engine view is issued. The
+ NewViewDestination property describes how the new view should be opened. In addition, the
+ WebEngineNewWindowRequest utility type can be used to load web pages in separate web engine views.
+
+ The \l findText() method can be used to search for a string on a web page, using the options
+ described by \l FindFlags.
+
+ The \l setActiveFocusOnPress() method can be used to create a UI element that should not get
+ focus on press. This can be useful in a hybrid UI.
+
+ The \l {WebEngineSettings::focusOnNavigationEnabled} {focusOnNavigationEnabled} setting can be
+ used to make the view automatically receive focus when a navigation operation occurs
+ (like loading or reloading a page or navigating through history).
+
+ The \l linkHovered() signal is emitted when a mouse pointer passes over a link and thus
+ corresponds to the \c{mouseover} DOM event.
+
+ Actions, such as selecting and editing content, can be performed on a web page by using the
+ \l triggerWebAction() method. The available actions are described by the \l WebAction property.
+
+ The \l backgroundColorChanged() signal is emitted when the web page background color changes.
+
+ \section2 User Scripts
+
+ During the loading of a page, so called \e {user scripts} can be injected in the JavaScript
+ engine at different points. The script objects attached to the web engine view are held by the
+ \l userScripts property and injected by using the WebEngineScript type. Scripts can also be run
+ by using the runJavaScript() method in the same world as other scripts that are part of the
+ loaded site.
+
+ The \l webChannel property can be used to expose a WebChannel instance in the JavaScript context
+ of the page it is rendering as \c qt.webChannelTransport.
+
+ \section2 Fullscreen Mode
+
+ A web page can request through the JavaScript API to be loaded in fullscreen mode. The
+ \l fullScreenRequested() signal is emitted when the web page issues the request. The
+ FullScreenRequest utility type can be used to toggle fullscreen requests. The
+ \l fullScreenCancelled method can be used to notify the browser engine when the windowing
+ system forces the application to leave fullscreen mode.
+
+ \section2 Profiles
+
+ Web engine views can be isolated from each other by using the WebEngineProfile type. A profile
+ contains settings, scripts, and the list of visited links shared by all views that belong to the
+ profile. For example, a dedicated profile could be created for a \e {private browsing} mode. The
+ current profile for the view is held by the \l profile property and the current settings are
+ held by the \l settings property. The settings are specified by using the WebEngineSettings
+ type.
+
+ \section2 Platform Features
+
+ Web pages can request access to platform features, such as geolocation or audio and video
+ capture devices. The \l featurePermissionRequested() signal is emitted when a web page requests
+ to make use of a resource. The supported platform features are described by the \l Feature
+ property. If users grant the permission, the \l grantFeaturePermission() method is used to set
+ it to \e granted.
+
+ \section2 Rendering to OpenGL Surface
+
+ When using a QQuickRenderControl to render a Qt Quick user interface to an OpenGL surface, the
+ WebEngineView type is not rendered correctly. The web engine view attempts to use a global
+ OpenGL context created by \l QtWebEngineQuick::initialize, but there is no public API for accessing
+ that context in order to share it with the \c QQuickRenderControl context.
+
+ To have the web engine view rendered correctly, it is possible to manually create a new
+ offscreen context that is shared with the \c QQuickRenderControl and to call the non-public
+ function \c qt_gl_set_global_share_context(), rather than calling \c initialize().
+ If \c initialize() is called after setting a global context, it will do nothing.
+*/
+
+/*!
+ \qmlmethod void WebEngineView::goBack()
+
+ Go backward within the browser's session history, if possible.
+ This function is equivalent to the \c{window.history.back()} DOM method.
+
+ \sa canGoBack
+*/
+
+/*!
+ \qmlmethod void WebEngineView::goForward()
+
+ Go forward within the browser's session history, if possible.
+ This function is equivalent to the \c{window.history.forward()} DOM method.
+*/
+
+/*!
+ \qmlmethod void WebEngineView::goBackOrForward(int offset)
+ \since QtWebEngine 1.1
+
+ If \a offset is positive, goes forward the specified number of offset
+ pages in the current session history. If offset is negative, it goes
+ back. If the offset is invalid, the page is not changed.
+
+ \sa goBack(), goForward()
+*/
+
+/*!
+ \qmlmethod void WebEngineView::stop()
+
+ Stops loading the current page.
+*/
+
+/*!
+ \qmlmethod void WebEngineView::reload()
+
+ Reloads the current page. This function is equivalent to the
+ \c{window.location.reload()} DOM method.
+
+ \sa reloadAndBypassCache()
+*/
+
+/*!
+ \qmlmethod void WebEngineView::reloadAndBypassCache()
+ \since QtWebEngine 1.1
+
+ Reloads the current page, ignoring any cached content.
+
+ \sa reload()
+*/
+
+/*!
+ \qmlproperty url WebEngineView::url
+
+ The location of the currently displayed HTML page. This writable
+ property offers the main interface to load a page into a web view.
+ It functions the same as the \c{window.location} DOM property.
+
+ \sa loadHtml()
+*/
+
+/*!
+ \qmlproperty url WebEngineView::icon
+ \readonly
+
+ An internal URL for accessing the currently displayed web site icon,
+ also known as favicon or shortcut icon.
+ This read-only URL corresponds to the image used within a mobile browser
+ application to represent a bookmarked page on the device's home screen.
+
+ The following snippet uses the \c{icon} property to build an \c{Image}
+ component:
+
+ \qml
+ Image {
+ id: appIcon
+ sourceSize: Qt.size(32, 32)
+ source: webView.icon != "" ? webView.icon : "fallbackFavicon.png";
+ // ...
+ }
+ \endqml
+
+ Specifying the \l {Image::sourceSize} property informs
+ the \QWE's favicon provider about the requested size and resizes the
+ icon to it. If \l {Image::sourceSize} property is not specified,
+ the provider provides the icon with the largest available resolution.
+*/
+
+/*!
+ \qmlproperty int WebEngineView::loadProgress
+ \readonly
+
+ The amount of data from the page that has been loaded, expressed
+ as an integer percentage in the range from \c{0} to \c{100}.
+*/
+
+/*!
+ \qmlproperty bool WebEngineView::canGoBack
+ \readonly
+
+ Returns \c{true} if there are prior session history entries, \c{false}
+ otherwise.
+*/
+
+/*!
+ \qmlproperty bool WebEngineView::canGoForward
+ \readonly
+
+ Returns \c{true} if there are subsequent session history entries,
+ \c{false} otherwise.
+*/
+
+/*!
+ \qmlproperty bool WebEngineView::loading
+ \readonly
+
+ Returns \c{true} if the HTML page is currently loading, \c{false} otherwise.
+*/
+
+/*!
+ \qmlproperty string WebEngineView::title
+ \readonly
+
+ The title of the currently displayed HTML page. This is a
+ read-only value that reflects the contents of the \c{<title>} tag.
+*/
+
+/*!
+ \qmlproperty bool WebEngineView::isFullScreen
+ \since QtWebEngine 1.1
+ \readonly
+
+ Returns \c{true} if the web view is in fullscreen mode, \c{false} otherwise.
+
+ \sa fullScreenRequested(), fullScreenCancelled()
+*/
+
+/*!
+ \qmlproperty WebEngineHistory WebEngineView::history
+ \since QtWebEngine 1.1
+ \readonly
+
+ The navigation history of the current view.
+
+ \sa WebEngineHistory
+*/
+
+/*!
+ \qmlproperty QQmlWebChannel WebEngineView::webChannel
+ \since QtWebEngine 1.1
+
+ The web channel instance used by this view.
+ This channel is automatically using the internal QtWebEngine transport mechanism over Chromium IPC,
+ and exposed in the javascript context of the page it is rendering as \c qt.webChannelTransport.
+ This transport object is used when instantiating the JavaScript counterpart of QWebChannel using
+ the \l{Qt WebChannel JavaScript API}.
+
+ \note The view does not take ownership for an assigned webChannel object.
+*/
+
+/*!
+ \qmlproperty WebEngineProfile WebEngineView::profile
+ \since QtWebEngine 1.1
+
+ The current profile used for the view.
+
+ \sa WebEngineProfile
+*/
+
+/*!
+ \qmlproperty WebEngineSettings WebEngineView::settings
+ \readonly
+ \since QtWebEngine 1.1
+
+ Settings used by this view.
+
+ \sa WebEngineSettings
+*/
+
+
+/*!
+ \qmlproperty WebEngineScriptCollection WebEngineView::userScripts
+ \readonly
+ \since QtWebEngine 1.1
+
+ The user scripts' collection associated with the view.
+
+ \sa WebEngineScriptCollection
+*/
+
+/*!
+ \qmlproperty real WebEngineView::zoomFactor
+ \since QtWebEngine 1.1
+
+ Zoom factor for the view. Valid values are within the range from \c{0.25}
+ to \c{5.0}. The default factor is \c{1.0}.
+*/
+
+/*!
+ \qmlproperty size WebEngineView::contentsSize
+ \since QtWebEngine 1.3
+
+ Size of the page contents.
+*/
+
+/*!
+ \qmlproperty point WebEngineView::scrollPosition
+ \since QtWebEngine 1.3
+
+ Scroll position of the page contents.
+*/
+
+/*!
+ \qmlproperty int WebEngineView::webChannelWorld
+ \since QtWebEngine 1.3
+
+ JavaScript world that the web channel instance used by this view is
+ installed in. The world must be a number between \c 0 and \c 256.
+*/
+
+/*!
+ \qmlmethod void WebEngineView::loadHtml(string html, url baseUrl)
+ Loads the specified \a html as the content of the web view.
+
+ This method offers a lower-level alternative to the \c{url} property,
+ which references HTML pages via URL.
+
+ \a baseUrl is optional and used to resolve relative URLs in the document,
+ such as referenced images or stylesheets. For example, if \a html
+ is retrieved from \c http://www.example.com/documents/overview.html, which
+ is the base URL, then an image referenced with the relative URL, \c diagram.png,
+ should be at \c{http://www.example.com/documents/diagram.png}.
+
+ \sa url
+*/
+
+/*!
+ \qmlmethod void WebEngineView::runJavaScript(string script, variant callback)
+ Runs the specified \a script in the content of the web view.
+
+ The \a callback parameter is optional. If a callback function is provided,
+ it will be invoked after the script finishes running.
+
+ \code
+ runJavaScript("document.title", function(result) { console.log(result); });
+ \endcode
+
+ Only plain data can be returned from JavaScript as the result value.
+ Supported data types include all of the JSON data types as well as, for
+ example, \c{Date} and \c{ArrayBuffer}. Unsupported data types include, for
+ example, \c{Function} and \c{Promise}.
+
+ The script will run in the same \e world as other scripts that are
+ part of the loaded site.
+
+ \warning Do not execute lengthy routines in the callback function, because it might block the
+ rendering of the web content.
+
+ For more information about injecting scripts, see \l {Script Injection}.
+ For an alternative way to inject scripts, see WebEngineView::userScripts.
+*/
+
+/*!
+ \qmlmethod void WebEngineView::findText(string subString)
+ \since QtWebEngine 1.1
+ Finds the specified string, \a subString, in the page.
+ The findTextFinished() signal is emitted when a string search is completed.
+
+ To clear the search highlight, just pass an empty string.
+
+ \sa findTextFinished()
+*/
+
+/*!
+ \qmlmethod void WebEngineView::findText(string subString, FindFlags options)
+ \since QtWebEngine 1.1
+ Finds the specified string, \a subString, in the page, using the given \a options.
+ The findTextFinished() signal is emitted when a string search is completed.
+
+ To clear the search highlight, just pass an empty string.
+
+ \code
+ findText("Qt", WebEngineView.FindBackward | WebEngineView.FindCaseSensitively);
+ \endcode
+
+ \sa findTextFinished()
+*/
+
+/*!
+ \qmlmethod void WebEngineView::findText(string subString, FindFlags options, variant resultCallback)
+ \since QtWebEngine 1.1
+ Finds the specified string, \a subString, in the page, using the given \a options.
+ The findTextFinished() signal is emitted when a string search is completed.
+
+ To clear the search highlight, just pass an empty string.
+
+ The \a resultCallback must take an integer parameter. It will be called with
+ the number of found occurrences of the \a subString.
+
+ \code
+ findText("Qt", WebEngineView.FindCaseSensitively, function(matchCount) {
+ if (matchCount > 0)
+ console.log("'Qt' tokens found:", matchCount);
+ });
+ \endcode
+
+ \sa findTextFinished()
+*/
+
+/*!
+ \qmlmethod void WebEngineView::grantFeaturePermission(url securityOrigin, Feature feature, bool granted)
+ \since QtWebEngine 1.1
+
+ Sets or unsets the permission, depending on \a granted, for the web site
+ identified by \a securityOrigin to use \a feature.
+
+ \sa featurePermissionRequested()
+*/
+
+
+/*!
+ \qmlmethod void WebEngineView::fullScreenCancelled()
+ \since QtWebEngine 1.1
+
+ Immediately sets \c{isFullScreen} property to \c{false}. It can be used to notify the
+ browser engine when the windowing system forces the application to leave fullscreen mode.
+
+ \qml
+ ApplicationWindow {
+ onVisibilityChanged: {
+ if (webEngineView.isFullScreen && visibility != Window.FullScreen)
+ webEngineView.fullScreenCancelled()
+ }
+
+ WebEngineView {
+ id: webEngineView
+ // ...
+ }
+ }
+ \endqml
+
+ \sa isFullScreen, fullScreenRequested()
+*/
+
+/*!
+ \qmlmethod void WebEngineView::setActiveFocusOnPress(bool arg)
+ \since QtWebEngine 1.2
+
+ Sets active focus to a clicked web engine view if \a arg is \c true. By setting it to \c false,
+ a web engine view can be used to create a UI element that should not get focus. This can be
+ useful in a hybrid UI.
+
+ \sa activeFocusOnPress, activeFocusOnPressChanged,
+ WebEngineSettings::focusOnNavigationEnabled
+*/
+
+/*!
+ \qmlmethod void WebEngineView::triggerWebAction(WebAction action)
+ \since QtWebEngine 1.2
+
+ Triggers the web action \a action.
+
+ \sa WebAction
+*/
+
+/*!
+ \qmlsignal WebEngineView::featurePermissionRequested(url securityOrigin, Feature feature)
+ \since QtWebEngine 1.1
+
+ This signal is emitted when the web site identified by \a securityOrigin requests
+ to make use of the resource or device identified by \a feature.
+
+ \sa grantFeaturePermission()
+*/
+
+/*!
+ \qmlsignal WebEngineView::loadingChanged(WebEngineLoadingInfo loadingInfo)
+
+ This signal is emitted when a page load begins, ends, or fails.
+
+ When handling the signal with \c onLoadingChanged, various read-only
+ parameters are available on the WebEngineLoadingInfo specified by
+ \a loadingInfo.
+
+ \sa loading, LoadStatus, ErrorDomain
+*/
+
+/*!
+ \qmlsignal WebEngineView::certificateError(WebEngineCertificateError error)
+ \since QtWebEngine 1.1
+
+ This signal is emitted when an invalid certificate error, \a error, is
+ raised while loading a given request.
+
+ The certificate error can be handled by using the methods of the WebEngineCertificateError
+ type.
+*/
+
+/*!
+ \qmlsignal WebEngineView::linkHovered(url hoveredUrl)
+
+ Within a mouse-driven interface, this signal is emitted when a mouse
+ pointer passes over a link, corresponding to the \c{mouseover} DOM
+ event. This event may also occur in touch interfaces for \c{mouseover}
+ events that are not cancelled with \c{preventDefault()}. \a{hoveredUrl}
+ provides the link's location.
+*/
+
+/*!
+ \qmlsignal WebEngineView::javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, string message, int lineNumber, string sourceID)
+ This signal is emitted when a JavaScript program tries to print a \a message to the web browser's console.
+
+ For example, in case of evaluation errors the source URL may be provided in \a sourceID as well
+ as the \a lineNumber.
+
+ \a level indicates the severity of the event that triggered the message, that is, whether it
+ was triggered by an error or a less severe event.
+
+ If no handler is specified, the view will log the messages into a \c js
+ \l{QLoggingCategory}{logging category}.
+
+ \sa{Console Logging}
+*/
+
+/*!
+ \qmlsignal WebEngineView::newWindowRequested(WebEngineNewWindowRequest request)
+ \since QtWebEngine 2.0
+
+ This signal is emitted when \a request is issued to load a page in a separate
+ web engine view. This can either be because the current page requested it explicitly
+ through a JavaScript call to \c window.open, or because the user clicked on a link
+ while holding Shift, Ctrl, or a built-in combination that triggers the page to open
+ in a new window.
+
+ The signal is handled by calling acceptAsNewWindow() on the destination view.
+ If this signal is not handled, the requested load will fail.
+
+ An example implementation:
+
+ \snippet qtwebengine_webengineview_newviewrequested.qml 0
+
+ \sa WebEngineNewWindowRequest, {WebEngine Quick Nano Browser}
+*/
+
+/*!
+ \qmlmethod void WebEngineView::acceptAsNewWindow(QWebEngineNewWindowRequest *request)
+ \since QtWebEngine 2.0
+
+ Handle the newWindowRequested signal by opening the \a request in this view.
+
+ \sa newWindowRequested
+*/
+
+/*!
+ \qmlsignal WebEngineView::fullScreenRequested(FullScreenRequest request)
+ \since QtWebEngine 1.1
+
+ This signal is emitted when the web page issues the \a request for
+ fullscreen mode through the JavaScript API.
+
+ \sa isFullScreen
+*/
+
+/*!
+ \qmlsignal WebEngineView::activeFocusOnPressChanged(bool activeFocusOnPress)
+ \since QtWebEngine 1.2
+
+ This signal is emitted when the value of \a activeFocusOnPress changes.
+ It specifies whether the view should gain active focus when pressed.
+
+ \sa activeFocusOnPress, setActiveFocusOnPress()
+*/
+
+/*!
+ \qmlsignal WebEngineView::backgroundColorChanged()
+ \since QtWebEngine 1.2
+
+ This signal is emitted when the web engine view background color changes.
+*/
+
+/*!
+ \qmlsignal WebEngineView::renderProcessTerminated(RenderProcessTerminationStatus terminationStatus, int exitCode)
+
+ \since QtWebEngine 1.2
+
+ This signal is emitted when the render process is terminated with a non-zero exit status.
+ \a terminationStatus is the termination status of the process and \a exitCode is the status code
+ with which the process terminated.
+
+ \sa RenderProcessTerminationStatus
+*/
+
+/*!
+ \qmlsignal WebEngineView::windowCloseRequested()
+ \since QtWebEngine 1.2
+
+ This signal is emitted whenever the page requests the web browser window to be closed,
+ for example through the JavaScript \c{window.close()} call.
+*/
+
+/*!
+ \qmlproperty enumeration WebEngineView::ErrorDomain
+
+ Describes various high-level error types:
+
+ \value WebEngineView.NoErrorDomain
+ \value WebEngineView.InternalErrorDomain
+ Content fails to be interpreted by \QWE.
+ \value WebEngineView.ConnectionErrorDomain
+ Error results from faulty network connection.
+ \value WebEngineView.CertificateErrorDomain
+ Error related to the SSL/TLS certificate.
+ \value WebEngineView.HttpErrorDomain
+ Error related to the HTTP connection.
+ \value WebEngineView.FtpErrorDomain
+ Error related to the FTP connection.
+ \value WebEngineView.DnsErrorDomain
+ Error related to the DNS connection.
+*/
+
+/*!
+ \qmlproperty enumeration WebEngineView::JavaScriptConsoleMessageLevel
+
+ Indicates the severity of a JavaScript console message:
+
+ \value WebEngineView.InfoMessageLevel
+ Message is purely informative and can safely be ignored.
+ \value WebEngineView.WarningMessageLevel
+ Message indicates there might be a problem that may need attention.
+ \value WebEngineView.ErrorMessageLevel
+ Message indicates there has been an error.
+*/
+
+/*!
+ \qmlproperty enumeration WebEngineView::LoadStatus
+
+ Reflects a page's load status:
+
+ \value WebEngineView.LoadStartedStatus
+ Page is currently loading.
+ \value WebEngineView.LoadStoppedStatus
+ Loading the page was stopped by the stop() method or by the loader
+ code or network stack in Chromium.
+ \value WebEngineView.LoadSucceededStatus
+ Page has successfully loaded, and is not currently loading.
+ \value WebEngineView.LoadFailedStatus
+ Page has failed to load, and is not currently loading.
+*/
+
+/*!
+ \qmlproperty enumeration WebEngineView::FindFlags
+
+ Describes the options available to the findText() function. The options
+ can be OR-ed together from the following list:
+
+ \value WebEngineView.FindBackward
+ Searches backwards instead of forwards.
+ \value WebEngineView.FindFlags FindCaseSensitively
+ By default findText() works case insensitive. Specifying
+ this option changes the behavior to a case sensitive find operation.
+
+ \sa findText()
+*/
+
+/*!
+ \qmlproperty enumeration WebEngineView::RenderProcessTerminationStatus
+ \since QtWebEngine 1.2
+
+ Describes the status with which the render process terminated:
+
+ \value WebEngineView.NormalTerminationStatus
+ The render process terminated normally.
+ \value WebEngineView.AbnormalTerminationStatus
+ The render process terminated with a non-zero exit status.
+ \value WebEngineView.CrashedTerminationStatus
+ The render process crashed, for example because of a segmentation fault.
+ \value WebEngineView.KilledTerminationStatus
+ The render process was killed, for example by \c SIGKILL or task manager kill.
+*/
+
+/*!
+ \qmlproperty enumeration WebEngineView::WebAction
+ \since QtWebEngine 1.2
+
+ Describes the types of action that can be performed on a web page:
+
+ \value WebEngineView.NoWebAction
+ No action is triggered.
+ \value WebEngineView.Back
+ Navigate back in the history of navigated links.
+ \value WebEngineView.Forward
+ Navigate forward in the history of navigated links.
+ \value WebEngineView.Stop
+ Stop loading the current page.
+ \value WebEngineView.Reload
+ Reload the current page.
+ \value WebEngineView.ReloadAndBypassCache
+ Reload the current page, but do not use any local cache.
+ \value WebEngineView.Cut
+ Cut the content currently selected into the clipboard.
+ \value WebEngineView.Copy
+ Copy the content currently selected into the clipboard.
+ \value WebEngineView.Paste
+ Paste content from the clipboard.
+ \value WebEngineView.Undo
+ Undo the last editing action.
+ \value WebEngineView.Redo
+ Redo the last editing action.
+ \value WebEngineView.SelectAll
+ Select all content.
+ This action is only enabled when the page's content is focused.
+ The focus can be forced by the JavaScript \c{window.focus()} call, or the
+ \l{WebEngineSettings::focusOnNavigationEnabled} {focusOnNavigationEnabled} setting
+ should be enabled to get automatic focus.
+ \value WebEngineView.PasteAndMatchStyle
+ Paste content from the clipboard with current style.
+ \value WebEngineView.OpenLinkInThisWindow
+ Open the current link in the current window. (Added in Qt 5.6)
+ \value WebEngineView.OpenLinkInNewWindow
+ Open the current link in a new window. Requires a handler for the
+ \l newWindowRequested() signal. (Added in Qt 5.6)
+ \value WebEngineView.OpenLinkInNewTab
+ Open the current link in a new tab. Requires a handler for the
+ \l newWindowRequested() signal. (Added in Qt 5.6)
+ \value WebEngineView.CopyLinkToClipboard
+ Copy the current link to the clipboard. (Added in Qt 5.6)
+ \value WebEngineView.CopyImageToClipboard
+ Copy the clicked image to the clipboard. (Added in Qt 5.6)
+ \value WebEngineView.CopyImageUrlToClipboard
+ Copy the clicked image's URL to the clipboard. (Added in Qt 5.6)
+ \value WebEngineView.CopyMediaUrlToClipboard
+ Copy the hovered audio or video's URL to the clipboard. (Added in Qt 5.6)
+ \value WebEngineView.ToggleMediaControls
+ Toggle between showing and hiding the controls for the hovered audio or video element.
+ (Added in Qt 5.6)
+ \value WebEngineView.ToggleMediaLoop
+ Toggle whether the hovered audio or video should loop on completetion or not.
+ (Added in Qt 5.6)
+ \value WebEngineView.ToggleMediaPlayPause
+ Toggle the play/pause state of the hovered audio or video element. (Added in Qt 5.6)
+ \value WebEngineView.ToggleMediaMute
+ Mute or unmute the hovered audio or video element. (Added in Qt 5.6)
+ \value WebEngineView.DownloadLinkToDisk
+ Download the current link to the disk. To implement download
+ actions, connect to the \l {QQuickWebEngineProfile::downloadRequested}
+ {WebEngineProfile.downloadRequested} signal. (Added in Qt 5.6)
+ \value WebEngineView.DownloadImageToDisk
+ Download the highlighted image to the disk. (Added in Qt 5.6)
+ \value WebEngineView.DownloadMediaToDisk
+ Download the hovered audio or video to the disk. (Added in Qt 5.6)
+ \value WebEngineView.InspectElement
+ Trigger any attached Web Inspector to inspect the highlighed element.
+ (Added in Qt 5.6)
+ \value WebEngineView.ExitFullScreen
+ Exit the fullscreen mode. (Added in Qt 5.6)
+ \value WebEngineView.SavePage
+ Save the current web page to disk. (Added in Qt 5.7)
+ \omitvalue WebEngineView.OpenLinkInNewBackgroundTab
+ \value WebEngineView.ViewSource
+ Show the source of the current page in a new tab. Requires a handler for the
+ \l newWindowRequested() signal. (Added in Qt 5.8)
+
+ \value WebEngineView.ToggleBold
+ Toggles boldness for the selection or at the cursor position.
+ Requires \c contenteditable="true". (Added in Qt 5.10)
+ \value WebEngineView.ToggleItalic
+ Toggles italics for the selection or at the cursor position.
+ Requires \c contenteditable="true". (Added in Qt 5.10)
+ \value WebEngineView.ToggleUnderline
+ Toggles underlining of the selection or at the cursor position.
+ Requires \c contenteditable="true". (Added in Qt 5.10)
+ \value WebEngineView.ToggleStrikethrough
+ Toggles striking through the selection or at the cursor position.
+ Requires \c contenteditable="true". (Added in Qt 5.10)
+
+ \value WebEngineView.AlignLeft
+ Aligns the lines containing the selection or the cursor to the left.
+ Requires \c contenteditable="true". (Added in Qt 5.10)
+ \value WebEngineView.AlignCenter
+ Aligns the lines containing the selection or the cursor at the center.
+ Requires \c contenteditable="true". (Added in Qt 5.10)
+ \value WebEngineView.AlignRight
+ Aligns the lines containing the selection or the cursor to the right.
+ Requires \c contenteditable="true". (Added in Qt 5.10)
+ \value WebEngineView.AlignJustified
+ Stretches the lines containing the selection or the cursor so that each
+ line has equal width.
+ Requires \c contenteditable="true". (Added in Qt 5.10)
+ \value WebEngineView.Indent
+ Indents the lines containing the selection or the cursor.
+ Requires \c contenteditable="true". (Added in Qt 5.10)
+ \value WebEngineView.Outdent
+ Outdents the lines containing the selection or the cursor.
+ Requires \c contenteditable="true". (Added in Qt 5.10)
+
+ \value WebEngineView.InsertOrderedList
+ Inserts an ordered list at the current cursor position, deleting the current selection.
+ Requires \c contenteditable="true". (Added in Qt 5.10)
+ \value WebEngineView.InsertUnorderedList
+ Inserts an unordered list at the current cursor position,
+ deleting the current selection.
+ Requires \c contenteditable="true". (Added in Qt 5.10)
+ \value WebEngineView.ChangeTextDirectionLTR
+ Changes text direction to left-to-right in the focused input element. (Added in Qt 6.6)
+ \value WebEngineView.ChangeTextDirectionRTL
+ Changes text direction to right-to-left in the focused input element. (Added in Qt 6.6)
+ \omitvalue WebActionCount
+*/
+
+/*!
+ \qmlproperty enumeration WebEngineView::Feature
+
+ Describes the platform feature access categories that the user may be asked to grant or deny
+ access to:
+
+ \value WebEngineView.Geolocation
+ Location hardware or service.
+ \value WebEngineView.MediaAudioCapture
+ Audio capture devices, such as microphones.
+ \value WebEngineView.MediaVideoCapture
+ Video devices, such as cameras.
+ \value WebEngineView.MediaAudioVideoCapture
+ Both audio and video capture devices.
+ \value WebEngineView.DesktopVideoCapture
+ Video output capture, that is, the capture of the user's display.
+ (Added in Qt 5.10)
+ \value WebEngineView.DesktopAudioVideoCapture
+ Both audio and video output capture. (Added in Qt 5.10)
+ \value WebEngineView.Notifications
+ Web notifications for the end-user.
+ \value WebEngineView.ClipboardReadWrite
+ Read and write access for the clipboard. If both \l{WebEngineSettings::JavascriptCanPaste}
+ {JavascriptCanPaste} and \l{WebEngineSettings::JavascriptCanAccessClipboard}
+ {JavascriptCanAccessClipboard} settings are enabled, this permission will always be granted
+ automatically and no feature requests will be made.
+ (Added in Qt 6.8)
+ \value WebEngineView.LocalFontsAccess
+ Access to the fonts installed on the user's machine. Only available on desktop platforms.
+ (Added in Qt 6.8)
+
+ \sa featurePermissionRequested(), grantFeaturePermission()
+*/
+
+/*!
+ \qmlproperty enumeration WebEngineView::PrintedPageSizeId
+ \since QtWebEngine 1.3
+
+ This enum type lists the available page sizes as defined in the Postscript
+ PPD standard.
+
+ The enumeration values are mapped from and must match QPageSize::PageSizeId. They are also
+ duplicated in QPagedPaintDevice and QPrinter.
+
+ The defined sizes are:
+
+ \value WebEngineView.A0 841 x 1189 mm
+ \value WebEngineView.A1 594 x 841 mm
+ \value WebEngineView.A2 420 x 594 mm
+ \value WebEngineView.A3 297 x 420 mm
+ \value WebEngineView.A4 210 x 297 mm, 8.26 x 11.69 inches
+ \value WebEngineView.A5 148 x 210 mm
+ \value WebEngineView.A6 105 x 148 mm
+ \value WebEngineView.A7 74 x 105 mm
+ \value WebEngineView.A8 52 x 74 mm
+ \value WebEngineView.A9 37 x 52 mm
+ \value WebEngineView.B0 1000 x 1414 mm
+ \value WebEngineView.B1 707 x 1000 mm
+ \value WebEngineView.B2 500 x 707 mm
+ \value WebEngineView.B3 353 x 500 mm
+ \value WebEngineView.B4 250 x 353 mm
+ \value WebEngineView.B5 176 x 250 mm, 6.93 x 9.84 inches
+ \value WebEngineView.B6 125 x 176 mm
+ \value WebEngineView.B7 88 x 125 mm
+ \value WebEngineView.B8 62 x 88 mm
+ \value WebEngineView.B9 44 x 62 mm
+ \value WebEngineView.B10 31 x 44 mm
+ \value WebEngineView.C5E 163 x 229 mm
+ \value WebEngineView.Comm10E 105 x 241 mm, U.S. Common 10 Envelope
+ \value WebEngineView.DLE 110 x 220 mm
+ \value WebEngineView.Executive 7.5 x 10 inches, 190.5 x 254 mm
+ \value WebEngineView.Folio 210 x 330 mm
+ \value WebEngineView.Ledger 431.8 x 279.4 mm
+ \value WebEngineView.Legal 8.5 x 14 inches, 215.9 x 355.6 mm
+ \value WebEngineView.Letter 8.5 x 11 inches, 215.9 x 279.4 mm
+ \value WebEngineView.Tabloid 279.4 x 431.8 mm
+ \value WebEngineView.Custom Unknown, or a user defined size.
+ \value WebEngineView.A10
+ \value WebEngineView.A3Extra
+ \value WebEngineView.A4Extra
+ \value WebEngineView.A4Plus
+ \value WebEngineView.A4Small
+ \value WebEngineView.A5Extra
+ \value WebEngineView.B5Extra
+ \value WebEngineView.JisB0
+ \value WebEngineView.JisB1
+ \value WebEngineView.JisB2
+ \value WebEngineView.JisB3
+ \value WebEngineView.JisB4
+ \value WebEngineView.JisB5
+ \value WebEngineView.JisB6
+ \value WebEngineView.JisB7
+ \value WebEngineView.JisB8
+ \value WebEngineView.JisB9
+ \value WebEngineView.JisB10
+ \value WebEngineView.AnsiA = \c Letter
+ \value WebEngineView.AnsiB = \c Ledger
+ \value WebEngineView.AnsiC
+ \value WebEngineView.AnsiD
+ \value WebEngineView.AnsiE
+ \value WebEngineView.LegalExtra
+ \value WebEngineView.LetterExtra
+ \value WebEngineView.LetterPlus
+ \value WebEngineView.LetterSmall
+ \value WebEngineView.TabloidExtra
+ \value WebEngineView.ArchA
+ \value WebEngineView.ArchB
+ \value WebEngineView.ArchC
+ \value WebEngineView.ArchD
+ \value WebEngineView.ArchE
+ \value WebEngineView.Imperial7x9
+ \value WebEngineView.Imperial8x10
+ \value WebEngineView.Imperial9x11
+ \value WebEngineView.Imperial9x12
+ \value WebEngineView.Imperial10x11
+ \value WebEngineView.Imperial10x13
+ \value WebEngineView.Imperial10x14
+ \value WebEngineView.Imperial12x11
+ \value WebEngineView.Imperial15x11
+ \value WebEngineView.ExecutiveStandard
+ \value WebEngineView.Note
+ \value WebEngineView.Quarto
+ \value WebEngineView.Statement
+ \value WebEngineView.SuperA
+ \value WebEngineView.SuperB
+ \value WebEngineView.Postcard
+ \value WebEngineView.DoublePostcard
+ \value WebEngineView.Prc16K
+ \value WebEngineView.Prc32K
+ \value WebEngineView.Prc32KBig
+ \value WebEngineView.FanFoldUS
+ \value WebEngineView.FanFoldGerman
+ \value WebEngineView.FanFoldGermanLegal
+ \value WebEngineView.EnvelopeB4
+ \value WebEngineView.EnvelopeB5
+ \value WebEngineView.EnvelopeB6
+ \value WebEngineView.EnvelopeC0
+ \value WebEngineView.EnvelopeC1
+ \value WebEngineView.EnvelopeC2
+ \value WebEngineView.EnvelopeC3
+ \value WebEngineView.EnvelopeC4
+ \value WebEngineView.EnvelopeC5 = \c C5E
+ \value WebEngineView.EnvelopeC6
+ \value WebEngineView.EnvelopeC65
+ \value WebEngineView.EnvelopeC7
+ \value WebEngineView.EnvelopeDL = \c DLE
+ \value WebEngineView.Envelope9
+ \value WebEngineView.Envelope10 = \c Comm10E
+ \value WebEngineView.Envelope11
+ \value WebEngineView.Envelope12
+ \value WebEngineView.Envelope14
+ \value WebEngineView.EnvelopeMonarch
+ \value WebEngineView.EnvelopePersonal
+ \value WebEngineView.EnvelopeChou3
+ \value WebEngineView.EnvelopeChou4
+ \value WebEngineView.EnvelopeInvite
+ \value WebEngineView.EnvelopeItalian
+ \value WebEngineView.EnvelopeKaku2
+ \value WebEngineView.EnvelopeKaku3
+ \value WebEngineView.EnvelopePrc1
+ \value WebEngineView.EnvelopePrc2
+ \value WebEngineView.EnvelopePrc3
+ \value WebEngineView.EnvelopePrc4
+ \value WebEngineView.EnvelopePrc5
+ \value WebEngineView.EnvelopePrc6
+ \value WebEngineView.EnvelopePrc7
+ \value WebEngineView.EnvelopePrc8
+ \value WebEngineView.EnvelopePrc9
+ \value WebEngineView.EnvelopePrc10
+ \value WebEngineView.EnvelopeYou4
+ \value WebEngineView.LastPageSize = \c EnvelopeYou4
+
+ \sa WebEngineView::printToPdf()
+*/
+
+/*!
+ \qmlproperty enumeration WebEngineView::PrintedPageOrientation
+ \since QtWebEngine 1.3
+
+ Describes the orientation of a PDF document that gets created from the WebEngineView's contents.
+ The enumeration values are mapped from and must match QPageLayout::Orientation.
+
+ \value WebEngineView.Portrait
+ The document will be created using portrait orientation.
+
+ \value WebEngineView.Landscape
+ The document will be created using landscape orientation.
+
+ \sa WebEngineView::printToPdf()
+*/
+
+/*!
+ \qmlproperty bool WebEngineView::activeFocusOnPress
+ \since QtWebEngine 1.2
+
+ Specifies whether the view should gain active focus when pressed.
+ The default value is \c true.
+*/
+
+/*!
+ \qmlproperty color WebEngineView::backgroundColor
+ \since QtWebEngine 1.2
+
+ Changes the color of the WebEngineView's background, behind the document's
+ body. Can be set to \c "transparent" or to a translucent color to see
+ through the document or to match the web content in a hybrid app to prevent
+ the white flashes that may appear during loading.
+
+ The default value is white.
+*/
+
+/*!
+ \qmlproperty bool WebEngineView::audioMuted
+ \brief The state of whether the current page audio is muted.
+ \since QtWebEngine 1.3
+ \sa recentlyAudible
+*/
+
+/*!
+ \qmlsignal WebEngineView::audioMutedChanged(bool muted)
+ \since QtWebEngine 1.3
+
+ This signal is emitted when the value of \a muted changes. The value is
+ specified using the \l audioMuted property.
+ \note Not to be confused with a specific HTML5 audio / video element being muted.
+
+ \sa audioMuted, recentlyAudibleChanged
+*/
+
+/*!
+ \qmlproperty bool WebEngineView::recentlyAudible
+ \brief Returns the current page's audible state (audio was recently played, or not).
+ \since QtWebEngine 1.3
+ \readonly
+ \sa audioMuted, recentlyAudibleChanged
+*/
+
+/*!
+ \qmlsignal WebEngineView::recentlyAudibleChanged(bool recentlyAudible)
+ \since QtWebEngine 1.3
+
+ This signal is emitted when the page's audible state, specified by
+ \a recentlyAudible, is changed, due to audio being played or stopped.
+
+ \note The signal is also emitted when the \l audioMuted property changes.
+ Also if the audio is paused, this signal is emitted with an approximate \b{two-second
+ delay}, from the moment the audio is paused.
+
+ If a web page contains two videos that are started in sequence, this signal
+ gets emitted only once, for the first video to generate sound. After both
+ videos are stopped, the signal is emitted upon the last sound generated.
+ This means that the signal is emitted both when any kind of sound is
+ generated and when everything is completely silent within a web page,
+ regardless of the number of audio streams.
+
+ Spurious signal emissions might also happen. For example, when sound is
+ stopped, this signal gets emitted first with a value of \c true, and then
+ with a value of \c false. Further, when audio starts playing, the signal is
+ emitted twice with a value of \c true.
+
+ \sa recentlyAudible
+*/
+
+/*!
+ \qmlsignal WebEngineView::pdfPrintingFinished(string filePath, bool success)
+ \since QtWebEngine 1.5
+
+ This signal is emitted when printing the web page into a PDF file has
+ finished.
+ \a filePath will contain the path the file was requested to be created
+ at, and \a success will be \c true if the file was successfully created and
+ \c false otherwise.
+
+ \sa printToPdf()
+*/
+
+/*!
+ \qmlmethod void WebEngineView::printToPdf(const string filePath, PrintedPageSizeId pageSizeId, PrintedPageOrientation orientation)
+ \since QtWebEngine 1.3
+
+ Prints the WebEngineView's current content to a PDF document and stores it
+ under \a filePath. The document's size will be determined by the value of
+ \a pageSizeId and its orientation will be determined using \a orientation.
+
+ This method issues an asynchronous request for printing the web page into a
+ PDF and returns immediately. To be informed about the result of the
+ request, connect to the signal pdfPrintingFinished().
+
+ If you leave out \a pageSizeId, it defaults to \c A4. If you leave out
+ \a orientation, it defaults to \c Portrait.
+
+ \sa pdfPrintingFinished()
+*/
+
+/*!
+ \qmlmethod void WebEngineView::printToPdf(variant resultCallback, PrintedPageSizeId pageSizeId, PrintedPageOrientation orientation)
+ \since QtWebEngine 1.3
+
+ Prints the WebEngineView's current content to a PDF document and returns it in a byte array. The document's size will be determined
+ by the value of \a pageSizeId and its orientation will be determined using \a orientation.
+
+ The \a resultCallback must take a string parameter. This string will contain the document's data upon successful printing and an empty
+ string otherwise.
+
+ If you leave out \a pageSizeId, it defaults to \c A4. If you leave out
+ \a orientation, it defaults to \c Portrait.
+*/
+
+/*!
+ \qmlmethod void WebEngineView::replaceMisspelledWord(const QString &replacement)
+ \since QtWebEngine 1.3
+
+ Replace the current misspelled word with \a replacement.
+*/
+
+/*!
+ \qmlsignal WebEngineView::wasRecentlyAudibleChanged(bool wasRecentlyAudible)
+ \since QtWebEngine 1.3
+
+ This signal is emitted when the page's audible state, specified by
+ \a wasRecentlyAudible, is changed, due to audio being played or stopped.
+
+ \note The signal is also emitted when calling the setAudioMuted method.
+*/
+
+/*!
+ \qmlsignal WebEngineView::authenticationDialogRequested(AuthenticationDialogRequest request)
+ \since QtWebEngine 1.4
+
+ This signal is emitted when an authentication dialog is requested.
+
+ The \a request can be handled by using the methods of the AuthenticationDialogRequest
+ type.
+
+ \note Signal handlers need to call \c{request.accepted = true} to prevent a
+ default dialog from showing up. Make sure to call either
+ AuthenticationDialogRequest::dialogAccept() or AuthenticationDialogRequest::dialogReject()
+ afterwards.
+*/
+
+/*!
+ \qmlsignal WebEngineView::javaScriptDialogRequested(JavaScriptDialogRequest request)
+ \since QtWebEngine 1.4
+
+ This signal is emitted when a JavaScript dialog is requested.
+
+ The \a request can be handled by using the methods of the JavaScriptDialogRequest
+ type.
+
+ \note Signal handlers need to call \c{request.accepted = true} to prevent a
+ default dialog from showing up. Make sure to call either
+ JavaScriptDialogRequest::dialogAccept() or JavaScriptDialogRequest::dialogReject()
+ afterwards.
+*/
+
+/*!
+ \qmlsignal WebEngineView::colorDialogRequested(ColorDialogRequest request)
+ \since QtWebEngine 1.4
+
+ This signal is emitted when a color picker dialog is requested.
+
+ The \a request can be handled by using the methods of the ColorDialogRequest
+ type.
+
+ \note Signal handlers need to call \c{request.accepted = true} to prevent a
+ default dialog from showing up. Make sure to call either
+ ColorDialogRequest::dialogAccept() or ColorDialogRequest::dialogReject() afterwards.
+*/
+
+/*!
+ \qmlsignal WebEngineView::fileDialogRequested(FileDialogRequest request)
+ \since QtWebEngine 1.4
+
+ This signal is emitted when a file picker dialog is requested.
+
+ The \a request can be handled by using the methods of the FileDialogRequest
+ type.
+
+ \note Signal handlers need to call \c{request.accepted = true} to prevent a
+ default dialog from showing up. Make sure to call either FileDialogRequest::dialogAccept()
+ or FileDialogRequest::dialogReject() afterwards.
+*/
+
+/*!
+ \qmlsignal WebEngineView::contextMenuRequested(ContextMenuRequest request)
+ \since QtWebEngine 1.4
+
+ This signal is emitted when a context menu is requested.
+
+ The \a request can be handled by using the properties of the ContextMenuRequest
+ type.
+
+ \note Signal handlers need to call \c{request.accepted = true} to prevent a
+ default context menu from showing up.
+*/
+
+/*! \qmlsignal WebEngineView::navigationRequested(WebEngineNavigationRequest request)
+ This signal is emitted when the navigation request \a request is issued.
+*/
+
+/*!
+ \qmlsignal WebEngineView::quotaRequested(QuotaRequest request)
+ \since QtWebEngine 1.7
+ \deprecated [6.5] This signal is no longer emitted.
+
+ Requesting host quota is no longer supported by Chromium.
+ The behavior of navigator.webkitPersistentStorage
+ is identical to navigator.webkitTemporaryStorage.
+
+ For further details, see https://crbug.com/1233525
+
+ \sa QuotaRequest
+*/
+
+/*!
+ \qmlsignal WebEngineView::registerProtocolHandlerRequested(RegisterProtocolHandlerRequest request)
+ \since QtWebEngine 1.7
+
+ This signal is emitted when the web page tries to register a custom protocol
+ by issuing a \l registerProtocolHandler \a request.
+
+ \sa RegisterProtocolHandlerRequest
+*/
+
+/*!
+ \qmlsignal WebEngineView::geometryChangeRequested(rect geometry, rect frameGeometry)
+ \since QtWebEngine 1.7
+
+ This signal is emitted whenever the document wants to change the position and size of the
+ page to \a frameGeometry. This can happen for example through JavaScript.
+
+ While \a frameGeometry includes, \a geometry excludes the size of frame margins.
+
+ \note Geometry related properties of QML Window expect a size excluding the window
+ decoration. You have to use \a geometry to handle this signal correctly.
+
+ \qml
+ onGeometryChangeRequested: {
+ window.x = geometry.x
+ window.y = geometry.y
+ window.width = geometry.width
+ window.height = geometry.height
+ }
+ \endqml
+*/
+
+/*!
+ \qmlproperty WebEngineView WebEngineView::inspectedView
+ \since QtWebEngine 1.7
+
+ The view this view is currently inspecting, if any. Setting it
+ will navigate to an internal URL with the developer tools of
+ the view set.
+
+ It is recommended to unset this property when developer tools
+ are not visible; otherwise some debug information may appear
+ in the inspected WebEngineView.
+
+ \sa devToolsView
+*/
+
+/*!
+ \qmlproperty WebEngineView WebEngineView::devToolsView
+ \since QtWebEngine 1.7
+
+ The view currently hosting the developer tools for this view.
+ Setting it to a new view will navigate that view to an internal
+ URL with the developer tools, and bind it to this view.
+
+ \sa inspectedView
+*/
+
+/*!
+ \qmlproperty WebEngineView WebEngineView::devToolsId
+ \since QtWebEngine 6.6
+ \readonly
+
+ The id of the developer tools host associated with this page.
+
+ If remote debugging is enabled (see \l{Qt WebEngine Developer Tools}), the id can be used to
+ build the URL to connect to the developer tool websocket:
+ \c{ws://localhost:<debugggin-port>/devtools/page/<id>)}. The websocket can be used to to interact
+ with the page using the \l{https://chromedevtools.github.io/devtools-protocol/}{DevTools
+ Protocol}.
+*/
+
+/*!
+ \qmlmethod WebEngineAction WebEngineView::action(WebAction action)
+ \since 5.12
+
+ Returns a \l WebEngineAction for the specified \l WebAction \a action.
+ WebEngineView also takes care of implementing the action,
+ so that upon triggering the corresponding action is performed on the view.
+
+ \code
+ var copyAction = webEngineView.action(WebEngineView.Copy);
+ \endcode
+
+ \sa WebEngineAction
+*/
+
+/*!
+ \qmlsignal WebEngineView::printRequested
+ \since QtWebEngine 1.8
+
+ This signal is emitted when the JavaScript \c{window.print()} method is called or the user pressed the print
+ button of PDF viewer plugin.
+ Typically, the signal handler can simply call printToPdf().
+
+ \sa printToPdf
+*/
+
+/*!
+ \qmlsignal WebEngineView::selectClientCertificate(WebEngineClientCertificateSelection clientCertificateSelection)
+ \since QtWebEngine 1.9
+
+ This signal is emitted when a web site requests an SSL client certificate, and one or more were
+ found in the system's client certificate store.
+
+ Handling the signal is asynchronous, and loading will be waiting until a certificate is selected,
+ or the last copy of \a clientCertificateSelection is destroyed.
+
+ If the signal is not handled, \a clientCertificateSelection is automatically destroyed, and loading
+ will continue without a client certificate.
+
+ \sa WebEngineClientCertificateSelection
+*/
+
+/*!
+ \qmlsignal WebEngineView::tooltipRequested(TooltipRequest request)
+ \since QtWebEngine 1.10
+
+ This signal is emitted when the web page sends a \a request to show a tooltip at
+ a specified position.
+
+ \note Signal handlers need to call \c{request.accepted = true} to prevent a default tooltip from showing up.
+
+ \sa TooltipRequest
+*/
+
+/*!
+ \qmlproperty enumeration WebEngineView::LifecycleState
+ \since QtWebEngine 1.10
+
+ This enum describes the lifecycle state of the page:
+
+ \value WebEngineView.LifecycleState.Active
+ Normal state.
+ \value WebEngineView.LifecycleState.Frozen
+ Low CPU usage state where most HTML task sources are suspended.
+ \value WebEngineView.LifecycleState.Discarded
+ Very low resource usage state where the entire browsing context is discarded.
+
+ \sa lifecycleState, {Page Lifecycle API}, {WebEngine Lifecycle Example}
+*/
+
+/*!
+ \qmlproperty LifecycleState WebEngineView::lifecycleState
+ \since QtWebEngine 1.10
+
+ \brief The current lifecycle state of the page.
+
+ The following restrictions are enforced by the setter:
+
+ \list
+ \li A visible page must remain in the \c{Active} state.
+ \li If the page is being inspected by a \l{devToolsView} then both pages must
+ remain in the \c{Active} states.
+ \li A page in the \c{Discarded} state can only transition to the \c{Active}
+ state. This will cause a reload of the page.
+ \endlist
+
+ These are the only hard limits on the lifecycle state, but see also
+ \l{recommendedState} for the recommended soft limits.
+
+ \sa recommendedState, {Page Lifecycle API}, {WebEngine Lifecycle Example}
+*/
+
+/*!
+ \qmlproperty LifecycleState WebEngineView::recommendedState
+ \since QtWebEngine 1.10
+
+ \brief The recommended limit for the lifecycle state of the page.
+
+ Setting the lifecycle state to a lower resource usage state than the
+ recommended state may cause side-effects such as stopping background audio
+ playback or loss of HTML form input. Setting the lifecycle state to a higher
+ resource state is however completely safe.
+
+ \sa lifecycleState, {Page Lifecycle API}, {WebEngine Lifecycle Example}
+*/
+
+/*!
+ \qmltype FindTextResult
+ \instantiates QWebEngineFindTextResult
+ \inqmlmodule QtWebEngine
+ \since QtWebEngine 1.10
+
+ \brief A utility type for encapsulating the result of a string search on a page.
+
+ \sa WebEngineView::findTextFinished()
+*/
+
+/*!
+ \qmlproperty int FindTextResult::numberOfMatches
+ \readonly
+
+ \brief The number of matches found.
+*/
+
+/*!
+ \qmlproperty int FindTextResult::activeMatch
+ \readonly
+
+ \brief The index of the currently highlighted match.
+*/
+
+/*!
+ \qmlsignal WebEngineView::findTextFinished(FindTextResult result)
+ \since QtWebEngine 1.10
+
+ This signal is emitted when a string search on a page is completed. \a result is
+ the result of the string search.
+
+ \sa findText(), FindTextResult
+*/
+
+/*!
+ \qmlproperty qint64 WebEngineView::renderProcessPid
+ \brief Returns the process ID (PID) of the render process assigned to the
+ current page's main frame.
+ \since QtWebEngine 1.11
+ \readonly
+
+ If no render process is available yet, \c 0 is returned.
+
+ \sa renderProcessPidChanged
+*/
+/*!
+ \qmlsignal WebEngineView::renderProcessPidChanged(qint64 pid)
+ \since QtWebEngine 1.11
+ \readonly
+
+ If no render process is available yet, \c 0 is returned.
+ This signal is emitted when \a pid (process ID) of the page's underlying
+ render process changed.
+
+ \sa renderProcessPid
+*/
+
+/*!
+ \qmlsignal WebEngineView::touchSelectionMenuRequested(TouchSelectionMenuRequest *request)
+ \since QtWebEngine 6.3
+ \readonly
+
+ This signal is emitted when a touch selection menu is requested at a specified position.
+
+ The \a request can be handled by using the methods of the TouchSelectionMenuRequest
+ type.
+
+ \note Signal handlers need to call \c{request.accepted = true} to prevent a default touch
+ selection menu from showing up.
+
+ \sa TouchSelectionMenuRequest
+*/
+
+/*!
+ \qmlproperty Component WebEngineView::touchHandleDelegate
+ \since QtWebEngine 6.4
+
+ The \a touchHandleDelegate provides a template defining visual touch handles instantiated by the view
+ whenever touch selection handling is required.
+
+ The handle's position, opacity, and visibility are updated automatically.
+ The delegate should be a QML Item or any QML type which inherits it.
+
+ \note If no QML Item is set, the default touch handles will be shown.
+
+ The following code uses a custom touch handle delegate:
+
+ \code
+ WebEngineView {
+ // ...
+ touchHandleDelegate: Rectangle {
+ color: "red"
+ }
+ // ...
+ }
+ \endcode
+
+ The touch handles can be also switched dynamically:
+
+ \code
+ Component {
+ id: circleTouchHandle
+ Rectangle {
+ color: "blue"
+ radius: 50
+ }
+ }
+ function showDefaultHandle(isDefault) {
+ if (isDefault)
+ webEngineView.touchHandleDelegate = circleTouchHandle
+ else
+ webEngineView.touchHandleDelegate = null
+ }
+ \endcode
+
+ \note If no delegate is provided, Chromium's default touch handles will appear.
+
+*/
+
+/*!
+ \qmlmethod void WebEngineView::save(const QString &filePath, QWebEngineDownloadRequest::SavePageFormat format)
+ \since QtWebEngine 6.6
+
+ Save the current web page to disk.
+
+ The web page is saved to \a filePath in the specified \a{format}.
+
+ This is a shortcut for the following actions:
+ \list
+ \li Trigger the Save web action.
+ \li Accept the next download item and set the specified file path and save format.
+ \endlist
+
+ This function issues an asynchronous download request for the web page and returns immediately.
+
+ \sa QWebEngineDownloadRequest::SavePageFormat
+*/
+
+/*!
+ \qmlsignal WebEngineView::webAuthUxRequested(QWebEngineWebAuthUxRequest *request);
+ \since QtWebEngine 6.7
+
+ This signal is emitted when a WebAuth authenticator requires user interaction
+ during the authentication process. These requests are handled by displaying a dialog to the user.
+
+ The \a request contains the information and API required to complete the WebAuth UX request.
+
+ \sa QWebEngineWebAuthUxRequest
+*/
+
+ \sa {WebEngine Qt Quick Custom Touch Handle Example}
+*/
diff --git a/src/webenginequick/plugin.cpp b/src/webenginequick/plugin.cpp
new file mode 100644
index 000000000..e06596b44
--- /dev/null
+++ b/src/webenginequick/plugin.cpp
@@ -0,0 +1,40 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include <QtQml/qqmlextensionplugin.h>
+#include <QtWebEngineQuick/QQuickWebEngineProfile>
+
+#include <QtWebEngineQuick/private/qquickwebenginefaviconprovider_p_p.h>
+#include <QtWebEngineQuick/private/qquickwebenginetouchhandleprovider_p_p.h>
+
+#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0)
+QT_BEGIN_NAMESPACE
+void Q_WEBENGINEQUICK_EXPORT qml_register_types_QtWebEngine();
+QT_END_NAMESPACE
+#else
+void Q_WEBENGINEQUICK_EXPORT qml_register_types_QtWebEngine();
+#endif
+
+QT_BEGIN_NAMESPACE
+
+class QtWebEnginePlugin : public QQmlExtensionPlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
+public:
+ void initializeEngine(QQmlEngine *engine, const char *uri) override
+ {
+ Q_UNUSED(uri);
+ engine->addImageProvider(QQuickWebEngineFaviconProvider::identifier(), new QQuickWebEngineFaviconProvider);
+ engine->addImageProvider(QQuickWebEngineTouchHandleProvider::identifier(), new QQuickWebEngineTouchHandleProvider);
+ }
+ void registerTypes(const char *uri) override {
+ volatile auto registration = &qml_register_types_QtWebEngine;
+ Q_UNUSED(registration);
+ Q_UNUSED(uri);
+ };
+};
+
+QT_END_NAMESPACE
+
+#include "plugin.moc"
diff --git a/src/webenginequick/qquickwebengine_accessible.cpp b/src/webenginequick/qquickwebengine_accessible.cpp
new file mode 100644
index 000000000..2941f01b5
--- /dev/null
+++ b/src/webenginequick/qquickwebengine_accessible.cpp
@@ -0,0 +1,147 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qquickwebengine_accessible.h"
+
+#include <QQuickItem>
+#include <QQuickWindow>
+
+#include "api/qquickwebengineview_p.h"
+#include "api/qquickwebengineview_p_p.h"
+#include "web_contents_adapter.h"
+
+QT_BEGIN_NAMESPACE
+QQuickWebEngineViewAccessible::QQuickWebEngineViewAccessible(QQuickWebEngineView *o)
+ : QAccessibleObject(o)
+{}
+
+bool QQuickWebEngineViewAccessible::isValid() const
+{
+ if (!QAccessibleObject::isValid())
+ return false;
+
+ if (!engineView() || !engineView()->d_func())
+ return false;
+
+ return true;
+}
+
+QAccessibleInterface *QQuickWebEngineViewAccessible::parent() const
+{
+ QQuickItem *parent = engineView()->parentItem();
+ QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(parent);
+ if (!iface)
+ return QAccessible::queryAccessibleInterface(engineView()->window());
+ return iface;
+}
+
+QAccessibleInterface *QQuickWebEngineViewAccessible::focusChild() const
+{
+ if (child(0) && child(0)->focusChild())
+ return child(0)->focusChild();
+ return const_cast<QQuickWebEngineViewAccessible *>(this);
+}
+
+int QQuickWebEngineViewAccessible::childCount() const
+{
+ return child(0) ? 1 : 0;
+}
+
+QAccessibleInterface *QQuickWebEngineViewAccessible::child(int index) const
+{
+ if (index == 0 && isValid())
+ return engineView()->d_func()->adapter->browserAccessible();
+ return nullptr;
+}
+
+int QQuickWebEngineViewAccessible::indexOfChild(const QAccessibleInterface *c) const
+{
+ if (child(0) && c == child(0))
+ return 0;
+ return -1;
+}
+
+QString QQuickWebEngineViewAccessible::text(QAccessible::Text) const
+{
+ return QString();
+}
+
+QAccessible::Role QQuickWebEngineViewAccessible::role() const
+{
+ return QAccessible::Client;
+}
+
+QAccessible::State QQuickWebEngineViewAccessible::state() const
+{
+ QAccessible::State s;
+ return s;
+}
+
+QQuickWebEngineView *QQuickWebEngineViewAccessible::engineView() const
+{
+ return static_cast<QQuickWebEngineView*>(object());
+}
+
+QT_END_NAMESPACE
+
+namespace QtWebEngineCore {
+
+RenderWidgetHostViewQtDelegateQuickAccessible::RenderWidgetHostViewQtDelegateQuickAccessible(QObject *o, QQuickWebEngineView *view)
+ : QAccessibleObject(o)
+ , m_view(view)
+{
+}
+
+bool RenderWidgetHostViewQtDelegateQuickAccessible::isValid() const
+{
+ if (!viewAccessible() || !viewAccessible()->isValid())
+ return false;
+
+ return QAccessibleObject::isValid();
+}
+
+QAccessibleInterface *RenderWidgetHostViewQtDelegateQuickAccessible::parent() const
+{
+ return viewAccessible()->parent();
+}
+
+QString RenderWidgetHostViewQtDelegateQuickAccessible::text(QAccessible::Text) const
+{
+ return QString();
+}
+
+QAccessible::Role RenderWidgetHostViewQtDelegateQuickAccessible::role() const
+{
+ return QAccessible::Client;
+}
+
+QAccessible::State RenderWidgetHostViewQtDelegateQuickAccessible::state() const
+{
+ return viewAccessible()->state();
+}
+
+QAccessibleInterface *RenderWidgetHostViewQtDelegateQuickAccessible::focusChild() const
+{
+ return viewAccessible()->focusChild();
+}
+
+int RenderWidgetHostViewQtDelegateQuickAccessible::childCount() const
+{
+ return viewAccessible()->childCount();
+}
+
+QAccessibleInterface *RenderWidgetHostViewQtDelegateQuickAccessible::child(int index) const
+{
+ return viewAccessible()->child(index);
+}
+
+int RenderWidgetHostViewQtDelegateQuickAccessible::indexOfChild(const QAccessibleInterface *c) const
+{
+ return viewAccessible()->indexOfChild(c);
+}
+
+QQuickWebEngineViewAccessible *RenderWidgetHostViewQtDelegateQuickAccessible::viewAccessible() const
+{
+ return static_cast<QQuickWebEngineViewAccessible *>(QAccessible::queryAccessibleInterface(m_view));
+}
+} // namespace QtWebEngineCore
diff --git a/src/webenginequick/qquickwebengine_accessible.h b/src/webenginequick/qquickwebengine_accessible.h
new file mode 100644
index 000000000..479de9789
--- /dev/null
+++ b/src/webenginequick/qquickwebengine_accessible.h
@@ -0,0 +1,56 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QQUICKWEBENGINE_ACCESSIBLE_H
+#define QQUICKWEBENGINE_ACCESSIBLE_H
+
+#include <QtCore/qpointer.h>
+#include <QtGui/qaccessibleobject.h>
+
+QT_BEGIN_NAMESPACE
+class QQuickWebEngineView;
+
+class QQuickWebEngineViewAccessible : public QAccessibleObject
+{
+public:
+ QQuickWebEngineViewAccessible(QQuickWebEngineView *o);
+ bool isValid() const override;
+ QAccessibleInterface *parent() const override;
+ QAccessibleInterface *focusChild() const override;
+ int childCount() const override;
+ QAccessibleInterface *child(int index) const override;
+ int indexOfChild(const QAccessibleInterface *) const override;
+ QString text(QAccessible::Text) const override;
+ QAccessible::Role role() const override;
+ QAccessible::State state() const override;
+
+private:
+ QQuickWebEngineView *engineView() const;
+};
+
+QT_END_NAMESPACE
+
+namespace QtWebEngineCore {
+class RenderWidgetHostViewQtDelegateQuickAccessible : public QAccessibleObject
+{
+public:
+ RenderWidgetHostViewQtDelegateQuickAccessible(QObject *o, QQuickWebEngineView *view);
+
+ bool isValid() const override;
+ QAccessibleInterface *parent() const override;
+ QString text(QAccessible::Text t) const override;
+ QAccessible::Role role() const override;
+ QAccessible::State state() const override;
+
+ QAccessibleInterface *focusChild() const override;
+ int childCount() const override;
+ QAccessibleInterface *child(int index) const override;
+ int indexOfChild(const QAccessibleInterface *) const override;
+
+private:
+ QQuickWebEngineViewAccessible *viewAccessible() const;
+ QPointer<QQuickWebEngineView> m_view;
+};
+} // namespace QtWebEngineCore
+
+#endif // QQUICKWEBENGINE_ACCESSIBLE_H
diff --git a/src/webenginequick/render_widget_host_view_qt_delegate_quickwindow.cpp b/src/webenginequick/render_widget_host_view_qt_delegate_quickwindow.cpp
new file mode 100644
index 000000000..b003dabe4
--- /dev/null
+++ b/src/webenginequick/render_widget_host_view_qt_delegate_quickwindow.cpp
@@ -0,0 +1,132 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "render_widget_host_view_qt_delegate_quickwindow.h"
+
+#include "api/qquickwebengineview_p_p.h"
+
+namespace QtWebEngineCore {
+
+static inline QPoint getOffset(QQuickItem *item)
+{
+ // get parent window (scene) offset
+ QPointF offset = item->mapFromScene(QPoint(0, 0));
+ offset = item->mapToGlobal(offset);
+ // get local offset
+ offset -= item->mapToScene(QPoint(0, 0));
+ return offset.toPoint();
+}
+
+static inline QPointF transformPoint(const QPointF &point, const QTransform &transform,
+ const QPointF &offset, const QQuickItem *parent)
+{
+ // make scene vector
+ QPointF a = point - offset;
+ // apply local transformation
+ a = transform.map(a);
+ // make screen coordinates
+ a = parent->mapFromScene(a);
+ a = parent->mapToGlobal(a);
+ return a;
+}
+
+RenderWidgetHostViewQtDelegateQuickWindow::RenderWidgetHostViewQtDelegateQuickWindow(
+ RenderWidgetHostViewQtDelegateItem *realDelegate, QWindow *parent)
+ : QQuickWindow(parent), m_realDelegate(realDelegate), m_virtualParent(nullptr), m_rotated(false)
+{
+ setFlags(Qt::Tool | Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::WindowDoesNotAcceptFocus);
+ realDelegate->setParentItem(contentItem());
+}
+
+RenderWidgetHostViewQtDelegateQuickWindow::~RenderWidgetHostViewQtDelegateQuickWindow()
+{
+ if (m_realDelegate) {
+ m_realDelegate->setWidgetDelegate(nullptr);
+ m_realDelegate->setParentItem(nullptr);
+ }
+}
+
+void RenderWidgetHostViewQtDelegateQuickWindow::setVirtualParent(QQuickItem *virtualParent)
+{
+ Q_ASSERT(virtualParent);
+ m_virtualParent = virtualParent;
+}
+
+// rect is window geometry in form of parent window offset + offset in scene coordinates
+// chromium knows nothing about local transformation
+void RenderWidgetHostViewQtDelegateQuickWindow::InitAsPopup(const QRect &rect)
+{
+ m_rotated = m_virtualParent->rotation() > 0 || m_virtualParent->parentItem()->rotation() > 0;
+ if (m_rotated) {
+ // code below tries to cover the case where webengine view is rotated,
+ // the code assumes the rotation is in the form of 90, 180, 270 degrees
+ // to archive that we keep chromium unaware of transformation and we transform
+ // just the window content.
+ m_rect = rect;
+ // get parent window (scene) offset
+ QPointF offset = m_virtualParent->mapFromScene(QPoint(0, 0));
+ offset = m_virtualParent->mapToGlobal(offset);
+ // get local transform
+ QTransform transform = m_virtualParent->itemTransform(nullptr, nullptr);
+ QPointF tl = transformPoint(rect.topLeft(), transform, offset, m_virtualParent);
+ QPointF br = transformPoint(rect.bottomRight(), transform, offset, m_virtualParent);
+ QRectF popupRect(tl, br);
+ popupRect = popupRect.normalized();
+ // include offset from parent window
+ popupRect.moveTo(popupRect.topLeft() - offset);
+ setGeometry(popupRect.adjusted(0, 0, 1, 1).toRect());
+ // add offset since screenRect and transformed popupRect one are different and
+ // we want to rotate in center.
+ m_realDelegate->setX(-rect.width() / 2.0 + geometry().width() / 2.0);
+ m_realDelegate->setY(-rect.height() / 2.0 + geometry().height() / 2.0);
+ m_realDelegate->setTransformOrigin(QQuickItem::Center);
+ m_realDelegate->setRotation(m_virtualParent->parentItem()->rotation());
+ } else {
+ QRect geometry(rect);
+ geometry.moveTo(rect.topLeft() - getOffset(m_virtualParent));
+ setGeometry(geometry);
+ }
+ m_realDelegate->show();
+ raise();
+ show();
+}
+
+void RenderWidgetHostViewQtDelegateQuickWindow::Resize(int width, int height)
+{
+ if (!m_rotated)
+ QQuickWindow::resize(width, height);
+}
+
+void RenderWidgetHostViewQtDelegateQuickWindow::MoveWindow(const QPoint &screenPos)
+{
+ if (!m_rotated)
+ QQuickWindow::setPosition(screenPos - getOffset(m_virtualParent));
+}
+
+void RenderWidgetHostViewQtDelegateQuickWindow::SetClearColor(const QColor &color)
+{
+ QQuickWindow::setColor(color);
+}
+
+bool RenderWidgetHostViewQtDelegateQuickWindow::ActiveFocusOnPress()
+{
+ return false;
+}
+
+void RenderWidgetHostViewQtDelegateQuickWindow::Bind(QtWebEngineCore::WebContentsAdapterClient *client)
+{
+ QQuickWebEngineViewPrivate::bindViewAndDelegateItem(
+ static_cast<QQuickWebEngineViewPrivate *>(client), m_realDelegate.data());
+}
+
+void RenderWidgetHostViewQtDelegateQuickWindow::Unbind()
+{
+ QQuickWebEngineViewPrivate::bindViewAndDelegateItem(nullptr, m_realDelegate.data());
+}
+
+void RenderWidgetHostViewQtDelegateQuickWindow::Destroy()
+{
+ deleteLater();
+}
+
+} // namespace QtWebEngineCore
diff --git a/src/webenginequick/render_widget_host_view_qt_delegate_quickwindow.h b/src/webenginequick/render_widget_host_view_qt_delegate_quickwindow.h
new file mode 100644
index 000000000..712eef732
--- /dev/null
+++ b/src/webenginequick/render_widget_host_view_qt_delegate_quickwindow.h
@@ -0,0 +1,46 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef RENDER_WIDGET_HOST_VIEW_QT_DELEGATE_QUICKWINDOW_H
+#define RENDER_WIDGET_HOST_VIEW_QT_DELEGATE_QUICKWINDOW_H
+
+#include "render_widget_host_view_qt_delegate.h"
+#include "render_widget_host_view_qt_delegate_item.h"
+
+#include <QtCore/qpointer.h>
+#include <QtQuick/qquickwindow.h>
+
+// silence syncqt
+QT_BEGIN_NAMESPACE
+QT_END_NAMESPACE
+
+namespace QtWebEngineCore {
+
+class RenderWidgetHostViewQtDelegateQuickWindow : public QQuickWindow , public WidgetDelegate {
+
+public:
+ RenderWidgetHostViewQtDelegateQuickWindow(RenderWidgetHostViewQtDelegateItem *realDelegate,
+ QWindow *parent);
+ ~RenderWidgetHostViewQtDelegateQuickWindow();
+
+ void InitAsPopup(const QRect &screenRect) override;
+ void SetClearColor(const QColor &) override;
+ bool ActiveFocusOnPress() override;
+ void MoveWindow(const QPoint &) override;
+ void Bind(WebContentsAdapterClient *) override;
+ void Unbind() override;
+ void Destroy() override;
+ void Resize(int width, int height) override;
+
+ void setVirtualParent(QQuickItem *virtualParent);
+
+private:
+ QPointer<RenderWidgetHostViewQtDelegateItem> m_realDelegate;
+ QQuickItem *m_virtualParent;
+ QRect m_rect;
+ bool m_rotated;
+};
+
+} // namespace QtWebEngineCore
+
+#endif // RENDER_WIDGET_HOST_VIEW_QT_DELEGATE_QUICKWINDOW_H
diff --git a/src/webenginequick/ui/AlertDialog.qml b/src/webenginequick/ui/AlertDialog.qml
new file mode 100644
index 000000000..e4c17b056
--- /dev/null
+++ b/src/webenginequick/ui/AlertDialog.qml
@@ -0,0 +1,64 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+
+Dialog {
+ property alias text: message.text
+ property bool handled: false
+ signal accepted()
+ signal rejected()
+ title: qsTr("Alert Dialog")
+ modal: false
+ anchors.centerIn: parent
+ objectName: "alertDialog"
+
+ //handle the case where users simply closes the dialog
+ onVisibleChanged: {
+ if (visible == false && handled == false) {
+ handled = true;
+ rejected();
+ } else {
+ handled = false;
+ }
+ }
+
+ function acceptDialog() {
+ accepted();
+ handled = true;
+ close();
+ }
+
+ ColumnLayout {
+ id: rootLayout
+ anchors.fill: parent
+ anchors.margins: 4
+ property int minimumWidth: rootLayout.implicitWidth + rootLayout.doubleMargins
+ property int minimumHeight: rootLayout.implicitHeight + rootLayout.doubleMargins
+ property int doubleMargins: anchors.margins * 2
+ SystemPalette { id: palette; colorGroup: SystemPalette.Active }
+ RowLayout {
+ Layout.alignment: Qt.AlignRight
+ spacing: 8
+ Image {
+ source: "qrc:/qt-project.org/imports/QtWebEngine/ControlsDelegates/information.png"
+ }
+ Label {
+ id: message
+ Layout.fillWidth: true
+ color: palette.windowText
+ textFormat: Text.PlainText
+ }
+ }
+ Item {
+ Layout.fillHeight: true
+ }
+ Button {
+ Layout.alignment: Qt.AlignHCenter
+ text: qsTr("OK")
+ onClicked: acceptDialog()
+ }
+ }
+}
diff --git a/src/webenginequick/ui/AuthenticationDialog.qml b/src/webenginequick/ui/AuthenticationDialog.qml
new file mode 100644
index 000000000..d0611b84f
--- /dev/null
+++ b/src/webenginequick/ui/AuthenticationDialog.qml
@@ -0,0 +1,101 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+
+Dialog {
+ property alias text: message.text
+ property bool handled: false
+ signal accepted(string user, string password)
+ signal rejected()
+ title: qsTr("Authentication Required")
+ modal: false
+ anchors.centerIn: parent
+ objectName: "authenticationDialog"
+
+ //handle the case where users simply closes the dialog
+ onVisibleChanged: {
+ if (visible == false && handled == false) {
+ handled = true;
+ rejected();
+ } else {
+ handled = false;
+ }
+ }
+
+ function acceptDialog() {
+ accepted(userField.text, passwordField.text);
+ handled = true;
+ close();
+ }
+
+ function rejectDialog() {
+ rejected();
+ handled = true;
+ close();
+ }
+
+ ColumnLayout {
+ id: rootLayout
+ anchors.fill: parent
+ anchors.margins: 4
+ property int minimumWidth: rootLayout.implicitWidth + rootLayout.doubleMargins
+ property int minimumHeight: rootLayout.implicitHeight + rootLayout.doubleMargins
+
+ property int doubleMargins: anchors.margins * 2
+
+ SystemPalette { id: palette; colorGroup: SystemPalette.Active }
+ Label {
+ id: message
+ color: palette.windowText
+ textFormat: Text.PlainText
+ }
+ GridLayout {
+ columns: 2
+ Label {
+ text: qsTr("Username:")
+ color: palette.windowText
+ }
+ TextField {
+ id: userField
+ focus: true
+ Layout.fillWidth: true
+ onAccepted: {
+ if (userField.text && passwordField.text)
+ acceptDialog();
+ }
+ }
+ Label {
+ text: qsTr("Password:")
+ color: palette.windowText
+ }
+ TextField {
+ id: passwordField
+ Layout.fillWidth: true
+ echoMode: TextInput.Password
+ onAccepted: {
+ if (userField.text && passwordField.text)
+ acceptDialog();
+ }
+ }
+ }
+ Item {
+ Layout.fillHeight: true
+ }
+ RowLayout {
+ Layout.alignment: Qt.AlignRight
+ spacing: 8
+ Button {
+ id: cancelButton
+ text: qsTr("Cancel")
+ onClicked: rejectDialog()
+ }
+ Button {
+ text: qsTr("Log In")
+ onClicked: acceptDialog()
+ }
+ }
+ }
+}
diff --git a/src/webenginequick/ui/AutofillPopup.qml b/src/webenginequick/ui/AutofillPopup.qml
new file mode 100644
index 000000000..0a14b6233
--- /dev/null
+++ b/src/webenginequick/ui/AutofillPopup.qml
@@ -0,0 +1,41 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+import QtQuick
+import QtQuick.Controls
+
+Popup {
+ id: root
+ // Let Chromium close the popup.
+ closePolicy: Popup.NoAutoClose
+
+ property variant controller: null
+ property int itemHeight: 0
+
+ signal selected(int index)
+ signal accepted()
+
+ function setCurrentIndex(index)
+ {
+ listView.currentIndex = index;
+ }
+
+ ListView {
+ id: listView
+ anchors.fill: parent
+ clip: true
+
+ model: controller.model
+ currentIndex: -1
+
+ delegate: ItemDelegate {
+ width: listView.width
+ height: root.itemHeight
+ text: model.display
+ highlighted: ListView.isCurrentItem
+
+ onHoveredChanged: if (hovered) selected(index);
+ onClicked: accepted();
+ }
+ }
+}
diff --git a/src/webenginequick/ui/CMakeLists.txt b/src/webenginequick/ui/CMakeLists.txt
new file mode 100644
index 000000000..ac960535e
--- /dev/null
+++ b/src/webenginequick/ui/CMakeLists.txt
@@ -0,0 +1,50 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+if (Qt6Quick_VERSION VERSION_GREATER_EQUAL "6.4.0")
+set(colorDialog "ColorDialog.qml")
+else()
+set(colorDialog "custom/ColorDialog.qml")
+endif()
+
+set(qml_files
+ "AlertDialog.qml"
+ "AuthenticationDialog.qml"
+ "AutofillPopup.qml"
+ "ConfirmDialog.qml"
+ "DirectoryPicker.qml"
+ "FilePicker.qml"
+ "Menu.qml"
+ "MenuItem.qml"
+ "MenuSeparator.qml"
+ "PromptDialog.qml"
+ "ToolTip.qml"
+ "TouchHandle.qml"
+ "TouchSelectionMenu.qml"
+ ${colorDialog}
+)
+
+set(resource_files
+ "information.png"
+ "question.png"
+)
+
+qt_internal_add_qml_module(WebEngineQuickDelegatesQml
+ URI "QtWebEngine.ControlsDelegates"
+ VERSION "${PROJECT_VERSION}"
+ QML_FILES ${qml_files}
+ PAST_MAJOR_VERSIONS 1
+ NO_SYNC_QT
+ PLUGIN_TARGET qtwebenginequickdelegatesplugin
+ DEPENDENCIES QtQuickControls2
+ NO_GENERATE_CPP_EXPORTS
+)
+
+qt_internal_add_resource(qtwebenginequickdelegatesplugin "qtwebenginequickdelegatesplugin"
+ PREFIX
+ "/qt-project.org/imports/QtWebEngine/ControlsDelegates"
+ FILES
+ ${resource_files}
+)
+
+
diff --git a/src/webenginequick/ui/ColorDialog.qml b/src/webenginequick/ui/ColorDialog.qml
new file mode 100644
index 000000000..f4d5b817b
--- /dev/null
+++ b/src/webenginequick/ui/ColorDialog.qml
@@ -0,0 +1,13 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+import QtQuick.Dialogs
+
+ColorDialog {
+ id: colorDialog
+ objectName: "colorDialog"
+
+ signal selectedColor(var color)
+
+ onAccepted : selectedColor(selectedColor)
+}
diff --git a/src/webenginequick/ui/ConfirmDialog.qml b/src/webenginequick/ui/ConfirmDialog.qml
new file mode 100644
index 000000000..cfffe7c4d
--- /dev/null
+++ b/src/webenginequick/ui/ConfirmDialog.qml
@@ -0,0 +1,77 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+
+Dialog {
+ property alias text: message.text
+ property bool handled: false
+ signal accepted()
+ signal rejected()
+ title: qsTr("Confirm Dialog")
+ modal: false
+ anchors.centerIn: parent
+ objectName: "confirmDialog"
+
+ //handle the case where users simply closes the dialog
+ onVisibleChanged: {
+ if (visible == false && handled == false) {
+ handled = true;
+ rejected();
+ } else {
+ handled = false;
+ }
+ }
+
+ function acceptDialog() {
+ accepted();
+ handled = true;
+ close();
+ }
+
+ function rejectDialog() {
+ rejected();
+ handled = true;
+ close();
+ }
+
+ ColumnLayout {
+ id: rootLayout
+ anchors.fill: parent
+ anchors.margins: 4
+ property int minimumWidth: rootLayout.implicitWidth + rootLayout.doubleMargins
+ property int minimumHeight: rootLayout.implicitHeight + rootLayout.doubleMargins
+ property int doubleMargins: anchors.margins * 2
+ SystemPalette { id: palette; colorGroup: SystemPalette.Active }
+ RowLayout {
+ Layout.alignment: Qt.AlignRight
+ spacing: 8
+ Image {
+ source: "qrc:/qt-project.org/imports/QtWebEngine/ControlsDelegates/question.png"
+ }
+ Text {
+ id: message
+ Layout.fillWidth: true
+ color: palette.windowText
+ textFormat: Text.PlainText
+ }
+ }
+ Item {
+ Layout.fillHeight: true
+ }
+ RowLayout {
+ Layout.alignment: Qt.AlignRight
+ spacing: 8
+ Button {
+ text: qsTr("OK")
+ onClicked: acceptDialog()
+ }
+ Button {
+ text: qsTr("Cancel")
+ onClicked: rejectDialog()
+ }
+ }
+ }
+}
diff --git a/src/webenginequick/ui/DirectoryPicker.qml b/src/webenginequick/ui/DirectoryPicker.qml
new file mode 100644
index 000000000..a8a6d47c9
--- /dev/null
+++ b/src/webenginequick/ui/DirectoryPicker.qml
@@ -0,0 +1,15 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+import QtQuick.Dialogs
+
+FolderDialog {
+ id: folderDialog
+ objectName: "folderDialog"
+
+ signal folderSelected(var folder)
+
+ onAccepted: {
+ folderSelected([selectedFolder])
+ }
+}
diff --git a/src/webenginequick/ui/FilePicker.qml b/src/webenginequick/ui/FilePicker.qml
new file mode 100644
index 000000000..d82c3bf35
--- /dev/null
+++ b/src/webenginequick/ui/FilePicker.qml
@@ -0,0 +1,15 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+import QtQuick.Dialogs
+
+FileDialog {
+ id: fileDialog
+ objectName: "fileDialog"
+
+ signal filesSelected(var fileList)
+
+ onAccepted: {
+ filesSelected(selectedFiles)
+ }
+}
diff --git a/src/webenginequick/ui/Menu.qml b/src/webenginequick/ui/Menu.qml
new file mode 100644
index 000000000..bfa037d1c
--- /dev/null
+++ b/src/webenginequick/ui/Menu.qml
@@ -0,0 +1,22 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+import QtQuick
+import QtQuick.Controls as C
+
+C.Menu {
+ id: menu
+ signal done()
+ objectName: "menu"
+
+ // Use private API for now
+ onAboutToHide: doneTimer.start()
+
+ // WORKAROUND On Mac the Menu may be destroyed before the MenuItem
+ // is actually triggered (see qtbase commit 08cc9b9991ae9ab51)
+ Timer {
+ id: doneTimer
+ interval: 100
+ onTriggered: menu.done()
+ }
+}
diff --git a/src/webenginequick/ui/MenuItem.qml b/src/webenginequick/ui/MenuItem.qml
new file mode 100644
index 000000000..8fefcdc69
--- /dev/null
+++ b/src/webenginequick/ui/MenuItem.qml
@@ -0,0 +1,7 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+import QtQuick
+import QtQuick.Controls as C
+
+C.MenuItem { }
diff --git a/src/webenginequick/ui/MenuSeparator.qml b/src/webenginequick/ui/MenuSeparator.qml
new file mode 100644
index 000000000..af37f57a9
--- /dev/null
+++ b/src/webenginequick/ui/MenuSeparator.qml
@@ -0,0 +1,6 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+import QtQuick
+
+Item { id: dummy }
diff --git a/src/webenginequick/ui/PromptDialog.qml b/src/webenginequick/ui/PromptDialog.qml
new file mode 100644
index 000000000..275deace8
--- /dev/null
+++ b/src/webenginequick/ui/PromptDialog.qml
@@ -0,0 +1,79 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+
+Dialog {
+ property alias text: message.text
+ property alias prompt: field.text
+ property bool handled: false
+ signal input(string text)
+ signal accepted()
+ signal rejected()
+ title: qsTr("Prompt Dialog")
+ modal: false
+ anchors.centerIn: parent
+ objectName: "promptDialog"
+
+ //handle the case where users simply closes the dialog
+ onVisibleChanged: {
+ if (visible == false && handled == false) {
+ handled = true;
+ rejected();
+ } else {
+ handled = false;
+ }
+ }
+
+ function acceptDialog() {
+ input(field.text);
+ accepted();
+ handled = true;
+ close();
+ }
+
+ function rejectDialog() {
+ rejected();
+ handled = true;
+ close();
+ }
+
+ ColumnLayout {
+ id: rootLayout
+ anchors.fill: parent
+ anchors.margins: 4
+ property int minimumWidth: rootLayout.implicitWidth + rootLayout.doubleMargins
+ property int minimumHeight: rootLayout.implicitHeight + rootLayout.doubleMargins
+ property int doubleMargins: anchors.margins * 2
+ SystemPalette { id: palette; colorGroup: SystemPalette.Active }
+ Text {
+ id: message
+ Layout.fillWidth: true
+ color: palette.windowText
+ textFormat: Text.PlainText
+ }
+ TextField {
+ id:field
+ focus: true
+ Layout.fillWidth: true
+ onAccepted: acceptDialog()
+ }
+ Item {
+ Layout.fillHeight: true
+ }
+ RowLayout {
+ Layout.alignment: Qt.AlignRight
+ spacing: 8
+ Button {
+ text: qsTr("OK")
+ onClicked: acceptDialog()
+ }
+ Button {
+ text: qsTr("Cancel")
+ onClicked: rejectDialog()
+ }
+ }
+ }
+}
diff --git a/src/webenginequick/ui/ToolTip.qml b/src/webenginequick/ui/ToolTip.qml
new file mode 100644
index 000000000..525258e2f
--- /dev/null
+++ b/src/webenginequick/ui/ToolTip.qml
@@ -0,0 +1,10 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+import QtQuick.Controls as C
+
+C.ToolTip {
+ delay: 1000
+ timeout: 1500
+ objectName: "toolTip"
+}
diff --git a/src/webenginequick/ui/TouchHandle.qml b/src/webenginequick/ui/TouchHandle.qml
new file mode 100644
index 000000000..a879ec71b
--- /dev/null
+++ b/src/webenginequick/ui/TouchHandle.qml
@@ -0,0 +1,6 @@
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+import QtQuick
+
+Image { }
diff --git a/src/webenginequick/ui/TouchSelectionMenu.qml b/src/webenginequick/ui/TouchSelectionMenu.qml
new file mode 100644
index 000000000..f42c256bb
--- /dev/null
+++ b/src/webenginequick/ui/TouchSelectionMenu.qml
@@ -0,0 +1,139 @@
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+import QtQuick
+import QtQuick.Layouts
+
+Rectangle {
+ id: menu
+
+ signal cutTriggered
+ signal copyTriggered
+ signal pasteTriggered
+ signal contextMenuTriggered
+
+ property bool isCutEnabled: false
+ property bool isCopyEnabled: false
+ property bool isPasteEnabled: false
+
+ property color borderColor: "darkGray"
+ property color bgColor: "white"
+
+ radius: 4
+ border.color: borderColor
+ color: borderColor
+ antialiasing: true
+
+ RowLayout {
+ anchors.fill: parent
+ spacing: parent.border.width
+ anchors.margins: parent.border.width
+
+ Rectangle {
+ Layout.fillHeight: true
+ Layout.fillWidth: true
+ radius: menu.radius
+ color: bgColor
+ visible: isCutEnabled
+
+ Text {
+ id: cutText
+ anchors.centerIn: parent
+ text: "Cut"
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ parent.color = borderColor;
+ cutText.color = "white";
+ }
+ onReleased: {
+ parent.color = bgColor;
+ cutText.color = "black";
+ cutTriggered();
+ }
+ }
+ }
+
+ Rectangle {
+ Layout.fillHeight: true
+ Layout.fillWidth: true
+ radius: menu.radius
+ color: bgColor
+ visible: isCopyEnabled
+
+ Text {
+ id: copyText
+ anchors.centerIn: parent
+ text: "Copy"
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ parent.color = borderColor;
+ copyText.color = "white";
+ }
+ onReleased: {
+ parent.color = bgColor;
+ copyText.color = "black";
+ copyTriggered();
+ }
+ }
+ }
+
+ Rectangle {
+ Layout.fillHeight: true
+ Layout.fillWidth: true
+ radius: menu.radius
+ color: bgColor
+ visible: isPasteEnabled
+
+ Text {
+ id: pasteText
+ anchors.centerIn: parent
+ text: "Paste"
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ parent.color = borderColor;
+ pasteText.color = "white";
+ }
+ onReleased: {
+ parent.color = bgColor;
+ pasteText.color = "black";
+ pasteTriggered();
+ }
+ }
+ }
+
+ Rectangle {
+ Layout.fillHeight: true
+ Layout.fillWidth: true
+ radius: menu.radius
+ color: bgColor
+
+ Text {
+ id: contextMenuText
+ anchors.centerIn: parent
+ text: "..."
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ parent.color = borderColor;
+ contextMenuText.color = "white";
+ }
+ onReleased: {
+ parent.color = bgColor;
+ contextMenuText.color = "black";
+ contextMenuTriggered();
+ }
+ }
+ }
+ }
+}
diff --git a/src/webenginequick/ui/custom/ColorDialog.qml b/src/webenginequick/ui/custom/ColorDialog.qml
new file mode 100644
index 000000000..895c90198
--- /dev/null
+++ b/src/webenginequick/ui/custom/ColorDialog.qml
@@ -0,0 +1,285 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+
+Dialog {
+ id: colorDialog
+ title: qsTr("Color Picker Dialog")
+ modal: false
+ anchors.centerIn: parent
+ objectName: "colorDialog"
+
+ property bool handled: false
+ property color color
+
+ signal selectedColor(var color)
+ signal rejected()
+
+ function accept() {
+ handled = true;
+ selectedColor(colorDialog.color)
+ close();
+ }
+
+ function reject() {
+ handled = true;
+ rejected();
+ close();
+ }
+
+ // Handle the case where users simply closes or clicks out of the dialog.
+ onVisibleChanged: {
+ if (!visible && !handled) {
+ handled = true;
+ rejected();
+ } else {
+ handled = false;
+ }
+ }
+
+ function selectColorFromPalette(paletteColor) {
+ colorDialog.color = paletteColor;
+ }
+
+ function zeroPadding(text, length = 2) {
+ var textLength = text.length;
+
+ if (textLength >= length) {
+ return text;
+ }
+
+ for (var i = 0; i < length - textLength; i++) {
+ text = "0" + text;
+ }
+
+ return text;
+ }
+
+ function calculateRGBA() {
+
+ var rgbArray = [colorDialog.color.r, colorDialog.color.g, colorDialog.color.b]
+ if (colorDialog.color.a != 1) {
+ rgbArray.push(colorDialog.color.a);
+ }
+
+ for (var i = 0; i < rgbArray.length; i++) {
+ rgbArray[i] = Number(Math.round(rgbArray[i] * 255)).toString(16);
+ rgbArray[i] = zeroPadding(rgbArray[i]);
+ }
+
+ return "#" + rgbArray.join("");
+ }
+
+
+ function isNaNOrUndefined(value) {
+ return value == null || value == undefined || Number.isNaN(value);
+ }
+
+ function parseColorText(colorText) {
+ if (colorText[0] == '#') {
+ colorText = colorText.substring(1);
+ }
+
+ if (!(colorText.length == 6 || colorText.length == 8)) {
+ return undefined;
+ }
+
+ var rgbaValues = [parseInt("0x" + colorText.substring(0,2)),
+ parseInt("0x" + colorText.substring(2,4)),
+ parseInt("0x" + colorText.substring(4,6)),
+ parseInt("0x" + (colorText.length > 6 ? colorText.substring(6,8) : "FF"))]
+
+ for (var i = 0; i < rgbaValues.length; i++) {
+ if (isNaNOrUndefined(rgbaValues[i])) {
+ return undefined;
+ }
+ rgbaValues[i] = rgbaValues[i] / 255;
+ }
+
+ return Qt.rgba(rgbaValues[0], rgbaValues[1], rgbaValues[2], rgbaValues[3]);
+ }
+
+ ListModel {
+ id: colorList
+ ListElement { rectangleColor: "red" }
+ ListElement { rectangleColor: "orangered" }
+ ListElement { rectangleColor: "orange" }
+ ListElement { rectangleColor: "gold" }
+ ListElement { rectangleColor: "yellow" }
+ ListElement { rectangleColor: "yellowgreen" }
+ ListElement { rectangleColor: "green" }
+ ListElement { rectangleColor: "lightskyblue" }
+ ListElement { rectangleColor: "blue" }
+ ListElement { rectangleColor: "blueviolet" }
+ ListElement { rectangleColor: "violet" }
+ ListElement { rectangleColor: "mediumvioletred" }
+ ListElement { rectangleColor: "black" }
+ ListElement { rectangleColor: "white" }
+ }
+
+ contentItem: GridLayout {
+ id: grid
+ columns: 7
+ rows: 5
+
+ Repeater {
+ model: colorList
+ delegate: Rectangle {
+ width: 50
+ height: 50
+ color: rectangleColor
+ border.color: "black"
+ border.width: 1
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: selectColorFromPalette(parent.color)
+ }
+ }
+ }
+ ColumnLayout {
+ id: colorTools
+ Layout.columnSpan: 4
+ Layout.rowSpan: 2
+ Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
+
+ Rectangle {
+ height: 100
+ width: 200
+ border.color: "black"
+ border.width: 1
+
+ Binding on color {
+ when: colorDialog.color
+ value: colorDialog.color
+ }
+ }
+ TextField {
+ id: colorTextField
+ width: 100
+ selectByMouse: true
+ Layout.alignment: Qt.AlignHCenter
+
+ Binding on text {
+ when: colorDialog.color
+ value: calculateRGBA()
+ delayed: true
+ }
+
+ onTextEdited: {
+ var parsedColor = parseColorText(colorTextField.text);
+ if (parsedColor != undefined) {
+ colorDialog.color = parsedColor;
+ }
+ }
+
+ MouseArea {
+ id: colorTextFieldMouseArea
+ anchors.fill: parent
+ acceptedButtons: Qt.RightButton
+ onClicked: colorTextFieldContextMenu.open()
+ }
+
+ Menu {
+ id: colorTextFieldContextMenu
+ x: colorTextFieldMouseArea.mouseX
+ y: colorTextFieldMouseArea.mouseY
+ MenuItem {
+ text: qsTr("Copy color")
+ onTriggered: {
+ colorTextField.selectAll();
+ colorTextField.copy();
+ colorTextField.deselect();
+ }
+ }
+ MenuSeparator {}
+ MenuItem {
+ text: qsTr("Paste")
+ onTriggered: {
+ colorTextField.selectAll();
+ colorTextField.paste();
+ }
+ enabled: colorTextField.canPaste
+ }
+ }
+ }
+ }
+ ListModel {
+ id: sliderBoxElements
+ ListElement { labelText: "Red value"; colorChannel: 0 }
+ ListElement { labelText: "Green value"; colorChannel: 1 }
+ ListElement { labelText: "Blue value"; colorChannel: 2 }
+ ListElement { labelText: "Alpha value"; colorChannel: 3 }
+ }
+ ColumnLayout {
+ id: sliderBox
+ Layout.columnSpan: 3
+ Layout.rowSpan: 2
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+
+ Repeater {
+ model: sliderBoxElements
+ delegate: ColumnLayout {
+ Label {
+ text: labelText
+ }
+ Slider {
+ id: colorSlider
+ property int channel: colorChannel
+ from: 0
+ to: 255
+ stepSize: 1
+ value: {
+ if (colorSlider.channel == 0)
+ return colorDialog.color.r * 255;
+ else if (colorSlider.channel == 1)
+ return colorDialog.color.g * 255;
+ else if (colorSlider.channel == 2)
+ return colorDialog.color.b * 255;
+ else if (colorSlider.channel == 3)
+ return colorDialog.color.a * 255;
+ }
+
+ Connections {
+ function onMoved() {
+ var redChannelValue = colorDialog.color.r;
+ var greenChannelValue = colorDialog.color.g;
+ var blueChannelValue = colorDialog.color.b;
+ var alphaChannelValue = colorDialog.color.a;
+
+ if (colorSlider.channel == 0)
+ redChannelValue = colorSlider.value / 255;
+ else if (colorSlider.channel == 1)
+ greenChannelValue = colorSlider.value / 255;
+ else if (colorSlider.channel == 2)
+ blueChannelValue = colorSlider.value / 255;
+ else if (colorSlider.channel == 3)
+ alphaChannelValue = colorSlider.value / 255;
+
+ colorDialog.color = Qt.rgba(redChannelValue, greenChannelValue, blueChannelValue, alphaChannelValue);
+ }
+ }
+ }
+ }
+ }
+ }
+ DialogButtonBox {
+ id: dialogButtonBox
+ Layout.columnSpan: 7
+ Layout.alignment: Qt.AlignRight
+
+ Button {
+ text: qsTr("Apply")
+ onClicked: accept()
+ }
+ Button {
+ text: qsTr("Cancel")
+ onClicked: reject()
+ }
+ }
+ }
+}
diff --git a/src/webengine/ui2/information.png b/src/webenginequick/ui/information.png
index 0a2eb87d1..0a2eb87d1 100644
--- a/src/webengine/ui2/information.png
+++ b/src/webenginequick/ui/information.png
Binary files differ
diff --git a/src/webengine/ui2/question.png b/src/webenginequick/ui/question.png
index 2dd92fd79..2dd92fd79 100644
--- a/src/webengine/ui2/question.png
+++ b/src/webenginequick/ui/question.png
Binary files differ
diff --git a/src/webenginequick/ui_delegates_manager.cpp b/src/webenginequick/ui_delegates_manager.cpp
new file mode 100644
index 000000000..3d6eff649
--- /dev/null
+++ b/src/webenginequick/ui_delegates_manager.cpp
@@ -0,0 +1,806 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "ui_delegates_manager.h"
+
+#include "api/qquickwebengineaction_p.h"
+#include "api/qquickwebengineview_p_p.h"
+
+#include <authentication_dialog_controller.h>
+#include <autofill_popup_controller.h>
+#include <color_chooser_controller.h>
+#include <file_picker_controller.h>
+#include <javascript_dialog_controller.h>
+#include <touch_selection_menu_controller.h>
+#include <web_contents_adapter_client.h>
+
+#include <QtCore/qdiriterator.h>
+#include <QtCore/qfileinfo.h>
+#include <QtCore/qlist.h>
+#include <QtCore/qtimer.h>
+#include <QtGui/qcursor.h>
+#include <QtGui/qguiapplication.h>
+#include <QtGui/qscreen.h>
+#include <QtQml/qqmlcontext.h>
+#include <QtQml/qqmlengine.h>
+#include <QtQml/qqmlproperty.h>
+#include <QtQuick/qquickwindow.h>
+
+#include <algorithm>
+
+// Uncomment for QML debugging
+//#define UI_DELEGATES_DEBUG
+
+namespace QtWebEngineCore {
+
+#define NO_SEPARATOR
+#define FILE_NAME_CASE_STATEMENT(TYPE, COMPONENT) \
+ case UIDelegatesManager::TYPE:\
+ return QStringLiteral(#TYPE".qml");
+
+static QString fileNameForComponent(UIDelegatesManager::ComponentType type)
+{
+ switch (type) {
+ FOR_EACH_COMPONENT_TYPE(FILE_NAME_CASE_STATEMENT, NO_SEPARATOR)
+ default:
+ Q_UNREACHABLE();
+ }
+ return QString();
+}
+
+static QPoint calculateToolTipPosition(QPoint &position, QSize &toolTip) {
+ QRect screen;
+ const QList<QScreen *> screens = QGuiApplication::screens();
+ for (const QScreen *src : screens)
+ if (src->availableGeometry().contains(position))
+ screen = src->availableGeometry();
+
+ position += QPoint(2, 16);
+
+ if (position.x() + toolTip.width() > screen.x() + screen.width())
+ position.rx() -= 4 + toolTip.width();
+ if (position.y() + toolTip.height() > screen.y() + screen.height())
+ position.ry() -= 24 + toolTip.height();
+ if (position.y() < screen.y())
+ position.setY(screen.y());
+ if (position.x() + toolTip.width() > screen.x() + screen.width())
+ position.setX(screen.x() + screen.width() - toolTip.width());
+ if (position.x() < screen.x())
+ position.setX(screen.x());
+ if (position.y() + toolTip.height() > screen.y() + screen.height())
+ position.setY(screen.y() + screen.height() - toolTip.height());
+
+ return position;
+}
+
+const char *defaultPropertyName(QObject *obj)
+{
+ const QMetaObject *metaObject = obj->metaObject();
+
+ int idx = metaObject->indexOfClassInfo("DefaultProperty");
+ if (-1 == idx)
+ return 0;
+
+ QMetaClassInfo info = metaObject->classInfo(idx);
+ return info.value();
+}
+
+#define COMPONENT_MEMBER_INIT(TYPE, COMPONENT) \
+ , COMPONENT##Component(0)
+
+// clang-format off
+UIDelegatesManager::UIDelegatesManager(QQuickWebEngineView *view)
+ : m_view(view)
+ , m_toolTip(nullptr)
+ , m_touchSelectionMenu(nullptr)
+ , m_autofillPopup(nullptr)
+ FOR_EACH_COMPONENT_TYPE(COMPONENT_MEMBER_INIT, NO_SEPARATOR)
+// clang-format on
+{
+}
+
+UIDelegatesManager::~UIDelegatesManager()
+{
+}
+
+#define COMPONENT_MEMBER_CASE_STATEMENT(TYPE, COMPONENT) \
+ case TYPE: \
+ component = &COMPONENT##Component; \
+ break;
+
+bool UIDelegatesManager::ensureComponentLoaded(ComponentType type)
+{
+ QQmlEngine* engine = qmlEngine(m_view);
+ if (m_importDirs.isEmpty() && !initializeImportDirs(m_importDirs, engine))
+ return false;
+
+ QQmlComponent **component;
+ switch (type) {
+ FOR_EACH_COMPONENT_TYPE(COMPONENT_MEMBER_CASE_STATEMENT, NO_SEPARATOR)
+ default:
+ Q_UNREACHABLE();
+ return false;
+ }
+ QString fileName(fileNameForComponent(type));
+#ifndef UI_DELEGATES_DEBUG
+ if (*component)
+ return true;
+#else // Unconditionally reload the components each time.
+ fprintf(stderr, "%s: %s\n", Q_FUNC_INFO, qPrintable(fileName));
+#endif
+ if (!engine)
+ return false;
+
+ for (const QString &importDir : std::as_const(m_importDirs)) {
+ const QString componentFilePath = importDir % QLatin1Char('/') % fileName;
+
+ if (!QFileInfo(componentFilePath).exists())
+ continue;
+
+ // FIXME: handle async loading
+ *component = (new QQmlComponent(engine,
+ importDir.startsWith(QLatin1String(":/")) ? QUrl(QLatin1String("qrc") + componentFilePath)
+ : QUrl::fromLocalFile(componentFilePath),
+ QQmlComponent::PreferSynchronous, m_view));
+
+ if ((*component)->status() != QQmlComponent::Ready) {
+ const QList<QQmlError> errs = (*component)->errors();
+ for (const QQmlError &err : errs)
+ qWarning("QtWebEngine: component error: %s\n", qPrintable(err.toString()));
+ delete *component;
+ *component = nullptr;
+ return false;
+ }
+ return true;
+ }
+ return false;
+}
+
+#define CHECK_QML_SIGNAL_PROPERTY(prop, location) \
+ if (!prop.isSignalProperty()) \
+ qWarning("%s is missing %s signal property.\n", qPrintable(location.toString()), qPrintable(prop.name()));
+
+void UIDelegatesManager::addMenuSeparator(QObject *menu)
+{
+ if (!ensureComponentLoaded(MenuSeparator))
+ return;
+
+ QQmlContext *itemContext = qmlContext(m_view);
+ QObject *sep = menuSeparatorComponent->create(itemContext);
+ sep->setParent(menu);
+
+ QQmlListReference entries(menu, defaultPropertyName(menu));
+ if (entries.isValid() && entries.count() > 0)
+ entries.append(sep);
+}
+
+#define ASSIGN_DIALOG_COMPONENT_DATA_CASE_STATEMENT(TYPE, COMPONENT) \
+ case TYPE:\
+ dialogComponent = COMPONENT##Component; \
+ break;
+
+
+void UIDelegatesManager::showDialog(QSharedPointer<JavaScriptDialogController> dialogController)
+{
+ Q_ASSERT(!dialogController.isNull());
+ ComponentType dialogComponentType = Invalid;
+ QString title;
+ switch (dialogController->type()) {
+ case WebContentsAdapterClient::AlertDialog:
+ dialogComponentType = AlertDialog;
+ title = tr("Javascript Alert - %1").arg(m_view->url().toString());
+ break;
+ case WebContentsAdapterClient::ConfirmDialog:
+ dialogComponentType = ConfirmDialog;
+ title = tr("Javascript Confirm - %1").arg(m_view->url().toString());
+ break;
+ case WebContentsAdapterClient::PromptDialog:
+ dialogComponentType = PromptDialog;
+ title = tr("Javascript Prompt - %1").arg(m_view->url().toString());
+ break;
+ case WebContentsAdapterClient::UnloadDialog:
+ dialogComponentType = ConfirmDialog;
+ title = tr("Are you sure you want to leave this page?");
+ break;
+ case WebContentsAdapterClient::InternalAuthorizationDialog:
+ dialogComponentType = ConfirmDialog;
+ title = dialogController->title();
+ break;
+ default:
+ Q_UNREACHABLE();
+ }
+
+ if (!ensureComponentLoaded(dialogComponentType)) {
+ // Let the controller know it couldn't be loaded
+ qWarning("Failed to load dialog, rejecting.");
+ dialogController->reject();
+ return;
+ }
+
+ QQmlComponent *dialogComponent = nullptr;
+ switch (dialogComponentType) {
+ FOR_EACH_COMPONENT_TYPE(ASSIGN_DIALOG_COMPONENT_DATA_CASE_STATEMENT, NO_SEPARATOR)
+ default:
+ Q_UNREACHABLE();
+ }
+
+ QQmlContext *context = qmlContext(m_view);
+ QObject *dialog = dialogComponent->beginCreate(context);
+ // set visual parent for non-Window-based dialogs
+ if (QQuickItem *item = qobject_cast<QQuickItem*>(dialog))
+ item->setParentItem(m_view);
+ dialog->setParent(m_view);
+ QQmlProperty textProp(dialog, QStringLiteral("text"));
+ if (dialogController->type() == WebContentsAdapterClient::UnloadDialog)
+ textProp.write(tr("Changes that you made may not be saved."));
+ else
+ textProp.write(dialogController->message());
+
+ QQmlProperty titleProp(dialog, QStringLiteral("title"));
+ titleProp.write(title);
+
+ QQmlProperty acceptSignal(dialog, QStringLiteral("onAccepted"));
+ QQmlProperty rejectSignal(dialog, QStringLiteral("onRejected"));
+ CHECK_QML_SIGNAL_PROPERTY(acceptSignal, dialogComponent->url());
+ CHECK_QML_SIGNAL_PROPERTY(rejectSignal, dialogComponent->url());
+
+ static int acceptIndex = dialogController->metaObject()->indexOfSlot("accept()");
+ QObject::connect(dialog, acceptSignal.method(), dialogController.data(), dialogController->metaObject()->method(acceptIndex));
+ static int rejectIndex = dialogController->metaObject()->indexOfSlot("reject()");
+ QObject::connect(dialog, rejectSignal.method(), dialogController.data(), dialogController->metaObject()->method(rejectIndex));
+
+ if (dialogComponentType == PromptDialog) {
+ QQmlProperty promptProp(dialog, QStringLiteral("prompt"));
+ promptProp.write(dialogController->defaultPrompt());
+ QQmlProperty inputSignal(dialog, QStringLiteral("onInput"));
+ CHECK_QML_SIGNAL_PROPERTY(inputSignal, dialogComponent->url());
+ static int setTextIndex = dialogController->metaObject()->indexOfSlot("textProvided(QString)");
+ QObject::connect(dialog, inputSignal.method(), dialogController.data(), dialogController->metaObject()->method(setTextIndex));
+ }
+
+ dialogComponent->completeCreate();
+
+ QObject::connect(dialogController.data(), &JavaScriptDialogController::dialogCloseRequested, dialog, &QObject::deleteLater);
+
+ QMetaObject::invokeMethod(dialog, "open");
+}
+
+void UIDelegatesManager::showColorDialog(QSharedPointer<ColorChooserController> controller)
+{
+ if (!ensureComponentLoaded(ColorDialog)) {
+ // Let the controller know it couldn't be loaded
+ qWarning("Failed to load dialog, rejecting.");
+ controller->reject();
+ return;
+ }
+
+ QQmlContext *context = qmlContext(m_view);
+ QObject *colorDialog = colorDialogComponent->beginCreate(context);
+ if (QQuickItem *item = qobject_cast<QQuickItem*>(colorDialog))
+ item->setParentItem(m_view);
+ colorDialog->setParent(m_view);
+
+ if (controller->initialColor().isValid())
+ colorDialog->setProperty("color", controller->initialColor());
+
+ QQmlProperty selectedColorSignal(colorDialog, QStringLiteral("onSelectedColor"));
+ CHECK_QML_SIGNAL_PROPERTY(selectedColorSignal, colorDialogComponent->url());
+ QQmlProperty rejectedSignal(colorDialog, QStringLiteral("onRejected"));
+ CHECK_QML_SIGNAL_PROPERTY(rejectedSignal, colorDialogComponent->url());
+
+ static int acceptIndex = controller->metaObject()->indexOfSlot("accept(QVariant)");
+ QObject::connect(colorDialog, selectedColorSignal.method(), controller.data(), controller->metaObject()->method(acceptIndex));
+ static int rejectIndex = controller->metaObject()->indexOfSlot("reject()");
+ QObject::connect(colorDialog, rejectedSignal.method(), controller.data(), controller->metaObject()->method(rejectIndex));
+
+ // delete later
+ static int deleteLaterIndex = colorDialog->metaObject()->indexOfSlot("deleteLater()");
+ QObject::connect(colorDialog, selectedColorSignal.method(), colorDialog, colorDialog->metaObject()->method(deleteLaterIndex));
+ QObject::connect(colorDialog, rejectedSignal.method(), colorDialog, colorDialog->metaObject()->method(deleteLaterIndex));
+
+ colorDialogComponent->completeCreate();
+ QMetaObject::invokeMethod(colorDialog, "open");
+}
+
+void UIDelegatesManager::showDialog(QSharedPointer<AuthenticationDialogController> dialogController)
+{
+ Q_ASSERT(!dialogController.isNull());
+
+ if (!ensureComponentLoaded(AuthenticationDialog)) {
+ // Let the controller know it couldn't be loaded
+ qWarning("Failed to load authentication dialog, rejecting.");
+ dialogController->reject();
+ return;
+ }
+
+ QQmlContext *context = qmlContext(m_view);
+ QObject *authenticationDialog = authenticationDialogComponent->beginCreate(context);
+ // set visual parent for non-Window-based dialogs
+ if (QQuickItem *item = qobject_cast<QQuickItem*>(authenticationDialog))
+ item->setParentItem(m_view);
+ authenticationDialog->setParent(m_view);
+
+ QString introMessage;
+ if (dialogController->isProxy()) {
+ introMessage = tr("Connect to proxy \"%1\" using:");
+ introMessage = introMessage.arg(dialogController->host().toHtmlEscaped());
+ } else {
+ const QUrl url = dialogController->url();
+ introMessage = tr("Enter username and password for \"%1\" at %2://%3");
+ introMessage = introMessage.arg(dialogController->realm(), url.scheme(), url.host());
+ }
+ QQmlProperty textProp(authenticationDialog, QStringLiteral("text"));
+ textProp.write(introMessage);
+
+ QQmlProperty acceptSignal(authenticationDialog, QStringLiteral("onAccepted"));
+ QQmlProperty rejectSignal(authenticationDialog, QStringLiteral("onRejected"));
+ CHECK_QML_SIGNAL_PROPERTY(acceptSignal, authenticationDialogComponent->url());
+ CHECK_QML_SIGNAL_PROPERTY(rejectSignal, authenticationDialogComponent->url());
+
+ static int acceptIndex = dialogController->metaObject()->indexOfSlot("accept(QString,QString)");
+ static int deleteLaterIndex = authenticationDialog->metaObject()->indexOfSlot("deleteLater()");
+ QObject::connect(authenticationDialog, acceptSignal.method(), dialogController.data(), dialogController->metaObject()->method(acceptIndex));
+ QObject::connect(authenticationDialog, acceptSignal.method(), authenticationDialog, authenticationDialog->metaObject()->method(deleteLaterIndex));
+ static int rejectIndex = dialogController->metaObject()->indexOfSlot("reject()");
+ QObject::connect(authenticationDialog, rejectSignal.method(), dialogController.data(), dialogController->metaObject()->method(rejectIndex));
+ QObject::connect(authenticationDialog, rejectSignal.method(), authenticationDialog, authenticationDialog->metaObject()->method(deleteLaterIndex));
+
+ authenticationDialogComponent->completeCreate();
+ QMetaObject::invokeMethod(authenticationDialog, "open");
+}
+
+void UIDelegatesManager::showFilePicker(QSharedPointer<FilePickerController> controller)
+{
+ if (controller->mode() == FilePickerController::UploadFolder) {
+ showDirectoryPicker(controller);
+ return;
+ }
+
+ if (!ensureComponentLoaded(FilePicker))
+ return;
+
+ QQmlContext *context = qmlContext(m_view);
+ QObject *filePicker = filePickerComponent->beginCreate(context);
+ if (QQuickItem *item = qobject_cast<QQuickItem*>(filePicker))
+ item->setParentItem(m_view);
+ filePicker->setParent(m_view);
+ filePickerComponent->completeCreate();
+
+ static int fileModeIndex = filePicker->metaObject()->indexOfEnumerator("FileMode");
+ QMetaEnum fileModeEnum = filePicker->metaObject()->enumerator(fileModeIndex);
+
+ // Fine-tune some properties depending on the mode.
+ switch (controller->mode()) {
+ case FilePickerController::Open:
+ filePicker->setProperty("fileMode", fileModeEnum.keyToValue("OpenFile"));
+ break;
+ case FilePickerController::Save:
+ filePicker->setProperty("fileMode", fileModeEnum.keyToValue("SaveFile"));
+ break;
+ case FilePickerController::OpenMultiple:
+ filePicker->setProperty("fileMode", fileModeEnum.keyToValue("OpenFiles"));
+ break;
+ case FilePickerController::UploadFolder:
+ default:
+ Q_UNREACHABLE();
+ }
+
+ filePicker->setProperty("nameFilters", FilePickerController::nameFilters(controller->acceptedMimeTypes()));
+
+ QQmlProperty filesPickedSignal(filePicker, QStringLiteral("onFilesSelected"));
+ CHECK_QML_SIGNAL_PROPERTY(filesPickedSignal, filePickerComponent->url());
+ QQmlProperty rejectSignal(filePicker, QStringLiteral("onRejected"));
+ CHECK_QML_SIGNAL_PROPERTY(rejectSignal, filePickerComponent->url());
+ static int acceptedIndex = controller->metaObject()->indexOfSlot("accepted(QVariant)");
+ QObject::connect(filePicker, filesPickedSignal.method(), controller.data(), controller->metaObject()->method(acceptedIndex));
+ static int rejectedIndex = controller->metaObject()->indexOfSlot("rejected()");
+ QObject::connect(filePicker, rejectSignal.method(), controller.data(), controller->metaObject()->method(rejectedIndex));
+
+ // delete when done.
+ static int deleteLaterIndex = filePicker->metaObject()->indexOfSlot("deleteLater()");
+ QObject::connect(filePicker, filesPickedSignal.method(), filePicker, filePicker->metaObject()->method(deleteLaterIndex));
+ QObject::connect(filePicker, rejectSignal.method(), filePicker, filePicker->metaObject()->method(deleteLaterIndex));
+
+ QMetaObject::invokeMethod(filePicker, "open");
+}
+
+void UIDelegatesManager::showDirectoryPicker(QSharedPointer<FilePickerController> controller)
+{
+ if (!ensureComponentLoaded(DirectoryPicker))
+ return;
+
+ QQmlContext *context = qmlContext(m_view);
+ QObject *directoryPicker = directoryPickerComponent->beginCreate(context);
+ if (QQuickItem *item = qobject_cast<QQuickItem*>(directoryPicker))
+ item->setParentItem(m_view);
+ directoryPicker->setParent(m_view);
+ directoryPickerComponent->completeCreate();
+
+ QQmlProperty directoryPickedSignal(directoryPicker, QStringLiteral("onFolderSelected"));
+ CHECK_QML_SIGNAL_PROPERTY(directoryPickedSignal, directoryPickerComponent->url());
+ QQmlProperty rejectSignal(directoryPicker, QStringLiteral("onRejected"));
+ CHECK_QML_SIGNAL_PROPERTY(rejectSignal, directoryPickerComponent->url());
+ static int acceptedIndex = controller->metaObject()->indexOfSlot("accepted(QVariant)");
+ QObject::connect(directoryPicker, directoryPickedSignal.method(), controller.data(), controller->metaObject()->method(acceptedIndex));
+ static int rejectedIndex = controller->metaObject()->indexOfSlot("rejected()");
+ QObject::connect(directoryPicker, rejectSignal.method(), controller.data(), controller->metaObject()->method(rejectedIndex));
+
+ // delete when done.
+ static int deleteLaterIndex = directoryPicker->metaObject()->indexOfSlot("deleteLater()");
+ QObject::connect(directoryPicker, directoryPickedSignal.method(), directoryPicker, directoryPicker->metaObject()->method(deleteLaterIndex));
+ QObject::connect(directoryPicker, rejectSignal.method(), directoryPicker, directoryPicker->metaObject()->method(deleteLaterIndex));
+
+ QMetaObject::invokeMethod(directoryPicker, "open");
+}
+
+class TemporaryCursorMove
+{
+public:
+ TemporaryCursorMove(const QQuickItem *item, const QPoint &pos)
+ {
+ if (pos.isNull() || !item->contains(pos))
+ return;
+ const QPoint oldPos = QCursor::pos();
+ const QPoint globalPos = item->mapToGlobal(QPointF(pos)).toPoint();
+ if (oldPos == globalPos)
+ return;
+ m_oldCursorPos = oldPos;
+ QCursor::setPos(globalPos);
+ }
+
+ ~TemporaryCursorMove()
+ {
+ if (!m_oldCursorPos.isNull())
+ QCursor::setPos(m_oldCursorPos);
+ }
+
+private:
+ QPoint m_oldCursorPos;
+};
+
+void UIDelegatesManager::showToolTip(const QString &text)
+{
+ if (text.isEmpty()) {
+ m_toolTip.reset();
+ return;
+ }
+
+ if (!ensureComponentLoaded(ToolTip))
+ return;
+
+ if (!m_toolTip.isNull())
+ return;
+
+ QQmlContext *context = qmlContext(m_view);
+ m_toolTip.reset(toolTipComponent->beginCreate(context));
+ if (QQuickItem *item = qobject_cast<QQuickItem *>(m_toolTip.data()))
+ item->setParentItem(m_view);
+ m_toolTip->setParent(m_view);
+ toolTipComponent->completeCreate();
+
+ QQmlProperty(m_toolTip.data(), QStringLiteral("text")).write(text);
+
+ int height = QQmlProperty(m_toolTip.data(), QStringLiteral("height")).read().toInt();
+ int width = QQmlProperty(m_toolTip.data(), QStringLiteral("width")).read().toInt();
+ QSize toolTipSize(width, height);
+ QPoint position = m_view->cursor().pos();
+ position = m_view->mapFromGlobal(calculateToolTipPosition(position, toolTipSize)).toPoint();
+
+ QQmlProperty(m_toolTip.data(), QStringLiteral("x")).write(position.x());
+ QQmlProperty(m_toolTip.data(), QStringLiteral("y")).write(position.y());
+
+ QMetaObject::invokeMethod(m_toolTip.data(), "open");
+}
+
+QQuickItem *UIDelegatesManager::createTouchHandle()
+{
+ if (!ensureComponentLoaded(TouchHandle))
+ return nullptr;
+
+ QQmlContext *context = qmlContext(m_view);
+ QObject *touchHandle = touchHandleComponent->beginCreate(context);
+ QQuickItem *item = qobject_cast<QQuickItem *>(touchHandle);
+ Q_ASSERT(item);
+ item->setParentItem(m_view);
+ touchHandleComponent->completeCreate();
+
+ return item;
+}
+
+void UIDelegatesManager::showTouchSelectionMenu(QtWebEngineCore::TouchSelectionMenuController *menuController, const QRect &bounds, const int spacing)
+{
+ if (!ensureComponentLoaded(TouchSelectionMenu))
+ return;
+
+ QQmlContext *context = qmlContext(m_view);
+ m_touchSelectionMenu.reset(touchSelectionMenuComponent->beginCreate(context));
+ if (QQuickItem *item = qobject_cast<QQuickItem *>(m_touchSelectionMenu.data()))
+ item->setParentItem(m_view);
+ m_touchSelectionMenu->setParent(m_view);
+
+ QQmlProperty(m_touchSelectionMenu.data(), QStringLiteral("width")).write(bounds.width());
+ QQmlProperty(m_touchSelectionMenu.data(), QStringLiteral("height")).write(bounds.height());
+ QQmlProperty(m_touchSelectionMenu.data(), QStringLiteral("x")).write(bounds.x());
+ QQmlProperty(m_touchSelectionMenu.data(), QStringLiteral("y")).write(bounds.y());
+ QQmlProperty(m_touchSelectionMenu.data(), QStringLiteral("border.width")).write(spacing);
+
+ // Cut button
+ bool cutEnabled = menuController->isCommandEnabled(TouchSelectionMenuController::Cut);
+ QQmlProperty(m_touchSelectionMenu.data(), QStringLiteral("isCutEnabled")).write(cutEnabled);
+ if (cutEnabled) {
+ QQmlProperty cutSignal(m_touchSelectionMenu.data(), QStringLiteral("onCutTriggered"));
+ CHECK_QML_SIGNAL_PROPERTY(cutSignal, touchSelectionMenuComponent->url());
+ int cutIndex = menuController->metaObject()->indexOfSlot("cut()");
+ QObject::connect(m_touchSelectionMenu.data(), cutSignal.method(), menuController, menuController->metaObject()->method(cutIndex));
+ }
+
+ // Copy button
+ bool copyEnabled = menuController->isCommandEnabled(TouchSelectionMenuController::Copy);
+ QQmlProperty(m_touchSelectionMenu.data(), QStringLiteral("isCopyEnabled")).write(copyEnabled);
+ if (copyEnabled) {
+ QQmlProperty copySignal(m_touchSelectionMenu.data(), QStringLiteral("onCopyTriggered"));
+ CHECK_QML_SIGNAL_PROPERTY(copySignal, touchSelectionMenuComponent->url());
+ int copyIndex = menuController->metaObject()->indexOfSlot("copy()");
+ QObject::connect(m_touchSelectionMenu.data(), copySignal.method(), menuController, menuController->metaObject()->method(copyIndex));
+ }
+
+ // Paste button
+ bool pasteEnabled = menuController->isCommandEnabled(TouchSelectionMenuController::Paste);
+ QQmlProperty(m_touchSelectionMenu.data(), QStringLiteral("isPasteEnabled")).write(pasteEnabled);
+ if (pasteEnabled) {
+ QQmlProperty pasteSignal(m_touchSelectionMenu.data(), QStringLiteral("onPasteTriggered"));
+ CHECK_QML_SIGNAL_PROPERTY(pasteSignal, touchSelectionMenuComponent->url());
+ int pasteIndex = menuController->metaObject()->indexOfSlot("paste()");
+ QObject::connect(m_touchSelectionMenu.data(), pasteSignal.method(), menuController, menuController->metaObject()->method(pasteIndex));
+ }
+
+ // Context menu button
+ QQmlProperty contextMenuSignal(m_touchSelectionMenu.data(), QStringLiteral("onContextMenuTriggered"));
+ CHECK_QML_SIGNAL_PROPERTY(contextMenuSignal, touchSelectionMenuComponent->url());
+ int contextMenuIndex = menuController->metaObject()->indexOfSlot("runContextMenu()");
+ QObject::connect(m_touchSelectionMenu.data(), contextMenuSignal.method(), menuController, menuController->metaObject()->method(contextMenuIndex));
+
+ touchSelectionMenuComponent->completeCreate();
+}
+
+void UIDelegatesManager::hideTouchSelectionMenu()
+{
+ QTimer::singleShot(0, m_view, [this] { m_touchSelectionMenu.reset(); });
+}
+
+bool AutofillPopupEventFilter::eventFilter(QObject *object, QEvent *event)
+{
+ if (event->type() == QEvent::ShortcutOverride) {
+ QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
+ if (keyEvent->key() == Qt::Key_Escape) {
+ m_manager->hideAutofillPopup();
+ return true;
+ }
+
+ // Ignore shortcuts while the popup is open. It may result unwanted
+ // edit commands sent to Chromium that blocks the key press.
+ event->ignore();
+ return true;
+ }
+
+ // AutofillPopupControllerImpl::HandleKeyPressEvent()
+ // chrome/browser/ui/autofill/autofill_popup_controller_impl.cc
+
+ if (event->type() == QEvent::KeyPress) {
+ QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
+ switch (keyEvent->key()) {
+ case Qt::Key_Up:
+ m_controller->selectPreviousSuggestion();
+ return true;
+ case Qt::Key_Down:
+ m_controller->selectNextSuggestion();
+ return true;
+ case Qt::Key_PageUp:
+ m_controller->selectFirstSuggestion();
+ return true;
+ case Qt::Key_PageDown:
+ m_controller->selectLastSuggestion();
+ return true;
+ case Qt::Key_Escape:
+ m_manager->hideAutofillPopup();
+ return true;
+ case Qt::Key_Enter:
+ case Qt::Key_Return:
+ m_controller->acceptSuggestion();
+ return true;
+ case Qt::Key_Delete:
+ // Remove suggestion is not supported for datalist.
+ // Forward delete to view to be able to remove selected text.
+ break;
+ case Qt::Key_Tab:
+ m_controller->acceptSuggestion();
+ break;
+ default:
+ break;
+ }
+ }
+
+ // Do not forward release events of the overridden key presses.
+ if (event->type() == QEvent::KeyRelease) {
+ QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
+ switch (keyEvent->key()) {
+ case Qt::Key_Up:
+ case Qt::Key_Down:
+ case Qt::Key_PageUp:
+ case Qt::Key_PageDown:
+ case Qt::Key_Escape:
+ case Qt::Key_Enter:
+ case Qt::Key_Return:
+ return true;
+ default:
+ break;
+ }
+ }
+
+ return QObject::eventFilter(object, event);
+}
+
+void UIDelegatesManager::showAutofillPopup(QtWebEngineCore::AutofillPopupController *controller,
+ QPointF pos, int width, bool autoselectFirstSuggestion)
+{
+ static const int padding = 1;
+ static const int itemHeight = 20;
+ const int proposedHeight = itemHeight * (controller->model()->rowCount()) + padding * 2;
+
+ bool popupWasNull = false;
+ if (m_autofillPopup.isNull()) {
+ popupWasNull = true;
+ if (!ensureComponentLoaded(AutofillPopup))
+ return;
+
+ QQmlContext *context = qmlContext(m_view);
+ m_autofillPopup.reset(autofillPopupComponent->beginCreate(context));
+ if (QQuickItem *item = qobject_cast<QQuickItem *>(m_autofillPopup.data()))
+ item->setParentItem(m_view);
+ m_autofillPopup->setParent(m_view);
+ }
+
+ m_autofillPopup->setProperty("controller", QVariant::fromValue(controller));
+ m_autofillPopup->setProperty("x", pos.x());
+ m_autofillPopup->setProperty("y", pos.y());
+ m_autofillPopup->setProperty("width", width);
+ m_autofillPopup->setProperty("height",
+ std::min(proposedHeight, qRound(m_view->height() - pos.y())));
+ m_autofillPopup->setProperty("padding", padding);
+ m_autofillPopup->setProperty("itemHeight", itemHeight);
+
+ if (popupWasNull) {
+ QQmlProperty selectedSignal(m_autofillPopup.data(), QStringLiteral("onSelected"));
+ CHECK_QML_SIGNAL_PROPERTY(selectedSignal, autofillPopupComponent->url());
+ static int selectSuggestionIndex =
+ controller->metaObject()->indexOfSlot("selectSuggestion(int)");
+ QObject::connect(m_autofillPopup.data(), selectedSignal.method(), controller,
+ controller->metaObject()->method(selectSuggestionIndex));
+
+ QQmlProperty acceptedSignal(m_autofillPopup.data(), QStringLiteral("onAccepted"));
+ CHECK_QML_SIGNAL_PROPERTY(acceptedSignal, autofillPopupComponent->url());
+ static int acceptSuggestionIndex =
+ controller->metaObject()->indexOfSlot("acceptSuggestion()");
+ QObject::connect(m_autofillPopup.data(), acceptedSignal.method(), controller,
+ controller->metaObject()->method(acceptSuggestionIndex));
+
+ QObject::connect(controller, &QtWebEngineCore::AutofillPopupController::currentIndexChanged,
+ [this](const QModelIndex &index) {
+ QMetaObject::invokeMethod(m_autofillPopup.data(), "setCurrentIndex",
+ Qt::DirectConnection,
+ Q_ARG(QVariant, index.row()));
+ });
+
+ autofillPopupComponent->completeCreate();
+
+ m_view->window()->installEventFilter(
+ new AutofillPopupEventFilter(controller, this, m_autofillPopup.data()));
+
+ QMetaObject::invokeMethod(m_autofillPopup.data(), "open");
+ controller->notifyPopupShown();
+ }
+
+ if (autoselectFirstSuggestion)
+ controller->selectFirstSuggestion();
+}
+
+void UIDelegatesManager::hideAutofillPopup()
+{
+ if (!m_autofillPopup)
+ return;
+
+ QTimer::singleShot(0, m_view, [this] {
+ if (m_autofillPopup) {
+ QtWebEngineCore::AutofillPopupController *controller =
+ m_autofillPopup->property("controller")
+ .value<QtWebEngineCore::AutofillPopupController *>();
+ m_autofillPopup.reset();
+ controller->notifyPopupHidden();
+ }
+ });
+}
+
+bool UIDelegatesManager::initializeImportDirs(QStringList &dirs, QQmlEngine *engine)
+{
+ const QStringList paths = engine->importPathList();
+ for (const QString &path : paths) {
+ QString controlsImportPath = path % QLatin1String("/QtWebEngine/ControlsDelegates/");
+
+ // resource paths have to be tested using the ":/" prefix
+ if (controlsImportPath.startsWith(QLatin1String("qrc:/"))) {
+ controlsImportPath.remove(0, 3);
+ }
+
+ QFileInfo fi(controlsImportPath);
+ if (fi.exists()) {
+ dirs << fi.absolutePath();
+
+ // add subdirectories
+ QDirIterator it(controlsImportPath, QDir::AllDirs | QDir::NoDotAndDotDot, QDirIterator::Subdirectories);
+ while (it.hasNext())
+ dirs << QFileInfo(it.next()).absoluteFilePath();
+ }
+ }
+ return !dirs.isEmpty();
+}
+
+QObject *UIDelegatesManager::addMenu(QObject *parentMenu, const QString &title, const QPoint &pos)
+{
+ Q_ASSERT(parentMenu);
+ if (!ensureComponentLoaded(Menu))
+ return nullptr;
+ QQmlContext *context = qmlContext(m_view);
+ QObject *menu = menuComponent->beginCreate(context);
+
+ // set visual parent for non-Window-based menus
+ if (QQuickItem *item = qobject_cast<QQuickItem*>(menu))
+ item->setParentItem(m_view);
+
+ if (!title.isEmpty())
+ menu->setProperty("title", title);
+ if (!pos.isNull()) {
+ menu->setProperty("x", pos.x());
+ menu->setProperty("y", pos.y());
+ }
+
+ menu->setParent(parentMenu);
+ QQmlProperty doneSignal(menu, QStringLiteral("onDone"));
+ CHECK_QML_SIGNAL_PROPERTY(doneSignal, menuComponent->url())
+ static int deleteLaterIndex = menu->metaObject()->indexOfSlot("deleteLater()");
+ QObject::connect(menu, doneSignal.method(), menu, menu->metaObject()->method(deleteLaterIndex));
+ menuComponent->completeCreate();
+ return menu;
+}
+
+void UIDelegatesManager::addMenuItem(QQuickWebEngineAction *action, QObject *menu, bool checkable, bool checked)
+{
+ Q_ASSERT(action);
+ if (!ensureComponentLoaded(MenuItem))
+ return;
+
+ QObject *it = menuItemComponent->beginCreate(qmlContext(m_view));
+
+ it->setProperty("text", action->text());
+ it->setProperty("enabled", action->isEnabled());
+ it->setProperty("checked", checked);
+ it->setProperty("checkable", checkable);
+
+ QQmlProperty signal(it, QStringLiteral("onTriggered"));
+ CHECK_QML_SIGNAL_PROPERTY(signal, menuItemComponent->url());
+ const QMetaObject *actionMeta = action->metaObject();
+ QObject::connect(it, signal.method(), action, actionMeta->method(actionMeta->indexOfSlot("trigger()")));
+ menuItemComponent->completeCreate();
+
+ it->setParent(menu);
+
+ QQmlListReference entries(menu, defaultPropertyName(menu));
+ if (entries.isValid())
+ entries.append(it);
+}
+
+void UIDelegatesManager::showMenu(QObject *menu)
+{
+ QMetaObject::invokeMethod(menu, "open");
+}
+
+} // namespace QtWebEngineCore
diff --git a/src/webenginequick/ui_delegates_manager.h b/src/webenginequick/ui_delegates_manager.h
new file mode 100644
index 000000000..24dde656c
--- /dev/null
+++ b/src/webenginequick/ui_delegates_manager.h
@@ -0,0 +1,130 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef UI_DELEGATES_MANAGER_H
+#define UI_DELEGATES_MANAGER_H
+
+#include <QtCore/qcoreapplication.h> // Q_DECLARE_TR_FUNCTIONS
+#include <QtCore/qobject.h>
+#include <QtCore/qpoint.h>
+#include <QtCore/qscopedpointer.h>
+#include <QtCore/qsharedpointer.h>
+#include <QtCore/qstring.h>
+#include <QtCore/qstringlist.h>
+
+// clang-format off
+#define FOR_EACH_COMPONENT_TYPE(F, SEPARATOR) \
+ F(Menu, menu) SEPARATOR \
+ F(MenuItem, menuItem) SEPARATOR \
+ F(MenuSeparator, menuSeparator) SEPARATOR \
+ F(AlertDialog, alertDialog) SEPARATOR \
+ F(ColorDialog, colorDialog) SEPARATOR \
+ F(ConfirmDialog, confirmDialog) SEPARATOR \
+ F(PromptDialog, promptDialog) SEPARATOR \
+ F(FilePicker, filePicker) SEPARATOR \
+ F(DirectoryPicker, directoryPicker) SEPARATOR \
+ F(AuthenticationDialog, authenticationDialog) SEPARATOR \
+ F(ToolTip, toolTip) SEPARATOR \
+ F(TouchHandle, touchHandle) SEPARATOR \
+ F(TouchSelectionMenu, touchSelectionMenu) SEPARATOR \
+ F(AutofillPopup, autofillPopup) SEPARATOR
+
+#define COMMA_SEPARATOR ,
+#define SEMICOLON_SEPARATOR ;
+#define ENUM_DECLARATION(TYPE, COMPONENT) \
+ TYPE
+#define MEMBER_DECLARATION(TYPE, COMPONENT) \
+ QQmlComponent *COMPONENT##Component
+// clang-format on
+
+QT_BEGIN_NAMESPACE
+class QEvent;
+class QQmlComponent;
+class QQmlContext;
+class QQmlEngine;
+class QQuickItem;
+class QQuickWebEngineAction;
+class QQuickWebEngineView;
+QT_END_NAMESPACE
+
+namespace QtWebEngineCore {
+class AuthenticationDialogController;
+class AutofillPopupController;
+class ColorChooserController;
+class FilePickerController;
+class JavaScriptDialogController;
+class TouchSelectionMenuController;
+
+const char *defaultPropertyName(QObject *obj);
+
+class UIDelegatesManager
+{
+ Q_DECLARE_TR_FUNCTIONS(UIDelegatesManager)
+public:
+ enum ComponentType {
+ Invalid = -1,
+ FOR_EACH_COMPONENT_TYPE(ENUM_DECLARATION, COMMA_SEPARATOR)
+ ComponentTypeCount
+ };
+
+ UIDelegatesManager(QQuickWebEngineView *);
+ virtual ~UIDelegatesManager();
+
+ virtual bool initializeImportDirs(QStringList &dirs, QQmlEngine *engine);
+ virtual void addMenuItem(QQuickWebEngineAction *action, QObject *menu,
+ bool checkable = false, bool checked = true);
+ void addMenuSeparator(QObject *menu);
+ virtual QObject *addMenu(QObject *parentMenu, const QString &title,
+ const QPoint &pos = QPoint());
+ QQmlContext *creationContextForComponent(QQmlComponent *);
+ void showColorDialog(QSharedPointer<ColorChooserController>);
+ void showDialog(QSharedPointer<JavaScriptDialogController>);
+ void showDialog(QSharedPointer<AuthenticationDialogController>);
+ void showFilePicker(QSharedPointer<FilePickerController>);
+ void showDirectoryPicker(QSharedPointer<FilePickerController>);
+ virtual void showMenu(QObject *menu);
+ void showToolTip(const QString &text);
+ QQuickItem *createTouchHandle();
+ void showTouchSelectionMenu(TouchSelectionMenuController *, const QRect &, const int spacing);
+ void hideTouchSelectionMenu();
+ void showAutofillPopup(QtWebEngineCore::AutofillPopupController *controller, QPointF pos,
+ int width, bool autoselectFirstSuggestion);
+ void hideAutofillPopup();
+
+private:
+ bool ensureComponentLoaded(ComponentType);
+
+ QQuickWebEngineView *m_view;
+ QStringList m_importDirs;
+ QScopedPointer<QObject> m_toolTip;
+ QScopedPointer<QObject> m_touchSelectionMenu;
+ QScopedPointer<QObject> m_autofillPopup;
+
+ FOR_EACH_COMPONENT_TYPE(MEMBER_DECLARATION, SEMICOLON_SEPARATOR)
+
+ Q_DISABLE_COPY(UIDelegatesManager)
+
+};
+
+class AutofillPopupEventFilter : public QObject
+{
+ Q_OBJECT
+
+public:
+ AutofillPopupEventFilter(QtWebEngineCore::AutofillPopupController *controller,
+ UIDelegatesManager *manager, QObject *parent)
+ : QObject(parent), m_controller(controller), m_manager(manager)
+ {
+ }
+
+protected:
+ bool eventFilter(QObject *object, QEvent *event) override;
+
+private:
+ QtWebEngineCore::AutofillPopupController *m_controller;
+ UIDelegatesManager *m_manager;
+};
+
+} // namespace QtWebEngineCore
+
+#endif // UI_DELEGATES_MANAGER_H
diff --git a/src/webenginewidgets/CMakeLists.txt b/src/webenginewidgets/CMakeLists.txt
new file mode 100644
index 000000000..dd11e48be
--- /dev/null
+++ b/src/webenginewidgets/CMakeLists.txt
@@ -0,0 +1,46 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+if(TARGET Qt::Designer)
+ add_subdirectory(plugins/qwebengineview)
+else()
+ message(WARNING "Qt tools Designer is required to compile designer plugin")
+endif()
+qt_internal_add_module(WebEngineWidgets
+ SOURCES
+ api/qtwebenginewidgetsglobal.h
+ api/qwebenginenotificationpresenter.cpp api/qwebenginenotificationpresenter_p.h
+ api/qwebengineview.cpp api/qwebengineview.h api/qwebengineview_p.h
+ ui/autofillpopupwidget.cpp ui/autofillpopupwidget_p.h
+ ui/touchhandlewidget.cpp ui/touchhandlewidget_p.h
+ ui/touchselectionmenuwidget.cpp ui/touchselectionmenuwidget_p.h
+ DEFINES
+ QT_BUILD_WEBENGINEWIDGETS_LIB
+ INCLUDE_DIRECTORIES
+ ../core
+ api
+ ui
+ LIBRARIES
+ Qt::CorePrivate
+ Qt::GuiPrivate
+ Qt::QuickWidgets
+ Qt::WidgetsPrivate
+ Qt::WebEngineCorePrivate
+ Qt::QuickPrivate
+ PUBLIC_LIBRARIES
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+ Qt::WebEngineCore
+ NO_GENERATE_CPP_EXPORTS
+)
+
+qt_internal_extend_target(WebEngineWidgets CONDITION QT_FEATURE_accessibility
+ SOURCES
+ qwebengine_accessible.cpp qwebengine_accessible.h
+)
+
+qt_internal_extend_target(WebEngineWidgets CONDITION QT_FEATURE_webengine_printing_and_pdf
+ PUBLIC_LIBRARIES
+ Qt::PrintSupport
+)
diff --git a/src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp b/src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp
deleted file mode 100644
index 5949f3d6e..000000000
--- a/src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qtwebenginewidgetsglobal.h"
-
-#include <QCoreApplication>
-#include <QOpenGLContext>
-
-namespace QtWebEngineCore
-{
- extern void initialize();
-}
-
-QT_BEGIN_NAMESPACE
-
-#if QT_CONFIG(opengl)
-Q_GUI_EXPORT QOpenGLContext *qt_gl_global_share_context();
-#endif
-
-static void initialize()
-{
-#if QT_CONFIG(opengl)
- if (QCoreApplication::instance()) {
- //On window/ANGLE, calling QtWebEngine::initialize from DllMain will result in a crash.
- if (!qt_gl_global_share_context()) {
- qWarning("Qt WebEngine seems to be initialized from a plugin. Please "
- "set Qt::AA_ShareOpenGLContexts using QCoreApplication::setAttribute "
- "before constructing QGuiApplication.");
- }
- return;
- }
- //QCoreApplication is not yet instantiated, ensuring the call will be deferred
- qAddPreRoutine(QtWebEngineCore::initialize);
-#endif // QT_CONFIG(opengl)
-}
-
-Q_CONSTRUCTOR_FUNCTION(initialize)
-
-QT_END_NAMESPACE
diff --git a/src/webenginewidgets/api/qtwebenginewidgetsglobal.h b/src/webenginewidgets/api/qtwebenginewidgetsglobal.h
index 128704578..58b9c7a2b 100644
--- a/src/webenginewidgets/api/qtwebenginewidgetsglobal.h
+++ b/src/webenginewidgets/api/qtwebenginewidgetsglobal.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QTWEBENGINEWIDGETSGLOBAL_H
#define QTWEBENGINEWIDGETSGLOBAL_H
diff --git a/src/webenginewidgets/api/qwebenginecertificateerror.cpp b/src/webenginewidgets/api/qwebenginecertificateerror.cpp
deleted file mode 100644
index d86019af8..000000000
--- a/src/webenginewidgets/api/qwebenginecertificateerror.cpp
+++ /dev/null
@@ -1,266 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qwebenginecertificateerror.h"
-
-#include "certificate_error_controller.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QWebEngineCertificateError
- \brief The QWebEngineCertificateError class provides information about a certificate error.
- \since 5.4
- \inmodule QtWebEngineWidgets
-
- Provides information about a certificate error. This class is used as a parameter of
- QWebEnginePage::certificateError().
-*/
-
-class QWebEngineCertificateErrorPrivate : public QSharedData {
-public:
- QWebEngineCertificateErrorPrivate(int error, QUrl url, bool overridable, QString errorDescription);
-
- ~QWebEngineCertificateErrorPrivate() {
- if (deferred && !answered)
- rejectCertificate();
- }
-
- void resolveError(bool accept) {
- if (answered)
- return;
- answered = true;
- if (overridable) {
- if (auto ctl = controller.lock())
- ctl->accept(accept);
- }
- }
-
- void ignoreCertificateError() { resolveError(true); }
- void rejectCertificate() { resolveError(false); }
-
- QWebEngineCertificateError::Error error;
- QUrl url;
- bool overridable;
- QString errorDescription;
- QList<QSslCertificate> certificateChain;
-
- bool answered = false, deferred = false;
- QWeakPointer<CertificateErrorController> controller;
-
- Q_DISABLE_COPY(QWebEngineCertificateErrorPrivate)
-};
-
-QWebEngineCertificateErrorPrivate::QWebEngineCertificateErrorPrivate(int error, QUrl url, bool overridable, QString errorDescription)
- : error(QWebEngineCertificateError::Error(error))
- , url(url)
- , overridable(overridable)
- , errorDescription(errorDescription)
-{ }
-
-/*! \internal
-*/
-QWebEngineCertificateError::QWebEngineCertificateError(int error, QUrl url, bool overridable, QString errorDescription)
- : d(new QWebEngineCertificateErrorPrivate(error, url, overridable, errorDescription))
-{ }
-
-/*! \internal
-*/
-QWebEngineCertificateError::QWebEngineCertificateError(const QSharedPointer<CertificateErrorController> &controller)
- : d(new QWebEngineCertificateErrorPrivate(controller->error(), controller->url(),
- controller->overridable(), controller->errorString()))
-{
- d->controller = controller;
- d->certificateChain = controller->certificateChain();
-}
-
-QWebEngineCertificateError::QWebEngineCertificateError(const QWebEngineCertificateError &) = default;
-
-QWebEngineCertificateError& QWebEngineCertificateError::operator=(const QWebEngineCertificateError &) = default;
-
-/*! \internal
-*/
-QWebEngineCertificateError::~QWebEngineCertificateError()
-{
-
-}
-
-/*!
- \enum QWebEngineCertificateError::Error
-
- This enum describes the type of certificate error encountered.
-
- The values of this enum type match the SSL errors Chromium provides.
- QSslError::SslError values are not used directly, because the Qt error
- categories cannot be mapped to the Chromium error categories.
-
- \value SslPinnedKeyNotInCertificateChain The certificate did not match the built-in public keys
- pinned for the host name.
- \value CertificateCommonNameInvalid The certificate's common name did not match the host name.
- \value CertificateDateInvalid The certificate is not valid at the current date and time.
- \value CertificateAuthorityInvalid The certificate is not signed by a trusted authority.
- \value CertificateContainsErrors The certificate contains errors.
- \value CertificateNoRevocationMechanism The certificate has no mechanism for determining if it has been revoked.
- \value CertificateUnableToCheckRevocation Revocation information for the certificate is not available.
- \value CertificateRevoked The certificate has been revoked.
- \value CertificateInvalid The certificate is invalid.
- \value CertificateWeakSignatureAlgorithm The certificate is signed using a weak signature algorithm.
- \value CertificateNonUniqueName The host name specified in the certificate is not unique.
- \value CertificateWeakKey The certificate contains a weak key.
- \value CertificateNameConstraintViolation The certificate claimed DNS names that are in violation of name constraints.
- \value CertificateValidityTooLong The certificate has a validity period that is too long. (Added in Qt 5.7)
- \value CertificateTransparencyRequired Certificate Transparency was required for this connection, but the server
- did not provide CT information that complied with the policy. (Added in Qt 5.8)
- \value CertificateKnownInterceptionBlocked The certificate is known to be
- used for interception by an entity other the device owner. (Added in
- 5.15)
-*/
-
-/*!
- Returns whether this error can be overridden and accepted.
-
- \sa error(), errorDescription()
-*/
-bool QWebEngineCertificateError::isOverridable() const
-{
- return d->overridable;
-}
-
-/*!
- Returns the URL that triggered the error.
-
- \sa error(), errorDescription()
-*/
-QUrl QWebEngineCertificateError::url() const
-{
- return d->url;
-}
-
-/*!
- Returns the type of the error.
-
- \sa errorDescription(), isOverridable()
-*/
-QWebEngineCertificateError::Error QWebEngineCertificateError::error() const
-{
- return d->error;
-}
-
-/*!
- Returns a short localized human-readable description of the error.
-
- \sa error(), url(), isOverridable()
-*/
-QString QWebEngineCertificateError::errorDescription() const
-{
- return d->errorDescription;
-}
-
-/*!
- \since 5.14
-
- Marks the certificate error for delayed handling.
-
- This function should be called when there is a need to postpone the decision whether to ignore a
- certificate error, for example, while waiting for user input. When called, the function pauses the
- URL request until ignoreCertificateError() or rejectCertificate() is called.
-
- \note It is only possible to defer overridable certificate errors.
-
- \sa isOverridable(), deferred()
-*/
-void QWebEngineCertificateError::defer()
-{
- if (isOverridable())
- d->deferred = true;
-}
-
-/*!
- \since 5.14
-
- Returns whether the decision for error handling was delayed and the URL load was halted.
-*/
-bool QWebEngineCertificateError::deferred() const
-{
- return d->deferred;
-}
-
-/*!
- \since 5.14
-
- Ignores the certificate error and continues the loading of the requested URL.
-*/
-void QWebEngineCertificateError::ignoreCertificateError()
-{
- d->ignoreCertificateError();
-}
-
-/*!
- \since 5.14
-
- Rejects the certificate and aborts the loading of the requested URL.
-*/
-void QWebEngineCertificateError::rejectCertificate()
-{
- d->rejectCertificate();
-}
-
-/*!
- \since 5.14
-
- Returns \c true if the error was explicitly rejected or ignored.
-*/
-bool QWebEngineCertificateError::answered() const
-{
- return d->answered;
-}
-
-/*!
- \since 5.14
-
- Returns the peer's chain of digital certificates.
-
- Chain starts with the peer's immediate certificate and ending with the CA's certificate.
-*/
-QList<QSslCertificate> QWebEngineCertificateError::certificateChain() const
-{
- return d->certificateChain;
-}
-
-QT_END_NAMESPACE
diff --git a/src/webenginewidgets/api/qwebenginecertificateerror.h b/src/webenginewidgets/api/qwebenginecertificateerror.h
deleted file mode 100644
index a32f7ab8e..000000000
--- a/src/webenginewidgets/api/qwebenginecertificateerror.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWEBENGINECERTIFICATEERROR_H
-#define QWEBENGINECERTIFICATEERROR_H
-
-#include <QtWebEngineWidgets/qtwebenginewidgetsglobal.h>
-
-#include <QtCore/qsharedpointer.h>
-#include <QtCore/qurl.h>
-#include <QtNetwork/QSslCertificate>
-
-QT_BEGIN_NAMESPACE
-
-class CertificateErrorController;
-class QWebEngineCertificateErrorPrivate;
-
-class QWEBENGINEWIDGETS_EXPORT QWebEngineCertificateError {
-public:
- QWebEngineCertificateError(int error, QUrl url, bool overridable, QString errorDescription);
- ~QWebEngineCertificateError();
-
- // Keep this identical to CertificateErrorController::CertificateError, or add mapping layer.
- enum Error {
- SslPinnedKeyNotInCertificateChain = -150,
- CertificateCommonNameInvalid = -200,
- CertificateDateInvalid = -201,
- CertificateAuthorityInvalid = -202,
- CertificateContainsErrors = -203,
- CertificateNoRevocationMechanism = -204,
- CertificateUnableToCheckRevocation = -205,
- CertificateRevoked = -206,
- CertificateInvalid = -207,
- CertificateWeakSignatureAlgorithm = -208,
- CertificateNonUniqueName = -210,
- CertificateWeakKey = -211,
- CertificateNameConstraintViolation = -212,
- CertificateValidityTooLong = -213,
- CertificateTransparencyRequired = -214,
- CertificateKnownInterceptionBlocked = -217,
- };
-
- Error error() const;
- QUrl url() const;
- bool isOverridable() const;
- QString errorDescription() const;
-
- QWebEngineCertificateError(const QWebEngineCertificateError &other);
- QWebEngineCertificateError& operator=(const QWebEngineCertificateError &other);
-
- void defer();
- bool deferred() const;
-
- void rejectCertificate();
- void ignoreCertificateError();
- bool answered() const;
-
- QList<QSslCertificate> certificateChain() const;
-
-private:
- friend class QWebEnginePagePrivate;
- QWebEngineCertificateError(const QSharedPointer<CertificateErrorController> &controller);
- QExplicitlySharedDataPointer<QWebEngineCertificateErrorPrivate> d;
-};
-
-QT_END_NAMESPACE
-
-#endif // QWEBENGINECERTIFICATEERROR_H
diff --git a/src/webenginewidgets/api/qwebengineclientcertificateselection.cpp b/src/webenginewidgets/api/qwebengineclientcertificateselection.cpp
deleted file mode 100644
index 9eca01bbe..000000000
--- a/src/webenginewidgets/api/qwebengineclientcertificateselection.cpp
+++ /dev/null
@@ -1,127 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qwebengineclientcertificateselection.h"
-
-#if !defined(QT_NO_SSL) || QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
-
-#include "client_cert_select_controller.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QWebEngineClientCertificateSelection
- \brief The QWebEngineClientCertSelection class wraps a client certificate selection.
- \since 5.12
- \inmodule QtWebEngineWidgets
-
- When a web site requests an SSL client certificate, and one or more certificates
- are found in the system's client certificate store, this class provides access to
- the certificates to choose from, as well as a method for selecting one.
-
- The selection is asynchronous. If no certificate is selected and no copy of the
- object is kept alive, loading will continue without a certificate.
-
- \sa QWebEnginePage::selectClientCertificate()
-*/
-
-/*! \internal
-*/
-QWebEngineClientCertificateSelection::QWebEngineClientCertificateSelection(QSharedPointer<ClientCertSelectController> selectController)
- : d_ptr(selectController)
-{}
-
-QWebEngineClientCertificateSelection::QWebEngineClientCertificateSelection(const QWebEngineClientCertificateSelection &other)
- : d_ptr(other.d_ptr)
-{}
-
-QWebEngineClientCertificateSelection &QWebEngineClientCertificateSelection::operator=(const QWebEngineClientCertificateSelection &other)
-{
- d_ptr = other.d_ptr;
- return *this;
-}
-
-QWebEngineClientCertificateSelection::~QWebEngineClientCertificateSelection()
-{
-}
-
-/*!
- Returns the client certificates available to choose from.
-
- \sa select()
-*/
-QVector<QSslCertificate> QWebEngineClientCertificateSelection::certificates() const
-{
- return d_ptr->certificates();
-}
-
-/*!
- Selects the client certificate \a certificate. The certificate must be one
- of those offered in certificates().
-
- \sa certificates(), selectNone()
-*/
-void QWebEngineClientCertificateSelection::select(const QSslCertificate &certificate)
-{
- d_ptr->select(certificate);
-}
-
-/*!
- Continue without using any of the offered certificates. This is the same
- action as taken when destroying the last copy of this object if no
- selection has been made.
-
- \sa select()
-*/
-void QWebEngineClientCertificateSelection::selectNone()
-{
- d_ptr->selectNone();
-}
-
-/*!
- Returns the host and port of the server requesting the client certificate.
-*/
-QUrl QWebEngineClientCertificateSelection::host() const
-{
- return d_ptr->hostAndPort();
-}
-
-QT_END_NAMESPACE
-
-#endif // !defined(QT_NO_SSL) || QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
diff --git a/src/webenginewidgets/api/qwebengineclientcertificateselection.h b/src/webenginewidgets/api/qwebengineclientcertificateselection.h
deleted file mode 100644
index d451d09ae..000000000
--- a/src/webenginewidgets/api/qwebengineclientcertificateselection.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWEBENGINECLIENTCERTSELECTION_H
-#define QWEBENGINECLIENTCERTSELECTION_H
-
-#include <QtWebEngineWidgets/qtwebenginewidgetsglobal.h>
-#include <QtNetwork/qtnetwork-config.h>
-
-#if !defined(QT_NO_SSL) || QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
-
-#include <QtCore/qscopedpointer.h>
-#include <QtCore/qvector.h>
-#include <QtNetwork/qsslcertificate.h>
-
-QT_BEGIN_NAMESPACE
-class ClientCertSelectController;
-
-class QWEBENGINEWIDGETS_EXPORT QWebEngineClientCertificateSelection {
-public:
- QWebEngineClientCertificateSelection(const QWebEngineClientCertificateSelection &);
- ~QWebEngineClientCertificateSelection();
-
- QWebEngineClientCertificateSelection &operator=(const QWebEngineClientCertificateSelection &);
-
- QUrl host() const;
-
- void select(const QSslCertificate &certificate);
- void selectNone();
- QVector<QSslCertificate> certificates() const;
-
-private:
- friend class QWebEnginePagePrivate;
-
- QWebEngineClientCertificateSelection(QSharedPointer<ClientCertSelectController>);
-
- QSharedPointer<ClientCertSelectController> d_ptr;
-};
-
-QT_END_NAMESPACE
-
-#endif // !defined(QT_NO_SSL) || QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
-
-#endif // QWEBENGINECLIENTCERTSELECTION_H
diff --git a/src/webenginewidgets/api/qwebenginecontextmenudata.cpp b/src/webenginewidgets/api/qwebenginecontextmenudata.cpp
deleted file mode 100644
index 377ffe1b5..000000000
--- a/src/webenginewidgets/api/qwebenginecontextmenudata.cpp
+++ /dev/null
@@ -1,306 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qwebenginecontextmenudata.h"
-
-#include "web_contents_adapter_client.h"
-
-QT_BEGIN_NAMESPACE
-
-// Match MediaType enum
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypeNone, QWebEngineContextMenuData::MediaTypeNone)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypeImage, QWebEngineContextMenuData::MediaTypeImage)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypeAudio, QWebEngineContextMenuData::MediaTypeAudio)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypeVideo, QWebEngineContextMenuData::MediaTypeVideo)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypeCanvas, QWebEngineContextMenuData::MediaTypeCanvas)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypeFile, QWebEngineContextMenuData::MediaTypeFile)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypePlugin, QWebEngineContextMenuData::MediaTypePlugin)
-
-// Match MediaFlag enum
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaInError, QWebEngineContextMenuData::MediaInError)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaPaused, QWebEngineContextMenuData::MediaPaused)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaMuted, QWebEngineContextMenuData::MediaMuted)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaLoop, QWebEngineContextMenuData::MediaLoop)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaCanSave, QWebEngineContextMenuData::MediaCanSave)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaHasAudio, QWebEngineContextMenuData::MediaHasAudio)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaCanToggleControls, QWebEngineContextMenuData::MediaCanToggleControls)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaControls, QWebEngineContextMenuData::MediaControls)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaCanPrint, QWebEngineContextMenuData::MediaCanPrint)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaCanRotate, QWebEngineContextMenuData::MediaCanRotate)
-
-// Match EditFlag enum
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::CanUndo, QWebEngineContextMenuData::CanUndo)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::CanRedo, QWebEngineContextMenuData::CanRedo)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::CanCut, QWebEngineContextMenuData::CanCut)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::CanCopy, QWebEngineContextMenuData::CanCopy)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::CanPaste, QWebEngineContextMenuData::CanPaste)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::CanDelete, QWebEngineContextMenuData::CanDelete)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::CanSelectAll, QWebEngineContextMenuData::CanSelectAll)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::CanTranslate, QWebEngineContextMenuData::CanTranslate)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::CanEditRichly, QWebEngineContextMenuData::CanEditRichly)
-
-/*!
- \class QWebEngineContextMenuData
- \since 5.7
- \brief The QWebEngineContextMenuData class provides context data for populating or extending a context menu with actions.
-
- \inmodule QtWebEngineWidgets
-
- QWebEngineContextMenuData is returned by QWebEnginePage::contextMenuData() after a context menu event,
- and contains information about where the context menu event took place. This is also in the context
- in which any context specific QWebEnginePage::WebAction will be performed.
-*/
-
-/*!
- \enum QWebEngineContextMenuData::MediaType
-
- This enum describes the media type of the context if any.
-
- \value MediaTypeNone The context is not a media type.
- \value MediaTypeImage The context is an image element.
- \value MediaTypeVideo The context is a video element.
- \value MediaTypeAudio The context is an audio element.
- \value MediaTypeCanvas The context is a canvas element.
- \value MediaTypeFile The context is a file.
- \value MediaTypePlugin The context is a plugin element.
-*/
-
-/*!
- \enum QWebEngineContextMenuData::EditFlag
- \readonly
- \since 5.11
-
- The available edit operations in the current context.
-
- \value CanUndo Undo is available.
- \value CanRedo Redo is available.
- \value CanCut Cut is available.
- \value CanCopy Copy is available.
- \value CanPaste Paste is available.
- \value CanDelete Delete is available.
- \value CanSelectAll Select All is available.
- \value CanTranslate Translate is available.
- \value CanEditRichly Context is richly editable.
-*/
-
-/*!
- \enum QWebEngineContextMenuData::MediaFlag
- \readonly
- \since 5.11
-
- The current media element's status and its available operations.
- \c MediaNone if the selected web page content is not a media element.
-
- \value MediaInError An error occurred.
- \value MediaPaused Media is paused.
- \value MediaMuted Media is muted.
- \value MediaLoop Media can be looped.
- \value MediaCanSave Media can be saved.
- \value MediaHasAudio Media has audio.
- \value MediaCanToggleControls Media can show controls.
- \value MediaControls Media controls are shown.
- \value MediaCanPrint Media is printable.
- \value MediaCanRotate Media is rotatable.
-*/
-
-/*!
- Constructs null context menu data.
-*/
-QWebEngineContextMenuData::QWebEngineContextMenuData() : d(nullptr)
-{
-}
-
-/*!
- Constructs context menu data from \a other.
-*/
-QWebEngineContextMenuData::QWebEngineContextMenuData(const QWebEngineContextMenuData &other)
-{
- d = new QtWebEngineCore::WebEngineContextMenuData(*other.d);
-}
-
-/*!
- Assigns the \a other context menu data to this.
-*/
-QWebEngineContextMenuData &QWebEngineContextMenuData::operator=(const QWebEngineContextMenuData &other)
-{
- delete d;
- d = new QtWebEngineCore::WebEngineContextMenuData(*other.d);
- return *this;
-}
-
-/*!
- Destroys the context menu data.
-*/
-QWebEngineContextMenuData::~QWebEngineContextMenuData()
-{
- delete d;
-}
-
-/*!
- Returns \c true if the context data is valid; otherwise returns \c false.
-*/
-bool QWebEngineContextMenuData::isValid() const
-{
- return d;
-}
-
-/*!
- Resets the context data, making it invalid.
- \internal
-
- \sa isValid()
-*/
-void QWebEngineContextMenuData::reset()
-{
- delete d;
- d = nullptr;
-}
-
-/*!
- Returns the position of the context, usually the mouse position where the context menu event was triggered.
-*/
-QPoint QWebEngineContextMenuData::position() const
-{
- return d ? d->position() : QPoint();
-}
-
-/*!
- Returns the text of a link if the context is a link.
-*/
-QString QWebEngineContextMenuData::linkText() const
-{
- return d ? d->linkText() : QString();
-}
-
-/*!
- Returns the URL of a link if the context is a link.
- It is not guaranteed to be a valid URL.
-*/
-QUrl QWebEngineContextMenuData::linkUrl() const
-{
- return d ? d->unfilteredLinkUrl() : QUrl();
-}
-
-/*!
- Returns the selected text of the context.
-*/
-QString QWebEngineContextMenuData::selectedText() const
-{
- return d ? d->selectedText() : QString();
-}
-
-/*!
- If the context is a media element, returns the URL of that media.
-*/
-QUrl QWebEngineContextMenuData::mediaUrl() const
-{
- return d ? d->mediaUrl() : QUrl();
-}
-
-/*!
- Returns the type of the media element or \c MediaTypeNone if the context is not a media element.
-*/
-QWebEngineContextMenuData::MediaType QWebEngineContextMenuData::mediaType() const
-{
- return d ? static_cast<QWebEngineContextMenuData::MediaType>(d->mediaType()) : MediaTypeNone;
-}
-
-/*!
- Returns \c true if the content is editable by the user; otherwise returns \c false.
-*/
-bool QWebEngineContextMenuData::isContentEditable() const
-{
- return d ? d->isEditable() : false;
-}
-
-/*!
- If the context is a word considered misspelled by the spell-checker, returns the misspelled word.
-
- For possible replacements of the word, see spellCheckerSuggestions().
-
- \since 5.8
-*/
-QString QWebEngineContextMenuData::misspelledWord() const
-{
- if (d)
- return d->misspelledWord();
- return QString();
-}
-
-/*!
- If the context is a word considered misspelled by the spell-checker, returns a list of suggested replacements
- for misspelledWord().
-
- \since 5.8
-*/
-QStringList QWebEngineContextMenuData::spellCheckerSuggestions() const
-{
- if (d)
- return d->spellCheckerSuggestions();
- return QStringList();
-}
-
-/*!
- \internal
-*/
-QWebEngineContextMenuData &QWebEngineContextMenuData::operator=(const QWebEngineContextDataPrivate &priv)
-{
- delete d;
- d = new QtWebEngineCore::WebEngineContextMenuData(priv);
- return *this;
-}
-
-/*!
- Returns the current media element's status and its available operations.
- \c MediaNone if the selected web page content is not a media element.
-*/
-QWebEngineContextMenuData::MediaFlags QWebEngineContextMenuData::mediaFlags() const
-{
- return static_cast<QWebEngineContextMenuData::MediaFlags>(d->mediaFlags());
-}
-
-/*!
- Returns the available edit operations in the current context or \c CanDoNone if no actions are available.
-*/
-QWebEngineContextMenuData::EditFlags QWebEngineContextMenuData::editFlags() const
-{
- return static_cast<QWebEngineContextMenuData::EditFlags>(d->editFlags());
-}
-
-QT_END_NAMESPACE
diff --git a/src/webenginewidgets/api/qwebenginecontextmenudata.h b/src/webenginewidgets/api/qwebenginecontextmenudata.h
deleted file mode 100644
index 5834df31a..000000000
--- a/src/webenginewidgets/api/qwebenginecontextmenudata.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWEBENGINECONTEXTDATA_H
-#define QWEBENGINECONTEXTDATA_H
-
-#include <QtWebEngineWidgets/qtwebenginewidgetsglobal.h>
-#include <QtCore/qpoint.h>
-#include <QtCore/qstring.h>
-#include <QtCore/qurl.h>
-
-namespace QtWebEngineCore {
-class WebEngineContextMenuData;
-}
-
-QT_BEGIN_NAMESPACE
-
-class QWEBENGINEWIDGETS_EXPORT QWebEngineContextMenuData {
- Q_GADGET
-
-public:
- QWebEngineContextMenuData();
- QWebEngineContextMenuData(const QWebEngineContextMenuData &other);
- QWebEngineContextMenuData &operator=(const QWebEngineContextMenuData &other);
- ~QWebEngineContextMenuData();
-
- enum MediaType {
- MediaTypeNone,
- MediaTypeImage,
- MediaTypeVideo,
- MediaTypeAudio,
- MediaTypeCanvas,
- MediaTypeFile,
- MediaTypePlugin
- };
-
- // Must match QWebEngineCore::WebEngineContextMenuData::MediaFlags:
- enum MediaFlag {
- MediaInError = 0x1,
- MediaPaused = 0x2,
- MediaMuted = 0x4,
- MediaLoop = 0x8,
- MediaCanSave = 0x10,
- MediaHasAudio = 0x20,
- MediaCanToggleControls = 0x40,
- MediaControls = 0x80,
- MediaCanPrint = 0x100,
- MediaCanRotate = 0x200,
- };
- Q_DECLARE_FLAGS(MediaFlags, MediaFlag)
- Q_FLAG(MediaFlags)
-
- // Must match QWebEngineCore::WebEngineContextMenuData::EditFlags:
- enum EditFlag {
- CanUndo = 0x1,
- CanRedo = 0x2,
- CanCut = 0x4,
- CanCopy = 0x8,
- CanPaste = 0x10,
- CanDelete = 0x20,
- CanSelectAll = 0x40,
- CanTranslate = 0x80,
- CanEditRichly = 0x100,
- };
- Q_DECLARE_FLAGS(EditFlags, EditFlag)
- Q_FLAG(EditFlags)
-
- bool isValid() const;
-
- QPoint position() const;
- QString selectedText() const;
- QString linkText() const;
- QUrl linkUrl() const;
- QUrl mediaUrl() const;
- MediaType mediaType() const;
- bool isContentEditable() const;
- QString misspelledWord() const;
- QStringList spellCheckerSuggestions() const;
- MediaFlags mediaFlags() const;
- EditFlags editFlags() const;
-
-private:
- void reset();
- typedef QtWebEngineCore::WebEngineContextMenuData QWebEngineContextDataPrivate;
- QWebEngineContextMenuData &operator=(const QWebEngineContextDataPrivate &priv);
- const QWebEngineContextDataPrivate *d;
-
- friend class QWebEnginePagePrivate;
- friend class QWebEnginePage;
-};
-
-Q_DECLARE_OPERATORS_FOR_FLAGS(QWebEngineContextMenuData::MediaFlags)
-Q_DECLARE_OPERATORS_FOR_FLAGS(QWebEngineContextMenuData::EditFlags)
-
-QT_END_NAMESPACE
-
-#endif // QWEBENGINECONTEXTDATA_H
diff --git a/src/webenginewidgets/api/qwebenginedownloaditem.cpp b/src/webenginewidgets/api/qwebenginedownloaditem.cpp
deleted file mode 100644
index 7366dbf59..000000000
--- a/src/webenginewidgets/api/qwebenginedownloaditem.cpp
+++ /dev/null
@@ -1,786 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qwebenginedownloaditem.h"
-#include "qwebenginedownloaditem_p.h"
-
-#include "profile_adapter.h"
-#include "qwebengineprofile_p.h"
-
-#include <QDir>
-#include "QFileInfo"
-
-QT_BEGIN_NAMESPACE
-
-using QtWebEngineCore::ProfileAdapterClient;
-
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::NoReason, QWebEngineDownloadItem::NoReason)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::FileFailed, QWebEngineDownloadItem::FileFailed)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::FileAccessDenied, QWebEngineDownloadItem::FileAccessDenied)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::FileNoSpace, QWebEngineDownloadItem::FileNoSpace)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::FileNameTooLong, QWebEngineDownloadItem::FileNameTooLong)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::FileTooLarge, QWebEngineDownloadItem::FileTooLarge)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::FileVirusInfected, QWebEngineDownloadItem::FileVirusInfected)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::FileTransientError, QWebEngineDownloadItem::FileTransientError)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::FileBlocked, QWebEngineDownloadItem::FileBlocked)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::FileSecurityCheckFailed, QWebEngineDownloadItem::FileSecurityCheckFailed)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::FileTooShort, QWebEngineDownloadItem::FileTooShort)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::FileHashMismatch, QWebEngineDownloadItem::FileHashMismatch)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::NetworkFailed, QWebEngineDownloadItem::NetworkFailed)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::NetworkTimeout, QWebEngineDownloadItem::NetworkTimeout)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::NetworkDisconnected, QWebEngineDownloadItem::NetworkDisconnected)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::NetworkServerDown, QWebEngineDownloadItem::NetworkServerDown)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::NetworkInvalidRequest, QWebEngineDownloadItem::NetworkInvalidRequest)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::ServerFailed, QWebEngineDownloadItem::ServerFailed)
-//ASSERT_ENUMS_MATCH(ProfileAdapterClient::ServerNoRange, QWebEngineDownloadItem::ServerNoRange)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::ServerBadContent, QWebEngineDownloadItem::ServerBadContent)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::ServerUnauthorized, QWebEngineDownloadItem::ServerUnauthorized)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::ServerCertProblem, QWebEngineDownloadItem::ServerCertProblem)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::ServerForbidden, QWebEngineDownloadItem::ServerForbidden)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::ServerUnreachable, QWebEngineDownloadItem::ServerUnreachable)
-ASSERT_ENUMS_MATCH(ProfileAdapterClient::UserCanceled, QWebEngineDownloadItem::UserCanceled)
-//ASSERT_ENUMS_MATCH(ProfileAdapterClient::UserShutdown, QWebEngineDownloadItem::UserShutdown)
-//ASSERT_ENUMS_MATCH(ProfileAdapterClient::Crash, QWebEngineDownloadItem::Crash)
-
-static inline QWebEngineDownloadItem::DownloadState toDownloadState(int state)
-{
- switch (state) {
- case ProfileAdapterClient::DownloadInProgress:
- return QWebEngineDownloadItem::DownloadInProgress;
- case ProfileAdapterClient::DownloadCompleted:
- return QWebEngineDownloadItem::DownloadCompleted;
- case ProfileAdapterClient::DownloadCancelled:
- return QWebEngineDownloadItem::DownloadCancelled;
- case ProfileAdapterClient::DownloadInterrupted:
- return QWebEngineDownloadItem::DownloadInterrupted;
- default:
- Q_UNREACHABLE();
- return QWebEngineDownloadItem::DownloadCancelled;
- }
-}
-
-static inline QWebEngineDownloadItem::DownloadInterruptReason toDownloadInterruptReason(int reason)
-{
- return static_cast<QWebEngineDownloadItem::DownloadInterruptReason>(reason);
-}
-
-/*!
- \class QWebEngineDownloadItem
- \brief The QWebEngineDownloadItem class provides information about a download.
-
- \since 5.5
-
- \inmodule QtWebEngineWidgets
-
- QWebEngineDownloadItem models a download throughout its life cycle, starting
- with a pending download request and finishing with a completed download. It
- can be used, for example, to get information about new downloads, to monitor
- progress, and to pause, resume, and cancel downloads.
-
- Downloads are usually triggered by user interaction on a web page. It is the
- QWebEngineProfile's responsibility to notify the application of new download
- requests, which it does by emitting the
- \l{QWebEngineProfile::downloadRequested}{downloadRequested} signal together
- with a newly created QWebEngineDownloadItem. The application can then
- examine this item and decide whether to accept it or not. A signal handler
- must explicitly call accept() on the item for \QWE to actually start
- downloading and writing data to disk. If no signal handler calls accept(),
- then the download request will be automatically rejected and nothing will be
- written to disk.
-
- \note Some properties, such as setting the path and file name where the file
- will be saved (see \l downloadDirectory() and \l downloadFileName()), can
- only be changed before calling accept().
-
- \section2 Object Life Cycle
-
- All items are guaranteed to be valid during the emission of the
- \l{QWebEngineProfile::downloadRequested}{downloadRequested} signal. If
- accept() is \e not called by any signal handler, then the item will be
- deleted \e immediately after signal emission. This means that the
- application \b{must not} keep references to rejected download items. It also
- means the application should not use a queued connection to this signal.
-
- If accept() \e is called by a signal handler, then the QWebEngineProfile
- will take ownership of the item. However, it is safe for the application to
- delete the item at any time, except during the handling of the
- \l{QWebEngineProfile::downloadRequested}{downloadRequested} signal. The
- QWebEngineProfile being a long-lived object, it is in fact recommended that
- the application delete any items it is no longer interested in.
-
- \note Deleting an item will also automatically cancel a download since 5.12.2,
- but it is recommended to cancel manually before deleting for portability.
-
- \section2 Web Page Downloads
-
- In addition to normal file downloads, which consist simply of retrieving
- some raw bytes from the network and writing them to disk, \QWE also
- supports saving complete web pages, which involves parsing the page's HTML,
- downloading any dependent resources, and potentially packaging everything
- into a special file format (\l savePageFormat). To check if a download is
- for a file or a web page, use \l isSavePageDownload.
-
- \sa QWebEngineProfile, QWebEngineProfile::downloadRequested,
- QWebEnginePage::download, QWebEnginePage::save
-*/
-
-QWebEngineDownloadItemPrivate::QWebEngineDownloadItemPrivate(QWebEngineProfilePrivate *p, const QUrl &url)
- : profile(p)
- , downloadFinished(false)
- , downloadId(-1)
- , downloadState(QWebEngineDownloadItem::DownloadCancelled)
- , savePageFormat(QWebEngineDownloadItem::MimeHtmlSaveFormat)
- , type(QWebEngineDownloadItem::Attachment)
- , interruptReason(QWebEngineDownloadItem::NoReason)
- , downloadUrl(url)
- , downloadPaused(false)
- , isCustomFileName(false)
- , totalBytes(-1)
- , receivedBytes(0)
- , page(0)
-{
-}
-
-QWebEngineDownloadItemPrivate::~QWebEngineDownloadItemPrivate()
-{
-}
-
-void QWebEngineDownloadItemPrivate::update(const ProfileAdapterClient::DownloadItemInfo &info)
-{
- Q_Q(QWebEngineDownloadItem);
-
- Q_ASSERT(downloadState != QWebEngineDownloadItem::DownloadRequested);
-
- if (toDownloadInterruptReason(info.downloadInterruptReason) != interruptReason)
- interruptReason = toDownloadInterruptReason(info.downloadInterruptReason);
-
- if (toDownloadState(info.state) != downloadState) {
- downloadState = toDownloadState(info.state);
- Q_EMIT q->stateChanged(downloadState);
- }
-
- if (info.receivedBytes != receivedBytes || info.totalBytes != totalBytes) {
- receivedBytes = info.receivedBytes;
- totalBytes = info.totalBytes;
- Q_EMIT q->downloadProgress(receivedBytes, totalBytes);
- }
-
- if (info.done)
- setFinished();
-
- if (downloadPaused != info.paused) {
- downloadPaused = info.paused;
- Q_EMIT q->isPausedChanged(downloadPaused);
- }
-}
-
-void QWebEngineDownloadItemPrivate::setFinished()
-{
- if (downloadFinished)
- return;
-
- downloadFinished = true;
- Q_EMIT q_ptr->finished();
-}
-
-/*!
- Accepts the current download request, which will start the download.
-
- If the item is in the \l DownloadRequested state, then it will transition
- into the \l DownloadInProgress state and the downloading will begin. If the
- item is in any other state, then nothing will happen.
-
- \sa finished(), stateChanged()
-*/
-
-void QWebEngineDownloadItem::accept()
-{
- Q_D(QWebEngineDownloadItem);
-
- if (d->downloadState != QWebEngineDownloadItem::DownloadRequested)
- return;
-
- d->downloadState = QWebEngineDownloadItem::DownloadInProgress;
- Q_EMIT stateChanged(d->downloadState);
-}
-
-/*!
- Cancels the current download.
-
- If the item is in the \l DownloadInProgress state, then it will transition
- into the \l DownloadCancelled state, the downloading will stop, and partially
- downloaded files will be deleted from disk.
-
- If the item is in the \l DownloadCompleted state, then nothing will happen.
- If the item is in any other state, then it will transition into the \l
- DownloadCancelled state without further effect.
-
- \sa finished(), stateChanged()
-*/
-
-void QWebEngineDownloadItem::cancel()
-{
- Q_D(QWebEngineDownloadItem);
-
- QWebEngineDownloadItem::DownloadState state = d->downloadState;
-
- if (state == QWebEngineDownloadItem::DownloadCompleted
- || state == QWebEngineDownloadItem::DownloadCancelled)
- return;
-
- // We directly cancel the download request if the user cancels
- // before it even started, so no need to notify the profile here.
- if (state == QWebEngineDownloadItem::DownloadInProgress) {
- if (auto profileAdapter = d->profile->profileAdapter())
- profileAdapter->cancelDownload(d->downloadId);
- } else {
- d->downloadState = QWebEngineDownloadItem::DownloadCancelled;
- Q_EMIT stateChanged(d->downloadState);
- d->setFinished();
- }
-}
-
-/*!
- \since 5.10
- Pauses the download.
-
- Has no effect if the state is not \l DownloadInProgress. Does not change the
- state.
-
- \sa resume(), isPaused()
-*/
-
-void QWebEngineDownloadItem::pause()
-{
- Q_D(QWebEngineDownloadItem);
-
- QWebEngineDownloadItem::DownloadState state = d->downloadState;
-
- if (state != QWebEngineDownloadItem::DownloadInProgress)
- return;
-
- d->profile->profileAdapter()->pauseDownload(d->downloadId);
-}
-
-/*!
- \since 5.10
- Resumes the current download if it was paused or interrupted.
-
- Has no effect if the state is not \l DownloadInProgress or \l
- DownloadInterrupted. Does not change the state.
-
- \sa pause(), isPaused(), state()
-*/
-void QWebEngineDownloadItem::resume()
-{
- Q_D(QWebEngineDownloadItem);
-
- QWebEngineDownloadItem::DownloadState state = d->downloadState;
-
- if (d->downloadFinished || (state != QWebEngineDownloadItem::DownloadInProgress && state != QWebEngineDownloadItem::DownloadInterrupted))
- return;
- d->profile->profileAdapter()->resumeDownload(d->downloadId);
-}
-
-/*!
- Returns the download item's ID.
-*/
-
-quint32 QWebEngineDownloadItem::id() const
-{
- Q_D(const QWebEngineDownloadItem);
- return d->downloadId;
-}
-
-/*!
- \fn void QWebEngineDownloadItem::finished()
-
- This signal is emitted when the download finishes.
-
- \sa state(), isFinished()
-*/
-
-/*!
- \fn void QWebEngineDownloadItem::isPausedChanged(bool isPaused)
- \since 5.10
-
- This signal is emitted whenever \a isPaused changes.
-
- \sa pause(), isPaused()
-*/
-
-/*!
- \fn void QWebEngineDownloadItem::stateChanged(DownloadState state)
-
- This signal is emitted whenever the download's \a state changes.
-
- \sa state(), DownloadState
-*/
-
-/*!
- \fn void QWebEngineDownloadItem::downloadProgress(qint64 bytesReceived, qint64 bytesTotal)
-
- This signal is emitted to indicate the progress of the download request.
-
- The \a bytesReceived parameter indicates the number of bytes received, while
- \a bytesTotal indicates the total number of bytes expected to be downloaded.
- If the size of the file to be downloaded is not known, \c bytesTotal will be
- 0.
-
- \sa totalBytes(), receivedBytes()
-*/
-
-/*!
- \enum QWebEngineDownloadItem::DownloadState
-
- This enum describes the state of the download:
-
- \value DownloadRequested Download has been requested, but has not been accepted yet.
- \value DownloadInProgress Download is in progress.
- \value DownloadCompleted Download completed successfully.
- \value DownloadCancelled Download has been cancelled.
- \value DownloadInterrupted Download has been interrupted (by the server or because of lost
- connectivity).
-*/
-
-/*!
- \enum QWebEngineDownloadItem::SavePageFormat
- \since 5.7
-
- This enum describes the format that is used to save a web page.
-
- \value UnknownSaveFormat This is not a request for downloading a complete web page.
- \value SingleHtmlSaveFormat The page is saved as a single HTML page. Resources such as images
- are not saved.
- \value CompleteHtmlSaveFormat The page is saved as a complete HTML page, for example a directory
- containing the single HTML page and the resources.
- \value MimeHtmlSaveFormat The page is saved as a complete web page in the MIME HTML format.
-*/
-
-/*!
- \enum QWebEngineDownloadItem::DownloadType
- \since 5.8
- \obsolete
-
- Describes the requested download's type.
-
- \value Attachment The web server's response includes a
- \c Content-Disposition header with the \c attachment directive. If \c Content-Disposition
- is present in the reply, the web server is indicating that the client should prompt the
- user to save the content regardless of the content type.
- See \l {RFC 2616 section 19.5.1} for details.
- \value DownloadAttribute The user clicked a link with the \c download
- attribute.
- \value UserRequested The user initiated the download, for example by
- selecting a web action.
- \value SavePage Saving of the current page was requested (for example by
- the \l{QWebEnginePage::WebAction}{QWebEnginePage::SavePage} web action).
-*/
-
-/*!
- \enum QWebEngineDownloadItem::DownloadInterruptReason
- \since 5.9
-
- Describes the reason why a download was interrupted:
-
- \value NoReason Unknown reason or not interrupted.
- \value FileFailed General file operation failure.
- \value FileAccessDenied The file cannot be written locally, due to access restrictions.
- \value FileNoSpace Insufficient space on the target drive.
- \value FileNameTooLong The directory or file name is too long.
- \value FileTooLarge The file size exceeds the file system limitation.
- \value FileVirusInfected The file is infected with a virus.
- \value FileTransientError Temporary problem (for example the file is in use,
- out of memory, or too many files are opened at once).
- \value FileBlocked The file was blocked due to local policy.
- \value FileSecurityCheckFailed An attempt to check the safety of the download
- failed due to unexpected reasons.
- \value FileTooShort An attempt was made to seek past the end of a file when
- opening a file (as part of resuming a previously interrupted download).
- \value FileHashMismatch The partial file did not match the expected hash.
-
- \value NetworkFailed General network failure.
- \value NetworkTimeout The network operation has timed out.
- \value NetworkDisconnected The network connection has been terminated.
- \value NetworkServerDown The server has gone down.
- \value NetworkInvalidRequest The network request was invalid (for example, the
- original or redirected URL is invalid, has an unsupported scheme, or is disallowed by policy).
-
- \value ServerFailed General server failure.
- \value ServerBadContent The server does not have the requested data.
- \value ServerUnauthorized The server did not authorize access to the resource.
- \value ServerCertProblem A problem with the server certificate occurred.
- \value ServerForbidden Access forbidden by the server.
- \value ServerUnreachable Unexpected server response (might indicate that
- the responding server may not be the intended server).
- \value UserCanceled The user canceled the download.
-*/
-
-/*!
- Returns the download item's current state.
-
- \sa DownloadState
-*/
-
-QWebEngineDownloadItem::DownloadState QWebEngineDownloadItem::state() const
-{
- Q_D(const QWebEngineDownloadItem);
- return d->downloadState;
-}
-
-/*!
- Returns the the total amount of data to download in bytes.
-
- \c -1 means the size is unknown.
-*/
-
-qint64 QWebEngineDownloadItem::totalBytes() const
-{
- Q_D(const QWebEngineDownloadItem);
- return d->totalBytes;
-}
-
-/*!
- Returns the amount of data in bytes that has been downloaded so far.
-
- \c -1 means the size is unknown.
-*/
-
-qint64 QWebEngineDownloadItem::receivedBytes() const
-{
- Q_D(const QWebEngineDownloadItem);
- return d->receivedBytes;
-}
-
-/*!
- Returns the download's origin URL.
-*/
-
-QUrl QWebEngineDownloadItem::url() const
-{
- Q_D(const QWebEngineDownloadItem);
- return d->downloadUrl;
-}
-
-/*!
- \since 5.6
-
- Returns the MIME type of the download.
-*/
-
-QString QWebEngineDownloadItem::mimeType() const
-{
- Q_D(const QWebEngineDownloadItem);
- return d->mimeType;
-}
-
-/*!
- \obsolete
-
- Use \l suggestedFileName(), \l downloadDirectory(), and
- \l downloadFileName() instead.
-
- Returns the full target path where data is being downloaded to.
-
- The path includes the file name. The default suggested path is the standard download location
- and file name is deduced not to overwrite already existing files.
-*/
-
-QString QWebEngineDownloadItem::path() const
-{
- Q_D(const QWebEngineDownloadItem);
- return QDir::cleanPath(QDir(d->downloadDirectory).filePath(d->downloadFileName));
-}
-
-/*!
- \obsolete
-
- Use \l setDownloadDirectory() and \l setDownloadFileName() instead.
-
- Sets the full target path to download the file to.
-
- The \a path should also include the file name. The download path can only be set in response
- to the QWebEngineProfile::downloadRequested() signal before the download is accepted.
- Past that point, this function has no effect on the download item's state.
-*/
-void QWebEngineDownloadItem::setPath(QString path)
-{
- Q_D(QWebEngineDownloadItem);
- if (d->downloadState != QWebEngineDownloadItem::DownloadRequested) {
- qWarning("Setting the download path is not allowed after the download has been accepted.");
- return;
- }
- if (QDir(d->downloadDirectory).filePath(d->downloadFileName) != path) {
- if (QFileInfo(path).fileName().isEmpty()) {
- qWarning("The download path does not include file name.");
- return;
- }
-
- if (QFileInfo(path).isDir()) {
- qWarning("The download path matches with an already existing directory path.");
- return;
- }
-
- if (QFileInfo(path).fileName() == path) {
- d->downloadDirectory = QStringLiteral("");
- d->downloadFileName = path;
- } else {
- d->downloadDirectory = QFileInfo(path).path();
- d->downloadFileName = QFileInfo(path).fileName();
- }
- }
-}
-
-/*!
- \since 5.14
-
- Returns the download directory path.
-*/
-
-QString QWebEngineDownloadItem::downloadDirectory() const
-{
- Q_D(const QWebEngineDownloadItem);
- return d->downloadDirectory;
-}
-
-/*!
- \since 5.14
-
- Sets \a directory as the directory path to download the file to.
-
- The download directory path can only be set in response to the QWebEngineProfile::downloadRequested()
- signal before the download is accepted. Past that point, this function has no effect on the
- download item's state.
-*/
-
-void QWebEngineDownloadItem::setDownloadDirectory(const QString &directory)
-{
- Q_D(QWebEngineDownloadItem);
- if (d->downloadState != QWebEngineDownloadItem::DownloadRequested) {
- qWarning("Setting the download directory is not allowed after the download has been accepted.");
- return;
- }
-
- if (!directory.isEmpty() && d->downloadDirectory != directory)
- d->downloadDirectory = directory;
-
- if (!d->isCustomFileName)
- d->downloadFileName = QFileInfo(d->profile->profileAdapter()->determineDownloadPath(d->downloadDirectory,
- d->suggestedFileName,
- d->startTime)).fileName();
-}
-
-/*!
- \since 5.14
-
- Returns the file name to download the file to.
-*/
-
-QString QWebEngineDownloadItem::downloadFileName() const
-{
- Q_D(const QWebEngineDownloadItem);
- return d->downloadFileName;
-}
-
-/*!
- \since 5.14
-
- Sets \a fileName as the file name to download the file to.
-
- The download file name can only be set in response to the QWebEngineProfile::downloadRequested()
- signal before the download is accepted. Past that point, this function has no effect on the
- download item's state.
-*/
-
-void QWebEngineDownloadItem::setDownloadFileName(const QString &fileName)
-{
- Q_D(QWebEngineDownloadItem);
- if (d->downloadState != QWebEngineDownloadItem::DownloadRequested) {
- qWarning("Setting the download file name is not allowed after the download has been accepted.");
- return;
- }
-
- if (!fileName.isEmpty()) {
- d->downloadFileName = fileName;
- d->isCustomFileName = true;
- }
-}
-
-/*!
- \since 5.14
-
- Returns the suggested file name.
-*/
-
-QString QWebEngineDownloadItem::suggestedFileName() const
-{
- Q_D(const QWebEngineDownloadItem);
- return d->suggestedFileName;
-}
-
-/*!
- Returns whether this download is finished (completed, cancelled, or non-resumable interrupted state).
-
- \sa finished(), state(),
-*/
-
-bool QWebEngineDownloadItem::isFinished() const
-{
- Q_D(const QWebEngineDownloadItem);
- return d->downloadFinished;
-}
-
-/*!
- Returns whether this download is paused.
-
- \sa pause(), resume()
-*/
-
-bool QWebEngineDownloadItem::isPaused() const
-{
- Q_D(const QWebEngineDownloadItem);
- return d->downloadPaused;
-}
-
-/*!
- Returns the format the web page will be saved in if this is a download request for a web page.
- \since 5.7
-
- \sa setSavePageFormat(), isSavePageDownload()
-*/
-QWebEngineDownloadItem::SavePageFormat QWebEngineDownloadItem::savePageFormat() const
-{
- Q_D(const QWebEngineDownloadItem);
- return d->savePageFormat;
-}
-
-/*!
- Sets the \a format the web page will be saved in if this is a download request for a web page.
- \since 5.7
-
- \sa savePageFormat(), isSavePageDownload()
-*/
-void QWebEngineDownloadItem::setSavePageFormat(QWebEngineDownloadItem::SavePageFormat format)
-{
- Q_D(QWebEngineDownloadItem);
- d->savePageFormat = format;
-}
-
-/*!
- Returns the requested download's type.
- \since 5.8
- \obsolete
-
- \note This property works unreliably, except for \c SavePage
- downloads. Use \l isSavePageDownload() instead.
- */
-
-QWebEngineDownloadItem::DownloadType QWebEngineDownloadItem::type() const
-{
- Q_D(const QWebEngineDownloadItem);
- return d->type;
-}
-
-/*!
- Returns \c true if this is a download request for saving a web page.
- \since 5.11
-
- \sa savePageFormat(), setSavePageFormat()
- */
-bool QWebEngineDownloadItem::isSavePageDownload() const
-{
- Q_D(const QWebEngineDownloadItem);
- return d->type == QWebEngineDownloadItem::SavePage;
-}
-
-/*!
- Returns the reason why the download was interrupted.
- \since 5.9
-
- \sa interruptReasonString()
-*/
-
-QWebEngineDownloadItem::DownloadInterruptReason QWebEngineDownloadItem::interruptReason() const
-{
- Q_D(const QWebEngineDownloadItem);
- return d->interruptReason;
-}
-
-/*!
- Returns a human-readable description of the reason for interrupting the download.
- \since 5.9
-
- \sa interruptReason()
-*/
-
-QString QWebEngineDownloadItem::interruptReasonString() const
-{
- return ProfileAdapterClient::downloadInterruptReasonToString(
- static_cast<ProfileAdapterClient::DownloadInterruptReason>(interruptReason()));
-}
-
-/*!
- \since 5.12
- Returns the page the download was requested on. If the download was not triggered by content in a page,
- \c nullptr is returned.
-*/
-QWebEnginePage *QWebEngineDownloadItem::page() const
-{
- Q_D(const QWebEngineDownloadItem);
- return d->page;
-}
-
-QWebEngineDownloadItem::QWebEngineDownloadItem(QWebEngineDownloadItemPrivate *p, QObject *parent)
- : QObject(parent)
- , d_ptr(p)
-{
- p->q_ptr = this;
-}
-
-/*! \internal
-*/
-QWebEngineDownloadItem::~QWebEngineDownloadItem()
-{
- // MEMO Items are owned by profile by default and will be destroyed on profile's destruction
- // It's not safe to access profile in that case, so we rely on profile to clean up items
- if (!isFinished())
- cancel();
-}
-
-QT_END_NAMESPACE
diff --git a/src/webenginewidgets/api/qwebenginedownloaditem.h b/src/webenginewidgets/api/qwebenginedownloaditem.h
deleted file mode 100644
index 094054079..000000000
--- a/src/webenginewidgets/api/qwebenginedownloaditem.h
+++ /dev/null
@@ -1,174 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWEBENGINEDOWNLOADITEM_H
-#define QWEBENGINEDOWNLOADITEM_H
-
-#include <QtWebEngineWidgets/qtwebenginewidgetsglobal.h>
-
-#include <QtCore/qobject.h>
-
-QT_BEGIN_NAMESPACE
-
-class QWebEnginePage;
-class QWebEngineDownloadItemPrivate;
-class QWebEngineProfilePrivate;
-
-class QWEBENGINEWIDGETS_EXPORT QWebEngineDownloadItem : public QObject
-{
- Q_OBJECT
-public:
- ~QWebEngineDownloadItem();
-
- enum DownloadState {
- DownloadRequested,
- DownloadInProgress,
- DownloadCompleted,
- DownloadCancelled,
- DownloadInterrupted
- };
- Q_ENUM(DownloadState)
-
- enum SavePageFormat {
- UnknownSaveFormat = -1,
- SingleHtmlSaveFormat,
- CompleteHtmlSaveFormat,
- MimeHtmlSaveFormat
- };
- Q_ENUM(SavePageFormat)
-
- enum DownloadInterruptReason {
- NoReason = 0,
- FileFailed = 1,
- FileAccessDenied = 2,
- FileNoSpace = 3,
- FileNameTooLong = 5,
- FileTooLarge = 6,
- FileVirusInfected = 7,
- FileTransientError = 10,
- FileBlocked = 11,
- FileSecurityCheckFailed = 12,
- FileTooShort = 13,
- FileHashMismatch = 14,
- NetworkFailed = 20,
- NetworkTimeout = 21,
- NetworkDisconnected = 22,
- NetworkServerDown = 23,
- NetworkInvalidRequest = 24,
- ServerFailed = 30,
- //ServerNoRange = 31,
- ServerBadContent = 33,
- ServerUnauthorized = 34,
- ServerCertProblem = 35,
- ServerForbidden = 36,
- ServerUnreachable = 37,
- UserCanceled = 40,
- //UserShutdown = 41,
- //Crash = 50
- };
- Q_ENUM(DownloadInterruptReason)
-
- enum DownloadType {
- Attachment = 0,
- DownloadAttribute,
- UserRequested,
- SavePage
- };
- Q_ENUM(DownloadType)
-
- quint32 id() const;
- DownloadState state() const;
- qint64 totalBytes() const;
- qint64 receivedBytes() const;
- QUrl url() const;
- QString mimeType() const;
-#if QT_DEPRECATED_SINCE(5, 14)
-#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
- QT_DEPRECATED_VERSION_X(5, 14, "Use downloadDirectory() and downloadFileName() instead")
- QString path() const;
- QT_DEPRECATED_VERSION_X(5, 14, "Use setDownloadDirectory() and setDownloadFileName() instead")
- void setPath(QString path);
-#else
- QT_DEPRECATED_X("Use downloadDirectory() and downloadFileName() instead")
- QString path() const;
- QT_DEPRECATED_X("Use setDownloadDirectory() and setDownloadFileName() instead")
- void setPath(QString path);
-#endif
-#endif
- bool isFinished() const;
- bool isPaused() const;
- SavePageFormat savePageFormat() const;
- void setSavePageFormat(SavePageFormat format);
- DownloadType Q_DECL_DEPRECATED type() const;
- DownloadInterruptReason interruptReason() const;
- QString interruptReasonString() const;
- bool isSavePageDownload() const;
- QString suggestedFileName() const;
- QString downloadDirectory() const;
- void setDownloadDirectory(const QString &directory);
- QString downloadFileName() const;
- void setDownloadFileName(const QString &fileName);
-
- QWebEnginePage *page() const;
-
-public Q_SLOTS:
- void accept();
- void cancel();
- void pause();
- void resume();
-
-Q_SIGNALS:
- void finished();
- void stateChanged(QWebEngineDownloadItem::DownloadState state);
- void downloadProgress(qint64 bytesReceived, qint64 bytesTotal);
- void isPausedChanged(bool isPaused);
-
-private:
- Q_DISABLE_COPY(QWebEngineDownloadItem)
- Q_DECLARE_PRIVATE(QWebEngineDownloadItem)
-
- friend class QWebEngineProfilePrivate;
-
- QWebEngineDownloadItem(QWebEngineDownloadItemPrivate*, QObject *parent = Q_NULLPTR);
- QScopedPointer<QWebEngineDownloadItemPrivate> d_ptr;
-};
-
-QT_END_NAMESPACE
-
-#endif // QWEBENGINEDOWNLOADITEM_H
diff --git a/src/webenginewidgets/api/qwebenginedownloaditem_p.h b/src/webenginewidgets/api/qwebenginedownloaditem_p.h
deleted file mode 100644
index 04c6fadcc..000000000
--- a/src/webenginewidgets/api/qwebenginedownloaditem_p.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWEBENGINEDOWNLOADITEM_P_H
-#define QWEBENGINEDOWNLOADITEM_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "qtwebenginewidgetsglobal.h"
-
-#include "qwebenginedownloaditem.h"
-#include "qwebengineprofile_p.h"
-#include <QString>
-
-QT_BEGIN_NAMESPACE
-
-class QWebEngineDownloadItemPrivate {
- QWebEngineDownloadItem *q_ptr;
- QWebEngineProfilePrivate* profile;
- friend class QWebEngineProfilePrivate;
-public:
- Q_DECLARE_PUBLIC(QWebEngineDownloadItem)
- QWebEngineDownloadItemPrivate(QWebEngineProfilePrivate *p, const QUrl &url);
- ~QWebEngineDownloadItemPrivate();
-
- bool downloadFinished;
- quint32 downloadId;
- qint64 startTime;
- QWebEngineDownloadItem::DownloadState downloadState;
- QWebEngineDownloadItem::SavePageFormat savePageFormat;
- QWebEngineDownloadItem::DownloadType type;
- QWebEngineDownloadItem::DownloadInterruptReason interruptReason;
- QString downloadPath;
- const QUrl downloadUrl;
- QString mimeType;
- bool downloadPaused;
- QString suggestedFileName;
- QString downloadDirectory;
- QString downloadFileName;
- bool isCustomFileName;
-
- qint64 totalBytes;
- qint64 receivedBytes;
- QWebEnginePage *page;
-
- void update(const QtWebEngineCore::ProfileAdapterClient::DownloadItemInfo &info);
-
- void setFinished();
-};
-
-QT_END_NAMESPACE
-
-#endif // QWEBENGINEDOWNLOADITEM_P_H
-
diff --git a/src/webenginewidgets/api/qwebenginefullscreenrequest.cpp b/src/webenginewidgets/api/qwebenginefullscreenrequest.cpp
deleted file mode 100644
index bcf2d5d22..000000000
--- a/src/webenginewidgets/api/qwebenginefullscreenrequest.cpp
+++ /dev/null
@@ -1,136 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qwebenginefullscreenrequest.h"
-#include "qwebenginepage_p.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QWebEngineFullScreenRequest
- \brief The QWebEngineFullScreenRequest class enables accepting or rejecting
- requests for entering and exiting the fullscreen mode.
-
- \since 5.6
-
- \inmodule QtWebEngineWidgets
-
- To allow elements such as videos to be shown in the fullscreen mode,
- applications must set QWebEngineSettings::FullScreenSupportEnabled and
- connect to QWebEnginePage::fullScreenRequested, which takes a
- QWebEngineFullScreenRequest instance as an argument.
-
- If an element of a web page requests to be shown in the fullscreen mode,
- QWebEnginePage::fullScreenRequested will be emitted with an
- QWebEngineFullScreenRequest instance as an argument where toggleOn() returns
- \c true. The signal handler needs to then either call accept() or reject().
-
- If the request to enter the fullscreen mode is accepted, the element
- requesting fullscreen mode will fill the viewport, but it is up to the
- application to make the view fullscreen or to move the page to a view that
- is in the fullscreen mode.
-
- Likewise, a QWebEnginePage::fullScreenRequested will be emitted when
- the user wants to leave the full screen mode (that is, through the
- QWebEnginePage::ExitFullScreen context menu action). In this case,
- toggleOn() will return \c false, and the signal handler again needs to
- accept() or reject() the request. If it is accepted, the applicaton needs to
- make sure that the global window state is restored.
-*/
-
-/*!
- \property QWebEngineFullScreenRequest::toggleOn
- \brief Whether the web page has issued a request to enter fullscreen mode.
-*/
-
-/*!
- \property QWebEngineFullScreenRequest::origin
- \brief The URL to be opened in the fullscreen mode.
-*/
-
-/*!
- \fn QWebEngineFullScreenRequest::toggleOn() const
- Returns \c true if the web page has issued a request to enter the fullscreen
- mode, otherwise returns \c false.
-*/
-
-/*!
- \fn QWebEngineFullScreenRequest::origin() const
- Returns the URL to be opened in the fullscreen mode.
-*/
-
-/*!
- Creates a request for opening the \a page from the URL specified by
- \a origin in the fullscreen mode if \a fullscreen is \c true.
-*/
-
-QWebEngineFullScreenRequest::QWebEngineFullScreenRequest(QWebEnginePage *page, const QUrl &origin, bool fullscreen)
- : m_page(page)
- , m_origin(origin)
- , m_toggleOn(fullscreen)
-{
-}
-
-/*!
- Rejects a request to enter or exit the fullscreen mode.
-*/
-void QWebEngineFullScreenRequest::reject()
-{
- if (!m_page) {
- qWarning("Cannot reject QWebEngineFullScreenRequest: Originating page is already deleted");
- return;
- }
-
- m_page->d_func()->setFullScreenMode(!m_toggleOn);
-}
-
-/*!
- Accepts the request to enter or exit the fullscreen mode.
-*/
-void QWebEngineFullScreenRequest::accept()
-{
- if (!m_page) {
- qWarning("Cannot accept QWebEngineFullScreenRequest: Originating page is already deleted");
- return;
- }
-
- m_page->d_func()->setFullScreenMode(m_toggleOn);
-}
-
-QT_END_NAMESPACE
diff --git a/src/webenginewidgets/api/qwebenginefullscreenrequest.h b/src/webenginewidgets/api/qwebenginefullscreenrequest.h
deleted file mode 100644
index 08505a410..000000000
--- a/src/webenginewidgets/api/qwebenginefullscreenrequest.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWEBENGINEFULLSCREENREQUEST_H
-#define QWEBENGINEFULLSCREENREQUEST_H
-
-#include <QtWebEngineWidgets/qtwebenginewidgetsglobal.h>
-#include <QtCore/qurl.h>
-#include <QtCore/qpointer.h>
-
-QT_BEGIN_NAMESPACE
-class QWebEnginePage;
-
-class QWEBENGINEWIDGETS_EXPORT QWebEngineFullScreenRequest {
- Q_GADGET
- Q_PROPERTY(bool toggleOn READ toggleOn CONSTANT)
- Q_PROPERTY(QUrl origin READ origin CONSTANT)
-public:
- Q_INVOKABLE void reject();
- Q_INVOKABLE void accept();
- bool toggleOn() const { return m_toggleOn; }
- const QUrl &origin() const { return m_origin; }
-
-private:
- QWebEngineFullScreenRequest(QWebEnginePage *page, const QUrl &origin, bool toggleOn);
- QPointer<QWebEnginePage> m_page;
- const QUrl m_origin;
- const bool m_toggleOn;
- friend class QWebEnginePagePrivate;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/webenginewidgets/api/qwebenginehistory.cpp b/src/webenginewidgets/api/qwebenginehistory.cpp
deleted file mode 100644
index 6a85b984e..000000000
--- a/src/webenginewidgets/api/qwebenginehistory.cpp
+++ /dev/null
@@ -1,280 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qwebenginehistory.h"
-#include "qwebenginehistory_p.h"
-
-#include "qwebenginepage_p.h"
-#include "web_contents_adapter.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \fn QWebEngineHistoryItem::swap(QWebEngineHistoryItem &other)
- Swaps the history item with the \a other item.
-*/
-
-QWebEngineHistoryItemPrivate::QWebEngineHistoryItemPrivate(QWebEnginePagePrivate *page, int index)
- : page(page)
- , index(index)
-{
-}
-
-QWebEngineHistoryItem::QWebEngineHistoryItem(QWebEngineHistoryItemPrivate *d)
- : d(d)
-{
-}
-
-QWebEngineHistoryItem::QWebEngineHistoryItem(const QWebEngineHistoryItem &other)
- : d(other.d)
-{
-}
-
-QWebEngineHistoryItem &QWebEngineHistoryItem::operator=(const QWebEngineHistoryItem &other)
-{
- d = other.d;
- return *this;
-}
-
-QWebEngineHistoryItem::~QWebEngineHistoryItem()
-{
-}
-
-QUrl QWebEngineHistoryItem::originalUrl() const
-{
- Q_D(const QWebEngineHistoryItem);
- return d->page ? d->page->webContents()->getNavigationEntryOriginalUrl(d->index) : QUrl();
-}
-
-QUrl QWebEngineHistoryItem::url() const
-{
- Q_D(const QWebEngineHistoryItem);
- return d->page ? d->page->webContents()->getNavigationEntryUrl(d->index) : QUrl();
-}
-
-QString QWebEngineHistoryItem::title() const
-{
- Q_D(const QWebEngineHistoryItem);
- return d->page ? d->page->webContents()->getNavigationEntryTitle(d->index) : QString();
-}
-
-QDateTime QWebEngineHistoryItem::lastVisited() const
-{
- Q_D(const QWebEngineHistoryItem);
- return d->page ? d->page->webContents()->getNavigationEntryTimestamp(d->index) : QDateTime();
-}
-
-/*!
- Returns the URL of the icon associated with the history item.
-
- \sa url(), originalUrl(), title()
-*/
-QUrl QWebEngineHistoryItem::iconUrl() const
-{
- Q_D(const QWebEngineHistoryItem);
- return d->page ? d->page->webContents()->getNavigationEntryIconUrl(d->index) : QUrl();
-}
-
-bool QWebEngineHistoryItem::isValid() const
-{
- Q_D(const QWebEngineHistoryItem);
- if (!d->page)
- return false;
- return d->index >= 0 && d->index < d->page->webContents()->navigationEntryCount();
-}
-
-QWebEngineHistoryPrivate::QWebEngineHistoryPrivate(QWebEnginePagePrivate *page)
- : page(page)
-{
-}
-
-QWebEngineHistoryPrivate::~QWebEngineHistoryPrivate()
-{
- // Invalidate shared item references possibly still out there.
- QList<QWebEngineHistoryItem>::iterator it, end;
- for (it = items.begin(), end = items.end(); it != end; ++it)
- it->d->page = 0;
-}
-
-void QWebEngineHistoryPrivate::updateItems() const
-{
- // Keep track of items we return to be able to invalidate them
- // and avoid dangling references to our page.
- int entryCount = page->webContents()->navigationEntryCount();
- while (items.size() > entryCount) {
- items.last().d->page = 0;
- items.removeLast();
- }
- while (items.size() < entryCount) {
- int nextIndex = items.size();
- items.append(QWebEngineHistoryItem(new QWebEngineHistoryItemPrivate(page, nextIndex)));
- }
-}
-
-QWebEngineHistory::QWebEngineHistory(QWebEngineHistoryPrivate *d)
- : d_ptr(d)
-{
-}
-
-QWebEngineHistory::~QWebEngineHistory()
-{
-}
-
-void QWebEngineHistory::clear()
-{
- Q_D(const QWebEngineHistory);
- d->page->webContents()->clearNavigationHistory();
- d->page->updateNavigationActions();
-}
-
-QList<QWebEngineHistoryItem> QWebEngineHistory::items() const
-{
- Q_D(const QWebEngineHistory);
- d->updateItems();
- return d->items;
-}
-
-QList<QWebEngineHistoryItem> QWebEngineHistory::backItems(int maxItems) const
-{
- Q_D(const QWebEngineHistory);
- d->updateItems();
- const int end = currentItemIndex();
- const int start = std::max(0, end - maxItems);
- return d->items.mid(start, end - start);
-}
-
-QList<QWebEngineHistoryItem> QWebEngineHistory::forwardItems(int maxItems) const
-{
- Q_D(const QWebEngineHistory);
- d->updateItems();
- const int start = currentItemIndex() + 1;
- const int end = std::min(count(), start + maxItems);
- return d->items.mid(start, end - start);
-}
-
-bool QWebEngineHistory::canGoBack() const
-{
- Q_D(const QWebEngineHistory);
- return d->page->webContents()->canGoToOffset(-1);
-}
-
-bool QWebEngineHistory::canGoForward() const
-{
- Q_D(const QWebEngineHistory);
- return d->page->webContents()->canGoToOffset(1);
-}
-
-void QWebEngineHistory::back()
-{
- Q_D(const QWebEngineHistory);
- d->page->webContents()->navigateToOffset(-1);
-}
-
-void QWebEngineHistory::forward()
-{
- Q_D(const QWebEngineHistory);
- d->page->webContents()->navigateToOffset(1);
-}
-
-void QWebEngineHistory::goToItem(const QWebEngineHistoryItem &item)
-{
- Q_D(const QWebEngineHistory);
- Q_ASSERT(item.d->page == d->page);
- d->page->webContents()->navigateToIndex(item.d->index);
-}
-
-QWebEngineHistoryItem QWebEngineHistory::backItem() const
-{
- return itemAt(currentItemIndex() - 1);
-}
-
-QWebEngineHistoryItem QWebEngineHistory::currentItem() const
-{
- return itemAt(currentItemIndex());
-}
-
-QWebEngineHistoryItem QWebEngineHistory::forwardItem() const
-{
- return itemAt(currentItemIndex() + 1);
-}
-
-QWebEngineHistoryItem QWebEngineHistory::itemAt(int i) const
-{
- Q_D(const QWebEngineHistory);
- if (i >= 0 && i < count()) {
- d->updateItems();
- return d->items[i];
- } else {
- // Return an invalid item right away.
- QWebEngineHistoryItem item(new QWebEngineHistoryItemPrivate(0, i));
- Q_ASSERT(!item.isValid());
- return item;
- }
-}
-
-int QWebEngineHistory::currentItemIndex() const
-{
- Q_D(const QWebEngineHistory);
- return d->page->webContents()->currentNavigationEntryIndex();
-}
-
-int QWebEngineHistory::count() const
-{
- Q_D(const QWebEngineHistory);
- if (!d->page->webContents()->isInitialized())
- return 0;
- return d->page->webContents()->navigationEntryCount();
-}
-
-QDataStream& operator<<(QDataStream& stream, const QWebEngineHistory& history)
-{
- QtWebEngineCore::WebContentsAdapter *adapter = history.d_func()->page->webContents();
- if (!adapter->isInitialized())
- adapter->loadDefault();
- adapter->serializeNavigationHistory(stream);
- return stream;
-}
-
-QDataStream& operator>>(QDataStream& stream, QWebEngineHistory& history)
-{
- history.d_func()->page->recreateFromSerializedHistory(stream);
- return stream;
-}
-
-QT_END_NAMESPACE
diff --git a/src/webenginewidgets/api/qwebenginehistory.h b/src/webenginewidgets/api/qwebenginehistory.h
deleted file mode 100644
index 33d91d523..000000000
--- a/src/webenginewidgets/api/qwebenginehistory.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWEBENGINEHISTORY_H
-#define QWEBENGINEHISTORY_H
-
-#include <QtCore/qurl.h>
-#include <QtCore/qstring.h>
-#include <QtCore/qdatetime.h>
-#include <QtCore/qshareddata.h>
-#include <QtGui/qicon.h>
-#include <QtWebEngineWidgets/qtwebenginewidgetsglobal.h>
-
-QT_BEGIN_NAMESPACE
-
-class QWebEngineHistory;
-class QWebEngineHistoryItemPrivate;
-class QWebEnginePage;
-class QWebEnginePagePrivate;
-
-class QWEBENGINEWIDGETS_EXPORT QWebEngineHistoryItem {
-public:
- QWebEngineHistoryItem(const QWebEngineHistoryItem &other);
- QWebEngineHistoryItem &operator=(const QWebEngineHistoryItem &other);
- ~QWebEngineHistoryItem();
-
- QUrl originalUrl() const;
- QUrl url() const;
-
- QString title() const;
- QDateTime lastVisited() const;
- QUrl iconUrl() const;
-
- bool isValid() const;
-
- void swap(QWebEngineHistoryItem &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
-
-private:
- QWebEngineHistoryItem(QWebEngineHistoryItemPrivate *priv);
- Q_DECLARE_PRIVATE_D(d.data(), QWebEngineHistoryItem)
- QExplicitlySharedDataPointer<QWebEngineHistoryItemPrivate> d;
- friend class QWebEngineHistory;
- friend class QWebEngineHistoryPrivate;
-};
-
-Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QWebEngineHistoryItem)
-
-class QWebEngineHistoryPrivate;
-class QWEBENGINEWIDGETS_EXPORT QWebEngineHistory {
-public:
- void clear();
-
- QList<QWebEngineHistoryItem> items() const;
- QList<QWebEngineHistoryItem> backItems(int maxItems) const;
- QList<QWebEngineHistoryItem> forwardItems(int maxItems) const;
-
- bool canGoBack() const;
- bool canGoForward() const;
-
- void back();
- void forward();
- void goToItem(const QWebEngineHistoryItem &item);
-
- QWebEngineHistoryItem backItem() const;
- QWebEngineHistoryItem currentItem() const;
- QWebEngineHistoryItem forwardItem() const;
- QWebEngineHistoryItem itemAt(int i) const;
-
- int currentItemIndex() const;
-
- int count() const;
-
-private:
- QWebEngineHistory(QWebEngineHistoryPrivate *d);
- ~QWebEngineHistory();
-
- Q_DISABLE_COPY(QWebEngineHistory)
- Q_DECLARE_PRIVATE(QWebEngineHistory)
- QScopedPointer<QWebEngineHistoryPrivate> d_ptr;
-
- friend QWEBENGINEWIDGETS_EXPORT QDataStream& operator>>(QDataStream&, QWebEngineHistory&);
- friend QWEBENGINEWIDGETS_EXPORT QDataStream& operator<<(QDataStream&, const QWebEngineHistory&);
- friend class QWebEnginePage;
- friend class QWebEnginePagePrivate;
-};
-
-QWEBENGINEWIDGETS_EXPORT QDataStream& operator<<(QDataStream& stream, const QWebEngineHistory& history);
-QWEBENGINEWIDGETS_EXPORT QDataStream& operator>>(QDataStream& stream, QWebEngineHistory& history);
-
-QT_END_NAMESPACE
-
-#endif // QWEBENGINEHISTORY_H
diff --git a/src/webenginewidgets/api/qwebenginehistory_p.h b/src/webenginewidgets/api/qwebenginehistory_p.h
deleted file mode 100644
index 8f7001967..000000000
--- a/src/webenginewidgets/api/qwebenginehistory_p.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWEBENGINEHISTORY_P_H
-#define QWEBENGINEHISTORY_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtCore/qshareddata.h>
-
-QT_BEGIN_NAMESPACE
-class QWebEnginePagePrivate;
-
-class QWebEngineHistoryItemPrivate : public QSharedData
-{
-public:
- QWebEngineHistoryItemPrivate(QWebEnginePagePrivate *page = 0, int index = 0);
-
- QWebEnginePagePrivate *page;
- int index;
-};
-
-class QWebEngineHistoryPrivate
-{
-public:
- QWebEngineHistoryPrivate(QWebEnginePagePrivate *page);
- ~QWebEngineHistoryPrivate();
- void updateItems() const;
-
- QWebEnginePagePrivate *page;
- mutable QList<QWebEngineHistoryItem> items;
-};
-
-QT_END_NAMESPACE
-
-#endif // QWEBENGINEHISTORY_P_H
diff --git a/src/webenginewidgets/api/qwebenginenotificationpresenter.cpp b/src/webenginewidgets/api/qwebenginenotificationpresenter.cpp
index 667605c37..83814fe4a 100644
--- a/src/webenginewidgets/api/qwebenginenotificationpresenter.cpp
+++ b/src/webenginewidgets/api/qwebenginenotificationpresenter.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qwebenginenotificationpresenter_p.h"
@@ -46,7 +10,7 @@ QT_BEGIN_NAMESPACE
DefaultNotificationPresenter::DefaultNotificationPresenter(QObject *parent) : QObject(parent)
{
-#ifndef QT_NO_SYSTEMTRAYICON
+#if QT_CONFIG(systemtrayicon)
m_systemTrayIcon = new QSystemTrayIcon(this);
connect(m_systemTrayIcon, &QSystemTrayIcon::messageClicked, this, &DefaultNotificationPresenter::messageClicked);
#endif
@@ -66,7 +30,7 @@ void DefaultNotificationPresenter::show(std::unique_ptr<QWebEngineNotification>
m_activeNotification = std::move(notification);
-#ifndef QT_NO_SYSTEMTRAYICON
+#if QT_CONFIG(systemtrayicon)
if (m_activeNotification && m_systemTrayIcon) {
m_systemTrayIcon->setIcon(qApp->windowIcon());
m_systemTrayIcon->show();
@@ -90,7 +54,7 @@ void DefaultNotificationPresenter::messageClicked()
void DefaultNotificationPresenter::closeNotification()
{
-#ifndef QT_NO_SYSTEMTRAYICON
+#if QT_CONFIG(systemtrayicon)
const QWebEngineNotification *canceled = static_cast<const QWebEngineNotification *>(QObject::sender());
if (m_systemTrayIcon && canceled->matches(m_activeNotification.get()))
m_systemTrayIcon->hide();
@@ -107,3 +71,5 @@ void defaultNotificationPresenter(std::unique_ptr<QWebEngineNotification> notifi
QT_END_NAMESPACE
+
+#include "moc_qwebenginenotificationpresenter_p.cpp"
diff --git a/src/webenginewidgets/api/qwebenginenotificationpresenter_p.h b/src/webenginewidgets/api/qwebenginenotificationpresenter_p.h
index 49d774806..61e7f9e45 100644
--- a/src/webenginewidgets/api/qwebenginenotificationpresenter_p.h
+++ b/src/webenginewidgets/api/qwebenginenotificationpresenter_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QWEBENGINENOTIFICATIONPRESENTER_P_H
#define QWEBENGINENOTIFICATIONPRESENTER_P_H
@@ -62,7 +26,8 @@ QT_BEGIN_NAMESPACE
class QSystemTrayIcon;
-class DefaultNotificationPresenter : public QObject {
+class DefaultNotificationPresenter : public QObject
+{
Q_OBJECT
public:
DefaultNotificationPresenter(QObject *parent = nullptr);
diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp
deleted file mode 100644
index 6fb3c5c43..000000000
--- a/src/webenginewidgets/api/qwebenginepage.cpp
+++ /dev/null
@@ -1,2845 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qwebenginepage.h"
-#include "qwebenginepage_p.h"
-
-#include "authentication_dialog_controller.h"
-#include "profile_adapter.h"
-#include "certificate_error_controller.h"
-#include "color_chooser_controller.h"
-#include "favicon_manager.h"
-#include "find_text_helper.h"
-#include "file_picker_controller.h"
-#include "javascript_dialog_controller.h"
-#if QT_CONFIG(webengine_printing_and_pdf)
-#include "printer_worker.h"
-#endif
-#include "qwebenginecertificateerror.h"
-#include "qwebenginefindtextresult.h"
-#include "qwebenginefullscreenrequest.h"
-#include "qwebenginehistory.h"
-#include "qwebenginehistory_p.h"
-#include "qwebenginenotification.h"
-#include "qwebengineprofile.h"
-#include "qwebengineprofile_p.h"
-#include "qwebenginequotarequest.h"
-#include "qwebengineregisterprotocolhandlerrequest.h"
-#include "qwebenginescriptcollection_p.h"
-#include "qwebenginesettings.h"
-#include "qwebengineview.h"
-#include "qwebengineview_p.h"
-#include "user_notification_controller.h"
-#include "render_widget_host_view_qt_delegate_widget.h"
-#include "web_contents_adapter.h"
-#include "web_engine_settings.h"
-#include "qwebenginescript.h"
-
-#include <QAction>
-#include <QApplication>
-#include <QAuthenticator>
-#include <QClipboard>
-#if QT_CONFIG(colordialog)
-#include <QColorDialog>
-#endif
-#include <QContextMenuEvent>
-#if QT_CONFIG(filedialog)
-#include <QFileDialog>
-#endif
-#include <QKeyEvent>
-#include <QIcon>
-#if QT_CONFIG(inputdialog)
-#include <QInputDialog>
-#endif
-#include <QLayout>
-#include <QLoggingCategory>
-#if QT_CONFIG(menu)
-#include <QMenu>
-#endif
-#if QT_CONFIG(messagebox)
-#include <QMessageBox>
-#endif
-#include <QMimeData>
-#if QT_CONFIG(webengine_printing_and_pdf)
-#include <QPrinter>
-#include <QThread>
-#endif
-#include <QStandardPaths>
-#include <QStyle>
-#include <QTimer>
-#include <QUrl>
-
-QT_BEGIN_NAMESPACE
-
-using namespace QtWebEngineCore;
-
-static const int MaxTooltipLength = 1024;
-
-static QWebEnginePage::WebWindowType toWindowType(WebContentsAdapterClient::WindowOpenDisposition disposition)
-{
- switch (disposition) {
- case WebContentsAdapterClient::NewForegroundTabDisposition:
- return QWebEnginePage::WebBrowserTab;
- case WebContentsAdapterClient::NewBackgroundTabDisposition:
- return QWebEnginePage::WebBrowserBackgroundTab;
- case WebContentsAdapterClient::NewPopupDisposition:
- return QWebEnginePage::WebDialog;
- case WebContentsAdapterClient::NewWindowDisposition:
- return QWebEnginePage::WebBrowserWindow;
- default:
- Q_UNREACHABLE();
- }
-}
-
-QWebEnginePagePrivate::QWebEnginePagePrivate(QWebEngineProfile *_profile)
- : adapter(QSharedPointer<WebContentsAdapter>::create())
- , history(new QWebEngineHistory(new QWebEngineHistoryPrivate(this)))
- , profile(_profile ? _profile : QWebEngineProfile::defaultProfile())
- , settings(new QWebEngineSettings(profile->settings()))
- , view(0)
- , isLoading(false)
- , scriptCollection(new QWebEngineScriptCollectionPrivate(profileAdapter()->userResourceController(), adapter))
- , m_isBeingAdopted(false)
- , m_backgroundColor(Qt::white)
- , fullscreenMode(false)
- , webChannel(nullptr)
- , webChannelWorldId(QWebEngineScript::MainWorld)
- , defaultAudioMuted(false)
- , defaultZoomFactor(1.0)
-#if QT_CONFIG(webengine_printing_and_pdf)
- , currentPrinter(nullptr)
-#endif
-{
- memset(actions, 0, sizeof(actions));
-
- qRegisterMetaType<QWebEngineQuotaRequest>();
- qRegisterMetaType<QWebEngineRegisterProtocolHandlerRequest>();
- qRegisterMetaType<QWebEngineFindTextResult>();
-
- // See setVisible().
- wasShownTimer.setSingleShot(true);
- QObject::connect(&wasShownTimer, &QTimer::timeout, [this](){
- ensureInitialized();
- });
-
- profile->d_ptr->addWebContentsAdapterClient(this);
-}
-
-QWebEnginePagePrivate::~QWebEnginePagePrivate()
-{
- delete history;
- delete settings;
- profile->d_ptr->removeWebContentsAdapterClient(this);
-}
-
-RenderWidgetHostViewQtDelegate *QWebEnginePagePrivate::CreateRenderWidgetHostViewQtDelegate(RenderWidgetHostViewQtDelegateClient *client)
-{
- // Set the QWebEngineView as the parent for a popup delegate, so that the new popup window
- // responds properly to clicks in case the QWebEngineView is inside a modal QDialog. Setting the
- // parent essentially notifies the OS that the popup window is part of the modal session, and
- // should allow interaction.
- // The new delegate will not be deleted by the parent view though, because we unset the parent
- // when the parent is destroyed. The delegate will be destroyed by Chromium when the popup is
- // dismissed.
- return new RenderWidgetHostViewQtDelegateWidget(client, this->view);
-}
-
-void QWebEnginePagePrivate::initializationFinished()
-{
- if (m_backgroundColor != Qt::white)
- adapter->setBackgroundColor(m_backgroundColor);
-#if QT_CONFIG(webengine_webchannel)
- if (webChannel)
- adapter->setWebChannel(webChannel, webChannelWorldId);
-#endif
- if (defaultAudioMuted != adapter->isAudioMuted())
- adapter->setAudioMuted(defaultAudioMuted);
- if (!qFuzzyCompare(adapter->currentZoomFactor(), defaultZoomFactor))
- adapter->setZoomFactor(defaultZoomFactor);
- if (view)
- adapter->setVisible(view->isVisible());
-
- scriptCollection.d->initializationFinished(adapter);
-
- m_isBeingAdopted = false;
-}
-
-void QWebEnginePagePrivate::titleChanged(const QString &title)
-{
- Q_Q(QWebEnginePage);
- Q_EMIT q->titleChanged(title);
-}
-
-void QWebEnginePagePrivate::urlChanged()
-{
- Q_Q(QWebEnginePage);
- QUrl qurl = adapter->activeUrl();
- if (url != qurl) {
- url = qurl;
- Q_EMIT q->urlChanged(qurl);
- }
-}
-
-void QWebEnginePagePrivate::iconChanged(const QUrl &url)
-{
- Q_Q(QWebEnginePage);
- if (iconUrl == url)
- return;
- iconUrl = url;
- Q_EMIT q->iconUrlChanged(iconUrl);
- Q_EMIT q->iconChanged(adapter->faviconManager()->getIcon());
-}
-
-void QWebEnginePagePrivate::loadProgressChanged(int progress)
-{
- Q_Q(QWebEnginePage);
- QTimer::singleShot(0, q, [q, progress] () { Q_EMIT q->loadProgress(progress); });
-}
-
-void QWebEnginePagePrivate::didUpdateTargetURL(const QUrl &hoveredUrl)
-{
- Q_Q(QWebEnginePage);
- Q_EMIT q->linkHovered(hoveredUrl.toString());
-}
-
-void QWebEnginePagePrivate::selectionChanged()
-{
- Q_Q(QWebEnginePage);
- QTimer::singleShot(0, q, [this, q]() {
- updateEditActions();
- Q_EMIT q->selectionChanged();
- });
-}
-
-void QWebEnginePagePrivate::recentlyAudibleChanged(bool recentlyAudible)
-{
- Q_Q(QWebEnginePage);
- Q_EMIT q->recentlyAudibleChanged(recentlyAudible);
-}
-
-void QWebEnginePagePrivate::renderProcessPidChanged(qint64 pid)
-{
- Q_Q(QWebEnginePage);
- Q_EMIT q->renderProcessPidChanged(pid);
-}
-
-QRectF QWebEnginePagePrivate::viewportRect() const
-{
- return view ? view->rect() : QRectF();
-}
-
-QColor QWebEnginePagePrivate::backgroundColor() const
-{
- return m_backgroundColor;
-}
-
-void QWebEnginePagePrivate::loadStarted(const QUrl &provisionalUrl, bool isErrorPage)
-{
- Q_UNUSED(provisionalUrl);
- Q_Q(QWebEnginePage);
-
- if (isErrorPage)
- return;
-
- isLoading = true;
- m_certificateErrorControllers.clear();
- QTimer::singleShot(0, q, &QWebEnginePage::loadStarted);
-}
-
-void QWebEnginePagePrivate::loadFinished(bool success, const QUrl &url, bool isErrorPage, int errorCode, const QString &errorDescription)
-{
- Q_Q(QWebEnginePage);
- Q_UNUSED(url);
- Q_UNUSED(errorCode);
- Q_UNUSED(errorDescription);
-
- if (isErrorPage) {
- Q_ASSERT(settings->testAttribute(QWebEngineSettings::ErrorPageEnabled));
- QTimer::singleShot(0, q, [q](){
- emit q->loadFinished(false);
- });
- return;
- }
-
- isLoading = false;
- // Delay notifying failure until the error-page is done loading.
- // Error-pages are not loaded on failures due to abort.
- if (success || errorCode == -3 /* ERR_ABORTED*/ || !settings->testAttribute(QWebEngineSettings::ErrorPageEnabled)) {
- QTimer::singleShot(0, q, [q, success](){
- emit q->loadFinished(success);
- });
- }
-}
-
-void QWebEnginePagePrivate::didPrintPageToPdf(const QString &filePath, bool success)
-{
- Q_Q(QWebEnginePage);
- Q_EMIT q->pdfPrintingFinished(filePath, success);
-}
-
-void QWebEnginePagePrivate::focusContainer()
-{
- if (view) {
- view->activateWindow();
- view->setFocus();
- }
-}
-
-void QWebEnginePagePrivate::unhandledKeyEvent(QKeyEvent *event)
-{
- if (view && view->parentWidget())
- QGuiApplication::sendEvent(view->parentWidget(), event);
-}
-
-QSharedPointer<WebContentsAdapter>
-QWebEnginePagePrivate::adoptNewWindow(QSharedPointer<WebContentsAdapter> newWebContents,
- WindowOpenDisposition disposition, bool userGesture,
- const QRect &initialGeometry, const QUrl &targetUrl)
-{
- Q_Q(QWebEnginePage);
- Q_UNUSED(userGesture);
- Q_UNUSED(targetUrl);
-
- QWebEnginePage *newPage = q->createWindow(toWindowType(disposition));
- if (!newPage)
- return nullptr;
-
- if (!newWebContents->webContents())
- return newPage->d_func()->adapter; // Reuse existing adapter
-
- // Mark the new page as being in the process of being adopted, so that a second mouse move event
- // sent by newWebContents->initialize() gets filtered in RenderWidgetHostViewQt::forwardEvent.
- // The first mouse move event is being sent by q->createWindow(). This is necessary because
- // Chromium does not get a mouse move acknowledgment message between the two events, and
- // InputRouterImpl::ProcessMouseAck is not executed, thus all subsequent mouse move events
- // get coalesced together, and don't get processed at all.
- // The mouse move events are actually sent as a result of show() being called on
- // RenderWidgetHostViewQtDelegateWidget, both when creating the window and when initialize is
- // called.
- newPage->d_func()->m_isBeingAdopted = true;
-
- // Overwrite the new page's WebContents with ours.
- newPage->d_func()->adapter = newWebContents;
- newWebContents->setClient(newPage->d_func());
-
- if (!initialGeometry.isEmpty())
- emit newPage->geometryChangeRequested(initialGeometry);
-
- return newWebContents;
-}
-
-bool QWebEnginePagePrivate::isBeingAdopted()
-{
- return m_isBeingAdopted;
-}
-
-void QWebEnginePagePrivate::close()
-{
- Q_Q(QWebEnginePage);
- Q_EMIT q->windowCloseRequested();
-}
-
-void QWebEnginePagePrivate::windowCloseRejected()
-{
- // Do nothing for now.
-}
-
-void QWebEnginePagePrivate::didRunJavaScript(quint64 requestId, const QVariant& result)
-{
- m_callbacks.invoke(requestId, result);
-}
-
-void QWebEnginePagePrivate::didFetchDocumentMarkup(quint64 requestId, const QString& result)
-{
- m_callbacks.invoke(requestId, result);
-}
-
-void QWebEnginePagePrivate::didFetchDocumentInnerText(quint64 requestId, const QString& result)
-{
- m_callbacks.invoke(requestId, result);
-}
-
-void QWebEnginePagePrivate::didPrintPage(quint64 requestId, QSharedPointer<QByteArray> result)
-{
-#if QT_CONFIG(webengine_printing_and_pdf)
- Q_Q(QWebEnginePage);
-
- // If no currentPrinter is set that means that were printing to PDF only.
- if (!currentPrinter) {
- if (!result.data())
- return;
- m_callbacks.invoke(requestId, *(result.data()));
- return;
- }
-
- QThread *printerThread = new QThread;
- QObject::connect(printerThread, &QThread::finished, printerThread, &QThread::deleteLater);
- printerThread->start();
-
- PrinterWorker *printerWorker = new PrinterWorker(result, currentPrinter);
- QObject::connect(printerWorker, &PrinterWorker::resultReady, q, [requestId, this](bool success) {
- currentPrinter = nullptr;
- m_callbacks.invoke(requestId, success);
- });
-
- QObject::connect(printerWorker, &PrinterWorker::resultReady, printerThread, &QThread::quit);
- QObject::connect(printerThread, &QThread::finished, printerWorker, &PrinterWorker::deleteLater);
-
- printerWorker->moveToThread(printerThread);
- QMetaObject::invokeMethod(printerWorker, "print");
-
-#else
- // we should never enter this branch, but just for safe-keeping...
- Q_UNUSED(result);
- m_callbacks.invoke(requestId, QByteArray());
-#endif
-}
-
-bool QWebEnginePagePrivate::passOnFocus(bool reverse)
-{
- if (view)
- return view->focusNextPrevChild(!reverse);
- return false;
-}
-
-void QWebEnginePagePrivate::authenticationRequired(QSharedPointer<AuthenticationDialogController> controller)
-{
- Q_Q(QWebEnginePage);
- QAuthenticator networkAuth;
- networkAuth.setRealm(controller->realm());
-
- if (controller->isProxy())
- Q_EMIT q->proxyAuthenticationRequired(controller->url(), &networkAuth, controller->host());
- else
- Q_EMIT q->authenticationRequired(controller->url(), &networkAuth);
-
- // Authentication has been cancelled
- if (networkAuth.isNull()) {
- controller->reject();
- return;
- }
-
- controller->accept(networkAuth.user(), networkAuth.password());
-}
-
-void QWebEnginePagePrivate::releaseProfile()
-{
- qWarning("Release of profile requested but WebEnginePage still not deleted. Expect troubles !");
- // this is not the way to go, but might avoid the crash if user code does not make any calls to page.
- delete q_ptr->d_ptr.take();
-}
-
-void QWebEnginePagePrivate::showColorDialog(QSharedPointer<ColorChooserController> controller)
-{
-#if QT_CONFIG(colordialog)
- QColorDialog *dialog = new QColorDialog(controller.data()->initialColor(), view);
-
- QColorDialog::connect(dialog, SIGNAL(colorSelected(QColor)), controller.data(), SLOT(accept(QColor)));
- QColorDialog::connect(dialog, SIGNAL(rejected()), controller.data(), SLOT(reject()));
-
- // Delete when done
- QColorDialog::connect(dialog, SIGNAL(colorSelected(QColor)), dialog, SLOT(deleteLater()));
- QColorDialog::connect(dialog, SIGNAL(rejected()), dialog, SLOT(deleteLater()));
-
- dialog->open();
-#else
- Q_UNUSED(controller);
-#endif
-}
-
-void QWebEnginePagePrivate::runMediaAccessPermissionRequest(const QUrl &securityOrigin, WebContentsAdapterClient::MediaRequestFlags requestFlags)
-{
- Q_Q(QWebEnginePage);
- QWebEnginePage::Feature feature;
- if (requestFlags.testFlag(WebContentsAdapterClient::MediaAudioCapture) &&
- requestFlags.testFlag(WebContentsAdapterClient::MediaVideoCapture))
- feature = QWebEnginePage::MediaAudioVideoCapture;
- else if (requestFlags.testFlag(WebContentsAdapterClient::MediaAudioCapture))
- feature = QWebEnginePage::MediaAudioCapture;
- else if (requestFlags.testFlag(WebContentsAdapterClient::MediaVideoCapture))
- feature = QWebEnginePage::MediaVideoCapture;
- else if (requestFlags.testFlag(WebContentsAdapterClient::MediaDesktopAudioCapture) &&
- requestFlags.testFlag(WebContentsAdapterClient::MediaDesktopVideoCapture))
- feature = QWebEnginePage::DesktopAudioVideoCapture;
- else // if (requestFlags.testFlag(WebContentsAdapterClient::MediaDesktopVideoCapture))
- feature = QWebEnginePage::DesktopVideoCapture;
- Q_EMIT q->featurePermissionRequested(securityOrigin, feature);
-}
-
-static QWebEnginePage::Feature toFeature(QtWebEngineCore::ProfileAdapter::PermissionType type)
-{
- switch (type) {
- case QtWebEngineCore::ProfileAdapter::NotificationPermission:
- return QWebEnginePage::Notifications;
- case QtWebEngineCore::ProfileAdapter::GeolocationPermission:
- return QWebEnginePage::Geolocation;
- default:
- break;
- }
- Q_UNREACHABLE();
- return QWebEnginePage::Feature(-1);
-}
-
-void QWebEnginePagePrivate::runFeaturePermissionRequest(QtWebEngineCore::ProfileAdapter::PermissionType permission, const QUrl &securityOrigin)
-{
- Q_Q(QWebEnginePage);
- Q_EMIT q->featurePermissionRequested(securityOrigin, toFeature(permission));
-}
-
-void QWebEnginePagePrivate::runMouseLockPermissionRequest(const QUrl &securityOrigin)
-{
- Q_Q(QWebEnginePage);
- Q_EMIT q->featurePermissionRequested(securityOrigin, QWebEnginePage::MouseLock);
-}
-
-void QWebEnginePagePrivate::runQuotaRequest(QWebEngineQuotaRequest request)
-{
- Q_Q(QWebEnginePage);
- Q_EMIT q->quotaRequested(request);
-}
-
-void QWebEnginePagePrivate::runRegisterProtocolHandlerRequest(QWebEngineRegisterProtocolHandlerRequest request)
-{
- Q_Q(QWebEnginePage);
- Q_EMIT q->registerProtocolHandlerRequested(request);
-}
-
-QObject *QWebEnginePagePrivate::accessibilityParentObject()
-{
- return view;
-}
-
-void QWebEnginePagePrivate::updateAction(QWebEnginePage::WebAction action) const
-{
-#ifdef QT_NO_ACTION
- Q_UNUSED(action)
-#else
- QAction *a = actions[action];
- if (!a)
- return;
-
- bool enabled = true;
-
- switch (action) {
- case QWebEnginePage::Back:
- enabled = adapter->canGoToOffset(-1);
- break;
- case QWebEnginePage::Forward:
- enabled = adapter->canGoToOffset(1);
- break;
- case QWebEnginePage::Stop:
- enabled = isLoading;
- break;
- case QWebEnginePage::Reload:
- case QWebEnginePage::ReloadAndBypassCache:
- enabled = !isLoading;
- break;
- case QWebEnginePage::ViewSource:
- enabled = adapter->canViewSource();
- break;
- case QWebEnginePage::Cut:
- case QWebEnginePage::Copy:
- case QWebEnginePage::Unselect:
- enabled = adapter->hasFocusedFrame() && !adapter->selectedText().isEmpty();
- break;
- case QWebEnginePage::Paste:
- case QWebEnginePage::Undo:
- case QWebEnginePage::Redo:
- case QWebEnginePage::SelectAll:
- case QWebEnginePage::PasteAndMatchStyle:
- enabled = adapter->hasFocusedFrame();
- break;
- default:
- break;
- }
-
- a->setEnabled(enabled);
-#endif // QT_NO_ACTION
-}
-
-void QWebEnginePagePrivate::updateNavigationActions()
-{
- updateAction(QWebEnginePage::Back);
- updateAction(QWebEnginePage::Forward);
- updateAction(QWebEnginePage::Stop);
- updateAction(QWebEnginePage::Reload);
- updateAction(QWebEnginePage::ReloadAndBypassCache);
- updateAction(QWebEnginePage::ViewSource);
-}
-
-void QWebEnginePagePrivate::updateEditActions()
-{
- updateAction(QWebEnginePage::Cut);
- updateAction(QWebEnginePage::Copy);
- updateAction(QWebEnginePage::Paste);
- updateAction(QWebEnginePage::Undo);
- updateAction(QWebEnginePage::Redo);
- updateAction(QWebEnginePage::SelectAll);
- updateAction(QWebEnginePage::PasteAndMatchStyle);
- updateAction(QWebEnginePage::Unselect);
-}
-
-#ifndef QT_NO_ACTION
-void QWebEnginePagePrivate::_q_webActionTriggered(bool checked)
-{
- Q_Q(QWebEnginePage);
- QAction *a = qobject_cast<QAction *>(q->sender());
- if (!a)
- return;
- QWebEnginePage::WebAction action = static_cast<QWebEnginePage::WebAction>(a->data().toInt());
- q->triggerAction(action, checked);
-}
-#endif // QT_NO_ACTION
-
-void QWebEnginePagePrivate::recreateFromSerializedHistory(QDataStream &input)
-{
- QSharedPointer<WebContentsAdapter> newWebContents = WebContentsAdapter::createFromSerializedNavigationHistory(input, this);
- if (newWebContents) {
- adapter = std::move(newWebContents);
- adapter->setClient(this);
- adapter->loadDefault();
- }
-}
-
-void QWebEnginePagePrivate::updateScrollPosition(const QPointF &position)
-{
- Q_Q(QWebEnginePage);
- Q_EMIT q->scrollPositionChanged(position);
-}
-
-void QWebEnginePagePrivate::updateContentsSize(const QSizeF &size)
-{
- Q_Q(QWebEnginePage);
- Q_EMIT q->contentsSizeChanged(size);
-}
-
-void QWebEnginePagePrivate::setFullScreenMode(bool fullscreen)
-{
- if (fullscreenMode != fullscreen) {
- fullscreenMode = fullscreen;
- adapter->changedFullScreen();
- }
-}
-
-ProfileAdapter* QWebEnginePagePrivate::profileAdapter()
-{
- return profile->d_ptr->profileAdapter();
-}
-
-WebContentsAdapter *QWebEnginePagePrivate::webContentsAdapter()
-{
- ensureInitialized();
- return adapter.data();
-}
-
-const QObject *QWebEnginePagePrivate::holdingQObject() const
-{
- Q_Q(const QWebEnginePage);
- return q;
-}
-
-void QWebEnginePagePrivate::widgetChanged(RenderWidgetHostViewQtDelegate *newWidgetBase)
-{
- Q_Q(QWebEnginePage);
- bindPageAndWidget(q, static_cast<RenderWidgetHostViewQtDelegateWidget *>(newWidgetBase));
-}
-
-void QWebEnginePagePrivate::findTextFinished(const QWebEngineFindTextResult &result)
-{
- Q_Q(QWebEnginePage);
- Q_EMIT q->findTextFinished(result);
-}
-
-void QWebEnginePagePrivate::ensureInitialized() const
-{
- if (!adapter->isInitialized())
- adapter->loadDefault();
-}
-
-void QWebEnginePagePrivate::bindPageAndView(QWebEnginePage *page, QWebEngineView *view)
-{
- auto oldView = page ? page->d_func()->view : nullptr;
- auto oldPage = view ? view->d_func()->page : nullptr;
-
- bool ownNewPage = false;
- bool deleteOldPage = false;
-
- // Change pointers first.
-
- if (page && oldView != view) {
- if (oldView) {
- ownNewPage = oldView->d_func()->m_ownsPage;
- oldView->d_func()->page = nullptr;
- oldView->d_func()->m_ownsPage = false;
- }
- page->d_func()->view = view;
- }
-
- if (view && oldPage != page) {
- if (oldPage) {
- if (oldPage->d_func())
- oldPage->d_func()->view = nullptr;
- deleteOldPage = view->d_func()->m_ownsPage;
- }
- view->d_func()->m_ownsPage = ownNewPage;
- view->d_func()->page = page;
- }
-
- // Then notify.
-
- auto widget = page ? page->d_func()->widget : nullptr;
- auto oldWidget = (oldPage && oldPage->d_func()) ? oldPage->d_func()->widget : nullptr;
-
- if (page && oldView != view && oldView) {
- oldView->d_func()->pageChanged(page, nullptr);
- if (widget)
- oldView->d_func()->widgetChanged(widget, nullptr);
- }
-
- if (view && oldPage != page) {
- if (oldPage && oldPage->d_func())
- view->d_func()->pageChanged(oldPage, page);
- else
- view->d_func()->pageChanged(nullptr, page);
- if (oldWidget != widget)
- view->d_func()->widgetChanged(oldWidget, widget);
- }
- if (deleteOldPage)
- delete oldPage;
-}
-
-void QWebEnginePagePrivate::bindPageAndWidget(QWebEnginePage *page, RenderWidgetHostViewQtDelegateWidget *widget)
-{
- auto oldPage = widget ? widget->m_page : nullptr;
- auto oldWidget = page ? page->d_func()->widget : nullptr;
-
- // Change pointers first.
-
- if (widget && oldPage != page) {
- if (oldPage && oldPage->d_func())
- oldPage->d_func()->widget = nullptr;
- widget->m_page = page;
- }
-
- if (page && oldWidget != widget) {
- if (oldWidget)
- oldWidget->m_page = nullptr;
- page->d_func()->widget = widget;
- }
-
- // Then notify.
-
- if (widget && oldPage != page && oldPage && oldPage->d_func()) {
- if (auto oldView = oldPage->d_func()->view)
- oldView->d_func()->widgetChanged(widget, nullptr);
- }
-
- if (page && oldWidget != widget) {
- if (auto view = page->d_func()->view)
- view->d_func()->widgetChanged(oldWidget, widget);
- }
-}
-
-QWebEnginePage::QWebEnginePage(QObject* parent)
- : QObject(parent)
- , d_ptr(new QWebEnginePagePrivate())
-{
- Q_D(QWebEnginePage);
- d->q_ptr = this;
- d->adapter->setClient(d);
-}
-
-/*!
- \fn void QWebEnginePage::findTextFinished(const QWebEngineFindTextResult &result)
- \since 5.14
-
- This signal is emitted when a search string search on a page is completed. \a result is
- the result of the string search.
-
- \sa findText()
-*/
-
-/*!
- \fn void QWebEnginePage::printRequested()
- \since 5.12
-
- This signal is emitted when the JavaScript \c{window.print()} method is called.
- Typically, the signal handler can simply call printToPdf().
-
- \sa printToPdf()
-*/
-
-/*!
- \enum QWebEnginePage::RenderProcessTerminationStatus
- \since 5.6
-
- This enum describes the status with which the render process terminated:
-
- \value NormalTerminationStatus
- The render process terminated normally.
- \value AbnormalTerminationStatus
- The render process terminated with with a non-zero exit status.
- \value CrashedTerminationStatus
- The render process crashed, for example because of a segmentation fault.
- \value KilledTerminationStatus
- The render process was killed, for example by \c SIGKILL or task manager kill.
-*/
-
-/*!
- \fn QWebEnginePage::renderProcessTerminated(RenderProcessTerminationStatus terminationStatus, int exitCode)
- \since 5.6
-
- This signal is emitted when the render process is terminated with a non-zero exit status.
- \a terminationStatus is the termination status of the process and \a exitCode is the status code
- with which the process terminated.
-*/
-
-/*!
- \fn QWebEnginePage::fullScreenRequested(QWebEngineFullScreenRequest fullScreenRequest)
-
- This signal is emitted when the web page issues the request to enter fullscreen mode for
- a web-element, usually a video element.
-
- The request object \a fullScreenRequest can be used to accept or reject the request.
-
- If the request is accepted the element requesting fullscreen will fill the viewport,
- but it is up to the application to make the view fullscreen or move the page to a view
- that is fullscreen.
-
- \sa QWebEngineSettings::FullScreenSupportEnabled
-*/
-
-/*!
- \fn QWebEnginePage::quotaRequested(QWebEngineQuotaRequest quotaRequest)
- \since 5.11
-
- This signal is emitted when the web page requests larger persistent storage
- than the application's current allocation in File System API. The default quota
- is 0 bytes.
-
- The request object \a quotaRequest can be used to accept or reject the request.
-*/
-
-/*!
- \fn QWebEnginePage::registerProtocolHandlerRequested(QWebEngineRegisterProtocolHandlerRequest request)
- \since 5.11
-
- This signal is emitted when the web page tries to register a custom protocol
- using the \l registerProtocolHandler API.
-
- The request object \a request can be used to accept or reject the request:
-
- \snippet webenginewidgets/simplebrowser/webpage.cpp registerProtocolHandlerRequested
-*/
-
-/*!
- \fn void QWebEnginePage::pdfPrintingFinished(const QString &filePath, bool success)
- \since 5.9
-
- This signal is emitted when printing the web page into a PDF file has
- finished.
- \a filePath will contain the path the file was requested to be created
- at, and \a success will be \c true if the file was successfully created and
- \c false otherwise.
-
- \sa printToPdf()
-*/
-
-/*!
- \property QWebEnginePage::scrollPosition
- \since 5.7
-
- \brief The scroll position of the page contents.
-*/
-
-/*!
- \property QWebEnginePage::contentsSize
- \since 5.7
-
- \brief The size of the page contents.
-*/
-
-/*!
- \fn void QWebEnginePage::audioMutedChanged(bool muted)
- \since 5.7
-
- This signal is emitted when the page's \a muted state changes.
- \note Not to be confused with a specific HTML5 audio or video element being muted.
-*/
-
-/*!
- \fn void QWebEnginePage::recentlyAudibleChanged(bool recentlyAudible);
- \since 5.7
-
- This signal is emitted when the page's audible state, \a recentlyAudible, changes, because
- the audio is played or stopped.
-
- \note The signal is also emitted when calling the setAudioMuted() method.
- Also, if the audio is paused, this signal is emitted with an approximate \b{two-second
- delay}, from the moment the audio is paused.
-*/
-
-/*!
- \fn void QWebEnginePage::renderProcessPidChanged(qint64 pid);
- \since 5.15
-
- This signal is emitted when the underlying render process PID, \a renderProcessPid, changes.
-*/
-
-/*!
- \fn void QWebEnginePage::iconUrlChanged(const QUrl &url)
-
- This signal is emitted when the URL of the icon ("favicon") associated with the
- page is changed. The new URL is specified by \a url.
-
- \sa iconUrl(), icon(), iconChanged()
-*/
-
-/*!
- \fn void QWebEnginePage::iconChanged(const QIcon &icon)
- \since 5.7
-
- This signal is emitted when the icon ("favicon") associated with the
- page is changed. The new icon is specified by \a icon.
-
- \sa icon(), iconUrl(), iconUrlChanged()
-*/
-
-/*!
- Constructs an empty web engine page in the web engine profile \a profile with the parent
- \a parent.
-
- If the profile is not the default profile, the caller must ensure that the profile stays alive
- for as long as the page does.
-
- \since 5.5
-*/
-QWebEnginePage::QWebEnginePage(QWebEngineProfile *profile, QObject* parent)
- : QObject(parent)
- , d_ptr(new QWebEnginePagePrivate(profile))
-{
- Q_D(QWebEnginePage);
- d->q_ptr = this;
- d->adapter->setClient(d);
-}
-
-QWebEnginePage::~QWebEnginePage()
-{
- if (d_ptr) {
- // d_ptr might be exceptionally null if profile adapter got deleted first
- setDevToolsPage(nullptr);
- QWebEnginePagePrivate::bindPageAndView(this, nullptr);
- QWebEnginePagePrivate::bindPageAndWidget(this, nullptr);
- }
-}
-
-QWebEngineHistory *QWebEnginePage::history() const
-{
- Q_D(const QWebEnginePage);
- return d->history;
-}
-
-QWebEngineSettings *QWebEnginePage::settings() const
-{
- Q_D(const QWebEnginePage);
- return d->settings;
-}
-
-/*!
- * Returns a pointer to the web channel instance used by this page or a null pointer if none was set.
- * This channel automatically uses the internal web engine transport mechanism over Chromium IPC
- * that is exposed in the JavaScript context of this page as \c qt.webChannelTransport.
- *
- * \since 5.5
- * \sa setWebChannel()
- */
-QWebChannel *QWebEnginePage::webChannel() const
-{
-#if QT_CONFIG(webengine_webchannel)
- Q_D(const QWebEnginePage);
- return d->webChannel;
-#endif
- qWarning("WebEngine compiled without webchannel support");
- return nullptr;
-}
-
-/*!
- * \overload
- *
- * Sets the web channel instance to be used by this page to \a channel and installs
- * it in the main JavaScript world.
- *
- * With this method the web channel can be accessed by web page content. If the content
- * is not under your control and might be hostile, this could be a security issue and
- * you should consider installing it in a private JavaScript world.
- *
- * \since 5.5
- * \sa QWebEngineScript::MainWorld
- */
-
-void QWebEnginePage::setWebChannel(QWebChannel *channel)
-{
- setWebChannel(channel, QWebEngineScript::MainWorld);
-}
-
-/*!
- * Sets the web channel instance to be used by this page to \a channel and connects it to
- * web engine's transport using Chromium IPC messages. The transport is exposed in the JavaScript
- * world \a worldId as
- * \c qt.webChannelTransport, which should be used when using the \l{Qt WebChannel JavaScript API}.
- *
- * \note The page does not take ownership of the channel object.
- * \note Only one web channel can be installed per page, setting one even in another JavaScript
- * world uninstalls any already installed web channel.
- *
- * \since 5.7
- * \sa QWebEngineScript::ScriptWorldId
- */
-void QWebEnginePage::setWebChannel(QWebChannel *channel, uint worldId)
-{
-#if QT_CONFIG(webengine_webchannel)
- Q_D(QWebEnginePage);
- if (d->webChannel != channel || d->webChannelWorldId != worldId) {
- d->webChannel = channel;
- d->webChannelWorldId = worldId;
- d->adapter->setWebChannel(channel, worldId);
- }
-#else
- Q_UNUSED(channel)
- Q_UNUSED(worldId)
- qWarning("WebEngine compiled without webchannel support");
-#endif
-}
-
-/*!
- \property QWebEnginePage::backgroundColor
- \brief The page's background color behind the document's body.
- \since 5.6
-
- You can set the background color to Qt::transparent or to a translucent
- color to see through the document, or you can set it to match your
- web content in a hybrid application to prevent the white flashes that may appear
- during loading.
-
- The default value is white.
-*/
-QColor QWebEnginePage::backgroundColor() const
-{
- Q_D(const QWebEnginePage);
- return d->m_backgroundColor;
-}
-
-void QWebEnginePage::setBackgroundColor(const QColor &color)
-{
- Q_D(QWebEnginePage);
- if (d->m_backgroundColor == color)
- return;
- d->m_backgroundColor = color;
- d->adapter->setBackgroundColor(color);
-}
-
-/*!
- * Save the currently loaded web page to disk.
- *
- * The web page is saved to \a filePath in the specified \a{format}.
- *
- * This is a short cut for the following actions:
- * \list
- * \li Trigger the Save web action.
- * \li Accept the next download item and set the specified file path and save format.
- * \endlist
- *
- * This function issues an asynchronous download request for the web page and returns immediately.
- *
- * \sa QWebEngineDownloadItem::SavePageFormat
- * \since 5.8
- */
-void QWebEnginePage::save(const QString &filePath,
- QWebEngineDownloadItem::SavePageFormat format) const
-{
- Q_D(const QWebEnginePage);
- d->ensureInitialized();
- d->adapter->save(filePath, format);
-}
-
-/*!
- \property QWebEnginePage::audioMuted
- \brief Whether the current page audio is muted.
- \since 5.7
-
- The default value is \c false.
- \sa recentlyAudible
-*/
-bool QWebEnginePage::isAudioMuted() const {
- Q_D(const QWebEnginePage);
- if (d->adapter->isInitialized())
- return d->adapter->isAudioMuted();
- return d->defaultAudioMuted;
-}
-
-void QWebEnginePage::setAudioMuted(bool muted) {
- Q_D(QWebEnginePage);
- bool wasAudioMuted = isAudioMuted();
- d->defaultAudioMuted = muted;
- d->adapter->setAudioMuted(muted);
- if (wasAudioMuted != isAudioMuted())
- Q_EMIT audioMutedChanged(muted);
-}
-
-/*!
- \property QWebEnginePage::recentlyAudible
- \brief The current page's \e {audible state}, that is, whether audio was recently played
- or not.
- \since 5.7
-
- The default value is \c false.
- \sa audioMuted
-*/
-bool QWebEnginePage::recentlyAudible() const
-{
- Q_D(const QWebEnginePage);
- return d->adapter->isInitialized() && d->adapter->recentlyAudible();
-}
-
-/*!
- \property QWebEnginePage::renderProcessPid
- \brief The process ID (PID) of the render process assigned to the current
- page's main frame.
- \since 5.15
-
- If no render process is available yet, \c 0 is returned.
-*/
-qint64 QWebEnginePage::renderProcessPid() const
-{
- Q_D(const QWebEnginePage);
- return d->adapter->renderProcessPid();
-}
-
-void QWebEnginePage::setView(QWidget *newViewBase)
-{
- QWebEnginePagePrivate::bindPageAndView(this, qobject_cast<QWebEngineView *>(newViewBase));
-}
-
-QWidget *QWebEnginePage::view() const
-{
- Q_D(const QWebEnginePage);
- return d->view;
-}
-
-/*!
- Returns the web engine profile the page belongs to.
- \since 5.5
-*/
-QWebEngineProfile *QWebEnginePage::profile() const
-{
- Q_D(const QWebEnginePage);
- return d->profile;
-}
-
-bool QWebEnginePage::hasSelection() const
-{
- return !selectedText().isEmpty();
-}
-
-QString QWebEnginePage::selectedText() const
-{
- Q_D(const QWebEnginePage);
- return d->adapter->selectedText();
-}
-
-#ifndef QT_NO_ACTION
-QAction *QWebEnginePage::action(WebAction action) const
-{
- Q_D(const QWebEnginePage);
- if (action == QWebEnginePage::NoWebAction)
- return 0;
- if (d->actions[action])
- return d->actions[action];
-
- QString text;
- QIcon icon;
- QStyle *style = d->view ? d->view->style() : qApp->style();
-
- switch (action) {
- case Back:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Back);
- icon = style->standardIcon(QStyle::SP_ArrowBack);
- break;
- case Forward:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Forward);
- icon = style->standardIcon(QStyle::SP_ArrowForward);
- break;
- case Stop:
- text = tr("Stop");
- icon = style->standardIcon(QStyle::SP_BrowserStop);
- break;
- case Reload:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Reload);
- icon = style->standardIcon(QStyle::SP_BrowserReload);
- break;
- case ReloadAndBypassCache:
- text = tr("Reload and Bypass Cache");
- icon = style->standardIcon(QStyle::SP_BrowserReload);
- break;
- case Cut:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Cut);
- break;
- case Copy:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Copy);
- break;
- case Paste:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Paste);
- break;
- case Undo:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Undo);
- break;
- case Redo:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::Redo);
- break;
- case SelectAll:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::SelectAll);
- break;
- case PasteAndMatchStyle:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::PasteAndMatchStyle);
- break;
- case OpenLinkInThisWindow:
- text = tr("Open link in this window");
- break;
- case OpenLinkInNewWindow:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::OpenLinkInNewWindow);
- break;
- case OpenLinkInNewTab:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::OpenLinkInNewTab);
- break;
- case OpenLinkInNewBackgroundTab:
- text = tr("Open link in new background tab");
- break;
- case CopyLinkToClipboard:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::CopyLinkToClipboard);
- break;
- case DownloadLinkToDisk:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::DownloadLinkToDisk);
- break;
- case CopyImageToClipboard:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::CopyImageToClipboard);
- break;
- case CopyImageUrlToClipboard:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::CopyImageUrlToClipboard);
- break;
- case DownloadImageToDisk:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::DownloadImageToDisk);
- break;
- case CopyMediaUrlToClipboard:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::CopyMediaUrlToClipboard);
- break;
- case ToggleMediaControls:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::ToggleMediaControls);
- break;
- case ToggleMediaLoop:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::ToggleMediaLoop);
- break;
- case ToggleMediaPlayPause:
- text = tr("Toggle Play/Pause");
- break;
- case ToggleMediaMute:
- text = tr("Toggle Mute");
- break;
- case DownloadMediaToDisk:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::DownloadMediaToDisk);
- break;
- case InspectElement:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::InspectElement);
- break;
- case ExitFullScreen:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::ExitFullScreen);
- break;
- case RequestClose:
- text = tr("Close Page");
- break;
- case Unselect:
- text = tr("Unselect");
- break;
- case SavePage:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::SavePage);
- break;
- case ViewSource:
- text = RenderViewContextMenuQt::getMenuItemName(RenderViewContextMenuQt::ContextMenuItem::ViewSource);
- break;
- case ToggleBold:
- text = tr("&Bold");
- break;
- case ToggleItalic:
- text = tr("&Italic");
- break;
- case ToggleUnderline:
- text = tr("&Underline");
- break;
- case ToggleStrikethrough:
- text = tr("&Strikethrough");
- break;
- case AlignLeft:
- text = tr("Align &Left");
- break;
- case AlignCenter:
- text = tr("Align &Center");
- break;
- case AlignRight:
- text = tr("Align &Right");
- break;
- case AlignJustified:
- text = tr("Align &Justified");
- break;
- case Indent:
- text = tr("&Indent");
- break;
- case Outdent:
- text = tr("&Outdent");
- break;
- case InsertOrderedList:
- text = tr("Insert &Ordered List");
- break;
- case InsertUnorderedList:
- text = tr("Insert &Unordered List");
- break;
- case NoWebAction:
- case WebActionCount:
- Q_UNREACHABLE();
- break;
- }
-
- QAction *a = new QAction(const_cast<QWebEnginePage*>(this));
- a->setText(text);
- a->setData(action);
- a->setIcon(icon);
-
- connect(a, SIGNAL(triggered(bool)), this, SLOT(_q_webActionTriggered(bool)));
-
- d->actions[action] = a;
- d->updateAction(action);
- return a;
-}
-#endif // QT_NO_ACTION
-
-void QWebEnginePage::triggerAction(WebAction action, bool)
-{
- Q_D(QWebEnginePage);
- d->ensureInitialized();
- const QtWebEngineCore::WebEngineContextMenuData *menuData = d->contextData.d;
- switch (action) {
- case Back:
- d->adapter->navigateBack();
- break;
- case Forward:
- d->adapter->navigateForward();
- break;
- case Stop:
- d->adapter->stop();
- break;
- case Reload:
- d->adapter->reload();
- break;
- case ReloadAndBypassCache:
- d->adapter->reloadAndBypassCache();
- break;
- case Cut:
- d->adapter->cut();
- break;
- case Copy:
- d->adapter->copy();
- break;
- case Paste:
- d->adapter->paste();
- break;
- case Undo:
- d->adapter->undo();
- break;
- case Redo:
- d->adapter->redo();
- break;
- case SelectAll:
- d->adapter->selectAll();
- break;
- case PasteAndMatchStyle:
- d->adapter->pasteAndMatchStyle();
- break;
- case Unselect:
- d->adapter->unselect();
- break;
- case OpenLinkInThisWindow:
- if (menuData && menuData->linkUrl().isValid())
- setUrl(menuData->linkUrl());
- break;
- case OpenLinkInNewWindow:
- if (menuData && menuData->linkUrl().isValid()) {
- QWebEnginePage *newPage = createWindow(WebBrowserWindow);
- if (newPage)
- newPage->setUrl(menuData->linkUrl());
- }
- break;
- case OpenLinkInNewTab:
- if (menuData && menuData->linkUrl().isValid()) {
- QWebEnginePage *newPage = createWindow(WebBrowserTab);
- if (newPage)
- newPage->setUrl(menuData->linkUrl());
- }
- break;
- case OpenLinkInNewBackgroundTab:
- if (menuData && menuData->linkUrl().isValid()) {
- QWebEnginePage *newPage = createWindow(WebBrowserBackgroundTab);
- if (newPage)
- newPage->setUrl(menuData->linkUrl());
- }
- break;
- case CopyLinkToClipboard:
- if (menuData && !menuData->unfilteredLinkUrl().isEmpty()) {
- QString urlString = menuData->unfilteredLinkUrl().toString(QUrl::FullyEncoded);
- QString linkText = menuData->linkText().toHtmlEscaped();
- QString title = menuData->titleText();
- if (!title.isEmpty())
- title = QStringLiteral(" title=\"%1\"").arg(title.toHtmlEscaped());
- QMimeData *data = new QMimeData();
- data->setText(urlString);
- QString html = QStringLiteral("<a href=\"") + urlString + QStringLiteral("\"") + title + QStringLiteral(">")
- + linkText + QStringLiteral("</a>");
- data->setHtml(html);
- data->setUrls(QList<QUrl>() << menuData->unfilteredLinkUrl());
- qApp->clipboard()->setMimeData(data);
- }
- break;
- case DownloadLinkToDisk:
- if (menuData && menuData->linkUrl().isValid())
- d->adapter->download(menuData->linkUrl(), menuData->suggestedFileName(),
- menuData->referrerUrl(), menuData->referrerPolicy());
-
- break;
- case CopyImageToClipboard:
- if (menuData && menuData->hasImageContent() &&
- (menuData->mediaType() == WebEngineContextMenuData::MediaTypeImage ||
- menuData->mediaType() == WebEngineContextMenuData::MediaTypeCanvas))
- {
- d->adapter->copyImageAt(menuData->position());
- }
- break;
- case CopyImageUrlToClipboard:
- if (menuData && menuData->mediaUrl().isValid() && menuData->mediaType() == WebEngineContextMenuData::MediaTypeImage) {
- QString urlString = menuData->mediaUrl().toString(QUrl::FullyEncoded);
- QString alt = menuData->altText();
- if (!alt.isEmpty())
- alt = QStringLiteral(" alt=\"%1\"").arg(alt.toHtmlEscaped());
- QString title = menuData->titleText();
- if (!title.isEmpty())
- title = QStringLiteral(" title=\"%1\"").arg(title.toHtmlEscaped());
- QMimeData *data = new QMimeData();
- data->setText(urlString);
- QString html = QStringLiteral("<img src=\"") + urlString + QStringLiteral("\"") + title + alt + QStringLiteral("></img>");
- data->setHtml(html);
- data->setUrls(QList<QUrl>() << menuData->mediaUrl());
- qApp->clipboard()->setMimeData(data);
- }
- break;
- case DownloadImageToDisk:
- case DownloadMediaToDisk:
- if (menuData && menuData->mediaUrl().isValid())
- d->adapter->download(menuData->mediaUrl(), menuData->suggestedFileName(),
- menuData->referrerUrl(), menuData->referrerPolicy());
- break;
- case CopyMediaUrlToClipboard:
- if (menuData && menuData->mediaUrl().isValid() &&
- (menuData->mediaType() == WebEngineContextMenuData::MediaTypeAudio ||
- menuData->mediaType() == WebEngineContextMenuData::MediaTypeVideo))
- {
- QString urlString = menuData->mediaUrl().toString(QUrl::FullyEncoded);
- QString title = menuData->titleText();
- if (!title.isEmpty())
- title = QStringLiteral(" title=\"%1\"").arg(title.toHtmlEscaped());
- QMimeData *data = new QMimeData();
- data->setText(urlString);
- if (menuData->mediaType() == WebEngineContextMenuData::MediaTypeAudio)
- data->setHtml(QStringLiteral("<audio src=\"") + urlString + QStringLiteral("\"") + title +
- QStringLiteral("></audio>"));
- else
- data->setHtml(QStringLiteral("<video src=\"") + urlString + QStringLiteral("\"") + title +
- QStringLiteral("></video>"));
- data->setUrls(QList<QUrl>() << menuData->mediaUrl());
- qApp->clipboard()->setMimeData(data);
- }
- break;
- case ToggleMediaControls:
- if (menuData && menuData->mediaUrl().isValid() && menuData->mediaFlags() & WebEngineContextMenuData::MediaCanToggleControls) {
- bool enable = !(menuData->mediaFlags() & WebEngineContextMenuData::MediaControls);
- d->adapter->executeMediaPlayerActionAt(menuData->position(), WebContentsAdapter::MediaPlayerControls, enable);
- }
- break;
- case ToggleMediaLoop:
- if (menuData && menuData->mediaUrl().isValid() &&
- (menuData->mediaType() == WebEngineContextMenuData::MediaTypeAudio ||
- menuData->mediaType() == WebEngineContextMenuData::MediaTypeVideo))
- {
- bool enable = !(menuData->mediaFlags() & WebEngineContextMenuData::MediaLoop);
- d->adapter->executeMediaPlayerActionAt(menuData->position(), WebContentsAdapter::MediaPlayerLoop, enable);
- }
- break;
- case ToggleMediaPlayPause:
- if (menuData && menuData->mediaUrl().isValid() &&
- (menuData->mediaType() == WebEngineContextMenuData::MediaTypeAudio ||
- menuData->mediaType() == WebEngineContextMenuData::MediaTypeVideo))
- {
- bool enable = (menuData->mediaFlags() & WebEngineContextMenuData::MediaPaused);
- d->adapter->executeMediaPlayerActionAt(menuData->position(), WebContentsAdapter::MediaPlayerPlay, enable);
- }
- break;
- case ToggleMediaMute:
- if (menuData && menuData->mediaUrl().isValid() && menuData->mediaFlags() & WebEngineContextMenuData::MediaHasAudio) {
- // Make sure to negate the value, so that toggling actually works.
- bool enable = !(menuData->mediaFlags() & WebEngineContextMenuData::MediaMuted);
- d->adapter->executeMediaPlayerActionAt(menuData->position(), WebContentsAdapter::MediaPlayerMute, enable);
- }
- break;
- case InspectElement:
- if (menuData)
- d->adapter->inspectElementAt(menuData->position());
- break;
- case ExitFullScreen:
- // See under ViewSource, anything that can trigger a delete of the current view is dangerous to call directly here.
- QTimer::singleShot(0, this, [d](){ d->adapter->exitFullScreen(); });
- break;
- case RequestClose:
- d->adapter->requestClose();
- break;
- case SavePage:
- d->adapter->save();
- break;
- case ViewSource:
- // This is a workaround to make the ViewSource action working in a context menu.
- // The WebContentsAdapter::viewSource() method deletes a
- // RenderWidgetHostViewQtDelegateWidget instance which passes the control to the event
- // loop. If the QMenu::aboutToHide() signal is connected to the QObject::deleteLater()
- // slot the QMenu is deleted by the event handler while the ViewSource action is still not
- // completed. This may lead to a crash. To avoid this the WebContentsAdapter::viewSource()
- // method is called indirectly via the QTimer::singleShot() function which schedules the
- // the viewSource() call after the QMenu's destruction.
- QTimer::singleShot(0, this, [d](){ d->adapter->viewSource(); });
- break;
- case ToggleBold:
- runJavaScript(QStringLiteral("document.execCommand('bold');"), QWebEngineScript::ApplicationWorld);
- break;
- case ToggleItalic:
- runJavaScript(QStringLiteral("document.execCommand('italic');"), QWebEngineScript::ApplicationWorld);
- break;
- case ToggleUnderline:
- runJavaScript(QStringLiteral("document.execCommand('underline');"), QWebEngineScript::ApplicationWorld);
- break;
- case ToggleStrikethrough:
- runJavaScript(QStringLiteral("document.execCommand('strikethrough');"), QWebEngineScript::ApplicationWorld);
- break;
- case AlignLeft:
- runJavaScript(QStringLiteral("document.execCommand('justifyLeft');"), QWebEngineScript::ApplicationWorld);
- break;
- case AlignCenter:
- runJavaScript(QStringLiteral("document.execCommand('justifyCenter');"), QWebEngineScript::ApplicationWorld);
- break;
- case AlignRight:
- runJavaScript(QStringLiteral("document.execCommand('justifyRight');"), QWebEngineScript::ApplicationWorld);
- break;
- case AlignJustified:
- runJavaScript(QStringLiteral("document.execCommand('justifyFull');"), QWebEngineScript::ApplicationWorld);
- break;
- case Indent:
- runJavaScript(QStringLiteral("document.execCommand('indent');"), QWebEngineScript::ApplicationWorld);
- break;
- case Outdent:
- runJavaScript(QStringLiteral("document.execCommand('outdent');"), QWebEngineScript::ApplicationWorld);
- break;
- case InsertOrderedList:
- runJavaScript(QStringLiteral("document.execCommand('insertOrderedList');"), QWebEngineScript::ApplicationWorld);
- break;
- case InsertUnorderedList:
- runJavaScript(QStringLiteral("document.execCommand('insertUnorderedList');"), QWebEngineScript::ApplicationWorld);
- break;
- case NoWebAction:
- break;
- case WebActionCount:
- Q_UNREACHABLE();
- break;
- }
-}
-
-/*!
- * \since 5.8
- * Replace the current misspelled word with \a replacement.
- *
- * The current misspelled word can be found in QWebEngineContextMenuData::misspelledWord(),
- * and suggested replacements in QWebEngineContextMenuData::spellCheckerSuggestions().
- *
- * \sa contextMenuData(),
- */
-
-void QWebEnginePage::replaceMisspelledWord(const QString &replacement)
-{
- Q_D(QWebEnginePage);
- d->adapter->replaceMisspelling(replacement);
-}
-
-void QWebEnginePage::findText(const QString &subString, FindFlags options, const QWebEngineCallback<bool> &resultCallback)
-{
- Q_D(QWebEnginePage);
- if (!d->adapter->isInitialized()) {
- QtWebEngineCore::CallbackDirectory().invokeEmpty(resultCallback);
- return;
- }
-
- d->adapter->findTextHelper()->startFinding(subString, options & FindCaseSensitively, options & FindBackward, resultCallback);
-}
-
-/*!
- * \reimp
- */
-bool QWebEnginePage::event(QEvent *e)
-{
- return QObject::event(e);
-}
-
-void QWebEnginePagePrivate::contextMenuRequested(const WebEngineContextMenuData &data)
-{
-#if QT_CONFIG(action)
- if (!view)
- return;
-
- contextData.reset();
- switch (view->contextMenuPolicy()) {
- case Qt::DefaultContextMenu:
- {
- contextData = data;
- QContextMenuEvent event(QContextMenuEvent::Mouse, data.position(), view->mapToGlobal(data.position()));
- view->contextMenuEvent(&event);
- return;
- }
- case Qt::CustomContextMenu:
- contextData = data;
- Q_EMIT view->customContextMenuRequested(data.position());
- return;
- case Qt::ActionsContextMenu:
- if (view->actions().count()) {
- QContextMenuEvent event(QContextMenuEvent::Mouse, data.position(), view->mapToGlobal(data.position()));
- QMenu::exec(view->actions(), event.globalPos(), 0, view);
- }
- return;
- case Qt::PreventContextMenu:
- case Qt::NoContextMenu:
- return;
- }
-
- Q_UNREACHABLE();
-#else
- Q_UNUSED(data);
-#endif // QT_CONFIG(action)
-}
-
-void QWebEnginePagePrivate::navigationRequested(int navigationType, const QUrl &url, int &navigationRequestAction, bool isMainFrame)
-{
- Q_Q(QWebEnginePage);
- bool accepted = q->acceptNavigationRequest(url, static_cast<QWebEnginePage::NavigationType>(navigationType), isMainFrame);
- if (accepted && adapter->findTextHelper()->isFindTextInProgress())
- adapter->findTextHelper()->stopFinding();
- navigationRequestAction = accepted ? WebContentsAdapterClient::AcceptRequest : WebContentsAdapterClient::IgnoreRequest;
-}
-
-void QWebEnginePagePrivate::requestFullScreenMode(const QUrl &origin, bool fullscreen)
-{
- Q_Q(QWebEnginePage);
- QWebEngineFullScreenRequest request(q, origin, fullscreen);
- Q_EMIT q->fullScreenRequested(request);
-}
-
-bool QWebEnginePagePrivate::isFullScreenMode() const
-{
- return fullscreenMode;
-}
-
-void QWebEnginePagePrivate::javascriptDialog(QSharedPointer<JavaScriptDialogController> controller)
-{
- Q_Q(QWebEnginePage);
- bool accepted = false;
- QString promptResult;
- switch (controller->type()) {
- case AlertDialog:
- q->javaScriptAlert(controller->securityOrigin(), controller->message());
- accepted = true;
- break;
- case ConfirmDialog:
- accepted = q->javaScriptConfirm(controller->securityOrigin(), controller->message());
- break;
- case PromptDialog:
- accepted = q->javaScriptPrompt(controller->securityOrigin(), controller->message(), controller->defaultPrompt(), &promptResult);
- if (accepted)
- controller->textProvided(promptResult);
- break;
- case UnloadDialog:
- accepted = q->javaScriptConfirm(controller->securityOrigin(), QCoreApplication::translate("QWebEnginePage", "Are you sure you want to leave this page? Changes that you made may not be saved."));
- break;
- case InternalAuthorizationDialog:
-#if QT_CONFIG(messagebox)
- accepted = (QMessageBox::question(view, controller->title(), controller->message(), QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes);
-#endif // QT_CONFIG(messagebox)
- break;
- }
- if (accepted)
- controller->accept();
- else
- controller->reject();
-}
-
-void QWebEnginePagePrivate::allowCertificateError(const QSharedPointer<CertificateErrorController> &controller)
-{
- Q_Q(QWebEnginePage);
- bool accepted = false;
-
- QWebEngineCertificateError error(controller);
- accepted = q->certificateError(error);
- if (error.deferred() && !error.answered())
- m_certificateErrorControllers.append(controller);
- else if (!error.answered())
- controller->accept(error.isOverridable() && accepted);
-}
-
-void QWebEnginePagePrivate::selectClientCert(const QSharedPointer<ClientCertSelectController> &controller)
-{
-#if !defined(QT_NO_SSL) || QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
- Q_Q(QWebEnginePage);
- QWebEngineClientCertificateSelection certSelection(controller);
-
- Q_EMIT q->selectClientCertificate(certSelection);
-#else
- Q_UNUSED(controller);
-#endif
-}
-
-#if !defined(QT_NO_SSL) || QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
-/*!
- \fn void QWebEnginePage::selectClientCertificate(QWebEngineClientCertificateSelection clientCertificateSelection)
- \since 5.12
-
- This signal is emitted when a web site requests an SSL client certificate, and one or more were
- found in system's client certificate store.
-
- Handling the signal is asynchronous, and loading will be waiting until a certificate is selected,
- or the last copy of \a clientCertificateSelection is destroyed.
-
- If the signal is not handled, \a clientCertificateSelection is automatically destroyed, and loading
- will continue without a client certificate.
-
- \sa QWebEngineClientCertificateSelection
-*/
-#endif
-
-void QWebEnginePagePrivate::javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString &message, int lineNumber, const QString &sourceID)
-{
- Q_Q(QWebEnginePage);
- q->javaScriptConsoleMessage(static_cast<QWebEnginePage::JavaScriptConsoleMessageLevel>(level), message, lineNumber, sourceID);
-}
-
-void QWebEnginePagePrivate::renderProcessTerminated(RenderProcessTerminationStatus terminationStatus,
- int exitCode)
-{
- Q_Q(QWebEnginePage);
- Q_EMIT q->renderProcessTerminated(static_cast<QWebEnginePage::RenderProcessTerminationStatus>(
- terminationStatus), exitCode);
-}
-
-void QWebEnginePagePrivate::requestGeometryChange(const QRect &geometry, const QRect &frameGeometry)
-{
- Q_UNUSED(geometry);
- Q_Q(QWebEnginePage);
- Q_EMIT q->geometryChangeRequested(frameGeometry);
-}
-
-void QWebEnginePagePrivate::startDragging(const content::DropData &dropData,
- Qt::DropActions allowedActions, const QPixmap &pixmap,
- const QPoint &offset)
-{
-#if !QT_CONFIG(draganddrop)
- Q_UNUSED(dropData);
- Q_UNUSED(allowedActions);
- Q_UNUSED(pixmap);
- Q_UNUSED(offset);
-#else
- adapter->startDragging(view, dropData, allowedActions, pixmap, offset);
-#endif // QT_CONFIG(draganddrop)
-}
-
-bool QWebEnginePagePrivate::supportsDragging() const
-{
- return true;
-}
-
-bool QWebEnginePagePrivate::isEnabled() const
-{
- const Q_Q(QWebEnginePage);
- const QWidget *view = q->view();
- if (view)
- return view->isEnabled();
- return true;
-}
-
-void QWebEnginePagePrivate::setToolTip(const QString &toolTipText)
-{
- if (!view)
- return;
-
- // Hide tooltip if shown.
- if (toolTipText.isEmpty()) {
- if (!view->toolTip().isEmpty())
- view->setToolTip(QString());
-
- return;
- }
-
- // Update tooltip if text was changed.
- QString wrappedTip = QLatin1String("<p style=\"white-space:pre-wrap\">")
- % toolTipText.toHtmlEscaped().left(MaxTooltipLength)
- % QLatin1String("</p>");
- if (view->toolTip() != wrappedTip)
- view->setToolTip(wrappedTip);
-}
-
-void QWebEnginePagePrivate::printRequested()
-{
- Q_Q(QWebEnginePage);
- QTimer::singleShot(0, q, [q](){
- Q_EMIT q->printRequested();
- });
-}
-
-void QWebEnginePagePrivate::lifecycleStateChanged(LifecycleState state)
-{
- Q_Q(QWebEnginePage);
- Q_EMIT q->lifecycleStateChanged(static_cast<QWebEnginePage::LifecycleState>(state));
-}
-
-void QWebEnginePagePrivate::recommendedStateChanged(LifecycleState state)
-{
- Q_Q(QWebEnginePage);
- QTimer::singleShot(0, q, [q, state]() {
- Q_EMIT q->recommendedStateChanged(static_cast<QWebEnginePage::LifecycleState>(state));
- });
-}
-
-void QWebEnginePagePrivate::visibleChanged(bool visible)
-{
- Q_Q(QWebEnginePage);
- Q_EMIT q->visibleChanged(visible);
-}
-
-/*!
- \since 5.13
-
- Registers the request interceptor \a interceptor to intercept URL requests.
-
- The page does not take ownership of the pointer. This interceptor is called
- after any interceptors on the profile, and unlike profile interceptors, only
- URL requests from this page are intercepted.
-
- To unset the request interceptor, set a \c nullptr.
-
- \sa QWebEngineUrlRequestInfo, QWebEngineProfile::setUrlRequestInterceptor()
-*/
-
-void QWebEnginePage::setUrlRequestInterceptor(QWebEngineUrlRequestInterceptor *interceptor)
-{
- Q_D(QWebEnginePage);
- d->adapter->setRequestInterceptor(interceptor);
-}
-
-#if QT_CONFIG(menu)
-QMenu *QWebEnginePage::createStandardContextMenu()
-{
- Q_D(QWebEnginePage);
- if (!d->contextData.d)
- return nullptr;
- d->ensureInitialized();
-
- QMenu *menu = new QMenu(d->view);
- const WebEngineContextMenuData &contextMenuData = *d->contextData.d;
-
- QContextMenuBuilder contextMenuBuilder(contextMenuData, this, menu);
-
- contextMenuBuilder.initMenu();
-
- menu->setAttribute(Qt::WA_DeleteOnClose, true);
-
- return menu;
-}
-#endif // QT_CONFIG(menu)
-
-void QWebEnginePage::setFeaturePermission(const QUrl &securityOrigin, QWebEnginePage::Feature feature, QWebEnginePage::PermissionPolicy policy)
-{
- Q_D(QWebEnginePage);
- if (policy == PermissionUnknown) {
- switch (feature) {
- case MediaAudioVideoCapture:
- case MediaAudioCapture:
- case MediaVideoCapture:
- case DesktopAudioVideoCapture:
- case DesktopVideoCapture:
- case MouseLock:
- break;
- case Geolocation:
- d->adapter->grantFeaturePermission(securityOrigin, ProfileAdapter::GeolocationPermission, ProfileAdapter::AskPermission);
- break;
- case Notifications:
- d->adapter->grantFeaturePermission(securityOrigin, ProfileAdapter::NotificationPermission, ProfileAdapter::AskPermission);
- break;
- }
- return;
- }
-
- const WebContentsAdapterClient::MediaRequestFlags audioVideoCaptureFlags(
- WebContentsAdapterClient::MediaVideoCapture |
- WebContentsAdapterClient::MediaAudioCapture);
- const WebContentsAdapterClient::MediaRequestFlags desktopAudioVideoCaptureFlags(
- WebContentsAdapterClient::MediaDesktopVideoCapture |
- WebContentsAdapterClient::MediaDesktopAudioCapture);
-
- if (policy == PermissionGrantedByUser) {
- switch (feature) {
- case MediaAudioVideoCapture:
- d->adapter->grantMediaAccessPermission(securityOrigin, audioVideoCaptureFlags);
- break;
- case MediaAudioCapture:
- d->adapter->grantMediaAccessPermission(securityOrigin, WebContentsAdapterClient::MediaAudioCapture);
- break;
- case MediaVideoCapture:
- d->adapter->grantMediaAccessPermission(securityOrigin, WebContentsAdapterClient::MediaVideoCapture);
- break;
- case DesktopAudioVideoCapture:
- d->adapter->grantMediaAccessPermission(securityOrigin, desktopAudioVideoCaptureFlags);
- break;
- case DesktopVideoCapture:
- d->adapter->grantMediaAccessPermission(securityOrigin, WebContentsAdapterClient::MediaDesktopVideoCapture);
- break;
- case MouseLock:
- d->adapter->grantMouseLockPermission(securityOrigin, true);
- break;
- case Geolocation:
- d->adapter->grantFeaturePermission(securityOrigin, ProfileAdapter::GeolocationPermission, ProfileAdapter::AllowedPermission);
- break;
- case Notifications:
- d->adapter->grantFeaturePermission(securityOrigin, ProfileAdapter::NotificationPermission, ProfileAdapter::AllowedPermission);
- break;
- }
- } else { // if (policy == PermissionDeniedByUser)
- switch (feature) {
- case MediaAudioVideoCapture:
- case MediaAudioCapture:
- case MediaVideoCapture:
- case DesktopAudioVideoCapture:
- case DesktopVideoCapture:
- d->adapter->grantMediaAccessPermission(securityOrigin, WebContentsAdapterClient::MediaNone);
- break;
- case Geolocation:
- d->adapter->grantFeaturePermission(securityOrigin, ProfileAdapter::GeolocationPermission, ProfileAdapter::DeniedPermission);
- break;
- case MouseLock:
- d->adapter->grantMouseLockPermission(securityOrigin, false);
- break;
- case Notifications:
- d->adapter->grantFeaturePermission(securityOrigin, ProfileAdapter::NotificationPermission, ProfileAdapter::DeniedPermission);
- break;
- }
- }
-}
-
-static inline QWebEnginePage::FileSelectionMode toPublic(FilePickerController::FileChooserMode mode)
-{
- // Should the underlying values change, we'll need a switch here.
- return static_cast<QWebEnginePage::FileSelectionMode>(mode);
-}
-
-void QWebEnginePagePrivate::runFileChooser(QSharedPointer<FilePickerController> controller)
-{
- Q_Q(QWebEnginePage);
-
- QStringList selectedFileNames = q->chooseFiles(toPublic(controller->mode()), (QStringList() << controller->defaultFileName()), controller->acceptedMimeTypes());
-
- if (!selectedFileNames.empty())
- controller->accepted(selectedFileNames);
- else
- controller->rejected();
-}
-
-WebEngineSettings *QWebEnginePagePrivate::webEngineSettings() const
-{
- return settings->d_func();
-}
-
-/*!
- \since 5.10
- Downloads the resource from the location given by \a url to a local file.
-
- If \a filename is given, it is used as the suggested file name.
- If it is relative, the file is saved in the standard download location with
- the given name.
- If it is a null or empty QString, the default file name is used.
-
- This will emit QWebEngineProfile::downloadRequested() after the download
- has started.
-*/
-
-void QWebEnginePage::download(const QUrl& url, const QString& filename)
-{
- Q_D(QWebEnginePage);
- d->ensureInitialized();
- d->adapter->download(url, filename);
-}
-
-void QWebEnginePage::load(const QUrl& url)
-{
- Q_D(QWebEnginePage);
- d->adapter->load(url);
-}
-
-/*!
- \since 5.9
- Issues the specified \a request and loads the response.
-
- \sa load(), setUrl(), url(), urlChanged(), QUrl::fromUserInput()
-*/
-void QWebEnginePage::load(const QWebEngineHttpRequest& request)
-{
- Q_D(QWebEnginePage);
- d->adapter->load(request);
-}
-
-void QWebEnginePage::toHtml(const QWebEngineCallback<const QString &> &resultCallback) const
-{
- Q_D(const QWebEnginePage);
- d->ensureInitialized();
- quint64 requestId = d->adapter->fetchDocumentMarkup();
- d->m_callbacks.registerCallback(requestId, resultCallback);
-}
-
-void QWebEnginePage::toPlainText(const QWebEngineCallback<const QString &> &resultCallback) const
-{
- Q_D(const QWebEnginePage);
- d->ensureInitialized();
- quint64 requestId = d->adapter->fetchDocumentInnerText();
- d->m_callbacks.registerCallback(requestId, resultCallback);
-}
-
-void QWebEnginePage::setHtml(const QString &html, const QUrl &baseUrl)
-{
- setContent(html.toUtf8(), QStringLiteral("text/html;charset=UTF-8"), baseUrl);
-}
-
-void QWebEnginePage::setContent(const QByteArray &data, const QString &mimeType, const QUrl &baseUrl)
-{
- Q_D(QWebEnginePage);
- d->adapter->setContent(data, mimeType, baseUrl);
-}
-
-QString QWebEnginePage::title() const
-{
- Q_D(const QWebEnginePage);
- return d->adapter->pageTitle();
-}
-
-void QWebEnginePage::setUrl(const QUrl &url)
-{
- Q_D(QWebEnginePage);
- if (d->url != url) {
- d->url = url;
- emit urlChanged(url);
- }
- load(url);
-}
-
-QUrl QWebEnginePage::url() const
-{
- Q_D(const QWebEnginePage);
- return d->url;
-}
-
-QUrl QWebEnginePage::requestedUrl() const
-{
- Q_D(const QWebEnginePage);
- return d->adapter->requestedUrl();
-}
-
-/*!
- \property QWebEnginePage::iconUrl
- \brief The URL of the icon associated with the page currently viewed.
-
- By default, this property contains an empty URL.
-
- \sa iconUrlChanged(), icon(), iconChanged()
-*/
-QUrl QWebEnginePage::iconUrl() const
-{
- Q_D(const QWebEnginePage);
- return d->iconUrl;
-}
-
-/*!
- \property QWebEnginePage::icon
- \brief The icon associated with the page currently viewed.
- \since 5.7
-
- By default, this property contains a null icon. If the web page specifies more than one icon,
- the \c{icon} property encapsulates the available candidate icons in a single,
- scalable \c{QIcon}.
-
- \sa iconChanged(), iconUrl(), iconUrlChanged()
-*/
-QIcon QWebEnginePage::icon() const
-{
- Q_D(const QWebEnginePage);
-
- if (d->iconUrl.isEmpty() || !d->adapter->isInitialized())
- return QIcon();
-
- return d->adapter->faviconManager()->getIcon();
-}
-
-qreal QWebEnginePage::zoomFactor() const
-{
- Q_D(const QWebEnginePage);
- if (d->adapter->isInitialized())
- return d->adapter->currentZoomFactor();
- return d->defaultZoomFactor;
-}
-
-void QWebEnginePage::setZoomFactor(qreal factor)
-{
- Q_D(QWebEnginePage);
- d->defaultZoomFactor = factor;
- if (d->adapter->isInitialized())
- d->adapter->setZoomFactor(factor);
-}
-
-void QWebEnginePage::runJavaScript(const QString &scriptSource)
-{
- Q_D(QWebEnginePage);
- d->ensureInitialized();
- if (d->adapter->lifecycleState() == WebContentsAdapter::LifecycleState::Discarded) {
- qWarning("runJavaScript: disabled in Discarded state");
- return;
- }
- d->adapter->runJavaScript(scriptSource, QWebEngineScript::MainWorld);
-}
-
-void QWebEnginePage::runJavaScript(const QString& scriptSource, const QWebEngineCallback<const QVariant &> &resultCallback)
-{
- Q_D(QWebEnginePage);
- d->ensureInitialized();
- if (d->adapter->lifecycleState() == WebContentsAdapter::LifecycleState::Discarded) {
- qWarning("runJavaScript: disabled in Discarded state");
- d->m_callbacks.invokeEmpty(resultCallback);
- return;
- }
- quint64 requestId = d->adapter->runJavaScriptCallbackResult(scriptSource, QWebEngineScript::MainWorld);
- d->m_callbacks.registerCallback(requestId, resultCallback);
-}
-
-void QWebEnginePage::runJavaScript(const QString &scriptSource, quint32 worldId)
-{
- Q_D(QWebEnginePage);
- d->ensureInitialized();
- d->adapter->runJavaScript(scriptSource, worldId);
-}
-
-void QWebEnginePage::runJavaScript(const QString& scriptSource, quint32 worldId, const QWebEngineCallback<const QVariant &> &resultCallback)
-{
- Q_D(QWebEnginePage);
- d->ensureInitialized();
- quint64 requestId = d->adapter->runJavaScriptCallbackResult(scriptSource, worldId);
- d->m_callbacks.registerCallback(requestId, resultCallback);
-}
-
-/*!
- Returns the collection of scripts that are injected into the page.
-
- In addition, a page might also execute scripts
- added through QWebEngineProfile::scripts().
-
- \sa QWebEngineScriptCollection, QWebEngineScript, {Script Injection}
-*/
-
-QWebEngineScriptCollection &QWebEnginePage::scripts()
-{
- Q_D(QWebEnginePage);
- return d->scriptCollection;
-}
-
-QWebEnginePage *QWebEnginePage::createWindow(WebWindowType type)
-{
- Q_D(QWebEnginePage);
- if (d->view) {
- QWebEngineView *newView = d->view->createWindow(type);
- if (newView)
- return newView->page();
- }
- return 0;
-}
-
-/*!
- \since 5.11
- Returns the page this page is inspecting, if any.
-
- Returns \c nullptr if this page is not a developer tools page.
-
- \sa setInspectedPage(), devToolsPage()
-*/
-
-QWebEnginePage *QWebEnginePage::inspectedPage() const
-{
- Q_D(const QWebEnginePage);
- return d->inspectedPage;
-}
-
-/*!
- \since 5.11
- Navigates this page to an internal URL that is the developer
- tools of \a page.
-
- This is the same as calling setDevToolsPage() on \a page
- with \c this as argument.
-
- \sa inspectedPage(), setDevToolsPage()
-*/
-
-void QWebEnginePage::setInspectedPage(QWebEnginePage *page)
-{
- Q_D(QWebEnginePage);
- if (d->inspectedPage == page)
- return;
- QWebEnginePage *oldPage = d->inspectedPage;
- d->inspectedPage = nullptr;
- if (oldPage)
- oldPage->setDevToolsPage(nullptr);
- d->inspectedPage = page;
- if (page)
- page->setDevToolsPage(this);
-}
-
-/*!
- \since 5.11
- Returns the page that is hosting the developer tools
- of this page, if any.
-
- Returns \c nullptr if no developer tools page is set.
-
- \sa setDevToolsPage(), inspectedPage()
-*/
-
-QWebEnginePage *QWebEnginePage::devToolsPage() const
-{
- Q_D(const QWebEnginePage);
- return d->devToolsPage;
-}
-
-/*!
- \since 5.11
- Binds \a devToolsPage to be the developer tools of this page.
- Triggers \a devToolsPage to navigate to an internal URL
- with the developer tools.
-
- This is the same as calling setInspectedPage() on \a devToolsPage
- with \c this as argument.
-
- \sa devToolsPage(), setInspectedPage()
-*/
-
-void QWebEnginePage::setDevToolsPage(QWebEnginePage *devToolsPage)
-{
- Q_D(QWebEnginePage);
- if (d->devToolsPage == devToolsPage)
- return;
- d->ensureInitialized();
- QWebEnginePage *oldDevTools = d->devToolsPage;
- d->devToolsPage = nullptr;
- if (oldDevTools)
- oldDevTools->setInspectedPage(nullptr);
- d->devToolsPage = devToolsPage;
- if (devToolsPage)
- devToolsPage->setInspectedPage(this);
- if (d->adapter) {
- if (devToolsPage)
- d->adapter->openDevToolsFrontend(devToolsPage->d_ptr->adapter);
- else
- d->adapter->closeDevToolsFrontend();
- }
-}
-
-ASSERT_ENUMS_MATCH(FilePickerController::Open, QWebEnginePage::FileSelectOpen)
-ASSERT_ENUMS_MATCH(FilePickerController::OpenMultiple, QWebEnginePage::FileSelectOpenMultiple)
-
-QStringList QWebEnginePage::chooseFiles(FileSelectionMode mode, const QStringList &oldFiles, const QStringList &acceptedMimeTypes)
-{
-#if QT_CONFIG(filedialog)
- const QStringList &filter = FilePickerController::nameFilters(acceptedMimeTypes);
- QStringList ret;
- QString str;
- switch (static_cast<FilePickerController::FileChooserMode>(mode)) {
- case FilePickerController::OpenMultiple:
- ret = QFileDialog::getOpenFileNames(view(), QString(), QString(), filter.join(QStringLiteral(";;")), nullptr, QFileDialog::HideNameFilterDetails);
- break;
- // Chromium extension, not exposed as part of the public API for now.
- case FilePickerController::UploadFolder:
- str = QFileDialog::getExistingDirectory(view(), tr("Select folder to upload"));
- if (!str.isNull())
- ret << str;
- break;
- case FilePickerController::Save:
- str = QFileDialog::getSaveFileName(view(), QString(), (QStandardPaths::writableLocation(QStandardPaths::DownloadLocation) + oldFiles.first()));
- if (!str.isNull())
- ret << str;
- break;
- case FilePickerController::Open:
- str = QFileDialog::getOpenFileName(view(), QString(), oldFiles.first(), filter.join(QStringLiteral(";;")), nullptr, QFileDialog::HideNameFilterDetails);
- if (!str.isNull())
- ret << str;
- break;
- }
- return ret;
-#else
- Q_UNUSED(mode);
- Q_UNUSED(oldFiles);
- Q_UNUSED(acceptedMimeTypes);
-
- return QStringList();
-#endif // QT_CONFIG(filedialog)
-}
-
-void QWebEnginePage::javaScriptAlert(const QUrl &securityOrigin, const QString &msg)
-{
- Q_UNUSED(securityOrigin);
-#if QT_CONFIG(messagebox)
- QMessageBox::information(view(),
- QStringLiteral("Javascript Alert - %1").arg(url().toString()),
- msg.toHtmlEscaped());
-#else
- Q_UNUSED(msg);
-#endif // QT_CONFIG(messagebox)
-}
-
-bool QWebEnginePage::javaScriptConfirm(const QUrl &securityOrigin, const QString &msg)
-{
- Q_UNUSED(securityOrigin);
-#if QT_CONFIG(messagebox)
- return (QMessageBox::information(view(),
- QStringLiteral("Javascript Confirm - %1").arg(url().toString()),
- msg.toHtmlEscaped(),
- QMessageBox::Ok,
- QMessageBox::Cancel) == QMessageBox::Ok);
-#else
- Q_UNUSED(msg);
- return false;
-#endif // QT_CONFIG(messagebox)
-}
-
-bool QWebEnginePage::javaScriptPrompt(const QUrl &securityOrigin, const QString &msg, const QString &defaultValue, QString *result)
-{
- Q_UNUSED(securityOrigin);
-#if QT_CONFIG(inputdialog)
- bool ret = false;
- if (result)
- *result = QInputDialog::getText(view(),
- QStringLiteral("Javascript Prompt - %1").arg(url().toString()),
- msg.toHtmlEscaped(),
- QLineEdit::Normal,
- defaultValue.toHtmlEscaped(),
- &ret);
- return ret;
-#else
- Q_UNUSED(msg);
- Q_UNUSED(defaultValue);
- Q_UNUSED(result);
- return false;
-#endif // QT_CONFIG(inputdialog)
-}
-
-void QWebEnginePage::javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString &message, int lineNumber, const QString &sourceID)
-{
- static QLoggingCategory loggingCategory("js", QtWarningMsg);
- static QByteArray file = sourceID.toUtf8();
- QMessageLogger logger(file.constData(), lineNumber, nullptr, loggingCategory.categoryName());
-
- switch (level) {
- case JavaScriptConsoleMessageLevel::InfoMessageLevel:
- if (loggingCategory.isInfoEnabled())
- logger.info().noquote() << message;
- break;
- case JavaScriptConsoleMessageLevel::WarningMessageLevel:
- if (loggingCategory.isWarningEnabled())
- logger.warning().noquote() << message;
- break;
- case JavaScriptConsoleMessageLevel::ErrorMessageLevel:
- if (loggingCategory.isCriticalEnabled())
- logger.critical().noquote() << message;
- break;
- }
-}
-
-bool QWebEnginePage::certificateError(const QWebEngineCertificateError &)
-{
- return false;
-}
-
-bool QWebEnginePage::acceptNavigationRequest(const QUrl &url, NavigationType type, bool isMainFrame)
-{
- Q_UNUSED(url);
- Q_UNUSED(type);
- Q_UNUSED(isMainFrame);
- return true;
-}
-
-QPointF QWebEnginePage::scrollPosition() const
-{
- Q_D(const QWebEnginePage);
- return d->adapter->lastScrollOffset();
-}
-
-QSizeF QWebEnginePage::contentsSize() const
-{
- Q_D(const QWebEnginePage);
- return d->adapter->lastContentsSize();
-}
-
-/*!
- Renders the current content of the page into a PDF document and saves it
- in the location specified in \a filePath.
- The page size and orientation of the produced PDF document are taken from
- the values specified in \a pageLayout.
-
- This method issues an asynchronous request for printing the web page into
- a PDF and returns immediately.
- To be informed about the result of the request, connect to the signal
- pdfPrintingFinished().
-
- If a file already exists at the provided file path, it will be overwritten.
- \since 5.7
- \sa pdfPrintingFinished()
-*/
-void QWebEnginePage::printToPdf(const QString &filePath, const QPageLayout &pageLayout)
-{
-#if QT_CONFIG(webengine_printing_and_pdf)
- Q_D(const QWebEnginePage);
- if (d->currentPrinter) {
- qWarning("Cannot print to PDF while at the same time printing on printer %ls", qUtf16Printable(d->currentPrinter->printerName()));
- return;
- }
- d->ensureInitialized();
- d->adapter->printToPDF(pageLayout, filePath);
-#else
- Q_UNUSED(filePath);
- Q_UNUSED(pageLayout);
-#endif
-}
-
-
-/*!
- Renders the current content of the page into a PDF document and returns a byte array containing the PDF data
- as parameter to \a resultCallback.
- The page size and orientation of the produced PDF document are taken from the values specified in \a pageLayout.
-
- The \a resultCallback must take a const reference to a QByteArray as parameter. If printing was successful, this byte array
- will contain the PDF data, otherwise, the byte array will be empty.
-
- \warning We guarantee that the callback (\a resultCallback) is always called, but it might be done
- during page destruction. When QWebEnginePage is deleted, the callback is triggered with an invalid
- value and it is not safe to use the corresponding QWebEnginePage or QWebEngineView instance inside it.
-
- \since 5.7
-*/
-void QWebEnginePage::printToPdf(const QWebEngineCallback<const QByteArray&> &resultCallback, const QPageLayout &pageLayout)
-{
- Q_D(QWebEnginePage);
-#if QT_CONFIG(webengine_printing_and_pdf)
- if (d->currentPrinter) {
- qWarning("Cannot print to PDF while at the same time printing on printer %ls", qUtf16Printable(d->currentPrinter->printerName()));
- d->m_callbacks.invokeEmpty(resultCallback);
- return;
- }
- d->ensureInitialized();
- quint64 requestId = d->adapter->printToPDFCallbackResult(pageLayout);
- d->m_callbacks.registerCallback(requestId, resultCallback);
-#else
- Q_UNUSED(pageLayout);
- d->m_callbacks.invokeEmpty(resultCallback);
-#endif
-}
-
-/*!
- Renders the current content of the page into a temporary PDF document, then prints it using \a printer.
-
- The settings for creating and printing the PDF document will be retrieved from the \a printer
- object.
- It is the users responsibility to ensure the \a printer remains valid until \a resultCallback
- has been called.
-
- \note Printing runs on the browser process, which is by default not sandboxed.
-
- The \a resultCallback must take a boolean as parameter. If printing was successful, this
- boolean will have the value \c true, otherwise, its value will be \c false.
-
- \warning We guarantee that the callback (\a resultCallback) is always called, but it might be done
- during page destruction. When QWebEnginePage is deleted, the callback is triggered with an invalid
- value and it is not safe to use the corresponding QWebEnginePage or QWebEngineView instance inside it.
-
- \since 5.8
-*/
-void QWebEnginePage::print(QPrinter *printer, const QWebEngineCallback<bool> &resultCallback)
-{
- Q_D(QWebEnginePage);
-#if QT_CONFIG(webengine_printing_and_pdf)
- if (d->currentPrinter) {
- qWarning("Cannot print page on printer %ls: Already printing on %ls.", qUtf16Printable(printer->printerName()), qUtf16Printable(d->currentPrinter->printerName()));
- d->m_callbacks.invokeDirectly(resultCallback, false);
- return;
- }
- d->currentPrinter = printer;
- d->ensureInitialized();
- quint64 requestId = d->adapter->printToPDFCallbackResult(printer->pageLayout(),
- printer->colorMode() == QPrinter::Color,
- false);
- d->m_callbacks.registerCallback(requestId, resultCallback);
-#else
- Q_UNUSED(printer);
- d->m_callbacks.invokeDirectly(resultCallback, false);
-#endif
-}
-
-/*!
- \since 5.7
-
- Returns additional data about the current context menu. It is only guaranteed to be valid during the call to the QWebEngineView::contextMenuEvent()
- handler of the associated QWebEngineView.
-
- \sa createStandardContextMenu()
-*/
-const QWebEngineContextMenuData &QWebEnginePage::contextMenuData() const
-{
- Q_D(const QWebEnginePage);
- return d->contextData;
-}
-
-/*!
- \enum QWebEnginePage::LifecycleState
- \since 5.14
-
- This enum describes the lifecycle state of the page:
-
- \value Active
- Normal state.
- \value Frozen
- Low CPU usage state where most HTML task sources are suspended.
- \value Discarded
- Very low resource usage state where the entire browsing context is discarded.
-
- \sa lifecycleState, {Page Lifecycle API}, {WebEngine Lifecycle Example}
-*/
-
-/*!
- \property QWebEnginePage::lifecycleState
- \since 5.14
-
- \brief The current lifecycle state of the page.
-
- The following restrictions are enforced by the setter:
-
- \list
- \li A \l{visible} page must remain in the \c{Active} state.
- \li If the page is being inspected by a \l{devToolsPage} then both pages must
- remain in the \c{Active} states.
- \li A page in the \c{Discarded} state can only transition to the \c{Active}
- state. This will cause a reload of the page.
- \endlist
-
- These are the only hard limits on the lifecycle state, but see also
- \l{recommendedState} for the recommended soft limits.
-
- \sa recommendedState, {Page Lifecycle API}, {WebEngine Lifecycle Example}
-*/
-
-QWebEnginePage::LifecycleState QWebEnginePage::lifecycleState() const
-{
- Q_D(const QWebEnginePage);
- return static_cast<LifecycleState>(d->adapter->lifecycleState());
-}
-
-void QWebEnginePage::setLifecycleState(LifecycleState state)
-{
- Q_D(QWebEnginePage);
- d->adapter->setLifecycleState(static_cast<WebContentsAdapterClient::LifecycleState>(state));
-}
-
-/*!
- \property QWebEnginePage::recommendedState
- \since 5.14
-
- \brief The recommended limit for the lifecycle state of the page.
-
- Setting the lifecycle state to a lower resource usage state than the
- recommended state may cause side-effects such as stopping background audio
- playback or loss of HTML form input. Setting the lifecycle state to a higher
- resource state is however completely safe.
-
- \sa lifecycleState, {Page Lifecycle API}, {WebEngine Lifecycle Example}
-*/
-
-QWebEnginePage::LifecycleState QWebEnginePage::recommendedState() const
-{
- Q_D(const QWebEnginePage);
- return static_cast<LifecycleState>(d->adapter->recommendedState());
-}
-
-/*!
- \property QWebEnginePage::visible
- \since 5.14
-
- \brief Whether the page is considered visible in the Page Visibility API.
-
- Setting this property changes the \c{Document.hidden} and the
- \c{Document.visibilityState} properties in JavaScript which web sites can use
- to voluntarily reduce their resource usage if they are not visible to the
- user.
-
- If the page is connected to a \l{view} then this property will be managed
- automatically by the view according to it's own visibility.
-
- \sa lifecycleState
-*/
-
-bool QWebEnginePage::isVisible() const
-{
- Q_D(const QWebEnginePage);
- return d->adapter->isVisible();
-}
-
-void QWebEnginePage::setVisible(bool visible)
-{
- Q_D(QWebEnginePage);
-
- if (!d->adapter->isInitialized()) {
- // On the one hand, it is too early to initialize here. The application
- // may call show() before load(), or it may call show() from
- // createWindow(), and then we would create an unnecessary blank
- // WebContents here. On the other hand, if the application calls show()
- // then it expects something to be shown, so we have to initialize.
- // Therefore we have to delay the initialization via the event loop.
- if (visible)
- d->wasShownTimer.start();
- else
- d->wasShownTimer.stop();
- return;
- }
-
- d->adapter->setVisible(visible);
-}
-
-#if QT_CONFIG(action)
-QContextMenuBuilder::QContextMenuBuilder(const QtWebEngineCore::WebEngineContextMenuData &data,
- QWebEnginePage *page,
- QMenu *menu)
- : QtWebEngineCore::RenderViewContextMenuQt(data)
- , m_page(page)
- , m_menu(menu)
-{
-}
-
-bool QContextMenuBuilder::hasInspector()
-{
- return m_page->d_ptr->adapter->hasInspector();
-}
-
-bool QContextMenuBuilder::isFullScreenMode()
-{
- return m_page->d_ptr->isFullScreenMode();
-}
-
-void QContextMenuBuilder::addMenuItem(ContextMenuItem menuItem)
-{
- QPointer<QWebEnginePage> thisRef(m_page);
- QAction *action = 0;
-
- switch (menuItem) {
- case ContextMenuItem::Back:
- action = thisRef->action(QWebEnginePage::Back);
- break;
- case ContextMenuItem::Forward:
- action = thisRef->action(QWebEnginePage::Forward);
- break;
- case ContextMenuItem::Reload:
- action = thisRef->action(QWebEnginePage::Reload);
- break;
- case ContextMenuItem::Cut:
- action = thisRef->action(QWebEnginePage::Cut);
- break;
- case ContextMenuItem::Copy:
- action = thisRef->action(QWebEnginePage::Copy);
- break;
- case ContextMenuItem::Paste:
- action = thisRef->action(QWebEnginePage::Paste);
- break;
- case ContextMenuItem::Undo:
- action = thisRef->action(QWebEnginePage::Undo);
- break;
- case ContextMenuItem::Redo:
- action = thisRef->action(QWebEnginePage::Redo);
- break;
- case ContextMenuItem::SelectAll:
- action = thisRef->action(QWebEnginePage::SelectAll);
- break;
- case ContextMenuItem::PasteAndMatchStyle:
- action = thisRef->action(QWebEnginePage::PasteAndMatchStyle);
- break;
- case ContextMenuItem::OpenLinkInNewWindow:
- action = thisRef->action(QWebEnginePage::OpenLinkInNewWindow);
- break;
- case ContextMenuItem::OpenLinkInNewTab:
- action = thisRef->action(QWebEnginePage::OpenLinkInNewTab);
- break;
- case ContextMenuItem::CopyLinkToClipboard:
- action = thisRef->action(QWebEnginePage::CopyLinkToClipboard);
- break;
- case ContextMenuItem::DownloadLinkToDisk:
- action = thisRef->action(QWebEnginePage::DownloadLinkToDisk);
- break;
- case ContextMenuItem::CopyImageToClipboard:
- action = thisRef->action(QWebEnginePage::CopyImageToClipboard);
- break;
- case ContextMenuItem::CopyImageUrlToClipboard:
- action = thisRef->action(QWebEnginePage::CopyImageUrlToClipboard);
- break;
- case ContextMenuItem::DownloadImageToDisk:
- action = thisRef->action(QWebEnginePage::DownloadImageToDisk);
- break;
- case ContextMenuItem::CopyMediaUrlToClipboard:
- action = thisRef->action(QWebEnginePage::CopyMediaUrlToClipboard);
- break;
- case ContextMenuItem::ToggleMediaControls:
- action = thisRef->action(QWebEnginePage::ToggleMediaControls);
- break;
- case ContextMenuItem::ToggleMediaLoop:
- action = thisRef->action(QWebEnginePage::ToggleMediaLoop);
- break;
- case ContextMenuItem::DownloadMediaToDisk:
- action = thisRef->action(QWebEnginePage::DownloadMediaToDisk);
- break;
- case ContextMenuItem::InspectElement:
- action = thisRef->action(QWebEnginePage::InspectElement);
- break;
- case ContextMenuItem::ExitFullScreen:
- action = thisRef->action(QWebEnginePage::ExitFullScreen);
- break;
- case ContextMenuItem::SavePage:
- action = thisRef->action(QWebEnginePage::SavePage);
- break;
- case ContextMenuItem::ViewSource:
- action = thisRef->action(QWebEnginePage::ViewSource);
- break;
- case ContextMenuItem::SpellingSuggestions:
- for (int i=0; i < m_contextData.spellCheckerSuggestions().count() && i < 4; i++) {
- action = new QAction(m_menu);
- QString replacement = m_contextData.spellCheckerSuggestions().at(i);
- QObject::connect(action, &QAction::triggered, [thisRef, replacement] { if (thisRef) thisRef->replaceMisspelledWord(replacement); });
- action->setText(replacement);
- m_menu->addAction(action);
- }
- return;
- case ContextMenuItem::Separator:
- if (!m_menu->isEmpty())
- m_menu->addSeparator();
- return;
- }
- action->setEnabled(isMenuItemEnabled(menuItem));
- m_menu->addAction(action);
-}
-
-bool QContextMenuBuilder::isMenuItemEnabled(ContextMenuItem menuItem)
-{
- switch (menuItem) {
- case ContextMenuItem::Back:
- return m_page->d_ptr->adapter->canGoBack();
- case ContextMenuItem::Forward:
- return m_page->d_ptr->adapter->canGoForward();
- case ContextMenuItem::Reload:
- return true;
- case ContextMenuItem::Cut:
- return m_contextData.editFlags() & QtWebEngineCore::WebEngineContextMenuData::CanCut;
- case ContextMenuItem::Copy:
- return m_contextData.editFlags() & QtWebEngineCore::WebEngineContextMenuData::CanCopy;
- case ContextMenuItem::Paste:
- return m_contextData.editFlags() & QtWebEngineCore::WebEngineContextMenuData::CanPaste;
- case ContextMenuItem::Undo:
- return m_contextData.editFlags() & QtWebEngineCore::WebEngineContextMenuData::CanUndo;
- case ContextMenuItem::Redo:
- return m_contextData.editFlags() & QtWebEngineCore::WebEngineContextMenuData::CanRedo;
- case ContextMenuItem::SelectAll:
- return m_contextData.editFlags() & QtWebEngineCore::WebEngineContextMenuData::CanSelectAll;
- case ContextMenuItem::PasteAndMatchStyle:
- return m_contextData.editFlags() & QtWebEngineCore::WebEngineContextMenuData::CanPaste;
- case ContextMenuItem::OpenLinkInNewWindow:
- case ContextMenuItem::OpenLinkInNewTab:
- case ContextMenuItem::CopyLinkToClipboard:
- case ContextMenuItem::DownloadLinkToDisk:
- case ContextMenuItem::CopyImageToClipboard:
- case ContextMenuItem::CopyImageUrlToClipboard:
- case ContextMenuItem::DownloadImageToDisk:
- case ContextMenuItem::CopyMediaUrlToClipboard:
- case ContextMenuItem::ToggleMediaControls:
- case ContextMenuItem::ToggleMediaLoop:
- case ContextMenuItem::DownloadMediaToDisk:
- case ContextMenuItem::InspectElement:
- case ContextMenuItem::ExitFullScreen:
- case ContextMenuItem::SavePage:
- return true;
- case ContextMenuItem::ViewSource:
- return m_page->d_ptr->adapter->canViewSource();
- case ContextMenuItem::SpellingSuggestions:
- case ContextMenuItem::Separator:
- return true;
- }
- Q_UNREACHABLE();
-}
-#endif // QT_CONFIG(action)
-
-QT_END_NAMESPACE
-
-#include "moc_qwebenginepage.cpp"
diff --git a/src/webenginewidgets/api/qwebenginepage.h b/src/webenginewidgets/api/qwebenginepage.h
deleted file mode 100644
index 3cf6a9f8b..000000000
--- a/src/webenginewidgets/api/qwebenginepage.h
+++ /dev/null
@@ -1,409 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWEBENGINEPAGE_H
-#define QWEBENGINEPAGE_H
-
-#include <QtWebEngineWidgets/qtwebenginewidgetsglobal.h>
-#include <QtWebEngineWidgets/qwebengineclientcertificateselection.h>
-#include <QtWebEngineWidgets/qwebenginedownloaditem.h>
-#include <QtWebEngineCore/qwebenginecallback.h>
-#include <QtWebEngineCore/qwebenginehttprequest.h>
-
-#include <QtCore/qobject.h>
-#include <QtCore/qurl.h>
-#include <QtCore/qvariant.h>
-#include <QtGui/qpagelayout.h>
-#include <QtNetwork/qnetworkaccessmanager.h>
-#include <QtWidgets/qwidget.h>
-
-QT_BEGIN_NAMESPACE
-class QMenu;
-class QPrinter;
-
-class QContextMenuBuilder;
-class QWebChannel;
-class QWebEngineCertificateError;
-class QWebEngineClientCertificateSelection;
-class QWebEngineContextMenuData;
-class QWebEngineFindTextResult;
-class QWebEngineFullScreenRequest;
-class QWebEngineHistory;
-class QWebEnginePage;
-class QWebEnginePagePrivate;
-class QWebEngineProfile;
-class QWebEngineQuotaRequest;
-class QWebEngineRegisterProtocolHandlerRequest;
-class QWebEngineScriptCollection;
-class QWebEngineSettings;
-class QWebEngineUrlRequestInterceptor;
-
-class QWEBENGINEWIDGETS_EXPORT QWebEnginePage : public QObject {
- Q_OBJECT
- Q_PROPERTY(QString selectedText READ selectedText)
- Q_PROPERTY(bool hasSelection READ hasSelection)
- Q_PROPERTY(QUrl requestedUrl READ requestedUrl)
- Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor)
- Q_PROPERTY(QString title READ title)
- Q_PROPERTY(QUrl url READ url WRITE setUrl)
- Q_PROPERTY(QUrl iconUrl READ iconUrl NOTIFY iconUrlChanged)
- Q_PROPERTY(QIcon icon READ icon NOTIFY iconChanged)
- Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor)
- Q_PROPERTY(QSizeF contentsSize READ contentsSize NOTIFY contentsSizeChanged)
- Q_PROPERTY(QPointF scrollPosition READ scrollPosition NOTIFY scrollPositionChanged)
- Q_PROPERTY(bool audioMuted READ isAudioMuted WRITE setAudioMuted NOTIFY audioMutedChanged)
- Q_PROPERTY(bool recentlyAudible READ recentlyAudible NOTIFY recentlyAudibleChanged)
- Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged)
- Q_PROPERTY(LifecycleState lifecycleState READ lifecycleState WRITE setLifecycleState NOTIFY lifecycleStateChanged)
- Q_PROPERTY(LifecycleState recommendedState READ recommendedState NOTIFY recommendedStateChanged)
- Q_PROPERTY(qint64 renderProcessPid READ renderProcessPid NOTIFY renderProcessPidChanged)
-
-public:
- enum WebAction {
- NoWebAction = - 1,
- Back,
- Forward,
- Stop,
- Reload,
-
- Cut,
- Copy,
- Paste,
-
- Undo,
- Redo,
- SelectAll,
- ReloadAndBypassCache,
-
- PasteAndMatchStyle,
-
- OpenLinkInThisWindow,
- OpenLinkInNewWindow,
- OpenLinkInNewTab,
- CopyLinkToClipboard,
- DownloadLinkToDisk,
-
- CopyImageToClipboard,
- CopyImageUrlToClipboard,
- DownloadImageToDisk,
-
- CopyMediaUrlToClipboard,
- ToggleMediaControls,
- ToggleMediaLoop,
- ToggleMediaPlayPause,
- ToggleMediaMute,
- DownloadMediaToDisk,
-
- InspectElement,
- ExitFullScreen,
- RequestClose,
- Unselect,
- SavePage,
- OpenLinkInNewBackgroundTab,
- ViewSource,
-
- ToggleBold,
- ToggleItalic,
- ToggleUnderline,
- ToggleStrikethrough,
-
- AlignLeft,
- AlignCenter,
- AlignRight,
- AlignJustified,
- Indent,
- Outdent,
-
- InsertOrderedList,
- InsertUnorderedList,
-
- WebActionCount
- };
- Q_ENUM(WebAction)
-
- enum FindFlag {
- FindBackward = 1,
- FindCaseSensitively = 2,
- };
- Q_DECLARE_FLAGS(FindFlags, FindFlag)
-
- enum WebWindowType {
- WebBrowserWindow,
- WebBrowserTab,
- WebDialog,
- WebBrowserBackgroundTab
- };
- Q_ENUM(WebWindowType)
-
- enum PermissionPolicy {
- PermissionUnknown,
- PermissionGrantedByUser,
- PermissionDeniedByUser
- };
- Q_ENUM(PermissionPolicy)
-
- // must match WebContentsAdapterClient::NavigationType
- enum NavigationType {
- NavigationTypeLinkClicked,
- NavigationTypeTyped,
- NavigationTypeFormSubmitted,
- NavigationTypeBackForward,
- NavigationTypeReload,
- NavigationTypeOther,
- NavigationTypeRedirect,
- };
- Q_ENUM(NavigationType)
-
- enum Feature {
- Notifications = 0,
- Geolocation = 1,
- MediaAudioCapture = 2,
- MediaVideoCapture,
- MediaAudioVideoCapture,
- MouseLock,
- DesktopVideoCapture,
- DesktopAudioVideoCapture
- };
- Q_ENUM(Feature)
-
- // Ex-QWebFrame enum
-
- enum FileSelectionMode {
- FileSelectOpen,
- FileSelectOpenMultiple,
- };
- Q_ENUM(FileSelectionMode)
-
- // must match WebContentsAdapterClient::JavaScriptConsoleMessageLevel
- enum JavaScriptConsoleMessageLevel {
- InfoMessageLevel = 0,
- WarningMessageLevel,
- ErrorMessageLevel
- };
- Q_ENUM(JavaScriptConsoleMessageLevel)
-
- // must match WebContentsAdapterClient::RenderProcessTerminationStatus
- enum RenderProcessTerminationStatus {
- NormalTerminationStatus = 0,
- AbnormalTerminationStatus,
- CrashedTerminationStatus,
- KilledTerminationStatus
- };
- Q_ENUM(RenderProcessTerminationStatus)
-
- // must match WebContentsAdapterClient::LifecycleState
- enum class LifecycleState {
- Active,
- Frozen,
- Discarded,
- };
- Q_ENUM(LifecycleState)
-
- explicit QWebEnginePage(QObject *parent = Q_NULLPTR);
- QWebEnginePage(QWebEngineProfile *profile, QObject *parent = Q_NULLPTR);
- ~QWebEnginePage();
- QWebEngineHistory *history() const;
-
- void setView(QWidget *view);
- QWidget *view() const;
-
- bool hasSelection() const;
- QString selectedText() const;
-
- QWebEngineProfile *profile() const;
-
-#ifndef QT_NO_ACTION
- QAction *action(WebAction action) const;
-#endif
- virtual void triggerAction(WebAction action, bool checked = false);
-
- void replaceMisspelledWord(const QString &replacement);
-
- virtual bool event(QEvent*);
-
- void findText(const QString &subString, FindFlags options = FindFlags(), const QWebEngineCallback<bool> &resultCallback = QWebEngineCallback<bool>());
-
-#if QT_CONFIG(menu)
- QMenu *createStandardContextMenu();
-#endif
-
- void setFeaturePermission(const QUrl &securityOrigin, Feature feature, PermissionPolicy policy);
-
- void load(const QUrl &url);
- void load(const QWebEngineHttpRequest &request);
- void download(const QUrl &url, const QString &filename = QString());
- void setHtml(const QString &html, const QUrl &baseUrl = QUrl());
- void setContent(const QByteArray &data, const QString &mimeType = QString(), const QUrl &baseUrl = QUrl());
-
- void toHtml(const QWebEngineCallback<const QString &> &resultCallback) const;
- void toPlainText(const QWebEngineCallback<const QString &> &resultCallback) const;
-
- QString title() const;
- void setUrl(const QUrl &url);
- QUrl url() const;
- QUrl requestedUrl() const;
- QUrl iconUrl() const;
- QIcon icon() const;
-
- qreal zoomFactor() const;
- void setZoomFactor(qreal factor);
-
- QPointF scrollPosition() const;
- QSizeF contentsSize() const;
-
- void runJavaScript(const QString& scriptSource);
- void runJavaScript(const QString& scriptSource, quint32 worldId);
- void runJavaScript(const QString& scriptSource, const QWebEngineCallback<const QVariant &> &resultCallback);
- void runJavaScript(const QString& scriptSource, quint32 worldId, const QWebEngineCallback<const QVariant &> &resultCallback);
- QWebEngineScriptCollection &scripts();
- QWebEngineSettings *settings() const;
-
- QWebChannel *webChannel() const;
- void setWebChannel(QWebChannel *);
- void setWebChannel(QWebChannel *, uint worldId);
- QColor backgroundColor() const;
- void setBackgroundColor(const QColor &color);
-
- void save(const QString &filePath, QWebEngineDownloadItem::SavePageFormat format
- = QWebEngineDownloadItem::MimeHtmlSaveFormat) const;
-
- bool isAudioMuted() const;
- void setAudioMuted(bool muted);
- bool recentlyAudible() const;
- qint64 renderProcessPid() const;
-
- void printToPdf(const QString &filePath, const QPageLayout &layout = QPageLayout(QPageSize(QPageSize::A4), QPageLayout::Portrait, QMarginsF()));
- void printToPdf(const QWebEngineCallback<const QByteArray&> &resultCallback, const QPageLayout &layout = QPageLayout(QPageSize(QPageSize::A4), QPageLayout::Portrait, QMarginsF()));
- void print(QPrinter *printer, const QWebEngineCallback<bool> &resultCallback);
-
- void setInspectedPage(QWebEnginePage *page);
- QWebEnginePage *inspectedPage() const;
- void setDevToolsPage(QWebEnginePage *page);
- QWebEnginePage *devToolsPage() const;
-
- void setUrlRequestInterceptor(QWebEngineUrlRequestInterceptor *interceptor);
-
- const QWebEngineContextMenuData &contextMenuData() const;
-
- LifecycleState lifecycleState() const;
- void setLifecycleState(LifecycleState state);
-
- LifecycleState recommendedState() const;
-
- bool isVisible() const;
- void setVisible(bool visible);
-
-Q_SIGNALS:
- void loadStarted();
- void loadProgress(int progress);
- void loadFinished(bool ok);
-
- void linkHovered(const QString &url);
- void selectionChanged();
- void geometryChangeRequested(const QRect& geom);
- void windowCloseRequested();
-
- void featurePermissionRequested(const QUrl &securityOrigin, QWebEnginePage::Feature feature);
- void featurePermissionRequestCanceled(const QUrl &securityOrigin, QWebEnginePage::Feature feature);
- void fullScreenRequested(QWebEngineFullScreenRequest fullScreenRequest);
- void quotaRequested(QWebEngineQuotaRequest quotaRequest);
- void registerProtocolHandlerRequested(QWebEngineRegisterProtocolHandlerRequest request);
-#if !defined(QT_NO_SSL) || QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
- void selectClientCertificate(QWebEngineClientCertificateSelection clientCertSelection);
-#endif
-
- void authenticationRequired(const QUrl &requestUrl, QAuthenticator *authenticator);
- void proxyAuthenticationRequired(const QUrl &requestUrl, QAuthenticator *authenticator, const QString &proxyHost);
-
- void renderProcessTerminated(RenderProcessTerminationStatus terminationStatus, int exitCode);
-
- // Ex-QWebFrame signals
- void titleChanged(const QString &title);
- void urlChanged(const QUrl &url);
- void iconUrlChanged(const QUrl &url);
- void iconChanged(const QIcon &icon);
-
- void scrollPositionChanged(const QPointF &position);
- void contentsSizeChanged(const QSizeF &size);
- void audioMutedChanged(bool muted);
- void recentlyAudibleChanged(bool recentlyAudible);
- void renderProcessPidChanged(qint64 pid);
-
- void pdfPrintingFinished(const QString &filePath, bool success);
- void printRequested();
-
- void visibleChanged(bool visible);
-
- void lifecycleStateChanged(LifecycleState state);
- void recommendedStateChanged(LifecycleState state);
-
- void findTextFinished(const QWebEngineFindTextResult &result);
-
-protected:
- virtual QWebEnginePage *createWindow(WebWindowType type);
- virtual QStringList chooseFiles(FileSelectionMode mode, const QStringList &oldFiles, const QStringList &acceptedMimeTypes);
- virtual void javaScriptAlert(const QUrl &securityOrigin, const QString& msg);
- virtual bool javaScriptConfirm(const QUrl &securityOrigin, const QString& msg);
- virtual bool javaScriptPrompt(const QUrl &securityOrigin, const QString& msg, const QString& defaultValue, QString* result);
- virtual void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString& message, int lineNumber, const QString& sourceID);
- virtual bool certificateError(const QWebEngineCertificateError &certificateError);
- virtual bool acceptNavigationRequest(const QUrl &url, NavigationType type, bool isMainFrame);
-
-private:
- Q_DISABLE_COPY(QWebEnginePage)
- Q_DECLARE_PRIVATE(QWebEnginePage)
- QScopedPointer<QWebEnginePagePrivate> d_ptr;
-#ifndef QT_NO_ACTION
- Q_PRIVATE_SLOT(d_func(), void _q_webActionTriggered(bool checked))
-#endif
-
- friend class QContextMenuBuilder;
- friend class QWebEngineFullScreenRequest;
- friend class QWebEngineView;
- friend class QWebEngineViewPrivate;
-#ifndef QT_NO_ACCESSIBILITY
- friend class QWebEngineViewAccessible;
-#endif // QT_NO_ACCESSIBILITY
-};
-
-Q_DECLARE_OPERATORS_FOR_FLAGS(QWebEnginePage::FindFlags)
-
-QT_END_NAMESPACE
-
-#endif // QWEBENGINEPAGE_H
diff --git a/src/webenginewidgets/api/qwebenginepage_p.h b/src/webenginewidgets/api/qwebenginepage_p.h
deleted file mode 100644
index 3ddf4b3d6..000000000
--- a/src/webenginewidgets/api/qwebenginepage_p.h
+++ /dev/null
@@ -1,231 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWEBENGINEPAGE_P_H
-#define QWEBENGINEPAGE_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "qwebenginepage.h"
-
-#include "qwebenginecallback_p.h"
-#include "qwebenginecontextmenudata.h"
-#include "qwebenginescriptcollection.h"
-#include "render_view_context_menu_qt.h"
-#include "web_contents_adapter_client.h"
-
-#include <QtCore/qcompilerdetection.h>
-#include <QtCore/QPointer>
-#include <QtCore/QTimer>
-
-namespace QtWebEngineCore {
-class RenderWidgetHostViewQtDelegate;
-class RenderWidgetHostViewQtDelegateWidget;
-class TouchHandleDrawableClient;
-class TouchSelectionMenuController;
-class WebContentsAdapter;
-}
-
-QT_BEGIN_NAMESPACE
-class QWebEngineFindTextResult;
-class QWebEngineHistory;
-class QWebEnginePage;
-class QWebEngineProfile;
-class QWebEngineSettings;
-class QWebEngineView;
-
-class QWebEnginePagePrivate : public QtWebEngineCore::WebContentsAdapterClient
-{
-public:
- Q_DECLARE_PUBLIC(QWebEnginePage)
- QWebEnginePage *q_ptr;
-
- QWebEnginePagePrivate(QWebEngineProfile *profile = 0);
- ~QWebEnginePagePrivate();
-
- QtWebEngineCore::RenderWidgetHostViewQtDelegate* CreateRenderWidgetHostViewQtDelegate(QtWebEngineCore::RenderWidgetHostViewQtDelegateClient *client) override;
- QtWebEngineCore::RenderWidgetHostViewQtDelegate* CreateRenderWidgetHostViewQtDelegateForPopup(QtWebEngineCore::RenderWidgetHostViewQtDelegateClient *client) override { return CreateRenderWidgetHostViewQtDelegate(client); }
- void initializationFinished() override;
- void lifecycleStateChanged(LifecycleState state) override;
- void recommendedStateChanged(LifecycleState state) override;
- void visibleChanged(bool visible) override;
- void titleChanged(const QString&) override;
- void urlChanged() override;
- void iconChanged(const QUrl&) override;
- void loadProgressChanged(int progress) override;
- void didUpdateTargetURL(const QUrl&) override;
- void selectionChanged() override;
- void recentlyAudibleChanged(bool recentlyAudible) override;
- void renderProcessPidChanged(qint64 pid) override;
- QRectF viewportRect() const override;
- QColor backgroundColor() const override;
- void loadStarted(const QUrl &provisionalUrl, bool isErrorPage = false) override;
- void loadCommitted() override { }
- void loadVisuallyCommitted() override { }
- void loadFinished(bool success, const QUrl &url, bool isErrorPage = false, int errorCode = 0, const QString &errorDescription = QString()) override;
- void focusContainer() override;
- void unhandledKeyEvent(QKeyEvent *event) override;
- QSharedPointer<QtWebEngineCore::WebContentsAdapter>
- adoptNewWindow(QSharedPointer<QtWebEngineCore::WebContentsAdapter> newWebContents,
- WindowOpenDisposition disposition, bool userGesture,
- const QRect &initialGeometry, const QUrl &targetUrl) override;
- bool isBeingAdopted() override;
- void close() override;
- void windowCloseRejected() override;
- void contextMenuRequested(const QtWebEngineCore::WebEngineContextMenuData &data) override;
- void navigationRequested(int navigationType, const QUrl &url, int &navigationRequestAction, bool isMainFrame) override;
- void requestFullScreenMode(const QUrl &origin, bool fullscreen) override;
- bool isFullScreenMode() const override;
- void javascriptDialog(QSharedPointer<QtWebEngineCore::JavaScriptDialogController>) override;
- void runFileChooser(QSharedPointer<QtWebEngineCore::FilePickerController>) override;
- void showColorDialog(QSharedPointer<QtWebEngineCore::ColorChooserController>) override;
- void didRunJavaScript(quint64 requestId, const QVariant& result) override;
- void didFetchDocumentMarkup(quint64 requestId, const QString& result) override;
- void didFetchDocumentInnerText(quint64 requestId, const QString& result) override;
- void didPrintPage(quint64 requestId, QSharedPointer<QByteArray> result) override;
- void didPrintPageToPdf(const QString &filePath, bool success) override;
- bool passOnFocus(bool reverse) override;
- void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString& message, int lineNumber, const QString& sourceID) override;
- void authenticationRequired(QSharedPointer<QtWebEngineCore::AuthenticationDialogController>) override;
- void releaseProfile() override;
- void runMediaAccessPermissionRequest(const QUrl &securityOrigin, MediaRequestFlags requestFlags) override;
- void runFeaturePermissionRequest(QtWebEngineCore::ProfileAdapter::PermissionType permission, const QUrl &securityOrigin) override;
- void runMouseLockPermissionRequest(const QUrl &securityOrigin) override;
- void runQuotaRequest(QWebEngineQuotaRequest) override;
- void runRegisterProtocolHandlerRequest(QWebEngineRegisterProtocolHandlerRequest) override;
- QObject *accessibilityParentObject() override;
- QtWebEngineCore::WebEngineSettings *webEngineSettings() const override;
- void allowCertificateError(const QSharedPointer<CertificateErrorController> &controller) override;
- void selectClientCert(const QSharedPointer<ClientCertSelectController> &controller) override;
- void renderProcessTerminated(RenderProcessTerminationStatus terminationStatus, int exitCode) override;
- void requestGeometryChange(const QRect &geometry, const QRect &frameGeometry) override;
- void updateScrollPosition(const QPointF &position) override;
- void updateContentsSize(const QSizeF &size) override;
- void updateNavigationActions() override;
- void updateEditActions() override;
- void startDragging(const content::DropData &dropData, Qt::DropActions allowedActions,
- const QPixmap &pixmap, const QPoint &offset) override;
- bool supportsDragging() const override;
- bool isEnabled() const override;
- void setToolTip(const QString &toolTipText) override;
- void printRequested() override;
- QtWebEngineCore::TouchHandleDrawableClient *createTouchHandle(const QMap<int, QImage> &) override { return nullptr; }
- void showTouchSelectionMenu(QtWebEngineCore::TouchSelectionMenuController *, const QRect &, const QSize &) override { }
- void hideTouchSelectionMenu() override { }
- const QObject *holdingQObject() const override;
- ClientType clientType() override { return QtWebEngineCore::WebContentsAdapterClient::WidgetsClient; }
- void widgetChanged(QtWebEngineCore::RenderWidgetHostViewQtDelegate *newWidget) override;
- void findTextFinished(const QWebEngineFindTextResult &result) override;
-
- QtWebEngineCore::ProfileAdapter *profileAdapter() override;
- QtWebEngineCore::WebContentsAdapter *webContentsAdapter() override;
-
- void updateAction(QWebEnginePage::WebAction) const;
- void _q_webActionTriggered(bool checked);
-
- QtWebEngineCore::WebContentsAdapter *webContents() { return adapter.data(); }
- void recreateFromSerializedHistory(QDataStream &input);
-
- void setFullScreenMode(bool);
- void ensureInitialized() const;
-
- static void bindPageAndView(QWebEnginePage *page, QWebEngineView *view);
- static void bindPageAndWidget(QWebEnginePage *page,
- QtWebEngineCore::RenderWidgetHostViewQtDelegateWidget *widget);
-
- QSharedPointer<QtWebEngineCore::WebContentsAdapter> adapter;
- QWebEngineHistory *history;
- QWebEngineProfile *profile;
- QWebEngineSettings *settings;
- QWebEngineView *view;
- QUrl url;
- QWebEngineContextMenuData contextData;
- bool isLoading;
- QWebEngineScriptCollection scriptCollection;
- bool m_isBeingAdopted;
- QColor m_backgroundColor;
- bool fullscreenMode;
- QWebChannel *webChannel;
- unsigned int webChannelWorldId;
- QUrl iconUrl;
- bool m_navigationActionTriggered;
- QPointer<QWebEnginePage> inspectedPage;
- QPointer<QWebEnginePage> devToolsPage;
- bool defaultAudioMuted;
- qreal defaultZoomFactor;
- QTimer wasShownTimer;
- QtWebEngineCore::RenderWidgetHostViewQtDelegateWidget *widget = nullptr;
-
- mutable QtWebEngineCore::CallbackDirectory m_callbacks;
- mutable QAction *actions[QWebEnginePage::WebActionCount];
-#if QT_CONFIG(webengine_printing_and_pdf)
- QPrinter *currentPrinter;
-#endif
-
- QList<QSharedPointer<CertificateErrorController>> m_certificateErrorControllers;
-};
-
-class QContextMenuBuilder : public QtWebEngineCore::RenderViewContextMenuQt
-{
-public:
- QContextMenuBuilder(const QtWebEngineCore::WebEngineContextMenuData &data, QWebEnginePage *page, QMenu *menu);
-
-private:
- virtual bool hasInspector() override;
- virtual bool isFullScreenMode() override;
-
- virtual void addMenuItem(ContextMenuItem entry) override;
- virtual bool isMenuItemEnabled(ContextMenuItem entry) override;
-
- QWebEnginePage *m_page;
- QMenu *m_menu;
-};
-
-QT_END_NAMESPACE
-
-#endif // QWEBENGINEPAGE_P_H
diff --git a/src/webenginewidgets/api/qwebengineprofile.cpp b/src/webenginewidgets/api/qwebengineprofile.cpp
deleted file mode 100644
index 4c49be709..000000000
--- a/src/webenginewidgets/api/qwebengineprofile.cpp
+++ /dev/null
@@ -1,892 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qwebengineprofile.h"
-#include "qwebengineprofile_p.h"
-
-#include "qwebenginecookiestore.h"
-#include "qwebenginedownloaditem.h"
-#include "qwebenginedownloaditem_p.h"
-#include "qwebenginenotificationpresenter_p.h"
-#include "qwebenginepage.h"
-#include "qwebenginepage_p.h"
-#include "qwebenginesettings.h"
-#include "qwebenginescriptcollection_p.h"
-#include "qtwebenginecoreglobal.h"
-#include "profile_adapter.h"
-#include "visited_links_manager_qt.h"
-#include "web_engine_settings.h"
-
-#include <QDir>
-#include <QtWebEngineCore/qwebengineurlscheme.h>
-
-QT_BEGIN_NAMESPACE
-
-ASSERT_ENUMS_MATCH(QWebEngineDownloadItem::UnknownSaveFormat, QtWebEngineCore::ProfileAdapterClient::UnknownSavePageFormat)
-ASSERT_ENUMS_MATCH(QWebEngineDownloadItem::SingleHtmlSaveFormat, QtWebEngineCore::ProfileAdapterClient::SingleHtmlSaveFormat)
-ASSERT_ENUMS_MATCH(QWebEngineDownloadItem::CompleteHtmlSaveFormat, QtWebEngineCore::ProfileAdapterClient::CompleteHtmlSaveFormat)
-ASSERT_ENUMS_MATCH(QWebEngineDownloadItem::MimeHtmlSaveFormat, QtWebEngineCore::ProfileAdapterClient::MimeHtmlSaveFormat)
-
-using QtWebEngineCore::ProfileAdapter;
-
-/*!
- \class QWebEngineProfile
- \brief The QWebEngineProfile class provides a web engine profile shared by multiple pages.
- \since 5.5
-
- \inmodule QtWebEngineWidgets
-
- A web engine profile contains settings, scripts, persistent cookie policy, and the list of
- visited links shared by all web engine pages that belong to the profile.
-
- All pages that belong to the profile share a common QWebEngineSettings instance, which can
- be accessed with the settings() method. Likewise, the scripts() method provides access
- to a common QWebEngineScriptCollection instance.
-
- Information about visited links is stored together with persistent cookies and other persistent
- data in a storage returned by storageName(). Persistent data is stored in a subdirectory set by
- calling setPersistentStoragePath(), and the cache is located in a subdirectory set by calling
- setCachePath(). The cache type can be set to \e in-memory or \e on-disk by calling
- setHttpCacheType(). If only the storage name is set, the subdirectories are created and named
- automatically. If you set any of the values manually, you should do it before creating any
- pages that belong to the profile.
-
- The cache can be cleared of links by calling
- clearVisitedLinks() or clearAllVisitedLinks(). PersistentCookiesPolicy describes whether
- session and persistent cookies are saved to and restored from memory or disk.
-
- Profiles can be used to isolate pages from each other. A typical use case is a dedicated
- \e {off-the-record profile} for a \e {private browsing} mode. Using QWebEngineProfile() without
- defining a storage name constructs a new off-the-record profile that leaves no record on the
- local machine, and has no persistent data or cache. The isOffTheRecord() method can be used
- to check whether a profile is off-the-record.
-
- The default profile can be accessed by defaultProfile(). It is a built-in profile that all
- web pages not specifically created with another profile belong to.
-
- Implementing the QWebEngineUrlRequestInterceptor interface and registering the interceptor on a
- profile by setUrlRequestInterceptor() enables intercepting, blocking, and modifying URL
- requests (QWebEngineUrlRequestInfo) before they reach the networking stack of Chromium.
-
- A QWebEngineUrlSchemeHandler can be registered for a profile by installUrlSchemeHandler()
- to add support for custom URL schemes. Requests for the scheme are then issued to
- QWebEngineUrlSchemeHandler::requestStarted() as QWebEngineUrlRequestJob objects.
-
- Spellchecking HTML form fields can be enabled per profile by using the setSpellCheckEnabled()
- method and the current languages used for spellchecking can be set by using the
- setSpellCheckLanguages() method.
-
-*/
-
-/*!
- \enum QWebEngineProfile::HttpCacheType
-
- This enum describes the HTTP cache type:
-
- \value MemoryHttpCache Use an in-memory cache. This is the default if
- \c off-the-record is set.
- \value DiskHttpCache Use a disk cache. This is the default if the profile
- is not \c off-the-record. If set on an \c off-the-record profile will instead
- set \c MemoryHttpCache.
- \value NoCache Disable both in-memory and disk caching. (Added in Qt 5.7)
-*/
-
-/*!
- \enum QWebEngineProfile::PersistentCookiesPolicy
-
- This enum describes policy for cookie persistency:
-
- \value NoPersistentCookies
- Both session and persistent cookies are stored in memory. This is the only setting
- possible if \c off-the-record is set or no persistent data path is available.
- \value AllowPersistentCookies
- Cookies marked persistent are saved to and restored from disk, whereas session cookies
- are only stored to disk for crash recovery. This is the default setting.
- \value ForcePersistentCookies
- Both session and persistent cookies are saved to and restored from disk.
-*/
-
-void QWebEngineProfilePrivate::showNotification(QSharedPointer<QtWebEngineCore::UserNotificationController> &controller)
-{
- if (m_notificationPresenter) {
- std::unique_ptr<QWebEngineNotification> notification(new QWebEngineNotification(controller));
- m_notificationPresenter(std::move(notification));
- }
-}
-
-/*!
- \fn QWebEngineProfile::downloadRequested(QWebEngineDownloadItem *download)
-
- \since 5.5
-
- This signal is emitted whenever a download has been triggered.
- The \a download argument holds the state of the download.
- The download has to be explicitly accepted with QWebEngineDownloadItem::accept() or it will be
- cancelled by default.
- The download item is parented by the profile. If it is not accepted, it
- will be deleted immediately after the signal emission.
- This signal cannot be used with a queued connection.
-
- \sa QWebEngineDownloadItem, QWebEnginePage::download()
-*/
-
-QWebEngineProfilePrivate::QWebEngineProfilePrivate(ProfileAdapter* profileAdapter)
- : m_settings(new QWebEngineSettings())
- , m_profileAdapter(profileAdapter)
- , m_scriptCollection(new QWebEngineScriptCollection(
- new QWebEngineScriptCollectionPrivate(profileAdapter->userResourceController())))
-{
- m_profileAdapter->addClient(this);
- m_settings->d_ptr->initDefaults();
-}
-
-QWebEngineProfilePrivate::~QWebEngineProfilePrivate()
-{
- if (m_profileAdapter) {
- // In the case the user sets this profile as the parent of the interceptor
- // it can be deleted before the browser-context still referencing it is.
- m_profileAdapter->setRequestInterceptor(nullptr);
- m_profileAdapter->removeClient(this);
- }
-
- if (m_profileAdapter != QtWebEngineCore::ProfileAdapter::defaultProfileAdapter())
- delete m_profileAdapter;
-
- delete m_settings;
-}
-
-ProfileAdapter* QWebEngineProfilePrivate::profileAdapter() const
-{
- return m_profileAdapter;
-}
-
-void QWebEngineProfilePrivate::downloadDestroyed(quint32 downloadId)
-{
- m_ongoingDownloads.remove(downloadId);
- if (m_profileAdapter)
- m_profileAdapter->removeDownload(downloadId);
-}
-
-void QWebEngineProfilePrivate::cleanDownloads()
-{
- for (auto download : m_ongoingDownloads.values()) {
- if (!download)
- continue;
-
- if (!download->isFinished())
- download->cancel();
-
- if (m_profileAdapter)
- m_profileAdapter->removeDownload(download->id());
- }
- m_ongoingDownloads.clear();
-}
-
-void QWebEngineProfilePrivate::downloadRequested(DownloadItemInfo &info)
-{
- Q_Q(QWebEngineProfile);
-
- Q_ASSERT(!m_ongoingDownloads.contains(info.id));
- QWebEngineDownloadItemPrivate *itemPrivate = new QWebEngineDownloadItemPrivate(this, info.url);
- itemPrivate->downloadId = info.id;
- itemPrivate->downloadState = info.accepted ? QWebEngineDownloadItem::DownloadInProgress
- : QWebEngineDownloadItem::DownloadRequested;
- itemPrivate->startTime = info.startTime;
- itemPrivate->downloadDirectory = QFileInfo(info.path).path();
- itemPrivate->downloadFileName = QFileInfo(info.path).fileName();
- itemPrivate->suggestedFileName = info.suggestedFileName;
- itemPrivate->mimeType = info.mimeType;
- itemPrivate->savePageFormat = static_cast<QWebEngineDownloadItem::SavePageFormat>(info.savePageFormat);
- itemPrivate->type = static_cast<QWebEngineDownloadItem::DownloadType>(info.downloadType);
- if (info.page && info.page->clientType() == QtWebEngineCore::WebContentsAdapterClient::WidgetsClient)
- itemPrivate->page = static_cast<QWebEnginePagePrivate *>(info.page)->q_ptr;
- else
- itemPrivate->page = nullptr;
-
- QWebEngineDownloadItem *download = new QWebEngineDownloadItem(itemPrivate, q);
-
- m_ongoingDownloads.insert(info.id, download);
- QObject::connect(download, &QWebEngineDownloadItem::destroyed, q, [id = info.id, this] () { downloadDestroyed(id); });
-
- Q_EMIT q->downloadRequested(download);
-
- QWebEngineDownloadItem::DownloadState state = download->state();
-
- info.path = QDir(download->downloadDirectory()).filePath(download->downloadFileName());
- info.savePageFormat = static_cast<QtWebEngineCore::ProfileAdapterClient::SavePageFormat>(
- download->savePageFormat());
- info.accepted = state != QWebEngineDownloadItem::DownloadCancelled;
-
- if (state == QWebEngineDownloadItem::DownloadRequested) {
- // Delete unaccepted downloads.
- info.accepted = false;
- delete download;
- }
-}
-
-void QWebEngineProfilePrivate::downloadUpdated(const DownloadItemInfo &info)
-{
- if (!m_ongoingDownloads.contains(info.id))
- return;
-
- QWebEngineDownloadItem* download = m_ongoingDownloads.value(info.id).data();
-
- if (!download) {
- downloadDestroyed(info.id);
- return;
- }
-
- download->d_func()->update(info);
-}
-
-void QWebEngineProfilePrivate::addWebContentsAdapterClient(QtWebEngineCore::WebContentsAdapterClient *adapter)
-{
- Q_ASSERT(m_profileAdapter);
- m_profileAdapter->addWebContentsAdapterClient(adapter);
-}
-
-void QWebEngineProfilePrivate::removeWebContentsAdapterClient(QtWebEngineCore::WebContentsAdapterClient *adapter)
-{
- Q_ASSERT(m_profileAdapter);
- m_profileAdapter->removeWebContentsAdapterClient(adapter);
-}
-
-/*!
- Constructs a new off-the-record profile with the parent \a parent.
-
- An off-the-record profile leaves no record on the local machine, and has no persistent data or cache.
- Thus, the HTTP cache can only be in memory and the cookies can only be non-persistent. Trying to change
- these settings will have no effect.
-
- \sa isOffTheRecord()
-*/
-QWebEngineProfile::QWebEngineProfile(QObject *parent)
- : QObject(parent)
- , d_ptr(new QWebEngineProfilePrivate(new QtWebEngineCore::ProfileAdapter()))
-{
- d_ptr->q_ptr = this;
-}
-
-/*!
- Constructs a new profile with the storage name \a storageName and parent \a parent.
-
- The storage name must be unique.
-
- A disk-based QWebEngineProfile should be destroyed on or before application exit, otherwise the cache
- and persistent data may not be fully flushed to disk.
-
- \sa storageName()
-*/
-QWebEngineProfile::QWebEngineProfile(const QString &storageName, QObject *parent)
- : QObject(parent)
- , d_ptr(new QWebEngineProfilePrivate(new QtWebEngineCore::ProfileAdapter(storageName)))
-{
- d_ptr->q_ptr = this;
-}
-
-/*! \internal
-*/
-QWebEngineProfile::QWebEngineProfile(QWebEngineProfilePrivate *privatePtr, QObject *parent)
- : QObject(parent)
- , d_ptr(privatePtr)
-{
- d_ptr->q_ptr = this;
-}
-
-/*! \internal
-*/
-QWebEngineProfile::~QWebEngineProfile()
-{
- d_ptr->cleanDownloads();
-}
-
-/*!
- Returns the storage name for the profile.
-
- The storage name is used to give each profile that uses the disk separate subdirectories for persistent data and cache.
-*/
-QString QWebEngineProfile::storageName() const
-{
- const Q_D(QWebEngineProfile);
- return d->profileAdapter()->storageName();
-}
-
-/*!
- Returns \c true if this is an off-the-record profile that leaves no record on the computer.
-
- This will force cookies and HTTP cache to be in memory, but also force all other normally
- persistent data to be stored in memory.
-*/
-bool QWebEngineProfile::isOffTheRecord() const
-{
- const Q_D(QWebEngineProfile);
- return d->profileAdapter()->isOffTheRecord();
-}
-
-/*!
- Returns the path used to store persistent data for the browser and web content.
-
- Persistent data includes persistent cookies, HTML5 local storage, and visited links.
-
- By default, this is below QStandardPaths::DataLocation in a QtWebengine/StorageName specific
- subdirectory.
-
- \note Use QStandardPaths::writableLocation(QStandardPaths::DataLocation)
- to obtain the QStandardPaths::DataLocation path.
-
- \sa setPersistentStoragePath(), storageName(), QStandardPaths::writableLocation()
-*/
-QString QWebEngineProfile::persistentStoragePath() const
-{
- const Q_D(QWebEngineProfile);
- return d->profileAdapter()->dataPath();
-}
-
-/*!
- Overrides the default path used to store persistent web engine data.
-
- If \a path is set to the null string, the default path is restored.
-
- \sa persistentStoragePath()
-*/
-void QWebEngineProfile::setPersistentStoragePath(const QString &path)
-{
- const Q_D(QWebEngineProfile);
- d->profileAdapter()->setDataPath(path);
-}
-
-/*!
- \since 5.13
-
- The path to the location where the downloaded files are stored.
-
- \note By default, the download path is QStandardPaths::DownloadLocation.
-
- \sa setDownloadPath(), QStandardPaths::writableLocation()
-*/
-QString QWebEngineProfile::downloadPath() const
-{
- const Q_D(QWebEngineProfile);
- return d->profileAdapter()->downloadPath();
-}
-
-/*!
- \since 5.13
-
- Overrides the default path used for download location, setting it to \a path.
-
- If set to the null string, the default path is restored.
-
- \sa downloadPath()
-*/
-void QWebEngineProfile::setDownloadPath(const QString &path)
-{
- Q_D(QWebEngineProfile);
- d->profileAdapter()->setDownloadPath(path);
-}
-
-/*!
- Returns the path used for caches.
-
- By default, this is below StandardPaths::CacheLocation in a QtWebengine/StorageName specific
- subdirectory.
-
- \note Use QStandardPaths::writableLocation(QStandardPaths::CacheLocation)
- to obtain the QStandardPaths::CacheLocation path.
-
- \sa setCachePath(), storageName(), QStandardPaths::writableLocation()
-*/
-QString QWebEngineProfile::cachePath() const
-{
- const Q_D(QWebEngineProfile);
- return d->profileAdapter()->cachePath();
-}
-
-/*!
- Overrides the default path used for disk caches, setting it to \a path.
-
- If set to the null string, the default path is restored.
-
- \sa cachePath()
-*/
-void QWebEngineProfile::setCachePath(const QString &path)
-{
- Q_D(QWebEngineProfile);
- d->profileAdapter()->setCachePath(path);
-}
-
-/*!
- Returns the user-agent string sent with HTTP to identify the browser.
-
- \note On Windows 8.1 and newer, the default user agent will always report
- "Windows NT 6.2" (Windows 8), unless the application does contain a manifest
- that declares newer Windows versions as supported.
-
- \sa setHttpUserAgent()
-*/
-QString QWebEngineProfile::httpUserAgent() const
-{
- const Q_D(QWebEngineProfile);
- return d->profileAdapter()->httpUserAgent();
-}
-
-/*!
- Overrides the default user-agent string, setting it to \a userAgent.
-
- \sa httpUserAgent()
-*/
-void QWebEngineProfile::setHttpUserAgent(const QString &userAgent)
-{
- Q_D(QWebEngineProfile);
- d->profileAdapter()->setHttpUserAgent(userAgent);
-}
-
-/*!
- Returns the type of HTTP cache used.
-
- If the profile is off-the-record, MemoryHttpCache is returned.
-
- \sa setHttpCacheType(), cachePath()
-*/
-QWebEngineProfile::HttpCacheType QWebEngineProfile::httpCacheType() const
-{
- const Q_D(QWebEngineProfile);
- return QWebEngineProfile::HttpCacheType(d->profileAdapter()->httpCacheType());
-}
-
-/*!
- Sets the HTTP cache type to \a httpCacheType.
-
- \sa httpCacheType(), setCachePath()
-*/
-void QWebEngineProfile::setHttpCacheType(QWebEngineProfile::HttpCacheType httpCacheType)
-{
- Q_D(QWebEngineProfile);
- d->profileAdapter()->setHttpCacheType(ProfileAdapter::HttpCacheType(httpCacheType));
-}
-
-/*!
- Sets the value of the Accept-Language HTTP request-header field to \a httpAcceptLanguage.
-
- \since 5.6
- */
-void QWebEngineProfile::setHttpAcceptLanguage(const QString &httpAcceptLanguage)
-{
- Q_D(QWebEngineProfile);
- d->profileAdapter()->setHttpAcceptLanguage(httpAcceptLanguage);
-}
-
-/*!
- Returns the value of the Accept-Language HTTP request-header field.
-
- \since 5.6
- */
-QString QWebEngineProfile::httpAcceptLanguage() const
-{
- Q_D(const QWebEngineProfile);
- return d->profileAdapter()->httpAcceptLanguage();
-}
-
-/*!
- Returns the current policy for persistent cookies.
-
- If the profile is off-the-record, NoPersistentCookies is returned.
-
- \sa setPersistentCookiesPolicy()
-*/
-QWebEngineProfile::PersistentCookiesPolicy QWebEngineProfile::persistentCookiesPolicy() const
-{
- const Q_D(QWebEngineProfile);
- return QWebEngineProfile::PersistentCookiesPolicy(d->profileAdapter()->persistentCookiesPolicy());
-}
-
-/*!
- Sets the policy for persistent cookies to \a newPersistentCookiesPolicy.
-
- \sa persistentCookiesPolicy()
-*/
-void QWebEngineProfile::setPersistentCookiesPolicy(QWebEngineProfile::PersistentCookiesPolicy newPersistentCookiesPolicy)
-{
- Q_D(QWebEngineProfile);
- d->profileAdapter()->setPersistentCookiesPolicy(ProfileAdapter::PersistentCookiesPolicy(newPersistentCookiesPolicy));
-}
-
-/*!
- Returns the maximum size of the HTTP cache in bytes.
-
- Will return \c 0 if the size is automatically controlled by QtWebEngine.
-
- \sa setHttpCacheMaximumSize(), httpCacheType()
-*/
-int QWebEngineProfile::httpCacheMaximumSize() const
-{
- const Q_D(QWebEngineProfile);
- return d->profileAdapter()->httpCacheMaxSize();
-}
-
-/*!
- Sets the maximum size of the HTTP cache to \a maxSize bytes.
-
- Setting it to \c 0 means the size will be controlled automatically by QtWebEngine.
-
- \sa httpCacheMaximumSize(), setHttpCacheType()
-*/
-void QWebEngineProfile::setHttpCacheMaximumSize(int maxSize)
-{
- Q_D(QWebEngineProfile);
- d->profileAdapter()->setHttpCacheMaxSize(maxSize);
-}
-
-/*!
- Returns the cookie store for this profile.
-
- \since 5.6
-*/
-
-QWebEngineCookieStore* QWebEngineProfile::cookieStore()
-{
- Q_D(QWebEngineProfile);
- return d->profileAdapter()->cookieStore();
-}
-
-#if QT_DEPRECATED_SINCE(5, 13)
-/*!
- Registers a request interceptor singleton \a interceptor to intercept URL requests.
-
- The profile does not take ownership of the pointer.
-
- \obsolete
-
- Interceptors installed with this method will call
- QWebEngineUrlRequestInterceptor::interceptRequest on the I/O thread. Therefore
- the user has to provide thread-safe interaction with the other user classes.
- For a duration of this call ui thread is blocked.
- Use setUrlRequestInterceptor instead.
-
- \since 5.6
- \sa QWebEngineUrlRequestInfo
-
-*/
-void QWebEngineProfile::setRequestInterceptor(QWebEngineUrlRequestInterceptor *interceptor)
-{
- Q_D(QWebEngineProfile);
- if (interceptor)
- interceptor->setProperty("deprecated", true);
- d->profileAdapter()->setRequestInterceptor(interceptor);
- if (interceptor)
- qDebug("Use of deprecated not thread-safe setter, use setUrlRequestInterceptor instead.");
-}
-#endif
-/*!
- Registers a request interceptor singleton \a interceptor to intercept URL requests.
-
- The profile does not take ownership of the pointer.
-
- \since 5.13
- \sa QWebEngineUrlRequestInfo QWebEngineUrlRequestInterceptor
-*/
-
-void QWebEngineProfile::setUrlRequestInterceptor(QWebEngineUrlRequestInterceptor *interceptor)
-{
- Q_D(QWebEngineProfile);
- d->profileAdapter()->setRequestInterceptor(interceptor);
-}
-
-/*!
- Clears all links from the visited links database.
-
- \sa clearVisitedLinks()
-*/
-void QWebEngineProfile::clearAllVisitedLinks()
-{
- Q_D(QWebEngineProfile);
- d->profileAdapter()->visitedLinksManager()->deleteAllVisitedLinkData();
-}
-
-/*!
- Clears the links in \a urls from the visited links database.
-
- \sa clearAllVisitedLinks()
-*/
-void QWebEngineProfile::clearVisitedLinks(const QList<QUrl> &urls)
-{
- Q_D(QWebEngineProfile);
- d->profileAdapter()->visitedLinksManager()->deleteVisitedLinkDataForUrls(urls);
-}
-
-/*!
- Returns \c true if \a url is considered a visited link by this profile.
-*/
-bool QWebEngineProfile::visitedLinksContainsUrl(const QUrl &url) const
-{
- Q_D(const QWebEngineProfile);
- return d->profileAdapter()->visitedLinksManager()->containsUrl(url);
-}
-
-/*!
- Returns the collection of scripts that are injected into all pages that share
- this profile.
-
- \sa QWebEngineScriptCollection, QWebEngineScript, QWebEnginePage::scripts(),
- {Script Injection}
-*/
-QWebEngineScriptCollection *QWebEngineProfile::scripts() const
-{
- Q_D(const QWebEngineProfile);
- return d->m_scriptCollection.data();
-}
-
-/*!
- Sets the function \a notificationPresenter as responsible for presenting sent notifications.
-
- \since 5.13
- \sa QWebEngineNotification
-*/
-void QWebEngineProfile::setNotificationPresenter(std::function<void(std::unique_ptr<QWebEngineNotification>)> notificationPresenter)
-{
- Q_D(QWebEngineProfile);
- d->m_notificationPresenter = std::move(notificationPresenter);
-}
-
-/*!
- Returns the default profile.
-
- The default profile uses the storage name "Default".
-
- \sa storageName()
-*/
-QWebEngineProfile *QWebEngineProfile::defaultProfile()
-{
- static QWebEngineProfile* profile = new QWebEngineProfile(
- new QWebEngineProfilePrivate(ProfileAdapter::createDefaultProfileAdapter()),
- ProfileAdapter::globalQObjectRoot());
- if (!profile->d_ptr->m_notificationPresenter)
- profile->setNotificationPresenter(&defaultNotificationPresenter);
- return profile;
-}
-
-/*!
- \since 5.8
-
- Sets the current list of \a languages for the spell checker.
- Each language should match the name of the \c .bdic dictionary.
- For example, the language \c en-US will load the \c en-US.bdic
- dictionary file.
-
- See the \l {Spellchecker}{Spellchecker feature documentation} for how
- dictionary files are searched.
-
- For more information about how to compile \c .bdic dictionaries, see the
- \l{WebEngine Widgets Spellchecker Example}{Spellchecker Example}.
-
-*/
-void QWebEngineProfile::setSpellCheckLanguages(const QStringList &languages)
-{
- Q_D(QWebEngineProfile);
- d->profileAdapter()->setSpellCheckLanguages(languages);
-}
-
-/*!
- \since 5.8
-
- Returns the list of languages used by the spell checker.
-*/
-QStringList QWebEngineProfile::spellCheckLanguages() const
-{
- const Q_D(QWebEngineProfile);
- return d->profileAdapter()->spellCheckLanguages();
-}
-
-/*!
- \since 5.8
-
- Enables spell checker if \a enable is \c true, otherwise disables it.
- \sa isSpellCheckEnabled()
- */
-void QWebEngineProfile::setSpellCheckEnabled(bool enable)
-{
- Q_D(QWebEngineProfile);
- d->profileAdapter()->setSpellCheckEnabled(enable);
-}
-/*!
- \since 5.8
-
- Returns \c true if the spell checker is enabled; otherwise returns \c false.
- \sa setSpellCheckEnabled()
- */
-bool QWebEngineProfile::isSpellCheckEnabled() const
-{
- const Q_D(QWebEngineProfile);
- return d->profileAdapter()->isSpellCheckEnabled();
-}
-
-/*!
- Returns the default settings for all pages in this profile.
-*/
-QWebEngineSettings *QWebEngineProfile::settings() const
-{
- const Q_D(QWebEngineProfile);
- return d->settings();
-}
-
-/*!
- \since 5.6
-
- Returns the custom URL scheme handler register for the URL scheme \a scheme.
-*/
-const QWebEngineUrlSchemeHandler *QWebEngineProfile::urlSchemeHandler(const QByteArray &scheme) const
-{
- const Q_D(QWebEngineProfile);
- return d->profileAdapter()->urlSchemeHandler(scheme);
-}
-
-/*!
- \since 5.6
-
- Registers a handler \a handler for custom URL scheme \a scheme in the profile.
-
- It is necessary to first register the scheme with \l
- QWebEngineUrlScheme::registerScheme at application startup.
-*/
-void QWebEngineProfile::installUrlSchemeHandler(const QByteArray &scheme, QWebEngineUrlSchemeHandler *handler)
-{
- Q_D(QWebEngineProfile);
- d->profileAdapter()->installUrlSchemeHandler(scheme, handler);
-}
-
-/*!
- \since 5.6
-
- Removes the custom URL scheme handler \a handler from the profile.
-
- \sa removeUrlScheme()
-*/
-void QWebEngineProfile::removeUrlSchemeHandler(QWebEngineUrlSchemeHandler *handler)
-{
- Q_D(QWebEngineProfile);
- d->profileAdapter()->removeUrlSchemeHandler(handler);
-}
-
-/*!
- \since 5.6
-
- Removes the custom URL scheme \a scheme from the profile.
-
- \sa removeUrlSchemeHandler()
-*/
-void QWebEngineProfile::removeUrlScheme(const QByteArray &scheme)
-{
- Q_D(QWebEngineProfile);
- d->profileAdapter()->removeUrlScheme(scheme);
-}
-
-/*!
- \since 5.6
-
- Removes all custom URL scheme handlers installed in the profile.
-*/
-void QWebEngineProfile::removeAllUrlSchemeHandlers()
-{
- Q_D(QWebEngineProfile);
- d->profileAdapter()->removeAllUrlSchemeHandlers();
-}
-
-/*!
- \since 5.13
-
- Sets if this profile is to be used for downloading and caching when needed
- during certificate verification, for instance for OCSP, CRLs, and AIA.
-
- Only one QWebEngineProfile can do this at a time, and it is recommended
- that the profile fullfilling this role has a disk HTTP cache to avoid
- needlessly re-downloading. If you set the option on a second profile,
- it will be disabled on the profile it is currently set.
-
- Currently only affects Linux/NSS installations where it enables OCSP.
-
- As long as one profile has \a enabled set to \c true, all other profiles
- will be able to use it for their certificate verification.
-
- \sa isUsedForGlobalCertificateVerification(), httpCacheType()
-*/
-void QWebEngineProfile::setUseForGlobalCertificateVerification(bool enabled)
-{
- Q_D(QWebEngineProfile);
- d->profileAdapter()->setUseForGlobalCertificateVerification(enabled);
-}
-
-/*!
- \since 5.13
-
- Returns \c true if this profile is currently being used for global
- certificate verification.
-*/
-bool QWebEngineProfile::isUsedForGlobalCertificateVerification() const
-{
- Q_D(const QWebEngineProfile);
- return d->profileAdapter()->isUsedForGlobalCertificateVerification();
-}
-
-/*!
- \since 5.7
-
- Removes the profile's cache entries.
-*/
-void QWebEngineProfile::clearHttpCache()
-{
- Q_D(QWebEngineProfile);
- d->profileAdapter()->clearHttpCache();
-}
-
-/*!
- \since 5.13
-
- Returns the profile's client certificate store.
-*/
-QWebEngineClientCertificateStore *QWebEngineProfile::clientCertificateStore()
-{
-#if QT_CONFIG(ssl)
- Q_D(QWebEngineProfile);
- return d->profileAdapter()->clientCertificateStore();
-#else
- return nullptr;
-#endif
-}
-
-QT_END_NAMESPACE
diff --git a/src/webenginewidgets/api/qwebengineprofile.h b/src/webenginewidgets/api/qwebengineprofile.h
deleted file mode 100644
index 794ba6279..000000000
--- a/src/webenginewidgets/api/qwebengineprofile.h
+++ /dev/null
@@ -1,167 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWEBENGINEPROFILE_H
-#define QWEBENGINEPROFILE_H
-
-#include <QtWebEngineWidgets/qtwebenginewidgetsglobal.h>
-
-#include <QtCore/qobject.h>
-#include <QtCore/qscopedpointer.h>
-#include <QtCore/qstring.h>
-
-#include <functional>
-#include <memory>
-
-QT_BEGIN_NAMESPACE
-
-class QObject;
-class QUrl;
-class QWebEngineClientCertificateStore;
-class QWebEngineCookieStore;
-class QWebEngineDownloadItem;
-class QWebEngineNotification;
-class QWebEnginePage;
-class QWebEnginePagePrivate;
-class QWebEngineProfilePrivate;
-class QWebEngineSettings;
-class QWebEngineScriptCollection;
-class QWebEngineUrlRequestInterceptor;
-class QWebEngineUrlSchemeHandler;
-
-class QWEBENGINEWIDGETS_EXPORT QWebEngineProfile : public QObject {
- Q_OBJECT
-public:
- explicit QWebEngineProfile(QObject *parent = Q_NULLPTR);
- explicit QWebEngineProfile(const QString &name, QObject *parent = Q_NULLPTR);
- virtual ~QWebEngineProfile();
-
- enum HttpCacheType {
- MemoryHttpCache,
- DiskHttpCache,
- NoCache
- };
- Q_ENUM(HttpCacheType)
-
- enum PersistentCookiesPolicy {
- NoPersistentCookies,
- AllowPersistentCookies,
- ForcePersistentCookies
- };
- Q_ENUM(PersistentCookiesPolicy)
-
- QString storageName() const;
- bool isOffTheRecord() const;
-
- QString persistentStoragePath() const;
- void setPersistentStoragePath(const QString &path);
-
- QString cachePath() const;
- void setCachePath(const QString &path);
-
- QString httpUserAgent() const;
- void setHttpUserAgent(const QString &userAgent);
-
- HttpCacheType httpCacheType() const;
- void setHttpCacheType(QWebEngineProfile::HttpCacheType);
-
- void setHttpAcceptLanguage(const QString &httpAcceptLanguage);
- QString httpAcceptLanguage() const;
-
- PersistentCookiesPolicy persistentCookiesPolicy() const;
- void setPersistentCookiesPolicy(QWebEngineProfile::PersistentCookiesPolicy);
-
- int httpCacheMaximumSize() const;
- void setHttpCacheMaximumSize(int maxSize);
-
- QWebEngineCookieStore* cookieStore();
-#if QT_DEPRECATED_SINCE(5, 13)
- void setRequestInterceptor(QWebEngineUrlRequestInterceptor *interceptor);
-#endif
- void setUrlRequestInterceptor(QWebEngineUrlRequestInterceptor *interceptor);
-
- void clearAllVisitedLinks();
- void clearVisitedLinks(const QList<QUrl> &urls);
- bool visitedLinksContainsUrl(const QUrl &url) const;
-
- QWebEngineSettings *settings() const;
- QWebEngineScriptCollection *scripts() const;
-
- const QWebEngineUrlSchemeHandler *urlSchemeHandler(const QByteArray &) const;
- void installUrlSchemeHandler(const QByteArray &scheme, QWebEngineUrlSchemeHandler *);
- void removeUrlScheme(const QByteArray &scheme);
- void removeUrlSchemeHandler(QWebEngineUrlSchemeHandler *);
- void removeAllUrlSchemeHandlers();
-
- void clearHttpCache();
-
- void setSpellCheckLanguages(const QStringList &languages);
- QStringList spellCheckLanguages() const;
- void setSpellCheckEnabled(bool enabled);
- bool isSpellCheckEnabled() const;
-
- void setUseForGlobalCertificateVerification(bool enabled = true);
- bool isUsedForGlobalCertificateVerification() const;
-
- QString downloadPath() const;
- void setDownloadPath(const QString &path);
-
- void setNotificationPresenter(std::function<void(std::unique_ptr<QWebEngineNotification>)> notificationPresenter);
-
- QWebEngineClientCertificateStore *clientCertificateStore();
-
- static QWebEngineProfile *defaultProfile();
-
-Q_SIGNALS:
- void downloadRequested(QWebEngineDownloadItem *download);
-
-private:
- Q_DISABLE_COPY(QWebEngineProfile)
- Q_DECLARE_PRIVATE(QWebEngineProfile)
- QWebEngineProfile(QWebEngineProfilePrivate *, QObject *parent = Q_NULLPTR);
-
- friend class QWebEnginePage;
- friend class QWebEnginePagePrivate;
- friend class QWebEngineUrlSchemeHandler;
- QScopedPointer<QWebEngineProfilePrivate> d_ptr;
-};
-
-QT_END_NAMESPACE
-
-#endif // QWEBENGINEPROFILE_H
diff --git a/src/webenginewidgets/api/qwebengineprofile_p.h b/src/webenginewidgets/api/qwebengineprofile_p.h
deleted file mode 100644
index 64e9500b0..000000000
--- a/src/webenginewidgets/api/qwebengineprofile_p.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWEBENGINEPROFILE_P_H
-#define QWEBENGINEPROFILE_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "profile_adapter_client.h"
-#include "qwebengineprofile.h"
-#include "qwebenginescriptcollection.h"
-
-#include <QMap>
-#include <QPointer>
-#include <QScopedPointer>
-#include <QSharedPointer>
-
-#include <functional>
-
-namespace QtWebEngineCore {
-class ProfileAdapter;
-}
-
-QT_BEGIN_NAMESPACE
-
-class QWebEngineBrowserContext;
-class QWebEngineProfilePrivate;
-class QWebEngineNotification;
-class QWebEngineSettings;
-
-class QWebEngineProfilePrivate : public QtWebEngineCore::ProfileAdapterClient {
-public:
- Q_DECLARE_PUBLIC(QWebEngineProfile)
- QWebEngineProfilePrivate(QtWebEngineCore::ProfileAdapter *profileAdapter);
- ~QWebEngineProfilePrivate();
-
- QtWebEngineCore::ProfileAdapter* profileAdapter() const;
- QWebEngineSettings *settings() const { return m_settings; }
-
- void downloadDestroyed(quint32 downloadId);
-
- void cleanDownloads();
-
- void downloadRequested(DownloadItemInfo &info) override;
- void downloadUpdated(const DownloadItemInfo &info) override;
-
- void showNotification(QSharedPointer<QtWebEngineCore::UserNotificationController> &) override;
-
- void addWebContentsAdapterClient(QtWebEngineCore::WebContentsAdapterClient *adapter) override;
- void removeWebContentsAdapterClient(QtWebEngineCore::WebContentsAdapterClient *adapter) override;
-
-private:
- QWebEngineProfile *q_ptr;
- QWebEngineSettings *m_settings;
- QPointer<QtWebEngineCore::ProfileAdapter> m_profileAdapter;
- QScopedPointer<QWebEngineScriptCollection> m_scriptCollection;
- QMap<quint32, QPointer<QWebEngineDownloadItem> > m_ongoingDownloads;
- std::function<void(std::unique_ptr<QWebEngineNotification>)> m_notificationPresenter;
-};
-
-QT_END_NAMESPACE
-
-#endif // QWEBENGINEPROFILE_P_H
diff --git a/src/webenginewidgets/api/qwebenginescript.cpp b/src/webenginewidgets/api/qwebenginescript.cpp
deleted file mode 100644
index af6b9aa8d..000000000
--- a/src/webenginewidgets/api/qwebenginescript.cpp
+++ /dev/null
@@ -1,293 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qwebenginescript.h"
-
-#include "user_script.h"
-#include <QtCore/QDebug>
-
-using QtWebEngineCore::UserScript;
-
-/*!
- \class QWebEngineScript
- \inmodule QtWebEngineWidgets
- \since 5.5
- \brief The QWebEngineScript class encapsulates a JavaScript program.
-
-
- QWebEngineScript enables the programmatic injection of so called \e {user scripts} in the
- JavaScript engine at different points, determined by injectionPoint(), during the loading of web
- contents.
-
- Scripts can be executed either in the main JavaScript \e world, along with the rest of the
- JavaScript coming from the web contents, or in their own isolated world. While the DOM of the
- page can be accessed from any world, JavaScript variables of a function defined in one world are
- not accessible from a different one. ScriptWorldId provides some predefined IDs for this
- purpose.
-
- The following \l Greasemonkey attributes are supported since Qt 5.8:
- \c @exclude, \c @include, \c @name, \c @match, and \c @run-at.
-
- Use QWebEnginePage::scripts() and QWebEngineProfile::scripts() to access
- the collection of scripts associated with a single page or a
- number of pages sharing the same profile.
-
- \sa {Script Injection}
-*/
-/*!
- \enum QWebEngineScript::InjectionPoint
-
- This enum describes the timing of the script injection:
-
- \value DocumentCreation The script will be executed as soon as the document is created. This is not suitable for
- any DOM operation.
- \value DocumentReady The script will run as soon as the DOM is ready. This is equivalent to the
- \c DOMContentLoaded event firing in JavaScript.
- \value Deferred The script will run when the page load finishes, or 500ms after the document is ready, whichever
- comes first.
-
-*/
-/*!
- \enum QWebEngineScript::ScriptWorldId
-
- This enum provides pre-defined world IDs for isolating user scripts into different worlds:
-
- \value MainWorld The world used by the page's web contents. It can be useful in order to expose custom functionality
- to web contents in certain scenarios.
- \value ApplicationWorld The default isolated world used for application level functionality implemented in JavaScript.
- \value UserWorld The first isolated world to be used by scripts set by users if the application is not making use
- of more worlds. As a rule of thumb, if that functionality is exposed to the application users, each individual script
- should probably get its own isolated world.
-
-*/
-
-/*!
- \fn QWebEngineScript::operator!=(const QWebEngineScript &other) const
-
- Returns \c true if the script is not equal to \a other, otherwise returns \c false.
-*/
-
-/*!
- \fn QWebEngineScript::swap(QWebEngineScript &other)
-
- Swaps the contents of the script with the contents of \a other.
-*/
-
-/*!
- * Constructs a null script.
- */
-
-QWebEngineScript::QWebEngineScript()
- : d(new UserScript)
-{
-}
-
-/*!
- * Constructs a user script using the contents of \a other.
- */
-QWebEngineScript::QWebEngineScript(const QWebEngineScript &other)
- : d(other.d)
-{
-}
-
-/*!
- Destroys a script.
-*/
-QWebEngineScript::~QWebEngineScript()
-{
-}
-
-/*!
- Assigns \a other to the script.
-*/
-QWebEngineScript &QWebEngineScript::operator=(const QWebEngineScript &other)
-{
- d = other.d;
- return *this;
-}
-
-/*!
- Returns \c true is the script is null; otherwise returns \c false.
-*/
-bool QWebEngineScript::isNull() const
-{
- return d->isNull();
-}
-
-/*!
- * Returns the name of the script. Can be useful to retrieve a particular script from a
- * QWebEngineScriptCollection.
- *
- * \sa QWebEngineScriptCollection::findScript(), QWebEngineScriptCollection::findScripts()
- */
-
-QString QWebEngineScript::name() const
-{
- return d->name();
-}
-
-/*!
- * Sets the script name to \a scriptName.
- */
-void QWebEngineScript::setName(const QString &scriptName)
-{
- if (scriptName == name())
- return;
- d->setName(scriptName);
-}
-
-/*!
- Returns the source of the script.
- */
-QString QWebEngineScript::sourceCode() const
-{
- return d->sourceCode();
-}
-
-/*!
- * Sets the script source to \a scriptSource.
- */
-void QWebEngineScript::setSourceCode(const QString &scriptSource)
-{
- if (scriptSource == sourceCode())
- return;
- d->setSourceCode(scriptSource);
-}
-
-ASSERT_ENUMS_MATCH(QWebEngineScript::Deferred, UserScript::AfterLoad)
-ASSERT_ENUMS_MATCH(QWebEngineScript::DocumentReady, UserScript::DocumentLoadFinished)
-ASSERT_ENUMS_MATCH(QWebEngineScript::DocumentCreation, UserScript::DocumentElementCreation)
-
-/*!
- * Returns the point in the loading process at which the script will be executed.
- * The default value is QWebEngineScript::Deferred.
- *
- * \sa setInjectionPoint()
- */
-QWebEngineScript::InjectionPoint QWebEngineScript::injectionPoint() const
-{
- return static_cast<QWebEngineScript::InjectionPoint>(d->injectionPoint());
-}
-/*!
- * Sets the point at which to execute the script to be \a p.
- *
- * \sa InjectionPoint
- */
-void QWebEngineScript::setInjectionPoint(QWebEngineScript::InjectionPoint p)
-{
- if (p == injectionPoint())
- return;
- d->setInjectionPoint(static_cast<UserScript::InjectionPoint>(p));
-}
-
-/*!
- Returns the world ID defining which world the script is executed in.
- */
-quint32 QWebEngineScript::worldId() const
-{
- return d->worldId();
-}
-
-/*!
- Sets the world ID of the isolated world to \a id when running this script.
-
- Must be between \c 0 and \c 256.
- */
-void QWebEngineScript::setWorldId(quint32 id)
-{
- if (id == d->worldId())
- return;
- d->setWorldId(id);
-}
-
-/*!
- Returns \c true if the script is executed on every frame in the page, or \c false if it is only
- ran for the main frame.
- */
-bool QWebEngineScript::runsOnSubFrames() const
-{
- return d->runsOnSubFrames();
-}
-
-/*!
- * Executes the script on sub frames in addition to the main frame if \a on returns \c true.
- */
-void QWebEngineScript::setRunsOnSubFrames(bool on)
-{
- if (runsOnSubFrames() == on)
- return;
- d->setRunsOnSubFrames(on);
-}
-
-/*!
- Returns \c true if the script is equal to \a other, otherwise returns \c false.
- */
-bool QWebEngineScript::operator==(const QWebEngineScript &other) const
-{
- return d == other.d || *d == *(other.d);
-}
-
-QWebEngineScript::QWebEngineScript(const UserScript &coreScript)
- : d(new UserScript(coreScript))
-{
-}
-
-#ifndef QT_NO_DEBUG_STREAM
-QDebug operator<<(QDebug d, const QWebEngineScript &script)
-{
- if (script.isNull())
- return d.maybeSpace() << "QWebEngineScript()";
-
- d.nospace() << "QWebEngineScript(" << script.name() << ", ";
- switch (script.injectionPoint()) {
- case QWebEngineScript::DocumentCreation:
- d << "QWebEngineScript::DocumentCreation" << ", ";
- break;
- case QWebEngineScript::DocumentReady:
- d << "QWebEngineScript::DocumentReady" << ", ";
- break;
- case QWebEngineScript::Deferred:
- d << "QWebEngineScript::Deferred" << ", ";
- break;
- }
- d << script.worldId() << ", "
- << script.runsOnSubFrames() << ", " << script.sourceCode() << ")";
- return d.space();
-}
-#endif
diff --git a/src/webenginewidgets/api/qwebenginescript.h b/src/webenginewidgets/api/qwebenginescript.h
deleted file mode 100644
index e3f65ec59..000000000
--- a/src/webenginewidgets/api/qwebenginescript.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWEBENGINESCRIPT_H
-#define QWEBENGINESCRIPT_H
-
-#include <QtWebEngineWidgets/qtwebenginewidgetsglobal.h>
-
-#include <QtCore/qshareddata.h>
-#include <QtCore/qstring.h>
-
-namespace QtWebEngineCore {
-class UserScript;
-} // namespace
-
-QT_BEGIN_NAMESPACE
-
-class QWEBENGINEWIDGETS_EXPORT QWebEngineScript {
-public:
- enum InjectionPoint {
- Deferred,
- DocumentReady,
- DocumentCreation
- };
-
- enum ScriptWorldId {
- MainWorld = 0,
- ApplicationWorld,
- UserWorld
- };
-
- QWebEngineScript();
- QWebEngineScript(const QWebEngineScript &other);
- ~QWebEngineScript();
-
- QWebEngineScript &operator=(const QWebEngineScript &other);
-
- bool isNull() const;
-
- QString name() const;
- void setName(const QString &);
-
- QString sourceCode() const;
- void setSourceCode(const QString &);
-
- InjectionPoint injectionPoint() const;
- void setInjectionPoint(InjectionPoint);
-
- quint32 worldId() const;
- void setWorldId(quint32);
-
- bool runsOnSubFrames() const;
- void setRunsOnSubFrames(bool on);
-
- bool operator==(const QWebEngineScript &other) const;
- inline bool operator!=(const QWebEngineScript &other) const
- { return !operator==(other); }
- void swap(QWebEngineScript &other) { qSwap(d, other.d); }
-
-
-private:
- friend class QWebEngineScriptCollectionPrivate;
- friend class QWebEngineScriptCollection;
- QWebEngineScript(const QtWebEngineCore::UserScript &);
-
- QSharedDataPointer<QtWebEngineCore::UserScript> d;
-};
-
-Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QWebEngineScript)
-
-#ifndef QT_NO_DEBUG_STREAM
-QWEBENGINEWIDGETS_EXPORT QDebug operator<<(QDebug, const QWebEngineScript &);
-#endif
-
-QT_END_NAMESPACE
-
-#endif // QWEBENGINESCRIPT_H
diff --git a/src/webenginewidgets/api/qwebenginescriptcollection.cpp b/src/webenginewidgets/api/qwebenginescriptcollection.cpp
deleted file mode 100644
index 8cbeeb804..000000000
--- a/src/webenginewidgets/api/qwebenginescriptcollection.cpp
+++ /dev/null
@@ -1,248 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qwebenginescriptcollection.h"
-#include "qwebenginescriptcollection_p.h"
-
-#include "renderer_host/user_resource_controller_host.h"
-
-using QtWebEngineCore::UserScript;
-
-/*!
- \class QWebEngineScriptCollection
- \inmodule QtWebEngineWidgets
- \since 5.5
- \brief The QWebEngineScriptCollection class represents a collection of user scripts.
-
- QWebEngineScriptCollection manages a set of user scripts.
-
- Use QWebEnginePage::scripts() and QWebEngineProfile::scripts() to access
- the collection of scripts associated with a single page or a
- number of pages sharing the same profile.
-
- \sa {Script Injection}
-*/
-
-/*!
- \fn QWebEngineScriptCollection::isEmpty() const
-
- Returns \c true if the collection is empty; otherwise returns \c false.
-*/
-
-/*!
- \fn QWebEngineScriptCollection::size() const
-
- Returns the number of elements in the collection.
-*/
-
-QWebEngineScriptCollection::QWebEngineScriptCollection(QWebEngineScriptCollectionPrivate *collectionPrivate)
- :d(collectionPrivate)
-{
-}
-
-/*!
- Destroys the collection.
-*/
-QWebEngineScriptCollection::~QWebEngineScriptCollection()
-{
-}
-
-/*!
- Returns the number of elements in the collection.
- */
-
-int QWebEngineScriptCollection::count() const
-{
- return d->count();
-}
-
-/*!
- Returns \c true if the collection contains an occurrence of \a value; otherwise returns
- \c false.
- */
-
-bool QWebEngineScriptCollection::contains(const QWebEngineScript &value) const
-{
- return d->contains(value);
-}
-
-/*!
- * Returns the first script found in the collection with the name \a name, or a null
- * QWebEngineScript if none was found.
- * \note The order in which the script collection is traversed is undefined, which means this should
- * be used when the unicity is guaranteed at the application level.
- * \sa findScripts()
- */
-
-QWebEngineScript QWebEngineScriptCollection::findScript(const QString &name) const
-{
- return d->find(name);
-}
-
-/*!
- Returns the list of scripts in the collection with the name \a name, or an empty list if none
- was found.
- */
-
-QList<QWebEngineScript> QWebEngineScriptCollection::findScripts(const QString &name) const
-{
- return d->toList(name);
-}
-/*!
- Inserts the script \a s into the collection.
- */
-void QWebEngineScriptCollection::insert(const QWebEngineScript &s)
-{
- d->insert(s);
-}
-/*!
- Inserts scripts from the list \a list into the collection.
- */
-void QWebEngineScriptCollection::insert(const QList<QWebEngineScript> &list)
-{
- d->reserve(list.size());
- for (const QWebEngineScript &s : list)
- d->insert(s);
-}
-
-/*!
- Removes \a script from the collection.
-
- Returns \c true if the script was found and successfully removed from the collection; otherwise
- returns \c false.
- */
-bool QWebEngineScriptCollection::remove(const QWebEngineScript &script)
-{
- return d->remove(script);
-}
-
-/*!
- * Removes all scripts from this collection.
- */
-void QWebEngineScriptCollection::clear()
-{
- d->clear();
-}
-
-/*!
- Returns a list with the values of the scripts used in this collection.
- */
-QList<QWebEngineScript> QWebEngineScriptCollection::toList() const
-{
- return d->toList();
-}
-
-
-QWebEngineScriptCollectionPrivate::QWebEngineScriptCollectionPrivate(QtWebEngineCore::UserResourceControllerHost *controller, QSharedPointer<QtWebEngineCore::WebContentsAdapter> webContents)
- : m_scriptController(controller)
- , m_contents(webContents)
-{
-}
-
-int QWebEngineScriptCollectionPrivate::count() const
-{
- return m_scripts.count();
-}
-
-bool QWebEngineScriptCollectionPrivate::contains(const QWebEngineScript &s) const
-{
- return m_scripts.contains(s);
-}
-
-void QWebEngineScriptCollectionPrivate::insert(const QWebEngineScript &script)
-{
- if (!script.d || script.d->isNull())
- return;
- m_scripts.append(script);
- if (!m_contents || m_contents->isInitialized())
- m_scriptController->addUserScript(*script.d, m_contents.data());
-}
-
-bool QWebEngineScriptCollectionPrivate::remove(const QWebEngineScript &script)
-{
- if (!script.d || script.d->isNull())
- return false;
- if (!m_contents || m_contents->isInitialized())
- m_scriptController->removeUserScript(*script.d, m_contents.data());
- return m_scripts.removeAll(script);
-}
-
-QList<QWebEngineScript> QWebEngineScriptCollectionPrivate::toList(const QString &scriptName) const
-{
- if (scriptName.isNull())
- return m_scripts;
-
- QList<QWebEngineScript> ret;
- for (const QWebEngineScript &script : qAsConst(m_scripts))
- if (scriptName == script.name())
- ret.append(script);
- return ret;
-}
-
-QWebEngineScript QWebEngineScriptCollectionPrivate::find(const QString &name) const
-{
- for (const QWebEngineScript &script : qAsConst(m_scripts))
- if (name == script.name())
- return script;
- return QWebEngineScript();
-}
-
-void QWebEngineScriptCollectionPrivate::clear()
-{
- m_scripts.clear();
- if (!m_contents || m_contents->isInitialized())
- m_scriptController->clearAllScripts(m_contents.data());
-}
-
-void QWebEngineScriptCollectionPrivate::reserve(int capacity)
-{
- m_scripts.reserve(capacity);
- if (!m_contents || m_contents->isInitialized())
- m_scriptController->reserve(m_contents.data(), capacity);
-}
-
-void QWebEngineScriptCollectionPrivate::initializationFinished(QSharedPointer<QtWebEngineCore::WebContentsAdapter> contents)
-{
- Q_ASSERT(m_contents);
- Q_ASSERT(contents);
-
- for (const QWebEngineScript &script : qAsConst(m_scripts))
- m_scriptController->addUserScript(*script.d, contents.data());
- m_contents = contents;
-}
diff --git a/src/webenginewidgets/api/qwebenginescriptcollection.h b/src/webenginewidgets/api/qwebenginescriptcollection.h
deleted file mode 100644
index e68dfce8f..000000000
--- a/src/webenginewidgets/api/qwebenginescriptcollection.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWEBENGINESCRIPTCOLLECTION_H
-#define QWEBENGINESCRIPTCOLLECTION_H
-
-#include <QtWebEngineWidgets/qtwebenginewidgetsglobal.h>
-#include <QtWebEngineWidgets/qwebenginescript.h>
-
-#include <QtCore/qscopedpointer.h>
-#include <QtCore/qlist.h>
-#include <QtCore/qset.h>
-
-QT_BEGIN_NAMESPACE
-class QWebEngineScriptCollectionPrivate;
-
-class QWEBENGINEWIDGETS_EXPORT QWebEngineScriptCollection {
-public:
- ~QWebEngineScriptCollection();
- bool isEmpty() const { return !count(); }
- int count() const;
- inline int size() const { return count(); }
- bool contains(const QWebEngineScript &value) const;
-
- QWebEngineScript findScript(const QString &name) const;
- QList<QWebEngineScript> findScripts(const QString &name) const;
-
- void insert(const QWebEngineScript &);
- void insert(const QList<QWebEngineScript> &list);
-
- bool remove(const QWebEngineScript &);
- void clear();
-
- QList<QWebEngineScript> toList() const;
-
-private:
- Q_DISABLE_COPY(QWebEngineScriptCollection)
- friend class QWebEnginePagePrivate;
- friend class QWebEngineProfilePrivate;
- QWebEngineScriptCollection(QWebEngineScriptCollectionPrivate *);
-
- QScopedPointer<QWebEngineScriptCollectionPrivate> d;
-};
-
-QT_END_NAMESPACE
-#endif // QWEBENGINESCRIPTCOLLECTION_H
diff --git a/src/webenginewidgets/api/qwebenginescriptcollection_p.h b/src/webenginewidgets/api/qwebenginescriptcollection_p.h
deleted file mode 100644
index 322ade3b6..000000000
--- a/src/webenginewidgets/api/qwebenginescriptcollection_p.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWEBENGINESCRIPTCOLLECTION_P_H
-#define QWEBENGINESCRIPTCOLLECTION_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "qtwebenginewidgetsglobal.h"
-
-#include "qwebenginescript.h"
-#include "web_contents_adapter.h"
-
-#include <QtCore/QSet>
-#include <QtCore/QSharedPointer>
-
-namespace QtWebEngineCore {
-class UserResourceControllerHost;
-} // namespace
-
-QT_BEGIN_NAMESPACE
-class QWebEngineScriptCollectionPrivate {
-public:
- QWebEngineScriptCollectionPrivate(QtWebEngineCore::UserResourceControllerHost *, QSharedPointer<QtWebEngineCore::WebContentsAdapter> = QSharedPointer<QtWebEngineCore::WebContentsAdapter>());
-
- int count() const;
- bool contains(const QWebEngineScript &) const;
- QList<QWebEngineScript> toList(const QString &scriptName = QString()) const;
- QWebEngineScript find(const QString & name) const;
-
- void initializationFinished(QSharedPointer<QtWebEngineCore::WebContentsAdapter> contents);
-
- void insert(const QWebEngineScript &);
- bool remove(const QWebEngineScript &);
- void clear();
- void reserve(int);
-
-private:
- QtWebEngineCore::UserResourceControllerHost *m_scriptController;
- QSharedPointer<QtWebEngineCore::WebContentsAdapter> m_contents;
- QList<QWebEngineScript> m_scripts;
-};
-
-QT_END_NAMESPACE
-
-#endif // QWEBENGINESCRIPTCOLLECTION__PH
diff --git a/src/webenginewidgets/api/qwebenginesettings.cpp b/src/webenginewidgets/api/qwebenginesettings.cpp
deleted file mode 100644
index d9fb3b000..000000000
--- a/src/webenginewidgets/api/qwebenginesettings.cpp
+++ /dev/null
@@ -1,254 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qwebenginesettings.h"
-
-#include "qwebengineprofile.h"
-#include "web_engine_settings.h"
-
-QT_BEGIN_NAMESPACE
-
-using QtWebEngineCore::WebEngineSettings;
-
-static WebEngineSettings::Attribute toWebEngineAttribute(QWebEngineSettings::WebAttribute attribute)
-{
- switch (attribute) {
- case QWebEngineSettings::AutoLoadImages:
- return WebEngineSettings::AutoLoadImages;
- case QWebEngineSettings::JavascriptEnabled:
- return WebEngineSettings::JavascriptEnabled;
- case QWebEngineSettings::JavascriptCanOpenWindows:
- return WebEngineSettings::JavascriptCanOpenWindows;
- case QWebEngineSettings::JavascriptCanAccessClipboard:
- return WebEngineSettings::JavascriptCanAccessClipboard;
- case QWebEngineSettings::LinksIncludedInFocusChain:
- return WebEngineSettings::LinksIncludedInFocusChain;
- case QWebEngineSettings::LocalStorageEnabled:
- return WebEngineSettings::LocalStorageEnabled;
- case QWebEngineSettings::LocalContentCanAccessRemoteUrls:
- return WebEngineSettings::LocalContentCanAccessRemoteUrls;
- case QWebEngineSettings::XSSAuditingEnabled:
- return WebEngineSettings::XSSAuditingEnabled;
- case QWebEngineSettings::SpatialNavigationEnabled:
- return WebEngineSettings::SpatialNavigationEnabled;
- case QWebEngineSettings::LocalContentCanAccessFileUrls:
- return WebEngineSettings::LocalContentCanAccessFileUrls;
- case QWebEngineSettings::HyperlinkAuditingEnabled:
- return WebEngineSettings::HyperlinkAuditingEnabled;
- case QWebEngineSettings::ScrollAnimatorEnabled:
- return WebEngineSettings::ScrollAnimatorEnabled;
- case QWebEngineSettings::ErrorPageEnabled:
- return WebEngineSettings::ErrorPageEnabled;
- case QWebEngineSettings::PluginsEnabled:
- return WebEngineSettings::PluginsEnabled;
- case QWebEngineSettings::FullScreenSupportEnabled:
- return WebEngineSettings::FullScreenSupportEnabled;
- case QWebEngineSettings::ScreenCaptureEnabled:
- return WebEngineSettings::ScreenCaptureEnabled;
- case QWebEngineSettings::WebGLEnabled:
- return WebEngineSettings::WebGLEnabled;
- case QWebEngineSettings::Accelerated2dCanvasEnabled:
- return WebEngineSettings::Accelerated2dCanvasEnabled;
- case QWebEngineSettings::AutoLoadIconsForPage:
- return WebEngineSettings::AutoLoadIconsForPage;
- case QWebEngineSettings::TouchIconsEnabled:
- return WebEngineSettings::TouchIconsEnabled;
- case QWebEngineSettings::FocusOnNavigationEnabled:
- return WebEngineSettings::FocusOnNavigationEnabled;
- case QWebEngineSettings::PrintElementBackgrounds:
- return WebEngineSettings::PrintElementBackgrounds;
- case QWebEngineSettings::AllowRunningInsecureContent:
- return WebEngineSettings::AllowRunningInsecureContent;
- case QWebEngineSettings::AllowGeolocationOnInsecureOrigins:
- return WebEngineSettings::AllowGeolocationOnInsecureOrigins;
- case QWebEngineSettings::AllowWindowActivationFromJavaScript:
- return WebEngineSettings::AllowWindowActivationFromJavaScript;
- case QWebEngineSettings::ShowScrollBars:
- return WebEngineSettings::ShowScrollBars;
- case QWebEngineSettings::PlaybackRequiresUserGesture:
- return WebEngineSettings::PlaybackRequiresUserGesture;
- case QWebEngineSettings::WebRTCPublicInterfacesOnly:
- return WebEngineSettings::WebRTCPublicInterfacesOnly;
- case QWebEngineSettings::JavascriptCanPaste:
- return WebEngineSettings::JavascriptCanPaste;
- case QWebEngineSettings::DnsPrefetchEnabled:
- return WebEngineSettings::DnsPrefetchEnabled;
- case QWebEngineSettings::PdfViewerEnabled:
- return WebEngineSettings::PdfViewerEnabled;
- default:
- return WebEngineSettings::UnsupportedInCoreSettings;
- }
-}
-
-QWebEngineSettings::QWebEngineSettings(QWebEngineSettings *parentSettings)
- : d_ptr(new WebEngineSettings(parentSettings ? parentSettings->d_func() : 0))
-{
- Q_D(QWebEngineSettings);
- d->scheduleApplyRecursively();
-}
-
-QWebEngineSettings::~QWebEngineSettings()
-{
-}
-
-#if QT_DEPRECATED_SINCE(5, 5)
-QWebEngineSettings *QWebEngineSettings::globalSettings()
-{
- return defaultSettings();
-}
-#endif
-
-/*!
- Returns the settings for a web engine page that belongs to the default
- profile. All web pages not specifically created with another profile belong
- to the default profile.
-*/
-QWebEngineSettings *QWebEngineSettings::defaultSettings()
-{
- return QWebEngineProfile::defaultProfile()->settings();
-}
-
-ASSERT_ENUMS_MATCH(WebEngineSettings::StandardFont, QWebEngineSettings::StandardFont)
-ASSERT_ENUMS_MATCH(WebEngineSettings::FixedFont, QWebEngineSettings::FixedFont)
-ASSERT_ENUMS_MATCH(WebEngineSettings::SerifFont, QWebEngineSettings::SerifFont)
-ASSERT_ENUMS_MATCH(WebEngineSettings::SansSerifFont, QWebEngineSettings::SansSerifFont)
-ASSERT_ENUMS_MATCH(WebEngineSettings::CursiveFont, QWebEngineSettings::CursiveFont)
-ASSERT_ENUMS_MATCH(WebEngineSettings::FantasyFont, QWebEngineSettings::FantasyFont)
-ASSERT_ENUMS_MATCH(WebEngineSettings::PictographFont, QWebEngineSettings::PictographFont)
-
-void QWebEngineSettings::setFontFamily(QWebEngineSettings::FontFamily which, const QString &family)
-{
- Q_D(QWebEngineSettings);
- d->setFontFamily(static_cast<WebEngineSettings::FontFamily>(which), family);
-}
-
-QString QWebEngineSettings::fontFamily(QWebEngineSettings::FontFamily which) const
-{
- return d_ptr->fontFamily(static_cast<WebEngineSettings::FontFamily>(which));
-}
-
-void QWebEngineSettings::resetFontFamily(QWebEngineSettings::FontFamily which)
-{
- d_ptr->resetFontFamily(static_cast<WebEngineSettings::FontFamily>(which));
-}
-
-ASSERT_ENUMS_MATCH(WebEngineSettings::DefaultFixedFontSize, QWebEngineSettings::DefaultFixedFontSize)
-ASSERT_ENUMS_MATCH(WebEngineSettings::DefaultFontSize, QWebEngineSettings::DefaultFontSize)
-ASSERT_ENUMS_MATCH(WebEngineSettings::MinimumFontSize, QWebEngineSettings::MinimumFontSize)
-ASSERT_ENUMS_MATCH(WebEngineSettings::MinimumLogicalFontSize, QWebEngineSettings::MinimumLogicalFontSize)
-
-void QWebEngineSettings::setFontSize(QWebEngineSettings::FontSize type, int size)
-{
- Q_D(QWebEngineSettings);
- d->setFontSize(static_cast<WebEngineSettings::FontSize>(type), size);
-}
-
-int QWebEngineSettings::fontSize(QWebEngineSettings::FontSize type) const
-{
- Q_D(const QWebEngineSettings);
- return d->fontSize(static_cast<WebEngineSettings::FontSize>(type));
-}
-
-void QWebEngineSettings::resetFontSize(QWebEngineSettings::FontSize type)
-{
- Q_D(QWebEngineSettings);
- d->resetFontSize(static_cast<WebEngineSettings::FontSize>(type));
-}
-
-void QWebEngineSettings::setDefaultTextEncoding(const QString &encoding)
-{
- Q_D(QWebEngineSettings);
- d->setDefaultTextEncoding(encoding);
-}
-
-QString QWebEngineSettings::defaultTextEncoding() const
-{
- Q_D(const QWebEngineSettings);
- return d->defaultTextEncoding();
-}
-
-ASSERT_ENUMS_MATCH(WebEngineSettings::DisallowUnknownUrlSchemes, QWebEngineSettings::DisallowUnknownUrlSchemes)
-ASSERT_ENUMS_MATCH(WebEngineSettings::AllowUnknownUrlSchemesFromUserInteraction, QWebEngineSettings::AllowUnknownUrlSchemesFromUserInteraction)
-ASSERT_ENUMS_MATCH(WebEngineSettings::AllowAllUnknownUrlSchemes, QWebEngineSettings::AllowAllUnknownUrlSchemes)
-
-QWebEngineSettings::UnknownUrlSchemePolicy QWebEngineSettings::unknownUrlSchemePolicy() const
-{
- Q_D(const QWebEngineSettings);
- WebEngineSettings::UnknownUrlSchemePolicy result = d->unknownUrlSchemePolicy();
- Q_ASSERT(result != WebEngineSettings::InheritedUnknownUrlSchemePolicy);
- return static_cast<QWebEngineSettings::UnknownUrlSchemePolicy>(result);
-}
-
-void QWebEngineSettings::setUnknownUrlSchemePolicy(QWebEngineSettings::UnknownUrlSchemePolicy policy)
-{
- Q_D(QWebEngineSettings);
- d->setUnknownUrlSchemePolicy(static_cast<WebEngineSettings::UnknownUrlSchemePolicy>(policy));
-}
-
-void QWebEngineSettings::resetUnknownUrlSchemePolicy()
-{
- Q_D(QWebEngineSettings);
- d->setUnknownUrlSchemePolicy(WebEngineSettings::InheritedUnknownUrlSchemePolicy);
-}
-
-void QWebEngineSettings::setAttribute(QWebEngineSettings::WebAttribute attr, bool on)
-{
- Q_D(QWebEngineSettings);
- WebEngineSettings::Attribute webEngineAttribute = toWebEngineAttribute(attr);
- Q_ASSERT(webEngineAttribute != WebEngineSettings::UnsupportedInCoreSettings);
- d->setAttribute(webEngineAttribute, on);
-}
-
-bool QWebEngineSettings::testAttribute(QWebEngineSettings::WebAttribute attr) const
-{
- Q_D(const QWebEngineSettings);
- WebEngineSettings::Attribute webEngineAttribute = toWebEngineAttribute(attr);
- Q_ASSERT(webEngineAttribute != WebEngineSettings::UnsupportedInCoreSettings);
- return d->testAttribute(webEngineAttribute);
-}
-
-void QWebEngineSettings::resetAttribute(QWebEngineSettings::WebAttribute attr)
-{
- Q_D(QWebEngineSettings);
- WebEngineSettings::Attribute webEngineAttribute = toWebEngineAttribute(attr);
- Q_ASSERT(webEngineAttribute != WebEngineSettings::UnsupportedInCoreSettings);
- d->resetAttribute(webEngineAttribute);
-}
-
-QT_END_NAMESPACE
diff --git a/src/webenginewidgets/api/qwebenginesettings.h b/src/webenginewidgets/api/qwebenginesettings.h
deleted file mode 100644
index d39291fed..000000000
--- a/src/webenginewidgets/api/qwebenginesettings.h
+++ /dev/null
@@ -1,154 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWEBENGINESETTINGS_H
-#define QWEBENGINESETTINGS_H
-
-#include <QtWebEngineWidgets/qtwebenginewidgetsglobal.h>
-#include <QtCore/qscopedpointer.h>
-#include <QtCore/qstring.h>
-
-namespace QtWebEngineCore {
-class WebEngineSettings;
-}
-
-QT_BEGIN_NAMESPACE
-
-class QIcon;
-class QPixmap;
-class QUrl;
-
-class QWEBENGINEWIDGETS_EXPORT QWebEngineSettings {
-public:
- enum FontFamily {
- StandardFont,
- FixedFont,
- SerifFont,
- SansSerifFont,
- CursiveFont,
- FantasyFont,
- PictographFont
- };
- enum WebAttribute {
- AutoLoadImages,
- JavascriptEnabled,
- JavascriptCanOpenWindows,
- JavascriptCanAccessClipboard,
- LinksIncludedInFocusChain,
- LocalStorageEnabled,
- LocalContentCanAccessRemoteUrls,
- XSSAuditingEnabled,
- SpatialNavigationEnabled,
- LocalContentCanAccessFileUrls,
- HyperlinkAuditingEnabled,
- ScrollAnimatorEnabled,
- ErrorPageEnabled,
- PluginsEnabled,
- FullScreenSupportEnabled,
- ScreenCaptureEnabled,
- WebGLEnabled,
- Accelerated2dCanvasEnabled,
- AutoLoadIconsForPage,
- TouchIconsEnabled,
- FocusOnNavigationEnabled,
- PrintElementBackgrounds,
- AllowRunningInsecureContent,
- AllowGeolocationOnInsecureOrigins,
- AllowWindowActivationFromJavaScript,
- ShowScrollBars,
- PlaybackRequiresUserGesture,
- WebRTCPublicInterfacesOnly,
- JavascriptCanPaste,
- DnsPrefetchEnabled,
- PdfViewerEnabled,
- };
-
- enum FontSize {
- MinimumFontSize,
- MinimumLogicalFontSize,
- DefaultFontSize,
- DefaultFixedFontSize
- };
-
- enum UnknownUrlSchemePolicy {
- DisallowUnknownUrlSchemes = 1,
- AllowUnknownUrlSchemesFromUserInteraction,
- AllowAllUnknownUrlSchemes
- };
-
-#if QT_DEPRECATED_SINCE(5, 5)
- static QWebEngineSettings *globalSettings();
-#endif
- static QWebEngineSettings *defaultSettings();
-
- void setFontFamily(FontFamily which, const QString &family);
- QString fontFamily(FontFamily which) const;
- void resetFontFamily(FontFamily which);
-
- void setFontSize(FontSize type, int size);
- int fontSize(FontSize type) const;
- void resetFontSize(FontSize type);
-
- void setAttribute(WebAttribute attr, bool on);
- bool testAttribute(WebAttribute attr) const;
- void resetAttribute(WebAttribute attr);
-
- void setDefaultTextEncoding(const QString &encoding);
- QString defaultTextEncoding() const;
-
- UnknownUrlSchemePolicy unknownUrlSchemePolicy() const;
- void setUnknownUrlSchemePolicy(UnknownUrlSchemePolicy policy);
- void resetUnknownUrlSchemePolicy();
-
-private:
- Q_DISABLE_COPY(QWebEngineSettings)
- typedef ::QtWebEngineCore::WebEngineSettings QWebEngineSettingsPrivate;
- QWebEngineSettingsPrivate* d_func() { return d_ptr.data(); }
- const QWebEngineSettingsPrivate* d_func() const { return d_ptr.data(); }
- QScopedPointer<QWebEngineSettingsPrivate> d_ptr;
- friend class QWebEnginePagePrivate;
- friend class QWebEngineProfilePrivate;
-
- ~QWebEngineSettings();
- explicit QWebEngineSettings(QWebEngineSettings *parentSettings = Q_NULLPTR);
-};
-
-QT_END_NAMESPACE
-
-#endif // QWEBENGINESETTINGS_H
diff --git a/src/webenginewidgets/api/qwebengineview.cpp b/src/webenginewidgets/api/qwebengineview.cpp
index b06d99478..e28f70b5f 100644
--- a/src/webenginewidgets/api/qwebengineview.cpp
+++ b/src/webenginewidgets/api/qwebengineview.cpp
@@ -1,58 +1,372 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+#include "qapplication.h"
+#include "qwebenginenotificationpresenter_p.h"
#include "qwebengineview.h"
#include "qwebengineview_p.h"
-
-#include "qwebenginepage_p.h"
-#include "render_widget_host_view_qt_delegate_widget.h"
+#include "render_widget_host_view_qt_delegate_client.h"
+#include "render_widget_host_view_qt_delegate_item.h"
+#include "ui/autofillpopupwidget_p.h"
+#include "touchhandlewidget_p.h"
+#include "touchselectionmenuwidget_p.h"
+
+#include <QtWebEngineCore/private/qwebenginepage_p.h>
+#include <QtWebEngineCore/qwebenginecontextmenurequest.h>
+#include <QtWebEngineCore/qwebenginehistory.h>
+#include <QtWebEngineCore/qwebenginehttprequest.h>
+#include <QtWebEngineCore/qwebengineprofile.h>
+
+#include "autofill_popup_controller.h"
+#include "color_chooser_controller.h"
+#include "touch_selection_menu_controller.h"
#include "web_contents_adapter.h"
+#include <QContextMenuEvent>
+#include <QToolTip>
+#include <QVBoxLayout>
+#include <QKeyEvent>
+#include <QIcon>
+#include <QStyle>
+#include <QGuiApplication>
+#include <QQuickWidget>
+
+#if QT_CONFIG(accessibility)
+#include "qwebengine_accessible.h"
+#endif
+
#if QT_CONFIG(action)
#include <QAction>
#endif
+
+#if QT_CONFIG(colordialog)
+#include <QColorDialog>
+#endif
+
+#if QT_CONFIG(filedialog)
+#include <QFileDialog>
+#include <QStandardPaths>
+#include "file_picker_controller.h"
+#endif
+
+#if QT_CONFIG(inputdialog)
+#include <QInputDialog>
+#endif
+
#if QT_CONFIG(menu)
#include <QMenu>
#endif
-#include <QContextMenuEvent>
-#include <QToolTip>
-#include <QVBoxLayout>
+
+#if QT_CONFIG(messagebox)
+#include <QMessageBox>
+#endif
+
+#if QT_CONFIG(webengine_printing_and_pdf)
+#include "printing/printer_worker.h"
+
+#include <QPrintEngine>
+#include <QPrinter>
+#include <QThread>
+#endif
+
+QT_BEGIN_NAMESPACE
+class QSpontaneKeyEvent
+{
+public:
+ static inline void makeSpontaneous(QEvent *ev) { ev->setSpontaneous(); }
+};
+QT_END_NAMESPACE
+
+namespace QtWebEngineCore {
+class WebEngineQuickWidget : public QQuickWidget, public WidgetDelegate
+{
+public:
+ WebEngineQuickWidget(RenderWidgetHostViewQtDelegateItem *widget, QWidget *parent)
+ : QQuickWidget(parent)
+ , m_contentItem(widget)
+ {
+ setFocusPolicy(Qt::StrongFocus);
+ setMouseTracking(true);
+ setAttribute(Qt::WA_AcceptTouchEvents);
+ setAttribute(Qt::WA_OpaquePaintEvent);
+ setAttribute(Qt::WA_AlwaysShowToolTips);
+
+ QQuickItem *root = new QQuickItem(); // Indirection so we don't delete m_contentItem
+ setContent(QUrl(), nullptr, root);
+ root->setFlags(QQuickItem::ItemHasContents);
+ root->setVisible(true);
+ m_contentItem->setParentItem(root);
+
+ connectRemoveParentBeforeParentDelete();
+ }
+ ~WebEngineQuickWidget() override
+ {
+ if (m_contentItem) {
+ m_contentItem->setWidgetDelegate(nullptr);
+ m_contentItem->setParentItem(nullptr);
+ }
+ }
+
+ void InitAsPopup(const QRect &screenRect) override
+ {
+ setAttribute(Qt::WA_ShowWithoutActivating);
+ setFocusPolicy(Qt::NoFocus);
+ setWindowFlags(Qt::Popup | Qt::FramelessWindowHint | Qt::WindowDoesNotAcceptFocus);
+
+ setGeometry(screenRect);
+ raise();
+ m_contentItem->show();
+ show();
+ }
+
+ void Bind(WebContentsAdapterClient *client) override
+ {
+ QWebEnginePagePrivate *page = static_cast<QWebEnginePagePrivate *>(client);
+ if (m_pageDestroyedConnection)
+ QObject::disconnect(m_pageDestroyedConnection);
+ QWebEngineViewPrivate::bindPageAndWidget(page, this);
+ m_pageDestroyedConnection = QObject::connect(page->q_ptr, &QObject::destroyed, this, &WebEngineQuickWidget::Unbind);
+ }
+
+ void Unbind() override
+ {
+ if (m_pageDestroyedConnection) {
+ QObject::disconnect(m_pageDestroyedConnection);
+ m_pageDestroyedConnection = {};
+ }
+ QWebEngineViewPrivate::bindPageAndWidget(nullptr, this);
+ }
+
+ void Destroy() override
+ {
+ deleteLater();
+ }
+
+ bool ActiveFocusOnPress() override
+ {
+ return true;
+ }
+
+ void SetInputMethodEnabled(bool enabled) override
+ {
+ QQuickWidget::setAttribute(Qt::WA_InputMethodEnabled, enabled);
+ }
+ void SetInputMethodHints(Qt::InputMethodHints hints) override
+ {
+ QQuickWidget::setInputMethodHints(hints);
+ }
+ void SetClearColor(const QColor &color) override
+ {
+ setUpdatesEnabled(false);
+ QQuickWidget::setClearColor(color);
+ // QQuickWidget is usually blended by punching holes into widgets
+ // above it to simulate the visual stacking order. If we want it to be
+ // transparent we have to throw away the proper stacking order and always
+ // blend the complete normal widgets backing store under it.
+ bool isTranslucent = color.alpha() < 255;
+ setAttribute(Qt::WA_AlwaysStackOnTop, isTranslucent);
+ setAttribute(Qt::WA_OpaquePaintEvent, !isTranslucent);
+ setUpdatesEnabled(true);
+ window()->update();
+ }
+ void MoveWindow(const QPoint &screenPos) override
+ {
+ QQuickWidget::move(screenPos);
+ }
+ void Resize(int width, int height) override
+ {
+ QQuickWidget::resize(width, height);
+ }
+ QWindow *Window() override
+ {
+ if (const QWidget *root = QQuickWidget::window())
+ return root->windowHandle();
+ return nullptr;
+ }
+ void unhandledWheelEvent(QWheelEvent *ev) override
+ {
+ auto parentWidget = QQuickWidget::parentWidget();
+ if (parentWidget) {
+ QSpontaneKeyEvent::makeSpontaneous(ev);
+ qApp->notify(parentWidget, ev);
+ }
+ }
+
+protected:
+ void closeEvent(QCloseEvent *event) override
+ {
+ QQuickWidget::closeEvent(event);
+
+ // If a close event was received from the window manager (e.g. when moving the parent window,
+ // clicking outside the popup area)
+ // make sure to notify the Chromium WebUI popup and its underlying
+ // RenderWidgetHostViewQtDelegate instance to be closed.
+ if (m_contentItem && m_contentItem->m_isPopup)
+ m_contentItem->m_client->closePopup();
+ }
+ void showEvent(QShowEvent *event) override
+ {
+ QQuickWidget::showEvent(event);
+ // We don't have a way to catch a top-level window change with QWidget
+ // but a widget will most likely be shown again if it changes, so do
+ // the reconnection at this point.
+ for (const QMetaObject::Connection &c : std::as_const(m_windowConnections))
+ disconnect(c);
+ m_windowConnections.clear();
+ if (QWindow *w = Window()) {
+ m_windowConnections.append(connect(w, SIGNAL(xChanged(int)), m_contentItem, SLOT(onWindowPosChanged())));
+ m_windowConnections.append(connect(w, SIGNAL(yChanged(int)), m_contentItem, SLOT(onWindowPosChanged())));
+ }
+ }
+ void resizeEvent(QResizeEvent *event) override
+ {
+ QQuickWidget::resizeEvent(event);
+ if (m_contentItem) { // FIXME: Not sure why we need to set m_contentItem size manually
+ m_contentItem->setSize(event->size());
+ m_contentItem->onWindowPosChanged();
+ }
+ }
+ QVariant inputMethodQuery(Qt::InputMethodQuery query) const override
+ {
+ if (m_contentItem)
+ return m_contentItem->inputMethodQuery(query);
+ return QVariant();
+ }
+ bool event(QEvent *event) override;
+
+ void connectRemoveParentBeforeParentDelete();
+ void removeParentBeforeParentDelete();
+
+private:
+ friend QWebEngineViewPrivate;
+ QPointer<RenderWidgetHostViewQtDelegateItem> m_contentItem; // deleted by core
+ QMetaObject::Connection m_parentDestroyedConnection;
+ QMetaObject::Connection m_pageDestroyedConnection;
+ QList<QMetaObject::Connection> m_windowConnections;
+};
+
+void WebEngineQuickWidget::connectRemoveParentBeforeParentDelete()
+{
+ disconnect(m_parentDestroyedConnection);
+
+ if (QWidget *parent = parentWidget()) {
+ m_parentDestroyedConnection = connect(parent, &QObject::destroyed,
+ this,
+ &WebEngineQuickWidget::removeParentBeforeParentDelete);
+ } else {
+ m_parentDestroyedConnection = QMetaObject::Connection();
+ }
+}
+
+void WebEngineQuickWidget::removeParentBeforeParentDelete()
+{
+ // Unset the parent, because parent is being destroyed, but the owner of this
+ // WebEngineQuickWidget is actually a RenderWidgetHostViewQt instance.
+ setParent(nullptr);
+
+ // If this widget represents a popup window, make sure to close it, so that if the popup was the
+ // last visible top level window, the application event loop can quit if it deems it necessarry.
+ if (m_contentItem && m_contentItem->m_isPopup)
+ close();
+}
+
+bool WebEngineQuickWidget::event(QEvent *event)
+{
+ bool handled = false;
+
+ // Track parent to make sure we don't get deleted.
+ if (event->type() == QEvent::ParentChange)
+ connectRemoveParentBeforeParentDelete();
+
+ if (!m_contentItem)
+ return QQuickWidget::event(event);
+
+ // Mimic QWidget::event() by ignoring mouse, keyboard, touch and tablet events if the widget is
+ // disabled.
+ if (!isEnabled()) {
+ switch (event->type()) {
+ case QEvent::TabletPress:
+ case QEvent::TabletRelease:
+ case QEvent::TabletMove:
+ case QEvent::MouseButtonPress:
+ case QEvent::MouseButtonRelease:
+ case QEvent::MouseButtonDblClick:
+ case QEvent::MouseMove:
+ case QEvent::TouchBegin:
+ case QEvent::TouchUpdate:
+ case QEvent::TouchEnd:
+ case QEvent::TouchCancel:
+ case QEvent::ContextMenu:
+ case QEvent::KeyPress:
+ case QEvent::KeyRelease:
+#if QT_CONFIG(wheelevent)
+ case QEvent::Wheel:
+#endif
+ return false;
+ default:
+ break;
+ }
+ }
+
+ switch (event->type()) {
+ case QEvent::FocusIn:
+ case QEvent::FocusOut:
+ // We forward focus events later, once they have made it to the content item.
+ return QQuickWidget::event(event);
+ case QEvent::DragEnter:
+ case QEvent::DragLeave:
+ case QEvent::DragMove:
+ case QEvent::Drop:
+ case QEvent::HoverEnter:
+ case QEvent::HoverLeave:
+ case QEvent::HoverMove:
+ // Let the parent handle these events.
+ return false;
+ default:
+ break;
+ }
+
+ switch (event->type()) {
+ case QEvent::MouseButtonPress:
+ case QEvent::MouseButtonRelease:
+ case QEvent::MouseButtonDblClick:
+ case QEvent::MouseMove:
+ // Don't forward mouse events synthesized by the system, which are caused by genuine touch
+ // events. Chromium would then process for e.g. a mouse click handler twice, once due to the
+ // system synthesized mouse event, and another time due to a touch-to-gesture-to-mouse
+ // transformation done by Chromium.
+ // Only allow them for popup type, since QWidgetWindow will ignore them for Qt::Popup flag,
+ // which is expected to get input through synthesized mouse events (either by system or Qt)
+ if (!m_contentItem->m_isPopup &&
+ static_cast<QMouseEvent *>(event)->source() == Qt::MouseEventSynthesizedBySystem) {
+ Q_ASSERT(!windowFlags().testFlag(Qt::Popup));
+ return true;
+ }
+ break;
+ default:
+ break;
+ }
+
+ if (event->type() == QEvent::MouseButtonDblClick) {
+ // QWidget keeps the Qt4 behavior where the DblClick event would replace the Press event.
+ // QtQuick is different by sending both the Press and DblClick events for the second press
+ // where we can simply ignore the DblClick event.
+ QMouseEvent *dblClick = static_cast<QMouseEvent *>(event);
+ QMouseEvent press(QEvent::MouseButtonPress, dblClick->position(), dblClick->scenePosition(),
+ dblClick->globalPosition(), dblClick->button(), dblClick->buttons(),
+ dblClick->modifiers(), dblClick->source());
+ press.setTimestamp(dblClick->timestamp());
+ handled = m_contentItem->m_client->forwardEvent(&press);
+ } else
+ handled = m_contentItem->m_client->forwardEvent(event);
+
+ if (!handled)
+ return QQuickWidget::event(event);
+ event->accept();
+ return true;
+}
+
+} // namespace QtWebEngineCore
QT_BEGIN_NAMESPACE
@@ -62,7 +376,15 @@ void QWebEngineViewPrivate::pageChanged(QWebEnginePage *oldPage, QWebEnginePage
if (oldPage) {
oldPage->setVisible(false);
- oldPage->disconnect(q);
+ QObject::disconnect(oldPage, &QWebEnginePage::titleChanged, q, &QWebEngineView::titleChanged);
+ QObject::disconnect(oldPage, &QWebEnginePage::urlChanged, q, &QWebEngineView::urlChanged);
+ QObject::disconnect(oldPage, &QWebEnginePage::iconUrlChanged, q, &QWebEngineView::iconUrlChanged);
+ QObject::disconnect(oldPage, &QWebEnginePage::iconChanged, q, &QWebEngineView::iconChanged);
+ QObject::disconnect(oldPage, &QWebEnginePage::loadStarted, q, &QWebEngineView::loadStarted);
+ QObject::disconnect(oldPage, &QWebEnginePage::loadProgress, q, &QWebEngineView::loadProgress);
+ QObject::disconnect(oldPage, &QWebEnginePage::loadFinished, q, &QWebEngineView::loadFinished);
+ QObject::disconnect(oldPage, &QWebEnginePage::selectionChanged, q, &QWebEngineView::selectionChanged);
+ QObject::disconnect(oldPage, &QWebEnginePage::renderProcessTerminated, q, &QWebEngineView::renderProcessTerminated);
}
if (newPage) {
@@ -99,8 +421,8 @@ void QWebEngineViewPrivate::pageChanged(QWebEnginePage *oldPage, QWebEnginePage
Q_EMIT q->selectionChanged();
}
-void QWebEngineViewPrivate::widgetChanged(QtWebEngineCore::RenderWidgetHostViewQtDelegateWidget *oldWidget,
- QtWebEngineCore::RenderWidgetHostViewQtDelegateWidget *newWidget)
+void QWebEngineViewPrivate::widgetChanged(QtWebEngineCore::WebEngineQuickWidget *oldWidget,
+ QtWebEngineCore::WebEngineQuickWidget *newWidget)
{
Q_Q(QWebEngineView);
@@ -108,40 +430,521 @@ void QWebEngineViewPrivate::widgetChanged(QtWebEngineCore::RenderWidgetHostViewQ
q->layout()->removeWidget(oldWidget);
oldWidget->hide();
#if QT_CONFIG(accessibility)
- QAccessible::deleteAccessibleInterface(QAccessible::uniqueId(QAccessible::queryAccessibleInterface(oldWidget)));
+ if (!QtWebEngineCore::closingDown())
+ QAccessible::deleteAccessibleInterface(
+ QAccessible::uniqueId(QAccessible::queryAccessibleInterface(oldWidget)));
#endif
}
if (newWidget) {
+ Q_ASSERT(!QtWebEngineCore::closingDown());
#if QT_CONFIG(accessibility)
- // An earlier QAccessible::queryAccessibleInterface() call may have already registered a default
- // QAccessibleInterface for newWidget: remove it first to avoid assert in QAccessibleCache::insert().
QAccessible::deleteAccessibleInterface(QAccessible::uniqueId(QAccessible::queryAccessibleInterface(newWidget)));
QAccessible::registerAccessibleInterface(new QtWebEngineCore::RenderWidgetHostViewQtDelegateWidgetAccessible(newWidget, q));
#endif
q->layout()->addWidget(newWidget);
q->setFocusProxy(newWidget);
+ if (oldWidget && oldWidget == QApplication::focusWidget())
+ newWidget->setFocus();
newWidget->show();
}
}
-#ifndef QT_NO_ACCESSIBILITY
+void QWebEngineViewPrivate::contextMenuRequested(QWebEngineContextMenuRequest *request)
+{
+#if QT_CONFIG(action)
+ m_contextRequest = request;
+ switch (q_ptr->contextMenuPolicy()) {
+ case Qt::DefaultContextMenu: {
+ QContextMenuEvent event(QContextMenuEvent::Mouse, request->position(),
+ q_ptr->mapToGlobal(request->position()));
+ q_ptr->contextMenuEvent(&event);
+ return;
+ }
+ case Qt::CustomContextMenu:
+ Q_EMIT q_ptr->customContextMenuRequested(request->position());
+ return;
+ case Qt::ActionsContextMenu:
+ if (q_ptr->actions().size()) {
+ QContextMenuEvent event(QContextMenuEvent::Mouse, request->position(),
+ q_ptr->mapToGlobal(request->position()));
+ QMenu::exec(q_ptr->actions(), event.globalPos(), 0, q_ptr);
+ }
+ return;
+ case Qt::PreventContextMenu:
+ case Qt::NoContextMenu:
+ return;
+ }
+
+ Q_UNREACHABLE();
+#else
+ Q_UNUSED(request);
+#endif // QT_CONFIG(action)
+}
+
+QStringList QWebEngineViewPrivate::chooseFiles(QWebEnginePage::FileSelectionMode mode,
+ const QStringList &oldFiles,
+ const QStringList &acceptedMimeTypes)
+{
+#if QT_CONFIG(filedialog)
+ Q_Q(QWebEngineView);
+ const QStringList &filter =
+ QtWebEngineCore::FilePickerController::nameFilters(acceptedMimeTypes);
+ QStringList ret;
+ QString str;
+ switch (static_cast<QtWebEngineCore::FilePickerController::FileChooserMode>(mode)) {
+ case QtWebEngineCore::FilePickerController::OpenMultiple:
+ ret = QFileDialog::getOpenFileNames(q, QString(), QString(),
+ filter.join(QStringLiteral(";;")), nullptr,
+ QFileDialog::HideNameFilterDetails);
+ break;
+ case QtWebEngineCore::FilePickerController::UploadFolder:
+ str = QFileDialog::getExistingDirectory(q, QWebEngineView::tr("Select folder to upload"));
+ if (!str.isNull())
+ ret << str;
+ break;
+ case QtWebEngineCore::FilePickerController::Save:
+ str = QFileDialog::getSaveFileName(
+ q, QString(),
+ (QStandardPaths::writableLocation(QStandardPaths::DownloadLocation)
+ + oldFiles.first()));
+ if (!str.isNull())
+ ret << str;
+ break;
+ case QtWebEngineCore::FilePickerController::Open:
+ str = QFileDialog::getOpenFileName(q, QString(), oldFiles.first(),
+ filter.join(QStringLiteral(";;")), nullptr,
+ QFileDialog::HideNameFilterDetails);
+ if (!str.isNull())
+ ret << str;
+ break;
+ }
+ return ret;
+#else
+ Q_UNUSED(mode);
+ Q_UNUSED(oldFiles);
+ Q_UNUSED(acceptedMimeTypes);
+
+ return QStringList();
+#endif // QT_CONFIG(filedialog)
+}
+
+void QWebEngineViewPrivate::showColorDialog(
+ QSharedPointer<QtWebEngineCore::ColorChooserController> controller)
+{
+#if QT_CONFIG(colordialog)
+ Q_Q(QWebEngineView);
+ QColorDialog *dialog = new QColorDialog(controller.data()->initialColor(), q);
+
+ QColorDialog::connect(dialog, SIGNAL(colorSelected(QColor)), controller.data(),
+ SLOT(accept(QColor)));
+ QColorDialog::connect(dialog, SIGNAL(rejected()), controller.data(), SLOT(reject()));
+
+ // Delete when done
+ QColorDialog::connect(dialog, SIGNAL(colorSelected(QColor)), dialog, SLOT(deleteLater()));
+ QColorDialog::connect(dialog, SIGNAL(rejected()), dialog, SLOT(deleteLater()));
+
+#if defined(Q_OS_MACOS)
+ dialog->setOption(QColorDialog::DontUseNativeDialog);
+#endif
+
+ dialog->open();
+#else
+ Q_UNUSED(controller);
+#endif
+}
+
+bool QWebEngineViewPrivate::showAuthorizationDialog(const QString &title, const QString &message)
+{
+#if QT_CONFIG(messagebox)
+ Q_Q(QWebEngineView);
+ QMessageBox msgBox(QMessageBox::Question, title, message, QMessageBox::Yes | QMessageBox::No,
+ q, Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint);
+ msgBox.setTextFormat(Qt::PlainText);
+ return msgBox.exec() == QMessageBox::Yes;
+#else
+ return false;
+#endif // QT_CONFIG(messagebox)
+}
+
+void QWebEngineViewPrivate::javaScriptAlert(const QUrl &url, const QString &msg)
+{
+#if QT_CONFIG(messagebox)
+ Q_Q(QWebEngineView);
+ QMessageBox msgBox(QMessageBox::Information,
+ QStringLiteral("Javascript Alert - %1").arg(url.toString()),
+ msg, QMessageBox::Ok, q,
+ Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint);
+ msgBox.setTextFormat(Qt::PlainText);
+ msgBox.exec();
+#else
+ Q_UNUSED(msg);
+#endif // QT_CONFIG(messagebox)
+}
+
+bool QWebEngineViewPrivate::javaScriptConfirm(const QUrl &url, const QString &msg)
+{
+#if QT_CONFIG(messagebox)
+ Q_Q(QWebEngineView);
+ QMessageBox msgBox(QMessageBox::Information,
+ QStringLiteral("Javascript Confirm - %1").arg(url.toString()),
+ msg, QMessageBox::Ok | QMessageBox::Cancel, q,
+ Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint);
+ msgBox.setTextFormat(Qt::PlainText);
+ return msgBox.exec() == QMessageBox::Ok;
+#else
+ Q_UNUSED(msg);
+ return false;
+#endif // QT_CONFIG(messagebox)
+}
+
+bool QWebEngineViewPrivate::javaScriptPrompt(const QUrl &url, const QString &msg,
+ const QString &defaultValue, QString *result)
+{
+#if QT_CONFIG(inputdialog)
+ Q_Q(QWebEngineView);
+ bool ret = false;
+
+ // Workaround: Do not interpret text as Qt::RichText
+ // QInputDialog uses Qt::AutoText that interprets the text string as
+ // Qt::RichText if Qt::mightBeRichText() returns true, otherwise as Qt::PlainText.
+ const QString message = Qt::mightBeRichText(msg) ? msg.toHtmlEscaped() : msg;
+
+ if (result)
+ *result = QInputDialog::getText(
+ q, QStringLiteral("Javascript Prompt - %1").arg(url.toString()),
+ message, QLineEdit::Normal, defaultValue, &ret);
+ return ret;
+#else
+ Q_UNUSED(msg);
+ Q_UNUSED(defaultValue);
+ Q_UNUSED(result);
+ return false;
+#endif // QT_CONFIG(inputdialog)
+}
+
+void QWebEngineViewPrivate::focusContainer()
+{
+ Q_Q(QWebEngineView);
+ q->activateWindow();
+ q->setFocus();
+}
+
+void QWebEngineViewPrivate::unhandledKeyEvent(QKeyEvent *event)
+{
+ Q_Q(QWebEngineView);
+ if (q->parentWidget())
+ QGuiApplication::sendEvent(q->parentWidget(), event);
+}
+
+bool QWebEngineViewPrivate::passOnFocus(bool reverse)
+{
+ Q_Q(QWebEngineView);
+ return q->focusNextPrevChild(!reverse);
+}
+
+#if QT_CONFIG(accessibility)
static QAccessibleInterface *webAccessibleFactory(const QString &, QObject *object)
{
if (QWebEngineView *v = qobject_cast<QWebEngineView*>(object))
return new QWebEngineViewAccessible(v);
return nullptr;
}
-#endif // QT_NO_ACCESSIBILITY
+#endif // QT_CONFIG(accessibility)
QWebEngineViewPrivate::QWebEngineViewPrivate()
- : page(0)
+ : page(nullptr)
, m_dragEntered(false)
, m_ownsPage(false)
+ , m_contextRequest(nullptr)
{
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
QAccessible::installFactory(&webAccessibleFactory);
-#endif // QT_NO_ACCESSIBILITY
+#endif // QT_CONFIG(accessibility)
+}
+
+QWebEngineViewPrivate::~QWebEngineViewPrivate() = default;
+
+// static
+void QWebEngineViewPrivate::bindPageAndView(QWebEnginePage *page, QWebEngineView *view)
+{
+ QWebEngineViewPrivate *v =
+ page ? static_cast<QWebEngineViewPrivate *>(page->d_func()->view) : nullptr;
+ auto oldView = v ? v->q_func() : nullptr;
+ auto oldPage = view ? view->d_func()->page : nullptr;
+
+ bool ownNewPage = false;
+ bool deleteOldPage = false;
+
+ // Change pointers first.
+
+ if (page && oldView != view) {
+ if (oldView) {
+ ownNewPage = oldView->d_func()->m_ownsPage;
+ oldView->d_func()->page = nullptr;
+ oldView->d_func()->m_ownsPage = false;
+ }
+ page->d_func()->view = view ? view->d_func() : nullptr;
+ }
+
+ if (view && oldPage != page) {
+ if (oldPage) {
+ if (oldPage->d_func())
+ oldPage->d_func()->view = nullptr;
+ deleteOldPage = view->d_func()->m_ownsPage;
+ }
+ view->d_func()->m_ownsPage = ownNewPage;
+ view->d_func()->page = page;
+ }
+
+ // Then notify.
+
+ auto item = page ? page->d_func()->delegateItem : nullptr;
+ auto oldItem = (oldPage && oldPage->d_func()) ? oldPage->d_func()->delegateItem : nullptr;
+ auto widget = item ? static_cast<QtWebEngineCore::WebEngineQuickWidget *>(item->m_widgetDelegate) : nullptr;
+ auto oldWidget = oldItem ? static_cast<QtWebEngineCore::WebEngineQuickWidget *>(oldItem->m_widgetDelegate) : nullptr;
+
+ // New page/widget moving away from oldView
+ if (page && oldView != view && oldView) {
+ oldView->d_func()->pageChanged(page, nullptr);
+ if (widget)
+ oldView->d_func()->widgetChanged(widget, nullptr);
+ }
+
+ // New page/widget moving into new view
+ if (view && oldPage != page) {
+ if (oldPage && oldPage->d_func())
+ view->d_func()->pageChanged(oldPage, page);
+ else
+ view->d_func()->pageChanged(nullptr, page);
+ if (!widget && item) {
+ widget = new QtWebEngineCore::WebEngineQuickWidget(item, nullptr);
+ item->setWidgetDelegate(widget);
+ }
+ if (oldWidget != widget)
+ view->d_func()->widgetChanged(oldWidget, widget);
+ }
+ if (deleteOldPage)
+ delete oldPage;
+}
+
+// static
+void QWebEngineViewPrivate::bindPageAndWidget(QWebEnginePagePrivate *pagePrivate,
+ QtWebEngineCore::WebEngineQuickWidget *widget)
+{
+ auto *oldAdapterClient = (widget && widget->m_contentItem) ? widget->m_contentItem->m_adapterClient : nullptr;
+ auto *oldPagePrivate = static_cast<QWebEnginePagePrivate *>(oldAdapterClient);
+ auto *oldItem = pagePrivate ? pagePrivate->delegateItem : nullptr;
+ auto *oldWidget = oldItem ? static_cast<QtWebEngineCore::WebEngineQuickWidget *>(oldItem->m_widgetDelegate) : nullptr;
+
+ // Change pointers first.
+
+ if (widget && oldPagePrivate != pagePrivate) {
+ if (oldPagePrivate)
+ oldPagePrivate->delegateItem = nullptr;
+ if (widget->m_contentItem)
+ widget->m_contentItem->m_adapterClient = pagePrivate;
+ }
+
+ if (pagePrivate && oldWidget != widget) {
+ if (oldWidget && oldWidget->m_contentItem)
+ oldWidget->m_contentItem->m_adapterClient = nullptr;
+ if (widget)
+ pagePrivate->delegateItem = widget->m_contentItem;
+ }
+
+ // Then notify.
+
+ if (oldPagePrivate && oldPagePrivate != pagePrivate) {
+ if (auto oldView = oldPagePrivate->view)
+ static_cast<QWebEngineViewPrivate *>(oldView)->widgetChanged(widget, nullptr);
+ }
+
+ if (pagePrivate && oldWidget != widget) {
+ if (auto view = pagePrivate->view)
+ static_cast<QWebEngineViewPrivate *>(view)->widgetChanged(oldWidget, widget);
+ }
+}
+
+QIcon QWebEngineViewPrivate::webActionIcon(QWebEnginePage::WebAction action) const
+{
+ Q_Q(const QWebEngineView);
+ QIcon icon;
+ QStyle *style = q->style();
+
+ switch (action) {
+ case QWebEnginePage::Back:
+ icon = style->standardIcon(QStyle::SP_ArrowBack);
+ break;
+ case QWebEnginePage::Forward:
+ icon = style->standardIcon(QStyle::SP_ArrowForward);
+ break;
+ case QWebEnginePage::Stop:
+ icon = style->standardIcon(QStyle::SP_BrowserStop);
+ break;
+ case QWebEnginePage::Reload:
+ icon = style->standardIcon(QStyle::SP_BrowserReload);
+ break;
+ case QWebEnginePage::ReloadAndBypassCache:
+ icon = style->standardIcon(QStyle::SP_BrowserReload);
+ break;
+ default:
+ break;
+ }
+ return icon;
+}
+
+QWebEnginePage *QWebEngineViewPrivate::createPageForWindow(QWebEnginePage::WebWindowType type)
+{
+ Q_Q(QWebEngineView);
+ QWebEngineView *newView = q->createWindow(type);
+ if (newView)
+ return newView->page();
+ return nullptr;
+}
+
+void QWebEngineViewPrivate::setToolTip(const QString &toolTipText)
+{
+ Q_Q(QWebEngineView);
+ if (toolTipText.isEmpty()) {
+ // Avoid duplicate events.
+ if (!q->toolTip().isEmpty())
+ q->setToolTip(QString());
+ // Force to hide tooltip because QWidget's default handler
+ // doesn't hide on empty text.
+ if (!QToolTip::text().isEmpty())
+ QToolTip::hideText();
+ } else if (toolTipText != q->toolTip()) {
+ q->setToolTip(toolTipText);
+ }
+
+}
+
+bool QWebEngineViewPrivate::isEnabled() const
+{
+ Q_Q(const QWebEngineView);
+ return q->isEnabled();
+}
+
+QObject *QWebEngineViewPrivate::accessibilityParentObject()
+{
+ Q_Q(QWebEngineView);
+ return q;
+}
+
+void QWebEngineViewPrivate::didPrintPage(QPrinter *&currentPrinter, QSharedPointer<QByteArray> result)
+{
+#if QT_CONFIG(webengine_printing_and_pdf)
+ Q_Q(QWebEngineView);
+
+ Q_ASSERT(currentPrinter);
+
+ QThread *printerThread = new QThread;
+ QObject::connect(printerThread, &QThread::finished, printerThread, &QThread::deleteLater);
+ printerThread->start();
+
+ QtWebEngineCore::PrinterWorker *printerWorker = new QtWebEngineCore::PrinterWorker(result, currentPrinter);
+ printerWorker->m_deviceResolution = currentPrinter->resolution();
+ printerWorker->m_firstPageFirst = currentPrinter->pageOrder() == QPrinter::FirstPageFirst;
+ printerWorker->m_documentCopies = currentPrinter->copyCount();
+ printerWorker->m_collateCopies = currentPrinter->collateCopies();
+
+ int oldCopyCount = currentPrinter->copyCount();
+ currentPrinter->printEngine()->setProperty(QPrintEngine::PPK_CopyCount, 1);
+
+ QObject::connect(printerWorker, &QtWebEngineCore::PrinterWorker::resultReady, q, [q, &currentPrinter, oldCopyCount](bool success) {
+ currentPrinter->printEngine()->setProperty(QPrintEngine::PPK_CopyCount, oldCopyCount);
+ currentPrinter = nullptr;
+ Q_EMIT q->printFinished(success);
+ });
+
+ QObject::connect(printerWorker, &QtWebEngineCore::PrinterWorker::resultReady, printerThread, &QThread::quit);
+ QObject::connect(printerThread, &QThread::finished, printerWorker, &QtWebEngineCore::PrinterWorker::deleteLater);
+
+ printerWorker->moveToThread(printerThread);
+ QMetaObject::invokeMethod(printerWorker, "print");
+
+#else
+ Q_UNUSED(currentPrinter);
+ Q_UNUSED(result);
+#endif
+}
+
+void QWebEngineViewPrivate::didPrintPageToPdf(const QString &filePath, bool success)
+{
+ Q_Q(QWebEngineView);
+ Q_EMIT q->pdfPrintingFinished(filePath, success);
+}
+
+void QWebEngineViewPrivate::printRequested()
+{
+ Q_Q(QWebEngineView);
+ QTimer::singleShot(0, q, [q]() {
+ Q_EMIT q->printRequested();
+ });
+}
+
+bool QWebEngineViewPrivate::isVisible() const
+{
+ Q_Q(const QWebEngineView);
+ return q->isVisible();
+}
+QRect QWebEngineViewPrivate::viewportRect() const
+{
+ Q_Q(const QWebEngineView);
+ return q->rect();
+}
+QtWebEngineCore::RenderWidgetHostViewQtDelegate *
+QWebEngineViewPrivate::CreateRenderWidgetHostViewQtDelegate(
+ QtWebEngineCore::RenderWidgetHostViewQtDelegateClient *client)
+{
+ auto *item = new QtWebEngineCore::RenderWidgetHostViewQtDelegateItem(client, false);
+ auto *widget = new QtWebEngineCore::WebEngineQuickWidget(item, nullptr);
+ item->setWidgetDelegate(widget);
+ return item;
+}
+
+QtWebEngineCore::RenderWidgetHostViewQtDelegate *
+QWebEngineViewPrivate::CreateRenderWidgetHostViewQtDelegateForPopup(
+ QtWebEngineCore::RenderWidgetHostViewQtDelegateClient *client)
+{
+ Q_Q(QWebEngineView);
+ auto *item = new QtWebEngineCore::RenderWidgetHostViewQtDelegateItem(client, true);
+ auto *widget = new QtWebEngineCore::WebEngineQuickWidget(item, q);
+ item->setWidgetDelegate(widget);
+ return item;
+}
+
+QWebEngineContextMenuRequest *QWebEngineViewPrivate::lastContextMenuRequest() const
+{
+ return m_contextRequest;
+}
+
+void QWebEngineViewPrivate::showAutofillPopup(QtWebEngineCore::AutofillPopupController *controller,
+ const QRect &bounds, bool autoselectFirstSuggestion)
+{
+ Q_Q(QWebEngineView);
+ if (!m_autofillPopupWidget)
+ m_autofillPopupWidget.reset(new QtWebEngineWidgetUI::AutofillPopupWidget(controller, q));
+ m_autofillPopupWidget->showPopup(q->mapToGlobal(bounds.bottomLeft()), bounds.width() + 2,
+ autoselectFirstSuggestion);
+ controller->notifyPopupShown();
+}
+
+void QWebEngineViewPrivate::hideAutofillPopup()
+{
+ if (!m_autofillPopupWidget)
+ return;
+
+ Q_Q(QWebEngineView);
+ QTimer::singleShot(0, q, [this] {
+ if (m_autofillPopupWidget) {
+ QtWebEngineCore::AutofillPopupController *controller =
+ m_autofillPopupWidget->m_controller;
+ m_autofillPopupWidget.reset();
+ controller->notifyPopupHidden();
+ }
+ });
}
/*!
@@ -176,10 +979,58 @@ QWebEngineView::QWebEngineView(QWidget *parent)
setLayout(layout);
}
+/*!
+ \since 6.4
+
+ Constructs an empty web view using \a profile with the parent \a parent.
+
+ \note The \a profile object ownership is not taken and it should outlive the view.
+
+ \sa load()
+*/
+
+QWebEngineView::QWebEngineView(QWebEngineProfile *profile, QWidget *parent)
+ : QWebEngineView(parent)
+{
+ Q_D(QWebEngineView);
+ setPage(new QWebEnginePage(profile, this));
+ d->m_ownsPage = true;
+}
+
+/*!
+ \since 6.4
+
+ Constructs a web view containing \a page with the parent \a parent.
+
+ \note Ownership of \a page is not taken, and it is up to the caller to ensure it is deleted.
+
+ \sa load(), setPage()
+*/
+
+QWebEngineView::QWebEngineView(QWebEnginePage *page, QWidget *parent)
+ : QWebEngineView(parent)
+{
+ setPage(page);
+}
+
QWebEngineView::~QWebEngineView()
{
blockSignals(true);
- QWebEnginePagePrivate::bindPageAndView(nullptr, this);
+ QWebEngineViewPrivate::bindPageAndView(nullptr, this);
+}
+
+/*!
+ \since 6.2
+
+ Returns the view if any, associated with the \a page.
+
+ \sa page(), setPage()
+*/
+QWebEngineView *QWebEngineView::forPage(const QWebEnginePage *page)
+{
+ if (!page)
+ return nullptr;
+ return qobject_cast<QWebEngineView *>(page->d_ptr->accessibilityParentObject());
}
QWebEnginePage* QWebEngineView::page() const
@@ -195,7 +1046,20 @@ QWebEnginePage* QWebEngineView::page() const
void QWebEngineView::setPage(QWebEnginePage *newPage)
{
- QWebEnginePagePrivate::bindPageAndView(newPage, this);
+ Q_D(QWebEngineView);
+ if (d->page) {
+ disconnect(d->m_pageConnection);
+ d->m_pageConnection = {};
+ }
+
+ QWebEngineViewPrivate::bindPageAndView(newPage, this);
+ if (!newPage)
+ return;
+ d->m_pageConnection = connect(newPage, &QWebEnginePage::_q_aboutToDelete, this,
+ [newPage]() { QWebEngineViewPrivate::bindPageAndView(newPage, nullptr); });
+ auto profile = newPage->profile();
+ if (!profile->notificationPresenter())
+ profile->setNotificationPresenter(&defaultNotificationPresenter);
}
void QWebEngineView::load(const QUrl& url)
@@ -273,10 +1137,19 @@ QString QWebEngineView::selectedText() const
return page()->selectedText();
}
-#ifndef QT_NO_ACTION
+#if QT_CONFIG(action)
QAction* QWebEngineView::pageAction(QWebEnginePage::WebAction action) const
{
- return page()->action(action);
+ Q_D(const QWebEngineView);
+ QAction *pageAction = page()->action(action);
+
+ if (pageAction->icon().isNull()) {
+ auto icon = d->webActionIcon(action);
+ if (!icon.isNull())
+ pageAction->setIcon(icon);
+ }
+
+ return pageAction;
}
#endif
@@ -285,7 +1158,7 @@ void QWebEngineView::triggerPageAction(QWebEnginePage::WebAction action, bool ch
page()->triggerAction(action, checked);
}
-void QWebEngineView::findText(const QString &subString, QWebEnginePage::FindFlags options, const QWebEngineCallback<bool> &resultCallback)
+void QWebEngineView::findText(const QString &subString, QWebEnginePage::FindFlags options, const std::function<void(const QWebEngineFindTextResult &)> &resultCallback)
{
page()->findText(subString, options, resultCallback);
}
@@ -326,8 +1199,8 @@ void QWebEngineView::reload()
QWebEngineView *QWebEngineView::createWindow(QWebEnginePage::WebWindowType type)
{
- Q_UNUSED(type)
- return 0;
+ Q_UNUSED(type);
+ return nullptr;
}
qreal QWebEngineView::zoomFactor() const
@@ -358,17 +1231,6 @@ bool QWebEngineView::event(QEvent *ev)
return true;
}
- // Override QWidget's default ToolTip handler since it doesn't hide tooltip on empty text.
- if (ev->type() == QEvent::ToolTip) {
- if (!toolTip().isEmpty())
- QToolTip::showText(static_cast<QHelpEvent *>(ev)->globalPos(), toolTip(), this, QRect(), toolTipDuration());
- else
- QToolTip::hideText();
-
- ev->accept();
- return true;
- }
-
return QWidget::event(ev);
}
@@ -378,7 +1240,7 @@ bool QWebEngineView::event(QEvent *ev)
#if QT_CONFIG(contextmenu)
void QWebEngineView::contextMenuEvent(QContextMenuEvent *event)
{
- QMenu *menu = page()->createStandardContextMenu();
+ QMenu *menu = createStandardContextMenu();
menu->popup(event->globalPos());
}
#endif // QT_CONFIG(contextmenu)
@@ -421,7 +1283,7 @@ void QWebEngineView::dragEnterEvent(QDragEnterEvent *e)
e->accept();
if (d->m_dragEntered)
d->page->d_ptr->adapter->leaveDrag();
- d->page->d_ptr->adapter->enterDrag(e, mapToGlobal(e->pos()));
+ d->page->d_ptr->adapter->enterDrag(e, mapToGlobal(e->position().toPoint()));
d->m_dragEntered = true;
}
@@ -447,7 +1309,8 @@ void QWebEngineView::dragMoveEvent(QDragMoveEvent *e)
if (!d->m_dragEntered)
return;
QtWebEngineCore::WebContentsAdapter *adapter = d->page->d_ptr->adapter.data();
- Qt::DropAction dropAction = adapter->updateDragPosition(e, mapToGlobal(e->pos()));
+ Qt::DropAction dropAction =
+ adapter->updateDragPosition(e, mapToGlobal(e->position().toPoint()));
if (Qt::IgnoreAction == dropAction) {
e->ignore();
} else {
@@ -465,49 +1328,370 @@ void QWebEngineView::dropEvent(QDropEvent *e)
if (!d->m_dragEntered)
return;
e->accept();
- d->page->d_ptr->adapter->endDragging(e, mapToGlobal(e->pos()));
+ d->page->d_ptr->adapter->endDragging(e, mapToGlobal(e->position().toPoint()));
d->m_dragEntered = false;
}
#endif // QT_CONFIG(draganddrop)
-#ifndef QT_NO_ACCESSIBILITY
-bool QWebEngineViewAccessible::isValid() const
+#if QT_CONFIG(menu)
+/*!
+ Creates a standard context menu and returns a pointer to it.
+*/
+QMenu *QWebEngineView::createStandardContextMenu()
{
- if (!QAccessibleWidget::isValid())
- return false;
+ Q_D(QWebEngineView);
+ QMenu *menu = new QMenu(this);
+ QContextMenuBuilder contextMenuBuilder(d->m_contextRequest, this, menu);
- if (!view() || !view()->d_func() || !view()->d_func()->page || !view()->d_func()->page->d_func())
- return false;
+ contextMenuBuilder.initMenu();
- return true;
+ menu->setAttribute(Qt::WA_DeleteOnClose, true);
+
+ return menu;
}
+#endif // QT_CONFIG(menu)
+
+/*!
+ \since 6.2
+
+ Returns additional data about the current context menu. It is only guaranteed to be valid during
+ the call to the contextMenuEvent().
-QAccessibleInterface *QWebEngineViewAccessible::focusChild() const
+ \sa createStandardContextMenu()
+*/
+QWebEngineContextMenuRequest *QWebEngineView::lastContextMenuRequest() const
{
- if (child(0) && child(0)->focusChild())
- return child(0)->focusChild();
- return const_cast<QWebEngineViewAccessible *>(this);
+ Q_D(const QWebEngineView);
+ return d->m_contextRequest;
}
-int QWebEngineViewAccessible::childCount() const
+/*!
+ \fn void QWebEngineView::pdfPrintingFinished(const QString &filePath, bool success)
+ \since 6.2
+
+ This signal is emitted when printing the web page into a PDF file has
+ finished.
+ \a filePath will contain the path the file was requested to be created
+ at, and \a success will be \c true if the file was successfully created and
+ \c false otherwise.
+
+ \sa printToPdf()
+*/
+
+/*!
+ Renders the current content of the page into a PDF document and saves it
+ in the location specified in \a filePath.
+ The page size and orientation of the produced PDF document are taken from
+ the values specified in \a layout, while the range of pages printed is
+ taken from \a ranges with the default being printing all pages.
+
+ This method issues an asynchronous request for printing the web page into
+ a PDF and returns immediately.
+ To be informed about the result of the request, connect to the signal
+ pdfPrintingFinished().
+
+ If a file already exists at the provided file path, it will be overwritten.
+ \since 6.2
+ \sa pdfPrintingFinished()
+*/
+void QWebEngineView::printToPdf(const QString &filePath, const QPageLayout &layout, const QPageRanges &ranges)
{
- return child(0) ? 1 : 0;
+ page()->printToPdf(filePath, layout, ranges);
}
-QAccessibleInterface *QWebEngineViewAccessible::child(int index) const
+/*!
+ Renders the current content of the page into a PDF document and returns a byte array containing the PDF data
+ as parameter to \a resultCallback.
+ The page size and orientation of the produced PDF document are taken from the values specified in \a layout,
+ while the range of pages printed is taken from \a ranges with the default being printing all pages.
+
+ The \a resultCallback must take a const reference to a QByteArray as parameter. If printing was successful, this byte array
+ will contain the PDF data, otherwise, the byte array will be empty.
+
+ \warning We guarantee that the callback (\a resultCallback) is always called, but it might be done
+ during page destruction. When QWebEnginePage is deleted, the callback is triggered with an invalid
+ value and it is not safe to use the corresponding QWebEnginePage or QWebEngineView instance inside it.
+
+ \since 6.2
+*/
+void QWebEngineView::printToPdf(const std::function<void(const QByteArray&)> &resultCallback, const QPageLayout &layout, const QPageRanges &ranges)
{
- if (index == 0 && isValid())
- return view()->page()->d_func()->adapter->browserAccessible();
- return nullptr;
+ page()->printToPdf(resultCallback, layout, ranges);
+}
+
+/*!
+ \fn void QWebEngineView::printRequested()
+ \since 6.2
+
+ This signal is emitted when the JavaScript \c{window.print()} method is called or the user pressed the print
+ button of PDF viewer plugin.
+ Typically, the signal handler can simply call print().
+
+ \sa print()
+*/
+
+/*!
+ \fn void QWebEngineView::printFinished(bool success)
+ \since 6.2
+
+ This signal is emitted when printing requested with print() has finished.
+ The parameter \a success is \c true for success or \c false for failure.
+
+ \sa print()
+*/
+
+/*!
+ Renders the current content of the page into a temporary PDF document, then prints it using \a printer.
+
+ The settings for creating and printing the PDF document will be retrieved from the \a printer
+ object.
+
+ When finished the signal printFinished() is emitted with the \c true for success or \c false for failure.
+
+ It is the users responsibility to ensure the \a printer remains valid until printFinished()
+ has been emitted.
+
+ \note Printing runs on the browser process, which is by default not sandboxed.
+
+ \note The data generation step of printing can be interrupted for a short period of time using
+ the \l QWebEnginePage::Stop web action.
+
+ \note This function rasterizes the result when rendering onto \a printer. Please consider raising
+ the default resolution of \a printer to at least 300 DPI or using printToPdf() to produce
+ PDF file output more effectively.
+
+ \since 6.2
+*/
+void QWebEngineView::print(QPrinter *printer)
+{
+#if QT_CONFIG(webengine_printing_and_pdf)
+ if (page()->d_ptr->currentPrinter) {
+ qWarning("Cannot print page on printer %ls: Already printing on a device.", qUtf16Printable(printer->printerName()));
+ return;
+ }
+
+ page()->d_ptr->currentPrinter = printer;
+ page()->d_ptr->ensureInitialized();
+ page()->d_ptr->adapter->printToPDFCallbackResult(printer->pageLayout(),
+ printer->pageRanges(),
+ printer->colorMode() == QPrinter::Color,
+ false);
+#else
+ Q_UNUSED(printer);
+ Q_EMIT printFinished(false);
+#endif
+}
+
+#if QT_CONFIG(action)
+QContextMenuBuilder::QContextMenuBuilder(QWebEngineContextMenuRequest *request,
+ QWebEngineView *view, QMenu *menu)
+ : QtWebEngineCore::RenderViewContextMenuQt(request), m_view(view), m_menu(menu)
+{
+ m_view->page()->d_ptr->ensureInitialized();
}
-int QWebEngineViewAccessible::indexOfChild(const QAccessibleInterface *c) const
+bool QContextMenuBuilder::hasInspector()
{
- if (child(0) && c == child(0))
- return 0;
- return -1;
+ return m_view->page()->d_ptr->adapter->hasInspector();
+}
+
+bool QContextMenuBuilder::isFullScreenMode()
+{
+ return m_view->page()->d_ptr->isFullScreenMode();
+}
+
+void QContextMenuBuilder::addMenuItem(ContextMenuItem menuItem)
+{
+ QPointer<QWebEnginePage> thisRef(m_view->page());
+ QAction *action = nullptr;
+
+ switch (menuItem) {
+ case ContextMenuItem::Back:
+ action = m_view->pageAction(QWebEnginePage::Back);
+ break;
+ case ContextMenuItem::Forward:
+ action = m_view->pageAction(QWebEnginePage::Forward);
+ break;
+ case ContextMenuItem::Reload:
+ action = m_view->pageAction(QWebEnginePage::Reload);
+ break;
+ case ContextMenuItem::Cut:
+ action = m_view->pageAction(QWebEnginePage::Cut);
+ break;
+ case ContextMenuItem::Copy:
+ action = m_view->pageAction(QWebEnginePage::Copy);
+ break;
+ case ContextMenuItem::Paste:
+ action = m_view->pageAction(QWebEnginePage::Paste);
+ break;
+ case ContextMenuItem::Undo:
+ action = m_view->pageAction(QWebEnginePage::Undo);
+ break;
+ case ContextMenuItem::Redo:
+ action = m_view->pageAction(QWebEnginePage::Redo);
+ break;
+ case ContextMenuItem::SelectAll:
+ action = m_view->pageAction(QWebEnginePage::SelectAll);
+ break;
+ case ContextMenuItem::PasteAndMatchStyle:
+ action = m_view->pageAction(QWebEnginePage::PasteAndMatchStyle);
+ break;
+ case ContextMenuItem::OpenLinkInNewWindow:
+ action = m_view->pageAction(QWebEnginePage::OpenLinkInNewWindow);
+ break;
+ case ContextMenuItem::OpenLinkInNewTab:
+ action = m_view->pageAction(QWebEnginePage::OpenLinkInNewTab);
+ break;
+ case ContextMenuItem::CopyLinkToClipboard:
+ action = m_view->pageAction(QWebEnginePage::CopyLinkToClipboard);
+ break;
+ case ContextMenuItem::DownloadLinkToDisk:
+ action = m_view->pageAction(QWebEnginePage::DownloadLinkToDisk);
+ break;
+ case ContextMenuItem::CopyImageToClipboard:
+ action = m_view->pageAction(QWebEnginePage::CopyImageToClipboard);
+ break;
+ case ContextMenuItem::CopyImageUrlToClipboard:
+ action = m_view->pageAction(QWebEnginePage::CopyImageUrlToClipboard);
+ break;
+ case ContextMenuItem::DownloadImageToDisk:
+ action = m_view->pageAction(QWebEnginePage::DownloadImageToDisk);
+ break;
+ case ContextMenuItem::CopyMediaUrlToClipboard:
+ action = m_view->pageAction(QWebEnginePage::CopyMediaUrlToClipboard);
+ break;
+ case ContextMenuItem::ToggleMediaControls:
+ action = m_view->pageAction(QWebEnginePage::ToggleMediaControls);
+ break;
+ case ContextMenuItem::ToggleMediaLoop:
+ action = m_view->pageAction(QWebEnginePage::ToggleMediaLoop);
+ break;
+ case ContextMenuItem::DownloadMediaToDisk:
+ action = m_view->pageAction(QWebEnginePage::DownloadMediaToDisk);
+ break;
+ case ContextMenuItem::InspectElement:
+ action = m_view->pageAction(QWebEnginePage::InspectElement);
+ break;
+ case ContextMenuItem::ExitFullScreen:
+ action = m_view->pageAction(QWebEnginePage::ExitFullScreen);
+ break;
+ case ContextMenuItem::SavePage:
+ action = m_view->pageAction(QWebEnginePage::SavePage);
+ break;
+ case ContextMenuItem::ViewSource:
+ action = m_view->pageAction(QWebEnginePage::ViewSource);
+ break;
+ case ContextMenuItem::SpellingSuggestions:
+ for (int i = 0; i < m_contextData->spellCheckerSuggestions().size() && i < 4; i++) {
+ action = new QAction(m_menu);
+ QString replacement = m_contextData->spellCheckerSuggestions().at(i);
+ QObject::connect(action, &QAction::triggered, [thisRef, replacement] {
+ if (thisRef)
+ thisRef->replaceMisspelledWord(replacement);
+ });
+ action->setText(replacement);
+ m_menu->addAction(action);
+ }
+ return;
+ case ContextMenuItem::Separator:
+ if (!m_menu->isEmpty())
+ m_menu->addSeparator();
+ return;
+ }
+ action->setEnabled(isMenuItemEnabled(menuItem));
+ m_menu->addAction(action);
+}
+
+bool QContextMenuBuilder::isMenuItemEnabled(ContextMenuItem menuItem)
+{
+ switch (menuItem) {
+ case ContextMenuItem::Back:
+ return m_view->page()->d_ptr->adapter->canGoBack();
+ case ContextMenuItem::Forward:
+ return m_view->page()->d_ptr->adapter->canGoForward();
+ case ContextMenuItem::Reload:
+ return true;
+ case ContextMenuItem::Cut:
+ return m_contextData->editFlags() & QWebEngineContextMenuRequest::CanCut;
+ case ContextMenuItem::Copy:
+ return m_contextData->editFlags() & QWebEngineContextMenuRequest::CanCopy;
+ case ContextMenuItem::Paste:
+ return m_contextData->editFlags() & QWebEngineContextMenuRequest::CanPaste;
+ case ContextMenuItem::Undo:
+ return m_contextData->editFlags() & QWebEngineContextMenuRequest::CanUndo;
+ case ContextMenuItem::Redo:
+ return m_contextData->editFlags() & QWebEngineContextMenuRequest::CanRedo;
+ case ContextMenuItem::SelectAll:
+ return m_contextData->editFlags() & QWebEngineContextMenuRequest::CanSelectAll;
+ case ContextMenuItem::PasteAndMatchStyle:
+ return m_contextData->editFlags() & QWebEngineContextMenuRequest::CanPaste;
+ case ContextMenuItem::OpenLinkInNewWindow:
+ case ContextMenuItem::OpenLinkInNewTab:
+ case ContextMenuItem::CopyLinkToClipboard:
+ case ContextMenuItem::DownloadLinkToDisk:
+ case ContextMenuItem::CopyImageToClipboard:
+ case ContextMenuItem::CopyImageUrlToClipboard:
+ case ContextMenuItem::DownloadImageToDisk:
+ case ContextMenuItem::CopyMediaUrlToClipboard:
+ case ContextMenuItem::ToggleMediaControls:
+ case ContextMenuItem::ToggleMediaLoop:
+ case ContextMenuItem::DownloadMediaToDisk:
+ case ContextMenuItem::InspectElement:
+ case ContextMenuItem::ExitFullScreen:
+ case ContextMenuItem::SavePage:
+ return true;
+ case ContextMenuItem::ViewSource:
+ return m_view->page()->d_ptr->adapter->canViewSource();
+ case ContextMenuItem::SpellingSuggestions:
+ case ContextMenuItem::Separator:
+ return true;
+ }
+ Q_UNREACHABLE();
+}
+#endif // QT_CONFIG(action)
+
+QtWebEngineCore::TouchHandleDrawableDelegate *
+QWebEngineViewPrivate::createTouchHandleDelegate(const QMap<int, QImage> &images)
+{
+ Q_Q(QWebEngineView);
+ return new QtWebEngineWidgetUI::TouchHandleWidget(q, images);
+}
+
+void QWebEngineViewPrivate::hideTouchSelectionMenu()
+{
+ if (m_touchSelectionMenu)
+ m_touchSelectionMenu->close();
+}
+
+void QWebEngineViewPrivate::showTouchSelectionMenu(
+ QtWebEngineCore::TouchSelectionMenuController *controller, const QRect &selectionBounds)
+{
+ Q_ASSERT(m_touchSelectionMenu == nullptr);
+ Q_Q(QWebEngineView);
+
+ // Do not show outside of view
+ QSize parentSize = q->nativeParentWidget() ? q->nativeParentWidget()->size() : q->size();
+ if (selectionBounds.x() < 0 || selectionBounds.x() > parentSize.width()
+ || selectionBounds.y() < 0 || selectionBounds.y() > parentSize.height())
+ return;
+
+ m_touchSelectionMenu = new QtWebEngineWidgetUI::TouchSelectionMenuWidget(q, controller);
+
+ const int kSpacingBetweenButtons = 2;
+ const int kMenuButtonMinWidth = 80;
+ const int kMenuButtonMinHeight = 40;
+
+ int buttonCount = controller->buttonCount();
+ int width = (kSpacingBetweenButtons * (buttonCount + 1)) + (kMenuButtonMinWidth * buttonCount);
+ int height = kMenuButtonMinHeight + kSpacingBetweenButtons;
+ int x = (selectionBounds.x() + selectionBounds.x() + selectionBounds.width() - width) / 2;
+ int y = selectionBounds.y() - height - 2;
+
+ QPoint pos = q->mapToGlobal(QPoint(x, y));
+
+ m_touchSelectionMenu->setGeometry(pos.x(), pos.y(), width, height);
+ m_touchSelectionMenu->show();
}
-#endif // QT_NO_ACCESSIBILITY
QT_END_NAMESPACE
diff --git a/src/webenginewidgets/api/qwebengineview.h b/src/webenginewidgets/api/qwebengineview.h
index 04c8ece74..f93d61b12 100644
--- a/src/webenginewidgets/api/qwebengineview.h
+++ b/src/webenginewidgets/api/qwebengineview.h
@@ -1,62 +1,34 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QWEBENGINEVIEW_H
#define QWEBENGINEVIEW_H
-#include <QtGui/qpainter.h>
-#include <QtNetwork/qnetworkaccessmanager.h>
+#include <QtGui/QPageLayout>
+#include <QtGui/qpageranges.h>
#include <QtWidgets/qwidget.h>
#include <QtWebEngineWidgets/qtwebenginewidgetsglobal.h>
-#include <QtWebEngineWidgets/qwebenginepage.h>
-#include <QtWebEngineCore/qwebenginehttprequest.h>
+#include <QtWebEngineCore/qwebenginepage.h>
+
+namespace QtWebEngineWidgetUI {
+class AutofillPopupWidget;
+}
QT_BEGIN_NAMESPACE
+
class QContextMenuEvent;
+class QPrinter;
class QUrl;
-class QWebEnginePage;
+class QWebEngineContextMenuRequest;
+class QWebEngineHistory;
+class QWebEngineHttpRequest;
class QWebEngineSettings;
class QWebEngineViewAccessible;
class QWebEngineViewPrivate;
-class QWEBENGINEWIDGETS_EXPORT QWebEngineView : public QWidget {
+class QWEBENGINEWIDGETS_EXPORT QWebEngineView : public QWidget
+{
Q_OBJECT
Q_PROPERTY(QString title READ title)
Q_PROPERTY(QUrl url READ url WRITE setUrl)
@@ -67,18 +39,23 @@ class QWEBENGINEWIDGETS_EXPORT QWebEngineView : public QWidget {
Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor)
public:
- explicit QWebEngineView(QWidget* parent = Q_NULLPTR);
+ explicit QWebEngineView(QWidget *parent = nullptr);
+ explicit QWebEngineView(QWebEngineProfile *profile, QWidget *parent = nullptr);
+ explicit QWebEngineView(QWebEnginePage *page, QWidget *parent = nullptr);
virtual ~QWebEngineView();
- QWebEnginePage* page() const;
- void setPage(QWebEnginePage* page);
+ static QWebEngineView *forPage(const QWebEnginePage *page);
+
+ QWebEnginePage *page() const;
+ void setPage(QWebEnginePage *page);
void load(const QUrl &url);
void load(const QWebEngineHttpRequest &request);
- void setHtml(const QString& html, const QUrl& baseUrl = QUrl());
- void setContent(const QByteArray& data, const QString& mimeType = QString(), const QUrl& baseUrl = QUrl());
+ void setHtml(const QString &html, const QUrl &baseUrl = QUrl());
+ void setContent(const QByteArray &data, const QString &mimeType = QString(),
+ const QUrl &baseUrl = QUrl());
- QWebEngineHistory* history() const;
+ QWebEngineHistory *history() const;
QString title() const;
void setUrl(const QUrl &url);
@@ -89,18 +66,35 @@ public:
bool hasSelection() const;
QString selectedText() const;
-#ifndef QT_NO_ACTION
- QAction* pageAction(QWebEnginePage::WebAction action) const;
+#if QT_CONFIG(action)
+ QAction *pageAction(QWebEnginePage::WebAction action) const;
#endif
void triggerPageAction(QWebEnginePage::WebAction action, bool checked = false);
qreal zoomFactor() const;
void setZoomFactor(qreal factor);
- void findText(const QString &subString, QWebEnginePage::FindFlags options = QWebEnginePage::FindFlags(), const QWebEngineCallback<bool> &resultCallback = QWebEngineCallback<bool>());
+ void findText(const QString &subString, QWebEnginePage::FindFlags options = {},
+ const std::function<void(const QWebEngineFindTextResult &)> &resultCallback =
+ std::function<void(const QWebEngineFindTextResult &)>());
QSize sizeHint() const override;
QWebEngineSettings *settings() const;
+#if QT_CONFIG(menu)
+ QMenu *createStandardContextMenu();
+#endif
+ QWebEngineContextMenuRequest *lastContextMenuRequest() const;
+
+ void printToPdf(const QString &filePath,
+ const QPageLayout &layout = QPageLayout(QPageSize(QPageSize::A4),
+ QPageLayout::Portrait, QMarginsF()),
+ const QPageRanges &ranges = {});
+ void printToPdf(const std::function<void(const QByteArray &)> &resultCallback,
+ const QPageLayout &layout = QPageLayout(QPageSize(QPageSize::A4),
+ QPageLayout::Portrait, QMarginsF()),
+ const QPageRanges &ranges = {});
+ void print(QPrinter *printer);
+
public Q_SLOTS:
void stop();
void back();
@@ -111,20 +105,23 @@ Q_SIGNALS:
void loadStarted();
void loadProgress(int progress);
void loadFinished(bool);
- void titleChanged(const QString& title);
+ void titleChanged(const QString &title);
void selectionChanged();
- void urlChanged(const QUrl&);
- void iconUrlChanged(const QUrl&);
- void iconChanged(const QIcon&);
+ void urlChanged(const QUrl &);
+ void iconUrlChanged(const QUrl &);
+ void iconChanged(const QIcon &);
void renderProcessTerminated(QWebEnginePage::RenderProcessTerminationStatus terminationStatus,
- int exitCode);
+ int exitCode);
+ void pdfPrintingFinished(const QString &filePath, bool success);
+ void printRequested();
+ void printFinished(bool success);
protected:
virtual QWebEngineView *createWindow(QWebEnginePage::WebWindowType type);
#if QT_CONFIG(contextmenu)
- void contextMenuEvent(QContextMenuEvent*) override;
+ void contextMenuEvent(QContextMenuEvent *) override;
#endif // QT_CONFIG(contextmenu)
- bool event(QEvent*) override;
+ bool event(QEvent *) override;
void showEvent(QShowEvent *) override;
void hideEvent(QHideEvent *) override;
void closeEvent(QCloseEvent *) override;
@@ -140,8 +137,7 @@ private:
Q_DECLARE_PRIVATE(QWebEngineView)
QScopedPointer<QWebEngineViewPrivate> d_ptr;
- friend class QWebEnginePage;
- friend class QWebEnginePagePrivate;
+ friend class QtWebEngineWidgetUI::AutofillPopupWidget;
#if QT_CONFIG(accessibility)
friend class QWebEngineViewAccessible;
#endif
diff --git a/src/webenginewidgets/api/qwebengineview_p.h b/src/webenginewidgets/api/qwebengineview_p.h
index a3c619cea..aa330ac23 100644
--- a/src/webenginewidgets/api/qwebengineview_p.h
+++ b/src/webenginewidgets/api/qwebengineview_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QWEBENGINEVIEW_P_H
#define QWEBENGINEVIEW_P_H
@@ -51,52 +15,109 @@
// We mean it.
//
-#include <QtWebEngineWidgets/qwebengineview.h>
+#include <QtWebEngineCore/private/qwebenginepage_p.h> // PageView
-#include <QtWidgets/qaccessiblewidget.h>
+#include "render_view_context_menu_qt.h"
+
+#include <QtCore/qpointer.h>
namespace QtWebEngineCore {
-class RenderWidgetHostViewQtDelegateWidget;
+class AutofillPopupController;
+class QWebEngineContextMenuRequest;
+class WebEngineQuickWidget;
+class RenderWidgetHostViewQtDelegate;
+class RenderWidgetHostViewQtDelegateClient;
+class TouchSelectionMenuController;
+}
+
+namespace QtWebEngineWidgetUI {
+class AutofillPopupWidget;
+class TouchHandleDrawableDelegate;
+class TouchSelectionMenuWidget;
}
QT_BEGIN_NAMESPACE
+class QMenu;
+class QPrinter;
class QWebEngineView;
-class QWebEngineViewPrivate
+class QWebEngineViewPrivate : public PageView
{
public:
Q_DECLARE_PUBLIC(QWebEngineView)
QWebEngineView *q_ptr;
void pageChanged(QWebEnginePage *oldPage, QWebEnginePage *newPage);
- void widgetChanged(QtWebEngineCore::RenderWidgetHostViewQtDelegateWidget *oldWidget,
- QtWebEngineCore::RenderWidgetHostViewQtDelegateWidget *newWidget);
-
+ void widgetChanged(QtWebEngineCore::WebEngineQuickWidget *oldWidget,
+ QtWebEngineCore::WebEngineQuickWidget *newWidget);
+
+ void contextMenuRequested(QWebEngineContextMenuRequest *request) override;
+ QStringList chooseFiles(QWebEnginePage::FileSelectionMode mode, const QStringList &oldFiles,
+ const QStringList &acceptedMimeTypes) override;
+ void
+ showColorDialog(QSharedPointer<QtWebEngineCore::ColorChooserController> controller) override;
+ bool showAuthorizationDialog(const QString &title, const QString &message) override;
+ void javaScriptAlert(const QUrl &url, const QString &msg) override;
+ bool javaScriptConfirm(const QUrl &url, const QString &msg) override;
+ bool javaScriptPrompt(const QUrl &url, const QString &msg, const QString &defaultValue,
+ QString *result) override;
+ void setToolTip(const QString &toolTipText) override;
+ QtWebEngineCore::RenderWidgetHostViewQtDelegate *CreateRenderWidgetHostViewQtDelegate(
+ QtWebEngineCore::RenderWidgetHostViewQtDelegateClient *client) override;
+ QtWebEngineCore::RenderWidgetHostViewQtDelegate *CreateRenderWidgetHostViewQtDelegateForPopup(
+ QtWebEngineCore::RenderWidgetHostViewQtDelegateClient *client) override;
+ QWebEngineContextMenuRequest *lastContextMenuRequest() const override;
+ QWebEnginePage *createPageForWindow(QWebEnginePage::WebWindowType type) override;
+ QObject *accessibilityParentObject() override;
+ void didPrintPage(QPrinter *&printer, QSharedPointer<QByteArray> result) override;
+ void didPrintPageToPdf(const QString &filePath, bool success) override;
+ void printRequested() override;
+ void showAutofillPopup(QtWebEngineCore::AutofillPopupController *controller,
+ const QRect &bounds, bool autoselectFirstSuggestion) override;
+ void hideAutofillPopup() override;
+ QtWebEngineCore::TouchHandleDrawableDelegate *
+ createTouchHandleDelegate(const QMap<int, QImage> &images) override;
+
+ void showTouchSelectionMenu(QtWebEngineCore::TouchSelectionMenuController *,
+ const QRect &) override;
+ void hideTouchSelectionMenu() override;
QWebEngineViewPrivate();
-
+ virtual ~QWebEngineViewPrivate();
+ static void bindPageAndView(QWebEnginePage *page, QWebEngineView *view);
+ static void bindPageAndWidget(QWebEnginePagePrivate *pagePrivate,
+ QtWebEngineCore::WebEngineQuickWidget *widget);
+ QIcon webActionIcon(QWebEnginePage::WebAction action) const;
+ void unhandledKeyEvent(QKeyEvent *event) override;
+ void focusContainer() override;
+ bool passOnFocus(bool reverse) override;
+ bool isEnabled() const override;
+ bool isVisible() const override;
+ QRect viewportRect() const override;
QWebEnginePage *page;
+ QMetaObject::Connection m_pageConnection;
bool m_dragEntered;
mutable bool m_ownsPage;
+ QWebEngineContextMenuRequest *m_contextRequest;
+ QScopedPointer<QtWebEngineWidgetUI::AutofillPopupWidget> m_autofillPopupWidget;
+ QPointer<QtWebEngineWidgetUI::TouchSelectionMenuWidget> m_touchSelectionMenu;
};
-#ifndef QT_NO_ACCESSIBILITY
-class QWebEngineViewAccessible : public QAccessibleWidget
+class QContextMenuBuilder : public QtWebEngineCore::RenderViewContextMenuQt
{
public:
- QWebEngineViewAccessible(QWebEngineView *o) : QAccessibleWidget(o)
- {}
-
- bool isValid() const override;
- QAccessibleInterface *focusChild() const override;
- int childCount() const override;
- QAccessibleInterface *child(int index) const override;
- int indexOfChild(const QAccessibleInterface *child) const override;
+ QContextMenuBuilder(QWebEngineContextMenuRequest *request, QWebEngineView *view, QMenu *menu);
private:
- QWebEngineView *view() const { return static_cast<QWebEngineView*>(object()); }
+ virtual bool hasInspector() override;
+ virtual bool isFullScreenMode() override;
+
+ virtual void addMenuItem(ContextMenuItem entry) override;
+ virtual bool isMenuItemEnabled(ContextMenuItem entry) override;
+
+ QWebEngineView *m_view;
+ QMenu *m_menu;
};
-#endif // QT_NO_ACCESSIBILITY
QT_END_NAMESPACE
diff --git a/src/webenginewidgets/configure.json b/src/webenginewidgets/configure.json
deleted file mode 100644
index a27faf78d..000000000
--- a/src/webenginewidgets/configure.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "module": "webenginewidgets",
- "condition": "module.webenginecore && features.webengine-widgets",
- "depends": [
- "webenginecore-private"
- ],
- "commandline": {
- "options": {
- "webengine-widgets": "boolean"
- }
- },
- "features": {
- "webengine-widgets": {
- "label": "Support Qt WebEngine Widgets",
- "purpose": "Provides WebEngine Widgets support.",
- "condition": "module.widgets",
- "output": [ "privateFeature" ]
- }
- },
- "summary": [
- {
- "section": "Qt WebEngineWidgets",
- "entries": [
- "webengine-widgets"
- ]
- }
- ]
-}
diff --git a/src/webenginewidgets/doc/snippets/push-notifications/commands b/src/webenginewidgets/doc/snippets/push-notifications/commands
new file mode 100644
index 000000000..aee9761c1
--- /dev/null
+++ b/src/webenginewidgets/doc/snippets/push-notifications/commands
@@ -0,0 +1,19 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+//! [0]
+npm init -y
+npm install web-push express
+//! [0]
+
+//! [1]
+"start": "node server.js"
+//! [1]
+
+//! [2]
+./node_odules/.bin/web-push generate-vapid-keys
+//! [2]
+
+//! [3]
+npm start
+//! [3]
diff --git a/src/webenginewidgets/doc/snippets/qtwebengine_qwebenginepage_snippet.cpp b/src/webenginewidgets/doc/snippets/qtwebengine_qwebenginepage_snippet.cpp
deleted file mode 100644
index b948fa597..000000000
--- a/src/webenginewidgets/doc/snippets/qtwebengine_qwebenginepage_snippet.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-void wrapInFunction()
-{
-
-//! [0]
- m_view->page()->findText(QStringLiteral("Qt"), QWebEnginePage::FindFlags(), [this](bool found) {
- if (!found) QMessageBox::information(m_view, QString(), QStringLiteral("No occurrences found"));
- });
-//! [0]
-
-}
-
diff --git a/src/webenginewidgets/doc/snippets/qtwebengine_qwebengineview_snippet.cpp b/src/webenginewidgets/doc/snippets/qtwebengine_qwebengineview_snippet.cpp
index 5d89cb8bc..64531cf3a 100644
--- a/src/webenginewidgets/doc/snippets/qtwebengine_qwebengineview_snippet.cpp
+++ b/src/webenginewidgets/doc/snippets/qtwebengine_qwebengineview_snippet.cpp
@@ -1,29 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
void wrapInFunction()
{
diff --git a/src/webenginewidgets/doc/snippets/qtwebenginewidgets_build_snippet.qdoc b/src/webenginewidgets/doc/snippets/qtwebenginewidgets_build_snippet.qdoc
index 38366db17..f11f550ff 100644
--- a/src/webenginewidgets/doc/snippets/qtwebenginewidgets_build_snippet.qdoc
+++ b/src/webenginewidgets/doc/snippets/qtwebenginewidgets_build_snippet.qdoc
@@ -1,35 +1,11 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
//! [0]
QT += webenginewidgets
//! [0]
-
-//! [1]
-#include <QtWebEngineWidgets>
-//! [1]
+//! [2]
+find_package(Qt6 REQUIRED COMPONENTS WebEngineWidgets)
+target_link_libraries(target PRIVATE Qt6::WebEngineWidgets)
+//! [2]
diff --git a/src/webenginewidgets/doc/snippets/simple/main.cpp b/src/webenginewidgets/doc/snippets/simple/main.cpp
index acaf073ba..08613906b 100644
--- a/src/webenginewidgets/doc/snippets/simple/main.cpp
+++ b/src/webenginewidgets/doc/snippets/simple/main.cpp
@@ -1,65 +1,19 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+//! [Minimal Example]
#include <QApplication>
-#include <QUrl>
#include <QWebEngineView>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
- QWidget *parent = 0;
//! [Using QWebEngineView]
- QWebEngineView *view = new QWebEngineView(parent);
- view->load(QUrl("http://qt-project.org/"));
- view->show();
+ QWebEngineView view;
+ view.load(QUrl("https://qt-project.org/"));
+ view.resize(1024, 750);
+ view.show();
//! [Using QWebEngineView]
return app.exec();
}
+//! [Minimal Example]
diff --git a/src/webenginewidgets/doc/src/qtwebenginewidgets-examples.qdoc b/src/webenginewidgets/doc/src/qtwebenginewidgets-examples.qdoc
index a9e0e69ea..c9bd76bf4 100644
--- a/src/webenginewidgets/doc/src/qtwebenginewidgets-examples.qdoc
+++ b/src/webenginewidgets/doc/src/qtwebenginewidgets-examples.qdoc
@@ -1,35 +1,10 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\group webengine-widgetexamples
\title Qt WebEngine Widgets Examples
\brief Examples demonstrating the \QWE Widgets usage.
- \ingroup all-examples
Qt provides an integrated Web browser component based on Chromium, the popular
open source browser engine.
diff --git a/src/webenginewidgets/doc/src/qtwebenginewidgets-index.qdoc b/src/webenginewidgets/doc/src/qtwebenginewidgets-index.qdoc
index b93bc86f2..8eb28b797 100644
--- a/src/webenginewidgets/doc/src/qtwebenginewidgets-index.qdoc
+++ b/src/webenginewidgets/doc/src/qtwebenginewidgets-index.qdoc
@@ -1,29 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\page qtwebenginewidgets-index.html
@@ -34,14 +10,14 @@
\section1 Getting Started
- To include the definitions of the module's classes, use the
- following directive:
+ To link against the module, add this line to your qmake project file:
- \snippet qtwebengine_build_snippet.qdoc 1
+ \snippet qtwebenginewidgets_build_snippet.qdoc 0
- To link against the module, add this line to your qmake project file:
+ For build with CMake use the \c find_package() command to locate the needed module components
+ in the Qt6 package and \c target_link_libraries() to link against the module:
- \snippet qtwebengine_build_snippet.qdoc 0
+ \snippet qtwebenginewidgets_build_snippet.qdoc 2
\section1 Articles and Guides
diff --git a/src/webenginewidgets/doc/src/qtwebenginewidgets-module.qdoc b/src/webenginewidgets/doc/src/qtwebenginewidgets-module.qdoc
index 6f3eac5ad..ef5a1c4b5 100644
--- a/src/webenginewidgets/doc/src/qtwebenginewidgets-module.qdoc
+++ b/src/webenginewidgets/doc/src/qtwebenginewidgets-module.qdoc
@@ -1,29 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\module QtWebEngineWidgets
@@ -32,18 +8,25 @@
\ingroup modules
\ingroup qtwebengine-modules
\qtvariable webenginewidgets
+ \qtcmakepackage WebEngineWidgets
- The \QWEWidgets module provides a web browser engine as well as C++ classes to render
+ The \QWE Widgets module provides a web browser engine as well as C++ classes to render
and interact with web content.
- To include the definitions of the module's classes, use the
- following directive:
-
- \snippet qtwebenginewidgets_build_snippet.qdoc 1
-
\if !defined(qtforpython)
- To link against the module, add the following to your qmake project file:
+ To link against the module using build with qmake,
+ add the following QT variable to your qmake .pro file:
\snippet qtwebenginewidgets_build_snippet.qdoc 0
+
+ For build with CMake use the \c find_package() command to locate the needed module components
+ in the Qt6 package and \c target_link_libraries() to link against the module:
+
+ \snippet qtwebenginewidgets_build_snippet.qdoc 2
\endif
+
+ The minimum amount of code needed to load and display an HTML page requires just
+ implementing the \c QWebEngineView class.
+
+ \snippet simple/main.cpp Minimal Example
*/
diff --git a/src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc b/src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc
index 9e8cc463c..37b73c010 100644
--- a/src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc
+++ b/src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc
@@ -1,29 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\page qtwebenginewidgets-qtwebkitportingguide.html
diff --git a/src/webenginewidgets/doc/src/qwebenginehistory_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebenginehistory_lgpl.qdoc
deleted file mode 100644
index 5e3ebecb1..000000000
--- a/src/webenginewidgets/doc/src/qwebenginehistory_lgpl.qdoc
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- Copyright (C) 2015 The Qt Company Ltd.
- Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-// The documentation in this file was imported from QtWebKit and is thus constrained
-// by its LGPL license. Documentation written from scratch for new methods should be
-// placed inline in the code as usual.
-
-/*!
- \class QWebEngineHistoryItem
- \brief The QWebEngineHistoryItem class represents one item in the history of a web engine page.
- \since 5.4
- \inmodule QtWebEngineWidgets
-
- Each web engine history item represents an entry in the history stack of a web page,
- containing information about the page, its location, and the time when it was last visited.
-
- \sa QWebEngineHistory, QWebEnginePage::history()
-*/
-
-/*!
- \fn QWebEngineHistoryItem::QWebEngineHistoryItem(const QWebEngineHistoryItem &other)
- Constructs a history item from \a other. The new item and \a other
- will share their data, and modifying either this item or \a other will
- modify both instances.
-*/
-
-/*!
- \fn QWebEngineHistoryItem &QWebEngineHistoryItem::operator=(const QWebEngineHistoryItem &other)
- Assigns the \a other history item to this. This item and \a other
- will share their data, and modifying either this item or \a other will
- modify both instances.
-*/
-
-/*!
- \fn QWebEngineHistoryItem::~QWebEngineHistoryItem()
- Destroys the history item.
-*/
-
-/*!
- \fn QUrl QWebEngineHistoryItem::originalUrl() const
- Returns the original URL associated with the history item.
-
- \sa url()
-*/
-
-/*!
- \fn QUrl QWebEngineHistoryItem::url() const
- Returns the URL associated with the history item.
-
- \sa originalUrl(), title(), lastVisited()
-*/
-
-/*!
- \fn QString QWebEngineHistoryItem::title() const
- Returns the title of the page associated with the history item.
-
- \sa url(), lastVisited()
-*/
-
-/*!
- \fn QDateTime QWebEngineHistoryItem::lastVisited() const
- Returns the date and time when the page associated with the item was last visited.
-
- \sa title(), url()
-*/
-
-/*!
- \fn bool QWebEngineHistoryItem::isValid() const
- Returns whether this is a valid history item.
-*/
-
-/*!
- \class QWebEngineHistory
- \brief The QWebEngineHistory class represents the history of a web engine page.
- \since 5.4
- \inmodule QtWebEngineWidgets
-
- Each web engine page contains a history of visited pages that can be accessed
- by QWebEnginePage::history().
-
- The history uses the concept of a \e{current item}, dividing the pages visited
- into those that can be visited by navigating \e back and \e forward using the
- back() and forward() functions. The current item can be obtained by calling
- currentItem(), and an arbitrary item in the history can be made the current
- item by passing it to goToItem().
-
- A list of items describing the pages that can be visited by going back can be
- obtained by calling the backItems() function; similarly, items describing the
- pages ahead of the current page can be obtained with the forwardItems() function.
- The total list of items is obtained with the items() function.
-
- Just as with containers, functions are available to examine the history in terms
- of a list. Arbitrary items in the history can be obtained with itemAt(), the total
- number of items is given by count(), and the history can be cleared with the
- clear() function.
-
- QWebEngineHistory's state can be saved to a QDataStream using the >> operator and loaded
- by using the << operator.
-
- \sa QWebEngineHistoryItem, QWebEnginePage
-*/
-
-/*!
- \fn void QWebEngineHistory::clear()
- Clears the history.
-
- \sa count(), items()
-*/
-
-/*!
- \fn QList<QWebEngineHistoryItem> QWebEngineHistory::items() const
- Returns a list of all items currently in the history.
-
- \sa count(), clear()
-*/
-
-/*!
- \fn QList<QWebEngineHistoryItem> QWebEngineHistory::backItems(int maxItems) const
- Returns the list of items in the backwards history list.
- At most \a maxItems entries are returned.
-
- \sa forwardItems()
-*/
-
-/*!
- \fn QList<QWebEngineHistoryItem> QWebEngineHistory::forwardItems(int maxItems) const
- Returns the list of items in the forward history list.
- At most \a maxItems entries are returned.
-
- \sa backItems()
-*/
-
-/*!
- \fn bool QWebEngineHistory::canGoBack() const
- Returns \c true if there is an item preceding the current item in the history;
- otherwise returns \c false.
-
- \sa canGoForward()
-*/
-
-/*!
- \fn bool QWebEngineHistory::canGoForward() const
- Returns \c true if we have an item to go forward to; otherwise returns \c false.
-
- \sa canGoBack()
-*/
-
-/*!
- \fn void QWebEngineHistory::back()
- Sets the current item to be the previous item in the history and goes to the
- corresponding page; that is, goes back one history item.
-
- \sa forward(), goToItem()
-*/
-
-/*!
- \fn void QWebEngineHistory::forward()
- Sets the current item to be the next item in the history and goes to the
- corresponding page; that is, goes forward one history item.
-
- \sa back(), goToItem()
-*/
-
-/*!
- \fn void QWebEngineHistory::goToItem(const QWebEngineHistoryItem &item)
- Sets the current item to be the specified \a item in the history and goes to the page.
-
- \sa back(), forward()
-*/
-
-/*!
- \fn QWebEngineHistoryItem QWebEngineHistory::backItem() const
- Returns the item before the current item in the history.
-*/
-
-/*!
- \fn QWebEngineHistoryItem QWebEngineHistory::currentItem() const
- Returns the current item in the history.
-*/
-
-/*!
- \fn QWebEngineHistoryItem QWebEngineHistory::forwardItem() const
- Returns the item after the current item in the history.
-*/
-
-/*!
- \fn int QWebEngineHistory::currentItemIndex() const
- Returns the index of the current item in history.
-*/
-
-/*!
- \fn QWebEngineHistoryItem QWebEngineHistory::itemAt(int i) const
- Returns the item at index \a i in the history.
-*/
-
-/*!
- \fn int QWebEngineHistory::count() const
- Returns the total number of items in the history.
-*/
-
-/*!
- \fn QDataStream& operator<<(QDataStream& stream, const QWebEngineHistory& history)
- \relates QWebEngineHistory
-
- Saves the web engine history \a history into \a stream.
-*/
-
-
-/*!
- \fn QDataStream& operator>>(QDataStream& stream, QWebEngineHistory& history)
- \relates QWebEngineHistory
-
- Loads the web engine history from \a stream into \a history.
-*/
diff --git a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
deleted file mode 100644
index 9d5c41713..000000000
--- a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
+++ /dev/null
@@ -1,851 +0,0 @@
-/*
- Copyright (C) 2019 The Qt Company Ltd.
- Copyright (C) 2008, 2009, 2012 Nokia Corporation and/or its subsidiary(-ies)
- Copyright (C) 2007 Staikos Computing Services Inc.
- Copyright (C) 2007 Apple Inc.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-// The documentation in this file was imported from QtWebKit and is thus constrained
-// by its LGPL license. Documentation written from scratch for new methods should be
-// placed inline in the code as usual.
-
-/*!
- \class QWebEnginePage
- \brief The QWebEnginePage class provides an object to view and edit web documents.
- \since 5.4
- \inmodule QtWebEngineWidgets
-
- A \e {web engine page} holds the contents of an HTML document, the history of navigated
- links, and actions.
-
- QWebEnginePage's API is very similar to QWebEngineView, as you are still provided with
- common functions like action() (known as
- \l{QWebEngineView::pageAction()}{pageAction}() in QWebEngineView), triggerAction(),
- and findText().
-
- A page can be loaded using load() or setUrl(). Alternatively, if you have
- the HTML content readily available, you can use setHtml(). The GET method is
- always used to load URLs.
-
- The QWebEnginePage class also offers methods to retrieve both the URL currently
- loaded by the page (see url()) as well as the URL originally requested
- to be loaded (see requestedUrl()). These methods make possible the retrieval
- of the URL before and after a DNS resolution or a redirection occurs during
- the load process. The requestedUrl() also matches to the URL added to the
- page history (\l{QWebEngineHistory}) if load is successful.
-
- The title of an HTML page can be accessed with the title() property.
- Additionally, a page may also specify an icon, which can be accessed
- using the icon() or its URL using the iconUrl() property.
- If the title or the icon changes, the corresponding titleChanged(), iconChanged()
- and iconUrlChanged() signals will be emitted.
- The zoomFactor() property enables zooming the contents of the web page by a
- scale factor.
-
- The loadStarted() signal is emitted when the page begins to load, whereas the loadProgress()
- signal is emitted whenever an element of the web page completes loading, such as an embedded
- image or a script. The loadFinished() signal is emitted when the page contents
- have been loaded completely, independent of script execution or page rendering.
- Its argument, either \c true or \c false, indicates whether or not the load
- operation succeeded.
-
- An HTML document is loaded in a \e {main frame} within the web page. If it references
- \e {child frames} (as defined by the \c <frame> or \c <iframe> elements), they are considered
- part of the content. Child frames are individually accessible only through JavaScript.
-
- Web sites define \e {security origin} for safely accessing each other's resources for
- client-side scripting or databases. An origin consist of a host name, a scheme, and a port
- number. For example, the sites \c http://www.example.com/my/page.html and
- \c http://www.example.com/my/overview.html are allowed to share the same database or access
- each other's documents when used in HTML frame sets and JavaScript. At the same time,
- \c http://www.malicious.com/evil.html is prevented from accessing the resources of
- \c http://www.example.com/, because they are of a different security origin.
- By default, local schemes like \c file:// and \c qrc:// are considered to be in the same
- security origin, and can access each other's resources. Local resources are by default
- restricted from accessing remote content, which means that \c file:// will not be able to
- access \c http://domain.com/foo.html.
-
- Scripts can be executed on the web page by using runJavaScript(), either in the main
- JavaScript \e world, along with the rest of the JavaScript coming from the web contents, or in
- their own isolated world. While the DOM of the page can be accessed from any world, JavaScript
- variables of a function defined in one world are not accessible from a different one.
- QWebEngineScript::ScriptWorldId provides some predefined IDs for this purpose. Using the
- \c runJavaScript() version without the world ID is the same as running the script in the
- \c MainWorld.
-
- The \l {QWebEngineSettings::FocusOnNavigationEnabled} {FocusOnNavigationEnabled} setting can be
- used to make the view associated with the page automatically receive focus when a navigation
- operation occurs (like loading or reloading a page or navigating through history).
-*/
-
-/*!
- \enum QWebEnginePage::FindFlag
-
- This enum describes the options available to the findText() function. The options
- can be OR-ed together from the following list:
-
- \value FindBackward Searches backwards instead of forwards.
- \value FindCaseSensitively By default findText() works case insensitive. Specifying this option
- changes the behavior to a case sensitive find operation.
-*/
-
-/*!
- \enum QWebEnginePage::WebAction
-
- This enum describes the types of action which can be performed on the web page.
-
- Actions only have an effect when they are applicable.
-
- The availability of actions can be be determined by checking
- \l{QAction::}{isEnabled()} on the action returned by action().
-
- \value NoWebAction No action is triggered.
- \value Back Navigate back in the history of navigated links.
- \value Forward Navigate forward in the history of navigated links.
- \value Stop Stop loading the current page.
- \value Reload Reload the current page.
- \value ReloadAndBypassCache Reload the current page, but do not use any local cache.
- \value Cut Cut the content currently selected into the clipboard.
- \value Copy Copy the content currently selected into the clipboard.
- \value Paste Paste content from the clipboard.
- \value Undo Undo the last editing action.
- \value Redo Redo the last editing action.
- \value SelectAll Select all content. This action is only enabled when the page's content is focused.
- The focus can be forced by the JavaScript \c{window.focus()} call, or the
- \l{QWebEngineSettings::FocusOnNavigationEnabled} {FocusOnNavigationEnabled} setting
- should be enabled to get automatic focus.
- \value PasteAndMatchStyle Paste content from the clipboard with current style.
-
- \value OpenLinkInThisWindow Open the current link in the current window. (Added in Qt 5.6)
- \value OpenLinkInNewWindow Open the current link in a new window. Requires implementation of
- \l createWindow(). (Added in Qt 5.6)
- \value OpenLinkInNewTab Open the current link in a new tab. Requires implementation of
- \l createWindow(). (Added in Qt 5.6)
- \value OpenLinkInNewBackgroundTab Open the current link in a new background tab. Requires
- implementation of \l createWindow(). (Added in Qt 5.7)
- \value CopyLinkToClipboard Copy the current link to the clipboard. (Added in Qt 5.6)
-
- \value CopyImageToClipboard Copy the clicked image to the clipboard. (Added in Qt 5.6)
- \value CopyImageUrlToClipboard Copy the clicked image's URL to the clipboard. (Added in Qt 5.6)
- \value CopyMediaUrlToClipboard Copy the hovered audio or video's URL to the clipboard. (Added in Qt 5.6)
- \value ToggleMediaControls Toggle between showing and hiding the controls for the hovered audio
- or video element. (Added in Qt 5.6)
- \value ToggleMediaLoop Toggle whether the hovered audio or video should loop on completetion or
- not. (Added in Qt 5.6)
- \value ToggleMediaPlayPause Toggle the play/pause state of the hovered audio or video element.
- (Added in Qt 5.6)
- \value ToggleMediaMute Mute or unmute the hovered audio or video element. (Added in Qt 5.6)
- \value DownloadLinkToDisk Download the current link to the disk. Requires a slot for
- \l{QWebEngineProfile::}{downloadRequested()}. (Added in Qt 5.6)
- \value DownloadImageToDisk Download the highlighted image to the disk. Requires a slot for
- \l{QWebEngineProfile::}{downloadRequested()}. (Added in Qt 5.6)
- \value DownloadMediaToDisk Download the hovered audio or video to the disk. Requires a slot for
- \l{QWebEngineProfile::}{downloadRequested()}. (Added in Qt 5.6)
-
- \value InspectElement Trigger any attached Web Inspector to inspect the highlighed element.
- (Added in Qt 5.6)
- \value ExitFullScreen Exit the fullscreen mode. (Added in Qt 5.6)
- \value RequestClose Request to close the web page. If defined, the \c{window.onbeforeunload}
- handler is run, and the user can confirm or reject to close the page. If the close
- request is confirmed, \c windowCloseRequested is emitted. (Added in Qt 5.6)
- \value Unselect Clear the current selection. (Added in Qt 5.7)
- \value SavePage Save the current page to disk. MHTML is the default format that is used to store
- the web page on disk. Requires a slot for \l{QWebEngineProfile::}{downloadRequested()}.
- (Added in Qt 5.7)
- \value ViewSource Show the source of the current page in a new tab. Requires implementation of
- \l createWindow(). (Added in Qt 5.8)
-
- \value ToggleBold
- Toggles boldness for the selection or at the cursor position.
- Requires \c contenteditable="true". (Added in Qt 5.10)
- \value ToggleItalic
- Toggles italics for the selection or at the cursor position.
- Requires \c contenteditable="true". (Added in Qt 5.10)
- \value ToggleUnderline
- Toggles underlining of the selection or at the cursor position.
- Requires \c contenteditable="true". (Added in Qt 5.10)
- \value ToggleStrikethrough
- Toggles striking through the selection or at the cursor position.
- Requires \c contenteditable="true". (Added in Qt 5.10)
-
- \value AlignLeft
- Aligns the lines containing the selection or the cursor to the left.
- Requires \c contenteditable="true". (Added in Qt 5.10)
- \value AlignCenter
- Aligns the lines containing the selection or the cursor at the center.
- Requires \c contenteditable="true". (Added in Qt 5.10)
- \value AlignRight
- Aligns the lines containing the selection or the cursor to the right.
- Requires \c contenteditable="true". (Added in Qt 5.10)
- \value AlignJustified
- Stretches the lines containing the selection or the cursor so that each
- line has equal width.
- Requires \c contenteditable="true". (Added in Qt 5.10)
- \value Indent
- Indents the lines containing the selection or the cursor.
- Requires \c contenteditable="true". (Added in Qt 5.10)
- \value Outdent
- Outdents the lines containing the selection or the cursor.
- Requires \c contenteditable="true". (Added in Qt 5.10)
-
- \value InsertOrderedList
- Inserts an ordered list at the current cursor position, deleting the current selection.
- Requires \c contenteditable="true". (Added in Qt 5.10)
- \value InsertUnorderedList
- Inserts an unordered list at the current cursor position,
- deleting the current selection.
- Requires \c contenteditable="true". (Added in Qt 5.10)
- \omitvalue WebActionCount
-
-*/
-
-/*!
- \enum QWebEnginePage::WebWindowType
-
- This enum describes the types of window that can be created by the createWindow() function:
-
- \value WebBrowserWindow
- A complete web browser window.
- \value WebBrowserTab
- A web browser tab.
- \value WebDialog
- A window without decoration.
- \value WebBrowserBackgroundTab
- A web browser tab without hiding the current visible WebEngineView. (Added in Qt 5.7)
-*/
-
-/*!
- \enum QWebEnginePage::JavaScriptConsoleMessageLevel
-
- This enum describes the different severity levels a JavaScript console message can have:
-
- \value InfoMessageLevel The message is purely informative and can safely be ignored.
- \value WarningMessageLevel The message informs about unexpected behavior or errors that may
- need attention.
- \value ErrorMessageLevel The message indicates there has been an error.
-*/
-
-/*!
- \enum QWebEnginePage::FileSelectionMode
-
- This enum indicates whether the implementation of the chooseFiles() function should
- return only one file or may return multiple files:
-
- \value FileSelectOpen
- Return only one file name.
- \value FileSelectOpenMultiple
- Return multiple file names.
-
- \sa chooseFiles()
-*/
-
-/*!
- \enum QWebEnginePage::PermissionPolicy
-
- This enum describes the permission policies that the user may set for data or device access:
-
- \value PermissionUnknown It is unknown whether the user grants or denies permission.
- \value PermissionGrantedByUser The user has granted permission.
- \value PermissionDeniedByUser The user has denied permission.
-
- \sa featurePermissionRequested(), featurePermissionRequestCanceled(), setFeaturePermission(), Feature
-*/
-
-/*!
- \enum QWebEnginePage::NavigationType
-
- This enum describes the type of a navigation request:
-
- \value NavigationTypeLinkClicked The navigation request resulted from a clicked link.
- \value NavigationTypeTyped The navigation request resulted from an explicitly loaded URL.
- \value NavigationTypeFormSubmitted The navigation request resulted from a form submission.
- \value NavigationTypeBackForward The navigation request resulted from a back or forward action.
- \value NavigationTypeReload The navigation request resulted from a reload action.
- \value NavigationTypeRedirect The navigation request resulted from a content or server controlled redirect. This also includes automatic reloads. (Added in Qt 5.14)
- \value NavigationTypeOther The navigation request was triggered by other means not covered by the above.
-
- \sa acceptNavigationRequest()
-*/
-
-/*!
- \enum QWebEnginePage::Feature
-
- This enum describes the platform feature access categories that the user may be asked to grant
- or deny access to:
-
- \value Notifications
- Web notifications for the end-user.
- \value Geolocation
- Location hardware or service.
- \value MediaAudioCapture
- Audio capture devices, such as microphones.
- \value MediaVideoCapture
- Video devices, such as cameras.
- \value MediaAudioVideoCapture
- Both audio and video capture devices.
- \value MouseLock
- Mouse locking, which locks the mouse pointer to the web view and is typically used in
- games.
- \value DesktopVideoCapture
- Video output capture, that is, the capture of the user's display,
- for screen sharing purposes for example. (Added in Qt 5.10)
- \value DesktopAudioVideoCapture
- Both audio and video output capture. (Added in Qt 5.10)
-
- \sa featurePermissionRequested(), featurePermissionRequestCanceled(), setFeaturePermission(), PermissionPolicy
-
-*/
-
-/*!
- \fn QWebEnginePage::QWebEnginePage(QObject *parent)
- Constructs an empty QWebEnginePage with the parent \a parent.
-*/
-
-/*!
- \fn QWebEnginePage::~QWebEnginePage()
- Destroys the web page.
-*/
-
-/*!
- \fn QWebEngineHistory *QWebEnginePage::history() const
- Returns a pointer to the view's history of navigated web pages.
-*/
-
-/*!
- \fn void QWebEnginePage::setView(QWidget* view)
- Sets the \a view that is associated with the web page.
-
- \sa view()
-*/
-
-/*!
- \fn QWidget *QWebEnginePage::view() const
- Returns the view widget that is associated with the web page.
-
- \sa setView()
-*/
-
-/*!
- \fn QMenu *QWebEnginePage::createStandardContextMenu()
- Creates the standard context menu which is shown when
- the user clicks on the web page with the right mouse button. It is
- called from the default \l{QWidget::}{contextMenuEvent()} handler. The popup menu's
- ownership is transferred to the caller.
-
- Returns \c nullptr if the context menu data is not initialized, for example when it
- is called when there is actually no context menu requested.
- */
-
-/*!
- \fn void QWebEnginePage::javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString& message, int lineNumber, const QString& sourceID)
- This function is called when a JavaScript program tries to print the \a message to the web
- browser's console.
-
- For example, in case of evaluation errors the source URL may be provided in \a sourceID as well
- as the \a lineNumber.
-
- \a level indicates the severity of the event that triggered the message. That is, whether it
- was triggered by an error or a less severe event.
-
- Since Qt 5.6, the default implementation logs the messages in a \c js
- \l{QLoggingCategory}{logging category}.
-
- \sa{Console Logging}
-*/
-
-/*!
- \fn bool QWebEnginePage::acceptNavigationRequest(const QUrl &url, NavigationType type, bool isMainFrame)
- \since 5.5
- This function is called upon receiving a request to navigate to the specified \a url by means of
- the specified navigation type \a type. \a isMainFrame indicates whether the request corresponds
- to the main frame or a child frame. If the function returns \c true, the navigation request is
- accepted and \c url is loaded. The default implementation accepts all navigation requests.
-
- This function is called for absolute URLs that are prefixed with \c {http://} or \c {https://}
- and for unrecognized schemes, such as \c {mailto:}, which will be handled by QDesktopServices
- if accepted. To have this function called also upon receiving navigation requests to local URLs,
- prefix the URLs with \c {http://}.
-
- Navigation requests can be delegated to the Qt application instead of having the HTML handler
- engine process them by overloading this function. This is necessary when an HTML document is
- used as part of the user interface, and not to display external data, for example, when
- displaying a list of results.
-
- \note The loading process is started and the loadStarted() signal is emitted
- \e before the request is accepted or rejected. Therefore, a loadFinished()
- signal that returns \c false is to be expected even after delegating the
- request.
-
- The \l{QWebEngineUrlRequestInterceptor} class offers further options for intercepting and
- manipulating requests.
-*/
-
-/*!
- \fn void QWebEnginePage::javaScriptAlert(const QUrl &securityOrigin, const QString& msg)
- This function is called whenever a JavaScript program running in a frame affiliated with
- \a securityOrigin calls the \c alert() function with the message \a msg.
-
- The default implementation shows the message, \a msg, with QMessageBox::information.
-*/
-
-/*!
- \fn bool QWebEnginePage::javaScriptConfirm(const QUrl &securityOrigin, const QString& msg)
- This function is called whenever a JavaScript program running in a frame affiliated with
- \a securityOrigin calls the \c confirm() function with the message \a msg. Returns \c true
- if the user confirms the message; otherwise returns \c false.
-
- It is also called when the \c onbeforeunload handler is requesting a confirmation before
- leaving a page.
-
- The default implementation executes the query using QMessageBox::information with QMessageBox::Ok and QMessageBox::Cancel buttons.
-*/
-
-/*!
- \fn bool QWebEnginePage::javaScriptPrompt(const QUrl &securityOrigin, const QString& msg, const QString& defaultValue, QString* result)
- This function is called whenever a JavaScript program running in a frame affiliated with \a securityOrigin tries to prompt the user for input.
- The program may provide an optional message, \a msg, as well as a default value for the input in \a defaultValue.
-
- If the prompt was cancelled by the user, the implementation should return \c false; otherwise the
- result should be written to \a result and \c true should be returned. If the prompt was not
- cancelled by the user, the implementation should return \c true and the result string must not
- be null.
-
- The default implementation uses QInputDialog::getText().
-*/
-
-/*!
- \fn QWebEnginePage *QWebEnginePage::createWindow(WebWindowType type)
- This function is called to create a new window of the specified \a type. For example, when a
- JavaScript program requests to open a document in a new window.
-
- If the new window can be created, the new window's QWebEnginePage is returned; otherwise a null pointer is returned.
-
- If the view associated with the web page is a QWebEngineView object, then the default implementation forwards
- the request to QWebEngineView::createWindow(); otherwise it returns a null pointer.
-
- \note In the cases when the window creation is being triggered by JavaScript, apart from
- reimplementing this method the application must also set
- QWebEngineSettings::JavascriptCanOpenWindows to \c true in order for the method to get called.
-
- \sa QWebEngineView::createWindow()
-*/
-
-/*!
- \fn void QWebEnginePage::triggerAction(WebAction action, bool checked = false)
- This function can be called to trigger the specified \a action.
- It is also called by \QWE if the user triggers the action, for example
- through a context menu item.
-
- If \a action is a checkable action, then \a checked specifies whether the action
- is toggled or not.
-
- \sa action()
-*/
-
-/*!
- \property QWebEnginePage::hasSelection
- \brief Whether this page contains selected content or not.
-
- \sa selectionChanged()
-*/
-
-/*!
- \property QWebEnginePage::selectedText
- \brief The text currently selected.
-
- By default, this property contains an empty string.
-
- \sa selectionChanged()
-*/
-
-/*!
- \fn QAction *QWebEnginePage::action(WebAction action) const
- Returns a QAction for the specified WebAction \a action.
-
- The action is owned by the QWebEnginePage but you can customize the look by
- changing its properties.
-
- QWebEnginePage also takes care of implementing the action, so that upon
- triggering the corresponding action is performed on the page.
-
- \sa triggerAction()
-*/
-
-/*!
- \fn void QWebEnginePage::findText(const QString &subString, QWebEnginePage::FindFlags options = FindFlags(), const QWebEngineCallback<bool> &resultCallback = QWebEngineCallback<bool>())
- Finds the specified string, \a subString, in the page, using the given \a options.
- The findTextFinished() signal is emitted when a string search is completed.
-
- To clear the search highlight, just pass an empty string.
-
- The \a resultCallback must take a boolean parameter. It will be called with a value of \c true
- if the \a subString was found; otherwise the callback value will be \c false.
-
- \warning We guarantee that the callback (\a resultCallback) is always called, but it might be done
- during page destruction. When QWebEnginePage is deleted, the callback is triggered with an invalid
- value and it is not safe to use the corresponding QWebEnginePage or QWebEngineView instance inside it.
-
- For example:
- \snippet qtwebengine_qwebenginepage_snippet.cpp 0
-
- \sa findTextFinished()
-*/
-
-/*!
- \fn QWebEngineSettings *QWebEnginePage::settings() const
- Returns a pointer to the page's settings object.
-
- \sa QWebEngineSettings::defaultSettings()
-*/
-
-/*!
- \fn bool QWebEnginePage::certificateError(const QWebEngineCertificateError & certificateError)
- This function is called when an invalid certificate error is raised while loading a given request.
-
- The \a certificateError parameter contains information about the certificate and details of the error.
-
- Return \c true to ignore the error and complete the request. Return \c false to stop loading
- the request.
-
- \note If the error was successfully deferred then the returned value will be ignored.
-
- \sa QWebEngineCertificateError
-*/
-
-/*!
- \fn QString QWebEnginePage::chooseFiles(FileSelectionMode mode, const QStringList& oldFiles, const QStringList& acceptedMimeTypes)
- This function is called when the web content requests a file name, for example
- as a result of the user clicking on a file upload button in an HTML form.
-
- \a mode indicates whether only one file or multiple files are expected to be returned.
-
- A suggested filename may be provided as the first entry of \a oldFiles. \a acceptedMimeTypes is ignored by the default implementation,
- but might be used by overrides.
-*/
-
-/*!
- \fn void QWebEnginePage::loadStarted()
-
- This signal is emitted when a page starts loading content.
-
- \sa loadFinished(), acceptNavigationRequest()
-*/
-
-/*!
- \fn void QWebEnginePage::loadProgress(int progress)
-
- This signal is emitted when the global progress status changes.
- The current value is provided by \a progress and scales from 0 to 100,
- which is the default range of QProgressBar.
- It accumulates changes from all the child frames.
-
-*/
-
-/*!
- \fn void QWebEnginePage::loadFinished(bool ok)
-
- This signal is emitted when the page finishes loading content. This signal
- is independent of script execution or page rendering.
- \a ok will indicate whether the load was successful or any error occurred.
-
- \note Navigation requests can be delegated to the Qt application instead
- of having the HTML handler engine process them by overloading the
- acceptNavigationRequest() function. Because the loading process is started
- and the loadStarted() signal is emitted \e before the request is accepted
- or rejected, a \c loadFinished() signal that returns \c false is to be
- expected even after delegating the request.
-
- \sa loadStarted(), acceptNavigationRequest()
-*/
-
-/*!
- \fn void QWebEnginePage::selectionChanged()
-
- This signal is emitted whenever the selection changes, either interactively
- or programmatically. For example, by calling triggerAction() with a selection action.
-
- \note When using the mouse to select text by left-clicking and dragging, the signal will be
- emitted for each new character selected, and not upon releasing the left mouse button.
-
- \sa selectedText()
-*/
-
-/*!
- \fn void QWebEnginePage::linkHovered(const QString &url)
-
- This signal is emitted when the mouse hovers over a link.
- \a url contains the target URL of the link.
-*/
-
-/*!
-
- \fn void QWebEnginePage::authenticationRequired(const QUrl &requestUrl, QAuthenticator *authenticator)
-
- This signal is emitted when access to \a requestUrl requires authentication.
- \a authenticator should be used to pass the user name and password for the connection.
-*/
-
-/*!
- \fn void QWebEnginePage::proxyAuthenticationRequired(const QUrl &requestUrl, QAuthenticator *authenticator, const QString &proxyHost)
-
- This signal is emitted when access to \a requestUrl via \a proxyHost requires authentication for the proxy.
- \a authenticator should be used to pass the user name and password for the connection.
-
-*/
-
-/*!
- \fn void QWebEnginePage::geometryChangeRequested(const QRect& geom)
-
- This signal is emitted whenever the document wants to change the position and size of the
- page to \a geom. This can happen for example through JavaScript.
-
- \note \l{QWindow::}{setGeometry()} expects a size excluding the window
- decoration, while \a geom includes it. You have to remove the size of the frame margins
- from \a geom to handle this signal correctly.
-
- \code
- window->setGeometry(geom.marginsRemoved(window->frameMargins()));
- \endcode
-*/
-
-/*!
- \fn void QWebEnginePage::windowCloseRequested()
-
- This signal is emitted whenever the page requests the web browser window to be closed,
- for example through the JavaScript \c{window.close()} call.
-
- \sa RequestClose
-*/
-
-/*!
- \fn void QWebEnginePage::toHtml(const QWebEngineCallback<const QString &> &resultCallback) const
- Asynchronous method to retrieve the page's content as HTML, enclosed in HTML and BODY tags.
- Upon successful completion, \a resultCallback is called with the page's content.
-
- \note \a resultCallback can be any of a function pointer, a functor or a lambda, and it is expected to take a QString parameter.
-
- \warning We guarantee that the callback (\a resultCallback) is always called, but it might be done
- during page destruction. When QWebEnginePage is deleted, the callback is triggered with an invalid
- value and it is not safe to use the corresponding QWebEnginePage or QWebEngineView instance inside it.
-
- \sa setHtml(), toPlainText()
-*/
-
-/*!
- \fn void QWebEnginePage::toPlainText(const QWebEngineCallback<const QString &> &resultCallback) const
- Asynchronous method to retrieve the page's content converted to plain text, completely stripped of all
- HTML formatting.
- Upon successful completion, \a resultCallback is called with the page's content.
-
- \note \a resultCallback can be any of a function pointer, a functor or a lambda, and it is expected to take a QString parameter.
-
- \warning We guarantee that the callback (\a resultCallback) is always called, but it might be done
- during page destruction. When QWebEnginePage is deleted, the callback is triggered with an invalid
- value and it is not safe to use the corresponding QWebEnginePage or QWebEngineView instance inside it.
-
- \sa toHtml()
-*/
-
-/*!
- \property QWebEnginePage::title
- \brief The title of the page as defined by the HTML \c <title> element.
-
- If the page has no \c <title> element, then the URL is used instead. For \c
- file:// URLs only the filename is used and not the full path.
-
- By default, before any content has been loaded, this property contains an
- empty string.
-
- \sa titleChanged()
-*/
-
-/*!
- \property QWebEnginePage::url
- \brief The URL of the page currently viewed.
-
- Setting this property clears the view and loads the URL.
-
- By default, this property contains an empty, invalid URL.
-
- \sa urlChanged()
-*/
-
-/*!
- \property QWebEnginePage::requestedUrl
- \brief The URL that was originally requested to be loaded by the page
- that is currently viewed.
-
- \note The URL may differ from the one returned by url(), which is the actual
- URL that results from DNS resolution or redirection.
-
- \sa url(), setUrl()
-*/
-
-/*!
- \fn void QWebEnginePage::load(const QUrl &url)
- Loads \a url into this page.
-
- \note The view remains the same until enough data has arrived to display the new URL.
-
- \sa setUrl(), setHtml(), setContent()
-*/
-
-/*!
- \fn void QWebEnginePage::setHtml(const QString &html, const QUrl &baseUrl)
- Sets the content of this page to \a html. \a baseUrl is optional and used to resolve relative
- URLs in the document, such as referenced images or stylesheets.
-
- The \a html is loaded immediately; external objects are loaded asynchronously.
-
- If a script in the \a html runs longer than the default script timeout (currently 10 seconds),
- for example due to being blocked by a modal JavaScript alert dialog, this method will return
- as soon as possible after the timeout and any subsequent \a html will be loaded asynchronously.
-
- When using this method, the web engine assumes that external resources, such as JavaScript programs or style
- sheets, are encoded in UTF-8 unless otherwise specified. For example, the encoding of an external
- script can be specified through the charset attribute of the HTML script tag. It is also possible
- for the encoding to be specified by the web server.
-
- This is a convenience function equivalent to setContent(html, "text/html", baseUrl).
-
- \note This method will not affect session or global history for the page.
-
- \warning This function works only for HTML, for other mime types (such as XHTML and SVG)
- setContent() should be used instead.
-
- \warning The content will be percent encoded before being sent to the renderer via IPC.
- This may increase its size. The maximum size of the percent encoded content is
- 2 megabytes minus 30 bytes.
-
- \sa toHtml(), setContent(), load()
-*/
-
-/*!
- \fn void QWebEnginePage::setContent(const QByteArray &data, const QString &mimeType, const QUrl &baseUrl)
- Sets the content of the web page to \a data. If the \a mimeType argument
- is empty, it is assumed that the content is \c{text/plain,charset=US-ASCII}.
-
- External objects referenced in the content are located relative to \a baseUrl.
-
- The \a data is loaded immediately; external objects are loaded asynchronously.
-
- \note This method will not affect session or global history for the page.
-
- \warning The content will be percent encoded before being sent to the renderer via IPC.
- This may increase its size. The maximum size of the percent encoded content is
- 2 megabytes minus 6 bytes plus the length of the mime type string.
-
- \sa toHtml(), setHtml()
-*/
-
-/*!
- \property QWebEnginePage::zoomFactor
- \brief The zoom factor for the page content.
-
- Valid values are within the range from \c{0.25} to \c{5.0}. The default factor is \c{1.0}.
-*/
-
-/*!
- \fn void QWebEnginePage::runJavaScript(const QString &scriptSource, quint32 worldId, const QWebEngineCallback<const QVariant &> &resultCallback)
- \fn void QWebEnginePage::runJavaScript(const QString &scriptSource, quint32 worldId)
- \fn void QWebEnginePage::runJavaScript(const QString& scriptSource)
- \fn void QWebEnginePage::runJavaScript(const QString &scriptSource, const QWebEngineCallback<const QVariant &> &resultCallback)
- \since 5.7
-
- Runs the JavaScript code contained in \a scriptSource without checking
- whether the DOM of the page has been constructed. If you need more
- control over how the script is run, consider using \l scripts() instead.
-
- To avoid conflicts with other scripts executed on the page, the world in
- which the script is run is specified by \a worldId. The world ID values are
- the same as provided by QWebEngineScript::ScriptWorldId, and between \c 0
- and \c 256. If you leave out the \c world ID, the script is run in the
- \c MainWorld.
-
- When the script has been executed, \a resultCallback is called with the result of the last
- executed statement. \c resultCallback can be any of a function pointer, a functor or a lambda,
- and it is expected to take a QVariant parameter. For example:
-
- \code
- page.runJavaScript("document.title", [](const QVariant &v) { qDebug() << v.toString(); });
- \endcode
-
- Only plain data can be returned from JavaScript as the result value.
- Supported data types include all of the JSON data types as well as, for
- example, \c{Date} and \c{ArrayBuffer}. Unsupported data types include, for
- example, \c{Function} and \c{Promise}.
-
- \warning Do not execute lengthy routines in the callback function, because it might block the
- rendering of the web engine page.
-
- \warning We guarantee that the callback (\a resultCallback) is always called, but it might be done
- during page destruction. When QWebEnginePage is deleted, the callback is triggered with an invalid
- value and it is not safe to use the corresponding QWebEnginePage or QWebEngineView instance inside it.
-
- \sa scripts(), QWebEngineScript::ScriptWorldId, {Script Injection}
-*/
-
-/*!
- \fn void QWebEnginePage::setFeaturePermission(const QUrl &securityOrigin, Feature feature, PermissionPolicy policy)
-
- Sets the permission for the web site identified by \a securityOrigin to use \a feature to \a policy.
-
- \note This method is primarily for calling after a featurePermissionRequested() signal has been emitted
- to trigger the feature permission response. It can also be called before a request has been emitted,
- but will only set a granted permission for passive checks, mainly for Notification APIs that can check
- if permission has already been granted before explicitly requesting it.
-
- \sa featurePermissionRequested(), featurePermissionRequestCanceled()
-*/
-
-/*!
- \fn void QWebEnginePage::featurePermissionRequested(const QUrl &securityOrigin, Feature feature)
-
- This signal is emitted when the web site identified by \a securityOrigin requests to make use of
- the resource or device identified by \a feature.
-
- \sa featurePermissionRequestCanceled(), setFeaturePermission()
-*/
-
-/*!
- \fn void QWebEnginePage::featurePermissionRequestCanceled(const QUrl &securityOrigin, Feature feature)
-
- This signal is emitted when the web site identified by \a securityOrigin cancels a previously issued
- request to make use of \a feature.
-
- \sa featurePermissionRequested(), setFeaturePermission()
-
-*/
-
-/*!
- \fn void QWebEnginePage::titleChanged(const QString &title)
-
- This signal is emitted whenever the title of the page changes.
- The \a title string specifies the new title.
-
- \sa title()
-*/
-
-/*!
- \fn void QWebEnginePage::urlChanged(const QUrl &url)
-
- This signal is emitted with the URL of the page when the page title is
- received. The new URL is specified by \a url.
-
- \sa url()
-*/
diff --git a/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc
deleted file mode 100644
index b83da9440..000000000
--- a/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc
+++ /dev/null
@@ -1,310 +0,0 @@
-/*
- Copyright (C) 2015 The Qt Company Ltd.
- Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-// The documentation in this file was imported from QtWebKit and is thus constrained
-// by its LGPL license. Documentation written from scratch for new methods should be
-// placed inline in the code as usual.
-
-#if QT_DEPRECATED_SINCE(5, 5)
-/*!
- \fn static QWebEngineSettings *QWebEngineSettings::globalSettings()
- \obsolete
-
- Use defaultSettings() instead.
-*/
-#endif
-
-/*!
- \class QWebEngineSettings
- \since 5.4
- \brief The QWebEngineSettings class provides an object to store the settings used
- by QWebEnginePage.
-
- \inmodule QtWebEngineWidgets
-
- QWebEngineSettings allows configuration of browser properties, such as font sizes and
- families, the location of a custom style sheet, and generic attributes, such as JavaScript
- support. Individual attributes are set using the setAttribute() function. The
- \l{QWebEngineSettings::WebAttribute}{WebAttribute} enum further describes each attribute.
-
- Each QWebEnginePage object has its own QWebEngineSettings object, which configures the
- settings for that page. If a setting is not configured for a web engine
- page, it is looked up in the settings of the profile the page belongs to.
-
- \sa QWebEnginePage::settings(), QWebEngineView::settings()
-*/
-
-/*!
- \enum QWebEngineSettings::FontFamily
-
- This enum describes the generic font families defined by CSS 2.
- For more information see the
- \l{http://www.w3.org/TR/REC-CSS2/fonts.html#generic-font-families}{CSS standard}.
-
- \value StandardFont
- \value FixedFont
- \value SerifFont
- \value SansSerifFont
- \value CursiveFont
- \value FantasyFont
- \value PictographFont
- (added in Qt 5.7)
-*/
-
-/*!
- \enum QWebEngineSettings::FontSize
-
- This enum describes the font sizes configurable through QWebEngineSettings:
-
- \value MinimumFontSize The hard minimum font size.
- \value MinimumLogicalFontSize The minimum logical font size that is applied
- when zooming out.
- \value DefaultFontSize The default font size for regular text.
- \value DefaultFixedFontSize The default font size for fixed-pitch text.
-*/
-
-/*!
- \enum QWebEngineSettings::WebAttribute
-
- This enum type specifies settings for web pages:
-
- \value AutoLoadImages
- Automatically dowloads images for web pages. When this setting is
- disabled, images are loaded from the cache. Enabled by default.
- \value JavascriptEnabled
- Enables the running of JavaScript programs in the
- \l{QWebEngineScript::MainWorld}{MainWorld}. Enabled by default.
- \value JavascriptCanOpenWindows
- Allows JavaScript programs to open popup windows without user
- interaction. Enabled by default.
- \value JavascriptCanAccessClipboard
- Allows JavaScript programs to read from and write to the clipboard.
- Writing to the clipboard is always allowed if it is specifically requested by the user.
- See JavascriptCanPaste to also allow pasting the content of the clipboard content from
- JavaScript.
- Disabled by default.
- \value LinksIncludedInFocusChain
- Includes hyperlinks in the keyboard focus chain. Enabled by default.
- \value LocalStorageEnabled
- Enables support for the HTML 5 local storage feature. Enabled by default.
- \value LocalContentCanAccessRemoteUrls
- Allows locally loaded documents to ignore cross-origin rules so that they can access
- remote resources that would normally be blocked, because all remote resources are
- considered cross-origin for a local file. Remote access that would not be blocked by
- cross-origin rules is still possible when this setting is disabled (default).
- Note that disabling this setting does not stop XMLHttpRequests or media elements in
- local files from accessing remote content. Basically, it only stops some HTML
- subresources, such as scripts, and therefore disabling this setting is not a safety
- mechanism.
- \value XSSAuditingEnabled
- Obsolete and has no effect.
- \value SpatialNavigationEnabled
- Enables the Spatial Navigation feature, which means the ability to navigate between
- focusable elements, such as hyperlinks and form controls, on a web page by using the
- Left, Right, Up and Down arrow keys. For example, if a user presses the
- Right key, heuristics determine whether there is an element they might be
- trying to reach towards the right and which element they probably want.
- Disabled by default.
- \value LocalContentCanAccessFileUrls
- Allows locally loaded documents to access other local URLs. Enabled by default.
- \value HyperlinkAuditingEnabled
- Enables support for the \c ping attribute for hyperlinks. Disabled by default.
- \value ScrollAnimatorEnabled
- Enables animated scrolling. Disabled by default.
- \value ErrorPageEnabled
- Enables displaying the built-in error pages of Chromium. Enabled by default.
- \value PluginsEnabled
- Enables support for Pepper plugins, such as the Flash player. Disabled by default.
- See also \l{Pepper Plugin API}. (Added in Qt 5.6)
- \value FullScreenSupportEnabled
- Enables fullscreen support in an application. Disabled by default. (Added in Qt 5.6)
- \value ScreenCaptureEnabled
- Enables screen capture in an application. Disabled by default. (Added in Qt 5.7)
- \value WebGLEnabled
- Enables support for HTML 5 WebGL. Enabled by default if available. (Added in Qt 5.7)
- \value Accelerated2dCanvasEnabled
- Specifies whether the HTML5 2D canvas should be a OpenGL framebuffer.
- This makes many painting operations faster, but slows down pixel access. Enabled by default if available. (Added in Qt 5.7)
- \value AutoLoadIconsForPage
- Automatically downloads icons for web pages. Enabled by default. (Added in Qt 5.7)
- \value TouchIconsEnabled
- Enables support for touch icons and precomposed touch icons
- Disabled by default. (Added in Qt 5.7)
- \value FocusOnNavigationEnabled
- Gives focus to the view associated with the page, whenever a navigation operation occurs
- (load, stop, reload, reload and bypass cache, forward, backward, set content, and so
- on).
- Disabled by default. (Added in Qt 5.8)
- \value PrintElementBackgrounds
- Turns on printing of CSS backgrounds when printing a web page.
- Enabled by default. (Added in Qt 5.8)
- \value AllowRunningInsecureContent
- By default, HTTPS pages cannot run JavaScript, CSS, plugins or
- web-sockets from HTTP URLs. This provides an override to get
- the old insecure behavior.
- Disabled by default. (Added in Qt 5.8)
- \value AllowGeolocationOnInsecureOrigins
- Since Qt 5.7, only secure origins such as HTTPS have been able to request
- Geolocation features. This provides an override to allow non secure
- origins to access Geolocation again.
- Disabled by default. (Added in Qt 5.9)
- \value AllowWindowActivationFromJavaScript
- Allows activating windows by using the window.focus() JavaScript
- method. Disabled by default.
- (Added in Qt 5.10)
- \value ShowScrollBars
- Shows scroll bars.
- Enabled by default. (Added in Qt 5.10)
- \value PlaybackRequiresUserGesture
- Inhibits playback of media content until the user interacts with
- the page. By default, WebEngine uses Chromium settings, as described
- in \l {Autoplay Policy Changes}. This is similar to how Chrome on
- Android behaves, while the default behavior when it is disabled is
- similar to Chrome on desktops. To overwrite the default behavior,
- disable this setting. (Added in Qt 5.11)
- \value JavascriptCanPaste
- Enables JavaScript \c{execCommand("paste")}. This also requires
- enabling JavascriptCanAccessClipboard.
- Disabled by default. (Added in Qt 5.11)
- \value WebRTCPublicInterfacesOnly
- Limits WebRTC to public IP addresses only. When disabled WebRTC may also use
- local network IP addresses, but remote hosts can also see your local network
- IP address.
- Disabled by default. (Added in Qt 5.11)
- \value DnsPrefetchEnabled Specifies whether WebEngine will try to pre-fetch DNS entries to
- speed up browsing.
- Disabled by default. (Added in Qt 5.12)
- \value PdfViewerEnabled Specifies that PDF documents will be opened in the internal PDF viewer
- instead of being downloaded.
- Enabled by default. (Added in Qt 5.13)
-*/
-
-/*!
- \enum QWebEngineSettings::UnknownUrlSchemePolicy
- \since Qt 5.11
-
- This enum describes how navigation requests to URLs with unknown schemes are handled.
-
- \value DisallowUnknownUrlSchemes
- Disallows all navigation requests to URLs with unknown schemes.
- \value AllowUnknownUrlSchemesFromUserInteraction
- Allows navigation requests to URLs with unknown schemes that are issued from
- user-interaction (like a mouse-click), whereas other navigation requests (for example
- from JavaScript) are suppressed.
- \value AllowAllUnknownUrlSchemes
- Allows all navigation requests to URLs with unknown schemes.
-
- \sa unknownUrlSchemePolicy setUnknownUrlSchemePolicy resetUnknownUrlSchemePolicy
-*/
-
-/*!
- \fn void QWebEngineSettings::setFontSize(FontSize type, int size)
- Sets the font size for \a type to \a size in pixels.
-*/
-
-/*!
- \fn int QWebEngineSettings::fontSize(FontSize type) const
- Returns the default font size for \a type in pixels.
-*/
-
-/*!
- \fn void QWebEngineSettings::resetFontSize(FontSize type)
- Resets the font size for \a type to the size specified in the profile that
- the page belongs to.
-*/
-
-/*!
- \fn void QWebEngineSettings::setDefaultTextEncoding(const QString& encoding)
- Specifies the default text encoding system.
-
- The value of \a encoding must be a string describing an encoding such as "utf-8" or
- "iso-8859-1". If left empty, a default value will be used. For a more
- extensive list of encoding names see \l{QTextCodec}.
-
- \sa defaultTextEncoding()
-*/
-
-/*!
- \fn QString QWebEngineSettings::defaultTextEncoding() const
- Returns the default text encoding.
-
- \sa setDefaultTextEncoding()
-*/
-
-/*!
- \fn void QWebEngineSettings::setFontFamily(FontFamily which, const QString& family)
- Sets the actual font family to \a family for the specified generic family,
- \a which.
-*/
-
-/*!
- \fn QString QWebEngineSettings::fontFamily(FontFamily which) const
- Returns the actual font family for the specified generic font family,
- \a which.
-*/
-
-/*!
- \fn void QWebEngineSettings::resetFontFamily(FontFamily which)
- Resets the actual font family specified by \a which to the one specified
- in the profile that the page belongs to.
-*/
-
-/*!
- \fn QWebEngineSettings::UnknownUrlSchemePolicy QWebEngineSettings::unknownUrlSchemePolicy() const
- \since Qt 5.11
- Returns the currently selected policy for handling navigation requests to URLs with
- unknown schemes. Default is \l{QWebEngineSettings::AllowUnknownUrlSchemesFromUserInteraction}.
- \sa setUnknownUrlSchemePolicy resetUnknownUrlSchemePolicy
-*/
-
-/*!
- \fn void QWebEngineSettings::setUnknownUrlSchemePolicy(QWebEngineSettings::UnknownUrlSchemePolicy policy)
- \since Qt 5.11
- Sets the policy for handling navigation requests to URLs with unknown schemes to \a policy.
- Default is \l{QWebEngineSettings::AllowUnknownUrlSchemesFromUserInteraction}.
- \sa unknownUrlSchemePolicy resetUnknownUrlSchemePolicy
-*/
-
-/*!
- \fn void QWebEngineSettings::resetUnknownUrlSchemePolicy()
- \since Qt 5.11
- Removes the policy for handling navigation requests to URLs with unknown schemes.
- \sa unknownUrlSchemePolicy setUnknownUrlSchemePolicy
-*/
-
-/*!
- \fn void QWebEngineSettings::setAttribute(WebAttribute attribute, bool on)
-
- Enables or disables the specified \a attribute feature depending on the
- value of \a on.
-*/
-
-/*!
- \fn bool QWebEngineSettings::testAttribute(WebAttribute attribute) const
-
- Returns \c true if \a attribute is enabled; otherwise returns \c false.
-*/
-
-/*!
- \fn void QWebEngineSettings::resetAttribute(WebAttribute attribute)
-
- Resets the setting of \a attribute to the value specified in the
- profile that the page belongs to.
-*/
diff --git a/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc
index 3f1b6e509..3153ec952 100644
--- a/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc
+++ b/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc
@@ -1,24 +1,8 @@
-/*
- Copyright (C) 2019 The Qt Company Ltd.
- Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
- Copyright (C) 2008 Holger Hans Peter Freyther
- Copyright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
+// Copyright (C) 2019 The Qt Company Ltd.
+// Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+// Copyright (C) 2008 Holger Hans Peter Freyther
+// Copyright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in>
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
// The documentation in this file was imported from QtWebKit and is thus constrained
// by its LGPL license. Documentation written from scratch for new methods should be
@@ -77,7 +61,7 @@
new windows, such as pop-up windows, you can subclass QWebEngineView and
reimplement the createWindow() function.
- \sa {WebEngine Widgets Simple Browser Example}, {WebEngine Content Manipulation Example}, {WebEngine Markdown Editor Example}
+ \sa {WebEngine Widgets Simple Browser Example}, {WebEngine Content Manipulation Example}
*/
@@ -124,9 +108,8 @@
\fn void QWebEngineView::setHtml(const QString &html, const QUrl &baseUrl)
Sets the content of the web view to the specified \a html content.
- External objects, such as stylesheets or images referenced in the HTML
- document, are located relative to \a baseUrl. For external objects to
- be loaded, \c baseUrl cannot be empty. For example, if \a html
+ \a baseUrl is optional and used to resolve relative URLs in the document,
+ such as referenced images or stylesheets. For example, if \a html
is retrieved from \c http://www.example.com/documents/overview.html, which
is the base URL, then an image referenced with the relative URL, \c diagram.png,
should be at \c{http://www.example.com/documents/diagram.png}.
@@ -160,7 +143,7 @@
is empty, it is assumed that the content is \c{text/plain,charset=US-ASCII}.
External objects referenced in the content are located relative to \a baseUrl.
- For external objects to be loaded, \c baseUrl cannot be empty.
+ For external objects with relative URLs to be loaded, \c baseUrl cannot be empty.
The data is loaded immediately; external objects are loaded asynchronously.
@@ -226,6 +209,7 @@
/*!
\fn QAction *QWebEngineView::pageAction(QWebEnginePage::WebAction action) const
Returns a pointer to a QAction that encapsulates the specified web action \a action.
+ This function will also set a default styled icon to the QAction if it lacks one.
*/
/*!
@@ -249,13 +233,12 @@
*/
/*!
- \fn void QWebEngineView::findText(const QString &subString, QWebEnginePage::FindFlags options = QWebEnginePage::FindFlags(), const QWebEngineCallback<bool> &resultCallback = QWebEngineCallback<bool>())
+ \fn void QWebEngineView::findText(const QString &subString, QWebEnginePage::FindFlags options = {}, const std::function<void(const QWebEngineFindTextResult &)> &resultCallback = std::function<void(const QWebEngineFindTextResult &)>)
Finds the specified string, \a subString, in the page, using the given \a options.
To clear the selection, just pass an empty string.
- \a resultCallback must take a boolean parameter. It will be called with a value of \c true
- if \a subString was found; otherwise the callback value will be \c false.
+ The \a resultCallback must take a QWebEngineFindTextResult parameter.
\warning We guarantee that the callback (\a resultCallback) is always called, but it might be done
during page destruction. When QWebEnginePage is deleted, the callback is triggered with an invalid
@@ -392,6 +375,4 @@
It is equivalent to:
\snippet qtwebengine_qwebengineview_snippet.cpp 6
-
- \sa QWebEngineSettings::defaultSettings()
*/
diff --git a/src/webenginewidgets/plugins/qwebengineview/CMakeLists.txt b/src/webenginewidgets/plugins/qwebengineview/CMakeLists.txt
new file mode 100644
index 000000000..0e7644bf7
--- /dev/null
+++ b/src/webenginewidgets/plugins/qwebengineview/CMakeLists.txt
@@ -0,0 +1,25 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_plugin(QWebEngineViewPlugin
+ OUTPUT_NAME qwebengineview
+ PLUGIN_TYPE designer
+ SOURCES
+ qwebengineview_plugin.cpp qwebengineview_plugin.h
+ LIBRARIES
+ Qt::Core
+ Qt::Designer
+ Qt::Gui
+ Qt::WebEngineWidgets
+)
+
+set(qwebengineview_plugin_resource_files
+ "images/qwebengineview.png"
+)
+
+qt_internal_add_resource(QWebEngineViewPlugin "qwebengineview_plugin"
+ PREFIX
+ "/qt-project.org/qwebengineview"
+ FILES
+ ${qwebengineview_plugin_resource_files}
+)
diff --git a/src/plugins/qwebengineview/images/qwebengineview.png b/src/webenginewidgets/plugins/qwebengineview/images/qwebengineview.png
index 01a0920c9..01a0920c9 100644
--- a/src/plugins/qwebengineview/images/qwebengineview.png
+++ b/src/webenginewidgets/plugins/qwebengineview/images/qwebengineview.png
Binary files differ
diff --git a/src/webenginewidgets/plugins/qwebengineview/qwebengineview_plugin.cpp b/src/webenginewidgets/plugins/qwebengineview/qwebengineview_plugin.cpp
new file mode 100644
index 000000000..6ba64a178
--- /dev/null
+++ b/src/webenginewidgets/plugins/qwebengineview/qwebengineview_plugin.cpp
@@ -0,0 +1,102 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qwebengineview_plugin.h"
+
+#include <QtDesigner/QExtensionFactory>
+#include <QtDesigner/QExtensionManager>
+
+#include <QtCore/qplugin.h>
+#include <QtQuick/QQuickWindow>
+#include <QWebEngineView>
+
+QT_BEGIN_NAMESPACE
+
+static const char toolTipC[] =
+ QT_TRANSLATE_NOOP(QWebEngineViewPlugin,
+ "A widget for displaying a web page, from the Qt WebEngineWidgets module");
+
+QWebEngineViewPlugin::QWebEngineViewPlugin(QObject *parent) :
+ QObject(parent),
+ m_initialized(false)
+{
+}
+
+QString QWebEngineViewPlugin::name() const
+{
+ return QStringLiteral("QWebEngineView");
+}
+
+QString QWebEngineViewPlugin::group() const
+{
+ return QStringLiteral("Display Widgets");
+}
+
+QString QWebEngineViewPlugin::toolTip() const
+{
+ return tr(toolTipC);
+}
+
+QString QWebEngineViewPlugin::whatsThis() const
+{
+ return tr(toolTipC);
+}
+
+QString QWebEngineViewPlugin::includeFile() const
+{
+ return QStringLiteral("<QtWebEngineWidgets/QWebEngineView>");
+}
+
+QIcon QWebEngineViewPlugin::icon() const
+{
+ return QIcon(QStringLiteral(":/qt-project.org/qwebengineview/images/qwebengineview.png"));
+}
+
+bool QWebEngineViewPlugin::isContainer() const
+{
+ return false;
+}
+
+QWidget *QWebEngineViewPlugin::createWidget(QWidget *parent)
+{
+ if (parent)
+ return new QWebEngineView(parent);
+ return new fake::QWebEngineView;
+}
+
+bool QWebEngineViewPlugin::isInitialized() const
+{
+ return m_initialized;
+}
+
+void QWebEngineViewPlugin::initialize(QDesignerFormEditorInterface * /*core*/)
+{
+ if (m_initialized)
+ return;
+
+ m_initialized = true;
+}
+
+QString QWebEngineViewPlugin::domXml() const
+{
+ return QStringLiteral("\
+ <ui language=\"c++\">\
+ <widget class=\"QWebEngineView\" name=\"webEngineView\">\
+ <property name=\"url\">\
+ <url>\
+ <string>about:blank</string>\
+ </url>\
+ </property>\
+ <property name=\"geometry\">\
+ <rect>\
+ <x>0</x>\
+ <y>0</y>\
+ <width>300</width>\
+ <height>200</height>\
+ </rect>\
+ </property>\
+ </widget>\
+ </ui>");
+}
+
+QT_END_NAMESPACE
diff --git a/src/webenginewidgets/plugins/qwebengineview/qwebengineview_plugin.h b/src/webenginewidgets/plugins/qwebengineview/qwebengineview_plugin.h
new file mode 100644
index 000000000..a7150151d
--- /dev/null
+++ b/src/webenginewidgets/plugins/qwebengineview/qwebengineview_plugin.h
@@ -0,0 +1,71 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QWEBENGINEVIEW_PLUGIN_H
+#define QWEBENGINEVIEW_PLUGIN_H
+
+#include <QtUiPlugin/QDesignerCustomWidgetInterface>
+#include <QtWidgets/QWidget>
+#include <QtGui/QIcon>
+#include <QtCore/QUrl>
+
+QT_BEGIN_NAMESPACE
+
+namespace fake {
+// A lightweight "fake" QWebEngineView class that is returned when Qt Designer
+// queries the default property values by calling
+// QDesignerCustomWidgetInterface::createWidget() with 0 parent, preventing
+// crashes during QWebEngine initialization (QTBUG-53984).
+// The property list needs to be kept in sync with QWebEngineView.
+class QWebEngineView : public QWidget {
+ Q_OBJECT
+ Q_PROPERTY(QString title READ title)
+ Q_PROPERTY(QUrl url READ url WRITE setUrl) // Designable
+ Q_PROPERTY(QUrl iconUrl READ iconUrl)
+ Q_PROPERTY(QIcon icon READ icon)
+ Q_PROPERTY(QString selectedText READ selectedText)
+ Q_PROPERTY(bool hasSelection READ hasSelection)
+ Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor) // Designable
+
+public:
+ explicit QWebEngineView(QWidget *parent = nullptr) : QWidget(parent) {}
+
+ QString title() const { return QString(); }
+ QUrl url() const { return QUrl(); }
+ void setUrl(const QUrl &) {}
+ QUrl iconUrl() const { return QUrl(); }
+ QIcon icon() const { return QIcon(); }
+ QString selectedText() { return QString(); }
+ bool hasSelection() { return false; }
+ qreal zoomFactor() const { return 1; }
+ void setZoomFactor(qreal) {}
+};
+} // namespace fake
+
+class QWebEngineViewPlugin: public QObject, public QDesignerCustomWidgetInterface
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDesignerCustomWidgetInterface")
+ Q_INTERFACES(QDesignerCustomWidgetInterface)
+public:
+ explicit QWebEngineViewPlugin(QObject *parent = nullptr);
+
+ QString name() const override;
+ QString group() const override;
+ QString toolTip() const override;
+ QString whatsThis() const override;
+ QString includeFile() const override;
+ QIcon icon() const override;
+ bool isContainer() const override;
+ QWidget *createWidget(QWidget *parent) override;
+ bool isInitialized() const override;
+ void initialize(QDesignerFormEditorInterface *core) override;
+ QString domXml() const override;
+
+private:
+ bool m_initialized;
+};
+
+QT_END_NAMESPACE
+
+#endif // QWEBENGINEVIEW_PLUGIN_H
diff --git a/src/webenginewidgets/printer_worker.cpp b/src/webenginewidgets/printer_worker.cpp
deleted file mode 100644
index 8e1c2a985..000000000
--- a/src/webenginewidgets/printer_worker.cpp
+++ /dev/null
@@ -1,159 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "printer_worker.h"
-
-#include "printing/pdfium_document_wrapper_qt.h"
-
-#include <QPainter>
-#include <QPrinter>
-
-namespace QtWebEngineCore {
-
-PrinterWorker::PrinterWorker(QSharedPointer<QByteArray> data, QPrinter *printer)
- : m_data(data)
- , m_printer(printer)
-{
-}
-
-PrinterWorker::~PrinterWorker()
-{
-}
-
-void PrinterWorker::print()
-{
- if (!m_data->size()) {
- qWarning("Failure to print on printer %ls: Print result data is empty.",
- qUtf16Printable(m_printer->printerName()));
- Q_EMIT resultReady(false);
- return;
- }
-
- PdfiumDocumentWrapperQt pdfiumWrapper(m_data->constData(), m_data->size());
-
- int toPage = m_printer->toPage();
- int fromPage = m_printer->fromPage();
- bool ascendingOrder = true;
-
- if (fromPage == 0 && toPage == 0) {
- fromPage = 1;
- toPage = pdfiumWrapper.pageCount();
- }
- fromPage = qMax(1, fromPage);
- toPage = qMin(pdfiumWrapper.pageCount(), toPage);
-
- if (m_printer->pageOrder() == QPrinter::LastPageFirst) {
- qSwap(fromPage, toPage);
- ascendingOrder = false;
- }
-
- int pageCopies = 1;
- int documentCopies = 1;
-
- if (!m_printer->supportsMultipleCopies())
- documentCopies = m_printer->copyCount();
-
- if (m_printer->collateCopies()) {
- pageCopies = documentCopies;
- documentCopies = 1;
- }
-
- qreal resolution = m_printer->resolution() / 72.0; // pdfium uses points so 1/72 inch
-
- QPainter painter;
-
- for (int printedDocuments = 0; printedDocuments < documentCopies; printedDocuments++) {
- if (printedDocuments > 0)
- m_printer->newPage();
-
- int currentPageIndex = fromPage;
-
- for (int i = 0; true; i++) {
- QSizeF documentSize = (pdfiumWrapper.pageSize(currentPageIndex - 1) * resolution);
- bool isLandscape = documentSize.width() > documentSize.height();
- m_printer->setPageOrientation(isLandscape ? QPageLayout::Landscape : QPageLayout::Portrait);
- QRectF pageRect = m_printer->pageRect(QPrinter::DevicePixel);
- documentSize = documentSize.scaled(pageRect.size(), Qt::KeepAspectRatio);
-
- // setPageOrientation has to be called before qpainter.begin() or before qprinter.newPage() so correct metrics is used,
- // therefore call begin now for only first page
- if (!painter.isActive() && !painter.begin(m_printer)) {
- qWarning("Failure to print on printer %ls: Could not open printer for painting.",
- qUtf16Printable(m_printer->printerName()));
- Q_EMIT resultReady(false);
- return;
- }
-
- if (i > 0)
- m_printer->newPage();
-
- for (int printedPages = 0; printedPages < pageCopies; printedPages++) {
- if (m_printer->printerState() == QPrinter::Aborted
- || m_printer->printerState() == QPrinter::Error) {
- Q_EMIT resultReady(false);
- return;
- }
-
- if (printedPages > 0)
- m_printer->newPage();
-
- QImage currentImage = pdfiumWrapper.pageAsQImage(currentPageIndex - 1,documentSize.width(),documentSize.height());
- if (currentImage.isNull()) {
- Q_EMIT resultReady(false);
- return;
- }
- painter.drawImage(0,0, currentImage);
- }
-
- if (currentPageIndex == toPage)
- break;
-
- if (ascendingOrder)
- currentPageIndex++;
- else
- currentPageIndex--;
- }
- }
- painter.end();
-
- Q_EMIT resultReady(true);
- return;
-}
-
-} // namespace QtWebEngineCore
diff --git a/src/webenginewidgets/printer_worker.h b/src/webenginewidgets/printer_worker.h
deleted file mode 100644
index 96025c90e..000000000
--- a/src/webenginewidgets/printer_worker.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#ifndef PRINTER_WORKER_H
-#define PRINTER_WORKER_H
-
-#include "qtwebenginecoreglobal_p.h"
-
-#include <QSharedPointer>
-
-QT_BEGIN_NAMESPACE
-class QPrinter;
-QT_END_NAMESPACE
-
-namespace QtWebEngineCore {
-
-class PrinterWorker : public QObject
-{
- Q_OBJECT
-public:
- PrinterWorker(QSharedPointer<QByteArray> data, QPrinter *printer);
- virtual ~PrinterWorker();
-
-public Q_SLOTS:
- void print();
-
-Q_SIGNALS:
- void resultReady(bool success);
-
-private:
- Q_DISABLE_COPY(PrinterWorker)
-
- QSharedPointer<QByteArray> m_data;
- QPrinter *m_printer;
-};
-
-} // namespace QtWebEngineCore
-
-Q_DECLARE_METATYPE(QtWebEngineCore::PrinterWorker*)
-
-#endif // PRINTER_WORKER_H
diff --git a/src/webenginewidgets/qwebengine_accessible.cpp b/src/webenginewidgets/qwebengine_accessible.cpp
new file mode 100644
index 000000000..6880a5a3a
--- /dev/null
+++ b/src/webenginewidgets/qwebengine_accessible.cpp
@@ -0,0 +1,102 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qwebengine_accessible.h"
+
+#include "qwebengineview.h"
+#include "qwebengineview_p.h"
+
+#include "web_contents_adapter.h"
+
+QT_BEGIN_NAMESPACE
+
+QWebEngineViewAccessible::QWebEngineViewAccessible(QWebEngineView *o) : QAccessibleWidget(o)
+{
+}
+
+bool QWebEngineViewAccessible::isValid() const
+{
+ if (!QAccessibleWidget::isValid())
+ return false;
+
+ if (!view() || !view()->d_func() || !view()->d_func()->page || !view()->d_func()->page->d_func())
+ return false;
+
+ return true;
+}
+
+QAccessibleInterface *QWebEngineViewAccessible::focusChild() const
+{
+ if (child(0) && child(0)->focusChild())
+ return child(0)->focusChild();
+ return const_cast<QWebEngineViewAccessible *>(this);
+}
+
+int QWebEngineViewAccessible::childCount() const
+{
+ return child(0) ? 1 : 0;
+}
+
+QAccessibleInterface *QWebEngineViewAccessible::child(int index) const
+{
+ if (index == 0 && isValid())
+ return view()->page()->d_func()->adapter->browserAccessible();
+ return nullptr;
+}
+
+int QWebEngineViewAccessible::indexOfChild(const QAccessibleInterface *c) const
+{
+ if (child(0) && c == child(0))
+ return 0;
+ return -1;
+}
+
+QWebEngineView *QWebEngineViewAccessible::view() const
+{
+ return static_cast<QWebEngineView *>(object());
+}
+
+QT_END_NAMESPACE
+
+namespace QtWebEngineCore {
+
+RenderWidgetHostViewQtDelegateWidgetAccessible::RenderWidgetHostViewQtDelegateWidgetAccessible(QWidget *o, QWebEngineView *view)
+ : QAccessibleWidget(o)
+ , m_view(view)
+{
+}
+
+bool RenderWidgetHostViewQtDelegateWidgetAccessible::isValid() const
+{
+ if (!viewAccessible() || !viewAccessible()->isValid())
+ return false;
+
+ return QAccessibleWidget::isValid();
+}
+
+QAccessibleInterface *RenderWidgetHostViewQtDelegateWidgetAccessible::focusChild() const
+{
+ return viewAccessible()->focusChild();
+}
+
+int RenderWidgetHostViewQtDelegateWidgetAccessible::childCount() const
+{
+ return viewAccessible()->childCount();
+}
+
+QAccessibleInterface *RenderWidgetHostViewQtDelegateWidgetAccessible::child(int index) const
+{
+ return viewAccessible()->child(index);
+}
+
+int RenderWidgetHostViewQtDelegateWidgetAccessible::indexOfChild(const QAccessibleInterface *c) const
+{
+ return viewAccessible()->indexOfChild(c);
+}
+
+QWebEngineViewAccessible *RenderWidgetHostViewQtDelegateWidgetAccessible::viewAccessible() const
+{
+ return static_cast<QWebEngineViewAccessible *>(QAccessible::queryAccessibleInterface(m_view));
+}
+
+} // namespace QtWebEngineCore
diff --git a/src/webenginewidgets/qwebengine_accessible.h b/src/webenginewidgets/qwebengine_accessible.h
new file mode 100644
index 000000000..f47996cf7
--- /dev/null
+++ b/src/webenginewidgets/qwebengine_accessible.h
@@ -0,0 +1,49 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QWEBENGINE_ACCESSIBLE_H
+#define QWEBENGINE_ACCESSIBLE_H
+
+#include <QtCore/QPointer>
+#include <QtWidgets/QAccessibleWidget>
+
+QT_BEGIN_NAMESPACE
+class QWebEngineView;
+
+class QWebEngineViewAccessible : public QAccessibleWidget
+{
+public:
+ QWebEngineViewAccessible(QWebEngineView *o);
+
+ bool isValid() const override;
+ QAccessibleInterface *focusChild() const override;
+ int childCount() const override;
+ QAccessibleInterface *child(int index) const override;
+ int indexOfChild(const QAccessibleInterface *child) const override;
+
+private:
+ QWebEngineView *view() const;
+};
+
+QT_END_NAMESPACE
+
+namespace QtWebEngineCore {
+
+class RenderWidgetHostViewQtDelegateWidgetAccessible : public QAccessibleWidget
+{
+public:
+ RenderWidgetHostViewQtDelegateWidgetAccessible(QWidget *o, QWebEngineView *view);
+
+ bool isValid() const override;
+ QAccessibleInterface *focusChild() const override;
+ int childCount() const override;
+ QAccessibleInterface *child(int index) const override;
+ int indexOfChild(const QAccessibleInterface *child) const override;
+
+private:
+ QWebEngineViewAccessible *viewAccessible() const;
+ QPointer<QWebEngineView> m_view;
+};
+} // namespace QtWebEngineCore
+
+#endif // QWEBENGINE_ACCESSIBLE_H
diff --git a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp
deleted file mode 100644
index 1dfcc4c5a..000000000
--- a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp
+++ /dev/null
@@ -1,533 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "render_widget_host_view_qt_delegate_widget.h"
-
-#include "qwebenginepage_p.h"
-#include "qwebengineview.h"
-#include "qwebengineview_p.h"
-#include <QGuiApplication>
-#include <QLayout>
-#include <QMouseEvent>
-#include <QOpenGLContext>
-#include <QResizeEvent>
-#include <QSGAbstractRenderer>
-#include <QSGNode>
-#include <QWindow>
-#include <QtQuick/private/qquickwindow_p.h>
-
-namespace QtWebEngineCore {
-
-class RenderWidgetHostViewQuickItem : public QQuickItem {
-public:
- RenderWidgetHostViewQuickItem(RenderWidgetHostViewQtDelegateClient *client) : m_client(client)
- {
- setFlag(ItemHasContents, true);
- // Mark that this item should receive focus when the parent QQuickWidget receives focus.
- setFocus(true);
- }
-protected:
- bool event(QEvent *event) override
- {
- if (event->type() == QEvent::ShortcutOverride)
- return m_client->forwardEvent(event);
-
- return QQuickItem::event(event);
- }
- void focusInEvent(QFocusEvent *event) override
- {
- m_client->forwardEvent(event);
- }
- void focusOutEvent(QFocusEvent *event) override
- {
- m_client->forwardEvent(event);
- }
- void inputMethodEvent(QInputMethodEvent *event) override
- {
- m_client->forwardEvent(event);
- }
- QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) override
- {
- return m_client->updatePaintNode(oldNode);
- }
-
- QVariant inputMethodQuery(Qt::InputMethodQuery query) const override
- {
- return m_client->inputMethodQuery(query);
- }
-private:
- RenderWidgetHostViewQtDelegateClient *m_client;
-};
-
-RenderWidgetHostViewQtDelegateWidget::RenderWidgetHostViewQtDelegateWidget(RenderWidgetHostViewQtDelegateClient *client, QWidget *parent)
- : QQuickWidget(parent)
- , m_client(client)
- , m_rootItem(new RenderWidgetHostViewQuickItem(client))
- , m_isPopup(false)
-{
- setFocusPolicy(Qt::StrongFocus);
-
- QSurfaceFormat format;
- format.setDepthBufferSize(24);
- format.setStencilBufferSize(8);
-
-#if QT_CONFIG(opengl)
- QOpenGLContext *globalSharedContext = QOpenGLContext::globalShareContext();
- if (globalSharedContext) {
- QSurfaceFormat sharedFormat = globalSharedContext->format();
-
-#ifdef Q_OS_OSX
- // Check that the default QSurfaceFormat OpenGL profile is compatible with the global OpenGL
- // shared context profile, otherwise this could lead to a nasty crash.
- QSurfaceFormat defaultFormat = QSurfaceFormat::defaultFormat();
-
- if (defaultFormat.profile() != sharedFormat.profile()
- && defaultFormat.profile() == QSurfaceFormat::CoreProfile
- && defaultFormat.version() >= qMakePair(3, 2)) {
- qFatal("QWebEngine: Default QSurfaceFormat OpenGL profile is not compatible with the "
- "global shared context OpenGL profile. Please make sure you set a compatible "
- "QSurfaceFormat before the QtGui application instance is created.");
- }
-#endif
- int major;
- int minor;
- QSurfaceFormat::OpenGLContextProfile profile;
-#ifdef Q_OS_MACOS
- // Due to QTBUG-63180, requesting the sharedFormat.majorVersion() on macOS will lead to
- // a failed creation of QQuickWidget shared context. Thus make sure to request the
- // major version specified in the defaultFormat instead.
- major = defaultFormat.majorVersion();
- minor = defaultFormat.minorVersion();
- profile = defaultFormat.profile();
-#else
- major = sharedFormat.majorVersion();
- minor = sharedFormat.minorVersion();
- profile = sharedFormat.profile();
-#endif
-
- // Make sure the OpenGL profile of the QQuickWidget matches the shared context profile.
- // It covers the following cases:
- // 1) Desktop OpenGL Core Profile.
- // 2) Windows ANGLE OpenGL ES profile.
- if (sharedFormat.profile() == QSurfaceFormat::CoreProfile
-#ifdef Q_OS_WIN
- || globalSharedContext->isOpenGLES()
-#endif
- ) {
- format.setMajorVersion(major);
- format.setMinorVersion(minor);
- format.setProfile(profile);
- }
- }
-
- setFormat(format);
-#endif
- setMouseTracking(true);
- setAttribute(Qt::WA_AcceptTouchEvents);
- setAttribute(Qt::WA_OpaquePaintEvent);
- setAttribute(Qt::WA_AlwaysShowToolTips);
-
- setContent(QUrl(), nullptr, m_rootItem.data());
-
- connectRemoveParentBeforeParentDelete();
-}
-
-RenderWidgetHostViewQtDelegateWidget::~RenderWidgetHostViewQtDelegateWidget()
-{
- QWebEnginePagePrivate::bindPageAndWidget(nullptr, this);
-}
-
-void RenderWidgetHostViewQtDelegateWidget::connectRemoveParentBeforeParentDelete()
-{
- disconnect(m_parentDestroyedConnection);
-
- if (QWidget *parent = parentWidget()) {
- m_parentDestroyedConnection = connect(parent, &QObject::destroyed,
- this,
- &RenderWidgetHostViewQtDelegateWidget::removeParentBeforeParentDelete);
- } else {
- m_parentDestroyedConnection = QMetaObject::Connection();
- }
-}
-
-void RenderWidgetHostViewQtDelegateWidget::removeParentBeforeParentDelete()
-{
- // Unset the parent, because parent is being destroyed, but the owner of this
- // RenderWidgetHostViewQtDelegateWidget is actually a RenderWidgetHostViewQt instance.
- setParent(nullptr);
-
- // If this widget represents a popup window, make sure to close it, so that if the popup was the
- // last visible top level window, the application event loop can quit if it deems it necessarry.
- if (m_isPopup)
- close();
-}
-
-void RenderWidgetHostViewQtDelegateWidget::initAsPopup(const QRect& screenRect)
-{
- m_isPopup = true;
-
- // The keyboard events are supposed to go to the parent RenderHostView
- // so the WebUI popups should never have focus. Besides, if the parent view
- // loses focus, WebKit will cause its associated popups (including this one)
- // to be destroyed.
- setAttribute(Qt::WA_ShowWithoutActivating);
- setFocusPolicy(Qt::NoFocus);
- setWindowFlags(Qt::Popup | Qt::FramelessWindowHint | Qt::WindowDoesNotAcceptFocus);
-
- setGeometry(screenRect);
- show();
-}
-
-void RenderWidgetHostViewQtDelegateWidget::closeEvent(QCloseEvent *event)
-{
- Q_UNUSED(event);
-
- // If a close event was received from the window manager (e.g. when moving the parent window,
- // clicking outside the popup area)
- // make sure to notify the Chromium WebUI popup and its underlying
- // RenderWidgetHostViewQtDelegate instance to be closed.
- if (m_isPopup)
- m_client->closePopup();
-}
-
-QRectF RenderWidgetHostViewQtDelegateWidget::viewGeometry() const
-{
- return QRectF(mapToGlobal(pos()), size());
-}
-
-QRect RenderWidgetHostViewQtDelegateWidget::windowGeometry() const
-{
- if (!window())
- return QRect();
- return window()->frameGeometry();
-}
-
-void RenderWidgetHostViewQtDelegateWidget::setKeyboardFocus()
-{
- // The root item always has focus within the root focus scope:
- Q_ASSERT(m_rootItem->hasFocus());
-
- setFocus();
-}
-
-bool RenderWidgetHostViewQtDelegateWidget::hasKeyboardFocus()
-{
- // The root item always has focus within the root focus scope:
- Q_ASSERT(m_rootItem->hasFocus());
-
- return hasFocus();
-}
-
-void RenderWidgetHostViewQtDelegateWidget::lockMouse()
-{
- grabMouse();
-}
-
-void RenderWidgetHostViewQtDelegateWidget::unlockMouse()
-{
- releaseMouse();
-}
-
-void RenderWidgetHostViewQtDelegateWidget::show()
-{
- m_rootItem->setVisible(true);
- // Check if we're attached to a QWebEngineView, we don't
- // want to show anything else than popups as top-level.
- if (parent() || m_isPopup) {
- QQuickWidget::show();
- }
-}
-
-void RenderWidgetHostViewQtDelegateWidget::hide()
-{
- m_rootItem->setVisible(false);
- QQuickWidget::hide();
-}
-
-bool RenderWidgetHostViewQtDelegateWidget::isVisible() const
-{
- return QQuickWidget::isVisible() && m_rootItem->isVisible();
-}
-
-QWindow* RenderWidgetHostViewQtDelegateWidget::window() const
-{
- const QWidget* root = QQuickWidget::window();
- return root ? root->windowHandle() : 0;
-}
-
-QSGTexture *RenderWidgetHostViewQtDelegateWidget::createTextureFromImage(const QImage &image)
-{
- return quickWindow()->createTextureFromImage(image, QQuickWindow::TextureCanUseAtlas);
-}
-
-QSGLayer *RenderWidgetHostViewQtDelegateWidget::createLayer()
-{
- QSGRenderContext *renderContext = QQuickWindowPrivate::get(quickWindow())->context;
- return renderContext->sceneGraphContext()->createLayer(renderContext);
-}
-
-QSGImageNode *RenderWidgetHostViewQtDelegateWidget::createImageNode()
-{
- return quickWindow()->createImageNode();
-}
-
-QSGRectangleNode *RenderWidgetHostViewQtDelegateWidget::createRectangleNode()
-{
- return quickWindow()->createRectangleNode();
-}
-
-void RenderWidgetHostViewQtDelegateWidget::update()
-{
- m_rootItem->update();
-}
-
-void RenderWidgetHostViewQtDelegateWidget::updateCursor(const QCursor &cursor)
-{
- QQuickWidget::setCursor(cursor);
-}
-
-void RenderWidgetHostViewQtDelegateWidget::resize(int width, int height)
-{
- QQuickWidget::resize(width, height);
-}
-
-void RenderWidgetHostViewQtDelegateWidget::move(const QPoint &screenPos)
-{
- Q_ASSERT(m_isPopup);
- QQuickWidget::move(screenPos);
-}
-
-void RenderWidgetHostViewQtDelegateWidget::inputMethodStateChanged(bool editorVisible, bool passwordInput)
-{
- QQuickWidget::setAttribute(Qt::WA_InputMethodEnabled, editorVisible && !passwordInput);
- qApp->inputMethod()->update(Qt::ImQueryInput | Qt::ImEnabled | Qt::ImHints);
- if (qApp->inputMethod()->isVisible() != editorVisible)
- qApp->inputMethod()->setVisible(editorVisible);
-}
-
-void RenderWidgetHostViewQtDelegateWidget::setInputMethodHints(Qt::InputMethodHints hints)
-{
- QQuickWidget::setInputMethodHints(hints);
-}
-
-void RenderWidgetHostViewQtDelegateWidget::setClearColor(const QColor &color)
-{
- QQuickWidget::setClearColor(color);
- // QQuickWidget is usually blended by punching holes into widgets
- // above it to simulate the visual stacking order. If we want it to be
- // transparent we have to throw away the proper stacking order and always
- // blend the complete normal widgets backing store under it.
- bool isTranslucent = color.alpha() < 255;
- setAttribute(Qt::WA_AlwaysStackOnTop, isTranslucent);
- setAttribute(Qt::WA_OpaquePaintEvent, !isTranslucent);
- update();
-}
-
-QVariant RenderWidgetHostViewQtDelegateWidget::inputMethodQuery(Qt::InputMethodQuery query) const
-{
- return m_client->inputMethodQuery(query);
-}
-
-void RenderWidgetHostViewQtDelegateWidget::resizeEvent(QResizeEvent *resizeEvent)
-{
- QQuickWidget::resizeEvent(resizeEvent);
- m_client->visualPropertiesChanged();
-}
-
-void RenderWidgetHostViewQtDelegateWidget::showEvent(QShowEvent *event)
-{
- QQuickWidget::showEvent(event);
- // We don't have a way to catch a top-level window change with QWidget
- // but a widget will most likely be shown again if it changes, so do
- // the reconnection at this point.
- for (const QMetaObject::Connection &c : qAsConst(m_windowConnections))
- disconnect(c);
- m_windowConnections.clear();
- if (QWindow *w = window()) {
- m_windowConnections.append(connect(w, SIGNAL(xChanged(int)), SLOT(onWindowPosChanged())));
- m_windowConnections.append(connect(w, SIGNAL(yChanged(int)), SLOT(onWindowPosChanged())));
- }
- m_client->visualPropertiesChanged();
- m_client->notifyShown();
-}
-
-void RenderWidgetHostViewQtDelegateWidget::hideEvent(QHideEvent *event)
-{
- QQuickWidget::hideEvent(event);
- m_client->notifyHidden();
-}
-
-bool RenderWidgetHostViewQtDelegateWidget::copySurface(const QRect &rect, const QSize &size, QImage &image)
-{
- QPixmap pixmap = rect.isEmpty() ? QQuickWidget::grab(QQuickWidget::rect()) : QQuickWidget::grab(rect);
- if (pixmap.isNull())
- return false;
- image = pixmap.toImage().scaled(size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
- return true;
-}
-
-bool RenderWidgetHostViewQtDelegateWidget::event(QEvent *event)
-{
- bool handled = false;
-
- // Track parent to make sure we don't get deleted.
- switch (event->type()) {
- case QEvent::ParentChange:
- connectRemoveParentBeforeParentDelete();
- break;
- default:
- break;
- }
-
- // Mimic QWidget::event() by ignoring mouse, keyboard, touch and tablet events if the widget is
- // disabled.
- if (!isEnabled()) {
- switch (event->type()) {
- case QEvent::TabletPress:
- case QEvent::TabletRelease:
- case QEvent::TabletMove:
- case QEvent::MouseButtonPress:
- case QEvent::MouseButtonRelease:
- case QEvent::MouseButtonDblClick:
- case QEvent::MouseMove:
- case QEvent::TouchBegin:
- case QEvent::TouchUpdate:
- case QEvent::TouchEnd:
- case QEvent::TouchCancel:
- case QEvent::ContextMenu:
- case QEvent::KeyPress:
- case QEvent::KeyRelease:
-#ifndef QT_NO_WHEELEVENT
- case QEvent::Wheel:
-#endif
- return false;
- default:
- break;
- }
- }
-
- switch (event->type()) {
- case QEvent::FocusIn:
- case QEvent::FocusOut:
- // We forward focus events later, once they have made it to the m_rootItem.
- return QQuickWidget::event(event);
- case QEvent::DragEnter:
- case QEvent::DragLeave:
- case QEvent::DragMove:
- case QEvent::Drop:
- case QEvent::HoverEnter:
- case QEvent::HoverLeave:
- case QEvent::HoverMove:
- // Let the parent handle these events.
- return false;
- default:
- break;
- }
-
- if (event->type() == QEvent::MouseButtonDblClick) {
- // QWidget keeps the Qt4 behavior where the DblClick event would replace the Press event.
- // QtQuick is different by sending both the Press and DblClick events for the second press
- // where we can simply ignore the DblClick event.
- QMouseEvent *dblClick = static_cast<QMouseEvent *>(event);
- QMouseEvent press(QEvent::MouseButtonPress, dblClick->localPos(), dblClick->windowPos(), dblClick->screenPos(),
- dblClick->button(), dblClick->buttons(), dblClick->modifiers(), dblClick->source());
- press.setTimestamp(dblClick->timestamp());
- handled = m_client->forwardEvent(&press);
- } else
- handled = m_client->forwardEvent(event);
-
- if (!handled)
- return QQuickWidget::event(event);
- event->accept();
- return true;
-}
-
-void RenderWidgetHostViewQtDelegateWidget::unhandledWheelEvent(QWheelEvent *ev)
-{
- if (QWidget *p = parentWidget())
- qApp->sendEvent(p, ev);
-}
-
-void RenderWidgetHostViewQtDelegateWidget::onWindowPosChanged()
-{
- m_client->visualPropertiesChanged();
-}
-
-#if QT_CONFIG(accessibility)
-RenderWidgetHostViewQtDelegateWidgetAccessible::RenderWidgetHostViewQtDelegateWidgetAccessible(RenderWidgetHostViewQtDelegateWidget *o, QWebEngineView *view)
- : QAccessibleWidget(o)
- , m_view(view)
-{
-}
-
-bool RenderWidgetHostViewQtDelegateWidgetAccessible::isValid() const
-{
- if (!viewAccessible() || !viewAccessible()->isValid())
- return false;
-
- return QAccessibleWidget::isValid();
-}
-
-QAccessibleInterface *RenderWidgetHostViewQtDelegateWidgetAccessible::focusChild() const
-{
- return viewAccessible()->focusChild();
-}
-
-int RenderWidgetHostViewQtDelegateWidgetAccessible::childCount() const
-{
- return viewAccessible()->childCount();
-}
-
-QAccessibleInterface *RenderWidgetHostViewQtDelegateWidgetAccessible::child(int index) const
-{
- return viewAccessible()->child(index);
-}
-
-int RenderWidgetHostViewQtDelegateWidgetAccessible::indexOfChild(const QAccessibleInterface *c) const
-{
- return viewAccessible()->indexOfChild(c);
-}
-
-QWebEngineViewAccessible *RenderWidgetHostViewQtDelegateWidgetAccessible::viewAccessible() const
-{
- return static_cast<QWebEngineViewAccessible *>(QAccessible::queryAccessibleInterface(m_view));
-}
-#endif // QT_CONFIG(accessibility)
-
-} // namespace QtWebEngineCore
diff --git a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h
deleted file mode 100644
index 034fdd65c..000000000
--- a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h
+++ /dev/null
@@ -1,142 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef RENDER_WIDGET_HOST_VIEW_QT_DELEGATE_WIDGET_H
-#define RENDER_WIDGET_HOST_VIEW_QT_DELEGATE_WIDGET_H
-
-#include "render_widget_host_view_qt_delegate.h"
-#include "web_contents_adapter_client.h"
-
-#include <QAccessibleWidget>
-#include <QQuickItem>
-#include <QQuickWidget>
-
-QT_BEGIN_NAMESPACE
-class QWebEnginePage;
-class QWebEngineView;
-class QWebEngineViewAccessible;
-class QWebEnginePagePrivate;
-QT_END_NAMESPACE
-
-namespace QtWebEngineCore {
-
-// Useful information keyboard and mouse QEvent propagation.
-// A RenderWidgetHostViewQtDelegateWidget instance initialized as a popup will receive
-// no keyboard focus (so all keyboard QEvents will be sent to the parent RWHVQD instance),
-// but will still receive mouse input (all mouse QEvent moves and clicks will be given to the popup
-// RWHVQD instance, and the mouse interaction area covers the surface of the whole parent
-// QWebEngineView, and not only the smaller surface that an HTML select popup would occupy).
-class RenderWidgetHostViewQtDelegateWidget : public QQuickWidget, public RenderWidgetHostViewQtDelegate {
- Q_OBJECT
-public:
- RenderWidgetHostViewQtDelegateWidget(RenderWidgetHostViewQtDelegateClient *client, QWidget *parent = 0);
- ~RenderWidgetHostViewQtDelegateWidget();
-
- void initAsPopup(const QRect&) override;
- QRectF viewGeometry() const override;
- QRect windowGeometry() const override;
- void setKeyboardFocus() override;
- bool hasKeyboardFocus() override;
- void lockMouse() override;
- void unlockMouse() override;
- void show() override;
- void hide() override;
- bool isVisible() const override;
- QWindow* window() const override;
- QSGTexture *createTextureFromImage(const QImage &) override;
- QSGLayer *createLayer() override;
- QSGImageNode *createImageNode() override;
- QSGRectangleNode *createRectangleNode() override;
- void update() override;
- void updateCursor(const QCursor &) override;
- void resize(int width, int height) override;
- void move(const QPoint &screenPos) override;
- void inputMethodStateChanged(bool editorVisible, bool passwordInput) override;
- void setInputMethodHints(Qt::InputMethodHints) override;
- void setClearColor(const QColor &color) override;
- bool copySurface(const QRect &, const QSize &, QImage &) override;
- void unhandledWheelEvent(QWheelEvent *ev) override;
-
-protected:
- bool event(QEvent *event) override;
- void resizeEvent(QResizeEvent *resizeEvent) override;
- void showEvent(QShowEvent *) override;
- void hideEvent(QHideEvent *) override;
- void closeEvent(QCloseEvent *event) override;
-
- QVariant inputMethodQuery(Qt::InputMethodQuery query) const override;
-
-private slots:
- void onWindowPosChanged();
- void connectRemoveParentBeforeParentDelete();
- void removeParentBeforeParentDelete();
-
-private:
- friend QWebEnginePagePrivate;
-
- RenderWidgetHostViewQtDelegateClient *m_client;
- QScopedPointer<QQuickItem> m_rootItem;
- bool m_isPopup;
- QColor m_clearColor;
- QList<QMetaObject::Connection> m_windowConnections;
- QWebEnginePage *m_page = nullptr;
- QMetaObject::Connection m_parentDestroyedConnection;
-};
-
-#if QT_CONFIG(accessibility)
-class RenderWidgetHostViewQtDelegateWidgetAccessible : public QAccessibleWidget
-{
-public:
- RenderWidgetHostViewQtDelegateWidgetAccessible(RenderWidgetHostViewQtDelegateWidget *o, QWebEngineView *view);
-
- bool isValid() const override;
- QAccessibleInterface *focusChild() const override;
- int childCount() const override;
- QAccessibleInterface *child(int index) const override;
- int indexOfChild(const QAccessibleInterface *child) const override;
-
-private:
- QWebEngineViewAccessible *viewAccessible() const;
- QWebEngineView *m_view;
-};
-#endif // QT_CONFIG(accessibility)
-
-} // namespace QtWebEngineCore
-
-#endif
diff --git a/src/webenginewidgets/ui/autofillpopupwidget.cpp b/src/webenginewidgets/ui/autofillpopupwidget.cpp
new file mode 100644
index 000000000..a4dc31beb
--- /dev/null
+++ b/src/webenginewidgets/ui/autofillpopupwidget.cpp
@@ -0,0 +1,201 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "autofillpopupwidget_p.h"
+#include "qwebengineview.h"
+#include "qwebengineview_p.h"
+
+#include "autofill_popup_controller.h"
+
+#include <QApplication>
+#include <QBoxLayout>
+#include <QEvent>
+#include <QKeyEvent>
+#include <QListView>
+#include <QMouseEvent>
+
+namespace QtWebEngineWidgetUI {
+
+AutofillPopupWidget::AutofillPopupWidget(QtWebEngineCore::AutofillPopupController *controller,
+ QWebEngineView *parent)
+ : QFrame(parent, Qt::Popup), m_controller(controller), m_webEngineView(parent)
+{
+ setAttribute(Qt::WA_WindowPropagation);
+ setAttribute(Qt::WA_X11NetWmWindowTypeCombo);
+
+ // we need a vertical layout
+ QBoxLayout *layout = new QBoxLayout(QBoxLayout::TopToBottom, this);
+ layout->setSpacing(0);
+ layout->setContentsMargins(QMargins());
+
+ m_listView = new QListView(m_webEngineView);
+ m_listView->setModel(m_controller->model());
+ m_listView->setTextElideMode(Qt::ElideMiddle);
+
+ // Based on QComboBoxPrivateContainer::setItemView
+ m_listView->setParent(this);
+ m_listView->setAttribute(Qt::WA_MacShowFocusRect, false);
+ layout->insertWidget(0, m_listView);
+ m_listView->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
+
+ m_listView->installEventFilter(this);
+ // Necessary for filtering QEvent::MouseMove:
+ m_listView->viewport()->installEventFilter(this);
+
+ m_listView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ // TODO: Implement vertical scrollbar. Chromium also has it.
+ m_listView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ m_listView->setMouseTracking(true);
+
+ m_listView->setSelectionMode(QAbstractItemView::SingleSelection);
+ m_listView->setEditTriggers(QAbstractItemView::NoEditTriggers);
+
+ // Some styles (Mac) have a margin at the top and bottom of the popup.
+ layout->insertSpacing(0, 0);
+ layout->addSpacing(0);
+
+ connect(m_controller, &QtWebEngineCore::AutofillPopupController::currentIndexChanged,
+ m_listView, &QListView::setCurrentIndex);
+}
+
+AutofillPopupWidget::~AutofillPopupWidget() { }
+
+// Based on QComboBox::showPopup()
+void AutofillPopupWidget::showPopup(QPoint pos, int width, bool autoselectFirstSuggestion)
+{
+ QStyle *const style = m_webEngineView->style();
+ QStyleOptionComboBox opt;
+ opt.initFrom(m_webEngineView);
+
+ if (autoselectFirstSuggestion)
+ m_controller->selectFirstSuggestion();
+
+ QRect listRect(pos, QSize(width, 0));
+
+ // Calculate height
+ {
+ int listHeight = 0;
+ int rowCount = m_controller->model()->rowCount();
+ for (int i = 0; i < rowCount; ++i) {
+ QModelIndex idx = m_controller->model()->index(i, 0);
+ listHeight += m_listView->visualRect(idx).height();
+ }
+ if (rowCount > 1)
+ listHeight += (rowCount - 1) * m_listView->spacing() * 2;
+
+ listRect.setHeight(listRect.height() + listHeight);
+ }
+
+ // Calculate height margin
+ {
+ int heightMargin = m_listView->spacing() * 2;
+
+ // Add the frame of the popup
+ const QMargins pm = contentsMargins();
+ heightMargin += pm.top() + pm.bottom();
+
+ // Add the frame of the list view
+ const QMargins vm = m_listView->contentsMargins();
+ heightMargin += vm.top() + vm.bottom();
+ listRect.setHeight(listRect.height() + heightMargin);
+ }
+
+ // Add space for margin at top and bottom if the style wants it
+ int styleMargin = style->pixelMetric(QStyle::PM_MenuVMargin, &opt, this) * 2;
+ listRect.setHeight(listRect.height() + styleMargin);
+
+ // Takes account of the mimium/maximum size of the popup
+ layout()->activate();
+ listRect.setSize(listRect.size().expandedTo(minimumSize()).boundedTo(maximumSize()));
+
+ setGeometry(listRect);
+ QFrame::show();
+}
+
+bool AutofillPopupWidget::eventFilter(QObject *object, QEvent *event)
+{
+ switch (event->type()) {
+ case QEvent::MouseMove:
+ if (isVisible()) {
+ QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event);
+ QModelIndex indexUnderMouse = m_listView->indexAt(mouseEvent->position().toPoint());
+ if (indexUnderMouse.isValid()
+ && indexUnderMouse.data(Qt::AccessibleDescriptionRole).toString()
+ != QLatin1String("separator")) {
+ m_controller->selectSuggestion(indexUnderMouse.row());
+ }
+ }
+ return true;
+ case QEvent::MouseButtonRelease: {
+ QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event);
+ if (mouseEvent->button() == Qt::LeftButton) {
+ m_controller->acceptSuggestion();
+ return true;
+ }
+ break;
+ }
+ default:
+ break;
+ }
+
+ return QFrame::eventFilter(object, event);
+}
+
+void AutofillPopupWidget::keyPressEvent(QKeyEvent *event)
+{
+ // AutofillPopupControllerImpl::HandleKeyPressEvent()
+ // chrome/browser/ui/autofill/autofill_popup_controller_impl.cc
+ switch (event->key()) {
+ case Qt::Key_Up:
+ m_controller->selectPreviousSuggestion();
+ return;
+ case Qt::Key_Down:
+ m_controller->selectNextSuggestion();
+ return;
+ case Qt::Key_PageUp:
+ m_controller->selectFirstSuggestion();
+ return;
+ case Qt::Key_PageDown:
+ m_controller->selectLastSuggestion();
+ return;
+ case Qt::Key_Escape:
+ m_webEngineView->d_ptr->hideAutofillPopup();
+ return;
+ case Qt::Key_Enter:
+ case Qt::Key_Return:
+ m_controller->acceptSuggestion();
+ return;
+ case Qt::Key_Delete:
+ // Remove suggestion is not supported for datalist.
+ // Forward delete to view to be able to remove selected text.
+ break;
+ case Qt::Key_Tab:
+ m_controller->acceptSuggestion();
+ break;
+ default:
+ break;
+ }
+
+ QCoreApplication::sendEvent(m_webEngineView->focusWidget(), event);
+}
+
+void AutofillPopupWidget::keyReleaseEvent(QKeyEvent *event)
+{
+ // Do not forward release events of the overridden key presses.
+ switch (event->key()) {
+ case Qt::Key_Up:
+ case Qt::Key_Down:
+ case Qt::Key_PageUp:
+ case Qt::Key_PageDown:
+ case Qt::Key_Escape:
+ case Qt::Key_Enter:
+ case Qt::Key_Return:
+ return;
+ default:
+ break;
+ }
+
+ QCoreApplication::sendEvent(m_webEngineView->focusWidget(), event);
+}
+
+} // namespace QtWebEngineWidgetUI
diff --git a/src/webenginewidgets/ui/autofillpopupwidget_p.h b/src/webenginewidgets/ui/autofillpopupwidget_p.h
new file mode 100644
index 000000000..79decc6ab
--- /dev/null
+++ b/src/webenginewidgets/ui/autofillpopupwidget_p.h
@@ -0,0 +1,58 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef AUTOFILLPOPUPWIDGET_P_H
+#define AUTOFILLPOPUPWIDGET_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QFrame>
+
+namespace QtWebEngineCore {
+class AutofillPopupController;
+}
+
+QT_BEGIN_NAMESPACE
+class QListView;
+class QWebEngineView;
+class QWebEngineViewPrivate;
+QT_END_NAMESPACE
+
+namespace QtWebEngineWidgetUI {
+
+// Based on QComboBoxPrivateContainer
+class AutofillPopupWidget : public QFrame
+{
+ Q_OBJECT
+public:
+ AutofillPopupWidget(QtWebEngineCore::AutofillPopupController *controller,
+ QWebEngineView *parent);
+ ~AutofillPopupWidget();
+
+ void showPopup(QPoint pos, int width, bool autoselectFirstSuggestion);
+
+protected:
+ bool eventFilter(QObject *object, QEvent *event) override;
+ void keyPressEvent(QKeyEvent *event) override;
+ void keyReleaseEvent(QKeyEvent *event) override;
+
+private:
+ QtWebEngineCore::AutofillPopupController *m_controller;
+ QWebEngineView *m_webEngineView;
+ QListView *m_listView;
+
+ friend class QT_PREPEND_NAMESPACE(QWebEngineViewPrivate);
+};
+
+} // namespace QtWebEngineWidgetUI
+
+#endif // AUTOFILLPOPUPWIDGET_P_H
diff --git a/src/webenginewidgets/ui/touchhandlewidget.cpp b/src/webenginewidgets/ui/touchhandlewidget.cpp
new file mode 100644
index 000000000..88af0ff36
--- /dev/null
+++ b/src/webenginewidgets/ui/touchhandlewidget.cpp
@@ -0,0 +1,59 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "touchhandlewidget_p.h"
+#include "qwebengineview.h"
+
+#include <QBoxLayout>
+#include <QGraphicsOpacityEffect>
+#include <QLabel>
+#include <QWidget>
+
+namespace QtWebEngineWidgetUI {
+TouchHandleWidget::TouchHandleWidget(QWebEngineView *view, const QMap<int, QImage> &images)
+ : m_widget(new QWidget(view))
+ , m_label(new QLabel(m_widget))
+ , m_opacityEffect(new QGraphicsOpacityEffect(m_widget))
+ , m_images(images)
+{
+ m_widget->setAttribute(Qt::WA_AcceptTouchEvents, true);
+ m_widget->setAttribute(Qt::WA_TransparentForMouseEvents, true);
+}
+
+TouchHandleWidget::~TouchHandleWidget()
+{
+}
+
+void TouchHandleWidget::setImage(int orientation)
+{
+ const QImage &img = m_images[orientation];
+ m_label->setPixmap(QPixmap::fromImage(img));
+ m_label->setFrameStyle(QFrame::NoFrame);
+ m_label->resize(img.size());
+ m_label->setVisible(true);
+
+ QVBoxLayout layout;
+ layout.setSpacing(0);
+ layout.setContentsMargins(QMargins());
+ layout.addWidget(m_label);
+ layout.setParent(m_widget);
+ m_widget->setLayout(&layout);
+ m_widget->resize(img.size());
+}
+
+void TouchHandleWidget::setBounds(const QRect &bounds)
+{
+ m_widget->setGeometry(bounds);
+}
+
+void TouchHandleWidget::setVisible(bool visible)
+{
+ m_widget->setVisible(visible);
+}
+
+void TouchHandleWidget::setOpacity(float opacity)
+{
+ m_opacityEffect->setOpacity(opacity);
+ m_widget->setGraphicsEffect(m_opacityEffect);
+}
+} // namespace QtWebEngineWidgetUI
diff --git a/src/webenginewidgets/ui/touchhandlewidget_p.h b/src/webenginewidgets/ui/touchhandlewidget_p.h
new file mode 100644
index 000000000..9f181c935
--- /dev/null
+++ b/src/webenginewidgets/ui/touchhandlewidget_p.h
@@ -0,0 +1,50 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef TOUCHHANDLEWIDGET_P_H
+#define TOUCHHANDLEWIDGET_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "touch_handle_drawable_client.h"
+
+#include <QImage>
+#include <QMap>
+
+QT_BEGIN_NAMESPACE
+class QGraphicsOpacityEffect;
+class QLabel;
+class QWebEngineView;
+class QWidget;
+QT_END_NAMESPACE
+
+namespace QtWebEngineWidgetUI {
+class TouchHandleWidget : public QtWebEngineCore::TouchHandleDrawableDelegate
+{
+public:
+ TouchHandleWidget(QWebEngineView *view, const QMap<int, QImage> &images);
+ ~TouchHandleWidget();
+
+ void setImage(int orientation) override;
+ void setBounds(const QRect &bounds) override;
+ void setVisible(bool visible) override;
+ void setOpacity(float opacity) override;
+
+private:
+ QWidget *m_widget;
+ QLabel *m_label;
+ QGraphicsOpacityEffect *m_opacityEffect;
+ QMap<int, QImage> m_images;
+};
+} // namespace QtWebEngineWidgetUI
+
+#endif // TOUCHHANDLEWIDGET_P_H
diff --git a/src/webenginewidgets/ui/touchselectionmenuwidget.cpp b/src/webenginewidgets/ui/touchselectionmenuwidget.cpp
new file mode 100644
index 000000000..ff69fe84b
--- /dev/null
+++ b/src/webenginewidgets/ui/touchselectionmenuwidget.cpp
@@ -0,0 +1,117 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "touchselectionmenuwidget_p.h"
+#include "qwebengineview.h"
+
+#include "touch_selection_menu_controller.h"
+
+#include <QBoxLayout>
+#include <QEvent>
+
+namespace QtWebEngineWidgetUI {
+namespace {
+// The Widgets module is built with rtti in developer-build while Core is not.
+// The MOC will throw "undefined reference to typeinfo..." errors if we connect slots
+// from QtWebEngineCore via function pointers, because it expects rtti on them.
+// To workaround this we use lambdas.
+void connectButton(TouchSelectionMenuWidget::TouchButton *button, std::function<void()> callback)
+{
+ QObject::connect(button, &QPushButton::clicked, std::move(callback));
+}
+} // namespace
+
+TouchSelectionMenuWidget::TouchButton::TouchButton(QString name, QWidget *parent)
+ : QPushButton(name, parent)
+{
+ setAttribute(Qt::WA_AcceptTouchEvents, true);
+}
+
+TouchSelectionMenuWidget::TouchButton::~TouchButton()
+{
+}
+
+bool TouchSelectionMenuWidget::TouchButton::event(QEvent *ev)
+{
+ switch (ev->type()) {
+ case QEvent::TouchBegin:
+ ev->accept();
+ return true;
+ case QEvent::TouchEnd:
+ Q_EMIT clicked();
+ ev->accept();
+ return true;
+ default:
+ break;
+ }
+
+ return QPushButton::event(ev);
+}
+
+TouchSelectionMenuWidget::TouchSelectionMenuWidget(
+ QWebEngineView *view, QtWebEngineCore::TouchSelectionMenuController *controller)
+ : QWidget(view,
+ Qt::Window | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint
+ | Qt::WindowDoesNotAcceptFocus)
+{
+ setAttribute(Qt::WA_AcceptTouchEvents, true);
+ setAttribute(Qt::WA_TransparentForMouseEvents, true);
+ setAttribute(Qt::WA_DeleteOnClose, true);
+
+ bool cutEnabled =
+ controller->isCommandEnabled(QtWebEngineCore::TouchSelectionMenuController::Cut);
+ bool copyEnabled =
+ controller->isCommandEnabled(QtWebEngineCore::TouchSelectionMenuController::Copy);
+ bool pasteEnabled =
+ controller->isCommandEnabled(QtWebEngineCore::TouchSelectionMenuController::Paste);
+
+ QSizePolicy policy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+ QHBoxLayout *layout = new QHBoxLayout();
+
+ if (cutEnabled) {
+ TouchButton *button = new TouchButton(tr("Cut"), this);
+ button->setSizePolicy(policy);
+ layout->addWidget(button);
+ connectButton(button, [controller]() { controller->cut(); });
+ }
+
+ if (copyEnabled) {
+ TouchButton *button = new TouchButton(tr("Copy"), this);
+ button->setSizePolicy(policy);
+ layout->addWidget(button);
+ connectButton(button, [controller]() { controller->copy(); });
+ }
+
+ if (pasteEnabled) {
+ TouchButton *button = new TouchButton(tr("Paste"), this);
+ button->setSizePolicy(policy);
+ layout->addWidget(button);
+ connectButton(button, [controller]() { controller->paste(); });
+ }
+
+ TouchButton *button = new TouchButton(tr("..."), this);
+ button->setSizePolicy(policy);
+ layout->addWidget(button);
+ connectButton(button, [controller]() { controller->runContextMenu(); });
+
+ layout->setSpacing(2);
+ layout->setSizeConstraint(QLayout::SetMinimumSize);
+ layout->setContentsMargins(0, 0, 0, 0);
+ setLayout(layout);
+
+ nativeParentWidget()->installEventFilter(this);
+}
+
+TouchSelectionMenuWidget::~TouchSelectionMenuWidget()
+{
+}
+
+bool TouchSelectionMenuWidget::eventFilter(QObject *obj, QEvent *ev)
+{
+ // Close the menu if the window is moved
+ if (ev->type() == QEvent::Move)
+ close();
+
+ return QWidget::eventFilter(obj, ev);
+}
+} // QtWebEngineWidgetUI
diff --git a/src/webenginewidgets/ui/touchselectionmenuwidget_p.h b/src/webenginewidgets/ui/touchselectionmenuwidget_p.h
new file mode 100644
index 000000000..1f822023b
--- /dev/null
+++ b/src/webenginewidgets/ui/touchselectionmenuwidget_p.h
@@ -0,0 +1,52 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef TOUCHSELECTIONMENUWIDGET_P_H
+#define TOUCHSELECTIONMENUWIDGET_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QPushButton>
+#include <QWidget>
+
+namespace QtWebEngineCore {
+class TouchSelectionMenuController;
+}
+
+QT_BEGIN_NAMESPACE
+class QWebEngineView;
+QT_END_NAMESPACE
+
+namespace QtWebEngineWidgetUI {
+class TouchSelectionMenuWidget : public QWidget
+{
+public:
+ class TouchButton : public QPushButton
+ {
+ public:
+ TouchButton(QString name, QWidget *parent);
+ ~TouchButton();
+
+ protected:
+ bool event(QEvent *ev) override;
+ };
+
+ TouchSelectionMenuWidget(QWebEngineView *view,
+ QtWebEngineCore::TouchSelectionMenuController *controller);
+ ~TouchSelectionMenuWidget();
+
+protected:
+ bool eventFilter(QObject *obj, QEvent *ev) override;
+};
+} // namespace QtWebEngineWidgetUI
+
+#endif // TOUCHSELECTIONMENUWIDGET_P_H
diff --git a/src/webenginewidgets/webenginewidgets.pro b/src/webenginewidgets/webenginewidgets.pro
deleted file mode 100644
index d4fb40dc7..000000000
--- a/src/webenginewidgets/webenginewidgets.pro
+++ /dev/null
@@ -1,59 +0,0 @@
-include($$QTWEBENGINE_OUT_ROOT/src/core/qtwebenginecore-config.pri)
-QT_FOR_CONFIG += webenginecore-private
-
-TARGET = QtWebEngineWidgets
-
-# For our export macros
-DEFINES += QT_BUILD_WEBENGINEWIDGETS_LIB
-
-QT += webenginecore widgets network quick
-QT_PRIVATE += quick-private gui-private core-private widgets-private quickwidgets webenginecore-private
-
-INCLUDEPATH += $$PWD api ../core ../core/api ../webengine/api
-
-SOURCES = \
- api/qtwebenginewidgetsglobal.cpp \
- api/qwebenginecertificateerror.cpp \
- api/qwebengineclientcertificateselection.cpp \
- api/qwebenginecontextmenudata.cpp \
- api/qwebenginedownloaditem.cpp \
- api/qwebenginefullscreenrequest.cpp \
- api/qwebenginehistory.cpp \
- api/qwebenginenotificationpresenter.cpp \
- api/qwebenginepage.cpp \
- api/qwebengineprofile.cpp \
- api/qwebenginescript.cpp \
- api/qwebenginescriptcollection.cpp \
- api/qwebenginesettings.cpp \
- api/qwebengineview.cpp \
- render_widget_host_view_qt_delegate_widget.cpp
-
-HEADERS = \
- api/qtwebenginewidgetsglobal.h \
- api/qwebenginecertificateerror.h \
- api/qwebengineclientcertificateselection.h \
- api/qwebenginecontextmenudata.h \
- api/qwebenginedownloaditem.h \
- api/qwebenginedownloaditem_p.h \
- api/qwebenginefullscreenrequest.h \
- api/qwebenginehistory.h \
- api/qwebenginenotificationpresenter_p.h \
- api/qwebenginepage.h \
- api/qwebenginepage_p.h \
- api/qwebengineprofile.h \
- api/qwebengineprofile_p.h \
- api/qwebenginescriptcollection.h \
- api/qwebenginescriptcollection_p.h \
- api/qwebenginesettings.h \
- api/qwebengineview.h \
- api/qwebengineview_p.h \
- render_widget_host_view_qt_delegate_widget.h
-
-qtConfig(webengine-printing-and-pdf) {
- QT += printsupport
-
- SOURCES += printer_worker.cpp
- HEADERS += printer_worker.h
-}
-
-load(qt_module)
diff --git a/sync.profile b/sync.profile
deleted file mode 100644
index a1e3c8ded..000000000
--- a/sync.profile
+++ /dev/null
@@ -1,15 +0,0 @@
-%modules = ( # path to module name map
- "QtWebEngine" => "$basedir/src/webengine",
- "QtWebEngineWidgets" => "$basedir/src/webenginewidgets",
- "QtWebEngineCore" => "$basedir/src/core",
- "QtPdf" => "$basedir/src/pdf",
- "QtPdfWidgets" => "$basedir/src/pdfwidgets",
-);
-%moduleheaders = ( # restrict the module headers to those found in relative path
- "QtWebEngine" => "api",
- "QtWebEngineWidgets" => "api",
- "QtWebEngineCore" => "api",
- "QtPdf" => "api"
-);
-%classnames = (
-);
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
new file mode 100644
index 000000000..a8f031a5d
--- /dev/null
+++ b/tests/CMakeLists.txt
@@ -0,0 +1 @@
+qt_build_tests()
diff --git a/tests/auto/CMakeLists.txt b/tests/auto/CMakeLists.txt
new file mode 100644
index 000000000..1b0ff3e9d
--- /dev/null
+++ b/tests/auto/CMakeLists.txt
@@ -0,0 +1,20 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+add_subdirectory(cmake)
+if(TARGET Qt::WebEngineCore)
+ add_subdirectory(httpserver)
+ add_subdirectory(util)
+ add_subdirectory(core)
+endif()
+if(TARGET Qt::WebEngineQuick)
+ add_subdirectory(quick)
+endif()
+if(TARGET Qt::WebEngineWidgets)
+ add_subdirectory(widgets)
+endif()
+if(TARGET Qt::Pdf)
+ add_subdirectory(pdf)
+endif()
+if(TARGET Qt::PdfQuick)
+ add_subdirectory(pdfquick)
+endif()
diff --git a/tests/auto/Info.plist.in b/tests/auto/Info.plist.in
deleted file mode 100644
index e7f314042..000000000
--- a/tests/auto/Info.plist.in
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version=\"1.0\" encoding=\"UTF-8\"?>
-<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
-<plist version=\"1.0\">
-<dict>
- <key>CFBundlePackageType</key>
- <string>APPL</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleExecutable</key>
- <string>$${TARGET}</string>
- <key>CFBundleIdentifier</key>
- <string>org.qt-project.qt.tests.$${TARGET_HYPHENATED}</string>
- <key>CFBundleName</key>
- <string>$${TARGET}</string>
- <key>LSUIElement</key>
- <string>0</string>
-</dict>
-</plist>
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
deleted file mode 100644
index 53f223642..000000000
--- a/tests/auto/auto.pro
+++ /dev/null
@@ -1,25 +0,0 @@
-
-include($$QTWEBENGINE_OUT_ROOT/src/buildtools/qtbuildtools-config.pri)
-include($$QTWEBENGINE_OUT_ROOT/src/webengine/qtwebengine-config.pri)
-include($$QTWEBENGINE_OUT_ROOT/src/webenginewidgets/qtwebenginewidgets-config.pri)
-include($$QTWEBENGINE_OUT_ROOT/src/pdf/qtpdf-config.pri)
-include($$QTWEBENGINE_OUT_ROOT/src/pdfwidgets/qtpdfwidgets-config.pri)
-
-QT_FOR_CONFIG += \
- buildtools-private \
- webengine-private \
- webenginewidgets-private \
- pdf-private \
- pdfwidgets-private
-
-TEMPLATE = subdirs
-
-qtConfig(build-qtwebengine-core):qtConfig(webengine-core-support) {
- qtConfig(webengine-qml): SUBDIRS += quick
- qtConfig(webengine-widgets): SUBDIRS += core widgets
-}
-
-qtConfig(build-qtpdf):qtConfig(webengine-qtpdf-support) {
- SUBDIRS += pdf
-}
-
diff --git a/tests/auto/bic/data/QtWebEngine.5.15.0.linux-gcc-amd64.txt b/tests/auto/bic/data/QtWebEngine.5.15.0.linux-gcc-amd64.txt
new file mode 100644
index 000000000..282526218
--- /dev/null
+++ b/tests/auto/bic/data/QtWebEngine.5.15.0.linux-gcc-amd64.txt
@@ -0,0 +1,12282 @@
+Class std::__failure_type
+ size=1 align=1
+ base size=0 base align=1
+std::__failure_type (0x0x7f1e81bedb40) 0 empty
+
+Class std::__do_is_destructible_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__do_is_destructible_impl (0x0x7f1e81cb2300) 0 empty
+
+Class std::__do_is_nt_destructible_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__do_is_nt_destructible_impl (0x0x7f1e81cb2540) 0 empty
+
+Class std::__do_is_default_constructible_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__do_is_default_constructible_impl (0x0x7f1e81cb2780) 0 empty
+
+Class std::__do_is_static_castable_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__do_is_static_castable_impl (0x0x7f1e81cb29c0) 0 empty
+
+Class std::__do_is_direct_constructible_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__do_is_direct_constructible_impl (0x0x7f1e81cb2b40) 0 empty
+
+Class std::__do_is_nary_constructible_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__do_is_nary_constructible_impl (0x0x7f1e81cb2f00) 0 empty
+
+Class std::__do_is_implicitly_default_constructible_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__do_is_implicitly_default_constructible_impl (0x0x7f1e81d21060) 0 empty
+
+Class std::__do_common_type_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__do_common_type_impl (0x0x7f1e81d75720) 0 empty
+
+Class std::__do_member_type_wrapper
+ size=1 align=1
+ base size=0 base align=1
+std::__do_member_type_wrapper (0x0x7f1e81d757e0) 0 empty
+
+Class std::__invoke_memfun_ref
+ size=1 align=1
+ base size=0 base align=1
+std::__invoke_memfun_ref (0x0x7f1e81d75ba0) 0 empty
+
+Class std::__invoke_memfun_deref
+ size=1 align=1
+ base size=0 base align=1
+std::__invoke_memfun_deref (0x0x7f1e81d75c00) 0 empty
+
+Class std::__invoke_memobj_ref
+ size=1 align=1
+ base size=0 base align=1
+std::__invoke_memobj_ref (0x0x7f1e81d75c60) 0 empty
+
+Class std::__invoke_memobj_deref
+ size=1 align=1
+ base size=0 base align=1
+std::__invoke_memobj_deref (0x0x7f1e81d75cc0) 0 empty
+
+Class std::__invoke_other
+ size=1 align=1
+ base size=0 base align=1
+std::__invoke_other (0x0x7f1e81d75d20) 0 empty
+
+Class std::__result_of_memfun_ref_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__result_of_memfun_ref_impl (0x0x7f1e81d75de0) 0 empty
+
+Class std::__result_of_memfun_deref_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__result_of_memfun_deref_impl (0x0x7f1e81d75ea0) 0 empty
+
+Class std::__result_of_memobj_ref_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__result_of_memobj_ref_impl (0x0x7f1e81d75f60) 0 empty
+
+Class std::__result_of_memobj_deref_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__result_of_memobj_deref_impl (0x0x7f1e81da7060) 0 empty
+
+Class std::__result_of_other_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__result_of_other_impl (0x0x7f1e81da73c0) 0 empty
+
+Class std::__swappable_details::__do_is_swappable_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__swappable_details::__do_is_swappable_impl (0x0x7f1e81da7720) 0 empty
+
+Class std::__swappable_details::__do_is_nothrow_swappable_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__swappable_details::__do_is_nothrow_swappable_impl (0x0x7f1e81da7780) 0 empty
+
+Class std::__nonesuch
+ size=1 align=1
+ base size=0 base align=1
+std::__nonesuch (0x0x7f1e81da7d20) 0 empty
+
+Class std::piecewise_construct_t
+ size=1 align=1
+ base size=0 base align=1
+std::piecewise_construct_t (0x0x7f1e81df03c0) 0 empty
+
+Class std::__nonesuch_no_braces
+ size=1 align=1
+ base size=1 base align=1
+std::__nonesuch_no_braces (0x0x7f1e81d62c98) 0 empty
+ std::__nonesuch (0x0x7f1e81df08a0) 0 empty
+
+Class std::__true_type
+ size=1 align=1
+ base size=0 base align=1
+std::__true_type (0x0x7f1e81e70240) 0 empty
+
+Class std::__false_type
+ size=1 align=1
+ base size=0 base align=1
+std::__false_type (0x0x7f1e81e702a0) 0 empty
+
+Class std::input_iterator_tag
+ size=1 align=1
+ base size=0 base align=1
+std::input_iterator_tag (0x0x7f1e81ea4f60) 0 empty
+
+Class std::output_iterator_tag
+ size=1 align=1
+ base size=0 base align=1
+std::output_iterator_tag (0x0x7f1e81ecd000) 0 empty
+
+Class std::forward_iterator_tag
+ size=1 align=1
+ base size=1 base align=1
+std::forward_iterator_tag (0x0x7f1e81e731a0) 0 empty
+ std::input_iterator_tag (0x0x7f1e81ecd060) 0 empty
+
+Class std::bidirectional_iterator_tag
+ size=1 align=1
+ base size=1 base align=1
+std::bidirectional_iterator_tag (0x0x7f1e81e73208) 0 empty
+ std::forward_iterator_tag (0x0x7f1e81e73270) 0 empty
+ std::input_iterator_tag (0x0x7f1e81ecd0c0) 0 empty
+
+Class std::random_access_iterator_tag
+ size=1 align=1
+ base size=1 base align=1
+std::random_access_iterator_tag (0x0x7f1e81e732d8) 0 empty
+ std::bidirectional_iterator_tag (0x0x7f1e81e73340) 0 empty
+ std::forward_iterator_tag (0x0x7f1e81e733a8) 0 empty
+ std::input_iterator_tag (0x0x7f1e81ecd120) 0 empty
+
+Class __gnu_cxx::__ops::_Iter_less_iter
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__ops::_Iter_less_iter (0x0x7f1e81559c00) 0 empty
+
+Class __gnu_cxx::__ops::_Iter_less_val
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__ops::_Iter_less_val (0x0x7f1e81559d20) 0 empty
+
+Class __gnu_cxx::__ops::_Val_less_iter
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__ops::_Val_less_iter (0x0x7f1e8157e060) 0 empty
+
+Class __gnu_cxx::__ops::_Iter_equal_to_iter
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__ops::_Iter_equal_to_iter (0x0x7f1e8157e360) 0 empty
+
+Class __gnu_cxx::__ops::_Iter_equal_to_val
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__ops::_Iter_equal_to_val (0x0x7f1e8157e480) 0 empty
+
+Class __locale_struct
+ size=232 align=8
+ base size=232 base align=8
+__locale_struct (0x0x7f1e8160c780) 0
+
+Class timeval
+ size=16 align=8
+ base size=16 base align=8
+timeval (0x0x7f1e8160ca80) 0
+
+Class timespec
+ size=16 align=8
+ base size=16 base align=8
+timespec (0x0x7f1e8160cae0) 0
+
+Class __pthread_rwlock_arch_t
+ size=56 align=8
+ base size=56 base align=8
+__pthread_rwlock_arch_t (0x0x7f1e8160cba0) 0
+
+Class __pthread_internal_list
+ size=16 align=8
+ base size=16 base align=8
+__pthread_internal_list (0x0x7f1e8160cc00) 0
+
+Class __pthread_mutex_s
+ size=40 align=8
+ base size=40 base align=8
+__pthread_mutex_s (0x0x7f1e8160cc60) 0
+
+Class __pthread_cond_s
+ size=48 align=8
+ base size=48 base align=8
+__pthread_cond_s (0x0x7f1e8160ccc0) 0
+
+Class pthread_attr_t
+ size=56 align=8
+ base size=56 base align=8
+pthread_attr_t (0x0x7f1e8160cf60) 0
+
+Class random_data
+ size=48 align=8
+ base size=48 base align=8
+random_data (0x0x7f1e8164d240) 0
+
+Class drand48_data
+ size=24 align=8
+ base size=24 base align=8
+drand48_data (0x0x7f1e8164d2a0) 0
+
+Vtable for std::exception
+std::exception::_ZTVSt9exception: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt9exception)
+16 (int (*)(...))std::exception::~exception
+24 (int (*)(...))std::exception::~exception
+32 (int (*)(...))std::exception::what
+
+Class std::exception
+ size=8 align=8
+ base size=8 base align=8
+std::exception (0x0x7f1e81306060) 0 nearly-empty
+ vptr=((& std::exception::_ZTVSt9exception) + 16)
+
+Vtable for std::bad_exception
+std::bad_exception::_ZTVSt13bad_exception: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt13bad_exception)
+16 (int (*)(...))std::bad_exception::~bad_exception
+24 (int (*)(...))std::bad_exception::~bad_exception
+32 (int (*)(...))std::bad_exception::what
+
+Class std::bad_exception
+ size=8 align=8
+ base size=8 base align=8
+std::bad_exception (0x0x7f1e81e736e8) 0 nearly-empty
+ vptr=((& std::bad_exception::_ZTVSt13bad_exception) + 16)
+ std::exception (0x0x7f1e81306240) 0 nearly-empty
+ primary-for std::bad_exception (0x0x7f1e81e736e8)
+
+Vtable for std::type_info
+std::type_info::_ZTVSt9type_info: 8 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt9type_info)
+16 (int (*)(...))std::type_info::~type_info
+24 (int (*)(...))std::type_info::~type_info
+32 (int (*)(...))std::type_info::__is_pointer_p
+40 (int (*)(...))std::type_info::__is_function_p
+48 (int (*)(...))std::type_info::__do_catch
+56 (int (*)(...))std::type_info::__do_upcast
+
+Class std::type_info
+ size=16 align=8
+ base size=16 base align=8
+std::type_info (0x0x7f1e81306420) 0
+ vptr=((& std::type_info::_ZTVSt9type_info) + 16)
+
+Vtable for std::bad_cast
+std::bad_cast::_ZTVSt8bad_cast: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt8bad_cast)
+16 (int (*)(...))std::bad_cast::~bad_cast
+24 (int (*)(...))std::bad_cast::~bad_cast
+32 (int (*)(...))std::bad_cast::what
+
+Class std::bad_cast
+ size=8 align=8
+ base size=8 base align=8
+std::bad_cast (0x0x7f1e81e73750) 0 nearly-empty
+ vptr=((& std::bad_cast::_ZTVSt8bad_cast) + 16)
+ std::exception (0x0x7f1e813067e0) 0 nearly-empty
+ primary-for std::bad_cast (0x0x7f1e81e73750)
+
+Vtable for std::bad_typeid
+std::bad_typeid::_ZTVSt10bad_typeid: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt10bad_typeid)
+16 (int (*)(...))std::bad_typeid::~bad_typeid
+24 (int (*)(...))std::bad_typeid::~bad_typeid
+32 (int (*)(...))std::bad_typeid::what
+
+Class std::bad_typeid
+ size=8 align=8
+ base size=8 base align=8
+std::bad_typeid (0x0x7f1e81e737b8) 0 nearly-empty
+ vptr=((& std::bad_typeid::_ZTVSt10bad_typeid) + 16)
+ std::exception (0x0x7f1e813069c0) 0 nearly-empty
+ primary-for std::bad_typeid (0x0x7f1e81e737b8)
+
+Class std::__exception_ptr::exception_ptr
+ size=8 align=8
+ base size=8 base align=8
+std::__exception_ptr::exception_ptr (0x0x7f1e81306ba0) 0
+
+Vtable for std::nested_exception
+std::nested_exception::_ZTVSt16nested_exception: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt16nested_exception)
+16 (int (*)(...))std::nested_exception::~nested_exception
+24 (int (*)(...))std::nested_exception::~nested_exception
+
+Class std::nested_exception
+ size=16 align=8
+ base size=16 base align=8
+std::nested_exception (0x0x7f1e8133b180) 0
+ vptr=((& std::nested_exception::_ZTVSt16nested_exception) + 16)
+
+Vtable for std::bad_alloc
+std::bad_alloc::_ZTVSt9bad_alloc: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt9bad_alloc)
+16 (int (*)(...))std::bad_alloc::~bad_alloc
+24 (int (*)(...))std::bad_alloc::~bad_alloc
+32 (int (*)(...))std::bad_alloc::what
+
+Class std::bad_alloc
+ size=8 align=8
+ base size=8 base align=8
+std::bad_alloc (0x0x7f1e81e73820) 0 nearly-empty
+ vptr=((& std::bad_alloc::_ZTVSt9bad_alloc) + 16)
+ std::exception (0x0x7f1e8133b840) 0 nearly-empty
+ primary-for std::bad_alloc (0x0x7f1e81e73820)
+
+Vtable for std::bad_array_new_length
+std::bad_array_new_length::_ZTVSt20bad_array_new_length: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt20bad_array_new_length)
+16 (int (*)(...))std::bad_array_new_length::~bad_array_new_length
+24 (int (*)(...))std::bad_array_new_length::~bad_array_new_length
+32 (int (*)(...))std::bad_array_new_length::what
+
+Class std::bad_array_new_length
+ size=8 align=8
+ base size=8 base align=8
+std::bad_array_new_length (0x0x7f1e81e73888) 0 nearly-empty
+ vptr=((& std::bad_array_new_length::_ZTVSt20bad_array_new_length) + 16)
+ std::bad_alloc (0x0x7f1e81e738f0) 0 nearly-empty
+ primary-for std::bad_array_new_length (0x0x7f1e81e73888)
+ std::exception (0x0x7f1e8133ba20) 0 nearly-empty
+ primary-for std::bad_alloc (0x0x7f1e81e738f0)
+
+Class std::nothrow_t
+ size=1 align=1
+ base size=0 base align=1
+std::nothrow_t (0x0x7f1e8133bc00) 0 empty
+
+Class std::__allocator_traits_base
+ size=1 align=1
+ base size=0 base align=1
+std::__allocator_traits_base (0x0x7f1e8133bde0) 0 empty
+
+Class std::__numeric_limits_base
+ size=1 align=1
+ base size=0 base align=1
+std::__numeric_limits_base (0x0x7f1e813e4300) 0 empty
+
+Class QSysInfo
+ size=1 align=1
+ base size=0 base align=1
+QSysInfo (0x0x7f1e81057840) 0 empty
+
+Class QMessageLogContext
+ size=32 align=8
+ base size=32 base align=8
+QMessageLogContext (0x0x7f1e81057960) 0
+
+Class QMessageLogger
+ size=32 align=8
+ base size=32 base align=8
+QMessageLogger (0x0x7f1e81057b40) 0
+
+Class QFlag
+ size=4 align=4
+ base size=4 base align=4
+QFlag (0x0x7f1e81096240) 0
+
+Class QIncompatibleFlag
+ size=4 align=4
+ base size=4 base align=4
+QIncompatibleFlag (0x0x7f1e810d29c0) 0
+
+Class std::__atomic_flag_base
+ size=1 align=1
+ base size=1 base align=1
+std::__atomic_flag_base (0x0x7f1e80d6df00) 0
+
+Class std::atomic_flag
+ size=1 align=1
+ base size=1 base align=1
+std::atomic_flag (0x0x7f1e80d19750) 0
+ std::__atomic_flag_base (0x0x7f1e80d6df60) 0
+
+Class QAtomicInt
+ size=4 align=4
+ base size=4 base align=4
+QAtomicInt (0x0x7f1e80d19ea0) 0
+ QAtomicInteger<int> (0x0x7f1e80d19f08) 0
+ QBasicAtomicInteger<int> (0x0x7f1e80cb71e0) 0
+
+Class QInternal
+ size=1 align=1
+ base size=0 base align=1
+QInternal (0x0x7f1e804fed20) 0 empty
+
+Class QtPrivate::QSlotObjectBase
+ size=16 align=8
+ base size=16 base align=8
+QtPrivate::QSlotObjectBase (0x0x7f1e8056b300) 0
+
+Class QGenericArgument
+ size=16 align=8
+ base size=16 base align=8
+QGenericArgument (0x0x7f1e8056ba20) 0
+
+Class QGenericReturnArgument
+ size=16 align=8
+ base size=16 base align=8
+QGenericReturnArgument (0x0x7f1e8077cb60) 0
+ QGenericArgument (0x0x7f1e8056bcc0) 0
+
+Class QMetaObject::SuperData
+ size=8 align=8
+ base size=8 base align=8
+QMetaObject::SuperData (0x0x7f1e805a3180) 0
+
+Class QMetaObject
+ size=48 align=8
+ base size=48 base align=8
+QMetaObject (0x0x7f1e805a3120) 0
+
+Class QMetaObject::Connection
+ size=8 align=8
+ base size=8 base align=8
+QMetaObject::Connection (0x0x7f1e805a3a20) 0
+
+Class QLatin1Char
+ size=1 align=1
+ base size=1 base align=1
+QLatin1Char (0x0x7f1e80653540) 0
+
+Class QChar
+ size=2 align=2
+ base size=2 base align=2
+QChar (0x0x7f1e80653c60) 0
+
+Class QtPrivate::RefCount
+ size=4 align=4
+ base size=4 base align=4
+QtPrivate::RefCount (0x0x7f1e80326a80) 0
+
+Class QArrayData
+ size=24 align=8
+ base size=24 base align=8
+QArrayData (0x0x7f1e80326de0) 0
+
+Class QtPrivate::QContainerImplHelper
+ size=1 align=1
+ base size=0 base align=1
+QtPrivate::QContainerImplHelper (0x0x7f1e803ab120) 0 empty
+
+Class lconv
+ size=96 align=8
+ base size=96 base align=8
+lconv (0x0x7f1e80463960) 0
+
+Vtable for __cxxabiv1::__forced_unwind
+__cxxabiv1::__forced_unwind::_ZTVN10__cxxabiv115__forced_unwindE: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTIN10__cxxabiv115__forced_unwindE)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+
+Class __cxxabiv1::__forced_unwind
+ size=8 align=8
+ base size=8 base align=8
+__cxxabiv1::__forced_unwind (0x0x7f1e80463a20) 0 nearly-empty
+ vptr=((& __cxxabiv1::__forced_unwind::_ZTVN10__cxxabiv115__forced_unwindE) + 16)
+
+Class sched_param
+ size=4 align=4
+ base size=4 base align=4
+sched_param (0x0x7f1e80124b40) 0
+
+Class timex
+ size=208 align=8
+ base size=208 base align=8
+timex (0x0x7f1e80124c00) 0
+
+Class tm
+ size=56 align=8
+ base size=56 base align=8
+tm (0x0x7f1e80124c60) 0
+
+Class itimerspec
+ size=32 align=8
+ base size=32 base align=8
+itimerspec (0x0x7f1e80124cc0) 0
+
+Class _pthread_cleanup_buffer
+ size=32 align=8
+ base size=32 base align=8
+_pthread_cleanup_buffer (0x0x7f1e80124d20) 0
+
+Class __pthread_cleanup_frame
+ size=24 align=8
+ base size=24 base align=8
+__pthread_cleanup_frame (0x0x7f1e80124e40) 0
+
+Class __pthread_cleanup_class
+ size=24 align=8
+ base size=24 base align=8
+__pthread_cleanup_class (0x0x7f1e80124ea0) 0
+
+Class _IO_marker
+ size=24 align=8
+ base size=24 base align=8
+_IO_marker (0x0x7f1e80261e40) 0
+
+Class _IO_FILE
+ size=216 align=8
+ base size=216 base align=8
+_IO_FILE (0x0x7f1e80261ea0) 0
+
+Class std::_Hash_impl
+ size=1 align=1
+ base size=0 base align=1
+std::_Hash_impl (0x0x7f1e80028f00) 0 empty
+
+Class std::_Fnv_hash_impl
+ size=1 align=1
+ base size=0 base align=1
+std::_Fnv_hash_impl (0x0x7f1e800490c0) 0 empty
+
+Class std::locale
+ size=8 align=8
+ base size=8 base align=8
+std::locale (0x0x7f1e7fdd0240) 0
+
+Vtable for std::locale::facet
+std::locale::facet::_ZTVNSt6locale5facetE: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTINSt6locale5facetE)
+16 (int (*)(...))std::locale::facet::~facet
+24 (int (*)(...))std::locale::facet::~facet
+
+Class std::locale::facet
+ size=16 align=8
+ base size=12 base align=8
+std::locale::facet (0x0x7f1e7fdd0600) 0
+ vptr=((& std::locale::facet::_ZTVNSt6locale5facetE) + 16)
+
+Class std::locale::id
+ size=8 align=8
+ base size=8 base align=8
+std::locale::id (0x0x7f1e7fdd08a0) 0
+
+Class std::locale::_Impl
+ size=40 align=8
+ base size=40 base align=8
+std::locale::_Impl (0x0x7f1e7fdd0a80) 0
+
+Class std::__cow_string
+ size=8 align=8
+ base size=8 base align=8
+std::__cow_string (0x0x7f1e7fe23a80) 0
+
+Vtable for std::logic_error
+std::logic_error::_ZTVSt11logic_error: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt11logic_error)
+16 (int (*)(...))std::logic_error::~logic_error
+24 (int (*)(...))std::logic_error::~logic_error
+32 (int (*)(...))std::logic_error::what
+
+Class std::logic_error
+ size=16 align=8
+ base size=16 base align=8
+std::logic_error (0x0x7f1e8005ac98) 0
+ vptr=((& std::logic_error::_ZTVSt11logic_error) + 16)
+ std::exception (0x0x7f1e7fe23b40) 0 nearly-empty
+ primary-for std::logic_error (0x0x7f1e8005ac98)
+
+Vtable for std::domain_error
+std::domain_error::_ZTVSt12domain_error: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt12domain_error)
+16 (int (*)(...))std::domain_error::~domain_error
+24 (int (*)(...))std::domain_error::~domain_error
+32 (int (*)(...))std::logic_error::what
+
+Class std::domain_error
+ size=16 align=8
+ base size=16 base align=8
+std::domain_error (0x0x7f1e8005ad00) 0
+ vptr=((& std::domain_error::_ZTVSt12domain_error) + 16)
+ std::logic_error (0x0x7f1e8005ad68) 0
+ primary-for std::domain_error (0x0x7f1e8005ad00)
+ std::exception (0x0x7f1e7fe23ba0) 0 nearly-empty
+ primary-for std::logic_error (0x0x7f1e8005ad68)
+
+Vtable for std::invalid_argument
+std::invalid_argument::_ZTVSt16invalid_argument: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt16invalid_argument)
+16 (int (*)(...))std::invalid_argument::~invalid_argument
+24 (int (*)(...))std::invalid_argument::~invalid_argument
+32 (int (*)(...))std::logic_error::what
+
+Class std::invalid_argument
+ size=16 align=8
+ base size=16 base align=8
+std::invalid_argument (0x0x7f1e8005add0) 0
+ vptr=((& std::invalid_argument::_ZTVSt16invalid_argument) + 16)
+ std::logic_error (0x0x7f1e8005ae38) 0
+ primary-for std::invalid_argument (0x0x7f1e8005add0)
+ std::exception (0x0x7f1e7fe23c00) 0 nearly-empty
+ primary-for std::logic_error (0x0x7f1e8005ae38)
+
+Vtable for std::length_error
+std::length_error::_ZTVSt12length_error: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt12length_error)
+16 (int (*)(...))std::length_error::~length_error
+24 (int (*)(...))std::length_error::~length_error
+32 (int (*)(...))std::logic_error::what
+
+Class std::length_error
+ size=16 align=8
+ base size=16 base align=8
+std::length_error (0x0x7f1e8005aea0) 0
+ vptr=((& std::length_error::_ZTVSt12length_error) + 16)
+ std::logic_error (0x0x7f1e8005af08) 0
+ primary-for std::length_error (0x0x7f1e8005aea0)
+ std::exception (0x0x7f1e7fe23c60) 0 nearly-empty
+ primary-for std::logic_error (0x0x7f1e8005af08)
+
+Vtable for std::out_of_range
+std::out_of_range::_ZTVSt12out_of_range: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt12out_of_range)
+16 (int (*)(...))std::out_of_range::~out_of_range
+24 (int (*)(...))std::out_of_range::~out_of_range
+32 (int (*)(...))std::logic_error::what
+
+Class std::out_of_range
+ size=16 align=8
+ base size=16 base align=8
+std::out_of_range (0x0x7f1e8005af70) 0
+ vptr=((& std::out_of_range::_ZTVSt12out_of_range) + 16)
+ std::logic_error (0x0x7f1e8005a1a0) 0
+ primary-for std::out_of_range (0x0x7f1e8005af70)
+ std::exception (0x0x7f1e7fe23cc0) 0 nearly-empty
+ primary-for std::logic_error (0x0x7f1e8005a1a0)
+
+Vtable for std::runtime_error
+std::runtime_error::_ZTVSt13runtime_error: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt13runtime_error)
+16 (int (*)(...))std::runtime_error::~runtime_error
+24 (int (*)(...))std::runtime_error::~runtime_error
+32 (int (*)(...))std::runtime_error::what
+
+Class std::runtime_error
+ size=16 align=8
+ base size=16 base align=8
+std::runtime_error (0x0x7f1e8005a208) 0
+ vptr=((& std::runtime_error::_ZTVSt13runtime_error) + 16)
+ std::exception (0x0x7f1e7fe23d20) 0 nearly-empty
+ primary-for std::runtime_error (0x0x7f1e8005a208)
+
+Vtable for std::range_error
+std::range_error::_ZTVSt11range_error: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt11range_error)
+16 (int (*)(...))std::range_error::~range_error
+24 (int (*)(...))std::range_error::~range_error
+32 (int (*)(...))std::runtime_error::what
+
+Class std::range_error
+ size=16 align=8
+ base size=16 base align=8
+std::range_error (0x0x7f1e8005a548) 0
+ vptr=((& std::range_error::_ZTVSt11range_error) + 16)
+ std::runtime_error (0x0x7f1e8005a5b0) 0
+ primary-for std::range_error (0x0x7f1e8005a548)
+ std::exception (0x0x7f1e7fe23d80) 0 nearly-empty
+ primary-for std::runtime_error (0x0x7f1e8005a5b0)
+
+Vtable for std::overflow_error
+std::overflow_error::_ZTVSt14overflow_error: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt14overflow_error)
+16 (int (*)(...))std::overflow_error::~overflow_error
+24 (int (*)(...))std::overflow_error::~overflow_error
+32 (int (*)(...))std::runtime_error::what
+
+Class std::overflow_error
+ size=16 align=8
+ base size=16 base align=8
+std::overflow_error (0x0x7f1e7fe79000) 0
+ vptr=((& std::overflow_error::_ZTVSt14overflow_error) + 16)
+ std::runtime_error (0x0x7f1e7fe79068) 0
+ primary-for std::overflow_error (0x0x7f1e7fe79000)
+ std::exception (0x0x7f1e7fe23de0) 0 nearly-empty
+ primary-for std::runtime_error (0x0x7f1e7fe79068)
+
+Vtable for std::underflow_error
+std::underflow_error::_ZTVSt15underflow_error: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt15underflow_error)
+16 (int (*)(...))std::underflow_error::~underflow_error
+24 (int (*)(...))std::underflow_error::~underflow_error
+32 (int (*)(...))std::runtime_error::what
+
+Class std::underflow_error
+ size=16 align=8
+ base size=16 base align=8
+std::underflow_error (0x0x7f1e7fe790d0) 0
+ vptr=((& std::underflow_error::_ZTVSt15underflow_error) + 16)
+ std::runtime_error (0x0x7f1e7fe79138) 0
+ primary-for std::underflow_error (0x0x7f1e7fe790d0)
+ std::exception (0x0x7f1e7fe23e40) 0 nearly-empty
+ primary-for std::runtime_error (0x0x7f1e7fe79138)
+
+Vtable for std::_V2::error_category
+std::_V2::error_category::_ZTVNSt3_V214error_categoryE: 10 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTINSt3_V214error_categoryE)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))std::_V2::error_category::_M_message
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))std::_V2::error_category::default_error_condition
+64 (int (*)(...))std::_V2::error_category::equivalent
+72 (int (*)(...))std::_V2::error_category::equivalent
+
+Class std::_V2::error_category
+ size=8 align=8
+ base size=8 base align=8
+std::_V2::error_category (0x0x7f1e7fe83000) 0 nearly-empty
+ vptr=((& std::_V2::error_category::_ZTVNSt3_V214error_categoryE) + 16)
+
+Class std::error_code
+ size=16 align=8
+ base size=16 base align=8
+std::error_code (0x0x7f1e7fe83360) 0
+
+Class std::error_condition
+ size=16 align=8
+ base size=16 base align=8
+std::error_condition (0x0x7f1e7fe83ba0) 0
+
+Vtable for std::system_error
+std::system_error::_ZTVSt12system_error: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt12system_error)
+16 (int (*)(...))std::system_error::~system_error
+24 (int (*)(...))std::system_error::~system_error
+32 (int (*)(...))std::runtime_error::what
+
+Class std::system_error
+ size=32 align=8
+ base size=32 base align=8
+std::system_error (0x0x7f1e7fe79548) 0
+ vptr=((& std::system_error::_ZTVSt12system_error) + 16)
+ std::runtime_error (0x0x7f1e7fe795b0) 0
+ primary-for std::system_error (0x0x7f1e7fe79548)
+ std::exception (0x0x7f1e7feb7780) 0 nearly-empty
+ primary-for std::runtime_error (0x0x7f1e7fe795b0)
+
+Vtable for std::ios_base::failure
+std::ios_base::failure::_ZTVNSt8ios_base7failureB5cxx11E: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTINSt8ios_base7failureB5cxx11E)
+16 (int (*)(...))std::ios_base::failure::~failure
+24 (int (*)(...))std::ios_base::failure::~failure
+32 (int (*)(...))std::ios_base::failure::what
+
+Class std::ios_base::failure
+ size=32 align=8
+ base size=32 base align=8
+std::ios_base::failure (0x0x7f1e7fe79820) 0
+ vptr=((& std::ios_base::failure::_ZTVNSt8ios_base7failureB5cxx11E) + 16)
+ std::system_error (0x0x7f1e7fe79888) 0
+ primary-for std::ios_base::failure (0x0x7f1e7fe79820)
+ std::runtime_error (0x0x7f1e7fe798f0) 0
+ primary-for std::system_error (0x0x7f1e7fe79888)
+ std::exception (0x0x7f1e7fae9d20) 0 nearly-empty
+ primary-for std::runtime_error (0x0x7f1e7fe798f0)
+
+Class std::ios_base::_Callback_list
+ size=24 align=8
+ base size=24 base align=8
+std::ios_base::_Callback_list (0x0x7f1e7fae9d80) 0
+
+Class std::ios_base::_Words
+ size=16 align=8
+ base size=16 base align=8
+std::ios_base::_Words (0x0x7f1e7fae9de0) 0
+
+Class std::ios_base::Init
+ size=1 align=1
+ base size=0 base align=1
+std::ios_base::Init (0x0x7f1e7fae9e40) 0 empty
+
+Vtable for std::ios_base
+std::ios_base::_ZTVSt8ios_base: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt8ios_base)
+16 (int (*)(...))std::ios_base::~ios_base
+24 (int (*)(...))std::ios_base::~ios_base
+
+Class std::ios_base
+ size=216 align=8
+ base size=216 base align=8
+std::ios_base (0x0x7f1e7fae9cc0) 0
+ vptr=((& std::ios_base::_ZTVSt8ios_base) + 16)
+
+Class std::ctype_base
+ size=1 align=1
+ base size=0 base align=1
+std::ctype_base (0x0x7f1e7fbde780) 0 empty
+
+Class std::__num_base
+ size=1 align=1
+ base size=0 base align=1
+std::__num_base (0x0x7f1e7fc9e960) 0 empty
+
+VTT for std::basic_ostream<char>
+std::basic_ostream<char>::_ZTTSo: 2 entries
+0 ((& std::basic_ostream<char>::_ZTVSo) + 24)
+8 ((& std::basic_ostream<char>::_ZTVSo) + 64)
+
+VTT for std::basic_ostream<wchar_t>
+std::basic_ostream<wchar_t>::_ZTTSt13basic_ostreamIwSt11char_traitsIwEE: 2 entries
+0 ((& std::basic_ostream<wchar_t>::_ZTVSt13basic_ostreamIwSt11char_traitsIwEE) + 24)
+8 ((& std::basic_ostream<wchar_t>::_ZTVSt13basic_ostreamIwSt11char_traitsIwEE) + 64)
+
+VTT for std::basic_istream<char>
+std::basic_istream<char>::_ZTTSi: 2 entries
+0 ((& std::basic_istream<char>::_ZTVSi) + 24)
+8 ((& std::basic_istream<char>::_ZTVSi) + 64)
+
+VTT for std::basic_istream<wchar_t>
+std::basic_istream<wchar_t>::_ZTTSt13basic_istreamIwSt11char_traitsIwEE: 2 entries
+0 ((& std::basic_istream<wchar_t>::_ZTVSt13basic_istreamIwSt11char_traitsIwEE) + 24)
+8 ((& std::basic_istream<wchar_t>::_ZTVSt13basic_istreamIwSt11char_traitsIwEE) + 64)
+
+Construction vtable for std::basic_istream<char> (0x0x7f1e7f86e000 instance) in std::basic_iostream<char>
+std::basic_iostream<char>::_ZTCSd0_Si: 10 entries
+0 24
+8 (int (*)(...))0
+16 (int (*)(...))(& _ZTISi)
+24 0
+32 0
+40 18446744073709551592
+48 (int (*)(...))-24
+56 (int (*)(...))(& _ZTISi)
+64 0
+72 0
+
+Construction vtable for std::basic_ostream<char> (0x0x7f1e7f86e0d0 instance) in std::basic_iostream<char>
+std::basic_iostream<char>::_ZTCSd16_So: 10 entries
+0 8
+8 (int (*)(...))0
+16 (int (*)(...))(& _ZTISo)
+24 0
+32 0
+40 18446744073709551608
+48 (int (*)(...))-8
+56 (int (*)(...))(& _ZTISo)
+64 0
+72 0
+
+VTT for std::basic_iostream<char>
+std::basic_iostream<char>::_ZTTSd: 7 entries
+0 ((& std::basic_iostream<char>::_ZTVSd) + 24)
+8 ((& std::basic_iostream<char>::_ZTCSd0_Si) + 24)
+16 ((& std::basic_iostream<char>::_ZTCSd0_Si) + 64)
+24 ((& std::basic_iostream<char>::_ZTCSd16_So) + 24)
+32 ((& std::basic_iostream<char>::_ZTCSd16_So) + 64)
+40 ((& std::basic_iostream<char>::_ZTVSd) + 104)
+48 ((& std::basic_iostream<char>::_ZTVSd) + 64)
+
+Construction vtable for std::basic_istream<wchar_t> (0x0x7f1e7f86eea0 instance) in std::basic_iostream<wchar_t>
+std::basic_iostream<wchar_t>::_ZTCSt14basic_iostreamIwSt11char_traitsIwEE0_St13basic_istreamIwS1_E: 10 entries
+0 24
+8 (int (*)(...))0
+16 (int (*)(...))(& _ZTISt13basic_istreamIwSt11char_traitsIwEE)
+24 0
+32 0
+40 18446744073709551592
+48 (int (*)(...))-24
+56 (int (*)(...))(& _ZTISt13basic_istreamIwSt11char_traitsIwEE)
+64 0
+72 0
+
+Construction vtable for std::basic_ostream<wchar_t> (0x0x7f1e7f86ef70 instance) in std::basic_iostream<wchar_t>
+std::basic_iostream<wchar_t>::_ZTCSt14basic_iostreamIwSt11char_traitsIwEE16_St13basic_ostreamIwS1_E: 10 entries
+0 8
+8 (int (*)(...))0
+16 (int (*)(...))(& _ZTISt13basic_ostreamIwSt11char_traitsIwEE)
+24 0
+32 0
+40 18446744073709551608
+48 (int (*)(...))-8
+56 (int (*)(...))(& _ZTISt13basic_ostreamIwSt11char_traitsIwEE)
+64 0
+72 0
+
+VTT for std::basic_iostream<wchar_t>
+std::basic_iostream<wchar_t>::_ZTTSt14basic_iostreamIwSt11char_traitsIwEE: 7 entries
+0 ((& std::basic_iostream<wchar_t>::_ZTVSt14basic_iostreamIwSt11char_traitsIwEE) + 24)
+8 ((& std::basic_iostream<wchar_t>::_ZTCSt14basic_iostreamIwSt11char_traitsIwEE0_St13basic_istreamIwS1_E) + 24)
+16 ((& std::basic_iostream<wchar_t>::_ZTCSt14basic_iostreamIwSt11char_traitsIwEE0_St13basic_istreamIwS1_E) + 64)
+24 ((& std::basic_iostream<wchar_t>::_ZTCSt14basic_iostreamIwSt11char_traitsIwEE16_St13basic_ostreamIwS1_E) + 24)
+32 ((& std::basic_iostream<wchar_t>::_ZTCSt14basic_iostreamIwSt11char_traitsIwEE16_St13basic_ostreamIwS1_E) + 64)
+40 ((& std::basic_iostream<wchar_t>::_ZTVSt14basic_iostreamIwSt11char_traitsIwEE) + 104)
+48 ((& std::basic_iostream<wchar_t>::_ZTVSt14basic_iostreamIwSt11char_traitsIwEE) + 64)
+
+Class QByteArrayDataPtr
+ size=8 align=8
+ base size=8 base align=8
+QByteArrayDataPtr (0x0x7f1e7f8bf300) 0
+
+Class QByteArray
+ size=8 align=8
+ base size=8 base align=8
+QByteArray (0x0x7f1e7f8bf360) 0
+
+Class QByteRef
+ size=16 align=8
+ base size=12 base align=8
+QByteRef (0x0x7f1e7f5f2720) 0
+
+Class QByteArray::FromBase64Result
+ size=16 align=8
+ base size=12 base align=8
+QByteArray::FromBase64Result (0x0x7f1e7f68f480) 0
+
+Class QStringDataPtr
+ size=8 align=8
+ base size=8 base align=8
+QStringDataPtr (0x0x7f1e7f36d960) 0
+
+Class QStringView
+ size=16 align=8
+ base size=16 base align=8
+QStringView (0x0x7f1e7f36dde0) 0
+
+Class QLatin1String
+ size=16 align=8
+ base size=16 base align=8
+QLatin1String (0x0x7f1e7f480000) 0
+
+Class QString::Null
+ size=1 align=1
+ base size=0 base align=1
+QString::Null (0x0x7f1e7f140180) 0 empty
+
+Class QString
+ size=8 align=8
+ base size=8 base align=8
+QString (0x0x7f1e7f140060) 0
+
+Class QCharRef
+ size=16 align=8
+ base size=12 base align=8
+QCharRef (0x0x7f1e7efe2f60) 0
+
+Class QStringRef
+ size=16 align=8
+ base size=16 base align=8
+QStringRef (0x0x7f1e7ed7bb40) 0
+
+Class QtPrivate::ArgBase
+ size=1 align=1
+ base size=1 base align=1
+QtPrivate::ArgBase (0x0x7f1e7eb069c0) 0
+
+Class QtPrivate::QStringViewArg
+ size=24 align=8
+ base size=24 base align=8
+QtPrivate::QStringViewArg (0x0x7f1e7ee25618) 0
+ QtPrivate::ArgBase (0x0x7f1e7eb06a20) 0
+
+Class QtPrivate::QLatin1StringArg
+ size=24 align=8
+ base size=24 base align=8
+QtPrivate::QLatin1StringArg (0x0x7f1e7ee25680) 0
+ QtPrivate::ArgBase (0x0x7f1e7eb06c00) 0
+
+Class std::__erased_type
+ size=1 align=1
+ base size=0 base align=1
+std::__erased_type (0x0x7f1e7ebe3d20) 0 empty
+
+Class std::allocator_arg_t
+ size=1 align=1
+ base size=0 base align=1
+std::allocator_arg_t (0x0x7f1e7ebe3d80) 0 empty
+
+Class std::__uses_alloc_base
+ size=1 align=1
+ base size=0 base align=1
+std::__uses_alloc_base (0x0x7f1e7ebe3f00) 0 empty
+
+Class std::__uses_alloc0::_Sink
+ size=1 align=1
+ base size=0 base align=1
+std::__uses_alloc0::_Sink (0x0x7f1e7ec01000) 0 empty
+
+Class std::__uses_alloc0
+ size=1 align=1
+ base size=1 base align=1
+std::__uses_alloc0 (0x0x7f1e7ee25a28) 0
+ std::__uses_alloc_base (0x0x7f1e7ebe3f60) 0 empty
+
+Class std::_Swallow_assign
+ size=1 align=1
+ base size=0 base align=1
+std::_Swallow_assign (0x0x7f1e7e96d360) 0 empty
+
+Vtable for std::bad_function_call
+std::bad_function_call::_ZTVSt17bad_function_call: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt17bad_function_call)
+16 (int (*)(...))std::bad_function_call::~bad_function_call
+24 (int (*)(...))std::bad_function_call::~bad_function_call
+32 (int (*)(...))std::bad_function_call::what
+
+Class std::bad_function_call
+ size=8 align=8
+ base size=8 base align=8
+std::bad_function_call (0x0x7f1e7e8f8c98) 0 nearly-empty
+ vptr=((& std::bad_function_call::_ZTVSt17bad_function_call) + 16)
+ std::exception (0x0x7f1e7e9afc60) 0 nearly-empty
+ primary-for std::bad_function_call (0x0x7f1e7e8f8c98)
+
+Class std::_Nocopy_types
+ size=16 align=8
+ base size=16 base align=8
+std::_Nocopy_types (0x0x7f1e7e9afd20) 0
+
+Class std::_Any_data
+ size=16 align=8
+ base size=16 base align=8
+std::_Any_data (0x0x7f1e7e9afd80) 0
+
+Class std::_Function_base
+ size=24 align=8
+ base size=24 base align=8
+std::_Function_base (0x0x7f1e7e9e30c0) 0
+
+Class QtPrivate::QHashCombine
+ size=1 align=1
+ base size=0 base align=1
+QtPrivate::QHashCombine (0x0x7f1e7e7e1540) 0 empty
+
+Class QtPrivate::QHashCombineCommutative
+ size=1 align=1
+ base size=0 base align=1
+QtPrivate::QHashCombineCommutative (0x0x7f1e7e7e1600) 0 empty
+
+Class std::_Bit_reference
+ size=16 align=8
+ base size=16 base align=8
+std::_Bit_reference (0x0x7f1e7e4eacc0) 0
+
+Class std::_Bit_iterator_base
+ size=16 align=8
+ base size=12 base align=8
+std::_Bit_iterator_base (0x0x7f1e7e820820) 0
+ std::iterator<std::random_access_iterator_tag, bool> (0x0x7f1e7e509420) 0 empty
+
+Class std::_Bit_iterator
+ size=16 align=8
+ base size=12 base align=8
+std::_Bit_iterator (0x0x7f1e7e820958) 0
+ std::_Bit_iterator_base (0x0x7f1e7e8209c0) 0
+ std::iterator<std::random_access_iterator_tag, bool> (0x0x7f1e7e509a80) 0 empty
+
+Class std::_Bit_const_iterator
+ size=16 align=8
+ base size=12 base align=8
+std::_Bit_const_iterator (0x0x7f1e7e820a28) 0
+ std::_Bit_iterator_base (0x0x7f1e7e820a90) 0
+ std::iterator<std::random_access_iterator_tag, bool> (0x0x7f1e7e53f2a0) 0 empty
+
+Class std::__detail::_List_node_base
+ size=16 align=8
+ base size=16 base align=8
+std::__detail::_List_node_base (0x0x7f1e7e2f6a80) 0
+
+Class QListData::NotArrayCompatibleLayout
+ size=1 align=1
+ base size=0 base align=1
+QListData::NotArrayCompatibleLayout (0x0x7f1e7e3fb840) 0 empty
+
+Class QListData::NotIndirectLayout
+ size=1 align=1
+ base size=0 base align=1
+QListData::NotIndirectLayout (0x0x7f1e7e3fb8a0) 0 empty
+
+Class QListData::ArrayCompatibleLayout
+ size=1 align=1
+ base size=1 base align=1
+QListData::ArrayCompatibleLayout (0x0x7f1e7e65e4e0) 0 empty
+ QListData::NotIndirectLayout (0x0x7f1e7e3fb900) 0 empty
+
+Class QListData::InlineWithPaddingLayout
+ size=1 align=1
+ base size=1 base align=1
+QListData::InlineWithPaddingLayout (0x0x7f1e7e365700) 0 empty
+ QListData::NotArrayCompatibleLayout (0x0x7f1e7e3fb960) 0 empty
+ QListData::NotIndirectLayout (0x0x7f1e7e3fb9c0) 0 empty
+
+Class QListData::IndirectLayout
+ size=1 align=1
+ base size=1 base align=1
+QListData::IndirectLayout (0x0x7f1e7e65e548) 0 empty
+ QListData::NotArrayCompatibleLayout (0x0x7f1e7e3fba20) 0 empty
+
+Class QListData::Data
+ size=24 align=8
+ base size=24 base align=8
+QListData::Data (0x0x7f1e7e3fba80) 0
+
+Class QListData
+ size=8 align=8
+ base size=8 base align=8
+QListData (0x0x7f1e7e3fb7e0) 0
+
+Class QRegExp
+ size=8 align=8
+ base size=8 base align=8
+QRegExp (0x0x7f1e7e0eec00) 0
+
+Class QStringMatcher::Data
+ size=272 align=8
+ base size=272 base align=8
+QStringMatcher::Data (0x0x7f1e7e1e6180) 0
+
+Class QStringMatcher
+ size=1048 align=8
+ base size=1048 base align=8
+QStringMatcher (0x0x7f1e7e1e6120) 0
+
+Class QStringList
+ size=8 align=8
+ base size=8 base align=8
+QStringList (0x0x7f1e7e1e5208) 0
+ QList<QString> (0x0x7f1e7e1e5270) 0
+ QListSpecialMethods<QString> (0x0x7f1e7e1e63c0) 0 empty
+
+Class QScopedPointerPodDeleter
+ size=1 align=1
+ base size=0 base align=1
+QScopedPointerPodDeleter (0x0x7f1e7e2c5180) 0 empty
+
+Class std::_Rb_tree_node_base
+ size=32 align=8
+ base size=32 base align=8
+std::_Rb_tree_node_base (0x0x7f1e7df4d3c0) 0
+
+Class std::_Rb_tree_header
+ size=40 align=8
+ base size=40 base align=8
+std::_Rb_tree_header (0x0x7f1e7df4d720) 0
+
+Class QtPrivate::AbstractDebugStreamFunction
+ size=16 align=8
+ base size=16 base align=8
+QtPrivate::AbstractDebugStreamFunction (0x0x7f1e7dd96d20) 0
+
+Class QtPrivate::AbstractComparatorFunction
+ size=24 align=8
+ base size=24 base align=8
+QtPrivate::AbstractComparatorFunction (0x0x7f1e7ddb40c0) 0
+
+Class QtPrivate::AbstractConverterFunction
+ size=8 align=8
+ base size=8 base align=8
+QtPrivate::AbstractConverterFunction (0x0x7f1e7ddb4600) 0
+
+Class QMetaType
+ size=80 align=8
+ base size=80 base align=8
+QMetaType (0x0x7f1e7ddb4b40) 0
+
+Class QtMetaTypePrivate::VariantData
+ size=24 align=8
+ base size=20 base align=8
+QtMetaTypePrivate::VariantData (0x0x7f1e7de07e40) 0
+
+Class QtMetaTypePrivate::VectorBoolElements
+ size=1 align=1
+ base size=0 base align=1
+QtMetaTypePrivate::VectorBoolElements (0x0x7f1e7de3f540) 0 empty
+
+Class QtMetaTypePrivate::QSequentialIterableImpl
+ size=104 align=8
+ base size=104 base align=8
+QtMetaTypePrivate::QSequentialIterableImpl (0x0x7f1e7ded75a0) 0
+
+Class QtMetaTypePrivate::QAssociativeIterableImpl
+ size=112 align=8
+ base size=112 base align=8
+QtMetaTypePrivate::QAssociativeIterableImpl (0x0x7f1e7db4e6c0) 0
+
+Class QtMetaTypePrivate::QPairVariantInterfaceImpl
+ size=40 align=8
+ base size=40 base align=8
+QtMetaTypePrivate::QPairVariantInterfaceImpl (0x0x7f1e7dba5c00) 0
+
+Class std::chrono::_V2::system_clock
+ size=1 align=1
+ base size=0 base align=1
+std::chrono::_V2::system_clock (0x0x7f1e7da772a0) 0 empty
+
+Class std::chrono::_V2::steady_clock
+ size=1 align=1
+ base size=0 base align=1
+std::chrono::_V2::steady_clock (0x0x7f1e7d76dd20) 0 empty
+
+Vtable for QObjectData
+QObjectData::_ZTV11QObjectData: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QObjectData)
+16 (int (*)(...))__cxa_pure_virtual
+24 (int (*)(...))__cxa_pure_virtual
+
+Class QObjectData
+ size=48 align=8
+ base size=48 base align=8
+QObjectData (0x0x7f1e7d76dd80) 0
+ vptr=((& QObjectData::_ZTV11QObjectData) + 16)
+
+Class QObject::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QObject::QPrivateSignal (0x0x7f1e7d76df60) 0 empty
+
+Vtable for QObject
+QObject::_ZTV7QObject: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI7QObject)
+16 (int (*)(...))QObject::metaObject
+24 (int (*)(...))QObject::qt_metacast
+32 (int (*)(...))QObject::qt_metacall
+40 (int (*)(...))QObject::~QObject
+48 (int (*)(...))QObject::~QObject
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QObject
+ size=16 align=8
+ base size=16 base align=8
+QObject (0x0x7f1e7d76df00) 0
+ vptr=((& QObject::_ZTV7QObject) + 16)
+
+Vtable for QObjectUserData
+QObjectUserData::_ZTV15QObjectUserData: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QObjectUserData)
+16 (int (*)(...))QObjectUserData::~QObjectUserData
+24 (int (*)(...))QObjectUserData::~QObjectUserData
+
+Class QObjectUserData
+ size=8 align=8
+ base size=8 base align=8
+QObjectUserData (0x0x7f1e7d84ed80) 0 nearly-empty
+ vptr=((& QObjectUserData::_ZTV15QObjectUserData) + 16)
+
+Class QSignalBlocker
+ size=16 align=8
+ base size=10 base align=8
+QSignalBlocker (0x0x7f1e7d84ef00) 0
+
+Class QAbstractAnimation::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAbstractAnimation::QPrivateSignal (0x0x7f1e7d87c7e0) 0 empty
+
+Vtable for QAbstractAnimation
+QAbstractAnimation::_ZTV18QAbstractAnimation: 18 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QAbstractAnimation)
+16 (int (*)(...))QAbstractAnimation::metaObject
+24 (int (*)(...))QAbstractAnimation::qt_metacast
+32 (int (*)(...))QAbstractAnimation::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QAbstractAnimation::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))QAbstractAnimation::updateState
+136 (int (*)(...))QAbstractAnimation::updateDirection
+
+Class QAbstractAnimation
+ size=16 align=8
+ base size=16 base align=8
+QAbstractAnimation (0x0x7f1e7d83e9c0) 0
+ vptr=((& QAbstractAnimation::_ZTV18QAbstractAnimation) + 16)
+ QObject (0x0x7f1e7d87c780) 0
+ primary-for QAbstractAnimation (0x0x7f1e7d83e9c0)
+
+Class QAnimationDriver::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAnimationDriver::QPrivateSignal (0x0x7f1e7d87cba0) 0 empty
+
+Vtable for QAnimationDriver
+QAnimationDriver::_ZTV16QAnimationDriver: 18 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QAnimationDriver)
+16 (int (*)(...))QAnimationDriver::metaObject
+24 (int (*)(...))QAnimationDriver::qt_metacast
+32 (int (*)(...))QAnimationDriver::qt_metacall
+40 (int (*)(...))QAnimationDriver::~QAnimationDriver
+48 (int (*)(...))QAnimationDriver::~QAnimationDriver
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QAnimationDriver::advance
+120 (int (*)(...))QAnimationDriver::elapsed
+128 (int (*)(...))QAnimationDriver::start
+136 (int (*)(...))QAnimationDriver::stop
+
+Class QAnimationDriver
+ size=16 align=8
+ base size=16 base align=8
+QAnimationDriver (0x0x7f1e7d83ea28) 0
+ vptr=((& QAnimationDriver::_ZTV16QAnimationDriver) + 16)
+ QObject (0x0x7f1e7d87cb40) 0
+ primary-for QAnimationDriver (0x0x7f1e7d83ea28)
+
+Class QEventLoop::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QEventLoop::QPrivateSignal (0x0x7f1e7d87cde0) 0 empty
+
+Vtable for QEventLoop
+QEventLoop::_ZTV10QEventLoop: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QEventLoop)
+16 (int (*)(...))QEventLoop::metaObject
+24 (int (*)(...))QEventLoop::qt_metacast
+32 (int (*)(...))QEventLoop::qt_metacall
+40 (int (*)(...))QEventLoop::~QEventLoop
+48 (int (*)(...))QEventLoop::~QEventLoop
+56 (int (*)(...))QEventLoop::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QEventLoop
+ size=16 align=8
+ base size=16 base align=8
+QEventLoop (0x0x7f1e7d83ea90) 0
+ vptr=((& QEventLoop::_ZTV10QEventLoop) + 16)
+ QObject (0x0x7f1e7d87cd80) 0
+ primary-for QEventLoop (0x0x7f1e7d83ea90)
+
+Class QEventLoopLocker
+ size=8 align=8
+ base size=8 base align=8
+QEventLoopLocker (0x0x7f1e7d8cf6c0) 0
+
+Class QAbstractEventDispatcher::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAbstractEventDispatcher::QPrivateSignal (0x0x7f1e7d8cf780) 0 empty
+
+Class QAbstractEventDispatcher::TimerInfo
+ size=12 align=4
+ base size=12 base align=4
+QAbstractEventDispatcher::TimerInfo (0x0x7f1e7d8cf7e0) 0
+
+Vtable for QAbstractEventDispatcher
+QAbstractEventDispatcher::_ZTV24QAbstractEventDispatcher: 28 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI24QAbstractEventDispatcher)
+16 (int (*)(...))QAbstractEventDispatcher::metaObject
+24 (int (*)(...))QAbstractEventDispatcher::qt_metacast
+32 (int (*)(...))QAbstractEventDispatcher::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))__cxa_pure_virtual
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))__cxa_pure_virtual
+160 (int (*)(...))__cxa_pure_virtual
+168 (int (*)(...))__cxa_pure_virtual
+176 (int (*)(...))__cxa_pure_virtual
+184 (int (*)(...))__cxa_pure_virtual
+192 (int (*)(...))__cxa_pure_virtual
+200 (int (*)(...))__cxa_pure_virtual
+208 (int (*)(...))QAbstractEventDispatcher::startingUp
+216 (int (*)(...))QAbstractEventDispatcher::closingDown
+
+Class QAbstractEventDispatcher
+ size=16 align=8
+ base size=16 base align=8
+QAbstractEventDispatcher (0x0x7f1e7d83ebc8) 0
+ vptr=((& QAbstractEventDispatcher::_ZTV24QAbstractEventDispatcher) + 16)
+ QObject (0x0x7f1e7d8cf720) 0
+ primary-for QAbstractEventDispatcher (0x0x7f1e7d83ebc8)
+
+Class QMapNodeBase
+ size=24 align=8
+ base size=24 base align=8
+QMapNodeBase (0x0x7f1e7d52d7e0) 0
+
+Class QMapDataBase
+ size=40 align=8
+ base size=40 base align=8
+QMapDataBase (0x0x7f1e7d557480) 0
+
+Class QHashData::Node
+ size=16 align=8
+ base size=16 base align=8
+QHashData::Node (0x0x7f1e7d649000) 0
+
+Class QHashData
+ size=48 align=8
+ base size=44 base align=8
+QHashData (0x0x7f1e7d625f60) 0
+
+Class QHashDummyValue
+ size=1 align=1
+ base size=0 base align=1
+QHashDummyValue (0x0x7f1e7d6492a0) 0 empty
+
+Class QVariant::PrivateShared
+ size=16 align=8
+ base size=12 base align=8
+QVariant::PrivateShared (0x0x7f1e7d35dd20) 0
+
+Class QVariant::Private::Data
+ size=8 align=8
+ base size=8 base align=8
+QVariant::Private::Data (0x0x7f1e7d35dde0) 0
+
+Class QVariant::Private
+ size=16 align=8
+ base size=12 base align=8
+QVariant::Private (0x0x7f1e7d35dd80) 0
+
+Class QVariant::Handler
+ size=72 align=8
+ base size=72 base align=8
+QVariant::Handler (0x0x7f1e7d35de40) 0
+
+Class QVariant
+ size=16 align=8
+ base size=16 base align=8
+QVariant (0x0x7f1e7d35dcc0) 0
+
+Class QVariantComparisonHelper
+ size=8 align=8
+ base size=8 base align=8
+QVariantComparisonHelper (0x0x7f1e7d0e1120) 0
+
+Class QSequentialIterable::const_iterator
+ size=112 align=8
+ base size=112 base align=8
+QSequentialIterable::const_iterator (0x0x7f1e7d126780) 0
+
+Class QSequentialIterable
+ size=104 align=8
+ base size=104 base align=8
+QSequentialIterable (0x0x7f1e7d126720) 0
+
+Class QAssociativeIterable::const_iterator
+ size=120 align=8
+ base size=120 base align=8
+QAssociativeIterable::const_iterator (0x0x7f1e7d1268a0) 0
+
+Class QAssociativeIterable
+ size=112 align=8
+ base size=112 base align=8
+QAssociativeIterable (0x0x7f1e7d126840) 0
+
+Class QModelIndex
+ size=24 align=8
+ base size=24 base align=8
+QModelIndex (0x0x7f1e7d202c00) 0
+
+Class QPersistentModelIndex
+ size=8 align=8
+ base size=8 base align=8
+QPersistentModelIndex (0x0x7f1e7d27f840) 0
+
+Class QAbstractItemModel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAbstractItemModel::QPrivateSignal (0x0x7f1e7cf49660) 0 empty
+
+Vtable for QAbstractItemModel
+QAbstractItemModel::_ZTV18QAbstractItemModel: 48 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QAbstractItemModel)
+16 (int (*)(...))QAbstractItemModel::metaObject
+24 (int (*)(...))QAbstractItemModel::qt_metacast
+32 (int (*)(...))QAbstractItemModel::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))QAbstractItemModel::sibling
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))QAbstractItemModel::hasChildren
+160 (int (*)(...))__cxa_pure_virtual
+168 (int (*)(...))QAbstractItemModel::setData
+176 (int (*)(...))QAbstractItemModel::headerData
+184 (int (*)(...))QAbstractItemModel::setHeaderData
+192 (int (*)(...))QAbstractItemModel::itemData
+200 (int (*)(...))QAbstractItemModel::setItemData
+208 (int (*)(...))QAbstractItemModel::mimeTypes
+216 (int (*)(...))QAbstractItemModel::mimeData
+224 (int (*)(...))QAbstractItemModel::canDropMimeData
+232 (int (*)(...))QAbstractItemModel::dropMimeData
+240 (int (*)(...))QAbstractItemModel::supportedDropActions
+248 (int (*)(...))QAbstractItemModel::supportedDragActions
+256 (int (*)(...))QAbstractItemModel::insertRows
+264 (int (*)(...))QAbstractItemModel::insertColumns
+272 (int (*)(...))QAbstractItemModel::removeRows
+280 (int (*)(...))QAbstractItemModel::removeColumns
+288 (int (*)(...))QAbstractItemModel::moveRows
+296 (int (*)(...))QAbstractItemModel::moveColumns
+304 (int (*)(...))QAbstractItemModel::fetchMore
+312 (int (*)(...))QAbstractItemModel::canFetchMore
+320 (int (*)(...))QAbstractItemModel::flags
+328 (int (*)(...))QAbstractItemModel::sort
+336 (int (*)(...))QAbstractItemModel::buddy
+344 (int (*)(...))QAbstractItemModel::match
+352 (int (*)(...))QAbstractItemModel::span
+360 (int (*)(...))QAbstractItemModel::roleNames
+368 (int (*)(...))QAbstractItemModel::submit
+376 (int (*)(...))QAbstractItemModel::revert
+
+Class QAbstractItemModel
+ size=16 align=8
+ base size=16 base align=8
+QAbstractItemModel (0x0x7f1e7cf3be38) 0
+ vptr=((& QAbstractItemModel::_ZTV18QAbstractItemModel) + 16)
+ QObject (0x0x7f1e7cf49600) 0
+ primary-for QAbstractItemModel (0x0x7f1e7cf3be38)
+
+Class QAbstractTableModel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAbstractTableModel::QPrivateSignal (0x0x7f1e7d00ba20) 0 empty
+
+Vtable for QAbstractTableModel
+QAbstractTableModel::_ZTV19QAbstractTableModel: 48 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QAbstractTableModel)
+16 (int (*)(...))QAbstractTableModel::metaObject
+24 (int (*)(...))QAbstractTableModel::qt_metacast
+32 (int (*)(...))QAbstractTableModel::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QAbstractTableModel::index
+120 (int (*)(...))QAbstractTableModel::parent
+128 (int (*)(...))QAbstractTableModel::sibling
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))QAbstractTableModel::hasChildren
+160 (int (*)(...))__cxa_pure_virtual
+168 (int (*)(...))QAbstractItemModel::setData
+176 (int (*)(...))QAbstractItemModel::headerData
+184 (int (*)(...))QAbstractItemModel::setHeaderData
+192 (int (*)(...))QAbstractItemModel::itemData
+200 (int (*)(...))QAbstractItemModel::setItemData
+208 (int (*)(...))QAbstractItemModel::mimeTypes
+216 (int (*)(...))QAbstractItemModel::mimeData
+224 (int (*)(...))QAbstractItemModel::canDropMimeData
+232 (int (*)(...))QAbstractTableModel::dropMimeData
+240 (int (*)(...))QAbstractItemModel::supportedDropActions
+248 (int (*)(...))QAbstractItemModel::supportedDragActions
+256 (int (*)(...))QAbstractItemModel::insertRows
+264 (int (*)(...))QAbstractItemModel::insertColumns
+272 (int (*)(...))QAbstractItemModel::removeRows
+280 (int (*)(...))QAbstractItemModel::removeColumns
+288 (int (*)(...))QAbstractItemModel::moveRows
+296 (int (*)(...))QAbstractItemModel::moveColumns
+304 (int (*)(...))QAbstractItemModel::fetchMore
+312 (int (*)(...))QAbstractItemModel::canFetchMore
+320 (int (*)(...))QAbstractTableModel::flags
+328 (int (*)(...))QAbstractItemModel::sort
+336 (int (*)(...))QAbstractItemModel::buddy
+344 (int (*)(...))QAbstractItemModel::match
+352 (int (*)(...))QAbstractItemModel::span
+360 (int (*)(...))QAbstractItemModel::roleNames
+368 (int (*)(...))QAbstractItemModel::submit
+376 (int (*)(...))QAbstractItemModel::revert
+
+Class QAbstractTableModel
+ size=16 align=8
+ base size=16 base align=8
+QAbstractTableModel (0x0x7f1e7cf91478) 0
+ vptr=((& QAbstractTableModel::_ZTV19QAbstractTableModel) + 16)
+ QAbstractItemModel (0x0x7f1e7cf914e0) 0
+ primary-for QAbstractTableModel (0x0x7f1e7cf91478)
+ QObject (0x0x7f1e7d00b9c0) 0
+ primary-for QAbstractItemModel (0x0x7f1e7cf914e0)
+
+Class QAbstractListModel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAbstractListModel::QPrivateSignal (0x0x7f1e7d00bba0) 0 empty
+
+Vtable for QAbstractListModel
+QAbstractListModel::_ZTV18QAbstractListModel: 48 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QAbstractListModel)
+16 (int (*)(...))QAbstractListModel::metaObject
+24 (int (*)(...))QAbstractListModel::qt_metacast
+32 (int (*)(...))QAbstractListModel::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QAbstractListModel::index
+120 (int (*)(...))QAbstractListModel::parent
+128 (int (*)(...))QAbstractListModel::sibling
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))QAbstractListModel::columnCount
+152 (int (*)(...))QAbstractListModel::hasChildren
+160 (int (*)(...))__cxa_pure_virtual
+168 (int (*)(...))QAbstractItemModel::setData
+176 (int (*)(...))QAbstractItemModel::headerData
+184 (int (*)(...))QAbstractItemModel::setHeaderData
+192 (int (*)(...))QAbstractItemModel::itemData
+200 (int (*)(...))QAbstractItemModel::setItemData
+208 (int (*)(...))QAbstractItemModel::mimeTypes
+216 (int (*)(...))QAbstractItemModel::mimeData
+224 (int (*)(...))QAbstractItemModel::canDropMimeData
+232 (int (*)(...))QAbstractListModel::dropMimeData
+240 (int (*)(...))QAbstractItemModel::supportedDropActions
+248 (int (*)(...))QAbstractItemModel::supportedDragActions
+256 (int (*)(...))QAbstractItemModel::insertRows
+264 (int (*)(...))QAbstractItemModel::insertColumns
+272 (int (*)(...))QAbstractItemModel::removeRows
+280 (int (*)(...))QAbstractItemModel::removeColumns
+288 (int (*)(...))QAbstractItemModel::moveRows
+296 (int (*)(...))QAbstractItemModel::moveColumns
+304 (int (*)(...))QAbstractItemModel::fetchMore
+312 (int (*)(...))QAbstractItemModel::canFetchMore
+320 (int (*)(...))QAbstractListModel::flags
+328 (int (*)(...))QAbstractItemModel::sort
+336 (int (*)(...))QAbstractItemModel::buddy
+344 (int (*)(...))QAbstractItemModel::match
+352 (int (*)(...))QAbstractItemModel::span
+360 (int (*)(...))QAbstractItemModel::roleNames
+368 (int (*)(...))QAbstractItemModel::submit
+376 (int (*)(...))QAbstractItemModel::revert
+
+Class QAbstractListModel
+ size=16 align=8
+ base size=16 base align=8
+QAbstractListModel (0x0x7f1e7cf91548) 0
+ vptr=((& QAbstractListModel::_ZTV18QAbstractListModel) + 16)
+ QAbstractItemModel (0x0x7f1e7cf915b0) 0
+ primary-for QAbstractListModel (0x0x7f1e7cf91548)
+ QObject (0x0x7f1e7d00bb40) 0
+ primary-for QAbstractItemModel (0x0x7f1e7cf915b0)
+
+Vtable for QAbstractNativeEventFilter
+QAbstractNativeEventFilter::_ZTV26QAbstractNativeEventFilter: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI26QAbstractNativeEventFilter)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+
+Class QAbstractNativeEventFilter
+ size=16 align=8
+ base size=16 base align=8
+QAbstractNativeEventFilter (0x0x7f1e7d04f300) 0
+ vptr=((& QAbstractNativeEventFilter::_ZTV26QAbstractNativeEventFilter) + 16)
+
+Class QAbstractProxyModel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAbstractProxyModel::QPrivateSignal (0x0x7f1e7d04f3c0) 0 empty
+
+Vtable for QAbstractProxyModel
+QAbstractProxyModel::_ZTV19QAbstractProxyModel: 53 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QAbstractProxyModel)
+16 (int (*)(...))QAbstractProxyModel::metaObject
+24 (int (*)(...))QAbstractProxyModel::qt_metacast
+32 (int (*)(...))QAbstractProxyModel::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))QAbstractProxyModel::sibling
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))QAbstractProxyModel::hasChildren
+160 (int (*)(...))QAbstractProxyModel::data
+168 (int (*)(...))QAbstractProxyModel::setData
+176 (int (*)(...))QAbstractProxyModel::headerData
+184 (int (*)(...))QAbstractProxyModel::setHeaderData
+192 (int (*)(...))QAbstractProxyModel::itemData
+200 (int (*)(...))QAbstractProxyModel::setItemData
+208 (int (*)(...))QAbstractProxyModel::mimeTypes
+216 (int (*)(...))QAbstractProxyModel::mimeData
+224 (int (*)(...))QAbstractProxyModel::canDropMimeData
+232 (int (*)(...))QAbstractProxyModel::dropMimeData
+240 (int (*)(...))QAbstractProxyModel::supportedDropActions
+248 (int (*)(...))QAbstractProxyModel::supportedDragActions
+256 (int (*)(...))QAbstractItemModel::insertRows
+264 (int (*)(...))QAbstractItemModel::insertColumns
+272 (int (*)(...))QAbstractItemModel::removeRows
+280 (int (*)(...))QAbstractItemModel::removeColumns
+288 (int (*)(...))QAbstractItemModel::moveRows
+296 (int (*)(...))QAbstractItemModel::moveColumns
+304 (int (*)(...))QAbstractProxyModel::fetchMore
+312 (int (*)(...))QAbstractProxyModel::canFetchMore
+320 (int (*)(...))QAbstractProxyModel::flags
+328 (int (*)(...))QAbstractProxyModel::sort
+336 (int (*)(...))QAbstractProxyModel::buddy
+344 (int (*)(...))QAbstractItemModel::match
+352 (int (*)(...))QAbstractProxyModel::span
+360 (int (*)(...))QAbstractItemModel::roleNames
+368 (int (*)(...))QAbstractProxyModel::submit
+376 (int (*)(...))QAbstractProxyModel::revert
+384 (int (*)(...))QAbstractProxyModel::setSourceModel
+392 (int (*)(...))__cxa_pure_virtual
+400 (int (*)(...))__cxa_pure_virtual
+408 (int (*)(...))QAbstractProxyModel::mapSelectionToSource
+416 (int (*)(...))QAbstractProxyModel::mapSelectionFromSource
+
+Class QAbstractProxyModel
+ size=16 align=8
+ base size=16 base align=8
+QAbstractProxyModel (0x0x7f1e7cf91680) 0
+ vptr=((& QAbstractProxyModel::_ZTV19QAbstractProxyModel) + 16)
+ QAbstractItemModel (0x0x7f1e7cf916e8) 0
+ primary-for QAbstractProxyModel (0x0x7f1e7cf91680)
+ QObject (0x0x7f1e7d04f360) 0
+ primary-for QAbstractItemModel (0x0x7f1e7cf916e8)
+
+Class QAbstractState::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAbstractState::QPrivateSignal (0x0x7f1e7d04f600) 0 empty
+
+Vtable for QAbstractState
+QAbstractState::_ZTV14QAbstractState: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QAbstractState)
+16 (int (*)(...))QAbstractState::metaObject
+24 (int (*)(...))QAbstractState::qt_metacast
+32 (int (*)(...))QAbstractState::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QAbstractState::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+
+Class QAbstractState
+ size=16 align=8
+ base size=16 base align=8
+QAbstractState (0x0x7f1e7cf91750) 0
+ vptr=((& QAbstractState::_ZTV14QAbstractState) + 16)
+ QObject (0x0x7f1e7d04f5a0) 0
+ primary-for QAbstractState (0x0x7f1e7cf91750)
+
+Class QAbstractTransition::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAbstractTransition::QPrivateSignal (0x0x7f1e7d04f840) 0 empty
+
+Vtable for QAbstractTransition
+QAbstractTransition::_ZTV19QAbstractTransition: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QAbstractTransition)
+16 (int (*)(...))QAbstractTransition::metaObject
+24 (int (*)(...))QAbstractTransition::qt_metacast
+32 (int (*)(...))QAbstractTransition::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QAbstractTransition::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+
+Class QAbstractTransition
+ size=16 align=8
+ base size=16 base align=8
+QAbstractTransition (0x0x7f1e7cf917b8) 0
+ vptr=((& QAbstractTransition::_ZTV19QAbstractTransition) + 16)
+ QObject (0x0x7f1e7d04f7e0) 0
+ primary-for QAbstractTransition (0x0x7f1e7cf917b8)
+
+Class QAnimationGroup::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAnimationGroup::QPrivateSignal (0x0x7f1e7d04fb40) 0 empty
+
+Vtable for QAnimationGroup
+QAnimationGroup::_ZTV15QAnimationGroup: 18 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QAnimationGroup)
+16 (int (*)(...))QAnimationGroup::metaObject
+24 (int (*)(...))QAnimationGroup::qt_metacast
+32 (int (*)(...))QAnimationGroup::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QAnimationGroup::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))QAbstractAnimation::updateState
+136 (int (*)(...))QAbstractAnimation::updateDirection
+
+Class QAnimationGroup
+ size=16 align=8
+ base size=16 base align=8
+QAnimationGroup (0x0x7f1e7cf91820) 0
+ vptr=((& QAnimationGroup::_ZTV15QAnimationGroup) + 16)
+ QAbstractAnimation (0x0x7f1e7cf91888) 0
+ primary-for QAnimationGroup (0x0x7f1e7cf91820)
+ QObject (0x0x7f1e7d04fae0) 0
+ primary-for QAbstractAnimation (0x0x7f1e7cf91888)
+
+Class QBasicTimer
+ size=4 align=4
+ base size=4 base align=4
+QBasicTimer (0x0x7f1e7ccfce40) 0
+
+Class QBitArray
+ size=8 align=8
+ base size=8 base align=8
+QBitArray (0x0x7f1e7cd9a7e0) 0
+
+Class QBitRef
+ size=16 align=8
+ base size=12 base align=8
+QBitRef (0x0x7f1e7cdc57e0) 0
+
+Class QIODevice::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QIODevice::QPrivateSignal (0x0x7f1e7ce1aa80) 0 empty
+
+Vtable for QIODevice
+QIODevice::_ZTV9QIODevice: 30 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QIODevice)
+16 (int (*)(...))QIODevice::metaObject
+24 (int (*)(...))QIODevice::qt_metacast
+32 (int (*)(...))QIODevice::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QIODevice::isSequential
+120 (int (*)(...))QIODevice::open
+128 (int (*)(...))QIODevice::close
+136 (int (*)(...))QIODevice::pos
+144 (int (*)(...))QIODevice::size
+152 (int (*)(...))QIODevice::seek
+160 (int (*)(...))QIODevice::atEnd
+168 (int (*)(...))QIODevice::reset
+176 (int (*)(...))QIODevice::bytesAvailable
+184 (int (*)(...))QIODevice::bytesToWrite
+192 (int (*)(...))QIODevice::canReadLine
+200 (int (*)(...))QIODevice::waitForReadyRead
+208 (int (*)(...))QIODevice::waitForBytesWritten
+216 (int (*)(...))__cxa_pure_virtual
+224 (int (*)(...))QIODevice::readLineData
+232 (int (*)(...))__cxa_pure_virtual
+
+Class QIODevice
+ size=16 align=8
+ base size=16 base align=8
+QIODevice (0x0x7f1e7ce2a1a0) 0
+ vptr=((& QIODevice::_ZTV9QIODevice) + 16)
+ QObject (0x0x7f1e7ce1aa20) 0
+ primary-for QIODevice (0x0x7f1e7ce2a1a0)
+
+Class QBuffer::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QBuffer::QPrivateSignal (0x0x7f1e7ce67420) 0 empty
+
+Vtable for QBuffer
+QBuffer::_ZTV7QBuffer: 30 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI7QBuffer)
+16 (int (*)(...))QBuffer::metaObject
+24 (int (*)(...))QBuffer::qt_metacast
+32 (int (*)(...))QBuffer::qt_metacall
+40 (int (*)(...))QBuffer::~QBuffer
+48 (int (*)(...))QBuffer::~QBuffer
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QBuffer::connectNotify
+104 (int (*)(...))QBuffer::disconnectNotify
+112 (int (*)(...))QIODevice::isSequential
+120 (int (*)(...))QBuffer::open
+128 (int (*)(...))QBuffer::close
+136 (int (*)(...))QBuffer::pos
+144 (int (*)(...))QBuffer::size
+152 (int (*)(...))QBuffer::seek
+160 (int (*)(...))QBuffer::atEnd
+168 (int (*)(...))QIODevice::reset
+176 (int (*)(...))QIODevice::bytesAvailable
+184 (int (*)(...))QIODevice::bytesToWrite
+192 (int (*)(...))QBuffer::canReadLine
+200 (int (*)(...))QIODevice::waitForReadyRead
+208 (int (*)(...))QIODevice::waitForBytesWritten
+216 (int (*)(...))QBuffer::readData
+224 (int (*)(...))QIODevice::readLineData
+232 (int (*)(...))QBuffer::writeData
+
+Class QBuffer
+ size=16 align=8
+ base size=16 base align=8
+QBuffer (0x0x7f1e7ce2a2d8) 0
+ vptr=((& QBuffer::_ZTV7QBuffer) + 16)
+ QIODevice (0x0x7f1e7ce2a340) 0
+ primary-for QBuffer (0x0x7f1e7ce2a2d8)
+ QObject (0x0x7f1e7ce673c0) 0
+ primary-for QIODevice (0x0x7f1e7ce2a340)
+
+Class QByteArrayMatcher::Data
+ size=272 align=8
+ base size=272 base align=8
+QByteArrayMatcher::Data (0x0x7f1e7ce676c0) 0
+
+Class QByteArrayMatcher
+ size=1040 align=8
+ base size=1040 base align=8
+QByteArrayMatcher (0x0x7f1e7ce67660) 0
+
+Class QStaticByteArrayMatcherBase::Skiptable
+ size=256 align=1
+ base size=256 base align=1
+QStaticByteArrayMatcherBase::Skiptable (0x0x7f1e7ce67840) 0
+
+Class QStaticByteArrayMatcherBase
+ size=256 align=16
+ base size=256 base align=16
+QStaticByteArrayMatcherBase (0x0x7f1e7ce677e0) 0
+
+Class QSharedData
+ size=4 align=4
+ base size=4 base align=4
+QSharedData (0x0x7f1e7ceb9720) 0
+
+Class QLocale
+ size=8 align=8
+ base size=8 base align=8
+QLocale (0x0x7f1e7caf9600) 0
+
+Class QCalendar::YearMonthDay
+ size=12 align=4
+ base size=12 base align=4
+QCalendar::YearMonthDay (0x0x7f1e7cc53ae0) 0
+
+Class QCalendar
+ size=8 align=8
+ base size=8 base align=8
+QCalendar (0x0x7f1e7cc53a80) 0
+
+Class QDate
+ size=8 align=8
+ base size=8 base align=8
+QDate (0x0x7f1e7cc9d300) 0
+
+Class QTime
+ size=4 align=4
+ base size=4 base align=4
+QTime (0x0x7f1e7c8f6ba0) 0
+
+Class QDateTime::ShortData
+ size=8 align=8
+ base size=8 base align=8
+QDateTime::ShortData (0x0x7f1e7c963840) 0
+
+Class QDateTime::Data
+ size=8 align=8
+ base size=8 base align=8
+QDateTime::Data (0x0x7f1e7c9638a0) 0
+
+Class QDateTime
+ size=8 align=8
+ base size=8 base align=8
+QDateTime (0x0x7f1e7c9637e0) 0
+
+Vtable for QTextStream
+QTextStream::_ZTV11QTextStream: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QTextStream)
+16 (int (*)(...))QTextStream::~QTextStream
+24 (int (*)(...))QTextStream::~QTextStream
+
+Class QTextStream
+ size=16 align=8
+ base size=16 base align=8
+QTextStream (0x0x7f1e7ca34f60) 0
+ vptr=((& QTextStream::_ZTV11QTextStream) + 16)
+
+Class QTextStreamManipulator
+ size=40 align=8
+ base size=38 base align=8
+QTextStreamManipulator (0x0x7f1e7ca74840) 0
+
+Class QContiguousCacheData
+ size=24 align=4
+ base size=24 base align=4
+QContiguousCacheData (0x0x7f1e7c72d4e0) 0
+
+Vtable for __gnu_cxx::__concurrence_lock_error
+__gnu_cxx::__concurrence_lock_error::_ZTVN9__gnu_cxx24__concurrence_lock_errorE: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTIN9__gnu_cxx24__concurrence_lock_errorE)
+16 (int (*)(...))__gnu_cxx::__concurrence_lock_error::~__concurrence_lock_error
+24 (int (*)(...))__gnu_cxx::__concurrence_lock_error::~__concurrence_lock_error
+32 (int (*)(...))__gnu_cxx::__concurrence_lock_error::what
+
+Class __gnu_cxx::__concurrence_lock_error
+ size=8 align=8
+ base size=8 base align=8
+__gnu_cxx::__concurrence_lock_error (0x0x7f1e7ca4c340) 0 nearly-empty
+ vptr=((& __gnu_cxx::__concurrence_lock_error::_ZTVN9__gnu_cxx24__concurrence_lock_errorE) + 16)
+ std::exception (0x0x7f1e7c77e360) 0 nearly-empty
+ primary-for __gnu_cxx::__concurrence_lock_error (0x0x7f1e7ca4c340)
+
+Vtable for __gnu_cxx::__concurrence_unlock_error
+__gnu_cxx::__concurrence_unlock_error::_ZTVN9__gnu_cxx26__concurrence_unlock_errorE: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTIN9__gnu_cxx26__concurrence_unlock_errorE)
+16 (int (*)(...))__gnu_cxx::__concurrence_unlock_error::~__concurrence_unlock_error
+24 (int (*)(...))__gnu_cxx::__concurrence_unlock_error::~__concurrence_unlock_error
+32 (int (*)(...))__gnu_cxx::__concurrence_unlock_error::what
+
+Class __gnu_cxx::__concurrence_unlock_error
+ size=8 align=8
+ base size=8 base align=8
+__gnu_cxx::__concurrence_unlock_error (0x0x7f1e7ca4c3a8) 0 nearly-empty
+ vptr=((& __gnu_cxx::__concurrence_unlock_error::_ZTVN9__gnu_cxx26__concurrence_unlock_errorE) + 16)
+ std::exception (0x0x7f1e7c77e480) 0 nearly-empty
+ primary-for __gnu_cxx::__concurrence_unlock_error (0x0x7f1e7ca4c3a8)
+
+Vtable for __gnu_cxx::__concurrence_broadcast_error
+__gnu_cxx::__concurrence_broadcast_error::_ZTVN9__gnu_cxx29__concurrence_broadcast_errorE: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTIN9__gnu_cxx29__concurrence_broadcast_errorE)
+16 (int (*)(...))__gnu_cxx::__concurrence_broadcast_error::~__concurrence_broadcast_error
+24 (int (*)(...))__gnu_cxx::__concurrence_broadcast_error::~__concurrence_broadcast_error
+32 (int (*)(...))__gnu_cxx::__concurrence_broadcast_error::what
+
+Class __gnu_cxx::__concurrence_broadcast_error
+ size=8 align=8
+ base size=8 base align=8
+__gnu_cxx::__concurrence_broadcast_error (0x0x7f1e7ca4c410) 0 nearly-empty
+ vptr=((& __gnu_cxx::__concurrence_broadcast_error::_ZTVN9__gnu_cxx29__concurrence_broadcast_errorE) + 16)
+ std::exception (0x0x7f1e7c77e5a0) 0 nearly-empty
+ primary-for __gnu_cxx::__concurrence_broadcast_error (0x0x7f1e7ca4c410)
+
+Vtable for __gnu_cxx::__concurrence_wait_error
+__gnu_cxx::__concurrence_wait_error::_ZTVN9__gnu_cxx24__concurrence_wait_errorE: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTIN9__gnu_cxx24__concurrence_wait_errorE)
+16 (int (*)(...))__gnu_cxx::__concurrence_wait_error::~__concurrence_wait_error
+24 (int (*)(...))__gnu_cxx::__concurrence_wait_error::~__concurrence_wait_error
+32 (int (*)(...))__gnu_cxx::__concurrence_wait_error::what
+
+Class __gnu_cxx::__concurrence_wait_error
+ size=8 align=8
+ base size=8 base align=8
+__gnu_cxx::__concurrence_wait_error (0x0x7f1e7ca4c4e0) 0 nearly-empty
+ vptr=((& __gnu_cxx::__concurrence_wait_error::_ZTVN9__gnu_cxx24__concurrence_wait_errorE) + 16)
+ std::exception (0x0x7f1e7c77e6c0) 0 nearly-empty
+ primary-for __gnu_cxx::__concurrence_wait_error (0x0x7f1e7ca4c4e0)
+
+Class __gnu_cxx::__mutex
+ size=40 align=8
+ base size=40 base align=8
+__gnu_cxx::__mutex (0x0x7f1e7c7a3720) 0
+
+Class __gnu_cxx::__recursive_mutex
+ size=40 align=8
+ base size=40 base align=8
+__gnu_cxx::__recursive_mutex (0x0x7f1e7c7a3a20) 0
+
+Class __gnu_cxx::__scoped_lock
+ size=8 align=8
+ base size=8 base align=8
+__gnu_cxx::__scoped_lock (0x0x7f1e7c7a3d20) 0
+
+Class __gnu_cxx::__cond
+ size=48 align=8
+ base size=48 base align=8
+__gnu_cxx::__cond (0x0x7f1e7c7cb0c0) 0
+
+Vtable for std::bad_weak_ptr
+std::bad_weak_ptr::_ZTVSt12bad_weak_ptr: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt12bad_weak_ptr)
+16 (int (*)(...))std::bad_weak_ptr::~bad_weak_ptr
+24 (int (*)(...))std::bad_weak_ptr::~bad_weak_ptr
+32 (int (*)(...))std::bad_weak_ptr::what
+
+Class std::bad_weak_ptr
+ size=8 align=8
+ base size=8 base align=8
+std::bad_weak_ptr (0x0x7f1e7ca4c548) 0 nearly-empty
+ vptr=((& std::bad_weak_ptr::_ZTVSt12bad_weak_ptr) + 16)
+ std::exception (0x0x7f1e7c8422a0) 0 nearly-empty
+ primary-for std::bad_weak_ptr (0x0x7f1e7ca4c548)
+
+Class std::_Sp_make_shared_tag
+ size=1 align=1
+ base size=0 base align=1
+std::_Sp_make_shared_tag (0x0x7f1e7c8ab240) 0 empty
+
+Class std::__sp_array_delete
+ size=1 align=1
+ base size=0 base align=1
+std::__sp_array_delete (0x0x7f1e7c8ab660) 0 empty
+
+Class std::_Sp_locker
+ size=2 align=1
+ base size=2 base align=1
+std::_Sp_locker (0x0x7f1e7c5ec4e0) 0
+
+Class QtSharedPointer::NormalDeleter
+ size=1 align=1
+ base size=0 base align=1
+QtSharedPointer::NormalDeleter (0x0x7f1e7c6209c0) 0 empty
+
+Class QtSharedPointer::ExternalRefCountData
+ size=16 align=8
+ base size=16 base align=8
+QtSharedPointer::ExternalRefCountData (0x0x7f1e7c620b40) 0
+
+Class QtPrivate::EnableInternalData
+ size=1 align=1
+ base size=0 base align=1
+QtPrivate::EnableInternalData (0x0x7f1e7c6a8480) 0 empty
+
+Class QDebug::Stream
+ size=80 align=8
+ base size=76 base align=8
+QDebug::Stream (0x0x7f1e7c6d2b40) 0
+
+Class QDebug
+ size=8 align=8
+ base size=8 base align=8
+QDebug (0x0x7f1e7c6d2ae0) 0
+
+Class QDebugStateSaver
+ size=8 align=8
+ base size=8 base align=8
+QDebugStateSaver (0x0x7f1e7c467480) 0
+
+Class QNoDebug
+ size=1 align=1
+ base size=0 base align=1
+QNoDebug (0x0x7f1e7c467540) 0 empty
+
+Class QCborError
+ size=4 align=4
+ base size=4 base align=4
+QCborError (0x0x7f1e7c0e8780) 0
+
+Class QRegularExpression
+ size=8 align=8
+ base size=8 base align=8
+QRegularExpression (0x0x7f1e7c0e8f00) 0
+
+Class QRegularExpressionMatch
+ size=8 align=8
+ base size=8 base align=8
+QRegularExpressionMatch (0x0x7f1e7c1aade0) 0
+
+Class QRegularExpressionMatchIterator
+ size=8 align=8
+ base size=8 base align=8
+QRegularExpressionMatchIterator (0x0x7f1e7c20eba0) 0
+
+Class QUrl
+ size=8 align=8
+ base size=8 base align=8
+QUrl (0x0x7f1e7c28b600) 0
+
+Class QUuid
+ size=16 align=4
+ base size=16 base align=4
+QUuid (0x0x7f1e7bfd75a0) 0
+
+Class QCborParserError
+ size=16 align=8
+ base size=12 base align=8
+QCborParserError (0x0x7f1e7c05b120) 0
+
+Class QCborValue
+ size=24 align=8
+ base size=20 base align=8
+QCborValue (0x0x7f1e7c05b1e0) 0
+
+Class QCborValueRef
+ size=16 align=8
+ base size=16 base align=8
+QCborValueRef (0x0x7f1e7be984e0) 0
+
+Class QCborArray::Iterator
+ size=16 align=8
+ base size=16 base align=8
+QCborArray::Iterator (0x0x7f1e7bb0ae40) 0
+
+Class QCborArray::ConstIterator
+ size=16 align=8
+ base size=16 base align=8
+QCborArray::ConstIterator (0x0x7f1e7bb0aea0) 0
+
+Class QCborArray
+ size=8 align=8
+ base size=8 base align=8
+QCborArray (0x0x7f1e7bb0ade0) 0
+
+Class QCborMap::Iterator
+ size=16 align=8
+ base size=16 base align=8
+QCborMap::Iterator (0x0x7f1e7bc8ca80) 0
+
+Class QCborMap::ConstIterator
+ size=16 align=8
+ base size=16 base align=8
+QCborMap::ConstIterator (0x0x7f1e7bc8cae0) 0
+
+Class QCborMap
+ size=8 align=8
+ base size=8 base align=8
+QCborMap (0x0x7f1e7bc8ca20) 0
+
+Class qfloat16::Wrap
+ size=2 align=2
+ base size=2 base align=2
+qfloat16::Wrap (0x0x7f1e7baae2a0) 0
+
+Class qfloat16
+ size=2 align=2
+ base size=2 base align=2
+qfloat16 (0x0x7f1e7baae240) 0
+
+Class QCborStreamReader
+ size=24 align=8
+ base size=20 base align=8
+QCborStreamReader (0x0x7f1e7b79e060) 0
+
+Class QCborStreamWriter
+ size=8 align=8
+ base size=8 base align=8
+QCborStreamWriter (0x0x7f1e7b821600) 0
+
+Class QCollatorSortKey
+ size=8 align=8
+ base size=8 base align=8
+QCollatorSortKey (0x0x7f1e7b821ea0) 0
+
+Class QCollator
+ size=8 align=8
+ base size=8 base align=8
+QCollator (0x0x7f1e7b85e0c0) 0
+
+Class QCommandLineOption
+ size=8 align=8
+ base size=8 base align=8
+QCommandLineOption (0x0x7f1e7b54b6c0) 0
+
+Vtable for QEvent
+QEvent::_ZTV6QEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI6QEvent)
+16 (int (*)(...))QEvent::~QEvent
+24 (int (*)(...))QEvent::~QEvent
+
+Class QEvent
+ size=24 align=8
+ base size=20 base align=8
+QEvent (0x0x7f1e7b612c00) 0
+ vptr=((& QEvent::_ZTV6QEvent) + 16)
+
+Vtable for QTimerEvent
+QTimerEvent::_ZTV11QTimerEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QTimerEvent)
+16 (int (*)(...))QTimerEvent::~QTimerEvent
+24 (int (*)(...))QTimerEvent::~QTimerEvent
+
+Class QTimerEvent
+ size=24 align=8
+ base size=24 base align=8
+QTimerEvent (0x0x7f1e7b615410) 0
+ vptr=((& QTimerEvent::_ZTV11QTimerEvent) + 16)
+ QEvent (0x0x7f1e7b658000) 0
+ primary-for QTimerEvent (0x0x7f1e7b615410)
+
+Vtable for QChildEvent
+QChildEvent::_ZTV11QChildEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QChildEvent)
+16 (int (*)(...))QChildEvent::~QChildEvent
+24 (int (*)(...))QChildEvent::~QChildEvent
+
+Class QChildEvent
+ size=32 align=8
+ base size=32 base align=8
+QChildEvent (0x0x7f1e7b615478) 0
+ vptr=((& QChildEvent::_ZTV11QChildEvent) + 16)
+ QEvent (0x0x7f1e7b6580c0) 0
+ primary-for QChildEvent (0x0x7f1e7b615478)
+
+Vtable for QDynamicPropertyChangeEvent
+QDynamicPropertyChangeEvent::_ZTV27QDynamicPropertyChangeEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI27QDynamicPropertyChangeEvent)
+16 (int (*)(...))QDynamicPropertyChangeEvent::~QDynamicPropertyChangeEvent
+24 (int (*)(...))QDynamicPropertyChangeEvent::~QDynamicPropertyChangeEvent
+
+Class QDynamicPropertyChangeEvent
+ size=32 align=8
+ base size=32 base align=8
+QDynamicPropertyChangeEvent (0x0x7f1e7b6159c0) 0
+ vptr=((& QDynamicPropertyChangeEvent::_ZTV27QDynamicPropertyChangeEvent) + 16)
+ QEvent (0x0x7f1e7b658720) 0
+ primary-for QDynamicPropertyChangeEvent (0x0x7f1e7b6159c0)
+
+Vtable for QDeferredDeleteEvent
+QDeferredDeleteEvent::_ZTV20QDeferredDeleteEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QDeferredDeleteEvent)
+16 (int (*)(...))QDeferredDeleteEvent::~QDeferredDeleteEvent
+24 (int (*)(...))QDeferredDeleteEvent::~QDeferredDeleteEvent
+
+Class QDeferredDeleteEvent
+ size=24 align=8
+ base size=24 base align=8
+QDeferredDeleteEvent (0x0x7f1e7b615a28) 0
+ vptr=((& QDeferredDeleteEvent::_ZTV20QDeferredDeleteEvent) + 16)
+ QEvent (0x0x7f1e7b6587e0) 0
+ primary-for QDeferredDeleteEvent (0x0x7f1e7b615a28)
+
+Class QCoreApplication::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QCoreApplication::QPrivateSignal (0x0x7f1e7b658900) 0 empty
+
+Vtable for QCoreApplication
+QCoreApplication::_ZTV16QCoreApplication: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QCoreApplication)
+16 (int (*)(...))QCoreApplication::metaObject
+24 (int (*)(...))QCoreApplication::qt_metacast
+32 (int (*)(...))QCoreApplication::qt_metacall
+40 (int (*)(...))QCoreApplication::~QCoreApplication
+48 (int (*)(...))QCoreApplication::~QCoreApplication
+56 (int (*)(...))QCoreApplication::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QCoreApplication::notify
+120 (int (*)(...))QCoreApplication::compressEvent
+
+Class QCoreApplication
+ size=16 align=8
+ base size=16 base align=8
+QCoreApplication (0x0x7f1e7b615a90) 0
+ vptr=((& QCoreApplication::_ZTV16QCoreApplication) + 16)
+ QObject (0x0x7f1e7b6588a0) 0
+ primary-for QCoreApplication (0x0x7f1e7b615a90)
+
+Class QCommandLineParser
+ size=8 align=8
+ base size=8 base align=8
+QCommandLineParser (0x0x7f1e7b658b40) 0
+
+Class QConcatenateTablesProxyModel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QConcatenateTablesProxyModel::QPrivateSignal (0x0x7f1e7b658cc0) 0 empty
+
+Vtable for QConcatenateTablesProxyModel
+QConcatenateTablesProxyModel::_ZTV28QConcatenateTablesProxyModel: 48 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI28QConcatenateTablesProxyModel)
+16 (int (*)(...))QConcatenateTablesProxyModel::metaObject
+24 (int (*)(...))QConcatenateTablesProxyModel::qt_metacast
+32 (int (*)(...))QConcatenateTablesProxyModel::qt_metacall
+40 (int (*)(...))QConcatenateTablesProxyModel::~QConcatenateTablesProxyModel
+48 (int (*)(...))QConcatenateTablesProxyModel::~QConcatenateTablesProxyModel
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QConcatenateTablesProxyModel::index
+120 (int (*)(...))QConcatenateTablesProxyModel::parent
+128 (int (*)(...))QAbstractItemModel::sibling
+136 (int (*)(...))QConcatenateTablesProxyModel::rowCount
+144 (int (*)(...))QConcatenateTablesProxyModel::columnCount
+152 (int (*)(...))QAbstractItemModel::hasChildren
+160 (int (*)(...))QConcatenateTablesProxyModel::data
+168 (int (*)(...))QConcatenateTablesProxyModel::setData
+176 (int (*)(...))QConcatenateTablesProxyModel::headerData
+184 (int (*)(...))QAbstractItemModel::setHeaderData
+192 (int (*)(...))QConcatenateTablesProxyModel::itemData
+200 (int (*)(...))QConcatenateTablesProxyModel::setItemData
+208 (int (*)(...))QConcatenateTablesProxyModel::mimeTypes
+216 (int (*)(...))QConcatenateTablesProxyModel::mimeData
+224 (int (*)(...))QConcatenateTablesProxyModel::canDropMimeData
+232 (int (*)(...))QConcatenateTablesProxyModel::dropMimeData
+240 (int (*)(...))QAbstractItemModel::supportedDropActions
+248 (int (*)(...))QAbstractItemModel::supportedDragActions
+256 (int (*)(...))QAbstractItemModel::insertRows
+264 (int (*)(...))QAbstractItemModel::insertColumns
+272 (int (*)(...))QAbstractItemModel::removeRows
+280 (int (*)(...))QAbstractItemModel::removeColumns
+288 (int (*)(...))QAbstractItemModel::moveRows
+296 (int (*)(...))QAbstractItemModel::moveColumns
+304 (int (*)(...))QAbstractItemModel::fetchMore
+312 (int (*)(...))QAbstractItemModel::canFetchMore
+320 (int (*)(...))QConcatenateTablesProxyModel::flags
+328 (int (*)(...))QAbstractItemModel::sort
+336 (int (*)(...))QAbstractItemModel::buddy
+344 (int (*)(...))QAbstractItemModel::match
+352 (int (*)(...))QConcatenateTablesProxyModel::span
+360 (int (*)(...))QAbstractItemModel::roleNames
+368 (int (*)(...))QAbstractItemModel::submit
+376 (int (*)(...))QAbstractItemModel::revert
+
+Class QConcatenateTablesProxyModel
+ size=16 align=8
+ base size=16 base align=8
+QConcatenateTablesProxyModel (0x0x7f1e7b615af8) 0
+ vptr=((& QConcatenateTablesProxyModel::_ZTV28QConcatenateTablesProxyModel) + 16)
+ QAbstractItemModel (0x0x7f1e7b615b60) 0
+ primary-for QConcatenateTablesProxyModel (0x0x7f1e7b615af8)
+ QObject (0x0x7f1e7b658c60) 0
+ primary-for QAbstractItemModel (0x0x7f1e7b615b60)
+
+Class QCryptographicHash
+ size=8 align=8
+ base size=8 base align=8
+QCryptographicHash (0x0x7f1e7b658ea0) 0
+
+Class QDataStream
+ size=32 align=8
+ base size=32 base align=8
+QDataStream (0x0x7f1e7b6c3000) 0
+
+Class QtPrivate::StreamStateSaver
+ size=16 align=8
+ base size=12 base align=8
+QtPrivate::StreamStateSaver (0x0x7f1e7b6c3180) 0
+
+Class QElapsedTimer
+ size=16 align=8
+ base size=16 base align=8
+QElapsedTimer (0x0x7f1e7b31b9c0) 0
+
+Class QDeadlineTimer
+ size=16 align=8
+ base size=16 base align=8
+QDeadlineTimer (0x0x7f1e7b34b120) 0
+
+Class QFileDevice::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QFileDevice::QPrivateSignal (0x0x7f1e7b467de0) 0 empty
+
+Vtable for QFileDevice
+QFileDevice::_ZTV11QFileDevice: 34 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QFileDevice)
+16 (int (*)(...))QFileDevice::metaObject
+24 (int (*)(...))QFileDevice::qt_metacast
+32 (int (*)(...))QFileDevice::qt_metacall
+40 (int (*)(...))QFileDevice::~QFileDevice
+48 (int (*)(...))QFileDevice::~QFileDevice
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QFileDevice::isSequential
+120 (int (*)(...))QIODevice::open
+128 (int (*)(...))QFileDevice::close
+136 (int (*)(...))QFileDevice::pos
+144 (int (*)(...))QFileDevice::size
+152 (int (*)(...))QFileDevice::seek
+160 (int (*)(...))QFileDevice::atEnd
+168 (int (*)(...))QIODevice::reset
+176 (int (*)(...))QIODevice::bytesAvailable
+184 (int (*)(...))QIODevice::bytesToWrite
+192 (int (*)(...))QIODevice::canReadLine
+200 (int (*)(...))QIODevice::waitForReadyRead
+208 (int (*)(...))QIODevice::waitForBytesWritten
+216 (int (*)(...))QFileDevice::readData
+224 (int (*)(...))QFileDevice::readLineData
+232 (int (*)(...))QFileDevice::writeData
+240 (int (*)(...))QFileDevice::fileName
+248 (int (*)(...))QFileDevice::resize
+256 (int (*)(...))QFileDevice::permissions
+264 (int (*)(...))QFileDevice::setPermissions
+
+Class QFileDevice
+ size=16 align=8
+ base size=16 base align=8
+QFileDevice (0x0x7f1e7b466d68) 0
+ vptr=((& QFileDevice::_ZTV11QFileDevice) + 16)
+ QIODevice (0x0x7f1e7b466dd0) 0
+ primary-for QFileDevice (0x0x7f1e7b466d68)
+ QObject (0x0x7f1e7b467d80) 0
+ primary-for QIODevice (0x0x7f1e7b466dd0)
+
+Class QFile::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QFile::QPrivateSignal (0x0x7f1e7b4a2720) 0 empty
+
+Vtable for QFile
+QFile::_ZTV5QFile: 34 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI5QFile)
+16 (int (*)(...))QFile::metaObject
+24 (int (*)(...))QFile::qt_metacast
+32 (int (*)(...))QFile::qt_metacall
+40 (int (*)(...))QFile::~QFile
+48 (int (*)(...))QFile::~QFile
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QFileDevice::isSequential
+120 (int (*)(...))QFile::open
+128 (int (*)(...))QFileDevice::close
+136 (int (*)(...))QFileDevice::pos
+144 (int (*)(...))QFile::size
+152 (int (*)(...))QFileDevice::seek
+160 (int (*)(...))QFileDevice::atEnd
+168 (int (*)(...))QIODevice::reset
+176 (int (*)(...))QIODevice::bytesAvailable
+184 (int (*)(...))QIODevice::bytesToWrite
+192 (int (*)(...))QIODevice::canReadLine
+200 (int (*)(...))QIODevice::waitForReadyRead
+208 (int (*)(...))QIODevice::waitForBytesWritten
+216 (int (*)(...))QFileDevice::readData
+224 (int (*)(...))QFileDevice::readLineData
+232 (int (*)(...))QFileDevice::writeData
+240 (int (*)(...))QFile::fileName
+248 (int (*)(...))QFile::resize
+256 (int (*)(...))QFile::permissions
+264 (int (*)(...))QFile::setPermissions
+
+Class QFile
+ size=16 align=8
+ base size=16 base align=8
+QFile (0x0x7f1e7b466f08) 0
+ vptr=((& QFile::_ZTV5QFile) + 16)
+ QFileDevice (0x0x7f1e7b466f70) 0
+ primary-for QFile (0x0x7f1e7b466f08)
+ QIODevice (0x0x7f1e7b4c7000) 0
+ primary-for QFileDevice (0x0x7f1e7b466f70)
+ QObject (0x0x7f1e7b4a26c0) 0
+ primary-for QIODevice (0x0x7f1e7b4c7000)
+
+Class QFileInfo
+ size=8 align=8
+ base size=8 base align=8
+QFileInfo (0x0x7f1e7b4a2d80) 0
+
+Class QDir
+ size=8 align=8
+ base size=8 base align=8
+QDir (0x0x7f1e7b1abc60) 0
+
+Class QDirIterator
+ size=8 align=8
+ base size=8 base align=8
+QDirIterator (0x0x7f1e7b2cdc60) 0
+
+Class QEasingCurve
+ size=8 align=8
+ base size=8 base align=8
+QEasingCurve (0x0x7f1e7af1d420) 0
+
+Class QEventTransition::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QEventTransition::QPrivateSignal (0x0x7f1e7b027540) 0 empty
+
+Vtable for QEventTransition
+QEventTransition::_ZTV16QEventTransition: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QEventTransition)
+16 (int (*)(...))QEventTransition::metaObject
+24 (int (*)(...))QEventTransition::qt_metacast
+32 (int (*)(...))QEventTransition::qt_metacall
+40 (int (*)(...))QEventTransition::~QEventTransition
+48 (int (*)(...))QEventTransition::~QEventTransition
+56 (int (*)(...))QEventTransition::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QEventTransition::eventTest
+120 (int (*)(...))QEventTransition::onTransition
+
+Class QEventTransition
+ size=16 align=8
+ base size=16 base align=8
+QEventTransition (0x0x7f1e7afdec98) 0
+ vptr=((& QEventTransition::_ZTV16QEventTransition) + 16)
+ QAbstractTransition (0x0x7f1e7afded00) 0
+ primary-for QEventTransition (0x0x7f1e7afdec98)
+ QObject (0x0x7f1e7b0274e0) 0
+ primary-for QAbstractTransition (0x0x7f1e7afded00)
+
+Vtable for QException
+QException::_ZTV10QException: 7 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QException)
+16 (int (*)(...))QException::~QException
+24 (int (*)(...))QException::~QException
+32 (int (*)(...))std::exception::what
+40 (int (*)(...))QException::raise
+48 (int (*)(...))QException::clone
+
+Class QException
+ size=8 align=8
+ base size=8 base align=8
+QException (0x0x7f1e7afded68) 0 nearly-empty
+ vptr=((& QException::_ZTV10QException) + 16)
+ std::exception (0x0x7f1e7b027720) 0 nearly-empty
+ primary-for QException (0x0x7f1e7afded68)
+
+Vtable for QUnhandledException
+QUnhandledException::_ZTV19QUnhandledException: 7 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QUnhandledException)
+16 (int (*)(...))QUnhandledException::~QUnhandledException
+24 (int (*)(...))QUnhandledException::~QUnhandledException
+32 (int (*)(...))std::exception::what
+40 (int (*)(...))QUnhandledException::raise
+48 (int (*)(...))QUnhandledException::clone
+
+Class QUnhandledException
+ size=8 align=8
+ base size=8 base align=8
+QUnhandledException (0x0x7f1e7afdedd0) 0 nearly-empty
+ vptr=((& QUnhandledException::_ZTV19QUnhandledException) + 16)
+ QException (0x0x7f1e7afdee38) 0 nearly-empty
+ primary-for QUnhandledException (0x0x7f1e7afdedd0)
+ std::exception (0x0x7f1e7b027780) 0 nearly-empty
+ primary-for QException (0x0x7f1e7afdee38)
+
+Class QtPrivate::ExceptionHolder
+ size=8 align=8
+ base size=8 base align=8
+QtPrivate::ExceptionHolder (0x0x7f1e7b0277e0) 0
+
+Class QtPrivate::ExceptionStore
+ size=8 align=8
+ base size=8 base align=8
+QtPrivate::ExceptionStore (0x0x7f1e7b0278a0) 0
+
+Vtable for QFactoryInterface
+QFactoryInterface::_ZTV17QFactoryInterface: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QFactoryInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+
+Class QFactoryInterface
+ size=8 align=8
+ base size=8 base align=8
+QFactoryInterface (0x0x7f1e7b027900) 0 nearly-empty
+ vptr=((& QFactoryInterface::_ZTV17QFactoryInterface) + 16)
+
+Class QFileSelector::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QFileSelector::QPrivateSignal (0x0x7f1e7b027b40) 0 empty
+
+Vtable for QFileSelector
+QFileSelector::_ZTV13QFileSelector: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QFileSelector)
+16 (int (*)(...))QFileSelector::metaObject
+24 (int (*)(...))QFileSelector::qt_metacast
+32 (int (*)(...))QFileSelector::qt_metacall
+40 (int (*)(...))QFileSelector::~QFileSelector
+48 (int (*)(...))QFileSelector::~QFileSelector
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QFileSelector
+ size=16 align=8
+ base size=16 base align=8
+QFileSelector (0x0x7f1e7afdeea0) 0
+ vptr=((& QFileSelector::_ZTV13QFileSelector) + 16)
+ QObject (0x0x7f1e7b027ae0) 0
+ primary-for QFileSelector (0x0x7f1e7afdeea0)
+
+Class QFileSystemWatcher::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QFileSystemWatcher::QPrivateSignal (0x0x7f1e7b027d80) 0 empty
+
+Vtable for QFileSystemWatcher
+QFileSystemWatcher::_ZTV18QFileSystemWatcher: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QFileSystemWatcher)
+16 (int (*)(...))QFileSystemWatcher::metaObject
+24 (int (*)(...))QFileSystemWatcher::qt_metacast
+32 (int (*)(...))QFileSystemWatcher::qt_metacall
+40 (int (*)(...))QFileSystemWatcher::~QFileSystemWatcher
+48 (int (*)(...))QFileSystemWatcher::~QFileSystemWatcher
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QFileSystemWatcher
+ size=16 align=8
+ base size=16 base align=8
+QFileSystemWatcher (0x0x7f1e7afdef08) 0
+ vptr=((& QFileSystemWatcher::_ZTV18QFileSystemWatcher) + 16)
+ QObject (0x0x7f1e7b027d20) 0
+ primary-for QFileSystemWatcher (0x0x7f1e7afdef08)
+
+Class QFinalState::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QFinalState::QPrivateSignal (0x0x7f1e7b07e000) 0 empty
+
+Vtable for QFinalState
+QFinalState::_ZTV11QFinalState: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QFinalState)
+16 (int (*)(...))QFinalState::metaObject
+24 (int (*)(...))QFinalState::qt_metacast
+32 (int (*)(...))QFinalState::qt_metacall
+40 (int (*)(...))QFinalState::~QFinalState
+48 (int (*)(...))QFinalState::~QFinalState
+56 (int (*)(...))QFinalState::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QFinalState::onEntry
+120 (int (*)(...))QFinalState::onExit
+
+Class QFinalState
+ size=16 align=8
+ base size=16 base align=8
+QFinalState (0x0x7f1e7afdef70) 0
+ vptr=((& QFinalState::_ZTV11QFinalState) + 16)
+ QAbstractState (0x0x7f1e7b079000) 0
+ primary-for QFinalState (0x0x7f1e7afdef70)
+ QObject (0x0x7f1e7b027f60) 0
+ primary-for QAbstractState (0x0x7f1e7b079000)
+
+Vtable for QRunnable
+QRunnable::_ZTV9QRunnable: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QRunnable)
+16 (int (*)(...))__cxa_pure_virtual
+24 0
+32 0
+
+Class QRunnable
+ size=16 align=8
+ base size=12 base align=8
+QRunnable (0x0x7f1e7b07e1e0) 0
+ vptr=((& QRunnable::_ZTV9QRunnable) + 16)
+
+Class QBasicMutex
+ size=8 align=8
+ base size=8 base align=8
+QBasicMutex (0x0x7f1e7b07e480) 0
+
+Class QMutex
+ size=8 align=8
+ base size=8 base align=8
+QMutex (0x0x7f1e7b0790d0) 0
+ QBasicMutex (0x0x7f1e7ad05120) 0
+
+Class QRecursiveMutex
+ size=8 align=8
+ base size=8 base align=8
+QRecursiveMutex (0x0x7f1e7b079138) 0
+ QMutex (0x0x7f1e7b0791a0) 0
+ QBasicMutex (0x0x7f1e7ad05360) 0
+
+Class QMutexLocker
+ size=8 align=8
+ base size=8 base align=8
+QMutexLocker (0x0x7f1e7ad053c0) 0
+
+Class QtPrivate::ResultItem
+ size=16 align=8
+ base size=16 base align=8
+QtPrivate::ResultItem (0x0x7f1e7ad059c0) 0
+
+Class QtPrivate::ResultIteratorBase
+ size=16 align=8
+ base size=12 base align=8
+QtPrivate::ResultIteratorBase (0x0x7f1e7ad33000) 0
+
+Vtable for QtPrivate::ResultStoreBase
+QtPrivate::ResultStoreBase::_ZTVN9QtPrivate15ResultStoreBaseE: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTIN9QtPrivate15ResultStoreBaseE)
+16 (int (*)(...))QtPrivate::ResultStoreBase::~ResultStoreBase
+24 (int (*)(...))QtPrivate::ResultStoreBase::~ResultStoreBase
+
+Class QtPrivate::ResultStoreBase
+ size=48 align=8
+ base size=44 base align=8
+QtPrivate::ResultStoreBase (0x0x7f1e7ad331e0) 0
+ vptr=((& QtPrivate::ResultStoreBase::_ZTVN9QtPrivate15ResultStoreBaseE) + 16)
+
+Class std::__mutex_base
+ size=40 align=8
+ base size=40 base align=8
+std::__mutex_base (0x0x7f1e7adad9c0) 0
+
+Class std::mutex
+ size=40 align=8
+ base size=40 base align=8
+std::mutex (0x0x7f1e7ada3a90) 0
+ std::__mutex_base (0x0x7f1e7adada20) 0
+
+Class std::defer_lock_t
+ size=1 align=1
+ base size=0 base align=1
+std::defer_lock_t (0x0x7f1e7adadc00) 0 empty
+
+Class std::try_to_lock_t
+ size=1 align=1
+ base size=0 base align=1
+std::try_to_lock_t (0x0x7f1e7adadc60) 0 empty
+
+Class std::adopt_lock_t
+ size=1 align=1
+ base size=0 base align=1
+std::adopt_lock_t (0x0x7f1e7adadcc0) 0 empty
+
+Class std::__recursive_mutex_base
+ size=40 align=8
+ base size=40 base align=8
+std::__recursive_mutex_base (0x0x7f1e7ade0720) 0
+
+Class std::recursive_mutex
+ size=40 align=8
+ base size=40 base align=8
+std::recursive_mutex (0x0x7f1e7ada3af8) 0
+ std::__recursive_mutex_base (0x0x7f1e7ade0780) 0
+
+Class std::timed_mutex
+ size=40 align=8
+ base size=40 base align=8
+std::timed_mutex (0x0x7f1e7add04d0) 0
+ std::__mutex_base (0x0x7f1e7ade0b40) 0
+ std::__timed_mutex_impl<std::timed_mutex> (0x0x7f1e7ade0ba0) 0 empty
+
+Class std::recursive_timed_mutex
+ size=40 align=8
+ base size=40 base align=8
+std::recursive_timed_mutex (0x0x7f1e7add0850) 0
+ std::__recursive_mutex_base (0x0x7f1e7ade0f00) 0
+ std::__timed_mutex_impl<std::recursive_timed_mutex> (0x0x7f1e7ade0f60) 0 empty
+
+Class std::once_flag
+ size=4 align=4
+ base size=4 base align=4
+std::once_flag (0x0x7f1e7ae1e6c0) 0
+
+Vtable for QFutureInterfaceBase
+QFutureInterfaceBase::_ZTV20QFutureInterfaceBase: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QFutureInterfaceBase)
+16 (int (*)(...))QFutureInterfaceBase::~QFutureInterfaceBase
+24 (int (*)(...))QFutureInterfaceBase::~QFutureInterfaceBase
+
+Class QFutureInterfaceBase
+ size=16 align=8
+ base size=16 base align=8
+QFutureInterfaceBase (0x0x7f1e7ae1e900) 0
+ vptr=((& QFutureInterfaceBase::_ZTV20QFutureInterfaceBase) + 16)
+
+Class QFutureWatcherBase::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QFutureWatcherBase::QPrivateSignal (0x0x7f1e7aecfc60) 0 empty
+
+Vtable for QFutureWatcherBase
+QFutureWatcherBase::_ZTV18QFutureWatcherBase: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QFutureWatcherBase)
+16 (int (*)(...))QFutureWatcherBase::metaObject
+24 (int (*)(...))QFutureWatcherBase::qt_metacast
+32 (int (*)(...))QFutureWatcherBase::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QFutureWatcherBase::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QFutureWatcherBase::connectNotify
+104 (int (*)(...))QFutureWatcherBase::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+
+Class QFutureWatcherBase
+ size=16 align=8
+ base size=16 base align=8
+QFutureWatcherBase (0x0x7f1e7ae6a8f0) 0
+ vptr=((& QFutureWatcherBase::_ZTV18QFutureWatcherBase) + 16)
+ QObject (0x0x7f1e7aecfc00) 0
+ primary-for QFutureWatcherBase (0x0x7f1e7ae6a8f0)
+
+Class QHistoryState::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QHistoryState::QPrivateSignal (0x0x7f1e7ab21000) 0 empty
+
+Vtable for QHistoryState
+QHistoryState::_ZTV13QHistoryState: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QHistoryState)
+16 (int (*)(...))QHistoryState::metaObject
+24 (int (*)(...))QHistoryState::qt_metacast
+32 (int (*)(...))QHistoryState::qt_metacall
+40 (int (*)(...))QHistoryState::~QHistoryState
+48 (int (*)(...))QHistoryState::~QHistoryState
+56 (int (*)(...))QHistoryState::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QHistoryState::onEntry
+120 (int (*)(...))QHistoryState::onExit
+
+Class QHistoryState
+ size=16 align=8
+ base size=16 base align=8
+QHistoryState (0x0x7f1e7ab15138) 0
+ vptr=((& QHistoryState::_ZTV13QHistoryState) + 16)
+ QAbstractState (0x0x7f1e7ab151a0) 0
+ primary-for QHistoryState (0x0x7f1e7ab15138)
+ QObject (0x0x7f1e7aafbf60) 0
+ primary-for QAbstractState (0x0x7f1e7ab151a0)
+
+Class QIdentityProxyModel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QIdentityProxyModel::QPrivateSignal (0x0x7f1e7ab21300) 0 empty
+
+Vtable for QIdentityProxyModel
+QIdentityProxyModel::_ZTV19QIdentityProxyModel: 53 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QIdentityProxyModel)
+16 (int (*)(...))QIdentityProxyModel::metaObject
+24 (int (*)(...))QIdentityProxyModel::qt_metacast
+32 (int (*)(...))QIdentityProxyModel::qt_metacall
+40 (int (*)(...))QIdentityProxyModel::~QIdentityProxyModel
+48 (int (*)(...))QIdentityProxyModel::~QIdentityProxyModel
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QIdentityProxyModel::index
+120 (int (*)(...))QIdentityProxyModel::parent
+128 (int (*)(...))QIdentityProxyModel::sibling
+136 (int (*)(...))QIdentityProxyModel::rowCount
+144 (int (*)(...))QIdentityProxyModel::columnCount
+152 (int (*)(...))QAbstractProxyModel::hasChildren
+160 (int (*)(...))QAbstractProxyModel::data
+168 (int (*)(...))QAbstractProxyModel::setData
+176 (int (*)(...))QIdentityProxyModel::headerData
+184 (int (*)(...))QAbstractProxyModel::setHeaderData
+192 (int (*)(...))QAbstractProxyModel::itemData
+200 (int (*)(...))QAbstractProxyModel::setItemData
+208 (int (*)(...))QAbstractProxyModel::mimeTypes
+216 (int (*)(...))QAbstractProxyModel::mimeData
+224 (int (*)(...))QAbstractProxyModel::canDropMimeData
+232 (int (*)(...))QIdentityProxyModel::dropMimeData
+240 (int (*)(...))QAbstractProxyModel::supportedDropActions
+248 (int (*)(...))QAbstractProxyModel::supportedDragActions
+256 (int (*)(...))QIdentityProxyModel::insertRows
+264 (int (*)(...))QIdentityProxyModel::insertColumns
+272 (int (*)(...))QIdentityProxyModel::removeRows
+280 (int (*)(...))QIdentityProxyModel::removeColumns
+288 (int (*)(...))QIdentityProxyModel::moveRows
+296 (int (*)(...))QIdentityProxyModel::moveColumns
+304 (int (*)(...))QAbstractProxyModel::fetchMore
+312 (int (*)(...))QAbstractProxyModel::canFetchMore
+320 (int (*)(...))QAbstractProxyModel::flags
+328 (int (*)(...))QAbstractProxyModel::sort
+336 (int (*)(...))QAbstractProxyModel::buddy
+344 (int (*)(...))QIdentityProxyModel::match
+352 (int (*)(...))QAbstractProxyModel::span
+360 (int (*)(...))QAbstractItemModel::roleNames
+368 (int (*)(...))QAbstractProxyModel::submit
+376 (int (*)(...))QAbstractProxyModel::revert
+384 (int (*)(...))QIdentityProxyModel::setSourceModel
+392 (int (*)(...))QIdentityProxyModel::mapToSource
+400 (int (*)(...))QIdentityProxyModel::mapFromSource
+408 (int (*)(...))QIdentityProxyModel::mapSelectionToSource
+416 (int (*)(...))QIdentityProxyModel::mapSelectionFromSource
+
+Class QIdentityProxyModel
+ size=16 align=8
+ base size=16 base align=8
+QIdentityProxyModel (0x0x7f1e7ab15208) 0
+ vptr=((& QIdentityProxyModel::_ZTV19QIdentityProxyModel) + 16)
+ QAbstractProxyModel (0x0x7f1e7ab15270) 0
+ primary-for QIdentityProxyModel (0x0x7f1e7ab15208)
+ QAbstractItemModel (0x0x7f1e7ab152d8) 0
+ primary-for QAbstractProxyModel (0x0x7f1e7ab15270)
+ QObject (0x0x7f1e7ab212a0) 0
+ primary-for QAbstractItemModel (0x0x7f1e7ab152d8)
+
+Class QItemSelectionRange
+ size=16 align=8
+ base size=16 base align=8
+QItemSelectionRange (0x0x7f1e7ab214e0) 0
+
+Class QItemSelectionModel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QItemSelectionModel::QPrivateSignal (0x0x7f1e7abe6de0) 0 empty
+
+Vtable for QItemSelectionModel
+QItemSelectionModel::_ZTV19QItemSelectionModel: 20 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QItemSelectionModel)
+16 (int (*)(...))QItemSelectionModel::metaObject
+24 (int (*)(...))QItemSelectionModel::qt_metacast
+32 (int (*)(...))QItemSelectionModel::qt_metacall
+40 (int (*)(...))QItemSelectionModel::~QItemSelectionModel
+48 (int (*)(...))QItemSelectionModel::~QItemSelectionModel
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QItemSelectionModel::setCurrentIndex
+120 (int (*)(...))QItemSelectionModel::select
+128 (int (*)(...))QItemSelectionModel::select
+136 (int (*)(...))QItemSelectionModel::clear
+144 (int (*)(...))QItemSelectionModel::reset
+152 (int (*)(...))QItemSelectionModel::clearCurrentIndex
+
+Class QItemSelectionModel
+ size=16 align=8
+ base size=16 base align=8
+QItemSelectionModel (0x0x7f1e7abeac30) 0
+ vptr=((& QItemSelectionModel::_ZTV19QItemSelectionModel) + 16)
+ QObject (0x0x7f1e7abe6d80) 0
+ primary-for QItemSelectionModel (0x0x7f1e7abeac30)
+
+Class QItemSelection
+ size=8 align=8
+ base size=8 base align=8
+QItemSelection (0x0x7f1e7abeadd0) 0
+ QList<QItemSelectionRange> (0x0x7f1e7abeae38) 0
+ QListSpecialMethods<QItemSelectionRange> (0x0x7f1e7ac12900) 0 empty
+
+Class QJsonValue
+ size=24 align=8
+ base size=20 base align=8
+QJsonValue (0x0x7f1e7acb9240) 0
+
+Class QJsonValueRef
+ size=16 align=8
+ base size=12 base align=8
+QJsonValueRef (0x0x7f1e7acb9ba0) 0
+
+Class QJsonValuePtr
+ size=24 align=8
+ base size=24 base align=8
+QJsonValuePtr (0x0x7f1e7a90eb40) 0
+
+Class QJsonValueRefPtr
+ size=16 align=8
+ base size=16 base align=8
+QJsonValueRefPtr (0x0x7f1e7a90ede0) 0
+
+Class QJsonArray::iterator
+ size=16 align=8
+ base size=12 base align=8
+QJsonArray::iterator (0x0x7f1e7a985180) 0
+
+Class QJsonArray::const_iterator
+ size=16 align=8
+ base size=12 base align=8
+QJsonArray::const_iterator (0x0x7f1e7a9851e0) 0
+
+Class QJsonArray
+ size=16 align=8
+ base size=16 base align=8
+QJsonArray (0x0x7f1e7a985120) 0
+
+Class QJsonParseError
+ size=8 align=4
+ base size=8 base align=4
+QJsonParseError (0x0x7f1e7aa36780) 0
+
+Class QJsonDocument
+ size=8 align=8
+ base size=8 base align=8
+QJsonDocument (0x0x7f1e7aa367e0) 0
+
+Class QJsonObject::iterator
+ size=16 align=8
+ base size=12 base align=8
+QJsonObject::iterator (0x0x7f1e7a87d720) 0
+
+Class QJsonObject::const_iterator
+ size=16 align=8
+ base size=12 base align=8
+QJsonObject::const_iterator (0x0x7f1e7a87d780) 0
+
+Class QJsonObject
+ size=16 align=8
+ base size=16 base align=8
+QJsonObject (0x0x7f1e7a87d6c0) 0
+
+Class QLibrary::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QLibrary::QPrivateSignal (0x0x7f1e7a531a20) 0 empty
+
+Vtable for QLibrary
+QLibrary::_ZTV8QLibrary: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI8QLibrary)
+16 (int (*)(...))QLibrary::metaObject
+24 (int (*)(...))QLibrary::qt_metacast
+32 (int (*)(...))QLibrary::qt_metacall
+40 (int (*)(...))QLibrary::~QLibrary
+48 (int (*)(...))QLibrary::~QLibrary
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QLibrary
+ size=32 align=8
+ base size=25 base align=8
+QLibrary (0x0x7f1e7a5367b8) 0
+ vptr=((& QLibrary::_ZTV8QLibrary) + 16)
+ QObject (0x0x7f1e7a5319c0) 0
+ primary-for QLibrary (0x0x7f1e7a5367b8)
+
+Class QVersionNumber::SegmentStorage
+ size=8 align=8
+ base size=8 base align=8
+QVersionNumber::SegmentStorage (0x0x7f1e7a5708a0) 0
+
+Class QVersionNumber
+ size=8 align=8
+ base size=8 base align=8
+QVersionNumber (0x0x7f1e7a5703c0) 0
+
+Class QLibraryInfo
+ size=1 align=1
+ base size=0 base align=1
+QLibraryInfo (0x0x7f1e7a65ecc0) 0 empty
+
+Class QPoint
+ size=8 align=4
+ base size=8 base align=4
+QPoint (0x0x7f1e7a65ed20) 0
+
+Class QPointF
+ size=16 align=8
+ base size=16 base align=8
+QPointF (0x0x7f1e7a6ceba0) 0
+
+Class QLine
+ size=16 align=4
+ base size=16 base align=4
+QLine (0x0x7f1e7a33ed80) 0
+
+Class QLineF
+ size=32 align=8
+ base size=32 base align=8
+QLineF (0x0x7f1e7a3d6180) 0
+
+Class QLinkedListData
+ size=32 align=8
+ base size=25 base align=8
+QLinkedListData (0x0x7f1e7a453420) 0
+
+Class QLockFile
+ size=8 align=8
+ base size=8 base align=8
+QLockFile (0x0x7f1e7a0f6960) 0
+
+Class QLoggingCategory::AtomicBools
+ size=4 align=1
+ base size=4 base align=1
+QLoggingCategory::AtomicBools (0x0x7f1e7a0f6ba0) 0
+
+Class QLoggingCategory
+ size=24 align=8
+ base size=24 base align=8
+QLoggingCategory (0x0x7f1e7a0f6b40) 0
+
+Class QMargins
+ size=16 align=4
+ base size=16 base align=4
+QMargins (0x0x7f1e7a162000) 0
+
+Class QMarginsF
+ size=32 align=8
+ base size=32 base align=8
+QMarginsF (0x0x7f1e7a1abf00) 0
+
+Class QMessageAuthenticationCode
+ size=8 align=8
+ base size=8 base align=8
+QMessageAuthenticationCode (0x0x7f1e7a01a720) 0
+
+Class QMetaMethod
+ size=16 align=8
+ base size=12 base align=8
+QMetaMethod (0x0x7f1e7a01a780) 0
+
+Class QMetaEnum
+ size=16 align=8
+ base size=12 base align=8
+QMetaEnum (0x0x7f1e7a0a4000) 0
+
+Class QMetaProperty
+ size=32 align=8
+ base size=32 base align=8
+QMetaProperty (0x0x7f1e79ce61e0) 0
+
+Class QMetaClassInfo
+ size=16 align=8
+ base size=12 base align=8
+QMetaClassInfo (0x0x7f1e79ce6300) 0
+
+Class QMimeData::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QMimeData::QPrivateSignal (0x0x7f1e79d268a0) 0 empty
+
+Vtable for QMimeData
+QMimeData::_ZTV9QMimeData: 17 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QMimeData)
+16 (int (*)(...))QMimeData::metaObject
+24 (int (*)(...))QMimeData::qt_metacast
+32 (int (*)(...))QMimeData::qt_metacall
+40 (int (*)(...))QMimeData::~QMimeData
+48 (int (*)(...))QMimeData::~QMimeData
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QMimeData::hasFormat
+120 (int (*)(...))QMimeData::formats
+128 (int (*)(...))QMimeData::retrieveData
+
+Class QMimeData
+ size=16 align=8
+ base size=16 base align=8
+QMimeData (0x0x7f1e79d31340) 0
+ vptr=((& QMimeData::_ZTV9QMimeData) + 16)
+ QObject (0x0x7f1e79d26840) 0
+ primary-for QMimeData (0x0x7f1e79d31340)
+
+Class QMimeType
+ size=8 align=8
+ base size=8 base align=8
+QMimeType (0x0x7f1e79d26a80) 0
+
+Class QMimeDatabase
+ size=8 align=8
+ base size=8 base align=8
+QMimeDatabase (0x0x7f1e79df79c0) 0
+
+Class QObjectCleanupHandler::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QObjectCleanupHandler::QPrivateSignal (0x0x7f1e79df7a80) 0 empty
+
+Vtable for QObjectCleanupHandler
+QObjectCleanupHandler::_ZTV21QObjectCleanupHandler: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI21QObjectCleanupHandler)
+16 (int (*)(...))QObjectCleanupHandler::metaObject
+24 (int (*)(...))QObjectCleanupHandler::qt_metacast
+32 (int (*)(...))QObjectCleanupHandler::qt_metacall
+40 (int (*)(...))QObjectCleanupHandler::~QObjectCleanupHandler
+48 (int (*)(...))QObjectCleanupHandler::~QObjectCleanupHandler
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QObjectCleanupHandler
+ size=24 align=8
+ base size=24 base align=8
+QObjectCleanupHandler (0x0x7f1e79deeea0) 0
+ vptr=((& QObjectCleanupHandler::_ZTV21QObjectCleanupHandler) + 16)
+ QObject (0x0x7f1e79df7a20) 0
+ primary-for QObjectCleanupHandler (0x0x7f1e79deeea0)
+
+Class QOperatingSystemVersion
+ size=16 align=4
+ base size=16 base align=4
+QOperatingSystemVersion (0x0x7f1e79df7ba0) 0
+
+Class QParallelAnimationGroup::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QParallelAnimationGroup::QPrivateSignal (0x0x7f1e79e84360) 0 empty
+
+Vtable for QParallelAnimationGroup
+QParallelAnimationGroup::_ZTV23QParallelAnimationGroup: 18 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI23QParallelAnimationGroup)
+16 (int (*)(...))QParallelAnimationGroup::metaObject
+24 (int (*)(...))QParallelAnimationGroup::qt_metacast
+32 (int (*)(...))QParallelAnimationGroup::qt_metacall
+40 (int (*)(...))QParallelAnimationGroup::~QParallelAnimationGroup
+48 (int (*)(...))QParallelAnimationGroup::~QParallelAnimationGroup
+56 (int (*)(...))QParallelAnimationGroup::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QParallelAnimationGroup::duration
+120 (int (*)(...))QParallelAnimationGroup::updateCurrentTime
+128 (int (*)(...))QParallelAnimationGroup::updateState
+136 (int (*)(...))QParallelAnimationGroup::updateDirection
+
+Class QParallelAnimationGroup
+ size=16 align=8
+ base size=16 base align=8
+QParallelAnimationGroup (0x0x7f1e79e7b750) 0
+ vptr=((& QParallelAnimationGroup::_ZTV23QParallelAnimationGroup) + 16)
+ QAnimationGroup (0x0x7f1e79e7b7b8) 0
+ primary-for QParallelAnimationGroup (0x0x7f1e79e7b750)
+ QAbstractAnimation (0x0x7f1e79e7b820) 0
+ primary-for QAnimationGroup (0x0x7f1e79e7b7b8)
+ QObject (0x0x7f1e79e84300) 0
+ primary-for QAbstractAnimation (0x0x7f1e79e7b820)
+
+Class QPauseAnimation::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QPauseAnimation::QPrivateSignal (0x0x7f1e79e845a0) 0 empty
+
+Vtable for QPauseAnimation
+QPauseAnimation::_ZTV15QPauseAnimation: 18 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QPauseAnimation)
+16 (int (*)(...))QPauseAnimation::metaObject
+24 (int (*)(...))QPauseAnimation::qt_metacast
+32 (int (*)(...))QPauseAnimation::qt_metacall
+40 (int (*)(...))QPauseAnimation::~QPauseAnimation
+48 (int (*)(...))QPauseAnimation::~QPauseAnimation
+56 (int (*)(...))QPauseAnimation::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QPauseAnimation::duration
+120 (int (*)(...))QPauseAnimation::updateCurrentTime
+128 (int (*)(...))QAbstractAnimation::updateState
+136 (int (*)(...))QAbstractAnimation::updateDirection
+
+Class QPauseAnimation
+ size=16 align=8
+ base size=16 base align=8
+QPauseAnimation (0x0x7f1e79e7b888) 0
+ vptr=((& QPauseAnimation::_ZTV15QPauseAnimation) + 16)
+ QAbstractAnimation (0x0x7f1e79e7b8f0) 0
+ primary-for QPauseAnimation (0x0x7f1e79e7b888)
+ QObject (0x0x7f1e79e84540) 0
+ primary-for QAbstractAnimation (0x0x7f1e79e7b8f0)
+
+Class QStaticPlugin
+ size=16 align=8
+ base size=16 base align=8
+QStaticPlugin (0x0x7f1e79ebd120) 0
+
+Class QPluginLoader::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QPluginLoader::QPrivateSignal (0x0x7f1e79af82a0) 0 empty
+
+Vtable for QPluginLoader
+QPluginLoader::_ZTV13QPluginLoader: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QPluginLoader)
+16 (int (*)(...))QPluginLoader::metaObject
+24 (int (*)(...))QPluginLoader::qt_metacast
+32 (int (*)(...))QPluginLoader::qt_metacall
+40 (int (*)(...))QPluginLoader::~QPluginLoader
+48 (int (*)(...))QPluginLoader::~QPluginLoader
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QPluginLoader
+ size=32 align=8
+ base size=25 base align=8
+QPluginLoader (0x0x7f1e79ae6c30) 0
+ vptr=((& QPluginLoader::_ZTV13QPluginLoader) + 16)
+ QObject (0x0x7f1e79af8240) 0
+ primary-for QPluginLoader (0x0x7f1e79ae6c30)
+
+Class QProcessEnvironment
+ size=8 align=8
+ base size=8 base align=8
+QProcessEnvironment (0x0x7f1e79af83c0) 0
+
+Class QProcess::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QProcess::QPrivateSignal (0x0x7f1e79bca840) 0 empty
+
+Vtable for QProcess
+QProcess::_ZTV8QProcess: 31 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI8QProcess)
+16 (int (*)(...))QProcess::metaObject
+24 (int (*)(...))QProcess::qt_metacast
+32 (int (*)(...))QProcess::qt_metacall
+40 (int (*)(...))QProcess::~QProcess
+48 (int (*)(...))QProcess::~QProcess
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QProcess::isSequential
+120 (int (*)(...))QProcess::open
+128 (int (*)(...))QProcess::close
+136 (int (*)(...))QIODevice::pos
+144 (int (*)(...))QIODevice::size
+152 (int (*)(...))QIODevice::seek
+160 (int (*)(...))QProcess::atEnd
+168 (int (*)(...))QIODevice::reset
+176 (int (*)(...))QProcess::bytesAvailable
+184 (int (*)(...))QProcess::bytesToWrite
+192 (int (*)(...))QProcess::canReadLine
+200 (int (*)(...))QProcess::waitForReadyRead
+208 (int (*)(...))QProcess::waitForBytesWritten
+216 (int (*)(...))QProcess::readData
+224 (int (*)(...))QIODevice::readLineData
+232 (int (*)(...))QProcess::writeData
+240 (int (*)(...))QProcess::setupChildProcess
+
+Class QProcess
+ size=16 align=8
+ base size=16 base align=8
+QProcess (0x0x7f1e79bd20d0) 0
+ vptr=((& QProcess::_ZTV8QProcess) + 16)
+ QIODevice (0x0x7f1e79bd2138) 0
+ primary-for QProcess (0x0x7f1e79bd20d0)
+ QObject (0x0x7f1e79bca7e0) 0
+ primary-for QIODevice (0x0x7f1e79bd2138)
+
+Class QVariantAnimation::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QVariantAnimation::QPrivateSignal (0x0x7f1e79bcaf00) 0 empty
+
+Vtable for QVariantAnimation
+QVariantAnimation::_ZTV17QVariantAnimation: 20 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QVariantAnimation)
+16 (int (*)(...))QVariantAnimation::metaObject
+24 (int (*)(...))QVariantAnimation::qt_metacast
+32 (int (*)(...))QVariantAnimation::qt_metacall
+40 (int (*)(...))QVariantAnimation::~QVariantAnimation
+48 (int (*)(...))QVariantAnimation::~QVariantAnimation
+56 (int (*)(...))QVariantAnimation::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QVariantAnimation::duration
+120 (int (*)(...))QVariantAnimation::updateCurrentTime
+128 (int (*)(...))QVariantAnimation::updateState
+136 (int (*)(...))QAbstractAnimation::updateDirection
+144 (int (*)(...))QVariantAnimation::updateCurrentValue
+152 (int (*)(...))QVariantAnimation::interpolated
+
+Class QVariantAnimation
+ size=16 align=8
+ base size=16 base align=8
+QVariantAnimation (0x0x7f1e79bd21a0) 0
+ vptr=((& QVariantAnimation::_ZTV17QVariantAnimation) + 16)
+ QAbstractAnimation (0x0x7f1e79bd2208) 0
+ primary-for QVariantAnimation (0x0x7f1e79bd21a0)
+ QObject (0x0x7f1e79bcaea0) 0
+ primary-for QAbstractAnimation (0x0x7f1e79bd2208)
+
+Class QPropertyAnimation::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QPropertyAnimation::QPrivateSignal (0x0x7f1e79c191e0) 0 empty
+
+Vtable for QPropertyAnimation
+QPropertyAnimation::_ZTV18QPropertyAnimation: 20 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QPropertyAnimation)
+16 (int (*)(...))QPropertyAnimation::metaObject
+24 (int (*)(...))QPropertyAnimation::qt_metacast
+32 (int (*)(...))QPropertyAnimation::qt_metacall
+40 (int (*)(...))QPropertyAnimation::~QPropertyAnimation
+48 (int (*)(...))QPropertyAnimation::~QPropertyAnimation
+56 (int (*)(...))QPropertyAnimation::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QVariantAnimation::duration
+120 (int (*)(...))QVariantAnimation::updateCurrentTime
+128 (int (*)(...))QPropertyAnimation::updateState
+136 (int (*)(...))QAbstractAnimation::updateDirection
+144 (int (*)(...))QPropertyAnimation::updateCurrentValue
+152 (int (*)(...))QVariantAnimation::interpolated
+
+Class QPropertyAnimation
+ size=16 align=8
+ base size=16 base align=8
+QPropertyAnimation (0x0x7f1e79bd22d8) 0
+ vptr=((& QPropertyAnimation::_ZTV18QPropertyAnimation) + 16)
+ QVariantAnimation (0x0x7f1e79bd2340) 0
+ primary-for QPropertyAnimation (0x0x7f1e79bd22d8)
+ QAbstractAnimation (0x0x7f1e79bd23a8) 0
+ primary-for QVariantAnimation (0x0x7f1e79bd2340)
+ QObject (0x0x7f1e79c19180) 0
+ primary-for QAbstractAnimation (0x0x7f1e79bd23a8)
+
+Class std::random_device
+ size=5000 align=8
+ base size=5000 base align=8
+std::random_device (0x0x7f1e79c8d900) 0
+
+Class std::bernoulli_distribution::param_type
+ size=8 align=8
+ base size=8 base align=8
+std::bernoulli_distribution::param_type (0x0x7f1e79997660) 0
+
+Class std::bernoulli_distribution
+ size=8 align=8
+ base size=8 base align=8
+std::bernoulli_distribution (0x0x7f1e79997600) 0
+
+Class std::seed_seq
+ size=24 align=8
+ base size=24 base align=8
+std::seed_seq (0x0x7f1e7978a3c0) 0
+
+Class QRandomGenerator::Storage
+ size=2504 align=8
+ base size=2504 base align=8
+QRandomGenerator::Storage (0x0x7f1e795c5060) 0
+
+Class QRandomGenerator
+ size=2512 align=8
+ base size=2512 base align=8
+QRandomGenerator (0x0x7f1e795c5000) 0
+
+Class QRandomGenerator64
+ size=2512 align=8
+ base size=2512 base align=8
+QRandomGenerator64 (0x0x7f1e79643068) 0
+ QRandomGenerator (0x0x7f1e7963fb40) 0
+
+Class QReadWriteLock
+ size=8 align=8
+ base size=8 base align=8
+QReadWriteLock (0x0x7f1e79665720) 0
+
+Class QReadLocker
+ size=8 align=8
+ base size=8 base align=8
+QReadLocker (0x0x7f1e796659c0) 0
+
+Class QWriteLocker
+ size=8 align=8
+ base size=8 base align=8
+QWriteLocker (0x0x7f1e79665ea0) 0
+
+Class QSize
+ size=8 align=4
+ base size=8 base align=4
+QSize (0x0x7f1e792ed3c0) 0
+
+Class QSizeF
+ size=16 align=8
+ base size=16 base align=8
+QSizeF (0x0x7f1e7935f2a0) 0
+
+Class QRect
+ size=16 align=4
+ base size=16 base align=4
+QRect (0x0x7f1e793db300) 0
+
+Class QRectF
+ size=32 align=8
+ base size=32 base align=8
+QRectF (0x0x7f1e79491360) 0
+
+Class QResource
+ size=8 align=8
+ base size=8 base align=8
+QResource (0x0x7f1e7914d480) 0
+
+Class QSaveFile::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSaveFile::QPrivateSignal (0x0x7f1e7914d720) 0 empty
+
+Vtable for QSaveFile
+QSaveFile::_ZTV9QSaveFile: 34 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QSaveFile)
+16 (int (*)(...))QSaveFile::metaObject
+24 (int (*)(...))QSaveFile::qt_metacast
+32 (int (*)(...))QSaveFile::qt_metacall
+40 (int (*)(...))QSaveFile::~QSaveFile
+48 (int (*)(...))QSaveFile::~QSaveFile
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QFileDevice::isSequential
+120 (int (*)(...))QSaveFile::open
+128 (int (*)(...))QSaveFile::close
+136 (int (*)(...))QFileDevice::pos
+144 (int (*)(...))QFileDevice::size
+152 (int (*)(...))QFileDevice::seek
+160 (int (*)(...))QFileDevice::atEnd
+168 (int (*)(...))QIODevice::reset
+176 (int (*)(...))QIODevice::bytesAvailable
+184 (int (*)(...))QIODevice::bytesToWrite
+192 (int (*)(...))QIODevice::canReadLine
+200 (int (*)(...))QIODevice::waitForReadyRead
+208 (int (*)(...))QIODevice::waitForBytesWritten
+216 (int (*)(...))QFileDevice::readData
+224 (int (*)(...))QFileDevice::readLineData
+232 (int (*)(...))QSaveFile::writeData
+240 (int (*)(...))QSaveFile::fileName
+248 (int (*)(...))QFileDevice::resize
+256 (int (*)(...))QFileDevice::permissions
+264 (int (*)(...))QFileDevice::setPermissions
+
+Class QSaveFile
+ size=16 align=8
+ base size=16 base align=8
+QSaveFile (0x0x7f1e790faa28) 0
+ vptr=((& QSaveFile::_ZTV9QSaveFile) + 16)
+ QFileDevice (0x0x7f1e790faa90) 0
+ primary-for QSaveFile (0x0x7f1e790faa28)
+ QIODevice (0x0x7f1e790faaf8) 0
+ primary-for QFileDevice (0x0x7f1e790faa90)
+ QObject (0x0x7f1e7914d6c0) 0
+ primary-for QIODevice (0x0x7f1e790faaf8)
+
+Class QSemaphore
+ size=8 align=8
+ base size=8 base align=8
+QSemaphore (0x0x7f1e7914dd80) 0
+
+Class QSemaphoreReleaser
+ size=16 align=8
+ base size=12 base align=8
+QSemaphoreReleaser (0x0x7f1e7914df00) 0
+
+Class QSequentialAnimationGroup::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSequentialAnimationGroup::QPrivateSignal (0x0x7f1e7924fb40) 0 empty
+
+Vtable for QSequentialAnimationGroup
+QSequentialAnimationGroup::_ZTV25QSequentialAnimationGroup: 18 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI25QSequentialAnimationGroup)
+16 (int (*)(...))QSequentialAnimationGroup::metaObject
+24 (int (*)(...))QSequentialAnimationGroup::qt_metacast
+32 (int (*)(...))QSequentialAnimationGroup::qt_metacall
+40 (int (*)(...))QSequentialAnimationGroup::~QSequentialAnimationGroup
+48 (int (*)(...))QSequentialAnimationGroup::~QSequentialAnimationGroup
+56 (int (*)(...))QSequentialAnimationGroup::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QSequentialAnimationGroup::duration
+120 (int (*)(...))QSequentialAnimationGroup::updateCurrentTime
+128 (int (*)(...))QSequentialAnimationGroup::updateState
+136 (int (*)(...))QSequentialAnimationGroup::updateDirection
+
+Class QSequentialAnimationGroup
+ size=16 align=8
+ base size=16 base align=8
+QSequentialAnimationGroup (0x0x7f1e792602d8) 0
+ vptr=((& QSequentialAnimationGroup::_ZTV25QSequentialAnimationGroup) + 16)
+ QAnimationGroup (0x0x7f1e79260340) 0
+ primary-for QSequentialAnimationGroup (0x0x7f1e792602d8)
+ QAbstractAnimation (0x0x7f1e792603a8) 0
+ primary-for QAnimationGroup (0x0x7f1e79260340)
+ QObject (0x0x7f1e7924fae0) 0
+ primary-for QAbstractAnimation (0x0x7f1e792603a8)
+
+Class QSettings::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSettings::QPrivateSignal (0x0x7f1e7924fd80) 0 empty
+
+Vtable for QSettings
+QSettings::_ZTV9QSettings: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QSettings)
+16 (int (*)(...))QSettings::metaObject
+24 (int (*)(...))QSettings::qt_metacast
+32 (int (*)(...))QSettings::qt_metacall
+40 (int (*)(...))QSettings::~QSettings
+48 (int (*)(...))QSettings::~QSettings
+56 (int (*)(...))QSettings::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QSettings
+ size=16 align=8
+ base size=16 base align=8
+QSettings (0x0x7f1e79260410) 0
+ vptr=((& QSettings::_ZTV9QSettings) + 16)
+ QObject (0x0x7f1e7924fd20) 0
+ primary-for QSettings (0x0x7f1e79260410)
+
+Class QSharedMemory::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSharedMemory::QPrivateSignal (0x0x7f1e7929a240) 0 empty
+
+Vtable for QSharedMemory
+QSharedMemory::_ZTV13QSharedMemory: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QSharedMemory)
+16 (int (*)(...))QSharedMemory::metaObject
+24 (int (*)(...))QSharedMemory::qt_metacast
+32 (int (*)(...))QSharedMemory::qt_metacall
+40 (int (*)(...))QSharedMemory::~QSharedMemory
+48 (int (*)(...))QSharedMemory::~QSharedMemory
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QSharedMemory
+ size=16 align=8
+ base size=16 base align=8
+QSharedMemory (0x0x7f1e79260478) 0
+ vptr=((& QSharedMemory::_ZTV13QSharedMemory) + 16)
+ QObject (0x0x7f1e7929a1e0) 0
+ primary-for QSharedMemory (0x0x7f1e79260478)
+
+Class QSignalMapper::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSignalMapper::QPrivateSignal (0x0x7f1e7929a480) 0 empty
+
+Vtable for QSignalMapper
+QSignalMapper::_ZTV13QSignalMapper: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QSignalMapper)
+16 (int (*)(...))QSignalMapper::metaObject
+24 (int (*)(...))QSignalMapper::qt_metacast
+32 (int (*)(...))QSignalMapper::qt_metacall
+40 (int (*)(...))QSignalMapper::~QSignalMapper
+48 (int (*)(...))QSignalMapper::~QSignalMapper
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QSignalMapper
+ size=16 align=8
+ base size=16 base align=8
+QSignalMapper (0x0x7f1e792604e0) 0
+ vptr=((& QSignalMapper::_ZTV13QSignalMapper) + 16)
+ QObject (0x0x7f1e7929a420) 0
+ primary-for QSignalMapper (0x0x7f1e792604e0)
+
+Class QSignalTransition::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSignalTransition::QPrivateSignal (0x0x7f1e7929a6c0) 0 empty
+
+Vtable for QSignalTransition
+QSignalTransition::_ZTV17QSignalTransition: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QSignalTransition)
+16 (int (*)(...))QSignalTransition::metaObject
+24 (int (*)(...))QSignalTransition::qt_metacast
+32 (int (*)(...))QSignalTransition::qt_metacall
+40 (int (*)(...))QSignalTransition::~QSignalTransition
+48 (int (*)(...))QSignalTransition::~QSignalTransition
+56 (int (*)(...))QSignalTransition::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QSignalTransition::eventTest
+120 (int (*)(...))QSignalTransition::onTransition
+
+Class QSignalTransition
+ size=16 align=8
+ base size=16 base align=8
+QSignalTransition (0x0x7f1e79260548) 0
+ vptr=((& QSignalTransition::_ZTV17QSignalTransition) + 16)
+ QAbstractTransition (0x0x7f1e792605b0) 0
+ primary-for QSignalTransition (0x0x7f1e79260548)
+ QObject (0x0x7f1e7929a660) 0
+ primary-for QAbstractTransition (0x0x7f1e792605b0)
+
+Class QSocketNotifier::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSocketNotifier::QPrivateSignal (0x0x7f1e7929a960) 0 empty
+
+Vtable for QSocketNotifier
+QSocketNotifier::_ZTV15QSocketNotifier: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QSocketNotifier)
+16 (int (*)(...))QSocketNotifier::metaObject
+24 (int (*)(...))QSocketNotifier::qt_metacast
+32 (int (*)(...))QSocketNotifier::qt_metacall
+40 (int (*)(...))QSocketNotifier::~QSocketNotifier
+48 (int (*)(...))QSocketNotifier::~QSocketNotifier
+56 (int (*)(...))QSocketNotifier::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QSocketNotifier
+ size=16 align=8
+ base size=16 base align=8
+QSocketNotifier (0x0x7f1e79260618) 0
+ vptr=((& QSocketNotifier::_ZTV15QSocketNotifier) + 16)
+ QObject (0x0x7f1e7929a900) 0
+ primary-for QSocketNotifier (0x0x7f1e79260618)
+
+Class QSocketDescriptor
+ size=4 align=4
+ base size=4 base align=4
+QSocketDescriptor (0x0x7f1e7929ab40) 0
+
+Class QSortFilterProxyModel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSortFilterProxyModel::QPrivateSignal (0x0x7f1e78ee8780) 0 empty
+
+Vtable for QSortFilterProxyModel
+QSortFilterProxyModel::_ZTV21QSortFilterProxyModel: 56 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI21QSortFilterProxyModel)
+16 (int (*)(...))QSortFilterProxyModel::metaObject
+24 (int (*)(...))QSortFilterProxyModel::qt_metacast
+32 (int (*)(...))QSortFilterProxyModel::qt_metacall
+40 (int (*)(...))QSortFilterProxyModel::~QSortFilterProxyModel
+48 (int (*)(...))QSortFilterProxyModel::~QSortFilterProxyModel
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QSortFilterProxyModel::index
+120 (int (*)(...))QSortFilterProxyModel::parent
+128 (int (*)(...))QSortFilterProxyModel::sibling
+136 (int (*)(...))QSortFilterProxyModel::rowCount
+144 (int (*)(...))QSortFilterProxyModel::columnCount
+152 (int (*)(...))QSortFilterProxyModel::hasChildren
+160 (int (*)(...))QSortFilterProxyModel::data
+168 (int (*)(...))QSortFilterProxyModel::setData
+176 (int (*)(...))QSortFilterProxyModel::headerData
+184 (int (*)(...))QSortFilterProxyModel::setHeaderData
+192 (int (*)(...))QAbstractProxyModel::itemData
+200 (int (*)(...))QAbstractProxyModel::setItemData
+208 (int (*)(...))QSortFilterProxyModel::mimeTypes
+216 (int (*)(...))QSortFilterProxyModel::mimeData
+224 (int (*)(...))QAbstractProxyModel::canDropMimeData
+232 (int (*)(...))QSortFilterProxyModel::dropMimeData
+240 (int (*)(...))QSortFilterProxyModel::supportedDropActions
+248 (int (*)(...))QAbstractProxyModel::supportedDragActions
+256 (int (*)(...))QSortFilterProxyModel::insertRows
+264 (int (*)(...))QSortFilterProxyModel::insertColumns
+272 (int (*)(...))QSortFilterProxyModel::removeRows
+280 (int (*)(...))QSortFilterProxyModel::removeColumns
+288 (int (*)(...))QAbstractItemModel::moveRows
+296 (int (*)(...))QAbstractItemModel::moveColumns
+304 (int (*)(...))QSortFilterProxyModel::fetchMore
+312 (int (*)(...))QSortFilterProxyModel::canFetchMore
+320 (int (*)(...))QSortFilterProxyModel::flags
+328 (int (*)(...))QSortFilterProxyModel::sort
+336 (int (*)(...))QSortFilterProxyModel::buddy
+344 (int (*)(...))QSortFilterProxyModel::match
+352 (int (*)(...))QSortFilterProxyModel::span
+360 (int (*)(...))QAbstractItemModel::roleNames
+368 (int (*)(...))QAbstractProxyModel::submit
+376 (int (*)(...))QAbstractProxyModel::revert
+384 (int (*)(...))QSortFilterProxyModel::setSourceModel
+392 (int (*)(...))QSortFilterProxyModel::mapToSource
+400 (int (*)(...))QSortFilterProxyModel::mapFromSource
+408 (int (*)(...))QSortFilterProxyModel::mapSelectionToSource
+416 (int (*)(...))QSortFilterProxyModel::mapSelectionFromSource
+424 (int (*)(...))QSortFilterProxyModel::filterAcceptsRow
+432 (int (*)(...))QSortFilterProxyModel::filterAcceptsColumn
+440 (int (*)(...))QSortFilterProxyModel::lessThan
+
+Class QSortFilterProxyModel
+ size=16 align=8
+ base size=16 base align=8
+QSortFilterProxyModel (0x0x7f1e79260b60) 0
+ vptr=((& QSortFilterProxyModel::_ZTV21QSortFilterProxyModel) + 16)
+ QAbstractProxyModel (0x0x7f1e79260bc8) 0
+ primary-for QSortFilterProxyModel (0x0x7f1e79260b60)
+ QAbstractItemModel (0x0x7f1e79260c30) 0
+ primary-for QAbstractProxyModel (0x0x7f1e79260bc8)
+ QObject (0x0x7f1e78ee8720) 0
+ primary-for QAbstractItemModel (0x0x7f1e79260c30)
+
+Class QStandardPaths
+ size=1 align=1
+ base size=0 base align=1
+QStandardPaths (0x0x7f1e78ee8ba0) 0 empty
+
+Class QState::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QState::QPrivateSignal (0x0x7f1e78f4d4e0) 0 empty
+
+Vtable for QState
+QState::_ZTV6QState: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI6QState)
+16 (int (*)(...))QState::metaObject
+24 (int (*)(...))QState::qt_metacast
+32 (int (*)(...))QState::qt_metacall
+40 (int (*)(...))QState::~QState
+48 (int (*)(...))QState::~QState
+56 (int (*)(...))QState::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QState::onEntry
+120 (int (*)(...))QState::onExit
+
+Class QState
+ size=16 align=8
+ base size=16 base align=8
+QState (0x0x7f1e79260dd0) 0
+ vptr=((& QState::_ZTV6QState) + 16)
+ QAbstractState (0x0x7f1e79260e38) 0
+ primary-for QState (0x0x7f1e79260dd0)
+ QObject (0x0x7f1e78f4d480) 0
+ primary-for QAbstractState (0x0x7f1e79260e38)
+
+Class QStateMachine::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QStateMachine::QPrivateSignal (0x0x7f1e78f4d960) 0 empty
+
+Vtable for QStateMachine::SignalEvent
+QStateMachine::SignalEvent::_ZTVN13QStateMachine11SignalEventE: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTIN13QStateMachine11SignalEventE)
+16 (int (*)(...))QStateMachine::SignalEvent::~SignalEvent
+24 (int (*)(...))QStateMachine::SignalEvent::~SignalEvent
+
+Class QStateMachine::SignalEvent
+ size=48 align=8
+ base size=48 base align=8
+QStateMachine::SignalEvent (0x0x7f1e78f7c000) 0
+ vptr=((& QStateMachine::SignalEvent::_ZTVN13QStateMachine11SignalEventE) + 16)
+ QEvent (0x0x7f1e78f4d9c0) 0
+ primary-for QStateMachine::SignalEvent (0x0x7f1e78f7c000)
+
+Vtable for QStateMachine::WrappedEvent
+QStateMachine::WrappedEvent::_ZTVN13QStateMachine12WrappedEventE: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTIN13QStateMachine12WrappedEventE)
+16 (int (*)(...))QStateMachine::WrappedEvent::~WrappedEvent
+24 (int (*)(...))QStateMachine::WrappedEvent::~WrappedEvent
+
+Class QStateMachine::WrappedEvent
+ size=40 align=8
+ base size=40 base align=8
+QStateMachine::WrappedEvent (0x0x7f1e78f7c068) 0
+ vptr=((& QStateMachine::WrappedEvent::_ZTVN13QStateMachine12WrappedEventE) + 16)
+ QEvent (0x0x7f1e78f4da20) 0
+ primary-for QStateMachine::WrappedEvent (0x0x7f1e78f7c068)
+
+Vtable for QStateMachine
+QStateMachine::_ZTV13QStateMachine: 20 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QStateMachine)
+16 (int (*)(...))QStateMachine::metaObject
+24 (int (*)(...))QStateMachine::qt_metacast
+32 (int (*)(...))QStateMachine::qt_metacall
+40 (int (*)(...))QStateMachine::~QStateMachine
+48 (int (*)(...))QStateMachine::~QStateMachine
+56 (int (*)(...))QStateMachine::event
+64 (int (*)(...))QStateMachine::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QStateMachine::onEntry
+120 (int (*)(...))QStateMachine::onExit
+128 (int (*)(...))QStateMachine::beginSelectTransitions
+136 (int (*)(...))QStateMachine::endSelectTransitions
+144 (int (*)(...))QStateMachine::beginMicrostep
+152 (int (*)(...))QStateMachine::endMicrostep
+
+Class QStateMachine
+ size=16 align=8
+ base size=16 base align=8
+QStateMachine (0x0x7f1e79260ea0) 0
+ vptr=((& QStateMachine::_ZTV13QStateMachine) + 16)
+ QState (0x0x7f1e79260f08) 0
+ primary-for QStateMachine (0x0x7f1e79260ea0)
+ QAbstractState (0x0x7f1e79260f70) 0
+ primary-for QState (0x0x7f1e79260f08)
+ QObject (0x0x7f1e78f4d900) 0
+ primary-for QAbstractState (0x0x7f1e79260f70)
+
+Class QStorageInfo
+ size=8 align=8
+ base size=8 base align=8
+QStorageInfo (0x0x7f1e78f4de40) 0
+
+Class QAbstractConcatenable
+ size=1 align=1
+ base size=0 base align=1
+QAbstractConcatenable (0x0x7f1e7907cc00) 0 empty
+
+Class QStringListModel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QStringListModel::QPrivateSignal (0x0x7f1e78d00f60) 0 empty
+
+Vtable for QStringListModel
+QStringListModel::_ZTV16QStringListModel: 48 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QStringListModel)
+16 (int (*)(...))QStringListModel::metaObject
+24 (int (*)(...))QStringListModel::qt_metacast
+32 (int (*)(...))QStringListModel::qt_metacall
+40 (int (*)(...))QStringListModel::~QStringListModel
+48 (int (*)(...))QStringListModel::~QStringListModel
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QAbstractListModel::index
+120 (int (*)(...))QAbstractListModel::parent
+128 (int (*)(...))QStringListModel::sibling
+136 (int (*)(...))QStringListModel::rowCount
+144 (int (*)(...))QAbstractListModel::columnCount
+152 (int (*)(...))QAbstractListModel::hasChildren
+160 (int (*)(...))QStringListModel::data
+168 (int (*)(...))QStringListModel::setData
+176 (int (*)(...))QAbstractItemModel::headerData
+184 (int (*)(...))QAbstractItemModel::setHeaderData
+192 (int (*)(...))QStringListModel::itemData
+200 (int (*)(...))QStringListModel::setItemData
+208 (int (*)(...))QAbstractItemModel::mimeTypes
+216 (int (*)(...))QAbstractItemModel::mimeData
+224 (int (*)(...))QAbstractItemModel::canDropMimeData
+232 (int (*)(...))QAbstractListModel::dropMimeData
+240 (int (*)(...))QStringListModel::supportedDropActions
+248 (int (*)(...))QAbstractItemModel::supportedDragActions
+256 (int (*)(...))QStringListModel::insertRows
+264 (int (*)(...))QAbstractItemModel::insertColumns
+272 (int (*)(...))QStringListModel::removeRows
+280 (int (*)(...))QAbstractItemModel::removeColumns
+288 (int (*)(...))QStringListModel::moveRows
+296 (int (*)(...))QAbstractItemModel::moveColumns
+304 (int (*)(...))QAbstractItemModel::fetchMore
+312 (int (*)(...))QAbstractItemModel::canFetchMore
+320 (int (*)(...))QStringListModel::flags
+328 (int (*)(...))QStringListModel::sort
+336 (int (*)(...))QAbstractItemModel::buddy
+344 (int (*)(...))QAbstractItemModel::match
+352 (int (*)(...))QAbstractItemModel::span
+360 (int (*)(...))QAbstractItemModel::roleNames
+368 (int (*)(...))QAbstractItemModel::submit
+376 (int (*)(...))QAbstractItemModel::revert
+
+Class QStringListModel
+ size=24 align=8
+ base size=24 base align=8
+QStringListModel (0x0x7f1e78d01958) 0
+ vptr=((& QStringListModel::_ZTV16QStringListModel) + 16)
+ QAbstractListModel (0x0x7f1e78d019c0) 0
+ primary-for QStringListModel (0x0x7f1e78d01958)
+ QAbstractItemModel (0x0x7f1e78d01a28) 0
+ primary-for QAbstractListModel (0x0x7f1e78d019c0)
+ QObject (0x0x7f1e78d00f00) 0
+ primary-for QAbstractItemModel (0x0x7f1e78d01a28)
+
+Class QSystemSemaphore
+ size=8 align=8
+ base size=8 base align=8
+QSystemSemaphore (0x0x7f1e78d3b0c0) 0
+
+Class QTemporaryDir
+ size=8 align=8
+ base size=8 base align=8
+QTemporaryDir (0x0x7f1e78d3b180) 0
+
+Class QTemporaryFile::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTemporaryFile::QPrivateSignal (0x0x7f1e78d3b2a0) 0 empty
+
+Vtable for QTemporaryFile
+QTemporaryFile::_ZTV14QTemporaryFile: 34 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QTemporaryFile)
+16 (int (*)(...))QTemporaryFile::metaObject
+24 (int (*)(...))QTemporaryFile::qt_metacast
+32 (int (*)(...))QTemporaryFile::qt_metacall
+40 (int (*)(...))QTemporaryFile::~QTemporaryFile
+48 (int (*)(...))QTemporaryFile::~QTemporaryFile
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QFileDevice::isSequential
+120 (int (*)(...))QTemporaryFile::open
+128 (int (*)(...))QFileDevice::close
+136 (int (*)(...))QFileDevice::pos
+144 (int (*)(...))QFile::size
+152 (int (*)(...))QFileDevice::seek
+160 (int (*)(...))QFileDevice::atEnd
+168 (int (*)(...))QIODevice::reset
+176 (int (*)(...))QIODevice::bytesAvailable
+184 (int (*)(...))QIODevice::bytesToWrite
+192 (int (*)(...))QIODevice::canReadLine
+200 (int (*)(...))QIODevice::waitForReadyRead
+208 (int (*)(...))QIODevice::waitForBytesWritten
+216 (int (*)(...))QFileDevice::readData
+224 (int (*)(...))QFileDevice::readLineData
+232 (int (*)(...))QFileDevice::writeData
+240 (int (*)(...))QTemporaryFile::fileName
+248 (int (*)(...))QFile::resize
+256 (int (*)(...))QFile::permissions
+264 (int (*)(...))QFile::setPermissions
+
+Class QTemporaryFile
+ size=16 align=8
+ base size=16 base align=8
+QTemporaryFile (0x0x7f1e78d01a90) 0
+ vptr=((& QTemporaryFile::_ZTV14QTemporaryFile) + 16)
+ QFile (0x0x7f1e78d01af8) 0
+ primary-for QTemporaryFile (0x0x7f1e78d01a90)
+ QFileDevice (0x0x7f1e78d01b60) 0
+ primary-for QFile (0x0x7f1e78d01af8)
+ QIODevice (0x0x7f1e78d01bc8) 0
+ primary-for QFileDevice (0x0x7f1e78d01b60)
+ QObject (0x0x7f1e78d3b240) 0
+ primary-for QIODevice (0x0x7f1e78d01bc8)
+
+Class QTextBoundaryFinder
+ size=48 align=8
+ base size=48 base align=8
+QTextBoundaryFinder (0x0x7f1e78d3b600) 0
+
+Class QTextCodec::ConverterState
+ size=32 align=8
+ base size=32 base align=8
+QTextCodec::ConverterState (0x0x7f1e78d3be40) 0
+
+Vtable for QTextCodec
+QTextCodec::_ZTV10QTextCodec: 9 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QTextCodec)
+16 (int (*)(...))__cxa_pure_virtual
+24 (int (*)(...))QTextCodec::aliases
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+56 0
+64 0
+
+Class QTextCodec
+ size=8 align=8
+ base size=8 base align=8
+QTextCodec (0x0x7f1e78d3bde0) 0 nearly-empty
+ vptr=((& QTextCodec::_ZTV10QTextCodec) + 16)
+
+Class QTextEncoder
+ size=40 align=8
+ base size=40 base align=8
+QTextEncoder (0x0x7f1e78db4840) 0
+
+Class QTextDecoder
+ size=40 align=8
+ base size=40 base align=8
+QTextDecoder (0x0x7f1e78db4a20) 0
+
+Vtable for std::thread::_State
+std::thread::_State::_ZTVNSt6thread6_StateE: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTINSt6thread6_StateE)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+
+Class std::thread::_State
+ size=8 align=8
+ base size=8 base align=8
+std::thread::_State (0x0x7f1e78db4c60) 0 nearly-empty
+ vptr=((& std::thread::_State::_ZTVNSt6thread6_StateE) + 16)
+
+Class std::thread::id
+ size=8 align=8
+ base size=8 base align=8
+std::thread::id (0x0x7f1e78db4cc0) 0
+
+Class std::thread
+ size=8 align=8
+ base size=8 base align=8
+std::thread (0x0x7f1e78db4c00) 0
+
+Class std::condition_variable
+ size=48 align=8
+ base size=48 base align=8
+std::condition_variable (0x0x7f1e78c940c0) 0
+
+Class std::__at_thread_exit_elt
+ size=16 align=8
+ base size=16 base align=8
+std::__at_thread_exit_elt (0x0x7f1e78c94480) 0
+
+Class std::_V2::condition_variable_any
+ size=64 align=8
+ base size=64 base align=8
+std::_V2::condition_variable_any (0x0x7f1e78c944e0) 0
+
+Class std::__atomic_futex_unsigned_base
+ size=1 align=1
+ base size=0 base align=1
+std::__atomic_futex_unsigned_base (0x0x7f1e78a157e0) 0 empty
+
+Vtable for std::future_error
+std::future_error::_ZTVSt12future_error: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt12future_error)
+16 (int (*)(...))std::future_error::~future_error
+24 (int (*)(...))std::future_error::~future_error
+32 (int (*)(...))std::future_error::what
+
+Class std::future_error
+ size=32 align=8
+ base size=32 base align=8
+std::future_error (0x0x7f1e78a09f70) 0
+ vptr=((& std::future_error::_ZTVSt12future_error) + 16)
+ std::logic_error (0x0x7f1e78a42000) 0
+ primary-for std::future_error (0x0x7f1e78a09f70)
+ std::exception (0x0x7f1e78a15f00) 0 nearly-empty
+ primary-for std::logic_error (0x0x7f1e78a42000)
+
+Class std::__future_base::_Result_base::_Deleter
+ size=1 align=1
+ base size=0 base align=1
+std::__future_base::_Result_base::_Deleter (0x0x7f1e78a49660) 0 empty
+
+Vtable for std::__future_base::_Result_base
+std::__future_base::_Result_base::_ZTVNSt13__future_base12_Result_baseE: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTINSt13__future_base12_Result_baseE)
+16 (int (*)(...))__cxa_pure_virtual
+24 0
+32 0
+
+Class std::__future_base::_Result_base
+ size=16 align=8
+ base size=16 base align=8
+std::__future_base::_Result_base (0x0x7f1e78a49600) 0
+ vptr=((& std::__future_base::_Result_base::_ZTVNSt13__future_base12_Result_baseE) + 16)
+
+Class std::__future_base::_State_baseV2::__exception_ptr_tag
+ size=1 align=1
+ base size=0 base align=1
+std::__future_base::_State_baseV2::__exception_ptr_tag (0x0x7f1e78809d80) 0 empty
+
+Class std::__future_base::_State_baseV2::_Make_ready
+ size=32 align=8
+ base size=32 base align=8
+std::__future_base::_State_baseV2::_Make_ready (0x0x7f1e7882c820) 0
+ std::__at_thread_exit_elt (0x0x7f1e78809e40) 0
+
+Vtable for std::__future_base::_State_baseV2
+std::__future_base::_State_baseV2::_ZTVNSt13__future_base13_State_baseV2E: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTINSt13__future_base13_State_baseV2E)
+16 (int (*)(...))std::__future_base::_State_baseV2::~_State_baseV2
+24 (int (*)(...))std::__future_base::_State_baseV2::~_State_baseV2
+32 (int (*)(...))std::__future_base::_State_baseV2::_M_complete_async
+40 (int (*)(...))std::__future_base::_State_baseV2::_M_is_deferred_future
+
+Class std::__future_base::_State_baseV2
+ size=32 align=8
+ base size=28 base align=8
+std::__future_base::_State_baseV2 (0x0x7f1e78a497e0) 0
+ vptr=((& std::__future_base::_State_baseV2::_ZTVNSt13__future_base13_State_baseV2E) + 16)
+
+Class std::__future_base
+ size=1 align=1
+ base size=0 base align=1
+std::__future_base (0x0x7f1e78a495a0) 0 empty
+
+Vtable for std::__future_base::_Async_state_commonV2
+std::__future_base::_Async_state_commonV2::_ZTVNSt13__future_base21_Async_state_commonV2E: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTINSt13__future_base21_Async_state_commonV2E)
+16 (int (*)(...))std::__future_base::_Async_state_commonV2::~_Async_state_commonV2
+24 (int (*)(...))std::__future_base::_Async_state_commonV2::~_Async_state_commonV2
+32 (int (*)(...))std::__future_base::_Async_state_commonV2::_M_complete_async
+40 (int (*)(...))std::__future_base::_State_baseV2::_M_is_deferred_future
+
+Class std::__future_base::_Async_state_commonV2
+ size=48 align=8
+ base size=44 base align=8
+std::__future_base::_Async_state_commonV2 (0x0x7f1e77f85af8) 0
+ vptr=((& std::__future_base::_Async_state_commonV2::_ZTVNSt13__future_base21_Async_state_commonV2E) + 16)
+ std::__future_base::_State_baseV2 (0x0x7f1e77fb8a20) 0
+ primary-for std::__future_base::_Async_state_commonV2 (0x0x7f1e77f85af8)
+
+Class QThread::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QThread::QPrivateSignal (0x0x7f1e77fed300) 0 empty
+
+Vtable for QThread
+QThread::_ZTV7QThread: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI7QThread)
+16 (int (*)(...))QThread::metaObject
+24 (int (*)(...))QThread::qt_metacast
+32 (int (*)(...))QThread::qt_metacall
+40 (int (*)(...))QThread::~QThread
+48 (int (*)(...))QThread::~QThread
+56 (int (*)(...))QThread::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QThread::run
+
+Class QThread
+ size=16 align=8
+ base size=16 base align=8
+QThread (0x0x7f1e77f85e38) 0
+ vptr=((& QThread::_ZTV7QThread) + 16)
+ QObject (0x0x7f1e77fed2a0) 0
+ primary-for QThread (0x0x7f1e77f85e38)
+
+Class QThreadPool::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QThreadPool::QPrivateSignal (0x0x7f1e77fed6c0) 0 empty
+
+Vtable for QThreadPool
+QThreadPool::_ZTV11QThreadPool: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QThreadPool)
+16 (int (*)(...))QThreadPool::metaObject
+24 (int (*)(...))QThreadPool::qt_metacast
+32 (int (*)(...))QThreadPool::qt_metacall
+40 (int (*)(...))QThreadPool::~QThreadPool
+48 (int (*)(...))QThreadPool::~QThreadPool
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QThreadPool
+ size=16 align=8
+ base size=16 base align=8
+QThreadPool (0x0x7f1e77f85ea0) 0
+ vptr=((& QThreadPool::_ZTV11QThreadPool) + 16)
+ QObject (0x0x7f1e77fed660) 0
+ primary-for QThreadPool (0x0x7f1e77f85ea0)
+
+Class QThreadStorageData
+ size=4 align=4
+ base size=4 base align=4
+QThreadStorageData (0x0x7f1e77fed8a0) 0
+
+Class QTimeLine::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTimeLine::QPrivateSignal (0x0x7f1e77fedf60) 0 empty
+
+Vtable for QTimeLine
+QTimeLine::_ZTV9QTimeLine: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QTimeLine)
+16 (int (*)(...))QTimeLine::metaObject
+24 (int (*)(...))QTimeLine::qt_metacast
+32 (int (*)(...))QTimeLine::qt_metacall
+40 (int (*)(...))QTimeLine::~QTimeLine
+48 (int (*)(...))QTimeLine::~QTimeLine
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QTimeLine::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QTimeLine::valueForTime
+
+Class QTimeLine
+ size=16 align=8
+ base size=16 base align=8
+QTimeLine (0x0x7f1e77f85f08) 0
+ vptr=((& QTimeLine::_ZTV9QTimeLine) + 16)
+ QObject (0x0x7f1e77fedf00) 0
+ primary-for QTimeLine (0x0x7f1e77f85f08)
+
+Class QTimer::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTimer::QPrivateSignal (0x0x7f1e780411e0) 0 empty
+
+Vtable for QTimer
+QTimer::_ZTV6QTimer: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI6QTimer)
+16 (int (*)(...))QTimer::metaObject
+24 (int (*)(...))QTimer::qt_metacast
+32 (int (*)(...))QTimer::qt_metacall
+40 (int (*)(...))QTimer::~QTimer
+48 (int (*)(...))QTimer::~QTimer
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QTimer::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QTimer
+ size=32 align=8
+ base size=29 base align=8
+QTimer (0x0x7f1e77f85f70) 0
+ vptr=((& QTimer::_ZTV6QTimer) + 16)
+ QObject (0x0x7f1e78041180) 0
+ primary-for QTimer (0x0x7f1e77f85f70)
+
+Class QTimeZone::OffsetData
+ size=32 align=8
+ base size=28 base align=8
+QTimeZone::OffsetData (0x0x7f1e78077b40) 0
+
+Class QTimeZone
+ size=8 align=8
+ base size=8 base align=8
+QTimeZone (0x0x7f1e78077ae0) 0
+
+Class QTranslator::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTranslator::QPrivateSignal (0x0x7f1e77d19c00) 0 empty
+
+Vtable for QTranslator
+QTranslator::_ZTV11QTranslator: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QTranslator)
+16 (int (*)(...))QTranslator::metaObject
+24 (int (*)(...))QTranslator::qt_metacast
+32 (int (*)(...))QTranslator::qt_metacall
+40 (int (*)(...))QTranslator::~QTranslator
+48 (int (*)(...))QTranslator::~QTranslator
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QTranslator::translate
+120 (int (*)(...))QTranslator::isEmpty
+
+Class QTranslator
+ size=16 align=8
+ base size=16 base align=8
+QTranslator (0x0x7f1e77d27680) 0
+ vptr=((& QTranslator::_ZTV11QTranslator) + 16)
+ QObject (0x0x7f1e77d19ba0) 0
+ primary-for QTranslator (0x0x7f1e77d27680)
+
+Class QTransposeProxyModel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTransposeProxyModel::QPrivateSignal (0x0x7f1e77d19e40) 0 empty
+
+Vtable for QTransposeProxyModel
+QTransposeProxyModel::_ZTV20QTransposeProxyModel: 53 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QTransposeProxyModel)
+16 (int (*)(...))QTransposeProxyModel::metaObject
+24 (int (*)(...))QTransposeProxyModel::qt_metacast
+32 (int (*)(...))QTransposeProxyModel::qt_metacall
+40 (int (*)(...))QTransposeProxyModel::~QTransposeProxyModel
+48 (int (*)(...))QTransposeProxyModel::~QTransposeProxyModel
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QTransposeProxyModel::index
+120 (int (*)(...))QTransposeProxyModel::parent
+128 (int (*)(...))QAbstractProxyModel::sibling
+136 (int (*)(...))QTransposeProxyModel::rowCount
+144 (int (*)(...))QTransposeProxyModel::columnCount
+152 (int (*)(...))QAbstractProxyModel::hasChildren
+160 (int (*)(...))QAbstractProxyModel::data
+168 (int (*)(...))QAbstractProxyModel::setData
+176 (int (*)(...))QTransposeProxyModel::headerData
+184 (int (*)(...))QTransposeProxyModel::setHeaderData
+192 (int (*)(...))QTransposeProxyModel::itemData
+200 (int (*)(...))QTransposeProxyModel::setItemData
+208 (int (*)(...))QAbstractProxyModel::mimeTypes
+216 (int (*)(...))QAbstractProxyModel::mimeData
+224 (int (*)(...))QAbstractProxyModel::canDropMimeData
+232 (int (*)(...))QAbstractProxyModel::dropMimeData
+240 (int (*)(...))QAbstractProxyModel::supportedDropActions
+248 (int (*)(...))QAbstractProxyModel::supportedDragActions
+256 (int (*)(...))QTransposeProxyModel::insertRows
+264 (int (*)(...))QTransposeProxyModel::insertColumns
+272 (int (*)(...))QTransposeProxyModel::removeRows
+280 (int (*)(...))QTransposeProxyModel::removeColumns
+288 (int (*)(...))QTransposeProxyModel::moveRows
+296 (int (*)(...))QTransposeProxyModel::moveColumns
+304 (int (*)(...))QAbstractProxyModel::fetchMore
+312 (int (*)(...))QAbstractProxyModel::canFetchMore
+320 (int (*)(...))QAbstractProxyModel::flags
+328 (int (*)(...))QTransposeProxyModel::sort
+336 (int (*)(...))QAbstractProxyModel::buddy
+344 (int (*)(...))QAbstractItemModel::match
+352 (int (*)(...))QTransposeProxyModel::span
+360 (int (*)(...))QAbstractItemModel::roleNames
+368 (int (*)(...))QAbstractProxyModel::submit
+376 (int (*)(...))QAbstractProxyModel::revert
+384 (int (*)(...))QTransposeProxyModel::setSourceModel
+392 (int (*)(...))QTransposeProxyModel::mapToSource
+400 (int (*)(...))QTransposeProxyModel::mapFromSource
+408 (int (*)(...))QAbstractProxyModel::mapSelectionToSource
+416 (int (*)(...))QAbstractProxyModel::mapSelectionFromSource
+
+Class QTransposeProxyModel
+ size=16 align=8
+ base size=16 base align=8
+QTransposeProxyModel (0x0x7f1e77d276e8) 0
+ vptr=((& QTransposeProxyModel::_ZTV20QTransposeProxyModel) + 16)
+ QAbstractProxyModel (0x0x7f1e77d27750) 0
+ primary-for QTransposeProxyModel (0x0x7f1e77d276e8)
+ QAbstractItemModel (0x0x7f1e77d277b8) 0
+ primary-for QAbstractProxyModel (0x0x7f1e77d27750)
+ QObject (0x0x7f1e77d19de0) 0
+ primary-for QAbstractItemModel (0x0x7f1e77d277b8)
+
+Class QUrlQuery
+ size=8 align=8
+ base size=8 base align=8
+QUrlQuery (0x0x7f1e77d58060) 0
+
+Class QWaitCondition
+ size=8 align=8
+ base size=8 base align=8
+QWaitCondition (0x0x7f1e77e39540) 0
+
+Class QXmlStreamStringRef
+ size=16 align=8
+ base size=16 base align=8
+QXmlStreamStringRef (0x0x7f1e77e39660) 0
+
+Class QXmlStreamAttribute
+ size=80 align=8
+ base size=73 base align=8
+QXmlStreamAttribute (0x0x7f1e77ecaa20) 0
+
+Class QXmlStreamAttributes
+ size=8 align=8
+ base size=8 base align=8
+QXmlStreamAttributes (0x0x7f1e77b37a90) 0
+ QVector<QXmlStreamAttribute> (0x0x7f1e77b40180) 0
+
+Class QXmlStreamNamespaceDeclaration
+ size=40 align=8
+ base size=40 base align=8
+QXmlStreamNamespaceDeclaration (0x0x7f1e77b40480) 0
+
+Class QXmlStreamNotationDeclaration
+ size=56 align=8
+ base size=56 base align=8
+QXmlStreamNotationDeclaration (0x0x7f1e77bcc420) 0
+
+Class QXmlStreamEntityDeclaration
+ size=88 align=8
+ base size=88 base align=8
+QXmlStreamEntityDeclaration (0x0x7f1e77c2b420) 0
+
+Vtable for QXmlStreamEntityResolver
+QXmlStreamEntityResolver::_ZTV24QXmlStreamEntityResolver: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI24QXmlStreamEntityResolver)
+16 (int (*)(...))QXmlStreamEntityResolver::~QXmlStreamEntityResolver
+24 (int (*)(...))QXmlStreamEntityResolver::~QXmlStreamEntityResolver
+32 (int (*)(...))QXmlStreamEntityResolver::resolveEntity
+40 (int (*)(...))QXmlStreamEntityResolver::resolveUndeclaredEntity
+
+Class QXmlStreamEntityResolver
+ size=8 align=8
+ base size=8 base align=8
+QXmlStreamEntityResolver (0x0x7f1e77c954e0) 0 nearly-empty
+ vptr=((& QXmlStreamEntityResolver::_ZTV24QXmlStreamEntityResolver) + 16)
+
+Class QXmlStreamReader
+ size=8 align=8
+ base size=8 base align=8
+QXmlStreamReader (0x0x7f1e77c95540) 0
+
+Class QXmlStreamWriter
+ size=8 align=8
+ base size=8 base align=8
+QXmlStreamWriter (0x0x7f1e778f2420) 0
+
+Class QRgba64
+ size=8 align=8
+ base size=8 base align=8
+QRgba64 (0x0x7f1e778f2a20) 0
+
+Class QColor::CT
+ size=10 align=2
+ base size=10 base align=2
+QColor::CT (0x0x7f1e779aaae0) 0
+
+Class QColor
+ size=16 align=4
+ base size=14 base align=4
+QColor (0x0x7f1e779aaa80) 0
+
+Class QRegion::QRegionData
+ size=16 align=8
+ base size=16 base align=8
+QRegion::QRegionData (0x0x7f1e77a6a9c0) 0
+
+Class QRegion
+ size=8 align=8
+ base size=8 base align=8
+QRegion (0x0x7f1e77a6a960) 0
+
+Class QKeySequence
+ size=8 align=8
+ base size=8 base align=8
+QKeySequence (0x0x7f1e777f2600) 0
+
+Class QVector2D
+ size=8 align=4
+ base size=8 base align=4
+QVector2D (0x0x7f1e774e2180) 0
+
+Class QTouchDevice
+ size=8 align=8
+ base size=8 base align=8
+QTouchDevice (0x0x7f1e77557240) 0
+
+Vtable for QInputEvent
+QInputEvent::_ZTV11QInputEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QInputEvent)
+16 (int (*)(...))QInputEvent::~QInputEvent
+24 (int (*)(...))QInputEvent::~QInputEvent
+
+Class QInputEvent
+ size=32 align=8
+ base size=32 base align=8
+QInputEvent (0x0x7f1e775311a0) 0
+ vptr=((& QInputEvent::_ZTV11QInputEvent) + 16)
+ QEvent (0x0x7f1e77557ae0) 0
+ primary-for QInputEvent (0x0x7f1e775311a0)
+
+Vtable for QEnterEvent
+QEnterEvent::_ZTV11QEnterEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QEnterEvent)
+16 (int (*)(...))QEnterEvent::~QEnterEvent
+24 (int (*)(...))QEnterEvent::~QEnterEvent
+
+Class QEnterEvent
+ size=72 align=8
+ base size=72 base align=8
+QEnterEvent (0x0x7f1e77531208) 0
+ vptr=((& QEnterEvent::_ZTV11QEnterEvent) + 16)
+ QEvent (0x0x7f1e77557cc0) 0
+ primary-for QEnterEvent (0x0x7f1e77531208)
+
+Vtable for QMouseEvent
+QMouseEvent::_ZTV11QMouseEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QMouseEvent)
+16 (int (*)(...))QMouseEvent::~QMouseEvent
+24 (int (*)(...))QMouseEvent::~QMouseEvent
+
+Class QMouseEvent
+ size=104 align=8
+ base size=100 base align=8
+QMouseEvent (0x0x7f1e77531270) 0
+ vptr=((& QMouseEvent::_ZTV11QMouseEvent) + 16)
+ QInputEvent (0x0x7f1e775312d8) 0
+ primary-for QMouseEvent (0x0x7f1e77531270)
+ QEvent (0x0x7f1e775a50c0) 0
+ primary-for QInputEvent (0x0x7f1e775312d8)
+
+Vtable for QHoverEvent
+QHoverEvent::_ZTV11QHoverEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QHoverEvent)
+16 (int (*)(...))QHoverEvent::~QHoverEvent
+24 (int (*)(...))QHoverEvent::~QHoverEvent
+
+Class QHoverEvent
+ size=64 align=8
+ base size=64 base align=8
+QHoverEvent (0x0x7f1e77531340) 0
+ vptr=((& QHoverEvent::_ZTV11QHoverEvent) + 16)
+ QInputEvent (0x0x7f1e775313a8) 0
+ primary-for QHoverEvent (0x0x7f1e77531340)
+ QEvent (0x0x7f1e775a55a0) 0
+ primary-for QInputEvent (0x0x7f1e775313a8)
+
+Vtable for QWheelEvent
+QWheelEvent::_ZTV11QWheelEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QWheelEvent)
+16 (int (*)(...))QWheelEvent::~QWheelEvent
+24 (int (*)(...))QWheelEvent::~QWheelEvent
+
+Class QWheelEvent
+ size=96 align=8
+ base size=96 base align=8
+QWheelEvent (0x0x7f1e77531410) 0
+ vptr=((& QWheelEvent::_ZTV11QWheelEvent) + 16)
+ QInputEvent (0x0x7f1e77531478) 0
+ primary-for QWheelEvent (0x0x7f1e77531410)
+ QEvent (0x0x7f1e775a5780) 0
+ primary-for QInputEvent (0x0x7f1e77531478)
+
+Vtable for QTabletEvent
+QTabletEvent::_ZTV12QTabletEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QTabletEvent)
+16 (int (*)(...))QTabletEvent::~QTabletEvent
+24 (int (*)(...))QTabletEvent::~QTabletEvent
+
+Class QTabletEvent
+ size=128 align=8
+ base size=128 base align=8
+QTabletEvent (0x0x7f1e775314e0) 0
+ vptr=((& QTabletEvent::_ZTV12QTabletEvent) + 16)
+ QInputEvent (0x0x7f1e77531548) 0
+ primary-for QTabletEvent (0x0x7f1e775314e0)
+ QEvent (0x0x7f1e775a5ea0) 0
+ primary-for QInputEvent (0x0x7f1e77531548)
+
+Vtable for QNativeGestureEvent
+QNativeGestureEvent::_ZTV19QNativeGestureEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QNativeGestureEvent)
+16 (int (*)(...))QNativeGestureEvent::~QNativeGestureEvent
+24 (int (*)(...))QNativeGestureEvent::~QNativeGestureEvent
+
+Class QNativeGestureEvent
+ size=112 align=8
+ base size=112 base align=8
+QNativeGestureEvent (0x0x7f1e775315b0) 0
+ vptr=((& QNativeGestureEvent::_ZTV19QNativeGestureEvent) + 16)
+ QInputEvent (0x0x7f1e77531618) 0
+ primary-for QNativeGestureEvent (0x0x7f1e775315b0)
+ QEvent (0x0x7f1e775f6840) 0
+ primary-for QInputEvent (0x0x7f1e77531618)
+
+Vtable for QKeyEvent
+QKeyEvent::_ZTV9QKeyEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QKeyEvent)
+16 (int (*)(...))QKeyEvent::~QKeyEvent
+24 (int (*)(...))QKeyEvent::~QKeyEvent
+
+Class QKeyEvent
+ size=64 align=8
+ base size=59 base align=8
+QKeyEvent (0x0x7f1e77531680) 0
+ vptr=((& QKeyEvent::_ZTV9QKeyEvent) + 16)
+ QInputEvent (0x0x7f1e775316e8) 0
+ primary-for QKeyEvent (0x0x7f1e77531680)
+ QEvent (0x0x7f1e775f6b40) 0
+ primary-for QInputEvent (0x0x7f1e775316e8)
+
+Vtable for QFocusEvent
+QFocusEvent::_ZTV11QFocusEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QFocusEvent)
+16 (int (*)(...))QFocusEvent::~QFocusEvent
+24 (int (*)(...))QFocusEvent::~QFocusEvent
+
+Class QFocusEvent
+ size=24 align=8
+ base size=24 base align=8
+QFocusEvent (0x0x7f1e77531750) 0
+ vptr=((& QFocusEvent::_ZTV11QFocusEvent) + 16)
+ QEvent (0x0x7f1e775f6e40) 0
+ primary-for QFocusEvent (0x0x7f1e77531750)
+
+Vtable for QPaintEvent
+QPaintEvent::_ZTV11QPaintEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QPaintEvent)
+16 (int (*)(...))QPaintEvent::~QPaintEvent
+24 (int (*)(...))QPaintEvent::~QPaintEvent
+
+Class QPaintEvent
+ size=56 align=8
+ base size=49 base align=8
+QPaintEvent (0x0x7f1e775317b8) 0
+ vptr=((& QPaintEvent::_ZTV11QPaintEvent) + 16)
+ QEvent (0x0x7f1e775f6f60) 0
+ primary-for QPaintEvent (0x0x7f1e775317b8)
+
+Vtable for QMoveEvent
+QMoveEvent::_ZTV10QMoveEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QMoveEvent)
+16 (int (*)(...))QMoveEvent::~QMoveEvent
+24 (int (*)(...))QMoveEvent::~QMoveEvent
+
+Class QMoveEvent
+ size=40 align=8
+ base size=36 base align=8
+QMoveEvent (0x0x7f1e77531820) 0
+ vptr=((& QMoveEvent::_ZTV10QMoveEvent) + 16)
+ QEvent (0x0x7f1e7762b0c0) 0
+ primary-for QMoveEvent (0x0x7f1e77531820)
+
+Vtable for QExposeEvent
+QExposeEvent::_ZTV12QExposeEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QExposeEvent)
+16 (int (*)(...))QExposeEvent::~QExposeEvent
+24 (int (*)(...))QExposeEvent::~QExposeEvent
+
+Class QExposeEvent
+ size=32 align=8
+ base size=32 base align=8
+QExposeEvent (0x0x7f1e77531888) 0
+ vptr=((& QExposeEvent::_ZTV12QExposeEvent) + 16)
+ QEvent (0x0x7f1e7762b1e0) 0
+ primary-for QExposeEvent (0x0x7f1e77531888)
+
+Vtable for QPlatformSurfaceEvent
+QPlatformSurfaceEvent::_ZTV21QPlatformSurfaceEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI21QPlatformSurfaceEvent)
+16 (int (*)(...))QPlatformSurfaceEvent::~QPlatformSurfaceEvent
+24 (int (*)(...))QPlatformSurfaceEvent::~QPlatformSurfaceEvent
+
+Class QPlatformSurfaceEvent
+ size=24 align=8
+ base size=24 base align=8
+QPlatformSurfaceEvent (0x0x7f1e775318f0) 0
+ vptr=((& QPlatformSurfaceEvent::_ZTV21QPlatformSurfaceEvent) + 16)
+ QEvent (0x0x7f1e7762b2a0) 0
+ primary-for QPlatformSurfaceEvent (0x0x7f1e775318f0)
+
+Vtable for QResizeEvent
+QResizeEvent::_ZTV12QResizeEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QResizeEvent)
+16 (int (*)(...))QResizeEvent::~QResizeEvent
+24 (int (*)(...))QResizeEvent::~QResizeEvent
+
+Class QResizeEvent
+ size=40 align=8
+ base size=36 base align=8
+QResizeEvent (0x0x7f1e77531958) 0
+ vptr=((& QResizeEvent::_ZTV12QResizeEvent) + 16)
+ QEvent (0x0x7f1e7762b360) 0
+ primary-for QResizeEvent (0x0x7f1e77531958)
+
+Vtable for QCloseEvent
+QCloseEvent::_ZTV11QCloseEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QCloseEvent)
+16 (int (*)(...))QCloseEvent::~QCloseEvent
+24 (int (*)(...))QCloseEvent::~QCloseEvent
+
+Class QCloseEvent
+ size=24 align=8
+ base size=20 base align=8
+QCloseEvent (0x0x7f1e775319c0) 0
+ vptr=((& QCloseEvent::_ZTV11QCloseEvent) + 16)
+ QEvent (0x0x7f1e7762b480) 0
+ primary-for QCloseEvent (0x0x7f1e775319c0)
+
+Vtable for QIconDragEvent
+QIconDragEvent::_ZTV14QIconDragEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QIconDragEvent)
+16 (int (*)(...))QIconDragEvent::~QIconDragEvent
+24 (int (*)(...))QIconDragEvent::~QIconDragEvent
+
+Class QIconDragEvent
+ size=24 align=8
+ base size=20 base align=8
+QIconDragEvent (0x0x7f1e77531a28) 0
+ vptr=((& QIconDragEvent::_ZTV14QIconDragEvent) + 16)
+ QEvent (0x0x7f1e7762b4e0) 0
+ primary-for QIconDragEvent (0x0x7f1e77531a28)
+
+Vtable for QShowEvent
+QShowEvent::_ZTV10QShowEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QShowEvent)
+16 (int (*)(...))QShowEvent::~QShowEvent
+24 (int (*)(...))QShowEvent::~QShowEvent
+
+Class QShowEvent
+ size=24 align=8
+ base size=20 base align=8
+QShowEvent (0x0x7f1e77531a90) 0
+ vptr=((& QShowEvent::_ZTV10QShowEvent) + 16)
+ QEvent (0x0x7f1e7762b540) 0
+ primary-for QShowEvent (0x0x7f1e77531a90)
+
+Vtable for QHideEvent
+QHideEvent::_ZTV10QHideEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QHideEvent)
+16 (int (*)(...))QHideEvent::~QHideEvent
+24 (int (*)(...))QHideEvent::~QHideEvent
+
+Class QHideEvent
+ size=24 align=8
+ base size=20 base align=8
+QHideEvent (0x0x7f1e77531af8) 0
+ vptr=((& QHideEvent::_ZTV10QHideEvent) + 16)
+ QEvent (0x0x7f1e7762b5a0) 0
+ primary-for QHideEvent (0x0x7f1e77531af8)
+
+Vtable for QContextMenuEvent
+QContextMenuEvent::_ZTV17QContextMenuEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QContextMenuEvent)
+16 (int (*)(...))QContextMenuEvent::~QContextMenuEvent
+24 (int (*)(...))QContextMenuEvent::~QContextMenuEvent
+
+Class QContextMenuEvent
+ size=56 align=8
+ base size=49 base align=8
+QContextMenuEvent (0x0x7f1e77531b60) 0
+ vptr=((& QContextMenuEvent::_ZTV17QContextMenuEvent) + 16)
+ QInputEvent (0x0x7f1e77531bc8) 0
+ primary-for QContextMenuEvent (0x0x7f1e77531b60)
+ QEvent (0x0x7f1e7762b600) 0
+ primary-for QInputEvent (0x0x7f1e77531bc8)
+
+Class QInputMethodEvent::Attribute
+ size=32 align=8
+ base size=32 base align=8
+QInputMethodEvent::Attribute (0x0x7f1e7762b960) 0
+
+Vtable for QInputMethodEvent
+QInputMethodEvent::_ZTV17QInputMethodEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QInputMethodEvent)
+16 (int (*)(...))QInputMethodEvent::~QInputMethodEvent
+24 (int (*)(...))QInputMethodEvent::~QInputMethodEvent
+
+Class QInputMethodEvent
+ size=56 align=8
+ base size=56 base align=8
+QInputMethodEvent (0x0x7f1e77531c30) 0
+ vptr=((& QInputMethodEvent::_ZTV17QInputMethodEvent) + 16)
+ QEvent (0x0x7f1e7762b900) 0
+ primary-for QInputMethodEvent (0x0x7f1e77531c30)
+
+Class QInputMethodQueryEvent::QueryPair
+ size=24 align=8
+ base size=24 base align=8
+QInputMethodQueryEvent::QueryPair (0x0x7f1e776bccc0) 0
+
+Vtable for QInputMethodQueryEvent
+QInputMethodQueryEvent::_ZTV22QInputMethodQueryEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI22QInputMethodQueryEvent)
+16 (int (*)(...))QInputMethodQueryEvent::~QInputMethodQueryEvent
+24 (int (*)(...))QInputMethodQueryEvent::~QInputMethodQueryEvent
+
+Class QInputMethodQueryEvent
+ size=32 align=8
+ base size=32 base align=8
+QInputMethodQueryEvent (0x0x7f1e776bfe38) 0
+ vptr=((& QInputMethodQueryEvent::_ZTV22QInputMethodQueryEvent) + 16)
+ QEvent (0x0x7f1e776bcc60) 0
+ primary-for QInputMethodQueryEvent (0x0x7f1e776bfe38)
+
+Vtable for QDropEvent
+QDropEvent::_ZTV10QDropEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QDropEvent)
+16 (int (*)(...))QDropEvent::~QDropEvent
+24 (int (*)(...))QDropEvent::~QDropEvent
+
+Class QDropEvent
+ size=72 align=8
+ base size=72 base align=8
+QDropEvent (0x0x7f1e77335f08) 0
+ vptr=((& QDropEvent::_ZTV10QDropEvent) + 16)
+ QEvent (0x0x7f1e77339a20) 0
+ primary-for QDropEvent (0x0x7f1e77335f08)
+
+Vtable for QDragMoveEvent
+QDragMoveEvent::_ZTV14QDragMoveEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QDragMoveEvent)
+16 (int (*)(...))QDragMoveEvent::~QDragMoveEvent
+24 (int (*)(...))QDragMoveEvent::~QDragMoveEvent
+
+Class QDragMoveEvent
+ size=88 align=8
+ base size=88 base align=8
+QDragMoveEvent (0x0x7f1e77335f70) 0
+ vptr=((& QDragMoveEvent::_ZTV14QDragMoveEvent) + 16)
+ QDropEvent (0x0x7f1e7735c000) 0
+ primary-for QDragMoveEvent (0x0x7f1e77335f70)
+ QEvent (0x0x7f1e77339de0) 0
+ primary-for QDropEvent (0x0x7f1e7735c000)
+
+Vtable for QDragEnterEvent
+QDragEnterEvent::_ZTV15QDragEnterEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QDragEnterEvent)
+16 (int (*)(...))QDragEnterEvent::~QDragEnterEvent
+24 (int (*)(...))QDragEnterEvent::~QDragEnterEvent
+
+Class QDragEnterEvent
+ size=88 align=8
+ base size=88 base align=8
+QDragEnterEvent (0x0x7f1e7735c068) 0
+ vptr=((& QDragEnterEvent::_ZTV15QDragEnterEvent) + 16)
+ QDragMoveEvent (0x0x7f1e7735c0d0) 0
+ primary-for QDragEnterEvent (0x0x7f1e7735c068)
+ QDropEvent (0x0x7f1e7735c138) 0
+ primary-for QDragMoveEvent (0x0x7f1e7735c0d0)
+ QEvent (0x0x7f1e77364060) 0
+ primary-for QDropEvent (0x0x7f1e7735c138)
+
+Vtable for QDragLeaveEvent
+QDragLeaveEvent::_ZTV15QDragLeaveEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QDragLeaveEvent)
+16 (int (*)(...))QDragLeaveEvent::~QDragLeaveEvent
+24 (int (*)(...))QDragLeaveEvent::~QDragLeaveEvent
+
+Class QDragLeaveEvent
+ size=24 align=8
+ base size=20 base align=8
+QDragLeaveEvent (0x0x7f1e7735c1a0) 0
+ vptr=((& QDragLeaveEvent::_ZTV15QDragLeaveEvent) + 16)
+ QEvent (0x0x7f1e773640c0) 0
+ primary-for QDragLeaveEvent (0x0x7f1e7735c1a0)
+
+Vtable for QHelpEvent
+QHelpEvent::_ZTV10QHelpEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QHelpEvent)
+16 (int (*)(...))QHelpEvent::~QHelpEvent
+24 (int (*)(...))QHelpEvent::~QHelpEvent
+
+Class QHelpEvent
+ size=40 align=8
+ base size=36 base align=8
+QHelpEvent (0x0x7f1e7735c208) 0
+ vptr=((& QHelpEvent::_ZTV10QHelpEvent) + 16)
+ QEvent (0x0x7f1e77364120) 0
+ primary-for QHelpEvent (0x0x7f1e7735c208)
+
+Vtable for QStatusTipEvent
+QStatusTipEvent::_ZTV15QStatusTipEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QStatusTipEvent)
+16 (int (*)(...))QStatusTipEvent::~QStatusTipEvent
+24 (int (*)(...))QStatusTipEvent::~QStatusTipEvent
+
+Class QStatusTipEvent
+ size=32 align=8
+ base size=32 base align=8
+QStatusTipEvent (0x0x7f1e7735c270) 0
+ vptr=((& QStatusTipEvent::_ZTV15QStatusTipEvent) + 16)
+ QEvent (0x0x7f1e773643c0) 0
+ primary-for QStatusTipEvent (0x0x7f1e7735c270)
+
+Vtable for QWhatsThisClickedEvent
+QWhatsThisClickedEvent::_ZTV22QWhatsThisClickedEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI22QWhatsThisClickedEvent)
+16 (int (*)(...))QWhatsThisClickedEvent::~QWhatsThisClickedEvent
+24 (int (*)(...))QWhatsThisClickedEvent::~QWhatsThisClickedEvent
+
+Class QWhatsThisClickedEvent
+ size=32 align=8
+ base size=32 base align=8
+QWhatsThisClickedEvent (0x0x7f1e7735c2d8) 0
+ vptr=((& QWhatsThisClickedEvent::_ZTV22QWhatsThisClickedEvent) + 16)
+ QEvent (0x0x7f1e77364480) 0
+ primary-for QWhatsThisClickedEvent (0x0x7f1e7735c2d8)
+
+Vtable for QActionEvent
+QActionEvent::_ZTV12QActionEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QActionEvent)
+16 (int (*)(...))QActionEvent::~QActionEvent
+24 (int (*)(...))QActionEvent::~QActionEvent
+
+Class QActionEvent
+ size=40 align=8
+ base size=40 base align=8
+QActionEvent (0x0x7f1e7735c340) 0
+ vptr=((& QActionEvent::_ZTV12QActionEvent) + 16)
+ QEvent (0x0x7f1e77364540) 0
+ primary-for QActionEvent (0x0x7f1e7735c340)
+
+Vtable for QFileOpenEvent
+QFileOpenEvent::_ZTV14QFileOpenEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QFileOpenEvent)
+16 (int (*)(...))QFileOpenEvent::~QFileOpenEvent
+24 (int (*)(...))QFileOpenEvent::~QFileOpenEvent
+
+Class QFileOpenEvent
+ size=40 align=8
+ base size=40 base align=8
+QFileOpenEvent (0x0x7f1e7735c3a8) 0
+ vptr=((& QFileOpenEvent::_ZTV14QFileOpenEvent) + 16)
+ QEvent (0x0x7f1e77364660) 0
+ primary-for QFileOpenEvent (0x0x7f1e7735c3a8)
+
+Vtable for QToolBarChangeEvent
+QToolBarChangeEvent::_ZTV19QToolBarChangeEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QToolBarChangeEvent)
+16 (int (*)(...))QToolBarChangeEvent::~QToolBarChangeEvent
+24 (int (*)(...))QToolBarChangeEvent::~QToolBarChangeEvent
+
+Class QToolBarChangeEvent
+ size=24 align=8
+ base size=21 base align=8
+QToolBarChangeEvent (0x0x7f1e7735c410) 0
+ vptr=((& QToolBarChangeEvent::_ZTV19QToolBarChangeEvent) + 16)
+ QEvent (0x0x7f1e77364780) 0
+ primary-for QToolBarChangeEvent (0x0x7f1e7735c410)
+
+Vtable for QShortcutEvent
+QShortcutEvent::_ZTV14QShortcutEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QShortcutEvent)
+16 (int (*)(...))QShortcutEvent::~QShortcutEvent
+24 (int (*)(...))QShortcutEvent::~QShortcutEvent
+
+Class QShortcutEvent
+ size=40 align=8
+ base size=40 base align=8
+QShortcutEvent (0x0x7f1e7735c478) 0
+ vptr=((& QShortcutEvent::_ZTV14QShortcutEvent) + 16)
+ QEvent (0x0x7f1e77364840) 0
+ primary-for QShortcutEvent (0x0x7f1e7735c478)
+
+Vtable for QWindowStateChangeEvent
+QWindowStateChangeEvent::_ZTV23QWindowStateChangeEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI23QWindowStateChangeEvent)
+16 (int (*)(...))QWindowStateChangeEvent::~QWindowStateChangeEvent
+24 (int (*)(...))QWindowStateChangeEvent::~QWindowStateChangeEvent
+
+Class QWindowStateChangeEvent
+ size=32 align=8
+ base size=25 base align=8
+QWindowStateChangeEvent (0x0x7f1e7735c4e0) 0
+ vptr=((& QWindowStateChangeEvent::_ZTV23QWindowStateChangeEvent) + 16)
+ QEvent (0x0x7f1e773649c0) 0
+ primary-for QWindowStateChangeEvent (0x0x7f1e7735c4e0)
+
+Class QPointingDeviceUniqueId
+ size=8 align=8
+ base size=8 base align=8
+QPointingDeviceUniqueId (0x0x7f1e77364b40) 0
+
+Class QTouchEvent::TouchPoint
+ size=8 align=8
+ base size=8 base align=8
+QTouchEvent::TouchPoint (0x0x7f1e773c4f00) 0
+
+Vtable for QTouchEvent
+QTouchEvent::_ZTV11QTouchEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QTouchEvent)
+16 (int (*)(...))QTouchEvent::~QTouchEvent
+24 (int (*)(...))QTouchEvent::~QTouchEvent
+
+Class QTouchEvent
+ size=72 align=8
+ base size=72 base align=8
+QTouchEvent (0x0x7f1e773d2d00) 0
+ vptr=((& QTouchEvent::_ZTV11QTouchEvent) + 16)
+ QInputEvent (0x0x7f1e773d2d68) 0
+ primary-for QTouchEvent (0x0x7f1e773d2d00)
+ QEvent (0x0x7f1e773c4ea0) 0
+ primary-for QInputEvent (0x0x7f1e773d2d68)
+
+Vtable for QScrollPrepareEvent
+QScrollPrepareEvent::_ZTV19QScrollPrepareEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QScrollPrepareEvent)
+16 (int (*)(...))QScrollPrepareEvent::~QScrollPrepareEvent
+24 (int (*)(...))QScrollPrepareEvent::~QScrollPrepareEvent
+
+Class QScrollPrepareEvent
+ size=112 align=8
+ base size=112 base align=8
+QScrollPrepareEvent (0x0x7f1e770e6a28) 0
+ vptr=((& QScrollPrepareEvent::_ZTV19QScrollPrepareEvent) + 16)
+ QEvent (0x0x7f1e7710c4e0) 0
+ primary-for QScrollPrepareEvent (0x0x7f1e770e6a28)
+
+Vtable for QScrollEvent
+QScrollEvent::_ZTV12QScrollEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QScrollEvent)
+16 (int (*)(...))QScrollEvent::~QScrollEvent
+24 (int (*)(...))QScrollEvent::~QScrollEvent
+
+Class QScrollEvent
+ size=64 align=8
+ base size=60 base align=8
+QScrollEvent (0x0x7f1e770e6a90) 0
+ vptr=((& QScrollEvent::_ZTV12QScrollEvent) + 16)
+ QEvent (0x0x7f1e7710c540) 0
+ primary-for QScrollEvent (0x0x7f1e770e6a90)
+
+Vtable for QScreenOrientationChangeEvent
+QScreenOrientationChangeEvent::_ZTV29QScreenOrientationChangeEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI29QScreenOrientationChangeEvent)
+16 (int (*)(...))QScreenOrientationChangeEvent::~QScreenOrientationChangeEvent
+24 (int (*)(...))QScreenOrientationChangeEvent::~QScreenOrientationChangeEvent
+
+Class QScreenOrientationChangeEvent
+ size=40 align=8
+ base size=36 base align=8
+QScreenOrientationChangeEvent (0x0x7f1e770e6af8) 0
+ vptr=((& QScreenOrientationChangeEvent::_ZTV29QScreenOrientationChangeEvent) + 16)
+ QEvent (0x0x7f1e7710c5a0) 0
+ primary-for QScreenOrientationChangeEvent (0x0x7f1e770e6af8)
+
+Vtable for QApplicationStateChangeEvent
+QApplicationStateChangeEvent::_ZTV28QApplicationStateChangeEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI28QApplicationStateChangeEvent)
+16 (int (*)(...))QApplicationStateChangeEvent::~QApplicationStateChangeEvent
+24 (int (*)(...))QApplicationStateChangeEvent::~QApplicationStateChangeEvent
+
+Class QApplicationStateChangeEvent
+ size=24 align=8
+ base size=24 base align=8
+QApplicationStateChangeEvent (0x0x7f1e770e6b60) 0
+ vptr=((& QApplicationStateChangeEvent::_ZTV28QApplicationStateChangeEvent) + 16)
+ QEvent (0x0x7f1e7710c600) 0
+ primary-for QApplicationStateChangeEvent (0x0x7f1e770e6b60)
+
+Class QFont
+ size=16 align=8
+ base size=12 base align=8
+QFont (0x0x7f1e7710c660) 0
+
+Class QPolygon
+ size=8 align=8
+ base size=8 base align=8
+QPolygon (0x0x7f1e7726b000) 0
+ QVector<QPoint> (0x0x7f1e7722a6c0) 0
+
+Class QPolygonF
+ size=8 align=8
+ base size=8 base align=8
+QPolygonF (0x0x7f1e772cd340) 0
+ QVector<QPointF> (0x0x7f1e772ce7e0) 0
+
+Class QMatrix
+ size=48 align=8
+ base size=48 base align=8
+QMatrix (0x0x7f1e76eee6c0) 0
+
+Class QTransform
+ size=88 align=8
+ base size=88 base align=8
+QTransform (0x0x7f1e76f57480) 0
+
+Vtable for QPaintDevice
+QPaintDevice::_ZTV12QPaintDevice: 10 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QPaintDevice)
+16 0
+24 0
+32 (int (*)(...))QPaintDevice::devType
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))QPaintDevice::metric
+56 (int (*)(...))QPaintDevice::initPainter
+64 (int (*)(...))QPaintDevice::redirected
+72 (int (*)(...))QPaintDevice::sharedPainter
+
+Class QPaintDevice
+ size=24 align=8
+ base size=24 base align=8
+QPaintDevice (0x0x7f1e76fdbea0) 0
+ vptr=((& QPaintDevice::_ZTV12QPaintDevice) + 16)
+
+Class QPixelFormat
+ size=8 align=8
+ base size=8 base align=8
+QPixelFormat (0x0x7f1e770304e0) 0
+
+Vtable for QImage
+QImage::_ZTV6QImage: 10 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI6QImage)
+16 (int (*)(...))QImage::~QImage
+24 (int (*)(...))QImage::~QImage
+32 (int (*)(...))QImage::devType
+40 (int (*)(...))QImage::paintEngine
+48 (int (*)(...))QImage::metric
+56 (int (*)(...))QPaintDevice::initPainter
+64 (int (*)(...))QPaintDevice::redirected
+72 (int (*)(...))QPaintDevice::sharedPainter
+
+Class QImage
+ size=32 align=8
+ base size=32 base align=8
+QImage (0x0x7f1e76cc0d68) 0
+ vptr=((& QImage::_ZTV6QImage) + 16)
+ QPaintDevice (0x0x7f1e76ccade0) 0
+ primary-for QImage (0x0x7f1e76cc0d68)
+
+Vtable for QPixmap
+QPixmap::_ZTV7QPixmap: 10 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI7QPixmap)
+16 (int (*)(...))QPixmap::~QPixmap
+24 (int (*)(...))QPixmap::~QPixmap
+32 (int (*)(...))QPixmap::devType
+40 (int (*)(...))QPixmap::paintEngine
+48 (int (*)(...))QPixmap::metric
+56 (int (*)(...))QPaintDevice::initPainter
+64 (int (*)(...))QPaintDevice::redirected
+72 (int (*)(...))QPaintDevice::sharedPainter
+
+Class QPixmap
+ size=32 align=8
+ base size=32 base align=8
+QPixmap (0x0x7f1e76de47b8) 0
+ vptr=((& QPixmap::_ZTV7QPixmap) + 16)
+ QPaintDevice (0x0x7f1e76de3c00) 0
+ primary-for QPixmap (0x0x7f1e76de47b8)
+
+Class QBrush
+ size=8 align=8
+ base size=8 base align=8
+QBrush (0x0x7f1e76ab8f00) 0
+
+Class QBrushData
+ size=112 align=8
+ base size=112 base align=8
+QBrushData (0x0x7f1e76b99480) 0
+
+Class QGradient::QGradientData
+ size=40 align=8
+ base size=40 base align=8
+QGradient::QGradientData (0x0x7f1e76b99720) 0
+
+Class QGradient
+ size=64 align=8
+ base size=64 base align=8
+QGradient (0x0x7f1e76b996c0) 0
+
+Class QLinearGradient
+ size=64 align=8
+ base size=64 base align=8
+QLinearGradient (0x0x7f1e76b9d1a0) 0
+ QGradient (0x0x7f1e76b99de0) 0
+
+Class QRadialGradient
+ size=64 align=8
+ base size=64 base align=8
+QRadialGradient (0x0x7f1e76b9d208) 0
+ QGradient (0x0x7f1e76b99f00) 0
+
+Class QConicalGradient
+ size=64 align=8
+ base size=64 base align=8
+QConicalGradient (0x0x7f1e76b9d270) 0
+ QGradient (0x0x7f1e76c0c060) 0
+
+Class QPen
+ size=8 align=8
+ base size=8 base align=8
+QPen (0x0x7f1e76c0c120) 0
+
+Class QTextOption::Tab
+ size=16 align=8
+ base size=14 base align=8
+QTextOption::Tab (0x0x7f1e768c0a80) 0
+
+Class QTextOption
+ size=32 align=8
+ base size=32 base align=8
+QTextOption (0x0x7f1e768c0a20) 0
+
+Class QTextLength
+ size=16 align=8
+ base size=16 base align=8
+QTextLength (0x0x7f1e7692e1e0) 0
+
+Class QTextFormat
+ size=16 align=8
+ base size=12 base align=8
+QTextFormat (0x0x7f1e76982b40) 0
+
+Class QTextCharFormat
+ size=16 align=8
+ base size=12 base align=8
+QTextCharFormat (0x0x7f1e766def70) 0
+ QTextFormat (0x0x7f1e76719240) 0
+
+Class QTextBlockFormat
+ size=16 align=8
+ base size=12 base align=8
+QTextBlockFormat (0x0x7f1e7679d3a8) 0
+ QTextFormat (0x0x7f1e76794c00) 0
+
+Class QTextListFormat
+ size=16 align=8
+ base size=12 base align=8
+QTextListFormat (0x0x7f1e767f78f0) 0
+ QTextFormat (0x0x7f1e767f69c0) 0
+
+Class QTextImageFormat
+ size=16 align=8
+ base size=12 base align=8
+QTextImageFormat (0x0x7f1e76838d00) 0
+ QTextCharFormat (0x0x7f1e76838d68) 0
+ QTextFormat (0x0x7f1e76851180) 0
+
+Class QTextFrameFormat
+ size=16 align=8
+ base size=12 base align=8
+QTextFrameFormat (0x0x7f1e764962d8) 0
+ QTextFormat (0x0x7f1e764917e0) 0
+
+Class QTextTableFormat
+ size=16 align=8
+ base size=12 base align=8
+QTextTableFormat (0x0x7f1e764e8820) 0
+ QTextFrameFormat (0x0x7f1e764e8888) 0
+ QTextFormat (0x0x7f1e764f5420) 0
+
+Class QTextTableCellFormat
+ size=16 align=8
+ base size=12 base align=8
+QTextTableCellFormat (0x0x7f1e76537dd0) 0
+ QTextCharFormat (0x0x7f1e76537e38) 0
+ QTextFormat (0x0x7f1e76538d80) 0
+
+Class QFontDatabase
+ size=8 align=8
+ base size=8 base align=8
+QFontDatabase (0x0x7f1e765a9c00) 0
+
+Class QRawFont
+ size=8 align=8
+ base size=8 base align=8
+QRawFont (0x0x7f1e765a9de0) 0
+
+Class QGlyphRun
+ size=8 align=8
+ base size=8 base align=8
+QGlyphRun (0x0x7f1e762c9600) 0
+
+Class QTextCursor
+ size=8 align=8
+ base size=8 base align=8
+QTextCursor (0x0x7f1e7639c540) 0
+
+Class QTextInlineObject
+ size=16 align=8
+ base size=16 base align=8
+QTextInlineObject (0x0x7f1e7607b1e0) 0
+
+Class QTextLayout::FormatRange
+ size=24 align=8
+ base size=24 base align=8
+QTextLayout::FormatRange (0x0x7f1e7607b600) 0
+
+Class QTextLayout
+ size=8 align=8
+ base size=8 base align=8
+QTextLayout (0x0x7f1e7607b5a0) 0
+
+Class QTextLine
+ size=16 align=8
+ base size=16 base align=8
+QTextLine (0x0x7f1e7610ecc0) 0
+
+Vtable for QAbstractUndoItem
+QAbstractUndoItem::_ZTV17QAbstractUndoItem: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QAbstractUndoItem)
+16 (int (*)(...))__cxa_pure_virtual
+24 (int (*)(...))__cxa_pure_virtual
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+
+Class QAbstractUndoItem
+ size=8 align=8
+ base size=8 base align=8
+QAbstractUndoItem (0x0x7f1e76139180) 0 nearly-empty
+ vptr=((& QAbstractUndoItem::_ZTV17QAbstractUndoItem) + 16)
+
+Class QTextDocument::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTextDocument::QPrivateSignal (0x0x7f1e76139420) 0 empty
+
+Vtable for QTextDocument
+QTextDocument::_ZTV13QTextDocument: 17 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QTextDocument)
+16 (int (*)(...))QTextDocument::metaObject
+24 (int (*)(...))QTextDocument::qt_metacast
+32 (int (*)(...))QTextDocument::qt_metacall
+40 (int (*)(...))QTextDocument::~QTextDocument
+48 (int (*)(...))QTextDocument::~QTextDocument
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QTextDocument::clear
+120 (int (*)(...))QTextDocument::createObject
+128 (int (*)(...))QTextDocument::loadResource
+
+Class QTextDocument
+ size=16 align=8
+ base size=16 base align=8
+QTextDocument (0x0x7f1e76123618) 0
+ vptr=((& QTextDocument::_ZTV13QTextDocument) + 16)
+ QObject (0x0x7f1e761393c0) 0
+ primary-for QTextDocument (0x0x7f1e76123618)
+
+Class QPalette::Data
+ size=4 align=4
+ base size=4 base align=4
+QPalette::Data (0x0x7f1e761a8420) 0
+
+Class QPalette
+ size=16 align=8
+ base size=12 base align=8
+QPalette (0x0x7f1e761a83c0) 0
+
+Class QAbstractTextDocumentLayout::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAbstractTextDocumentLayout::QPrivateSignal (0x0x7f1e75e907e0) 0 empty
+
+Class QAbstractTextDocumentLayout::Selection
+ size=24 align=8
+ base size=24 base align=8
+QAbstractTextDocumentLayout::Selection (0x0x7f1e75e90840) 0
+
+Class QAbstractTextDocumentLayout::PaintContext
+ size=64 align=8
+ base size=64 base align=8
+QAbstractTextDocumentLayout::PaintContext (0x0x7f1e75e908a0) 0
+
+Vtable for QAbstractTextDocumentLayout
+QAbstractTextDocumentLayout::_ZTV27QAbstractTextDocumentLayout: 24 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI27QAbstractTextDocumentLayout)
+16 (int (*)(...))QAbstractTextDocumentLayout::metaObject
+24 (int (*)(...))QAbstractTextDocumentLayout::qt_metacast
+32 (int (*)(...))QAbstractTextDocumentLayout::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))__cxa_pure_virtual
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))__cxa_pure_virtual
+160 (int (*)(...))__cxa_pure_virtual
+168 (int (*)(...))QAbstractTextDocumentLayout::resizeInlineObject
+176 (int (*)(...))QAbstractTextDocumentLayout::positionInlineObject
+184 (int (*)(...))QAbstractTextDocumentLayout::drawInlineObject
+
+Class QAbstractTextDocumentLayout
+ size=16 align=8
+ base size=16 base align=8
+QAbstractTextDocumentLayout (0x0x7f1e75e94410) 0
+ vptr=((& QAbstractTextDocumentLayout::_ZTV27QAbstractTextDocumentLayout) + 16)
+ QObject (0x0x7f1e75e90780) 0
+ primary-for QAbstractTextDocumentLayout (0x0x7f1e75e94410)
+
+Vtable for QTextObjectInterface
+QTextObjectInterface::_ZTV20QTextObjectInterface: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QTextObjectInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+
+Class QTextObjectInterface
+ size=8 align=8
+ base size=8 base align=8
+QTextObjectInterface (0x0x7f1e75f60480) 0 nearly-empty
+ vptr=((& QTextObjectInterface::_ZTV20QTextObjectInterface) + 16)
+
+Class QAccessible::State
+ size=8 align=8
+ base size=5 base align=8
+QAccessible::State (0x0x7f1e75f606c0) 0
+
+Vtable for QAccessible::ActivationObserver
+QAccessible::ActivationObserver::_ZTVN11QAccessible18ActivationObserverE: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTIN11QAccessible18ActivationObserverE)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+
+Class QAccessible::ActivationObserver
+ size=8 align=8
+ base size=8 base align=8
+QAccessible::ActivationObserver (0x0x7f1e75f60720) 0 nearly-empty
+ vptr=((& QAccessible::ActivationObserver::_ZTVN11QAccessible18ActivationObserverE) + 16)
+
+Class QAccessible
+ size=1 align=1
+ base size=0 base align=1
+QAccessible (0x0x7f1e75f60660) 0 empty
+
+Vtable for QAccessibleInterface
+QAccessibleInterface::_ZTV20QAccessibleInterface: 23 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QAccessibleInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))QAccessibleInterface::window
+56 (int (*)(...))QAccessibleInterface::relations
+64 (int (*)(...))QAccessibleInterface::focusChild
+72 (int (*)(...))__cxa_pure_virtual
+80 (int (*)(...))__cxa_pure_virtual
+88 (int (*)(...))__cxa_pure_virtual
+96 (int (*)(...))__cxa_pure_virtual
+104 (int (*)(...))__cxa_pure_virtual
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))__cxa_pure_virtual
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))QAccessibleInterface::foregroundColor
+160 (int (*)(...))QAccessibleInterface::backgroundColor
+168 (int (*)(...))QAccessibleInterface::virtual_hook
+176 (int (*)(...))QAccessibleInterface::interface_cast
+
+Class QAccessibleInterface
+ size=8 align=8
+ base size=8 base align=8
+QAccessibleInterface (0x0x7f1e75fb5300) 0 nearly-empty
+ vptr=((& QAccessibleInterface::_ZTV20QAccessibleInterface) + 16)
+
+Vtable for QAccessibleTextInterface
+QAccessibleTextInterface::_ZTV24QAccessibleTextInterface: 20 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI24QAccessibleTextInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))__cxa_pure_virtual
+72 (int (*)(...))__cxa_pure_virtual
+80 (int (*)(...))__cxa_pure_virtual
+88 (int (*)(...))__cxa_pure_virtual
+96 (int (*)(...))QAccessibleTextInterface::textBeforeOffset
+104 (int (*)(...))QAccessibleTextInterface::textAfterOffset
+112 (int (*)(...))QAccessibleTextInterface::textAtOffset
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))__cxa_pure_virtual
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))__cxa_pure_virtual
+
+Class QAccessibleTextInterface
+ size=8 align=8
+ base size=8 base align=8
+QAccessibleTextInterface (0x0x7f1e75fb5660) 0 nearly-empty
+ vptr=((& QAccessibleTextInterface::_ZTV24QAccessibleTextInterface) + 16)
+
+Vtable for QAccessibleEditableTextInterface
+QAccessibleEditableTextInterface::_ZTV32QAccessibleEditableTextInterface: 7 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI32QAccessibleEditableTextInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+
+Class QAccessibleEditableTextInterface
+ size=8 align=8
+ base size=8 base align=8
+QAccessibleEditableTextInterface (0x0x7f1e75fb56c0) 0 nearly-empty
+ vptr=((& QAccessibleEditableTextInterface::_ZTV32QAccessibleEditableTextInterface) + 16)
+
+Vtable for QAccessibleValueInterface
+QAccessibleValueInterface::_ZTV25QAccessibleValueInterface: 9 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI25QAccessibleValueInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))__cxa_pure_virtual
+
+Class QAccessibleValueInterface
+ size=8 align=8
+ base size=8 base align=8
+QAccessibleValueInterface (0x0x7f1e75fb5720) 0 nearly-empty
+ vptr=((& QAccessibleValueInterface::_ZTV25QAccessibleValueInterface) + 16)
+
+Vtable for QAccessibleTableCellInterface
+QAccessibleTableCellInterface::_ZTV29QAccessibleTableCellInterface: 12 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI29QAccessibleTableCellInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))__cxa_pure_virtual
+72 (int (*)(...))__cxa_pure_virtual
+80 (int (*)(...))__cxa_pure_virtual
+88 (int (*)(...))__cxa_pure_virtual
+
+Class QAccessibleTableCellInterface
+ size=8 align=8
+ base size=8 base align=8
+QAccessibleTableCellInterface (0x0x7f1e75fb5780) 0 nearly-empty
+ vptr=((& QAccessibleTableCellInterface::_ZTV29QAccessibleTableCellInterface) + 16)
+
+Vtable for QAccessibleTableInterface
+QAccessibleTableInterface::_ZTV25QAccessibleTableInterface: 24 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI25QAccessibleTableInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))__cxa_pure_virtual
+72 (int (*)(...))__cxa_pure_virtual
+80 (int (*)(...))__cxa_pure_virtual
+88 (int (*)(...))__cxa_pure_virtual
+96 (int (*)(...))__cxa_pure_virtual
+104 (int (*)(...))__cxa_pure_virtual
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))__cxa_pure_virtual
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))__cxa_pure_virtual
+160 (int (*)(...))__cxa_pure_virtual
+168 (int (*)(...))__cxa_pure_virtual
+176 (int (*)(...))__cxa_pure_virtual
+184 (int (*)(...))__cxa_pure_virtual
+
+Class QAccessibleTableInterface
+ size=8 align=8
+ base size=8 base align=8
+QAccessibleTableInterface (0x0x7f1e75fb57e0) 0 nearly-empty
+ vptr=((& QAccessibleTableInterface::_ZTV25QAccessibleTableInterface) + 16)
+
+Vtable for QAccessibleActionInterface
+QAccessibleActionInterface::_ZTV26QAccessibleActionInterface: 9 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI26QAccessibleActionInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))QAccessibleActionInterface::localizedActionName
+48 (int (*)(...))QAccessibleActionInterface::localizedActionDescription
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))__cxa_pure_virtual
+
+Class QAccessibleActionInterface
+ size=8 align=8
+ base size=8 base align=8
+QAccessibleActionInterface (0x0x7f1e75fb5840) 0 nearly-empty
+ vptr=((& QAccessibleActionInterface::_ZTV26QAccessibleActionInterface) + 16)
+
+Vtable for QAccessibleImageInterface
+QAccessibleImageInterface::_ZTV25QAccessibleImageInterface: 7 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI25QAccessibleImageInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+
+Class QAccessibleImageInterface
+ size=8 align=8
+ base size=8 base align=8
+QAccessibleImageInterface (0x0x7f1e75fb5960) 0 nearly-empty
+ vptr=((& QAccessibleImageInterface::_ZTV25QAccessibleImageInterface) + 16)
+
+Vtable for QAccessibleEvent
+QAccessibleEvent::_ZTV16QAccessibleEvent: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QAccessibleEvent)
+16 (int (*)(...))QAccessibleEvent::~QAccessibleEvent
+24 (int (*)(...))QAccessibleEvent::~QAccessibleEvent
+32 (int (*)(...))QAccessibleEvent::accessibleInterface
+
+Class QAccessibleEvent
+ size=32 align=8
+ base size=28 base align=8
+QAccessibleEvent (0x0x7f1e75fb59c0) 0
+ vptr=((& QAccessibleEvent::_ZTV16QAccessibleEvent) + 16)
+
+Vtable for QAccessibleStateChangeEvent
+QAccessibleStateChangeEvent::_ZTV27QAccessibleStateChangeEvent: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI27QAccessibleStateChangeEvent)
+16 (int (*)(...))QAccessibleStateChangeEvent::~QAccessibleStateChangeEvent
+24 (int (*)(...))QAccessibleStateChangeEvent::~QAccessibleStateChangeEvent
+32 (int (*)(...))QAccessibleEvent::accessibleInterface
+
+Class QAccessibleStateChangeEvent
+ size=40 align=8
+ base size=40 base align=8
+QAccessibleStateChangeEvent (0x0x7f1e75f61a28) 0
+ vptr=((& QAccessibleStateChangeEvent::_ZTV27QAccessibleStateChangeEvent) + 16)
+ QAccessibleEvent (0x0x7f1e760213c0) 0
+ primary-for QAccessibleStateChangeEvent (0x0x7f1e75f61a28)
+
+Vtable for QAccessibleTextCursorEvent
+QAccessibleTextCursorEvent::_ZTV26QAccessibleTextCursorEvent: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI26QAccessibleTextCursorEvent)
+16 (int (*)(...))QAccessibleTextCursorEvent::~QAccessibleTextCursorEvent
+24 (int (*)(...))QAccessibleTextCursorEvent::~QAccessibleTextCursorEvent
+32 (int (*)(...))QAccessibleEvent::accessibleInterface
+
+Class QAccessibleTextCursorEvent
+ size=32 align=8
+ base size=32 base align=8
+QAccessibleTextCursorEvent (0x0x7f1e75f61a90) 0
+ vptr=((& QAccessibleTextCursorEvent::_ZTV26QAccessibleTextCursorEvent) + 16)
+ QAccessibleEvent (0x0x7f1e76021780) 0
+ primary-for QAccessibleTextCursorEvent (0x0x7f1e75f61a90)
+
+Vtable for QAccessibleTextSelectionEvent
+QAccessibleTextSelectionEvent::_ZTV29QAccessibleTextSelectionEvent: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI29QAccessibleTextSelectionEvent)
+16 (int (*)(...))QAccessibleTextSelectionEvent::~QAccessibleTextSelectionEvent
+24 (int (*)(...))QAccessibleTextSelectionEvent::~QAccessibleTextSelectionEvent
+32 (int (*)(...))QAccessibleEvent::accessibleInterface
+
+Class QAccessibleTextSelectionEvent
+ size=40 align=8
+ base size=40 base align=8
+QAccessibleTextSelectionEvent (0x0x7f1e75f61af8) 0
+ vptr=((& QAccessibleTextSelectionEvent::_ZTV29QAccessibleTextSelectionEvent) + 16)
+ QAccessibleTextCursorEvent (0x0x7f1e75f61b60) 0
+ primary-for QAccessibleTextSelectionEvent (0x0x7f1e75f61af8)
+ QAccessibleEvent (0x0x7f1e76021ba0) 0
+ primary-for QAccessibleTextCursorEvent (0x0x7f1e75f61b60)
+
+Vtable for QAccessibleTextInsertEvent
+QAccessibleTextInsertEvent::_ZTV26QAccessibleTextInsertEvent: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI26QAccessibleTextInsertEvent)
+16 (int (*)(...))QAccessibleTextInsertEvent::~QAccessibleTextInsertEvent
+24 (int (*)(...))QAccessibleTextInsertEvent::~QAccessibleTextInsertEvent
+32 (int (*)(...))QAccessibleEvent::accessibleInterface
+
+Class QAccessibleTextInsertEvent
+ size=48 align=8
+ base size=48 base align=8
+QAccessibleTextInsertEvent (0x0x7f1e75f61bc8) 0
+ vptr=((& QAccessibleTextInsertEvent::_ZTV26QAccessibleTextInsertEvent) + 16)
+ QAccessibleTextCursorEvent (0x0x7f1e75f61c30) 0
+ primary-for QAccessibleTextInsertEvent (0x0x7f1e75f61bc8)
+ QAccessibleEvent (0x0x7f1e75c70060) 0
+ primary-for QAccessibleTextCursorEvent (0x0x7f1e75f61c30)
+
+Vtable for QAccessibleTextRemoveEvent
+QAccessibleTextRemoveEvent::_ZTV26QAccessibleTextRemoveEvent: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI26QAccessibleTextRemoveEvent)
+16 (int (*)(...))QAccessibleTextRemoveEvent::~QAccessibleTextRemoveEvent
+24 (int (*)(...))QAccessibleTextRemoveEvent::~QAccessibleTextRemoveEvent
+32 (int (*)(...))QAccessibleEvent::accessibleInterface
+
+Class QAccessibleTextRemoveEvent
+ size=48 align=8
+ base size=48 base align=8
+QAccessibleTextRemoveEvent (0x0x7f1e75f61c98) 0
+ vptr=((& QAccessibleTextRemoveEvent::_ZTV26QAccessibleTextRemoveEvent) + 16)
+ QAccessibleTextCursorEvent (0x0x7f1e75f61d00) 0
+ primary-for QAccessibleTextRemoveEvent (0x0x7f1e75f61c98)
+ QAccessibleEvent (0x0x7f1e75c70480) 0
+ primary-for QAccessibleTextCursorEvent (0x0x7f1e75f61d00)
+
+Vtable for QAccessibleTextUpdateEvent
+QAccessibleTextUpdateEvent::_ZTV26QAccessibleTextUpdateEvent: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI26QAccessibleTextUpdateEvent)
+16 (int (*)(...))QAccessibleTextUpdateEvent::~QAccessibleTextUpdateEvent
+24 (int (*)(...))QAccessibleTextUpdateEvent::~QAccessibleTextUpdateEvent
+32 (int (*)(...))QAccessibleEvent::accessibleInterface
+
+Class QAccessibleTextUpdateEvent
+ size=56 align=8
+ base size=56 base align=8
+QAccessibleTextUpdateEvent (0x0x7f1e75f61d68) 0
+ vptr=((& QAccessibleTextUpdateEvent::_ZTV26QAccessibleTextUpdateEvent) + 16)
+ QAccessibleTextCursorEvent (0x0x7f1e75f61dd0) 0
+ primary-for QAccessibleTextUpdateEvent (0x0x7f1e75f61d68)
+ QAccessibleEvent (0x0x7f1e75c708a0) 0
+ primary-for QAccessibleTextCursorEvent (0x0x7f1e75f61dd0)
+
+Vtable for QAccessibleValueChangeEvent
+QAccessibleValueChangeEvent::_ZTV27QAccessibleValueChangeEvent: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI27QAccessibleValueChangeEvent)
+16 (int (*)(...))QAccessibleValueChangeEvent::~QAccessibleValueChangeEvent
+24 (int (*)(...))QAccessibleValueChangeEvent::~QAccessibleValueChangeEvent
+32 (int (*)(...))QAccessibleEvent::accessibleInterface
+
+Class QAccessibleValueChangeEvent
+ size=48 align=8
+ base size=48 base align=8
+QAccessibleValueChangeEvent (0x0x7f1e75f61e38) 0
+ vptr=((& QAccessibleValueChangeEvent::_ZTV27QAccessibleValueChangeEvent) + 16)
+ QAccessibleEvent (0x0x7f1e75c70d20) 0
+ primary-for QAccessibleValueChangeEvent (0x0x7f1e75f61e38)
+
+Vtable for QAccessibleTableModelChangeEvent
+QAccessibleTableModelChangeEvent::_ZTV32QAccessibleTableModelChangeEvent: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI32QAccessibleTableModelChangeEvent)
+16 (int (*)(...))QAccessibleTableModelChangeEvent::~QAccessibleTableModelChangeEvent
+24 (int (*)(...))QAccessibleTableModelChangeEvent::~QAccessibleTableModelChangeEvent
+32 (int (*)(...))QAccessibleEvent::accessibleInterface
+
+Class QAccessibleTableModelChangeEvent
+ size=48 align=8
+ base size=48 base align=8
+QAccessibleTableModelChangeEvent (0x0x7f1e75f61ea0) 0
+ vptr=((& QAccessibleTableModelChangeEvent::_ZTV32QAccessibleTableModelChangeEvent) + 16)
+ QAccessibleEvent (0x0x7f1e75ca7180) 0
+ primary-for QAccessibleTableModelChangeEvent (0x0x7f1e75f61ea0)
+
+Vtable for QAccessibleBridge
+QAccessibleBridge::_ZTV17QAccessibleBridge: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QAccessibleBridge)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+
+Class QAccessibleBridge
+ size=8 align=8
+ base size=8 base align=8
+QAccessibleBridge (0x0x7f1e75ca7a20) 0 nearly-empty
+ vptr=((& QAccessibleBridge::_ZTV17QAccessibleBridge) + 16)
+
+Class QAccessibleBridgePlugin::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAccessibleBridgePlugin::QPrivateSignal (0x0x7f1e75ca7cc0) 0 empty
+
+Vtable for QAccessibleBridgePlugin
+QAccessibleBridgePlugin::_ZTV23QAccessibleBridgePlugin: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI23QAccessibleBridgePlugin)
+16 (int (*)(...))QAccessibleBridgePlugin::metaObject
+24 (int (*)(...))QAccessibleBridgePlugin::qt_metacast
+32 (int (*)(...))QAccessibleBridgePlugin::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+
+Class QAccessibleBridgePlugin
+ size=16 align=8
+ base size=16 base align=8
+QAccessibleBridgePlugin (0x0x7f1e75f61f08) 0
+ vptr=((& QAccessibleBridgePlugin::_ZTV23QAccessibleBridgePlugin) + 16)
+ QObject (0x0x7f1e75ca7c60) 0
+ primary-for QAccessibleBridgePlugin (0x0x7f1e75f61f08)
+
+Vtable for QAccessibleObject
+QAccessibleObject::_ZTV17QAccessibleObject: 23 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QAccessibleObject)
+16 0
+24 0
+32 (int (*)(...))QAccessibleObject::isValid
+40 (int (*)(...))QAccessibleObject::object
+48 (int (*)(...))QAccessibleInterface::window
+56 (int (*)(...))QAccessibleInterface::relations
+64 (int (*)(...))QAccessibleInterface::focusChild
+72 (int (*)(...))QAccessibleObject::childAt
+80 (int (*)(...))__cxa_pure_virtual
+88 (int (*)(...))__cxa_pure_virtual
+96 (int (*)(...))__cxa_pure_virtual
+104 (int (*)(...))__cxa_pure_virtual
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))QAccessibleObject::setText
+128 (int (*)(...))QAccessibleObject::rect
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))QAccessibleInterface::foregroundColor
+160 (int (*)(...))QAccessibleInterface::backgroundColor
+168 (int (*)(...))QAccessibleInterface::virtual_hook
+176 (int (*)(...))QAccessibleInterface::interface_cast
+
+Class QAccessibleObject
+ size=16 align=8
+ base size=16 base align=8
+QAccessibleObject (0x0x7f1e75f61f70) 0
+ vptr=((& QAccessibleObject::_ZTV17QAccessibleObject) + 16)
+ QAccessibleInterface (0x0x7f1e75ca7de0) 0 nearly-empty
+ primary-for QAccessibleObject (0x0x7f1e75f61f70)
+
+Vtable for QAccessibleApplication
+QAccessibleApplication::_ZTV22QAccessibleApplication: 23 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI22QAccessibleApplication)
+16 (int (*)(...))QAccessibleApplication::~QAccessibleApplication
+24 (int (*)(...))QAccessibleApplication::~QAccessibleApplication
+32 (int (*)(...))QAccessibleObject::isValid
+40 (int (*)(...))QAccessibleObject::object
+48 (int (*)(...))QAccessibleApplication::window
+56 (int (*)(...))QAccessibleInterface::relations
+64 (int (*)(...))QAccessibleApplication::focusChild
+72 (int (*)(...))QAccessibleObject::childAt
+80 (int (*)(...))QAccessibleApplication::parent
+88 (int (*)(...))QAccessibleApplication::child
+96 (int (*)(...))QAccessibleApplication::childCount
+104 (int (*)(...))QAccessibleApplication::indexOfChild
+112 (int (*)(...))QAccessibleApplication::text
+120 (int (*)(...))QAccessibleObject::setText
+128 (int (*)(...))QAccessibleObject::rect
+136 (int (*)(...))QAccessibleApplication::role
+144 (int (*)(...))QAccessibleApplication::state
+152 (int (*)(...))QAccessibleInterface::foregroundColor
+160 (int (*)(...))QAccessibleInterface::backgroundColor
+168 (int (*)(...))QAccessibleInterface::virtual_hook
+176 (int (*)(...))QAccessibleInterface::interface_cast
+
+Class QAccessibleApplication
+ size=16 align=8
+ base size=16 base align=8
+QAccessibleApplication (0x0x7f1e75cd7000) 0
+ vptr=((& QAccessibleApplication::_ZTV22QAccessibleApplication) + 16)
+ QAccessibleObject (0x0x7f1e75cd7068) 0
+ primary-for QAccessibleApplication (0x0x7f1e75cd7000)
+ QAccessibleInterface (0x0x7f1e75ca7e40) 0 nearly-empty
+ primary-for QAccessibleObject (0x0x7f1e75cd7068)
+
+Class QAccessiblePlugin::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAccessiblePlugin::QPrivateSignal (0x0x7f1e75ca7f00) 0 empty
+
+Vtable for QAccessiblePlugin
+QAccessiblePlugin::_ZTV17QAccessiblePlugin: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QAccessiblePlugin)
+16 (int (*)(...))QAccessiblePlugin::metaObject
+24 (int (*)(...))QAccessiblePlugin::qt_metacast
+32 (int (*)(...))QAccessiblePlugin::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+
+Class QAccessiblePlugin
+ size=16 align=8
+ base size=16 base align=8
+QAccessiblePlugin (0x0x7f1e75cd70d0) 0
+ vptr=((& QAccessiblePlugin::_ZTV17QAccessiblePlugin) + 16)
+ QObject (0x0x7f1e75ca7ea0) 0
+ primary-for QAccessiblePlugin (0x0x7f1e75cd70d0)
+
+Class QSurfaceFormat
+ size=8 align=8
+ base size=8 base align=8
+QSurfaceFormat (0x0x7f1e75ce4060) 0
+
+Vtable for QSurface
+QSurface::_ZTV8QSurface: 8 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI8QSurface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))__cxa_pure_virtual
+
+Class QSurface
+ size=24 align=8
+ base size=24 base align=8
+QSurface (0x0x7f1e75ce4ba0) 0
+ vptr=((& QSurface::_ZTV8QSurface) + 16)
+
+Class QIcon
+ size=8 align=8
+ base size=8 base align=8
+QIcon (0x0x7f1e75ce4f60) 0
+
+Class QCursor
+ size=8 align=8
+ base size=8 base align=8
+QCursor (0x0x7f1e75dfaae0) 0
+
+Class QWindow::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QWindow::QPrivateSignal (0x0x7f1e75ac48a0) 0 empty
+
+Vtable for QWindow
+QWindow::_ZTV7QWindow: 45 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI7QWindow)
+16 (int (*)(...))QWindow::metaObject
+24 (int (*)(...))QWindow::qt_metacast
+32 (int (*)(...))QWindow::qt_metacall
+40 (int (*)(...))QWindow::~QWindow
+48 (int (*)(...))QWindow::~QWindow
+56 (int (*)(...))QWindow::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWindow::surfaceType
+120 (int (*)(...))QWindow::format
+128 (int (*)(...))QWindow::size
+136 (int (*)(...))QWindow::accessibleRoot
+144 (int (*)(...))QWindow::focusObject
+152 (int (*)(...))QWindow::exposeEvent
+160 (int (*)(...))QWindow::resizeEvent
+168 (int (*)(...))QWindow::moveEvent
+176 (int (*)(...))QWindow::focusInEvent
+184 (int (*)(...))QWindow::focusOutEvent
+192 (int (*)(...))QWindow::showEvent
+200 (int (*)(...))QWindow::hideEvent
+208 (int (*)(...))QWindow::keyPressEvent
+216 (int (*)(...))QWindow::keyReleaseEvent
+224 (int (*)(...))QWindow::mousePressEvent
+232 (int (*)(...))QWindow::mouseReleaseEvent
+240 (int (*)(...))QWindow::mouseDoubleClickEvent
+248 (int (*)(...))QWindow::mouseMoveEvent
+256 (int (*)(...))QWindow::wheelEvent
+264 (int (*)(...))QWindow::touchEvent
+272 (int (*)(...))QWindow::tabletEvent
+280 (int (*)(...))QWindow::nativeEvent
+288 (int (*)(...))QWindow::surfaceHandle
+296 (int (*)(...))-16
+304 (int (*)(...))(& _ZTI7QWindow)
+312 (int (*)(...))QWindow::_ZThn16_N7QWindowD1Ev
+320 (int (*)(...))QWindow::_ZThn16_N7QWindowD0Ev
+328 (int (*)(...))QWindow::_ZThn16_NK7QWindow6formatEv
+336 (int (*)(...))QWindow::_ZThn16_NK7QWindow13surfaceHandleEv
+344 (int (*)(...))QWindow::_ZThn16_NK7QWindow11surfaceTypeEv
+352 (int (*)(...))QWindow::_ZThn16_NK7QWindow4sizeEv
+
+Class QWindow
+ size=40 align=8
+ base size=40 base align=8
+QWindow (0x0x7f1e75ace310) 0
+ vptr=((& QWindow::_ZTV7QWindow) + 16)
+ QObject (0x0x7f1e75ac47e0) 0
+ primary-for QWindow (0x0x7f1e75ace310)
+ QSurface (0x0x7f1e75ac4840) 16
+ vptr=((& QWindow::_ZTV7QWindow) + 312)
+
+Class QBackingStore
+ size=8 align=8
+ base size=8 base align=8
+QBackingStore (0x0x7f1e75b17180) 0
+
+Vtable for QBitmap
+QBitmap::_ZTV7QBitmap: 10 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI7QBitmap)
+16 (int (*)(...))QBitmap::~QBitmap
+24 (int (*)(...))QBitmap::~QBitmap
+32 (int (*)(...))QPixmap::devType
+40 (int (*)(...))QPixmap::paintEngine
+48 (int (*)(...))QPixmap::metric
+56 (int (*)(...))QPaintDevice::initPainter
+64 (int (*)(...))QPaintDevice::redirected
+72 (int (*)(...))QPaintDevice::sharedPainter
+
+Class QBitmap
+ size=32 align=8
+ base size=32 base align=8
+QBitmap (0x0x7f1e75ad13a8) 0
+ vptr=((& QBitmap::_ZTV7QBitmap) + 16)
+ QPixmap (0x0x7f1e75ad1410) 0
+ primary-for QBitmap (0x0x7f1e75ad13a8)
+ QPaintDevice (0x0x7f1e75b17240) 0
+ primary-for QPixmap (0x0x7f1e75ad1410)
+
+Class QClipboard::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QClipboard::QPrivateSignal (0x0x7f1e75b6c780) 0 empty
+
+Vtable for QClipboard
+QClipboard::_ZTV10QClipboard: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QClipboard)
+16 (int (*)(...))QClipboard::metaObject
+24 (int (*)(...))QClipboard::qt_metacast
+32 (int (*)(...))QClipboard::qt_metacall
+40 (int (*)(...))QClipboard::~QClipboard
+48 (int (*)(...))QClipboard::~QClipboard
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QClipboard
+ size=16 align=8
+ base size=16 base align=8
+QClipboard (0x0x7f1e75b6a6e8) 0
+ vptr=((& QClipboard::_ZTV10QClipboard) + 16)
+ QObject (0x0x7f1e75b6c720) 0
+ primary-for QClipboard (0x0x7f1e75b6a6e8)
+
+Class QColorTransform
+ size=8 align=8
+ base size=8 base align=8
+QColorTransform (0x0x7f1e75b6c8a0) 0
+
+Class QColorSpace
+ size=8 align=8
+ base size=8 base align=8
+QColorSpace (0x0x7f1e75c3aa20) 0
+
+Class QDesktopServices
+ size=1 align=1
+ base size=0 base align=1
+QDesktopServices (0x0x7f1e759157e0) 0 empty
+
+Class QDrag::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QDrag::QPrivateSignal (0x0x7f1e759158a0) 0 empty
+
+Vtable for QDrag
+QDrag::_ZTV5QDrag: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI5QDrag)
+16 (int (*)(...))QDrag::metaObject
+24 (int (*)(...))QDrag::qt_metacast
+32 (int (*)(...))QDrag::qt_metacall
+40 (int (*)(...))QDrag::~QDrag
+48 (int (*)(...))QDrag::~QDrag
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QDrag
+ size=16 align=8
+ base size=16 base align=8
+QDrag (0x0x7f1e759183a8) 0
+ vptr=((& QDrag::_ZTV5QDrag) + 16)
+ QObject (0x0x7f1e75915840) 0
+ primary-for QDrag (0x0x7f1e759183a8)
+
+Class QFontInfo
+ size=8 align=8
+ base size=8 base align=8
+QFontInfo (0x0x7f1e75915a80) 0
+
+Class QFontMetrics
+ size=8 align=8
+ base size=8 base align=8
+QFontMetrics (0x0x7f1e75967ae0) 0
+
+Class QFontMetricsF
+ size=8 align=8
+ base size=8 base align=8
+QFontMetricsF (0x0x7f1e759b5e40) 0
+
+Class QGenericPlugin::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QGenericPlugin::QPrivateSignal (0x0x7f1e75752000) 0 empty
+
+Vtable for QGenericPlugin
+QGenericPlugin::_ZTV14QGenericPlugin: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QGenericPlugin)
+16 (int (*)(...))QGenericPlugin::metaObject
+24 (int (*)(...))QGenericPlugin::qt_metacast
+32 (int (*)(...))QGenericPlugin::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+
+Class QGenericPlugin
+ size=16 align=8
+ base size=16 base align=8
+QGenericPlugin (0x0x7f1e75a08f70) 0
+ vptr=((& QGenericPlugin::_ZTV14QGenericPlugin) + 16)
+ QObject (0x0x7f1e756a9f60) 0
+ primary-for QGenericPlugin (0x0x7f1e75a08f70)
+
+Class QGenericPluginFactory
+ size=1 align=1
+ base size=0 base align=1
+QGenericPluginFactory (0x0x7f1e75752120) 0 empty
+
+Class QInputMethod::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QInputMethod::QPrivateSignal (0x0x7f1e757521e0) 0 empty
+
+Vtable for QInputMethod
+QInputMethod::_ZTV12QInputMethod: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QInputMethod)
+16 (int (*)(...))QInputMethod::metaObject
+24 (int (*)(...))QInputMethod::qt_metacast
+32 (int (*)(...))QInputMethod::qt_metacall
+40 (int (*)(...))QInputMethod::~QInputMethod
+48 (int (*)(...))QInputMethod::~QInputMethod
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QInputMethod
+ size=16 align=8
+ base size=16 base align=8
+QInputMethod (0x0x7f1e75759000) 0
+ vptr=((& QInputMethod::_ZTV12QInputMethod) + 16)
+ QObject (0x0x7f1e75752180) 0
+ primary-for QInputMethod (0x0x7f1e75759000)
+
+Class QGuiApplication::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QGuiApplication::QPrivateSignal (0x0x7f1e757524e0) 0 empty
+
+Vtable for QGuiApplication
+QGuiApplication::_ZTV15QGuiApplication: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QGuiApplication)
+16 (int (*)(...))QGuiApplication::metaObject
+24 (int (*)(...))QGuiApplication::qt_metacast
+32 (int (*)(...))QGuiApplication::qt_metacall
+40 (int (*)(...))QGuiApplication::~QGuiApplication
+48 (int (*)(...))QGuiApplication::~QGuiApplication
+56 (int (*)(...))QGuiApplication::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QGuiApplication::notify
+120 (int (*)(...))QGuiApplication::compressEvent
+
+Class QGuiApplication
+ size=16 align=8
+ base size=16 base align=8
+QGuiApplication (0x0x7f1e75759068) 0
+ vptr=((& QGuiApplication::_ZTV15QGuiApplication) + 16)
+ QCoreApplication (0x0x7f1e757590d0) 0
+ primary-for QGuiApplication (0x0x7f1e75759068)
+ QObject (0x0x7f1e75752480) 0
+ primary-for QCoreApplication (0x0x7f1e757590d0)
+
+Class QIconEngine::AvailableSizesArgument
+ size=16 align=8
+ base size=16 base align=8
+QIconEngine::AvailableSizesArgument (0x0x7f1e75752c60) 0
+
+Class QIconEngine::ScaledPixmapArgument
+ size=56 align=8
+ base size=56 base align=8
+QIconEngine::ScaledPixmapArgument (0x0x7f1e75752de0) 0
+
+Vtable for QIconEngine
+QIconEngine::_ZTV11QIconEngine: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QIconEngine)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))QIconEngine::actualSize
+48 (int (*)(...))QIconEngine::pixmap
+56 (int (*)(...))QIconEngine::addPixmap
+64 (int (*)(...))QIconEngine::addFile
+72 (int (*)(...))QIconEngine::key
+80 (int (*)(...))__cxa_pure_virtual
+88 (int (*)(...))QIconEngine::read
+96 (int (*)(...))QIconEngine::write
+104 (int (*)(...))QIconEngine::availableSizes
+112 (int (*)(...))QIconEngine::iconName
+120 (int (*)(...))QIconEngine::virtual_hook
+
+Class QIconEngine
+ size=8 align=8
+ base size=8 base align=8
+QIconEngine (0x0x7f1e75752c00) 0 nearly-empty
+ vptr=((& QIconEngine::_ZTV11QIconEngine) + 16)
+
+Class QIconEnginePlugin::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QIconEnginePlugin::QPrivateSignal (0x0x7f1e75752ea0) 0 empty
+
+Vtable for QIconEnginePlugin
+QIconEnginePlugin::_ZTV17QIconEnginePlugin: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QIconEnginePlugin)
+16 (int (*)(...))QIconEnginePlugin::metaObject
+24 (int (*)(...))QIconEnginePlugin::qt_metacast
+32 (int (*)(...))QIconEnginePlugin::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+
+Class QIconEnginePlugin
+ size=16 align=8
+ base size=16 base align=8
+QIconEnginePlugin (0x0x7f1e75759680) 0
+ vptr=((& QIconEnginePlugin::_ZTV17QIconEnginePlugin) + 16)
+ QObject (0x0x7f1e75752e40) 0
+ primary-for QIconEnginePlugin (0x0x7f1e75759680)
+
+Vtable for QImageIOHandler
+QImageIOHandler::_ZTV15QImageIOHandler: 18 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QImageIOHandler)
+16 0
+24 0
+32 (int (*)(...))QImageIOHandler::name
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))QImageIOHandler::write
+64 (int (*)(...))QImageIOHandler::option
+72 (int (*)(...))QImageIOHandler::setOption
+80 (int (*)(...))QImageIOHandler::supportsOption
+88 (int (*)(...))QImageIOHandler::jumpToNextImage
+96 (int (*)(...))QImageIOHandler::jumpToImage
+104 (int (*)(...))QImageIOHandler::loopCount
+112 (int (*)(...))QImageIOHandler::imageCount
+120 (int (*)(...))QImageIOHandler::nextImageDelay
+128 (int (*)(...))QImageIOHandler::currentImageNumber
+136 (int (*)(...))QImageIOHandler::currentImageRect
+
+Class QImageIOHandler
+ size=16 align=8
+ base size=16 base align=8
+QImageIOHandler (0x0x7f1e757d4000) 0
+ vptr=((& QImageIOHandler::_ZTV15QImageIOHandler) + 16)
+
+Class QImageIOPlugin::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QImageIOPlugin::QPrivateSignal (0x0x7f1e757d4240) 0 empty
+
+Vtable for QImageIOPlugin
+QImageIOPlugin::_ZTV14QImageIOPlugin: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QImageIOPlugin)
+16 (int (*)(...))QImageIOPlugin::metaObject
+24 (int (*)(...))QImageIOPlugin::qt_metacast
+32 (int (*)(...))QImageIOPlugin::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+
+Class QImageIOPlugin
+ size=16 align=8
+ base size=16 base align=8
+QImageIOPlugin (0x0x7f1e757596e8) 0
+ vptr=((& QImageIOPlugin::_ZTV14QImageIOPlugin) + 16)
+ QObject (0x0x7f1e757d41e0) 0
+ primary-for QImageIOPlugin (0x0x7f1e757596e8)
+
+Class QImageReader
+ size=8 align=8
+ base size=8 base align=8
+QImageReader (0x0x7f1e757d4a20) 0
+
+Class QImageWriter
+ size=8 align=8
+ base size=8 base align=8
+QImageWriter (0x0x7f1e757d4b40) 0
+
+Class QVector3D
+ size=12 align=4
+ base size=12 base align=4
+QVector3D (0x0x7f1e757d4c60) 0
+
+Class QVector4D
+ size=16 align=4
+ base size=16 base align=4
+QVector4D (0x0x7f1e7549cde0) 0
+
+Class QQuaternion
+ size=16 align=4
+ base size=16 base align=4
+QQuaternion (0x0x7f1e75556060) 0
+
+Class QMatrix4x4
+ size=68 align=4
+ base size=68 base align=4
+QMatrix4x4 (0x0x7f1e755dd960) 0
+
+Class QMovie::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QMovie::QPrivateSignal (0x0x7f1e752ec7e0) 0 empty
+
+Vtable for QMovie
+QMovie::_ZTV6QMovie: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI6QMovie)
+16 (int (*)(...))QMovie::metaObject
+24 (int (*)(...))QMovie::qt_metacast
+32 (int (*)(...))QMovie::qt_metacall
+40 (int (*)(...))QMovie::~QMovie
+48 (int (*)(...))QMovie::~QMovie
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QMovie
+ size=16 align=8
+ base size=16 base align=8
+QMovie (0x0x7f1e7565ce38) 0
+ vptr=((& QMovie::_ZTV6QMovie) + 16)
+ QObject (0x0x7f1e752ec780) 0
+ primary-for QMovie (0x0x7f1e7565ce38)
+
+Class QOffscreenSurface::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QOffscreenSurface::QPrivateSignal (0x0x7f1e752ecc00) 0 empty
+
+Vtable for QOffscreenSurface
+QOffscreenSurface::_ZTV17QOffscreenSurface: 26 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QOffscreenSurface)
+16 (int (*)(...))QOffscreenSurface::metaObject
+24 (int (*)(...))QOffscreenSurface::qt_metacast
+32 (int (*)(...))QOffscreenSurface::qt_metacall
+40 (int (*)(...))QOffscreenSurface::~QOffscreenSurface
+48 (int (*)(...))QOffscreenSurface::~QOffscreenSurface
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QOffscreenSurface::surfaceType
+120 (int (*)(...))QOffscreenSurface::format
+128 (int (*)(...))QOffscreenSurface::size
+136 (int (*)(...))QOffscreenSurface::surfaceHandle
+144 (int (*)(...))-16
+152 (int (*)(...))(& _ZTI17QOffscreenSurface)
+160 (int (*)(...))QOffscreenSurface::_ZThn16_N17QOffscreenSurfaceD1Ev
+168 (int (*)(...))QOffscreenSurface::_ZThn16_N17QOffscreenSurfaceD0Ev
+176 (int (*)(...))QOffscreenSurface::_ZThn16_NK17QOffscreenSurface6formatEv
+184 (int (*)(...))QOffscreenSurface::_ZThn16_NK17QOffscreenSurface13surfaceHandleEv
+192 (int (*)(...))QOffscreenSurface::_ZThn16_NK17QOffscreenSurface11surfaceTypeEv
+200 (int (*)(...))QOffscreenSurface::_ZThn16_NK17QOffscreenSurface4sizeEv
+
+Class QOffscreenSurface
+ size=40 align=8
+ base size=40 base align=8
+QOffscreenSurface (0x0x7f1e75309310) 0
+ vptr=((& QOffscreenSurface::_ZTV17QOffscreenSurface) + 16)
+ QObject (0x0x7f1e752ecb40) 0
+ primary-for QOffscreenSurface (0x0x7f1e75309310)
+ QSurface (0x0x7f1e752ecba0) 16
+ vptr=((& QOffscreenSurface::_ZTV17QOffscreenSurface) + 160)
+
+Class QOpenGLBuffer
+ size=8 align=8
+ base size=8 base align=8
+QOpenGLBuffer (0x0x7f1e752ece40) 0
+
+Class QOpenGLVersionStatus
+ size=12 align=4
+ base size=12 base align=4
+QOpenGLVersionStatus (0x0x7f1e74fe16c0) 0
+
+Class QOpenGLVersionFunctionsBackend
+ size=16 align=8
+ base size=12 base align=8
+QOpenGLVersionFunctionsBackend (0x0x7f1e7505b2a0) 0
+
+Class QOpenGLVersionFunctionsStorage
+ size=8 align=8
+ base size=8 base align=8
+QOpenGLVersionFunctionsStorage (0x0x7f1e7505b480) 0
+
+Class QAbstractOpenGLFunctionsPrivate
+ size=16 align=8
+ base size=9 base align=8
+QAbstractOpenGLFunctionsPrivate (0x0x7f1e7505b4e0) 0
+
+Vtable for QAbstractOpenGLFunctions
+QAbstractOpenGLFunctions::_ZTV24QAbstractOpenGLFunctions: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI24QAbstractOpenGLFunctions)
+16 (int (*)(...))QAbstractOpenGLFunctions::~QAbstractOpenGLFunctions
+24 (int (*)(...))QAbstractOpenGLFunctions::~QAbstractOpenGLFunctions
+32 (int (*)(...))QAbstractOpenGLFunctions::initializeOpenGLFunctions
+
+Class QAbstractOpenGLFunctions
+ size=16 align=8
+ base size=16 base align=8
+QAbstractOpenGLFunctions (0x0x7f1e7505b6c0) 0
+ vptr=((& QAbstractOpenGLFunctions::_ZTV24QAbstractOpenGLFunctions) + 16)
+
+Class QOpenGLFunctions_1_0_CoreBackend::Functions
+ size=384 align=8
+ base size=384 base align=8
+QOpenGLFunctions_1_0_CoreBackend::Functions (0x0x7f1e7505b8a0) 0
+
+Class QOpenGLFunctions_1_0_CoreBackend
+ size=400 align=8
+ base size=400 base align=8
+QOpenGLFunctions_1_0_CoreBackend (0x0x7f1e75040d00) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f1e7505b840) 0
+
+Class QOpenGLFunctions_1_1_CoreBackend::Functions
+ size=128 align=8
+ base size=128 base align=8
+QOpenGLFunctions_1_1_CoreBackend::Functions (0x0x7f1e7505bba0) 0
+
+Class QOpenGLFunctions_1_1_CoreBackend
+ size=144 align=8
+ base size=144 base align=8
+QOpenGLFunctions_1_1_CoreBackend (0x0x7f1e75040d68) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f1e7505bb40) 0
+
+Class QOpenGLFunctions_1_2_CoreBackend::Functions
+ size=48 align=8
+ base size=48 base align=8
+QOpenGLFunctions_1_2_CoreBackend::Functions (0x0x7f1e7505bea0) 0
+
+Class QOpenGLFunctions_1_2_CoreBackend
+ size=64 align=8
+ base size=64 base align=8
+QOpenGLFunctions_1_2_CoreBackend (0x0x7f1e75040dd0) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f1e7505be40) 0
+
+Class QOpenGLFunctions_1_3_CoreBackend::Functions
+ size=72 align=8
+ base size=72 base align=8
+QOpenGLFunctions_1_3_CoreBackend::Functions (0x0x7f1e74c981e0) 0
+
+Class QOpenGLFunctions_1_3_CoreBackend
+ size=88 align=8
+ base size=88 base align=8
+QOpenGLFunctions_1_3_CoreBackend (0x0x7f1e75040e38) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f1e74c98180) 0
+
+Class QOpenGLFunctions_1_4_CoreBackend::Functions
+ size=56 align=8
+ base size=56 base align=8
+QOpenGLFunctions_1_4_CoreBackend::Functions (0x0x7f1e74c98540) 0
+
+Class QOpenGLFunctions_1_4_CoreBackend
+ size=72 align=8
+ base size=72 base align=8
+QOpenGLFunctions_1_4_CoreBackend (0x0x7f1e75040ea0) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f1e74c984e0) 0
+
+Class QOpenGLFunctions_1_5_CoreBackend::Functions
+ size=152 align=8
+ base size=152 base align=8
+QOpenGLFunctions_1_5_CoreBackend::Functions (0x0x7f1e74c98840) 0
+
+Class QOpenGLFunctions_1_5_CoreBackend
+ size=168 align=8
+ base size=168 base align=8
+QOpenGLFunctions_1_5_CoreBackend (0x0x7f1e75040f08) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f1e74c987e0) 0
+
+Class QOpenGLFunctions_2_0_CoreBackend::Functions
+ size=744 align=8
+ base size=744 base align=8
+QOpenGLFunctions_2_0_CoreBackend::Functions (0x0x7f1e74c98b40) 0
+
+Class QOpenGLFunctions_2_0_CoreBackend
+ size=760 align=8
+ base size=760 base align=8
+QOpenGLFunctions_2_0_CoreBackend (0x0x7f1e75040f70) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f1e74c98ae0) 0
+
+Class QOpenGLFunctions_2_1_CoreBackend::Functions
+ size=48 align=8
+ base size=48 base align=8
+QOpenGLFunctions_2_1_CoreBackend::Functions (0x0x7f1e74c98e40) 0
+
+Class QOpenGLFunctions_2_1_CoreBackend
+ size=64 align=8
+ base size=64 base align=8
+QOpenGLFunctions_2_1_CoreBackend (0x0x7f1e74ccc000) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f1e74c98de0) 0
+
+Class QOpenGLFunctions_3_0_CoreBackend::Functions
+ size=672 align=8
+ base size=672 base align=8
+QOpenGLFunctions_3_0_CoreBackend::Functions (0x0x7f1e74cd3180) 0
+
+Class QOpenGLFunctions_3_0_CoreBackend
+ size=688 align=8
+ base size=688 base align=8
+QOpenGLFunctions_3_0_CoreBackend (0x0x7f1e74ccc068) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f1e74cd3120) 0
+
+Class QOpenGLFunctions_3_1_CoreBackend::Functions
+ size=96 align=8
+ base size=96 base align=8
+QOpenGLFunctions_3_1_CoreBackend::Functions (0x0x7f1e74cd3480) 0
+
+Class QOpenGLFunctions_3_1_CoreBackend
+ size=112 align=8
+ base size=112 base align=8
+QOpenGLFunctions_3_1_CoreBackend (0x0x7f1e74ccc0d0) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f1e74cd3420) 0
+
+Class QOpenGLFunctions_3_2_CoreBackend::Functions
+ size=152 align=8
+ base size=152 base align=8
+QOpenGLFunctions_3_2_CoreBackend::Functions (0x0x7f1e74cd3780) 0
+
+Class QOpenGLFunctions_3_2_CoreBackend
+ size=168 align=8
+ base size=168 base align=8
+QOpenGLFunctions_3_2_CoreBackend (0x0x7f1e74ccc138) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f1e74cd3720) 0
+
+Class QOpenGLFunctions_3_3_CoreBackend::Functions
+ size=464 align=8
+ base size=464 base align=8
+QOpenGLFunctions_3_3_CoreBackend::Functions (0x0x7f1e74cd3a80) 0
+
+Class QOpenGLFunctions_3_3_CoreBackend
+ size=480 align=8
+ base size=480 base align=8
+QOpenGLFunctions_3_3_CoreBackend (0x0x7f1e74ccc1a0) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f1e74cd3a20) 0
+
+Class QOpenGLFunctions_4_0_CoreBackend::Functions
+ size=368 align=8
+ base size=368 base align=8
+QOpenGLFunctions_4_0_CoreBackend::Functions (0x0x7f1e74cd3d80) 0
+
+Class QOpenGLFunctions_4_0_CoreBackend
+ size=384 align=8
+ base size=384 base align=8
+QOpenGLFunctions_4_0_CoreBackend (0x0x7f1e74ccc208) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f1e74cd3d20) 0
+
+Class QOpenGLFunctions_4_1_CoreBackend::Functions
+ size=704 align=8
+ base size=704 base align=8
+QOpenGLFunctions_4_1_CoreBackend::Functions (0x0x7f1e74d270c0) 0
+
+Class QOpenGLFunctions_4_1_CoreBackend
+ size=720 align=8
+ base size=720 base align=8
+QOpenGLFunctions_4_1_CoreBackend (0x0x7f1e74ccc270) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f1e74d27060) 0
+
+Class QOpenGLFunctions_4_2_CoreBackend::Functions
+ size=96 align=8
+ base size=96 base align=8
+QOpenGLFunctions_4_2_CoreBackend::Functions (0x0x7f1e74d273c0) 0
+
+Class QOpenGLFunctions_4_2_CoreBackend
+ size=112 align=8
+ base size=112 base align=8
+QOpenGLFunctions_4_2_CoreBackend (0x0x7f1e74ccc2d8) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f1e74d27360) 0
+
+Class QOpenGLFunctions_4_3_CoreBackend::Functions
+ size=344 align=8
+ base size=344 base align=8
+QOpenGLFunctions_4_3_CoreBackend::Functions (0x0x7f1e74d276c0) 0
+
+Class QOpenGLFunctions_4_3_CoreBackend
+ size=360 align=8
+ base size=360 base align=8
+QOpenGLFunctions_4_3_CoreBackend (0x0x7f1e74ccc340) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f1e74d27660) 0
+
+Class QOpenGLFunctions_4_4_CoreBackend::Functions
+ size=72 align=8
+ base size=72 base align=8
+QOpenGLFunctions_4_4_CoreBackend::Functions (0x0x7f1e74d279c0) 0
+
+Class QOpenGLFunctions_4_4_CoreBackend
+ size=88 align=8
+ base size=88 base align=8
+QOpenGLFunctions_4_4_CoreBackend (0x0x7f1e74ccc3a8) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f1e74d27960) 0
+
+Class QOpenGLFunctions_4_5_CoreBackend::Functions
+ size=848 align=8
+ base size=848 base align=8
+QOpenGLFunctions_4_5_CoreBackend::Functions (0x0x7f1e74d27d20) 0
+
+Class QOpenGLFunctions_4_5_CoreBackend
+ size=864 align=8
+ base size=864 base align=8
+QOpenGLFunctions_4_5_CoreBackend (0x0x7f1e74ccc410) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f1e74d27cc0) 0
+
+Class QOpenGLFunctions_1_0_DeprecatedBackend::Functions
+ size=2064 align=8
+ base size=2064 base align=8
+QOpenGLFunctions_1_0_DeprecatedBackend::Functions (0x0x7f1e74d96060) 0
+
+Class QOpenGLFunctions_1_0_DeprecatedBackend
+ size=2080 align=8
+ base size=2080 base align=8
+QOpenGLFunctions_1_0_DeprecatedBackend (0x0x7f1e74ccc478) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f1e74d96000) 0
+
+Class QOpenGLFunctions_1_1_DeprecatedBackend::Functions
+ size=136 align=8
+ base size=136 base align=8
+QOpenGLFunctions_1_1_DeprecatedBackend::Functions (0x0x7f1e74d96360) 0
+
+Class QOpenGLFunctions_1_1_DeprecatedBackend
+ size=152 align=8
+ base size=152 base align=8
+QOpenGLFunctions_1_1_DeprecatedBackend (0x0x7f1e74ccc4e0) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f1e74d96300) 0
+
+Class QOpenGLFunctions_1_2_DeprecatedBackend::Functions
+ size=256 align=8
+ base size=256 base align=8
+QOpenGLFunctions_1_2_DeprecatedBackend::Functions (0x0x7f1e74d96660) 0
+
+Class QOpenGLFunctions_1_2_DeprecatedBackend
+ size=272 align=8
+ base size=272 base align=8
+QOpenGLFunctions_1_2_DeprecatedBackend (0x0x7f1e74ccc548) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f1e74d96600) 0
+
+Class QOpenGLFunctions_1_3_DeprecatedBackend::Functions
+ size=296 align=8
+ base size=296 base align=8
+QOpenGLFunctions_1_3_DeprecatedBackend::Functions (0x0x7f1e74d96960) 0
+
+Class QOpenGLFunctions_1_3_DeprecatedBackend
+ size=312 align=8
+ base size=312 base align=8
+QOpenGLFunctions_1_3_DeprecatedBackend (0x0x7f1e74ccc5b0) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f1e74d96900) 0
+
+Class QOpenGLFunctions_1_4_DeprecatedBackend::Functions
+ size=304 align=8
+ base size=304 base align=8
+QOpenGLFunctions_1_4_DeprecatedBackend::Functions (0x0x7f1e74d96c60) 0
+
+Class QOpenGLFunctions_1_4_DeprecatedBackend
+ size=320 align=8
+ base size=320 base align=8
+QOpenGLFunctions_1_4_DeprecatedBackend (0x0x7f1e74ccc618) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f1e74d96c00) 0
+
+Class QOpenGLFunctions_2_0_DeprecatedBackend::Functions
+ size=288 align=8
+ base size=288 base align=8
+QOpenGLFunctions_2_0_DeprecatedBackend::Functions (0x0x7f1e74d96f60) 0
+
+Class QOpenGLFunctions_2_0_DeprecatedBackend
+ size=304 align=8
+ base size=304 base align=8
+QOpenGLFunctions_2_0_DeprecatedBackend (0x0x7f1e74ccc680) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f1e74d96f00) 0
+
+Class QOpenGLFunctions_3_0_DeprecatedBackend::Functions
+ size=160 align=8
+ base size=160 base align=8
+QOpenGLFunctions_3_0_DeprecatedBackend::Functions (0x0x7f1e74e0f2a0) 0
+
+Class QOpenGLFunctions_3_0_DeprecatedBackend
+ size=176 align=8
+ base size=176 base align=8
+QOpenGLFunctions_3_0_DeprecatedBackend (0x0x7f1e74ccc6e8) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f1e74e0f240) 0
+
+Class QOpenGLFunctions_3_3_DeprecatedBackend::Functions
+ size=240 align=8
+ base size=240 base align=8
+QOpenGLFunctions_3_3_DeprecatedBackend::Functions (0x0x7f1e74e0f5a0) 0
+
+Class QOpenGLFunctions_3_3_DeprecatedBackend
+ size=256 align=8
+ base size=256 base align=8
+QOpenGLFunctions_3_3_DeprecatedBackend (0x0x7f1e74ccc750) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f1e74e0f540) 0
+
+Class QOpenGLFunctions_4_5_DeprecatedBackend::Functions
+ size=96 align=8
+ base size=96 base align=8
+QOpenGLFunctions_4_5_DeprecatedBackend::Functions (0x0x7f1e74e0f8a0) 0
+
+Class QOpenGLFunctions_4_5_DeprecatedBackend
+ size=112 align=8
+ base size=112 base align=8
+QOpenGLFunctions_4_5_DeprecatedBackend (0x0x7f1e74ccc7b8) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f1e74e0f840) 0
+
+Class QOpenGLVersionProfile
+ size=8 align=8
+ base size=8 base align=8
+QOpenGLVersionProfile (0x0x7f1e74e0fb40) 0
+
+Class QOpenGLContextGroup::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QOpenGLContextGroup::QPrivateSignal (0x0x7f1e74e43660) 0 empty
+
+Vtable for QOpenGLContextGroup
+QOpenGLContextGroup::_ZTV19QOpenGLContextGroup: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QOpenGLContextGroup)
+16 (int (*)(...))QOpenGLContextGroup::metaObject
+24 (int (*)(...))QOpenGLContextGroup::qt_metacast
+32 (int (*)(...))QOpenGLContextGroup::qt_metacall
+40 (int (*)(...))QOpenGLContextGroup::~QOpenGLContextGroup
+48 (int (*)(...))QOpenGLContextGroup::~QOpenGLContextGroup
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QOpenGLContextGroup
+ size=16 align=8
+ base size=16 base align=8
+QOpenGLContextGroup (0x0x7f1e74e54208) 0
+ vptr=((& QOpenGLContextGroup::_ZTV19QOpenGLContextGroup) + 16)
+ QObject (0x0x7f1e74e43600) 0
+ primary-for QOpenGLContextGroup (0x0x7f1e74e54208)
+
+Class QOpenGLContext::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QOpenGLContext::QPrivateSignal (0x0x7f1e74e438a0) 0 empty
+
+Vtable for QOpenGLContext
+QOpenGLContext::_ZTV14QOpenGLContext: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QOpenGLContext)
+16 (int (*)(...))QOpenGLContext::metaObject
+24 (int (*)(...))QOpenGLContext::qt_metacast
+32 (int (*)(...))QOpenGLContext::qt_metacall
+40 (int (*)(...))QOpenGLContext::~QOpenGLContext
+48 (int (*)(...))QOpenGLContext::~QOpenGLContext
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QOpenGLContext
+ size=16 align=8
+ base size=16 base align=8
+QOpenGLContext (0x0x7f1e74e54270) 0
+ vptr=((& QOpenGLContext::_ZTV14QOpenGLContext) + 16)
+ QObject (0x0x7f1e74e43840) 0
+ primary-for QOpenGLContext (0x0x7f1e74e54270)
+
+Class QOpenGLDebugMessage
+ size=8 align=8
+ base size=8 base align=8
+QOpenGLDebugMessage (0x0x7f1e74e43ae0) 0
+
+Class QOpenGLDebugLogger::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QOpenGLDebugLogger::QPrivateSignal (0x0x7f1e74bc70c0) 0 empty
+
+Vtable for QOpenGLDebugLogger
+QOpenGLDebugLogger::_ZTV18QOpenGLDebugLogger: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QOpenGLDebugLogger)
+16 (int (*)(...))QOpenGLDebugLogger::metaObject
+24 (int (*)(...))QOpenGLDebugLogger::qt_metacast
+32 (int (*)(...))QOpenGLDebugLogger::qt_metacall
+40 (int (*)(...))QOpenGLDebugLogger::~QOpenGLDebugLogger
+48 (int (*)(...))QOpenGLDebugLogger::~QOpenGLDebugLogger
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QOpenGLDebugLogger
+ size=16 align=8
+ base size=16 base align=8
+QOpenGLDebugLogger (0x0x7f1e74b414e0) 0
+ vptr=((& QOpenGLDebugLogger::_ZTV18QOpenGLDebugLogger) + 16)
+ QObject (0x0x7f1e74bc7060) 0
+ primary-for QOpenGLDebugLogger (0x0x7f1e74b414e0)
+
+Class QOpenGLFunctions
+ size=8 align=8
+ base size=8 base align=8
+QOpenGLFunctions (0x0x7f1e74bc7540) 0
+
+Class QOpenGLFunctionsPrivate::Functions
+ size=1152 align=8
+ base size=1152 base align=8
+QOpenGLFunctionsPrivate::Functions (0x0x7f1e74bc7ea0) 0
+
+Class QOpenGLFunctionsPrivate
+ size=1152 align=8
+ base size=1152 base align=8
+QOpenGLFunctionsPrivate (0x0x7f1e74bc7e40) 0
+
+Class QOpenGLExtraFunctions
+ size=8 align=8
+ base size=8 base align=8
+QOpenGLExtraFunctions (0x0x7f1e787f7e38) 0
+ QOpenGLFunctions (0x0x7f1e7fbc0f60) 0
+
+Class QOpenGLExtraFunctionsPrivate::Functions
+ size=1728 align=8
+ base size=1728 base align=8
+QOpenGLExtraFunctionsPrivate::Functions (0x0x7f1e7fa374e0) 0
+
+Class QOpenGLExtraFunctionsPrivate
+ size=2880 align=8
+ base size=2880 base align=8
+QOpenGLExtraFunctionsPrivate (0x0x7f1e787f7ea0) 0
+ QOpenGLFunctionsPrivate (0x0x7f1e7fa37060) 0
+
+Vtable for QOpenGLFramebufferObject
+QOpenGLFramebufferObject::_ZTV24QOpenGLFramebufferObject: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI24QOpenGLFramebufferObject)
+16 (int (*)(...))QOpenGLFramebufferObject::~QOpenGLFramebufferObject
+24 (int (*)(...))QOpenGLFramebufferObject::~QOpenGLFramebufferObject
+
+Class QOpenGLFramebufferObject
+ size=16 align=8
+ base size=16 base align=8
+QOpenGLFramebufferObject (0x0x7f1e7e1ca180) 0
+ vptr=((& QOpenGLFramebufferObject::_ZTV24QOpenGLFramebufferObject) + 16)
+
+Class QOpenGLFramebufferObjectFormat
+ size=8 align=8
+ base size=8 base align=8
+QOpenGLFramebufferObjectFormat (0x0x7f1e7e1caf00) 0
+
+Vtable for QOpenGLPaintDevice
+QOpenGLPaintDevice::_ZTV18QOpenGLPaintDevice: 11 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QOpenGLPaintDevice)
+16 (int (*)(...))QOpenGLPaintDevice::~QOpenGLPaintDevice
+24 (int (*)(...))QOpenGLPaintDevice::~QOpenGLPaintDevice
+32 (int (*)(...))QOpenGLPaintDevice::devType
+40 (int (*)(...))QOpenGLPaintDevice::paintEngine
+48 (int (*)(...))QOpenGLPaintDevice::metric
+56 (int (*)(...))QPaintDevice::initPainter
+64 (int (*)(...))QPaintDevice::redirected
+72 (int (*)(...))QPaintDevice::sharedPainter
+80 (int (*)(...))QOpenGLPaintDevice::ensureActiveTarget
+
+Class QOpenGLPaintDevice
+ size=32 align=8
+ base size=32 base align=8
+QOpenGLPaintDevice (0x0x7f1e7ef58958) 0
+ vptr=((& QOpenGLPaintDevice::_ZTV18QOpenGLPaintDevice) + 16)
+ QPaintDevice (0x0x7f1e7e2558a0) 0
+ primary-for QOpenGLPaintDevice (0x0x7f1e7ef58958)
+
+Class QOpenGLPixelTransferOptions
+ size=8 align=8
+ base size=8 base align=8
+QOpenGLPixelTransferOptions (0x0x7f1e7e26fb40) 0
+
+Class QOpenGLShader::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QOpenGLShader::QPrivateSignal (0x0x7f1e7d0e1c00) 0 empty
+
+Vtable for QOpenGLShader
+QOpenGLShader::_ZTV13QOpenGLShader: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QOpenGLShader)
+16 (int (*)(...))QOpenGLShader::metaObject
+24 (int (*)(...))QOpenGLShader::qt_metacast
+32 (int (*)(...))QOpenGLShader::qt_metacall
+40 (int (*)(...))QOpenGLShader::~QOpenGLShader
+48 (int (*)(...))QOpenGLShader::~QOpenGLShader
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QOpenGLShader
+ size=16 align=8
+ base size=16 base align=8
+QOpenGLShader (0x0x7f1e7e6f03a8) 0
+ vptr=((& QOpenGLShader::_ZTV13QOpenGLShader) + 16)
+ QObject (0x0x7f1e7d0e1ba0) 0
+ primary-for QOpenGLShader (0x0x7f1e7e6f03a8)
+
+Class QOpenGLShaderProgram::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QOpenGLShaderProgram::QPrivateSignal (0x0x7f1e7d27f660) 0 empty
+
+Vtable for QOpenGLShaderProgram
+QOpenGLShaderProgram::_ZTV20QOpenGLShaderProgram: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QOpenGLShaderProgram)
+16 (int (*)(...))QOpenGLShaderProgram::metaObject
+24 (int (*)(...))QOpenGLShaderProgram::qt_metacast
+32 (int (*)(...))QOpenGLShaderProgram::qt_metacall
+40 (int (*)(...))QOpenGLShaderProgram::~QOpenGLShaderProgram
+48 (int (*)(...))QOpenGLShaderProgram::~QOpenGLShaderProgram
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QOpenGLShaderProgram::link
+
+Class QOpenGLShaderProgram
+ size=16 align=8
+ base size=16 base align=8
+QOpenGLShaderProgram (0x0x7f1e7e1561a0) 0
+ vptr=((& QOpenGLShaderProgram::_ZTV20QOpenGLShaderProgram) + 16)
+ QObject (0x0x7f1e7d27f600) 0
+ primary-for QOpenGLShaderProgram (0x0x7f1e7e1561a0)
+
+Class QOpenGLTexture
+ size=8 align=8
+ base size=8 base align=8
+QOpenGLTexture (0x0x7f1e7d2cf960) 0
+
+Class QOpenGLTextureBlitter
+ size=8 align=8
+ base size=8 base align=8
+QOpenGLTextureBlitter (0x0x7f1e7cdc5f60) 0
+
+Class QOpenGLTimerQuery::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QOpenGLTimerQuery::QPrivateSignal (0x0x7f1e7ce1a780) 0 empty
+
+Vtable for QOpenGLTimerQuery
+QOpenGLTimerQuery::_ZTV17QOpenGLTimerQuery: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QOpenGLTimerQuery)
+16 (int (*)(...))QOpenGLTimerQuery::metaObject
+24 (int (*)(...))QOpenGLTimerQuery::qt_metacast
+32 (int (*)(...))QOpenGLTimerQuery::qt_metacall
+40 (int (*)(...))QOpenGLTimerQuery::~QOpenGLTimerQuery
+48 (int (*)(...))QOpenGLTimerQuery::~QOpenGLTimerQuery
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QOpenGLTimerQuery
+ size=16 align=8
+ base size=16 base align=8
+QOpenGLTimerQuery (0x0x7f1e7e1567b8) 0
+ vptr=((& QOpenGLTimerQuery::_ZTV17QOpenGLTimerQuery) + 16)
+ QObject (0x0x7f1e7cdfdc00) 0
+ primary-for QOpenGLTimerQuery (0x0x7f1e7e1567b8)
+
+Class QOpenGLTimeMonitor::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QOpenGLTimeMonitor::QPrivateSignal (0x0x7f1e7cbfd960) 0 empty
+
+Vtable for QOpenGLTimeMonitor
+QOpenGLTimeMonitor::_ZTV18QOpenGLTimeMonitor: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QOpenGLTimeMonitor)
+16 (int (*)(...))QOpenGLTimeMonitor::metaObject
+24 (int (*)(...))QOpenGLTimeMonitor::qt_metacast
+32 (int (*)(...))QOpenGLTimeMonitor::qt_metacall
+40 (int (*)(...))QOpenGLTimeMonitor::~QOpenGLTimeMonitor
+48 (int (*)(...))QOpenGLTimeMonitor::~QOpenGLTimeMonitor
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QOpenGLTimeMonitor
+ size=16 align=8
+ base size=16 base align=8
+QOpenGLTimeMonitor (0x0x7f1e7e1733a8) 0
+ vptr=((& QOpenGLTimeMonitor::_ZTV18QOpenGLTimeMonitor) + 16)
+ QObject (0x0x7f1e7cbfd7e0) 0
+ primary-for QOpenGLTimeMonitor (0x0x7f1e7e1733a8)
+
+Class QOpenGLVertexArrayObject::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QOpenGLVertexArrayObject::QPrivateSignal (0x0x7f1e7cc18480) 0 empty
+
+Class QOpenGLVertexArrayObject::Binder
+ size=8 align=8
+ base size=8 base align=8
+QOpenGLVertexArrayObject::Binder (0x0x7f1e7cc184e0) 0
+
+Vtable for QOpenGLVertexArrayObject
+QOpenGLVertexArrayObject::_ZTV24QOpenGLVertexArrayObject: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI24QOpenGLVertexArrayObject)
+16 (int (*)(...))QOpenGLVertexArrayObject::metaObject
+24 (int (*)(...))QOpenGLVertexArrayObject::qt_metacast
+32 (int (*)(...))QOpenGLVertexArrayObject::qt_metacall
+40 (int (*)(...))QOpenGLVertexArrayObject::~QOpenGLVertexArrayObject
+48 (int (*)(...))QOpenGLVertexArrayObject::~QOpenGLVertexArrayObject
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QOpenGLVertexArrayObject
+ size=16 align=8
+ base size=16 base align=8
+QOpenGLVertexArrayObject (0x0x7f1e7e173410) 0
+ vptr=((& QOpenGLVertexArrayObject::_ZTV24QOpenGLVertexArrayObject) + 16)
+ QObject (0x0x7f1e7cbfdcc0) 0
+ primary-for QOpenGLVertexArrayObject (0x0x7f1e7e173410)
+
+Class QPaintDeviceWindow::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QPaintDeviceWindow::QPrivateSignal (0x0x7f1e7ccd8f60) 0 empty
+
+Vtable for QPaintDeviceWindow
+QPaintDeviceWindow::_ZTV18QPaintDeviceWindow: 58 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QPaintDeviceWindow)
+16 (int (*)(...))QPaintDeviceWindow::metaObject
+24 (int (*)(...))QPaintDeviceWindow::qt_metacast
+32 (int (*)(...))QPaintDeviceWindow::qt_metacall
+40 (int (*)(...))QPaintDeviceWindow::~QPaintDeviceWindow
+48 (int (*)(...))QPaintDeviceWindow::~QPaintDeviceWindow
+56 (int (*)(...))QPaintDeviceWindow::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWindow::surfaceType
+120 (int (*)(...))QWindow::format
+128 (int (*)(...))QWindow::size
+136 (int (*)(...))QWindow::accessibleRoot
+144 (int (*)(...))QWindow::focusObject
+152 (int (*)(...))QPaintDeviceWindow::exposeEvent
+160 (int (*)(...))QWindow::resizeEvent
+168 (int (*)(...))QWindow::moveEvent
+176 (int (*)(...))QWindow::focusInEvent
+184 (int (*)(...))QWindow::focusOutEvent
+192 (int (*)(...))QWindow::showEvent
+200 (int (*)(...))QWindow::hideEvent
+208 (int (*)(...))QWindow::keyPressEvent
+216 (int (*)(...))QWindow::keyReleaseEvent
+224 (int (*)(...))QWindow::mousePressEvent
+232 (int (*)(...))QWindow::mouseReleaseEvent
+240 (int (*)(...))QWindow::mouseDoubleClickEvent
+248 (int (*)(...))QWindow::mouseMoveEvent
+256 (int (*)(...))QWindow::wheelEvent
+264 (int (*)(...))QWindow::touchEvent
+272 (int (*)(...))QWindow::tabletEvent
+280 (int (*)(...))QWindow::nativeEvent
+288 (int (*)(...))QWindow::surfaceHandle
+296 (int (*)(...))QPaintDeviceWindow::paintEvent
+304 (int (*)(...))QPaintDeviceWindow::metric
+312 (int (*)(...))QPaintDeviceWindow::paintEngine
+320 (int (*)(...))-16
+328 (int (*)(...))(& _ZTI18QPaintDeviceWindow)
+336 (int (*)(...))QPaintDeviceWindow::_ZThn16_N18QPaintDeviceWindowD1Ev
+344 (int (*)(...))QPaintDeviceWindow::_ZThn16_N18QPaintDeviceWindowD0Ev
+352 (int (*)(...))QWindow::_ZThn16_NK7QWindow6formatEv
+360 (int (*)(...))QWindow::_ZThn16_NK7QWindow13surfaceHandleEv
+368 (int (*)(...))QWindow::_ZThn16_NK7QWindow11surfaceTypeEv
+376 (int (*)(...))QWindow::_ZThn16_NK7QWindow4sizeEv
+384 (int (*)(...))-40
+392 (int (*)(...))(& _ZTI18QPaintDeviceWindow)
+400 (int (*)(...))QPaintDeviceWindow::_ZThn40_N18QPaintDeviceWindowD1Ev
+408 (int (*)(...))QPaintDeviceWindow::_ZThn40_N18QPaintDeviceWindowD0Ev
+416 (int (*)(...))QPaintDevice::devType
+424 (int (*)(...))QPaintDeviceWindow::_ZThn40_NK18QPaintDeviceWindow11paintEngineEv
+432 (int (*)(...))QPaintDeviceWindow::_ZThn40_NK18QPaintDeviceWindow6metricEN12QPaintDevice17PaintDeviceMetricE
+440 (int (*)(...))QPaintDevice::initPainter
+448 (int (*)(...))QPaintDevice::redirected
+456 (int (*)(...))QPaintDevice::sharedPainter
+
+Class QPaintDeviceWindow
+ size=64 align=8
+ base size=64 base align=8
+QPaintDeviceWindow (0x0x7f1e813e9e00) 0
+ vptr=((& QPaintDeviceWindow::_ZTV18QPaintDeviceWindow) + 16)
+ QWindow (0x0x7f1e813e9e70) 0
+ primary-for QPaintDeviceWindow (0x0x7f1e813e9e00)
+ QObject (0x0x7f1e7ccd8d80) 0
+ primary-for QWindow (0x0x7f1e813e9e70)
+ QSurface (0x0x7f1e7ccd8de0) 16
+ vptr=((& QPaintDeviceWindow::_ZTV18QPaintDeviceWindow) + 336)
+ QPaintDevice (0x0x7f1e7ccd8ea0) 40
+ vptr=((& QPaintDeviceWindow::_ZTV18QPaintDeviceWindow) + 400)
+
+Class QOpenGLWindow::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QOpenGLWindow::QPrivateSignal (0x0x7f1e7c945060) 0 empty
+
+Vtable for QOpenGLWindow
+QOpenGLWindow::_ZTV13QOpenGLWindow: 64 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QOpenGLWindow)
+16 (int (*)(...))QOpenGLWindow::metaObject
+24 (int (*)(...))QOpenGLWindow::qt_metacast
+32 (int (*)(...))QOpenGLWindow::qt_metacall
+40 (int (*)(...))QOpenGLWindow::~QOpenGLWindow
+48 (int (*)(...))QOpenGLWindow::~QOpenGLWindow
+56 (int (*)(...))QPaintDeviceWindow::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWindow::surfaceType
+120 (int (*)(...))QWindow::format
+128 (int (*)(...))QWindow::size
+136 (int (*)(...))QWindow::accessibleRoot
+144 (int (*)(...))QWindow::focusObject
+152 (int (*)(...))QPaintDeviceWindow::exposeEvent
+160 (int (*)(...))QOpenGLWindow::resizeEvent
+168 (int (*)(...))QWindow::moveEvent
+176 (int (*)(...))QWindow::focusInEvent
+184 (int (*)(...))QWindow::focusOutEvent
+192 (int (*)(...))QWindow::showEvent
+200 (int (*)(...))QWindow::hideEvent
+208 (int (*)(...))QWindow::keyPressEvent
+216 (int (*)(...))QWindow::keyReleaseEvent
+224 (int (*)(...))QWindow::mousePressEvent
+232 (int (*)(...))QWindow::mouseReleaseEvent
+240 (int (*)(...))QWindow::mouseDoubleClickEvent
+248 (int (*)(...))QWindow::mouseMoveEvent
+256 (int (*)(...))QWindow::wheelEvent
+264 (int (*)(...))QWindow::touchEvent
+272 (int (*)(...))QWindow::tabletEvent
+280 (int (*)(...))QWindow::nativeEvent
+288 (int (*)(...))QWindow::surfaceHandle
+296 (int (*)(...))QOpenGLWindow::paintEvent
+304 (int (*)(...))QOpenGLWindow::metric
+312 (int (*)(...))QPaintDeviceWindow::paintEngine
+320 (int (*)(...))QOpenGLWindow::initializeGL
+328 (int (*)(...))QOpenGLWindow::resizeGL
+336 (int (*)(...))QOpenGLWindow::paintGL
+344 (int (*)(...))QOpenGLWindow::paintUnderGL
+352 (int (*)(...))QOpenGLWindow::paintOverGL
+360 (int (*)(...))QOpenGLWindow::redirected
+368 (int (*)(...))-16
+376 (int (*)(...))(& _ZTI13QOpenGLWindow)
+384 (int (*)(...))QOpenGLWindow::_ZThn16_N13QOpenGLWindowD1Ev
+392 (int (*)(...))QOpenGLWindow::_ZThn16_N13QOpenGLWindowD0Ev
+400 (int (*)(...))QWindow::_ZThn16_NK7QWindow6formatEv
+408 (int (*)(...))QWindow::_ZThn16_NK7QWindow13surfaceHandleEv
+416 (int (*)(...))QWindow::_ZThn16_NK7QWindow11surfaceTypeEv
+424 (int (*)(...))QWindow::_ZThn16_NK7QWindow4sizeEv
+432 (int (*)(...))-40
+440 (int (*)(...))(& _ZTI13QOpenGLWindow)
+448 (int (*)(...))QOpenGLWindow::_ZThn40_N13QOpenGLWindowD1Ev
+456 (int (*)(...))QOpenGLWindow::_ZThn40_N13QOpenGLWindowD0Ev
+464 (int (*)(...))QPaintDevice::devType
+472 (int (*)(...))QPaintDeviceWindow::_ZThn40_NK18QPaintDeviceWindow11paintEngineEv
+480 (int (*)(...))QOpenGLWindow::_ZThn40_NK13QOpenGLWindow6metricEN12QPaintDevice17PaintDeviceMetricE
+488 (int (*)(...))QPaintDevice::initPainter
+496 (int (*)(...))QOpenGLWindow::_ZThn40_NK13QOpenGLWindow10redirectedEP6QPoint
+504 (int (*)(...))QPaintDevice::sharedPainter
+
+Class QOpenGLWindow
+ size=64 align=8
+ base size=64 base align=8
+QOpenGLWindow (0x0x7f1e7e173820) 0
+ vptr=((& QOpenGLWindow::_ZTV13QOpenGLWindow) + 16)
+ QPaintDeviceWindow (0x0x7f1e81dbe0e0) 0
+ primary-for QOpenGLWindow (0x0x7f1e7e173820)
+ QWindow (0x0x7f1e81dbe150) 0
+ primary-for QPaintDeviceWindow (0x0x7f1e81dbe0e0)
+ QObject (0x0x7f1e7c920d20) 0
+ primary-for QWindow (0x0x7f1e81dbe150)
+ QSurface (0x0x7f1e7c920d80) 16
+ vptr=((& QOpenGLWindow::_ZTV13QOpenGLWindow) + 384)
+ QPaintDevice (0x0x7f1e7c945000) 40
+ vptr=((& QOpenGLWindow::_ZTV13QOpenGLWindow) + 448)
+
+Class QPageSize
+ size=8 align=8
+ base size=8 base align=8
+QPageSize (0x0x7f1e7c945f00) 0
+
+Class QPageLayout
+ size=8 align=8
+ base size=8 base align=8
+QPageLayout (0x0x7f1e7ba8e8a0) 0
+
+Class QPagedPaintDevice::Margins
+ size=32 align=8
+ base size=32 base align=8
+QPagedPaintDevice::Margins (0x0x7f1e7a800300) 0
+
+Vtable for QPagedPaintDevice
+QPagedPaintDevice::_ZTV17QPagedPaintDevice: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QPagedPaintDevice)
+16 0
+24 0
+32 (int (*)(...))QPaintDevice::devType
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))QPaintDevice::metric
+56 (int (*)(...))QPaintDevice::initPainter
+64 (int (*)(...))QPaintDevice::redirected
+72 (int (*)(...))QPaintDevice::sharedPainter
+80 (int (*)(...))__cxa_pure_virtual
+88 (int (*)(...))QPagedPaintDevice::setPageSize
+96 (int (*)(...))QPagedPaintDevice::setPageSizeMM
+104 (int (*)(...))QPagedPaintDevice::setMargins
+
+Class QPagedPaintDevice
+ size=32 align=8
+ base size=32 base align=8
+QPagedPaintDevice (0x0x7f1e7af68548) 0
+ vptr=((& QPagedPaintDevice::_ZTV17QPagedPaintDevice) + 16)
+ QPaintDevice (0x0x7f1e7a800240) 0
+ primary-for QPagedPaintDevice (0x0x7f1e7af68548)
+
+Class QPainter::PixmapFragment
+ size=80 align=8
+ base size=80 base align=8
+QPainter::PixmapFragment (0x0x7f1e7a800480) 0
+
+Class QPainter
+ size=8 align=8
+ base size=8 base align=8
+QPainter (0x0x7f1e7a8003c0) 0
+
+Class QTextItem
+ size=1 align=1
+ base size=0 base align=1
+QTextItem (0x0x7f1e79544780) 0 empty
+
+Vtable for QPaintEngine
+QPaintEngine::_ZTV12QPaintEngine: 24 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QPaintEngine)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))QPaintEngine::drawRects
+64 (int (*)(...))QPaintEngine::drawRects
+72 (int (*)(...))QPaintEngine::drawLines
+80 (int (*)(...))QPaintEngine::drawLines
+88 (int (*)(...))QPaintEngine::drawEllipse
+96 (int (*)(...))QPaintEngine::drawEllipse
+104 (int (*)(...))QPaintEngine::drawPath
+112 (int (*)(...))QPaintEngine::drawPoints
+120 (int (*)(...))QPaintEngine::drawPoints
+128 (int (*)(...))QPaintEngine::drawPolygon
+136 (int (*)(...))QPaintEngine::drawPolygon
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))QPaintEngine::drawTextItem
+160 (int (*)(...))QPaintEngine::drawTiledPixmap
+168 (int (*)(...))QPaintEngine::drawImage
+176 (int (*)(...))QPaintEngine::coordinateOffset
+184 (int (*)(...))__cxa_pure_virtual
+
+Class QPaintEngine
+ size=32 align=8
+ base size=32 base align=8
+QPaintEngine (0x0x7f1e7905d360) 0
+ vptr=((& QPaintEngine::_ZTV12QPaintEngine) + 16)
+
+Class QPaintEngineState
+ size=4 align=4
+ base size=4 base align=4
+QPaintEngineState (0x0x7f1e78e2eea0) 0
+
+Class QPainterPath::Element
+ size=24 align=8
+ base size=24 base align=8
+QPainterPath::Element (0x0x7f1e78508660) 0
+
+Class QPainterPath
+ size=8 align=8
+ base size=8 base align=8
+QPainterPath (0x0x7f1e78508360) 0
+
+Class QPainterPathStroker
+ size=8 align=8
+ base size=8 base align=8
+QPainterPathStroker (0x0x7f1e76dbe2a0) 0
+
+Class QPdfWriter::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QPdfWriter::QPrivateSignal (0x0x7f1e76ab8420) 0 empty
+
+Vtable for QPdfWriter
+QPdfWriter::_ZTV10QPdfWriter: 34 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QPdfWriter)
+16 (int (*)(...))QPdfWriter::metaObject
+24 (int (*)(...))QPdfWriter::qt_metacast
+32 (int (*)(...))QPdfWriter::qt_metacall
+40 (int (*)(...))QPdfWriter::~QPdfWriter
+48 (int (*)(...))QPdfWriter::~QPdfWriter
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QPdfWriter::newPage
+120 (int (*)(...))QPdfWriter::setPageSize
+128 (int (*)(...))QPdfWriter::setPageSizeMM
+136 (int (*)(...))QPdfWriter::setMargins
+144 (int (*)(...))QPdfWriter::paintEngine
+152 (int (*)(...))QPdfWriter::metric
+160 (int (*)(...))-16
+168 (int (*)(...))(& _ZTI10QPdfWriter)
+176 (int (*)(...))QPdfWriter::_ZThn16_N10QPdfWriterD1Ev
+184 (int (*)(...))QPdfWriter::_ZThn16_N10QPdfWriterD0Ev
+192 (int (*)(...))QPaintDevice::devType
+200 (int (*)(...))QPdfWriter::_ZThn16_NK10QPdfWriter11paintEngineEv
+208 (int (*)(...))QPdfWriter::_ZThn16_NK10QPdfWriter6metricEN12QPaintDevice17PaintDeviceMetricE
+216 (int (*)(...))QPaintDevice::initPainter
+224 (int (*)(...))QPaintDevice::redirected
+232 (int (*)(...))QPaintDevice::sharedPainter
+240 (int (*)(...))QPdfWriter::_ZThn16_N10QPdfWriter7newPageEv
+248 (int (*)(...))QPdfWriter::_ZThn16_N10QPdfWriter11setPageSizeEN17QPagedPaintDevice8PageSizeE
+256 (int (*)(...))QPdfWriter::_ZThn16_N10QPdfWriter13setPageSizeMMERK6QSizeF
+264 (int (*)(...))QPdfWriter::_ZThn16_N10QPdfWriter10setMarginsERKN17QPagedPaintDevice7MarginsE
+
+Class QPdfWriter
+ size=48 align=8
+ base size=48 base align=8
+QPdfWriter (0x0x7f1e8081b700) 0
+ vptr=((& QPdfWriter::_ZTV10QPdfWriter) + 16)
+ QObject (0x0x7f1e76a9cde0) 0
+ primary-for QPdfWriter (0x0x7f1e8081b700)
+ QPagedPaintDevice (0x0x7f1e77a5a4e0) 16
+ vptr=((& QPdfWriter::_ZTV10QPdfWriter) + 176)
+ QPaintDevice (0x0x7f1e76a9ce40) 16
+ primary-for QPagedPaintDevice (0x0x7f1e77a5a4e0)
+
+Vtable for QPicture
+QPicture::_ZTV8QPicture: 11 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI8QPicture)
+16 (int (*)(...))QPicture::~QPicture
+24 (int (*)(...))QPicture::~QPicture
+32 (int (*)(...))QPicture::devType
+40 (int (*)(...))QPicture::paintEngine
+48 (int (*)(...))QPicture::metric
+56 (int (*)(...))QPaintDevice::initPainter
+64 (int (*)(...))QPaintDevice::redirected
+72 (int (*)(...))QPaintDevice::sharedPainter
+80 (int (*)(...))QPicture::setData
+
+Class QPicture
+ size=32 align=8
+ base size=32 base align=8
+QPicture (0x0x7f1e77a5ab60) 0
+ vptr=((& QPicture::_ZTV8QPicture) + 16)
+ QPaintDevice (0x0x7f1e76b20de0) 0
+ primary-for QPicture (0x0x7f1e77a5ab60)
+
+Class QPictureIO
+ size=8 align=8
+ base size=8 base align=8
+QPictureIO (0x0x7f1e7633dde0) 0
+
+Class QPictureFormatPlugin::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QPictureFormatPlugin::QPrivateSignal (0x0x7f1e7633df00) 0 empty
+
+Vtable for QPictureFormatPlugin
+QPictureFormatPlugin::_ZTV20QPictureFormatPlugin: 17 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QPictureFormatPlugin)
+16 (int (*)(...))QPictureFormatPlugin::metaObject
+24 (int (*)(...))QPictureFormatPlugin::qt_metacast
+32 (int (*)(...))QPictureFormatPlugin::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QPictureFormatPlugin::loadPicture
+120 (int (*)(...))QPictureFormatPlugin::savePicture
+128 (int (*)(...))__cxa_pure_virtual
+
+Class QPictureFormatPlugin
+ size=16 align=8
+ base size=16 base align=8
+QPictureFormatPlugin (0x0x7f1e76a247b8) 0
+ vptr=((& QPictureFormatPlugin::_ZTV20QPictureFormatPlugin) + 16)
+ QObject (0x0x7f1e7633de40) 0
+ primary-for QPictureFormatPlugin (0x0x7f1e76a247b8)
+
+Class QPixmapCache::Key
+ size=8 align=8
+ base size=8 base align=8
+QPixmapCache::Key (0x0x7f1e76380180) 0
+
+Class QPixmapCache
+ size=1 align=1
+ base size=0 base align=1
+QPixmapCache (0x0x7f1e76380120) 0 empty
+
+Class QRasterWindow::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QRasterWindow::QPrivateSignal (0x0x7f1e7547d120) 0 empty
+
+Vtable for QRasterWindow
+QRasterWindow::_ZTV13QRasterWindow: 59 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QRasterWindow)
+16 (int (*)(...))QRasterWindow::metaObject
+24 (int (*)(...))QRasterWindow::qt_metacast
+32 (int (*)(...))QRasterWindow::qt_metacall
+40 (int (*)(...))QRasterWindow::~QRasterWindow
+48 (int (*)(...))QRasterWindow::~QRasterWindow
+56 (int (*)(...))QPaintDeviceWindow::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWindow::surfaceType
+120 (int (*)(...))QWindow::format
+128 (int (*)(...))QWindow::size
+136 (int (*)(...))QWindow::accessibleRoot
+144 (int (*)(...))QWindow::focusObject
+152 (int (*)(...))QPaintDeviceWindow::exposeEvent
+160 (int (*)(...))QWindow::resizeEvent
+168 (int (*)(...))QWindow::moveEvent
+176 (int (*)(...))QWindow::focusInEvent
+184 (int (*)(...))QWindow::focusOutEvent
+192 (int (*)(...))QWindow::showEvent
+200 (int (*)(...))QWindow::hideEvent
+208 (int (*)(...))QWindow::keyPressEvent
+216 (int (*)(...))QWindow::keyReleaseEvent
+224 (int (*)(...))QWindow::mousePressEvent
+232 (int (*)(...))QWindow::mouseReleaseEvent
+240 (int (*)(...))QWindow::mouseDoubleClickEvent
+248 (int (*)(...))QWindow::mouseMoveEvent
+256 (int (*)(...))QWindow::wheelEvent
+264 (int (*)(...))QWindow::touchEvent
+272 (int (*)(...))QWindow::tabletEvent
+280 (int (*)(...))QWindow::nativeEvent
+288 (int (*)(...))QWindow::surfaceHandle
+296 (int (*)(...))QPaintDeviceWindow::paintEvent
+304 (int (*)(...))QRasterWindow::metric
+312 (int (*)(...))QPaintDeviceWindow::paintEngine
+320 (int (*)(...))QRasterWindow::redirected
+328 (int (*)(...))-16
+336 (int (*)(...))(& _ZTI13QRasterWindow)
+344 (int (*)(...))QRasterWindow::_ZThn16_N13QRasterWindowD1Ev
+352 (int (*)(...))QRasterWindow::_ZThn16_N13QRasterWindowD0Ev
+360 (int (*)(...))QWindow::_ZThn16_NK7QWindow6formatEv
+368 (int (*)(...))QWindow::_ZThn16_NK7QWindow13surfaceHandleEv
+376 (int (*)(...))QWindow::_ZThn16_NK7QWindow11surfaceTypeEv
+384 (int (*)(...))QWindow::_ZThn16_NK7QWindow4sizeEv
+392 (int (*)(...))-40
+400 (int (*)(...))(& _ZTI13QRasterWindow)
+408 (int (*)(...))QRasterWindow::_ZThn40_N13QRasterWindowD1Ev
+416 (int (*)(...))QRasterWindow::_ZThn40_N13QRasterWindowD0Ev
+424 (int (*)(...))QPaintDevice::devType
+432 (int (*)(...))QPaintDeviceWindow::_ZThn40_NK18QPaintDeviceWindow11paintEngineEv
+440 (int (*)(...))QRasterWindow::_ZThn40_NK13QRasterWindow6metricEN12QPaintDevice17PaintDeviceMetricE
+448 (int (*)(...))QPaintDevice::initPainter
+456 (int (*)(...))QRasterWindow::_ZThn40_NK13QRasterWindow10redirectedEP6QPoint
+464 (int (*)(...))QPaintDevice::sharedPainter
+
+Class QRasterWindow
+ size=64 align=8
+ base size=64 base align=8
+QRasterWindow (0x0x7f1e7546d0d0) 0
+ vptr=((& QRasterWindow::_ZTV13QRasterWindow) + 16)
+ QPaintDeviceWindow (0x0x7f1e7fc32b60) 0
+ primary-for QRasterWindow (0x0x7f1e7546d0d0)
+ QWindow (0x0x7f1e7fc32bd0) 0
+ primary-for QPaintDeviceWindow (0x0x7f1e7fc32b60)
+ QObject (0x0x7f1e7545eae0) 0
+ primary-for QWindow (0x0x7f1e7fc32bd0)
+ QSurface (0x0x7f1e7545eb40) 16
+ vptr=((& QRasterWindow::_ZTV13QRasterWindow) + 344)
+ QPaintDevice (0x0x7f1e7547d0c0) 40
+ vptr=((& QRasterWindow::_ZTV13QRasterWindow) + 408)
+
+Class QScreen::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QScreen::QPrivateSignal (0x0x7f1e754e3b40) 0 empty
+
+Vtable for QScreen
+QScreen::_ZTV7QScreen: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI7QScreen)
+16 (int (*)(...))QScreen::metaObject
+24 (int (*)(...))QScreen::qt_metacast
+32 (int (*)(...))QScreen::qt_metacall
+40 (int (*)(...))QScreen::~QScreen
+48 (int (*)(...))QScreen::~QScreen
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QScreen
+ size=16 align=8
+ base size=16 base align=8
+QScreen (0x0x7f1e75489138) 0
+ vptr=((& QScreen::_ZTV7QScreen) + 16)
+ QObject (0x0x7f1e754e3ae0) 0
+ primary-for QScreen (0x0x7f1e75489138)
+
+Class QSessionManager::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSessionManager::QPrivateSignal (0x0x7f1e75556720) 0 empty
+
+Vtable for QSessionManager
+QSessionManager::_ZTV15QSessionManager: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QSessionManager)
+16 (int (*)(...))QSessionManager::metaObject
+24 (int (*)(...))QSessionManager::qt_metacast
+32 (int (*)(...))QSessionManager::qt_metacall
+40 (int (*)(...))QSessionManager::~QSessionManager
+48 (int (*)(...))QSessionManager::~QSessionManager
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QSessionManager
+ size=16 align=8
+ base size=16 base align=8
+QSessionManager (0x0x7f1e754894e0) 0
+ vptr=((& QSessionManager::_ZTV15QSessionManager) + 16)
+ QObject (0x0x7f1e755566c0) 0
+ primary-for QSessionManager (0x0x7f1e754894e0)
+
+Vtable for QStandardItem
+QStandardItem::_ZTV13QStandardItem: 11 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QStandardItem)
+16 (int (*)(...))QStandardItem::~QStandardItem
+24 (int (*)(...))QStandardItem::~QStandardItem
+32 (int (*)(...))QStandardItem::data
+40 (int (*)(...))QStandardItem::setData
+48 (int (*)(...))QStandardItem::clone
+56 (int (*)(...))QStandardItem::type
+64 (int (*)(...))QStandardItem::read
+72 (int (*)(...))QStandardItem::write
+80 (int (*)(...))QStandardItem::operator<
+
+Class QStandardItem
+ size=16 align=8
+ base size=16 base align=8
+QStandardItem (0x0x7f1e7558d960) 0
+ vptr=((& QStandardItem::_ZTV13QStandardItem) + 16)
+
+Class QStandardItemModel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QStandardItemModel::QPrivateSignal (0x0x7f1e74832a20) 0 empty
+
+Vtable for QStandardItemModel
+QStandardItemModel::_ZTV18QStandardItemModel: 48 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QStandardItemModel)
+16 (int (*)(...))QStandardItemModel::metaObject
+24 (int (*)(...))QStandardItemModel::qt_metacast
+32 (int (*)(...))QStandardItemModel::qt_metacall
+40 (int (*)(...))QStandardItemModel::~QStandardItemModel
+48 (int (*)(...))QStandardItemModel::~QStandardItemModel
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QStandardItemModel::index
+120 (int (*)(...))QStandardItemModel::parent
+128 (int (*)(...))QStandardItemModel::sibling
+136 (int (*)(...))QStandardItemModel::rowCount
+144 (int (*)(...))QStandardItemModel::columnCount
+152 (int (*)(...))QStandardItemModel::hasChildren
+160 (int (*)(...))QStandardItemModel::data
+168 (int (*)(...))QStandardItemModel::setData
+176 (int (*)(...))QStandardItemModel::headerData
+184 (int (*)(...))QStandardItemModel::setHeaderData
+192 (int (*)(...))QStandardItemModel::itemData
+200 (int (*)(...))QStandardItemModel::setItemData
+208 (int (*)(...))QStandardItemModel::mimeTypes
+216 (int (*)(...))QStandardItemModel::mimeData
+224 (int (*)(...))QAbstractItemModel::canDropMimeData
+232 (int (*)(...))QStandardItemModel::dropMimeData
+240 (int (*)(...))QStandardItemModel::supportedDropActions
+248 (int (*)(...))QAbstractItemModel::supportedDragActions
+256 (int (*)(...))QStandardItemModel::insertRows
+264 (int (*)(...))QStandardItemModel::insertColumns
+272 (int (*)(...))QStandardItemModel::removeRows
+280 (int (*)(...))QStandardItemModel::removeColumns
+288 (int (*)(...))QAbstractItemModel::moveRows
+296 (int (*)(...))QAbstractItemModel::moveColumns
+304 (int (*)(...))QAbstractItemModel::fetchMore
+312 (int (*)(...))QAbstractItemModel::canFetchMore
+320 (int (*)(...))QStandardItemModel::flags
+328 (int (*)(...))QStandardItemModel::sort
+336 (int (*)(...))QAbstractItemModel::buddy
+344 (int (*)(...))QAbstractItemModel::match
+352 (int (*)(...))QAbstractItemModel::span
+360 (int (*)(...))QAbstractItemModel::roleNames
+368 (int (*)(...))QAbstractItemModel::submit
+376 (int (*)(...))QAbstractItemModel::revert
+
+Class QStandardItemModel
+ size=16 align=8
+ base size=16 base align=8
+QStandardItemModel (0x0x7f1e7557bd68) 0
+ vptr=((& QStandardItemModel::_ZTV18QStandardItemModel) + 16)
+ QAbstractItemModel (0x0x7f1e7557bdd0) 0
+ primary-for QStandardItemModel (0x0x7f1e7557bd68)
+ QObject (0x0x7f1e748329c0) 0
+ primary-for QAbstractItemModel (0x0x7f1e7557bdd0)
+
+Class QStaticText
+ size=8 align=8
+ base size=8 base align=8
+QStaticText (0x0x7f1e74832de0) 0
+
+Class QStyleHints::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QStyleHints::QPrivateSignal (0x0x7f1e76f73120) 0 empty
+
+Vtable for QStyleHints
+QStyleHints::_ZTV11QStyleHints: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QStyleHints)
+16 (int (*)(...))QStyleHints::metaObject
+24 (int (*)(...))QStyleHints::qt_metacast
+32 (int (*)(...))QStyleHints::qt_metacall
+40 (int (*)(...))QStyleHints::~QStyleHints
+48 (int (*)(...))QStyleHints::~QStyleHints
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QStyleHints
+ size=16 align=8
+ base size=16 base align=8
+QStyleHints (0x0x7f1e77148340) 0
+ vptr=((& QStyleHints::_ZTV11QStyleHints) + 16)
+ QObject (0x0x7f1e76f730c0) 0
+ primary-for QStyleHints (0x0x7f1e77148340)
+
+Class QTextObject::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTextObject::QPrivateSignal (0x0x7f1e76f73360) 0 empty
+
+Vtable for QTextObject
+QTextObject::_ZTV11QTextObject: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QTextObject)
+16 (int (*)(...))QTextObject::metaObject
+24 (int (*)(...))QTextObject::qt_metacast
+32 (int (*)(...))QTextObject::qt_metacall
+40 (int (*)(...))QTextObject::~QTextObject
+48 (int (*)(...))QTextObject::~QTextObject
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QTextObject
+ size=16 align=8
+ base size=16 base align=8
+QTextObject (0x0x7f1e771483a8) 0
+ vptr=((& QTextObject::_ZTV11QTextObject) + 16)
+ QObject (0x0x7f1e76f73300) 0
+ primary-for QTextObject (0x0x7f1e771483a8)
+
+Class QTextBlockGroup::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTextBlockGroup::QPrivateSignal (0x0x7f1e76f735a0) 0 empty
+
+Vtable for QTextBlockGroup
+QTextBlockGroup::_ZTV15QTextBlockGroup: 17 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QTextBlockGroup)
+16 (int (*)(...))QTextBlockGroup::metaObject
+24 (int (*)(...))QTextBlockGroup::qt_metacast
+32 (int (*)(...))QTextBlockGroup::qt_metacall
+40 (int (*)(...))QTextBlockGroup::~QTextBlockGroup
+48 (int (*)(...))QTextBlockGroup::~QTextBlockGroup
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QTextBlockGroup::blockInserted
+120 (int (*)(...))QTextBlockGroup::blockRemoved
+128 (int (*)(...))QTextBlockGroup::blockFormatChanged
+
+Class QTextBlockGroup
+ size=16 align=8
+ base size=16 base align=8
+QTextBlockGroup (0x0x7f1e77148410) 0
+ vptr=((& QTextBlockGroup::_ZTV15QTextBlockGroup) + 16)
+ QTextObject (0x0x7f1e77148478) 0
+ primary-for QTextBlockGroup (0x0x7f1e77148410)
+ QObject (0x0x7f1e76f73540) 0
+ primary-for QTextObject (0x0x7f1e77148478)
+
+Vtable for QTextFrameLayoutData
+QTextFrameLayoutData::_ZTV20QTextFrameLayoutData: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QTextFrameLayoutData)
+16 (int (*)(...))QTextFrameLayoutData::~QTextFrameLayoutData
+24 (int (*)(...))QTextFrameLayoutData::~QTextFrameLayoutData
+
+Class QTextFrameLayoutData
+ size=8 align=8
+ base size=8 base align=8
+QTextFrameLayoutData (0x0x7f1e76f73780) 0 nearly-empty
+ vptr=((& QTextFrameLayoutData::_ZTV20QTextFrameLayoutData) + 16)
+
+Class QTextFrame::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTextFrame::QPrivateSignal (0x0x7f1e76f73840) 0 empty
+
+Class QTextFrame::iterator
+ size=32 align=8
+ base size=28 base align=8
+QTextFrame::iterator (0x0x7f1e76f738a0) 0
+
+Vtable for QTextFrame
+QTextFrame::_ZTV10QTextFrame: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QTextFrame)
+16 (int (*)(...))QTextFrame::metaObject
+24 (int (*)(...))QTextFrame::qt_metacast
+32 (int (*)(...))QTextFrame::qt_metacall
+40 (int (*)(...))QTextFrame::~QTextFrame
+48 (int (*)(...))QTextFrame::~QTextFrame
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QTextFrame
+ size=16 align=8
+ base size=16 base align=8
+QTextFrame (0x0x7f1e771484e0) 0
+ vptr=((& QTextFrame::_ZTV10QTextFrame) + 16)
+ QTextObject (0x0x7f1e77148548) 0
+ primary-for QTextFrame (0x0x7f1e771484e0)
+ QObject (0x0x7f1e76f737e0) 0
+ primary-for QTextObject (0x0x7f1e77148548)
+
+Vtable for QTextBlockUserData
+QTextBlockUserData::_ZTV18QTextBlockUserData: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QTextBlockUserData)
+16 (int (*)(...))QTextBlockUserData::~QTextBlockUserData
+24 (int (*)(...))QTextBlockUserData::~QTextBlockUserData
+
+Class QTextBlockUserData
+ size=8 align=8
+ base size=8 base align=8
+QTextBlockUserData (0x0x7f1e7600e240) 0 nearly-empty
+ vptr=((& QTextBlockUserData::_ZTV18QTextBlockUserData) + 16)
+
+Class QTextBlock::iterator
+ size=24 align=8
+ base size=20 base align=8
+QTextBlock::iterator (0x0x7f1e7600e300) 0
+
+Class QTextBlock
+ size=16 align=8
+ base size=12 base align=8
+QTextBlock (0x0x7f1e7600e2a0) 0
+
+Class QTextFragment
+ size=16 align=8
+ base size=16 base align=8
+QTextFragment (0x0x7f1e7526e000) 0
+
+Class QSyntaxHighlighter::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSyntaxHighlighter::QPrivateSignal (0x0x7f1e752a37e0) 0 empty
+
+Vtable for QSyntaxHighlighter
+QSyntaxHighlighter::_ZTV18QSyntaxHighlighter: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QSyntaxHighlighter)
+16 (int (*)(...))QSyntaxHighlighter::metaObject
+24 (int (*)(...))QSyntaxHighlighter::qt_metacast
+32 (int (*)(...))QSyntaxHighlighter::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+
+Class QSyntaxHighlighter
+ size=16 align=8
+ base size=16 base align=8
+QSyntaxHighlighter (0x0x7f1e752a97b8) 0
+ vptr=((& QSyntaxHighlighter::_ZTV18QSyntaxHighlighter) + 16)
+ QObject (0x0x7f1e752a3780) 0
+ primary-for QSyntaxHighlighter (0x0x7f1e752a97b8)
+
+Class QTextDocumentFragment
+ size=8 align=8
+ base size=8 base align=8
+QTextDocumentFragment (0x0x7f1e752a39c0) 0
+
+Class QTextDocumentWriter
+ size=8 align=8
+ base size=8 base align=8
+QTextDocumentWriter (0x0x7f1e752a3a20) 0
+
+Class QTextList::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTextList::QPrivateSignal (0x0x7f1e752a3ae0) 0 empty
+
+Vtable for QTextList
+QTextList::_ZTV9QTextList: 17 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QTextList)
+16 (int (*)(...))QTextList::metaObject
+24 (int (*)(...))QTextList::qt_metacast
+32 (int (*)(...))QTextList::qt_metacall
+40 (int (*)(...))QTextList::~QTextList
+48 (int (*)(...))QTextList::~QTextList
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QTextBlockGroup::blockInserted
+120 (int (*)(...))QTextBlockGroup::blockRemoved
+128 (int (*)(...))QTextBlockGroup::blockFormatChanged
+
+Class QTextList
+ size=16 align=8
+ base size=16 base align=8
+QTextList (0x0x7f1e752a9820) 0
+ vptr=((& QTextList::_ZTV9QTextList) + 16)
+ QTextBlockGroup (0x0x7f1e752a9888) 0
+ primary-for QTextList (0x0x7f1e752a9820)
+ QTextObject (0x0x7f1e752a98f0) 0
+ primary-for QTextBlockGroup (0x0x7f1e752a9888)
+ QObject (0x0x7f1e752a3a80) 0
+ primary-for QTextObject (0x0x7f1e752a98f0)
+
+Class QTextTableCell
+ size=16 align=8
+ base size=12 base align=8
+QTextTableCell (0x0x7f1e7e1f8120) 0
+
+Class QTextTable::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTextTable::QPrivateSignal (0x0x7f1e7e1f8960) 0 empty
+
+Vtable for QTextTable
+QTextTable::_ZTV10QTextTable: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QTextTable)
+16 (int (*)(...))QTextTable::metaObject
+24 (int (*)(...))QTextTable::qt_metacast
+32 (int (*)(...))QTextTable::qt_metacall
+40 (int (*)(...))QTextTable::~QTextTable
+48 (int (*)(...))QTextTable::~QTextTable
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QTextTable
+ size=16 align=8
+ base size=16 base align=8
+QTextTable (0x0x7f1e752a9958) 0
+ vptr=((& QTextTable::_ZTV10QTextTable) + 16)
+ QTextFrame (0x0x7f1e752a99c0) 0
+ primary-for QTextTable (0x0x7f1e752a9958)
+ QTextObject (0x0x7f1e752a9a28) 0
+ primary-for QTextFrame (0x0x7f1e752a99c0)
+ QObject (0x0x7f1e7e1f8900) 0
+ primary-for QTextObject (0x0x7f1e752a9a28)
+
+Class QValidator::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QValidator::QPrivateSignal (0x0x7f1e7e1f8f00) 0 empty
+
+Vtable for QValidator
+QValidator::_ZTV10QValidator: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QValidator)
+16 (int (*)(...))QValidator::metaObject
+24 (int (*)(...))QValidator::qt_metacast
+32 (int (*)(...))QValidator::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))QValidator::fixup
+
+Class QValidator
+ size=16 align=8
+ base size=16 base align=8
+QValidator (0x0x7f1e752a9a90) 0
+ vptr=((& QValidator::_ZTV10QValidator) + 16)
+ QObject (0x0x7f1e7e1f8ea0) 0
+ primary-for QValidator (0x0x7f1e752a9a90)
+
+Class QIntValidator::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QIntValidator::QPrivateSignal (0x0x7f1e75446240) 0 empty
+
+Vtable for QIntValidator
+QIntValidator::_ZTV13QIntValidator: 17 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QIntValidator)
+16 (int (*)(...))QIntValidator::metaObject
+24 (int (*)(...))QIntValidator::qt_metacast
+32 (int (*)(...))QIntValidator::qt_metacall
+40 (int (*)(...))QIntValidator::~QIntValidator
+48 (int (*)(...))QIntValidator::~QIntValidator
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QIntValidator::validate
+120 (int (*)(...))QIntValidator::fixup
+128 (int (*)(...))QIntValidator::setRange
+
+Class QIntValidator
+ size=24 align=8
+ base size=24 base align=8
+QIntValidator (0x0x7f1e752a9af8) 0
+ vptr=((& QIntValidator::_ZTV13QIntValidator) + 16)
+ QValidator (0x0x7f1e752a9b60) 0
+ primary-for QIntValidator (0x0x7f1e752a9af8)
+ QObject (0x0x7f1e754461e0) 0
+ primary-for QValidator (0x0x7f1e752a9b60)
+
+Class QDoubleValidator::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QDoubleValidator::QPrivateSignal (0x0x7f1e75446480) 0 empty
+
+Vtable for QDoubleValidator
+QDoubleValidator::_ZTV16QDoubleValidator: 17 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QDoubleValidator)
+16 (int (*)(...))QDoubleValidator::metaObject
+24 (int (*)(...))QDoubleValidator::qt_metacast
+32 (int (*)(...))QDoubleValidator::qt_metacall
+40 (int (*)(...))QDoubleValidator::~QDoubleValidator
+48 (int (*)(...))QDoubleValidator::~QDoubleValidator
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QDoubleValidator::validate
+120 (int (*)(...))QValidator::fixup
+128 (int (*)(...))QDoubleValidator::setRange
+
+Class QDoubleValidator
+ size=40 align=8
+ base size=36 base align=8
+QDoubleValidator (0x0x7f1e752a9bc8) 0
+ vptr=((& QDoubleValidator::_ZTV16QDoubleValidator) + 16)
+ QValidator (0x0x7f1e752a9c30) 0
+ primary-for QDoubleValidator (0x0x7f1e752a9bc8)
+ QObject (0x0x7f1e75446420) 0
+ primary-for QValidator (0x0x7f1e752a9c30)
+
+Class QRegExpValidator::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QRegExpValidator::QPrivateSignal (0x0x7f1e75446900) 0 empty
+
+Vtable for QRegExpValidator
+QRegExpValidator::_ZTV16QRegExpValidator: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QRegExpValidator)
+16 (int (*)(...))QRegExpValidator::metaObject
+24 (int (*)(...))QRegExpValidator::qt_metacast
+32 (int (*)(...))QRegExpValidator::qt_metacall
+40 (int (*)(...))QRegExpValidator::~QRegExpValidator
+48 (int (*)(...))QRegExpValidator::~QRegExpValidator
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QRegExpValidator::validate
+120 (int (*)(...))QValidator::fixup
+
+Class QRegExpValidator
+ size=24 align=8
+ base size=24 base align=8
+QRegExpValidator (0x0x7f1e752a9c98) 0
+ vptr=((& QRegExpValidator::_ZTV16QRegExpValidator) + 16)
+ QValidator (0x0x7f1e752a9d00) 0
+ primary-for QRegExpValidator (0x0x7f1e752a9c98)
+ QObject (0x0x7f1e754468a0) 0
+ primary-for QValidator (0x0x7f1e752a9d00)
+
+Class QRegularExpressionValidator::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QRegularExpressionValidator::QPrivateSignal (0x0x7f1e75446ae0) 0 empty
+
+Vtable for QRegularExpressionValidator
+QRegularExpressionValidator::_ZTV27QRegularExpressionValidator: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI27QRegularExpressionValidator)
+16 (int (*)(...))QRegularExpressionValidator::metaObject
+24 (int (*)(...))QRegularExpressionValidator::qt_metacast
+32 (int (*)(...))QRegularExpressionValidator::qt_metacall
+40 (int (*)(...))QRegularExpressionValidator::~QRegularExpressionValidator
+48 (int (*)(...))QRegularExpressionValidator::~QRegularExpressionValidator
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QRegularExpressionValidator::validate
+120 (int (*)(...))QValidator::fixup
+
+Class QRegularExpressionValidator
+ size=16 align=8
+ base size=16 base align=8
+QRegularExpressionValidator (0x0x7f1e752a9d68) 0
+ vptr=((& QRegularExpressionValidator::_ZTV27QRegularExpressionValidator) + 16)
+ QValidator (0x0x7f1e752a9dd0) 0
+ primary-for QRegularExpressionValidator (0x0x7f1e752a9d68)
+ QObject (0x0x7f1e75446a80) 0
+ primary-for QValidator (0x0x7f1e752a9dd0)
+
+Class QNetworkRequest
+ size=8 align=8
+ base size=8 base align=8
+QNetworkRequest (0x0x7f1e75446cc0) 0
+
+Class QNetworkCacheMetaData
+ size=8 align=8
+ base size=8 base align=8
+QNetworkCacheMetaData (0x0x7f1e750f2180) 0
+
+Class QAbstractNetworkCache::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAbstractNetworkCache::QPrivateSignal (0x0x7f1e7513a660) 0 empty
+
+Vtable for QAbstractNetworkCache
+QAbstractNetworkCache::_ZTV21QAbstractNetworkCache: 22 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI21QAbstractNetworkCache)
+16 (int (*)(...))QAbstractNetworkCache::metaObject
+24 (int (*)(...))QAbstractNetworkCache::qt_metacast
+32 (int (*)(...))QAbstractNetworkCache::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))__cxa_pure_virtual
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))__cxa_pure_virtual
+160 (int (*)(...))__cxa_pure_virtual
+168 (int (*)(...))__cxa_pure_virtual
+
+Class QAbstractNetworkCache
+ size=16 align=8
+ base size=16 base align=8
+QAbstractNetworkCache (0x0x7f1e75137a90) 0
+ vptr=((& QAbstractNetworkCache::_ZTV21QAbstractNetworkCache) + 16)
+ QObject (0x0x7f1e7513a600) 0
+ primary-for QAbstractNetworkCache (0x0x7f1e75137a90)
+
+Class QAbstractSocket::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAbstractSocket::QPrivateSignal (0x0x7f1e7513a8a0) 0 empty
+
+Vtable for QAbstractSocket
+QAbstractSocket::_ZTV15QAbstractSocket: 41 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QAbstractSocket)
+16 (int (*)(...))QAbstractSocket::metaObject
+24 (int (*)(...))QAbstractSocket::qt_metacast
+32 (int (*)(...))QAbstractSocket::qt_metacall
+40 (int (*)(...))QAbstractSocket::~QAbstractSocket
+48 (int (*)(...))QAbstractSocket::~QAbstractSocket
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QAbstractSocket::isSequential
+120 (int (*)(...))QIODevice::open
+128 (int (*)(...))QAbstractSocket::close
+136 (int (*)(...))QIODevice::pos
+144 (int (*)(...))QIODevice::size
+152 (int (*)(...))QIODevice::seek
+160 (int (*)(...))QAbstractSocket::atEnd
+168 (int (*)(...))QIODevice::reset
+176 (int (*)(...))QAbstractSocket::bytesAvailable
+184 (int (*)(...))QAbstractSocket::bytesToWrite
+192 (int (*)(...))QAbstractSocket::canReadLine
+200 (int (*)(...))QAbstractSocket::waitForReadyRead
+208 (int (*)(...))QAbstractSocket::waitForBytesWritten
+216 (int (*)(...))QAbstractSocket::readData
+224 (int (*)(...))QAbstractSocket::readLineData
+232 (int (*)(...))QAbstractSocket::writeData
+240 (int (*)(...))QAbstractSocket::resume
+248 (int (*)(...))QAbstractSocket::connectToHost
+256 (int (*)(...))QAbstractSocket::connectToHost
+264 (int (*)(...))QAbstractSocket::disconnectFromHost
+272 (int (*)(...))QAbstractSocket::setReadBufferSize
+280 (int (*)(...))QAbstractSocket::socketDescriptor
+288 (int (*)(...))QAbstractSocket::setSocketDescriptor
+296 (int (*)(...))QAbstractSocket::setSocketOption
+304 (int (*)(...))QAbstractSocket::socketOption
+312 (int (*)(...))QAbstractSocket::waitForConnected
+320 (int (*)(...))QAbstractSocket::waitForDisconnected
+
+Class QAbstractSocket
+ size=16 align=8
+ base size=16 base align=8
+QAbstractSocket (0x0x7f1e75137af8) 0
+ vptr=((& QAbstractSocket::_ZTV15QAbstractSocket) + 16)
+ QIODevice (0x0x7f1e75137b60) 0
+ primary-for QAbstractSocket (0x0x7f1e75137af8)
+ QObject (0x0x7f1e7513a840) 0
+ primary-for QIODevice (0x0x7f1e75137b60)
+
+Class QAuthenticator
+ size=8 align=8
+ base size=8 base align=8
+QAuthenticator (0x0x7f1e751b5060) 0
+
+Class QDnsDomainNameRecord
+ size=8 align=8
+ base size=8 base align=8
+QDnsDomainNameRecord (0x0x7f1e751b5120) 0
+
+Class QDnsHostAddressRecord
+ size=8 align=8
+ base size=8 base align=8
+QDnsHostAddressRecord (0x0x7f1e752111e0) 0
+
+Class QDnsMailExchangeRecord
+ size=8 align=8
+ base size=8 base align=8
+QDnsMailExchangeRecord (0x0x7f1e7525b2a0) 0
+
+Class QDnsServiceRecord
+ size=8 align=8
+ base size=8 base align=8
+QDnsServiceRecord (0x0x7f1e74ea62a0) 0
+
+Class QDnsTextRecord
+ size=8 align=8
+ base size=8 base align=8
+QDnsTextRecord (0x0x7f1e74ef9180) 0
+
+Class QDnsLookup::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QDnsLookup::QPrivateSignal (0x0x7f1e74f4c1e0) 0 empty
+
+Vtable for QDnsLookup
+QDnsLookup::_ZTV10QDnsLookup: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QDnsLookup)
+16 (int (*)(...))QDnsLookup::metaObject
+24 (int (*)(...))QDnsLookup::qt_metacast
+32 (int (*)(...))QDnsLookup::qt_metacall
+40 (int (*)(...))QDnsLookup::~QDnsLookup
+48 (int (*)(...))QDnsLookup::~QDnsLookup
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QDnsLookup
+ size=16 align=8
+ base size=16 base align=8
+QDnsLookup (0x0x7f1e74f45a28) 0
+ vptr=((& QDnsLookup::_ZTV10QDnsLookup) + 16)
+ QObject (0x0x7f1e74f4c180) 0
+ primary-for QDnsLookup (0x0x7f1e74f45a28)
+
+Class QTcpSocket::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTcpSocket::QPrivateSignal (0x0x7f1e74f4c5a0) 0 empty
+
+Vtable for QTcpSocket
+QTcpSocket::_ZTV10QTcpSocket: 41 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QTcpSocket)
+16 (int (*)(...))QTcpSocket::metaObject
+24 (int (*)(...))QTcpSocket::qt_metacast
+32 (int (*)(...))QTcpSocket::qt_metacall
+40 (int (*)(...))QTcpSocket::~QTcpSocket
+48 (int (*)(...))QTcpSocket::~QTcpSocket
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QAbstractSocket::isSequential
+120 (int (*)(...))QIODevice::open
+128 (int (*)(...))QAbstractSocket::close
+136 (int (*)(...))QIODevice::pos
+144 (int (*)(...))QIODevice::size
+152 (int (*)(...))QIODevice::seek
+160 (int (*)(...))QAbstractSocket::atEnd
+168 (int (*)(...))QIODevice::reset
+176 (int (*)(...))QAbstractSocket::bytesAvailable
+184 (int (*)(...))QAbstractSocket::bytesToWrite
+192 (int (*)(...))QAbstractSocket::canReadLine
+200 (int (*)(...))QAbstractSocket::waitForReadyRead
+208 (int (*)(...))QAbstractSocket::waitForBytesWritten
+216 (int (*)(...))QAbstractSocket::readData
+224 (int (*)(...))QAbstractSocket::readLineData
+232 (int (*)(...))QAbstractSocket::writeData
+240 (int (*)(...))QAbstractSocket::resume
+248 (int (*)(...))QAbstractSocket::connectToHost
+256 (int (*)(...))QAbstractSocket::connectToHost
+264 (int (*)(...))QAbstractSocket::disconnectFromHost
+272 (int (*)(...))QAbstractSocket::setReadBufferSize
+280 (int (*)(...))QAbstractSocket::socketDescriptor
+288 (int (*)(...))QAbstractSocket::setSocketDescriptor
+296 (int (*)(...))QAbstractSocket::setSocketOption
+304 (int (*)(...))QAbstractSocket::socketOption
+312 (int (*)(...))QAbstractSocket::waitForConnected
+320 (int (*)(...))QAbstractSocket::waitForDisconnected
+
+Class QTcpSocket
+ size=16 align=8
+ base size=16 base align=8
+QTcpSocket (0x0x7f1e74f45a90) 0
+ vptr=((& QTcpSocket::_ZTV10QTcpSocket) + 16)
+ QAbstractSocket (0x0x7f1e74f45af8) 0
+ primary-for QTcpSocket (0x0x7f1e74f45a90)
+ QIODevice (0x0x7f1e74f45b60) 0
+ primary-for QAbstractSocket (0x0x7f1e74f45af8)
+ QObject (0x0x7f1e74f4c540) 0
+ primary-for QIODevice (0x0x7f1e74f45b60)
+
+Class QSslCertificate
+ size=8 align=8
+ base size=8 base align=8
+QSslCertificate (0x0x7f1e74f4ce40) 0
+
+Class QSslError
+ size=8 align=8
+ base size=8 base align=8
+QSslError (0x0x7f1e74cfe6c0) 0
+
+Class QSslSocket::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSslSocket::QPrivateSignal (0x0x7f1e74dbd960) 0 empty
+
+Vtable for QSslSocket
+QSslSocket::_ZTV10QSslSocket: 41 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QSslSocket)
+16 (int (*)(...))QSslSocket::metaObject
+24 (int (*)(...))QSslSocket::qt_metacast
+32 (int (*)(...))QSslSocket::qt_metacall
+40 (int (*)(...))QSslSocket::~QSslSocket
+48 (int (*)(...))QSslSocket::~QSslSocket
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QAbstractSocket::isSequential
+120 (int (*)(...))QIODevice::open
+128 (int (*)(...))QSslSocket::close
+136 (int (*)(...))QIODevice::pos
+144 (int (*)(...))QIODevice::size
+152 (int (*)(...))QIODevice::seek
+160 (int (*)(...))QSslSocket::atEnd
+168 (int (*)(...))QIODevice::reset
+176 (int (*)(...))QSslSocket::bytesAvailable
+184 (int (*)(...))QSslSocket::bytesToWrite
+192 (int (*)(...))QSslSocket::canReadLine
+200 (int (*)(...))QSslSocket::waitForReadyRead
+208 (int (*)(...))QSslSocket::waitForBytesWritten
+216 (int (*)(...))QSslSocket::readData
+224 (int (*)(...))QAbstractSocket::readLineData
+232 (int (*)(...))QSslSocket::writeData
+240 (int (*)(...))QSslSocket::resume
+248 (int (*)(...))QSslSocket::connectToHost
+256 (int (*)(...))QAbstractSocket::connectToHost
+264 (int (*)(...))QSslSocket::disconnectFromHost
+272 (int (*)(...))QSslSocket::setReadBufferSize
+280 (int (*)(...))QAbstractSocket::socketDescriptor
+288 (int (*)(...))QSslSocket::setSocketDescriptor
+296 (int (*)(...))QSslSocket::setSocketOption
+304 (int (*)(...))QSslSocket::socketOption
+312 (int (*)(...))QSslSocket::waitForConnected
+320 (int (*)(...))QSslSocket::waitForDisconnected
+
+Class QSslSocket
+ size=16 align=8
+ base size=16 base align=8
+QSslSocket (0x0x7f1e74dba820) 0
+ vptr=((& QSslSocket::_ZTV10QSslSocket) + 16)
+ QTcpSocket (0x0x7f1e74dba888) 0
+ primary-for QSslSocket (0x0x7f1e74dba820)
+ QAbstractSocket (0x0x7f1e74dba8f0) 0
+ primary-for QTcpSocket (0x0x7f1e74dba888)
+ QIODevice (0x0x7f1e74dba958) 0
+ primary-for QAbstractSocket (0x0x7f1e74dba8f0)
+ QObject (0x0x7f1e74dbd900) 0
+ primary-for QIODevice (0x0x7f1e74dba958)
+
+Class QDtlsClientVerifier::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QDtlsClientVerifier::QPrivateSignal (0x0x7f1e74dbdba0) 0 empty
+
+Class QDtlsClientVerifier::GeneratorParameters
+ size=16 align=8
+ base size=16 base align=8
+QDtlsClientVerifier::GeneratorParameters (0x0x7f1e74dbdc00) 0
+
+Vtable for QDtlsClientVerifier
+QDtlsClientVerifier::_ZTV19QDtlsClientVerifier: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QDtlsClientVerifier)
+16 (int (*)(...))QDtlsClientVerifier::metaObject
+24 (int (*)(...))QDtlsClientVerifier::qt_metacast
+32 (int (*)(...))QDtlsClientVerifier::qt_metacall
+40 (int (*)(...))QDtlsClientVerifier::~QDtlsClientVerifier
+48 (int (*)(...))QDtlsClientVerifier::~QDtlsClientVerifier
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QDtlsClientVerifier
+ size=16 align=8
+ base size=16 base align=8
+QDtlsClientVerifier (0x0x7f1e74dba9c0) 0
+ vptr=((& QDtlsClientVerifier::_ZTV19QDtlsClientVerifier) + 16)
+ QObject (0x0x7f1e74dbdb40) 0
+ primary-for QDtlsClientVerifier (0x0x7f1e74dba9c0)
+
+Class QDtls::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QDtls::QPrivateSignal (0x0x7f1e74dbde40) 0 empty
+
+Vtable for QDtls
+QDtls::_ZTV5QDtls: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI5QDtls)
+16 (int (*)(...))QDtls::metaObject
+24 (int (*)(...))QDtls::qt_metacast
+32 (int (*)(...))QDtls::qt_metacall
+40 (int (*)(...))QDtls::~QDtls
+48 (int (*)(...))QDtls::~QDtls
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QDtls
+ size=16 align=8
+ base size=16 base align=8
+QDtls (0x0x7f1e74dbaa28) 0
+ vptr=((& QDtls::_ZTV5QDtls) + 16)
+ QObject (0x0x7f1e74dbdde0) 0
+ primary-for QDtls (0x0x7f1e74dbaa28)
+
+Class QIPv6Address
+ size=16 align=1
+ base size=16 base align=1
+QIPv6Address (0x0x7f1e7f7e90c0) 0
+
+Class QHostAddress
+ size=8 align=8
+ base size=8 base align=8
+QHostAddress (0x0x7f1e7f7e91e0) 0
+
+Class QHostInfo
+ size=8 align=8
+ base size=8 base align=8
+QHostInfo (0x0x7f1e7eac6f60) 0
+
+Class QHstsPolicy
+ size=8 align=8
+ base size=8 base align=8
+QHstsPolicy (0x0x7f1e7c7af660) 0
+
+Class QHttp2Configuration
+ size=8 align=8
+ base size=8 base align=8
+QHttp2Configuration (0x0x7f1e7b8a3d80) 0
+
+Class QHttpPart
+ size=8 align=8
+ base size=8 base align=8
+QHttpPart (0x0x7f1e7aa57300) 0
+
+Class QHttpMultiPart::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QHttpMultiPart::QPrivateSignal (0x0x7f1e7940cf60) 0 empty
+
+Vtable for QHttpMultiPart
+QHttpMultiPart::_ZTV14QHttpMultiPart: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QHttpMultiPart)
+16 (int (*)(...))QHttpMultiPart::metaObject
+24 (int (*)(...))QHttpMultiPart::qt_metacast
+32 (int (*)(...))QHttpMultiPart::qt_metacall
+40 (int (*)(...))QHttpMultiPart::~QHttpMultiPart
+48 (int (*)(...))QHttpMultiPart::~QHttpMultiPart
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QHttpMultiPart
+ size=16 align=8
+ base size=16 base align=8
+QHttpMultiPart (0x0x7f1e792431a0) 0
+ vptr=((& QHttpMultiPart::_ZTV14QHttpMultiPart) + 16)
+ QObject (0x0x7f1e7940cf00) 0
+ primary-for QHttpMultiPart (0x0x7f1e792431a0)
+
+Class QLocalServer::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QLocalServer::QPrivateSignal (0x0x7f1e78e411e0) 0 empty
+
+Vtable for QLocalServer
+QLocalServer::_ZTV12QLocalServer: 17 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QLocalServer)
+16 (int (*)(...))QLocalServer::metaObject
+24 (int (*)(...))QLocalServer::qt_metacast
+32 (int (*)(...))QLocalServer::qt_metacall
+40 (int (*)(...))QLocalServer::~QLocalServer
+48 (int (*)(...))QLocalServer::~QLocalServer
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QLocalServer::hasPendingConnections
+120 (int (*)(...))QLocalServer::nextPendingConnection
+128 (int (*)(...))QLocalServer::incomingConnection
+
+Class QLocalServer
+ size=16 align=8
+ base size=16 base align=8
+QLocalServer (0x0x7f1e79243208) 0
+ vptr=((& QLocalServer::_ZTV12QLocalServer) + 16)
+ QObject (0x0x7f1e78e41180) 0
+ primary-for QLocalServer (0x0x7f1e79243208)
+
+Class QLocalSocket::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QLocalSocket::QPrivateSignal (0x0x7f1e78e41c60) 0 empty
+
+Vtable for QLocalSocket
+QLocalSocket::_ZTV12QLocalSocket: 30 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QLocalSocket)
+16 (int (*)(...))QLocalSocket::metaObject
+24 (int (*)(...))QLocalSocket::qt_metacast
+32 (int (*)(...))QLocalSocket::qt_metacall
+40 (int (*)(...))QLocalSocket::~QLocalSocket
+48 (int (*)(...))QLocalSocket::~QLocalSocket
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QLocalSocket::isSequential
+120 (int (*)(...))QLocalSocket::open
+128 (int (*)(...))QLocalSocket::close
+136 (int (*)(...))QIODevice::pos
+144 (int (*)(...))QIODevice::size
+152 (int (*)(...))QIODevice::seek
+160 (int (*)(...))QIODevice::atEnd
+168 (int (*)(...))QIODevice::reset
+176 (int (*)(...))QLocalSocket::bytesAvailable
+184 (int (*)(...))QLocalSocket::bytesToWrite
+192 (int (*)(...))QLocalSocket::canReadLine
+200 (int (*)(...))QLocalSocket::waitForReadyRead
+208 (int (*)(...))QLocalSocket::waitForBytesWritten
+216 (int (*)(...))QLocalSocket::readData
+224 (int (*)(...))QIODevice::readLineData
+232 (int (*)(...))QLocalSocket::writeData
+
+Class QLocalSocket
+ size=16 align=8
+ base size=16 base align=8
+QLocalSocket (0x0x7f1e792433a8) 0
+ vptr=((& QLocalSocket::_ZTV12QLocalSocket) + 16)
+ QIODevice (0x0x7f1e79243410) 0
+ primary-for QLocalSocket (0x0x7f1e792433a8)
+ QObject (0x0x7f1e78e41c00) 0
+ primary-for QIODevice (0x0x7f1e79243410)
+
+Class QSslConfiguration
+ size=8 align=8
+ base size=8 base align=8
+QSslConfiguration (0x0x7f1e78e41ea0) 0
+
+Class QSslPreSharedKeyAuthenticator
+ size=8 align=8
+ base size=8 base align=8
+QSslPreSharedKeyAuthenticator (0x0x7f1e76d443c0) 0
+
+Class QNetworkAccessManager::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QNetworkAccessManager::QPrivateSignal (0x0x7f1e75e33a20) 0 empty
+
+Vtable for QNetworkAccessManager
+QNetworkAccessManager::_ZTV21QNetworkAccessManager: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI21QNetworkAccessManager)
+16 (int (*)(...))QNetworkAccessManager::metaObject
+24 (int (*)(...))QNetworkAccessManager::qt_metacast
+32 (int (*)(...))QNetworkAccessManager::qt_metacall
+40 (int (*)(...))QNetworkAccessManager::~QNetworkAccessManager
+48 (int (*)(...))QNetworkAccessManager::~QNetworkAccessManager
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QNetworkAccessManager::createRequest
+
+Class QNetworkAccessManager
+ size=16 align=8
+ base size=16 base align=8
+QNetworkAccessManager (0x0x7f1e75dee8f0) 0
+ vptr=((& QNetworkAccessManager::_ZTV21QNetworkAccessManager) + 16)
+ QObject (0x0x7f1e75e339c0) 0
+ primary-for QNetworkAccessManager (0x0x7f1e75dee8f0)
+
+Class QNetworkConfiguration
+ size=8 align=8
+ base size=8 base align=8
+QNetworkConfiguration (0x0x7f1e75e33cc0) 0
+
+Class QNetworkConfigurationManager::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QNetworkConfigurationManager::QPrivateSignal (0x0x7f1e7db2d0c0) 0 empty
+
+Vtable for QNetworkConfigurationManager
+QNetworkConfigurationManager::_ZTV28QNetworkConfigurationManager: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI28QNetworkConfigurationManager)
+16 (int (*)(...))QNetworkConfigurationManager::metaObject
+24 (int (*)(...))QNetworkConfigurationManager::qt_metacast
+32 (int (*)(...))QNetworkConfigurationManager::qt_metacall
+40 (int (*)(...))QNetworkConfigurationManager::~QNetworkConfigurationManager
+48 (int (*)(...))QNetworkConfigurationManager::~QNetworkConfigurationManager
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QNetworkConfigurationManager
+ size=16 align=8
+ base size=16 base align=8
+QNetworkConfigurationManager (0x0x7f1e7eab2bc8) 0
+ vptr=((& QNetworkConfigurationManager::_ZTV28QNetworkConfigurationManager) + 16)
+ QObject (0x0x7f1e7db2d060) 0
+ primary-for QNetworkConfigurationManager (0x0x7f1e7eab2bc8)
+
+Class QNetworkCookie
+ size=8 align=8
+ base size=8 base align=8
+QNetworkCookie (0x0x7f1e7db2dc00) 0
+
+Class QNetworkCookieJar::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QNetworkCookieJar::QPrivateSignal (0x0x7f1e7b154240) 0 empty
+
+Vtable for QNetworkCookieJar
+QNetworkCookieJar::_ZTV17QNetworkCookieJar: 20 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QNetworkCookieJar)
+16 (int (*)(...))QNetworkCookieJar::metaObject
+24 (int (*)(...))QNetworkCookieJar::qt_metacast
+32 (int (*)(...))QNetworkCookieJar::qt_metacall
+40 (int (*)(...))QNetworkCookieJar::~QNetworkCookieJar
+48 (int (*)(...))QNetworkCookieJar::~QNetworkCookieJar
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QNetworkCookieJar::cookiesForUrl
+120 (int (*)(...))QNetworkCookieJar::setCookiesFromUrl
+128 (int (*)(...))QNetworkCookieJar::insertCookie
+136 (int (*)(...))QNetworkCookieJar::updateCookie
+144 (int (*)(...))QNetworkCookieJar::deleteCookie
+152 (int (*)(...))QNetworkCookieJar::validateCookie
+
+Class QNetworkCookieJar
+ size=16 align=8
+ base size=16 base align=8
+QNetworkCookieJar (0x0x7f1e7b3a7e38) 0
+ vptr=((& QNetworkCookieJar::_ZTV17QNetworkCookieJar) + 16)
+ QObject (0x0x7f1e7b1541e0) 0
+ primary-for QNetworkCookieJar (0x0x7f1e7b3a7e38)
+
+Class QNetworkDatagram
+ size=8 align=8
+ base size=8 base align=8
+QNetworkDatagram (0x0x7f1e7b154420) 0
+
+Class QNetworkDiskCache::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QNetworkDiskCache::QPrivateSignal (0x0x7f1e78e22f60) 0 empty
+
+Vtable for QNetworkDiskCache
+QNetworkDiskCache::_ZTV17QNetworkDiskCache: 23 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QNetworkDiskCache)
+16 (int (*)(...))QNetworkDiskCache::metaObject
+24 (int (*)(...))QNetworkDiskCache::qt_metacast
+32 (int (*)(...))QNetworkDiskCache::qt_metacall
+40 (int (*)(...))QNetworkDiskCache::~QNetworkDiskCache
+48 (int (*)(...))QNetworkDiskCache::~QNetworkDiskCache
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QNetworkDiskCache::metaData
+120 (int (*)(...))QNetworkDiskCache::updateMetaData
+128 (int (*)(...))QNetworkDiskCache::data
+136 (int (*)(...))QNetworkDiskCache::remove
+144 (int (*)(...))QNetworkDiskCache::cacheSize
+152 (int (*)(...))QNetworkDiskCache::prepare
+160 (int (*)(...))QNetworkDiskCache::insert
+168 (int (*)(...))QNetworkDiskCache::clear
+176 (int (*)(...))QNetworkDiskCache::expire
+
+Class QNetworkDiskCache
+ size=16 align=8
+ base size=16 base align=8
+QNetworkDiskCache (0x0x7f1e78e3fd00) 0
+ vptr=((& QNetworkDiskCache::_ZTV17QNetworkDiskCache) + 16)
+ QAbstractNetworkCache (0x0x7f1e78e3fd68) 0
+ primary-for QNetworkDiskCache (0x0x7f1e78e3fd00)
+ QObject (0x0x7f1e78e22f00) 0
+ primary-for QAbstractNetworkCache (0x0x7f1e78e3fd68)
+
+Class QNetworkAddressEntry
+ size=8 align=8
+ base size=8 base align=8
+QNetworkAddressEntry (0x0x7f1e786c4180) 0
+
+Class QNetworkInterface
+ size=8 align=8
+ base size=8 base align=8
+QNetworkInterface (0x0x7f1e76b3c120) 0
+
+Class QNetworkProxyQuery
+ size=8 align=8
+ base size=8 base align=8
+QNetworkProxyQuery (0x0x7f1e74ab7c00) 0
+
+Class QNetworkProxy
+ size=8 align=8
+ base size=8 base align=8
+QNetworkProxy (0x0x7f1e7b2ddf00) 0
+
+Vtable for QNetworkProxyFactory
+QNetworkProxyFactory::_ZTV20QNetworkProxyFactory: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QNetworkProxyFactory)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+
+Class QNetworkProxyFactory
+ size=8 align=8
+ base size=8 base align=8
+QNetworkProxyFactory (0x0x7f1e761b0780) 0 nearly-empty
+ vptr=((& QNetworkProxyFactory::_ZTV20QNetworkProxyFactory) + 16)
+
+Class QNetworkReply::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QNetworkReply::QPrivateSignal (0x0x7f1e761b0a20) 0 empty
+
+Vtable for QNetworkReply
+QNetworkReply::_ZTV13QNetworkReply: 36 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QNetworkReply)
+16 (int (*)(...))QNetworkReply::metaObject
+24 (int (*)(...))QNetworkReply::qt_metacast
+32 (int (*)(...))QNetworkReply::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QNetworkReply::isSequential
+120 (int (*)(...))QIODevice::open
+128 (int (*)(...))QNetworkReply::close
+136 (int (*)(...))QIODevice::pos
+144 (int (*)(...))QIODevice::size
+152 (int (*)(...))QIODevice::seek
+160 (int (*)(...))QIODevice::atEnd
+168 (int (*)(...))QIODevice::reset
+176 (int (*)(...))QIODevice::bytesAvailable
+184 (int (*)(...))QIODevice::bytesToWrite
+192 (int (*)(...))QIODevice::canReadLine
+200 (int (*)(...))QIODevice::waitForReadyRead
+208 (int (*)(...))QIODevice::waitForBytesWritten
+216 (int (*)(...))__cxa_pure_virtual
+224 (int (*)(...))QIODevice::readLineData
+232 (int (*)(...))QNetworkReply::writeData
+240 (int (*)(...))QNetworkReply::setReadBufferSize
+248 (int (*)(...))__cxa_pure_virtual
+256 (int (*)(...))QNetworkReply::ignoreSslErrors
+264 (int (*)(...))QNetworkReply::sslConfigurationImplementation
+272 (int (*)(...))QNetworkReply::setSslConfigurationImplementation
+280 (int (*)(...))QNetworkReply::ignoreSslErrorsImplementation
+
+Class QNetworkReply
+ size=16 align=8
+ base size=16 base align=8
+QNetworkReply (0x0x7f1e761a21a0) 0
+ vptr=((& QNetworkReply::_ZTV13QNetworkReply) + 16)
+ QIODevice (0x0x7f1e761a2208) 0
+ primary-for QNetworkReply (0x0x7f1e761a21a0)
+ QObject (0x0x7f1e761b09c0) 0
+ primary-for QIODevice (0x0x7f1e761a2208)
+
+Class QNetworkSession::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QNetworkSession::QPrivateSignal (0x0x7f1e761b0f60) 0 empty
+
+Vtable for QNetworkSession
+QNetworkSession::_ZTV15QNetworkSession: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QNetworkSession)
+16 (int (*)(...))QNetworkSession::metaObject
+24 (int (*)(...))QNetworkSession::qt_metacast
+32 (int (*)(...))QNetworkSession::qt_metacall
+40 (int (*)(...))QNetworkSession::~QNetworkSession
+48 (int (*)(...))QNetworkSession::~QNetworkSession
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QNetworkSession::connectNotify
+104 (int (*)(...))QNetworkSession::disconnectNotify
+
+Class QNetworkSession
+ size=24 align=8
+ base size=24 base align=8
+QNetworkSession (0x0x7f1e761a2270) 0
+ vptr=((& QNetworkSession::_ZTV15QNetworkSession) + 16)
+ QObject (0x0x7f1e761b0f00) 0
+ primary-for QNetworkSession (0x0x7f1e761a2270)
+
+Class QOcspResponse
+ size=8 align=8
+ base size=8 base align=8
+QOcspResponse (0x0x7f1e74cd97e0) 0
+
+Class QTcpServer::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTcpServer::QPrivateSignal (0x0x7f1e74de3060) 0 empty
+
+Vtable for QTcpServer
+QTcpServer::_ZTV10QTcpServer: 17 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QTcpServer)
+16 (int (*)(...))QTcpServer::metaObject
+24 (int (*)(...))QTcpServer::qt_metacast
+32 (int (*)(...))QTcpServer::qt_metacall
+40 (int (*)(...))QTcpServer::~QTcpServer
+48 (int (*)(...))QTcpServer::~QTcpServer
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QTcpServer::hasPendingConnections
+120 (int (*)(...))QTcpServer::nextPendingConnection
+128 (int (*)(...))QTcpServer::incomingConnection
+
+Class QTcpServer
+ size=16 align=8
+ base size=16 base align=8
+QTcpServer (0x0x7f1e74da6af8) 0
+ vptr=((& QTcpServer::_ZTV10QTcpServer) + 16)
+ QObject (0x0x7f1e74de3000) 0
+ primary-for QTcpServer (0x0x7f1e74da6af8)
+
+Class QSslCertificateExtension
+ size=8 align=8
+ base size=8 base align=8
+QSslCertificateExtension (0x0x7f1e74de3240) 0
+
+Class QSslCipher
+ size=8 align=8
+ base size=8 base align=8
+QSslCipher (0x0x7f1e74d2b1e0) 0
+
+Class QSslDiffieHellmanParameters
+ size=8 align=8
+ base size=8 base align=8
+QSslDiffieHellmanParameters (0x0x7f1e7bb002a0) 0
+
+Class QSslEllipticCurve
+ size=4 align=4
+ base size=4 base align=4
+QSslEllipticCurve (0x0x7f1e79e3e000) 0
+
+Class QSslKey
+ size=8 align=8
+ base size=8 base align=8
+QSslKey (0x0x7f1e77afb960) 0
+
+Class QUdpSocket::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QUdpSocket::QPrivateSignal (0x0x7f1e77ac1840) 0 empty
+
+Vtable for QUdpSocket
+QUdpSocket::_ZTV10QUdpSocket: 41 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QUdpSocket)
+16 (int (*)(...))QUdpSocket::metaObject
+24 (int (*)(...))QUdpSocket::qt_metacast
+32 (int (*)(...))QUdpSocket::qt_metacall
+40 (int (*)(...))QUdpSocket::~QUdpSocket
+48 (int (*)(...))QUdpSocket::~QUdpSocket
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QAbstractSocket::isSequential
+120 (int (*)(...))QIODevice::open
+128 (int (*)(...))QAbstractSocket::close
+136 (int (*)(...))QIODevice::pos
+144 (int (*)(...))QIODevice::size
+152 (int (*)(...))QIODevice::seek
+160 (int (*)(...))QAbstractSocket::atEnd
+168 (int (*)(...))QIODevice::reset
+176 (int (*)(...))QAbstractSocket::bytesAvailable
+184 (int (*)(...))QAbstractSocket::bytesToWrite
+192 (int (*)(...))QAbstractSocket::canReadLine
+200 (int (*)(...))QAbstractSocket::waitForReadyRead
+208 (int (*)(...))QAbstractSocket::waitForBytesWritten
+216 (int (*)(...))QAbstractSocket::readData
+224 (int (*)(...))QAbstractSocket::readLineData
+232 (int (*)(...))QAbstractSocket::writeData
+240 (int (*)(...))QAbstractSocket::resume
+248 (int (*)(...))QAbstractSocket::connectToHost
+256 (int (*)(...))QAbstractSocket::connectToHost
+264 (int (*)(...))QAbstractSocket::disconnectFromHost
+272 (int (*)(...))QAbstractSocket::setReadBufferSize
+280 (int (*)(...))QAbstractSocket::socketDescriptor
+288 (int (*)(...))QAbstractSocket::setSocketDescriptor
+296 (int (*)(...))QAbstractSocket::setSocketOption
+304 (int (*)(...))QAbstractSocket::socketOption
+312 (int (*)(...))QAbstractSocket::waitForConnected
+320 (int (*)(...))QAbstractSocket::waitForDisconnected
+
+Class QUdpSocket
+ size=16 align=8
+ base size=16 base align=8
+QUdpSocket (0x0x7f1e77acc0d0) 0
+ vptr=((& QUdpSocket::_ZTV10QUdpSocket) + 16)
+ QAbstractSocket (0x0x7f1e77acc138) 0
+ primary-for QUdpSocket (0x0x7f1e77acc0d0)
+ QIODevice (0x0x7f1e77acc1a0) 0
+ primary-for QAbstractSocket (0x0x7f1e77acc138)
+ QObject (0x0x7f1e77ac17e0) 0
+ primary-for QIODevice (0x0x7f1e77acc1a0)
+
+Class QJSValue
+ size=8 align=8
+ base size=8 base align=8
+QJSValue (0x0x7f1e77ac1a80) 0
+
+Class QQmlDebuggingEnabler
+ size=1 align=1
+ base size=0 base align=1
+QQmlDebuggingEnabler (0x0x7f1e7704d000) 0 empty
+
+Class QJSEngine::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QJSEngine::QPrivateSignal (0x0x7f1e7704d0c0) 0 empty
+
+Vtable for QJSEngine
+QJSEngine::_ZTV9QJSEngine: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QJSEngine)
+16 (int (*)(...))QJSEngine::metaObject
+24 (int (*)(...))QJSEngine::qt_metacast
+32 (int (*)(...))QJSEngine::qt_metacall
+40 (int (*)(...))QJSEngine::~QJSEngine
+48 (int (*)(...))QJSEngine::~QJSEngine
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QJSEngine
+ size=24 align=8
+ base size=24 base align=8
+QJSEngine (0x0x7f1e77acc270) 0
+ vptr=((& QJSEngine::_ZTV9QJSEngine) + 16)
+ QObject (0x0x7f1e7704d060) 0
+ primary-for QJSEngine (0x0x7f1e77acc270)
+
+Class QJSValueIterator
+ size=8 align=8
+ base size=8 base align=8
+QJSValueIterator (0x0x7f1e7704dc00) 0
+
+Vtable for QQmlParserStatus
+QQmlParserStatus::_ZTV16QQmlParserStatus: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QQmlParserStatus)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+
+Class QQmlParserStatus
+ size=16 align=8
+ base size=16 base align=8
+QQmlParserStatus (0x0x7f1e7704dde0) 0
+ vptr=((& QQmlParserStatus::_ZTV16QQmlParserStatus) + 16)
+
+Class QQmlListReference
+ size=8 align=8
+ base size=8 base align=8
+QQmlListReference (0x0x7f1e763bc9c0) 0
+
+Vtable for QQmlPropertyValueSource
+QQmlPropertyValueSource::_ZTV23QQmlPropertyValueSource: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI23QQmlPropertyValueSource)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+
+Class QQmlPropertyValueSource
+ size=8 align=8
+ base size=8 base align=8
+QQmlPropertyValueSource (0x0x7f1e763bcc00) 0 nearly-empty
+ vptr=((& QQmlPropertyValueSource::_ZTV23QQmlPropertyValueSource) + 16)
+
+Class QQmlPrivate::RegisterType
+ size=128 align=8
+ base size=124 base align=8
+QQmlPrivate::RegisterType (0x0x7f1e7601dde0) 0
+
+Class QQmlPrivate::RegisterTypeAndRevisions
+ size=112 align=8
+ base size=112 base align=8
+QQmlPrivate::RegisterTypeAndRevisions (0x0x7f1e7601de40) 0
+
+Class QQmlPrivate::RegisterInterface
+ size=40 align=8
+ base size=40 base align=8
+QQmlPrivate::RegisterInterface (0x0x7f1e7601dea0) 0
+
+Class QQmlPrivate::RegisterAutoParent
+ size=16 align=8
+ base size=16 base align=8
+QQmlPrivate::RegisterAutoParent (0x0x7f1e7601df00) 0
+
+Class QQmlPrivate::RegisterSingletonType
+ size=96 align=8
+ base size=96 base align=8
+QQmlPrivate::RegisterSingletonType (0x0x7f1e7601df60) 0
+
+Class QQmlPrivate::RegisterSingletonTypeAndRevisions
+ size=88 align=8
+ base size=88 base align=8
+QQmlPrivate::RegisterSingletonTypeAndRevisions (0x0x7f1e75d05180) 0
+
+Class QQmlPrivate::RegisterCompositeType
+ size=32 align=8
+ base size=32 base align=8
+QQmlPrivate::RegisterCompositeType (0x0x7f1e75d051e0) 0
+
+Class QQmlPrivate::RegisterCompositeSingletonType
+ size=32 align=8
+ base size=32 base align=8
+QQmlPrivate::RegisterCompositeSingletonType (0x0x7f1e75d05240) 0
+
+Class QQmlPrivate::CachedQmlUnit
+ size=24 align=8
+ base size=24 base align=8
+QQmlPrivate::CachedQmlUnit (0x0x7f1e75d052a0) 0
+
+Class QQmlPrivate::RegisterQmlUnitCacheHook
+ size=16 align=8
+ base size=16 base align=8
+QQmlPrivate::RegisterQmlUnitCacheHook (0x0x7f1e75d05300) 0
+
+Class QQmlPrivate::RegisterSingletonFunctor
+ size=24 align=8
+ base size=17 base align=8
+QQmlPrivate::RegisterSingletonFunctor (0x0x7f1e75d05360) 0
+
+Vtable for QQmlAbstractUrlInterceptor
+QQmlAbstractUrlInterceptor::_ZTV26QQmlAbstractUrlInterceptor: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI26QQmlAbstractUrlInterceptor)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+
+Class QQmlAbstractUrlInterceptor
+ size=8 align=8
+ base size=8 base align=8
+QQmlAbstractUrlInterceptor (0x0x7f1e736124e0) 0 nearly-empty
+ vptr=((& QQmlAbstractUrlInterceptor::_ZTV26QQmlAbstractUrlInterceptor) + 16)
+
+Class QQmlError
+ size=8 align=8
+ base size=8 base align=8
+QQmlError (0x0x7f1e73612540) 0
+
+Vtable for QQmlImageProviderBase
+QQmlImageProviderBase::_ZTV21QQmlImageProviderBase: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI21QQmlImageProviderBase)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+
+Class QQmlImageProviderBase
+ size=8 align=8
+ base size=8 base align=8
+QQmlImageProviderBase (0x0x7f1e73630480) 0 nearly-empty
+ vptr=((& QQmlImageProviderBase::_ZTV21QQmlImageProviderBase) + 16)
+
+Class QQmlEngine::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQmlEngine::QPrivateSignal (0x0x7f1e73630c00) 0 empty
+
+Vtable for QQmlEngine
+QQmlEngine::_ZTV10QQmlEngine: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QQmlEngine)
+16 (int (*)(...))QQmlEngine::metaObject
+24 (int (*)(...))QQmlEngine::qt_metacast
+32 (int (*)(...))QQmlEngine::qt_metacall
+40 (int (*)(...))QQmlEngine::~QQmlEngine
+48 (int (*)(...))QQmlEngine::~QQmlEngine
+56 (int (*)(...))QQmlEngine::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QQmlEngine
+ size=24 align=8
+ base size=24 base align=8
+QQmlEngine (0x0x7f1e73637068) 0
+ vptr=((& QQmlEngine::_ZTV10QQmlEngine) + 16)
+ QJSEngine (0x0x7f1e736370d0) 0
+ primary-for QQmlEngine (0x0x7f1e73637068)
+ QObject (0x0x7f1e73630ba0) 0
+ primary-for QJSEngine (0x0x7f1e736370d0)
+
+Class QQmlApplicationEngine::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQmlApplicationEngine::QPrivateSignal (0x0x7f1e73630ea0) 0 empty
+
+Vtable for QQmlApplicationEngine
+QQmlApplicationEngine::_ZTV21QQmlApplicationEngine: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI21QQmlApplicationEngine)
+16 (int (*)(...))QQmlApplicationEngine::metaObject
+24 (int (*)(...))QQmlApplicationEngine::qt_metacast
+32 (int (*)(...))QQmlApplicationEngine::qt_metacall
+40 (int (*)(...))QQmlApplicationEngine::~QQmlApplicationEngine
+48 (int (*)(...))QQmlApplicationEngine::~QQmlApplicationEngine
+56 (int (*)(...))QQmlEngine::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QQmlApplicationEngine
+ size=24 align=8
+ base size=24 base align=8
+QQmlApplicationEngine (0x0x7f1e73637138) 0
+ vptr=((& QQmlApplicationEngine::_ZTV21QQmlApplicationEngine) + 16)
+ QQmlEngine (0x0x7f1e736371a0) 0
+ primary-for QQmlApplicationEngine (0x0x7f1e73637138)
+ QJSEngine (0x0x7f1e73637208) 0
+ primary-for QQmlEngine (0x0x7f1e736371a0)
+ QObject (0x0x7f1e73630e40) 0
+ primary-for QJSEngine (0x0x7f1e73637208)
+
+Class QQmlComponent::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQmlComponent::QPrivateSignal (0x0x7f1e73657120) 0 empty
+
+Vtable for QQmlComponent
+QQmlComponent::_ZTV13QQmlComponent: 17 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QQmlComponent)
+16 (int (*)(...))QQmlComponent::metaObject
+24 (int (*)(...))QQmlComponent::qt_metacast
+32 (int (*)(...))QQmlComponent::qt_metacall
+40 (int (*)(...))QQmlComponent::~QQmlComponent
+48 (int (*)(...))QQmlComponent::~QQmlComponent
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QQmlComponent::create
+120 (int (*)(...))QQmlComponent::beginCreate
+128 (int (*)(...))QQmlComponent::completeCreate
+
+Class QQmlComponent
+ size=16 align=8
+ base size=16 base align=8
+QQmlComponent (0x0x7f1e73637270) 0
+ vptr=((& QQmlComponent::_ZTV13QQmlComponent) + 16)
+ QObject (0x0x7f1e736570c0) 0
+ primary-for QQmlComponent (0x0x7f1e73637270)
+
+Class QQmlContext::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQmlContext::QPrivateSignal (0x0x7f1e736579c0) 0 empty
+
+Class QQmlContext::PropertyPair
+ size=24 align=8
+ base size=24 base align=8
+QQmlContext::PropertyPair (0x0x7f1e73657a20) 0
+
+Vtable for QQmlContext
+QQmlContext::_ZTV11QQmlContext: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QQmlContext)
+16 (int (*)(...))QQmlContext::metaObject
+24 (int (*)(...))QQmlContext::qt_metacast
+32 (int (*)(...))QQmlContext::qt_metacall
+40 (int (*)(...))QQmlContext::~QQmlContext
+48 (int (*)(...))QQmlContext::~QQmlContext
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QQmlContext
+ size=16 align=8
+ base size=16 base align=8
+QQmlContext (0x0x7f1e736372d8) 0
+ vptr=((& QQmlContext::_ZTV11QQmlContext) + 16)
+ QObject (0x0x7f1e73657960) 0
+ primary-for QQmlContext (0x0x7f1e736372d8)
+
+Class QQmlScriptString
+ size=8 align=8
+ base size=8 base align=8
+QQmlScriptString (0x0x7f1e73657de0) 0
+
+Class QQmlExpression::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQmlExpression::QPrivateSignal (0x0x7f1e73685120) 0 empty
+
+Vtable for QQmlExpression
+QQmlExpression::_ZTV14QQmlExpression: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QQmlExpression)
+16 (int (*)(...))QQmlExpression::metaObject
+24 (int (*)(...))QQmlExpression::qt_metacast
+32 (int (*)(...))QQmlExpression::qt_metacall
+40 (int (*)(...))QQmlExpression::~QQmlExpression
+48 (int (*)(...))QQmlExpression::~QQmlExpression
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QQmlExpression
+ size=16 align=8
+ base size=16 base align=8
+QQmlExpression (0x0x7f1e73637340) 0
+ vptr=((& QQmlExpression::_ZTV14QQmlExpression) + 16)
+ QObject (0x0x7f1e736850c0) 0
+ primary-for QQmlExpression (0x0x7f1e73637340)
+
+Vtable for QQmlTypesExtensionInterface
+QQmlTypesExtensionInterface::_ZTV27QQmlTypesExtensionInterface: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI27QQmlTypesExtensionInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+
+Class QQmlTypesExtensionInterface
+ size=8 align=8
+ base size=8 base align=8
+QQmlTypesExtensionInterface (0x0x7f1e73685300) 0 nearly-empty
+ vptr=((& QQmlTypesExtensionInterface::_ZTV27QQmlTypesExtensionInterface) + 16)
+
+Vtable for QQmlExtensionInterface
+QQmlExtensionInterface::_ZTV22QQmlExtensionInterface: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI22QQmlExtensionInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+
+Class QQmlExtensionInterface
+ size=8 align=8
+ base size=8 base align=8
+QQmlExtensionInterface (0x0x7f1e736373a8) 0 nearly-empty
+ vptr=((& QQmlExtensionInterface::_ZTV22QQmlExtensionInterface) + 16)
+ QQmlTypesExtensionInterface (0x0x7f1e73685360) 0 nearly-empty
+ primary-for QQmlExtensionInterface (0x0x7f1e736373a8)
+
+Vtable for QQmlEngineExtensionInterface
+QQmlEngineExtensionInterface::_ZTV28QQmlEngineExtensionInterface: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI28QQmlEngineExtensionInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+
+Class QQmlEngineExtensionInterface
+ size=8 align=8
+ base size=8 base align=8
+QQmlEngineExtensionInterface (0x0x7f1e736853c0) 0 nearly-empty
+ vptr=((& QQmlEngineExtensionInterface::_ZTV28QQmlEngineExtensionInterface) + 16)
+
+Class QQmlExtensionPlugin::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQmlExtensionPlugin::QPrivateSignal (0x0x7f1e73685960) 0 empty
+
+Vtable for QQmlExtensionPlugin
+QQmlExtensionPlugin::_ZTV19QQmlExtensionPlugin: 22 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QQmlExtensionPlugin)
+16 (int (*)(...))QQmlExtensionPlugin::metaObject
+24 (int (*)(...))QQmlExtensionPlugin::qt_metacast
+32 (int (*)(...))QQmlExtensionPlugin::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))QQmlExtensionPlugin::initializeEngine
+128 (int (*)(...))-16
+136 (int (*)(...))(& _ZTI19QQmlExtensionPlugin)
+144 0
+152 0
+160 (int (*)(...))__cxa_pure_virtual
+168 (int (*)(...))QQmlExtensionPlugin::_ZThn16_N19QQmlExtensionPlugin16initializeEngineEP10QQmlEnginePKc
+
+Class QQmlExtensionPlugin
+ size=24 align=8
+ base size=24 base align=8
+QQmlExtensionPlugin (0x0x7f1e77209cb0) 0
+ vptr=((& QQmlExtensionPlugin::_ZTV19QQmlExtensionPlugin) + 16)
+ QObject (0x0x7f1e736858a0) 0
+ primary-for QQmlExtensionPlugin (0x0x7f1e77209cb0)
+ QQmlExtensionInterface (0x0x7f1e73637410) 16 nearly-empty
+ vptr=((& QQmlExtensionPlugin::_ZTV19QQmlExtensionPlugin) + 144)
+ QQmlTypesExtensionInterface (0x0x7f1e73685900) 16 nearly-empty
+ primary-for QQmlExtensionInterface (0x0x7f1e73637410)
+
+Class QQmlEngineExtensionPlugin::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQmlEngineExtensionPlugin::QPrivateSignal (0x0x7f1e73685c00) 0 empty
+
+Vtable for QQmlEngineExtensionPlugin
+QQmlEngineExtensionPlugin::_ZTV25QQmlEngineExtensionPlugin: 20 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI25QQmlEngineExtensionPlugin)
+16 (int (*)(...))QQmlEngineExtensionPlugin::metaObject
+24 (int (*)(...))QQmlEngineExtensionPlugin::qt_metacast
+32 (int (*)(...))QQmlEngineExtensionPlugin::qt_metacall
+40 (int (*)(...))QQmlEngineExtensionPlugin::~QQmlEngineExtensionPlugin
+48 (int (*)(...))QQmlEngineExtensionPlugin::~QQmlEngineExtensionPlugin
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QQmlEngineExtensionPlugin::initializeEngine
+120 (int (*)(...))-16
+128 (int (*)(...))(& _ZTI25QQmlEngineExtensionPlugin)
+136 (int (*)(...))QQmlEngineExtensionPlugin::_ZThn16_N25QQmlEngineExtensionPluginD1Ev
+144 (int (*)(...))QQmlEngineExtensionPlugin::_ZThn16_N25QQmlEngineExtensionPluginD0Ev
+152 (int (*)(...))QQmlEngineExtensionPlugin::_ZThn16_N25QQmlEngineExtensionPlugin16initializeEngineEP10QQmlEnginePKc
+
+Class QQmlEngineExtensionPlugin
+ size=24 align=8
+ base size=24 base align=8
+QQmlEngineExtensionPlugin (0x0x7f1e77284070) 0
+ vptr=((& QQmlEngineExtensionPlugin::_ZTV25QQmlEngineExtensionPlugin) + 16)
+ QObject (0x0x7f1e73685b40) 0
+ primary-for QQmlEngineExtensionPlugin (0x0x7f1e77284070)
+ QQmlEngineExtensionInterface (0x0x7f1e73685ba0) 16 nearly-empty
+ vptr=((& QQmlEngineExtensionPlugin::_ZTV25QQmlEngineExtensionPlugin) + 136)
+
+Class QQmlFile
+ size=8 align=8
+ base size=8 base align=8
+QQmlFile (0x0x7f1e73685d20) 0
+
+Class QQmlFileSelector::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQmlFileSelector::QPrivateSignal (0x0x7f1e73685de0) 0 empty
+
+Vtable for QQmlFileSelector
+QQmlFileSelector::_ZTV16QQmlFileSelector: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QQmlFileSelector)
+16 (int (*)(...))QQmlFileSelector::metaObject
+24 (int (*)(...))QQmlFileSelector::qt_metacast
+32 (int (*)(...))QQmlFileSelector::qt_metacall
+40 (int (*)(...))QQmlFileSelector::~QQmlFileSelector
+48 (int (*)(...))QQmlFileSelector::~QQmlFileSelector
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QQmlFileSelector
+ size=16 align=8
+ base size=16 base align=8
+QQmlFileSelector (0x0x7f1e736374e0) 0
+ vptr=((& QQmlFileSelector::_ZTV16QQmlFileSelector) + 16)
+ QObject (0x0x7f1e73685d80) 0
+ primary-for QQmlFileSelector (0x0x7f1e736374e0)
+
+Vtable for QQmlIncubator
+QQmlIncubator::_ZTV13QQmlIncubator: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QQmlIncubator)
+16 (int (*)(...))QQmlIncubator::~QQmlIncubator
+24 (int (*)(...))QQmlIncubator::~QQmlIncubator
+32 (int (*)(...))QQmlIncubator::statusChanged
+40 (int (*)(...))QQmlIncubator::setInitialState
+
+Class QQmlIncubator
+ size=16 align=8
+ base size=16 base align=8
+QQmlIncubator (0x0x7f1e736ae000) 0
+ vptr=((& QQmlIncubator::_ZTV13QQmlIncubator) + 16)
+
+Vtable for QQmlIncubationController
+QQmlIncubationController::_ZTV24QQmlIncubationController: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI24QQmlIncubationController)
+16 (int (*)(...))QQmlIncubationController::~QQmlIncubationController
+24 (int (*)(...))QQmlIncubationController::~QQmlIncubationController
+32 (int (*)(...))QQmlIncubationController::incubatingObjectCountChanged
+
+Class QQmlIncubationController
+ size=16 align=8
+ base size=16 base align=8
+QQmlIncubationController (0x0x7f1e736ae060) 0
+ vptr=((& QQmlIncubationController::_ZTV24QQmlIncubationController) + 16)
+
+Class QQmlInfo
+ size=16 align=8
+ base size=16 base align=8
+QQmlInfo (0x0x7f1e73637548) 0
+ QDebug (0x0x7f1e736ae0c0) 0
+
+Class QQmlModuleRegistration
+ size=8 align=8
+ base size=8 base align=8
+QQmlModuleRegistration (0x0x7f1e736c4060) 0
+
+Vtable for QQmlNetworkAccessManagerFactory
+QQmlNetworkAccessManagerFactory::_ZTV31QQmlNetworkAccessManagerFactory: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI31QQmlNetworkAccessManagerFactory)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+
+Class QQmlNetworkAccessManagerFactory
+ size=8 align=8
+ base size=8 base align=8
+QQmlNetworkAccessManagerFactory (0x0x7f1e736c40c0) 0 nearly-empty
+ vptr=((& QQmlNetworkAccessManagerFactory::_ZTV31QQmlNetworkAccessManagerFactory) + 16)
+
+Class QQmlProperty
+ size=8 align=8
+ base size=8 base align=8
+QQmlProperty (0x0x7f1e736c4120) 0
+
+Class QQmlPropertyMap::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQmlPropertyMap::QPrivateSignal (0x0x7f1e736e4960) 0 empty
+
+Vtable for QQmlPropertyMap
+QQmlPropertyMap::_ZTV15QQmlPropertyMap: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QQmlPropertyMap)
+16 (int (*)(...))QQmlPropertyMap::metaObject
+24 (int (*)(...))QQmlPropertyMap::qt_metacast
+32 (int (*)(...))QQmlPropertyMap::qt_metacall
+40 (int (*)(...))QQmlPropertyMap::~QQmlPropertyMap
+48 (int (*)(...))QQmlPropertyMap::~QQmlPropertyMap
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QQmlPropertyMap::updateValue
+
+Class QQmlPropertyMap
+ size=16 align=8
+ base size=16 base align=8
+QQmlPropertyMap (0x0x7f1e736e0b60) 0
+ vptr=((& QQmlPropertyMap::_ZTV15QQmlPropertyMap) + 16)
+ QObject (0x0x7f1e736e4900) 0
+ primary-for QQmlPropertyMap (0x0x7f1e736e0b60)
+
+Class QQuickTransform::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQuickTransform::QPrivateSignal (0x0x7f1e736e4c00) 0 empty
+
+Vtable for QQuickTransform
+QQuickTransform::_ZTV15QQuickTransform: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QQuickTransform)
+16 (int (*)(...))QQuickTransform::metaObject
+24 (int (*)(...))QQuickTransform::qt_metacast
+32 (int (*)(...))QQuickTransform::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+
+Class QQuickTransform
+ size=16 align=8
+ base size=16 base align=8
+QQuickTransform (0x0x7f1e736e0bc8) 0
+ vptr=((& QQuickTransform::_ZTV15QQuickTransform) + 16)
+ QObject (0x0x7f1e736e4ba0) 0
+ primary-for QQuickTransform (0x0x7f1e736e0bc8)
+
+Class QQuickItem::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQuickItem::QPrivateSignal (0x0x7f1e736e4ea0) 0 empty
+
+Class QQuickItem::ItemChangeData
+ size=8 align=8
+ base size=8 base align=8
+QQuickItem::ItemChangeData (0x0x7f1e736e4f00) 0
+
+Class QQuickItem::UpdatePaintNodeData
+ size=8 align=8
+ base size=8 base align=8
+QQuickItem::UpdatePaintNodeData (0x0x7f1e736e4f60) 0
+
+Vtable for QQuickItem
+QQuickItem::_ZTV10QQuickItem: 55 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QQuickItem)
+16 (int (*)(...))QQuickItem::metaObject
+24 (int (*)(...))QQuickItem::qt_metacast
+32 (int (*)(...))QQuickItem::qt_metacall
+40 (int (*)(...))QQuickItem::~QQuickItem
+48 (int (*)(...))QQuickItem::~QQuickItem
+56 (int (*)(...))QQuickItem::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QQuickItem::boundingRect
+120 (int (*)(...))QQuickItem::clipRect
+128 (int (*)(...))QQuickItem::contains
+136 (int (*)(...))QQuickItem::inputMethodQuery
+144 (int (*)(...))QQuickItem::isTextureProvider
+152 (int (*)(...))QQuickItem::textureProvider
+160 (int (*)(...))QQuickItem::itemChange
+168 (int (*)(...))QQuickItem::classBegin
+176 (int (*)(...))QQuickItem::componentComplete
+184 (int (*)(...))QQuickItem::keyPressEvent
+192 (int (*)(...))QQuickItem::keyReleaseEvent
+200 (int (*)(...))QQuickItem::inputMethodEvent
+208 (int (*)(...))QQuickItem::focusInEvent
+216 (int (*)(...))QQuickItem::focusOutEvent
+224 (int (*)(...))QQuickItem::mousePressEvent
+232 (int (*)(...))QQuickItem::mouseMoveEvent
+240 (int (*)(...))QQuickItem::mouseReleaseEvent
+248 (int (*)(...))QQuickItem::mouseDoubleClickEvent
+256 (int (*)(...))QQuickItem::mouseUngrabEvent
+264 (int (*)(...))QQuickItem::touchUngrabEvent
+272 (int (*)(...))QQuickItem::wheelEvent
+280 (int (*)(...))QQuickItem::touchEvent
+288 (int (*)(...))QQuickItem::hoverEnterEvent
+296 (int (*)(...))QQuickItem::hoverMoveEvent
+304 (int (*)(...))QQuickItem::hoverLeaveEvent
+312 (int (*)(...))QQuickItem::dragEnterEvent
+320 (int (*)(...))QQuickItem::dragMoveEvent
+328 (int (*)(...))QQuickItem::dragLeaveEvent
+336 (int (*)(...))QQuickItem::dropEvent
+344 (int (*)(...))QQuickItem::childMouseEventFilter
+352 (int (*)(...))QQuickItem::windowDeactivateEvent
+360 (int (*)(...))QQuickItem::geometryChanged
+368 (int (*)(...))QQuickItem::updatePaintNode
+376 (int (*)(...))QQuickItem::releaseResources
+384 (int (*)(...))QQuickItem::updatePolish
+392 (int (*)(...))-16
+400 (int (*)(...))(& _ZTI10QQuickItem)
+408 (int (*)(...))QQuickItem::_ZThn16_N10QQuickItemD1Ev
+416 (int (*)(...))QQuickItem::_ZThn16_N10QQuickItemD0Ev
+424 (int (*)(...))QQuickItem::_ZThn16_N10QQuickItem10classBeginEv
+432 (int (*)(...))QQuickItem::_ZThn16_N10QQuickItem17componentCompleteEv
+
+Class QQuickItem
+ size=32 align=8
+ base size=32 base align=8
+QQuickItem (0x0x7f1e76f4f3f0) 0
+ vptr=((& QQuickItem::_ZTV10QQuickItem) + 16)
+ QObject (0x0x7f1e736e4de0) 0
+ primary-for QQuickItem (0x0x7f1e76f4f3f0)
+ QQmlParserStatus (0x0x7f1e736e4e40) 16
+ vptr=((& QQuickItem::_ZTV10QQuickItem) + 408)
+
+Class QQuickFramebufferObject::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQuickFramebufferObject::QPrivateSignal (0x0x7f1e73728900) 0 empty
+
+Vtable for QQuickFramebufferObject::Renderer
+QQuickFramebufferObject::Renderer::_ZTVN23QQuickFramebufferObject8RendererE: 7 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTIN23QQuickFramebufferObject8RendererE)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))QQuickFramebufferObject::Renderer::createFramebufferObject
+48 (int (*)(...))QQuickFramebufferObject::Renderer::synchronize
+
+Class QQuickFramebufferObject::Renderer
+ size=16 align=8
+ base size=16 base align=8
+QQuickFramebufferObject::Renderer (0x0x7f1e73728960) 0
+ vptr=((& QQuickFramebufferObject::Renderer::_ZTVN23QQuickFramebufferObject8RendererE) + 16)
+
+Vtable for QQuickFramebufferObject
+QQuickFramebufferObject::_ZTV23QQuickFramebufferObject: 56 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI23QQuickFramebufferObject)
+16 (int (*)(...))QQuickFramebufferObject::metaObject
+24 (int (*)(...))QQuickFramebufferObject::qt_metacast
+32 (int (*)(...))QQuickFramebufferObject::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QQuickItem::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QQuickItem::boundingRect
+120 (int (*)(...))QQuickItem::clipRect
+128 (int (*)(...))QQuickItem::contains
+136 (int (*)(...))QQuickItem::inputMethodQuery
+144 (int (*)(...))QQuickFramebufferObject::isTextureProvider
+152 (int (*)(...))QQuickFramebufferObject::textureProvider
+160 (int (*)(...))QQuickItem::itemChange
+168 (int (*)(...))QQuickItem::classBegin
+176 (int (*)(...))QQuickItem::componentComplete
+184 (int (*)(...))QQuickItem::keyPressEvent
+192 (int (*)(...))QQuickItem::keyReleaseEvent
+200 (int (*)(...))QQuickItem::inputMethodEvent
+208 (int (*)(...))QQuickItem::focusInEvent
+216 (int (*)(...))QQuickItem::focusOutEvent
+224 (int (*)(...))QQuickItem::mousePressEvent
+232 (int (*)(...))QQuickItem::mouseMoveEvent
+240 (int (*)(...))QQuickItem::mouseReleaseEvent
+248 (int (*)(...))QQuickItem::mouseDoubleClickEvent
+256 (int (*)(...))QQuickItem::mouseUngrabEvent
+264 (int (*)(...))QQuickItem::touchUngrabEvent
+272 (int (*)(...))QQuickItem::wheelEvent
+280 (int (*)(...))QQuickItem::touchEvent
+288 (int (*)(...))QQuickItem::hoverEnterEvent
+296 (int (*)(...))QQuickItem::hoverMoveEvent
+304 (int (*)(...))QQuickItem::hoverLeaveEvent
+312 (int (*)(...))QQuickItem::dragEnterEvent
+320 (int (*)(...))QQuickItem::dragMoveEvent
+328 (int (*)(...))QQuickItem::dragLeaveEvent
+336 (int (*)(...))QQuickItem::dropEvent
+344 (int (*)(...))QQuickItem::childMouseEventFilter
+352 (int (*)(...))QQuickItem::windowDeactivateEvent
+360 (int (*)(...))QQuickFramebufferObject::geometryChanged
+368 (int (*)(...))QQuickFramebufferObject::updatePaintNode
+376 (int (*)(...))QQuickFramebufferObject::releaseResources
+384 (int (*)(...))QQuickItem::updatePolish
+392 (int (*)(...))__cxa_pure_virtual
+400 (int (*)(...))-16
+408 (int (*)(...))(& _ZTI23QQuickFramebufferObject)
+416 0
+424 0
+432 (int (*)(...))QQuickItem::_ZThn16_N10QQuickItem10classBeginEv
+440 (int (*)(...))QQuickItem::_ZThn16_N10QQuickItem17componentCompleteEv
+
+Class QQuickFramebufferObject
+ size=32 align=8
+ base size=32 base align=8
+QQuickFramebufferObject (0x0x7f1e736e0d00) 0
+ vptr=((& QQuickFramebufferObject::_ZTV23QQuickFramebufferObject) + 16)
+ QQuickItem (0x0x7f1e76c9a8c0) 0
+ primary-for QQuickFramebufferObject (0x0x7f1e736e0d00)
+ QObject (0x0x7f1e73728840) 0
+ primary-for QQuickItem (0x0x7f1e76c9a8c0)
+ QQmlParserStatus (0x0x7f1e737288a0) 16
+ vptr=((& QQuickFramebufferObject::_ZTV23QQuickFramebufferObject) + 416)
+
+Class QQuickTextureFactory::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQuickTextureFactory::QPrivateSignal (0x0x7f1e73728ba0) 0 empty
+
+Vtable for QQuickTextureFactory
+QQuickTextureFactory::_ZTV20QQuickTextureFactory: 18 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QQuickTextureFactory)
+16 (int (*)(...))QQuickTextureFactory::metaObject
+24 (int (*)(...))QQuickTextureFactory::qt_metacast
+32 (int (*)(...))QQuickTextureFactory::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))__cxa_pure_virtual
+136 (int (*)(...))QQuickTextureFactory::image
+
+Class QQuickTextureFactory
+ size=16 align=8
+ base size=16 base align=8
+QQuickTextureFactory (0x0x7f1e736e0d68) 0
+ vptr=((& QQuickTextureFactory::_ZTV20QQuickTextureFactory) + 16)
+ QObject (0x0x7f1e73728b40) 0
+ primary-for QQuickTextureFactory (0x0x7f1e736e0d68)
+
+Class QQuickImageResponse::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQuickImageResponse::QPrivateSignal (0x0x7f1e73728d20) 0 empty
+
+Vtable for QQuickImageResponse
+QQuickImageResponse::_ZTV19QQuickImageResponse: 17 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QQuickImageResponse)
+16 (int (*)(...))QQuickImageResponse::metaObject
+24 (int (*)(...))QQuickImageResponse::qt_metacast
+32 (int (*)(...))QQuickImageResponse::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))QQuickImageResponse::errorString
+128 (int (*)(...))QQuickImageResponse::cancel
+
+Class QQuickImageResponse
+ size=16 align=8
+ base size=16 base align=8
+QQuickImageResponse (0x0x7f1e736e0dd0) 0
+ vptr=((& QQuickImageResponse::_ZTV19QQuickImageResponse) + 16)
+ QObject (0x0x7f1e73728cc0) 0
+ primary-for QQuickImageResponse (0x0x7f1e736e0dd0)
+
+Vtable for QQuickImageProvider
+QQuickImageProvider::_ZTV19QQuickImageProvider: 9 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QQuickImageProvider)
+16 (int (*)(...))QQuickImageProvider::~QQuickImageProvider
+24 (int (*)(...))QQuickImageProvider::~QQuickImageProvider
+32 (int (*)(...))QQuickImageProvider::imageType
+40 (int (*)(...))QQuickImageProvider::flags
+48 (int (*)(...))QQuickImageProvider::requestImage
+56 (int (*)(...))QQuickImageProvider::requestPixmap
+64 (int (*)(...))QQuickImageProvider::requestTexture
+
+Class QQuickImageProvider
+ size=16 align=8
+ base size=16 base align=8
+QQuickImageProvider (0x0x7f1e736e0e38) 0
+ vptr=((& QQuickImageProvider::_ZTV19QQuickImageProvider) + 16)
+ QQmlImageProviderBase (0x0x7f1e73728f00) 0 nearly-empty
+ primary-for QQuickImageProvider (0x0x7f1e736e0e38)
+
+Vtable for QQuickAsyncImageProvider
+QQuickAsyncImageProvider::_ZTV24QQuickAsyncImageProvider: 10 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI24QQuickAsyncImageProvider)
+16 0
+24 0
+32 (int (*)(...))QQuickImageProvider::imageType
+40 (int (*)(...))QQuickImageProvider::flags
+48 (int (*)(...))QQuickImageProvider::requestImage
+56 (int (*)(...))QQuickImageProvider::requestPixmap
+64 (int (*)(...))QQuickImageProvider::requestTexture
+72 (int (*)(...))__cxa_pure_virtual
+
+Class QQuickAsyncImageProvider
+ size=24 align=8
+ base size=24 base align=8
+QQuickAsyncImageProvider (0x0x7f1e736e0ea0) 0
+ vptr=((& QQuickAsyncImageProvider::_ZTV24QQuickAsyncImageProvider) + 16)
+ QQuickImageProvider (0x0x7f1e736e0f08) 0
+ primary-for QQuickAsyncImageProvider (0x0x7f1e736e0ea0)
+ QQmlImageProviderBase (0x0x7f1e73755180) 0 nearly-empty
+ primary-for QQuickImageProvider (0x0x7f1e736e0f08)
+
+Class QQuickItemGrabResult::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQuickItemGrabResult::QPrivateSignal (0x0x7f1e73755240) 0 empty
+
+Vtable for QQuickItemGrabResult
+QQuickItemGrabResult::_ZTV20QQuickItemGrabResult: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QQuickItemGrabResult)
+16 (int (*)(...))QQuickItemGrabResult::metaObject
+24 (int (*)(...))QQuickItemGrabResult::qt_metacast
+32 (int (*)(...))QQuickItemGrabResult::qt_metacall
+40 (int (*)(...))QQuickItemGrabResult::~QQuickItemGrabResult
+48 (int (*)(...))QQuickItemGrabResult::~QQuickItemGrabResult
+56 (int (*)(...))QQuickItemGrabResult::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QQuickItemGrabResult
+ size=16 align=8
+ base size=16 base align=8
+QQuickItemGrabResult (0x0x7f1e736e0f70) 0
+ vptr=((& QQuickItemGrabResult::_ZTV20QQuickItemGrabResult) + 16)
+ QObject (0x0x7f1e737551e0) 0
+ primary-for QQuickItemGrabResult (0x0x7f1e736e0f70)
+
+Class QQuickPaintedItem::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQuickPaintedItem::QPrivateSignal (0x0x7f1e737554e0) 0 empty
+
+Vtable for QQuickPaintedItem
+QQuickPaintedItem::_ZTV17QQuickPaintedItem: 56 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QQuickPaintedItem)
+16 (int (*)(...))QQuickPaintedItem::metaObject
+24 (int (*)(...))QQuickPaintedItem::qt_metacast
+32 (int (*)(...))QQuickPaintedItem::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QQuickItem::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QQuickItem::boundingRect
+120 (int (*)(...))QQuickItem::clipRect
+128 (int (*)(...))QQuickItem::contains
+136 (int (*)(...))QQuickItem::inputMethodQuery
+144 (int (*)(...))QQuickPaintedItem::isTextureProvider
+152 (int (*)(...))QQuickPaintedItem::textureProvider
+160 (int (*)(...))QQuickPaintedItem::itemChange
+168 (int (*)(...))QQuickItem::classBegin
+176 (int (*)(...))QQuickItem::componentComplete
+184 (int (*)(...))QQuickItem::keyPressEvent
+192 (int (*)(...))QQuickItem::keyReleaseEvent
+200 (int (*)(...))QQuickItem::inputMethodEvent
+208 (int (*)(...))QQuickItem::focusInEvent
+216 (int (*)(...))QQuickItem::focusOutEvent
+224 (int (*)(...))QQuickItem::mousePressEvent
+232 (int (*)(...))QQuickItem::mouseMoveEvent
+240 (int (*)(...))QQuickItem::mouseReleaseEvent
+248 (int (*)(...))QQuickItem::mouseDoubleClickEvent
+256 (int (*)(...))QQuickItem::mouseUngrabEvent
+264 (int (*)(...))QQuickItem::touchUngrabEvent
+272 (int (*)(...))QQuickItem::wheelEvent
+280 (int (*)(...))QQuickItem::touchEvent
+288 (int (*)(...))QQuickItem::hoverEnterEvent
+296 (int (*)(...))QQuickItem::hoverMoveEvent
+304 (int (*)(...))QQuickItem::hoverLeaveEvent
+312 (int (*)(...))QQuickItem::dragEnterEvent
+320 (int (*)(...))QQuickItem::dragMoveEvent
+328 (int (*)(...))QQuickItem::dragLeaveEvent
+336 (int (*)(...))QQuickItem::dropEvent
+344 (int (*)(...))QQuickItem::childMouseEventFilter
+352 (int (*)(...))QQuickItem::windowDeactivateEvent
+360 (int (*)(...))QQuickItem::geometryChanged
+368 (int (*)(...))QQuickPaintedItem::updatePaintNode
+376 (int (*)(...))QQuickPaintedItem::releaseResources
+384 (int (*)(...))QQuickItem::updatePolish
+392 (int (*)(...))__cxa_pure_virtual
+400 (int (*)(...))-16
+408 (int (*)(...))(& _ZTI17QQuickPaintedItem)
+416 0
+424 0
+432 (int (*)(...))QQuickItem::_ZThn16_N10QQuickItem10classBeginEv
+440 (int (*)(...))QQuickItem::_ZThn16_N10QQuickItem17componentCompleteEv
+
+Class QQuickPaintedItem
+ size=32 align=8
+ base size=32 base align=8
+QQuickPaintedItem (0x0x7f1e7375c000) 0
+ vptr=((& QQuickPaintedItem::_ZTV17QQuickPaintedItem) + 16)
+ QQuickItem (0x0x7f1e76c9af50) 0
+ primary-for QQuickPaintedItem (0x0x7f1e7375c000)
+ QObject (0x0x7f1e73755420) 0
+ primary-for QQuickItem (0x0x7f1e76c9af50)
+ QQmlParserStatus (0x0x7f1e73755480) 16
+ vptr=((& QQuickPaintedItem::_ZTV17QQuickPaintedItem) + 416)
+
+Class QQuickRenderControl::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQuickRenderControl::QPrivateSignal (0x0x7f1e73755f60) 0 empty
+
+Vtable for QQuickRenderControl
+QQuickRenderControl::_ZTV19QQuickRenderControl: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QQuickRenderControl)
+16 (int (*)(...))QQuickRenderControl::metaObject
+24 (int (*)(...))QQuickRenderControl::qt_metacast
+32 (int (*)(...))QQuickRenderControl::qt_metacall
+40 (int (*)(...))QQuickRenderControl::~QQuickRenderControl
+48 (int (*)(...))QQuickRenderControl::~QQuickRenderControl
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QQuickRenderControl::renderWindow
+
+Class QQuickRenderControl
+ size=16 align=8
+ base size=16 base align=8
+QQuickRenderControl (0x0x7f1e7375c1a0) 0
+ vptr=((& QQuickRenderControl::_ZTV19QQuickRenderControl) + 16)
+ QObject (0x0x7f1e73755f00) 0
+ primary-for QQuickRenderControl (0x0x7f1e7375c1a0)
+
+Class QQuickTextDocument::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQuickTextDocument::QPrivateSignal (0x0x7f1e7377a240) 0 empty
+
+Vtable for QQuickTextDocument
+QQuickTextDocument::_ZTV18QQuickTextDocument: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QQuickTextDocument)
+16 (int (*)(...))QQuickTextDocument::metaObject
+24 (int (*)(...))QQuickTextDocument::qt_metacast
+32 (int (*)(...))QQuickTextDocument::qt_metacall
+40 (int (*)(...))QQuickTextDocument::~QQuickTextDocument
+48 (int (*)(...))QQuickTextDocument::~QQuickTextDocument
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QQuickTextDocument
+ size=16 align=8
+ base size=16 base align=8
+QQuickTextDocument (0x0x7f1e7375c208) 0
+ vptr=((& QQuickTextDocument::_ZTV18QQuickTextDocument) + 16)
+ QObject (0x0x7f1e7377a1e0) 0
+ primary-for QQuickTextDocument (0x0x7f1e7375c208)
+
+Class QSGGeometry::Attribute
+ size=16 align=4
+ base size=16 base align=4
+QSGGeometry::Attribute (0x0x7f1e7377a8a0) 0
+
+Class QSGGeometry::AttributeSet
+ size=16 align=8
+ base size=16 base align=8
+QSGGeometry::AttributeSet (0x0x7f1e7377a900) 0
+
+Class QSGGeometry::Point2D
+ size=8 align=4
+ base size=8 base align=4
+QSGGeometry::Point2D (0x0x7f1e7377a960) 0
+
+Class QSGGeometry::TexturedPoint2D
+ size=16 align=4
+ base size=16 base align=4
+QSGGeometry::TexturedPoint2D (0x0x7f1e7377a9c0) 0
+
+Class QSGGeometry::ColoredPoint2D
+ size=12 align=4
+ base size=12 base align=4
+QSGGeometry::ColoredPoint2D (0x0x7f1e7377aa20) 0
+
+Vtable for QSGGeometry
+QSGGeometry::_ZTV11QSGGeometry: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QSGGeometry)
+16 (int (*)(...))QSGGeometry::~QSGGeometry
+24 (int (*)(...))QSGGeometry::~QSGGeometry
+
+Class QSGGeometry
+ size=128 align=8
+ base size=128 base align=8
+QSGGeometry (0x0x7f1e7377a840) 0
+ vptr=((& QSGGeometry::_ZTV11QSGGeometry) + 16)
+
+Vtable for QSGNode
+QSGNode::_ZTV7QSGNode: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI7QSGNode)
+16 (int (*)(...))QSGNode::~QSGNode
+24 (int (*)(...))QSGNode::~QSGNode
+32 (int (*)(...))QSGNode::isSubtreeBlocked
+40 (int (*)(...))QSGNode::preprocess
+
+Class QSGNode
+ size=80 align=8
+ base size=80 base align=8
+QSGNode (0x0x7f1e737a7a20) 0
+ vptr=((& QSGNode::_ZTV7QSGNode) + 16)
+
+Vtable for QSGBasicGeometryNode
+QSGBasicGeometryNode::_ZTV20QSGBasicGeometryNode: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QSGBasicGeometryNode)
+16 (int (*)(...))QSGBasicGeometryNode::~QSGBasicGeometryNode
+24 (int (*)(...))QSGBasicGeometryNode::~QSGBasicGeometryNode
+32 (int (*)(...))QSGNode::isSubtreeBlocked
+40 (int (*)(...))QSGNode::preprocess
+
+Class QSGBasicGeometryNode
+ size=112 align=8
+ base size=112 base align=8
+QSGBasicGeometryNode (0x0x7f1e7375c8f0) 0
+ vptr=((& QSGBasicGeometryNode::_ZTV20QSGBasicGeometryNode) + 16)
+ QSGNode (0x0x7f1e737d51e0) 0
+ primary-for QSGBasicGeometryNode (0x0x7f1e7375c8f0)
+
+Vtable for QSGGeometryNode
+QSGGeometryNode::_ZTV15QSGGeometryNode: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QSGGeometryNode)
+16 (int (*)(...))QSGGeometryNode::~QSGGeometryNode
+24 (int (*)(...))QSGGeometryNode::~QSGGeometryNode
+32 (int (*)(...))QSGNode::isSubtreeBlocked
+40 (int (*)(...))QSGNode::preprocess
+
+Class QSGGeometryNode
+ size=144 align=8
+ base size=144 base align=8
+QSGGeometryNode (0x0x7f1e7375c958) 0
+ vptr=((& QSGGeometryNode::_ZTV15QSGGeometryNode) + 16)
+ QSGBasicGeometryNode (0x0x7f1e7375c9c0) 0
+ primary-for QSGGeometryNode (0x0x7f1e7375c958)
+ QSGNode (0x0x7f1e737d5480) 0
+ primary-for QSGBasicGeometryNode (0x0x7f1e7375c9c0)
+
+Vtable for QSGClipNode
+QSGClipNode::_ZTV11QSGClipNode: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QSGClipNode)
+16 (int (*)(...))QSGClipNode::~QSGClipNode
+24 (int (*)(...))QSGClipNode::~QSGClipNode
+32 (int (*)(...))QSGNode::isSubtreeBlocked
+40 (int (*)(...))QSGNode::preprocess
+
+Class QSGClipNode
+ size=152 align=8
+ base size=152 base align=8
+QSGClipNode (0x0x7f1e7375ca28) 0
+ vptr=((& QSGClipNode::_ZTV11QSGClipNode) + 16)
+ QSGBasicGeometryNode (0x0x7f1e7375ca90) 0
+ primary-for QSGClipNode (0x0x7f1e7375ca28)
+ QSGNode (0x0x7f1e737d5660) 0
+ primary-for QSGBasicGeometryNode (0x0x7f1e7375ca90)
+
+Vtable for QSGTransformNode
+QSGTransformNode::_ZTV16QSGTransformNode: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QSGTransformNode)
+16 (int (*)(...))QSGTransformNode::~QSGTransformNode
+24 (int (*)(...))QSGTransformNode::~QSGTransformNode
+32 (int (*)(...))QSGNode::isSubtreeBlocked
+40 (int (*)(...))QSGNode::preprocess
+
+Class QSGTransformNode
+ size=216 align=8
+ base size=216 base align=8
+QSGTransformNode (0x0x7f1e7375caf8) 0
+ vptr=((& QSGTransformNode::_ZTV16QSGTransformNode) + 16)
+ QSGNode (0x0x7f1e737d5780) 0
+ primary-for QSGTransformNode (0x0x7f1e7375caf8)
+
+Vtable for QSGRootNode
+QSGRootNode::_ZTV11QSGRootNode: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QSGRootNode)
+16 (int (*)(...))QSGRootNode::~QSGRootNode
+24 (int (*)(...))QSGRootNode::~QSGRootNode
+32 (int (*)(...))QSGNode::isSubtreeBlocked
+40 (int (*)(...))QSGNode::preprocess
+
+Class QSGRootNode
+ size=88 align=8
+ base size=88 base align=8
+QSGRootNode (0x0x7f1e7375cb60) 0
+ vptr=((& QSGRootNode::_ZTV11QSGRootNode) + 16)
+ QSGNode (0x0x7f1e737d58a0) 0
+ primary-for QSGRootNode (0x0x7f1e7375cb60)
+
+Vtable for QSGOpacityNode
+QSGOpacityNode::_ZTV14QSGOpacityNode: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QSGOpacityNode)
+16 (int (*)(...))QSGOpacityNode::~QSGOpacityNode
+24 (int (*)(...))QSGOpacityNode::~QSGOpacityNode
+32 (int (*)(...))QSGOpacityNode::isSubtreeBlocked
+40 (int (*)(...))QSGNode::preprocess
+
+Class QSGOpacityNode
+ size=96 align=8
+ base size=96 base align=8
+QSGOpacityNode (0x0x7f1e7375cc30) 0
+ vptr=((& QSGOpacityNode::_ZTV14QSGOpacityNode) + 16)
+ QSGNode (0x0x7f1e737d5a20) 0
+ primary-for QSGOpacityNode (0x0x7f1e7375cc30)
+
+Vtable for QSGNodeVisitor
+QSGNodeVisitor::_ZTV14QSGNodeVisitor: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QSGNodeVisitor)
+16 (int (*)(...))QSGNodeVisitor::~QSGNodeVisitor
+24 (int (*)(...))QSGNodeVisitor::~QSGNodeVisitor
+32 (int (*)(...))QSGNodeVisitor::enterTransformNode
+40 (int (*)(...))QSGNodeVisitor::leaveTransformNode
+48 (int (*)(...))QSGNodeVisitor::enterClipNode
+56 (int (*)(...))QSGNodeVisitor::leaveClipNode
+64 (int (*)(...))QSGNodeVisitor::enterGeometryNode
+72 (int (*)(...))QSGNodeVisitor::leaveGeometryNode
+80 (int (*)(...))QSGNodeVisitor::enterOpacityNode
+88 (int (*)(...))QSGNodeVisitor::leaveOpacityNode
+96 (int (*)(...))QSGNodeVisitor::visitNode
+104 (int (*)(...))QSGNodeVisitor::visitChildren
+
+Class QSGNodeVisitor
+ size=8 align=8
+ base size=8 base align=8
+QSGNodeVisitor (0x0x7f1e737d5b40) 0 nearly-empty
+ vptr=((& QSGNodeVisitor::_ZTV14QSGNodeVisitor) + 16)
+
+Vtable for QSGRendererInterface
+QSGRendererInterface::_ZTV20QSGRendererInterface: 10 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QSGRendererInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))QSGRendererInterface::getResource
+48 (int (*)(...))QSGRendererInterface::getResource
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))__cxa_pure_virtual
+72 (int (*)(...))__cxa_pure_virtual
+
+Class QSGRendererInterface
+ size=8 align=8
+ base size=8 base align=8
+QSGRendererInterface (0x0x7f1e73417960) 0 nearly-empty
+ vptr=((& QSGRendererInterface::_ZTV20QSGRendererInterface) + 16)
+
+Class QQuickWindow::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQuickWindow::QPrivateSignal (0x0x7f1e73438840) 0 empty
+
+Class QQuickWindow::GraphicsStateInfo
+ size=8 align=4
+ base size=8 base align=4
+QQuickWindow::GraphicsStateInfo (0x0x7f1e734388a0) 0
+
+Vtable for QQuickWindow
+QQuickWindow::_ZTV12QQuickWindow: 45 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QQuickWindow)
+16 (int (*)(...))QQuickWindow::metaObject
+24 (int (*)(...))QQuickWindow::qt_metacast
+32 (int (*)(...))QQuickWindow::qt_metacall
+40 (int (*)(...))QQuickWindow::~QQuickWindow
+48 (int (*)(...))QQuickWindow::~QQuickWindow
+56 (int (*)(...))QQuickWindow::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWindow::surfaceType
+120 (int (*)(...))QWindow::format
+128 (int (*)(...))QWindow::size
+136 (int (*)(...))QQuickWindow::accessibleRoot
+144 (int (*)(...))QQuickWindow::focusObject
+152 (int (*)(...))QQuickWindow::exposeEvent
+160 (int (*)(...))QQuickWindow::resizeEvent
+168 (int (*)(...))QWindow::moveEvent
+176 (int (*)(...))QQuickWindow::focusInEvent
+184 (int (*)(...))QQuickWindow::focusOutEvent
+192 (int (*)(...))QQuickWindow::showEvent
+200 (int (*)(...))QQuickWindow::hideEvent
+208 (int (*)(...))QQuickWindow::keyPressEvent
+216 (int (*)(...))QQuickWindow::keyReleaseEvent
+224 (int (*)(...))QQuickWindow::mousePressEvent
+232 (int (*)(...))QQuickWindow::mouseReleaseEvent
+240 (int (*)(...))QQuickWindow::mouseDoubleClickEvent
+248 (int (*)(...))QQuickWindow::mouseMoveEvent
+256 (int (*)(...))QQuickWindow::wheelEvent
+264 (int (*)(...))QWindow::touchEvent
+272 (int (*)(...))QQuickWindow::tabletEvent
+280 (int (*)(...))QWindow::nativeEvent
+288 (int (*)(...))QWindow::surfaceHandle
+296 (int (*)(...))-16
+304 (int (*)(...))(& _ZTI12QQuickWindow)
+312 (int (*)(...))QQuickWindow::_ZThn16_N12QQuickWindowD1Ev
+320 (int (*)(...))QQuickWindow::_ZThn16_N12QQuickWindowD0Ev
+328 (int (*)(...))QWindow::_ZThn16_NK7QWindow6formatEv
+336 (int (*)(...))QWindow::_ZThn16_NK7QWindow13surfaceHandleEv
+344 (int (*)(...))QWindow::_ZThn16_NK7QWindow11surfaceTypeEv
+352 (int (*)(...))QWindow::_ZThn16_NK7QWindow4sizeEv
+
+Class QQuickWindow
+ size=40 align=8
+ base size=40 base align=8
+QQuickWindow (0x0x7f1e7375ce38) 0
+ vptr=((& QQuickWindow::_ZTV12QQuickWindow) + 16)
+ QWindow (0x0x7f1e76b4fd20) 0
+ primary-for QQuickWindow (0x0x7f1e7375ce38)
+ QObject (0x0x7f1e73438780) 0
+ primary-for QWindow (0x0x7f1e76b4fd20)
+ QSurface (0x0x7f1e734387e0) 16
+ vptr=((& QQuickWindow::_ZTV12QQuickWindow) + 312)
+
+Class QQuickView::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQuickView::QPrivateSignal (0x0x7f1e734783c0) 0 empty
+
+Vtable for QQuickView
+QQuickView::_ZTV10QQuickView: 45 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QQuickView)
+16 (int (*)(...))QQuickView::metaObject
+24 (int (*)(...))QQuickView::qt_metacast
+32 (int (*)(...))QQuickView::qt_metacall
+40 (int (*)(...))QQuickView::~QQuickView
+48 (int (*)(...))QQuickView::~QQuickView
+56 (int (*)(...))QQuickWindow::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QQuickView::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWindow::surfaceType
+120 (int (*)(...))QWindow::format
+128 (int (*)(...))QWindow::size
+136 (int (*)(...))QQuickWindow::accessibleRoot
+144 (int (*)(...))QQuickWindow::focusObject
+152 (int (*)(...))QQuickWindow::exposeEvent
+160 (int (*)(...))QQuickView::resizeEvent
+168 (int (*)(...))QWindow::moveEvent
+176 (int (*)(...))QQuickWindow::focusInEvent
+184 (int (*)(...))QQuickWindow::focusOutEvent
+192 (int (*)(...))QQuickWindow::showEvent
+200 (int (*)(...))QQuickWindow::hideEvent
+208 (int (*)(...))QQuickView::keyPressEvent
+216 (int (*)(...))QQuickView::keyReleaseEvent
+224 (int (*)(...))QQuickView::mousePressEvent
+232 (int (*)(...))QQuickView::mouseReleaseEvent
+240 (int (*)(...))QQuickWindow::mouseDoubleClickEvent
+248 (int (*)(...))QQuickView::mouseMoveEvent
+256 (int (*)(...))QQuickWindow::wheelEvent
+264 (int (*)(...))QWindow::touchEvent
+272 (int (*)(...))QQuickWindow::tabletEvent
+280 (int (*)(...))QWindow::nativeEvent
+288 (int (*)(...))QWindow::surfaceHandle
+296 (int (*)(...))-16
+304 (int (*)(...))(& _ZTI10QQuickView)
+312 (int (*)(...))QQuickView::_ZThn16_N10QQuickViewD1Ev
+320 (int (*)(...))QQuickView::_ZThn16_N10QQuickViewD0Ev
+328 (int (*)(...))QWindow::_ZThn16_NK7QWindow6formatEv
+336 (int (*)(...))QWindow::_ZThn16_NK7QWindow13surfaceHandleEv
+344 (int (*)(...))QWindow::_ZThn16_NK7QWindow11surfaceTypeEv
+352 (int (*)(...))QWindow::_ZThn16_NK7QWindow4sizeEv
+
+Class QQuickView
+ size=40 align=8
+ base size=40 base align=8
+QQuickView (0x0x7f1e7375cf70) 0
+ vptr=((& QQuickView::_ZTV10QQuickView) + 16)
+ QQuickWindow (0x0x7f1e73481000) 0
+ primary-for QQuickView (0x0x7f1e7375cf70)
+ QWindow (0x0x7f1e76bb5f50) 0
+ primary-for QQuickWindow (0x0x7f1e73481000)
+ QObject (0x0x7f1e73478300) 0
+ primary-for QWindow (0x0x7f1e76bb5f50)
+ QSurface (0x0x7f1e73478360) 16
+ vptr=((& QQuickView::_ZTV10QQuickView) + 312)
+
+Class QSGAbstractRenderer::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSGAbstractRenderer::QPrivateSignal (0x0x7f1e73478780) 0 empty
+
+Vtable for QSGAbstractRenderer
+QSGAbstractRenderer::_ZTV19QSGAbstractRenderer: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QSGAbstractRenderer)
+16 (int (*)(...))QSGAbstractRenderer::metaObject
+24 (int (*)(...))QSGAbstractRenderer::qt_metacast
+32 (int (*)(...))QSGAbstractRenderer::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+
+Class QSGAbstractRenderer
+ size=16 align=8
+ base size=16 base align=8
+QSGAbstractRenderer (0x0x7f1e73481068) 0
+ vptr=((& QSGAbstractRenderer::_ZTV19QSGAbstractRenderer) + 16)
+ QObject (0x0x7f1e73478720) 0
+ primary-for QSGAbstractRenderer (0x0x7f1e73481068)
+
+Class QSGEngine::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSGEngine::QPrivateSignal (0x0x7f1e734ba480) 0 empty
+
+Vtable for QSGEngine
+QSGEngine::_ZTV9QSGEngine: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QSGEngine)
+16 (int (*)(...))QSGEngine::metaObject
+24 (int (*)(...))QSGEngine::qt_metacast
+32 (int (*)(...))QSGEngine::qt_metacall
+40 (int (*)(...))QSGEngine::~QSGEngine
+48 (int (*)(...))QSGEngine::~QSGEngine
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QSGEngine
+ size=16 align=8
+ base size=16 base align=8
+QSGEngine (0x0x7f1e73481270) 0
+ vptr=((& QSGEngine::_ZTV9QSGEngine) + 16)
+ QObject (0x0x7f1e734ba420) 0
+ primary-for QSGEngine (0x0x7f1e73481270)
+
+Class QSGMaterialType
+ size=1 align=1
+ base size=0 base align=1
+QSGMaterialType (0x0x7f1e734baae0) 0 empty
+
+Class QSGMaterialShader::RenderState
+ size=16 align=8
+ base size=16 base align=8
+QSGMaterialShader::RenderState (0x0x7f1e734baba0) 0
+
+Vtable for QSGMaterialShader
+QSGMaterialShader::_ZTV17QSGMaterialShader: 12 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QSGMaterialShader)
+16 0
+24 0
+32 (int (*)(...))QSGMaterialShader::activate
+40 (int (*)(...))QSGMaterialShader::deactivate
+48 (int (*)(...))QSGMaterialShader::updateState
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))QSGMaterialShader::compile
+72 (int (*)(...))QSGMaterialShader::initialize
+80 (int (*)(...))QSGMaterialShader::vertexShader
+88 (int (*)(...))QSGMaterialShader::fragmentShader
+
+Class QSGMaterialShader
+ size=32 align=8
+ base size=32 base align=8
+QSGMaterialShader (0x0x7f1e734bab40) 0
+ vptr=((& QSGMaterialShader::_ZTV17QSGMaterialShader) + 16)
+
+Class QSGMaterialRhiShader::RenderState
+ size=16 align=8
+ base size=16 base align=8
+QSGMaterialRhiShader::RenderState (0x0x7f1e734f4720) 0
+
+Class QSGMaterialRhiShader::GraphicsPipelineState
+ size=36 align=4
+ base size=36 base align=4
+QSGMaterialRhiShader::GraphicsPipelineState (0x0x7f1e734f4780) 0
+
+Vtable for QSGMaterialRhiShader
+QSGMaterialRhiShader::_ZTV20QSGMaterialRhiShader: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QSGMaterialRhiShader)
+16 (int (*)(...))QSGMaterialRhiShader::~QSGMaterialRhiShader
+24 (int (*)(...))QSGMaterialRhiShader::~QSGMaterialRhiShader
+32 (int (*)(...))QSGMaterialShader::activate
+40 (int (*)(...))QSGMaterialShader::deactivate
+48 (int (*)(...))QSGMaterialShader::updateState
+56 (int (*)(...))QSGMaterialRhiShader::attributeNames
+64 (int (*)(...))QSGMaterialShader::compile
+72 (int (*)(...))QSGMaterialShader::initialize
+80 (int (*)(...))QSGMaterialShader::vertexShader
+88 (int (*)(...))QSGMaterialShader::fragmentShader
+96 (int (*)(...))QSGMaterialRhiShader::updateUniformData
+104 (int (*)(...))QSGMaterialRhiShader::updateSampledImage
+112 (int (*)(...))QSGMaterialRhiShader::updateGraphicsPipelineState
+
+Class QSGMaterialRhiShader
+ size=40 align=8
+ base size=40 base align=8
+QSGMaterialRhiShader (0x0x7f1e734814e0) 0
+ vptr=((& QSGMaterialRhiShader::_ZTV20QSGMaterialRhiShader) + 16)
+ QSGMaterialShader (0x0x7f1e734f46c0) 0
+ primary-for QSGMaterialRhiShader (0x0x7f1e734814e0)
+
+Vtable for QSGMaterial
+QSGMaterial::_ZTV11QSGMaterial: 7 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QSGMaterial)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))QSGMaterial::compare
+
+Class QSGMaterial
+ size=24 align=8
+ base size=24 base align=8
+QSGMaterial (0x0x7f1e7351e840) 0
+ vptr=((& QSGMaterial::_ZTV11QSGMaterial) + 16)
+
+Vtable for QSGFlatColorMaterial
+QSGFlatColorMaterial::_ZTV20QSGFlatColorMaterial: 7 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QSGFlatColorMaterial)
+16 (int (*)(...))QSGFlatColorMaterial::~QSGFlatColorMaterial
+24 (int (*)(...))QSGFlatColorMaterial::~QSGFlatColorMaterial
+32 (int (*)(...))QSGFlatColorMaterial::type
+40 (int (*)(...))QSGFlatColorMaterial::createShader
+48 (int (*)(...))QSGFlatColorMaterial::compare
+
+Class QSGFlatColorMaterial
+ size=40 align=8
+ base size=40 base align=8
+QSGFlatColorMaterial (0x0x7f1e73481820) 0
+ vptr=((& QSGFlatColorMaterial::_ZTV20QSGFlatColorMaterial) + 16)
+ QSGMaterial (0x0x7f1e7354b000) 0
+ primary-for QSGFlatColorMaterial (0x0x7f1e73481820)
+
+Class QSGTexture::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSGTexture::QPrivateSignal (0x0x7f1e7354b120) 0 empty
+
+Class QSGTexture::NativeTexture
+ size=16 align=8
+ base size=16 base align=8
+QSGTexture::NativeTexture (0x0x7f1e7354b180) 0
+
+Vtable for QSGTexture
+QSGTexture::_ZTV10QSGTexture: 22 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QSGTexture)
+16 (int (*)(...))QSGTexture::metaObject
+24 (int (*)(...))QSGTexture::qt_metacast
+32 (int (*)(...))QSGTexture::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))__cxa_pure_virtual
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))QSGTexture::normalizedTextureSubRect
+152 (int (*)(...))QSGTexture::isAtlasTexture
+160 (int (*)(...))QSGTexture::removedFromAtlas
+168 (int (*)(...))__cxa_pure_virtual
+
+Class QSGTexture
+ size=16 align=8
+ base size=16 base align=8
+QSGTexture (0x0x7f1e73481888) 0
+ vptr=((& QSGTexture::_ZTV10QSGTexture) + 16)
+ QObject (0x0x7f1e7354b0c0) 0
+ primary-for QSGTexture (0x0x7f1e73481888)
+
+Class QSGDynamicTexture::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSGDynamicTexture::QPrivateSignal (0x0x7f1e7354b420) 0 empty
+
+Vtable for QSGDynamicTexture
+QSGDynamicTexture::_ZTV17QSGDynamicTexture: 23 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QSGDynamicTexture)
+16 (int (*)(...))QSGDynamicTexture::metaObject
+24 (int (*)(...))QSGDynamicTexture::qt_metacast
+32 (int (*)(...))QSGDynamicTexture::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))__cxa_pure_virtual
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))QSGTexture::normalizedTextureSubRect
+152 (int (*)(...))QSGTexture::isAtlasTexture
+160 (int (*)(...))QSGTexture::removedFromAtlas
+168 (int (*)(...))__cxa_pure_virtual
+176 (int (*)(...))__cxa_pure_virtual
+
+Class QSGDynamicTexture
+ size=16 align=8
+ base size=16 base align=8
+QSGDynamicTexture (0x0x7f1e734818f0) 0
+ vptr=((& QSGDynamicTexture::_ZTV17QSGDynamicTexture) + 16)
+ QSGTexture (0x0x7f1e73481958) 0
+ primary-for QSGDynamicTexture (0x0x7f1e734818f0)
+ QObject (0x0x7f1e7354b3c0) 0
+ primary-for QSGTexture (0x0x7f1e73481958)
+
+Vtable for QSGImageNode
+QSGImageNode::_ZTV12QSGImageNode: 20 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QSGImageNode)
+16 0
+24 0
+32 (int (*)(...))QSGNode::isSubtreeBlocked
+40 (int (*)(...))QSGNode::preprocess
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))__cxa_pure_virtual
+72 (int (*)(...))__cxa_pure_virtual
+80 (int (*)(...))__cxa_pure_virtual
+88 (int (*)(...))__cxa_pure_virtual
+96 (int (*)(...))__cxa_pure_virtual
+104 (int (*)(...))__cxa_pure_virtual
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))__cxa_pure_virtual
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))__cxa_pure_virtual
+
+Class QSGImageNode
+ size=144 align=8
+ base size=144 base align=8
+QSGImageNode (0x0x7f1e734819c0) 0
+ vptr=((& QSGImageNode::_ZTV12QSGImageNode) + 16)
+ QSGGeometryNode (0x0x7f1e73481a28) 0
+ primary-for QSGImageNode (0x0x7f1e734819c0)
+ QSGBasicGeometryNode (0x0x7f1e73481a90) 0
+ primary-for QSGGeometryNode (0x0x7f1e73481a28)
+ QSGNode (0x0x7f1e7354b540) 0
+ primary-for QSGBasicGeometryNode (0x0x7f1e73481a90)
+
+Vtable for QSGNinePatchNode
+QSGNinePatchNode::_ZTV16QSGNinePatchNode: 11 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QSGNinePatchNode)
+16 0
+24 0
+32 (int (*)(...))QSGNode::isSubtreeBlocked
+40 (int (*)(...))QSGNode::preprocess
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))__cxa_pure_virtual
+72 (int (*)(...))__cxa_pure_virtual
+80 (int (*)(...))__cxa_pure_virtual
+
+Class QSGNinePatchNode
+ size=144 align=8
+ base size=144 base align=8
+QSGNinePatchNode (0x0x7f1e73481bc8) 0
+ vptr=((& QSGNinePatchNode::_ZTV16QSGNinePatchNode) + 16)
+ QSGGeometryNode (0x0x7f1e73481c30) 0
+ primary-for QSGNinePatchNode (0x0x7f1e73481bc8)
+ QSGBasicGeometryNode (0x0x7f1e73481c98) 0
+ primary-for QSGGeometryNode (0x0x7f1e73481c30)
+ QSGNode (0x0x7f1e7354bd20) 0
+ primary-for QSGBasicGeometryNode (0x0x7f1e73481c98)
+
+Vtable for QSGRectangleNode
+QSGRectangleNode::_ZTV16QSGRectangleNode: 10 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QSGRectangleNode)
+16 0
+24 0
+32 (int (*)(...))QSGNode::isSubtreeBlocked
+40 (int (*)(...))QSGNode::preprocess
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))__cxa_pure_virtual
+72 (int (*)(...))__cxa_pure_virtual
+
+Class QSGRectangleNode
+ size=144 align=8
+ base size=144 base align=8
+QSGRectangleNode (0x0x7f1e73481d00) 0
+ vptr=((& QSGRectangleNode::_ZTV16QSGRectangleNode) + 16)
+ QSGGeometryNode (0x0x7f1e73481d68) 0
+ primary-for QSGRectangleNode (0x0x7f1e73481d00)
+ QSGBasicGeometryNode (0x0x7f1e73481dd0) 0
+ primary-for QSGGeometryNode (0x0x7f1e73481d68)
+ QSGNode (0x0x7f1e7354bd80) 0
+ primary-for QSGBasicGeometryNode (0x0x7f1e73481dd0)
+
+Vtable for QSGRenderNode::RenderState
+QSGRenderNode::RenderState::_ZTVN13QSGRenderNode11RenderStateE: 11 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTIN13QSGRenderNode11RenderStateE)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))__cxa_pure_virtual
+72 (int (*)(...))__cxa_pure_virtual
+80 (int (*)(...))QSGRenderNode::RenderState::get
+
+Class QSGRenderNode::RenderState
+ size=8 align=8
+ base size=8 base align=8
+QSGRenderNode::RenderState (0x0x7f1e7354bea0) 0 nearly-empty
+ vptr=((& QSGRenderNode::RenderState::_ZTVN13QSGRenderNode11RenderStateE) + 16)
+
+Vtable for QSGRenderNode
+QSGRenderNode::_ZTV13QSGRenderNode: 11 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QSGRenderNode)
+16 0
+24 0
+32 (int (*)(...))QSGNode::isSubtreeBlocked
+40 (int (*)(...))QSGNode::preprocess
+48 (int (*)(...))QSGRenderNode::changedStates
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))QSGRenderNode::releaseResources
+72 (int (*)(...))QSGRenderNode::flags
+80 (int (*)(...))QSGRenderNode::rect
+
+Class QSGRenderNode
+ size=88 align=8
+ base size=88 base align=8
+QSGRenderNode (0x0x7f1e73481e38) 0
+ vptr=((& QSGRenderNode::_ZTV13QSGRenderNode) + 16)
+ QSGNode (0x0x7f1e7354be40) 0
+ primary-for QSGRenderNode (0x0x7f1e73481e38)
+
+Vtable for QSGSimpleRectNode
+QSGSimpleRectNode::_ZTV17QSGSimpleRectNode: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QSGSimpleRectNode)
+16 (int (*)(...))QSGSimpleRectNode::~QSGSimpleRectNode
+24 (int (*)(...))QSGSimpleRectNode::~QSGSimpleRectNode
+32 (int (*)(...))QSGNode::isSubtreeBlocked
+40 (int (*)(...))QSGNode::preprocess
+
+Class QSGSimpleRectNode
+ size=320 align=8
+ base size=320 base align=8
+QSGSimpleRectNode (0x0x7f1e735a03a8) 0
+ vptr=((& QSGSimpleRectNode::_ZTV17QSGSimpleRectNode) + 16)
+ QSGGeometryNode (0x0x7f1e735a0410) 0
+ primary-for QSGSimpleRectNode (0x0x7f1e735a03a8)
+ QSGBasicGeometryNode (0x0x7f1e735a0478) 0
+ primary-for QSGGeometryNode (0x0x7f1e735a0410)
+ QSGNode (0x0x7f1e735d3600) 0
+ primary-for QSGBasicGeometryNode (0x0x7f1e735a0478)
+
+Vtable for QSGOpaqueTextureMaterial
+QSGOpaqueTextureMaterial::_ZTV24QSGOpaqueTextureMaterial: 7 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI24QSGOpaqueTextureMaterial)
+16 (int (*)(...))QSGOpaqueTextureMaterial::~QSGOpaqueTextureMaterial
+24 (int (*)(...))QSGOpaqueTextureMaterial::~QSGOpaqueTextureMaterial
+32 (int (*)(...))QSGOpaqueTextureMaterial::type
+40 (int (*)(...))QSGOpaqueTextureMaterial::createShader
+48 (int (*)(...))QSGOpaqueTextureMaterial::compare
+
+Class QSGOpaqueTextureMaterial
+ size=40 align=8
+ base size=36 base align=8
+QSGOpaqueTextureMaterial (0x0x7f1e735a04e0) 0
+ vptr=((& QSGOpaqueTextureMaterial::_ZTV24QSGOpaqueTextureMaterial) + 16)
+ QSGMaterial (0x0x7f1e735d36c0) 0
+ primary-for QSGOpaqueTextureMaterial (0x0x7f1e735a04e0)
+
+Vtable for QSGTextureMaterial
+QSGTextureMaterial::_ZTV18QSGTextureMaterial: 7 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QSGTextureMaterial)
+16 (int (*)(...))QSGTextureMaterial::~QSGTextureMaterial
+24 (int (*)(...))QSGTextureMaterial::~QSGTextureMaterial
+32 (int (*)(...))QSGTextureMaterial::type
+40 (int (*)(...))QSGTextureMaterial::createShader
+48 (int (*)(...))QSGOpaqueTextureMaterial::compare
+
+Class QSGTextureMaterial
+ size=40 align=8
+ base size=36 base align=8
+QSGTextureMaterial (0x0x7f1e735a0548) 0
+ vptr=((& QSGTextureMaterial::_ZTV18QSGTextureMaterial) + 16)
+ QSGOpaqueTextureMaterial (0x0x7f1e735a05b0) 0
+ primary-for QSGTextureMaterial (0x0x7f1e735a0548)
+ QSGMaterial (0x0x7f1e735d3b40) 0
+ primary-for QSGOpaqueTextureMaterial (0x0x7f1e735a05b0)
+
+Vtable for QSGSimpleTextureNode
+QSGSimpleTextureNode::_ZTV20QSGSimpleTextureNode: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QSGSimpleTextureNode)
+16 (int (*)(...))QSGSimpleTextureNode::~QSGSimpleTextureNode
+24 (int (*)(...))QSGSimpleTextureNode::~QSGSimpleTextureNode
+32 (int (*)(...))QSGNode::isSubtreeBlocked
+40 (int (*)(...))QSGNode::preprocess
+
+Class QSGSimpleTextureNode
+ size=384 align=8
+ base size=384 base align=8
+QSGSimpleTextureNode (0x0x7f1e735a0618) 0
+ vptr=((& QSGSimpleTextureNode::_ZTV20QSGSimpleTextureNode) + 16)
+ QSGGeometryNode (0x0x7f1e735a0680) 0
+ primary-for QSGSimpleTextureNode (0x0x7f1e735a0618)
+ QSGBasicGeometryNode (0x0x7f1e735a06e8) 0
+ primary-for QSGGeometryNode (0x0x7f1e735a0680)
+ QSGNode (0x0x7f1e735d3ba0) 0
+ primary-for QSGBasicGeometryNode (0x0x7f1e735a06e8)
+
+Class QSGTextureProvider::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSGTextureProvider::QPrivateSignal (0x0x7f1e73209540) 0 empty
+
+Vtable for QSGTextureProvider
+QSGTextureProvider::_ZTV18QSGTextureProvider: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QSGTextureProvider)
+16 (int (*)(...))QSGTextureProvider::metaObject
+24 (int (*)(...))QSGTextureProvider::qt_metacast
+32 (int (*)(...))QSGTextureProvider::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+
+Class QSGTextureProvider
+ size=16 align=8
+ base size=16 base align=8
+QSGTextureProvider (0x0x7f1e735a0888) 0
+ vptr=((& QSGTextureProvider::_ZTV18QSGTextureProvider) + 16)
+ QObject (0x0x7f1e732094e0) 0
+ primary-for QSGTextureProvider (0x0x7f1e735a0888)
+
+Vtable for QSGVertexColorMaterial
+QSGVertexColorMaterial::_ZTV22QSGVertexColorMaterial: 7 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI22QSGVertexColorMaterial)
+16 (int (*)(...))QSGVertexColorMaterial::~QSGVertexColorMaterial
+24 (int (*)(...))QSGVertexColorMaterial::~QSGVertexColorMaterial
+32 (int (*)(...))QSGVertexColorMaterial::type
+40 (int (*)(...))QSGVertexColorMaterial::createShader
+48 (int (*)(...))QSGVertexColorMaterial::compare
+
+Class QSGVertexColorMaterial
+ size=24 align=8
+ base size=24 base align=8
+QSGVertexColorMaterial (0x0x7f1e735a08f0) 0
+ vptr=((& QSGVertexColorMaterial::_ZTV22QSGVertexColorMaterial) + 16)
+ QSGMaterial (0x0x7f1e73209660) 0
+ primary-for QSGVertexColorMaterial (0x0x7f1e735a08f0)
+
+Class QGeoAddress
+ size=8 align=8
+ base size=8 base align=8
+QGeoAddress (0x0x7f1e732096c0) 0
+
+Class QGeoCoordinate
+ size=8 align=8
+ base size=8 base align=8
+QGeoCoordinate (0x0x7f1e73236cc0) 0
+
+Class QGeoShape
+ size=8 align=8
+ base size=8 base align=8
+QGeoShape (0x0x7f1e73276300) 0
+
+Class QGeoAreaMonitorInfo
+ size=8 align=8
+ base size=8 base align=8
+QGeoAreaMonitorInfo (0x0x7f1e732a64e0) 0
+
+Class QGeoPositionInfo
+ size=8 align=8
+ base size=8 base align=8
+QGeoPositionInfo (0x0x7f1e732a65a0) 0
+
+Class QGeoPositionInfoSource::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QGeoPositionInfoSource::QPrivateSignal (0x0x7f1e732a68a0) 0 empty
+
+Vtable for QGeoPositionInfoSource
+QGeoPositionInfoSource::_ZTV22QGeoPositionInfoSource: 23 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI22QGeoPositionInfoSource)
+16 (int (*)(...))QGeoPositionInfoSource::metaObject
+24 (int (*)(...))QGeoPositionInfoSource::qt_metacast
+32 (int (*)(...))QGeoPositionInfoSource::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QGeoPositionInfoSource::setUpdateInterval
+120 (int (*)(...))QGeoPositionInfoSource::setPreferredPositioningMethods
+128 (int (*)(...))__cxa_pure_virtual
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))__cxa_pure_virtual
+160 (int (*)(...))__cxa_pure_virtual
+168 (int (*)(...))__cxa_pure_virtual
+176 (int (*)(...))__cxa_pure_virtual
+
+Class QGeoPositionInfoSource
+ size=24 align=8
+ base size=24 base align=8
+QGeoPositionInfoSource (0x0x7f1e732a2750) 0
+ vptr=((& QGeoPositionInfoSource::_ZTV22QGeoPositionInfoSource) + 16)
+ QObject (0x0x7f1e732a6840) 0
+ primary-for QGeoPositionInfoSource (0x0x7f1e732a2750)
+
+Class QGeoAreaMonitorSource::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QGeoAreaMonitorSource::QPrivateSignal (0x0x7f1e732e1120) 0 empty
+
+Vtable for QGeoAreaMonitorSource
+QGeoAreaMonitorSource::_ZTV21QGeoAreaMonitorSource: 23 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI21QGeoAreaMonitorSource)
+16 (int (*)(...))QGeoAreaMonitorSource::metaObject
+24 (int (*)(...))QGeoAreaMonitorSource::qt_metacast
+32 (int (*)(...))QGeoAreaMonitorSource::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QGeoAreaMonitorSource::setPositionInfoSource
+120 (int (*)(...))QGeoAreaMonitorSource::positionInfoSource
+128 (int (*)(...))__cxa_pure_virtual
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))__cxa_pure_virtual
+160 (int (*)(...))__cxa_pure_virtual
+168 (int (*)(...))__cxa_pure_virtual
+176 (int (*)(...))__cxa_pure_virtual
+
+Class QGeoAreaMonitorSource
+ size=24 align=8
+ base size=24 base align=8
+QGeoAreaMonitorSource (0x0x7f1e732a2888) 0
+ vptr=((& QGeoAreaMonitorSource::_ZTV21QGeoAreaMonitorSource) + 16)
+ QObject (0x0x7f1e732e10c0) 0
+ primary-for QGeoAreaMonitorSource (0x0x7f1e732a2888)
+
+Class QGeoRectangle
+ size=8 align=8
+ base size=8 base align=8
+QGeoRectangle (0x0x7f1e732a28f0) 0
+ QGeoShape (0x0x7f1e732e1240) 0
+
+Class QGeoCircle
+ size=8 align=8
+ base size=8 base align=8
+QGeoCircle (0x0x7f1e7330dc98) 0
+ QGeoShape (0x0x7f1e733166c0) 0
+
+Class QGeoLocation
+ size=8 align=8
+ base size=8 base align=8
+QGeoLocation (0x0x7f1e7335a8a0) 0
+
+Class QGeoPath
+ size=8 align=8
+ base size=8 base align=8
+QGeoPath (0x0x7f1e7338b750) 0
+ QGeoShape (0x0x7f1e73384f00) 0
+
+Class QGeoPolygon
+ size=8 align=8
+ base size=8 base align=8
+QGeoPolygon (0x0x7f1e733b88f0) 0
+ QGeoShape (0x0x7f1e733c0120) 0
+
+Class QGeoSatelliteInfo
+ size=8 align=8
+ base size=8 base align=8
+QGeoSatelliteInfo (0x0x7f1e72feb300) 0
+
+Class QGeoSatelliteInfoSource::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QGeoSatelliteInfoSource::QPrivateSignal (0x0x7f1e72feb420) 0 empty
+
+Vtable for QGeoSatelliteInfoSource
+QGeoSatelliteInfoSource::_ZTV23QGeoSatelliteInfoSource: 20 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI23QGeoSatelliteInfoSource)
+16 (int (*)(...))QGeoSatelliteInfoSource::metaObject
+24 (int (*)(...))QGeoSatelliteInfoSource::qt_metacast
+32 (int (*)(...))QGeoSatelliteInfoSource::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QGeoSatelliteInfoSource::setUpdateInterval
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))__cxa_pure_virtual
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))__cxa_pure_virtual
+
+Class QGeoSatelliteInfoSource
+ size=24 align=8
+ base size=24 base align=8
+QGeoSatelliteInfoSource (0x0x7f1e72fe0c30) 0
+ vptr=((& QGeoSatelliteInfoSource::_ZTV23QGeoSatelliteInfoSource) + 16)
+ QObject (0x0x7f1e72feb3c0) 0
+ primary-for QGeoSatelliteInfoSource (0x0x7f1e72fe0c30)
+
+Vtable for QGeoPositionInfoSourceFactory
+QGeoPositionInfoSourceFactory::_ZTV29QGeoPositionInfoSourceFactory: 7 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI29QGeoPositionInfoSourceFactory)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+
+Class QGeoPositionInfoSourceFactory
+ size=8 align=8
+ base size=8 base align=8
+QGeoPositionInfoSourceFactory (0x0x7f1e72feb5a0) 0 nearly-empty
+ vptr=((& QGeoPositionInfoSourceFactory::_ZTV29QGeoPositionInfoSourceFactory) + 16)
+
+Vtable for QGeoPositionInfoSourceFactoryV2
+QGeoPositionInfoSourceFactoryV2::_ZTV31QGeoPositionInfoSourceFactoryV2: 10 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI31QGeoPositionInfoSourceFactoryV2)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))__cxa_pure_virtual
+72 (int (*)(...))__cxa_pure_virtual
+
+Class QGeoPositionInfoSourceFactoryV2
+ size=8 align=8
+ base size=8 base align=8
+QGeoPositionInfoSourceFactoryV2 (0x0x7f1e72fe0c98) 0 nearly-empty
+ vptr=((& QGeoPositionInfoSourceFactoryV2::_ZTV31QGeoPositionInfoSourceFactoryV2) + 16)
+ QGeoPositionInfoSourceFactory (0x0x7f1e72feb780) 0 nearly-empty
+ primary-for QGeoPositionInfoSourceFactoryV2 (0x0x7f1e72fe0c98)
+
+Class QNmeaPositionInfoSource::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QNmeaPositionInfoSource::QPrivateSignal (0x0x7f1e72feb9c0) 0 empty
+
+Vtable for QNmeaPositionInfoSource
+QNmeaPositionInfoSource::_ZTV23QNmeaPositionInfoSource: 24 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI23QNmeaPositionInfoSource)
+16 (int (*)(...))QNmeaPositionInfoSource::metaObject
+24 (int (*)(...))QNmeaPositionInfoSource::qt_metacast
+32 (int (*)(...))QNmeaPositionInfoSource::qt_metacall
+40 (int (*)(...))QNmeaPositionInfoSource::~QNmeaPositionInfoSource
+48 (int (*)(...))QNmeaPositionInfoSource::~QNmeaPositionInfoSource
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QNmeaPositionInfoSource::setUpdateInterval
+120 (int (*)(...))QGeoPositionInfoSource::setPreferredPositioningMethods
+128 (int (*)(...))QNmeaPositionInfoSource::lastKnownPosition
+136 (int (*)(...))QNmeaPositionInfoSource::supportedPositioningMethods
+144 (int (*)(...))QNmeaPositionInfoSource::minimumUpdateInterval
+152 (int (*)(...))QNmeaPositionInfoSource::error
+160 (int (*)(...))QNmeaPositionInfoSource::startUpdates
+168 (int (*)(...))QNmeaPositionInfoSource::stopUpdates
+176 (int (*)(...))QNmeaPositionInfoSource::requestUpdate
+184 (int (*)(...))QNmeaPositionInfoSource::parsePosInfoFromNmeaData
+
+Class QNmeaPositionInfoSource
+ size=32 align=8
+ base size=32 base align=8
+QNmeaPositionInfoSource (0x0x7f1e72fe0d00) 0
+ vptr=((& QNmeaPositionInfoSource::_ZTV23QNmeaPositionInfoSource) + 16)
+ QGeoPositionInfoSource (0x0x7f1e72fe0d68) 0
+ primary-for QNmeaPositionInfoSource (0x0x7f1e72fe0d00)
+ QObject (0x0x7f1e72feb960) 0
+ primary-for QGeoPositionInfoSource (0x0x7f1e72fe0d68)
+
+Class QWebChannel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QWebChannel::QPrivateSignal (0x0x7f1e72febb40) 0 empty
+
+Vtable for QWebChannel
+QWebChannel::_ZTV11QWebChannel: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QWebChannel)
+16 (int (*)(...))QWebChannel::metaObject
+24 (int (*)(...))QWebChannel::qt_metacast
+32 (int (*)(...))QWebChannel::qt_metacall
+40 (int (*)(...))QWebChannel::~QWebChannel
+48 (int (*)(...))QWebChannel::~QWebChannel
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QWebChannel
+ size=16 align=8
+ base size=16 base align=8
+QWebChannel (0x0x7f1e72fe0dd0) 0
+ vptr=((& QWebChannel::_ZTV11QWebChannel) + 16)
+ QObject (0x0x7f1e72febae0) 0
+ primary-for QWebChannel (0x0x7f1e72fe0dd0)
+
+Class QQmlWebChannel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQmlWebChannel::QPrivateSignal (0x0x7f1e72febd80) 0 empty
+
+Vtable for QQmlWebChannel
+QQmlWebChannel::_ZTV14QQmlWebChannel: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QQmlWebChannel)
+16 (int (*)(...))QQmlWebChannel::metaObject
+24 (int (*)(...))QQmlWebChannel::qt_metacast
+32 (int (*)(...))QQmlWebChannel::qt_metacall
+40 (int (*)(...))QQmlWebChannel::~QQmlWebChannel
+48 (int (*)(...))QQmlWebChannel::~QQmlWebChannel
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QQmlWebChannel
+ size=16 align=8
+ base size=16 base align=8
+QQmlWebChannel (0x0x7f1e72fe0e38) 0
+ vptr=((& QQmlWebChannel::_ZTV14QQmlWebChannel) + 16)
+ QWebChannel (0x0x7f1e72fe0ea0) 0
+ primary-for QQmlWebChannel (0x0x7f1e72fe0e38)
+ QObject (0x0x7f1e72febd20) 0
+ primary-for QWebChannel (0x0x7f1e72fe0ea0)
+
+Class QWebChannelAbstractTransport::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QWebChannelAbstractTransport::QPrivateSignal (0x0x7f1e73024900) 0 empty
+
+Vtable for QWebChannelAbstractTransport
+QWebChannelAbstractTransport::_ZTV28QWebChannelAbstractTransport: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI28QWebChannelAbstractTransport)
+16 (int (*)(...))QWebChannelAbstractTransport::metaObject
+24 (int (*)(...))QWebChannelAbstractTransport::qt_metacast
+32 (int (*)(...))QWebChannelAbstractTransport::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+
+Class QWebChannelAbstractTransport
+ size=16 align=8
+ base size=16 base align=8
+QWebChannelAbstractTransport (0x0x7f1e73036410) 0
+ vptr=((& QWebChannelAbstractTransport::_ZTV28QWebChannelAbstractTransport) + 16)
+ QObject (0x0x7f1e730248a0) 0
+ primary-for QWebChannelAbstractTransport (0x0x7f1e73036410)
+
+Class QWebEngineClientCertificateStore
+ size=8 align=8
+ base size=8 base align=8
+QWebEngineClientCertificateStore (0x0x7f1e73115f00) 0
+
+Class QWebEngineCookieStore::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QWebEngineCookieStore::QPrivateSignal (0x0x7f1e7312f000) 0 empty
+
+Class QWebEngineCookieStore::FilterRequest
+ size=24 align=8
+ base size=20 base align=8
+QWebEngineCookieStore::FilterRequest (0x0x7f1e7312f060) 0
+
+Vtable for QWebEngineCookieStore
+QWebEngineCookieStore::_ZTV21QWebEngineCookieStore: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI21QWebEngineCookieStore)
+16 (int (*)(...))QWebEngineCookieStore::metaObject
+24 (int (*)(...))QWebEngineCookieStore::qt_metacast
+32 (int (*)(...))QWebEngineCookieStore::qt_metacall
+40 (int (*)(...))QWebEngineCookieStore::~QWebEngineCookieStore
+48 (int (*)(...))QWebEngineCookieStore::~QWebEngineCookieStore
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QWebEngineCookieStore
+ size=24 align=8
+ base size=24 base align=8
+QWebEngineCookieStore (0x0x7f1e73119dd0) 0
+ vptr=((& QWebEngineCookieStore::_ZTV21QWebEngineCookieStore) + 16)
+ QObject (0x0x7f1e73115f60) 0
+ primary-for QWebEngineCookieStore (0x0x7f1e73119dd0)
+
+Class QWebEngineFindTextResult
+ size=8 align=8
+ base size=8 base align=8
+QWebEngineFindTextResult (0x0x7f1e7312f4e0) 0
+
+Class QWebEngineHttpRequest
+ size=8 align=8
+ base size=8 base align=8
+QWebEngineHttpRequest (0x0x7f1e7312f780) 0
+
+Class QWebEngineNotification::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QWebEngineNotification::QPrivateSignal (0x0x7f1e731be900) 0 empty
+
+Vtable for QWebEngineNotification
+QWebEngineNotification::_ZTV22QWebEngineNotification: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI22QWebEngineNotification)
+16 (int (*)(...))QWebEngineNotification::metaObject
+24 (int (*)(...))QWebEngineNotification::qt_metacast
+32 (int (*)(...))QWebEngineNotification::qt_metacall
+40 (int (*)(...))QWebEngineNotification::~QWebEngineNotification
+48 (int (*)(...))QWebEngineNotification::~QWebEngineNotification
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QWebEngineNotification
+ size=24 align=8
+ base size=24 base align=8
+QWebEngineNotification (0x0x7f1e731b8a28) 0
+ vptr=((& QWebEngineNotification::_ZTV22QWebEngineNotification) + 16)
+ QObject (0x0x7f1e731be8a0) 0
+ primary-for QWebEngineNotification (0x0x7f1e731b8a28)
+
+Class QWebEngineQuotaRequest
+ size=16 align=8
+ base size=16 base align=8
+QWebEngineQuotaRequest (0x0x7f1e731beba0) 0
+
+Class QWebEngineRegisterProtocolHandlerRequest
+ size=16 align=8
+ base size=16 base align=8
+QWebEngineRegisterProtocolHandlerRequest (0x0x7f1e72dfa720) 0
+
+Class QWebEngineUrlRequestInfo
+ size=8 align=8
+ base size=8 base align=8
+QWebEngineUrlRequestInfo (0x0x7f1e72e26060) 0
+
+Class QWebEngineUrlRequestInterceptor::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QWebEngineUrlRequestInterceptor::QPrivateSignal (0x0x7f1e72e262a0) 0 empty
+
+Vtable for QWebEngineUrlRequestInterceptor
+QWebEngineUrlRequestInterceptor::_ZTV31QWebEngineUrlRequestInterceptor: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI31QWebEngineUrlRequestInterceptor)
+16 (int (*)(...))QWebEngineUrlRequestInterceptor::metaObject
+24 (int (*)(...))QWebEngineUrlRequestInterceptor::qt_metacast
+32 (int (*)(...))QWebEngineUrlRequestInterceptor::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+
+Class QWebEngineUrlRequestInterceptor
+ size=16 align=8
+ base size=16 base align=8
+QWebEngineUrlRequestInterceptor (0x0x7f1e72dfc8f0) 0
+ vptr=((& QWebEngineUrlRequestInterceptor::_ZTV31QWebEngineUrlRequestInterceptor) + 16)
+ QObject (0x0x7f1e72e26240) 0
+ primary-for QWebEngineUrlRequestInterceptor (0x0x7f1e72dfc8f0)
+
+Class QWebEngineUrlRequestJob::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QWebEngineUrlRequestJob::QPrivateSignal (0x0x7f1e72e265a0) 0 empty
+
+Vtable for QWebEngineUrlRequestJob
+QWebEngineUrlRequestJob::_ZTV23QWebEngineUrlRequestJob: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI23QWebEngineUrlRequestJob)
+16 (int (*)(...))QWebEngineUrlRequestJob::metaObject
+24 (int (*)(...))QWebEngineUrlRequestJob::qt_metacast
+32 (int (*)(...))QWebEngineUrlRequestJob::qt_metacall
+40 (int (*)(...))QWebEngineUrlRequestJob::~QWebEngineUrlRequestJob
+48 (int (*)(...))QWebEngineUrlRequestJob::~QWebEngineUrlRequestJob
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QWebEngineUrlRequestJob
+ size=24 align=8
+ base size=24 base align=8
+QWebEngineUrlRequestJob (0x0x7f1e72dfc958) 0
+ vptr=((& QWebEngineUrlRequestJob::_ZTV23QWebEngineUrlRequestJob) + 16)
+ QObject (0x0x7f1e72e26540) 0
+ primary-for QWebEngineUrlRequestJob (0x0x7f1e72dfc958)
+
+Class QWebEngineUrlScheme
+ size=8 align=8
+ base size=8 base align=8
+QWebEngineUrlScheme (0x0x7f1e72e26780) 0
+
+Class QWebEngineUrlSchemeHandler::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QWebEngineUrlSchemeHandler::QPrivateSignal (0x0x7f1e72e68540) 0 empty
+
+Vtable for QWebEngineUrlSchemeHandler
+QWebEngineUrlSchemeHandler::_ZTV26QWebEngineUrlSchemeHandler: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI26QWebEngineUrlSchemeHandler)
+16 (int (*)(...))QWebEngineUrlSchemeHandler::metaObject
+24 (int (*)(...))QWebEngineUrlSchemeHandler::qt_metacast
+32 (int (*)(...))QWebEngineUrlSchemeHandler::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+
+Class QWebEngineUrlSchemeHandler
+ size=16 align=8
+ base size=16 base align=8
+QWebEngineUrlSchemeHandler (0x0x7f1e72dfcf70) 0
+ vptr=((& QWebEngineUrlSchemeHandler::_ZTV26QWebEngineUrlSchemeHandler) + 16)
+ QObject (0x0x7f1e72e684e0) 0
+ primary-for QWebEngineUrlSchemeHandler (0x0x7f1e72dfcf70)
+
+Class QQuickWebEngineProfile::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQuickWebEngineProfile::QPrivateSignal (0x0x7f1e72e686c0) 0 empty
+
+Vtable for QQuickWebEngineProfile
+QQuickWebEngineProfile::_ZTV22QQuickWebEngineProfile: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI22QQuickWebEngineProfile)
+16 (int (*)(...))QQuickWebEngineProfile::metaObject
+24 (int (*)(...))QQuickWebEngineProfile::qt_metacast
+32 (int (*)(...))QQuickWebEngineProfile::qt_metacall
+40 (int (*)(...))QQuickWebEngineProfile::~QQuickWebEngineProfile
+48 (int (*)(...))QQuickWebEngineProfile::~QQuickWebEngineProfile
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QQuickWebEngineProfile
+ size=24 align=8
+ base size=24 base align=8
+QQuickWebEngineProfile (0x0x7f1e72e71000) 0
+ vptr=((& QQuickWebEngineProfile::_ZTV22QQuickWebEngineProfile) + 16)
+ QObject (0x0x7f1e72e68660) 0
+ primary-for QQuickWebEngineProfile (0x0x7f1e72e71000)
+
+Class QQuickWebEngineScript::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQuickWebEngineScript::QPrivateSignal (0x0x7f1e72e68b40) 0 empty
+
+Vtable for QQuickWebEngineScript
+QQuickWebEngineScript::_ZTV21QQuickWebEngineScript: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI21QQuickWebEngineScript)
+16 (int (*)(...))QQuickWebEngineScript::metaObject
+24 (int (*)(...))QQuickWebEngineScript::qt_metacast
+32 (int (*)(...))QQuickWebEngineScript::qt_metacall
+40 (int (*)(...))QQuickWebEngineScript::~QQuickWebEngineScript
+48 (int (*)(...))QQuickWebEngineScript::~QQuickWebEngineScript
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QQuickWebEngineScript::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QQuickWebEngineScript
+ size=24 align=8
+ base size=24 base align=8
+QQuickWebEngineScript (0x0x7f1e72e71068) 0
+ vptr=((& QQuickWebEngineScript::_ZTV21QQuickWebEngineScript) + 16)
+ QObject (0x0x7f1e72e68ae0) 0
+ primary-for QQuickWebEngineScript (0x0x7f1e72e71068)
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Save_errno (0x0x7f1e72eb0240) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Range_chk (0x0x7f1e72eb05a0) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = long int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = long int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Save_errno (0x0x7f1e72eb0780) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = long int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = long int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Range_chk (0x0x7f1e72eb0ae0) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long unsigned int; _Ret = long unsigned int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long unsigned int; _Ret = long unsigned int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Save_errno (0x0x7f1e72eb0cc0) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long unsigned int; _Ret = long unsigned int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long unsigned int; _Ret = long unsigned int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Range_chk (0x0x7f1e72ed2060) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long int; _Ret = long long int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long int; _Ret = long long int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Save_errno (0x0x7f1e72ed2240) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long int; _Ret = long long int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long int; _Ret = long long int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Range_chk (0x0x7f1e72ed25a0) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long unsigned int; _Ret = long long unsigned int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long unsigned int; _Ret = long long unsigned int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Save_errno (0x0x7f1e72ed2780) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long unsigned int; _Ret = long long unsigned int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long unsigned int; _Ret = long long unsigned int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Range_chk (0x0x7f1e72ed2ae0) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = float; _Ret = float; _CharT = char; _Base = {}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = float; _Ret = float; _CharT = char; _Base = {}; std::size_t = long unsigned int]::_Save_errno (0x0x7f1e72ed2cc0) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = float; _Ret = float; _CharT = char; _Base = {}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = float; _Ret = float; _CharT = char; _Base = {}; std::size_t = long unsigned int]::_Range_chk (0x0x7f1e72ef4060) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = double; _Ret = double; _CharT = char; _Base = {}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = double; _Ret = double; _CharT = char; _Base = {}; std::size_t = long unsigned int]::_Save_errno (0x0x7f1e72ef4240) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = double; _Ret = double; _CharT = char; _Base = {}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = double; _Ret = double; _CharT = char; _Base = {}; std::size_t = long unsigned int]::_Range_chk (0x0x7f1e72ef45a0) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long double; _Ret = long double; _CharT = char; _Base = {}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long double; _Ret = long double; _CharT = char; _Base = {}; std::size_t = long unsigned int]::_Save_errno (0x0x7f1e72ef4780) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long double; _Ret = long double; _CharT = char; _Base = {}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long double; _Ret = long double; _CharT = char; _Base = {}; std::size_t = long unsigned int]::_Range_chk (0x0x7f1e72ef4ae0) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Save_errno (0x0x7f1e72f28000) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Range_chk (0x0x7f1e72f28360) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = long int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = long int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Save_errno (0x0x7f1e72f284e0) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = long int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = long int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Range_chk (0x0x7f1e72f28840) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long unsigned int; _Ret = long unsigned int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long unsigned int; _Ret = long unsigned int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Save_errno (0x0x7f1e72f289c0) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long unsigned int; _Ret = long unsigned int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long unsigned int; _Ret = long unsigned int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Range_chk (0x0x7f1e72f28d20) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long int; _Ret = long long int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long int; _Ret = long long int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Save_errno (0x0x7f1e72f28ea0) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long int; _Ret = long long int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long int; _Ret = long long int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Range_chk (0x0x7f1e72f46240) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long unsigned int; _Ret = long long unsigned int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long unsigned int; _Ret = long long unsigned int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Save_errno (0x0x7f1e72f463c0) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long unsigned int; _Ret = long long unsigned int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long unsigned int; _Ret = long long unsigned int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Range_chk (0x0x7f1e72f46720) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = float; _Ret = float; _CharT = wchar_t; _Base = {}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = float; _Ret = float; _CharT = wchar_t; _Base = {}; std::size_t = long unsigned int]::_Save_errno (0x0x7f1e72f468a0) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = float; _Ret = float; _CharT = wchar_t; _Base = {}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = float; _Ret = float; _CharT = wchar_t; _Base = {}; std::size_t = long unsigned int]::_Range_chk (0x0x7f1e72f46c00) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = double; _Ret = double; _CharT = wchar_t; _Base = {}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = double; _Ret = double; _CharT = wchar_t; _Base = {}; std::size_t = long unsigned int]::_Save_errno (0x0x7f1e72f46d80) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = double; _Ret = double; _CharT = wchar_t; _Base = {}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = double; _Ret = double; _CharT = wchar_t; _Base = {}; std::size_t = long unsigned int]::_Range_chk (0x0x7f1e72f5d120) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long double; _Ret = long double; _CharT = wchar_t; _Base = {}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long double; _Ret = long double; _CharT = wchar_t; _Base = {}; std::size_t = long unsigned int]::_Save_errno (0x0x7f1e72f5d2a0) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long double; _Ret = long double; _CharT = wchar_t; _Base = {}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long double; _Ret = long double; _CharT = wchar_t; _Base = {}; std::size_t = long unsigned int]::_Range_chk (0x0x7f1e72f5d600) 0 empty
+
diff --git a/tests/auto/bic/data/QtWebEngineCore.5.15.0.linux-gcc-amd64.txt b/tests/auto/bic/data/QtWebEngineCore.5.15.0.linux-gcc-amd64.txt
new file mode 100644
index 000000000..71f0baaa2
--- /dev/null
+++ b/tests/auto/bic/data/QtWebEngineCore.5.15.0.linux-gcc-amd64.txt
@@ -0,0 +1,12222 @@
+Class std::__failure_type
+ size=1 align=1
+ base size=0 base align=1
+std::__failure_type (0x0x7f78576e39c0) 0 empty
+
+Class std::__do_is_destructible_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__do_is_destructible_impl (0x0x7f78577a5180) 0 empty
+
+Class std::__do_is_nt_destructible_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__do_is_nt_destructible_impl (0x0x7f78577a53c0) 0 empty
+
+Class std::__do_is_default_constructible_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__do_is_default_constructible_impl (0x0x7f78577a5600) 0 empty
+
+Class std::__do_is_static_castable_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__do_is_static_castable_impl (0x0x7f78577a5840) 0 empty
+
+Class std::__do_is_direct_constructible_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__do_is_direct_constructible_impl (0x0x7f78577a59c0) 0 empty
+
+Class std::__do_is_nary_constructible_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__do_is_nary_constructible_impl (0x0x7f78577a5d80) 0 empty
+
+Class std::__do_is_implicitly_default_constructible_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__do_is_implicitly_default_constructible_impl (0x0x7f78577e7ea0) 0 empty
+
+Class std::__do_common_type_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__do_common_type_impl (0x0x7f78578675a0) 0 empty
+
+Class std::__do_member_type_wrapper
+ size=1 align=1
+ base size=0 base align=1
+std::__do_member_type_wrapper (0x0x7f7857867660) 0 empty
+
+Class std::__invoke_memfun_ref
+ size=1 align=1
+ base size=0 base align=1
+std::__invoke_memfun_ref (0x0x7f7857867a20) 0 empty
+
+Class std::__invoke_memfun_deref
+ size=1 align=1
+ base size=0 base align=1
+std::__invoke_memfun_deref (0x0x7f7857867a80) 0 empty
+
+Class std::__invoke_memobj_ref
+ size=1 align=1
+ base size=0 base align=1
+std::__invoke_memobj_ref (0x0x7f7857867ae0) 0 empty
+
+Class std::__invoke_memobj_deref
+ size=1 align=1
+ base size=0 base align=1
+std::__invoke_memobj_deref (0x0x7f7857867b40) 0 empty
+
+Class std::__invoke_other
+ size=1 align=1
+ base size=0 base align=1
+std::__invoke_other (0x0x7f7857867ba0) 0 empty
+
+Class std::__result_of_memfun_ref_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__result_of_memfun_ref_impl (0x0x7f7857867c60) 0 empty
+
+Class std::__result_of_memfun_deref_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__result_of_memfun_deref_impl (0x0x7f7857867d20) 0 empty
+
+Class std::__result_of_memobj_ref_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__result_of_memobj_ref_impl (0x0x7f7857867de0) 0 empty
+
+Class std::__result_of_memobj_deref_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__result_of_memobj_deref_impl (0x0x7f7857867ea0) 0 empty
+
+Class std::__result_of_other_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__result_of_other_impl (0x0x7f785789f240) 0 empty
+
+Class std::__swappable_details::__do_is_swappable_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__swappable_details::__do_is_swappable_impl (0x0x7f785789f5a0) 0 empty
+
+Class std::__swappable_details::__do_is_nothrow_swappable_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__swappable_details::__do_is_nothrow_swappable_impl (0x0x7f785789f600) 0 empty
+
+Class std::__nonesuch
+ size=1 align=1
+ base size=0 base align=1
+std::__nonesuch (0x0x7f785789fba0) 0 empty
+
+Class std::piecewise_construct_t
+ size=1 align=1
+ base size=0 base align=1
+std::piecewise_construct_t (0x0x7f78578e5240) 0 empty
+
+Class std::__nonesuch_no_braces
+ size=1 align=1
+ base size=1 base align=1
+std::__nonesuch_no_braces (0x0x7f7857851c98) 0 empty
+ std::__nonesuch (0x0x7f78578e5720) 0 empty
+
+Class std::__true_type
+ size=1 align=1
+ base size=0 base align=1
+std::__true_type (0x0x7f78579650c0) 0 empty
+
+Class std::__false_type
+ size=1 align=1
+ base size=0 base align=1
+std::__false_type (0x0x7f7857965120) 0 empty
+
+Class std::input_iterator_tag
+ size=1 align=1
+ base size=0 base align=1
+std::input_iterator_tag (0x0x7f7857997de0) 0 empty
+
+Class std::output_iterator_tag
+ size=1 align=1
+ base size=0 base align=1
+std::output_iterator_tag (0x0x7f7857997e40) 0 empty
+
+Class std::forward_iterator_tag
+ size=1 align=1
+ base size=1 base align=1
+std::forward_iterator_tag (0x0x7f78579631a0) 0 empty
+ std::input_iterator_tag (0x0x7f7857997ea0) 0 empty
+
+Class std::bidirectional_iterator_tag
+ size=1 align=1
+ base size=1 base align=1
+std::bidirectional_iterator_tag (0x0x7f7857963208) 0 empty
+ std::forward_iterator_tag (0x0x7f7857963270) 0 empty
+ std::input_iterator_tag (0x0x7f7857997f00) 0 empty
+
+Class std::random_access_iterator_tag
+ size=1 align=1
+ base size=1 base align=1
+std::random_access_iterator_tag (0x0x7f78579632d8) 0 empty
+ std::bidirectional_iterator_tag (0x0x7f7857963340) 0 empty
+ std::forward_iterator_tag (0x0x7f78579633a8) 0 empty
+ std::input_iterator_tag (0x0x7f7857997f60) 0 empty
+
+Class __gnu_cxx::__ops::_Iter_less_iter
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__ops::_Iter_less_iter (0x0x7f785704ba80) 0 empty
+
+Class __gnu_cxx::__ops::_Iter_less_val
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__ops::_Iter_less_val (0x0x7f785704bba0) 0 empty
+
+Class __gnu_cxx::__ops::_Val_less_iter
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__ops::_Val_less_iter (0x0x7f785704bea0) 0 empty
+
+Class __gnu_cxx::__ops::_Iter_equal_to_iter
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__ops::_Iter_equal_to_iter (0x0x7f78570711e0) 0 empty
+
+Class __gnu_cxx::__ops::_Iter_equal_to_val
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__ops::_Iter_equal_to_val (0x0x7f7857071300) 0 empty
+
+Class __locale_struct
+ size=232 align=8
+ base size=232 base align=8
+__locale_struct (0x0x7f78570fd600) 0
+
+Class timeval
+ size=16 align=8
+ base size=16 base align=8
+timeval (0x0x7f78570fd900) 0
+
+Class timespec
+ size=16 align=8
+ base size=16 base align=8
+timespec (0x0x7f78570fd960) 0
+
+Class __pthread_rwlock_arch_t
+ size=56 align=8
+ base size=56 base align=8
+__pthread_rwlock_arch_t (0x0x7f78570fda20) 0
+
+Class __pthread_internal_list
+ size=16 align=8
+ base size=16 base align=8
+__pthread_internal_list (0x0x7f78570fda80) 0
+
+Class __pthread_mutex_s
+ size=40 align=8
+ base size=40 base align=8
+__pthread_mutex_s (0x0x7f78570fdae0) 0
+
+Class __pthread_cond_s
+ size=48 align=8
+ base size=48 base align=8
+__pthread_cond_s (0x0x7f78570fdb40) 0
+
+Class pthread_attr_t
+ size=56 align=8
+ base size=56 base align=8
+pthread_attr_t (0x0x7f78570fdde0) 0
+
+Class random_data
+ size=48 align=8
+ base size=48 base align=8
+random_data (0x0x7f785713d0c0) 0
+
+Class drand48_data
+ size=24 align=8
+ base size=24 base align=8
+drand48_data (0x0x7f785713d120) 0
+
+Vtable for std::exception
+std::exception::_ZTVSt9exception: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt9exception)
+16 (int (*)(...))std::exception::~exception
+24 (int (*)(...))std::exception::~exception
+32 (int (*)(...))std::exception::what
+
+Class std::exception
+ size=8 align=8
+ base size=8 base align=8
+std::exception (0x0x7f785713dea0) 0 nearly-empty
+ vptr=((& std::exception::_ZTVSt9exception) + 16)
+
+Vtable for std::bad_exception
+std::bad_exception::_ZTVSt13bad_exception: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt13bad_exception)
+16 (int (*)(...))std::bad_exception::~bad_exception
+24 (int (*)(...))std::bad_exception::~bad_exception
+32 (int (*)(...))std::bad_exception::what
+
+Class std::bad_exception
+ size=8 align=8
+ base size=8 base align=8
+std::bad_exception (0x0x7f78579636e8) 0 nearly-empty
+ vptr=((& std::bad_exception::_ZTVSt13bad_exception) + 16)
+ std::exception (0x0x7f7856dfa0c0) 0 nearly-empty
+ primary-for std::bad_exception (0x0x7f78579636e8)
+
+Vtable for std::type_info
+std::type_info::_ZTVSt9type_info: 8 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt9type_info)
+16 (int (*)(...))std::type_info::~type_info
+24 (int (*)(...))std::type_info::~type_info
+32 (int (*)(...))std::type_info::__is_pointer_p
+40 (int (*)(...))std::type_info::__is_function_p
+48 (int (*)(...))std::type_info::__do_catch
+56 (int (*)(...))std::type_info::__do_upcast
+
+Class std::type_info
+ size=16 align=8
+ base size=16 base align=8
+std::type_info (0x0x7f7856dfa2a0) 0
+ vptr=((& std::type_info::_ZTVSt9type_info) + 16)
+
+Vtable for std::bad_cast
+std::bad_cast::_ZTVSt8bad_cast: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt8bad_cast)
+16 (int (*)(...))std::bad_cast::~bad_cast
+24 (int (*)(...))std::bad_cast::~bad_cast
+32 (int (*)(...))std::bad_cast::what
+
+Class std::bad_cast
+ size=8 align=8
+ base size=8 base align=8
+std::bad_cast (0x0x7f7857963750) 0 nearly-empty
+ vptr=((& std::bad_cast::_ZTVSt8bad_cast) + 16)
+ std::exception (0x0x7f7856dfa660) 0 nearly-empty
+ primary-for std::bad_cast (0x0x7f7857963750)
+
+Vtable for std::bad_typeid
+std::bad_typeid::_ZTVSt10bad_typeid: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt10bad_typeid)
+16 (int (*)(...))std::bad_typeid::~bad_typeid
+24 (int (*)(...))std::bad_typeid::~bad_typeid
+32 (int (*)(...))std::bad_typeid::what
+
+Class std::bad_typeid
+ size=8 align=8
+ base size=8 base align=8
+std::bad_typeid (0x0x7f78579637b8) 0 nearly-empty
+ vptr=((& std::bad_typeid::_ZTVSt10bad_typeid) + 16)
+ std::exception (0x0x7f7856dfa840) 0 nearly-empty
+ primary-for std::bad_typeid (0x0x7f78579637b8)
+
+Class std::__exception_ptr::exception_ptr
+ size=8 align=8
+ base size=8 base align=8
+std::__exception_ptr::exception_ptr (0x0x7f7856dfaa20) 0
+
+Vtable for std::nested_exception
+std::nested_exception::_ZTVSt16nested_exception: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt16nested_exception)
+16 (int (*)(...))std::nested_exception::~nested_exception
+24 (int (*)(...))std::nested_exception::~nested_exception
+
+Class std::nested_exception
+ size=16 align=8
+ base size=16 base align=8
+std::nested_exception (0x0x7f7856e2f000) 0
+ vptr=((& std::nested_exception::_ZTVSt16nested_exception) + 16)
+
+Vtable for std::bad_alloc
+std::bad_alloc::_ZTVSt9bad_alloc: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt9bad_alloc)
+16 (int (*)(...))std::bad_alloc::~bad_alloc
+24 (int (*)(...))std::bad_alloc::~bad_alloc
+32 (int (*)(...))std::bad_alloc::what
+
+Class std::bad_alloc
+ size=8 align=8
+ base size=8 base align=8
+std::bad_alloc (0x0x7f7857963820) 0 nearly-empty
+ vptr=((& std::bad_alloc::_ZTVSt9bad_alloc) + 16)
+ std::exception (0x0x7f7856e2f6c0) 0 nearly-empty
+ primary-for std::bad_alloc (0x0x7f7857963820)
+
+Vtable for std::bad_array_new_length
+std::bad_array_new_length::_ZTVSt20bad_array_new_length: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt20bad_array_new_length)
+16 (int (*)(...))std::bad_array_new_length::~bad_array_new_length
+24 (int (*)(...))std::bad_array_new_length::~bad_array_new_length
+32 (int (*)(...))std::bad_array_new_length::what
+
+Class std::bad_array_new_length
+ size=8 align=8
+ base size=8 base align=8
+std::bad_array_new_length (0x0x7f7857963888) 0 nearly-empty
+ vptr=((& std::bad_array_new_length::_ZTVSt20bad_array_new_length) + 16)
+ std::bad_alloc (0x0x7f78579638f0) 0 nearly-empty
+ primary-for std::bad_array_new_length (0x0x7f7857963888)
+ std::exception (0x0x7f7856e2f8a0) 0 nearly-empty
+ primary-for std::bad_alloc (0x0x7f78579638f0)
+
+Class std::nothrow_t
+ size=1 align=1
+ base size=0 base align=1
+std::nothrow_t (0x0x7f7856e2fa80) 0 empty
+
+Class std::__allocator_traits_base
+ size=1 align=1
+ base size=0 base align=1
+std::__allocator_traits_base (0x0x7f7856e2fc60) 0 empty
+
+Class std::__numeric_limits_base
+ size=1 align=1
+ base size=0 base align=1
+std::__numeric_limits_base (0x0x7f7856ed5180) 0 empty
+
+Class QSysInfo
+ size=1 align=1
+ base size=0 base align=1
+QSysInfo (0x0x7f7856b4b6c0) 0 empty
+
+Class QMessageLogContext
+ size=32 align=8
+ base size=32 base align=8
+QMessageLogContext (0x0x7f7856b4b7e0) 0
+
+Class QMessageLogger
+ size=32 align=8
+ base size=32 base align=8
+QMessageLogger (0x0x7f7856b4b9c0) 0
+
+Class QFlag
+ size=4 align=4
+ base size=4 base align=4
+QFlag (0x0x7f7856b860c0) 0
+
+Class QIncompatibleFlag
+ size=4 align=4
+ base size=4 base align=4
+QIncompatibleFlag (0x0x7f7856bc6840) 0
+
+Class std::__atomic_flag_base
+ size=1 align=1
+ base size=1 base align=1
+std::__atomic_flag_base (0x0x7f785685fd80) 0
+
+Class std::atomic_flag
+ size=1 align=1
+ base size=1 base align=1
+std::atomic_flag (0x0x7f785680a750) 0
+ std::__atomic_flag_base (0x0x7f785685fde0) 0
+
+Class QAtomicInt
+ size=4 align=4
+ base size=4 base align=4
+QAtomicInt (0x0x7f785680aea0) 0
+ QAtomicInteger<int> (0x0x7f785680af08) 0
+ QBasicAtomicInteger<int> (0x0x7f78563e8060) 0
+
+Class QInternal
+ size=1 align=1
+ base size=0 base align=1
+QInternal (0x0x7f7855ff1ba0) 0 empty
+
+Class QtPrivate::QSlotObjectBase
+ size=16 align=8
+ base size=16 base align=8
+QtPrivate::QSlotObjectBase (0x0x7f7856060180) 0
+
+Class QGenericArgument
+ size=16 align=8
+ base size=16 base align=8
+QGenericArgument (0x0x7f78560608a0) 0
+
+Class QGenericReturnArgument
+ size=16 align=8
+ base size=16 base align=8
+QGenericReturnArgument (0x0x7f785626bb60) 0
+ QGenericArgument (0x0x7f7856060b40) 0
+
+Class QMetaObject::SuperData
+ size=8 align=8
+ base size=8 base align=8
+QMetaObject::SuperData (0x0x7f78560ad000) 0
+
+Class QMetaObject
+ size=48 align=8
+ base size=48 base align=8
+QMetaObject (0x0x7f7856060f60) 0
+
+Class QMetaObject::Connection
+ size=8 align=8
+ base size=8 base align=8
+QMetaObject::Connection (0x0x7f78560ad8a0) 0
+
+Class QLatin1Char
+ size=1 align=1
+ base size=1 base align=1
+QLatin1Char (0x0x7f78561463c0) 0
+
+Class QChar
+ size=2 align=2
+ base size=2 base align=2
+QChar (0x0x7f7856146ae0) 0
+
+Class QtPrivate::RefCount
+ size=4 align=4
+ base size=4 base align=4
+QtPrivate::RefCount (0x0x7f7855e17900) 0
+
+Class QArrayData
+ size=24 align=8
+ base size=24 base align=8
+QArrayData (0x0x7f7855e17c60) 0
+
+Class QtPrivate::QContainerImplHelper
+ size=1 align=1
+ base size=0 base align=1
+QtPrivate::QContainerImplHelper (0x0x7f7855e6df60) 0 empty
+
+Class lconv
+ size=96 align=8
+ base size=96 base align=8
+lconv (0x0x7f7855f567e0) 0
+
+Vtable for __cxxabiv1::__forced_unwind
+__cxxabiv1::__forced_unwind::_ZTVN10__cxxabiv115__forced_unwindE: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTIN10__cxxabiv115__forced_unwindE)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+
+Class __cxxabiv1::__forced_unwind
+ size=8 align=8
+ base size=8 base align=8
+__cxxabiv1::__forced_unwind (0x0x7f7855f568a0) 0 nearly-empty
+ vptr=((& __cxxabiv1::__forced_unwind::_ZTVN10__cxxabiv115__forced_unwindE) + 16)
+
+Class sched_param
+ size=4 align=4
+ base size=4 base align=4
+sched_param (0x0x7f7855c1c9c0) 0
+
+Class timex
+ size=208 align=8
+ base size=208 base align=8
+timex (0x0x7f7855c1ca80) 0
+
+Class tm
+ size=56 align=8
+ base size=56 base align=8
+tm (0x0x7f7855c1cae0) 0
+
+Class itimerspec
+ size=32 align=8
+ base size=32 base align=8
+itimerspec (0x0x7f7855c1cb40) 0
+
+Class _pthread_cleanup_buffer
+ size=32 align=8
+ base size=32 base align=8
+_pthread_cleanup_buffer (0x0x7f7855c1cba0) 0
+
+Class __pthread_cleanup_frame
+ size=24 align=8
+ base size=24 base align=8
+__pthread_cleanup_frame (0x0x7f7855c1ccc0) 0
+
+Class __pthread_cleanup_class
+ size=24 align=8
+ base size=24 base align=8
+__pthread_cleanup_class (0x0x7f7855c1cd20) 0
+
+Class _IO_marker
+ size=24 align=8
+ base size=24 base align=8
+_IO_marker (0x0x7f7855d5acc0) 0
+
+Class _IO_FILE
+ size=216 align=8
+ base size=216 base align=8
+_IO_FILE (0x0x7f7855d5ad20) 0
+
+Class std::_Hash_impl
+ size=1 align=1
+ base size=0 base align=1
+std::_Hash_impl (0x0x7f7855b19d80) 0 empty
+
+Class std::_Fnv_hash_impl
+ size=1 align=1
+ base size=0 base align=1
+std::_Fnv_hash_impl (0x0x7f7855b19f00) 0 empty
+
+Class std::locale
+ size=8 align=8
+ base size=8 base align=8
+std::locale (0x0x7f78558c20c0) 0
+
+Vtable for std::locale::facet
+std::locale::facet::_ZTVNSt6locale5facetE: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTINSt6locale5facetE)
+16 (int (*)(...))std::locale::facet::~facet
+24 (int (*)(...))std::locale::facet::~facet
+
+Class std::locale::facet
+ size=16 align=8
+ base size=12 base align=8
+std::locale::facet (0x0x7f78558c2480) 0
+ vptr=((& std::locale::facet::_ZTVNSt6locale5facetE) + 16)
+
+Class std::locale::id
+ size=8 align=8
+ base size=8 base align=8
+std::locale::id (0x0x7f78558c2720) 0
+
+Class std::locale::_Impl
+ size=40 align=8
+ base size=40 base align=8
+std::locale::_Impl (0x0x7f78558c2900) 0
+
+Class std::__cow_string
+ size=8 align=8
+ base size=8 base align=8
+std::__cow_string (0x0x7f785591f900) 0
+
+Vtable for std::logic_error
+std::logic_error::_ZTVSt11logic_error: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt11logic_error)
+16 (int (*)(...))std::logic_error::~logic_error
+24 (int (*)(...))std::logic_error::~logic_error
+32 (int (*)(...))std::logic_error::what
+
+Class std::logic_error
+ size=16 align=8
+ base size=16 base align=8
+std::logic_error (0x0x7f7855b48c98) 0
+ vptr=((& std::logic_error::_ZTVSt11logic_error) + 16)
+ std::exception (0x0x7f785591f9c0) 0 nearly-empty
+ primary-for std::logic_error (0x0x7f7855b48c98)
+
+Vtable for std::domain_error
+std::domain_error::_ZTVSt12domain_error: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt12domain_error)
+16 (int (*)(...))std::domain_error::~domain_error
+24 (int (*)(...))std::domain_error::~domain_error
+32 (int (*)(...))std::logic_error::what
+
+Class std::domain_error
+ size=16 align=8
+ base size=16 base align=8
+std::domain_error (0x0x7f7855b48d00) 0
+ vptr=((& std::domain_error::_ZTVSt12domain_error) + 16)
+ std::logic_error (0x0x7f7855b48d68) 0
+ primary-for std::domain_error (0x0x7f7855b48d00)
+ std::exception (0x0x7f785591fa20) 0 nearly-empty
+ primary-for std::logic_error (0x0x7f7855b48d68)
+
+Vtable for std::invalid_argument
+std::invalid_argument::_ZTVSt16invalid_argument: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt16invalid_argument)
+16 (int (*)(...))std::invalid_argument::~invalid_argument
+24 (int (*)(...))std::invalid_argument::~invalid_argument
+32 (int (*)(...))std::logic_error::what
+
+Class std::invalid_argument
+ size=16 align=8
+ base size=16 base align=8
+std::invalid_argument (0x0x7f7855b48dd0) 0
+ vptr=((& std::invalid_argument::_ZTVSt16invalid_argument) + 16)
+ std::logic_error (0x0x7f7855b48e38) 0
+ primary-for std::invalid_argument (0x0x7f7855b48dd0)
+ std::exception (0x0x7f785591fa80) 0 nearly-empty
+ primary-for std::logic_error (0x0x7f7855b48e38)
+
+Vtable for std::length_error
+std::length_error::_ZTVSt12length_error: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt12length_error)
+16 (int (*)(...))std::length_error::~length_error
+24 (int (*)(...))std::length_error::~length_error
+32 (int (*)(...))std::logic_error::what
+
+Class std::length_error
+ size=16 align=8
+ base size=16 base align=8
+std::length_error (0x0x7f7855b48ea0) 0
+ vptr=((& std::length_error::_ZTVSt12length_error) + 16)
+ std::logic_error (0x0x7f7855b48f08) 0
+ primary-for std::length_error (0x0x7f7855b48ea0)
+ std::exception (0x0x7f785591fae0) 0 nearly-empty
+ primary-for std::logic_error (0x0x7f7855b48f08)
+
+Vtable for std::out_of_range
+std::out_of_range::_ZTVSt12out_of_range: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt12out_of_range)
+16 (int (*)(...))std::out_of_range::~out_of_range
+24 (int (*)(...))std::out_of_range::~out_of_range
+32 (int (*)(...))std::logic_error::what
+
+Class std::out_of_range
+ size=16 align=8
+ base size=16 base align=8
+std::out_of_range (0x0x7f7855b48f70) 0
+ vptr=((& std::out_of_range::_ZTVSt12out_of_range) + 16)
+ std::logic_error (0x0x7f7855b481a0) 0
+ primary-for std::out_of_range (0x0x7f7855b48f70)
+ std::exception (0x0x7f785591fb40) 0 nearly-empty
+ primary-for std::logic_error (0x0x7f7855b481a0)
+
+Vtable for std::runtime_error
+std::runtime_error::_ZTVSt13runtime_error: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt13runtime_error)
+16 (int (*)(...))std::runtime_error::~runtime_error
+24 (int (*)(...))std::runtime_error::~runtime_error
+32 (int (*)(...))std::runtime_error::what
+
+Class std::runtime_error
+ size=16 align=8
+ base size=16 base align=8
+std::runtime_error (0x0x7f7855b48208) 0
+ vptr=((& std::runtime_error::_ZTVSt13runtime_error) + 16)
+ std::exception (0x0x7f785591fba0) 0 nearly-empty
+ primary-for std::runtime_error (0x0x7f7855b48208)
+
+Vtable for std::range_error
+std::range_error::_ZTVSt11range_error: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt11range_error)
+16 (int (*)(...))std::range_error::~range_error
+24 (int (*)(...))std::range_error::~range_error
+32 (int (*)(...))std::runtime_error::what
+
+Class std::range_error
+ size=16 align=8
+ base size=16 base align=8
+std::range_error (0x0x7f7855b48548) 0
+ vptr=((& std::range_error::_ZTVSt11range_error) + 16)
+ std::runtime_error (0x0x7f7855b485b0) 0
+ primary-for std::range_error (0x0x7f7855b48548)
+ std::exception (0x0x7f785591fc00) 0 nearly-empty
+ primary-for std::runtime_error (0x0x7f7855b485b0)
+
+Vtable for std::overflow_error
+std::overflow_error::_ZTVSt14overflow_error: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt14overflow_error)
+16 (int (*)(...))std::overflow_error::~overflow_error
+24 (int (*)(...))std::overflow_error::~overflow_error
+32 (int (*)(...))std::runtime_error::what
+
+Class std::overflow_error
+ size=16 align=8
+ base size=16 base align=8
+std::overflow_error (0x0x7f7855968000) 0
+ vptr=((& std::overflow_error::_ZTVSt14overflow_error) + 16)
+ std::runtime_error (0x0x7f7855968068) 0
+ primary-for std::overflow_error (0x0x7f7855968000)
+ std::exception (0x0x7f785591fc60) 0 nearly-empty
+ primary-for std::runtime_error (0x0x7f7855968068)
+
+Vtable for std::underflow_error
+std::underflow_error::_ZTVSt15underflow_error: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt15underflow_error)
+16 (int (*)(...))std::underflow_error::~underflow_error
+24 (int (*)(...))std::underflow_error::~underflow_error
+32 (int (*)(...))std::runtime_error::what
+
+Class std::underflow_error
+ size=16 align=8
+ base size=16 base align=8
+std::underflow_error (0x0x7f78559680d0) 0
+ vptr=((& std::underflow_error::_ZTVSt15underflow_error) + 16)
+ std::runtime_error (0x0x7f7855968138) 0
+ primary-for std::underflow_error (0x0x7f78559680d0)
+ std::exception (0x0x7f785591fcc0) 0 nearly-empty
+ primary-for std::runtime_error (0x0x7f7855968138)
+
+Vtable for std::_V2::error_category
+std::_V2::error_category::_ZTVNSt3_V214error_categoryE: 10 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTINSt3_V214error_categoryE)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))std::_V2::error_category::_M_message
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))std::_V2::error_category::default_error_condition
+64 (int (*)(...))std::_V2::error_category::equivalent
+72 (int (*)(...))std::_V2::error_category::equivalent
+
+Class std::_V2::error_category
+ size=8 align=8
+ base size=8 base align=8
+std::_V2::error_category (0x0x7f785591fe40) 0 nearly-empty
+ vptr=((& std::_V2::error_category::_ZTVNSt3_V214error_categoryE) + 16)
+
+Class std::error_code
+ size=16 align=8
+ base size=16 base align=8
+std::error_code (0x0x7f785597a1e0) 0
+
+Class std::error_condition
+ size=16 align=8
+ base size=16 base align=8
+std::error_condition (0x0x7f785597aa20) 0
+
+Vtable for std::system_error
+std::system_error::_ZTVSt12system_error: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt12system_error)
+16 (int (*)(...))std::system_error::~system_error
+24 (int (*)(...))std::system_error::~system_error
+32 (int (*)(...))std::runtime_error::what
+
+Class std::system_error
+ size=32 align=8
+ base size=32 base align=8
+std::system_error (0x0x7f7855968548) 0
+ vptr=((& std::system_error::_ZTVSt12system_error) + 16)
+ std::runtime_error (0x0x7f78559685b0) 0
+ primary-for std::system_error (0x0x7f7855968548)
+ std::exception (0x0x7f78559a8600) 0 nearly-empty
+ primary-for std::runtime_error (0x0x7f78559685b0)
+
+Vtable for std::ios_base::failure
+std::ios_base::failure::_ZTVNSt8ios_base7failureB5cxx11E: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTINSt8ios_base7failureB5cxx11E)
+16 (int (*)(...))std::ios_base::failure::~failure
+24 (int (*)(...))std::ios_base::failure::~failure
+32 (int (*)(...))std::ios_base::failure::what
+
+Class std::ios_base::failure
+ size=32 align=8
+ base size=32 base align=8
+std::ios_base::failure (0x0x7f7855968820) 0
+ vptr=((& std::ios_base::failure::_ZTVNSt8ios_base7failureB5cxx11E) + 16)
+ std::system_error (0x0x7f7855968888) 0
+ primary-for std::ios_base::failure (0x0x7f7855968820)
+ std::runtime_error (0x0x7f78559688f0) 0
+ primary-for std::system_error (0x0x7f7855968888)
+ std::exception (0x0x7f78555dbba0) 0 nearly-empty
+ primary-for std::runtime_error (0x0x7f78559688f0)
+
+Class std::ios_base::_Callback_list
+ size=24 align=8
+ base size=24 base align=8
+std::ios_base::_Callback_list (0x0x7f78555dbc00) 0
+
+Class std::ios_base::_Words
+ size=16 align=8
+ base size=16 base align=8
+std::ios_base::_Words (0x0x7f78555dbc60) 0
+
+Class std::ios_base::Init
+ size=1 align=1
+ base size=0 base align=1
+std::ios_base::Init (0x0x7f78555dbcc0) 0 empty
+
+Vtable for std::ios_base
+std::ios_base::_ZTVSt8ios_base: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt8ios_base)
+16 (int (*)(...))std::ios_base::~ios_base
+24 (int (*)(...))std::ios_base::~ios_base
+
+Class std::ios_base
+ size=216 align=8
+ base size=216 base align=8
+std::ios_base (0x0x7f78555dbb40) 0
+ vptr=((& std::ios_base::_ZTVSt8ios_base) + 16)
+
+Class std::ctype_base
+ size=1 align=1
+ base size=0 base align=1
+std::ctype_base (0x0x7f78556d5600) 0 empty
+
+Class std::__num_base
+ size=1 align=1
+ base size=0 base align=1
+std::__num_base (0x0x7f78557937e0) 0 empty
+
+VTT for std::basic_ostream<char>
+std::basic_ostream<char>::_ZTTSo: 2 entries
+0 ((& std::basic_ostream<char>::_ZTVSo) + 24)
+8 ((& std::basic_ostream<char>::_ZTVSo) + 64)
+
+VTT for std::basic_ostream<wchar_t>
+std::basic_ostream<wchar_t>::_ZTTSt13basic_ostreamIwSt11char_traitsIwEE: 2 entries
+0 ((& std::basic_ostream<wchar_t>::_ZTVSt13basic_ostreamIwSt11char_traitsIwEE) + 24)
+8 ((& std::basic_ostream<wchar_t>::_ZTVSt13basic_ostreamIwSt11char_traitsIwEE) + 64)
+
+VTT for std::basic_istream<char>
+std::basic_istream<char>::_ZTTSi: 2 entries
+0 ((& std::basic_istream<char>::_ZTVSi) + 24)
+8 ((& std::basic_istream<char>::_ZTVSi) + 64)
+
+VTT for std::basic_istream<wchar_t>
+std::basic_istream<wchar_t>::_ZTTSt13basic_istreamIwSt11char_traitsIwEE: 2 entries
+0 ((& std::basic_istream<wchar_t>::_ZTVSt13basic_istreamIwSt11char_traitsIwEE) + 24)
+8 ((& std::basic_istream<wchar_t>::_ZTVSt13basic_istreamIwSt11char_traitsIwEE) + 64)
+
+Construction vtable for std::basic_istream<char> (0x0x7f785535b000 instance) in std::basic_iostream<char>
+std::basic_iostream<char>::_ZTCSd0_Si: 10 entries
+0 24
+8 (int (*)(...))0
+16 (int (*)(...))(& _ZTISi)
+24 0
+32 0
+40 18446744073709551592
+48 (int (*)(...))-24
+56 (int (*)(...))(& _ZTISi)
+64 0
+72 0
+
+Construction vtable for std::basic_ostream<char> (0x0x7f785535b0d0 instance) in std::basic_iostream<char>
+std::basic_iostream<char>::_ZTCSd16_So: 10 entries
+0 8
+8 (int (*)(...))0
+16 (int (*)(...))(& _ZTISo)
+24 0
+32 0
+40 18446744073709551608
+48 (int (*)(...))-8
+56 (int (*)(...))(& _ZTISo)
+64 0
+72 0
+
+VTT for std::basic_iostream<char>
+std::basic_iostream<char>::_ZTTSd: 7 entries
+0 ((& std::basic_iostream<char>::_ZTVSd) + 24)
+8 ((& std::basic_iostream<char>::_ZTCSd0_Si) + 24)
+16 ((& std::basic_iostream<char>::_ZTCSd0_Si) + 64)
+24 ((& std::basic_iostream<char>::_ZTCSd16_So) + 24)
+32 ((& std::basic_iostream<char>::_ZTCSd16_So) + 64)
+40 ((& std::basic_iostream<char>::_ZTVSd) + 104)
+48 ((& std::basic_iostream<char>::_ZTVSd) + 64)
+
+Construction vtable for std::basic_istream<wchar_t> (0x0x7f785535bea0 instance) in std::basic_iostream<wchar_t>
+std::basic_iostream<wchar_t>::_ZTCSt14basic_iostreamIwSt11char_traitsIwEE0_St13basic_istreamIwS1_E: 10 entries
+0 24
+8 (int (*)(...))0
+16 (int (*)(...))(& _ZTISt13basic_istreamIwSt11char_traitsIwEE)
+24 0
+32 0
+40 18446744073709551592
+48 (int (*)(...))-24
+56 (int (*)(...))(& _ZTISt13basic_istreamIwSt11char_traitsIwEE)
+64 0
+72 0
+
+Construction vtable for std::basic_ostream<wchar_t> (0x0x7f785535bf70 instance) in std::basic_iostream<wchar_t>
+std::basic_iostream<wchar_t>::_ZTCSt14basic_iostreamIwSt11char_traitsIwEE16_St13basic_ostreamIwS1_E: 10 entries
+0 8
+8 (int (*)(...))0
+16 (int (*)(...))(& _ZTISt13basic_ostreamIwSt11char_traitsIwEE)
+24 0
+32 0
+40 18446744073709551608
+48 (int (*)(...))-8
+56 (int (*)(...))(& _ZTISt13basic_ostreamIwSt11char_traitsIwEE)
+64 0
+72 0
+
+VTT for std::basic_iostream<wchar_t>
+std::basic_iostream<wchar_t>::_ZTTSt14basic_iostreamIwSt11char_traitsIwEE: 7 entries
+0 ((& std::basic_iostream<wchar_t>::_ZTVSt14basic_iostreamIwSt11char_traitsIwEE) + 24)
+8 ((& std::basic_iostream<wchar_t>::_ZTCSt14basic_iostreamIwSt11char_traitsIwEE0_St13basic_istreamIwS1_E) + 24)
+16 ((& std::basic_iostream<wchar_t>::_ZTCSt14basic_iostreamIwSt11char_traitsIwEE0_St13basic_istreamIwS1_E) + 64)
+24 ((& std::basic_iostream<wchar_t>::_ZTCSt14basic_iostreamIwSt11char_traitsIwEE16_St13basic_ostreamIwS1_E) + 24)
+32 ((& std::basic_iostream<wchar_t>::_ZTCSt14basic_iostreamIwSt11char_traitsIwEE16_St13basic_ostreamIwS1_E) + 64)
+40 ((& std::basic_iostream<wchar_t>::_ZTVSt14basic_iostreamIwSt11char_traitsIwEE) + 104)
+48 ((& std::basic_iostream<wchar_t>::_ZTVSt14basic_iostreamIwSt11char_traitsIwEE) + 64)
+
+Class QByteArrayDataPtr
+ size=8 align=8
+ base size=8 base align=8
+QByteArrayDataPtr (0x0x7f78553b4180) 0
+
+Class QByteArray
+ size=8 align=8
+ base size=8 base align=8
+QByteArray (0x0x7f78553b41e0) 0
+
+Class QByteRef
+ size=16 align=8
+ base size=12 base align=8
+QByteRef (0x0x7f78550e45a0) 0
+
+Class QByteArray::FromBase64Result
+ size=16 align=8
+ base size=12 base align=8
+QByteArray::FromBase64Result (0x0x7f7855183300) 0
+
+Class QStringDataPtr
+ size=8 align=8
+ base size=8 base align=8
+QStringDataPtr (0x0x7f7854e5f7e0) 0
+
+Class QStringView
+ size=16 align=8
+ base size=16 base align=8
+QStringView (0x0x7f7854e5fc60) 0
+
+Class QLatin1String
+ size=16 align=8
+ base size=16 base align=8
+QLatin1String (0x0x7f7854f54e40) 0
+
+Class QString::Null
+ size=1 align=1
+ base size=0 base align=1
+QString::Null (0x0x7f7854ccb000) 0 empty
+
+Class QString
+ size=8 align=8
+ base size=8 base align=8
+QString (0x0x7f7854c0eea0) 0
+
+Class QCharRef
+ size=16 align=8
+ base size=12 base align=8
+QCharRef (0x0x7f7854ad5de0) 0
+
+Class QStringRef
+ size=16 align=8
+ base size=16 base align=8
+QStringRef (0x0x7f785486c9c0) 0
+
+Class QtPrivate::ArgBase
+ size=1 align=1
+ base size=1 base align=1
+QtPrivate::ArgBase (0x0x7f78545f6840) 0
+
+Class QtPrivate::QStringViewArg
+ size=24 align=8
+ base size=24 base align=8
+QtPrivate::QStringViewArg (0x0x7f7854914618) 0
+ QtPrivate::ArgBase (0x0x7f78545f68a0) 0
+
+Class QtPrivate::QLatin1StringArg
+ size=24 align=8
+ base size=24 base align=8
+QtPrivate::QLatin1StringArg (0x0x7f7854914680) 0
+ QtPrivate::ArgBase (0x0x7f78545f6a80) 0
+
+Class std::__erased_type
+ size=1 align=1
+ base size=0 base align=1
+std::__erased_type (0x0x7f78546d3ba0) 0 empty
+
+Class std::allocator_arg_t
+ size=1 align=1
+ base size=0 base align=1
+std::allocator_arg_t (0x0x7f78546d3c00) 0 empty
+
+Class std::__uses_alloc_base
+ size=1 align=1
+ base size=0 base align=1
+std::__uses_alloc_base (0x0x7f78546d3d80) 0 empty
+
+Class std::__uses_alloc0::_Sink
+ size=1 align=1
+ base size=0 base align=1
+std::__uses_alloc0::_Sink (0x0x7f78546d3e40) 0 empty
+
+Class std::__uses_alloc0
+ size=1 align=1
+ base size=1 base align=1
+std::__uses_alloc0 (0x0x7f7854914a28) 0
+ std::__uses_alloc_base (0x0x7f78546d3de0) 0 empty
+
+Class std::_Swallow_assign
+ size=1 align=1
+ base size=0 base align=1
+std::_Swallow_assign (0x0x7f78544651e0) 0 empty
+
+Vtable for std::bad_function_call
+std::bad_function_call::_ZTVSt17bad_function_call: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt17bad_function_call)
+16 (int (*)(...))std::bad_function_call::~bad_function_call
+24 (int (*)(...))std::bad_function_call::~bad_function_call
+32 (int (*)(...))std::bad_function_call::what
+
+Class std::bad_function_call
+ size=8 align=8
+ base size=8 base align=8
+std::bad_function_call (0x0x7f78543e7c98) 0 nearly-empty
+ vptr=((& std::bad_function_call::_ZTVSt17bad_function_call) + 16)
+ std::exception (0x0x7f78544a1ae0) 0 nearly-empty
+ primary-for std::bad_function_call (0x0x7f78543e7c98)
+
+Class std::_Nocopy_types
+ size=16 align=8
+ base size=16 base align=8
+std::_Nocopy_types (0x0x7f78544a1ba0) 0
+
+Class std::_Any_data
+ size=16 align=8
+ base size=16 base align=8
+std::_Any_data (0x0x7f78544a1c00) 0
+
+Class std::_Function_base
+ size=24 align=8
+ base size=24 base align=8
+std::_Function_base (0x0x7f78544a1f00) 0
+
+Class QtPrivate::QHashCombine
+ size=1 align=1
+ base size=0 base align=1
+QtPrivate::QHashCombine (0x0x7f78542d23c0) 0 empty
+
+Class QtPrivate::QHashCombineCommutative
+ size=1 align=1
+ base size=0 base align=1
+QtPrivate::QHashCombineCommutative (0x0x7f78542d2480) 0 empty
+
+Class std::_Bit_reference
+ size=16 align=8
+ base size=16 base align=8
+std::_Bit_reference (0x0x7f7853fdbb40) 0
+
+Class std::_Bit_iterator_base
+ size=16 align=8
+ base size=12 base align=8
+std::_Bit_iterator_base (0x0x7f7854312820) 0
+ std::iterator<std::random_access_iterator_tag, bool> (0x0x7f7853ffc2a0) 0 empty
+
+Class std::_Bit_iterator
+ size=16 align=8
+ base size=12 base align=8
+std::_Bit_iterator (0x0x7f7854312958) 0
+ std::_Bit_iterator_base (0x0x7f78543129c0) 0
+ std::iterator<std::random_access_iterator_tag, bool> (0x0x7f7853ffc900) 0 empty
+
+Class std::_Bit_const_iterator
+ size=16 align=8
+ base size=12 base align=8
+std::_Bit_const_iterator (0x0x7f7854312a28) 0
+ std::_Bit_iterator_base (0x0x7f7854312a90) 0
+ std::iterator<std::random_access_iterator_tag, bool> (0x0x7f7854032120) 0 empty
+
+Class std::__detail::_List_node_base
+ size=16 align=8
+ base size=16 base align=8
+std::__detail::_List_node_base (0x0x7f7853e1b900) 0
+
+Class QListData::NotArrayCompatibleLayout
+ size=1 align=1
+ base size=0 base align=1
+QListData::NotArrayCompatibleLayout (0x0x7f7853ee96c0) 0 empty
+
+Class QListData::NotIndirectLayout
+ size=1 align=1
+ base size=0 base align=1
+QListData::NotIndirectLayout (0x0x7f7853ee9720) 0 empty
+
+Class QListData::ArrayCompatibleLayout
+ size=1 align=1
+ base size=1 base align=1
+QListData::ArrayCompatibleLayout (0x0x7f785414f4e0) 0 empty
+ QListData::NotIndirectLayout (0x0x7f7853ee9780) 0 empty
+
+Class QListData::InlineWithPaddingLayout
+ size=1 align=1
+ base size=1 base align=1
+QListData::InlineWithPaddingLayout (0x0x7f7853e53700) 0 empty
+ QListData::NotArrayCompatibleLayout (0x0x7f7853ee97e0) 0 empty
+ QListData::NotIndirectLayout (0x0x7f7853ee9840) 0 empty
+
+Class QListData::IndirectLayout
+ size=1 align=1
+ base size=1 base align=1
+QListData::IndirectLayout (0x0x7f785414f548) 0 empty
+ QListData::NotArrayCompatibleLayout (0x0x7f7853ee98a0) 0 empty
+
+Class QListData::Data
+ size=24 align=8
+ base size=24 base align=8
+QListData::Data (0x0x7f7853ee9900) 0
+
+Class QListData
+ size=8 align=8
+ base size=8 base align=8
+QListData (0x0x7f7853ee9660) 0
+
+Class QRegExp
+ size=8 align=8
+ base size=8 base align=8
+QRegExp (0x0x7f7853bdea80) 0
+
+Class QStringMatcher::Data
+ size=272 align=8
+ base size=272 base align=8
+QStringMatcher::Data (0x0x7f7853ce2000) 0
+
+Class QStringMatcher
+ size=1048 align=8
+ base size=1048 base align=8
+QStringMatcher (0x0x7f7853cbff60) 0
+
+Class QStringList
+ size=8 align=8
+ base size=8 base align=8
+QStringList (0x0x7f7853cd7208) 0
+ QList<QString> (0x0x7f7853cd7270) 0
+ QListSpecialMethods<QString> (0x0x7f7853ce2240) 0 empty
+
+Class QScopedPointerPodDeleter
+ size=1 align=1
+ base size=0 base align=1
+QScopedPointerPodDeleter (0x0x7f7853db9000) 0 empty
+
+Class std::_Rb_tree_node_base
+ size=32 align=8
+ base size=32 base align=8
+std::_Rb_tree_node_base (0x0x7f7853a40240) 0
+
+Class std::_Rb_tree_header
+ size=40 align=8
+ base size=40 base align=8
+std::_Rb_tree_header (0x0x7f7853a405a0) 0
+
+Class QtPrivate::AbstractDebugStreamFunction
+ size=16 align=8
+ base size=16 base align=8
+QtPrivate::AbstractDebugStreamFunction (0x0x7f7853884ba0) 0
+
+Class QtPrivate::AbstractComparatorFunction
+ size=24 align=8
+ base size=24 base align=8
+QtPrivate::AbstractComparatorFunction (0x0x7f7853884f00) 0
+
+Class QtPrivate::AbstractConverterFunction
+ size=8 align=8
+ base size=8 base align=8
+QtPrivate::AbstractConverterFunction (0x0x7f78538a7480) 0
+
+Class QMetaType
+ size=80 align=8
+ base size=80 base align=8
+QMetaType (0x0x7f78538a79c0) 0
+
+Class QtMetaTypePrivate::VariantData
+ size=24 align=8
+ base size=20 base align=8
+QtMetaTypePrivate::VariantData (0x0x7f78538f9cc0) 0
+
+Class QtMetaTypePrivate::VectorBoolElements
+ size=1 align=1
+ base size=0 base align=1
+QtMetaTypePrivate::VectorBoolElements (0x0x7f78539303c0) 0 empty
+
+Class QtMetaTypePrivate::QSequentialIterableImpl
+ size=104 align=8
+ base size=104 base align=8
+QtMetaTypePrivate::QSequentialIterableImpl (0x0x7f78539cc420) 0
+
+Class QtMetaTypePrivate::QAssociativeIterableImpl
+ size=112 align=8
+ base size=112 base align=8
+QtMetaTypePrivate::QAssociativeIterableImpl (0x0x7f7853642540) 0
+
+Class QtMetaTypePrivate::QPairVariantInterfaceImpl
+ size=40 align=8
+ base size=40 base align=8
+QtMetaTypePrivate::QPairVariantInterfaceImpl (0x0x7f7853699a80) 0
+
+Class std::chrono::_V2::system_clock
+ size=1 align=1
+ base size=0 base align=1
+std::chrono::_V2::system_clock (0x0x7f7853568120) 0 empty
+
+Class std::chrono::_V2::steady_clock
+ size=1 align=1
+ base size=0 base align=1
+std::chrono::_V2::steady_clock (0x0x7f7853264ba0) 0 empty
+
+Vtable for QObjectData
+QObjectData::_ZTV11QObjectData: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QObjectData)
+16 (int (*)(...))__cxa_pure_virtual
+24 (int (*)(...))__cxa_pure_virtual
+
+Class QObjectData
+ size=48 align=8
+ base size=48 base align=8
+QObjectData (0x0x7f7853264c00) 0
+ vptr=((& QObjectData::_ZTV11QObjectData) + 16)
+
+Class QObject::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QObject::QPrivateSignal (0x0x7f7853264de0) 0 empty
+
+Vtable for QObject
+QObject::_ZTV7QObject: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI7QObject)
+16 (int (*)(...))QObject::metaObject
+24 (int (*)(...))QObject::qt_metacast
+32 (int (*)(...))QObject::qt_metacall
+40 (int (*)(...))QObject::~QObject
+48 (int (*)(...))QObject::~QObject
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QObject
+ size=16 align=8
+ base size=16 base align=8
+QObject (0x0x7f7853264d80) 0
+ vptr=((& QObject::_ZTV7QObject) + 16)
+
+Vtable for QObjectUserData
+QObjectUserData::_ZTV15QObjectUserData: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QObjectUserData)
+16 (int (*)(...))QObjectUserData::~QObjectUserData
+24 (int (*)(...))QObjectUserData::~QObjectUserData
+
+Class QObjectUserData
+ size=8 align=8
+ base size=8 base align=8
+QObjectUserData (0x0x7f7853348c00) 0 nearly-empty
+ vptr=((& QObjectUserData::_ZTV15QObjectUserData) + 16)
+
+Class QSignalBlocker
+ size=16 align=8
+ base size=10 base align=8
+QSignalBlocker (0x0x7f7853348d80) 0
+
+Class QAbstractAnimation::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAbstractAnimation::QPrivateSignal (0x0x7f785336a660) 0 empty
+
+Vtable for QAbstractAnimation
+QAbstractAnimation::_ZTV18QAbstractAnimation: 18 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QAbstractAnimation)
+16 (int (*)(...))QAbstractAnimation::metaObject
+24 (int (*)(...))QAbstractAnimation::qt_metacast
+32 (int (*)(...))QAbstractAnimation::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QAbstractAnimation::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))QAbstractAnimation::updateState
+136 (int (*)(...))QAbstractAnimation::updateDirection
+
+Class QAbstractAnimation
+ size=16 align=8
+ base size=16 base align=8
+QAbstractAnimation (0x0x7f78533289c0) 0
+ vptr=((& QAbstractAnimation::_ZTV18QAbstractAnimation) + 16)
+ QObject (0x0x7f785336a600) 0
+ primary-for QAbstractAnimation (0x0x7f78533289c0)
+
+Class QAnimationDriver::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAnimationDriver::QPrivateSignal (0x0x7f785336aa20) 0 empty
+
+Vtable for QAnimationDriver
+QAnimationDriver::_ZTV16QAnimationDriver: 18 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QAnimationDriver)
+16 (int (*)(...))QAnimationDriver::metaObject
+24 (int (*)(...))QAnimationDriver::qt_metacast
+32 (int (*)(...))QAnimationDriver::qt_metacall
+40 (int (*)(...))QAnimationDriver::~QAnimationDriver
+48 (int (*)(...))QAnimationDriver::~QAnimationDriver
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QAnimationDriver::advance
+120 (int (*)(...))QAnimationDriver::elapsed
+128 (int (*)(...))QAnimationDriver::start
+136 (int (*)(...))QAnimationDriver::stop
+
+Class QAnimationDriver
+ size=16 align=8
+ base size=16 base align=8
+QAnimationDriver (0x0x7f7853328a28) 0
+ vptr=((& QAnimationDriver::_ZTV16QAnimationDriver) + 16)
+ QObject (0x0x7f785336a9c0) 0
+ primary-for QAnimationDriver (0x0x7f7853328a28)
+
+Class QEventLoop::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QEventLoop::QPrivateSignal (0x0x7f785336ac60) 0 empty
+
+Vtable for QEventLoop
+QEventLoop::_ZTV10QEventLoop: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QEventLoop)
+16 (int (*)(...))QEventLoop::metaObject
+24 (int (*)(...))QEventLoop::qt_metacast
+32 (int (*)(...))QEventLoop::qt_metacall
+40 (int (*)(...))QEventLoop::~QEventLoop
+48 (int (*)(...))QEventLoop::~QEventLoop
+56 (int (*)(...))QEventLoop::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QEventLoop
+ size=16 align=8
+ base size=16 base align=8
+QEventLoop (0x0x7f7853328a90) 0
+ vptr=((& QEventLoop::_ZTV10QEventLoop) + 16)
+ QObject (0x0x7f785336ac00) 0
+ primary-for QEventLoop (0x0x7f7853328a90)
+
+Class QEventLoopLocker
+ size=8 align=8
+ base size=8 base align=8
+QEventLoopLocker (0x0x7f78533bf540) 0
+
+Class QAbstractEventDispatcher::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAbstractEventDispatcher::QPrivateSignal (0x0x7f78533bf600) 0 empty
+
+Class QAbstractEventDispatcher::TimerInfo
+ size=12 align=4
+ base size=12 base align=4
+QAbstractEventDispatcher::TimerInfo (0x0x7f78533bf660) 0
+
+Vtable for QAbstractEventDispatcher
+QAbstractEventDispatcher::_ZTV24QAbstractEventDispatcher: 28 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI24QAbstractEventDispatcher)
+16 (int (*)(...))QAbstractEventDispatcher::metaObject
+24 (int (*)(...))QAbstractEventDispatcher::qt_metacast
+32 (int (*)(...))QAbstractEventDispatcher::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))__cxa_pure_virtual
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))__cxa_pure_virtual
+160 (int (*)(...))__cxa_pure_virtual
+168 (int (*)(...))__cxa_pure_virtual
+176 (int (*)(...))__cxa_pure_virtual
+184 (int (*)(...))__cxa_pure_virtual
+192 (int (*)(...))__cxa_pure_virtual
+200 (int (*)(...))__cxa_pure_virtual
+208 (int (*)(...))QAbstractEventDispatcher::startingUp
+216 (int (*)(...))QAbstractEventDispatcher::closingDown
+
+Class QAbstractEventDispatcher
+ size=16 align=8
+ base size=16 base align=8
+QAbstractEventDispatcher (0x0x7f7853328bc8) 0
+ vptr=((& QAbstractEventDispatcher::_ZTV24QAbstractEventDispatcher) + 16)
+ QObject (0x0x7f78533bf5a0) 0
+ primary-for QAbstractEventDispatcher (0x0x7f7853328bc8)
+
+Class QMapNodeBase
+ size=24 align=8
+ base size=24 base align=8
+QMapNodeBase (0x0x7f785301f660) 0
+
+Class QMapDataBase
+ size=40 align=8
+ base size=40 base align=8
+QMapDataBase (0x0x7f785304c300) 0
+
+Class QHashData::Node
+ size=16 align=8
+ base size=16 base align=8
+QHashData::Node (0x0x7f785311ae40) 0
+
+Class QHashData
+ size=48 align=8
+ base size=44 base align=8
+QHashData (0x0x7f785311ade0) 0
+
+Class QHashDummyValue
+ size=1 align=1
+ base size=0 base align=1
+QHashDummyValue (0x0x7f7853140120) 0 empty
+
+Class QVariant::PrivateShared
+ size=16 align=8
+ base size=12 base align=8
+QVariant::PrivateShared (0x0x7f7852e4cba0) 0
+
+Class QVariant::Private::Data
+ size=8 align=8
+ base size=8 base align=8
+QVariant::Private::Data (0x0x7f7852e4cc60) 0
+
+Class QVariant::Private
+ size=16 align=8
+ base size=12 base align=8
+QVariant::Private (0x0x7f7852e4cc00) 0
+
+Class QVariant::Handler
+ size=72 align=8
+ base size=72 base align=8
+QVariant::Handler (0x0x7f7852e4ccc0) 0
+
+Class QVariant
+ size=16 align=8
+ base size=16 base align=8
+QVariant (0x0x7f7852e4cb40) 0
+
+Class QVariantComparisonHelper
+ size=8 align=8
+ base size=8 base align=8
+QVariantComparisonHelper (0x0x7f7852f44f60) 0
+
+Class QSequentialIterable::const_iterator
+ size=112 align=8
+ base size=112 base align=8
+QSequentialIterable::const_iterator (0x0x7f7852c13600) 0
+
+Class QSequentialIterable
+ size=104 align=8
+ base size=104 base align=8
+QSequentialIterable (0x0x7f7852c135a0) 0
+
+Class QAssociativeIterable::const_iterator
+ size=120 align=8
+ base size=120 base align=8
+QAssociativeIterable::const_iterator (0x0x7f7852c13720) 0
+
+Class QAssociativeIterable
+ size=112 align=8
+ base size=112 base align=8
+QAssociativeIterable (0x0x7f7852c136c0) 0
+
+Class QModelIndex
+ size=24 align=8
+ base size=24 base align=8
+QModelIndex (0x0x7f7852cf3a80) 0
+
+Class QPersistentModelIndex
+ size=8 align=8
+ base size=8 base align=8
+QPersistentModelIndex (0x0x7f7852d6e6c0) 0
+
+Class QAbstractItemModel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAbstractItemModel::QPrivateSignal (0x0x7f7852a3a4e0) 0 empty
+
+Vtable for QAbstractItemModel
+QAbstractItemModel::_ZTV18QAbstractItemModel: 48 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QAbstractItemModel)
+16 (int (*)(...))QAbstractItemModel::metaObject
+24 (int (*)(...))QAbstractItemModel::qt_metacast
+32 (int (*)(...))QAbstractItemModel::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))QAbstractItemModel::sibling
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))QAbstractItemModel::hasChildren
+160 (int (*)(...))__cxa_pure_virtual
+168 (int (*)(...))QAbstractItemModel::setData
+176 (int (*)(...))QAbstractItemModel::headerData
+184 (int (*)(...))QAbstractItemModel::setHeaderData
+192 (int (*)(...))QAbstractItemModel::itemData
+200 (int (*)(...))QAbstractItemModel::setItemData
+208 (int (*)(...))QAbstractItemModel::mimeTypes
+216 (int (*)(...))QAbstractItemModel::mimeData
+224 (int (*)(...))QAbstractItemModel::canDropMimeData
+232 (int (*)(...))QAbstractItemModel::dropMimeData
+240 (int (*)(...))QAbstractItemModel::supportedDropActions
+248 (int (*)(...))QAbstractItemModel::supportedDragActions
+256 (int (*)(...))QAbstractItemModel::insertRows
+264 (int (*)(...))QAbstractItemModel::insertColumns
+272 (int (*)(...))QAbstractItemModel::removeRows
+280 (int (*)(...))QAbstractItemModel::removeColumns
+288 (int (*)(...))QAbstractItemModel::moveRows
+296 (int (*)(...))QAbstractItemModel::moveColumns
+304 (int (*)(...))QAbstractItemModel::fetchMore
+312 (int (*)(...))QAbstractItemModel::canFetchMore
+320 (int (*)(...))QAbstractItemModel::flags
+328 (int (*)(...))QAbstractItemModel::sort
+336 (int (*)(...))QAbstractItemModel::buddy
+344 (int (*)(...))QAbstractItemModel::match
+352 (int (*)(...))QAbstractItemModel::span
+360 (int (*)(...))QAbstractItemModel::roleNames
+368 (int (*)(...))QAbstractItemModel::submit
+376 (int (*)(...))QAbstractItemModel::revert
+
+Class QAbstractItemModel
+ size=16 align=8
+ base size=16 base align=8
+QAbstractItemModel (0x0x7f7852a29e38) 0
+ vptr=((& QAbstractItemModel::_ZTV18QAbstractItemModel) + 16)
+ QObject (0x0x7f7852a3a480) 0
+ primary-for QAbstractItemModel (0x0x7f7852a29e38)
+
+Class QAbstractTableModel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAbstractTableModel::QPrivateSignal (0x0x7f7852afc8a0) 0 empty
+
+Vtable for QAbstractTableModel
+QAbstractTableModel::_ZTV19QAbstractTableModel: 48 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QAbstractTableModel)
+16 (int (*)(...))QAbstractTableModel::metaObject
+24 (int (*)(...))QAbstractTableModel::qt_metacast
+32 (int (*)(...))QAbstractTableModel::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QAbstractTableModel::index
+120 (int (*)(...))QAbstractTableModel::parent
+128 (int (*)(...))QAbstractTableModel::sibling
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))QAbstractTableModel::hasChildren
+160 (int (*)(...))__cxa_pure_virtual
+168 (int (*)(...))QAbstractItemModel::setData
+176 (int (*)(...))QAbstractItemModel::headerData
+184 (int (*)(...))QAbstractItemModel::setHeaderData
+192 (int (*)(...))QAbstractItemModel::itemData
+200 (int (*)(...))QAbstractItemModel::setItemData
+208 (int (*)(...))QAbstractItemModel::mimeTypes
+216 (int (*)(...))QAbstractItemModel::mimeData
+224 (int (*)(...))QAbstractItemModel::canDropMimeData
+232 (int (*)(...))QAbstractTableModel::dropMimeData
+240 (int (*)(...))QAbstractItemModel::supportedDropActions
+248 (int (*)(...))QAbstractItemModel::supportedDragActions
+256 (int (*)(...))QAbstractItemModel::insertRows
+264 (int (*)(...))QAbstractItemModel::insertColumns
+272 (int (*)(...))QAbstractItemModel::removeRows
+280 (int (*)(...))QAbstractItemModel::removeColumns
+288 (int (*)(...))QAbstractItemModel::moveRows
+296 (int (*)(...))QAbstractItemModel::moveColumns
+304 (int (*)(...))QAbstractItemModel::fetchMore
+312 (int (*)(...))QAbstractItemModel::canFetchMore
+320 (int (*)(...))QAbstractTableModel::flags
+328 (int (*)(...))QAbstractItemModel::sort
+336 (int (*)(...))QAbstractItemModel::buddy
+344 (int (*)(...))QAbstractItemModel::match
+352 (int (*)(...))QAbstractItemModel::span
+360 (int (*)(...))QAbstractItemModel::roleNames
+368 (int (*)(...))QAbstractItemModel::submit
+376 (int (*)(...))QAbstractItemModel::revert
+
+Class QAbstractTableModel
+ size=16 align=8
+ base size=16 base align=8
+QAbstractTableModel (0x0x7f7852a81478) 0
+ vptr=((& QAbstractTableModel::_ZTV19QAbstractTableModel) + 16)
+ QAbstractItemModel (0x0x7f7852a814e0) 0
+ primary-for QAbstractTableModel (0x0x7f7852a81478)
+ QObject (0x0x7f7852afc840) 0
+ primary-for QAbstractItemModel (0x0x7f7852a814e0)
+
+Class QAbstractListModel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAbstractListModel::QPrivateSignal (0x0x7f7852afca20) 0 empty
+
+Vtable for QAbstractListModel
+QAbstractListModel::_ZTV18QAbstractListModel: 48 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QAbstractListModel)
+16 (int (*)(...))QAbstractListModel::metaObject
+24 (int (*)(...))QAbstractListModel::qt_metacast
+32 (int (*)(...))QAbstractListModel::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QAbstractListModel::index
+120 (int (*)(...))QAbstractListModel::parent
+128 (int (*)(...))QAbstractListModel::sibling
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))QAbstractListModel::columnCount
+152 (int (*)(...))QAbstractListModel::hasChildren
+160 (int (*)(...))__cxa_pure_virtual
+168 (int (*)(...))QAbstractItemModel::setData
+176 (int (*)(...))QAbstractItemModel::headerData
+184 (int (*)(...))QAbstractItemModel::setHeaderData
+192 (int (*)(...))QAbstractItemModel::itemData
+200 (int (*)(...))QAbstractItemModel::setItemData
+208 (int (*)(...))QAbstractItemModel::mimeTypes
+216 (int (*)(...))QAbstractItemModel::mimeData
+224 (int (*)(...))QAbstractItemModel::canDropMimeData
+232 (int (*)(...))QAbstractListModel::dropMimeData
+240 (int (*)(...))QAbstractItemModel::supportedDropActions
+248 (int (*)(...))QAbstractItemModel::supportedDragActions
+256 (int (*)(...))QAbstractItemModel::insertRows
+264 (int (*)(...))QAbstractItemModel::insertColumns
+272 (int (*)(...))QAbstractItemModel::removeRows
+280 (int (*)(...))QAbstractItemModel::removeColumns
+288 (int (*)(...))QAbstractItemModel::moveRows
+296 (int (*)(...))QAbstractItemModel::moveColumns
+304 (int (*)(...))QAbstractItemModel::fetchMore
+312 (int (*)(...))QAbstractItemModel::canFetchMore
+320 (int (*)(...))QAbstractListModel::flags
+328 (int (*)(...))QAbstractItemModel::sort
+336 (int (*)(...))QAbstractItemModel::buddy
+344 (int (*)(...))QAbstractItemModel::match
+352 (int (*)(...))QAbstractItemModel::span
+360 (int (*)(...))QAbstractItemModel::roleNames
+368 (int (*)(...))QAbstractItemModel::submit
+376 (int (*)(...))QAbstractItemModel::revert
+
+Class QAbstractListModel
+ size=16 align=8
+ base size=16 base align=8
+QAbstractListModel (0x0x7f7852a81548) 0
+ vptr=((& QAbstractListModel::_ZTV18QAbstractListModel) + 16)
+ QAbstractItemModel (0x0x7f7852a815b0) 0
+ primary-for QAbstractListModel (0x0x7f7852a81548)
+ QObject (0x0x7f7852afc9c0) 0
+ primary-for QAbstractItemModel (0x0x7f7852a815b0)
+
+Vtable for QAbstractNativeEventFilter
+QAbstractNativeEventFilter::_ZTV26QAbstractNativeEventFilter: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI26QAbstractNativeEventFilter)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+
+Class QAbstractNativeEventFilter
+ size=16 align=8
+ base size=16 base align=8
+QAbstractNativeEventFilter (0x0x7f7852b44180) 0
+ vptr=((& QAbstractNativeEventFilter::_ZTV26QAbstractNativeEventFilter) + 16)
+
+Class QAbstractProxyModel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAbstractProxyModel::QPrivateSignal (0x0x7f7852b44240) 0 empty
+
+Vtable for QAbstractProxyModel
+QAbstractProxyModel::_ZTV19QAbstractProxyModel: 53 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QAbstractProxyModel)
+16 (int (*)(...))QAbstractProxyModel::metaObject
+24 (int (*)(...))QAbstractProxyModel::qt_metacast
+32 (int (*)(...))QAbstractProxyModel::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))QAbstractProxyModel::sibling
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))QAbstractProxyModel::hasChildren
+160 (int (*)(...))QAbstractProxyModel::data
+168 (int (*)(...))QAbstractProxyModel::setData
+176 (int (*)(...))QAbstractProxyModel::headerData
+184 (int (*)(...))QAbstractProxyModel::setHeaderData
+192 (int (*)(...))QAbstractProxyModel::itemData
+200 (int (*)(...))QAbstractProxyModel::setItemData
+208 (int (*)(...))QAbstractProxyModel::mimeTypes
+216 (int (*)(...))QAbstractProxyModel::mimeData
+224 (int (*)(...))QAbstractProxyModel::canDropMimeData
+232 (int (*)(...))QAbstractProxyModel::dropMimeData
+240 (int (*)(...))QAbstractProxyModel::supportedDropActions
+248 (int (*)(...))QAbstractProxyModel::supportedDragActions
+256 (int (*)(...))QAbstractItemModel::insertRows
+264 (int (*)(...))QAbstractItemModel::insertColumns
+272 (int (*)(...))QAbstractItemModel::removeRows
+280 (int (*)(...))QAbstractItemModel::removeColumns
+288 (int (*)(...))QAbstractItemModel::moveRows
+296 (int (*)(...))QAbstractItemModel::moveColumns
+304 (int (*)(...))QAbstractProxyModel::fetchMore
+312 (int (*)(...))QAbstractProxyModel::canFetchMore
+320 (int (*)(...))QAbstractProxyModel::flags
+328 (int (*)(...))QAbstractProxyModel::sort
+336 (int (*)(...))QAbstractProxyModel::buddy
+344 (int (*)(...))QAbstractItemModel::match
+352 (int (*)(...))QAbstractProxyModel::span
+360 (int (*)(...))QAbstractItemModel::roleNames
+368 (int (*)(...))QAbstractProxyModel::submit
+376 (int (*)(...))QAbstractProxyModel::revert
+384 (int (*)(...))QAbstractProxyModel::setSourceModel
+392 (int (*)(...))__cxa_pure_virtual
+400 (int (*)(...))__cxa_pure_virtual
+408 (int (*)(...))QAbstractProxyModel::mapSelectionToSource
+416 (int (*)(...))QAbstractProxyModel::mapSelectionFromSource
+
+Class QAbstractProxyModel
+ size=16 align=8
+ base size=16 base align=8
+QAbstractProxyModel (0x0x7f7852a81680) 0
+ vptr=((& QAbstractProxyModel::_ZTV19QAbstractProxyModel) + 16)
+ QAbstractItemModel (0x0x7f7852a816e8) 0
+ primary-for QAbstractProxyModel (0x0x7f7852a81680)
+ QObject (0x0x7f7852b441e0) 0
+ primary-for QAbstractItemModel (0x0x7f7852a816e8)
+
+Class QAbstractState::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAbstractState::QPrivateSignal (0x0x7f7852b44480) 0 empty
+
+Vtable for QAbstractState
+QAbstractState::_ZTV14QAbstractState: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QAbstractState)
+16 (int (*)(...))QAbstractState::metaObject
+24 (int (*)(...))QAbstractState::qt_metacast
+32 (int (*)(...))QAbstractState::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QAbstractState::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+
+Class QAbstractState
+ size=16 align=8
+ base size=16 base align=8
+QAbstractState (0x0x7f7852a81750) 0
+ vptr=((& QAbstractState::_ZTV14QAbstractState) + 16)
+ QObject (0x0x7f7852b44420) 0
+ primary-for QAbstractState (0x0x7f7852a81750)
+
+Class QAbstractTransition::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAbstractTransition::QPrivateSignal (0x0x7f7852b446c0) 0 empty
+
+Vtable for QAbstractTransition
+QAbstractTransition::_ZTV19QAbstractTransition: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QAbstractTransition)
+16 (int (*)(...))QAbstractTransition::metaObject
+24 (int (*)(...))QAbstractTransition::qt_metacast
+32 (int (*)(...))QAbstractTransition::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QAbstractTransition::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+
+Class QAbstractTransition
+ size=16 align=8
+ base size=16 base align=8
+QAbstractTransition (0x0x7f7852a817b8) 0
+ vptr=((& QAbstractTransition::_ZTV19QAbstractTransition) + 16)
+ QObject (0x0x7f7852b44660) 0
+ primary-for QAbstractTransition (0x0x7f7852a817b8)
+
+Class QAnimationGroup::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAnimationGroup::QPrivateSignal (0x0x7f7852b449c0) 0 empty
+
+Vtable for QAnimationGroup
+QAnimationGroup::_ZTV15QAnimationGroup: 18 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QAnimationGroup)
+16 (int (*)(...))QAnimationGroup::metaObject
+24 (int (*)(...))QAnimationGroup::qt_metacast
+32 (int (*)(...))QAnimationGroup::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QAnimationGroup::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))QAbstractAnimation::updateState
+136 (int (*)(...))QAbstractAnimation::updateDirection
+
+Class QAnimationGroup
+ size=16 align=8
+ base size=16 base align=8
+QAnimationGroup (0x0x7f7852a81820) 0
+ vptr=((& QAnimationGroup::_ZTV15QAnimationGroup) + 16)
+ QAbstractAnimation (0x0x7f7852a81888) 0
+ primary-for QAnimationGroup (0x0x7f7852a81820)
+ QObject (0x0x7f7852b44960) 0
+ primary-for QAbstractAnimation (0x0x7f7852a81888)
+
+Class QBasicTimer
+ size=4 align=4
+ base size=4 base align=4
+QBasicTimer (0x0x7f78527edcc0) 0
+
+Class QBitArray
+ size=8 align=8
+ base size=8 base align=8
+QBitArray (0x0x7f785288d660) 0
+
+Class QBitRef
+ size=16 align=8
+ base size=12 base align=8
+QBitRef (0x0x7f78528c7660) 0
+
+Class QIODevice::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QIODevice::QPrivateSignal (0x0x7f785290f900) 0 empty
+
+Vtable for QIODevice
+QIODevice::_ZTV9QIODevice: 30 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QIODevice)
+16 (int (*)(...))QIODevice::metaObject
+24 (int (*)(...))QIODevice::qt_metacast
+32 (int (*)(...))QIODevice::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QIODevice::isSequential
+120 (int (*)(...))QIODevice::open
+128 (int (*)(...))QIODevice::close
+136 (int (*)(...))QIODevice::pos
+144 (int (*)(...))QIODevice::size
+152 (int (*)(...))QIODevice::seek
+160 (int (*)(...))QIODevice::atEnd
+168 (int (*)(...))QIODevice::reset
+176 (int (*)(...))QIODevice::bytesAvailable
+184 (int (*)(...))QIODevice::bytesToWrite
+192 (int (*)(...))QIODevice::canReadLine
+200 (int (*)(...))QIODevice::waitForReadyRead
+208 (int (*)(...))QIODevice::waitForBytesWritten
+216 (int (*)(...))__cxa_pure_virtual
+224 (int (*)(...))QIODevice::readLineData
+232 (int (*)(...))__cxa_pure_virtual
+
+Class QIODevice
+ size=16 align=8
+ base size=16 base align=8
+QIODevice (0x0x7f78529181a0) 0
+ vptr=((& QIODevice::_ZTV9QIODevice) + 16)
+ QObject (0x0x7f785290f8a0) 0
+ primary-for QIODevice (0x0x7f78529181a0)
+
+Class QBuffer::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QBuffer::QPrivateSignal (0x0x7f78529592a0) 0 empty
+
+Vtable for QBuffer
+QBuffer::_ZTV7QBuffer: 30 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI7QBuffer)
+16 (int (*)(...))QBuffer::metaObject
+24 (int (*)(...))QBuffer::qt_metacast
+32 (int (*)(...))QBuffer::qt_metacall
+40 (int (*)(...))QBuffer::~QBuffer
+48 (int (*)(...))QBuffer::~QBuffer
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QBuffer::connectNotify
+104 (int (*)(...))QBuffer::disconnectNotify
+112 (int (*)(...))QIODevice::isSequential
+120 (int (*)(...))QBuffer::open
+128 (int (*)(...))QBuffer::close
+136 (int (*)(...))QBuffer::pos
+144 (int (*)(...))QBuffer::size
+152 (int (*)(...))QBuffer::seek
+160 (int (*)(...))QBuffer::atEnd
+168 (int (*)(...))QIODevice::reset
+176 (int (*)(...))QIODevice::bytesAvailable
+184 (int (*)(...))QIODevice::bytesToWrite
+192 (int (*)(...))QBuffer::canReadLine
+200 (int (*)(...))QIODevice::waitForReadyRead
+208 (int (*)(...))QIODevice::waitForBytesWritten
+216 (int (*)(...))QBuffer::readData
+224 (int (*)(...))QIODevice::readLineData
+232 (int (*)(...))QBuffer::writeData
+
+Class QBuffer
+ size=16 align=8
+ base size=16 base align=8
+QBuffer (0x0x7f78529182d8) 0
+ vptr=((& QBuffer::_ZTV7QBuffer) + 16)
+ QIODevice (0x0x7f7852918340) 0
+ primary-for QBuffer (0x0x7f78529182d8)
+ QObject (0x0x7f7852959240) 0
+ primary-for QIODevice (0x0x7f7852918340)
+
+Class QByteArrayMatcher::Data
+ size=272 align=8
+ base size=272 base align=8
+QByteArrayMatcher::Data (0x0x7f7852959540) 0
+
+Class QByteArrayMatcher
+ size=1040 align=8
+ base size=1040 base align=8
+QByteArrayMatcher (0x0x7f78529594e0) 0
+
+Class QStaticByteArrayMatcherBase::Skiptable
+ size=256 align=1
+ base size=256 base align=1
+QStaticByteArrayMatcherBase::Skiptable (0x0x7f78529596c0) 0
+
+Class QStaticByteArrayMatcherBase
+ size=256 align=16
+ base size=256 base align=16
+QStaticByteArrayMatcherBase (0x0x7f7852959660) 0
+
+Class QSharedData
+ size=4 align=4
+ base size=4 base align=4
+QSharedData (0x0x7f78529a85a0) 0
+
+Class QLocale
+ size=8 align=8
+ base size=8 base align=8
+QLocale (0x0x7f78525ea480) 0
+
+Class QCalendar::YearMonthDay
+ size=12 align=4
+ base size=12 base align=4
+QCalendar::YearMonthDay (0x0x7f785275a960) 0
+
+Class QCalendar
+ size=8 align=8
+ base size=8 base align=8
+QCalendar (0x0x7f785275a900) 0
+
+Class QDate
+ size=8 align=8
+ base size=8 base align=8
+QDate (0x0x7f7852794180) 0
+
+Class QTime
+ size=4 align=4
+ base size=4 base align=4
+QTime (0x0x7f78523e6a20) 0
+
+Class QDateTime::ShortData
+ size=8 align=8
+ base size=8 base align=8
+QDateTime::ShortData (0x0x7f78524536c0) 0
+
+Class QDateTime::Data
+ size=8 align=8
+ base size=8 base align=8
+QDateTime::Data (0x0x7f7852453720) 0
+
+Class QDateTime
+ size=8 align=8
+ base size=8 base align=8
+QDateTime (0x0x7f7852453660) 0
+
+Vtable for QTextStream
+QTextStream::_ZTV11QTextStream: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QTextStream)
+16 (int (*)(...))QTextStream::~QTextStream
+24 (int (*)(...))QTextStream::~QTextStream
+
+Class QTextStream
+ size=16 align=8
+ base size=16 base align=8
+QTextStream (0x0x7f7852524de0) 0
+ vptr=((& QTextStream::_ZTV11QTextStream) + 16)
+
+Class QTextStreamManipulator
+ size=40 align=8
+ base size=38 base align=8
+QTextStreamManipulator (0x0x7f78525736c0) 0
+
+Class QContiguousCacheData
+ size=24 align=4
+ base size=24 base align=4
+QContiguousCacheData (0x0x7f785221e360) 0
+
+Vtable for __gnu_cxx::__concurrence_lock_error
+__gnu_cxx::__concurrence_lock_error::_ZTVN9__gnu_cxx24__concurrence_lock_errorE: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTIN9__gnu_cxx24__concurrence_lock_errorE)
+16 (int (*)(...))__gnu_cxx::__concurrence_lock_error::~__concurrence_lock_error
+24 (int (*)(...))__gnu_cxx::__concurrence_lock_error::~__concurrence_lock_error
+32 (int (*)(...))__gnu_cxx::__concurrence_lock_error::what
+
+Class __gnu_cxx::__concurrence_lock_error
+ size=8 align=8
+ base size=8 base align=8
+__gnu_cxx::__concurrence_lock_error (0x0x7f785253a340) 0 nearly-empty
+ vptr=((& __gnu_cxx::__concurrence_lock_error::_ZTVN9__gnu_cxx24__concurrence_lock_errorE) + 16)
+ std::exception (0x0x7f78522711e0) 0 nearly-empty
+ primary-for __gnu_cxx::__concurrence_lock_error (0x0x7f785253a340)
+
+Vtable for __gnu_cxx::__concurrence_unlock_error
+__gnu_cxx::__concurrence_unlock_error::_ZTVN9__gnu_cxx26__concurrence_unlock_errorE: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTIN9__gnu_cxx26__concurrence_unlock_errorE)
+16 (int (*)(...))__gnu_cxx::__concurrence_unlock_error::~__concurrence_unlock_error
+24 (int (*)(...))__gnu_cxx::__concurrence_unlock_error::~__concurrence_unlock_error
+32 (int (*)(...))__gnu_cxx::__concurrence_unlock_error::what
+
+Class __gnu_cxx::__concurrence_unlock_error
+ size=8 align=8
+ base size=8 base align=8
+__gnu_cxx::__concurrence_unlock_error (0x0x7f785253a3a8) 0 nearly-empty
+ vptr=((& __gnu_cxx::__concurrence_unlock_error::_ZTVN9__gnu_cxx26__concurrence_unlock_errorE) + 16)
+ std::exception (0x0x7f7852271300) 0 nearly-empty
+ primary-for __gnu_cxx::__concurrence_unlock_error (0x0x7f785253a3a8)
+
+Vtable for __gnu_cxx::__concurrence_broadcast_error
+__gnu_cxx::__concurrence_broadcast_error::_ZTVN9__gnu_cxx29__concurrence_broadcast_errorE: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTIN9__gnu_cxx29__concurrence_broadcast_errorE)
+16 (int (*)(...))__gnu_cxx::__concurrence_broadcast_error::~__concurrence_broadcast_error
+24 (int (*)(...))__gnu_cxx::__concurrence_broadcast_error::~__concurrence_broadcast_error
+32 (int (*)(...))__gnu_cxx::__concurrence_broadcast_error::what
+
+Class __gnu_cxx::__concurrence_broadcast_error
+ size=8 align=8
+ base size=8 base align=8
+__gnu_cxx::__concurrence_broadcast_error (0x0x7f785253a410) 0 nearly-empty
+ vptr=((& __gnu_cxx::__concurrence_broadcast_error::_ZTVN9__gnu_cxx29__concurrence_broadcast_errorE) + 16)
+ std::exception (0x0x7f7852271420) 0 nearly-empty
+ primary-for __gnu_cxx::__concurrence_broadcast_error (0x0x7f785253a410)
+
+Vtable for __gnu_cxx::__concurrence_wait_error
+__gnu_cxx::__concurrence_wait_error::_ZTVN9__gnu_cxx24__concurrence_wait_errorE: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTIN9__gnu_cxx24__concurrence_wait_errorE)
+16 (int (*)(...))__gnu_cxx::__concurrence_wait_error::~__concurrence_wait_error
+24 (int (*)(...))__gnu_cxx::__concurrence_wait_error::~__concurrence_wait_error
+32 (int (*)(...))__gnu_cxx::__concurrence_wait_error::what
+
+Class __gnu_cxx::__concurrence_wait_error
+ size=8 align=8
+ base size=8 base align=8
+__gnu_cxx::__concurrence_wait_error (0x0x7f785253a4e0) 0 nearly-empty
+ vptr=((& __gnu_cxx::__concurrence_wait_error::_ZTVN9__gnu_cxx24__concurrence_wait_errorE) + 16)
+ std::exception (0x0x7f7852271540) 0 nearly-empty
+ primary-for __gnu_cxx::__concurrence_wait_error (0x0x7f785253a4e0)
+
+Class __gnu_cxx::__mutex
+ size=40 align=8
+ base size=40 base align=8
+__gnu_cxx::__mutex (0x0x7f78522955a0) 0
+
+Class __gnu_cxx::__recursive_mutex
+ size=40 align=8
+ base size=40 base align=8
+__gnu_cxx::__recursive_mutex (0x0x7f78522958a0) 0
+
+Class __gnu_cxx::__scoped_lock
+ size=8 align=8
+ base size=8 base align=8
+__gnu_cxx::__scoped_lock (0x0x7f7852295ba0) 0
+
+Class __gnu_cxx::__cond
+ size=48 align=8
+ base size=48 base align=8
+__gnu_cxx::__cond (0x0x7f7852295f00) 0
+
+Vtable for std::bad_weak_ptr
+std::bad_weak_ptr::_ZTVSt12bad_weak_ptr: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt12bad_weak_ptr)
+16 (int (*)(...))std::bad_weak_ptr::~bad_weak_ptr
+24 (int (*)(...))std::bad_weak_ptr::~bad_weak_ptr
+32 (int (*)(...))std::bad_weak_ptr::what
+
+Class std::bad_weak_ptr
+ size=8 align=8
+ base size=8 base align=8
+std::bad_weak_ptr (0x0x7f785253a548) 0 nearly-empty
+ vptr=((& std::bad_weak_ptr::_ZTVSt12bad_weak_ptr) + 16)
+ std::exception (0x0x7f7852336120) 0 nearly-empty
+ primary-for std::bad_weak_ptr (0x0x7f785253a548)
+
+Class std::_Sp_make_shared_tag
+ size=1 align=1
+ base size=0 base align=1
+std::_Sp_make_shared_tag (0x0x7f785239d0c0) 0 empty
+
+Class std::__sp_array_delete
+ size=1 align=1
+ base size=0 base align=1
+std::__sp_array_delete (0x0x7f785239d4e0) 0 empty
+
+Class std::_Sp_locker
+ size=2 align=1
+ base size=2 base align=1
+std::_Sp_locker (0x0x7f78520e0360) 0
+
+Class QtSharedPointer::NormalDeleter
+ size=1 align=1
+ base size=0 base align=1
+QtSharedPointer::NormalDeleter (0x0x7f7852112840) 0 empty
+
+Class QtSharedPointer::ExternalRefCountData
+ size=16 align=8
+ base size=16 base align=8
+QtSharedPointer::ExternalRefCountData (0x0x7f78521129c0) 0
+
+Class QtPrivate::EnableInternalData
+ size=1 align=1
+ base size=0 base align=1
+QtPrivate::EnableInternalData (0x0x7f7852199300) 0 empty
+
+Class QDebug::Stream
+ size=80 align=8
+ base size=76 base align=8
+QDebug::Stream (0x0x7f78521c49c0) 0
+
+Class QDebug
+ size=8 align=8
+ base size=8 base align=8
+QDebug (0x0x7f78521c4960) 0
+
+Class QDebugStateSaver
+ size=8 align=8
+ base size=8 base align=8
+QDebugStateSaver (0x0x7f7851f5b300) 0
+
+Class QNoDebug
+ size=1 align=1
+ base size=0 base align=1
+QNoDebug (0x0x7f7851f5b3c0) 0 empty
+
+Class QCborError
+ size=4 align=4
+ base size=4 base align=4
+QCborError (0x0x7f7851bdc600) 0
+
+Class QRegularExpression
+ size=8 align=8
+ base size=8 base align=8
+QRegularExpression (0x0x7f7851bdcd80) 0
+
+Class QRegularExpressionMatch
+ size=8 align=8
+ base size=8 base align=8
+QRegularExpressionMatch (0x0x7f7851c98c60) 0
+
+Class QRegularExpressionMatchIterator
+ size=8 align=8
+ base size=8 base align=8
+QRegularExpressionMatchIterator (0x0x7f7851cfda20) 0
+
+Class QUrl
+ size=8 align=8
+ base size=8 base align=8
+QUrl (0x0x7f7851d7a480) 0
+
+Class QUuid
+ size=16 align=4
+ base size=16 base align=4
+QUuid (0x0x7f7851acb420) 0
+
+Class QCborParserError
+ size=16 align=8
+ base size=12 base align=8
+QCborParserError (0x0x7f7851b31f60) 0
+
+Class QCborValue
+ size=24 align=8
+ base size=20 base align=8
+QCborValue (0x0x7f7851b56060) 0
+
+Class QCborValueRef
+ size=16 align=8
+ base size=16 base align=8
+QCborValueRef (0x0x7f785198a360) 0
+
+Class QCborArray::Iterator
+ size=16 align=8
+ base size=16 base align=8
+QCborArray::Iterator (0x0x7f78515fdcc0) 0
+
+Class QCborArray::ConstIterator
+ size=16 align=8
+ base size=16 base align=8
+QCborArray::ConstIterator (0x0x7f78515fdd20) 0
+
+Class QCborArray
+ size=8 align=8
+ base size=8 base align=8
+QCborArray (0x0x7f78515fdc60) 0
+
+Class QCborMap::Iterator
+ size=16 align=8
+ base size=16 base align=8
+QCborMap::Iterator (0x0x7f785177d900) 0
+
+Class QCborMap::ConstIterator
+ size=16 align=8
+ base size=16 base align=8
+QCborMap::ConstIterator (0x0x7f785177d960) 0
+
+Class QCborMap
+ size=8 align=8
+ base size=8 base align=8
+QCborMap (0x0x7f785177d8a0) 0
+
+Class qfloat16::Wrap
+ size=2 align=2
+ base size=2 base align=2
+qfloat16::Wrap (0x0x7f785159f120) 0
+
+Class qfloat16
+ size=2 align=2
+ base size=2 base align=2
+qfloat16 (0x0x7f785159f0c0) 0
+
+Class QCborStreamReader
+ size=24 align=8
+ base size=20 base align=8
+QCborStreamReader (0x0x7f7851262ea0) 0
+
+Class QCborStreamWriter
+ size=8 align=8
+ base size=8 base align=8
+QCborStreamWriter (0x0x7f7851311480) 0
+
+Class QCollatorSortKey
+ size=8 align=8
+ base size=8 base align=8
+QCollatorSortKey (0x0x7f7851311d20) 0
+
+Class QCollator
+ size=8 align=8
+ base size=8 base align=8
+QCollator (0x0x7f7851311f00) 0
+
+Class QCommandLineOption
+ size=8 align=8
+ base size=8 base align=8
+QCommandLineOption (0x0x7f785103f540) 0
+
+Vtable for QEvent
+QEvent::_ZTV6QEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI6QEvent)
+16 (int (*)(...))QEvent::~QEvent
+24 (int (*)(...))QEvent::~QEvent
+
+Class QEvent
+ size=24 align=8
+ base size=20 base align=8
+QEvent (0x0x7f7851106a80) 0
+ vptr=((& QEvent::_ZTV6QEvent) + 16)
+
+Vtable for QTimerEvent
+QTimerEvent::_ZTV11QTimerEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QTimerEvent)
+16 (int (*)(...))QTimerEvent::~QTimerEvent
+24 (int (*)(...))QTimerEvent::~QTimerEvent
+
+Class QTimerEvent
+ size=24 align=8
+ base size=24 base align=8
+QTimerEvent (0x0x7f7851105410) 0
+ vptr=((& QTimerEvent::_ZTV11QTimerEvent) + 16)
+ QEvent (0x0x7f7851106e40) 0
+ primary-for QTimerEvent (0x0x7f7851105410)
+
+Vtable for QChildEvent
+QChildEvent::_ZTV11QChildEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QChildEvent)
+16 (int (*)(...))QChildEvent::~QChildEvent
+24 (int (*)(...))QChildEvent::~QChildEvent
+
+Class QChildEvent
+ size=32 align=8
+ base size=32 base align=8
+QChildEvent (0x0x7f7851105478) 0
+ vptr=((& QChildEvent::_ZTV11QChildEvent) + 16)
+ QEvent (0x0x7f7851106f00) 0
+ primary-for QChildEvent (0x0x7f7851105478)
+
+Vtable for QDynamicPropertyChangeEvent
+QDynamicPropertyChangeEvent::_ZTV27QDynamicPropertyChangeEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI27QDynamicPropertyChangeEvent)
+16 (int (*)(...))QDynamicPropertyChangeEvent::~QDynamicPropertyChangeEvent
+24 (int (*)(...))QDynamicPropertyChangeEvent::~QDynamicPropertyChangeEvent
+
+Class QDynamicPropertyChangeEvent
+ size=32 align=8
+ base size=32 base align=8
+QDynamicPropertyChangeEvent (0x0x7f78511059c0) 0
+ vptr=((& QDynamicPropertyChangeEvent::_ZTV27QDynamicPropertyChangeEvent) + 16)
+ QEvent (0x0x7f785114d5a0) 0
+ primary-for QDynamicPropertyChangeEvent (0x0x7f78511059c0)
+
+Vtable for QDeferredDeleteEvent
+QDeferredDeleteEvent::_ZTV20QDeferredDeleteEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QDeferredDeleteEvent)
+16 (int (*)(...))QDeferredDeleteEvent::~QDeferredDeleteEvent
+24 (int (*)(...))QDeferredDeleteEvent::~QDeferredDeleteEvent
+
+Class QDeferredDeleteEvent
+ size=24 align=8
+ base size=24 base align=8
+QDeferredDeleteEvent (0x0x7f7851105a28) 0
+ vptr=((& QDeferredDeleteEvent::_ZTV20QDeferredDeleteEvent) + 16)
+ QEvent (0x0x7f785114d660) 0
+ primary-for QDeferredDeleteEvent (0x0x7f7851105a28)
+
+Class QCoreApplication::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QCoreApplication::QPrivateSignal (0x0x7f785114d780) 0 empty
+
+Vtable for QCoreApplication
+QCoreApplication::_ZTV16QCoreApplication: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QCoreApplication)
+16 (int (*)(...))QCoreApplication::metaObject
+24 (int (*)(...))QCoreApplication::qt_metacast
+32 (int (*)(...))QCoreApplication::qt_metacall
+40 (int (*)(...))QCoreApplication::~QCoreApplication
+48 (int (*)(...))QCoreApplication::~QCoreApplication
+56 (int (*)(...))QCoreApplication::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QCoreApplication::notify
+120 (int (*)(...))QCoreApplication::compressEvent
+
+Class QCoreApplication
+ size=16 align=8
+ base size=16 base align=8
+QCoreApplication (0x0x7f7851105a90) 0
+ vptr=((& QCoreApplication::_ZTV16QCoreApplication) + 16)
+ QObject (0x0x7f785114d720) 0
+ primary-for QCoreApplication (0x0x7f7851105a90)
+
+Class QCommandLineParser
+ size=8 align=8
+ base size=8 base align=8
+QCommandLineParser (0x0x7f785114d9c0) 0
+
+Class QConcatenateTablesProxyModel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QConcatenateTablesProxyModel::QPrivateSignal (0x0x7f785114db40) 0 empty
+
+Vtable for QConcatenateTablesProxyModel
+QConcatenateTablesProxyModel::_ZTV28QConcatenateTablesProxyModel: 48 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI28QConcatenateTablesProxyModel)
+16 (int (*)(...))QConcatenateTablesProxyModel::metaObject
+24 (int (*)(...))QConcatenateTablesProxyModel::qt_metacast
+32 (int (*)(...))QConcatenateTablesProxyModel::qt_metacall
+40 (int (*)(...))QConcatenateTablesProxyModel::~QConcatenateTablesProxyModel
+48 (int (*)(...))QConcatenateTablesProxyModel::~QConcatenateTablesProxyModel
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QConcatenateTablesProxyModel::index
+120 (int (*)(...))QConcatenateTablesProxyModel::parent
+128 (int (*)(...))QAbstractItemModel::sibling
+136 (int (*)(...))QConcatenateTablesProxyModel::rowCount
+144 (int (*)(...))QConcatenateTablesProxyModel::columnCount
+152 (int (*)(...))QAbstractItemModel::hasChildren
+160 (int (*)(...))QConcatenateTablesProxyModel::data
+168 (int (*)(...))QConcatenateTablesProxyModel::setData
+176 (int (*)(...))QConcatenateTablesProxyModel::headerData
+184 (int (*)(...))QAbstractItemModel::setHeaderData
+192 (int (*)(...))QConcatenateTablesProxyModel::itemData
+200 (int (*)(...))QConcatenateTablesProxyModel::setItemData
+208 (int (*)(...))QConcatenateTablesProxyModel::mimeTypes
+216 (int (*)(...))QConcatenateTablesProxyModel::mimeData
+224 (int (*)(...))QConcatenateTablesProxyModel::canDropMimeData
+232 (int (*)(...))QConcatenateTablesProxyModel::dropMimeData
+240 (int (*)(...))QAbstractItemModel::supportedDropActions
+248 (int (*)(...))QAbstractItemModel::supportedDragActions
+256 (int (*)(...))QAbstractItemModel::insertRows
+264 (int (*)(...))QAbstractItemModel::insertColumns
+272 (int (*)(...))QAbstractItemModel::removeRows
+280 (int (*)(...))QAbstractItemModel::removeColumns
+288 (int (*)(...))QAbstractItemModel::moveRows
+296 (int (*)(...))QAbstractItemModel::moveColumns
+304 (int (*)(...))QAbstractItemModel::fetchMore
+312 (int (*)(...))QAbstractItemModel::canFetchMore
+320 (int (*)(...))QConcatenateTablesProxyModel::flags
+328 (int (*)(...))QAbstractItemModel::sort
+336 (int (*)(...))QAbstractItemModel::buddy
+344 (int (*)(...))QAbstractItemModel::match
+352 (int (*)(...))QConcatenateTablesProxyModel::span
+360 (int (*)(...))QAbstractItemModel::roleNames
+368 (int (*)(...))QAbstractItemModel::submit
+376 (int (*)(...))QAbstractItemModel::revert
+
+Class QConcatenateTablesProxyModel
+ size=16 align=8
+ base size=16 base align=8
+QConcatenateTablesProxyModel (0x0x7f7851105af8) 0
+ vptr=((& QConcatenateTablesProxyModel::_ZTV28QConcatenateTablesProxyModel) + 16)
+ QAbstractItemModel (0x0x7f7851105b60) 0
+ primary-for QConcatenateTablesProxyModel (0x0x7f7851105af8)
+ QObject (0x0x7f785114dae0) 0
+ primary-for QAbstractItemModel (0x0x7f7851105b60)
+
+Class QCryptographicHash
+ size=8 align=8
+ base size=8 base align=8
+QCryptographicHash (0x0x7f785114dd20) 0
+
+Class QDataStream
+ size=32 align=8
+ base size=32 base align=8
+QDataStream (0x0x7f785114de40) 0
+
+Class QtPrivate::StreamStateSaver
+ size=16 align=8
+ base size=12 base align=8
+QtPrivate::StreamStateSaver (0x0x7f7850dd9000) 0
+
+Class QElapsedTimer
+ size=16 align=8
+ base size=16 base align=8
+QElapsedTimer (0x0x7f7850e0d840) 0
+
+Class QDeadlineTimer
+ size=16 align=8
+ base size=16 base align=8
+QDeadlineTimer (0x0x7f7850e0df60) 0
+
+Class QFileDevice::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QFileDevice::QPrivateSignal (0x0x7f7850f60c60) 0 empty
+
+Vtable for QFileDevice
+QFileDevice::_ZTV11QFileDevice: 34 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QFileDevice)
+16 (int (*)(...))QFileDevice::metaObject
+24 (int (*)(...))QFileDevice::qt_metacast
+32 (int (*)(...))QFileDevice::qt_metacall
+40 (int (*)(...))QFileDevice::~QFileDevice
+48 (int (*)(...))QFileDevice::~QFileDevice
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QFileDevice::isSequential
+120 (int (*)(...))QIODevice::open
+128 (int (*)(...))QFileDevice::close
+136 (int (*)(...))QFileDevice::pos
+144 (int (*)(...))QFileDevice::size
+152 (int (*)(...))QFileDevice::seek
+160 (int (*)(...))QFileDevice::atEnd
+168 (int (*)(...))QIODevice::reset
+176 (int (*)(...))QIODevice::bytesAvailable
+184 (int (*)(...))QIODevice::bytesToWrite
+192 (int (*)(...))QIODevice::canReadLine
+200 (int (*)(...))QIODevice::waitForReadyRead
+208 (int (*)(...))QIODevice::waitForBytesWritten
+216 (int (*)(...))QFileDevice::readData
+224 (int (*)(...))QFileDevice::readLineData
+232 (int (*)(...))QFileDevice::writeData
+240 (int (*)(...))QFileDevice::fileName
+248 (int (*)(...))QFileDevice::resize
+256 (int (*)(...))QFileDevice::permissions
+264 (int (*)(...))QFileDevice::setPermissions
+
+Class QFileDevice
+ size=16 align=8
+ base size=16 base align=8
+QFileDevice (0x0x7f7850f58d68) 0
+ vptr=((& QFileDevice::_ZTV11QFileDevice) + 16)
+ QIODevice (0x0x7f7850f58dd0) 0
+ primary-for QFileDevice (0x0x7f7850f58d68)
+ QObject (0x0x7f7850f60c00) 0
+ primary-for QIODevice (0x0x7f7850f58dd0)
+
+Class QFile::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QFile::QPrivateSignal (0x0x7f7850fab5a0) 0 empty
+
+Vtable for QFile
+QFile::_ZTV5QFile: 34 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI5QFile)
+16 (int (*)(...))QFile::metaObject
+24 (int (*)(...))QFile::qt_metacast
+32 (int (*)(...))QFile::qt_metacall
+40 (int (*)(...))QFile::~QFile
+48 (int (*)(...))QFile::~QFile
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QFileDevice::isSequential
+120 (int (*)(...))QFile::open
+128 (int (*)(...))QFileDevice::close
+136 (int (*)(...))QFileDevice::pos
+144 (int (*)(...))QFile::size
+152 (int (*)(...))QFileDevice::seek
+160 (int (*)(...))QFileDevice::atEnd
+168 (int (*)(...))QIODevice::reset
+176 (int (*)(...))QIODevice::bytesAvailable
+184 (int (*)(...))QIODevice::bytesToWrite
+192 (int (*)(...))QIODevice::canReadLine
+200 (int (*)(...))QIODevice::waitForReadyRead
+208 (int (*)(...))QIODevice::waitForBytesWritten
+216 (int (*)(...))QFileDevice::readData
+224 (int (*)(...))QFileDevice::readLineData
+232 (int (*)(...))QFileDevice::writeData
+240 (int (*)(...))QFile::fileName
+248 (int (*)(...))QFile::resize
+256 (int (*)(...))QFile::permissions
+264 (int (*)(...))QFile::setPermissions
+
+Class QFile
+ size=16 align=8
+ base size=16 base align=8
+QFile (0x0x7f7850f58f08) 0
+ vptr=((& QFile::_ZTV5QFile) + 16)
+ QFileDevice (0x0x7f7850f58f70) 0
+ primary-for QFile (0x0x7f7850f58f08)
+ QIODevice (0x0x7f7850fb8000) 0
+ primary-for QFileDevice (0x0x7f7850f58f70)
+ QObject (0x0x7f7850fab540) 0
+ primary-for QIODevice (0x0x7f7850fb8000)
+
+Class QFileInfo
+ size=8 align=8
+ base size=8 base align=8
+QFileInfo (0x0x7f7850fabc00) 0
+
+Class QDir
+ size=8 align=8
+ base size=8 base align=8
+QDir (0x0x7f7850ca1ae0) 0
+
+Class QDirIterator
+ size=8 align=8
+ base size=8 base align=8
+QDirIterator (0x0x7f7850dbdae0) 0
+
+Class QEasingCurve
+ size=8 align=8
+ base size=8 base align=8
+QEasingCurve (0x0x7f7850a172a0) 0
+
+Class QEventTransition::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QEventTransition::QPrivateSignal (0x0x7f7850b183c0) 0 empty
+
+Vtable for QEventTransition
+QEventTransition::_ZTV16QEventTransition: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QEventTransition)
+16 (int (*)(...))QEventTransition::metaObject
+24 (int (*)(...))QEventTransition::qt_metacast
+32 (int (*)(...))QEventTransition::qt_metacall
+40 (int (*)(...))QEventTransition::~QEventTransition
+48 (int (*)(...))QEventTransition::~QEventTransition
+56 (int (*)(...))QEventTransition::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QEventTransition::eventTest
+120 (int (*)(...))QEventTransition::onTransition
+
+Class QEventTransition
+ size=16 align=8
+ base size=16 base align=8
+QEventTransition (0x0x7f7850accc98) 0
+ vptr=((& QEventTransition::_ZTV16QEventTransition) + 16)
+ QAbstractTransition (0x0x7f7850accd00) 0
+ primary-for QEventTransition (0x0x7f7850accc98)
+ QObject (0x0x7f7850b18360) 0
+ primary-for QAbstractTransition (0x0x7f7850accd00)
+
+Vtable for QException
+QException::_ZTV10QException: 7 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QException)
+16 (int (*)(...))QException::~QException
+24 (int (*)(...))QException::~QException
+32 (int (*)(...))std::exception::what
+40 (int (*)(...))QException::raise
+48 (int (*)(...))QException::clone
+
+Class QException
+ size=8 align=8
+ base size=8 base align=8
+QException (0x0x7f7850accd68) 0 nearly-empty
+ vptr=((& QException::_ZTV10QException) + 16)
+ std::exception (0x0x7f7850b185a0) 0 nearly-empty
+ primary-for QException (0x0x7f7850accd68)
+
+Vtable for QUnhandledException
+QUnhandledException::_ZTV19QUnhandledException: 7 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QUnhandledException)
+16 (int (*)(...))QUnhandledException::~QUnhandledException
+24 (int (*)(...))QUnhandledException::~QUnhandledException
+32 (int (*)(...))std::exception::what
+40 (int (*)(...))QUnhandledException::raise
+48 (int (*)(...))QUnhandledException::clone
+
+Class QUnhandledException
+ size=8 align=8
+ base size=8 base align=8
+QUnhandledException (0x0x7f7850accdd0) 0 nearly-empty
+ vptr=((& QUnhandledException::_ZTV19QUnhandledException) + 16)
+ QException (0x0x7f7850acce38) 0 nearly-empty
+ primary-for QUnhandledException (0x0x7f7850accdd0)
+ std::exception (0x0x7f7850b18600) 0 nearly-empty
+ primary-for QException (0x0x7f7850acce38)
+
+Class QtPrivate::ExceptionHolder
+ size=8 align=8
+ base size=8 base align=8
+QtPrivate::ExceptionHolder (0x0x7f7850b18660) 0
+
+Class QtPrivate::ExceptionStore
+ size=8 align=8
+ base size=8 base align=8
+QtPrivate::ExceptionStore (0x0x7f7850b18720) 0
+
+Vtable for QFactoryInterface
+QFactoryInterface::_ZTV17QFactoryInterface: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QFactoryInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+
+Class QFactoryInterface
+ size=8 align=8
+ base size=8 base align=8
+QFactoryInterface (0x0x7f7850b18780) 0 nearly-empty
+ vptr=((& QFactoryInterface::_ZTV17QFactoryInterface) + 16)
+
+Class QFileSelector::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QFileSelector::QPrivateSignal (0x0x7f7850b189c0) 0 empty
+
+Vtable for QFileSelector
+QFileSelector::_ZTV13QFileSelector: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QFileSelector)
+16 (int (*)(...))QFileSelector::metaObject
+24 (int (*)(...))QFileSelector::qt_metacast
+32 (int (*)(...))QFileSelector::qt_metacall
+40 (int (*)(...))QFileSelector::~QFileSelector
+48 (int (*)(...))QFileSelector::~QFileSelector
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QFileSelector
+ size=16 align=8
+ base size=16 base align=8
+QFileSelector (0x0x7f7850accea0) 0
+ vptr=((& QFileSelector::_ZTV13QFileSelector) + 16)
+ QObject (0x0x7f7850b18960) 0
+ primary-for QFileSelector (0x0x7f7850accea0)
+
+Class QFileSystemWatcher::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QFileSystemWatcher::QPrivateSignal (0x0x7f7850b18c00) 0 empty
+
+Vtable for QFileSystemWatcher
+QFileSystemWatcher::_ZTV18QFileSystemWatcher: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QFileSystemWatcher)
+16 (int (*)(...))QFileSystemWatcher::metaObject
+24 (int (*)(...))QFileSystemWatcher::qt_metacast
+32 (int (*)(...))QFileSystemWatcher::qt_metacall
+40 (int (*)(...))QFileSystemWatcher::~QFileSystemWatcher
+48 (int (*)(...))QFileSystemWatcher::~QFileSystemWatcher
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QFileSystemWatcher
+ size=16 align=8
+ base size=16 base align=8
+QFileSystemWatcher (0x0x7f7850accf08) 0
+ vptr=((& QFileSystemWatcher::_ZTV18QFileSystemWatcher) + 16)
+ QObject (0x0x7f7850b18ba0) 0
+ primary-for QFileSystemWatcher (0x0x7f7850accf08)
+
+Class QFinalState::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QFinalState::QPrivateSignal (0x0x7f7850b18e40) 0 empty
+
+Vtable for QFinalState
+QFinalState::_ZTV11QFinalState: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QFinalState)
+16 (int (*)(...))QFinalState::metaObject
+24 (int (*)(...))QFinalState::qt_metacast
+32 (int (*)(...))QFinalState::qt_metacall
+40 (int (*)(...))QFinalState::~QFinalState
+48 (int (*)(...))QFinalState::~QFinalState
+56 (int (*)(...))QFinalState::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QFinalState::onEntry
+120 (int (*)(...))QFinalState::onExit
+
+Class QFinalState
+ size=16 align=8
+ base size=16 base align=8
+QFinalState (0x0x7f7850accf70) 0
+ vptr=((& QFinalState::_ZTV11QFinalState) + 16)
+ QAbstractState (0x0x7f7850b66000) 0
+ primary-for QFinalState (0x0x7f7850accf70)
+ QObject (0x0x7f7850b18de0) 0
+ primary-for QAbstractState (0x0x7f7850b66000)
+
+Vtable for QRunnable
+QRunnable::_ZTV9QRunnable: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QRunnable)
+16 (int (*)(...))__cxa_pure_virtual
+24 0
+32 0
+
+Class QRunnable
+ size=16 align=8
+ base size=12 base align=8
+QRunnable (0x0x7f7850b75060) 0
+ vptr=((& QRunnable::_ZTV9QRunnable) + 16)
+
+Class QBasicMutex
+ size=8 align=8
+ base size=8 base align=8
+QBasicMutex (0x0x7f7850b75300) 0
+
+Class QMutex
+ size=8 align=8
+ base size=8 base align=8
+QMutex (0x0x7f7850b660d0) 0
+ QBasicMutex (0x0x7f7850b75f60) 0
+
+Class QRecursiveMutex
+ size=8 align=8
+ base size=8 base align=8
+QRecursiveMutex (0x0x7f7850b66138) 0
+ QMutex (0x0x7f7850b661a0) 0
+ QBasicMutex (0x0x7f78508001e0) 0
+
+Class QMutexLocker
+ size=8 align=8
+ base size=8 base align=8
+QMutexLocker (0x0x7f7850800240) 0
+
+Class QtPrivate::ResultItem
+ size=16 align=8
+ base size=16 base align=8
+QtPrivate::ResultItem (0x0x7f7850800840) 0
+
+Class QtPrivate::ResultIteratorBase
+ size=16 align=8
+ base size=12 base align=8
+QtPrivate::ResultIteratorBase (0x0x7f7850800e40) 0
+
+Vtable for QtPrivate::ResultStoreBase
+QtPrivate::ResultStoreBase::_ZTVN9QtPrivate15ResultStoreBaseE: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTIN9QtPrivate15ResultStoreBaseE)
+16 (int (*)(...))QtPrivate::ResultStoreBase::~ResultStoreBase
+24 (int (*)(...))QtPrivate::ResultStoreBase::~ResultStoreBase
+
+Class QtPrivate::ResultStoreBase
+ size=48 align=8
+ base size=44 base align=8
+QtPrivate::ResultStoreBase (0x0x7f7850851060) 0
+ vptr=((& QtPrivate::ResultStoreBase::_ZTVN9QtPrivate15ResultStoreBaseE) + 16)
+
+Class std::__mutex_base
+ size=40 align=8
+ base size=40 base align=8
+std::__mutex_base (0x0x7f785089d840) 0
+
+Class std::mutex
+ size=40 align=8
+ base size=40 base align=8
+std::mutex (0x0x7f7850892a90) 0
+ std::__mutex_base (0x0x7f785089d8a0) 0
+
+Class std::defer_lock_t
+ size=1 align=1
+ base size=0 base align=1
+std::defer_lock_t (0x0x7f785089da80) 0 empty
+
+Class std::try_to_lock_t
+ size=1 align=1
+ base size=0 base align=1
+std::try_to_lock_t (0x0x7f785089dae0) 0 empty
+
+Class std::adopt_lock_t
+ size=1 align=1
+ base size=0 base align=1
+std::adopt_lock_t (0x0x7f785089db40) 0 empty
+
+Class std::__recursive_mutex_base
+ size=40 align=8
+ base size=40 base align=8
+std::__recursive_mutex_base (0x0x7f78508d15a0) 0
+
+Class std::recursive_mutex
+ size=40 align=8
+ base size=40 base align=8
+std::recursive_mutex (0x0x7f7850892af8) 0
+ std::__recursive_mutex_base (0x0x7f78508d1600) 0
+
+Class std::timed_mutex
+ size=40 align=8
+ base size=40 base align=8
+std::timed_mutex (0x0x7f78508be4d0) 0
+ std::__mutex_base (0x0x7f78508d19c0) 0
+ std::__timed_mutex_impl<std::timed_mutex> (0x0x7f78508d1a20) 0 empty
+
+Class std::recursive_timed_mutex
+ size=40 align=8
+ base size=40 base align=8
+std::recursive_timed_mutex (0x0x7f78508be850) 0
+ std::__recursive_mutex_base (0x0x7f78508d1d80) 0
+ std::__timed_mutex_impl<std::recursive_timed_mutex> (0x0x7f78508d1de0) 0 empty
+
+Class std::once_flag
+ size=4 align=4
+ base size=4 base align=4
+std::once_flag (0x0x7f785090e540) 0
+
+Vtable for QFutureInterfaceBase
+QFutureInterfaceBase::_ZTV20QFutureInterfaceBase: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QFutureInterfaceBase)
+16 (int (*)(...))QFutureInterfaceBase::~QFutureInterfaceBase
+24 (int (*)(...))QFutureInterfaceBase::~QFutureInterfaceBase
+
+Class QFutureInterfaceBase
+ size=16 align=8
+ base size=16 base align=8
+QFutureInterfaceBase (0x0x7f785090e780) 0
+ vptr=((& QFutureInterfaceBase::_ZTV20QFutureInterfaceBase) + 16)
+
+Class QFutureWatcherBase::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QFutureWatcherBase::QPrivateSignal (0x0x7f78509beae0) 0 empty
+
+Vtable for QFutureWatcherBase
+QFutureWatcherBase::_ZTV18QFutureWatcherBase: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QFutureWatcherBase)
+16 (int (*)(...))QFutureWatcherBase::metaObject
+24 (int (*)(...))QFutureWatcherBase::qt_metacast
+32 (int (*)(...))QFutureWatcherBase::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QFutureWatcherBase::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QFutureWatcherBase::connectNotify
+104 (int (*)(...))QFutureWatcherBase::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+
+Class QFutureWatcherBase
+ size=16 align=8
+ base size=16 base align=8
+QFutureWatcherBase (0x0x7f78509598f0) 0
+ vptr=((& QFutureWatcherBase::_ZTV18QFutureWatcherBase) + 16)
+ QObject (0x0x7f78509bea80) 0
+ primary-for QFutureWatcherBase (0x0x7f78509598f0)
+
+Class QHistoryState::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QHistoryState::QPrivateSignal (0x0x7f78505ebe40) 0 empty
+
+Vtable for QHistoryState
+QHistoryState::_ZTV13QHistoryState: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QHistoryState)
+16 (int (*)(...))QHistoryState::metaObject
+24 (int (*)(...))QHistoryState::qt_metacast
+32 (int (*)(...))QHistoryState::qt_metacall
+40 (int (*)(...))QHistoryState::~QHistoryState
+48 (int (*)(...))QHistoryState::~QHistoryState
+56 (int (*)(...))QHistoryState::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QHistoryState::onEntry
+120 (int (*)(...))QHistoryState::onExit
+
+Class QHistoryState
+ size=16 align=8
+ base size=16 base align=8
+QHistoryState (0x0x7f7850604138) 0
+ vptr=((& QHistoryState::_ZTV13QHistoryState) + 16)
+ QAbstractState (0x0x7f78506041a0) 0
+ primary-for QHistoryState (0x0x7f7850604138)
+ QObject (0x0x7f78505ebde0) 0
+ primary-for QAbstractState (0x0x7f78506041a0)
+
+Class QIdentityProxyModel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QIdentityProxyModel::QPrivateSignal (0x0x7f785061b180) 0 empty
+
+Vtable for QIdentityProxyModel
+QIdentityProxyModel::_ZTV19QIdentityProxyModel: 53 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QIdentityProxyModel)
+16 (int (*)(...))QIdentityProxyModel::metaObject
+24 (int (*)(...))QIdentityProxyModel::qt_metacast
+32 (int (*)(...))QIdentityProxyModel::qt_metacall
+40 (int (*)(...))QIdentityProxyModel::~QIdentityProxyModel
+48 (int (*)(...))QIdentityProxyModel::~QIdentityProxyModel
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QIdentityProxyModel::index
+120 (int (*)(...))QIdentityProxyModel::parent
+128 (int (*)(...))QIdentityProxyModel::sibling
+136 (int (*)(...))QIdentityProxyModel::rowCount
+144 (int (*)(...))QIdentityProxyModel::columnCount
+152 (int (*)(...))QAbstractProxyModel::hasChildren
+160 (int (*)(...))QAbstractProxyModel::data
+168 (int (*)(...))QAbstractProxyModel::setData
+176 (int (*)(...))QIdentityProxyModel::headerData
+184 (int (*)(...))QAbstractProxyModel::setHeaderData
+192 (int (*)(...))QAbstractProxyModel::itemData
+200 (int (*)(...))QAbstractProxyModel::setItemData
+208 (int (*)(...))QAbstractProxyModel::mimeTypes
+216 (int (*)(...))QAbstractProxyModel::mimeData
+224 (int (*)(...))QAbstractProxyModel::canDropMimeData
+232 (int (*)(...))QIdentityProxyModel::dropMimeData
+240 (int (*)(...))QAbstractProxyModel::supportedDropActions
+248 (int (*)(...))QAbstractProxyModel::supportedDragActions
+256 (int (*)(...))QIdentityProxyModel::insertRows
+264 (int (*)(...))QIdentityProxyModel::insertColumns
+272 (int (*)(...))QIdentityProxyModel::removeRows
+280 (int (*)(...))QIdentityProxyModel::removeColumns
+288 (int (*)(...))QIdentityProxyModel::moveRows
+296 (int (*)(...))QIdentityProxyModel::moveColumns
+304 (int (*)(...))QAbstractProxyModel::fetchMore
+312 (int (*)(...))QAbstractProxyModel::canFetchMore
+320 (int (*)(...))QAbstractProxyModel::flags
+328 (int (*)(...))QAbstractProxyModel::sort
+336 (int (*)(...))QAbstractProxyModel::buddy
+344 (int (*)(...))QIdentityProxyModel::match
+352 (int (*)(...))QAbstractProxyModel::span
+360 (int (*)(...))QAbstractItemModel::roleNames
+368 (int (*)(...))QAbstractProxyModel::submit
+376 (int (*)(...))QAbstractProxyModel::revert
+384 (int (*)(...))QIdentityProxyModel::setSourceModel
+392 (int (*)(...))QIdentityProxyModel::mapToSource
+400 (int (*)(...))QIdentityProxyModel::mapFromSource
+408 (int (*)(...))QIdentityProxyModel::mapSelectionToSource
+416 (int (*)(...))QIdentityProxyModel::mapSelectionFromSource
+
+Class QIdentityProxyModel
+ size=16 align=8
+ base size=16 base align=8
+QIdentityProxyModel (0x0x7f7850604208) 0
+ vptr=((& QIdentityProxyModel::_ZTV19QIdentityProxyModel) + 16)
+ QAbstractProxyModel (0x0x7f7850604270) 0
+ primary-for QIdentityProxyModel (0x0x7f7850604208)
+ QAbstractItemModel (0x0x7f78506042d8) 0
+ primary-for QAbstractProxyModel (0x0x7f7850604270)
+ QObject (0x0x7f785061b120) 0
+ primary-for QAbstractItemModel (0x0x7f78506042d8)
+
+Class QItemSelectionRange
+ size=16 align=8
+ base size=16 base align=8
+QItemSelectionRange (0x0x7f785061b360) 0
+
+Class QItemSelectionModel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QItemSelectionModel::QPrivateSignal (0x0x7f78506d9c60) 0 empty
+
+Vtable for QItemSelectionModel
+QItemSelectionModel::_ZTV19QItemSelectionModel: 20 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QItemSelectionModel)
+16 (int (*)(...))QItemSelectionModel::metaObject
+24 (int (*)(...))QItemSelectionModel::qt_metacast
+32 (int (*)(...))QItemSelectionModel::qt_metacall
+40 (int (*)(...))QItemSelectionModel::~QItemSelectionModel
+48 (int (*)(...))QItemSelectionModel::~QItemSelectionModel
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QItemSelectionModel::setCurrentIndex
+120 (int (*)(...))QItemSelectionModel::select
+128 (int (*)(...))QItemSelectionModel::select
+136 (int (*)(...))QItemSelectionModel::clear
+144 (int (*)(...))QItemSelectionModel::reset
+152 (int (*)(...))QItemSelectionModel::clearCurrentIndex
+
+Class QItemSelectionModel
+ size=16 align=8
+ base size=16 base align=8
+QItemSelectionModel (0x0x7f78506d8c30) 0
+ vptr=((& QItemSelectionModel::_ZTV19QItemSelectionModel) + 16)
+ QObject (0x0x7f78506d9c00) 0
+ primary-for QItemSelectionModel (0x0x7f78506d8c30)
+
+Class QItemSelection
+ size=8 align=8
+ base size=8 base align=8
+QItemSelection (0x0x7f78506d8dd0) 0
+ QList<QItemSelectionRange> (0x0x7f78506d8e38) 0
+ QListSpecialMethods<QItemSelectionRange> (0x0x7f7850716780) 0 empty
+
+Class QJsonValue
+ size=24 align=8
+ base size=20 base align=8
+QJsonValue (0x0x7f78507ac0c0) 0
+
+Class QJsonValueRef
+ size=16 align=8
+ base size=12 base align=8
+QJsonValueRef (0x0x7f78507aca20) 0
+
+Class QJsonValuePtr
+ size=24 align=8
+ base size=24 base align=8
+QJsonValuePtr (0x0x7f785040d9c0) 0
+
+Class QJsonValueRefPtr
+ size=16 align=8
+ base size=16 base align=8
+QJsonValueRefPtr (0x0x7f785040dc60) 0
+
+Class QJsonArray::iterator
+ size=16 align=8
+ base size=12 base align=8
+QJsonArray::iterator (0x0x7f7850484000) 0
+
+Class QJsonArray::const_iterator
+ size=16 align=8
+ base size=12 base align=8
+QJsonArray::const_iterator (0x0x7f7850484060) 0
+
+Class QJsonArray
+ size=16 align=8
+ base size=16 base align=8
+QJsonArray (0x0x7f785045cf60) 0
+
+Class QJsonParseError
+ size=8 align=4
+ base size=8 base align=4
+QJsonParseError (0x0x7f7850525600) 0
+
+Class QJsonDocument
+ size=8 align=8
+ base size=8 base align=8
+QJsonDocument (0x0x7f7850525660) 0
+
+Class QJsonObject::iterator
+ size=16 align=8
+ base size=12 base align=8
+QJsonObject::iterator (0x0x7f785036e5a0) 0
+
+Class QJsonObject::const_iterator
+ size=16 align=8
+ base size=12 base align=8
+QJsonObject::const_iterator (0x0x7f785036e600) 0
+
+Class QJsonObject
+ size=16 align=8
+ base size=16 base align=8
+QJsonObject (0x0x7f785036e540) 0
+
+Class QLibrary::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QLibrary::QPrivateSignal (0x0x7f78500248a0) 0 empty
+
+Vtable for QLibrary
+QLibrary::_ZTV8QLibrary: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI8QLibrary)
+16 (int (*)(...))QLibrary::metaObject
+24 (int (*)(...))QLibrary::qt_metacast
+32 (int (*)(...))QLibrary::qt_metacall
+40 (int (*)(...))QLibrary::~QLibrary
+48 (int (*)(...))QLibrary::~QLibrary
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QLibrary
+ size=32 align=8
+ base size=25 base align=8
+QLibrary (0x0x7f78500257b8) 0
+ vptr=((& QLibrary::_ZTV8QLibrary) + 16)
+ QObject (0x0x7f7850024840) 0
+ primary-for QLibrary (0x0x7f78500257b8)
+
+Class QVersionNumber::SegmentStorage
+ size=8 align=8
+ base size=8 base align=8
+QVersionNumber::SegmentStorage (0x0x7f7850066720) 0
+
+Class QVersionNumber
+ size=8 align=8
+ base size=8 base align=8
+QVersionNumber (0x0x7f7850066240) 0
+
+Class QLibraryInfo
+ size=1 align=1
+ base size=0 base align=1
+QLibraryInfo (0x0x7f785014fb40) 0 empty
+
+Class QPoint
+ size=8 align=4
+ base size=8 base align=4
+QPoint (0x0x7f785014fba0) 0
+
+Class QPointF
+ size=16 align=8
+ base size=16 base align=8
+QPointF (0x0x7f78501c0a20) 0
+
+Class QLine
+ size=16 align=4
+ base size=16 base align=4
+QLine (0x0x7f784fe33c00) 0
+
+Class QLineF
+ size=32 align=8
+ base size=32 base align=8
+QLineF (0x0x7f784fed2000) 0
+
+Class QLinkedListData
+ size=32 align=8
+ base size=25 base align=8
+QLinkedListData (0x0x7f784ff492a0) 0
+
+Class QLockFile
+ size=8 align=8
+ base size=8 base align=8
+QLockFile (0x0x7f784fbe87e0) 0
+
+Class QLoggingCategory::AtomicBools
+ size=4 align=1
+ base size=4 base align=1
+QLoggingCategory::AtomicBools (0x0x7f784fbe8a20) 0
+
+Class QLoggingCategory
+ size=24 align=8
+ base size=24 base align=8
+QLoggingCategory (0x0x7f784fbe89c0) 0
+
+Class QMargins
+ size=16 align=4
+ base size=16 base align=4
+QMargins (0x0x7f784fbe8e40) 0
+
+Class QMarginsF
+ size=32 align=8
+ base size=32 base align=8
+QMarginsF (0x0x7f784fc9ed80) 0
+
+Class QMessageAuthenticationCode
+ size=8 align=8
+ base size=8 base align=8
+QMessageAuthenticationCode (0x0x7f784fb0d5a0) 0
+
+Class QMetaMethod
+ size=16 align=8
+ base size=12 base align=8
+QMetaMethod (0x0x7f784fb0d600) 0
+
+Class QMetaEnum
+ size=16 align=8
+ base size=12 base align=8
+QMetaEnum (0x0x7f784fb76e40) 0
+
+Class QMetaProperty
+ size=32 align=8
+ base size=32 base align=8
+QMetaProperty (0x0x7f784f7d9060) 0
+
+Class QMetaClassInfo
+ size=16 align=8
+ base size=12 base align=8
+QMetaClassInfo (0x0x7f784f7d9180) 0
+
+Class QMimeData::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QMimeData::QPrivateSignal (0x0x7f784f819720) 0 empty
+
+Vtable for QMimeData
+QMimeData::_ZTV9QMimeData: 17 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QMimeData)
+16 (int (*)(...))QMimeData::metaObject
+24 (int (*)(...))QMimeData::qt_metacast
+32 (int (*)(...))QMimeData::qt_metacall
+40 (int (*)(...))QMimeData::~QMimeData
+48 (int (*)(...))QMimeData::~QMimeData
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QMimeData::hasFormat
+120 (int (*)(...))QMimeData::formats
+128 (int (*)(...))QMimeData::retrieveData
+
+Class QMimeData
+ size=16 align=8
+ base size=16 base align=8
+QMimeData (0x0x7f784f820340) 0
+ vptr=((& QMimeData::_ZTV9QMimeData) + 16)
+ QObject (0x0x7f784f8196c0) 0
+ primary-for QMimeData (0x0x7f784f820340)
+
+Class QMimeType
+ size=8 align=8
+ base size=8 base align=8
+QMimeType (0x0x7f784f819900) 0
+
+Class QMimeDatabase
+ size=8 align=8
+ base size=8 base align=8
+QMimeDatabase (0x0x7f784f8e9840) 0
+
+Class QObjectCleanupHandler::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QObjectCleanupHandler::QPrivateSignal (0x0x7f784f8e9900) 0 empty
+
+Vtable for QObjectCleanupHandler
+QObjectCleanupHandler::_ZTV21QObjectCleanupHandler: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI21QObjectCleanupHandler)
+16 (int (*)(...))QObjectCleanupHandler::metaObject
+24 (int (*)(...))QObjectCleanupHandler::qt_metacast
+32 (int (*)(...))QObjectCleanupHandler::qt_metacall
+40 (int (*)(...))QObjectCleanupHandler::~QObjectCleanupHandler
+48 (int (*)(...))QObjectCleanupHandler::~QObjectCleanupHandler
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QObjectCleanupHandler
+ size=24 align=8
+ base size=24 base align=8
+QObjectCleanupHandler (0x0x7f784f8deea0) 0
+ vptr=((& QObjectCleanupHandler::_ZTV21QObjectCleanupHandler) + 16)
+ QObject (0x0x7f784f8e98a0) 0
+ primary-for QObjectCleanupHandler (0x0x7f784f8deea0)
+
+Class QOperatingSystemVersion
+ size=16 align=4
+ base size=16 base align=4
+QOperatingSystemVersion (0x0x7f784f8e9a20) 0
+
+Class QParallelAnimationGroup::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QParallelAnimationGroup::QPrivateSignal (0x0x7f784f9741e0) 0 empty
+
+Vtable for QParallelAnimationGroup
+QParallelAnimationGroup::_ZTV23QParallelAnimationGroup: 18 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI23QParallelAnimationGroup)
+16 (int (*)(...))QParallelAnimationGroup::metaObject
+24 (int (*)(...))QParallelAnimationGroup::qt_metacast
+32 (int (*)(...))QParallelAnimationGroup::qt_metacall
+40 (int (*)(...))QParallelAnimationGroup::~QParallelAnimationGroup
+48 (int (*)(...))QParallelAnimationGroup::~QParallelAnimationGroup
+56 (int (*)(...))QParallelAnimationGroup::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QParallelAnimationGroup::duration
+120 (int (*)(...))QParallelAnimationGroup::updateCurrentTime
+128 (int (*)(...))QParallelAnimationGroup::updateState
+136 (int (*)(...))QParallelAnimationGroup::updateDirection
+
+Class QParallelAnimationGroup
+ size=16 align=8
+ base size=16 base align=8
+QParallelAnimationGroup (0x0x7f784f96b750) 0
+ vptr=((& QParallelAnimationGroup::_ZTV23QParallelAnimationGroup) + 16)
+ QAnimationGroup (0x0x7f784f96b7b8) 0
+ primary-for QParallelAnimationGroup (0x0x7f784f96b750)
+ QAbstractAnimation (0x0x7f784f96b820) 0
+ primary-for QAnimationGroup (0x0x7f784f96b7b8)
+ QObject (0x0x7f784f974180) 0
+ primary-for QAbstractAnimation (0x0x7f784f96b820)
+
+Class QPauseAnimation::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QPauseAnimation::QPrivateSignal (0x0x7f784f974420) 0 empty
+
+Vtable for QPauseAnimation
+QPauseAnimation::_ZTV15QPauseAnimation: 18 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QPauseAnimation)
+16 (int (*)(...))QPauseAnimation::metaObject
+24 (int (*)(...))QPauseAnimation::qt_metacast
+32 (int (*)(...))QPauseAnimation::qt_metacall
+40 (int (*)(...))QPauseAnimation::~QPauseAnimation
+48 (int (*)(...))QPauseAnimation::~QPauseAnimation
+56 (int (*)(...))QPauseAnimation::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QPauseAnimation::duration
+120 (int (*)(...))QPauseAnimation::updateCurrentTime
+128 (int (*)(...))QAbstractAnimation::updateState
+136 (int (*)(...))QAbstractAnimation::updateDirection
+
+Class QPauseAnimation
+ size=16 align=8
+ base size=16 base align=8
+QPauseAnimation (0x0x7f784f96b888) 0
+ vptr=((& QPauseAnimation::_ZTV15QPauseAnimation) + 16)
+ QAbstractAnimation (0x0x7f784f96b8f0) 0
+ primary-for QPauseAnimation (0x0x7f784f96b888)
+ QObject (0x0x7f784f9743c0) 0
+ primary-for QAbstractAnimation (0x0x7f784f96b8f0)
+
+Class QStaticPlugin
+ size=16 align=8
+ base size=16 base align=8
+QStaticPlugin (0x0x7f784f974f60) 0
+
+Class QPluginLoader::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QPluginLoader::QPrivateSignal (0x0x7f784f5eb120) 0 empty
+
+Vtable for QPluginLoader
+QPluginLoader::_ZTV13QPluginLoader: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QPluginLoader)
+16 (int (*)(...))QPluginLoader::metaObject
+24 (int (*)(...))QPluginLoader::qt_metacast
+32 (int (*)(...))QPluginLoader::qt_metacall
+40 (int (*)(...))QPluginLoader::~QPluginLoader
+48 (int (*)(...))QPluginLoader::~QPluginLoader
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QPluginLoader
+ size=32 align=8
+ base size=25 base align=8
+QPluginLoader (0x0x7f784f5d6c30) 0
+ vptr=((& QPluginLoader::_ZTV13QPluginLoader) + 16)
+ QObject (0x0x7f784f5eb0c0) 0
+ primary-for QPluginLoader (0x0x7f784f5d6c30)
+
+Class QProcessEnvironment
+ size=8 align=8
+ base size=8 base align=8
+QProcessEnvironment (0x0x7f784f5eb240) 0
+
+Class QProcess::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QProcess::QPrivateSignal (0x0x7f784f6ba6c0) 0 empty
+
+Vtable for QProcess
+QProcess::_ZTV8QProcess: 31 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI8QProcess)
+16 (int (*)(...))QProcess::metaObject
+24 (int (*)(...))QProcess::qt_metacast
+32 (int (*)(...))QProcess::qt_metacall
+40 (int (*)(...))QProcess::~QProcess
+48 (int (*)(...))QProcess::~QProcess
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QProcess::isSequential
+120 (int (*)(...))QProcess::open
+128 (int (*)(...))QProcess::close
+136 (int (*)(...))QIODevice::pos
+144 (int (*)(...))QIODevice::size
+152 (int (*)(...))QIODevice::seek
+160 (int (*)(...))QProcess::atEnd
+168 (int (*)(...))QIODevice::reset
+176 (int (*)(...))QProcess::bytesAvailable
+184 (int (*)(...))QProcess::bytesToWrite
+192 (int (*)(...))QProcess::canReadLine
+200 (int (*)(...))QProcess::waitForReadyRead
+208 (int (*)(...))QProcess::waitForBytesWritten
+216 (int (*)(...))QProcess::readData
+224 (int (*)(...))QIODevice::readLineData
+232 (int (*)(...))QProcess::writeData
+240 (int (*)(...))QProcess::setupChildProcess
+
+Class QProcess
+ size=16 align=8
+ base size=16 base align=8
+QProcess (0x0x7f784f6c00d0) 0
+ vptr=((& QProcess::_ZTV8QProcess) + 16)
+ QIODevice (0x0x7f784f6c0138) 0
+ primary-for QProcess (0x0x7f784f6c00d0)
+ QObject (0x0x7f784f6ba660) 0
+ primary-for QIODevice (0x0x7f784f6c0138)
+
+Class QVariantAnimation::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QVariantAnimation::QPrivateSignal (0x0x7f784f6bad80) 0 empty
+
+Vtable for QVariantAnimation
+QVariantAnimation::_ZTV17QVariantAnimation: 20 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QVariantAnimation)
+16 (int (*)(...))QVariantAnimation::metaObject
+24 (int (*)(...))QVariantAnimation::qt_metacast
+32 (int (*)(...))QVariantAnimation::qt_metacall
+40 (int (*)(...))QVariantAnimation::~QVariantAnimation
+48 (int (*)(...))QVariantAnimation::~QVariantAnimation
+56 (int (*)(...))QVariantAnimation::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QVariantAnimation::duration
+120 (int (*)(...))QVariantAnimation::updateCurrentTime
+128 (int (*)(...))QVariantAnimation::updateState
+136 (int (*)(...))QAbstractAnimation::updateDirection
+144 (int (*)(...))QVariantAnimation::updateCurrentValue
+152 (int (*)(...))QVariantAnimation::interpolated
+
+Class QVariantAnimation
+ size=16 align=8
+ base size=16 base align=8
+QVariantAnimation (0x0x7f784f6c01a0) 0
+ vptr=((& QVariantAnimation::_ZTV17QVariantAnimation) + 16)
+ QAbstractAnimation (0x0x7f784f6c0208) 0
+ primary-for QVariantAnimation (0x0x7f784f6c01a0)
+ QObject (0x0x7f784f6bad20) 0
+ primary-for QAbstractAnimation (0x0x7f784f6c0208)
+
+Class QPropertyAnimation::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QPropertyAnimation::QPrivateSignal (0x0x7f784f70d060) 0 empty
+
+Vtable for QPropertyAnimation
+QPropertyAnimation::_ZTV18QPropertyAnimation: 20 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QPropertyAnimation)
+16 (int (*)(...))QPropertyAnimation::metaObject
+24 (int (*)(...))QPropertyAnimation::qt_metacast
+32 (int (*)(...))QPropertyAnimation::qt_metacall
+40 (int (*)(...))QPropertyAnimation::~QPropertyAnimation
+48 (int (*)(...))QPropertyAnimation::~QPropertyAnimation
+56 (int (*)(...))QPropertyAnimation::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QVariantAnimation::duration
+120 (int (*)(...))QVariantAnimation::updateCurrentTime
+128 (int (*)(...))QPropertyAnimation::updateState
+136 (int (*)(...))QAbstractAnimation::updateDirection
+144 (int (*)(...))QPropertyAnimation::updateCurrentValue
+152 (int (*)(...))QVariantAnimation::interpolated
+
+Class QPropertyAnimation
+ size=16 align=8
+ base size=16 base align=8
+QPropertyAnimation (0x0x7f784f6c02d8) 0
+ vptr=((& QPropertyAnimation::_ZTV18QPropertyAnimation) + 16)
+ QVariantAnimation (0x0x7f784f6c0340) 0
+ primary-for QPropertyAnimation (0x0x7f784f6c02d8)
+ QAbstractAnimation (0x0x7f784f6c03a8) 0
+ primary-for QVariantAnimation (0x0x7f784f6c0340)
+ QObject (0x0x7f784f70d000) 0
+ primary-for QAbstractAnimation (0x0x7f784f6c03a8)
+
+Class std::random_device
+ size=5000 align=8
+ base size=5000 base align=8
+std::random_device (0x0x7f784f780780) 0
+
+Class std::bernoulli_distribution::param_type
+ size=8 align=8
+ base size=8 base align=8
+std::bernoulli_distribution::param_type (0x0x7f784f4894e0) 0
+
+Class std::bernoulli_distribution
+ size=8 align=8
+ base size=8 base align=8
+std::bernoulli_distribution (0x0x7f784f489480) 0
+
+Class std::seed_seq
+ size=24 align=8
+ base size=24 base align=8
+std::seed_seq (0x0x7f784f27d240) 0
+
+Class QRandomGenerator::Storage
+ size=2504 align=8
+ base size=2504 base align=8
+QRandomGenerator::Storage (0x0x7f784f081ea0) 0
+
+Class QRandomGenerator
+ size=2512 align=8
+ base size=2512 base align=8
+QRandomGenerator (0x0x7f784f081e40) 0
+
+Class QRandomGenerator64
+ size=2512 align=8
+ base size=2512 base align=8
+QRandomGenerator64 (0x0x7f784f134068) 0
+ QRandomGenerator (0x0x7f784f1329c0) 0
+
+Class QReadWriteLock
+ size=8 align=8
+ base size=8 base align=8
+QReadWriteLock (0x0x7f784f1575a0) 0
+
+Class QReadLocker
+ size=8 align=8
+ base size=8 base align=8
+QReadLocker (0x0x7f784f157840) 0
+
+Class QWriteLocker
+ size=8 align=8
+ base size=8 base align=8
+QWriteLocker (0x0x7f784f157d20) 0
+
+Class QSize
+ size=8 align=4
+ base size=8 base align=4
+QSize (0x0x7f784ede1240) 0
+
+Class QSizeF
+ size=16 align=8
+ base size=16 base align=8
+QSizeF (0x0x7f784ee54120) 0
+
+Class QRect
+ size=16 align=4
+ base size=16 base align=4
+QRect (0x0x7f784eecf180) 0
+
+Class QRectF
+ size=32 align=8
+ base size=32 base align=8
+QRectF (0x0x7f784ef8d1e0) 0
+
+Class QResource
+ size=8 align=8
+ base size=8 base align=8
+QResource (0x0x7f784ec46300) 0
+
+Class QSaveFile::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSaveFile::QPrivateSignal (0x0x7f784ec465a0) 0 empty
+
+Vtable for QSaveFile
+QSaveFile::_ZTV9QSaveFile: 34 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QSaveFile)
+16 (int (*)(...))QSaveFile::metaObject
+24 (int (*)(...))QSaveFile::qt_metacast
+32 (int (*)(...))QSaveFile::qt_metacall
+40 (int (*)(...))QSaveFile::~QSaveFile
+48 (int (*)(...))QSaveFile::~QSaveFile
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QFileDevice::isSequential
+120 (int (*)(...))QSaveFile::open
+128 (int (*)(...))QSaveFile::close
+136 (int (*)(...))QFileDevice::pos
+144 (int (*)(...))QFileDevice::size
+152 (int (*)(...))QFileDevice::seek
+160 (int (*)(...))QFileDevice::atEnd
+168 (int (*)(...))QIODevice::reset
+176 (int (*)(...))QIODevice::bytesAvailable
+184 (int (*)(...))QIODevice::bytesToWrite
+192 (int (*)(...))QIODevice::canReadLine
+200 (int (*)(...))QIODevice::waitForReadyRead
+208 (int (*)(...))QIODevice::waitForBytesWritten
+216 (int (*)(...))QFileDevice::readData
+224 (int (*)(...))QFileDevice::readLineData
+232 (int (*)(...))QSaveFile::writeData
+240 (int (*)(...))QSaveFile::fileName
+248 (int (*)(...))QFileDevice::resize
+256 (int (*)(...))QFileDevice::permissions
+264 (int (*)(...))QFileDevice::setPermissions
+
+Class QSaveFile
+ size=16 align=8
+ base size=16 base align=8
+QSaveFile (0x0x7f784ebe7a28) 0
+ vptr=((& QSaveFile::_ZTV9QSaveFile) + 16)
+ QFileDevice (0x0x7f784ebe7a90) 0
+ primary-for QSaveFile (0x0x7f784ebe7a28)
+ QIODevice (0x0x7f784ebe7af8) 0
+ primary-for QFileDevice (0x0x7f784ebe7a90)
+ QObject (0x0x7f784ec46540) 0
+ primary-for QIODevice (0x0x7f784ebe7af8)
+
+Class QSemaphore
+ size=8 align=8
+ base size=8 base align=8
+QSemaphore (0x0x7f784ec46c00) 0
+
+Class QSemaphoreReleaser
+ size=16 align=8
+ base size=12 base align=8
+QSemaphoreReleaser (0x0x7f784ec46d80) 0
+
+Class QSequentialAnimationGroup::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSequentialAnimationGroup::QPrivateSignal (0x0x7f784ed409c0) 0 empty
+
+Vtable for QSequentialAnimationGroup
+QSequentialAnimationGroup::_ZTV25QSequentialAnimationGroup: 18 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI25QSequentialAnimationGroup)
+16 (int (*)(...))QSequentialAnimationGroup::metaObject
+24 (int (*)(...))QSequentialAnimationGroup::qt_metacast
+32 (int (*)(...))QSequentialAnimationGroup::qt_metacall
+40 (int (*)(...))QSequentialAnimationGroup::~QSequentialAnimationGroup
+48 (int (*)(...))QSequentialAnimationGroup::~QSequentialAnimationGroup
+56 (int (*)(...))QSequentialAnimationGroup::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QSequentialAnimationGroup::duration
+120 (int (*)(...))QSequentialAnimationGroup::updateCurrentTime
+128 (int (*)(...))QSequentialAnimationGroup::updateState
+136 (int (*)(...))QSequentialAnimationGroup::updateDirection
+
+Class QSequentialAnimationGroup
+ size=16 align=8
+ base size=16 base align=8
+QSequentialAnimationGroup (0x0x7f784ed512d8) 0
+ vptr=((& QSequentialAnimationGroup::_ZTV25QSequentialAnimationGroup) + 16)
+ QAnimationGroup (0x0x7f784ed51340) 0
+ primary-for QSequentialAnimationGroup (0x0x7f784ed512d8)
+ QAbstractAnimation (0x0x7f784ed513a8) 0
+ primary-for QAnimationGroup (0x0x7f784ed51340)
+ QObject (0x0x7f784ed40960) 0
+ primary-for QAbstractAnimation (0x0x7f784ed513a8)
+
+Class QSettings::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSettings::QPrivateSignal (0x0x7f784ed40c00) 0 empty
+
+Vtable for QSettings
+QSettings::_ZTV9QSettings: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QSettings)
+16 (int (*)(...))QSettings::metaObject
+24 (int (*)(...))QSettings::qt_metacast
+32 (int (*)(...))QSettings::qt_metacall
+40 (int (*)(...))QSettings::~QSettings
+48 (int (*)(...))QSettings::~QSettings
+56 (int (*)(...))QSettings::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QSettings
+ size=16 align=8
+ base size=16 base align=8
+QSettings (0x0x7f784ed51410) 0
+ vptr=((& QSettings::_ZTV9QSettings) + 16)
+ QObject (0x0x7f784ed40ba0) 0
+ primary-for QSettings (0x0x7f784ed51410)
+
+Class QSharedMemory::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSharedMemory::QPrivateSignal (0x0x7f784ed890c0) 0 empty
+
+Vtable for QSharedMemory
+QSharedMemory::_ZTV13QSharedMemory: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QSharedMemory)
+16 (int (*)(...))QSharedMemory::metaObject
+24 (int (*)(...))QSharedMemory::qt_metacast
+32 (int (*)(...))QSharedMemory::qt_metacall
+40 (int (*)(...))QSharedMemory::~QSharedMemory
+48 (int (*)(...))QSharedMemory::~QSharedMemory
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QSharedMemory
+ size=16 align=8
+ base size=16 base align=8
+QSharedMemory (0x0x7f784ed51478) 0
+ vptr=((& QSharedMemory::_ZTV13QSharedMemory) + 16)
+ QObject (0x0x7f784ed89060) 0
+ primary-for QSharedMemory (0x0x7f784ed51478)
+
+Class QSignalMapper::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSignalMapper::QPrivateSignal (0x0x7f784ed89300) 0 empty
+
+Vtable for QSignalMapper
+QSignalMapper::_ZTV13QSignalMapper: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QSignalMapper)
+16 (int (*)(...))QSignalMapper::metaObject
+24 (int (*)(...))QSignalMapper::qt_metacast
+32 (int (*)(...))QSignalMapper::qt_metacall
+40 (int (*)(...))QSignalMapper::~QSignalMapper
+48 (int (*)(...))QSignalMapper::~QSignalMapper
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QSignalMapper
+ size=16 align=8
+ base size=16 base align=8
+QSignalMapper (0x0x7f784ed514e0) 0
+ vptr=((& QSignalMapper::_ZTV13QSignalMapper) + 16)
+ QObject (0x0x7f784ed892a0) 0
+ primary-for QSignalMapper (0x0x7f784ed514e0)
+
+Class QSignalTransition::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSignalTransition::QPrivateSignal (0x0x7f784ed89540) 0 empty
+
+Vtable for QSignalTransition
+QSignalTransition::_ZTV17QSignalTransition: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QSignalTransition)
+16 (int (*)(...))QSignalTransition::metaObject
+24 (int (*)(...))QSignalTransition::qt_metacast
+32 (int (*)(...))QSignalTransition::qt_metacall
+40 (int (*)(...))QSignalTransition::~QSignalTransition
+48 (int (*)(...))QSignalTransition::~QSignalTransition
+56 (int (*)(...))QSignalTransition::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QSignalTransition::eventTest
+120 (int (*)(...))QSignalTransition::onTransition
+
+Class QSignalTransition
+ size=16 align=8
+ base size=16 base align=8
+QSignalTransition (0x0x7f784ed51548) 0
+ vptr=((& QSignalTransition::_ZTV17QSignalTransition) + 16)
+ QAbstractTransition (0x0x7f784ed515b0) 0
+ primary-for QSignalTransition (0x0x7f784ed51548)
+ QObject (0x0x7f784ed894e0) 0
+ primary-for QAbstractTransition (0x0x7f784ed515b0)
+
+Class QSocketNotifier::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSocketNotifier::QPrivateSignal (0x0x7f784ed897e0) 0 empty
+
+Vtable for QSocketNotifier
+QSocketNotifier::_ZTV15QSocketNotifier: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QSocketNotifier)
+16 (int (*)(...))QSocketNotifier::metaObject
+24 (int (*)(...))QSocketNotifier::qt_metacast
+32 (int (*)(...))QSocketNotifier::qt_metacall
+40 (int (*)(...))QSocketNotifier::~QSocketNotifier
+48 (int (*)(...))QSocketNotifier::~QSocketNotifier
+56 (int (*)(...))QSocketNotifier::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QSocketNotifier
+ size=16 align=8
+ base size=16 base align=8
+QSocketNotifier (0x0x7f784ed51618) 0
+ vptr=((& QSocketNotifier::_ZTV15QSocketNotifier) + 16)
+ QObject (0x0x7f784ed89780) 0
+ primary-for QSocketNotifier (0x0x7f784ed51618)
+
+Class QSocketDescriptor
+ size=4 align=4
+ base size=4 base align=4
+QSocketDescriptor (0x0x7f784ed899c0) 0
+
+Class QSortFilterProxyModel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSortFilterProxyModel::QPrivateSignal (0x0x7f784e9db600) 0 empty
+
+Vtable for QSortFilterProxyModel
+QSortFilterProxyModel::_ZTV21QSortFilterProxyModel: 56 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI21QSortFilterProxyModel)
+16 (int (*)(...))QSortFilterProxyModel::metaObject
+24 (int (*)(...))QSortFilterProxyModel::qt_metacast
+32 (int (*)(...))QSortFilterProxyModel::qt_metacall
+40 (int (*)(...))QSortFilterProxyModel::~QSortFilterProxyModel
+48 (int (*)(...))QSortFilterProxyModel::~QSortFilterProxyModel
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QSortFilterProxyModel::index
+120 (int (*)(...))QSortFilterProxyModel::parent
+128 (int (*)(...))QSortFilterProxyModel::sibling
+136 (int (*)(...))QSortFilterProxyModel::rowCount
+144 (int (*)(...))QSortFilterProxyModel::columnCount
+152 (int (*)(...))QSortFilterProxyModel::hasChildren
+160 (int (*)(...))QSortFilterProxyModel::data
+168 (int (*)(...))QSortFilterProxyModel::setData
+176 (int (*)(...))QSortFilterProxyModel::headerData
+184 (int (*)(...))QSortFilterProxyModel::setHeaderData
+192 (int (*)(...))QAbstractProxyModel::itemData
+200 (int (*)(...))QAbstractProxyModel::setItemData
+208 (int (*)(...))QSortFilterProxyModel::mimeTypes
+216 (int (*)(...))QSortFilterProxyModel::mimeData
+224 (int (*)(...))QAbstractProxyModel::canDropMimeData
+232 (int (*)(...))QSortFilterProxyModel::dropMimeData
+240 (int (*)(...))QSortFilterProxyModel::supportedDropActions
+248 (int (*)(...))QAbstractProxyModel::supportedDragActions
+256 (int (*)(...))QSortFilterProxyModel::insertRows
+264 (int (*)(...))QSortFilterProxyModel::insertColumns
+272 (int (*)(...))QSortFilterProxyModel::removeRows
+280 (int (*)(...))QSortFilterProxyModel::removeColumns
+288 (int (*)(...))QAbstractItemModel::moveRows
+296 (int (*)(...))QAbstractItemModel::moveColumns
+304 (int (*)(...))QSortFilterProxyModel::fetchMore
+312 (int (*)(...))QSortFilterProxyModel::canFetchMore
+320 (int (*)(...))QSortFilterProxyModel::flags
+328 (int (*)(...))QSortFilterProxyModel::sort
+336 (int (*)(...))QSortFilterProxyModel::buddy
+344 (int (*)(...))QSortFilterProxyModel::match
+352 (int (*)(...))QSortFilterProxyModel::span
+360 (int (*)(...))QAbstractItemModel::roleNames
+368 (int (*)(...))QAbstractProxyModel::submit
+376 (int (*)(...))QAbstractProxyModel::revert
+384 (int (*)(...))QSortFilterProxyModel::setSourceModel
+392 (int (*)(...))QSortFilterProxyModel::mapToSource
+400 (int (*)(...))QSortFilterProxyModel::mapFromSource
+408 (int (*)(...))QSortFilterProxyModel::mapSelectionToSource
+416 (int (*)(...))QSortFilterProxyModel::mapSelectionFromSource
+424 (int (*)(...))QSortFilterProxyModel::filterAcceptsRow
+432 (int (*)(...))QSortFilterProxyModel::filterAcceptsColumn
+440 (int (*)(...))QSortFilterProxyModel::lessThan
+
+Class QSortFilterProxyModel
+ size=16 align=8
+ base size=16 base align=8
+QSortFilterProxyModel (0x0x7f784ed51b60) 0
+ vptr=((& QSortFilterProxyModel::_ZTV21QSortFilterProxyModel) + 16)
+ QAbstractProxyModel (0x0x7f784ed51bc8) 0
+ primary-for QSortFilterProxyModel (0x0x7f784ed51b60)
+ QAbstractItemModel (0x0x7f784ed51c30) 0
+ primary-for QAbstractProxyModel (0x0x7f784ed51bc8)
+ QObject (0x0x7f784e9db5a0) 0
+ primary-for QAbstractItemModel (0x0x7f784ed51c30)
+
+Class QStandardPaths
+ size=1 align=1
+ base size=0 base align=1
+QStandardPaths (0x0x7f784e9dba20) 0 empty
+
+Class QState::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QState::QPrivateSignal (0x0x7f784ea48360) 0 empty
+
+Vtable for QState
+QState::_ZTV6QState: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI6QState)
+16 (int (*)(...))QState::metaObject
+24 (int (*)(...))QState::qt_metacast
+32 (int (*)(...))QState::qt_metacall
+40 (int (*)(...))QState::~QState
+48 (int (*)(...))QState::~QState
+56 (int (*)(...))QState::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QState::onEntry
+120 (int (*)(...))QState::onExit
+
+Class QState
+ size=16 align=8
+ base size=16 base align=8
+QState (0x0x7f784ed51dd0) 0
+ vptr=((& QState::_ZTV6QState) + 16)
+ QAbstractState (0x0x7f784ed51e38) 0
+ primary-for QState (0x0x7f784ed51dd0)
+ QObject (0x0x7f784ea48300) 0
+ primary-for QAbstractState (0x0x7f784ed51e38)
+
+Class QStateMachine::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QStateMachine::QPrivateSignal (0x0x7f784ea487e0) 0 empty
+
+Vtable for QStateMachine::SignalEvent
+QStateMachine::SignalEvent::_ZTVN13QStateMachine11SignalEventE: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTIN13QStateMachine11SignalEventE)
+16 (int (*)(...))QStateMachine::SignalEvent::~SignalEvent
+24 (int (*)(...))QStateMachine::SignalEvent::~SignalEvent
+
+Class QStateMachine::SignalEvent
+ size=48 align=8
+ base size=48 base align=8
+QStateMachine::SignalEvent (0x0x7f784ea6c000) 0
+ vptr=((& QStateMachine::SignalEvent::_ZTVN13QStateMachine11SignalEventE) + 16)
+ QEvent (0x0x7f784ea48840) 0
+ primary-for QStateMachine::SignalEvent (0x0x7f784ea6c000)
+
+Vtable for QStateMachine::WrappedEvent
+QStateMachine::WrappedEvent::_ZTVN13QStateMachine12WrappedEventE: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTIN13QStateMachine12WrappedEventE)
+16 (int (*)(...))QStateMachine::WrappedEvent::~WrappedEvent
+24 (int (*)(...))QStateMachine::WrappedEvent::~WrappedEvent
+
+Class QStateMachine::WrappedEvent
+ size=40 align=8
+ base size=40 base align=8
+QStateMachine::WrappedEvent (0x0x7f784ea6c068) 0
+ vptr=((& QStateMachine::WrappedEvent::_ZTVN13QStateMachine12WrappedEventE) + 16)
+ QEvent (0x0x7f784ea488a0) 0
+ primary-for QStateMachine::WrappedEvent (0x0x7f784ea6c068)
+
+Vtable for QStateMachine
+QStateMachine::_ZTV13QStateMachine: 20 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QStateMachine)
+16 (int (*)(...))QStateMachine::metaObject
+24 (int (*)(...))QStateMachine::qt_metacast
+32 (int (*)(...))QStateMachine::qt_metacall
+40 (int (*)(...))QStateMachine::~QStateMachine
+48 (int (*)(...))QStateMachine::~QStateMachine
+56 (int (*)(...))QStateMachine::event
+64 (int (*)(...))QStateMachine::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QStateMachine::onEntry
+120 (int (*)(...))QStateMachine::onExit
+128 (int (*)(...))QStateMachine::beginSelectTransitions
+136 (int (*)(...))QStateMachine::endSelectTransitions
+144 (int (*)(...))QStateMachine::beginMicrostep
+152 (int (*)(...))QStateMachine::endMicrostep
+
+Class QStateMachine
+ size=16 align=8
+ base size=16 base align=8
+QStateMachine (0x0x7f784ed51ea0) 0
+ vptr=((& QStateMachine::_ZTV13QStateMachine) + 16)
+ QState (0x0x7f784ed51f08) 0
+ primary-for QStateMachine (0x0x7f784ed51ea0)
+ QAbstractState (0x0x7f784ed51f70) 0
+ primary-for QState (0x0x7f784ed51f08)
+ QObject (0x0x7f784ea48780) 0
+ primary-for QAbstractState (0x0x7f784ed51f70)
+
+Class QStorageInfo
+ size=8 align=8
+ base size=8 base align=8
+QStorageInfo (0x0x7f784ea48cc0) 0
+
+Class QAbstractConcatenable
+ size=1 align=1
+ base size=0 base align=1
+QAbstractConcatenable (0x0x7f784eb6fa80) 0 empty
+
+Class QStringListModel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QStringListModel::QPrivateSignal (0x0x7f784e7f6de0) 0 empty
+
+Vtable for QStringListModel
+QStringListModel::_ZTV16QStringListModel: 48 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QStringListModel)
+16 (int (*)(...))QStringListModel::metaObject
+24 (int (*)(...))QStringListModel::qt_metacast
+32 (int (*)(...))QStringListModel::qt_metacall
+40 (int (*)(...))QStringListModel::~QStringListModel
+48 (int (*)(...))QStringListModel::~QStringListModel
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QAbstractListModel::index
+120 (int (*)(...))QAbstractListModel::parent
+128 (int (*)(...))QStringListModel::sibling
+136 (int (*)(...))QStringListModel::rowCount
+144 (int (*)(...))QAbstractListModel::columnCount
+152 (int (*)(...))QAbstractListModel::hasChildren
+160 (int (*)(...))QStringListModel::data
+168 (int (*)(...))QStringListModel::setData
+176 (int (*)(...))QAbstractItemModel::headerData
+184 (int (*)(...))QAbstractItemModel::setHeaderData
+192 (int (*)(...))QStringListModel::itemData
+200 (int (*)(...))QStringListModel::setItemData
+208 (int (*)(...))QAbstractItemModel::mimeTypes
+216 (int (*)(...))QAbstractItemModel::mimeData
+224 (int (*)(...))QAbstractItemModel::canDropMimeData
+232 (int (*)(...))QAbstractListModel::dropMimeData
+240 (int (*)(...))QStringListModel::supportedDropActions
+248 (int (*)(...))QAbstractItemModel::supportedDragActions
+256 (int (*)(...))QStringListModel::insertRows
+264 (int (*)(...))QAbstractItemModel::insertColumns
+272 (int (*)(...))QStringListModel::removeRows
+280 (int (*)(...))QAbstractItemModel::removeColumns
+288 (int (*)(...))QStringListModel::moveRows
+296 (int (*)(...))QAbstractItemModel::moveColumns
+304 (int (*)(...))QAbstractItemModel::fetchMore
+312 (int (*)(...))QAbstractItemModel::canFetchMore
+320 (int (*)(...))QStringListModel::flags
+328 (int (*)(...))QStringListModel::sort
+336 (int (*)(...))QAbstractItemModel::buddy
+344 (int (*)(...))QAbstractItemModel::match
+352 (int (*)(...))QAbstractItemModel::span
+360 (int (*)(...))QAbstractItemModel::roleNames
+368 (int (*)(...))QAbstractItemModel::submit
+376 (int (*)(...))QAbstractItemModel::revert
+
+Class QStringListModel
+ size=24 align=8
+ base size=24 base align=8
+QStringListModel (0x0x7f784e7f2958) 0
+ vptr=((& QStringListModel::_ZTV16QStringListModel) + 16)
+ QAbstractListModel (0x0x7f784e7f29c0) 0
+ primary-for QStringListModel (0x0x7f784e7f2958)
+ QAbstractItemModel (0x0x7f784e7f2a28) 0
+ primary-for QAbstractListModel (0x0x7f784e7f29c0)
+ QObject (0x0x7f784e7f6d80) 0
+ primary-for QAbstractItemModel (0x0x7f784e7f2a28)
+
+Class QSystemSemaphore
+ size=8 align=8
+ base size=8 base align=8
+QSystemSemaphore (0x0x7f784e7f6f00) 0
+
+Class QTemporaryDir
+ size=8 align=8
+ base size=8 base align=8
+QTemporaryDir (0x0x7f784e83b000) 0
+
+Class QTemporaryFile::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTemporaryFile::QPrivateSignal (0x0x7f784e83b120) 0 empty
+
+Vtable for QTemporaryFile
+QTemporaryFile::_ZTV14QTemporaryFile: 34 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QTemporaryFile)
+16 (int (*)(...))QTemporaryFile::metaObject
+24 (int (*)(...))QTemporaryFile::qt_metacast
+32 (int (*)(...))QTemporaryFile::qt_metacall
+40 (int (*)(...))QTemporaryFile::~QTemporaryFile
+48 (int (*)(...))QTemporaryFile::~QTemporaryFile
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QFileDevice::isSequential
+120 (int (*)(...))QTemporaryFile::open
+128 (int (*)(...))QFileDevice::close
+136 (int (*)(...))QFileDevice::pos
+144 (int (*)(...))QFile::size
+152 (int (*)(...))QFileDevice::seek
+160 (int (*)(...))QFileDevice::atEnd
+168 (int (*)(...))QIODevice::reset
+176 (int (*)(...))QIODevice::bytesAvailable
+184 (int (*)(...))QIODevice::bytesToWrite
+192 (int (*)(...))QIODevice::canReadLine
+200 (int (*)(...))QIODevice::waitForReadyRead
+208 (int (*)(...))QIODevice::waitForBytesWritten
+216 (int (*)(...))QFileDevice::readData
+224 (int (*)(...))QFileDevice::readLineData
+232 (int (*)(...))QFileDevice::writeData
+240 (int (*)(...))QTemporaryFile::fileName
+248 (int (*)(...))QFile::resize
+256 (int (*)(...))QFile::permissions
+264 (int (*)(...))QFile::setPermissions
+
+Class QTemporaryFile
+ size=16 align=8
+ base size=16 base align=8
+QTemporaryFile (0x0x7f784e7f2a90) 0
+ vptr=((& QTemporaryFile::_ZTV14QTemporaryFile) + 16)
+ QFile (0x0x7f784e7f2af8) 0
+ primary-for QTemporaryFile (0x0x7f784e7f2a90)
+ QFileDevice (0x0x7f784e7f2b60) 0
+ primary-for QFile (0x0x7f784e7f2af8)
+ QIODevice (0x0x7f784e7f2bc8) 0
+ primary-for QFileDevice (0x0x7f784e7f2b60)
+ QObject (0x0x7f784e83b0c0) 0
+ primary-for QIODevice (0x0x7f784e7f2bc8)
+
+Class QTextBoundaryFinder
+ size=48 align=8
+ base size=48 base align=8
+QTextBoundaryFinder (0x0x7f784e83b480) 0
+
+Class QTextCodec::ConverterState
+ size=32 align=8
+ base size=32 base align=8
+QTextCodec::ConverterState (0x0x7f784e83bcc0) 0
+
+Vtable for QTextCodec
+QTextCodec::_ZTV10QTextCodec: 9 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QTextCodec)
+16 (int (*)(...))__cxa_pure_virtual
+24 (int (*)(...))QTextCodec::aliases
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+56 0
+64 0
+
+Class QTextCodec
+ size=8 align=8
+ base size=8 base align=8
+QTextCodec (0x0x7f784e83bc60) 0 nearly-empty
+ vptr=((& QTextCodec::_ZTV10QTextCodec) + 16)
+
+Class QTextEncoder
+ size=40 align=8
+ base size=40 base align=8
+QTextEncoder (0x0x7f784e8b56c0) 0
+
+Class QTextDecoder
+ size=40 align=8
+ base size=40 base align=8
+QTextDecoder (0x0x7f784e8b58a0) 0
+
+Vtable for std::thread::_State
+std::thread::_State::_ZTVNSt6thread6_StateE: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTINSt6thread6_StateE)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+
+Class std::thread::_State
+ size=8 align=8
+ base size=8 base align=8
+std::thread::_State (0x0x7f784e8b5ae0) 0 nearly-empty
+ vptr=((& std::thread::_State::_ZTVNSt6thread6_StateE) + 16)
+
+Class std::thread::id
+ size=8 align=8
+ base size=8 base align=8
+std::thread::id (0x0x7f784e8b5b40) 0
+
+Class std::thread
+ size=8 align=8
+ base size=8 base align=8
+std::thread (0x0x7f784e8b5a80) 0
+
+Class std::condition_variable
+ size=48 align=8
+ base size=48 base align=8
+std::condition_variable (0x0x7f784e755f00) 0
+
+Class std::__at_thread_exit_elt
+ size=16 align=8
+ base size=16 base align=8
+std::__at_thread_exit_elt (0x0x7f784e78e300) 0
+
+Class std::_V2::condition_variable_any
+ size=64 align=8
+ base size=64 base align=8
+std::_V2::condition_variable_any (0x0x7f784e78e360) 0
+
+Class std::__atomic_futex_unsigned_base
+ size=1 align=1
+ base size=0 base align=1
+std::__atomic_futex_unsigned_base (0x0x7f784e506660) 0 empty
+
+Vtable for std::future_error
+std::future_error::_ZTVSt12future_error: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt12future_error)
+16 (int (*)(...))std::future_error::~future_error
+24 (int (*)(...))std::future_error::~future_error
+32 (int (*)(...))std::future_error::what
+
+Class std::future_error
+ size=32 align=8
+ base size=32 base align=8
+std::future_error (0x0x7f784e4f8f70) 0
+ vptr=((& std::future_error::_ZTVSt12future_error) + 16)
+ std::logic_error (0x0x7f784e530000) 0
+ primary-for std::future_error (0x0x7f784e4f8f70)
+ std::exception (0x0x7f784e506d80) 0 nearly-empty
+ primary-for std::logic_error (0x0x7f784e530000)
+
+Class std::__future_base::_Result_base::_Deleter
+ size=1 align=1
+ base size=0 base align=1
+std::__future_base::_Result_base::_Deleter (0x0x7f784e5394e0) 0 empty
+
+Vtable for std::__future_base::_Result_base
+std::__future_base::_Result_base::_ZTVNSt13__future_base12_Result_baseE: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTINSt13__future_base12_Result_baseE)
+16 (int (*)(...))__cxa_pure_virtual
+24 0
+32 0
+
+Class std::__future_base::_Result_base
+ size=16 align=8
+ base size=16 base align=8
+std::__future_base::_Result_base (0x0x7f784e539480) 0
+ vptr=((& std::__future_base::_Result_base::_ZTVNSt13__future_base12_Result_baseE) + 16)
+
+Class std::__future_base::_State_baseV2::__exception_ptr_tag
+ size=1 align=1
+ base size=0 base align=1
+std::__future_base::_State_baseV2::__exception_ptr_tag (0x0x7f784e300c00) 0 empty
+
+Class std::__future_base::_State_baseV2::_Make_ready
+ size=32 align=8
+ base size=32 base align=8
+std::__future_base::_State_baseV2::_Make_ready (0x0x7f784e31e820) 0
+ std::__at_thread_exit_elt (0x0x7f784e300cc0) 0
+
+Vtable for std::__future_base::_State_baseV2
+std::__future_base::_State_baseV2::_ZTVNSt13__future_base13_State_baseV2E: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTINSt13__future_base13_State_baseV2E)
+16 (int (*)(...))std::__future_base::_State_baseV2::~_State_baseV2
+24 (int (*)(...))std::__future_base::_State_baseV2::~_State_baseV2
+32 (int (*)(...))std::__future_base::_State_baseV2::_M_complete_async
+40 (int (*)(...))std::__future_base::_State_baseV2::_M_is_deferred_future
+
+Class std::__future_base::_State_baseV2
+ size=32 align=8
+ base size=28 base align=8
+std::__future_base::_State_baseV2 (0x0x7f784e539660) 0
+ vptr=((& std::__future_base::_State_baseV2::_ZTVNSt13__future_base13_State_baseV2E) + 16)
+
+Class std::__future_base
+ size=1 align=1
+ base size=0 base align=1
+std::__future_base (0x0x7f784e539420) 0 empty
+
+Vtable for std::__future_base::_Async_state_commonV2
+std::__future_base::_Async_state_commonV2::_ZTVNSt13__future_base21_Async_state_commonV2E: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTINSt13__future_base21_Async_state_commonV2E)
+16 (int (*)(...))std::__future_base::_Async_state_commonV2::~_Async_state_commonV2
+24 (int (*)(...))std::__future_base::_Async_state_commonV2::~_Async_state_commonV2
+32 (int (*)(...))std::__future_base::_Async_state_commonV2::_M_complete_async
+40 (int (*)(...))std::__future_base::_State_baseV2::_M_is_deferred_future
+
+Class std::__future_base::_Async_state_commonV2
+ size=48 align=8
+ base size=44 base align=8
+std::__future_base::_Async_state_commonV2 (0x0x7f784da75af8) 0
+ vptr=((& std::__future_base::_Async_state_commonV2::_ZTVNSt13__future_base21_Async_state_commonV2E) + 16)
+ std::__future_base::_State_baseV2 (0x0x7f784daad8a0) 0
+ primary-for std::__future_base::_Async_state_commonV2 (0x0x7f784da75af8)
+
+Class QThread::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QThread::QPrivateSignal (0x0x7f784dae2180) 0 empty
+
+Vtable for QThread
+QThread::_ZTV7QThread: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI7QThread)
+16 (int (*)(...))QThread::metaObject
+24 (int (*)(...))QThread::qt_metacast
+32 (int (*)(...))QThread::qt_metacall
+40 (int (*)(...))QThread::~QThread
+48 (int (*)(...))QThread::~QThread
+56 (int (*)(...))QThread::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QThread::run
+
+Class QThread
+ size=16 align=8
+ base size=16 base align=8
+QThread (0x0x7f784da75e38) 0
+ vptr=((& QThread::_ZTV7QThread) + 16)
+ QObject (0x0x7f784dae2120) 0
+ primary-for QThread (0x0x7f784da75e38)
+
+Class QThreadPool::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QThreadPool::QPrivateSignal (0x0x7f784dae2540) 0 empty
+
+Vtable for QThreadPool
+QThreadPool::_ZTV11QThreadPool: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QThreadPool)
+16 (int (*)(...))QThreadPool::metaObject
+24 (int (*)(...))QThreadPool::qt_metacast
+32 (int (*)(...))QThreadPool::qt_metacall
+40 (int (*)(...))QThreadPool::~QThreadPool
+48 (int (*)(...))QThreadPool::~QThreadPool
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QThreadPool
+ size=16 align=8
+ base size=16 base align=8
+QThreadPool (0x0x7f784da75ea0) 0
+ vptr=((& QThreadPool::_ZTV11QThreadPool) + 16)
+ QObject (0x0x7f784dae24e0) 0
+ primary-for QThreadPool (0x0x7f784da75ea0)
+
+Class QThreadStorageData
+ size=4 align=4
+ base size=4 base align=4
+QThreadStorageData (0x0x7f784dae2720) 0
+
+Class QTimeLine::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTimeLine::QPrivateSignal (0x0x7f784dae2de0) 0 empty
+
+Vtable for QTimeLine
+QTimeLine::_ZTV9QTimeLine: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QTimeLine)
+16 (int (*)(...))QTimeLine::metaObject
+24 (int (*)(...))QTimeLine::qt_metacast
+32 (int (*)(...))QTimeLine::qt_metacall
+40 (int (*)(...))QTimeLine::~QTimeLine
+48 (int (*)(...))QTimeLine::~QTimeLine
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QTimeLine::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QTimeLine::valueForTime
+
+Class QTimeLine
+ size=16 align=8
+ base size=16 base align=8
+QTimeLine (0x0x7f784da75f08) 0
+ vptr=((& QTimeLine::_ZTV9QTimeLine) + 16)
+ QObject (0x0x7f784dae2d80) 0
+ primary-for QTimeLine (0x0x7f784da75f08)
+
+Class QTimer::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTimer::QPrivateSignal (0x0x7f784db31060) 0 empty
+
+Vtable for QTimer
+QTimer::_ZTV6QTimer: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI6QTimer)
+16 (int (*)(...))QTimer::metaObject
+24 (int (*)(...))QTimer::qt_metacast
+32 (int (*)(...))QTimer::qt_metacall
+40 (int (*)(...))QTimer::~QTimer
+48 (int (*)(...))QTimer::~QTimer
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QTimer::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QTimer
+ size=32 align=8
+ base size=29 base align=8
+QTimer (0x0x7f784da75f70) 0
+ vptr=((& QTimer::_ZTV6QTimer) + 16)
+ QObject (0x0x7f784db31000) 0
+ primary-for QTimer (0x0x7f784da75f70)
+
+Class QTimeZone::OffsetData
+ size=32 align=8
+ base size=28 base align=8
+QTimeZone::OffsetData (0x0x7f784db6b9c0) 0
+
+Class QTimeZone
+ size=8 align=8
+ base size=8 base align=8
+QTimeZone (0x0x7f784db6b960) 0
+
+Class QTranslator::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTranslator::QPrivateSignal (0x0x7f784d80ba80) 0 empty
+
+Vtable for QTranslator
+QTranslator::_ZTV11QTranslator: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QTranslator)
+16 (int (*)(...))QTranslator::metaObject
+24 (int (*)(...))QTranslator::qt_metacast
+32 (int (*)(...))QTranslator::qt_metacall
+40 (int (*)(...))QTranslator::~QTranslator
+48 (int (*)(...))QTranslator::~QTranslator
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QTranslator::translate
+120 (int (*)(...))QTranslator::isEmpty
+
+Class QTranslator
+ size=16 align=8
+ base size=16 base align=8
+QTranslator (0x0x7f784d815680) 0
+ vptr=((& QTranslator::_ZTV11QTranslator) + 16)
+ QObject (0x0x7f784d80ba20) 0
+ primary-for QTranslator (0x0x7f784d815680)
+
+Class QTransposeProxyModel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTransposeProxyModel::QPrivateSignal (0x0x7f784d80bcc0) 0 empty
+
+Vtable for QTransposeProxyModel
+QTransposeProxyModel::_ZTV20QTransposeProxyModel: 53 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QTransposeProxyModel)
+16 (int (*)(...))QTransposeProxyModel::metaObject
+24 (int (*)(...))QTransposeProxyModel::qt_metacast
+32 (int (*)(...))QTransposeProxyModel::qt_metacall
+40 (int (*)(...))QTransposeProxyModel::~QTransposeProxyModel
+48 (int (*)(...))QTransposeProxyModel::~QTransposeProxyModel
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QTransposeProxyModel::index
+120 (int (*)(...))QTransposeProxyModel::parent
+128 (int (*)(...))QAbstractProxyModel::sibling
+136 (int (*)(...))QTransposeProxyModel::rowCount
+144 (int (*)(...))QTransposeProxyModel::columnCount
+152 (int (*)(...))QAbstractProxyModel::hasChildren
+160 (int (*)(...))QAbstractProxyModel::data
+168 (int (*)(...))QAbstractProxyModel::setData
+176 (int (*)(...))QTransposeProxyModel::headerData
+184 (int (*)(...))QTransposeProxyModel::setHeaderData
+192 (int (*)(...))QTransposeProxyModel::itemData
+200 (int (*)(...))QTransposeProxyModel::setItemData
+208 (int (*)(...))QAbstractProxyModel::mimeTypes
+216 (int (*)(...))QAbstractProxyModel::mimeData
+224 (int (*)(...))QAbstractProxyModel::canDropMimeData
+232 (int (*)(...))QAbstractProxyModel::dropMimeData
+240 (int (*)(...))QAbstractProxyModel::supportedDropActions
+248 (int (*)(...))QAbstractProxyModel::supportedDragActions
+256 (int (*)(...))QTransposeProxyModel::insertRows
+264 (int (*)(...))QTransposeProxyModel::insertColumns
+272 (int (*)(...))QTransposeProxyModel::removeRows
+280 (int (*)(...))QTransposeProxyModel::removeColumns
+288 (int (*)(...))QTransposeProxyModel::moveRows
+296 (int (*)(...))QTransposeProxyModel::moveColumns
+304 (int (*)(...))QAbstractProxyModel::fetchMore
+312 (int (*)(...))QAbstractProxyModel::canFetchMore
+320 (int (*)(...))QAbstractProxyModel::flags
+328 (int (*)(...))QTransposeProxyModel::sort
+336 (int (*)(...))QAbstractProxyModel::buddy
+344 (int (*)(...))QAbstractItemModel::match
+352 (int (*)(...))QTransposeProxyModel::span
+360 (int (*)(...))QAbstractItemModel::roleNames
+368 (int (*)(...))QAbstractProxyModel::submit
+376 (int (*)(...))QAbstractProxyModel::revert
+384 (int (*)(...))QTransposeProxyModel::setSourceModel
+392 (int (*)(...))QTransposeProxyModel::mapToSource
+400 (int (*)(...))QTransposeProxyModel::mapFromSource
+408 (int (*)(...))QAbstractProxyModel::mapSelectionToSource
+416 (int (*)(...))QAbstractProxyModel::mapSelectionFromSource
+
+Class QTransposeProxyModel
+ size=16 align=8
+ base size=16 base align=8
+QTransposeProxyModel (0x0x7f784d8156e8) 0
+ vptr=((& QTransposeProxyModel::_ZTV20QTransposeProxyModel) + 16)
+ QAbstractProxyModel (0x0x7f784d815750) 0
+ primary-for QTransposeProxyModel (0x0x7f784d8156e8)
+ QAbstractItemModel (0x0x7f784d8157b8) 0
+ primary-for QAbstractProxyModel (0x0x7f784d815750)
+ QObject (0x0x7f784d80bc60) 0
+ primary-for QAbstractItemModel (0x0x7f784d8157b8)
+
+Class QUrlQuery
+ size=8 align=8
+ base size=8 base align=8
+QUrlQuery (0x0x7f784d80bea0) 0
+
+Class QWaitCondition
+ size=8 align=8
+ base size=8 base align=8
+QWaitCondition (0x0x7f784d9283c0) 0
+
+Class QXmlStreamStringRef
+ size=16 align=8
+ base size=16 base align=8
+QXmlStreamStringRef (0x0x7f784d9284e0) 0
+
+Class QXmlStreamAttribute
+ size=80 align=8
+ base size=73 base align=8
+QXmlStreamAttribute (0x0x7f784d9bb8a0) 0
+
+Class QXmlStreamAttributes
+ size=8 align=8
+ base size=8 base align=8
+QXmlStreamAttributes (0x0x7f784d626a90) 0
+ QVector<QXmlStreamAttribute> (0x0x7f784d663000) 0
+
+Class QXmlStreamNamespaceDeclaration
+ size=40 align=8
+ base size=40 base align=8
+QXmlStreamNamespaceDeclaration (0x0x7f784d663300) 0
+
+Class QXmlStreamNotationDeclaration
+ size=56 align=8
+ base size=56 base align=8
+QXmlStreamNotationDeclaration (0x0x7f784d6c02a0) 0
+
+Class QXmlStreamEntityDeclaration
+ size=88 align=8
+ base size=88 base align=8
+QXmlStreamEntityDeclaration (0x0x7f784d71b2a0) 0
+
+Vtable for QXmlStreamEntityResolver
+QXmlStreamEntityResolver::_ZTV24QXmlStreamEntityResolver: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI24QXmlStreamEntityResolver)
+16 (int (*)(...))QXmlStreamEntityResolver::~QXmlStreamEntityResolver
+24 (int (*)(...))QXmlStreamEntityResolver::~QXmlStreamEntityResolver
+32 (int (*)(...))QXmlStreamEntityResolver::resolveEntity
+40 (int (*)(...))QXmlStreamEntityResolver::resolveUndeclaredEntity
+
+Class QXmlStreamEntityResolver
+ size=8 align=8
+ base size=8 base align=8
+QXmlStreamEntityResolver (0x0x7f784d787360) 0 nearly-empty
+ vptr=((& QXmlStreamEntityResolver::_ZTV24QXmlStreamEntityResolver) + 16)
+
+Class QXmlStreamReader
+ size=8 align=8
+ base size=8 base align=8
+QXmlStreamReader (0x0x7f784d7873c0) 0
+
+Class QXmlStreamWriter
+ size=8 align=8
+ base size=8 base align=8
+QXmlStreamWriter (0x0x7f784d3e52a0) 0
+
+Class QRgba64
+ size=8 align=8
+ base size=8 base align=8
+QRgba64 (0x0x7f784d3e58a0) 0
+
+Class QColor::CT
+ size=10 align=2
+ base size=10 base align=2
+QColor::CT (0x0x7f784d499960) 0
+
+Class QColor
+ size=16 align=4
+ base size=14 base align=4
+QColor (0x0x7f784d499900) 0
+
+Class QRegion::QRegionData
+ size=16 align=8
+ base size=16 base align=8
+QRegion::QRegionData (0x0x7f784d55c840) 0
+
+Class QRegion
+ size=8 align=8
+ base size=8 base align=8
+QRegion (0x0x7f784d55c7e0) 0
+
+Class QKeySequence
+ size=8 align=8
+ base size=8 base align=8
+QKeySequence (0x0x7f784d2e4480) 0
+
+Class QVector2D
+ size=8 align=4
+ base size=8 base align=4
+QVector2D (0x0x7f784d3d2000) 0
+
+Class QTouchDevice
+ size=8 align=8
+ base size=8 base align=8
+QTouchDevice (0x0x7f784d04a0c0) 0
+
+Vtable for QInputEvent
+QInputEvent::_ZTV11QInputEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QInputEvent)
+16 (int (*)(...))QInputEvent::~QInputEvent
+24 (int (*)(...))QInputEvent::~QInputEvent
+
+Class QInputEvent
+ size=32 align=8
+ base size=32 base align=8
+QInputEvent (0x0x7f784d0201a0) 0
+ vptr=((& QInputEvent::_ZTV11QInputEvent) + 16)
+ QEvent (0x0x7f784d04a960) 0
+ primary-for QInputEvent (0x0x7f784d0201a0)
+
+Vtable for QEnterEvent
+QEnterEvent::_ZTV11QEnterEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QEnterEvent)
+16 (int (*)(...))QEnterEvent::~QEnterEvent
+24 (int (*)(...))QEnterEvent::~QEnterEvent
+
+Class QEnterEvent
+ size=72 align=8
+ base size=72 base align=8
+QEnterEvent (0x0x7f784d020208) 0
+ vptr=((& QEnterEvent::_ZTV11QEnterEvent) + 16)
+ QEvent (0x0x7f784d04ab40) 0
+ primary-for QEnterEvent (0x0x7f784d020208)
+
+Vtable for QMouseEvent
+QMouseEvent::_ZTV11QMouseEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QMouseEvent)
+16 (int (*)(...))QMouseEvent::~QMouseEvent
+24 (int (*)(...))QMouseEvent::~QMouseEvent
+
+Class QMouseEvent
+ size=104 align=8
+ base size=100 base align=8
+QMouseEvent (0x0x7f784d020270) 0
+ vptr=((& QMouseEvent::_ZTV11QMouseEvent) + 16)
+ QInputEvent (0x0x7f784d0202d8) 0
+ primary-for QMouseEvent (0x0x7f784d020270)
+ QEvent (0x0x7f784d04af00) 0
+ primary-for QInputEvent (0x0x7f784d0202d8)
+
+Vtable for QHoverEvent
+QHoverEvent::_ZTV11QHoverEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QHoverEvent)
+16 (int (*)(...))QHoverEvent::~QHoverEvent
+24 (int (*)(...))QHoverEvent::~QHoverEvent
+
+Class QHoverEvent
+ size=64 align=8
+ base size=64 base align=8
+QHoverEvent (0x0x7f784d020340) 0
+ vptr=((& QHoverEvent::_ZTV11QHoverEvent) + 16)
+ QInputEvent (0x0x7f784d0203a8) 0
+ primary-for QHoverEvent (0x0x7f784d020340)
+ QEvent (0x0x7f784d0a3420) 0
+ primary-for QInputEvent (0x0x7f784d0203a8)
+
+Vtable for QWheelEvent
+QWheelEvent::_ZTV11QWheelEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QWheelEvent)
+16 (int (*)(...))QWheelEvent::~QWheelEvent
+24 (int (*)(...))QWheelEvent::~QWheelEvent
+
+Class QWheelEvent
+ size=96 align=8
+ base size=96 base align=8
+QWheelEvent (0x0x7f784d020410) 0
+ vptr=((& QWheelEvent::_ZTV11QWheelEvent) + 16)
+ QInputEvent (0x0x7f784d020478) 0
+ primary-for QWheelEvent (0x0x7f784d020410)
+ QEvent (0x0x7f784d0a3600) 0
+ primary-for QInputEvent (0x0x7f784d020478)
+
+Vtable for QTabletEvent
+QTabletEvent::_ZTV12QTabletEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QTabletEvent)
+16 (int (*)(...))QTabletEvent::~QTabletEvent
+24 (int (*)(...))QTabletEvent::~QTabletEvent
+
+Class QTabletEvent
+ size=128 align=8
+ base size=128 base align=8
+QTabletEvent (0x0x7f784d0204e0) 0
+ vptr=((& QTabletEvent::_ZTV12QTabletEvent) + 16)
+ QInputEvent (0x0x7f784d020548) 0
+ primary-for QTabletEvent (0x0x7f784d0204e0)
+ QEvent (0x0x7f784d0a3d20) 0
+ primary-for QInputEvent (0x0x7f784d020548)
+
+Vtable for QNativeGestureEvent
+QNativeGestureEvent::_ZTV19QNativeGestureEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QNativeGestureEvent)
+16 (int (*)(...))QNativeGestureEvent::~QNativeGestureEvent
+24 (int (*)(...))QNativeGestureEvent::~QNativeGestureEvent
+
+Class QNativeGestureEvent
+ size=112 align=8
+ base size=112 base align=8
+QNativeGestureEvent (0x0x7f784d0205b0) 0
+ vptr=((& QNativeGestureEvent::_ZTV19QNativeGestureEvent) + 16)
+ QInputEvent (0x0x7f784d020618) 0
+ primary-for QNativeGestureEvent (0x0x7f784d0205b0)
+ QEvent (0x0x7f784d0e76c0) 0
+ primary-for QInputEvent (0x0x7f784d020618)
+
+Vtable for QKeyEvent
+QKeyEvent::_ZTV9QKeyEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QKeyEvent)
+16 (int (*)(...))QKeyEvent::~QKeyEvent
+24 (int (*)(...))QKeyEvent::~QKeyEvent
+
+Class QKeyEvent
+ size=64 align=8
+ base size=59 base align=8
+QKeyEvent (0x0x7f784d020680) 0
+ vptr=((& QKeyEvent::_ZTV9QKeyEvent) + 16)
+ QInputEvent (0x0x7f784d0206e8) 0
+ primary-for QKeyEvent (0x0x7f784d020680)
+ QEvent (0x0x7f784d0e79c0) 0
+ primary-for QInputEvent (0x0x7f784d0206e8)
+
+Vtable for QFocusEvent
+QFocusEvent::_ZTV11QFocusEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QFocusEvent)
+16 (int (*)(...))QFocusEvent::~QFocusEvent
+24 (int (*)(...))QFocusEvent::~QFocusEvent
+
+Class QFocusEvent
+ size=24 align=8
+ base size=24 base align=8
+QFocusEvent (0x0x7f784d020750) 0
+ vptr=((& QFocusEvent::_ZTV11QFocusEvent) + 16)
+ QEvent (0x0x7f784d0e7cc0) 0
+ primary-for QFocusEvent (0x0x7f784d020750)
+
+Vtable for QPaintEvent
+QPaintEvent::_ZTV11QPaintEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QPaintEvent)
+16 (int (*)(...))QPaintEvent::~QPaintEvent
+24 (int (*)(...))QPaintEvent::~QPaintEvent
+
+Class QPaintEvent
+ size=56 align=8
+ base size=49 base align=8
+QPaintEvent (0x0x7f784d0207b8) 0
+ vptr=((& QPaintEvent::_ZTV11QPaintEvent) + 16)
+ QEvent (0x0x7f784d0e7de0) 0
+ primary-for QPaintEvent (0x0x7f784d0207b8)
+
+Vtable for QMoveEvent
+QMoveEvent::_ZTV10QMoveEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QMoveEvent)
+16 (int (*)(...))QMoveEvent::~QMoveEvent
+24 (int (*)(...))QMoveEvent::~QMoveEvent
+
+Class QMoveEvent
+ size=40 align=8
+ base size=36 base align=8
+QMoveEvent (0x0x7f784d020820) 0
+ vptr=((& QMoveEvent::_ZTV10QMoveEvent) + 16)
+ QEvent (0x0x7f784d0e7f00) 0
+ primary-for QMoveEvent (0x0x7f784d020820)
+
+Vtable for QExposeEvent
+QExposeEvent::_ZTV12QExposeEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QExposeEvent)
+16 (int (*)(...))QExposeEvent::~QExposeEvent
+24 (int (*)(...))QExposeEvent::~QExposeEvent
+
+Class QExposeEvent
+ size=32 align=8
+ base size=32 base align=8
+QExposeEvent (0x0x7f784d020888) 0
+ vptr=((& QExposeEvent::_ZTV12QExposeEvent) + 16)
+ QEvent (0x0x7f784d11e060) 0
+ primary-for QExposeEvent (0x0x7f784d020888)
+
+Vtable for QPlatformSurfaceEvent
+QPlatformSurfaceEvent::_ZTV21QPlatformSurfaceEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI21QPlatformSurfaceEvent)
+16 (int (*)(...))QPlatformSurfaceEvent::~QPlatformSurfaceEvent
+24 (int (*)(...))QPlatformSurfaceEvent::~QPlatformSurfaceEvent
+
+Class QPlatformSurfaceEvent
+ size=24 align=8
+ base size=24 base align=8
+QPlatformSurfaceEvent (0x0x7f784d0208f0) 0
+ vptr=((& QPlatformSurfaceEvent::_ZTV21QPlatformSurfaceEvent) + 16)
+ QEvent (0x0x7f784d11e120) 0
+ primary-for QPlatformSurfaceEvent (0x0x7f784d0208f0)
+
+Vtable for QResizeEvent
+QResizeEvent::_ZTV12QResizeEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QResizeEvent)
+16 (int (*)(...))QResizeEvent::~QResizeEvent
+24 (int (*)(...))QResizeEvent::~QResizeEvent
+
+Class QResizeEvent
+ size=40 align=8
+ base size=36 base align=8
+QResizeEvent (0x0x7f784d020958) 0
+ vptr=((& QResizeEvent::_ZTV12QResizeEvent) + 16)
+ QEvent (0x0x7f784d11e1e0) 0
+ primary-for QResizeEvent (0x0x7f784d020958)
+
+Vtable for QCloseEvent
+QCloseEvent::_ZTV11QCloseEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QCloseEvent)
+16 (int (*)(...))QCloseEvent::~QCloseEvent
+24 (int (*)(...))QCloseEvent::~QCloseEvent
+
+Class QCloseEvent
+ size=24 align=8
+ base size=20 base align=8
+QCloseEvent (0x0x7f784d0209c0) 0
+ vptr=((& QCloseEvent::_ZTV11QCloseEvent) + 16)
+ QEvent (0x0x7f784d11e300) 0
+ primary-for QCloseEvent (0x0x7f784d0209c0)
+
+Vtable for QIconDragEvent
+QIconDragEvent::_ZTV14QIconDragEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QIconDragEvent)
+16 (int (*)(...))QIconDragEvent::~QIconDragEvent
+24 (int (*)(...))QIconDragEvent::~QIconDragEvent
+
+Class QIconDragEvent
+ size=24 align=8
+ base size=20 base align=8
+QIconDragEvent (0x0x7f784d020a28) 0
+ vptr=((& QIconDragEvent::_ZTV14QIconDragEvent) + 16)
+ QEvent (0x0x7f784d11e360) 0
+ primary-for QIconDragEvent (0x0x7f784d020a28)
+
+Vtable for QShowEvent
+QShowEvent::_ZTV10QShowEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QShowEvent)
+16 (int (*)(...))QShowEvent::~QShowEvent
+24 (int (*)(...))QShowEvent::~QShowEvent
+
+Class QShowEvent
+ size=24 align=8
+ base size=20 base align=8
+QShowEvent (0x0x7f784d020a90) 0
+ vptr=((& QShowEvent::_ZTV10QShowEvent) + 16)
+ QEvent (0x0x7f784d11e3c0) 0
+ primary-for QShowEvent (0x0x7f784d020a90)
+
+Vtable for QHideEvent
+QHideEvent::_ZTV10QHideEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QHideEvent)
+16 (int (*)(...))QHideEvent::~QHideEvent
+24 (int (*)(...))QHideEvent::~QHideEvent
+
+Class QHideEvent
+ size=24 align=8
+ base size=20 base align=8
+QHideEvent (0x0x7f784d020af8) 0
+ vptr=((& QHideEvent::_ZTV10QHideEvent) + 16)
+ QEvent (0x0x7f784d11e420) 0
+ primary-for QHideEvent (0x0x7f784d020af8)
+
+Vtable for QContextMenuEvent
+QContextMenuEvent::_ZTV17QContextMenuEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QContextMenuEvent)
+16 (int (*)(...))QContextMenuEvent::~QContextMenuEvent
+24 (int (*)(...))QContextMenuEvent::~QContextMenuEvent
+
+Class QContextMenuEvent
+ size=56 align=8
+ base size=49 base align=8
+QContextMenuEvent (0x0x7f784d020b60) 0
+ vptr=((& QContextMenuEvent::_ZTV17QContextMenuEvent) + 16)
+ QInputEvent (0x0x7f784d020bc8) 0
+ primary-for QContextMenuEvent (0x0x7f784d020b60)
+ QEvent (0x0x7f784d11e480) 0
+ primary-for QInputEvent (0x0x7f784d020bc8)
+
+Class QInputMethodEvent::Attribute
+ size=32 align=8
+ base size=32 base align=8
+QInputMethodEvent::Attribute (0x0x7f784d11e7e0) 0
+
+Vtable for QInputMethodEvent
+QInputMethodEvent::_ZTV17QInputMethodEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QInputMethodEvent)
+16 (int (*)(...))QInputMethodEvent::~QInputMethodEvent
+24 (int (*)(...))QInputMethodEvent::~QInputMethodEvent
+
+Class QInputMethodEvent
+ size=56 align=8
+ base size=56 base align=8
+QInputMethodEvent (0x0x7f784d020c30) 0
+ vptr=((& QInputMethodEvent::_ZTV17QInputMethodEvent) + 16)
+ QEvent (0x0x7f784d11e780) 0
+ primary-for QInputMethodEvent (0x0x7f784d020c30)
+
+Class QInputMethodQueryEvent::QueryPair
+ size=24 align=8
+ base size=24 base align=8
+QInputMethodQueryEvent::QueryPair (0x0x7f784d1aeb40) 0
+
+Vtable for QInputMethodQueryEvent
+QInputMethodQueryEvent::_ZTV22QInputMethodQueryEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI22QInputMethodQueryEvent)
+16 (int (*)(...))QInputMethodQueryEvent::~QInputMethodQueryEvent
+24 (int (*)(...))QInputMethodQueryEvent::~QInputMethodQueryEvent
+
+Class QInputMethodQueryEvent
+ size=32 align=8
+ base size=32 base align=8
+QInputMethodQueryEvent (0x0x7f784d1b1e38) 0
+ vptr=((& QInputMethodQueryEvent::_ZTV22QInputMethodQueryEvent) + 16)
+ QEvent (0x0x7f784d1aeae0) 0
+ primary-for QInputMethodQueryEvent (0x0x7f784d1b1e38)
+
+Vtable for QDropEvent
+QDropEvent::_ZTV10QDropEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QDropEvent)
+16 (int (*)(...))QDropEvent::~QDropEvent
+24 (int (*)(...))QDropEvent::~QDropEvent
+
+Class QDropEvent
+ size=72 align=8
+ base size=72 base align=8
+QDropEvent (0x0x7f784ce26f08) 0
+ vptr=((& QDropEvent::_ZTV10QDropEvent) + 16)
+ QEvent (0x0x7f784ce2e8a0) 0
+ primary-for QDropEvent (0x0x7f784ce26f08)
+
+Vtable for QDragMoveEvent
+QDragMoveEvent::_ZTV14QDragMoveEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QDragMoveEvent)
+16 (int (*)(...))QDragMoveEvent::~QDragMoveEvent
+24 (int (*)(...))QDragMoveEvent::~QDragMoveEvent
+
+Class QDragMoveEvent
+ size=88 align=8
+ base size=88 base align=8
+QDragMoveEvent (0x0x7f784ce26f70) 0
+ vptr=((& QDragMoveEvent::_ZTV14QDragMoveEvent) + 16)
+ QDropEvent (0x0x7f784ce4d000) 0
+ primary-for QDragMoveEvent (0x0x7f784ce26f70)
+ QEvent (0x0x7f784ce2ec60) 0
+ primary-for QDropEvent (0x0x7f784ce4d000)
+
+Vtable for QDragEnterEvent
+QDragEnterEvent::_ZTV15QDragEnterEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QDragEnterEvent)
+16 (int (*)(...))QDragEnterEvent::~QDragEnterEvent
+24 (int (*)(...))QDragEnterEvent::~QDragEnterEvent
+
+Class QDragEnterEvent
+ size=88 align=8
+ base size=88 base align=8
+QDragEnterEvent (0x0x7f784ce4d068) 0
+ vptr=((& QDragEnterEvent::_ZTV15QDragEnterEvent) + 16)
+ QDragMoveEvent (0x0x7f784ce4d0d0) 0
+ primary-for QDragEnterEvent (0x0x7f784ce4d068)
+ QDropEvent (0x0x7f784ce4d138) 0
+ primary-for QDragMoveEvent (0x0x7f784ce4d0d0)
+ QEvent (0x0x7f784ce2eea0) 0
+ primary-for QDropEvent (0x0x7f784ce4d138)
+
+Vtable for QDragLeaveEvent
+QDragLeaveEvent::_ZTV15QDragLeaveEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QDragLeaveEvent)
+16 (int (*)(...))QDragLeaveEvent::~QDragLeaveEvent
+24 (int (*)(...))QDragLeaveEvent::~QDragLeaveEvent
+
+Class QDragLeaveEvent
+ size=24 align=8
+ base size=20 base align=8
+QDragLeaveEvent (0x0x7f784ce4d1a0) 0
+ vptr=((& QDragLeaveEvent::_ZTV15QDragLeaveEvent) + 16)
+ QEvent (0x0x7f784ce2ef00) 0
+ primary-for QDragLeaveEvent (0x0x7f784ce4d1a0)
+
+Vtable for QHelpEvent
+QHelpEvent::_ZTV10QHelpEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QHelpEvent)
+16 (int (*)(...))QHelpEvent::~QHelpEvent
+24 (int (*)(...))QHelpEvent::~QHelpEvent
+
+Class QHelpEvent
+ size=40 align=8
+ base size=36 base align=8
+QHelpEvent (0x0x7f784ce4d208) 0
+ vptr=((& QHelpEvent::_ZTV10QHelpEvent) + 16)
+ QEvent (0x0x7f784ce2ef60) 0
+ primary-for QHelpEvent (0x0x7f784ce4d208)
+
+Vtable for QStatusTipEvent
+QStatusTipEvent::_ZTV15QStatusTipEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QStatusTipEvent)
+16 (int (*)(...))QStatusTipEvent::~QStatusTipEvent
+24 (int (*)(...))QStatusTipEvent::~QStatusTipEvent
+
+Class QStatusTipEvent
+ size=32 align=8
+ base size=32 base align=8
+QStatusTipEvent (0x0x7f784ce4d270) 0
+ vptr=((& QStatusTipEvent::_ZTV15QStatusTipEvent) + 16)
+ QEvent (0x0x7f784ce5f240) 0
+ primary-for QStatusTipEvent (0x0x7f784ce4d270)
+
+Vtable for QWhatsThisClickedEvent
+QWhatsThisClickedEvent::_ZTV22QWhatsThisClickedEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI22QWhatsThisClickedEvent)
+16 (int (*)(...))QWhatsThisClickedEvent::~QWhatsThisClickedEvent
+24 (int (*)(...))QWhatsThisClickedEvent::~QWhatsThisClickedEvent
+
+Class QWhatsThisClickedEvent
+ size=32 align=8
+ base size=32 base align=8
+QWhatsThisClickedEvent (0x0x7f784ce4d2d8) 0
+ vptr=((& QWhatsThisClickedEvent::_ZTV22QWhatsThisClickedEvent) + 16)
+ QEvent (0x0x7f784ce5f300) 0
+ primary-for QWhatsThisClickedEvent (0x0x7f784ce4d2d8)
+
+Vtable for QActionEvent
+QActionEvent::_ZTV12QActionEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QActionEvent)
+16 (int (*)(...))QActionEvent::~QActionEvent
+24 (int (*)(...))QActionEvent::~QActionEvent
+
+Class QActionEvent
+ size=40 align=8
+ base size=40 base align=8
+QActionEvent (0x0x7f784ce4d340) 0
+ vptr=((& QActionEvent::_ZTV12QActionEvent) + 16)
+ QEvent (0x0x7f784ce5f3c0) 0
+ primary-for QActionEvent (0x0x7f784ce4d340)
+
+Vtable for QFileOpenEvent
+QFileOpenEvent::_ZTV14QFileOpenEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QFileOpenEvent)
+16 (int (*)(...))QFileOpenEvent::~QFileOpenEvent
+24 (int (*)(...))QFileOpenEvent::~QFileOpenEvent
+
+Class QFileOpenEvent
+ size=40 align=8
+ base size=40 base align=8
+QFileOpenEvent (0x0x7f784ce4d3a8) 0
+ vptr=((& QFileOpenEvent::_ZTV14QFileOpenEvent) + 16)
+ QEvent (0x0x7f784ce5f4e0) 0
+ primary-for QFileOpenEvent (0x0x7f784ce4d3a8)
+
+Vtable for QToolBarChangeEvent
+QToolBarChangeEvent::_ZTV19QToolBarChangeEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QToolBarChangeEvent)
+16 (int (*)(...))QToolBarChangeEvent::~QToolBarChangeEvent
+24 (int (*)(...))QToolBarChangeEvent::~QToolBarChangeEvent
+
+Class QToolBarChangeEvent
+ size=24 align=8
+ base size=21 base align=8
+QToolBarChangeEvent (0x0x7f784ce4d410) 0
+ vptr=((& QToolBarChangeEvent::_ZTV19QToolBarChangeEvent) + 16)
+ QEvent (0x0x7f784ce5f600) 0
+ primary-for QToolBarChangeEvent (0x0x7f784ce4d410)
+
+Vtable for QShortcutEvent
+QShortcutEvent::_ZTV14QShortcutEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QShortcutEvent)
+16 (int (*)(...))QShortcutEvent::~QShortcutEvent
+24 (int (*)(...))QShortcutEvent::~QShortcutEvent
+
+Class QShortcutEvent
+ size=40 align=8
+ base size=40 base align=8
+QShortcutEvent (0x0x7f784ce4d478) 0
+ vptr=((& QShortcutEvent::_ZTV14QShortcutEvent) + 16)
+ QEvent (0x0x7f784ce5f6c0) 0
+ primary-for QShortcutEvent (0x0x7f784ce4d478)
+
+Vtable for QWindowStateChangeEvent
+QWindowStateChangeEvent::_ZTV23QWindowStateChangeEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI23QWindowStateChangeEvent)
+16 (int (*)(...))QWindowStateChangeEvent::~QWindowStateChangeEvent
+24 (int (*)(...))QWindowStateChangeEvent::~QWindowStateChangeEvent
+
+Class QWindowStateChangeEvent
+ size=32 align=8
+ base size=25 base align=8
+QWindowStateChangeEvent (0x0x7f784ce4d4e0) 0
+ vptr=((& QWindowStateChangeEvent::_ZTV23QWindowStateChangeEvent) + 16)
+ QEvent (0x0x7f784ce5f840) 0
+ primary-for QWindowStateChangeEvent (0x0x7f784ce4d4e0)
+
+Class QPointingDeviceUniqueId
+ size=8 align=8
+ base size=8 base align=8
+QPointingDeviceUniqueId (0x0x7f784ce5f9c0) 0
+
+Class QTouchEvent::TouchPoint
+ size=8 align=8
+ base size=8 base align=8
+QTouchEvent::TouchPoint (0x0x7f784cebcd80) 0
+
+Vtable for QTouchEvent
+QTouchEvent::_ZTV11QTouchEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QTouchEvent)
+16 (int (*)(...))QTouchEvent::~QTouchEvent
+24 (int (*)(...))QTouchEvent::~QTouchEvent
+
+Class QTouchEvent
+ size=72 align=8
+ base size=72 base align=8
+QTouchEvent (0x0x7f784cebfd00) 0
+ vptr=((& QTouchEvent::_ZTV11QTouchEvent) + 16)
+ QInputEvent (0x0x7f784cebfd68) 0
+ primary-for QTouchEvent (0x0x7f784cebfd00)
+ QEvent (0x0x7f784cebcd20) 0
+ primary-for QInputEvent (0x0x7f784cebfd68)
+
+Vtable for QScrollPrepareEvent
+QScrollPrepareEvent::_ZTV19QScrollPrepareEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QScrollPrepareEvent)
+16 (int (*)(...))QScrollPrepareEvent::~QScrollPrepareEvent
+24 (int (*)(...))QScrollPrepareEvent::~QScrollPrepareEvent
+
+Class QScrollPrepareEvent
+ size=112 align=8
+ base size=112 base align=8
+QScrollPrepareEvent (0x0x7f784cbd4a28) 0
+ vptr=((& QScrollPrepareEvent::_ZTV19QScrollPrepareEvent) + 16)
+ QEvent (0x0x7f784cbff360) 0
+ primary-for QScrollPrepareEvent (0x0x7f784cbd4a28)
+
+Vtable for QScrollEvent
+QScrollEvent::_ZTV12QScrollEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QScrollEvent)
+16 (int (*)(...))QScrollEvent::~QScrollEvent
+24 (int (*)(...))QScrollEvent::~QScrollEvent
+
+Class QScrollEvent
+ size=64 align=8
+ base size=60 base align=8
+QScrollEvent (0x0x7f784cbd4a90) 0
+ vptr=((& QScrollEvent::_ZTV12QScrollEvent) + 16)
+ QEvent (0x0x7f784cbff3c0) 0
+ primary-for QScrollEvent (0x0x7f784cbd4a90)
+
+Vtable for QScreenOrientationChangeEvent
+QScreenOrientationChangeEvent::_ZTV29QScreenOrientationChangeEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI29QScreenOrientationChangeEvent)
+16 (int (*)(...))QScreenOrientationChangeEvent::~QScreenOrientationChangeEvent
+24 (int (*)(...))QScreenOrientationChangeEvent::~QScreenOrientationChangeEvent
+
+Class QScreenOrientationChangeEvent
+ size=40 align=8
+ base size=36 base align=8
+QScreenOrientationChangeEvent (0x0x7f784cbd4af8) 0
+ vptr=((& QScreenOrientationChangeEvent::_ZTV29QScreenOrientationChangeEvent) + 16)
+ QEvent (0x0x7f784cbff420) 0
+ primary-for QScreenOrientationChangeEvent (0x0x7f784cbd4af8)
+
+Vtable for QApplicationStateChangeEvent
+QApplicationStateChangeEvent::_ZTV28QApplicationStateChangeEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI28QApplicationStateChangeEvent)
+16 (int (*)(...))QApplicationStateChangeEvent::~QApplicationStateChangeEvent
+24 (int (*)(...))QApplicationStateChangeEvent::~QApplicationStateChangeEvent
+
+Class QApplicationStateChangeEvent
+ size=24 align=8
+ base size=24 base align=8
+QApplicationStateChangeEvent (0x0x7f784cbd4b60) 0
+ vptr=((& QApplicationStateChangeEvent::_ZTV28QApplicationStateChangeEvent) + 16)
+ QEvent (0x0x7f784cbff480) 0
+ primary-for QApplicationStateChangeEvent (0x0x7f784cbd4b60)
+
+Class QFont
+ size=16 align=8
+ base size=12 base align=8
+QFont (0x0x7f784cbff4e0) 0
+
+Class QPolygon
+ size=8 align=8
+ base size=8 base align=8
+QPolygon (0x0x7f784cd59000) 0
+ QVector<QPoint> (0x0x7f784cd1d540) 0
+
+Class QPolygonF
+ size=8 align=8
+ base size=8 base align=8
+QPolygonF (0x0x7f784cdbb340) 0
+ QVector<QPointF> (0x0x7f784cdbd660) 0
+
+Class QMatrix
+ size=48 align=8
+ base size=48 base align=8
+QMatrix (0x0x7f784ca5f540) 0
+
+Class QTransform
+ size=88 align=8
+ base size=88 base align=8
+QTransform (0x0x7f784caca300) 0
+
+Vtable for QPaintDevice
+QPaintDevice::_ZTV12QPaintDevice: 10 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QPaintDevice)
+16 0
+24 0
+32 (int (*)(...))QPaintDevice::devType
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))QPaintDevice::metric
+56 (int (*)(...))QPaintDevice::initPainter
+64 (int (*)(...))QPaintDevice::redirected
+72 (int (*)(...))QPaintDevice::sharedPainter
+
+Class QPaintDevice
+ size=24 align=8
+ base size=24 base align=8
+QPaintDevice (0x0x7f784cb55d20) 0
+ vptr=((& QPaintDevice::_ZTV12QPaintDevice) + 16)
+
+Class QPixelFormat
+ size=8 align=8
+ base size=8 base align=8
+QPixelFormat (0x0x7f784cba3360) 0
+
+Vtable for QImage
+QImage::_ZTV6QImage: 10 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI6QImage)
+16 (int (*)(...))QImage::~QImage
+24 (int (*)(...))QImage::~QImage
+32 (int (*)(...))QImage::devType
+40 (int (*)(...))QImage::paintEngine
+48 (int (*)(...))QImage::metric
+56 (int (*)(...))QPaintDevice::initPainter
+64 (int (*)(...))QPaintDevice::redirected
+72 (int (*)(...))QPaintDevice::sharedPainter
+
+Class QImage
+ size=32 align=8
+ base size=32 base align=8
+QImage (0x0x7f784c82ed68) 0
+ vptr=((& QImage::_ZTV6QImage) + 16)
+ QPaintDevice (0x0x7f784c838c60) 0
+ primary-for QImage (0x0x7f784c82ed68)
+
+Vtable for QPixmap
+QPixmap::_ZTV7QPixmap: 10 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI7QPixmap)
+16 (int (*)(...))QPixmap::~QPixmap
+24 (int (*)(...))QPixmap::~QPixmap
+32 (int (*)(...))QPixmap::devType
+40 (int (*)(...))QPixmap::paintEngine
+48 (int (*)(...))QPixmap::metric
+56 (int (*)(...))QPaintDevice::initPainter
+64 (int (*)(...))QPaintDevice::redirected
+72 (int (*)(...))QPaintDevice::sharedPainter
+
+Class QPixmap
+ size=32 align=8
+ base size=32 base align=8
+QPixmap (0x0x7f784c9507b8) 0
+ vptr=((& QPixmap::_ZTV7QPixmap) + 16)
+ QPaintDevice (0x0x7f784c94ea80) 0
+ primary-for QPixmap (0x0x7f784c9507b8)
+
+Class QBrush
+ size=8 align=8
+ base size=8 base align=8
+QBrush (0x0x7f784c62ad80) 0
+
+Class QBrushData
+ size=112 align=8
+ base size=112 base align=8
+QBrushData (0x0x7f784c70c300) 0
+
+Class QGradient::QGradientData
+ size=40 align=8
+ base size=40 base align=8
+QGradient::QGradientData (0x0x7f784c70c5a0) 0
+
+Class QGradient
+ size=64 align=8
+ base size=64 base align=8
+QGradient (0x0x7f784c70c540) 0
+
+Class QLinearGradient
+ size=64 align=8
+ base size=64 base align=8
+QLinearGradient (0x0x7f784c70d1a0) 0
+ QGradient (0x0x7f784c70cc60) 0
+
+Class QRadialGradient
+ size=64 align=8
+ base size=64 base align=8
+QRadialGradient (0x0x7f784c70d208) 0
+ QGradient (0x0x7f784c70cd80) 0
+
+Class QConicalGradient
+ size=64 align=8
+ base size=64 base align=8
+QConicalGradient (0x0x7f784c70d270) 0
+ QGradient (0x0x7f784c70cea0) 0
+
+Class QPen
+ size=8 align=8
+ base size=8 base align=8
+QPen (0x0x7f784c70cf60) 0
+
+Class QTextOption::Tab
+ size=16 align=8
+ base size=14 base align=8
+QTextOption::Tab (0x0x7f784c431900) 0
+
+Class QTextOption
+ size=32 align=8
+ base size=32 base align=8
+QTextOption (0x0x7f784c4318a0) 0
+
+Class QTextLength
+ size=16 align=8
+ base size=16 base align=8
+QTextLength (0x0x7f784c4a3060) 0
+
+Class QTextFormat
+ size=16 align=8
+ base size=12 base align=8
+QTextFormat (0x0x7f784c4f59c0) 0
+
+Class QTextCharFormat
+ size=16 align=8
+ base size=12 base align=8
+QTextCharFormat (0x0x7f784c24df70) 0
+ QTextFormat (0x0x7f784c28f0c0) 0
+
+Class QTextBlockFormat
+ size=16 align=8
+ base size=12 base align=8
+QTextBlockFormat (0x0x7f784c30b3a8) 0
+ QTextFormat (0x0x7f784c305a80) 0
+
+Class QTextListFormat
+ size=16 align=8
+ base size=12 base align=8
+QTextListFormat (0x0x7f784c3658f0) 0
+ QTextFormat (0x0x7f784c367840) 0
+
+Class QTextImageFormat
+ size=16 align=8
+ base size=12 base align=8
+QTextImageFormat (0x0x7f784c3a6d00) 0
+ QTextCharFormat (0x0x7f784c3a6d68) 0
+ QTextFormat (0x0x7f784c3c2000) 0
+
+Class QTextFrameFormat
+ size=16 align=8
+ base size=12 base align=8
+QTextFrameFormat (0x0x7f784c0062d8) 0
+ QTextFormat (0x0x7f784c001660) 0
+
+Class QTextTableFormat
+ size=16 align=8
+ base size=12 base align=8
+QTextTableFormat (0x0x7f784c053820) 0
+ QTextFrameFormat (0x0x7f784c053888) 0
+ QTextFormat (0x0x7f784c0682a0) 0
+
+Class QTextTableCellFormat
+ size=16 align=8
+ base size=12 base align=8
+QTextTableCellFormat (0x0x7f784c0a7dd0) 0
+ QTextCharFormat (0x0x7f784c0a7e38) 0
+ QTextFormat (0x0x7f784c0adc00) 0
+
+Class QFontDatabase
+ size=8 align=8
+ base size=8 base align=8
+QFontDatabase (0x0x7f784c119a80) 0
+
+Class QRawFont
+ size=8 align=8
+ base size=8 base align=8
+QRawFont (0x0x7f784c119c60) 0
+
+Class QGlyphRun
+ size=8 align=8
+ base size=8 base align=8
+QGlyphRun (0x0x7f784be38480) 0
+
+Class QTextCursor
+ size=8 align=8
+ base size=8 base align=8
+QTextCursor (0x0x7f784bf0e3c0) 0
+
+Class QTextInlineObject
+ size=16 align=8
+ base size=16 base align=8
+QTextInlineObject (0x0x7f784bbed060) 0
+
+Class QTextLayout::FormatRange
+ size=24 align=8
+ base size=24 base align=8
+QTextLayout::FormatRange (0x0x7f784bbed480) 0
+
+Class QTextLayout
+ size=8 align=8
+ base size=8 base align=8
+QTextLayout (0x0x7f784bbed420) 0
+
+Class QTextLine
+ size=16 align=8
+ base size=16 base align=8
+QTextLine (0x0x7f784bc7eb40) 0
+
+Vtable for QAbstractUndoItem
+QAbstractUndoItem::_ZTV17QAbstractUndoItem: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QAbstractUndoItem)
+16 (int (*)(...))__cxa_pure_virtual
+24 (int (*)(...))__cxa_pure_virtual
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+
+Class QAbstractUndoItem
+ size=8 align=8
+ base size=8 base align=8
+QAbstractUndoItem (0x0x7f784bcaa000) 0 nearly-empty
+ vptr=((& QAbstractUndoItem::_ZTV17QAbstractUndoItem) + 16)
+
+Class QTextDocument::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTextDocument::QPrivateSignal (0x0x7f784bcaa2a0) 0 empty
+
+Vtable for QTextDocument
+QTextDocument::_ZTV13QTextDocument: 17 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QTextDocument)
+16 (int (*)(...))QTextDocument::metaObject
+24 (int (*)(...))QTextDocument::qt_metacast
+32 (int (*)(...))QTextDocument::qt_metacall
+40 (int (*)(...))QTextDocument::~QTextDocument
+48 (int (*)(...))QTextDocument::~QTextDocument
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QTextDocument::clear
+120 (int (*)(...))QTextDocument::createObject
+128 (int (*)(...))QTextDocument::loadResource
+
+Class QTextDocument
+ size=16 align=8
+ base size=16 base align=8
+QTextDocument (0x0x7f784bc91618) 0
+ vptr=((& QTextDocument::_ZTV13QTextDocument) + 16)
+ QObject (0x0x7f784bcaa240) 0
+ primary-for QTextDocument (0x0x7f784bc91618)
+
+Class QPalette::Data
+ size=4 align=4
+ base size=4 base align=4
+QPalette::Data (0x0x7f784bd1b2a0) 0
+
+Class QPalette
+ size=16 align=8
+ base size=12 base align=8
+QPalette (0x0x7f784bd1b240) 0
+
+Class QAbstractTextDocumentLayout::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAbstractTextDocumentLayout::QPrivateSignal (0x0x7f784ba02660) 0 empty
+
+Class QAbstractTextDocumentLayout::Selection
+ size=24 align=8
+ base size=24 base align=8
+QAbstractTextDocumentLayout::Selection (0x0x7f784ba026c0) 0
+
+Class QAbstractTextDocumentLayout::PaintContext
+ size=64 align=8
+ base size=64 base align=8
+QAbstractTextDocumentLayout::PaintContext (0x0x7f784ba02720) 0
+
+Vtable for QAbstractTextDocumentLayout
+QAbstractTextDocumentLayout::_ZTV27QAbstractTextDocumentLayout: 24 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI27QAbstractTextDocumentLayout)
+16 (int (*)(...))QAbstractTextDocumentLayout::metaObject
+24 (int (*)(...))QAbstractTextDocumentLayout::qt_metacast
+32 (int (*)(...))QAbstractTextDocumentLayout::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))__cxa_pure_virtual
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))__cxa_pure_virtual
+160 (int (*)(...))__cxa_pure_virtual
+168 (int (*)(...))QAbstractTextDocumentLayout::resizeInlineObject
+176 (int (*)(...))QAbstractTextDocumentLayout::positionInlineObject
+184 (int (*)(...))QAbstractTextDocumentLayout::drawInlineObject
+
+Class QAbstractTextDocumentLayout
+ size=16 align=8
+ base size=16 base align=8
+QAbstractTextDocumentLayout (0x0x7f784ba00410) 0
+ vptr=((& QAbstractTextDocumentLayout::_ZTV27QAbstractTextDocumentLayout) + 16)
+ QObject (0x0x7f784ba02600) 0
+ primary-for QAbstractTextDocumentLayout (0x0x7f784ba00410)
+
+Vtable for QTextObjectInterface
+QTextObjectInterface::_ZTV20QTextObjectInterface: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QTextObjectInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+
+Class QTextObjectInterface
+ size=8 align=8
+ base size=8 base align=8
+QTextObjectInterface (0x0x7f784bad2300) 0 nearly-empty
+ vptr=((& QTextObjectInterface::_ZTV20QTextObjectInterface) + 16)
+
+Class QAccessible::State
+ size=8 align=8
+ base size=5 base align=8
+QAccessible::State (0x0x7f784bad2540) 0
+
+Vtable for QAccessible::ActivationObserver
+QAccessible::ActivationObserver::_ZTVN11QAccessible18ActivationObserverE: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTIN11QAccessible18ActivationObserverE)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+
+Class QAccessible::ActivationObserver
+ size=8 align=8
+ base size=8 base align=8
+QAccessible::ActivationObserver (0x0x7f784bad25a0) 0 nearly-empty
+ vptr=((& QAccessible::ActivationObserver::_ZTVN11QAccessible18ActivationObserverE) + 16)
+
+Class QAccessible
+ size=1 align=1
+ base size=0 base align=1
+QAccessible (0x0x7f784bad24e0) 0 empty
+
+Vtable for QAccessibleInterface
+QAccessibleInterface::_ZTV20QAccessibleInterface: 23 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QAccessibleInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))QAccessibleInterface::window
+56 (int (*)(...))QAccessibleInterface::relations
+64 (int (*)(...))QAccessibleInterface::focusChild
+72 (int (*)(...))__cxa_pure_virtual
+80 (int (*)(...))__cxa_pure_virtual
+88 (int (*)(...))__cxa_pure_virtual
+96 (int (*)(...))__cxa_pure_virtual
+104 (int (*)(...))__cxa_pure_virtual
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))__cxa_pure_virtual
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))QAccessibleInterface::foregroundColor
+160 (int (*)(...))QAccessibleInterface::backgroundColor
+168 (int (*)(...))QAccessibleInterface::virtual_hook
+176 (int (*)(...))QAccessibleInterface::interface_cast
+
+Class QAccessibleInterface
+ size=8 align=8
+ base size=8 base align=8
+QAccessibleInterface (0x0x7f784bb26180) 0 nearly-empty
+ vptr=((& QAccessibleInterface::_ZTV20QAccessibleInterface) + 16)
+
+Vtable for QAccessibleTextInterface
+QAccessibleTextInterface::_ZTV24QAccessibleTextInterface: 20 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI24QAccessibleTextInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))__cxa_pure_virtual
+72 (int (*)(...))__cxa_pure_virtual
+80 (int (*)(...))__cxa_pure_virtual
+88 (int (*)(...))__cxa_pure_virtual
+96 (int (*)(...))QAccessibleTextInterface::textBeforeOffset
+104 (int (*)(...))QAccessibleTextInterface::textAfterOffset
+112 (int (*)(...))QAccessibleTextInterface::textAtOffset
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))__cxa_pure_virtual
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))__cxa_pure_virtual
+
+Class QAccessibleTextInterface
+ size=8 align=8
+ base size=8 base align=8
+QAccessibleTextInterface (0x0x7f784bb264e0) 0 nearly-empty
+ vptr=((& QAccessibleTextInterface::_ZTV24QAccessibleTextInterface) + 16)
+
+Vtable for QAccessibleEditableTextInterface
+QAccessibleEditableTextInterface::_ZTV32QAccessibleEditableTextInterface: 7 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI32QAccessibleEditableTextInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+
+Class QAccessibleEditableTextInterface
+ size=8 align=8
+ base size=8 base align=8
+QAccessibleEditableTextInterface (0x0x7f784bb26540) 0 nearly-empty
+ vptr=((& QAccessibleEditableTextInterface::_ZTV32QAccessibleEditableTextInterface) + 16)
+
+Vtable for QAccessibleValueInterface
+QAccessibleValueInterface::_ZTV25QAccessibleValueInterface: 9 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI25QAccessibleValueInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))__cxa_pure_virtual
+
+Class QAccessibleValueInterface
+ size=8 align=8
+ base size=8 base align=8
+QAccessibleValueInterface (0x0x7f784bb265a0) 0 nearly-empty
+ vptr=((& QAccessibleValueInterface::_ZTV25QAccessibleValueInterface) + 16)
+
+Vtable for QAccessibleTableCellInterface
+QAccessibleTableCellInterface::_ZTV29QAccessibleTableCellInterface: 12 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI29QAccessibleTableCellInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))__cxa_pure_virtual
+72 (int (*)(...))__cxa_pure_virtual
+80 (int (*)(...))__cxa_pure_virtual
+88 (int (*)(...))__cxa_pure_virtual
+
+Class QAccessibleTableCellInterface
+ size=8 align=8
+ base size=8 base align=8
+QAccessibleTableCellInterface (0x0x7f784bb26600) 0 nearly-empty
+ vptr=((& QAccessibleTableCellInterface::_ZTV29QAccessibleTableCellInterface) + 16)
+
+Vtable for QAccessibleTableInterface
+QAccessibleTableInterface::_ZTV25QAccessibleTableInterface: 24 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI25QAccessibleTableInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))__cxa_pure_virtual
+72 (int (*)(...))__cxa_pure_virtual
+80 (int (*)(...))__cxa_pure_virtual
+88 (int (*)(...))__cxa_pure_virtual
+96 (int (*)(...))__cxa_pure_virtual
+104 (int (*)(...))__cxa_pure_virtual
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))__cxa_pure_virtual
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))__cxa_pure_virtual
+160 (int (*)(...))__cxa_pure_virtual
+168 (int (*)(...))__cxa_pure_virtual
+176 (int (*)(...))__cxa_pure_virtual
+184 (int (*)(...))__cxa_pure_virtual
+
+Class QAccessibleTableInterface
+ size=8 align=8
+ base size=8 base align=8
+QAccessibleTableInterface (0x0x7f784bb26660) 0 nearly-empty
+ vptr=((& QAccessibleTableInterface::_ZTV25QAccessibleTableInterface) + 16)
+
+Vtable for QAccessibleActionInterface
+QAccessibleActionInterface::_ZTV26QAccessibleActionInterface: 9 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI26QAccessibleActionInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))QAccessibleActionInterface::localizedActionName
+48 (int (*)(...))QAccessibleActionInterface::localizedActionDescription
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))__cxa_pure_virtual
+
+Class QAccessibleActionInterface
+ size=8 align=8
+ base size=8 base align=8
+QAccessibleActionInterface (0x0x7f784bb266c0) 0 nearly-empty
+ vptr=((& QAccessibleActionInterface::_ZTV26QAccessibleActionInterface) + 16)
+
+Vtable for QAccessibleImageInterface
+QAccessibleImageInterface::_ZTV25QAccessibleImageInterface: 7 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI25QAccessibleImageInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+
+Class QAccessibleImageInterface
+ size=8 align=8
+ base size=8 base align=8
+QAccessibleImageInterface (0x0x7f784bb267e0) 0 nearly-empty
+ vptr=((& QAccessibleImageInterface::_ZTV25QAccessibleImageInterface) + 16)
+
+Vtable for QAccessibleEvent
+QAccessibleEvent::_ZTV16QAccessibleEvent: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QAccessibleEvent)
+16 (int (*)(...))QAccessibleEvent::~QAccessibleEvent
+24 (int (*)(...))QAccessibleEvent::~QAccessibleEvent
+32 (int (*)(...))QAccessibleEvent::accessibleInterface
+
+Class QAccessibleEvent
+ size=32 align=8
+ base size=28 base align=8
+QAccessibleEvent (0x0x7f784bb26840) 0
+ vptr=((& QAccessibleEvent::_ZTV16QAccessibleEvent) + 16)
+
+Vtable for QAccessibleStateChangeEvent
+QAccessibleStateChangeEvent::_ZTV27QAccessibleStateChangeEvent: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI27QAccessibleStateChangeEvent)
+16 (int (*)(...))QAccessibleStateChangeEvent::~QAccessibleStateChangeEvent
+24 (int (*)(...))QAccessibleStateChangeEvent::~QAccessibleStateChangeEvent
+32 (int (*)(...))QAccessibleEvent::accessibleInterface
+
+Class QAccessibleStateChangeEvent
+ size=40 align=8
+ base size=40 base align=8
+QAccessibleStateChangeEvent (0x0x7f784bad0a28) 0
+ vptr=((& QAccessibleStateChangeEvent::_ZTV27QAccessibleStateChangeEvent) + 16)
+ QAccessibleEvent (0x0x7f784bbb8240) 0
+ primary-for QAccessibleStateChangeEvent (0x0x7f784bad0a28)
+
+Vtable for QAccessibleTextCursorEvent
+QAccessibleTextCursorEvent::_ZTV26QAccessibleTextCursorEvent: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI26QAccessibleTextCursorEvent)
+16 (int (*)(...))QAccessibleTextCursorEvent::~QAccessibleTextCursorEvent
+24 (int (*)(...))QAccessibleTextCursorEvent::~QAccessibleTextCursorEvent
+32 (int (*)(...))QAccessibleEvent::accessibleInterface
+
+Class QAccessibleTextCursorEvent
+ size=32 align=8
+ base size=32 base align=8
+QAccessibleTextCursorEvent (0x0x7f784bad0a90) 0
+ vptr=((& QAccessibleTextCursorEvent::_ZTV26QAccessibleTextCursorEvent) + 16)
+ QAccessibleEvent (0x0x7f784bbb8600) 0
+ primary-for QAccessibleTextCursorEvent (0x0x7f784bad0a90)
+
+Vtable for QAccessibleTextSelectionEvent
+QAccessibleTextSelectionEvent::_ZTV29QAccessibleTextSelectionEvent: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI29QAccessibleTextSelectionEvent)
+16 (int (*)(...))QAccessibleTextSelectionEvent::~QAccessibleTextSelectionEvent
+24 (int (*)(...))QAccessibleTextSelectionEvent::~QAccessibleTextSelectionEvent
+32 (int (*)(...))QAccessibleEvent::accessibleInterface
+
+Class QAccessibleTextSelectionEvent
+ size=40 align=8
+ base size=40 base align=8
+QAccessibleTextSelectionEvent (0x0x7f784bad0af8) 0
+ vptr=((& QAccessibleTextSelectionEvent::_ZTV29QAccessibleTextSelectionEvent) + 16)
+ QAccessibleTextCursorEvent (0x0x7f784bad0b60) 0
+ primary-for QAccessibleTextSelectionEvent (0x0x7f784bad0af8)
+ QAccessibleEvent (0x0x7f784bbb8a20) 0
+ primary-for QAccessibleTextCursorEvent (0x0x7f784bad0b60)
+
+Vtable for QAccessibleTextInsertEvent
+QAccessibleTextInsertEvent::_ZTV26QAccessibleTextInsertEvent: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI26QAccessibleTextInsertEvent)
+16 (int (*)(...))QAccessibleTextInsertEvent::~QAccessibleTextInsertEvent
+24 (int (*)(...))QAccessibleTextInsertEvent::~QAccessibleTextInsertEvent
+32 (int (*)(...))QAccessibleEvent::accessibleInterface
+
+Class QAccessibleTextInsertEvent
+ size=48 align=8
+ base size=48 base align=8
+QAccessibleTextInsertEvent (0x0x7f784bad0bc8) 0
+ vptr=((& QAccessibleTextInsertEvent::_ZTV26QAccessibleTextInsertEvent) + 16)
+ QAccessibleTextCursorEvent (0x0x7f784bad0c30) 0
+ primary-for QAccessibleTextInsertEvent (0x0x7f784bad0bc8)
+ QAccessibleEvent (0x0x7f784bbb8ea0) 0
+ primary-for QAccessibleTextCursorEvent (0x0x7f784bad0c30)
+
+Vtable for QAccessibleTextRemoveEvent
+QAccessibleTextRemoveEvent::_ZTV26QAccessibleTextRemoveEvent: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI26QAccessibleTextRemoveEvent)
+16 (int (*)(...))QAccessibleTextRemoveEvent::~QAccessibleTextRemoveEvent
+24 (int (*)(...))QAccessibleTextRemoveEvent::~QAccessibleTextRemoveEvent
+32 (int (*)(...))QAccessibleEvent::accessibleInterface
+
+Class QAccessibleTextRemoveEvent
+ size=48 align=8
+ base size=48 base align=8
+QAccessibleTextRemoveEvent (0x0x7f784bad0c98) 0
+ vptr=((& QAccessibleTextRemoveEvent::_ZTV26QAccessibleTextRemoveEvent) + 16)
+ QAccessibleTextCursorEvent (0x0x7f784bad0d00) 0
+ primary-for QAccessibleTextRemoveEvent (0x0x7f784bad0c98)
+ QAccessibleEvent (0x0x7f784b7e7300) 0
+ primary-for QAccessibleTextCursorEvent (0x0x7f784bad0d00)
+
+Vtable for QAccessibleTextUpdateEvent
+QAccessibleTextUpdateEvent::_ZTV26QAccessibleTextUpdateEvent: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI26QAccessibleTextUpdateEvent)
+16 (int (*)(...))QAccessibleTextUpdateEvent::~QAccessibleTextUpdateEvent
+24 (int (*)(...))QAccessibleTextUpdateEvent::~QAccessibleTextUpdateEvent
+32 (int (*)(...))QAccessibleEvent::accessibleInterface
+
+Class QAccessibleTextUpdateEvent
+ size=56 align=8
+ base size=56 base align=8
+QAccessibleTextUpdateEvent (0x0x7f784bad0d68) 0
+ vptr=((& QAccessibleTextUpdateEvent::_ZTV26QAccessibleTextUpdateEvent) + 16)
+ QAccessibleTextCursorEvent (0x0x7f784bad0dd0) 0
+ primary-for QAccessibleTextUpdateEvent (0x0x7f784bad0d68)
+ QAccessibleEvent (0x0x7f784b7e7720) 0
+ primary-for QAccessibleTextCursorEvent (0x0x7f784bad0dd0)
+
+Vtable for QAccessibleValueChangeEvent
+QAccessibleValueChangeEvent::_ZTV27QAccessibleValueChangeEvent: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI27QAccessibleValueChangeEvent)
+16 (int (*)(...))QAccessibleValueChangeEvent::~QAccessibleValueChangeEvent
+24 (int (*)(...))QAccessibleValueChangeEvent::~QAccessibleValueChangeEvent
+32 (int (*)(...))QAccessibleEvent::accessibleInterface
+
+Class QAccessibleValueChangeEvent
+ size=48 align=8
+ base size=48 base align=8
+QAccessibleValueChangeEvent (0x0x7f784bad0e38) 0
+ vptr=((& QAccessibleValueChangeEvent::_ZTV27QAccessibleValueChangeEvent) + 16)
+ QAccessibleEvent (0x0x7f784b7e7ba0) 0
+ primary-for QAccessibleValueChangeEvent (0x0x7f784bad0e38)
+
+Vtable for QAccessibleTableModelChangeEvent
+QAccessibleTableModelChangeEvent::_ZTV32QAccessibleTableModelChangeEvent: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI32QAccessibleTableModelChangeEvent)
+16 (int (*)(...))QAccessibleTableModelChangeEvent::~QAccessibleTableModelChangeEvent
+24 (int (*)(...))QAccessibleTableModelChangeEvent::~QAccessibleTableModelChangeEvent
+32 (int (*)(...))QAccessibleEvent::accessibleInterface
+
+Class QAccessibleTableModelChangeEvent
+ size=48 align=8
+ base size=48 base align=8
+QAccessibleTableModelChangeEvent (0x0x7f784bad0ea0) 0
+ vptr=((& QAccessibleTableModelChangeEvent::_ZTV32QAccessibleTableModelChangeEvent) + 16)
+ QAccessibleEvent (0x0x7f784b818000) 0
+ primary-for QAccessibleTableModelChangeEvent (0x0x7f784bad0ea0)
+
+Vtable for QAccessibleBridge
+QAccessibleBridge::_ZTV17QAccessibleBridge: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QAccessibleBridge)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+
+Class QAccessibleBridge
+ size=8 align=8
+ base size=8 base align=8
+QAccessibleBridge (0x0x7f784b8188a0) 0 nearly-empty
+ vptr=((& QAccessibleBridge::_ZTV17QAccessibleBridge) + 16)
+
+Class QAccessibleBridgePlugin::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAccessibleBridgePlugin::QPrivateSignal (0x0x7f784b818b40) 0 empty
+
+Vtable for QAccessibleBridgePlugin
+QAccessibleBridgePlugin::_ZTV23QAccessibleBridgePlugin: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI23QAccessibleBridgePlugin)
+16 (int (*)(...))QAccessibleBridgePlugin::metaObject
+24 (int (*)(...))QAccessibleBridgePlugin::qt_metacast
+32 (int (*)(...))QAccessibleBridgePlugin::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+
+Class QAccessibleBridgePlugin
+ size=16 align=8
+ base size=16 base align=8
+QAccessibleBridgePlugin (0x0x7f784bad0f08) 0
+ vptr=((& QAccessibleBridgePlugin::_ZTV23QAccessibleBridgePlugin) + 16)
+ QObject (0x0x7f784b818ae0) 0
+ primary-for QAccessibleBridgePlugin (0x0x7f784bad0f08)
+
+Vtable for QAccessibleObject
+QAccessibleObject::_ZTV17QAccessibleObject: 23 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QAccessibleObject)
+16 0
+24 0
+32 (int (*)(...))QAccessibleObject::isValid
+40 (int (*)(...))QAccessibleObject::object
+48 (int (*)(...))QAccessibleInterface::window
+56 (int (*)(...))QAccessibleInterface::relations
+64 (int (*)(...))QAccessibleInterface::focusChild
+72 (int (*)(...))QAccessibleObject::childAt
+80 (int (*)(...))__cxa_pure_virtual
+88 (int (*)(...))__cxa_pure_virtual
+96 (int (*)(...))__cxa_pure_virtual
+104 (int (*)(...))__cxa_pure_virtual
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))QAccessibleObject::setText
+128 (int (*)(...))QAccessibleObject::rect
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))QAccessibleInterface::foregroundColor
+160 (int (*)(...))QAccessibleInterface::backgroundColor
+168 (int (*)(...))QAccessibleInterface::virtual_hook
+176 (int (*)(...))QAccessibleInterface::interface_cast
+
+Class QAccessibleObject
+ size=16 align=8
+ base size=16 base align=8
+QAccessibleObject (0x0x7f784bad0f70) 0
+ vptr=((& QAccessibleObject::_ZTV17QAccessibleObject) + 16)
+ QAccessibleInterface (0x0x7f784b818c60) 0 nearly-empty
+ primary-for QAccessibleObject (0x0x7f784bad0f70)
+
+Vtable for QAccessibleApplication
+QAccessibleApplication::_ZTV22QAccessibleApplication: 23 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI22QAccessibleApplication)
+16 (int (*)(...))QAccessibleApplication::~QAccessibleApplication
+24 (int (*)(...))QAccessibleApplication::~QAccessibleApplication
+32 (int (*)(...))QAccessibleObject::isValid
+40 (int (*)(...))QAccessibleObject::object
+48 (int (*)(...))QAccessibleApplication::window
+56 (int (*)(...))QAccessibleInterface::relations
+64 (int (*)(...))QAccessibleApplication::focusChild
+72 (int (*)(...))QAccessibleObject::childAt
+80 (int (*)(...))QAccessibleApplication::parent
+88 (int (*)(...))QAccessibleApplication::child
+96 (int (*)(...))QAccessibleApplication::childCount
+104 (int (*)(...))QAccessibleApplication::indexOfChild
+112 (int (*)(...))QAccessibleApplication::text
+120 (int (*)(...))QAccessibleObject::setText
+128 (int (*)(...))QAccessibleObject::rect
+136 (int (*)(...))QAccessibleApplication::role
+144 (int (*)(...))QAccessibleApplication::state
+152 (int (*)(...))QAccessibleInterface::foregroundColor
+160 (int (*)(...))QAccessibleInterface::backgroundColor
+168 (int (*)(...))QAccessibleInterface::virtual_hook
+176 (int (*)(...))QAccessibleInterface::interface_cast
+
+Class QAccessibleApplication
+ size=16 align=8
+ base size=16 base align=8
+QAccessibleApplication (0x0x7f784b844000) 0
+ vptr=((& QAccessibleApplication::_ZTV22QAccessibleApplication) + 16)
+ QAccessibleObject (0x0x7f784b844068) 0
+ primary-for QAccessibleApplication (0x0x7f784b844000)
+ QAccessibleInterface (0x0x7f784b818cc0) 0 nearly-empty
+ primary-for QAccessibleObject (0x0x7f784b844068)
+
+Class QAccessiblePlugin::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAccessiblePlugin::QPrivateSignal (0x0x7f784b818d80) 0 empty
+
+Vtable for QAccessiblePlugin
+QAccessiblePlugin::_ZTV17QAccessiblePlugin: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QAccessiblePlugin)
+16 (int (*)(...))QAccessiblePlugin::metaObject
+24 (int (*)(...))QAccessiblePlugin::qt_metacast
+32 (int (*)(...))QAccessiblePlugin::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+
+Class QAccessiblePlugin
+ size=16 align=8
+ base size=16 base align=8
+QAccessiblePlugin (0x0x7f784b8440d0) 0
+ vptr=((& QAccessiblePlugin::_ZTV17QAccessiblePlugin) + 16)
+ QObject (0x0x7f784b818d20) 0
+ primary-for QAccessiblePlugin (0x0x7f784b8440d0)
+
+Class QSurfaceFormat
+ size=8 align=8
+ base size=8 base align=8
+QSurfaceFormat (0x0x7f784b818ea0) 0
+
+Vtable for QSurface
+QSurface::_ZTV8QSurface: 8 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI8QSurface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))__cxa_pure_virtual
+
+Class QSurface
+ size=24 align=8
+ base size=24 base align=8
+QSurface (0x0x7f784b872a20) 0
+ vptr=((& QSurface::_ZTV8QSurface) + 16)
+
+Class QIcon
+ size=8 align=8
+ base size=8 base align=8
+QIcon (0x0x7f784b872de0) 0
+
+Class QCursor
+ size=8 align=8
+ base size=8 base align=8
+QCursor (0x0x7f784b96e960) 0
+
+Class QWindow::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QWindow::QPrivateSignal (0x0x7f784b636720) 0 empty
+
+Vtable for QWindow
+QWindow::_ZTV7QWindow: 45 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI7QWindow)
+16 (int (*)(...))QWindow::metaObject
+24 (int (*)(...))QWindow::qt_metacast
+32 (int (*)(...))QWindow::qt_metacall
+40 (int (*)(...))QWindow::~QWindow
+48 (int (*)(...))QWindow::~QWindow
+56 (int (*)(...))QWindow::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWindow::surfaceType
+120 (int (*)(...))QWindow::format
+128 (int (*)(...))QWindow::size
+136 (int (*)(...))QWindow::accessibleRoot
+144 (int (*)(...))QWindow::focusObject
+152 (int (*)(...))QWindow::exposeEvent
+160 (int (*)(...))QWindow::resizeEvent
+168 (int (*)(...))QWindow::moveEvent
+176 (int (*)(...))QWindow::focusInEvent
+184 (int (*)(...))QWindow::focusOutEvent
+192 (int (*)(...))QWindow::showEvent
+200 (int (*)(...))QWindow::hideEvent
+208 (int (*)(...))QWindow::keyPressEvent
+216 (int (*)(...))QWindow::keyReleaseEvent
+224 (int (*)(...))QWindow::mousePressEvent
+232 (int (*)(...))QWindow::mouseReleaseEvent
+240 (int (*)(...))QWindow::mouseDoubleClickEvent
+248 (int (*)(...))QWindow::mouseMoveEvent
+256 (int (*)(...))QWindow::wheelEvent
+264 (int (*)(...))QWindow::touchEvent
+272 (int (*)(...))QWindow::tabletEvent
+280 (int (*)(...))QWindow::nativeEvent
+288 (int (*)(...))QWindow::surfaceHandle
+296 (int (*)(...))-16
+304 (int (*)(...))(& _ZTI7QWindow)
+312 (int (*)(...))QWindow::_ZThn16_N7QWindowD1Ev
+320 (int (*)(...))QWindow::_ZThn16_N7QWindowD0Ev
+328 (int (*)(...))QWindow::_ZThn16_NK7QWindow6formatEv
+336 (int (*)(...))QWindow::_ZThn16_NK7QWindow13surfaceHandleEv
+344 (int (*)(...))QWindow::_ZThn16_NK7QWindow11surfaceTypeEv
+352 (int (*)(...))QWindow::_ZThn16_NK7QWindow4sizeEv
+
+Class QWindow
+ size=40 align=8
+ base size=40 base align=8
+QWindow (0x0x7f784b63e310) 0
+ vptr=((& QWindow::_ZTV7QWindow) + 16)
+ QObject (0x0x7f784b636660) 0
+ primary-for QWindow (0x0x7f784b63e310)
+ QSurface (0x0x7f784b6366c0) 16
+ vptr=((& QWindow::_ZTV7QWindow) + 312)
+
+Class QBackingStore
+ size=8 align=8
+ base size=8 base align=8
+QBackingStore (0x0x7f784b68c000) 0
+
+Vtable for QBitmap
+QBitmap::_ZTV7QBitmap: 10 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI7QBitmap)
+16 (int (*)(...))QBitmap::~QBitmap
+24 (int (*)(...))QBitmap::~QBitmap
+32 (int (*)(...))QPixmap::devType
+40 (int (*)(...))QPixmap::paintEngine
+48 (int (*)(...))QPixmap::metric
+56 (int (*)(...))QPaintDevice::initPainter
+64 (int (*)(...))QPaintDevice::redirected
+72 (int (*)(...))QPaintDevice::sharedPainter
+
+Class QBitmap
+ size=32 align=8
+ base size=32 base align=8
+QBitmap (0x0x7f784b6403a8) 0
+ vptr=((& QBitmap::_ZTV7QBitmap) + 16)
+ QPixmap (0x0x7f784b640410) 0
+ primary-for QBitmap (0x0x7f784b6403a8)
+ QPaintDevice (0x0x7f784b68c0c0) 0
+ primary-for QPixmap (0x0x7f784b640410)
+
+Class QClipboard::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QClipboard::QPrivateSignal (0x0x7f784b6dd600) 0 empty
+
+Vtable for QClipboard
+QClipboard::_ZTV10QClipboard: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QClipboard)
+16 (int (*)(...))QClipboard::metaObject
+24 (int (*)(...))QClipboard::qt_metacast
+32 (int (*)(...))QClipboard::qt_metacall
+40 (int (*)(...))QClipboard::~QClipboard
+48 (int (*)(...))QClipboard::~QClipboard
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QClipboard
+ size=16 align=8
+ base size=16 base align=8
+QClipboard (0x0x7f784b6db6e8) 0
+ vptr=((& QClipboard::_ZTV10QClipboard) + 16)
+ QObject (0x0x7f784b6dd5a0) 0
+ primary-for QClipboard (0x0x7f784b6db6e8)
+
+Class QColorTransform
+ size=8 align=8
+ base size=8 base align=8
+QColorTransform (0x0x7f784b6dd720) 0
+
+Class QColorSpace
+ size=8 align=8
+ base size=8 base align=8
+QColorSpace (0x0x7f784b7ac8a0) 0
+
+Class QDesktopServices
+ size=1 align=1
+ base size=0 base align=1
+QDesktopServices (0x0x7f784b485660) 0 empty
+
+Class QDrag::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QDrag::QPrivateSignal (0x0x7f784b485720) 0 empty
+
+Vtable for QDrag
+QDrag::_ZTV5QDrag: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI5QDrag)
+16 (int (*)(...))QDrag::metaObject
+24 (int (*)(...))QDrag::qt_metacast
+32 (int (*)(...))QDrag::qt_metacall
+40 (int (*)(...))QDrag::~QDrag
+48 (int (*)(...))QDrag::~QDrag
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QDrag
+ size=16 align=8
+ base size=16 base align=8
+QDrag (0x0x7f784b4863a8) 0
+ vptr=((& QDrag::_ZTV5QDrag) + 16)
+ QObject (0x0x7f784b4856c0) 0
+ primary-for QDrag (0x0x7f784b4863a8)
+
+Class QFontInfo
+ size=8 align=8
+ base size=8 base align=8
+QFontInfo (0x0x7f784b485900) 0
+
+Class QFontMetrics
+ size=8 align=8
+ base size=8 base align=8
+QFontMetrics (0x0x7f784b4db960) 0
+
+Class QFontMetricsF
+ size=8 align=8
+ base size=8 base align=8
+QFontMetricsF (0x0x7f784b526cc0) 0
+
+Class QGenericPlugin::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QGenericPlugin::QPrivateSignal (0x0x7f784b22fe40) 0 empty
+
+Vtable for QGenericPlugin
+QGenericPlugin::_ZTV14QGenericPlugin: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QGenericPlugin)
+16 (int (*)(...))QGenericPlugin::metaObject
+24 (int (*)(...))QGenericPlugin::qt_metacast
+32 (int (*)(...))QGenericPlugin::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+
+Class QGenericPlugin
+ size=16 align=8
+ base size=16 base align=8
+QGenericPlugin (0x0x7f784b579f70) 0
+ vptr=((& QGenericPlugin::_ZTV14QGenericPlugin) + 16)
+ QObject (0x0x7f784b22fde0) 0
+ primary-for QGenericPlugin (0x0x7f784b579f70)
+
+Class QGenericPluginFactory
+ size=1 align=1
+ base size=0 base align=1
+QGenericPluginFactory (0x0x7f784b22ff60) 0 empty
+
+Class QInputMethod::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QInputMethod::QPrivateSignal (0x0x7f784b2c9060) 0 empty
+
+Vtable for QInputMethod
+QInputMethod::_ZTV12QInputMethod: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QInputMethod)
+16 (int (*)(...))QInputMethod::metaObject
+24 (int (*)(...))QInputMethod::qt_metacast
+32 (int (*)(...))QInputMethod::qt_metacall
+40 (int (*)(...))QInputMethod::~QInputMethod
+48 (int (*)(...))QInputMethod::~QInputMethod
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QInputMethod
+ size=16 align=8
+ base size=16 base align=8
+QInputMethod (0x0x7f784b2c8000) 0
+ vptr=((& QInputMethod::_ZTV12QInputMethod) + 16)
+ QObject (0x0x7f784b2c9000) 0
+ primary-for QInputMethod (0x0x7f784b2c8000)
+
+Class QGuiApplication::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QGuiApplication::QPrivateSignal (0x0x7f784b2c9360) 0 empty
+
+Vtable for QGuiApplication
+QGuiApplication::_ZTV15QGuiApplication: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QGuiApplication)
+16 (int (*)(...))QGuiApplication::metaObject
+24 (int (*)(...))QGuiApplication::qt_metacast
+32 (int (*)(...))QGuiApplication::qt_metacall
+40 (int (*)(...))QGuiApplication::~QGuiApplication
+48 (int (*)(...))QGuiApplication::~QGuiApplication
+56 (int (*)(...))QGuiApplication::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QGuiApplication::notify
+120 (int (*)(...))QGuiApplication::compressEvent
+
+Class QGuiApplication
+ size=16 align=8
+ base size=16 base align=8
+QGuiApplication (0x0x7f784b2c8068) 0
+ vptr=((& QGuiApplication::_ZTV15QGuiApplication) + 16)
+ QCoreApplication (0x0x7f784b2c80d0) 0
+ primary-for QGuiApplication (0x0x7f784b2c8068)
+ QObject (0x0x7f784b2c9300) 0
+ primary-for QCoreApplication (0x0x7f784b2c80d0)
+
+Class QIconEngine::AvailableSizesArgument
+ size=16 align=8
+ base size=16 base align=8
+QIconEngine::AvailableSizesArgument (0x0x7f784b2c9ae0) 0
+
+Class QIconEngine::ScaledPixmapArgument
+ size=56 align=8
+ base size=56 base align=8
+QIconEngine::ScaledPixmapArgument (0x0x7f784b2c9c60) 0
+
+Vtable for QIconEngine
+QIconEngine::_ZTV11QIconEngine: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QIconEngine)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))QIconEngine::actualSize
+48 (int (*)(...))QIconEngine::pixmap
+56 (int (*)(...))QIconEngine::addPixmap
+64 (int (*)(...))QIconEngine::addFile
+72 (int (*)(...))QIconEngine::key
+80 (int (*)(...))__cxa_pure_virtual
+88 (int (*)(...))QIconEngine::read
+96 (int (*)(...))QIconEngine::write
+104 (int (*)(...))QIconEngine::availableSizes
+112 (int (*)(...))QIconEngine::iconName
+120 (int (*)(...))QIconEngine::virtual_hook
+
+Class QIconEngine
+ size=8 align=8
+ base size=8 base align=8
+QIconEngine (0x0x7f784b2c9a80) 0 nearly-empty
+ vptr=((& QIconEngine::_ZTV11QIconEngine) + 16)
+
+Class QIconEnginePlugin::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QIconEnginePlugin::QPrivateSignal (0x0x7f784b2c9d20) 0 empty
+
+Vtable for QIconEnginePlugin
+QIconEnginePlugin::_ZTV17QIconEnginePlugin: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QIconEnginePlugin)
+16 (int (*)(...))QIconEnginePlugin::metaObject
+24 (int (*)(...))QIconEnginePlugin::qt_metacast
+32 (int (*)(...))QIconEnginePlugin::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+
+Class QIconEnginePlugin
+ size=16 align=8
+ base size=16 base align=8
+QIconEnginePlugin (0x0x7f784b2c8680) 0
+ vptr=((& QIconEnginePlugin::_ZTV17QIconEnginePlugin) + 16)
+ QObject (0x0x7f784b2c9cc0) 0
+ primary-for QIconEnginePlugin (0x0x7f784b2c8680)
+
+Vtable for QImageIOHandler
+QImageIOHandler::_ZTV15QImageIOHandler: 18 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QImageIOHandler)
+16 0
+24 0
+32 (int (*)(...))QImageIOHandler::name
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))QImageIOHandler::write
+64 (int (*)(...))QImageIOHandler::option
+72 (int (*)(...))QImageIOHandler::setOption
+80 (int (*)(...))QImageIOHandler::supportsOption
+88 (int (*)(...))QImageIOHandler::jumpToNextImage
+96 (int (*)(...))QImageIOHandler::jumpToImage
+104 (int (*)(...))QImageIOHandler::loopCount
+112 (int (*)(...))QImageIOHandler::imageCount
+120 (int (*)(...))QImageIOHandler::nextImageDelay
+128 (int (*)(...))QImageIOHandler::currentImageNumber
+136 (int (*)(...))QImageIOHandler::currentImageRect
+
+Class QImageIOHandler
+ size=16 align=8
+ base size=16 base align=8
+QImageIOHandler (0x0x7f784b2c9e40) 0
+ vptr=((& QImageIOHandler::_ZTV15QImageIOHandler) + 16)
+
+Class QImageIOPlugin::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QImageIOPlugin::QPrivateSignal (0x0x7f784b3590c0) 0 empty
+
+Vtable for QImageIOPlugin
+QImageIOPlugin::_ZTV14QImageIOPlugin: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QImageIOPlugin)
+16 (int (*)(...))QImageIOPlugin::metaObject
+24 (int (*)(...))QImageIOPlugin::qt_metacast
+32 (int (*)(...))QImageIOPlugin::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+
+Class QImageIOPlugin
+ size=16 align=8
+ base size=16 base align=8
+QImageIOPlugin (0x0x7f784b2c86e8) 0
+ vptr=((& QImageIOPlugin::_ZTV14QImageIOPlugin) + 16)
+ QObject (0x0x7f784b359060) 0
+ primary-for QImageIOPlugin (0x0x7f784b2c86e8)
+
+Class QImageReader
+ size=8 align=8
+ base size=8 base align=8
+QImageReader (0x0x7f784b3598a0) 0
+
+Class QImageWriter
+ size=8 align=8
+ base size=8 base align=8
+QImageWriter (0x0x7f784b3599c0) 0
+
+Class QVector3D
+ size=12 align=4
+ base size=12 base align=4
+QVector3D (0x0x7f784b359ae0) 0
+
+Class QVector4D
+ size=16 align=4
+ base size=16 base align=4
+QVector4D (0x0x7f784b010c60) 0
+
+Class QQuaternion
+ size=16 align=4
+ base size=16 base align=4
+QQuaternion (0x0x7f784b090ea0) 0
+
+Class QMatrix4x4
+ size=68 align=4
+ base size=68 base align=4
+QMatrix4x4 (0x0x7f784b1577e0) 0
+
+Class QMovie::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QMovie::QPrivateSignal (0x0x7f784ae85660) 0 empty
+
+Vtable for QMovie
+QMovie::_ZTV6QMovie: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI6QMovie)
+16 (int (*)(...))QMovie::metaObject
+24 (int (*)(...))QMovie::qt_metacast
+32 (int (*)(...))QMovie::qt_metacall
+40 (int (*)(...))QMovie::~QMovie
+48 (int (*)(...))QMovie::~QMovie
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QMovie
+ size=16 align=8
+ base size=16 base align=8
+QMovie (0x0x7f784b1cae38) 0
+ vptr=((& QMovie::_ZTV6QMovie) + 16)
+ QObject (0x0x7f784ae85600) 0
+ primary-for QMovie (0x0x7f784b1cae38)
+
+Class QOffscreenSurface::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QOffscreenSurface::QPrivateSignal (0x0x7f784ae85a80) 0 empty
+
+Vtable for QOffscreenSurface
+QOffscreenSurface::_ZTV17QOffscreenSurface: 26 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QOffscreenSurface)
+16 (int (*)(...))QOffscreenSurface::metaObject
+24 (int (*)(...))QOffscreenSurface::qt_metacast
+32 (int (*)(...))QOffscreenSurface::qt_metacall
+40 (int (*)(...))QOffscreenSurface::~QOffscreenSurface
+48 (int (*)(...))QOffscreenSurface::~QOffscreenSurface
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QOffscreenSurface::surfaceType
+120 (int (*)(...))QOffscreenSurface::format
+128 (int (*)(...))QOffscreenSurface::size
+136 (int (*)(...))QOffscreenSurface::surfaceHandle
+144 (int (*)(...))-16
+152 (int (*)(...))(& _ZTI17QOffscreenSurface)
+160 (int (*)(...))QOffscreenSurface::_ZThn16_N17QOffscreenSurfaceD1Ev
+168 (int (*)(...))QOffscreenSurface::_ZThn16_N17QOffscreenSurfaceD0Ev
+176 (int (*)(...))QOffscreenSurface::_ZThn16_NK17QOffscreenSurface6formatEv
+184 (int (*)(...))QOffscreenSurface::_ZThn16_NK17QOffscreenSurface13surfaceHandleEv
+192 (int (*)(...))QOffscreenSurface::_ZThn16_NK17QOffscreenSurface11surfaceTypeEv
+200 (int (*)(...))QOffscreenSurface::_ZThn16_NK17QOffscreenSurface4sizeEv
+
+Class QOffscreenSurface
+ size=40 align=8
+ base size=40 base align=8
+QOffscreenSurface (0x0x7f784ae75310) 0
+ vptr=((& QOffscreenSurface::_ZTV17QOffscreenSurface) + 16)
+ QObject (0x0x7f784ae859c0) 0
+ primary-for QOffscreenSurface (0x0x7f784ae75310)
+ QSurface (0x0x7f784ae85a20) 16
+ vptr=((& QOffscreenSurface::_ZTV17QOffscreenSurface) + 160)
+
+Class QOpenGLBuffer
+ size=8 align=8
+ base size=8 base align=8
+QOpenGLBuffer (0x0x7f784ae85cc0) 0
+
+Class QOpenGLVersionStatus
+ size=12 align=4
+ base size=12 base align=4
+QOpenGLVersionStatus (0x0x7f784ab6d540) 0
+
+Class QOpenGLVersionFunctionsBackend
+ size=16 align=8
+ base size=12 base align=8
+QOpenGLVersionFunctionsBackend (0x0x7f784abcd120) 0
+
+Class QOpenGLVersionFunctionsStorage
+ size=8 align=8
+ base size=8 base align=8
+QOpenGLVersionFunctionsStorage (0x0x7f784abcd300) 0
+
+Class QAbstractOpenGLFunctionsPrivate
+ size=16 align=8
+ base size=9 base align=8
+QAbstractOpenGLFunctionsPrivate (0x0x7f784abcd360) 0
+
+Vtable for QAbstractOpenGLFunctions
+QAbstractOpenGLFunctions::_ZTV24QAbstractOpenGLFunctions: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI24QAbstractOpenGLFunctions)
+16 (int (*)(...))QAbstractOpenGLFunctions::~QAbstractOpenGLFunctions
+24 (int (*)(...))QAbstractOpenGLFunctions::~QAbstractOpenGLFunctions
+32 (int (*)(...))QAbstractOpenGLFunctions::initializeOpenGLFunctions
+
+Class QAbstractOpenGLFunctions
+ size=16 align=8
+ base size=16 base align=8
+QAbstractOpenGLFunctions (0x0x7f784abcd540) 0
+ vptr=((& QAbstractOpenGLFunctions::_ZTV24QAbstractOpenGLFunctions) + 16)
+
+Class QOpenGLFunctions_1_0_CoreBackend::Functions
+ size=384 align=8
+ base size=384 base align=8
+QOpenGLFunctions_1_0_CoreBackend::Functions (0x0x7f784abcd720) 0
+
+Class QOpenGLFunctions_1_0_CoreBackend
+ size=400 align=8
+ base size=400 base align=8
+QOpenGLFunctions_1_0_CoreBackend (0x0x7f784abb0d00) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f784abcd6c0) 0
+
+Class QOpenGLFunctions_1_1_CoreBackend::Functions
+ size=128 align=8
+ base size=128 base align=8
+QOpenGLFunctions_1_1_CoreBackend::Functions (0x0x7f784abcda20) 0
+
+Class QOpenGLFunctions_1_1_CoreBackend
+ size=144 align=8
+ base size=144 base align=8
+QOpenGLFunctions_1_1_CoreBackend (0x0x7f784abb0d68) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f784abcd9c0) 0
+
+Class QOpenGLFunctions_1_2_CoreBackend::Functions
+ size=48 align=8
+ base size=48 base align=8
+QOpenGLFunctions_1_2_CoreBackend::Functions (0x0x7f784abcdd20) 0
+
+Class QOpenGLFunctions_1_2_CoreBackend
+ size=64 align=8
+ base size=64 base align=8
+QOpenGLFunctions_1_2_CoreBackend (0x0x7f784abb0dd0) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f784abcdcc0) 0
+
+Class QOpenGLFunctions_1_3_CoreBackend::Functions
+ size=72 align=8
+ base size=72 base align=8
+QOpenGLFunctions_1_3_CoreBackend::Functions (0x0x7f784a806060) 0
+
+Class QOpenGLFunctions_1_3_CoreBackend
+ size=88 align=8
+ base size=88 base align=8
+QOpenGLFunctions_1_3_CoreBackend (0x0x7f784abb0e38) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f784a806000) 0
+
+Class QOpenGLFunctions_1_4_CoreBackend::Functions
+ size=56 align=8
+ base size=56 base align=8
+QOpenGLFunctions_1_4_CoreBackend::Functions (0x0x7f784a8063c0) 0
+
+Class QOpenGLFunctions_1_4_CoreBackend
+ size=72 align=8
+ base size=72 base align=8
+QOpenGLFunctions_1_4_CoreBackend (0x0x7f784abb0ea0) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f784a806360) 0
+
+Class QOpenGLFunctions_1_5_CoreBackend::Functions
+ size=152 align=8
+ base size=152 base align=8
+QOpenGLFunctions_1_5_CoreBackend::Functions (0x0x7f784a8066c0) 0
+
+Class QOpenGLFunctions_1_5_CoreBackend
+ size=168 align=8
+ base size=168 base align=8
+QOpenGLFunctions_1_5_CoreBackend (0x0x7f784abb0f08) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f784a806660) 0
+
+Class QOpenGLFunctions_2_0_CoreBackend::Functions
+ size=744 align=8
+ base size=744 base align=8
+QOpenGLFunctions_2_0_CoreBackend::Functions (0x0x7f784a8069c0) 0
+
+Class QOpenGLFunctions_2_0_CoreBackend
+ size=760 align=8
+ base size=760 base align=8
+QOpenGLFunctions_2_0_CoreBackend (0x0x7f784abb0f70) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f784a806960) 0
+
+Class QOpenGLFunctions_2_1_CoreBackend::Functions
+ size=48 align=8
+ base size=48 base align=8
+QOpenGLFunctions_2_1_CoreBackend::Functions (0x0x7f784a806cc0) 0
+
+Class QOpenGLFunctions_2_1_CoreBackend
+ size=64 align=8
+ base size=64 base align=8
+QOpenGLFunctions_2_1_CoreBackend (0x0x7f784a83d000) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f784a806c60) 0
+
+Class QOpenGLFunctions_3_0_CoreBackend::Functions
+ size=672 align=8
+ base size=672 base align=8
+QOpenGLFunctions_3_0_CoreBackend::Functions (0x0x7f784a844000) 0
+
+Class QOpenGLFunctions_3_0_CoreBackend
+ size=688 align=8
+ base size=688 base align=8
+QOpenGLFunctions_3_0_CoreBackend (0x0x7f784a83d068) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f784a806f60) 0
+
+Class QOpenGLFunctions_3_1_CoreBackend::Functions
+ size=96 align=8
+ base size=96 base align=8
+QOpenGLFunctions_3_1_CoreBackend::Functions (0x0x7f784a844300) 0
+
+Class QOpenGLFunctions_3_1_CoreBackend
+ size=112 align=8
+ base size=112 base align=8
+QOpenGLFunctions_3_1_CoreBackend (0x0x7f784a83d0d0) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f784a8442a0) 0
+
+Class QOpenGLFunctions_3_2_CoreBackend::Functions
+ size=152 align=8
+ base size=152 base align=8
+QOpenGLFunctions_3_2_CoreBackend::Functions (0x0x7f784a844600) 0
+
+Class QOpenGLFunctions_3_2_CoreBackend
+ size=168 align=8
+ base size=168 base align=8
+QOpenGLFunctions_3_2_CoreBackend (0x0x7f784a83d138) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f784a8445a0) 0
+
+Class QOpenGLFunctions_3_3_CoreBackend::Functions
+ size=464 align=8
+ base size=464 base align=8
+QOpenGLFunctions_3_3_CoreBackend::Functions (0x0x7f784a844900) 0
+
+Class QOpenGLFunctions_3_3_CoreBackend
+ size=480 align=8
+ base size=480 base align=8
+QOpenGLFunctions_3_3_CoreBackend (0x0x7f784a83d1a0) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f784a8448a0) 0
+
+Class QOpenGLFunctions_4_0_CoreBackend::Functions
+ size=368 align=8
+ base size=368 base align=8
+QOpenGLFunctions_4_0_CoreBackend::Functions (0x0x7f784a844c00) 0
+
+Class QOpenGLFunctions_4_0_CoreBackend
+ size=384 align=8
+ base size=384 base align=8
+QOpenGLFunctions_4_0_CoreBackend (0x0x7f784a83d208) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f784a844ba0) 0
+
+Class QOpenGLFunctions_4_1_CoreBackend::Functions
+ size=704 align=8
+ base size=704 base align=8
+QOpenGLFunctions_4_1_CoreBackend::Functions (0x0x7f784a844f00) 0
+
+Class QOpenGLFunctions_4_1_CoreBackend
+ size=720 align=8
+ base size=720 base align=8
+QOpenGLFunctions_4_1_CoreBackend (0x0x7f784a83d270) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f784a844ea0) 0
+
+Class QOpenGLFunctions_4_2_CoreBackend::Functions
+ size=96 align=8
+ base size=96 base align=8
+QOpenGLFunctions_4_2_CoreBackend::Functions (0x0x7f784a8b4240) 0
+
+Class QOpenGLFunctions_4_2_CoreBackend
+ size=112 align=8
+ base size=112 base align=8
+QOpenGLFunctions_4_2_CoreBackend (0x0x7f784a83d2d8) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f784a8b41e0) 0
+
+Class QOpenGLFunctions_4_3_CoreBackend::Functions
+ size=344 align=8
+ base size=344 base align=8
+QOpenGLFunctions_4_3_CoreBackend::Functions (0x0x7f784a8b4540) 0
+
+Class QOpenGLFunctions_4_3_CoreBackend
+ size=360 align=8
+ base size=360 base align=8
+QOpenGLFunctions_4_3_CoreBackend (0x0x7f784a83d340) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f784a8b44e0) 0
+
+Class QOpenGLFunctions_4_4_CoreBackend::Functions
+ size=72 align=8
+ base size=72 base align=8
+QOpenGLFunctions_4_4_CoreBackend::Functions (0x0x7f784a8b4840) 0
+
+Class QOpenGLFunctions_4_4_CoreBackend
+ size=88 align=8
+ base size=88 base align=8
+QOpenGLFunctions_4_4_CoreBackend (0x0x7f784a83d3a8) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f784a8b47e0) 0
+
+Class QOpenGLFunctions_4_5_CoreBackend::Functions
+ size=848 align=8
+ base size=848 base align=8
+QOpenGLFunctions_4_5_CoreBackend::Functions (0x0x7f784a8b4ba0) 0
+
+Class QOpenGLFunctions_4_5_CoreBackend
+ size=864 align=8
+ base size=864 base align=8
+QOpenGLFunctions_4_5_CoreBackend (0x0x7f784a83d410) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f784a8b4b40) 0
+
+Class QOpenGLFunctions_1_0_DeprecatedBackend::Functions
+ size=2064 align=8
+ base size=2064 base align=8
+QOpenGLFunctions_1_0_DeprecatedBackend::Functions (0x0x7f784a8b4ea0) 0
+
+Class QOpenGLFunctions_1_0_DeprecatedBackend
+ size=2080 align=8
+ base size=2080 base align=8
+QOpenGLFunctions_1_0_DeprecatedBackend (0x0x7f784a83d478) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f784a8b4e40) 0
+
+Class QOpenGLFunctions_1_1_DeprecatedBackend::Functions
+ size=136 align=8
+ base size=136 base align=8
+QOpenGLFunctions_1_1_DeprecatedBackend::Functions (0x0x7f784a93f1e0) 0
+
+Class QOpenGLFunctions_1_1_DeprecatedBackend
+ size=152 align=8
+ base size=152 base align=8
+QOpenGLFunctions_1_1_DeprecatedBackend (0x0x7f784a83d4e0) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f784a93f180) 0
+
+Class QOpenGLFunctions_1_2_DeprecatedBackend::Functions
+ size=256 align=8
+ base size=256 base align=8
+QOpenGLFunctions_1_2_DeprecatedBackend::Functions (0x0x7f784a93f4e0) 0
+
+Class QOpenGLFunctions_1_2_DeprecatedBackend
+ size=272 align=8
+ base size=272 base align=8
+QOpenGLFunctions_1_2_DeprecatedBackend (0x0x7f784a83d548) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f784a93f480) 0
+
+Class QOpenGLFunctions_1_3_DeprecatedBackend::Functions
+ size=296 align=8
+ base size=296 base align=8
+QOpenGLFunctions_1_3_DeprecatedBackend::Functions (0x0x7f784a93f7e0) 0
+
+Class QOpenGLFunctions_1_3_DeprecatedBackend
+ size=312 align=8
+ base size=312 base align=8
+QOpenGLFunctions_1_3_DeprecatedBackend (0x0x7f784a83d5b0) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f784a93f780) 0
+
+Class QOpenGLFunctions_1_4_DeprecatedBackend::Functions
+ size=304 align=8
+ base size=304 base align=8
+QOpenGLFunctions_1_4_DeprecatedBackend::Functions (0x0x7f784a93fae0) 0
+
+Class QOpenGLFunctions_1_4_DeprecatedBackend
+ size=320 align=8
+ base size=320 base align=8
+QOpenGLFunctions_1_4_DeprecatedBackend (0x0x7f784a83d618) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f784a93fa80) 0
+
+Class QOpenGLFunctions_2_0_DeprecatedBackend::Functions
+ size=288 align=8
+ base size=288 base align=8
+QOpenGLFunctions_2_0_DeprecatedBackend::Functions (0x0x7f784a93fde0) 0
+
+Class QOpenGLFunctions_2_0_DeprecatedBackend
+ size=304 align=8
+ base size=304 base align=8
+QOpenGLFunctions_2_0_DeprecatedBackend (0x0x7f784a83d680) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f784a93fd80) 0
+
+Class QOpenGLFunctions_3_0_DeprecatedBackend::Functions
+ size=160 align=8
+ base size=160 base align=8
+QOpenGLFunctions_3_0_DeprecatedBackend::Functions (0x0x7f784a97e120) 0
+
+Class QOpenGLFunctions_3_0_DeprecatedBackend
+ size=176 align=8
+ base size=176 base align=8
+QOpenGLFunctions_3_0_DeprecatedBackend (0x0x7f784a83d6e8) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f784a97e0c0) 0
+
+Class QOpenGLFunctions_3_3_DeprecatedBackend::Functions
+ size=240 align=8
+ base size=240 base align=8
+QOpenGLFunctions_3_3_DeprecatedBackend::Functions (0x0x7f784a97e420) 0
+
+Class QOpenGLFunctions_3_3_DeprecatedBackend
+ size=256 align=8
+ base size=256 base align=8
+QOpenGLFunctions_3_3_DeprecatedBackend (0x0x7f784a83d750) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f784a97e3c0) 0
+
+Class QOpenGLFunctions_4_5_DeprecatedBackend::Functions
+ size=96 align=8
+ base size=96 base align=8
+QOpenGLFunctions_4_5_DeprecatedBackend::Functions (0x0x7f784a97e720) 0
+
+Class QOpenGLFunctions_4_5_DeprecatedBackend
+ size=112 align=8
+ base size=112 base align=8
+QOpenGLFunctions_4_5_DeprecatedBackend (0x0x7f784a83d7b8) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f784a97e6c0) 0
+
+Class QOpenGLVersionProfile
+ size=8 align=8
+ base size=8 base align=8
+QOpenGLVersionProfile (0x0x7f784a97e9c0) 0
+
+Class QOpenGLContextGroup::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QOpenGLContextGroup::QPrivateSignal (0x0x7f784a9bb4e0) 0 empty
+
+Vtable for QOpenGLContextGroup
+QOpenGLContextGroup::_ZTV19QOpenGLContextGroup: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QOpenGLContextGroup)
+16 (int (*)(...))QOpenGLContextGroup::metaObject
+24 (int (*)(...))QOpenGLContextGroup::qt_metacast
+32 (int (*)(...))QOpenGLContextGroup::qt_metacall
+40 (int (*)(...))QOpenGLContextGroup::~QOpenGLContextGroup
+48 (int (*)(...))QOpenGLContextGroup::~QOpenGLContextGroup
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QOpenGLContextGroup
+ size=16 align=8
+ base size=16 base align=8
+QOpenGLContextGroup (0x0x7f784a9c2208) 0
+ vptr=((& QOpenGLContextGroup::_ZTV19QOpenGLContextGroup) + 16)
+ QObject (0x0x7f784a9bb480) 0
+ primary-for QOpenGLContextGroup (0x0x7f784a9c2208)
+
+Class QOpenGLContext::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QOpenGLContext::QPrivateSignal (0x0x7f784a9bb720) 0 empty
+
+Vtable for QOpenGLContext
+QOpenGLContext::_ZTV14QOpenGLContext: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QOpenGLContext)
+16 (int (*)(...))QOpenGLContext::metaObject
+24 (int (*)(...))QOpenGLContext::qt_metacast
+32 (int (*)(...))QOpenGLContext::qt_metacall
+40 (int (*)(...))QOpenGLContext::~QOpenGLContext
+48 (int (*)(...))QOpenGLContext::~QOpenGLContext
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QOpenGLContext
+ size=16 align=8
+ base size=16 base align=8
+QOpenGLContext (0x0x7f784a9c2270) 0
+ vptr=((& QOpenGLContext::_ZTV14QOpenGLContext) + 16)
+ QObject (0x0x7f784a9bb6c0) 0
+ primary-for QOpenGLContext (0x0x7f784a9c2270)
+
+Class QOpenGLDebugMessage
+ size=8 align=8
+ base size=8 base align=8
+QOpenGLDebugMessage (0x0x7f784a9bb960) 0
+
+Class QOpenGLDebugLogger::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QOpenGLDebugLogger::QPrivateSignal (0x0x7f784a6d3f00) 0 empty
+
+Vtable for QOpenGLDebugLogger
+QOpenGLDebugLogger::_ZTV18QOpenGLDebugLogger: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QOpenGLDebugLogger)
+16 (int (*)(...))QOpenGLDebugLogger::metaObject
+24 (int (*)(...))QOpenGLDebugLogger::qt_metacast
+32 (int (*)(...))QOpenGLDebugLogger::qt_metacall
+40 (int (*)(...))QOpenGLDebugLogger::~QOpenGLDebugLogger
+48 (int (*)(...))QOpenGLDebugLogger::~QOpenGLDebugLogger
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QOpenGLDebugLogger
+ size=16 align=8
+ base size=16 base align=8
+QOpenGLDebugLogger (0x0x7f784a6ae4e0) 0
+ vptr=((& QOpenGLDebugLogger::_ZTV18QOpenGLDebugLogger) + 16)
+ QObject (0x0x7f784a6d3ea0) 0
+ primary-for QOpenGLDebugLogger (0x0x7f784a6ae4e0)
+
+Class QOpenGLFunctions
+ size=8 align=8
+ base size=8 base align=8
+QOpenGLFunctions (0x0x7f784a7483c0) 0
+
+Class QOpenGLFunctionsPrivate::Functions
+ size=1152 align=8
+ base size=1152 base align=8
+QOpenGLFunctionsPrivate::Functions (0x0x7f784a748d20) 0
+
+Class QOpenGLFunctionsPrivate
+ size=1152 align=8
+ base size=1152 base align=8
+QOpenGLFunctionsPrivate (0x0x7f784a748cc0) 0
+
+Class QOpenGLExtraFunctions
+ size=8 align=8
+ base size=8 base align=8
+QOpenGLExtraFunctions (0x0x7f784dd0a3a8) 0
+ QOpenGLFunctions (0x0x7f7856d60900) 0
+
+Class QOpenGLExtraFunctionsPrivate::Functions
+ size=1728 align=8
+ base size=1728 base align=8
+QOpenGLExtraFunctionsPrivate::Functions (0x0x7f7856da11e0) 0
+
+Class QOpenGLExtraFunctionsPrivate
+ size=2880 align=8
+ base size=2880 base align=8
+QOpenGLExtraFunctionsPrivate (0x0x7f784dd0a410) 0
+ QOpenGLFunctionsPrivate (0x0x7f7856d7e8a0) 0
+
+Vtable for QOpenGLFramebufferObject
+QOpenGLFramebufferObject::_ZTV24QOpenGLFramebufferObject: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI24QOpenGLFramebufferObject)
+16 (int (*)(...))QOpenGLFramebufferObject::~QOpenGLFramebufferObject
+24 (int (*)(...))QOpenGLFramebufferObject::~QOpenGLFramebufferObject
+
+Class QOpenGLFramebufferObject
+ size=16 align=8
+ base size=16 base align=8
+QOpenGLFramebufferObject (0x0x7f7854bf31e0) 0
+ vptr=((& QOpenGLFramebufferObject::_ZTV24QOpenGLFramebufferObject) + 16)
+
+Class QOpenGLFramebufferObjectFormat
+ size=8 align=8
+ base size=8 base align=8
+QOpenGLFramebufferObjectFormat (0x0x7f7854c0e300) 0
+
+Vtable for QOpenGLPaintDevice
+QOpenGLPaintDevice::_ZTV18QOpenGLPaintDevice: 11 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QOpenGLPaintDevice)
+16 (int (*)(...))QOpenGLPaintDevice::~QOpenGLPaintDevice
+24 (int (*)(...))QOpenGLPaintDevice::~QOpenGLPaintDevice
+32 (int (*)(...))QOpenGLPaintDevice::devType
+40 (int (*)(...))QOpenGLPaintDevice::paintEngine
+48 (int (*)(...))QOpenGLPaintDevice::metric
+56 (int (*)(...))QPaintDevice::initPainter
+64 (int (*)(...))QPaintDevice::redirected
+72 (int (*)(...))QPaintDevice::sharedPainter
+80 (int (*)(...))QOpenGLPaintDevice::ensureActiveTarget
+
+Class QOpenGLPaintDevice
+ size=32 align=8
+ base size=32 base align=8
+QOpenGLPaintDevice (0x0x7f7854d6db60) 0
+ vptr=((& QOpenGLPaintDevice::_ZTV18QOpenGLPaintDevice) + 16)
+ QPaintDevice (0x0x7f7854c0e360) 0
+ primary-for QOpenGLPaintDevice (0x0x7f7854d6db60)
+
+Class QOpenGLPixelTransferOptions
+ size=8 align=8
+ base size=8 base align=8
+QOpenGLPixelTransferOptions (0x0x7f7854a26540) 0
+
+Class QOpenGLShader::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QOpenGLShader::QPrivateSignal (0x0x7f7854553d80) 0 empty
+
+Vtable for QOpenGLShader
+QOpenGLShader::_ZTV13QOpenGLShader: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QOpenGLShader)
+16 (int (*)(...))QOpenGLShader::metaObject
+24 (int (*)(...))QOpenGLShader::qt_metacast
+32 (int (*)(...))QOpenGLShader::qt_metacall
+40 (int (*)(...))QOpenGLShader::~QOpenGLShader
+48 (int (*)(...))QOpenGLShader::~QOpenGLShader
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QOpenGLShader
+ size=16 align=8
+ base size=16 base align=8
+QOpenGLShader (0x0x7f78545c9b60) 0
+ vptr=((& QOpenGLShader::_ZTV13QOpenGLShader) + 16)
+ QObject (0x0x7f7854553b40) 0
+ primary-for QOpenGLShader (0x0x7f78545c9b60)
+
+Class QOpenGLShaderProgram::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QOpenGLShaderProgram::QPrivateSignal (0x0x7f785458ac00) 0 empty
+
+Vtable for QOpenGLShaderProgram
+QOpenGLShaderProgram::_ZTV20QOpenGLShaderProgram: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QOpenGLShaderProgram)
+16 (int (*)(...))QOpenGLShaderProgram::metaObject
+24 (int (*)(...))QOpenGLShaderProgram::qt_metacast
+32 (int (*)(...))QOpenGLShaderProgram::qt_metacall
+40 (int (*)(...))QOpenGLShaderProgram::~QOpenGLShaderProgram
+48 (int (*)(...))QOpenGLShaderProgram::~QOpenGLShaderProgram
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QOpenGLShaderProgram::link
+
+Class QOpenGLShaderProgram
+ size=16 align=8
+ base size=16 base align=8
+QOpenGLShaderProgram (0x0x7f78541df138) 0
+ vptr=((& QOpenGLShaderProgram::_ZTV20QOpenGLShaderProgram) + 16)
+ QObject (0x0x7f785458aba0) 0
+ primary-for QOpenGLShaderProgram (0x0x7f78541df138)
+
+Class QOpenGLTexture
+ size=8 align=8
+ base size=8 base align=8
+QOpenGLTexture (0x0x7f78545a92a0) 0
+
+Class QOpenGLTextureBlitter
+ size=8 align=8
+ base size=8 base align=8
+QOpenGLTextureBlitter (0x0x7f7853cbfd80) 0
+
+Class QOpenGLTimerQuery::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QOpenGLTimerQuery::QPrivateSignal (0x0x7f7853d47ea0) 0 empty
+
+Vtable for QOpenGLTimerQuery
+QOpenGLTimerQuery::_ZTV17QOpenGLTimerQuery: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QOpenGLTimerQuery)
+16 (int (*)(...))QOpenGLTimerQuery::metaObject
+24 (int (*)(...))QOpenGLTimerQuery::qt_metacast
+32 (int (*)(...))QOpenGLTimerQuery::qt_metacall
+40 (int (*)(...))QOpenGLTimerQuery::~QOpenGLTimerQuery
+48 (int (*)(...))QOpenGLTimerQuery::~QOpenGLTimerQuery
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QOpenGLTimerQuery
+ size=16 align=8
+ base size=16 base align=8
+QOpenGLTimerQuery (0x0x7f785414fb60) 0
+ vptr=((& QOpenGLTimerQuery::_ZTV17QOpenGLTimerQuery) + 16)
+ QObject (0x0x7f7853d47e40) 0
+ primary-for QOpenGLTimerQuery (0x0x7f785414fb60)
+
+Class QOpenGLTimeMonitor::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QOpenGLTimeMonitor::QPrivateSignal (0x0x7f78539cca20) 0 empty
+
+Vtable for QOpenGLTimeMonitor
+QOpenGLTimeMonitor::_ZTV18QOpenGLTimeMonitor: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QOpenGLTimeMonitor)
+16 (int (*)(...))QOpenGLTimeMonitor::metaObject
+24 (int (*)(...))QOpenGLTimeMonitor::qt_metacast
+32 (int (*)(...))QOpenGLTimeMonitor::qt_metacall
+40 (int (*)(...))QOpenGLTimeMonitor::~QOpenGLTimeMonitor
+48 (int (*)(...))QOpenGLTimeMonitor::~QOpenGLTimeMonitor
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QOpenGLTimeMonitor
+ size=16 align=8
+ base size=16 base align=8
+QOpenGLTimeMonitor (0x0x7f7853c441a0) 0
+ vptr=((& QOpenGLTimeMonitor::_ZTV18QOpenGLTimeMonitor) + 16)
+ QObject (0x0x7f78539cc9c0) 0
+ primary-for QOpenGLTimeMonitor (0x0x7f7853c441a0)
+
+Class QOpenGLVertexArrayObject::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QOpenGLVertexArrayObject::QPrivateSignal (0x0x7f78539ccf00) 0 empty
+
+Class QOpenGLVertexArrayObject::Binder
+ size=8 align=8
+ base size=8 base align=8
+QOpenGLVertexArrayObject::Binder (0x0x7f7853568840) 0
+
+Vtable for QOpenGLVertexArrayObject
+QOpenGLVertexArrayObject::_ZTV24QOpenGLVertexArrayObject: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI24QOpenGLVertexArrayObject)
+16 (int (*)(...))QOpenGLVertexArrayObject::metaObject
+24 (int (*)(...))QOpenGLVertexArrayObject::qt_metacast
+32 (int (*)(...))QOpenGLVertexArrayObject::qt_metacall
+40 (int (*)(...))QOpenGLVertexArrayObject::~QOpenGLVertexArrayObject
+48 (int (*)(...))QOpenGLVertexArrayObject::~QOpenGLVertexArrayObject
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QOpenGLVertexArrayObject
+ size=16 align=8
+ base size=16 base align=8
+QOpenGLVertexArrayObject (0x0x7f7853c44208) 0
+ vptr=((& QOpenGLVertexArrayObject::_ZTV24QOpenGLVertexArrayObject) + 16)
+ QObject (0x0x7f78539ccea0) 0
+ primary-for QOpenGLVertexArrayObject (0x0x7f7853c44208)
+
+Class QPaintDeviceWindow::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QPaintDeviceWindow::QPrivateSignal (0x0x7f78535c6de0) 0 empty
+
+Vtable for QPaintDeviceWindow
+QPaintDeviceWindow::_ZTV18QPaintDeviceWindow: 58 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QPaintDeviceWindow)
+16 (int (*)(...))QPaintDeviceWindow::metaObject
+24 (int (*)(...))QPaintDeviceWindow::qt_metacast
+32 (int (*)(...))QPaintDeviceWindow::qt_metacall
+40 (int (*)(...))QPaintDeviceWindow::~QPaintDeviceWindow
+48 (int (*)(...))QPaintDeviceWindow::~QPaintDeviceWindow
+56 (int (*)(...))QPaintDeviceWindow::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWindow::surfaceType
+120 (int (*)(...))QWindow::format
+128 (int (*)(...))QWindow::size
+136 (int (*)(...))QWindow::accessibleRoot
+144 (int (*)(...))QWindow::focusObject
+152 (int (*)(...))QPaintDeviceWindow::exposeEvent
+160 (int (*)(...))QWindow::resizeEvent
+168 (int (*)(...))QWindow::moveEvent
+176 (int (*)(...))QWindow::focusInEvent
+184 (int (*)(...))QWindow::focusOutEvent
+192 (int (*)(...))QWindow::showEvent
+200 (int (*)(...))QWindow::hideEvent
+208 (int (*)(...))QWindow::keyPressEvent
+216 (int (*)(...))QWindow::keyReleaseEvent
+224 (int (*)(...))QWindow::mousePressEvent
+232 (int (*)(...))QWindow::mouseReleaseEvent
+240 (int (*)(...))QWindow::mouseDoubleClickEvent
+248 (int (*)(...))QWindow::mouseMoveEvent
+256 (int (*)(...))QWindow::wheelEvent
+264 (int (*)(...))QWindow::touchEvent
+272 (int (*)(...))QWindow::tabletEvent
+280 (int (*)(...))QWindow::nativeEvent
+288 (int (*)(...))QWindow::surfaceHandle
+296 (int (*)(...))QPaintDeviceWindow::paintEvent
+304 (int (*)(...))QPaintDeviceWindow::metric
+312 (int (*)(...))QPaintDeviceWindow::paintEngine
+320 (int (*)(...))-16
+328 (int (*)(...))(& _ZTI18QPaintDeviceWindow)
+336 (int (*)(...))QPaintDeviceWindow::_ZThn16_N18QPaintDeviceWindowD1Ev
+344 (int (*)(...))QPaintDeviceWindow::_ZThn16_N18QPaintDeviceWindowD0Ev
+352 (int (*)(...))QWindow::_ZThn16_NK7QWindow6formatEv
+360 (int (*)(...))QWindow::_ZThn16_NK7QWindow13surfaceHandleEv
+368 (int (*)(...))QWindow::_ZThn16_NK7QWindow11surfaceTypeEv
+376 (int (*)(...))QWindow::_ZThn16_NK7QWindow4sizeEv
+384 (int (*)(...))-40
+392 (int (*)(...))(& _ZTI18QPaintDeviceWindow)
+400 (int (*)(...))QPaintDeviceWindow::_ZThn40_N18QPaintDeviceWindowD1Ev
+408 (int (*)(...))QPaintDeviceWindow::_ZThn40_N18QPaintDeviceWindowD0Ev
+416 (int (*)(...))QPaintDevice::devType
+424 (int (*)(...))QPaintDeviceWindow::_ZThn40_NK18QPaintDeviceWindow11paintEngineEv
+432 (int (*)(...))QPaintDeviceWindow::_ZThn40_NK18QPaintDeviceWindow6metricEN12QPaintDevice17PaintDeviceMetricE
+440 (int (*)(...))QPaintDevice::initPainter
+448 (int (*)(...))QPaintDevice::redirected
+456 (int (*)(...))QPaintDevice::sharedPainter
+
+Class QPaintDeviceWindow
+ size=64 align=8
+ base size=64 base align=8
+QPaintDeviceWindow (0x0x7f7856ed9d20) 0
+ vptr=((& QPaintDeviceWindow::_ZTV18QPaintDeviceWindow) + 16)
+ QWindow (0x0x7f7856ed9d90) 0
+ primary-for QPaintDeviceWindow (0x0x7f7856ed9d20)
+ QObject (0x0x7f78535c6c00) 0
+ primary-for QWindow (0x0x7f7856ed9d90)
+ QSurface (0x0x7f78535c6c60) 16
+ vptr=((& QPaintDeviceWindow::_ZTV18QPaintDeviceWindow) + 336)
+ QPaintDevice (0x0x7f78535c6d80) 40
+ vptr=((& QPaintDeviceWindow::_ZTV18QPaintDeviceWindow) + 400)
+
+Class QOpenGLWindow::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QOpenGLWindow::QPrivateSignal (0x0x7f7853348480) 0 empty
+
+Vtable for QOpenGLWindow
+QOpenGLWindow::_ZTV13QOpenGLWindow: 64 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QOpenGLWindow)
+16 (int (*)(...))QOpenGLWindow::metaObject
+24 (int (*)(...))QOpenGLWindow::qt_metacast
+32 (int (*)(...))QOpenGLWindow::qt_metacall
+40 (int (*)(...))QOpenGLWindow::~QOpenGLWindow
+48 (int (*)(...))QOpenGLWindow::~QOpenGLWindow
+56 (int (*)(...))QPaintDeviceWindow::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWindow::surfaceType
+120 (int (*)(...))QWindow::format
+128 (int (*)(...))QWindow::size
+136 (int (*)(...))QWindow::accessibleRoot
+144 (int (*)(...))QWindow::focusObject
+152 (int (*)(...))QPaintDeviceWindow::exposeEvent
+160 (int (*)(...))QOpenGLWindow::resizeEvent
+168 (int (*)(...))QWindow::moveEvent
+176 (int (*)(...))QWindow::focusInEvent
+184 (int (*)(...))QWindow::focusOutEvent
+192 (int (*)(...))QWindow::showEvent
+200 (int (*)(...))QWindow::hideEvent
+208 (int (*)(...))QWindow::keyPressEvent
+216 (int (*)(...))QWindow::keyReleaseEvent
+224 (int (*)(...))QWindow::mousePressEvent
+232 (int (*)(...))QWindow::mouseReleaseEvent
+240 (int (*)(...))QWindow::mouseDoubleClickEvent
+248 (int (*)(...))QWindow::mouseMoveEvent
+256 (int (*)(...))QWindow::wheelEvent
+264 (int (*)(...))QWindow::touchEvent
+272 (int (*)(...))QWindow::tabletEvent
+280 (int (*)(...))QWindow::nativeEvent
+288 (int (*)(...))QWindow::surfaceHandle
+296 (int (*)(...))QOpenGLWindow::paintEvent
+304 (int (*)(...))QOpenGLWindow::metric
+312 (int (*)(...))QPaintDeviceWindow::paintEngine
+320 (int (*)(...))QOpenGLWindow::initializeGL
+328 (int (*)(...))QOpenGLWindow::resizeGL
+336 (int (*)(...))QOpenGLWindow::paintGL
+344 (int (*)(...))QOpenGLWindow::paintUnderGL
+352 (int (*)(...))QOpenGLWindow::paintOverGL
+360 (int (*)(...))QOpenGLWindow::redirected
+368 (int (*)(...))-16
+376 (int (*)(...))(& _ZTI13QOpenGLWindow)
+384 (int (*)(...))QOpenGLWindow::_ZThn16_N13QOpenGLWindowD1Ev
+392 (int (*)(...))QOpenGLWindow::_ZThn16_N13QOpenGLWindowD0Ev
+400 (int (*)(...))QWindow::_ZThn16_NK7QWindow6formatEv
+408 (int (*)(...))QWindow::_ZThn16_NK7QWindow13surfaceHandleEv
+416 (int (*)(...))QWindow::_ZThn16_NK7QWindow11surfaceTypeEv
+424 (int (*)(...))QWindow::_ZThn16_NK7QWindow4sizeEv
+432 (int (*)(...))-40
+440 (int (*)(...))(& _ZTI13QOpenGLWindow)
+448 (int (*)(...))QOpenGLWindow::_ZThn40_N13QOpenGLWindowD1Ev
+456 (int (*)(...))QOpenGLWindow::_ZThn40_N13QOpenGLWindowD0Ev
+464 (int (*)(...))QPaintDevice::devType
+472 (int (*)(...))QPaintDeviceWindow::_ZThn40_NK18QPaintDeviceWindow11paintEngineEv
+480 (int (*)(...))QOpenGLWindow::_ZThn40_NK13QOpenGLWindow6metricEN12QPaintDevice17PaintDeviceMetricE
+488 (int (*)(...))QPaintDevice::initPainter
+496 (int (*)(...))QOpenGLWindow::_ZThn40_NK13QOpenGLWindow10redirectedEP6QPoint
+504 (int (*)(...))QPaintDevice::sharedPainter
+
+Class QOpenGLWindow
+ size=64 align=8
+ base size=64 base align=8
+QOpenGLWindow (0x0x7f7853c447b8) 0
+ vptr=((& QOpenGLWindow::_ZTV13QOpenGLWindow) + 16)
+ QPaintDeviceWindow (0x0x7f7856ed9f50) 0
+ primary-for QOpenGLWindow (0x0x7f7853c447b8)
+ QWindow (0x0x7f78578ad000) 0
+ primary-for QPaintDeviceWindow (0x0x7f7856ed9f50)
+ QObject (0x0x7f7853239840) 0
+ primary-for QWindow (0x0x7f78578ad000)
+ QSurface (0x0x7f78532398a0) 16
+ vptr=((& QOpenGLWindow::_ZTV13QOpenGLWindow) + 384)
+ QPaintDevice (0x0x7f7853348420) 40
+ vptr=((& QOpenGLWindow::_ZTV13QOpenGLWindow) + 448)
+
+Class QPageSize
+ size=8 align=8
+ base size=8 base align=8
+QPageSize (0x0x7f7853348780) 0
+
+Class QPageLayout
+ size=8 align=8
+ base size=8 base align=8
+QPageLayout (0x0x7f7851f1c8a0) 0
+
+Class QPagedPaintDevice::Margins
+ size=32 align=8
+ base size=32 base align=8
+QPagedPaintDevice::Margins (0x0x7f7850e7c000) 0
+
+Vtable for QPagedPaintDevice
+QPagedPaintDevice::_ZTV17QPagedPaintDevice: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QPagedPaintDevice)
+16 0
+24 0
+32 (int (*)(...))QPaintDevice::devType
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))QPaintDevice::metric
+56 (int (*)(...))QPaintDevice::initPainter
+64 (int (*)(...))QPaintDevice::redirected
+72 (int (*)(...))QPaintDevice::sharedPainter
+80 (int (*)(...))__cxa_pure_virtual
+88 (int (*)(...))QPagedPaintDevice::setPageSize
+96 (int (*)(...))QPagedPaintDevice::setPageSizeMM
+104 (int (*)(...))QPagedPaintDevice::setMargins
+
+Class QPagedPaintDevice
+ size=32 align=8
+ base size=32 base align=8
+QPagedPaintDevice (0x0x7f7850dc7f08) 0
+ vptr=((& QPagedPaintDevice::_ZTV17QPagedPaintDevice) + 16)
+ QPaintDevice (0x0x7f7850e5af60) 0
+ primary-for QPagedPaintDevice (0x0x7f7850dc7f08)
+
+Class QPainter::PixmapFragment
+ size=80 align=8
+ base size=80 base align=8
+QPainter::PixmapFragment (0x0x7f7850e7c7e0) 0
+
+Class QPainter
+ size=8 align=8
+ base size=8 base align=8
+QPainter (0x0x7f7850e7c780) 0
+
+Class QTextItem
+ size=1 align=1
+ base size=0 base align=1
+QTextItem (0x0x7f7850131840) 0 empty
+
+Vtable for QPaintEngine
+QPaintEngine::_ZTV12QPaintEngine: 24 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QPaintEngine)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))QPaintEngine::drawRects
+64 (int (*)(...))QPaintEngine::drawRects
+72 (int (*)(...))QPaintEngine::drawLines
+80 (int (*)(...))QPaintEngine::drawLines
+88 (int (*)(...))QPaintEngine::drawEllipse
+96 (int (*)(...))QPaintEngine::drawEllipse
+104 (int (*)(...))QPaintEngine::drawPath
+112 (int (*)(...))QPaintEngine::drawPoints
+120 (int (*)(...))QPaintEngine::drawPoints
+128 (int (*)(...))QPaintEngine::drawPolygon
+136 (int (*)(...))QPaintEngine::drawPolygon
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))QPaintEngine::drawTextItem
+160 (int (*)(...))QPaintEngine::drawTiledPixmap
+168 (int (*)(...))QPaintEngine::drawImage
+176 (int (*)(...))QPaintEngine::coordinateOffset
+184 (int (*)(...))__cxa_pure_virtual
+
+Class QPaintEngine
+ size=32 align=8
+ base size=32 base align=8
+QPaintEngine (0x0x7f784fb563c0) 0
+ vptr=((& QPaintEngine::_ZTV12QPaintEngine) + 16)
+
+Class QPaintEngineState
+ size=4 align=4
+ base size=4 base align=4
+QPaintEngineState (0x0x7f784f7d9c60) 0
+
+Class QPainterPath::Element
+ size=24 align=8
+ base size=24 base align=8
+QPainterPath::Element (0x0x7f784f6ba060) 0
+
+Class QPainterPath
+ size=8 align=8
+ base size=8 base align=8
+QPainterPath (0x0x7f784f69fe40) 0
+
+Class QPainterPathStroker
+ size=8 align=8
+ base size=8 base align=8
+QPainterPathStroker (0x0x7f784d27f180) 0
+
+Class QPdfWriter::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QPdfWriter::QPrivateSignal (0x0x7f784d2e4e40) 0 empty
+
+Vtable for QPdfWriter
+QPdfWriter::_ZTV10QPdfWriter: 34 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QPdfWriter)
+16 (int (*)(...))QPdfWriter::metaObject
+24 (int (*)(...))QPdfWriter::qt_metacast
+32 (int (*)(...))QPdfWriter::qt_metacall
+40 (int (*)(...))QPdfWriter::~QPdfWriter
+48 (int (*)(...))QPdfWriter::~QPdfWriter
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QPdfWriter::newPage
+120 (int (*)(...))QPdfWriter::setPageSize
+128 (int (*)(...))QPdfWriter::setPageSizeMM
+136 (int (*)(...))QPdfWriter::setMargins
+144 (int (*)(...))QPdfWriter::paintEngine
+152 (int (*)(...))QPdfWriter::metric
+160 (int (*)(...))-16
+168 (int (*)(...))(& _ZTI10QPdfWriter)
+176 (int (*)(...))QPdfWriter::_ZThn16_N10QPdfWriterD1Ev
+184 (int (*)(...))QPdfWriter::_ZThn16_N10QPdfWriterD0Ev
+192 (int (*)(...))QPaintDevice::devType
+200 (int (*)(...))QPdfWriter::_ZThn16_NK10QPdfWriter11paintEngineEv
+208 (int (*)(...))QPdfWriter::_ZThn16_NK10QPdfWriter6metricEN12QPaintDevice17PaintDeviceMetricE
+216 (int (*)(...))QPaintDevice::initPainter
+224 (int (*)(...))QPaintDevice::redirected
+232 (int (*)(...))QPaintDevice::sharedPainter
+240 (int (*)(...))QPdfWriter::_ZThn16_N10QPdfWriter7newPageEv
+248 (int (*)(...))QPdfWriter::_ZThn16_N10QPdfWriter11setPageSizeEN17QPagedPaintDevice8PageSizeE
+256 (int (*)(...))QPdfWriter::_ZThn16_N10QPdfWriter13setPageSizeMMERK6QSizeF
+264 (int (*)(...))QPdfWriter::_ZThn16_N10QPdfWriter10setMarginsERKN17QPagedPaintDevice7MarginsE
+
+Class QPdfWriter
+ size=48 align=8
+ base size=48 base align=8
+QPdfWriter (0x0x7f7856309620) 0
+ vptr=((& QPdfWriter::_ZTV10QPdfWriter) + 16)
+ QObject (0x0x7f784d2e4d20) 0
+ primary-for QPdfWriter (0x0x7f7856309620)
+ QPagedPaintDevice (0x0x7f784d52c5b0) 16
+ vptr=((& QPdfWriter::_ZTV10QPdfWriter) + 176)
+ QPaintDevice (0x0x7f784d2e4d80) 16
+ primary-for QPagedPaintDevice (0x0x7f784d52c5b0)
+
+Vtable for QPicture
+QPicture::_ZTV8QPicture: 11 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI8QPicture)
+16 (int (*)(...))QPicture::~QPicture
+24 (int (*)(...))QPicture::~QPicture
+32 (int (*)(...))QPicture::devType
+40 (int (*)(...))QPicture::paintEngine
+48 (int (*)(...))QPicture::metric
+56 (int (*)(...))QPaintDevice::initPainter
+64 (int (*)(...))QPaintDevice::redirected
+72 (int (*)(...))QPaintDevice::sharedPainter
+80 (int (*)(...))QPicture::setData
+
+Class QPicture
+ size=32 align=8
+ base size=32 base align=8
+QPicture (0x0x7f784d548000) 0
+ vptr=((& QPicture::_ZTV8QPicture) + 16)
+ QPaintDevice (0x0x7f784d348540) 0
+ primary-for QPicture (0x0x7f784d548000)
+
+Class QPictureIO
+ size=8 align=8
+ base size=8 base align=8
+QPictureIO (0x0x7f784c4130c0) 0
+
+Class QPictureFormatPlugin::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QPictureFormatPlugin::QPrivateSignal (0x0x7f784c413a80) 0 empty
+
+Vtable for QPictureFormatPlugin
+QPictureFormatPlugin::_ZTV20QPictureFormatPlugin: 17 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QPictureFormatPlugin)
+16 (int (*)(...))QPictureFormatPlugin::metaObject
+24 (int (*)(...))QPictureFormatPlugin::qt_metacast
+32 (int (*)(...))QPictureFormatPlugin::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QPictureFormatPlugin::loadPicture
+120 (int (*)(...))QPictureFormatPlugin::savePicture
+128 (int (*)(...))__cxa_pure_virtual
+
+Class QPictureFormatPlugin
+ size=16 align=8
+ base size=16 base align=8
+QPictureFormatPlugin (0x0x7f784c4e4bc8) 0
+ vptr=((& QPictureFormatPlugin::_ZTV20QPictureFormatPlugin) + 16)
+ QObject (0x0x7f784c413a20) 0
+ primary-for QPictureFormatPlugin (0x0x7f784c4e4bc8)
+
+Class QPixmapCache::Key
+ size=8 align=8
+ base size=8 base align=8
+QPixmapCache::Key (0x0x7f784c431000) 0
+
+Class QPixmapCache
+ size=1 align=1
+ base size=0 base align=1
+QPixmapCache (0x0x7f784c413f60) 0 empty
+
+Class QRasterWindow::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QRasterWindow::QPrivateSignal (0x0x7f784b929720) 0 empty
+
+Vtable for QRasterWindow
+QRasterWindow::_ZTV13QRasterWindow: 59 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QRasterWindow)
+16 (int (*)(...))QRasterWindow::metaObject
+24 (int (*)(...))QRasterWindow::qt_metacast
+32 (int (*)(...))QRasterWindow::qt_metacall
+40 (int (*)(...))QRasterWindow::~QRasterWindow
+48 (int (*)(...))QRasterWindow::~QRasterWindow
+56 (int (*)(...))QPaintDeviceWindow::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWindow::surfaceType
+120 (int (*)(...))QWindow::format
+128 (int (*)(...))QWindow::size
+136 (int (*)(...))QWindow::accessibleRoot
+144 (int (*)(...))QWindow::focusObject
+152 (int (*)(...))QPaintDeviceWindow::exposeEvent
+160 (int (*)(...))QWindow::resizeEvent
+168 (int (*)(...))QWindow::moveEvent
+176 (int (*)(...))QWindow::focusInEvent
+184 (int (*)(...))QWindow::focusOutEvent
+192 (int (*)(...))QWindow::showEvent
+200 (int (*)(...))QWindow::hideEvent
+208 (int (*)(...))QWindow::keyPressEvent
+216 (int (*)(...))QWindow::keyReleaseEvent
+224 (int (*)(...))QWindow::mousePressEvent
+232 (int (*)(...))QWindow::mouseReleaseEvent
+240 (int (*)(...))QWindow::mouseDoubleClickEvent
+248 (int (*)(...))QWindow::mouseMoveEvent
+256 (int (*)(...))QWindow::wheelEvent
+264 (int (*)(...))QWindow::touchEvent
+272 (int (*)(...))QWindow::tabletEvent
+280 (int (*)(...))QWindow::nativeEvent
+288 (int (*)(...))QWindow::surfaceHandle
+296 (int (*)(...))QPaintDeviceWindow::paintEvent
+304 (int (*)(...))QRasterWindow::metric
+312 (int (*)(...))QPaintDeviceWindow::paintEngine
+320 (int (*)(...))QRasterWindow::redirected
+328 (int (*)(...))-16
+336 (int (*)(...))(& _ZTI13QRasterWindow)
+344 (int (*)(...))QRasterWindow::_ZThn16_N13QRasterWindowD1Ev
+352 (int (*)(...))QRasterWindow::_ZThn16_N13QRasterWindowD0Ev
+360 (int (*)(...))QWindow::_ZThn16_NK7QWindow6formatEv
+368 (int (*)(...))QWindow::_ZThn16_NK7QWindow13surfaceHandleEv
+376 (int (*)(...))QWindow::_ZThn16_NK7QWindow11surfaceTypeEv
+384 (int (*)(...))QWindow::_ZThn16_NK7QWindow4sizeEv
+392 (int (*)(...))-40
+400 (int (*)(...))(& _ZTI13QRasterWindow)
+408 (int (*)(...))QRasterWindow::_ZThn40_N13QRasterWindowD1Ev
+416 (int (*)(...))QRasterWindow::_ZThn40_N13QRasterWindowD0Ev
+424 (int (*)(...))QPaintDevice::devType
+432 (int (*)(...))QPaintDeviceWindow::_ZThn40_NK18QPaintDeviceWindow11paintEngineEv
+440 (int (*)(...))QRasterWindow::_ZThn40_NK13QRasterWindow6metricEN12QPaintDevice17PaintDeviceMetricE
+448 (int (*)(...))QPaintDevice::initPainter
+456 (int (*)(...))QRasterWindow::_ZThn40_NK13QRasterWindow10redirectedEP6QPoint
+464 (int (*)(...))QPaintDevice::sharedPainter
+
+Class QRasterWindow
+ size=64 align=8
+ base size=64 base align=8
+QRasterWindow (0x0x7f784b579a90) 0
+ vptr=((& QRasterWindow::_ZTV13QRasterWindow) + 16)
+ QPaintDeviceWindow (0x0x7f7855722930) 0
+ primary-for QRasterWindow (0x0x7f784b579a90)
+ QWindow (0x0x7f78557229a0) 0
+ primary-for QPaintDeviceWindow (0x0x7f7855722930)
+ QObject (0x0x7f784b90ff00) 0
+ primary-for QWindow (0x0x7f78557229a0)
+ QSurface (0x0x7f784b90ff60) 16
+ vptr=((& QRasterWindow::_ZTV13QRasterWindow) + 344)
+ QPaintDevice (0x0x7f784b929060) 40
+ vptr=((& QRasterWindow::_ZTV13QRasterWindow) + 408)
+
+Class QScreen::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QScreen::QPrivateSignal (0x0x7f784b94db40) 0 empty
+
+Vtable for QScreen
+QScreen::_ZTV7QScreen: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI7QScreen)
+16 (int (*)(...))QScreen::metaObject
+24 (int (*)(...))QScreen::qt_metacast
+32 (int (*)(...))QScreen::qt_metacall
+40 (int (*)(...))QScreen::~QScreen
+48 (int (*)(...))QScreen::~QScreen
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QScreen
+ size=16 align=8
+ base size=16 base align=8
+QScreen (0x0x7f784b2c8d00) 0
+ vptr=((& QScreen::_ZTV7QScreen) + 16)
+ QObject (0x0x7f784b94dae0) 0
+ primary-for QScreen (0x0x7f784b2c8d00)
+
+Class QSessionManager::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSessionManager::QPrivateSignal (0x0x7f784b96e720) 0 empty
+
+Vtable for QSessionManager
+QSessionManager::_ZTV15QSessionManager: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QSessionManager)
+16 (int (*)(...))QSessionManager::metaObject
+24 (int (*)(...))QSessionManager::qt_metacast
+32 (int (*)(...))QSessionManager::qt_metacall
+40 (int (*)(...))QSessionManager::~QSessionManager
+48 (int (*)(...))QSessionManager::~QSessionManager
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QSessionManager
+ size=16 align=8
+ base size=16 base align=8
+QSessionManager (0x0x7f784afdd068) 0
+ vptr=((& QSessionManager::_ZTV15QSessionManager) + 16)
+ QObject (0x0x7f784b96e6c0) 0
+ primary-for QSessionManager (0x0x7f784afdd068)
+
+Vtable for QStandardItem
+QStandardItem::_ZTV13QStandardItem: 11 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QStandardItem)
+16 (int (*)(...))QStandardItem::~QStandardItem
+24 (int (*)(...))QStandardItem::~QStandardItem
+32 (int (*)(...))QStandardItem::data
+40 (int (*)(...))QStandardItem::setData
+48 (int (*)(...))QStandardItem::clone
+56 (int (*)(...))QStandardItem::type
+64 (int (*)(...))QStandardItem::read
+72 (int (*)(...))QStandardItem::write
+80 (int (*)(...))QStandardItem::operator<
+
+Class QStandardItem
+ size=16 align=8
+ base size=16 base align=8
+QStandardItem (0x0x7f784b99aa20) 0
+ vptr=((& QStandardItem::_ZTV13QStandardItem) + 16)
+
+Class QStandardItemModel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QStandardItemModel::QPrivateSignal (0x0x7f784b7750c0) 0 empty
+
+Vtable for QStandardItemModel
+QStandardItemModel::_ZTV18QStandardItemModel: 48 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QStandardItemModel)
+16 (int (*)(...))QStandardItemModel::metaObject
+24 (int (*)(...))QStandardItemModel::qt_metacast
+32 (int (*)(...))QStandardItemModel::qt_metacall
+40 (int (*)(...))QStandardItemModel::~QStandardItemModel
+48 (int (*)(...))QStandardItemModel::~QStandardItemModel
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QStandardItemModel::index
+120 (int (*)(...))QStandardItemModel::parent
+128 (int (*)(...))QStandardItemModel::sibling
+136 (int (*)(...))QStandardItemModel::rowCount
+144 (int (*)(...))QStandardItemModel::columnCount
+152 (int (*)(...))QStandardItemModel::hasChildren
+160 (int (*)(...))QStandardItemModel::data
+168 (int (*)(...))QStandardItemModel::setData
+176 (int (*)(...))QStandardItemModel::headerData
+184 (int (*)(...))QStandardItemModel::setHeaderData
+192 (int (*)(...))QStandardItemModel::itemData
+200 (int (*)(...))QStandardItemModel::setItemData
+208 (int (*)(...))QStandardItemModel::mimeTypes
+216 (int (*)(...))QStandardItemModel::mimeData
+224 (int (*)(...))QAbstractItemModel::canDropMimeData
+232 (int (*)(...))QStandardItemModel::dropMimeData
+240 (int (*)(...))QStandardItemModel::supportedDropActions
+248 (int (*)(...))QAbstractItemModel::supportedDragActions
+256 (int (*)(...))QStandardItemModel::insertRows
+264 (int (*)(...))QStandardItemModel::insertColumns
+272 (int (*)(...))QStandardItemModel::removeRows
+280 (int (*)(...))QStandardItemModel::removeColumns
+288 (int (*)(...))QAbstractItemModel::moveRows
+296 (int (*)(...))QAbstractItemModel::moveColumns
+304 (int (*)(...))QAbstractItemModel::fetchMore
+312 (int (*)(...))QAbstractItemModel::canFetchMore
+320 (int (*)(...))QStandardItemModel::flags
+328 (int (*)(...))QStandardItemModel::sort
+336 (int (*)(...))QAbstractItemModel::buddy
+344 (int (*)(...))QAbstractItemModel::match
+352 (int (*)(...))QAbstractItemModel::span
+360 (int (*)(...))QAbstractItemModel::roleNames
+368 (int (*)(...))QAbstractItemModel::submit
+376 (int (*)(...))QAbstractItemModel::revert
+
+Class QStandardItemModel
+ size=16 align=8
+ base size=16 base align=8
+QStandardItemModel (0x0x7f784b0ec270) 0
+ vptr=((& QStandardItemModel::_ZTV18QStandardItemModel) + 16)
+ QAbstractItemModel (0x0x7f784b0ec2d8) 0
+ primary-for QStandardItemModel (0x0x7f784b0ec270)
+ QObject (0x0x7f784b775060) 0
+ primary-for QAbstractItemModel (0x0x7f784b0ec2d8)
+
+Class QStaticText
+ size=8 align=8
+ base size=8 base align=8
+QStaticText (0x0x7f784b775c60) 0
+
+Class QStyleHints::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QStyleHints::QPrivateSignal (0x0x7f784e8e3f60) 0 empty
+
+Vtable for QStyleHints
+QStyleHints::_ZTV11QStyleHints: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QStyleHints)
+16 (int (*)(...))QStyleHints::metaObject
+24 (int (*)(...))QStyleHints::qt_metacast
+32 (int (*)(...))QStyleHints::qt_metacall
+40 (int (*)(...))QStyleHints::~QStyleHints
+48 (int (*)(...))QStyleHints::~QStyleHints
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QStyleHints
+ size=16 align=8
+ base size=16 base align=8
+QStyleHints (0x0x7f784e945270) 0
+ vptr=((& QStyleHints::_ZTV11QStyleHints) + 16)
+ QObject (0x0x7f784e8e3f00) 0
+ primary-for QStyleHints (0x0x7f784e945270)
+
+Class QTextObject::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTextObject::QPrivateSignal (0x0x7f784d4ae1e0) 0 empty
+
+Vtable for QTextObject
+QTextObject::_ZTV11QTextObject: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QTextObject)
+16 (int (*)(...))QTextObject::metaObject
+24 (int (*)(...))QTextObject::qt_metacast
+32 (int (*)(...))QTextObject::qt_metacall
+40 (int (*)(...))QTextObject::~QTextObject
+48 (int (*)(...))QTextObject::~QTextObject
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QTextObject
+ size=16 align=8
+ base size=16 base align=8
+QTextObject (0x0x7f784e9452d8) 0
+ vptr=((& QTextObject::_ZTV11QTextObject) + 16)
+ QObject (0x0x7f784d4ae180) 0
+ primary-for QTextObject (0x0x7f784e9452d8)
+
+Class QTextBlockGroup::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTextBlockGroup::QPrivateSignal (0x0x7f784d4ae420) 0 empty
+
+Vtable for QTextBlockGroup
+QTextBlockGroup::_ZTV15QTextBlockGroup: 17 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QTextBlockGroup)
+16 (int (*)(...))QTextBlockGroup::metaObject
+24 (int (*)(...))QTextBlockGroup::qt_metacast
+32 (int (*)(...))QTextBlockGroup::qt_metacall
+40 (int (*)(...))QTextBlockGroup::~QTextBlockGroup
+48 (int (*)(...))QTextBlockGroup::~QTextBlockGroup
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QTextBlockGroup::blockInserted
+120 (int (*)(...))QTextBlockGroup::blockRemoved
+128 (int (*)(...))QTextBlockGroup::blockFormatChanged
+
+Class QTextBlockGroup
+ size=16 align=8
+ base size=16 base align=8
+QTextBlockGroup (0x0x7f784e945340) 0
+ vptr=((& QTextBlockGroup::_ZTV15QTextBlockGroup) + 16)
+ QTextObject (0x0x7f784e9453a8) 0
+ primary-for QTextBlockGroup (0x0x7f784e945340)
+ QObject (0x0x7f784d4ae3c0) 0
+ primary-for QTextObject (0x0x7f784e9453a8)
+
+Vtable for QTextFrameLayoutData
+QTextFrameLayoutData::_ZTV20QTextFrameLayoutData: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QTextFrameLayoutData)
+16 (int (*)(...))QTextFrameLayoutData::~QTextFrameLayoutData
+24 (int (*)(...))QTextFrameLayoutData::~QTextFrameLayoutData
+
+Class QTextFrameLayoutData
+ size=8 align=8
+ base size=8 base align=8
+QTextFrameLayoutData (0x0x7f784d4ae600) 0 nearly-empty
+ vptr=((& QTextFrameLayoutData::_ZTV20QTextFrameLayoutData) + 16)
+
+Class QTextFrame::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTextFrame::QPrivateSignal (0x0x7f784d4ae6c0) 0 empty
+
+Class QTextFrame::iterator
+ size=32 align=8
+ base size=28 base align=8
+QTextFrame::iterator (0x0x7f784d4ae720) 0
+
+Vtable for QTextFrame
+QTextFrame::_ZTV10QTextFrame: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QTextFrame)
+16 (int (*)(...))QTextFrame::metaObject
+24 (int (*)(...))QTextFrame::qt_metacast
+32 (int (*)(...))QTextFrame::qt_metacall
+40 (int (*)(...))QTextFrame::~QTextFrame
+48 (int (*)(...))QTextFrame::~QTextFrame
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QTextFrame
+ size=16 align=8
+ base size=16 base align=8
+QTextFrame (0x0x7f784e945410) 0
+ vptr=((& QTextFrame::_ZTV10QTextFrame) + 16)
+ QTextObject (0x0x7f784e945478) 0
+ primary-for QTextFrame (0x0x7f784e945410)
+ QObject (0x0x7f784d4ae660) 0
+ primary-for QTextObject (0x0x7f784e945478)
+
+Vtable for QTextBlockUserData
+QTextBlockUserData::_ZTV18QTextBlockUserData: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QTextBlockUserData)
+16 (int (*)(...))QTextBlockUserData::~QTextBlockUserData
+24 (int (*)(...))QTextBlockUserData::~QTextBlockUserData
+
+Class QTextBlockUserData
+ size=8 align=8
+ base size=8 base align=8
+QTextBlockUserData (0x0x7f784cb710c0) 0 nearly-empty
+ vptr=((& QTextBlockUserData::_ZTV18QTextBlockUserData) + 16)
+
+Class QTextBlock::iterator
+ size=24 align=8
+ base size=20 base align=8
+QTextBlock::iterator (0x0x7f784cb71180) 0
+
+Class QTextBlock
+ size=16 align=8
+ base size=12 base align=8
+QTextBlock (0x0x7f784cb71120) 0
+
+Class QTextFragment
+ size=16 align=8
+ base size=16 base align=8
+QTextFragment (0x0x7f784bb6de40) 0
+
+Class QSyntaxHighlighter::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSyntaxHighlighter::QPrivateSignal (0x0x7f784b8bd660) 0 empty
+
+Vtable for QSyntaxHighlighter
+QSyntaxHighlighter::_ZTV18QSyntaxHighlighter: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QSyntaxHighlighter)
+16 (int (*)(...))QSyntaxHighlighter::metaObject
+24 (int (*)(...))QSyntaxHighlighter::qt_metacast
+32 (int (*)(...))QSyntaxHighlighter::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+
+Class QSyntaxHighlighter
+ size=16 align=8
+ base size=16 base align=8
+QSyntaxHighlighter (0x0x7f784b8b76e8) 0
+ vptr=((& QSyntaxHighlighter::_ZTV18QSyntaxHighlighter) + 16)
+ QObject (0x0x7f784b8bd600) 0
+ primary-for QSyntaxHighlighter (0x0x7f784b8b76e8)
+
+Class QTextDocumentFragment
+ size=8 align=8
+ base size=8 base align=8
+QTextDocumentFragment (0x0x7f784b8bd840) 0
+
+Class QTextDocumentWriter
+ size=8 align=8
+ base size=8 base align=8
+QTextDocumentWriter (0x0x7f784b8bd8a0) 0
+
+Class QTextList::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTextList::QPrivateSignal (0x0x7f784b8bd960) 0 empty
+
+Vtable for QTextList
+QTextList::_ZTV9QTextList: 17 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QTextList)
+16 (int (*)(...))QTextList::metaObject
+24 (int (*)(...))QTextList::qt_metacast
+32 (int (*)(...))QTextList::qt_metacall
+40 (int (*)(...))QTextList::~QTextList
+48 (int (*)(...))QTextList::~QTextList
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QTextBlockGroup::blockInserted
+120 (int (*)(...))QTextBlockGroup::blockRemoved
+128 (int (*)(...))QTextBlockGroup::blockFormatChanged
+
+Class QTextList
+ size=16 align=8
+ base size=16 base align=8
+QTextList (0x0x7f784b8b7750) 0
+ vptr=((& QTextList::_ZTV9QTextList) + 16)
+ QTextBlockGroup (0x0x7f784b8b77b8) 0
+ primary-for QTextList (0x0x7f784b8b7750)
+ QTextObject (0x0x7f784b8b7820) 0
+ primary-for QTextBlockGroup (0x0x7f784b8b77b8)
+ QObject (0x0x7f784b8bd900) 0
+ primary-for QTextObject (0x0x7f784b8b7820)
+
+Class QTextTableCell
+ size=16 align=8
+ base size=12 base align=8
+QTextTableCell (0x0x7f784b8bdf60) 0
+
+Class QTextTable::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTextTable::QPrivateSignal (0x0x7f784addb7e0) 0 empty
+
+Vtable for QTextTable
+QTextTable::_ZTV10QTextTable: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QTextTable)
+16 (int (*)(...))QTextTable::metaObject
+24 (int (*)(...))QTextTable::qt_metacast
+32 (int (*)(...))QTextTable::qt_metacall
+40 (int (*)(...))QTextTable::~QTextTable
+48 (int (*)(...))QTextTable::~QTextTable
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QTextTable
+ size=16 align=8
+ base size=16 base align=8
+QTextTable (0x0x7f784b8b7888) 0
+ vptr=((& QTextTable::_ZTV10QTextTable) + 16)
+ QTextFrame (0x0x7f784b8b78f0) 0
+ primary-for QTextTable (0x0x7f784b8b7888)
+ QTextObject (0x0x7f784b8b7958) 0
+ primary-for QTextFrame (0x0x7f784b8b78f0)
+ QObject (0x0x7f784addb780) 0
+ primary-for QTextObject (0x0x7f784b8b7958)
+
+Class QValidator::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QValidator::QPrivateSignal (0x0x7f784addbd80) 0 empty
+
+Vtable for QValidator
+QValidator::_ZTV10QValidator: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QValidator)
+16 (int (*)(...))QValidator::metaObject
+24 (int (*)(...))QValidator::qt_metacast
+32 (int (*)(...))QValidator::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))QValidator::fixup
+
+Class QValidator
+ size=16 align=8
+ base size=16 base align=8
+QValidator (0x0x7f784b8b79c0) 0
+ vptr=((& QValidator::_ZTV10QValidator) + 16)
+ QObject (0x0x7f784addbd20) 0
+ primary-for QValidator (0x0x7f784b8b79c0)
+
+Class QIntValidator::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QIntValidator::QPrivateSignal (0x0x7f784ae220c0) 0 empty
+
+Vtable for QIntValidator
+QIntValidator::_ZTV13QIntValidator: 17 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QIntValidator)
+16 (int (*)(...))QIntValidator::metaObject
+24 (int (*)(...))QIntValidator::qt_metacast
+32 (int (*)(...))QIntValidator::qt_metacall
+40 (int (*)(...))QIntValidator::~QIntValidator
+48 (int (*)(...))QIntValidator::~QIntValidator
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QIntValidator::validate
+120 (int (*)(...))QIntValidator::fixup
+128 (int (*)(...))QIntValidator::setRange
+
+Class QIntValidator
+ size=24 align=8
+ base size=24 base align=8
+QIntValidator (0x0x7f784b8b7a28) 0
+ vptr=((& QIntValidator::_ZTV13QIntValidator) + 16)
+ QValidator (0x0x7f784b8b7a90) 0
+ primary-for QIntValidator (0x0x7f784b8b7a28)
+ QObject (0x0x7f784ae22060) 0
+ primary-for QValidator (0x0x7f784b8b7a90)
+
+Class QDoubleValidator::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QDoubleValidator::QPrivateSignal (0x0x7f784ae22300) 0 empty
+
+Vtable for QDoubleValidator
+QDoubleValidator::_ZTV16QDoubleValidator: 17 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QDoubleValidator)
+16 (int (*)(...))QDoubleValidator::metaObject
+24 (int (*)(...))QDoubleValidator::qt_metacast
+32 (int (*)(...))QDoubleValidator::qt_metacall
+40 (int (*)(...))QDoubleValidator::~QDoubleValidator
+48 (int (*)(...))QDoubleValidator::~QDoubleValidator
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QDoubleValidator::validate
+120 (int (*)(...))QValidator::fixup
+128 (int (*)(...))QDoubleValidator::setRange
+
+Class QDoubleValidator
+ size=40 align=8
+ base size=36 base align=8
+QDoubleValidator (0x0x7f784b8b7af8) 0
+ vptr=((& QDoubleValidator::_ZTV16QDoubleValidator) + 16)
+ QValidator (0x0x7f784b8b7b60) 0
+ primary-for QDoubleValidator (0x0x7f784b8b7af8)
+ QObject (0x0x7f784ae222a0) 0
+ primary-for QValidator (0x0x7f784b8b7b60)
+
+Class QRegExpValidator::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QRegExpValidator::QPrivateSignal (0x0x7f784ae22780) 0 empty
+
+Vtable for QRegExpValidator
+QRegExpValidator::_ZTV16QRegExpValidator: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QRegExpValidator)
+16 (int (*)(...))QRegExpValidator::metaObject
+24 (int (*)(...))QRegExpValidator::qt_metacast
+32 (int (*)(...))QRegExpValidator::qt_metacall
+40 (int (*)(...))QRegExpValidator::~QRegExpValidator
+48 (int (*)(...))QRegExpValidator::~QRegExpValidator
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QRegExpValidator::validate
+120 (int (*)(...))QValidator::fixup
+
+Class QRegExpValidator
+ size=24 align=8
+ base size=24 base align=8
+QRegExpValidator (0x0x7f784b8b7bc8) 0
+ vptr=((& QRegExpValidator::_ZTV16QRegExpValidator) + 16)
+ QValidator (0x0x7f784b8b7c30) 0
+ primary-for QRegExpValidator (0x0x7f784b8b7bc8)
+ QObject (0x0x7f784ae22720) 0
+ primary-for QValidator (0x0x7f784b8b7c30)
+
+Class QRegularExpressionValidator::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QRegularExpressionValidator::QPrivateSignal (0x0x7f784ae22960) 0 empty
+
+Vtable for QRegularExpressionValidator
+QRegularExpressionValidator::_ZTV27QRegularExpressionValidator: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI27QRegularExpressionValidator)
+16 (int (*)(...))QRegularExpressionValidator::metaObject
+24 (int (*)(...))QRegularExpressionValidator::qt_metacast
+32 (int (*)(...))QRegularExpressionValidator::qt_metacall
+40 (int (*)(...))QRegularExpressionValidator::~QRegularExpressionValidator
+48 (int (*)(...))QRegularExpressionValidator::~QRegularExpressionValidator
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QRegularExpressionValidator::validate
+120 (int (*)(...))QValidator::fixup
+
+Class QRegularExpressionValidator
+ size=16 align=8
+ base size=16 base align=8
+QRegularExpressionValidator (0x0x7f784b8b7c98) 0
+ vptr=((& QRegularExpressionValidator::_ZTV27QRegularExpressionValidator) + 16)
+ QValidator (0x0x7f784b8b7d00) 0
+ primary-for QRegularExpressionValidator (0x0x7f784b8b7c98)
+ QObject (0x0x7f784ae22900) 0
+ primary-for QValidator (0x0x7f784b8b7d00)
+
+Class QNetworkRequest
+ size=8 align=8
+ base size=8 base align=8
+QNetworkRequest (0x0x7f784ae22b40) 0
+
+Class QNetworkCacheMetaData
+ size=8 align=8
+ base size=8 base align=8
+QNetworkCacheMetaData (0x0x7f784ac19000) 0
+
+Class QAbstractNetworkCache::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAbstractNetworkCache::QPrivateSignal (0x0x7f784ac614e0) 0 empty
+
+Vtable for QAbstractNetworkCache
+QAbstractNetworkCache::_ZTV21QAbstractNetworkCache: 22 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI21QAbstractNetworkCache)
+16 (int (*)(...))QAbstractNetworkCache::metaObject
+24 (int (*)(...))QAbstractNetworkCache::qt_metacast
+32 (int (*)(...))QAbstractNetworkCache::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))__cxa_pure_virtual
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))__cxa_pure_virtual
+160 (int (*)(...))__cxa_pure_virtual
+168 (int (*)(...))__cxa_pure_virtual
+
+Class QAbstractNetworkCache
+ size=16 align=8
+ base size=16 base align=8
+QAbstractNetworkCache (0x0x7f784ac5d9c0) 0
+ vptr=((& QAbstractNetworkCache::_ZTV21QAbstractNetworkCache) + 16)
+ QObject (0x0x7f784ac61480) 0
+ primary-for QAbstractNetworkCache (0x0x7f784ac5d9c0)
+
+Class QAbstractSocket::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAbstractSocket::QPrivateSignal (0x0x7f784ac61720) 0 empty
+
+Vtable for QAbstractSocket
+QAbstractSocket::_ZTV15QAbstractSocket: 41 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QAbstractSocket)
+16 (int (*)(...))QAbstractSocket::metaObject
+24 (int (*)(...))QAbstractSocket::qt_metacast
+32 (int (*)(...))QAbstractSocket::qt_metacall
+40 (int (*)(...))QAbstractSocket::~QAbstractSocket
+48 (int (*)(...))QAbstractSocket::~QAbstractSocket
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QAbstractSocket::isSequential
+120 (int (*)(...))QIODevice::open
+128 (int (*)(...))QAbstractSocket::close
+136 (int (*)(...))QIODevice::pos
+144 (int (*)(...))QIODevice::size
+152 (int (*)(...))QIODevice::seek
+160 (int (*)(...))QAbstractSocket::atEnd
+168 (int (*)(...))QIODevice::reset
+176 (int (*)(...))QAbstractSocket::bytesAvailable
+184 (int (*)(...))QAbstractSocket::bytesToWrite
+192 (int (*)(...))QAbstractSocket::canReadLine
+200 (int (*)(...))QAbstractSocket::waitForReadyRead
+208 (int (*)(...))QAbstractSocket::waitForBytesWritten
+216 (int (*)(...))QAbstractSocket::readData
+224 (int (*)(...))QAbstractSocket::readLineData
+232 (int (*)(...))QAbstractSocket::writeData
+240 (int (*)(...))QAbstractSocket::resume
+248 (int (*)(...))QAbstractSocket::connectToHost
+256 (int (*)(...))QAbstractSocket::connectToHost
+264 (int (*)(...))QAbstractSocket::disconnectFromHost
+272 (int (*)(...))QAbstractSocket::setReadBufferSize
+280 (int (*)(...))QAbstractSocket::socketDescriptor
+288 (int (*)(...))QAbstractSocket::setSocketDescriptor
+296 (int (*)(...))QAbstractSocket::setSocketOption
+304 (int (*)(...))QAbstractSocket::socketOption
+312 (int (*)(...))QAbstractSocket::waitForConnected
+320 (int (*)(...))QAbstractSocket::waitForDisconnected
+
+Class QAbstractSocket
+ size=16 align=8
+ base size=16 base align=8
+QAbstractSocket (0x0x7f784ac5da28) 0
+ vptr=((& QAbstractSocket::_ZTV15QAbstractSocket) + 16)
+ QIODevice (0x0x7f784ac5da90) 0
+ primary-for QAbstractSocket (0x0x7f784ac5da28)
+ QObject (0x0x7f784ac616c0) 0
+ primary-for QIODevice (0x0x7f784ac5da90)
+
+Class QAuthenticator
+ size=8 align=8
+ base size=8 base align=8
+QAuthenticator (0x0x7f784acb0ea0) 0
+
+Class QDnsDomainNameRecord
+ size=8 align=8
+ base size=8 base align=8
+QDnsDomainNameRecord (0x0x7f784acb0f60) 0
+
+Class QDnsHostAddressRecord
+ size=8 align=8
+ base size=8 base align=8
+QDnsHostAddressRecord (0x0x7f784ad2f060) 0
+
+Class QDnsMailExchangeRecord
+ size=8 align=8
+ base size=8 base align=8
+QDnsMailExchangeRecord (0x0x7f784ad74120) 0
+
+Class QDnsServiceRecord
+ size=8 align=8
+ base size=8 base align=8
+QDnsServiceRecord (0x0x7f784adb9120) 0
+
+Class QDnsTextRecord
+ size=8 align=8
+ base size=8 base align=8
+QDnsTextRecord (0x0x7f784a9fd000) 0
+
+Class QDnsLookup::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QDnsLookup::QPrivateSignal (0x0x7f784aa47060) 0 empty
+
+Vtable for QDnsLookup
+QDnsLookup::_ZTV10QDnsLookup: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QDnsLookup)
+16 (int (*)(...))QDnsLookup::metaObject
+24 (int (*)(...))QDnsLookup::qt_metacast
+32 (int (*)(...))QDnsLookup::qt_metacall
+40 (int (*)(...))QDnsLookup::~QDnsLookup
+48 (int (*)(...))QDnsLookup::~QDnsLookup
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QDnsLookup
+ size=16 align=8
+ base size=16 base align=8
+QDnsLookup (0x0x7f784aa42958) 0
+ vptr=((& QDnsLookup::_ZTV10QDnsLookup) + 16)
+ QObject (0x0x7f784aa47000) 0
+ primary-for QDnsLookup (0x0x7f784aa42958)
+
+Class QTcpSocket::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTcpSocket::QPrivateSignal (0x0x7f784aa47420) 0 empty
+
+Vtable for QTcpSocket
+QTcpSocket::_ZTV10QTcpSocket: 41 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QTcpSocket)
+16 (int (*)(...))QTcpSocket::metaObject
+24 (int (*)(...))QTcpSocket::qt_metacast
+32 (int (*)(...))QTcpSocket::qt_metacall
+40 (int (*)(...))QTcpSocket::~QTcpSocket
+48 (int (*)(...))QTcpSocket::~QTcpSocket
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QAbstractSocket::isSequential
+120 (int (*)(...))QIODevice::open
+128 (int (*)(...))QAbstractSocket::close
+136 (int (*)(...))QIODevice::pos
+144 (int (*)(...))QIODevice::size
+152 (int (*)(...))QIODevice::seek
+160 (int (*)(...))QAbstractSocket::atEnd
+168 (int (*)(...))QIODevice::reset
+176 (int (*)(...))QAbstractSocket::bytesAvailable
+184 (int (*)(...))QAbstractSocket::bytesToWrite
+192 (int (*)(...))QAbstractSocket::canReadLine
+200 (int (*)(...))QAbstractSocket::waitForReadyRead
+208 (int (*)(...))QAbstractSocket::waitForBytesWritten
+216 (int (*)(...))QAbstractSocket::readData
+224 (int (*)(...))QAbstractSocket::readLineData
+232 (int (*)(...))QAbstractSocket::writeData
+240 (int (*)(...))QAbstractSocket::resume
+248 (int (*)(...))QAbstractSocket::connectToHost
+256 (int (*)(...))QAbstractSocket::connectToHost
+264 (int (*)(...))QAbstractSocket::disconnectFromHost
+272 (int (*)(...))QAbstractSocket::setReadBufferSize
+280 (int (*)(...))QAbstractSocket::socketDescriptor
+288 (int (*)(...))QAbstractSocket::setSocketDescriptor
+296 (int (*)(...))QAbstractSocket::setSocketOption
+304 (int (*)(...))QAbstractSocket::socketOption
+312 (int (*)(...))QAbstractSocket::waitForConnected
+320 (int (*)(...))QAbstractSocket::waitForDisconnected
+
+Class QTcpSocket
+ size=16 align=8
+ base size=16 base align=8
+QTcpSocket (0x0x7f784aa429c0) 0
+ vptr=((& QTcpSocket::_ZTV10QTcpSocket) + 16)
+ QAbstractSocket (0x0x7f784aa42a28) 0
+ primary-for QTcpSocket (0x0x7f784aa429c0)
+ QIODevice (0x0x7f784aa42a90) 0
+ primary-for QAbstractSocket (0x0x7f784aa42a28)
+ QObject (0x0x7f784aa473c0) 0
+ primary-for QIODevice (0x0x7f784aa42a90)
+
+Class QSslCertificate
+ size=8 align=8
+ base size=8 base align=8
+QSslCertificate (0x0x7f784aa47cc0) 0
+
+Class QSslError
+ size=8 align=8
+ base size=8 base align=8
+QSslError (0x0x7f784ab0a540) 0
+
+Class QSslSocket::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSslSocket::QPrivateSignal (0x0x7f784a8ab7e0) 0 empty
+
+Vtable for QSslSocket
+QSslSocket::_ZTV10QSslSocket: 41 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QSslSocket)
+16 (int (*)(...))QSslSocket::metaObject
+24 (int (*)(...))QSslSocket::qt_metacast
+32 (int (*)(...))QSslSocket::qt_metacall
+40 (int (*)(...))QSslSocket::~QSslSocket
+48 (int (*)(...))QSslSocket::~QSslSocket
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QAbstractSocket::isSequential
+120 (int (*)(...))QIODevice::open
+128 (int (*)(...))QSslSocket::close
+136 (int (*)(...))QIODevice::pos
+144 (int (*)(...))QIODevice::size
+152 (int (*)(...))QIODevice::seek
+160 (int (*)(...))QSslSocket::atEnd
+168 (int (*)(...))QIODevice::reset
+176 (int (*)(...))QSslSocket::bytesAvailable
+184 (int (*)(...))QSslSocket::bytesToWrite
+192 (int (*)(...))QSslSocket::canReadLine
+200 (int (*)(...))QSslSocket::waitForReadyRead
+208 (int (*)(...))QSslSocket::waitForBytesWritten
+216 (int (*)(...))QSslSocket::readData
+224 (int (*)(...))QAbstractSocket::readLineData
+232 (int (*)(...))QSslSocket::writeData
+240 (int (*)(...))QSslSocket::resume
+248 (int (*)(...))QSslSocket::connectToHost
+256 (int (*)(...))QAbstractSocket::connectToHost
+264 (int (*)(...))QSslSocket::disconnectFromHost
+272 (int (*)(...))QSslSocket::setReadBufferSize
+280 (int (*)(...))QAbstractSocket::socketDescriptor
+288 (int (*)(...))QSslSocket::setSocketDescriptor
+296 (int (*)(...))QSslSocket::setSocketOption
+304 (int (*)(...))QSslSocket::socketOption
+312 (int (*)(...))QSslSocket::waitForConnected
+320 (int (*)(...))QSslSocket::waitForDisconnected
+
+Class QSslSocket
+ size=16 align=8
+ base size=16 base align=8
+QSslSocket (0x0x7f784a8a9750) 0
+ vptr=((& QSslSocket::_ZTV10QSslSocket) + 16)
+ QTcpSocket (0x0x7f784a8a97b8) 0
+ primary-for QSslSocket (0x0x7f784a8a9750)
+ QAbstractSocket (0x0x7f784a8a9820) 0
+ primary-for QTcpSocket (0x0x7f784a8a97b8)
+ QIODevice (0x0x7f784a8a9888) 0
+ primary-for QAbstractSocket (0x0x7f784a8a9820)
+ QObject (0x0x7f784a8ab780) 0
+ primary-for QIODevice (0x0x7f784a8a9888)
+
+Class QDtlsClientVerifier::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QDtlsClientVerifier::QPrivateSignal (0x0x7f784a8aba20) 0 empty
+
+Class QDtlsClientVerifier::GeneratorParameters
+ size=16 align=8
+ base size=16 base align=8
+QDtlsClientVerifier::GeneratorParameters (0x0x7f784a8aba80) 0
+
+Vtable for QDtlsClientVerifier
+QDtlsClientVerifier::_ZTV19QDtlsClientVerifier: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QDtlsClientVerifier)
+16 (int (*)(...))QDtlsClientVerifier::metaObject
+24 (int (*)(...))QDtlsClientVerifier::qt_metacast
+32 (int (*)(...))QDtlsClientVerifier::qt_metacall
+40 (int (*)(...))QDtlsClientVerifier::~QDtlsClientVerifier
+48 (int (*)(...))QDtlsClientVerifier::~QDtlsClientVerifier
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QDtlsClientVerifier
+ size=16 align=8
+ base size=16 base align=8
+QDtlsClientVerifier (0x0x7f784a8a98f0) 0
+ vptr=((& QDtlsClientVerifier::_ZTV19QDtlsClientVerifier) + 16)
+ QObject (0x0x7f784a8ab9c0) 0
+ primary-for QDtlsClientVerifier (0x0x7f784a8a98f0)
+
+Class QDtls::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QDtls::QPrivateSignal (0x0x7f784a8abcc0) 0 empty
+
+Vtable for QDtls
+QDtls::_ZTV5QDtls: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI5QDtls)
+16 (int (*)(...))QDtls::metaObject
+24 (int (*)(...))QDtls::qt_metacast
+32 (int (*)(...))QDtls::qt_metacall
+40 (int (*)(...))QDtls::~QDtls
+48 (int (*)(...))QDtls::~QDtls
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QDtls
+ size=16 align=8
+ base size=16 base align=8
+QDtls (0x0x7f784a8a9958) 0
+ vptr=((& QDtls::_ZTV5QDtls) + 16)
+ QObject (0x0x7f784a8abc60) 0
+ primary-for QDtls (0x0x7f784a8a9958)
+
+Class QIPv6Address
+ size=16 align=1
+ base size=16 base align=1
+QIPv6Address (0x0x7f784a8abf00) 0
+
+Class QHostAddress
+ size=8 align=8
+ base size=8 base align=8
+QHostAddress (0x0x7f784a77d060) 0
+
+Class QHostInfo
+ size=8 align=8
+ base size=8 base align=8
+QHostInfo (0x0x7f7855226de0) 0
+
+Class QHstsPolicy
+ size=8 align=8
+ base size=8 base align=8
+QHstsPolicy (0x0x7f78531d54e0) 0
+
+Class QHttp2Configuration
+ size=8 align=8
+ base size=8 base align=8
+QHttp2Configuration (0x0x7f7851d48c00) 0
+
+Class QHttpPart
+ size=8 align=8
+ base size=8 base align=8
+QHttpPart (0x0x7f7851392180) 0
+
+Class QHttpMultiPart::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QHttpMultiPart::QPrivateSignal (0x0x7f78502ebde0) 0 empty
+
+Vtable for QHttpMultiPart
+QHttpMultiPart::_ZTV14QHttpMultiPart: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QHttpMultiPart)
+16 (int (*)(...))QHttpMultiPart::metaObject
+24 (int (*)(...))QHttpMultiPart::qt_metacast
+32 (int (*)(...))QHttpMultiPart::qt_metacall
+40 (int (*)(...))QHttpMultiPart::~QHttpMultiPart
+48 (int (*)(...))QHttpMultiPart::~QHttpMultiPart
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QHttpMultiPart
+ size=16 align=8
+ base size=16 base align=8
+QHttpMultiPart (0x0x7f78500d80d0) 0
+ vptr=((& QHttpMultiPart::_ZTV14QHttpMultiPart) + 16)
+ QObject (0x0x7f78502ebd80) 0
+ primary-for QHttpMultiPart (0x0x7f78500d80d0)
+
+Class QLocalServer::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QLocalServer::QPrivateSignal (0x0x7f784fce3060) 0 empty
+
+Vtable for QLocalServer
+QLocalServer::_ZTV12QLocalServer: 17 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QLocalServer)
+16 (int (*)(...))QLocalServer::metaObject
+24 (int (*)(...))QLocalServer::qt_metacast
+32 (int (*)(...))QLocalServer::qt_metacall
+40 (int (*)(...))QLocalServer::~QLocalServer
+48 (int (*)(...))QLocalServer::~QLocalServer
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QLocalServer::hasPendingConnections
+120 (int (*)(...))QLocalServer::nextPendingConnection
+128 (int (*)(...))QLocalServer::incomingConnection
+
+Class QLocalServer
+ size=16 align=8
+ base size=16 base align=8
+QLocalServer (0x0x7f78500d8138) 0
+ vptr=((& QLocalServer::_ZTV12QLocalServer) + 16)
+ QObject (0x0x7f784fce3000) 0
+ primary-for QLocalServer (0x0x7f78500d8138)
+
+Class QLocalSocket::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QLocalSocket::QPrivateSignal (0x0x7f784fce3ae0) 0 empty
+
+Vtable for QLocalSocket
+QLocalSocket::_ZTV12QLocalSocket: 30 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QLocalSocket)
+16 (int (*)(...))QLocalSocket::metaObject
+24 (int (*)(...))QLocalSocket::qt_metacast
+32 (int (*)(...))QLocalSocket::qt_metacall
+40 (int (*)(...))QLocalSocket::~QLocalSocket
+48 (int (*)(...))QLocalSocket::~QLocalSocket
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QLocalSocket::isSequential
+120 (int (*)(...))QLocalSocket::open
+128 (int (*)(...))QLocalSocket::close
+136 (int (*)(...))QIODevice::pos
+144 (int (*)(...))QIODevice::size
+152 (int (*)(...))QIODevice::seek
+160 (int (*)(...))QIODevice::atEnd
+168 (int (*)(...))QIODevice::reset
+176 (int (*)(...))QLocalSocket::bytesAvailable
+184 (int (*)(...))QLocalSocket::bytesToWrite
+192 (int (*)(...))QLocalSocket::canReadLine
+200 (int (*)(...))QLocalSocket::waitForReadyRead
+208 (int (*)(...))QLocalSocket::waitForBytesWritten
+216 (int (*)(...))QLocalSocket::readData
+224 (int (*)(...))QIODevice::readLineData
+232 (int (*)(...))QLocalSocket::writeData
+
+Class QLocalSocket
+ size=16 align=8
+ base size=16 base align=8
+QLocalSocket (0x0x7f78500d82d8) 0
+ vptr=((& QLocalSocket::_ZTV12QLocalSocket) + 16)
+ QIODevice (0x0x7f78500d8340) 0
+ primary-for QLocalSocket (0x0x7f78500d82d8)
+ QObject (0x0x7f784fce3a80) 0
+ primary-for QIODevice (0x0x7f78500d8340)
+
+Class QSslConfiguration
+ size=8 align=8
+ base size=8 base align=8
+QSslConfiguration (0x0x7f784fce3d20) 0
+
+Class QSslPreSharedKeyAuthenticator
+ size=8 align=8
+ base size=8 base align=8
+QSslPreSharedKeyAuthenticator (0x0x7f784d9ac240) 0
+
+Class QNetworkAccessManager::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QNetworkAccessManager::QPrivateSignal (0x0x7f784c4d88a0) 0 empty
+
+Vtable for QNetworkAccessManager
+QNetworkAccessManager::_ZTV21QNetworkAccessManager: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI21QNetworkAccessManager)
+16 (int (*)(...))QNetworkAccessManager::metaObject
+24 (int (*)(...))QNetworkAccessManager::qt_metacast
+32 (int (*)(...))QNetworkAccessManager::qt_metacall
+40 (int (*)(...))QNetworkAccessManager::~QNetworkAccessManager
+48 (int (*)(...))QNetworkAccessManager::~QNetworkAccessManager
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QNetworkAccessManager::createRequest
+
+Class QNetworkAccessManager
+ size=16 align=8
+ base size=16 base align=8
+QNetworkAccessManager (0x0x7f784c3d7820) 0
+ vptr=((& QNetworkAccessManager::_ZTV21QNetworkAccessManager) + 16)
+ QObject (0x0x7f784c4d8840) 0
+ primary-for QNetworkAccessManager (0x0x7f784c3d7820)
+
+Class QNetworkConfiguration
+ size=8 align=8
+ base size=8 base align=8
+QNetworkConfiguration (0x0x7f784c4d8b40) 0
+
+Class QNetworkConfigurationManager::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QNetworkConfigurationManager::QPrivateSignal (0x0x7f7856d46f00) 0 empty
+
+Vtable for QNetworkConfigurationManager
+QNetworkConfigurationManager::_ZTV28QNetworkConfigurationManager: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI28QNetworkConfigurationManager)
+16 (int (*)(...))QNetworkConfigurationManager::metaObject
+24 (int (*)(...))QNetworkConfigurationManager::qt_metacast
+32 (int (*)(...))QNetworkConfigurationManager::qt_metacall
+40 (int (*)(...))QNetworkConfigurationManager::~QNetworkConfigurationManager
+48 (int (*)(...))QNetworkConfigurationManager::~QNetworkConfigurationManager
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QNetworkConfigurationManager
+ size=16 align=8
+ base size=16 base align=8
+QNetworkConfigurationManager (0x0x7f784a691af8) 0
+ vptr=((& QNetworkConfigurationManager::_ZTV28QNetworkConfigurationManager) + 16)
+ QObject (0x0x7f7856d46ea0) 0
+ primary-for QNetworkConfigurationManager (0x0x7f784a691af8)
+
+Class QNetworkCookie
+ size=8 align=8
+ base size=8 base align=8
+QNetworkCookie (0x0x7f78556b2a80) 0
+
+Class QNetworkCookieJar::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QNetworkCookieJar::QPrivateSignal (0x0x7f7851a740c0) 0 empty
+
+Vtable for QNetworkCookieJar
+QNetworkCookieJar::_ZTV17QNetworkCookieJar: 20 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QNetworkCookieJar)
+16 (int (*)(...))QNetworkCookieJar::metaObject
+24 (int (*)(...))QNetworkCookieJar::qt_metacast
+32 (int (*)(...))QNetworkCookieJar::qt_metacall
+40 (int (*)(...))QNetworkCookieJar::~QNetworkCookieJar
+48 (int (*)(...))QNetworkCookieJar::~QNetworkCookieJar
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QNetworkCookieJar::cookiesForUrl
+120 (int (*)(...))QNetworkCookieJar::setCookiesFromUrl
+128 (int (*)(...))QNetworkCookieJar::insertCookie
+136 (int (*)(...))QNetworkCookieJar::updateCookie
+144 (int (*)(...))QNetworkCookieJar::deleteCookie
+152 (int (*)(...))QNetworkCookieJar::validateCookie
+
+Class QNetworkCookieJar
+ size=16 align=8
+ base size=16 base align=8
+QNetworkCookieJar (0x0x7f7851f32d68) 0
+ vptr=((& QNetworkCookieJar::_ZTV17QNetworkCookieJar) + 16)
+ QObject (0x0x7f7851a74060) 0
+ primary-for QNetworkCookieJar (0x0x7f7851f32d68)
+
+Class QNetworkDatagram
+ size=8 align=8
+ base size=8 base align=8
+QNetworkDatagram (0x0x7f7851a742a0) 0
+
+Class QNetworkDiskCache::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QNetworkDiskCache::QPrivateSignal (0x0x7f7850347de0) 0 empty
+
+Vtable for QNetworkDiskCache
+QNetworkDiskCache::_ZTV17QNetworkDiskCache: 23 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QNetworkDiskCache)
+16 (int (*)(...))QNetworkDiskCache::metaObject
+24 (int (*)(...))QNetworkDiskCache::qt_metacast
+32 (int (*)(...))QNetworkDiskCache::qt_metacall
+40 (int (*)(...))QNetworkDiskCache::~QNetworkDiskCache
+48 (int (*)(...))QNetworkDiskCache::~QNetworkDiskCache
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QNetworkDiskCache::metaData
+120 (int (*)(...))QNetworkDiskCache::updateMetaData
+128 (int (*)(...))QNetworkDiskCache::data
+136 (int (*)(...))QNetworkDiskCache::remove
+144 (int (*)(...))QNetworkDiskCache::cacheSize
+152 (int (*)(...))QNetworkDiskCache::prepare
+160 (int (*)(...))QNetworkDiskCache::insert
+168 (int (*)(...))QNetworkDiskCache::clear
+176 (int (*)(...))QNetworkDiskCache::expire
+
+Class QNetworkDiskCache
+ size=16 align=8
+ base size=16 base align=8
+QNetworkDiskCache (0x0x7f784fff5c30) 0
+ vptr=((& QNetworkDiskCache::_ZTV17QNetworkDiskCache) + 16)
+ QAbstractNetworkCache (0x0x7f784fff5c98) 0
+ primary-for QNetworkDiskCache (0x0x7f784fff5c30)
+ QObject (0x0x7f7850347d80) 0
+ primary-for QAbstractNetworkCache (0x0x7f784fff5c98)
+
+Class QNetworkAddressEntry
+ size=8 align=8
+ base size=8 base align=8
+QNetworkAddressEntry (0x0x7f784f88b000) 0
+
+Class QNetworkInterface
+ size=8 align=8
+ base size=8 base align=8
+QNetworkInterface (0x0x7f784d959f60) 0
+
+Class QNetworkProxyQuery
+ size=8 align=8
+ base size=8 base align=8
+QNetworkProxyQuery (0x0x7f784bfb0a80) 0
+
+Class QNetworkProxy
+ size=8 align=8
+ base size=8 base align=8
+QNetworkProxy (0x0x7f7854ce7d80) 0
+
+Vtable for QNetworkProxyFactory
+QNetworkProxyFactory::_ZTV20QNetworkProxyFactory: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QNetworkProxyFactory)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+
+Class QNetworkProxyFactory
+ size=8 align=8
+ base size=8 base align=8
+QNetworkProxyFactory (0x0x7f784d07d600) 0 nearly-empty
+ vptr=((& QNetworkProxyFactory::_ZTV20QNetworkProxyFactory) + 16)
+
+Class QNetworkReply::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QNetworkReply::QPrivateSignal (0x0x7f784d07d8a0) 0 empty
+
+Vtable for QNetworkReply
+QNetworkReply::_ZTV13QNetworkReply: 36 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QNetworkReply)
+16 (int (*)(...))QNetworkReply::metaObject
+24 (int (*)(...))QNetworkReply::qt_metacast
+32 (int (*)(...))QNetworkReply::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QNetworkReply::isSequential
+120 (int (*)(...))QIODevice::open
+128 (int (*)(...))QNetworkReply::close
+136 (int (*)(...))QIODevice::pos
+144 (int (*)(...))QIODevice::size
+152 (int (*)(...))QIODevice::seek
+160 (int (*)(...))QIODevice::atEnd
+168 (int (*)(...))QIODevice::reset
+176 (int (*)(...))QIODevice::bytesAvailable
+184 (int (*)(...))QIODevice::bytesToWrite
+192 (int (*)(...))QIODevice::canReadLine
+200 (int (*)(...))QIODevice::waitForReadyRead
+208 (int (*)(...))QIODevice::waitForBytesWritten
+216 (int (*)(...))__cxa_pure_virtual
+224 (int (*)(...))QIODevice::readLineData
+232 (int (*)(...))QNetworkReply::writeData
+240 (int (*)(...))QNetworkReply::setReadBufferSize
+248 (int (*)(...))__cxa_pure_virtual
+256 (int (*)(...))QNetworkReply::ignoreSslErrors
+264 (int (*)(...))QNetworkReply::sslConfigurationImplementation
+272 (int (*)(...))QNetworkReply::setSslConfigurationImplementation
+280 (int (*)(...))QNetworkReply::ignoreSslErrorsImplementation
+
+Class QNetworkReply
+ size=16 align=8
+ base size=16 base align=8
+QNetworkReply (0x0x7f784d3910d0) 0
+ vptr=((& QNetworkReply::_ZTV13QNetworkReply) + 16)
+ QIODevice (0x0x7f784d391138) 0
+ primary-for QNetworkReply (0x0x7f784d3910d0)
+ QObject (0x0x7f784d07d840) 0
+ primary-for QIODevice (0x0x7f784d391138)
+
+Class QNetworkSession::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QNetworkSession::QPrivateSignal (0x0x7f784d07dde0) 0 empty
+
+Vtable for QNetworkSession
+QNetworkSession::_ZTV15QNetworkSession: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QNetworkSession)
+16 (int (*)(...))QNetworkSession::metaObject
+24 (int (*)(...))QNetworkSession::qt_metacast
+32 (int (*)(...))QNetworkSession::qt_metacall
+40 (int (*)(...))QNetworkSession::~QNetworkSession
+48 (int (*)(...))QNetworkSession::~QNetworkSession
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QNetworkSession::connectNotify
+104 (int (*)(...))QNetworkSession::disconnectNotify
+
+Class QNetworkSession
+ size=24 align=8
+ base size=24 base align=8
+QNetworkSession (0x0x7f784d3911a0) 0
+ vptr=((& QNetworkSession::_ZTV15QNetworkSession) + 16)
+ QObject (0x0x7f784d07dd80) 0
+ primary-for QNetworkSession (0x0x7f784d3911a0)
+
+Class QOcspResponse
+ size=8 align=8
+ base size=8 base align=8
+QOcspResponse (0x0x7f784b88c660) 0
+
+Class QTcpServer::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTcpServer::QPrivateSignal (0x0x7f784a855ea0) 0 empty
+
+Vtable for QTcpServer
+QTcpServer::_ZTV10QTcpServer: 17 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QTcpServer)
+16 (int (*)(...))QTcpServer::metaObject
+24 (int (*)(...))QTcpServer::qt_metacast
+32 (int (*)(...))QTcpServer::qt_metacall
+40 (int (*)(...))QTcpServer::~QTcpServer
+48 (int (*)(...))QTcpServer::~QTcpServer
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QTcpServer::hasPendingConnections
+120 (int (*)(...))QTcpServer::nextPendingConnection
+128 (int (*)(...))QTcpServer::incomingConnection
+
+Class QTcpServer
+ size=16 align=8
+ base size=16 base align=8
+QTcpServer (0x0x7f784a878a28) 0
+ vptr=((& QTcpServer::_ZTV10QTcpServer) + 16)
+ QObject (0x0x7f784a855e40) 0
+ primary-for QTcpServer (0x0x7f784a878a28)
+
+Class QSslCertificateExtension
+ size=8 align=8
+ base size=8 base align=8
+QSslCertificateExtension (0x0x7f784a8c30c0) 0
+
+Class QSslCipher
+ size=8 align=8
+ base size=8 base align=8
+QSslCipher (0x0x7f784a7c9060) 0
+
+Class QSslDiffieHellmanParameters
+ size=8 align=8
+ base size=8 base align=8
+QSslDiffieHellmanParameters (0x0x7f7852790120) 0
+
+Class QSslEllipticCurve
+ size=4 align=4
+ base size=4 base align=4
+QSslEllipticCurve (0x0x7f78514f6e40) 0
+
+Class QSslKey
+ size=8 align=8
+ base size=8 base align=8
+QSslKey (0x0x7f7850ae37e0) 0
+
+Class QUdpSocket::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QUdpSocket::QPrivateSignal (0x0x7f784d7c26c0) 0 empty
+
+Vtable for QUdpSocket
+QUdpSocket::_ZTV10QUdpSocket: 41 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QUdpSocket)
+16 (int (*)(...))QUdpSocket::metaObject
+24 (int (*)(...))QUdpSocket::qt_metacast
+32 (int (*)(...))QUdpSocket::qt_metacall
+40 (int (*)(...))QUdpSocket::~QUdpSocket
+48 (int (*)(...))QUdpSocket::~QUdpSocket
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QAbstractSocket::isSequential
+120 (int (*)(...))QIODevice::open
+128 (int (*)(...))QAbstractSocket::close
+136 (int (*)(...))QIODevice::pos
+144 (int (*)(...))QIODevice::size
+152 (int (*)(...))QIODevice::seek
+160 (int (*)(...))QAbstractSocket::atEnd
+168 (int (*)(...))QIODevice::reset
+176 (int (*)(...))QAbstractSocket::bytesAvailable
+184 (int (*)(...))QAbstractSocket::bytesToWrite
+192 (int (*)(...))QAbstractSocket::canReadLine
+200 (int (*)(...))QAbstractSocket::waitForReadyRead
+208 (int (*)(...))QAbstractSocket::waitForBytesWritten
+216 (int (*)(...))QAbstractSocket::readData
+224 (int (*)(...))QAbstractSocket::readLineData
+232 (int (*)(...))QAbstractSocket::writeData
+240 (int (*)(...))QAbstractSocket::resume
+248 (int (*)(...))QAbstractSocket::connectToHost
+256 (int (*)(...))QAbstractSocket::connectToHost
+264 (int (*)(...))QAbstractSocket::disconnectFromHost
+272 (int (*)(...))QAbstractSocket::setReadBufferSize
+280 (int (*)(...))QAbstractSocket::socketDescriptor
+288 (int (*)(...))QAbstractSocket::setSocketDescriptor
+296 (int (*)(...))QAbstractSocket::setSocketOption
+304 (int (*)(...))QAbstractSocket::socketOption
+312 (int (*)(...))QAbstractSocket::waitForConnected
+320 (int (*)(...))QAbstractSocket::waitForDisconnected
+
+Class QUdpSocket
+ size=16 align=8
+ base size=16 base align=8
+QUdpSocket (0x0x7f784d3da000) 0
+ vptr=((& QUdpSocket::_ZTV10QUdpSocket) + 16)
+ QAbstractSocket (0x0x7f784d3da068) 0
+ primary-for QUdpSocket (0x0x7f784d3da000)
+ QIODevice (0x0x7f784d3da0d0) 0
+ primary-for QAbstractSocket (0x0x7f784d3da068)
+ QObject (0x0x7f784d7c2660) 0
+ primary-for QIODevice (0x0x7f784d3da0d0)
+
+Class QJSValue
+ size=8 align=8
+ base size=8 base align=8
+QJSValue (0x0x7f784d7c2900) 0
+
+Class QQmlDebuggingEnabler
+ size=1 align=1
+ base size=0 base align=1
+QQmlDebuggingEnabler (0x0x7f784d7c2e40) 0 empty
+
+Class QJSEngine::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QJSEngine::QPrivateSignal (0x0x7f784d7c2f00) 0 empty
+
+Vtable for QJSEngine
+QJSEngine::_ZTV9QJSEngine: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QJSEngine)
+16 (int (*)(...))QJSEngine::metaObject
+24 (int (*)(...))QJSEngine::qt_metacast
+32 (int (*)(...))QJSEngine::qt_metacall
+40 (int (*)(...))QJSEngine::~QJSEngine
+48 (int (*)(...))QJSEngine::~QJSEngine
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QJSEngine
+ size=24 align=8
+ base size=24 base align=8
+QJSEngine (0x0x7f784d3da1a0) 0
+ vptr=((& QJSEngine::_ZTV9QJSEngine) + 16)
+ QObject (0x0x7f784d7c2ea0) 0
+ primary-for QJSEngine (0x0x7f784d3da1a0)
+
+Class QJSValueIterator
+ size=8 align=8
+ base size=8 base align=8
+QJSValueIterator (0x0x7f784d1ffa80) 0
+
+Vtable for QQmlParserStatus
+QQmlParserStatus::_ZTV16QQmlParserStatus: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QQmlParserStatus)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+
+Class QQmlParserStatus
+ size=16 align=8
+ base size=16 base align=8
+QQmlParserStatus (0x0x7f784d1ffc60) 0
+ vptr=((& QQmlParserStatus::_ZTV16QQmlParserStatus) + 16)
+
+Class QQmlListReference
+ size=8 align=8
+ base size=8 base align=8
+QQmlListReference (0x0x7f784cbbd840) 0
+
+Vtable for QQmlPropertyValueSource
+QQmlPropertyValueSource::_ZTV23QQmlPropertyValueSource: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI23QQmlPropertyValueSource)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+
+Class QQmlPropertyValueSource
+ size=8 align=8
+ base size=8 base align=8
+QQmlPropertyValueSource (0x0x7f784cbbda80) 0 nearly-empty
+ vptr=((& QQmlPropertyValueSource::_ZTV23QQmlPropertyValueSource) + 16)
+
+Class QQmlPrivate::RegisterType
+ size=128 align=8
+ base size=124 base align=8
+QQmlPrivate::RegisterType (0x0x7f784c5d2c60) 0
+
+Class QQmlPrivate::RegisterTypeAndRevisions
+ size=112 align=8
+ base size=112 base align=8
+QQmlPrivate::RegisterTypeAndRevisions (0x0x7f784c5d2cc0) 0
+
+Class QQmlPrivate::RegisterInterface
+ size=40 align=8
+ base size=40 base align=8
+QQmlPrivate::RegisterInterface (0x0x7f784c5d2d20) 0
+
+Class QQmlPrivate::RegisterAutoParent
+ size=16 align=8
+ base size=16 base align=8
+QQmlPrivate::RegisterAutoParent (0x0x7f784c5d2d80) 0
+
+Class QQmlPrivate::RegisterSingletonType
+ size=96 align=8
+ base size=96 base align=8
+QQmlPrivate::RegisterSingletonType (0x0x7f784c5d2de0) 0
+
+Class QQmlPrivate::RegisterSingletonTypeAndRevisions
+ size=88 align=8
+ base size=88 base align=8
+QQmlPrivate::RegisterSingletonTypeAndRevisions (0x0x7f784bb82000) 0
+
+Class QQmlPrivate::RegisterCompositeType
+ size=32 align=8
+ base size=32 base align=8
+QQmlPrivate::RegisterCompositeType (0x0x7f784bb82060) 0
+
+Class QQmlPrivate::RegisterCompositeSingletonType
+ size=32 align=8
+ base size=32 base align=8
+QQmlPrivate::RegisterCompositeSingletonType (0x0x7f784bb820c0) 0
+
+Class QQmlPrivate::CachedQmlUnit
+ size=24 align=8
+ base size=24 base align=8
+QQmlPrivate::CachedQmlUnit (0x0x7f784bb82120) 0
+
+Class QQmlPrivate::RegisterQmlUnitCacheHook
+ size=16 align=8
+ base size=16 base align=8
+QQmlPrivate::RegisterQmlUnitCacheHook (0x0x7f784bb82180) 0
+
+Class QQmlPrivate::RegisterSingletonFunctor
+ size=24 align=8
+ base size=17 base align=8
+QQmlPrivate::RegisterSingletonFunctor (0x0x7f784bb821e0) 0
+
+Vtable for QQmlAbstractUrlInterceptor
+QQmlAbstractUrlInterceptor::_ZTV26QQmlAbstractUrlInterceptor: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI26QQmlAbstractUrlInterceptor)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+
+Class QQmlAbstractUrlInterceptor
+ size=8 align=8
+ base size=8 base align=8
+QQmlAbstractUrlInterceptor (0x0x7f7849168360) 0 nearly-empty
+ vptr=((& QQmlAbstractUrlInterceptor::_ZTV26QQmlAbstractUrlInterceptor) + 16)
+
+Class QQmlError
+ size=8 align=8
+ base size=8 base align=8
+QQmlError (0x0x7f78491683c0) 0
+
+Vtable for QQmlImageProviderBase
+QQmlImageProviderBase::_ZTV21QQmlImageProviderBase: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI21QQmlImageProviderBase)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+
+Class QQmlImageProviderBase
+ size=8 align=8
+ base size=8 base align=8
+QQmlImageProviderBase (0x0x7f7849187300) 0 nearly-empty
+ vptr=((& QQmlImageProviderBase::_ZTV21QQmlImageProviderBase) + 16)
+
+Class QQmlEngine::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQmlEngine::QPrivateSignal (0x0x7f7849187a80) 0 empty
+
+Vtable for QQmlEngine
+QQmlEngine::_ZTV10QQmlEngine: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QQmlEngine)
+16 (int (*)(...))QQmlEngine::metaObject
+24 (int (*)(...))QQmlEngine::qt_metacast
+32 (int (*)(...))QQmlEngine::qt_metacall
+40 (int (*)(...))QQmlEngine::~QQmlEngine
+48 (int (*)(...))QQmlEngine::~QQmlEngine
+56 (int (*)(...))QQmlEngine::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QQmlEngine
+ size=24 align=8
+ base size=24 base align=8
+QQmlEngine (0x0x7f7849183f70) 0
+ vptr=((& QQmlEngine::_ZTV10QQmlEngine) + 16)
+ QJSEngine (0x0x7f784919b000) 0
+ primary-for QQmlEngine (0x0x7f7849183f70)
+ QObject (0x0x7f7849187a20) 0
+ primary-for QJSEngine (0x0x7f784919b000)
+
+Class QQmlApplicationEngine::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQmlApplicationEngine::QPrivateSignal (0x0x7f7849187d20) 0 empty
+
+Vtable for QQmlApplicationEngine
+QQmlApplicationEngine::_ZTV21QQmlApplicationEngine: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI21QQmlApplicationEngine)
+16 (int (*)(...))QQmlApplicationEngine::metaObject
+24 (int (*)(...))QQmlApplicationEngine::qt_metacast
+32 (int (*)(...))QQmlApplicationEngine::qt_metacall
+40 (int (*)(...))QQmlApplicationEngine::~QQmlApplicationEngine
+48 (int (*)(...))QQmlApplicationEngine::~QQmlApplicationEngine
+56 (int (*)(...))QQmlEngine::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QQmlApplicationEngine
+ size=24 align=8
+ base size=24 base align=8
+QQmlApplicationEngine (0x0x7f784919b068) 0
+ vptr=((& QQmlApplicationEngine::_ZTV21QQmlApplicationEngine) + 16)
+ QQmlEngine (0x0x7f784919b0d0) 0
+ primary-for QQmlApplicationEngine (0x0x7f784919b068)
+ QJSEngine (0x0x7f784919b138) 0
+ primary-for QQmlEngine (0x0x7f784919b0d0)
+ QObject (0x0x7f7849187cc0) 0
+ primary-for QJSEngine (0x0x7f784919b138)
+
+Class QQmlComponent::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQmlComponent::QPrivateSignal (0x0x7f7849187f60) 0 empty
+
+Vtable for QQmlComponent
+QQmlComponent::_ZTV13QQmlComponent: 17 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QQmlComponent)
+16 (int (*)(...))QQmlComponent::metaObject
+24 (int (*)(...))QQmlComponent::qt_metacast
+32 (int (*)(...))QQmlComponent::qt_metacall
+40 (int (*)(...))QQmlComponent::~QQmlComponent
+48 (int (*)(...))QQmlComponent::~QQmlComponent
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QQmlComponent::create
+120 (int (*)(...))QQmlComponent::beginCreate
+128 (int (*)(...))QQmlComponent::completeCreate
+
+Class QQmlComponent
+ size=16 align=8
+ base size=16 base align=8
+QQmlComponent (0x0x7f784919b1a0) 0
+ vptr=((& QQmlComponent::_ZTV13QQmlComponent) + 16)
+ QObject (0x0x7f7849187f00) 0
+ primary-for QQmlComponent (0x0x7f784919b1a0)
+
+Class QQmlContext::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQmlContext::QPrivateSignal (0x0x7f78491ba840) 0 empty
+
+Class QQmlContext::PropertyPair
+ size=24 align=8
+ base size=24 base align=8
+QQmlContext::PropertyPair (0x0x7f78491ba8a0) 0
+
+Vtable for QQmlContext
+QQmlContext::_ZTV11QQmlContext: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QQmlContext)
+16 (int (*)(...))QQmlContext::metaObject
+24 (int (*)(...))QQmlContext::qt_metacast
+32 (int (*)(...))QQmlContext::qt_metacall
+40 (int (*)(...))QQmlContext::~QQmlContext
+48 (int (*)(...))QQmlContext::~QQmlContext
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QQmlContext
+ size=16 align=8
+ base size=16 base align=8
+QQmlContext (0x0x7f784919b208) 0
+ vptr=((& QQmlContext::_ZTV11QQmlContext) + 16)
+ QObject (0x0x7f78491ba7e0) 0
+ primary-for QQmlContext (0x0x7f784919b208)
+
+Class QQmlScriptString
+ size=8 align=8
+ base size=8 base align=8
+QQmlScriptString (0x0x7f78491bac60) 0
+
+Class QQmlExpression::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQmlExpression::QPrivateSignal (0x0x7f78491baf60) 0 empty
+
+Vtable for QQmlExpression
+QQmlExpression::_ZTV14QQmlExpression: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QQmlExpression)
+16 (int (*)(...))QQmlExpression::metaObject
+24 (int (*)(...))QQmlExpression::qt_metacast
+32 (int (*)(...))QQmlExpression::qt_metacall
+40 (int (*)(...))QQmlExpression::~QQmlExpression
+48 (int (*)(...))QQmlExpression::~QQmlExpression
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QQmlExpression
+ size=16 align=8
+ base size=16 base align=8
+QQmlExpression (0x0x7f784919b270) 0
+ vptr=((& QQmlExpression::_ZTV14QQmlExpression) + 16)
+ QObject (0x0x7f78491baf00) 0
+ primary-for QQmlExpression (0x0x7f784919b270)
+
+Vtable for QQmlTypesExtensionInterface
+QQmlTypesExtensionInterface::_ZTV27QQmlTypesExtensionInterface: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI27QQmlTypesExtensionInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+
+Class QQmlTypesExtensionInterface
+ size=8 align=8
+ base size=8 base align=8
+QQmlTypesExtensionInterface (0x0x7f78491e6180) 0 nearly-empty
+ vptr=((& QQmlTypesExtensionInterface::_ZTV27QQmlTypesExtensionInterface) + 16)
+
+Vtable for QQmlExtensionInterface
+QQmlExtensionInterface::_ZTV22QQmlExtensionInterface: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI22QQmlExtensionInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+
+Class QQmlExtensionInterface
+ size=8 align=8
+ base size=8 base align=8
+QQmlExtensionInterface (0x0x7f784919b2d8) 0 nearly-empty
+ vptr=((& QQmlExtensionInterface::_ZTV22QQmlExtensionInterface) + 16)
+ QQmlTypesExtensionInterface (0x0x7f78491e61e0) 0 nearly-empty
+ primary-for QQmlExtensionInterface (0x0x7f784919b2d8)
+
+Vtable for QQmlEngineExtensionInterface
+QQmlEngineExtensionInterface::_ZTV28QQmlEngineExtensionInterface: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI28QQmlEngineExtensionInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+
+Class QQmlEngineExtensionInterface
+ size=8 align=8
+ base size=8 base align=8
+QQmlEngineExtensionInterface (0x0x7f78491e6240) 0 nearly-empty
+ vptr=((& QQmlEngineExtensionInterface::_ZTV28QQmlEngineExtensionInterface) + 16)
+
+Class QQmlExtensionPlugin::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQmlExtensionPlugin::QPrivateSignal (0x0x7f78491e67e0) 0 empty
+
+Vtable for QQmlExtensionPlugin
+QQmlExtensionPlugin::_ZTV19QQmlExtensionPlugin: 22 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QQmlExtensionPlugin)
+16 (int (*)(...))QQmlExtensionPlugin::metaObject
+24 (int (*)(...))QQmlExtensionPlugin::qt_metacast
+32 (int (*)(...))QQmlExtensionPlugin::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))QQmlExtensionPlugin::initializeEngine
+128 (int (*)(...))-16
+136 (int (*)(...))(& _ZTI19QQmlExtensionPlugin)
+144 0
+152 0
+160 (int (*)(...))__cxa_pure_virtual
+168 (int (*)(...))QQmlExtensionPlugin::_ZThn16_N19QQmlExtensionPlugin16initializeEngineEP10QQmlEnginePKc
+
+Class QQmlExtensionPlugin
+ size=24 align=8
+ base size=24 base align=8
+QQmlExtensionPlugin (0x0x7f784ccf8bd0) 0
+ vptr=((& QQmlExtensionPlugin::_ZTV19QQmlExtensionPlugin) + 16)
+ QObject (0x0x7f78491e6720) 0
+ primary-for QQmlExtensionPlugin (0x0x7f784ccf8bd0)
+ QQmlExtensionInterface (0x0x7f784919b340) 16 nearly-empty
+ vptr=((& QQmlExtensionPlugin::_ZTV19QQmlExtensionPlugin) + 144)
+ QQmlTypesExtensionInterface (0x0x7f78491e6780) 16 nearly-empty
+ primary-for QQmlExtensionInterface (0x0x7f784919b340)
+
+Class QQmlEngineExtensionPlugin::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQmlEngineExtensionPlugin::QPrivateSignal (0x0x7f78491e6a80) 0 empty
+
+Vtable for QQmlEngineExtensionPlugin
+QQmlEngineExtensionPlugin::_ZTV25QQmlEngineExtensionPlugin: 20 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI25QQmlEngineExtensionPlugin)
+16 (int (*)(...))QQmlEngineExtensionPlugin::metaObject
+24 (int (*)(...))QQmlEngineExtensionPlugin::qt_metacast
+32 (int (*)(...))QQmlEngineExtensionPlugin::qt_metacall
+40 (int (*)(...))QQmlEngineExtensionPlugin::~QQmlEngineExtensionPlugin
+48 (int (*)(...))QQmlEngineExtensionPlugin::~QQmlEngineExtensionPlugin
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QQmlEngineExtensionPlugin::initializeEngine
+120 (int (*)(...))-16
+128 (int (*)(...))(& _ZTI25QQmlEngineExtensionPlugin)
+136 (int (*)(...))QQmlEngineExtensionPlugin::_ZThn16_N25QQmlEngineExtensionPluginD1Ev
+144 (int (*)(...))QQmlEngineExtensionPlugin::_ZThn16_N25QQmlEngineExtensionPluginD0Ev
+152 (int (*)(...))QQmlEngineExtensionPlugin::_ZThn16_N25QQmlEngineExtensionPlugin16initializeEngineEP10QQmlEnginePKc
+
+Class QQmlEngineExtensionPlugin
+ size=24 align=8
+ base size=24 base align=8
+QQmlEngineExtensionPlugin (0x0x7f784ccf85b0) 0
+ vptr=((& QQmlEngineExtensionPlugin::_ZTV25QQmlEngineExtensionPlugin) + 16)
+ QObject (0x0x7f78491e69c0) 0
+ primary-for QQmlEngineExtensionPlugin (0x0x7f784ccf85b0)
+ QQmlEngineExtensionInterface (0x0x7f78491e6a20) 16 nearly-empty
+ vptr=((& QQmlEngineExtensionPlugin::_ZTV25QQmlEngineExtensionPlugin) + 136)
+
+Class QQmlFile
+ size=8 align=8
+ base size=8 base align=8
+QQmlFile (0x0x7f78491e6ba0) 0
+
+Class QQmlFileSelector::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQmlFileSelector::QPrivateSignal (0x0x7f78491e6c60) 0 empty
+
+Vtable for QQmlFileSelector
+QQmlFileSelector::_ZTV16QQmlFileSelector: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QQmlFileSelector)
+16 (int (*)(...))QQmlFileSelector::metaObject
+24 (int (*)(...))QQmlFileSelector::qt_metacast
+32 (int (*)(...))QQmlFileSelector::qt_metacall
+40 (int (*)(...))QQmlFileSelector::~QQmlFileSelector
+48 (int (*)(...))QQmlFileSelector::~QQmlFileSelector
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QQmlFileSelector
+ size=16 align=8
+ base size=16 base align=8
+QQmlFileSelector (0x0x7f784919b410) 0
+ vptr=((& QQmlFileSelector::_ZTV16QQmlFileSelector) + 16)
+ QObject (0x0x7f78491e6c00) 0
+ primary-for QQmlFileSelector (0x0x7f784919b410)
+
+Vtable for QQmlIncubator
+QQmlIncubator::_ZTV13QQmlIncubator: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QQmlIncubator)
+16 (int (*)(...))QQmlIncubator::~QQmlIncubator
+24 (int (*)(...))QQmlIncubator::~QQmlIncubator
+32 (int (*)(...))QQmlIncubator::statusChanged
+40 (int (*)(...))QQmlIncubator::setInitialState
+
+Class QQmlIncubator
+ size=16 align=8
+ base size=16 base align=8
+QQmlIncubator (0x0x7f78491e6e40) 0
+ vptr=((& QQmlIncubator::_ZTV13QQmlIncubator) + 16)
+
+Vtable for QQmlIncubationController
+QQmlIncubationController::_ZTV24QQmlIncubationController: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI24QQmlIncubationController)
+16 (int (*)(...))QQmlIncubationController::~QQmlIncubationController
+24 (int (*)(...))QQmlIncubationController::~QQmlIncubationController
+32 (int (*)(...))QQmlIncubationController::incubatingObjectCountChanged
+
+Class QQmlIncubationController
+ size=16 align=8
+ base size=16 base align=8
+QQmlIncubationController (0x0x7f78491e6ea0) 0
+ vptr=((& QQmlIncubationController::_ZTV24QQmlIncubationController) + 16)
+
+Class QQmlInfo
+ size=16 align=8
+ base size=16 base align=8
+QQmlInfo (0x0x7f784919b478) 0
+ QDebug (0x0x7f78491e6f00) 0
+
+Class QQmlModuleRegistration
+ size=8 align=8
+ base size=8 base align=8
+QQmlModuleRegistration (0x0x7f7849212ea0) 0
+
+Vtable for QQmlNetworkAccessManagerFactory
+QQmlNetworkAccessManagerFactory::_ZTV31QQmlNetworkAccessManagerFactory: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI31QQmlNetworkAccessManagerFactory)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+
+Class QQmlNetworkAccessManagerFactory
+ size=8 align=8
+ base size=8 base align=8
+QQmlNetworkAccessManagerFactory (0x0x7f7849212f00) 0 nearly-empty
+ vptr=((& QQmlNetworkAccessManagerFactory::_ZTV31QQmlNetworkAccessManagerFactory) + 16)
+
+Class QQmlProperty
+ size=8 align=8
+ base size=8 base align=8
+QQmlProperty (0x0x7f7849212f60) 0
+
+Class QQmlPropertyMap::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQmlPropertyMap::QPrivateSignal (0x0x7f784923b7e0) 0 empty
+
+Vtable for QQmlPropertyMap
+QQmlPropertyMap::_ZTV15QQmlPropertyMap: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QQmlPropertyMap)
+16 (int (*)(...))QQmlPropertyMap::metaObject
+24 (int (*)(...))QQmlPropertyMap::qt_metacast
+32 (int (*)(...))QQmlPropertyMap::qt_metacall
+40 (int (*)(...))QQmlPropertyMap::~QQmlPropertyMap
+48 (int (*)(...))QQmlPropertyMap::~QQmlPropertyMap
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QQmlPropertyMap::updateValue
+
+Class QQmlPropertyMap
+ size=16 align=8
+ base size=16 base align=8
+QQmlPropertyMap (0x0x7f7849238a90) 0
+ vptr=((& QQmlPropertyMap::_ZTV15QQmlPropertyMap) + 16)
+ QObject (0x0x7f784923b780) 0
+ primary-for QQmlPropertyMap (0x0x7f7849238a90)
+
+Class QQuickTransform::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQuickTransform::QPrivateSignal (0x0x7f784923ba80) 0 empty
+
+Vtable for QQuickTransform
+QQuickTransform::_ZTV15QQuickTransform: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QQuickTransform)
+16 (int (*)(...))QQuickTransform::metaObject
+24 (int (*)(...))QQuickTransform::qt_metacast
+32 (int (*)(...))QQuickTransform::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+
+Class QQuickTransform
+ size=16 align=8
+ base size=16 base align=8
+QQuickTransform (0x0x7f7849238af8) 0
+ vptr=((& QQuickTransform::_ZTV15QQuickTransform) + 16)
+ QObject (0x0x7f784923ba20) 0
+ primary-for QQuickTransform (0x0x7f7849238af8)
+
+Class QQuickItem::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQuickItem::QPrivateSignal (0x0x7f784923bd20) 0 empty
+
+Class QQuickItem::ItemChangeData
+ size=8 align=8
+ base size=8 base align=8
+QQuickItem::ItemChangeData (0x0x7f784923bd80) 0
+
+Class QQuickItem::UpdatePaintNodeData
+ size=8 align=8
+ base size=8 base align=8
+QQuickItem::UpdatePaintNodeData (0x0x7f784923bde0) 0
+
+Vtable for QQuickItem
+QQuickItem::_ZTV10QQuickItem: 55 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QQuickItem)
+16 (int (*)(...))QQuickItem::metaObject
+24 (int (*)(...))QQuickItem::qt_metacast
+32 (int (*)(...))QQuickItem::qt_metacall
+40 (int (*)(...))QQuickItem::~QQuickItem
+48 (int (*)(...))QQuickItem::~QQuickItem
+56 (int (*)(...))QQuickItem::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QQuickItem::boundingRect
+120 (int (*)(...))QQuickItem::clipRect
+128 (int (*)(...))QQuickItem::contains
+136 (int (*)(...))QQuickItem::inputMethodQuery
+144 (int (*)(...))QQuickItem::isTextureProvider
+152 (int (*)(...))QQuickItem::textureProvider
+160 (int (*)(...))QQuickItem::itemChange
+168 (int (*)(...))QQuickItem::classBegin
+176 (int (*)(...))QQuickItem::componentComplete
+184 (int (*)(...))QQuickItem::keyPressEvent
+192 (int (*)(...))QQuickItem::keyReleaseEvent
+200 (int (*)(...))QQuickItem::inputMethodEvent
+208 (int (*)(...))QQuickItem::focusInEvent
+216 (int (*)(...))QQuickItem::focusOutEvent
+224 (int (*)(...))QQuickItem::mousePressEvent
+232 (int (*)(...))QQuickItem::mouseMoveEvent
+240 (int (*)(...))QQuickItem::mouseReleaseEvent
+248 (int (*)(...))QQuickItem::mouseDoubleClickEvent
+256 (int (*)(...))QQuickItem::mouseUngrabEvent
+264 (int (*)(...))QQuickItem::touchUngrabEvent
+272 (int (*)(...))QQuickItem::wheelEvent
+280 (int (*)(...))QQuickItem::touchEvent
+288 (int (*)(...))QQuickItem::hoverEnterEvent
+296 (int (*)(...))QQuickItem::hoverMoveEvent
+304 (int (*)(...))QQuickItem::hoverLeaveEvent
+312 (int (*)(...))QQuickItem::dragEnterEvent
+320 (int (*)(...))QQuickItem::dragMoveEvent
+328 (int (*)(...))QQuickItem::dragLeaveEvent
+336 (int (*)(...))QQuickItem::dropEvent
+344 (int (*)(...))QQuickItem::childMouseEventFilter
+352 (int (*)(...))QQuickItem::windowDeactivateEvent
+360 (int (*)(...))QQuickItem::geometryChanged
+368 (int (*)(...))QQuickItem::updatePaintNode
+376 (int (*)(...))QQuickItem::releaseResources
+384 (int (*)(...))QQuickItem::updatePolish
+392 (int (*)(...))-16
+400 (int (*)(...))(& _ZTI10QQuickItem)
+408 (int (*)(...))QQuickItem::_ZThn16_N10QQuickItemD1Ev
+416 (int (*)(...))QQuickItem::_ZThn16_N10QQuickItemD0Ev
+424 (int (*)(...))QQuickItem::_ZThn16_N10QQuickItem10classBeginEv
+432 (int (*)(...))QQuickItem::_ZThn16_N10QQuickItem17componentCompleteEv
+
+Class QQuickItem
+ size=32 align=8
+ base size=32 base align=8
+QQuickItem (0x0x7f784cabf310) 0
+ vptr=((& QQuickItem::_ZTV10QQuickItem) + 16)
+ QObject (0x0x7f784923bc60) 0
+ primary-for QQuickItem (0x0x7f784cabf310)
+ QQmlParserStatus (0x0x7f784923bcc0) 16
+ vptr=((& QQuickItem::_ZTV10QQuickItem) + 408)
+
+Class QQuickFramebufferObject::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQuickFramebufferObject::QPrivateSignal (0x0x7f7849281780) 0 empty
+
+Vtable for QQuickFramebufferObject::Renderer
+QQuickFramebufferObject::Renderer::_ZTVN23QQuickFramebufferObject8RendererE: 7 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTIN23QQuickFramebufferObject8RendererE)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))QQuickFramebufferObject::Renderer::createFramebufferObject
+48 (int (*)(...))QQuickFramebufferObject::Renderer::synchronize
+
+Class QQuickFramebufferObject::Renderer
+ size=16 align=8
+ base size=16 base align=8
+QQuickFramebufferObject::Renderer (0x0x7f78492817e0) 0
+ vptr=((& QQuickFramebufferObject::Renderer::_ZTVN23QQuickFramebufferObject8RendererE) + 16)
+
+Vtable for QQuickFramebufferObject
+QQuickFramebufferObject::_ZTV23QQuickFramebufferObject: 56 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI23QQuickFramebufferObject)
+16 (int (*)(...))QQuickFramebufferObject::metaObject
+24 (int (*)(...))QQuickFramebufferObject::qt_metacast
+32 (int (*)(...))QQuickFramebufferObject::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QQuickItem::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QQuickItem::boundingRect
+120 (int (*)(...))QQuickItem::clipRect
+128 (int (*)(...))QQuickItem::contains
+136 (int (*)(...))QQuickItem::inputMethodQuery
+144 (int (*)(...))QQuickFramebufferObject::isTextureProvider
+152 (int (*)(...))QQuickFramebufferObject::textureProvider
+160 (int (*)(...))QQuickItem::itemChange
+168 (int (*)(...))QQuickItem::classBegin
+176 (int (*)(...))QQuickItem::componentComplete
+184 (int (*)(...))QQuickItem::keyPressEvent
+192 (int (*)(...))QQuickItem::keyReleaseEvent
+200 (int (*)(...))QQuickItem::inputMethodEvent
+208 (int (*)(...))QQuickItem::focusInEvent
+216 (int (*)(...))QQuickItem::focusOutEvent
+224 (int (*)(...))QQuickItem::mousePressEvent
+232 (int (*)(...))QQuickItem::mouseMoveEvent
+240 (int (*)(...))QQuickItem::mouseReleaseEvent
+248 (int (*)(...))QQuickItem::mouseDoubleClickEvent
+256 (int (*)(...))QQuickItem::mouseUngrabEvent
+264 (int (*)(...))QQuickItem::touchUngrabEvent
+272 (int (*)(...))QQuickItem::wheelEvent
+280 (int (*)(...))QQuickItem::touchEvent
+288 (int (*)(...))QQuickItem::hoverEnterEvent
+296 (int (*)(...))QQuickItem::hoverMoveEvent
+304 (int (*)(...))QQuickItem::hoverLeaveEvent
+312 (int (*)(...))QQuickItem::dragEnterEvent
+320 (int (*)(...))QQuickItem::dragMoveEvent
+328 (int (*)(...))QQuickItem::dragLeaveEvent
+336 (int (*)(...))QQuickItem::dropEvent
+344 (int (*)(...))QQuickItem::childMouseEventFilter
+352 (int (*)(...))QQuickItem::windowDeactivateEvent
+360 (int (*)(...))QQuickFramebufferObject::geometryChanged
+368 (int (*)(...))QQuickFramebufferObject::updatePaintNode
+376 (int (*)(...))QQuickFramebufferObject::releaseResources
+384 (int (*)(...))QQuickItem::updatePolish
+392 (int (*)(...))__cxa_pure_virtual
+400 (int (*)(...))-16
+408 (int (*)(...))(& _ZTI23QQuickFramebufferObject)
+416 0
+424 0
+432 (int (*)(...))QQuickItem::_ZThn16_N10QQuickItem10classBeginEv
+440 (int (*)(...))QQuickItem::_ZThn16_N10QQuickItem17componentCompleteEv
+
+Class QQuickFramebufferObject
+ size=32 align=8
+ base size=32 base align=8
+QQuickFramebufferObject (0x0x7f7849238c30) 0
+ vptr=((& QQuickFramebufferObject::_ZTV23QQuickFramebufferObject) + 16)
+ QQuickItem (0x0x7f784c80b7e0) 0
+ primary-for QQuickFramebufferObject (0x0x7f7849238c30)
+ QObject (0x0x7f78492816c0) 0
+ primary-for QQuickItem (0x0x7f784c80b7e0)
+ QQmlParserStatus (0x0x7f7849281720) 16
+ vptr=((& QQuickFramebufferObject::_ZTV23QQuickFramebufferObject) + 416)
+
+Class QQuickTextureFactory::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQuickTextureFactory::QPrivateSignal (0x0x7f7849281a20) 0 empty
+
+Vtable for QQuickTextureFactory
+QQuickTextureFactory::_ZTV20QQuickTextureFactory: 18 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QQuickTextureFactory)
+16 (int (*)(...))QQuickTextureFactory::metaObject
+24 (int (*)(...))QQuickTextureFactory::qt_metacast
+32 (int (*)(...))QQuickTextureFactory::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))__cxa_pure_virtual
+136 (int (*)(...))QQuickTextureFactory::image
+
+Class QQuickTextureFactory
+ size=16 align=8
+ base size=16 base align=8
+QQuickTextureFactory (0x0x7f7849238c98) 0
+ vptr=((& QQuickTextureFactory::_ZTV20QQuickTextureFactory) + 16)
+ QObject (0x0x7f78492819c0) 0
+ primary-for QQuickTextureFactory (0x0x7f7849238c98)
+
+Class QQuickImageResponse::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQuickImageResponse::QPrivateSignal (0x0x7f7849281ba0) 0 empty
+
+Vtable for QQuickImageResponse
+QQuickImageResponse::_ZTV19QQuickImageResponse: 17 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QQuickImageResponse)
+16 (int (*)(...))QQuickImageResponse::metaObject
+24 (int (*)(...))QQuickImageResponse::qt_metacast
+32 (int (*)(...))QQuickImageResponse::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))QQuickImageResponse::errorString
+128 (int (*)(...))QQuickImageResponse::cancel
+
+Class QQuickImageResponse
+ size=16 align=8
+ base size=16 base align=8
+QQuickImageResponse (0x0x7f7849238d00) 0
+ vptr=((& QQuickImageResponse::_ZTV19QQuickImageResponse) + 16)
+ QObject (0x0x7f7849281b40) 0
+ primary-for QQuickImageResponse (0x0x7f7849238d00)
+
+Vtable for QQuickImageProvider
+QQuickImageProvider::_ZTV19QQuickImageProvider: 9 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QQuickImageProvider)
+16 (int (*)(...))QQuickImageProvider::~QQuickImageProvider
+24 (int (*)(...))QQuickImageProvider::~QQuickImageProvider
+32 (int (*)(...))QQuickImageProvider::imageType
+40 (int (*)(...))QQuickImageProvider::flags
+48 (int (*)(...))QQuickImageProvider::requestImage
+56 (int (*)(...))QQuickImageProvider::requestPixmap
+64 (int (*)(...))QQuickImageProvider::requestTexture
+
+Class QQuickImageProvider
+ size=16 align=8
+ base size=16 base align=8
+QQuickImageProvider (0x0x7f7849238d68) 0
+ vptr=((& QQuickImageProvider::_ZTV19QQuickImageProvider) + 16)
+ QQmlImageProviderBase (0x0x7f7849281d80) 0 nearly-empty
+ primary-for QQuickImageProvider (0x0x7f7849238d68)
+
+Vtable for QQuickAsyncImageProvider
+QQuickAsyncImageProvider::_ZTV24QQuickAsyncImageProvider: 10 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI24QQuickAsyncImageProvider)
+16 0
+24 0
+32 (int (*)(...))QQuickImageProvider::imageType
+40 (int (*)(...))QQuickImageProvider::flags
+48 (int (*)(...))QQuickImageProvider::requestImage
+56 (int (*)(...))QQuickImageProvider::requestPixmap
+64 (int (*)(...))QQuickImageProvider::requestTexture
+72 (int (*)(...))__cxa_pure_virtual
+
+Class QQuickAsyncImageProvider
+ size=24 align=8
+ base size=24 base align=8
+QQuickAsyncImageProvider (0x0x7f7849238dd0) 0
+ vptr=((& QQuickAsyncImageProvider::_ZTV24QQuickAsyncImageProvider) + 16)
+ QQuickImageProvider (0x0x7f7849238e38) 0
+ primary-for QQuickAsyncImageProvider (0x0x7f7849238dd0)
+ QQmlImageProviderBase (0x0x7f78492ac000) 0 nearly-empty
+ primary-for QQuickImageProvider (0x0x7f7849238e38)
+
+Class QQuickItemGrabResult::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQuickItemGrabResult::QPrivateSignal (0x0x7f78492ac0c0) 0 empty
+
+Vtable for QQuickItemGrabResult
+QQuickItemGrabResult::_ZTV20QQuickItemGrabResult: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QQuickItemGrabResult)
+16 (int (*)(...))QQuickItemGrabResult::metaObject
+24 (int (*)(...))QQuickItemGrabResult::qt_metacast
+32 (int (*)(...))QQuickItemGrabResult::qt_metacall
+40 (int (*)(...))QQuickItemGrabResult::~QQuickItemGrabResult
+48 (int (*)(...))QQuickItemGrabResult::~QQuickItemGrabResult
+56 (int (*)(...))QQuickItemGrabResult::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QQuickItemGrabResult
+ size=16 align=8
+ base size=16 base align=8
+QQuickItemGrabResult (0x0x7f7849238ea0) 0
+ vptr=((& QQuickItemGrabResult::_ZTV20QQuickItemGrabResult) + 16)
+ QObject (0x0x7f78492ac060) 0
+ primary-for QQuickItemGrabResult (0x0x7f7849238ea0)
+
+Class QQuickPaintedItem::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQuickPaintedItem::QPrivateSignal (0x0x7f78492ac360) 0 empty
+
+Vtable for QQuickPaintedItem
+QQuickPaintedItem::_ZTV17QQuickPaintedItem: 56 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QQuickPaintedItem)
+16 (int (*)(...))QQuickPaintedItem::metaObject
+24 (int (*)(...))QQuickPaintedItem::qt_metacast
+32 (int (*)(...))QQuickPaintedItem::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QQuickItem::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QQuickItem::boundingRect
+120 (int (*)(...))QQuickItem::clipRect
+128 (int (*)(...))QQuickItem::contains
+136 (int (*)(...))QQuickItem::inputMethodQuery
+144 (int (*)(...))QQuickPaintedItem::isTextureProvider
+152 (int (*)(...))QQuickPaintedItem::textureProvider
+160 (int (*)(...))QQuickPaintedItem::itemChange
+168 (int (*)(...))QQuickItem::classBegin
+176 (int (*)(...))QQuickItem::componentComplete
+184 (int (*)(...))QQuickItem::keyPressEvent
+192 (int (*)(...))QQuickItem::keyReleaseEvent
+200 (int (*)(...))QQuickItem::inputMethodEvent
+208 (int (*)(...))QQuickItem::focusInEvent
+216 (int (*)(...))QQuickItem::focusOutEvent
+224 (int (*)(...))QQuickItem::mousePressEvent
+232 (int (*)(...))QQuickItem::mouseMoveEvent
+240 (int (*)(...))QQuickItem::mouseReleaseEvent
+248 (int (*)(...))QQuickItem::mouseDoubleClickEvent
+256 (int (*)(...))QQuickItem::mouseUngrabEvent
+264 (int (*)(...))QQuickItem::touchUngrabEvent
+272 (int (*)(...))QQuickItem::wheelEvent
+280 (int (*)(...))QQuickItem::touchEvent
+288 (int (*)(...))QQuickItem::hoverEnterEvent
+296 (int (*)(...))QQuickItem::hoverMoveEvent
+304 (int (*)(...))QQuickItem::hoverLeaveEvent
+312 (int (*)(...))QQuickItem::dragEnterEvent
+320 (int (*)(...))QQuickItem::dragMoveEvent
+328 (int (*)(...))QQuickItem::dragLeaveEvent
+336 (int (*)(...))QQuickItem::dropEvent
+344 (int (*)(...))QQuickItem::childMouseEventFilter
+352 (int (*)(...))QQuickItem::windowDeactivateEvent
+360 (int (*)(...))QQuickItem::geometryChanged
+368 (int (*)(...))QQuickPaintedItem::updatePaintNode
+376 (int (*)(...))QQuickPaintedItem::releaseResources
+384 (int (*)(...))QQuickItem::updatePolish
+392 (int (*)(...))__cxa_pure_virtual
+400 (int (*)(...))-16
+408 (int (*)(...))(& _ZTI17QQuickPaintedItem)
+416 0
+424 0
+432 (int (*)(...))QQuickItem::_ZThn16_N10QQuickItem10classBeginEv
+440 (int (*)(...))QQuickItem::_ZThn16_N10QQuickItem17componentCompleteEv
+
+Class QQuickPaintedItem
+ size=32 align=8
+ base size=32 base align=8
+QQuickPaintedItem (0x0x7f7849238f08) 0
+ vptr=((& QQuickPaintedItem::_ZTV17QQuickPaintedItem) + 16)
+ QQuickItem (0x0x7f784c80be70) 0
+ primary-for QQuickPaintedItem (0x0x7f7849238f08)
+ QObject (0x0x7f78492ac2a0) 0
+ primary-for QQuickItem (0x0x7f784c80be70)
+ QQmlParserStatus (0x0x7f78492ac300) 16
+ vptr=((& QQuickPaintedItem::_ZTV17QQuickPaintedItem) + 416)
+
+Class QQuickRenderControl::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQuickRenderControl::QPrivateSignal (0x0x7f78492acde0) 0 empty
+
+Vtable for QQuickRenderControl
+QQuickRenderControl::_ZTV19QQuickRenderControl: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QQuickRenderControl)
+16 (int (*)(...))QQuickRenderControl::metaObject
+24 (int (*)(...))QQuickRenderControl::qt_metacast
+32 (int (*)(...))QQuickRenderControl::qt_metacall
+40 (int (*)(...))QQuickRenderControl::~QQuickRenderControl
+48 (int (*)(...))QQuickRenderControl::~QQuickRenderControl
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QQuickRenderControl::renderWindow
+
+Class QQuickRenderControl
+ size=16 align=8
+ base size=16 base align=8
+QQuickRenderControl (0x0x7f78492be0d0) 0
+ vptr=((& QQuickRenderControl::_ZTV19QQuickRenderControl) + 16)
+ QObject (0x0x7f78492acd80) 0
+ primary-for QQuickRenderControl (0x0x7f78492be0d0)
+
+Class QQuickTextDocument::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQuickTextDocument::QPrivateSignal (0x0x7f78492d10c0) 0 empty
+
+Vtable for QQuickTextDocument
+QQuickTextDocument::_ZTV18QQuickTextDocument: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QQuickTextDocument)
+16 (int (*)(...))QQuickTextDocument::metaObject
+24 (int (*)(...))QQuickTextDocument::qt_metacast
+32 (int (*)(...))QQuickTextDocument::qt_metacall
+40 (int (*)(...))QQuickTextDocument::~QQuickTextDocument
+48 (int (*)(...))QQuickTextDocument::~QQuickTextDocument
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QQuickTextDocument
+ size=16 align=8
+ base size=16 base align=8
+QQuickTextDocument (0x0x7f78492be138) 0
+ vptr=((& QQuickTextDocument::_ZTV18QQuickTextDocument) + 16)
+ QObject (0x0x7f78492d1060) 0
+ primary-for QQuickTextDocument (0x0x7f78492be138)
+
+Class QSGGeometry::Attribute
+ size=16 align=4
+ base size=16 base align=4
+QSGGeometry::Attribute (0x0x7f78492d1720) 0
+
+Class QSGGeometry::AttributeSet
+ size=16 align=8
+ base size=16 base align=8
+QSGGeometry::AttributeSet (0x0x7f78492d1780) 0
+
+Class QSGGeometry::Point2D
+ size=8 align=4
+ base size=8 base align=4
+QSGGeometry::Point2D (0x0x7f78492d17e0) 0
+
+Class QSGGeometry::TexturedPoint2D
+ size=16 align=4
+ base size=16 base align=4
+QSGGeometry::TexturedPoint2D (0x0x7f78492d1840) 0
+
+Class QSGGeometry::ColoredPoint2D
+ size=12 align=4
+ base size=12 base align=4
+QSGGeometry::ColoredPoint2D (0x0x7f78492d18a0) 0
+
+Vtable for QSGGeometry
+QSGGeometry::_ZTV11QSGGeometry: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QSGGeometry)
+16 (int (*)(...))QSGGeometry::~QSGGeometry
+24 (int (*)(...))QSGGeometry::~QSGGeometry
+
+Class QSGGeometry
+ size=128 align=8
+ base size=128 base align=8
+QSGGeometry (0x0x7f78492d16c0) 0
+ vptr=((& QSGGeometry::_ZTV11QSGGeometry) + 16)
+
+Vtable for QSGNode
+QSGNode::_ZTV7QSGNode: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI7QSGNode)
+16 (int (*)(...))QSGNode::~QSGNode
+24 (int (*)(...))QSGNode::~QSGNode
+32 (int (*)(...))QSGNode::isSubtreeBlocked
+40 (int (*)(...))QSGNode::preprocess
+
+Class QSGNode
+ size=80 align=8
+ base size=80 base align=8
+QSGNode (0x0x7f78492fe8a0) 0
+ vptr=((& QSGNode::_ZTV7QSGNode) + 16)
+
+Vtable for QSGBasicGeometryNode
+QSGBasicGeometryNode::_ZTV20QSGBasicGeometryNode: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QSGBasicGeometryNode)
+16 (int (*)(...))QSGBasicGeometryNode::~QSGBasicGeometryNode
+24 (int (*)(...))QSGBasicGeometryNode::~QSGBasicGeometryNode
+32 (int (*)(...))QSGNode::isSubtreeBlocked
+40 (int (*)(...))QSGNode::preprocess
+
+Class QSGBasicGeometryNode
+ size=112 align=8
+ base size=112 base align=8
+QSGBasicGeometryNode (0x0x7f78492be820) 0
+ vptr=((& QSGBasicGeometryNode::_ZTV20QSGBasicGeometryNode) + 16)
+ QSGNode (0x0x7f7849330060) 0
+ primary-for QSGBasicGeometryNode (0x0x7f78492be820)
+
+Vtable for QSGGeometryNode
+QSGGeometryNode::_ZTV15QSGGeometryNode: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QSGGeometryNode)
+16 (int (*)(...))QSGGeometryNode::~QSGGeometryNode
+24 (int (*)(...))QSGGeometryNode::~QSGGeometryNode
+32 (int (*)(...))QSGNode::isSubtreeBlocked
+40 (int (*)(...))QSGNode::preprocess
+
+Class QSGGeometryNode
+ size=144 align=8
+ base size=144 base align=8
+QSGGeometryNode (0x0x7f78492be888) 0
+ vptr=((& QSGGeometryNode::_ZTV15QSGGeometryNode) + 16)
+ QSGBasicGeometryNode (0x0x7f78492be8f0) 0
+ primary-for QSGGeometryNode (0x0x7f78492be888)
+ QSGNode (0x0x7f7849330300) 0
+ primary-for QSGBasicGeometryNode (0x0x7f78492be8f0)
+
+Vtable for QSGClipNode
+QSGClipNode::_ZTV11QSGClipNode: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QSGClipNode)
+16 (int (*)(...))QSGClipNode::~QSGClipNode
+24 (int (*)(...))QSGClipNode::~QSGClipNode
+32 (int (*)(...))QSGNode::isSubtreeBlocked
+40 (int (*)(...))QSGNode::preprocess
+
+Class QSGClipNode
+ size=152 align=8
+ base size=152 base align=8
+QSGClipNode (0x0x7f78492be958) 0
+ vptr=((& QSGClipNode::_ZTV11QSGClipNode) + 16)
+ QSGBasicGeometryNode (0x0x7f78492be9c0) 0
+ primary-for QSGClipNode (0x0x7f78492be958)
+ QSGNode (0x0x7f78493304e0) 0
+ primary-for QSGBasicGeometryNode (0x0x7f78492be9c0)
+
+Vtable for QSGTransformNode
+QSGTransformNode::_ZTV16QSGTransformNode: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QSGTransformNode)
+16 (int (*)(...))QSGTransformNode::~QSGTransformNode
+24 (int (*)(...))QSGTransformNode::~QSGTransformNode
+32 (int (*)(...))QSGNode::isSubtreeBlocked
+40 (int (*)(...))QSGNode::preprocess
+
+Class QSGTransformNode
+ size=216 align=8
+ base size=216 base align=8
+QSGTransformNode (0x0x7f78492bea28) 0
+ vptr=((& QSGTransformNode::_ZTV16QSGTransformNode) + 16)
+ QSGNode (0x0x7f7849330600) 0
+ primary-for QSGTransformNode (0x0x7f78492bea28)
+
+Vtable for QSGRootNode
+QSGRootNode::_ZTV11QSGRootNode: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QSGRootNode)
+16 (int (*)(...))QSGRootNode::~QSGRootNode
+24 (int (*)(...))QSGRootNode::~QSGRootNode
+32 (int (*)(...))QSGNode::isSubtreeBlocked
+40 (int (*)(...))QSGNode::preprocess
+
+Class QSGRootNode
+ size=88 align=8
+ base size=88 base align=8
+QSGRootNode (0x0x7f78492bea90) 0
+ vptr=((& QSGRootNode::_ZTV11QSGRootNode) + 16)
+ QSGNode (0x0x7f7849330720) 0
+ primary-for QSGRootNode (0x0x7f78492bea90)
+
+Vtable for QSGOpacityNode
+QSGOpacityNode::_ZTV14QSGOpacityNode: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QSGOpacityNode)
+16 (int (*)(...))QSGOpacityNode::~QSGOpacityNode
+24 (int (*)(...))QSGOpacityNode::~QSGOpacityNode
+32 (int (*)(...))QSGOpacityNode::isSubtreeBlocked
+40 (int (*)(...))QSGNode::preprocess
+
+Class QSGOpacityNode
+ size=96 align=8
+ base size=96 base align=8
+QSGOpacityNode (0x0x7f78492beb60) 0
+ vptr=((& QSGOpacityNode::_ZTV14QSGOpacityNode) + 16)
+ QSGNode (0x0x7f78493308a0) 0
+ primary-for QSGOpacityNode (0x0x7f78492beb60)
+
+Vtable for QSGNodeVisitor
+QSGNodeVisitor::_ZTV14QSGNodeVisitor: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QSGNodeVisitor)
+16 (int (*)(...))QSGNodeVisitor::~QSGNodeVisitor
+24 (int (*)(...))QSGNodeVisitor::~QSGNodeVisitor
+32 (int (*)(...))QSGNodeVisitor::enterTransformNode
+40 (int (*)(...))QSGNodeVisitor::leaveTransformNode
+48 (int (*)(...))QSGNodeVisitor::enterClipNode
+56 (int (*)(...))QSGNodeVisitor::leaveClipNode
+64 (int (*)(...))QSGNodeVisitor::enterGeometryNode
+72 (int (*)(...))QSGNodeVisitor::leaveGeometryNode
+80 (int (*)(...))QSGNodeVisitor::enterOpacityNode
+88 (int (*)(...))QSGNodeVisitor::leaveOpacityNode
+96 (int (*)(...))QSGNodeVisitor::visitNode
+104 (int (*)(...))QSGNodeVisitor::visitChildren
+
+Class QSGNodeVisitor
+ size=8 align=8
+ base size=8 base align=8
+QSGNodeVisitor (0x0x7f78493309c0) 0 nearly-empty
+ vptr=((& QSGNodeVisitor::_ZTV14QSGNodeVisitor) + 16)
+
+Vtable for QSGRendererInterface
+QSGRendererInterface::_ZTV20QSGRendererInterface: 10 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QSGRendererInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))QSGRendererInterface::getResource
+48 (int (*)(...))QSGRendererInterface::getResource
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))__cxa_pure_virtual
+72 (int (*)(...))__cxa_pure_virtual
+
+Class QSGRendererInterface
+ size=8 align=8
+ base size=8 base align=8
+QSGRendererInterface (0x0x7f7848f707e0) 0 nearly-empty
+ vptr=((& QSGRendererInterface::_ZTV20QSGRendererInterface) + 16)
+
+Class QQuickWindow::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQuickWindow::QPrivateSignal (0x0x7f7848f916c0) 0 empty
+
+Class QQuickWindow::GraphicsStateInfo
+ size=8 align=4
+ base size=8 base align=4
+QQuickWindow::GraphicsStateInfo (0x0x7f7848f91720) 0
+
+Vtable for QQuickWindow
+QQuickWindow::_ZTV12QQuickWindow: 45 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QQuickWindow)
+16 (int (*)(...))QQuickWindow::metaObject
+24 (int (*)(...))QQuickWindow::qt_metacast
+32 (int (*)(...))QQuickWindow::qt_metacall
+40 (int (*)(...))QQuickWindow::~QQuickWindow
+48 (int (*)(...))QQuickWindow::~QQuickWindow
+56 (int (*)(...))QQuickWindow::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWindow::surfaceType
+120 (int (*)(...))QWindow::format
+128 (int (*)(...))QWindow::size
+136 (int (*)(...))QQuickWindow::accessibleRoot
+144 (int (*)(...))QQuickWindow::focusObject
+152 (int (*)(...))QQuickWindow::exposeEvent
+160 (int (*)(...))QQuickWindow::resizeEvent
+168 (int (*)(...))QWindow::moveEvent
+176 (int (*)(...))QQuickWindow::focusInEvent
+184 (int (*)(...))QQuickWindow::focusOutEvent
+192 (int (*)(...))QQuickWindow::showEvent
+200 (int (*)(...))QQuickWindow::hideEvent
+208 (int (*)(...))QQuickWindow::keyPressEvent
+216 (int (*)(...))QQuickWindow::keyReleaseEvent
+224 (int (*)(...))QQuickWindow::mousePressEvent
+232 (int (*)(...))QQuickWindow::mouseReleaseEvent
+240 (int (*)(...))QQuickWindow::mouseDoubleClickEvent
+248 (int (*)(...))QQuickWindow::mouseMoveEvent
+256 (int (*)(...))QQuickWindow::wheelEvent
+264 (int (*)(...))QWindow::touchEvent
+272 (int (*)(...))QQuickWindow::tabletEvent
+280 (int (*)(...))QWindow::nativeEvent
+288 (int (*)(...))QWindow::surfaceHandle
+296 (int (*)(...))-16
+304 (int (*)(...))(& _ZTI12QQuickWindow)
+312 (int (*)(...))QQuickWindow::_ZThn16_N12QQuickWindowD1Ev
+320 (int (*)(...))QQuickWindow::_ZThn16_N12QQuickWindowD0Ev
+328 (int (*)(...))QWindow::_ZThn16_NK7QWindow6formatEv
+336 (int (*)(...))QWindow::_ZThn16_NK7QWindow13surfaceHandleEv
+344 (int (*)(...))QWindow::_ZThn16_NK7QWindow11surfaceTypeEv
+352 (int (*)(...))QWindow::_ZThn16_NK7QWindow4sizeEv
+
+Class QQuickWindow
+ size=40 align=8
+ base size=40 base align=8
+QQuickWindow (0x0x7f78492bed68) 0
+ vptr=((& QQuickWindow::_ZTV12QQuickWindow) + 16)
+ QWindow (0x0x7f784c6bcc40) 0
+ primary-for QQuickWindow (0x0x7f78492bed68)
+ QObject (0x0x7f7848f91600) 0
+ primary-for QWindow (0x0x7f784c6bcc40)
+ QSurface (0x0x7f7848f91660) 16
+ vptr=((& QQuickWindow::_ZTV12QQuickWindow) + 312)
+
+Class QQuickView::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQuickView::QPrivateSignal (0x0x7f7848fd3240) 0 empty
+
+Vtable for QQuickView
+QQuickView::_ZTV10QQuickView: 45 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QQuickView)
+16 (int (*)(...))QQuickView::metaObject
+24 (int (*)(...))QQuickView::qt_metacast
+32 (int (*)(...))QQuickView::qt_metacall
+40 (int (*)(...))QQuickView::~QQuickView
+48 (int (*)(...))QQuickView::~QQuickView
+56 (int (*)(...))QQuickWindow::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QQuickView::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWindow::surfaceType
+120 (int (*)(...))QWindow::format
+128 (int (*)(...))QWindow::size
+136 (int (*)(...))QQuickWindow::accessibleRoot
+144 (int (*)(...))QQuickWindow::focusObject
+152 (int (*)(...))QQuickWindow::exposeEvent
+160 (int (*)(...))QQuickView::resizeEvent
+168 (int (*)(...))QWindow::moveEvent
+176 (int (*)(...))QQuickWindow::focusInEvent
+184 (int (*)(...))QQuickWindow::focusOutEvent
+192 (int (*)(...))QQuickWindow::showEvent
+200 (int (*)(...))QQuickWindow::hideEvent
+208 (int (*)(...))QQuickView::keyPressEvent
+216 (int (*)(...))QQuickView::keyReleaseEvent
+224 (int (*)(...))QQuickView::mousePressEvent
+232 (int (*)(...))QQuickView::mouseReleaseEvent
+240 (int (*)(...))QQuickWindow::mouseDoubleClickEvent
+248 (int (*)(...))QQuickView::mouseMoveEvent
+256 (int (*)(...))QQuickWindow::wheelEvent
+264 (int (*)(...))QWindow::touchEvent
+272 (int (*)(...))QQuickWindow::tabletEvent
+280 (int (*)(...))QWindow::nativeEvent
+288 (int (*)(...))QWindow::surfaceHandle
+296 (int (*)(...))-16
+304 (int (*)(...))(& _ZTI10QQuickView)
+312 (int (*)(...))QQuickView::_ZThn16_N10QQuickViewD1Ev
+320 (int (*)(...))QQuickView::_ZThn16_N10QQuickViewD0Ev
+328 (int (*)(...))QWindow::_ZThn16_NK7QWindow6formatEv
+336 (int (*)(...))QWindow::_ZThn16_NK7QWindow13surfaceHandleEv
+344 (int (*)(...))QWindow::_ZThn16_NK7QWindow11surfaceTypeEv
+352 (int (*)(...))QWindow::_ZThn16_NK7QWindow4sizeEv
+
+Class QQuickView
+ size=40 align=8
+ base size=40 base align=8
+QQuickView (0x0x7f78492beea0) 0
+ vptr=((& QQuickView::_ZTV10QQuickView) + 16)
+ QQuickWindow (0x0x7f78492bef08) 0
+ primary-for QQuickView (0x0x7f78492beea0)
+ QWindow (0x0x7f784c723e70) 0
+ primary-for QQuickWindow (0x0x7f78492bef08)
+ QObject (0x0x7f7848fd3180) 0
+ primary-for QWindow (0x0x7f784c723e70)
+ QSurface (0x0x7f7848fd31e0) 16
+ vptr=((& QQuickView::_ZTV10QQuickView) + 312)
+
+Class QSGAbstractRenderer::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSGAbstractRenderer::QPrivateSignal (0x0x7f7848fd3600) 0 empty
+
+Vtable for QSGAbstractRenderer
+QSGAbstractRenderer::_ZTV19QSGAbstractRenderer: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QSGAbstractRenderer)
+16 (int (*)(...))QSGAbstractRenderer::metaObject
+24 (int (*)(...))QSGAbstractRenderer::qt_metacast
+32 (int (*)(...))QSGAbstractRenderer::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+
+Class QSGAbstractRenderer
+ size=16 align=8
+ base size=16 base align=8
+QSGAbstractRenderer (0x0x7f78492bef70) 0
+ vptr=((& QSGAbstractRenderer::_ZTV19QSGAbstractRenderer) + 16)
+ QObject (0x0x7f7848fd35a0) 0
+ primary-for QSGAbstractRenderer (0x0x7f78492bef70)
+
+Class QSGEngine::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSGEngine::QPrivateSignal (0x0x7f7849013300) 0 empty
+
+Vtable for QSGEngine
+QSGEngine::_ZTV9QSGEngine: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QSGEngine)
+16 (int (*)(...))QSGEngine::metaObject
+24 (int (*)(...))QSGEngine::qt_metacast
+32 (int (*)(...))QSGEngine::qt_metacall
+40 (int (*)(...))QSGEngine::~QSGEngine
+48 (int (*)(...))QSGEngine::~QSGEngine
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QSGEngine
+ size=16 align=8
+ base size=16 base align=8
+QSGEngine (0x0x7f7848ff21a0) 0
+ vptr=((& QSGEngine::_ZTV9QSGEngine) + 16)
+ QObject (0x0x7f78490132a0) 0
+ primary-for QSGEngine (0x0x7f7848ff21a0)
+
+Class QSGMaterialType
+ size=1 align=1
+ base size=0 base align=1
+QSGMaterialType (0x0x7f7849013960) 0 empty
+
+Class QSGMaterialShader::RenderState
+ size=16 align=8
+ base size=16 base align=8
+QSGMaterialShader::RenderState (0x0x7f7849013a20) 0
+
+Vtable for QSGMaterialShader
+QSGMaterialShader::_ZTV17QSGMaterialShader: 12 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QSGMaterialShader)
+16 0
+24 0
+32 (int (*)(...))QSGMaterialShader::activate
+40 (int (*)(...))QSGMaterialShader::deactivate
+48 (int (*)(...))QSGMaterialShader::updateState
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))QSGMaterialShader::compile
+72 (int (*)(...))QSGMaterialShader::initialize
+80 (int (*)(...))QSGMaterialShader::vertexShader
+88 (int (*)(...))QSGMaterialShader::fragmentShader
+
+Class QSGMaterialShader
+ size=32 align=8
+ base size=32 base align=8
+QSGMaterialShader (0x0x7f78490139c0) 0
+ vptr=((& QSGMaterialShader::_ZTV17QSGMaterialShader) + 16)
+
+Class QSGMaterialRhiShader::RenderState
+ size=16 align=8
+ base size=16 base align=8
+QSGMaterialRhiShader::RenderState (0x0x7f784904c5a0) 0
+
+Class QSGMaterialRhiShader::GraphicsPipelineState
+ size=36 align=4
+ base size=36 base align=4
+QSGMaterialRhiShader::GraphicsPipelineState (0x0x7f784904c600) 0
+
+Vtable for QSGMaterialRhiShader
+QSGMaterialRhiShader::_ZTV20QSGMaterialRhiShader: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QSGMaterialRhiShader)
+16 (int (*)(...))QSGMaterialRhiShader::~QSGMaterialRhiShader
+24 (int (*)(...))QSGMaterialRhiShader::~QSGMaterialRhiShader
+32 (int (*)(...))QSGMaterialShader::activate
+40 (int (*)(...))QSGMaterialShader::deactivate
+48 (int (*)(...))QSGMaterialShader::updateState
+56 (int (*)(...))QSGMaterialRhiShader::attributeNames
+64 (int (*)(...))QSGMaterialShader::compile
+72 (int (*)(...))QSGMaterialShader::initialize
+80 (int (*)(...))QSGMaterialShader::vertexShader
+88 (int (*)(...))QSGMaterialShader::fragmentShader
+96 (int (*)(...))QSGMaterialRhiShader::updateUniformData
+104 (int (*)(...))QSGMaterialRhiShader::updateSampledImage
+112 (int (*)(...))QSGMaterialRhiShader::updateGraphicsPipelineState
+
+Class QSGMaterialRhiShader
+ size=40 align=8
+ base size=40 base align=8
+QSGMaterialRhiShader (0x0x7f7848ff2410) 0
+ vptr=((& QSGMaterialRhiShader::_ZTV20QSGMaterialRhiShader) + 16)
+ QSGMaterialShader (0x0x7f784904c540) 0
+ primary-for QSGMaterialRhiShader (0x0x7f7848ff2410)
+
+Vtable for QSGMaterial
+QSGMaterial::_ZTV11QSGMaterial: 7 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QSGMaterial)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))QSGMaterial::compare
+
+Class QSGMaterial
+ size=24 align=8
+ base size=24 base align=8
+QSGMaterial (0x0x7f78490786c0) 0
+ vptr=((& QSGMaterial::_ZTV11QSGMaterial) + 16)
+
+Vtable for QSGFlatColorMaterial
+QSGFlatColorMaterial::_ZTV20QSGFlatColorMaterial: 7 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QSGFlatColorMaterial)
+16 (int (*)(...))QSGFlatColorMaterial::~QSGFlatColorMaterial
+24 (int (*)(...))QSGFlatColorMaterial::~QSGFlatColorMaterial
+32 (int (*)(...))QSGFlatColorMaterial::type
+40 (int (*)(...))QSGFlatColorMaterial::createShader
+48 (int (*)(...))QSGFlatColorMaterial::compare
+
+Class QSGFlatColorMaterial
+ size=40 align=8
+ base size=40 base align=8
+QSGFlatColorMaterial (0x0x7f7848ff2750) 0
+ vptr=((& QSGFlatColorMaterial::_ZTV20QSGFlatColorMaterial) + 16)
+ QSGMaterial (0x0x7f7849078e40) 0
+ primary-for QSGFlatColorMaterial (0x0x7f7848ff2750)
+
+Class QSGTexture::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSGTexture::QPrivateSignal (0x0x7f7849078f60) 0 empty
+
+Class QSGTexture::NativeTexture
+ size=16 align=8
+ base size=16 base align=8
+QSGTexture::NativeTexture (0x0x7f78490ad000) 0
+
+Vtable for QSGTexture
+QSGTexture::_ZTV10QSGTexture: 22 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QSGTexture)
+16 (int (*)(...))QSGTexture::metaObject
+24 (int (*)(...))QSGTexture::qt_metacast
+32 (int (*)(...))QSGTexture::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))__cxa_pure_virtual
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))QSGTexture::normalizedTextureSubRect
+152 (int (*)(...))QSGTexture::isAtlasTexture
+160 (int (*)(...))QSGTexture::removedFromAtlas
+168 (int (*)(...))__cxa_pure_virtual
+
+Class QSGTexture
+ size=16 align=8
+ base size=16 base align=8
+QSGTexture (0x0x7f7848ff27b8) 0
+ vptr=((& QSGTexture::_ZTV10QSGTexture) + 16)
+ QObject (0x0x7f7849078f00) 0
+ primary-for QSGTexture (0x0x7f7848ff27b8)
+
+Class QSGDynamicTexture::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSGDynamicTexture::QPrivateSignal (0x0x7f78490ad2a0) 0 empty
+
+Vtable for QSGDynamicTexture
+QSGDynamicTexture::_ZTV17QSGDynamicTexture: 23 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QSGDynamicTexture)
+16 (int (*)(...))QSGDynamicTexture::metaObject
+24 (int (*)(...))QSGDynamicTexture::qt_metacast
+32 (int (*)(...))QSGDynamicTexture::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))__cxa_pure_virtual
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))QSGTexture::normalizedTextureSubRect
+152 (int (*)(...))QSGTexture::isAtlasTexture
+160 (int (*)(...))QSGTexture::removedFromAtlas
+168 (int (*)(...))__cxa_pure_virtual
+176 (int (*)(...))__cxa_pure_virtual
+
+Class QSGDynamicTexture
+ size=16 align=8
+ base size=16 base align=8
+QSGDynamicTexture (0x0x7f7848ff2820) 0
+ vptr=((& QSGDynamicTexture::_ZTV17QSGDynamicTexture) + 16)
+ QSGTexture (0x0x7f7848ff2888) 0
+ primary-for QSGDynamicTexture (0x0x7f7848ff2820)
+ QObject (0x0x7f78490ad240) 0
+ primary-for QSGTexture (0x0x7f7848ff2888)
+
+Vtable for QSGImageNode
+QSGImageNode::_ZTV12QSGImageNode: 20 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QSGImageNode)
+16 0
+24 0
+32 (int (*)(...))QSGNode::isSubtreeBlocked
+40 (int (*)(...))QSGNode::preprocess
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))__cxa_pure_virtual
+72 (int (*)(...))__cxa_pure_virtual
+80 (int (*)(...))__cxa_pure_virtual
+88 (int (*)(...))__cxa_pure_virtual
+96 (int (*)(...))__cxa_pure_virtual
+104 (int (*)(...))__cxa_pure_virtual
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))__cxa_pure_virtual
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))__cxa_pure_virtual
+
+Class QSGImageNode
+ size=144 align=8
+ base size=144 base align=8
+QSGImageNode (0x0x7f7848ff28f0) 0
+ vptr=((& QSGImageNode::_ZTV12QSGImageNode) + 16)
+ QSGGeometryNode (0x0x7f7848ff2958) 0
+ primary-for QSGImageNode (0x0x7f7848ff28f0)
+ QSGBasicGeometryNode (0x0x7f7848ff29c0) 0
+ primary-for QSGGeometryNode (0x0x7f7848ff2958)
+ QSGNode (0x0x7f78490ad3c0) 0
+ primary-for QSGBasicGeometryNode (0x0x7f7848ff29c0)
+
+Vtable for QSGNinePatchNode
+QSGNinePatchNode::_ZTV16QSGNinePatchNode: 11 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QSGNinePatchNode)
+16 0
+24 0
+32 (int (*)(...))QSGNode::isSubtreeBlocked
+40 (int (*)(...))QSGNode::preprocess
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))__cxa_pure_virtual
+72 (int (*)(...))__cxa_pure_virtual
+80 (int (*)(...))__cxa_pure_virtual
+
+Class QSGNinePatchNode
+ size=144 align=8
+ base size=144 base align=8
+QSGNinePatchNode (0x0x7f7848ff2af8) 0
+ vptr=((& QSGNinePatchNode::_ZTV16QSGNinePatchNode) + 16)
+ QSGGeometryNode (0x0x7f7848ff2b60) 0
+ primary-for QSGNinePatchNode (0x0x7f7848ff2af8)
+ QSGBasicGeometryNode (0x0x7f7848ff2bc8) 0
+ primary-for QSGGeometryNode (0x0x7f7848ff2b60)
+ QSGNode (0x0x7f78490adba0) 0
+ primary-for QSGBasicGeometryNode (0x0x7f7848ff2bc8)
+
+Vtable for QSGRectangleNode
+QSGRectangleNode::_ZTV16QSGRectangleNode: 10 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QSGRectangleNode)
+16 0
+24 0
+32 (int (*)(...))QSGNode::isSubtreeBlocked
+40 (int (*)(...))QSGNode::preprocess
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))__cxa_pure_virtual
+72 (int (*)(...))__cxa_pure_virtual
+
+Class QSGRectangleNode
+ size=144 align=8
+ base size=144 base align=8
+QSGRectangleNode (0x0x7f7848ff2c30) 0
+ vptr=((& QSGRectangleNode::_ZTV16QSGRectangleNode) + 16)
+ QSGGeometryNode (0x0x7f7848ff2c98) 0
+ primary-for QSGRectangleNode (0x0x7f7848ff2c30)
+ QSGBasicGeometryNode (0x0x7f7848ff2d00) 0
+ primary-for QSGGeometryNode (0x0x7f7848ff2c98)
+ QSGNode (0x0x7f78490adc00) 0
+ primary-for QSGBasicGeometryNode (0x0x7f7848ff2d00)
+
+Vtable for QSGRenderNode::RenderState
+QSGRenderNode::RenderState::_ZTVN13QSGRenderNode11RenderStateE: 11 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTIN13QSGRenderNode11RenderStateE)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))__cxa_pure_virtual
+72 (int (*)(...))__cxa_pure_virtual
+80 (int (*)(...))QSGRenderNode::RenderState::get
+
+Class QSGRenderNode::RenderState
+ size=8 align=8
+ base size=8 base align=8
+QSGRenderNode::RenderState (0x0x7f78490add20) 0 nearly-empty
+ vptr=((& QSGRenderNode::RenderState::_ZTVN13QSGRenderNode11RenderStateE) + 16)
+
+Vtable for QSGRenderNode
+QSGRenderNode::_ZTV13QSGRenderNode: 11 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QSGRenderNode)
+16 0
+24 0
+32 (int (*)(...))QSGNode::isSubtreeBlocked
+40 (int (*)(...))QSGNode::preprocess
+48 (int (*)(...))QSGRenderNode::changedStates
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))QSGRenderNode::releaseResources
+72 (int (*)(...))QSGRenderNode::flags
+80 (int (*)(...))QSGRenderNode::rect
+
+Class QSGRenderNode
+ size=88 align=8
+ base size=88 base align=8
+QSGRenderNode (0x0x7f7848ff2d68) 0
+ vptr=((& QSGRenderNode::_ZTV13QSGRenderNode) + 16)
+ QSGNode (0x0x7f78490adcc0) 0
+ primary-for QSGRenderNode (0x0x7f7848ff2d68)
+
+Vtable for QSGSimpleRectNode
+QSGSimpleRectNode::_ZTV17QSGSimpleRectNode: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QSGSimpleRectNode)
+16 (int (*)(...))QSGSimpleRectNode::~QSGSimpleRectNode
+24 (int (*)(...))QSGSimpleRectNode::~QSGSimpleRectNode
+32 (int (*)(...))QSGNode::isSubtreeBlocked
+40 (int (*)(...))QSGNode::preprocess
+
+Class QSGSimpleRectNode
+ size=320 align=8
+ base size=320 base align=8
+QSGSimpleRectNode (0x0x7f78491152d8) 0
+ vptr=((& QSGSimpleRectNode::_ZTV17QSGSimpleRectNode) + 16)
+ QSGGeometryNode (0x0x7f7849115340) 0
+ primary-for QSGSimpleRectNode (0x0x7f78491152d8)
+ QSGBasicGeometryNode (0x0x7f78491153a8) 0
+ primary-for QSGGeometryNode (0x0x7f7849115340)
+ QSGNode (0x0x7f784912a480) 0
+ primary-for QSGBasicGeometryNode (0x0x7f78491153a8)
+
+Vtable for QSGOpaqueTextureMaterial
+QSGOpaqueTextureMaterial::_ZTV24QSGOpaqueTextureMaterial: 7 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI24QSGOpaqueTextureMaterial)
+16 (int (*)(...))QSGOpaqueTextureMaterial::~QSGOpaqueTextureMaterial
+24 (int (*)(...))QSGOpaqueTextureMaterial::~QSGOpaqueTextureMaterial
+32 (int (*)(...))QSGOpaqueTextureMaterial::type
+40 (int (*)(...))QSGOpaqueTextureMaterial::createShader
+48 (int (*)(...))QSGOpaqueTextureMaterial::compare
+
+Class QSGOpaqueTextureMaterial
+ size=40 align=8
+ base size=36 base align=8
+QSGOpaqueTextureMaterial (0x0x7f7849115410) 0
+ vptr=((& QSGOpaqueTextureMaterial::_ZTV24QSGOpaqueTextureMaterial) + 16)
+ QSGMaterial (0x0x7f784912a540) 0
+ primary-for QSGOpaqueTextureMaterial (0x0x7f7849115410)
+
+Vtable for QSGTextureMaterial
+QSGTextureMaterial::_ZTV18QSGTextureMaterial: 7 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QSGTextureMaterial)
+16 (int (*)(...))QSGTextureMaterial::~QSGTextureMaterial
+24 (int (*)(...))QSGTextureMaterial::~QSGTextureMaterial
+32 (int (*)(...))QSGTextureMaterial::type
+40 (int (*)(...))QSGTextureMaterial::createShader
+48 (int (*)(...))QSGOpaqueTextureMaterial::compare
+
+Class QSGTextureMaterial
+ size=40 align=8
+ base size=36 base align=8
+QSGTextureMaterial (0x0x7f7849115478) 0
+ vptr=((& QSGTextureMaterial::_ZTV18QSGTextureMaterial) + 16)
+ QSGOpaqueTextureMaterial (0x0x7f78491154e0) 0
+ primary-for QSGTextureMaterial (0x0x7f7849115478)
+ QSGMaterial (0x0x7f784912a9c0) 0
+ primary-for QSGOpaqueTextureMaterial (0x0x7f78491154e0)
+
+Vtable for QSGSimpleTextureNode
+QSGSimpleTextureNode::_ZTV20QSGSimpleTextureNode: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QSGSimpleTextureNode)
+16 (int (*)(...))QSGSimpleTextureNode::~QSGSimpleTextureNode
+24 (int (*)(...))QSGSimpleTextureNode::~QSGSimpleTextureNode
+32 (int (*)(...))QSGNode::isSubtreeBlocked
+40 (int (*)(...))QSGNode::preprocess
+
+Class QSGSimpleTextureNode
+ size=384 align=8
+ base size=384 base align=8
+QSGSimpleTextureNode (0x0x7f7849115548) 0
+ vptr=((& QSGSimpleTextureNode::_ZTV20QSGSimpleTextureNode) + 16)
+ QSGGeometryNode (0x0x7f78491155b0) 0
+ primary-for QSGSimpleTextureNode (0x0x7f7849115548)
+ QSGBasicGeometryNode (0x0x7f7849115618) 0
+ primary-for QSGGeometryNode (0x0x7f78491155b0)
+ QSGNode (0x0x7f784912aa20) 0
+ primary-for QSGBasicGeometryNode (0x0x7f7849115618)
+
+Class QSGTextureProvider::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSGTextureProvider::QPrivateSignal (0x0x7f7848d603c0) 0 empty
+
+Vtable for QSGTextureProvider
+QSGTextureProvider::_ZTV18QSGTextureProvider: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QSGTextureProvider)
+16 (int (*)(...))QSGTextureProvider::metaObject
+24 (int (*)(...))QSGTextureProvider::qt_metacast
+32 (int (*)(...))QSGTextureProvider::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+
+Class QSGTextureProvider
+ size=16 align=8
+ base size=16 base align=8
+QSGTextureProvider (0x0x7f78491157b8) 0
+ vptr=((& QSGTextureProvider::_ZTV18QSGTextureProvider) + 16)
+ QObject (0x0x7f7848d60360) 0
+ primary-for QSGTextureProvider (0x0x7f78491157b8)
+
+Vtable for QSGVertexColorMaterial
+QSGVertexColorMaterial::_ZTV22QSGVertexColorMaterial: 7 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI22QSGVertexColorMaterial)
+16 (int (*)(...))QSGVertexColorMaterial::~QSGVertexColorMaterial
+24 (int (*)(...))QSGVertexColorMaterial::~QSGVertexColorMaterial
+32 (int (*)(...))QSGVertexColorMaterial::type
+40 (int (*)(...))QSGVertexColorMaterial::createShader
+48 (int (*)(...))QSGVertexColorMaterial::compare
+
+Class QSGVertexColorMaterial
+ size=24 align=8
+ base size=24 base align=8
+QSGVertexColorMaterial (0x0x7f7849115820) 0
+ vptr=((& QSGVertexColorMaterial::_ZTV22QSGVertexColorMaterial) + 16)
+ QSGMaterial (0x0x7f7848d604e0) 0
+ primary-for QSGVertexColorMaterial (0x0x7f7849115820)
+
+Class QGeoAddress
+ size=8 align=8
+ base size=8 base align=8
+QGeoAddress (0x0x7f7848d60540) 0
+
+Class QGeoCoordinate
+ size=8 align=8
+ base size=8 base align=8
+QGeoCoordinate (0x0x7f7848d90b40) 0
+
+Class QGeoShape
+ size=8 align=8
+ base size=8 base align=8
+QGeoShape (0x0x7f7848dcf180) 0
+
+Class QGeoAreaMonitorInfo
+ size=8 align=8
+ base size=8 base align=8
+QGeoAreaMonitorInfo (0x0x7f7848dfd360) 0
+
+Class QGeoPositionInfo
+ size=8 align=8
+ base size=8 base align=8
+QGeoPositionInfo (0x0x7f7848dfd420) 0
+
+Class QGeoPositionInfoSource::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QGeoPositionInfoSource::QPrivateSignal (0x0x7f7848dfd720) 0 empty
+
+Vtable for QGeoPositionInfoSource
+QGeoPositionInfoSource::_ZTV22QGeoPositionInfoSource: 23 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI22QGeoPositionInfoSource)
+16 (int (*)(...))QGeoPositionInfoSource::metaObject
+24 (int (*)(...))QGeoPositionInfoSource::qt_metacast
+32 (int (*)(...))QGeoPositionInfoSource::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QGeoPositionInfoSource::setUpdateInterval
+120 (int (*)(...))QGeoPositionInfoSource::setPreferredPositioningMethods
+128 (int (*)(...))__cxa_pure_virtual
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))__cxa_pure_virtual
+160 (int (*)(...))__cxa_pure_virtual
+168 (int (*)(...))__cxa_pure_virtual
+176 (int (*)(...))__cxa_pure_virtual
+
+Class QGeoPositionInfoSource
+ size=24 align=8
+ base size=24 base align=8
+QGeoPositionInfoSource (0x0x7f7848df9680) 0
+ vptr=((& QGeoPositionInfoSource::_ZTV22QGeoPositionInfoSource) + 16)
+ QObject (0x0x7f7848dfd6c0) 0
+ primary-for QGeoPositionInfoSource (0x0x7f7848df9680)
+
+Class QGeoAreaMonitorSource::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QGeoAreaMonitorSource::QPrivateSignal (0x0x7f7848dfdf60) 0 empty
+
+Vtable for QGeoAreaMonitorSource
+QGeoAreaMonitorSource::_ZTV21QGeoAreaMonitorSource: 23 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI21QGeoAreaMonitorSource)
+16 (int (*)(...))QGeoAreaMonitorSource::metaObject
+24 (int (*)(...))QGeoAreaMonitorSource::qt_metacast
+32 (int (*)(...))QGeoAreaMonitorSource::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QGeoAreaMonitorSource::setPositionInfoSource
+120 (int (*)(...))QGeoAreaMonitorSource::positionInfoSource
+128 (int (*)(...))__cxa_pure_virtual
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))__cxa_pure_virtual
+160 (int (*)(...))__cxa_pure_virtual
+168 (int (*)(...))__cxa_pure_virtual
+176 (int (*)(...))__cxa_pure_virtual
+
+Class QGeoAreaMonitorSource
+ size=24 align=8
+ base size=24 base align=8
+QGeoAreaMonitorSource (0x0x7f7848df97b8) 0
+ vptr=((& QGeoAreaMonitorSource::_ZTV21QGeoAreaMonitorSource) + 16)
+ QObject (0x0x7f7848dfdf00) 0
+ primary-for QGeoAreaMonitorSource (0x0x7f7848df97b8)
+
+Class QGeoRectangle
+ size=8 align=8
+ base size=8 base align=8
+QGeoRectangle (0x0x7f7848df9820) 0
+ QGeoShape (0x0x7f7848e420c0) 0
+
+Class QGeoCircle
+ size=8 align=8
+ base size=8 base align=8
+QGeoCircle (0x0x7f7848e64bc8) 0
+ QGeoShape (0x0x7f7848e6e540) 0
+
+Class QGeoLocation
+ size=8 align=8
+ base size=8 base align=8
+QGeoLocation (0x0x7f7848eb2720) 0
+
+Class QGeoPath
+ size=8 align=8
+ base size=8 base align=8
+QGeoPath (0x0x7f7848ee3680) 0
+ QGeoShape (0x0x7f7848eddd80) 0
+
+Class QGeoPolygon
+ size=8 align=8
+ base size=8 base align=8
+QGeoPolygon (0x0x7f7848f0f820) 0
+ QGeoShape (0x0x7f7848f08f60) 0
+
+Class QGeoSatelliteInfo
+ size=8 align=8
+ base size=8 base align=8
+QGeoSatelliteInfo (0x0x7f7848f46180) 0
+
+Class QGeoSatelliteInfoSource::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QGeoSatelliteInfoSource::QPrivateSignal (0x0x7f7848f462a0) 0 empty
+
+Vtable for QGeoSatelliteInfoSource
+QGeoSatelliteInfoSource::_ZTV23QGeoSatelliteInfoSource: 20 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI23QGeoSatelliteInfoSource)
+16 (int (*)(...))QGeoSatelliteInfoSource::metaObject
+24 (int (*)(...))QGeoSatelliteInfoSource::qt_metacast
+32 (int (*)(...))QGeoSatelliteInfoSource::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QGeoSatelliteInfoSource::setUpdateInterval
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))__cxa_pure_virtual
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))__cxa_pure_virtual
+
+Class QGeoSatelliteInfoSource
+ size=24 align=8
+ base size=24 base align=8
+QGeoSatelliteInfoSource (0x0x7f7848f37b60) 0
+ vptr=((& QGeoSatelliteInfoSource::_ZTV23QGeoSatelliteInfoSource) + 16)
+ QObject (0x0x7f7848f46240) 0
+ primary-for QGeoSatelliteInfoSource (0x0x7f7848f37b60)
+
+Vtable for QGeoPositionInfoSourceFactory
+QGeoPositionInfoSourceFactory::_ZTV29QGeoPositionInfoSourceFactory: 7 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI29QGeoPositionInfoSourceFactory)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+
+Class QGeoPositionInfoSourceFactory
+ size=8 align=8
+ base size=8 base align=8
+QGeoPositionInfoSourceFactory (0x0x7f7848f46420) 0 nearly-empty
+ vptr=((& QGeoPositionInfoSourceFactory::_ZTV29QGeoPositionInfoSourceFactory) + 16)
+
+Vtable for QGeoPositionInfoSourceFactoryV2
+QGeoPositionInfoSourceFactoryV2::_ZTV31QGeoPositionInfoSourceFactoryV2: 10 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI31QGeoPositionInfoSourceFactoryV2)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))__cxa_pure_virtual
+72 (int (*)(...))__cxa_pure_virtual
+
+Class QGeoPositionInfoSourceFactoryV2
+ size=8 align=8
+ base size=8 base align=8
+QGeoPositionInfoSourceFactoryV2 (0x0x7f7848f37bc8) 0 nearly-empty
+ vptr=((& QGeoPositionInfoSourceFactoryV2::_ZTV31QGeoPositionInfoSourceFactoryV2) + 16)
+ QGeoPositionInfoSourceFactory (0x0x7f7848f46600) 0 nearly-empty
+ primary-for QGeoPositionInfoSourceFactoryV2 (0x0x7f7848f37bc8)
+
+Class QNmeaPositionInfoSource::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QNmeaPositionInfoSource::QPrivateSignal (0x0x7f7848f46840) 0 empty
+
+Vtable for QNmeaPositionInfoSource
+QNmeaPositionInfoSource::_ZTV23QNmeaPositionInfoSource: 24 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI23QNmeaPositionInfoSource)
+16 (int (*)(...))QNmeaPositionInfoSource::metaObject
+24 (int (*)(...))QNmeaPositionInfoSource::qt_metacast
+32 (int (*)(...))QNmeaPositionInfoSource::qt_metacall
+40 (int (*)(...))QNmeaPositionInfoSource::~QNmeaPositionInfoSource
+48 (int (*)(...))QNmeaPositionInfoSource::~QNmeaPositionInfoSource
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QNmeaPositionInfoSource::setUpdateInterval
+120 (int (*)(...))QGeoPositionInfoSource::setPreferredPositioningMethods
+128 (int (*)(...))QNmeaPositionInfoSource::lastKnownPosition
+136 (int (*)(...))QNmeaPositionInfoSource::supportedPositioningMethods
+144 (int (*)(...))QNmeaPositionInfoSource::minimumUpdateInterval
+152 (int (*)(...))QNmeaPositionInfoSource::error
+160 (int (*)(...))QNmeaPositionInfoSource::startUpdates
+168 (int (*)(...))QNmeaPositionInfoSource::stopUpdates
+176 (int (*)(...))QNmeaPositionInfoSource::requestUpdate
+184 (int (*)(...))QNmeaPositionInfoSource::parsePosInfoFromNmeaData
+
+Class QNmeaPositionInfoSource
+ size=32 align=8
+ base size=32 base align=8
+QNmeaPositionInfoSource (0x0x7f7848f37c30) 0
+ vptr=((& QNmeaPositionInfoSource::_ZTV23QNmeaPositionInfoSource) + 16)
+ QGeoPositionInfoSource (0x0x7f7848f37c98) 0
+ primary-for QNmeaPositionInfoSource (0x0x7f7848f37c30)
+ QObject (0x0x7f7848f467e0) 0
+ primary-for QGeoPositionInfoSource (0x0x7f7848f37c98)
+
+Class QWebChannel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QWebChannel::QPrivateSignal (0x0x7f7848f469c0) 0 empty
+
+Vtable for QWebChannel
+QWebChannel::_ZTV11QWebChannel: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QWebChannel)
+16 (int (*)(...))QWebChannel::metaObject
+24 (int (*)(...))QWebChannel::qt_metacast
+32 (int (*)(...))QWebChannel::qt_metacall
+40 (int (*)(...))QWebChannel::~QWebChannel
+48 (int (*)(...))QWebChannel::~QWebChannel
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QWebChannel
+ size=16 align=8
+ base size=16 base align=8
+QWebChannel (0x0x7f7848f37d00) 0
+ vptr=((& QWebChannel::_ZTV11QWebChannel) + 16)
+ QObject (0x0x7f7848f46960) 0
+ primary-for QWebChannel (0x0x7f7848f37d00)
+
+Class QQmlWebChannel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQmlWebChannel::QPrivateSignal (0x0x7f7848f46c00) 0 empty
+
+Vtable for QQmlWebChannel
+QQmlWebChannel::_ZTV14QQmlWebChannel: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QQmlWebChannel)
+16 (int (*)(...))QQmlWebChannel::metaObject
+24 (int (*)(...))QQmlWebChannel::qt_metacast
+32 (int (*)(...))QQmlWebChannel::qt_metacall
+40 (int (*)(...))QQmlWebChannel::~QQmlWebChannel
+48 (int (*)(...))QQmlWebChannel::~QQmlWebChannel
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QQmlWebChannel
+ size=16 align=8
+ base size=16 base align=8
+QQmlWebChannel (0x0x7f7848f37d68) 0
+ vptr=((& QQmlWebChannel::_ZTV14QQmlWebChannel) + 16)
+ QWebChannel (0x0x7f7848f37dd0) 0
+ primary-for QQmlWebChannel (0x0x7f7848f37d68)
+ QObject (0x0x7f7848f46ba0) 0
+ primary-for QWebChannel (0x0x7f7848f37dd0)
+
+Class QWebChannelAbstractTransport::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QWebChannelAbstractTransport::QPrivateSignal (0x0x7f7848b7e780) 0 empty
+
+Vtable for QWebChannelAbstractTransport
+QWebChannelAbstractTransport::_ZTV28QWebChannelAbstractTransport: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI28QWebChannelAbstractTransport)
+16 (int (*)(...))QWebChannelAbstractTransport::metaObject
+24 (int (*)(...))QWebChannelAbstractTransport::qt_metacast
+32 (int (*)(...))QWebChannelAbstractTransport::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+
+Class QWebChannelAbstractTransport
+ size=16 align=8
+ base size=16 base align=8
+QWebChannelAbstractTransport (0x0x7f7848b8e340) 0
+ vptr=((& QWebChannelAbstractTransport::_ZTV28QWebChannelAbstractTransport) + 16)
+ QObject (0x0x7f7848b7e720) 0
+ primary-for QWebChannelAbstractTransport (0x0x7f7848b8e340)
+
+Class QWebEngineClientCertificateStore
+ size=8 align=8
+ base size=8 base align=8
+QWebEngineClientCertificateStore (0x0x7f7848c70d80) 0
+
+Class QWebEngineCookieStore::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QWebEngineCookieStore::QPrivateSignal (0x0x7f7848c70e40) 0 empty
+
+Class QWebEngineCookieStore::FilterRequest
+ size=24 align=8
+ base size=20 base align=8
+QWebEngineCookieStore::FilterRequest (0x0x7f7848c70ea0) 0
+
+Vtable for QWebEngineCookieStore
+QWebEngineCookieStore::_ZTV21QWebEngineCookieStore: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI21QWebEngineCookieStore)
+16 (int (*)(...))QWebEngineCookieStore::metaObject
+24 (int (*)(...))QWebEngineCookieStore::qt_metacast
+32 (int (*)(...))QWebEngineCookieStore::qt_metacall
+40 (int (*)(...))QWebEngineCookieStore::~QWebEngineCookieStore
+48 (int (*)(...))QWebEngineCookieStore::~QWebEngineCookieStore
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QWebEngineCookieStore
+ size=24 align=8
+ base size=24 base align=8
+QWebEngineCookieStore (0x0x7f7848c72d00) 0
+ vptr=((& QWebEngineCookieStore::_ZTV21QWebEngineCookieStore) + 16)
+ QObject (0x0x7f7848c70de0) 0
+ primary-for QWebEngineCookieStore (0x0x7f7848c72d00)
+
+Class QWebEngineFindTextResult
+ size=8 align=8
+ base size=8 base align=8
+QWebEngineFindTextResult (0x0x7f7848c8f360) 0
+
+Class QWebEngineHttpRequest
+ size=8 align=8
+ base size=8 base align=8
+QWebEngineHttpRequest (0x0x7f7848c8f600) 0
+
+Class QWebEngineNotification::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QWebEngineNotification::QPrivateSignal (0x0x7f7848d15780) 0 empty
+
+Vtable for QWebEngineNotification
+QWebEngineNotification::_ZTV22QWebEngineNotification: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI22QWebEngineNotification)
+16 (int (*)(...))QWebEngineNotification::metaObject
+24 (int (*)(...))QWebEngineNotification::qt_metacast
+32 (int (*)(...))QWebEngineNotification::qt_metacall
+40 (int (*)(...))QWebEngineNotification::~QWebEngineNotification
+48 (int (*)(...))QWebEngineNotification::~QWebEngineNotification
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QWebEngineNotification
+ size=24 align=8
+ base size=24 base align=8
+QWebEngineNotification (0x0x7f7848d11958) 0
+ vptr=((& QWebEngineNotification::_ZTV22QWebEngineNotification) + 16)
+ QObject (0x0x7f7848d15720) 0
+ primary-for QWebEngineNotification (0x0x7f7848d11958)
+
+Class QWebEngineQuotaRequest
+ size=16 align=8
+ base size=16 base align=8
+QWebEngineQuotaRequest (0x0x7f7848d15a20) 0
+
+Class QWebEngineRegisterProtocolHandlerRequest
+ size=16 align=8
+ base size=16 base align=8
+QWebEngineRegisterProtocolHandlerRequest (0x0x7f7848d525a0) 0
+
+Class QWebEngineUrlRequestInfo
+ size=8 align=8
+ base size=8 base align=8
+QWebEngineUrlRequestInfo (0x0x7f7848d52ea0) 0
+
+Class QWebEngineUrlRequestInterceptor::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QWebEngineUrlRequestInterceptor::QPrivateSignal (0x0x7f784898a120) 0 empty
+
+Vtable for QWebEngineUrlRequestInterceptor
+QWebEngineUrlRequestInterceptor::_ZTV31QWebEngineUrlRequestInterceptor: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI31QWebEngineUrlRequestInterceptor)
+16 (int (*)(...))QWebEngineUrlRequestInterceptor::metaObject
+24 (int (*)(...))QWebEngineUrlRequestInterceptor::qt_metacast
+32 (int (*)(...))QWebEngineUrlRequestInterceptor::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+
+Class QWebEngineUrlRequestInterceptor
+ size=16 align=8
+ base size=16 base align=8
+QWebEngineUrlRequestInterceptor (0x0x7f7848977820) 0
+ vptr=((& QWebEngineUrlRequestInterceptor::_ZTV31QWebEngineUrlRequestInterceptor) + 16)
+ QObject (0x0x7f784898a0c0) 0
+ primary-for QWebEngineUrlRequestInterceptor (0x0x7f7848977820)
+
+Class QWebEngineUrlRequestJob::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QWebEngineUrlRequestJob::QPrivateSignal (0x0x7f784898a420) 0 empty
+
+Vtable for QWebEngineUrlRequestJob
+QWebEngineUrlRequestJob::_ZTV23QWebEngineUrlRequestJob: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI23QWebEngineUrlRequestJob)
+16 (int (*)(...))QWebEngineUrlRequestJob::metaObject
+24 (int (*)(...))QWebEngineUrlRequestJob::qt_metacast
+32 (int (*)(...))QWebEngineUrlRequestJob::qt_metacall
+40 (int (*)(...))QWebEngineUrlRequestJob::~QWebEngineUrlRequestJob
+48 (int (*)(...))QWebEngineUrlRequestJob::~QWebEngineUrlRequestJob
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QWebEngineUrlRequestJob
+ size=24 align=8
+ base size=24 base align=8
+QWebEngineUrlRequestJob (0x0x7f7848977888) 0
+ vptr=((& QWebEngineUrlRequestJob::_ZTV23QWebEngineUrlRequestJob) + 16)
+ QObject (0x0x7f784898a3c0) 0
+ primary-for QWebEngineUrlRequestJob (0x0x7f7848977888)
+
+Class QWebEngineUrlScheme
+ size=8 align=8
+ base size=8 base align=8
+QWebEngineUrlScheme (0x0x7f784898a600) 0
+
+Class QWebEngineUrlSchemeHandler::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QWebEngineUrlSchemeHandler::QPrivateSignal (0x0x7f78489bf3c0) 0 empty
+
+Vtable for QWebEngineUrlSchemeHandler
+QWebEngineUrlSchemeHandler::_ZTV26QWebEngineUrlSchemeHandler: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI26QWebEngineUrlSchemeHandler)
+16 (int (*)(...))QWebEngineUrlSchemeHandler::metaObject
+24 (int (*)(...))QWebEngineUrlSchemeHandler::qt_metacast
+32 (int (*)(...))QWebEngineUrlSchemeHandler::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+
+Class QWebEngineUrlSchemeHandler
+ size=16 align=8
+ base size=16 base align=8
+QWebEngineUrlSchemeHandler (0x0x7f7848977ea0) 0
+ vptr=((& QWebEngineUrlSchemeHandler::_ZTV26QWebEngineUrlSchemeHandler) + 16)
+ QObject (0x0x7f78489bf360) 0
+ primary-for QWebEngineUrlSchemeHandler (0x0x7f7848977ea0)
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Save_errno (0x0x7f78489d8780) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Range_chk (0x0x7f78489d8ae0) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = long int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = long int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Save_errno (0x0x7f78489d8cc0) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = long int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = long int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Range_chk (0x0x7f78489f4060) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long unsigned int; _Ret = long unsigned int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long unsigned int; _Ret = long unsigned int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Save_errno (0x0x7f78489f4240) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long unsigned int; _Ret = long unsigned int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long unsigned int; _Ret = long unsigned int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Range_chk (0x0x7f78489f45a0) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long int; _Ret = long long int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long int; _Ret = long long int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Save_errno (0x0x7f78489f4780) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long int; _Ret = long long int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long int; _Ret = long long int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Range_chk (0x0x7f78489f4ae0) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long unsigned int; _Ret = long long unsigned int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long unsigned int; _Ret = long long unsigned int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Save_errno (0x0x7f78489f4cc0) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long unsigned int; _Ret = long long unsigned int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long unsigned int; _Ret = long long unsigned int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Range_chk (0x0x7f7848a14060) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = float; _Ret = float; _CharT = char; _Base = {}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = float; _Ret = float; _CharT = char; _Base = {}; std::size_t = long unsigned int]::_Save_errno (0x0x7f7848a14240) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = float; _Ret = float; _CharT = char; _Base = {}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = float; _Ret = float; _CharT = char; _Base = {}; std::size_t = long unsigned int]::_Range_chk (0x0x7f7848a145a0) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = double; _Ret = double; _CharT = char; _Base = {}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = double; _Ret = double; _CharT = char; _Base = {}; std::size_t = long unsigned int]::_Save_errno (0x0x7f7848a14780) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = double; _Ret = double; _CharT = char; _Base = {}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = double; _Ret = double; _CharT = char; _Base = {}; std::size_t = long unsigned int]::_Range_chk (0x0x7f7848a14ae0) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long double; _Ret = long double; _CharT = char; _Base = {}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long double; _Ret = long double; _CharT = char; _Base = {}; std::size_t = long unsigned int]::_Save_errno (0x0x7f7848a14cc0) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long double; _Ret = long double; _CharT = char; _Base = {}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long double; _Ret = long double; _CharT = char; _Base = {}; std::size_t = long unsigned int]::_Range_chk (0x0x7f7848a35060) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Save_errno (0x0x7f7848a4f540) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Range_chk (0x0x7f7848a4f8a0) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = long int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = long int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Save_errno (0x0x7f7848a4fa20) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = long int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = long int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Range_chk (0x0x7f7848a4fd80) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long unsigned int; _Ret = long unsigned int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long unsigned int; _Ret = long unsigned int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Save_errno (0x0x7f7848a4ff00) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long unsigned int; _Ret = long unsigned int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long unsigned int; _Ret = long unsigned int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Range_chk (0x0x7f7848a692a0) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long int; _Ret = long long int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long int; _Ret = long long int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Save_errno (0x0x7f7848a69420) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long int; _Ret = long long int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long int; _Ret = long long int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Range_chk (0x0x7f7848a69780) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long unsigned int; _Ret = long long unsigned int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long unsigned int; _Ret = long long unsigned int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Save_errno (0x0x7f7848a69900) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long unsigned int; _Ret = long long unsigned int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long unsigned int; _Ret = long long unsigned int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Range_chk (0x0x7f7848a69c60) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = float; _Ret = float; _CharT = wchar_t; _Base = {}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = float; _Ret = float; _CharT = wchar_t; _Base = {}; std::size_t = long unsigned int]::_Save_errno (0x0x7f7848a69de0) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = float; _Ret = float; _CharT = wchar_t; _Base = {}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = float; _Ret = float; _CharT = wchar_t; _Base = {}; std::size_t = long unsigned int]::_Range_chk (0x0x7f7848a83180) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = double; _Ret = double; _CharT = wchar_t; _Base = {}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = double; _Ret = double; _CharT = wchar_t; _Base = {}; std::size_t = long unsigned int]::_Save_errno (0x0x7f7848a83300) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = double; _Ret = double; _CharT = wchar_t; _Base = {}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = double; _Ret = double; _CharT = wchar_t; _Base = {}; std::size_t = long unsigned int]::_Range_chk (0x0x7f7848a83660) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long double; _Ret = long double; _CharT = wchar_t; _Base = {}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long double; _Ret = long double; _CharT = wchar_t; _Base = {}; std::size_t = long unsigned int]::_Save_errno (0x0x7f7848a837e0) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long double; _Ret = long double; _CharT = wchar_t; _Base = {}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long double; _Ret = long double; _CharT = wchar_t; _Base = {}; std::size_t = long unsigned int]::_Range_chk (0x0x7f7848a83b40) 0 empty
+
diff --git a/tests/auto/bic/data/QtWebEngineWidgets.5.15.0.linux-gcc-amd64.txt b/tests/auto/bic/data/QtWebEngineWidgets.5.15.0.linux-gcc-amd64.txt
new file mode 100644
index 000000000..ef572a2a3
--- /dev/null
+++ b/tests/auto/bic/data/QtWebEngineWidgets.5.15.0.linux-gcc-amd64.txt
@@ -0,0 +1,23728 @@
+Class std::__failure_type
+ size=1 align=1
+ base size=0 base align=1
+std::__failure_type (0x0x7f5281428e40) 0 empty
+
+Class std::__do_is_destructible_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__do_is_destructible_impl (0x0x7f52814bc600) 0 empty
+
+Class std::__do_is_nt_destructible_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__do_is_nt_destructible_impl (0x0x7f52814bc840) 0 empty
+
+Class std::__do_is_default_constructible_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__do_is_default_constructible_impl (0x0x7f52814bca80) 0 empty
+
+Class std::__do_is_static_castable_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__do_is_static_castable_impl (0x0x7f52814bccc0) 0 empty
+
+Class std::__do_is_direct_constructible_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__do_is_direct_constructible_impl (0x0x7f52814bce40) 0 empty
+
+Class std::__do_is_nary_constructible_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__do_is_nary_constructible_impl (0x0x7f52814f1240) 0 empty
+
+Class std::__do_is_implicitly_default_constructible_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__do_is_implicitly_default_constructible_impl (0x0x7f5281528360) 0 empty
+
+Class std::__do_common_type_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__do_common_type_impl (0x0x7f527eb7ca20) 0 empty
+
+Class std::__do_member_type_wrapper
+ size=1 align=1
+ base size=0 base align=1
+std::__do_member_type_wrapper (0x0x7f527eb7cae0) 0 empty
+
+Class std::__invoke_memfun_ref
+ size=1 align=1
+ base size=0 base align=1
+std::__invoke_memfun_ref (0x0x7f527eb7cea0) 0 empty
+
+Class std::__invoke_memfun_deref
+ size=1 align=1
+ base size=0 base align=1
+std::__invoke_memfun_deref (0x0x7f527eb7cf00) 0 empty
+
+Class std::__invoke_memobj_ref
+ size=1 align=1
+ base size=0 base align=1
+std::__invoke_memobj_ref (0x0x7f527eb7cf60) 0 empty
+
+Class std::__invoke_memobj_deref
+ size=1 align=1
+ base size=0 base align=1
+std::__invoke_memobj_deref (0x0x7f527ebaa000) 0 empty
+
+Class std::__invoke_other
+ size=1 align=1
+ base size=0 base align=1
+std::__invoke_other (0x0x7f527ebaa060) 0 empty
+
+Class std::__result_of_memfun_ref_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__result_of_memfun_ref_impl (0x0x7f527ebaa120) 0 empty
+
+Class std::__result_of_memfun_deref_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__result_of_memfun_deref_impl (0x0x7f527ebaa1e0) 0 empty
+
+Class std::__result_of_memobj_ref_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__result_of_memobj_ref_impl (0x0x7f527ebaa2a0) 0 empty
+
+Class std::__result_of_memobj_deref_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__result_of_memobj_deref_impl (0x0x7f527ebaa360) 0 empty
+
+Class std::__result_of_other_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__result_of_other_impl (0x0x7f527ebaa6c0) 0 empty
+
+Class std::__swappable_details::__do_is_swappable_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__swappable_details::__do_is_swappable_impl (0x0x7f527ebaaa20) 0 empty
+
+Class std::__swappable_details::__do_is_nothrow_swappable_impl
+ size=1 align=1
+ base size=0 base align=1
+std::__swappable_details::__do_is_nothrow_swappable_impl (0x0x7f527ebaaa80) 0 empty
+
+Class std::__nonesuch
+ size=1 align=1
+ base size=0 base align=1
+std::__nonesuch (0x0x7f527ebf3060) 0 empty
+
+Class std::piecewise_construct_t
+ size=1 align=1
+ base size=0 base align=1
+std::piecewise_construct_t (0x0x7f527ebf36c0) 0 empty
+
+Class std::__nonesuch_no_braces
+ size=1 align=1
+ base size=1 base align=1
+std::__nonesuch_no_braces (0x0x7f527ec22000) 0 empty
+ std::__nonesuch (0x0x7f527ebf3ba0) 0 empty
+
+Class std::__true_type
+ size=1 align=1
+ base size=0 base align=1
+std::__true_type (0x0x7f527ec79540) 0 empty
+
+Class std::__false_type
+ size=1 align=1
+ base size=0 base align=1
+std::__false_type (0x0x7f527ec795a0) 0 empty
+
+Class std::input_iterator_tag
+ size=1 align=1
+ base size=0 base align=1
+std::input_iterator_tag (0x0x7f527ecce2a0) 0 empty
+
+Class std::output_iterator_tag
+ size=1 align=1
+ base size=0 base align=1
+std::output_iterator_tag (0x0x7f527ecce300) 0 empty
+
+Class std::forward_iterator_tag
+ size=1 align=1
+ base size=1 base align=1
+std::forward_iterator_tag (0x0x7f527ec224e0) 0 empty
+ std::input_iterator_tag (0x0x7f527ecce360) 0 empty
+
+Class std::bidirectional_iterator_tag
+ size=1 align=1
+ base size=1 base align=1
+std::bidirectional_iterator_tag (0x0x7f527ec22548) 0 empty
+ std::forward_iterator_tag (0x0x7f527ec225b0) 0 empty
+ std::input_iterator_tag (0x0x7f527ecce3c0) 0 empty
+
+Class std::random_access_iterator_tag
+ size=1 align=1
+ base size=1 base align=1
+std::random_access_iterator_tag (0x0x7f527ec22618) 0 empty
+ std::bidirectional_iterator_tag (0x0x7f527ec22680) 0 empty
+ std::forward_iterator_tag (0x0x7f527ec226e8) 0 empty
+ std::input_iterator_tag (0x0x7f527ecce420) 0 empty
+
+Class __gnu_cxx::__ops::_Iter_less_iter
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__ops::_Iter_less_iter (0x0x7f527e95ef00) 0 empty
+
+Class __gnu_cxx::__ops::_Iter_less_val
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__ops::_Iter_less_val (0x0x7f527e986060) 0 empty
+
+Class __gnu_cxx::__ops::_Val_less_iter
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__ops::_Val_less_iter (0x0x7f527e986360) 0 empty
+
+Class __gnu_cxx::__ops::_Iter_equal_to_iter
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__ops::_Iter_equal_to_iter (0x0x7f527e986660) 0 empty
+
+Class __gnu_cxx::__ops::_Iter_equal_to_val
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__ops::_Iter_equal_to_val (0x0x7f527e986780) 0 empty
+
+Class __locale_struct
+ size=232 align=8
+ base size=232 base align=8
+__locale_struct (0x0x7f527ea12a80) 0
+
+Class timeval
+ size=16 align=8
+ base size=16 base align=8
+timeval (0x0x7f527ea12d80) 0
+
+Class timespec
+ size=16 align=8
+ base size=16 base align=8
+timespec (0x0x7f527ea12de0) 0
+
+Class __pthread_rwlock_arch_t
+ size=56 align=8
+ base size=56 base align=8
+__pthread_rwlock_arch_t (0x0x7f527ea12ea0) 0
+
+Class __pthread_internal_list
+ size=16 align=8
+ base size=16 base align=8
+__pthread_internal_list (0x0x7f527ea12f00) 0
+
+Class __pthread_mutex_s
+ size=40 align=8
+ base size=40 base align=8
+__pthread_mutex_s (0x0x7f527ea12f60) 0
+
+Class __pthread_cond_s
+ size=48 align=8
+ base size=48 base align=8
+__pthread_cond_s (0x0x7f527ea5a000) 0
+
+Class pthread_attr_t
+ size=56 align=8
+ base size=56 base align=8
+pthread_attr_t (0x0x7f527ea5a2a0) 0
+
+Class random_data
+ size=48 align=8
+ base size=48 base align=8
+random_data (0x0x7f527ea5a540) 0
+
+Class drand48_data
+ size=24 align=8
+ base size=24 base align=8
+drand48_data (0x0x7f527ea5a5a0) 0
+
+Vtable for std::exception
+std::exception::_ZTVSt9exception: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt9exception)
+16 (int (*)(...))std::exception::~exception
+24 (int (*)(...))std::exception::~exception
+32 (int (*)(...))std::exception::what
+
+Class std::exception
+ size=8 align=8
+ base size=8 base align=8
+std::exception (0x0x7f527eb0d360) 0 nearly-empty
+ vptr=((& std::exception::_ZTVSt9exception) + 16)
+
+Vtable for std::bad_exception
+std::bad_exception::_ZTVSt13bad_exception: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt13bad_exception)
+16 (int (*)(...))std::bad_exception::~bad_exception
+24 (int (*)(...))std::bad_exception::~bad_exception
+32 (int (*)(...))std::bad_exception::what
+
+Class std::bad_exception
+ size=8 align=8
+ base size=8 base align=8
+std::bad_exception (0x0x7f527ec22a28) 0 nearly-empty
+ vptr=((& std::bad_exception::_ZTVSt13bad_exception) + 16)
+ std::exception (0x0x7f527eb0d540) 0 nearly-empty
+ primary-for std::bad_exception (0x0x7f527ec22a28)
+
+Vtable for std::type_info
+std::type_info::_ZTVSt9type_info: 8 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt9type_info)
+16 (int (*)(...))std::type_info::~type_info
+24 (int (*)(...))std::type_info::~type_info
+32 (int (*)(...))std::type_info::__is_pointer_p
+40 (int (*)(...))std::type_info::__is_function_p
+48 (int (*)(...))std::type_info::__do_catch
+56 (int (*)(...))std::type_info::__do_upcast
+
+Class std::type_info
+ size=16 align=8
+ base size=16 base align=8
+std::type_info (0x0x7f527eb0d720) 0
+ vptr=((& std::type_info::_ZTVSt9type_info) + 16)
+
+Vtable for std::bad_cast
+std::bad_cast::_ZTVSt8bad_cast: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt8bad_cast)
+16 (int (*)(...))std::bad_cast::~bad_cast
+24 (int (*)(...))std::bad_cast::~bad_cast
+32 (int (*)(...))std::bad_cast::what
+
+Class std::bad_cast
+ size=8 align=8
+ base size=8 base align=8
+std::bad_cast (0x0x7f527ec22a90) 0 nearly-empty
+ vptr=((& std::bad_cast::_ZTVSt8bad_cast) + 16)
+ std::exception (0x0x7f527eb0dae0) 0 nearly-empty
+ primary-for std::bad_cast (0x0x7f527ec22a90)
+
+Vtable for std::bad_typeid
+std::bad_typeid::_ZTVSt10bad_typeid: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt10bad_typeid)
+16 (int (*)(...))std::bad_typeid::~bad_typeid
+24 (int (*)(...))std::bad_typeid::~bad_typeid
+32 (int (*)(...))std::bad_typeid::what
+
+Class std::bad_typeid
+ size=8 align=8
+ base size=8 base align=8
+std::bad_typeid (0x0x7f527ec22af8) 0 nearly-empty
+ vptr=((& std::bad_typeid::_ZTVSt10bad_typeid) + 16)
+ std::exception (0x0x7f527eb0dcc0) 0 nearly-empty
+ primary-for std::bad_typeid (0x0x7f527ec22af8)
+
+Class std::__exception_ptr::exception_ptr
+ size=8 align=8
+ base size=8 base align=8
+std::__exception_ptr::exception_ptr (0x0x7f527eb0dea0) 0
+
+Vtable for std::nested_exception
+std::nested_exception::_ZTVSt16nested_exception: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt16nested_exception)
+16 (int (*)(...))std::nested_exception::~nested_exception
+24 (int (*)(...))std::nested_exception::~nested_exception
+
+Class std::nested_exception
+ size=16 align=8
+ base size=16 base align=8
+std::nested_exception (0x0x7f527e747480) 0
+ vptr=((& std::nested_exception::_ZTVSt16nested_exception) + 16)
+
+Vtable for std::bad_alloc
+std::bad_alloc::_ZTVSt9bad_alloc: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt9bad_alloc)
+16 (int (*)(...))std::bad_alloc::~bad_alloc
+24 (int (*)(...))std::bad_alloc::~bad_alloc
+32 (int (*)(...))std::bad_alloc::what
+
+Class std::bad_alloc
+ size=8 align=8
+ base size=8 base align=8
+std::bad_alloc (0x0x7f527ec22b60) 0 nearly-empty
+ vptr=((& std::bad_alloc::_ZTVSt9bad_alloc) + 16)
+ std::exception (0x0x7f527e747b40) 0 nearly-empty
+ primary-for std::bad_alloc (0x0x7f527ec22b60)
+
+Vtable for std::bad_array_new_length
+std::bad_array_new_length::_ZTVSt20bad_array_new_length: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt20bad_array_new_length)
+16 (int (*)(...))std::bad_array_new_length::~bad_array_new_length
+24 (int (*)(...))std::bad_array_new_length::~bad_array_new_length
+32 (int (*)(...))std::bad_array_new_length::what
+
+Class std::bad_array_new_length
+ size=8 align=8
+ base size=8 base align=8
+std::bad_array_new_length (0x0x7f527ec22bc8) 0 nearly-empty
+ vptr=((& std::bad_array_new_length::_ZTVSt20bad_array_new_length) + 16)
+ std::bad_alloc (0x0x7f527ec22c30) 0 nearly-empty
+ primary-for std::bad_array_new_length (0x0x7f527ec22bc8)
+ std::exception (0x0x7f527e747d20) 0 nearly-empty
+ primary-for std::bad_alloc (0x0x7f527ec22c30)
+
+Class std::nothrow_t
+ size=1 align=1
+ base size=0 base align=1
+std::nothrow_t (0x0x7f527e747f00) 0 empty
+
+Class std::__allocator_traits_base
+ size=1 align=1
+ base size=0 base align=1
+std::__allocator_traits_base (0x0x7f527e776120) 0 empty
+
+Class std::__numeric_limits_base
+ size=1 align=1
+ base size=0 base align=1
+std::__numeric_limits_base (0x0x7f527e7eb600) 0 empty
+
+Class QSysInfo
+ size=1 align=1
+ base size=0 base align=1
+QSysInfo (0x0x7f527e463b40) 0 empty
+
+Class QMessageLogContext
+ size=32 align=8
+ base size=32 base align=8
+QMessageLogContext (0x0x7f527e463c60) 0
+
+Class QMessageLogger
+ size=32 align=8
+ base size=32 base align=8
+QMessageLogger (0x0x7f527e463e40) 0
+
+Class QFlag
+ size=4 align=4
+ base size=4 base align=4
+QFlag (0x0x7f527e4a1540) 0
+
+Class QIncompatibleFlag
+ size=4 align=4
+ base size=4 base align=4
+QIncompatibleFlag (0x0x7f527e4ddcc0) 0
+
+Class std::__atomic_flag_base
+ size=1 align=1
+ base size=1 base align=1
+std::__atomic_flag_base (0x0x7f527e191240) 0
+
+Class std::atomic_flag
+ size=1 align=1
+ base size=1 base align=1
+std::atomic_flag (0x0x7f527e52aa90) 0
+ std::__atomic_flag_base (0x0x7f527e1912a0) 0
+
+Class QAtomicInt
+ size=4 align=4
+ base size=4 base align=4
+QAtomicInt (0x0x7f527dfe3208) 0
+ QAtomicInteger<int> (0x0x7f527dfe3270) 0
+ QBasicAtomicInteger<int> (0x0x7f527e0c24e0) 0
+
+Class QInternal
+ size=1 align=1
+ base size=0 base align=1
+QInternal (0x0x7f527dd29060) 0 empty
+
+Class QtPrivate::QSlotObjectBase
+ size=16 align=8
+ base size=16 base align=8
+QtPrivate::QSlotObjectBase (0x0x7f527d96b600) 0
+
+Class QGenericArgument
+ size=16 align=8
+ base size=16 base align=8
+QGenericArgument (0x0x7f527d96bd20) 0
+
+Class QGenericReturnArgument
+ size=16 align=8
+ base size=16 base align=8
+QGenericReturnArgument (0x0x7f527dee0ea0) 0
+ QGenericArgument (0x0x7f527d9aa000) 0
+
+Class QMetaObject::SuperData
+ size=8 align=8
+ base size=8 base align=8
+QMetaObject::SuperData (0x0x7f527d9aa480) 0
+
+Class QMetaObject
+ size=48 align=8
+ base size=48 base align=8
+QMetaObject (0x0x7f527d9aa420) 0
+
+Class QMetaObject::Connection
+ size=8 align=8
+ base size=8 base align=8
+QMetaObject::Connection (0x0x7f527d9aad20) 0
+
+Class QLatin1Char
+ size=1 align=1
+ base size=1 base align=1
+QLatin1Char (0x0x7f527da5c840) 0
+
+Class QChar
+ size=2 align=2
+ base size=2 base align=2
+QChar (0x0x7f527da5cf60) 0
+
+Class QtPrivate::RefCount
+ size=4 align=4
+ base size=4 base align=4
+QtPrivate::RefCount (0x0x7f527d72dd80) 0
+
+Class QArrayData
+ size=24 align=8
+ base size=24 base align=8
+QArrayData (0x0x7f527d755120) 0
+
+Class QtPrivate::QContainerImplHelper
+ size=1 align=1
+ base size=0 base align=1
+QtPrivate::QContainerImplHelper (0x0x7f527d7b6420) 0 empty
+
+Class lconv
+ size=96 align=8
+ base size=96 base align=8
+lconv (0x0x7f527d866c60) 0
+
+Vtable for __cxxabiv1::__forced_unwind
+__cxxabiv1::__forced_unwind::_ZTVN10__cxxabiv115__forced_unwindE: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTIN10__cxxabiv115__forced_unwindE)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+
+Class __cxxabiv1::__forced_unwind
+ size=8 align=8
+ base size=8 base align=8
+__cxxabiv1::__forced_unwind (0x0x7f527d866d20) 0 nearly-empty
+ vptr=((& __cxxabiv1::__forced_unwind::_ZTVN10__cxxabiv115__forced_unwindE) + 16)
+
+Class sched_param
+ size=4 align=4
+ base size=4 base align=4
+sched_param (0x0x7f527d52ee40) 0
+
+Class timex
+ size=208 align=8
+ base size=208 base align=8
+timex (0x0x7f527d52ef00) 0
+
+Class tm
+ size=56 align=8
+ base size=56 base align=8
+tm (0x0x7f527d52ef60) 0
+
+Class itimerspec
+ size=32 align=8
+ base size=32 base align=8
+itimerspec (0x0x7f527d563000) 0
+
+Class _pthread_cleanup_buffer
+ size=32 align=8
+ base size=32 base align=8
+_pthread_cleanup_buffer (0x0x7f527d563060) 0
+
+Class __pthread_cleanup_frame
+ size=24 align=8
+ base size=24 base align=8
+__pthread_cleanup_frame (0x0x7f527d563180) 0
+
+Class __pthread_cleanup_class
+ size=24 align=8
+ base size=24 base align=8
+__pthread_cleanup_class (0x0x7f527d5631e0) 0
+
+Class _IO_marker
+ size=24 align=8
+ base size=24 base align=8
+_IO_marker (0x0x7f527d6a4180) 0
+
+Class _IO_FILE
+ size=216 align=8
+ base size=216 base align=8
+_IO_FILE (0x0x7f527d6a41e0) 0
+
+Class std::_Hash_impl
+ size=1 align=1
+ base size=0 base align=1
+std::_Hash_impl (0x0x7f527d452240) 0 empty
+
+Class std::_Fnv_hash_impl
+ size=1 align=1
+ base size=0 base align=1
+std::_Fnv_hash_impl (0x0x7f527d4523c0) 0 empty
+
+Class std::locale
+ size=8 align=8
+ base size=8 base align=8
+std::locale (0x0x7f527d1d3540) 0
+
+Vtable for std::locale::facet
+std::locale::facet::_ZTVNSt6locale5facetE: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTINSt6locale5facetE)
+16 (int (*)(...))std::locale::facet::~facet
+24 (int (*)(...))std::locale::facet::~facet
+
+Class std::locale::facet
+ size=16 align=8
+ base size=12 base align=8
+std::locale::facet (0x0x7f527d1d3900) 0
+ vptr=((& std::locale::facet::_ZTVNSt6locale5facetE) + 16)
+
+Class std::locale::id
+ size=8 align=8
+ base size=8 base align=8
+std::locale::id (0x0x7f527d1d3ba0) 0
+
+Class std::locale::_Impl
+ size=40 align=8
+ base size=40 base align=8
+std::locale::_Impl (0x0x7f527d1d3d80) 0
+
+Class std::__cow_string
+ size=8 align=8
+ base size=8 base align=8
+std::__cow_string (0x0x7f527d226d80) 0
+
+Vtable for std::logic_error
+std::logic_error::_ZTVSt11logic_error: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt11logic_error)
+16 (int (*)(...))std::logic_error::~logic_error
+24 (int (*)(...))std::logic_error::~logic_error
+32 (int (*)(...))std::logic_error::what
+
+Class std::logic_error
+ size=16 align=8
+ base size=16 base align=8
+std::logic_error (0x0x7f527d4554e0) 0
+ vptr=((& std::logic_error::_ZTVSt11logic_error) + 16)
+ std::exception (0x0x7f527d226e40) 0 nearly-empty
+ primary-for std::logic_error (0x0x7f527d4554e0)
+
+Vtable for std::domain_error
+std::domain_error::_ZTVSt12domain_error: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt12domain_error)
+16 (int (*)(...))std::domain_error::~domain_error
+24 (int (*)(...))std::domain_error::~domain_error
+32 (int (*)(...))std::logic_error::what
+
+Class std::domain_error
+ size=16 align=8
+ base size=16 base align=8
+std::domain_error (0x0x7f527d455548) 0
+ vptr=((& std::domain_error::_ZTVSt12domain_error) + 16)
+ std::logic_error (0x0x7f527d455888) 0
+ primary-for std::domain_error (0x0x7f527d455548)
+ std::exception (0x0x7f527d226ea0) 0 nearly-empty
+ primary-for std::logic_error (0x0x7f527d455888)
+
+Vtable for std::invalid_argument
+std::invalid_argument::_ZTVSt16invalid_argument: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt16invalid_argument)
+16 (int (*)(...))std::invalid_argument::~invalid_argument
+24 (int (*)(...))std::invalid_argument::~invalid_argument
+32 (int (*)(...))std::logic_error::what
+
+Class std::invalid_argument
+ size=16 align=8
+ base size=16 base align=8
+std::invalid_argument (0x0x7f527d4558f0) 0
+ vptr=((& std::invalid_argument::_ZTVSt16invalid_argument) + 16)
+ std::logic_error (0x0x7f527d279000) 0
+ primary-for std::invalid_argument (0x0x7f527d4558f0)
+ std::exception (0x0x7f527d226f00) 0 nearly-empty
+ primary-for std::logic_error (0x0x7f527d279000)
+
+Vtable for std::length_error
+std::length_error::_ZTVSt12length_error: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt12length_error)
+16 (int (*)(...))std::length_error::~length_error
+24 (int (*)(...))std::length_error::~length_error
+32 (int (*)(...))std::logic_error::what
+
+Class std::length_error
+ size=16 align=8
+ base size=16 base align=8
+std::length_error (0x0x7f527d279068) 0
+ vptr=((& std::length_error::_ZTVSt12length_error) + 16)
+ std::logic_error (0x0x7f527d2790d0) 0
+ primary-for std::length_error (0x0x7f527d279068)
+ std::exception (0x0x7f527d226f60) 0 nearly-empty
+ primary-for std::logic_error (0x0x7f527d2790d0)
+
+Vtable for std::out_of_range
+std::out_of_range::_ZTVSt12out_of_range: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt12out_of_range)
+16 (int (*)(...))std::out_of_range::~out_of_range
+24 (int (*)(...))std::out_of_range::~out_of_range
+32 (int (*)(...))std::logic_error::what
+
+Class std::out_of_range
+ size=16 align=8
+ base size=16 base align=8
+std::out_of_range (0x0x7f527d279138) 0
+ vptr=((& std::out_of_range::_ZTVSt12out_of_range) + 16)
+ std::logic_error (0x0x7f527d2791a0) 0
+ primary-for std::out_of_range (0x0x7f527d279138)
+ std::exception (0x0x7f527d27f000) 0 nearly-empty
+ primary-for std::logic_error (0x0x7f527d2791a0)
+
+Vtable for std::runtime_error
+std::runtime_error::_ZTVSt13runtime_error: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt13runtime_error)
+16 (int (*)(...))std::runtime_error::~runtime_error
+24 (int (*)(...))std::runtime_error::~runtime_error
+32 (int (*)(...))std::runtime_error::what
+
+Class std::runtime_error
+ size=16 align=8
+ base size=16 base align=8
+std::runtime_error (0x0x7f527d279208) 0
+ vptr=((& std::runtime_error::_ZTVSt13runtime_error) + 16)
+ std::exception (0x0x7f527d27f060) 0 nearly-empty
+ primary-for std::runtime_error (0x0x7f527d279208)
+
+Vtable for std::range_error
+std::range_error::_ZTVSt11range_error: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt11range_error)
+16 (int (*)(...))std::range_error::~range_error
+24 (int (*)(...))std::range_error::~range_error
+32 (int (*)(...))std::runtime_error::what
+
+Class std::range_error
+ size=16 align=8
+ base size=16 base align=8
+std::range_error (0x0x7f527d279270) 0
+ vptr=((& std::range_error::_ZTVSt11range_error) + 16)
+ std::runtime_error (0x0x7f527d2792d8) 0
+ primary-for std::range_error (0x0x7f527d279270)
+ std::exception (0x0x7f527d27f0c0) 0 nearly-empty
+ primary-for std::runtime_error (0x0x7f527d2792d8)
+
+Vtable for std::overflow_error
+std::overflow_error::_ZTVSt14overflow_error: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt14overflow_error)
+16 (int (*)(...))std::overflow_error::~overflow_error
+24 (int (*)(...))std::overflow_error::~overflow_error
+32 (int (*)(...))std::runtime_error::what
+
+Class std::overflow_error
+ size=16 align=8
+ base size=16 base align=8
+std::overflow_error (0x0x7f527d279340) 0
+ vptr=((& std::overflow_error::_ZTVSt14overflow_error) + 16)
+ std::runtime_error (0x0x7f527d2793a8) 0
+ primary-for std::overflow_error (0x0x7f527d279340)
+ std::exception (0x0x7f527d27f120) 0 nearly-empty
+ primary-for std::runtime_error (0x0x7f527d2793a8)
+
+Vtable for std::underflow_error
+std::underflow_error::_ZTVSt15underflow_error: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt15underflow_error)
+16 (int (*)(...))std::underflow_error::~underflow_error
+24 (int (*)(...))std::underflow_error::~underflow_error
+32 (int (*)(...))std::runtime_error::what
+
+Class std::underflow_error
+ size=16 align=8
+ base size=16 base align=8
+std::underflow_error (0x0x7f527d279410) 0
+ vptr=((& std::underflow_error::_ZTVSt15underflow_error) + 16)
+ std::runtime_error (0x0x7f527d279478) 0
+ primary-for std::underflow_error (0x0x7f527d279410)
+ std::exception (0x0x7f527d27f180) 0 nearly-empty
+ primary-for std::runtime_error (0x0x7f527d279478)
+
+Vtable for std::_V2::error_category
+std::_V2::error_category::_ZTVNSt3_V214error_categoryE: 10 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTINSt3_V214error_categoryE)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))std::_V2::error_category::_M_message
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))std::_V2::error_category::default_error_condition
+64 (int (*)(...))std::_V2::error_category::equivalent
+72 (int (*)(...))std::_V2::error_category::equivalent
+
+Class std::_V2::error_category
+ size=8 align=8
+ base size=8 base align=8
+std::_V2::error_category (0x0x7f527d27f300) 0 nearly-empty
+ vptr=((& std::_V2::error_category::_ZTVNSt3_V214error_categoryE) + 16)
+
+Class std::error_code
+ size=16 align=8
+ base size=16 base align=8
+std::error_code (0x0x7f527d27f660) 0
+
+Class std::error_condition
+ size=16 align=8
+ base size=16 base align=8
+std::error_condition (0x0x7f527d27fea0) 0
+
+Vtable for std::system_error
+std::system_error::_ZTVSt12system_error: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt12system_error)
+16 (int (*)(...))std::system_error::~system_error
+24 (int (*)(...))std::system_error::~system_error
+32 (int (*)(...))std::runtime_error::what
+
+Class std::system_error
+ size=32 align=8
+ base size=32 base align=8
+std::system_error (0x0x7f527d279888) 0
+ vptr=((& std::system_error::_ZTVSt12system_error) + 16)
+ std::runtime_error (0x0x7f527d2798f0) 0
+ primary-for std::system_error (0x0x7f527d279888)
+ std::exception (0x0x7f527d2c2a80) 0 nearly-empty
+ primary-for std::runtime_error (0x0x7f527d2798f0)
+
+Vtable for std::ios_base::failure
+std::ios_base::failure::_ZTVNSt8ios_base7failureB5cxx11E: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTINSt8ios_base7failureB5cxx11E)
+16 (int (*)(...))std::ios_base::failure::~failure
+24 (int (*)(...))std::ios_base::failure::~failure
+32 (int (*)(...))std::ios_base::failure::what
+
+Class std::ios_base::failure
+ size=32 align=8
+ base size=32 base align=8
+std::ios_base::failure (0x0x7f527d279b60) 0
+ vptr=((& std::ios_base::failure::_ZTVNSt8ios_base7failureB5cxx11E) + 16)
+ std::system_error (0x0x7f527d279bc8) 0
+ primary-for std::ios_base::failure (0x0x7f527d279b60)
+ std::runtime_error (0x0x7f527d279c30) 0
+ primary-for std::system_error (0x0x7f527d279bc8)
+ std::exception (0x0x7f527d31c060) 0 nearly-empty
+ primary-for std::runtime_error (0x0x7f527d279c30)
+
+Class std::ios_base::_Callback_list
+ size=24 align=8
+ base size=24 base align=8
+std::ios_base::_Callback_list (0x0x7f527d31c0c0) 0
+
+Class std::ios_base::_Words
+ size=16 align=8
+ base size=16 base align=8
+std::ios_base::_Words (0x0x7f527d31c120) 0
+
+Class std::ios_base::Init
+ size=1 align=1
+ base size=0 base align=1
+std::ios_base::Init (0x0x7f527d31c180) 0 empty
+
+Vtable for std::ios_base
+std::ios_base::_ZTVSt8ios_base: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt8ios_base)
+16 (int (*)(...))std::ios_base::~ios_base
+24 (int (*)(...))std::ios_base::~ios_base
+
+Class std::ios_base
+ size=216 align=8
+ base size=216 base align=8
+std::ios_base (0x0x7f527d31c000) 0
+ vptr=((& std::ios_base::_ZTVSt8ios_base) + 16)
+
+Class std::ctype_base
+ size=1 align=1
+ base size=0 base align=1
+std::ctype_base (0x0x7f527cfe7a80) 0 empty
+
+Class std::__num_base
+ size=1 align=1
+ base size=0 base align=1
+std::__num_base (0x0x7f527d08cc60) 0 empty
+
+VTT for std::basic_ostream<char>
+std::basic_ostream<char>::_ZTTSo: 2 entries
+0 ((& std::basic_ostream<char>::_ZTVSo) + 24)
+8 ((& std::basic_ostream<char>::_ZTVSo) + 64)
+
+VTT for std::basic_ostream<wchar_t>
+std::basic_ostream<wchar_t>::_ZTTSt13basic_ostreamIwSt11char_traitsIwEE: 2 entries
+0 ((& std::basic_ostream<wchar_t>::_ZTVSt13basic_ostreamIwSt11char_traitsIwEE) + 24)
+8 ((& std::basic_ostream<wchar_t>::_ZTVSt13basic_ostreamIwSt11char_traitsIwEE) + 64)
+
+VTT for std::basic_istream<char>
+std::basic_istream<char>::_ZTTSi: 2 entries
+0 ((& std::basic_istream<char>::_ZTVSi) + 24)
+8 ((& std::basic_istream<char>::_ZTVSi) + 64)
+
+VTT for std::basic_istream<wchar_t>
+std::basic_istream<wchar_t>::_ZTTSt13basic_istreamIwSt11char_traitsIwEE: 2 entries
+0 ((& std::basic_istream<wchar_t>::_ZTVSt13basic_istreamIwSt11char_traitsIwEE) + 24)
+8 ((& std::basic_istream<wchar_t>::_ZTVSt13basic_istreamIwSt11char_traitsIwEE) + 64)
+
+Construction vtable for std::basic_istream<char> (0x0x7f527cc63340 instance) in std::basic_iostream<char>
+std::basic_iostream<char>::_ZTCSd0_Si: 10 entries
+0 24
+8 (int (*)(...))0
+16 (int (*)(...))(& _ZTISi)
+24 0
+32 0
+40 18446744073709551592
+48 (int (*)(...))-24
+56 (int (*)(...))(& _ZTISi)
+64 0
+72 0
+
+Construction vtable for std::basic_ostream<char> (0x0x7f527cc63410 instance) in std::basic_iostream<char>
+std::basic_iostream<char>::_ZTCSd16_So: 10 entries
+0 8
+8 (int (*)(...))0
+16 (int (*)(...))(& _ZTISo)
+24 0
+32 0
+40 18446744073709551608
+48 (int (*)(...))-8
+56 (int (*)(...))(& _ZTISo)
+64 0
+72 0
+
+VTT for std::basic_iostream<char>
+std::basic_iostream<char>::_ZTTSd: 7 entries
+0 ((& std::basic_iostream<char>::_ZTVSd) + 24)
+8 ((& std::basic_iostream<char>::_ZTCSd0_Si) + 24)
+16 ((& std::basic_iostream<char>::_ZTCSd0_Si) + 64)
+24 ((& std::basic_iostream<char>::_ZTCSd16_So) + 24)
+32 ((& std::basic_iostream<char>::_ZTCSd16_So) + 64)
+40 ((& std::basic_iostream<char>::_ZTVSd) + 104)
+48 ((& std::basic_iostream<char>::_ZTVSd) + 64)
+
+Construction vtable for std::basic_istream<wchar_t> (0x0x7f527cca80d0 instance) in std::basic_iostream<wchar_t>
+std::basic_iostream<wchar_t>::_ZTCSt14basic_iostreamIwSt11char_traitsIwEE0_St13basic_istreamIwS1_E: 10 entries
+0 24
+8 (int (*)(...))0
+16 (int (*)(...))(& _ZTISt13basic_istreamIwSt11char_traitsIwEE)
+24 0
+32 0
+40 18446744073709551592
+48 (int (*)(...))-24
+56 (int (*)(...))(& _ZTISt13basic_istreamIwSt11char_traitsIwEE)
+64 0
+72 0
+
+Construction vtable for std::basic_ostream<wchar_t> (0x0x7f527cca81a0 instance) in std::basic_iostream<wchar_t>
+std::basic_iostream<wchar_t>::_ZTCSt14basic_iostreamIwSt11char_traitsIwEE16_St13basic_ostreamIwS1_E: 10 entries
+0 8
+8 (int (*)(...))0
+16 (int (*)(...))(& _ZTISt13basic_ostreamIwSt11char_traitsIwEE)
+24 0
+32 0
+40 18446744073709551608
+48 (int (*)(...))-8
+56 (int (*)(...))(& _ZTISt13basic_ostreamIwSt11char_traitsIwEE)
+64 0
+72 0
+
+VTT for std::basic_iostream<wchar_t>
+std::basic_iostream<wchar_t>::_ZTTSt14basic_iostreamIwSt11char_traitsIwEE: 7 entries
+0 ((& std::basic_iostream<wchar_t>::_ZTVSt14basic_iostreamIwSt11char_traitsIwEE) + 24)
+8 ((& std::basic_iostream<wchar_t>::_ZTCSt14basic_iostreamIwSt11char_traitsIwEE0_St13basic_istreamIwS1_E) + 24)
+16 ((& std::basic_iostream<wchar_t>::_ZTCSt14basic_iostreamIwSt11char_traitsIwEE0_St13basic_istreamIwS1_E) + 64)
+24 ((& std::basic_iostream<wchar_t>::_ZTCSt14basic_iostreamIwSt11char_traitsIwEE16_St13basic_ostreamIwS1_E) + 24)
+32 ((& std::basic_iostream<wchar_t>::_ZTCSt14basic_iostreamIwSt11char_traitsIwEE16_St13basic_ostreamIwS1_E) + 64)
+40 ((& std::basic_iostream<wchar_t>::_ZTVSt14basic_iostreamIwSt11char_traitsIwEE) + 104)
+48 ((& std::basic_iostream<wchar_t>::_ZTVSt14basic_iostreamIwSt11char_traitsIwEE) + 64)
+
+Class QByteArrayDataPtr
+ size=8 align=8
+ base size=8 base align=8
+QByteArrayDataPtr (0x0x7f527ccca600) 0
+
+Class QByteArray
+ size=8 align=8
+ base size=8 base align=8
+QByteArray (0x0x7f527ccca660) 0
+
+Class QByteRef
+ size=16 align=8
+ base size=12 base align=8
+QByteRef (0x0x7f527c9fda20) 0
+
+Class QByteArray::FromBase64Result
+ size=16 align=8
+ base size=12 base align=8
+QByteArray::FromBase64Result (0x0x7f527ca9c780) 0
+
+Class QStringDataPtr
+ size=8 align=8
+ base size=8 base align=8
+QStringDataPtr (0x0x7f527c774c60) 0
+
+Class QStringView
+ size=16 align=8
+ base size=16 base align=8
+QStringView (0x0x7f527c7ad120) 0
+
+Class QLatin1String
+ size=16 align=8
+ base size=16 base align=8
+QLatin1String (0x0x7f527c88c300) 0
+
+Class QString::Null
+ size=1 align=1
+ base size=0 base align=1
+QString::Null (0x0x7f527c545480) 0 empty
+
+Class QString
+ size=8 align=8
+ base size=8 base align=8
+QString (0x0x7f527c545360) 0
+
+Class QCharRef
+ size=16 align=8
+ base size=12 base align=8
+QCharRef (0x0x7f527c4242a0) 0
+
+Class QStringRef
+ size=16 align=8
+ base size=16 base align=8
+QStringRef (0x0x7f527c188e40) 0
+
+Class QtPrivate::ArgBase
+ size=1 align=1
+ base size=1 base align=1
+QtPrivate::ArgBase (0x0x7f527c30bcc0) 0
+
+Class QtPrivate::QStringViewArg
+ size=24 align=8
+ base size=24 base align=8
+QtPrivate::QStringViewArg (0x0x7f527c232958) 0
+ QtPrivate::ArgBase (0x0x7f527c30bd20) 0
+
+Class QtPrivate::QLatin1StringArg
+ size=24 align=8
+ base size=24 base align=8
+QtPrivate::QLatin1StringArg (0x0x7f527c2329c0) 0
+ QtPrivate::ArgBase (0x0x7f527c30bf00) 0
+
+Class std::__erased_type
+ size=1 align=1
+ base size=0 base align=1
+std::__erased_type (0x0x7f527c009060) 0 empty
+
+Class std::allocator_arg_t
+ size=1 align=1
+ base size=0 base align=1
+std::allocator_arg_t (0x0x7f527c0090c0) 0 empty
+
+Class std::__uses_alloc_base
+ size=1 align=1
+ base size=0 base align=1
+std::__uses_alloc_base (0x0x7f527c009240) 0 empty
+
+Class std::__uses_alloc0::_Sink
+ size=1 align=1
+ base size=0 base align=1
+std::__uses_alloc0::_Sink (0x0x7f527c009300) 0 empty
+
+Class std::__uses_alloc0
+ size=1 align=1
+ base size=1 base align=1
+std::__uses_alloc0 (0x0x7f527c232d68) 0
+ std::__uses_alloc_base (0x0x7f527c0092a0) 0 empty
+
+Class std::_Swallow_assign
+ size=1 align=1
+ base size=0 base align=1
+std::_Swallow_assign (0x0x7f527bd71660) 0 empty
+
+Vtable for std::bad_function_call
+std::bad_function_call::_ZTVSt17bad_function_call: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt17bad_function_call)
+16 (int (*)(...))std::bad_function_call::~bad_function_call
+24 (int (*)(...))std::bad_function_call::~bad_function_call
+32 (int (*)(...))std::bad_function_call::what
+
+Class std::bad_function_call
+ size=8 align=8
+ base size=8 base align=8
+std::bad_function_call (0x0x7f527bde7000) 0 nearly-empty
+ vptr=((& std::bad_function_call::_ZTVSt17bad_function_call) + 16)
+ std::exception (0x0x7f527bdb5f60) 0 nearly-empty
+ primary-for std::bad_function_call (0x0x7f527bde7000)
+
+Class std::_Nocopy_types
+ size=16 align=8
+ base size=16 base align=8
+std::_Nocopy_types (0x0x7f527bdea060) 0
+
+Class std::_Any_data
+ size=16 align=8
+ base size=16 base align=8
+std::_Any_data (0x0x7f527bdea0c0) 0
+
+Class std::_Function_base
+ size=24 align=8
+ base size=24 base align=8
+std::_Function_base (0x0x7f527bdea3c0) 0
+
+Class QtPrivate::QHashCombine
+ size=1 align=1
+ base size=0 base align=1
+QtPrivate::QHashCombine (0x0x7f527bbde840) 0 empty
+
+Class QtPrivate::QHashCombineCommutative
+ size=1 align=1
+ base size=0 base align=1
+QtPrivate::QHashCombineCommutative (0x0x7f527bbde900) 0 empty
+
+Class std::_Bit_reference
+ size=16 align=8
+ base size=16 base align=8
+std::_Bit_reference (0x0x7f527bd13000) 0
+
+Class std::_Bit_iterator_base
+ size=16 align=8
+ base size=12 base align=8
+std::_Bit_iterator_base (0x0x7f527bc2cb60) 0
+ std::iterator<std::random_access_iterator_tag, bool> (0x0x7f527bd13720) 0 empty
+
+Class std::_Bit_iterator
+ size=16 align=8
+ base size=12 base align=8
+std::_Bit_iterator (0x0x7f527bc2cc98) 0
+ std::_Bit_iterator_base (0x0x7f527bc2cd00) 0
+ std::iterator<std::random_access_iterator_tag, bool> (0x0x7f527bd13d80) 0 empty
+
+Class std::_Bit_const_iterator
+ size=16 align=8
+ base size=12 base align=8
+std::_Bit_const_iterator (0x0x7f527bc2cd68) 0
+ std::_Bit_iterator_base (0x0x7f527bc2cdd0) 0
+ std::iterator<std::random_access_iterator_tag, bool> (0x0x7f527b9465a0) 0 empty
+
+Class std::__detail::_List_node_base
+ size=16 align=8
+ base size=16 base align=8
+std::__detail::_List_node_base (0x0x7f527bafdd80) 0
+
+Class QListData::NotArrayCompatibleLayout
+ size=1 align=1
+ base size=0 base align=1
+QListData::NotArrayCompatibleLayout (0x0x7f527b806b40) 0 empty
+
+Class QListData::NotIndirectLayout
+ size=1 align=1
+ base size=0 base align=1
+QListData::NotIndirectLayout (0x0x7f527b806ba0) 0 empty
+
+Class QListData::ArrayCompatibleLayout
+ size=1 align=1
+ base size=1 base align=1
+QListData::ArrayCompatibleLayout (0x0x7f527b9c58f0) 0 empty
+ QListData::NotIndirectLayout (0x0x7f527b806c00) 0 empty
+
+Class QListData::InlineWithPaddingLayout
+ size=1 align=1
+ base size=1 base align=1
+QListData::InlineWithPaddingLayout (0x0x7f527b75e9a0) 0 empty
+ QListData::NotArrayCompatibleLayout (0x0x7f527b806c60) 0 empty
+ QListData::NotIndirectLayout (0x0x7f527b806cc0) 0 empty
+
+Class QListData::IndirectLayout
+ size=1 align=1
+ base size=1 base align=1
+QListData::IndirectLayout (0x0x7f527b9c5958) 0 empty
+ QListData::NotArrayCompatibleLayout (0x0x7f527b806d20) 0 empty
+
+Class QListData::Data
+ size=24 align=8
+ base size=24 base align=8
+QListData::Data (0x0x7f527b806d80) 0
+
+Class QListData
+ size=8 align=8
+ base size=8 base align=8
+QListData (0x0x7f527b806ae0) 0
+
+Class QRegExp
+ size=8 align=8
+ base size=8 base align=8
+QRegExp (0x0x7f527b8f6f00) 0
+
+Class QStringMatcher::Data
+ size=272 align=8
+ base size=272 base align=8
+QStringMatcher::Data (0x0x7f527b5f3480) 0
+
+Class QStringMatcher
+ size=1048 align=8
+ base size=1048 base align=8
+QStringMatcher (0x0x7f527b5f3420) 0
+
+Class QStringList
+ size=8 align=8
+ base size=8 base align=8
+QStringList (0x0x7f527b5f1548) 0
+ QList<QString> (0x0x7f527b5f15b0) 0
+ QListSpecialMethods<QString> (0x0x7f527b5f36c0) 0 empty
+
+Class QScopedPointerPodDeleter
+ size=1 align=1
+ base size=0 base align=1
+QScopedPointerPodDeleter (0x0x7f527b6d0480) 0 empty
+
+Class std::_Rb_tree_node_base
+ size=32 align=8
+ base size=32 base align=8
+std::_Rb_tree_node_base (0x0x7f527b3596c0) 0
+
+Class std::_Rb_tree_header
+ size=40 align=8
+ base size=40 base align=8
+std::_Rb_tree_header (0x0x7f527b359a20) 0
+
+Class QtPrivate::AbstractDebugStreamFunction
+ size=16 align=8
+ base size=16 base align=8
+QtPrivate::AbstractDebugStreamFunction (0x0x7f527b1ba060) 0
+
+Class QtPrivate::AbstractComparatorFunction
+ size=24 align=8
+ base size=24 base align=8
+QtPrivate::AbstractComparatorFunction (0x0x7f527b1ba3c0) 0
+
+Class QtPrivate::AbstractConverterFunction
+ size=8 align=8
+ base size=8 base align=8
+QtPrivate::AbstractConverterFunction (0x0x7f527b1ba900) 0
+
+Class QMetaType
+ size=80 align=8
+ base size=80 base align=8
+QMetaType (0x0x7f527b1bae40) 0
+
+Class QtMetaTypePrivate::VariantData
+ size=24 align=8
+ base size=20 base align=8
+QtMetaTypePrivate::VariantData (0x0x7f527b247180) 0
+
+Class QtMetaTypePrivate::VectorBoolElements
+ size=1 align=1
+ base size=0 base align=1
+QtMetaTypePrivate::VectorBoolElements (0x0x7f527b247840) 0 empty
+
+Class QtMetaTypePrivate::QSequentialIterableImpl
+ size=104 align=8
+ base size=104 base align=8
+QtMetaTypePrivate::QSequentialIterableImpl (0x0x7f527b2e18a0) 0
+
+Class QtMetaTypePrivate::QAssociativeIterableImpl
+ size=112 align=8
+ base size=112 base align=8
+QtMetaTypePrivate::QAssociativeIterableImpl (0x0x7f527af5c9c0) 0
+
+Class QtMetaTypePrivate::QPairVariantInterfaceImpl
+ size=40 align=8
+ base size=40 base align=8
+QtMetaTypePrivate::QPairVariantInterfaceImpl (0x0x7f527afb1f00) 0
+
+Class std::chrono::_V2::system_clock
+ size=1 align=1
+ base size=0 base align=1
+std::chrono::_V2::system_clock (0x0x7f527ae7b5a0) 0 empty
+
+Class std::chrono::_V2::steady_clock
+ size=1 align=1
+ base size=0 base align=1
+std::chrono::_V2::steady_clock (0x0x7f527aba8060) 0 empty
+
+Vtable for QObjectData
+QObjectData::_ZTV11QObjectData: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QObjectData)
+16 (int (*)(...))__cxa_pure_virtual
+24 (int (*)(...))__cxa_pure_virtual
+
+Class QObjectData
+ size=48 align=8
+ base size=48 base align=8
+QObjectData (0x0x7f527aba80c0) 0
+ vptr=((& QObjectData::_ZTV11QObjectData) + 16)
+
+Class QObject::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QObject::QPrivateSignal (0x0x7f527aba82a0) 0 empty
+
+Vtable for QObject
+QObject::_ZTV7QObject: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI7QObject)
+16 (int (*)(...))QObject::metaObject
+24 (int (*)(...))QObject::qt_metacast
+32 (int (*)(...))QObject::qt_metacall
+40 (int (*)(...))QObject::~QObject
+48 (int (*)(...))QObject::~QObject
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QObject
+ size=16 align=8
+ base size=16 base align=8
+QObject (0x0x7f527aba8240) 0
+ vptr=((& QObject::_ZTV7QObject) + 16)
+
+Vtable for QObjectUserData
+QObjectUserData::_ZTV15QObjectUserData: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QObjectUserData)
+16 (int (*)(...))QObjectUserData::~QObjectUserData
+24 (int (*)(...))QObjectUserData::~QObjectUserData
+
+Class QObjectUserData
+ size=8 align=8
+ base size=8 base align=8
+QObjectUserData (0x0x7f527ac7c0c0) 0 nearly-empty
+ vptr=((& QObjectUserData::_ZTV15QObjectUserData) + 16)
+
+Class QSignalBlocker
+ size=16 align=8
+ base size=10 base align=8
+QSignalBlocker (0x0x7f527ac7c240) 0
+
+Class QAbstractAnimation::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAbstractAnimation::QPrivateSignal (0x0x7f527ac7cae0) 0 empty
+
+Vtable for QAbstractAnimation
+QAbstractAnimation::_ZTV18QAbstractAnimation: 18 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QAbstractAnimation)
+16 (int (*)(...))QAbstractAnimation::metaObject
+24 (int (*)(...))QAbstractAnimation::qt_metacast
+32 (int (*)(...))QAbstractAnimation::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QAbstractAnimation::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))QAbstractAnimation::updateState
+136 (int (*)(...))QAbstractAnimation::updateDirection
+
+Class QAbstractAnimation
+ size=16 align=8
+ base size=16 base align=8
+QAbstractAnimation (0x0x7f527ac30d00) 0
+ vptr=((& QAbstractAnimation::_ZTV18QAbstractAnimation) + 16)
+ QObject (0x0x7f527ac7ca80) 0
+ primary-for QAbstractAnimation (0x0x7f527ac30d00)
+
+Class QAnimationDriver::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAnimationDriver::QPrivateSignal (0x0x7f527ac7cea0) 0 empty
+
+Vtable for QAnimationDriver
+QAnimationDriver::_ZTV16QAnimationDriver: 18 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QAnimationDriver)
+16 (int (*)(...))QAnimationDriver::metaObject
+24 (int (*)(...))QAnimationDriver::qt_metacast
+32 (int (*)(...))QAnimationDriver::qt_metacall
+40 (int (*)(...))QAnimationDriver::~QAnimationDriver
+48 (int (*)(...))QAnimationDriver::~QAnimationDriver
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QAnimationDriver::advance
+120 (int (*)(...))QAnimationDriver::elapsed
+128 (int (*)(...))QAnimationDriver::start
+136 (int (*)(...))QAnimationDriver::stop
+
+Class QAnimationDriver
+ size=16 align=8
+ base size=16 base align=8
+QAnimationDriver (0x0x7f527ac30d68) 0
+ vptr=((& QAnimationDriver::_ZTV16QAnimationDriver) + 16)
+ QObject (0x0x7f527ac7ce40) 0
+ primary-for QAnimationDriver (0x0x7f527ac30d68)
+
+Class QEventLoop::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QEventLoop::QPrivateSignal (0x0x7f527acc1120) 0 empty
+
+Vtable for QEventLoop
+QEventLoop::_ZTV10QEventLoop: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QEventLoop)
+16 (int (*)(...))QEventLoop::metaObject
+24 (int (*)(...))QEventLoop::qt_metacast
+32 (int (*)(...))QEventLoop::qt_metacall
+40 (int (*)(...))QEventLoop::~QEventLoop
+48 (int (*)(...))QEventLoop::~QEventLoop
+56 (int (*)(...))QEventLoop::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QEventLoop
+ size=16 align=8
+ base size=16 base align=8
+QEventLoop (0x0x7f527ac30dd0) 0
+ vptr=((& QEventLoop::_ZTV10QEventLoop) + 16)
+ QObject (0x0x7f527acc10c0) 0
+ primary-for QEventLoop (0x0x7f527ac30dd0)
+
+Class QEventLoopLocker
+ size=8 align=8
+ base size=8 base align=8
+QEventLoopLocker (0x0x7f527acc19c0) 0
+
+Class QAbstractEventDispatcher::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAbstractEventDispatcher::QPrivateSignal (0x0x7f527acc1a80) 0 empty
+
+Class QAbstractEventDispatcher::TimerInfo
+ size=12 align=4
+ base size=12 base align=4
+QAbstractEventDispatcher::TimerInfo (0x0x7f527acc1ae0) 0
+
+Vtable for QAbstractEventDispatcher
+QAbstractEventDispatcher::_ZTV24QAbstractEventDispatcher: 28 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI24QAbstractEventDispatcher)
+16 (int (*)(...))QAbstractEventDispatcher::metaObject
+24 (int (*)(...))QAbstractEventDispatcher::qt_metacast
+32 (int (*)(...))QAbstractEventDispatcher::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))__cxa_pure_virtual
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))__cxa_pure_virtual
+160 (int (*)(...))__cxa_pure_virtual
+168 (int (*)(...))__cxa_pure_virtual
+176 (int (*)(...))__cxa_pure_virtual
+184 (int (*)(...))__cxa_pure_virtual
+192 (int (*)(...))__cxa_pure_virtual
+200 (int (*)(...))__cxa_pure_virtual
+208 (int (*)(...))QAbstractEventDispatcher::startingUp
+216 (int (*)(...))QAbstractEventDispatcher::closingDown
+
+Class QAbstractEventDispatcher
+ size=16 align=8
+ base size=16 base align=8
+QAbstractEventDispatcher (0x0x7f527ac30f08) 0
+ vptr=((& QAbstractEventDispatcher::_ZTV24QAbstractEventDispatcher) + 16)
+ QObject (0x0x7f527acc1a20) 0
+ primary-for QAbstractEventDispatcher (0x0x7f527ac30f08)
+
+Class QMapNodeBase
+ size=24 align=8
+ base size=24 base align=8
+QMapNodeBase (0x0x7f527a932ae0) 0
+
+Class QMapDataBase
+ size=40 align=8
+ base size=40 base align=8
+QMapDataBase (0x0x7f527a960780) 0
+
+Class QHashData::Node
+ size=16 align=8
+ base size=16 base align=8
+QHashData::Node (0x0x7f527aa58300) 0
+
+Class QHashData
+ size=48 align=8
+ base size=44 base align=8
+QHashData (0x0x7f527aa582a0) 0
+
+Class QHashDummyValue
+ size=1 align=1
+ base size=0 base align=1
+QHashDummyValue (0x0x7f527aa585a0) 0 empty
+
+Class QVariant::PrivateShared
+ size=16 align=8
+ base size=12 base align=8
+QVariant::PrivateShared (0x0x7f527a787060) 0
+
+Class QVariant::Private::Data
+ size=8 align=8
+ base size=8 base align=8
+QVariant::Private::Data (0x0x7f527a787120) 0
+
+Class QVariant::Private
+ size=16 align=8
+ base size=12 base align=8
+QVariant::Private (0x0x7f527a7870c0) 0
+
+Class QVariant::Handler
+ size=72 align=8
+ base size=72 base align=8
+QVariant::Handler (0x0x7f527a787180) 0
+
+Class QVariant
+ size=16 align=8
+ base size=16 base align=8
+QVariant (0x0x7f527a787000) 0
+
+Class QVariantComparisonHelper
+ size=8 align=8
+ base size=8 base align=8
+QVariantComparisonHelper (0x0x7f527a8eb420) 0
+
+Class QSequentialIterable::const_iterator
+ size=112 align=8
+ base size=112 base align=8
+QSequentialIterable::const_iterator (0x0x7f527a530a80) 0
+
+Class QSequentialIterable
+ size=104 align=8
+ base size=104 base align=8
+QSequentialIterable (0x0x7f527a530a20) 0
+
+Class QAssociativeIterable::const_iterator
+ size=120 align=8
+ base size=120 base align=8
+QAssociativeIterable::const_iterator (0x0x7f527a530ba0) 0
+
+Class QAssociativeIterable
+ size=112 align=8
+ base size=112 base align=8
+QAssociativeIterable (0x0x7f527a530b40) 0
+
+Class QModelIndex
+ size=24 align=8
+ base size=24 base align=8
+QModelIndex (0x0x7f527a611f00) 0
+
+Class QPersistentModelIndex
+ size=8 align=8
+ base size=8 base align=8
+QPersistentModelIndex (0x0x7f527a688b40) 0
+
+Class QAbstractItemModel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAbstractItemModel::QPrivateSignal (0x0x7f527a354960) 0 empty
+
+Vtable for QAbstractItemModel
+QAbstractItemModel::_ZTV18QAbstractItemModel: 48 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QAbstractItemModel)
+16 (int (*)(...))QAbstractItemModel::metaObject
+24 (int (*)(...))QAbstractItemModel::qt_metacast
+32 (int (*)(...))QAbstractItemModel::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))QAbstractItemModel::sibling
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))QAbstractItemModel::hasChildren
+160 (int (*)(...))__cxa_pure_virtual
+168 (int (*)(...))QAbstractItemModel::setData
+176 (int (*)(...))QAbstractItemModel::headerData
+184 (int (*)(...))QAbstractItemModel::setHeaderData
+192 (int (*)(...))QAbstractItemModel::itemData
+200 (int (*)(...))QAbstractItemModel::setItemData
+208 (int (*)(...))QAbstractItemModel::mimeTypes
+216 (int (*)(...))QAbstractItemModel::mimeData
+224 (int (*)(...))QAbstractItemModel::canDropMimeData
+232 (int (*)(...))QAbstractItemModel::dropMimeData
+240 (int (*)(...))QAbstractItemModel::supportedDropActions
+248 (int (*)(...))QAbstractItemModel::supportedDragActions
+256 (int (*)(...))QAbstractItemModel::insertRows
+264 (int (*)(...))QAbstractItemModel::insertColumns
+272 (int (*)(...))QAbstractItemModel::removeRows
+280 (int (*)(...))QAbstractItemModel::removeColumns
+288 (int (*)(...))QAbstractItemModel::moveRows
+296 (int (*)(...))QAbstractItemModel::moveColumns
+304 (int (*)(...))QAbstractItemModel::fetchMore
+312 (int (*)(...))QAbstractItemModel::canFetchMore
+320 (int (*)(...))QAbstractItemModel::flags
+328 (int (*)(...))QAbstractItemModel::sort
+336 (int (*)(...))QAbstractItemModel::buddy
+344 (int (*)(...))QAbstractItemModel::match
+352 (int (*)(...))QAbstractItemModel::span
+360 (int (*)(...))QAbstractItemModel::roleNames
+368 (int (*)(...))QAbstractItemModel::submit
+376 (int (*)(...))QAbstractItemModel::revert
+
+Class QAbstractItemModel
+ size=16 align=8
+ base size=16 base align=8
+QAbstractItemModel (0x0x7f527a3621a0) 0
+ vptr=((& QAbstractItemModel::_ZTV18QAbstractItemModel) + 16)
+ QObject (0x0x7f527a354900) 0
+ primary-for QAbstractItemModel (0x0x7f527a3621a0)
+
+Class QAbstractTableModel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAbstractTableModel::QPrivateSignal (0x0x7f527a3b9d20) 0 empty
+
+Vtable for QAbstractTableModel
+QAbstractTableModel::_ZTV19QAbstractTableModel: 48 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QAbstractTableModel)
+16 (int (*)(...))QAbstractTableModel::metaObject
+24 (int (*)(...))QAbstractTableModel::qt_metacast
+32 (int (*)(...))QAbstractTableModel::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QAbstractTableModel::index
+120 (int (*)(...))QAbstractTableModel::parent
+128 (int (*)(...))QAbstractTableModel::sibling
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))QAbstractTableModel::hasChildren
+160 (int (*)(...))__cxa_pure_virtual
+168 (int (*)(...))QAbstractItemModel::setData
+176 (int (*)(...))QAbstractItemModel::headerData
+184 (int (*)(...))QAbstractItemModel::setHeaderData
+192 (int (*)(...))QAbstractItemModel::itemData
+200 (int (*)(...))QAbstractItemModel::setItemData
+208 (int (*)(...))QAbstractItemModel::mimeTypes
+216 (int (*)(...))QAbstractItemModel::mimeData
+224 (int (*)(...))QAbstractItemModel::canDropMimeData
+232 (int (*)(...))QAbstractTableModel::dropMimeData
+240 (int (*)(...))QAbstractItemModel::supportedDropActions
+248 (int (*)(...))QAbstractItemModel::supportedDragActions
+256 (int (*)(...))QAbstractItemModel::insertRows
+264 (int (*)(...))QAbstractItemModel::insertColumns
+272 (int (*)(...))QAbstractItemModel::removeRows
+280 (int (*)(...))QAbstractItemModel::removeColumns
+288 (int (*)(...))QAbstractItemModel::moveRows
+296 (int (*)(...))QAbstractItemModel::moveColumns
+304 (int (*)(...))QAbstractItemModel::fetchMore
+312 (int (*)(...))QAbstractItemModel::canFetchMore
+320 (int (*)(...))QAbstractTableModel::flags
+328 (int (*)(...))QAbstractItemModel::sort
+336 (int (*)(...))QAbstractItemModel::buddy
+344 (int (*)(...))QAbstractItemModel::match
+352 (int (*)(...))QAbstractItemModel::span
+360 (int (*)(...))QAbstractItemModel::roleNames
+368 (int (*)(...))QAbstractItemModel::submit
+376 (int (*)(...))QAbstractItemModel::revert
+
+Class QAbstractTableModel
+ size=16 align=8
+ base size=16 base align=8
+QAbstractTableModel (0x0x7f527a3627b8) 0
+ vptr=((& QAbstractTableModel::_ZTV19QAbstractTableModel) + 16)
+ QAbstractItemModel (0x0x7f527a362820) 0
+ primary-for QAbstractTableModel (0x0x7f527a3627b8)
+ QObject (0x0x7f527a3b9cc0) 0
+ primary-for QAbstractItemModel (0x0x7f527a362820)
+
+Class QAbstractListModel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAbstractListModel::QPrivateSignal (0x0x7f527a3b9ea0) 0 empty
+
+Vtable for QAbstractListModel
+QAbstractListModel::_ZTV18QAbstractListModel: 48 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QAbstractListModel)
+16 (int (*)(...))QAbstractListModel::metaObject
+24 (int (*)(...))QAbstractListModel::qt_metacast
+32 (int (*)(...))QAbstractListModel::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QAbstractListModel::index
+120 (int (*)(...))QAbstractListModel::parent
+128 (int (*)(...))QAbstractListModel::sibling
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))QAbstractListModel::columnCount
+152 (int (*)(...))QAbstractListModel::hasChildren
+160 (int (*)(...))__cxa_pure_virtual
+168 (int (*)(...))QAbstractItemModel::setData
+176 (int (*)(...))QAbstractItemModel::headerData
+184 (int (*)(...))QAbstractItemModel::setHeaderData
+192 (int (*)(...))QAbstractItemModel::itemData
+200 (int (*)(...))QAbstractItemModel::setItemData
+208 (int (*)(...))QAbstractItemModel::mimeTypes
+216 (int (*)(...))QAbstractItemModel::mimeData
+224 (int (*)(...))QAbstractItemModel::canDropMimeData
+232 (int (*)(...))QAbstractListModel::dropMimeData
+240 (int (*)(...))QAbstractItemModel::supportedDropActions
+248 (int (*)(...))QAbstractItemModel::supportedDragActions
+256 (int (*)(...))QAbstractItemModel::insertRows
+264 (int (*)(...))QAbstractItemModel::insertColumns
+272 (int (*)(...))QAbstractItemModel::removeRows
+280 (int (*)(...))QAbstractItemModel::removeColumns
+288 (int (*)(...))QAbstractItemModel::moveRows
+296 (int (*)(...))QAbstractItemModel::moveColumns
+304 (int (*)(...))QAbstractItemModel::fetchMore
+312 (int (*)(...))QAbstractItemModel::canFetchMore
+320 (int (*)(...))QAbstractListModel::flags
+328 (int (*)(...))QAbstractItemModel::sort
+336 (int (*)(...))QAbstractItemModel::buddy
+344 (int (*)(...))QAbstractItemModel::match
+352 (int (*)(...))QAbstractItemModel::span
+360 (int (*)(...))QAbstractItemModel::roleNames
+368 (int (*)(...))QAbstractItemModel::submit
+376 (int (*)(...))QAbstractItemModel::revert
+
+Class QAbstractListModel
+ size=16 align=8
+ base size=16 base align=8
+QAbstractListModel (0x0x7f527a362888) 0
+ vptr=((& QAbstractListModel::_ZTV18QAbstractListModel) + 16)
+ QAbstractItemModel (0x0x7f527a3628f0) 0
+ primary-for QAbstractListModel (0x0x7f527a362888)
+ QObject (0x0x7f527a3b9e40) 0
+ primary-for QAbstractItemModel (0x0x7f527a3628f0)
+
+Vtable for QAbstractNativeEventFilter
+QAbstractNativeEventFilter::_ZTV26QAbstractNativeEventFilter: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI26QAbstractNativeEventFilter)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+
+Class QAbstractNativeEventFilter
+ size=16 align=8
+ base size=16 base align=8
+QAbstractNativeEventFilter (0x0x7f527a454600) 0
+ vptr=((& QAbstractNativeEventFilter::_ZTV26QAbstractNativeEventFilter) + 16)
+
+Class QAbstractProxyModel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAbstractProxyModel::QPrivateSignal (0x0x7f527a4546c0) 0 empty
+
+Vtable for QAbstractProxyModel
+QAbstractProxyModel::_ZTV19QAbstractProxyModel: 53 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QAbstractProxyModel)
+16 (int (*)(...))QAbstractProxyModel::metaObject
+24 (int (*)(...))QAbstractProxyModel::qt_metacast
+32 (int (*)(...))QAbstractProxyModel::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))QAbstractProxyModel::sibling
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))QAbstractProxyModel::hasChildren
+160 (int (*)(...))QAbstractProxyModel::data
+168 (int (*)(...))QAbstractProxyModel::setData
+176 (int (*)(...))QAbstractProxyModel::headerData
+184 (int (*)(...))QAbstractProxyModel::setHeaderData
+192 (int (*)(...))QAbstractProxyModel::itemData
+200 (int (*)(...))QAbstractProxyModel::setItemData
+208 (int (*)(...))QAbstractProxyModel::mimeTypes
+216 (int (*)(...))QAbstractProxyModel::mimeData
+224 (int (*)(...))QAbstractProxyModel::canDropMimeData
+232 (int (*)(...))QAbstractProxyModel::dropMimeData
+240 (int (*)(...))QAbstractProxyModel::supportedDropActions
+248 (int (*)(...))QAbstractProxyModel::supportedDragActions
+256 (int (*)(...))QAbstractItemModel::insertRows
+264 (int (*)(...))QAbstractItemModel::insertColumns
+272 (int (*)(...))QAbstractItemModel::removeRows
+280 (int (*)(...))QAbstractItemModel::removeColumns
+288 (int (*)(...))QAbstractItemModel::moveRows
+296 (int (*)(...))QAbstractItemModel::moveColumns
+304 (int (*)(...))QAbstractProxyModel::fetchMore
+312 (int (*)(...))QAbstractProxyModel::canFetchMore
+320 (int (*)(...))QAbstractProxyModel::flags
+328 (int (*)(...))QAbstractProxyModel::sort
+336 (int (*)(...))QAbstractProxyModel::buddy
+344 (int (*)(...))QAbstractItemModel::match
+352 (int (*)(...))QAbstractProxyModel::span
+360 (int (*)(...))QAbstractItemModel::roleNames
+368 (int (*)(...))QAbstractProxyModel::submit
+376 (int (*)(...))QAbstractProxyModel::revert
+384 (int (*)(...))QAbstractProxyModel::setSourceModel
+392 (int (*)(...))__cxa_pure_virtual
+400 (int (*)(...))__cxa_pure_virtual
+408 (int (*)(...))QAbstractProxyModel::mapSelectionToSource
+416 (int (*)(...))QAbstractProxyModel::mapSelectionFromSource
+
+Class QAbstractProxyModel
+ size=16 align=8
+ base size=16 base align=8
+QAbstractProxyModel (0x0x7f527a3629c0) 0
+ vptr=((& QAbstractProxyModel::_ZTV19QAbstractProxyModel) + 16)
+ QAbstractItemModel (0x0x7f527a362a28) 0
+ primary-for QAbstractProxyModel (0x0x7f527a3629c0)
+ QObject (0x0x7f527a454660) 0
+ primary-for QAbstractItemModel (0x0x7f527a362a28)
+
+Class QAbstractState::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAbstractState::QPrivateSignal (0x0x7f527a454900) 0 empty
+
+Vtable for QAbstractState
+QAbstractState::_ZTV14QAbstractState: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QAbstractState)
+16 (int (*)(...))QAbstractState::metaObject
+24 (int (*)(...))QAbstractState::qt_metacast
+32 (int (*)(...))QAbstractState::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QAbstractState::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+
+Class QAbstractState
+ size=16 align=8
+ base size=16 base align=8
+QAbstractState (0x0x7f527a362a90) 0
+ vptr=((& QAbstractState::_ZTV14QAbstractState) + 16)
+ QObject (0x0x7f527a4548a0) 0
+ primary-for QAbstractState (0x0x7f527a362a90)
+
+Class QAbstractTransition::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAbstractTransition::QPrivateSignal (0x0x7f527a454b40) 0 empty
+
+Vtable for QAbstractTransition
+QAbstractTransition::_ZTV19QAbstractTransition: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QAbstractTransition)
+16 (int (*)(...))QAbstractTransition::metaObject
+24 (int (*)(...))QAbstractTransition::qt_metacast
+32 (int (*)(...))QAbstractTransition::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QAbstractTransition::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+
+Class QAbstractTransition
+ size=16 align=8
+ base size=16 base align=8
+QAbstractTransition (0x0x7f527a362af8) 0
+ vptr=((& QAbstractTransition::_ZTV19QAbstractTransition) + 16)
+ QObject (0x0x7f527a454ae0) 0
+ primary-for QAbstractTransition (0x0x7f527a362af8)
+
+Class QAnimationGroup::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAnimationGroup::QPrivateSignal (0x0x7f527a454e40) 0 empty
+
+Vtable for QAnimationGroup
+QAnimationGroup::_ZTV15QAnimationGroup: 18 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QAnimationGroup)
+16 (int (*)(...))QAnimationGroup::metaObject
+24 (int (*)(...))QAnimationGroup::qt_metacast
+32 (int (*)(...))QAnimationGroup::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QAnimationGroup::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))QAbstractAnimation::updateState
+136 (int (*)(...))QAbstractAnimation::updateDirection
+
+Class QAnimationGroup
+ size=16 align=8
+ base size=16 base align=8
+QAnimationGroup (0x0x7f527a362b60) 0
+ vptr=((& QAnimationGroup::_ZTV15QAnimationGroup) + 16)
+ QAbstractAnimation (0x0x7f527a362bc8) 0
+ primary-for QAnimationGroup (0x0x7f527a362b60)
+ QObject (0x0x7f527a454de0) 0
+ primary-for QAbstractAnimation (0x0x7f527a362bc8)
+
+Class QBasicTimer
+ size=4 align=4
+ base size=4 base align=4
+QBasicTimer (0x0x7f527a524180) 0
+
+Class QBitArray
+ size=8 align=8
+ base size=8 base align=8
+QBitArray (0x0x7f527a1a4ae0) 0
+
+Class QBitRef
+ size=16 align=8
+ base size=12 base align=8
+QBitRef (0x0x7f527a1cfae0) 0
+
+Class QIODevice::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QIODevice::QPrivateSignal (0x0x7f527a225d80) 0 empty
+
+Vtable for QIODevice
+QIODevice::_ZTV9QIODevice: 30 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QIODevice)
+16 (int (*)(...))QIODevice::metaObject
+24 (int (*)(...))QIODevice::qt_metacast
+32 (int (*)(...))QIODevice::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QIODevice::isSequential
+120 (int (*)(...))QIODevice::open
+128 (int (*)(...))QIODevice::close
+136 (int (*)(...))QIODevice::pos
+144 (int (*)(...))QIODevice::size
+152 (int (*)(...))QIODevice::seek
+160 (int (*)(...))QIODevice::atEnd
+168 (int (*)(...))QIODevice::reset
+176 (int (*)(...))QIODevice::bytesAvailable
+184 (int (*)(...))QIODevice::bytesToWrite
+192 (int (*)(...))QIODevice::canReadLine
+200 (int (*)(...))QIODevice::waitForReadyRead
+208 (int (*)(...))QIODevice::waitForBytesWritten
+216 (int (*)(...))__cxa_pure_virtual
+224 (int (*)(...))QIODevice::readLineData
+232 (int (*)(...))__cxa_pure_virtual
+
+Class QIODevice
+ size=16 align=8
+ base size=16 base align=8
+QIODevice (0x0x7f527a2354e0) 0
+ vptr=((& QIODevice::_ZTV9QIODevice) + 16)
+ QObject (0x0x7f527a225d20) 0
+ primary-for QIODevice (0x0x7f527a2354e0)
+
+Class QBuffer::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QBuffer::QPrivateSignal (0x0x7f527a25c720) 0 empty
+
+Vtable for QBuffer
+QBuffer::_ZTV7QBuffer: 30 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI7QBuffer)
+16 (int (*)(...))QBuffer::metaObject
+24 (int (*)(...))QBuffer::qt_metacast
+32 (int (*)(...))QBuffer::qt_metacall
+40 (int (*)(...))QBuffer::~QBuffer
+48 (int (*)(...))QBuffer::~QBuffer
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QBuffer::connectNotify
+104 (int (*)(...))QBuffer::disconnectNotify
+112 (int (*)(...))QIODevice::isSequential
+120 (int (*)(...))QBuffer::open
+128 (int (*)(...))QBuffer::close
+136 (int (*)(...))QBuffer::pos
+144 (int (*)(...))QBuffer::size
+152 (int (*)(...))QBuffer::seek
+160 (int (*)(...))QBuffer::atEnd
+168 (int (*)(...))QIODevice::reset
+176 (int (*)(...))QIODevice::bytesAvailable
+184 (int (*)(...))QIODevice::bytesToWrite
+192 (int (*)(...))QBuffer::canReadLine
+200 (int (*)(...))QIODevice::waitForReadyRead
+208 (int (*)(...))QIODevice::waitForBytesWritten
+216 (int (*)(...))QBuffer::readData
+224 (int (*)(...))QIODevice::readLineData
+232 (int (*)(...))QBuffer::writeData
+
+Class QBuffer
+ size=16 align=8
+ base size=16 base align=8
+QBuffer (0x0x7f527a235618) 0
+ vptr=((& QBuffer::_ZTV7QBuffer) + 16)
+ QIODevice (0x0x7f527a235680) 0
+ primary-for QBuffer (0x0x7f527a235618)
+ QObject (0x0x7f527a25c6c0) 0
+ primary-for QIODevice (0x0x7f527a235680)
+
+Class QByteArrayMatcher::Data
+ size=272 align=8
+ base size=272 base align=8
+QByteArrayMatcher::Data (0x0x7f527a25c9c0) 0
+
+Class QByteArrayMatcher
+ size=1040 align=8
+ base size=1040 base align=8
+QByteArrayMatcher (0x0x7f527a25c960) 0
+
+Class QStaticByteArrayMatcherBase::Skiptable
+ size=256 align=1
+ base size=256 base align=1
+QStaticByteArrayMatcherBase::Skiptable (0x0x7f527a25cb40) 0
+
+Class QStaticByteArrayMatcherBase
+ size=256 align=16
+ base size=256 base align=16
+QStaticByteArrayMatcherBase (0x0x7f527a25cae0) 0
+
+Class QSharedData
+ size=4 align=4
+ base size=4 base align=4
+QSharedData (0x0x7f527a2b8a20) 0
+
+Class QLocale
+ size=8 align=8
+ base size=8 base align=8
+QLocale (0x0x7f527a303900) 0
+
+Class QCalendar::YearMonthDay
+ size=12 align=4
+ base size=12 base align=4
+QCalendar::YearMonthDay (0x0x7f527a05fde0) 0
+
+Class QCalendar
+ size=8 align=8
+ base size=8 base align=8
+QCalendar (0x0x7f527a05fd80) 0
+
+Class QDate
+ size=8 align=8
+ base size=8 base align=8
+QDate (0x0x7f527a0a9600) 0
+
+Class QTime
+ size=4 align=4
+ base size=4 base align=4
+QTime (0x0x7f527a0ffea0) 0
+
+Class QDateTime::ShortData
+ size=8 align=8
+ base size=8 base align=8
+QDateTime::ShortData (0x0x7f5279d6cb40) 0
+
+Class QDateTime::Data
+ size=8 align=8
+ base size=8 base align=8
+QDateTime::Data (0x0x7f5279d6cba0) 0
+
+Class QDateTime
+ size=8 align=8
+ base size=8 base align=8
+QDateTime (0x0x7f5279d6cae0) 0
+
+Vtable for QTextStream
+QTextStream::_ZTV11QTextStream: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QTextStream)
+16 (int (*)(...))QTextStream::~QTextStream
+24 (int (*)(...))QTextStream::~QTextStream
+
+Class QTextStream
+ size=16 align=8
+ base size=16 base align=8
+QTextStream (0x0x7f5279e5d2a0) 0
+ vptr=((& QTextStream::_ZTV11QTextStream) + 16)
+
+Class QTextStreamManipulator
+ size=40 align=8
+ base size=38 base align=8
+QTextStreamManipulator (0x0x7f5279e5db40) 0
+
+Class QContiguousCacheData
+ size=24 align=4
+ base size=24 base align=4
+QContiguousCacheData (0x0x7f5279b377e0) 0
+
+Vtable for __gnu_cxx::__concurrence_lock_error
+__gnu_cxx::__concurrence_lock_error::_ZTVN9__gnu_cxx24__concurrence_lock_errorE: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTIN9__gnu_cxx24__concurrence_lock_errorE)
+16 (int (*)(...))__gnu_cxx::__concurrence_lock_error::~__concurrence_lock_error
+24 (int (*)(...))__gnu_cxx::__concurrence_lock_error::~__concurrence_lock_error
+32 (int (*)(...))__gnu_cxx::__concurrence_lock_error::what
+
+Class __gnu_cxx::__concurrence_lock_error
+ size=8 align=8
+ base size=8 base align=8
+__gnu_cxx::__concurrence_lock_error (0x0x7f5279e59680) 0 nearly-empty
+ vptr=((& __gnu_cxx::__concurrence_lock_error::_ZTVN9__gnu_cxx24__concurrence_lock_errorE) + 16)
+ std::exception (0x0x7f5279b88660) 0 nearly-empty
+ primary-for __gnu_cxx::__concurrence_lock_error (0x0x7f5279e59680)
+
+Vtable for __gnu_cxx::__concurrence_unlock_error
+__gnu_cxx::__concurrence_unlock_error::_ZTVN9__gnu_cxx26__concurrence_unlock_errorE: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTIN9__gnu_cxx26__concurrence_unlock_errorE)
+16 (int (*)(...))__gnu_cxx::__concurrence_unlock_error::~__concurrence_unlock_error
+24 (int (*)(...))__gnu_cxx::__concurrence_unlock_error::~__concurrence_unlock_error
+32 (int (*)(...))__gnu_cxx::__concurrence_unlock_error::what
+
+Class __gnu_cxx::__concurrence_unlock_error
+ size=8 align=8
+ base size=8 base align=8
+__gnu_cxx::__concurrence_unlock_error (0x0x7f5279e596e8) 0 nearly-empty
+ vptr=((& __gnu_cxx::__concurrence_unlock_error::_ZTVN9__gnu_cxx26__concurrence_unlock_errorE) + 16)
+ std::exception (0x0x7f5279b88780) 0 nearly-empty
+ primary-for __gnu_cxx::__concurrence_unlock_error (0x0x7f5279e596e8)
+
+Vtable for __gnu_cxx::__concurrence_broadcast_error
+__gnu_cxx::__concurrence_broadcast_error::_ZTVN9__gnu_cxx29__concurrence_broadcast_errorE: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTIN9__gnu_cxx29__concurrence_broadcast_errorE)
+16 (int (*)(...))__gnu_cxx::__concurrence_broadcast_error::~__concurrence_broadcast_error
+24 (int (*)(...))__gnu_cxx::__concurrence_broadcast_error::~__concurrence_broadcast_error
+32 (int (*)(...))__gnu_cxx::__concurrence_broadcast_error::what
+
+Class __gnu_cxx::__concurrence_broadcast_error
+ size=8 align=8
+ base size=8 base align=8
+__gnu_cxx::__concurrence_broadcast_error (0x0x7f5279e59750) 0 nearly-empty
+ vptr=((& __gnu_cxx::__concurrence_broadcast_error::_ZTVN9__gnu_cxx29__concurrence_broadcast_errorE) + 16)
+ std::exception (0x0x7f5279b888a0) 0 nearly-empty
+ primary-for __gnu_cxx::__concurrence_broadcast_error (0x0x7f5279e59750)
+
+Vtable for __gnu_cxx::__concurrence_wait_error
+__gnu_cxx::__concurrence_wait_error::_ZTVN9__gnu_cxx24__concurrence_wait_errorE: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTIN9__gnu_cxx24__concurrence_wait_errorE)
+16 (int (*)(...))__gnu_cxx::__concurrence_wait_error::~__concurrence_wait_error
+24 (int (*)(...))__gnu_cxx::__concurrence_wait_error::~__concurrence_wait_error
+32 (int (*)(...))__gnu_cxx::__concurrence_wait_error::what
+
+Class __gnu_cxx::__concurrence_wait_error
+ size=8 align=8
+ base size=8 base align=8
+__gnu_cxx::__concurrence_wait_error (0x0x7f5279e59820) 0 nearly-empty
+ vptr=((& __gnu_cxx::__concurrence_wait_error::_ZTVN9__gnu_cxx24__concurrence_wait_errorE) + 16)
+ std::exception (0x0x7f5279b889c0) 0 nearly-empty
+ primary-for __gnu_cxx::__concurrence_wait_error (0x0x7f5279e59820)
+
+Class __gnu_cxx::__mutex
+ size=40 align=8
+ base size=40 base align=8
+__gnu_cxx::__mutex (0x0x7f5279bafa20) 0
+
+Class __gnu_cxx::__recursive_mutex
+ size=40 align=8
+ base size=40 base align=8
+__gnu_cxx::__recursive_mutex (0x0x7f5279bafd20) 0
+
+Class __gnu_cxx::__scoped_lock
+ size=8 align=8
+ base size=8 base align=8
+__gnu_cxx::__scoped_lock (0x0x7f5279bd2060) 0
+
+Class __gnu_cxx::__cond
+ size=48 align=8
+ base size=48 base align=8
+__gnu_cxx::__cond (0x0x7f5279bd23c0) 0
+
+Vtable for std::bad_weak_ptr
+std::bad_weak_ptr::_ZTVSt12bad_weak_ptr: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt12bad_weak_ptr)
+16 (int (*)(...))std::bad_weak_ptr::~bad_weak_ptr
+24 (int (*)(...))std::bad_weak_ptr::~bad_weak_ptr
+32 (int (*)(...))std::bad_weak_ptr::what
+
+Class std::bad_weak_ptr
+ size=8 align=8
+ base size=8 base align=8
+std::bad_weak_ptr (0x0x7f5279e59888) 0 nearly-empty
+ vptr=((& std::bad_weak_ptr::_ZTVSt12bad_weak_ptr) + 16)
+ std::exception (0x0x7f5279c4b5a0) 0 nearly-empty
+ primary-for std::bad_weak_ptr (0x0x7f5279e59888)
+
+Class std::_Sp_make_shared_tag
+ size=1 align=1
+ base size=0 base align=1
+std::_Sp_make_shared_tag (0x0x7f5279cb0540) 0 empty
+
+Class std::__sp_array_delete
+ size=1 align=1
+ base size=0 base align=1
+std::__sp_array_delete (0x0x7f5279cb0960) 0 empty
+
+Class std::_Sp_locker
+ size=2 align=1
+ base size=2 base align=1
+std::_Sp_locker (0x0x7f52799f77e0) 0
+
+Class QtSharedPointer::NormalDeleter
+ size=1 align=1
+ base size=0 base align=1
+QtSharedPointer::NormalDeleter (0x0x7f5279a25cc0) 0 empty
+
+Class QtSharedPointer::ExternalRefCountData
+ size=16 align=8
+ base size=16 base align=8
+QtSharedPointer::ExternalRefCountData (0x0x7f5279a25e40) 0
+
+Class QtPrivate::EnableInternalData
+ size=1 align=1
+ base size=0 base align=1
+QtPrivate::EnableInternalData (0x0x7f5279ab4780) 0 empty
+
+Class QDebug::Stream
+ size=80 align=8
+ base size=76 base align=8
+QDebug::Stream (0x0x7f5279ad9e40) 0
+
+Class QDebug
+ size=8 align=8
+ base size=8 base align=8
+QDebug (0x0x7f5279ad9de0) 0
+
+Class QDebugStateSaver
+ size=8 align=8
+ base size=8 base align=8
+QDebugStateSaver (0x0x7f5279876780) 0
+
+Class QNoDebug
+ size=1 align=1
+ base size=0 base align=1
+QNoDebug (0x0x7f5279876840) 0 empty
+
+Class QCborError
+ size=4 align=4
+ base size=4 base align=4
+QCborError (0x0x7f52798f5a80) 0
+
+Class QRegularExpression
+ size=8 align=8
+ base size=8 base align=8
+QRegularExpression (0x0x7f5279927240) 0
+
+Class QRegularExpressionMatch
+ size=8 align=8
+ base size=8 base align=8
+QRegularExpressionMatch (0x0x7f52795da120) 0
+
+Class QRegularExpressionMatchIterator
+ size=8 align=8
+ base size=8 base align=8
+QRegularExpressionMatchIterator (0x0x7f5279617ea0) 0
+
+Class QUrl
+ size=8 align=8
+ base size=8 base align=8
+QUrl (0x0x7f5279699900) 0
+
+Class QUuid
+ size=16 align=4
+ base size=16 base align=4
+QUuid (0x0x7f52793e18a0) 0
+
+Class QCborParserError
+ size=16 align=8
+ base size=12 base align=8
+QCborParserError (0x0x7f5279469420) 0
+
+Class QCborValue
+ size=24 align=8
+ base size=20 base align=8
+QCborValue (0x0x7f52794694e0) 0
+
+Class QCborValueRef
+ size=16 align=8
+ base size=16 base align=8
+QCborValueRef (0x0x7f52792a47e0) 0
+
+Class QCborArray::Iterator
+ size=16 align=8
+ base size=16 base align=8
+QCborArray::Iterator (0x0x7f5278f3b180) 0
+
+Class QCborArray::ConstIterator
+ size=16 align=8
+ base size=16 base align=8
+QCborArray::ConstIterator (0x0x7f5278f3b1e0) 0
+
+Class QCborArray
+ size=8 align=8
+ base size=8 base align=8
+QCborArray (0x0x7f5278f3b120) 0
+
+Class QCborMap::Iterator
+ size=16 align=8
+ base size=16 base align=8
+QCborMap::Iterator (0x0x7f5279096d80) 0
+
+Class QCborMap::ConstIterator
+ size=16 align=8
+ base size=16 base align=8
+QCborMap::ConstIterator (0x0x7f5279096de0) 0
+
+Class QCborMap
+ size=8 align=8
+ base size=8 base align=8
+QCborMap (0x0x7f5279096d20) 0
+
+Class qfloat16::Wrap
+ size=2 align=2
+ base size=2 base align=2
+qfloat16::Wrap (0x0x7f5278eb75a0) 0
+
+Class qfloat16
+ size=2 align=2
+ base size=2 base align=2
+qfloat16 (0x0x7f5278eb7540) 0
+
+Class QCborStreamReader
+ size=24 align=8
+ base size=20 base align=8
+QCborStreamReader (0x0x7f5278ba8360) 0
+
+Class QCborStreamWriter
+ size=8 align=8
+ base size=8 base align=8
+QCborStreamWriter (0x0x7f5278c2d900) 0
+
+Class QCollatorSortKey
+ size=8 align=8
+ base size=8 base align=8
+QCollatorSortKey (0x0x7f5278c571e0) 0
+
+Class QCollator
+ size=8 align=8
+ base size=8 base align=8
+QCollator (0x0x7f5278c573c0) 0
+
+Class QCommandLineOption
+ size=8 align=8
+ base size=8 base align=8
+QCommandLineOption (0x0x7f52789569c0) 0
+
+Vtable for QEvent
+QEvent::_ZTV6QEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI6QEvent)
+16 (int (*)(...))QEvent::~QEvent
+24 (int (*)(...))QEvent::~QEvent
+
+Class QEvent
+ size=24 align=8
+ base size=20 base align=8
+QEvent (0x0x7f5278a1df00) 0
+ vptr=((& QEvent::_ZTV6QEvent) + 16)
+
+Vtable for QTimerEvent
+QTimerEvent::_ZTV11QTimerEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QTimerEvent)
+16 (int (*)(...))QTimerEvent::~QTimerEvent
+24 (int (*)(...))QTimerEvent::~QTimerEvent
+
+Class QTimerEvent
+ size=24 align=8
+ base size=24 base align=8
+QTimerEvent (0x0x7f5278a1f750) 0
+ vptr=((& QTimerEvent::_ZTV11QTimerEvent) + 16)
+ QEvent (0x0x7f5278a60300) 0
+ primary-for QTimerEvent (0x0x7f5278a1f750)
+
+Vtable for QChildEvent
+QChildEvent::_ZTV11QChildEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QChildEvent)
+16 (int (*)(...))QChildEvent::~QChildEvent
+24 (int (*)(...))QChildEvent::~QChildEvent
+
+Class QChildEvent
+ size=32 align=8
+ base size=32 base align=8
+QChildEvent (0x0x7f5278a1f7b8) 0
+ vptr=((& QChildEvent::_ZTV11QChildEvent) + 16)
+ QEvent (0x0x7f5278a603c0) 0
+ primary-for QChildEvent (0x0x7f5278a1f7b8)
+
+Vtable for QDynamicPropertyChangeEvent
+QDynamicPropertyChangeEvent::_ZTV27QDynamicPropertyChangeEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI27QDynamicPropertyChangeEvent)
+16 (int (*)(...))QDynamicPropertyChangeEvent::~QDynamicPropertyChangeEvent
+24 (int (*)(...))QDynamicPropertyChangeEvent::~QDynamicPropertyChangeEvent
+
+Class QDynamicPropertyChangeEvent
+ size=32 align=8
+ base size=32 base align=8
+QDynamicPropertyChangeEvent (0x0x7f5278a1fd00) 0
+ vptr=((& QDynamicPropertyChangeEvent::_ZTV27QDynamicPropertyChangeEvent) + 16)
+ QEvent (0x0x7f5278a60a20) 0
+ primary-for QDynamicPropertyChangeEvent (0x0x7f5278a1fd00)
+
+Vtable for QDeferredDeleteEvent
+QDeferredDeleteEvent::_ZTV20QDeferredDeleteEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QDeferredDeleteEvent)
+16 (int (*)(...))QDeferredDeleteEvent::~QDeferredDeleteEvent
+24 (int (*)(...))QDeferredDeleteEvent::~QDeferredDeleteEvent
+
+Class QDeferredDeleteEvent
+ size=24 align=8
+ base size=24 base align=8
+QDeferredDeleteEvent (0x0x7f5278a1fd68) 0
+ vptr=((& QDeferredDeleteEvent::_ZTV20QDeferredDeleteEvent) + 16)
+ QEvent (0x0x7f5278a60ae0) 0
+ primary-for QDeferredDeleteEvent (0x0x7f5278a1fd68)
+
+Class QCoreApplication::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QCoreApplication::QPrivateSignal (0x0x7f5278a60c00) 0 empty
+
+Vtable for QCoreApplication
+QCoreApplication::_ZTV16QCoreApplication: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QCoreApplication)
+16 (int (*)(...))QCoreApplication::metaObject
+24 (int (*)(...))QCoreApplication::qt_metacast
+32 (int (*)(...))QCoreApplication::qt_metacall
+40 (int (*)(...))QCoreApplication::~QCoreApplication
+48 (int (*)(...))QCoreApplication::~QCoreApplication
+56 (int (*)(...))QCoreApplication::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QCoreApplication::notify
+120 (int (*)(...))QCoreApplication::compressEvent
+
+Class QCoreApplication
+ size=16 align=8
+ base size=16 base align=8
+QCoreApplication (0x0x7f5278a1fdd0) 0
+ vptr=((& QCoreApplication::_ZTV16QCoreApplication) + 16)
+ QObject (0x0x7f5278a60ba0) 0
+ primary-for QCoreApplication (0x0x7f5278a1fdd0)
+
+Class QCommandLineParser
+ size=8 align=8
+ base size=8 base align=8
+QCommandLineParser (0x0x7f5278a60e40) 0
+
+Class QConcatenateTablesProxyModel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QConcatenateTablesProxyModel::QPrivateSignal (0x0x7f5278ab7000) 0 empty
+
+Vtable for QConcatenateTablesProxyModel
+QConcatenateTablesProxyModel::_ZTV28QConcatenateTablesProxyModel: 48 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI28QConcatenateTablesProxyModel)
+16 (int (*)(...))QConcatenateTablesProxyModel::metaObject
+24 (int (*)(...))QConcatenateTablesProxyModel::qt_metacast
+32 (int (*)(...))QConcatenateTablesProxyModel::qt_metacall
+40 (int (*)(...))QConcatenateTablesProxyModel::~QConcatenateTablesProxyModel
+48 (int (*)(...))QConcatenateTablesProxyModel::~QConcatenateTablesProxyModel
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QConcatenateTablesProxyModel::index
+120 (int (*)(...))QConcatenateTablesProxyModel::parent
+128 (int (*)(...))QAbstractItemModel::sibling
+136 (int (*)(...))QConcatenateTablesProxyModel::rowCount
+144 (int (*)(...))QConcatenateTablesProxyModel::columnCount
+152 (int (*)(...))QAbstractItemModel::hasChildren
+160 (int (*)(...))QConcatenateTablesProxyModel::data
+168 (int (*)(...))QConcatenateTablesProxyModel::setData
+176 (int (*)(...))QConcatenateTablesProxyModel::headerData
+184 (int (*)(...))QAbstractItemModel::setHeaderData
+192 (int (*)(...))QConcatenateTablesProxyModel::itemData
+200 (int (*)(...))QConcatenateTablesProxyModel::setItemData
+208 (int (*)(...))QConcatenateTablesProxyModel::mimeTypes
+216 (int (*)(...))QConcatenateTablesProxyModel::mimeData
+224 (int (*)(...))QConcatenateTablesProxyModel::canDropMimeData
+232 (int (*)(...))QConcatenateTablesProxyModel::dropMimeData
+240 (int (*)(...))QAbstractItemModel::supportedDropActions
+248 (int (*)(...))QAbstractItemModel::supportedDragActions
+256 (int (*)(...))QAbstractItemModel::insertRows
+264 (int (*)(...))QAbstractItemModel::insertColumns
+272 (int (*)(...))QAbstractItemModel::removeRows
+280 (int (*)(...))QAbstractItemModel::removeColumns
+288 (int (*)(...))QAbstractItemModel::moveRows
+296 (int (*)(...))QAbstractItemModel::moveColumns
+304 (int (*)(...))QAbstractItemModel::fetchMore
+312 (int (*)(...))QAbstractItemModel::canFetchMore
+320 (int (*)(...))QConcatenateTablesProxyModel::flags
+328 (int (*)(...))QAbstractItemModel::sort
+336 (int (*)(...))QAbstractItemModel::buddy
+344 (int (*)(...))QAbstractItemModel::match
+352 (int (*)(...))QConcatenateTablesProxyModel::span
+360 (int (*)(...))QAbstractItemModel::roleNames
+368 (int (*)(...))QAbstractItemModel::submit
+376 (int (*)(...))QAbstractItemModel::revert
+
+Class QConcatenateTablesProxyModel
+ size=16 align=8
+ base size=16 base align=8
+QConcatenateTablesProxyModel (0x0x7f5278a1fe38) 0
+ vptr=((& QConcatenateTablesProxyModel::_ZTV28QConcatenateTablesProxyModel) + 16)
+ QAbstractItemModel (0x0x7f5278a1fea0) 0
+ primary-for QConcatenateTablesProxyModel (0x0x7f5278a1fe38)
+ QObject (0x0x7f5278a60f60) 0
+ primary-for QAbstractItemModel (0x0x7f5278a1fea0)
+
+Class QCryptographicHash
+ size=8 align=8
+ base size=8 base align=8
+QCryptographicHash (0x0x7f5278ab71e0) 0
+
+Class QDataStream
+ size=32 align=8
+ base size=32 base align=8
+QDataStream (0x0x7f5278ab7300) 0
+
+Class QtPrivate::StreamStateSaver
+ size=16 align=8
+ base size=12 base align=8
+QtPrivate::StreamStateSaver (0x0x7f5278ab7480) 0
+
+Class QElapsedTimer
+ size=16 align=8
+ base size=16 base align=8
+QElapsedTimer (0x0x7f5278b22cc0) 0
+
+Class QDeadlineTimer
+ size=16 align=8
+ base size=16 base align=8
+QDeadlineTimer (0x0x7f5278757420) 0
+
+Class QFileDevice::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QFileDevice::QPrivateSignal (0x0x7f5278897120) 0 empty
+
+Vtable for QFileDevice
+QFileDevice::_ZTV11QFileDevice: 34 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QFileDevice)
+16 (int (*)(...))QFileDevice::metaObject
+24 (int (*)(...))QFileDevice::qt_metacast
+32 (int (*)(...))QFileDevice::qt_metacall
+40 (int (*)(...))QFileDevice::~QFileDevice
+48 (int (*)(...))QFileDevice::~QFileDevice
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QFileDevice::isSequential
+120 (int (*)(...))QIODevice::open
+128 (int (*)(...))QFileDevice::close
+136 (int (*)(...))QFileDevice::pos
+144 (int (*)(...))QFileDevice::size
+152 (int (*)(...))QFileDevice::seek
+160 (int (*)(...))QFileDevice::atEnd
+168 (int (*)(...))QIODevice::reset
+176 (int (*)(...))QIODevice::bytesAvailable
+184 (int (*)(...))QIODevice::bytesToWrite
+192 (int (*)(...))QIODevice::canReadLine
+200 (int (*)(...))QIODevice::waitForReadyRead
+208 (int (*)(...))QIODevice::waitForBytesWritten
+216 (int (*)(...))QFileDevice::readData
+224 (int (*)(...))QFileDevice::readLineData
+232 (int (*)(...))QFileDevice::writeData
+240 (int (*)(...))QFileDevice::fileName
+248 (int (*)(...))QFileDevice::resize
+256 (int (*)(...))QFileDevice::permissions
+264 (int (*)(...))QFileDevice::setPermissions
+
+Class QFileDevice
+ size=16 align=8
+ base size=16 base align=8
+QFileDevice (0x0x7f527888d0d0) 0
+ vptr=((& QFileDevice::_ZTV11QFileDevice) + 16)
+ QIODevice (0x0x7f527888d138) 0
+ primary-for QFileDevice (0x0x7f527888d0d0)
+ QObject (0x0x7f52788970c0) 0
+ primary-for QIODevice (0x0x7f527888d138)
+
+Class QFile::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QFile::QPrivateSignal (0x0x7f5278897a20) 0 empty
+
+Vtable for QFile
+QFile::_ZTV5QFile: 34 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI5QFile)
+16 (int (*)(...))QFile::metaObject
+24 (int (*)(...))QFile::qt_metacast
+32 (int (*)(...))QFile::qt_metacall
+40 (int (*)(...))QFile::~QFile
+48 (int (*)(...))QFile::~QFile
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QFileDevice::isSequential
+120 (int (*)(...))QFile::open
+128 (int (*)(...))QFileDevice::close
+136 (int (*)(...))QFileDevice::pos
+144 (int (*)(...))QFile::size
+152 (int (*)(...))QFileDevice::seek
+160 (int (*)(...))QFileDevice::atEnd
+168 (int (*)(...))QIODevice::reset
+176 (int (*)(...))QIODevice::bytesAvailable
+184 (int (*)(...))QIODevice::bytesToWrite
+192 (int (*)(...))QIODevice::canReadLine
+200 (int (*)(...))QIODevice::waitForReadyRead
+208 (int (*)(...))QIODevice::waitForBytesWritten
+216 (int (*)(...))QFileDevice::readData
+224 (int (*)(...))QFileDevice::readLineData
+232 (int (*)(...))QFileDevice::writeData
+240 (int (*)(...))QFile::fileName
+248 (int (*)(...))QFile::resize
+256 (int (*)(...))QFile::permissions
+264 (int (*)(...))QFile::setPermissions
+
+Class QFile
+ size=16 align=8
+ base size=16 base align=8
+QFile (0x0x7f527888d270) 0
+ vptr=((& QFile::_ZTV5QFile) + 16)
+ QFileDevice (0x0x7f527888d2d8) 0
+ primary-for QFile (0x0x7f527888d270)
+ QIODevice (0x0x7f527888d340) 0
+ primary-for QFileDevice (0x0x7f527888d2d8)
+ QObject (0x0x7f52788979c0) 0
+ primary-for QIODevice (0x0x7f527888d340)
+
+Class QFileInfo
+ size=8 align=8
+ base size=8 base align=8
+QFileInfo (0x0x7f527890e0c0) 0
+
+Class QDir
+ size=8 align=8
+ base size=8 base align=8
+QDir (0x0x7f52785b8f60) 0
+
+Class QDirIterator
+ size=8 align=8
+ base size=8 base align=8
+QDirIterator (0x0x7f52786d5f60) 0
+
+Class QEasingCurve
+ size=8 align=8
+ base size=8 base align=8
+QEasingCurve (0x0x7f527870e720) 0
+
+Class QEventTransition::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QEventTransition::QPrivateSignal (0x0x7f5278432840) 0 empty
+
+Vtable for QEventTransition
+QEventTransition::_ZTV16QEventTransition: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QEventTransition)
+16 (int (*)(...))QEventTransition::metaObject
+24 (int (*)(...))QEventTransition::qt_metacast
+32 (int (*)(...))QEventTransition::qt_metacall
+40 (int (*)(...))QEventTransition::~QEventTransition
+48 (int (*)(...))QEventTransition::~QEventTransition
+56 (int (*)(...))QEventTransition::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QEventTransition::eventTest
+120 (int (*)(...))QEventTransition::onTransition
+
+Class QEventTransition
+ size=16 align=8
+ base size=16 base align=8
+QEventTransition (0x0x7f5278447000) 0
+ vptr=((& QEventTransition::_ZTV16QEventTransition) + 16)
+ QAbstractTransition (0x0x7f5278447068) 0
+ primary-for QEventTransition (0x0x7f5278447000)
+ QObject (0x0x7f52784327e0) 0
+ primary-for QAbstractTransition (0x0x7f5278447068)
+
+Vtable for QException
+QException::_ZTV10QException: 7 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QException)
+16 (int (*)(...))QException::~QException
+24 (int (*)(...))QException::~QException
+32 (int (*)(...))std::exception::what
+40 (int (*)(...))QException::raise
+48 (int (*)(...))QException::clone
+
+Class QException
+ size=8 align=8
+ base size=8 base align=8
+QException (0x0x7f52784470d0) 0 nearly-empty
+ vptr=((& QException::_ZTV10QException) + 16)
+ std::exception (0x0x7f5278432a20) 0 nearly-empty
+ primary-for QException (0x0x7f52784470d0)
+
+Vtable for QUnhandledException
+QUnhandledException::_ZTV19QUnhandledException: 7 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QUnhandledException)
+16 (int (*)(...))QUnhandledException::~QUnhandledException
+24 (int (*)(...))QUnhandledException::~QUnhandledException
+32 (int (*)(...))std::exception::what
+40 (int (*)(...))QUnhandledException::raise
+48 (int (*)(...))QUnhandledException::clone
+
+Class QUnhandledException
+ size=8 align=8
+ base size=8 base align=8
+QUnhandledException (0x0x7f5278447138) 0 nearly-empty
+ vptr=((& QUnhandledException::_ZTV19QUnhandledException) + 16)
+ QException (0x0x7f52784471a0) 0 nearly-empty
+ primary-for QUnhandledException (0x0x7f5278447138)
+ std::exception (0x0x7f5278432a80) 0 nearly-empty
+ primary-for QException (0x0x7f52784471a0)
+
+Class QtPrivate::ExceptionHolder
+ size=8 align=8
+ base size=8 base align=8
+QtPrivate::ExceptionHolder (0x0x7f5278432ae0) 0
+
+Class QtPrivate::ExceptionStore
+ size=8 align=8
+ base size=8 base align=8
+QtPrivate::ExceptionStore (0x0x7f5278432ba0) 0
+
+Vtable for QFactoryInterface
+QFactoryInterface::_ZTV17QFactoryInterface: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QFactoryInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+
+Class QFactoryInterface
+ size=8 align=8
+ base size=8 base align=8
+QFactoryInterface (0x0x7f5278432c00) 0 nearly-empty
+ vptr=((& QFactoryInterface::_ZTV17QFactoryInterface) + 16)
+
+Class QFileSelector::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QFileSelector::QPrivateSignal (0x0x7f5278432e40) 0 empty
+
+Vtable for QFileSelector
+QFileSelector::_ZTV13QFileSelector: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QFileSelector)
+16 (int (*)(...))QFileSelector::metaObject
+24 (int (*)(...))QFileSelector::qt_metacast
+32 (int (*)(...))QFileSelector::qt_metacall
+40 (int (*)(...))QFileSelector::~QFileSelector
+48 (int (*)(...))QFileSelector::~QFileSelector
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QFileSelector
+ size=16 align=8
+ base size=16 base align=8
+QFileSelector (0x0x7f5278447208) 0
+ vptr=((& QFileSelector::_ZTV13QFileSelector) + 16)
+ QObject (0x0x7f5278432de0) 0
+ primary-for QFileSelector (0x0x7f5278447208)
+
+Class QFileSystemWatcher::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QFileSystemWatcher::QPrivateSignal (0x0x7f527847d0c0) 0 empty
+
+Vtable for QFileSystemWatcher
+QFileSystemWatcher::_ZTV18QFileSystemWatcher: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QFileSystemWatcher)
+16 (int (*)(...))QFileSystemWatcher::metaObject
+24 (int (*)(...))QFileSystemWatcher::qt_metacast
+32 (int (*)(...))QFileSystemWatcher::qt_metacall
+40 (int (*)(...))QFileSystemWatcher::~QFileSystemWatcher
+48 (int (*)(...))QFileSystemWatcher::~QFileSystemWatcher
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QFileSystemWatcher
+ size=16 align=8
+ base size=16 base align=8
+QFileSystemWatcher (0x0x7f5278447270) 0
+ vptr=((& QFileSystemWatcher::_ZTV18QFileSystemWatcher) + 16)
+ QObject (0x0x7f527847d060) 0
+ primary-for QFileSystemWatcher (0x0x7f5278447270)
+
+Class QFinalState::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QFinalState::QPrivateSignal (0x0x7f527847d300) 0 empty
+
+Vtable for QFinalState
+QFinalState::_ZTV11QFinalState: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QFinalState)
+16 (int (*)(...))QFinalState::metaObject
+24 (int (*)(...))QFinalState::qt_metacast
+32 (int (*)(...))QFinalState::qt_metacall
+40 (int (*)(...))QFinalState::~QFinalState
+48 (int (*)(...))QFinalState::~QFinalState
+56 (int (*)(...))QFinalState::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QFinalState::onEntry
+120 (int (*)(...))QFinalState::onExit
+
+Class QFinalState
+ size=16 align=8
+ base size=16 base align=8
+QFinalState (0x0x7f52784472d8) 0
+ vptr=((& QFinalState::_ZTV11QFinalState) + 16)
+ QAbstractState (0x0x7f5278447340) 0
+ primary-for QFinalState (0x0x7f52784472d8)
+ QObject (0x0x7f527847d2a0) 0
+ primary-for QAbstractState (0x0x7f5278447340)
+
+Vtable for QRunnable
+QRunnable::_ZTV9QRunnable: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QRunnable)
+16 (int (*)(...))__cxa_pure_virtual
+24 0
+32 0
+
+Class QRunnable
+ size=16 align=8
+ base size=12 base align=8
+QRunnable (0x0x7f527847d4e0) 0
+ vptr=((& QRunnable::_ZTV9QRunnable) + 16)
+
+Class QBasicMutex
+ size=8 align=8
+ base size=8 base align=8
+QBasicMutex (0x0x7f527847d780) 0
+
+Class QMutex
+ size=8 align=8
+ base size=8 base align=8
+QMutex (0x0x7f5278447410) 0
+ QBasicMutex (0x0x7f5278510420) 0
+
+Class QRecursiveMutex
+ size=8 align=8
+ base size=8 base align=8
+QRecursiveMutex (0x0x7f5278447478) 0
+ QMutex (0x0x7f52784474e0) 0
+ QBasicMutex (0x0x7f5278510660) 0
+
+Class QMutexLocker
+ size=8 align=8
+ base size=8 base align=8
+QMutexLocker (0x0x7f52785106c0) 0
+
+Class QtPrivate::ResultItem
+ size=16 align=8
+ base size=16 base align=8
+QtPrivate::ResultItem (0x0x7f5278510cc0) 0
+
+Class QtPrivate::ResultIteratorBase
+ size=16 align=8
+ base size=12 base align=8
+QtPrivate::ResultIteratorBase (0x0x7f527813e300) 0
+
+Vtable for QtPrivate::ResultStoreBase
+QtPrivate::ResultStoreBase::_ZTVN9QtPrivate15ResultStoreBaseE: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTIN9QtPrivate15ResultStoreBaseE)
+16 (int (*)(...))QtPrivate::ResultStoreBase::~ResultStoreBase
+24 (int (*)(...))QtPrivate::ResultStoreBase::~ResultStoreBase
+
+Class QtPrivate::ResultStoreBase
+ size=48 align=8
+ base size=44 base align=8
+QtPrivate::ResultStoreBase (0x0x7f527813e4e0) 0
+ vptr=((& QtPrivate::ResultStoreBase::_ZTVN9QtPrivate15ResultStoreBaseE) + 16)
+
+Class std::__mutex_base
+ size=40 align=8
+ base size=40 base align=8
+std::__mutex_base (0x0x7f52781b3cc0) 0
+
+Class std::mutex
+ size=40 align=8
+ base size=40 base align=8
+std::mutex (0x0x7f52781b1dd0) 0
+ std::__mutex_base (0x0x7f52781b3d20) 0
+
+Class std::defer_lock_t
+ size=1 align=1
+ base size=0 base align=1
+std::defer_lock_t (0x0x7f52781b3f00) 0 empty
+
+Class std::try_to_lock_t
+ size=1 align=1
+ base size=0 base align=1
+std::try_to_lock_t (0x0x7f52781b3f60) 0 empty
+
+Class std::adopt_lock_t
+ size=1 align=1
+ base size=0 base align=1
+std::adopt_lock_t (0x0x7f52781d9000) 0 empty
+
+Class std::__recursive_mutex_base
+ size=40 align=8
+ base size=40 base align=8
+std::__recursive_mutex_base (0x0x7f52781d9a20) 0
+
+Class std::recursive_mutex
+ size=40 align=8
+ base size=40 base align=8
+std::recursive_mutex (0x0x7f52781b1e38) 0
+ std::__recursive_mutex_base (0x0x7f52781d9a80) 0
+
+Class std::timed_mutex
+ size=40 align=8
+ base size=40 base align=8
+std::timed_mutex (0x0x7f52781d1770) 0
+ std::__mutex_base (0x0x7f52781d9e40) 0
+ std::__timed_mutex_impl<std::timed_mutex> (0x0x7f52781d9ea0) 0 empty
+
+Class std::recursive_timed_mutex
+ size=40 align=8
+ base size=40 base align=8
+std::recursive_timed_mutex (0x0x7f52781d1af0) 0
+ std::__recursive_mutex_base (0x0x7f527821a240) 0
+ std::__timed_mutex_impl<std::recursive_timed_mutex> (0x0x7f527821a2a0) 0 empty
+
+Class std::once_flag
+ size=4 align=4
+ base size=4 base align=4
+std::once_flag (0x0x7f527821a9c0) 0
+
+Vtable for QFutureInterfaceBase
+QFutureInterfaceBase::_ZTV20QFutureInterfaceBase: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QFutureInterfaceBase)
+16 (int (*)(...))QFutureInterfaceBase::~QFutureInterfaceBase
+24 (int (*)(...))QFutureInterfaceBase::~QFutureInterfaceBase
+
+Class QFutureInterfaceBase
+ size=16 align=8
+ base size=16 base align=8
+QFutureInterfaceBase (0x0x7f527821ac00) 0
+ vptr=((& QFutureInterfaceBase::_ZTV20QFutureInterfaceBase) + 16)
+
+Class QFutureWatcherBase::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QFutureWatcherBase::QPrivateSignal (0x0x7f52782d8f60) 0 empty
+
+Vtable for QFutureWatcherBase
+QFutureWatcherBase::_ZTV18QFutureWatcherBase: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QFutureWatcherBase)
+16 (int (*)(...))QFutureWatcherBase::metaObject
+24 (int (*)(...))QFutureWatcherBase::qt_metacast
+32 (int (*)(...))QFutureWatcherBase::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QFutureWatcherBase::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QFutureWatcherBase::connectNotify
+104 (int (*)(...))QFutureWatcherBase::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+
+Class QFutureWatcherBase
+ size=16 align=8
+ base size=16 base align=8
+QFutureWatcherBase (0x0x7f5278260c30) 0
+ vptr=((& QFutureWatcherBase::_ZTV18QFutureWatcherBase) + 16)
+ QObject (0x0x7f52782d8f00) 0
+ primary-for QFutureWatcherBase (0x0x7f5278260c30)
+
+Class QHistoryState::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QHistoryState::QPrivateSignal (0x0x7f5278326300) 0 empty
+
+Vtable for QHistoryState
+QHistoryState::_ZTV13QHistoryState: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QHistoryState)
+16 (int (*)(...))QHistoryState::metaObject
+24 (int (*)(...))QHistoryState::qt_metacast
+32 (int (*)(...))QHistoryState::qt_metacall
+40 (int (*)(...))QHistoryState::~QHistoryState
+48 (int (*)(...))QHistoryState::~QHistoryState
+56 (int (*)(...))QHistoryState::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QHistoryState::onEntry
+120 (int (*)(...))QHistoryState::onExit
+
+Class QHistoryState
+ size=16 align=8
+ base size=16 base align=8
+QHistoryState (0x0x7f5278322478) 0
+ vptr=((& QHistoryState::_ZTV13QHistoryState) + 16)
+ QAbstractState (0x0x7f52783224e0) 0
+ primary-for QHistoryState (0x0x7f5278322478)
+ QObject (0x0x7f52783262a0) 0
+ primary-for QAbstractState (0x0x7f52783224e0)
+
+Class QIdentityProxyModel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QIdentityProxyModel::QPrivateSignal (0x0x7f5278326600) 0 empty
+
+Vtable for QIdentityProxyModel
+QIdentityProxyModel::_ZTV19QIdentityProxyModel: 53 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QIdentityProxyModel)
+16 (int (*)(...))QIdentityProxyModel::metaObject
+24 (int (*)(...))QIdentityProxyModel::qt_metacast
+32 (int (*)(...))QIdentityProxyModel::qt_metacall
+40 (int (*)(...))QIdentityProxyModel::~QIdentityProxyModel
+48 (int (*)(...))QIdentityProxyModel::~QIdentityProxyModel
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QIdentityProxyModel::index
+120 (int (*)(...))QIdentityProxyModel::parent
+128 (int (*)(...))QIdentityProxyModel::sibling
+136 (int (*)(...))QIdentityProxyModel::rowCount
+144 (int (*)(...))QIdentityProxyModel::columnCount
+152 (int (*)(...))QAbstractProxyModel::hasChildren
+160 (int (*)(...))QAbstractProxyModel::data
+168 (int (*)(...))QAbstractProxyModel::setData
+176 (int (*)(...))QIdentityProxyModel::headerData
+184 (int (*)(...))QAbstractProxyModel::setHeaderData
+192 (int (*)(...))QAbstractProxyModel::itemData
+200 (int (*)(...))QAbstractProxyModel::setItemData
+208 (int (*)(...))QAbstractProxyModel::mimeTypes
+216 (int (*)(...))QAbstractProxyModel::mimeData
+224 (int (*)(...))QAbstractProxyModel::canDropMimeData
+232 (int (*)(...))QIdentityProxyModel::dropMimeData
+240 (int (*)(...))QAbstractProxyModel::supportedDropActions
+248 (int (*)(...))QAbstractProxyModel::supportedDragActions
+256 (int (*)(...))QIdentityProxyModel::insertRows
+264 (int (*)(...))QIdentityProxyModel::insertColumns
+272 (int (*)(...))QIdentityProxyModel::removeRows
+280 (int (*)(...))QIdentityProxyModel::removeColumns
+288 (int (*)(...))QIdentityProxyModel::moveRows
+296 (int (*)(...))QIdentityProxyModel::moveColumns
+304 (int (*)(...))QAbstractProxyModel::fetchMore
+312 (int (*)(...))QAbstractProxyModel::canFetchMore
+320 (int (*)(...))QAbstractProxyModel::flags
+328 (int (*)(...))QAbstractProxyModel::sort
+336 (int (*)(...))QAbstractProxyModel::buddy
+344 (int (*)(...))QIdentityProxyModel::match
+352 (int (*)(...))QAbstractProxyModel::span
+360 (int (*)(...))QAbstractItemModel::roleNames
+368 (int (*)(...))QAbstractProxyModel::submit
+376 (int (*)(...))QAbstractProxyModel::revert
+384 (int (*)(...))QIdentityProxyModel::setSourceModel
+392 (int (*)(...))QIdentityProxyModel::mapToSource
+400 (int (*)(...))QIdentityProxyModel::mapFromSource
+408 (int (*)(...))QIdentityProxyModel::mapSelectionToSource
+416 (int (*)(...))QIdentityProxyModel::mapSelectionFromSource
+
+Class QIdentityProxyModel
+ size=16 align=8
+ base size=16 base align=8
+QIdentityProxyModel (0x0x7f5278322548) 0
+ vptr=((& QIdentityProxyModel::_ZTV19QIdentityProxyModel) + 16)
+ QAbstractProxyModel (0x0x7f52783225b0) 0
+ primary-for QIdentityProxyModel (0x0x7f5278322548)
+ QAbstractItemModel (0x0x7f5278322618) 0
+ primary-for QAbstractProxyModel (0x0x7f52783225b0)
+ QObject (0x0x7f52783265a0) 0
+ primary-for QAbstractItemModel (0x0x7f5278322618)
+
+Class QItemSelectionRange
+ size=16 align=8
+ base size=16 base align=8
+QItemSelectionRange (0x0x7f52783267e0) 0
+
+Class QItemSelectionModel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QItemSelectionModel::QPrivateSignal (0x0x7f5278008120) 0 empty
+
+Vtable for QItemSelectionModel
+QItemSelectionModel::_ZTV19QItemSelectionModel: 20 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QItemSelectionModel)
+16 (int (*)(...))QItemSelectionModel::metaObject
+24 (int (*)(...))QItemSelectionModel::qt_metacast
+32 (int (*)(...))QItemSelectionModel::qt_metacall
+40 (int (*)(...))QItemSelectionModel::~QItemSelectionModel
+48 (int (*)(...))QItemSelectionModel::~QItemSelectionModel
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QItemSelectionModel::setCurrentIndex
+120 (int (*)(...))QItemSelectionModel::select
+128 (int (*)(...))QItemSelectionModel::select
+136 (int (*)(...))QItemSelectionModel::clear
+144 (int (*)(...))QItemSelectionModel::reset
+152 (int (*)(...))QItemSelectionModel::clearCurrentIndex
+
+Class QItemSelectionModel
+ size=16 align=8
+ base size=16 base align=8
+QItemSelectionModel (0x0x7f5277ff3f70) 0
+ vptr=((& QItemSelectionModel::_ZTV19QItemSelectionModel) + 16)
+ QObject (0x0x7f52780080c0) 0
+ primary-for QItemSelectionModel (0x0x7f5277ff3f70)
+
+Class QItemSelection
+ size=8 align=8
+ base size=8 base align=8
+QItemSelection (0x0x7f5278025138) 0
+ QList<QItemSelectionRange> (0x0x7f52780251a0) 0
+ QListSpecialMethods<QItemSelectionRange> (0x0x7f5278008c00) 0 empty
+
+Class QJsonValue
+ size=24 align=8
+ base size=20 base align=8
+QJsonValue (0x0x7f52780be540) 0
+
+Class QJsonValueRef
+ size=16 align=8
+ base size=12 base align=8
+QJsonValueRef (0x0x7f52780beea0) 0
+
+Class QJsonValuePtr
+ size=24 align=8
+ base size=24 base align=8
+QJsonValuePtr (0x0x7f5278119e40) 0
+
+Class QJsonValueRefPtr
+ size=16 align=8
+ base size=16 base align=8
+QJsonValueRefPtr (0x0x7f5277d53120) 0
+
+Class QJsonArray::iterator
+ size=16 align=8
+ base size=12 base align=8
+QJsonArray::iterator (0x0x7f5277d90480) 0
+
+Class QJsonArray::const_iterator
+ size=16 align=8
+ base size=12 base align=8
+QJsonArray::const_iterator (0x0x7f5277d904e0) 0
+
+Class QJsonArray
+ size=16 align=8
+ base size=16 base align=8
+QJsonArray (0x0x7f5277d90420) 0
+
+Class QJsonParseError
+ size=8 align=4
+ base size=8 base align=4
+QJsonParseError (0x0x7f5277e41a80) 0
+
+Class QJsonDocument
+ size=8 align=8
+ base size=8 base align=8
+QJsonDocument (0x0x7f5277e41ae0) 0
+
+Class QJsonObject::iterator
+ size=16 align=8
+ base size=12 base align=8
+QJsonObject::iterator (0x0x7f5277c89a20) 0
+
+Class QJsonObject::const_iterator
+ size=16 align=8
+ base size=12 base align=8
+QJsonObject::const_iterator (0x0x7f5277c89a80) 0
+
+Class QJsonObject
+ size=16 align=8
+ base size=16 base align=8
+QJsonObject (0x0x7f5277c899c0) 0
+
+Class QLibrary::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QLibrary::QPrivateSignal (0x0x7f5277939d20) 0 empty
+
+Vtable for QLibrary
+QLibrary::_ZTV8QLibrary: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI8QLibrary)
+16 (int (*)(...))QLibrary::metaObject
+24 (int (*)(...))QLibrary::qt_metacast
+32 (int (*)(...))QLibrary::qt_metacall
+40 (int (*)(...))QLibrary::~QLibrary
+48 (int (*)(...))QLibrary::~QLibrary
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QLibrary
+ size=32 align=8
+ base size=25 base align=8
+QLibrary (0x0x7f527793caf8) 0
+ vptr=((& QLibrary::_ZTV8QLibrary) + 16)
+ QObject (0x0x7f5277939cc0) 0
+ primary-for QLibrary (0x0x7f527793caf8)
+
+Class QVersionNumber::SegmentStorage
+ size=8 align=8
+ base size=8 base align=8
+QVersionNumber::SegmentStorage (0x0x7f527796bba0) 0
+
+Class QVersionNumber
+ size=8 align=8
+ base size=8 base align=8
+QVersionNumber (0x0x7f527796b6c0) 0
+
+Class QLibraryInfo
+ size=1 align=1
+ base size=0 base align=1
+QLibraryInfo (0x0x7f5277a8a000) 0 empty
+
+Class QPoint
+ size=8 align=4
+ base size=8 base align=4
+QPoint (0x0x7f5277a8a060) 0
+
+Class QPointF
+ size=16 align=8
+ base size=16 base align=8
+QPointF (0x0x7f5277ad8ea0) 0
+
+Class QLine
+ size=16 align=4
+ base size=16 base align=4
+QLine (0x0x7f52777720c0) 0
+
+Class QLineF
+ size=32 align=8
+ base size=32 base align=8
+QLineF (0x0x7f52777d9480) 0
+
+Class QLinkedListData
+ size=32 align=8
+ base size=25 base align=8
+QLinkedListData (0x0x7f5277855720) 0
+
+Class QLockFile
+ size=8 align=8
+ base size=8 base align=8
+QLockFile (0x0x7f52778fcc60) 0
+
+Class QLoggingCategory::AtomicBools
+ size=4 align=1
+ base size=4 base align=1
+QLoggingCategory::AtomicBools (0x0x7f52778fcea0) 0
+
+Class QLoggingCategory
+ size=24 align=8
+ base size=24 base align=8
+QLoggingCategory (0x0x7f52778fce40) 0
+
+Class QMargins
+ size=16 align=4
+ base size=16 base align=4
+QMargins (0x0x7f527756c300) 0
+
+Class QMarginsF
+ size=32 align=8
+ base size=32 base align=8
+QMarginsF (0x0x7f52775ed240) 0
+
+Class QMessageAuthenticationCode
+ size=8 align=8
+ base size=8 base align=8
+QMessageAuthenticationCode (0x0x7f5277422a20) 0
+
+Class QMetaMethod
+ size=16 align=8
+ base size=12 base align=8
+QMetaMethod (0x0x7f5277422a80) 0
+
+Class QMetaEnum
+ size=16 align=8
+ base size=12 base align=8
+QMetaEnum (0x0x7f52774af300) 0
+
+Class QMetaProperty
+ size=32 align=8
+ base size=32 base align=8
+QMetaProperty (0x0x7f52774f14e0) 0
+
+Class QMetaClassInfo
+ size=16 align=8
+ base size=12 base align=8
+QMetaClassInfo (0x0x7f52774f1600) 0
+
+Class QMimeData::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QMimeData::QPrivateSignal (0x0x7f527712fba0) 0 empty
+
+Vtable for QMimeData
+QMimeData::_ZTV9QMimeData: 17 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QMimeData)
+16 (int (*)(...))QMimeData::metaObject
+24 (int (*)(...))QMimeData::qt_metacast
+32 (int (*)(...))QMimeData::qt_metacall
+40 (int (*)(...))QMimeData::~QMimeData
+48 (int (*)(...))QMimeData::~QMimeData
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QMimeData::hasFormat
+120 (int (*)(...))QMimeData::formats
+128 (int (*)(...))QMimeData::retrieveData
+
+Class QMimeData
+ size=16 align=8
+ base size=16 base align=8
+QMimeData (0x0x7f527713b680) 0
+ vptr=((& QMimeData::_ZTV9QMimeData) + 16)
+ QObject (0x0x7f527712fb40) 0
+ primary-for QMimeData (0x0x7f527713b680)
+
+Class QMimeType
+ size=8 align=8
+ base size=8 base align=8
+QMimeType (0x0x7f527712fd80) 0
+
+Class QMimeDatabase
+ size=8 align=8
+ base size=8 base align=8
+QMimeDatabase (0x0x7f5277200cc0) 0
+
+Class QObjectCleanupHandler::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QObjectCleanupHandler::QPrivateSignal (0x0x7f5277200d80) 0 empty
+
+Vtable for QObjectCleanupHandler
+QObjectCleanupHandler::_ZTV21QObjectCleanupHandler: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI21QObjectCleanupHandler)
+16 (int (*)(...))QObjectCleanupHandler::metaObject
+24 (int (*)(...))QObjectCleanupHandler::qt_metacast
+32 (int (*)(...))QObjectCleanupHandler::qt_metacall
+40 (int (*)(...))QObjectCleanupHandler::~QObjectCleanupHandler
+48 (int (*)(...))QObjectCleanupHandler::~QObjectCleanupHandler
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QObjectCleanupHandler
+ size=24 align=8
+ base size=24 base align=8
+QObjectCleanupHandler (0x0x7f5277216208) 0
+ vptr=((& QObjectCleanupHandler::_ZTV21QObjectCleanupHandler) + 16)
+ QObject (0x0x7f5277200d20) 0
+ primary-for QObjectCleanupHandler (0x0x7f5277216208)
+
+Class QOperatingSystemVersion
+ size=16 align=4
+ base size=16 base align=4
+QOperatingSystemVersion (0x0x7f5277200ea0) 0
+
+Class QParallelAnimationGroup::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QParallelAnimationGroup::QPrivateSignal (0x0x7f527728d660) 0 empty
+
+Vtable for QParallelAnimationGroup
+QParallelAnimationGroup::_ZTV23QParallelAnimationGroup: 18 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI23QParallelAnimationGroup)
+16 (int (*)(...))QParallelAnimationGroup::metaObject
+24 (int (*)(...))QParallelAnimationGroup::qt_metacast
+32 (int (*)(...))QParallelAnimationGroup::qt_metacall
+40 (int (*)(...))QParallelAnimationGroup::~QParallelAnimationGroup
+48 (int (*)(...))QParallelAnimationGroup::~QParallelAnimationGroup
+56 (int (*)(...))QParallelAnimationGroup::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QParallelAnimationGroup::duration
+120 (int (*)(...))QParallelAnimationGroup::updateCurrentTime
+128 (int (*)(...))QParallelAnimationGroup::updateState
+136 (int (*)(...))QParallelAnimationGroup::updateDirection
+
+Class QParallelAnimationGroup
+ size=16 align=8
+ base size=16 base align=8
+QParallelAnimationGroup (0x0x7f5277287a90) 0
+ vptr=((& QParallelAnimationGroup::_ZTV23QParallelAnimationGroup) + 16)
+ QAnimationGroup (0x0x7f5277287af8) 0
+ primary-for QParallelAnimationGroup (0x0x7f5277287a90)
+ QAbstractAnimation (0x0x7f5277287b60) 0
+ primary-for QAnimationGroup (0x0x7f5277287af8)
+ QObject (0x0x7f527728d600) 0
+ primary-for QAbstractAnimation (0x0x7f5277287b60)
+
+Class QPauseAnimation::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QPauseAnimation::QPrivateSignal (0x0x7f527728d8a0) 0 empty
+
+Vtable for QPauseAnimation
+QPauseAnimation::_ZTV15QPauseAnimation: 18 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QPauseAnimation)
+16 (int (*)(...))QPauseAnimation::metaObject
+24 (int (*)(...))QPauseAnimation::qt_metacast
+32 (int (*)(...))QPauseAnimation::qt_metacall
+40 (int (*)(...))QPauseAnimation::~QPauseAnimation
+48 (int (*)(...))QPauseAnimation::~QPauseAnimation
+56 (int (*)(...))QPauseAnimation::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QPauseAnimation::duration
+120 (int (*)(...))QPauseAnimation::updateCurrentTime
+128 (int (*)(...))QAbstractAnimation::updateState
+136 (int (*)(...))QAbstractAnimation::updateDirection
+
+Class QPauseAnimation
+ size=16 align=8
+ base size=16 base align=8
+QPauseAnimation (0x0x7f5277287bc8) 0
+ vptr=((& QPauseAnimation::_ZTV15QPauseAnimation) + 16)
+ QAbstractAnimation (0x0x7f5277287c30) 0
+ primary-for QPauseAnimation (0x0x7f5277287bc8)
+ QObject (0x0x7f527728d840) 0
+ primary-for QAbstractAnimation (0x0x7f5277287c30)
+
+Class QStaticPlugin
+ size=16 align=8
+ base size=16 base align=8
+QStaticPlugin (0x0x7f52772c0420) 0
+
+Class QPluginLoader::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QPluginLoader::QPrivateSignal (0x0x7f52773045a0) 0 empty
+
+Vtable for QPluginLoader
+QPluginLoader::_ZTV13QPluginLoader: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QPluginLoader)
+16 (int (*)(...))QPluginLoader::metaObject
+24 (int (*)(...))QPluginLoader::qt_metacast
+32 (int (*)(...))QPluginLoader::qt_metacall
+40 (int (*)(...))QPluginLoader::~QPluginLoader
+48 (int (*)(...))QPluginLoader::~QPluginLoader
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QPluginLoader
+ size=32 align=8
+ base size=25 base align=8
+QPluginLoader (0x0x7f52772f4f70) 0
+ vptr=((& QPluginLoader::_ZTV13QPluginLoader) + 16)
+ QObject (0x0x7f5277304540) 0
+ primary-for QPluginLoader (0x0x7f52772f4f70)
+
+Class QProcessEnvironment
+ size=8 align=8
+ base size=8 base align=8
+QProcessEnvironment (0x0x7f52773046c0) 0
+
+Class QProcess::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QProcess::QPrivateSignal (0x0x7f5276fd5b40) 0 empty
+
+Vtable for QProcess
+QProcess::_ZTV8QProcess: 31 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI8QProcess)
+16 (int (*)(...))QProcess::metaObject
+24 (int (*)(...))QProcess::qt_metacast
+32 (int (*)(...))QProcess::qt_metacall
+40 (int (*)(...))QProcess::~QProcess
+48 (int (*)(...))QProcess::~QProcess
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QProcess::isSequential
+120 (int (*)(...))QProcess::open
+128 (int (*)(...))QProcess::close
+136 (int (*)(...))QIODevice::pos
+144 (int (*)(...))QIODevice::size
+152 (int (*)(...))QIODevice::seek
+160 (int (*)(...))QProcess::atEnd
+168 (int (*)(...))QIODevice::reset
+176 (int (*)(...))QProcess::bytesAvailable
+184 (int (*)(...))QProcess::bytesToWrite
+192 (int (*)(...))QProcess::canReadLine
+200 (int (*)(...))QProcess::waitForReadyRead
+208 (int (*)(...))QProcess::waitForBytesWritten
+216 (int (*)(...))QProcess::readData
+224 (int (*)(...))QIODevice::readLineData
+232 (int (*)(...))QProcess::writeData
+240 (int (*)(...))QProcess::setupChildProcess
+
+Class QProcess
+ size=16 align=8
+ base size=16 base align=8
+QProcess (0x0x7f5276fde410) 0
+ vptr=((& QProcess::_ZTV8QProcess) + 16)
+ QIODevice (0x0x7f5276fde478) 0
+ primary-for QProcess (0x0x7f5276fde410)
+ QObject (0x0x7f5276fd5ae0) 0
+ primary-for QIODevice (0x0x7f5276fde478)
+
+Class QVariantAnimation::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QVariantAnimation::QPrivateSignal (0x0x7f5277016240) 0 empty
+
+Vtable for QVariantAnimation
+QVariantAnimation::_ZTV17QVariantAnimation: 20 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QVariantAnimation)
+16 (int (*)(...))QVariantAnimation::metaObject
+24 (int (*)(...))QVariantAnimation::qt_metacast
+32 (int (*)(...))QVariantAnimation::qt_metacall
+40 (int (*)(...))QVariantAnimation::~QVariantAnimation
+48 (int (*)(...))QVariantAnimation::~QVariantAnimation
+56 (int (*)(...))QVariantAnimation::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QVariantAnimation::duration
+120 (int (*)(...))QVariantAnimation::updateCurrentTime
+128 (int (*)(...))QVariantAnimation::updateState
+136 (int (*)(...))QAbstractAnimation::updateDirection
+144 (int (*)(...))QVariantAnimation::updateCurrentValue
+152 (int (*)(...))QVariantAnimation::interpolated
+
+Class QVariantAnimation
+ size=16 align=8
+ base size=16 base align=8
+QVariantAnimation (0x0x7f5276fde4e0) 0
+ vptr=((& QVariantAnimation::_ZTV17QVariantAnimation) + 16)
+ QAbstractAnimation (0x0x7f5276fde548) 0
+ primary-for QVariantAnimation (0x0x7f5276fde4e0)
+ QObject (0x0x7f52770161e0) 0
+ primary-for QAbstractAnimation (0x0x7f5276fde548)
+
+Class QPropertyAnimation::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QPropertyAnimation::QPrivateSignal (0x0x7f52770164e0) 0 empty
+
+Vtable for QPropertyAnimation
+QPropertyAnimation::_ZTV18QPropertyAnimation: 20 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QPropertyAnimation)
+16 (int (*)(...))QPropertyAnimation::metaObject
+24 (int (*)(...))QPropertyAnimation::qt_metacast
+32 (int (*)(...))QPropertyAnimation::qt_metacall
+40 (int (*)(...))QPropertyAnimation::~QPropertyAnimation
+48 (int (*)(...))QPropertyAnimation::~QPropertyAnimation
+56 (int (*)(...))QPropertyAnimation::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QVariantAnimation::duration
+120 (int (*)(...))QVariantAnimation::updateCurrentTime
+128 (int (*)(...))QPropertyAnimation::updateState
+136 (int (*)(...))QAbstractAnimation::updateDirection
+144 (int (*)(...))QPropertyAnimation::updateCurrentValue
+152 (int (*)(...))QVariantAnimation::interpolated
+
+Class QPropertyAnimation
+ size=16 align=8
+ base size=16 base align=8
+QPropertyAnimation (0x0x7f5276fde618) 0
+ vptr=((& QPropertyAnimation::_ZTV18QPropertyAnimation) + 16)
+ QVariantAnimation (0x0x7f5276fde680) 0
+ primary-for QPropertyAnimation (0x0x7f5276fde618)
+ QAbstractAnimation (0x0x7f5276fde6e8) 0
+ primary-for QVariantAnimation (0x0x7f5276fde680)
+ QObject (0x0x7f5277016480) 0
+ primary-for QAbstractAnimation (0x0x7f5276fde6e8)
+
+Class std::random_device
+ size=5000 align=8
+ base size=5000 base align=8
+std::random_device (0x0x7f527709dc00) 0
+
+Class std::bernoulli_distribution::param_type
+ size=8 align=8
+ base size=8 base align=8
+std::bernoulli_distribution::param_type (0x0x7f5276d95960) 0
+
+Class std::bernoulli_distribution
+ size=8 align=8
+ base size=8 base align=8
+std::bernoulli_distribution (0x0x7f5276d95900) 0
+
+Class std::seed_seq
+ size=24 align=8
+ base size=24 base align=8
+std::seed_seq (0x0x7f5276b986c0) 0
+
+Class QRandomGenerator::Storage
+ size=2504 align=8
+ base size=2504 base align=8
+QRandomGenerator::Storage (0x0x7f52769ca360) 0
+
+Class QRandomGenerator
+ size=2512 align=8
+ base size=2512 base align=8
+QRandomGenerator (0x0x7f52769ca300) 0
+
+Class QRandomGenerator64
+ size=2512 align=8
+ base size=2512 base align=8
+QRandomGenerator64 (0x0x7f5276a513a8) 0
+ QRandomGenerator (0x0x7f5276a49e40) 0
+
+Class QReadWriteLock
+ size=8 align=8
+ base size=8 base align=8
+QReadWriteLock (0x0x7f5276a70a20) 0
+
+Class QReadLocker
+ size=8 align=8
+ base size=8 base align=8
+QReadLocker (0x0x7f5276a70cc0) 0
+
+Class QWriteLocker
+ size=8 align=8
+ base size=8 base align=8
+QWriteLocker (0x0x7f5276af91e0) 0
+
+Class QSize
+ size=8 align=4
+ base size=8 base align=4
+QSize (0x0x7f5276af96c0) 0
+
+Class QSizeF
+ size=16 align=8
+ base size=16 base align=8
+QSizeF (0x0x7f52767655a0) 0
+
+Class QRect
+ size=16 align=4
+ base size=16 base align=4
+QRect (0x0x7f52767df600) 0
+
+Class QRectF
+ size=32 align=8
+ base size=32 base align=8
+QRectF (0x0x7f5276898660) 0
+
+Class QResource
+ size=8 align=8
+ base size=8 base align=8
+QResource (0x0x7f5276554780) 0
+
+Class QSaveFile::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSaveFile::QPrivateSignal (0x0x7f5276554a20) 0 empty
+
+Vtable for QSaveFile
+QSaveFile::_ZTV9QSaveFile: 34 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QSaveFile)
+16 (int (*)(...))QSaveFile::metaObject
+24 (int (*)(...))QSaveFile::qt_metacast
+32 (int (*)(...))QSaveFile::qt_metacall
+40 (int (*)(...))QSaveFile::~QSaveFile
+48 (int (*)(...))QSaveFile::~QSaveFile
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QFileDevice::isSequential
+120 (int (*)(...))QSaveFile::open
+128 (int (*)(...))QSaveFile::close
+136 (int (*)(...))QFileDevice::pos
+144 (int (*)(...))QFileDevice::size
+152 (int (*)(...))QFileDevice::seek
+160 (int (*)(...))QFileDevice::atEnd
+168 (int (*)(...))QIODevice::reset
+176 (int (*)(...))QIODevice::bytesAvailable
+184 (int (*)(...))QIODevice::bytesToWrite
+192 (int (*)(...))QIODevice::canReadLine
+200 (int (*)(...))QIODevice::waitForReadyRead
+208 (int (*)(...))QIODevice::waitForBytesWritten
+216 (int (*)(...))QFileDevice::readData
+224 (int (*)(...))QFileDevice::readLineData
+232 (int (*)(...))QSaveFile::writeData
+240 (int (*)(...))QSaveFile::fileName
+248 (int (*)(...))QFileDevice::resize
+256 (int (*)(...))QFileDevice::permissions
+264 (int (*)(...))QFileDevice::setPermissions
+
+Class QSaveFile
+ size=16 align=8
+ base size=16 base align=8
+QSaveFile (0x0x7f5276902d68) 0
+ vptr=((& QSaveFile::_ZTV9QSaveFile) + 16)
+ QFileDevice (0x0x7f5276902dd0) 0
+ primary-for QSaveFile (0x0x7f5276902d68)
+ QIODevice (0x0x7f5276902e38) 0
+ primary-for QFileDevice (0x0x7f5276902dd0)
+ QObject (0x0x7f52765549c0) 0
+ primary-for QIODevice (0x0x7f5276902e38)
+
+Class QSemaphore
+ size=8 align=8
+ base size=8 base align=8
+QSemaphore (0x0x7f52765ac0c0) 0
+
+Class QSemaphoreReleaser
+ size=16 align=8
+ base size=12 base align=8
+QSemaphoreReleaser (0x0x7f52765ac240) 0
+
+Class QSequentialAnimationGroup::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSequentialAnimationGroup::QPrivateSignal (0x0x7f527665ae40) 0 empty
+
+Vtable for QSequentialAnimationGroup
+QSequentialAnimationGroup::_ZTV25QSequentialAnimationGroup: 18 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI25QSequentialAnimationGroup)
+16 (int (*)(...))QSequentialAnimationGroup::metaObject
+24 (int (*)(...))QSequentialAnimationGroup::qt_metacast
+32 (int (*)(...))QSequentialAnimationGroup::qt_metacall
+40 (int (*)(...))QSequentialAnimationGroup::~QSequentialAnimationGroup
+48 (int (*)(...))QSequentialAnimationGroup::~QSequentialAnimationGroup
+56 (int (*)(...))QSequentialAnimationGroup::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QSequentialAnimationGroup::duration
+120 (int (*)(...))QSequentialAnimationGroup::updateCurrentTime
+128 (int (*)(...))QSequentialAnimationGroup::updateState
+136 (int (*)(...))QSequentialAnimationGroup::updateDirection
+
+Class QSequentialAnimationGroup
+ size=16 align=8
+ base size=16 base align=8
+QSequentialAnimationGroup (0x0x7f5276671618) 0
+ vptr=((& QSequentialAnimationGroup::_ZTV25QSequentialAnimationGroup) + 16)
+ QAnimationGroup (0x0x7f5276671680) 0
+ primary-for QSequentialAnimationGroup (0x0x7f5276671618)
+ QAbstractAnimation (0x0x7f52766716e8) 0
+ primary-for QAnimationGroup (0x0x7f5276671680)
+ QObject (0x0x7f527665ade0) 0
+ primary-for QAbstractAnimation (0x0x7f52766716e8)
+
+Class QSettings::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSettings::QPrivateSignal (0x0x7f52766850c0) 0 empty
+
+Vtable for QSettings
+QSettings::_ZTV9QSettings: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QSettings)
+16 (int (*)(...))QSettings::metaObject
+24 (int (*)(...))QSettings::qt_metacast
+32 (int (*)(...))QSettings::qt_metacall
+40 (int (*)(...))QSettings::~QSettings
+48 (int (*)(...))QSettings::~QSettings
+56 (int (*)(...))QSettings::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QSettings
+ size=16 align=8
+ base size=16 base align=8
+QSettings (0x0x7f5276671750) 0
+ vptr=((& QSettings::_ZTV9QSettings) + 16)
+ QObject (0x0x7f5276685060) 0
+ primary-for QSettings (0x0x7f5276671750)
+
+Class QSharedMemory::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSharedMemory::QPrivateSignal (0x0x7f5276685540) 0 empty
+
+Vtable for QSharedMemory
+QSharedMemory::_ZTV13QSharedMemory: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QSharedMemory)
+16 (int (*)(...))QSharedMemory::metaObject
+24 (int (*)(...))QSharedMemory::qt_metacast
+32 (int (*)(...))QSharedMemory::qt_metacall
+40 (int (*)(...))QSharedMemory::~QSharedMemory
+48 (int (*)(...))QSharedMemory::~QSharedMemory
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QSharedMemory
+ size=16 align=8
+ base size=16 base align=8
+QSharedMemory (0x0x7f52766717b8) 0
+ vptr=((& QSharedMemory::_ZTV13QSharedMemory) + 16)
+ QObject (0x0x7f52766854e0) 0
+ primary-for QSharedMemory (0x0x7f52766717b8)
+
+Class QSignalMapper::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSignalMapper::QPrivateSignal (0x0x7f5276685780) 0 empty
+
+Vtable for QSignalMapper
+QSignalMapper::_ZTV13QSignalMapper: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QSignalMapper)
+16 (int (*)(...))QSignalMapper::metaObject
+24 (int (*)(...))QSignalMapper::qt_metacast
+32 (int (*)(...))QSignalMapper::qt_metacall
+40 (int (*)(...))QSignalMapper::~QSignalMapper
+48 (int (*)(...))QSignalMapper::~QSignalMapper
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QSignalMapper
+ size=16 align=8
+ base size=16 base align=8
+QSignalMapper (0x0x7f5276671820) 0
+ vptr=((& QSignalMapper::_ZTV13QSignalMapper) + 16)
+ QObject (0x0x7f5276685720) 0
+ primary-for QSignalMapper (0x0x7f5276671820)
+
+Class QSignalTransition::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSignalTransition::QPrivateSignal (0x0x7f52766859c0) 0 empty
+
+Vtable for QSignalTransition
+QSignalTransition::_ZTV17QSignalTransition: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QSignalTransition)
+16 (int (*)(...))QSignalTransition::metaObject
+24 (int (*)(...))QSignalTransition::qt_metacast
+32 (int (*)(...))QSignalTransition::qt_metacall
+40 (int (*)(...))QSignalTransition::~QSignalTransition
+48 (int (*)(...))QSignalTransition::~QSignalTransition
+56 (int (*)(...))QSignalTransition::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QSignalTransition::eventTest
+120 (int (*)(...))QSignalTransition::onTransition
+
+Class QSignalTransition
+ size=16 align=8
+ base size=16 base align=8
+QSignalTransition (0x0x7f5276671888) 0
+ vptr=((& QSignalTransition::_ZTV17QSignalTransition) + 16)
+ QAbstractTransition (0x0x7f52766718f0) 0
+ primary-for QSignalTransition (0x0x7f5276671888)
+ QObject (0x0x7f5276685960) 0
+ primary-for QAbstractTransition (0x0x7f52766718f0)
+
+Class QSocketNotifier::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSocketNotifier::QPrivateSignal (0x0x7f5276685c60) 0 empty
+
+Vtable for QSocketNotifier
+QSocketNotifier::_ZTV15QSocketNotifier: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QSocketNotifier)
+16 (int (*)(...))QSocketNotifier::metaObject
+24 (int (*)(...))QSocketNotifier::qt_metacast
+32 (int (*)(...))QSocketNotifier::qt_metacall
+40 (int (*)(...))QSocketNotifier::~QSocketNotifier
+48 (int (*)(...))QSocketNotifier::~QSocketNotifier
+56 (int (*)(...))QSocketNotifier::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QSocketNotifier
+ size=16 align=8
+ base size=16 base align=8
+QSocketNotifier (0x0x7f5276671958) 0
+ vptr=((& QSocketNotifier::_ZTV15QSocketNotifier) + 16)
+ QObject (0x0x7f5276685c00) 0
+ primary-for QSocketNotifier (0x0x7f5276671958)
+
+Class QSocketDescriptor
+ size=4 align=4
+ base size=4 base align=4
+QSocketDescriptor (0x0x7f5276685e40) 0
+
+Class QSortFilterProxyModel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSortFilterProxyModel::QPrivateSignal (0x0x7f52766efa80) 0 empty
+
+Vtable for QSortFilterProxyModel
+QSortFilterProxyModel::_ZTV21QSortFilterProxyModel: 56 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI21QSortFilterProxyModel)
+16 (int (*)(...))QSortFilterProxyModel::metaObject
+24 (int (*)(...))QSortFilterProxyModel::qt_metacast
+32 (int (*)(...))QSortFilterProxyModel::qt_metacall
+40 (int (*)(...))QSortFilterProxyModel::~QSortFilterProxyModel
+48 (int (*)(...))QSortFilterProxyModel::~QSortFilterProxyModel
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QSortFilterProxyModel::index
+120 (int (*)(...))QSortFilterProxyModel::parent
+128 (int (*)(...))QSortFilterProxyModel::sibling
+136 (int (*)(...))QSortFilterProxyModel::rowCount
+144 (int (*)(...))QSortFilterProxyModel::columnCount
+152 (int (*)(...))QSortFilterProxyModel::hasChildren
+160 (int (*)(...))QSortFilterProxyModel::data
+168 (int (*)(...))QSortFilterProxyModel::setData
+176 (int (*)(...))QSortFilterProxyModel::headerData
+184 (int (*)(...))QSortFilterProxyModel::setHeaderData
+192 (int (*)(...))QAbstractProxyModel::itemData
+200 (int (*)(...))QAbstractProxyModel::setItemData
+208 (int (*)(...))QSortFilterProxyModel::mimeTypes
+216 (int (*)(...))QSortFilterProxyModel::mimeData
+224 (int (*)(...))QAbstractProxyModel::canDropMimeData
+232 (int (*)(...))QSortFilterProxyModel::dropMimeData
+240 (int (*)(...))QSortFilterProxyModel::supportedDropActions
+248 (int (*)(...))QAbstractProxyModel::supportedDragActions
+256 (int (*)(...))QSortFilterProxyModel::insertRows
+264 (int (*)(...))QSortFilterProxyModel::insertColumns
+272 (int (*)(...))QSortFilterProxyModel::removeRows
+280 (int (*)(...))QSortFilterProxyModel::removeColumns
+288 (int (*)(...))QAbstractItemModel::moveRows
+296 (int (*)(...))QAbstractItemModel::moveColumns
+304 (int (*)(...))QSortFilterProxyModel::fetchMore
+312 (int (*)(...))QSortFilterProxyModel::canFetchMore
+320 (int (*)(...))QSortFilterProxyModel::flags
+328 (int (*)(...))QSortFilterProxyModel::sort
+336 (int (*)(...))QSortFilterProxyModel::buddy
+344 (int (*)(...))QSortFilterProxyModel::match
+352 (int (*)(...))QSortFilterProxyModel::span
+360 (int (*)(...))QAbstractItemModel::roleNames
+368 (int (*)(...))QAbstractProxyModel::submit
+376 (int (*)(...))QAbstractProxyModel::revert
+384 (int (*)(...))QSortFilterProxyModel::setSourceModel
+392 (int (*)(...))QSortFilterProxyModel::mapToSource
+400 (int (*)(...))QSortFilterProxyModel::mapFromSource
+408 (int (*)(...))QSortFilterProxyModel::mapSelectionToSource
+416 (int (*)(...))QSortFilterProxyModel::mapSelectionFromSource
+424 (int (*)(...))QSortFilterProxyModel::filterAcceptsRow
+432 (int (*)(...))QSortFilterProxyModel::filterAcceptsColumn
+440 (int (*)(...))QSortFilterProxyModel::lessThan
+
+Class QSortFilterProxyModel
+ size=16 align=8
+ base size=16 base align=8
+QSortFilterProxyModel (0x0x7f5276671ea0) 0
+ vptr=((& QSortFilterProxyModel::_ZTV21QSortFilterProxyModel) + 16)
+ QAbstractProxyModel (0x0x7f5276671f08) 0
+ primary-for QSortFilterProxyModel (0x0x7f5276671ea0)
+ QAbstractItemModel (0x0x7f5276671f70) 0
+ primary-for QAbstractProxyModel (0x0x7f5276671f08)
+ QObject (0x0x7f52766efa20) 0
+ primary-for QAbstractItemModel (0x0x7f5276671f70)
+
+Class QStandardPaths
+ size=1 align=1
+ base size=0 base align=1
+QStandardPaths (0x0x7f52766efea0) 0 empty
+
+Class QState::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QState::QPrivateSignal (0x0x7f527634a7e0) 0 empty
+
+Vtable for QState
+QState::_ZTV6QState: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI6QState)
+16 (int (*)(...))QState::metaObject
+24 (int (*)(...))QState::qt_metacast
+32 (int (*)(...))QState::qt_metacall
+40 (int (*)(...))QState::~QState
+48 (int (*)(...))QState::~QState
+56 (int (*)(...))QState::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QState::onEntry
+120 (int (*)(...))QState::onExit
+
+Class QState
+ size=16 align=8
+ base size=16 base align=8
+QState (0x0x7f5276337138) 0
+ vptr=((& QState::_ZTV6QState) + 16)
+ QAbstractState (0x0x7f52763371a0) 0
+ primary-for QState (0x0x7f5276337138)
+ QObject (0x0x7f527634a780) 0
+ primary-for QAbstractState (0x0x7f52763371a0)
+
+Class QStateMachine::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QStateMachine::QPrivateSignal (0x0x7f527634ac60) 0 empty
+
+Vtable for QStateMachine::SignalEvent
+QStateMachine::SignalEvent::_ZTVN13QStateMachine11SignalEventE: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTIN13QStateMachine11SignalEventE)
+16 (int (*)(...))QStateMachine::SignalEvent::~SignalEvent
+24 (int (*)(...))QStateMachine::SignalEvent::~SignalEvent
+
+Class QStateMachine::SignalEvent
+ size=48 align=8
+ base size=48 base align=8
+QStateMachine::SignalEvent (0x0x7f5276337340) 0
+ vptr=((& QStateMachine::SignalEvent::_ZTVN13QStateMachine11SignalEventE) + 16)
+ QEvent (0x0x7f527634acc0) 0
+ primary-for QStateMachine::SignalEvent (0x0x7f5276337340)
+
+Vtable for QStateMachine::WrappedEvent
+QStateMachine::WrappedEvent::_ZTVN13QStateMachine12WrappedEventE: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTIN13QStateMachine12WrappedEventE)
+16 (int (*)(...))QStateMachine::WrappedEvent::~WrappedEvent
+24 (int (*)(...))QStateMachine::WrappedEvent::~WrappedEvent
+
+Class QStateMachine::WrappedEvent
+ size=40 align=8
+ base size=40 base align=8
+QStateMachine::WrappedEvent (0x0x7f52763373a8) 0
+ vptr=((& QStateMachine::WrappedEvent::_ZTVN13QStateMachine12WrappedEventE) + 16)
+ QEvent (0x0x7f527634ad20) 0
+ primary-for QStateMachine::WrappedEvent (0x0x7f52763373a8)
+
+Vtable for QStateMachine
+QStateMachine::_ZTV13QStateMachine: 20 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QStateMachine)
+16 (int (*)(...))QStateMachine::metaObject
+24 (int (*)(...))QStateMachine::qt_metacast
+32 (int (*)(...))QStateMachine::qt_metacall
+40 (int (*)(...))QStateMachine::~QStateMachine
+48 (int (*)(...))QStateMachine::~QStateMachine
+56 (int (*)(...))QStateMachine::event
+64 (int (*)(...))QStateMachine::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QStateMachine::onEntry
+120 (int (*)(...))QStateMachine::onExit
+128 (int (*)(...))QStateMachine::beginSelectTransitions
+136 (int (*)(...))QStateMachine::endSelectTransitions
+144 (int (*)(...))QStateMachine::beginMicrostep
+152 (int (*)(...))QStateMachine::endMicrostep
+
+Class QStateMachine
+ size=16 align=8
+ base size=16 base align=8
+QStateMachine (0x0x7f5276337208) 0
+ vptr=((& QStateMachine::_ZTV13QStateMachine) + 16)
+ QState (0x0x7f5276337270) 0
+ primary-for QStateMachine (0x0x7f5276337208)
+ QAbstractState (0x0x7f52763372d8) 0
+ primary-for QState (0x0x7f5276337270)
+ QObject (0x0x7f527634ac00) 0
+ primary-for QAbstractState (0x0x7f52763372d8)
+
+Class QStorageInfo
+ size=8 align=8
+ base size=8 base align=8
+QStorageInfo (0x0x7f52763ad180) 0
+
+Class QAbstractConcatenable
+ size=1 align=1
+ base size=0 base align=1
+QAbstractConcatenable (0x0x7f5276485f00) 0 empty
+
+Class QStringListModel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QStringListModel::QPrivateSignal (0x0x7f52761302a0) 0 empty
+
+Vtable for QStringListModel
+QStringListModel::_ZTV16QStringListModel: 48 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QStringListModel)
+16 (int (*)(...))QStringListModel::metaObject
+24 (int (*)(...))QStringListModel::qt_metacast
+32 (int (*)(...))QStringListModel::qt_metacall
+40 (int (*)(...))QStringListModel::~QStringListModel
+48 (int (*)(...))QStringListModel::~QStringListModel
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QAbstractListModel::index
+120 (int (*)(...))QAbstractListModel::parent
+128 (int (*)(...))QStringListModel::sibling
+136 (int (*)(...))QStringListModel::rowCount
+144 (int (*)(...))QAbstractListModel::columnCount
+152 (int (*)(...))QAbstractListModel::hasChildren
+160 (int (*)(...))QStringListModel::data
+168 (int (*)(...))QStringListModel::setData
+176 (int (*)(...))QAbstractItemModel::headerData
+184 (int (*)(...))QAbstractItemModel::setHeaderData
+192 (int (*)(...))QStringListModel::itemData
+200 (int (*)(...))QStringListModel::setItemData
+208 (int (*)(...))QAbstractItemModel::mimeTypes
+216 (int (*)(...))QAbstractItemModel::mimeData
+224 (int (*)(...))QAbstractItemModel::canDropMimeData
+232 (int (*)(...))QAbstractListModel::dropMimeData
+240 (int (*)(...))QStringListModel::supportedDropActions
+248 (int (*)(...))QAbstractItemModel::supportedDragActions
+256 (int (*)(...))QStringListModel::insertRows
+264 (int (*)(...))QAbstractItemModel::insertColumns
+272 (int (*)(...))QStringListModel::removeRows
+280 (int (*)(...))QAbstractItemModel::removeColumns
+288 (int (*)(...))QStringListModel::moveRows
+296 (int (*)(...))QAbstractItemModel::moveColumns
+304 (int (*)(...))QAbstractItemModel::fetchMore
+312 (int (*)(...))QAbstractItemModel::canFetchMore
+320 (int (*)(...))QStringListModel::flags
+328 (int (*)(...))QStringListModel::sort
+336 (int (*)(...))QAbstractItemModel::buddy
+344 (int (*)(...))QAbstractItemModel::match
+352 (int (*)(...))QAbstractItemModel::span
+360 (int (*)(...))QAbstractItemModel::roleNames
+368 (int (*)(...))QAbstractItemModel::submit
+376 (int (*)(...))QAbstractItemModel::revert
+
+Class QStringListModel
+ size=24 align=8
+ base size=24 base align=8
+QStringListModel (0x0x7f5276502c98) 0
+ vptr=((& QStringListModel::_ZTV16QStringListModel) + 16)
+ QAbstractListModel (0x0x7f5276502d00) 0
+ primary-for QStringListModel (0x0x7f5276502c98)
+ QAbstractItemModel (0x0x7f5276502d68) 0
+ primary-for QAbstractListModel (0x0x7f5276502d00)
+ QObject (0x0x7f5276130240) 0
+ primary-for QAbstractItemModel (0x0x7f5276502d68)
+
+Class QSystemSemaphore
+ size=8 align=8
+ base size=8 base align=8
+QSystemSemaphore (0x0x7f52761303c0) 0
+
+Class QTemporaryDir
+ size=8 align=8
+ base size=8 base align=8
+QTemporaryDir (0x0x7f5276130480) 0
+
+Class QTemporaryFile::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTemporaryFile::QPrivateSignal (0x0x7f52761305a0) 0 empty
+
+Vtable for QTemporaryFile
+QTemporaryFile::_ZTV14QTemporaryFile: 34 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QTemporaryFile)
+16 (int (*)(...))QTemporaryFile::metaObject
+24 (int (*)(...))QTemporaryFile::qt_metacast
+32 (int (*)(...))QTemporaryFile::qt_metacall
+40 (int (*)(...))QTemporaryFile::~QTemporaryFile
+48 (int (*)(...))QTemporaryFile::~QTemporaryFile
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QFileDevice::isSequential
+120 (int (*)(...))QTemporaryFile::open
+128 (int (*)(...))QFileDevice::close
+136 (int (*)(...))QFileDevice::pos
+144 (int (*)(...))QFile::size
+152 (int (*)(...))QFileDevice::seek
+160 (int (*)(...))QFileDevice::atEnd
+168 (int (*)(...))QIODevice::reset
+176 (int (*)(...))QIODevice::bytesAvailable
+184 (int (*)(...))QIODevice::bytesToWrite
+192 (int (*)(...))QIODevice::canReadLine
+200 (int (*)(...))QIODevice::waitForReadyRead
+208 (int (*)(...))QIODevice::waitForBytesWritten
+216 (int (*)(...))QFileDevice::readData
+224 (int (*)(...))QFileDevice::readLineData
+232 (int (*)(...))QFileDevice::writeData
+240 (int (*)(...))QTemporaryFile::fileName
+248 (int (*)(...))QFile::resize
+256 (int (*)(...))QFile::permissions
+264 (int (*)(...))QFile::setPermissions
+
+Class QTemporaryFile
+ size=16 align=8
+ base size=16 base align=8
+QTemporaryFile (0x0x7f5276502dd0) 0
+ vptr=((& QTemporaryFile::_ZTV14QTemporaryFile) + 16)
+ QFile (0x0x7f5276502e38) 0
+ primary-for QTemporaryFile (0x0x7f5276502dd0)
+ QFileDevice (0x0x7f5276502ea0) 0
+ primary-for QFile (0x0x7f5276502e38)
+ QIODevice (0x0x7f5276502f08) 0
+ primary-for QFileDevice (0x0x7f5276502ea0)
+ QObject (0x0x7f5276130540) 0
+ primary-for QIODevice (0x0x7f5276502f08)
+
+Class QTextBoundaryFinder
+ size=48 align=8
+ base size=48 base align=8
+QTextBoundaryFinder (0x0x7f5276130900) 0
+
+Class QTextCodec::ConverterState
+ size=32 align=8
+ base size=32 base align=8
+QTextCodec::ConverterState (0x0x7f52761ab180) 0
+
+Vtable for QTextCodec
+QTextCodec::_ZTV10QTextCodec: 9 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QTextCodec)
+16 (int (*)(...))__cxa_pure_virtual
+24 (int (*)(...))QTextCodec::aliases
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+56 0
+64 0
+
+Class QTextCodec
+ size=8 align=8
+ base size=8 base align=8
+QTextCodec (0x0x7f52761ab120) 0 nearly-empty
+ vptr=((& QTextCodec::_ZTV10QTextCodec) + 16)
+
+Class QTextEncoder
+ size=40 align=8
+ base size=40 base align=8
+QTextEncoder (0x0x7f52761abb40) 0
+
+Class QTextDecoder
+ size=40 align=8
+ base size=40 base align=8
+QTextDecoder (0x0x7f52761abd20) 0
+
+Vtable for std::thread::_State
+std::thread::_State::_ZTVNSt6thread6_StateE: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTINSt6thread6_StateE)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+
+Class std::thread::_State
+ size=8 align=8
+ base size=8 base align=8
+std::thread::_State (0x0x7f52761abf60) 0 nearly-empty
+ vptr=((& std::thread::_State::_ZTVNSt6thread6_StateE) + 16)
+
+Class std::thread::id
+ size=8 align=8
+ base size=8 base align=8
+std::thread::id (0x0x7f5276206000) 0
+
+Class std::thread
+ size=8 align=8
+ base size=8 base align=8
+std::thread (0x0x7f52761abf00) 0
+
+Class std::condition_variable
+ size=48 align=8
+ base size=48 base align=8
+std::condition_variable (0x0x7f52760983c0) 0
+
+Class std::__at_thread_exit_elt
+ size=16 align=8
+ base size=16 base align=8
+std::__at_thread_exit_elt (0x0x7f5276098780) 0
+
+Class std::_V2::condition_variable_any
+ size=64 align=8
+ base size=64 base align=8
+std::_V2::condition_variable_any (0x0x7f52760987e0) 0
+
+Class std::__atomic_futex_unsigned_base
+ size=1 align=1
+ base size=0 base align=1
+std::__atomic_futex_unsigned_base (0x0x7f5275e1fae0) 0 empty
+
+Vtable for std::future_error
+std::future_error::_ZTVSt12future_error: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTISt12future_error)
+16 (int (*)(...))std::future_error::~future_error
+24 (int (*)(...))std::future_error::~future_error
+32 (int (*)(...))std::future_error::what
+
+Class std::future_error
+ size=32 align=8
+ base size=32 base align=8
+std::future_error (0x0x7f5275e2a2d8) 0
+ vptr=((& std::future_error::_ZTVSt12future_error) + 16)
+ std::logic_error (0x0x7f5275e2a340) 0
+ primary-for std::future_error (0x0x7f5275e2a2d8)
+ std::exception (0x0x7f5275e50240) 0 nearly-empty
+ primary-for std::logic_error (0x0x7f5275e2a340)
+
+Class std::__future_base::_Result_base::_Deleter
+ size=1 align=1
+ base size=0 base align=1
+std::__future_base::_Result_base::_Deleter (0x0x7f5275e50960) 0 empty
+
+Vtable for std::__future_base::_Result_base
+std::__future_base::_Result_base::_ZTVNSt13__future_base12_Result_baseE: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTINSt13__future_base12_Result_baseE)
+16 (int (*)(...))__cxa_pure_virtual
+24 0
+32 0
+
+Class std::__future_base::_Result_base
+ size=16 align=8
+ base size=16 base align=8
+std::__future_base::_Result_base (0x0x7f5275e50900) 0
+ vptr=((& std::__future_base::_Result_base::_ZTVNSt13__future_base12_Result_baseE) + 16)
+
+Class std::__future_base::_State_baseV2::__exception_ptr_tag
+ size=1 align=1
+ base size=0 base align=1
+std::__future_base::_State_baseV2::__exception_ptr_tag (0x0x7f5275c650c0) 0 empty
+
+Class std::__future_base::_State_baseV2::_Make_ready
+ size=32 align=8
+ base size=32 base align=8
+std::__future_base::_State_baseV2::_Make_ready (0x0x7f5275c1fb60) 0
+ std::__at_thread_exit_elt (0x0x7f5275c65180) 0
+
+Vtable for std::__future_base::_State_baseV2
+std::__future_base::_State_baseV2::_ZTVNSt13__future_base13_State_baseV2E: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTINSt13__future_base13_State_baseV2E)
+16 (int (*)(...))std::__future_base::_State_baseV2::~_State_baseV2
+24 (int (*)(...))std::__future_base::_State_baseV2::~_State_baseV2
+32 (int (*)(...))std::__future_base::_State_baseV2::_M_complete_async
+40 (int (*)(...))std::__future_base::_State_baseV2::_M_is_deferred_future
+
+Class std::__future_base::_State_baseV2
+ size=32 align=8
+ base size=28 base align=8
+std::__future_base::_State_baseV2 (0x0x7f5275e50ae0) 0
+ vptr=((& std::__future_base::_State_baseV2::_ZTVNSt13__future_base13_State_baseV2E) + 16)
+
+Class std::__future_base
+ size=1 align=1
+ base size=0 base align=1
+std::__future_base (0x0x7f5275e508a0) 0 empty
+
+Vtable for std::__future_base::_Async_state_commonV2
+std::__future_base::_Async_state_commonV2::_ZTVNSt13__future_base21_Async_state_commonV2E: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTINSt13__future_base21_Async_state_commonV2E)
+16 (int (*)(...))std::__future_base::_Async_state_commonV2::~_Async_state_commonV2
+24 (int (*)(...))std::__future_base::_Async_state_commonV2::~_Async_state_commonV2
+32 (int (*)(...))std::__future_base::_Async_state_commonV2::_M_complete_async
+40 (int (*)(...))std::__future_base::_State_baseV2::_M_is_deferred_future
+
+Class std::__future_base::_Async_state_commonV2
+ size=48 align=8
+ base size=44 base align=8
+std::__future_base::_Async_state_commonV2 (0x0x7f5275390e38) 0
+ vptr=((& std::__future_base::_Async_state_commonV2::_ZTVNSt13__future_base21_Async_state_commonV2E) + 16)
+ std::__future_base::_State_baseV2 (0x0x7f52753b9d20) 0
+ primary-for std::__future_base::_Async_state_commonV2 (0x0x7f5275390e38)
+
+Class QThread::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QThread::QPrivateSignal (0x0x7f52753f6600) 0 empty
+
+Vtable for QThread
+QThread::_ZTV7QThread: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI7QThread)
+16 (int (*)(...))QThread::metaObject
+24 (int (*)(...))QThread::qt_metacast
+32 (int (*)(...))QThread::qt_metacall
+40 (int (*)(...))QThread::~QThread
+48 (int (*)(...))QThread::~QThread
+56 (int (*)(...))QThread::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QThread::run
+
+Class QThread
+ size=16 align=8
+ base size=16 base align=8
+QThread (0x0x7f52753fc1a0) 0
+ vptr=((& QThread::_ZTV7QThread) + 16)
+ QObject (0x0x7f52753f65a0) 0
+ primary-for QThread (0x0x7f52753fc1a0)
+
+Class QThreadPool::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QThreadPool::QPrivateSignal (0x0x7f52753f69c0) 0 empty
+
+Vtable for QThreadPool
+QThreadPool::_ZTV11QThreadPool: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QThreadPool)
+16 (int (*)(...))QThreadPool::metaObject
+24 (int (*)(...))QThreadPool::qt_metacast
+32 (int (*)(...))QThreadPool::qt_metacall
+40 (int (*)(...))QThreadPool::~QThreadPool
+48 (int (*)(...))QThreadPool::~QThreadPool
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QThreadPool
+ size=16 align=8
+ base size=16 base align=8
+QThreadPool (0x0x7f52753fc208) 0
+ vptr=((& QThreadPool::_ZTV11QThreadPool) + 16)
+ QObject (0x0x7f52753f6960) 0
+ primary-for QThreadPool (0x0x7f52753fc208)
+
+Class QThreadStorageData
+ size=4 align=4
+ base size=4 base align=4
+QThreadStorageData (0x0x7f52753f6ba0) 0
+
+Class QTimeLine::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTimeLine::QPrivateSignal (0x0x7f527543f2a0) 0 empty
+
+Vtable for QTimeLine
+QTimeLine::_ZTV9QTimeLine: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QTimeLine)
+16 (int (*)(...))QTimeLine::metaObject
+24 (int (*)(...))QTimeLine::qt_metacast
+32 (int (*)(...))QTimeLine::qt_metacall
+40 (int (*)(...))QTimeLine::~QTimeLine
+48 (int (*)(...))QTimeLine::~QTimeLine
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QTimeLine::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QTimeLine::valueForTime
+
+Class QTimeLine
+ size=16 align=8
+ base size=16 base align=8
+QTimeLine (0x0x7f52753fc270) 0
+ vptr=((& QTimeLine::_ZTV9QTimeLine) + 16)
+ QObject (0x0x7f527543f240) 0
+ primary-for QTimeLine (0x0x7f52753fc270)
+
+Class QTimer::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTimer::QPrivateSignal (0x0x7f527543f4e0) 0 empty
+
+Vtable for QTimer
+QTimer::_ZTV6QTimer: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI6QTimer)
+16 (int (*)(...))QTimer::metaObject
+24 (int (*)(...))QTimer::qt_metacast
+32 (int (*)(...))QTimer::qt_metacall
+40 (int (*)(...))QTimer::~QTimer
+48 (int (*)(...))QTimer::~QTimer
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QTimer::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QTimer
+ size=32 align=8
+ base size=29 base align=8
+QTimer (0x0x7f52753fc2d8) 0
+ vptr=((& QTimer::_ZTV6QTimer) + 16)
+ QObject (0x0x7f527543f480) 0
+ primary-for QTimer (0x0x7f52753fc2d8)
+
+Class QTimeZone::OffsetData
+ size=32 align=8
+ base size=28 base align=8
+QTimeZone::OffsetData (0x0x7f5275484e40) 0
+
+Class QTimeZone
+ size=8 align=8
+ base size=8 base align=8
+QTimeZone (0x0x7f5275484de0) 0
+
+Class QTranslator::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTranslator::QPrivateSignal (0x0x7f5275523f00) 0 empty
+
+Vtable for QTranslator
+QTranslator::_ZTV11QTranslator: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QTranslator)
+16 (int (*)(...))QTranslator::metaObject
+24 (int (*)(...))QTranslator::qt_metacast
+32 (int (*)(...))QTranslator::qt_metacall
+40 (int (*)(...))QTranslator::~QTranslator
+48 (int (*)(...))QTranslator::~QTranslator
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QTranslator::translate
+120 (int (*)(...))QTranslator::isEmpty
+
+Class QTranslator
+ size=16 align=8
+ base size=16 base align=8
+QTranslator (0x0x7f52751329c0) 0
+ vptr=((& QTranslator::_ZTV11QTranslator) + 16)
+ QObject (0x0x7f5275523ea0) 0
+ primary-for QTranslator (0x0x7f52751329c0)
+
+Class QTransposeProxyModel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTransposeProxyModel::QPrivateSignal (0x0x7f527514e180) 0 empty
+
+Vtable for QTransposeProxyModel
+QTransposeProxyModel::_ZTV20QTransposeProxyModel: 53 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QTransposeProxyModel)
+16 (int (*)(...))QTransposeProxyModel::metaObject
+24 (int (*)(...))QTransposeProxyModel::qt_metacast
+32 (int (*)(...))QTransposeProxyModel::qt_metacall
+40 (int (*)(...))QTransposeProxyModel::~QTransposeProxyModel
+48 (int (*)(...))QTransposeProxyModel::~QTransposeProxyModel
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QTransposeProxyModel::index
+120 (int (*)(...))QTransposeProxyModel::parent
+128 (int (*)(...))QAbstractProxyModel::sibling
+136 (int (*)(...))QTransposeProxyModel::rowCount
+144 (int (*)(...))QTransposeProxyModel::columnCount
+152 (int (*)(...))QAbstractProxyModel::hasChildren
+160 (int (*)(...))QAbstractProxyModel::data
+168 (int (*)(...))QAbstractProxyModel::setData
+176 (int (*)(...))QTransposeProxyModel::headerData
+184 (int (*)(...))QTransposeProxyModel::setHeaderData
+192 (int (*)(...))QTransposeProxyModel::itemData
+200 (int (*)(...))QTransposeProxyModel::setItemData
+208 (int (*)(...))QAbstractProxyModel::mimeTypes
+216 (int (*)(...))QAbstractProxyModel::mimeData
+224 (int (*)(...))QAbstractProxyModel::canDropMimeData
+232 (int (*)(...))QAbstractProxyModel::dropMimeData
+240 (int (*)(...))QAbstractProxyModel::supportedDropActions
+248 (int (*)(...))QAbstractProxyModel::supportedDragActions
+256 (int (*)(...))QTransposeProxyModel::insertRows
+264 (int (*)(...))QTransposeProxyModel::insertColumns
+272 (int (*)(...))QTransposeProxyModel::removeRows
+280 (int (*)(...))QTransposeProxyModel::removeColumns
+288 (int (*)(...))QTransposeProxyModel::moveRows
+296 (int (*)(...))QTransposeProxyModel::moveColumns
+304 (int (*)(...))QAbstractProxyModel::fetchMore
+312 (int (*)(...))QAbstractProxyModel::canFetchMore
+320 (int (*)(...))QAbstractProxyModel::flags
+328 (int (*)(...))QTransposeProxyModel::sort
+336 (int (*)(...))QAbstractProxyModel::buddy
+344 (int (*)(...))QAbstractItemModel::match
+352 (int (*)(...))QTransposeProxyModel::span
+360 (int (*)(...))QAbstractItemModel::roleNames
+368 (int (*)(...))QAbstractProxyModel::submit
+376 (int (*)(...))QAbstractProxyModel::revert
+384 (int (*)(...))QTransposeProxyModel::setSourceModel
+392 (int (*)(...))QTransposeProxyModel::mapToSource
+400 (int (*)(...))QTransposeProxyModel::mapFromSource
+408 (int (*)(...))QAbstractProxyModel::mapSelectionToSource
+416 (int (*)(...))QAbstractProxyModel::mapSelectionFromSource
+
+Class QTransposeProxyModel
+ size=16 align=8
+ base size=16 base align=8
+QTransposeProxyModel (0x0x7f5275132a28) 0
+ vptr=((& QTransposeProxyModel::_ZTV20QTransposeProxyModel) + 16)
+ QAbstractProxyModel (0x0x7f5275132a90) 0
+ primary-for QTransposeProxyModel (0x0x7f5275132a28)
+ QAbstractItemModel (0x0x7f5275132af8) 0
+ primary-for QAbstractProxyModel (0x0x7f5275132a90)
+ QObject (0x0x7f527514e120) 0
+ primary-for QAbstractItemModel (0x0x7f5275132af8)
+
+Class QUrlQuery
+ size=8 align=8
+ base size=8 base align=8
+QUrlQuery (0x0x7f527514e360) 0
+
+Class QWaitCondition
+ size=8 align=8
+ base size=8 base align=8
+QWaitCondition (0x0x7f5275242840) 0
+
+Class QXmlStreamStringRef
+ size=16 align=8
+ base size=16 base align=8
+QXmlStreamStringRef (0x0x7f5275242960) 0
+
+Class QXmlStreamAttribute
+ size=80 align=8
+ base size=73 base align=8
+QXmlStreamAttribute (0x0x7f52752d2d20) 0
+
+Class QXmlStreamAttributes
+ size=8 align=8
+ base size=8 base align=8
+QXmlStreamAttributes (0x0x7f5274f3ddd0) 0
+ QVector<QXmlStreamAttribute> (0x0x7f5274f4e480) 0
+
+Class QXmlStreamNamespaceDeclaration
+ size=40 align=8
+ base size=40 base align=8
+QXmlStreamNamespaceDeclaration (0x0x7f5274f4e780) 0
+
+Class QXmlStreamNotationDeclaration
+ size=56 align=8
+ base size=56 base align=8
+QXmlStreamNotationDeclaration (0x0x7f5274fd8720) 0
+
+Class QXmlStreamEntityDeclaration
+ size=88 align=8
+ base size=88 base align=8
+QXmlStreamEntityDeclaration (0x0x7f5275033720) 0
+
+Vtable for QXmlStreamEntityResolver
+QXmlStreamEntityResolver::_ZTV24QXmlStreamEntityResolver: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI24QXmlStreamEntityResolver)
+16 (int (*)(...))QXmlStreamEntityResolver::~QXmlStreamEntityResolver
+24 (int (*)(...))QXmlStreamEntityResolver::~QXmlStreamEntityResolver
+32 (int (*)(...))QXmlStreamEntityResolver::resolveEntity
+40 (int (*)(...))QXmlStreamEntityResolver::resolveUndeclaredEntity
+
+Class QXmlStreamEntityResolver
+ size=8 align=8
+ base size=8 base align=8
+QXmlStreamEntityResolver (0x0x7f52750a07e0) 0 nearly-empty
+ vptr=((& QXmlStreamEntityResolver::_ZTV24QXmlStreamEntityResolver) + 16)
+
+Class QXmlStreamReader
+ size=8 align=8
+ base size=8 base align=8
+QXmlStreamReader (0x0x7f52750a0840) 0
+
+Class QXmlStreamWriter
+ size=8 align=8
+ base size=8 base align=8
+QXmlStreamWriter (0x0x7f52750f4720) 0
+
+Class QRgba64
+ size=8 align=8
+ base size=8 base align=8
+QRgba64 (0x0x7f52750f4d20) 0
+
+Class QColor::CT
+ size=10 align=2
+ base size=10 base align=2
+QColor::CT (0x0x7f5274db5de0) 0
+
+Class QColor
+ size=16 align=4
+ base size=14 base align=4
+QColor (0x0x7f5274db5d80) 0
+
+Class QRegion::QRegionData
+ size=16 align=8
+ base size=16 base align=8
+QRegion::QRegionData (0x0x7f5274e75cc0) 0
+
+Class QRegion
+ size=8 align=8
+ base size=8 base align=8
+QRegion (0x0x7f5274e75c60) 0
+
+Class QKeySequence
+ size=8 align=8
+ base size=8 base align=8
+QKeySequence (0x0x7f5274c00900) 0
+
+Class QVector2D
+ size=8 align=4
+ base size=8 base align=4
+QVector2D (0x0x7f5274cea480) 0
+
+Class QTouchDevice
+ size=8 align=8
+ base size=8 base align=8
+QTouchDevice (0x0x7f527495a540) 0
+
+Vtable for QInputEvent
+QInputEvent::_ZTV11QInputEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QInputEvent)
+16 (int (*)(...))QInputEvent::~QInputEvent
+24 (int (*)(...))QInputEvent::~QInputEvent
+
+Class QInputEvent
+ size=32 align=8
+ base size=32 base align=8
+QInputEvent (0x0x7f527493b4e0) 0
+ vptr=((& QInputEvent::_ZTV11QInputEvent) + 16)
+ QEvent (0x0x7f527495ade0) 0
+ primary-for QInputEvent (0x0x7f527493b4e0)
+
+Vtable for QEnterEvent
+QEnterEvent::_ZTV11QEnterEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QEnterEvent)
+16 (int (*)(...))QEnterEvent::~QEnterEvent
+24 (int (*)(...))QEnterEvent::~QEnterEvent
+
+Class QEnterEvent
+ size=72 align=8
+ base size=72 base align=8
+QEnterEvent (0x0x7f527493b548) 0
+ vptr=((& QEnterEvent::_ZTV11QEnterEvent) + 16)
+ QEvent (0x0x7f52749ad000) 0
+ primary-for QEnterEvent (0x0x7f527493b548)
+
+Vtable for QMouseEvent
+QMouseEvent::_ZTV11QMouseEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QMouseEvent)
+16 (int (*)(...))QMouseEvent::~QMouseEvent
+24 (int (*)(...))QMouseEvent::~QMouseEvent
+
+Class QMouseEvent
+ size=104 align=8
+ base size=100 base align=8
+QMouseEvent (0x0x7f527493b5b0) 0
+ vptr=((& QMouseEvent::_ZTV11QMouseEvent) + 16)
+ QInputEvent (0x0x7f527493b618) 0
+ primary-for QMouseEvent (0x0x7f527493b5b0)
+ QEvent (0x0x7f52749ad3c0) 0
+ primary-for QInputEvent (0x0x7f527493b618)
+
+Vtable for QHoverEvent
+QHoverEvent::_ZTV11QHoverEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QHoverEvent)
+16 (int (*)(...))QHoverEvent::~QHoverEvent
+24 (int (*)(...))QHoverEvent::~QHoverEvent
+
+Class QHoverEvent
+ size=64 align=8
+ base size=64 base align=8
+QHoverEvent (0x0x7f527493b680) 0
+ vptr=((& QHoverEvent::_ZTV11QHoverEvent) + 16)
+ QInputEvent (0x0x7f527493b6e8) 0
+ primary-for QHoverEvent (0x0x7f527493b680)
+ QEvent (0x0x7f52749ad8a0) 0
+ primary-for QInputEvent (0x0x7f527493b6e8)
+
+Vtable for QWheelEvent
+QWheelEvent::_ZTV11QWheelEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QWheelEvent)
+16 (int (*)(...))QWheelEvent::~QWheelEvent
+24 (int (*)(...))QWheelEvent::~QWheelEvent
+
+Class QWheelEvent
+ size=96 align=8
+ base size=96 base align=8
+QWheelEvent (0x0x7f527493b750) 0
+ vptr=((& QWheelEvent::_ZTV11QWheelEvent) + 16)
+ QInputEvent (0x0x7f527493b7b8) 0
+ primary-for QWheelEvent (0x0x7f527493b750)
+ QEvent (0x0x7f52749ada80) 0
+ primary-for QInputEvent (0x0x7f527493b7b8)
+
+Vtable for QTabletEvent
+QTabletEvent::_ZTV12QTabletEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QTabletEvent)
+16 (int (*)(...))QTabletEvent::~QTabletEvent
+24 (int (*)(...))QTabletEvent::~QTabletEvent
+
+Class QTabletEvent
+ size=128 align=8
+ base size=128 base align=8
+QTabletEvent (0x0x7f527493b820) 0
+ vptr=((& QTabletEvent::_ZTV12QTabletEvent) + 16)
+ QInputEvent (0x0x7f527493b888) 0
+ primary-for QTabletEvent (0x0x7f527493b820)
+ QEvent (0x0x7f52749f01e0) 0
+ primary-for QInputEvent (0x0x7f527493b888)
+
+Vtable for QNativeGestureEvent
+QNativeGestureEvent::_ZTV19QNativeGestureEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QNativeGestureEvent)
+16 (int (*)(...))QNativeGestureEvent::~QNativeGestureEvent
+24 (int (*)(...))QNativeGestureEvent::~QNativeGestureEvent
+
+Class QNativeGestureEvent
+ size=112 align=8
+ base size=112 base align=8
+QNativeGestureEvent (0x0x7f527493b8f0) 0
+ vptr=((& QNativeGestureEvent::_ZTV19QNativeGestureEvent) + 16)
+ QInputEvent (0x0x7f527493b958) 0
+ primary-for QNativeGestureEvent (0x0x7f527493b8f0)
+ QEvent (0x0x7f52749f0b40) 0
+ primary-for QInputEvent (0x0x7f527493b958)
+
+Vtable for QKeyEvent
+QKeyEvent::_ZTV9QKeyEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QKeyEvent)
+16 (int (*)(...))QKeyEvent::~QKeyEvent
+24 (int (*)(...))QKeyEvent::~QKeyEvent
+
+Class QKeyEvent
+ size=64 align=8
+ base size=59 base align=8
+QKeyEvent (0x0x7f527493b9c0) 0
+ vptr=((& QKeyEvent::_ZTV9QKeyEvent) + 16)
+ QInputEvent (0x0x7f527493ba28) 0
+ primary-for QKeyEvent (0x0x7f527493b9c0)
+ QEvent (0x0x7f52749f0e40) 0
+ primary-for QInputEvent (0x0x7f527493ba28)
+
+Vtable for QFocusEvent
+QFocusEvent::_ZTV11QFocusEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QFocusEvent)
+16 (int (*)(...))QFocusEvent::~QFocusEvent
+24 (int (*)(...))QFocusEvent::~QFocusEvent
+
+Class QFocusEvent
+ size=24 align=8
+ base size=24 base align=8
+QFocusEvent (0x0x7f527493ba90) 0
+ vptr=((& QFocusEvent::_ZTV11QFocusEvent) + 16)
+ QEvent (0x0x7f5274a26180) 0
+ primary-for QFocusEvent (0x0x7f527493ba90)
+
+Vtable for QPaintEvent
+QPaintEvent::_ZTV11QPaintEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QPaintEvent)
+16 (int (*)(...))QPaintEvent::~QPaintEvent
+24 (int (*)(...))QPaintEvent::~QPaintEvent
+
+Class QPaintEvent
+ size=56 align=8
+ base size=49 base align=8
+QPaintEvent (0x0x7f527493baf8) 0
+ vptr=((& QPaintEvent::_ZTV11QPaintEvent) + 16)
+ QEvent (0x0x7f5274a262a0) 0
+ primary-for QPaintEvent (0x0x7f527493baf8)
+
+Vtable for QMoveEvent
+QMoveEvent::_ZTV10QMoveEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QMoveEvent)
+16 (int (*)(...))QMoveEvent::~QMoveEvent
+24 (int (*)(...))QMoveEvent::~QMoveEvent
+
+Class QMoveEvent
+ size=40 align=8
+ base size=36 base align=8
+QMoveEvent (0x0x7f527493bb60) 0
+ vptr=((& QMoveEvent::_ZTV10QMoveEvent) + 16)
+ QEvent (0x0x7f5274a263c0) 0
+ primary-for QMoveEvent (0x0x7f527493bb60)
+
+Vtable for QExposeEvent
+QExposeEvent::_ZTV12QExposeEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QExposeEvent)
+16 (int (*)(...))QExposeEvent::~QExposeEvent
+24 (int (*)(...))QExposeEvent::~QExposeEvent
+
+Class QExposeEvent
+ size=32 align=8
+ base size=32 base align=8
+QExposeEvent (0x0x7f527493bbc8) 0
+ vptr=((& QExposeEvent::_ZTV12QExposeEvent) + 16)
+ QEvent (0x0x7f5274a264e0) 0
+ primary-for QExposeEvent (0x0x7f527493bbc8)
+
+Vtable for QPlatformSurfaceEvent
+QPlatformSurfaceEvent::_ZTV21QPlatformSurfaceEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI21QPlatformSurfaceEvent)
+16 (int (*)(...))QPlatformSurfaceEvent::~QPlatformSurfaceEvent
+24 (int (*)(...))QPlatformSurfaceEvent::~QPlatformSurfaceEvent
+
+Class QPlatformSurfaceEvent
+ size=24 align=8
+ base size=24 base align=8
+QPlatformSurfaceEvent (0x0x7f527493bc30) 0
+ vptr=((& QPlatformSurfaceEvent::_ZTV21QPlatformSurfaceEvent) + 16)
+ QEvent (0x0x7f5274a265a0) 0
+ primary-for QPlatformSurfaceEvent (0x0x7f527493bc30)
+
+Vtable for QResizeEvent
+QResizeEvent::_ZTV12QResizeEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QResizeEvent)
+16 (int (*)(...))QResizeEvent::~QResizeEvent
+24 (int (*)(...))QResizeEvent::~QResizeEvent
+
+Class QResizeEvent
+ size=40 align=8
+ base size=36 base align=8
+QResizeEvent (0x0x7f527493bc98) 0
+ vptr=((& QResizeEvent::_ZTV12QResizeEvent) + 16)
+ QEvent (0x0x7f5274a26660) 0
+ primary-for QResizeEvent (0x0x7f527493bc98)
+
+Vtable for QCloseEvent
+QCloseEvent::_ZTV11QCloseEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QCloseEvent)
+16 (int (*)(...))QCloseEvent::~QCloseEvent
+24 (int (*)(...))QCloseEvent::~QCloseEvent
+
+Class QCloseEvent
+ size=24 align=8
+ base size=20 base align=8
+QCloseEvent (0x0x7f527493bd00) 0
+ vptr=((& QCloseEvent::_ZTV11QCloseEvent) + 16)
+ QEvent (0x0x7f5274a26780) 0
+ primary-for QCloseEvent (0x0x7f527493bd00)
+
+Vtable for QIconDragEvent
+QIconDragEvent::_ZTV14QIconDragEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QIconDragEvent)
+16 (int (*)(...))QIconDragEvent::~QIconDragEvent
+24 (int (*)(...))QIconDragEvent::~QIconDragEvent
+
+Class QIconDragEvent
+ size=24 align=8
+ base size=20 base align=8
+QIconDragEvent (0x0x7f527493bd68) 0
+ vptr=((& QIconDragEvent::_ZTV14QIconDragEvent) + 16)
+ QEvent (0x0x7f5274a267e0) 0
+ primary-for QIconDragEvent (0x0x7f527493bd68)
+
+Vtable for QShowEvent
+QShowEvent::_ZTV10QShowEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QShowEvent)
+16 (int (*)(...))QShowEvent::~QShowEvent
+24 (int (*)(...))QShowEvent::~QShowEvent
+
+Class QShowEvent
+ size=24 align=8
+ base size=20 base align=8
+QShowEvent (0x0x7f527493bdd0) 0
+ vptr=((& QShowEvent::_ZTV10QShowEvent) + 16)
+ QEvent (0x0x7f5274a26840) 0
+ primary-for QShowEvent (0x0x7f527493bdd0)
+
+Vtable for QHideEvent
+QHideEvent::_ZTV10QHideEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QHideEvent)
+16 (int (*)(...))QHideEvent::~QHideEvent
+24 (int (*)(...))QHideEvent::~QHideEvent
+
+Class QHideEvent
+ size=24 align=8
+ base size=20 base align=8
+QHideEvent (0x0x7f527493be38) 0
+ vptr=((& QHideEvent::_ZTV10QHideEvent) + 16)
+ QEvent (0x0x7f5274a268a0) 0
+ primary-for QHideEvent (0x0x7f527493be38)
+
+Vtable for QContextMenuEvent
+QContextMenuEvent::_ZTV17QContextMenuEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QContextMenuEvent)
+16 (int (*)(...))QContextMenuEvent::~QContextMenuEvent
+24 (int (*)(...))QContextMenuEvent::~QContextMenuEvent
+
+Class QContextMenuEvent
+ size=56 align=8
+ base size=49 base align=8
+QContextMenuEvent (0x0x7f527493bea0) 0
+ vptr=((& QContextMenuEvent::_ZTV17QContextMenuEvent) + 16)
+ QInputEvent (0x0x7f527493bf08) 0
+ primary-for QContextMenuEvent (0x0x7f527493bea0)
+ QEvent (0x0x7f5274a26900) 0
+ primary-for QInputEvent (0x0x7f527493bf08)
+
+Class QInputMethodEvent::Attribute
+ size=32 align=8
+ base size=32 base align=8
+QInputMethodEvent::Attribute (0x0x7f5274a26c60) 0
+
+Vtable for QInputMethodEvent
+QInputMethodEvent::_ZTV17QInputMethodEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QInputMethodEvent)
+16 (int (*)(...))QInputMethodEvent::~QInputMethodEvent
+24 (int (*)(...))QInputMethodEvent::~QInputMethodEvent
+
+Class QInputMethodEvent
+ size=56 align=8
+ base size=56 base align=8
+QInputMethodEvent (0x0x7f527493bf70) 0
+ vptr=((& QInputMethodEvent::_ZTV17QInputMethodEvent) + 16)
+ QEvent (0x0x7f5274a26c00) 0
+ primary-for QInputMethodEvent (0x0x7f527493bf70)
+
+Class QInputMethodQueryEvent::QueryPair
+ size=24 align=8
+ base size=24 base align=8
+QInputMethodQueryEvent::QueryPair (0x0x7f5274ae9000) 0
+
+Vtable for QInputMethodQueryEvent
+QInputMethodQueryEvent::_ZTV22QInputMethodQueryEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI22QInputMethodQueryEvent)
+16 (int (*)(...))QInputMethodQueryEvent::~QInputMethodQueryEvent
+24 (int (*)(...))QInputMethodQueryEvent::~QInputMethodQueryEvent
+
+Class QInputMethodQueryEvent
+ size=32 align=8
+ base size=32 base align=8
+QInputMethodQueryEvent (0x0x7f5274ae51a0) 0
+ vptr=((& QInputMethodQueryEvent::_ZTV22QInputMethodQueryEvent) + 16)
+ QEvent (0x0x7f5274ac6f60) 0
+ primary-for QInputMethodQueryEvent (0x0x7f5274ae51a0)
+
+Vtable for QDropEvent
+QDropEvent::_ZTV10QDropEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QDropEvent)
+16 (int (*)(...))QDropEvent::~QDropEvent
+24 (int (*)(...))QDropEvent::~QDropEvent
+
+Class QDropEvent
+ size=72 align=8
+ base size=72 base align=8
+QDropEvent (0x0x7f527475c270) 0
+ vptr=((& QDropEvent::_ZTV10QDropEvent) + 16)
+ QEvent (0x0x7f5274743d20) 0
+ primary-for QDropEvent (0x0x7f527475c270)
+
+Vtable for QDragMoveEvent
+QDragMoveEvent::_ZTV14QDragMoveEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QDragMoveEvent)
+16 (int (*)(...))QDragMoveEvent::~QDragMoveEvent
+24 (int (*)(...))QDragMoveEvent::~QDragMoveEvent
+
+Class QDragMoveEvent
+ size=88 align=8
+ base size=88 base align=8
+QDragMoveEvent (0x0x7f527475c2d8) 0
+ vptr=((& QDragMoveEvent::_ZTV14QDragMoveEvent) + 16)
+ QDropEvent (0x0x7f527475c340) 0
+ primary-for QDragMoveEvent (0x0x7f527475c2d8)
+ QEvent (0x0x7f527476f120) 0
+ primary-for QDropEvent (0x0x7f527475c340)
+
+Vtable for QDragEnterEvent
+QDragEnterEvent::_ZTV15QDragEnterEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QDragEnterEvent)
+16 (int (*)(...))QDragEnterEvent::~QDragEnterEvent
+24 (int (*)(...))QDragEnterEvent::~QDragEnterEvent
+
+Class QDragEnterEvent
+ size=88 align=8
+ base size=88 base align=8
+QDragEnterEvent (0x0x7f527475c3a8) 0
+ vptr=((& QDragEnterEvent::_ZTV15QDragEnterEvent) + 16)
+ QDragMoveEvent (0x0x7f527475c410) 0
+ primary-for QDragEnterEvent (0x0x7f527475c3a8)
+ QDropEvent (0x0x7f527475c478) 0
+ primary-for QDragMoveEvent (0x0x7f527475c410)
+ QEvent (0x0x7f527476f360) 0
+ primary-for QDropEvent (0x0x7f527475c478)
+
+Vtable for QDragLeaveEvent
+QDragLeaveEvent::_ZTV15QDragLeaveEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QDragLeaveEvent)
+16 (int (*)(...))QDragLeaveEvent::~QDragLeaveEvent
+24 (int (*)(...))QDragLeaveEvent::~QDragLeaveEvent
+
+Class QDragLeaveEvent
+ size=24 align=8
+ base size=20 base align=8
+QDragLeaveEvent (0x0x7f527475c4e0) 0
+ vptr=((& QDragLeaveEvent::_ZTV15QDragLeaveEvent) + 16)
+ QEvent (0x0x7f527476f3c0) 0
+ primary-for QDragLeaveEvent (0x0x7f527475c4e0)
+
+Vtable for QHelpEvent
+QHelpEvent::_ZTV10QHelpEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QHelpEvent)
+16 (int (*)(...))QHelpEvent::~QHelpEvent
+24 (int (*)(...))QHelpEvent::~QHelpEvent
+
+Class QHelpEvent
+ size=40 align=8
+ base size=36 base align=8
+QHelpEvent (0x0x7f527475c548) 0
+ vptr=((& QHelpEvent::_ZTV10QHelpEvent) + 16)
+ QEvent (0x0x7f527476f420) 0
+ primary-for QHelpEvent (0x0x7f527475c548)
+
+Vtable for QStatusTipEvent
+QStatusTipEvent::_ZTV15QStatusTipEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QStatusTipEvent)
+16 (int (*)(...))QStatusTipEvent::~QStatusTipEvent
+24 (int (*)(...))QStatusTipEvent::~QStatusTipEvent
+
+Class QStatusTipEvent
+ size=32 align=8
+ base size=32 base align=8
+QStatusTipEvent (0x0x7f527475c5b0) 0
+ vptr=((& QStatusTipEvent::_ZTV15QStatusTipEvent) + 16)
+ QEvent (0x0x7f527476f6c0) 0
+ primary-for QStatusTipEvent (0x0x7f527475c5b0)
+
+Vtable for QWhatsThisClickedEvent
+QWhatsThisClickedEvent::_ZTV22QWhatsThisClickedEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI22QWhatsThisClickedEvent)
+16 (int (*)(...))QWhatsThisClickedEvent::~QWhatsThisClickedEvent
+24 (int (*)(...))QWhatsThisClickedEvent::~QWhatsThisClickedEvent
+
+Class QWhatsThisClickedEvent
+ size=32 align=8
+ base size=32 base align=8
+QWhatsThisClickedEvent (0x0x7f527475c618) 0
+ vptr=((& QWhatsThisClickedEvent::_ZTV22QWhatsThisClickedEvent) + 16)
+ QEvent (0x0x7f527476f780) 0
+ primary-for QWhatsThisClickedEvent (0x0x7f527475c618)
+
+Vtable for QActionEvent
+QActionEvent::_ZTV12QActionEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QActionEvent)
+16 (int (*)(...))QActionEvent::~QActionEvent
+24 (int (*)(...))QActionEvent::~QActionEvent
+
+Class QActionEvent
+ size=40 align=8
+ base size=40 base align=8
+QActionEvent (0x0x7f527475c680) 0
+ vptr=((& QActionEvent::_ZTV12QActionEvent) + 16)
+ QEvent (0x0x7f527476f840) 0
+ primary-for QActionEvent (0x0x7f527475c680)
+
+Vtable for QFileOpenEvent
+QFileOpenEvent::_ZTV14QFileOpenEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QFileOpenEvent)
+16 (int (*)(...))QFileOpenEvent::~QFileOpenEvent
+24 (int (*)(...))QFileOpenEvent::~QFileOpenEvent
+
+Class QFileOpenEvent
+ size=40 align=8
+ base size=40 base align=8
+QFileOpenEvent (0x0x7f527475c6e8) 0
+ vptr=((& QFileOpenEvent::_ZTV14QFileOpenEvent) + 16)
+ QEvent (0x0x7f527476f960) 0
+ primary-for QFileOpenEvent (0x0x7f527475c6e8)
+
+Vtable for QToolBarChangeEvent
+QToolBarChangeEvent::_ZTV19QToolBarChangeEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QToolBarChangeEvent)
+16 (int (*)(...))QToolBarChangeEvent::~QToolBarChangeEvent
+24 (int (*)(...))QToolBarChangeEvent::~QToolBarChangeEvent
+
+Class QToolBarChangeEvent
+ size=24 align=8
+ base size=21 base align=8
+QToolBarChangeEvent (0x0x7f527475c750) 0
+ vptr=((& QToolBarChangeEvent::_ZTV19QToolBarChangeEvent) + 16)
+ QEvent (0x0x7f527476fa80) 0
+ primary-for QToolBarChangeEvent (0x0x7f527475c750)
+
+Vtable for QShortcutEvent
+QShortcutEvent::_ZTV14QShortcutEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QShortcutEvent)
+16 (int (*)(...))QShortcutEvent::~QShortcutEvent
+24 (int (*)(...))QShortcutEvent::~QShortcutEvent
+
+Class QShortcutEvent
+ size=40 align=8
+ base size=40 base align=8
+QShortcutEvent (0x0x7f527475c7b8) 0
+ vptr=((& QShortcutEvent::_ZTV14QShortcutEvent) + 16)
+ QEvent (0x0x7f527476fb40) 0
+ primary-for QShortcutEvent (0x0x7f527475c7b8)
+
+Vtable for QWindowStateChangeEvent
+QWindowStateChangeEvent::_ZTV23QWindowStateChangeEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI23QWindowStateChangeEvent)
+16 (int (*)(...))QWindowStateChangeEvent::~QWindowStateChangeEvent
+24 (int (*)(...))QWindowStateChangeEvent::~QWindowStateChangeEvent
+
+Class QWindowStateChangeEvent
+ size=32 align=8
+ base size=25 base align=8
+QWindowStateChangeEvent (0x0x7f527475c820) 0
+ vptr=((& QWindowStateChangeEvent::_ZTV23QWindowStateChangeEvent) + 16)
+ QEvent (0x0x7f527476fcc0) 0
+ primary-for QWindowStateChangeEvent (0x0x7f527475c820)
+
+Class QPointingDeviceUniqueId
+ size=8 align=8
+ base size=8 base align=8
+QPointingDeviceUniqueId (0x0x7f527476fe40) 0
+
+Class QTouchEvent::TouchPoint
+ size=8 align=8
+ base size=8 base align=8
+QTouchEvent::TouchPoint (0x0x7f52747f2240) 0
+
+Vtable for QTouchEvent
+QTouchEvent::_ZTV11QTouchEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QTouchEvent)
+16 (int (*)(...))QTouchEvent::~QTouchEvent
+24 (int (*)(...))QTouchEvent::~QTouchEvent
+
+Class QTouchEvent
+ size=72 align=8
+ base size=72 base align=8
+QTouchEvent (0x0x7f52747f8068) 0
+ vptr=((& QTouchEvent::_ZTV11QTouchEvent) + 16)
+ QInputEvent (0x0x7f52747f80d0) 0
+ primary-for QTouchEvent (0x0x7f52747f8068)
+ QEvent (0x0x7f52747f21e0) 0
+ primary-for QInputEvent (0x0x7f52747f80d0)
+
+Vtable for QScrollPrepareEvent
+QScrollPrepareEvent::_ZTV19QScrollPrepareEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QScrollPrepareEvent)
+16 (int (*)(...))QScrollPrepareEvent::~QScrollPrepareEvent
+24 (int (*)(...))QScrollPrepareEvent::~QScrollPrepareEvent
+
+Class QScrollPrepareEvent
+ size=112 align=8
+ base size=112 base align=8
+QScrollPrepareEvent (0x0x7f52748f1d68) 0
+ vptr=((& QScrollPrepareEvent::_ZTV19QScrollPrepareEvent) + 16)
+ QEvent (0x0x7f52748ff7e0) 0
+ primary-for QScrollPrepareEvent (0x0x7f52748f1d68)
+
+Vtable for QScrollEvent
+QScrollEvent::_ZTV12QScrollEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QScrollEvent)
+16 (int (*)(...))QScrollEvent::~QScrollEvent
+24 (int (*)(...))QScrollEvent::~QScrollEvent
+
+Class QScrollEvent
+ size=64 align=8
+ base size=60 base align=8
+QScrollEvent (0x0x7f52748f1dd0) 0
+ vptr=((& QScrollEvent::_ZTV12QScrollEvent) + 16)
+ QEvent (0x0x7f52748ff840) 0
+ primary-for QScrollEvent (0x0x7f52748f1dd0)
+
+Vtable for QScreenOrientationChangeEvent
+QScreenOrientationChangeEvent::_ZTV29QScreenOrientationChangeEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI29QScreenOrientationChangeEvent)
+16 (int (*)(...))QScreenOrientationChangeEvent::~QScreenOrientationChangeEvent
+24 (int (*)(...))QScreenOrientationChangeEvent::~QScreenOrientationChangeEvent
+
+Class QScreenOrientationChangeEvent
+ size=40 align=8
+ base size=36 base align=8
+QScreenOrientationChangeEvent (0x0x7f52748f1e38) 0
+ vptr=((& QScreenOrientationChangeEvent::_ZTV29QScreenOrientationChangeEvent) + 16)
+ QEvent (0x0x7f52748ff8a0) 0
+ primary-for QScreenOrientationChangeEvent (0x0x7f52748f1e38)
+
+Vtable for QApplicationStateChangeEvent
+QApplicationStateChangeEvent::_ZTV28QApplicationStateChangeEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI28QApplicationStateChangeEvent)
+16 (int (*)(...))QApplicationStateChangeEvent::~QApplicationStateChangeEvent
+24 (int (*)(...))QApplicationStateChangeEvent::~QApplicationStateChangeEvent
+
+Class QApplicationStateChangeEvent
+ size=24 align=8
+ base size=24 base align=8
+QApplicationStateChangeEvent (0x0x7f52748f1ea0) 0
+ vptr=((& QApplicationStateChangeEvent::_ZTV28QApplicationStateChangeEvent) + 16)
+ QEvent (0x0x7f52748ff900) 0
+ primary-for QApplicationStateChangeEvent (0x0x7f52748f1ea0)
+
+Class QFont
+ size=16 align=8
+ base size=12 base align=8
+QFont (0x0x7f52748ff960) 0
+
+Class QPolygon
+ size=8 align=8
+ base size=8 base align=8
+QPolygon (0x0x7f5274641340) 0
+ QVector<QPoint> (0x0x7f52746359c0) 0
+
+Class QPolygonF
+ size=8 align=8
+ base size=8 base align=8
+QPolygonF (0x0x7f52746d9680) 0
+ QVector<QPointF> (0x0x7f52746daae0) 0
+
+Class QMatrix
+ size=48 align=8
+ base size=48 base align=8
+QMatrix (0x0x7f527437a9c0) 0
+
+Class QTransform
+ size=88 align=8
+ base size=88 base align=8
+QTransform (0x0x7f52743e0780) 0
+
+Vtable for QPaintDevice
+QPaintDevice::_ZTV12QPaintDevice: 10 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QPaintDevice)
+16 0
+24 0
+32 (int (*)(...))QPaintDevice::devType
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))QPaintDevice::metric
+56 (int (*)(...))QPaintDevice::initPainter
+64 (int (*)(...))QPaintDevice::redirected
+72 (int (*)(...))QPaintDevice::sharedPainter
+
+Class QPaintDevice
+ size=24 align=8
+ base size=24 base align=8
+QPaintDevice (0x0x7f52744ad1e0) 0
+ vptr=((& QPaintDevice::_ZTV12QPaintDevice) + 16)
+
+Class QPixelFormat
+ size=8 align=8
+ base size=8 base align=8
+QPixelFormat (0x0x7f52744ad7e0) 0
+
+Vtable for QImage
+QImage::_ZTV6QImage: 10 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI6QImage)
+16 (int (*)(...))QImage::~QImage
+24 (int (*)(...))QImage::~QImage
+32 (int (*)(...))QImage::devType
+40 (int (*)(...))QImage::paintEngine
+48 (int (*)(...))QImage::metric
+56 (int (*)(...))QPaintDevice::initPainter
+64 (int (*)(...))QPaintDevice::redirected
+72 (int (*)(...))QPaintDevice::sharedPainter
+
+Class QImage
+ size=32 align=8
+ base size=32 base align=8
+QImage (0x0x7f52741810d0) 0
+ vptr=((& QImage::_ZTV6QImage) + 16)
+ QPaintDevice (0x0x7f527417a120) 0
+ primary-for QImage (0x0x7f52741810d0)
+
+Vtable for QPixmap
+QPixmap::_ZTV7QPixmap: 10 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI7QPixmap)
+16 (int (*)(...))QPixmap::~QPixmap
+24 (int (*)(...))QPixmap::~QPixmap
+32 (int (*)(...))QPixmap::devType
+40 (int (*)(...))QPixmap::paintEngine
+48 (int (*)(...))QPixmap::metric
+56 (int (*)(...))QPaintDevice::initPainter
+64 (int (*)(...))QPaintDevice::redirected
+72 (int (*)(...))QPaintDevice::sharedPainter
+
+Class QPixmap
+ size=32 align=8
+ base size=32 base align=8
+QPixmap (0x0x7f5274265af8) 0
+ vptr=((& QPixmap::_ZTV7QPixmap) + 16)
+ QPaintDevice (0x0x7f5274264f00) 0
+ primary-for QPixmap (0x0x7f5274265af8)
+
+Class QBrush
+ size=8 align=8
+ base size=8 base align=8
+QBrush (0x0x7f5273f5f240) 0
+
+Class QBrushData
+ size=112 align=8
+ base size=112 base align=8
+QBrushData (0x0x7f5274025780) 0
+
+Class QGradient::QGradientData
+ size=40 align=8
+ base size=40 base align=8
+QGradient::QGradientData (0x0x7f5274025a20) 0
+
+Class QGradient
+ size=64 align=8
+ base size=64 base align=8
+QGradient (0x0x7f52740259c0) 0
+
+Class QLinearGradient
+ size=64 align=8
+ base size=64 base align=8
+QLinearGradient (0x0x7f52740284e0) 0
+ QGradient (0x0x7f5274088120) 0
+
+Class QRadialGradient
+ size=64 align=8
+ base size=64 base align=8
+QRadialGradient (0x0x7f5274028548) 0
+ QGradient (0x0x7f5274088240) 0
+
+Class QConicalGradient
+ size=64 align=8
+ base size=64 base align=8
+QConicalGradient (0x0x7f52740285b0) 0
+ QGradient (0x0x7f5274088360) 0
+
+Class QPen
+ size=8 align=8
+ base size=8 base align=8
+QPen (0x0x7f5274088420) 0
+
+Class QTextOption::Tab
+ size=16 align=8
+ base size=14 base align=8
+QTextOption::Tab (0x0x7f5273d49d80) 0
+
+Class QTextOption
+ size=32 align=8
+ base size=32 base align=8
+QTextOption (0x0x7f5273d49d20) 0
+
+Class QTextLength
+ size=16 align=8
+ base size=16 base align=8
+QTextLength (0x0x7f5273db64e0) 0
+
+Class QTextFormat
+ size=16 align=8
+ base size=12 base align=8
+QTextFormat (0x0x7f5273e0be40) 0
+
+Class QTextCharFormat
+ size=16 align=8
+ base size=12 base align=8
+QTextCharFormat (0x0x7f5273b832d8) 0
+ QTextFormat (0x0x7f5273ba5540) 0
+
+Class QTextBlockFormat
+ size=16 align=8
+ base size=12 base align=8
+QTextBlockFormat (0x0x7f5273c276e8) 0
+ QTextFormat (0x0x7f5273c1bf00) 0
+
+Class QTextListFormat
+ size=16 align=8
+ base size=12 base align=8
+QTextListFormat (0x0x7f5273c7ec30) 0
+ QTextFormat (0x0x7f5273c7dcc0) 0
+
+Class QTextImageFormat
+ size=16 align=8
+ base size=12 base align=8
+QTextImageFormat (0x0x7f5273ce0068) 0
+ QTextCharFormat (0x0x7f5273ce00d0) 0
+ QTextFormat (0x0x7f5273cdb480) 0
+
+Class QTextFrameFormat
+ size=16 align=8
+ base size=12 base align=8
+QTextFrameFormat (0x0x7f5273d1f618) 0
+ QTextFormat (0x0x7f5273d1bae0) 0
+
+Class QTextTableFormat
+ size=16 align=8
+ base size=12 base align=8
+QTextTableFormat (0x0x7f5273973b60) 0
+ QTextFrameFormat (0x0x7f5273973bc8) 0
+ QTextFormat (0x0x7f527397f720) 0
+
+Class QTextTableCellFormat
+ size=16 align=8
+ base size=12 base align=8
+QTextTableCellFormat (0x0x7f52739de138) 0
+ QTextCharFormat (0x0x7f52739de1a0) 0
+ QTextFormat (0x0x7f52739e30c0) 0
+
+Class QFontDatabase
+ size=8 align=8
+ base size=8 base align=8
+QFontDatabase (0x0x7f5273a33f00) 0
+
+Class QRawFont
+ size=8 align=8
+ base size=8 base align=8
+QRawFont (0x0x7f5273a63120) 0
+
+Class QGlyphRun
+ size=8 align=8
+ base size=8 base align=8
+QGlyphRun (0x0x7f5273739900) 0
+
+Class QTextCursor
+ size=8 align=8
+ base size=8 base align=8
+QTextCursor (0x0x7f5273828840) 0
+
+Class QTextInlineObject
+ size=16 align=8
+ base size=16 base align=8
+QTextInlineObject (0x0x7f52739054e0) 0
+
+Class QTextLayout::FormatRange
+ size=24 align=8
+ base size=24 base align=8
+QTextLayout::FormatRange (0x0x7f5273905900) 0
+
+Class QTextLayout
+ size=8 align=8
+ base size=8 base align=8
+QTextLayout (0x0x7f52739058a0) 0
+
+Class QTextLine
+ size=16 align=8
+ base size=16 base align=8
+QTextLine (0x0x7f52735b9000) 0
+
+Vtable for QAbstractUndoItem
+QAbstractUndoItem::_ZTV17QAbstractUndoItem: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QAbstractUndoItem)
+16 (int (*)(...))__cxa_pure_virtual
+24 (int (*)(...))__cxa_pure_virtual
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+
+Class QAbstractUndoItem
+ size=8 align=8
+ base size=8 base align=8
+QAbstractUndoItem (0x0x7f52735b9480) 0 nearly-empty
+ vptr=((& QAbstractUndoItem::_ZTV17QAbstractUndoItem) + 16)
+
+Class QTextDocument::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTextDocument::QPrivateSignal (0x0x7f52735b9720) 0 empty
+
+Vtable for QTextDocument
+QTextDocument::_ZTV13QTextDocument: 17 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QTextDocument)
+16 (int (*)(...))QTextDocument::metaObject
+24 (int (*)(...))QTextDocument::qt_metacast
+32 (int (*)(...))QTextDocument::qt_metacall
+40 (int (*)(...))QTextDocument::~QTextDocument
+48 (int (*)(...))QTextDocument::~QTextDocument
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QTextDocument::clear
+120 (int (*)(...))QTextDocument::createObject
+128 (int (*)(...))QTextDocument::loadResource
+
+Class QTextDocument
+ size=16 align=8
+ base size=16 base align=8
+QTextDocument (0x0x7f52735af958) 0
+ vptr=((& QTextDocument::_ZTV13QTextDocument) + 16)
+ QObject (0x0x7f52735b96c0) 0
+ primary-for QTextDocument (0x0x7f52735af958)
+
+Class QPalette::Data
+ size=4 align=4
+ base size=4 base align=4
+QPalette::Data (0x0x7f527362d720) 0
+
+Class QPalette
+ size=16 align=8
+ base size=12 base align=8
+QPalette (0x0x7f527362d6c0) 0
+
+Class QAbstractTextDocumentLayout::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAbstractTextDocumentLayout::QPrivateSignal (0x0x7f527371dae0) 0 empty
+
+Class QAbstractTextDocumentLayout::Selection
+ size=24 align=8
+ base size=24 base align=8
+QAbstractTextDocumentLayout::Selection (0x0x7f527371db40) 0
+
+Class QAbstractTextDocumentLayout::PaintContext
+ size=64 align=8
+ base size=64 base align=8
+QAbstractTextDocumentLayout::PaintContext (0x0x7f527371dba0) 0
+
+Vtable for QAbstractTextDocumentLayout
+QAbstractTextDocumentLayout::_ZTV27QAbstractTextDocumentLayout: 24 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI27QAbstractTextDocumentLayout)
+16 (int (*)(...))QAbstractTextDocumentLayout::metaObject
+24 (int (*)(...))QAbstractTextDocumentLayout::qt_metacast
+32 (int (*)(...))QAbstractTextDocumentLayout::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))__cxa_pure_virtual
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))__cxa_pure_virtual
+160 (int (*)(...))__cxa_pure_virtual
+168 (int (*)(...))QAbstractTextDocumentLayout::resizeInlineObject
+176 (int (*)(...))QAbstractTextDocumentLayout::positionInlineObject
+184 (int (*)(...))QAbstractTextDocumentLayout::drawInlineObject
+
+Class QAbstractTextDocumentLayout
+ size=16 align=8
+ base size=16 base align=8
+QAbstractTextDocumentLayout (0x0x7f5273720750) 0
+ vptr=((& QAbstractTextDocumentLayout::_ZTV27QAbstractTextDocumentLayout) + 16)
+ QObject (0x0x7f527371da80) 0
+ primary-for QAbstractTextDocumentLayout (0x0x7f5273720750)
+
+Vtable for QTextObjectInterface
+QTextObjectInterface::_ZTV20QTextObjectInterface: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QTextObjectInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+
+Class QTextObjectInterface
+ size=8 align=8
+ base size=8 base align=8
+QTextObjectInterface (0x0x7f52733ec780) 0 nearly-empty
+ vptr=((& QTextObjectInterface::_ZTV20QTextObjectInterface) + 16)
+
+Class QAccessible::State
+ size=8 align=8
+ base size=5 base align=8
+QAccessible::State (0x0x7f52733ec9c0) 0
+
+Vtable for QAccessible::ActivationObserver
+QAccessible::ActivationObserver::_ZTVN11QAccessible18ActivationObserverE: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTIN11QAccessible18ActivationObserverE)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+
+Class QAccessible::ActivationObserver
+ size=8 align=8
+ base size=8 base align=8
+QAccessible::ActivationObserver (0x0x7f52733eca20) 0 nearly-empty
+ vptr=((& QAccessible::ActivationObserver::_ZTVN11QAccessible18ActivationObserverE) + 16)
+
+Class QAccessible
+ size=1 align=1
+ base size=0 base align=1
+QAccessible (0x0x7f52733ec960) 0 empty
+
+Vtable for QAccessibleInterface
+QAccessibleInterface::_ZTV20QAccessibleInterface: 23 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QAccessibleInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))QAccessibleInterface::window
+56 (int (*)(...))QAccessibleInterface::relations
+64 (int (*)(...))QAccessibleInterface::focusChild
+72 (int (*)(...))__cxa_pure_virtual
+80 (int (*)(...))__cxa_pure_virtual
+88 (int (*)(...))__cxa_pure_virtual
+96 (int (*)(...))__cxa_pure_virtual
+104 (int (*)(...))__cxa_pure_virtual
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))__cxa_pure_virtual
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))QAccessibleInterface::foregroundColor
+160 (int (*)(...))QAccessibleInterface::backgroundColor
+168 (int (*)(...))QAccessibleInterface::virtual_hook
+176 (int (*)(...))QAccessibleInterface::interface_cast
+
+Class QAccessibleInterface
+ size=8 align=8
+ base size=8 base align=8
+QAccessibleInterface (0x0x7f5273428600) 0 nearly-empty
+ vptr=((& QAccessibleInterface::_ZTV20QAccessibleInterface) + 16)
+
+Vtable for QAccessibleTextInterface
+QAccessibleTextInterface::_ZTV24QAccessibleTextInterface: 20 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI24QAccessibleTextInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))__cxa_pure_virtual
+72 (int (*)(...))__cxa_pure_virtual
+80 (int (*)(...))__cxa_pure_virtual
+88 (int (*)(...))__cxa_pure_virtual
+96 (int (*)(...))QAccessibleTextInterface::textBeforeOffset
+104 (int (*)(...))QAccessibleTextInterface::textAfterOffset
+112 (int (*)(...))QAccessibleTextInterface::textAtOffset
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))__cxa_pure_virtual
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))__cxa_pure_virtual
+
+Class QAccessibleTextInterface
+ size=8 align=8
+ base size=8 base align=8
+QAccessibleTextInterface (0x0x7f5273428960) 0 nearly-empty
+ vptr=((& QAccessibleTextInterface::_ZTV24QAccessibleTextInterface) + 16)
+
+Vtable for QAccessibleEditableTextInterface
+QAccessibleEditableTextInterface::_ZTV32QAccessibleEditableTextInterface: 7 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI32QAccessibleEditableTextInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+
+Class QAccessibleEditableTextInterface
+ size=8 align=8
+ base size=8 base align=8
+QAccessibleEditableTextInterface (0x0x7f52734289c0) 0 nearly-empty
+ vptr=((& QAccessibleEditableTextInterface::_ZTV32QAccessibleEditableTextInterface) + 16)
+
+Vtable for QAccessibleValueInterface
+QAccessibleValueInterface::_ZTV25QAccessibleValueInterface: 9 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI25QAccessibleValueInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))__cxa_pure_virtual
+
+Class QAccessibleValueInterface
+ size=8 align=8
+ base size=8 base align=8
+QAccessibleValueInterface (0x0x7f5273428a20) 0 nearly-empty
+ vptr=((& QAccessibleValueInterface::_ZTV25QAccessibleValueInterface) + 16)
+
+Vtable for QAccessibleTableCellInterface
+QAccessibleTableCellInterface::_ZTV29QAccessibleTableCellInterface: 12 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI29QAccessibleTableCellInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))__cxa_pure_virtual
+72 (int (*)(...))__cxa_pure_virtual
+80 (int (*)(...))__cxa_pure_virtual
+88 (int (*)(...))__cxa_pure_virtual
+
+Class QAccessibleTableCellInterface
+ size=8 align=8
+ base size=8 base align=8
+QAccessibleTableCellInterface (0x0x7f5273428a80) 0 nearly-empty
+ vptr=((& QAccessibleTableCellInterface::_ZTV29QAccessibleTableCellInterface) + 16)
+
+Vtable for QAccessibleTableInterface
+QAccessibleTableInterface::_ZTV25QAccessibleTableInterface: 24 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI25QAccessibleTableInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))__cxa_pure_virtual
+72 (int (*)(...))__cxa_pure_virtual
+80 (int (*)(...))__cxa_pure_virtual
+88 (int (*)(...))__cxa_pure_virtual
+96 (int (*)(...))__cxa_pure_virtual
+104 (int (*)(...))__cxa_pure_virtual
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))__cxa_pure_virtual
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))__cxa_pure_virtual
+160 (int (*)(...))__cxa_pure_virtual
+168 (int (*)(...))__cxa_pure_virtual
+176 (int (*)(...))__cxa_pure_virtual
+184 (int (*)(...))__cxa_pure_virtual
+
+Class QAccessibleTableInterface
+ size=8 align=8
+ base size=8 base align=8
+QAccessibleTableInterface (0x0x7f5273428ae0) 0 nearly-empty
+ vptr=((& QAccessibleTableInterface::_ZTV25QAccessibleTableInterface) + 16)
+
+Vtable for QAccessibleActionInterface
+QAccessibleActionInterface::_ZTV26QAccessibleActionInterface: 9 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI26QAccessibleActionInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))QAccessibleActionInterface::localizedActionName
+48 (int (*)(...))QAccessibleActionInterface::localizedActionDescription
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))__cxa_pure_virtual
+
+Class QAccessibleActionInterface
+ size=8 align=8
+ base size=8 base align=8
+QAccessibleActionInterface (0x0x7f5273428b40) 0 nearly-empty
+ vptr=((& QAccessibleActionInterface::_ZTV26QAccessibleActionInterface) + 16)
+
+Vtable for QAccessibleImageInterface
+QAccessibleImageInterface::_ZTV25QAccessibleImageInterface: 7 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI25QAccessibleImageInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+
+Class QAccessibleImageInterface
+ size=8 align=8
+ base size=8 base align=8
+QAccessibleImageInterface (0x0x7f5273428c60) 0 nearly-empty
+ vptr=((& QAccessibleImageInterface::_ZTV25QAccessibleImageInterface) + 16)
+
+Vtable for QAccessibleEvent
+QAccessibleEvent::_ZTV16QAccessibleEvent: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QAccessibleEvent)
+16 (int (*)(...))QAccessibleEvent::~QAccessibleEvent
+24 (int (*)(...))QAccessibleEvent::~QAccessibleEvent
+32 (int (*)(...))QAccessibleEvent::accessibleInterface
+
+Class QAccessibleEvent
+ size=32 align=8
+ base size=28 base align=8
+QAccessibleEvent (0x0x7f5273428cc0) 0
+ vptr=((& QAccessibleEvent::_ZTV16QAccessibleEvent) + 16)
+
+Vtable for QAccessibleStateChangeEvent
+QAccessibleStateChangeEvent::_ZTV27QAccessibleStateChangeEvent: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI27QAccessibleStateChangeEvent)
+16 (int (*)(...))QAccessibleStateChangeEvent::~QAccessibleStateChangeEvent
+24 (int (*)(...))QAccessibleStateChangeEvent::~QAccessibleStateChangeEvent
+32 (int (*)(...))QAccessibleEvent::accessibleInterface
+
+Class QAccessibleStateChangeEvent
+ size=40 align=8
+ base size=40 base align=8
+QAccessibleStateChangeEvent (0x0x7f52733eed68) 0
+ vptr=((& QAccessibleStateChangeEvent::_ZTV27QAccessibleStateChangeEvent) + 16)
+ QAccessibleEvent (0x0x7f527348d6c0) 0
+ primary-for QAccessibleStateChangeEvent (0x0x7f52733eed68)
+
+Vtable for QAccessibleTextCursorEvent
+QAccessibleTextCursorEvent::_ZTV26QAccessibleTextCursorEvent: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI26QAccessibleTextCursorEvent)
+16 (int (*)(...))QAccessibleTextCursorEvent::~QAccessibleTextCursorEvent
+24 (int (*)(...))QAccessibleTextCursorEvent::~QAccessibleTextCursorEvent
+32 (int (*)(...))QAccessibleEvent::accessibleInterface
+
+Class QAccessibleTextCursorEvent
+ size=32 align=8
+ base size=32 base align=8
+QAccessibleTextCursorEvent (0x0x7f52733eedd0) 0
+ vptr=((& QAccessibleTextCursorEvent::_ZTV26QAccessibleTextCursorEvent) + 16)
+ QAccessibleEvent (0x0x7f527348da80) 0
+ primary-for QAccessibleTextCursorEvent (0x0x7f52733eedd0)
+
+Vtable for QAccessibleTextSelectionEvent
+QAccessibleTextSelectionEvent::_ZTV29QAccessibleTextSelectionEvent: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI29QAccessibleTextSelectionEvent)
+16 (int (*)(...))QAccessibleTextSelectionEvent::~QAccessibleTextSelectionEvent
+24 (int (*)(...))QAccessibleTextSelectionEvent::~QAccessibleTextSelectionEvent
+32 (int (*)(...))QAccessibleEvent::accessibleInterface
+
+Class QAccessibleTextSelectionEvent
+ size=40 align=8
+ base size=40 base align=8
+QAccessibleTextSelectionEvent (0x0x7f52733eee38) 0
+ vptr=((& QAccessibleTextSelectionEvent::_ZTV29QAccessibleTextSelectionEvent) + 16)
+ QAccessibleTextCursorEvent (0x0x7f52733eeea0) 0
+ primary-for QAccessibleTextSelectionEvent (0x0x7f52733eee38)
+ QAccessibleEvent (0x0x7f527348dea0) 0
+ primary-for QAccessibleTextCursorEvent (0x0x7f52733eeea0)
+
+Vtable for QAccessibleTextInsertEvent
+QAccessibleTextInsertEvent::_ZTV26QAccessibleTextInsertEvent: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI26QAccessibleTextInsertEvent)
+16 (int (*)(...))QAccessibleTextInsertEvent::~QAccessibleTextInsertEvent
+24 (int (*)(...))QAccessibleTextInsertEvent::~QAccessibleTextInsertEvent
+32 (int (*)(...))QAccessibleEvent::accessibleInterface
+
+Class QAccessibleTextInsertEvent
+ size=48 align=8
+ base size=48 base align=8
+QAccessibleTextInsertEvent (0x0x7f52733eef08) 0
+ vptr=((& QAccessibleTextInsertEvent::_ZTV26QAccessibleTextInsertEvent) + 16)
+ QAccessibleTextCursorEvent (0x0x7f52733eef70) 0
+ primary-for QAccessibleTextInsertEvent (0x0x7f52733eef08)
+ QAccessibleEvent (0x0x7f52734fd360) 0
+ primary-for QAccessibleTextCursorEvent (0x0x7f52733eef70)
+
+Vtable for QAccessibleTextRemoveEvent
+QAccessibleTextRemoveEvent::_ZTV26QAccessibleTextRemoveEvent: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI26QAccessibleTextRemoveEvent)
+16 (int (*)(...))QAccessibleTextRemoveEvent::~QAccessibleTextRemoveEvent
+24 (int (*)(...))QAccessibleTextRemoveEvent::~QAccessibleTextRemoveEvent
+32 (int (*)(...))QAccessibleEvent::accessibleInterface
+
+Class QAccessibleTextRemoveEvent
+ size=48 align=8
+ base size=48 base align=8
+QAccessibleTextRemoveEvent (0x0x7f527350e000) 0
+ vptr=((& QAccessibleTextRemoveEvent::_ZTV26QAccessibleTextRemoveEvent) + 16)
+ QAccessibleTextCursorEvent (0x0x7f527350e068) 0
+ primary-for QAccessibleTextRemoveEvent (0x0x7f527350e000)
+ QAccessibleEvent (0x0x7f52734fd780) 0
+ primary-for QAccessibleTextCursorEvent (0x0x7f527350e068)
+
+Vtable for QAccessibleTextUpdateEvent
+QAccessibleTextUpdateEvent::_ZTV26QAccessibleTextUpdateEvent: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI26QAccessibleTextUpdateEvent)
+16 (int (*)(...))QAccessibleTextUpdateEvent::~QAccessibleTextUpdateEvent
+24 (int (*)(...))QAccessibleTextUpdateEvent::~QAccessibleTextUpdateEvent
+32 (int (*)(...))QAccessibleEvent::accessibleInterface
+
+Class QAccessibleTextUpdateEvent
+ size=56 align=8
+ base size=56 base align=8
+QAccessibleTextUpdateEvent (0x0x7f527350e0d0) 0
+ vptr=((& QAccessibleTextUpdateEvent::_ZTV26QAccessibleTextUpdateEvent) + 16)
+ QAccessibleTextCursorEvent (0x0x7f527350e138) 0
+ primary-for QAccessibleTextUpdateEvent (0x0x7f527350e0d0)
+ QAccessibleEvent (0x0x7f52734fdba0) 0
+ primary-for QAccessibleTextCursorEvent (0x0x7f527350e138)
+
+Vtable for QAccessibleValueChangeEvent
+QAccessibleValueChangeEvent::_ZTV27QAccessibleValueChangeEvent: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI27QAccessibleValueChangeEvent)
+16 (int (*)(...))QAccessibleValueChangeEvent::~QAccessibleValueChangeEvent
+24 (int (*)(...))QAccessibleValueChangeEvent::~QAccessibleValueChangeEvent
+32 (int (*)(...))QAccessibleEvent::accessibleInterface
+
+Class QAccessibleValueChangeEvent
+ size=48 align=8
+ base size=48 base align=8
+QAccessibleValueChangeEvent (0x0x7f527350e1a0) 0
+ vptr=((& QAccessibleValueChangeEvent::_ZTV27QAccessibleValueChangeEvent) + 16)
+ QAccessibleEvent (0x0x7f527312d060) 0
+ primary-for QAccessibleValueChangeEvent (0x0x7f527350e1a0)
+
+Vtable for QAccessibleTableModelChangeEvent
+QAccessibleTableModelChangeEvent::_ZTV32QAccessibleTableModelChangeEvent: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI32QAccessibleTableModelChangeEvent)
+16 (int (*)(...))QAccessibleTableModelChangeEvent::~QAccessibleTableModelChangeEvent
+24 (int (*)(...))QAccessibleTableModelChangeEvent::~QAccessibleTableModelChangeEvent
+32 (int (*)(...))QAccessibleEvent::accessibleInterface
+
+Class QAccessibleTableModelChangeEvent
+ size=48 align=8
+ base size=48 base align=8
+QAccessibleTableModelChangeEvent (0x0x7f527350e208) 0
+ vptr=((& QAccessibleTableModelChangeEvent::_ZTV32QAccessibleTableModelChangeEvent) + 16)
+ QAccessibleEvent (0x0x7f527312d480) 0
+ primary-for QAccessibleTableModelChangeEvent (0x0x7f527350e208)
+
+Vtable for QAccessibleBridge
+QAccessibleBridge::_ZTV17QAccessibleBridge: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QAccessibleBridge)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+
+Class QAccessibleBridge
+ size=8 align=8
+ base size=8 base align=8
+QAccessibleBridge (0x0x7f527312dd20) 0 nearly-empty
+ vptr=((& QAccessibleBridge::_ZTV17QAccessibleBridge) + 16)
+
+Class QAccessibleBridgePlugin::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAccessibleBridgePlugin::QPrivateSignal (0x0x7f5273159000) 0 empty
+
+Vtable for QAccessibleBridgePlugin
+QAccessibleBridgePlugin::_ZTV23QAccessibleBridgePlugin: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI23QAccessibleBridgePlugin)
+16 (int (*)(...))QAccessibleBridgePlugin::metaObject
+24 (int (*)(...))QAccessibleBridgePlugin::qt_metacast
+32 (int (*)(...))QAccessibleBridgePlugin::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+
+Class QAccessibleBridgePlugin
+ size=16 align=8
+ base size=16 base align=8
+QAccessibleBridgePlugin (0x0x7f527350e270) 0
+ vptr=((& QAccessibleBridgePlugin::_ZTV23QAccessibleBridgePlugin) + 16)
+ QObject (0x0x7f527312df60) 0
+ primary-for QAccessibleBridgePlugin (0x0x7f527350e270)
+
+Vtable for QAccessibleObject
+QAccessibleObject::_ZTV17QAccessibleObject: 23 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QAccessibleObject)
+16 0
+24 0
+32 (int (*)(...))QAccessibleObject::isValid
+40 (int (*)(...))QAccessibleObject::object
+48 (int (*)(...))QAccessibleInterface::window
+56 (int (*)(...))QAccessibleInterface::relations
+64 (int (*)(...))QAccessibleInterface::focusChild
+72 (int (*)(...))QAccessibleObject::childAt
+80 (int (*)(...))__cxa_pure_virtual
+88 (int (*)(...))__cxa_pure_virtual
+96 (int (*)(...))__cxa_pure_virtual
+104 (int (*)(...))__cxa_pure_virtual
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))QAccessibleObject::setText
+128 (int (*)(...))QAccessibleObject::rect
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))QAccessibleInterface::foregroundColor
+160 (int (*)(...))QAccessibleInterface::backgroundColor
+168 (int (*)(...))QAccessibleInterface::virtual_hook
+176 (int (*)(...))QAccessibleInterface::interface_cast
+
+Class QAccessibleObject
+ size=16 align=8
+ base size=16 base align=8
+QAccessibleObject (0x0x7f527350e2d8) 0
+ vptr=((& QAccessibleObject::_ZTV17QAccessibleObject) + 16)
+ QAccessibleInterface (0x0x7f5273159120) 0 nearly-empty
+ primary-for QAccessibleObject (0x0x7f527350e2d8)
+
+Vtable for QAccessibleApplication
+QAccessibleApplication::_ZTV22QAccessibleApplication: 23 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI22QAccessibleApplication)
+16 (int (*)(...))QAccessibleApplication::~QAccessibleApplication
+24 (int (*)(...))QAccessibleApplication::~QAccessibleApplication
+32 (int (*)(...))QAccessibleObject::isValid
+40 (int (*)(...))QAccessibleObject::object
+48 (int (*)(...))QAccessibleApplication::window
+56 (int (*)(...))QAccessibleInterface::relations
+64 (int (*)(...))QAccessibleApplication::focusChild
+72 (int (*)(...))QAccessibleObject::childAt
+80 (int (*)(...))QAccessibleApplication::parent
+88 (int (*)(...))QAccessibleApplication::child
+96 (int (*)(...))QAccessibleApplication::childCount
+104 (int (*)(...))QAccessibleApplication::indexOfChild
+112 (int (*)(...))QAccessibleApplication::text
+120 (int (*)(...))QAccessibleObject::setText
+128 (int (*)(...))QAccessibleObject::rect
+136 (int (*)(...))QAccessibleApplication::role
+144 (int (*)(...))QAccessibleApplication::state
+152 (int (*)(...))QAccessibleInterface::foregroundColor
+160 (int (*)(...))QAccessibleInterface::backgroundColor
+168 (int (*)(...))QAccessibleInterface::virtual_hook
+176 (int (*)(...))QAccessibleInterface::interface_cast
+
+Class QAccessibleApplication
+ size=16 align=8
+ base size=16 base align=8
+QAccessibleApplication (0x0x7f527350e340) 0
+ vptr=((& QAccessibleApplication::_ZTV22QAccessibleApplication) + 16)
+ QAccessibleObject (0x0x7f527350e3a8) 0
+ primary-for QAccessibleApplication (0x0x7f527350e340)
+ QAccessibleInterface (0x0x7f5273159180) 0 nearly-empty
+ primary-for QAccessibleObject (0x0x7f527350e3a8)
+
+Class QAccessiblePlugin::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAccessiblePlugin::QPrivateSignal (0x0x7f5273159240) 0 empty
+
+Vtable for QAccessiblePlugin
+QAccessiblePlugin::_ZTV17QAccessiblePlugin: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QAccessiblePlugin)
+16 (int (*)(...))QAccessiblePlugin::metaObject
+24 (int (*)(...))QAccessiblePlugin::qt_metacast
+32 (int (*)(...))QAccessiblePlugin::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+
+Class QAccessiblePlugin
+ size=16 align=8
+ base size=16 base align=8
+QAccessiblePlugin (0x0x7f527350e410) 0
+ vptr=((& QAccessiblePlugin::_ZTV17QAccessiblePlugin) + 16)
+ QObject (0x0x7f52731591e0) 0
+ primary-for QAccessiblePlugin (0x0x7f527350e410)
+
+Class QSurfaceFormat
+ size=8 align=8
+ base size=8 base align=8
+QSurfaceFormat (0x0x7f5273159360) 0
+
+Vtable for QSurface
+QSurface::_ZTV8QSurface: 8 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI8QSurface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))__cxa_pure_virtual
+
+Class QSurface
+ size=24 align=8
+ base size=24 base align=8
+QSurface (0x0x7f5273159ea0) 0
+ vptr=((& QSurface::_ZTV8QSurface) + 16)
+
+Class QIcon
+ size=8 align=8
+ base size=8 base align=8
+QIcon (0x0x7f52731cd2a0) 0
+
+Class QCursor
+ size=8 align=8
+ base size=8 base align=8
+QCursor (0x0x7f5273285de0) 0
+
+Class QWindow::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QWindow::QPrivateSignal (0x0x7f5272f51ba0) 0 empty
+
+Vtable for QWindow
+QWindow::_ZTV7QWindow: 45 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI7QWindow)
+16 (int (*)(...))QWindow::metaObject
+24 (int (*)(...))QWindow::qt_metacast
+32 (int (*)(...))QWindow::qt_metacall
+40 (int (*)(...))QWindow::~QWindow
+48 (int (*)(...))QWindow::~QWindow
+56 (int (*)(...))QWindow::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWindow::surfaceType
+120 (int (*)(...))QWindow::format
+128 (int (*)(...))QWindow::size
+136 (int (*)(...))QWindow::accessibleRoot
+144 (int (*)(...))QWindow::focusObject
+152 (int (*)(...))QWindow::exposeEvent
+160 (int (*)(...))QWindow::resizeEvent
+168 (int (*)(...))QWindow::moveEvent
+176 (int (*)(...))QWindow::focusInEvent
+184 (int (*)(...))QWindow::focusOutEvent
+192 (int (*)(...))QWindow::showEvent
+200 (int (*)(...))QWindow::hideEvent
+208 (int (*)(...))QWindow::keyPressEvent
+216 (int (*)(...))QWindow::keyReleaseEvent
+224 (int (*)(...))QWindow::mousePressEvent
+232 (int (*)(...))QWindow::mouseReleaseEvent
+240 (int (*)(...))QWindow::mouseDoubleClickEvent
+248 (int (*)(...))QWindow::mouseMoveEvent
+256 (int (*)(...))QWindow::wheelEvent
+264 (int (*)(...))QWindow::touchEvent
+272 (int (*)(...))QWindow::tabletEvent
+280 (int (*)(...))QWindow::nativeEvent
+288 (int (*)(...))QWindow::surfaceHandle
+296 (int (*)(...))-16
+304 (int (*)(...))(& _ZTI7QWindow)
+312 (int (*)(...))QWindow::_ZThn16_N7QWindowD1Ev
+320 (int (*)(...))QWindow::_ZThn16_N7QWindowD0Ev
+328 (int (*)(...))QWindow::_ZThn16_NK7QWindow6formatEv
+336 (int (*)(...))QWindow::_ZThn16_NK7QWindow13surfaceHandleEv
+344 (int (*)(...))QWindow::_ZThn16_NK7QWindow11surfaceTypeEv
+352 (int (*)(...))QWindow::_ZThn16_NK7QWindow4sizeEv
+
+Class QWindow
+ size=40 align=8
+ base size=40 base align=8
+QWindow (0x0x7f5272f585b0) 0
+ vptr=((& QWindow::_ZTV7QWindow) + 16)
+ QObject (0x0x7f5272f51ae0) 0
+ primary-for QWindow (0x0x7f5272f585b0)
+ QSurface (0x0x7f5272f51b40) 16
+ vptr=((& QWindow::_ZTV7QWindow) + 312)
+
+Class QBackingStore
+ size=8 align=8
+ base size=8 base align=8
+QBackingStore (0x0x7f527e65ad80) 0
+
+Vtable for QBitmap
+QBitmap::_ZTV7QBitmap: 10 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI7QBitmap)
+16 (int (*)(...))QBitmap::~QBitmap
+24 (int (*)(...))QBitmap::~QBitmap
+32 (int (*)(...))QPixmap::devType
+40 (int (*)(...))QPixmap::paintEngine
+48 (int (*)(...))QPixmap::metric
+56 (int (*)(...))QPaintDevice::initPainter
+64 (int (*)(...))QPaintDevice::redirected
+72 (int (*)(...))QPaintDevice::sharedPainter
+
+Class QBitmap
+ size=32 align=8
+ base size=32 base align=8
+QBitmap (0x0x7f5275627750) 0
+ vptr=((& QBitmap::_ZTV7QBitmap) + 16)
+ QPixmap (0x0x7f5275aa70d0) 0
+ primary-for QBitmap (0x0x7f5275627750)
+ QPaintDevice (0x0x7f527e67c000) 0
+ primary-for QPixmap (0x0x7f5275aa70d0)
+
+Class QClipboard::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QClipboard::QPrivateSignal (0x0x7f527e4c0240) 0 empty
+
+Vtable for QClipboard
+QClipboard::_ZTV10QClipboard: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QClipboard)
+16 (int (*)(...))QClipboard::metaObject
+24 (int (*)(...))QClipboard::qt_metacast
+32 (int (*)(...))QClipboard::qt_metacall
+40 (int (*)(...))QClipboard::~QClipboard
+48 (int (*)(...))QClipboard::~QClipboard
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QClipboard
+ size=16 align=8
+ base size=16 base align=8
+QClipboard (0x0x7f527e52a410) 0
+ vptr=((& QClipboard::_ZTV10QClipboard) + 16)
+ QObject (0x0x7f527e463960) 0
+ primary-for QClipboard (0x0x7f527e52a410)
+
+Class QColorTransform
+ size=8 align=8
+ base size=8 base align=8
+QColorTransform (0x0x7f527e4c0540) 0
+
+Class QColorSpace
+ size=8 align=8
+ base size=8 base align=8
+QColorSpace (0x0x7f527bea63c0) 0
+
+Class QDesktopServices
+ size=1 align=1
+ base size=0 base align=1
+QDesktopServices (0x0x7f527a204ea0) 0 empty
+
+Class QDrag::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QDrag::QPrivateSignal (0x0x7f527a225a80) 0 empty
+
+Vtable for QDrag
+QDrag::_ZTV5QDrag: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI5QDrag)
+16 (int (*)(...))QDrag::metaObject
+24 (int (*)(...))QDrag::qt_metacast
+32 (int (*)(...))QDrag::qt_metacall
+40 (int (*)(...))QDrag::~QDrag
+48 (int (*)(...))QDrag::~QDrag
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QDrag
+ size=16 align=8
+ base size=16 base align=8
+QDrag (0x0x7f52792045b0) 0
+ vptr=((& QDrag::_ZTV5QDrag) + 16)
+ QObject (0x0x7f527a204f00) 0
+ primary-for QDrag (0x0x7f52792045b0)
+
+Class QFontInfo
+ size=8 align=8
+ base size=8 base align=8
+QFontInfo (0x0x7f527a004ae0) 0
+
+Class QFontMetrics
+ size=8 align=8
+ base size=8 base align=8
+QFontMetrics (0x0x7f527974af60) 0
+
+Class QFontMetricsF
+ size=8 align=8
+ base size=8 base align=8
+QFontMetricsF (0x0x7f527917fcc0) 0
+
+Class QGenericPlugin::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QGenericPlugin::QPrivateSignal (0x0x7f5277f727e0) 0 empty
+
+Vtable for QGenericPlugin
+QGenericPlugin::_ZTV14QGenericPlugin: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QGenericPlugin)
+16 (int (*)(...))QGenericPlugin::metaObject
+24 (int (*)(...))QGenericPlugin::qt_metacast
+32 (int (*)(...))QGenericPlugin::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+
+Class QGenericPlugin
+ size=16 align=8
+ base size=16 base align=8
+QGenericPlugin (0x0x7f5277c74000) 0
+ vptr=((& QGenericPlugin::_ZTV14QGenericPlugin) + 16)
+ QObject (0x0x7f5277f72780) 0
+ primary-for QGenericPlugin (0x0x7f5277c74000)
+
+Class QGenericPluginFactory
+ size=1 align=1
+ base size=0 base align=1
+QGenericPluginFactory (0x0x7f5277f72e40) 0 empty
+
+Class QInputMethod::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QInputMethod::QPrivateSignal (0x0x7f5277fcfc00) 0 empty
+
+Vtable for QInputMethod
+QInputMethod::_ZTV12QInputMethod: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QInputMethod)
+16 (int (*)(...))QInputMethod::metaObject
+24 (int (*)(...))QInputMethod::qt_metacast
+32 (int (*)(...))QInputMethod::qt_metacall
+40 (int (*)(...))QInputMethod::~QInputMethod
+48 (int (*)(...))QInputMethod::~QInputMethod
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QInputMethod
+ size=16 align=8
+ base size=16 base align=8
+QInputMethod (0x0x7f5277c74068) 0
+ vptr=((& QInputMethod::_ZTV12QInputMethod) + 16)
+ QObject (0x0x7f5277fcfba0) 0
+ primary-for QInputMethod (0x0x7f5277c74068)
+
+Class QGuiApplication::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QGuiApplication::QPrivateSignal (0x0x7f5277fefe40) 0 empty
+
+Vtable for QGuiApplication
+QGuiApplication::_ZTV15QGuiApplication: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QGuiApplication)
+16 (int (*)(...))QGuiApplication::metaObject
+24 (int (*)(...))QGuiApplication::qt_metacast
+32 (int (*)(...))QGuiApplication::qt_metacall
+40 (int (*)(...))QGuiApplication::~QGuiApplication
+48 (int (*)(...))QGuiApplication::~QGuiApplication
+56 (int (*)(...))QGuiApplication::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QGuiApplication::notify
+120 (int (*)(...))QGuiApplication::compressEvent
+
+Class QGuiApplication
+ size=16 align=8
+ base size=16 base align=8
+QGuiApplication (0x0x7f5277c744e0) 0
+ vptr=((& QGuiApplication::_ZTV15QGuiApplication) + 16)
+ QCoreApplication (0x0x7f5277c74548) 0
+ primary-for QGuiApplication (0x0x7f5277c744e0)
+ QObject (0x0x7f5277fefb40) 0
+ primary-for QCoreApplication (0x0x7f5277c74548)
+
+Class QIconEngine::AvailableSizesArgument
+ size=16 align=8
+ base size=16 base align=8
+QIconEngine::AvailableSizesArgument (0x0x7f52780a4c00) 0
+
+Class QIconEngine::ScaledPixmapArgument
+ size=56 align=8
+ base size=56 base align=8
+QIconEngine::ScaledPixmapArgument (0x0x7f5277d53f00) 0
+
+Vtable for QIconEngine
+QIconEngine::_ZTV11QIconEngine: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QIconEngine)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))QIconEngine::actualSize
+48 (int (*)(...))QIconEngine::pixmap
+56 (int (*)(...))QIconEngine::addPixmap
+64 (int (*)(...))QIconEngine::addFile
+72 (int (*)(...))QIconEngine::key
+80 (int (*)(...))__cxa_pure_virtual
+88 (int (*)(...))QIconEngine::read
+96 (int (*)(...))QIconEngine::write
+104 (int (*)(...))QIconEngine::availableSizes
+112 (int (*)(...))QIconEngine::iconName
+120 (int (*)(...))QIconEngine::virtual_hook
+
+Class QIconEngine
+ size=8 align=8
+ base size=8 base align=8
+QIconEngine (0x0x7f52780a49c0) 0 nearly-empty
+ vptr=((& QIconEngine::_ZTV11QIconEngine) + 16)
+
+Class QIconEnginePlugin::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QIconEnginePlugin::QPrivateSignal (0x0x7f5277d734e0) 0 empty
+
+Vtable for QIconEnginePlugin
+QIconEnginePlugin::_ZTV17QIconEnginePlugin: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QIconEnginePlugin)
+16 (int (*)(...))QIconEnginePlugin::metaObject
+24 (int (*)(...))QIconEnginePlugin::qt_metacast
+32 (int (*)(...))QIconEnginePlugin::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+
+Class QIconEnginePlugin
+ size=16 align=8
+ base size=16 base align=8
+QIconEnginePlugin (0x0x7f5277999a28) 0
+ vptr=((& QIconEnginePlugin::_ZTV17QIconEnginePlugin) + 16)
+ QObject (0x0x7f5277d53f60) 0
+ primary-for QIconEnginePlugin (0x0x7f5277999a28)
+
+Vtable for QImageIOHandler
+QImageIOHandler::_ZTV15QImageIOHandler: 18 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QImageIOHandler)
+16 0
+24 0
+32 (int (*)(...))QImageIOHandler::name
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))QImageIOHandler::write
+64 (int (*)(...))QImageIOHandler::option
+72 (int (*)(...))QImageIOHandler::setOption
+80 (int (*)(...))QImageIOHandler::supportsOption
+88 (int (*)(...))QImageIOHandler::jumpToNextImage
+96 (int (*)(...))QImageIOHandler::jumpToImage
+104 (int (*)(...))QImageIOHandler::loopCount
+112 (int (*)(...))QImageIOHandler::imageCount
+120 (int (*)(...))QImageIOHandler::nextImageDelay
+128 (int (*)(...))QImageIOHandler::currentImageNumber
+136 (int (*)(...))QImageIOHandler::currentImageRect
+
+Class QImageIOHandler
+ size=16 align=8
+ base size=16 base align=8
+QImageIOHandler (0x0x7f5277d73ba0) 0
+ vptr=((& QImageIOHandler::_ZTV15QImageIOHandler) + 16)
+
+Class QImageIOPlugin::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QImageIOPlugin::QPrivateSignal (0x0x7f5277e21600) 0 empty
+
+Vtable for QImageIOPlugin
+QImageIOPlugin::_ZTV14QImageIOPlugin: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QImageIOPlugin)
+16 (int (*)(...))QImageIOPlugin::metaObject
+24 (int (*)(...))QImageIOPlugin::qt_metacast
+32 (int (*)(...))QImageIOPlugin::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+
+Class QImageIOPlugin
+ size=16 align=8
+ base size=16 base align=8
+QImageIOPlugin (0x0x7f5277999a90) 0
+ vptr=((& QImageIOPlugin::_ZTV14QImageIOPlugin) + 16)
+ QObject (0x0x7f5277e215a0) 0
+ primary-for QImageIOPlugin (0x0x7f5277999a90)
+
+Class QImageReader
+ size=8 align=8
+ base size=8 base align=8
+QImageReader (0x0x7f5277c0c780) 0
+
+Class QImageWriter
+ size=8 align=8
+ base size=8 base align=8
+QImageWriter (0x0x7f5277c420c0) 0
+
+Class QVector3D
+ size=12 align=4
+ base size=12 base align=4
+QVector3D (0x0x7f5277c42f00) 0
+
+Class QVector4D
+ size=16 align=4
+ base size=16 base align=4
+QVector4D (0x0x7f52774afae0) 0
+
+Class QQuaternion
+ size=16 align=4
+ base size=16 base align=4
+QQuaternion (0x0x7f5276638780) 0
+
+Class QMatrix4x4
+ size=68 align=4
+ base size=68 base align=4
+QMatrix4x4 (0x0x7f5275affa20) 0
+
+Class QMovie::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QMovie::QPrivateSignal (0x0x7f5274c5f780) 0 empty
+
+Vtable for QMovie
+QMovie::_ZTV6QMovie: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI6QMovie)
+16 (int (*)(...))QMovie::metaObject
+24 (int (*)(...))QMovie::qt_metacast
+32 (int (*)(...))QMovie::qt_metacall
+40 (int (*)(...))QMovie::~QMovie
+48 (int (*)(...))QMovie::~QMovie
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QMovie
+ size=16 align=8
+ base size=16 base align=8
+QMovie (0x0x7f52752b56e8) 0
+ vptr=((& QMovie::_ZTV6QMovie) + 16)
+ QObject (0x0x7f5274c5f6c0) 0
+ primary-for QMovie (0x0x7f52752b56e8)
+
+Class QOffscreenSurface::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QOffscreenSurface::QPrivateSignal (0x0x7f5274ca0d80) 0 empty
+
+Vtable for QOffscreenSurface
+QOffscreenSurface::_ZTV17QOffscreenSurface: 26 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QOffscreenSurface)
+16 (int (*)(...))QOffscreenSurface::metaObject
+24 (int (*)(...))QOffscreenSurface::qt_metacast
+32 (int (*)(...))QOffscreenSurface::qt_metacall
+40 (int (*)(...))QOffscreenSurface::~QOffscreenSurface
+48 (int (*)(...))QOffscreenSurface::~QOffscreenSurface
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QOffscreenSurface::surfaceType
+120 (int (*)(...))QOffscreenSurface::format
+128 (int (*)(...))QOffscreenSurface::size
+136 (int (*)(...))QOffscreenSurface::surfaceHandle
+144 (int (*)(...))-16
+152 (int (*)(...))(& _ZTI17QOffscreenSurface)
+160 (int (*)(...))QOffscreenSurface::_ZThn16_N17QOffscreenSurfaceD1Ev
+168 (int (*)(...))QOffscreenSurface::_ZThn16_N17QOffscreenSurfaceD0Ev
+176 (int (*)(...))QOffscreenSurface::_ZThn16_NK17QOffscreenSurface6formatEv
+184 (int (*)(...))QOffscreenSurface::_ZThn16_NK17QOffscreenSurface13surfaceHandleEv
+192 (int (*)(...))QOffscreenSurface::_ZThn16_NK17QOffscreenSurface11surfaceTypeEv
+200 (int (*)(...))QOffscreenSurface::_ZThn16_NK17QOffscreenSurface4sizeEv
+
+Class QOffscreenSurface
+ size=40 align=8
+ base size=40 base align=8
+QOffscreenSurface (0x0x7f527e430620) 0
+ vptr=((& QOffscreenSurface::_ZTV17QOffscreenSurface) + 16)
+ QObject (0x0x7f5274ca0ae0) 0
+ primary-for QOffscreenSurface (0x0x7f527e430620)
+ QSurface (0x0x7f5274ca0ba0) 16
+ vptr=((& QOffscreenSurface::_ZTV17QOffscreenSurface) + 160)
+
+Class QOpenGLBuffer
+ size=8 align=8
+ base size=8 base align=8
+QOpenGLBuffer (0x0x7f5274ccdf00) 0
+
+Class QOpenGLVersionStatus
+ size=12 align=4
+ base size=12 base align=4
+QOpenGLVersionStatus (0x0x7f52748a7240) 0
+
+Class QOpenGLVersionFunctionsBackend
+ size=16 align=8
+ base size=12 base align=8
+QOpenGLVersionFunctionsBackend (0x0x7f5274136300) 0
+
+Class QOpenGLVersionFunctionsStorage
+ size=8 align=8
+ base size=8 base align=8
+QOpenGLVersionFunctionsStorage (0x0x7f52741368a0) 0
+
+Class QAbstractOpenGLFunctionsPrivate
+ size=16 align=8
+ base size=9 base align=8
+QAbstractOpenGLFunctionsPrivate (0x0x7f52741513c0) 0
+
+Vtable for QAbstractOpenGLFunctions
+QAbstractOpenGLFunctions::_ZTV24QAbstractOpenGLFunctions: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI24QAbstractOpenGLFunctions)
+16 (int (*)(...))QAbstractOpenGLFunctions::~QAbstractOpenGLFunctions
+24 (int (*)(...))QAbstractOpenGLFunctions::~QAbstractOpenGLFunctions
+32 (int (*)(...))QAbstractOpenGLFunctions::initializeOpenGLFunctions
+
+Class QAbstractOpenGLFunctions
+ size=16 align=8
+ base size=16 base align=8
+QAbstractOpenGLFunctions (0x0x7f5274151ae0) 0
+ vptr=((& QAbstractOpenGLFunctions::_ZTV24QAbstractOpenGLFunctions) + 16)
+
+Class QOpenGLFunctions_1_0_CoreBackend::Functions
+ size=384 align=8
+ base size=384 base align=8
+QOpenGLFunctions_1_0_CoreBackend::Functions (0x0x7f52741df2a0) 0
+
+Class QOpenGLFunctions_1_0_CoreBackend
+ size=400 align=8
+ base size=400 base align=8
+QOpenGLFunctions_1_0_CoreBackend (0x0x7f5274e79c30) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f527417aea0) 0
+
+Class QOpenGLFunctions_1_1_CoreBackend::Functions
+ size=128 align=8
+ base size=128 base align=8
+QOpenGLFunctions_1_1_CoreBackend::Functions (0x0x7f5274206ea0) 0
+
+Class QOpenGLFunctions_1_1_CoreBackend
+ size=144 align=8
+ base size=144 base align=8
+QOpenGLFunctions_1_1_CoreBackend (0x0x7f5274e79c98) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f52742068a0) 0
+
+Class QOpenGLFunctions_1_2_CoreBackend::Functions
+ size=48 align=8
+ base size=48 base align=8
+QOpenGLFunctions_1_2_CoreBackend::Functions (0x0x7f5274264360) 0
+
+Class QOpenGLFunctions_1_2_CoreBackend
+ size=64 align=8
+ base size=64 base align=8
+QOpenGLFunctions_1_2_CoreBackend (0x0x7f5274e79d00) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f5274264300) 0
+
+Class QOpenGLFunctions_1_3_CoreBackend::Functions
+ size=72 align=8
+ base size=72 base align=8
+QOpenGLFunctions_1_3_CoreBackend::Functions (0x0x7f52742e2ea0) 0
+
+Class QOpenGLFunctions_1_3_CoreBackend
+ size=88 align=8
+ base size=88 base align=8
+QOpenGLFunctions_1_3_CoreBackend (0x0x7f5274e79d68) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f52742e2de0) 0
+
+Class QOpenGLFunctions_1_4_CoreBackend::Functions
+ size=56 align=8
+ base size=56 base align=8
+QOpenGLFunctions_1_4_CoreBackend::Functions (0x0x7f5273f46120) 0
+
+Class QOpenGLFunctions_1_4_CoreBackend
+ size=72 align=8
+ base size=72 base align=8
+QOpenGLFunctions_1_4_CoreBackend (0x0x7f5274e79dd0) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f5274324900) 0
+
+Class QOpenGLFunctions_1_5_CoreBackend::Functions
+ size=152 align=8
+ base size=152 base align=8
+QOpenGLFunctions_1_5_CoreBackend::Functions (0x0x7f5273f5f5a0) 0
+
+Class QOpenGLFunctions_1_5_CoreBackend
+ size=168 align=8
+ base size=168 base align=8
+QOpenGLFunctions_1_5_CoreBackend (0x0x7f5274e79e38) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f5273f46ea0) 0
+
+Class QOpenGLFunctions_2_0_CoreBackend::Functions
+ size=744 align=8
+ base size=744 base align=8
+QOpenGLFunctions_2_0_CoreBackend::Functions (0x0x7f5273fcbde0) 0
+
+Class QOpenGLFunctions_2_0_CoreBackend
+ size=760 align=8
+ base size=760 base align=8
+QOpenGLFunctions_2_0_CoreBackend (0x0x7f5274e79ea0) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f5273fcbd80) 0
+
+Class QOpenGLFunctions_2_1_CoreBackend::Functions
+ size=48 align=8
+ base size=48 base align=8
+QOpenGLFunctions_2_1_CoreBackend::Functions (0x0x7f5274007d80) 0
+
+Class QOpenGLFunctions_2_1_CoreBackend
+ size=64 align=8
+ base size=64 base align=8
+QOpenGLFunctions_2_1_CoreBackend (0x0x7f5274e79f08) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f5274007060) 0
+
+Class QOpenGLFunctions_3_0_CoreBackend::Functions
+ size=672 align=8
+ base size=672 base align=8
+QOpenGLFunctions_3_0_CoreBackend::Functions (0x0x7f52740ce360) 0
+
+Class QOpenGLFunctions_3_0_CoreBackend
+ size=688 align=8
+ base size=688 base align=8
+QOpenGLFunctions_3_0_CoreBackend (0x0x7f5274e79f70) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f5274088ba0) 0
+
+Class QOpenGLFunctions_3_1_CoreBackend::Functions
+ size=96 align=8
+ base size=96 base align=8
+QOpenGLFunctions_3_1_CoreBackend::Functions (0x0x7f52740f22a0) 0
+
+Class QOpenGLFunctions_3_1_CoreBackend
+ size=112 align=8
+ base size=112 base align=8
+QOpenGLFunctions_3_1_CoreBackend (0x0x7f5274f12000) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f52740f2240) 0
+
+Class QOpenGLFunctions_3_2_CoreBackend::Functions
+ size=152 align=8
+ base size=152 base align=8
+QOpenGLFunctions_3_2_CoreBackend::Functions (0x0x7f5274110480) 0
+
+Class QOpenGLFunctions_3_2_CoreBackend
+ size=168 align=8
+ base size=168 base align=8
+QOpenGLFunctions_3_2_CoreBackend (0x0x7f5274f12068) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f5274110420) 0
+
+Class QOpenGLFunctions_3_3_CoreBackend::Functions
+ size=464 align=8
+ base size=464 base align=8
+QOpenGLFunctions_3_3_CoreBackend::Functions (0x0x7f5273d49000) 0
+
+Class QOpenGLFunctions_3_3_CoreBackend
+ size=480 align=8
+ base size=480 base align=8
+QOpenGLFunctions_3_3_CoreBackend (0x0x7f5274f120d0) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f5273d2cf00) 0
+
+Class QOpenGLFunctions_4_0_CoreBackend::Functions
+ size=368 align=8
+ base size=368 base align=8
+QOpenGLFunctions_4_0_CoreBackend::Functions (0x0x7f5273def660) 0
+
+Class QOpenGLFunctions_4_0_CoreBackend
+ size=384 align=8
+ base size=384 base align=8
+QOpenGLFunctions_4_0_CoreBackend (0x0x7f5274f12138) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f5273def240) 0
+
+Class QOpenGLFunctions_4_1_CoreBackend::Functions
+ size=704 align=8
+ base size=704 base align=8
+QOpenGLFunctions_4_1_CoreBackend::Functions (0x0x7f5273b512a0) 0
+
+Class QOpenGLFunctions_4_1_CoreBackend
+ size=720 align=8
+ base size=720 base align=8
+QOpenGLFunctions_4_1_CoreBackend (0x0x7f5274f121a0) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f5273e0bae0) 0
+
+Class QOpenGLFunctions_4_2_CoreBackend::Functions
+ size=96 align=8
+ base size=96 base align=8
+QOpenGLFunctions_4_2_CoreBackend::Functions (0x0x7f5273b6eb40) 0
+
+Class QOpenGLFunctions_4_2_CoreBackend
+ size=112 align=8
+ base size=112 base align=8
+QOpenGLFunctions_4_2_CoreBackend (0x0x7f5274f12208) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f5273b6e5a0) 0
+
+Class QOpenGLFunctions_4_3_CoreBackend::Functions
+ size=344 align=8
+ base size=344 base align=8
+QOpenGLFunctions_4_3_CoreBackend::Functions (0x0x7f5273c01600) 0
+
+Class QOpenGLFunctions_4_3_CoreBackend
+ size=360 align=8
+ base size=360 base align=8
+QOpenGLFunctions_4_3_CoreBackend (0x0x7f5274f12270) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f5273c01360) 0
+
+Class QOpenGLFunctions_4_4_CoreBackend::Functions
+ size=72 align=8
+ base size=72 base align=8
+QOpenGLFunctions_4_4_CoreBackend::Functions (0x0x7f5273c1b5a0) 0
+
+Class QOpenGLFunctions_4_4_CoreBackend
+ size=88 align=8
+ base size=88 base align=8
+QOpenGLFunctions_4_4_CoreBackend (0x0x7f5274f122d8) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f5273c1b540) 0
+
+Class QOpenGLFunctions_4_5_CoreBackend::Functions
+ size=848 align=8
+ base size=848 base align=8
+QOpenGLFunctions_4_5_CoreBackend::Functions (0x0x7f5273c62360) 0
+
+Class QOpenGLFunctions_4_5_CoreBackend
+ size=864 align=8
+ base size=864 base align=8
+QOpenGLFunctions_4_5_CoreBackend (0x0x7f5274f12340) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f5273c45f00) 0
+
+Class QOpenGLFunctions_1_0_DeprecatedBackend::Functions
+ size=2064 align=8
+ base size=2064 base align=8
+QOpenGLFunctions_1_0_DeprecatedBackend::Functions (0x0x7f5273c62ea0) 0
+
+Class QOpenGLFunctions_1_0_DeprecatedBackend
+ size=2080 align=8
+ base size=2080 base align=8
+QOpenGLFunctions_1_0_DeprecatedBackend (0x0x7f5274f123a8) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f5273c62de0) 0
+
+Class QOpenGLFunctions_1_1_DeprecatedBackend::Functions
+ size=136 align=8
+ base size=136 base align=8
+QOpenGLFunctions_1_1_DeprecatedBackend::Functions (0x0x7f5273ca5540) 0
+
+Class QOpenGLFunctions_1_1_DeprecatedBackend
+ size=152 align=8
+ base size=152 base align=8
+QOpenGLFunctions_1_1_DeprecatedBackend (0x0x7f5274f12410) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f5273ca5480) 0
+
+Class QOpenGLFunctions_1_2_DeprecatedBackend::Functions
+ size=256 align=8
+ base size=256 base align=8
+QOpenGLFunctions_1_2_DeprecatedBackend::Functions (0x0x7f5273cc33c0) 0
+
+Class QOpenGLFunctions_1_2_DeprecatedBackend
+ size=272 align=8
+ base size=272 base align=8
+QOpenGLFunctions_1_2_DeprecatedBackend (0x0x7f5274f12478) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f5273cc3300) 0
+
+Class QOpenGLFunctions_1_3_DeprecatedBackend::Functions
+ size=296 align=8
+ base size=296 base align=8
+QOpenGLFunctions_1_3_DeprecatedBackend::Functions (0x0x7f5273cdb0c0) 0
+
+Class QOpenGLFunctions_1_3_DeprecatedBackend
+ size=312 align=8
+ base size=312 base align=8
+QOpenGLFunctions_1_3_DeprecatedBackend (0x0x7f5274f124e0) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f5273cdb060) 0
+
+Class QOpenGLFunctions_1_4_DeprecatedBackend::Functions
+ size=304 align=8
+ base size=304 base align=8
+QOpenGLFunctions_1_4_DeprecatedBackend::Functions (0x0x7f5273cfe480) 0
+
+Class QOpenGLFunctions_1_4_DeprecatedBackend
+ size=320 align=8
+ base size=320 base align=8
+QOpenGLFunctions_1_4_DeprecatedBackend (0x0x7f5274f12548) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f5273cfe420) 0
+
+Class QOpenGLFunctions_2_0_DeprecatedBackend::Functions
+ size=288 align=8
+ base size=288 base align=8
+QOpenGLFunctions_2_0_DeprecatedBackend::Functions (0x0x7f5273d1b6c0) 0
+
+Class QOpenGLFunctions_2_0_DeprecatedBackend
+ size=304 align=8
+ base size=304 base align=8
+QOpenGLFunctions_2_0_DeprecatedBackend (0x0x7f5274f125b0) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f5273d1b180) 0
+
+Class QOpenGLFunctions_3_0_DeprecatedBackend::Functions
+ size=160 align=8
+ base size=160 base align=8
+QOpenGLFunctions_3_0_DeprecatedBackend::Functions (0x0x7f5273943e40) 0
+
+Class QOpenGLFunctions_3_0_DeprecatedBackend
+ size=176 align=8
+ base size=176 base align=8
+QOpenGLFunctions_3_0_DeprecatedBackend (0x0x7f5274f12618) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f5273943ba0) 0
+
+Class QOpenGLFunctions_3_3_DeprecatedBackend::Functions
+ size=240 align=8
+ base size=240 base align=8
+QOpenGLFunctions_3_3_DeprecatedBackend::Functions (0x0x7f5273960ba0) 0
+
+Class QOpenGLFunctions_3_3_DeprecatedBackend
+ size=256 align=8
+ base size=256 base align=8
+QOpenGLFunctions_3_3_DeprecatedBackend (0x0x7f5274f12680) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f5273960b40) 0
+
+Class QOpenGLFunctions_4_5_DeprecatedBackend::Functions
+ size=96 align=8
+ base size=96 base align=8
+QOpenGLFunctions_4_5_DeprecatedBackend::Functions (0x0x7f52739ab780) 0
+
+Class QOpenGLFunctions_4_5_DeprecatedBackend
+ size=112 align=8
+ base size=112 base align=8
+QOpenGLFunctions_4_5_DeprecatedBackend (0x0x7f5274f126e8) 0
+ QOpenGLVersionFunctionsBackend (0x0x7f52739ab720) 0
+
+Class QOpenGLVersionProfile
+ size=8 align=8
+ base size=8 base align=8
+QOpenGLVersionProfile (0x0x7f52739c72a0) 0
+
+Class QOpenGLContextGroup::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QOpenGLContextGroup::QPrivateSignal (0x0x7f5273b1f2a0) 0 empty
+
+Vtable for QOpenGLContextGroup
+QOpenGLContextGroup::_ZTV19QOpenGLContextGroup: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QOpenGLContextGroup)
+16 (int (*)(...))QOpenGLContextGroup::metaObject
+24 (int (*)(...))QOpenGLContextGroup::qt_metacast
+32 (int (*)(...))QOpenGLContextGroup::qt_metacall
+40 (int (*)(...))QOpenGLContextGroup::~QOpenGLContextGroup
+48 (int (*)(...))QOpenGLContextGroup::~QOpenGLContextGroup
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QOpenGLContextGroup
+ size=16 align=8
+ base size=16 base align=8
+QOpenGLContextGroup (0x0x7f5274c0ae38) 0
+ vptr=((& QOpenGLContextGroup::_ZTV19QOpenGLContextGroup) + 16)
+ QObject (0x0x7f5273b1f240) 0
+ primary-for QOpenGLContextGroup (0x0x7f5274c0ae38)
+
+Class QOpenGLContext::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QOpenGLContext::QPrivateSignal (0x0x7f52737c5780) 0 empty
+
+Vtable for QOpenGLContext
+QOpenGLContext::_ZTV14QOpenGLContext: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QOpenGLContext)
+16 (int (*)(...))QOpenGLContext::metaObject
+24 (int (*)(...))QOpenGLContext::qt_metacast
+32 (int (*)(...))QOpenGLContext::qt_metacall
+40 (int (*)(...))QOpenGLContext::~QOpenGLContext
+48 (int (*)(...))QOpenGLContext::~QOpenGLContext
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QOpenGLContext
+ size=16 align=8
+ base size=16 base align=8
+QOpenGLContext (0x0x7f5274c4f000) 0
+ vptr=((& QOpenGLContext::_ZTV14QOpenGLContext) + 16)
+ QObject (0x0x7f52737c5720) 0
+ primary-for QOpenGLContext (0x0x7f5274c4f000)
+
+Class QOpenGLDebugMessage
+ size=8 align=8
+ base size=8 base align=8
+QOpenGLDebugMessage (0x0x7f52737e5240) 0
+
+Class QOpenGLDebugLogger::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QOpenGLDebugLogger::QPrivateSignal (0x0x7f527b56f8a0) 0 empty
+
+Vtable for QOpenGLDebugLogger
+QOpenGLDebugLogger::_ZTV18QOpenGLDebugLogger: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QOpenGLDebugLogger)
+16 (int (*)(...))QOpenGLDebugLogger::metaObject
+24 (int (*)(...))QOpenGLDebugLogger::qt_metacast
+32 (int (*)(...))QOpenGLDebugLogger::qt_metacall
+40 (int (*)(...))QOpenGLDebugLogger::~QOpenGLDebugLogger
+48 (int (*)(...))QOpenGLDebugLogger::~QOpenGLDebugLogger
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QOpenGLDebugLogger
+ size=16 align=8
+ base size=16 base align=8
+QOpenGLDebugLogger (0x0x7f5273a20478) 0
+ vptr=((& QOpenGLDebugLogger::_ZTV18QOpenGLDebugLogger) + 16)
+ QObject (0x0x7f527b56f840) 0
+ primary-for QOpenGLDebugLogger (0x0x7f5273a20478)
+
+Class QOpenGLFunctions
+ size=8 align=8
+ base size=8 base align=8
+QOpenGLFunctions (0x0x7f527b56fd20) 0
+
+Class QOpenGLFunctionsPrivate::Functions
+ size=1152 align=8
+ base size=1152 base align=8
+QOpenGLFunctionsPrivate::Functions (0x0x7f5279d536c0) 0
+
+Class QOpenGLFunctionsPrivate
+ size=1152 align=8
+ base size=1152 base align=8
+QOpenGLFunctionsPrivate (0x0x7f5279d53660) 0
+
+Class QOpenGLExtraFunctions
+ size=8 align=8
+ base size=8 base align=8
+QOpenGLExtraFunctions (0x0x7f5273b24750) 0
+ QOpenGLFunctions (0x0x7f527882e480) 0
+
+Class QOpenGLExtraFunctionsPrivate::Functions
+ size=1728 align=8
+ base size=1728 base align=8
+QOpenGLExtraFunctionsPrivate::Functions (0x0x7f527882e7e0) 0
+
+Class QOpenGLExtraFunctionsPrivate
+ size=2880 align=8
+ base size=2880 base align=8
+QOpenGLExtraFunctionsPrivate (0x0x7f5273b247b8) 0
+ QOpenGLFunctionsPrivate (0x0x7f527882e780) 0
+
+Vtable for QOpenGLFramebufferObject
+QOpenGLFramebufferObject::_ZTV24QOpenGLFramebufferObject: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI24QOpenGLFramebufferObject)
+16 (int (*)(...))QOpenGLFramebufferObject::~QOpenGLFramebufferObject
+24 (int (*)(...))QOpenGLFramebufferObject::~QOpenGLFramebufferObject
+
+Class QOpenGLFramebufferObject
+ size=16 align=8
+ base size=16 base align=8
+QOpenGLFramebufferObject (0x0x7f5274e4c2a0) 0
+ vptr=((& QOpenGLFramebufferObject::_ZTV24QOpenGLFramebufferObject) + 16)
+
+Class QOpenGLFramebufferObjectFormat
+ size=8 align=8
+ base size=8 base align=8
+QOpenGLFramebufferObjectFormat (0x0x7f5274e4c540) 0
+
+Vtable for QOpenGLPaintDevice
+QOpenGLPaintDevice::_ZTV18QOpenGLPaintDevice: 11 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QOpenGLPaintDevice)
+16 (int (*)(...))QOpenGLPaintDevice::~QOpenGLPaintDevice
+24 (int (*)(...))QOpenGLPaintDevice::~QOpenGLPaintDevice
+32 (int (*)(...))QOpenGLPaintDevice::devType
+40 (int (*)(...))QOpenGLPaintDevice::paintEngine
+48 (int (*)(...))QOpenGLPaintDevice::metric
+56 (int (*)(...))QPaintDevice::initPainter
+64 (int (*)(...))QPaintDevice::redirected
+72 (int (*)(...))QPaintDevice::sharedPainter
+80 (int (*)(...))QOpenGLPaintDevice::ensureActiveTarget
+
+Class QOpenGLPaintDevice
+ size=32 align=8
+ base size=32 base align=8
+QOpenGLPaintDevice (0x0x7f5274b782d8) 0
+ vptr=((& QOpenGLPaintDevice::_ZTV18QOpenGLPaintDevice) + 16)
+ QPaintDevice (0x0x7f5274e4c5a0) 0
+ primary-for QOpenGLPaintDevice (0x0x7f5274b782d8)
+
+Class QOpenGLPixelTransferOptions
+ size=8 align=8
+ base size=8 base align=8
+QOpenGLPixelTransferOptions (0x0x7f5274e4c7e0) 0
+
+Class QOpenGLShader::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QOpenGLShader::QPrivateSignal (0x0x7f5274014600) 0 empty
+
+Vtable for QOpenGLShader
+QOpenGLShader::_ZTV13QOpenGLShader: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QOpenGLShader)
+16 (int (*)(...))QOpenGLShader::metaObject
+24 (int (*)(...))QOpenGLShader::qt_metacast
+32 (int (*)(...))QOpenGLShader::qt_metacall
+40 (int (*)(...))QOpenGLShader::~QOpenGLShader
+48 (int (*)(...))QOpenGLShader::~QOpenGLShader
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QOpenGLShader
+ size=16 align=8
+ base size=16 base align=8
+QOpenGLShader (0x0x7f52740c3410) 0
+ vptr=((& QOpenGLShader::_ZTV13QOpenGLShader) + 16)
+ QObject (0x0x7f52740145a0) 0
+ primary-for QOpenGLShader (0x0x7f52740c3410)
+
+Class QOpenGLShaderProgram::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QOpenGLShaderProgram::QPrivateSignal (0x0x7f5274014f00) 0 empty
+
+Vtable for QOpenGLShaderProgram
+QOpenGLShaderProgram::_ZTV20QOpenGLShaderProgram: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QOpenGLShaderProgram)
+16 (int (*)(...))QOpenGLShaderProgram::metaObject
+24 (int (*)(...))QOpenGLShaderProgram::qt_metacast
+32 (int (*)(...))QOpenGLShaderProgram::qt_metacall
+40 (int (*)(...))QOpenGLShaderProgram::~QOpenGLShaderProgram
+48 (int (*)(...))QOpenGLShaderProgram::~QOpenGLShaderProgram
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QOpenGLShaderProgram::link
+
+Class QOpenGLShaderProgram
+ size=16 align=8
+ base size=16 base align=8
+QOpenGLShaderProgram (0x0x7f52740c3548) 0
+ vptr=((& QOpenGLShaderProgram::_ZTV20QOpenGLShaderProgram) + 16)
+ QObject (0x0x7f5274014ea0) 0
+ primary-for QOpenGLShaderProgram (0x0x7f52740c3548)
+
+Class QOpenGLTexture
+ size=8 align=8
+ base size=8 base align=8
+QOpenGLTexture (0x0x7f52732bf120) 0
+
+Class QOpenGLTextureBlitter
+ size=8 align=8
+ base size=8 base align=8
+QOpenGLTextureBlitter (0x0x7f527beb0600) 0
+
+Class QOpenGLTimerQuery::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QOpenGLTimerQuery::QPrivateSignal (0x0x7f527beb0840) 0 empty
+
+Vtable for QOpenGLTimerQuery
+QOpenGLTimerQuery::_ZTV17QOpenGLTimerQuery: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QOpenGLTimerQuery)
+16 (int (*)(...))QOpenGLTimerQuery::metaObject
+24 (int (*)(...))QOpenGLTimerQuery::qt_metacast
+32 (int (*)(...))QOpenGLTimerQuery::qt_metacall
+40 (int (*)(...))QOpenGLTimerQuery::~QOpenGLTimerQuery
+48 (int (*)(...))QOpenGLTimerQuery::~QOpenGLTimerQuery
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QOpenGLTimerQuery
+ size=16 align=8
+ base size=16 base align=8
+QOpenGLTimerQuery (0x0x7f52740c3680) 0
+ vptr=((& QOpenGLTimerQuery::_ZTV17QOpenGLTimerQuery) + 16)
+ QObject (0x0x7f527beb07e0) 0
+ primary-for QOpenGLTimerQuery (0x0x7f52740c3680)
+
+Class QOpenGLTimeMonitor::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QOpenGLTimeMonitor::QPrivateSignal (0x0x7f527beb0a80) 0 empty
+
+Vtable for QOpenGLTimeMonitor
+QOpenGLTimeMonitor::_ZTV18QOpenGLTimeMonitor: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QOpenGLTimeMonitor)
+16 (int (*)(...))QOpenGLTimeMonitor::metaObject
+24 (int (*)(...))QOpenGLTimeMonitor::qt_metacast
+32 (int (*)(...))QOpenGLTimeMonitor::qt_metacall
+40 (int (*)(...))QOpenGLTimeMonitor::~QOpenGLTimeMonitor
+48 (int (*)(...))QOpenGLTimeMonitor::~QOpenGLTimeMonitor
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QOpenGLTimeMonitor
+ size=16 align=8
+ base size=16 base align=8
+QOpenGLTimeMonitor (0x0x7f52740c36e8) 0
+ vptr=((& QOpenGLTimeMonitor::_ZTV18QOpenGLTimeMonitor) + 16)
+ QObject (0x0x7f527beb0a20) 0
+ primary-for QOpenGLTimeMonitor (0x0x7f52740c36e8)
+
+Class QOpenGLVertexArrayObject::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QOpenGLVertexArrayObject::QPrivateSignal (0x0x7f527beb0cc0) 0 empty
+
+Class QOpenGLVertexArrayObject::Binder
+ size=8 align=8
+ base size=8 base align=8
+QOpenGLVertexArrayObject::Binder (0x0x7f527beb0d20) 0
+
+Vtable for QOpenGLVertexArrayObject
+QOpenGLVertexArrayObject::_ZTV24QOpenGLVertexArrayObject: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI24QOpenGLVertexArrayObject)
+16 (int (*)(...))QOpenGLVertexArrayObject::metaObject
+24 (int (*)(...))QOpenGLVertexArrayObject::qt_metacast
+32 (int (*)(...))QOpenGLVertexArrayObject::qt_metacall
+40 (int (*)(...))QOpenGLVertexArrayObject::~QOpenGLVertexArrayObject
+48 (int (*)(...))QOpenGLVertexArrayObject::~QOpenGLVertexArrayObject
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QOpenGLVertexArrayObject
+ size=16 align=8
+ base size=16 base align=8
+QOpenGLVertexArrayObject (0x0x7f52740c3750) 0
+ vptr=((& QOpenGLVertexArrayObject::_ZTV24QOpenGLVertexArrayObject) + 16)
+ QObject (0x0x7f527beb0c60) 0
+ primary-for QOpenGLVertexArrayObject (0x0x7f52740c3750)
+
+Class QPaintDeviceWindow::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QPaintDeviceWindow::QPrivateSignal (0x0x7f5279fea420) 0 empty
+
+Vtable for QPaintDeviceWindow
+QPaintDeviceWindow::_ZTV18QPaintDeviceWindow: 58 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QPaintDeviceWindow)
+16 (int (*)(...))QPaintDeviceWindow::metaObject
+24 (int (*)(...))QPaintDeviceWindow::qt_metacast
+32 (int (*)(...))QPaintDeviceWindow::qt_metacall
+40 (int (*)(...))QPaintDeviceWindow::~QPaintDeviceWindow
+48 (int (*)(...))QPaintDeviceWindow::~QPaintDeviceWindow
+56 (int (*)(...))QPaintDeviceWindow::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWindow::surfaceType
+120 (int (*)(...))QWindow::format
+128 (int (*)(...))QWindow::size
+136 (int (*)(...))QWindow::accessibleRoot
+144 (int (*)(...))QWindow::focusObject
+152 (int (*)(...))QPaintDeviceWindow::exposeEvent
+160 (int (*)(...))QWindow::resizeEvent
+168 (int (*)(...))QWindow::moveEvent
+176 (int (*)(...))QWindow::focusInEvent
+184 (int (*)(...))QWindow::focusOutEvent
+192 (int (*)(...))QWindow::showEvent
+200 (int (*)(...))QWindow::hideEvent
+208 (int (*)(...))QWindow::keyPressEvent
+216 (int (*)(...))QWindow::keyReleaseEvent
+224 (int (*)(...))QWindow::mousePressEvent
+232 (int (*)(...))QWindow::mouseReleaseEvent
+240 (int (*)(...))QWindow::mouseDoubleClickEvent
+248 (int (*)(...))QWindow::mouseMoveEvent
+256 (int (*)(...))QWindow::wheelEvent
+264 (int (*)(...))QWindow::touchEvent
+272 (int (*)(...))QWindow::tabletEvent
+280 (int (*)(...))QWindow::nativeEvent
+288 (int (*)(...))QWindow::surfaceHandle
+296 (int (*)(...))QPaintDeviceWindow::paintEvent
+304 (int (*)(...))QPaintDeviceWindow::metric
+312 (int (*)(...))QPaintDeviceWindow::paintEngine
+320 (int (*)(...))-16
+328 (int (*)(...))(& _ZTI18QPaintDeviceWindow)
+336 (int (*)(...))QPaintDeviceWindow::_ZThn16_N18QPaintDeviceWindowD1Ev
+344 (int (*)(...))QPaintDeviceWindow::_ZThn16_N18QPaintDeviceWindowD0Ev
+352 (int (*)(...))QWindow::_ZThn16_NK7QWindow6formatEv
+360 (int (*)(...))QWindow::_ZThn16_NK7QWindow13surfaceHandleEv
+368 (int (*)(...))QWindow::_ZThn16_NK7QWindow11surfaceTypeEv
+376 (int (*)(...))QWindow::_ZThn16_NK7QWindow4sizeEv
+384 (int (*)(...))-40
+392 (int (*)(...))(& _ZTI18QPaintDeviceWindow)
+400 (int (*)(...))QPaintDeviceWindow::_ZThn40_N18QPaintDeviceWindowD1Ev
+408 (int (*)(...))QPaintDeviceWindow::_ZThn40_N18QPaintDeviceWindowD0Ev
+416 (int (*)(...))QPaintDevice::devType
+424 (int (*)(...))QPaintDeviceWindow::_ZThn40_NK18QPaintDeviceWindow11paintEngineEv
+432 (int (*)(...))QPaintDeviceWindow::_ZThn40_NK18QPaintDeviceWindow6metricEN12QPaintDevice17PaintDeviceMetricE
+440 (int (*)(...))QPaintDevice::initPainter
+448 (int (*)(...))QPaintDevice::redirected
+456 (int (*)(...))QPaintDevice::sharedPainter
+
+Class QPaintDeviceWindow
+ size=64 align=8
+ base size=64 base align=8
+QPaintDeviceWindow (0x0x7f527ccb3cb0) 0
+ vptr=((& QPaintDeviceWindow::_ZTV18QPaintDeviceWindow) + 16)
+ QWindow (0x0x7f527ccb3d20) 0
+ primary-for QPaintDeviceWindow (0x0x7f527ccb3cb0)
+ QObject (0x0x7f5279fea300) 0
+ primary-for QWindow (0x0x7f527ccb3d20)
+ QSurface (0x0x7f5279fea360) 16
+ vptr=((& QPaintDeviceWindow::_ZTV18QPaintDeviceWindow) + 336)
+ QPaintDevice (0x0x7f5279fea3c0) 40
+ vptr=((& QPaintDeviceWindow::_ZTV18QPaintDeviceWindow) + 400)
+
+Class QOpenGLWindow::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QOpenGLWindow::QPrivateSignal (0x0x7f5279fea720) 0 empty
+
+Vtable for QOpenGLWindow
+QOpenGLWindow::_ZTV13QOpenGLWindow: 64 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QOpenGLWindow)
+16 (int (*)(...))QOpenGLWindow::metaObject
+24 (int (*)(...))QOpenGLWindow::qt_metacast
+32 (int (*)(...))QOpenGLWindow::qt_metacall
+40 (int (*)(...))QOpenGLWindow::~QOpenGLWindow
+48 (int (*)(...))QOpenGLWindow::~QOpenGLWindow
+56 (int (*)(...))QPaintDeviceWindow::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWindow::surfaceType
+120 (int (*)(...))QWindow::format
+128 (int (*)(...))QWindow::size
+136 (int (*)(...))QWindow::accessibleRoot
+144 (int (*)(...))QWindow::focusObject
+152 (int (*)(...))QPaintDeviceWindow::exposeEvent
+160 (int (*)(...))QOpenGLWindow::resizeEvent
+168 (int (*)(...))QWindow::moveEvent
+176 (int (*)(...))QWindow::focusInEvent
+184 (int (*)(...))QWindow::focusOutEvent
+192 (int (*)(...))QWindow::showEvent
+200 (int (*)(...))QWindow::hideEvent
+208 (int (*)(...))QWindow::keyPressEvent
+216 (int (*)(...))QWindow::keyReleaseEvent
+224 (int (*)(...))QWindow::mousePressEvent
+232 (int (*)(...))QWindow::mouseReleaseEvent
+240 (int (*)(...))QWindow::mouseDoubleClickEvent
+248 (int (*)(...))QWindow::mouseMoveEvent
+256 (int (*)(...))QWindow::wheelEvent
+264 (int (*)(...))QWindow::touchEvent
+272 (int (*)(...))QWindow::tabletEvent
+280 (int (*)(...))QWindow::nativeEvent
+288 (int (*)(...))QWindow::surfaceHandle
+296 (int (*)(...))QOpenGLWindow::paintEvent
+304 (int (*)(...))QOpenGLWindow::metric
+312 (int (*)(...))QPaintDeviceWindow::paintEngine
+320 (int (*)(...))QOpenGLWindow::initializeGL
+328 (int (*)(...))QOpenGLWindow::resizeGL
+336 (int (*)(...))QOpenGLWindow::paintGL
+344 (int (*)(...))QOpenGLWindow::paintUnderGL
+352 (int (*)(...))QOpenGLWindow::paintOverGL
+360 (int (*)(...))QOpenGLWindow::redirected
+368 (int (*)(...))-16
+376 (int (*)(...))(& _ZTI13QOpenGLWindow)
+384 (int (*)(...))QOpenGLWindow::_ZThn16_N13QOpenGLWindowD1Ev
+392 (int (*)(...))QOpenGLWindow::_ZThn16_N13QOpenGLWindowD0Ev
+400 (int (*)(...))QWindow::_ZThn16_NK7QWindow6formatEv
+408 (int (*)(...))QWindow::_ZThn16_NK7QWindow13surfaceHandleEv
+416 (int (*)(...))QWindow::_ZThn16_NK7QWindow11surfaceTypeEv
+424 (int (*)(...))QWindow::_ZThn16_NK7QWindow4sizeEv
+432 (int (*)(...))-40
+440 (int (*)(...))(& _ZTI13QOpenGLWindow)
+448 (int (*)(...))QOpenGLWindow::_ZThn40_N13QOpenGLWindowD1Ev
+456 (int (*)(...))QOpenGLWindow::_ZThn40_N13QOpenGLWindowD0Ev
+464 (int (*)(...))QPaintDevice::devType
+472 (int (*)(...))QPaintDeviceWindow::_ZThn40_NK18QPaintDeviceWindow11paintEngineEv
+480 (int (*)(...))QOpenGLWindow::_ZThn40_NK13QOpenGLWindow6metricEN12QPaintDevice17PaintDeviceMetricE
+488 (int (*)(...))QPaintDevice::initPainter
+496 (int (*)(...))QOpenGLWindow::_ZThn40_NK13QOpenGLWindow10redirectedEP6QPoint
+504 (int (*)(...))QPaintDevice::sharedPainter
+
+Class QOpenGLWindow
+ size=64 align=8
+ base size=64 base align=8
+QOpenGLWindow (0x0x7f52740c3820) 0
+ vptr=((& QOpenGLWindow::_ZTV13QOpenGLWindow) + 16)
+ QPaintDeviceWindow (0x0x7f527ccb3ee0) 0
+ primary-for QOpenGLWindow (0x0x7f52740c3820)
+ QWindow (0x0x7f527ccb3f50) 0
+ primary-for QPaintDeviceWindow (0x0x7f527ccb3ee0)
+ QObject (0x0x7f5279fea600) 0
+ primary-for QWindow (0x0x7f527ccb3f50)
+ QSurface (0x0x7f5279fea660) 16
+ vptr=((& QOpenGLWindow::_ZTV13QOpenGLWindow) + 384)
+ QPaintDevice (0x0x7f5279fea6c0) 40
+ vptr=((& QOpenGLWindow::_ZTV13QOpenGLWindow) + 448)
+
+Class QPageSize
+ size=8 align=8
+ base size=8 base align=8
+QPageSize (0x0x7f5279fea900) 0
+
+Class QPageLayout
+ size=8 align=8
+ base size=8 base align=8
+QPageLayout (0x0x7f5278cb0e40) 0
+
+Class QPagedPaintDevice::Margins
+ size=32 align=8
+ base size=32 base align=8
+QPagedPaintDevice::Margins (0x0x7f52775fe900) 0
+
+Vtable for QPagedPaintDevice
+QPagedPaintDevice::_ZTV17QPagedPaintDevice: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QPagedPaintDevice)
+16 0
+24 0
+32 (int (*)(...))QPaintDevice::devType
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))QPaintDevice::metric
+56 (int (*)(...))QPaintDevice::initPainter
+64 (int (*)(...))QPaintDevice::redirected
+72 (int (*)(...))QPaintDevice::sharedPainter
+80 (int (*)(...))__cxa_pure_virtual
+88 (int (*)(...))QPagedPaintDevice::setPageSize
+96 (int (*)(...))QPagedPaintDevice::setPageSizeMM
+104 (int (*)(...))QPagedPaintDevice::setMargins
+
+Class QPagedPaintDevice
+ size=32 align=8
+ base size=32 base align=8
+QPagedPaintDevice (0x0x7f527778ac30) 0
+ vptr=((& QPagedPaintDevice::_ZTV17QPagedPaintDevice) + 16)
+ QPaintDevice (0x0x7f52775fe8a0) 0
+ primary-for QPagedPaintDevice (0x0x7f527778ac30)
+
+Class QPainter::PixmapFragment
+ size=80 align=8
+ base size=80 base align=8
+QPainter::PixmapFragment (0x0x7f52775fe9c0) 0
+
+Class QPainter
+ size=8 align=8
+ base size=8 base align=8
+QPainter (0x0x7f52775fe960) 0
+
+Class QTextItem
+ size=1 align=1
+ base size=0 base align=1
+QTextItem (0x0x7f527c605ba0) 0 empty
+
+Vtable for QPaintEngine
+QPaintEngine::_ZTV12QPaintEngine: 24 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QPaintEngine)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))QPaintEngine::drawRects
+64 (int (*)(...))QPaintEngine::drawRects
+72 (int (*)(...))QPaintEngine::drawLines
+80 (int (*)(...))QPaintEngine::drawLines
+88 (int (*)(...))QPaintEngine::drawEllipse
+96 (int (*)(...))QPaintEngine::drawEllipse
+104 (int (*)(...))QPaintEngine::drawPath
+112 (int (*)(...))QPaintEngine::drawPoints
+120 (int (*)(...))QPaintEngine::drawPoints
+128 (int (*)(...))QPaintEngine::drawPolygon
+136 (int (*)(...))QPaintEngine::drawPolygon
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))QPaintEngine::drawTextItem
+160 (int (*)(...))QPaintEngine::drawTiledPixmap
+168 (int (*)(...))QPaintEngine::drawImage
+176 (int (*)(...))QPaintEngine::coordinateOffset
+184 (int (*)(...))__cxa_pure_virtual
+
+Class QPaintEngine
+ size=32 align=8
+ base size=32 base align=8
+QPaintEngine (0x0x7f5279401ae0) 0
+ vptr=((& QPaintEngine::_ZTV12QPaintEngine) + 16)
+
+Class QPaintEngineState
+ size=4 align=4
+ base size=4 base align=4
+QPaintEngineState (0x0x7f5276444300) 0
+
+Class QPainterPath::Element
+ size=24 align=8
+ base size=24 base align=8
+QPainterPath::Element (0x0x7f5273f84a20) 0
+
+Class QPainterPath
+ size=8 align=8
+ base size=8 base align=8
+QPainterPath (0x0x7f5273f849c0) 0
+
+Class QPainterPathStroker
+ size=8 align=8
+ base size=8 base align=8
+QPainterPathStroker (0x0x7f5279223d80) 0
+
+Class QPdfWriter::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QPdfWriter::QPrivateSignal (0x0x7f52792d25a0) 0 empty
+
+Vtable for QPdfWriter
+QPdfWriter::_ZTV10QPdfWriter: 34 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QPdfWriter)
+16 (int (*)(...))QPdfWriter::metaObject
+24 (int (*)(...))QPdfWriter::qt_metacast
+32 (int (*)(...))QPdfWriter::qt_metacall
+40 (int (*)(...))QPdfWriter::~QPdfWriter
+48 (int (*)(...))QPdfWriter::~QPdfWriter
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QPdfWriter::newPage
+120 (int (*)(...))QPdfWriter::setPageSize
+128 (int (*)(...))QPdfWriter::setPageSizeMM
+136 (int (*)(...))QPdfWriter::setMargins
+144 (int (*)(...))QPdfWriter::paintEngine
+152 (int (*)(...))QPdfWriter::metric
+160 (int (*)(...))-16
+168 (int (*)(...))(& _ZTI10QPdfWriter)
+176 (int (*)(...))QPdfWriter::_ZThn16_N10QPdfWriterD1Ev
+184 (int (*)(...))QPdfWriter::_ZThn16_N10QPdfWriterD0Ev
+192 (int (*)(...))QPaintDevice::devType
+200 (int (*)(...))QPdfWriter::_ZThn16_NK10QPdfWriter11paintEngineEv
+208 (int (*)(...))QPdfWriter::_ZThn16_NK10QPdfWriter6metricEN12QPaintDevice17PaintDeviceMetricE
+216 (int (*)(...))QPaintDevice::initPainter
+224 (int (*)(...))QPaintDevice::redirected
+232 (int (*)(...))QPaintDevice::sharedPainter
+240 (int (*)(...))QPdfWriter::_ZThn16_N10QPdfWriter7newPageEv
+248 (int (*)(...))QPdfWriter::_ZThn16_N10QPdfWriter11setPageSizeEN17QPagedPaintDevice8PageSizeE
+256 (int (*)(...))QPdfWriter::_ZThn16_N10QPdfWriter13setPageSizeMMERK6QSizeF
+264 (int (*)(...))QPdfWriter::_ZThn16_N10QPdfWriter10setMarginsERKN17QPagedPaintDevice7MarginsE
+
+Class QPdfWriter
+ size=48 align=8
+ base size=48 base align=8
+QPdfWriter (0x0x7f527b07da80) 0
+ vptr=((& QPdfWriter::_ZTV10QPdfWriter) + 16)
+ QObject (0x0x7f52792d24e0) 0
+ primary-for QPdfWriter (0x0x7f527b07da80)
+ QPagedPaintDevice (0x0x7f5279237410) 16
+ vptr=((& QPdfWriter::_ZTV10QPdfWriter) + 176)
+ QPaintDevice (0x0x7f52792d2540) 16
+ primary-for QPagedPaintDevice (0x0x7f5279237410)
+
+Vtable for QPicture
+QPicture::_ZTV8QPicture: 11 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI8QPicture)
+16 (int (*)(...))QPicture::~QPicture
+24 (int (*)(...))QPicture::~QPicture
+32 (int (*)(...))QPicture::devType
+40 (int (*)(...))QPicture::paintEngine
+48 (int (*)(...))QPicture::metric
+56 (int (*)(...))QPaintDevice::initPainter
+64 (int (*)(...))QPaintDevice::redirected
+72 (int (*)(...))QPaintDevice::sharedPainter
+80 (int (*)(...))QPicture::setData
+
+Class QPicture
+ size=32 align=8
+ base size=32 base align=8
+QPicture (0x0x7f5279237478) 0
+ vptr=((& QPicture::_ZTV8QPicture) + 16)
+ QPaintDevice (0x0x7f52792d2900) 0
+ primary-for QPicture (0x0x7f5279237478)
+
+Class QPictureIO
+ size=8 align=8
+ base size=8 base align=8
+QPictureIO (0x0x7f5277da89c0) 0
+
+Class QPictureFormatPlugin::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QPictureFormatPlugin::QPrivateSignal (0x0x7f5277da8a80) 0 empty
+
+Vtable for QPictureFormatPlugin
+QPictureFormatPlugin::_ZTV20QPictureFormatPlugin: 17 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QPictureFormatPlugin)
+16 (int (*)(...))QPictureFormatPlugin::metaObject
+24 (int (*)(...))QPictureFormatPlugin::qt_metacast
+32 (int (*)(...))QPictureFormatPlugin::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QPictureFormatPlugin::loadPicture
+120 (int (*)(...))QPictureFormatPlugin::savePicture
+128 (int (*)(...))__cxa_pure_virtual
+
+Class QPictureFormatPlugin
+ size=16 align=8
+ base size=16 base align=8
+QPictureFormatPlugin (0x0x7f5277d31e38) 0
+ vptr=((& QPictureFormatPlugin::_ZTV20QPictureFormatPlugin) + 16)
+ QObject (0x0x7f5277da8a20) 0
+ primary-for QPictureFormatPlugin (0x0x7f5277d31e38)
+
+Class QPixmapCache::Key
+ size=8 align=8
+ base size=8 base align=8
+QPixmapCache::Key (0x0x7f5277da8c00) 0
+
+Class QPixmapCache
+ size=1 align=1
+ base size=0 base align=1
+QPixmapCache (0x0x7f5277da8ba0) 0 empty
+
+Class QRasterWindow::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QRasterWindow::QPrivateSignal (0x0x7f5274d673c0) 0 empty
+
+Vtable for QRasterWindow
+QRasterWindow::_ZTV13QRasterWindow: 59 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QRasterWindow)
+16 (int (*)(...))QRasterWindow::metaObject
+24 (int (*)(...))QRasterWindow::qt_metacast
+32 (int (*)(...))QRasterWindow::qt_metacall
+40 (int (*)(...))QRasterWindow::~QRasterWindow
+48 (int (*)(...))QRasterWindow::~QRasterWindow
+56 (int (*)(...))QPaintDeviceWindow::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWindow::surfaceType
+120 (int (*)(...))QWindow::format
+128 (int (*)(...))QWindow::size
+136 (int (*)(...))QWindow::accessibleRoot
+144 (int (*)(...))QWindow::focusObject
+152 (int (*)(...))QPaintDeviceWindow::exposeEvent
+160 (int (*)(...))QWindow::resizeEvent
+168 (int (*)(...))QWindow::moveEvent
+176 (int (*)(...))QWindow::focusInEvent
+184 (int (*)(...))QWindow::focusOutEvent
+192 (int (*)(...))QWindow::showEvent
+200 (int (*)(...))QWindow::hideEvent
+208 (int (*)(...))QWindow::keyPressEvent
+216 (int (*)(...))QWindow::keyReleaseEvent
+224 (int (*)(...))QWindow::mousePressEvent
+232 (int (*)(...))QWindow::mouseReleaseEvent
+240 (int (*)(...))QWindow::mouseDoubleClickEvent
+248 (int (*)(...))QWindow::mouseMoveEvent
+256 (int (*)(...))QWindow::wheelEvent
+264 (int (*)(...))QWindow::touchEvent
+272 (int (*)(...))QWindow::tabletEvent
+280 (int (*)(...))QWindow::nativeEvent
+288 (int (*)(...))QWindow::surfaceHandle
+296 (int (*)(...))QPaintDeviceWindow::paintEvent
+304 (int (*)(...))QRasterWindow::metric
+312 (int (*)(...))QPaintDeviceWindow::paintEngine
+320 (int (*)(...))QRasterWindow::redirected
+328 (int (*)(...))-16
+336 (int (*)(...))(& _ZTI13QRasterWindow)
+344 (int (*)(...))QRasterWindow::_ZThn16_N13QRasterWindowD1Ev
+352 (int (*)(...))QRasterWindow::_ZThn16_N13QRasterWindowD0Ev
+360 (int (*)(...))QWindow::_ZThn16_NK7QWindow6formatEv
+368 (int (*)(...))QWindow::_ZThn16_NK7QWindow13surfaceHandleEv
+376 (int (*)(...))QWindow::_ZThn16_NK7QWindow11surfaceTypeEv
+384 (int (*)(...))QWindow::_ZThn16_NK7QWindow4sizeEv
+392 (int (*)(...))-40
+400 (int (*)(...))(& _ZTI13QRasterWindow)
+408 (int (*)(...))QRasterWindow::_ZThn40_N13QRasterWindowD1Ev
+416 (int (*)(...))QRasterWindow::_ZThn40_N13QRasterWindowD0Ev
+424 (int (*)(...))QPaintDevice::devType
+432 (int (*)(...))QPaintDeviceWindow::_ZThn40_NK18QPaintDeviceWindow11paintEngineEv
+440 (int (*)(...))QRasterWindow::_ZThn40_NK13QRasterWindow6metricEN12QPaintDevice17PaintDeviceMetricE
+448 (int (*)(...))QPaintDevice::initPainter
+456 (int (*)(...))QRasterWindow::_ZThn40_NK13QRasterWindow10redirectedEP6QPoint
+464 (int (*)(...))QPaintDevice::sharedPainter
+
+Class QRasterWindow
+ size=64 align=8
+ base size=64 base align=8
+QRasterWindow (0x0x7f5274d61a90) 0
+ vptr=((& QRasterWindow::_ZTV13QRasterWindow) + 16)
+ QPaintDeviceWindow (0x0x7f527a8baa80) 0
+ primary-for QRasterWindow (0x0x7f5274d61a90)
+ QWindow (0x0x7f527a8baaf0) 0
+ primary-for QPaintDeviceWindow (0x0x7f527a8baa80)
+ QObject (0x0x7f5274d672a0) 0
+ primary-for QWindow (0x0x7f527a8baaf0)
+ QSurface (0x0x7f5274d67300) 16
+ vptr=((& QRasterWindow::_ZTV13QRasterWindow) + 344)
+ QPaintDevice (0x0x7f5274d67360) 40
+ vptr=((& QRasterWindow::_ZTV13QRasterWindow) + 408)
+
+Class QScreen::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QScreen::QPrivateSignal (0x0x7f5274d67600) 0 empty
+
+Vtable for QScreen
+QScreen::_ZTV7QScreen: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI7QScreen)
+16 (int (*)(...))QScreen::metaObject
+24 (int (*)(...))QScreen::qt_metacast
+32 (int (*)(...))QScreen::qt_metacall
+40 (int (*)(...))QScreen::~QScreen
+48 (int (*)(...))QScreen::~QScreen
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QScreen
+ size=16 align=8
+ base size=16 base align=8
+QScreen (0x0x7f5274d61b60) 0
+ vptr=((& QScreen::_ZTV7QScreen) + 16)
+ QObject (0x0x7f5274d675a0) 0
+ primary-for QScreen (0x0x7f5274d61b60)
+
+Class QSessionManager::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSessionManager::QPrivateSignal (0x0x7f5274d67840) 0 empty
+
+Vtable for QSessionManager
+QSessionManager::_ZTV15QSessionManager: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QSessionManager)
+16 (int (*)(...))QSessionManager::metaObject
+24 (int (*)(...))QSessionManager::qt_metacast
+32 (int (*)(...))QSessionManager::qt_metacall
+40 (int (*)(...))QSessionManager::~QSessionManager
+48 (int (*)(...))QSessionManager::~QSessionManager
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QSessionManager
+ size=16 align=8
+ base size=16 base align=8
+QSessionManager (0x0x7f5274d61bc8) 0
+ vptr=((& QSessionManager::_ZTV15QSessionManager) + 16)
+ QObject (0x0x7f5274d677e0) 0
+ primary-for QSessionManager (0x0x7f5274d61bc8)
+
+Vtable for QStandardItem
+QStandardItem::_ZTV13QStandardItem: 11 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QStandardItem)
+16 (int (*)(...))QStandardItem::~QStandardItem
+24 (int (*)(...))QStandardItem::~QStandardItem
+32 (int (*)(...))QStandardItem::data
+40 (int (*)(...))QStandardItem::setData
+48 (int (*)(...))QStandardItem::clone
+56 (int (*)(...))QStandardItem::type
+64 (int (*)(...))QStandardItem::read
+72 (int (*)(...))QStandardItem::write
+80 (int (*)(...))QStandardItem::operator<
+
+Class QStandardItem
+ size=16 align=8
+ base size=16 base align=8
+QStandardItem (0x0x7f5274d67a20) 0
+ vptr=((& QStandardItem::_ZTV13QStandardItem) + 16)
+
+Class QStandardItemModel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QStandardItemModel::QPrivateSignal (0x0x7f5273f831e0) 0 empty
+
+Vtable for QStandardItemModel
+QStandardItemModel::_ZTV18QStandardItemModel: 48 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QStandardItemModel)
+16 (int (*)(...))QStandardItemModel::metaObject
+24 (int (*)(...))QStandardItemModel::qt_metacast
+32 (int (*)(...))QStandardItemModel::qt_metacall
+40 (int (*)(...))QStandardItemModel::~QStandardItemModel
+48 (int (*)(...))QStandardItemModel::~QStandardItemModel
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QStandardItemModel::index
+120 (int (*)(...))QStandardItemModel::parent
+128 (int (*)(...))QStandardItemModel::sibling
+136 (int (*)(...))QStandardItemModel::rowCount
+144 (int (*)(...))QStandardItemModel::columnCount
+152 (int (*)(...))QStandardItemModel::hasChildren
+160 (int (*)(...))QStandardItemModel::data
+168 (int (*)(...))QStandardItemModel::setData
+176 (int (*)(...))QStandardItemModel::headerData
+184 (int (*)(...))QStandardItemModel::setHeaderData
+192 (int (*)(...))QStandardItemModel::itemData
+200 (int (*)(...))QStandardItemModel::setItemData
+208 (int (*)(...))QStandardItemModel::mimeTypes
+216 (int (*)(...))QStandardItemModel::mimeData
+224 (int (*)(...))QAbstractItemModel::canDropMimeData
+232 (int (*)(...))QStandardItemModel::dropMimeData
+240 (int (*)(...))QStandardItemModel::supportedDropActions
+248 (int (*)(...))QAbstractItemModel::supportedDragActions
+256 (int (*)(...))QStandardItemModel::insertRows
+264 (int (*)(...))QStandardItemModel::insertColumns
+272 (int (*)(...))QStandardItemModel::removeRows
+280 (int (*)(...))QStandardItemModel::removeColumns
+288 (int (*)(...))QAbstractItemModel::moveRows
+296 (int (*)(...))QAbstractItemModel::moveColumns
+304 (int (*)(...))QAbstractItemModel::fetchMore
+312 (int (*)(...))QAbstractItemModel::canFetchMore
+320 (int (*)(...))QStandardItemModel::flags
+328 (int (*)(...))QStandardItemModel::sort
+336 (int (*)(...))QAbstractItemModel::buddy
+344 (int (*)(...))QAbstractItemModel::match
+352 (int (*)(...))QAbstractItemModel::span
+360 (int (*)(...))QAbstractItemModel::roleNames
+368 (int (*)(...))QAbstractItemModel::submit
+376 (int (*)(...))QAbstractItemModel::revert
+
+Class QStandardItemModel
+ size=16 align=8
+ base size=16 base align=8
+QStandardItemModel (0x0x7f5274a2f1a0) 0
+ vptr=((& QStandardItemModel::_ZTV18QStandardItemModel) + 16)
+ QAbstractItemModel (0x0x7f5274a2f208) 0
+ primary-for QStandardItemModel (0x0x7f5274a2f1a0)
+ QObject (0x0x7f5273f83180) 0
+ primary-for QAbstractItemModel (0x0x7f5274a2f208)
+
+Class QStaticText
+ size=8 align=8
+ base size=8 base align=8
+QStaticText (0x0x7f5273f835a0) 0
+
+Class QStyleHints::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QStyleHints::QPrivateSignal (0x0x7f5272d318a0) 0 empty
+
+Vtable for QStyleHints
+QStyleHints::_ZTV11QStyleHints: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QStyleHints)
+16 (int (*)(...))QStyleHints::metaObject
+24 (int (*)(...))QStyleHints::qt_metacast
+32 (int (*)(...))QStyleHints::qt_metacall
+40 (int (*)(...))QStyleHints::~QStyleHints
+48 (int (*)(...))QStyleHints::~QStyleHints
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QStyleHints
+ size=16 align=8
+ base size=16 base align=8
+QStyleHints (0x0x7f5272d2ed68) 0
+ vptr=((& QStyleHints::_ZTV11QStyleHints) + 16)
+ QObject (0x0x7f5272d31840) 0
+ primary-for QStyleHints (0x0x7f5272d2ed68)
+
+Class QTextObject::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTextObject::QPrivateSignal (0x0x7f5272d31ae0) 0 empty
+
+Vtable for QTextObject
+QTextObject::_ZTV11QTextObject: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QTextObject)
+16 (int (*)(...))QTextObject::metaObject
+24 (int (*)(...))QTextObject::qt_metacast
+32 (int (*)(...))QTextObject::qt_metacall
+40 (int (*)(...))QTextObject::~QTextObject
+48 (int (*)(...))QTextObject::~QTextObject
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QTextObject
+ size=16 align=8
+ base size=16 base align=8
+QTextObject (0x0x7f5272d2edd0) 0
+ vptr=((& QTextObject::_ZTV11QTextObject) + 16)
+ QObject (0x0x7f5272d31a80) 0
+ primary-for QTextObject (0x0x7f5272d2edd0)
+
+Class QTextBlockGroup::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTextBlockGroup::QPrivateSignal (0x0x7f5272d31d20) 0 empty
+
+Vtable for QTextBlockGroup
+QTextBlockGroup::_ZTV15QTextBlockGroup: 17 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QTextBlockGroup)
+16 (int (*)(...))QTextBlockGroup::metaObject
+24 (int (*)(...))QTextBlockGroup::qt_metacast
+32 (int (*)(...))QTextBlockGroup::qt_metacall
+40 (int (*)(...))QTextBlockGroup::~QTextBlockGroup
+48 (int (*)(...))QTextBlockGroup::~QTextBlockGroup
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QTextBlockGroup::blockInserted
+120 (int (*)(...))QTextBlockGroup::blockRemoved
+128 (int (*)(...))QTextBlockGroup::blockFormatChanged
+
+Class QTextBlockGroup
+ size=16 align=8
+ base size=16 base align=8
+QTextBlockGroup (0x0x7f5272d2ee38) 0
+ vptr=((& QTextBlockGroup::_ZTV15QTextBlockGroup) + 16)
+ QTextObject (0x0x7f5272d2eea0) 0
+ primary-for QTextBlockGroup (0x0x7f5272d2ee38)
+ QObject (0x0x7f5272d31cc0) 0
+ primary-for QTextObject (0x0x7f5272d2eea0)
+
+Vtable for QTextFrameLayoutData
+QTextFrameLayoutData::_ZTV20QTextFrameLayoutData: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QTextFrameLayoutData)
+16 (int (*)(...))QTextFrameLayoutData::~QTextFrameLayoutData
+24 (int (*)(...))QTextFrameLayoutData::~QTextFrameLayoutData
+
+Class QTextFrameLayoutData
+ size=8 align=8
+ base size=8 base align=8
+QTextFrameLayoutData (0x0x7f5272d31f00) 0 nearly-empty
+ vptr=((& QTextFrameLayoutData::_ZTV20QTextFrameLayoutData) + 16)
+
+Class QTextFrame::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTextFrame::QPrivateSignal (0x0x7f5272d4d000) 0 empty
+
+Class QTextFrame::iterator
+ size=32 align=8
+ base size=28 base align=8
+QTextFrame::iterator (0x0x7f5272d4d060) 0
+
+Vtable for QTextFrame
+QTextFrame::_ZTV10QTextFrame: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QTextFrame)
+16 (int (*)(...))QTextFrame::metaObject
+24 (int (*)(...))QTextFrame::qt_metacast
+32 (int (*)(...))QTextFrame::qt_metacall
+40 (int (*)(...))QTextFrame::~QTextFrame
+48 (int (*)(...))QTextFrame::~QTextFrame
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QTextFrame
+ size=16 align=8
+ base size=16 base align=8
+QTextFrame (0x0x7f5272d2ef08) 0
+ vptr=((& QTextFrame::_ZTV10QTextFrame) + 16)
+ QTextObject (0x0x7f5272d2ef70) 0
+ primary-for QTextFrame (0x0x7f5272d2ef08)
+ QObject (0x0x7f5272d31f60) 0
+ primary-for QTextObject (0x0x7f5272d2ef70)
+
+Vtable for QTextBlockUserData
+QTextBlockUserData::_ZTV18QTextBlockUserData: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QTextBlockUserData)
+16 (int (*)(...))QTextBlockUserData::~QTextBlockUserData
+24 (int (*)(...))QTextBlockUserData::~QTextBlockUserData
+
+Class QTextBlockUserData
+ size=8 align=8
+ base size=8 base align=8
+QTextBlockUserData (0x0x7f5272d689c0) 0 nearly-empty
+ vptr=((& QTextBlockUserData::_ZTV18QTextBlockUserData) + 16)
+
+Class QTextBlock::iterator
+ size=24 align=8
+ base size=20 base align=8
+QTextBlock::iterator (0x0x7f5272d68a80) 0
+
+Class QTextBlock
+ size=16 align=8
+ base size=12 base align=8
+QTextBlock (0x0x7f5272d68a20) 0
+
+Class QTextFragment
+ size=16 align=8
+ base size=16 base align=8
+QTextFragment (0x0x7f5272d9a780) 0
+
+Class QSyntaxHighlighter::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSyntaxHighlighter::QPrivateSignal (0x0x7f5272daef60) 0 empty
+
+Vtable for QSyntaxHighlighter
+QSyntaxHighlighter::_ZTV18QSyntaxHighlighter: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QSyntaxHighlighter)
+16 (int (*)(...))QSyntaxHighlighter::metaObject
+24 (int (*)(...))QSyntaxHighlighter::qt_metacast
+32 (int (*)(...))QSyntaxHighlighter::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+
+Class QSyntaxHighlighter
+ size=16 align=8
+ base size=16 base align=8
+QSyntaxHighlighter (0x0x7f5272db5208) 0
+ vptr=((& QSyntaxHighlighter::_ZTV18QSyntaxHighlighter) + 16)
+ QObject (0x0x7f5272daef00) 0
+ primary-for QSyntaxHighlighter (0x0x7f5272db5208)
+
+Class QTextDocumentFragment
+ size=8 align=8
+ base size=8 base align=8
+QTextDocumentFragment (0x0x7f5272dbb180) 0
+
+Class QTextDocumentWriter
+ size=8 align=8
+ base size=8 base align=8
+QTextDocumentWriter (0x0x7f5272dbb1e0) 0
+
+Class QTextList::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTextList::QPrivateSignal (0x0x7f5272dbb2a0) 0 empty
+
+Vtable for QTextList
+QTextList::_ZTV9QTextList: 17 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QTextList)
+16 (int (*)(...))QTextList::metaObject
+24 (int (*)(...))QTextList::qt_metacast
+32 (int (*)(...))QTextList::qt_metacall
+40 (int (*)(...))QTextList::~QTextList
+48 (int (*)(...))QTextList::~QTextList
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QTextBlockGroup::blockInserted
+120 (int (*)(...))QTextBlockGroup::blockRemoved
+128 (int (*)(...))QTextBlockGroup::blockFormatChanged
+
+Class QTextList
+ size=16 align=8
+ base size=16 base align=8
+QTextList (0x0x7f5272db5270) 0
+ vptr=((& QTextList::_ZTV9QTextList) + 16)
+ QTextBlockGroup (0x0x7f5272db52d8) 0
+ primary-for QTextList (0x0x7f5272db5270)
+ QTextObject (0x0x7f5272db5340) 0
+ primary-for QTextBlockGroup (0x0x7f5272db52d8)
+ QObject (0x0x7f5272dbb240) 0
+ primary-for QTextObject (0x0x7f5272db5340)
+
+Class QTextTableCell
+ size=16 align=8
+ base size=12 base align=8
+QTextTableCell (0x0x7f5272dbb8a0) 0
+
+Class QTextTable::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTextTable::QPrivateSignal (0x0x7f5272dd3120) 0 empty
+
+Vtable for QTextTable
+QTextTable::_ZTV10QTextTable: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QTextTable)
+16 (int (*)(...))QTextTable::metaObject
+24 (int (*)(...))QTextTable::qt_metacast
+32 (int (*)(...))QTextTable::qt_metacall
+40 (int (*)(...))QTextTable::~QTextTable
+48 (int (*)(...))QTextTable::~QTextTable
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QTextTable
+ size=16 align=8
+ base size=16 base align=8
+QTextTable (0x0x7f5272db53a8) 0
+ vptr=((& QTextTable::_ZTV10QTextTable) + 16)
+ QTextFrame (0x0x7f5272db5410) 0
+ primary-for QTextTable (0x0x7f5272db53a8)
+ QTextObject (0x0x7f5272db5478) 0
+ primary-for QTextFrame (0x0x7f5272db5410)
+ QObject (0x0x7f5272dd30c0) 0
+ primary-for QTextObject (0x0x7f5272db5478)
+
+Class QValidator::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QValidator::QPrivateSignal (0x0x7f5272dd36c0) 0 empty
+
+Vtable for QValidator
+QValidator::_ZTV10QValidator: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QValidator)
+16 (int (*)(...))QValidator::metaObject
+24 (int (*)(...))QValidator::qt_metacast
+32 (int (*)(...))QValidator::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))QValidator::fixup
+
+Class QValidator
+ size=16 align=8
+ base size=16 base align=8
+QValidator (0x0x7f5272db54e0) 0
+ vptr=((& QValidator::_ZTV10QValidator) + 16)
+ QObject (0x0x7f5272dd3660) 0
+ primary-for QValidator (0x0x7f5272db54e0)
+
+Class QIntValidator::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QIntValidator::QPrivateSignal (0x0x7f5272dd39c0) 0 empty
+
+Vtable for QIntValidator
+QIntValidator::_ZTV13QIntValidator: 17 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QIntValidator)
+16 (int (*)(...))QIntValidator::metaObject
+24 (int (*)(...))QIntValidator::qt_metacast
+32 (int (*)(...))QIntValidator::qt_metacall
+40 (int (*)(...))QIntValidator::~QIntValidator
+48 (int (*)(...))QIntValidator::~QIntValidator
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QIntValidator::validate
+120 (int (*)(...))QIntValidator::fixup
+128 (int (*)(...))QIntValidator::setRange
+
+Class QIntValidator
+ size=24 align=8
+ base size=24 base align=8
+QIntValidator (0x0x7f5272db5548) 0
+ vptr=((& QIntValidator::_ZTV13QIntValidator) + 16)
+ QValidator (0x0x7f5272db55b0) 0
+ primary-for QIntValidator (0x0x7f5272db5548)
+ QObject (0x0x7f5272dd3960) 0
+ primary-for QValidator (0x0x7f5272db55b0)
+
+Class QDoubleValidator::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QDoubleValidator::QPrivateSignal (0x0x7f5272dd3c00) 0 empty
+
+Vtable for QDoubleValidator
+QDoubleValidator::_ZTV16QDoubleValidator: 17 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QDoubleValidator)
+16 (int (*)(...))QDoubleValidator::metaObject
+24 (int (*)(...))QDoubleValidator::qt_metacast
+32 (int (*)(...))QDoubleValidator::qt_metacall
+40 (int (*)(...))QDoubleValidator::~QDoubleValidator
+48 (int (*)(...))QDoubleValidator::~QDoubleValidator
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QDoubleValidator::validate
+120 (int (*)(...))QValidator::fixup
+128 (int (*)(...))QDoubleValidator::setRange
+
+Class QDoubleValidator
+ size=40 align=8
+ base size=36 base align=8
+QDoubleValidator (0x0x7f5272db5618) 0
+ vptr=((& QDoubleValidator::_ZTV16QDoubleValidator) + 16)
+ QValidator (0x0x7f5272db5680) 0
+ primary-for QDoubleValidator (0x0x7f5272db5618)
+ QObject (0x0x7f5272dd3ba0) 0
+ primary-for QValidator (0x0x7f5272db5680)
+
+Class QRegExpValidator::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QRegExpValidator::QPrivateSignal (0x0x7f5272df20c0) 0 empty
+
+Vtable for QRegExpValidator
+QRegExpValidator::_ZTV16QRegExpValidator: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QRegExpValidator)
+16 (int (*)(...))QRegExpValidator::metaObject
+24 (int (*)(...))QRegExpValidator::qt_metacast
+32 (int (*)(...))QRegExpValidator::qt_metacall
+40 (int (*)(...))QRegExpValidator::~QRegExpValidator
+48 (int (*)(...))QRegExpValidator::~QRegExpValidator
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QRegExpValidator::validate
+120 (int (*)(...))QValidator::fixup
+
+Class QRegExpValidator
+ size=24 align=8
+ base size=24 base align=8
+QRegExpValidator (0x0x7f5272db56e8) 0
+ vptr=((& QRegExpValidator::_ZTV16QRegExpValidator) + 16)
+ QValidator (0x0x7f5272db5750) 0
+ primary-for QRegExpValidator (0x0x7f5272db56e8)
+ QObject (0x0x7f5272df2060) 0
+ primary-for QValidator (0x0x7f5272db5750)
+
+Class QRegularExpressionValidator::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QRegularExpressionValidator::QPrivateSignal (0x0x7f5272df22a0) 0 empty
+
+Vtable for QRegularExpressionValidator
+QRegularExpressionValidator::_ZTV27QRegularExpressionValidator: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI27QRegularExpressionValidator)
+16 (int (*)(...))QRegularExpressionValidator::metaObject
+24 (int (*)(...))QRegularExpressionValidator::qt_metacast
+32 (int (*)(...))QRegularExpressionValidator::qt_metacall
+40 (int (*)(...))QRegularExpressionValidator::~QRegularExpressionValidator
+48 (int (*)(...))QRegularExpressionValidator::~QRegularExpressionValidator
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QRegularExpressionValidator::validate
+120 (int (*)(...))QValidator::fixup
+
+Class QRegularExpressionValidator
+ size=16 align=8
+ base size=16 base align=8
+QRegularExpressionValidator (0x0x7f5272db57b8) 0
+ vptr=((& QRegularExpressionValidator::_ZTV27QRegularExpressionValidator) + 16)
+ QValidator (0x0x7f5272db5820) 0
+ primary-for QRegularExpressionValidator (0x0x7f5272db57b8)
+ QObject (0x0x7f5272df2240) 0
+ primary-for QValidator (0x0x7f5272db5820)
+
+Class QNetworkRequest
+ size=8 align=8
+ base size=8 base align=8
+QNetworkRequest (0x0x7f5272df2480) 0
+
+Class QNetworkCacheMetaData
+ size=8 align=8
+ base size=8 base align=8
+QNetworkCacheMetaData (0x0x7f5272e37900) 0
+
+Class QAbstractNetworkCache::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAbstractNetworkCache::QPrivateSignal (0x0x7f5272e70de0) 0 empty
+
+Vtable for QAbstractNetworkCache
+QAbstractNetworkCache::_ZTV21QAbstractNetworkCache: 22 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI21QAbstractNetworkCache)
+16 (int (*)(...))QAbstractNetworkCache::metaObject
+24 (int (*)(...))QAbstractNetworkCache::qt_metacast
+32 (int (*)(...))QAbstractNetworkCache::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))__cxa_pure_virtual
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))__cxa_pure_virtual
+160 (int (*)(...))__cxa_pure_virtual
+168 (int (*)(...))__cxa_pure_virtual
+
+Class QAbstractNetworkCache
+ size=16 align=8
+ base size=16 base align=8
+QAbstractNetworkCache (0x0x7f5272e754e0) 0
+ vptr=((& QAbstractNetworkCache::_ZTV21QAbstractNetworkCache) + 16)
+ QObject (0x0x7f5272e70d80) 0
+ primary-for QAbstractNetworkCache (0x0x7f5272e754e0)
+
+Class QAbstractSocket::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAbstractSocket::QPrivateSignal (0x0x7f5272e7e060) 0 empty
+
+Vtable for QAbstractSocket
+QAbstractSocket::_ZTV15QAbstractSocket: 41 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QAbstractSocket)
+16 (int (*)(...))QAbstractSocket::metaObject
+24 (int (*)(...))QAbstractSocket::qt_metacast
+32 (int (*)(...))QAbstractSocket::qt_metacall
+40 (int (*)(...))QAbstractSocket::~QAbstractSocket
+48 (int (*)(...))QAbstractSocket::~QAbstractSocket
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QAbstractSocket::isSequential
+120 (int (*)(...))QIODevice::open
+128 (int (*)(...))QAbstractSocket::close
+136 (int (*)(...))QIODevice::pos
+144 (int (*)(...))QIODevice::size
+152 (int (*)(...))QIODevice::seek
+160 (int (*)(...))QAbstractSocket::atEnd
+168 (int (*)(...))QIODevice::reset
+176 (int (*)(...))QAbstractSocket::bytesAvailable
+184 (int (*)(...))QAbstractSocket::bytesToWrite
+192 (int (*)(...))QAbstractSocket::canReadLine
+200 (int (*)(...))QAbstractSocket::waitForReadyRead
+208 (int (*)(...))QAbstractSocket::waitForBytesWritten
+216 (int (*)(...))QAbstractSocket::readData
+224 (int (*)(...))QAbstractSocket::readLineData
+232 (int (*)(...))QAbstractSocket::writeData
+240 (int (*)(...))QAbstractSocket::resume
+248 (int (*)(...))QAbstractSocket::connectToHost
+256 (int (*)(...))QAbstractSocket::connectToHost
+264 (int (*)(...))QAbstractSocket::disconnectFromHost
+272 (int (*)(...))QAbstractSocket::setReadBufferSize
+280 (int (*)(...))QAbstractSocket::socketDescriptor
+288 (int (*)(...))QAbstractSocket::setSocketDescriptor
+296 (int (*)(...))QAbstractSocket::setSocketOption
+304 (int (*)(...))QAbstractSocket::socketOption
+312 (int (*)(...))QAbstractSocket::waitForConnected
+320 (int (*)(...))QAbstractSocket::waitForDisconnected
+
+Class QAbstractSocket
+ size=16 align=8
+ base size=16 base align=8
+QAbstractSocket (0x0x7f5272e75548) 0
+ vptr=((& QAbstractSocket::_ZTV15QAbstractSocket) + 16)
+ QIODevice (0x0x7f5272e755b0) 0
+ primary-for QAbstractSocket (0x0x7f5272e75548)
+ QObject (0x0x7f5272e7e000) 0
+ primary-for QIODevice (0x0x7f5272e755b0)
+
+Class QAuthenticator
+ size=8 align=8
+ base size=8 base align=8
+QAuthenticator (0x0x7f5272ea97e0) 0
+
+Class QDnsDomainNameRecord
+ size=8 align=8
+ base size=8 base align=8
+QDnsDomainNameRecord (0x0x7f5272ea98a0) 0
+
+Class QDnsHostAddressRecord
+ size=8 align=8
+ base size=8 base align=8
+QDnsHostAddressRecord (0x0x7f5272ee7960) 0
+
+Class QDnsMailExchangeRecord
+ size=8 align=8
+ base size=8 base align=8
+QDnsMailExchangeRecord (0x0x7f5272f1da20) 0
+
+Class QDnsServiceRecord
+ size=8 align=8
+ base size=8 base align=8
+QDnsServiceRecord (0x0x7f5272b55a20) 0
+
+Class QDnsTextRecord
+ size=8 align=8
+ base size=8 base align=8
+QDnsTextRecord (0x0x7f5272b89900) 0
+
+Class QDnsLookup::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QDnsLookup::QPrivateSignal (0x0x7f5272bc2960) 0 empty
+
+Vtable for QDnsLookup
+QDnsLookup::_ZTV10QDnsLookup: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QDnsLookup)
+16 (int (*)(...))QDnsLookup::metaObject
+24 (int (*)(...))QDnsLookup::qt_metacast
+32 (int (*)(...))QDnsLookup::qt_metacall
+40 (int (*)(...))QDnsLookup::~QDnsLookup
+48 (int (*)(...))QDnsLookup::~QDnsLookup
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QDnsLookup
+ size=16 align=8
+ base size=16 base align=8
+QDnsLookup (0x0x7f5272bc4478) 0
+ vptr=((& QDnsLookup::_ZTV10QDnsLookup) + 16)
+ QObject (0x0x7f5272bc2900) 0
+ primary-for QDnsLookup (0x0x7f5272bc4478)
+
+Class QTcpSocket::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTcpSocket::QPrivateSignal (0x0x7f5272bc2d20) 0 empty
+
+Vtable for QTcpSocket
+QTcpSocket::_ZTV10QTcpSocket: 41 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QTcpSocket)
+16 (int (*)(...))QTcpSocket::metaObject
+24 (int (*)(...))QTcpSocket::qt_metacast
+32 (int (*)(...))QTcpSocket::qt_metacall
+40 (int (*)(...))QTcpSocket::~QTcpSocket
+48 (int (*)(...))QTcpSocket::~QTcpSocket
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QAbstractSocket::isSequential
+120 (int (*)(...))QIODevice::open
+128 (int (*)(...))QAbstractSocket::close
+136 (int (*)(...))QIODevice::pos
+144 (int (*)(...))QIODevice::size
+152 (int (*)(...))QIODevice::seek
+160 (int (*)(...))QAbstractSocket::atEnd
+168 (int (*)(...))QIODevice::reset
+176 (int (*)(...))QAbstractSocket::bytesAvailable
+184 (int (*)(...))QAbstractSocket::bytesToWrite
+192 (int (*)(...))QAbstractSocket::canReadLine
+200 (int (*)(...))QAbstractSocket::waitForReadyRead
+208 (int (*)(...))QAbstractSocket::waitForBytesWritten
+216 (int (*)(...))QAbstractSocket::readData
+224 (int (*)(...))QAbstractSocket::readLineData
+232 (int (*)(...))QAbstractSocket::writeData
+240 (int (*)(...))QAbstractSocket::resume
+248 (int (*)(...))QAbstractSocket::connectToHost
+256 (int (*)(...))QAbstractSocket::connectToHost
+264 (int (*)(...))QAbstractSocket::disconnectFromHost
+272 (int (*)(...))QAbstractSocket::setReadBufferSize
+280 (int (*)(...))QAbstractSocket::socketDescriptor
+288 (int (*)(...))QAbstractSocket::setSocketDescriptor
+296 (int (*)(...))QAbstractSocket::setSocketOption
+304 (int (*)(...))QAbstractSocket::socketOption
+312 (int (*)(...))QAbstractSocket::waitForConnected
+320 (int (*)(...))QAbstractSocket::waitForDisconnected
+
+Class QTcpSocket
+ size=16 align=8
+ base size=16 base align=8
+QTcpSocket (0x0x7f5272bc44e0) 0
+ vptr=((& QTcpSocket::_ZTV10QTcpSocket) + 16)
+ QAbstractSocket (0x0x7f5272bc4548) 0
+ primary-for QTcpSocket (0x0x7f5272bc44e0)
+ QIODevice (0x0x7f5272bc45b0) 0
+ primary-for QAbstractSocket (0x0x7f5272bc4548)
+ QObject (0x0x7f5272bc2cc0) 0
+ primary-for QIODevice (0x0x7f5272bc45b0)
+
+Class QSslCertificate
+ size=8 align=8
+ base size=8 base align=8
+QSslCertificate (0x0x7f5272bdd600) 0
+
+Class QSslError
+ size=8 align=8
+ base size=8 base align=8
+QSslError (0x0x7f5272c24e40) 0
+
+Class QSslSocket::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSslSocket::QPrivateSignal (0x0x7f5272c80120) 0 empty
+
+Vtable for QSslSocket
+QSslSocket::_ZTV10QSslSocket: 41 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QSslSocket)
+16 (int (*)(...))QSslSocket::metaObject
+24 (int (*)(...))QSslSocket::qt_metacast
+32 (int (*)(...))QSslSocket::qt_metacall
+40 (int (*)(...))QSslSocket::~QSslSocket
+48 (int (*)(...))QSslSocket::~QSslSocket
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QAbstractSocket::isSequential
+120 (int (*)(...))QIODevice::open
+128 (int (*)(...))QSslSocket::close
+136 (int (*)(...))QIODevice::pos
+144 (int (*)(...))QIODevice::size
+152 (int (*)(...))QIODevice::seek
+160 (int (*)(...))QSslSocket::atEnd
+168 (int (*)(...))QIODevice::reset
+176 (int (*)(...))QSslSocket::bytesAvailable
+184 (int (*)(...))QSslSocket::bytesToWrite
+192 (int (*)(...))QSslSocket::canReadLine
+200 (int (*)(...))QSslSocket::waitForReadyRead
+208 (int (*)(...))QSslSocket::waitForBytesWritten
+216 (int (*)(...))QSslSocket::readData
+224 (int (*)(...))QAbstractSocket::readLineData
+232 (int (*)(...))QSslSocket::writeData
+240 (int (*)(...))QSslSocket::resume
+248 (int (*)(...))QSslSocket::connectToHost
+256 (int (*)(...))QAbstractSocket::connectToHost
+264 (int (*)(...))QSslSocket::disconnectFromHost
+272 (int (*)(...))QSslSocket::setReadBufferSize
+280 (int (*)(...))QAbstractSocket::socketDescriptor
+288 (int (*)(...))QSslSocket::setSocketDescriptor
+296 (int (*)(...))QSslSocket::setSocketOption
+304 (int (*)(...))QSslSocket::socketOption
+312 (int (*)(...))QSslSocket::waitForConnected
+320 (int (*)(...))QSslSocket::waitForDisconnected
+
+Class QSslSocket
+ size=16 align=8
+ base size=16 base align=8
+QSslSocket (0x0x7f5272c68270) 0
+ vptr=((& QSslSocket::_ZTV10QSslSocket) + 16)
+ QTcpSocket (0x0x7f5272c682d8) 0
+ primary-for QSslSocket (0x0x7f5272c68270)
+ QAbstractSocket (0x0x7f5272c68340) 0
+ primary-for QTcpSocket (0x0x7f5272c682d8)
+ QIODevice (0x0x7f5272c683a8) 0
+ primary-for QAbstractSocket (0x0x7f5272c68340)
+ QObject (0x0x7f5272c800c0) 0
+ primary-for QIODevice (0x0x7f5272c683a8)
+
+Class QDtlsClientVerifier::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QDtlsClientVerifier::QPrivateSignal (0x0x7f5272c80360) 0 empty
+
+Class QDtlsClientVerifier::GeneratorParameters
+ size=16 align=8
+ base size=16 base align=8
+QDtlsClientVerifier::GeneratorParameters (0x0x7f5272c803c0) 0
+
+Vtable for QDtlsClientVerifier
+QDtlsClientVerifier::_ZTV19QDtlsClientVerifier: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QDtlsClientVerifier)
+16 (int (*)(...))QDtlsClientVerifier::metaObject
+24 (int (*)(...))QDtlsClientVerifier::qt_metacast
+32 (int (*)(...))QDtlsClientVerifier::qt_metacall
+40 (int (*)(...))QDtlsClientVerifier::~QDtlsClientVerifier
+48 (int (*)(...))QDtlsClientVerifier::~QDtlsClientVerifier
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QDtlsClientVerifier
+ size=16 align=8
+ base size=16 base align=8
+QDtlsClientVerifier (0x0x7f5272c68410) 0
+ vptr=((& QDtlsClientVerifier::_ZTV19QDtlsClientVerifier) + 16)
+ QObject (0x0x7f5272c80300) 0
+ primary-for QDtlsClientVerifier (0x0x7f5272c68410)
+
+Class QDtls::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QDtls::QPrivateSignal (0x0x7f5272c80600) 0 empty
+
+Vtable for QDtls
+QDtls::_ZTV5QDtls: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI5QDtls)
+16 (int (*)(...))QDtls::metaObject
+24 (int (*)(...))QDtls::qt_metacast
+32 (int (*)(...))QDtls::qt_metacall
+40 (int (*)(...))QDtls::~QDtls
+48 (int (*)(...))QDtls::~QDtls
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QDtls
+ size=16 align=8
+ base size=16 base align=8
+QDtls (0x0x7f5272c68478) 0
+ vptr=((& QDtls::_ZTV5QDtls) + 16)
+ QObject (0x0x7f5272c805a0) 0
+ primary-for QDtls (0x0x7f5272c68478)
+
+Class QIPv6Address
+ size=16 align=1
+ base size=16 base align=1
+QIPv6Address (0x0x7f5272c80840) 0
+
+Class QHostAddress
+ size=8 align=8
+ base size=8 base align=8
+QHostAddress (0x0x7f5272c80960) 0
+
+Class QHostInfo
+ size=8 align=8
+ base size=8 base align=8
+QHostInfo (0x0x7f5272cd7720) 0
+
+Class QHstsPolicy
+ size=8 align=8
+ base size=8 base align=8
+QHstsPolicy (0x0x7f5272d0fde0) 0
+
+Class QHttp2Configuration
+ size=8 align=8
+ base size=8 base align=8
+QHttp2Configuration (0x0x7f527295f540) 0
+
+Class QHttpPart
+ size=8 align=8
+ base size=8 base align=8
+QHttpPart (0x0x7f527297aa80) 0
+
+Class QHttpMultiPart::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QHttpMultiPart::QPrivateSignal (0x0x7f52729b2720) 0 empty
+
+Vtable for QHttpMultiPart
+QHttpMultiPart::_ZTV14QHttpMultiPart: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QHttpMultiPart)
+16 (int (*)(...))QHttpMultiPart::metaObject
+24 (int (*)(...))QHttpMultiPart::qt_metacast
+32 (int (*)(...))QHttpMultiPart::qt_metacall
+40 (int (*)(...))QHttpMultiPart::~QHttpMultiPart
+48 (int (*)(...))QHttpMultiPart::~QHttpMultiPart
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QHttpMultiPart
+ size=16 align=8
+ base size=16 base align=8
+QHttpMultiPart (0x0x7f52729aebc8) 0
+ vptr=((& QHttpMultiPart::_ZTV14QHttpMultiPart) + 16)
+ QObject (0x0x7f52729b26c0) 0
+ primary-for QHttpMultiPart (0x0x7f52729aebc8)
+
+Class QLocalServer::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QLocalServer::QPrivateSignal (0x0x7f52729b2960) 0 empty
+
+Vtable for QLocalServer
+QLocalServer::_ZTV12QLocalServer: 17 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QLocalServer)
+16 (int (*)(...))QLocalServer::metaObject
+24 (int (*)(...))QLocalServer::qt_metacast
+32 (int (*)(...))QLocalServer::qt_metacall
+40 (int (*)(...))QLocalServer::~QLocalServer
+48 (int (*)(...))QLocalServer::~QLocalServer
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QLocalServer::hasPendingConnections
+120 (int (*)(...))QLocalServer::nextPendingConnection
+128 (int (*)(...))QLocalServer::incomingConnection
+
+Class QLocalServer
+ size=16 align=8
+ base size=16 base align=8
+QLocalServer (0x0x7f52729aec30) 0
+ vptr=((& QLocalServer::_ZTV12QLocalServer) + 16)
+ QObject (0x0x7f52729b2900) 0
+ primary-for QLocalServer (0x0x7f52729aec30)
+
+Class QLocalSocket::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QLocalSocket::QPrivateSignal (0x0x7f52729d2420) 0 empty
+
+Vtable for QLocalSocket
+QLocalSocket::_ZTV12QLocalSocket: 30 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QLocalSocket)
+16 (int (*)(...))QLocalSocket::metaObject
+24 (int (*)(...))QLocalSocket::qt_metacast
+32 (int (*)(...))QLocalSocket::qt_metacall
+40 (int (*)(...))QLocalSocket::~QLocalSocket
+48 (int (*)(...))QLocalSocket::~QLocalSocket
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QLocalSocket::isSequential
+120 (int (*)(...))QLocalSocket::open
+128 (int (*)(...))QLocalSocket::close
+136 (int (*)(...))QIODevice::pos
+144 (int (*)(...))QIODevice::size
+152 (int (*)(...))QIODevice::seek
+160 (int (*)(...))QIODevice::atEnd
+168 (int (*)(...))QIODevice::reset
+176 (int (*)(...))QLocalSocket::bytesAvailable
+184 (int (*)(...))QLocalSocket::bytesToWrite
+192 (int (*)(...))QLocalSocket::canReadLine
+200 (int (*)(...))QLocalSocket::waitForReadyRead
+208 (int (*)(...))QLocalSocket::waitForBytesWritten
+216 (int (*)(...))QLocalSocket::readData
+224 (int (*)(...))QIODevice::readLineData
+232 (int (*)(...))QLocalSocket::writeData
+
+Class QLocalSocket
+ size=16 align=8
+ base size=16 base align=8
+QLocalSocket (0x0x7f52729aedd0) 0
+ vptr=((& QLocalSocket::_ZTV12QLocalSocket) + 16)
+ QIODevice (0x0x7f52729aee38) 0
+ primary-for QLocalSocket (0x0x7f52729aedd0)
+ QObject (0x0x7f52729d23c0) 0
+ primary-for QIODevice (0x0x7f52729aee38)
+
+Class QSslConfiguration
+ size=8 align=8
+ base size=8 base align=8
+QSslConfiguration (0x0x7f52729d2660) 0
+
+Class QSslPreSharedKeyAuthenticator
+ size=8 align=8
+ base size=8 base align=8
+QSslPreSharedKeyAuthenticator (0x0x7f5272a28b40) 0
+
+Class QNetworkAccessManager::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QNetworkAccessManager::QPrivateSignal (0x0x7f5272a731e0) 0 empty
+
+Vtable for QNetworkAccessManager
+QNetworkAccessManager::_ZTV21QNetworkAccessManager: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI21QNetworkAccessManager)
+16 (int (*)(...))QNetworkAccessManager::metaObject
+24 (int (*)(...))QNetworkAccessManager::qt_metacast
+32 (int (*)(...))QNetworkAccessManager::qt_metacall
+40 (int (*)(...))QNetworkAccessManager::~QNetworkAccessManager
+48 (int (*)(...))QNetworkAccessManager::~QNetworkAccessManager
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QNetworkAccessManager::createRequest
+
+Class QNetworkAccessManager
+ size=16 align=8
+ base size=16 base align=8
+QNetworkAccessManager (0x0x7f5272a6a340) 0
+ vptr=((& QNetworkAccessManager::_ZTV21QNetworkAccessManager) + 16)
+ QObject (0x0x7f5272a73180) 0
+ primary-for QNetworkAccessManager (0x0x7f5272a6a340)
+
+Class QNetworkConfiguration
+ size=8 align=8
+ base size=8 base align=8
+QNetworkConfiguration (0x0x7f5272a73480) 0
+
+Class QNetworkConfigurationManager::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QNetworkConfigurationManager::QPrivateSignal (0x0x7f5272ade840) 0 empty
+
+Vtable for QNetworkConfigurationManager
+QNetworkConfigurationManager::_ZTV28QNetworkConfigurationManager: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI28QNetworkConfigurationManager)
+16 (int (*)(...))QNetworkConfigurationManager::metaObject
+24 (int (*)(...))QNetworkConfigurationManager::qt_metacast
+32 (int (*)(...))QNetworkConfigurationManager::qt_metacall
+40 (int (*)(...))QNetworkConfigurationManager::~QNetworkConfigurationManager
+48 (int (*)(...))QNetworkConfigurationManager::~QNetworkConfigurationManager
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QNetworkConfigurationManager
+ size=16 align=8
+ base size=16 base align=8
+QNetworkConfigurationManager (0x0x7f5272adb618) 0
+ vptr=((& QNetworkConfigurationManager::_ZTV28QNetworkConfigurationManager) + 16)
+ QObject (0x0x7f5272ade7e0) 0
+ primary-for QNetworkConfigurationManager (0x0x7f5272adb618)
+
+Class QNetworkCookie
+ size=8 align=8
+ base size=8 base align=8
+QNetworkCookie (0x0x7f5272b0e3c0) 0
+
+Class QNetworkCookieJar::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QNetworkCookieJar::QPrivateSignal (0x0x7f527277b9c0) 0 empty
+
+Vtable for QNetworkCookieJar
+QNetworkCookieJar::_ZTV17QNetworkCookieJar: 20 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QNetworkCookieJar)
+16 (int (*)(...))QNetworkCookieJar::metaObject
+24 (int (*)(...))QNetworkCookieJar::qt_metacast
+32 (int (*)(...))QNetworkCookieJar::qt_metacall
+40 (int (*)(...))QNetworkCookieJar::~QNetworkCookieJar
+48 (int (*)(...))QNetworkCookieJar::~QNetworkCookieJar
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QNetworkCookieJar::cookiesForUrl
+120 (int (*)(...))QNetworkCookieJar::setCookiesFromUrl
+128 (int (*)(...))QNetworkCookieJar::insertCookie
+136 (int (*)(...))QNetworkCookieJar::updateCookie
+144 (int (*)(...))QNetworkCookieJar::deleteCookie
+152 (int (*)(...))QNetworkCookieJar::validateCookie
+
+Class QNetworkCookieJar
+ size=16 align=8
+ base size=16 base align=8
+QNetworkCookieJar (0x0x7f527277a888) 0
+ vptr=((& QNetworkCookieJar::_ZTV17QNetworkCookieJar) + 16)
+ QObject (0x0x7f527277b960) 0
+ primary-for QNetworkCookieJar (0x0x7f527277a888)
+
+Class QNetworkDatagram
+ size=8 align=8
+ base size=8 base align=8
+QNetworkDatagram (0x0x7f527277bba0) 0
+
+Class QNetworkDiskCache::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QNetworkDiskCache::QPrivateSignal (0x0x7f52727f6720) 0 empty
+
+Vtable for QNetworkDiskCache
+QNetworkDiskCache::_ZTV17QNetworkDiskCache: 23 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QNetworkDiskCache)
+16 (int (*)(...))QNetworkDiskCache::metaObject
+24 (int (*)(...))QNetworkDiskCache::qt_metacast
+32 (int (*)(...))QNetworkDiskCache::qt_metacall
+40 (int (*)(...))QNetworkDiskCache::~QNetworkDiskCache
+48 (int (*)(...))QNetworkDiskCache::~QNetworkDiskCache
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QNetworkDiskCache::metaData
+120 (int (*)(...))QNetworkDiskCache::updateMetaData
+128 (int (*)(...))QNetworkDiskCache::data
+136 (int (*)(...))QNetworkDiskCache::remove
+144 (int (*)(...))QNetworkDiskCache::cacheSize
+152 (int (*)(...))QNetworkDiskCache::prepare
+160 (int (*)(...))QNetworkDiskCache::insert
+168 (int (*)(...))QNetworkDiskCache::clear
+176 (int (*)(...))QNetworkDiskCache::expire
+
+Class QNetworkDiskCache
+ size=16 align=8
+ base size=16 base align=8
+QNetworkDiskCache (0x0x7f52727f4750) 0
+ vptr=((& QNetworkDiskCache::_ZTV17QNetworkDiskCache) + 16)
+ QAbstractNetworkCache (0x0x7f52727f47b8) 0
+ primary-for QNetworkDiskCache (0x0x7f52727f4750)
+ QObject (0x0x7f52727f66c0) 0
+ primary-for QAbstractNetworkCache (0x0x7f52727f47b8)
+
+Class QNetworkAddressEntry
+ size=8 align=8
+ base size=8 base align=8
+QNetworkAddressEntry (0x0x7f52727f6900) 0
+
+Class QNetworkInterface
+ size=8 align=8
+ base size=8 base align=8
+QNetworkInterface (0x0x7f527286e8a0) 0
+
+Class QNetworkProxyQuery
+ size=8 align=8
+ base size=8 base align=8
+QNetworkProxyQuery (0x0x7f52728f43c0) 0
+
+Class QNetworkProxy
+ size=8 align=8
+ base size=8 base align=8
+QNetworkProxy (0x0x7f527256b6c0) 0
+
+Vtable for QNetworkProxyFactory
+QNetworkProxyFactory::_ZTV20QNetworkProxyFactory: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QNetworkProxyFactory)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+
+Class QNetworkProxyFactory
+ size=8 align=8
+ base size=8 base align=8
+QNetworkProxyFactory (0x0x7f52725dbf00) 0 nearly-empty
+ vptr=((& QNetworkProxyFactory::_ZTV20QNetworkProxyFactory) + 16)
+
+Class QNetworkReply::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QNetworkReply::QPrivateSignal (0x0x7f52725f81e0) 0 empty
+
+Vtable for QNetworkReply
+QNetworkReply::_ZTV13QNetworkReply: 36 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QNetworkReply)
+16 (int (*)(...))QNetworkReply::metaObject
+24 (int (*)(...))QNetworkReply::qt_metacast
+32 (int (*)(...))QNetworkReply::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QNetworkReply::isSequential
+120 (int (*)(...))QIODevice::open
+128 (int (*)(...))QNetworkReply::close
+136 (int (*)(...))QIODevice::pos
+144 (int (*)(...))QIODevice::size
+152 (int (*)(...))QIODevice::seek
+160 (int (*)(...))QIODevice::atEnd
+168 (int (*)(...))QIODevice::reset
+176 (int (*)(...))QIODevice::bytesAvailable
+184 (int (*)(...))QIODevice::bytesToWrite
+192 (int (*)(...))QIODevice::canReadLine
+200 (int (*)(...))QIODevice::waitForReadyRead
+208 (int (*)(...))QIODevice::waitForBytesWritten
+216 (int (*)(...))__cxa_pure_virtual
+224 (int (*)(...))QIODevice::readLineData
+232 (int (*)(...))QNetworkReply::writeData
+240 (int (*)(...))QNetworkReply::setReadBufferSize
+248 (int (*)(...))__cxa_pure_virtual
+256 (int (*)(...))QNetworkReply::ignoreSslErrors
+264 (int (*)(...))QNetworkReply::sslConfigurationImplementation
+272 (int (*)(...))QNetworkReply::setSslConfigurationImplementation
+280 (int (*)(...))QNetworkReply::ignoreSslErrorsImplementation
+
+Class QNetworkReply
+ size=16 align=8
+ base size=16 base align=8
+QNetworkReply (0x0x7f52725d5bc8) 0
+ vptr=((& QNetworkReply::_ZTV13QNetworkReply) + 16)
+ QIODevice (0x0x7f52725d5c30) 0
+ primary-for QNetworkReply (0x0x7f52725d5bc8)
+ QObject (0x0x7f52725f8180) 0
+ primary-for QIODevice (0x0x7f52725d5c30)
+
+Class QNetworkSession::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QNetworkSession::QPrivateSignal (0x0x7f52725f8720) 0 empty
+
+Vtable for QNetworkSession
+QNetworkSession::_ZTV15QNetworkSession: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QNetworkSession)
+16 (int (*)(...))QNetworkSession::metaObject
+24 (int (*)(...))QNetworkSession::qt_metacast
+32 (int (*)(...))QNetworkSession::qt_metacall
+40 (int (*)(...))QNetworkSession::~QNetworkSession
+48 (int (*)(...))QNetworkSession::~QNetworkSession
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QNetworkSession::connectNotify
+104 (int (*)(...))QNetworkSession::disconnectNotify
+
+Class QNetworkSession
+ size=24 align=8
+ base size=24 base align=8
+QNetworkSession (0x0x7f52725d5c98) 0
+ vptr=((& QNetworkSession::_ZTV15QNetworkSession) + 16)
+ QObject (0x0x7f52725f86c0) 0
+ primary-for QNetworkSession (0x0x7f52725d5c98)
+
+Class QOcspResponse
+ size=8 align=8
+ base size=8 base align=8
+QOcspResponse (0x0x7f52725f8f60) 0
+
+Class QTcpServer::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTcpServer::QPrivateSignal (0x0x7f52726617e0) 0 empty
+
+Vtable for QTcpServer
+QTcpServer::_ZTV10QTcpServer: 17 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QTcpServer)
+16 (int (*)(...))QTcpServer::metaObject
+24 (int (*)(...))QTcpServer::qt_metacast
+32 (int (*)(...))QTcpServer::qt_metacall
+40 (int (*)(...))QTcpServer::~QTcpServer
+48 (int (*)(...))QTcpServer::~QTcpServer
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QTcpServer::hasPendingConnections
+120 (int (*)(...))QTcpServer::nextPendingConnection
+128 (int (*)(...))QTcpServer::incomingConnection
+
+Class QTcpServer
+ size=16 align=8
+ base size=16 base align=8
+QTcpServer (0x0x7f5272662548) 0
+ vptr=((& QTcpServer::_ZTV10QTcpServer) + 16)
+ QObject (0x0x7f5272661780) 0
+ primary-for QTcpServer (0x0x7f5272662548)
+
+Class QSslCertificateExtension
+ size=8 align=8
+ base size=8 base align=8
+QSslCertificateExtension (0x0x7f52726619c0) 0
+
+Class QSslCipher
+ size=8 align=8
+ base size=8 base align=8
+QSslCipher (0x0x7f52726d4960) 0
+
+Class QSslDiffieHellmanParameters
+ size=8 align=8
+ base size=8 base align=8
+QSslDiffieHellmanParameters (0x0x7f527233fa20) 0
+
+Class QSslEllipticCurve
+ size=4 align=4
+ base size=4 base align=4
+QSslEllipticCurve (0x0x7f52723a8780) 0
+
+Class QSslKey
+ size=8 align=8
+ base size=8 base align=8
+QSslKey (0x0x7f52723de120) 0
+
+Class QUdpSocket::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QUdpSocket::QPrivateSignal (0x0x7f527244e000) 0 empty
+
+Vtable for QUdpSocket
+QUdpSocket::_ZTV10QUdpSocket: 41 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QUdpSocket)
+16 (int (*)(...))QUdpSocket::metaObject
+24 (int (*)(...))QUdpSocket::qt_metacast
+32 (int (*)(...))QUdpSocket::qt_metacall
+40 (int (*)(...))QUdpSocket::~QUdpSocket
+48 (int (*)(...))QUdpSocket::~QUdpSocket
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QAbstractSocket::isSequential
+120 (int (*)(...))QIODevice::open
+128 (int (*)(...))QAbstractSocket::close
+136 (int (*)(...))QIODevice::pos
+144 (int (*)(...))QIODevice::size
+152 (int (*)(...))QIODevice::seek
+160 (int (*)(...))QAbstractSocket::atEnd
+168 (int (*)(...))QIODevice::reset
+176 (int (*)(...))QAbstractSocket::bytesAvailable
+184 (int (*)(...))QAbstractSocket::bytesToWrite
+192 (int (*)(...))QAbstractSocket::canReadLine
+200 (int (*)(...))QAbstractSocket::waitForReadyRead
+208 (int (*)(...))QAbstractSocket::waitForBytesWritten
+216 (int (*)(...))QAbstractSocket::readData
+224 (int (*)(...))QAbstractSocket::readLineData
+232 (int (*)(...))QAbstractSocket::writeData
+240 (int (*)(...))QAbstractSocket::resume
+248 (int (*)(...))QAbstractSocket::connectToHost
+256 (int (*)(...))QAbstractSocket::connectToHost
+264 (int (*)(...))QAbstractSocket::disconnectFromHost
+272 (int (*)(...))QAbstractSocket::setReadBufferSize
+280 (int (*)(...))QAbstractSocket::socketDescriptor
+288 (int (*)(...))QAbstractSocket::setSocketDescriptor
+296 (int (*)(...))QAbstractSocket::setSocketOption
+304 (int (*)(...))QAbstractSocket::socketOption
+312 (int (*)(...))QAbstractSocket::waitForConnected
+320 (int (*)(...))QAbstractSocket::waitForDisconnected
+
+Class QUdpSocket
+ size=16 align=8
+ base size=16 base align=8
+QUdpSocket (0x0x7f527243faf8) 0
+ vptr=((& QUdpSocket::_ZTV10QUdpSocket) + 16)
+ QAbstractSocket (0x0x7f527243fb60) 0
+ primary-for QUdpSocket (0x0x7f527243faf8)
+ QIODevice (0x0x7f527243fbc8) 0
+ primary-for QAbstractSocket (0x0x7f527243fb60)
+ QObject (0x0x7f527243bf60) 0
+ primary-for QIODevice (0x0x7f527243fbc8)
+
+Class QJSValue
+ size=8 align=8
+ base size=8 base align=8
+QJSValue (0x0x7f527244e240) 0
+
+Class QQmlDebuggingEnabler
+ size=1 align=1
+ base size=0 base align=1
+QQmlDebuggingEnabler (0x0x7f527244e780) 0 empty
+
+Class QJSEngine::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QJSEngine::QPrivateSignal (0x0x7f527244e840) 0 empty
+
+Vtable for QJSEngine
+QJSEngine::_ZTV9QJSEngine: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QJSEngine)
+16 (int (*)(...))QJSEngine::metaObject
+24 (int (*)(...))QJSEngine::qt_metacast
+32 (int (*)(...))QJSEngine::qt_metacall
+40 (int (*)(...))QJSEngine::~QJSEngine
+48 (int (*)(...))QJSEngine::~QJSEngine
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QJSEngine
+ size=24 align=8
+ base size=24 base align=8
+QJSEngine (0x0x7f527243fc98) 0
+ vptr=((& QJSEngine::_ZTV9QJSEngine) + 16)
+ QObject (0x0x7f527244e7e0) 0
+ primary-for QJSEngine (0x0x7f527243fc98)
+
+Class QJSValueIterator
+ size=8 align=8
+ base size=8 base align=8
+QJSValueIterator (0x0x7f52724af3c0) 0
+
+Vtable for QQmlParserStatus
+QQmlParserStatus::_ZTV16QQmlParserStatus: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QQmlParserStatus)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+
+Class QQmlParserStatus
+ size=16 align=8
+ base size=16 base align=8
+QQmlParserStatus (0x0x7f52724af5a0) 0
+ vptr=((& QQmlParserStatus::_ZTV16QQmlParserStatus) + 16)
+
+Class QQmlListReference
+ size=8 align=8
+ base size=8 base align=8
+QQmlListReference (0x0x7f52724cc180) 0
+
+Vtable for QQmlPropertyValueSource
+QQmlPropertyValueSource::_ZTV23QQmlPropertyValueSource: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI23QQmlPropertyValueSource)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+
+Class QQmlPropertyValueSource
+ size=8 align=8
+ base size=8 base align=8
+QQmlPropertyValueSource (0x0x7f52724cc3c0) 0 nearly-empty
+ vptr=((& QQmlPropertyValueSource::_ZTV23QQmlPropertyValueSource) + 16)
+
+Class QQmlPrivate::RegisterType
+ size=128 align=8
+ base size=124 base align=8
+QQmlPrivate::RegisterType (0x0x7f52724eb5a0) 0
+
+Class QQmlPrivate::RegisterTypeAndRevisions
+ size=112 align=8
+ base size=112 base align=8
+QQmlPrivate::RegisterTypeAndRevisions (0x0x7f52724eb600) 0
+
+Class QQmlPrivate::RegisterInterface
+ size=40 align=8
+ base size=40 base align=8
+QQmlPrivate::RegisterInterface (0x0x7f52724eb660) 0
+
+Class QQmlPrivate::RegisterAutoParent
+ size=16 align=8
+ base size=16 base align=8
+QQmlPrivate::RegisterAutoParent (0x0x7f52724eb6c0) 0
+
+Class QQmlPrivate::RegisterSingletonType
+ size=96 align=8
+ base size=96 base align=8
+QQmlPrivate::RegisterSingletonType (0x0x7f52724eb720) 0
+
+Class QQmlPrivate::RegisterSingletonTypeAndRevisions
+ size=88 align=8
+ base size=88 base align=8
+QQmlPrivate::RegisterSingletonTypeAndRevisions (0x0x7f52724eb900) 0
+
+Class QQmlPrivate::RegisterCompositeType
+ size=32 align=8
+ base size=32 base align=8
+QQmlPrivate::RegisterCompositeType (0x0x7f52724eb960) 0
+
+Class QQmlPrivate::RegisterCompositeSingletonType
+ size=32 align=8
+ base size=32 base align=8
+QQmlPrivate::RegisterCompositeSingletonType (0x0x7f52724eb9c0) 0
+
+Class QQmlPrivate::CachedQmlUnit
+ size=24 align=8
+ base size=24 base align=8
+QQmlPrivate::CachedQmlUnit (0x0x7f52724eba20) 0
+
+Class QQmlPrivate::RegisterQmlUnitCacheHook
+ size=16 align=8
+ base size=16 base align=8
+QQmlPrivate::RegisterQmlUnitCacheHook (0x0x7f52724eba80) 0
+
+Class QQmlPrivate::RegisterSingletonFunctor
+ size=24 align=8
+ base size=17 base align=8
+QQmlPrivate::RegisterSingletonFunctor (0x0x7f52724ebae0) 0
+
+Vtable for QQmlAbstractUrlInterceptor
+QQmlAbstractUrlInterceptor::_ZTV26QQmlAbstractUrlInterceptor: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI26QQmlAbstractUrlInterceptor)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+
+Class QQmlAbstractUrlInterceptor
+ size=8 align=8
+ base size=8 base align=8
+QQmlAbstractUrlInterceptor (0x0x7f5272188c60) 0 nearly-empty
+ vptr=((& QQmlAbstractUrlInterceptor::_ZTV26QQmlAbstractUrlInterceptor) + 16)
+
+Class QQmlError
+ size=8 align=8
+ base size=8 base align=8
+QQmlError (0x0x7f5272188cc0) 0
+
+Vtable for QQmlImageProviderBase
+QQmlImageProviderBase::_ZTV21QQmlImageProviderBase: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI21QQmlImageProviderBase)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+
+Class QQmlImageProviderBase
+ size=8 align=8
+ base size=8 base align=8
+QQmlImageProviderBase (0x0x7f52721c4c00) 0 nearly-empty
+ vptr=((& QQmlImageProviderBase::_ZTV21QQmlImageProviderBase) + 16)
+
+Class QQmlEngine::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQmlEngine::QPrivateSignal (0x0x7f52721e83c0) 0 empty
+
+Vtable for QQmlEngine
+QQmlEngine::_ZTV10QQmlEngine: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QQmlEngine)
+16 (int (*)(...))QQmlEngine::metaObject
+24 (int (*)(...))QQmlEngine::qt_metacast
+32 (int (*)(...))QQmlEngine::qt_metacall
+40 (int (*)(...))QQmlEngine::~QQmlEngine
+48 (int (*)(...))QQmlEngine::~QQmlEngine
+56 (int (*)(...))QQmlEngine::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QQmlEngine
+ size=24 align=8
+ base size=24 base align=8
+QQmlEngine (0x0x7f52721caa90) 0
+ vptr=((& QQmlEngine::_ZTV10QQmlEngine) + 16)
+ QJSEngine (0x0x7f52721caaf8) 0
+ primary-for QQmlEngine (0x0x7f52721caa90)
+ QObject (0x0x7f52721e8360) 0
+ primary-for QJSEngine (0x0x7f52721caaf8)
+
+Class QQmlApplicationEngine::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQmlApplicationEngine::QPrivateSignal (0x0x7f52721e8660) 0 empty
+
+Vtable for QQmlApplicationEngine
+QQmlApplicationEngine::_ZTV21QQmlApplicationEngine: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI21QQmlApplicationEngine)
+16 (int (*)(...))QQmlApplicationEngine::metaObject
+24 (int (*)(...))QQmlApplicationEngine::qt_metacast
+32 (int (*)(...))QQmlApplicationEngine::qt_metacall
+40 (int (*)(...))QQmlApplicationEngine::~QQmlApplicationEngine
+48 (int (*)(...))QQmlApplicationEngine::~QQmlApplicationEngine
+56 (int (*)(...))QQmlEngine::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QQmlApplicationEngine
+ size=24 align=8
+ base size=24 base align=8
+QQmlApplicationEngine (0x0x7f52721cab60) 0
+ vptr=((& QQmlApplicationEngine::_ZTV21QQmlApplicationEngine) + 16)
+ QQmlEngine (0x0x7f52721cabc8) 0
+ primary-for QQmlApplicationEngine (0x0x7f52721cab60)
+ QJSEngine (0x0x7f52721cac30) 0
+ primary-for QQmlEngine (0x0x7f52721cabc8)
+ QObject (0x0x7f52721e8600) 0
+ primary-for QJSEngine (0x0x7f52721cac30)
+
+Class QQmlComponent::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQmlComponent::QPrivateSignal (0x0x7f52721e88a0) 0 empty
+
+Vtable for QQmlComponent
+QQmlComponent::_ZTV13QQmlComponent: 17 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QQmlComponent)
+16 (int (*)(...))QQmlComponent::metaObject
+24 (int (*)(...))QQmlComponent::qt_metacast
+32 (int (*)(...))QQmlComponent::qt_metacall
+40 (int (*)(...))QQmlComponent::~QQmlComponent
+48 (int (*)(...))QQmlComponent::~QQmlComponent
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QQmlComponent::create
+120 (int (*)(...))QQmlComponent::beginCreate
+128 (int (*)(...))QQmlComponent::completeCreate
+
+Class QQmlComponent
+ size=16 align=8
+ base size=16 base align=8
+QQmlComponent (0x0x7f52721cac98) 0
+ vptr=((& QQmlComponent::_ZTV13QQmlComponent) + 16)
+ QObject (0x0x7f52721e8840) 0
+ primary-for QQmlComponent (0x0x7f52721cac98)
+
+Class QQmlContext::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQmlContext::QPrivateSignal (0x0x7f5272228180) 0 empty
+
+Class QQmlContext::PropertyPair
+ size=24 align=8
+ base size=24 base align=8
+QQmlContext::PropertyPair (0x0x7f52722281e0) 0
+
+Vtable for QQmlContext
+QQmlContext::_ZTV11QQmlContext: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QQmlContext)
+16 (int (*)(...))QQmlContext::metaObject
+24 (int (*)(...))QQmlContext::qt_metacast
+32 (int (*)(...))QQmlContext::qt_metacall
+40 (int (*)(...))QQmlContext::~QQmlContext
+48 (int (*)(...))QQmlContext::~QQmlContext
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QQmlContext
+ size=16 align=8
+ base size=16 base align=8
+QQmlContext (0x0x7f52721cad00) 0
+ vptr=((& QQmlContext::_ZTV11QQmlContext) + 16)
+ QObject (0x0x7f5272228120) 0
+ primary-for QQmlContext (0x0x7f52721cad00)
+
+Class QQmlScriptString
+ size=8 align=8
+ base size=8 base align=8
+QQmlScriptString (0x0x7f52722285a0) 0
+
+Class QQmlExpression::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQmlExpression::QPrivateSignal (0x0x7f52722288a0) 0 empty
+
+Vtable for QQmlExpression
+QQmlExpression::_ZTV14QQmlExpression: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QQmlExpression)
+16 (int (*)(...))QQmlExpression::metaObject
+24 (int (*)(...))QQmlExpression::qt_metacast
+32 (int (*)(...))QQmlExpression::qt_metacall
+40 (int (*)(...))QQmlExpression::~QQmlExpression
+48 (int (*)(...))QQmlExpression::~QQmlExpression
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QQmlExpression
+ size=16 align=8
+ base size=16 base align=8
+QQmlExpression (0x0x7f52721cad68) 0
+ vptr=((& QQmlExpression::_ZTV14QQmlExpression) + 16)
+ QObject (0x0x7f5272228840) 0
+ primary-for QQmlExpression (0x0x7f52721cad68)
+
+Vtable for QQmlTypesExtensionInterface
+QQmlTypesExtensionInterface::_ZTV27QQmlTypesExtensionInterface: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI27QQmlTypesExtensionInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+
+Class QQmlTypesExtensionInterface
+ size=8 align=8
+ base size=8 base align=8
+QQmlTypesExtensionInterface (0x0x7f5272228a80) 0 nearly-empty
+ vptr=((& QQmlTypesExtensionInterface::_ZTV27QQmlTypesExtensionInterface) + 16)
+
+Vtable for QQmlExtensionInterface
+QQmlExtensionInterface::_ZTV22QQmlExtensionInterface: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI22QQmlExtensionInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+
+Class QQmlExtensionInterface
+ size=8 align=8
+ base size=8 base align=8
+QQmlExtensionInterface (0x0x7f52721cadd0) 0 nearly-empty
+ vptr=((& QQmlExtensionInterface::_ZTV22QQmlExtensionInterface) + 16)
+ QQmlTypesExtensionInterface (0x0x7f5272228ae0) 0 nearly-empty
+ primary-for QQmlExtensionInterface (0x0x7f52721cadd0)
+
+Vtable for QQmlEngineExtensionInterface
+QQmlEngineExtensionInterface::_ZTV28QQmlEngineExtensionInterface: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI28QQmlEngineExtensionInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+
+Class QQmlEngineExtensionInterface
+ size=8 align=8
+ base size=8 base align=8
+QQmlEngineExtensionInterface (0x0x7f5272228b40) 0 nearly-empty
+ vptr=((& QQmlEngineExtensionInterface::_ZTV28QQmlEngineExtensionInterface) + 16)
+
+Class QQmlExtensionPlugin::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQmlExtensionPlugin::QPrivateSignal (0x0x7f5272261120) 0 empty
+
+Vtable for QQmlExtensionPlugin
+QQmlExtensionPlugin::_ZTV19QQmlExtensionPlugin: 22 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QQmlExtensionPlugin)
+16 (int (*)(...))QQmlExtensionPlugin::metaObject
+24 (int (*)(...))QQmlExtensionPlugin::qt_metacast
+32 (int (*)(...))QQmlExtensionPlugin::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))QQmlExtensionPlugin::initializeEngine
+128 (int (*)(...))-16
+136 (int (*)(...))(& _ZTI19QQmlExtensionPlugin)
+144 0
+152 0
+160 (int (*)(...))__cxa_pure_virtual
+168 (int (*)(...))QQmlExtensionPlugin::_ZThn16_N19QQmlExtensionPlugin16initializeEngineEP10QQmlEnginePKc
+
+Class QQmlExtensionPlugin
+ size=24 align=8
+ base size=24 base align=8
+QQmlExtensionPlugin (0x0x7f5272237c40) 0
+ vptr=((& QQmlExtensionPlugin::_ZTV19QQmlExtensionPlugin) + 16)
+ QObject (0x0x7f5272261060) 0
+ primary-for QQmlExtensionPlugin (0x0x7f5272237c40)
+ QQmlExtensionInterface (0x0x7f52721cae38) 16 nearly-empty
+ vptr=((& QQmlExtensionPlugin::_ZTV19QQmlExtensionPlugin) + 144)
+ QQmlTypesExtensionInterface (0x0x7f52722610c0) 16 nearly-empty
+ primary-for QQmlExtensionInterface (0x0x7f52721cae38)
+
+Class QQmlEngineExtensionPlugin::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQmlEngineExtensionPlugin::QPrivateSignal (0x0x7f52722613c0) 0 empty
+
+Vtable for QQmlEngineExtensionPlugin
+QQmlEngineExtensionPlugin::_ZTV25QQmlEngineExtensionPlugin: 20 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI25QQmlEngineExtensionPlugin)
+16 (int (*)(...))QQmlEngineExtensionPlugin::metaObject
+24 (int (*)(...))QQmlEngineExtensionPlugin::qt_metacast
+32 (int (*)(...))QQmlEngineExtensionPlugin::qt_metacall
+40 (int (*)(...))QQmlEngineExtensionPlugin::~QQmlEngineExtensionPlugin
+48 (int (*)(...))QQmlEngineExtensionPlugin::~QQmlEngineExtensionPlugin
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QQmlEngineExtensionPlugin::initializeEngine
+120 (int (*)(...))-16
+128 (int (*)(...))(& _ZTI25QQmlEngineExtensionPlugin)
+136 (int (*)(...))QQmlEngineExtensionPlugin::_ZThn16_N25QQmlEngineExtensionPluginD1Ev
+144 (int (*)(...))QQmlEngineExtensionPlugin::_ZThn16_N25QQmlEngineExtensionPluginD0Ev
+152 (int (*)(...))QQmlEngineExtensionPlugin::_ZThn16_N25QQmlEngineExtensionPlugin16initializeEngineEP10QQmlEnginePKc
+
+Class QQmlEngineExtensionPlugin
+ size=24 align=8
+ base size=24 base align=8
+QQmlEngineExtensionPlugin (0x0x7f5272237e00) 0
+ vptr=((& QQmlEngineExtensionPlugin::_ZTV25QQmlEngineExtensionPlugin) + 16)
+ QObject (0x0x7f5272261300) 0
+ primary-for QQmlEngineExtensionPlugin (0x0x7f5272237e00)
+ QQmlEngineExtensionInterface (0x0x7f5272261360) 16 nearly-empty
+ vptr=((& QQmlEngineExtensionPlugin::_ZTV25QQmlEngineExtensionPlugin) + 136)
+
+Class QQmlFile
+ size=8 align=8
+ base size=8 base align=8
+QQmlFile (0x0x7f52722614e0) 0
+
+Class QQmlFileSelector::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQmlFileSelector::QPrivateSignal (0x0x7f52722615a0) 0 empty
+
+Vtable for QQmlFileSelector
+QQmlFileSelector::_ZTV16QQmlFileSelector: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QQmlFileSelector)
+16 (int (*)(...))QQmlFileSelector::metaObject
+24 (int (*)(...))QQmlFileSelector::qt_metacast
+32 (int (*)(...))QQmlFileSelector::qt_metacall
+40 (int (*)(...))QQmlFileSelector::~QQmlFileSelector
+48 (int (*)(...))QQmlFileSelector::~QQmlFileSelector
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QQmlFileSelector
+ size=16 align=8
+ base size=16 base align=8
+QQmlFileSelector (0x0x7f52721caf08) 0
+ vptr=((& QQmlFileSelector::_ZTV16QQmlFileSelector) + 16)
+ QObject (0x0x7f5272261540) 0
+ primary-for QQmlFileSelector (0x0x7f52721caf08)
+
+Vtable for QQmlIncubator
+QQmlIncubator::_ZTV13QQmlIncubator: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QQmlIncubator)
+16 (int (*)(...))QQmlIncubator::~QQmlIncubator
+24 (int (*)(...))QQmlIncubator::~QQmlIncubator
+32 (int (*)(...))QQmlIncubator::statusChanged
+40 (int (*)(...))QQmlIncubator::setInitialState
+
+Class QQmlIncubator
+ size=16 align=8
+ base size=16 base align=8
+QQmlIncubator (0x0x7f5272261780) 0
+ vptr=((& QQmlIncubator::_ZTV13QQmlIncubator) + 16)
+
+Vtable for QQmlIncubationController
+QQmlIncubationController::_ZTV24QQmlIncubationController: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI24QQmlIncubationController)
+16 (int (*)(...))QQmlIncubationController::~QQmlIncubationController
+24 (int (*)(...))QQmlIncubationController::~QQmlIncubationController
+32 (int (*)(...))QQmlIncubationController::incubatingObjectCountChanged
+
+Class QQmlIncubationController
+ size=16 align=8
+ base size=16 base align=8
+QQmlIncubationController (0x0x7f52722617e0) 0
+ vptr=((& QQmlIncubationController::_ZTV24QQmlIncubationController) + 16)
+
+Class QQmlInfo
+ size=16 align=8
+ base size=16 base align=8
+QQmlInfo (0x0x7f52721caf70) 0
+ QDebug (0x0x7f5272261840) 0
+
+Class QQmlModuleRegistration
+ size=8 align=8
+ base size=8 base align=8
+QQmlModuleRegistration (0x0x7f527229c7e0) 0
+
+Vtable for QQmlNetworkAccessManagerFactory
+QQmlNetworkAccessManagerFactory::_ZTV31QQmlNetworkAccessManagerFactory: 5 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI31QQmlNetworkAccessManagerFactory)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+
+Class QQmlNetworkAccessManagerFactory
+ size=8 align=8
+ base size=8 base align=8
+QQmlNetworkAccessManagerFactory (0x0x7f527229c840) 0 nearly-empty
+ vptr=((& QQmlNetworkAccessManagerFactory::_ZTV31QQmlNetworkAccessManagerFactory) + 16)
+
+Class QQmlProperty
+ size=8 align=8
+ base size=8 base align=8
+QQmlProperty (0x0x7f527229c8a0) 0
+
+Class QQmlPropertyMap::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQmlPropertyMap::QPrivateSignal (0x0x7f52722dd120) 0 empty
+
+Vtable for QQmlPropertyMap
+QQmlPropertyMap::_ZTV15QQmlPropertyMap: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QQmlPropertyMap)
+16 (int (*)(...))QQmlPropertyMap::metaObject
+24 (int (*)(...))QQmlPropertyMap::qt_metacast
+32 (int (*)(...))QQmlPropertyMap::qt_metacall
+40 (int (*)(...))QQmlPropertyMap::~QQmlPropertyMap
+48 (int (*)(...))QQmlPropertyMap::~QQmlPropertyMap
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QQmlPropertyMap::updateValue
+
+Class QQmlPropertyMap
+ size=16 align=8
+ base size=16 base align=8
+QQmlPropertyMap (0x0x7f52722d95b0) 0
+ vptr=((& QQmlPropertyMap::_ZTV15QQmlPropertyMap) + 16)
+ QObject (0x0x7f52722dd0c0) 0
+ primary-for QQmlPropertyMap (0x0x7f52722d95b0)
+
+Class QQuickTransform::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQuickTransform::QPrivateSignal (0x0x7f52722dd3c0) 0 empty
+
+Vtable for QQuickTransform
+QQuickTransform::_ZTV15QQuickTransform: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QQuickTransform)
+16 (int (*)(...))QQuickTransform::metaObject
+24 (int (*)(...))QQuickTransform::qt_metacast
+32 (int (*)(...))QQuickTransform::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+
+Class QQuickTransform
+ size=16 align=8
+ base size=16 base align=8
+QQuickTransform (0x0x7f52722d9618) 0
+ vptr=((& QQuickTransform::_ZTV15QQuickTransform) + 16)
+ QObject (0x0x7f52722dd360) 0
+ primary-for QQuickTransform (0x0x7f52722d9618)
+
+Class QQuickItem::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQuickItem::QPrivateSignal (0x0x7f52722dd660) 0 empty
+
+Class QQuickItem::ItemChangeData
+ size=8 align=8
+ base size=8 base align=8
+QQuickItem::ItemChangeData (0x0x7f52722dd6c0) 0
+
+Class QQuickItem::UpdatePaintNodeData
+ size=8 align=8
+ base size=8 base align=8
+QQuickItem::UpdatePaintNodeData (0x0x7f52722dd720) 0
+
+Vtable for QQuickItem
+QQuickItem::_ZTV10QQuickItem: 55 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QQuickItem)
+16 (int (*)(...))QQuickItem::metaObject
+24 (int (*)(...))QQuickItem::qt_metacast
+32 (int (*)(...))QQuickItem::qt_metacall
+40 (int (*)(...))QQuickItem::~QQuickItem
+48 (int (*)(...))QQuickItem::~QQuickItem
+56 (int (*)(...))QQuickItem::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QQuickItem::boundingRect
+120 (int (*)(...))QQuickItem::clipRect
+128 (int (*)(...))QQuickItem::contains
+136 (int (*)(...))QQuickItem::inputMethodQuery
+144 (int (*)(...))QQuickItem::isTextureProvider
+152 (int (*)(...))QQuickItem::textureProvider
+160 (int (*)(...))QQuickItem::itemChange
+168 (int (*)(...))QQuickItem::classBegin
+176 (int (*)(...))QQuickItem::componentComplete
+184 (int (*)(...))QQuickItem::keyPressEvent
+192 (int (*)(...))QQuickItem::keyReleaseEvent
+200 (int (*)(...))QQuickItem::inputMethodEvent
+208 (int (*)(...))QQuickItem::focusInEvent
+216 (int (*)(...))QQuickItem::focusOutEvent
+224 (int (*)(...))QQuickItem::mousePressEvent
+232 (int (*)(...))QQuickItem::mouseMoveEvent
+240 (int (*)(...))QQuickItem::mouseReleaseEvent
+248 (int (*)(...))QQuickItem::mouseDoubleClickEvent
+256 (int (*)(...))QQuickItem::mouseUngrabEvent
+264 (int (*)(...))QQuickItem::touchUngrabEvent
+272 (int (*)(...))QQuickItem::wheelEvent
+280 (int (*)(...))QQuickItem::touchEvent
+288 (int (*)(...))QQuickItem::hoverEnterEvent
+296 (int (*)(...))QQuickItem::hoverMoveEvent
+304 (int (*)(...))QQuickItem::hoverLeaveEvent
+312 (int (*)(...))QQuickItem::dragEnterEvent
+320 (int (*)(...))QQuickItem::dragMoveEvent
+328 (int (*)(...))QQuickItem::dragLeaveEvent
+336 (int (*)(...))QQuickItem::dropEvent
+344 (int (*)(...))QQuickItem::childMouseEventFilter
+352 (int (*)(...))QQuickItem::windowDeactivateEvent
+360 (int (*)(...))QQuickItem::geometryChanged
+368 (int (*)(...))QQuickItem::updatePaintNode
+376 (int (*)(...))QQuickItem::releaseResources
+384 (int (*)(...))QQuickItem::updatePolish
+392 (int (*)(...))-16
+400 (int (*)(...))(& _ZTI10QQuickItem)
+408 (int (*)(...))QQuickItem::_ZThn16_N10QQuickItemD1Ev
+416 (int (*)(...))QQuickItem::_ZThn16_N10QQuickItemD0Ev
+424 (int (*)(...))QQuickItem::_ZThn16_N10QQuickItem10classBeginEv
+432 (int (*)(...))QQuickItem::_ZThn16_N10QQuickItem17componentCompleteEv
+
+Class QQuickItem
+ size=32 align=8
+ base size=32 base align=8
+QQuickItem (0x0x7f52722dc700) 0
+ vptr=((& QQuickItem::_ZTV10QQuickItem) + 16)
+ QObject (0x0x7f52722dd5a0) 0
+ primary-for QQuickItem (0x0x7f52722dc700)
+ QQmlParserStatus (0x0x7f52722dd600) 16
+ vptr=((& QQuickItem::_ZTV10QQuickItem) + 408)
+
+Class QQuickFramebufferObject::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQuickFramebufferObject::QPrivateSignal (0x0x7f5271f5b0c0) 0 empty
+
+Vtable for QQuickFramebufferObject::Renderer
+QQuickFramebufferObject::Renderer::_ZTVN23QQuickFramebufferObject8RendererE: 7 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTIN23QQuickFramebufferObject8RendererE)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))QQuickFramebufferObject::Renderer::createFramebufferObject
+48 (int (*)(...))QQuickFramebufferObject::Renderer::synchronize
+
+Class QQuickFramebufferObject::Renderer
+ size=16 align=8
+ base size=16 base align=8
+QQuickFramebufferObject::Renderer (0x0x7f5271f5b120) 0
+ vptr=((& QQuickFramebufferObject::Renderer::_ZTVN23QQuickFramebufferObject8RendererE) + 16)
+
+Vtable for QQuickFramebufferObject
+QQuickFramebufferObject::_ZTV23QQuickFramebufferObject: 56 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI23QQuickFramebufferObject)
+16 (int (*)(...))QQuickFramebufferObject::metaObject
+24 (int (*)(...))QQuickFramebufferObject::qt_metacast
+32 (int (*)(...))QQuickFramebufferObject::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QQuickItem::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QQuickItem::boundingRect
+120 (int (*)(...))QQuickItem::clipRect
+128 (int (*)(...))QQuickItem::contains
+136 (int (*)(...))QQuickItem::inputMethodQuery
+144 (int (*)(...))QQuickFramebufferObject::isTextureProvider
+152 (int (*)(...))QQuickFramebufferObject::textureProvider
+160 (int (*)(...))QQuickItem::itemChange
+168 (int (*)(...))QQuickItem::classBegin
+176 (int (*)(...))QQuickItem::componentComplete
+184 (int (*)(...))QQuickItem::keyPressEvent
+192 (int (*)(...))QQuickItem::keyReleaseEvent
+200 (int (*)(...))QQuickItem::inputMethodEvent
+208 (int (*)(...))QQuickItem::focusInEvent
+216 (int (*)(...))QQuickItem::focusOutEvent
+224 (int (*)(...))QQuickItem::mousePressEvent
+232 (int (*)(...))QQuickItem::mouseMoveEvent
+240 (int (*)(...))QQuickItem::mouseReleaseEvent
+248 (int (*)(...))QQuickItem::mouseDoubleClickEvent
+256 (int (*)(...))QQuickItem::mouseUngrabEvent
+264 (int (*)(...))QQuickItem::touchUngrabEvent
+272 (int (*)(...))QQuickItem::wheelEvent
+280 (int (*)(...))QQuickItem::touchEvent
+288 (int (*)(...))QQuickItem::hoverEnterEvent
+296 (int (*)(...))QQuickItem::hoverMoveEvent
+304 (int (*)(...))QQuickItem::hoverLeaveEvent
+312 (int (*)(...))QQuickItem::dragEnterEvent
+320 (int (*)(...))QQuickItem::dragMoveEvent
+328 (int (*)(...))QQuickItem::dragLeaveEvent
+336 (int (*)(...))QQuickItem::dropEvent
+344 (int (*)(...))QQuickItem::childMouseEventFilter
+352 (int (*)(...))QQuickItem::windowDeactivateEvent
+360 (int (*)(...))QQuickFramebufferObject::geometryChanged
+368 (int (*)(...))QQuickFramebufferObject::updatePaintNode
+376 (int (*)(...))QQuickFramebufferObject::releaseResources
+384 (int (*)(...))QQuickItem::updatePolish
+392 (int (*)(...))__cxa_pure_virtual
+400 (int (*)(...))-16
+408 (int (*)(...))(& _ZTI23QQuickFramebufferObject)
+416 0
+424 0
+432 (int (*)(...))QQuickItem::_ZThn16_N10QQuickItem10classBeginEv
+440 (int (*)(...))QQuickItem::_ZThn16_N10QQuickItem17componentCompleteEv
+
+Class QQuickFramebufferObject
+ size=32 align=8
+ base size=32 base align=8
+QQuickFramebufferObject (0x0x7f52722d9750) 0
+ vptr=((& QQuickFramebufferObject::_ZTV23QQuickFramebufferObject) + 16)
+ QQuickItem (0x0x7f5271f58150) 0
+ primary-for QQuickFramebufferObject (0x0x7f52722d9750)
+ QObject (0x0x7f5271f5b000) 0
+ primary-for QQuickItem (0x0x7f5271f58150)
+ QQmlParserStatus (0x0x7f5271f5b060) 16
+ vptr=((& QQuickFramebufferObject::_ZTV23QQuickFramebufferObject) + 416)
+
+Class QQuickTextureFactory::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQuickTextureFactory::QPrivateSignal (0x0x7f5271f5b360) 0 empty
+
+Vtable for QQuickTextureFactory
+QQuickTextureFactory::_ZTV20QQuickTextureFactory: 18 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QQuickTextureFactory)
+16 (int (*)(...))QQuickTextureFactory::metaObject
+24 (int (*)(...))QQuickTextureFactory::qt_metacast
+32 (int (*)(...))QQuickTextureFactory::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))__cxa_pure_virtual
+136 (int (*)(...))QQuickTextureFactory::image
+
+Class QQuickTextureFactory
+ size=16 align=8
+ base size=16 base align=8
+QQuickTextureFactory (0x0x7f52722d97b8) 0
+ vptr=((& QQuickTextureFactory::_ZTV20QQuickTextureFactory) + 16)
+ QObject (0x0x7f5271f5b300) 0
+ primary-for QQuickTextureFactory (0x0x7f52722d97b8)
+
+Class QQuickImageResponse::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQuickImageResponse::QPrivateSignal (0x0x7f5271f5b4e0) 0 empty
+
+Vtable for QQuickImageResponse
+QQuickImageResponse::_ZTV19QQuickImageResponse: 17 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QQuickImageResponse)
+16 (int (*)(...))QQuickImageResponse::metaObject
+24 (int (*)(...))QQuickImageResponse::qt_metacast
+32 (int (*)(...))QQuickImageResponse::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))QQuickImageResponse::errorString
+128 (int (*)(...))QQuickImageResponse::cancel
+
+Class QQuickImageResponse
+ size=16 align=8
+ base size=16 base align=8
+QQuickImageResponse (0x0x7f52722d9820) 0
+ vptr=((& QQuickImageResponse::_ZTV19QQuickImageResponse) + 16)
+ QObject (0x0x7f5271f5b480) 0
+ primary-for QQuickImageResponse (0x0x7f52722d9820)
+
+Vtable for QQuickImageProvider
+QQuickImageProvider::_ZTV19QQuickImageProvider: 9 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QQuickImageProvider)
+16 (int (*)(...))QQuickImageProvider::~QQuickImageProvider
+24 (int (*)(...))QQuickImageProvider::~QQuickImageProvider
+32 (int (*)(...))QQuickImageProvider::imageType
+40 (int (*)(...))QQuickImageProvider::flags
+48 (int (*)(...))QQuickImageProvider::requestImage
+56 (int (*)(...))QQuickImageProvider::requestPixmap
+64 (int (*)(...))QQuickImageProvider::requestTexture
+
+Class QQuickImageProvider
+ size=16 align=8
+ base size=16 base align=8
+QQuickImageProvider (0x0x7f52722d9888) 0
+ vptr=((& QQuickImageProvider::_ZTV19QQuickImageProvider) + 16)
+ QQmlImageProviderBase (0x0x7f5271f5b6c0) 0 nearly-empty
+ primary-for QQuickImageProvider (0x0x7f52722d9888)
+
+Vtable for QQuickAsyncImageProvider
+QQuickAsyncImageProvider::_ZTV24QQuickAsyncImageProvider: 10 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI24QQuickAsyncImageProvider)
+16 0
+24 0
+32 (int (*)(...))QQuickImageProvider::imageType
+40 (int (*)(...))QQuickImageProvider::flags
+48 (int (*)(...))QQuickImageProvider::requestImage
+56 (int (*)(...))QQuickImageProvider::requestPixmap
+64 (int (*)(...))QQuickImageProvider::requestTexture
+72 (int (*)(...))__cxa_pure_virtual
+
+Class QQuickAsyncImageProvider
+ size=24 align=8
+ base size=24 base align=8
+QQuickAsyncImageProvider (0x0x7f52722d98f0) 0
+ vptr=((& QQuickAsyncImageProvider::_ZTV24QQuickAsyncImageProvider) + 16)
+ QQuickImageProvider (0x0x7f52722d9958) 0
+ primary-for QQuickAsyncImageProvider (0x0x7f52722d98f0)
+ QQmlImageProviderBase (0x0x7f5271f5b900) 0 nearly-empty
+ primary-for QQuickImageProvider (0x0x7f52722d9958)
+
+Class QQuickItemGrabResult::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQuickItemGrabResult::QPrivateSignal (0x0x7f5271f5b9c0) 0 empty
+
+Vtable for QQuickItemGrabResult
+QQuickItemGrabResult::_ZTV20QQuickItemGrabResult: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QQuickItemGrabResult)
+16 (int (*)(...))QQuickItemGrabResult::metaObject
+24 (int (*)(...))QQuickItemGrabResult::qt_metacast
+32 (int (*)(...))QQuickItemGrabResult::qt_metacall
+40 (int (*)(...))QQuickItemGrabResult::~QQuickItemGrabResult
+48 (int (*)(...))QQuickItemGrabResult::~QQuickItemGrabResult
+56 (int (*)(...))QQuickItemGrabResult::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QQuickItemGrabResult
+ size=16 align=8
+ base size=16 base align=8
+QQuickItemGrabResult (0x0x7f52722d99c0) 0
+ vptr=((& QQuickItemGrabResult::_ZTV20QQuickItemGrabResult) + 16)
+ QObject (0x0x7f5271f5b960) 0
+ primary-for QQuickItemGrabResult (0x0x7f52722d99c0)
+
+Class QQuickPaintedItem::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQuickPaintedItem::QPrivateSignal (0x0x7f5271f5bc60) 0 empty
+
+Vtable for QQuickPaintedItem
+QQuickPaintedItem::_ZTV17QQuickPaintedItem: 56 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QQuickPaintedItem)
+16 (int (*)(...))QQuickPaintedItem::metaObject
+24 (int (*)(...))QQuickPaintedItem::qt_metacast
+32 (int (*)(...))QQuickPaintedItem::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QQuickItem::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QQuickItem::boundingRect
+120 (int (*)(...))QQuickItem::clipRect
+128 (int (*)(...))QQuickItem::contains
+136 (int (*)(...))QQuickItem::inputMethodQuery
+144 (int (*)(...))QQuickPaintedItem::isTextureProvider
+152 (int (*)(...))QQuickPaintedItem::textureProvider
+160 (int (*)(...))QQuickPaintedItem::itemChange
+168 (int (*)(...))QQuickItem::classBegin
+176 (int (*)(...))QQuickItem::componentComplete
+184 (int (*)(...))QQuickItem::keyPressEvent
+192 (int (*)(...))QQuickItem::keyReleaseEvent
+200 (int (*)(...))QQuickItem::inputMethodEvent
+208 (int (*)(...))QQuickItem::focusInEvent
+216 (int (*)(...))QQuickItem::focusOutEvent
+224 (int (*)(...))QQuickItem::mousePressEvent
+232 (int (*)(...))QQuickItem::mouseMoveEvent
+240 (int (*)(...))QQuickItem::mouseReleaseEvent
+248 (int (*)(...))QQuickItem::mouseDoubleClickEvent
+256 (int (*)(...))QQuickItem::mouseUngrabEvent
+264 (int (*)(...))QQuickItem::touchUngrabEvent
+272 (int (*)(...))QQuickItem::wheelEvent
+280 (int (*)(...))QQuickItem::touchEvent
+288 (int (*)(...))QQuickItem::hoverEnterEvent
+296 (int (*)(...))QQuickItem::hoverMoveEvent
+304 (int (*)(...))QQuickItem::hoverLeaveEvent
+312 (int (*)(...))QQuickItem::dragEnterEvent
+320 (int (*)(...))QQuickItem::dragMoveEvent
+328 (int (*)(...))QQuickItem::dragLeaveEvent
+336 (int (*)(...))QQuickItem::dropEvent
+344 (int (*)(...))QQuickItem::childMouseEventFilter
+352 (int (*)(...))QQuickItem::windowDeactivateEvent
+360 (int (*)(...))QQuickItem::geometryChanged
+368 (int (*)(...))QQuickPaintedItem::updatePaintNode
+376 (int (*)(...))QQuickPaintedItem::releaseResources
+384 (int (*)(...))QQuickItem::updatePolish
+392 (int (*)(...))__cxa_pure_virtual
+400 (int (*)(...))-16
+408 (int (*)(...))(& _ZTI17QQuickPaintedItem)
+416 0
+424 0
+432 (int (*)(...))QQuickItem::_ZThn16_N10QQuickItem10classBeginEv
+440 (int (*)(...))QQuickItem::_ZThn16_N10QQuickItem17componentCompleteEv
+
+Class QQuickPaintedItem
+ size=32 align=8
+ base size=32 base align=8
+QQuickPaintedItem (0x0x7f52722d9a28) 0
+ vptr=((& QQuickPaintedItem::_ZTV17QQuickPaintedItem) + 16)
+ QQuickItem (0x0x7f5271f58850) 0
+ primary-for QQuickPaintedItem (0x0x7f52722d9a28)
+ QObject (0x0x7f5271f5bba0) 0
+ primary-for QQuickItem (0x0x7f5271f58850)
+ QQmlParserStatus (0x0x7f5271f5bc00) 16
+ vptr=((& QQuickPaintedItem::_ZTV17QQuickPaintedItem) + 416)
+
+Class QQuickRenderControl::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQuickRenderControl::QPrivateSignal (0x0x7f5271fa0720) 0 empty
+
+Vtable for QQuickRenderControl
+QQuickRenderControl::_ZTV19QQuickRenderControl: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QQuickRenderControl)
+16 (int (*)(...))QQuickRenderControl::metaObject
+24 (int (*)(...))QQuickRenderControl::qt_metacast
+32 (int (*)(...))QQuickRenderControl::qt_metacall
+40 (int (*)(...))QQuickRenderControl::~QQuickRenderControl
+48 (int (*)(...))QQuickRenderControl::~QQuickRenderControl
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QQuickRenderControl::renderWindow
+
+Class QQuickRenderControl
+ size=16 align=8
+ base size=16 base align=8
+QQuickRenderControl (0x0x7f52722d9bc8) 0
+ vptr=((& QQuickRenderControl::_ZTV19QQuickRenderControl) + 16)
+ QObject (0x0x7f5271fa06c0) 0
+ primary-for QQuickRenderControl (0x0x7f52722d9bc8)
+
+Class QQuickTextDocument::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQuickTextDocument::QPrivateSignal (0x0x7f5271fa09c0) 0 empty
+
+Vtable for QQuickTextDocument
+QQuickTextDocument::_ZTV18QQuickTextDocument: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QQuickTextDocument)
+16 (int (*)(...))QQuickTextDocument::metaObject
+24 (int (*)(...))QQuickTextDocument::qt_metacast
+32 (int (*)(...))QQuickTextDocument::qt_metacall
+40 (int (*)(...))QQuickTextDocument::~QQuickTextDocument
+48 (int (*)(...))QQuickTextDocument::~QQuickTextDocument
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QQuickTextDocument
+ size=16 align=8
+ base size=16 base align=8
+QQuickTextDocument (0x0x7f52722d9c30) 0
+ vptr=((& QQuickTextDocument::_ZTV18QQuickTextDocument) + 16)
+ QObject (0x0x7f5271fa0960) 0
+ primary-for QQuickTextDocument (0x0x7f52722d9c30)
+
+Class QSGGeometry::Attribute
+ size=16 align=4
+ base size=16 base align=4
+QSGGeometry::Attribute (0x0x7f5271fc6060) 0
+
+Class QSGGeometry::AttributeSet
+ size=16 align=8
+ base size=16 base align=8
+QSGGeometry::AttributeSet (0x0x7f5271fc60c0) 0
+
+Class QSGGeometry::Point2D
+ size=8 align=4
+ base size=8 base align=4
+QSGGeometry::Point2D (0x0x7f5271fc6120) 0
+
+Class QSGGeometry::TexturedPoint2D
+ size=16 align=4
+ base size=16 base align=4
+QSGGeometry::TexturedPoint2D (0x0x7f5271fc6180) 0
+
+Class QSGGeometry::ColoredPoint2D
+ size=12 align=4
+ base size=12 base align=4
+QSGGeometry::ColoredPoint2D (0x0x7f5271fc61e0) 0
+
+Vtable for QSGGeometry
+QSGGeometry::_ZTV11QSGGeometry: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QSGGeometry)
+16 (int (*)(...))QSGGeometry::~QSGGeometry
+24 (int (*)(...))QSGGeometry::~QSGGeometry
+
+Class QSGGeometry
+ size=128 align=8
+ base size=128 base align=8
+QSGGeometry (0x0x7f5271fc6000) 0
+ vptr=((& QSGGeometry::_ZTV11QSGGeometry) + 16)
+
+Vtable for QSGNode
+QSGNode::_ZTV7QSGNode: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI7QSGNode)
+16 (int (*)(...))QSGNode::~QSGNode
+24 (int (*)(...))QSGNode::~QSGNode
+32 (int (*)(...))QSGNode::isSubtreeBlocked
+40 (int (*)(...))QSGNode::preprocess
+
+Class QSGNode
+ size=80 align=8
+ base size=80 base align=8
+QSGNode (0x0x7f5271fe51e0) 0
+ vptr=((& QSGNode::_ZTV7QSGNode) + 16)
+
+Vtable for QSGBasicGeometryNode
+QSGBasicGeometryNode::_ZTV20QSGBasicGeometryNode: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QSGBasicGeometryNode)
+16 (int (*)(...))QSGBasicGeometryNode::~QSGBasicGeometryNode
+24 (int (*)(...))QSGBasicGeometryNode::~QSGBasicGeometryNode
+32 (int (*)(...))QSGNode::isSubtreeBlocked
+40 (int (*)(...))QSGNode::preprocess
+
+Class QSGBasicGeometryNode
+ size=112 align=8
+ base size=112 base align=8
+QSGBasicGeometryNode (0x0x7f5271fe0340) 0
+ vptr=((& QSGBasicGeometryNode::_ZTV20QSGBasicGeometryNode) + 16)
+ QSGNode (0x0x7f5271fe5960) 0
+ primary-for QSGBasicGeometryNode (0x0x7f5271fe0340)
+
+Vtable for QSGGeometryNode
+QSGGeometryNode::_ZTV15QSGGeometryNode: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QSGGeometryNode)
+16 (int (*)(...))QSGGeometryNode::~QSGGeometryNode
+24 (int (*)(...))QSGGeometryNode::~QSGGeometryNode
+32 (int (*)(...))QSGNode::isSubtreeBlocked
+40 (int (*)(...))QSGNode::preprocess
+
+Class QSGGeometryNode
+ size=144 align=8
+ base size=144 base align=8
+QSGGeometryNode (0x0x7f5271fe03a8) 0
+ vptr=((& QSGGeometryNode::_ZTV15QSGGeometryNode) + 16)
+ QSGBasicGeometryNode (0x0x7f5271fe0410) 0
+ primary-for QSGGeometryNode (0x0x7f5271fe03a8)
+ QSGNode (0x0x7f5271fe5c00) 0
+ primary-for QSGBasicGeometryNode (0x0x7f5271fe0410)
+
+Vtable for QSGClipNode
+QSGClipNode::_ZTV11QSGClipNode: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QSGClipNode)
+16 (int (*)(...))QSGClipNode::~QSGClipNode
+24 (int (*)(...))QSGClipNode::~QSGClipNode
+32 (int (*)(...))QSGNode::isSubtreeBlocked
+40 (int (*)(...))QSGNode::preprocess
+
+Class QSGClipNode
+ size=152 align=8
+ base size=152 base align=8
+QSGClipNode (0x0x7f5271fe0478) 0
+ vptr=((& QSGClipNode::_ZTV11QSGClipNode) + 16)
+ QSGBasicGeometryNode (0x0x7f5271fe04e0) 0
+ primary-for QSGClipNode (0x0x7f5271fe0478)
+ QSGNode (0x0x7f5271fe5de0) 0
+ primary-for QSGBasicGeometryNode (0x0x7f5271fe04e0)
+
+Vtable for QSGTransformNode
+QSGTransformNode::_ZTV16QSGTransformNode: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QSGTransformNode)
+16 (int (*)(...))QSGTransformNode::~QSGTransformNode
+24 (int (*)(...))QSGTransformNode::~QSGTransformNode
+32 (int (*)(...))QSGNode::isSubtreeBlocked
+40 (int (*)(...))QSGNode::preprocess
+
+Class QSGTransformNode
+ size=216 align=8
+ base size=216 base align=8
+QSGTransformNode (0x0x7f5271fe0548) 0
+ vptr=((& QSGTransformNode::_ZTV16QSGTransformNode) + 16)
+ QSGNode (0x0x7f5271fe5f00) 0
+ primary-for QSGTransformNode (0x0x7f5271fe0548)
+
+Vtable for QSGRootNode
+QSGRootNode::_ZTV11QSGRootNode: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QSGRootNode)
+16 (int (*)(...))QSGRootNode::~QSGRootNode
+24 (int (*)(...))QSGRootNode::~QSGRootNode
+32 (int (*)(...))QSGNode::isSubtreeBlocked
+40 (int (*)(...))QSGNode::preprocess
+
+Class QSGRootNode
+ size=88 align=8
+ base size=88 base align=8
+QSGRootNode (0x0x7f5271fe05b0) 0
+ vptr=((& QSGRootNode::_ZTV11QSGRootNode) + 16)
+ QSGNode (0x0x7f527202c060) 0
+ primary-for QSGRootNode (0x0x7f5271fe05b0)
+
+Vtable for QSGOpacityNode
+QSGOpacityNode::_ZTV14QSGOpacityNode: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QSGOpacityNode)
+16 (int (*)(...))QSGOpacityNode::~QSGOpacityNode
+24 (int (*)(...))QSGOpacityNode::~QSGOpacityNode
+32 (int (*)(...))QSGOpacityNode::isSubtreeBlocked
+40 (int (*)(...))QSGNode::preprocess
+
+Class QSGOpacityNode
+ size=96 align=8
+ base size=96 base align=8
+QSGOpacityNode (0x0x7f5271fe0680) 0
+ vptr=((& QSGOpacityNode::_ZTV14QSGOpacityNode) + 16)
+ QSGNode (0x0x7f527202c1e0) 0
+ primary-for QSGOpacityNode (0x0x7f5271fe0680)
+
+Vtable for QSGNodeVisitor
+QSGNodeVisitor::_ZTV14QSGNodeVisitor: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QSGNodeVisitor)
+16 (int (*)(...))QSGNodeVisitor::~QSGNodeVisitor
+24 (int (*)(...))QSGNodeVisitor::~QSGNodeVisitor
+32 (int (*)(...))QSGNodeVisitor::enterTransformNode
+40 (int (*)(...))QSGNodeVisitor::leaveTransformNode
+48 (int (*)(...))QSGNodeVisitor::enterClipNode
+56 (int (*)(...))QSGNodeVisitor::leaveClipNode
+64 (int (*)(...))QSGNodeVisitor::enterGeometryNode
+72 (int (*)(...))QSGNodeVisitor::leaveGeometryNode
+80 (int (*)(...))QSGNodeVisitor::enterOpacityNode
+88 (int (*)(...))QSGNodeVisitor::leaveOpacityNode
+96 (int (*)(...))QSGNodeVisitor::visitNode
+104 (int (*)(...))QSGNodeVisitor::visitChildren
+
+Class QSGNodeVisitor
+ size=8 align=8
+ base size=8 base align=8
+QSGNodeVisitor (0x0x7f527202c300) 0 nearly-empty
+ vptr=((& QSGNodeVisitor::_ZTV14QSGNodeVisitor) + 16)
+
+Vtable for QSGRendererInterface
+QSGRendererInterface::_ZTV20QSGRendererInterface: 10 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QSGRendererInterface)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))QSGRendererInterface::getResource
+48 (int (*)(...))QSGRendererInterface::getResource
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))__cxa_pure_virtual
+72 (int (*)(...))__cxa_pure_virtual
+
+Class QSGRendererInterface
+ size=8 align=8
+ base size=8 base align=8
+QSGRendererInterface (0x0x7f5272062120) 0 nearly-empty
+ vptr=((& QSGRendererInterface::_ZTV20QSGRendererInterface) + 16)
+
+Class QQuickWindow::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQuickWindow::QPrivateSignal (0x0x7f5272093000) 0 empty
+
+Class QQuickWindow::GraphicsStateInfo
+ size=8 align=4
+ base size=8 base align=4
+QQuickWindow::GraphicsStateInfo (0x0x7f5272093060) 0
+
+Vtable for QQuickWindow
+QQuickWindow::_ZTV12QQuickWindow: 45 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QQuickWindow)
+16 (int (*)(...))QQuickWindow::metaObject
+24 (int (*)(...))QQuickWindow::qt_metacast
+32 (int (*)(...))QQuickWindow::qt_metacall
+40 (int (*)(...))QQuickWindow::~QQuickWindow
+48 (int (*)(...))QQuickWindow::~QQuickWindow
+56 (int (*)(...))QQuickWindow::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWindow::surfaceType
+120 (int (*)(...))QWindow::format
+128 (int (*)(...))QWindow::size
+136 (int (*)(...))QQuickWindow::accessibleRoot
+144 (int (*)(...))QQuickWindow::focusObject
+152 (int (*)(...))QQuickWindow::exposeEvent
+160 (int (*)(...))QQuickWindow::resizeEvent
+168 (int (*)(...))QWindow::moveEvent
+176 (int (*)(...))QQuickWindow::focusInEvent
+184 (int (*)(...))QQuickWindow::focusOutEvent
+192 (int (*)(...))QQuickWindow::showEvent
+200 (int (*)(...))QQuickWindow::hideEvent
+208 (int (*)(...))QQuickWindow::keyPressEvent
+216 (int (*)(...))QQuickWindow::keyReleaseEvent
+224 (int (*)(...))QQuickWindow::mousePressEvent
+232 (int (*)(...))QQuickWindow::mouseReleaseEvent
+240 (int (*)(...))QQuickWindow::mouseDoubleClickEvent
+248 (int (*)(...))QQuickWindow::mouseMoveEvent
+256 (int (*)(...))QQuickWindow::wheelEvent
+264 (int (*)(...))QWindow::touchEvent
+272 (int (*)(...))QQuickWindow::tabletEvent
+280 (int (*)(...))QWindow::nativeEvent
+288 (int (*)(...))QWindow::surfaceHandle
+296 (int (*)(...))-16
+304 (int (*)(...))(& _ZTI12QQuickWindow)
+312 (int (*)(...))QQuickWindow::_ZThn16_N12QQuickWindowD1Ev
+320 (int (*)(...))QQuickWindow::_ZThn16_N12QQuickWindowD0Ev
+328 (int (*)(...))QWindow::_ZThn16_NK7QWindow6formatEv
+336 (int (*)(...))QWindow::_ZThn16_NK7QWindow13surfaceHandleEv
+344 (int (*)(...))QWindow::_ZThn16_NK7QWindow11surfaceTypeEv
+352 (int (*)(...))QWindow::_ZThn16_NK7QWindow4sizeEv
+
+Class QQuickWindow
+ size=40 align=8
+ base size=40 base align=8
+QQuickWindow (0x0x7f5271fe0888) 0
+ vptr=((& QQuickWindow::_ZTV12QQuickWindow) + 16)
+ QWindow (0x0x7f5272075c40) 0
+ primary-for QQuickWindow (0x0x7f5271fe0888)
+ QObject (0x0x7f5272062f00) 0
+ primary-for QWindow (0x0x7f5272075c40)
+ QSurface (0x0x7f5272062f60) 16
+ vptr=((& QQuickWindow::_ZTV12QQuickWindow) + 312)
+
+Class QQuickView::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQuickView::QPrivateSignal (0x0x7f5272093b40) 0 empty
+
+Vtable for QQuickView
+QQuickView::_ZTV10QQuickView: 45 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QQuickView)
+16 (int (*)(...))QQuickView::metaObject
+24 (int (*)(...))QQuickView::qt_metacast
+32 (int (*)(...))QQuickView::qt_metacall
+40 (int (*)(...))QQuickView::~QQuickView
+48 (int (*)(...))QQuickView::~QQuickView
+56 (int (*)(...))QQuickWindow::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QQuickView::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWindow::surfaceType
+120 (int (*)(...))QWindow::format
+128 (int (*)(...))QWindow::size
+136 (int (*)(...))QQuickWindow::accessibleRoot
+144 (int (*)(...))QQuickWindow::focusObject
+152 (int (*)(...))QQuickWindow::exposeEvent
+160 (int (*)(...))QQuickView::resizeEvent
+168 (int (*)(...))QWindow::moveEvent
+176 (int (*)(...))QQuickWindow::focusInEvent
+184 (int (*)(...))QQuickWindow::focusOutEvent
+192 (int (*)(...))QQuickWindow::showEvent
+200 (int (*)(...))QQuickWindow::hideEvent
+208 (int (*)(...))QQuickView::keyPressEvent
+216 (int (*)(...))QQuickView::keyReleaseEvent
+224 (int (*)(...))QQuickView::mousePressEvent
+232 (int (*)(...))QQuickView::mouseReleaseEvent
+240 (int (*)(...))QQuickWindow::mouseDoubleClickEvent
+248 (int (*)(...))QQuickView::mouseMoveEvent
+256 (int (*)(...))QQuickWindow::wheelEvent
+264 (int (*)(...))QWindow::touchEvent
+272 (int (*)(...))QQuickWindow::tabletEvent
+280 (int (*)(...))QWindow::nativeEvent
+288 (int (*)(...))QWindow::surfaceHandle
+296 (int (*)(...))-16
+304 (int (*)(...))(& _ZTI10QQuickView)
+312 (int (*)(...))QQuickView::_ZThn16_N10QQuickViewD1Ev
+320 (int (*)(...))QQuickView::_ZThn16_N10QQuickViewD0Ev
+328 (int (*)(...))QWindow::_ZThn16_NK7QWindow6formatEv
+336 (int (*)(...))QWindow::_ZThn16_NK7QWindow13surfaceHandleEv
+344 (int (*)(...))QWindow::_ZThn16_NK7QWindow11surfaceTypeEv
+352 (int (*)(...))QWindow::_ZThn16_NK7QWindow4sizeEv
+
+Class QQuickView
+ size=40 align=8
+ base size=40 base align=8
+QQuickView (0x0x7f5271fe09c0) 0
+ vptr=((& QQuickView::_ZTV10QQuickView) + 16)
+ QQuickWindow (0x0x7f5271fe0a28) 0
+ primary-for QQuickView (0x0x7f5271fe09c0)
+ QWindow (0x0x7f5272096cb0) 0
+ primary-for QQuickWindow (0x0x7f5271fe0a28)
+ QObject (0x0x7f5272093a80) 0
+ primary-for QWindow (0x0x7f5272096cb0)
+ QSurface (0x0x7f5272093ae0) 16
+ vptr=((& QQuickView::_ZTV10QQuickView) + 312)
+
+Class QSGAbstractRenderer::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSGAbstractRenderer::QPrivateSignal (0x0x7f5272093f00) 0 empty
+
+Vtable for QSGAbstractRenderer
+QSGAbstractRenderer::_ZTV19QSGAbstractRenderer: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QSGAbstractRenderer)
+16 (int (*)(...))QSGAbstractRenderer::metaObject
+24 (int (*)(...))QSGAbstractRenderer::qt_metacast
+32 (int (*)(...))QSGAbstractRenderer::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+
+Class QSGAbstractRenderer
+ size=16 align=8
+ base size=16 base align=8
+QSGAbstractRenderer (0x0x7f5271fe0a90) 0
+ vptr=((& QSGAbstractRenderer::_ZTV19QSGAbstractRenderer) + 16)
+ QObject (0x0x7f5272093ea0) 0
+ primary-for QSGAbstractRenderer (0x0x7f5271fe0a90)
+
+Class QSGEngine::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSGEngine::QPrivateSignal (0x0x7f52720e4c00) 0 empty
+
+Vtable for QSGEngine
+QSGEngine::_ZTV9QSGEngine: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QSGEngine)
+16 (int (*)(...))QSGEngine::metaObject
+24 (int (*)(...))QSGEngine::qt_metacast
+32 (int (*)(...))QSGEngine::qt_metacall
+40 (int (*)(...))QSGEngine::~QSGEngine
+48 (int (*)(...))QSGEngine::~QSGEngine
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QSGEngine
+ size=16 align=8
+ base size=16 base align=8
+QSGEngine (0x0x7f5271fe0c98) 0
+ vptr=((& QSGEngine::_ZTV9QSGEngine) + 16)
+ QObject (0x0x7f52720e4ba0) 0
+ primary-for QSGEngine (0x0x7f5271fe0c98)
+
+Class QSGMaterialType
+ size=1 align=1
+ base size=0 base align=1
+QSGMaterialType (0x0x7f527211d2a0) 0 empty
+
+Class QSGMaterialShader::RenderState
+ size=16 align=8
+ base size=16 base align=8
+QSGMaterialShader::RenderState (0x0x7f527211d360) 0
+
+Vtable for QSGMaterialShader
+QSGMaterialShader::_ZTV17QSGMaterialShader: 12 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QSGMaterialShader)
+16 0
+24 0
+32 (int (*)(...))QSGMaterialShader::activate
+40 (int (*)(...))QSGMaterialShader::deactivate
+48 (int (*)(...))QSGMaterialShader::updateState
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))QSGMaterialShader::compile
+72 (int (*)(...))QSGMaterialShader::initialize
+80 (int (*)(...))QSGMaterialShader::vertexShader
+88 (int (*)(...))QSGMaterialShader::fragmentShader
+
+Class QSGMaterialShader
+ size=32 align=8
+ base size=32 base align=8
+QSGMaterialShader (0x0x7f527211d300) 0
+ vptr=((& QSGMaterialShader::_ZTV17QSGMaterialShader) + 16)
+
+Class QSGMaterialRhiShader::RenderState
+ size=16 align=8
+ base size=16 base align=8
+QSGMaterialRhiShader::RenderState (0x0x7f527211dea0) 0
+
+Class QSGMaterialRhiShader::GraphicsPipelineState
+ size=36 align=4
+ base size=36 base align=4
+QSGMaterialRhiShader::GraphicsPipelineState (0x0x7f527211df00) 0
+
+Vtable for QSGMaterialRhiShader
+QSGMaterialRhiShader::_ZTV20QSGMaterialRhiShader: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QSGMaterialRhiShader)
+16 (int (*)(...))QSGMaterialRhiShader::~QSGMaterialRhiShader
+24 (int (*)(...))QSGMaterialRhiShader::~QSGMaterialRhiShader
+32 (int (*)(...))QSGMaterialShader::activate
+40 (int (*)(...))QSGMaterialShader::deactivate
+48 (int (*)(...))QSGMaterialShader::updateState
+56 (int (*)(...))QSGMaterialRhiShader::attributeNames
+64 (int (*)(...))QSGMaterialShader::compile
+72 (int (*)(...))QSGMaterialShader::initialize
+80 (int (*)(...))QSGMaterialShader::vertexShader
+88 (int (*)(...))QSGMaterialShader::fragmentShader
+96 (int (*)(...))QSGMaterialRhiShader::updateUniformData
+104 (int (*)(...))QSGMaterialRhiShader::updateSampledImage
+112 (int (*)(...))QSGMaterialRhiShader::updateGraphicsPipelineState
+
+Class QSGMaterialRhiShader
+ size=40 align=8
+ base size=40 base align=8
+QSGMaterialRhiShader (0x0x7f5271fe0f08) 0
+ vptr=((& QSGMaterialRhiShader::_ZTV20QSGMaterialRhiShader) + 16)
+ QSGMaterialShader (0x0x7f527211de40) 0
+ primary-for QSGMaterialRhiShader (0x0x7f5271fe0f08)
+
+Vtable for QSGMaterial
+QSGMaterial::_ZTV11QSGMaterial: 7 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QSGMaterial)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))QSGMaterial::compare
+
+Class QSGMaterial
+ size=24 align=8
+ base size=24 base align=8
+QSGMaterial (0x0x7f5271d83000) 0
+ vptr=((& QSGMaterial::_ZTV11QSGMaterial) + 16)
+
+Vtable for QSGFlatColorMaterial
+QSGFlatColorMaterial::_ZTV20QSGFlatColorMaterial: 7 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QSGFlatColorMaterial)
+16 (int (*)(...))QSGFlatColorMaterial::~QSGFlatColorMaterial
+24 (int (*)(...))QSGFlatColorMaterial::~QSGFlatColorMaterial
+32 (int (*)(...))QSGFlatColorMaterial::type
+40 (int (*)(...))QSGFlatColorMaterial::createShader
+48 (int (*)(...))QSGFlatColorMaterial::compare
+
+Class QSGFlatColorMaterial
+ size=40 align=8
+ base size=40 base align=8
+QSGFlatColorMaterial (0x0x7f5271d4e270) 0
+ vptr=((& QSGFlatColorMaterial::_ZTV20QSGFlatColorMaterial) + 16)
+ QSGMaterial (0x0x7f5271d83780) 0
+ primary-for QSGFlatColorMaterial (0x0x7f5271d4e270)
+
+Class QSGTexture::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSGTexture::QPrivateSignal (0x0x7f5271d838a0) 0 empty
+
+Class QSGTexture::NativeTexture
+ size=16 align=8
+ base size=16 base align=8
+QSGTexture::NativeTexture (0x0x7f5271d83900) 0
+
+Vtable for QSGTexture
+QSGTexture::_ZTV10QSGTexture: 22 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QSGTexture)
+16 (int (*)(...))QSGTexture::metaObject
+24 (int (*)(...))QSGTexture::qt_metacast
+32 (int (*)(...))QSGTexture::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))__cxa_pure_virtual
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))QSGTexture::normalizedTextureSubRect
+152 (int (*)(...))QSGTexture::isAtlasTexture
+160 (int (*)(...))QSGTexture::removedFromAtlas
+168 (int (*)(...))__cxa_pure_virtual
+
+Class QSGTexture
+ size=16 align=8
+ base size=16 base align=8
+QSGTexture (0x0x7f5271d4e2d8) 0
+ vptr=((& QSGTexture::_ZTV10QSGTexture) + 16)
+ QObject (0x0x7f5271d83840) 0
+ primary-for QSGTexture (0x0x7f5271d4e2d8)
+
+Class QSGDynamicTexture::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSGDynamicTexture::QPrivateSignal (0x0x7f5271d83ba0) 0 empty
+
+Vtable for QSGDynamicTexture
+QSGDynamicTexture::_ZTV17QSGDynamicTexture: 23 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QSGDynamicTexture)
+16 (int (*)(...))QSGDynamicTexture::metaObject
+24 (int (*)(...))QSGDynamicTexture::qt_metacast
+32 (int (*)(...))QSGDynamicTexture::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))__cxa_pure_virtual
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))QSGTexture::normalizedTextureSubRect
+152 (int (*)(...))QSGTexture::isAtlasTexture
+160 (int (*)(...))QSGTexture::removedFromAtlas
+168 (int (*)(...))__cxa_pure_virtual
+176 (int (*)(...))__cxa_pure_virtual
+
+Class QSGDynamicTexture
+ size=16 align=8
+ base size=16 base align=8
+QSGDynamicTexture (0x0x7f5271d4e340) 0
+ vptr=((& QSGDynamicTexture::_ZTV17QSGDynamicTexture) + 16)
+ QSGTexture (0x0x7f5271d4e3a8) 0
+ primary-for QSGDynamicTexture (0x0x7f5271d4e340)
+ QObject (0x0x7f5271d83b40) 0
+ primary-for QSGTexture (0x0x7f5271d4e3a8)
+
+Vtable for QSGImageNode
+QSGImageNode::_ZTV12QSGImageNode: 20 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QSGImageNode)
+16 0
+24 0
+32 (int (*)(...))QSGNode::isSubtreeBlocked
+40 (int (*)(...))QSGNode::preprocess
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))__cxa_pure_virtual
+72 (int (*)(...))__cxa_pure_virtual
+80 (int (*)(...))__cxa_pure_virtual
+88 (int (*)(...))__cxa_pure_virtual
+96 (int (*)(...))__cxa_pure_virtual
+104 (int (*)(...))__cxa_pure_virtual
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))__cxa_pure_virtual
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))__cxa_pure_virtual
+
+Class QSGImageNode
+ size=144 align=8
+ base size=144 base align=8
+QSGImageNode (0x0x7f5271d4e410) 0
+ vptr=((& QSGImageNode::_ZTV12QSGImageNode) + 16)
+ QSGGeometryNode (0x0x7f5271d4e478) 0
+ primary-for QSGImageNode (0x0x7f5271d4e410)
+ QSGBasicGeometryNode (0x0x7f5271d4e4e0) 0
+ primary-for QSGGeometryNode (0x0x7f5271d4e478)
+ QSGNode (0x0x7f5271d83cc0) 0
+ primary-for QSGBasicGeometryNode (0x0x7f5271d4e4e0)
+
+Vtable for QSGNinePatchNode
+QSGNinePatchNode::_ZTV16QSGNinePatchNode: 11 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QSGNinePatchNode)
+16 0
+24 0
+32 (int (*)(...))QSGNode::isSubtreeBlocked
+40 (int (*)(...))QSGNode::preprocess
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))__cxa_pure_virtual
+72 (int (*)(...))__cxa_pure_virtual
+80 (int (*)(...))__cxa_pure_virtual
+
+Class QSGNinePatchNode
+ size=144 align=8
+ base size=144 base align=8
+QSGNinePatchNode (0x0x7f5271d4e618) 0
+ vptr=((& QSGNinePatchNode::_ZTV16QSGNinePatchNode) + 16)
+ QSGGeometryNode (0x0x7f5271d4e680) 0
+ primary-for QSGNinePatchNode (0x0x7f5271d4e618)
+ QSGBasicGeometryNode (0x0x7f5271d4e6e8) 0
+ primary-for QSGGeometryNode (0x0x7f5271d4e680)
+ QSGNode (0x0x7f5271dcc4e0) 0
+ primary-for QSGBasicGeometryNode (0x0x7f5271d4e6e8)
+
+Vtable for QSGRectangleNode
+QSGRectangleNode::_ZTV16QSGRectangleNode: 10 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QSGRectangleNode)
+16 0
+24 0
+32 (int (*)(...))QSGNode::isSubtreeBlocked
+40 (int (*)(...))QSGNode::preprocess
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))__cxa_pure_virtual
+72 (int (*)(...))__cxa_pure_virtual
+
+Class QSGRectangleNode
+ size=144 align=8
+ base size=144 base align=8
+QSGRectangleNode (0x0x7f5271d4e750) 0
+ vptr=((& QSGRectangleNode::_ZTV16QSGRectangleNode) + 16)
+ QSGGeometryNode (0x0x7f5271d4e7b8) 0
+ primary-for QSGRectangleNode (0x0x7f5271d4e750)
+ QSGBasicGeometryNode (0x0x7f5271d4e820) 0
+ primary-for QSGGeometryNode (0x0x7f5271d4e7b8)
+ QSGNode (0x0x7f5271dcc540) 0
+ primary-for QSGBasicGeometryNode (0x0x7f5271d4e820)
+
+Vtable for QSGRenderNode::RenderState
+QSGRenderNode::RenderState::_ZTVN13QSGRenderNode11RenderStateE: 11 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTIN13QSGRenderNode11RenderStateE)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))__cxa_pure_virtual
+72 (int (*)(...))__cxa_pure_virtual
+80 (int (*)(...))QSGRenderNode::RenderState::get
+
+Class QSGRenderNode::RenderState
+ size=8 align=8
+ base size=8 base align=8
+QSGRenderNode::RenderState (0x0x7f5271dcc660) 0 nearly-empty
+ vptr=((& QSGRenderNode::RenderState::_ZTVN13QSGRenderNode11RenderStateE) + 16)
+
+Vtable for QSGRenderNode
+QSGRenderNode::_ZTV13QSGRenderNode: 11 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QSGRenderNode)
+16 0
+24 0
+32 (int (*)(...))QSGNode::isSubtreeBlocked
+40 (int (*)(...))QSGNode::preprocess
+48 (int (*)(...))QSGRenderNode::changedStates
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))QSGRenderNode::releaseResources
+72 (int (*)(...))QSGRenderNode::flags
+80 (int (*)(...))QSGRenderNode::rect
+
+Class QSGRenderNode
+ size=88 align=8
+ base size=88 base align=8
+QSGRenderNode (0x0x7f5271d4e888) 0
+ vptr=((& QSGRenderNode::_ZTV13QSGRenderNode) + 16)
+ QSGNode (0x0x7f5271dcc600) 0
+ primary-for QSGRenderNode (0x0x7f5271d4e888)
+
+Vtable for QSGSimpleRectNode
+QSGSimpleRectNode::_ZTV17QSGSimpleRectNode: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QSGSimpleRectNode)
+16 (int (*)(...))QSGSimpleRectNode::~QSGSimpleRectNode
+24 (int (*)(...))QSGSimpleRectNode::~QSGSimpleRectNode
+32 (int (*)(...))QSGNode::isSubtreeBlocked
+40 (int (*)(...))QSGNode::preprocess
+
+Class QSGSimpleRectNode
+ size=320 align=8
+ base size=320 base align=8
+QSGSimpleRectNode (0x0x7f5271d4edd0) 0
+ vptr=((& QSGSimpleRectNode::_ZTV17QSGSimpleRectNode) + 16)
+ QSGGeometryNode (0x0x7f5271d4ee38) 0
+ primary-for QSGSimpleRectNode (0x0x7f5271d4edd0)
+ QSGBasicGeometryNode (0x0x7f5271d4eea0) 0
+ primary-for QSGGeometryNode (0x0x7f5271d4ee38)
+ QSGNode (0x0x7f5271e05d80) 0
+ primary-for QSGBasicGeometryNode (0x0x7f5271d4eea0)
+
+Vtable for QSGOpaqueTextureMaterial
+QSGOpaqueTextureMaterial::_ZTV24QSGOpaqueTextureMaterial: 7 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI24QSGOpaqueTextureMaterial)
+16 (int (*)(...))QSGOpaqueTextureMaterial::~QSGOpaqueTextureMaterial
+24 (int (*)(...))QSGOpaqueTextureMaterial::~QSGOpaqueTextureMaterial
+32 (int (*)(...))QSGOpaqueTextureMaterial::type
+40 (int (*)(...))QSGOpaqueTextureMaterial::createShader
+48 (int (*)(...))QSGOpaqueTextureMaterial::compare
+
+Class QSGOpaqueTextureMaterial
+ size=40 align=8
+ base size=36 base align=8
+QSGOpaqueTextureMaterial (0x0x7f5271d4ef08) 0
+ vptr=((& QSGOpaqueTextureMaterial::_ZTV24QSGOpaqueTextureMaterial) + 16)
+ QSGMaterial (0x0x7f5271e05e40) 0
+ primary-for QSGOpaqueTextureMaterial (0x0x7f5271d4ef08)
+
+Vtable for QSGTextureMaterial
+QSGTextureMaterial::_ZTV18QSGTextureMaterial: 7 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QSGTextureMaterial)
+16 (int (*)(...))QSGTextureMaterial::~QSGTextureMaterial
+24 (int (*)(...))QSGTextureMaterial::~QSGTextureMaterial
+32 (int (*)(...))QSGTextureMaterial::type
+40 (int (*)(...))QSGTextureMaterial::createShader
+48 (int (*)(...))QSGOpaqueTextureMaterial::compare
+
+Class QSGTextureMaterial
+ size=40 align=8
+ base size=36 base align=8
+QSGTextureMaterial (0x0x7f5271d4ef70) 0
+ vptr=((& QSGTextureMaterial::_ZTV18QSGTextureMaterial) + 16)
+ QSGOpaqueTextureMaterial (0x0x7f5271e46000) 0
+ primary-for QSGTextureMaterial (0x0x7f5271d4ef70)
+ QSGMaterial (0x0x7f5271e45300) 0
+ primary-for QSGOpaqueTextureMaterial (0x0x7f5271e46000)
+
+Vtable for QSGSimpleTextureNode
+QSGSimpleTextureNode::_ZTV20QSGSimpleTextureNode: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QSGSimpleTextureNode)
+16 (int (*)(...))QSGSimpleTextureNode::~QSGSimpleTextureNode
+24 (int (*)(...))QSGSimpleTextureNode::~QSGSimpleTextureNode
+32 (int (*)(...))QSGNode::isSubtreeBlocked
+40 (int (*)(...))QSGNode::preprocess
+
+Class QSGSimpleTextureNode
+ size=384 align=8
+ base size=384 base align=8
+QSGSimpleTextureNode (0x0x7f5271e46068) 0
+ vptr=((& QSGSimpleTextureNode::_ZTV20QSGSimpleTextureNode) + 16)
+ QSGGeometryNode (0x0x7f5271e460d0) 0
+ primary-for QSGSimpleTextureNode (0x0x7f5271e46068)
+ QSGBasicGeometryNode (0x0x7f5271e46138) 0
+ primary-for QSGGeometryNode (0x0x7f5271e460d0)
+ QSGNode (0x0x7f5271e45360) 0
+ primary-for QSGBasicGeometryNode (0x0x7f5271e46138)
+
+Class QSGTextureProvider::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSGTextureProvider::QPrivateSignal (0x0x7f5271e45cc0) 0 empty
+
+Vtable for QSGTextureProvider
+QSGTextureProvider::_ZTV18QSGTextureProvider: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QSGTextureProvider)
+16 (int (*)(...))QSGTextureProvider::metaObject
+24 (int (*)(...))QSGTextureProvider::qt_metacast
+32 (int (*)(...))QSGTextureProvider::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+
+Class QSGTextureProvider
+ size=16 align=8
+ base size=16 base align=8
+QSGTextureProvider (0x0x7f5271e462d8) 0
+ vptr=((& QSGTextureProvider::_ZTV18QSGTextureProvider) + 16)
+ QObject (0x0x7f5271e45c60) 0
+ primary-for QSGTextureProvider (0x0x7f5271e462d8)
+
+Vtable for QSGVertexColorMaterial
+QSGVertexColorMaterial::_ZTV22QSGVertexColorMaterial: 7 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI22QSGVertexColorMaterial)
+16 (int (*)(...))QSGVertexColorMaterial::~QSGVertexColorMaterial
+24 (int (*)(...))QSGVertexColorMaterial::~QSGVertexColorMaterial
+32 (int (*)(...))QSGVertexColorMaterial::type
+40 (int (*)(...))QSGVertexColorMaterial::createShader
+48 (int (*)(...))QSGVertexColorMaterial::compare
+
+Class QSGVertexColorMaterial
+ size=24 align=8
+ base size=24 base align=8
+QSGVertexColorMaterial (0x0x7f5271e46340) 0
+ vptr=((& QSGVertexColorMaterial::_ZTV22QSGVertexColorMaterial) + 16)
+ QSGMaterial (0x0x7f5271e45de0) 0
+ primary-for QSGVertexColorMaterial (0x0x7f5271e46340)
+
+Class QGeoAddress
+ size=8 align=8
+ base size=8 base align=8
+QGeoAddress (0x0x7f5271e45e40) 0
+
+Class QGeoCoordinate
+ size=8 align=8
+ base size=8 base align=8
+QGeoCoordinate (0x0x7f5271ea1480) 0
+
+Class QGeoShape
+ size=8 align=8
+ base size=8 base align=8
+QGeoShape (0x0x7f5271ed4a80) 0
+
+Class QGeoAreaMonitorInfo
+ size=8 align=8
+ base size=8 base align=8
+QGeoAreaMonitorInfo (0x0x7f5271f04c60) 0
+
+Class QGeoPositionInfo
+ size=8 align=8
+ base size=8 base align=8
+QGeoPositionInfo (0x0x7f5271f04d20) 0
+
+Class QGeoPositionInfoSource::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QGeoPositionInfoSource::QPrivateSignal (0x0x7f5271b31060) 0 empty
+
+Vtable for QGeoPositionInfoSource
+QGeoPositionInfoSource::_ZTV22QGeoPositionInfoSource: 23 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI22QGeoPositionInfoSource)
+16 (int (*)(...))QGeoPositionInfoSource::metaObject
+24 (int (*)(...))QGeoPositionInfoSource::qt_metacast
+32 (int (*)(...))QGeoPositionInfoSource::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QGeoPositionInfoSource::setUpdateInterval
+120 (int (*)(...))QGeoPositionInfoSource::setPreferredPositioningMethods
+128 (int (*)(...))__cxa_pure_virtual
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))__cxa_pure_virtual
+160 (int (*)(...))__cxa_pure_virtual
+168 (int (*)(...))__cxa_pure_virtual
+176 (int (*)(...))__cxa_pure_virtual
+
+Class QGeoPositionInfoSource
+ size=24 align=8
+ base size=24 base align=8
+QGeoPositionInfoSource (0x0x7f5271f101a0) 0
+ vptr=((& QGeoPositionInfoSource::_ZTV22QGeoPositionInfoSource) + 16)
+ QObject (0x0x7f5271b31000) 0
+ primary-for QGeoPositionInfoSource (0x0x7f5271f101a0)
+
+Class QGeoAreaMonitorSource::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QGeoAreaMonitorSource::QPrivateSignal (0x0x7f5271b318a0) 0 empty
+
+Vtable for QGeoAreaMonitorSource
+QGeoAreaMonitorSource::_ZTV21QGeoAreaMonitorSource: 23 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI21QGeoAreaMonitorSource)
+16 (int (*)(...))QGeoAreaMonitorSource::metaObject
+24 (int (*)(...))QGeoAreaMonitorSource::qt_metacast
+32 (int (*)(...))QGeoAreaMonitorSource::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QGeoAreaMonitorSource::setPositionInfoSource
+120 (int (*)(...))QGeoAreaMonitorSource::positionInfoSource
+128 (int (*)(...))__cxa_pure_virtual
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))__cxa_pure_virtual
+160 (int (*)(...))__cxa_pure_virtual
+168 (int (*)(...))__cxa_pure_virtual
+176 (int (*)(...))__cxa_pure_virtual
+
+Class QGeoAreaMonitorSource
+ size=24 align=8
+ base size=24 base align=8
+QGeoAreaMonitorSource (0x0x7f5271f102d8) 0
+ vptr=((& QGeoAreaMonitorSource::_ZTV21QGeoAreaMonitorSource) + 16)
+ QObject (0x0x7f5271b31840) 0
+ primary-for QGeoAreaMonitorSource (0x0x7f5271f102d8)
+
+Class QGeoRectangle
+ size=8 align=8
+ base size=8 base align=8
+QGeoRectangle (0x0x7f5271f10340) 0
+ QGeoShape (0x0x7f5271b319c0) 0
+
+Class QGeoCircle
+ size=8 align=8
+ base size=8 base align=8
+QGeoCircle (0x0x7f5271b876e8) 0
+ QGeoShape (0x0x7f5271b82e40) 0
+
+Class QGeoLocation
+ size=8 align=8
+ base size=8 base align=8
+QGeoLocation (0x0x7f5271bdc060) 0
+
+Class QGeoPath
+ size=8 align=8
+ base size=8 base align=8
+QGeoPath (0x0x7f5271c111a0) 0
+ QGeoShape (0x0x7f5271c0e6c0) 0
+
+Class QGeoPolygon
+ size=8 align=8
+ base size=8 base align=8
+QGeoPolygon (0x0x7f5271c42340) 0
+ QGeoShape (0x0x7f5271c3f8a0) 0
+
+Class QGeoSatelliteInfo
+ size=8 align=8
+ base size=8 base align=8
+QGeoSatelliteInfo (0x0x7f5271c6da80) 0
+
+Class QGeoSatelliteInfoSource::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QGeoSatelliteInfoSource::QPrivateSignal (0x0x7f5271c6dba0) 0 empty
+
+Vtable for QGeoSatelliteInfoSource
+QGeoSatelliteInfoSource::_ZTV23QGeoSatelliteInfoSource: 20 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI23QGeoSatelliteInfoSource)
+16 (int (*)(...))QGeoSatelliteInfoSource::metaObject
+24 (int (*)(...))QGeoSatelliteInfoSource::qt_metacast
+32 (int (*)(...))QGeoSatelliteInfoSource::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QGeoSatelliteInfoSource::setUpdateInterval
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))__cxa_pure_virtual
+136 (int (*)(...))__cxa_pure_virtual
+144 (int (*)(...))__cxa_pure_virtual
+152 (int (*)(...))__cxa_pure_virtual
+
+Class QGeoSatelliteInfoSource
+ size=24 align=8
+ base size=24 base align=8
+QGeoSatelliteInfoSource (0x0x7f5271c70680) 0
+ vptr=((& QGeoSatelliteInfoSource::_ZTV23QGeoSatelliteInfoSource) + 16)
+ QObject (0x0x7f5271c6db40) 0
+ primary-for QGeoSatelliteInfoSource (0x0x7f5271c70680)
+
+Vtable for QGeoPositionInfoSourceFactory
+QGeoPositionInfoSourceFactory::_ZTV29QGeoPositionInfoSourceFactory: 7 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI29QGeoPositionInfoSourceFactory)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+
+Class QGeoPositionInfoSourceFactory
+ size=8 align=8
+ base size=8 base align=8
+QGeoPositionInfoSourceFactory (0x0x7f5271c6dd20) 0 nearly-empty
+ vptr=((& QGeoPositionInfoSourceFactory::_ZTV29QGeoPositionInfoSourceFactory) + 16)
+
+Vtable for QGeoPositionInfoSourceFactoryV2
+QGeoPositionInfoSourceFactoryV2::_ZTV31QGeoPositionInfoSourceFactoryV2: 10 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI31QGeoPositionInfoSourceFactoryV2)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))__cxa_pure_virtual
+72 (int (*)(...))__cxa_pure_virtual
+
+Class QGeoPositionInfoSourceFactoryV2
+ size=8 align=8
+ base size=8 base align=8
+QGeoPositionInfoSourceFactoryV2 (0x0x7f5271c706e8) 0 nearly-empty
+ vptr=((& QGeoPositionInfoSourceFactoryV2::_ZTV31QGeoPositionInfoSourceFactoryV2) + 16)
+ QGeoPositionInfoSourceFactory (0x0x7f5271c6df00) 0 nearly-empty
+ primary-for QGeoPositionInfoSourceFactoryV2 (0x0x7f5271c706e8)
+
+Class QNmeaPositionInfoSource::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QNmeaPositionInfoSource::QPrivateSignal (0x0x7f5271c96180) 0 empty
+
+Vtable for QNmeaPositionInfoSource
+QNmeaPositionInfoSource::_ZTV23QNmeaPositionInfoSource: 24 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI23QNmeaPositionInfoSource)
+16 (int (*)(...))QNmeaPositionInfoSource::metaObject
+24 (int (*)(...))QNmeaPositionInfoSource::qt_metacast
+32 (int (*)(...))QNmeaPositionInfoSource::qt_metacall
+40 (int (*)(...))QNmeaPositionInfoSource::~QNmeaPositionInfoSource
+48 (int (*)(...))QNmeaPositionInfoSource::~QNmeaPositionInfoSource
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QNmeaPositionInfoSource::setUpdateInterval
+120 (int (*)(...))QGeoPositionInfoSource::setPreferredPositioningMethods
+128 (int (*)(...))QNmeaPositionInfoSource::lastKnownPosition
+136 (int (*)(...))QNmeaPositionInfoSource::supportedPositioningMethods
+144 (int (*)(...))QNmeaPositionInfoSource::minimumUpdateInterval
+152 (int (*)(...))QNmeaPositionInfoSource::error
+160 (int (*)(...))QNmeaPositionInfoSource::startUpdates
+168 (int (*)(...))QNmeaPositionInfoSource::stopUpdates
+176 (int (*)(...))QNmeaPositionInfoSource::requestUpdate
+184 (int (*)(...))QNmeaPositionInfoSource::parsePosInfoFromNmeaData
+
+Class QNmeaPositionInfoSource
+ size=32 align=8
+ base size=32 base align=8
+QNmeaPositionInfoSource (0x0x7f5271c70750) 0
+ vptr=((& QNmeaPositionInfoSource::_ZTV23QNmeaPositionInfoSource) + 16)
+ QGeoPositionInfoSource (0x0x7f5271c707b8) 0
+ primary-for QNmeaPositionInfoSource (0x0x7f5271c70750)
+ QObject (0x0x7f5271c96120) 0
+ primary-for QGeoPositionInfoSource (0x0x7f5271c707b8)
+
+Class QWebChannel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QWebChannel::QPrivateSignal (0x0x7f5271c96300) 0 empty
+
+Vtable for QWebChannel
+QWebChannel::_ZTV11QWebChannel: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QWebChannel)
+16 (int (*)(...))QWebChannel::metaObject
+24 (int (*)(...))QWebChannel::qt_metacast
+32 (int (*)(...))QWebChannel::qt_metacall
+40 (int (*)(...))QWebChannel::~QWebChannel
+48 (int (*)(...))QWebChannel::~QWebChannel
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QWebChannel
+ size=16 align=8
+ base size=16 base align=8
+QWebChannel (0x0x7f5271c70820) 0
+ vptr=((& QWebChannel::_ZTV11QWebChannel) + 16)
+ QObject (0x0x7f5271c962a0) 0
+ primary-for QWebChannel (0x0x7f5271c70820)
+
+Class QQmlWebChannel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QQmlWebChannel::QPrivateSignal (0x0x7f5271c96540) 0 empty
+
+Vtable for QQmlWebChannel
+QQmlWebChannel::_ZTV14QQmlWebChannel: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QQmlWebChannel)
+16 (int (*)(...))QQmlWebChannel::metaObject
+24 (int (*)(...))QQmlWebChannel::qt_metacast
+32 (int (*)(...))QQmlWebChannel::qt_metacall
+40 (int (*)(...))QQmlWebChannel::~QQmlWebChannel
+48 (int (*)(...))QQmlWebChannel::~QQmlWebChannel
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QQmlWebChannel
+ size=16 align=8
+ base size=16 base align=8
+QQmlWebChannel (0x0x7f5271c70888) 0
+ vptr=((& QQmlWebChannel::_ZTV14QQmlWebChannel) + 16)
+ QWebChannel (0x0x7f5271c708f0) 0
+ primary-for QQmlWebChannel (0x0x7f5271c70888)
+ QObject (0x0x7f5271c964e0) 0
+ primary-for QWebChannel (0x0x7f5271c708f0)
+
+Class QWebChannelAbstractTransport::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QWebChannelAbstractTransport::QPrivateSignal (0x0x7f5271cc80c0) 0 empty
+
+Vtable for QWebChannelAbstractTransport
+QWebChannelAbstractTransport::_ZTV28QWebChannelAbstractTransport: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI28QWebChannelAbstractTransport)
+16 (int (*)(...))QWebChannelAbstractTransport::metaObject
+24 (int (*)(...))QWebChannelAbstractTransport::qt_metacast
+32 (int (*)(...))QWebChannelAbstractTransport::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+
+Class QWebChannelAbstractTransport
+ size=16 align=8
+ base size=16 base align=8
+QWebChannelAbstractTransport (0x0x7f5271c70e38) 0
+ vptr=((& QWebChannelAbstractTransport::_ZTV28QWebChannelAbstractTransport) + 16)
+ QObject (0x0x7f5271cc8060) 0
+ primary-for QWebChannelAbstractTransport (0x0x7f5271c70e38)
+
+Class QWebEngineClientCertificateStore
+ size=8 align=8
+ base size=8 base align=8
+QWebEngineClientCertificateStore (0x0x7f52719d46c0) 0
+
+Class QWebEngineCookieStore::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QWebEngineCookieStore::QPrivateSignal (0x0x7f52719d4780) 0 empty
+
+Class QWebEngineCookieStore::FilterRequest
+ size=24 align=8
+ base size=20 base align=8
+QWebEngineCookieStore::FilterRequest (0x0x7f52719d47e0) 0
+
+Vtable for QWebEngineCookieStore
+QWebEngineCookieStore::_ZTV21QWebEngineCookieStore: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI21QWebEngineCookieStore)
+16 (int (*)(...))QWebEngineCookieStore::metaObject
+24 (int (*)(...))QWebEngineCookieStore::qt_metacast
+32 (int (*)(...))QWebEngineCookieStore::qt_metacall
+40 (int (*)(...))QWebEngineCookieStore::~QWebEngineCookieStore
+48 (int (*)(...))QWebEngineCookieStore::~QWebEngineCookieStore
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QWebEngineCookieStore
+ size=24 align=8
+ base size=24 base align=8
+QWebEngineCookieStore (0x0x7f52719d2820) 0
+ vptr=((& QWebEngineCookieStore::_ZTV21QWebEngineCookieStore) + 16)
+ QObject (0x0x7f52719d4720) 0
+ primary-for QWebEngineCookieStore (0x0x7f52719d2820)
+
+Class QWebEngineFindTextResult
+ size=8 align=8
+ base size=8 base align=8
+QWebEngineFindTextResult (0x0x7f52719d4c60) 0
+
+Class QWebEngineHttpRequest
+ size=8 align=8
+ base size=8 base align=8
+QWebEngineHttpRequest (0x0x7f52719d4f00) 0
+
+Class QWebEngineNotification::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QWebEngineNotification::QPrivateSignal (0x0x7f5271a8a0c0) 0 empty
+
+Vtable for QWebEngineNotification
+QWebEngineNotification::_ZTV22QWebEngineNotification: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI22QWebEngineNotification)
+16 (int (*)(...))QWebEngineNotification::metaObject
+24 (int (*)(...))QWebEngineNotification::qt_metacast
+32 (int (*)(...))QWebEngineNotification::qt_metacall
+40 (int (*)(...))QWebEngineNotification::~QWebEngineNotification
+48 (int (*)(...))QWebEngineNotification::~QWebEngineNotification
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QWebEngineNotification
+ size=24 align=8
+ base size=24 base align=8
+QWebEngineNotification (0x0x7f5271a84478) 0
+ vptr=((& QWebEngineNotification::_ZTV22QWebEngineNotification) + 16)
+ QObject (0x0x7f5271a8a060) 0
+ primary-for QWebEngineNotification (0x0x7f5271a84478)
+
+Class QWebEngineQuotaRequest
+ size=16 align=8
+ base size=16 base align=8
+QWebEngineQuotaRequest (0x0x7f5271a8a360) 0
+
+Class QWebEngineRegisterProtocolHandlerRequest
+ size=16 align=8
+ base size=16 base align=8
+QWebEngineRegisterProtocolHandlerRequest (0x0x7f5271a8aea0) 0
+
+Class QWebEngineUrlRequestInfo
+ size=8 align=8
+ base size=8 base align=8
+QWebEngineUrlRequestInfo (0x0x7f5271aea7e0) 0
+
+Class QWebEngineUrlRequestInterceptor::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QWebEngineUrlRequestInterceptor::QPrivateSignal (0x0x7f5271aeaa20) 0 empty
+
+Vtable for QWebEngineUrlRequestInterceptor
+QWebEngineUrlRequestInterceptor::_ZTV31QWebEngineUrlRequestInterceptor: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI31QWebEngineUrlRequestInterceptor)
+16 (int (*)(...))QWebEngineUrlRequestInterceptor::metaObject
+24 (int (*)(...))QWebEngineUrlRequestInterceptor::qt_metacast
+32 (int (*)(...))QWebEngineUrlRequestInterceptor::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+
+Class QWebEngineUrlRequestInterceptor
+ size=16 align=8
+ base size=16 base align=8
+QWebEngineUrlRequestInterceptor (0x0x7f5271aef340) 0
+ vptr=((& QWebEngineUrlRequestInterceptor::_ZTV31QWebEngineUrlRequestInterceptor) + 16)
+ QObject (0x0x7f5271aea9c0) 0
+ primary-for QWebEngineUrlRequestInterceptor (0x0x7f5271aef340)
+
+Class QWebEngineUrlRequestJob::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QWebEngineUrlRequestJob::QPrivateSignal (0x0x7f5271aead20) 0 empty
+
+Vtable for QWebEngineUrlRequestJob
+QWebEngineUrlRequestJob::_ZTV23QWebEngineUrlRequestJob: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI23QWebEngineUrlRequestJob)
+16 (int (*)(...))QWebEngineUrlRequestJob::metaObject
+24 (int (*)(...))QWebEngineUrlRequestJob::qt_metacast
+32 (int (*)(...))QWebEngineUrlRequestJob::qt_metacall
+40 (int (*)(...))QWebEngineUrlRequestJob::~QWebEngineUrlRequestJob
+48 (int (*)(...))QWebEngineUrlRequestJob::~QWebEngineUrlRequestJob
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QWebEngineUrlRequestJob
+ size=24 align=8
+ base size=24 base align=8
+QWebEngineUrlRequestJob (0x0x7f5271aef3a8) 0
+ vptr=((& QWebEngineUrlRequestJob::_ZTV23QWebEngineUrlRequestJob) + 16)
+ QObject (0x0x7f5271aeacc0) 0
+ primary-for QWebEngineUrlRequestJob (0x0x7f5271aef3a8)
+
+Class QWebEngineUrlScheme
+ size=8 align=8
+ base size=8 base align=8
+QWebEngineUrlScheme (0x0x7f5271aeaf00) 0
+
+Class QWebEngineUrlSchemeHandler::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QWebEngineUrlSchemeHandler::QPrivateSignal (0x0x7f5271b1dcc0) 0 empty
+
+Vtable for QWebEngineUrlSchemeHandler
+QWebEngineUrlSchemeHandler::_ZTV26QWebEngineUrlSchemeHandler: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI26QWebEngineUrlSchemeHandler)
+16 (int (*)(...))QWebEngineUrlSchemeHandler::metaObject
+24 (int (*)(...))QWebEngineUrlSchemeHandler::qt_metacast
+32 (int (*)(...))QWebEngineUrlSchemeHandler::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+
+Class QWebEngineUrlSchemeHandler
+ size=16 align=8
+ base size=16 base align=8
+QWebEngineUrlSchemeHandler (0x0x7f5271aef9c0) 0
+ vptr=((& QWebEngineUrlSchemeHandler::_ZTV26QWebEngineUrlSchemeHandler) + 16)
+ QObject (0x0x7f5271b1dc60) 0
+ primary-for QWebEngineUrlSchemeHandler (0x0x7f5271aef9c0)
+
+Class QSizePolicy::Bits
+ size=4 align=4
+ base size=4 base align=4
+QSizePolicy::Bits (0x0x7f5271b1de40) 0
+
+Class QSizePolicy
+ size=4 align=4
+ base size=4 base align=4
+QSizePolicy (0x0x7f5271b1dde0) 0
+
+Class QWidgetData
+ size=88 align=8
+ base size=88 base align=8
+QWidgetData (0x0x7f5271793ae0) 0
+
+Class QWidget::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QWidget::QPrivateSignal (0x0x7f5271793c00) 0 empty
+
+Vtable for QWidget
+QWidget::_ZTV7QWidget: 64 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI7QWidget)
+16 (int (*)(...))QWidget::metaObject
+24 (int (*)(...))QWidget::qt_metacast
+32 (int (*)(...))QWidget::qt_metacall
+40 (int (*)(...))QWidget::~QWidget
+48 (int (*)(...))QWidget::~QWidget
+56 (int (*)(...))QWidget::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QWidget::sizeHint
+136 (int (*)(...))QWidget::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QWidget::mousePressEvent
+176 (int (*)(...))QWidget::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QWidget::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QWidget::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QWidget::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QWidget::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QWidget::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QWidget::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))-16
+440 (int (*)(...))(& _ZTI7QWidget)
+448 (int (*)(...))QWidget::_ZThn16_N7QWidgetD1Ev
+456 (int (*)(...))QWidget::_ZThn16_N7QWidgetD0Ev
+464 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+472 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+480 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QWidget
+ size=48 align=8
+ base size=48 base align=8
+QWidget (0x0x7f52717a02a0) 0
+ vptr=((& QWidget::_ZTV7QWidget) + 16)
+ QObject (0x0x7f5271793b40) 0
+ primary-for QWidget (0x0x7f52717a02a0)
+ QPaintDevice (0x0x7f5271793ba0) 16
+ vptr=((& QWidget::_ZTV7QWidget) + 448)
+
+Class QAbstractButton::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAbstractButton::QPrivateSignal (0x0x7f527181a5a0) 0 empty
+
+Vtable for QAbstractButton
+QAbstractButton::_ZTV15QAbstractButton: 67 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QAbstractButton)
+16 (int (*)(...))QAbstractButton::metaObject
+24 (int (*)(...))QAbstractButton::qt_metacast
+32 (int (*)(...))QAbstractButton::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QAbstractButton::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QAbstractButton::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QWidget::sizeHint
+136 (int (*)(...))QWidget::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QAbstractButton::mousePressEvent
+176 (int (*)(...))QAbstractButton::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QAbstractButton::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QAbstractButton::keyPressEvent
+216 (int (*)(...))QAbstractButton::keyReleaseEvent
+224 (int (*)(...))QAbstractButton::focusInEvent
+232 (int (*)(...))QAbstractButton::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))__cxa_pure_virtual
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QWidget::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QWidget::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QAbstractButton::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QAbstractButton::hitButton
+440 (int (*)(...))QAbstractButton::checkStateSet
+448 (int (*)(...))QAbstractButton::nextCheckState
+456 (int (*)(...))-16
+464 (int (*)(...))(& _ZTI15QAbstractButton)
+472 0
+480 0
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+520 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+528 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QAbstractButton
+ size=48 align=8
+ base size=48 base align=8
+QAbstractButton (0x0x7f5271796dd0) 0
+ vptr=((& QAbstractButton::_ZTV15QAbstractButton) + 16)
+ QWidget (0x0x7f5271802b60) 0
+ primary-for QAbstractButton (0x0x7f5271796dd0)
+ QObject (0x0x7f527181a4e0) 0
+ primary-for QWidget (0x0x7f5271802b60)
+ QPaintDevice (0x0x7f527181a540) 16
+ vptr=((& QAbstractButton::_ZTV15QAbstractButton) + 472)
+
+Class QAbstractSpinBox::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAbstractSpinBox::QPrivateSignal (0x0x7f527181a840) 0 empty
+
+Vtable for QAbstractSpinBox
+QAbstractSpinBox::_ZTV16QAbstractSpinBox: 69 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QAbstractSpinBox)
+16 (int (*)(...))QAbstractSpinBox::metaObject
+24 (int (*)(...))QAbstractSpinBox::qt_metacast
+32 (int (*)(...))QAbstractSpinBox::qt_metacall
+40 (int (*)(...))QAbstractSpinBox::~QAbstractSpinBox
+48 (int (*)(...))QAbstractSpinBox::~QAbstractSpinBox
+56 (int (*)(...))QAbstractSpinBox::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QAbstractSpinBox::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QAbstractSpinBox::sizeHint
+136 (int (*)(...))QAbstractSpinBox::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QAbstractSpinBox::mousePressEvent
+176 (int (*)(...))QAbstractSpinBox::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QAbstractSpinBox::mouseMoveEvent
+200 (int (*)(...))QAbstractSpinBox::wheelEvent
+208 (int (*)(...))QAbstractSpinBox::keyPressEvent
+216 (int (*)(...))QAbstractSpinBox::keyReleaseEvent
+224 (int (*)(...))QAbstractSpinBox::focusInEvent
+232 (int (*)(...))QAbstractSpinBox::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QAbstractSpinBox::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QAbstractSpinBox::resizeEvent
+280 (int (*)(...))QAbstractSpinBox::closeEvent
+288 (int (*)(...))QAbstractSpinBox::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QAbstractSpinBox::showEvent
+352 (int (*)(...))QAbstractSpinBox::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QAbstractSpinBox::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QAbstractSpinBox::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QAbstractSpinBox::validate
+440 (int (*)(...))QAbstractSpinBox::fixup
+448 (int (*)(...))QAbstractSpinBox::stepBy
+456 (int (*)(...))QAbstractSpinBox::clear
+464 (int (*)(...))QAbstractSpinBox::stepEnabled
+472 (int (*)(...))-16
+480 (int (*)(...))(& _ZTI16QAbstractSpinBox)
+488 (int (*)(...))QAbstractSpinBox::_ZThn16_N16QAbstractSpinBoxD1Ev
+496 (int (*)(...))QAbstractSpinBox::_ZThn16_N16QAbstractSpinBoxD0Ev
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+520 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+528 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+536 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+544 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QAbstractSpinBox
+ size=48 align=8
+ base size=48 base align=8
+QAbstractSpinBox (0x0x7f5271796e38) 0
+ vptr=((& QAbstractSpinBox::_ZTV16QAbstractSpinBox) + 16)
+ QWidget (0x0x7f5271802bd0) 0
+ primary-for QAbstractSpinBox (0x0x7f5271796e38)
+ QObject (0x0x7f527181a780) 0
+ primary-for QWidget (0x0x7f5271802bd0)
+ QPaintDevice (0x0x7f527181a7e0) 16
+ vptr=((& QAbstractSpinBox::_ZTV16QAbstractSpinBox) + 488)
+
+Class QAbstractSlider::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAbstractSlider::QPrivateSignal (0x0x7f527185b420) 0 empty
+
+Vtable for QAbstractSlider
+QAbstractSlider::_ZTV15QAbstractSlider: 65 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QAbstractSlider)
+16 (int (*)(...))QAbstractSlider::metaObject
+24 (int (*)(...))QAbstractSlider::qt_metacast
+32 (int (*)(...))QAbstractSlider::qt_metacall
+40 (int (*)(...))QAbstractSlider::~QAbstractSlider
+48 (int (*)(...))QAbstractSlider::~QAbstractSlider
+56 (int (*)(...))QAbstractSlider::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QAbstractSlider::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QWidget::sizeHint
+136 (int (*)(...))QWidget::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QWidget::mousePressEvent
+176 (int (*)(...))QWidget::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QWidget::mouseMoveEvent
+200 (int (*)(...))QAbstractSlider::wheelEvent
+208 (int (*)(...))QAbstractSlider::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QWidget::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QWidget::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QWidget::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QAbstractSlider::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QAbstractSlider::sliderChange
+440 (int (*)(...))-16
+448 (int (*)(...))(& _ZTI15QAbstractSlider)
+456 (int (*)(...))QAbstractSlider::_ZThn16_N15QAbstractSliderD1Ev
+464 (int (*)(...))QAbstractSlider::_ZThn16_N15QAbstractSliderD0Ev
+472 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+480 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+512 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QAbstractSlider
+ size=48 align=8
+ base size=48 base align=8
+QAbstractSlider (0x0x7f5271796f70) 0
+ vptr=((& QAbstractSlider::_ZTV15QAbstractSlider) + 16)
+ QWidget (0x0x7f5271836930) 0
+ primary-for QAbstractSlider (0x0x7f5271796f70)
+ QObject (0x0x7f527185b360) 0
+ primary-for QWidget (0x0x7f5271836930)
+ QPaintDevice (0x0x7f527185b3c0) 16
+ vptr=((& QAbstractSlider::_ZTV15QAbstractSlider) + 456)
+
+Class QSlider::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSlider::QPrivateSignal (0x0x7f527185b6c0) 0 empty
+
+Vtable for QSlider
+QSlider::_ZTV7QSlider: 65 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI7QSlider)
+16 (int (*)(...))QSlider::metaObject
+24 (int (*)(...))QSlider::qt_metacast
+32 (int (*)(...))QSlider::qt_metacall
+40 (int (*)(...))QSlider::~QSlider
+48 (int (*)(...))QSlider::~QSlider
+56 (int (*)(...))QSlider::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QAbstractSlider::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QSlider::sizeHint
+136 (int (*)(...))QSlider::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QSlider::mousePressEvent
+176 (int (*)(...))QSlider::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QSlider::mouseMoveEvent
+200 (int (*)(...))QAbstractSlider::wheelEvent
+208 (int (*)(...))QAbstractSlider::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QSlider::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QWidget::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QWidget::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QAbstractSlider::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QAbstractSlider::sliderChange
+440 (int (*)(...))-16
+448 (int (*)(...))(& _ZTI7QSlider)
+456 (int (*)(...))QSlider::_ZThn16_N7QSliderD1Ev
+464 (int (*)(...))QSlider::_ZThn16_N7QSliderD0Ev
+472 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+480 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+512 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QSlider
+ size=48 align=8
+ base size=48 base align=8
+QSlider (0x0x7f527186e000) 0
+ vptr=((& QSlider::_ZTV7QSlider) + 16)
+ QAbstractSlider (0x0x7f527186e068) 0
+ primary-for QSlider (0x0x7f527186e000)
+ QWidget (0x0x7f5271836ee0) 0
+ primary-for QAbstractSlider (0x0x7f527186e068)
+ QObject (0x0x7f527185b600) 0
+ primary-for QWidget (0x0x7f5271836ee0)
+ QPaintDevice (0x0x7f527185b660) 16
+ vptr=((& QSlider::_ZTV7QSlider) + 456)
+
+Class QStyle::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QStyle::QPrivateSignal (0x0x7f527185b9c0) 0 empty
+
+Vtable for QStyle
+QStyle::_ZTV6QStyle: 37 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI6QStyle)
+16 (int (*)(...))QStyle::metaObject
+24 (int (*)(...))QStyle::qt_metacast
+32 (int (*)(...))QStyle::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QStyle::polish
+120 (int (*)(...))QStyle::unpolish
+128 (int (*)(...))QStyle::polish
+136 (int (*)(...))QStyle::unpolish
+144 (int (*)(...))QStyle::polish
+152 (int (*)(...))QStyle::itemTextRect
+160 (int (*)(...))QStyle::itemPixmapRect
+168 (int (*)(...))QStyle::drawItemText
+176 (int (*)(...))QStyle::drawItemPixmap
+184 (int (*)(...))QStyle::standardPalette
+192 (int (*)(...))__cxa_pure_virtual
+200 (int (*)(...))__cxa_pure_virtual
+208 (int (*)(...))__cxa_pure_virtual
+216 (int (*)(...))__cxa_pure_virtual
+224 (int (*)(...))__cxa_pure_virtual
+232 (int (*)(...))__cxa_pure_virtual
+240 (int (*)(...))__cxa_pure_virtual
+248 (int (*)(...))__cxa_pure_virtual
+256 (int (*)(...))__cxa_pure_virtual
+264 (int (*)(...))__cxa_pure_virtual
+272 (int (*)(...))__cxa_pure_virtual
+280 (int (*)(...))__cxa_pure_virtual
+288 (int (*)(...))__cxa_pure_virtual
+
+Class QStyle
+ size=16 align=8
+ base size=16 base align=8
+QStyle (0x0x7f527186e138) 0
+ vptr=((& QStyle::_ZTV6QStyle) + 16)
+ QObject (0x0x7f527185b960) 0
+ primary-for QStyle (0x0x7f527186e138)
+
+Class QTabBar::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTabBar::QPrivateSignal (0x0x7f52718dd2a0) 0 empty
+
+Vtable for QTabBar
+QTabBar::_ZTV7QTabBar: 69 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI7QTabBar)
+16 (int (*)(...))QTabBar::metaObject
+24 (int (*)(...))QTabBar::qt_metacast
+32 (int (*)(...))QTabBar::qt_metacall
+40 (int (*)(...))QTabBar::~QTabBar
+48 (int (*)(...))QTabBar::~QTabBar
+56 (int (*)(...))QTabBar::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QTabBar::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QTabBar::sizeHint
+136 (int (*)(...))QTabBar::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QTabBar::mousePressEvent
+176 (int (*)(...))QTabBar::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QTabBar::mouseMoveEvent
+200 (int (*)(...))QTabBar::wheelEvent
+208 (int (*)(...))QTabBar::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QTabBar::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QTabBar::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QWidget::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QTabBar::showEvent
+352 (int (*)(...))QTabBar::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QTabBar::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QTabBar::tabSizeHint
+440 (int (*)(...))QTabBar::minimumTabSizeHint
+448 (int (*)(...))QTabBar::tabInserted
+456 (int (*)(...))QTabBar::tabRemoved
+464 (int (*)(...))QTabBar::tabLayoutChange
+472 (int (*)(...))-16
+480 (int (*)(...))(& _ZTI7QTabBar)
+488 (int (*)(...))QTabBar::_ZThn16_N7QTabBarD1Ev
+496 (int (*)(...))QTabBar::_ZThn16_N7QTabBarD0Ev
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+520 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+528 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+536 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+544 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QTabBar
+ size=48 align=8
+ base size=48 base align=8
+QTabBar (0x0x7f527186e340) 0
+ vptr=((& QTabBar::_ZTV7QTabBar) + 16)
+ QWidget (0x0x7f52718b9d90) 0
+ primary-for QTabBar (0x0x7f527186e340)
+ QObject (0x0x7f52718dd1e0) 0
+ primary-for QWidget (0x0x7f52718b9d90)
+ QPaintDevice (0x0x7f52718dd240) 16
+ vptr=((& QTabBar::_ZTV7QTabBar) + 488)
+
+Class QTabWidget::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTabWidget::QPrivateSignal (0x0x7f52718dd600) 0 empty
+
+Vtable for QTabWidget
+QTabWidget::_ZTV10QTabWidget: 66 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QTabWidget)
+16 (int (*)(...))QTabWidget::metaObject
+24 (int (*)(...))QTabWidget::qt_metacast
+32 (int (*)(...))QTabWidget::qt_metacall
+40 (int (*)(...))QTabWidget::~QTabWidget
+48 (int (*)(...))QTabWidget::~QTabWidget
+56 (int (*)(...))QTabWidget::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QTabWidget::sizeHint
+136 (int (*)(...))QTabWidget::minimumSizeHint
+144 (int (*)(...))QTabWidget::heightForWidth
+152 (int (*)(...))QTabWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QWidget::mousePressEvent
+176 (int (*)(...))QWidget::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QWidget::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QTabWidget::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QTabWidget::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QTabWidget::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QWidget::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QTabWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QTabWidget::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QTabWidget::tabInserted
+440 (int (*)(...))QTabWidget::tabRemoved
+448 (int (*)(...))-16
+456 (int (*)(...))(& _ZTI10QTabWidget)
+464 (int (*)(...))QTabWidget::_ZThn16_N10QTabWidgetD1Ev
+472 (int (*)(...))QTabWidget::_ZThn16_N10QTabWidgetD0Ev
+480 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+512 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+520 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QTabWidget
+ size=48 align=8
+ base size=48 base align=8
+QTabWidget (0x0x7f527186e3a8) 0
+ vptr=((& QTabWidget::_ZTV10QTabWidget) + 16)
+ QWidget (0x0x7f52718e53f0) 0
+ primary-for QTabWidget (0x0x7f527186e3a8)
+ QObject (0x0x7f52718dd540) 0
+ primary-for QWidget (0x0x7f52718e53f0)
+ QPaintDevice (0x0x7f52718dd5a0) 16
+ vptr=((& QTabWidget::_ZTV10QTabWidget) + 464)
+
+Class QRubberBand::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QRubberBand::QPrivateSignal (0x0x7f52718dda20) 0 empty
+
+Vtable for QRubberBand
+QRubberBand::_ZTV11QRubberBand: 64 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QRubberBand)
+16 (int (*)(...))QRubberBand::metaObject
+24 (int (*)(...))QRubberBand::qt_metacast
+32 (int (*)(...))QRubberBand::qt_metacall
+40 (int (*)(...))QRubberBand::~QRubberBand
+48 (int (*)(...))QRubberBand::~QRubberBand
+56 (int (*)(...))QRubberBand::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QWidget::sizeHint
+136 (int (*)(...))QWidget::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QWidget::mousePressEvent
+176 (int (*)(...))QWidget::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QWidget::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QWidget::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QRubberBand::paintEvent
+264 (int (*)(...))QRubberBand::moveEvent
+272 (int (*)(...))QRubberBand::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QWidget::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QRubberBand::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QRubberBand::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))-16
+440 (int (*)(...))(& _ZTI11QRubberBand)
+448 (int (*)(...))QRubberBand::_ZThn16_N11QRubberBandD1Ev
+456 (int (*)(...))QRubberBand::_ZThn16_N11QRubberBandD0Ev
+464 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+472 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+480 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QRubberBand
+ size=48 align=8
+ base size=48 base align=8
+QRubberBand (0x0x7f527186e410) 0
+ vptr=((& QRubberBand::_ZTV11QRubberBand) + 16)
+ QWidget (0x0x7f52718e57e0) 0
+ primary-for QRubberBand (0x0x7f527186e410)
+ QObject (0x0x7f52718dd960) 0
+ primary-for QWidget (0x0x7f52718e57e0)
+ QPaintDevice (0x0x7f52718dd9c0) 16
+ vptr=((& QRubberBand::_ZTV11QRubberBand) + 448)
+
+Class QFrame::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QFrame::QPrivateSignal (0x0x7f52718ddea0) 0 empty
+
+Vtable for QFrame
+QFrame::_ZTV6QFrame: 64 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI6QFrame)
+16 (int (*)(...))QFrame::metaObject
+24 (int (*)(...))QFrame::qt_metacast
+32 (int (*)(...))QFrame::qt_metacall
+40 (int (*)(...))QFrame::~QFrame
+48 (int (*)(...))QFrame::~QFrame
+56 (int (*)(...))QFrame::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QFrame::sizeHint
+136 (int (*)(...))QWidget::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QWidget::mousePressEvent
+176 (int (*)(...))QWidget::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QWidget::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QWidget::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QFrame::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QWidget::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QWidget::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QFrame::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))-16
+440 (int (*)(...))(& _ZTI6QFrame)
+448 (int (*)(...))QFrame::_ZThn16_N6QFrameD1Ev
+456 (int (*)(...))QFrame::_ZThn16_N6QFrameD0Ev
+464 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+472 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+480 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QFrame
+ size=48 align=8
+ base size=48 base align=8
+QFrame (0x0x7f527186e478) 0
+ vptr=((& QFrame::_ZTV6QFrame) + 16)
+ QWidget (0x0x7f52718e5a10) 0
+ primary-for QFrame (0x0x7f527186e478)
+ QObject (0x0x7f52718ddde0) 0
+ primary-for QWidget (0x0x7f52718e5a10)
+ QPaintDevice (0x0x7f52718dde40) 16
+ vptr=((& QFrame::_ZTV6QFrame) + 448)
+
+Class QStyleOption
+ size=64 align=8
+ base size=64 base align=8
+QStyleOption (0x0x7f5271532240) 0
+
+Class QStyleOptionFocusRect
+ size=80 align=8
+ base size=80 base align=8
+QStyleOptionFocusRect (0x0x7f527186e4e0) 0
+ QStyleOption (0x0x7f5271532300) 0
+
+Class QStyleOptionFrame
+ size=80 align=8
+ base size=80 base align=8
+QStyleOptionFrame (0x0x7f527186e548) 0
+ QStyleOption (0x0x7f5271532540) 0
+
+Class QStyleOptionTabWidgetFrame
+ size=136 align=8
+ base size=132 base align=8
+QStyleOptionTabWidgetFrame (0x0x7f527186e680) 0
+ QStyleOption (0x0x7f5271532e40) 0
+
+Class QStyleOptionTabBarBase
+ size=104 align=8
+ base size=101 base align=8
+QStyleOptionTabBarBase (0x0x7f527186e6e8) 0
+ QStyleOption (0x0x7f52715620c0) 0
+
+Class QStyleOptionHeader
+ size=120 align=8
+ base size=116 base align=8
+QStyleOptionHeader (0x0x7f527186e750) 0
+ QStyleOption (0x0x7f5271562360) 0
+
+Class QStyleOptionButton
+ size=96 align=8
+ base size=96 base align=8
+QStyleOptionButton (0x0x7f527186e7b8) 0
+ QStyleOption (0x0x7f52715625a0) 0
+
+Class QStyleOptionTab
+ size=136 align=8
+ base size=136 base align=8
+QStyleOptionTab (0x0x7f527186e8f0) 0
+ QStyleOption (0x0x7f5271562ea0) 0
+
+Class QStyleOptionTabV4
+ size=144 align=8
+ base size=140 base align=8
+QStyleOptionTabV4 (0x0x7f527186eaf8) 0
+ QStyleOptionTab (0x0x7f527186eb60) 0
+ QStyleOption (0x0x7f5271595420) 0
+
+Class QStyleOptionToolBar
+ size=88 align=8
+ base size=88 base align=8
+QStyleOptionToolBar (0x0x7f527186ebc8) 0
+ QStyleOption (0x0x7f52715959c0) 0
+
+Class QStyleOptionProgressBar
+ size=104 align=8
+ base size=102 base align=8
+QStyleOptionProgressBar (0x0x7f527186ed00) 0
+ QStyleOption (0x0x7f52715d9300) 0
+
+Class QStyleOptionMenuItem
+ size=136 align=8
+ base size=136 base align=8
+QStyleOptionMenuItem (0x0x7f527186ed68) 0
+ QStyleOption (0x0x7f52715d9540) 0
+
+Class QStyleOptionDockWidget
+ size=80 align=8
+ base size=76 base align=8
+QStyleOptionDockWidget (0x0x7f527186edd0) 0
+ QStyleOption (0x0x7f52715d9780) 0
+
+Class QStyleOptionViewItem
+ size=192 align=8
+ base size=192 base align=8
+QStyleOptionViewItem (0x0x7f527186eea0) 0
+ QStyleOption (0x0x7f52715d99c0) 0
+
+Class QStyleOptionToolBox
+ size=88 align=8
+ base size=88 base align=8
+QStyleOptionToolBox (0x0x7f5271610000) 0
+ QStyleOption (0x0x7f527160c300) 0
+
+Class QStyleOptionRubberBand
+ size=72 align=8
+ base size=69 base align=8
+QStyleOptionRubberBand (0x0x7f5271610068) 0
+ QStyleOption (0x0x7f527160c540) 0
+
+Class QStyleOptionComplex
+ size=72 align=8
+ base size=72 base align=8
+QStyleOptionComplex (0x0x7f52716100d0) 0
+ QStyleOption (0x0x7f527160c780) 0
+
+Class QStyleOptionSlider
+ size=128 align=8
+ base size=121 base align=8
+QStyleOptionSlider (0x0x7f5271610138) 0
+ QStyleOptionComplex (0x0x7f52716101a0) 0
+ QStyleOption (0x0x7f527160c9c0) 0
+
+Class QStyleOptionSpinBox
+ size=88 align=8
+ base size=81 base align=8
+QStyleOptionSpinBox (0x0x7f5271610208) 0
+ QStyleOptionComplex (0x0x7f5271610270) 0
+ QStyleOption (0x0x7f527160cd80) 0
+
+Class QStyleOptionToolButton
+ size=136 align=8
+ base size=136 base align=8
+QStyleOptionToolButton (0x0x7f52716102d8) 0
+ QStyleOptionComplex (0x0x7f5271610340) 0
+ QStyleOption (0x0x7f5271633000) 0
+
+Class QStyleOptionComboBox
+ size=120 align=8
+ base size=120 base align=8
+QStyleOptionComboBox (0x0x7f5271610478) 0
+ QStyleOptionComplex (0x0x7f52716104e0) 0
+ QStyleOption (0x0x7f5271633900) 0
+
+Class QStyleOptionTitleBar
+ size=96 align=8
+ base size=96 base align=8
+QStyleOptionTitleBar (0x0x7f5271610548) 0
+ QStyleOptionComplex (0x0x7f52716105b0) 0
+ QStyleOption (0x0x7f5271633b40) 0
+
+Class QStyleOptionGroupBox
+ size=120 align=8
+ base size=116 base align=8
+QStyleOptionGroupBox (0x0x7f5271610618) 0
+ QStyleOptionComplex (0x0x7f5271610680) 0
+ QStyleOption (0x0x7f5271633de0) 0
+
+Class QStyleOptionSizeGrip
+ size=80 align=8
+ base size=76 base align=8
+QStyleOptionSizeGrip (0x0x7f52716106e8) 0
+ QStyleOptionComplex (0x0x7f5271610750) 0
+ QStyleOption (0x0x7f5271662060) 0
+
+Class QStyleOptionGraphicsItem
+ size=152 align=8
+ base size=152 base align=8
+QStyleOptionGraphicsItem (0x0x7f52716107b8) 0
+ QStyleOption (0x0x7f52716622a0) 0
+
+Class QStyleHintReturn
+ size=8 align=4
+ base size=8 base align=4
+QStyleHintReturn (0x0x7f5271662a20) 0
+
+Class QStyleHintReturnMask
+ size=16 align=8
+ base size=16 base align=8
+QStyleHintReturnMask (0x0x7f5271610d68) 0
+ QStyleHintReturn (0x0x7f5271662a80) 0
+
+Class QStyleHintReturnVariant
+ size=24 align=8
+ base size=24 base align=8
+QStyleHintReturnVariant (0x0x7f5271610dd0) 0
+ QStyleHintReturn (0x0x7f5271662ae0) 0
+
+Class QAbstractItemDelegate::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAbstractItemDelegate::QPrivateSignal (0x0x7f5271686120) 0 empty
+
+Vtable for QAbstractItemDelegate
+QAbstractItemDelegate::_ZTV21QAbstractItemDelegate: 24 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI21QAbstractItemDelegate)
+16 (int (*)(...))QAbstractItemDelegate::metaObject
+24 (int (*)(...))QAbstractItemDelegate::qt_metacast
+32 (int (*)(...))QAbstractItemDelegate::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))QAbstractItemDelegate::createEditor
+136 (int (*)(...))QAbstractItemDelegate::destroyEditor
+144 (int (*)(...))QAbstractItemDelegate::setEditorData
+152 (int (*)(...))QAbstractItemDelegate::setModelData
+160 (int (*)(...))QAbstractItemDelegate::updateEditorGeometry
+168 (int (*)(...))QAbstractItemDelegate::editorEvent
+176 (int (*)(...))QAbstractItemDelegate::helpEvent
+184 (int (*)(...))QAbstractItemDelegate::paintingRoles
+
+Class QAbstractItemDelegate
+ size=16 align=8
+ base size=16 base align=8
+QAbstractItemDelegate (0x0x7f5271683340) 0
+ vptr=((& QAbstractItemDelegate::_ZTV21QAbstractItemDelegate) + 16)
+ QObject (0x0x7f52716860c0) 0
+ primary-for QAbstractItemDelegate (0x0x7f5271683340)
+
+Class QAbstractScrollArea::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAbstractScrollArea::QPrivateSignal (0x0x7f5271686420) 0 empty
+
+Vtable for QAbstractScrollArea
+QAbstractScrollArea::_ZTV19QAbstractScrollArea: 68 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QAbstractScrollArea)
+16 (int (*)(...))QAbstractScrollArea::metaObject
+24 (int (*)(...))QAbstractScrollArea::qt_metacast
+32 (int (*)(...))QAbstractScrollArea::qt_metacall
+40 (int (*)(...))QAbstractScrollArea::~QAbstractScrollArea
+48 (int (*)(...))QAbstractScrollArea::~QAbstractScrollArea
+56 (int (*)(...))QAbstractScrollArea::event
+64 (int (*)(...))QAbstractScrollArea::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QAbstractScrollArea::sizeHint
+136 (int (*)(...))QAbstractScrollArea::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QAbstractScrollArea::mousePressEvent
+176 (int (*)(...))QAbstractScrollArea::mouseReleaseEvent
+184 (int (*)(...))QAbstractScrollArea::mouseDoubleClickEvent
+192 (int (*)(...))QAbstractScrollArea::mouseMoveEvent
+200 (int (*)(...))QAbstractScrollArea::wheelEvent
+208 (int (*)(...))QAbstractScrollArea::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QAbstractScrollArea::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QAbstractScrollArea::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QAbstractScrollArea::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QAbstractScrollArea::dragEnterEvent
+320 (int (*)(...))QAbstractScrollArea::dragMoveEvent
+328 (int (*)(...))QAbstractScrollArea::dragLeaveEvent
+336 (int (*)(...))QAbstractScrollArea::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QFrame::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QAbstractScrollArea::setupViewport
+440 (int (*)(...))QAbstractScrollArea::viewportEvent
+448 (int (*)(...))QAbstractScrollArea::scrollContentsBy
+456 (int (*)(...))QAbstractScrollArea::viewportSizeHint
+464 (int (*)(...))-16
+472 (int (*)(...))(& _ZTI19QAbstractScrollArea)
+480 (int (*)(...))QAbstractScrollArea::_ZThn16_N19QAbstractScrollAreaD1Ev
+488 (int (*)(...))QAbstractScrollArea::_ZThn16_N19QAbstractScrollAreaD0Ev
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+512 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+520 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+528 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+536 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QAbstractScrollArea
+ size=48 align=8
+ base size=48 base align=8
+QAbstractScrollArea (0x0x7f52716833a8) 0
+ vptr=((& QAbstractScrollArea::_ZTV19QAbstractScrollArea) + 16)
+ QFrame (0x0x7f5271683410) 0
+ primary-for QAbstractScrollArea (0x0x7f52716833a8)
+ QWidget (0x0x7f5271684310) 0
+ primary-for QFrame (0x0x7f5271683410)
+ QObject (0x0x7f5271686360) 0
+ primary-for QWidget (0x0x7f5271684310)
+ QPaintDevice (0x0x7f52716863c0) 16
+ vptr=((& QAbstractScrollArea::_ZTV19QAbstractScrollArea) + 480)
+
+Class QAbstractItemView::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAbstractItemView::QPrivateSignal (0x0x7f5271686780) 0 empty
+
+Vtable for QAbstractItemView
+QAbstractItemView::_ZTV17QAbstractItemView: 106 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QAbstractItemView)
+16 (int (*)(...))QAbstractItemView::metaObject
+24 (int (*)(...))QAbstractItemView::qt_metacast
+32 (int (*)(...))QAbstractItemView::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QAbstractItemView::event
+64 (int (*)(...))QAbstractItemView::eventFilter
+72 (int (*)(...))QAbstractItemView::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QAbstractScrollArea::sizeHint
+136 (int (*)(...))QAbstractScrollArea::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QAbstractItemView::mousePressEvent
+176 (int (*)(...))QAbstractItemView::mouseReleaseEvent
+184 (int (*)(...))QAbstractItemView::mouseDoubleClickEvent
+192 (int (*)(...))QAbstractItemView::mouseMoveEvent
+200 (int (*)(...))QAbstractScrollArea::wheelEvent
+208 (int (*)(...))QAbstractItemView::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QAbstractItemView::focusInEvent
+232 (int (*)(...))QAbstractItemView::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QAbstractScrollArea::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QAbstractItemView::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QAbstractScrollArea::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QAbstractItemView::dragEnterEvent
+320 (int (*)(...))QAbstractItemView::dragMoveEvent
+328 (int (*)(...))QAbstractItemView::dragLeaveEvent
+336 (int (*)(...))QAbstractItemView::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QFrame::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QAbstractItemView::inputMethodEvent
+416 (int (*)(...))QAbstractItemView::inputMethodQuery
+424 (int (*)(...))QAbstractItemView::focusNextPrevChild
+432 (int (*)(...))QAbstractScrollArea::setupViewport
+440 (int (*)(...))QAbstractItemView::viewportEvent
+448 (int (*)(...))QAbstractScrollArea::scrollContentsBy
+456 (int (*)(...))QAbstractItemView::viewportSizeHint
+464 (int (*)(...))QAbstractItemView::setModel
+472 (int (*)(...))QAbstractItemView::setSelectionModel
+480 (int (*)(...))QAbstractItemView::keyboardSearch
+488 (int (*)(...))__cxa_pure_virtual
+496 (int (*)(...))__cxa_pure_virtual
+504 (int (*)(...))__cxa_pure_virtual
+512 (int (*)(...))QAbstractItemView::sizeHintForRow
+520 (int (*)(...))QAbstractItemView::sizeHintForColumn
+528 (int (*)(...))QAbstractItemView::reset
+536 (int (*)(...))QAbstractItemView::setRootIndex
+544 (int (*)(...))QAbstractItemView::doItemsLayout
+552 (int (*)(...))QAbstractItemView::selectAll
+560 (int (*)(...))QAbstractItemView::dataChanged
+568 (int (*)(...))QAbstractItemView::rowsInserted
+576 (int (*)(...))QAbstractItemView::rowsAboutToBeRemoved
+584 (int (*)(...))QAbstractItemView::selectionChanged
+592 (int (*)(...))QAbstractItemView::currentChanged
+600 (int (*)(...))QAbstractItemView::updateEditorData
+608 (int (*)(...))QAbstractItemView::updateEditorGeometries
+616 (int (*)(...))QAbstractItemView::updateGeometries
+624 (int (*)(...))QAbstractItemView::verticalScrollbarAction
+632 (int (*)(...))QAbstractItemView::horizontalScrollbarAction
+640 (int (*)(...))QAbstractItemView::verticalScrollbarValueChanged
+648 (int (*)(...))QAbstractItemView::horizontalScrollbarValueChanged
+656 (int (*)(...))QAbstractItemView::closeEditor
+664 (int (*)(...))QAbstractItemView::commitData
+672 (int (*)(...))QAbstractItemView::editorDestroyed
+680 (int (*)(...))__cxa_pure_virtual
+688 (int (*)(...))__cxa_pure_virtual
+696 (int (*)(...))__cxa_pure_virtual
+704 (int (*)(...))__cxa_pure_virtual
+712 (int (*)(...))__cxa_pure_virtual
+720 (int (*)(...))__cxa_pure_virtual
+728 (int (*)(...))QAbstractItemView::selectedIndexes
+736 (int (*)(...))QAbstractItemView::edit
+744 (int (*)(...))QAbstractItemView::selectionCommand
+752 (int (*)(...))QAbstractItemView::startDrag
+760 (int (*)(...))QAbstractItemView::viewOptions
+768 (int (*)(...))-16
+776 (int (*)(...))(& _ZTI17QAbstractItemView)
+784 0
+792 0
+800 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+808 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+816 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+824 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+832 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+840 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QAbstractItemView
+ size=48 align=8
+ base size=48 base align=8
+QAbstractItemView (0x0x7f5271683478) 0
+ vptr=((& QAbstractItemView::_ZTV17QAbstractItemView) + 16)
+ QAbstractScrollArea (0x0x7f52716834e0) 0
+ primary-for QAbstractItemView (0x0x7f5271683478)
+ QFrame (0x0x7f5271683548) 0
+ primary-for QAbstractScrollArea (0x0x7f52716834e0)
+ QWidget (0x0x7f5271684540) 0
+ primary-for QFrame (0x0x7f5271683548)
+ QObject (0x0x7f52716866c0) 0
+ primary-for QWidget (0x0x7f5271684540)
+ QPaintDevice (0x0x7f5271686720) 16
+ vptr=((& QAbstractItemView::_ZTV17QAbstractItemView) + 784)
+
+Vtable for QAccessibleWidget
+QAccessibleWidget::_ZTV17QAccessibleWidget: 35 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QAccessibleWidget)
+16 (int (*)(...))QAccessibleWidget::~QAccessibleWidget
+24 (int (*)(...))QAccessibleWidget::~QAccessibleWidget
+32 (int (*)(...))QAccessibleWidget::isValid
+40 (int (*)(...))QAccessibleObject::object
+48 (int (*)(...))QAccessibleWidget::window
+56 (int (*)(...))QAccessibleWidget::relations
+64 (int (*)(...))QAccessibleWidget::focusChild
+72 (int (*)(...))QAccessibleObject::childAt
+80 (int (*)(...))QAccessibleWidget::parent
+88 (int (*)(...))QAccessibleWidget::child
+96 (int (*)(...))QAccessibleWidget::childCount
+104 (int (*)(...))QAccessibleWidget::indexOfChild
+112 (int (*)(...))QAccessibleWidget::text
+120 (int (*)(...))QAccessibleObject::setText
+128 (int (*)(...))QAccessibleWidget::rect
+136 (int (*)(...))QAccessibleWidget::role
+144 (int (*)(...))QAccessibleWidget::state
+152 (int (*)(...))QAccessibleWidget::foregroundColor
+160 (int (*)(...))QAccessibleWidget::backgroundColor
+168 (int (*)(...))QAccessibleInterface::virtual_hook
+176 (int (*)(...))QAccessibleWidget::interface_cast
+184 (int (*)(...))QAccessibleWidget::actionNames
+192 (int (*)(...))QAccessibleWidget::doAction
+200 (int (*)(...))QAccessibleWidget::keyBindingsForAction
+208 (int (*)(...))-16
+216 (int (*)(...))(& _ZTI17QAccessibleWidget)
+224 (int (*)(...))QAccessibleWidget::_ZThn16_N17QAccessibleWidgetD1Ev
+232 (int (*)(...))QAccessibleWidget::_ZThn16_N17QAccessibleWidgetD0Ev
+240 (int (*)(...))QAccessibleWidget::_ZThn16_NK17QAccessibleWidget11actionNamesEv
+248 (int (*)(...))QAccessibleActionInterface::localizedActionName
+256 (int (*)(...))QAccessibleActionInterface::localizedActionDescription
+264 (int (*)(...))QAccessibleWidget::_ZThn16_N17QAccessibleWidget8doActionERK7QString
+272 (int (*)(...))QAccessibleWidget::_ZThn16_NK17QAccessibleWidget20keyBindingsForActionERK7QString
+
+Class QAccessibleWidget
+ size=32 align=8
+ base size=32 base align=8
+QAccessibleWidget (0x0x7f52716eb310) 0
+ vptr=((& QAccessibleWidget::_ZTV17QAccessibleWidget) + 16)
+ QAccessibleObject (0x0x7f5271683680) 0
+ primary-for QAccessibleWidget (0x0x7f52716eb310)
+ QAccessibleInterface (0x0x7f52716e74e0) 0 nearly-empty
+ primary-for QAccessibleObject (0x0x7f5271683680)
+ QAccessibleActionInterface (0x0x7f52716e7540) 16 nearly-empty
+ vptr=((& QAccessibleWidget::_ZTV17QAccessibleWidget) + 224)
+
+Class QAction::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAction::QPrivateSignal (0x0x7f52716e7660) 0 empty
+
+Vtable for QAction
+QAction::_ZTV7QAction: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI7QAction)
+16 (int (*)(...))QAction::metaObject
+24 (int (*)(...))QAction::qt_metacast
+32 (int (*)(...))QAction::qt_metacall
+40 (int (*)(...))QAction::~QAction
+48 (int (*)(...))QAction::~QAction
+56 (int (*)(...))QAction::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QAction
+ size=16 align=8
+ base size=16 base align=8
+QAction (0x0x7f52716836e8) 0
+ vptr=((& QAction::_ZTV7QAction) + 16)
+ QObject (0x0x7f52716e7600) 0
+ primary-for QAction (0x0x7f52716836e8)
+
+Class QActionGroup::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QActionGroup::QPrivateSignal (0x0x7f52716e7b40) 0 empty
+
+Vtable for QActionGroup
+QActionGroup::_ZTV12QActionGroup: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QActionGroup)
+16 (int (*)(...))QActionGroup::metaObject
+24 (int (*)(...))QActionGroup::qt_metacast
+32 (int (*)(...))QActionGroup::qt_metacall
+40 (int (*)(...))QActionGroup::~QActionGroup
+48 (int (*)(...))QActionGroup::~QActionGroup
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QActionGroup
+ size=16 align=8
+ base size=16 base align=8
+QActionGroup (0x0x7f5271683750) 0
+ vptr=((& QActionGroup::_ZTV12QActionGroup) + 16)
+ QObject (0x0x7f52716e7ae0) 0
+ primary-for QActionGroup (0x0x7f5271683750)
+
+Class QApplication::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QApplication::QPrivateSignal (0x0x7f52716e7ea0) 0 empty
+
+Vtable for QApplication
+QApplication::_ZTV12QApplication: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QApplication)
+16 (int (*)(...))QApplication::metaObject
+24 (int (*)(...))QApplication::qt_metacast
+32 (int (*)(...))QApplication::qt_metacall
+40 (int (*)(...))QApplication::~QApplication
+48 (int (*)(...))QApplication::~QApplication
+56 (int (*)(...))QApplication::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QApplication::notify
+120 (int (*)(...))QApplication::compressEvent
+
+Class QApplication
+ size=16 align=8
+ base size=16 base align=8
+QApplication (0x0x7f52716837b8) 0
+ vptr=((& QApplication::_ZTV12QApplication) + 16)
+ QGuiApplication (0x0x7f5271683820) 0
+ primary-for QApplication (0x0x7f52716837b8)
+ QCoreApplication (0x0x7f5271683888) 0
+ primary-for QGuiApplication (0x0x7f5271683820)
+ QObject (0x0x7f52716e7e40) 0
+ primary-for QCoreApplication (0x0x7f5271683888)
+
+Vtable for QLayoutItem
+QLayoutItem::_ZTV11QLayoutItem: 19 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QLayoutItem)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))__cxa_pure_virtual
+72 (int (*)(...))__cxa_pure_virtual
+80 (int (*)(...))__cxa_pure_virtual
+88 (int (*)(...))QLayoutItem::hasHeightForWidth
+96 (int (*)(...))QLayoutItem::heightForWidth
+104 (int (*)(...))QLayoutItem::minimumHeightForWidth
+112 (int (*)(...))QLayoutItem::invalidate
+120 (int (*)(...))QLayoutItem::widget
+128 (int (*)(...))QLayoutItem::layout
+136 (int (*)(...))QLayoutItem::spacerItem
+144 (int (*)(...))QLayoutItem::controlTypes
+
+Class QLayoutItem
+ size=16 align=8
+ base size=12 base align=8
+QLayoutItem (0x0x7f527172b180) 0
+ vptr=((& QLayoutItem::_ZTV11QLayoutItem) + 16)
+
+Vtable for QSpacerItem
+QSpacerItem::_ZTV11QSpacerItem: 19 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QSpacerItem)
+16 (int (*)(...))QSpacerItem::~QSpacerItem
+24 (int (*)(...))QSpacerItem::~QSpacerItem
+32 (int (*)(...))QSpacerItem::sizeHint
+40 (int (*)(...))QSpacerItem::minimumSize
+48 (int (*)(...))QSpacerItem::maximumSize
+56 (int (*)(...))QSpacerItem::expandingDirections
+64 (int (*)(...))QSpacerItem::setGeometry
+72 (int (*)(...))QSpacerItem::geometry
+80 (int (*)(...))QSpacerItem::isEmpty
+88 (int (*)(...))QLayoutItem::hasHeightForWidth
+96 (int (*)(...))QLayoutItem::heightForWidth
+104 (int (*)(...))QLayoutItem::minimumHeightForWidth
+112 (int (*)(...))QLayoutItem::invalidate
+120 (int (*)(...))QLayoutItem::widget
+128 (int (*)(...))QLayoutItem::layout
+136 (int (*)(...))QSpacerItem::spacerItem
+144 (int (*)(...))QLayoutItem::controlTypes
+
+Class QSpacerItem
+ size=40 align=8
+ base size=40 base align=8
+QSpacerItem (0x0x7f52716838f0) 0
+ vptr=((& QSpacerItem::_ZTV11QSpacerItem) + 16)
+ QLayoutItem (0x0x7f527172b5a0) 0
+ primary-for QSpacerItem (0x0x7f52716838f0)
+
+Vtable for QWidgetItem
+QWidgetItem::_ZTV11QWidgetItem: 19 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QWidgetItem)
+16 (int (*)(...))QWidgetItem::~QWidgetItem
+24 (int (*)(...))QWidgetItem::~QWidgetItem
+32 (int (*)(...))QWidgetItem::sizeHint
+40 (int (*)(...))QWidgetItem::minimumSize
+48 (int (*)(...))QWidgetItem::maximumSize
+56 (int (*)(...))QWidgetItem::expandingDirections
+64 (int (*)(...))QWidgetItem::setGeometry
+72 (int (*)(...))QWidgetItem::geometry
+80 (int (*)(...))QWidgetItem::isEmpty
+88 (int (*)(...))QWidgetItem::hasHeightForWidth
+96 (int (*)(...))QWidgetItem::heightForWidth
+104 (int (*)(...))QLayoutItem::minimumHeightForWidth
+112 (int (*)(...))QLayoutItem::invalidate
+120 (int (*)(...))QWidgetItem::widget
+128 (int (*)(...))QLayoutItem::layout
+136 (int (*)(...))QLayoutItem::spacerItem
+144 (int (*)(...))QWidgetItem::controlTypes
+
+Class QWidgetItem
+ size=24 align=8
+ base size=24 base align=8
+QWidgetItem (0x0x7f5271683958) 0
+ vptr=((& QWidgetItem::_ZTV11QWidgetItem) + 16)
+ QLayoutItem (0x0x7f527172b7e0) 0
+ primary-for QWidgetItem (0x0x7f5271683958)
+
+Vtable for QWidgetItemV2
+QWidgetItemV2::_ZTV13QWidgetItemV2: 19 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QWidgetItemV2)
+16 (int (*)(...))QWidgetItemV2::~QWidgetItemV2
+24 (int (*)(...))QWidgetItemV2::~QWidgetItemV2
+32 (int (*)(...))QWidgetItemV2::sizeHint
+40 (int (*)(...))QWidgetItemV2::minimumSize
+48 (int (*)(...))QWidgetItemV2::maximumSize
+56 (int (*)(...))QWidgetItem::expandingDirections
+64 (int (*)(...))QWidgetItem::setGeometry
+72 (int (*)(...))QWidgetItem::geometry
+80 (int (*)(...))QWidgetItem::isEmpty
+88 (int (*)(...))QWidgetItem::hasHeightForWidth
+96 (int (*)(...))QWidgetItemV2::heightForWidth
+104 (int (*)(...))QLayoutItem::minimumHeightForWidth
+112 (int (*)(...))QLayoutItem::invalidate
+120 (int (*)(...))QWidgetItem::widget
+128 (int (*)(...))QLayoutItem::layout
+136 (int (*)(...))QLayoutItem::spacerItem
+144 (int (*)(...))QWidgetItem::controlTypes
+
+Class QWidgetItemV2
+ size=88 align=8
+ base size=88 base align=8
+QWidgetItemV2 (0x0x7f52716839c0) 0
+ vptr=((& QWidgetItemV2::_ZTV13QWidgetItemV2) + 16)
+ QWidgetItem (0x0x7f5271683a28) 0
+ primary-for QWidgetItemV2 (0x0x7f52716839c0)
+ QLayoutItem (0x0x7f527172b9c0) 0
+ primary-for QWidgetItem (0x0x7f5271683a28)
+
+Class QLayout::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QLayout::QPrivateSignal (0x0x7f527172bb40) 0 empty
+
+Vtable for QLayout
+QLayout::_ZTV7QLayout: 47 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI7QLayout)
+16 (int (*)(...))QLayout::metaObject
+24 (int (*)(...))QLayout::qt_metacast
+32 (int (*)(...))QLayout::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QLayout::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QLayout::invalidate
+120 (int (*)(...))QLayout::geometry
+128 (int (*)(...))__cxa_pure_virtual
+136 (int (*)(...))QLayout::expandingDirections
+144 (int (*)(...))QLayout::minimumSize
+152 (int (*)(...))QLayout::maximumSize
+160 (int (*)(...))QLayout::setGeometry
+168 (int (*)(...))__cxa_pure_virtual
+176 (int (*)(...))__cxa_pure_virtual
+184 (int (*)(...))QLayout::indexOf
+192 (int (*)(...))__cxa_pure_virtual
+200 (int (*)(...))QLayout::isEmpty
+208 (int (*)(...))QLayout::controlTypes
+216 (int (*)(...))QLayout::layout
+224 (int (*)(...))-16
+232 (int (*)(...))(& _ZTI7QLayout)
+240 0
+248 0
+256 (int (*)(...))__cxa_pure_virtual
+264 (int (*)(...))QLayout::_ZThn16_NK7QLayout11minimumSizeEv
+272 (int (*)(...))QLayout::_ZThn16_NK7QLayout11maximumSizeEv
+280 (int (*)(...))QLayout::_ZThn16_NK7QLayout19expandingDirectionsEv
+288 (int (*)(...))QLayout::_ZThn16_N7QLayout11setGeometryERK5QRect
+296 (int (*)(...))QLayout::_ZThn16_NK7QLayout8geometryEv
+304 (int (*)(...))QLayout::_ZThn16_NK7QLayout7isEmptyEv
+312 (int (*)(...))QLayoutItem::hasHeightForWidth
+320 (int (*)(...))QLayoutItem::heightForWidth
+328 (int (*)(...))QLayoutItem::minimumHeightForWidth
+336 (int (*)(...))QLayout::_ZThn16_N7QLayout10invalidateEv
+344 (int (*)(...))QLayoutItem::widget
+352 (int (*)(...))QLayout::_ZThn16_N7QLayout6layoutEv
+360 (int (*)(...))QLayoutItem::spacerItem
+368 (int (*)(...))QLayout::_ZThn16_NK7QLayout12controlTypesEv
+
+Class QLayout
+ size=32 align=8
+ base size=28 base align=8
+QLayout (0x0x7f5271336700) 0
+ vptr=((& QLayout::_ZTV7QLayout) + 16)
+ QObject (0x0x7f527172ba80) 0
+ primary-for QLayout (0x0x7f5271336700)
+ QLayoutItem (0x0x7f527172bae0) 16
+ vptr=((& QLayout::_ZTV7QLayout) + 240)
+
+Class QGridLayout::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QGridLayout::QPrivateSignal (0x0x7f52713620c0) 0 empty
+
+Vtable for QGridLayout
+QGridLayout::_ZTV11QGridLayout: 51 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QGridLayout)
+16 (int (*)(...))QGridLayout::metaObject
+24 (int (*)(...))QGridLayout::qt_metacast
+32 (int (*)(...))QGridLayout::qt_metacall
+40 (int (*)(...))QGridLayout::~QGridLayout
+48 (int (*)(...))QGridLayout::~QGridLayout
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QLayout::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QGridLayout::invalidate
+120 (int (*)(...))QLayout::geometry
+128 (int (*)(...))QGridLayout::addItem
+136 (int (*)(...))QGridLayout::expandingDirections
+144 (int (*)(...))QGridLayout::minimumSize
+152 (int (*)(...))QGridLayout::maximumSize
+160 (int (*)(...))QGridLayout::setGeometry
+168 (int (*)(...))QGridLayout::itemAt
+176 (int (*)(...))QGridLayout::takeAt
+184 (int (*)(...))QLayout::indexOf
+192 (int (*)(...))QGridLayout::count
+200 (int (*)(...))QLayout::isEmpty
+208 (int (*)(...))QLayout::controlTypes
+216 (int (*)(...))QLayout::layout
+224 (int (*)(...))QGridLayout::sizeHint
+232 (int (*)(...))QGridLayout::hasHeightForWidth
+240 (int (*)(...))QGridLayout::heightForWidth
+248 (int (*)(...))QGridLayout::minimumHeightForWidth
+256 (int (*)(...))-16
+264 (int (*)(...))(& _ZTI11QGridLayout)
+272 (int (*)(...))QGridLayout::_ZThn16_N11QGridLayoutD1Ev
+280 (int (*)(...))QGridLayout::_ZThn16_N11QGridLayoutD0Ev
+288 (int (*)(...))QGridLayout::_ZThn16_NK11QGridLayout8sizeHintEv
+296 (int (*)(...))QGridLayout::_ZThn16_NK11QGridLayout11minimumSizeEv
+304 (int (*)(...))QGridLayout::_ZThn16_NK11QGridLayout11maximumSizeEv
+312 (int (*)(...))QGridLayout::_ZThn16_NK11QGridLayout19expandingDirectionsEv
+320 (int (*)(...))QGridLayout::_ZThn16_N11QGridLayout11setGeometryERK5QRect
+328 (int (*)(...))QLayout::_ZThn16_NK7QLayout8geometryEv
+336 (int (*)(...))QLayout::_ZThn16_NK7QLayout7isEmptyEv
+344 (int (*)(...))QGridLayout::_ZThn16_NK11QGridLayout17hasHeightForWidthEv
+352 (int (*)(...))QGridLayout::_ZThn16_NK11QGridLayout14heightForWidthEi
+360 (int (*)(...))QGridLayout::_ZThn16_NK11QGridLayout21minimumHeightForWidthEi
+368 (int (*)(...))QGridLayout::_ZThn16_N11QGridLayout10invalidateEv
+376 (int (*)(...))QLayoutItem::widget
+384 (int (*)(...))QLayout::_ZThn16_N7QLayout6layoutEv
+392 (int (*)(...))QLayoutItem::spacerItem
+400 (int (*)(...))QLayout::_ZThn16_NK7QLayout12controlTypesEv
+
+Class QGridLayout
+ size=32 align=8
+ base size=28 base align=8
+QGridLayout (0x0x7f5271683a90) 0
+ vptr=((& QGridLayout::_ZTV11QGridLayout) + 16)
+ QLayout (0x0x7f5271336e00) 0
+ primary-for QGridLayout (0x0x7f5271683a90)
+ QObject (0x0x7f5271362000) 0
+ primary-for QLayout (0x0x7f5271336e00)
+ QLayoutItem (0x0x7f5271362060) 16
+ vptr=((& QGridLayout::_ZTV11QGridLayout) + 272)
+
+Class QBoxLayout::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QBoxLayout::QPrivateSignal (0x0x7f52713623c0) 0 empty
+
+Vtable for QBoxLayout
+QBoxLayout::_ZTV10QBoxLayout: 51 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QBoxLayout)
+16 (int (*)(...))QBoxLayout::metaObject
+24 (int (*)(...))QBoxLayout::qt_metacast
+32 (int (*)(...))QBoxLayout::qt_metacall
+40 (int (*)(...))QBoxLayout::~QBoxLayout
+48 (int (*)(...))QBoxLayout::~QBoxLayout
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QLayout::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QBoxLayout::invalidate
+120 (int (*)(...))QLayout::geometry
+128 (int (*)(...))QBoxLayout::addItem
+136 (int (*)(...))QBoxLayout::expandingDirections
+144 (int (*)(...))QBoxLayout::minimumSize
+152 (int (*)(...))QBoxLayout::maximumSize
+160 (int (*)(...))QBoxLayout::setGeometry
+168 (int (*)(...))QBoxLayout::itemAt
+176 (int (*)(...))QBoxLayout::takeAt
+184 (int (*)(...))QLayout::indexOf
+192 (int (*)(...))QBoxLayout::count
+200 (int (*)(...))QLayout::isEmpty
+208 (int (*)(...))QLayout::controlTypes
+216 (int (*)(...))QLayout::layout
+224 (int (*)(...))QBoxLayout::sizeHint
+232 (int (*)(...))QBoxLayout::hasHeightForWidth
+240 (int (*)(...))QBoxLayout::heightForWidth
+248 (int (*)(...))QBoxLayout::minimumHeightForWidth
+256 (int (*)(...))-16
+264 (int (*)(...))(& _ZTI10QBoxLayout)
+272 (int (*)(...))QBoxLayout::_ZThn16_N10QBoxLayoutD1Ev
+280 (int (*)(...))QBoxLayout::_ZThn16_N10QBoxLayoutD0Ev
+288 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout8sizeHintEv
+296 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout11minimumSizeEv
+304 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout11maximumSizeEv
+312 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout19expandingDirectionsEv
+320 (int (*)(...))QBoxLayout::_ZThn16_N10QBoxLayout11setGeometryERK5QRect
+328 (int (*)(...))QLayout::_ZThn16_NK7QLayout8geometryEv
+336 (int (*)(...))QLayout::_ZThn16_NK7QLayout7isEmptyEv
+344 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout17hasHeightForWidthEv
+352 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout14heightForWidthEi
+360 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout21minimumHeightForWidthEi
+368 (int (*)(...))QBoxLayout::_ZThn16_N10QBoxLayout10invalidateEv
+376 (int (*)(...))QLayoutItem::widget
+384 (int (*)(...))QLayout::_ZThn16_N7QLayout6layoutEv
+392 (int (*)(...))QLayoutItem::spacerItem
+400 (int (*)(...))QLayout::_ZThn16_NK7QLayout12controlTypesEv
+
+Class QBoxLayout
+ size=32 align=8
+ base size=28 base align=8
+QBoxLayout (0x0x7f5271683af8) 0
+ vptr=((& QBoxLayout::_ZTV10QBoxLayout) + 16)
+ QLayout (0x0x7f5271336f50) 0
+ primary-for QBoxLayout (0x0x7f5271683af8)
+ QObject (0x0x7f5271362300) 0
+ primary-for QLayout (0x0x7f5271336f50)
+ QLayoutItem (0x0x7f5271362360) 16
+ vptr=((& QBoxLayout::_ZTV10QBoxLayout) + 272)
+
+Class QHBoxLayout::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QHBoxLayout::QPrivateSignal (0x0x7f5271362660) 0 empty
+
+Vtable for QHBoxLayout
+QHBoxLayout::_ZTV11QHBoxLayout: 51 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QHBoxLayout)
+16 (int (*)(...))QHBoxLayout::metaObject
+24 (int (*)(...))QHBoxLayout::qt_metacast
+32 (int (*)(...))QHBoxLayout::qt_metacall
+40 (int (*)(...))QHBoxLayout::~QHBoxLayout
+48 (int (*)(...))QHBoxLayout::~QHBoxLayout
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QLayout::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QBoxLayout::invalidate
+120 (int (*)(...))QLayout::geometry
+128 (int (*)(...))QBoxLayout::addItem
+136 (int (*)(...))QBoxLayout::expandingDirections
+144 (int (*)(...))QBoxLayout::minimumSize
+152 (int (*)(...))QBoxLayout::maximumSize
+160 (int (*)(...))QBoxLayout::setGeometry
+168 (int (*)(...))QBoxLayout::itemAt
+176 (int (*)(...))QBoxLayout::takeAt
+184 (int (*)(...))QLayout::indexOf
+192 (int (*)(...))QBoxLayout::count
+200 (int (*)(...))QLayout::isEmpty
+208 (int (*)(...))QLayout::controlTypes
+216 (int (*)(...))QLayout::layout
+224 (int (*)(...))QBoxLayout::sizeHint
+232 (int (*)(...))QBoxLayout::hasHeightForWidth
+240 (int (*)(...))QBoxLayout::heightForWidth
+248 (int (*)(...))QBoxLayout::minimumHeightForWidth
+256 (int (*)(...))-16
+264 (int (*)(...))(& _ZTI11QHBoxLayout)
+272 (int (*)(...))QHBoxLayout::_ZThn16_N11QHBoxLayoutD1Ev
+280 (int (*)(...))QHBoxLayout::_ZThn16_N11QHBoxLayoutD0Ev
+288 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout8sizeHintEv
+296 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout11minimumSizeEv
+304 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout11maximumSizeEv
+312 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout19expandingDirectionsEv
+320 (int (*)(...))QBoxLayout::_ZThn16_N10QBoxLayout11setGeometryERK5QRect
+328 (int (*)(...))QLayout::_ZThn16_NK7QLayout8geometryEv
+336 (int (*)(...))QLayout::_ZThn16_NK7QLayout7isEmptyEv
+344 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout17hasHeightForWidthEv
+352 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout14heightForWidthEi
+360 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout21minimumHeightForWidthEi
+368 (int (*)(...))QBoxLayout::_ZThn16_N10QBoxLayout10invalidateEv
+376 (int (*)(...))QLayoutItem::widget
+384 (int (*)(...))QLayout::_ZThn16_N7QLayout6layoutEv
+392 (int (*)(...))QLayoutItem::spacerItem
+400 (int (*)(...))QLayout::_ZThn16_NK7QLayout12controlTypesEv
+
+Class QHBoxLayout
+ size=32 align=8
+ base size=28 base align=8
+QHBoxLayout (0x0x7f5271683bc8) 0
+ vptr=((& QHBoxLayout::_ZTV11QHBoxLayout) + 16)
+ QBoxLayout (0x0x7f5271683c30) 0
+ primary-for QHBoxLayout (0x0x7f5271683bc8)
+ QLayout (0x0x7f5271375380) 0
+ primary-for QBoxLayout (0x0x7f5271683c30)
+ QObject (0x0x7f52713625a0) 0
+ primary-for QLayout (0x0x7f5271375380)
+ QLayoutItem (0x0x7f5271362600) 16
+ vptr=((& QHBoxLayout::_ZTV11QHBoxLayout) + 272)
+
+Class QVBoxLayout::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QVBoxLayout::QPrivateSignal (0x0x7f5271362840) 0 empty
+
+Vtable for QVBoxLayout
+QVBoxLayout::_ZTV11QVBoxLayout: 51 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QVBoxLayout)
+16 (int (*)(...))QVBoxLayout::metaObject
+24 (int (*)(...))QVBoxLayout::qt_metacast
+32 (int (*)(...))QVBoxLayout::qt_metacall
+40 (int (*)(...))QVBoxLayout::~QVBoxLayout
+48 (int (*)(...))QVBoxLayout::~QVBoxLayout
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QLayout::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QBoxLayout::invalidate
+120 (int (*)(...))QLayout::geometry
+128 (int (*)(...))QBoxLayout::addItem
+136 (int (*)(...))QBoxLayout::expandingDirections
+144 (int (*)(...))QBoxLayout::minimumSize
+152 (int (*)(...))QBoxLayout::maximumSize
+160 (int (*)(...))QBoxLayout::setGeometry
+168 (int (*)(...))QBoxLayout::itemAt
+176 (int (*)(...))QBoxLayout::takeAt
+184 (int (*)(...))QLayout::indexOf
+192 (int (*)(...))QBoxLayout::count
+200 (int (*)(...))QLayout::isEmpty
+208 (int (*)(...))QLayout::controlTypes
+216 (int (*)(...))QLayout::layout
+224 (int (*)(...))QBoxLayout::sizeHint
+232 (int (*)(...))QBoxLayout::hasHeightForWidth
+240 (int (*)(...))QBoxLayout::heightForWidth
+248 (int (*)(...))QBoxLayout::minimumHeightForWidth
+256 (int (*)(...))-16
+264 (int (*)(...))(& _ZTI11QVBoxLayout)
+272 (int (*)(...))QVBoxLayout::_ZThn16_N11QVBoxLayoutD1Ev
+280 (int (*)(...))QVBoxLayout::_ZThn16_N11QVBoxLayoutD0Ev
+288 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout8sizeHintEv
+296 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout11minimumSizeEv
+304 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout11maximumSizeEv
+312 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout19expandingDirectionsEv
+320 (int (*)(...))QBoxLayout::_ZThn16_N10QBoxLayout11setGeometryERK5QRect
+328 (int (*)(...))QLayout::_ZThn16_NK7QLayout8geometryEv
+336 (int (*)(...))QLayout::_ZThn16_NK7QLayout7isEmptyEv
+344 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout17hasHeightForWidthEv
+352 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout14heightForWidthEi
+360 (int (*)(...))QBoxLayout::_ZThn16_NK10QBoxLayout21minimumHeightForWidthEi
+368 (int (*)(...))QBoxLayout::_ZThn16_N10QBoxLayout10invalidateEv
+376 (int (*)(...))QLayoutItem::widget
+384 (int (*)(...))QLayout::_ZThn16_N7QLayout6layoutEv
+392 (int (*)(...))QLayoutItem::spacerItem
+400 (int (*)(...))QLayout::_ZThn16_NK7QLayout12controlTypesEv
+
+Class QVBoxLayout
+ size=32 align=8
+ base size=28 base align=8
+QVBoxLayout (0x0x7f5271683c98) 0
+ vptr=((& QVBoxLayout::_ZTV11QVBoxLayout) + 16)
+ QBoxLayout (0x0x7f5271683d00) 0
+ primary-for QVBoxLayout (0x0x7f5271683c98)
+ QLayout (0x0x7f52713754d0) 0
+ primary-for QBoxLayout (0x0x7f5271683d00)
+ QObject (0x0x7f5271362780) 0
+ primary-for QLayout (0x0x7f52713754d0)
+ QLayoutItem (0x0x7f52713627e0) 16
+ vptr=((& QVBoxLayout::_ZTV11QVBoxLayout) + 272)
+
+Class QButtonGroup::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QButtonGroup::QPrivateSignal (0x0x7f52713629c0) 0 empty
+
+Vtable for QButtonGroup
+QButtonGroup::_ZTV12QButtonGroup: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QButtonGroup)
+16 (int (*)(...))QButtonGroup::metaObject
+24 (int (*)(...))QButtonGroup::qt_metacast
+32 (int (*)(...))QButtonGroup::qt_metacall
+40 (int (*)(...))QButtonGroup::~QButtonGroup
+48 (int (*)(...))QButtonGroup::~QButtonGroup
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QButtonGroup
+ size=16 align=8
+ base size=16 base align=8
+QButtonGroup (0x0x7f5271683d68) 0
+ vptr=((& QButtonGroup::_ZTV12QButtonGroup) + 16)
+ QObject (0x0x7f5271362960) 0
+ primary-for QButtonGroup (0x0x7f5271683d68)
+
+Class QCalendarWidget::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QCalendarWidget::QPrivateSignal (0x0x7f5271362c60) 0 empty
+
+Vtable for QCalendarWidget
+QCalendarWidget::_ZTV15QCalendarWidget: 65 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QCalendarWidget)
+16 (int (*)(...))QCalendarWidget::metaObject
+24 (int (*)(...))QCalendarWidget::qt_metacast
+32 (int (*)(...))QCalendarWidget::qt_metacall
+40 (int (*)(...))QCalendarWidget::~QCalendarWidget
+48 (int (*)(...))QCalendarWidget::~QCalendarWidget
+56 (int (*)(...))QCalendarWidget::event
+64 (int (*)(...))QCalendarWidget::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QCalendarWidget::sizeHint
+136 (int (*)(...))QCalendarWidget::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QCalendarWidget::mousePressEvent
+176 (int (*)(...))QWidget::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QWidget::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QCalendarWidget::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QWidget::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QCalendarWidget::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QWidget::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QWidget::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QCalendarWidget::paintCell
+440 (int (*)(...))-16
+448 (int (*)(...))(& _ZTI15QCalendarWidget)
+456 (int (*)(...))QCalendarWidget::_ZThn16_N15QCalendarWidgetD1Ev
+464 (int (*)(...))QCalendarWidget::_ZThn16_N15QCalendarWidgetD0Ev
+472 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+480 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+512 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QCalendarWidget
+ size=48 align=8
+ base size=48 base align=8
+QCalendarWidget (0x0x7f5271683dd0) 0
+ vptr=((& QCalendarWidget::_ZTV15QCalendarWidget) + 16)
+ QWidget (0x0x7f5271375700) 0
+ primary-for QCalendarWidget (0x0x7f5271683dd0)
+ QObject (0x0x7f5271362ba0) 0
+ primary-for QWidget (0x0x7f5271375700)
+ QPaintDevice (0x0x7f5271362c00) 16
+ vptr=((& QCalendarWidget::_ZTV15QCalendarWidget) + 456)
+
+Class QCheckBox::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QCheckBox::QPrivateSignal (0x0x7f52713b6180) 0 empty
+
+Vtable for QCheckBox
+QCheckBox::_ZTV9QCheckBox: 67 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QCheckBox)
+16 (int (*)(...))QCheckBox::metaObject
+24 (int (*)(...))QCheckBox::qt_metacast
+32 (int (*)(...))QCheckBox::qt_metacall
+40 (int (*)(...))QCheckBox::~QCheckBox
+48 (int (*)(...))QCheckBox::~QCheckBox
+56 (int (*)(...))QCheckBox::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QAbstractButton::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QCheckBox::sizeHint
+136 (int (*)(...))QCheckBox::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QAbstractButton::mousePressEvent
+176 (int (*)(...))QAbstractButton::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QCheckBox::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QAbstractButton::keyPressEvent
+216 (int (*)(...))QAbstractButton::keyReleaseEvent
+224 (int (*)(...))QAbstractButton::focusInEvent
+232 (int (*)(...))QAbstractButton::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QCheckBox::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QWidget::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QWidget::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QAbstractButton::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QCheckBox::hitButton
+440 (int (*)(...))QCheckBox::checkStateSet
+448 (int (*)(...))QCheckBox::nextCheckState
+456 (int (*)(...))-16
+464 (int (*)(...))(& _ZTI9QCheckBox)
+472 (int (*)(...))QCheckBox::_ZThn16_N9QCheckBoxD1Ev
+480 (int (*)(...))QCheckBox::_ZThn16_N9QCheckBoxD0Ev
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+520 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+528 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QCheckBox
+ size=48 align=8
+ base size=48 base align=8
+QCheckBox (0x0x7f5271683e38) 0
+ vptr=((& QCheckBox::_ZTV9QCheckBox) + 16)
+ QAbstractButton (0x0x7f5271683ea0) 0
+ primary-for QCheckBox (0x0x7f5271683e38)
+ QWidget (0x0x7f5271375bd0) 0
+ primary-for QAbstractButton (0x0x7f5271683ea0)
+ QObject (0x0x7f52713b60c0) 0
+ primary-for QWidget (0x0x7f5271375bd0)
+ QPaintDevice (0x0x7f52713b6120) 16
+ vptr=((& QCheckBox::_ZTV9QCheckBox) + 472)
+
+Class QDialog::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QDialog::QPrivateSignal (0x0x7f52713b6420) 0 empty
+
+Vtable for QDialog
+QDialog::_ZTV7QDialog: 69 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI7QDialog)
+16 (int (*)(...))QDialog::metaObject
+24 (int (*)(...))QDialog::qt_metacast
+32 (int (*)(...))QDialog::qt_metacall
+40 (int (*)(...))QDialog::~QDialog
+48 (int (*)(...))QDialog::~QDialog
+56 (int (*)(...))QWidget::event
+64 (int (*)(...))QDialog::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QDialog::setVisible
+128 (int (*)(...))QDialog::sizeHint
+136 (int (*)(...))QDialog::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QWidget::mousePressEvent
+176 (int (*)(...))QWidget::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QWidget::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QDialog::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QWidget::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QDialog::resizeEvent
+280 (int (*)(...))QDialog::closeEvent
+288 (int (*)(...))QDialog::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QDialog::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QWidget::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QDialog::open
+440 (int (*)(...))QDialog::exec
+448 (int (*)(...))QDialog::done
+456 (int (*)(...))QDialog::accept
+464 (int (*)(...))QDialog::reject
+472 (int (*)(...))-16
+480 (int (*)(...))(& _ZTI7QDialog)
+488 (int (*)(...))QDialog::_ZThn16_N7QDialogD1Ev
+496 (int (*)(...))QDialog::_ZThn16_N7QDialogD0Ev
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+520 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+528 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+536 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+544 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QDialog
+ size=48 align=8
+ base size=48 base align=8
+QDialog (0x0x7f5271683f08) 0
+ vptr=((& QDialog::_ZTV7QDialog) + 16)
+ QWidget (0x0x7f5271375d20) 0
+ primary-for QDialog (0x0x7f5271683f08)
+ QObject (0x0x7f52713b6360) 0
+ primary-for QWidget (0x0x7f5271375d20)
+ QPaintDevice (0x0x7f52713b63c0) 16
+ vptr=((& QDialog::_ZTV7QDialog) + 488)
+
+Class QColorDialog::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QColorDialog::QPrivateSignal (0x0x7f52713b66c0) 0 empty
+
+Vtable for QColorDialog
+QColorDialog::_ZTV12QColorDialog: 69 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QColorDialog)
+16 (int (*)(...))QColorDialog::metaObject
+24 (int (*)(...))QColorDialog::qt_metacast
+32 (int (*)(...))QColorDialog::qt_metacall
+40 (int (*)(...))QColorDialog::~QColorDialog
+48 (int (*)(...))QColorDialog::~QColorDialog
+56 (int (*)(...))QWidget::event
+64 (int (*)(...))QDialog::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QColorDialog::setVisible
+128 (int (*)(...))QDialog::sizeHint
+136 (int (*)(...))QDialog::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QWidget::mousePressEvent
+176 (int (*)(...))QWidget::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QWidget::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QDialog::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QWidget::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QDialog::resizeEvent
+280 (int (*)(...))QDialog::closeEvent
+288 (int (*)(...))QDialog::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QDialog::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QColorDialog::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QDialog::open
+440 (int (*)(...))QDialog::exec
+448 (int (*)(...))QColorDialog::done
+456 (int (*)(...))QDialog::accept
+464 (int (*)(...))QDialog::reject
+472 (int (*)(...))-16
+480 (int (*)(...))(& _ZTI12QColorDialog)
+488 (int (*)(...))QColorDialog::_ZThn16_N12QColorDialogD1Ev
+496 (int (*)(...))QColorDialog::_ZThn16_N12QColorDialogD0Ev
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+520 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+528 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+536 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+544 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QColorDialog
+ size=48 align=8
+ base size=48 base align=8
+QColorDialog (0x0x7f5271683f70) 0
+ vptr=((& QColorDialog::_ZTV12QColorDialog) + 16)
+ QDialog (0x0x7f52713d0000) 0
+ primary-for QColorDialog (0x0x7f5271683f70)
+ QWidget (0x0x7f5271375f50) 0
+ primary-for QDialog (0x0x7f52713d0000)
+ QObject (0x0x7f52713b6600) 0
+ primary-for QWidget (0x0x7f5271375f50)
+ QPaintDevice (0x0x7f52713b6660) 16
+ vptr=((& QColorDialog::_ZTV12QColorDialog) + 488)
+
+Class QColormap
+ size=8 align=8
+ base size=8 base align=8
+QColormap (0x0x7f52713f52a0) 0
+
+Class QColumnView::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QColumnView::QPrivateSignal (0x0x7f52713f53c0) 0 empty
+
+Vtable for QColumnView
+QColumnView::_ZTV11QColumnView: 107 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QColumnView)
+16 (int (*)(...))QColumnView::metaObject
+24 (int (*)(...))QColumnView::qt_metacast
+32 (int (*)(...))QColumnView::qt_metacall
+40 (int (*)(...))QColumnView::~QColumnView
+48 (int (*)(...))QColumnView::~QColumnView
+56 (int (*)(...))QAbstractItemView::event
+64 (int (*)(...))QAbstractItemView::eventFilter
+72 (int (*)(...))QAbstractItemView::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QColumnView::sizeHint
+136 (int (*)(...))QAbstractScrollArea::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QAbstractItemView::mousePressEvent
+176 (int (*)(...))QAbstractItemView::mouseReleaseEvent
+184 (int (*)(...))QAbstractItemView::mouseDoubleClickEvent
+192 (int (*)(...))QAbstractItemView::mouseMoveEvent
+200 (int (*)(...))QAbstractScrollArea::wheelEvent
+208 (int (*)(...))QAbstractItemView::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QAbstractItemView::focusInEvent
+232 (int (*)(...))QAbstractItemView::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QAbstractScrollArea::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QColumnView::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QAbstractScrollArea::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QAbstractItemView::dragEnterEvent
+320 (int (*)(...))QAbstractItemView::dragMoveEvent
+328 (int (*)(...))QAbstractItemView::dragLeaveEvent
+336 (int (*)(...))QAbstractItemView::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QFrame::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QAbstractItemView::inputMethodEvent
+416 (int (*)(...))QAbstractItemView::inputMethodQuery
+424 (int (*)(...))QAbstractItemView::focusNextPrevChild
+432 (int (*)(...))QAbstractScrollArea::setupViewport
+440 (int (*)(...))QAbstractItemView::viewportEvent
+448 (int (*)(...))QColumnView::scrollContentsBy
+456 (int (*)(...))QAbstractItemView::viewportSizeHint
+464 (int (*)(...))QColumnView::setModel
+472 (int (*)(...))QColumnView::setSelectionModel
+480 (int (*)(...))QAbstractItemView::keyboardSearch
+488 (int (*)(...))QColumnView::visualRect
+496 (int (*)(...))QColumnView::scrollTo
+504 (int (*)(...))QColumnView::indexAt
+512 (int (*)(...))QAbstractItemView::sizeHintForRow
+520 (int (*)(...))QAbstractItemView::sizeHintForColumn
+528 (int (*)(...))QAbstractItemView::reset
+536 (int (*)(...))QColumnView::setRootIndex
+544 (int (*)(...))QAbstractItemView::doItemsLayout
+552 (int (*)(...))QColumnView::selectAll
+560 (int (*)(...))QAbstractItemView::dataChanged
+568 (int (*)(...))QColumnView::rowsInserted
+576 (int (*)(...))QAbstractItemView::rowsAboutToBeRemoved
+584 (int (*)(...))QAbstractItemView::selectionChanged
+592 (int (*)(...))QColumnView::currentChanged
+600 (int (*)(...))QAbstractItemView::updateEditorData
+608 (int (*)(...))QAbstractItemView::updateEditorGeometries
+616 (int (*)(...))QAbstractItemView::updateGeometries
+624 (int (*)(...))QAbstractItemView::verticalScrollbarAction
+632 (int (*)(...))QAbstractItemView::horizontalScrollbarAction
+640 (int (*)(...))QAbstractItemView::verticalScrollbarValueChanged
+648 (int (*)(...))QAbstractItemView::horizontalScrollbarValueChanged
+656 (int (*)(...))QAbstractItemView::closeEditor
+664 (int (*)(...))QAbstractItemView::commitData
+672 (int (*)(...))QAbstractItemView::editorDestroyed
+680 (int (*)(...))QColumnView::moveCursor
+688 (int (*)(...))QColumnView::horizontalOffset
+696 (int (*)(...))QColumnView::verticalOffset
+704 (int (*)(...))QColumnView::isIndexHidden
+712 (int (*)(...))QColumnView::setSelection
+720 (int (*)(...))QColumnView::visualRegionForSelection
+728 (int (*)(...))QAbstractItemView::selectedIndexes
+736 (int (*)(...))QAbstractItemView::edit
+744 (int (*)(...))QAbstractItemView::selectionCommand
+752 (int (*)(...))QAbstractItemView::startDrag
+760 (int (*)(...))QAbstractItemView::viewOptions
+768 (int (*)(...))QColumnView::createColumn
+776 (int (*)(...))-16
+784 (int (*)(...))(& _ZTI11QColumnView)
+792 (int (*)(...))QColumnView::_ZThn16_N11QColumnViewD1Ev
+800 (int (*)(...))QColumnView::_ZThn16_N11QColumnViewD0Ev
+808 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+816 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+824 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+832 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+840 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+848 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QColumnView
+ size=48 align=8
+ base size=48 base align=8
+QColumnView (0x0x7f52713d0138) 0
+ vptr=((& QColumnView::_ZTV11QColumnView) + 16)
+ QAbstractItemView (0x0x7f52713d01a0) 0
+ primary-for QColumnView (0x0x7f52713d0138)
+ QAbstractScrollArea (0x0x7f52713d0208) 0
+ primary-for QAbstractItemView (0x0x7f52713d01a0)
+ QFrame (0x0x7f52713d0270) 0
+ primary-for QAbstractScrollArea (0x0x7f52713d0208)
+ QWidget (0x0x7f52713d5d90) 0
+ primary-for QFrame (0x0x7f52713d0270)
+ QObject (0x0x7f52713f5300) 0
+ primary-for QWidget (0x0x7f52713d5d90)
+ QPaintDevice (0x0x7f52713f5360) 16
+ vptr=((& QColumnView::_ZTV11QColumnView) + 792)
+
+Class QComboBox::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QComboBox::QPrivateSignal (0x0x7f52713f5660) 0 empty
+
+Vtable for QComboBox
+QComboBox::_ZTV9QComboBox: 66 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QComboBox)
+16 (int (*)(...))QComboBox::metaObject
+24 (int (*)(...))QComboBox::qt_metacast
+32 (int (*)(...))QComboBox::qt_metacall
+40 (int (*)(...))QComboBox::~QComboBox
+48 (int (*)(...))QComboBox::~QComboBox
+56 (int (*)(...))QComboBox::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QComboBox::sizeHint
+136 (int (*)(...))QComboBox::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QComboBox::mousePressEvent
+176 (int (*)(...))QComboBox::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QWidget::mouseMoveEvent
+200 (int (*)(...))QComboBox::wheelEvent
+208 (int (*)(...))QComboBox::keyPressEvent
+216 (int (*)(...))QComboBox::keyReleaseEvent
+224 (int (*)(...))QComboBox::focusInEvent
+232 (int (*)(...))QComboBox::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QComboBox::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QComboBox::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QComboBox::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QComboBox::showEvent
+352 (int (*)(...))QComboBox::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QComboBox::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QComboBox::inputMethodEvent
+416 (int (*)(...))QComboBox::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QComboBox::showPopup
+440 (int (*)(...))QComboBox::hidePopup
+448 (int (*)(...))-16
+456 (int (*)(...))(& _ZTI9QComboBox)
+464 (int (*)(...))QComboBox::_ZThn16_N9QComboBoxD1Ev
+472 (int (*)(...))QComboBox::_ZThn16_N9QComboBoxD0Ev
+480 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+512 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+520 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QComboBox
+ size=48 align=8
+ base size=48 base align=8
+QComboBox (0x0x7f52713d02d8) 0
+ vptr=((& QComboBox::_ZTV9QComboBox) + 16)
+ QWidget (0x0x7f52713d5e00) 0
+ primary-for QComboBox (0x0x7f52713d02d8)
+ QObject (0x0x7f52713f55a0) 0
+ primary-for QWidget (0x0x7f52713d5e00)
+ QPaintDevice (0x0x7f52713f5600) 16
+ vptr=((& QComboBox::_ZTV9QComboBox) + 464)
+
+Class QPushButton::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QPushButton::QPrivateSignal (0x0x7f52713f5c60) 0 empty
+
+Vtable for QPushButton
+QPushButton::_ZTV11QPushButton: 67 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QPushButton)
+16 (int (*)(...))QPushButton::metaObject
+24 (int (*)(...))QPushButton::qt_metacast
+32 (int (*)(...))QPushButton::qt_metacall
+40 (int (*)(...))QPushButton::~QPushButton
+48 (int (*)(...))QPushButton::~QPushButton
+56 (int (*)(...))QPushButton::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QAbstractButton::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QPushButton::sizeHint
+136 (int (*)(...))QPushButton::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QAbstractButton::mousePressEvent
+176 (int (*)(...))QAbstractButton::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QAbstractButton::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QPushButton::keyPressEvent
+216 (int (*)(...))QAbstractButton::keyReleaseEvent
+224 (int (*)(...))QPushButton::focusInEvent
+232 (int (*)(...))QPushButton::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QPushButton::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QWidget::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QWidget::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QAbstractButton::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QPushButton::hitButton
+440 (int (*)(...))QAbstractButton::checkStateSet
+448 (int (*)(...))QAbstractButton::nextCheckState
+456 (int (*)(...))-16
+464 (int (*)(...))(& _ZTI11QPushButton)
+472 (int (*)(...))QPushButton::_ZThn16_N11QPushButtonD1Ev
+480 (int (*)(...))QPushButton::_ZThn16_N11QPushButtonD0Ev
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+520 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+528 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QPushButton
+ size=48 align=8
+ base size=48 base align=8
+QPushButton (0x0x7f52713d03a8) 0
+ vptr=((& QPushButton::_ZTV11QPushButton) + 16)
+ QAbstractButton (0x0x7f52713d0410) 0
+ primary-for QPushButton (0x0x7f52713d03a8)
+ QWidget (0x0x7f5271412460) 0
+ primary-for QAbstractButton (0x0x7f52713d0410)
+ QObject (0x0x7f52713f5ba0) 0
+ primary-for QWidget (0x0x7f5271412460)
+ QPaintDevice (0x0x7f52713f5c00) 16
+ vptr=((& QPushButton::_ZTV11QPushButton) + 472)
+
+Class QCommandLinkButton::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QCommandLinkButton::QPrivateSignal (0x0x7f52713f5f00) 0 empty
+
+Vtable for QCommandLinkButton
+QCommandLinkButton::_ZTV18QCommandLinkButton: 67 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QCommandLinkButton)
+16 (int (*)(...))QCommandLinkButton::metaObject
+24 (int (*)(...))QCommandLinkButton::qt_metacast
+32 (int (*)(...))QCommandLinkButton::qt_metacall
+40 (int (*)(...))QCommandLinkButton::~QCommandLinkButton
+48 (int (*)(...))QCommandLinkButton::~QCommandLinkButton
+56 (int (*)(...))QCommandLinkButton::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QAbstractButton::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QCommandLinkButton::sizeHint
+136 (int (*)(...))QCommandLinkButton::minimumSizeHint
+144 (int (*)(...))QCommandLinkButton::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QAbstractButton::mousePressEvent
+176 (int (*)(...))QAbstractButton::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QAbstractButton::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QPushButton::keyPressEvent
+216 (int (*)(...))QAbstractButton::keyReleaseEvent
+224 (int (*)(...))QPushButton::focusInEvent
+232 (int (*)(...))QPushButton::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QCommandLinkButton::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QWidget::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QWidget::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QAbstractButton::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QPushButton::hitButton
+440 (int (*)(...))QAbstractButton::checkStateSet
+448 (int (*)(...))QAbstractButton::nextCheckState
+456 (int (*)(...))-16
+464 (int (*)(...))(& _ZTI18QCommandLinkButton)
+472 (int (*)(...))QCommandLinkButton::_ZThn16_N18QCommandLinkButtonD1Ev
+480 (int (*)(...))QCommandLinkButton::_ZThn16_N18QCommandLinkButtonD0Ev
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+520 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+528 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QCommandLinkButton
+ size=48 align=8
+ base size=48 base align=8
+QCommandLinkButton (0x0x7f52713d0478) 0
+ vptr=((& QCommandLinkButton::_ZTV18QCommandLinkButton) + 16)
+ QPushButton (0x0x7f52713d04e0) 0
+ primary-for QCommandLinkButton (0x0x7f52713d0478)
+ QAbstractButton (0x0x7f52713d0548) 0
+ primary-for QPushButton (0x0x7f52713d04e0)
+ QWidget (0x0x7f52714125b0) 0
+ primary-for QAbstractButton (0x0x7f52713d0548)
+ QObject (0x0x7f52713f5e40) 0
+ primary-for QWidget (0x0x7f52714125b0)
+ QPaintDevice (0x0x7f52713f5ea0) 16
+ vptr=((& QCommandLinkButton::_ZTV18QCommandLinkButton) + 472)
+
+Class QCommonStyle::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QCommonStyle::QPrivateSignal (0x0x7f5271446180) 0 empty
+
+Vtable for QCommonStyle
+QCommonStyle::_ZTV12QCommonStyle: 37 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QCommonStyle)
+16 (int (*)(...))QCommonStyle::metaObject
+24 (int (*)(...))QCommonStyle::qt_metacast
+32 (int (*)(...))QCommonStyle::qt_metacall
+40 (int (*)(...))QCommonStyle::~QCommonStyle
+48 (int (*)(...))QCommonStyle::~QCommonStyle
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QCommonStyle::polish
+120 (int (*)(...))QCommonStyle::unpolish
+128 (int (*)(...))QCommonStyle::polish
+136 (int (*)(...))QCommonStyle::unpolish
+144 (int (*)(...))QCommonStyle::polish
+152 (int (*)(...))QStyle::itemTextRect
+160 (int (*)(...))QStyle::itemPixmapRect
+168 (int (*)(...))QStyle::drawItemText
+176 (int (*)(...))QStyle::drawItemPixmap
+184 (int (*)(...))QStyle::standardPalette
+192 (int (*)(...))QCommonStyle::drawPrimitive
+200 (int (*)(...))QCommonStyle::drawControl
+208 (int (*)(...))QCommonStyle::subElementRect
+216 (int (*)(...))QCommonStyle::drawComplexControl
+224 (int (*)(...))QCommonStyle::hitTestComplexControl
+232 (int (*)(...))QCommonStyle::subControlRect
+240 (int (*)(...))QCommonStyle::pixelMetric
+248 (int (*)(...))QCommonStyle::sizeFromContents
+256 (int (*)(...))QCommonStyle::styleHint
+264 (int (*)(...))QCommonStyle::standardPixmap
+272 (int (*)(...))QCommonStyle::standardIcon
+280 (int (*)(...))QCommonStyle::generatedIconPixmap
+288 (int (*)(...))QCommonStyle::layoutSpacing
+
+Class QCommonStyle
+ size=16 align=8
+ base size=16 base align=8
+QCommonStyle (0x0x7f52713d05b0) 0
+ vptr=((& QCommonStyle::_ZTV12QCommonStyle) + 16)
+ QStyle (0x0x7f52713d0618) 0
+ primary-for QCommonStyle (0x0x7f52713d05b0)
+ QObject (0x0x7f5271446120) 0
+ primary-for QStyle (0x0x7f52713d0618)
+
+Class QCompleter::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QCompleter::QPrivateSignal (0x0x7f52714463c0) 0 empty
+
+Vtable for QCompleter
+QCompleter::_ZTV10QCompleter: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QCompleter)
+16 (int (*)(...))QCompleter::metaObject
+24 (int (*)(...))QCompleter::qt_metacast
+32 (int (*)(...))QCompleter::qt_metacall
+40 (int (*)(...))QCompleter::~QCompleter
+48 (int (*)(...))QCompleter::~QCompleter
+56 (int (*)(...))QCompleter::event
+64 (int (*)(...))QCompleter::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QCompleter::pathFromIndex
+120 (int (*)(...))QCompleter::splitPath
+
+Class QCompleter
+ size=16 align=8
+ base size=16 base align=8
+QCompleter (0x0x7f52713d0680) 0
+ vptr=((& QCompleter::_ZTV10QCompleter) + 16)
+ QObject (0x0x7f5271446360) 0
+ primary-for QCompleter (0x0x7f52713d0680)
+
+Class QDataWidgetMapper::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QDataWidgetMapper::QPrivateSignal (0x0x7f5271446780) 0 empty
+
+Vtable for QDataWidgetMapper
+QDataWidgetMapper::_ZTV17QDataWidgetMapper: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QDataWidgetMapper)
+16 (int (*)(...))QDataWidgetMapper::metaObject
+24 (int (*)(...))QDataWidgetMapper::qt_metacast
+32 (int (*)(...))QDataWidgetMapper::qt_metacall
+40 (int (*)(...))QDataWidgetMapper::~QDataWidgetMapper
+48 (int (*)(...))QDataWidgetMapper::~QDataWidgetMapper
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QDataWidgetMapper::setCurrentIndex
+
+Class QDataWidgetMapper
+ size=16 align=8
+ base size=16 base align=8
+QDataWidgetMapper (0x0x7f52713d06e8) 0
+ vptr=((& QDataWidgetMapper::_ZTV17QDataWidgetMapper) + 16)
+ QObject (0x0x7f5271446720) 0
+ primary-for QDataWidgetMapper (0x0x7f52713d06e8)
+
+Class QDateTimeEdit::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QDateTimeEdit::QPrivateSignal (0x0x7f5271446ae0) 0 empty
+
+Vtable for QDateTimeEdit
+QDateTimeEdit::_ZTV13QDateTimeEdit: 71 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QDateTimeEdit)
+16 (int (*)(...))QDateTimeEdit::metaObject
+24 (int (*)(...))QDateTimeEdit::qt_metacast
+32 (int (*)(...))QDateTimeEdit::qt_metacall
+40 (int (*)(...))QDateTimeEdit::~QDateTimeEdit
+48 (int (*)(...))QDateTimeEdit::~QDateTimeEdit
+56 (int (*)(...))QDateTimeEdit::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QAbstractSpinBox::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QDateTimeEdit::sizeHint
+136 (int (*)(...))QAbstractSpinBox::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QDateTimeEdit::mousePressEvent
+176 (int (*)(...))QAbstractSpinBox::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QAbstractSpinBox::mouseMoveEvent
+200 (int (*)(...))QDateTimeEdit::wheelEvent
+208 (int (*)(...))QDateTimeEdit::keyPressEvent
+216 (int (*)(...))QAbstractSpinBox::keyReleaseEvent
+224 (int (*)(...))QDateTimeEdit::focusInEvent
+232 (int (*)(...))QAbstractSpinBox::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QDateTimeEdit::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QAbstractSpinBox::resizeEvent
+280 (int (*)(...))QAbstractSpinBox::closeEvent
+288 (int (*)(...))QAbstractSpinBox::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QAbstractSpinBox::showEvent
+352 (int (*)(...))QAbstractSpinBox::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QAbstractSpinBox::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QAbstractSpinBox::inputMethodQuery
+424 (int (*)(...))QDateTimeEdit::focusNextPrevChild
+432 (int (*)(...))QDateTimeEdit::validate
+440 (int (*)(...))QDateTimeEdit::fixup
+448 (int (*)(...))QDateTimeEdit::stepBy
+456 (int (*)(...))QDateTimeEdit::clear
+464 (int (*)(...))QDateTimeEdit::stepEnabled
+472 (int (*)(...))QDateTimeEdit::dateTimeFromText
+480 (int (*)(...))QDateTimeEdit::textFromDateTime
+488 (int (*)(...))-16
+496 (int (*)(...))(& _ZTI13QDateTimeEdit)
+504 (int (*)(...))QDateTimeEdit::_ZThn16_N13QDateTimeEditD1Ev
+512 (int (*)(...))QDateTimeEdit::_ZThn16_N13QDateTimeEditD0Ev
+520 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+528 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+536 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+544 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+552 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+560 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QDateTimeEdit
+ size=48 align=8
+ base size=48 base align=8
+QDateTimeEdit (0x0x7f52713d0750) 0
+ vptr=((& QDateTimeEdit::_ZTV13QDateTimeEdit) + 16)
+ QAbstractSpinBox (0x0x7f52713d07b8) 0
+ primary-for QDateTimeEdit (0x0x7f52713d0750)
+ QWidget (0x0x7f5271412d90) 0
+ primary-for QAbstractSpinBox (0x0x7f52713d07b8)
+ QObject (0x0x7f5271446a20) 0
+ primary-for QWidget (0x0x7f5271412d90)
+ QPaintDevice (0x0x7f5271446a80) 16
+ vptr=((& QDateTimeEdit::_ZTV13QDateTimeEdit) + 504)
+
+Class QTimeEdit::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTimeEdit::QPrivateSignal (0x0x7f527149f0c0) 0 empty
+
+Vtable for QTimeEdit
+QTimeEdit::_ZTV9QTimeEdit: 71 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QTimeEdit)
+16 (int (*)(...))QTimeEdit::metaObject
+24 (int (*)(...))QTimeEdit::qt_metacast
+32 (int (*)(...))QTimeEdit::qt_metacall
+40 (int (*)(...))QTimeEdit::~QTimeEdit
+48 (int (*)(...))QTimeEdit::~QTimeEdit
+56 (int (*)(...))QDateTimeEdit::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QAbstractSpinBox::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QDateTimeEdit::sizeHint
+136 (int (*)(...))QAbstractSpinBox::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QDateTimeEdit::mousePressEvent
+176 (int (*)(...))QAbstractSpinBox::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QAbstractSpinBox::mouseMoveEvent
+200 (int (*)(...))QDateTimeEdit::wheelEvent
+208 (int (*)(...))QDateTimeEdit::keyPressEvent
+216 (int (*)(...))QAbstractSpinBox::keyReleaseEvent
+224 (int (*)(...))QDateTimeEdit::focusInEvent
+232 (int (*)(...))QAbstractSpinBox::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QDateTimeEdit::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QAbstractSpinBox::resizeEvent
+280 (int (*)(...))QAbstractSpinBox::closeEvent
+288 (int (*)(...))QAbstractSpinBox::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QAbstractSpinBox::showEvent
+352 (int (*)(...))QAbstractSpinBox::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QAbstractSpinBox::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QAbstractSpinBox::inputMethodQuery
+424 (int (*)(...))QDateTimeEdit::focusNextPrevChild
+432 (int (*)(...))QDateTimeEdit::validate
+440 (int (*)(...))QDateTimeEdit::fixup
+448 (int (*)(...))QDateTimeEdit::stepBy
+456 (int (*)(...))QDateTimeEdit::clear
+464 (int (*)(...))QDateTimeEdit::stepEnabled
+472 (int (*)(...))QDateTimeEdit::dateTimeFromText
+480 (int (*)(...))QDateTimeEdit::textFromDateTime
+488 (int (*)(...))-16
+496 (int (*)(...))(& _ZTI9QTimeEdit)
+504 (int (*)(...))QTimeEdit::_ZThn16_N9QTimeEditD1Ev
+512 (int (*)(...))QTimeEdit::_ZThn16_N9QTimeEditD0Ev
+520 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+528 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+536 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+544 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+552 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+560 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QTimeEdit
+ size=48 align=8
+ base size=48 base align=8
+QTimeEdit (0x0x7f52713d08f0) 0
+ vptr=((& QTimeEdit::_ZTV9QTimeEdit) + 16)
+ QDateTimeEdit (0x0x7f52713d0958) 0
+ primary-for QTimeEdit (0x0x7f52713d08f0)
+ QAbstractSpinBox (0x0x7f52713d09c0) 0
+ primary-for QDateTimeEdit (0x0x7f52713d0958)
+ QWidget (0x0x7f52714795b0) 0
+ primary-for QAbstractSpinBox (0x0x7f52713d09c0)
+ QObject (0x0x7f527149f000) 0
+ primary-for QWidget (0x0x7f52714795b0)
+ QPaintDevice (0x0x7f527149f060) 16
+ vptr=((& QTimeEdit::_ZTV9QTimeEdit) + 504)
+
+Class QDateEdit::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QDateEdit::QPrivateSignal (0x0x7f527149f2a0) 0 empty
+
+Vtable for QDateEdit
+QDateEdit::_ZTV9QDateEdit: 71 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QDateEdit)
+16 (int (*)(...))QDateEdit::metaObject
+24 (int (*)(...))QDateEdit::qt_metacast
+32 (int (*)(...))QDateEdit::qt_metacall
+40 (int (*)(...))QDateEdit::~QDateEdit
+48 (int (*)(...))QDateEdit::~QDateEdit
+56 (int (*)(...))QDateTimeEdit::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QAbstractSpinBox::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QDateTimeEdit::sizeHint
+136 (int (*)(...))QAbstractSpinBox::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QDateTimeEdit::mousePressEvent
+176 (int (*)(...))QAbstractSpinBox::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QAbstractSpinBox::mouseMoveEvent
+200 (int (*)(...))QDateTimeEdit::wheelEvent
+208 (int (*)(...))QDateTimeEdit::keyPressEvent
+216 (int (*)(...))QAbstractSpinBox::keyReleaseEvent
+224 (int (*)(...))QDateTimeEdit::focusInEvent
+232 (int (*)(...))QAbstractSpinBox::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QDateTimeEdit::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QAbstractSpinBox::resizeEvent
+280 (int (*)(...))QAbstractSpinBox::closeEvent
+288 (int (*)(...))QAbstractSpinBox::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QAbstractSpinBox::showEvent
+352 (int (*)(...))QAbstractSpinBox::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QAbstractSpinBox::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QAbstractSpinBox::inputMethodQuery
+424 (int (*)(...))QDateTimeEdit::focusNextPrevChild
+432 (int (*)(...))QDateTimeEdit::validate
+440 (int (*)(...))QDateTimeEdit::fixup
+448 (int (*)(...))QDateTimeEdit::stepBy
+456 (int (*)(...))QDateTimeEdit::clear
+464 (int (*)(...))QDateTimeEdit::stepEnabled
+472 (int (*)(...))QDateTimeEdit::dateTimeFromText
+480 (int (*)(...))QDateTimeEdit::textFromDateTime
+488 (int (*)(...))-16
+496 (int (*)(...))(& _ZTI9QDateEdit)
+504 (int (*)(...))QDateEdit::_ZThn16_N9QDateEditD1Ev
+512 (int (*)(...))QDateEdit::_ZThn16_N9QDateEditD0Ev
+520 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+528 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+536 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+544 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+552 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+560 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QDateEdit
+ size=48 align=8
+ base size=48 base align=8
+QDateEdit (0x0x7f52713d0a28) 0
+ vptr=((& QDateEdit::_ZTV9QDateEdit) + 16)
+ QDateTimeEdit (0x0x7f52713d0a90) 0
+ primary-for QDateEdit (0x0x7f52713d0a28)
+ QAbstractSpinBox (0x0x7f52713d0af8) 0
+ primary-for QDateTimeEdit (0x0x7f52713d0a90)
+ QWidget (0x0x7f5271479700) 0
+ primary-for QAbstractSpinBox (0x0x7f52713d0af8)
+ QObject (0x0x7f527149f1e0) 0
+ primary-for QWidget (0x0x7f5271479700)
+ QPaintDevice (0x0x7f527149f240) 16
+ vptr=((& QDateEdit::_ZTV9QDateEdit) + 504)
+
+Class QDesktopWidget::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QDesktopWidget::QPrivateSignal (0x0x7f527149f9c0) 0 empty
+
+Vtable for QDesktopWidget
+QDesktopWidget::_ZTV14QDesktopWidget: 64 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QDesktopWidget)
+16 (int (*)(...))QDesktopWidget::metaObject
+24 (int (*)(...))QDesktopWidget::qt_metacast
+32 (int (*)(...))QDesktopWidget::qt_metacall
+40 (int (*)(...))QDesktopWidget::~QDesktopWidget
+48 (int (*)(...))QDesktopWidget::~QDesktopWidget
+56 (int (*)(...))QWidget::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QWidget::sizeHint
+136 (int (*)(...))QWidget::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QWidget::mousePressEvent
+176 (int (*)(...))QWidget::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QWidget::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QWidget::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QWidget::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QDesktopWidget::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QWidget::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QWidget::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))-16
+440 (int (*)(...))(& _ZTI14QDesktopWidget)
+448 (int (*)(...))QDesktopWidget::_ZThn16_N14QDesktopWidgetD1Ev
+456 (int (*)(...))QDesktopWidget::_ZThn16_N14QDesktopWidgetD0Ev
+464 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+472 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+480 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QDesktopWidget
+ size=48 align=8
+ base size=48 base align=8
+QDesktopWidget (0x0x7f52713d0b60) 0
+ vptr=((& QDesktopWidget::_ZTV14QDesktopWidget) + 16)
+ QWidget (0x0x7f5271479e00) 0
+ primary-for QDesktopWidget (0x0x7f52713d0b60)
+ QObject (0x0x7f527149f900) 0
+ primary-for QWidget (0x0x7f5271479e00)
+ QPaintDevice (0x0x7f527149f960) 16
+ vptr=((& QDesktopWidget::_ZTV14QDesktopWidget) + 448)
+
+Class QDial::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QDial::QPrivateSignal (0x0x7f527149fd80) 0 empty
+
+Vtable for QDial
+QDial::_ZTV5QDial: 65 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI5QDial)
+16 (int (*)(...))QDial::metaObject
+24 (int (*)(...))QDial::qt_metacast
+32 (int (*)(...))QDial::qt_metacall
+40 (int (*)(...))QDial::~QDial
+48 (int (*)(...))QDial::~QDial
+56 (int (*)(...))QDial::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QAbstractSlider::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QDial::sizeHint
+136 (int (*)(...))QDial::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QDial::mousePressEvent
+176 (int (*)(...))QDial::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QDial::mouseMoveEvent
+200 (int (*)(...))QAbstractSlider::wheelEvent
+208 (int (*)(...))QAbstractSlider::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QDial::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QDial::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QWidget::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QAbstractSlider::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QDial::sliderChange
+440 (int (*)(...))-16
+448 (int (*)(...))(& _ZTI5QDial)
+456 (int (*)(...))QDial::_ZThn16_N5QDialD1Ev
+464 (int (*)(...))QDial::_ZThn16_N5QDialD0Ev
+472 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+480 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+512 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QDial
+ size=48 align=8
+ base size=48 base align=8
+QDial (0x0x7f52713d0bc8) 0
+ vptr=((& QDial::_ZTV5QDial) + 16)
+ QAbstractSlider (0x0x7f52713d0c30) 0
+ primary-for QDial (0x0x7f52713d0bc8)
+ QWidget (0x0x7f5271479e70) 0
+ primary-for QAbstractSlider (0x0x7f52713d0c30)
+ QObject (0x0x7f527149fcc0) 0
+ primary-for QWidget (0x0x7f5271479e70)
+ QPaintDevice (0x0x7f527149fd20) 16
+ vptr=((& QDial::_ZTV5QDial) + 456)
+
+Class QDialogButtonBox::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QDialogButtonBox::QPrivateSignal (0x0x7f52714ca060) 0 empty
+
+Vtable for QDialogButtonBox
+QDialogButtonBox::_ZTV16QDialogButtonBox: 64 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QDialogButtonBox)
+16 (int (*)(...))QDialogButtonBox::metaObject
+24 (int (*)(...))QDialogButtonBox::qt_metacast
+32 (int (*)(...))QDialogButtonBox::qt_metacall
+40 (int (*)(...))QDialogButtonBox::~QDialogButtonBox
+48 (int (*)(...))QDialogButtonBox::~QDialogButtonBox
+56 (int (*)(...))QDialogButtonBox::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QWidget::sizeHint
+136 (int (*)(...))QWidget::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QWidget::mousePressEvent
+176 (int (*)(...))QWidget::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QWidget::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QWidget::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QWidget::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QWidget::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QWidget::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QDialogButtonBox::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))-16
+440 (int (*)(...))(& _ZTI16QDialogButtonBox)
+448 (int (*)(...))QDialogButtonBox::_ZThn16_N16QDialogButtonBoxD1Ev
+456 (int (*)(...))QDialogButtonBox::_ZThn16_N16QDialogButtonBoxD0Ev
+464 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+472 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+480 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QDialogButtonBox
+ size=48 align=8
+ base size=48 base align=8
+QDialogButtonBox (0x0x7f52713d0c98) 0
+ vptr=((& QDialogButtonBox::_ZTV16QDialogButtonBox) + 16)
+ QWidget (0x0x7f5271479f50) 0
+ primary-for QDialogButtonBox (0x0x7f52713d0c98)
+ QObject (0x0x7f527149ff60) 0
+ primary-for QWidget (0x0x7f5271479f50)
+ QPaintDevice (0x0x7f52714ca000) 16
+ vptr=((& QDialogButtonBox::_ZTV16QDialogButtonBox) + 448)
+
+Vtable for QFileIconProvider
+QFileIconProvider::_ZTV17QFileIconProvider: 7 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QFileIconProvider)
+16 (int (*)(...))QFileIconProvider::~QFileIconProvider
+24 (int (*)(...))QFileIconProvider::~QFileIconProvider
+32 (int (*)(...))QFileIconProvider::icon
+40 (int (*)(...))QFileIconProvider::icon
+48 (int (*)(...))QFileIconProvider::type
+
+Class QFileIconProvider
+ size=16 align=8
+ base size=16 base align=8
+QFileIconProvider (0x0x7f52714ca9c0) 0
+ vptr=((& QFileIconProvider::_ZTV17QFileIconProvider) + 16)
+
+Class QDirModel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QDirModel::QPrivateSignal (0x0x7f5271513300) 0 empty
+
+Vtable for QDirModel
+QDirModel::_ZTV9QDirModel: 48 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QDirModel)
+16 (int (*)(...))QDirModel::metaObject
+24 (int (*)(...))QDirModel::qt_metacast
+32 (int (*)(...))QDirModel::qt_metacall
+40 (int (*)(...))QDirModel::~QDirModel
+48 (int (*)(...))QDirModel::~QDirModel
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QDirModel::index
+120 (int (*)(...))QDirModel::parent
+128 (int (*)(...))QAbstractItemModel::sibling
+136 (int (*)(...))QDirModel::rowCount
+144 (int (*)(...))QDirModel::columnCount
+152 (int (*)(...))QDirModel::hasChildren
+160 (int (*)(...))QDirModel::data
+168 (int (*)(...))QDirModel::setData
+176 (int (*)(...))QDirModel::headerData
+184 (int (*)(...))QAbstractItemModel::setHeaderData
+192 (int (*)(...))QAbstractItemModel::itemData
+200 (int (*)(...))QAbstractItemModel::setItemData
+208 (int (*)(...))QDirModel::mimeTypes
+216 (int (*)(...))QDirModel::mimeData
+224 (int (*)(...))QAbstractItemModel::canDropMimeData
+232 (int (*)(...))QDirModel::dropMimeData
+240 (int (*)(...))QDirModel::supportedDropActions
+248 (int (*)(...))QAbstractItemModel::supportedDragActions
+256 (int (*)(...))QAbstractItemModel::insertRows
+264 (int (*)(...))QAbstractItemModel::insertColumns
+272 (int (*)(...))QAbstractItemModel::removeRows
+280 (int (*)(...))QAbstractItemModel::removeColumns
+288 (int (*)(...))QAbstractItemModel::moveRows
+296 (int (*)(...))QAbstractItemModel::moveColumns
+304 (int (*)(...))QAbstractItemModel::fetchMore
+312 (int (*)(...))QAbstractItemModel::canFetchMore
+320 (int (*)(...))QDirModel::flags
+328 (int (*)(...))QDirModel::sort
+336 (int (*)(...))QAbstractItemModel::buddy
+344 (int (*)(...))QAbstractItemModel::match
+352 (int (*)(...))QAbstractItemModel::span
+360 (int (*)(...))QAbstractItemModel::roleNames
+368 (int (*)(...))QAbstractItemModel::submit
+376 (int (*)(...))QAbstractItemModel::revert
+
+Class QDirModel
+ size=16 align=8
+ base size=16 base align=8
+QDirModel (0x0x7f52713d0ea0) 0
+ vptr=((& QDirModel::_ZTV9QDirModel) + 16)
+ QAbstractItemModel (0x0x7f52713d0f08) 0
+ primary-for QDirModel (0x0x7f52713d0ea0)
+ QObject (0x0x7f52715132a0) 0
+ primary-for QAbstractItemModel (0x0x7f52713d0f08)
+
+Class QDockWidget::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QDockWidget::QPrivateSignal (0x0x7f52715135a0) 0 empty
+
+Vtable for QDockWidget
+QDockWidget::_ZTV11QDockWidget: 64 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QDockWidget)
+16 (int (*)(...))QDockWidget::metaObject
+24 (int (*)(...))QDockWidget::qt_metacast
+32 (int (*)(...))QDockWidget::qt_metacall
+40 (int (*)(...))QDockWidget::~QDockWidget
+48 (int (*)(...))QDockWidget::~QDockWidget
+56 (int (*)(...))QDockWidget::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QWidget::sizeHint
+136 (int (*)(...))QWidget::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QWidget::mousePressEvent
+176 (int (*)(...))QWidget::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QWidget::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QWidget::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QDockWidget::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QWidget::resizeEvent
+280 (int (*)(...))QDockWidget::closeEvent
+288 (int (*)(...))QWidget::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QDockWidget::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))-16
+440 (int (*)(...))(& _ZTI11QDockWidget)
+448 (int (*)(...))QDockWidget::_ZThn16_N11QDockWidgetD1Ev
+456 (int (*)(...))QDockWidget::_ZThn16_N11QDockWidgetD0Ev
+464 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+472 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+480 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QDockWidget
+ size=48 align=8
+ base size=48 base align=8
+QDockWidget (0x0x7f52713d0f70) 0
+ vptr=((& QDockWidget::_ZTV11QDockWidget) + 16)
+ QWidget (0x0x7f5271512540) 0
+ primary-for QDockWidget (0x0x7f52713d0f70)
+ QObject (0x0x7f52715134e0) 0
+ primary-for QWidget (0x0x7f5271512540)
+ QPaintDevice (0x0x7f5271513540) 16
+ vptr=((& QDockWidget::_ZTV11QDockWidget) + 448)
+
+Class QTileRules
+ size=8 align=4
+ base size=8 base align=4
+QTileRules (0x0x7f5271153480) 0
+
+Class QErrorMessage::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QErrorMessage::QPrivateSignal (0x0x7f5271153c60) 0 empty
+
+Vtable for QErrorMessage
+QErrorMessage::_ZTV13QErrorMessage: 69 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QErrorMessage)
+16 (int (*)(...))QErrorMessage::metaObject
+24 (int (*)(...))QErrorMessage::qt_metacast
+32 (int (*)(...))QErrorMessage::qt_metacall
+40 (int (*)(...))QErrorMessage::~QErrorMessage
+48 (int (*)(...))QErrorMessage::~QErrorMessage
+56 (int (*)(...))QWidget::event
+64 (int (*)(...))QDialog::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QDialog::setVisible
+128 (int (*)(...))QDialog::sizeHint
+136 (int (*)(...))QDialog::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QWidget::mousePressEvent
+176 (int (*)(...))QWidget::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QWidget::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QDialog::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QWidget::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QDialog::resizeEvent
+280 (int (*)(...))QDialog::closeEvent
+288 (int (*)(...))QDialog::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QDialog::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QErrorMessage::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QDialog::open
+440 (int (*)(...))QDialog::exec
+448 (int (*)(...))QErrorMessage::done
+456 (int (*)(...))QDialog::accept
+464 (int (*)(...))QDialog::reject
+472 (int (*)(...))-16
+480 (int (*)(...))(& _ZTI13QErrorMessage)
+488 (int (*)(...))QErrorMessage::_ZThn16_N13QErrorMessageD1Ev
+496 (int (*)(...))QErrorMessage::_ZThn16_N13QErrorMessageD0Ev
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+520 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+528 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+536 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+544 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QErrorMessage
+ size=48 align=8
+ base size=48 base align=8
+QErrorMessage (0x0x7f527113b680) 0
+ vptr=((& QErrorMessage::_ZTV13QErrorMessage) + 16)
+ QDialog (0x0x7f527113b6e8) 0
+ primary-for QErrorMessage (0x0x7f527113b680)
+ QWidget (0x0x7f5271174150) 0
+ primary-for QDialog (0x0x7f527113b6e8)
+ QObject (0x0x7f5271153ba0) 0
+ primary-for QWidget (0x0x7f5271174150)
+ QPaintDevice (0x0x7f5271153c00) 16
+ vptr=((& QErrorMessage::_ZTV13QErrorMessage) + 488)
+
+Class QFileDialog::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QFileDialog::QPrivateSignal (0x0x7f5271153f00) 0 empty
+
+Vtable for QFileDialog
+QFileDialog::_ZTV11QFileDialog: 69 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QFileDialog)
+16 (int (*)(...))QFileDialog::metaObject
+24 (int (*)(...))QFileDialog::qt_metacast
+32 (int (*)(...))QFileDialog::qt_metacall
+40 (int (*)(...))QFileDialog::~QFileDialog
+48 (int (*)(...))QFileDialog::~QFileDialog
+56 (int (*)(...))QWidget::event
+64 (int (*)(...))QDialog::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QFileDialog::setVisible
+128 (int (*)(...))QDialog::sizeHint
+136 (int (*)(...))QDialog::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QWidget::mousePressEvent
+176 (int (*)(...))QWidget::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QWidget::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QDialog::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QWidget::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QDialog::resizeEvent
+280 (int (*)(...))QDialog::closeEvent
+288 (int (*)(...))QDialog::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QDialog::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QFileDialog::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QDialog::open
+440 (int (*)(...))QDialog::exec
+448 (int (*)(...))QFileDialog::done
+456 (int (*)(...))QFileDialog::accept
+464 (int (*)(...))QDialog::reject
+472 (int (*)(...))-16
+480 (int (*)(...))(& _ZTI11QFileDialog)
+488 (int (*)(...))QFileDialog::_ZThn16_N11QFileDialogD1Ev
+496 (int (*)(...))QFileDialog::_ZThn16_N11QFileDialogD0Ev
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+520 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+528 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+536 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+544 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QFileDialog
+ size=48 align=8
+ base size=48 base align=8
+QFileDialog (0x0x7f527113b750) 0
+ vptr=((& QFileDialog::_ZTV11QFileDialog) + 16)
+ QDialog (0x0x7f527113b7b8) 0
+ primary-for QFileDialog (0x0x7f527113b750)
+ QWidget (0x0x7f52711742a0) 0
+ primary-for QDialog (0x0x7f527113b7b8)
+ QObject (0x0x7f5271153e40) 0
+ primary-for QWidget (0x0x7f52711742a0)
+ QPaintDevice (0x0x7f5271153ea0) 16
+ vptr=((& QFileDialog::_ZTV11QFileDialog) + 488)
+
+Class QFileSystemModel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QFileSystemModel::QPrivateSignal (0x0x7f527119ce40) 0 empty
+
+Vtable for QFileSystemModel
+QFileSystemModel::_ZTV16QFileSystemModel: 48 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QFileSystemModel)
+16 (int (*)(...))QFileSystemModel::metaObject
+24 (int (*)(...))QFileSystemModel::qt_metacast
+32 (int (*)(...))QFileSystemModel::qt_metacall
+40 (int (*)(...))QFileSystemModel::~QFileSystemModel
+48 (int (*)(...))QFileSystemModel::~QFileSystemModel
+56 (int (*)(...))QFileSystemModel::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QFileSystemModel::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QFileSystemModel::index
+120 (int (*)(...))QFileSystemModel::parent
+128 (int (*)(...))QFileSystemModel::sibling
+136 (int (*)(...))QFileSystemModel::rowCount
+144 (int (*)(...))QFileSystemModel::columnCount
+152 (int (*)(...))QFileSystemModel::hasChildren
+160 (int (*)(...))QFileSystemModel::data
+168 (int (*)(...))QFileSystemModel::setData
+176 (int (*)(...))QFileSystemModel::headerData
+184 (int (*)(...))QAbstractItemModel::setHeaderData
+192 (int (*)(...))QAbstractItemModel::itemData
+200 (int (*)(...))QAbstractItemModel::setItemData
+208 (int (*)(...))QFileSystemModel::mimeTypes
+216 (int (*)(...))QFileSystemModel::mimeData
+224 (int (*)(...))QAbstractItemModel::canDropMimeData
+232 (int (*)(...))QFileSystemModel::dropMimeData
+240 (int (*)(...))QFileSystemModel::supportedDropActions
+248 (int (*)(...))QAbstractItemModel::supportedDragActions
+256 (int (*)(...))QAbstractItemModel::insertRows
+264 (int (*)(...))QAbstractItemModel::insertColumns
+272 (int (*)(...))QAbstractItemModel::removeRows
+280 (int (*)(...))QAbstractItemModel::removeColumns
+288 (int (*)(...))QAbstractItemModel::moveRows
+296 (int (*)(...))QAbstractItemModel::moveColumns
+304 (int (*)(...))QFileSystemModel::fetchMore
+312 (int (*)(...))QFileSystemModel::canFetchMore
+320 (int (*)(...))QFileSystemModel::flags
+328 (int (*)(...))QFileSystemModel::sort
+336 (int (*)(...))QAbstractItemModel::buddy
+344 (int (*)(...))QAbstractItemModel::match
+352 (int (*)(...))QAbstractItemModel::span
+360 (int (*)(...))QAbstractItemModel::roleNames
+368 (int (*)(...))QAbstractItemModel::submit
+376 (int (*)(...))QAbstractItemModel::revert
+
+Class QFileSystemModel
+ size=16 align=8
+ base size=16 base align=8
+QFileSystemModel (0x0x7f527113b8f0) 0
+ vptr=((& QFileSystemModel::_ZTV16QFileSystemModel) + 16)
+ QAbstractItemModel (0x0x7f527113b958) 0
+ primary-for QFileSystemModel (0x0x7f527113b8f0)
+ QObject (0x0x7f527119cde0) 0
+ primary-for QAbstractItemModel (0x0x7f527113b958)
+
+Class QFocusFrame::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QFocusFrame::QPrivateSignal (0x0x7f52711cf960) 0 empty
+
+Vtable for QFocusFrame
+QFocusFrame::_ZTV11QFocusFrame: 64 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QFocusFrame)
+16 (int (*)(...))QFocusFrame::metaObject
+24 (int (*)(...))QFocusFrame::qt_metacast
+32 (int (*)(...))QFocusFrame::qt_metacall
+40 (int (*)(...))QFocusFrame::~QFocusFrame
+48 (int (*)(...))QFocusFrame::~QFocusFrame
+56 (int (*)(...))QFocusFrame::event
+64 (int (*)(...))QFocusFrame::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QWidget::sizeHint
+136 (int (*)(...))QWidget::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QWidget::mousePressEvent
+176 (int (*)(...))QWidget::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QWidget::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QWidget::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QFocusFrame::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QWidget::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QWidget::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QWidget::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))-16
+440 (int (*)(...))(& _ZTI11QFocusFrame)
+448 (int (*)(...))QFocusFrame::_ZThn16_N11QFocusFrameD1Ev
+456 (int (*)(...))QFocusFrame::_ZThn16_N11QFocusFrameD0Ev
+464 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+472 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+480 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QFocusFrame
+ size=48 align=8
+ base size=48 base align=8
+QFocusFrame (0x0x7f527113ba90) 0
+ vptr=((& QFocusFrame::_ZTV11QFocusFrame) + 16)
+ QWidget (0x0x7f52711e4310) 0
+ primary-for QFocusFrame (0x0x7f527113ba90)
+ QObject (0x0x7f52711cf8a0) 0
+ primary-for QWidget (0x0x7f52711e4310)
+ QPaintDevice (0x0x7f52711cf900) 16
+ vptr=((& QFocusFrame::_ZTV11QFocusFrame) + 448)
+
+Class QFontComboBox::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QFontComboBox::QPrivateSignal (0x0x7f52711cfc00) 0 empty
+
+Vtable for QFontComboBox
+QFontComboBox::_ZTV13QFontComboBox: 66 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QFontComboBox)
+16 (int (*)(...))QFontComboBox::metaObject
+24 (int (*)(...))QFontComboBox::qt_metacast
+32 (int (*)(...))QFontComboBox::qt_metacall
+40 (int (*)(...))QFontComboBox::~QFontComboBox
+48 (int (*)(...))QFontComboBox::~QFontComboBox
+56 (int (*)(...))QFontComboBox::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QFontComboBox::sizeHint
+136 (int (*)(...))QComboBox::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QComboBox::mousePressEvent
+176 (int (*)(...))QComboBox::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QWidget::mouseMoveEvent
+200 (int (*)(...))QComboBox::wheelEvent
+208 (int (*)(...))QComboBox::keyPressEvent
+216 (int (*)(...))QComboBox::keyReleaseEvent
+224 (int (*)(...))QComboBox::focusInEvent
+232 (int (*)(...))QComboBox::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QComboBox::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QComboBox::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QComboBox::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QComboBox::showEvent
+352 (int (*)(...))QComboBox::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QComboBox::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QComboBox::inputMethodEvent
+416 (int (*)(...))QComboBox::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QComboBox::showPopup
+440 (int (*)(...))QComboBox::hidePopup
+448 (int (*)(...))-16
+456 (int (*)(...))(& _ZTI13QFontComboBox)
+464 (int (*)(...))QFontComboBox::_ZThn16_N13QFontComboBoxD1Ev
+472 (int (*)(...))QFontComboBox::_ZThn16_N13QFontComboBoxD0Ev
+480 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+512 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+520 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QFontComboBox
+ size=48 align=8
+ base size=48 base align=8
+QFontComboBox (0x0x7f527113baf8) 0
+ vptr=((& QFontComboBox::_ZTV13QFontComboBox) + 16)
+ QComboBox (0x0x7f527113bb60) 0
+ primary-for QFontComboBox (0x0x7f527113baf8)
+ QWidget (0x0x7f52711e4380) 0
+ primary-for QComboBox (0x0x7f527113bb60)
+ QObject (0x0x7f52711cfb40) 0
+ primary-for QWidget (0x0x7f52711e4380)
+ QPaintDevice (0x0x7f52711cfba0) 16
+ vptr=((& QFontComboBox::_ZTV13QFontComboBox) + 464)
+
+Class QFontDialog::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QFontDialog::QPrivateSignal (0x0x7f5271207660) 0 empty
+
+Vtable for QFontDialog
+QFontDialog::_ZTV11QFontDialog: 69 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QFontDialog)
+16 (int (*)(...))QFontDialog::metaObject
+24 (int (*)(...))QFontDialog::qt_metacast
+32 (int (*)(...))QFontDialog::qt_metacall
+40 (int (*)(...))QFontDialog::~QFontDialog
+48 (int (*)(...))QFontDialog::~QFontDialog
+56 (int (*)(...))QWidget::event
+64 (int (*)(...))QFontDialog::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QFontDialog::setVisible
+128 (int (*)(...))QDialog::sizeHint
+136 (int (*)(...))QDialog::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QWidget::mousePressEvent
+176 (int (*)(...))QWidget::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QWidget::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QDialog::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QWidget::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QDialog::resizeEvent
+280 (int (*)(...))QDialog::closeEvent
+288 (int (*)(...))QDialog::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QDialog::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QFontDialog::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QDialog::open
+440 (int (*)(...))QDialog::exec
+448 (int (*)(...))QFontDialog::done
+456 (int (*)(...))QDialog::accept
+464 (int (*)(...))QDialog::reject
+472 (int (*)(...))-16
+480 (int (*)(...))(& _ZTI11QFontDialog)
+488 (int (*)(...))QFontDialog::_ZThn16_N11QFontDialogD1Ev
+496 (int (*)(...))QFontDialog::_ZThn16_N11QFontDialogD0Ev
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+520 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+528 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+536 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+544 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QFontDialog
+ size=48 align=8
+ base size=48 base align=8
+QFontDialog (0x0x7f527113bd00) 0
+ vptr=((& QFontDialog::_ZTV11QFontDialog) + 16)
+ QDialog (0x0x7f527113bd68) 0
+ primary-for QFontDialog (0x0x7f527113bd00)
+ QWidget (0x0x7f52711e4e00) 0
+ primary-for QDialog (0x0x7f527113bd68)
+ QObject (0x0x7f52712075a0) 0
+ primary-for QWidget (0x0x7f52711e4e00)
+ QPaintDevice (0x0x7f5271207600) 16
+ vptr=((& QFontDialog::_ZTV11QFontDialog) + 488)
+
+Class QFormLayout::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QFormLayout::QPrivateSignal (0x0x7f52712342a0) 0 empty
+
+Class QFormLayout::TakeRowResult
+ size=16 align=8
+ base size=16 base align=8
+QFormLayout::TakeRowResult (0x0x7f5271234300) 0
+
+Vtable for QFormLayout
+QFormLayout::_ZTV11QFormLayout: 50 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QFormLayout)
+16 (int (*)(...))QFormLayout::metaObject
+24 (int (*)(...))QFormLayout::qt_metacast
+32 (int (*)(...))QFormLayout::qt_metacall
+40 (int (*)(...))QFormLayout::~QFormLayout
+48 (int (*)(...))QFormLayout::~QFormLayout
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QLayout::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QFormLayout::invalidate
+120 (int (*)(...))QLayout::geometry
+128 (int (*)(...))QFormLayout::addItem
+136 (int (*)(...))QFormLayout::expandingDirections
+144 (int (*)(...))QFormLayout::minimumSize
+152 (int (*)(...))QLayout::maximumSize
+160 (int (*)(...))QFormLayout::setGeometry
+168 (int (*)(...))QFormLayout::itemAt
+176 (int (*)(...))QFormLayout::takeAt
+184 (int (*)(...))QLayout::indexOf
+192 (int (*)(...))QFormLayout::count
+200 (int (*)(...))QLayout::isEmpty
+208 (int (*)(...))QLayout::controlTypes
+216 (int (*)(...))QLayout::layout
+224 (int (*)(...))QFormLayout::sizeHint
+232 (int (*)(...))QFormLayout::hasHeightForWidth
+240 (int (*)(...))QFormLayout::heightForWidth
+248 (int (*)(...))-16
+256 (int (*)(...))(& _ZTI11QFormLayout)
+264 (int (*)(...))QFormLayout::_ZThn16_N11QFormLayoutD1Ev
+272 (int (*)(...))QFormLayout::_ZThn16_N11QFormLayoutD0Ev
+280 (int (*)(...))QFormLayout::_ZThn16_NK11QFormLayout8sizeHintEv
+288 (int (*)(...))QFormLayout::_ZThn16_NK11QFormLayout11minimumSizeEv
+296 (int (*)(...))QLayout::_ZThn16_NK7QLayout11maximumSizeEv
+304 (int (*)(...))QFormLayout::_ZThn16_NK11QFormLayout19expandingDirectionsEv
+312 (int (*)(...))QFormLayout::_ZThn16_N11QFormLayout11setGeometryERK5QRect
+320 (int (*)(...))QLayout::_ZThn16_NK7QLayout8geometryEv
+328 (int (*)(...))QLayout::_ZThn16_NK7QLayout7isEmptyEv
+336 (int (*)(...))QFormLayout::_ZThn16_NK11QFormLayout17hasHeightForWidthEv
+344 (int (*)(...))QFormLayout::_ZThn16_NK11QFormLayout14heightForWidthEi
+352 (int (*)(...))QLayoutItem::minimumHeightForWidth
+360 (int (*)(...))QFormLayout::_ZThn16_N11QFormLayout10invalidateEv
+368 (int (*)(...))QLayoutItem::widget
+376 (int (*)(...))QLayout::_ZThn16_N7QLayout6layoutEv
+384 (int (*)(...))QLayoutItem::spacerItem
+392 (int (*)(...))QLayout::_ZThn16_NK7QLayout12controlTypesEv
+
+Class QFormLayout
+ size=32 align=8
+ base size=28 base align=8
+QFormLayout (0x0x7f527113bea0) 0
+ vptr=((& QFormLayout::_ZTV11QFormLayout) + 16)
+ QLayout (0x0x7f5271212af0) 0
+ primary-for QFormLayout (0x0x7f527113bea0)
+ QObject (0x0x7f52712341e0) 0
+ primary-for QLayout (0x0x7f5271212af0)
+ QLayoutItem (0x0x7f5271234240) 16
+ vptr=((& QFormLayout::_ZTV11QFormLayout) + 264)
+
+Class QGesture::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QGesture::QPrivateSignal (0x0x7f5271271720) 0 empty
+
+Vtable for QGesture
+QGesture::_ZTV8QGesture: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI8QGesture)
+16 (int (*)(...))QGesture::metaObject
+24 (int (*)(...))QGesture::qt_metacast
+32 (int (*)(...))QGesture::qt_metacall
+40 (int (*)(...))QGesture::~QGesture
+48 (int (*)(...))QGesture::~QGesture
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QGesture
+ size=16 align=8
+ base size=16 base align=8
+QGesture (0x0x7f5271273208) 0
+ vptr=((& QGesture::_ZTV8QGesture) + 16)
+ QObject (0x0x7f52712716c0) 0
+ primary-for QGesture (0x0x7f5271273208)
+
+Class QPanGesture::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QPanGesture::QPrivateSignal (0x0x7f5271271960) 0 empty
+
+Vtable for QPanGesture
+QPanGesture::_ZTV11QPanGesture: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QPanGesture)
+16 (int (*)(...))QPanGesture::metaObject
+24 (int (*)(...))QPanGesture::qt_metacast
+32 (int (*)(...))QPanGesture::qt_metacall
+40 (int (*)(...))QPanGesture::~QPanGesture
+48 (int (*)(...))QPanGesture::~QPanGesture
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QPanGesture
+ size=16 align=8
+ base size=16 base align=8
+QPanGesture (0x0x7f5271273270) 0
+ vptr=((& QPanGesture::_ZTV11QPanGesture) + 16)
+ QGesture (0x0x7f52712732d8) 0
+ primary-for QPanGesture (0x0x7f5271273270)
+ QObject (0x0x7f5271271900) 0
+ primary-for QGesture (0x0x7f52712732d8)
+
+Class QPinchGesture::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QPinchGesture::QPrivateSignal (0x0x7f5271271ba0) 0 empty
+
+Vtable for QPinchGesture
+QPinchGesture::_ZTV13QPinchGesture: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QPinchGesture)
+16 (int (*)(...))QPinchGesture::metaObject
+24 (int (*)(...))QPinchGesture::qt_metacast
+32 (int (*)(...))QPinchGesture::qt_metacall
+40 (int (*)(...))QPinchGesture::~QPinchGesture
+48 (int (*)(...))QPinchGesture::~QPinchGesture
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QPinchGesture
+ size=16 align=8
+ base size=16 base align=8
+QPinchGesture (0x0x7f5271273340) 0
+ vptr=((& QPinchGesture::_ZTV13QPinchGesture) + 16)
+ QGesture (0x0x7f52712733a8) 0
+ primary-for QPinchGesture (0x0x7f5271273340)
+ QObject (0x0x7f5271271b40) 0
+ primary-for QGesture (0x0x7f52712733a8)
+
+Class QSwipeGesture::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSwipeGesture::QPrivateSignal (0x0x7f52712ac840) 0 empty
+
+Vtable for QSwipeGesture
+QSwipeGesture::_ZTV13QSwipeGesture: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QSwipeGesture)
+16 (int (*)(...))QSwipeGesture::metaObject
+24 (int (*)(...))QSwipeGesture::qt_metacast
+32 (int (*)(...))QSwipeGesture::qt_metacall
+40 (int (*)(...))QSwipeGesture::~QSwipeGesture
+48 (int (*)(...))QSwipeGesture::~QSwipeGesture
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QSwipeGesture
+ size=16 align=8
+ base size=16 base align=8
+QSwipeGesture (0x0x7f52712734e0) 0
+ vptr=((& QSwipeGesture::_ZTV13QSwipeGesture) + 16)
+ QGesture (0x0x7f5271273548) 0
+ primary-for QSwipeGesture (0x0x7f52712734e0)
+ QObject (0x0x7f52712ac7e0) 0
+ primary-for QGesture (0x0x7f5271273548)
+
+Class QTapGesture::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTapGesture::QPrivateSignal (0x0x7f52712acba0) 0 empty
+
+Vtable for QTapGesture
+QTapGesture::_ZTV11QTapGesture: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QTapGesture)
+16 (int (*)(...))QTapGesture::metaObject
+24 (int (*)(...))QTapGesture::qt_metacast
+32 (int (*)(...))QTapGesture::qt_metacall
+40 (int (*)(...))QTapGesture::~QTapGesture
+48 (int (*)(...))QTapGesture::~QTapGesture
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QTapGesture
+ size=16 align=8
+ base size=16 base align=8
+QTapGesture (0x0x7f52712735b0) 0
+ vptr=((& QTapGesture::_ZTV11QTapGesture) + 16)
+ QGesture (0x0x7f5271273618) 0
+ primary-for QTapGesture (0x0x7f52712735b0)
+ QObject (0x0x7f52712acb40) 0
+ primary-for QGesture (0x0x7f5271273618)
+
+Class QTapAndHoldGesture::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTapAndHoldGesture::QPrivateSignal (0x0x7f52712acde0) 0 empty
+
+Vtable for QTapAndHoldGesture
+QTapAndHoldGesture::_ZTV18QTapAndHoldGesture: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QTapAndHoldGesture)
+16 (int (*)(...))QTapAndHoldGesture::metaObject
+24 (int (*)(...))QTapAndHoldGesture::qt_metacast
+32 (int (*)(...))QTapAndHoldGesture::qt_metacall
+40 (int (*)(...))QTapAndHoldGesture::~QTapAndHoldGesture
+48 (int (*)(...))QTapAndHoldGesture::~QTapAndHoldGesture
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QTapAndHoldGesture
+ size=16 align=8
+ base size=16 base align=8
+QTapAndHoldGesture (0x0x7f5271273680) 0
+ vptr=((& QTapAndHoldGesture::_ZTV18QTapAndHoldGesture) + 16)
+ QGesture (0x0x7f52712736e8) 0
+ primary-for QTapAndHoldGesture (0x0x7f5271273680)
+ QObject (0x0x7f52712acd80) 0
+ primary-for QGesture (0x0x7f52712736e8)
+
+Vtable for QGestureEvent
+QGestureEvent::_ZTV13QGestureEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QGestureEvent)
+16 (int (*)(...))QGestureEvent::~QGestureEvent
+24 (int (*)(...))QGestureEvent::~QGestureEvent
+
+Class QGestureEvent
+ size=56 align=8
+ base size=56 base align=8
+QGestureEvent (0x0x7f5271273750) 0
+ vptr=((& QGestureEvent::_ZTV13QGestureEvent) + 16)
+ QEvent (0x0x7f52712ce000) 0
+ primary-for QGestureEvent (0x0x7f5271273750)
+
+Vtable for QGestureRecognizer
+QGestureRecognizer::_ZTV18QGestureRecognizer: 7 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QGestureRecognizer)
+16 0
+24 0
+32 (int (*)(...))QGestureRecognizer::create
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))QGestureRecognizer::reset
+
+Class QGestureRecognizer
+ size=8 align=8
+ base size=8 base align=8
+QGestureRecognizer (0x0x7f52712ce480) 0 nearly-empty
+ vptr=((& QGestureRecognizer::_ZTV18QGestureRecognizer) + 16)
+
+Vtable for QGraphicsItem
+QGraphicsItem::_ZTV13QGraphicsItem: 39 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QGraphicsItem)
+16 0
+24 0
+32 (int (*)(...))QGraphicsItem::advance
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))QGraphicsItem::shape
+56 (int (*)(...))QGraphicsItem::contains
+64 (int (*)(...))QGraphicsItem::collidesWithItem
+72 (int (*)(...))QGraphicsItem::collidesWithPath
+80 (int (*)(...))QGraphicsItem::isObscuredBy
+88 (int (*)(...))QGraphicsItem::opaqueArea
+96 (int (*)(...))__cxa_pure_virtual
+104 (int (*)(...))QGraphicsItem::type
+112 (int (*)(...))QGraphicsItem::sceneEventFilter
+120 (int (*)(...))QGraphicsItem::sceneEvent
+128 (int (*)(...))QGraphicsItem::contextMenuEvent
+136 (int (*)(...))QGraphicsItem::dragEnterEvent
+144 (int (*)(...))QGraphicsItem::dragLeaveEvent
+152 (int (*)(...))QGraphicsItem::dragMoveEvent
+160 (int (*)(...))QGraphicsItem::dropEvent
+168 (int (*)(...))QGraphicsItem::focusInEvent
+176 (int (*)(...))QGraphicsItem::focusOutEvent
+184 (int (*)(...))QGraphicsItem::hoverEnterEvent
+192 (int (*)(...))QGraphicsItem::hoverMoveEvent
+200 (int (*)(...))QGraphicsItem::hoverLeaveEvent
+208 (int (*)(...))QGraphicsItem::keyPressEvent
+216 (int (*)(...))QGraphicsItem::keyReleaseEvent
+224 (int (*)(...))QGraphicsItem::mousePressEvent
+232 (int (*)(...))QGraphicsItem::mouseMoveEvent
+240 (int (*)(...))QGraphicsItem::mouseReleaseEvent
+248 (int (*)(...))QGraphicsItem::mouseDoubleClickEvent
+256 (int (*)(...))QGraphicsItem::wheelEvent
+264 (int (*)(...))QGraphicsItem::inputMethodEvent
+272 (int (*)(...))QGraphicsItem::inputMethodQuery
+280 (int (*)(...))QGraphicsItem::itemChange
+288 (int (*)(...))QGraphicsItem::supportsExtension
+296 (int (*)(...))QGraphicsItem::setExtension
+304 (int (*)(...))QGraphicsItem::extension
+
+Class QGraphicsItem
+ size=16 align=8
+ base size=16 base align=8
+QGraphicsItem (0x0x7f52712ceba0) 0
+ vptr=((& QGraphicsItem::_ZTV13QGraphicsItem) + 16)
+
+Class QGraphicsObject::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QGraphicsObject::QPrivateSignal (0x0x7f5270fa0180) 0 empty
+
+Vtable for QGraphicsObject
+QGraphicsObject::_ZTV15QGraphicsObject: 53 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QGraphicsObject)
+16 (int (*)(...))QGraphicsObject::metaObject
+24 (int (*)(...))QGraphicsObject::qt_metacast
+32 (int (*)(...))QGraphicsObject::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QGraphicsObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))-16
+120 (int (*)(...))(& _ZTI15QGraphicsObject)
+128 0
+136 0
+144 (int (*)(...))QGraphicsItem::advance
+152 (int (*)(...))__cxa_pure_virtual
+160 (int (*)(...))QGraphicsItem::shape
+168 (int (*)(...))QGraphicsItem::contains
+176 (int (*)(...))QGraphicsItem::collidesWithItem
+184 (int (*)(...))QGraphicsItem::collidesWithPath
+192 (int (*)(...))QGraphicsItem::isObscuredBy
+200 (int (*)(...))QGraphicsItem::opaqueArea
+208 (int (*)(...))__cxa_pure_virtual
+216 (int (*)(...))QGraphicsItem::type
+224 (int (*)(...))QGraphicsItem::sceneEventFilter
+232 (int (*)(...))QGraphicsItem::sceneEvent
+240 (int (*)(...))QGraphicsItem::contextMenuEvent
+248 (int (*)(...))QGraphicsItem::dragEnterEvent
+256 (int (*)(...))QGraphicsItem::dragLeaveEvent
+264 (int (*)(...))QGraphicsItem::dragMoveEvent
+272 (int (*)(...))QGraphicsItem::dropEvent
+280 (int (*)(...))QGraphicsItem::focusInEvent
+288 (int (*)(...))QGraphicsItem::focusOutEvent
+296 (int (*)(...))QGraphicsItem::hoverEnterEvent
+304 (int (*)(...))QGraphicsItem::hoverMoveEvent
+312 (int (*)(...))QGraphicsItem::hoverLeaveEvent
+320 (int (*)(...))QGraphicsItem::keyPressEvent
+328 (int (*)(...))QGraphicsItem::keyReleaseEvent
+336 (int (*)(...))QGraphicsItem::mousePressEvent
+344 (int (*)(...))QGraphicsItem::mouseMoveEvent
+352 (int (*)(...))QGraphicsItem::mouseReleaseEvent
+360 (int (*)(...))QGraphicsItem::mouseDoubleClickEvent
+368 (int (*)(...))QGraphicsItem::wheelEvent
+376 (int (*)(...))QGraphicsItem::inputMethodEvent
+384 (int (*)(...))QGraphicsItem::inputMethodQuery
+392 (int (*)(...))QGraphicsItem::itemChange
+400 (int (*)(...))QGraphicsItem::supportsExtension
+408 (int (*)(...))QGraphicsItem::setExtension
+416 (int (*)(...))QGraphicsItem::extension
+
+Class QGraphicsObject
+ size=32 align=8
+ base size=32 base align=8
+QGraphicsObject (0x0x7f5270f399a0) 0
+ vptr=((& QGraphicsObject::_ZTV15QGraphicsObject) + 16)
+ QObject (0x0x7f5270fa00c0) 0
+ primary-for QGraphicsObject (0x0x7f5270f399a0)
+ QGraphicsItem (0x0x7f5270fa0120) 16
+ vptr=((& QGraphicsObject::_ZTV15QGraphicsObject) + 128)
+
+Vtable for QAbstractGraphicsShapeItem
+QAbstractGraphicsShapeItem::_ZTV26QAbstractGraphicsShapeItem: 39 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI26QAbstractGraphicsShapeItem)
+16 0
+24 0
+32 (int (*)(...))QGraphicsItem::advance
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))QGraphicsItem::shape
+56 (int (*)(...))QGraphicsItem::contains
+64 (int (*)(...))QGraphicsItem::collidesWithItem
+72 (int (*)(...))QGraphicsItem::collidesWithPath
+80 (int (*)(...))QAbstractGraphicsShapeItem::isObscuredBy
+88 (int (*)(...))QAbstractGraphicsShapeItem::opaqueArea
+96 (int (*)(...))__cxa_pure_virtual
+104 (int (*)(...))QGraphicsItem::type
+112 (int (*)(...))QGraphicsItem::sceneEventFilter
+120 (int (*)(...))QGraphicsItem::sceneEvent
+128 (int (*)(...))QGraphicsItem::contextMenuEvent
+136 (int (*)(...))QGraphicsItem::dragEnterEvent
+144 (int (*)(...))QGraphicsItem::dragLeaveEvent
+152 (int (*)(...))QGraphicsItem::dragMoveEvent
+160 (int (*)(...))QGraphicsItem::dropEvent
+168 (int (*)(...))QGraphicsItem::focusInEvent
+176 (int (*)(...))QGraphicsItem::focusOutEvent
+184 (int (*)(...))QGraphicsItem::hoverEnterEvent
+192 (int (*)(...))QGraphicsItem::hoverMoveEvent
+200 (int (*)(...))QGraphicsItem::hoverLeaveEvent
+208 (int (*)(...))QGraphicsItem::keyPressEvent
+216 (int (*)(...))QGraphicsItem::keyReleaseEvent
+224 (int (*)(...))QGraphicsItem::mousePressEvent
+232 (int (*)(...))QGraphicsItem::mouseMoveEvent
+240 (int (*)(...))QGraphicsItem::mouseReleaseEvent
+248 (int (*)(...))QGraphicsItem::mouseDoubleClickEvent
+256 (int (*)(...))QGraphicsItem::wheelEvent
+264 (int (*)(...))QGraphicsItem::inputMethodEvent
+272 (int (*)(...))QGraphicsItem::inputMethodQuery
+280 (int (*)(...))QGraphicsItem::itemChange
+288 (int (*)(...))QGraphicsItem::supportsExtension
+296 (int (*)(...))QGraphicsItem::setExtension
+304 (int (*)(...))QGraphicsItem::extension
+
+Class QAbstractGraphicsShapeItem
+ size=16 align=8
+ base size=16 base align=8
+QAbstractGraphicsShapeItem (0x0x7f52712739c0) 0
+ vptr=((& QAbstractGraphicsShapeItem::_ZTV26QAbstractGraphicsShapeItem) + 16)
+ QGraphicsItem (0x0x7f5270fa02a0) 0
+ primary-for QAbstractGraphicsShapeItem (0x0x7f52712739c0)
+
+Vtable for QGraphicsPathItem
+QGraphicsPathItem::_ZTV17QGraphicsPathItem: 39 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QGraphicsPathItem)
+16 (int (*)(...))QGraphicsPathItem::~QGraphicsPathItem
+24 (int (*)(...))QGraphicsPathItem::~QGraphicsPathItem
+32 (int (*)(...))QGraphicsItem::advance
+40 (int (*)(...))QGraphicsPathItem::boundingRect
+48 (int (*)(...))QGraphicsPathItem::shape
+56 (int (*)(...))QGraphicsPathItem::contains
+64 (int (*)(...))QGraphicsItem::collidesWithItem
+72 (int (*)(...))QGraphicsItem::collidesWithPath
+80 (int (*)(...))QGraphicsPathItem::isObscuredBy
+88 (int (*)(...))QGraphicsPathItem::opaqueArea
+96 (int (*)(...))QGraphicsPathItem::paint
+104 (int (*)(...))QGraphicsPathItem::type
+112 (int (*)(...))QGraphicsItem::sceneEventFilter
+120 (int (*)(...))QGraphicsItem::sceneEvent
+128 (int (*)(...))QGraphicsItem::contextMenuEvent
+136 (int (*)(...))QGraphicsItem::dragEnterEvent
+144 (int (*)(...))QGraphicsItem::dragLeaveEvent
+152 (int (*)(...))QGraphicsItem::dragMoveEvent
+160 (int (*)(...))QGraphicsItem::dropEvent
+168 (int (*)(...))QGraphicsItem::focusInEvent
+176 (int (*)(...))QGraphicsItem::focusOutEvent
+184 (int (*)(...))QGraphicsItem::hoverEnterEvent
+192 (int (*)(...))QGraphicsItem::hoverMoveEvent
+200 (int (*)(...))QGraphicsItem::hoverLeaveEvent
+208 (int (*)(...))QGraphicsItem::keyPressEvent
+216 (int (*)(...))QGraphicsItem::keyReleaseEvent
+224 (int (*)(...))QGraphicsItem::mousePressEvent
+232 (int (*)(...))QGraphicsItem::mouseMoveEvent
+240 (int (*)(...))QGraphicsItem::mouseReleaseEvent
+248 (int (*)(...))QGraphicsItem::mouseDoubleClickEvent
+256 (int (*)(...))QGraphicsItem::wheelEvent
+264 (int (*)(...))QGraphicsItem::inputMethodEvent
+272 (int (*)(...))QGraphicsItem::inputMethodQuery
+280 (int (*)(...))QGraphicsItem::itemChange
+288 (int (*)(...))QGraphicsPathItem::supportsExtension
+296 (int (*)(...))QGraphicsPathItem::setExtension
+304 (int (*)(...))QGraphicsPathItem::extension
+
+Class QGraphicsPathItem
+ size=16 align=8
+ base size=16 base align=8
+QGraphicsPathItem (0x0x7f5271273a28) 0
+ vptr=((& QGraphicsPathItem::_ZTV17QGraphicsPathItem) + 16)
+ QAbstractGraphicsShapeItem (0x0x7f5271273a90) 0
+ primary-for QGraphicsPathItem (0x0x7f5271273a28)
+ QGraphicsItem (0x0x7f5270fa03c0) 0
+ primary-for QAbstractGraphicsShapeItem (0x0x7f5271273a90)
+
+Vtable for QGraphicsRectItem
+QGraphicsRectItem::_ZTV17QGraphicsRectItem: 39 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QGraphicsRectItem)
+16 (int (*)(...))QGraphicsRectItem::~QGraphicsRectItem
+24 (int (*)(...))QGraphicsRectItem::~QGraphicsRectItem
+32 (int (*)(...))QGraphicsItem::advance
+40 (int (*)(...))QGraphicsRectItem::boundingRect
+48 (int (*)(...))QGraphicsRectItem::shape
+56 (int (*)(...))QGraphicsRectItem::contains
+64 (int (*)(...))QGraphicsItem::collidesWithItem
+72 (int (*)(...))QGraphicsItem::collidesWithPath
+80 (int (*)(...))QGraphicsRectItem::isObscuredBy
+88 (int (*)(...))QGraphicsRectItem::opaqueArea
+96 (int (*)(...))QGraphicsRectItem::paint
+104 (int (*)(...))QGraphicsRectItem::type
+112 (int (*)(...))QGraphicsItem::sceneEventFilter
+120 (int (*)(...))QGraphicsItem::sceneEvent
+128 (int (*)(...))QGraphicsItem::contextMenuEvent
+136 (int (*)(...))QGraphicsItem::dragEnterEvent
+144 (int (*)(...))QGraphicsItem::dragLeaveEvent
+152 (int (*)(...))QGraphicsItem::dragMoveEvent
+160 (int (*)(...))QGraphicsItem::dropEvent
+168 (int (*)(...))QGraphicsItem::focusInEvent
+176 (int (*)(...))QGraphicsItem::focusOutEvent
+184 (int (*)(...))QGraphicsItem::hoverEnterEvent
+192 (int (*)(...))QGraphicsItem::hoverMoveEvent
+200 (int (*)(...))QGraphicsItem::hoverLeaveEvent
+208 (int (*)(...))QGraphicsItem::keyPressEvent
+216 (int (*)(...))QGraphicsItem::keyReleaseEvent
+224 (int (*)(...))QGraphicsItem::mousePressEvent
+232 (int (*)(...))QGraphicsItem::mouseMoveEvent
+240 (int (*)(...))QGraphicsItem::mouseReleaseEvent
+248 (int (*)(...))QGraphicsItem::mouseDoubleClickEvent
+256 (int (*)(...))QGraphicsItem::wheelEvent
+264 (int (*)(...))QGraphicsItem::inputMethodEvent
+272 (int (*)(...))QGraphicsItem::inputMethodQuery
+280 (int (*)(...))QGraphicsItem::itemChange
+288 (int (*)(...))QGraphicsRectItem::supportsExtension
+296 (int (*)(...))QGraphicsRectItem::setExtension
+304 (int (*)(...))QGraphicsRectItem::extension
+
+Class QGraphicsRectItem
+ size=16 align=8
+ base size=16 base align=8
+QGraphicsRectItem (0x0x7f5271273af8) 0
+ vptr=((& QGraphicsRectItem::_ZTV17QGraphicsRectItem) + 16)
+ QAbstractGraphicsShapeItem (0x0x7f5271273b60) 0
+ primary-for QGraphicsRectItem (0x0x7f5271273af8)
+ QGraphicsItem (0x0x7f5270fa04e0) 0
+ primary-for QAbstractGraphicsShapeItem (0x0x7f5271273b60)
+
+Vtable for QGraphicsEllipseItem
+QGraphicsEllipseItem::_ZTV20QGraphicsEllipseItem: 39 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QGraphicsEllipseItem)
+16 (int (*)(...))QGraphicsEllipseItem::~QGraphicsEllipseItem
+24 (int (*)(...))QGraphicsEllipseItem::~QGraphicsEllipseItem
+32 (int (*)(...))QGraphicsItem::advance
+40 (int (*)(...))QGraphicsEllipseItem::boundingRect
+48 (int (*)(...))QGraphicsEllipseItem::shape
+56 (int (*)(...))QGraphicsEllipseItem::contains
+64 (int (*)(...))QGraphicsItem::collidesWithItem
+72 (int (*)(...))QGraphicsItem::collidesWithPath
+80 (int (*)(...))QGraphicsEllipseItem::isObscuredBy
+88 (int (*)(...))QGraphicsEllipseItem::opaqueArea
+96 (int (*)(...))QGraphicsEllipseItem::paint
+104 (int (*)(...))QGraphicsEllipseItem::type
+112 (int (*)(...))QGraphicsItem::sceneEventFilter
+120 (int (*)(...))QGraphicsItem::sceneEvent
+128 (int (*)(...))QGraphicsItem::contextMenuEvent
+136 (int (*)(...))QGraphicsItem::dragEnterEvent
+144 (int (*)(...))QGraphicsItem::dragLeaveEvent
+152 (int (*)(...))QGraphicsItem::dragMoveEvent
+160 (int (*)(...))QGraphicsItem::dropEvent
+168 (int (*)(...))QGraphicsItem::focusInEvent
+176 (int (*)(...))QGraphicsItem::focusOutEvent
+184 (int (*)(...))QGraphicsItem::hoverEnterEvent
+192 (int (*)(...))QGraphicsItem::hoverMoveEvent
+200 (int (*)(...))QGraphicsItem::hoverLeaveEvent
+208 (int (*)(...))QGraphicsItem::keyPressEvent
+216 (int (*)(...))QGraphicsItem::keyReleaseEvent
+224 (int (*)(...))QGraphicsItem::mousePressEvent
+232 (int (*)(...))QGraphicsItem::mouseMoveEvent
+240 (int (*)(...))QGraphicsItem::mouseReleaseEvent
+248 (int (*)(...))QGraphicsItem::mouseDoubleClickEvent
+256 (int (*)(...))QGraphicsItem::wheelEvent
+264 (int (*)(...))QGraphicsItem::inputMethodEvent
+272 (int (*)(...))QGraphicsItem::inputMethodQuery
+280 (int (*)(...))QGraphicsItem::itemChange
+288 (int (*)(...))QGraphicsEllipseItem::supportsExtension
+296 (int (*)(...))QGraphicsEllipseItem::setExtension
+304 (int (*)(...))QGraphicsEllipseItem::extension
+
+Class QGraphicsEllipseItem
+ size=16 align=8
+ base size=16 base align=8
+QGraphicsEllipseItem (0x0x7f5271273bc8) 0
+ vptr=((& QGraphicsEllipseItem::_ZTV20QGraphicsEllipseItem) + 16)
+ QAbstractGraphicsShapeItem (0x0x7f5271273c30) 0
+ primary-for QGraphicsEllipseItem (0x0x7f5271273bc8)
+ QGraphicsItem (0x0x7f5270fa0660) 0
+ primary-for QAbstractGraphicsShapeItem (0x0x7f5271273c30)
+
+Vtable for QGraphicsPolygonItem
+QGraphicsPolygonItem::_ZTV20QGraphicsPolygonItem: 39 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QGraphicsPolygonItem)
+16 (int (*)(...))QGraphicsPolygonItem::~QGraphicsPolygonItem
+24 (int (*)(...))QGraphicsPolygonItem::~QGraphicsPolygonItem
+32 (int (*)(...))QGraphicsItem::advance
+40 (int (*)(...))QGraphicsPolygonItem::boundingRect
+48 (int (*)(...))QGraphicsPolygonItem::shape
+56 (int (*)(...))QGraphicsPolygonItem::contains
+64 (int (*)(...))QGraphicsItem::collidesWithItem
+72 (int (*)(...))QGraphicsItem::collidesWithPath
+80 (int (*)(...))QGraphicsPolygonItem::isObscuredBy
+88 (int (*)(...))QGraphicsPolygonItem::opaqueArea
+96 (int (*)(...))QGraphicsPolygonItem::paint
+104 (int (*)(...))QGraphicsPolygonItem::type
+112 (int (*)(...))QGraphicsItem::sceneEventFilter
+120 (int (*)(...))QGraphicsItem::sceneEvent
+128 (int (*)(...))QGraphicsItem::contextMenuEvent
+136 (int (*)(...))QGraphicsItem::dragEnterEvent
+144 (int (*)(...))QGraphicsItem::dragLeaveEvent
+152 (int (*)(...))QGraphicsItem::dragMoveEvent
+160 (int (*)(...))QGraphicsItem::dropEvent
+168 (int (*)(...))QGraphicsItem::focusInEvent
+176 (int (*)(...))QGraphicsItem::focusOutEvent
+184 (int (*)(...))QGraphicsItem::hoverEnterEvent
+192 (int (*)(...))QGraphicsItem::hoverMoveEvent
+200 (int (*)(...))QGraphicsItem::hoverLeaveEvent
+208 (int (*)(...))QGraphicsItem::keyPressEvent
+216 (int (*)(...))QGraphicsItem::keyReleaseEvent
+224 (int (*)(...))QGraphicsItem::mousePressEvent
+232 (int (*)(...))QGraphicsItem::mouseMoveEvent
+240 (int (*)(...))QGraphicsItem::mouseReleaseEvent
+248 (int (*)(...))QGraphicsItem::mouseDoubleClickEvent
+256 (int (*)(...))QGraphicsItem::wheelEvent
+264 (int (*)(...))QGraphicsItem::inputMethodEvent
+272 (int (*)(...))QGraphicsItem::inputMethodQuery
+280 (int (*)(...))QGraphicsItem::itemChange
+288 (int (*)(...))QGraphicsPolygonItem::supportsExtension
+296 (int (*)(...))QGraphicsPolygonItem::setExtension
+304 (int (*)(...))QGraphicsPolygonItem::extension
+
+Class QGraphicsPolygonItem
+ size=16 align=8
+ base size=16 base align=8
+QGraphicsPolygonItem (0x0x7f5271273c98) 0
+ vptr=((& QGraphicsPolygonItem::_ZTV20QGraphicsPolygonItem) + 16)
+ QAbstractGraphicsShapeItem (0x0x7f5271273d00) 0
+ primary-for QGraphicsPolygonItem (0x0x7f5271273c98)
+ QGraphicsItem (0x0x7f5270fa07e0) 0
+ primary-for QAbstractGraphicsShapeItem (0x0x7f5271273d00)
+
+Vtable for QGraphicsLineItem
+QGraphicsLineItem::_ZTV17QGraphicsLineItem: 39 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QGraphicsLineItem)
+16 (int (*)(...))QGraphicsLineItem::~QGraphicsLineItem
+24 (int (*)(...))QGraphicsLineItem::~QGraphicsLineItem
+32 (int (*)(...))QGraphicsItem::advance
+40 (int (*)(...))QGraphicsLineItem::boundingRect
+48 (int (*)(...))QGraphicsLineItem::shape
+56 (int (*)(...))QGraphicsLineItem::contains
+64 (int (*)(...))QGraphicsItem::collidesWithItem
+72 (int (*)(...))QGraphicsItem::collidesWithPath
+80 (int (*)(...))QGraphicsLineItem::isObscuredBy
+88 (int (*)(...))QGraphicsLineItem::opaqueArea
+96 (int (*)(...))QGraphicsLineItem::paint
+104 (int (*)(...))QGraphicsLineItem::type
+112 (int (*)(...))QGraphicsItem::sceneEventFilter
+120 (int (*)(...))QGraphicsItem::sceneEvent
+128 (int (*)(...))QGraphicsItem::contextMenuEvent
+136 (int (*)(...))QGraphicsItem::dragEnterEvent
+144 (int (*)(...))QGraphicsItem::dragLeaveEvent
+152 (int (*)(...))QGraphicsItem::dragMoveEvent
+160 (int (*)(...))QGraphicsItem::dropEvent
+168 (int (*)(...))QGraphicsItem::focusInEvent
+176 (int (*)(...))QGraphicsItem::focusOutEvent
+184 (int (*)(...))QGraphicsItem::hoverEnterEvent
+192 (int (*)(...))QGraphicsItem::hoverMoveEvent
+200 (int (*)(...))QGraphicsItem::hoverLeaveEvent
+208 (int (*)(...))QGraphicsItem::keyPressEvent
+216 (int (*)(...))QGraphicsItem::keyReleaseEvent
+224 (int (*)(...))QGraphicsItem::mousePressEvent
+232 (int (*)(...))QGraphicsItem::mouseMoveEvent
+240 (int (*)(...))QGraphicsItem::mouseReleaseEvent
+248 (int (*)(...))QGraphicsItem::mouseDoubleClickEvent
+256 (int (*)(...))QGraphicsItem::wheelEvent
+264 (int (*)(...))QGraphicsItem::inputMethodEvent
+272 (int (*)(...))QGraphicsItem::inputMethodQuery
+280 (int (*)(...))QGraphicsItem::itemChange
+288 (int (*)(...))QGraphicsLineItem::supportsExtension
+296 (int (*)(...))QGraphicsLineItem::setExtension
+304 (int (*)(...))QGraphicsLineItem::extension
+
+Class QGraphicsLineItem
+ size=16 align=8
+ base size=16 base align=8
+QGraphicsLineItem (0x0x7f5271273d68) 0
+ vptr=((& QGraphicsLineItem::_ZTV17QGraphicsLineItem) + 16)
+ QGraphicsItem (0x0x7f5270fa0900) 0
+ primary-for QGraphicsLineItem (0x0x7f5271273d68)
+
+Vtable for QGraphicsPixmapItem
+QGraphicsPixmapItem::_ZTV19QGraphicsPixmapItem: 39 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QGraphicsPixmapItem)
+16 (int (*)(...))QGraphicsPixmapItem::~QGraphicsPixmapItem
+24 (int (*)(...))QGraphicsPixmapItem::~QGraphicsPixmapItem
+32 (int (*)(...))QGraphicsItem::advance
+40 (int (*)(...))QGraphicsPixmapItem::boundingRect
+48 (int (*)(...))QGraphicsPixmapItem::shape
+56 (int (*)(...))QGraphicsPixmapItem::contains
+64 (int (*)(...))QGraphicsItem::collidesWithItem
+72 (int (*)(...))QGraphicsItem::collidesWithPath
+80 (int (*)(...))QGraphicsPixmapItem::isObscuredBy
+88 (int (*)(...))QGraphicsPixmapItem::opaqueArea
+96 (int (*)(...))QGraphicsPixmapItem::paint
+104 (int (*)(...))QGraphicsPixmapItem::type
+112 (int (*)(...))QGraphicsItem::sceneEventFilter
+120 (int (*)(...))QGraphicsItem::sceneEvent
+128 (int (*)(...))QGraphicsItem::contextMenuEvent
+136 (int (*)(...))QGraphicsItem::dragEnterEvent
+144 (int (*)(...))QGraphicsItem::dragLeaveEvent
+152 (int (*)(...))QGraphicsItem::dragMoveEvent
+160 (int (*)(...))QGraphicsItem::dropEvent
+168 (int (*)(...))QGraphicsItem::focusInEvent
+176 (int (*)(...))QGraphicsItem::focusOutEvent
+184 (int (*)(...))QGraphicsItem::hoverEnterEvent
+192 (int (*)(...))QGraphicsItem::hoverMoveEvent
+200 (int (*)(...))QGraphicsItem::hoverLeaveEvent
+208 (int (*)(...))QGraphicsItem::keyPressEvent
+216 (int (*)(...))QGraphicsItem::keyReleaseEvent
+224 (int (*)(...))QGraphicsItem::mousePressEvent
+232 (int (*)(...))QGraphicsItem::mouseMoveEvent
+240 (int (*)(...))QGraphicsItem::mouseReleaseEvent
+248 (int (*)(...))QGraphicsItem::mouseDoubleClickEvent
+256 (int (*)(...))QGraphicsItem::wheelEvent
+264 (int (*)(...))QGraphicsItem::inputMethodEvent
+272 (int (*)(...))QGraphicsItem::inputMethodQuery
+280 (int (*)(...))QGraphicsItem::itemChange
+288 (int (*)(...))QGraphicsPixmapItem::supportsExtension
+296 (int (*)(...))QGraphicsPixmapItem::setExtension
+304 (int (*)(...))QGraphicsPixmapItem::extension
+
+Class QGraphicsPixmapItem
+ size=16 align=8
+ base size=16 base align=8
+QGraphicsPixmapItem (0x0x7f5271273dd0) 0
+ vptr=((& QGraphicsPixmapItem::_ZTV19QGraphicsPixmapItem) + 16)
+ QGraphicsItem (0x0x7f5270fa0a80) 0
+ primary-for QGraphicsPixmapItem (0x0x7f5271273dd0)
+
+Class QGraphicsTextItem::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QGraphicsTextItem::QPrivateSignal (0x0x7f5270fa0cc0) 0 empty
+
+Vtable for QGraphicsTextItem
+QGraphicsTextItem::_ZTV17QGraphicsTextItem: 82 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QGraphicsTextItem)
+16 (int (*)(...))QGraphicsTextItem::metaObject
+24 (int (*)(...))QGraphicsTextItem::qt_metacast
+32 (int (*)(...))QGraphicsTextItem::qt_metacall
+40 (int (*)(...))QGraphicsTextItem::~QGraphicsTextItem
+48 (int (*)(...))QGraphicsTextItem::~QGraphicsTextItem
+56 (int (*)(...))QGraphicsObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QGraphicsTextItem::boundingRect
+120 (int (*)(...))QGraphicsTextItem::shape
+128 (int (*)(...))QGraphicsTextItem::contains
+136 (int (*)(...))QGraphicsTextItem::paint
+144 (int (*)(...))QGraphicsTextItem::isObscuredBy
+152 (int (*)(...))QGraphicsTextItem::opaqueArea
+160 (int (*)(...))QGraphicsTextItem::type
+168 (int (*)(...))QGraphicsTextItem::sceneEvent
+176 (int (*)(...))QGraphicsTextItem::mousePressEvent
+184 (int (*)(...))QGraphicsTextItem::mouseMoveEvent
+192 (int (*)(...))QGraphicsTextItem::mouseReleaseEvent
+200 (int (*)(...))QGraphicsTextItem::mouseDoubleClickEvent
+208 (int (*)(...))QGraphicsTextItem::contextMenuEvent
+216 (int (*)(...))QGraphicsTextItem::keyPressEvent
+224 (int (*)(...))QGraphicsTextItem::keyReleaseEvent
+232 (int (*)(...))QGraphicsTextItem::focusInEvent
+240 (int (*)(...))QGraphicsTextItem::focusOutEvent
+248 (int (*)(...))QGraphicsTextItem::dragEnterEvent
+256 (int (*)(...))QGraphicsTextItem::dragLeaveEvent
+264 (int (*)(...))QGraphicsTextItem::dragMoveEvent
+272 (int (*)(...))QGraphicsTextItem::dropEvent
+280 (int (*)(...))QGraphicsTextItem::inputMethodEvent
+288 (int (*)(...))QGraphicsTextItem::hoverEnterEvent
+296 (int (*)(...))QGraphicsTextItem::hoverMoveEvent
+304 (int (*)(...))QGraphicsTextItem::hoverLeaveEvent
+312 (int (*)(...))QGraphicsTextItem::inputMethodQuery
+320 (int (*)(...))QGraphicsTextItem::supportsExtension
+328 (int (*)(...))QGraphicsTextItem::setExtension
+336 (int (*)(...))QGraphicsTextItem::extension
+344 (int (*)(...))-16
+352 (int (*)(...))(& _ZTI17QGraphicsTextItem)
+360 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItemD1Ev
+368 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItemD0Ev
+376 (int (*)(...))QGraphicsItem::advance
+384 (int (*)(...))QGraphicsTextItem::_ZThn16_NK17QGraphicsTextItem12boundingRectEv
+392 (int (*)(...))QGraphicsTextItem::_ZThn16_NK17QGraphicsTextItem5shapeEv
+400 (int (*)(...))QGraphicsTextItem::_ZThn16_NK17QGraphicsTextItem8containsERK7QPointF
+408 (int (*)(...))QGraphicsItem::collidesWithItem
+416 (int (*)(...))QGraphicsItem::collidesWithPath
+424 (int (*)(...))QGraphicsTextItem::_ZThn16_NK17QGraphicsTextItem12isObscuredByEPK13QGraphicsItem
+432 (int (*)(...))QGraphicsTextItem::_ZThn16_NK17QGraphicsTextItem10opaqueAreaEv
+440 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItem5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget
+448 (int (*)(...))QGraphicsTextItem::_ZThn16_NK17QGraphicsTextItem4typeEv
+456 (int (*)(...))QGraphicsItem::sceneEventFilter
+464 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItem10sceneEventEP6QEvent
+472 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItem16contextMenuEventEP30QGraphicsSceneContextMenuEvent
+480 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItem14dragEnterEventEP27QGraphicsSceneDragDropEvent
+488 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItem14dragLeaveEventEP27QGraphicsSceneDragDropEvent
+496 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItem13dragMoveEventEP27QGraphicsSceneDragDropEvent
+504 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItem9dropEventEP27QGraphicsSceneDragDropEvent
+512 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItem12focusInEventEP11QFocusEvent
+520 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItem13focusOutEventEP11QFocusEvent
+528 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItem15hoverEnterEventEP24QGraphicsSceneHoverEvent
+536 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItem14hoverMoveEventEP24QGraphicsSceneHoverEvent
+544 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItem15hoverLeaveEventEP24QGraphicsSceneHoverEvent
+552 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItem13keyPressEventEP9QKeyEvent
+560 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItem15keyReleaseEventEP9QKeyEvent
+568 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItem15mousePressEventEP24QGraphicsSceneMouseEvent
+576 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItem14mouseMoveEventEP24QGraphicsSceneMouseEvent
+584 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItem17mouseReleaseEventEP24QGraphicsSceneMouseEvent
+592 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItem21mouseDoubleClickEventEP24QGraphicsSceneMouseEvent
+600 (int (*)(...))QGraphicsItem::wheelEvent
+608 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItem16inputMethodEventEP17QInputMethodEvent
+616 (int (*)(...))QGraphicsTextItem::_ZThn16_NK17QGraphicsTextItem16inputMethodQueryEN2Qt16InputMethodQueryE
+624 (int (*)(...))QGraphicsItem::itemChange
+632 (int (*)(...))QGraphicsTextItem::_ZThn16_NK17QGraphicsTextItem17supportsExtensionEN13QGraphicsItem9ExtensionE
+640 (int (*)(...))QGraphicsTextItem::_ZThn16_N17QGraphicsTextItem12setExtensionEN13QGraphicsItem9ExtensionERK8QVariant
+648 (int (*)(...))QGraphicsTextItem::_ZThn16_NK17QGraphicsTextItem9extensionERK8QVariant
+
+Class QGraphicsTextItem
+ size=40 align=8
+ base size=40 base align=8
+QGraphicsTextItem (0x0x7f5271273e38) 0
+ vptr=((& QGraphicsTextItem::_ZTV17QGraphicsTextItem) + 16)
+ QGraphicsObject (0x0x7f5270feb2a0) 0
+ primary-for QGraphicsTextItem (0x0x7f5271273e38)
+ QObject (0x0x7f5270fa0c00) 0
+ primary-for QGraphicsObject (0x0x7f5270feb2a0)
+ QGraphicsItem (0x0x7f5270fa0c60) 16
+ vptr=((& QGraphicsTextItem::_ZTV17QGraphicsTextItem) + 360)
+
+Vtable for QGraphicsSimpleTextItem
+QGraphicsSimpleTextItem::_ZTV23QGraphicsSimpleTextItem: 39 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI23QGraphicsSimpleTextItem)
+16 (int (*)(...))QGraphicsSimpleTextItem::~QGraphicsSimpleTextItem
+24 (int (*)(...))QGraphicsSimpleTextItem::~QGraphicsSimpleTextItem
+32 (int (*)(...))QGraphicsItem::advance
+40 (int (*)(...))QGraphicsSimpleTextItem::boundingRect
+48 (int (*)(...))QGraphicsSimpleTextItem::shape
+56 (int (*)(...))QGraphicsSimpleTextItem::contains
+64 (int (*)(...))QGraphicsItem::collidesWithItem
+72 (int (*)(...))QGraphicsItem::collidesWithPath
+80 (int (*)(...))QGraphicsSimpleTextItem::isObscuredBy
+88 (int (*)(...))QGraphicsSimpleTextItem::opaqueArea
+96 (int (*)(...))QGraphicsSimpleTextItem::paint
+104 (int (*)(...))QGraphicsSimpleTextItem::type
+112 (int (*)(...))QGraphicsItem::sceneEventFilter
+120 (int (*)(...))QGraphicsItem::sceneEvent
+128 (int (*)(...))QGraphicsItem::contextMenuEvent
+136 (int (*)(...))QGraphicsItem::dragEnterEvent
+144 (int (*)(...))QGraphicsItem::dragLeaveEvent
+152 (int (*)(...))QGraphicsItem::dragMoveEvent
+160 (int (*)(...))QGraphicsItem::dropEvent
+168 (int (*)(...))QGraphicsItem::focusInEvent
+176 (int (*)(...))QGraphicsItem::focusOutEvent
+184 (int (*)(...))QGraphicsItem::hoverEnterEvent
+192 (int (*)(...))QGraphicsItem::hoverMoveEvent
+200 (int (*)(...))QGraphicsItem::hoverLeaveEvent
+208 (int (*)(...))QGraphicsItem::keyPressEvent
+216 (int (*)(...))QGraphicsItem::keyReleaseEvent
+224 (int (*)(...))QGraphicsItem::mousePressEvent
+232 (int (*)(...))QGraphicsItem::mouseMoveEvent
+240 (int (*)(...))QGraphicsItem::mouseReleaseEvent
+248 (int (*)(...))QGraphicsItem::mouseDoubleClickEvent
+256 (int (*)(...))QGraphicsItem::wheelEvent
+264 (int (*)(...))QGraphicsItem::inputMethodEvent
+272 (int (*)(...))QGraphicsItem::inputMethodQuery
+280 (int (*)(...))QGraphicsItem::itemChange
+288 (int (*)(...))QGraphicsSimpleTextItem::supportsExtension
+296 (int (*)(...))QGraphicsSimpleTextItem::setExtension
+304 (int (*)(...))QGraphicsSimpleTextItem::extension
+
+Class QGraphicsSimpleTextItem
+ size=16 align=8
+ base size=16 base align=8
+QGraphicsSimpleTextItem (0x0x7f5271273f70) 0
+ vptr=((& QGraphicsSimpleTextItem::_ZTV23QGraphicsSimpleTextItem) + 16)
+ QAbstractGraphicsShapeItem (0x0x7f5271014000) 0
+ primary-for QGraphicsSimpleTextItem (0x0x7f5271273f70)
+ QGraphicsItem (0x0x7f5271015000) 0
+ primary-for QAbstractGraphicsShapeItem (0x0x7f5271014000)
+
+Vtable for QGraphicsItemGroup
+QGraphicsItemGroup::_ZTV18QGraphicsItemGroup: 39 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QGraphicsItemGroup)
+16 (int (*)(...))QGraphicsItemGroup::~QGraphicsItemGroup
+24 (int (*)(...))QGraphicsItemGroup::~QGraphicsItemGroup
+32 (int (*)(...))QGraphicsItem::advance
+40 (int (*)(...))QGraphicsItemGroup::boundingRect
+48 (int (*)(...))QGraphicsItem::shape
+56 (int (*)(...))QGraphicsItem::contains
+64 (int (*)(...))QGraphicsItem::collidesWithItem
+72 (int (*)(...))QGraphicsItem::collidesWithPath
+80 (int (*)(...))QGraphicsItemGroup::isObscuredBy
+88 (int (*)(...))QGraphicsItemGroup::opaqueArea
+96 (int (*)(...))QGraphicsItemGroup::paint
+104 (int (*)(...))QGraphicsItemGroup::type
+112 (int (*)(...))QGraphicsItem::sceneEventFilter
+120 (int (*)(...))QGraphicsItem::sceneEvent
+128 (int (*)(...))QGraphicsItem::contextMenuEvent
+136 (int (*)(...))QGraphicsItem::dragEnterEvent
+144 (int (*)(...))QGraphicsItem::dragLeaveEvent
+152 (int (*)(...))QGraphicsItem::dragMoveEvent
+160 (int (*)(...))QGraphicsItem::dropEvent
+168 (int (*)(...))QGraphicsItem::focusInEvent
+176 (int (*)(...))QGraphicsItem::focusOutEvent
+184 (int (*)(...))QGraphicsItem::hoverEnterEvent
+192 (int (*)(...))QGraphicsItem::hoverMoveEvent
+200 (int (*)(...))QGraphicsItem::hoverLeaveEvent
+208 (int (*)(...))QGraphicsItem::keyPressEvent
+216 (int (*)(...))QGraphicsItem::keyReleaseEvent
+224 (int (*)(...))QGraphicsItem::mousePressEvent
+232 (int (*)(...))QGraphicsItem::mouseMoveEvent
+240 (int (*)(...))QGraphicsItem::mouseReleaseEvent
+248 (int (*)(...))QGraphicsItem::mouseDoubleClickEvent
+256 (int (*)(...))QGraphicsItem::wheelEvent
+264 (int (*)(...))QGraphicsItem::inputMethodEvent
+272 (int (*)(...))QGraphicsItem::inputMethodQuery
+280 (int (*)(...))QGraphicsItem::itemChange
+288 (int (*)(...))QGraphicsItem::supportsExtension
+296 (int (*)(...))QGraphicsItem::setExtension
+304 (int (*)(...))QGraphicsItem::extension
+
+Class QGraphicsItemGroup
+ size=16 align=8
+ base size=16 base align=8
+QGraphicsItemGroup (0x0x7f5271014068) 0
+ vptr=((& QGraphicsItemGroup::_ZTV18QGraphicsItemGroup) + 16)
+ QGraphicsItem (0x0x7f5271015120) 0
+ primary-for QGraphicsItemGroup (0x0x7f5271014068)
+
+Vtable for QGraphicsLayoutItem
+QGraphicsLayoutItem::_ZTV19QGraphicsLayoutItem: 8 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QGraphicsLayoutItem)
+16 0
+24 0
+32 (int (*)(...))QGraphicsLayoutItem::setGeometry
+40 (int (*)(...))QGraphicsLayoutItem::getContentsMargins
+48 (int (*)(...))QGraphicsLayoutItem::updateGeometry
+56 (int (*)(...))__cxa_pure_virtual
+
+Class QGraphicsLayoutItem
+ size=16 align=8
+ base size=16 base align=8
+QGraphicsLayoutItem (0x0x7f52710154e0) 0
+ vptr=((& QGraphicsLayoutItem::_ZTV19QGraphicsLayoutItem) + 16)
+
+Vtable for QGraphicsLayout
+QGraphicsLayout::_ZTV15QGraphicsLayout: 13 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QGraphicsLayout)
+16 0
+24 0
+32 (int (*)(...))QGraphicsLayoutItem::setGeometry
+40 (int (*)(...))QGraphicsLayout::getContentsMargins
+48 (int (*)(...))QGraphicsLayout::updateGeometry
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))QGraphicsLayout::invalidate
+72 (int (*)(...))QGraphicsLayout::widgetEvent
+80 (int (*)(...))__cxa_pure_virtual
+88 (int (*)(...))__cxa_pure_virtual
+96 (int (*)(...))__cxa_pure_virtual
+
+Class QGraphicsLayout
+ size=16 align=8
+ base size=16 base align=8
+QGraphicsLayout (0x0x7f52710140d0) 0
+ vptr=((& QGraphicsLayout::_ZTV15QGraphicsLayout) + 16)
+ QGraphicsLayoutItem (0x0x7f5271015ba0) 0
+ primary-for QGraphicsLayout (0x0x7f52710140d0)
+
+Class QGraphicsAnchor::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QGraphicsAnchor::QPrivateSignal (0x0x7f5271015ea0) 0 empty
+
+Vtable for QGraphicsAnchor
+QGraphicsAnchor::_ZTV15QGraphicsAnchor: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QGraphicsAnchor)
+16 (int (*)(...))QGraphicsAnchor::metaObject
+24 (int (*)(...))QGraphicsAnchor::qt_metacast
+32 (int (*)(...))QGraphicsAnchor::qt_metacall
+40 (int (*)(...))QGraphicsAnchor::~QGraphicsAnchor
+48 (int (*)(...))QGraphicsAnchor::~QGraphicsAnchor
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QGraphicsAnchor
+ size=16 align=8
+ base size=16 base align=8
+QGraphicsAnchor (0x0x7f5271014138) 0
+ vptr=((& QGraphicsAnchor::_ZTV15QGraphicsAnchor) + 16)
+ QObject (0x0x7f5271015e40) 0
+ primary-for QGraphicsAnchor (0x0x7f5271014138)
+
+Vtable for QGraphicsAnchorLayout
+QGraphicsAnchorLayout::_ZTV21QGraphicsAnchorLayout: 13 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI21QGraphicsAnchorLayout)
+16 (int (*)(...))QGraphicsAnchorLayout::~QGraphicsAnchorLayout
+24 (int (*)(...))QGraphicsAnchorLayout::~QGraphicsAnchorLayout
+32 (int (*)(...))QGraphicsAnchorLayout::setGeometry
+40 (int (*)(...))QGraphicsLayout::getContentsMargins
+48 (int (*)(...))QGraphicsLayout::updateGeometry
+56 (int (*)(...))QGraphicsAnchorLayout::sizeHint
+64 (int (*)(...))QGraphicsAnchorLayout::invalidate
+72 (int (*)(...))QGraphicsLayout::widgetEvent
+80 (int (*)(...))QGraphicsAnchorLayout::count
+88 (int (*)(...))QGraphicsAnchorLayout::itemAt
+96 (int (*)(...))QGraphicsAnchorLayout::removeAt
+
+Class QGraphicsAnchorLayout
+ size=16 align=8
+ base size=16 base align=8
+QGraphicsAnchorLayout (0x0x7f52710141a0) 0
+ vptr=((& QGraphicsAnchorLayout::_ZTV21QGraphicsAnchorLayout) + 16)
+ QGraphicsLayout (0x0x7f5271014208) 0
+ primary-for QGraphicsAnchorLayout (0x0x7f52710141a0)
+ QGraphicsLayoutItem (0x0x7f527105e0c0) 0
+ primary-for QGraphicsLayout (0x0x7f5271014208)
+
+Class QGraphicsEffect::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QGraphicsEffect::QPrivateSignal (0x0x7f527105e240) 0 empty
+
+Vtable for QGraphicsEffect
+QGraphicsEffect::_ZTV15QGraphicsEffect: 17 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QGraphicsEffect)
+16 (int (*)(...))QGraphicsEffect::metaObject
+24 (int (*)(...))QGraphicsEffect::qt_metacast
+32 (int (*)(...))QGraphicsEffect::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QGraphicsEffect::boundingRectFor
+120 (int (*)(...))__cxa_pure_virtual
+128 (int (*)(...))QGraphicsEffect::sourceChanged
+
+Class QGraphicsEffect
+ size=16 align=8
+ base size=16 base align=8
+QGraphicsEffect (0x0x7f5271014270) 0
+ vptr=((& QGraphicsEffect::_ZTV15QGraphicsEffect) + 16)
+ QObject (0x0x7f527105e1e0) 0
+ primary-for QGraphicsEffect (0x0x7f5271014270)
+
+Class QGraphicsColorizeEffect::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QGraphicsColorizeEffect::QPrivateSignal (0x0x7f527105ec00) 0 empty
+
+Vtable for QGraphicsColorizeEffect
+QGraphicsColorizeEffect::_ZTV23QGraphicsColorizeEffect: 17 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI23QGraphicsColorizeEffect)
+16 (int (*)(...))QGraphicsColorizeEffect::metaObject
+24 (int (*)(...))QGraphicsColorizeEffect::qt_metacast
+32 (int (*)(...))QGraphicsColorizeEffect::qt_metacall
+40 (int (*)(...))QGraphicsColorizeEffect::~QGraphicsColorizeEffect
+48 (int (*)(...))QGraphicsColorizeEffect::~QGraphicsColorizeEffect
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QGraphicsEffect::boundingRectFor
+120 (int (*)(...))QGraphicsColorizeEffect::draw
+128 (int (*)(...))QGraphicsEffect::sourceChanged
+
+Class QGraphicsColorizeEffect
+ size=16 align=8
+ base size=16 base align=8
+QGraphicsColorizeEffect (0x0x7f52710143a8) 0
+ vptr=((& QGraphicsColorizeEffect::_ZTV23QGraphicsColorizeEffect) + 16)
+ QGraphicsEffect (0x0x7f5271014410) 0
+ primary-for QGraphicsColorizeEffect (0x0x7f52710143a8)
+ QObject (0x0x7f527105eba0) 0
+ primary-for QGraphicsEffect (0x0x7f5271014410)
+
+Class QGraphicsBlurEffect::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QGraphicsBlurEffect::QPrivateSignal (0x0x7f527105ee40) 0 empty
+
+Vtable for QGraphicsBlurEffect
+QGraphicsBlurEffect::_ZTV19QGraphicsBlurEffect: 17 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QGraphicsBlurEffect)
+16 (int (*)(...))QGraphicsBlurEffect::metaObject
+24 (int (*)(...))QGraphicsBlurEffect::qt_metacast
+32 (int (*)(...))QGraphicsBlurEffect::qt_metacall
+40 (int (*)(...))QGraphicsBlurEffect::~QGraphicsBlurEffect
+48 (int (*)(...))QGraphicsBlurEffect::~QGraphicsBlurEffect
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QGraphicsBlurEffect::boundingRectFor
+120 (int (*)(...))QGraphicsBlurEffect::draw
+128 (int (*)(...))QGraphicsEffect::sourceChanged
+
+Class QGraphicsBlurEffect
+ size=16 align=8
+ base size=16 base align=8
+QGraphicsBlurEffect (0x0x7f5271014478) 0
+ vptr=((& QGraphicsBlurEffect::_ZTV19QGraphicsBlurEffect) + 16)
+ QGraphicsEffect (0x0x7f52710144e0) 0
+ primary-for QGraphicsBlurEffect (0x0x7f5271014478)
+ QObject (0x0x7f527105ede0) 0
+ primary-for QGraphicsEffect (0x0x7f52710144e0)
+
+Class QGraphicsDropShadowEffect::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QGraphicsDropShadowEffect::QPrivateSignal (0x0x7f52710a7900) 0 empty
+
+Vtable for QGraphicsDropShadowEffect
+QGraphicsDropShadowEffect::_ZTV25QGraphicsDropShadowEffect: 17 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI25QGraphicsDropShadowEffect)
+16 (int (*)(...))QGraphicsDropShadowEffect::metaObject
+24 (int (*)(...))QGraphicsDropShadowEffect::qt_metacast
+32 (int (*)(...))QGraphicsDropShadowEffect::qt_metacall
+40 (int (*)(...))QGraphicsDropShadowEffect::~QGraphicsDropShadowEffect
+48 (int (*)(...))QGraphicsDropShadowEffect::~QGraphicsDropShadowEffect
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QGraphicsDropShadowEffect::boundingRectFor
+120 (int (*)(...))QGraphicsDropShadowEffect::draw
+128 (int (*)(...))QGraphicsEffect::sourceChanged
+
+Class QGraphicsDropShadowEffect
+ size=16 align=8
+ base size=16 base align=8
+QGraphicsDropShadowEffect (0x0x7f5271014618) 0
+ vptr=((& QGraphicsDropShadowEffect::_ZTV25QGraphicsDropShadowEffect) + 16)
+ QGraphicsEffect (0x0x7f5271014680) 0
+ primary-for QGraphicsDropShadowEffect (0x0x7f5271014618)
+ QObject (0x0x7f52710a78a0) 0
+ primary-for QGraphicsEffect (0x0x7f5271014680)
+
+Class QGraphicsOpacityEffect::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QGraphicsOpacityEffect::QPrivateSignal (0x0x7f52710a7d80) 0 empty
+
+Vtable for QGraphicsOpacityEffect
+QGraphicsOpacityEffect::_ZTV22QGraphicsOpacityEffect: 17 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI22QGraphicsOpacityEffect)
+16 (int (*)(...))QGraphicsOpacityEffect::metaObject
+24 (int (*)(...))QGraphicsOpacityEffect::qt_metacast
+32 (int (*)(...))QGraphicsOpacityEffect::qt_metacall
+40 (int (*)(...))QGraphicsOpacityEffect::~QGraphicsOpacityEffect
+48 (int (*)(...))QGraphicsOpacityEffect::~QGraphicsOpacityEffect
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QGraphicsEffect::boundingRectFor
+120 (int (*)(...))QGraphicsOpacityEffect::draw
+128 (int (*)(...))QGraphicsEffect::sourceChanged
+
+Class QGraphicsOpacityEffect
+ size=16 align=8
+ base size=16 base align=8
+QGraphicsOpacityEffect (0x0x7f52710146e8) 0
+ vptr=((& QGraphicsOpacityEffect::_ZTV22QGraphicsOpacityEffect) + 16)
+ QGraphicsEffect (0x0x7f5271014750) 0
+ primary-for QGraphicsOpacityEffect (0x0x7f52710146e8)
+ QObject (0x0x7f52710a7d20) 0
+ primary-for QGraphicsEffect (0x0x7f5271014750)
+
+Vtable for QGraphicsGridLayout
+QGraphicsGridLayout::_ZTV19QGraphicsGridLayout: 13 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QGraphicsGridLayout)
+16 (int (*)(...))QGraphicsGridLayout::~QGraphicsGridLayout
+24 (int (*)(...))QGraphicsGridLayout::~QGraphicsGridLayout
+32 (int (*)(...))QGraphicsGridLayout::setGeometry
+40 (int (*)(...))QGraphicsLayout::getContentsMargins
+48 (int (*)(...))QGraphicsLayout::updateGeometry
+56 (int (*)(...))QGraphicsGridLayout::sizeHint
+64 (int (*)(...))QGraphicsGridLayout::invalidate
+72 (int (*)(...))QGraphicsLayout::widgetEvent
+80 (int (*)(...))QGraphicsGridLayout::count
+88 (int (*)(...))QGraphicsGridLayout::itemAt
+96 (int (*)(...))QGraphicsGridLayout::removeAt
+
+Class QGraphicsGridLayout
+ size=16 align=8
+ base size=16 base align=8
+QGraphicsGridLayout (0x0x7f52710147b8) 0
+ vptr=((& QGraphicsGridLayout::_ZTV19QGraphicsGridLayout) + 16)
+ QGraphicsLayout (0x0x7f5271014820) 0
+ primary-for QGraphicsGridLayout (0x0x7f52710147b8)
+ QGraphicsLayoutItem (0x0x7f52710a7f60) 0
+ primary-for QGraphicsLayout (0x0x7f5271014820)
+
+Class QGraphicsItemAnimation::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QGraphicsItemAnimation::QPrivateSignal (0x0x7f52710e6180) 0 empty
+
+Vtable for QGraphicsItemAnimation
+QGraphicsItemAnimation::_ZTV22QGraphicsItemAnimation: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI22QGraphicsItemAnimation)
+16 (int (*)(...))QGraphicsItemAnimation::metaObject
+24 (int (*)(...))QGraphicsItemAnimation::qt_metacast
+32 (int (*)(...))QGraphicsItemAnimation::qt_metacall
+40 (int (*)(...))QGraphicsItemAnimation::~QGraphicsItemAnimation
+48 (int (*)(...))QGraphicsItemAnimation::~QGraphicsItemAnimation
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QGraphicsItemAnimation::beforeAnimationStep
+120 (int (*)(...))QGraphicsItemAnimation::afterAnimationStep
+
+Class QGraphicsItemAnimation
+ size=24 align=8
+ base size=24 base align=8
+QGraphicsItemAnimation (0x0x7f5271014958) 0
+ vptr=((& QGraphicsItemAnimation::_ZTV22QGraphicsItemAnimation) + 16)
+ QObject (0x0x7f52710e6120) 0
+ primary-for QGraphicsItemAnimation (0x0x7f5271014958)
+
+Vtable for QGraphicsLinearLayout
+QGraphicsLinearLayout::_ZTV21QGraphicsLinearLayout: 13 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI21QGraphicsLinearLayout)
+16 (int (*)(...))QGraphicsLinearLayout::~QGraphicsLinearLayout
+24 (int (*)(...))QGraphicsLinearLayout::~QGraphicsLinearLayout
+32 (int (*)(...))QGraphicsLinearLayout::setGeometry
+40 (int (*)(...))QGraphicsLayout::getContentsMargins
+48 (int (*)(...))QGraphicsLayout::updateGeometry
+56 (int (*)(...))QGraphicsLinearLayout::sizeHint
+64 (int (*)(...))QGraphicsLinearLayout::invalidate
+72 (int (*)(...))QGraphicsLayout::widgetEvent
+80 (int (*)(...))QGraphicsLinearLayout::count
+88 (int (*)(...))QGraphicsLinearLayout::itemAt
+96 (int (*)(...))QGraphicsLinearLayout::removeAt
+
+Class QGraphicsLinearLayout
+ size=16 align=8
+ base size=16 base align=8
+QGraphicsLinearLayout (0x0x7f52710149c0) 0
+ vptr=((& QGraphicsLinearLayout::_ZTV21QGraphicsLinearLayout) + 16)
+ QGraphicsLayout (0x0x7f5271014a28) 0
+ primary-for QGraphicsLinearLayout (0x0x7f52710149c0)
+ QGraphicsLayoutItem (0x0x7f52710e62a0) 0
+ primary-for QGraphicsLayout (0x0x7f5271014a28)
+
+Class QGraphicsWidget::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QGraphicsWidget::QPrivateSignal (0x0x7f52710e65a0) 0 empty
+
+Vtable for QGraphicsWidget
+QGraphicsWidget::_ZTV15QGraphicsWidget: 92 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QGraphicsWidget)
+16 (int (*)(...))QGraphicsWidget::metaObject
+24 (int (*)(...))QGraphicsWidget::qt_metacast
+32 (int (*)(...))QGraphicsWidget::qt_metacall
+40 (int (*)(...))QGraphicsWidget::~QGraphicsWidget
+48 (int (*)(...))QGraphicsWidget::~QGraphicsWidget
+56 (int (*)(...))QGraphicsWidget::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QGraphicsWidget::setGeometry
+120 (int (*)(...))QGraphicsWidget::getContentsMargins
+128 (int (*)(...))QGraphicsWidget::type
+136 (int (*)(...))QGraphicsWidget::paint
+144 (int (*)(...))QGraphicsWidget::paintWindowFrame
+152 (int (*)(...))QGraphicsWidget::boundingRect
+160 (int (*)(...))QGraphicsWidget::shape
+168 (int (*)(...))QGraphicsWidget::initStyleOption
+176 (int (*)(...))QGraphicsWidget::sizeHint
+184 (int (*)(...))QGraphicsWidget::updateGeometry
+192 (int (*)(...))QGraphicsWidget::itemChange
+200 (int (*)(...))QGraphicsWidget::propertyChange
+208 (int (*)(...))QGraphicsWidget::sceneEvent
+216 (int (*)(...))QGraphicsWidget::windowFrameEvent
+224 (int (*)(...))QGraphicsWidget::windowFrameSectionAt
+232 (int (*)(...))QGraphicsWidget::changeEvent
+240 (int (*)(...))QGraphicsWidget::closeEvent
+248 (int (*)(...))QGraphicsWidget::focusInEvent
+256 (int (*)(...))QGraphicsWidget::focusNextPrevChild
+264 (int (*)(...))QGraphicsWidget::focusOutEvent
+272 (int (*)(...))QGraphicsWidget::hideEvent
+280 (int (*)(...))QGraphicsWidget::moveEvent
+288 (int (*)(...))QGraphicsWidget::polishEvent
+296 (int (*)(...))QGraphicsWidget::resizeEvent
+304 (int (*)(...))QGraphicsWidget::showEvent
+312 (int (*)(...))QGraphicsWidget::hoverMoveEvent
+320 (int (*)(...))QGraphicsWidget::hoverLeaveEvent
+328 (int (*)(...))QGraphicsWidget::grabMouseEvent
+336 (int (*)(...))QGraphicsWidget::ungrabMouseEvent
+344 (int (*)(...))QGraphicsWidget::grabKeyboardEvent
+352 (int (*)(...))QGraphicsWidget::ungrabKeyboardEvent
+360 (int (*)(...))-16
+368 (int (*)(...))(& _ZTI15QGraphicsWidget)
+376 (int (*)(...))QGraphicsWidget::_ZThn16_N15QGraphicsWidgetD1Ev
+384 (int (*)(...))QGraphicsWidget::_ZThn16_N15QGraphicsWidgetD0Ev
+392 (int (*)(...))QGraphicsItem::advance
+400 (int (*)(...))QGraphicsWidget::_ZThn16_NK15QGraphicsWidget12boundingRectEv
+408 (int (*)(...))QGraphicsWidget::_ZThn16_NK15QGraphicsWidget5shapeEv
+416 (int (*)(...))QGraphicsItem::contains
+424 (int (*)(...))QGraphicsItem::collidesWithItem
+432 (int (*)(...))QGraphicsItem::collidesWithPath
+440 (int (*)(...))QGraphicsItem::isObscuredBy
+448 (int (*)(...))QGraphicsItem::opaqueArea
+456 (int (*)(...))QGraphicsWidget::_ZThn16_N15QGraphicsWidget5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget
+464 (int (*)(...))QGraphicsWidget::_ZThn16_NK15QGraphicsWidget4typeEv
+472 (int (*)(...))QGraphicsItem::sceneEventFilter
+480 (int (*)(...))QGraphicsWidget::_ZThn16_N15QGraphicsWidget10sceneEventEP6QEvent
+488 (int (*)(...))QGraphicsItem::contextMenuEvent
+496 (int (*)(...))QGraphicsItem::dragEnterEvent
+504 (int (*)(...))QGraphicsItem::dragLeaveEvent
+512 (int (*)(...))QGraphicsItem::dragMoveEvent
+520 (int (*)(...))QGraphicsItem::dropEvent
+528 (int (*)(...))QGraphicsWidget::_ZThn16_N15QGraphicsWidget12focusInEventEP11QFocusEvent
+536 (int (*)(...))QGraphicsWidget::_ZThn16_N15QGraphicsWidget13focusOutEventEP11QFocusEvent
+544 (int (*)(...))QGraphicsItem::hoverEnterEvent
+552 (int (*)(...))QGraphicsWidget::_ZThn16_N15QGraphicsWidget14hoverMoveEventEP24QGraphicsSceneHoverEvent
+560 (int (*)(...))QGraphicsWidget::_ZThn16_N15QGraphicsWidget15hoverLeaveEventEP24QGraphicsSceneHoverEvent
+568 (int (*)(...))QGraphicsItem::keyPressEvent
+576 (int (*)(...))QGraphicsItem::keyReleaseEvent
+584 (int (*)(...))QGraphicsItem::mousePressEvent
+592 (int (*)(...))QGraphicsItem::mouseMoveEvent
+600 (int (*)(...))QGraphicsItem::mouseReleaseEvent
+608 (int (*)(...))QGraphicsItem::mouseDoubleClickEvent
+616 (int (*)(...))QGraphicsItem::wheelEvent
+624 (int (*)(...))QGraphicsItem::inputMethodEvent
+632 (int (*)(...))QGraphicsItem::inputMethodQuery
+640 (int (*)(...))QGraphicsWidget::_ZThn16_N15QGraphicsWidget10itemChangeEN13QGraphicsItem18GraphicsItemChangeERK8QVariant
+648 (int (*)(...))QGraphicsItem::supportsExtension
+656 (int (*)(...))QGraphicsItem::setExtension
+664 (int (*)(...))QGraphicsItem::extension
+672 (int (*)(...))-32
+680 (int (*)(...))(& _ZTI15QGraphicsWidget)
+688 (int (*)(...))QGraphicsWidget::_ZThn32_N15QGraphicsWidgetD1Ev
+696 (int (*)(...))QGraphicsWidget::_ZThn32_N15QGraphicsWidgetD0Ev
+704 (int (*)(...))QGraphicsWidget::_ZThn32_N15QGraphicsWidget11setGeometryERK6QRectF
+712 (int (*)(...))QGraphicsWidget::_ZThn32_NK15QGraphicsWidget18getContentsMarginsEPdS0_S0_S0_
+720 (int (*)(...))QGraphicsWidget::_ZThn32_N15QGraphicsWidget14updateGeometryEv
+728 (int (*)(...))QGraphicsWidget::_ZThn32_NK15QGraphicsWidget8sizeHintEN2Qt8SizeHintERK6QSizeF
+
+Class QGraphicsWidget
+ size=48 align=8
+ base size=48 base align=8
+QGraphicsWidget (0x0x7f527109caf0) 0
+ vptr=((& QGraphicsWidget::_ZTV15QGraphicsWidget) + 16)
+ QGraphicsObject (0x0x7f527109cb60) 0
+ primary-for QGraphicsWidget (0x0x7f527109caf0)
+ QObject (0x0x7f52710e6480) 0
+ primary-for QGraphicsObject (0x0x7f527109cb60)
+ QGraphicsItem (0x0x7f52710e64e0) 16
+ vptr=((& QGraphicsWidget::_ZTV15QGraphicsWidget) + 376)
+ QGraphicsLayoutItem (0x0x7f52710e6540) 32
+ vptr=((& QGraphicsWidget::_ZTV15QGraphicsWidget) + 688)
+
+Class QGraphicsProxyWidget::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QGraphicsProxyWidget::QPrivateSignal (0x0x7f52710e6a80) 0 empty
+
+Vtable for QGraphicsProxyWidget
+QGraphicsProxyWidget::_ZTV20QGraphicsProxyWidget: 107 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QGraphicsProxyWidget)
+16 (int (*)(...))QGraphicsProxyWidget::metaObject
+24 (int (*)(...))QGraphicsProxyWidget::qt_metacast
+32 (int (*)(...))QGraphicsProxyWidget::qt_metacall
+40 (int (*)(...))QGraphicsProxyWidget::~QGraphicsProxyWidget
+48 (int (*)(...))QGraphicsProxyWidget::~QGraphicsProxyWidget
+56 (int (*)(...))QGraphicsProxyWidget::event
+64 (int (*)(...))QGraphicsProxyWidget::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QGraphicsProxyWidget::setGeometry
+120 (int (*)(...))QGraphicsWidget::getContentsMargins
+128 (int (*)(...))QGraphicsProxyWidget::type
+136 (int (*)(...))QGraphicsProxyWidget::paint
+144 (int (*)(...))QGraphicsWidget::paintWindowFrame
+152 (int (*)(...))QGraphicsWidget::boundingRect
+160 (int (*)(...))QGraphicsWidget::shape
+168 (int (*)(...))QGraphicsWidget::initStyleOption
+176 (int (*)(...))QGraphicsProxyWidget::sizeHint
+184 (int (*)(...))QGraphicsWidget::updateGeometry
+192 (int (*)(...))QGraphicsProxyWidget::itemChange
+200 (int (*)(...))QGraphicsWidget::propertyChange
+208 (int (*)(...))QGraphicsWidget::sceneEvent
+216 (int (*)(...))QGraphicsWidget::windowFrameEvent
+224 (int (*)(...))QGraphicsWidget::windowFrameSectionAt
+232 (int (*)(...))QGraphicsWidget::changeEvent
+240 (int (*)(...))QGraphicsWidget::closeEvent
+248 (int (*)(...))QGraphicsProxyWidget::focusInEvent
+256 (int (*)(...))QGraphicsProxyWidget::focusNextPrevChild
+264 (int (*)(...))QGraphicsProxyWidget::focusOutEvent
+272 (int (*)(...))QGraphicsProxyWidget::hideEvent
+280 (int (*)(...))QGraphicsWidget::moveEvent
+288 (int (*)(...))QGraphicsWidget::polishEvent
+296 (int (*)(...))QGraphicsProxyWidget::resizeEvent
+304 (int (*)(...))QGraphicsProxyWidget::showEvent
+312 (int (*)(...))QGraphicsProxyWidget::hoverMoveEvent
+320 (int (*)(...))QGraphicsProxyWidget::hoverLeaveEvent
+328 (int (*)(...))QGraphicsProxyWidget::grabMouseEvent
+336 (int (*)(...))QGraphicsProxyWidget::ungrabMouseEvent
+344 (int (*)(...))QGraphicsWidget::grabKeyboardEvent
+352 (int (*)(...))QGraphicsWidget::ungrabKeyboardEvent
+360 (int (*)(...))QGraphicsProxyWidget::contextMenuEvent
+368 (int (*)(...))QGraphicsProxyWidget::dragEnterEvent
+376 (int (*)(...))QGraphicsProxyWidget::dragLeaveEvent
+384 (int (*)(...))QGraphicsProxyWidget::dragMoveEvent
+392 (int (*)(...))QGraphicsProxyWidget::dropEvent
+400 (int (*)(...))QGraphicsProxyWidget::hoverEnterEvent
+408 (int (*)(...))QGraphicsProxyWidget::mouseMoveEvent
+416 (int (*)(...))QGraphicsProxyWidget::mousePressEvent
+424 (int (*)(...))QGraphicsProxyWidget::mouseReleaseEvent
+432 (int (*)(...))QGraphicsProxyWidget::mouseDoubleClickEvent
+440 (int (*)(...))QGraphicsProxyWidget::wheelEvent
+448 (int (*)(...))QGraphicsProxyWidget::keyPressEvent
+456 (int (*)(...))QGraphicsProxyWidget::keyReleaseEvent
+464 (int (*)(...))QGraphicsProxyWidget::inputMethodQuery
+472 (int (*)(...))QGraphicsProxyWidget::inputMethodEvent
+480 (int (*)(...))-16
+488 (int (*)(...))(& _ZTI20QGraphicsProxyWidget)
+496 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidgetD1Ev
+504 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidgetD0Ev
+512 (int (*)(...))QGraphicsItem::advance
+520 (int (*)(...))QGraphicsWidget::_ZThn16_NK15QGraphicsWidget12boundingRectEv
+528 (int (*)(...))QGraphicsWidget::_ZThn16_NK15QGraphicsWidget5shapeEv
+536 (int (*)(...))QGraphicsItem::contains
+544 (int (*)(...))QGraphicsItem::collidesWithItem
+552 (int (*)(...))QGraphicsItem::collidesWithPath
+560 (int (*)(...))QGraphicsItem::isObscuredBy
+568 (int (*)(...))QGraphicsItem::opaqueArea
+576 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget
+584 (int (*)(...))QGraphicsProxyWidget::_ZThn16_NK20QGraphicsProxyWidget4typeEv
+592 (int (*)(...))QGraphicsItem::sceneEventFilter
+600 (int (*)(...))QGraphicsWidget::_ZThn16_N15QGraphicsWidget10sceneEventEP6QEvent
+608 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget16contextMenuEventEP30QGraphicsSceneContextMenuEvent
+616 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget14dragEnterEventEP27QGraphicsSceneDragDropEvent
+624 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget14dragLeaveEventEP27QGraphicsSceneDragDropEvent
+632 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget13dragMoveEventEP27QGraphicsSceneDragDropEvent
+640 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget9dropEventEP27QGraphicsSceneDragDropEvent
+648 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget12focusInEventEP11QFocusEvent
+656 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget13focusOutEventEP11QFocusEvent
+664 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget15hoverEnterEventEP24QGraphicsSceneHoverEvent
+672 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget14hoverMoveEventEP24QGraphicsSceneHoverEvent
+680 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget15hoverLeaveEventEP24QGraphicsSceneHoverEvent
+688 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget13keyPressEventEP9QKeyEvent
+696 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget15keyReleaseEventEP9QKeyEvent
+704 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget15mousePressEventEP24QGraphicsSceneMouseEvent
+712 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget14mouseMoveEventEP24QGraphicsSceneMouseEvent
+720 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget17mouseReleaseEventEP24QGraphicsSceneMouseEvent
+728 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget21mouseDoubleClickEventEP24QGraphicsSceneMouseEvent
+736 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget10wheelEventEP24QGraphicsSceneWheelEvent
+744 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget16inputMethodEventEP17QInputMethodEvent
+752 (int (*)(...))QGraphicsProxyWidget::_ZThn16_NK20QGraphicsProxyWidget16inputMethodQueryEN2Qt16InputMethodQueryE
+760 (int (*)(...))QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget10itemChangeEN13QGraphicsItem18GraphicsItemChangeERK8QVariant
+768 (int (*)(...))QGraphicsItem::supportsExtension
+776 (int (*)(...))QGraphicsItem::setExtension
+784 (int (*)(...))QGraphicsItem::extension
+792 (int (*)(...))-32
+800 (int (*)(...))(& _ZTI20QGraphicsProxyWidget)
+808 (int (*)(...))QGraphicsProxyWidget::_ZThn32_N20QGraphicsProxyWidgetD1Ev
+816 (int (*)(...))QGraphicsProxyWidget::_ZThn32_N20QGraphicsProxyWidgetD0Ev
+824 (int (*)(...))QGraphicsProxyWidget::_ZThn32_N20QGraphicsProxyWidget11setGeometryERK6QRectF
+832 (int (*)(...))QGraphicsWidget::_ZThn32_NK15QGraphicsWidget18getContentsMarginsEPdS0_S0_S0_
+840 (int (*)(...))QGraphicsWidget::_ZThn32_N15QGraphicsWidget14updateGeometryEv
+848 (int (*)(...))QGraphicsProxyWidget::_ZThn32_NK20QGraphicsProxyWidget8sizeHintEN2Qt8SizeHintERK6QSizeF
+
+Class QGraphicsProxyWidget
+ size=48 align=8
+ base size=48 base align=8
+QGraphicsProxyWidget (0x0x7f5271014b60) 0
+ vptr=((& QGraphicsProxyWidget::_ZTV20QGraphicsProxyWidget) + 16)
+ QGraphicsWidget (0x0x7f527109cd90) 0
+ primary-for QGraphicsProxyWidget (0x0x7f5271014b60)
+ QGraphicsObject (0x0x7f527109ce00) 0
+ primary-for QGraphicsWidget (0x0x7f527109cd90)
+ QObject (0x0x7f52710e6960) 0
+ primary-for QGraphicsObject (0x0x7f527109ce00)
+ QGraphicsItem (0x0x7f52710e69c0) 16
+ vptr=((& QGraphicsProxyWidget::_ZTV20QGraphicsProxyWidget) + 496)
+ QGraphicsLayoutItem (0x0x7f52710e6a20) 32
+ vptr=((& QGraphicsProxyWidget::_ZTV20QGraphicsProxyWidget) + 808)
+
+Class QGraphicsScene::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QGraphicsScene::QPrivateSignal (0x0x7f52710e6e40) 0 empty
+
+Vtable for QGraphicsScene
+QGraphicsScene::_ZTV14QGraphicsScene: 34 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QGraphicsScene)
+16 (int (*)(...))QGraphicsScene::metaObject
+24 (int (*)(...))QGraphicsScene::qt_metacast
+32 (int (*)(...))QGraphicsScene::qt_metacall
+40 (int (*)(...))QGraphicsScene::~QGraphicsScene
+48 (int (*)(...))QGraphicsScene::~QGraphicsScene
+56 (int (*)(...))QGraphicsScene::event
+64 (int (*)(...))QGraphicsScene::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QGraphicsScene::inputMethodQuery
+120 (int (*)(...))QGraphicsScene::contextMenuEvent
+128 (int (*)(...))QGraphicsScene::dragEnterEvent
+136 (int (*)(...))QGraphicsScene::dragMoveEvent
+144 (int (*)(...))QGraphicsScene::dragLeaveEvent
+152 (int (*)(...))QGraphicsScene::dropEvent
+160 (int (*)(...))QGraphicsScene::focusInEvent
+168 (int (*)(...))QGraphicsScene::focusOutEvent
+176 (int (*)(...))QGraphicsScene::helpEvent
+184 (int (*)(...))QGraphicsScene::keyPressEvent
+192 (int (*)(...))QGraphicsScene::keyReleaseEvent
+200 (int (*)(...))QGraphicsScene::mousePressEvent
+208 (int (*)(...))QGraphicsScene::mouseMoveEvent
+216 (int (*)(...))QGraphicsScene::mouseReleaseEvent
+224 (int (*)(...))QGraphicsScene::mouseDoubleClickEvent
+232 (int (*)(...))QGraphicsScene::wheelEvent
+240 (int (*)(...))QGraphicsScene::inputMethodEvent
+248 (int (*)(...))QGraphicsScene::drawBackground
+256 (int (*)(...))QGraphicsScene::drawForeground
+264 (int (*)(...))QGraphicsScene::drawItems
+
+Class QGraphicsScene
+ size=16 align=8
+ base size=16 base align=8
+QGraphicsScene (0x0x7f5271014d68) 0
+ vptr=((& QGraphicsScene::_ZTV14QGraphicsScene) + 16)
+ QObject (0x0x7f52710e6de0) 0
+ primary-for QGraphicsScene (0x0x7f5271014d68)
+
+Vtable for QGraphicsSceneEvent
+QGraphicsSceneEvent::_ZTV19QGraphicsSceneEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QGraphicsSceneEvent)
+16 (int (*)(...))QGraphicsSceneEvent::~QGraphicsSceneEvent
+24 (int (*)(...))QGraphicsSceneEvent::~QGraphicsSceneEvent
+
+Class QGraphicsSceneEvent
+ size=32 align=8
+ base size=32 base align=8
+QGraphicsSceneEvent (0x0x7f5271014f08) 0
+ vptr=((& QGraphicsSceneEvent::_ZTV19QGraphicsSceneEvent) + 16)
+ QEvent (0x0x7f5270d6cd20) 0
+ primary-for QGraphicsSceneEvent (0x0x7f5271014f08)
+
+Vtable for QGraphicsSceneMouseEvent
+QGraphicsSceneMouseEvent::_ZTV24QGraphicsSceneMouseEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI24QGraphicsSceneMouseEvent)
+16 (int (*)(...))QGraphicsSceneMouseEvent::~QGraphicsSceneMouseEvent
+24 (int (*)(...))QGraphicsSceneMouseEvent::~QGraphicsSceneMouseEvent
+
+Class QGraphicsSceneMouseEvent
+ size=32 align=8
+ base size=32 base align=8
+QGraphicsSceneMouseEvent (0x0x7f5271014f70) 0
+ vptr=((& QGraphicsSceneMouseEvent::_ZTV24QGraphicsSceneMouseEvent) + 16)
+ QGraphicsSceneEvent (0x0x7f5270db6000) 0
+ primary-for QGraphicsSceneMouseEvent (0x0x7f5271014f70)
+ QEvent (0x0x7f5270d6cf00) 0
+ primary-for QGraphicsSceneEvent (0x0x7f5270db6000)
+
+Vtable for QGraphicsSceneWheelEvent
+QGraphicsSceneWheelEvent::_ZTV24QGraphicsSceneWheelEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI24QGraphicsSceneWheelEvent)
+16 (int (*)(...))QGraphicsSceneWheelEvent::~QGraphicsSceneWheelEvent
+24 (int (*)(...))QGraphicsSceneWheelEvent::~QGraphicsSceneWheelEvent
+
+Class QGraphicsSceneWheelEvent
+ size=32 align=8
+ base size=32 base align=8
+QGraphicsSceneWheelEvent (0x0x7f5270db6068) 0
+ vptr=((& QGraphicsSceneWheelEvent::_ZTV24QGraphicsSceneWheelEvent) + 16)
+ QGraphicsSceneEvent (0x0x7f5270db60d0) 0
+ primary-for QGraphicsSceneWheelEvent (0x0x7f5270db6068)
+ QEvent (0x0x7f5270dbf060) 0
+ primary-for QGraphicsSceneEvent (0x0x7f5270db60d0)
+
+Vtable for QGraphicsSceneContextMenuEvent
+QGraphicsSceneContextMenuEvent::_ZTV30QGraphicsSceneContextMenuEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI30QGraphicsSceneContextMenuEvent)
+16 (int (*)(...))QGraphicsSceneContextMenuEvent::~QGraphicsSceneContextMenuEvent
+24 (int (*)(...))QGraphicsSceneContextMenuEvent::~QGraphicsSceneContextMenuEvent
+
+Class QGraphicsSceneContextMenuEvent
+ size=32 align=8
+ base size=32 base align=8
+QGraphicsSceneContextMenuEvent (0x0x7f5270db6138) 0
+ vptr=((& QGraphicsSceneContextMenuEvent::_ZTV30QGraphicsSceneContextMenuEvent) + 16)
+ QGraphicsSceneEvent (0x0x7f5270db61a0) 0
+ primary-for QGraphicsSceneContextMenuEvent (0x0x7f5270db6138)
+ QEvent (0x0x7f5270dbf180) 0
+ primary-for QGraphicsSceneEvent (0x0x7f5270db61a0)
+
+Vtable for QGraphicsSceneHoverEvent
+QGraphicsSceneHoverEvent::_ZTV24QGraphicsSceneHoverEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI24QGraphicsSceneHoverEvent)
+16 (int (*)(...))QGraphicsSceneHoverEvent::~QGraphicsSceneHoverEvent
+24 (int (*)(...))QGraphicsSceneHoverEvent::~QGraphicsSceneHoverEvent
+
+Class QGraphicsSceneHoverEvent
+ size=32 align=8
+ base size=32 base align=8
+QGraphicsSceneHoverEvent (0x0x7f5270db6208) 0
+ vptr=((& QGraphicsSceneHoverEvent::_ZTV24QGraphicsSceneHoverEvent) + 16)
+ QGraphicsSceneEvent (0x0x7f5270db6270) 0
+ primary-for QGraphicsSceneHoverEvent (0x0x7f5270db6208)
+ QEvent (0x0x7f5270dbf2a0) 0
+ primary-for QGraphicsSceneEvent (0x0x7f5270db6270)
+
+Vtable for QGraphicsSceneHelpEvent
+QGraphicsSceneHelpEvent::_ZTV23QGraphicsSceneHelpEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI23QGraphicsSceneHelpEvent)
+16 (int (*)(...))QGraphicsSceneHelpEvent::~QGraphicsSceneHelpEvent
+24 (int (*)(...))QGraphicsSceneHelpEvent::~QGraphicsSceneHelpEvent
+
+Class QGraphicsSceneHelpEvent
+ size=32 align=8
+ base size=32 base align=8
+QGraphicsSceneHelpEvent (0x0x7f5270db62d8) 0
+ vptr=((& QGraphicsSceneHelpEvent::_ZTV23QGraphicsSceneHelpEvent) + 16)
+ QGraphicsSceneEvent (0x0x7f5270db6340) 0
+ primary-for QGraphicsSceneHelpEvent (0x0x7f5270db62d8)
+ QEvent (0x0x7f5270dbf3c0) 0
+ primary-for QGraphicsSceneEvent (0x0x7f5270db6340)
+
+Vtable for QGraphicsSceneDragDropEvent
+QGraphicsSceneDragDropEvent::_ZTV27QGraphicsSceneDragDropEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI27QGraphicsSceneDragDropEvent)
+16 (int (*)(...))QGraphicsSceneDragDropEvent::~QGraphicsSceneDragDropEvent
+24 (int (*)(...))QGraphicsSceneDragDropEvent::~QGraphicsSceneDragDropEvent
+
+Class QGraphicsSceneDragDropEvent
+ size=32 align=8
+ base size=32 base align=8
+QGraphicsSceneDragDropEvent (0x0x7f5270db63a8) 0
+ vptr=((& QGraphicsSceneDragDropEvent::_ZTV27QGraphicsSceneDragDropEvent) + 16)
+ QGraphicsSceneEvent (0x0x7f5270db6410) 0
+ primary-for QGraphicsSceneDragDropEvent (0x0x7f5270db63a8)
+ QEvent (0x0x7f5270dbf4e0) 0
+ primary-for QGraphicsSceneEvent (0x0x7f5270db6410)
+
+Vtable for QGraphicsSceneResizeEvent
+QGraphicsSceneResizeEvent::_ZTV25QGraphicsSceneResizeEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI25QGraphicsSceneResizeEvent)
+16 (int (*)(...))QGraphicsSceneResizeEvent::~QGraphicsSceneResizeEvent
+24 (int (*)(...))QGraphicsSceneResizeEvent::~QGraphicsSceneResizeEvent
+
+Class QGraphicsSceneResizeEvent
+ size=32 align=8
+ base size=32 base align=8
+QGraphicsSceneResizeEvent (0x0x7f5270db6478) 0
+ vptr=((& QGraphicsSceneResizeEvent::_ZTV25QGraphicsSceneResizeEvent) + 16)
+ QGraphicsSceneEvent (0x0x7f5270db64e0) 0
+ primary-for QGraphicsSceneResizeEvent (0x0x7f5270db6478)
+ QEvent (0x0x7f5270dbf600) 0
+ primary-for QGraphicsSceneEvent (0x0x7f5270db64e0)
+
+Vtable for QGraphicsSceneMoveEvent
+QGraphicsSceneMoveEvent::_ZTV23QGraphicsSceneMoveEvent: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI23QGraphicsSceneMoveEvent)
+16 (int (*)(...))QGraphicsSceneMoveEvent::~QGraphicsSceneMoveEvent
+24 (int (*)(...))QGraphicsSceneMoveEvent::~QGraphicsSceneMoveEvent
+
+Class QGraphicsSceneMoveEvent
+ size=32 align=8
+ base size=32 base align=8
+QGraphicsSceneMoveEvent (0x0x7f5270db6548) 0
+ vptr=((& QGraphicsSceneMoveEvent::_ZTV23QGraphicsSceneMoveEvent) + 16)
+ QGraphicsSceneEvent (0x0x7f5270db65b0) 0
+ primary-for QGraphicsSceneMoveEvent (0x0x7f5270db6548)
+ QEvent (0x0x7f5270dbf720) 0
+ primary-for QGraphicsSceneEvent (0x0x7f5270db65b0)
+
+Class QGraphicsTransform::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QGraphicsTransform::QPrivateSignal (0x0x7f5270dbf8a0) 0 empty
+
+Vtable for QGraphicsTransform
+QGraphicsTransform::_ZTV18QGraphicsTransform: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QGraphicsTransform)
+16 (int (*)(...))QGraphicsTransform::metaObject
+24 (int (*)(...))QGraphicsTransform::qt_metacast
+32 (int (*)(...))QGraphicsTransform::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+
+Class QGraphicsTransform
+ size=16 align=8
+ base size=16 base align=8
+QGraphicsTransform (0x0x7f5270db6618) 0
+ vptr=((& QGraphicsTransform::_ZTV18QGraphicsTransform) + 16)
+ QObject (0x0x7f5270dbf840) 0
+ primary-for QGraphicsTransform (0x0x7f5270db6618)
+
+Class QGraphicsScale::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QGraphicsScale::QPrivateSignal (0x0x7f5270dbfae0) 0 empty
+
+Vtable for QGraphicsScale
+QGraphicsScale::_ZTV14QGraphicsScale: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QGraphicsScale)
+16 (int (*)(...))QGraphicsScale::metaObject
+24 (int (*)(...))QGraphicsScale::qt_metacast
+32 (int (*)(...))QGraphicsScale::qt_metacall
+40 (int (*)(...))QGraphicsScale::~QGraphicsScale
+48 (int (*)(...))QGraphicsScale::~QGraphicsScale
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QGraphicsScale::applyTo
+
+Class QGraphicsScale
+ size=16 align=8
+ base size=16 base align=8
+QGraphicsScale (0x0x7f5270db6680) 0
+ vptr=((& QGraphicsScale::_ZTV14QGraphicsScale) + 16)
+ QGraphicsTransform (0x0x7f5270db66e8) 0
+ primary-for QGraphicsScale (0x0x7f5270db6680)
+ QObject (0x0x7f5270dbfa80) 0
+ primary-for QGraphicsTransform (0x0x7f5270db66e8)
+
+Class QGraphicsRotation::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QGraphicsRotation::QPrivateSignal (0x0x7f5270dbfd20) 0 empty
+
+Vtable for QGraphicsRotation
+QGraphicsRotation::_ZTV17QGraphicsRotation: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QGraphicsRotation)
+16 (int (*)(...))QGraphicsRotation::metaObject
+24 (int (*)(...))QGraphicsRotation::qt_metacast
+32 (int (*)(...))QGraphicsRotation::qt_metacall
+40 (int (*)(...))QGraphicsRotation::~QGraphicsRotation
+48 (int (*)(...))QGraphicsRotation::~QGraphicsRotation
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QGraphicsRotation::applyTo
+
+Class QGraphicsRotation
+ size=16 align=8
+ base size=16 base align=8
+QGraphicsRotation (0x0x7f5270db6750) 0
+ vptr=((& QGraphicsRotation::_ZTV17QGraphicsRotation) + 16)
+ QGraphicsTransform (0x0x7f5270db67b8) 0
+ primary-for QGraphicsRotation (0x0x7f5270db6750)
+ QObject (0x0x7f5270dbfcc0) 0
+ primary-for QGraphicsTransform (0x0x7f5270db67b8)
+
+Class QScrollArea::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QScrollArea::QPrivateSignal (0x0x7f5270e0e000) 0 empty
+
+Vtable for QScrollArea
+QScrollArea::_ZTV11QScrollArea: 68 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QScrollArea)
+16 (int (*)(...))QScrollArea::metaObject
+24 (int (*)(...))QScrollArea::qt_metacast
+32 (int (*)(...))QScrollArea::qt_metacall
+40 (int (*)(...))QScrollArea::~QScrollArea
+48 (int (*)(...))QScrollArea::~QScrollArea
+56 (int (*)(...))QScrollArea::event
+64 (int (*)(...))QScrollArea::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QScrollArea::sizeHint
+136 (int (*)(...))QAbstractScrollArea::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QAbstractScrollArea::mousePressEvent
+176 (int (*)(...))QAbstractScrollArea::mouseReleaseEvent
+184 (int (*)(...))QAbstractScrollArea::mouseDoubleClickEvent
+192 (int (*)(...))QAbstractScrollArea::mouseMoveEvent
+200 (int (*)(...))QAbstractScrollArea::wheelEvent
+208 (int (*)(...))QAbstractScrollArea::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QAbstractScrollArea::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QScrollArea::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QAbstractScrollArea::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QAbstractScrollArea::dragEnterEvent
+320 (int (*)(...))QAbstractScrollArea::dragMoveEvent
+328 (int (*)(...))QAbstractScrollArea::dragLeaveEvent
+336 (int (*)(...))QAbstractScrollArea::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QFrame::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QScrollArea::focusNextPrevChild
+432 (int (*)(...))QAbstractScrollArea::setupViewport
+440 (int (*)(...))QAbstractScrollArea::viewportEvent
+448 (int (*)(...))QScrollArea::scrollContentsBy
+456 (int (*)(...))QScrollArea::viewportSizeHint
+464 (int (*)(...))-16
+472 (int (*)(...))(& _ZTI11QScrollArea)
+480 (int (*)(...))QScrollArea::_ZThn16_N11QScrollAreaD1Ev
+488 (int (*)(...))QScrollArea::_ZThn16_N11QScrollAreaD0Ev
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+512 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+520 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+528 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+536 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QScrollArea
+ size=48 align=8
+ base size=48 base align=8
+QScrollArea (0x0x7f5270db6820) 0
+ vptr=((& QScrollArea::_ZTV11QScrollArea) + 16)
+ QAbstractScrollArea (0x0x7f5270db6888) 0
+ primary-for QScrollArea (0x0x7f5270db6820)
+ QFrame (0x0x7f5270db68f0) 0
+ primary-for QAbstractScrollArea (0x0x7f5270db6888)
+ QWidget (0x0x7f5270da3b60) 0
+ primary-for QFrame (0x0x7f5270db68f0)
+ QObject (0x0x7f5270dbff00) 0
+ primary-for QWidget (0x0x7f5270da3b60)
+ QPaintDevice (0x0x7f5270dbff60) 16
+ vptr=((& QScrollArea::_ZTV11QScrollArea) + 480)
+
+Class QGraphicsView::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QGraphicsView::QPrivateSignal (0x0x7f5270e0e2a0) 0 empty
+
+Vtable for QGraphicsView
+QGraphicsView::_ZTV13QGraphicsView: 71 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QGraphicsView)
+16 (int (*)(...))QGraphicsView::metaObject
+24 (int (*)(...))QGraphicsView::qt_metacast
+32 (int (*)(...))QGraphicsView::qt_metacall
+40 (int (*)(...))QGraphicsView::~QGraphicsView
+48 (int (*)(...))QGraphicsView::~QGraphicsView
+56 (int (*)(...))QGraphicsView::event
+64 (int (*)(...))QAbstractScrollArea::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QGraphicsView::sizeHint
+136 (int (*)(...))QAbstractScrollArea::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QGraphicsView::mousePressEvent
+176 (int (*)(...))QGraphicsView::mouseReleaseEvent
+184 (int (*)(...))QGraphicsView::mouseDoubleClickEvent
+192 (int (*)(...))QGraphicsView::mouseMoveEvent
+200 (int (*)(...))QGraphicsView::wheelEvent
+208 (int (*)(...))QGraphicsView::keyPressEvent
+216 (int (*)(...))QGraphicsView::keyReleaseEvent
+224 (int (*)(...))QGraphicsView::focusInEvent
+232 (int (*)(...))QGraphicsView::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QGraphicsView::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QGraphicsView::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QGraphicsView::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QGraphicsView::dragEnterEvent
+320 (int (*)(...))QGraphicsView::dragMoveEvent
+328 (int (*)(...))QGraphicsView::dragLeaveEvent
+336 (int (*)(...))QGraphicsView::dropEvent
+344 (int (*)(...))QGraphicsView::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QFrame::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QGraphicsView::inputMethodEvent
+416 (int (*)(...))QGraphicsView::inputMethodQuery
+424 (int (*)(...))QGraphicsView::focusNextPrevChild
+432 (int (*)(...))QGraphicsView::setupViewport
+440 (int (*)(...))QGraphicsView::viewportEvent
+448 (int (*)(...))QGraphicsView::scrollContentsBy
+456 (int (*)(...))QAbstractScrollArea::viewportSizeHint
+464 (int (*)(...))QGraphicsView::drawBackground
+472 (int (*)(...))QGraphicsView::drawForeground
+480 (int (*)(...))QGraphicsView::drawItems
+488 (int (*)(...))-16
+496 (int (*)(...))(& _ZTI13QGraphicsView)
+504 (int (*)(...))QGraphicsView::_ZThn16_N13QGraphicsViewD1Ev
+512 (int (*)(...))QGraphicsView::_ZThn16_N13QGraphicsViewD0Ev
+520 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+528 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+536 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+544 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+552 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+560 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QGraphicsView
+ size=48 align=8
+ base size=48 base align=8
+QGraphicsView (0x0x7f5270db6958) 0
+ vptr=((& QGraphicsView::_ZTV13QGraphicsView) + 16)
+ QAbstractScrollArea (0x0x7f5270db69c0) 0
+ primary-for QGraphicsView (0x0x7f5270db6958)
+ QFrame (0x0x7f5270db6a28) 0
+ primary-for QAbstractScrollArea (0x0x7f5270db69c0)
+ QWidget (0x0x7f5270da3cb0) 0
+ primary-for QFrame (0x0x7f5270db6a28)
+ QObject (0x0x7f5270e0e1e0) 0
+ primary-for QWidget (0x0x7f5270da3cb0)
+ QPaintDevice (0x0x7f5270e0e240) 16
+ vptr=((& QGraphicsView::_ZTV13QGraphicsView) + 504)
+
+Class QGroupBox::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QGroupBox::QPrivateSignal (0x0x7f5270e74960) 0 empty
+
+Vtable for QGroupBox
+QGroupBox::_ZTV9QGroupBox: 64 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QGroupBox)
+16 (int (*)(...))QGroupBox::metaObject
+24 (int (*)(...))QGroupBox::qt_metacast
+32 (int (*)(...))QGroupBox::qt_metacall
+40 (int (*)(...))QGroupBox::~QGroupBox
+48 (int (*)(...))QGroupBox::~QGroupBox
+56 (int (*)(...))QGroupBox::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QGroupBox::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QWidget::sizeHint
+136 (int (*)(...))QGroupBox::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QGroupBox::mousePressEvent
+176 (int (*)(...))QGroupBox::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QGroupBox::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QWidget::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QGroupBox::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QGroupBox::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QGroupBox::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QWidget::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QGroupBox::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))-16
+440 (int (*)(...))(& _ZTI9QGroupBox)
+448 (int (*)(...))QGroupBox::_ZThn16_N9QGroupBoxD1Ev
+456 (int (*)(...))QGroupBox::_ZThn16_N9QGroupBoxD0Ev
+464 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+472 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+480 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QGroupBox
+ size=48 align=8
+ base size=48 base align=8
+QGroupBox (0x0x7f5270db6c30) 0
+ vptr=((& QGroupBox::_ZTV9QGroupBox) + 16)
+ QWidget (0x0x7f5270e73380) 0
+ primary-for QGroupBox (0x0x7f5270db6c30)
+ QObject (0x0x7f5270e748a0) 0
+ primary-for QWidget (0x0x7f5270e73380)
+ QPaintDevice (0x0x7f5270e74900) 16
+ vptr=((& QGroupBox::_ZTV9QGroupBox) + 448)
+
+Class QHeaderView::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QHeaderView::QPrivateSignal (0x0x7f5270e74c00) 0 empty
+
+Vtable for QHeaderView
+QHeaderView::_ZTV11QHeaderView: 108 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QHeaderView)
+16 (int (*)(...))QHeaderView::metaObject
+24 (int (*)(...))QHeaderView::qt_metacast
+32 (int (*)(...))QHeaderView::qt_metacall
+40 (int (*)(...))QHeaderView::~QHeaderView
+48 (int (*)(...))QHeaderView::~QHeaderView
+56 (int (*)(...))QHeaderView::event
+64 (int (*)(...))QAbstractItemView::eventFilter
+72 (int (*)(...))QAbstractItemView::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QHeaderView::setVisible
+128 (int (*)(...))QHeaderView::sizeHint
+136 (int (*)(...))QAbstractScrollArea::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QHeaderView::mousePressEvent
+176 (int (*)(...))QHeaderView::mouseReleaseEvent
+184 (int (*)(...))QHeaderView::mouseDoubleClickEvent
+192 (int (*)(...))QHeaderView::mouseMoveEvent
+200 (int (*)(...))QAbstractScrollArea::wheelEvent
+208 (int (*)(...))QAbstractItemView::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QAbstractItemView::focusInEvent
+232 (int (*)(...))QAbstractItemView::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QHeaderView::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QAbstractItemView::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QAbstractScrollArea::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QAbstractItemView::dragEnterEvent
+320 (int (*)(...))QAbstractItemView::dragMoveEvent
+328 (int (*)(...))QAbstractItemView::dragLeaveEvent
+336 (int (*)(...))QAbstractItemView::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QFrame::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QAbstractItemView::inputMethodEvent
+416 (int (*)(...))QAbstractItemView::inputMethodQuery
+424 (int (*)(...))QAbstractItemView::focusNextPrevChild
+432 (int (*)(...))QAbstractScrollArea::setupViewport
+440 (int (*)(...))QHeaderView::viewportEvent
+448 (int (*)(...))QHeaderView::scrollContentsBy
+456 (int (*)(...))QAbstractItemView::viewportSizeHint
+464 (int (*)(...))QHeaderView::setModel
+472 (int (*)(...))QAbstractItemView::setSelectionModel
+480 (int (*)(...))QAbstractItemView::keyboardSearch
+488 (int (*)(...))QHeaderView::visualRect
+496 (int (*)(...))QHeaderView::scrollTo
+504 (int (*)(...))QHeaderView::indexAt
+512 (int (*)(...))QAbstractItemView::sizeHintForRow
+520 (int (*)(...))QAbstractItemView::sizeHintForColumn
+528 (int (*)(...))QHeaderView::reset
+536 (int (*)(...))QAbstractItemView::setRootIndex
+544 (int (*)(...))QHeaderView::doItemsLayout
+552 (int (*)(...))QAbstractItemView::selectAll
+560 (int (*)(...))QHeaderView::dataChanged
+568 (int (*)(...))QHeaderView::rowsInserted
+576 (int (*)(...))QAbstractItemView::rowsAboutToBeRemoved
+584 (int (*)(...))QAbstractItemView::selectionChanged
+592 (int (*)(...))QHeaderView::currentChanged
+600 (int (*)(...))QAbstractItemView::updateEditorData
+608 (int (*)(...))QAbstractItemView::updateEditorGeometries
+616 (int (*)(...))QHeaderView::updateGeometries
+624 (int (*)(...))QAbstractItemView::verticalScrollbarAction
+632 (int (*)(...))QAbstractItemView::horizontalScrollbarAction
+640 (int (*)(...))QAbstractItemView::verticalScrollbarValueChanged
+648 (int (*)(...))QAbstractItemView::horizontalScrollbarValueChanged
+656 (int (*)(...))QAbstractItemView::closeEditor
+664 (int (*)(...))QAbstractItemView::commitData
+672 (int (*)(...))QAbstractItemView::editorDestroyed
+680 (int (*)(...))QHeaderView::moveCursor
+688 (int (*)(...))QHeaderView::horizontalOffset
+696 (int (*)(...))QHeaderView::verticalOffset
+704 (int (*)(...))QHeaderView::isIndexHidden
+712 (int (*)(...))QHeaderView::setSelection
+720 (int (*)(...))QHeaderView::visualRegionForSelection
+728 (int (*)(...))QAbstractItemView::selectedIndexes
+736 (int (*)(...))QAbstractItemView::edit
+744 (int (*)(...))QAbstractItemView::selectionCommand
+752 (int (*)(...))QAbstractItemView::startDrag
+760 (int (*)(...))QAbstractItemView::viewOptions
+768 (int (*)(...))QHeaderView::paintSection
+776 (int (*)(...))QHeaderView::sectionSizeFromContents
+784 (int (*)(...))-16
+792 (int (*)(...))(& _ZTI11QHeaderView)
+800 (int (*)(...))QHeaderView::_ZThn16_N11QHeaderViewD1Ev
+808 (int (*)(...))QHeaderView::_ZThn16_N11QHeaderViewD0Ev
+816 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+824 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+832 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+840 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+848 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+856 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QHeaderView
+ size=48 align=8
+ base size=48 base align=8
+QHeaderView (0x0x7f5270db6c98) 0
+ vptr=((& QHeaderView::_ZTV11QHeaderView) + 16)
+ QAbstractItemView (0x0x7f5270db6d00) 0
+ primary-for QHeaderView (0x0x7f5270db6c98)
+ QAbstractScrollArea (0x0x7f5270db6d68) 0
+ primary-for QAbstractItemView (0x0x7f5270db6d00)
+ QFrame (0x0x7f5270db6dd0) 0
+ primary-for QAbstractScrollArea (0x0x7f5270db6d68)
+ QWidget (0x0x7f5270e733f0) 0
+ primary-for QFrame (0x0x7f5270db6dd0)
+ QObject (0x0x7f5270e74b40) 0
+ primary-for QWidget (0x0x7f5270e733f0)
+ QPaintDevice (0x0x7f5270e74ba0) 16
+ vptr=((& QHeaderView::_ZTV11QHeaderView) + 800)
+
+Class QLineEdit::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QLineEdit::QPrivateSignal (0x0x7f5270eb3600) 0 empty
+
+Vtable for QLineEdit
+QLineEdit::_ZTV9QLineEdit: 64 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QLineEdit)
+16 (int (*)(...))QLineEdit::metaObject
+24 (int (*)(...))QLineEdit::qt_metacast
+32 (int (*)(...))QLineEdit::qt_metacall
+40 (int (*)(...))QLineEdit::~QLineEdit
+48 (int (*)(...))QLineEdit::~QLineEdit
+56 (int (*)(...))QLineEdit::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QLineEdit::sizeHint
+136 (int (*)(...))QLineEdit::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QLineEdit::mousePressEvent
+176 (int (*)(...))QLineEdit::mouseReleaseEvent
+184 (int (*)(...))QLineEdit::mouseDoubleClickEvent
+192 (int (*)(...))QLineEdit::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QLineEdit::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QLineEdit::focusInEvent
+232 (int (*)(...))QLineEdit::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QLineEdit::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QWidget::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QLineEdit::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QLineEdit::dragEnterEvent
+320 (int (*)(...))QLineEdit::dragMoveEvent
+328 (int (*)(...))QLineEdit::dragLeaveEvent
+336 (int (*)(...))QLineEdit::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QLineEdit::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QLineEdit::inputMethodEvent
+416 (int (*)(...))QLineEdit::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))-16
+440 (int (*)(...))(& _ZTI9QLineEdit)
+448 (int (*)(...))QLineEdit::_ZThn16_N9QLineEditD1Ev
+456 (int (*)(...))QLineEdit::_ZThn16_N9QLineEditD0Ev
+464 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+472 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+480 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QLineEdit
+ size=48 align=8
+ base size=48 base align=8
+QLineEdit (0x0x7f5270eb6340) 0
+ vptr=((& QLineEdit::_ZTV9QLineEdit) + 16)
+ QWidget (0x0x7f5270e73cb0) 0
+ primary-for QLineEdit (0x0x7f5270eb6340)
+ QObject (0x0x7f5270eb3540) 0
+ primary-for QWidget (0x0x7f5270e73cb0)
+ QPaintDevice (0x0x7f5270eb35a0) 16
+ vptr=((& QLineEdit::_ZTV9QLineEdit) + 448)
+
+Class QInputDialog::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QInputDialog::QPrivateSignal (0x0x7f5270eb3a20) 0 empty
+
+Vtable for QInputDialog
+QInputDialog::_ZTV12QInputDialog: 69 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QInputDialog)
+16 (int (*)(...))QInputDialog::metaObject
+24 (int (*)(...))QInputDialog::qt_metacast
+32 (int (*)(...))QInputDialog::qt_metacall
+40 (int (*)(...))QInputDialog::~QInputDialog
+48 (int (*)(...))QInputDialog::~QInputDialog
+56 (int (*)(...))QWidget::event
+64 (int (*)(...))QDialog::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QInputDialog::setVisible
+128 (int (*)(...))QInputDialog::sizeHint
+136 (int (*)(...))QInputDialog::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QWidget::mousePressEvent
+176 (int (*)(...))QWidget::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QWidget::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QDialog::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QWidget::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QDialog::resizeEvent
+280 (int (*)(...))QDialog::closeEvent
+288 (int (*)(...))QDialog::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QDialog::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QWidget::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QDialog::open
+440 (int (*)(...))QDialog::exec
+448 (int (*)(...))QInputDialog::done
+456 (int (*)(...))QDialog::accept
+464 (int (*)(...))QDialog::reject
+472 (int (*)(...))-16
+480 (int (*)(...))(& _ZTI12QInputDialog)
+488 (int (*)(...))QInputDialog::_ZThn16_N12QInputDialogD1Ev
+496 (int (*)(...))QInputDialog::_ZThn16_N12QInputDialogD0Ev
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+520 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+528 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+536 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+544 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QInputDialog
+ size=48 align=8
+ base size=48 base align=8
+QInputDialog (0x0x7f5270eb63a8) 0
+ vptr=((& QInputDialog::_ZTV12QInputDialog) + 16)
+ QDialog (0x0x7f5270eb6410) 0
+ primary-for QInputDialog (0x0x7f5270eb63a8)
+ QWidget (0x0x7f5270ebf0e0) 0
+ primary-for QDialog (0x0x7f5270eb6410)
+ QObject (0x0x7f5270eb3960) 0
+ primary-for QWidget (0x0x7f5270ebf0e0)
+ QPaintDevice (0x0x7f5270eb39c0) 16
+ vptr=((& QInputDialog::_ZTV12QInputDialog) + 488)
+
+Class QItemDelegate::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QItemDelegate::QPrivateSignal (0x0x7f5270f05360) 0 empty
+
+Vtable for QItemDelegate
+QItemDelegate::_ZTV13QItemDelegate: 28 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QItemDelegate)
+16 (int (*)(...))QItemDelegate::metaObject
+24 (int (*)(...))QItemDelegate::qt_metacast
+32 (int (*)(...))QItemDelegate::qt_metacall
+40 (int (*)(...))QItemDelegate::~QItemDelegate
+48 (int (*)(...))QItemDelegate::~QItemDelegate
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QItemDelegate::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QItemDelegate::paint
+120 (int (*)(...))QItemDelegate::sizeHint
+128 (int (*)(...))QItemDelegate::createEditor
+136 (int (*)(...))QAbstractItemDelegate::destroyEditor
+144 (int (*)(...))QItemDelegate::setEditorData
+152 (int (*)(...))QItemDelegate::setModelData
+160 (int (*)(...))QItemDelegate::updateEditorGeometry
+168 (int (*)(...))QItemDelegate::editorEvent
+176 (int (*)(...))QAbstractItemDelegate::helpEvent
+184 (int (*)(...))QAbstractItemDelegate::paintingRoles
+192 (int (*)(...))QItemDelegate::drawDisplay
+200 (int (*)(...))QItemDelegate::drawDecoration
+208 (int (*)(...))QItemDelegate::drawFocus
+216 (int (*)(...))QItemDelegate::drawCheck
+
+Class QItemDelegate
+ size=16 align=8
+ base size=16 base align=8
+QItemDelegate (0x0x7f5270eb6548) 0
+ vptr=((& QItemDelegate::_ZTV13QItemDelegate) + 16)
+ QAbstractItemDelegate (0x0x7f5270eb65b0) 0
+ primary-for QItemDelegate (0x0x7f5270eb6548)
+ QObject (0x0x7f5270f05300) 0
+ primary-for QAbstractItemDelegate (0x0x7f5270eb65b0)
+
+Vtable for QItemEditorCreatorBase
+QItemEditorCreatorBase::_ZTV22QItemEditorCreatorBase: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI22QItemEditorCreatorBase)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+
+Class QItemEditorCreatorBase
+ size=8 align=8
+ base size=8 base align=8
+QItemEditorCreatorBase (0x0x7f5270f05540) 0 nearly-empty
+ vptr=((& QItemEditorCreatorBase::_ZTV22QItemEditorCreatorBase) + 16)
+
+Vtable for QItemEditorFactory
+QItemEditorFactory::_ZTV18QItemEditorFactory: 6 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI18QItemEditorFactory)
+16 (int (*)(...))QItemEditorFactory::~QItemEditorFactory
+24 (int (*)(...))QItemEditorFactory::~QItemEditorFactory
+32 (int (*)(...))QItemEditorFactory::createEditor
+40 (int (*)(...))QItemEditorFactory::valuePropertyName
+
+Class QItemEditorFactory
+ size=16 align=8
+ base size=16 base align=8
+QItemEditorFactory (0x0x7f5270f058a0) 0
+ vptr=((& QItemEditorFactory::_ZTV18QItemEditorFactory) + 16)
+
+Class QKeyEventTransition::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QKeyEventTransition::QPrivateSignal (0x0x7f5270f05ba0) 0 empty
+
+Vtable for QKeyEventTransition
+QKeyEventTransition::_ZTV19QKeyEventTransition: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QKeyEventTransition)
+16 (int (*)(...))QKeyEventTransition::metaObject
+24 (int (*)(...))QKeyEventTransition::qt_metacast
+32 (int (*)(...))QKeyEventTransition::qt_metacall
+40 (int (*)(...))QKeyEventTransition::~QKeyEventTransition
+48 (int (*)(...))QKeyEventTransition::~QKeyEventTransition
+56 (int (*)(...))QEventTransition::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QKeyEventTransition::eventTest
+120 (int (*)(...))QKeyEventTransition::onTransition
+
+Class QKeyEventTransition
+ size=16 align=8
+ base size=16 base align=8
+QKeyEventTransition (0x0x7f5270eb66e8) 0
+ vptr=((& QKeyEventTransition::_ZTV19QKeyEventTransition) + 16)
+ QEventTransition (0x0x7f5270eb6750) 0
+ primary-for QKeyEventTransition (0x0x7f5270eb66e8)
+ QAbstractTransition (0x0x7f5270eb67b8) 0
+ primary-for QEventTransition (0x0x7f5270eb6750)
+ QObject (0x0x7f5270f05b40) 0
+ primary-for QAbstractTransition (0x0x7f5270eb67b8)
+
+Class QKeySequenceEdit::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QKeySequenceEdit::QPrivateSignal (0x0x7f5270f05e40) 0 empty
+
+Vtable for QKeySequenceEdit
+QKeySequenceEdit::_ZTV16QKeySequenceEdit: 64 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QKeySequenceEdit)
+16 (int (*)(...))QKeySequenceEdit::metaObject
+24 (int (*)(...))QKeySequenceEdit::qt_metacast
+32 (int (*)(...))QKeySequenceEdit::qt_metacall
+40 (int (*)(...))QKeySequenceEdit::~QKeySequenceEdit
+48 (int (*)(...))QKeySequenceEdit::~QKeySequenceEdit
+56 (int (*)(...))QKeySequenceEdit::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QKeySequenceEdit::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QWidget::sizeHint
+136 (int (*)(...))QWidget::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QWidget::mousePressEvent
+176 (int (*)(...))QWidget::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QWidget::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QKeySequenceEdit::keyPressEvent
+216 (int (*)(...))QKeySequenceEdit::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QWidget::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QWidget::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QWidget::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QWidget::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))-16
+440 (int (*)(...))(& _ZTI16QKeySequenceEdit)
+448 (int (*)(...))QKeySequenceEdit::_ZThn16_N16QKeySequenceEditD1Ev
+456 (int (*)(...))QKeySequenceEdit::_ZThn16_N16QKeySequenceEditD0Ev
+464 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+472 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+480 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QKeySequenceEdit
+ size=48 align=8
+ base size=48 base align=8
+QKeySequenceEdit (0x0x7f5270eb6820) 0
+ vptr=((& QKeySequenceEdit::_ZTV16QKeySequenceEdit) + 16)
+ QWidget (0x0x7f5270b3b150) 0
+ primary-for QKeySequenceEdit (0x0x7f5270eb6820)
+ QObject (0x0x7f5270f05d80) 0
+ primary-for QWidget (0x0x7f5270b3b150)
+ QPaintDevice (0x0x7f5270f05de0) 16
+ vptr=((& QKeySequenceEdit::_ZTV16QKeySequenceEdit) + 448)
+
+Class QLabel::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QLabel::QPrivateSignal (0x0x7f5270b54120) 0 empty
+
+Vtable for QLabel
+QLabel::_ZTV6QLabel: 64 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI6QLabel)
+16 (int (*)(...))QLabel::metaObject
+24 (int (*)(...))QLabel::qt_metacast
+32 (int (*)(...))QLabel::qt_metacall
+40 (int (*)(...))QLabel::~QLabel
+48 (int (*)(...))QLabel::~QLabel
+56 (int (*)(...))QLabel::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QLabel::sizeHint
+136 (int (*)(...))QLabel::minimumSizeHint
+144 (int (*)(...))QLabel::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QLabel::mousePressEvent
+176 (int (*)(...))QLabel::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QLabel::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QLabel::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QLabel::focusInEvent
+232 (int (*)(...))QLabel::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QLabel::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QWidget::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QLabel::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QLabel::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QLabel::focusNextPrevChild
+432 (int (*)(...))-16
+440 (int (*)(...))(& _ZTI6QLabel)
+448 (int (*)(...))QLabel::_ZThn16_N6QLabelD1Ev
+456 (int (*)(...))QLabel::_ZThn16_N6QLabelD0Ev
+464 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+472 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+480 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QLabel
+ size=48 align=8
+ base size=48 base align=8
+QLabel (0x0x7f5270eb6888) 0
+ vptr=((& QLabel::_ZTV6QLabel) + 16)
+ QFrame (0x0x7f5270eb68f0) 0
+ primary-for QLabel (0x0x7f5270eb6888)
+ QWidget (0x0x7f5270b3b2a0) 0
+ primary-for QFrame (0x0x7f5270eb68f0)
+ QObject (0x0x7f5270b54060) 0
+ primary-for QWidget (0x0x7f5270b3b2a0)
+ QPaintDevice (0x0x7f5270b540c0) 16
+ vptr=((& QLabel::_ZTV6QLabel) + 448)
+
+Class QLCDNumber::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QLCDNumber::QPrivateSignal (0x0x7f5270b543c0) 0 empty
+
+Vtable for QLCDNumber
+QLCDNumber::_ZTV10QLCDNumber: 64 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QLCDNumber)
+16 (int (*)(...))QLCDNumber::metaObject
+24 (int (*)(...))QLCDNumber::qt_metacast
+32 (int (*)(...))QLCDNumber::qt_metacall
+40 (int (*)(...))QLCDNumber::~QLCDNumber
+48 (int (*)(...))QLCDNumber::~QLCDNumber
+56 (int (*)(...))QLCDNumber::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QLCDNumber::sizeHint
+136 (int (*)(...))QWidget::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QWidget::mousePressEvent
+176 (int (*)(...))QWidget::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QWidget::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QWidget::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QLCDNumber::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QWidget::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QWidget::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QFrame::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))-16
+440 (int (*)(...))(& _ZTI10QLCDNumber)
+448 (int (*)(...))QLCDNumber::_ZThn16_N10QLCDNumberD1Ev
+456 (int (*)(...))QLCDNumber::_ZThn16_N10QLCDNumberD0Ev
+464 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+472 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+480 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QLCDNumber
+ size=48 align=8
+ base size=48 base align=8
+QLCDNumber (0x0x7f5270eb6958) 0
+ vptr=((& QLCDNumber::_ZTV10QLCDNumber) + 16)
+ QFrame (0x0x7f5270eb69c0) 0
+ primary-for QLCDNumber (0x0x7f5270eb6958)
+ QWidget (0x0x7f5270b3b3f0) 0
+ primary-for QFrame (0x0x7f5270eb69c0)
+ QObject (0x0x7f5270b54300) 0
+ primary-for QWidget (0x0x7f5270b3b3f0)
+ QPaintDevice (0x0x7f5270b54360) 16
+ vptr=((& QLCDNumber::_ZTV10QLCDNumber) + 448)
+
+Class QListView::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QListView::QPrivateSignal (0x0x7f5270b547e0) 0 empty
+
+Vtable for QListView
+QListView::_ZTV9QListView: 106 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QListView)
+16 (int (*)(...))QListView::metaObject
+24 (int (*)(...))QListView::qt_metacast
+32 (int (*)(...))QListView::qt_metacall
+40 (int (*)(...))QListView::~QListView
+48 (int (*)(...))QListView::~QListView
+56 (int (*)(...))QListView::event
+64 (int (*)(...))QAbstractItemView::eventFilter
+72 (int (*)(...))QListView::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QAbstractScrollArea::sizeHint
+136 (int (*)(...))QAbstractScrollArea::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QAbstractItemView::mousePressEvent
+176 (int (*)(...))QListView::mouseReleaseEvent
+184 (int (*)(...))QAbstractItemView::mouseDoubleClickEvent
+192 (int (*)(...))QListView::mouseMoveEvent
+200 (int (*)(...))QListView::wheelEvent
+208 (int (*)(...))QAbstractItemView::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QAbstractItemView::focusInEvent
+232 (int (*)(...))QAbstractItemView::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QListView::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QListView::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QAbstractScrollArea::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QAbstractItemView::dragEnterEvent
+320 (int (*)(...))QListView::dragMoveEvent
+328 (int (*)(...))QListView::dragLeaveEvent
+336 (int (*)(...))QListView::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QFrame::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QAbstractItemView::inputMethodEvent
+416 (int (*)(...))QAbstractItemView::inputMethodQuery
+424 (int (*)(...))QAbstractItemView::focusNextPrevChild
+432 (int (*)(...))QAbstractScrollArea::setupViewport
+440 (int (*)(...))QAbstractItemView::viewportEvent
+448 (int (*)(...))QListView::scrollContentsBy
+456 (int (*)(...))QListView::viewportSizeHint
+464 (int (*)(...))QAbstractItemView::setModel
+472 (int (*)(...))QAbstractItemView::setSelectionModel
+480 (int (*)(...))QAbstractItemView::keyboardSearch
+488 (int (*)(...))QListView::visualRect
+496 (int (*)(...))QListView::scrollTo
+504 (int (*)(...))QListView::indexAt
+512 (int (*)(...))QAbstractItemView::sizeHintForRow
+520 (int (*)(...))QAbstractItemView::sizeHintForColumn
+528 (int (*)(...))QListView::reset
+536 (int (*)(...))QListView::setRootIndex
+544 (int (*)(...))QListView::doItemsLayout
+552 (int (*)(...))QAbstractItemView::selectAll
+560 (int (*)(...))QListView::dataChanged
+568 (int (*)(...))QListView::rowsInserted
+576 (int (*)(...))QListView::rowsAboutToBeRemoved
+584 (int (*)(...))QListView::selectionChanged
+592 (int (*)(...))QListView::currentChanged
+600 (int (*)(...))QAbstractItemView::updateEditorData
+608 (int (*)(...))QAbstractItemView::updateEditorGeometries
+616 (int (*)(...))QListView::updateGeometries
+624 (int (*)(...))QAbstractItemView::verticalScrollbarAction
+632 (int (*)(...))QAbstractItemView::horizontalScrollbarAction
+640 (int (*)(...))QAbstractItemView::verticalScrollbarValueChanged
+648 (int (*)(...))QAbstractItemView::horizontalScrollbarValueChanged
+656 (int (*)(...))QAbstractItemView::closeEditor
+664 (int (*)(...))QAbstractItemView::commitData
+672 (int (*)(...))QAbstractItemView::editorDestroyed
+680 (int (*)(...))QListView::moveCursor
+688 (int (*)(...))QListView::horizontalOffset
+696 (int (*)(...))QListView::verticalOffset
+704 (int (*)(...))QListView::isIndexHidden
+712 (int (*)(...))QListView::setSelection
+720 (int (*)(...))QListView::visualRegionForSelection
+728 (int (*)(...))QListView::selectedIndexes
+736 (int (*)(...))QAbstractItemView::edit
+744 (int (*)(...))QAbstractItemView::selectionCommand
+752 (int (*)(...))QListView::startDrag
+760 (int (*)(...))QListView::viewOptions
+768 (int (*)(...))-16
+776 (int (*)(...))(& _ZTI9QListView)
+784 (int (*)(...))QListView::_ZThn16_N9QListViewD1Ev
+792 (int (*)(...))QListView::_ZThn16_N9QListViewD0Ev
+800 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+808 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+816 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+824 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+832 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+840 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QListView
+ size=48 align=8
+ base size=48 base align=8
+QListView (0x0x7f5270eb6a28) 0
+ vptr=((& QListView::_ZTV9QListView) + 16)
+ QAbstractItemView (0x0x7f5270eb6a90) 0
+ primary-for QListView (0x0x7f5270eb6a28)
+ QAbstractScrollArea (0x0x7f5270eb6af8) 0
+ primary-for QAbstractItemView (0x0x7f5270eb6a90)
+ QFrame (0x0x7f5270eb6b60) 0
+ primary-for QAbstractScrollArea (0x0x7f5270eb6af8)
+ QWidget (0x0x7f5270b3b850) 0
+ primary-for QFrame (0x0x7f5270eb6b60)
+ QObject (0x0x7f5270b54720) 0
+ primary-for QWidget (0x0x7f5270b3b850)
+ QPaintDevice (0x0x7f5270b54780) 16
+ vptr=((& QListView::_ZTV9QListView) + 784)
+
+Vtable for QListWidgetItem
+QListWidgetItem::_ZTV15QListWidgetItem: 11 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QListWidgetItem)
+16 (int (*)(...))QListWidgetItem::~QListWidgetItem
+24 (int (*)(...))QListWidgetItem::~QListWidgetItem
+32 (int (*)(...))QListWidgetItem::clone
+40 (int (*)(...))QListWidgetItem::setBackgroundColor
+48 (int (*)(...))QListWidgetItem::data
+56 (int (*)(...))QListWidgetItem::setData
+64 (int (*)(...))QListWidgetItem::operator<
+72 (int (*)(...))QListWidgetItem::read
+80 (int (*)(...))QListWidgetItem::write
+
+Class QListWidgetItem
+ size=48 align=8
+ base size=44 base align=8
+QListWidgetItem (0x0x7f5270b54d80) 0
+ vptr=((& QListWidgetItem::_ZTV15QListWidgetItem) + 16)
+
+Class QListWidget::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QListWidget::QPrivateSignal (0x0x7f5270bd3f60) 0 empty
+
+Vtable for QListWidget
+QListWidget::_ZTV11QListWidget: 110 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QListWidget)
+16 (int (*)(...))QListWidget::metaObject
+24 (int (*)(...))QListWidget::qt_metacast
+32 (int (*)(...))QListWidget::qt_metacall
+40 (int (*)(...))QListWidget::~QListWidget
+48 (int (*)(...))QListWidget::~QListWidget
+56 (int (*)(...))QListWidget::event
+64 (int (*)(...))QAbstractItemView::eventFilter
+72 (int (*)(...))QListView::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QAbstractScrollArea::sizeHint
+136 (int (*)(...))QAbstractScrollArea::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QAbstractItemView::mousePressEvent
+176 (int (*)(...))QListView::mouseReleaseEvent
+184 (int (*)(...))QAbstractItemView::mouseDoubleClickEvent
+192 (int (*)(...))QListView::mouseMoveEvent
+200 (int (*)(...))QListView::wheelEvent
+208 (int (*)(...))QAbstractItemView::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QAbstractItemView::focusInEvent
+232 (int (*)(...))QAbstractItemView::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QListView::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QListView::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QAbstractScrollArea::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QAbstractItemView::dragEnterEvent
+320 (int (*)(...))QListView::dragMoveEvent
+328 (int (*)(...))QListView::dragLeaveEvent
+336 (int (*)(...))QListWidget::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QFrame::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QAbstractItemView::inputMethodEvent
+416 (int (*)(...))QAbstractItemView::inputMethodQuery
+424 (int (*)(...))QAbstractItemView::focusNextPrevChild
+432 (int (*)(...))QAbstractScrollArea::setupViewport
+440 (int (*)(...))QAbstractItemView::viewportEvent
+448 (int (*)(...))QListView::scrollContentsBy
+456 (int (*)(...))QListView::viewportSizeHint
+464 (int (*)(...))QListWidget::setModel
+472 (int (*)(...))QListWidget::setSelectionModel
+480 (int (*)(...))QAbstractItemView::keyboardSearch
+488 (int (*)(...))QListView::visualRect
+496 (int (*)(...))QListView::scrollTo
+504 (int (*)(...))QListView::indexAt
+512 (int (*)(...))QAbstractItemView::sizeHintForRow
+520 (int (*)(...))QAbstractItemView::sizeHintForColumn
+528 (int (*)(...))QListView::reset
+536 (int (*)(...))QListView::setRootIndex
+544 (int (*)(...))QListView::doItemsLayout
+552 (int (*)(...))QAbstractItemView::selectAll
+560 (int (*)(...))QListView::dataChanged
+568 (int (*)(...))QListView::rowsInserted
+576 (int (*)(...))QListView::rowsAboutToBeRemoved
+584 (int (*)(...))QListView::selectionChanged
+592 (int (*)(...))QListView::currentChanged
+600 (int (*)(...))QAbstractItemView::updateEditorData
+608 (int (*)(...))QAbstractItemView::updateEditorGeometries
+616 (int (*)(...))QListView::updateGeometries
+624 (int (*)(...))QAbstractItemView::verticalScrollbarAction
+632 (int (*)(...))QAbstractItemView::horizontalScrollbarAction
+640 (int (*)(...))QAbstractItemView::verticalScrollbarValueChanged
+648 (int (*)(...))QAbstractItemView::horizontalScrollbarValueChanged
+656 (int (*)(...))QAbstractItemView::closeEditor
+664 (int (*)(...))QAbstractItemView::commitData
+672 (int (*)(...))QAbstractItemView::editorDestroyed
+680 (int (*)(...))QListView::moveCursor
+688 (int (*)(...))QListView::horizontalOffset
+696 (int (*)(...))QListView::verticalOffset
+704 (int (*)(...))QListView::isIndexHidden
+712 (int (*)(...))QListView::setSelection
+720 (int (*)(...))QListView::visualRegionForSelection
+728 (int (*)(...))QListView::selectedIndexes
+736 (int (*)(...))QAbstractItemView::edit
+744 (int (*)(...))QAbstractItemView::selectionCommand
+752 (int (*)(...))QListView::startDrag
+760 (int (*)(...))QListView::viewOptions
+768 (int (*)(...))QListWidget::mimeTypes
+776 (int (*)(...))QListWidget::mimeData
+784 (int (*)(...))QListWidget::dropMimeData
+792 (int (*)(...))QListWidget::supportedDropActions
+800 (int (*)(...))-16
+808 (int (*)(...))(& _ZTI11QListWidget)
+816 (int (*)(...))QListWidget::_ZThn16_N11QListWidgetD1Ev
+824 (int (*)(...))QListWidget::_ZThn16_N11QListWidgetD0Ev
+832 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+840 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+848 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+856 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+864 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+872 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QListWidget
+ size=48 align=8
+ base size=48 base align=8
+QListWidget (0x0x7f5270bdb1a0) 0
+ vptr=((& QListWidget::_ZTV11QListWidget) + 16)
+ QListView (0x0x7f5270bdb208) 0
+ primary-for QListWidget (0x0x7f5270bdb1a0)
+ QAbstractItemView (0x0x7f5270bdb270) 0
+ primary-for QListView (0x0x7f5270bdb208)
+ QAbstractScrollArea (0x0x7f5270bdb2d8) 0
+ primary-for QAbstractItemView (0x0x7f5270bdb270)
+ QFrame (0x0x7f5270bdb340) 0
+ primary-for QAbstractScrollArea (0x0x7f5270bdb2d8)
+ QWidget (0x0x7f5270bd0620) 0
+ primary-for QFrame (0x0x7f5270bdb340)
+ QObject (0x0x7f5270bd3ea0) 0
+ primary-for QWidget (0x0x7f5270bd0620)
+ QPaintDevice (0x0x7f5270bd3f00) 16
+ vptr=((& QListWidget::_ZTV11QListWidget) + 816)
+
+Class QMainWindow::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QMainWindow::QPrivateSignal (0x0x7f5270bfd4e0) 0 empty
+
+Vtable for QMainWindow
+QMainWindow::_ZTV11QMainWindow: 65 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QMainWindow)
+16 (int (*)(...))QMainWindow::metaObject
+24 (int (*)(...))QMainWindow::qt_metacast
+32 (int (*)(...))QMainWindow::qt_metacall
+40 (int (*)(...))QMainWindow::~QMainWindow
+48 (int (*)(...))QMainWindow::~QMainWindow
+56 (int (*)(...))QMainWindow::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QWidget::sizeHint
+136 (int (*)(...))QWidget::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QWidget::mousePressEvent
+176 (int (*)(...))QWidget::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QWidget::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QWidget::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QWidget::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QWidget::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QMainWindow::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QWidget::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QMainWindow::createPopupMenu
+440 (int (*)(...))-16
+448 (int (*)(...))(& _ZTI11QMainWindow)
+456 (int (*)(...))QMainWindow::_ZThn16_N11QMainWindowD1Ev
+464 (int (*)(...))QMainWindow::_ZThn16_N11QMainWindowD0Ev
+472 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+480 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+512 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QMainWindow
+ size=48 align=8
+ base size=48 base align=8
+QMainWindow (0x0x7f5270bdb3a8) 0
+ vptr=((& QMainWindow::_ZTV11QMainWindow) + 16)
+ QWidget (0x0x7f5270bd08c0) 0
+ primary-for QMainWindow (0x0x7f5270bdb3a8)
+ QObject (0x0x7f5270bfd420) 0
+ primary-for QWidget (0x0x7f5270bd08c0)
+ QPaintDevice (0x0x7f5270bfd480) 16
+ vptr=((& QMainWindow::_ZTV11QMainWindow) + 456)
+
+Class QMdiArea::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QMdiArea::QPrivateSignal (0x0x7f5270c3a000) 0 empty
+
+Vtable for QMdiArea
+QMdiArea::_ZTV8QMdiArea: 68 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI8QMdiArea)
+16 (int (*)(...))QMdiArea::metaObject
+24 (int (*)(...))QMdiArea::qt_metacast
+32 (int (*)(...))QMdiArea::qt_metacall
+40 (int (*)(...))QMdiArea::~QMdiArea
+48 (int (*)(...))QMdiArea::~QMdiArea
+56 (int (*)(...))QMdiArea::event
+64 (int (*)(...))QMdiArea::eventFilter
+72 (int (*)(...))QMdiArea::timerEvent
+80 (int (*)(...))QMdiArea::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QMdiArea::sizeHint
+136 (int (*)(...))QMdiArea::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QAbstractScrollArea::mousePressEvent
+176 (int (*)(...))QAbstractScrollArea::mouseReleaseEvent
+184 (int (*)(...))QAbstractScrollArea::mouseDoubleClickEvent
+192 (int (*)(...))QAbstractScrollArea::mouseMoveEvent
+200 (int (*)(...))QAbstractScrollArea::wheelEvent
+208 (int (*)(...))QAbstractScrollArea::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QMdiArea::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QMdiArea::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QAbstractScrollArea::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QAbstractScrollArea::dragEnterEvent
+320 (int (*)(...))QAbstractScrollArea::dragMoveEvent
+328 (int (*)(...))QAbstractScrollArea::dragLeaveEvent
+336 (int (*)(...))QAbstractScrollArea::dropEvent
+344 (int (*)(...))QMdiArea::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QFrame::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QMdiArea::setupViewport
+440 (int (*)(...))QMdiArea::viewportEvent
+448 (int (*)(...))QMdiArea::scrollContentsBy
+456 (int (*)(...))QAbstractScrollArea::viewportSizeHint
+464 (int (*)(...))-16
+472 (int (*)(...))(& _ZTI8QMdiArea)
+480 (int (*)(...))QMdiArea::_ZThn16_N8QMdiAreaD1Ev
+488 (int (*)(...))QMdiArea::_ZThn16_N8QMdiAreaD0Ev
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+512 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+520 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+528 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+536 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QMdiArea
+ size=48 align=8
+ base size=48 base align=8
+QMdiArea (0x0x7f5270bdb4e0) 0
+ vptr=((& QMdiArea::_ZTV8QMdiArea) + 16)
+ QAbstractScrollArea (0x0x7f5270bdb548) 0
+ primary-for QMdiArea (0x0x7f5270bdb4e0)
+ QFrame (0x0x7f5270bdb5b0) 0
+ primary-for QAbstractScrollArea (0x0x7f5270bdb548)
+ QWidget (0x0x7f5270c2e3f0) 0
+ primary-for QFrame (0x0x7f5270bdb5b0)
+ QObject (0x0x7f5270bfdf00) 0
+ primary-for QWidget (0x0x7f5270c2e3f0)
+ QPaintDevice (0x0x7f5270bfdf60) 16
+ vptr=((& QMdiArea::_ZTV8QMdiArea) + 480)
+
+Class QMdiSubWindow::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QMdiSubWindow::QPrivateSignal (0x0x7f5270c3aae0) 0 empty
+
+Vtable for QMdiSubWindow
+QMdiSubWindow::_ZTV13QMdiSubWindow: 64 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QMdiSubWindow)
+16 (int (*)(...))QMdiSubWindow::metaObject
+24 (int (*)(...))QMdiSubWindow::qt_metacast
+32 (int (*)(...))QMdiSubWindow::qt_metacall
+40 (int (*)(...))QMdiSubWindow::~QMdiSubWindow
+48 (int (*)(...))QMdiSubWindow::~QMdiSubWindow
+56 (int (*)(...))QMdiSubWindow::event
+64 (int (*)(...))QMdiSubWindow::eventFilter
+72 (int (*)(...))QMdiSubWindow::timerEvent
+80 (int (*)(...))QMdiSubWindow::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QMdiSubWindow::sizeHint
+136 (int (*)(...))QMdiSubWindow::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QMdiSubWindow::mousePressEvent
+176 (int (*)(...))QMdiSubWindow::mouseReleaseEvent
+184 (int (*)(...))QMdiSubWindow::mouseDoubleClickEvent
+192 (int (*)(...))QMdiSubWindow::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QMdiSubWindow::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QMdiSubWindow::focusInEvent
+232 (int (*)(...))QMdiSubWindow::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QMdiSubWindow::leaveEvent
+256 (int (*)(...))QMdiSubWindow::paintEvent
+264 (int (*)(...))QMdiSubWindow::moveEvent
+272 (int (*)(...))QMdiSubWindow::resizeEvent
+280 (int (*)(...))QMdiSubWindow::closeEvent
+288 (int (*)(...))QMdiSubWindow::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QMdiSubWindow::showEvent
+352 (int (*)(...))QMdiSubWindow::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QMdiSubWindow::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))-16
+440 (int (*)(...))(& _ZTI13QMdiSubWindow)
+448 (int (*)(...))QMdiSubWindow::_ZThn16_N13QMdiSubWindowD1Ev
+456 (int (*)(...))QMdiSubWindow::_ZThn16_N13QMdiSubWindowD0Ev
+464 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+472 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+480 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QMdiSubWindow
+ size=48 align=8
+ base size=48 base align=8
+QMdiSubWindow (0x0x7f5270bdb6e8) 0
+ vptr=((& QMdiSubWindow::_ZTV13QMdiSubWindow) + 16)
+ QWidget (0x0x7f5270c2ee00) 0
+ primary-for QMdiSubWindow (0x0x7f5270bdb6e8)
+ QObject (0x0x7f5270c3aa20) 0
+ primary-for QWidget (0x0x7f5270c2ee00)
+ QPaintDevice (0x0x7f5270c3aa80) 16
+ vptr=((& QMdiSubWindow::_ZTV13QMdiSubWindow) + 448)
+
+Class QMenu::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QMenu::QPrivateSignal (0x0x7f5270c8d4e0) 0 empty
+
+Vtable for QMenu
+QMenu::_ZTV5QMenu: 64 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI5QMenu)
+16 (int (*)(...))QMenu::metaObject
+24 (int (*)(...))QMenu::qt_metacast
+32 (int (*)(...))QMenu::qt_metacall
+40 (int (*)(...))QMenu::~QMenu
+48 (int (*)(...))QMenu::~QMenu
+56 (int (*)(...))QMenu::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QMenu::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QMenu::sizeHint
+136 (int (*)(...))QWidget::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QMenu::mousePressEvent
+176 (int (*)(...))QMenu::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QMenu::mouseMoveEvent
+200 (int (*)(...))QMenu::wheelEvent
+208 (int (*)(...))QMenu::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QMenu::enterEvent
+248 (int (*)(...))QMenu::leaveEvent
+256 (int (*)(...))QMenu::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QWidget::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QWidget::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QMenu::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QMenu::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QMenu::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QMenu::focusNextPrevChild
+432 (int (*)(...))-16
+440 (int (*)(...))(& _ZTI5QMenu)
+448 (int (*)(...))QMenu::_ZThn16_N5QMenuD1Ev
+456 (int (*)(...))QMenu::_ZThn16_N5QMenuD0Ev
+464 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+472 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+480 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QMenu
+ size=48 align=8
+ base size=48 base align=8
+QMenu (0x0x7f5270bdb820) 0
+ vptr=((& QMenu::_ZTV5QMenu) + 16)
+ QWidget (0x0x7f5270c687e0) 0
+ primary-for QMenu (0x0x7f5270bdb820)
+ QObject (0x0x7f5270c8d420) 0
+ primary-for QWidget (0x0x7f5270c687e0)
+ QPaintDevice (0x0x7f5270c8d480) 16
+ vptr=((& QMenu::_ZTV5QMenu) + 448)
+
+Class QMenuBar::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QMenuBar::QPrivateSignal (0x0x7f5270c8d900) 0 empty
+
+Vtable for QMenuBar
+QMenuBar::_ZTV8QMenuBar: 64 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI8QMenuBar)
+16 (int (*)(...))QMenuBar::metaObject
+24 (int (*)(...))QMenuBar::qt_metacast
+32 (int (*)(...))QMenuBar::qt_metacall
+40 (int (*)(...))QMenuBar::~QMenuBar
+48 (int (*)(...))QMenuBar::~QMenuBar
+56 (int (*)(...))QMenuBar::event
+64 (int (*)(...))QMenuBar::eventFilter
+72 (int (*)(...))QMenuBar::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QMenuBar::setVisible
+128 (int (*)(...))QMenuBar::sizeHint
+136 (int (*)(...))QMenuBar::minimumSizeHint
+144 (int (*)(...))QMenuBar::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QMenuBar::mousePressEvent
+176 (int (*)(...))QMenuBar::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QMenuBar::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QMenuBar::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QMenuBar::focusInEvent
+232 (int (*)(...))QMenuBar::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QMenuBar::leaveEvent
+256 (int (*)(...))QMenuBar::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QMenuBar::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QWidget::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QMenuBar::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QMenuBar::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))-16
+440 (int (*)(...))(& _ZTI8QMenuBar)
+448 (int (*)(...))QMenuBar::_ZThn16_N8QMenuBarD1Ev
+456 (int (*)(...))QMenuBar::_ZThn16_N8QMenuBarD0Ev
+464 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+472 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+480 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QMenuBar
+ size=48 align=8
+ base size=48 base align=8
+QMenuBar (0x0x7f5270bdb888) 0
+ vptr=((& QMenuBar::_ZTV8QMenuBar) + 16)
+ QWidget (0x0x7f5270c68850) 0
+ primary-for QMenuBar (0x0x7f5270bdb888)
+ QObject (0x0x7f5270c8d840) 0
+ primary-for QWidget (0x0x7f5270c68850)
+ QPaintDevice (0x0x7f5270c8d8a0) 16
+ vptr=((& QMenuBar::_ZTV8QMenuBar) + 448)
+
+Class QMessageBox::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QMessageBox::QPrivateSignal (0x0x7f5270c8dc60) 0 empty
+
+Vtable for QMessageBox
+QMessageBox::_ZTV11QMessageBox: 69 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QMessageBox)
+16 (int (*)(...))QMessageBox::metaObject
+24 (int (*)(...))QMessageBox::qt_metacast
+32 (int (*)(...))QMessageBox::qt_metacall
+40 (int (*)(...))QMessageBox::~QMessageBox
+48 (int (*)(...))QMessageBox::~QMessageBox
+56 (int (*)(...))QMessageBox::event
+64 (int (*)(...))QDialog::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QDialog::setVisible
+128 (int (*)(...))QDialog::sizeHint
+136 (int (*)(...))QDialog::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QWidget::mousePressEvent
+176 (int (*)(...))QWidget::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QWidget::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QMessageBox::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QWidget::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QMessageBox::resizeEvent
+280 (int (*)(...))QMessageBox::closeEvent
+288 (int (*)(...))QDialog::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QMessageBox::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QMessageBox::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QDialog::open
+440 (int (*)(...))QDialog::exec
+448 (int (*)(...))QDialog::done
+456 (int (*)(...))QDialog::accept
+464 (int (*)(...))QDialog::reject
+472 (int (*)(...))-16
+480 (int (*)(...))(& _ZTI11QMessageBox)
+488 (int (*)(...))QMessageBox::_ZThn16_N11QMessageBoxD1Ev
+496 (int (*)(...))QMessageBox::_ZThn16_N11QMessageBoxD0Ev
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+520 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+528 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+536 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+544 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QMessageBox
+ size=48 align=8
+ base size=48 base align=8
+QMessageBox (0x0x7f5270bdb8f0) 0
+ vptr=((& QMessageBox::_ZTV11QMessageBox) + 16)
+ QDialog (0x0x7f5270bdb958) 0
+ primary-for QMessageBox (0x0x7f5270bdb8f0)
+ QWidget (0x0x7f5270c689a0) 0
+ primary-for QDialog (0x0x7f5270bdb958)
+ QObject (0x0x7f5270c8dba0) 0
+ primary-for QWidget (0x0x7f5270c689a0)
+ QPaintDevice (0x0x7f5270c8dc00) 16
+ vptr=((& QMessageBox::_ZTV11QMessageBox) + 488)
+
+Class QMouseEventTransition::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QMouseEventTransition::QPrivateSignal (0x0x7f5270cf88a0) 0 empty
+
+Vtable for QMouseEventTransition
+QMouseEventTransition::_ZTV21QMouseEventTransition: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI21QMouseEventTransition)
+16 (int (*)(...))QMouseEventTransition::metaObject
+24 (int (*)(...))QMouseEventTransition::qt_metacast
+32 (int (*)(...))QMouseEventTransition::qt_metacall
+40 (int (*)(...))QMouseEventTransition::~QMouseEventTransition
+48 (int (*)(...))QMouseEventTransition::~QMouseEventTransition
+56 (int (*)(...))QEventTransition::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QMouseEventTransition::eventTest
+120 (int (*)(...))QMouseEventTransition::onTransition
+
+Class QMouseEventTransition
+ size=16 align=8
+ base size=16 base align=8
+QMouseEventTransition (0x0x7f5270bdba90) 0
+ vptr=((& QMouseEventTransition::_ZTV21QMouseEventTransition) + 16)
+ QEventTransition (0x0x7f5270bdbaf8) 0
+ primary-for QMouseEventTransition (0x0x7f5270bdba90)
+ QAbstractTransition (0x0x7f5270bdbb60) 0
+ primary-for QEventTransition (0x0x7f5270bdbaf8)
+ QObject (0x0x7f5270cf8840) 0
+ primary-for QAbstractTransition (0x0x7f5270bdbb60)
+
+Class QOpenGLWidget::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QOpenGLWidget::QPrivateSignal (0x0x7f5270cf8b40) 0 empty
+
+Vtable for QOpenGLWidget
+QOpenGLWidget::_ZTV13QOpenGLWidget: 67 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QOpenGLWidget)
+16 (int (*)(...))QOpenGLWidget::metaObject
+24 (int (*)(...))QOpenGLWidget::qt_metacast
+32 (int (*)(...))QOpenGLWidget::qt_metacall
+40 (int (*)(...))QOpenGLWidget::~QOpenGLWidget
+48 (int (*)(...))QOpenGLWidget::~QOpenGLWidget
+56 (int (*)(...))QOpenGLWidget::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QWidget::sizeHint
+136 (int (*)(...))QWidget::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QOpenGLWidget::paintEngine
+168 (int (*)(...))QWidget::mousePressEvent
+176 (int (*)(...))QWidget::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QWidget::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QWidget::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QOpenGLWidget::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QOpenGLWidget::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QWidget::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QWidget::changeEvent
+376 (int (*)(...))QOpenGLWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QOpenGLWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QOpenGLWidget::initializeGL
+440 (int (*)(...))QOpenGLWidget::resizeGL
+448 (int (*)(...))QOpenGLWidget::paintGL
+456 (int (*)(...))-16
+464 (int (*)(...))(& _ZTI13QOpenGLWidget)
+472 (int (*)(...))QOpenGLWidget::_ZThn16_N13QOpenGLWidgetD1Ev
+480 (int (*)(...))QOpenGLWidget::_ZThn16_N13QOpenGLWidgetD0Ev
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+496 (int (*)(...))QOpenGLWidget::_ZThn16_NK13QOpenGLWidget11paintEngineEv
+504 (int (*)(...))QOpenGLWidget::_ZThn16_NK13QOpenGLWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+520 (int (*)(...))QOpenGLWidget::_ZThn16_NK13QOpenGLWidget10redirectedEP6QPoint
+528 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QOpenGLWidget
+ size=48 align=8
+ base size=48 base align=8
+QOpenGLWidget (0x0x7f5270bdbbc8) 0
+ vptr=((& QOpenGLWidget::_ZTV13QOpenGLWidget) + 16)
+ QWidget (0x0x7f5270cf7690) 0
+ primary-for QOpenGLWidget (0x0x7f5270bdbbc8)
+ QObject (0x0x7f5270cf8a80) 0
+ primary-for QWidget (0x0x7f5270cf7690)
+ QPaintDevice (0x0x7f5270cf8ae0) 16
+ vptr=((& QOpenGLWidget::_ZTV13QOpenGLWidget) + 472)
+
+Class QTextEdit::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTextEdit::QPrivateSignal (0x0x7f5270cf8de0) 0 empty
+
+Class QTextEdit::ExtraSelection
+ size=24 align=8
+ base size=24 base align=8
+QTextEdit::ExtraSelection (0x0x7f5270cf8e40) 0
+
+Vtable for QTextEdit
+QTextEdit::_ZTV9QTextEdit: 73 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QTextEdit)
+16 (int (*)(...))QTextEdit::metaObject
+24 (int (*)(...))QTextEdit::qt_metacast
+32 (int (*)(...))QTextEdit::qt_metacall
+40 (int (*)(...))QTextEdit::~QTextEdit
+48 (int (*)(...))QTextEdit::~QTextEdit
+56 (int (*)(...))QTextEdit::event
+64 (int (*)(...))QAbstractScrollArea::eventFilter
+72 (int (*)(...))QTextEdit::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QAbstractScrollArea::sizeHint
+136 (int (*)(...))QAbstractScrollArea::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QTextEdit::mousePressEvent
+176 (int (*)(...))QTextEdit::mouseReleaseEvent
+184 (int (*)(...))QTextEdit::mouseDoubleClickEvent
+192 (int (*)(...))QTextEdit::mouseMoveEvent
+200 (int (*)(...))QTextEdit::wheelEvent
+208 (int (*)(...))QTextEdit::keyPressEvent
+216 (int (*)(...))QTextEdit::keyReleaseEvent
+224 (int (*)(...))QTextEdit::focusInEvent
+232 (int (*)(...))QTextEdit::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QTextEdit::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QTextEdit::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QTextEdit::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QTextEdit::dragEnterEvent
+320 (int (*)(...))QTextEdit::dragMoveEvent
+328 (int (*)(...))QTextEdit::dragLeaveEvent
+336 (int (*)(...))QTextEdit::dropEvent
+344 (int (*)(...))QTextEdit::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QTextEdit::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QTextEdit::inputMethodEvent
+416 (int (*)(...))QTextEdit::inputMethodQuery
+424 (int (*)(...))QTextEdit::focusNextPrevChild
+432 (int (*)(...))QAbstractScrollArea::setupViewport
+440 (int (*)(...))QAbstractScrollArea::viewportEvent
+448 (int (*)(...))QTextEdit::scrollContentsBy
+456 (int (*)(...))QAbstractScrollArea::viewportSizeHint
+464 (int (*)(...))QTextEdit::loadResource
+472 (int (*)(...))QTextEdit::createMimeDataFromSelection
+480 (int (*)(...))QTextEdit::canInsertFromMimeData
+488 (int (*)(...))QTextEdit::insertFromMimeData
+496 (int (*)(...))QTextEdit::doSetTextCursor
+504 (int (*)(...))-16
+512 (int (*)(...))(& _ZTI9QTextEdit)
+520 (int (*)(...))QTextEdit::_ZThn16_N9QTextEditD1Ev
+528 (int (*)(...))QTextEdit::_ZThn16_N9QTextEditD0Ev
+536 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+544 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+552 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+560 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+568 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+576 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QTextEdit
+ size=48 align=8
+ base size=48 base align=8
+QTextEdit (0x0x7f5270bdbc98) 0
+ vptr=((& QTextEdit::_ZTV9QTextEdit) + 16)
+ QAbstractScrollArea (0x0x7f5270bdbd00) 0
+ primary-for QTextEdit (0x0x7f5270bdbc98)
+ QFrame (0x0x7f5270bdbd68) 0
+ primary-for QAbstractScrollArea (0x0x7f5270bdbd00)
+ QWidget (0x0x7f5270cf78c0) 0
+ primary-for QFrame (0x0x7f5270bdbd68)
+ QObject (0x0x7f5270cf8d20) 0
+ primary-for QWidget (0x0x7f5270cf78c0)
+ QPaintDevice (0x0x7f5270cf8d80) 16
+ vptr=((& QTextEdit::_ZTV9QTextEdit) + 520)
+
+Class QPlainTextEdit::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QPlainTextEdit::QPrivateSignal (0x0x7f5270968ae0) 0 empty
+
+Vtable for QPlainTextEdit
+QPlainTextEdit::_ZTV14QPlainTextEdit: 73 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QPlainTextEdit)
+16 (int (*)(...))QPlainTextEdit::metaObject
+24 (int (*)(...))QPlainTextEdit::qt_metacast
+32 (int (*)(...))QPlainTextEdit::qt_metacall
+40 (int (*)(...))QPlainTextEdit::~QPlainTextEdit
+48 (int (*)(...))QPlainTextEdit::~QPlainTextEdit
+56 (int (*)(...))QPlainTextEdit::event
+64 (int (*)(...))QAbstractScrollArea::eventFilter
+72 (int (*)(...))QPlainTextEdit::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QAbstractScrollArea::sizeHint
+136 (int (*)(...))QAbstractScrollArea::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QPlainTextEdit::mousePressEvent
+176 (int (*)(...))QPlainTextEdit::mouseReleaseEvent
+184 (int (*)(...))QPlainTextEdit::mouseDoubleClickEvent
+192 (int (*)(...))QPlainTextEdit::mouseMoveEvent
+200 (int (*)(...))QPlainTextEdit::wheelEvent
+208 (int (*)(...))QPlainTextEdit::keyPressEvent
+216 (int (*)(...))QPlainTextEdit::keyReleaseEvent
+224 (int (*)(...))QPlainTextEdit::focusInEvent
+232 (int (*)(...))QPlainTextEdit::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QPlainTextEdit::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QPlainTextEdit::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QPlainTextEdit::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QPlainTextEdit::dragEnterEvent
+320 (int (*)(...))QPlainTextEdit::dragMoveEvent
+328 (int (*)(...))QPlainTextEdit::dragLeaveEvent
+336 (int (*)(...))QPlainTextEdit::dropEvent
+344 (int (*)(...))QPlainTextEdit::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QPlainTextEdit::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QPlainTextEdit::inputMethodEvent
+416 (int (*)(...))QPlainTextEdit::inputMethodQuery
+424 (int (*)(...))QPlainTextEdit::focusNextPrevChild
+432 (int (*)(...))QAbstractScrollArea::setupViewport
+440 (int (*)(...))QAbstractScrollArea::viewportEvent
+448 (int (*)(...))QPlainTextEdit::scrollContentsBy
+456 (int (*)(...))QAbstractScrollArea::viewportSizeHint
+464 (int (*)(...))QPlainTextEdit::loadResource
+472 (int (*)(...))QPlainTextEdit::createMimeDataFromSelection
+480 (int (*)(...))QPlainTextEdit::canInsertFromMimeData
+488 (int (*)(...))QPlainTextEdit::insertFromMimeData
+496 (int (*)(...))QPlainTextEdit::doSetTextCursor
+504 (int (*)(...))-16
+512 (int (*)(...))(& _ZTI14QPlainTextEdit)
+520 (int (*)(...))QPlainTextEdit::_ZThn16_N14QPlainTextEditD1Ev
+528 (int (*)(...))QPlainTextEdit::_ZThn16_N14QPlainTextEditD0Ev
+536 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+544 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+552 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+560 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+568 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+576 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QPlainTextEdit
+ size=48 align=8
+ base size=48 base align=8
+QPlainTextEdit (0x0x7f5270bdbea0) 0
+ vptr=((& QPlainTextEdit::_ZTV14QPlainTextEdit) + 16)
+ QAbstractScrollArea (0x0x7f5270bdbf08) 0
+ primary-for QPlainTextEdit (0x0x7f5270bdbea0)
+ QFrame (0x0x7f5270bdbf70) 0
+ primary-for QAbstractScrollArea (0x0x7f5270bdbf08)
+ QWidget (0x0x7f527097b540) 0
+ primary-for QFrame (0x0x7f5270bdbf70)
+ QObject (0x0x7f5270968a20) 0
+ primary-for QWidget (0x0x7f527097b540)
+ QPaintDevice (0x0x7f5270968a80) 16
+ vptr=((& QPlainTextEdit::_ZTV14QPlainTextEdit) + 520)
+
+Class QPlainTextDocumentLayout::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QPlainTextDocumentLayout::QPrivateSignal (0x0x7f52709cc0c0) 0 empty
+
+Vtable for QPlainTextDocumentLayout
+QPlainTextDocumentLayout::_ZTV24QPlainTextDocumentLayout: 24 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI24QPlainTextDocumentLayout)
+16 (int (*)(...))QPlainTextDocumentLayout::metaObject
+24 (int (*)(...))QPlainTextDocumentLayout::qt_metacast
+32 (int (*)(...))QPlainTextDocumentLayout::qt_metacall
+40 (int (*)(...))QPlainTextDocumentLayout::~QPlainTextDocumentLayout
+48 (int (*)(...))QPlainTextDocumentLayout::~QPlainTextDocumentLayout
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QPlainTextDocumentLayout::draw
+120 (int (*)(...))QPlainTextDocumentLayout::hitTest
+128 (int (*)(...))QPlainTextDocumentLayout::pageCount
+136 (int (*)(...))QPlainTextDocumentLayout::documentSize
+144 (int (*)(...))QPlainTextDocumentLayout::frameBoundingRect
+152 (int (*)(...))QPlainTextDocumentLayout::blockBoundingRect
+160 (int (*)(...))QPlainTextDocumentLayout::documentChanged
+168 (int (*)(...))QAbstractTextDocumentLayout::resizeInlineObject
+176 (int (*)(...))QAbstractTextDocumentLayout::positionInlineObject
+184 (int (*)(...))QAbstractTextDocumentLayout::drawInlineObject
+
+Class QPlainTextDocumentLayout
+ size=16 align=8
+ base size=16 base align=8
+QPlainTextDocumentLayout (0x0x7f52709cd000) 0
+ vptr=((& QPlainTextDocumentLayout::_ZTV24QPlainTextDocumentLayout) + 16)
+ QAbstractTextDocumentLayout (0x0x7f52709cd068) 0
+ primary-for QPlainTextDocumentLayout (0x0x7f52709cd000)
+ QObject (0x0x7f52709cc060) 0
+ primary-for QAbstractTextDocumentLayout (0x0x7f52709cd068)
+
+Class QProgressBar::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QProgressBar::QPrivateSignal (0x0x7f52709cc360) 0 empty
+
+Vtable for QProgressBar
+QProgressBar::_ZTV12QProgressBar: 65 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QProgressBar)
+16 (int (*)(...))QProgressBar::metaObject
+24 (int (*)(...))QProgressBar::qt_metacast
+32 (int (*)(...))QProgressBar::qt_metacall
+40 (int (*)(...))QProgressBar::~QProgressBar
+48 (int (*)(...))QProgressBar::~QProgressBar
+56 (int (*)(...))QProgressBar::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QProgressBar::sizeHint
+136 (int (*)(...))QProgressBar::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QWidget::mousePressEvent
+176 (int (*)(...))QWidget::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QWidget::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QWidget::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QProgressBar::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QWidget::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QWidget::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QWidget::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QProgressBar::text
+440 (int (*)(...))-16
+448 (int (*)(...))(& _ZTI12QProgressBar)
+456 (int (*)(...))QProgressBar::_ZThn16_N12QProgressBarD1Ev
+464 (int (*)(...))QProgressBar::_ZThn16_N12QProgressBarD0Ev
+472 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+480 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+512 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QProgressBar
+ size=48 align=8
+ base size=48 base align=8
+QProgressBar (0x0x7f52709cd0d0) 0
+ vptr=((& QProgressBar::_ZTV12QProgressBar) + 16)
+ QWidget (0x0x7f527097b700) 0
+ primary-for QProgressBar (0x0x7f52709cd0d0)
+ QObject (0x0x7f52709cc2a0) 0
+ primary-for QWidget (0x0x7f527097b700)
+ QPaintDevice (0x0x7f52709cc300) 16
+ vptr=((& QProgressBar::_ZTV12QProgressBar) + 456)
+
+Class QProgressDialog::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QProgressDialog::QPrivateSignal (0x0x7f52709cc6c0) 0 empty
+
+Vtable for QProgressDialog
+QProgressDialog::_ZTV15QProgressDialog: 69 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QProgressDialog)
+16 (int (*)(...))QProgressDialog::metaObject
+24 (int (*)(...))QProgressDialog::qt_metacast
+32 (int (*)(...))QProgressDialog::qt_metacall
+40 (int (*)(...))QProgressDialog::~QProgressDialog
+48 (int (*)(...))QProgressDialog::~QProgressDialog
+56 (int (*)(...))QWidget::event
+64 (int (*)(...))QDialog::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QDialog::setVisible
+128 (int (*)(...))QProgressDialog::sizeHint
+136 (int (*)(...))QDialog::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QWidget::mousePressEvent
+176 (int (*)(...))QWidget::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QWidget::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QDialog::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QWidget::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QProgressDialog::resizeEvent
+280 (int (*)(...))QProgressDialog::closeEvent
+288 (int (*)(...))QDialog::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QProgressDialog::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QProgressDialog::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QDialog::open
+440 (int (*)(...))QDialog::exec
+448 (int (*)(...))QDialog::done
+456 (int (*)(...))QDialog::accept
+464 (int (*)(...))QDialog::reject
+472 (int (*)(...))-16
+480 (int (*)(...))(& _ZTI15QProgressDialog)
+488 (int (*)(...))QProgressDialog::_ZThn16_N15QProgressDialogD1Ev
+496 (int (*)(...))QProgressDialog::_ZThn16_N15QProgressDialogD0Ev
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+520 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+528 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+536 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+544 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QProgressDialog
+ size=48 align=8
+ base size=48 base align=8
+QProgressDialog (0x0x7f52709cd138) 0
+ vptr=((& QProgressDialog::_ZTV15QProgressDialog) + 16)
+ QDialog (0x0x7f52709cd1a0) 0
+ primary-for QProgressDialog (0x0x7f52709cd138)
+ QWidget (0x0x7f527097b930) 0
+ primary-for QDialog (0x0x7f52709cd1a0)
+ QObject (0x0x7f52709cc600) 0
+ primary-for QWidget (0x0x7f527097b930)
+ QPaintDevice (0x0x7f52709cc660) 16
+ vptr=((& QProgressDialog::_ZTV15QProgressDialog) + 488)
+
+Class QProxyStyle::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QProxyStyle::QPrivateSignal (0x0x7f52709cc900) 0 empty
+
+Vtable for QProxyStyle
+QProxyStyle::_ZTV11QProxyStyle: 37 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QProxyStyle)
+16 (int (*)(...))QProxyStyle::metaObject
+24 (int (*)(...))QProxyStyle::qt_metacast
+32 (int (*)(...))QProxyStyle::qt_metacall
+40 (int (*)(...))QProxyStyle::~QProxyStyle
+48 (int (*)(...))QProxyStyle::~QProxyStyle
+56 (int (*)(...))QProxyStyle::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QProxyStyle::polish
+120 (int (*)(...))QProxyStyle::unpolish
+128 (int (*)(...))QProxyStyle::polish
+136 (int (*)(...))QProxyStyle::unpolish
+144 (int (*)(...))QProxyStyle::polish
+152 (int (*)(...))QProxyStyle::itemTextRect
+160 (int (*)(...))QProxyStyle::itemPixmapRect
+168 (int (*)(...))QProxyStyle::drawItemText
+176 (int (*)(...))QProxyStyle::drawItemPixmap
+184 (int (*)(...))QProxyStyle::standardPalette
+192 (int (*)(...))QProxyStyle::drawPrimitive
+200 (int (*)(...))QProxyStyle::drawControl
+208 (int (*)(...))QProxyStyle::subElementRect
+216 (int (*)(...))QProxyStyle::drawComplexControl
+224 (int (*)(...))QProxyStyle::hitTestComplexControl
+232 (int (*)(...))QProxyStyle::subControlRect
+240 (int (*)(...))QProxyStyle::pixelMetric
+248 (int (*)(...))QProxyStyle::sizeFromContents
+256 (int (*)(...))QProxyStyle::styleHint
+264 (int (*)(...))QProxyStyle::standardPixmap
+272 (int (*)(...))QProxyStyle::standardIcon
+280 (int (*)(...))QProxyStyle::generatedIconPixmap
+288 (int (*)(...))QProxyStyle::layoutSpacing
+
+Class QProxyStyle
+ size=16 align=8
+ base size=16 base align=8
+QProxyStyle (0x0x7f52709cd208) 0
+ vptr=((& QProxyStyle::_ZTV11QProxyStyle) + 16)
+ QCommonStyle (0x0x7f52709cd270) 0
+ primary-for QProxyStyle (0x0x7f52709cd208)
+ QStyle (0x0x7f52709cd2d8) 0
+ primary-for QCommonStyle (0x0x7f52709cd270)
+ QObject (0x0x7f52709cc8a0) 0
+ primary-for QStyle (0x0x7f52709cd2d8)
+
+Class QRadioButton::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QRadioButton::QPrivateSignal (0x0x7f52709ccba0) 0 empty
+
+Vtable for QRadioButton
+QRadioButton::_ZTV12QRadioButton: 67 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QRadioButton)
+16 (int (*)(...))QRadioButton::metaObject
+24 (int (*)(...))QRadioButton::qt_metacast
+32 (int (*)(...))QRadioButton::qt_metacall
+40 (int (*)(...))QRadioButton::~QRadioButton
+48 (int (*)(...))QRadioButton::~QRadioButton
+56 (int (*)(...))QRadioButton::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QAbstractButton::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QRadioButton::sizeHint
+136 (int (*)(...))QRadioButton::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QAbstractButton::mousePressEvent
+176 (int (*)(...))QAbstractButton::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QRadioButton::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QAbstractButton::keyPressEvent
+216 (int (*)(...))QAbstractButton::keyReleaseEvent
+224 (int (*)(...))QAbstractButton::focusInEvent
+232 (int (*)(...))QAbstractButton::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QRadioButton::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QWidget::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QWidget::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QAbstractButton::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QRadioButton::hitButton
+440 (int (*)(...))QAbstractButton::checkStateSet
+448 (int (*)(...))QAbstractButton::nextCheckState
+456 (int (*)(...))-16
+464 (int (*)(...))(& _ZTI12QRadioButton)
+472 (int (*)(...))QRadioButton::_ZThn16_N12QRadioButtonD1Ev
+480 (int (*)(...))QRadioButton::_ZThn16_N12QRadioButtonD0Ev
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+520 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+528 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QRadioButton
+ size=48 align=8
+ base size=48 base align=8
+QRadioButton (0x0x7f52709cd340) 0
+ vptr=((& QRadioButton::_ZTV12QRadioButton) + 16)
+ QAbstractButton (0x0x7f52709cd3a8) 0
+ primary-for QRadioButton (0x0x7f52709cd340)
+ QWidget (0x0x7f527097bb60) 0
+ primary-for QAbstractButton (0x0x7f52709cd3a8)
+ QObject (0x0x7f52709ccae0) 0
+ primary-for QWidget (0x0x7f527097bb60)
+ QPaintDevice (0x0x7f52709ccb40) 16
+ vptr=((& QRadioButton::_ZTV12QRadioButton) + 472)
+
+Class QScrollBar::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QScrollBar::QPrivateSignal (0x0x7f52709cce40) 0 empty
+
+Vtable for QScrollBar
+QScrollBar::_ZTV10QScrollBar: 65 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QScrollBar)
+16 (int (*)(...))QScrollBar::metaObject
+24 (int (*)(...))QScrollBar::qt_metacast
+32 (int (*)(...))QScrollBar::qt_metacall
+40 (int (*)(...))QScrollBar::~QScrollBar
+48 (int (*)(...))QScrollBar::~QScrollBar
+56 (int (*)(...))QScrollBar::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QAbstractSlider::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QScrollBar::sizeHint
+136 (int (*)(...))QWidget::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QScrollBar::mousePressEvent
+176 (int (*)(...))QScrollBar::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QScrollBar::mouseMoveEvent
+200 (int (*)(...))QScrollBar::wheelEvent
+208 (int (*)(...))QAbstractSlider::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QScrollBar::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QWidget::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QScrollBar::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QScrollBar::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QAbstractSlider::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QScrollBar::sliderChange
+440 (int (*)(...))-16
+448 (int (*)(...))(& _ZTI10QScrollBar)
+456 (int (*)(...))QScrollBar::_ZThn16_N10QScrollBarD1Ev
+464 (int (*)(...))QScrollBar::_ZThn16_N10QScrollBarD0Ev
+472 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+480 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+512 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QScrollBar
+ size=48 align=8
+ base size=48 base align=8
+QScrollBar (0x0x7f52709cd410) 0
+ vptr=((& QScrollBar::_ZTV10QScrollBar) + 16)
+ QAbstractSlider (0x0x7f52709cd478) 0
+ primary-for QScrollBar (0x0x7f52709cd410)
+ QWidget (0x0x7f527097bcb0) 0
+ primary-for QAbstractSlider (0x0x7f52709cd478)
+ QObject (0x0x7f52709ccd80) 0
+ primary-for QWidget (0x0x7f527097bcb0)
+ QPaintDevice (0x0x7f52709ccde0) 16
+ vptr=((& QScrollBar::_ZTV10QScrollBar) + 456)
+
+Vtable for QScrollerProperties
+QScrollerProperties::_ZTV19QScrollerProperties: 4 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QScrollerProperties)
+16 (int (*)(...))QScrollerProperties::~QScrollerProperties
+24 (int (*)(...))QScrollerProperties::~QScrollerProperties
+
+Class QScrollerProperties
+ size=16 align=8
+ base size=16 base align=8
+QScrollerProperties (0x0x7f5270a45060) 0
+ vptr=((& QScrollerProperties::_ZTV19QScrollerProperties) + 16)
+
+Class QScroller::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QScroller::QPrivateSignal (0x0x7f5270a45540) 0 empty
+
+Vtable for QScroller
+QScroller::_ZTV9QScroller: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QScroller)
+16 (int (*)(...))QScroller::metaObject
+24 (int (*)(...))QScroller::qt_metacast
+32 (int (*)(...))QScroller::qt_metacall
+40 (int (*)(...))QScroller::~QScroller
+48 (int (*)(...))QScroller::~QScroller
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QScroller
+ size=24 align=8
+ base size=24 base align=8
+QScroller (0x0x7f52709cd4e0) 0
+ vptr=((& QScroller::_ZTV9QScroller) + 16)
+ QObject (0x0x7f5270a454e0) 0
+ primary-for QScroller (0x0x7f52709cd4e0)
+
+Class QShortcut::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QShortcut::QPrivateSignal (0x0x7f5270a45840) 0 empty
+
+Vtable for QShortcut
+QShortcut::_ZTV9QShortcut: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QShortcut)
+16 (int (*)(...))QShortcut::metaObject
+24 (int (*)(...))QShortcut::qt_metacast
+32 (int (*)(...))QShortcut::qt_metacall
+40 (int (*)(...))QShortcut::~QShortcut
+48 (int (*)(...))QShortcut::~QShortcut
+56 (int (*)(...))QShortcut::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QShortcut
+ size=16 align=8
+ base size=16 base align=8
+QShortcut (0x0x7f52709cd548) 0
+ vptr=((& QShortcut::_ZTV9QShortcut) + 16)
+ QObject (0x0x7f5270a457e0) 0
+ primary-for QShortcut (0x0x7f52709cd548)
+
+Class QSizeGrip::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSizeGrip::QPrivateSignal (0x0x7f5270a45cc0) 0 empty
+
+Vtable for QSizeGrip
+QSizeGrip::_ZTV9QSizeGrip: 64 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QSizeGrip)
+16 (int (*)(...))QSizeGrip::metaObject
+24 (int (*)(...))QSizeGrip::qt_metacast
+32 (int (*)(...))QSizeGrip::qt_metacall
+40 (int (*)(...))QSizeGrip::~QSizeGrip
+48 (int (*)(...))QSizeGrip::~QSizeGrip
+56 (int (*)(...))QSizeGrip::event
+64 (int (*)(...))QSizeGrip::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QSizeGrip::setVisible
+128 (int (*)(...))QSizeGrip::sizeHint
+136 (int (*)(...))QWidget::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QSizeGrip::mousePressEvent
+176 (int (*)(...))QSizeGrip::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QSizeGrip::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QWidget::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QSizeGrip::paintEvent
+264 (int (*)(...))QSizeGrip::moveEvent
+272 (int (*)(...))QWidget::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QWidget::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QSizeGrip::showEvent
+352 (int (*)(...))QSizeGrip::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QWidget::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))-16
+440 (int (*)(...))(& _ZTI9QSizeGrip)
+448 (int (*)(...))QSizeGrip::_ZThn16_N9QSizeGripD1Ev
+456 (int (*)(...))QSizeGrip::_ZThn16_N9QSizeGripD0Ev
+464 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+472 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+480 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QSizeGrip
+ size=48 align=8
+ base size=48 base align=8
+QSizeGrip (0x0x7f52709cd5b0) 0
+ vptr=((& QSizeGrip::_ZTV9QSizeGrip) + 16)
+ QWidget (0x0x7f5270a60a10) 0
+ primary-for QSizeGrip (0x0x7f52709cd5b0)
+ QObject (0x0x7f5270a45c00) 0
+ primary-for QWidget (0x0x7f5270a60a10)
+ QPaintDevice (0x0x7f5270a45c60) 16
+ vptr=((& QSizeGrip::_ZTV9QSizeGrip) + 448)
+
+Class QSpinBox::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSpinBox::QPrivateSignal (0x0x7f5270a45f60) 0 empty
+
+Vtable for QSpinBox
+QSpinBox::_ZTV8QSpinBox: 71 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI8QSpinBox)
+16 (int (*)(...))QSpinBox::metaObject
+24 (int (*)(...))QSpinBox::qt_metacast
+32 (int (*)(...))QSpinBox::qt_metacall
+40 (int (*)(...))QSpinBox::~QSpinBox
+48 (int (*)(...))QSpinBox::~QSpinBox
+56 (int (*)(...))QSpinBox::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QAbstractSpinBox::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QAbstractSpinBox::sizeHint
+136 (int (*)(...))QAbstractSpinBox::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QAbstractSpinBox::mousePressEvent
+176 (int (*)(...))QAbstractSpinBox::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QAbstractSpinBox::mouseMoveEvent
+200 (int (*)(...))QAbstractSpinBox::wheelEvent
+208 (int (*)(...))QAbstractSpinBox::keyPressEvent
+216 (int (*)(...))QAbstractSpinBox::keyReleaseEvent
+224 (int (*)(...))QAbstractSpinBox::focusInEvent
+232 (int (*)(...))QAbstractSpinBox::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QAbstractSpinBox::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QAbstractSpinBox::resizeEvent
+280 (int (*)(...))QAbstractSpinBox::closeEvent
+288 (int (*)(...))QAbstractSpinBox::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QAbstractSpinBox::showEvent
+352 (int (*)(...))QAbstractSpinBox::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QAbstractSpinBox::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QAbstractSpinBox::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QSpinBox::validate
+440 (int (*)(...))QSpinBox::fixup
+448 (int (*)(...))QAbstractSpinBox::stepBy
+456 (int (*)(...))QAbstractSpinBox::clear
+464 (int (*)(...))QAbstractSpinBox::stepEnabled
+472 (int (*)(...))QSpinBox::valueFromText
+480 (int (*)(...))QSpinBox::textFromValue
+488 (int (*)(...))-16
+496 (int (*)(...))(& _ZTI8QSpinBox)
+504 (int (*)(...))QSpinBox::_ZThn16_N8QSpinBoxD1Ev
+512 (int (*)(...))QSpinBox::_ZThn16_N8QSpinBoxD0Ev
+520 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+528 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+536 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+544 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+552 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+560 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QSpinBox
+ size=48 align=8
+ base size=48 base align=8
+QSpinBox (0x0x7f52709cd618) 0
+ vptr=((& QSpinBox::_ZTV8QSpinBox) + 16)
+ QAbstractSpinBox (0x0x7f52709cd680) 0
+ primary-for QSpinBox (0x0x7f52709cd618)
+ QWidget (0x0x7f5270a60a80) 0
+ primary-for QAbstractSpinBox (0x0x7f52709cd680)
+ QObject (0x0x7f5270a45ea0) 0
+ primary-for QWidget (0x0x7f5270a60a80)
+ QPaintDevice (0x0x7f5270a45f00) 16
+ vptr=((& QSpinBox::_ZTV8QSpinBox) + 504)
+
+Class QDoubleSpinBox::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QDoubleSpinBox::QPrivateSignal (0x0x7f5270ab7240) 0 empty
+
+Vtable for QDoubleSpinBox
+QDoubleSpinBox::_ZTV14QDoubleSpinBox: 71 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QDoubleSpinBox)
+16 (int (*)(...))QDoubleSpinBox::metaObject
+24 (int (*)(...))QDoubleSpinBox::qt_metacast
+32 (int (*)(...))QDoubleSpinBox::qt_metacall
+40 (int (*)(...))QDoubleSpinBox::~QDoubleSpinBox
+48 (int (*)(...))QDoubleSpinBox::~QDoubleSpinBox
+56 (int (*)(...))QAbstractSpinBox::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QAbstractSpinBox::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QAbstractSpinBox::sizeHint
+136 (int (*)(...))QAbstractSpinBox::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QAbstractSpinBox::mousePressEvent
+176 (int (*)(...))QAbstractSpinBox::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QAbstractSpinBox::mouseMoveEvent
+200 (int (*)(...))QAbstractSpinBox::wheelEvent
+208 (int (*)(...))QAbstractSpinBox::keyPressEvent
+216 (int (*)(...))QAbstractSpinBox::keyReleaseEvent
+224 (int (*)(...))QAbstractSpinBox::focusInEvent
+232 (int (*)(...))QAbstractSpinBox::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QAbstractSpinBox::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QAbstractSpinBox::resizeEvent
+280 (int (*)(...))QAbstractSpinBox::closeEvent
+288 (int (*)(...))QAbstractSpinBox::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QAbstractSpinBox::showEvent
+352 (int (*)(...))QAbstractSpinBox::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QAbstractSpinBox::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QAbstractSpinBox::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QDoubleSpinBox::validate
+440 (int (*)(...))QDoubleSpinBox::fixup
+448 (int (*)(...))QAbstractSpinBox::stepBy
+456 (int (*)(...))QAbstractSpinBox::clear
+464 (int (*)(...))QAbstractSpinBox::stepEnabled
+472 (int (*)(...))QDoubleSpinBox::valueFromText
+480 (int (*)(...))QDoubleSpinBox::textFromValue
+488 (int (*)(...))-16
+496 (int (*)(...))(& _ZTI14QDoubleSpinBox)
+504 (int (*)(...))QDoubleSpinBox::_ZThn16_N14QDoubleSpinBoxD1Ev
+512 (int (*)(...))QDoubleSpinBox::_ZThn16_N14QDoubleSpinBoxD0Ev
+520 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+528 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+536 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+544 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+552 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+560 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QDoubleSpinBox
+ size=48 align=8
+ base size=48 base align=8
+QDoubleSpinBox (0x0x7f52709cd6e8) 0
+ vptr=((& QDoubleSpinBox::_ZTV14QDoubleSpinBox) + 16)
+ QAbstractSpinBox (0x0x7f52709cd750) 0
+ primary-for QDoubleSpinBox (0x0x7f52709cd6e8)
+ QWidget (0x0x7f5270a60bd0) 0
+ primary-for QAbstractSpinBox (0x0x7f52709cd750)
+ QObject (0x0x7f5270ab7180) 0
+ primary-for QWidget (0x0x7f5270a60bd0)
+ QPaintDevice (0x0x7f5270ab71e0) 16
+ vptr=((& QDoubleSpinBox::_ZTV14QDoubleSpinBox) + 504)
+
+Class QSplashScreen::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSplashScreen::QPrivateSignal (0x0x7f5270ab74e0) 0 empty
+
+Vtable for QSplashScreen
+QSplashScreen::_ZTV13QSplashScreen: 65 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QSplashScreen)
+16 (int (*)(...))QSplashScreen::metaObject
+24 (int (*)(...))QSplashScreen::qt_metacast
+32 (int (*)(...))QSplashScreen::qt_metacall
+40 (int (*)(...))QSplashScreen::~QSplashScreen
+48 (int (*)(...))QSplashScreen::~QSplashScreen
+56 (int (*)(...))QSplashScreen::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QWidget::sizeHint
+136 (int (*)(...))QWidget::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QSplashScreen::mousePressEvent
+176 (int (*)(...))QWidget::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QWidget::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QWidget::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QWidget::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QWidget::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QWidget::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QWidget::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QSplashScreen::drawContents
+440 (int (*)(...))-16
+448 (int (*)(...))(& _ZTI13QSplashScreen)
+456 (int (*)(...))QSplashScreen::_ZThn16_N13QSplashScreenD1Ev
+464 (int (*)(...))QSplashScreen::_ZThn16_N13QSplashScreenD0Ev
+472 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+480 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+512 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QSplashScreen
+ size=48 align=8
+ base size=48 base align=8
+QSplashScreen (0x0x7f52709cd7b8) 0
+ vptr=((& QSplashScreen::_ZTV13QSplashScreen) + 16)
+ QWidget (0x0x7f5270a60d20) 0
+ primary-for QSplashScreen (0x0x7f52709cd7b8)
+ QObject (0x0x7f5270ab7420) 0
+ primary-for QWidget (0x0x7f5270a60d20)
+ QPaintDevice (0x0x7f5270ab7480) 16
+ vptr=((& QSplashScreen::_ZTV13QSplashScreen) + 456)
+
+Class QSplitter::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSplitter::QPrivateSignal (0x0x7f5270ab7780) 0 empty
+
+Vtable for QSplitter
+QSplitter::_ZTV9QSplitter: 65 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QSplitter)
+16 (int (*)(...))QSplitter::metaObject
+24 (int (*)(...))QSplitter::qt_metacast
+32 (int (*)(...))QSplitter::qt_metacall
+40 (int (*)(...))QSplitter::~QSplitter
+48 (int (*)(...))QSplitter::~QSplitter
+56 (int (*)(...))QSplitter::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QSplitter::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QSplitter::sizeHint
+136 (int (*)(...))QSplitter::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QWidget::mousePressEvent
+176 (int (*)(...))QWidget::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QWidget::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QWidget::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QFrame::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QSplitter::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QWidget::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QSplitter::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QSplitter::createHandle
+440 (int (*)(...))-16
+448 (int (*)(...))(& _ZTI9QSplitter)
+456 (int (*)(...))QSplitter::_ZThn16_N9QSplitterD1Ev
+464 (int (*)(...))QSplitter::_ZThn16_N9QSplitterD0Ev
+472 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+480 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+512 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QSplitter
+ size=48 align=8
+ base size=48 base align=8
+QSplitter (0x0x7f52709cd820) 0
+ vptr=((& QSplitter::_ZTV9QSplitter) + 16)
+ QFrame (0x0x7f52709cd888) 0
+ primary-for QSplitter (0x0x7f52709cd820)
+ QWidget (0x0x7f5270a60e70) 0
+ primary-for QFrame (0x0x7f52709cd888)
+ QObject (0x0x7f5270ab76c0) 0
+ primary-for QWidget (0x0x7f5270a60e70)
+ QPaintDevice (0x0x7f5270ab7720) 16
+ vptr=((& QSplitter::_ZTV9QSplitter) + 456)
+
+Class QSplitterHandle::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSplitterHandle::QPrivateSignal (0x0x7f5270ab7a20) 0 empty
+
+Vtable for QSplitterHandle
+QSplitterHandle::_ZTV15QSplitterHandle: 64 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QSplitterHandle)
+16 (int (*)(...))QSplitterHandle::metaObject
+24 (int (*)(...))QSplitterHandle::qt_metacast
+32 (int (*)(...))QSplitterHandle::qt_metacall
+40 (int (*)(...))QSplitterHandle::~QSplitterHandle
+48 (int (*)(...))QSplitterHandle::~QSplitterHandle
+56 (int (*)(...))QSplitterHandle::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QSplitterHandle::sizeHint
+136 (int (*)(...))QWidget::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QSplitterHandle::mousePressEvent
+176 (int (*)(...))QSplitterHandle::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QSplitterHandle::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QWidget::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QSplitterHandle::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QSplitterHandle::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QWidget::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QWidget::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))-16
+440 (int (*)(...))(& _ZTI15QSplitterHandle)
+448 (int (*)(...))QSplitterHandle::_ZThn16_N15QSplitterHandleD1Ev
+456 (int (*)(...))QSplitterHandle::_ZThn16_N15QSplitterHandleD0Ev
+464 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+472 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+480 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QSplitterHandle
+ size=48 align=8
+ base size=48 base align=8
+QSplitterHandle (0x0x7f52709cd8f0) 0
+ vptr=((& QSplitterHandle::_ZTV15QSplitterHandle) + 16)
+ QWidget (0x0x7f5270a60070) 0
+ primary-for QSplitterHandle (0x0x7f52709cd8f0)
+ QObject (0x0x7f5270ab7960) 0
+ primary-for QWidget (0x0x7f5270a60070)
+ QPaintDevice (0x0x7f5270ab79c0) 16
+ vptr=((& QSplitterHandle::_ZTV15QSplitterHandle) + 448)
+
+Class QStackedLayout::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QStackedLayout::QPrivateSignal (0x0x7f5270ab7cc0) 0 empty
+
+Vtable for QStackedLayout
+QStackedLayout::_ZTV14QStackedLayout: 50 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QStackedLayout)
+16 (int (*)(...))QStackedLayout::metaObject
+24 (int (*)(...))QStackedLayout::qt_metacast
+32 (int (*)(...))QStackedLayout::qt_metacall
+40 (int (*)(...))QStackedLayout::~QStackedLayout
+48 (int (*)(...))QStackedLayout::~QStackedLayout
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QLayout::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QLayout::invalidate
+120 (int (*)(...))QLayout::geometry
+128 (int (*)(...))QStackedLayout::addItem
+136 (int (*)(...))QLayout::expandingDirections
+144 (int (*)(...))QStackedLayout::minimumSize
+152 (int (*)(...))QLayout::maximumSize
+160 (int (*)(...))QStackedLayout::setGeometry
+168 (int (*)(...))QStackedLayout::itemAt
+176 (int (*)(...))QStackedLayout::takeAt
+184 (int (*)(...))QLayout::indexOf
+192 (int (*)(...))QStackedLayout::count
+200 (int (*)(...))QLayout::isEmpty
+208 (int (*)(...))QLayout::controlTypes
+216 (int (*)(...))QLayout::layout
+224 (int (*)(...))QStackedLayout::sizeHint
+232 (int (*)(...))QStackedLayout::hasHeightForWidth
+240 (int (*)(...))QStackedLayout::heightForWidth
+248 (int (*)(...))-16
+256 (int (*)(...))(& _ZTI14QStackedLayout)
+264 (int (*)(...))QStackedLayout::_ZThn16_N14QStackedLayoutD1Ev
+272 (int (*)(...))QStackedLayout::_ZThn16_N14QStackedLayoutD0Ev
+280 (int (*)(...))QStackedLayout::_ZThn16_NK14QStackedLayout8sizeHintEv
+288 (int (*)(...))QStackedLayout::_ZThn16_NK14QStackedLayout11minimumSizeEv
+296 (int (*)(...))QLayout::_ZThn16_NK7QLayout11maximumSizeEv
+304 (int (*)(...))QLayout::_ZThn16_NK7QLayout19expandingDirectionsEv
+312 (int (*)(...))QStackedLayout::_ZThn16_N14QStackedLayout11setGeometryERK5QRect
+320 (int (*)(...))QLayout::_ZThn16_NK7QLayout8geometryEv
+328 (int (*)(...))QLayout::_ZThn16_NK7QLayout7isEmptyEv
+336 (int (*)(...))QStackedLayout::_ZThn16_NK14QStackedLayout17hasHeightForWidthEv
+344 (int (*)(...))QStackedLayout::_ZThn16_NK14QStackedLayout14heightForWidthEi
+352 (int (*)(...))QLayoutItem::minimumHeightForWidth
+360 (int (*)(...))QLayout::_ZThn16_N7QLayout10invalidateEv
+368 (int (*)(...))QLayoutItem::widget
+376 (int (*)(...))QLayout::_ZThn16_N7QLayout6layoutEv
+384 (int (*)(...))QLayoutItem::spacerItem
+392 (int (*)(...))QLayout::_ZThn16_NK7QLayout12controlTypesEv
+
+Class QStackedLayout
+ size=32 align=8
+ base size=28 base align=8
+QStackedLayout (0x0x7f52709cd958) 0
+ vptr=((& QStackedLayout::_ZTV14QStackedLayout) + 16)
+ QLayout (0x0x7f5270b0a070) 0
+ primary-for QStackedLayout (0x0x7f52709cd958)
+ QObject (0x0x7f5270ab7c00) 0
+ primary-for QLayout (0x0x7f5270b0a070)
+ QLayoutItem (0x0x7f5270ab7c60) 16
+ vptr=((& QStackedLayout::_ZTV14QStackedLayout) + 264)
+
+Class QStackedWidget::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QStackedWidget::QPrivateSignal (0x0x7f5270b25060) 0 empty
+
+Vtable for QStackedWidget
+QStackedWidget::_ZTV14QStackedWidget: 64 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QStackedWidget)
+16 (int (*)(...))QStackedWidget::metaObject
+24 (int (*)(...))QStackedWidget::qt_metacast
+32 (int (*)(...))QStackedWidget::qt_metacall
+40 (int (*)(...))QStackedWidget::~QStackedWidget
+48 (int (*)(...))QStackedWidget::~QStackedWidget
+56 (int (*)(...))QStackedWidget::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QFrame::sizeHint
+136 (int (*)(...))QWidget::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QWidget::mousePressEvent
+176 (int (*)(...))QWidget::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QWidget::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QWidget::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QFrame::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QWidget::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QWidget::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QFrame::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))-16
+440 (int (*)(...))(& _ZTI14QStackedWidget)
+448 (int (*)(...))QStackedWidget::_ZThn16_N14QStackedWidgetD1Ev
+456 (int (*)(...))QStackedWidget::_ZThn16_N14QStackedWidgetD0Ev
+464 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+472 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+480 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QStackedWidget
+ size=48 align=8
+ base size=48 base align=8
+QStackedWidget (0x0x7f52709cd9c0) 0
+ vptr=((& QStackedWidget::_ZTV14QStackedWidget) + 16)
+ QFrame (0x0x7f52709cda28) 0
+ primary-for QStackedWidget (0x0x7f52709cd9c0)
+ QWidget (0x0x7f5270b0a2a0) 0
+ primary-for QFrame (0x0x7f52709cda28)
+ QObject (0x0x7f5270ab7f60) 0
+ primary-for QWidget (0x0x7f5270b0a2a0)
+ QPaintDevice (0x0x7f5270b25000) 16
+ vptr=((& QStackedWidget::_ZTV14QStackedWidget) + 448)
+
+Class QStatusBar::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QStatusBar::QPrivateSignal (0x0x7f5270b25300) 0 empty
+
+Vtable for QStatusBar
+QStatusBar::_ZTV10QStatusBar: 64 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QStatusBar)
+16 (int (*)(...))QStatusBar::metaObject
+24 (int (*)(...))QStatusBar::qt_metacast
+32 (int (*)(...))QStatusBar::qt_metacall
+40 (int (*)(...))QStatusBar::~QStatusBar
+48 (int (*)(...))QStatusBar::~QStatusBar
+56 (int (*)(...))QStatusBar::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QWidget::sizeHint
+136 (int (*)(...))QWidget::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QWidget::mousePressEvent
+176 (int (*)(...))QWidget::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QWidget::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QWidget::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QStatusBar::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QStatusBar::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QWidget::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QStatusBar::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QWidget::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))-16
+440 (int (*)(...))(& _ZTI10QStatusBar)
+448 (int (*)(...))QStatusBar::_ZThn16_N10QStatusBarD1Ev
+456 (int (*)(...))QStatusBar::_ZThn16_N10QStatusBarD0Ev
+464 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+472 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+480 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QStatusBar
+ size=48 align=8
+ base size=48 base align=8
+QStatusBar (0x0x7f52709cda90) 0
+ vptr=((& QStatusBar::_ZTV10QStatusBar) + 16)
+ QWidget (0x0x7f5270b0a3f0) 0
+ primary-for QStatusBar (0x0x7f52709cda90)
+ QObject (0x0x7f5270b25240) 0
+ primary-for QWidget (0x0x7f5270b0a3f0)
+ QPaintDevice (0x0x7f5270b252a0) 16
+ vptr=((& QStatusBar::_ZTV10QStatusBar) + 448)
+
+Class QStyledItemDelegate::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QStyledItemDelegate::QPrivateSignal (0x0x7f5270b25540) 0 empty
+
+Vtable for QStyledItemDelegate
+QStyledItemDelegate::_ZTV19QStyledItemDelegate: 26 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QStyledItemDelegate)
+16 (int (*)(...))QStyledItemDelegate::metaObject
+24 (int (*)(...))QStyledItemDelegate::qt_metacast
+32 (int (*)(...))QStyledItemDelegate::qt_metacall
+40 (int (*)(...))QStyledItemDelegate::~QStyledItemDelegate
+48 (int (*)(...))QStyledItemDelegate::~QStyledItemDelegate
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QStyledItemDelegate::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QStyledItemDelegate::paint
+120 (int (*)(...))QStyledItemDelegate::sizeHint
+128 (int (*)(...))QStyledItemDelegate::createEditor
+136 (int (*)(...))QAbstractItemDelegate::destroyEditor
+144 (int (*)(...))QStyledItemDelegate::setEditorData
+152 (int (*)(...))QStyledItemDelegate::setModelData
+160 (int (*)(...))QStyledItemDelegate::updateEditorGeometry
+168 (int (*)(...))QStyledItemDelegate::editorEvent
+176 (int (*)(...))QAbstractItemDelegate::helpEvent
+184 (int (*)(...))QAbstractItemDelegate::paintingRoles
+192 (int (*)(...))QStyledItemDelegate::displayText
+200 (int (*)(...))QStyledItemDelegate::initStyleOption
+
+Class QStyledItemDelegate
+ size=16 align=8
+ base size=16 base align=8
+QStyledItemDelegate (0x0x7f52709cdaf8) 0
+ vptr=((& QStyledItemDelegate::_ZTV19QStyledItemDelegate) + 16)
+ QAbstractItemDelegate (0x0x7f52709cdb60) 0
+ primary-for QStyledItemDelegate (0x0x7f52709cdaf8)
+ QObject (0x0x7f5270b254e0) 0
+ primary-for QAbstractItemDelegate (0x0x7f52709cdb60)
+
+Class QStyleFactory
+ size=1 align=1
+ base size=0 base align=1
+QStyleFactory (0x0x7f5270b25720) 0 empty
+
+Class QStylePainter
+ size=24 align=8
+ base size=24 base align=8
+QStylePainter (0x0x7f52709cdbc8) 0
+ QPainter (0x0x7f5270b25780) 0
+
+Class QStylePlugin::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QStylePlugin::QPrivateSignal (0x0x7f527076b060) 0 empty
+
+Vtable for QStylePlugin
+QStylePlugin::_ZTV12QStylePlugin: 15 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QStylePlugin)
+16 (int (*)(...))QStylePlugin::metaObject
+24 (int (*)(...))QStylePlugin::qt_metacast
+32 (int (*)(...))QStylePlugin::qt_metacall
+40 0
+48 0
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))__cxa_pure_virtual
+
+Class QStylePlugin
+ size=16 align=8
+ base size=16 base align=8
+QStylePlugin (0x0x7f52709cdc30) 0
+ vptr=((& QStylePlugin::_ZTV12QStylePlugin) + 16)
+ QObject (0x0x7f527076b000) 0
+ primary-for QStylePlugin (0x0x7f52709cdc30)
+
+Class QSystemTrayIcon::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QSystemTrayIcon::QPrivateSignal (0x0x7f527076b1e0) 0 empty
+
+Vtable for QSystemTrayIcon
+QSystemTrayIcon::_ZTV15QSystemTrayIcon: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QSystemTrayIcon)
+16 (int (*)(...))QSystemTrayIcon::metaObject
+24 (int (*)(...))QSystemTrayIcon::qt_metacast
+32 (int (*)(...))QSystemTrayIcon::qt_metacall
+40 (int (*)(...))QSystemTrayIcon::~QSystemTrayIcon
+48 (int (*)(...))QSystemTrayIcon::~QSystemTrayIcon
+56 (int (*)(...))QSystemTrayIcon::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QSystemTrayIcon
+ size=16 align=8
+ base size=16 base align=8
+QSystemTrayIcon (0x0x7f52709cdc98) 0
+ vptr=((& QSystemTrayIcon::_ZTV15QSystemTrayIcon) + 16)
+ QObject (0x0x7f527076b180) 0
+ primary-for QSystemTrayIcon (0x0x7f52709cdc98)
+
+Class QTableView::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTableView::QPrivateSignal (0x0x7f527076b540) 0 empty
+
+Vtable for QTableView
+QTableView::_ZTV10QTableView: 106 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QTableView)
+16 (int (*)(...))QTableView::metaObject
+24 (int (*)(...))QTableView::qt_metacast
+32 (int (*)(...))QTableView::qt_metacall
+40 (int (*)(...))QTableView::~QTableView
+48 (int (*)(...))QTableView::~QTableView
+56 (int (*)(...))QAbstractItemView::event
+64 (int (*)(...))QAbstractItemView::eventFilter
+72 (int (*)(...))QTableView::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QAbstractScrollArea::sizeHint
+136 (int (*)(...))QAbstractScrollArea::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QAbstractItemView::mousePressEvent
+176 (int (*)(...))QAbstractItemView::mouseReleaseEvent
+184 (int (*)(...))QAbstractItemView::mouseDoubleClickEvent
+192 (int (*)(...))QAbstractItemView::mouseMoveEvent
+200 (int (*)(...))QAbstractScrollArea::wheelEvent
+208 (int (*)(...))QAbstractItemView::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QAbstractItemView::focusInEvent
+232 (int (*)(...))QAbstractItemView::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QTableView::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QAbstractItemView::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QAbstractScrollArea::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QAbstractItemView::dragEnterEvent
+320 (int (*)(...))QAbstractItemView::dragMoveEvent
+328 (int (*)(...))QAbstractItemView::dragLeaveEvent
+336 (int (*)(...))QAbstractItemView::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QFrame::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QAbstractItemView::inputMethodEvent
+416 (int (*)(...))QAbstractItemView::inputMethodQuery
+424 (int (*)(...))QAbstractItemView::focusNextPrevChild
+432 (int (*)(...))QAbstractScrollArea::setupViewport
+440 (int (*)(...))QAbstractItemView::viewportEvent
+448 (int (*)(...))QTableView::scrollContentsBy
+456 (int (*)(...))QTableView::viewportSizeHint
+464 (int (*)(...))QTableView::setModel
+472 (int (*)(...))QTableView::setSelectionModel
+480 (int (*)(...))QAbstractItemView::keyboardSearch
+488 (int (*)(...))QTableView::visualRect
+496 (int (*)(...))QTableView::scrollTo
+504 (int (*)(...))QTableView::indexAt
+512 (int (*)(...))QTableView::sizeHintForRow
+520 (int (*)(...))QTableView::sizeHintForColumn
+528 (int (*)(...))QAbstractItemView::reset
+536 (int (*)(...))QTableView::setRootIndex
+544 (int (*)(...))QTableView::doItemsLayout
+552 (int (*)(...))QAbstractItemView::selectAll
+560 (int (*)(...))QAbstractItemView::dataChanged
+568 (int (*)(...))QAbstractItemView::rowsInserted
+576 (int (*)(...))QAbstractItemView::rowsAboutToBeRemoved
+584 (int (*)(...))QTableView::selectionChanged
+592 (int (*)(...))QTableView::currentChanged
+600 (int (*)(...))QAbstractItemView::updateEditorData
+608 (int (*)(...))QAbstractItemView::updateEditorGeometries
+616 (int (*)(...))QTableView::updateGeometries
+624 (int (*)(...))QTableView::verticalScrollbarAction
+632 (int (*)(...))QTableView::horizontalScrollbarAction
+640 (int (*)(...))QAbstractItemView::verticalScrollbarValueChanged
+648 (int (*)(...))QAbstractItemView::horizontalScrollbarValueChanged
+656 (int (*)(...))QAbstractItemView::closeEditor
+664 (int (*)(...))QAbstractItemView::commitData
+672 (int (*)(...))QAbstractItemView::editorDestroyed
+680 (int (*)(...))QTableView::moveCursor
+688 (int (*)(...))QTableView::horizontalOffset
+696 (int (*)(...))QTableView::verticalOffset
+704 (int (*)(...))QTableView::isIndexHidden
+712 (int (*)(...))QTableView::setSelection
+720 (int (*)(...))QTableView::visualRegionForSelection
+728 (int (*)(...))QTableView::selectedIndexes
+736 (int (*)(...))QAbstractItemView::edit
+744 (int (*)(...))QAbstractItemView::selectionCommand
+752 (int (*)(...))QAbstractItemView::startDrag
+760 (int (*)(...))QTableView::viewOptions
+768 (int (*)(...))-16
+776 (int (*)(...))(& _ZTI10QTableView)
+784 (int (*)(...))QTableView::_ZThn16_N10QTableViewD1Ev
+792 (int (*)(...))QTableView::_ZThn16_N10QTableViewD0Ev
+800 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+808 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+816 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+824 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+832 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+840 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QTableView
+ size=48 align=8
+ base size=48 base align=8
+QTableView (0x0x7f52709cdd00) 0
+ vptr=((& QTableView::_ZTV10QTableView) + 16)
+ QAbstractItemView (0x0x7f52709cdd68) 0
+ primary-for QTableView (0x0x7f52709cdd00)
+ QAbstractScrollArea (0x0x7f52709cddd0) 0
+ primary-for QAbstractItemView (0x0x7f52709cdd68)
+ QFrame (0x0x7f52709cde38) 0
+ primary-for QAbstractScrollArea (0x0x7f52709cddd0)
+ QWidget (0x0x7f5270785000) 0
+ primary-for QFrame (0x0x7f52709cde38)
+ QObject (0x0x7f527076b480) 0
+ primary-for QWidget (0x0x7f5270785000)
+ QPaintDevice (0x0x7f527076b4e0) 16
+ vptr=((& QTableView::_ZTV10QTableView) + 784)
+
+Class QTableWidgetSelectionRange
+ size=16 align=4
+ base size=16 base align=4
+QTableWidgetSelectionRange (0x0x7f527076b780) 0
+
+Vtable for QTableWidgetItem
+QTableWidgetItem::_ZTV16QTableWidgetItem: 10 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QTableWidgetItem)
+16 (int (*)(...))QTableWidgetItem::~QTableWidgetItem
+24 (int (*)(...))QTableWidgetItem::~QTableWidgetItem
+32 (int (*)(...))QTableWidgetItem::clone
+40 (int (*)(...))QTableWidgetItem::data
+48 (int (*)(...))QTableWidgetItem::setData
+56 (int (*)(...))QTableWidgetItem::operator<
+64 (int (*)(...))QTableWidgetItem::read
+72 (int (*)(...))QTableWidgetItem::write
+
+Class QTableWidgetItem
+ size=48 align=8
+ base size=44 base align=8
+QTableWidgetItem (0x0x7f527076ba20) 0
+ vptr=((& QTableWidgetItem::_ZTV16QTableWidgetItem) + 16)
+
+Class QTableWidget::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTableWidget::QPrivateSignal (0x0x7f52707fe780) 0 empty
+
+Vtable for QTableWidget
+QTableWidget::_ZTV12QTableWidget: 110 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QTableWidget)
+16 (int (*)(...))QTableWidget::metaObject
+24 (int (*)(...))QTableWidget::qt_metacast
+32 (int (*)(...))QTableWidget::qt_metacall
+40 (int (*)(...))QTableWidget::~QTableWidget
+48 (int (*)(...))QTableWidget::~QTableWidget
+56 (int (*)(...))QTableWidget::event
+64 (int (*)(...))QAbstractItemView::eventFilter
+72 (int (*)(...))QTableView::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QAbstractScrollArea::sizeHint
+136 (int (*)(...))QAbstractScrollArea::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QAbstractItemView::mousePressEvent
+176 (int (*)(...))QAbstractItemView::mouseReleaseEvent
+184 (int (*)(...))QAbstractItemView::mouseDoubleClickEvent
+192 (int (*)(...))QAbstractItemView::mouseMoveEvent
+200 (int (*)(...))QAbstractScrollArea::wheelEvent
+208 (int (*)(...))QAbstractItemView::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QAbstractItemView::focusInEvent
+232 (int (*)(...))QAbstractItemView::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QTableView::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QAbstractItemView::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QAbstractScrollArea::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QAbstractItemView::dragEnterEvent
+320 (int (*)(...))QAbstractItemView::dragMoveEvent
+328 (int (*)(...))QAbstractItemView::dragLeaveEvent
+336 (int (*)(...))QTableWidget::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QFrame::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QAbstractItemView::inputMethodEvent
+416 (int (*)(...))QAbstractItemView::inputMethodQuery
+424 (int (*)(...))QAbstractItemView::focusNextPrevChild
+432 (int (*)(...))QAbstractScrollArea::setupViewport
+440 (int (*)(...))QAbstractItemView::viewportEvent
+448 (int (*)(...))QTableView::scrollContentsBy
+456 (int (*)(...))QTableView::viewportSizeHint
+464 (int (*)(...))QTableWidget::setModel
+472 (int (*)(...))QTableView::setSelectionModel
+480 (int (*)(...))QAbstractItemView::keyboardSearch
+488 (int (*)(...))QTableView::visualRect
+496 (int (*)(...))QTableView::scrollTo
+504 (int (*)(...))QTableView::indexAt
+512 (int (*)(...))QTableView::sizeHintForRow
+520 (int (*)(...))QTableView::sizeHintForColumn
+528 (int (*)(...))QAbstractItemView::reset
+536 (int (*)(...))QTableView::setRootIndex
+544 (int (*)(...))QTableView::doItemsLayout
+552 (int (*)(...))QAbstractItemView::selectAll
+560 (int (*)(...))QAbstractItemView::dataChanged
+568 (int (*)(...))QAbstractItemView::rowsInserted
+576 (int (*)(...))QAbstractItemView::rowsAboutToBeRemoved
+584 (int (*)(...))QTableView::selectionChanged
+592 (int (*)(...))QTableView::currentChanged
+600 (int (*)(...))QAbstractItemView::updateEditorData
+608 (int (*)(...))QAbstractItemView::updateEditorGeometries
+616 (int (*)(...))QTableView::updateGeometries
+624 (int (*)(...))QTableView::verticalScrollbarAction
+632 (int (*)(...))QTableView::horizontalScrollbarAction
+640 (int (*)(...))QAbstractItemView::verticalScrollbarValueChanged
+648 (int (*)(...))QAbstractItemView::horizontalScrollbarValueChanged
+656 (int (*)(...))QAbstractItemView::closeEditor
+664 (int (*)(...))QAbstractItemView::commitData
+672 (int (*)(...))QAbstractItemView::editorDestroyed
+680 (int (*)(...))QTableView::moveCursor
+688 (int (*)(...))QTableView::horizontalOffset
+696 (int (*)(...))QTableView::verticalOffset
+704 (int (*)(...))QTableView::isIndexHidden
+712 (int (*)(...))QTableView::setSelection
+720 (int (*)(...))QTableView::visualRegionForSelection
+728 (int (*)(...))QTableView::selectedIndexes
+736 (int (*)(...))QAbstractItemView::edit
+744 (int (*)(...))QAbstractItemView::selectionCommand
+752 (int (*)(...))QAbstractItemView::startDrag
+760 (int (*)(...))QTableView::viewOptions
+768 (int (*)(...))QTableWidget::mimeTypes
+776 (int (*)(...))QTableWidget::mimeData
+784 (int (*)(...))QTableWidget::dropMimeData
+792 (int (*)(...))QTableWidget::supportedDropActions
+800 (int (*)(...))-16
+808 (int (*)(...))(& _ZTI12QTableWidget)
+816 (int (*)(...))QTableWidget::_ZThn16_N12QTableWidgetD1Ev
+824 (int (*)(...))QTableWidget::_ZThn16_N12QTableWidgetD0Ev
+832 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+840 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+848 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+856 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+864 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+872 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QTableWidget
+ size=48 align=8
+ base size=48 base align=8
+QTableWidget (0x0x7f52709cdf70) 0
+ vptr=((& QTableWidget::_ZTV12QTableWidget) + 16)
+ QTableView (0x0x7f5270824000) 0
+ primary-for QTableWidget (0x0x7f52709cdf70)
+ QAbstractItemView (0x0x7f5270824068) 0
+ primary-for QTableView (0x0x7f5270824000)
+ QAbstractScrollArea (0x0x7f52708240d0) 0
+ primary-for QAbstractItemView (0x0x7f5270824068)
+ QFrame (0x0x7f5270824138) 0
+ primary-for QAbstractScrollArea (0x0x7f52708240d0)
+ QWidget (0x0x7f52707853f0) 0
+ primary-for QFrame (0x0x7f5270824138)
+ QObject (0x0x7f52707fe6c0) 0
+ primary-for QWidget (0x0x7f52707853f0)
+ QPaintDevice (0x0x7f52707fe720) 16
+ vptr=((& QTableWidget::_ZTV12QTableWidget) + 816)
+
+Class QTextBrowser::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTextBrowser::QPrivateSignal (0x0x7f52707feba0) 0 empty
+
+Vtable for QTextBrowser
+QTextBrowser::_ZTV12QTextBrowser: 78 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QTextBrowser)
+16 (int (*)(...))QTextBrowser::metaObject
+24 (int (*)(...))QTextBrowser::qt_metacast
+32 (int (*)(...))QTextBrowser::qt_metacall
+40 (int (*)(...))QTextBrowser::~QTextBrowser
+48 (int (*)(...))QTextBrowser::~QTextBrowser
+56 (int (*)(...))QTextBrowser::event
+64 (int (*)(...))QAbstractScrollArea::eventFilter
+72 (int (*)(...))QTextEdit::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QAbstractScrollArea::sizeHint
+136 (int (*)(...))QAbstractScrollArea::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QTextBrowser::mousePressEvent
+176 (int (*)(...))QTextBrowser::mouseReleaseEvent
+184 (int (*)(...))QTextEdit::mouseDoubleClickEvent
+192 (int (*)(...))QTextBrowser::mouseMoveEvent
+200 (int (*)(...))QTextEdit::wheelEvent
+208 (int (*)(...))QTextBrowser::keyPressEvent
+216 (int (*)(...))QTextEdit::keyReleaseEvent
+224 (int (*)(...))QTextEdit::focusInEvent
+232 (int (*)(...))QTextBrowser::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QTextBrowser::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QTextEdit::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QTextEdit::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QTextEdit::dragEnterEvent
+320 (int (*)(...))QTextEdit::dragMoveEvent
+328 (int (*)(...))QTextEdit::dragLeaveEvent
+336 (int (*)(...))QTextEdit::dropEvent
+344 (int (*)(...))QTextEdit::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QTextEdit::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QTextEdit::inputMethodEvent
+416 (int (*)(...))QTextEdit::inputMethodQuery
+424 (int (*)(...))QTextBrowser::focusNextPrevChild
+432 (int (*)(...))QAbstractScrollArea::setupViewport
+440 (int (*)(...))QAbstractScrollArea::viewportEvent
+448 (int (*)(...))QTextEdit::scrollContentsBy
+456 (int (*)(...))QAbstractScrollArea::viewportSizeHint
+464 (int (*)(...))QTextBrowser::loadResource
+472 (int (*)(...))QTextEdit::createMimeDataFromSelection
+480 (int (*)(...))QTextEdit::canInsertFromMimeData
+488 (int (*)(...))QTextEdit::insertFromMimeData
+496 (int (*)(...))QTextEdit::doSetTextCursor
+504 (int (*)(...))QTextBrowser::setSource
+512 (int (*)(...))QTextBrowser::backward
+520 (int (*)(...))QTextBrowser::forward
+528 (int (*)(...))QTextBrowser::home
+536 (int (*)(...))QTextBrowser::reload
+544 (int (*)(...))-16
+552 (int (*)(...))(& _ZTI12QTextBrowser)
+560 (int (*)(...))QTextBrowser::_ZThn16_N12QTextBrowserD1Ev
+568 (int (*)(...))QTextBrowser::_ZThn16_N12QTextBrowserD0Ev
+576 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+584 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+592 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+600 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+608 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+616 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QTextBrowser
+ size=48 align=8
+ base size=48 base align=8
+QTextBrowser (0x0x7f52708241a0) 0
+ vptr=((& QTextBrowser::_ZTV12QTextBrowser) + 16)
+ QTextEdit (0x0x7f5270824208) 0
+ primary-for QTextBrowser (0x0x7f52708241a0)
+ QAbstractScrollArea (0x0x7f5270824270) 0
+ primary-for QTextEdit (0x0x7f5270824208)
+ QFrame (0x0x7f52708242d8) 0
+ primary-for QAbstractScrollArea (0x0x7f5270824270)
+ QWidget (0x0x7f52707855b0) 0
+ primary-for QFrame (0x0x7f52708242d8)
+ QObject (0x0x7f52707feae0) 0
+ primary-for QWidget (0x0x7f52707855b0)
+ QPaintDevice (0x0x7f52707feb40) 16
+ vptr=((& QTextBrowser::_ZTV12QTextBrowser) + 560)
+
+Class QToolBar::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QToolBar::QPrivateSignal (0x0x7f52707fee40) 0 empty
+
+Vtable for QToolBar
+QToolBar::_ZTV8QToolBar: 64 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI8QToolBar)
+16 (int (*)(...))QToolBar::metaObject
+24 (int (*)(...))QToolBar::qt_metacast
+32 (int (*)(...))QToolBar::qt_metacall
+40 (int (*)(...))QToolBar::~QToolBar
+48 (int (*)(...))QToolBar::~QToolBar
+56 (int (*)(...))QToolBar::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QWidget::sizeHint
+136 (int (*)(...))QWidget::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QWidget::mousePressEvent
+176 (int (*)(...))QWidget::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QWidget::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QWidget::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QToolBar::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QWidget::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QWidget::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QToolBar::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QToolBar::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))-16
+440 (int (*)(...))(& _ZTI8QToolBar)
+448 (int (*)(...))QToolBar::_ZThn16_N8QToolBarD1Ev
+456 (int (*)(...))QToolBar::_ZThn16_N8QToolBarD0Ev
+464 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+472 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+480 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QToolBar
+ size=48 align=8
+ base size=48 base align=8
+QToolBar (0x0x7f5270824340) 0
+ vptr=((& QToolBar::_ZTV8QToolBar) + 16)
+ QWidget (0x0x7f5270785700) 0
+ primary-for QToolBar (0x0x7f5270824340)
+ QObject (0x0x7f52707fed80) 0
+ primary-for QWidget (0x0x7f5270785700)
+ QPaintDevice (0x0x7f52707fede0) 16
+ vptr=((& QToolBar::_ZTV8QToolBar) + 448)
+
+Class QToolBox::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QToolBox::QPrivateSignal (0x0x7f52708857e0) 0 empty
+
+Vtable for QToolBox
+QToolBox::_ZTV8QToolBox: 66 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI8QToolBox)
+16 (int (*)(...))QToolBox::metaObject
+24 (int (*)(...))QToolBox::qt_metacast
+32 (int (*)(...))QToolBox::qt_metacall
+40 (int (*)(...))QToolBox::~QToolBox
+48 (int (*)(...))QToolBox::~QToolBox
+56 (int (*)(...))QToolBox::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QFrame::sizeHint
+136 (int (*)(...))QWidget::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QWidget::mousePressEvent
+176 (int (*)(...))QWidget::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QWidget::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QWidget::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QFrame::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QWidget::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QWidget::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QToolBox::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QToolBox::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QToolBox::itemInserted
+440 (int (*)(...))QToolBox::itemRemoved
+448 (int (*)(...))-16
+456 (int (*)(...))(& _ZTI8QToolBox)
+464 (int (*)(...))QToolBox::_ZThn16_N8QToolBoxD1Ev
+472 (int (*)(...))QToolBox::_ZThn16_N8QToolBoxD0Ev
+480 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+512 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+520 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QToolBox
+ size=48 align=8
+ base size=48 base align=8
+QToolBox (0x0x7f5270824888) 0
+ vptr=((& QToolBox::_ZTV8QToolBox) + 16)
+ QFrame (0x0x7f52708248f0) 0
+ primary-for QToolBox (0x0x7f5270824888)
+ QWidget (0x0x7f5270785e00) 0
+ primary-for QFrame (0x0x7f52708248f0)
+ QObject (0x0x7f5270885720) 0
+ primary-for QWidget (0x0x7f5270785e00)
+ QPaintDevice (0x0x7f5270885780) 16
+ vptr=((& QToolBox::_ZTV8QToolBox) + 464)
+
+Class QToolButton::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QToolButton::QPrivateSignal (0x0x7f5270885ba0) 0 empty
+
+Vtable for QToolButton
+QToolButton::_ZTV11QToolButton: 67 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QToolButton)
+16 (int (*)(...))QToolButton::metaObject
+24 (int (*)(...))QToolButton::qt_metacast
+32 (int (*)(...))QToolButton::qt_metacall
+40 (int (*)(...))QToolButton::~QToolButton
+48 (int (*)(...))QToolButton::~QToolButton
+56 (int (*)(...))QToolButton::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QToolButton::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QToolButton::sizeHint
+136 (int (*)(...))QToolButton::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QToolButton::mousePressEvent
+176 (int (*)(...))QToolButton::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QAbstractButton::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QAbstractButton::keyPressEvent
+216 (int (*)(...))QAbstractButton::keyReleaseEvent
+224 (int (*)(...))QAbstractButton::focusInEvent
+232 (int (*)(...))QAbstractButton::focusOutEvent
+240 (int (*)(...))QToolButton::enterEvent
+248 (int (*)(...))QToolButton::leaveEvent
+256 (int (*)(...))QToolButton::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QWidget::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QWidget::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QToolButton::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QToolButton::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QToolButton::hitButton
+440 (int (*)(...))QAbstractButton::checkStateSet
+448 (int (*)(...))QToolButton::nextCheckState
+456 (int (*)(...))-16
+464 (int (*)(...))(& _ZTI11QToolButton)
+472 (int (*)(...))QToolButton::_ZThn16_N11QToolButtonD1Ev
+480 (int (*)(...))QToolButton::_ZThn16_N11QToolButtonD0Ev
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+520 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+528 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QToolButton
+ size=48 align=8
+ base size=48 base align=8
+QToolButton (0x0x7f5270824958) 0
+ vptr=((& QToolButton::_ZTV11QToolButton) + 16)
+ QAbstractButton (0x0x7f52708249c0) 0
+ primary-for QToolButton (0x0x7f5270824958)
+ QWidget (0x0x7f5270785ee0) 0
+ primary-for QAbstractButton (0x0x7f52708249c0)
+ QObject (0x0x7f5270885ae0) 0
+ primary-for QWidget (0x0x7f5270785ee0)
+ QPaintDevice (0x0x7f5270885b40) 16
+ vptr=((& QToolButton::_ZTV11QToolButton) + 472)
+
+Class QToolTip
+ size=1 align=1
+ base size=0 base align=1
+QToolTip (0x0x7f5270885e40) 0 empty
+
+Class QTreeView::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTreeView::QPrivateSignal (0x0x7f52708cb000) 0 empty
+
+Vtable for QTreeView
+QTreeView::_ZTV9QTreeView: 108 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QTreeView)
+16 (int (*)(...))QTreeView::metaObject
+24 (int (*)(...))QTreeView::qt_metacast
+32 (int (*)(...))QTreeView::qt_metacall
+40 (int (*)(...))QTreeView::~QTreeView
+48 (int (*)(...))QTreeView::~QTreeView
+56 (int (*)(...))QAbstractItemView::event
+64 (int (*)(...))QAbstractItemView::eventFilter
+72 (int (*)(...))QTreeView::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QAbstractScrollArea::sizeHint
+136 (int (*)(...))QAbstractScrollArea::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QTreeView::mousePressEvent
+176 (int (*)(...))QTreeView::mouseReleaseEvent
+184 (int (*)(...))QTreeView::mouseDoubleClickEvent
+192 (int (*)(...))QTreeView::mouseMoveEvent
+200 (int (*)(...))QAbstractScrollArea::wheelEvent
+208 (int (*)(...))QTreeView::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QAbstractItemView::focusInEvent
+232 (int (*)(...))QAbstractItemView::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QTreeView::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QAbstractItemView::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QAbstractScrollArea::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QAbstractItemView::dragEnterEvent
+320 (int (*)(...))QTreeView::dragMoveEvent
+328 (int (*)(...))QAbstractItemView::dragLeaveEvent
+336 (int (*)(...))QAbstractItemView::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QFrame::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QAbstractItemView::inputMethodEvent
+416 (int (*)(...))QAbstractItemView::inputMethodQuery
+424 (int (*)(...))QAbstractItemView::focusNextPrevChild
+432 (int (*)(...))QAbstractScrollArea::setupViewport
+440 (int (*)(...))QTreeView::viewportEvent
+448 (int (*)(...))QTreeView::scrollContentsBy
+456 (int (*)(...))QTreeView::viewportSizeHint
+464 (int (*)(...))QTreeView::setModel
+472 (int (*)(...))QTreeView::setSelectionModel
+480 (int (*)(...))QTreeView::keyboardSearch
+488 (int (*)(...))QTreeView::visualRect
+496 (int (*)(...))QTreeView::scrollTo
+504 (int (*)(...))QTreeView::indexAt
+512 (int (*)(...))QAbstractItemView::sizeHintForRow
+520 (int (*)(...))QTreeView::sizeHintForColumn
+528 (int (*)(...))QTreeView::reset
+536 (int (*)(...))QTreeView::setRootIndex
+544 (int (*)(...))QTreeView::doItemsLayout
+552 (int (*)(...))QTreeView::selectAll
+560 (int (*)(...))QTreeView::dataChanged
+568 (int (*)(...))QTreeView::rowsInserted
+576 (int (*)(...))QTreeView::rowsAboutToBeRemoved
+584 (int (*)(...))QTreeView::selectionChanged
+592 (int (*)(...))QTreeView::currentChanged
+600 (int (*)(...))QAbstractItemView::updateEditorData
+608 (int (*)(...))QAbstractItemView::updateEditorGeometries
+616 (int (*)(...))QTreeView::updateGeometries
+624 (int (*)(...))QAbstractItemView::verticalScrollbarAction
+632 (int (*)(...))QTreeView::horizontalScrollbarAction
+640 (int (*)(...))QTreeView::verticalScrollbarValueChanged
+648 (int (*)(...))QAbstractItemView::horizontalScrollbarValueChanged
+656 (int (*)(...))QAbstractItemView::closeEditor
+664 (int (*)(...))QAbstractItemView::commitData
+672 (int (*)(...))QAbstractItemView::editorDestroyed
+680 (int (*)(...))QTreeView::moveCursor
+688 (int (*)(...))QTreeView::horizontalOffset
+696 (int (*)(...))QTreeView::verticalOffset
+704 (int (*)(...))QTreeView::isIndexHidden
+712 (int (*)(...))QTreeView::setSelection
+720 (int (*)(...))QTreeView::visualRegionForSelection
+728 (int (*)(...))QTreeView::selectedIndexes
+736 (int (*)(...))QAbstractItemView::edit
+744 (int (*)(...))QAbstractItemView::selectionCommand
+752 (int (*)(...))QAbstractItemView::startDrag
+760 (int (*)(...))QAbstractItemView::viewOptions
+768 (int (*)(...))QTreeView::drawRow
+776 (int (*)(...))QTreeView::drawBranches
+784 (int (*)(...))-16
+792 (int (*)(...))(& _ZTI9QTreeView)
+800 (int (*)(...))QTreeView::_ZThn16_N9QTreeViewD1Ev
+808 (int (*)(...))QTreeView::_ZThn16_N9QTreeViewD0Ev
+816 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+824 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+832 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+840 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+848 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+856 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QTreeView
+ size=48 align=8
+ base size=48 base align=8
+QTreeView (0x0x7f5270824a28) 0
+ vptr=((& QTreeView::_ZTV9QTreeView) + 16)
+ QAbstractItemView (0x0x7f5270824a90) 0
+ primary-for QTreeView (0x0x7f5270824a28)
+ QAbstractScrollArea (0x0x7f5270824af8) 0
+ primary-for QAbstractItemView (0x0x7f5270824a90)
+ QFrame (0x0x7f5270824b60) 0
+ primary-for QAbstractScrollArea (0x0x7f5270824af8)
+ QWidget (0x0x7f52708af230) 0
+ primary-for QFrame (0x0x7f5270824b60)
+ QObject (0x0x7f5270885f00) 0
+ primary-for QWidget (0x0x7f52708af230)
+ QPaintDevice (0x0x7f5270885f60) 16
+ vptr=((& QTreeView::_ZTV9QTreeView) + 800)
+
+Class QTreeWidgetItemIterator
+ size=24 align=8
+ base size=20 base align=8
+QTreeWidgetItemIterator (0x0x7f52708cb240) 0
+
+Vtable for QTreeWidgetItem
+QTreeWidgetItem::_ZTV15QTreeWidgetItem: 10 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI15QTreeWidgetItem)
+16 (int (*)(...))QTreeWidgetItem::~QTreeWidgetItem
+24 (int (*)(...))QTreeWidgetItem::~QTreeWidgetItem
+32 (int (*)(...))QTreeWidgetItem::clone
+40 (int (*)(...))QTreeWidgetItem::data
+48 (int (*)(...))QTreeWidgetItem::setData
+56 (int (*)(...))QTreeWidgetItem::operator<
+64 (int (*)(...))QTreeWidgetItem::read
+72 (int (*)(...))QTreeWidgetItem::write
+
+Class QTreeWidgetItem
+ size=64 align=8
+ base size=60 base align=8
+QTreeWidgetItem (0x0x7f52708cbcc0) 0
+ vptr=((& QTreeWidgetItem::_ZTV15QTreeWidgetItem) + 16)
+
+Class QTreeWidget::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QTreeWidget::QPrivateSignal (0x0x7f52705c7cc0) 0 empty
+
+Vtable for QTreeWidget
+QTreeWidget::_ZTV11QTreeWidget: 112 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QTreeWidget)
+16 (int (*)(...))QTreeWidget::metaObject
+24 (int (*)(...))QTreeWidget::qt_metacast
+32 (int (*)(...))QTreeWidget::qt_metacall
+40 (int (*)(...))QTreeWidget::~QTreeWidget
+48 (int (*)(...))QTreeWidget::~QTreeWidget
+56 (int (*)(...))QTreeWidget::event
+64 (int (*)(...))QAbstractItemView::eventFilter
+72 (int (*)(...))QTreeView::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QAbstractScrollArea::sizeHint
+136 (int (*)(...))QAbstractScrollArea::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QTreeView::mousePressEvent
+176 (int (*)(...))QTreeView::mouseReleaseEvent
+184 (int (*)(...))QTreeView::mouseDoubleClickEvent
+192 (int (*)(...))QTreeView::mouseMoveEvent
+200 (int (*)(...))QAbstractScrollArea::wheelEvent
+208 (int (*)(...))QTreeView::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QAbstractItemView::focusInEvent
+232 (int (*)(...))QAbstractItemView::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QTreeView::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QAbstractItemView::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QAbstractScrollArea::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QAbstractItemView::dragEnterEvent
+320 (int (*)(...))QTreeView::dragMoveEvent
+328 (int (*)(...))QAbstractItemView::dragLeaveEvent
+336 (int (*)(...))QTreeWidget::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QFrame::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QAbstractItemView::inputMethodEvent
+416 (int (*)(...))QAbstractItemView::inputMethodQuery
+424 (int (*)(...))QAbstractItemView::focusNextPrevChild
+432 (int (*)(...))QAbstractScrollArea::setupViewport
+440 (int (*)(...))QTreeView::viewportEvent
+448 (int (*)(...))QTreeView::scrollContentsBy
+456 (int (*)(...))QTreeView::viewportSizeHint
+464 (int (*)(...))QTreeWidget::setModel
+472 (int (*)(...))QTreeWidget::setSelectionModel
+480 (int (*)(...))QTreeView::keyboardSearch
+488 (int (*)(...))QTreeView::visualRect
+496 (int (*)(...))QTreeView::scrollTo
+504 (int (*)(...))QTreeView::indexAt
+512 (int (*)(...))QAbstractItemView::sizeHintForRow
+520 (int (*)(...))QTreeView::sizeHintForColumn
+528 (int (*)(...))QTreeView::reset
+536 (int (*)(...))QTreeView::setRootIndex
+544 (int (*)(...))QTreeView::doItemsLayout
+552 (int (*)(...))QTreeView::selectAll
+560 (int (*)(...))QTreeView::dataChanged
+568 (int (*)(...))QTreeView::rowsInserted
+576 (int (*)(...))QTreeView::rowsAboutToBeRemoved
+584 (int (*)(...))QTreeView::selectionChanged
+592 (int (*)(...))QTreeView::currentChanged
+600 (int (*)(...))QAbstractItemView::updateEditorData
+608 (int (*)(...))QAbstractItemView::updateEditorGeometries
+616 (int (*)(...))QTreeView::updateGeometries
+624 (int (*)(...))QAbstractItemView::verticalScrollbarAction
+632 (int (*)(...))QTreeView::horizontalScrollbarAction
+640 (int (*)(...))QTreeView::verticalScrollbarValueChanged
+648 (int (*)(...))QAbstractItemView::horizontalScrollbarValueChanged
+656 (int (*)(...))QAbstractItemView::closeEditor
+664 (int (*)(...))QAbstractItemView::commitData
+672 (int (*)(...))QAbstractItemView::editorDestroyed
+680 (int (*)(...))QTreeView::moveCursor
+688 (int (*)(...))QTreeView::horizontalOffset
+696 (int (*)(...))QTreeView::verticalOffset
+704 (int (*)(...))QTreeView::isIndexHidden
+712 (int (*)(...))QTreeView::setSelection
+720 (int (*)(...))QTreeView::visualRegionForSelection
+728 (int (*)(...))QTreeView::selectedIndexes
+736 (int (*)(...))QAbstractItemView::edit
+744 (int (*)(...))QAbstractItemView::selectionCommand
+752 (int (*)(...))QAbstractItemView::startDrag
+760 (int (*)(...))QAbstractItemView::viewOptions
+768 (int (*)(...))QTreeView::drawRow
+776 (int (*)(...))QTreeView::drawBranches
+784 (int (*)(...))QTreeWidget::mimeTypes
+792 (int (*)(...))QTreeWidget::mimeData
+800 (int (*)(...))QTreeWidget::dropMimeData
+808 (int (*)(...))QTreeWidget::supportedDropActions
+816 (int (*)(...))-16
+824 (int (*)(...))(& _ZTI11QTreeWidget)
+832 (int (*)(...))QTreeWidget::_ZThn16_N11QTreeWidgetD1Ev
+840 (int (*)(...))QTreeWidget::_ZThn16_N11QTreeWidgetD0Ev
+848 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+856 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+864 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+872 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+880 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+888 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QTreeWidget
+ size=48 align=8
+ base size=48 base align=8
+QTreeWidget (0x0x7f5270824dd0) 0
+ vptr=((& QTreeWidget::_ZTV11QTreeWidget) + 16)
+ QTreeView (0x0x7f5270824e38) 0
+ primary-for QTreeWidget (0x0x7f5270824dd0)
+ QAbstractItemView (0x0x7f5270824ea0) 0
+ primary-for QTreeView (0x0x7f5270824e38)
+ QAbstractScrollArea (0x0x7f5270824f08) 0
+ primary-for QAbstractItemView (0x0x7f5270824ea0)
+ QFrame (0x0x7f5270824f70) 0
+ primary-for QAbstractScrollArea (0x0x7f5270824f08)
+ QWidget (0x0x7f5270917d20) 0
+ primary-for QFrame (0x0x7f5270824f70)
+ QObject (0x0x7f52705c7c00) 0
+ primary-for QWidget (0x0x7f5270917d20)
+ QPaintDevice (0x0x7f52705c7c60) 16
+ vptr=((& QTreeWidget::_ZTV11QTreeWidget) + 832)
+
+Class QUndoGroup::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QUndoGroup::QPrivateSignal (0x0x7f527062b120) 0 empty
+
+Vtable for QUndoGroup
+QUndoGroup::_ZTV10QUndoGroup: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QUndoGroup)
+16 (int (*)(...))QUndoGroup::metaObject
+24 (int (*)(...))QUndoGroup::qt_metacast
+32 (int (*)(...))QUndoGroup::qt_metacall
+40 (int (*)(...))QUndoGroup::~QUndoGroup
+48 (int (*)(...))QUndoGroup::~QUndoGroup
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QUndoGroup
+ size=16 align=8
+ base size=16 base align=8
+QUndoGroup (0x0x7f527062e000) 0
+ vptr=((& QUndoGroup::_ZTV10QUndoGroup) + 16)
+ QObject (0x0x7f527062b0c0) 0
+ primary-for QUndoGroup (0x0x7f527062e000)
+
+Vtable for QUndoCommand
+QUndoCommand::_ZTV12QUndoCommand: 8 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QUndoCommand)
+16 (int (*)(...))QUndoCommand::~QUndoCommand
+24 (int (*)(...))QUndoCommand::~QUndoCommand
+32 (int (*)(...))QUndoCommand::undo
+40 (int (*)(...))QUndoCommand::redo
+48 (int (*)(...))QUndoCommand::id
+56 (int (*)(...))QUndoCommand::mergeWith
+
+Class QUndoCommand
+ size=16 align=8
+ base size=16 base align=8
+QUndoCommand (0x0x7f527062b300) 0
+ vptr=((& QUndoCommand::_ZTV12QUndoCommand) + 16)
+
+Class QUndoStack::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QUndoStack::QPrivateSignal (0x0x7f527062b3c0) 0 empty
+
+Vtable for QUndoStack
+QUndoStack::_ZTV10QUndoStack: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI10QUndoStack)
+16 (int (*)(...))QUndoStack::metaObject
+24 (int (*)(...))QUndoStack::qt_metacast
+32 (int (*)(...))QUndoStack::qt_metacall
+40 (int (*)(...))QUndoStack::~QUndoStack
+48 (int (*)(...))QUndoStack::~QUndoStack
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QUndoStack
+ size=16 align=8
+ base size=16 base align=8
+QUndoStack (0x0x7f527062e068) 0
+ vptr=((& QUndoStack::_ZTV10QUndoStack) + 16)
+ QObject (0x0x7f527062b360) 0
+ primary-for QUndoStack (0x0x7f527062e068)
+
+Class QUndoView::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QUndoView::QPrivateSignal (0x0x7f527062b660) 0 empty
+
+Vtable for QUndoView
+QUndoView::_ZTV9QUndoView: 106 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI9QUndoView)
+16 (int (*)(...))QUndoView::metaObject
+24 (int (*)(...))QUndoView::qt_metacast
+32 (int (*)(...))QUndoView::qt_metacall
+40 (int (*)(...))QUndoView::~QUndoView
+48 (int (*)(...))QUndoView::~QUndoView
+56 (int (*)(...))QListView::event
+64 (int (*)(...))QAbstractItemView::eventFilter
+72 (int (*)(...))QListView::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QAbstractScrollArea::sizeHint
+136 (int (*)(...))QAbstractScrollArea::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QAbstractItemView::mousePressEvent
+176 (int (*)(...))QListView::mouseReleaseEvent
+184 (int (*)(...))QAbstractItemView::mouseDoubleClickEvent
+192 (int (*)(...))QListView::mouseMoveEvent
+200 (int (*)(...))QListView::wheelEvent
+208 (int (*)(...))QAbstractItemView::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QAbstractItemView::focusInEvent
+232 (int (*)(...))QAbstractItemView::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QListView::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QListView::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QAbstractScrollArea::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QAbstractItemView::dragEnterEvent
+320 (int (*)(...))QListView::dragMoveEvent
+328 (int (*)(...))QListView::dragLeaveEvent
+336 (int (*)(...))QListView::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QFrame::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QAbstractItemView::inputMethodEvent
+416 (int (*)(...))QAbstractItemView::inputMethodQuery
+424 (int (*)(...))QAbstractItemView::focusNextPrevChild
+432 (int (*)(...))QAbstractScrollArea::setupViewport
+440 (int (*)(...))QAbstractItemView::viewportEvent
+448 (int (*)(...))QListView::scrollContentsBy
+456 (int (*)(...))QListView::viewportSizeHint
+464 (int (*)(...))QAbstractItemView::setModel
+472 (int (*)(...))QAbstractItemView::setSelectionModel
+480 (int (*)(...))QAbstractItemView::keyboardSearch
+488 (int (*)(...))QListView::visualRect
+496 (int (*)(...))QListView::scrollTo
+504 (int (*)(...))QListView::indexAt
+512 (int (*)(...))QAbstractItemView::sizeHintForRow
+520 (int (*)(...))QAbstractItemView::sizeHintForColumn
+528 (int (*)(...))QListView::reset
+536 (int (*)(...))QListView::setRootIndex
+544 (int (*)(...))QListView::doItemsLayout
+552 (int (*)(...))QAbstractItemView::selectAll
+560 (int (*)(...))QListView::dataChanged
+568 (int (*)(...))QListView::rowsInserted
+576 (int (*)(...))QListView::rowsAboutToBeRemoved
+584 (int (*)(...))QListView::selectionChanged
+592 (int (*)(...))QListView::currentChanged
+600 (int (*)(...))QAbstractItemView::updateEditorData
+608 (int (*)(...))QAbstractItemView::updateEditorGeometries
+616 (int (*)(...))QListView::updateGeometries
+624 (int (*)(...))QAbstractItemView::verticalScrollbarAction
+632 (int (*)(...))QAbstractItemView::horizontalScrollbarAction
+640 (int (*)(...))QAbstractItemView::verticalScrollbarValueChanged
+648 (int (*)(...))QAbstractItemView::horizontalScrollbarValueChanged
+656 (int (*)(...))QAbstractItemView::closeEditor
+664 (int (*)(...))QAbstractItemView::commitData
+672 (int (*)(...))QAbstractItemView::editorDestroyed
+680 (int (*)(...))QListView::moveCursor
+688 (int (*)(...))QListView::horizontalOffset
+696 (int (*)(...))QListView::verticalOffset
+704 (int (*)(...))QListView::isIndexHidden
+712 (int (*)(...))QListView::setSelection
+720 (int (*)(...))QListView::visualRegionForSelection
+728 (int (*)(...))QListView::selectedIndexes
+736 (int (*)(...))QAbstractItemView::edit
+744 (int (*)(...))QAbstractItemView::selectionCommand
+752 (int (*)(...))QListView::startDrag
+760 (int (*)(...))QListView::viewOptions
+768 (int (*)(...))-16
+776 (int (*)(...))(& _ZTI9QUndoView)
+784 (int (*)(...))QUndoView::_ZThn16_N9QUndoViewD1Ev
+792 (int (*)(...))QUndoView::_ZThn16_N9QUndoViewD0Ev
+800 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+808 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+816 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+824 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+832 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+840 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QUndoView
+ size=48 align=8
+ base size=48 base align=8
+QUndoView (0x0x7f527062e0d0) 0
+ vptr=((& QUndoView::_ZTV9QUndoView) + 16)
+ QListView (0x0x7f527062e138) 0
+ primary-for QUndoView (0x0x7f527062e0d0)
+ QAbstractItemView (0x0x7f527062e1a0) 0
+ primary-for QListView (0x0x7f527062e138)
+ QAbstractScrollArea (0x0x7f527062e208) 0
+ primary-for QAbstractItemView (0x0x7f527062e1a0)
+ QFrame (0x0x7f527062e270) 0
+ primary-for QAbstractScrollArea (0x0x7f527062e208)
+ QWidget (0x0x7f52706480e0) 0
+ primary-for QFrame (0x0x7f527062e270)
+ QObject (0x0x7f527062b5a0) 0
+ primary-for QWidget (0x0x7f52706480e0)
+ QPaintDevice (0x0x7f527062b600) 16
+ vptr=((& QUndoView::_ZTV9QUndoView) + 784)
+
+Class QWhatsThis
+ size=1 align=1
+ base size=0 base align=1
+QWhatsThis (0x0x7f527062b840) 0 empty
+
+Class QWidgetAction::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QWidgetAction::QPrivateSignal (0x0x7f527062b900) 0 empty
+
+Vtable for QWidgetAction
+QWidgetAction::_ZTV13QWidgetAction: 16 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI13QWidgetAction)
+16 (int (*)(...))QWidgetAction::metaObject
+24 (int (*)(...))QWidgetAction::qt_metacast
+32 (int (*)(...))QWidgetAction::qt_metacall
+40 (int (*)(...))QWidgetAction::~QWidgetAction
+48 (int (*)(...))QWidgetAction::~QWidgetAction
+56 (int (*)(...))QWidgetAction::event
+64 (int (*)(...))QWidgetAction::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidgetAction::createWidget
+120 (int (*)(...))QWidgetAction::deleteWidget
+
+Class QWidgetAction
+ size=16 align=8
+ base size=16 base align=8
+QWidgetAction (0x0x7f527062e2d8) 0
+ vptr=((& QWidgetAction::_ZTV13QWidgetAction) + 16)
+ QAction (0x0x7f527062e340) 0
+ primary-for QWidgetAction (0x0x7f527062e2d8)
+ QObject (0x0x7f527062b8a0) 0
+ primary-for QAction (0x0x7f527062e340)
+
+Class QWizard::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QWizard::QPrivateSignal (0x0x7f527062bba0) 0 empty
+
+Vtable for QWizard
+QWizard::_ZTV7QWizard: 73 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI7QWizard)
+16 (int (*)(...))QWizard::metaObject
+24 (int (*)(...))QWizard::qt_metacast
+32 (int (*)(...))QWizard::qt_metacall
+40 (int (*)(...))QWizard::~QWizard
+48 (int (*)(...))QWizard::~QWizard
+56 (int (*)(...))QWizard::event
+64 (int (*)(...))QDialog::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWizard::setVisible
+128 (int (*)(...))QWizard::sizeHint
+136 (int (*)(...))QDialog::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QWidget::mousePressEvent
+176 (int (*)(...))QWidget::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QWidget::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QDialog::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QWizard::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QWizard::resizeEvent
+280 (int (*)(...))QDialog::closeEvent
+288 (int (*)(...))QDialog::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QDialog::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QWidget::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QDialog::open
+440 (int (*)(...))QDialog::exec
+448 (int (*)(...))QWizard::done
+456 (int (*)(...))QDialog::accept
+464 (int (*)(...))QDialog::reject
+472 (int (*)(...))QWizard::validateCurrentPage
+480 (int (*)(...))QWizard::nextId
+488 (int (*)(...))QWizard::initializePage
+496 (int (*)(...))QWizard::cleanupPage
+504 (int (*)(...))-16
+512 (int (*)(...))(& _ZTI7QWizard)
+520 (int (*)(...))QWizard::_ZThn16_N7QWizardD1Ev
+528 (int (*)(...))QWizard::_ZThn16_N7QWizardD0Ev
+536 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+544 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+552 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+560 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+568 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+576 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QWizard
+ size=48 align=8
+ base size=48 base align=8
+QWizard (0x0x7f527062e3a8) 0
+ vptr=((& QWizard::_ZTV7QWizard) + 16)
+ QDialog (0x0x7f527062e410) 0
+ primary-for QWizard (0x0x7f527062e3a8)
+ QWidget (0x0x7f5270648380) 0
+ primary-for QDialog (0x0x7f527062e410)
+ QObject (0x0x7f527062bae0) 0
+ primary-for QWidget (0x0x7f5270648380)
+ QPaintDevice (0x0x7f527062bb40) 16
+ vptr=((& QWizard::_ZTV7QWizard) + 520)
+
+Class QWizardPage::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QWizardPage::QPrivateSignal (0x0x7f52706b0780) 0 empty
+
+Vtable for QWizardPage
+QWizardPage::_ZTV11QWizardPage: 69 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI11QWizardPage)
+16 (int (*)(...))QWizardPage::metaObject
+24 (int (*)(...))QWizardPage::qt_metacast
+32 (int (*)(...))QWizardPage::qt_metacall
+40 (int (*)(...))QWizardPage::~QWizardPage
+48 (int (*)(...))QWizardPage::~QWizardPage
+56 (int (*)(...))QWidget::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QWidget::sizeHint
+136 (int (*)(...))QWidget::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QWidget::mousePressEvent
+176 (int (*)(...))QWidget::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QWidget::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QWidget::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QWidget::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QWidget::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QWidget::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QWidget::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QWizardPage::initializePage
+440 (int (*)(...))QWizardPage::cleanupPage
+448 (int (*)(...))QWizardPage::validatePage
+456 (int (*)(...))QWizardPage::isComplete
+464 (int (*)(...))QWizardPage::nextId
+472 (int (*)(...))-16
+480 (int (*)(...))(& _ZTI11QWizardPage)
+488 (int (*)(...))QWizardPage::_ZThn16_N11QWizardPageD1Ev
+496 (int (*)(...))QWizardPage::_ZThn16_N11QWizardPageD0Ev
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+520 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+528 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+536 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+544 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QWizardPage
+ size=48 align=8
+ base size=48 base align=8
+QWizardPage (0x0x7f527062e548) 0
+ vptr=((& QWizardPage::_ZTV11QWizardPage) + 16)
+ QWidget (0x0x7f5270680e00) 0
+ primary-for QWizardPage (0x0x7f527062e548)
+ QObject (0x0x7f52706b06c0) 0
+ primary-for QWidget (0x0x7f5270680e00)
+ QPaintDevice (0x0x7f52706b0720) 16
+ vptr=((& QWizardPage::_ZTV11QWizardPage) + 488)
+
+Class QAbstractPrintDialog::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QAbstractPrintDialog::QPrivateSignal (0x0x7f52706b0a20) 0 empty
+
+Vtable for QAbstractPrintDialog
+QAbstractPrintDialog::_ZTV20QAbstractPrintDialog: 69 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI20QAbstractPrintDialog)
+16 (int (*)(...))QAbstractPrintDialog::metaObject
+24 (int (*)(...))QAbstractPrintDialog::qt_metacast
+32 (int (*)(...))QAbstractPrintDialog::qt_metacall
+40 (int (*)(...))QAbstractPrintDialog::~QAbstractPrintDialog
+48 (int (*)(...))QAbstractPrintDialog::~QAbstractPrintDialog
+56 (int (*)(...))QWidget::event
+64 (int (*)(...))QDialog::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QDialog::setVisible
+128 (int (*)(...))QDialog::sizeHint
+136 (int (*)(...))QDialog::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QWidget::mousePressEvent
+176 (int (*)(...))QWidget::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QWidget::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QDialog::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QWidget::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QDialog::resizeEvent
+280 (int (*)(...))QDialog::closeEvent
+288 (int (*)(...))QDialog::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QDialog::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QWidget::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QDialog::open
+440 (int (*)(...))QDialog::exec
+448 (int (*)(...))QDialog::done
+456 (int (*)(...))QDialog::accept
+464 (int (*)(...))QDialog::reject
+472 (int (*)(...))-16
+480 (int (*)(...))(& _ZTI20QAbstractPrintDialog)
+488 (int (*)(...))QAbstractPrintDialog::_ZThn16_N20QAbstractPrintDialogD1Ev
+496 (int (*)(...))QAbstractPrintDialog::_ZThn16_N20QAbstractPrintDialogD0Ev
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+520 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+528 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+536 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+544 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QAbstractPrintDialog
+ size=48 align=8
+ base size=48 base align=8
+QAbstractPrintDialog (0x0x7f527062e5b0) 0
+ vptr=((& QAbstractPrintDialog::_ZTV20QAbstractPrintDialog) + 16)
+ QDialog (0x0x7f527062e618) 0
+ primary-for QAbstractPrintDialog (0x0x7f527062e5b0)
+ QWidget (0x0x7f5270680e70) 0
+ primary-for QDialog (0x0x7f527062e618)
+ QObject (0x0x7f52706b0960) 0
+ primary-for QWidget (0x0x7f5270680e70)
+ QPaintDevice (0x0x7f52706b09c0) 16
+ vptr=((& QAbstractPrintDialog::_ZTV20QAbstractPrintDialog) + 488)
+
+Class QPageSetupDialog::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QPageSetupDialog::QPrivateSignal (0x0x7f527032c540) 0 empty
+
+Vtable for QPageSetupDialog
+QPageSetupDialog::_ZTV16QPageSetupDialog: 69 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI16QPageSetupDialog)
+16 (int (*)(...))QPageSetupDialog::metaObject
+24 (int (*)(...))QPageSetupDialog::qt_metacast
+32 (int (*)(...))QPageSetupDialog::qt_metacall
+40 (int (*)(...))QPageSetupDialog::~QPageSetupDialog
+48 (int (*)(...))QPageSetupDialog::~QPageSetupDialog
+56 (int (*)(...))QWidget::event
+64 (int (*)(...))QDialog::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QDialog::setVisible
+128 (int (*)(...))QDialog::sizeHint
+136 (int (*)(...))QDialog::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QWidget::mousePressEvent
+176 (int (*)(...))QWidget::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QWidget::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QDialog::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QWidget::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QDialog::resizeEvent
+280 (int (*)(...))QDialog::closeEvent
+288 (int (*)(...))QDialog::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QDialog::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QWidget::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QDialog::open
+440 (int (*)(...))QPageSetupDialog::exec
+448 (int (*)(...))QPageSetupDialog::done
+456 (int (*)(...))QDialog::accept
+464 (int (*)(...))QDialog::reject
+472 (int (*)(...))-16
+480 (int (*)(...))(& _ZTI16QPageSetupDialog)
+488 (int (*)(...))QPageSetupDialog::_ZThn16_N16QPageSetupDialogD1Ev
+496 (int (*)(...))QPageSetupDialog::_ZThn16_N16QPageSetupDialogD0Ev
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+520 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+528 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+536 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+544 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QPageSetupDialog
+ size=48 align=8
+ base size=48 base align=8
+QPageSetupDialog (0x0x7f527062e750) 0
+ vptr=((& QPageSetupDialog::_ZTV16QPageSetupDialog) + 16)
+ QDialog (0x0x7f527062e7b8) 0
+ primary-for QPageSetupDialog (0x0x7f527062e750)
+ QWidget (0x0x7f52706edc40) 0
+ primary-for QDialog (0x0x7f527062e7b8)
+ QObject (0x0x7f527032c480) 0
+ primary-for QWidget (0x0x7f52706edc40)
+ QPaintDevice (0x0x7f527032c4e0) 16
+ vptr=((& QPageSetupDialog::_ZTV16QPageSetupDialog) + 488)
+
+Class QPrintDialog::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QPrintDialog::QPrivateSignal (0x0x7f527032c7e0) 0 empty
+
+Vtable for QPrintDialog
+QPrintDialog::_ZTV12QPrintDialog: 69 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QPrintDialog)
+16 (int (*)(...))QPrintDialog::metaObject
+24 (int (*)(...))QPrintDialog::qt_metacast
+32 (int (*)(...))QPrintDialog::qt_metacall
+40 (int (*)(...))QPrintDialog::~QPrintDialog
+48 (int (*)(...))QPrintDialog::~QPrintDialog
+56 (int (*)(...))QWidget::event
+64 (int (*)(...))QDialog::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QPrintDialog::setVisible
+128 (int (*)(...))QDialog::sizeHint
+136 (int (*)(...))QDialog::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QWidget::mousePressEvent
+176 (int (*)(...))QWidget::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QWidget::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QDialog::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QWidget::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QDialog::resizeEvent
+280 (int (*)(...))QDialog::closeEvent
+288 (int (*)(...))QDialog::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QDialog::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QWidget::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QDialog::open
+440 (int (*)(...))QPrintDialog::exec
+448 (int (*)(...))QPrintDialog::done
+456 (int (*)(...))QPrintDialog::accept
+464 (int (*)(...))QDialog::reject
+472 (int (*)(...))-16
+480 (int (*)(...))(& _ZTI12QPrintDialog)
+488 (int (*)(...))QPrintDialog::_ZThn16_N12QPrintDialogD1Ev
+496 (int (*)(...))QPrintDialog::_ZThn16_N12QPrintDialogD0Ev
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+520 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+528 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+536 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+544 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QPrintDialog
+ size=48 align=8
+ base size=48 base align=8
+QPrintDialog (0x0x7f527062e820) 0
+ vptr=((& QPrintDialog::_ZTV12QPrintDialog) + 16)
+ QAbstractPrintDialog (0x0x7f527062e888) 0
+ primary-for QPrintDialog (0x0x7f527062e820)
+ QDialog (0x0x7f527062e8f0) 0
+ primary-for QAbstractPrintDialog (0x0x7f527062e888)
+ QWidget (0x0x7f52706edcb0) 0
+ primary-for QDialog (0x0x7f527062e8f0)
+ QObject (0x0x7f527032c720) 0
+ primary-for QWidget (0x0x7f52706edcb0)
+ QPaintDevice (0x0x7f527032c780) 16
+ vptr=((& QPrintDialog::_ZTV12QPrintDialog) + 488)
+
+Vtable for QPrinter
+QPrinter::_ZTV8QPrinter: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI8QPrinter)
+16 (int (*)(...))QPrinter::~QPrinter
+24 (int (*)(...))QPrinter::~QPrinter
+32 (int (*)(...))QPrinter::devType
+40 (int (*)(...))QPrinter::paintEngine
+48 (int (*)(...))QPrinter::metric
+56 (int (*)(...))QPaintDevice::initPainter
+64 (int (*)(...))QPaintDevice::redirected
+72 (int (*)(...))QPaintDevice::sharedPainter
+80 (int (*)(...))QPrinter::newPage
+88 (int (*)(...))QPrinter::setPageSize
+96 (int (*)(...))QPrinter::setPageSizeMM
+104 (int (*)(...))QPrinter::setMargins
+
+Class QPrinter
+ size=40 align=8
+ base size=40 base align=8
+QPrinter (0x0x7f527062e958) 0
+ vptr=((& QPrinter::_ZTV8QPrinter) + 16)
+ QPagedPaintDevice (0x0x7f527062e9c0) 0
+ primary-for QPrinter (0x0x7f527062e958)
+ QPaintDevice (0x0x7f527032c9c0) 0
+ primary-for QPagedPaintDevice (0x0x7f527062e9c0)
+
+Vtable for QPrintEngine
+QPrintEngine::_ZTV12QPrintEngine: 10 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI12QPrintEngine)
+16 0
+24 0
+32 (int (*)(...))__cxa_pure_virtual
+40 (int (*)(...))__cxa_pure_virtual
+48 (int (*)(...))__cxa_pure_virtual
+56 (int (*)(...))__cxa_pure_virtual
+64 (int (*)(...))__cxa_pure_virtual
+72 (int (*)(...))__cxa_pure_virtual
+
+Class QPrintEngine
+ size=8 align=8
+ base size=8 base align=8
+QPrintEngine (0x0x7f527032cd80) 0 nearly-empty
+ vptr=((& QPrintEngine::_ZTV12QPrintEngine) + 16)
+
+Class QPrinterInfo
+ size=8 align=8
+ base size=8 base align=8
+QPrinterInfo (0x0x7f527039a000) 0
+
+Class QPrintPreviewDialog::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QPrintPreviewDialog::QPrivateSignal (0x0x7f527039a240) 0 empty
+
+Vtable for QPrintPreviewDialog
+QPrintPreviewDialog::_ZTV19QPrintPreviewDialog: 69 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QPrintPreviewDialog)
+16 (int (*)(...))QPrintPreviewDialog::metaObject
+24 (int (*)(...))QPrintPreviewDialog::qt_metacast
+32 (int (*)(...))QPrintPreviewDialog::qt_metacall
+40 (int (*)(...))QPrintPreviewDialog::~QPrintPreviewDialog
+48 (int (*)(...))QPrintPreviewDialog::~QPrintPreviewDialog
+56 (int (*)(...))QWidget::event
+64 (int (*)(...))QDialog::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QPrintPreviewDialog::setVisible
+128 (int (*)(...))QDialog::sizeHint
+136 (int (*)(...))QDialog::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QWidget::mousePressEvent
+176 (int (*)(...))QWidget::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QWidget::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QDialog::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QWidget::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QDialog::resizeEvent
+280 (int (*)(...))QDialog::closeEvent
+288 (int (*)(...))QDialog::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QDialog::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QWidget::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QDialog::open
+440 (int (*)(...))QDialog::exec
+448 (int (*)(...))QPrintPreviewDialog::done
+456 (int (*)(...))QDialog::accept
+464 (int (*)(...))QDialog::reject
+472 (int (*)(...))-16
+480 (int (*)(...))(& _ZTI19QPrintPreviewDialog)
+488 (int (*)(...))QPrintPreviewDialog::_ZThn16_N19QPrintPreviewDialogD1Ev
+496 (int (*)(...))QPrintPreviewDialog::_ZThn16_N19QPrintPreviewDialogD0Ev
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+512 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+520 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+528 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+536 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+544 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QPrintPreviewDialog
+ size=48 align=8
+ base size=48 base align=8
+QPrintPreviewDialog (0x0x7f527062ea28) 0
+ vptr=((& QPrintPreviewDialog::_ZTV19QPrintPreviewDialog) + 16)
+ QDialog (0x0x7f527062ea90) 0
+ primary-for QPrintPreviewDialog (0x0x7f527062ea28)
+ QWidget (0x0x7f5270392850) 0
+ primary-for QDialog (0x0x7f527062ea90)
+ QObject (0x0x7f527039a180) 0
+ primary-for QWidget (0x0x7f5270392850)
+ QPaintDevice (0x0x7f527039a1e0) 16
+ vptr=((& QPrintPreviewDialog::_ZTV19QPrintPreviewDialog) + 488)
+
+Class QPrintPreviewWidget::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QPrintPreviewWidget::QPrivateSignal (0x0x7f527039a4e0) 0 empty
+
+Vtable for QPrintPreviewWidget
+QPrintPreviewWidget::_ZTV19QPrintPreviewWidget: 64 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI19QPrintPreviewWidget)
+16 (int (*)(...))QPrintPreviewWidget::metaObject
+24 (int (*)(...))QPrintPreviewWidget::qt_metacast
+32 (int (*)(...))QPrintPreviewWidget::qt_metacall
+40 (int (*)(...))QPrintPreviewWidget::~QPrintPreviewWidget
+48 (int (*)(...))QPrintPreviewWidget::~QPrintPreviewWidget
+56 (int (*)(...))QWidget::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QPrintPreviewWidget::setVisible
+128 (int (*)(...))QWidget::sizeHint
+136 (int (*)(...))QWidget::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QWidget::mousePressEvent
+176 (int (*)(...))QWidget::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QWidget::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QWidget::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QWidget::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QWidget::resizeEvent
+280 (int (*)(...))QWidget::closeEvent
+288 (int (*)(...))QWidget::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWidget::dragEnterEvent
+320 (int (*)(...))QWidget::dragMoveEvent
+328 (int (*)(...))QWidget::dragLeaveEvent
+336 (int (*)(...))QWidget::dropEvent
+344 (int (*)(...))QWidget::showEvent
+352 (int (*)(...))QWidget::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QWidget::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))-16
+440 (int (*)(...))(& _ZTI19QPrintPreviewWidget)
+448 (int (*)(...))QPrintPreviewWidget::_ZThn16_N19QPrintPreviewWidgetD1Ev
+456 (int (*)(...))QPrintPreviewWidget::_ZThn16_N19QPrintPreviewWidgetD0Ev
+464 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+472 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+480 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QPrintPreviewWidget
+ size=48 align=8
+ base size=48 base align=8
+QPrintPreviewWidget (0x0x7f527062eaf8) 0
+ vptr=((& QPrintPreviewWidget::_ZTV19QPrintPreviewWidget) + 16)
+ QWidget (0x0x7f52703929a0) 0
+ primary-for QPrintPreviewWidget (0x0x7f527062eaf8)
+ QObject (0x0x7f527039a420) 0
+ primary-for QWidget (0x0x7f52703929a0)
+ QPaintDevice (0x0x7f527039a480) 16
+ vptr=((& QPrintPreviewWidget::_ZTV19QPrintPreviewWidget) + 448)
+
+Class QWebEngineCertificateError
+ size=8 align=8
+ base size=8 base align=8
+QWebEngineCertificateError (0x0x7f527039a6c0) 0
+
+Class QWebEngineClientCertificateSelection
+ size=16 align=8
+ base size=16 base align=8
+QWebEngineClientCertificateSelection (0x0x7f527039a780) 0
+
+Class QWebEngineContextMenuData
+ size=8 align=8
+ base size=8 base align=8
+QWebEngineContextMenuData (0x0x7f527039a840) 0
+
+Class QWebEngineDownloadItem::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QWebEngineDownloadItem::QPrivateSignal (0x0x7f5270462840) 0 empty
+
+Vtable for QWebEngineDownloadItem
+QWebEngineDownloadItem::_ZTV22QWebEngineDownloadItem: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI22QWebEngineDownloadItem)
+16 (int (*)(...))QWebEngineDownloadItem::metaObject
+24 (int (*)(...))QWebEngineDownloadItem::qt_metacast
+32 (int (*)(...))QWebEngineDownloadItem::qt_metacall
+40 (int (*)(...))QWebEngineDownloadItem::~QWebEngineDownloadItem
+48 (int (*)(...))QWebEngineDownloadItem::~QWebEngineDownloadItem
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QWebEngineDownloadItem
+ size=24 align=8
+ base size=24 base align=8
+QWebEngineDownloadItem (0x0x7f527062ed00) 0
+ vptr=((& QWebEngineDownloadItem::_ZTV22QWebEngineDownloadItem) + 16)
+ QObject (0x0x7f52704627e0) 0
+ primary-for QWebEngineDownloadItem (0x0x7f527062ed00)
+
+Class QWebEngineFullScreenRequest
+ size=32 align=8
+ base size=25 base align=8
+QWebEngineFullScreenRequest (0x0x7f5270462de0) 0
+
+Class QWebEngineHistoryItem
+ size=8 align=8
+ base size=8 base align=8
+QWebEngineHistoryItem (0x0x7f52704c51e0) 0
+
+Class QWebEngineHistory
+ size=8 align=8
+ base size=8 base align=8
+QWebEngineHistory (0x0x7f527018e360) 0
+
+Class QWebEnginePage::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QWebEnginePage::QPrivateSignal (0x0x7f527018e5a0) 0 empty
+
+Vtable for QWebEnginePage
+QWebEnginePage::_ZTV14QWebEnginePage: 23 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QWebEnginePage)
+16 (int (*)(...))QWebEnginePage::metaObject
+24 (int (*)(...))QWebEnginePage::qt_metacast
+32 (int (*)(...))QWebEnginePage::qt_metacall
+40 (int (*)(...))QWebEnginePage::~QWebEnginePage
+48 (int (*)(...))QWebEnginePage::~QWebEnginePage
+56 (int (*)(...))QWebEnginePage::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWebEnginePage::triggerAction
+120 (int (*)(...))QWebEnginePage::createWindow
+128 (int (*)(...))QWebEnginePage::chooseFiles
+136 (int (*)(...))QWebEnginePage::javaScriptAlert
+144 (int (*)(...))QWebEnginePage::javaScriptConfirm
+152 (int (*)(...))QWebEnginePage::javaScriptPrompt
+160 (int (*)(...))QWebEnginePage::javaScriptConsoleMessage
+168 (int (*)(...))QWebEnginePage::certificateError
+176 (int (*)(...))QWebEnginePage::acceptNavigationRequest
+
+Class QWebEnginePage
+ size=24 align=8
+ base size=24 base align=8
+QWebEnginePage (0x0x7f527018d208) 0
+ vptr=((& QWebEnginePage::_ZTV14QWebEnginePage) + 16)
+ QObject (0x0x7f527018e540) 0
+ primary-for QWebEnginePage (0x0x7f527018d208)
+
+Class QWebEngineProfile::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QWebEngineProfile::QPrivateSignal (0x0x7f5270206b40) 0 empty
+
+Vtable for QWebEngineProfile
+QWebEngineProfile::_ZTV17QWebEngineProfile: 14 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI17QWebEngineProfile)
+16 (int (*)(...))QWebEngineProfile::metaObject
+24 (int (*)(...))QWebEngineProfile::qt_metacast
+32 (int (*)(...))QWebEngineProfile::qt_metacall
+40 (int (*)(...))QWebEngineProfile::~QWebEngineProfile
+48 (int (*)(...))QWebEngineProfile::~QWebEngineProfile
+56 (int (*)(...))QObject::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+
+Class QWebEngineProfile
+ size=24 align=8
+ base size=24 base align=8
+QWebEngineProfile (0x0x7f527018d340) 0
+ vptr=((& QWebEngineProfile::_ZTV17QWebEngineProfile) + 16)
+ QObject (0x0x7f5270206ae0) 0
+ primary-for QWebEngineProfile (0x0x7f527018d340)
+
+Class QWebEngineScript
+ size=8 align=8
+ base size=8 base align=8
+QWebEngineScript (0x0x7f5270206f60) 0
+
+Class QWebEngineScriptCollection
+ size=8 align=8
+ base size=8 base align=8
+QWebEngineScriptCollection (0x0x7f527031d360) 0
+
+Class QWebEngineSettings
+ size=8 align=8
+ base size=8 base align=8
+QWebEngineSettings (0x0x7f527031d4e0) 0
+
+Class QWebEngineView::QPrivateSignal
+ size=1 align=1
+ base size=0 base align=1
+QWebEngineView::QPrivateSignal (0x0x7f527031d720) 0 empty
+
+Vtable for QWebEngineView
+QWebEngineView::_ZTV14QWebEngineView: 65 entries
+0 (int (*)(...))0
+8 (int (*)(...))(& _ZTI14QWebEngineView)
+16 (int (*)(...))QWebEngineView::metaObject
+24 (int (*)(...))QWebEngineView::qt_metacast
+32 (int (*)(...))QWebEngineView::qt_metacall
+40 (int (*)(...))QWebEngineView::~QWebEngineView
+48 (int (*)(...))QWebEngineView::~QWebEngineView
+56 (int (*)(...))QWebEngineView::event
+64 (int (*)(...))QObject::eventFilter
+72 (int (*)(...))QObject::timerEvent
+80 (int (*)(...))QObject::childEvent
+88 (int (*)(...))QObject::customEvent
+96 (int (*)(...))QObject::connectNotify
+104 (int (*)(...))QObject::disconnectNotify
+112 (int (*)(...))QWidget::devType
+120 (int (*)(...))QWidget::setVisible
+128 (int (*)(...))QWebEngineView::sizeHint
+136 (int (*)(...))QWidget::minimumSizeHint
+144 (int (*)(...))QWidget::heightForWidth
+152 (int (*)(...))QWidget::hasHeightForWidth
+160 (int (*)(...))QWidget::paintEngine
+168 (int (*)(...))QWidget::mousePressEvent
+176 (int (*)(...))QWidget::mouseReleaseEvent
+184 (int (*)(...))QWidget::mouseDoubleClickEvent
+192 (int (*)(...))QWidget::mouseMoveEvent
+200 (int (*)(...))QWidget::wheelEvent
+208 (int (*)(...))QWidget::keyPressEvent
+216 (int (*)(...))QWidget::keyReleaseEvent
+224 (int (*)(...))QWidget::focusInEvent
+232 (int (*)(...))QWidget::focusOutEvent
+240 (int (*)(...))QWidget::enterEvent
+248 (int (*)(...))QWidget::leaveEvent
+256 (int (*)(...))QWidget::paintEvent
+264 (int (*)(...))QWidget::moveEvent
+272 (int (*)(...))QWidget::resizeEvent
+280 (int (*)(...))QWebEngineView::closeEvent
+288 (int (*)(...))QWebEngineView::contextMenuEvent
+296 (int (*)(...))QWidget::tabletEvent
+304 (int (*)(...))QWidget::actionEvent
+312 (int (*)(...))QWebEngineView::dragEnterEvent
+320 (int (*)(...))QWebEngineView::dragMoveEvent
+328 (int (*)(...))QWebEngineView::dragLeaveEvent
+336 (int (*)(...))QWebEngineView::dropEvent
+344 (int (*)(...))QWebEngineView::showEvent
+352 (int (*)(...))QWebEngineView::hideEvent
+360 (int (*)(...))QWidget::nativeEvent
+368 (int (*)(...))QWidget::changeEvent
+376 (int (*)(...))QWidget::metric
+384 (int (*)(...))QWidget::initPainter
+392 (int (*)(...))QWidget::redirected
+400 (int (*)(...))QWidget::sharedPainter
+408 (int (*)(...))QWidget::inputMethodEvent
+416 (int (*)(...))QWidget::inputMethodQuery
+424 (int (*)(...))QWidget::focusNextPrevChild
+432 (int (*)(...))QWebEngineView::createWindow
+440 (int (*)(...))-16
+448 (int (*)(...))(& _ZTI14QWebEngineView)
+456 (int (*)(...))QWebEngineView::_ZThn16_N14QWebEngineViewD1Ev
+464 (int (*)(...))QWebEngineView::_ZThn16_N14QWebEngineViewD0Ev
+472 (int (*)(...))QWidget::_ZThn16_NK7QWidget7devTypeEv
+480 (int (*)(...))QWidget::_ZThn16_NK7QWidget11paintEngineEv
+488 (int (*)(...))QWidget::_ZThn16_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+496 (int (*)(...))QWidget::_ZThn16_NK7QWidget11initPainterEP8QPainter
+504 (int (*)(...))QWidget::_ZThn16_NK7QWidget10redirectedEP6QPoint
+512 (int (*)(...))QWidget::_ZThn16_NK7QWidget13sharedPainterEv
+
+Class QWebEngineView
+ size=56 align=8
+ base size=56 base align=8
+QWebEngineView (0x0x7f527031f0d0) 0
+ vptr=((& QWebEngineView::_ZTV14QWebEngineView) + 16)
+ QWidget (0x0x7f526ff348c0) 0
+ primary-for QWebEngineView (0x0x7f527031f0d0)
+ QObject (0x0x7f527031d660) 0
+ primary-for QWidget (0x0x7f526ff348c0)
+ QPaintDevice (0x0x7f527031d6c0) 16
+ vptr=((& QWebEngineView::_ZTV14QWebEngineView) + 456)
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Save_errno (0x0x7f526ff87c60) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Range_chk (0x0x7f526ffa3000) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = long int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = long int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Save_errno (0x0x7f526ffa31e0) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = long int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = long int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Range_chk (0x0x7f526ffa3540) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long unsigned int; _Ret = long unsigned int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long unsigned int; _Ret = long unsigned int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Save_errno (0x0x7f526ffa3720) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long unsigned int; _Ret = long unsigned int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long unsigned int; _Ret = long unsigned int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Range_chk (0x0x7f526ffa3a80) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long int; _Ret = long long int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long int; _Ret = long long int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Save_errno (0x0x7f526ffa3c60) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long int; _Ret = long long int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long int; _Ret = long long int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Range_chk (0x0x7f526ffdf000) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long unsigned int; _Ret = long long unsigned int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long unsigned int; _Ret = long long unsigned int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Save_errno (0x0x7f526ffdf1e0) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long unsigned int; _Ret = long long unsigned int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long unsigned int; _Ret = long long unsigned int; _CharT = char; _Base = {int}; std::size_t = long unsigned int]::_Range_chk (0x0x7f526ffdf540) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = float; _Ret = float; _CharT = char; _Base = {}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = float; _Ret = float; _CharT = char; _Base = {}; std::size_t = long unsigned int]::_Save_errno (0x0x7f526ffdf720) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = float; _Ret = float; _CharT = char; _Base = {}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = float; _Ret = float; _CharT = char; _Base = {}; std::size_t = long unsigned int]::_Range_chk (0x0x7f526ffdfa80) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = double; _Ret = double; _CharT = char; _Base = {}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = double; _Ret = double; _CharT = char; _Base = {}; std::size_t = long unsigned int]::_Save_errno (0x0x7f526ffdfc60) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = double; _Ret = double; _CharT = char; _Base = {}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = double; _Ret = double; _CharT = char; _Base = {}; std::size_t = long unsigned int]::_Range_chk (0x0x7f5270015000) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long double; _Ret = long double; _CharT = char; _Base = {}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long double; _Ret = long double; _CharT = char; _Base = {}; std::size_t = long unsigned int]::_Save_errno (0x0x7f52700151e0) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long double; _Ret = long double; _CharT = char; _Base = {}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long double; _Ret = long double; _CharT = char; _Base = {}; std::size_t = long unsigned int]::_Range_chk (0x0x7f5270015540) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Save_errno (0x0x7f5270043a20) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Range_chk (0x0x7f5270043d80) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = long int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = long int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Save_errno (0x0x7f5270043f00) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = long int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long int; _Ret = long int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Range_chk (0x0x7f52700722a0) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long unsigned int; _Ret = long unsigned int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long unsigned int; _Ret = long unsigned int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Save_errno (0x0x7f5270072420) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long unsigned int; _Ret = long unsigned int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long unsigned int; _Ret = long unsigned int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Range_chk (0x0x7f5270072780) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long int; _Ret = long long int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long int; _Ret = long long int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Save_errno (0x0x7f5270072900) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long int; _Ret = long long int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long int; _Ret = long long int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Range_chk (0x0x7f5270072c60) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long unsigned int; _Ret = long long unsigned int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long unsigned int; _Ret = long long unsigned int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Save_errno (0x0x7f5270072de0) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long unsigned int; _Ret = long long unsigned int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long long unsigned int; _Ret = long long unsigned int; _CharT = wchar_t; _Base = {int}; std::size_t = long unsigned int]::_Range_chk (0x0x7f52700a1180) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = float; _Ret = float; _CharT = wchar_t; _Base = {}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = float; _Ret = float; _CharT = wchar_t; _Base = {}; std::size_t = long unsigned int]::_Save_errno (0x0x7f52700a1300) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = float; _Ret = float; _CharT = wchar_t; _Base = {}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = float; _Ret = float; _CharT = wchar_t; _Base = {}; std::size_t = long unsigned int]::_Range_chk (0x0x7f52700a1660) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = double; _Ret = double; _CharT = wchar_t; _Base = {}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = double; _Ret = double; _CharT = wchar_t; _Base = {}; std::size_t = long unsigned int]::_Save_errno (0x0x7f52700a17e0) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = double; _Ret = double; _CharT = wchar_t; _Base = {}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = double; _Ret = double; _CharT = wchar_t; _Base = {}; std::size_t = long unsigned int]::_Range_chk (0x0x7f52700a1b40) 0 empty
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long double; _Ret = long double; _CharT = wchar_t; _Base = {}; std::size_t = long unsigned int]::_Save_errno
+ size=4 align=4
+ base size=4 base align=4
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long double; _Ret = long double; _CharT = wchar_t; _Base = {}; std::size_t = long unsigned int]::_Save_errno (0x0x7f52700a1cc0) 0
+
+Class __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long double; _Ret = long double; _CharT = wchar_t; _Base = {}; std::size_t = long unsigned int]::_Range_chk
+ size=1 align=1
+ base size=0 base align=1
+__gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...) [with _TRet = long double; _Ret = long double; _CharT = wchar_t; _Base = {}; std::size_t = long unsigned int]::_Range_chk (0x0x7f52700ca060) 0 empty
+
diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt
index d3c0651d1..2fa1f915a 100644
--- a/tests/auto/cmake/CMakeLists.txt
+++ b/tests/auto/cmake/CMakeLists.txt
@@ -1,16 +1,30 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
-cmake_minimum_required(VERSION 2.8)
-
-project(qmake_cmake_files)
+cmake_minimum_required(VERSION 3.16)
+project(qtwebengine_cmake_tests)
enable_testing()
-find_package(Qt5Core REQUIRED)
+find_package(Qt6Core REQUIRED)
-include("${_Qt5CTestMacros}")
+include("${_Qt6CTestMacros}")
-if (NOT NO_WIDGETS)
- test_module_includes(
- WebEngineWidgets QWebEngineView
+set(module_includes "")
+if(TARGET Qt6::WebEngineCore)
+ list(APPEND module_includes
+ WebEngineCore QWebEnginePage
+ )
+endif()
+if(TARGET Qt6::WebEngineWidgets)
+ list(APPEND module_includes
+ WebEngineWidgets QWebEngineView
)
endif()
+if(TARGET Qt6::Pdf)
+ list(APPEND module_includes
+ Pdf QPdfDocument
+ )
+endif()
+
+_qt_internal_test_module_includes(${module_includes})
diff --git a/tests/auto/cmake/cmake.pro b/tests/auto/cmake/cmake.pro
deleted file mode 100644
index 51d30da67..000000000
--- a/tests/auto/cmake/cmake.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-
-# Cause make to do nothing.
-TEMPLATE = subdirs
-
-CMAKE_QT_MODULES_UNDER_TEST = webengine
-qtHaveModule(widgets): CMAKE_QT_MODULES_UNDER_TEST += webenginewidgets
-
-CONFIG += ctest_testcase
diff --git a/tests/auto/core/CMakeLists.txt b/tests/auto/core/CMakeLists.txt
new file mode 100644
index 000000000..5908756b4
--- /dev/null
+++ b/tests/auto/core/CMakeLists.txt
@@ -0,0 +1,25 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+add_subdirectory(qwebenginecookiestore)
+add_subdirectory(qwebengineloadinginfo)
+add_subdirectory(qwebenginesettings)
+if(QT_FEATURE_ssl)
+ # only tests doh, and requires ssl
+ add_subdirectory(qwebengineglobalsettings)
+endif()
+add_subdirectory(qwebengineurlrequestinterceptor)
+add_subdirectory(qwebengineurlrequestjob)
+add_subdirectory(origins)
+add_subdirectory(devtools)
+add_subdirectory(getdomainandregistry)
+add_subdirectory(qtversion)
+
+if(QT_FEATURE_ssl)
+ add_subdirectory(qwebengineclientcertificatestore)
+ add_subdirectory(certificateerror)
+endif()
+
+if(QT_FEATURE_webenginedriver)
+ add_subdirectory(webenginedriver)
+endif()
diff --git a/tests/auto/core/certificateerror/BLACKLIST b/tests/auto/core/certificateerror/BLACKLIST
new file mode 100644
index 000000000..a8fd16bf3
--- /dev/null
+++ b/tests/auto/core/certificateerror/BLACKLIST
@@ -0,0 +1,2 @@
+[fatalError]
+*
diff --git a/tests/auto/core/certificateerror/CMakeLists.txt b/tests/auto/core/certificateerror/CMakeLists.txt
new file mode 100644
index 000000000..6223ca25c
--- /dev/null
+++ b/tests/auto/core/certificateerror/CMakeLists.txt
@@ -0,0 +1,26 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+include(../../httpserver/httpserver.cmake)
+include(../../util/util.cmake)
+
+qt_internal_add_test(tst_certificateerror
+ SOURCES
+ tst_certificateerror.cpp
+ LIBRARIES
+ Qt::WebEngineCore
+ Test::HttpServer
+ Test::Util
+)
+
+set(tst_certificateerror_resource_files
+ "resources/server.pem"
+ "resources/server.key"
+)
+
+qt_internal_add_resource(tst_certificateerror "tst_certificateerror"
+ PREFIX
+ "/"
+ FILES
+ ${tst_certificateerror_resource_files}
+)
diff --git a/tests/auto/core/certificateerror/resources/server.key b/tests/auto/core/certificateerror/resources/server.key
new file mode 100644
index 000000000..9bf87aee3
--- /dev/null
+++ b/tests/auto/core/certificateerror/resources/server.key
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEpQIBAAKCAQEAqAygFPG5ILLb3G51D0OIN4Kpm5t3Oh1nByTnvi1kMz+sCBBd
+CSugt4NnKkB6kiGtMEsrEm1/xg8Bkfbpet3v3+jAidRpjvCISqy3Z9D1cgCFM46h
+iob/AvLZpqITiAgsU4fJ4auuIKhFplIGrIKMv2gK8haoBGBoRUD1RM+irwjEr6TN
+XTQt2Ap+Ouxs53NLPhAOgumpfzzRR8/Umbhen+G5MhH+XTzzreiClz2V6A79ePJj
+y1uQ8NJ79feOOWBDRizRDWwxsnNd24GjkpvcaTwafiK6Vdqeub+XTtiB5RPal2on
+Cj0TQDcnaacecl/zmUWsIFNkNJWDcd3/vEdyOQIDAQABAoIBAQCW93icOCdim6tu
+FIDu7HEjxSsPUpPCToWu4lWaAHcinxGx0NlzkpD4K4DzcSdrvfszBmQ0UtBVokd7
+1IAdU+HZmePWLk+CDM2zoAPHrO3Cs3r2PS0cIHhZMsearcG0E/uWMseHB08PoXuo
+lcnPEhzVGueyYe4guGcTx+5PGeUBLf+fJcEc3rIQnT2LYulM2aqBZSQM3jRUaPYs
+F0awDpCNwajW/Bt2VB14Pr+H5MJ+WSznFCqW7SolBkqDGfKckXPSHgX6xZ0y7VCI
+MM8vwlVI4mPkaHvSQMSI8vS4Qh+SGQCSs/AuuNLjjPoz1YotV3Ih4YbLj6BjFP2g
+CrqzT6VNAoGBANOHmsqE0nRkLzonTDrMdla5b0TjTxwtNM5DjLgJa6UBBqPe+1Lv
+JFoBP9bIfYDRWZOZrxXItfMmM43nK/ST6Xqgx1IpHUCLKVr2pA9RXrP+m4oawfgn
+frW212fHibeOYiLy+DaQXQ0VRFxsc/VbwKVyVlMEcNg3N93x2E67M7vjAoGBAMtg
+7wDa+5gjwuyNr7LKkp5VDTmtKQhoDtg4sw6MSQSMF6fJT9Z4kGTZ23+G85/LsM/k
+iXbceabGJ0CQJvGn6oW4dI2Ut2c2nCNVbQCxJ6Nyn/yW7bRLShMnwXvbGAVxVUax
+5ohJPZGJ8ar2CP76A0bkvm2Nwylq2gp6Y8h7+iwzAoGBAKizwfQ6sk45iKDsrpNG
+dir8gY2DbJigRTksDpLIkJ1skAspz295YpiV3oBCLjYKwVJCg6zwAo0FrqBB+oB5
+ZwByMgWI3NeZJUZy5q2Ay/Lp4MroRELR3PC3/lu6fE90szgEZ4m84TmJ+Jdtt527
+q41H/yj+pbELePb95vIDw2LZAoGBAJBZ+MmupCzUFSI5Xp+UUIS48W4ijaE92mt1
+swF8aMcleBTLOjOL11D9oGHfs0OUG6czGq6WxnGs62dT6ZBUEo1e4rsq9xH3HNOn
+anq3Qt8sGIn7xjPVzHnUGeyDEYWrb0+CLZJGCcEnG7SwdKolYfYLnW281Oysvp35
+SKGf/W0pAoGAa2+sZmhb1mpGAf6Bi4z+uym/6qOJmG6CnrBSM9e/r8nujwFVkCYF
+3iz48qx3GbuliO6za8aM1drX2u8KWp1uP5KzwYvtW5SfpQ1eusFblHEYQQNRcKLT
+j/wZBXnU961eMKkkTe2XsPirO8rVhVmxuFLqT/aEPffcragQFFIGOEQ=
+-----END RSA PRIVATE KEY-----
diff --git a/tests/auto/core/certificateerror/resources/server.pem b/tests/auto/core/certificateerror/resources/server.pem
new file mode 100644
index 000000000..a201ed08e
--- /dev/null
+++ b/tests/auto/core/certificateerror/resources/server.pem
@@ -0,0 +1,41 @@
+-----BEGIN CERTIFICATE-----
+MIIDezCCAmOgAwIBAgIUFZEIIzeR7lEA10rb14w7MfhP87MwDQYJKoZIhvcNAQEL
+BQAwWjELMAkGA1UEBhMCREUxDzANBgNVBAgMBkJlcmxpbjEPMA0GA1UEBwwGQmVy
+bGluMRUwEwYDVQQKDAxUaGVRdENvbXBhbnkxEjAQBgNVBAsMCXdlYmVuZ2luZTAe
+Fw0yMTA1MTAyMTM1MTJaFw0yMjA1MTAyMTM1MTJaMGAxCzAJBgNVBAYTAkRFMQ8w
+DQYDVQQIDAZCZXJsaW4xDzANBgNVBAcMBkJlcmxpbjEVMBMGA1UECgwMVGhlUXRD
+b21wYW55MRgwFgYDVQQDDA93ZWJlbmdpbmUucXQuaW8wggEiMA0GCSqGSIb3DQEB
+AQUAA4IBDwAwggEKAoIBAQCoDKAU8bkgstvcbnUPQ4g3gqmbm3c6HWcHJOe+LWQz
+P6wIEF0JK6C3g2cqQHqSIa0wSysSbX/GDwGR9ul63e/f6MCJ1GmO8IhKrLdn0PVy
+AIUzjqGKhv8C8tmmohOICCxTh8nhq64gqEWmUgasgoy/aAryFqgEYGhFQPVEz6Kv
+CMSvpM1dNC3YCn467Gznc0s+EA6C6al/PNFHz9SZuF6f4bkyEf5dPPOt6IKXPZXo
+Dv148mPLW5Dw0nv19445YENGLNENbDGyc13bgaOSm9xpPBp+IrpV2p65v5dO2IHl
+E9qXaicKPRNANydppx5yX/OZRawgU2Q0lYNx3f+8R3I5AgMBAAGjMzAxMBoGA1Ud
+EQQTMBGCD3dlYmVuZ2luZS5xdC5pbzATBgNVHSUEDDAKBggrBgEFBQcDATANBgkq
+hkiG9w0BAQsFAAOCAQEAjThKpP0sBv1vEmaqBc1wTu//7RHmFcoStTt3scADzb2C
+9gjOVC4NzxBneLkv01444Z1p/Iiu/ZZ+VKu7aJElJgnBWEisYwJ09t3cdZRA0UY7
+XRvTVAqV0OlsB1Jn0afE+aTLGjWo+jSYzua0O+NK74e23p9jkdSmXxH9w0FB/oyM
+FGIOFnnfP0+QR4ZVvAGk2H60tBHQKmCM6b87TiD4GQIfOghCQWH+qJYSuyGu4hkE
+uis+n1KHHhed3GIJOHpm7gt1C9qtjcp1nOpv0ycQjfc9CGvr02BcQjhMeO65hX0A
+TvCgKN9/XMFv5jwwjjPCL12GBhwnN2k9hM/tEYpe2A==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDOzCCAiMCFDwWg4NZxCplj3qyBxAUTi1wmj4jMA0GCSqGSIb3DQEBCwUAMFox
+CzAJBgNVBAYTAkRFMQ8wDQYDVQQIDAZCZXJsaW4xDzANBgNVBAcMBkJlcmxpbjEV
+MBMGA1UECgwMVGhlUXRDb21wYW55MRIwEAYDVQQLDAl3ZWJlbmdpbmUwHhcNMjEw
+NTEwMjEzMTE4WhcNMjIwNTEwMjEzMTE4WjBaMQswCQYDVQQGEwJERTEPMA0GA1UE
+CAwGQmVybGluMQ8wDQYDVQQHDAZCZXJsaW4xFTATBgNVBAoMDFRoZVF0Q29tcGFu
+eTESMBAGA1UECwwJd2ViZW5naW5lMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
+CgKCAQEAuc/8xVrfSzOsI6kYul+o1QIPBh1I86eQm1PhTBDMAAPHuzyPaEMgBkn2
+XAUmvkynGpNioaJDU2ndV2fBHvsoeQCdNNmjFTe1rKYjrN6U2X5KoYSzN93TOYzK
+aR38fEFx+w4qV76nnxSjYtGNe9z74GrfWFMdDQ0NJKzvaO4gaZ+OOg0OzWy4MJQ0
+aINo3UV55Y7Nt92AxFweiuHucKu+rjf3BX7n0Af/Tcs2c84f0R3HA7euReSibVvX
+f33eHLRKwu2bvDjXiUzOdkxBn9GTo6Q09LyY6wDG0ZdWnyCKj3NBQKBVrq+bs3Q0
+ATsWhj/PvYlZhhZh4EOlqYOhCpwv4wIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQCC
+pLSFGJcG0zhHW+2A6ogmpn2tA8gKUZx7f0J1nwgPEoAXQqWQv/299ZtmWfMKHUkk
+ygG4u80C87wWPH42XWXo/KDrP9iYzoqAvtqbRuPG9PAxefQ/JUSnuhikA51g9+Mu
+IDKKKSI+y/JW9u0Qo77fp/5n2DaFn5B+pBYvn/xLfaEa9bRdJMTEMsElGbPBzMZd
+I/7X6B78X6Ow5TuRKSeZA7E1AZ/+e5A4Hj65bLAugoSKz3zaS0dV26LwAo18c2zP
+TqtwHyIVj4QCoI6Z694q9KH4Pkml3fz8VSkk+MvZMWapvUhHu/DneTgqGbp9POYg
+nx6oWME6idhnvN6DljxB
+-----END CERTIFICATE-----
diff --git a/tests/auto/core/certificateerror/tst_certificateerror.cpp b/tests/auto/core/certificateerror/tst_certificateerror.cpp
new file mode 100644
index 000000000..67e2d8ae4
--- /dev/null
+++ b/tests/auto/core/certificateerror/tst_certificateerror.cpp
@@ -0,0 +1,134 @@
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+#include <httpsserver.h>
+#include <util.h>
+
+#include <QWebEngineCertificateError>
+#include <QWebEnginePage>
+#include <QWebEngineSettings>
+
+#include <QtTest/QtTest>
+
+class tst_CertificateError : public QObject
+{
+ Q_OBJECT
+public:
+ tst_CertificateError() { }
+
+private Q_SLOTS:
+ void handleError_data();
+ void handleError();
+ void fatalError();
+};
+
+struct PageWithCertificateErrorHandler : QWebEnginePage
+{
+ Q_OBJECT
+
+public:
+ PageWithCertificateErrorHandler(bool defer, bool accept, QObject *p = nullptr)
+ : QWebEnginePage(p), deferError(defer), acceptCertificate(accept)
+ , loadSpy(this, &QWebEnginePage::loadFinished)
+ {
+ connect(this, &PageWithCertificateErrorHandler::certificateError,
+ this, &PageWithCertificateErrorHandler::onCertificateError);
+ }
+
+ bool deferError, acceptCertificate;
+
+ QSignalSpy loadSpy;
+ QScopedPointer<QWebEngineCertificateError> error;
+
+public Q_SLOTS:
+ void onCertificateError(QWebEngineCertificateError e)
+ {
+ error.reset(new QWebEngineCertificateError(e));
+ if (deferError) {
+ error->defer();
+ return;
+ }
+
+ if (acceptCertificate)
+ error->acceptCertificate();
+ else
+ error->rejectCertificate();
+ }
+};
+
+void tst_CertificateError::handleError_data()
+{
+ QTest::addColumn<bool>("deferError");
+ QTest::addColumn<bool>("acceptCertificate");
+ QTest::addColumn<QString>("expectedContent");
+ QTest::addRow("Reject") << false << false << QString();
+ QTest::addRow("DeferReject") << true << false << QString();
+ QTest::addRow("DeferAccept") << true << true << "TEST";
+}
+
+void tst_CertificateError::handleError()
+{
+ HttpsServer server(":/resources/server.pem", ":/resources/server.key", "");
+ server.setExpectError(false);
+ QVERIFY(server.start());
+
+ connect(&server, &HttpsServer::newRequest, [&] (HttpReqRep *rr) {
+ rr->setResponseBody(QByteArrayLiteral("<html><body>TEST</body></html>"));
+ rr->sendResponse();
+ });
+
+ QFETCH(bool, deferError);
+ QFETCH(bool, acceptCertificate);
+ QFETCH(QString, expectedContent);
+
+ PageWithCertificateErrorHandler page(deferError, acceptCertificate);
+ page.settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, false);
+
+ page.setUrl(server.url());
+ QTRY_VERIFY(page.error);
+ QVERIFY(page.error->isOverridable());
+ auto chain = page.error->certificateChain();
+ QCOMPARE(chain.size(), 2);
+ QCOMPARE(chain[0].serialNumber(), "15:91:08:23:37:91:ee:51:00:d7:4a:db:d7:8c:3b:31:f8:4f:f3:b3");
+ QCOMPARE(chain[1].serialNumber(), "3c:16:83:83:59:c4:2a:65:8f:7a:b2:07:10:14:4e:2d:70:9a:3e:23");
+
+ if (deferError) {
+ QCOMPARE(page.loadSpy.size(), 0);
+ QCOMPARE(toPlainTextSync(&page), QString());
+
+ if (acceptCertificate)
+ page.error->acceptCertificate();
+ else
+ page.error->rejectCertificate();
+
+ page.error.reset();
+ }
+ QTRY_COMPARE_WITH_TIMEOUT(page.loadSpy.size(), 1, 30000);
+ QCOMPARE(page.loadSpy.takeFirst().value(0).toBool(), acceptCertificate);
+ QCOMPARE(toPlainTextSync(&page), expectedContent);
+ QVERIFY(server.stop());
+}
+
+void tst_CertificateError::fatalError()
+{
+ PageWithCertificateErrorHandler page(false, false);
+ page.settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, false);
+ QSignalSpy loadFinishedSpy(&page, &QWebEnginePage::loadFinished);
+
+ page.setUrl(QUrl("https://revoked.badssl.com"));
+ if (!loadFinishedSpy.wait(10000)) {
+ QVERIFY2(!page.error, "There shouldn't be any certificate error if not loaded due to missing internet access!");
+ QSKIP("Couldn't load page from network, skipping test.");
+ }
+
+ // revoked certificate might not be reported as invalid by chromium and the load will silently succeed
+ bool failed = !loadFinishedSpy.first().first().toBool(), hasError = bool(page.error);
+ QCOMPARE(failed, hasError);
+ if (hasError) {
+ QVERIFY(!page.error->isOverridable());
+ // Fatal certificate errors are implicitly rejected. But second call should not cause crash.
+ page.error->rejectCertificate();
+ }
+}
+
+QTEST_MAIN(tst_CertificateError)
+#include <tst_certificateerror.moc>
diff --git a/tests/auto/core/core.pro b/tests/auto/core/core.pro
deleted file mode 100644
index 1dc5e052c..000000000
--- a/tests/auto/core/core.pro
+++ /dev/null
@@ -1,9 +0,0 @@
-TEMPLATE = subdirs
-QT_FOR_CONFIG += network-private
-
-SUBDIRS += \
- qwebenginecookiestore \
- qwebengineurlrequestinterceptor
-
-qtConfig(ssl): SUBDIRS += qwebengineclientcertificatestore
-
diff --git a/tests/auto/core/devtools/CMakeLists.txt b/tests/auto/core/devtools/CMakeLists.txt
new file mode 100644
index 000000000..efde75240
--- /dev/null
+++ b/tests/auto/core/devtools/CMakeLists.txt
@@ -0,0 +1,10 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_test(tst_devtools
+ SOURCES
+ tst_devtools.cpp
+ LIBRARIES
+ Qt::WebEngineCore
+)
+
diff --git a/tests/auto/core/devtools/tst_devtools.cpp b/tests/auto/core/devtools/tst_devtools.cpp
new file mode 100644
index 000000000..57a2b83a3
--- /dev/null
+++ b/tests/auto/core/devtools/tst_devtools.cpp
@@ -0,0 +1,69 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#include <QtTest/QtTest>
+
+#include <qwebenginepage.h>
+
+class tst_DevTools : public QObject {
+ Q_OBJECT
+
+private Q_SLOTS:
+ void attachAndDestroyPageFirst();
+ void attachAndDestroyInspectorFirst();
+};
+
+void tst_DevTools::attachAndDestroyPageFirst()
+{
+ // External inspector + manual destruction of page first
+ QWebEnginePage* page = new QWebEnginePage();
+ QWebEnginePage* inspector = new QWebEnginePage();
+
+ QSignalSpy spy(page, &QWebEnginePage::loadFinished);
+ page->load(QUrl("data:text/plain,foobarbaz"));
+ QTRY_COMPARE_WITH_TIMEOUT(spy.size(), 1, 12000);
+
+ // shouldn't do anything until page is set
+ page->triggerAction(QWebEnginePage::InspectElement);
+
+ inspector->setInspectedPage(page);
+ page->triggerAction(QWebEnginePage::InspectElement);
+
+ // This is deliberately racy:
+ QTest::qWait(10);
+
+ delete page;
+ delete inspector;
+}
+
+void tst_DevTools::attachAndDestroyInspectorFirst()
+{
+ // External inspector + manual destruction of inspector first
+ QWebEnginePage* page = new QWebEnginePage();
+
+ // shouldn't do anything until page is set
+ page->triggerAction(QWebEnginePage::InspectElement);
+
+ QWebEnginePage* inspector = new QWebEnginePage();
+ inspector->setInspectedPage(page);
+
+ QSignalSpy spy(page, &QWebEnginePage::loadFinished);
+ page->setHtml(QStringLiteral("<body><h1>FOO BAR!</h1></body>"));
+ QTRY_COMPARE_WITH_TIMEOUT(spy.size(), 1, 12000);
+
+ page->triggerAction(QWebEnginePage::InspectElement);
+
+ delete inspector;
+
+ page->triggerAction(QWebEnginePage::InspectElement);
+
+ // This is deliberately racy:
+ QTest::qWait(10);
+
+ delete page;
+}
+
+
+QTEST_MAIN(tst_DevTools)
+
+#include "tst_devtools.moc"
diff --git a/tests/auto/core/getdomainandregistry/CMakeLists.txt b/tests/auto/core/getdomainandregistry/CMakeLists.txt
new file mode 100644
index 000000000..c2b65f9dc
--- /dev/null
+++ b/tests/auto/core/getdomainandregistry/CMakeLists.txt
@@ -0,0 +1,12 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+include(../../util/util.cmake)
+
+qt_internal_add_test(tst_getdomainandregistry
+ SOURCES
+ tst_getdomainandregistry.cpp
+ LIBRARIES
+ Qt::WebEngineCore
+ Test::Util
+)
diff --git a/tests/auto/core/getdomainandregistry/tst_getdomainandregistry.cpp b/tests/auto/core/getdomainandregistry/tst_getdomainandregistry.cpp
new file mode 100644
index 000000000..e9e0bf105
--- /dev/null
+++ b/tests/auto/core/getdomainandregistry/tst_getdomainandregistry.cpp
@@ -0,0 +1,30 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#include <QtTest/QtTest>
+#include <QtWebEngineCore/qtwebenginecoreglobal.h>
+
+class tst_GetDomainAndRegistry final : public QObject {
+ Q_OBJECT
+
+private Q_SLOTS:
+ void getDomainAndRegistry();
+};
+
+void tst_GetDomainAndRegistry::getDomainAndRegistry() {
+ QCOMPARE(qWebEngineGetDomainAndRegistry({"http://www.google.com/"}), QString("google.com"));
+ QCOMPARE(qWebEngineGetDomainAndRegistry({"http://www.google.co.uk/"}), QString("google.co.uk"));
+ QCOMPARE(qWebEngineGetDomainAndRegistry({"http://127.0.0.1/"}), QString());
+ QCOMPARE(qWebEngineGetDomainAndRegistry({"https://qt.io/"}), QString("qt.io"));
+ QCOMPARE(qWebEngineGetDomainAndRegistry({"https://download.qt.io/"}), QString("qt.io"));
+ QCOMPARE(qWebEngineGetDomainAndRegistry({"https://foo.fr/"}), QString("foo.fr"));
+ QCOMPARE(qWebEngineGetDomainAndRegistry({"https://foo.gouv.fr/"}), QString("foo.gouv.fr"));
+ QCOMPARE(qWebEngineGetDomainAndRegistry({"https://bar.foo.gouv.fr/"}), QString("foo.gouv.fr"));
+ QCOMPARE(qWebEngineGetDomainAndRegistry({"https://fr.wikipedia.org/wiki/%C3%89l%C3%A9phant"}), QString("wikipedia.org"));
+ QCOMPARE(qWebEngineGetDomainAndRegistry({"https://foo.günstigbestellen.de/"}), QString("foo.xn--gnstigbestellen-zvb.de"));
+ QCOMPARE(qWebEngineGetDomainAndRegistry({"https://foo.g\u00fcnstigbestellen.de/"}), QString("foo.xn--gnstigbestellen-zvb.de"));
+}
+
+
+QTEST_MAIN(tst_GetDomainAndRegistry)
+#include "tst_getdomainandregistry.moc"
diff --git a/tests/auto/core/origins/CMakeLists.txt b/tests/auto/core/origins/CMakeLists.txt
new file mode 100644
index 000000000..306074994
--- /dev/null
+++ b/tests/auto/core/origins/CMakeLists.txt
@@ -0,0 +1,52 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+include(../../httpserver/httpserver.cmake)
+include(../../util/util.cmake)
+
+qt_internal_add_test(tst_origins
+ SOURCES
+ tst_origins.cpp
+ LIBRARIES
+ Qt::WebEngineCore
+ Qt::WebEngineWidgets
+ Test::HttpServer
+ Test::Util
+)
+
+set(tst_origins_resource_files
+ "resources/createObjectURL.html"
+ "resources/dedicatedWorker.html"
+ "resources/dedicatedWorker.js"
+ "resources/mixedSchemes.html"
+ "resources/mixedSchemesWithCsp.html"
+ "resources/mixedSchemes_frame.html"
+ "resources/mixedXHR.html"
+ "resources/mixedXHR.txt"
+ "resources/serviceWorker.html"
+ "resources/serviceWorker.js"
+ "resources/sharedWorker.html"
+ "resources/sharedWorker.js"
+ "resources/subdir/frame2.html"
+ "resources/subdir/index.html"
+ "resources/subdir_frame1.html"
+ "resources/viewSource.html"
+ "resources/websocket.html"
+ "resources/websocket2.html"
+ "resources/red.png"
+ "resources/fetchApi.html"
+)
+
+qt_internal_add_resource(tst_origins "tst_origins"
+ PREFIX
+ "/"
+ FILES
+ ${tst_origins_resource_files}
+)
+
+qt_internal_extend_target(tst_origins CONDITION QT_FEATURE_webengine_webchannel AND TARGET Qt::WebSockets
+ DEFINES
+ WEBSOCKETS
+ LIBRARIES
+ Qt::WebSockets
+)
diff --git a/tests/auto/widgets/origins/resources/createObjectURL.html b/tests/auto/core/origins/resources/createObjectURL.html
index 133f636bb..133f636bb 100644
--- a/tests/auto/widgets/origins/resources/createObjectURL.html
+++ b/tests/auto/core/origins/resources/createObjectURL.html
diff --git a/tests/auto/widgets/origins/resources/dedicatedWorker.html b/tests/auto/core/origins/resources/dedicatedWorker.html
index cb4f14e73..cb4f14e73 100644
--- a/tests/auto/widgets/origins/resources/dedicatedWorker.html
+++ b/tests/auto/core/origins/resources/dedicatedWorker.html
diff --git a/tests/auto/widgets/origins/resources/dedicatedWorker.js b/tests/auto/core/origins/resources/dedicatedWorker.js
index 2631939d7..2631939d7 100644
--- a/tests/auto/widgets/origins/resources/dedicatedWorker.js
+++ b/tests/auto/core/origins/resources/dedicatedWorker.js
diff --git a/tests/auto/core/origins/resources/fetchApi.html b/tests/auto/core/origins/resources/fetchApi.html
new file mode 100644
index 000000000..7b54416fd
--- /dev/null
+++ b/tests/auto/core/origins/resources/fetchApi.html
@@ -0,0 +1,14 @@
+<!doctype html>
+<html>
+<body>
+ <script type="text/javascript">
+ const queryString = window.location.search;
+ const urlParams = new URLSearchParams(queryString);
+ const url = urlParams.get('url');
+ const f = fetch(url);
+ if (urlParams.get('printRes') == 'true') {
+ f.then((r) => r.text()).then((p) => console.log(p));
+ }
+ </script>
+</body>
+</html>
diff --git a/tests/auto/core/origins/resources/link.html b/tests/auto/core/origins/resources/link.html
new file mode 100644
index 000000000..297b9b273
--- /dev/null
+++ b/tests/auto/core/origins/resources/link.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Link</title>
+ </head>
+ <body>
+ <a id="link" href="">Link</a>
+ <script>
+ const urlParams = new URLSearchParams(window.location.search);
+ document.getElementById("link").href = urlParams.get('linkLocation');
+ </script>
+ </body>
+</html>
diff --git a/tests/auto/core/origins/resources/media.html b/tests/auto/core/origins/resources/media.html
new file mode 100644
index 000000000..091485b61
--- /dev/null
+++ b/tests/auto/core/origins/resources/media.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Media</title>
+ <script>
+ function addAudio(src) {
+ let aud = document.createElement('audio')
+ aud.src = src
+ document.getElementsByTagName("body")[0].appendChild(aud)
+ }
+ </script>
+ </head>
+ <body>
+ </body>
+</html>
diff --git a/tests/auto/core/origins/resources/mixedSchemes.html b/tests/auto/core/origins/resources/mixedSchemes.html
new file mode 100644
index 000000000..3e50c2c3b
--- /dev/null
+++ b/tests/auto/core/origins/resources/mixedSchemes.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Mixed</title>
+ <script>
+ var result;
+ var canary;
+
+ function setIFrameUrl(frameUrl,imgUrl) {
+ result = undefined;
+ canary = undefined;
+ let img = document.createElement('img');
+ img.onerror = function() {
+ console.log("TEST:cannotLoad");
+ console.log("TEST:done");
+ };
+ img.onload = function() {
+ document.getElementById("iframe").setAttribute("src", frameUrl);
+ };
+ img.src = imgUrl
+ }
+
+ addEventListener("load", function() {
+ document.getElementById("iframe").addEventListener("load", function() {
+ if (canary && window[0].canary) {
+ console.log("TEST:canLoadAndAccess");
+ console.log("TEST:done");
+ } else {
+ console.log("TEST:canLoadButNotAccess");
+ console.log("TEST:done");
+ }
+ });
+ });
+ window.onerror = function(message, url, line, col, errorObj) {
+ return true;
+ };
+ </script>
+ </head>
+ <body>
+ <iframe id="iframe"></iframe>
+ </body>
+</html>
diff --git a/tests/auto/widgets/origins/resources/mixedSchemesWithCsp.html b/tests/auto/core/origins/resources/mixedSchemesWithCsp.html
index ad7cbeeb7..ad7cbeeb7 100644
--- a/tests/auto/widgets/origins/resources/mixedSchemesWithCsp.html
+++ b/tests/auto/core/origins/resources/mixedSchemesWithCsp.html
diff --git a/tests/auto/core/origins/resources/mixedSchemes_frame.html b/tests/auto/core/origins/resources/mixedSchemes_frame.html
new file mode 100644
index 000000000..9499caa1f
--- /dev/null
+++ b/tests/auto/core/origins/resources/mixedSchemes_frame.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Mixed - Frame</title>
+ <script>
+ try{
+ var canary = true;
+ parent.canary = true;
+ }catch(exception){
+ };
+
+ </script>
+ </head>
+ <body></body>
+</html>
diff --git a/tests/auto/widgets/origins/resources/mixedXHR.html b/tests/auto/core/origins/resources/mixedXHR.html
index 3dfd90006..3dfd90006 100644
--- a/tests/auto/widgets/origins/resources/mixedXHR.html
+++ b/tests/auto/core/origins/resources/mixedXHR.html
diff --git a/tests/auto/widgets/origins/resources/mixedXHR.txt b/tests/auto/core/origins/resources/mixedXHR.txt
index b5754e203..b5754e203 100644
--- a/tests/auto/widgets/origins/resources/mixedXHR.txt
+++ b/tests/auto/core/origins/resources/mixedXHR.txt
diff --git a/tests/auto/core/origins/resources/red.png b/tests/auto/core/origins/resources/red.png
new file mode 100644
index 000000000..5ae85192b
--- /dev/null
+++ b/tests/auto/core/origins/resources/red.png
Binary files differ
diff --git a/tests/auto/core/origins/resources/redirect.css b/tests/auto/core/origins/resources/redirect.css
new file mode 100644
index 000000000..a6a03d8f5
--- /dev/null
+++ b/tests/auto/core/origins/resources/redirect.css
@@ -0,0 +1,3 @@
+body {
+ font-family: serif;
+}
diff --git a/tests/auto/core/origins/resources/redirect.html b/tests/auto/core/origins/resources/redirect.html
new file mode 100644
index 000000000..603cb76f0
--- /dev/null
+++ b/tests/auto/core/origins/resources/redirect.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>redirect</title>
+ <script>
+ function addStylesheetLink(src) {
+ let link = document.createElement('link');
+ link.rel = 'stylesheet';
+ link.href = src;
+ document.getElementsByTagName("head")[0].appendChild(link);
+ }
+ </script>
+ </head>
+ <body>
+ Text
+ </body>
+</html>
diff --git a/tests/auto/widgets/origins/resources/serviceWorker.html b/tests/auto/core/origins/resources/serviceWorker.html
index 27890c98f..27890c98f 100644
--- a/tests/auto/widgets/origins/resources/serviceWorker.html
+++ b/tests/auto/core/origins/resources/serviceWorker.html
diff --git a/tests/auto/widgets/origins/resources/serviceWorker.js b/tests/auto/core/origins/resources/serviceWorker.js
index 40a8c178f..40a8c178f 100644
--- a/tests/auto/widgets/origins/resources/serviceWorker.js
+++ b/tests/auto/core/origins/resources/serviceWorker.js
diff --git a/tests/auto/widgets/origins/resources/sharedWorker.html b/tests/auto/core/origins/resources/sharedWorker.html
index 8b5a0a794..8b5a0a794 100644
--- a/tests/auto/widgets/origins/resources/sharedWorker.html
+++ b/tests/auto/core/origins/resources/sharedWorker.html
diff --git a/tests/auto/widgets/origins/resources/sharedWorker.js b/tests/auto/core/origins/resources/sharedWorker.js
index 60ef93a5f..60ef93a5f 100644
--- a/tests/auto/widgets/origins/resources/sharedWorker.js
+++ b/tests/auto/core/origins/resources/sharedWorker.js
diff --git a/tests/auto/widgets/origins/resources/subdir/frame2.html b/tests/auto/core/origins/resources/subdir/frame2.html
index 3a2f664ca..3a2f664ca 100644
--- a/tests/auto/widgets/origins/resources/subdir/frame2.html
+++ b/tests/auto/core/origins/resources/subdir/frame2.html
diff --git a/tests/auto/widgets/origins/resources/subdir/index.html b/tests/auto/core/origins/resources/subdir/index.html
index 9c5d5d782..9c5d5d782 100644
--- a/tests/auto/widgets/origins/resources/subdir/index.html
+++ b/tests/auto/core/origins/resources/subdir/index.html
diff --git a/tests/auto/widgets/origins/resources/subdir_frame1.html b/tests/auto/core/origins/resources/subdir_frame1.html
index 63973f2f4..63973f2f4 100644
--- a/tests/auto/widgets/origins/resources/subdir_frame1.html
+++ b/tests/auto/core/origins/resources/subdir_frame1.html
diff --git a/tests/auto/widgets/origins/resources/viewSource.html b/tests/auto/core/origins/resources/viewSource.html
index 977074c74..977074c74 100644
--- a/tests/auto/widgets/origins/resources/viewSource.html
+++ b/tests/auto/core/origins/resources/viewSource.html
diff --git a/tests/auto/widgets/origins/resources/websocket.html b/tests/auto/core/origins/resources/websocket.html
index 31db66571..31db66571 100644
--- a/tests/auto/widgets/origins/resources/websocket.html
+++ b/tests/auto/core/origins/resources/websocket.html
diff --git a/tests/auto/core/origins/resources/websocket2.html b/tests/auto/core/origins/resources/websocket2.html
new file mode 100644
index 000000000..7365143de
--- /dev/null
+++ b/tests/auto/core/origins/resources/websocket2.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>WebSocket</title>
+ <script src="../qtwebchannel/qwebchannel.js"></script>
+ <script>
+ var result;
+ new QWebChannel(qt.webChannelTransport, channel => {
+ const ws = new WebSocket(channel.objects.echoServer.url);
+ ws.addEventListener("open", event => {
+ ws.send("ok");
+ });
+ ws.addEventListener("message", event => {
+ result = event.data;
+ });
+ ws.addEventListener("close", event => {
+ result = event.code;
+ });
+ })
+ </script>
+ </head>
+ <body></body>
+</html>
diff --git a/tests/auto/core/origins/tst_origins.cpp b/tests/auto/core/origins/tst_origins.cpp
new file mode 100644
index 000000000..81385701f
--- /dev/null
+++ b/tests/auto/core/origins/tst_origins.cpp
@@ -0,0 +1,1730 @@
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#include <util.h>
+#include "httpserver.h"
+
+#include <QtCore/qfile.h>
+#include <QtTest/QtTest>
+#include <QtWebEngineCore/qwebengineurlrequestinterceptor.h>
+#include <QtWebEngineCore/qwebengineurlrequestjob.h>
+#include <QtWebEngineCore/qwebengineurlscheme.h>
+#include <QtWebEngineCore/qwebengineurlschemehandler.h>
+#include <QtWebEngineCore/qwebenginesettings.h>
+#include <QtWebEngineCore/qwebengineprofile.h>
+#include <QtWebEngineCore/qwebenginepage.h>
+#include <QtWebEngineWidgets/qwebengineview.h>
+
+#if defined(WEBSOCKETS)
+#include <QtWebSockets/qwebsocket.h>
+#include <QtWebSockets/qwebsocketserver.h>
+#include <QtWebChannel/qwebchannel.h>
+#endif
+#include <qaction.h>
+
+#define QSL QStringLiteral
+#define QBAL QByteArrayLiteral
+
+Q_LOGGING_CATEGORY(lc, "qt.webengine.tests")
+
+void registerSchemes()
+{
+ {
+ QWebEngineUrlScheme scheme(QBAL("PathSyntax"));
+ QWebEngineUrlScheme::registerScheme(scheme);
+ }
+
+ {
+ QWebEngineUrlScheme scheme(QBAL("PathSyntax-Secure"));
+ scheme.setFlags(QWebEngineUrlScheme::SecureScheme);
+ QWebEngineUrlScheme::registerScheme(scheme);
+ }
+
+ {
+ QWebEngineUrlScheme scheme(QBAL("PathSyntax-Secure-ServiceWorkersAllowed"));
+ scheme.setFlags(QWebEngineUrlScheme::SecureScheme | QWebEngineUrlScheme::ServiceWorkersAllowed);
+ QWebEngineUrlScheme::registerScheme(scheme);
+ }
+
+ {
+ QWebEngineUrlScheme scheme(QBAL("PathSyntax-Local"));
+ scheme.setFlags(QWebEngineUrlScheme::LocalScheme);
+ QWebEngineUrlScheme::registerScheme(scheme);
+ }
+
+ {
+ QWebEngineUrlScheme scheme(QBAL("PathSyntax-LocalAccessAllowed"));
+ scheme.setFlags(QWebEngineUrlScheme::LocalAccessAllowed);
+ QWebEngineUrlScheme::registerScheme(scheme);
+ }
+
+ {
+ QWebEngineUrlScheme scheme(QBAL("PathSyntax-NoAccessAllowed"));
+ scheme.setFlags(QWebEngineUrlScheme::NoAccessAllowed);
+ QWebEngineUrlScheme::registerScheme(scheme);
+ }
+
+ {
+ QWebEngineUrlScheme scheme(QBAL("PathSyntax-ServiceWorkersAllowed"));
+ scheme.setFlags(QWebEngineUrlScheme::ServiceWorkersAllowed);
+ QWebEngineUrlScheme::registerScheme(scheme);
+ }
+
+ {
+ QWebEngineUrlScheme scheme(QBAL("PathSyntax-ViewSourceAllowed"));
+ scheme.setFlags(QWebEngineUrlScheme::ViewSourceAllowed);
+ QWebEngineUrlScheme::registerScheme(scheme);
+ }
+
+ {
+ QWebEngineUrlScheme scheme(QBAL("HostSyntax"));
+ scheme.setSyntax(QWebEngineUrlScheme::Syntax::Host);
+ QWebEngineUrlScheme::registerScheme(scheme);
+ }
+
+ {
+ QWebEngineUrlScheme scheme(QBAL("HostSyntax-ContentSecurityPolicyIgnored"));
+ scheme.setSyntax(QWebEngineUrlScheme::Syntax::Host);
+ scheme.setFlags(QWebEngineUrlScheme::ContentSecurityPolicyIgnored);
+ QWebEngineUrlScheme::registerScheme(scheme);
+ }
+
+ {
+ QWebEngineUrlScheme scheme(QBAL("HostAndPortSyntax"));
+ scheme.setSyntax(QWebEngineUrlScheme::Syntax::HostAndPort);
+ scheme.setDefaultPort(42);
+ QWebEngineUrlScheme::registerScheme(scheme);
+ }
+
+ {
+ QWebEngineUrlScheme scheme(QBAL("HostPortAndUserInformationSyntax"));
+ scheme.setSyntax(QWebEngineUrlScheme::Syntax::HostPortAndUserInformation);
+ scheme.setDefaultPort(42);
+ QWebEngineUrlScheme::registerScheme(scheme);
+ }
+
+ {
+ QWebEngineUrlScheme scheme(QBAL("redirect"));
+ scheme.setFlags(QWebEngineUrlScheme::CorsEnabled);
+ QWebEngineUrlScheme::registerScheme(scheme);
+ }
+
+ {
+ QWebEngineUrlScheme scheme(QBAL("redirect-secure"));
+ scheme.setFlags(QWebEngineUrlScheme::SecureScheme);
+ QWebEngineUrlScheme::registerScheme(scheme);
+ }
+
+ {
+ QWebEngineUrlScheme scheme(QBAL("redirect-local"));
+ scheme.setFlags(QWebEngineUrlScheme::LocalScheme | QWebEngineUrlScheme::LocalAccessAllowed);
+ QWebEngineUrlScheme::registerScheme(scheme);
+ }
+
+ {
+ QWebEngineUrlScheme scheme(QBAL("cors"));
+ scheme.setFlags(QWebEngineUrlScheme::CorsEnabled);
+ QWebEngineUrlScheme::registerScheme(scheme);
+ }
+ {
+ QWebEngineUrlScheme scheme(QBAL("secure-cors"));
+ scheme.setFlags(QWebEngineUrlScheme::SecureScheme | QWebEngineUrlScheme::CorsEnabled);
+ QWebEngineUrlScheme::registerScheme(scheme);
+ }
+ {
+ QWebEngineUrlScheme scheme(QBAL("localaccess"));
+ scheme.setFlags(QWebEngineUrlScheme::LocalAccessAllowed);
+ QWebEngineUrlScheme::registerScheme(scheme);
+ }
+ {
+ QWebEngineUrlScheme scheme(QBAL("local"));
+ scheme.setFlags(QWebEngineUrlScheme::LocalScheme);
+ QWebEngineUrlScheme::registerScheme(scheme);
+ }
+ {
+ QWebEngineUrlScheme scheme(QBAL("local-localaccess"));
+ scheme.setFlags(QWebEngineUrlScheme::LocalScheme | QWebEngineUrlScheme::LocalAccessAllowed);
+ QWebEngineUrlScheme::registerScheme(scheme);
+ }
+ {
+ QWebEngineUrlScheme scheme(QBAL("local-cors"));
+ scheme.setFlags(QWebEngineUrlScheme::LocalScheme | QWebEngineUrlScheme::CorsEnabled);
+ QWebEngineUrlScheme::registerScheme(scheme);
+ }
+ {
+ QWebEngineUrlScheme scheme("fetchapi-allowed");
+ scheme.setFlags(QWebEngineUrlScheme::CorsEnabled | QWebEngineUrlScheme::FetchApiAllowed);
+ QWebEngineUrlScheme::registerScheme(scheme);
+ }
+ {
+ QWebEngineUrlScheme scheme("fetchapi-not-allowed");
+ QWebEngineUrlScheme::registerScheme(scheme);
+ }
+}
+Q_CONSTRUCTOR_FUNCTION(registerSchemes)
+
+class TstUrlSchemeHandler final : public QWebEngineUrlSchemeHandler {
+ Q_OBJECT
+
+public:
+ TstUrlSchemeHandler(QWebEngineProfile *profile)
+ {
+ profile->installUrlSchemeHandler(QBAL("tst"), this);
+
+ profile->installUrlSchemeHandler(QBAL("PathSyntax"), this);
+ profile->installUrlSchemeHandler(QBAL("PathSyntax-Secure"), this);
+ profile->installUrlSchemeHandler(QBAL("PathSyntax-Secure-ServiceWorkersAllowed"), this);
+ profile->installUrlSchemeHandler(QBAL("PathSyntax-Local"), this);
+ profile->installUrlSchemeHandler(QBAL("PathSyntax-LocalAccessAllowed"), this);
+ profile->installUrlSchemeHandler(QBAL("PathSyntax-NoAccessAllowed"), this);
+ profile->installUrlSchemeHandler(QBAL("PathSyntax-ServiceWorkersAllowed"), this);
+ profile->installUrlSchemeHandler(QBAL("PathSyntax-ViewSourceAllowed"), this);
+ profile->installUrlSchemeHandler(QBAL("HostSyntax"), this);
+ profile->installUrlSchemeHandler(QBAL("HostSyntax-ContentSecurityPolicyIgnored"), this);
+ profile->installUrlSchemeHandler(QBAL("HostAndPortSyntax"), this);
+ profile->installUrlSchemeHandler(QBAL("HostPortAndUserInformationSyntax"), this);
+ profile->installUrlSchemeHandler(QBAL("redirect"), this);
+ profile->installUrlSchemeHandler(QBAL("redirect-secure"), this);
+ profile->installUrlSchemeHandler(QBAL("redirect-local"), this);
+ profile->installUrlSchemeHandler(QBAL("cors"), this);
+ profile->installUrlSchemeHandler(QBAL("secure-cors"), this);
+ profile->installUrlSchemeHandler(QBAL("localaccess"), this);
+ profile->installUrlSchemeHandler(QBAL("local"), this);
+ profile->installUrlSchemeHandler(QBAL("local-localaccess"), this);
+ profile->installUrlSchemeHandler(QBAL("local-cors"), this);
+ }
+
+ QList<QUrl> &requests() { return m_requests; }
+
+private:
+ void requestStarted(QWebEngineUrlRequestJob *job) override
+ {
+ QUrl url = job->requestUrl();
+ m_requests << url;
+
+ if (url.scheme().startsWith("redirect")) {
+ QString path = url.path();
+ int idx = path.indexOf(QChar('/'));
+ if (idx > 0) {
+ url.setScheme(path.first(idx));
+ url.setPath(path.mid(idx, -1));
+ job->redirect(url);
+ return;
+ }
+ }
+
+ QString pathPrefix = QDir(QT_TESTCASE_SOURCEDIR).canonicalPath();
+ if (url.path().startsWith("/qtwebchannel/"))
+ pathPrefix = QSL(":");
+ QString pathSuffix = url.path();
+ auto file = std::make_unique<QFile>(pathPrefix + pathSuffix, job);
+ if (!file->open(QIODevice::ReadOnly)) {
+ qWarning() << "Failed to read data for:" << url << file->errorString();
+ job->fail(QWebEngineUrlRequestJob::RequestFailed);
+ return;
+ }
+ QByteArray mimeType = QBAL("text/html");
+ if (pathSuffix.endsWith(QSL(".js")))
+ mimeType = QBAL("application/javascript");
+ else if (pathSuffix.endsWith(QSL(".css")))
+ mimeType = QBAL("text/css");
+ job->reply(mimeType, file.release());
+ }
+
+ QList<QUrl> m_requests;
+};
+
+class TestRequestInterceptor : public QWebEngineUrlRequestInterceptor
+{
+public:
+ TestRequestInterceptor() = default;
+ void interceptRequest(QWebEngineUrlRequestInfo &info) override
+ {
+ qCDebug(lc) << this << "Type:" << info.resourceType() << info.requestMethod() << "Navigation:" << info.navigationType()
+ << info.requestUrl() << "Initiator:" << info.initiator();
+
+ QUrl url = info.requestUrl();
+ requests << url;
+ if (url.scheme().startsWith("redirect")) {
+ QString path = url.path();
+ int idx = path.indexOf(QChar('/'));
+ if (idx > 0) {
+ url.setScheme(path.first(idx));
+ url.setPath(path.mid(idx, -1));
+ info.redirect(url);
+ }
+ }
+ }
+ QList<QUrl> requests;
+};
+
+class TestPage : public QWebEnginePage
+{
+public:
+ TestPage(QWebEngineProfile *profile) : QWebEnginePage(profile, nullptr)
+ {
+ }
+ void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel,
+ const QString &message, int,
+ const QString &) override
+ {
+ messages << message;
+ qCDebug(lc) << message;
+ }
+
+ bool logContainsDoneMarker() const { return messages.contains("TEST:done"); }
+
+ QString findResultInLog() const
+ {
+ // make sure we do not have some extra logs from blink
+ for (auto message : messages) {
+ QStringList s = message.split(':');
+ if (s.size() > 1 && s[0] == "TEST")
+ return s[1];
+ }
+ return QString();
+ }
+
+ void clearLog() { messages.clear(); }
+
+private:
+ QStringList messages;
+};
+
+class tst_Origins final : public QObject {
+ Q_OBJECT
+
+private Q_SLOTS:
+ void initTestCase();
+ void cleanupTestCase();
+ void init();
+ void cleanup();
+
+ void jsUrlCanon();
+ void jsUrlRelative();
+ void jsUrlOrigin();
+ void subdirWithAccess();
+ void subdirWithoutAccess();
+ void fileAccessRemoteUrl_data();
+ void fileAccessRemoteUrl();
+ void fileAccessLocalUrl_data();
+ void fileAccessLocalUrl();
+ void mixedSchemes_data();
+ void mixedSchemes();
+ void mixedSchemesWithCsp();
+ void mixedXHR_data();
+ void mixedXHR();
+ void mixedContent_data();
+ void mixedContent();
+ void localMediaBlock_data();
+ void localMediaBlock();
+#if defined(WEBSOCKETS)
+ void webSocket();
+#endif
+ void dedicatedWorker();
+ void sharedWorker();
+ void serviceWorker();
+ void viewSource();
+ void createObjectURL();
+ void redirectScheme();
+ void redirectSchemeLocal();
+ void redirectSchemeSecure();
+ void redirectInterceptor();
+ void redirectInterceptorLocal();
+ void redirectInterceptorSecure();
+ void redirectInterceptorFile();
+ void redirectInterceptorHttp();
+ void fetchApiCustomUrl_data();
+ void fetchApiCustomUrl();
+ void fetchApiHttpUrl();
+
+private:
+ bool verifyLoad(const QUrl &url)
+ {
+ QSignalSpy spy(m_page, &QWebEnginePage::loadFinished);
+ m_page->load(url);
+ [&spy]() { QTRY_VERIFY_WITH_TIMEOUT(!spy.isEmpty(), 90000); }();
+ return !spy.isEmpty() && spy.front().value(0).toBool();
+ }
+
+ QVariant eval(const QString &code)
+ {
+ return evaluateJavaScriptSync(m_page, code);
+ }
+
+ QWebEngineProfile m_profile;
+ TestPage *m_page = nullptr;
+ TstUrlSchemeHandler *m_handler = nullptr;
+};
+
+void tst_Origins::initTestCase()
+{
+ QTest::ignoreMessage(
+ QtWarningMsg,
+ QRegularExpression("Please register the custom scheme 'tst'.*"));
+
+ m_handler = new TstUrlSchemeHandler(&m_profile);
+}
+
+void tst_Origins::cleanupTestCase()
+{
+ QVERIFY(!m_page);
+ delete m_handler;
+}
+
+void tst_Origins::init()
+{
+ m_page = new TestPage(&m_profile);
+}
+
+void tst_Origins::cleanup()
+{
+ delete m_page;
+ m_page = nullptr;
+ m_handler->requests().clear();
+}
+
+// Test URL parsing and canonicalization in Blink. The implementation of this
+// part is mostly shared between Blink and Chromium proper.
+void tst_Origins::jsUrlCanon()
+{
+ QVERIFY(verifyLoad(QSL("about:blank")));
+
+ // Standard schemes are biased towards the authority part.
+ QCOMPARE(eval(QSL("new URL(\"http:foo/bar\").href")), QVariant(QSL("http://foo/bar")));
+ QCOMPARE(eval(QSL("new URL(\"http:/foo/bar\").href")), QVariant(QSL("http://foo/bar")));
+ QCOMPARE(eval(QSL("new URL(\"http://foo/bar\").href")), QVariant(QSL("http://foo/bar")));
+ QCOMPARE(eval(QSL("new URL(\"http:///foo/bar\").href")), QVariant(QSL("http://foo/bar")));
+
+ // The file scheme is however a (particularly) special case.
+#ifdef Q_OS_WIN
+ QCOMPARE(eval(QSL("new URL(\"file:foo/bar\").href")), QVariant(QSL("file://foo/bar")));
+ QCOMPARE(eval(QSL("new URL(\"file:/foo/bar\").href")), QVariant(QSL("file://foo/bar")));
+ QCOMPARE(eval(QSL("new URL(\"file://foo/bar\").href")), QVariant(QSL("file://foo/bar")));
+ QCOMPARE(eval(QSL("new URL(\"file:///foo/bar\").href")), QVariant(QSL("file:///foo/bar")));
+#else
+ QCOMPARE(eval(QSL("new URL(\"file:foo/bar\").href")), QVariant(QSL("file:///foo/bar")));
+ QCOMPARE(eval(QSL("new URL(\"file:/foo/bar\").href")), QVariant(QSL("file:///foo/bar")));
+ QCOMPARE(eval(QSL("new URL(\"file://foo/bar\").href")), QVariant(QSL("file://foo/bar")));
+ QCOMPARE(eval(QSL("new URL(\"file:///foo/bar\").href")), QVariant(QSL("file:///foo/bar")));
+#endif
+
+ // The qrc scheme is a PathSyntax scheme, having only a path and nothing else.
+ QCOMPARE(eval(QSL("new URL(\"qrc:foo/bar\").href")), QVariant(QSL("qrc:foo/bar")));
+ QCOMPARE(eval(QSL("new URL(\"qrc:/foo/bar\").href")), QVariant(QSL("qrc:/foo/bar")));
+ QCOMPARE(eval(QSL("new URL(\"qrc://foo/bar\").href")), QVariant(QSL("qrc://foo/bar")));
+ QCOMPARE(eval(QSL("new URL(\"qrc:///foo/bar\").href")), QVariant(QSL("qrc:///foo/bar")));
+
+ // Same for unregistered schemes.
+ QCOMPARE(eval(QSL("new URL(\"tst:foo/bar\").href")), QVariant(QSL("tst:foo/bar")));
+ QCOMPARE(eval(QSL("new URL(\"tst:/foo/bar\").href")), QVariant(QSL("tst:/foo/bar")));
+ QCOMPARE(eval(QSL("new URL(\"tst://foo/bar\").href")), QVariant(QSL("tst://foo/bar")));
+ QCOMPARE(eval(QSL("new URL(\"tst:///foo/bar\").href")), QVariant(QSL("tst:///foo/bar")));
+
+ // A HostSyntax scheme is like http without the port & user information.
+ QCOMPARE(eval(QSL("new URL(\"HostSyntax:foo/bar\").href")), QVariant(QSL("hostsyntax://foo/bar")));
+ QCOMPARE(eval(QSL("new URL(\"HostSyntax:foo:42/bar\").href")), QVariant(QSL("hostsyntax://foo/bar")));
+ QCOMPARE(eval(QSL("new URL(\"HostSyntax:a:b@foo/bar\").href")), QVariant(QSL("hostsyntax://foo/bar")));
+
+ // A HostAndPortSyntax scheme is like http without the user information.
+ QCOMPARE(eval(QSL("new URL(\"HostAndPortSyntax:foo/bar\").href")),
+ QVariant(QSL("hostandportsyntax://foo/bar")));
+ QCOMPARE(eval(QSL("new URL(\"HostAndPortSyntax:foo:41/bar\").href")),
+ QVariant(QSL("hostandportsyntax://foo:41/bar")));
+ QCOMPARE(eval(QSL("new URL(\"HostAndPortSyntax:foo:42/bar\").href")),
+ QVariant(QSL("hostandportsyntax://foo/bar")));
+ QCOMPARE(eval(QSL("new URL(\"HostAndPortSyntax:a:b@foo/bar\").href")),
+ QVariant(QSL("hostandportsyntax://foo/bar")));
+
+ // A HostPortAndUserInformationSyntax scheme is exactly like http.
+ QCOMPARE(eval(QSL("new URL(\"HostPortAndUserInformationSyntax:foo/bar\").href")),
+ QVariant(QSL("hostportanduserinformationsyntax://foo/bar")));
+ QCOMPARE(eval(QSL("new URL(\"HostPortAndUserInformationSyntax:foo:41/bar\").href")),
+ QVariant(QSL("hostportanduserinformationsyntax://foo:41/bar")));
+ QCOMPARE(eval(QSL("new URL(\"HostPortAndUserInformationSyntax:foo:42/bar\").href")),
+ QVariant(QSL("hostportanduserinformationsyntax://foo/bar")));
+ QCOMPARE(eval(QSL("new URL(\"HostPortAndUserInformationSyntax:a:b@foo/bar\").href")),
+ QVariant(QSL("hostportanduserinformationsyntax://a:b@foo/bar")));
+}
+
+// Test relative URL resolution.
+void tst_Origins::jsUrlRelative()
+{
+ QVERIFY(verifyLoad(QSL("about:blank")));
+
+ // Schemes with hosts, like http, work as expected.
+ QCOMPARE(eval(QSL("new URL('bar', 'http://foo').href")), QVariant(QSL("http://foo/bar")));
+ QCOMPARE(eval(QSL("new URL('baz', 'http://foo/bar').href")), QVariant(QSL("http://foo/baz")));
+ QCOMPARE(eval(QSL("new URL('baz', 'http://foo/bar/').href")), QVariant(QSL("http://foo/bar/baz")));
+ QCOMPARE(eval(QSL("new URL('/baz', 'http://foo/bar/').href")), QVariant(QSL("http://foo/baz")));
+ QCOMPARE(eval(QSL("new URL('./baz', 'http://foo/bar/').href")), QVariant(QSL("http://foo/bar/baz")));
+ QCOMPARE(eval(QSL("new URL('../baz', 'http://foo/bar/').href")), QVariant(QSL("http://foo/baz")));
+ QCOMPARE(eval(QSL("new URL('../../baz', 'http://foo/bar/').href")), QVariant(QSL("http://foo/baz")));
+ QCOMPARE(eval(QSL("new URL('//baz', 'http://foo/bar/').href")), QVariant(QSL("http://baz/")));
+
+ // In the case of schemes without hosts, relative URLs only work if the URL
+ // starts with a single slash -- and canonicalization does not guarantee
+ // this. The following cases all fail with TypeErrors.
+ QCOMPARE(eval(QSL("new URL('bar', 'tst:foo').href")), QVariant());
+ QCOMPARE(eval(QSL("new URL('baz', 'tst:foo/bar').href")), QVariant());
+ QCOMPARE(eval(QSL("new URL('bar', 'tst://foo').href")), QVariant());
+ QCOMPARE(eval(QSL("new URL('bar', 'tst:///foo').href")), QVariant());
+
+ // However, registered custom schemes have been patched to allow relative
+ // URLs even without an initial slash.
+ QCOMPARE(eval(QSL("new URL('bar', 'qrc:foo').href")), QVariant(QSL("qrc:bar")));
+ QCOMPARE(eval(QSL("new URL('baz', 'qrc:foo/bar').href")), QVariant(QSL("qrc:foo/baz")));
+ QCOMPARE(eval(QSL("new URL('bar', 'qrc://foo').href")), QVariant(QSL("qrc://bar")));
+ QCOMPARE(eval(QSL("new URL('bar', 'qrc:///foo').href")), QVariant(QSL("qrc:///bar")));
+
+ // With a slash it works the same as http except 'foo' is part of the path and not the host.
+ QCOMPARE(eval(QSL("new URL('bar', 'qrc:/foo').href")), QVariant(QSL("qrc:/bar")));
+ QCOMPARE(eval(QSL("new URL('bar', 'qrc:/foo/').href")), QVariant(QSL("qrc:/foo/bar")));
+ QCOMPARE(eval(QSL("new URL('baz', 'qrc:/foo/bar').href")), QVariant(QSL("qrc:/foo/baz")));
+ QCOMPARE(eval(QSL("new URL('baz', 'qrc:/foo/bar/').href")), QVariant(QSL("qrc:/foo/bar/baz")));
+ QCOMPARE(eval(QSL("new URL('/baz', 'qrc:/foo/bar/').href")), QVariant(QSL("qrc:/baz")));
+ QCOMPARE(eval(QSL("new URL('./baz', 'qrc:/foo/bar/').href")), QVariant(QSL("qrc:/foo/bar/baz")));
+ QCOMPARE(eval(QSL("new URL('../baz', 'qrc:/foo/bar/').href")), QVariant(QSL("qrc:/foo/baz")));
+ QCOMPARE(eval(QSL("new URL('../../baz', 'qrc:/foo/bar/').href")), QVariant(QSL("qrc:/baz")));
+ QCOMPARE(eval(QSL("new URL('../../../baz', 'qrc:/foo/bar/').href")), QVariant(QSL("qrc:/baz")));
+
+ // If the relative URL begins with >= 2 slashes, then the scheme is treated
+ // not as a Syntax::Path scheme but as a Syntax::HostPortAndUserInformation
+ // scheme.
+ QCOMPARE(eval(QSL("new URL('//baz', 'qrc:/foo/bar/').href")), QVariant(QSL("qrc://baz/")));
+ QCOMPARE(eval(QSL("new URL('///baz', 'qrc:/foo/bar/').href")), QVariant(QSL("qrc://baz/")));
+}
+
+// Test origin serialization in Blink, implemented by blink::KURL and
+// blink::SecurityOrigin as opposed to GURL and url::Origin.
+void tst_Origins::jsUrlOrigin()
+{
+ QVERIFY(verifyLoad(QSL("about:blank")));
+
+ // For network protocols the origin string must include the domain and port.
+ QCOMPARE(eval(QSL("new URL(\"http://foo.com/page.html\").origin")), QVariant(QSL("http://foo.com")));
+ QCOMPARE(eval(QSL("new URL(\"https://foo.com/page.html\").origin")), QVariant(QSL("https://foo.com")));
+
+ // Even though file URL can also have domains, these are not included in the
+ // origin string by Chromium. The standard does not specify a value here,
+ // but suggests 'null' (https://url.spec.whatwg.org/#origin).
+ QCOMPARE(eval(QSL("new URL(\"file:/etc/passwd\").origin")), QVariant(QSL("file://")));
+ QCOMPARE(eval(QSL("new URL(\"file://foo.com/etc/passwd\").origin")), QVariant(QSL("file://")));
+
+ // Unregistered schemes behave like file.
+ QCOMPARE(eval(QSL("new URL(\"tst:/banana\").origin")), QVariant(QSL("tst://")));
+ QCOMPARE(eval(QSL("new URL(\"tst://foo.com/banana\").origin")), QVariant(QSL("tst://")));
+
+ // The non-PathSyntax schemes should have hosts and potentially ports.
+ QCOMPARE(eval(QSL("new URL(\"HostSyntax:foo:41/bar\").origin")),
+ QVariant(QSL("hostsyntax://foo")));
+ QCOMPARE(eval(QSL("new URL(\"HostAndPortSyntax:foo:41/bar\").origin")),
+ QVariant(QSL("hostandportsyntax://foo:41")));
+ QCOMPARE(eval(QSL("new URL(\"HostAndPortSyntax:foo:42/bar\").origin")),
+ QVariant(QSL("hostandportsyntax://foo")));
+ QCOMPARE(eval(QSL("new URL(\"HostPortAndUserInformationSyntax:foo:41/bar\").origin")),
+ QVariant(QSL("hostportanduserinformationsyntax://foo:41")));
+ QCOMPARE(eval(QSL("new URL(\"HostPortAndUserInformationSyntax:foo:42/bar\").origin")),
+ QVariant(QSL("hostportanduserinformationsyntax://foo")));
+
+ // A PathSyntax scheme should have a 'universal' origin.
+ QCOMPARE(eval(QSL("new URL(\"PathSyntax:foo\").origin")), QVariant(QSL("pathsyntax:")));
+ QCOMPARE(eval(QSL("new URL(\"qrc:/crysis.css\").origin")), QVariant(QSL("qrc:")));
+ QCOMPARE(eval(QSL("new URL(\"qrc://foo.com/crysis.css\").origin")), QVariant(QSL("qrc:")));
+
+ // The NoAccessAllowed flag forces opaque origins.
+ QCOMPARE(eval(QSL("new URL(\"PathSyntax-NoAccessAllowed:foo\").origin")),
+ QVariant(QSL("null")));
+}
+
+class ScopedAttribute {
+public:
+ ScopedAttribute(QWebEngineSettings *settings, QWebEngineSettings::WebAttribute attribute, bool newValue)
+ : m_settings(settings)
+ , m_attribute(attribute)
+ , m_oldValue(m_settings->testAttribute(m_attribute))
+ {
+ m_settings->setAttribute(m_attribute, newValue);
+ }
+ ~ScopedAttribute()
+ {
+ m_settings->setAttribute(m_attribute, m_oldValue);
+ }
+private:
+ QWebEngineSettings *m_settings;
+ QWebEngineSettings::WebAttribute m_attribute;
+ bool m_oldValue;
+};
+
+// Test same-origin policy of file, qrc and custom schemes.
+//
+// Note the test case involves the main page trying to load an iframe from a
+// file that resides in a parent directory. This is just a small detail to
+// demonstrate the difference with Firefox where such access is not allowed.
+void tst_Origins::subdirWithAccess()
+{
+ ScopedAttribute sa(m_page->settings(), QWebEngineSettings::LocalContentCanAccessFileUrls, true);
+
+ QVERIFY(verifyLoad("file:" + QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + "/resources/subdir/index.html"));
+ QCOMPARE(eval(QSL("msg[0]")), QVariant(QSL("hello")));
+ QCOMPARE(eval(QSL("msg[1]")), QVariant(QSL("world")));
+
+ QVERIFY(verifyLoad(QSL("qrc:/resources/subdir/index.html")));
+ QCOMPARE(eval(QSL("msg[0]")), QVariant(QSL("hello")));
+ QCOMPARE(eval(QSL("msg[1]")), QVariant(QSL("world")));
+
+ QVERIFY(verifyLoad(QSL("tst:/resources/subdir/index.html")));
+ QCOMPARE(eval(QSL("msg[0]")), QVariant(QSL("hello")));
+ QCOMPARE(eval(QSL("msg[1]")), QVariant(QSL("world")));
+}
+
+// In this variation the LocalContentCanAccessFileUrls attribute is disabled. As
+// a result all file URLs will be considered to have unique/opaque origins, that
+// is, they are not the 'same origin as' any other origin.
+//
+// Note that this applies only to file URLs and not qrc or custom schemes.
+//
+// See also (in Blink):
+// - the allow_file_access_from_file_urls option and
+// - the blink::SecurityOrigin::BlockLocalAccessFromLocalOrigin() method.
+void tst_Origins::subdirWithoutAccess()
+{
+ ScopedAttribute sa(m_page->settings(), QWebEngineSettings::LocalContentCanAccessFileUrls, false);
+
+ QVERIFY(verifyLoad("file:" + QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + "/resources/subdir/index.html"));
+ QCOMPARE(eval(QSL("msg[0]")), QVariant());
+ QCOMPARE(eval(QSL("msg[1]")), QVariant());
+
+ QVERIFY(verifyLoad(QSL("qrc:/resources/subdir/index.html")));
+ QCOMPARE(eval(QSL("msg[0]")), QVariant(QSL("hello")));
+ QCOMPARE(eval(QSL("msg[1]")), QVariant(QSL("world")));
+
+ QVERIFY(verifyLoad(QSL("tst:/resources/subdir/index.html")));
+ QCOMPARE(eval(QSL("msg[0]")), QVariant(QSL("hello")));
+ QCOMPARE(eval(QSL("msg[1]")), QVariant(QSL("world")));
+}
+
+void tst_Origins::fileAccessRemoteUrl_data()
+{
+ QTest::addColumn<bool>("EnableAccess");
+ QTest::addColumn<bool>("UserGesture");
+ QTest::addRow("enabled, XHR") << true << false;
+ QTest::addRow("enabled, link click") << true << true;
+ QTest::addRow("disabled, XHR") << false << false;
+ QTest::addRow("disabled, link click") << false << true;
+}
+
+void tst_Origins::fileAccessRemoteUrl()
+{
+ QFETCH(bool, EnableAccess);
+ QFETCH(bool, UserGesture);
+
+ QWebEngineView view;
+ view.setPage(m_page);
+ view.resize(800, 600);
+ view.show();
+
+ HttpServer server;
+ server.setResourceDirs({ QDir(QT_TESTCASE_SOURCEDIR).canonicalPath() + "/resources" });
+ QVERIFY(server.start());
+
+ ScopedAttribute sa1(m_page->settings(), QWebEngineSettings::LocalContentCanAccessRemoteUrls, EnableAccess);
+ ScopedAttribute sa2(m_page->settings(), QWebEngineSettings::ErrorPageEnabled, false);
+
+ if (UserGesture) {
+ QString remoteUrl(server.url("/link.html").toString());
+#ifdef Q_OS_WIN
+ QString localUrl("file:///" + QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + "/resources/link.html?linkLocation=" + remoteUrl);
+#else
+ QString localUrl("file:" + QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + "/resources/link.html?linkLocation=" + remoteUrl);
+#endif
+
+ QVERIFY(verifyLoad(localUrl));
+
+ QTest::mouseClick(view.focusProxy(), Qt::LeftButton, {}, elementCenter(m_page, "link"));
+ // Succeed independently of EnableAccess == false
+ QTRY_COMPARE(m_page->url(), remoteUrl);
+
+ // Back/forward navigation is also allowed, however they are not user gesture
+ m_page->triggerAction(QWebEnginePage::Back);
+ QTRY_COMPARE(m_page->url(), localUrl);
+ m_page->triggerAction(QWebEnginePage::Forward);
+ QTRY_COMPARE(m_page->url(), remoteUrl);
+ } else {
+ QVERIFY(verifyLoad("file:" + QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + "/resources/mixedXHR.html"));
+ eval("sendXHR('" + server.url("/mixedXHR.txt").toString() + "')");
+ QTRY_COMPARE(eval("result"), (EnableAccess ? QString("ok") : QString("error")));
+ }
+}
+
+void tst_Origins::fileAccessLocalUrl_data()
+{
+ QTest::addColumn<bool>("EnableAccess");
+ QTest::addColumn<bool>("UserGesture");
+ QTest::addRow("enabled, XHR") << true << false;
+ QTest::addRow("enabled, link click") << true << true;
+ QTest::addRow("disabled, XHR") << false << false;
+ QTest::addRow("disabled, link click") << false << true;
+}
+
+void tst_Origins::fileAccessLocalUrl()
+{
+ QFETCH(bool, EnableAccess);
+ QFETCH(bool, UserGesture);
+
+ QWebEngineView view;
+ view.setPage(m_page);
+ view.resize(800, 600);
+ view.show();
+
+ ScopedAttribute sa1(m_page->settings(), QWebEngineSettings::LocalContentCanAccessFileUrls, EnableAccess);
+ ScopedAttribute sa2(m_page->settings(), QWebEngineSettings::ErrorPageEnabled, false);
+
+ if (UserGesture) {
+#ifdef Q_OS_WIN
+ QString localUrl1("file:///" + QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + "/resources/link.html?linkLocation=link.html");
+ QString localUrl2("file:///" + QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + "/resources/link.html");
+#else
+ QString localUrl1("file:" + QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + "/resources/link.html?linkLocation=link.html");
+ QString localUrl2("file:" + QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + "/resources/link.html");
+#endif
+
+ QVERIFY(verifyLoad(localUrl1));
+ QTest::mouseClick(view.focusProxy(), Qt::LeftButton, {}, elementCenter(m_page, "link"));
+ // Succeed independently of EnableAccess == false
+ QTRY_COMPARE(m_page->url(), localUrl2);
+
+ // Back/forward navigation is also allowed, however they are not user gesture
+ m_page->triggerAction(QWebEnginePage::Back);
+ QTRY_COMPARE(m_page->url(), localUrl1);
+ m_page->triggerAction(QWebEnginePage::Forward);
+ QTRY_COMPARE(m_page->url(), localUrl2);
+ } else {
+ QVERIFY(verifyLoad("file:" + QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + "/resources/mixedXHR.html"));
+ eval("sendXHR('file:" + QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + "/resources/mixedXHR.txt" + "')");
+ QTRY_COMPARE(eval("result"), (EnableAccess ? QString("ok") : QString("error")));
+ }
+}
+
+// Load the main page over one scheme with an iframe over another scheme.
+//
+// For file and qrc schemes, the iframe should load but it should not be
+// possible for scripts in different frames to interact.
+//
+// Additionally for unregistered custom schemes and custom schemes without
+// LocalAccessAllowed it should not be possible to load an iframe over the
+// file: scheme.
+void tst_Origins::mixedSchemes_data()
+{
+ QTest::addColumn<QString>("schemeFrom");
+ QTest::addColumn<QVariantMap>("testPairs");
+
+ QVariant SLF = QVariant(QSL("canLoadAndAccess")), OK = QVariant(QSL("canLoadButNotAccess")),
+ ERR = QVariant(QSL("cannotLoad"));
+ std::vector<std::pair<const char *, std::vector<std::pair<const char *, QVariant>>>> data = {
+ { "file",
+ {
+ { "file", SLF },
+ { "qrc", OK },
+ { "tst", ERR },
+ } },
+ { "qrc",
+ {
+ { "file", ERR },
+ { "qrc", SLF },
+ { "tst", OK },
+ } },
+ { "tst",
+ {
+ { "file", ERR },
+ { "qrc", OK },
+ { "tst", SLF },
+ } },
+ { "PathSyntax",
+ {
+ { "PathSyntax", SLF },
+ { "PathSyntax-Local", ERR },
+ { "PathSyntax-LocalAccessAllowed", OK },
+ { "PathSyntax-NoAccessAllowed", OK },
+ } },
+ { "PathSyntax-LocalAccessAllowed",
+ {
+ { "PathSyntax", OK },
+ { "PathSyntax-Local", OK },
+ { "PathSyntax-LocalAccessAllowed", SLF },
+ { "PathSyntax-NoAccessAllowed", OK },
+ } },
+ { "PathSyntax-NoAccessAllowed",
+ {
+ { "PathSyntax", OK },
+ { "PathSyntax-Local", ERR },
+ { "PathSyntax-LocalAccessAllowed", OK },
+ { "PathSyntax-NoAccessAllowed", OK },
+ } },
+ { "HostSyntax://a",
+ {
+ { "HostSyntax://a", SLF },
+ { "HostSyntax://b", OK },
+ } },
+ { "local-localaccess",
+ {
+ { "local-cors", OK },
+ { "local-localaccess", SLF },
+ { "local", OK },
+ } },
+ { "local-cors",
+ {
+ { "local", OK },
+ { "local-cors", SLF },
+ } },
+ };
+
+ for (auto &&d : data) {
+ auto schemeFrom = d.first;
+ QVariantMap testPairs;
+ for (auto &&destSchemes : d.second) {
+ auto &&destScheme = destSchemes.first;
+ testPairs[destScheme] = destSchemes.second;
+ }
+ QTest::addRow("%s", schemeFrom) << schemeFrom << testPairs;
+ }
+}
+
+static QStringList protocolAndHost(const QString scheme)
+{
+ static QString srcDir(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath());
+ QStringList result;
+ if (scheme == QSL("file")) {
+ return QStringList{ scheme, srcDir };
+ }
+ if (scheme.contains(QSL("HostSyntax:"))) {
+ const QStringList &res = scheme.split(':');
+ Q_ASSERT(res.size() == 2);
+ return res;
+ }
+ return QStringList{ scheme, "" };
+}
+
+void tst_Origins::mixedSchemes()
+{
+ QFETCH(QString, schemeFrom);
+ QFETCH(QVariantMap, testPairs);
+
+ ScopedAttribute sa(m_page->settings(), QWebEngineSettings::ErrorPageEnabled, false);
+ QString srcDir(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath());
+ QString host;
+ auto pah = protocolAndHost(schemeFrom);
+ auto loadUrl = QString("%1:%2/resources/mixedSchemes.html").arg(pah[0]).arg(pah[1]);
+ QVERIFY(verifyLoad(loadUrl));
+
+ QStringList schemesTo, expected, results;
+ for (auto it = testPairs.begin(), end = testPairs.end(); it != end; ++it) {
+
+ auto schemeTo = it.key();
+ auto pah = protocolAndHost(schemeTo);
+ auto expectedResult = it.value().toString();
+ auto frameUrl = QString("%1:%2/resources/mixedSchemes_frame.html").arg(pah[0]).arg(pah[1]);
+ auto imgUrl = QString("%1:%2/resources/red.png").arg(pah[0]).arg(pah[1]);
+
+ eval(QString("setIFrameUrl('%1','%2')").arg(frameUrl).arg(imgUrl));
+
+ // wait for token in the log
+ QTRY_VERIFY(m_page->logContainsDoneMarker());
+ const QString result = m_page->findResultInLog();
+ m_page->clearLog();
+ schemesTo.append(schemeTo.rightJustified(20));
+ results.append(result.rightJustified(20));
+ expected.append(expectedResult.rightJustified(20));
+ }
+
+ QVERIFY2(results == expected,
+ qPrintable(QString("\nFrom '%1' to:\n\tScheme: %2\n\tActual: %3\n\tExpect: %4")
+ .arg(schemeFrom)
+ .arg(schemesTo.join(' '))
+ .arg(results.join(' '))
+ .arg(expected.join(' '))));
+}
+
+// Like mixedSchemes but adds a Content-Security-Policy: frame-src 'none' header.
+void tst_Origins::mixedSchemesWithCsp()
+{
+ QVERIFY(verifyLoad(QSL("HostSyntax://a/resources/mixedSchemesWithCsp.html")));
+ eval(QSL("setIFrameUrl('HostSyntax://a/resources/mixedSchemes_frame.html')"));
+ QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("canLoadButNotAccess")));
+ eval(QSL("setIFrameUrl('HostSyntax://b/resources/mixedSchemes_frame.html')"));
+ QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("canLoadButNotAccess")));
+
+ QVERIFY(verifyLoad(QSL("HostSyntax-ContentSecurityPolicyIgnored://a/resources/mixedSchemesWithCsp.html")));
+ eval(QSL("setIFrameUrl('HostSyntax-ContentSecurityPolicyIgnored://a/resources/mixedSchemes_frame.html')"));
+ QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("canLoadAndAccess")));
+ eval(QSL("setIFrameUrl('HostSyntax-ContentSecurityPolicyIgnored://b/resources/mixedSchemes_frame.html')"));
+ QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("canLoadButNotAccess")));
+}
+
+// Load the main page over one scheme, then make an XMLHttpRequest to a
+// different scheme.
+//
+// Cross-origin XMLHttpRequests can only be made to CORS-enabled schemes. These
+// include the builtin schemes http, https, data, and chrome, as well as custom
+// schemes with the CorsEnabled flag.
+void tst_Origins::mixedXHR_data()
+{
+ QTest::addColumn<QString>("schemeFrom");
+ QTest::addColumn<bool>("canAccessFileUrls");
+ QTest::addColumn<bool>("canAccessRemoteUrl");
+ QTest::addColumn<QVariantMap>("testPairs");
+
+ bool defaultFileAccess = QWebEnginePage().settings()->testAttribute(QWebEngineSettings::LocalContentCanAccessFileUrls);
+ bool defaultRemoteAccess = QWebEnginePage().settings()->testAttribute(QWebEngineSettings::LocalContentCanAccessRemoteUrls);
+ Q_ASSERT(defaultFileAccess);
+ Q_ASSERT(!defaultRemoteAccess);
+ std::vector<std::pair<bool, bool>> settingCombinations = {
+ { defaultFileAccess, defaultRemoteAccess }, // tag: *schemeFrom*_local_noremote
+ { defaultFileAccess, !defaultRemoteAccess }, // tag: *schemeFrom*_local_remote
+ { !defaultFileAccess, defaultRemoteAccess }, // tag: *schemeFrom*_nolocal_noremote
+ { !defaultFileAccess, !defaultRemoteAccess } // tag: *schemeFrom*_nolocal_remote
+ };
+
+ QVariant OK = QString("ok"), ERR = QString("error");
+ std::vector<
+ std::pair<const char *, std::vector<
+ std::pair<const char *, std::vector<QVariant>>>>> data = {
+ { "file", {
+ { "file", { OK, OK, ERR, ERR } },
+ { "qrc", { ERR, ERR, ERR, ERR } },
+ { "tst", { ERR, ERR, ERR, ERR } },
+ { "data", { OK, OK, OK, OK } },
+ { "cors", { ERR, OK, ERR, OK } },
+ { "local-localaccess", { OK, OK, ERR, ERR } },
+ { "local-cors", { OK, OK, ERR, ERR } }, } },
+
+ { "qrc", {
+ { "file", { ERR, ERR, ERR, ERR } },
+ { "qrc", { OK, OK, OK, OK } },
+ { "tst", { ERR, ERR, ERR, ERR } },
+ { "data", { OK, OK, OK, OK } },
+ { "cors", { OK, OK, OK, OK } },
+ { "local-localaccess", { ERR, ERR, ERR, ERR } },
+ { "local-cors", { ERR, ERR, ERR, ERR } }, } },
+
+ { "tst", {
+ { "file", { ERR, ERR, ERR, ERR } },
+ { "qrc", { ERR, ERR, ERR, ERR } },
+ { "tst", { OK, OK, OK, OK } },
+ { "data", { OK, OK, OK, OK } },
+ { "cors", { OK, OK, OK, OK } },
+ { "local-localaccess", { ERR, ERR, ERR, ERR } },
+ { "local-cors", { ERR, ERR, ERR, ERR } }, } },
+
+ { "cors", { // -local +cors -local-access
+ { "file", { ERR, ERR, ERR, ERR } },
+ { "qrc", { ERR, ERR, ERR, ERR } },
+ { "tst", { ERR, ERR, ERR, ERR } },
+ { "data", { OK, OK, OK, OK } },
+ { "cors", { OK, OK, OK, OK } },
+ { "local-localaccess", { ERR, ERR, ERR, ERR } },
+ { "local-cors", { ERR, ERR, ERR, ERR } }, } },
+
+ { "local", { // +local -cors -local-access
+ { "file", { OK, OK, ERR, ERR } },
+ { "qrc", { ERR, ERR, ERR, ERR } },
+ { "tst", { ERR, ERR, ERR, ERR } },
+ { "data", { OK, OK, OK, OK } },
+ { "cors", { ERR, OK, ERR, OK } },
+ { "local-localaccess", { OK, OK, ERR, ERR } },
+ { "local-cors", { OK, OK, ERR, ERR } }, } },
+
+ { "local-cors", { // +local +cors -local-access
+ { "file", { OK, OK, ERR, ERR } },
+ { "qrc", { ERR, ERR, ERR, ERR } },
+ { "tst", { ERR, ERR, ERR, ERR } },
+ { "data", { OK, OK, OK, OK } },
+ { "cors", { ERR, OK, ERR, OK } },
+ { "local-localaccess", { OK, OK, ERR, ERR } },
+ { "local-cors", { OK, OK, ERR, ERR } }, } },
+
+ { "local-localaccess", { // +local -cors +local-access
+ { "file", { OK, OK, OK, OK } },
+ { "qrc", { ERR, ERR, ERR, ERR } },
+ { "tst", { ERR, ERR, ERR, ERR } },
+ { "data", { OK, OK, OK, OK } },
+ { "cors", { ERR, OK, ERR, OK } },
+ { "local-localaccess", { OK, OK, OK, OK } },
+ { "local-cors", { OK, OK, OK, OK } }, } },
+
+ { "localaccess", { // -local -cors +local-access
+ { "file", { OK, OK, OK, OK } },
+ { "qrc", { ERR, ERR, ERR, ERR } },
+ { "tst", { ERR, ERR, ERR, ERR } },
+ { "data", { OK, OK, OK, OK } },
+ { "cors", { OK, OK, OK, OK } },
+ { "local-localaccess", { OK, OK, OK, OK } },
+ { "local-cors", { OK, OK, OK, OK } }, } },
+ };
+
+ for (auto &&d : data) {
+ auto schemeFrom = d.first;
+
+ for (int i = 0; i < 4; ++i) {
+ const auto &it = settingCombinations[i];
+ bool canAccessFileUrls = it.first, canAccessRemoteUrl = it.second;
+
+ QVariantMap testPairs;
+ for (auto &&destSchemes : d.second) {
+ auto &&destScheme = destSchemes.first;
+ auto &&expectedResults = destSchemes.second;
+ testPairs[destScheme] = expectedResults[i];
+ }
+
+ QTest::addRow("%s_%s_%s", schemeFrom, (canAccessFileUrls ? "local" : "nolocal"), (canAccessRemoteUrl ? "remote" : "noremote"))
+ << schemeFrom << canAccessFileUrls << canAccessRemoteUrl << testPairs;
+ }
+ }
+}
+
+void tst_Origins::mixedXHR()
+{
+ QFETCH(QString, schemeFrom);
+ QFETCH(bool, canAccessFileUrls);
+ QFETCH(bool, canAccessRemoteUrl);
+ QFETCH(QVariantMap, testPairs);
+
+ QString srcDir(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath());
+ auto loadUrl = QString("%1:%2/resources/mixedXHR.html").arg(schemeFrom).arg(schemeFrom == "file" ? srcDir : "");
+ auto sendXHR = [&] (const QString &scheme) {
+ if (scheme == "data")
+ return QString("sendXHR('data:,ok')");
+ return QString("sendXHR('%1:%2/resources/mixedXHR.txt')").arg(scheme).arg(scheme == "file" ? srcDir : "");
+ };
+
+ QCOMPARE(testPairs.size(), 7);
+ ScopedAttribute sa0(m_page->settings(), QWebEngineSettings::LocalContentCanAccessFileUrls, canAccessFileUrls);
+ ScopedAttribute sa1(m_page->settings(), QWebEngineSettings::LocalContentCanAccessRemoteUrls, canAccessRemoteUrl);
+ QVERIFY(verifyLoad(loadUrl));
+
+ QStringList schemesTo, expected, results;
+ for (auto it = testPairs.begin(), end = testPairs.end(); it != end; ++it) {
+ auto schemeTo = it.key();
+ auto expectedResult = it.value().toString();
+ auto command = sendXHR(schemeTo);
+
+ eval(command);
+
+ QTRY_COMPARE(eval(QSL("result !== undefined")), QVariant(true));
+ auto result = eval(QSL("result")).toString();
+
+ schemesTo.append(schemeTo.rightJustified(10));
+ results.append(result.rightJustified(10));
+ expected.append(expectedResult.rightJustified(10));
+ }
+ QVERIFY2(results == expected,
+ qPrintable(QString("From '%1' to:\n\tScheme: %2\n\tActual: %3\n\tExpect: %4")
+ .arg(schemeFrom).arg(schemesTo.join(' ')).arg(results.join(' ')).arg(expected.join(' '))));
+}
+
+// Load the main page over one scheme, then load an iframe over a different scheme. This load is not considered CORS.
+void tst_Origins::mixedContent_data()
+{
+ QTest::addColumn<QString>("schemeFrom");
+ QTest::addColumn<bool>("canAccessFileUrls");
+ QTest::addColumn<bool>("canAccessRemoteUrl");
+ QTest::addColumn<QVariantMap>("testPairs");
+
+ bool defaultFileAccess = true;
+ bool defaultRemoteAccess = false;
+ std::vector<std::pair<bool, bool>> settingCombinations = {
+ { defaultFileAccess, defaultRemoteAccess }, // tag: *schemeFrom*_local_noremote
+ { defaultFileAccess, !defaultRemoteAccess }, // tag: *schemeFrom*_local_remote
+ { !defaultFileAccess, defaultRemoteAccess }, // tag: *schemeFrom*_nolocal_noremote
+ { !defaultFileAccess, !defaultRemoteAccess } // tag: *schemeFrom*_nolocal_remote
+ };
+
+ QVariant SLF = QVariant(QSL("canLoadAndAccess")), OK = QVariant(QSL("canLoadButNotAccess")), ERR = QVariant(QSL("cannotLoad"));
+ std::vector<
+ std::pair<const char *, std::vector<
+ std::pair<const char *, std::vector<QVariant>>>>> data = {
+ { "file", {
+ { "file", { SLF, SLF, ERR, ERR } },
+ { "qrc", { OK, OK, OK, OK } },
+ { "tst", { ERR, OK, ERR, OK } },
+ { "data", { OK, OK, OK, OK } },
+ { "cors", { ERR, OK, ERR, OK } },
+ { "local-localaccess", { OK, OK, ERR, ERR } },
+ { "local-cors", { OK, OK, ERR, ERR } },
+ } },
+
+ { "qrc", {
+ { "file", { ERR, ERR, ERR, ERR } },
+ { "qrc", { SLF, SLF, SLF, SLF } },
+ { "tst", { OK, OK, OK, OK } },
+ { "data", { OK, OK, OK, OK } },
+ { "cors", { OK, OK, OK, OK } },
+ { "local-localaccess", { ERR, ERR, ERR, ERR } },
+ { "local-cors", { ERR, ERR, ERR, ERR } }, } },
+
+ { "tst", {
+ { "file", { ERR, ERR, ERR, ERR } },
+ { "qrc", { OK, OK, OK, OK } },
+ { "tst", { SLF, SLF, SLF, SLF } },
+ { "data", { OK, OK, OK, OK } },
+ { "cors", { OK, OK, OK, OK } },
+ { "local-localaccess", { ERR, ERR, ERR, ERR } },
+ { "local-cors", { ERR, ERR, ERR, ERR } }, } },
+
+ { "cors", { // -local +cors -local-access
+ { "file", { ERR, ERR, ERR, ERR } },
+ { "qrc", { OK, OK, OK, OK } },
+ { "tst", { OK, OK, OK, OK } },
+ { "data", { OK, OK, OK, OK } },
+ { "cors", { SLF, SLF, SLF, SLF } },
+ { "local-localaccess", { ERR, ERR, ERR, ERR } },
+ { "local-cors", { ERR, ERR, ERR, ERR } }, } },
+
+ { "local", { // +local -cors -local-access
+ { "file", { OK, OK, ERR, ERR } },
+ { "qrc", { OK, OK, OK, OK } },
+ { "tst", { ERR, OK, ERR, OK } },
+ { "data", { OK, OK, OK, OK } },
+ { "cors", { ERR, OK, ERR, OK } },
+ { "local-localaccess", { OK, OK, ERR, ERR } },
+ { "local-cors", { OK, OK, ERR, ERR } },
+ } },
+
+ { "local-cors", { // +local +cors -local-access
+ { "file", { OK, OK, ERR, ERR } },
+ { "qrc", { OK, OK, OK, OK } },
+ { "tst", { ERR, OK, ERR, OK } },
+ { "data", { OK, OK, OK, OK } },
+ { "cors", { ERR, OK, ERR, OK } },
+ { "local-localaccess", { OK, OK, ERR, ERR } },
+ { "local-cors", { SLF, SLF, ERR, ERR } },
+ } },
+
+ { "local-localaccess", { // +local -cors + OK-access
+ { "file", { OK, OK, OK, OK } },
+ { "qrc", { OK, OK, OK, OK } },
+ { "tst", { ERR, OK, ERR, OK } },
+ { "data", { OK, OK, OK, OK } },
+ { "cors", { ERR, OK, ERR, OK } },
+ { "local-localaccess", { SLF, SLF, OK, OK } }, // ### should probably be: SLF, SLF, SLF, SLF
+ { "local-cors", { OK, OK, OK, OK } },
+ } },
+
+ { "localaccess", { // -local -cors +local-access
+ { "file", { OK, OK, OK, OK } },
+ { "qrc", { OK, OK, OK, OK } },
+ { "tst", { OK, OK, OK, OK } },
+ { "data", { OK, OK, OK, OK } },
+ { "cors", { OK, OK, OK, OK } },
+ { "local-localaccess", { OK, OK, OK, OK } },
+ { "local-cors", { OK, OK, OK, OK } }, } },
+ };
+
+ for (auto &&d : data) {
+ auto schemeFrom = d.first;
+
+ for (int i = 0; i < 4; ++i) {
+ const auto &it = settingCombinations[i];
+ bool canAccessFileUrls = it.first, canAccessRemoteUrl = it.second;
+
+ QVariantMap testPairs;
+ for (auto &&destSchemes : d.second) {
+ auto &&destScheme = destSchemes.first;
+ auto &&expectedResults = destSchemes.second;
+ testPairs[destScheme] = expectedResults[i];
+ }
+
+ QTest::addRow("%s_%s_%s", schemeFrom, (canAccessFileUrls ? "local" : "nolocal"), (canAccessRemoteUrl ? "remote" : "noremote"))
+ << schemeFrom << canAccessFileUrls << canAccessRemoteUrl << testPairs;
+ }
+ }
+}
+
+void tst_Origins::mixedContent()
+{
+ QFETCH(QString, schemeFrom);
+ QFETCH(bool, canAccessFileUrls);
+ QFETCH(bool, canAccessRemoteUrl);
+ QFETCH(QVariantMap, testPairs);
+
+ QString srcDir(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath());
+ auto loadUrl = QString("%1:%2/resources/mixedSchemes.html").arg(schemeFrom).arg(schemeFrom == "file" ? srcDir : "");
+
+ QCOMPARE(testPairs.size(), 7);
+ ScopedAttribute sa2(m_page->settings(), QWebEngineSettings::ErrorPageEnabled, false);
+ ScopedAttribute sa0(m_page->settings(), QWebEngineSettings::LocalContentCanAccessFileUrls, canAccessFileUrls);
+ ScopedAttribute sa1(m_page->settings(), QWebEngineSettings::LocalContentCanAccessRemoteUrls, canAccessRemoteUrl);
+ QVERIFY(verifyLoad(loadUrl));
+
+ auto setIFrameUrl = [&] (const QString &scheme) {
+ if (scheme == "data")
+ return QString("setIFrameUrl('data:,<script>var canary = true; parent.canary = "
+ "true</script>','data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAUA"
+ "AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/"
+ "w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==')");
+ auto frameUrl = QString("%1:%2/resources/mixedSchemes_frame.html").arg(scheme).arg(scheme == "file" ? srcDir : "");
+ auto imgUrl =
+ QString("%1:%2/resources/red.png").arg(scheme).arg(scheme == "file" ? srcDir : "");
+ return QString("setIFrameUrl('%1','%2')").arg(frameUrl).arg(imgUrl);
+ };
+
+ m_page->clearLog();
+ QStringList schemesTo, expected, results;
+ for (auto it = testPairs.begin(), end = testPairs.end(); it != end; ++it) {
+
+ auto schemeTo = it.key();
+ auto expectedResult = it.value().toString();
+
+ eval(setIFrameUrl(schemeTo));
+
+ // wait for token in the log
+ QTRY_VERIFY(m_page->logContainsDoneMarker());
+ const QString result = m_page->findResultInLog();
+ m_page->clearLog();
+ schemesTo.append(schemeTo.rightJustified(20));
+ results.append(result.rightJustified(20));
+ expected.append(expectedResult.rightJustified(20));
+ }
+ QVERIFY2(results == expected,
+ qPrintable(QString("\nFrom '%1' to:\n\tScheme: %2\n\tActual: %3\n\tExpect: %4")
+ .arg(schemeFrom).arg(schemesTo.join(' ')).arg(results.join(' ')).arg(expected.join(' '))));
+}
+
+#if defined(WEBSOCKETS)
+class EchoServer : public QObject {
+ Q_OBJECT
+ Q_PROPERTY(QUrl url READ url NOTIFY urlChanged)
+public:
+ EchoServer() : webSocketServer(QSL("EchoServer"), QWebSocketServer::NonSecureMode)
+ {
+ connect(&webSocketServer, &QWebSocketServer::newConnection, this, &EchoServer::onNewConnection);
+ }
+
+ bool listen()
+ {
+ if (webSocketServer.listen(QHostAddress::Any)) {
+ Q_EMIT urlChanged();
+ return true;
+ }
+ return false;
+ }
+
+ QUrl url() const
+ {
+ return webSocketServer.serverUrl();
+ }
+
+Q_SIGNALS:
+ void urlChanged();
+
+private:
+ void onNewConnection()
+ {
+ QWebSocket *socket = webSocketServer.nextPendingConnection();
+ connect(socket, &QWebSocket::textMessageReceived, this, &EchoServer::onTextMessageReceived);
+ connect(socket, &QWebSocket::disconnected, socket, &QObject::deleteLater);
+ }
+
+ void onTextMessageReceived(const QString &message)
+ {
+ QWebSocket *socket = qobject_cast<QWebSocket *>(sender());
+ socket->sendTextMessage(message);
+ }
+
+ QWebSocketServer webSocketServer;
+};
+
+// Try opening a WebSocket from pages loaded over various URL schemes.
+void tst_Origins::webSocket()
+{
+ EchoServer echoServer;
+ QWebChannel channel;
+ channel.registerObject(QSL("echoServer"), &echoServer);
+ m_page->setWebChannel(&channel);
+ QVERIFY(echoServer.listen());
+
+ QVERIFY(verifyLoad("file:" + QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + "/resources/websocket.html"));
+ QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("ok")));
+
+ QVERIFY(verifyLoad(QSL("qrc:/resources/websocket.html")));
+ QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("ok")));
+
+ // Unregistered schemes can also open WebSockets (since Chromium 71)
+ QVERIFY(verifyLoad(QSL("tst:/resources/websocket2.html")));
+ QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("ok")));
+
+ // Even an insecure registered scheme can open WebSockets.
+ QVERIFY(verifyLoad(QSL("PathSyntax:/resources/websocket2.html")));
+ QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("ok")));
+}
+#endif
+// Create a (Dedicated)Worker. Since dedicated workers can only be accessed from
+// one page, there is not much need for security restrictions.
+void tst_Origins::dedicatedWorker()
+{
+ QVERIFY(verifyLoad("file:" + QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + "/resources/dedicatedWorker.html"));
+ QTRY_VERIFY(eval(QSL("done")).toBool());
+ QCOMPARE(eval(QSL("result")), QVariant(42));
+
+ QVERIFY(verifyLoad(QSL("qrc:/resources/dedicatedWorker.html")));
+ QTRY_VERIFY(eval(QSL("done")).toBool());
+ QCOMPARE(eval(QSL("result")), QVariant(42));
+
+ // Unregistered schemes can also create Workers (since Chromium 71)
+ QVERIFY(verifyLoad(QSL("tst:/resources/dedicatedWorker.html")));
+ QTRY_VERIFY(eval(QSL("done")).toBool());
+ QCOMPARE(eval(QSL("result")), QVariant(42));
+
+ // Even an insecure registered scheme can create Workers.
+ QVERIFY(verifyLoad(QSL("PathSyntax:/resources/dedicatedWorker.html")));
+ QTRY_VERIFY(eval(QSL("done")).toBool());
+ QCOMPARE(eval(QSL("result")), QVariant(42));
+
+ // But not if the NoAccessAllowed flag is set.
+ QVERIFY(verifyLoad(QSL("PathSyntax-NoAccessAllowed:/resources/dedicatedWorker.html")));
+ QTRY_VERIFY(eval(QSL("done")).toBool());
+ QVERIFY(eval(QSL("error")).toString()
+ .contains(QSL("cannot be accessed from origin 'null'")));
+}
+
+// Create a SharedWorker. Shared workers can be accessed from multiple pages,
+// and therefore the same-origin policy applies.
+void tst_Origins::sharedWorker()
+{
+ {
+ ScopedAttribute sa(m_page->settings(), QWebEngineSettings::LocalContentCanAccessFileUrls, false);
+ QVERIFY(verifyLoad("file:" + QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + "/resources/sharedWorker.html"));
+ QTRY_VERIFY_WITH_TIMEOUT(eval(QSL("done")).toBool(), 10000);
+ QVERIFY(eval(QSL("error")).toString()
+ .contains(QSL("cannot be accessed from origin 'null'")));
+ }
+
+ {
+ ScopedAttribute sa(m_page->settings(), QWebEngineSettings::LocalContentCanAccessFileUrls, true);
+ QVERIFY(verifyLoad("file:" + QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + "/resources/sharedWorker.html"));
+ QTRY_VERIFY_WITH_TIMEOUT(eval(QSL("done")).toBool(), 10000);
+ QCOMPARE(eval(QSL("result")), QVariant(42));
+ }
+
+ QVERIFY(verifyLoad(QSL("qrc:/resources/sharedWorker.html")));
+ QTRY_VERIFY_WITH_TIMEOUT(eval(QSL("done")).toBool(), 10000);
+ QCOMPARE(eval(QSL("result")), QVariant(42));
+
+ // Unregistered schemes should not create SharedWorkers.
+
+ QVERIFY(verifyLoad(QSL("PathSyntax:/resources/sharedWorker.html")));
+ QTRY_VERIFY_WITH_TIMEOUT(eval(QSL("done")).toBool(), 10000);
+ QCOMPARE(eval(QSL("result")), QVariant(42));
+
+ QVERIFY(verifyLoad(QSL("PathSyntax-NoAccessAllowed:/resources/sharedWorker.html")));
+ QTRY_VERIFY_WITH_TIMEOUT(eval(QSL("done")).toBool(), 10000);
+ QVERIFY(eval(QSL("error")).toString()
+ .contains(QSL("denied to origin 'null'")));
+}
+
+// Service workers have to be explicitly enabled for a scheme.
+void tst_Origins::serviceWorker()
+{
+ QVERIFY(verifyLoad("file:" + QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + "/resources/serviceWorker.html"));
+ QTRY_VERIFY(eval(QSL("done")).toBool());
+ QVERIFY(eval(QSL("error")).toString()
+ .contains(QSL("The URL protocol of the current origin ('file://') is not supported.")));
+
+ QVERIFY(verifyLoad(QSL("qrc:/resources/serviceWorker.html")));
+ QTRY_VERIFY(eval(QSL("done")).toBool());
+ QVERIFY(eval(QSL("error")).toString()
+ .contains(QSL("The URL protocol of the current origin ('qrc:') is not supported.")));
+
+ QVERIFY(verifyLoad(QSL("tst:/resources/serviceWorker.html")));
+ QTRY_VERIFY(eval(QSL("done")).toBool());
+ QVERIFY(eval(QSL("error")).toString()
+ .contains(QSL("Cannot read properties of undefined")));
+
+ QVERIFY(verifyLoad(QSL("PathSyntax:/resources/serviceWorker.html")));
+ QTRY_VERIFY(eval(QSL("done")).toBool());
+ QVERIFY(eval(QSL("error")).toString()
+ .contains(QSL("Cannot read properties of undefined")));
+
+ QVERIFY(verifyLoad(QSL("PathSyntax-Secure:/resources/serviceWorker.html")));
+ QTRY_VERIFY(eval(QSL("done")).toBool());
+ QVERIFY(eval(QSL("error")).toString()
+ .contains(QSL("The URL protocol of the current origin ('pathsyntax-secure:') is not supported.")));
+
+ QVERIFY(verifyLoad(QSL("PathSyntax-ServiceWorkersAllowed:/resources/serviceWorker.html")));
+ QTRY_VERIFY(eval(QSL("done")).toBool());
+ QVERIFY(eval(QSL("error")).toString()
+ .contains(QSL("Cannot read properties of undefined")));
+
+ QVERIFY(verifyLoad(QSL("PathSyntax-Secure-ServiceWorkersAllowed:/resources/serviceWorker.html")));
+ QTRY_VERIFY(eval(QSL("done")).toBool());
+ QCOMPARE(eval(QSL("error")), QVariant());
+
+ QVERIFY(verifyLoad(QSL("PathSyntax-NoAccessAllowed:/resources/serviceWorker.html")));
+ QTRY_VERIFY(eval(QSL("done")).toBool());
+ QVERIFY(eval(QSL("error")).toString()
+ .contains(QSL("Cannot read properties of undefined")));
+}
+
+// Support for view-source must be enabled explicitly.
+void tst_Origins::viewSource()
+{
+ QVERIFY(verifyLoad("view-source:file:" + QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + "/resources/viewSource.html"));
+#ifdef Q_OS_WIN
+ QCOMPARE(m_page->requestedUrl().toString(),
+ "file:///" + QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + "/resources/viewSource.html");
+#else
+ QCOMPARE(m_page->requestedUrl().toString(),
+ "file://" + QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + "/resources/viewSource.html");
+#endif
+
+ QVERIFY(verifyLoad(QSL("view-source:qrc:/resources/viewSource.html")));
+ QCOMPARE(m_page->requestedUrl().toString(), QSL("qrc:/resources/viewSource.html"));
+
+ QVERIFY(verifyLoad(QSL("view-source:tst:/resources/viewSource.html")));
+ QCOMPARE(m_page->requestedUrl().toString(), QSL("about:blank"));
+
+ QVERIFY(verifyLoad(QSL("view-source:PathSyntax:/resources/viewSource.html")));
+ QCOMPARE(m_page->requestedUrl().toString(), QSL("about:blank"));
+
+ QVERIFY(verifyLoad(QSL("view-source:PathSyntax-ViewSourceAllowed:/resources/viewSource.html")));
+ QCOMPARE(m_page->requestedUrl().toString(), QSL("pathsyntax-viewsourceallowed:/resources/viewSource.html"));
+}
+
+void tst_Origins::createObjectURL()
+{
+ // Legal for registered custom schemes.
+ QVERIFY(verifyLoad(QSL("qrc:/resources/createObjectURL.html")));
+ QVERIFY(eval(QSL("result")).toString().startsWith(QSL("blob:qrc:")));
+
+ // Also legal for unregistered schemes (since Chromium 71)
+ QVERIFY(verifyLoad(QSL("tst:/resources/createObjectURL.html")));
+ QVERIFY(eval(QSL("result")).toString().startsWith(QSL("blob:tst:")));
+}
+
+void tst_Origins::redirectScheme()
+{
+ QVERIFY(verifyLoad(QSL("redirect:cors/resources/redirect.html")));
+ eval("addStylesheetLink('redirect:cors/resources/redirect.css')");
+ QTRY_COMPARE(m_handler->requests().size(), 4);
+ QCOMPARE(m_handler->requests()[0], QUrl(QStringLiteral("redirect:cors/resources/redirect.html")));
+ QCOMPARE(m_handler->requests()[1], QUrl(QStringLiteral("cors:/resources/redirect.html")));
+ QCOMPARE(m_handler->requests()[2], QUrl(QStringLiteral("redirect:cors/resources/redirect.css")));
+ QCOMPARE(m_handler->requests()[3], QUrl(QStringLiteral("cors:/resources/redirect.css")));
+
+ QVERIFY(!verifyLoad(QSL("redirect:file/resources/redirect.html")));
+ QVERIFY(!verifyLoad(QSL("redirect:local/resources/redirect.html")));
+ QVERIFY(!verifyLoad(QSL("redirect:local-cors/resources/redirect.html")));
+}
+
+void tst_Origins::redirectSchemeLocal()
+{
+ QVERIFY(verifyLoad(QSL("redirect-local:local/resources/redirect.html")));
+ eval("addStylesheetLink('redirect-local:local/resources/redirect.css')");
+ QTRY_COMPARE(m_handler->requests().size(), 4);
+ QCOMPARE(m_handler->requests()[0], QUrl(QStringLiteral("redirect-local:local/resources/redirect.html")));
+ QCOMPARE(m_handler->requests()[1], QUrl(QStringLiteral("local:/resources/redirect.html")));
+ QCOMPARE(m_handler->requests()[2], QUrl(QStringLiteral("redirect-local:local/resources/redirect.css")));
+ QCOMPARE(m_handler->requests()[3], QUrl(QStringLiteral("local:/resources/redirect.css")));
+}
+
+void tst_Origins::redirectSchemeSecure()
+{
+ QVERIFY(verifyLoad(QSL("redirect-secure:secure-cors/resources/redirect.html")));
+ eval("addStylesheetLink('redirect-secure:secure-cors/resources/redirect.css')");
+ QTRY_COMPARE(m_handler->requests().size(), 4);
+ QCOMPARE(m_handler->requests()[0], QUrl(QStringLiteral("redirect-secure:secure-cors/resources/redirect.html")));
+ QCOMPARE(m_handler->requests()[1], QUrl(QStringLiteral("secure-cors:/resources/redirect.html")));
+ QCOMPARE(m_handler->requests()[2], QUrl(QStringLiteral("redirect-secure:secure-cors/resources/redirect.css")));
+ QCOMPARE(m_handler->requests()[3], QUrl(QStringLiteral("secure-cors:/resources/redirect.css")));
+}
+
+void tst_Origins::redirectInterceptor()
+{
+ TestRequestInterceptor interceptor;
+ m_profile.setUrlRequestInterceptor(&interceptor);
+
+ QVERIFY(verifyLoad(QSL("redirect:cors/resources/redirect.html")));
+ eval("addStylesheetLink('redirect:cors/resources/redirect.css')");
+
+ QTRY_COMPARE(interceptor.requests.size(), 4);
+ QTRY_COMPARE(m_handler->requests().size(), 2);
+ QCOMPARE(m_handler->requests()[0], QUrl(QStringLiteral("cors:/resources/redirect.html")));
+ QCOMPARE(m_handler->requests()[1], QUrl(QStringLiteral("cors:/resources/redirect.css")));
+
+ QCOMPARE(interceptor.requests[0], QUrl(QStringLiteral("redirect:cors/resources/redirect.html")));
+ QCOMPARE(interceptor.requests[1], QUrl(QStringLiteral("cors:/resources/redirect.html")));
+ QCOMPARE(interceptor.requests[2], QUrl(QStringLiteral("redirect:cors/resources/redirect.css")));
+ QCOMPARE(interceptor.requests[3], QUrl(QStringLiteral("cors:/resources/redirect.css")));
+
+ QVERIFY(!verifyLoad(QSL("redirect:file/resources/redirect.html")));
+ QVERIFY(!verifyLoad(QSL("redirect:local/resources/redirect.html")));
+ QVERIFY(!verifyLoad(QSL("redirect:local-cors/resources/redirect.html")));
+}
+
+void tst_Origins::redirectInterceptorLocal()
+{
+ TestRequestInterceptor interceptor;
+ m_profile.setUrlRequestInterceptor(&interceptor);
+
+ QVERIFY(verifyLoad(QSL("redirect-local:local/resources/redirect.html")));
+ eval("addStylesheetLink('redirect-local:local/resources/redirect.css')");
+
+ QTRY_COMPARE(interceptor.requests.size(), 4);
+ QTRY_COMPARE(m_handler->requests().size(), 2);
+ QCOMPARE(m_handler->requests()[0], QUrl(QStringLiteral("local:/resources/redirect.html")));
+ QCOMPARE(m_handler->requests()[1], QUrl(QStringLiteral("local:/resources/redirect.css")));
+
+ QCOMPARE(interceptor.requests[0], QUrl(QStringLiteral("redirect-local:local/resources/redirect.html")));
+ QCOMPARE(interceptor.requests[1], QUrl(QStringLiteral("local:/resources/redirect.html")));
+ QCOMPARE(interceptor.requests[2], QUrl(QStringLiteral("redirect-local:local/resources/redirect.css")));
+ QCOMPARE(interceptor.requests[3], QUrl(QStringLiteral("local:/resources/redirect.css")));
+}
+
+void tst_Origins::redirectInterceptorSecure()
+{
+ TestRequestInterceptor interceptor;
+ m_profile.setUrlRequestInterceptor(&interceptor);
+
+ QVERIFY(verifyLoad(QSL("redirect-secure:secure-cors/resources/redirect.html")));
+ eval("addStylesheetLink('redirect-secure:secure-cors/resources/redirect.css')");
+
+ QTRY_COMPARE(interceptor.requests.size(), 4);
+ QTRY_COMPARE(m_handler->requests().size(), 2);
+ QCOMPARE(m_handler->requests()[0], QUrl(QStringLiteral("secure-cors:/resources/redirect.html")));
+ QCOMPARE(m_handler->requests()[1], QUrl(QStringLiteral("secure-cors:/resources/redirect.css")));
+
+ QCOMPARE(interceptor.requests[0], QUrl(QStringLiteral("redirect-secure:secure-cors/resources/redirect.html")));
+ QCOMPARE(interceptor.requests[1], QUrl(QStringLiteral("secure-cors:/resources/redirect.html")));
+ QCOMPARE(interceptor.requests[2], QUrl(QStringLiteral("redirect-secure:secure-cors/resources/redirect.css")));
+ QCOMPARE(interceptor.requests[3], QUrl(QStringLiteral("secure-cors:/resources/redirect.css")));
+}
+
+class TestRedirectInterceptor : public QWebEngineUrlRequestInterceptor
+{
+public:
+ TestRedirectInterceptor() = default;
+ void interceptRequest(QWebEngineUrlRequestInfo &info) override
+ {
+ qCDebug(lc) << this << "Type:" << info.resourceType() << info.requestMethod() << "Navigation:" << info.navigationType()
+ << info.requestUrl() << "Initiator:" << info.initiator();
+
+ QUrl url = info.requestUrl();
+ requests << url;
+ if (url.path().startsWith("/redirect")) {
+ QString path = url.path();
+ int idx = path.indexOf(QChar('/'), 10);
+ if (idx > 0) {
+ url.setScheme(path.mid(10, idx - 10));
+ url.setPath(path.mid(idx, -1));
+ url.setHost({});
+ info.redirect(url);
+ }
+ }
+ }
+ QList<QUrl> requests;
+};
+
+void tst_Origins::redirectInterceptorFile()
+{
+ TestRedirectInterceptor interceptor;
+ m_profile.setUrlRequestInterceptor(&interceptor);
+
+ QVERIFY(verifyLoad(QSL("file:///redirect/local-cors/resources/redirect.html")));
+ eval("addStylesheetLink('file:///redirect/local-cors/resources/redirect.css')");
+
+ QTRY_COMPARE(interceptor.requests.size(), 4);
+ QTRY_COMPARE(m_handler->requests().size(), 2);
+ QCOMPARE(m_handler->requests()[0], QUrl(QStringLiteral("local-cors:/resources/redirect.html")));
+ QCOMPARE(m_handler->requests()[1], QUrl(QStringLiteral("local-cors:/resources/redirect.css")));
+
+ QCOMPARE(interceptor.requests[0], QUrl(QStringLiteral("file:///redirect/local-cors/resources/redirect.html")));
+ QCOMPARE(interceptor.requests[1], QUrl(QStringLiteral("local-cors:/resources/redirect.html")));
+ QCOMPARE(interceptor.requests[2], QUrl(QStringLiteral("file:///redirect/local-cors/resources/redirect.css")));
+ QCOMPARE(interceptor.requests[3], QUrl(QStringLiteral("local-cors:/resources/redirect.css")));
+}
+
+void tst_Origins::redirectInterceptorHttp()
+{
+ TestRedirectInterceptor interceptor;
+ m_profile.setUrlRequestInterceptor(&interceptor);
+
+ QVERIFY(verifyLoad(QSL("http://hallo/redirect/cors/resources/redirect.html")));
+ eval("addStylesheetLink('http://hallo/redirect/cors/resources/redirect.css')");
+
+ QTRY_COMPARE(interceptor.requests.size(), 4);
+ QTRY_COMPARE(m_handler->requests().size(), 2);
+ QCOMPARE(m_handler->requests()[0], QUrl(QStringLiteral("cors:/resources/redirect.html")));
+ QCOMPARE(m_handler->requests()[1], QUrl(QStringLiteral("cors:/resources/redirect.css")));
+
+ QCOMPARE(interceptor.requests[0], QUrl(QStringLiteral("http://hallo/redirect/cors/resources/redirect.html")));
+ QCOMPARE(interceptor.requests[1], QUrl(QStringLiteral("cors:/resources/redirect.html")));
+ QCOMPARE(interceptor.requests[2], QUrl(QStringLiteral("http://hallo/redirect/cors/resources/redirect.css")));
+ QCOMPARE(interceptor.requests[3], QUrl(QStringLiteral("cors:/resources/redirect.css")));
+}
+
+void tst_Origins::localMediaBlock_data()
+{
+ QTest::addColumn<bool>("enableAccess");
+ QTest::addRow("enabled") << true;
+ QTest::addRow("disabled") << false;
+}
+
+void tst_Origins::localMediaBlock()
+{
+ QFETCH(bool, enableAccess);
+
+ std::atomic<bool> accessed = false;
+ HttpServer server;
+ server.setResourceDirs({ QDir(QT_TESTCASE_SOURCEDIR).canonicalPath() + "/resources" });
+ connect(&server, &HttpServer::newRequest, [&](HttpReqRep *) { accessed.store(true); });
+ QVERIFY(server.start());
+
+ ScopedAttribute sa1(m_page->settings(), QWebEngineSettings::LocalContentCanAccessRemoteUrls, enableAccess);
+
+ QVERIFY(verifyLoad("file:" + QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + "/resources/media.html"));
+ eval("addAudio('" + server.url("/mixedXHR.txt").toString() + "')");
+
+ // Give it a chance to avoid a false positive on the default value of accessed.
+ if (!enableAccess)
+ QTest::qSleep(500);
+ QTRY_COMPARE(accessed.load(), enableAccess);
+
+}
+
+class FetchApiHandler : public QWebEngineUrlSchemeHandler
+{
+ Q_OBJECT
+public:
+ FetchApiHandler(QByteArray schemeName, QObject *parent = nullptr)
+ : QWebEngineUrlSchemeHandler(parent), m_schemeName(schemeName)
+ {
+ }
+
+ void requestStarted(QWebEngineUrlRequestJob *job) override
+ {
+ QCOMPARE(job->requestUrl(), QUrl(m_schemeName + ":about"));
+ fetchWasAllowed = true;
+ }
+
+ bool fetchWasAllowed = false;
+
+private:
+ QByteArray m_schemeName;
+};
+
+class FetchApiPage : public QWebEnginePage
+{
+ Q_OBJECT
+
+signals:
+ void jsCalled();
+
+public:
+ FetchApiPage(QWebEngineProfile *profile, QObject *parent = nullptr)
+ : QWebEnginePage(profile, parent)
+ {
+ }
+
+protected:
+ void javaScriptConsoleMessage(QWebEnginePage::JavaScriptConsoleMessageLevel,
+ const QString &message, int, const QString &) override
+ {
+ qCritical() << "js:" << message;
+ emit jsCalled();
+ }
+};
+
+void tst_Origins::fetchApiCustomUrl_data()
+{
+ QTest::addColumn<QUrl>("url");
+ QTest::addColumn<QByteArray>("fetchApiScheme");
+ QTest::addColumn<bool>("expectedFetchWasAllowed");
+
+ QTest::newRow("custom url with fetch allowed flag")
+ << QUrl("qrc:///resources/fetchApi.html?printRes=false&url=fetchapi-allowed:about")
+ << QBAL("fetchapi-allowed") << true;
+ QTest::newRow("custom url without fetch allowed flag")
+ << QUrl("qrc:///resources/fetchApi.html?printRes=false&url=fetchapi-not-allowed:about")
+ << QBAL("fetchapi-not-allowed") << false;
+}
+
+void tst_Origins::fetchApiCustomUrl()
+{
+ QFETCH(QUrl, url);
+ QFETCH(QByteArray, fetchApiScheme);
+ QFETCH(bool, expectedFetchWasAllowed);
+
+ QWebEngineProfile profile;
+ FetchApiHandler handler(fetchApiScheme);
+
+ profile.installUrlSchemeHandler(fetchApiScheme, &handler);
+
+ FetchApiPage page(&profile);
+ QSignalSpy loadSpy(&page, SIGNAL(loadFinished(bool)));
+ QSignalSpy jsSpy(&page, SIGNAL(jsCalled()));
+
+ if (fetchApiScheme == "fetchapi-not-allowed") {
+ QTest::ignoreMessage(QtCriticalMsg, QRegularExpression("Failed to fetch"));
+ QTest::ignoreMessage(
+ QtCriticalMsg,
+ QRegularExpression("Fetch API cannot load fetchapi-not-allowed:about."));
+ }
+
+ page.load(url);
+ QTRY_VERIFY(loadSpy.count() > 0);
+ QTRY_COMPARE(handler.fetchWasAllowed, expectedFetchWasAllowed);
+
+ if (fetchApiScheme == "fetchapi-not-allowed") {
+ QTRY_VERIFY(jsSpy.count() > 0);
+ }
+}
+
+void tst_Origins::fetchApiHttpUrl()
+{
+ HttpServer httpServer;
+ QObject::connect(&httpServer, &HttpServer::newRequest, this, [](HttpReqRep *rr) {
+ rr->setResponseBody(QBAL("Fetch Was Allowed"));
+ rr->setResponseHeader(QBAL("Access-Control-Allow-Origin"), QBAL("*"));
+ rr->sendResponse();
+ });
+ QVERIFY(httpServer.start());
+
+ QWebEngineProfile profile;
+ FetchApiPage page(&profile);
+
+ QSignalSpy loadSpy(&page, SIGNAL(loadFinished(bool)));
+ QSignalSpy jsSpy(&page, SIGNAL(jsCalled()));
+
+ QTest::ignoreMessage(QtCriticalMsg, QRegularExpression("Fetch Was Allowed"));
+
+ const QByteArray fullUrl = QByteArray("qrc:///resources/fetchApi.html?printRes=true&url=")
+ + httpServer.url("/somepage.html").toEncoded();
+ page.load(QUrl(fullUrl));
+
+ QTRY_VERIFY(loadSpy.count() > 0);
+ QTRY_VERIFY(jsSpy.count() > 0);
+ QVERIFY(httpServer.stop());
+}
+
+QTEST_MAIN(tst_Origins)
+#include "tst_origins.moc"
diff --git a/tests/auto/core/qtversion/CMakeLists.txt b/tests/auto/core/qtversion/CMakeLists.txt
new file mode 100644
index 000000000..9a5e89266
--- /dev/null
+++ b/tests/auto/core/qtversion/CMakeLists.txt
@@ -0,0 +1,10 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_test(tst_qtversion
+ SOURCES
+ tst_qtversion.cpp
+ LIBRARIES
+ Qt::WebEngineCore
+)
+
diff --git a/tests/auto/core/qtversion/tst_qtversion.cpp b/tests/auto/core/qtversion/tst_qtversion.cpp
new file mode 100644
index 000000000..44c2d4e5c
--- /dev/null
+++ b/tests/auto/core/qtversion/tst_qtversion.cpp
@@ -0,0 +1,34 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#include <QtTest/QtTest>
+#include <QtWebEngineCore/qwebenginepage.h>
+
+class tst_QtVersion : public QObject
+{
+ Q_OBJECT
+signals:
+ void done();
+private Q_SLOTS:
+ void checkVersion();
+};
+
+void tst_QtVersion::checkVersion()
+{
+ QWebEnginePage page;
+ QSignalSpy loadSpy(&page, &QWebEnginePage::loadFinished);
+ QSignalSpy doneSpy(this, &tst_QtVersion::done);
+ page.load(QUrl("chrome://qt"));
+ QTRY_COMPARE_WITH_TIMEOUT(loadSpy.size(), 1, 12000);
+ page.toPlainText([this](const QString &result) {
+ QVERIFY(result.contains(qWebEngineVersion()));
+ QVERIFY(result.contains(qWebEngineChromiumVersion()));
+ QVERIFY(result.contains(qWebEngineChromiumSecurityPatchVersion()));
+ emit done();
+ });
+ QTRY_VERIFY(doneSpy.size());
+}
+
+QTEST_MAIN(tst_QtVersion)
+
+#include "tst_qtversion.moc"
diff --git a/tests/auto/core/qwebengineclientcertificatestore/CMakeLists.txt b/tests/auto/core/qwebengineclientcertificatestore/CMakeLists.txt
new file mode 100644
index 000000000..8cee7f630
--- /dev/null
+++ b/tests/auto/core/qwebengineclientcertificatestore/CMakeLists.txt
@@ -0,0 +1,80 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+include(../../httpserver/httpserver.cmake)
+include(../../util/util.cmake)
+
+qt_internal_add_test(tst_qwebengineclientcertificatestore
+ SOURCES
+ tst_qwebengineclientcertificatestore.cpp
+ LIBRARIES
+ Qt::WebEngineCore
+ Test::HttpServer
+ Test::Util
+)
+
+set(tst_qwebengineclientcertificatestore_resource_files
+ "resources/certificate.crt"
+ "resources/certificate1.crt"
+ "resources/privatekey.key"
+ "resources/privatekey1.key"
+ "resources/server.pem"
+ "resources/server.key"
+ "resources/client.pem"
+ "resources/client.key"
+ "resources/client2.pem"
+ "resources/client2.key"
+ "resources/ca.pem"
+)
+
+qt_internal_add_resource(tst_qwebengineclientcertificatestore "tst_qwebengineclientcertificatestore"
+ PREFIX
+ "/"
+ FILES
+ ${tst_qwebengineclientcertificatestore_resource_files}
+)
+
+if(LINUX AND NOT CMAKE_CROSSCOMPILING)
+
+ get_filename_component(homePath $ENV{HOME} ABSOLUTE)
+
+ find_program(pk12util_EXECUTABLE NAMES pk12util)
+ find_program(certutil_EXECUTABLE NAMES certutil)
+
+ if(pk12util_EXECUTABLE AND certutil_EXECUTABLE)
+ add_custom_command(
+ DEPENDS resources/client2.p12
+ COMMAND test -e "${homePath}/.pki/nssdb" || ${CMAKE_COMMAND} -E make_directory
+ "${homePath}/.pki/nssdb"
+ COMMAND test -e "${homePath}/.pki/nssdb/cert9.db" || ${certutil_EXECUTABLE}
+ -N --empty-password -d sql:${homePath}/.pki/nssdb
+ COMMAND test -e "${homePath}/.pki/nssdb/cert9.db" && ${pk12util_EXECUTABLE}
+ -d sql:${homePath}/.pki/nssdb
+ -i "${CMAKE_CURRENT_LIST_DIR}/resources/client2.p12"
+ -W ""
+ COMMAND ${CMAKE_COMMAND} -E touch pk12util.stamp
+ OUTPUT pk12util.stamp
+ VERBATIM
+ USES_TERMINAL
+ )
+ add_custom_target(
+ add-user-personal-certificate
+ DEPENDS pk12util.stamp
+ )
+ qt_internal_extend_target(tst_qwebengineclientcertificatestore DEFINES TEST_NSS)
+ add_dependencies(tst_qwebengineclientcertificatestore add-user-personal-certificate)
+ endif()
+
+ find_program(certutil_EXECUTABLE NAMES certutil)
+
+ if(certutil_EXECUTABLE)
+ add_custom_target(remove-user-personal-certificate
+ COMMAND ${CMAKE_COMMAND} -E remove pk12util.stamp
+ COMMAND ${certutil_EXECUTABLE}
+ -d sql:"${homePath}/.pki/nssdb"
+ -D
+ -n qwebengineclientcertificatestore
+ )
+ endif()
+endif()
+
diff --git a/tests/auto/core/qwebengineclientcertificatestore/qwebengineclientcertificatestore.pro b/tests/auto/core/qwebengineclientcertificatestore/qwebengineclientcertificatestore.pro
deleted file mode 100644
index e99c7f493..000000000
--- a/tests/auto/core/qwebengineclientcertificatestore/qwebengineclientcertificatestore.pro
+++ /dev/null
@@ -1 +0,0 @@
-include(../tests.pri)
diff --git a/tests/auto/core/qwebengineclientcertificatestore/resources/ca.pem b/tests/auto/core/qwebengineclientcertificatestore/resources/ca.pem
new file mode 100644
index 000000000..cb62ad62c
--- /dev/null
+++ b/tests/auto/core/qwebengineclientcertificatestore/resources/ca.pem
@@ -0,0 +1,24 @@
+-----BEGIN CERTIFICATE-----
+MIIECzCCAvOgAwIBAgIUdhDW1WgGxF313LYA0JjEQpKbanQwDQYJKoZIhvcNAQEL
+BQAwgZQxCzAJBgNVBAYTAkRFMQ8wDQYDVQQIDAZCZXJsaW4xDzANBgNVBAcMBkJl
+cmxpbjEXMBUGA1UECgwOVGhlIFF0IENvbXBhbnkxFDASBgNVBAsMC1F0V2ViRW5n
+aW5lMRIwEAYDVQQDDAl3d3cucXQuaW8xIDAeBgkqhkiG9w0BCQEWEXF0d2ViZW5n
+aW5lQHF0LmlvMB4XDTIyMTExNjExMDQxNFoXDTMyMTExMzExMDQxNFowgZQxCzAJ
+BgNVBAYTAkRFMQ8wDQYDVQQIDAZCZXJsaW4xDzANBgNVBAcMBkJlcmxpbjEXMBUG
+A1UECgwOVGhlIFF0IENvbXBhbnkxFDASBgNVBAsMC1F0V2ViRW5naW5lMRIwEAYD
+VQQDDAl3d3cucXQuaW8xIDAeBgkqhkiG9w0BCQEWEXF0d2ViZW5naW5lQHF0Lmlv
+MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxyNLLwAA+FgNQavVJ19n
+gdoy+NKLHQyhzcRFykKSp9aAbpAR6e4ukxwG7mWNBcuR7zv1Zw/JqLFE0gmVztVw
+FeQWdw1cvTN/OlVEuM+0ShTDHHsCqRpx7/XJT6ytMKVU8jdZN4Vl1m7MubWv4aPy
+0WYYd3zIAicciYgy/RHaRhPTKpPzWIPYhmHsM5w2cebL8I0aZXUkC0OeklJArnp9
+007Fr6SXXK0xQ3RO20n7X193gCfd5U70lug0ks/ZZqxtzPHmzIO1WGAOBura50HR
+hxUKAu7qQHzBiW5Qwdn0af4FPLJR/SX8ADKTLCSWlMOo1FLYO5w6D8hB4K6/b9VQ
+RwIDAQABo1MwUTAdBgNVHQ4EFgQUXuTuB85/iBgwJpLdOc+8TB0KESIwHwYDVR0j
+BBgwFoAUXuTuB85/iBgwJpLdOc+8TB0KESIwDwYDVR0TAQH/BAUwAwEB/zANBgkq
+hkiG9w0BAQsFAAOCAQEAvtucUJa0IECltWv8U6R+LQuZ1Q+ubbmstojO/h8tg6Wf
+v6FZ5bH3oboSyGEcytRr6INf4G6znUNAypbodehAEW6/PETdzGM9CJyv2JPJAWzV
+rxb1H5VTyiEs8924QOqcNATD+oe7G0vwnDkvprcqaWBA6yvQkWpCXoqMc+F95KnY
+8VFt2VQw17l4L4nhaX3Us6hJLMiKV+dLeF0pN+pkCPRP9G5WKgW3mT2U6Gig+rLz
+6L7rBbb5KWAttdAbuHCrMa65PgXoVD1P/GteFxUnghDd0PWgUaign8c/DyHGsrbA
+uvJqSym0kmQQXptryRaKFsGcCrizdbE6FfrH2iE7vQ==
+-----END CERTIFICATE-----
diff --git a/tests/auto/core/qwebengineclientcertificatestore/resources/client.key b/tests/auto/core/qwebengineclientcertificatestore/resources/client.key
new file mode 100644
index 000000000..21c8e3183
--- /dev/null
+++ b/tests/auto/core/qwebengineclientcertificatestore/resources/client.key
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEowIBAAKCAQEAqnHbq38y1VprEaV2xXzv2nAPyjqCuIfuick8qETkzEsNWPQi
+dsBlLfcyf+15wEMhpRIwILXCrUM7Sb7WCGtg1XC00JZvCh2xPBMSD2fiQyHn4men
+Fwh9vVbTf1v7w21ZT/pXQrwlgLgNWYZHE3JrcEAwlThQRIdQfzSE6/QeHfYZoGB9
+WfvbREsOWiUlZze/yrblS9vnAVhYwVurelc7lXyHA0dHmkcZ0HwMxVJZ/vLuCyIw
+lNGT/ytnA9p1l8uFkAgTcbWZKoyJAsAZG9faZp46hk8+e3KAyKQ78aoUSbjAqnNQ
+tBM3bnHeHanf3ddCxyej+k9PfSIY27a9FZxHpQIDAQABAoIBAFsomA8p8ZsQR9Fh
+SJupDXMrmhZTotRkxxxkR4/LgP8OaO4ZbFFM5xBldFndPc+pV9Y8WwczjxIxsgTo
+Dvrjyx98rwgcXPjxFniFzpP0wJudB7McMs5r2SwpwuYL4SQNWMYgowjrLbehOGqY
+GW16NaIMgq9cNfng0RmnkivMHUtyE5GGdK+C6cyK+fIE+cNtQtHPRKfEnwbE9VHz
+3EY/nCXGZvMFyj5uHaU4EeZFCzo19TUqhh8H7b0EA44pBtb5U/CxsH4xphZ7rpjt
+iVjMfRSMR4qalQNIs6ZEj57We+M/zca/Qq1yhjW+0NYbZifcYo1Oj6e4lC9YlIgn
+kGkcuUECgYEA1j0iVFjgBXS8pJP3jBgmbrbBBTNEUv27yjnJCAQx5TbplJkvBM4/
+qzum1uH2o6uRrFtrYJFiAhDHARtg+70rMeYqZp8WFvzJT5c5s+FOmGQPfFjgrD6e
+wfnCwFzS7nohJ8TM2mPGJ88pBv0eBYW6D0f7fvcJmEk8hnGktdLRCrECgYEAy6tU
+YFZDzGhbgrG2wWzBvAKVngUNhrYZHMiF1WVN8zZdCm7Z8b1S/NMe0rPA5orhAkSX
+8fxlDfKOm+U2fKp43aiN0NDiP0TlGRbypAXe7FSnvDxNHbV+Ie0UbwuiJ4s3vJuc
+6cdzgKqAs5/rjPXPdUpM8C7344HV7azgSzHIYTUCgYAtVmCmcuxtmye0uG+BoTa4
+5UnxvMivu2x7PkFRxfl9JWLHBKfTn4YPyZ7kCIu2VT+NtwcBN6MDBuPmUxHyFDVI
+6Ql+EBqPoM1FX55hd8O3Mi2oxfI94T6dlCpnpP0qZIQRs28apFSx5gArr3Mj/gnC
+5BvP4Z2RMaZyWShfJg8A8QKBgQClZEhswyDjiYtmorJqeMsKxn6BiFDnqFDUUvJ7
+zHx0mR0NL9/Es54Eud059ccccIMwuEs7s17M6MBuUMDik/z647nmbPqNroDs0vnP
+wQS6njRoY/+rtIrtOf1x/9x6iE+G1keigNmHDu7c72z1V1hVQzUfhsS+99yl2dF6
+vr6eUQKBgF/OHW1bE3FruZ+53Arcb94N/IKnpH9VWoB3elIzr0w6pLtL4HHhmQ58
+TayEpq6YguUAjTvCBbaHuYuKPHiXCAy5DhtrXvP4YdMNH9X1nHc7jVEbGltVbnQU
+bG/p5YfZSrDmsjf8w0z7feFOcovC6vF1YCXc8OHK/LQ6JFJ/gtO1
+-----END RSA PRIVATE KEY-----
diff --git a/tests/auto/core/qwebengineclientcertificatestore/resources/client.pem b/tests/auto/core/qwebengineclientcertificatestore/resources/client.pem
new file mode 100644
index 000000000..dd1f898f7
--- /dev/null
+++ b/tests/auto/core/qwebengineclientcertificatestore/resources/client.pem
@@ -0,0 +1,22 @@
+-----BEGIN CERTIFICATE-----
+MIIDrzCCApcCFFNQAgGBu5nr81tUMdXXLGkm8Li+MA0GCSqGSIb3DQEBCwUAMIGU
+MQswCQYDVQQGEwJERTEPMA0GA1UECAwGQmVybGluMQ8wDQYDVQQHDAZCZXJsaW4x
+FzAVBgNVBAoMDlRoZSBRdCBDb21wYW55MRQwEgYDVQQLDAtRdFdlYkVuZ2luZTES
+MBAGA1UEAwwJd3d3LnF0LmlvMSAwHgYJKoZIhvcNAQkBFhFxdHdlYmVuZ2luZUBx
+dC5pbzAeFw0yMjExMTYxMjExMDFaFw0zMjExMTMxMjExMDFaMIGSMQswCQYDVQQG
+EwJERTEPMA0GA1UECAwGQmVybGluMQ8wDQYDVQQHDAZCZXJsaW4xFzAVBgNVBAoM
+DlRoZSBRdCBDb21wYW55MRQwEgYDVQQLDAtRdFdlYkVuZ2luZTEVMBMGA1UEAwwM
+Y2xpZW50LnF0LmlvMRswGQYJKoZIhvcNAQkBFgxjbGllbnRAcXQuaW8wggEiMA0G
+CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCqcdurfzLVWmsRpXbFfO/acA/KOoK4
+h+6JyTyoROTMSw1Y9CJ2wGUt9zJ/7XnAQyGlEjAgtcKtQztJvtYIa2DVcLTQlm8K
+HbE8ExIPZ+JDIefiZ6cXCH29VtN/W/vDbVlP+ldCvCWAuA1ZhkcTcmtwQDCVOFBE
+h1B/NITr9B4d9hmgYH1Z+9tESw5aJSVnN7/KtuVL2+cBWFjBW6t6VzuVfIcDR0ea
+RxnQfAzFUln+8u4LIjCU0ZP/K2cD2nWXy4WQCBNxtZkqjIkCwBkb19pmnjqGTz57
+coDIpDvxqhRJuMCqc1C0Ezducd4dqd/d10LHJ6P6T099Ihjbtr0VnEelAgMBAAEw
+DQYJKoZIhvcNAQELBQADggEBALE75ZQxmEXJA16cNAxxmxCKHkaqAE6Ulim1vXNH
+jCFfNCDGYn/R28F3BVtMe+bIMoomaTh3h5eOd/9uc2nm8IiT5FUz9epJWPeRG/cl
+I+hQ3fvaE7oJ3m3EwfGq1mdqUf1zi+DFjtkimNbn9ZRDocZfpO5VN0u23ptEuk0P
+5cH4+Dst0giRMv5W0kXG6QD13H/eVH3jDZCtZa/8T4oxGGskHEa4yDr8s976lVOV
+XLI1r7oN4a/KXKow8WN3oHFeKn4QJx86z1uecuZLtT8xjABKSWpZqgsIlmGTGE1a
+9W06C+uPVamwn5ND3gnf93YQqn6PwrjlHdrQOTG/vngJLPw=
+-----END CERTIFICATE-----
diff --git a/tests/auto/core/qwebengineclientcertificatestore/resources/client2.key b/tests/auto/core/qwebengineclientcertificatestore/resources/client2.key
new file mode 100644
index 000000000..3c1346519
--- /dev/null
+++ b/tests/auto/core/qwebengineclientcertificatestore/resources/client2.key
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEowIBAAKCAQEAv0vrzULGwDJBoZgnGXdkMFxCvkTqqQYCE/LlNtStLJfJH7Fo
+CgenVFcJ8RIFHdkL7HeFAIZjDLSjIp2Ud41fd+VsaGgB/+j1/UeEN8nkArvYB9ol
+OnKGq6CbSrCocrLo2o2X+6eyLtrtLG6RLr8/UiqB2OWNAdnw70S5RCvnbV6phr8z
+bgYqPdPSBaedfZk5Kj6yM6XvIKSK6IjgZuo+Z5SyabJqk2VhaBlB7mjCf3Mj4zPD
+XvQXsAq0ZNQXQVwKRfJ2I9uAeNAZiQP5i00pBqe2kIJEKnk8qbP4/Jho2Tp8XSBC
+jHMn0oWrAZyO9vw3W940qmqmdRftyt+J8DO9xwIDAQABAoIBAGBpXTCYRR88tQNC
+cgJNv/r3pNPMXBBP7OAs/QUDbzwYS89jVDIp5VWGgIY1NMr0RyQooKnBEU6oA8hA
+b0FJySHeSSLduJRHzyKV1rdfU0Fldt2OPlEUw3bgfSPJoTwdm2n7DuxQemdPA1Xv
+a9CJpto8fjDYkJasRtfwZQdMsVjXCfQ/cCzkOkblUDZcc7yTx3uiBKF8Jy8C+0qc
+98btotYU88KWoE9A0ucWt/ik68MjYmccO6PYXKerNW2Ijgd1kik35G3TbEWxOFWW
+y3zLFtfoD+21SdUgTMzM06owDVfSt/MER4tOxFyUPRuze7BJXrBofGQfuPiGiPuK
+f5QZP8ECgYEA+x1PkClsqtRnjrzmRfi3OFez1Kbbzneucg5ssWR+Hd4EUFhhO42q
+te1ZYoydy09tEqd002U7e5hob0/o+rVK9jldpZszMCBfVDYCDqdtw5rNI89bL1Uz
+8krn6nk3BBx42lgAFU4C1JEaur4r14OOUtoFfRTAwjogQHcDmpyPNjcCgYEAwwSv
+FJAKRjw1oOXKlGotoeYEAREVxH9HFnfM5IcVwcwMt+KUFEyrMtXeH1gk7jo+2ev4
+87njQ8hU3VPObCUcnTJHi2a6D9JIY+zA9bKTJjc8drcBathipmwtak14TsX2qe14
+JBIKlC3V0h1FqM3ep76p4dnt7sTmVc7ZOqBR7PECgYEA1HQE94wEkzdnch0hmbuG
+kBWrYNPXDgS1w2uuzBqglPZcoflUMkV2U7s+r6EWc4d8WZbxwVRZkgTs/pgWHd66
+UD1SnKUFFsecv6t97BX9SMu0mYJ6vD4S2ABF3Fu3jzPjj596WowI2vz1J19zyj9U
+b4ZjtGKVfv4cgU3v76RbidsCgYAx4CvKzX/jMJjimoJx7KnZAxO5Fh6ED60loOQE
++ktlMgN6r/cBLg6GxM23JHrldn4Gi+QyqTLnbf/OTxW28NLdnTNRAqfJThV3gOBk
+thQOLQhIsEsrgUXRnE8NJd0EAHsyQGp+hyKvfP13bEcZgfVU311hRrQkYbUq8uj5
+pnDtcQKBgEFIpP7EzdJWrVOUjnjMQloqBhW8KVVtNwI5bmlcsUvVYjfZph016SiF
+UTfZss1KkBmQClAVtyZsrKIfObIJ9KJ4hPAzzk+ca1D6XTLsYjxPwtB/U0ewB2Dm
+yMxkXpT1kAiJ2Tdr1hZ8OcQhvnGWmrhtz+AkjyLXiYgST7Hubrxt
+-----END RSA PRIVATE KEY-----
diff --git a/tests/auto/core/qwebengineclientcertificatestore/resources/client2.p12 b/tests/auto/core/qwebengineclientcertificatestore/resources/client2.p12
new file mode 100644
index 000000000..81e7eb624
--- /dev/null
+++ b/tests/auto/core/qwebengineclientcertificatestore/resources/client2.p12
Binary files differ
diff --git a/tests/auto/core/qwebengineclientcertificatestore/resources/client2.pem b/tests/auto/core/qwebengineclientcertificatestore/resources/client2.pem
new file mode 100644
index 000000000..39c0b3f09
--- /dev/null
+++ b/tests/auto/core/qwebengineclientcertificatestore/resources/client2.pem
@@ -0,0 +1,22 @@
+-----BEGIN CERTIFICATE-----
+MIIDsTCCApkCFFNQAgGBu5nr81tUMdXXLGkm8LjBMA0GCSqGSIb3DQEBCwUAMIGU
+MQswCQYDVQQGEwJERTEPMA0GA1UECAwGQmVybGluMQ8wDQYDVQQHDAZCZXJsaW4x
+FzAVBgNVBAoMDlRoZSBRdCBDb21wYW55MRQwEgYDVQQLDAtRdFdlYkVuZ2luZTES
+MBAGA1UEAwwJd3d3LnF0LmlvMSAwHgYJKoZIhvcNAQkBFhFxdHdlYmVuZ2luZUBx
+dC5pbzAeFw0yMjExMTYxOTIwMzBaFw0zMjExMTMxOTIwMzBaMIGUMQswCQYDVQQG
+EwJERTEPMA0GA1UECAwGQmVybGluMQ8wDQYDVQQHDAZCZXJsaW4xFzAVBgNVBAoM
+DlRoZSBRdCBDb21wYW55MRQwEgYDVQQLDAtRdFdlYkVuZ2luZTEWMBQGA1UEAwwN
+Y2xpZW50Mi5xdC5pbzEcMBoGCSqGSIb3DQEJARYNY2xpZW50MkBxdC5pbzCCASIw
+DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL9L681CxsAyQaGYJxl3ZDBcQr5E
+6qkGAhPy5TbUrSyXyR+xaAoHp1RXCfESBR3ZC+x3hQCGYwy0oyKdlHeNX3flbGho
+Af/o9f1HhDfJ5AK72AfaJTpyhqugm0qwqHKy6NqNl/unsi7a7SxukS6/P1Iqgdjl
+jQHZ8O9EuUQr521eqYa/M24GKj3T0gWnnX2ZOSo+sjOl7yCkiuiI4GbqPmeUsmmy
+apNlYWgZQe5own9zI+Mzw170F7AKtGTUF0FcCkXydiPbgHjQGYkD+YtNKQantpCC
+RCp5PKmz+PyYaNk6fF0gQoxzJ9KFqwGcjvb8N1veNKpqpnUX7crfifAzvccCAwEA
+ATANBgkqhkiG9w0BAQsFAAOCAQEAic8F8q1TpP2ufnBRbrBp54Jgddl/zdVb7O3M
+AAK67KiEpEr9xPPVcIowfns1ZTIsIB8D4VS4NQGJXBrwvGWL08SpSmi76I1E156x
+9Hql0PHXCjqsJTOSEvljIgQ4sp33zs0DTmlyejSSGnG9sw2FtcYAGZNV+ImAhTO2
+DNxw3BnF++ilHsQbiWIKD5z14bOXb77SJrimup0YBzfwBWJO013k8g8lkiRRs5Ng
+XYVr3NoTLcIJQ7BTFu4W1Wegxwrw3fQZ98BBlCVh0htrOcLpWKelJeI16MgZA/7T
+P4MwvN5tkyjqrcsrDORldR6JKdX8i+GLF49MgRW4QispcZzoYA==
+-----END CERTIFICATE-----
diff --git a/tests/auto/core/qwebengineclientcertificatestore/resources/server.key b/tests/auto/core/qwebengineclientcertificatestore/resources/server.key
new file mode 100644
index 000000000..632cc4d2e
--- /dev/null
+++ b/tests/auto/core/qwebengineclientcertificatestore/resources/server.key
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEowIBAAKCAQEA5gQoJryenjmvzy4RbqHdNXHK8Gk/8Lto1SwT8+Wbh5EyYRTt
+hFdioT1JYcIe3XMwOmx3TjADY1jAXAPfeRcjTkMcnZwF76AXUK2XqBANhaG1wjsi
+b7ISGU/U5/Jarm2iwQJ5zjKsNm8pZYqpmKsYAVFMErtfcpdLdSp6BG54SrbItcXh
+WHfsUs5cuVEi9nCeugLkDzoPLlj/TeouKWOdzhyvLXkPvPmD4/hD0dULTXpCDZhf
+73AuQBWTGsWeUnJQiQhDRwuXWhGRX8qFJQ4rzY8rIbaKhge+BQ6BL+pij2uzHKNQ
+j12ZLFZgLihLDJogGp08y9Ud6Ru/3WGoFkY38wIDAQABAoIBABM/TczQA8XhteB0
+Tmkfik8qknzDkeInDIKqCZFjKTyS3dBZ2/YzCcHMSxOvFr4ZIXQCF4mnYuExUAdj
+G5QaZ43o98AIikae8tSBcitSDI+eFIOIRz1pfTI5B+vQz93AttnHx0GF4/s6GhCx
+JbfsuTmDAAahPz9rgZjwUP2F8PLvaAZqJrXBPY+QLWz0SN2zh6vWAHPbJA0sO/4E
+oWUhRPXJDf33YCFxnwtbUBie5313suAfNspODcyH+AxBH2FFh63pe0ZGOhX7XFMJ
+yxJqujeZrQdfwFZNPXAPVLJGbd7AIOrVE+O8/bYUB/uuj6pPJBqr+Ob/JhY48pRb
+VG2qL4ECgYEA9n3PuL13F9XFcLeergGH7fUcSQeD1T6Z1qaI2Wth0Umfmer/fFZh
+IKSCSwEGMTLsalFdlTj8jsSAasjuSorQTeSgHjzvzik1Ll2P6syputjsD1RX/nkl
+8L50Pwdeey57Y9dgow7Cw/heGYs6dkXLe9H6qM7eoB8Vrk7/TAFuqNECgYEA7uOl
+oKyOxeLn005cenc5enY2IxDhXTaAjTGHE64C0lmicD2OZB7/b+ZIb8M5R7GnCNox
+4TxLSRhZYOMO/QcTrnSND5PXbX/HLd3nyQRIN1XtBbg7pJooxP/MQ/Ne5XTTMjCg
+qPudkOe0ZgUHEcuH8m/YAFY3DDJC50uiXqYtxYMCgYBHfL+ExbZHfGExyp9Duf/x
+PHhCmeJbMzessEnaPLF24FJgcm48YlTzAaMkG5zvIeS9BPIOOCPPSCAyWCn8BnxZ
+SuhBPM0TzpG067+0ijzjiswTuhN3Iy2kv6e5K+rz8MwqbamCQOKtsVehMub2rFFS
+jNiUosKgT8Oa9SBHq9arMQKBgQCE3EVEnFP3iOAILH/QeLiV/GLVk9DTR7mtTUtj
+zZayKLnoFMQ5uOe182x8BCa6UfqlOL0fGKqCZ7Fl6kJuxV3T2+yMKlxZAQTk5JLB
+wMjtRbPCR5mcTUS5c87GR/eSRCwlsNfZw775VXSGfOtWoUzlsACBB3IsLVP6UZ1n
+aKLyQwKBgC61BvKiyGBEYIchqMI4dSF+zCJbSjNUtjwVobcgC6yERZtX2OeLFCoh
+NEf9CcL2Eqb+RzwAD3OV65AiZcrThQNXZ8poBxvwWK8I6E6zB+LX7POAvNu/AV/5
+ANnxwHGGLqi+wTcdMZal2iXkdsrno1Ek/nGMCdA7IVs7l5k7fEpG
+-----END RSA PRIVATE KEY-----
diff --git a/tests/auto/core/qwebengineclientcertificatestore/resources/server.pem b/tests/auto/core/qwebengineclientcertificatestore/resources/server.pem
new file mode 100644
index 000000000..4706fa73e
--- /dev/null
+++ b/tests/auto/core/qwebengineclientcertificatestore/resources/server.pem
@@ -0,0 +1,22 @@
+-----BEGIN CERTIFICATE-----
+MIIDrzCCApcCFFNQAgGBu5nr81tUMdXXLGkm8Li/MA0GCSqGSIb3DQEBCwUAMIGU
+MQswCQYDVQQGEwJERTEPMA0GA1UECAwGQmVybGluMQ8wDQYDVQQHDAZCZXJsaW4x
+FzAVBgNVBAoMDlRoZSBRdCBDb21wYW55MRQwEgYDVQQLDAtRdFdlYkVuZ2luZTES
+MBAGA1UEAwwJd3d3LnF0LmlvMSAwHgYJKoZIhvcNAQkBFhFxdHdlYmVuZ2luZUBx
+dC5pbzAeFw0yMjExMTYxMjExMTRaFw0zMjExMTMxMjExMTRaMIGSMQswCQYDVQQG
+EwJERTEPMA0GA1UECAwGQmVybGluMQ8wDQYDVQQHDAZCZXJsaW4xFzAVBgNVBAoM
+DlRoZSBRdCBDb21wYW55MRQwEgYDVQQLDAtRdFdlYkVuZ2luZTEVMBMGA1UEAwwM
+c2VydmVyLnF0LmlvMRswGQYJKoZIhvcNAQkBFgxzZXJ2ZXJAcXQuaW8wggEiMA0G
+CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDmBCgmvJ6eOa/PLhFuod01ccrwaT/w
+u2jVLBPz5ZuHkTJhFO2EV2KhPUlhwh7dczA6bHdOMANjWMBcA995FyNOQxydnAXv
+oBdQrZeoEA2FobXCOyJvshIZT9Tn8lqubaLBAnnOMqw2bylliqmYqxgBUUwSu19y
+l0t1KnoEbnhKtsi1xeFYd+xSzly5USL2cJ66AuQPOg8uWP9N6i4pY53OHK8teQ+8
++YPj+EPR1QtNekINmF/vcC5AFZMaxZ5SclCJCENHC5daEZFfyoUlDivNjyshtoqG
+B74FDoEv6mKPa7Mco1CPXZksVmAuKEsMmiAanTzL1R3pG7/dYagWRjfzAgMBAAEw
+DQYJKoZIhvcNAQELBQADggEBAHotgaBbqIlG4EqjzSpX8kQnZnGJUsA51dbY3K5C
+4tNCd+JquQfPmCIKDHkRsmmEU6pcU+LT8m+toJ8Gx0XG4nrdUIDt0Nlf/QrykbPj
+hN8z+aSfP9J5tg4NsT7qMWmqUHOa3BcsgWcC4IwWVkbOMz/XbczEQqdBJMbE0+PC
+32ihTKPZBPC2QlIvXyuwupvQtcXgEjw1r2FQeYcmItk3CKbJPE/Rk4/aXSCo4b0F
+iXPphh8BJPZVvQ2cLpPaGvcse5qjIhF9ODb2HEK3myMwuJVi7teURy8mPlS23Li/
+8gRCNu/stjMlkic7d3dqV0LwaG8+Df1W2wzxsT7IkxN/Z+o=
+-----END CERTIFICATE-----
diff --git a/tests/auto/core/qwebengineclientcertificatestore/tst_qwebengineclientcertificatestore.cpp b/tests/auto/core/qwebengineclientcertificatestore/tst_qwebengineclientcertificatestore.cpp
index 6d51bf7af..7d82a5640 100644
--- a/tests/auto/core/qwebengineclientcertificatestore/tst_qwebengineclientcertificatestore.cpp
+++ b/tests/auto/core/qwebengineclientcertificatestore/tst_qwebengineclientcertificatestore.cpp
@@ -1,34 +1,14 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+#include <httpsserver.h>
+#include <util.h>
#include <QtTest/QtTest>
#include <QtWebEngineCore/qwebengineclientcertificatestore.h>
-#include <QtWebEngineWidgets/qwebengineprofile.h>
+#include <QtWebEngineCore/qwebenginepage.h>
+#include <QtWebEngineCore/qwebengineprofile.h>
+#include <QtWebEngineCore/qwebenginecertificateerror.h>
+#include <QtWebEngineCore/qwebenginesettings.h>
class tst_QWebEngineClientCertificateStore : public QObject
{
@@ -39,8 +19,12 @@ public:
~tst_QWebEngineClientCertificateStore();
private Q_SLOTS:
+ void init();
+ void cleanup();
void addAndListCertificates();
void removeAndClearCertificates();
+ void clientAuthentication_data();
+ void clientAuthentication();
};
tst_QWebEngineClientCertificateStore::tst_QWebEngineClientCertificateStore()
@@ -51,6 +35,19 @@ tst_QWebEngineClientCertificateStore::~tst_QWebEngineClientCertificateStore()
{
}
+void tst_QWebEngineClientCertificateStore::init()
+{
+ QCOMPARE(0,
+ QWebEngineProfile::defaultProfile()->clientCertificateStore()->certificates().size());
+}
+
+void tst_QWebEngineClientCertificateStore::cleanup()
+{
+ QWebEngineProfile::defaultProfile()->clientCertificateStore()->clear();
+ QCOMPARE(0,
+ QWebEngineProfile::defaultProfile()->clientCertificateStore()->certificates().size());
+}
+
void tst_QWebEngineClientCertificateStore::addAndListCertificates()
{
// Load QSslCertificate
@@ -77,21 +74,93 @@ void tst_QWebEngineClientCertificateStore::addAndListCertificates()
QWebEngineProfile::defaultProfile()->clientCertificateStore()->add(cert, sslKey);
QWebEngineProfile::defaultProfile()->clientCertificateStore()->add(certSecond, sslKeySecond);
- QCOMPARE(2, QWebEngineProfile::defaultProfile()->clientCertificateStore()->certificates().length());
+ QCOMPARE(2, QWebEngineProfile::defaultProfile()->clientCertificateStore()->certificates().size());
}
void tst_QWebEngineClientCertificateStore::removeAndClearCertificates()
{
- QCOMPARE(2, QWebEngineProfile::defaultProfile()->clientCertificateStore()->certificates().length());
+ addAndListCertificates();
+ QCOMPARE(2, QWebEngineProfile::defaultProfile()->clientCertificateStore()->certificates().size());
// Remove one certificate from in-memory store
auto list = QWebEngineProfile::defaultProfile()->clientCertificateStore()->certificates();
QWebEngineProfile::defaultProfile()->clientCertificateStore()->remove(list[0]);
- QCOMPARE(1, QWebEngineProfile::defaultProfile()->clientCertificateStore()->certificates().length());
+ QCOMPARE(1, QWebEngineProfile::defaultProfile()->clientCertificateStore()->certificates().size());
// Remove all certificates in-memory store
QWebEngineProfile::defaultProfile()->clientCertificateStore()->clear();
- QCOMPARE(0, QWebEngineProfile::defaultProfile()->clientCertificateStore()->certificates().length());
+ QCOMPARE(0, QWebEngineProfile::defaultProfile()->clientCertificateStore()->certificates().size());
+}
+
+void tst_QWebEngineClientCertificateStore::clientAuthentication_data()
+{
+ QTest::addColumn<QString>("client_certificate");
+ QTest::addColumn<QString>("client_key");
+ QTest::addColumn<bool>("in_memory");
+ QTest::addColumn<bool>("add_more_in_memory_certificates");
+ QTest::newRow("in_memory") << ":/resources/client.pem"
+ << ":/resources/client.key" << true << false;
+#if defined(TEST_NSS)
+ QTest::newRow("nss") << ":/resources/client2.pem"
+ << ":/resources/client2.key" << false << false;
+ QTest::newRow("in_memory + nss") << ":/resources/client2.pem"
+ << ":/resources/client2.key" << false << true;
+#endif
+}
+
+void tst_QWebEngineClientCertificateStore::clientAuthentication()
+{
+ QFETCH(QString, client_certificate);
+ QFETCH(QString, client_key);
+ QFETCH(bool, in_memory);
+ QFETCH(bool, add_more_in_memory_certificates);
+
+ HttpsServer server(":/resources/server.pem", ":/resources/server.key", ":resources/ca.pem");
+ server.setExpectError(false);
+ QVERIFY(server.start());
+
+ connect(&server, &HttpsServer::newRequest, [&](HttpReqRep *rr) {
+ rr->setResponseBody(QByteArrayLiteral("<html><body>TEST</body></html>"));
+ rr->sendResponse();
+ });
+
+ QFile certFile(client_certificate);
+ certFile.open(QIODevice::ReadOnly);
+ const QSslCertificate cert(certFile.readAll(), QSsl::Pem);
+
+ QFile keyFile(client_key);
+ keyFile.open(QIODevice::ReadOnly);
+ const QSslKey sslKey(keyFile.readAll(), QSsl::Rsa, QSsl::Pem, QSsl::PrivateKey, "");
+
+ if (in_memory)
+ QWebEngineProfile::defaultProfile()->clientCertificateStore()->add(cert, sslKey);
+
+ if (add_more_in_memory_certificates)
+ addAndListCertificates();
+
+ QWebEnginePage page;
+ connect(&page, &QWebEnginePage::certificateError, [](QWebEngineCertificateError e) {
+ // ca is self signed in this test simply accept the certificate error
+ e.acceptCertificate();
+ });
+ connect(&page, &QWebEnginePage::selectClientCertificate, &page,
+ [&cert](QWebEngineClientCertificateSelection selection) {
+ QVERIFY(!selection.certificates().isEmpty());
+ for (const QSslCertificate &sCert : selection.certificates()) {
+ if (cert == sCert) {
+ selection.select(sCert);
+ return;
+ }
+ }
+ QFAIL("No certificate found.");
+ });
+ QSignalSpy loadFinishedSpy(&page, SIGNAL(loadFinished(bool)));
+ page.settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, false);
+ page.setUrl(server.url());
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size() > 0, true, 20000);
+ QCOMPARE(loadFinishedSpy.takeFirst().at(0).toBool(), true);
+ QCOMPARE(toPlainTextSync(&page), QStringLiteral("TEST"));
+ QVERIFY(server.stop());
}
QTEST_MAIN(tst_QWebEngineClientCertificateStore)
diff --git a/tests/auto/core/qwebengineclientcertificatestore/tst_qwebengineclientcertificatestore.qrc b/tests/auto/core/qwebengineclientcertificatestore/tst_qwebengineclientcertificatestore.qrc
deleted file mode 100644
index db481fef6..000000000
--- a/tests/auto/core/qwebengineclientcertificatestore/tst_qwebengineclientcertificatestore.qrc
+++ /dev/null
@@ -1,8 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>resources/certificate.crt</file>
- <file>resources/privatekey.key</file>
- <file>resources/certificate1.crt</file>
- <file>resources/privatekey1.key</file>
- </qresource>
-</RCC>
diff --git a/tests/auto/core/qwebenginecookiestore/CMakeLists.txt b/tests/auto/core/qwebenginecookiestore/CMakeLists.txt
new file mode 100644
index 000000000..cc14940f1
--- /dev/null
+++ b/tests/auto/core/qwebenginecookiestore/CMakeLists.txt
@@ -0,0 +1,26 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+include(../../httpserver/httpserver.cmake)
+include(../../util/util.cmake)
+
+qt_internal_add_test(tst_qwebenginecookiestore
+ SOURCES
+ tst_qwebenginecookiestore.cpp
+ LIBRARIES
+ Qt::WebEngineCore
+ Test::HttpServer
+ Test::Util
+)
+
+set(tst_qwebenginecookiestore_resource_files
+ "resources/content.html"
+ "resources/index.html"
+)
+
+qt_internal_add_resource(tst_qwebenginecookiestore "tst_qwebenginecookiestore"
+ PREFIX
+ "/"
+ FILES
+ ${tst_qwebenginecookiestore_resource_files}
+)
diff --git a/tests/auto/core/qwebenginecookiestore/qwebenginecookiestore.pro b/tests/auto/core/qwebenginecookiestore/qwebenginecookiestore.pro
deleted file mode 100644
index e99c7f493..000000000
--- a/tests/auto/core/qwebenginecookiestore/qwebenginecookiestore.pro
+++ /dev/null
@@ -1 +0,0 @@
-include(../tests.pri)
diff --git a/tests/auto/core/qwebenginecookiestore/tst_qwebenginecookiestore.cpp b/tests/auto/core/qwebenginecookiestore/tst_qwebenginecookiestore.cpp
index 2c41aa9b1..3fff2cd45 100644
--- a/tests/auto/core/qwebenginecookiestore/tst_qwebenginecookiestore.cpp
+++ b/tests/auto/core/qwebenginecookiestore/tst_qwebenginecookiestore.cpp
@@ -1,37 +1,18 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "../../widgets/util.h"
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#include <util.h>
#include <QtTest/QtTest>
-#include <QtWebEngineCore/qwebenginecallback.h>
#include <QtWebEngineCore/qwebenginecookiestore.h>
-#include <QtWebEngineWidgets/qwebenginepage.h>
-#include <QtWebEngineWidgets/qwebengineprofile.h>
+#include <QtWebEngineCore/qwebengineprofile.h>
+#include <QtWebEngineCore/qwebenginepage.h>
+
+#include "httpserver.h"
+#include "httpreqrep.h"
+
+// locally overwrite the default timeout of QTY_(COMPARE|VERIFY)
+#define QWE_TRY_COMPARE(x, y) QTRY_COMPARE_WITH_TIMEOUT(x, y, 30000)
+#define QWE_TRY_VERIFY(x) QTRY_VERIFY_WITH_TIMEOUT(x, 30000)
class tst_QWebEngineCookieStore : public QObject
{
@@ -53,9 +34,11 @@ private Q_SLOTS:
// as it checks storage manipulation without navigation
void setAndDeleteCookie();
+ void setInvalidCookie();
void cookieSignals();
void batchCookieTasks();
void basicFilter();
+ void basicFilterOverHTTP();
void html5featureFilter();
private:
@@ -101,22 +84,22 @@ void tst_QWebEngineCookieStore::cookieSignals()
page.load(QUrl("qrc:///resources/index.html"));
- QTRY_COMPARE_WITH_TIMEOUT(loadSpy.count(), 1, 30000);
+ QWE_TRY_COMPARE(loadSpy.size(), 1);
QVariant success = loadSpy.takeFirst().takeFirst();
QVERIFY(success.toBool());
- QTRY_COMPARE(cookieAddedSpy.count(), 2);
+ QWE_TRY_COMPARE(cookieAddedSpy.size(), 2);
// try whether updating a cookie to be expired results in that cookie being removed.
QNetworkCookie expiredCookie(QNetworkCookie::parseCookies(QByteArrayLiteral("SessionCookie=delete; expires=Thu, 01-Jan-1970 00:00:00 GMT; path=///resources")).first());
client->setCookie(expiredCookie, QUrl("qrc:///resources/index.html"));
- QTRY_COMPARE(cookieRemovedSpy.count(), 1);
+ QWE_TRY_COMPARE(cookieRemovedSpy.size(), 1);
cookieRemovedSpy.clear();
// try removing the other cookie.
QNetworkCookie nonSessionCookie(QNetworkCookie::parseCookies(QByteArrayLiteral("CookieWithExpiresField=QtWebEngineCookieTest; path=///resources")).first());
client->deleteCookie(nonSessionCookie, QUrl("qrc:///resources/index.html"));
- QTRY_COMPARE(cookieRemovedSpy.count(), 1);
+ QWE_TRY_COMPARE(cookieRemovedSpy.size(), 1);
}
void tst_QWebEngineCookieStore::setAndDeleteCookie()
@@ -137,33 +120,64 @@ void tst_QWebEngineCookieStore::setAndDeleteCookie()
client->loadAllCookies();
// /* FIXME remove 'blank' navigation once loadAllCookies api is fixed
page.load(QUrl("about:blank"));
- QTRY_COMPARE_WITH_TIMEOUT(loadSpy.count(), 1, 30000);
+ QWE_TRY_COMPARE(loadSpy.size(), 1);
// */
// check if pending cookies are set and removed
client->setCookie(cookie1);
client->setCookie(cookie2);
- QTRY_COMPARE(cookieAddedSpy.count(), 2);
+ QWE_TRY_COMPARE(cookieAddedSpy.size(), 2);
client->deleteCookie(cookie1);
- QTRY_COMPARE(cookieRemovedSpy.count(), 1);
+ QWE_TRY_COMPARE(cookieRemovedSpy.size(), 1);
page.load(QUrl("qrc:///resources/content.html"));
- QTRY_COMPARE_WITH_TIMEOUT(loadSpy.count(), 2, 30000);
+ QWE_TRY_COMPARE(loadSpy.size(), 2);
QVariant success = loadSpy.takeFirst().takeFirst();
QVERIFY(success.toBool());
- QTRY_COMPARE(cookieAddedSpy.count(), 2);
- QTRY_COMPARE(cookieRemovedSpy.count(), 1);
+ QWE_TRY_COMPARE(cookieAddedSpy.size(), 2);
+ QWE_TRY_COMPARE(cookieRemovedSpy.size(), 1);
cookieAddedSpy.clear();
cookieRemovedSpy.clear();
client->setCookie(cookie3);
- QTRY_COMPARE(cookieAddedSpy.count(), 1);
+ QWE_TRY_COMPARE(cookieAddedSpy.size(), 1);
// updating a cookie with an expired 'expires' field should remove the cookie with the same name
client->setCookie(expiredCookie3);
client->deleteCookie(cookie2);
- QTRY_COMPARE(cookieAddedSpy.count(), 1);
- QTRY_COMPARE(cookieRemovedSpy.count(), 2);
+ QWE_TRY_COMPARE(cookieAddedSpy.size(), 1);
+ QWE_TRY_COMPARE(cookieRemovedSpy.size(), 2);
+}
+
+void tst_QWebEngineCookieStore::setInvalidCookie()
+{
+ QWebEnginePage page(m_profile);
+ QWebEngineCookieStore *client = m_profile->cookieStore();
+
+ QSignalSpy loadSpy(&page, SIGNAL(loadFinished(bool)));
+ QSignalSpy cookieAddedSpy(client, SIGNAL(cookieAdded(const QNetworkCookie &)));
+ QSignalSpy cookieRemovedSpy(client, SIGNAL(cookieRemoved(const QNetworkCookie &)));
+
+ QNetworkCookie goodCookie(
+ QNetworkCookie::parseCookies(
+ QByteArrayLiteral("khaos=I9GX8CWI; Domain=.example.com; Path=/docs"))
+ .first());
+ QNetworkCookie badCookie(
+ QNetworkCookie::parseCookies(QByteArrayLiteral("TestCookie=foo\tbar;")).first());
+
+ // force to init storage as it's done lazily upon first navigation
+ client->loadAllCookies();
+ // /* FIXME remove 'blank' navigation once loadAllCookies api is fixed
+ page.load(QUrl("about:blank"));
+ QWE_TRY_COMPARE(loadSpy.size(), 1);
+ // */
+
+ client->setCookie(badCookie);
+ client->setCookie(goodCookie);
+ client->deleteCookie(goodCookie);
+ // by the time the second cookie is removed, only one cookie should have been added
+ QWE_TRY_COMPARE(cookieRemovedSpy.size(), 1);
+ QWE_TRY_COMPARE(cookieAddedSpy.size(), 1);
}
void tst_QWebEngineCookieStore::batchCookieTasks()
@@ -182,29 +196,29 @@ void tst_QWebEngineCookieStore::batchCookieTasks()
client->loadAllCookies();
// /* FIXME remove 'blank' navigation once loadAllCookies api is fixed
page.load(QUrl("about:blank"));
- QTRY_COMPARE_WITH_TIMEOUT(loadSpy.count(), 1, 30000);
+ QWE_TRY_COMPARE(loadSpy.size(), 1);
// */
client->setCookie(cookie1);
client->setCookie(cookie2);
- QTRY_COMPARE(cookieAddedSpy.count(), 2);
+ QWE_TRY_COMPARE(cookieAddedSpy.size(), 2);
page.load(QUrl("qrc:///resources/index.html"));
- QTRY_COMPARE_WITH_TIMEOUT(loadSpy.count(), 2, 30000);
+ QWE_TRY_COMPARE(loadSpy.size(), 2);
QVariant success = loadSpy.takeFirst().takeFirst();
QVERIFY(success.toBool());
- QTRY_COMPARE(cookieAddedSpy.count(), 4);
- QTRY_COMPARE(cookieRemovedSpy.count(), 0);
+ QWE_TRY_COMPARE(cookieAddedSpy.size(), 4);
+ QWE_TRY_COMPARE(cookieRemovedSpy.size(), 0);
cookieAddedSpy.clear();
cookieRemovedSpy.clear();
client->deleteSessionCookies();
- QTRY_COMPARE(cookieRemovedSpy.count(), 3);
+ QWE_TRY_COMPARE(cookieRemovedSpy.size(), 3);
client->deleteAllCookies();
- QTRY_COMPARE(cookieRemovedSpy.count(), 4);
+ QWE_TRY_COMPARE(cookieRemovedSpy.size(), 4);
}
void tst_QWebEngineCookieStore::basicFilter()
@@ -221,22 +235,112 @@ void tst_QWebEngineCookieStore::basicFilter()
page.load(QUrl("qrc:///resources/index.html"));
- QTRY_COMPARE_WITH_TIMEOUT(loadSpy.count(), 1, 30000);
+ QWE_TRY_COMPARE(loadSpy.size(), 1);
QVERIFY(loadSpy.takeFirst().takeFirst().toBool());
- QTRY_COMPARE(cookieAddedSpy.count(), 2);
- QTRY_COMPARE(accessTested.loadAcquire(), 2); // FIXME?
+ QWE_TRY_COMPARE(cookieAddedSpy.size(), 2);
+ QWE_TRY_COMPARE(accessTested.loadAcquire(), 2); // FIXME?
client->deleteAllCookies();
- QTRY_COMPARE(cookieRemovedSpy.count(), 2);
+ QWE_TRY_COMPARE(cookieRemovedSpy.size(), 2);
client->setCookieFilter([&](const QWebEngineCookieStore::FilterRequest &){ ++accessTested; return false; });
page.triggerAction(QWebEnginePage::ReloadAndBypassCache);
- QTRY_COMPARE(loadSpy.count(), 1);
+ QWE_TRY_COMPARE(loadSpy.size(), 1);
+ QVERIFY(loadSpy.takeFirst().takeFirst().toBool());
+ QWE_TRY_COMPARE(accessTested.loadAcquire(), 4); // FIXME?
+ // Test cookies are NOT added:
+ QTest::qWait(100);
+ QCOMPARE(cookieAddedSpy.size(), 2);
+}
+
+void tst_QWebEngineCookieStore::basicFilterOverHTTP()
+{
+ QWebEnginePage page(m_profile);
+ QWebEngineCookieStore *client = m_profile->cookieStore();
+
+ QAtomicInt accessTested = 0;
+ QList<QPair<QUrl, QUrl>> resourceFirstParty;
+ client->setCookieFilter([&](const QWebEngineCookieStore::FilterRequest &request) {
+ resourceFirstParty.append(qMakePair(request.origin, request.firstPartyUrl));
+ ++accessTested;
+ return true;
+ });
+
+ HttpServer httpServer;
+ httpServer.setHostDomain(QString("sub.test.localhost"));
+ QVERIFY(httpServer.start());
+
+ QByteArray cookieRequestHeader;
+ connect(&httpServer, &HttpServer::newRequest, [&cookieRequestHeader](HttpReqRep *rr) {
+ if (rr->requestMethod() == "GET" && rr->requestPath() == "/test.html") {
+ cookieRequestHeader = rr->requestHeader(QByteArrayLiteral("Cookie"));
+ if (cookieRequestHeader.isEmpty())
+ rr->setResponseHeader(QByteArrayLiteral("Set-Cookie"), QByteArrayLiteral("Test=test"));
+ rr->setResponseBody("<head><link rel='icon' type='image/png' href='resources/Fav.png'/>"
+ "<title>Page with a favicon and an icon</title></head>"
+ "<body><img src='resources/Img.ico'></body>");
+ rr->sendResponse();
+ }
+ });
+
+ QSignalSpy loadSpy(&page, SIGNAL(loadFinished(bool)));
+ QSignalSpy cookieAddedSpy(client, SIGNAL(cookieAdded(const QNetworkCookie &)));
+ QSignalSpy cookieRemovedSpy(client, SIGNAL(cookieRemoved(const QNetworkCookie &)));
+ QSignalSpy serverSpy(&httpServer, SIGNAL(newRequest(HttpReqRep *)));
+
+ QUrl firstPartyUrl = httpServer.url("/test.html");
+ page.load(firstPartyUrl);
+
+ QWE_TRY_COMPARE(loadSpy.size(), 1);
+ QVERIFY(loadSpy.takeFirst().takeFirst().toBool());
+ QWE_TRY_COMPARE(cookieAddedSpy.size(), 1);
+ QWE_TRY_COMPARE(accessTested.loadAcquire(), 4);
+ QVERIFY(cookieRequestHeader.isEmpty());
+
+ QWE_TRY_COMPARE(serverSpy.size(), 3);
+
+ page.triggerAction(QWebEnginePage::Reload);
+ QWE_TRY_COMPARE(loadSpy.size(), 1);
+ QVERIFY(loadSpy.takeFirst().takeFirst().toBool());
+ QVERIFY(!cookieRequestHeader.isEmpty());
+ QWE_TRY_COMPARE(cookieAddedSpy.size(), 1);
+ QWE_TRY_COMPARE(accessTested.loadAcquire(), 6);
+
+ QWE_TRY_COMPARE(serverSpy.size(), 5);
+
+ client->deleteAllCookies();
+ QWE_TRY_COMPARE(cookieRemovedSpy.size(), 1);
+
+ client->setCookieFilter([&](const QWebEngineCookieStore::FilterRequest &request) {
+ resourceFirstParty.append(qMakePair(request.origin, request.firstPartyUrl));
+ ++accessTested;
+ return false;
+ });
+ page.triggerAction(QWebEnginePage::ReloadAndBypassCache);
+ QWE_TRY_COMPARE(loadSpy.size(), 1);
QVERIFY(loadSpy.takeFirst().takeFirst().toBool());
- QTRY_COMPARE(accessTested.loadAcquire(), 4); // FIXME?
+ QVERIFY(cookieRequestHeader.isEmpty());
// Test cookies are NOT added:
QTest::qWait(100);
- QCOMPARE(cookieAddedSpy.count(), 2);
+ QCOMPARE(cookieAddedSpy.size(), 1);
+ QWE_TRY_COMPARE(accessTested.loadAcquire(), 9);
+
+ QWE_TRY_COMPARE(serverSpy.size(), 7);
+
+ page.triggerAction(QWebEnginePage::Reload);
+ QWE_TRY_COMPARE(loadSpy.size(), 1);
+ QVERIFY(loadSpy.takeFirst().takeFirst().toBool());
+ QVERIFY(cookieRequestHeader.isEmpty());
+ QCOMPARE(cookieAddedSpy.size(), 1);
+
+ // Wait for last GET /favicon.ico
+ QWE_TRY_COMPARE(serverSpy.size(), 9);
+ (void) httpServer.stop();
+
+ QCOMPARE(resourceFirstParty.size(), accessTested.loadAcquire());
+ for (auto &&p : std::as_const(resourceFirstParty))
+ QVERIFY2(p.second == firstPartyUrl,
+ qPrintable(QString("Resource [%1] has wrong firstPartyUrl: %2").arg(p.first.toString(), p.second.toString())));
}
void tst_QWebEngineCookieStore::html5featureFilter()
@@ -251,17 +355,17 @@ void tst_QWebEngineCookieStore::html5featureFilter()
page.load(QUrl("qrc:///resources/content.html"));
- QTRY_COMPARE_WITH_TIMEOUT(loadSpy.count(), 1, 30000);
+ QWE_TRY_COMPARE(loadSpy.size(), 1);
QVERIFY(loadSpy.takeFirst().takeFirst().toBool());
QCOMPARE(accessTested.loadAcquire(), 0); // FIXME?
QTest::ignoreMessage(QtCriticalMsg, QRegularExpression(".*Uncaught SecurityError.*sessionStorage.*"));
page.runJavaScript("sessionStorage.test = 5;");
- QTRY_COMPARE(accessTested.loadAcquire(), 1);
+ QWE_TRY_COMPARE(accessTested.loadAcquire(), 1);
QTest::ignoreMessage(QtCriticalMsg, QRegularExpression(".*Uncaught SecurityError.*sessionStorage.*"));
QAtomicInt callbackTriggered = 0;
page.runJavaScript("sessionStorage.test", [&](const QVariant &v) { QVERIFY(!v.isValid()); callbackTriggered = 1; });
- QTRY_VERIFY(callbackTriggered);
+ QWE_TRY_VERIFY(callbackTriggered);
}
QTEST_MAIN(tst_QWebEngineCookieStore)
diff --git a/tests/auto/core/qwebenginecookiestore/tst_qwebenginecookiestore.qrc b/tests/auto/core/qwebenginecookiestore/tst_qwebenginecookiestore.qrc
deleted file mode 100644
index afeae268b..000000000
--- a/tests/auto/core/qwebenginecookiestore/tst_qwebenginecookiestore.qrc
+++ /dev/null
@@ -1,6 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
-<qresource>
- <file>resources/index.html</file>
- <file>resources/content.html</file>
-</qresource>
-</RCC>
diff --git a/tests/auto/core/qwebengineglobalsettings/CMakeLists.txt b/tests/auto/core/qwebengineglobalsettings/CMakeLists.txt
new file mode 100644
index 000000000..fa81ba8df
--- /dev/null
+++ b/tests/auto/core/qwebengineglobalsettings/CMakeLists.txt
@@ -0,0 +1,29 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+include(../../httpserver/httpserver.cmake)
+include(../../util/util.cmake)
+
+qt_internal_add_test(tst_qwebengineglobalsettings
+ SOURCES
+ tst_qwebengineglobalsettings.cpp
+ LIBRARIES
+ Qt::WebEngineCore
+ Test::HttpServer
+ Qt::WebEngineWidgets
+ Test::Util
+)
+
+# Resources:
+set(tst_qwebengineglobalsettings_resource_files
+ "cert/localhost.crt"
+ "cert/localhost.key"
+ "cert/RootCA.pem"
+)
+
+qt_add_resources(tst_qwebengineglobalsettings "tst_qwebengineglobalsettings"
+ PREFIX
+ "/"
+ FILES
+ ${tst_qwebengineglobalsettings_resource_files}
+)
diff --git a/tests/auto/core/qwebengineglobalsettings/cert/RootCA.pem b/tests/auto/core/qwebengineglobalsettings/cert/RootCA.pem
new file mode 100644
index 000000000..16be384bb
--- /dev/null
+++ b/tests/auto/core/qwebengineglobalsettings/cert/RootCA.pem
@@ -0,0 +1,20 @@
+-----BEGIN CERTIFICATE-----
+MIIDTzCCAjegAwIBAgIUNYpmREIW67Fh7WNzCwPL6nnSgRMwDQYJKoZIhvcNAQEL
+BQAwNzELMAkGA1UEBhMCREUxKDAmBgNVBAMMH1dlYkVuZ2luZUdsb2JhbFNldHRp
+bmdzLVRlc3QtQ0EwHhcNMjMwMzI5MTYwMzMzWhcNMjYwMTE2MTYwMzMzWjA3MQsw
+CQYDVQQGEwJERTEoMCYGA1UEAwwfV2ViRW5naW5lR2xvYmFsU2V0dGluZ3MtVGVz
+dC1DQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJhZ9DwcdbVBzMyY
+/nEqt5KUi74LFwEnS0G2ne8IYco9+Pbkpb8wV5u6n43IsQ2c3u8D/KVtu1Vy3tf2
+G3aKOwhFzaj7GWLE9FweZyMoL6ASOtWEa55myT5zAysVQtHAkePu0smAPP0gVq3E
+vjSTwV1W1mVXv4wMwffR8AvNGhKrJIa3L2/uYKGbzEmaCk2kt0vIqfrx8095RlXC
+lUcwTMJ6/d/e/DMDtqQ1ypUuz5QYQybIVKwuqkhojT2DXbitv0rE4HLQub8CxOZ+
+9GcQjeAt8Tzrlp1UP6c9OtlsMoo37gJYzb/XDE6OPnk42chQXDxGQjtVRs+60kcT
+Dx/YHG0CAwEAAaNTMFEwHQYDVR0OBBYEFP1FK1U9CUHQEp7coaab7IdR18zDMB8G
+A1UdIwQYMBaAFP1FK1U9CUHQEp7coaab7IdR18zDMA8GA1UdEwEB/wQFMAMBAf8w
+DQYJKoZIhvcNAQELBQADggEBAGTlcxmRsuwBeRW0CsjX/qbdcB0OWkIC857Jn8RU
+6yGa7P9i6EQb1O/DEF+Z7dkASx5zfN6LPIrph6J56/mmcNBeqArovWJwxQUTNO9i
+1kOU3xoH5n/ya+gdBr3reA90bAMKWXwa6uI3smPJKy+2hOkdDaSBa5KECYWhniH0
+yRxL7YdhQhuCc7Ijf+S6WzeHRwdLkdiV8c2vAGWdunDFuGT2iYVOZ1qbp6O/tmjv
+TxWAnvP4+0ykFIlMor0vYWD8xbnq28263VmNh7mrFwkBYnHJiY/nTDwxaL+g6Uji
+9n6+VuxUDgfQWX1YRHC4a89zI/Zvnn2z/92To7zRmNd73RQ=
+-----END CERTIFICATE-----
diff --git a/tests/auto/core/qwebengineglobalsettings/cert/localhost.crt b/tests/auto/core/qwebengineglobalsettings/cert/localhost.crt
new file mode 100644
index 000000000..c063bf268
--- /dev/null
+++ b/tests/auto/core/qwebengineglobalsettings/cert/localhost.crt
@@ -0,0 +1,22 @@
+-----BEGIN CERTIFICATE-----
+MIIDtDCCApygAwIBAgIURotPFTfDJxwaqhZsr0IpAahl2EMwDQYJKoZIhvcNAQEL
+BQAwNzELMAkGA1UEBhMCREUxKDAmBgNVBAMMH1dlYkVuZ2luZUdsb2JhbFNldHRp
+bmdzLVRlc3QtQ0EwHhcNMjMwMzI5MTYwNDI1WhcNMjYwMTE2MTYwNDI1WjB0MQsw
+CQYDVQQGEwJERTEPMA0GA1UECAwGQmVybGluMQ8wDQYDVQQHDAZCZXJsaW4xKTAn
+BgNVBAoMIFFXZWJFbmdpbmVHbG9iYWxTZXR0aW5ncy1FeGFtcGxlMRgwFgYDVQQD
+DA9sb2NhbGhvc3QubG9jYWwwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB
+AQCY9FX/8YetuJKSFSoYPxMKPvjt2zJ5g13DywqZtbDzLAIASCxn4iad3qgxaoWB
+uI0g4ykzrhUa98YHU8fDH4T4Vwhwu72SRYW4+MgT9ohc1oCKBX05b+BWSuTSeuHy
+leqdL78bj3bu5TtFs2dJt2t8eA6SNR9lDa5g4v7oA4xVp93gMo2YqZwaLONmxIKY
+cI4lcETnHHsvc6+dB2UqWHJEN75UkdC/XnDLM/VbL3/4zxU+9x34nvvfSJwCHVnE
+u+zYwrZXkbiDVDovT855phVC/K5skVgBL2miz3eygljuw1tIwnmVix/e/xHZyqMg
+Lje/LZN53v5G61Wut6bbdkeVAgMBAAGjezB5MB8GA1UdIwQYMBaAFP1FK1U9CUHQ
+Ep7coaab7IdR18zDMAkGA1UdEwQCMAAwCwYDVR0PBAQDAgTwMB8GA1UdEQQYMBaC
+CWxvY2FsaG9zdIIJMTI3LjAuMC4xMB0GA1UdDgQWBBQv20ImViFtvMm5gHqTeML6
+pi5BtTANBgkqhkiG9w0BAQsFAAOCAQEAGsL7eOms30+IPdKQZ2pjtX22GfM6EiUs
+xsQfsX/Q3bus30B2m9GJ6AVIwVUJimOGiMauDCLjDeXWCMZpihzodExhC0D/X1B+
+FsCLagcjlgfWwekKEo8sUWUZp0DNCyacPtTPxqoS2RA7foEzQhRLViLSvf+UXU8g
+jZAwWGB/5V849zcbbNBcWKzRsPvNOqeENWEn1ByGcsWhas2V0KzRcUODuA9UHv1x
++eDlLZYsWV9c1MuL8a1VDEluIR19eR/Gl9axjPZY2oiPvlp2b7I4z1bY+wV2i6vh
+NeDCAxAxJ42tXeb86vtnVXfSDbzedDbLv0l2kEhcywVN3MwhsEpmpg==
+-----END CERTIFICATE-----
diff --git a/tests/auto/core/qwebengineglobalsettings/cert/localhost.key b/tests/auto/core/qwebengineglobalsettings/cert/localhost.key
new file mode 100644
index 000000000..49502ab9a
--- /dev/null
+++ b/tests/auto/core/qwebengineglobalsettings/cert/localhost.key
@@ -0,0 +1,28 @@
+-----BEGIN PRIVATE KEY-----
+MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCY9FX/8YetuJKS
+FSoYPxMKPvjt2zJ5g13DywqZtbDzLAIASCxn4iad3qgxaoWBuI0g4ykzrhUa98YH
+U8fDH4T4Vwhwu72SRYW4+MgT9ohc1oCKBX05b+BWSuTSeuHyleqdL78bj3bu5TtF
+s2dJt2t8eA6SNR9lDa5g4v7oA4xVp93gMo2YqZwaLONmxIKYcI4lcETnHHsvc6+d
+B2UqWHJEN75UkdC/XnDLM/VbL3/4zxU+9x34nvvfSJwCHVnEu+zYwrZXkbiDVDov
+T855phVC/K5skVgBL2miz3eygljuw1tIwnmVix/e/xHZyqMgLje/LZN53v5G61Wu
+t6bbdkeVAgMBAAECggEAF7ADX5NivUsv29LORZoDE1ukRoXjX8Ex9MANoLdsM4S1
+vKBwzBfQfjN83cZO7cOMi7LSby//EcGcmAboEXZgq+siof7ZQX1l07snlTvha2tG
+1dk6xvnmBscrf9NLCbwg7P33fUevFhlHICjEDr0KtuiK7Sav+YDwaA3Ph1QBWERd
+GO3sVlnuGsDpf/0GijlwqEGuDKUePEEANOhXcByh693VmvlKVf9SbrimYeunKW1O
+FvvcAiBMzqurhZotb9/juiq+fIMID29OULCCxlZZSySRYw0REpnAAxgWvaSZqyWd
+tGosSKEgc4SptPTmC8DzRDDfN/zqvXmkmYnN9o4qMwKBgQC3tVYdEPn3fHX973Df
+Ukp55cRpZFuNxjOiV3Qo1aTAKqpbmJ4/x8tUL7rhsmJXSxlW7xdNQ/WIHM1PJlZx
+UAIr5eBq1MUVd5OENP8PuVIdAIumHXICB5FioJR/WnXRXLJEbGxSRr5gwaTw3sXd
+ObPRQEUOrJtK+W0aeBKePRtIiwKBgQDVJN7A26vy8PMcE4TcDp75vAY/qasZl6ES
+oksaHf3c4/jsnr70wRoOXi3fPo/DpWmVFylttMSEnzh3nfnOkDXZD3mQx3sdVw8l
+12++t59733hllJZlwqk5OAc990kE1X44UW/gPA+5Vb9kpo6ahpFtqwhDmqa4RjtZ
+0R/1H/KUXwKBgGjR7Qq0rwwJVgHIZ2zlNV2MPp+sBZlFaBzPLZZHILQNJBsTX+gg
+heHJQiaZdAc+8Hxr+624gxZg6LyqsVQCRNrrVTtfn/x5uBANdSNxqGqn7wafcne5
+/bh6y4BHC0akT4s/Gidv+hyXIRfW5Ksvy2wv8bdHwWvsGdaqgGUNlM21AoGAe9Vc
+BbibAh6zYBCHFEL6YiW3i61L1yadUnIwKBBcucVJjk/8qb63ILne9OEoLYcg/Jnk
+W/S2aEcJS5Xg2P44CtBO1KrRAI7gIiA0sB2G7zU6gen+J0kdgDzpGDtflQtktdu6
+oBDFIeyLsjKCj4y3WXwQ5RYo3s8PFHPHmWbiTQkCgYBViqAHaAaPJQZG7Q6/Xqhf
+rFosC0DeZk5PHrEDbpAnuJbySafGZ4LxY5Oq05+aM8BeR+IuGopciBBDWXoh7msO
+N8WItu7WI86lIu7JZRbeju2w59tgj0EA+GyU1udPjTjseP5qpB27X1JEGV6TYBNs
+LMmQSgdGWqwteKsc50UrkA==
+-----END PRIVATE KEY-----
diff --git a/tests/auto/core/qwebengineglobalsettings/tst_qwebengineglobalsettings.cpp b/tests/auto/core/qwebengineglobalsettings/tst_qwebengineglobalsettings.cpp
new file mode 100644
index 000000000..0af85a711
--- /dev/null
+++ b/tests/auto/core/qwebengineglobalsettings/tst_qwebengineglobalsettings.cpp
@@ -0,0 +1,121 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#include <QtTest>
+#include <widgetutil.h>
+#include <QWebEngineProfile>
+#include <QWebEnginePage>
+#include <QWebEngineGlobalSettings>
+#include <QWebEngineLoadingInfo>
+
+#include "httpsserver.h"
+#include "httpreqrep.h"
+
+class tst_QWebEngineGlobalSettings : public QObject
+{
+ Q_OBJECT
+
+public:
+ tst_QWebEngineGlobalSettings() { }
+ ~tst_QWebEngineGlobalSettings() { }
+
+public Q_SLOTS:
+ void init() { }
+ void cleanup() { }
+
+private Q_SLOTS:
+ void initTestCase() { }
+ void cleanupTestCase() { }
+ void dnsOverHttps_data();
+ void dnsOverHttps();
+};
+
+Q_LOGGING_CATEGORY(lc, "qt.webengine.tests")
+
+void tst_QWebEngineGlobalSettings::dnsOverHttps_data()
+{
+ QTest::addColumn<QWebEngineGlobalSettings::SecureDnsMode>("dnsMode");
+ QTest::addColumn<QString>("uriTemplate");
+ QTest::addColumn<bool>("isMockDnsServerCalledExpected");
+ QTest::addColumn<bool>("isDnsResolutionSuccessExpected");
+ QTest::addColumn<bool>("isConfigurationSuccessExpected");
+ QTest::newRow("DnsMode::SystemOnly (no DoH server)")
+ << QWebEngineGlobalSettings::SecureDnsMode::SystemOnly << QStringLiteral("") << false
+ << true << true;
+ QTest::newRow("DnsMode::SecureOnly (mock DoH server)")
+ << QWebEngineGlobalSettings::SecureDnsMode::SecureOnly
+ << QStringLiteral("https://127.0.0.1:3000/dns-query{?dns}") << true << false << true;
+ QTest::newRow("DnsMode::SecureOnly (real DoH server)")
+ << QWebEngineGlobalSettings::SecureDnsMode::SecureOnly
+ << QStringLiteral("https://dns.google/dns-query{?dns}") << false << true << true;
+ QTest::newRow("DnsMode::SecureOnly (Empty URI Templates)")
+ << QWebEngineGlobalSettings::SecureDnsMode::SecureOnly << QStringLiteral("") << false
+ << false << false;
+ // Note: In the following test, we can't verify that the DoH server is called first and
+ // afterwards insecure DNS is tried, because for the DoH server to ever be used when the DNS
+ // mode is set to DnsMode::WithFallback, Chromium starts an asynchronous DoH server DnsProbe and
+ // requires that the connection is successful. That is, we'd have to implement a correct
+ // DNS response, which in turn requires that certificate errors aren't ignored and
+ // non-self-signed certificates are used for correct encryption. Instead of implementing
+ // all of that, this test verifies that Chromium tries probing the configured DoH server only.
+ QTest::newRow("DnsMode::SecureWithFallback (mock DoH server)")
+ << QWebEngineGlobalSettings::SecureDnsMode::SecureWithFallback
+ << QStringLiteral("https://127.0.0.1:3000/dns-query{?dns}") << true << true << true;
+ QTest::newRow("DnsMode::SecureWithFallback (Empty URI Templates)")
+ << QWebEngineGlobalSettings::SecureDnsMode::SecureWithFallback << QStringLiteral("")
+ << false << false << false;
+}
+
+void tst_QWebEngineGlobalSettings::dnsOverHttps()
+{
+ QFETCH(QWebEngineGlobalSettings::SecureDnsMode, dnsMode);
+ QFETCH(QString, uriTemplate);
+ QFETCH(bool, isMockDnsServerCalledExpected);
+ QFETCH(bool, isDnsResolutionSuccessExpected);
+ QFETCH(bool, isConfigurationSuccessExpected);
+ bool isMockDnsServerCalled = false;
+ bool isLoadSuccessful = false;
+
+ bool configurationSuccess =
+ QWebEngineGlobalSettings::setDnsMode({ dnsMode, QStringList{ uriTemplate } });
+ QCOMPARE(configurationSuccess, isConfigurationSuccessExpected);
+
+ if (!configurationSuccess) {
+ // In this case, DNS has invalid configuration, so the DNS change transaction is not
+ // triggered and the result of the DNS resolution depends on the current DNS mode, which is
+ // set by the previous run of this function.
+ return;
+ }
+ HttpsServer httpsServer(":/cert/localhost.crt", ":/cert/localhost.key", ":/cert/RootCA.pem",
+ 3000, this);
+ QObject::connect(&httpsServer, &HttpsServer::newRequest, this,
+ [&isMockDnsServerCalled](HttpReqRep *rr) {
+ QVERIFY(rr->requestPath().contains(QByteArrayLiteral("/dns-query?dns=")));
+ isMockDnsServerCalled = true;
+ rr->close();
+ });
+ QVERIFY(httpsServer.start());
+ httpsServer.setExpectError(isMockDnsServerCalledExpected);
+ httpsServer.setVerifyMode(QSslSocket::PeerVerifyMode::VerifyNone);
+
+ QWebEngineProfile profile;
+ QWebEnginePage page(&profile);
+ QSignalSpy loadSpy(&page, SIGNAL(loadFinished(bool)));
+
+ connect(&page, &QWebEnginePage::loadFinished, this,
+ [&isLoadSuccessful](bool ok) { isLoadSuccessful = ok; });
+
+ page.load(QUrl("https://google.com/"));
+ if (!loadSpy.wait(20000)) {
+ QSKIP("Couldn't load page from network, skipping test.");
+ }
+
+ QTRY_COMPARE(isMockDnsServerCalled, isMockDnsServerCalledExpected);
+ QCOMPARE(isLoadSuccessful, isDnsResolutionSuccessExpected);
+ QVERIFY(httpsServer.stop());
+}
+
+static QByteArrayList params = QByteArrayList() << "--ignore-certificate-errors";
+
+W_QTEST_MAIN(tst_QWebEngineGlobalSettings, params)
+#include "tst_qwebengineglobalsettings.moc"
diff --git a/tests/auto/core/qwebengineloadinginfo/CMakeLists.txt b/tests/auto/core/qwebengineloadinginfo/CMakeLists.txt
new file mode 100644
index 000000000..09d9c30f5
--- /dev/null
+++ b/tests/auto/core/qwebengineloadinginfo/CMakeLists.txt
@@ -0,0 +1,10 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_test(tst_qwebengineloadinginfo
+ SOURCES
+ tst_qwebengineloadinginfo.cpp
+ LIBRARIES
+ Qt::WebEngineCore
+ Test::HttpServer
+)
diff --git a/tests/auto/core/qwebengineloadinginfo/tst_qwebengineloadinginfo.cpp b/tests/auto/core/qwebengineloadinginfo/tst_qwebengineloadinginfo.cpp
new file mode 100644
index 000000000..ccae7436b
--- /dev/null
+++ b/tests/auto/core/qwebengineloadinginfo/tst_qwebengineloadinginfo.cpp
@@ -0,0 +1,93 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#include <QtTest/QtTest>
+#include <QtWebEngineCore/qwebengineprofile.h>
+#include <QtWebEngineCore/qwebenginepage.h>
+#include <QtWebEngineCore/qwebengineloadinginfo.h>
+#include <QtWebEngineCore/qwebenginehttprequest.h>
+#include <QtWebEngineCore/qwebenginesettings.h>
+
+#include <httpserver.h>
+#include <httpreqrep.h>
+
+typedef QMultiMap<QByteArray, QByteArray> Map;
+
+class tst_QWebEngineLoadingInfo : public QObject
+{
+ Q_OBJECT
+
+public:
+ tst_QWebEngineLoadingInfo() { }
+
+public slots:
+ void loadingInfoChanged(QWebEngineLoadingInfo loadingInfo)
+ {
+ const auto responseHeaders = loadingInfo.responseHeaders();
+ QFETCH(Map, expected);
+
+ if (loadingInfo.status() == QWebEngineLoadingInfo::LoadSucceededStatus
+ || loadingInfo.status() == QWebEngineLoadingInfo::LoadFailedStatus) {
+ if (!expected.empty())
+ QCOMPARE(responseHeaders, expected);
+ } else {
+ QVERIFY(responseHeaders.size() == 0);
+ }
+ }
+
+private Q_SLOTS:
+ void responseHeaders_data()
+ {
+ QTest::addColumn<int>("responseCode");
+ QTest::addColumn<Map>("input");
+ QTest::addColumn<Map>("expected");
+
+ const Map empty;
+ const Map input {
+ std::make_pair("header1", "value1"),
+ std::make_pair("header2", "value2")
+ };
+ const Map expected {
+ std::make_pair("header1", "value1"),
+ std::make_pair("header2", "value2"),
+ std::make_pair("Connection", "close")
+ };
+
+
+ QTest::newRow("with headers HTTP 200") << 200 << input << expected;
+ QTest::newRow("with headers HTTP 500") << 500 << input << expected;
+ QTest::newRow("without headers HTTP 200") << 200 << empty << empty;
+ QTest::newRow("without headers HTTP 500") << 500 << empty << empty;
+ }
+
+ void responseHeaders()
+ {
+ HttpServer httpServer;
+
+ QFETCH(Map, input);
+ QFETCH(int, responseCode);
+ QObject::connect(&httpServer, &HttpServer::newRequest, this, [&](HttpReqRep *rr) {
+ for (auto it = input.cbegin(); it != input.cend(); ++it)
+ rr->setResponseHeader(it.key(), it.value());
+
+ rr->sendResponse(responseCode);
+ });
+ QVERIFY(httpServer.start());
+
+ QWebEngineProfile profile;
+ QWebEnginePage page(&profile);
+ page.settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, false);
+ QSignalSpy spy(&page, SIGNAL(loadFinished(bool)));
+ QObject::connect(&page, &QWebEnginePage::loadingChanged, this, &tst_QWebEngineLoadingInfo::loadingInfoChanged);
+
+
+ QWebEngineHttpRequest request(httpServer.url("/somepage.html"));
+ page.load(request);
+
+ QTRY_VERIFY(spy.count() > 0);
+ QVERIFY(httpServer.stop());
+ }
+};
+
+QTEST_MAIN(tst_QWebEngineLoadingInfo)
+#include "tst_qwebengineloadinginfo.moc"
diff --git a/tests/auto/core/qwebenginesettings/BLACKLIST b/tests/auto/core/qwebenginesettings/BLACKLIST
new file mode 100644
index 000000000..4b99b8e84
--- /dev/null
+++ b/tests/auto/core/qwebenginesettings/BLACKLIST
@@ -0,0 +1,5 @@
+[javascriptClipboard]
+ubuntu-20.04
+
+[setInAcceptNavigationRequest]
+macos
diff --git a/tests/auto/core/qwebenginesettings/CMakeLists.txt b/tests/auto/core/qwebenginesettings/CMakeLists.txt
new file mode 100644
index 000000000..756b99bbb
--- /dev/null
+++ b/tests/auto/core/qwebenginesettings/CMakeLists.txt
@@ -0,0 +1,13 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+include(../../util/util.cmake)
+
+qt_internal_add_test(tst_qwebenginesettings
+ SOURCES
+ tst_qwebenginesettings.cpp
+ LIBRARIES
+ Qt::WebEngineCore
+ Qt::WebEngineWidgets
+ Test::Util
+)
diff --git a/tests/auto/core/qwebenginesettings/tst_qwebenginesettings.cpp b/tests/auto/core/qwebenginesettings/tst_qwebenginesettings.cpp
new file mode 100644
index 000000000..e856dd094
--- /dev/null
+++ b/tests/auto/core/qwebenginesettings/tst_qwebenginesettings.cpp
@@ -0,0 +1,307 @@
+/*
+ Copyright (C) 2015 The Qt Company Ltd.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <util.h>
+
+#include <QtTest/QtTest>
+
+#include <qwebenginepage.h>
+#include <qwebengineprofile.h>
+#include <qwebenginesettings.h>
+
+#include <QtGui/qclipboard.h>
+#include <QtGui/qguiapplication.h>
+#include <QtWebEngineWidgets/qwebengineview.h>
+
+class tst_QWebEngineSettings: public QObject {
+ Q_OBJECT
+
+private Q_SLOTS:
+ void resetAttributes();
+ void defaultFontFamily_data();
+ void defaultFontFamily();
+ void javascriptClipboard_data();
+ void javascriptClipboard();
+ void setInAcceptNavigationRequest();
+ void disableReadingFromCanvas_data();
+ void disableReadingFromCanvas();
+ void forceDarkMode();
+ void forceDarkModeMultiView();
+};
+
+void tst_QWebEngineSettings::resetAttributes()
+{
+ QWebEngineProfile profile;
+ QWebEngineSettings *settings = profile.settings();
+
+ // Attribute
+ bool defaultValue = settings->testAttribute(QWebEngineSettings::FullScreenSupportEnabled);
+ settings->setAttribute(QWebEngineSettings::FullScreenSupportEnabled, !defaultValue);
+ QCOMPARE(!defaultValue, settings->testAttribute(QWebEngineSettings::FullScreenSupportEnabled));
+ settings->resetAttribute(QWebEngineSettings::FullScreenSupportEnabled);
+ QCOMPARE(defaultValue, settings->testAttribute(QWebEngineSettings::FullScreenSupportEnabled));
+
+ // Font family
+ QString defaultFamily = settings->fontFamily(QWebEngineSettings::StandardFont);
+ QString newFontFamily("PugDog");
+ settings->setFontFamily(QWebEngineSettings::StandardFont, newFontFamily);
+ QCOMPARE(newFontFamily, settings->fontFamily(QWebEngineSettings::StandardFont));
+ settings->resetFontFamily(QWebEngineSettings::StandardFont);
+ QCOMPARE(defaultFamily, settings->fontFamily(QWebEngineSettings::StandardFont));
+
+ // Font size
+ int defaultSize = settings->fontSize(QWebEngineSettings::MinimumFontSize);
+ int newSize = defaultSize + 10;
+ settings->setFontSize(QWebEngineSettings::MinimumFontSize, newSize);
+ QCOMPARE(newSize, settings->fontSize(QWebEngineSettings::MinimumFontSize));
+ settings->resetFontSize(QWebEngineSettings::MinimumFontSize);
+ QCOMPARE(defaultSize, settings->fontSize(QWebEngineSettings::MinimumFontSize));
+}
+
+void tst_QWebEngineSettings::defaultFontFamily_data()
+{
+ QTest::addColumn<int>("fontFamily");
+
+ QTest::newRow("StandardFont") << static_cast<int>(QWebEngineSettings::StandardFont);
+ QTest::newRow("FixedFont") << static_cast<int>(QWebEngineSettings::FixedFont);
+ QTest::newRow("SerifFont") << static_cast<int>(QWebEngineSettings::SerifFont);
+ QTest::newRow("SansSerifFont") << static_cast<int>(QWebEngineSettings::SansSerifFont);
+ QTest::newRow("CursiveFont") << static_cast<int>(QWebEngineSettings::CursiveFont);
+ QTest::newRow("FantasyFont") << static_cast<int>(QWebEngineSettings::FantasyFont);
+}
+
+void tst_QWebEngineSettings::defaultFontFamily()
+{
+ QWebEngineProfile profile;
+ QWebEngineSettings *settings = profile.settings();
+
+ QFETCH(int, fontFamily);
+ QVERIFY(!settings->fontFamily(static_cast<QWebEngineSettings::FontFamily>(fontFamily)).isEmpty());
+}
+
+void tst_QWebEngineSettings::javascriptClipboard_data()
+{
+ QTest::addColumn<bool>("javascriptCanAccessClipboard");
+ QTest::addColumn<bool>("javascriptCanPaste");
+ QTest::addColumn<bool>("copyResult");
+ QTest::addColumn<bool>("pasteResult");
+
+ QTest::newRow("default") << false << false << false << false;
+ QTest::newRow("canCopy") << true << false << true << false;
+ // paste command requires both permissions
+ QTest::newRow("canPaste") << false << true << false << false;
+ QTest::newRow("canCopyAndPaste") << true << true << true << true;
+}
+
+void tst_QWebEngineSettings::javascriptClipboard()
+{
+ QFETCH(bool, javascriptCanAccessClipboard);
+ QFETCH(bool, javascriptCanPaste);
+ QFETCH(bool, copyResult);
+ QFETCH(bool, pasteResult);
+
+ QWebEnginePage page;
+
+ // check defaults
+ QCOMPARE(page.settings()->testAttribute(QWebEngineSettings::JavascriptCanAccessClipboard),
+ false);
+ QCOMPARE(page.settings()->testAttribute(QWebEngineSettings::JavascriptCanPaste), false);
+
+ // check accessors
+ page.settings()->setAttribute(QWebEngineSettings::JavascriptCanAccessClipboard,
+ javascriptCanAccessClipboard);
+ page.settings()->setAttribute(QWebEngineSettings::JavascriptCanPaste,
+ javascriptCanPaste);
+ QCOMPARE(page.settings()->testAttribute(QWebEngineSettings::JavascriptCanAccessClipboard),
+ javascriptCanAccessClipboard);
+ QCOMPARE(page.settings()->testAttribute(QWebEngineSettings::JavascriptCanPaste),
+ javascriptCanPaste);
+
+ QSignalSpy loadFinishedSpy(&page, SIGNAL(loadFinished(bool)));
+ page.setHtml("<html><body>"
+ "<input type='text' value='OriginalText' id='myInput'/>"
+ "</body></html>");
+ QVERIFY(loadFinishedSpy.wait());
+
+ // make sure that 'OriginalText' is selected
+ evaluateJavaScriptSync(&page, "document.getElementById('myInput').select()");
+ QCOMPARE(evaluateJavaScriptSync(&page, "window.getSelection().toString()").toString(),
+ QStringLiteral("OriginalText"));
+
+ // Check that the actual settings work by the
+ // - return value of queryCommandEnabled and
+ // - return value of execCommand
+ // - comparing the clipboard / input field
+ QGuiApplication::clipboard()->setText(QString());
+ QCOMPARE(evaluateJavaScriptSync(&page, "document.queryCommandEnabled('copy')").toBool(),
+ copyResult);
+ QCOMPARE(evaluateJavaScriptSync(&page, "document.execCommand('copy')").toBool(), copyResult);
+ QTRY_COMPARE(QGuiApplication::clipboard()->text(),
+ (copyResult ? QString("OriginalText") : QString()));
+
+
+ QGuiApplication::clipboard()->setText("AnotherText");
+ QCOMPARE(evaluateJavaScriptSync(&page, "document.queryCommandEnabled('paste')").toBool(),
+ pasteResult);
+ QCOMPARE(evaluateJavaScriptSync(&page, "document.execCommand('paste')").toBool(), pasteResult);
+ QCOMPARE(evaluateJavaScriptSync(&page, "document.getElementById('myInput').value").toString(),
+ (pasteResult ? QString("AnotherText") : QString("OriginalText")));
+}
+
+class NavigationRequestOverride : public QWebEnginePage
+{
+protected:
+ bool acceptNavigationRequest(const QUrl &url, NavigationType type, bool isMainFrame) override
+ {
+ Q_UNUSED(type);
+
+ if (isMainFrame && url.scheme().startsWith("data"))
+ settings()->setAttribute(QWebEngineSettings::JavascriptEnabled, true);
+ // TODO: note this setting is flaky, consider settings().commit()
+ return true;
+ }
+};
+
+void tst_QWebEngineSettings::setInAcceptNavigationRequest()
+{
+ NavigationRequestOverride page;
+ QSignalSpy loadFinishedSpy(&page, SIGNAL(loadFinished(bool)));
+ QWebEngineProfile::defaultProfile()->settings()->setAttribute(QWebEngineSettings::JavascriptEnabled, false);
+ QVERIFY(!page.settings()->testAttribute(QWebEngineSettings::JavascriptEnabled));
+
+ page.load(QUrl("about:blank"));
+ QVERIFY(loadFinishedSpy.wait());
+ QVERIFY(!page.settings()->testAttribute(QWebEngineSettings::JavascriptEnabled));
+
+ page.setHtml("<html><body>"
+ "<script>document.write('PASS')</script>"
+ "<noscript>FAIL</noscript>"
+ "</body></html>");
+ QVERIFY(loadFinishedSpy.wait());
+ QVERIFY(page.settings()->testAttribute(QWebEngineSettings::JavascriptEnabled));
+ QCOMPARE(toPlainTextSync(&page), QStringLiteral("PASS"));
+}
+
+void tst_QWebEngineSettings::disableReadingFromCanvas_data()
+{
+ QTest::addColumn<bool>("disableReadingFromCanvas");
+ QTest::addColumn<bool>("result");
+ QTest::newRow("disabled") << false << true;
+ QTest::newRow("enabled") << true << false;
+}
+
+void tst_QWebEngineSettings::disableReadingFromCanvas()
+{
+ QFETCH(bool, disableReadingFromCanvas);
+ QFETCH(bool, result);
+
+ QWebEnginePage page;
+ QSignalSpy loadFinishedSpy(&page, SIGNAL(loadFinished(bool)));
+ page.settings()->setAttribute(QWebEngineSettings::JavascriptEnabled, true);
+ page.settings()->setAttribute(QWebEngineSettings::ReadingFromCanvasEnabled,
+ !disableReadingFromCanvas);
+ page.setHtml("<html><body>"
+ "<canvas id='myCanvas' width='200' height='40' style='border:1px solid "
+ "#000000;'></canvas>"
+ "</body></html>");
+ QVERIFY(loadFinishedSpy.wait());
+ QCOMPARE(page.settings()->testAttribute(QWebEngineSettings::ReadingFromCanvasEnabled),
+ !disableReadingFromCanvas);
+
+ const QString jsCode("(function(){"
+ " var canvas = document.getElementById(\"myCanvas\");"
+ " var ctx = canvas.getContext(\"2d\");"
+ " ctx.fillStyle = \"rgb(255,0,255)\";"
+ " ctx.fillRect(0, 0, 200, 40);"
+ " try {"
+ " src = canvas.toDataURL();"
+ " }"
+ " catch(err) {"
+ " src = \"\";"
+ " }"
+ " return src.length ? true : false;"
+ "})();");
+ QCOMPARE(evaluateJavaScriptSync(&page, jsCode).toBool(), result);
+}
+
+void tst_QWebEngineSettings::forceDarkMode()
+{
+ QWebEnginePage page;
+ QSignalSpy loadFinishedSpy(&page, SIGNAL(loadFinished(bool)));
+ page.settings()->setAttribute(QWebEngineSettings::JavascriptEnabled, true);
+
+ // based on: https://developer.chrome.com/blog/auto-dark-theme/#detecting-auto-dark-theme
+ page.setHtml("<html><body>"
+ "<div id=\"detection\", style=\"display: none; background-color: canvas; color-scheme: light\"</div>"
+ "</body></html>");
+
+ const QString isAutoDark("(() => {"
+ " const detectionDiv = document.querySelector('#detection');"
+ " return getComputedStyle(detectionDiv).backgroundColor != 'rgb(255, 255, 255)';"
+ "})()");
+
+ QVERIFY(loadFinishedSpy.wait());
+ QTRY_COMPARE(evaluateJavaScriptSync(&page, isAutoDark).toBool(), false);
+ page.settings()->setAttribute(QWebEngineSettings::ForceDarkMode, true);
+ QTRY_COMPARE(evaluateJavaScriptSync(&page, isAutoDark).toBool(), true);
+}
+
+void tst_QWebEngineSettings::forceDarkModeMultiView()
+{
+ QWebEngineView view1;
+ QWebEngineView view2;
+ QWebEnginePage *page1 = view1.page();
+ QWebEnginePage *page2 = view2.page();
+ page1->settings()->setAttribute(QWebEngineSettings::JavascriptEnabled, true);
+ page2->settings()->setAttribute(QWebEngineSettings::JavascriptEnabled, true);
+ view1.resize(300,300);
+ view2.resize(300,300);
+ view1.show();
+ view2.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view1));
+ QVERIFY(QTest::qWaitForWindowExposed(&view2));
+
+ QSignalSpy loadFinishedSpy(page1, SIGNAL(loadFinished(bool)));
+ QSignalSpy loadFinishedSpy2(page2, SIGNAL(loadFinished(bool)));
+ QString html("<html><body>"
+ "<div id=\"detection\", style=\"display: none; background-color: canvas; color-scheme: light\"</div>"
+ "</body></html>");
+
+ const QString isAutoDark("(() => {"
+ " const detectionDiv = document.querySelector('#detection');"
+ " return getComputedStyle(detectionDiv).backgroundColor != 'rgb(255, 255, 255)';"
+ "})()");
+
+ view1.setHtml(html);
+ QVERIFY(loadFinishedSpy.wait());
+ view2.setHtml(html);
+ QVERIFY(loadFinishedSpy2.wait());
+
+ // both views has light color-scheme
+ QTRY_COMPARE(evaluateJavaScriptSync(page1, isAutoDark).toBool(), false);
+ QTRY_COMPARE(evaluateJavaScriptSync(page2, isAutoDark).toBool(), false);
+ view1.settings()->setAttribute(QWebEngineSettings::ForceDarkMode, true);
+ // dark mode should apply only for view1
+ QTRY_COMPARE(evaluateJavaScriptSync(page1, isAutoDark).toBool(), true);
+ QTRY_COMPARE(evaluateJavaScriptSync(page2, isAutoDark).toBool(), false);
+}
+
+QTEST_MAIN(tst_QWebEngineSettings)
+
+#include "tst_qwebenginesettings.moc"
diff --git a/tests/auto/core/qwebengineurlrequestinterceptor/CMakeLists.txt b/tests/auto/core/qwebengineurlrequestinterceptor/CMakeLists.txt
new file mode 100644
index 000000000..c12c0c45c
--- /dev/null
+++ b/tests/auto/core/qwebengineurlrequestinterceptor/CMakeLists.txt
@@ -0,0 +1,49 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+include(../../util/util.cmake)
+include(../../httpserver/httpserver.cmake)
+
+qt_internal_add_test(tst_qwebengineurlrequestinterceptor
+ SOURCES
+ tst_qwebengineurlrequestinterceptor.cpp
+ LIBRARIES
+ Qt::WebEngineCore
+ Qt::WebEngineCorePrivate
+ Qt::CorePrivate
+ Test::HttpServer
+ Test::Util
+)
+
+set(tst_qwebengineurlrequestinterceptor_resource_files
+ "resources/content.html"
+ "resources/content2.html"
+ "resources/content3.html"
+ "resources/favicon.html"
+ "resources/firstparty.html"
+ "resources/fontawesome.woff"
+ "resources/icons/favicon.png"
+ "resources/iframe.html"
+ "resources/iframe2.html"
+ "resources/iframe3.html"
+ "resources/image.html"
+ "resources/image_in_iframe.html"
+ "resources/index.html"
+ "resources/media.html"
+ "resources/media.mp4"
+ "resources/media_in_iframe.html"
+ "resources/resource.html"
+ "resources/resource_in_iframe.html"
+ "resources/script.js"
+ "resources/style.css"
+ "resources/sw.html"
+ "resources/sw.js"
+ "resources/postBodyFile.txt"
+)
+
+qt_internal_add_resource(tst_qwebengineurlrequestinterceptor "tst_qwebengineurlrequestinterceptor"
+ PREFIX
+ "/"
+ FILES
+ ${tst_qwebengineurlrequestinterceptor_resource_files}
+)
diff --git a/tests/auto/core/qwebengineurlrequestinterceptor/qwebengineurlrequestinterceptor.pro b/tests/auto/core/qwebengineurlrequestinterceptor/qwebengineurlrequestinterceptor.pro
deleted file mode 100644
index 9c239f1a7..000000000
--- a/tests/auto/core/qwebengineurlrequestinterceptor/qwebengineurlrequestinterceptor.pro
+++ /dev/null
@@ -1,2 +0,0 @@
-include(../tests.pri)
-include(../../shared/http.pri)
diff --git a/tests/auto/core/qwebengineurlrequestinterceptor/resources/content.html b/tests/auto/core/qwebengineurlrequestinterceptor/resources/content.html
index 360ad65ef..84bf55036 100644
--- a/tests/auto/core/qwebengineurlrequestinterceptor/resources/content.html
+++ b/tests/auto/core/qwebengineurlrequestinterceptor/resources/content.html
@@ -1,5 +1,6 @@
<html>
+<head><link rel="icon" href="data:,"></head>
<body>
-<a>This is test content</a>
+<a>Simple test page without favicon (meaning no separate request from http server)</a>
</body>
</html>
diff --git a/tests/auto/core/qwebengineurlrequestinterceptor/resources/content2.html b/tests/auto/core/qwebengineurlrequestinterceptor/resources/content2.html
new file mode 100644
index 000000000..84bf55036
--- /dev/null
+++ b/tests/auto/core/qwebengineurlrequestinterceptor/resources/content2.html
@@ -0,0 +1,6 @@
+<html>
+<head><link rel="icon" href="data:,"></head>
+<body>
+<a>Simple test page without favicon (meaning no separate request from http server)</a>
+</body>
+</html>
diff --git a/tests/auto/core/qwebengineurlrequestinterceptor/resources/content3.html b/tests/auto/core/qwebengineurlrequestinterceptor/resources/content3.html
new file mode 100644
index 000000000..84bf55036
--- /dev/null
+++ b/tests/auto/core/qwebengineurlrequestinterceptor/resources/content3.html
@@ -0,0 +1,6 @@
+<html>
+<head><link rel="icon" href="data:,"></head>
+<body>
+<a>Simple test page without favicon (meaning no separate request from http server)</a>
+</body>
+</html>
diff --git a/tests/auto/core/qwebengineurlrequestinterceptor/resources/postBodyFile.txt b/tests/auto/core/qwebengineurlrequestinterceptor/resources/postBodyFile.txt
new file mode 100644
index 000000000..7729c4e0a
--- /dev/null
+++ b/tests/auto/core/qwebengineurlrequestinterceptor/resources/postBodyFile.txt
@@ -0,0 +1,3 @@
+{
+"test": "1234"
+}
diff --git a/tests/auto/core/qwebengineurlrequestinterceptor/resources/sw.html b/tests/auto/core/qwebengineurlrequestinterceptor/resources/sw.html
index af44b45a2..fc3d9ded4 100644
--- a/tests/auto/core/qwebengineurlrequestinterceptor/resources/sw.html
+++ b/tests/auto/core/qwebengineurlrequestinterceptor/resources/sw.html
@@ -2,13 +2,40 @@
<html>
<body>
<script>
+ function logState(state) {
+ console.log("Service worker " + state)
+ }
+
+ const registerServiceWorker = async () => {
+ try {
+ var serviceWorker;
+ const registration = await navigator.serviceWorker.register('/sw.js');
+ if (registration.installing) {
+ serviceWorker = registration.installing;
+ } else if (registration.waiting) {
+ serviceWorker = registration.waiting;
+ } else if (registration.active) {
+ serviceWorker = registration.active;
+ }
+ } catch (error) {
+ console.error("Service worker registration error: ${error}");
+ }
+ if (serviceWorker) {
+ logState(serviceWorker.state);
+ serviceWorker.addEventListener('statechange', function(e) {
+ logState(e.target.state);
+ });
+ }
+ };
if ('serviceWorker' in navigator) {
- window.addEventListener('load', function() {
- navigator.serviceWorker.register('/sw.js').then(function(registration) {
- console.log('ServiceWorker registration successful with scope: ', registration.scope);
- }, function(err) {
- console.error('ServiceWorker registration failed: ', err);
- });
+ registerServiceWorker();
+ navigator.serviceWorker.ready.then((registration) => {
+ navigator.serviceWorker.onmessage = (event) => {
+ if (event.data && event.data.type === 'PONG') {
+ console.log("Service worker done");
+ }
+ };
+ registration.active.postMessage({type: 'PING'});
});
}
</script>
diff --git a/tests/auto/core/qwebengineurlrequestinterceptor/resources/sw.js b/tests/auto/core/qwebengineurlrequestinterceptor/resources/sw.js
index 2216e2a07..196a9ad67 100644
--- a/tests/auto/core/qwebengineurlrequestinterceptor/resources/sw.js
+++ b/tests/auto/core/qwebengineurlrequestinterceptor/resources/sw.js
@@ -1,3 +1,16 @@
self.addEventListener('install', function(event) {
- console.log('ServiceWorker installed');
+ event.waitUntil(self.skipWaiting());
+});
+
+self.addEventListener('activate', function(event) {
+ event.waitUntil(self.clients.claim());
+});
+self.addEventListener('message', (event) => {
+ if (event.data && event.data.type === 'PING') {
+ self.clients.matchAll({includeUncontrolled: true, type: 'window'}).then((clients) => {
+ if (clients && clients.length) {
+ clients[0].postMessage({type: 'PONG'});
+ }
+ });
+ }
});
diff --git a/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp b/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp
index 350c15174..7cea14c0c 100644
--- a/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp
+++ b/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp
@@ -1,44 +1,21 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "../../widgets/util.h"
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses
+
+#include <util.h>
#include <QtTest/QtTest>
#include <QtWebEngineCore/qwebengineurlrequestinfo.h>
+#include <QtWebEngineCore/private/qwebengineurlrequestinfo_p.h>
#include <QtWebEngineCore/qwebengineurlrequestinterceptor.h>
-#include <QtWebEngineWidgets/qwebenginepage.h>
-#include <QtWebEngineWidgets/qwebengineprofile.h>
-#include <QtWebEngineWidgets/qwebenginesettings.h>
+#include <QtWebEngineCore/qwebenginesettings.h>
+#include <QtWebEngineCore/qwebengineprofile.h>
+#include <QtWebEngineCore/qwebenginepage.h>
+#include <QtWebEngineCore/qwebenginehttprequest.h>
#include <httpserver.h>
#include <httpreqrep.h>
-typedef void (QWebEngineProfile::*InterceptorSetter)(QWebEngineUrlRequestInterceptor *interceptor);
-Q_DECLARE_METATYPE(InterceptorSetter)
class tst_QWebEngineUrlRequestInterceptor : public QObject
{
Q_OBJECT
@@ -54,28 +31,30 @@ public Q_SLOTS:
private Q_SLOTS:
void initTestCase();
void cleanupTestCase();
- void interceptRequest_data();
void interceptRequest();
- void ipv6HostEncoding_data();
void ipv6HostEncoding();
void requestedUrl_data();
void requestedUrl();
void setUrlSameUrl_data();
void setUrlSameUrl();
- void firstPartyUrl_data();
void firstPartyUrl();
void firstPartyUrlNestedIframes_data();
void firstPartyUrlNestedIframes();
void requestInterceptorByResourceType_data();
void requestInterceptorByResourceType();
- void firstPartyUrlHttp_data();
void firstPartyUrlHttp();
- void passRefererHeader_data();
- void passRefererHeader();
- void initiator_data();
+ void headers();
+ void customHeaders();
void initiator();
- void jsServiceWorker_data();
void jsServiceWorker();
+ void replaceInterceptor_data();
+ void replaceInterceptor();
+ void replaceOnIntercept();
+ void multipleRedirects();
+ void postWithBody_data();
+ void postWithBody();
+ void profilePreventsPageInterception_data();
+ void profilePreventsPageInterception();
};
tst_QWebEngineUrlRequestInterceptor::tst_QWebEngineUrlRequestInterceptor()
@@ -108,39 +87,61 @@ struct RequestInfo {
, firstPartyUrl(info.firstPartyUrl())
, initiator(info.initiator())
, resourceType(info.resourceType())
+ , headers(info.httpHeaders())
{}
QUrl requestUrl;
QUrl firstPartyUrl;
QUrl initiator;
int resourceType;
+ QHash<QByteArray, QByteArray> headers;
};
-static const QByteArray kHttpHeaderReferrerValue = QByteArrayLiteral("http://somereferrer.com/");
-static const QByteArray kHttpHeaderRefererName = QByteArrayLiteral("referer");
+static const QUrl kRedirectUrl = QUrl("qrc:///resources/content.html");
+
+Q_LOGGING_CATEGORY(lc, "qt.webengine.tests")
class TestRequestInterceptor : public QWebEngineUrlRequestInterceptor
{
public:
QList<RequestInfo> requestInfos;
- bool shouldIntercept;
+ bool shouldRedirect = false;
+ QUrl redirectUrl;
QMap<QUrl, QSet<QUrl>> requestInitiatorUrls;
+ QMap<QByteArray, QByteArray> headers;
+ std::function<bool (QWebEngineUrlRequestInfo &)> onIntercept;
void interceptRequest(QWebEngineUrlRequestInfo &info) override
{
- QCOMPARE(QThread::currentThread() == QCoreApplication::instance()->thread(), !property("deprecated").toBool());
+ QVERIFY(QThread::currentThread() == QCoreApplication::instance()->thread());
+ qCDebug(lc) << this << "Type:" << info.resourceType() << info.requestMethod() << "Navigation:" << info.navigationType()
+ << info.requestUrl() << "Initiator:" << info.initiator();
+
// Since 63 we also intercept some unrelated blob requests..
if (info.requestUrl().scheme() == QLatin1String("blob"))
return;
- info.block(info.requestMethod() != QByteArrayLiteral("GET"));
- if (shouldIntercept && info.requestUrl().toString().endsWith(QLatin1String("__placeholder__")))
- info.redirect(QUrl("qrc:///resources/content.html"));
- // Set referrer header
- info.setHttpHeader(kHttpHeaderRefererName, kHttpHeaderReferrerValue);
+ if (onIntercept && !onIntercept(info))
+ return;
+
+ bool block = info.requestMethod() != QByteArrayLiteral("GET");
+ bool redirect = shouldRedirect && info.requestUrl() != redirectUrl;
+
+ // set additional headers if any required by test
+ for (auto it = headers.begin(); it != headers.end(); ++it) info.setHttpHeader(it.key(), it.value());
+
+ if (block) {
+ info.block(true);
+ } else if (redirect) {
+ info.redirect(redirectUrl);
+ }
requestInitiatorUrls[info.requestUrl()].insert(info.initiator());
requestInfos.append(info);
+
+ // MEMO avoid unintentionally changing request when it is not needed for test logic
+ // since api behavior depends on 'changed' state of the info object
+ Q_ASSERT(info.changed() == (block || redirect));
}
bool shouldSkipRequest(const RequestInfo &requestInfo)
@@ -182,42 +183,32 @@ public:
return false;
}
- TestRequestInterceptor(bool intercept)
- : shouldIntercept(intercept)
+ TestRequestInterceptor(bool redirect = false, const QUrl &url = kRedirectUrl)
+ : shouldRedirect(redirect), redirectUrl(url)
{
}
};
-class TestServer : public HttpServer
-{
+class TestMultipleRedirectsInterceptor : public QWebEngineUrlRequestInterceptor {
public:
- TestServer()
+ QList<RequestInfo> requestInfos;
+ QMap<QUrl, QUrl> redirectPairs;
+ int redirectCount = 0;
+ void interceptRequest(QWebEngineUrlRequestInfo &info) override
{
- connect(this, &HttpServer::newRequest, this, &TestServer::onNewRequest);
+ QVERIFY(QThread::currentThread() == QCoreApplication::instance()->thread());
+ qCDebug(lc) << this << "Type:" << info.resourceType() << info.requestMethod() << "Navigation:" << info.navigationType()
+ << info.requestUrl() << "Initiator:" << info.initiator();
+ auto redirectUrl = redirectPairs.constFind(info.requestUrl());
+ if (redirectUrl != redirectPairs.constEnd()) {
+ info.redirect(redirectUrl.value());
+ requestInfos.append(info);
+ redirectCount++;
+ }
}
-private:
- void onNewRequest(HttpReqRep *rr)
+ TestMultipleRedirectsInterceptor()
{
- const QDir resourceDir(TESTS_SOURCE_DIR "qwebengineurlrequestinterceptor/resources");
- QString path = rr->requestPath();
- path.remove(0, 1);
-
- if (rr->requestMethod() != "GET" || !resourceDir.exists(path))
- {
- rr->setResponseStatus(404);
- rr->sendResponse();
- return;
- }
-
- QFile file(resourceDir.filePath(path));
- file.open(QIODevice::ReadOnly);
- QByteArray data = file.readAll();
- rr->setResponseBody(data);
- QMimeDatabase db;
- QMimeType mime = db.mimeTypeForFileNameAndData(file.fileName(), data);
- rr->setResponseHeader(QByteArrayLiteral("content-type"), mime.name().toUtf8());
- rr->sendResponse();
}
};
@@ -226,7 +217,7 @@ class ConsolePage : public QWebEnginePage {
public:
ConsolePage(QWebEngineProfile* profile) : QWebEnginePage(profile) {}
- virtual void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString& message, int lineNumber, const QString& sourceID)
+ void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString& message, int lineNumber, const QString& sourceID) override
{
levels.append(level);
messages.append(message);
@@ -240,25 +231,17 @@ public:
QStringList sourceIDs;
};
-void tst_QWebEngineUrlRequestInterceptor::interceptRequest_data()
-{
- QTest::addColumn<InterceptorSetter>("setter");
- QTest::newRow("ui") << &QWebEngineProfile::setUrlRequestInterceptor;
- QTest::newRow("io") << &QWebEngineProfile::setRequestInterceptor;
-}
-
void tst_QWebEngineUrlRequestInterceptor::interceptRequest()
{
- QFETCH(InterceptorSetter, setter);
QWebEngineProfile profile;
profile.settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, false);
- TestRequestInterceptor interceptor(/* intercept */ true);
- (profile.*setter)(&interceptor);
+ TestRequestInterceptor interceptor(/* intercept */ false);
+ profile.setUrlRequestInterceptor(&interceptor);
QWebEnginePage page(&profile);
QSignalSpy loadSpy(&page, SIGNAL(loadFinished(bool)));
page.load(QUrl("qrc:///resources/index.html"));
- QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE_WITH_TIMEOUT(loadSpy.size(), 1, 20000);
QVariant success = loadSpy.takeFirst().takeFirst();
QVERIFY(success.toBool());
loadSpy.clear();
@@ -266,29 +249,30 @@ void tst_QWebEngineUrlRequestInterceptor::interceptRequest()
page.runJavaScript("post();", [&ok](const QVariant result){ ok = result; });
QTRY_VERIFY(ok.toBool());
- QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE(loadSpy.size(), 1);
success = loadSpy.takeFirst().takeFirst();
// We block non-GET requests, so this should not succeed.
QVERIFY(!success.toBool());
loadSpy.clear();
+ interceptor.shouldRedirect = true;
page.load(QUrl("qrc:///resources/__placeholder__"));
- QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE_WITH_TIMEOUT(loadSpy.size(), 1, 20000);
success = loadSpy.takeFirst().takeFirst();
// The redirection for __placeholder__ should succeed.
QVERIFY(success.toBool());
loadSpy.clear();
- QCOMPARE(interceptor.requestInfos.count(), 4);
+ QCOMPARE(interceptor.requestInfos.size(), 4);
// Make sure that registering an observer does not modify the request.
TestRequestInterceptor observer(/* intercept */ false);
- (profile.*setter)(&observer);
+ profile.setUrlRequestInterceptor(&observer);
page.load(QUrl("qrc:///resources/__placeholder__"));
- QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE_WITH_TIMEOUT(loadSpy.size(), 1, 20000);
success = loadSpy.takeFirst().takeFirst();
// Since we do not intercept, loading an invalid path should not succeed.
QVERIFY(!success.toBool());
- QCOMPARE(observer.requestInfos.count(), 1);
+ QCOMPARE(observer.requestInfos.size(), 1);
}
class LocalhostContentProvider : public QWebEngineUrlRequestInterceptor
@@ -311,53 +295,44 @@ public:
QList<QUrl> requestedUrls;
};
-void tst_QWebEngineUrlRequestInterceptor::ipv6HostEncoding_data()
-{
- interceptRequest_data();
-}
-
void tst_QWebEngineUrlRequestInterceptor::ipv6HostEncoding()
{
- QFETCH(InterceptorSetter, setter);
QWebEngineProfile profile;
LocalhostContentProvider contentProvider;
- (profile.*setter)(&contentProvider);
+ profile.setUrlRequestInterceptor(&contentProvider);
QWebEnginePage page(&profile);
QSignalSpy spyLoadFinished(&page, SIGNAL(loadFinished(bool)));
page.setHtml("<p>Hi", QUrl::fromEncoded("http://[::1]/index.html"));
- QTRY_COMPARE(spyLoadFinished.count(), 1);
- QCOMPARE(contentProvider.requestedUrls.count(), 0);
+ QTRY_COMPARE(spyLoadFinished.size(), 1);
+ QCOMPARE(contentProvider.requestedUrls.size(), 0);
evaluateJavaScriptSync(&page, "var r = new XMLHttpRequest();"
"r.open('GET', 'http://[::1]/test.xml', false);"
"r.send(null);"
);
- QCOMPARE(contentProvider.requestedUrls.count(), 1);
+ QCOMPARE(contentProvider.requestedUrls.size(), 1);
QCOMPARE(contentProvider.requestedUrls.at(0), QUrl::fromEncoded("http://[::1]/test.xml"));
}
void tst_QWebEngineUrlRequestInterceptor::requestedUrl_data()
{
- QTest::addColumn<InterceptorSetter>("setter");
QTest::addColumn<bool>("interceptInPage");
- QTest::newRow("ui profile intercept") << &QWebEngineProfile::setUrlRequestInterceptor << false;
- QTest::newRow("ui page intercept") << &QWebEngineProfile::setUrlRequestInterceptor << true;
- QTest::newRow("io profile intercept") << &QWebEngineProfile::setRequestInterceptor << false;
+ QTest::newRow("profile intercept") << false;
+ QTest::newRow("page intercept") << true;
}
void tst_QWebEngineUrlRequestInterceptor::requestedUrl()
{
- QFETCH(InterceptorSetter, setter);
QFETCH(bool, interceptInPage);
QWebEngineProfile profile;
profile.settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, false);
TestRequestInterceptor interceptor(/* intercept */ true);
if (!interceptInPage)
- (profile.*setter)(&interceptor);
+ profile.setUrlRequestInterceptor(&interceptor);
QWebEnginePage page(&profile);
if (interceptInPage)
@@ -366,22 +341,24 @@ void tst_QWebEngineUrlRequestInterceptor::requestedUrl()
page.setUrl(QUrl("qrc:///resources/__placeholder__"));
QVERIFY(spy.wait());
- QTRY_COMPARE(spy.count(), 1);
- QVERIFY(interceptor.requestInfos.count() >= 1);
+ QTRY_COMPARE_WITH_TIMEOUT(spy.size(), 1, 20000);
+ QVERIFY(interceptor.requestInfos.size() >= 1);
QCOMPARE(interceptor.requestInfos.at(0).requestUrl, QUrl("qrc:///resources/content.html"));
QCOMPARE(page.requestedUrl(), QUrl("qrc:///resources/__placeholder__"));
QCOMPARE(page.url(), QUrl("qrc:///resources/content.html"));
+ interceptor.shouldRedirect = false;
+
page.setUrl(QUrl("qrc:/non-existent.html"));
- QTRY_COMPARE(spy.count(), 2);
- QVERIFY(interceptor.requestInfos.count() >= 3);
+ QTRY_COMPARE_WITH_TIMEOUT(spy.size(), 2, 20000);
+ QVERIFY(interceptor.requestInfos.size() >= 3);
QCOMPARE(interceptor.requestInfos.at(2).requestUrl, QUrl("qrc:/non-existent.html"));
QCOMPARE(page.requestedUrl(), QUrl("qrc:///resources/__placeholder__"));
QCOMPARE(page.url(), QUrl("qrc:///resources/content.html"));
page.setUrl(QUrl("http://abcdef.abcdef"));
- QTRY_COMPARE_WITH_TIMEOUT(spy.count(), 3, 15000);
- QVERIFY(interceptor.requestInfos.count() >= 4);
+ QTRY_COMPARE_WITH_TIMEOUT(spy.size(), 3, 20000);
+ QVERIFY(interceptor.requestInfos.size() >= 4);
QCOMPARE(interceptor.requestInfos.at(3).requestUrl, QUrl("http://abcdef.abcdef/"));
QCOMPARE(page.requestedUrl(), QUrl("qrc:///resources/__placeholder__"));
QCOMPARE(page.url(), QUrl("qrc:///resources/content.html"));
@@ -394,13 +371,12 @@ void tst_QWebEngineUrlRequestInterceptor::setUrlSameUrl_data()
void tst_QWebEngineUrlRequestInterceptor::setUrlSameUrl()
{
- QFETCH(InterceptorSetter, setter);
QFETCH(bool, interceptInPage);
QWebEngineProfile profile;
TestRequestInterceptor interceptor(/* intercept */ true);
if (!interceptInPage)
- (profile.*setter)(&interceptor);
+ profile.setUrlRequestInterceptor(&interceptor);
QWebEnginePage page(&profile);
if (interceptInPage)
@@ -410,95 +386,89 @@ void tst_QWebEngineUrlRequestInterceptor::setUrlSameUrl()
page.setUrl(QUrl("qrc:///resources/__placeholder__"));
QVERIFY(spy.wait());
QCOMPARE(page.url(), QUrl("qrc:///resources/content.html"));
- QCOMPARE(spy.count(), 1);
+ QCOMPARE(spy.size(), 1);
page.setUrl(QUrl("qrc:///resources/__placeholder__"));
QVERIFY(spy.wait());
QCOMPARE(page.url(), QUrl("qrc:///resources/content.html"));
- QCOMPARE(spy.count(), 2);
+ QCOMPARE(spy.size(), 2);
// Now a case without redirect.
page.setUrl(QUrl("qrc:///resources/content.html"));
QVERIFY(spy.wait());
QCOMPARE(page.url(), QUrl("qrc:///resources/content.html"));
- QCOMPARE(spy.count(), 3);
+ QCOMPARE(spy.size(), 3);
page.setUrl(QUrl("qrc:///resources/__placeholder__"));
QVERIFY(spy.wait());
QCOMPARE(page.url(), QUrl("qrc:///resources/content.html"));
- QCOMPARE(spy.count(), 4);
-}
-
-void tst_QWebEngineUrlRequestInterceptor::firstPartyUrl_data()
-{
- interceptRequest_data();
+ QCOMPARE(spy.size(), 4);
}
void tst_QWebEngineUrlRequestInterceptor::firstPartyUrl()
{
- QFETCH(InterceptorSetter, setter);
QWebEngineProfile profile;
TestRequestInterceptor interceptor(/* intercept */ false);
- (profile.*setter)(&interceptor);
+ profile.setUrlRequestInterceptor(&interceptor);
QWebEnginePage page(&profile);
QSignalSpy spy(&page, SIGNAL(loadFinished(bool)));
page.setUrl(QUrl("qrc:///resources/firstparty.html"));
QVERIFY(spy.wait());
- QVERIFY(interceptor.requestInfos.count() >= 2);
+ QVERIFY(interceptor.requestInfos.size() >= 2);
QCOMPARE(interceptor.requestInfos.at(0).requestUrl, QUrl("qrc:///resources/firstparty.html"));
QCOMPARE(interceptor.requestInfos.at(1).requestUrl, QUrl("qrc:///resources/content.html"));
QCOMPARE(interceptor.requestInfos.at(0).firstPartyUrl, QUrl("qrc:///resources/firstparty.html"));
QCOMPARE(interceptor.requestInfos.at(1).firstPartyUrl, QUrl("qrc:///resources/firstparty.html"));
- QCOMPARE(spy.count(), 1);
+ QCOMPARE(spy.size(), 1);
}
void tst_QWebEngineUrlRequestInterceptor::firstPartyUrlNestedIframes_data()
{
- QUrl url = QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebengineurlrequestinterceptor/resources/iframe.html"));
- QTest::addColumn<InterceptorSetter>("setter");
+ QUrl url = QUrl::fromLocalFile(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + QLatin1String("/resources/iframe.html"));
QTest::addColumn<QUrl>("requestUrl");
- QTest::newRow("ui file") << &QWebEngineProfile::setUrlRequestInterceptor << url;
- QTest::newRow("io file") << &QWebEngineProfile::setRequestInterceptor << url;
- QTest::newRow("ui qrc") << &QWebEngineProfile::setUrlRequestInterceptor
- << QUrl("qrc:///resources/iframe.html");
- QTest::newRow("io qrc") << &QWebEngineProfile::setRequestInterceptor
- << QUrl("qrc:///resources/iframe.html");
+ QTest::newRow("ui file") << url;
+ QTest::newRow("ui qrc") << QUrl("qrc:///resources/iframe.html");
}
void tst_QWebEngineUrlRequestInterceptor::firstPartyUrlNestedIframes()
{
- QFETCH(InterceptorSetter, setter);
QFETCH(QUrl, requestUrl);
- if (requestUrl.scheme() == "file" && !QDir(TESTS_SOURCE_DIR).exists())
- W_QSKIP(QString("This test requires access to resources found in '%1'").arg(TESTS_SOURCE_DIR).toLatin1().constData(), SkipAll);
+ if (requestUrl.scheme() == "file"
+ && !QDir(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()).exists())
+ W_QSKIP(QString("This test requires access to resources found in '%1'")
+ .arg(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath())
+ .toLatin1()
+ .constData(),
+ SkipAll);
QString adjustedUrl = requestUrl.adjusted(QUrl::RemoveFilename).toString();
QWebEngineProfile profile;
TestRequestInterceptor interceptor(/* intercept */ false);
- (profile.*setter)(&interceptor);
+ profile.setUrlRequestInterceptor(&interceptor);
QWebEnginePage page(&profile);
QSignalSpy loadSpy(&page, SIGNAL(loadFinished(bool)));
page.setUrl(requestUrl);
- QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE_WITH_TIMEOUT(loadSpy.size(), 1, 20000);
- QVERIFY(interceptor.requestInfos.count() >= 1);
+ QVERIFY(interceptor.requestInfos.size() >= 1);
RequestInfo info = interceptor.requestInfos.at(0);
QCOMPARE(info.requestUrl, requestUrl);
QCOMPARE(info.firstPartyUrl, requestUrl);
QCOMPARE(info.resourceType, QWebEngineUrlRequestInfo::ResourceTypeMainFrame);
- QVERIFY(interceptor.requestInfos.count() >= 2);
+ QVERIFY(interceptor.requestInfos.size() >= 2);
info = interceptor.requestInfos.at(1);
QCOMPARE(info.requestUrl, QUrl(adjustedUrl + "iframe2.html"));
QCOMPARE(info.firstPartyUrl, requestUrl);
QCOMPARE(info.resourceType, QWebEngineUrlRequestInfo::ResourceTypeSubFrame);
- QVERIFY(interceptor.requestInfos.count() >= 3);
+ QVERIFY(interceptor.requestInfos.size() >= 3);
info = interceptor.requestInfos.at(2);
QCOMPARE(info.requestUrl, QUrl(adjustedUrl + "iframe3.html"));
QCOMPARE(info.firstPartyUrl, requestUrl);
@@ -507,84 +477,88 @@ void tst_QWebEngineUrlRequestInterceptor::firstPartyUrlNestedIframes()
void tst_QWebEngineUrlRequestInterceptor::requestInterceptorByResourceType_data()
{
- QUrl firstPartyUrl = QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebengineurlrequestinterceptor/resources/resource_in_iframe.html"));
- QUrl styleRequestUrl = QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebengineurlrequestinterceptor/resources/style.css"));
- QUrl scriptRequestUrl = QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebengineurlrequestinterceptor/resources/script.js"));
- QUrl fontRequestUrl = QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebengineurlrequestinterceptor/resources/fontawesome.woff"));
- QUrl xhrRequestUrl = QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebengineurlrequestinterceptor/resources/test"));
- QUrl imageFirstPartyUrl = QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebengineurlrequestinterceptor/resources/image_in_iframe.html"));
- QUrl imageRequestUrl = QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebengineurlrequestinterceptor/resources/icons/favicon.png"));
- QUrl mediaFirstPartyUrl = QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebengineurlrequestinterceptor/resources/media_in_iframe.html"));
- QUrl mediaRequestUrl = QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebengineurlrequestinterceptor/resources/media.mp4"));
- QUrl faviconFirstPartyUrl = QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebengineurlrequestinterceptor/resources/favicon.html"));
- QUrl faviconRequestUrl = QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebengineurlrequestinterceptor/resources/icons/favicon.png"));
-
- QTest::addColumn<InterceptorSetter>("setter");
+ QUrl firstPartyUrl = QUrl::fromLocalFile(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + QLatin1String("/resources/resource_in_iframe.html"));
+ QUrl styleRequestUrl = QUrl::fromLocalFile(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + QLatin1String("/resources/style.css"));
+ QUrl scriptRequestUrl = QUrl::fromLocalFile(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + QLatin1String("/resources/script.js"));
+ QUrl fontRequestUrl = QUrl::fromLocalFile(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + QLatin1String("/resources/fontawesome.woff"));
+ QUrl xhrRequestUrl = QUrl::fromLocalFile(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + QLatin1String("/resources/test"));
+ QUrl imageFirstPartyUrl =
+ QUrl::fromLocalFile(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + QLatin1String("/resources/image_in_iframe.html"));
+ QUrl imageRequestUrl = QUrl::fromLocalFile(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + QLatin1String("/resources/icons/favicon.png"));
+ QUrl mediaFirstPartyUrl =
+ QUrl::fromLocalFile(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + QLatin1String("/resources/media_in_iframe.html"));
+ QUrl mediaRequestUrl = QUrl::fromLocalFile(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + QLatin1String("/resources/media.mp4"));
+ QUrl faviconFirstPartyUrl = QUrl::fromLocalFile(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + QLatin1String("/resources/favicon.html"));
+ QUrl faviconRequestUrl = QUrl::fromLocalFile(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + QLatin1String("/resources/icons/favicon.png"));
+
QTest::addColumn<QUrl>("requestUrl");
QTest::addColumn<QUrl>("firstPartyUrl");
QTest::addColumn<int>("resourceType");
- QStringList name = { "ui", "io" };
- QVector<InterceptorSetter> setters = { &QWebEngineProfile::setUrlRequestInterceptor,
- &QWebEngineProfile::setRequestInterceptor };
- for (int i = 0; i < 2; i++) {
- QTest::newRow(qPrintable(name[i] + "StyleSheet"))
- << setters[i] << styleRequestUrl << firstPartyUrl
- << static_cast<int>(QWebEngineUrlRequestInfo::ResourceTypeStylesheet);
- QTest::newRow(qPrintable(name[i] + "Script")) << setters[i] << scriptRequestUrl << firstPartyUrl
- << static_cast<int>(QWebEngineUrlRequestInfo::ResourceTypeScript);
- QTest::newRow(qPrintable(name[i] + "Image")) << setters[i] << imageRequestUrl << imageFirstPartyUrl
- << static_cast<int>(QWebEngineUrlRequestInfo::ResourceTypeImage);
- QTest::newRow(qPrintable(name[i] + "FontResource"))
- << setters[i] << fontRequestUrl << firstPartyUrl
- << static_cast<int>(QWebEngineUrlRequestInfo::ResourceTypeFontResource);
- QTest::newRow(qPrintable(name[i] + "Media")) << setters[i] << mediaRequestUrl << mediaFirstPartyUrl
- << static_cast<int>(QWebEngineUrlRequestInfo::ResourceTypeMedia);
- QTest::newRow(qPrintable(name[i] + "Favicon"))
- << setters[i] << faviconRequestUrl << faviconFirstPartyUrl
- << static_cast<int>(QWebEngineUrlRequestInfo::ResourceTypeFavicon);
- QTest::newRow(qPrintable(name[i] + "Xhr")) << setters[i] << xhrRequestUrl << firstPartyUrl
- << static_cast<int>(QWebEngineUrlRequestInfo::ResourceTypeXhr);
- }
+ QTest::newRow("StyleSheet")
+ << styleRequestUrl << firstPartyUrl
+ << static_cast<int>(QWebEngineUrlRequestInfo::ResourceTypeStylesheet);
+ QTest::newRow("Script") << scriptRequestUrl << firstPartyUrl
+ << static_cast<int>(QWebEngineUrlRequestInfo::ResourceTypeScript);
+ QTest::newRow("Image") << imageRequestUrl << imageFirstPartyUrl
+ << static_cast<int>(QWebEngineUrlRequestInfo::ResourceTypeImage);
+ QTest::newRow("FontResource")
+ << fontRequestUrl << firstPartyUrl
+ << static_cast<int>(QWebEngineUrlRequestInfo::ResourceTypeFontResource);
+ QTest::newRow(qPrintable("Media")) << mediaRequestUrl << mediaFirstPartyUrl
+ << static_cast<int>(QWebEngineUrlRequestInfo::ResourceTypeMedia);
+ QTest::newRow("Favicon")
+ << faviconRequestUrl << faviconFirstPartyUrl
+ << static_cast<int>(QWebEngineUrlRequestInfo::ResourceTypeFavicon);
+ QTest::newRow(qPrintable("Xhr")) << xhrRequestUrl << firstPartyUrl
+ << static_cast<int>(QWebEngineUrlRequestInfo::ResourceTypeXhr);
}
void tst_QWebEngineUrlRequestInterceptor::requestInterceptorByResourceType()
{
- if (!QDir(TESTS_SOURCE_DIR).exists())
- W_QSKIP(QString("This test requires access to resources found in '%1'").arg(TESTS_SOURCE_DIR).toLatin1().constData(), SkipAll);
- QFETCH(InterceptorSetter, setter);
+ if (!QDir(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()).exists())
+ W_QSKIP(QString("This test requires access to resources found in '%1'")
+ .arg(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath())
+ .toLatin1()
+ .constData(),
+ SkipAll);
QFETCH(QUrl, requestUrl);
QFETCH(QUrl, firstPartyUrl);
QFETCH(int, resourceType);
QWebEngineProfile profile;
TestRequestInterceptor interceptor(/* intercept */ false);
- (profile.*setter)(&interceptor);
+ profile.setUrlRequestInterceptor(&interceptor);
QWebEnginePage page(&profile);
QSignalSpy loadSpy(&page, SIGNAL(loadFinished(bool)));
page.setUrl(firstPartyUrl);
- QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE_WITH_TIMEOUT(loadSpy.size(), 1, 20000);
- QTRY_COMPARE(interceptor.getUrlRequestForType(static_cast<QWebEngineUrlRequestInfo::ResourceType>(resourceType)).count(), 1);
+ QTRY_COMPARE(interceptor.getUrlRequestForType(static_cast<QWebEngineUrlRequestInfo::ResourceType>(resourceType)).size(), 1);
QList<RequestInfo> infos = interceptor.getUrlRequestForType(static_cast<QWebEngineUrlRequestInfo::ResourceType>(resourceType));
- QVERIFY(infos.count() >= 1);
+ QVERIFY(infos.size() >= 1);
QCOMPARE(infos.at(0).requestUrl, requestUrl);
QCOMPARE(infos.at(0).firstPartyUrl, firstPartyUrl);
QCOMPARE(infos.at(0).resourceType, resourceType);
}
-void tst_QWebEngineUrlRequestInterceptor::firstPartyUrlHttp_data()
-{
- interceptRequest_data();
-}
-
void tst_QWebEngineUrlRequestInterceptor::firstPartyUrlHttp()
{
- QFETCH(InterceptorSetter, setter);
QWebEngineProfile profile;
TestRequestInterceptor interceptor(/* intercept */ false);
- (profile.*setter)(&interceptor);
+ profile.setUrlRequestInterceptor(&interceptor);
QWebEnginePage page(&profile);
QSignalSpy loadSpy(&page, SIGNAL(loadFinished(bool)));
@@ -595,12 +569,6 @@ void tst_QWebEngineUrlRequestInterceptor::firstPartyUrlHttp()
QList<RequestInfo> infos;
- // SubFrame
- QTRY_VERIFY(interceptor.hasUrlRequestForType(QWebEngineUrlRequestInfo::ResourceTypeSubFrame));
- infos = interceptor.getUrlRequestForType(QWebEngineUrlRequestInfo::ResourceTypeSubFrame);
- foreach (auto info, infos)
- QCOMPARE(info.firstPartyUrl, firstPartyUrl);
-
// Stylesheet
QTRY_VERIFY(interceptor.hasUrlRequestForType(QWebEngineUrlRequestInfo::ResourceTypeStylesheet));
infos = interceptor.getUrlRequestForType(QWebEngineUrlRequestInfo::ResourceTypeStylesheet);
@@ -644,56 +612,105 @@ void tst_QWebEngineUrlRequestInterceptor::firstPartyUrlHttp()
QCOMPARE(info.firstPartyUrl, firstPartyUrl);
}
-void tst_QWebEngineUrlRequestInterceptor::passRefererHeader_data()
+void tst_QWebEngineUrlRequestInterceptor::headers()
{
- interceptRequest_data();
+ HttpServer httpServer;
+ httpServer.setResourceDirs({ QDir(QT_TESTCASE_SOURCEDIR).canonicalPath() + "/resources" });
+ QVERIFY(httpServer.start());
+ QWebEngineProfile profile;
+ TestRequestInterceptor interceptor(false);
+ profile.setUrlRequestInterceptor(&interceptor);
+
+ QWebEnginePage page(&profile);
+ QSignalSpy spy(&page, SIGNAL(loadFinished(bool)));
+
+ QWebEngineHttpRequest request(httpServer.url("/content.html"));
+ request.setHeader("X-HEADERNAME", "HEADERVALUE");
+ page.load(request);
+ QVERIFY(spy.wait());
+ QVERIFY(interceptor.requestInfos.last().headers.contains("X-HEADERNAME"));
+ QCOMPARE(interceptor.requestInfos.last().headers.value("X-HEADERNAME"),
+ QByteArray("HEADERVALUE"));
+
+ bool jsFinished = false;
+
+ page.runJavaScript(R"(
+var request = new XMLHttpRequest();
+request.open('GET', 'resource.html', /* async = */ false);
+request.setRequestHeader('X-FOO', 'BAR');
+request.send();
+)",
+ [&](const QVariant &) { jsFinished = true; });
+ QTRY_VERIFY(jsFinished);
+ QVERIFY(interceptor.requestInfos.last().headers.contains("X-FOO"));
+ QCOMPARE(interceptor.requestInfos.last().headers.value("X-FOO"), QByteArray("BAR"));
}
-void tst_QWebEngineUrlRequestInterceptor::passRefererHeader()
+void tst_QWebEngineUrlRequestInterceptor::customHeaders()
{
- QFETCH(InterceptorSetter, setter);
// Create HTTP Server to parse the request.
HttpServer httpServer;
-
- if (!httpServer.start())
- QSKIP("Failed to start http server");
-
- bool succeeded = false;
- connect(&httpServer, &HttpServer::newRequest, [&succeeded](HttpReqRep *rr) {
- const QByteArray headerValue = rr->requestHeader(kHttpHeaderRefererName);
- QCOMPARE(headerValue, kHttpHeaderReferrerValue);
- succeeded = headerValue == kHttpHeaderReferrerValue;
- rr->setResponseStatus(200);
- rr->sendResponse();
- });
+ httpServer.setResourceDirs({ QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + "/resources" });
+ QVERIFY(httpServer.start());
QWebEngineProfile profile;
- TestRequestInterceptor interceptor(true);
- (profile.*setter)(&interceptor);
+ TestRequestInterceptor interceptor(false);
+ profile.setUrlRequestInterceptor(&interceptor);
QWebEnginePage page(&profile);
QSignalSpy spy(&page, SIGNAL(loadFinished(bool)));
- QWebEngineHttpRequest httpRequest;
- QUrl requestUrl = httpServer.url();
- httpRequest.setUrl(requestUrl);
- page.load(httpRequest);
+ interceptor.headers = {
+ { "referer", "http://somereferrer.com/" },
+ { "from", "user@example.com" },
+ { "user-agent", "mozilla/5.0 (x11; linux x86_64; rv:12.0) gecko/20100101 firefox/12.0" },
+ };
+
+ QMap<QByteArray, QByteArray> actual, expected;
+ connect(&httpServer, &HttpServer::newRequest, [&] (HttpReqRep *rr) {
+ for (auto it = expected.begin(); it != expected.end(); ++it) {
+ auto headerValue = rr->requestHeader(it.key());
+ actual[it.key()] = headerValue;
+ QCOMPARE(headerValue, it.value());
+ }
+ });
+
+ auto dumpHeaders = [&] () {
+ QString s; QDebug d(&s);
+ for (auto it = expected.begin(); it != expected.end(); ++it)
+ d << "\n\tHeader:" << it.key() << "| actual:" << actual[it.key()] << "expected:" << it.value();
+ return s;
+ };
+
+ expected = interceptor.headers;
+ page.load(httpServer.url("/content.html"));
QVERIFY(spy.wait());
- (void) httpServer.stop();
- QVERIFY(succeeded);
-}
+ QVERIFY2(actual == expected, qPrintable(dumpHeaders()));
+
+ // test that custom headers are also applied on redirect
+ interceptor.shouldRedirect = true;
+ interceptor.redirectUrl = httpServer.url("/content2.html");
+ interceptor.headers = {
+ { "referer", "http://somereferrer2.com/" },
+ { "from", "user2@example.com" },
+ { "user-agent", "mozilla/5.0 (compatible; googlebot/2.1; +http://www.google.com/bot.html)" },
+ };
+
+ actual.clear();
+ expected = interceptor.headers;
+ page.triggerAction(QWebEnginePage::Reload);
+ QVERIFY(spy.wait());
+ QVERIFY2(actual == expected, qPrintable(dumpHeaders()));
-void tst_QWebEngineUrlRequestInterceptor::initiator_data()
-{
- interceptRequest_data();
+ (void) httpServer.stop();
}
void tst_QWebEngineUrlRequestInterceptor::initiator()
{
- QFETCH(InterceptorSetter, setter);
QWebEngineProfile profile;
TestRequestInterceptor interceptor(/* intercept */ false);
- (profile.*setter)(&interceptor);
+ profile.setUrlRequestInterceptor(&interceptor);
QWebEnginePage page(&profile);
QSignalSpy loadSpy(&page, SIGNAL(loadFinished(bool)));
@@ -704,12 +721,6 @@ void tst_QWebEngineUrlRequestInterceptor::initiator()
QList<RequestInfo> infos;
- // SubFrame
- QTRY_VERIFY(interceptor.hasUrlRequestForType(QWebEngineUrlRequestInfo::ResourceTypeSubFrame));
- infos = interceptor.getUrlRequestForType(QWebEngineUrlRequestInfo::ResourceTypeSubFrame);
- foreach (auto info, infos)
- QVERIFY(interceptor.requestInitiatorUrls[info.requestUrl].contains(info.initiator));
-
// Stylesheet
QTRY_VERIFY(interceptor.hasUrlRequestForType(QWebEngineUrlRequestInfo::ResourceTypeStylesheet));
infos = interceptor.getUrlRequestForType(QWebEngineUrlRequestInfo::ResourceTypeStylesheet);
@@ -753,30 +764,31 @@ void tst_QWebEngineUrlRequestInterceptor::initiator()
QVERIFY(interceptor.requestInitiatorUrls[info.requestUrl].contains(info.initiator));
}
-void tst_QWebEngineUrlRequestInterceptor::jsServiceWorker_data()
-{
- interceptRequest_data();
-}
-
void tst_QWebEngineUrlRequestInterceptor::jsServiceWorker()
{
- QFETCH(InterceptorSetter, setter);
- TestServer server;
+ HttpServer server;
+ server.setResourceDirs({ QDir(QT_TESTCASE_SOURCEDIR).canonicalPath() + "/resources" });
QVERIFY(server.start());
-
- QWebEngineProfile profile(QStringLiteral("Test"));
+ QWebEngineProfile profile;
std::unique_ptr<ConsolePage> page;
page.reset(new ConsolePage(&profile));
TestRequestInterceptor interceptor(/* intercept */ false);
- (profile.*setter)(&interceptor);
+ profile.setUrlRequestInterceptor(&interceptor);
QVERIFY(loadSync(page.get(), server.url("/sw.html")));
// We expect only one message here, because logging of services workers is not exposed in our API.
- QTRY_COMPARE(page->messages.count(), 1);
- QCOMPARE(page->levels.at(0), QWebEnginePage::InfoMessageLevel);
+ // Note this is very fragile setup , you need fresh profile otherwise install event might not get triggered
+ // and this in turn can lead to incorrect intercepted requests, therefore we should keep this off the record.
+ QTRY_COMPARE_WITH_TIMEOUT(page->messages.size(), 5, 20000);
- QUrl firstPartyUrl = QUrl(server.url().toString() + "sw.js");
+ QCOMPARE(page->levels.at(0), QWebEnginePage::InfoMessageLevel);
+ QCOMPARE(page->messages.at(0),QLatin1String("Service worker installing"));
+ QCOMPARE(page->messages.at(1),QLatin1String("Service worker installed"));
+ QCOMPARE(page->messages.at(2),QLatin1String("Service worker activating"));
+ QCOMPARE(page->messages.at(3),QLatin1String("Service worker activated"));
+ QCOMPARE(page->messages.at(4),QLatin1String("Service worker done"));
+ QUrl firstPartyUrl = QUrl(server.url().toString() + "sw.html");
QList<RequestInfo> infos;
// Service Worker
QTRY_VERIFY(interceptor.hasUrlRequestForType(QWebEngineUrlRequestInfo::ResourceTypeServiceWorker));
@@ -787,5 +799,324 @@ void tst_QWebEngineUrlRequestInterceptor::jsServiceWorker()
QVERIFY(server.stop());
}
+void tst_QWebEngineUrlRequestInterceptor::replaceInterceptor_data()
+{
+ QTest::addColumn<bool>("firstInterceptIsInPage");
+ QTest::addColumn<bool>("keepInterceptionPoint");
+ QTest::newRow("page") << true << true;
+ QTest::newRow("page-profile") << true << false;
+ QTest::newRow("profile") << false << true;
+ QTest::newRow("profile-page") << false << false;
+}
+
+void tst_QWebEngineUrlRequestInterceptor::replaceInterceptor()
+{
+ QFETCH(bool, firstInterceptIsInPage);
+ QFETCH(bool, keepInterceptionPoint);
+
+ HttpServer server;
+ server.setResourceDirs({ ":/resources" });
+ QVERIFY(server.start());
+
+ QWebEngineProfile profile;
+ profile.settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, false);
+ QWebEnginePage page(&profile);
+ QSignalSpy spy(&page, SIGNAL(loadFinished(bool)));
+ bool fetchFinished = false;
+
+ auto setInterceptor = [&] (QWebEngineUrlRequestInterceptor *interceptor, bool interceptInPage) {
+ interceptInPage ? page.setUrlRequestInterceptor(interceptor) : profile.setUrlRequestInterceptor(interceptor);
+ };
+
+ std::vector<TestRequestInterceptor> interceptors(3);
+ std::vector<int> requestsOnReplace;
+ setInterceptor(&interceptors.front(), firstInterceptIsInPage);
+
+ auto sc = connect(&page, &QWebEnginePage::loadFinished, [&] () {
+ auto currentInterceptorIndex = requestsOnReplace.size();
+ requestsOnReplace.push_back(interceptors[currentInterceptorIndex].requestInfos.size());
+
+ bool isFirstReinstall = currentInterceptorIndex == 0;
+ bool interceptInPage = keepInterceptionPoint ? firstInterceptIsInPage : (isFirstReinstall ^ firstInterceptIsInPage);
+ setInterceptor(&interceptors[++currentInterceptorIndex], interceptInPage);
+ if (!keepInterceptionPoint)
+ setInterceptor(nullptr, !interceptInPage);
+
+ if (isFirstReinstall) {
+ page.triggerAction(QWebEnginePage::Reload);
+ } else {
+ page.runJavaScript("fetch('http://nonexistent.invalid').catch(() => {})", [&, interceptInPage] (const QVariant &) {
+ requestsOnReplace.push_back(interceptors.back().requestInfos.size());
+ setInterceptor(nullptr, interceptInPage);
+ fetchFinished = true;
+ });
+ }
+ });
+
+ page.setUrl(server.url("/favicon.html"));
+ QTRY_COMPARE_WITH_TIMEOUT(spy.size(), 2, 20000);
+ QTRY_VERIFY(fetchFinished);
+
+ QString s; QDebug d(&s);
+ for (auto i = 0u; i < interceptors.size(); ++i) {
+ auto &&interceptor = interceptors[i];
+ auto &&requests = interceptor.requestInfos;
+ d << "\nInterceptor [" << i << "] with" << requestsOnReplace[i] << "requests on replace and" << requests.size() << "in the end:";
+ for (int j = 0; j < requests.size(); ++j) {
+ auto &&r = requests[j];
+ d << "\n\t" << j << "| url:" << r.requestUrl << "firstPartyUrl:" << r.firstPartyUrl;
+ }
+ QVERIFY2(!requests.isEmpty(), qPrintable(s));
+ QVERIFY2(requests.size() == requestsOnReplace[i], qPrintable(s));
+ }
+}
+
+void tst_QWebEngineUrlRequestInterceptor::replaceOnIntercept()
+{
+ HttpServer server;
+ server.setResourceDirs({ ":/resources" });
+ QVERIFY(server.start());
+
+ QWebEngineProfile profile;
+ profile.settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, false);
+ QWebEnginePage page(&profile);
+ QSignalSpy spy(&page, SIGNAL(loadFinished(bool)));
+
+ struct Interceptor : QWebEngineUrlRequestInterceptor {
+ Interceptor(const std::function<void ()> &a) : action(a) { }
+ void interceptRequest(QWebEngineUrlRequestInfo &) override { action(); }
+ std::function<void ()> action;
+ int interceptRequestReceived = 0;
+ };
+
+ TestRequestInterceptor profileInterceptor, pageInterceptor1, pageInterceptor2;
+ page.setUrlRequestInterceptor(&pageInterceptor1);
+ profile.setUrlRequestInterceptor(&profileInterceptor);
+ profileInterceptor.onIntercept = [&] (QWebEngineUrlRequestInfo &) {
+ page.setUrlRequestInterceptor(&pageInterceptor2);
+ return true;
+ };
+
+ page.setUrl(server.url("/favicon.html"));
+ QTRY_COMPARE_WITH_TIMEOUT(spy.size(), 1, 20000);
+ QTRY_COMPARE(profileInterceptor.requestInfos.size(), 2);
+
+ // if interceptor for page was replaced on intercept call in profile then, since request first
+ // comes to profile, forward to page's interceptor should land to second one
+ QCOMPARE(pageInterceptor1.requestInfos.size(), 0);
+ QCOMPARE(profileInterceptor.requestInfos.size(), pageInterceptor2.requestInfos.size());
+
+ page.setUrlRequestInterceptor(&pageInterceptor1);
+ bool fetchFinished = false;
+ page.runJavaScript("fetch('http://nonexistent.invalid').catch(() => {})", [&] (const QVariant &) {
+ page.setUrlRequestInterceptor(&pageInterceptor2);
+ fetchFinished = true;
+ });
+
+ QTRY_VERIFY(fetchFinished);
+ QCOMPARE(profileInterceptor.requestInfos.size(), 3);
+ QCOMPARE(pageInterceptor1.requestInfos.size(), 0);
+ QCOMPARE(profileInterceptor.requestInfos.size(), pageInterceptor2.requestInfos.size());
+}
+
+void tst_QWebEngineUrlRequestInterceptor::multipleRedirects()
+{
+ HttpServer server;
+ server.setResourceDirs({ ":/resources" });
+ QVERIFY(server.start());
+
+ TestMultipleRedirectsInterceptor multiInterceptor;
+ multiInterceptor.redirectPairs.insert(QUrl(server.url("/content.html")), QUrl(server.url("/content2.html")));
+ multiInterceptor.redirectPairs.insert(QUrl(server.url("/content2.html")), QUrl(server.url("/content3.html")));
+
+ QWebEngineProfile profile;
+ profile.settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, false);
+ profile.setUrlRequestInterceptor(&multiInterceptor);
+ QWebEnginePage page(&profile);
+ QSignalSpy spy(&page, SIGNAL(loadFinished(bool)));
+
+ page.setUrl(server.url("/content.html"));
+
+ QTRY_COMPARE_WITH_TIMEOUT(spy.count(), 1, 20000);
+ QTRY_COMPARE(multiInterceptor.redirectCount, 2);
+ QTRY_COMPARE(multiInterceptor.requestInfos.size(), 2);
+}
+
+class TestPostRequestInterceptor : public QWebEngineUrlRequestInterceptor
+{
+public:
+ TestPostRequestInterceptor(QString expected, bool isAppendFile, QObject *parent = nullptr)
+ : QWebEngineUrlRequestInterceptor(parent)
+ , m_expected(expected)
+ , m_isAppendFile(isAppendFile)
+ {};
+
+ void interceptRequest(QWebEngineUrlRequestInfo &info) override
+ {
+ info.block(true);
+ isCalled = true;
+
+ QIODevice *requestBodyDevice = info.requestBody();
+
+ if (m_isAppendFile) {
+ info.d_ptr->appendFileToResourceRequestBodyForTest(":/resources/postBodyFile.txt");
+ }
+
+ requestBodyDevice->open(QIODevice::ReadOnly);
+
+ const QString webKitBoundary = requestBodyDevice->read(40);
+ QVERIFY(webKitBoundary.contains("------WebKitFormBoundary"));
+
+ const QString fullBodyWithoutBoundaries = (webKitBoundary + requestBodyDevice->readAll())
+ .replace(webKitBoundary, "")
+ .replace("\r", "")
+ .replace("\n", "")
+ .replace(" ", "");
+
+ QCOMPARE(fullBodyWithoutBoundaries, m_expected);
+
+ requestBodyDevice->close();
+ }
+
+ bool isCalled = false;
+ QString m_expected;
+ bool m_isAppendFile;
+};
+
+void tst_QWebEngineUrlRequestInterceptor::postWithBody_data()
+{
+ QTest::addColumn<QString>("input");
+ QTest::addColumn<QString>("output");
+ QTest::addColumn<bool>("isAppendFile");
+ QTest::addRow("FormData append (DataElementByte)")
+ << "fd.append('userId', 1);"
+ "fd.append('title',' Test123');"
+ "fd.append('completed', false);"
+ << "Content-Disposition:form-data;name=\"userId"
+ "\"1Content-Disposition:form-data"
+ ";name=\"title\"Test123Content-Di"
+ "sposition:form-data;name=\"completed\"f"
+ "alse--"
+ << false;
+ QTest::addRow("FormData blob (DataElementPipe)")
+ << "const blob1 = new Blob(['blob1thisisablob'],"
+ "{type: 'text/plain'});"
+ "fd.append('blob1', blob1);"
+ << "Content-Disposition:form-data;name=\"blob1"
+ "\";filename=\"blob\"Content-Type:text/plai"
+ "nblob1thisisablob--"
+ << false;
+ QTest::addRow("Append file (DataElementFile)") << ""
+ << "--{\"test\":\"1234\"}\"1234\"}" << true;
+ QTest::addRow("All combined") << "fd.append('userId', 1);"
+ "fd.append('title', 'Test123');"
+ "fd.append('completed', false);"
+ "const blob1 = new Blob(['blob1thisisablob'],"
+ "{type: 'text/plain'});"
+ "const blob2 = new Blob(['blob2thisisanotherblob'],"
+ "{type: 'text/plain'});"
+ "fd.append('blob1', blob1);"
+ "fd.append('userId', 2);"
+ "fd.append('title', 'Test456');"
+ "fd.append('completed', true);"
+ "fd.append('blob2', blob2);"
+ << "Content-Disposition:form-data;name=\"userId\""
+ "1Content-Disposition:form-data;na"
+ "me=\"title\"Test123Content-Disposit"
+ "ion:form-data;name=\"completed\"false"
+ "Content-Disposition:form-data;name=\"blob1\";"
+ "filename=\"blob\"Content-Type:text/plain"
+ "blob1thisisablobContent-Disposition:form-"
+ "data;name=\"userId\"2Content-Dispos"
+ "ition:form-data;name=\"title\"Test456"
+ "Content-Disposition:form-data;name=\"complete"
+ "d\"trueContent-Disposition:form-da"
+ "ta;name=\"blob2\";filename=\"blob\"Content-Ty"
+ "pe:text/plainblob2thisisanotherblob--"
+ "{\"test\":\"1234\"}\"1234\"}"
+ << true;
+}
+
+void tst_QWebEngineUrlRequestInterceptor::postWithBody()
+{
+ QFETCH(QString, input);
+ QFETCH(QString, output);
+ QFETCH(bool, isAppendFile);
+
+ QString script;
+ script.append("const fd = new FormData();");
+ script.append(input);
+ script.append("fetch('http://127.0.0.1', {method: 'POST',body: fd});");
+
+ QWebEngineProfile profile;
+ profile.settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, false);
+ TestPostRequestInterceptor interceptor(output, isAppendFile);
+ profile.setUrlRequestInterceptor(&interceptor);
+ QWebEnginePage page(&profile);
+ bool ok = false;
+
+ page.runJavaScript(script, [&ok](const QVariant) { ok = true; });
+
+ QTRY_VERIFY(ok);
+ QVERIFY(interceptor.isCalled);
+}
+
+class PageOrProfileInterceptor : public QWebEngineUrlRequestInterceptor
+{
+public:
+ PageOrProfileInterceptor(const QString &profileAction)
+ : profileAction(profileAction)
+ {
+ }
+
+ void interceptRequest(QWebEngineUrlRequestInfo &info) override
+ {
+ if (profileAction == "block")
+ info.block(true);
+ else if (profileAction == "redirect")
+ info.redirect(QUrl("data:text/html,<p>redirected"));
+ else if (profileAction == "add header")
+ info.setHttpHeader("Custom-Header", "Value");
+ else
+ QVERIFY(info.httpHeaders().contains("Custom-Header"));
+ ran = true;
+ }
+
+ QString profileAction;
+ bool ran = false;
+};
+
+void tst_QWebEngineUrlRequestInterceptor::profilePreventsPageInterception_data()
+{
+ QTest::addColumn<QString>("profileAction");
+ QTest::addColumn<bool>("interceptInProfile");
+ QTest::addColumn<bool>("interceptInPage");
+ QTest::newRow("block") << "block" << true << false;
+ QTest::newRow("redirect") << "redirect" << true << false;
+ QTest::newRow("add header") << "add header" << true << true;
+}
+
+void tst_QWebEngineUrlRequestInterceptor::profilePreventsPageInterception()
+{
+ QFETCH(QString, profileAction);
+ QFETCH(bool, interceptInProfile);
+ QFETCH(bool, interceptInPage);
+
+ QWebEngineProfile profile;
+ PageOrProfileInterceptor profileInterceptor(profileAction);
+ profile.setUrlRequestInterceptor(&profileInterceptor);
+ profile.settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, false);
+
+ QWebEnginePage page(&profile);
+ PageOrProfileInterceptor pageInterceptor("");
+ page.setUrlRequestInterceptor(&pageInterceptor);
+ QSignalSpy loadSpy(&page, SIGNAL(loadFinished(bool)));
+
+ page.load(QUrl("qrc:///resources/index.html"));
+ QTRY_COMPARE(loadSpy.size(), 1);
+ QCOMPARE(profileInterceptor.ran, interceptInProfile);
+ QCOMPARE(pageInterceptor.ran, interceptInPage);
+}
+
QTEST_MAIN(tst_QWebEngineUrlRequestInterceptor)
#include "tst_qwebengineurlrequestinterceptor.moc"
diff --git a/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.qrc b/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.qrc
deleted file mode 100644
index 6a34635f7..000000000
--- a/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.qrc
+++ /dev/null
@@ -1,24 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
- <qresource prefix="/">
- <file>resources/content.html</file>
- <file>resources/favicon.html</file>
- <file>resources/firstparty.html</file>
- <file>resources/fontawesome.woff</file>
- <file>resources/iframe.html</file>
- <file>resources/iframe2.html</file>
- <file>resources/iframe3.html</file>
- <file>resources/image.html</file>
- <file>resources/image_in_iframe.html</file>
- <file>resources/index.html</file>
- <file>resources/media.html</file>
- <file>resources/media.mp4</file>
- <file>resources/media_in_iframe.html</file>
- <file>resources/resource.html</file>
- <file>resources/resource_in_iframe.html</file>
- <file>resources/script.js</file>
- <file>resources/style.css</file>
- <file>resources/sw.html</file>
- <file>resources/sw.js</file>
- <file>resources/icons/favicon.png</file>
- </qresource>
-</RCC>
diff --git a/tests/auto/core/qwebengineurlrequestjob/CMakeLists.txt b/tests/auto/core/qwebengineurlrequestjob/CMakeLists.txt
new file mode 100644
index 000000000..02b668313
--- /dev/null
+++ b/tests/auto/core/qwebengineurlrequestjob/CMakeLists.txt
@@ -0,0 +1,22 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_test(tst_qwebengineurlrequestjob
+ SOURCES
+ tst_qwebengineurlrequestjob.cpp
+ LIBRARIES
+ Qt::WebEngineCore
+)
+
+# Resources:
+set(tst_qwebengineurlrequestjob_resource_files
+ "additionalResponseHeadersScript.html"
+ "requestBodyScript.html"
+)
+
+qt_add_resources(tst_qwebengineurlrequestjob "tst_qwebengineurlrequestjob"
+ PREFIX
+ "/"
+ FILES
+ ${tst_qwebengineurlrequestjob_resource_files}
+)
diff --git a/tests/auto/core/qwebengineurlrequestjob/additionalResponseHeadersScript.html b/tests/auto/core/qwebengineurlrequestjob/additionalResponseHeadersScript.html
new file mode 100644
index 000000000..a1b8a92d3
--- /dev/null
+++ b/tests/auto/core/qwebengineurlrequestjob/additionalResponseHeadersScript.html
@@ -0,0 +1,12 @@
+<!doctype html>
+<html>
+<body>
+ <script type="text/javascript">
+ var request = new XMLHttpRequest();
+ request.open('GET', 'additionalresponseheadershandler:about', /* async = */ false);
+ request.send();
+ var headers = request.getAllResponseHeaders();
+ console.log("TST_ADDITIONALRESPONSEHEADERS;" + headers);
+ </script>
+</body>
+</html>
diff --git a/tests/auto/core/qwebengineurlrequestjob/requestBodyScript.html b/tests/auto/core/qwebengineurlrequestjob/requestBodyScript.html
new file mode 100644
index 000000000..95b7ff1bf
--- /dev/null
+++ b/tests/auto/core/qwebengineurlrequestjob/requestBodyScript.html
@@ -0,0 +1,12 @@
+<!doctype html>
+<html>
+<body>
+ <script type="text/javascript">
+ var request = new XMLHttpRequest();
+ request.open('POST', 'requestbodyhandler:about', /* async = */ false);
+ request.setRequestHeader('Content-Type', 'text/plain');
+ request.send('reading request body successful');
+ console.log("TST_REQUESTBODY;" + request.response);
+ </script>
+</body>
+</html>
diff --git a/tests/auto/core/qwebengineurlrequestjob/tst_qwebengineurlrequestjob.cpp b/tests/auto/core/qwebengineurlrequestjob/tst_qwebengineurlrequestjob.cpp
new file mode 100644
index 000000000..d48da2c44
--- /dev/null
+++ b/tests/auto/core/qwebengineurlrequestjob/tst_qwebengineurlrequestjob.cpp
@@ -0,0 +1,187 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#include <QtTest/QtTest>
+#include <QtWebEngineCore/qwebengineurlschemehandler.h>
+#include <QtWebEngineCore/qwebengineurlscheme.h>
+#include <QtWebEngineCore/qwebengineurlrequestjob.h>
+#include <QtWebEngineCore/qwebengineprofile.h>
+#include <QtWebEngineCore/qwebenginepage.h>
+
+class CustomPage : public QWebEnginePage
+{
+ Q_OBJECT
+
+public:
+ CustomPage(QWebEngineProfile *profile, QString compareStringPrefix, QString compareStringSuffix,
+ QObject *parent = nullptr)
+ : QWebEnginePage(profile, parent)
+ , m_compareStringPrefix(compareStringPrefix)
+ , m_compareStringSuffix(compareStringSuffix)
+ , m_comparedMessageCount(0)
+ {
+ }
+
+ int comparedMessageCount() const { return m_comparedMessageCount; }
+
+signals:
+ void receivedMessage();
+
+protected:
+ void javaScriptConsoleMessage(QWebEnginePage::JavaScriptConsoleMessageLevel level,
+ const QString &message, int lineNumber,
+ const QString &sourceID) override
+ {
+ Q_UNUSED(level);
+ Q_UNUSED(lineNumber);
+ Q_UNUSED(sourceID);
+
+ auto splitMessage = message.split(";");
+ if (splitMessage[0] == m_compareStringPrefix) {
+ QCOMPARE(splitMessage[1], m_compareStringSuffix);
+ m_comparedMessageCount++;
+ emit receivedMessage();
+ }
+ }
+
+private:
+ QString m_compareStringPrefix;
+ QString m_compareStringSuffix;
+ int m_comparedMessageCount;
+};
+
+class AdditionalResponseHeadersHandler : public QWebEngineUrlSchemeHandler
+{
+ Q_OBJECT
+public:
+ AdditionalResponseHeadersHandler(bool addAdditionalResponseHeaders, QObject *parent = nullptr)
+ : QWebEngineUrlSchemeHandler(parent)
+ , m_addAdditionalResponseHeaders(addAdditionalResponseHeaders)
+ {
+ }
+
+ void requestStarted(QWebEngineUrlRequestJob *job) override
+ {
+ QCOMPARE(job->requestUrl(), QUrl(schemeName + ":about"));
+
+ QMultiMap<QByteArray, QByteArray> additionalResponseHeaders;
+ if (m_addAdditionalResponseHeaders) {
+ additionalResponseHeaders.insert(QByteArray::fromStdString("test1"),
+ QByteArray::fromStdString("test1VALUE"));
+ additionalResponseHeaders.insert(QByteArray::fromStdString("test2"),
+ QByteArray::fromStdString("test2VALUE"));
+ }
+ job->setAdditionalResponseHeaders(additionalResponseHeaders);
+
+ QFile *file = new QFile(QStringLiteral(":additionalResponseHeadersScript.html"), job);
+ file->open(QIODevice::ReadOnly);
+
+ job->reply(QByteArrayLiteral("text/html"), file);
+ }
+
+ static void registerUrlScheme()
+ {
+ QWebEngineUrlScheme webUiScheme(schemeName);
+ webUiScheme.setFlags(QWebEngineUrlScheme::CorsEnabled);
+ QWebEngineUrlScheme::registerScheme(webUiScheme);
+ }
+
+ const static inline QByteArray schemeName =
+ QByteArrayLiteral("additionalresponseheadershandler");
+
+private:
+ bool m_addAdditionalResponseHeaders;
+};
+
+class RequestBodyHandler : public QWebEngineUrlSchemeHandler
+{
+ Q_OBJECT
+public:
+ void requestStarted(QWebEngineUrlRequestJob *job) override
+ {
+ QCOMPARE(job->requestUrl(), QUrl(schemeName + ":about"));
+ QCOMPARE(job->requestMethod(), QByteArrayLiteral("POST"));
+
+ QIODevice *requestBodyDevice = job->requestBody();
+ requestBodyDevice->open(QIODevice::ReadOnly);
+ QByteArray requestBody = requestBodyDevice->readAll();
+ requestBodyDevice->close();
+
+ QBuffer *buf = new QBuffer(job);
+ buf->open(QBuffer::ReadWrite);
+ buf->write(requestBody);
+ job->reply(QByteArrayLiteral("text/plain"), buf);
+ buf->close();
+ }
+
+ static void registerUrlScheme()
+ {
+ QWebEngineUrlScheme webUiScheme(schemeName);
+ webUiScheme.setFlags(QWebEngineUrlScheme::CorsEnabled
+ | QWebEngineUrlScheme::FetchApiAllowed);
+ QWebEngineUrlScheme::registerScheme(webUiScheme);
+ }
+
+ const static inline QByteArray schemeName = QByteArrayLiteral("requestbodyhandler");
+};
+
+class tst_QWebEngineUrlRequestJob : public QObject
+{
+ Q_OBJECT
+
+public:
+ tst_QWebEngineUrlRequestJob() { }
+
+private Q_SLOTS:
+ void initTestCase()
+ {
+ AdditionalResponseHeadersHandler::registerUrlScheme();
+ RequestBodyHandler::registerUrlScheme();
+ }
+
+ void withAdditionalResponseHeaders_data()
+ {
+ QTest::addColumn<bool>("withHeaders");
+ QTest::addColumn<QString>("expectedHeaders");
+ QTest::newRow("headers enabled")
+ << true << "content-type: text/html\r\ntest1: test1value\r\ntest2: test2value\r\n";
+ QTest::newRow("headers disabled") << false << "content-type: text/html\r\n";
+ }
+
+ void withAdditionalResponseHeaders()
+ {
+ QFETCH(bool, withHeaders);
+ QFETCH(QString, expectedHeaders);
+
+ QWebEngineProfile profile;
+
+ AdditionalResponseHeadersHandler handler(withHeaders);
+ profile.installUrlSchemeHandler(AdditionalResponseHeadersHandler::schemeName, &handler);
+
+ CustomPage page(&profile, "TST_ADDITIONALRESPONSEHEADERS", expectedHeaders);
+ QSignalSpy spy(&page, SIGNAL(loadFinished(bool)));
+
+ page.load(QUrl("qrc:///additionalResponseHeadersScript.html"));
+ QVERIFY(spy.wait());
+ QCOMPARE(page.comparedMessageCount(), 1);
+ }
+
+ void requestBody()
+ {
+ QWebEngineProfile profile;
+
+ RequestBodyHandler handler;
+ profile.installUrlSchemeHandler(RequestBodyHandler::schemeName, &handler);
+
+ const QString expected = "reading request body successful";
+ CustomPage page(&profile, "TST_REQUESTBODY", expected);
+ QSignalSpy spy(&page, SIGNAL(receivedMessage()));
+
+ page.load(QUrl("qrc:///requestBodyScript.html"));
+ QVERIFY(spy.wait());
+ QCOMPARE(page.comparedMessageCount(), 1);
+ }
+};
+
+QTEST_MAIN(tst_QWebEngineUrlRequestJob)
+#include "tst_qwebengineurlrequestjob.moc"
diff --git a/tests/auto/core/tests.pri b/tests/auto/core/tests.pri
deleted file mode 100644
index 59d6c0865..000000000
--- a/tests/auto/core/tests.pri
+++ /dev/null
@@ -1,17 +0,0 @@
-TEMPLATE = app
-
-CONFIG += testcase
-
-VPATH += $$_PRO_FILE_PWD_
-TARGET = tst_$$TARGET
-
-SOURCES += $${TARGET}.cpp
-INCLUDEPATH += $$PWD
-
-exists($$_PRO_FILE_PWD_/$${TARGET}.qrc): RESOURCES += $${TARGET}.qrc
-
-QT += testlib network webenginewidgets widgets
-
-# This define is used by some tests to look up resources in the source tree
-DEFINES += TESTS_SOURCE_DIR=\\\"$$PWD/\\\"
-include(../embed_info_plist.pri)
diff --git a/tests/auto/core/webenginedriver/CMakeLists.txt b/tests/auto/core/webenginedriver/CMakeLists.txt
new file mode 100644
index 000000000..c8cf8b3ab
--- /dev/null
+++ b/tests/auto/core/webenginedriver/CMakeLists.txt
@@ -0,0 +1,15 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.16)
+ project(tst_webenginedriver LANGUAGES CXX)
+ find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST)
+endif()
+
+add_subdirectory(test)
+add_subdirectory(browser)
+
+add_dependencies(tst_webenginedriver
+ testbrowser
+)
diff --git a/tests/auto/core/webenginedriver/browser/CMakeLists.txt b/tests/auto/core/webenginedriver/browser/CMakeLists.txt
new file mode 100644
index 000000000..25e162e7b
--- /dev/null
+++ b/tests/auto/core/webenginedriver/browser/CMakeLists.txt
@@ -0,0 +1,13 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_executable(testbrowser
+ SOURCES
+ main.cpp
+ LIBRARIES
+ Qt::Core
+ Qt::Gui
+ Qt::WebEngineWidgets
+ OUTPUT_DIRECTORY
+ ${CMAKE_CURRENT_BINARY_DIR}/..
+)
diff --git a/tests/auto/core/webenginedriver/browser/main.cpp b/tests/auto/core/webenginedriver/browser/main.cpp
new file mode 100644
index 000000000..4b8f3513f
--- /dev/null
+++ b/tests/auto/core/webenginedriver/browser/main.cpp
@@ -0,0 +1,21 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include <QtWebEngineCore/qwebenginepage.h>
+#include <QtWebEngineWidgets/qwebengineview.h>
+#include <QtWidgets/qapplication.h>
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QWebEngineView view;
+ QObject::connect(view.page(), &QWebEnginePage::windowCloseRequested, &app, &QApplication::quit);
+ QObject::connect(&app, &QApplication::aboutToQuit,
+ []() { fprintf(stderr, "Test browser is about to quit.\n"); });
+
+ view.resize(100, 100);
+ view.show();
+
+ return app.exec();
+}
diff --git a/tests/auto/core/webenginedriver/resources/input.html b/tests/auto/core/webenginedriver/resources/input.html
new file mode 100644
index 000000000..c21458350
--- /dev/null
+++ b/tests/auto/core/webenginedriver/resources/input.html
@@ -0,0 +1,5 @@
+<html>
+<body>
+ <input type="text" id="text_input">
+</body>
+</html>
diff --git a/tests/auto/core/webenginedriver/test/CMakeLists.txt b/tests/auto/core/webenginedriver/test/CMakeLists.txt
new file mode 100644
index 000000000..041bf955b
--- /dev/null
+++ b/tests/auto/core/webenginedriver/test/CMakeLists.txt
@@ -0,0 +1,26 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+include(../../../util/util.cmake)
+
+qt_internal_add_test(tst_webenginedriver
+ SOURCES
+ ../tst_webenginedriver.cpp
+ LIBRARIES
+ Qt::Network
+ Qt::WebEngineCore
+ Qt::WebEngineWidgets
+ Test::Util
+ OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+)
+
+set(tst_webenginedriver_resource_files
+ "../resources/input.html"
+)
+
+qt_internal_add_resource(tst_webenginedriver "tst_webenginedriver"
+ PREFIX
+ "/"
+ FILES
+ ${tst_webenginedriver_resource_files}
+)
diff --git a/tests/auto/core/webenginedriver/tst_webenginedriver.cpp b/tests/auto/core/webenginedriver/tst_webenginedriver.cpp
new file mode 100644
index 000000000..cd3098b25
--- /dev/null
+++ b/tests/auto/core/webenginedriver/tst_webenginedriver.cpp
@@ -0,0 +1,631 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#include <QtTest/QtTest>
+
+#include <QtCore/qjsondocument.h>
+#include <QtCore/qlibraryinfo.h>
+#include <QtCore/qobject.h>
+#include <QtCore/qprocess.h>
+#include <QtGui/qimage.h>
+#include <QtNetwork/qnetworkaccessmanager.h>
+#include <QtNetwork/qnetworkreply.h>
+#include <QtNetwork/qnetworkrequest.h>
+#include <QtWebEngineCore/qtwebenginecoreglobal.h>
+#include <QtWebEngineCore/qwebenginepage.h>
+#include <QtWebEngineCore/qwebengineprofile.h>
+#include <QtWebEngineWidgets/qwebengineview.h>
+
+#include <widgetutil.h>
+
+#define REMOTE_DEBUGGING_PORT 12345
+#define WEBENGINEDRIVER_PORT 9515
+
+class DriverServer : public QObject
+{
+ Q_OBJECT
+
+public:
+ DriverServer(QProcessEnvironment processEnvironment = {}, QStringList processArguments = {})
+ : m_serverURL(QUrl(
+ QLatin1String("http://localhost:%1").arg(QString::number(WEBENGINEDRIVER_PORT))))
+ {
+ QString driverPath = QLibraryInfo::path(QLibraryInfo::LibraryExecutablesPath)
+ + QLatin1String("/webenginedriver");
+#if defined(Q_OS_WIN)
+ driverPath += QLatin1String(".exe");
+#endif
+ m_process.setProgram(driverPath);
+
+ if (processArguments.isEmpty())
+ processArguments
+ << QLatin1String("--port=%1").arg(QString::number(WEBENGINEDRIVER_PORT));
+ m_process.setArguments(processArguments);
+
+ if (!processEnvironment.isEmpty())
+ m_process.setProcessEnvironment(processEnvironment);
+
+ connect(&m_process, &QProcess::errorOccurred, [this](QProcess::ProcessError error) {
+ qWarning() << "WebEngineDriver error occurred:" << error;
+ dumpConsoleMessages();
+ });
+
+ connect(&m_process, &QProcess::readyReadStandardError, [this]() {
+ QProcess::ProcessChannel tmp = m_process.readChannel();
+ m_process.setReadChannel(QProcess::StandardError);
+ while (m_process.canReadLine()) {
+ QString line = QString::fromUtf8(m_process.readLine());
+ if (line.endsWith(QLatin1Char('\n')))
+ line.truncate(line.size() - 1);
+ m_stderr << line;
+ }
+ m_process.setReadChannel(tmp);
+ });
+
+ connect(&m_process, &QProcess::readyReadStandardOutput, [this]() {
+ QProcess::ProcessChannel tmp = m_process.readChannel();
+ m_process.setReadChannel(QProcess::StandardOutput);
+ while (m_process.canReadLine()) {
+ QString line = QString::fromUtf8(m_process.readLine());
+ if (line.endsWith(QLatin1Char('\n')))
+ line.truncate(line.size() - 1);
+ m_stdout << line;
+ }
+ m_process.setReadChannel(tmp);
+ });
+ }
+
+ ~DriverServer()
+ {
+ if (m_process.state() != QProcess::Running)
+ return;
+
+ if (!m_sessionId.isEmpty())
+ deleteSession();
+
+ shutdown();
+ }
+
+ bool start()
+ {
+ if (!QFileInfo::exists(m_process.program())) {
+ qWarning() << "WebEngineDriver executable not found:" << m_process.program();
+ return false;
+ }
+
+ connect(&m_process, &QProcess::finished,
+ [this](int exitCode, QProcess::ExitStatus exitStatus) {
+ qWarning().nospace()
+ << "WebEngineDriver exited unexpectedly (exitCode: " << exitCode
+ << " exitStatus: " << exitStatus << "):";
+ dumpConsoleMessages();
+ });
+
+ m_process.start();
+
+ bool started = m_process.waitForStarted();
+ if (!started) {
+ qWarning() << "Failed to start WebEngineDriver:" << m_process.errorString();
+ return false;
+ }
+
+ bool ready = QTest::qWaitFor(
+ [this]() {
+ if (m_process.state() != QProcess::Running)
+ return true;
+
+ for (QString line : m_stdout) {
+ if (line.contains(
+ QLatin1String("WebEngineDriver was started successfully.")))
+ return true;
+ }
+
+ return false;
+ },
+ 10000);
+
+ if (ready && m_process.state() != QProcess::Running) {
+ // Warning is already reported by handler of QProcess::finished() signal.
+ return false;
+ }
+
+ if (!ready) {
+ if (m_stdout.empty())
+ qWarning("Starting WebEngineDriver timed out.");
+ else
+ qWarning("Something went wrong while starting WebEngineDriver:");
+
+ dumpConsoleMessages();
+ return false;
+ }
+
+ return true;
+ }
+
+ bool shutdown()
+ {
+ // Do not warn about unexpected exit.
+ disconnect(&m_process, &QProcess::finished, nullptr, nullptr);
+
+ bool sent = sendCommand(QLatin1String("/shutdown"));
+
+ bool finished = (m_process.state() == QProcess::NotRunning) || m_process.waitForFinished();
+ if (!finished || !sent)
+ qWarning() << "Failed to properly shutdown WebEngineDriver:" << m_process.errorString();
+
+ return finished;
+ }
+
+ bool sendCommand(QString command, const QJsonDocument &params = {},
+ QJsonDocument *result = nullptr)
+ {
+ if (command.contains(QLatin1String(":sessionId"))) {
+ if (m_sessionId.isEmpty()) {
+ qWarning("Unable to execute session command without session.");
+ return false;
+ }
+
+ QStringList commandList = command.split(QLatin1Char('/'));
+ for (int i = 0; i < commandList.size(); ++i) {
+ if (commandList[i] == QLatin1String(":sessionId")) {
+ commandList[i] = m_sessionId;
+ break;
+ }
+ }
+
+ command = commandList.join(QLatin1Char('/'));
+ }
+
+ QNetworkReply::NetworkError replyError = QNetworkReply::NoError;
+ QString replyString;
+
+ connect(
+ &m_qnam, &QNetworkAccessManager::finished, this,
+ [&replyError, &replyString](QNetworkReply *reply) {
+ replyError = reply->error();
+ replyString = QString::fromUtf8(reply->readAll());
+ },
+ static_cast<Qt::ConnectionType>(Qt::SingleShotConnection));
+
+ QNetworkRequest request;
+ QUrl requestURL = m_serverURL;
+
+ requestURL.setPath(command);
+ request.setUrl(requestURL);
+
+ if (params.isEmpty()) {
+ m_qnam.get(request);
+ } else {
+ request.setHeader(QNetworkRequest::ContentTypeHeader,
+ QVariant::fromValue(QStringLiteral("application/json")));
+ m_qnam.post(request, params.toJson(QJsonDocument::Compact));
+ }
+
+ bool ready = QTest::qWaitFor(
+ [&replyError, &replyString]() {
+ return replyError != QNetworkReply::NoError || !replyString.isEmpty();
+ },
+ 10000);
+
+ if (!ready) {
+ qWarning() << "Command" << command << "timed out.";
+ dumpConsoleMessages();
+ return false;
+ }
+
+ if (replyError != QNetworkReply::NoError) {
+ qWarning() << "Network error:" << replyError;
+ if (!replyString.isEmpty()) {
+ QJsonDocument errorReply = QJsonDocument::fromJson(replyString.toLatin1());
+ if (!errorReply.isNull()) {
+ QString error = errorReply["value"]["error"].toString();
+ QString message = errorReply["value"]["message"].toString();
+ if (!error.isEmpty() || message.isEmpty()) {
+ qWarning() << "error:" << error;
+ qWarning() << "message:" << message;
+ return false;
+ }
+ }
+
+ qWarning() << replyString;
+ return false;
+ }
+
+ dumpConsoleMessages();
+ return false;
+ }
+
+ if (result) {
+ if (replyString.isEmpty()) {
+ qWarning("Network reply is empty.");
+ return false;
+ }
+
+ QJsonParseError jsonError;
+ *result = QJsonDocument::fromJson(replyString.toLatin1(), &jsonError);
+
+ if (jsonError.error != QJsonParseError::NoError) {
+ qWarning() << "Unable to parse reply:" << jsonError.errorString();
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ bool createSession(QJsonObject chromeOptions = {}, QString *sessionId = nullptr)
+ {
+ if (!m_sessionId.isEmpty()) {
+ qWarning("A session already exists.");
+ return false;
+ }
+
+ QJsonObject root;
+
+ if (chromeOptions.isEmpty()) {
+ // Connect to the test by default.
+ chromeOptions.insert(
+ QLatin1String("debuggerAddress"),
+ QLatin1String("localhost:%1").arg(QString::number(REMOTE_DEBUGGING_PORT)));
+ chromeOptions.insert(QLatin1String("w3c"), true);
+ }
+
+ QJsonObject alwaysMatch;
+ alwaysMatch.insert(QLatin1String("goog:chromeOptions"), chromeOptions);
+
+ QJsonObject seOptions;
+ seOptions.insert(QLatin1String("loggingPrefs"), QJsonObject());
+ alwaysMatch.insert(QLatin1String("se:options"), seOptions);
+
+ QJsonObject capabilities;
+ capabilities.insert(QLatin1String("alwaysMatch"), alwaysMatch);
+ root.insert(QLatin1String("capabilities"), capabilities);
+
+ QJsonDocument params;
+ params.setObject(root);
+
+ QJsonDocument sessionReply;
+ bool sent = sendCommand(QLatin1String("/session"), params, &sessionReply);
+ if (sent) {
+ m_sessionId = sessionReply["value"]["sessionId"].toString();
+ if (sessionId)
+ *sessionId = m_sessionId;
+ }
+
+ return sent;
+ }
+
+ bool deleteSession()
+ {
+ if (m_sessionId.isEmpty()) {
+ qWarning("There is no active session.");
+ return false;
+ }
+
+ QNetworkReply::NetworkError replyError = QNetworkReply::NoError;
+ QString replyString;
+
+ connect(
+ &m_qnam, &QNetworkAccessManager::finished, this,
+ [&replyError, &replyString](QNetworkReply *reply) {
+ replyError = reply->error();
+ replyString = QString::fromUtf8(reply->readAll());
+ },
+ static_cast<Qt::ConnectionType>(Qt::SingleShotConnection));
+
+ QNetworkRequest request;
+ QUrl requestURL = m_serverURL;
+ requestURL.setPath(QLatin1String("/session/%1").arg(m_sessionId));
+ request.setUrl(requestURL);
+ m_qnam.deleteResource(request);
+
+ bool ready = QTest::qWaitFor(
+ [&replyError, &replyString]() {
+ return replyError != QNetworkReply::NoError || !replyString.isEmpty();
+ },
+ 10000);
+
+ if (!ready) {
+ qWarning("Deleting session timed out.");
+ return false;
+ }
+
+ if (replyError != QNetworkReply::NoError) {
+ qWarning() << "Network error:" << replyError;
+ return false;
+ }
+
+ return true;
+ }
+
+ QStringList stderrLines() const { return m_stderr; }
+
+ bool waitForMessageOnStderr(const QRegularExpression &re, QString *message = nullptr) const
+ {
+ return QTest::qWaitFor(
+ [this, &re, message]() {
+ for (QString line : m_stderr) {
+ if (line.contains(re)) {
+ if (message)
+ *message = line;
+ return true;
+ }
+ }
+
+ return false;
+ },
+ 10000);
+ }
+
+private:
+ void dumpConsoleMessages()
+ {
+ auto dumpLines = [](QStringList *lines) {
+ if (lines->empty())
+ return;
+
+ for (QString line : *lines)
+ qWarning() << qPrintable(line);
+
+ lines->clear();
+ };
+
+ dumpLines(&m_stdout);
+ dumpLines(&m_stderr);
+ }
+
+ QProcess m_process;
+ QStringList m_stdout;
+ QStringList m_stderr;
+
+ QUrl m_serverURL;
+ QString m_sessionId;
+
+ QNetworkAccessManager m_qnam;
+};
+
+class tst_WebEngineDriver : public QObject
+{
+ Q_OBJECT
+
+private Q_SLOTS:
+ void status();
+ void startBrowser();
+ void navigate();
+ void typeElement();
+ void executeScript();
+ void screenshot();
+};
+
+void tst_WebEngineDriver::status()
+{
+ DriverServer driverServer;
+ QVERIFY(driverServer.start());
+
+ QJsonDocument statusReply;
+ QVERIFY(driverServer.sendCommand(QLatin1String("/status"), {}, &statusReply));
+
+ QString versionString = statusReply["value"]["build"]["version"].toString();
+ QCOMPARE(qWebEngineChromiumVersion(), versionString.split(QLatin1Char(' '))[0]);
+
+ bool ready = statusReply["value"]["ready"].toBool();
+ QVERIFY(ready);
+}
+
+void tst_WebEngineDriver::startBrowser()
+{
+ QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
+ env.insert(QLatin1String("QTWEBENGINE_REMOTE_DEBUGGING"),
+ QString::number(REMOTE_DEBUGGING_PORT));
+
+ QStringList args;
+ args << QLatin1String("--port=%1").arg(QString::number(WEBENGINEDRIVER_PORT));
+ args << QLatin1String("--log-level=ALL");
+
+ DriverServer driverServer(env, args);
+ QVERIFY(driverServer.start());
+
+ QString testBrowserPath =
+ QCoreApplication::applicationDirPath() + QLatin1String("/testbrowser");
+#if defined(Q_OS_WIN)
+ testBrowserPath += QLatin1String(".exe");
+#endif
+
+ QJsonArray chromeArgs;
+ chromeArgs.append(QLatin1String("enable-logging=stderr"));
+ chromeArgs.append(QLatin1String("v=1"));
+ // To force graceful shutdown.
+ chromeArgs.append(QLatin1String("log-net-log"));
+
+ QJsonObject chromeOptions;
+ chromeOptions.insert(QLatin1String("binary"), testBrowserPath);
+ chromeOptions.insert(QLatin1String("args"), chromeArgs);
+ chromeOptions.insert(QLatin1String("w3c"), true);
+ QString sessionId;
+ QVERIFY(driverServer.createSession(chromeOptions, &sessionId));
+
+ // Test if the browser is started.
+ QVERIFY(driverServer.waitForMessageOnStderr(QRegularExpression(
+ QLatin1String("^DevTools listening on ws://127.0.0.1:%1/devtools/browser/")
+ .arg(QString::number(REMOTE_DEBUGGING_PORT)))));
+ QVERIFY(driverServer.waitForMessageOnStderr(QRegularExpression(
+ QLatin1String("^Remote debugging server started successfully. "
+ "Try pointing a Chromium-based browser to http://127.0.0.1:%1")
+ .arg(QString::number(REMOTE_DEBUGGING_PORT)))));
+
+ // Check custom chromeArgs via logging.
+ QVERIFY(driverServer.waitForMessageOnStderr(QRegularExpression(QLatin1String("VERBOSE1"))));
+
+ QJsonDocument statusReply;
+ QVERIFY(driverServer.sendCommand(QLatin1String("/status"), {}, &statusReply));
+ bool ready = statusReply["value"]["ready"].toBool();
+ QVERIFY(ready);
+
+ QVERIFY(driverServer.deleteSession());
+
+ // Test if the browser is stopped.
+ QVERIFY(driverServer.waitForMessageOnStderr(
+ QRegularExpression(QLatin1String("Test browser is about to quit."))));
+ QVERIFY(driverServer.waitForMessageOnStderr(
+ QRegularExpression(QLatin1String("\\[%1\\] RESPONSE Quit").arg(sessionId))));
+}
+
+void tst_WebEngineDriver::navigate()
+{
+ DriverServer driverServer;
+ QVERIFY(driverServer.start());
+
+ QWebEnginePage page;
+ QSignalSpy loadSpy(&page, &QWebEnginePage::loadFinished);
+
+ page.load(QUrl(QLatin1String("about:blank")));
+ QTRY_COMPARE(loadSpy.size(), 1);
+
+ QVERIFY(driverServer.createSession());
+
+ QUrl url = QUrl(QLatin1String("qrc:///resources/input.html"));
+ QString paramsString = QLatin1String("{\"url\": \"%1\"}").arg(url.toString());
+ QJsonDocument params = QJsonDocument::fromJson(paramsString.toUtf8());
+ QVERIFY(driverServer.sendCommand(QLatin1String("/session/:sessionId/url"), params));
+ QTRY_COMPARE(loadSpy.size(), 2);
+ QVERIFY(loadSpy.at(1).at(0).toBool());
+ QCOMPARE(url, page.url());
+
+ QVERIFY(driverServer.deleteSession());
+}
+
+void tst_WebEngineDriver::typeElement()
+{
+ DriverServer driverServer;
+ QVERIFY(driverServer.start());
+
+ QWebEngineView view;
+ view.resize(300, 100);
+ view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
+
+ QUrl url = QUrl(QLatin1String("qrc:///resources/input.html"));
+ QSignalSpy loadSpy(view.page(), &QWebEnginePage::loadFinished);
+ view.load(url);
+ QTRY_COMPARE(loadSpy.size(), 1);
+
+ QVERIFY(driverServer.createSession());
+
+ // Find <input id="text_input"> element and extract its id from the reply.
+ QString textInputId;
+ {
+ QString paramsString = QLatin1String(
+ "{\"using\": \"css selector\", \"value\": \"[id=\\\"text_input\\\"]\"}");
+ QJsonDocument params = QJsonDocument::fromJson(paramsString.toUtf8());
+ QJsonDocument elementReply;
+ QVERIFY(driverServer.sendCommand(QLatin1String("/session/:sessionId/element"), params,
+ &elementReply));
+
+ QVERIFY(!elementReply.isEmpty());
+ QJsonObject value = elementReply["value"].toObject();
+ QVERIFY(!value.isEmpty());
+ QStringList keys = value.keys();
+ QCOMPARE(keys.size(), 1);
+ textInputId = value[keys[0]].toString();
+ QVERIFY(!textInputId.isEmpty());
+ }
+
+ // Type text into the input field.
+ QString inputText = QLatin1String("WebEngineDriver");
+ {
+ QString command = QLatin1String("/session/:sessionId/element/%1/value").arg(textInputId);
+
+ QJsonObject root;
+ root.insert(QLatin1String("text"), inputText);
+ QJsonArray value;
+ for (QChar ch : inputText) {
+ value.append(QJsonValue(ch));
+ }
+ root.insert(QLatin1String("value"), value);
+ root.insert(QLatin1String("id"), textInputId);
+ QJsonDocument params;
+ params.setObject(root);
+
+ QVERIFY(driverServer.sendCommand(command, params));
+
+ QTRY_COMPARE(
+ evaluateJavaScriptSync(view.page(), "document.getElementById('text_input').value")
+ .toString(),
+ inputText);
+ }
+
+ QVERIFY(driverServer.deleteSession());
+}
+
+void tst_WebEngineDriver::executeScript()
+{
+ DriverServer driverServer;
+ QVERIFY(driverServer.start());
+
+ QUrl url = QUrl(QLatin1String("qrc:///resources/input.html"));
+ QWebEnginePage page;
+ QSignalSpy loadSpy(&page, &QWebEnginePage::loadFinished);
+
+ page.load(url);
+ QTRY_COMPARE(loadSpy.size(), 1);
+ QCOMPARE(page.title(), url.toString());
+ QSignalSpy titleSpy(&page, &QWebEnginePage::titleChanged);
+
+ QString newTitle = QLatin1String("WebEngineDriver Test Page");
+ QString script = QLatin1String("document.title = '%1';"
+ "return document.title;")
+ .arg(newTitle);
+
+ QVERIFY(driverServer.createSession());
+ QString paramsString = QLatin1String("{\"script\": \"%1\", \"args\": []}").arg(script);
+ QJsonDocument params = QJsonDocument::fromJson(paramsString.toUtf8());
+ QJsonDocument executeReply;
+ QVERIFY(driverServer.sendCommand(QLatin1String("/session/:sessionId/execute/sync"), params,
+ &executeReply));
+
+ QTRY_COMPARE(titleSpy.size(), 1);
+ QCOMPARE(executeReply["value"].toString(), newTitle);
+ QCOMPARE(page.title(), newTitle);
+
+ QVERIFY(driverServer.deleteSession());
+}
+
+void tst_WebEngineDriver::screenshot()
+{
+ DriverServer driverServer;
+ QVERIFY(driverServer.start());
+
+ QWebEngineView view;
+ view.resize(300, 100);
+ view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
+
+ QSignalSpy loadSpy(view.page(), &QWebEnginePage::loadFinished);
+
+ view.setHtml(QLatin1String("<html><head><style>"
+ "html {background-color:red;}"
+ "</style></head><body></body></html>"));
+ QTRY_COMPARE(loadSpy.size(), 1);
+
+ QVERIFY(driverServer.createSession());
+ QJsonDocument screenshotReply;
+ QVERIFY(driverServer.sendCommand(QLatin1String("/session/:sessionId/screenshot"), {},
+ &screenshotReply));
+
+ QByteArray base64 = screenshotReply["value"].toString().toLocal8Bit();
+ QVERIFY(!base64.isEmpty());
+ QImage screenshot;
+ screenshot.loadFromData(QByteArray::fromBase64(base64));
+ QVERIFY(!screenshot.isNull());
+ QCOMPARE(screenshot.pixel(screenshot.width() / 2, screenshot.height() / 2), 0xFFFF0000);
+
+ QVERIFY(driverServer.deleteSession());
+}
+
+#define STRINGIFY_LITERAL(x) #x
+#define STRINGIFY_EXPANDED(x) STRINGIFY_LITERAL(x)
+static QByteArrayList params = QByteArrayList()
+ << "--remote-debugging-port=" STRINGIFY_EXPANDED(REMOTE_DEBUGGING_PORT);
+W_QTEST_MAIN(tst_WebEngineDriver, params)
+
+#include "tst_webenginedriver.moc"
diff --git a/tests/auto/embed_info_plist.pri b/tests/auto/embed_info_plist.pri
deleted file mode 100644
index cca93c35e..000000000
--- a/tests/auto/embed_info_plist.pri
+++ /dev/null
@@ -1,13 +0,0 @@
-macos {
- CONFIG -= app_bundle
-
- # QTBUG-57354 embed Info.plist so that certain fonts can be found in non-bundle apps
- out_info = $$OUT_PWD/Info.plist
- embed_info_plist.input = $$PWD/Info.plist.in
- embed_info_plist.output = $$out_info
- TARGET_HYPHENATED = $$replace(TARGET, [^a-zA-Z0-9-.], -)
- QMAKE_SUBSTITUTES += embed_info_plist
- QMAKE_LFLAGS += -Wl,-sectcreate,__TEXT,__info_plist,$$shell_quote($$out_info)
- PRE_TARGETDEPS += $$out_info
- QMAKE_DISTCLEAN += $$out_info
-}
diff --git a/tests/auto/httpserver/CMakeLists.txt b/tests/auto/httpserver/CMakeLists.txt
new file mode 100644
index 000000000..0a1f881b9
--- /dev/null
+++ b/tests/auto/httpserver/CMakeLists.txt
@@ -0,0 +1,10 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.18)
+project(minimal LANGUAGES CXX)
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Network)
+
+include(httpserver.cmake)
diff --git a/tests/auto/httpserver/data/hedgehog.html b/tests/auto/httpserver/data/hedgehog.html
new file mode 100644
index 000000000..d8abbcd48
--- /dev/null
+++ b/tests/auto/httpserver/data/hedgehog.html
@@ -0,0 +1,9 @@
+<!doctype html>
+<html>
+ <head>
+ <title>BREAKING NEWS: 15 Hedgehogs With Things That Look Like Hedgehogs</title>
+ </head>
+ <body>
+ <img src="hedgehog.png"/>
+ </body>
+</html>
diff --git a/tests/auto/httpserver/data/hedgehog.png b/tests/auto/httpserver/data/hedgehog.png
new file mode 100644
index 000000000..4d56d8633
--- /dev/null
+++ b/tests/auto/httpserver/data/hedgehog.png
Binary files differ
diff --git a/tests/auto/widgets/loadsignals/resources/downloadable.tar.gz b/tests/auto/httpserver/data/loadprogress/downloadable.tar.gz
index 741cb8ca6..741cb8ca6 100644
--- a/tests/auto/widgets/loadsignals/resources/downloadable.tar.gz
+++ b/tests/auto/httpserver/data/loadprogress/downloadable.tar.gz
Binary files differ
diff --git a/tests/auto/httpserver/data/loadprogress/main.html b/tests/auto/httpserver/data/loadprogress/main.html
new file mode 100644
index 000000000..3b7d2034b
--- /dev/null
+++ b/tests/auto/httpserver/data/loadprogress/main.html
@@ -0,0 +1,30 @@
+<html>
+<head><title>Load Progress Test Page</title>
+ <style>
+ .monospace { font-family: "Lucida Console", Courier, monospace; }
+ </style>
+ <title>page1</title>
+ <script>
+ function addP(t) {
+ var p = document.createElement('p')
+ p.class = 'monospace'
+ p.innerHTML = t
+ var d = document.createElement('div')
+ d.appendChild(p)
+ document.body.appendChild(d)
+ }
+ window.addEventListener('DOMContentLoaded', (event) => { addP('DOMContentLoaded') })
+ </script>
+</head>
+<body>
+ <h1>Hello.</h1>
+ <script>
+ addP('sometext')
+ </script>
+ <p class="monospace">body in monospace</p>
+ <iframe id="page1" src="page1.html"></iframe>
+ <iframe id="page2" src="page2.html"></iframe>
+ <iframe id="page3" src="page3.html"></iframe>
+ <iframe id="page4" src="page4.html"></iframe>
+</body>
+</html>
diff --git a/tests/auto/httpserver/data/loadprogress/page1.html b/tests/auto/httpserver/data/loadprogress/page1.html
new file mode 100644
index 000000000..9b11ce887
--- /dev/null
+++ b/tests/auto/httpserver/data/loadprogress/page1.html
@@ -0,0 +1,8 @@
+<html>
+ <head>
+ <title>page1</title>
+ </head>
+ <body>
+ <div><a href="page2.html#anchor">page2</a></div>
+ </body>
+</html>
diff --git a/tests/auto/httpserver/data/loadprogress/page2.html b/tests/auto/httpserver/data/loadprogress/page2.html
new file mode 100644
index 000000000..223817c8c
--- /dev/null
+++ b/tests/auto/httpserver/data/loadprogress/page2.html
@@ -0,0 +1,15 @@
+<html>
+ <head>
+ <title>page2</title>
+ </head>
+ <style>
+ .fardown {
+ position: absolute;
+ top: 2500px;
+ }
+ </style>
+ <body>
+ <div><a href="#anchor">page2</a></div>
+ <div class="fardown" id="anchor">page2 anchor</div>
+ </body>
+</html>
diff --git a/tests/auto/widgets/loadsignals/resources/page3.html b/tests/auto/httpserver/data/loadprogress/page3.html
index d38ca31f0..d38ca31f0 100644
--- a/tests/auto/widgets/loadsignals/resources/page3.html
+++ b/tests/auto/httpserver/data/loadprogress/page3.html
diff --git a/tests/auto/widgets/loadsignals/resources/page4.html b/tests/auto/httpserver/data/loadprogress/page4.html
index 61976b4fb..61976b4fb 100644
--- a/tests/auto/widgets/loadsignals/resources/page4.html
+++ b/tests/auto/httpserver/data/loadprogress/page4.html
diff --git a/tests/auto/httpserver/data/loadprogress/page5.html b/tests/auto/httpserver/data/loadprogress/page5.html
new file mode 100644
index 000000000..47709ff08
--- /dev/null
+++ b/tests/auto/httpserver/data/loadprogress/page5.html
@@ -0,0 +1,20 @@
+<html>
+ <head>
+ <title>page5</title>
+ </head>
+ <script>
+ addEventListener('DOMContentLoaded', (event) => {
+ document.getElementById('anchorLink').click();
+ });
+ </script>
+ <style>
+ .fardown {
+ position: absolute;
+ top: 2500px;
+ }
+ </style>
+ <body>
+ <div><a id="anchorLink" href="#anchor">go to the anchor</a></div>
+ <div class="fardown" id="anchor">here is the anchor</div>
+ </body>
+</html>
diff --git a/tests/auto/httpserver/data/loadprogress/page6.html b/tests/auto/httpserver/data/loadprogress/page6.html
new file mode 100644
index 000000000..98042701a
--- /dev/null
+++ b/tests/auto/httpserver/data/loadprogress/page6.html
@@ -0,0 +1,13 @@
+<html>
+ <head>
+ <title>page6</title>
+ </head>
+ <script>
+ addEventListener('DOMContentLoaded', (event) => {
+ document.getElementById('anchorLink').click();
+ });
+ </script>
+ <body>
+ <div><a id="anchorLink" href="page2.html#anchor">go to another page</a></div>
+ </body>
+</html>
diff --git a/tests/auto/httpserver/data/loadprogress/page7.html b/tests/auto/httpserver/data/loadprogress/page7.html
new file mode 100644
index 000000000..42538c5de
--- /dev/null
+++ b/tests/auto/httpserver/data/loadprogress/page7.html
@@ -0,0 +1,13 @@
+<html>
+ <head>
+ <title>page6</title>
+ </head>
+ <script>
+ setTimeout(function(){
+ document.getElementById('anchorLink').click();
+ },500);
+ </script>
+ <body>
+ <div><a id="anchorLink" href="page2.html#anchor">go to another page</a></div>
+ </body>
+</html>
diff --git a/tests/auto/httpserver/data/loadprogress/page8.html b/tests/auto/httpserver/data/loadprogress/page8.html
new file mode 100644
index 000000000..8ebdddf97
--- /dev/null
+++ b/tests/auto/httpserver/data/loadprogress/page8.html
@@ -0,0 +1,20 @@
+<html>
+ <head>
+ <title>Page with js navigation in the end of document to anchor within the page</title>
+ </head>
+ <style>
+ .fardown {
+ position: absolute;
+ top: 2500px;
+ }
+ </style>
+ <body>
+ <div><a id="anchorLink" href="#anchor">go to the anchor</a></div>
+ <div class="fardown" id="anchor">here is the anchor</div>
+ <script>
+ addEventListener('load', (event) => {
+ window.location.replace(document.getElementById('anchorLink').href)
+ })
+ </script>
+ </body>
+</html>
diff --git a/tests/auto/shared/data/notification.html b/tests/auto/httpserver/data/notification.html
index 1d1e9c411..1d1e9c411 100644
--- a/tests/auto/shared/data/notification.html
+++ b/tests/auto/httpserver/data/notification.html
diff --git a/tests/auto/httpserver/httpreqrep.cpp b/tests/auto/httpserver/httpreqrep.cpp
new file mode 100644
index 000000000..8b338ce4e
--- /dev/null
+++ b/tests/auto/httpserver/httpreqrep.cpp
@@ -0,0 +1,125 @@
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+#include "httpreqrep.h"
+
+HttpReqRep::HttpReqRep(QTcpSocket *socket, QObject *parent)
+ : QObject(parent), m_socket(socket)
+{
+ m_socket->setParent(this);
+ connect(m_socket, &QTcpSocket::readyRead, this, &HttpReqRep::handleReadyRead);
+ connect(m_socket, &QTcpSocket::disconnected, this, &HttpReqRep::handleDisconnected);
+}
+
+void HttpReqRep::sendResponse(int statusCode)
+{
+ if (m_state != State::REQUEST_RECEIVED)
+ return;
+ m_responseStatusCode = statusCode;
+ m_socket->write("HTTP/1.1 ");
+ m_socket->write(QByteArray::number(m_responseStatusCode));
+ m_socket->write(" OK?\r\n");
+ for (const auto & kv : m_responseHeaders) {
+ m_socket->write(kv.first);
+ m_socket->write(": ");
+ m_socket->write(kv.second);
+ m_socket->write("\r\n");
+ }
+ m_socket->write("Connection: close\r\n");
+ m_socket->write("\r\n");
+ m_socket->write(m_responseBody);
+ m_state = State::DISCONNECTING;
+ m_socket->disconnectFromHost();
+ Q_EMIT responseSent();
+}
+
+void HttpReqRep::sendResponse(const QByteArray &response)
+{
+ m_socket->write(response);
+ m_state = State::DISCONNECTING;
+ m_socket->disconnectFromHost();
+ Q_EMIT responseSent();
+}
+
+void HttpReqRep::close()
+{
+ if (m_state != State::REQUEST_RECEIVED)
+ return;
+ m_state = State::DISCONNECTING;
+ m_socket->disconnectFromHost();
+ Q_EMIT error(QStringLiteral("missing response"));
+}
+
+QByteArray HttpReqRep::requestHeader(const QByteArray &key) const
+{
+ auto it = m_requestHeaders.find(key.toLower());
+ if (it != m_requestHeaders.end())
+ return it->second;
+ return {};
+}
+
+bool HttpReqRep::hasRequestHeader(const QByteArray &key) const
+{
+ return m_requestHeaders.find(key.toLower()) != m_requestHeaders.end();
+}
+
+void HttpReqRep::handleReadyRead()
+{
+ while (m_socket->canReadLine()) {
+ switch (m_state) {
+ case State::RECEIVING_REQUEST: {
+ const auto requestLine = m_socket->readLine();
+ const auto requestLineParts = requestLine.split(' ');
+ if (requestLineParts.size() != 3 || !requestLineParts[2].toUpper().startsWith("HTTP/")) {
+ m_state = State::DISCONNECTING;
+ m_socket->disconnectFromHost();
+ Q_EMIT error(QStringLiteral("invalid request line"));
+ return;
+ }
+ m_requestMethod = requestLineParts[0];
+ m_requestPath = requestLineParts[1];
+ m_state = State::RECEIVING_HEADERS;
+ break;
+ }
+ case State::RECEIVING_HEADERS: {
+ const auto headerLine = m_socket->readLine();
+ if (headerLine == QByteArrayLiteral("\r\n")) {
+ m_state = State::REQUEST_RECEIVED;
+ Q_EMIT requestReceived();
+ return;
+ }
+ int colonIndex = headerLine.indexOf(':');
+ if (colonIndex < 0) {
+ m_state = State::DISCONNECTING;
+ m_socket->disconnectFromHost();
+ Q_EMIT error(QStringLiteral("invalid header line"));
+ return;
+ }
+ auto headerKey = headerLine.left(colonIndex).trimmed().toLower();
+ auto headerValue = headerLine.mid(colonIndex + 1).trimmed().toLower();
+ m_requestHeaders.emplace(headerKey, headerValue);
+ break;
+ }
+ default:
+ return;
+ }
+ }
+}
+
+void HttpReqRep::handleDisconnected()
+{
+ switch (m_state) {
+ case State::RECEIVING_REQUEST:
+ case State::RECEIVING_HEADERS:
+ case State::REQUEST_RECEIVED:
+ Q_EMIT error(QStringLiteral("unexpected disconnect"));
+ break;
+ case State::DISCONNECTING:
+ break;
+ case State::DISCONNECTED:
+ Q_UNREACHABLE();
+ }
+ m_state = State::DISCONNECTED;
+ Q_EMIT closed();
+}
+
+#include "moc_httpreqrep.cpp"
diff --git a/tests/auto/httpserver/httpreqrep.h b/tests/auto/httpserver/httpreqrep.h
new file mode 100644
index 000000000..774c08eb1
--- /dev/null
+++ b/tests/auto/httpserver/httpreqrep.h
@@ -0,0 +1,85 @@
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+#ifndef HTTPREQREP_H
+#define HTTPREQREP_H
+
+#include <QTcpSocket>
+
+#include <map>
+#include <utility>
+
+// Represents an HTTP request-response exchange.
+class HttpReqRep : public QObject
+{
+ Q_OBJECT
+public:
+ explicit HttpReqRep(QTcpSocket *socket, QObject *parent = nullptr);
+
+ Q_INVOKABLE void sendResponse(int statusCode = 200);
+ void sendResponse(const QByteArray &response);
+ void close();
+ bool isClosed() const { return m_state == State::DISCONNECTED; }
+
+ // Request parameters (only valid after requestReceived())
+
+ QByteArray requestMethod() const { return m_requestMethod; }
+ QByteArray requestPath() const { return m_requestPath; }
+ QByteArray requestHeader(const QByteArray &key) const;
+ bool hasRequestHeader(const QByteArray &key) const;
+
+ // Response parameters (can be set until sendResponse()/close()).
+
+ int responseStatus() const { return m_responseStatusCode; }
+ void setResponseStatus(int statusCode)
+ {
+ m_responseStatusCode = statusCode;
+ }
+ void setResponseHeader(const QByteArray &key, QByteArray value)
+ {
+ m_responseHeaders[key.toLower()] = std::move(value);
+ }
+ QByteArray responseBody() const { return m_responseBody; }
+ Q_INVOKABLE void setResponseBody(QByteArray content)
+ {
+ m_responseHeaders["content-length"] = QByteArray::number(content.size());
+ m_responseBody = std::move(content);
+ }
+
+Q_SIGNALS:
+ // Emitted when the request has been correctly parsed.
+ void requestReceived();
+ // Emitted on first call to sendResponse().
+ void responseSent();
+ // Emitted when something goes wrong.
+ void error(const QString &error);
+ // Emitted during or some time after sendResponse() or close().
+ void closed();
+
+private Q_SLOTS:
+ void handleReadyRead();
+ void handleDisconnected();
+
+private:
+ enum class State {
+ // Waiting for first line of request.
+ RECEIVING_REQUEST, // Next: RECEIVING_HEADERS or DISCONNECTING.
+ // Waiting for header lines.
+ RECEIVING_HEADERS, // Next: REQUEST_RECEIVED or DISCONNECTING.
+ // Request parsing succeeded, waiting for sendResponse() or close().
+ REQUEST_RECEIVED, // Next: DISCONNECTING.
+ // Waiting for network.
+ DISCONNECTING, // Next: DISCONNECTED.
+ // Connection is dead.
+ DISCONNECTED, // Next: -
+ };
+ QTcpSocket *m_socket = nullptr;
+ State m_state = State::RECEIVING_REQUEST;
+ QByteArray m_requestMethod;
+ QByteArray m_requestPath;
+ std::map<QByteArray, QByteArray> m_requestHeaders;
+ int m_responseStatusCode = -1;
+ std::map<QByteArray, QByteArray> m_responseHeaders;
+ QByteArray m_responseBody;
+};
+
+#endif // !HTTPREQREP_H
diff --git a/tests/auto/httpserver/httpserver.cmake b/tests/auto/httpserver/httpserver.cmake
new file mode 100644
index 000000000..f98434e1a
--- /dev/null
+++ b/tests/auto/httpserver/httpserver.cmake
@@ -0,0 +1,41 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+if (NOT TARGET Test::HttpServer)
+
+ add_library(httpserver STATIC
+ ${CMAKE_CURRENT_LIST_DIR}/httpreqrep.cpp
+ ${CMAKE_CURRENT_LIST_DIR}/httpreqrep.h
+ ${CMAKE_CURRENT_LIST_DIR}/httpserver.cpp
+ ${CMAKE_CURRENT_LIST_DIR}/httpserver.h
+ ${CMAKE_CURRENT_LIST_DIR}/proxy_server.h
+ ${CMAKE_CURRENT_LIST_DIR}/proxy_server.cpp
+ )
+
+ # moc binary might not exist in case of top level build
+ qt_autogen_tools(httpserver ENABLE_AUTOGEN_TOOLS "moc")
+
+ if(QT_FEATURE_ssl)
+ target_sources(httpserver INTERFACE ${CMAKE_CURRENT_LIST_DIR}/httpsserver.h)
+ endif()
+
+ add_library(Test::HttpServer ALIAS httpserver)
+
+ target_include_directories(httpserver INTERFACE
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>
+ )
+
+ target_link_libraries(httpserver PUBLIC
+ Qt::Core
+ Qt::Network
+ )
+
+ get_filename_component(SERVER_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}" REALPATH)
+ target_compile_definitions(httpserver PRIVATE
+ SERVER_SOURCE_DIR="${SERVER_SOURCE_DIR}"
+ )
+
+ set_target_properties(httpserver PROPERTIES
+ SHARED_DATA "${CMAKE_CURRENT_LIST_DIR}/data"
+ )
+endif()
diff --git a/tests/auto/httpserver/httpserver.cpp b/tests/auto/httpserver/httpserver.cpp
new file mode 100644
index 000000000..e08af77e7
--- /dev/null
+++ b/tests/auto/httpserver/httpserver.cpp
@@ -0,0 +1,127 @@
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+#include "httpserver.h"
+
+#include <QFile>
+#include <QLoggingCategory>
+#include <QMimeDatabase>
+
+Q_LOGGING_CATEGORY(gHttpServerLog, "HttpServer")
+
+HttpServer::HttpServer(QObject *parent)
+ : HttpServer(new QTcpServer, "http", QHostAddress::LocalHost, 0, parent)
+{
+}
+
+HttpServer::HttpServer(const QHostAddress &hostAddress, quint16 port, QObject *parent)
+ : HttpServer(new QTcpServer, "http", hostAddress, port, parent)
+{
+}
+
+HttpServer::HttpServer(QTcpServer *tcpServer, const QString &protocol,
+ const QHostAddress &hostAddress, quint16 port, QObject *parent)
+ : QObject(parent), m_tcpServer(tcpServer), m_hostAddress(hostAddress), m_port(port)
+{
+ m_url.setHost(hostAddress.toString());
+ m_url.setScheme(protocol);
+ connect(tcpServer, &QTcpServer::pendingConnectionAvailable, this,
+ &HttpServer::handleNewConnection);
+}
+
+HttpServer::~HttpServer()
+{
+ delete m_tcpServer;
+}
+
+bool HttpServer::start()
+{
+ m_error = false;
+ m_expectingError = false;
+ m_ignoreNewConnection = false;
+
+ if (!m_tcpServer->listen(m_hostAddress, m_port)) {
+ qCWarning(gHttpServerLog).noquote() << m_tcpServer->errorString();
+ return false;
+ }
+
+ m_url.setPort(m_tcpServer->serverPort());
+ return true;
+}
+
+bool HttpServer::stop()
+{
+ m_tcpServer->close();
+ return m_error == m_expectingError;
+}
+
+void HttpServer::setExpectError(bool b)
+{
+ m_expectingError = b;
+}
+
+QUrl HttpServer::url(const QString &path) const
+{
+ auto copy = m_url;
+ copy.setPath(path);
+ return copy;
+}
+
+void HttpServer::handleNewConnection()
+{
+ if (m_ignoreNewConnection)
+ return;
+
+ auto rr = new HttpReqRep(m_tcpServer->nextPendingConnection(), this);
+ connect(rr, &HttpReqRep::requestReceived, [this, rr]() {
+ Q_EMIT newRequest(rr);
+ if (rr->isClosed()) // was explicitly answered
+ return;
+
+ // if request wasn't handled or purposely ignored for default behavior
+ // then try to serve htmls from resources dirs if set
+ if (rr->requestMethod() == "GET") {
+ for (auto &&dir : std::as_const(m_dirs)) {
+ QFile f(dir + rr->requestPath());
+ if (f.exists()) {
+ if (f.open(QFile::ReadOnly)) {
+ QMimeType mime = QMimeDatabase().mimeTypeForFileNameAndData(f.fileName(), &f);
+ rr->setResponseHeader(QByteArrayLiteral("Content-Type"), mime.name().toUtf8());
+ rr->setResponseHeader(QByteArrayLiteral("Access-Control-Allow-Origin"), QByteArrayLiteral("*"));
+ rr->setResponseBody(f.readAll());
+ rr->sendResponse();
+ } else {
+ qWarning() << "Can't open resource" << f.fileName() << ": " << f.errorString();
+ rr->sendResponse(500); // internal server error
+ }
+ break;
+ } else {
+ qWarning() << "Can't open resource" << dir + rr->requestPath();
+ }
+ }
+ }
+
+ if (!rr->isClosed())
+ rr->sendResponse(404);
+ });
+ connect(rr, &HttpReqRep::responseSent, [rr]() {
+ qCInfo(gHttpServerLog).noquote() << rr->requestMethod() << rr->requestPath()
+ << rr->responseStatus() << rr->responseBody().size();
+ });
+ connect(rr, &HttpReqRep::error, [this, rr](const QString &error) {
+ qCWarning(gHttpServerLog).noquote() << rr->requestMethod() << rr->requestPath()
+ << error;
+ m_error = true;
+ });
+
+ if (!m_tcpServer->isListening()) {
+ m_ignoreNewConnection = true;
+ connect(rr, &HttpReqRep::closed, rr, &QObject::deleteLater);
+ }
+}
+
+QString HttpServer::sharedDataDir() const
+{
+ return SERVER_SOURCE_DIR + QLatin1String("/data");
+}
+
+#include "moc_httpserver.cpp"
diff --git a/tests/auto/httpserver/httpserver.h b/tests/auto/httpserver/httpserver.h
new file mode 100644
index 000000000..201eef4c6
--- /dev/null
+++ b/tests/auto/httpserver/httpserver.h
@@ -0,0 +1,82 @@
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+#ifndef HTTPSERVER_H
+#define HTTPSERVER_H
+
+#include "httpreqrep.h"
+
+#include <QTcpServer>
+#include <QUrl>
+
+// Listens on a TCP socket and creates HttpReqReps for each connection.
+//
+// Usage:
+//
+// HttpServer server;
+// connect(&server, &HttpServer::newRequest, [](HttpReqRep *rr) {
+// if (rr->requestPath() == "/myPage.html") {
+// rr->setResponseBody("<html><body>Hello, World!</body></html>");
+// rr->sendResponse();
+// }
+// });
+// QVERIFY(server.start());
+// /* do stuff */
+// QVERIFY(server.stop());
+//
+// HttpServer owns the HttpReqRep objects. The signal handler should not store
+// references to HttpReqRep objects.
+//
+// Only if a handler calls sendResponse() will a response be actually sent. This
+// means that multiple handlers can be connected to the signal, with different
+// handlers responsible for different paths.
+class HttpServer : public QObject
+{
+ Q_OBJECT
+public:
+ explicit HttpServer(QObject *parent = nullptr);
+ HttpServer(const QHostAddress &hostAddress, quint16 port, QObject *parent = nullptr);
+ HttpServer(QTcpServer *server, const QString &protocol, const QHostAddress &address,
+ quint16 port, QObject *parent = nullptr);
+
+ ~HttpServer() override;
+
+ // Must be called to start listening.
+ //
+ // Returns true if a TCP port has been successfully bound.
+ Q_INVOKABLE Q_REQUIRED_RESULT bool start();
+
+ // Stops listening and performs final error checks.
+ Q_INVOKABLE Q_REQUIRED_RESULT bool stop();
+
+ Q_INVOKABLE void setExpectError(bool b);
+
+ // Full URL for given relative path
+ Q_INVOKABLE QUrl url(const QString &path = QStringLiteral("/")) const;
+
+ Q_INVOKABLE QString sharedDataDir() const;
+
+ Q_INVOKABLE void setResourceDirs(const QStringList &dirs) { m_dirs = dirs; }
+
+ Q_INVOKABLE void setHostDomain(const QString &host) { m_url.setHost(host); }
+
+ Q_INVOKABLE QTcpServer *getTcpServer() const { return m_tcpServer; }
+
+Q_SIGNALS:
+ // Emitted after a HTTP request has been successfully parsed.
+ void newRequest(HttpReqRep *reqRep);
+
+private Q_SLOTS:
+ void handleNewConnection();
+
+private:
+ QTcpServer *m_tcpServer;
+ QUrl m_url;
+ QStringList m_dirs;
+ bool m_error = false;
+ bool m_ignoreNewConnection = false;
+ bool m_expectingError = false;
+ QHostAddress m_hostAddress;
+ quint16 m_port;
+};
+
+#endif // !HTTPSERVER_H
diff --git a/tests/auto/httpserver/httpsserver.h b/tests/auto/httpserver/httpsserver.h
new file mode 100644
index 000000000..d029851aa
--- /dev/null
+++ b/tests/auto/httpserver/httpsserver.h
@@ -0,0 +1,73 @@
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+#ifndef HTTPSSERVER_H
+#define HTTPSSERVER_H
+
+#include "httpreqrep.h"
+#include "httpserver.h"
+
+#include <QDebug>
+#include <QtCore/qfile.h>
+#include <QtNetwork/qsslkey.h>
+#include <QtNetwork/qsslsocket.h>
+#include <QtNetwork/qsslconfiguration.h>
+#include <QtNetwork/qsslserver.h>
+
+static QSslServer *createServer(const QString &certificateFileName, const QString &keyFileName,
+ const QString &ca)
+{
+ QSslConfiguration configuration(QSslConfiguration::defaultConfiguration());
+
+ QFile keyFile(keyFileName);
+ if (keyFile.open(QIODevice::ReadOnly)) {
+ QSslKey key(keyFile.readAll(), QSsl::Rsa, QSsl::Pem, QSsl::PrivateKey);
+ if (!key.isNull()) {
+ configuration.setPrivateKey(key);
+ } else {
+ qCritical() << "Could not parse key: " << keyFileName;
+ }
+ } else {
+ qCritical() << "Could not find key: " << keyFileName;
+ }
+
+ QList<QSslCertificate> localCerts = QSslCertificate::fromPath(certificateFileName);
+ if (!localCerts.isEmpty()) {
+ configuration.setLocalCertificateChain(localCerts);
+ } else {
+ qCritical() << "Could not find certificate: " << certificateFileName;
+ }
+
+ if (!ca.isEmpty()) {
+ QList<QSslCertificate> caCerts = QSslCertificate::fromPath(ca);
+ if (!caCerts.isEmpty()) {
+ configuration.addCaCertificates(caCerts);
+ configuration.setPeerVerifyMode(QSslSocket::VerifyPeer);
+ } else {
+ qCritical() << "Could not find certificate: " << certificateFileName;
+ }
+ }
+
+ QSslServer *server = new QSslServer();
+ server->setSslConfiguration(configuration);
+ return server;
+}
+
+struct HttpsServer : HttpServer
+{
+ HttpsServer(const QString &certPath, const QString &keyPath, const QString &ca,
+ quint16 port = 0, QObject *parent = nullptr)
+ : HttpServer(createServer(certPath, keyPath, ca), "https", QHostAddress::LocalHost, port,
+ parent)
+ {
+ }
+
+ void setVerifyMode(const QSslSocket::PeerVerifyMode verifyMode)
+ {
+ QSslServer *server = static_cast<QSslServer *>(getTcpServer());
+ QSslConfiguration config = server->sslConfiguration();
+ config.setPeerVerifyMode(verifyMode);
+ server->setSslConfiguration(config);
+ }
+};
+
+#endif
diff --git a/tests/auto/httpserver/proxy_server.cpp b/tests/auto/httpserver/proxy_server.cpp
new file mode 100644
index 000000000..338415311
--- /dev/null
+++ b/tests/auto/httpserver/proxy_server.cpp
@@ -0,0 +1,85 @@
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#include "proxy_server.h"
+#include <QDataStream>
+#include <QTcpSocket>
+#include <QDebug>
+
+ProxyServer::ProxyServer(QObject *parent) : QObject(parent)
+{
+ connect(&m_server, &QTcpServer::newConnection, this, &ProxyServer::handleNewConnection);
+}
+
+void ProxyServer::setPort(int port)
+{
+ m_port = port;
+}
+
+void ProxyServer::setCredentials(const QByteArray &user, const QByteArray password)
+{
+ m_auth.append(user);
+ m_auth.append(':');
+ m_auth.append(password);
+ m_auth = m_auth.toBase64();
+ m_authenticate = true;
+}
+
+void ProxyServer::setCookie(const QByteArray &cookie)
+{
+ m_cookie.append(QByteArrayLiteral("Cookie: "));
+ m_cookie.append(cookie);
+}
+
+
+bool ProxyServer::isListening()
+{
+ return m_server.isListening();
+}
+
+void ProxyServer::run()
+{
+ if (!m_server.listen(QHostAddress::LocalHost, m_port))
+ qFatal("Could not start the test server");
+}
+
+void ProxyServer::handleNewConnection()
+{
+ // do one connection at the time
+ Q_ASSERT(m_data.isEmpty());
+ QTcpSocket *socket = m_server.nextPendingConnection();
+ Q_ASSERT(socket);
+ connect(socket, &QAbstractSocket::disconnected, socket, &QObject::deleteLater);
+ connect(socket, &QAbstractSocket::readyRead, this, &ProxyServer::handleReadReady);
+}
+
+void ProxyServer::handleReadReady()
+{
+ QTcpSocket *socket = qobject_cast<QTcpSocket*>(sender());
+ Q_ASSERT(socket);
+
+ m_data.append(socket->readAll());
+
+ if (!m_data.endsWith("\r\n\r\n"))
+ return;
+
+ if (m_authenticate && !m_data.contains(QByteArrayLiteral("Proxy-Authorization: Basic"))) {
+ socket->write("HTTP/1.1 407 Proxy Authentication Required\nProxy-Authenticate: "
+ "Basic realm=\"Proxy requires authentication\"\r\n"
+ "content-length: 0\r\n"
+ "\r\n");
+ return;
+ }
+
+ if (m_authenticate && m_data.contains(m_auth)) {
+ emit authenticationSuccess();
+ }
+
+ if (m_data.contains(m_cookie)) {
+ emit cookieMatch();
+ }
+ m_data.clear();
+ emit requestReceived();
+}
+
+#include "moc_proxy_server.cpp"
diff --git a/tests/auto/httpserver/proxy_server.h b/tests/auto/httpserver/proxy_server.h
new file mode 100644
index 000000000..6be0c4e1a
--- /dev/null
+++ b/tests/auto/httpserver/proxy_server.h
@@ -0,0 +1,42 @@
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#ifndef PROXY_SERVER_H
+#define PROXY_SERVER_H
+
+#include <QObject>
+#include <QTcpServer>
+
+class ProxyServer : public QObject
+{
+ Q_OBJECT
+
+public:
+ explicit ProxyServer(QObject *parent = nullptr);
+ void setCredentials(const QByteArray &user, const QByteArray password);
+ void setCookie(const QByteArray &cookie);
+ bool isListening();
+ void setPort(int port);
+
+public slots:
+ void run();
+
+private slots:
+ void handleNewConnection();
+ void handleReadReady();
+
+signals:
+ void authenticationSuccess();
+ void cookieMatch();
+ void requestReceived();
+
+private:
+ int m_port = 5555;
+ QByteArray m_data;
+ QTcpServer m_server;
+ QByteArray m_auth;
+ QByteArray m_cookie;
+ bool m_authenticate = false;
+};
+
+#endif // PROXY_SERVER_H
diff --git a/tests/auto/pdf/CMakeLists.txt b/tests/auto/pdf/CMakeLists.txt
new file mode 100644
index 000000000..205bd24d0
--- /dev/null
+++ b/tests/auto/pdf/CMakeLists.txt
@@ -0,0 +1,12 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+add_subdirectory(qpdfbookmarkmodel)
+if (TARGET Qt::PdfWidgets)
+ add_subdirectory(qpdfpagenavigator)
+endif()
+add_subdirectory(qpdfpagerenderer)
+add_subdirectory(qpdfsearchmodel)
+if(TARGET Qt::PrintSupport)
+ add_subdirectory(qpdfdocument)
+endif()
diff --git a/tests/auto/pdf/pdf.pro b/tests/auto/pdf/pdf.pro
deleted file mode 100644
index a2b3fcff2..000000000
--- a/tests/auto/pdf/pdf.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-TEMPLATE = subdirs
-
-SUBDIRS = \
- qpdfbookmarkmodel \
- qpdfpagenavigation \
- qpdfpagerenderer
-
-qtHaveModule(printsupport): SUBDIRS += qpdfdocument
diff --git a/tests/auto/pdf/qpdfbookmarkmodel/CMakeLists.txt b/tests/auto/pdf/qpdfbookmarkmodel/CMakeLists.txt
new file mode 100644
index 000000000..729bc9138
--- /dev/null
+++ b/tests/auto/pdf/qpdfbookmarkmodel/CMakeLists.txt
@@ -0,0 +1,15 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_test(tst_qpdfbookmarkmodel
+ SOURCES
+ tst_qpdfbookmarkmodel.cpp
+ LIBRARIES
+ Qt::Gui
+ Qt::Network
+ Qt::Pdf
+ TESTDATA
+ pdf-sample.bookmarks.pdf
+ pdf-sample.bookmarks_pages.pdf
+)
+
diff --git a/tests/auto/pdf/qpdfbookmarkmodel/qpdfbookmarkmodel.pro b/tests/auto/pdf/qpdfbookmarkmodel/qpdfbookmarkmodel.pro
deleted file mode 100644
index 11a010637..000000000
--- a/tests/auto/pdf/qpdfbookmarkmodel/qpdfbookmarkmodel.pro
+++ /dev/null
@@ -1,5 +0,0 @@
-CONFIG += testcase
-TARGET = tst_qpdfbookmarkmodel
-QT += pdf testlib network
-macos:CONFIG -= app_bundle
-SOURCES += tst_qpdfbookmarkmodel.cpp
diff --git a/tests/auto/pdf/qpdfbookmarkmodel/tst_qpdfbookmarkmodel.cpp b/tests/auto/pdf/qpdfbookmarkmodel/tst_qpdfbookmarkmodel.cpp
index fddc98011..a1804e179 100644
--- a/tests/auto/pdf/qpdfbookmarkmodel/tst_qpdfbookmarkmodel.cpp
+++ b/tests/auto/pdf/qpdfbookmarkmodel/tst_qpdfbookmarkmodel.cpp
@@ -1,38 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include <QtTest/QtTest>
@@ -57,8 +24,8 @@ private slots:
void setLoadedDocument();
void unloadDocument();
void testTreeStructure();
- void testListStructure();
void testPageNumberRole();
+ void testLocationAndZoomRoles();
};
void tst_QPdfBookmarkModel::emptyModel()
@@ -66,7 +33,6 @@ void tst_QPdfBookmarkModel::emptyModel()
QPdfBookmarkModel model;
QVERIFY(!model.document());
- QCOMPARE(model.structureMode(), QPdfBookmarkModel::TreeMode);
QCOMPARE(model.rowCount(), 0);
QCOMPARE(model.columnCount(), 1);
QCOMPARE(model.index(0, 0).isValid(), false);
@@ -80,7 +46,6 @@ void tst_QPdfBookmarkModel::setEmptyDocument()
model.setDocument(&document);
QCOMPARE(model.document(), &document);
- QCOMPARE(model.structureMode(), QPdfBookmarkModel::TreeMode);
QCOMPARE(model.rowCount(), 0);
QCOMPARE(model.columnCount(), 1);
QCOMPARE(model.index(0, 0).isValid(), false);
@@ -96,10 +61,10 @@ void tst_QPdfBookmarkModel::setEmptyDocumentAndLoad()
QSignalSpy modelAboutToBeResetSpy(&model, SIGNAL(modelAboutToBeReset()));
QSignalSpy modelResetSpy(&model, SIGNAL(modelReset()));
- QCOMPARE(document.load(QFINDTESTDATA("pdf-sample.bookmarks.pdf")), QPdfDocument::NoError);
+ QCOMPARE(document.load(QFINDTESTDATA("pdf-sample.bookmarks.pdf")), QPdfDocument::Error::None);
- QCOMPARE(modelAboutToBeResetSpy.count(), 1);
- QCOMPARE(modelResetSpy.count(), 1);
+ QCOMPARE(modelAboutToBeResetSpy.size(), 1);
+ QCOMPARE(modelResetSpy.size(), 1);
QCOMPARE(model.rowCount(), 3);
}
@@ -107,7 +72,7 @@ void tst_QPdfBookmarkModel::setEmptyDocumentAndLoad()
void tst_QPdfBookmarkModel::setLoadedDocument()
{
QPdfDocument document;
- QCOMPARE(document.load(QFINDTESTDATA("pdf-sample.bookmarks.pdf")), QPdfDocument::NoError);
+ QCOMPARE(document.load(QFINDTESTDATA("pdf-sample.bookmarks.pdf")), QPdfDocument::Error::None);
QPdfBookmarkModel model;
@@ -116,8 +81,8 @@ void tst_QPdfBookmarkModel::setLoadedDocument()
model.setDocument(&document);
- QCOMPARE(modelAboutToBeResetSpy.count(), 1);
- QCOMPARE(modelResetSpy.count(), 1);
+ QCOMPARE(modelAboutToBeResetSpy.size(), 1);
+ QCOMPARE(modelResetSpy.size(), 1);
QCOMPARE(model.rowCount(), 3);
}
@@ -125,7 +90,7 @@ void tst_QPdfBookmarkModel::setLoadedDocument()
void tst_QPdfBookmarkModel::unloadDocument()
{
QPdfDocument document;
- QCOMPARE(document.load(QFINDTESTDATA("pdf-sample.bookmarks.pdf")), QPdfDocument::NoError);
+ QCOMPARE(document.load(QFINDTESTDATA("pdf-sample.bookmarks.pdf")), QPdfDocument::Error::None);
QPdfBookmarkModel model;
model.setDocument(&document);
@@ -137,8 +102,8 @@ void tst_QPdfBookmarkModel::unloadDocument()
document.close();
- QCOMPARE(modelAboutToBeResetSpy.count(), 1);
- QCOMPARE(modelResetSpy.count(), 1);
+ QCOMPARE(modelAboutToBeResetSpy.size(), 1);
+ QCOMPARE(modelResetSpy.size(), 1);
QCOMPARE(model.rowCount(), 0);
}
@@ -146,7 +111,7 @@ void tst_QPdfBookmarkModel::unloadDocument()
void tst_QPdfBookmarkModel::testTreeStructure()
{
QPdfDocument document;
- QCOMPARE(document.load(QFINDTESTDATA("pdf-sample.bookmarks.pdf")), QPdfDocument::NoError);
+ QCOMPARE(document.load(QFINDTESTDATA("pdf-sample.bookmarks.pdf")), QPdfDocument::Error::None);
QPdfBookmarkModel model;
model.setDocument(&document);
@@ -154,115 +119,76 @@ void tst_QPdfBookmarkModel::testTreeStructure()
QCOMPARE(model.rowCount(), 3);
const QModelIndex index1 = model.index(0, 0);
- QCOMPARE(index1.data(QPdfBookmarkModel::TitleRole).toString(), QLatin1String("Section 1"));
- QCOMPARE(index1.data(QPdfBookmarkModel::LevelRole).toInt(), 0);
+ QCOMPARE(index1.data(int(QPdfBookmarkModel::Role::Title)).toString(), QLatin1String("Section 1"));
+ QCOMPARE(index1.data(int(QPdfBookmarkModel::Role::Level)).toInt(), 0);
QCOMPARE(model.rowCount(index1), 2);
const QModelIndex index1_1 = model.index(0, 0, index1);
- QCOMPARE(index1_1.data(QPdfBookmarkModel::TitleRole).toString(), QLatin1String("Section 1.1"));
- QCOMPARE(index1_1.data(QPdfBookmarkModel::LevelRole).toInt(), 1);
+ QCOMPARE(index1_1.data(int(QPdfBookmarkModel::Role::Title)).toString(), QLatin1String("Section 1.1"));
+ QCOMPARE(index1_1.data(int(QPdfBookmarkModel::Role::Level)).toInt(), 1);
QCOMPARE(model.rowCount(index1_1), 0);
const QModelIndex index1_2 = model.index(1, 0, index1);
- QCOMPARE(index1_2.data(QPdfBookmarkModel::TitleRole).toString(), QLatin1String("Section 1.2"));
- QCOMPARE(index1_2.data(QPdfBookmarkModel::LevelRole).toInt(), 1);
+ QCOMPARE(index1_2.data(int(QPdfBookmarkModel::Role::Title)).toString(), QLatin1String("Section 1.2"));
+ QCOMPARE(index1_2.data(int(QPdfBookmarkModel::Role::Level)).toInt(), 1);
QCOMPARE(model.rowCount(index1_2), 0);
const QModelIndex index2 = model.index(1, 0);
- QCOMPARE(index2.data(QPdfBookmarkModel::TitleRole).toString(), QLatin1String("Section 2"));
- QCOMPARE(index2.data(QPdfBookmarkModel::LevelRole).toInt(), 0);
+ QCOMPARE(index2.data(int(QPdfBookmarkModel::Role::Title)).toString(), QLatin1String("Section 2"));
+ QCOMPARE(index2.data(int(QPdfBookmarkModel::Role::Level)).toInt(), 0);
QCOMPARE(model.rowCount(index2), 2);
const QModelIndex index2_1 = model.index(0, 0, index2);
- QCOMPARE(index2_1.data(QPdfBookmarkModel::TitleRole).toString(), QLatin1String("Section 2.1"));
- QCOMPARE(index2_1.data(QPdfBookmarkModel::LevelRole).toInt(), 1);
+ QCOMPARE(index2_1.data(int(QPdfBookmarkModel::Role::Title)).toString(), QLatin1String("Section 2.1"));
+ QCOMPARE(index2_1.data(int(QPdfBookmarkModel::Role::Level)).toInt(), 1);
QCOMPARE(model.rowCount(index2_1), 1);
const QModelIndex index2_1_1 = model.index(0, 0, index2_1);
- QCOMPARE(index2_1_1.data(QPdfBookmarkModel::TitleRole).toString(), QLatin1String("Section 2.1.1"));
- QCOMPARE(index2_1_1.data(QPdfBookmarkModel::LevelRole).toInt(), 2);
+ QCOMPARE(index2_1_1.data(int(QPdfBookmarkModel::Role::Title)).toString(), QLatin1String("Section 2.1.1"));
+ QCOMPARE(index2_1_1.data(int(QPdfBookmarkModel::Role::Level)).toInt(), 2);
QCOMPARE(model.rowCount(index2_1_1), 0);
const QModelIndex index2_2 = model.index(1, 0, index2);
- QCOMPARE(index2_2.data(QPdfBookmarkModel::TitleRole).toString(), QLatin1String("Section 2.2"));
- QCOMPARE(index2_2.data(QPdfBookmarkModel::LevelRole).toInt(), 1);
+ QCOMPARE(index2_2.data(int(QPdfBookmarkModel::Role::Title)).toString(), QLatin1String("Section 2.2"));
+ QCOMPARE(index2_2.data(int(QPdfBookmarkModel::Role::Level)).toInt(), 1);
QCOMPARE(model.rowCount(index2_2), 0);
const QModelIndex index3 = model.index(2, 0);
- QCOMPARE(index3.data(QPdfBookmarkModel::TitleRole).toString(), QLatin1String("Section 3"));
- QCOMPARE(index3.data(QPdfBookmarkModel::LevelRole).toInt(), 0);
+ QCOMPARE(index3.data(int(QPdfBookmarkModel::Role::Title)).toString(), QLatin1String("Section 3"));
+ QCOMPARE(index3.data(int(QPdfBookmarkModel::Role::Level)).toInt(), 0);
QCOMPARE(model.rowCount(index3), 0);
const QModelIndex index4 = model.index(3, 0);
QCOMPARE(index4, QModelIndex());
}
-void tst_QPdfBookmarkModel::testListStructure()
+void tst_QPdfBookmarkModel::testPageNumberRole()
{
QPdfDocument document;
- QCOMPARE(document.load(QFINDTESTDATA("pdf-sample.bookmarks.pdf")), QPdfDocument::NoError);
+ QCOMPARE(document.load(QFINDTESTDATA("pdf-sample.bookmarks_pages.pdf")), QPdfDocument::Error::None);
QPdfBookmarkModel model;
model.setDocument(&document);
- QSignalSpy modelAboutToBeResetSpy(&model, SIGNAL(modelAboutToBeReset()));
- QSignalSpy modelResetSpy(&model, SIGNAL(modelReset()));
-
- model.setStructureMode(QPdfBookmarkModel::ListMode);
-
- QCOMPARE(modelAboutToBeResetSpy.count(), 1);
- QCOMPARE(modelResetSpy.count(), 1);
-
- QCOMPARE(model.rowCount(), 8);
+ QCOMPARE(model.rowCount(), 3);
const QModelIndex index1 = model.index(0, 0);
- QCOMPARE(index1.data(QPdfBookmarkModel::TitleRole).toString(), QLatin1String("Section 1"));
- QCOMPARE(index1.data(QPdfBookmarkModel::LevelRole).toInt(), 0);
- QCOMPARE(model.rowCount(index1), 0);
-
- const QModelIndex index1_1 = model.index(1, 0);
- QCOMPARE(index1_1.data(QPdfBookmarkModel::TitleRole).toString(), QLatin1String("Section 1.1"));
- QCOMPARE(index1_1.data(QPdfBookmarkModel::LevelRole).toInt(), 1);
- QCOMPARE(model.rowCount(index1_1), 0);
-
- const QModelIndex index1_2 = model.index(2, 0);
- QCOMPARE(index1_2.data(QPdfBookmarkModel::TitleRole).toString(), QLatin1String("Section 1.2"));
- QCOMPARE(index1_2.data(QPdfBookmarkModel::LevelRole).toInt(), 1);
- QCOMPARE(model.rowCount(index1_2), 0);
+ QCOMPARE(index1.data(int(QPdfBookmarkModel::Role::Page)).toInt(), 0);
- const QModelIndex index2 = model.index(3, 0);
- QCOMPARE(index2.data(QPdfBookmarkModel::TitleRole).toString(), QLatin1String("Section 2"));
- QCOMPARE(index2.data(QPdfBookmarkModel::LevelRole).toInt(), 0);
- QCOMPARE(model.rowCount(index2), 0);
-
- const QModelIndex index2_1 = model.index(4, 0);
- QCOMPARE(index2_1.data(QPdfBookmarkModel::TitleRole).toString(), QLatin1String("Section 2.1"));
- QCOMPARE(index2_1.data(QPdfBookmarkModel::LevelRole).toInt(), 1);
- QCOMPARE(model.rowCount(index2_1), 0);
-
- const QModelIndex index2_1_1 = model.index(5, 0);
- QCOMPARE(index2_1_1.data(QPdfBookmarkModel::TitleRole).toString(), QLatin1String("Section 2.1.1"));
- QCOMPARE(index2_1_1.data(QPdfBookmarkModel::LevelRole).toInt(), 2);
- QCOMPARE(model.rowCount(index2_1_1), 0);
-
- const QModelIndex index2_2 = model.index(6, 0);
- QCOMPARE(index2_2.data(QPdfBookmarkModel::TitleRole).toString(), QLatin1String("Section 2.2"));
- QCOMPARE(index2_2.data(QPdfBookmarkModel::LevelRole).toInt(), 1);
- QCOMPARE(model.rowCount(index2_2), 0);
+ const QModelIndex index2 = model.index(1, 0);
+ QCOMPARE(index2.data(int(QPdfBookmarkModel::Role::Page)).toInt(), 1);
- const QModelIndex index3 = model.index(7, 0);
- QCOMPARE(index3.data(QPdfBookmarkModel::TitleRole).toString(), QLatin1String("Section 3"));
- QCOMPARE(index3.data(QPdfBookmarkModel::LevelRole).toInt(), 0);
- QCOMPARE(model.rowCount(index3), 0);
+ const QModelIndex index2_1 = model.index(0, 0, index2);
+ QCOMPARE(index2_1.data(int(QPdfBookmarkModel::Role::Page)).toInt(), 1);
- const QModelIndex index4 = model.index(8, 0);
- QCOMPARE(index4, QModelIndex());
+ const QModelIndex index3 = model.index(2, 0);
+ QCOMPARE(index3.data(int(QPdfBookmarkModel::Role::Page)).toInt(), 2);
}
-void tst_QPdfBookmarkModel::testPageNumberRole()
+void tst_QPdfBookmarkModel::testLocationAndZoomRoles()
{
QPdfDocument document;
- QCOMPARE(document.load(QFINDTESTDATA("pdf-sample.bookmarks_pages.pdf")), QPdfDocument::NoError);
+ QCOMPARE(document.load(QFINDTESTDATA("pdf-sample.bookmarks_pages.pdf")), QPdfDocument::Error::None);
QPdfBookmarkModel model;
model.setDocument(&document);
@@ -270,16 +196,20 @@ void tst_QPdfBookmarkModel::testPageNumberRole()
QCOMPARE(model.rowCount(), 3);
const QModelIndex index1 = model.index(0, 0);
- QCOMPARE(index1.data(QPdfBookmarkModel::PageNumberRole).toInt(), 0);
+ QCOMPARE(index1.data(int(QPdfBookmarkModel::Role::Location)).toPoint(), QPoint(57, 69));
+ QCOMPARE(index1.data(int(QPdfBookmarkModel::Role::Zoom)).toInt(), 0);
const QModelIndex index2 = model.index(1, 0);
- QCOMPARE(index2.data(QPdfBookmarkModel::PageNumberRole).toInt(), 1);
+ QCOMPARE(index2.data(int(QPdfBookmarkModel::Role::Location)).toPoint(), QPoint(57, 57));
+ QCOMPARE(index2.data(int(QPdfBookmarkModel::Role::Zoom)).toInt(), 0);
const QModelIndex index2_1 = model.index(0, 0, index2);
- QCOMPARE(index2_1.data(QPdfBookmarkModel::PageNumberRole).toInt(), 1);
+ QCOMPARE(index2_1.data(int(QPdfBookmarkModel::Role::Location)).toPoint(), QPoint(57, 526));
+ QCOMPARE(index2_1.data(int(QPdfBookmarkModel::Role::Zoom)).toInt(), 0);
const QModelIndex index3 = model.index(2, 0);
- QCOMPARE(index3.data(QPdfBookmarkModel::PageNumberRole).toInt(), 2);
+ QCOMPARE(index3.data(int(QPdfBookmarkModel::Role::Location)).toPoint(), QPoint(57, 402));
+ QCOMPARE(index3.data(int(QPdfBookmarkModel::Role::Zoom)).toInt(), 0);
}
QTEST_MAIN(tst_QPdfBookmarkModel)
diff --git a/tests/auto/pdf/qpdfdocument/BLACKLIST b/tests/auto/pdf/qpdfdocument/BLACKLIST
deleted file mode 100644
index b8db556d6..000000000
--- a/tests/auto/pdf/qpdfdocument/BLACKLIST
+++ /dev/null
@@ -1,6 +0,0 @@
-[password]
-*
-
-[passwordClearedOnClose]
-*
-
diff --git a/tests/auto/pdf/qpdfdocument/CMakeLists.txt b/tests/auto/pdf/qpdfdocument/CMakeLists.txt
new file mode 100644
index 000000000..b8300ef27
--- /dev/null
+++ b/tests/auto/pdf/qpdfdocument/CMakeLists.txt
@@ -0,0 +1,18 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_test(tst_qpdfdocument
+ SOURCES
+ tst_qpdfdocument.cpp
+ LIBRARIES
+ Qt::Gui
+ Qt::Network
+ Qt::PrintSupport
+ Qt::Pdf
+ TESTDATA
+ pdf-sample.protected.pdf
+ pdf-sample.metadata.pdf
+ rotated_text.pdf
+ tagged_mcr_multipage.pdf
+ test.pdf
+)
diff --git a/tests/auto/pdf/qpdfdocument/qpdfdocument.pro b/tests/auto/pdf/qpdfdocument/qpdfdocument.pro
deleted file mode 100644
index 8382a25e3..000000000
--- a/tests/auto/pdf/qpdfdocument/qpdfdocument.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-CONFIG += testcase
-TARGET = tst_qpdfdocument
-QT += pdf printsupport testlib network
-macx:CONFIG -= app_bundle
-SOURCES += tst_qpdfdocument.cpp
-
diff --git a/tests/auto/pdf/qpdfdocument/rotated_text.pdf b/tests/auto/pdf/qpdfdocument/rotated_text.pdf
new file mode 100644
index 000000000..d6d8db84e
--- /dev/null
+++ b/tests/auto/pdf/qpdfdocument/rotated_text.pdf
@@ -0,0 +1,70 @@
+%PDF-1.7
+% ò¤ô
+1 0 obj <<
+ /Type /Catalog
+ /Pages 2 0 R
+>>
+endobj
+2 0 obj <<
+ /Type /Pages
+ /MediaBox [ 0 0 200 200 ]
+ /Count 1
+ /Kids [ 3 0 R ]
+>>
+endobj
+3 0 obj <<
+ /Type /Page
+ /Parent 2 0 R
+ /Resources <<
+ /Font <<
+ /F1 4 0 R
+ >>
+ >>
+ /Contents 5 0 R
+>>
+endobj
+4 0 obj <<
+ /Type /Font
+ /Subtype /Type1
+ /BaseFont /Times-Roman
+>>
+endobj
+5 0 obj <<
+ /Length 406
+>>
+stream
+BT
+0 0 Td
+/F1 12 Tf
+0.70710678118 -0.70710678118 0.70710678118 0.70710678118 100 100 Tm
+(Hello,) Tj
+0 0 Td
+/F1 12 Tf
+-0.70710678118 -0.70710678118 0.70710678118 -0.70710678118 100 100 Tm
+( world!\r\n) Tj
+0 0 Td
+/F1 12 Tf
+-0.70710678118 0.70710678118 -0.70710678118 -0.70710678118 100 100 Tm
+(Goodbye,) Tj
+0 0 Td
+/F1 12 Tf
+0.70710678118 0.70710678118 -0.70710678118 0.70710678118 100 100 Tm
+( world!) Tj
+ET
+endstream
+endobj
+xref
+0 6
+0000000000 65535 f
+0000000015 00000 n
+0000000068 00000 n
+0000000161 00000 n
+0000000287 00000 n
+0000000365 00000 n
+trailer <<
+ /Root 1 0 R
+ /Size 6
+>>
+startxref
+823
+%%EOF
diff --git a/tests/auto/pdf/qpdfdocument/tagged_mcr_multipage.pdf b/tests/auto/pdf/qpdfdocument/tagged_mcr_multipage.pdf
new file mode 100644
index 000000000..fcc5fafda
--- /dev/null
+++ b/tests/auto/pdf/qpdfdocument/tagged_mcr_multipage.pdf
@@ -0,0 +1,136 @@
+%PDF-1.7
+% ò¤ô
+1 0 obj <<
+ /Type /Catalog
+ /MarkInfo <<
+ /Type /MarkInfo
+ /Marked true
+ >>
+ /Pages 2 0 R
+ /StructTreeRoot 8 0 R
+>>
+endobj
+2 0 obj <<
+ /Type /Pages
+ /CropBox [ 10.8197 8.459 605.705 801.639 ]
+ /MediaBox [ 0.0 0.0 616.721 809.902 ]
+ /Count 2
+ /Kids [
+ 4 0 R
+ 6 0 R
+ ]
+>>
+endobj
+3 0 obj <<
+ /Type /Font
+ /Subtype /Type1
+ /BaseFont /Times-Roman
+>>
+endobj
+4 0 obj <<
+ /Type /Page
+ /Tabs /S
+ /Parent 2 0 R
+ /StructParents 0
+ /Contents 5 0 R
+ /Resources <<
+ /ProcSet [/PDF /Text]
+ /Font <<
+ /F1 3 0 R
+ >>
+ >>
+>>
+endobj
+5 0 obj <<
+ /Length 83
+>>
+stream
+BT
+/Document <</MCID 0 >>BDC
+0 i
+/F1 1 Tf
+12 0 0 12 43.073 771.625 Tm
+(1)Tj
+EMC
+ET
+endstream
+endobj
+6 0 obj <<
+ /Type /Page
+ /Tabs /S
+ /Parent 2 0 R
+ /StructParents 1
+ /Contents 7 0 R
+ /Resources <<
+ /ProcSet [/PDF /Text]
+ /Font <<
+ /F1 3 0 R
+ >>
+ >>
+>>
+endobj
+7 0 obj <<
+ /Length 83
+>>
+stream
+BT
+/Document <</MCID 0 >>BDC
+0 i
+/F1 1 Tf
+12 0 0 12 43.073 771.625 Tm
+(2)Tj
+EMC
+ET
+endstream
+endobj
+8 0 obj <<
+ /Type /StructTreeRoot
+ /K 10 0 R
+ /ParentTree 9 0 R
+ /ParentTreeNextKey 2
+>>
+endobj
+9 0 obj <<
+ /Nums [
+ 0
+ [10 0 R]
+ 1
+ [10 0 R]
+ ]
+>>
+endobj
+10 0 obj <<
+ /T ()
+ /S /Document
+ /P 8 0 R
+ /Pg 4 0 R
+ /K [
+ 0
+ <<
+ /MCID 0
+ /Pg 6 0 R
+ /Type /MCR
+ >>
+ ]
+>>
+%endobj
+xref
+0 11
+0000000000 65535 f
+0000000015 00000 n
+0000000149 00000 n
+0000000315 00000 n
+0000000393 00000 n
+0000000575 00000 n
+0000000709 00000 n
+0000000891 00000 n
+0000001025 00000 n
+0000001125 00000 n
+0000001198 00000 n
+trailer <<
+ /Root 1 0 R
+ /Size 11
+>>
+startxref
+1345
+%%EOF
diff --git a/tests/auto/pdf/qpdfdocument/test.pdf b/tests/auto/pdf/qpdfdocument/test.pdf
new file mode 100644
index 000000000..0832dfbed
--- /dev/null
+++ b/tests/auto/pdf/qpdfdocument/test.pdf
Binary files differ
diff --git a/tests/auto/pdf/qpdfdocument/tst_qpdfdocument.cpp b/tests/auto/pdf/qpdfdocument/tst_qpdfdocument.cpp
index 29b85fc89..d222bff0c 100644
--- a/tests/auto/pdf/qpdfdocument/tst_qpdfdocument.cpp
+++ b/tests/auto/pdf/qpdfdocument/tst_qpdfdocument.cpp
@@ -1,38 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include <QtTest/QtTest>
@@ -40,7 +7,9 @@
#include <QPainter>
#include <QPdfDocument>
#include <QPrinter>
+#include <QDateTime>
#include <QTemporaryFile>
+#include <QTimeZone>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
@@ -66,16 +35,32 @@ private slots:
void status();
void passwordClearedOnClose();
void metaData();
+ void pageLabels();
+ void getSelection_data();
+ void getSelection();
+ void getSelectionAtIndex_data();
+ void getSelectionAtIndex();
+
+private:
+ void consistencyCheck(QPdfDocument &doc) const;
};
struct TemporaryPdf: public QTemporaryFile
{
TemporaryPdf();
QPageLayout pageLayout;
+
+ static QString pageText(int page) {
+ switch (page) {
+ case 0: return QStringLiteral("Hello Page 1");
+ case 1: return QStringLiteral("Hello Page 2");
+ default: return {};
+ }
+ }
};
-TemporaryPdf::TemporaryPdf()
+TemporaryPdf::TemporaryPdf():QTemporaryFile(QStringLiteral("qpdfdocument"))
{
open();
pageLayout = QPageLayout(QPageSize(QPageSize::A4), QPageLayout::Portrait, QMarginsF());
@@ -88,9 +73,9 @@ TemporaryPdf::TemporaryPdf()
{
QPainter painter(&printer);
- painter.drawText(100, 100, QStringLiteral("Hello Page 1"));
+ painter.drawText(100, 100, pageText(0));
printer.newPage();
- painter.drawText(100, 100, QStringLiteral("Hello Page 2"));
+ painter.drawText(100, 100, pageText(1));
}
}
@@ -105,12 +90,12 @@ void tst_QPdfDocument::pageCount()
QSignalSpy pageCountChangedSpy(&doc, SIGNAL(pageCountChanged(int)));
QCOMPARE(doc.pageCount(), 0);
- QCOMPARE(doc.load(tempPdf.fileName()), QPdfDocument::NoError);
+ QCOMPARE(doc.load(tempPdf.fileName()), QPdfDocument::Error::None);
QCOMPARE(doc.pageCount(), 2);
- QCOMPARE(pageCountChangedSpy.count(), 1);
+ QCOMPARE(pageCountChangedSpy.size(), 1);
QCOMPARE(pageCountChangedSpy[0][0].toInt(), doc.pageCount());
- QCOMPARE(doc.pageSize(0).toSize(), tempPdf.pageLayout.fullRectPoints().size());
+ QCOMPARE(doc.pagePointSize(0).toSize(), tempPdf.pageLayout.fullRectPoints().size());
}
void tst_QPdfDocument::loadFromIODevice()
@@ -120,13 +105,26 @@ void tst_QPdfDocument::loadFromIODevice()
QSignalSpy statusChangedSpy(&doc, SIGNAL(statusChanged(QPdfDocument::Status)));
QSignalSpy pageCountChangedSpy(&doc, SIGNAL(pageCountChanged(int)));
doc.load(&tempPdf);
- QCOMPARE(statusChangedSpy.count(), 2);
- QCOMPARE(statusChangedSpy[0][0].value<QPdfDocument::Status>(), QPdfDocument::Loading);
- QCOMPARE(statusChangedSpy[1][0].value<QPdfDocument::Status>(), QPdfDocument::Ready);
- QCOMPARE(doc.error(), QPdfDocument::NoError);
+ QCOMPARE(statusChangedSpy.size(), 2);
+ QCOMPARE(statusChangedSpy[0][0].value<QPdfDocument::Status>(), QPdfDocument::Status::Loading);
+ QCOMPARE(statusChangedSpy[1][0].value<QPdfDocument::Status>(), QPdfDocument::Status::Ready);
+ QCOMPARE(doc.error(), QPdfDocument::Error::None);
QCOMPARE(doc.pageCount(), 2);
- QCOMPARE(pageCountChangedSpy.count(), 1);
+ QCOMPARE(pageCountChangedSpy.size(), 1);
QCOMPARE(pageCountChangedSpy[0][0].toInt(), doc.pageCount());
+
+ consistencyCheck(doc);
+}
+
+void tst_QPdfDocument::consistencyCheck(QPdfDocument &doc) const
+{
+ for (int i = 0; i < doc.pageCount(); ++i) {
+ const QString expected = TemporaryPdf::pageText(i);
+ QPdfSelection page = doc.getAllText(i);
+ QCOMPARE(page.text(), expected);
+ auto pageMoved = std::move(page);
+ QCOMPARE(pageMoved.text(), expected);
+ }
}
void tst_QPdfDocument::loadAsync()
@@ -144,12 +142,14 @@ void tst_QPdfDocument::loadAsync()
doc.load(reply.data());
- QCOMPARE(statusChangedSpy.count(), 2);
- QCOMPARE(statusChangedSpy[0][0].value<QPdfDocument::Status>(), QPdfDocument::Loading);
- QCOMPARE(statusChangedSpy[1][0].value<QPdfDocument::Status>(), QPdfDocument::Ready);
+ QCOMPARE(statusChangedSpy.size(), 2);
+ QCOMPARE(statusChangedSpy[0][0].value<QPdfDocument::Status>(), QPdfDocument::Status::Loading);
+ QCOMPARE(statusChangedSpy[1][0].value<QPdfDocument::Status>(), QPdfDocument::Status::Ready);
QCOMPARE(doc.pageCount(), 2);
- QCOMPARE(pageCountChangedSpy.count(), 1);
+ QCOMPARE(pageCountChangedSpy.size(), 1);
QCOMPARE(pageCountChangedSpy[0][0].toInt(), doc.pageCount());
+
+ consistencyCheck(doc);
}
void tst_QPdfDocument::password()
@@ -158,15 +158,15 @@ void tst_QPdfDocument::password()
QSignalSpy passwordChangedSpy(&doc, SIGNAL(passwordChanged()));
QCOMPARE(doc.pageCount(), 0);
- QCOMPARE(doc.load(QFINDTESTDATA("pdf-sample.protected.pdf")), QPdfDocument::IncorrectPasswordError);
- QCOMPARE(passwordChangedSpy.count(), 0);
+ QCOMPARE(doc.load(QFINDTESTDATA("pdf-sample.protected.pdf")), QPdfDocument::Error::IncorrectPassword);
+ QCOMPARE(passwordChangedSpy.size(), 0);
doc.setPassword(QStringLiteral("WrongPassword"));
- QCOMPARE(passwordChangedSpy.count(), 1);
- QCOMPARE(doc.load(QFINDTESTDATA("pdf-sample.protected.pdf")), QPdfDocument::IncorrectPasswordError);
- QCOMPARE(doc.status(), QPdfDocument::Error);
+ QCOMPARE(passwordChangedSpy.size(), 1);
+ QCOMPARE(doc.load(QFINDTESTDATA("pdf-sample.protected.pdf")), QPdfDocument::Error::IncorrectPassword);
+ QCOMPARE(doc.status(), QPdfDocument::Status::Error);
doc.setPassword(QStringLiteral("Qt"));
- QCOMPARE(passwordChangedSpy.count(), 2);
- QCOMPARE(doc.load(QFINDTESTDATA("pdf-sample.protected.pdf")), QPdfDocument::NoError);
+ QCOMPARE(passwordChangedSpy.size(), 2);
+ QCOMPARE(doc.load(QFINDTESTDATA("pdf-sample.protected.pdf")), QPdfDocument::Error::None);
QCOMPARE(doc.pageCount(), 1);
}
@@ -180,21 +180,25 @@ void tst_QPdfDocument::close()
doc.load(&tempPdf);
- QCOMPARE(statusChangedSpy.count(), 2);
- QCOMPARE(statusChangedSpy[0][0].value<QPdfDocument::Status>(), QPdfDocument::Loading);
- QCOMPARE(statusChangedSpy[1][0].value<QPdfDocument::Status>(), QPdfDocument::Ready);
- QCOMPARE(pageCountChangedSpy.count(), 1);
+ QCOMPARE(statusChangedSpy.size(), 2);
+ QCOMPARE(statusChangedSpy[0][0].value<QPdfDocument::Status>(), QPdfDocument::Status::Loading);
+ QCOMPARE(statusChangedSpy[1][0].value<QPdfDocument::Status>(), QPdfDocument::Status::Ready);
+ QCOMPARE(pageCountChangedSpy.size(), 1);
QCOMPARE(pageCountChangedSpy[0][0].toInt(), doc.pageCount());
statusChangedSpy.clear();
pageCountChangedSpy.clear();
+ consistencyCheck(doc);
+ if (QTest::currentTestFailed())
+ return;
+
doc.close();
- QCOMPARE(statusChangedSpy.count(), 2);
- QCOMPARE(statusChangedSpy[0][0].value<QPdfDocument::Status>(), QPdfDocument::Unloading);
- QCOMPARE(statusChangedSpy[1][0].value<QPdfDocument::Status>(), QPdfDocument::Null);
+ QCOMPARE(statusChangedSpy.size(), 2);
+ QCOMPARE(statusChangedSpy[0][0].value<QPdfDocument::Status>(), QPdfDocument::Status::Unloading);
+ QCOMPARE(statusChangedSpy[1][0].value<QPdfDocument::Status>(), QPdfDocument::Status::Null);
QCOMPARE(doc.pageCount(), 0);
- QCOMPARE(pageCountChangedSpy.count(), 1);
+ QCOMPARE(pageCountChangedSpy.size(), 1);
QCOMPARE(pageCountChangedSpy[0][0].toInt(), doc.pageCount());
}
@@ -207,31 +211,33 @@ void tst_QPdfDocument::loadAfterClose()
QSignalSpy pageCountChangedSpy(&doc, SIGNAL(pageCountChanged(int)));
doc.load(&tempPdf);
- QCOMPARE(statusChangedSpy.count(), 2);
- QCOMPARE(statusChangedSpy[0][0].value<QPdfDocument::Status>(), QPdfDocument::Loading);
- QCOMPARE(statusChangedSpy[1][0].value<QPdfDocument::Status>(), QPdfDocument::Ready);
- QCOMPARE(pageCountChangedSpy.count(), 1);
+ QCOMPARE(statusChangedSpy.size(), 2);
+ QCOMPARE(statusChangedSpy[0][0].value<QPdfDocument::Status>(), QPdfDocument::Status::Loading);
+ QCOMPARE(statusChangedSpy[1][0].value<QPdfDocument::Status>(), QPdfDocument::Status::Ready);
+ QCOMPARE(pageCountChangedSpy.size(), 1);
QCOMPARE(pageCountChangedSpy[0][0].toInt(), doc.pageCount());
statusChangedSpy.clear();
pageCountChangedSpy.clear();
doc.close();
- QCOMPARE(statusChangedSpy.count(), 2);
- QCOMPARE(statusChangedSpy[0][0].value<QPdfDocument::Status>(), QPdfDocument::Unloading);
- QCOMPARE(statusChangedSpy[1][0].value<QPdfDocument::Status>(), QPdfDocument::Null);
- QCOMPARE(pageCountChangedSpy.count(), 1);
+ QCOMPARE(statusChangedSpy.size(), 2);
+ QCOMPARE(statusChangedSpy[0][0].value<QPdfDocument::Status>(), QPdfDocument::Status::Unloading);
+ QCOMPARE(statusChangedSpy[1][0].value<QPdfDocument::Status>(), QPdfDocument::Status::Null);
+ QCOMPARE(pageCountChangedSpy.size(), 1);
QCOMPARE(pageCountChangedSpy[0][0].toInt(), doc.pageCount());
statusChangedSpy.clear();
pageCountChangedSpy.clear();
doc.load(&tempPdf);
- QCOMPARE(statusChangedSpy.count(), 2);
- QCOMPARE(statusChangedSpy[0][0].value<QPdfDocument::Status>(), QPdfDocument::Loading);
- QCOMPARE(statusChangedSpy[1][0].value<QPdfDocument::Status>(), QPdfDocument::Ready);
- QCOMPARE(doc.error(), QPdfDocument::NoError);
+ QCOMPARE(statusChangedSpy.size(), 2);
+ QCOMPARE(statusChangedSpy[0][0].value<QPdfDocument::Status>(), QPdfDocument::Status::Loading);
+ QCOMPARE(statusChangedSpy[1][0].value<QPdfDocument::Status>(), QPdfDocument::Status::Ready);
+ QCOMPARE(doc.error(), QPdfDocument::Error::None);
QCOMPARE(doc.pageCount(), 2);
- QCOMPARE(pageCountChangedSpy.count(), 1);
+ QCOMPARE(pageCountChangedSpy.size(), 1);
QCOMPARE(pageCountChangedSpy[0][0].toInt(), doc.pageCount());
+
+ consistencyCheck(doc);
}
void tst_QPdfDocument::closeOnDestroy()
@@ -249,10 +255,10 @@ void tst_QPdfDocument::closeOnDestroy()
delete doc;
- QCOMPARE(statusChangedSpy.count(), 2);
- QCOMPARE(statusChangedSpy[0][0].value<QPdfDocument::Status>(), QPdfDocument::Unloading);
- QCOMPARE(statusChangedSpy[1][0].value<QPdfDocument::Status>(), QPdfDocument::Null);
- QCOMPARE(pageCountChangedSpy.count(), 1);
+ QCOMPARE(statusChangedSpy.size(), 2);
+ QCOMPARE(statusChangedSpy[0][0].value<QPdfDocument::Status>(), QPdfDocument::Status::Unloading);
+ QCOMPARE(statusChangedSpy[1][0].value<QPdfDocument::Status>(), QPdfDocument::Status::Null);
+ QCOMPARE(pageCountChangedSpy.size(), 1);
QCOMPARE(pageCountChangedSpy[0][0].toInt(), 0);
}
@@ -267,8 +273,8 @@ void tst_QPdfDocument::closeOnDestroy()
delete doc;
- QCOMPARE(statusChangedSpy.count(), 0);
- QCOMPARE(pageCountChangedSpy.count(), 0);
+ QCOMPARE(statusChangedSpy.size(), 0);
+ QCOMPARE(pageCountChangedSpy.size(), 0);
}
}
@@ -277,35 +283,35 @@ void tst_QPdfDocument::status()
TemporaryPdf tempPdf;
QPdfDocument doc;
- QCOMPARE(doc.status(), QPdfDocument::Null);
+ QCOMPARE(doc.status(), QPdfDocument::Status::Null);
QSignalSpy statusChangedSpy(&doc, SIGNAL(statusChanged(QPdfDocument::Status)));
// open existing document
doc.load(&tempPdf);
- QCOMPARE(statusChangedSpy.count(), 2);
- QCOMPARE(statusChangedSpy[0][0].value<QPdfDocument::Status>(), QPdfDocument::Loading);
- QCOMPARE(statusChangedSpy[1][0].value<QPdfDocument::Status>(), QPdfDocument::Ready);
+ QCOMPARE(statusChangedSpy.size(), 2);
+ QCOMPARE(statusChangedSpy[0][0].value<QPdfDocument::Status>(), QPdfDocument::Status::Loading);
+ QCOMPARE(statusChangedSpy[1][0].value<QPdfDocument::Status>(), QPdfDocument::Status::Ready);
statusChangedSpy.clear();
- QCOMPARE(doc.status(), QPdfDocument::Ready);
+ QCOMPARE(doc.status(), QPdfDocument::Status::Ready);
// close document
doc.close();
- QCOMPARE(statusChangedSpy.count(), 2);
- QCOMPARE(statusChangedSpy[0][0].value<QPdfDocument::Status>(), QPdfDocument::Unloading);
- QCOMPARE(statusChangedSpy[1][0].value<QPdfDocument::Status>(), QPdfDocument::Null);
+ QCOMPARE(statusChangedSpy.size(), 2);
+ QCOMPARE(statusChangedSpy[0][0].value<QPdfDocument::Status>(), QPdfDocument::Status::Unloading);
+ QCOMPARE(statusChangedSpy[1][0].value<QPdfDocument::Status>(), QPdfDocument::Status::Null);
statusChangedSpy.clear();
- QCOMPARE(doc.status(), QPdfDocument::Null);
+ QCOMPARE(doc.status(), QPdfDocument::Status::Null);
// try to open non-existing document
doc.load(QFINDTESTDATA("does-not-exist.pdf"));
- QCOMPARE(statusChangedSpy.count(), 2);
- QCOMPARE(statusChangedSpy[0][0].value<QPdfDocument::Status>(), QPdfDocument::Loading);
- QCOMPARE(statusChangedSpy[1][0].value<QPdfDocument::Status>(), QPdfDocument::Error);
- QCOMPARE(doc.status(), QPdfDocument::Error);
+ QCOMPARE(statusChangedSpy.size(), 2);
+ QCOMPARE(statusChangedSpy[0][0].value<QPdfDocument::Status>(), QPdfDocument::Status::Loading);
+ QCOMPARE(statusChangedSpy[1][0].value<QPdfDocument::Status>(), QPdfDocument::Status::Error);
+ QCOMPARE(doc.status(), QPdfDocument::Status::Error);
statusChangedSpy.clear();
// try to open non-existing document asynchronously
@@ -320,15 +326,15 @@ void tst_QPdfDocument::status()
stopWatch.start();
forever {
QCoreApplication::instance()->processEvents();
- if (statusChangedSpy.count() == 2)
+ if (statusChangedSpy.size() == 2)
break;
if (stopWatch.elapsed() >= 30000)
break;
}
- QCOMPARE(statusChangedSpy.count(), 2);
- QCOMPARE(statusChangedSpy[0][0].value<QPdfDocument::Status>(), QPdfDocument::Loading);
- QCOMPARE(statusChangedSpy[1][0].value<QPdfDocument::Status>(), QPdfDocument::Error);
+ QCOMPARE(statusChangedSpy.size(), 2);
+ QCOMPARE(statusChangedSpy[0][0].value<QPdfDocument::Status>(), QPdfDocument::Status::Loading);
+ QCOMPARE(statusChangedSpy[1][0].value<QPdfDocument::Status>(), QPdfDocument::Status::Error);
statusChangedSpy.clear();
}
@@ -340,17 +346,17 @@ void tst_QPdfDocument::passwordClearedOnClose()
QSignalSpy passwordChangedSpy(&doc, SIGNAL(passwordChanged()));
doc.setPassword(QStringLiteral("Qt"));
- QCOMPARE(passwordChangedSpy.count(), 1);
- QCOMPARE(doc.load(QFINDTESTDATA("pdf-sample.protected.pdf")), QPdfDocument::NoError);
+ QCOMPARE(passwordChangedSpy.size(), 1);
+ QCOMPARE(doc.load(QFINDTESTDATA("pdf-sample.protected.pdf")), QPdfDocument::Error::None);
passwordChangedSpy.clear();
doc.close(); // password is cleared on close
- QCOMPARE(passwordChangedSpy.count(), 1);
+ QCOMPARE(passwordChangedSpy.size(), 1);
passwordChangedSpy.clear();
doc.load(&tempPdf);
doc.close(); // signal is not emitted if password didn't change
- QCOMPARE(passwordChangedSpy.count(), 0);
+ QCOMPARE(passwordChangedSpy.size(), 0);
}
void tst_QPdfDocument::metaData()
@@ -358,26 +364,118 @@ void tst_QPdfDocument::metaData()
QPdfDocument doc;
// a closed document does not return any meta data
- QCOMPARE(doc.metaData(QPdfDocument::Title).toString(), QString());
- QCOMPARE(doc.metaData(QPdfDocument::Subject).toString(), QString());
- QCOMPARE(doc.metaData(QPdfDocument::Author).toString(), QString());
- QCOMPARE(doc.metaData(QPdfDocument::Keywords).toString(), QString());
- QCOMPARE(doc.metaData(QPdfDocument::Producer).toString(), QString());
- QCOMPARE(doc.metaData(QPdfDocument::Creator).toString(), QString());
- QCOMPARE(doc.metaData(QPdfDocument::CreationDate).toDateTime(), QDateTime());
- QCOMPARE(doc.metaData(QPdfDocument::ModificationDate).toDateTime(), QDateTime());
+ QCOMPARE(doc.metaData(QPdfDocument::MetaDataField::Title).toString(), QString());
+ QCOMPARE(doc.metaData(QPdfDocument::MetaDataField::Subject).toString(), QString());
+ QCOMPARE(doc.metaData(QPdfDocument::MetaDataField::Author).toString(), QString());
+ QCOMPARE(doc.metaData(QPdfDocument::MetaDataField::Keywords).toString(), QString());
+ QCOMPARE(doc.metaData(QPdfDocument::MetaDataField::Producer).toString(), QString());
+ QCOMPARE(doc.metaData(QPdfDocument::MetaDataField::Creator).toString(), QString());
+ QCOMPARE(doc.metaData(QPdfDocument::MetaDataField::CreationDate).toDateTime(), QDateTime());
+ QCOMPARE(doc.metaData(QPdfDocument::MetaDataField::ModificationDate).toDateTime(), QDateTime());
- QCOMPARE(doc.load(QFINDTESTDATA("pdf-sample.metadata.pdf")), QPdfDocument::NoError);
+ QCOMPARE(doc.load(QFINDTESTDATA("pdf-sample.metadata.pdf")), QPdfDocument::Error::None);
// check for proper meta data from sample document
- QCOMPARE(doc.metaData(QPdfDocument::Title).toString(), QString::fromLatin1("Qt PDF Unit Test Document"));
- QCOMPARE(doc.metaData(QPdfDocument::Subject).toString(), QString::fromLatin1("A test for meta data access"));
- QCOMPARE(doc.metaData(QPdfDocument::Author).toString(), QString::fromLatin1("John Doe"));
- QCOMPARE(doc.metaData(QPdfDocument::Keywords).toString(), QString::fromLatin1("meta data keywords"));
- QCOMPARE(doc.metaData(QPdfDocument::Producer).toString(), QString::fromLatin1("LibreOffice 5.1"));
- QCOMPARE(doc.metaData(QPdfDocument::Creator).toString(), QString::fromLatin1("Writer"));
- QCOMPARE(doc.metaData(QPdfDocument::CreationDate).toDateTime(), QDateTime(QDate(2016, 8, 7), QTime(7, 3, 6), Qt::UTC));
- QCOMPARE(doc.metaData(QPdfDocument::ModificationDate).toDateTime(), QDateTime(QDate(2016, 8, 8), QTime(8, 3, 6), Qt::UTC));
+ QCOMPARE(doc.metaData(QPdfDocument::MetaDataField::Title).toString(), QString::fromLatin1("Qt PDF Unit Test Document"));
+ QCOMPARE(doc.metaData(QPdfDocument::MetaDataField::Subject).toString(), QString::fromLatin1("A test for meta data access"));
+ QCOMPARE(doc.metaData(QPdfDocument::MetaDataField::Author).toString(), QString::fromLatin1("John Doe"));
+ QCOMPARE(doc.metaData(QPdfDocument::MetaDataField::Keywords).toString(), QString::fromLatin1("meta data keywords"));
+ QCOMPARE(doc.metaData(QPdfDocument::MetaDataField::Producer).toString(), QString::fromLatin1("LibreOffice 5.1"));
+ QCOMPARE(doc.metaData(QPdfDocument::MetaDataField::Creator).toString(), QString::fromLatin1("Writer"));
+ QCOMPARE(doc.metaData(QPdfDocument::MetaDataField::CreationDate).toDateTime(),
+ QDateTime(QDate(2016, 8, 7), QTime(7, 3, 6), QTimeZone::UTC));
+ QCOMPARE(doc.metaData(QPdfDocument::MetaDataField::ModificationDate).toDateTime(),
+ QDateTime(QDate(2016, 8, 8), QTime(8, 3, 6), QTimeZone::UTC));
+}
+
+void tst_QPdfDocument::pageLabels()
+{
+ QPdfDocument doc;
+ QCOMPARE(doc.load(QFINDTESTDATA("test.pdf")), QPdfDocument::Error::None);
+ QCOMPARE(doc.pageCount(), 3);
+ QCOMPARE(doc.pageLabel(0), "Qt");
+ QCOMPARE(doc.pageLabel(1), "1");
+ QCOMPARE(doc.pageLabel(2), "i"); // i of the tiger!
+}
+
+void tst_QPdfDocument::getSelection_data()
+{
+ QTest::addColumn<QString>("pdfPath");
+ QTest::addColumn<int>("page");
+ QTest::addColumn<QPointF>("start");
+ QTest::addColumn<QPointF>("end");
+ QTest::addColumn<QString>("expectedText");
+ QTest::addColumn<int>("expectedStartIndex");
+ QTest::addColumn<int>("expectedEndIndex");
+ QTest::addColumn<QRect>("expectedBounds");
+ QTest::addColumn<int>("expectedPolygonCount");
+
+ QTest::newRow("raid") << QFINDTESTDATA("test.pdf")
+ << 1 << QPointF(316.4, 206) << QPointF(339, 201)
+ << "raid" << 80 << 84 << QRect(316, 201, 21, 12) << 1;
+ QTest::newRow("rotated text") << QFINDTESTDATA("rotated_text.pdf")
+ << 0 << QPointF(102, 94) << QPointF(125, 73)
+ << "world!" << 25 << 31 << QRect(98, 70, 26, 28) << 1;
+}
+
+void tst_QPdfDocument::getSelection()
+{
+ QFETCH(QString, pdfPath);
+ QFETCH(int, page);
+ QFETCH(QPointF, start);
+ QFETCH(QPointF, end);
+ QFETCH(QString, expectedText);
+ QFETCH(int, expectedStartIndex);
+ QFETCH(int, expectedEndIndex);
+ QFETCH(QRect, expectedBounds);
+ QFETCH(int, expectedPolygonCount);
+
+ QPdfDocument doc;
+ QCOMPARE(doc.load(pdfPath), QPdfDocument::Error::None);
+
+ QPdfSelection sel = doc.getSelection(page, start, end);
+ QCOMPARE(sel.text(), expectedText);
+ QCOMPARE(sel.startIndex(), expectedStartIndex);
+ QCOMPARE(sel.endIndex(), expectedEndIndex);
+ QCOMPARE(sel.boundingRectangle().toRect(), expectedBounds);
+ QCOMPARE(sel.bounds().size(), expectedPolygonCount);
+}
+
+void tst_QPdfDocument::getSelectionAtIndex_data()
+{
+ QTest::addColumn<QString>("pdfPath");
+ QTest::addColumn<int>("page");
+ QTest::addColumn<int>("start");
+ QTest::addColumn<int>("maxLen");
+ QTest::addColumn<QString>("expectedText");
+ QTest::addColumn<QRect>("expectedBounds");
+ QTest::addColumn<int>("expectedPolygonCount");
+
+ QTest::newRow("raid") << QFINDTESTDATA("test.pdf")
+ << 1 << 80 << 4 << "raid" << QRect(316, 201, 21, 12) << 1;
+ QTest::newRow("rotated text") << QFINDTESTDATA("rotated_text.pdf")
+ << 0 << 7 << 6 << "world!" << QRect(76, 102, 26, 28) << 1;
+ QTest::newRow("displaced text") << QFINDTESTDATA("tagged_mcr_multipage.pdf")
+ << 0 << 0 << 10 << "1" << QRect(34, 22, 3, 8) << 1;
+}
+
+void tst_QPdfDocument::getSelectionAtIndex()
+{
+ QFETCH(QString, pdfPath);
+ QFETCH(int, page);
+ QFETCH(int, start);
+ QFETCH(int, maxLen);
+ QFETCH(QString, expectedText);
+ QFETCH(QRect, expectedBounds);
+ QFETCH(int, expectedPolygonCount);
+
+ QPdfDocument doc;
+ QCOMPARE(doc.load(pdfPath), QPdfDocument::Error::None);
+
+ QPdfSelection sel = doc.getSelectionAtIndex(page, start, maxLen);
+ QCOMPARE(sel.text(), expectedText);
+ QCOMPARE(sel.boundingRectangle().toRect(), expectedBounds);
+ QCOMPARE(sel.bounds().size(), expectedPolygonCount);
}
QTEST_MAIN(tst_QPdfDocument)
diff --git a/tests/auto/pdf/qpdfpagenavigation/qpdfpagenavigation.pro b/tests/auto/pdf/qpdfpagenavigation/qpdfpagenavigation.pro
deleted file mode 100644
index 8de99543f..000000000
--- a/tests/auto/pdf/qpdfpagenavigation/qpdfpagenavigation.pro
+++ /dev/null
@@ -1,5 +0,0 @@
-CONFIG += testcase
-TARGET = tst_qpdfpagenavigation
-QT += pdf testlib network
-macos:CONFIG -= app_bundle
-SOURCES += tst_qpdfpagenavigation.cpp
diff --git a/tests/auto/pdf/qpdfpagenavigation/tst_qpdfpagenavigation.cpp b/tests/auto/pdf/qpdfpagenavigation/tst_qpdfpagenavigation.cpp
deleted file mode 100644
index ff6a02750..000000000
--- a/tests/auto/pdf/qpdfpagenavigation/tst_qpdfpagenavigation.cpp
+++ /dev/null
@@ -1,200 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-#include <QtTest/QtTest>
-
-#include <QPdfDocument>
-#include <QPdfPageNavigation>
-
-class tst_QPdfPageNavigation: public QObject
-{
- Q_OBJECT
-
-private slots:
- void defaultValues();
- void setEmptyDocument();
- void setEmptyDocumentAndLoad();
- void setLoadedDocument();
- void unloadDocument();
- void navigate();
-};
-
-void tst_QPdfPageNavigation::defaultValues()
-{
- QPdfPageNavigation pageNavigation;
-
- QCOMPARE(pageNavigation.document(), nullptr);
- QCOMPARE(pageNavigation.currentPage(), 0);
- QCOMPARE(pageNavigation.pageCount(), 0);
- QCOMPARE(pageNavigation.canGoToPreviousPage(), false);
- QCOMPARE(pageNavigation.canGoToNextPage(), false);
-}
-
-void tst_QPdfPageNavigation::setEmptyDocument()
-{
- QPdfDocument document;
- QPdfPageNavigation pageNavigation;
-
- pageNavigation.setDocument(&document);
-
- QCOMPARE(pageNavigation.document(), &document);
- QCOMPARE(pageNavigation.currentPage(), 0);
- QCOMPARE(pageNavigation.pageCount(), 0);
- QCOMPARE(pageNavigation.canGoToPreviousPage(), false);
- QCOMPARE(pageNavigation.canGoToNextPage(), false);
-}
-
-void tst_QPdfPageNavigation::setEmptyDocumentAndLoad()
-{
- QPdfDocument document;
- QPdfPageNavigation pageNavigation;
-
- pageNavigation.setDocument(&document);
-
- QSignalSpy currentPageChangedSpy(&pageNavigation, &QPdfPageNavigation::currentPageChanged);
- QSignalSpy pageCountChangedSpy(&pageNavigation, &QPdfPageNavigation::pageCountChanged);
- QSignalSpy canGoToPreviousPageChangedSpy(&pageNavigation, &QPdfPageNavigation::canGoToPreviousPageChanged);
- QSignalSpy canGoToNextPageChangedSpy(&pageNavigation, &QPdfPageNavigation::canGoToNextPageChanged);
-
- QCOMPARE(document.load(QFINDTESTDATA("pdf-sample.pagenavigation.pdf")), QPdfDocument::NoError);
-
- QCOMPARE(currentPageChangedSpy.count(), 0); // current page stays '0'
- QCOMPARE(pageCountChangedSpy.count(), 1);
- QCOMPARE(pageCountChangedSpy[0][0].toInt(), 3);
- QCOMPARE(canGoToPreviousPageChangedSpy.count(), 0); // still no previous page available
- QCOMPARE(canGoToNextPageChangedSpy.count(), 1);
- QCOMPARE(canGoToNextPageChangedSpy[0][0].toBool(), true);
-}
-
-void tst_QPdfPageNavigation::setLoadedDocument()
-{
- QPdfDocument document;
- QCOMPARE(document.load(QFINDTESTDATA("pdf-sample.pagenavigation.pdf")), QPdfDocument::NoError);
-
- QPdfPageNavigation pageNavigation;
-
- QSignalSpy currentPageChangedSpy(&pageNavigation, &QPdfPageNavigation::currentPageChanged);
- QSignalSpy pageCountChangedSpy(&pageNavigation, &QPdfPageNavigation::pageCountChanged);
- QSignalSpy canGoToPreviousPageChangedSpy(&pageNavigation, &QPdfPageNavigation::canGoToPreviousPageChanged);
- QSignalSpy canGoToNextPageChangedSpy(&pageNavigation, &QPdfPageNavigation::canGoToNextPageChanged);
-
- pageNavigation.setDocument(&document);
-
- QCOMPARE(currentPageChangedSpy.count(), 0); // current page stays '0'
- QCOMPARE(pageCountChangedSpy.count(), 1);
- QCOMPARE(pageCountChangedSpy[0][0].toInt(), 3);
- QCOMPARE(canGoToPreviousPageChangedSpy.count(), 0); // still no previous page available
- QCOMPARE(canGoToNextPageChangedSpy.count(), 1);
- QCOMPARE(canGoToNextPageChangedSpy[0][0].toBool(), true);
-}
-
-void tst_QPdfPageNavigation::unloadDocument()
-{
- QPdfDocument document;
- QCOMPARE(document.load(QFINDTESTDATA("pdf-sample.pagenavigation.pdf")), QPdfDocument::NoError);
-
- QPdfPageNavigation pageNavigation;
- pageNavigation.setDocument(&document);
-
- QSignalSpy currentPageChangedSpy(&pageNavigation, &QPdfPageNavigation::currentPageChanged);
- QSignalSpy pageCountChangedSpy(&pageNavigation, &QPdfPageNavigation::pageCountChanged);
- QSignalSpy canGoToPreviousPageChangedSpy(&pageNavigation, &QPdfPageNavigation::canGoToPreviousPageChanged);
- QSignalSpy canGoToNextPageChangedSpy(&pageNavigation, &QPdfPageNavigation::canGoToNextPageChanged);
-
- document.close();
-
- QCOMPARE(currentPageChangedSpy.count(), 0); // current page stays '0'
- QCOMPARE(pageCountChangedSpy.count(), 1);
- QCOMPARE(pageCountChangedSpy[0][0].toInt(), 0);
- QCOMPARE(canGoToPreviousPageChangedSpy.count(), 0); // still no previous page available
- QCOMPARE(canGoToNextPageChangedSpy.count(), 1);
- QCOMPARE(canGoToNextPageChangedSpy[0][0].toBool(), false);
-}
-
-void tst_QPdfPageNavigation::navigate()
-{
- QPdfDocument document;
- QCOMPARE(document.load(QFINDTESTDATA("pdf-sample.pagenavigation.pdf")), QPdfDocument::NoError);
-
- QPdfPageNavigation pageNavigation;
- pageNavigation.setDocument(&document);
-
- QSignalSpy currentPageChangedSpy(&pageNavigation, &QPdfPageNavigation::currentPageChanged);
- QSignalSpy canGoToPreviousPageChangedSpy(&pageNavigation, &QPdfPageNavigation::canGoToPreviousPageChanged);
- QSignalSpy canGoToNextPageChangedSpy(&pageNavigation, &QPdfPageNavigation::canGoToNextPageChanged);
-
- QCOMPARE(pageNavigation.currentPage(), 0);
-
- // try to go to previous page while there is none
- QCOMPARE(pageNavigation.canGoToPreviousPage(), false);
- pageNavigation.goToPreviousPage();
- QCOMPARE(canGoToPreviousPageChangedSpy.count(), 0);
- QCOMPARE(pageNavigation.currentPage(), 0);
- QCOMPARE(pageNavigation.canGoToPreviousPage(), false);
-
- // try to go to next page
- QCOMPARE(pageNavigation.canGoToNextPage(), true);
- pageNavigation.goToNextPage();
- QCOMPARE(canGoToPreviousPageChangedSpy.count(), 1);
- QCOMPARE(canGoToNextPageChangedSpy.count(), 0);
- QCOMPARE(currentPageChangedSpy.count(), 1);
- QCOMPARE(pageNavigation.currentPage(), 1);
- QCOMPARE(pageNavigation.canGoToPreviousPage(), true);
-
- currentPageChangedSpy.clear();
- canGoToPreviousPageChangedSpy.clear();
- canGoToNextPageChangedSpy.clear();
-
- // try to go to last page
- pageNavigation.setCurrentPage(2);
- QCOMPARE(canGoToPreviousPageChangedSpy.count(), 0);
- QCOMPARE(canGoToNextPageChangedSpy.count(), 1);
- QCOMPARE(currentPageChangedSpy.count(), 1);
- QCOMPARE(pageNavigation.currentPage(), 2);
- QCOMPARE(pageNavigation.canGoToNextPage(), false);
-
- // check that invalid requests are ignored
- pageNavigation.setCurrentPage(-1);
- QCOMPARE(pageNavigation.currentPage(), 2);
-
- pageNavigation.setCurrentPage(3);
- QCOMPARE(pageNavigation.currentPage(), 2);
-}
-
-QTEST_MAIN(tst_QPdfPageNavigation)
-
-#include "tst_qpdfpagenavigation.moc"
diff --git a/tests/auto/pdf/qpdfpagenavigator/CMakeLists.txt b/tests/auto/pdf/qpdfpagenavigator/CMakeLists.txt
new file mode 100644
index 000000000..3e8b8f416
--- /dev/null
+++ b/tests/auto/pdf/qpdfpagenavigator/CMakeLists.txt
@@ -0,0 +1,14 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_test(tst_qpdfpagenavigator.cpp
+ SOURCES
+ tst_qpdfpagenavigator.cpp
+ LIBRARIES
+ Qt::Gui
+ Qt::Network
+ Qt::Pdf
+ Qt::PdfWidgets
+ TESTDATA
+ pdf-sample.bookmarks_pages.pdf
+)
diff --git a/tests/auto/pdf/qpdfpagenavigation/pdf-sample.pagenavigation.pdf b/tests/auto/pdf/qpdfpagenavigator/pdf-sample.bookmarks_pages.pdf
index c4e1aa36e..c4e1aa36e 100644
--- a/tests/auto/pdf/qpdfpagenavigation/pdf-sample.pagenavigation.pdf
+++ b/tests/auto/pdf/qpdfpagenavigator/pdf-sample.bookmarks_pages.pdf
Binary files differ
diff --git a/tests/auto/pdf/qpdfpagenavigator/tst_qpdfpagenavigator.cpp b/tests/auto/pdf/qpdfpagenavigator/tst_qpdfpagenavigator.cpp
new file mode 100644
index 000000000..327a9f36a
--- /dev/null
+++ b/tests/auto/pdf/qpdfpagenavigator/tst_qpdfpagenavigator.cpp
@@ -0,0 +1,70 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+
+#include <QtTest/QtTest>
+
+#include <QPdfDocument>
+#include <QPdfView>
+#include <QPdfPageNavigator>
+
+class tst_QPdfPageNavigator: public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void offScreenSignals();
+};
+
+void tst_QPdfPageNavigator::offScreenSignals()
+{
+ QPdfDocument document;
+ QPdfView pdfView;
+ QPdfPageNavigator *navigator = pdfView.pageNavigator();
+
+ QSignalSpy currentPageChanged(navigator, &QPdfPageNavigator::currentPageChanged);
+ QSignalSpy currentLocationChanged(navigator, &QPdfPageNavigator::currentLocationChanged);
+ QSignalSpy backAvailableChanged(navigator, &QPdfPageNavigator::backAvailableChanged);
+ QSignalSpy forwardAvailableChanged(navigator, &QPdfPageNavigator::forwardAvailableChanged);
+ QSignalSpy jumped(navigator, &QPdfPageNavigator::jumped);
+
+ QCOMPARE(document.load(QFINDTESTDATA("pdf-sample.bookmarks_pages.pdf")), QPdfDocument::Error::None);
+ QVERIFY2(document.pageCount() == 3, "Test document has changed! 3 pages expected.");
+ pdfView.setDocument(&document);
+
+ // Start with a clean history
+ QCOMPARE(forwardAvailableChanged.count(), 0);
+ QCOMPARE(backAvailableChanged.count(), 0);
+
+ navigator->jump(3, QPoint());
+ QCOMPARE(forwardAvailableChanged.count(), 0);
+ QCOMPARE(backAvailableChanged.count(), 1);
+ QCOMPARE(currentPageChanged.count(), 1);
+ QCOMPARE(currentLocationChanged.count(), 0);
+ QCOMPARE(jumped.count(), 1);
+
+ navigator->jump(1, QPoint());
+ QCOMPARE(forwardAvailableChanged.count(), 0);
+ QCOMPARE(backAvailableChanged.count(), 1);
+ QCOMPARE(currentPageChanged.count(), 2);
+ QCOMPARE(currentLocationChanged.count(), 0);
+ QCOMPARE(jumped.count(), 2);
+
+ navigator->back();
+ QCOMPARE(forwardAvailableChanged.count(), 1);
+ QCOMPARE(backAvailableChanged.count(), 1);
+ QCOMPARE(currentPageChanged.count(), 3);
+ QCOMPARE(currentLocationChanged.count(), 0);
+ QCOMPARE(jumped.count(), 3);
+
+ navigator->forward();
+ QCOMPARE(forwardAvailableChanged.count(), 2);
+ QCOMPARE(backAvailableChanged.count(), 1);
+ QCOMPARE(currentPageChanged.count(), 4);
+ QCOMPARE(currentLocationChanged.count(), 0);
+ QCOMPARE(jumped.count(), 4);
+}
+
+QTEST_MAIN(tst_QPdfPageNavigator)
+
+#include "tst_qpdfpagenavigator.moc"
diff --git a/tests/auto/pdf/qpdfpagerenderer/CMakeLists.txt b/tests/auto/pdf/qpdfpagerenderer/CMakeLists.txt
new file mode 100644
index 000000000..53a68fe59
--- /dev/null
+++ b/tests/auto/pdf/qpdfpagerenderer/CMakeLists.txt
@@ -0,0 +1,14 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_test(tst_qpdfpagerenderer
+ SOURCES
+ tst_qpdfpagerenderer.cpp
+ LIBRARIES
+ Qt::Gui
+ Qt::Network
+ Qt::Pdf
+ TESTDATA
+ pdf-sample.pagerenderer.pdf
+)
+
diff --git a/tests/auto/pdf/qpdfpagerenderer/qpdfpagerenderer.pro b/tests/auto/pdf/qpdfpagerenderer/qpdfpagerenderer.pro
deleted file mode 100644
index 9ccb4e82c..000000000
--- a/tests/auto/pdf/qpdfpagerenderer/qpdfpagerenderer.pro
+++ /dev/null
@@ -1,5 +0,0 @@
-CONFIG += testcase
-TARGET = tst_qpdfpagerenderer
-QT += pdf testlib network
-macos:CONFIG -= app_bundle
-SOURCES += tst_qpdfpagerenderer.cpp
diff --git a/tests/auto/pdf/qpdfpagerenderer/tst_qpdfpagerenderer.cpp b/tests/auto/pdf/qpdfpagerenderer/tst_qpdfpagerenderer.cpp
index 534fbd9ce..39d32df0b 100644
--- a/tests/auto/pdf/qpdfpagerenderer/tst_qpdfpagerenderer.cpp
+++ b/tests/auto/pdf/qpdfpagerenderer/tst_qpdfpagerenderer.cpp
@@ -1,38 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias König <tobias.koenig@kdab.com>
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias König <tobias.koenig@kdab.com>
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include <QPdfDocument>
#include <QPdfPageRenderer>
@@ -89,7 +56,7 @@ void tst_QPdfPageRenderer::withLoadedDocumentSingleThreaded()
QPdfPageRenderer pageRenderer;
pageRenderer.setDocument(&document);
- QCOMPARE(document.load(QFINDTESTDATA("pdf-sample.pagerenderer.pdf")), QPdfDocument::NoError);
+ QCOMPARE(document.load(QFINDTESTDATA("pdf-sample.pagerenderer.pdf")), QPdfDocument::Error::None);
QSignalSpy pageRenderedSpy(&pageRenderer, &QPdfPageRenderer::pageRendered);
@@ -97,7 +64,7 @@ void tst_QPdfPageRenderer::withLoadedDocumentSingleThreaded()
const quint64 requestId = pageRenderer.requestPage(0, imageSize);
QCOMPARE(requestId, quint64(1));
- QTRY_COMPARE(pageRenderedSpy.count(), 1);
+ QTRY_COMPARE(pageRenderedSpy.size(), 1);
QCOMPARE(pageRenderedSpy[0][0].toInt(), 0);
QCOMPARE(pageRenderedSpy[0][1].toSize(), imageSize);
QCOMPARE(pageRenderedSpy[0][2].value<QImage>().size(), imageSize);
@@ -112,7 +79,7 @@ void tst_QPdfPageRenderer::withLoadedDocumentMultiThreaded()
pageRenderer.setDocument(&document);
pageRenderer.setRenderMode(QPdfPageRenderer::RenderMode::MultiThreaded);
- QCOMPARE(document.load(QFINDTESTDATA("pdf-sample.pagerenderer.pdf")), QPdfDocument::NoError);
+ QCOMPARE(document.load(QFINDTESTDATA("pdf-sample.pagerenderer.pdf")), QPdfDocument::Error::None);
QSignalSpy pageRenderedSpy(&pageRenderer, &QPdfPageRenderer::pageRendered);
@@ -120,7 +87,7 @@ void tst_QPdfPageRenderer::withLoadedDocumentMultiThreaded()
const quint64 requestId = pageRenderer.requestPage(0, imageSize);
QCOMPARE(requestId, quint64(1));
- QTRY_COMPARE(pageRenderedSpy.count(), 1);
+ QTRY_COMPARE(pageRenderedSpy.size(), 1);
QCOMPARE(pageRenderedSpy[0][0].toInt(), 0);
QCOMPARE(pageRenderedSpy[0][1].toSize(), imageSize);
QCOMPARE(pageRenderedSpy[0][2].value<QImage>().size(), imageSize);
@@ -133,7 +100,7 @@ void tst_QPdfPageRenderer::switchingRenderMode()
QPdfPageRenderer pageRenderer;
pageRenderer.setDocument(&document);
- QCOMPARE(document.load(QFINDTESTDATA("pdf-sample.pagerenderer.pdf")), QPdfDocument::NoError);
+ QCOMPARE(document.load(QFINDTESTDATA("pdf-sample.pagerenderer.pdf")), QPdfDocument::Error::None);
QSignalSpy pageRenderedSpy(&pageRenderer, &QPdfPageRenderer::pageRendered);
@@ -141,7 +108,7 @@ void tst_QPdfPageRenderer::switchingRenderMode()
const QSize imageSize(100, 100);
const quint64 firstRequestId = pageRenderer.requestPage(0, imageSize);
- QTRY_COMPARE(pageRenderedSpy.count(), 1);
+ QTRY_COMPARE(pageRenderedSpy.size(), 1);
QCOMPARE(pageRenderedSpy[0][0].toInt(), 0);
QCOMPARE(pageRenderedSpy[0][1].toSize(), imageSize);
QCOMPARE(pageRenderedSpy[0][2].value<QImage>().size(), imageSize);
@@ -157,7 +124,7 @@ void tst_QPdfPageRenderer::switchingRenderMode()
const quint64 secondRequestId = pageRenderer.requestPage(0, imageSize);
QVERIFY(firstRequestId != secondRequestId);
- QTRY_COMPARE(pageRenderedSpy.count(), 1);
+ QTRY_COMPARE(pageRenderedSpy.size(), 1);
QCOMPARE(pageRenderedSpy[0][0].toInt(), 0);
QCOMPARE(pageRenderedSpy[0][1].toSize(), imageSize);
QCOMPARE(pageRenderedSpy[0][2].value<QImage>(), image);
@@ -171,7 +138,7 @@ void tst_QPdfPageRenderer::switchingRenderMode()
const quint64 thirdRequestId = pageRenderer.requestPage(0, imageSize);
- QTRY_COMPARE(pageRenderedSpy.count(), 1);
+ QTRY_COMPARE(pageRenderedSpy.size(), 1);
QCOMPARE(pageRenderedSpy[0][0].toInt(), 0);
QCOMPARE(pageRenderedSpy[0][1].toSize(), imageSize);
QCOMPARE(pageRenderedSpy[0][2].value<QImage>(), image);
diff --git a/tests/auto/pdf/qpdfsearchmodel/CMakeLists.txt b/tests/auto/pdf/qpdfsearchmodel/CMakeLists.txt
new file mode 100644
index 000000000..668d1ea36
--- /dev/null
+++ b/tests/auto/pdf/qpdfsearchmodel/CMakeLists.txt
@@ -0,0 +1,15 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_test(tst_qpdfsearchmodel
+ SOURCES
+ tst_qpdfsearchmodel.cpp
+ LIBRARIES
+ Qt::Gui
+ Qt::Network
+ Qt::Pdf
+ TESTDATA
+ rotated_text.pdf
+ tagged_mcr_multipage.pdf
+ test.pdf
+)
diff --git a/tests/auto/pdf/qpdfsearchmodel/qpdfsearchmodel.pro b/tests/auto/pdf/qpdfsearchmodel/qpdfsearchmodel.pro
deleted file mode 100644
index 205fef175..000000000
--- a/tests/auto/pdf/qpdfsearchmodel/qpdfsearchmodel.pro
+++ /dev/null
@@ -1,5 +0,0 @@
-CONFIG += testcase
-TARGET = tst_qpdfsearchmodel
-QT += pdf testlib network
-macos:CONFIG -= app_bundle
-SOURCES += tst_qpdfsearchmodel.cpp
diff --git a/tests/auto/pdf/qpdfsearchmodel/rotated_text.pdf b/tests/auto/pdf/qpdfsearchmodel/rotated_text.pdf
new file mode 100644
index 000000000..d6d8db84e
--- /dev/null
+++ b/tests/auto/pdf/qpdfsearchmodel/rotated_text.pdf
@@ -0,0 +1,70 @@
+%PDF-1.7
+% ò¤ô
+1 0 obj <<
+ /Type /Catalog
+ /Pages 2 0 R
+>>
+endobj
+2 0 obj <<
+ /Type /Pages
+ /MediaBox [ 0 0 200 200 ]
+ /Count 1
+ /Kids [ 3 0 R ]
+>>
+endobj
+3 0 obj <<
+ /Type /Page
+ /Parent 2 0 R
+ /Resources <<
+ /Font <<
+ /F1 4 0 R
+ >>
+ >>
+ /Contents 5 0 R
+>>
+endobj
+4 0 obj <<
+ /Type /Font
+ /Subtype /Type1
+ /BaseFont /Times-Roman
+>>
+endobj
+5 0 obj <<
+ /Length 406
+>>
+stream
+BT
+0 0 Td
+/F1 12 Tf
+0.70710678118 -0.70710678118 0.70710678118 0.70710678118 100 100 Tm
+(Hello,) Tj
+0 0 Td
+/F1 12 Tf
+-0.70710678118 -0.70710678118 0.70710678118 -0.70710678118 100 100 Tm
+( world!\r\n) Tj
+0 0 Td
+/F1 12 Tf
+-0.70710678118 0.70710678118 -0.70710678118 -0.70710678118 100 100 Tm
+(Goodbye,) Tj
+0 0 Td
+/F1 12 Tf
+0.70710678118 0.70710678118 -0.70710678118 0.70710678118 100 100 Tm
+( world!) Tj
+ET
+endstream
+endobj
+xref
+0 6
+0000000000 65535 f
+0000000015 00000 n
+0000000068 00000 n
+0000000161 00000 n
+0000000287 00000 n
+0000000365 00000 n
+trailer <<
+ /Root 1 0 R
+ /Size 6
+>>
+startxref
+823
+%%EOF
diff --git a/tests/auto/pdf/qpdfsearchmodel/tagged_mcr_multipage.pdf b/tests/auto/pdf/qpdfsearchmodel/tagged_mcr_multipage.pdf
new file mode 100644
index 000000000..fcc5fafda
--- /dev/null
+++ b/tests/auto/pdf/qpdfsearchmodel/tagged_mcr_multipage.pdf
@@ -0,0 +1,136 @@
+%PDF-1.7
+% ò¤ô
+1 0 obj <<
+ /Type /Catalog
+ /MarkInfo <<
+ /Type /MarkInfo
+ /Marked true
+ >>
+ /Pages 2 0 R
+ /StructTreeRoot 8 0 R
+>>
+endobj
+2 0 obj <<
+ /Type /Pages
+ /CropBox [ 10.8197 8.459 605.705 801.639 ]
+ /MediaBox [ 0.0 0.0 616.721 809.902 ]
+ /Count 2
+ /Kids [
+ 4 0 R
+ 6 0 R
+ ]
+>>
+endobj
+3 0 obj <<
+ /Type /Font
+ /Subtype /Type1
+ /BaseFont /Times-Roman
+>>
+endobj
+4 0 obj <<
+ /Type /Page
+ /Tabs /S
+ /Parent 2 0 R
+ /StructParents 0
+ /Contents 5 0 R
+ /Resources <<
+ /ProcSet [/PDF /Text]
+ /Font <<
+ /F1 3 0 R
+ >>
+ >>
+>>
+endobj
+5 0 obj <<
+ /Length 83
+>>
+stream
+BT
+/Document <</MCID 0 >>BDC
+0 i
+/F1 1 Tf
+12 0 0 12 43.073 771.625 Tm
+(1)Tj
+EMC
+ET
+endstream
+endobj
+6 0 obj <<
+ /Type /Page
+ /Tabs /S
+ /Parent 2 0 R
+ /StructParents 1
+ /Contents 7 0 R
+ /Resources <<
+ /ProcSet [/PDF /Text]
+ /Font <<
+ /F1 3 0 R
+ >>
+ >>
+>>
+endobj
+7 0 obj <<
+ /Length 83
+>>
+stream
+BT
+/Document <</MCID 0 >>BDC
+0 i
+/F1 1 Tf
+12 0 0 12 43.073 771.625 Tm
+(2)Tj
+EMC
+ET
+endstream
+endobj
+8 0 obj <<
+ /Type /StructTreeRoot
+ /K 10 0 R
+ /ParentTree 9 0 R
+ /ParentTreeNextKey 2
+>>
+endobj
+9 0 obj <<
+ /Nums [
+ 0
+ [10 0 R]
+ 1
+ [10 0 R]
+ ]
+>>
+endobj
+10 0 obj <<
+ /T ()
+ /S /Document
+ /P 8 0 R
+ /Pg 4 0 R
+ /K [
+ 0
+ <<
+ /MCID 0
+ /Pg 6 0 R
+ /Type /MCR
+ >>
+ ]
+>>
+%endobj
+xref
+0 11
+0000000000 65535 f
+0000000015 00000 n
+0000000149 00000 n
+0000000315 00000 n
+0000000393 00000 n
+0000000575 00000 n
+0000000709 00000 n
+0000000891 00000 n
+0000001025 00000 n
+0000001125 00000 n
+0000001198 00000 n
+trailer <<
+ /Root 1 0 R
+ /Size 11
+>>
+startxref
+1345
+%%EOF
diff --git a/tests/auto/pdf/qpdfsearchmodel/test.pdf b/tests/auto/pdf/qpdfsearchmodel/test.pdf
index a9dc1bc29..0832dfbed 100644
--- a/tests/auto/pdf/qpdfsearchmodel/test.pdf
+++ b/tests/auto/pdf/qpdfsearchmodel/test.pdf
Binary files differ
diff --git a/tests/auto/pdf/qpdfsearchmodel/tst_qpdfsearchmodel.cpp b/tests/auto/pdf/qpdfsearchmodel/tst_qpdfsearchmodel.cpp
index e690bfc11..cf71b148e 100644
--- a/tests/auto/pdf/qpdfsearchmodel/tst_qpdfsearchmodel.cpp
+++ b/tests/auto/pdf/qpdfsearchmodel/tst_qpdfsearchmodel.cpp
@@ -1,38 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include <QtTest/QtTest>
@@ -40,6 +7,8 @@
#include <QPdfDocument>
#include <QPdfSearchModel>
+Q_LOGGING_CATEGORY(lcTests, "qt.pdf.tests")
+
class tst_QPdfSearchModel: public QObject
{
Q_OBJECT
@@ -48,20 +17,51 @@ public:
tst_QPdfSearchModel() {}
private slots:
+ void findText_data();
void findText();
};
+void tst_QPdfSearchModel::findText_data()
+{
+ QTest::addColumn<QString>("pdfPath");
+ QTest::addColumn<QString>("searchString");
+ QTest::addColumn<int>("expectedMatchCount");
+ QTest::addColumn<int>("matchIndexToCheck");
+ QTest::addColumn<int>("expectedRectangleCount");
+ QTest::addColumn<int>("rectIndexToCheck");
+ QTest::addColumn<QRect>("expectedMatchBounds");
+
+ QTest::newRow("the search for ai") << QFINDTESTDATA("test.pdf")
+ << "ai" << 3 << 0 << 1 << 0 << QRect(321, 202, 9, 11);
+ QTest::newRow("rotated text") << QFINDTESTDATA("rotated_text.pdf")
+ << "world!" << 2 << 0 << 1 << 0 << QRect(76, 102, 26, 28);
+ QTest::newRow("displaced text") << QFINDTESTDATA("tagged_mcr_multipage.pdf")
+ << "1" << 1 << 0 << 1 << 0 << QRect(34, 22, 3, 8);
+}
+
void tst_QPdfSearchModel::findText()
{
+ QFETCH(QString, pdfPath);
+ QFETCH(QString, searchString);
+ QFETCH(int, expectedMatchCount);
+ QFETCH(int, matchIndexToCheck);
+ QFETCH(int, expectedRectangleCount);
+ QFETCH(int, rectIndexToCheck);
+ QFETCH(QRect, expectedMatchBounds);
+
QPdfDocument document;
- QCOMPARE(document.load(QFINDTESTDATA("test.pdf")), QPdfDocument::NoError);
+ QCOMPARE(document.load(pdfPath), QPdfDocument::Error::None);
QPdfSearchModel model;
model.setDocument(&document);
- QVector<QRectF> matches = model.matches(1, "ai");
+ model.setSearchString(searchString);
- qDebug() << matches;
- QCOMPARE(matches.count(), 3);
+ QTRY_COMPARE(model.count(), expectedMatchCount); // wait for the timer
+ QPdfLink match = model.resultAtIndex(matchIndexToCheck);
+ qCDebug(lcTests) << match;
+ QList<QRectF> rects = match.rectangles();
+ QCOMPARE(rects.size(), expectedRectangleCount);
+ QCOMPARE(rects.at(rectIndexToCheck).toRect(), expectedMatchBounds);
}
QTEST_MAIN(tst_QPdfSearchModel)
diff --git a/tests/auto/pdfquick/CMakeLists.txt b/tests/auto/pdfquick/CMakeLists.txt
new file mode 100644
index 000000000..e6a3a460c
--- /dev/null
+++ b/tests/auto/pdfquick/CMakeLists.txt
@@ -0,0 +1,2 @@
+add_subdirectory(multipageview)
+add_subdirectory(pdfpageimage)
diff --git a/tests/auto/pdfquick/multipageview/BLACKLIST b/tests/auto/pdfquick/multipageview/BLACKLIST
new file mode 100644
index 000000000..9012902f6
--- /dev/null
+++ b/tests/auto/pdfquick/multipageview/BLACKLIST
@@ -0,0 +1,7 @@
+# QTBUG-111306
+[navigation:click links and go back, twice]
+android
+
+# QTBUG-111306
+[navigation:click two links in series and then go back]
+android
diff --git a/tests/auto/pdfquick/multipageview/CMakeLists.txt b/tests/auto/pdfquick/multipageview/CMakeLists.txt
new file mode 100644
index 000000000..50f7d7d8f
--- /dev/null
+++ b/tests/auto/pdfquick/multipageview/CMakeLists.txt
@@ -0,0 +1,30 @@
+# Collect test data
+file(GLOB_RECURSE test_data_glob
+ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
+ data/*)
+list(APPEND test_data ${test_data_glob})
+
+qt_internal_add_test(tst_multipageview
+ SOURCES
+ tst_multipageview.cpp
+ ../shared/util.cpp ../shared/util.h
+ LIBRARIES
+ Qt::Gui
+ Qt::Quick
+ Qt::PdfQuickPrivate
+ TESTDATA ${test_data}
+)
+
+## Scopes:
+#####################################################################
+
+qt_internal_extend_target(tst_multipageview CONDITION ANDROID OR IOS
+ DEFINES
+ QT_QMLTEST_DATADIR=":/data"
+)
+
+qt_internal_extend_target(tst_multipageview CONDITION NOT ANDROID AND NOT IOS
+ DEFINES
+ QT_QMLTEST_DATADIR="${CMAKE_CURRENT_SOURCE_DIR}/data"
+)
+
diff --git a/tests/auto/pdfquick/multipageview/data/bookmarksAndLinks.pdf b/tests/auto/pdfquick/multipageview/data/bookmarksAndLinks.pdf
new file mode 100644
index 000000000..aa0b99039
--- /dev/null
+++ b/tests/auto/pdfquick/multipageview/data/bookmarksAndLinks.pdf
@@ -0,0 +1,317 @@
+%PDF-1.7
+
+1 0 obj
+<<
+ /Type /Catalog
+ /PageMode /FullScreen
+ /Outlines 6 0 R
+ /Pages 2 0 R
+ /Names 50 0 R
+ /PageLabels 23 0 R
+ /ViewerPreferences<</NonFullScreenPageMode (UseThumbs)>>
+>>
+endobj
+
+50 0 obj
+<<
+ /Dests <</Names [ (ToTest2) [4 0 R /XYZ 300 300 1] (ToTest3) [5 0 R /XYZ 290 10 0.5] (ToTest1) [3 0 R /XYZ 600 800 1] ]>>
+>>
+endobj
+
+23 0 obj
+<<
+ /Nums [0 <</S /D /P(test )>> 3 <</S /A >> 4<</S /R/St >> 5<</S /r/St >> ]
+ /Limits [0 5]
+>>
+endobj
+
+2 0 obj
+<<
+ /Type /Pages
+ /Kids [3 0 R 4 0 R 5 0 R]
+ /Count 3
+>>
+endobj
+
+3 0 obj
+<<
+ /Type /Page
+ /Parent 2 0 R
+ /MediaBox [0 10 600 800]
+ /Annots [24 0 R 25 0 R]
+ /Contents 16 0 R
+ /Resources <<
+ /Font <</F1 18 0 R>>
+ >>
+>>
+endobj
+
+24 0 obj
+<<
+ /Subtype /Link
+ /Border [0 0 0]
+ /Dest (ToTest2)
+ /A << /Type /Action
+ /S /GoTo
+ /D [5 0 R /FitR ¨C4 399 199 533]
+ >>
+ /Rect [10 690 150 720]
+
+>>
+endobj
+
+25 0 obj
+<<
+ /Subtype /Link
+ /Border [0 0 0]
+ /Dest (ToTest3)
+ /Rect [10 630 150 650]
+>>
+endobj
+
+
+16 0 obj
+<< /Length 0 >>
+ stream
+ BT
+ /F1 72 Tf
+ 200 200 TD
+ 0 0 1 RG
+ 5 Tr
+ (Test_1) Tj
+ 0 800 m
+ 600 0 l S
+ /F1 30 Tf
+ 0 1 0 RG
+ 1 Tr
+ -190 490 TD
+ (GO Test_2) Tj
+ 0 -50 TD
+ 5 w
+ 2 Tr
+ 1 0 0 RG
+ (GO Test_3) Tj
+ ET
+ endstream
+endobj
+
+
+endobj
+
+18 0 obj
+<<
+ /Type /Font
+ /Subtype /Type1
+ /Name /F1
+ /BaseFont /Helvetica
+>>
+endobj
+
+4 0 obj
+<<
+ /Type /Page
+ /Parent 2 0 R
+ /MediaBox [10 0 500 700]
+ /Annots [60 0 R]
+ /Contents 19 0 R
+ /Resources <<
+ /Font <</F2 20 0 R>>
+ >>
+>>
+endobj
+
+19 0 obj
+<< /Length 0 >>
+stream
+BT
+ 1 -0.7 0 1 30 100 cm
+ /F2 50 Tf
+ 10 50 TD
+ (TEST_2) Tj
+
+ 1 0.7 0 1 -30 -100 cm
+ /F2 25 Tf
+ 1 0 1 RG
+ 7 w
+ 100 60 TD
+
+ (GO Test_1) Tj
+ 100 100 140 40 re S f
+ET
+endstream
+endobj
+
+20 0 obj
+<<
+ /Type /Font
+ /Subtype /TrueType
+ /Name /F2
+ /BaseFont /NewYork , Bold
+ /FirstChar 0
+ /LastChar 255
+ /Widths 23 0 R
+ /FontDescriptor 7 0 R
+ /Encoding /MacRomanEncoding
+>>
+endobj
+
+60 0 obj
+<<
+ /Subtype /Link
+ /Border [0 0 0]
+ /Dest (ToTest1)
+ /Rect [110 110 230 150]
+>>
+endobj
+
+5 0 obj
+<<
+ /Type /Page
+ /Parent 2 0 R
+ /MediaBox [-10 -10 400 600]
+ /Annots [61 0 R]
+ /Contents 21 0 R
+ /Resources << /Font <</F3 22 0 R>> >>
+>>
+endobj
+
+21 0 obj
+<< /Length 0 >>
+stream
+BT
+ /F3 30 Tf
+ 290 10 TD
+ (TEST_3) Tj
+ -50 90 TD
+ (GO Test_2)Tj
+ET
+endstream
+endobj
+
+22 0 obj
+<<
+ /Type /Font
+ /Subtype /Type1
+ /Name /F3
+ /BaseFont /Courier-Bold
+>>
+endobj
+
+61 0 obj
+<<
+ /Subtype /Link
+ /Border [0 0 0]
+ /Dest (ToTest2)
+ /Rect [240 90 400 130]
+>>
+
+6 0 obj
+<<
+ /Type /Outlines
+ /First 7 0 R
+ /Last 11 0 R
+ /Count 4 0 R
+>>
+endobj
+
+7 0 obj
+<<
+ /Title (First)
+ /Parent 6 0 R
+ /Next 8 0 R
+ /C [1 0 0]
+ /Dest [ 3 0 R /XYZ 600 800 0.5 ]
+>>
+endobj
+
+8 0 obj
+<<
+ /Title (Second)
+ /Parent 6 0 R
+ /Prev 7 0 R
+ /Next 9 0 R
+ /C [0 1 0]
+ % /Dest [ 4 0 R /XYZ 500 700 null ]
+/Dest (ToTest2)
+>>
+endobj
+
+9 0 obj
+<<
+ /Title (Third)
+ /Parent 6 0 R
+ /Prev 8 0 R
+ /Next 10 0 R
+ /C [0 0 1]
+ /Dest [ 5 0 R /XYZ 400 600 0.8 ]
+>>
+endobj
+
+10 0 obj
+<<
+ /Title (Fourth)
+ /Parent 6 0 R
+ /Prev 9 0 R
+ /Next 11 0 R
+>>
+endobj
+
+11 0 obj
+<<
+ /Title (Fivth)
+ /Parent 6 0 R
+ /Prev 10 0 R
+ /First 12 0 R
+ /Last 15 0 R
+ /Count 4
+>>
+endobj
+
+12 0 obj
+<<
+ /Title (Fivth_1)
+ /Parent 11 0 R
+ /Next 13 0 R
+>>
+endobj
+
+13 0 obj
+<<
+ /Title (Fivth_2)
+ /Parent 11 0 R
+ /Prev 12 0 R
+ /Next 14 0 R
+>>
+endobj
+
+14 0 obj
+<<
+ /Title (Fivth_3)
+ /Parent 11 0 R
+ /Prev 13 0 R
+ /Next 15 0 R
+>>
+endobj
+
+15 0 obj
+<<
+ /Title (Fivth_4)
+ /Parent 11 0 R
+ /Prev 14 0 R
+>>
+endobj
+
+
+
+
+xref
+0000000000 65536 f
+
+trailer
+<<
+ /Size 0
+ /Root 1 0 R
+>>
+startxref
+0
+%%EOF
diff --git a/tests/auto/pdfquick/multipageview/data/jumpOnDocumentReady.qml b/tests/auto/pdfquick/multipageview/data/jumpOnDocumentReady.qml
new file mode 100644
index 000000000..ce74f5ed8
--- /dev/null
+++ b/tests/auto/pdfquick/multipageview/data/jumpOnDocumentReady.qml
@@ -0,0 +1,18 @@
+import QtQuick
+import QtQuick.Pdf
+
+PdfMultiPageView {
+ id: view
+ width: 480
+ height: 480
+
+ document: PdfDocument {
+ id: document
+ onStatusChanged: {
+ if(status === PdfDocument.Ready)
+ view.goToPage(2)
+ }
+ }
+
+ Component.onCompleted: document.source = "bookmarksAndLinks.pdf"
+}
diff --git a/tests/auto/pdfquick/multipageview/data/multiPageView.qml b/tests/auto/pdfquick/multipageview/data/multiPageView.qml
new file mode 100644
index 000000000..bf88180ce
--- /dev/null
+++ b/tests/auto/pdfquick/multipageview/data/multiPageView.qml
@@ -0,0 +1,8 @@
+import QtQuick
+import QtQuick.Pdf
+
+PdfMultiPageView {
+ width: 480; height: 480
+ property alias source: document.source
+ document: PdfDocument { id: document }
+}
diff --git a/tests/auto/pdfquick/multipageview/data/multiPageViewWithFeedback.qml b/tests/auto/pdfquick/multipageview/data/multiPageViewWithFeedback.qml
new file mode 100644
index 000000000..93a556c97
--- /dev/null
+++ b/tests/auto/pdfquick/multipageview/data/multiPageViewWithFeedback.qml
@@ -0,0 +1,18 @@
+import QtQuick
+import QtQuick.Pdf
+
+PdfMultiPageView {
+ id: view
+ property point hoverPos: hover.point.position
+ width: 640; height: 480
+ document: PdfDocument { }
+
+ // mouse hover feedback for test development
+ Rectangle {
+ width: 200
+ height: hoverPosLabel.implicitHeight + 12
+ color: "beige"
+ Text { id: hoverPosLabel; x: 6; y: 6; text: view.hoverPos.x + ", " + view.hoverPos.y }
+ }
+ HoverHandler { id: hover }
+}
diff --git a/tests/auto/pdfquick/multipageview/data/pdf-sample.protected.pdf b/tests/auto/pdfquick/multipageview/data/pdf-sample.protected.pdf
new file mode 100644
index 000000000..d76fdd1a6
--- /dev/null
+++ b/tests/auto/pdfquick/multipageview/data/pdf-sample.protected.pdf
Binary files differ
diff --git a/tests/auto/pdfquick/multipageview/data/qpdfwriter.pdf b/tests/auto/pdfquick/multipageview/data/qpdfwriter.pdf
new file mode 100644
index 000000000..4abc76f6d
--- /dev/null
+++ b/tests/auto/pdfquick/multipageview/data/qpdfwriter.pdf
Binary files differ
diff --git a/tests/auto/pdfquick/multipageview/tst_multipageview.cpp b/tests/auto/pdfquick/multipageview/tst_multipageview.cpp
new file mode 100644
index 000000000..c5e0b30db
--- /dev/null
+++ b/tests/auto/pdfquick/multipageview/tst_multipageview.cpp
@@ -0,0 +1,446 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include <QSignalSpy>
+#include <QTest>
+#include <QtCore/QLoggingCategory>
+#include <QtGui/QClipboard>
+#include <QtGui/QPointingDevice>
+#include <QtGui/QStyleHints>
+#include <QtQuick/QQuickView>
+#include <QtPdfQuick/private/qquickpdflinkmodel_p.h>
+#include <QtPdfQuick/private/qquickpdfsearchmodel_p.h>
+#include <QtPdfQuick/private/qquickpdfpageimage_p.h>
+#include "../shared/util.h"
+
+using namespace Qt::StringLiterals;
+
+Q_LOGGING_CATEGORY(lcTests, "qt.pdf.tests")
+
+class tst_MultiPageView : public QQuickDataTest
+{
+ Q_OBJECT
+
+private Q_SLOTS:
+ void internalLink_data();
+ void internalLink();
+ void navigation_data();
+ void navigation();
+ void password();
+ void selectionAndClipboard();
+ void search();
+ void pinchDragPinch();
+ void jumpOnDocumentReady();
+
+public:
+ enum NavigationAction {
+ Back,
+ Forward,
+ GotoPage,
+ GotoLocation,
+ ClickLink
+ };
+ Q_ENUM(NavigationAction)
+
+ struct NavigationCommand {
+ NavigationAction action;
+ int index;
+ QPointF location;
+ qreal zoom;
+ QPointF expectedContentPos;
+ int expectedCurrentPage;
+ };
+
+private:
+ QScopedPointer<QPointingDevice> touchscreen = QScopedPointer<QPointingDevice>(QTest::createTouchDevice());
+};
+
+void tst_MultiPageView::internalLink_data()
+{
+ QTest::addColumn<int>("linkIndex");
+ QTest::addColumn<int>("expectedPage");
+ QTest::addColumn<qreal>("expectedZoom");
+ QTest::addColumn<QPoint>("expectedScroll");
+
+ QTest::newRow("first link") << 0 << 1 << qreal(1) << QPoint(134, 1286);
+ // TODO fails because it zooms out, and the view leaves gaps between pages currently
+// QTest::newRow("second link") << 1 << 2 << qreal(0.5) << QPoint(0, 717);
+}
+
+void tst_MultiPageView::internalLink()
+{
+ QFETCH(int, linkIndex);
+ QFETCH(int, expectedPage);
+ QFETCH(qreal, expectedZoom);
+ QFETCH(QPoint, expectedScroll);
+
+ QQuickView window;
+ QVERIFY(showView(window, testFileUrl("multiPageView.qml")));
+ QQuickItem *pdfView = window.rootObject();
+ QVERIFY(pdfView);
+ pdfView->setProperty("source", testFileUrl("bookmarksAndLinks.pdf"));
+ QTRY_COMPARE(pdfView->property("currentPageRenderingStatus").toInt(), QQuickPdfPageImage::Ready);
+
+ QQuickItem *table = static_cast<QQuickItem *>(findFirstChild(pdfView, "QQuickTableView"));
+ QVERIFY(table);
+ QQuickItem *firstPage = tableViewItemAtCell(table, 0, 0);
+ QVERIFY(firstPage);
+ QQuickPdfLinkModel *linkModel = firstPage->findChild<QQuickPdfLinkModel*>();
+ QVERIFY(linkModel);
+ QQuickItem *repeater = qobject_cast<QQuickItem *>(linkModel->parent());
+ QVERIFY(repeater);
+ QVERIFY(repeater->property("count").toInt() > linkIndex);
+
+ QCOMPARE(pdfView->property("backEnabled").toBool(), false);
+ QCOMPARE(pdfView->property("forwardEnabled").toBool(), false);
+
+ // get the PdfLinkDelegate instance, which has a TapHandler declared inside
+ QQuickItem *linkDelegate = repeaterItemAt(repeater, linkIndex);
+ QVERIFY(linkDelegate);
+ const auto modelIdx = linkModel->index(linkIndex);
+ const int linkPage = linkModel->data(modelIdx, int(QPdfLinkModel::Role::Page)).toInt();
+ QVERIFY(linkPage >= 0);
+ const QPointF linkLocation = linkModel->data(modelIdx, int(QPdfLinkModel::Role::Location)).toPointF();
+ const qreal linkZoom = linkModel->data(modelIdx, int(QPdfLinkModel::Role::Zoom)).toReal();
+
+ // click on it, and check whether it went to the right place
+ const auto point = linkDelegate->position().toPoint() + QPoint(15, 15);
+ QTest::mouseClick(&window, Qt::LeftButton, Qt::NoModifier, point);
+ QTRY_COMPARE(tableViewContentPos(table).y(), expectedScroll.y());
+ const auto linkScrollPos = tableViewContentPos(table);
+ qCDebug(lcTests, "clicked link @ %d, %d and expected scrolling to %d, %d; actually scrolled to %d, %d",
+ point.x(), point.y(), expectedScroll.x(), expectedScroll.y(), linkScrollPos.x(), linkScrollPos.y());
+ QVERIFY(qAbs(linkScrollPos.x() - expectedScroll.x()) < 15);
+ QTRY_COMPARE(pdfView->property("currentPageRenderingStatus").toInt(), QQuickPdfPageImage::Ready);
+ QCOMPARE(pdfView->property("currentPage").toInt(), linkPage);
+ QCOMPARE(linkPage, expectedPage);
+ QCOMPARE(pdfView->property("renderScale").toReal(), linkZoom);
+ QCOMPARE(linkZoom, expectedZoom);
+ qCDebug(lcTests, "link %d goes to page %d location {%lf,%lf} zoom %lf scroll to {%lf,%lf}",
+ linkIndex, linkPage, linkLocation.x(), linkLocation.y(), linkZoom,
+ table->property("contentX").toReal(), table->property("contentY").toReal());
+
+ // check that we can go back to where we came from
+ QCOMPARE(pdfView->property("backEnabled").toBool(), true);
+ QCOMPARE(pdfView->property("forwardEnabled").toBool(), false);
+ QVERIFY(QMetaObject::invokeMethod(pdfView, "back"));
+ QTRY_COMPARE(tableViewContentPos(table), QPoint(0, 0));
+ QCOMPARE(pdfView->property("currentPage").toInt(), 0);
+ QCOMPARE(pdfView->property("renderScale").toReal(), qreal(1));
+
+ // and then forward again
+ QCOMPARE(pdfView->property("backEnabled").toBool(), false);
+ QCOMPARE(pdfView->property("forwardEnabled").toBool(), true);
+ QVERIFY(QMetaObject::invokeMethod(pdfView, "forward"));
+ QTRY_COMPARE(tableViewContentPos(table), linkScrollPos);
+ QCOMPARE(pdfView->property("currentPage").toInt(), linkPage);
+ QCOMPARE(pdfView->property("renderScale").toReal(), linkZoom);
+}
+
+void tst_MultiPageView::navigation_data()
+{
+ QTest::addColumn<QList<NavigationCommand>>("actions");
+ const int totalPageSpacing = 832; // 826 points + 6 px (rowSpacing)
+
+ QList<NavigationCommand> actions;
+ actions << NavigationCommand {NavigationAction::GotoPage, 2, {}, 0, {0, 1664}, 2}
+ << NavigationCommand {NavigationAction::GotoPage, 3, {}, 0, {0, 2496}, 3}
+ << NavigationCommand {NavigationAction::Back, 0, {}, 0, {0, 1664}, 2}
+ << NavigationCommand {NavigationAction::Back, 0, {}, 0, {0, 0}, 0};
+ QTest::newRow("goto and back") << actions;
+
+ actions.clear();
+ actions // first link is "More..." going to page 0, location 8, 740
+ << NavigationCommand {NavigationAction::ClickLink, 0, {465, 65}, 0, {0, 740}, 0}
+ << NavigationCommand {NavigationAction::Back, 0, {}, 0, {0, 0}, 0}
+ // link "setPdfVersion()" going to page 3, location 8, 295
+ << NavigationCommand {NavigationAction::ClickLink, 0, {255, 455}, 0, {0, totalPageSpacing * 3 + 295}, 3}
+ << NavigationCommand {NavigationAction::Back, 0, {}, 0, {0, 0}, 0};
+ QTest::newRow("click links and go back, twice") << actions;
+
+ actions.clear();
+ actions // first link is "More..." going to page 0, location 8, 740
+ << NavigationCommand {NavigationAction::ClickLink, 0, {465, 65}, 0, {0, 740}, 0}
+ // link "newPage()" going to page 1, location 8, 290
+ << NavigationCommand {NavigationAction::ClickLink, 0, {480, 40}, 0, {0, totalPageSpacing + 290}, 1} // fails, goes back to page 0
+ << NavigationCommand {NavigationAction::Back, 0, {}, 0, {8, 740}, 0}
+ << NavigationCommand {NavigationAction::Back, 0, {}, 0, {0, 0}, 0};
+ QTest::newRow("click two links in series and then go back") << actions;
+}
+
+void tst_MultiPageView::navigation()
+{
+ QFETCH(QList<NavigationCommand>, actions);
+
+ QQuickView window;
+ window.setColor(Qt::gray);
+ window.setSource(testFileUrl("multiPageViewWithFeedback.qml"));
+ QTRY_COMPARE(window.status(), QQuickView::Ready);
+ QQuickItem *pdfView = window.rootObject();
+ QVERIFY(pdfView);
+ QObject *doc = pdfView->property("document").value<QObject *>();
+ QVERIFY(doc);
+ doc->setProperty("source", testFileUrl("qpdfwriter.pdf"));
+ QQuickItem *table = static_cast<QQuickItem *>(findFirstChild(pdfView, "QQuickTableView"));
+ QVERIFY(table);
+ // Expect that contentY == destination y after a jump, for ease of comparison.
+ // 0.01 is close enough to 0 that we can compare int positions accurately,
+ // but nonzero so that QRectF::isValid() is true in tableView.positionViewAtCell()
+ table->setProperty("jumpLocationMargin", QPointF(0.01, 0.01));
+
+ window.show();
+ window.requestActivate();
+ QVERIFY(QTest::qWaitForWindowExposed(&window));
+
+ QTRY_COMPARE(table->property("contentHeight").toInt(), 3322);
+ QCOMPARE(table->property("contentY").toInt(), 0);
+
+ for (const NavigationCommand &nav : actions) {
+ switch (nav.action) {
+ case NavigationAction::Back:
+ QVERIFY(QMetaObject::invokeMethod(pdfView, "back"));
+ QCOMPARE(pdfView->property("forwardEnabled").toBool(), true);
+ break;
+ case NavigationAction::Forward:
+ QVERIFY(QMetaObject::invokeMethod(pdfView, "forward"));
+ QCOMPARE(pdfView->property("backEnabled").toBool(), true);
+ break;
+ case NavigationAction::GotoPage:
+ QVERIFY(QMetaObject::invokeMethod(pdfView, "goToPage",
+ Q_ARG(QVariant, QVariant(nav.index))));
+ QCOMPARE(pdfView->property("backEnabled").toBool(), true);
+ break;
+ case NavigationAction::GotoLocation:
+ QVERIFY(QMetaObject::invokeMethod(pdfView, "goToLocation",
+ Q_ARG(QVariant, QVariant(nav.index)),
+ Q_ARG(QVariant, QVariant(nav.location)),
+ Q_ARG(QVariant, QVariant(nav.zoom)) ));
+ break;
+ case NavigationAction::ClickLink:
+ // Link delegates don't exist until page rendering is done
+ QTRY_VERIFY(pdfView->property("currentPageRenderingStatus").toInt() == 1); // QQuickImage::Status::Ready
+ QTest::mouseClick(&window, Qt::LeftButton, Qt::NoModifier, nav.location.toPoint());
+ // Wait for the destination page to be rendered
+ QTRY_VERIFY(pdfView->property("currentPageRenderingStatus").toInt() == 1); // QQuickImage::Status::Ready
+ break;
+ }
+ qCDebug(lcTests) << "action" << nav.action << "index" << nav.index
+ << "contentX,Y" << table->property("contentX").toInt() << table->property("contentY").toInt()
+ << "expected" << nav.expectedContentPos;
+ QTRY_COMPARE(table->property("contentY").toInt(), nav.expectedContentPos.y());
+ // some minor side-to-side scrolling happens, in practice
+ QVERIFY(qAbs(table->property("contentX").toInt() - nav.expectedContentPos.x()) < 10);
+ QCOMPARE(pdfView->property("currentPage").toInt(), nav.expectedCurrentPage);
+ }
+
+ QCOMPARE(pdfView->property("backEnabled").toBool(), false);
+}
+
+void tst_MultiPageView::password()
+{
+ QQuickView window;
+ QVERIFY(showView(window, testFileUrl("multiPageView.qml")));
+ QQuickItem *pdfView = window.rootObject();
+ QVERIFY(pdfView);
+ QQuickPdfDocument *doc = pdfView->property("document").value<QQuickPdfDocument*>();
+ QVERIFY(doc);
+ QPdfDocument *cppDoc = static_cast<QPdfDocument *>(qmlExtendedObject(doc));
+ QVERIFY(cppDoc);
+ QSignalSpy passwordRequiredSpy(doc, SIGNAL(passwordRequired()));
+ // actually QPdfDocument::passwordRequired, but QML_EXTENDED gives us this signal virtually in QQuickPdfDocument
+ QVERIFY(passwordRequiredSpy.isValid());
+ QSignalSpy passwordChangedSpy(doc, SIGNAL(passwordChanged()));
+ // actually QPdfDocument::passwordChanged, but QML_EXTENDED gives us this signal virtually in QQuickPdfDocument
+ QVERIFY(passwordChangedSpy.isValid());
+ QSignalSpy statusChangedSpy(doc, SIGNAL(statusChanged(QPdfDocument::Status)));
+ // actually QPdfDocument::statusChanged, but QML_EXTENDED gives us this signal virtually in QQuickPdfDocument
+ QVERIFY(statusChangedSpy.isValid());
+ QSignalSpy pageCountChangedSpy(doc, SIGNAL(pageCountChanged(int)));
+ // QPdfDocument::pageCountChanged(int), but QML_EXTENDED gives us this signal virtually in QQuickPdfDocument
+ QVERIFY(pageCountChangedSpy.isValid());
+ QSignalSpy extPageCountChangedSpy(cppDoc, &QPdfDocument::pageCountChanged);
+ // actual QPdfDocument::pageCountChanged(int), for comparison with the illusory QQuickPdfDocument::pageCountChanged
+ QVERIFY(extPageCountChangedSpy.isValid());
+
+ QVERIFY(pdfView->setProperty("source", testFileUrl(u"pdf-sample.protected.pdf"_s)));
+
+ QTRY_COMPARE(passwordRequiredSpy.size(), 1);
+ qCDebug(lcTests) << "error while awaiting password" << doc->error()
+ << "passwordRequired count" << passwordRequiredSpy.size()
+ << "statusChanged count" << statusChangedSpy.size();
+ QCOMPARE(doc->property("status").toInt(), int(QPdfDocument::Status::Error));
+ QCOMPARE(pageCountChangedSpy.size(), 0);
+ QCOMPARE(extPageCountChangedSpy.size(), 0);
+ QCOMPARE(statusChangedSpy.size(), 2); // Loading and then Error
+ statusChangedSpy.clear();
+ QVERIFY(doc->setProperty("password", u"Qt"_s));
+ QCOMPARE(passwordChangedSpy.size(), 1);
+ QTRY_COMPARE(doc->property("status").toInt(), int(QPdfDocument::Status::Ready));
+ qCDebug(lcTests) << "after setPassword" << doc->error()
+ << "passwordChanged count" << passwordChangedSpy.size()
+ << "statusChanged count" << statusChangedSpy.size()
+ << "pageCountChanged count" << pageCountChangedSpy.size();
+ QCOMPARE(statusChangedSpy.size(), 2); // Loading and then Ready
+ QCOMPARE(pageCountChangedSpy.size(), 1);
+ QCOMPARE(extPageCountChangedSpy.size(), pageCountChangedSpy.size());
+}
+
+void tst_MultiPageView::selectionAndClipboard()
+{
+ QQuickView window;
+ QVERIFY(showView(window, testFileUrl("multiPageView.qml")));
+ QQuickItem *pdfView = window.rootObject();
+ QVERIFY(pdfView);
+ QQuickPdfDocument *doc = pdfView->property("document").value<QQuickPdfDocument*>();
+ QVERIFY(doc);
+ QVERIFY(doc->setProperty("password", u"Qt"_s));
+ QVERIFY(pdfView->setProperty("source", testFileUrl((u"pdf-sample.protected.pdf"_s))));
+ QTRY_COMPARE(pdfView->property("currentPageRenderingStatus").toInt(), QQuickPdfPageImage::Ready);
+
+ QVERIFY(QMetaObject::invokeMethod(pdfView, "selectAll"));
+ QString sel = pdfView->property("selectedText").toString();
+ QCOMPARE(sel.size(), 1073);
+
+#if QT_CONFIG(clipboard)
+ QClipboard *clip = qApp->clipboard();
+ if (clip->supportsSelection())
+ QCOMPARE(clip->text(QClipboard::Selection), sel);
+ QVERIFY(QMetaObject::invokeMethod(pdfView, "copySelectionToClipboard"));
+ QCOMPARE(clip->text(QClipboard::Clipboard), sel);
+#endif // clipboard
+}
+
+void tst_MultiPageView::search()
+{
+ QQuickView window;
+ QVERIFY(showView(window, testFileUrl("multiPageView.qml")));
+ window.setResizeMode(QQuickView::SizeRootObjectToView);
+ window.resize(200, 200);
+ QQuickItem *pdfView = window.rootObject();
+ QVERIFY(pdfView);
+ QTRY_COMPARE(pdfView->width(), 200);
+ QQuickPdfDocument *doc = pdfView->property("document").value<QQuickPdfDocument*>();
+ QVERIFY(doc);
+ QVERIFY(doc->setProperty("password", u"Qt"_s));
+ QVERIFY(pdfView->setProperty("source", testFileUrl(u"pdf-sample.protected.pdf"_s)));
+ QTRY_COMPARE(pdfView->property("currentPageRenderingStatus").toInt(), QQuickPdfPageImage::Ready);
+ QPdfSearchModel *searchModel = pdfView->property("searchModel").value<QPdfSearchModel*>();
+ QVERIFY(searchModel);
+ QQuickItem *table = static_cast<QQuickItem *>(findFirstChild(pdfView, "QQuickTableView"));
+ QVERIFY(table);
+ QQuickItem *firstPage = tableViewItemAtCell(table, 0, 0);
+ QVERIFY(firstPage);
+ QObject *multiline = findFirstChild(firstPage, "QQuickPathMultiline");
+ QVERIFY(multiline);
+
+ pdfView->setProperty("searchString", u"PDF"_s);
+ QTRY_COMPARE(searchModel->rowCount(QModelIndex()), 7); // occurrences of the word "PDF" in this file
+ const int count = searchModel->rowCount(QModelIndex());
+ QList<QList<QPointF>> resultOutlines = multiline->property("paths").value<QList<QList<QPointF>>>();
+ QCOMPARE(resultOutlines.size(), 7);
+ QPoint contentPos = tableViewContentPos(table);
+ int movements = 0;
+ for (int i = 0; i < count; ++i) {
+ // only one page, so IndexOnPage data is the same as overall index
+ QCOMPARE(i, searchModel->data(searchModel->index(i), int(QPdfSearchModel::Role::IndexOnPage)).toInt());
+ QCOMPARE(resultOutlines.at(i).size(), 5); // 5-point polygon is a rectangle (including drawing back to the start, to close it)
+ QCOMPARE(resultOutlines.at(i).first(), searchModel->data(searchModel->index(i), int(QPdfSearchModel::Role::Location)).toPointF());
+
+ QVERIFY(QMetaObject::invokeMethod(pdfView, "searchForward"));
+ QTest::qWait(500); // animation time; but it doesn't always need to move
+ // TODO maybe: if movement starts, wait for it to stop somehow?
+ qCDebug(lcTests) << i << resultOutlines.at(i) << "scrolled to" << tableViewContentPos(table);
+ if (tableViewContentPos(table) != contentPos)
+ ++movements;
+ contentPos = tableViewContentPos(table);
+ }
+ qCDebug(lcTests) << "total movements" << movements;
+ QVERIFY(movements > 4);
+}
+
+void tst_MultiPageView::pinchDragPinch()
+{
+ qputenv("QML_NO_TOUCH_COMPRESSION", "1");
+ QQuickView window;
+ QVERIFY(showView(window, testFileUrl("multiPageView.qml")));
+ QQuickItem *pdfView = window.rootObject();
+ QVERIFY(pdfView);
+ pdfView->setProperty("source", testFileUrl("bookmarksAndLinks.pdf"));
+ QTRY_COMPARE(pdfView->property("currentPageRenderingStatus").toInt(), QQuickPdfPageImage::Ready);
+ QQuickItem *table = static_cast<QQuickItem *>(findFirstChild(pdfView, "QQuickTableView"));
+ QVERIFY(table);
+ QQuickItem *firstPage = tableViewItemAtCell(table, 0, 0);
+ QVERIFY(firstPage);
+ QQuickItem *paper = firstPage->childAt(10, 10);
+ QVERIFY(paper);
+ QQuickPdfPageImage *image = firstPage->findChild<QQuickPdfPageImage *>();
+ QVERIFY(image);
+
+ auto pinch = [&window, paper, this]() {
+ const int threshold = QGuiApplication::styleHints()->startDragDistance();
+ const int movement = 100;
+ QCOMPARE_GT(movement, threshold);
+ const qreal initialScale = paper->scale();
+ QPoint p0(100, 200);
+ QPoint p1(200, 200);
+ QTest::QTouchEventSequence seq = QTest::touchEvent(&window, touchscreen.get());
+ seq.press(0, p0, &window).commit();
+ seq.stationary(0).press(1, p1, &window).commit();
+ p1.setX(p1.x() + movement);
+ QSignalSpy frameSwappedSpy(&window, &QQuickWindow::frameSwapped);
+ seq.stationary(0).move(1, p1, &window).commit();
+ // after a frame is rendered, the PinchHandler ought to be active
+ // (but verifying it would require private API)
+ QTRY_VERIFY(frameSwappedSpy.size() > 0);
+ QTRY_COMPARE(paper->scale(), initialScale);
+
+ for (int i = 1; i <= 2; ++i) {
+ p1.setX(p1.x() + movement);
+ seq.stationary(0).move(1, p1, &window).commit();
+ QTRY_COMPARE(paper->scale(), initialScale + i * 0.5);
+ }
+ seq.release(0, p0, &window).release(1, p1, &window).commit();
+ };
+
+ auto drag = [&window, table, this]() {
+ const int movement = 100;
+ QPoint p0(200, 200);
+ QTest::QTouchEventSequence seq = QTest::touchEvent(&window, touchscreen.get());
+ seq.press(0, p0, &window).commit();
+ p0.setY(p0.y() + movement);
+ seq.move(0, p0, &window).commit();
+ p0.setY(p0.y() + movement);
+ seq.move(0, p0, &window).commit();
+ seq.release(0, p0, &window).commit();
+ QTRY_COMPARE(table->property("moving"), false);
+ };
+
+ pinch();
+ qCDebug(lcTests) << "new scale" << pdfView->property("renderScale").toReal();
+ QTRY_COMPARE(pdfView->property("renderScale").toReal(), 2);
+
+ drag();
+ QCOMPARE(pdfView->property("renderScale").toReal(), 2);
+
+ pinch();
+ qCDebug(lcTests) << "new scale" << pdfView->property("renderScale").toReal();
+ QTRY_COMPARE(pdfView->property("renderScale").toReal(), 4);
+
+ // wait for rendering to be done before we exit: if we delete the document
+ // prematurely, QPdfIOHandler might access a dangling pointer
+ QTRY_COMPARE(image->status(), QQuickPdfPageImage::Ready);
+}
+
+void tst_MultiPageView::jumpOnDocumentReady() // QTBUG-119416
+{
+ QQuickView window;
+ QVERIFY(showView(window, testFileUrl("jumpOnDocumentReady.qml")));
+ QQuickItem *pdfView = window.rootObject();
+ QVERIFY(pdfView);
+
+ // QML calls view.goToPage(2): verify that it eventually happens
+ QTRY_COMPARE(pdfView->property("currentPage").toInt(), 2);
+}
+
+QTEST_MAIN(tst_MultiPageView)
+#include "tst_multipageview.moc"
diff --git a/tests/auto/pdfquick/pdfpageimage/CMakeLists.txt b/tests/auto/pdfquick/pdfpageimage/CMakeLists.txt
new file mode 100644
index 000000000..da67d8721
--- /dev/null
+++ b/tests/auto/pdfquick/pdfpageimage/CMakeLists.txt
@@ -0,0 +1,30 @@
+# Collect test data
+file(GLOB_RECURSE test_data_glob
+ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
+ data/*)
+list(APPEND test_data ${test_data_glob})
+
+qt_internal_add_test(tst_pdfpageimage
+ SOURCES
+ tst_pdfpageimage.cpp
+ ../shared/util.cpp ../shared/util.h
+ LIBRARIES
+ Qt::Gui
+ Qt::Quick
+ Qt::PdfQuickPrivate
+ TESTDATA ${test_data}
+)
+
+## Scopes:
+#####################################################################
+
+qt_internal_extend_target(tst_pdfpageimage CONDITION ANDROID OR IOS
+ DEFINES
+ QT_QMLTEST_DATADIR=":/data"
+)
+
+qt_internal_extend_target(tst_pdfpageimage CONDITION NOT ANDROID AND NOT IOS
+ DEFINES
+ QT_QMLTEST_DATADIR="${CMAKE_CURRENT_SOURCE_DIR}/data"
+)
+
diff --git a/tests/auto/pdfquick/pdfpageimage/data/bookmarksAndLinks.pdf b/tests/auto/pdfquick/pdfpageimage/data/bookmarksAndLinks.pdf
new file mode 100644
index 000000000..aa0b99039
--- /dev/null
+++ b/tests/auto/pdfquick/pdfpageimage/data/bookmarksAndLinks.pdf
@@ -0,0 +1,317 @@
+%PDF-1.7
+
+1 0 obj
+<<
+ /Type /Catalog
+ /PageMode /FullScreen
+ /Outlines 6 0 R
+ /Pages 2 0 R
+ /Names 50 0 R
+ /PageLabels 23 0 R
+ /ViewerPreferences<</NonFullScreenPageMode (UseThumbs)>>
+>>
+endobj
+
+50 0 obj
+<<
+ /Dests <</Names [ (ToTest2) [4 0 R /XYZ 300 300 1] (ToTest3) [5 0 R /XYZ 290 10 0.5] (ToTest1) [3 0 R /XYZ 600 800 1] ]>>
+>>
+endobj
+
+23 0 obj
+<<
+ /Nums [0 <</S /D /P(test )>> 3 <</S /A >> 4<</S /R/St >> 5<</S /r/St >> ]
+ /Limits [0 5]
+>>
+endobj
+
+2 0 obj
+<<
+ /Type /Pages
+ /Kids [3 0 R 4 0 R 5 0 R]
+ /Count 3
+>>
+endobj
+
+3 0 obj
+<<
+ /Type /Page
+ /Parent 2 0 R
+ /MediaBox [0 10 600 800]
+ /Annots [24 0 R 25 0 R]
+ /Contents 16 0 R
+ /Resources <<
+ /Font <</F1 18 0 R>>
+ >>
+>>
+endobj
+
+24 0 obj
+<<
+ /Subtype /Link
+ /Border [0 0 0]
+ /Dest (ToTest2)
+ /A << /Type /Action
+ /S /GoTo
+ /D [5 0 R /FitR ¨C4 399 199 533]
+ >>
+ /Rect [10 690 150 720]
+
+>>
+endobj
+
+25 0 obj
+<<
+ /Subtype /Link
+ /Border [0 0 0]
+ /Dest (ToTest3)
+ /Rect [10 630 150 650]
+>>
+endobj
+
+
+16 0 obj
+<< /Length 0 >>
+ stream
+ BT
+ /F1 72 Tf
+ 200 200 TD
+ 0 0 1 RG
+ 5 Tr
+ (Test_1) Tj
+ 0 800 m
+ 600 0 l S
+ /F1 30 Tf
+ 0 1 0 RG
+ 1 Tr
+ -190 490 TD
+ (GO Test_2) Tj
+ 0 -50 TD
+ 5 w
+ 2 Tr
+ 1 0 0 RG
+ (GO Test_3) Tj
+ ET
+ endstream
+endobj
+
+
+endobj
+
+18 0 obj
+<<
+ /Type /Font
+ /Subtype /Type1
+ /Name /F1
+ /BaseFont /Helvetica
+>>
+endobj
+
+4 0 obj
+<<
+ /Type /Page
+ /Parent 2 0 R
+ /MediaBox [10 0 500 700]
+ /Annots [60 0 R]
+ /Contents 19 0 R
+ /Resources <<
+ /Font <</F2 20 0 R>>
+ >>
+>>
+endobj
+
+19 0 obj
+<< /Length 0 >>
+stream
+BT
+ 1 -0.7 0 1 30 100 cm
+ /F2 50 Tf
+ 10 50 TD
+ (TEST_2) Tj
+
+ 1 0.7 0 1 -30 -100 cm
+ /F2 25 Tf
+ 1 0 1 RG
+ 7 w
+ 100 60 TD
+
+ (GO Test_1) Tj
+ 100 100 140 40 re S f
+ET
+endstream
+endobj
+
+20 0 obj
+<<
+ /Type /Font
+ /Subtype /TrueType
+ /Name /F2
+ /BaseFont /NewYork , Bold
+ /FirstChar 0
+ /LastChar 255
+ /Widths 23 0 R
+ /FontDescriptor 7 0 R
+ /Encoding /MacRomanEncoding
+>>
+endobj
+
+60 0 obj
+<<
+ /Subtype /Link
+ /Border [0 0 0]
+ /Dest (ToTest1)
+ /Rect [110 110 230 150]
+>>
+endobj
+
+5 0 obj
+<<
+ /Type /Page
+ /Parent 2 0 R
+ /MediaBox [-10 -10 400 600]
+ /Annots [61 0 R]
+ /Contents 21 0 R
+ /Resources << /Font <</F3 22 0 R>> >>
+>>
+endobj
+
+21 0 obj
+<< /Length 0 >>
+stream
+BT
+ /F3 30 Tf
+ 290 10 TD
+ (TEST_3) Tj
+ -50 90 TD
+ (GO Test_2)Tj
+ET
+endstream
+endobj
+
+22 0 obj
+<<
+ /Type /Font
+ /Subtype /Type1
+ /Name /F3
+ /BaseFont /Courier-Bold
+>>
+endobj
+
+61 0 obj
+<<
+ /Subtype /Link
+ /Border [0 0 0]
+ /Dest (ToTest2)
+ /Rect [240 90 400 130]
+>>
+
+6 0 obj
+<<
+ /Type /Outlines
+ /First 7 0 R
+ /Last 11 0 R
+ /Count 4 0 R
+>>
+endobj
+
+7 0 obj
+<<
+ /Title (First)
+ /Parent 6 0 R
+ /Next 8 0 R
+ /C [1 0 0]
+ /Dest [ 3 0 R /XYZ 600 800 0.5 ]
+>>
+endobj
+
+8 0 obj
+<<
+ /Title (Second)
+ /Parent 6 0 R
+ /Prev 7 0 R
+ /Next 9 0 R
+ /C [0 1 0]
+ % /Dest [ 4 0 R /XYZ 500 700 null ]
+/Dest (ToTest2)
+>>
+endobj
+
+9 0 obj
+<<
+ /Title (Third)
+ /Parent 6 0 R
+ /Prev 8 0 R
+ /Next 10 0 R
+ /C [0 0 1]
+ /Dest [ 5 0 R /XYZ 400 600 0.8 ]
+>>
+endobj
+
+10 0 obj
+<<
+ /Title (Fourth)
+ /Parent 6 0 R
+ /Prev 9 0 R
+ /Next 11 0 R
+>>
+endobj
+
+11 0 obj
+<<
+ /Title (Fivth)
+ /Parent 6 0 R
+ /Prev 10 0 R
+ /First 12 0 R
+ /Last 15 0 R
+ /Count 4
+>>
+endobj
+
+12 0 obj
+<<
+ /Title (Fivth_1)
+ /Parent 11 0 R
+ /Next 13 0 R
+>>
+endobj
+
+13 0 obj
+<<
+ /Title (Fivth_2)
+ /Parent 11 0 R
+ /Prev 12 0 R
+ /Next 14 0 R
+>>
+endobj
+
+14 0 obj
+<<
+ /Title (Fivth_3)
+ /Parent 11 0 R
+ /Prev 13 0 R
+ /Next 15 0 R
+>>
+endobj
+
+15 0 obj
+<<
+ /Title (Fivth_4)
+ /Parent 11 0 R
+ /Prev 14 0 R
+>>
+endobj
+
+
+
+
+xref
+0000000000 65536 f
+
+trailer
+<<
+ /Size 0
+ /Root 1 0 R
+>>
+startxref
+0
+%%EOF
diff --git a/tests/auto/pdfquick/pdfpageimage/data/pdfPageImage.qml b/tests/auto/pdfquick/pdfpageimage/data/pdfPageImage.qml
new file mode 100644
index 000000000..a268bf14b
--- /dev/null
+++ b/tests/auto/pdfquick/pdfpageimage/data/pdfPageImage.qml
@@ -0,0 +1,16 @@
+import QtQuick
+import QtQuick.Pdf
+
+Item {
+ width: 320
+ height: 320
+
+ PdfDocument {
+ id: doc
+ source: "bookmarksAndLinks.pdf"
+ }
+
+ PdfPageImage {
+ anchors.centerIn: parent
+ }
+}
diff --git a/tests/auto/pdfquick/pdfpageimage/tst_pdfpageimage.cpp b/tests/auto/pdfquick/pdfpageimage/tst_pdfpageimage.cpp
new file mode 100644
index 000000000..d2c9c8709
--- /dev/null
+++ b/tests/auto/pdfquick/pdfpageimage/tst_pdfpageimage.cpp
@@ -0,0 +1,131 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include <QRegularExpression>
+#include <QSignalSpy>
+#include <QTest>
+#include <QtQuick/QQuickView>
+#include <QtPdfQuick/private/qquickpdfdocument_p.h>
+#include <QtPdfQuick/private/qquickpdfpageimage_p.h>
+#include "../shared/util.h"
+
+using namespace Qt::StringLiterals;
+
+Q_LOGGING_CATEGORY(lcTests, "qt.pdf.tests")
+
+// #define DEBUG_WRITE_OUTPUT
+
+class tst_PdfPageImage : public QQuickDataTest
+{
+ Q_OBJECT
+
+private Q_SLOTS:
+ void settableProperties_data();
+ void settableProperties();
+
+public:
+ enum Property {
+ Source = 0x01,
+ Document = 0x02,
+ SourceSize = 0x04,
+ SourceClipRect = 0x08,
+ MipMap = 0x10,
+ AutoTransform = 0x20,
+ Asynchronous = 0x40,
+ NoCache = 0x80,
+ Mirror = 0x100,
+ MirrorVertically = 0x200,
+ ColorSpace = 0x400,
+ };
+ Q_DECLARE_FLAGS(Properties, Property)
+ Q_FLAG(Properties)
+
+private:
+#ifdef DEBUG_WRITE_OUTPUT
+ QTemporaryDir m_tmpDir;
+#endif
+};
+
+void tst_PdfPageImage::settableProperties_data()
+{
+ QTest::addColumn<tst_PdfPageImage::Properties>("toSet");
+ QTest::addColumn<QSize>("expectedSize");
+ QTest::addColumn<QRegularExpression>("expectedWarning");
+
+ const QRegularExpression NoWarning;
+ const qreal dpr = qGuiApp->devicePixelRatio();
+
+ QTest::newRow("source") << Properties(Source) << (QSizeF(600, 790) * dpr).toSize()
+ << QRegularExpression("document property not set: falling back to inefficient loading"); // QTBUG-104767
+ QTest::newRow("document") << Properties(Document) << QSize(600, 790) << NoWarning;
+ QTest::newRow("source and document") << Properties(Source | Document) << QSize(600, 790)
+ << QRegularExpression("document and source properties in conflict");
+ QTest::newRow("document and sourceSize") << Properties(Document | SourceSize) << QSize(100, 100) << NoWarning;
+ QTest::newRow("document and sourceClipRect") << Properties(Document | SourceClipRect) << QSize(100, 100) << NoWarning;
+ QTest::newRow("document and autoTransform") << Properties(Document | AutoTransform) << QSize(600, 790) << NoWarning;
+ QTest::newRow("document and async") << Properties(Document | Asynchronous) << QSize(600, 790) << NoWarning;
+ QTest::newRow("document and nocache") << Properties(Document | NoCache) << QSize(600, 790) << NoWarning;
+ QTest::newRow("document and mirror") << Properties(Document | Mirror) << QSize(600, 790) << NoWarning;
+ QTest::newRow("document and mirrorVertically") << Properties(Document | MirrorVertically) << QSize(600, 790) << NoWarning;
+ QTest::newRow("document and colorSpace") << Properties(Document | ColorSpace) << QSize(600, 790) << NoWarning;
+}
+
+void tst_PdfPageImage::settableProperties()
+{
+ QFETCH(tst_PdfPageImage::Properties, toSet);
+ QFETCH(QSize, expectedSize);
+ QFETCH(QRegularExpression, expectedWarning);
+
+ QQuickView window;
+ if (!expectedWarning.pattern().isEmpty())
+ QTest::ignoreMessage(QtWarningMsg, expectedWarning);
+ QVERIFY(showView(window, testFileUrl("pdfPageImage.qml")));
+ QQuickPdfPageImage *pdfImage = window.rootObject()->findChild<QQuickPdfPageImage *>();
+ QVERIFY(pdfImage);
+ QQuickPdfDocument *doc = window.rootObject()->findChild<QQuickPdfDocument *>();
+ QVERIFY(doc);
+ if (toSet.testFlag(Document))
+ pdfImage->setDocument(doc);
+ if (toSet.testFlag(Source))
+ pdfImage->setSource(doc->source());
+ if (toSet.testFlag(SourceSize))
+ pdfImage->setSourceSize({100, 100});
+ if (toSet.testFlag(SourceClipRect))
+ pdfImage->setSourceClipRect({100, 100, 100, 100});
+ if (toSet.testFlag(MipMap))
+ pdfImage->setMipmap(true);
+ if (toSet.testFlag(AutoTransform))
+ pdfImage->setAutoTransform(true);
+ if (toSet.testFlag(Asynchronous)) {
+ QCOMPARE(pdfImage->asynchronous(), false);
+ // test the opposite of the default
+ pdfImage->setAsynchronous(true);
+ }
+ if (toSet.testFlag(NoCache)) {
+ QCOMPARE(pdfImage->cache(), true);
+ // test the opposite of the default
+ pdfImage->setCache(false);
+ }
+ if (toSet.testFlag(Mirror)) {
+ QCOMPARE(pdfImage->mirror(), false);
+ pdfImage->setMirror(true);
+ }
+ if (toSet.testFlag(MirrorVertically)) {
+ QCOMPARE(pdfImage->mirrorVertically(), false);
+ pdfImage->setMirrorVertically(true);
+ }
+ if (toSet.testFlag(ColorSpace))
+ pdfImage->setColorSpace(QColorSpace::ProPhotoRgb);
+ QTRY_COMPARE(pdfImage->status(), QQuickPdfPageImage::Ready);
+ const QImage img = pdfImage->image();
+ QCOMPARE(img.size(), expectedSize);
+#ifdef DEBUG_WRITE_OUTPUT
+ m_tmpDir.setAutoRemove(false);
+ const auto path = m_tmpDir.filePath(QString::fromLocal8Bit(QTest::currentDataTag()) + ".png");
+ qCDebug(lcTests) << "saving to" << path;
+ img.save(path);
+#endif
+}
+
+QTEST_MAIN(tst_PdfPageImage)
+#include "tst_pdfpageimage.moc"
diff --git a/tests/auto/pdfquick/shared/util.cpp b/tests/auto/pdfquick/shared/util.cpp
new file mode 100644
index 000000000..c540ebfa6
--- /dev/null
+++ b/tests/auto/pdfquick/shared/util.cpp
@@ -0,0 +1,110 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "util.h"
+#include <QtQuick/QQuickItem>
+
+QQuickDataTest::QQuickDataTest() :
+ m_initialized(false),
+#ifdef QT_TESTCASE_BUILDDIR
+ m_dataDirectory(QTest::qFindTestData("data", QT_QMLTEST_DATADIR, 0, QT_TESTCASE_BUILDDIR)),
+#else
+ m_dataDirectory(QTest::qFindTestData("data", QT_QMLTEST_DATADIR, 0)),
+#endif
+
+ m_dataDirectoryUrl(m_dataDirectory.startsWith(QLatin1Char(':'))
+ ? QUrl(QLatin1String("qrc") + m_dataDirectory)
+ : QUrl::fromLocalFile(m_dataDirectory + QLatin1Char('/')))
+{
+}
+
+QQuickDataTest::~QQuickDataTest()
+{
+}
+
+void QQuickDataTest::initTestCase()
+{
+ QVERIFY2(!m_dataDirectory.isEmpty(), "'data' directory not found");
+ m_directory = QFileInfo(m_dataDirectory).absolutePath();
+ if (m_dataDirectoryUrl.scheme() != QLatin1String("qrc"))
+ QVERIFY2(QDir::setCurrent(m_directory), qPrintable(QLatin1String("Could not chdir to ") + m_directory));
+
+ if (QGuiApplication::platformName() == QLatin1String("offscreen")
+ || QGuiApplication::platformName() == QLatin1String("minimal"))
+ {
+ QSKIP("Skipping visual tests due to running with offscreen/minimal");
+ }
+
+ m_initialized = true;
+}
+
+void QQuickDataTest::cleanupTestCase()
+{
+ m_initialized = false;
+}
+
+QString QQuickDataTest::testFile(const QString &fileName) const
+{
+ if (m_directory.isEmpty())
+ qFatal("QQuickDataTest::initTestCase() not called.");
+ QString result = m_dataDirectory;
+ result += QLatin1Char('/');
+ result += fileName;
+ return result;
+}
+
+QObject *QQuickDataTest::findFirstChild(QObject *parent, const char *className)
+{
+ const auto children = parent->findChildren<QObject*>();
+ for (QObject *child : children) {
+ if (child->inherits(className))
+ return child;
+ }
+ return nullptr;
+}
+
+bool QQuickDataTest::showView(QQuickView &view, const QUrl &url)
+{
+ view.setSource(url);
+ while (view.status() == QQuickView::Loading)
+ QTest::qWait(10);
+ if (view.status() != QQuickView::Ready)
+ return false;
+ const QRect screenGeometry = view.screen()->availableGeometry();
+ const QSize size = view.size();
+ const QPoint offset = QPoint(size.width() / 2, size.height() / 2);
+ view.setFramePosition(screenGeometry.center() - offset);
+#if QT_CONFIG(cursor) // Get the cursor out of the way.
+ QCursor::setPos(view.geometry().topRight() + QPoint(100, 100));
+#endif
+ view.show();
+ if (!QTest::qWaitForWindowExposed(&view))
+ return false;
+ if (!view.rootObject())
+ return false;
+ return true;
+}
+
+QQuickItem *QQuickDataTest::repeaterItemAt(QQuickItem *repeater, int i)
+{
+ static const QMetaMethod itemAtMethod = repeater->metaObject()->method(
+ repeater->metaObject()->indexOfMethod("itemAt(int)"));
+ QQuickItem *ret = nullptr;
+ itemAtMethod.invoke(repeater, Qt::DirectConnection, Q_RETURN_ARG(QQuickItem*, ret), Q_ARG(int, i));
+ return ret;
+}
+
+QQuickItem *QQuickDataTest::tableViewItemAtCell(QQuickItem *table, int col, int row)
+{
+ static const QMetaMethod itemAtCellMethod = table->metaObject()->method(
+ table->metaObject()->indexOfMethod("itemAtCell(int,int)"));
+ QQuickItem *ret = nullptr;
+ itemAtCellMethod.invoke(table, Qt::DirectConnection,
+ Q_RETURN_ARG(QQuickItem*, ret), Q_ARG(int, col), Q_ARG(int, row));
+ return ret;
+}
+
+QPoint QQuickDataTest::tableViewContentPos(QQuickItem *table)
+{
+ return QPoint(table->property("contentX").toInt(), table->property("contentY").toInt());
+}
diff --git a/tests/auto/pdfquick/shared/util.h b/tests/auto/pdfquick/shared/util.h
new file mode 100644
index 000000000..9ceb711af
--- /dev/null
+++ b/tests/auto/pdfquick/shared/util.h
@@ -0,0 +1,58 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QUICK_VISUAL_TEST_UTIL_H
+#define QUICK_VISUAL_TEST_UTIL_H
+
+#include <QtCore/QUrl>
+#include <QtQuick/QQuickView>
+#include <QtTest/QTest>
+
+/*! \internal
+ Base class for tests with data that are located in a "data" subfolder.
+*/
+class QQuickDataTest : public QObject
+{
+ Q_OBJECT
+public:
+ QQuickDataTest();
+ ~QQuickDataTest();
+
+ bool initialized() const { return m_initialized; }
+
+ bool showView(QQuickView &view, const QUrl &url);
+
+ QString testFile(const QString &fileName) const;
+ inline QString testFile(const char *fileName) const
+ { return testFile(QLatin1String(fileName)); }
+ inline QUrl testFileUrl(const QString &fileName) const
+ {
+ const QString fn = testFile(fileName);
+ return fn.startsWith(QLatin1Char(':'))
+ ? QUrl(QLatin1String("qrc") + fn)
+ : QUrl::fromLocalFile(fn);
+ }
+ inline QUrl testFileUrl(const char *fileName) const
+ { return testFileUrl(QLatin1String(fileName)); }
+
+ inline QString dataDirectory() const { return m_dataDirectory; }
+ inline QUrl dataDirectoryUrl() const { return m_dataDirectoryUrl; }
+ inline QString directory() const { return m_directory; }
+
+ QObject *findFirstChild(QObject *parent, const char *className);
+ QQuickItem *repeaterItemAt(QQuickItem *repeater, int i);
+ QQuickItem *tableViewItemAtCell(QQuickItem *table, int col, int row);
+ QPoint tableViewContentPos(QQuickItem *table);
+
+public slots:
+ virtual void initTestCase();
+ virtual void cleanupTestCase();
+
+private:
+ bool m_initialized;
+ QString m_dataDirectory;
+ QUrl m_dataDirectoryUrl;
+ QString m_directory;
+};
+
+#endif
diff --git a/tests/auto/quick/CMakeLists.txt b/tests/auto/quick/CMakeLists.txt
new file mode 100644
index 000000000..d2cf7c3b3
--- /dev/null
+++ b/tests/auto/quick/CMakeLists.txt
@@ -0,0 +1,15 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+add_subdirectory(dialogs)
+add_subdirectory(publicapi)
+add_subdirectory(qquickwebenginedefaultsurfaceformat)
+add_subdirectory(qtbug-70248)
+# Re-enable if QTBUG-101744 and QTBUG-103354 have been fixed.
+if(NOT MACOS)
+ add_subdirectory(uidelegates)
+endif()
+add_subdirectory(inspectorserver)
+add_subdirectory(qmltests)
+add_subdirectory(qquickwebengineview)
+add_subdirectory(qquickwebengineviewgraphics)
diff --git a/tests/auto/quick/dialogs/CMakeLists.txt b/tests/auto/quick/dialogs/CMakeLists.txt
new file mode 100644
index 000000000..4d8dc853b
--- /dev/null
+++ b/tests/auto/quick/dialogs/CMakeLists.txt
@@ -0,0 +1,28 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+include(../../httpserver/httpserver.cmake)
+include(../../util/util.cmake)
+
+qt_internal_add_test(tst_dialogs
+ SOURCES
+ testhandler.cpp testhandler.h
+ tst_dialogs.cpp
+ LIBRARIES
+ Qt::CorePrivate
+ Qt::WebEngineQuickPrivate
+ Test::HttpServer
+ Test::Util
+)
+
+set(dialogs_resource_files
+ "WebView.qml"
+ "index.html"
+)
+
+qt_internal_add_resource(tst_dialogs "dialogs"
+ PREFIX
+ "/"
+ FILES
+ ${dialogs_resource_files}
+)
diff --git a/tests/auto/quick/dialogs/WebView.qml b/tests/auto/quick/dialogs/WebView.qml
index 01f4ac297..45fafb42d 100644
--- a/tests/auto/quick/dialogs/WebView.qml
+++ b/tests/auto/quick/dialogs/WebView.qml
@@ -1,36 +1,11 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-import QtQuick 2.0
-import QtWebEngine 1.4
-import QtQuick.Window 2.0
-import QtTest 1.0
-import io.qt.tester 1.0
+import QtQuick
+import QtWebEngine
+import QtQuick.Window
+import QtTest
+import io.qt.tester
Window {
width: 50
diff --git a/tests/auto/quick/dialogs/dialogs.pro b/tests/auto/quick/dialogs/dialogs.pro
deleted file mode 100644
index 29d509b20..000000000
--- a/tests/auto/quick/dialogs/dialogs.pro
+++ /dev/null
@@ -1,13 +0,0 @@
-include(../tests.pri)
-QT += core-private webengine webengine-private
-
-HEADERS += \
- server.h \
- testhandler.h
-
-SOURCES += \
- server.cpp \
- testhandler.cpp
-
-RESOURCES += \
- dialogs.qrc
diff --git a/tests/auto/quick/dialogs/dialogs.qrc b/tests/auto/quick/dialogs/dialogs.qrc
deleted file mode 100644
index a0715dbce..000000000
--- a/tests/auto/quick/dialogs/dialogs.qrc
+++ /dev/null
@@ -1,6 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>index.html</file>
- <file>WebView.qml</file>
- </qresource>
-</RCC>
diff --git a/tests/auto/quick/dialogs/server.cpp b/tests/auto/quick/dialogs/server.cpp
deleted file mode 100644
index dfc7c97ad..000000000
--- a/tests/auto/quick/dialogs/server.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "server.h"
-#include <QDataStream>
-#include <QTcpSocket>
-#include <QDebug>
-
-Server::Server(QObject *parent) : QObject(parent)
-{
- connect(&m_server, &QTcpServer::newConnection, this, &Server::handleNewConnection);
-}
-
-bool Server::isListening()
-{
- return m_server.isListening();
-}
-
-void Server::setReply(const QByteArray &reply)
-{
- m_reply = reply;
-}
-
-void Server::run()
-{
- if (!m_server.listen(QHostAddress::LocalHost, 5555))
- qFatal("Could not start the test server");
-}
-
-void Server::handleNewConnection()
-{
- // do one connection at the time
- Q_ASSERT(m_data.isEmpty());
- QTcpSocket *socket = m_server.nextPendingConnection();
- Q_ASSERT(socket);
- connect(socket, &QAbstractSocket::disconnected, socket, &QObject::deleteLater);
- connect(socket, &QAbstractSocket::readyRead, this, &Server::handleReadReady);
-}
-
-void Server::handleReadReady()
-{
- QTcpSocket *socket = qobject_cast<QTcpSocket*>(sender());
- Q_ASSERT(socket);
-
- m_data.append(socket->readAll());
-
- //simply wait for whole request
- if (!m_data.endsWith("\r\n\r\n"))
- return;
-
- socket->write(m_reply);
- m_data.clear();
- socket->disconnectFromHost();
-}
diff --git a/tests/auto/quick/dialogs/server.h b/tests/auto/quick/dialogs/server.h
deleted file mode 100644
index fa9a73811..000000000
--- a/tests/auto/quick/dialogs/server.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef SERVER_H
-#define SERVER_H
-
-#include <QObject>
-#include <QTcpServer>
-
-class Server : public QObject
-{
- Q_OBJECT
-
-public:
- explicit Server(QObject *parent = nullptr);
-
- bool isListening();
- void setReply(const QByteArray &reply);
-
-public slots:
- void run();
-
-private slots:
- void handleNewConnection();
- void handleReadReady();
-
-private:
- QByteArray m_data;
- QByteArray m_reply;
- QTcpServer m_server;
-
-};
-
-#endif // SERVER_H
diff --git a/tests/auto/quick/dialogs/testhandler.cpp b/tests/auto/quick/dialogs/testhandler.cpp
index bdd63a547..f45852630 100644
--- a/tests/auto/quick/dialogs/testhandler.cpp
+++ b/tests/auto/quick/dialogs/testhandler.cpp
@@ -1,36 +1,11 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "testhandler.h"
TestHandler::TestHandler(QObject *parent) : QObject(parent)
{
- setObjectName(QStringLiteral("TestListner"));
+ setObjectName(QStringLiteral("TestListener"));
}
QObject* TestHandler::request() const
diff --git a/tests/auto/quick/dialogs/testhandler.h b/tests/auto/quick/dialogs/testhandler.h
index 93ecfcdcb..c72e81841 100644
--- a/tests/auto/quick/dialogs/testhandler.h
+++ b/tests/auto/quick/dialogs/testhandler.h
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#ifndef TESTHANDLER_H
#define TESTHANDLER_H
diff --git a/tests/auto/quick/dialogs/tst_dialogs.cpp b/tests/auto/quick/dialogs/tst_dialogs.cpp
index 8e802a836..2b861efa6 100644
--- a/tests/auto/quick/dialogs/tst_dialogs.cpp
+++ b/tests/auto/quick/dialogs/tst_dialogs.cpp
@@ -1,50 +1,26 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "testhandler.h"
-#include "server.h"
-#include "util.h"
-#include <QtWebEngine/private/qquickwebenginedialogrequests_p.h>
-#include <QtWebEngine/private/qquickwebenginecontextmenurequest_p.h>
+#include <quickutil.h>
+#include <httpserver.h>
+
+#include <QtWebEngineQuick/private/qquickwebenginedialogrequests_p.h>
+#include <QtWebEngineCore/qwebenginecontextmenurequest.h>
#include <QQuickWebEngineProfile>
+
+#include <QNetworkProxy>
#include <QQmlApplicationEngine>
#include <QQuickWindow>
-#include <QTest>
#include <QSignalSpy>
-#include <QNetworkProxy>
-
+#include <QTest>
-class tst_Dialogs : public QObject {
+class tst_Dialogs : public QObject
+{
Q_OBJECT
public:
tst_Dialogs(){}
-
private slots:
void initTestCase();
void init();
@@ -57,11 +33,11 @@ private slots:
void authenticationDialogRequested();
private:
- void createDialog(const QLatin1String& dialog, bool &ok);
+ void createDialog(const QLatin1String &dialog, bool &ok);
private:
QScopedPointer<QQmlApplicationEngine> m_engine;
- QQuickWindow *m_widnow;
- TestHandler *m_listner;
+ QQuickWindow *m_window;
+ TestHandler *m_listener;
};
void tst_Dialogs::initTestCase()
@@ -70,10 +46,10 @@ void tst_Dialogs::initTestCase()
qmlRegisterType<TestHandler>("io.qt.tester", 1, 0, "TestHandler");
m_engine.reset(new QQmlApplicationEngine());
m_engine->load(QUrl(QStringLiteral("qrc:/WebView.qml")));
- m_widnow = qobject_cast<QQuickWindow*>(m_engine->rootObjects().first());
- Q_ASSERT(m_widnow);
- m_listner = m_widnow->findChild<TestHandler*>(QStringLiteral("TestListner"));
- Q_ASSERT(m_listner);
+ m_window = qobject_cast<QQuickWindow*>(m_engine->rootObjects().first());
+ Q_ASSERT(m_window);
+ m_listener = m_window->findChild<TestHandler*>(QStringLiteral("TestListener"));
+ Q_ASSERT(m_listener);
QNetworkProxy proxy;
proxy.setType(QNetworkProxy::HttpProxy);
@@ -84,29 +60,29 @@ void tst_Dialogs::initTestCase()
void tst_Dialogs::init()
{
- m_listner->setRequest(nullptr);
- m_listner->setReady(false);
+ m_listener->setRequest(nullptr);
+ m_listener->setReady(false);
}
-void tst_Dialogs::createDialog(const QLatin1String& dialog, bool &ok)
+void tst_Dialogs::createDialog(const QLatin1String &dialog, bool &ok)
{
QString trigger = QStringLiteral("document.getElementById('buttonOne').onclick = function() {document.getElementById('%1').click()}");
- QSignalSpy dialogSpy(m_listner, &TestHandler::requestChanged);
- m_listner->runJavaScript(trigger.arg(dialog));
- QTRY_VERIFY(m_listner->ready());
- QTest::mouseClick(m_widnow, Qt::LeftButton);
- QTRY_COMPARE(dialogSpy.count(), 1);
+ QSignalSpy dialogSpy(m_listener, &TestHandler::requestChanged);
+ m_listener->runJavaScript(trigger.arg(dialog));
+ QTRY_VERIFY(m_listener->ready());
+ QTest::mouseClick(m_window, Qt::LeftButton);
+ QTRY_COMPARE(dialogSpy.size(), 1);
ok = true;
}
void tst_Dialogs::colorDialogRequested()
{
- m_listner->load(QUrl("qrc:/index.html"));
- QTRY_VERIFY(m_listner->ready());
+ m_listener->load(QUrl("qrc:/index.html"));
+ QTRY_VERIFY(m_listener->ready());
bool ok = false;
createDialog(QLatin1String("colorpicker"), ok);
if (ok) {
- auto dialog = qobject_cast<QQuickWebEngineColorDialogRequest*>(m_listner->request());
+ auto *dialog = qobject_cast<QQuickWebEngineColorDialogRequest*>(m_listener->request());
QVERIFY2(dialog, "Incorrect dialog requested");
dialog->dialogReject();
QVERIFY2(dialog->isAccepted(), "Dialog is not accepted");
@@ -116,23 +92,23 @@ void tst_Dialogs::colorDialogRequested()
void tst_Dialogs::contextMenuRequested()
{
- m_listner->load(QUrl("qrc:/index.html"));
- QTRY_COMPARE_WITH_TIMEOUT(m_listner->ready(), true, 20000);
- QSignalSpy dialogSpy(m_listner, &TestHandler::requestChanged);
- QTest::mouseClick(m_widnow, Qt::RightButton);
- QTRY_COMPARE(dialogSpy.count(), 1);
- auto dialog = qobject_cast<QQuickWebEngineContextMenuRequest*>(m_listner->request());
+ m_listener->load(QUrl("qrc:/index.html"));
+ QTRY_COMPARE_WITH_TIMEOUT(m_listener->ready(), true, 20000);
+ QSignalSpy dialogSpy(m_listener, &TestHandler::requestChanged);
+ QTest::mouseClick(m_window, Qt::RightButton);
+ QTRY_COMPARE(dialogSpy.size(), 1);
+ auto dialog = qobject_cast<QWebEngineContextMenuRequest *>(m_listener->request());
QVERIFY2(dialog, "Incorrect dialog requested");
}
void tst_Dialogs::fileDialogRequested()
{
- m_listner->load(QUrl("qrc:/index.html"));
- QTRY_VERIFY(m_listner->ready());
+ m_listener->load(QUrl("qrc:/index.html"));
+ QTRY_VERIFY(m_listener->ready());
bool ok = false;
createDialog(QLatin1String("filepicker"), ok);
if (ok) {
- auto dialog = qobject_cast<QQuickWebEngineFileDialogRequest*>(m_listner->request());
+ auto dialog = qobject_cast<QQuickWebEngineFileDialogRequest*>(m_listener->request());
QVERIFY2(dialog, "Incorrect dialog requested");
dialog->dialogReject();
QVERIFY2(dialog->isAccepted(), "Dialog is not accepted");
@@ -146,7 +122,7 @@ void tst_Dialogs::authenticationDialogRequested_data()
QTest::addColumn<QUrl>("url");
QTest::addColumn<QQuickWebEngineAuthenticationDialogRequest::AuthenticationType>("type");
QTest::addColumn<QString>("realm");
- QTest::addColumn<QByteArray>("reply");
+ QTest::addColumn<QByteArray>("response");
QTest::newRow("Http Authentication Dialog") << QUrl("http://localhost:5555/")
<< QQuickWebEngineAuthenticationDialogRequest::AuthenticationTypeHTTP
<< QStringLiteral("Very Restricted Area")
@@ -166,18 +142,19 @@ void tst_Dialogs::authenticationDialogRequested()
QFETCH(QUrl, url);
QFETCH(QQuickWebEngineAuthenticationDialogRequest::AuthenticationType, type);
QFETCH(QString, realm);
+ QFETCH(QByteArray, response);
- QFETCH(QByteArray, reply);
- Server server;
- server.setReply(reply);
- server.run();
- QTRY_VERIFY2(server.isListening(), "Could not setup authentication server");
+ HttpServer server(QHostAddress::LocalHost, 5555);
+ connect(&server, &HttpServer::newRequest, [url, response](HttpReqRep *rr) {
+ rr->sendResponse(response);
+ });
+ QVERIFY(server.start());
- QSignalSpy dialogSpy(m_listner, &TestHandler::requestChanged);
- m_listner->load(url);
+ QSignalSpy dialogSpy(m_listener, &TestHandler::requestChanged);
+ m_listener->load(url);
- QTRY_COMPARE(dialogSpy.count(), 1);
- auto dialog = qobject_cast<QQuickWebEngineAuthenticationDialogRequest*>(m_listner->request());
+ QTRY_COMPARE(dialogSpy.size(), 1);
+ auto *dialog = qobject_cast<QQuickWebEngineAuthenticationDialogRequest*>(m_listener->request());
QVERIFY2(dialog, "Incorrect dialog requested");
dialog->dialogReject();
QVERIFY2(dialog->isAccepted(), "Dialog is not accepted");
@@ -185,6 +162,7 @@ void tst_Dialogs::authenticationDialogRequested()
QCOMPARE(dialog->realm(),realm);
QCOMPARE(dialog->url(), url);
QCOMPARE(dialog->proxyHost(), QStringLiteral("localhost"));
+ QVERIFY(server.stop());
}
void tst_Dialogs::javaScriptDialogRequested_data()
@@ -214,20 +192,20 @@ void tst_Dialogs::javaScriptDialogRequested()
QFETCH(QString, message);
QFETCH(QString, defaultText);
- m_listner->load(QUrl("qrc:/index.html"));
- QTRY_VERIFY(m_listner->ready());
+ m_listener->load(QUrl("qrc:/index.html"));
+ QTRY_VERIFY(m_listener->ready());
- QSignalSpy dialogSpy(m_listner, &TestHandler::requestChanged);
- m_listner->runJavaScript(script);
- QTRY_COMPARE(dialogSpy.count(), 1);
- auto dialog = qobject_cast<QQuickWebEngineJavaScriptDialogRequest*>(m_listner->request());
+ QSignalSpy dialogSpy(m_listener, &TestHandler::requestChanged);
+ m_listener->runJavaScript(script);
+ QTRY_COMPARE(dialogSpy.size(), 1);
+ auto *dialog = qobject_cast<QQuickWebEngineJavaScriptDialogRequest*>(m_listener->request());
QVERIFY2(dialog, "Incorrect dialog requested");
dialog->dialogReject();
QVERIFY2(dialog->isAccepted(), "Dialog is not accepted");
QCOMPARE(dialog->type(), type);
QCOMPARE(dialog->message(), message);
QCOMPARE(dialog->defaultText(), defaultText);
- QTRY_VERIFY(m_listner->ready()); // make sure javascript executes no longer
+ QTRY_VERIFY(m_listener->ready()); // make sure javascript executes no longer
}
static QByteArrayList params;
diff --git a/tests/auto/quick/inspectorserver/BLACKLIST b/tests/auto/quick/inspectorserver/BLACKLIST
index 92c76505a..076dd5f10 100644
--- a/tests/auto/quick/inspectorserver/BLACKLIST
+++ b/tests/auto/quick/inspectorserver/BLACKLIST
@@ -1,6 +1,2 @@
-[testRemoteDebuggingMessage]
-osx
-
[openRemoteDebuggingSession]
-osx
-msvc-2019
+macos
diff --git a/tests/auto/quick/inspectorserver/CMakeLists.txt b/tests/auto/quick/inspectorserver/CMakeLists.txt
new file mode 100644
index 000000000..d890581b8
--- /dev/null
+++ b/tests/auto/quick/inspectorserver/CMakeLists.txt
@@ -0,0 +1,12 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_test(tst_inspectorserver
+ SOURCES
+ tst_inspectorserver.cpp
+ LIBRARIES
+ Qt::CorePrivate
+ Qt::WebEngineQuickPrivate
+)
+
+
diff --git a/tests/auto/quick/html/basic_page.html b/tests/auto/quick/inspectorserver/html/basic_page.html
index 53726e4a6..53726e4a6 100644
--- a/tests/auto/quick/html/basic_page.html
+++ b/tests/auto/quick/inspectorserver/html/basic_page.html
diff --git a/tests/auto/quick/inspectorserver/inspectorserver.pro b/tests/auto/quick/inspectorserver/inspectorserver.pro
deleted file mode 100644
index fdc213f38..000000000
--- a/tests/auto/quick/inspectorserver/inspectorserver.pro
+++ /dev/null
@@ -1,4 +0,0 @@
-include(../tests.pri)
-QT += webengine
-QT_PRIVATE += core-private webengine-private webenginecore-private
-DEFINES += IMPORT_DIR=\"\\\"$${ROOT_BUILD_DIR}$${QMAKE_DIR_SEP}imports\\\"\"
diff --git a/tests/auto/quick/inspectorserver/tst_inspectorserver.cpp b/tests/auto/quick/inspectorserver/tst_inspectorserver.cpp
index 224814f7e..a9638bee4 100644
--- a/tests/auto/quick/inspectorserver/tst_inspectorserver.cpp
+++ b/tests/auto/quick/inspectorserver/tst_inspectorserver.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include <QNetworkAccessManager>
#include <QNetworkReply>
@@ -33,7 +8,8 @@
#include <QtQml/QQmlEngine>
#include <QtTest/QtTest>
#include <QQuickWebEngineProfile>
-#include <QtWebEngine/private/qquickwebengineview_p.h>
+#include <QtWebEngineQuick/private/qquickwebengineview_p.h>
+#include <QWebEnginePage>
#define INSPECTOR_SERVER_PORT "23654"
static const QUrl s_inspectorServerHttpBaseUrl("http://localhost:" INSPECTOR_SERVER_PORT);
@@ -47,6 +23,7 @@ private Q_SLOTS:
void init();
void cleanup();
+ void testDevToolsId();
void testPageList();
void testRemoteDebuggingMessage();
void openRemoteDebuggingSession();
@@ -61,8 +38,9 @@ private:
tst_InspectorServer::tst_InspectorServer()
{
+ qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--remote-allow-origins=*");
qputenv("QTWEBENGINE_REMOTE_DEBUGGING", INSPECTOR_SERVER_PORT);
- QtWebEngine::initialize();
+ QtWebEngineQuick::initialize();
QQuickWebEngineProfile::defaultProfile()->setOffTheRecord(true);
prepareWebViewComponent();
}
@@ -70,12 +48,10 @@ tst_InspectorServer::tst_InspectorServer()
void tst_InspectorServer::prepareWebViewComponent()
{
static QQmlEngine* engine = new QQmlEngine(this);
- engine->addImportPath(QString::fromUtf8(IMPORT_DIR));
-
m_component.reset(new QQmlComponent(engine, this));
- m_component->setData(QByteArrayLiteral("import QtQuick 2.0\n"
- "import QtWebEngine 1.2\n"
+ m_component->setData(QByteArrayLiteral("import QtQuick\n"
+ "import QtWebEngine\n"
"WebEngineView { }")
, QUrl());
}
@@ -105,17 +81,40 @@ inline QQuickWebEngineView* tst_InspectorServer::webView() const
QJsonArray tst_InspectorServer::fetchPageList() const
{
QNetworkAccessManager qnam;
- QScopedPointer<QNetworkReply> reply(qnam.get(QNetworkRequest(s_inspectorServerHttpBaseUrl.resolved(QUrl("json/list")))));
- QSignalSpy(reply.data(), SIGNAL(finished())).wait();
+ QSignalSpy spy(&qnam, &QNetworkAccessManager::finished);
+ QNetworkRequest request(s_inspectorServerHttpBaseUrl.resolved(QUrl("json/list")));
+ QScopedPointer<QNetworkReply> reply(qnam.get(request));
+ spy.wait();
+ // Work-around a network bug in Qt6:
+ if (reply->error() == QNetworkReply::ContentNotFoundError) {
+ reply.reset(qnam.get(request));
+ spy.wait();
+ }
return QJsonDocument::fromJson(reply->readAll()).array();
}
+void tst_InspectorServer::testDevToolsId()
+{
+ const QUrl testPageUrl = QUrl::fromLocalFile(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + QLatin1String("/html/basic_page.html"));
+ QSignalSpy loadSpy(webView(), SIGNAL(loadingChanged(QWebEngineLoadingInfo)));
+ webView()->setUrl(testPageUrl);
+ QTRY_VERIFY_WITH_TIMEOUT(loadSpy.size() && !webView()->isLoading(), 10000);
+
+ // Our page should be the only one in the list.
+ QJsonArray pageList = fetchPageList();
+ QCOMPARE(pageList.size(), 1);
+ QCOMPARE(testPageUrl.toString(), pageList.at(0).toObject().value("url").toString());
+ QCOMPARE(webView()->devToolsId(), pageList.at(0).toObject().value("id").toString());
+}
+
void tst_InspectorServer::testPageList()
{
- const QUrl testPageUrl = QUrl::fromLocalFile(QLatin1String(TESTS_SOURCE_DIR "/html/basic_page.html"));
- QSignalSpy loadSpy(webView(), SIGNAL(loadingChanged(QQuickWebEngineLoadRequest*)));
+ const QUrl testPageUrl = QUrl::fromLocalFile(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + QLatin1String("/html/basic_page.html"));
+ QSignalSpy loadSpy(webView(), SIGNAL(loadingChanged(QWebEngineLoadingInfo)));
webView()->setUrl(testPageUrl);
- QTRY_VERIFY(loadSpy.size() && !webView()->isLoading());
+ QTRY_VERIFY_WITH_TIMEOUT(loadSpy.size() && !webView()->isLoading(), 10000);
// Our page has developerExtrasEnabled and should be the only one in the list.
QJsonArray pageList = fetchPageList();
@@ -125,6 +124,12 @@ void tst_InspectorServer::testPageList()
void tst_InspectorServer::testRemoteDebuggingMessage()
{
+ const QUrl testPageUrl = QUrl::fromLocalFile(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + QLatin1String("/html/basic_page.html"));
+ QSignalSpy loadSpy(webView(), SIGNAL(loadingChanged(QWebEngineLoadingInfo)));
+ webView()->setUrl(testPageUrl);
+ QTRY_VERIFY_WITH_TIMEOUT(loadSpy.size() && !webView()->isLoading(), 10000);
+
QJsonArray pageList = fetchPageList();
QCOMPARE(pageList.size(), 1);
QVERIFY(pageList.at(0).toObject().contains("webSocketDebuggerUrl"));
@@ -149,11 +154,17 @@ void tst_InspectorServer::testRemoteDebuggingMessage()
.arg(pageList.at(0).toObject().value("webSocketDebuggerUrl").toString())
.arg(jsExpression));
- QTRY_COMPARE(webSocketQueryWebView->title(), jsExpressionResult);
+ QTRY_COMPARE_WITH_TIMEOUT(webSocketQueryWebView->title(), jsExpressionResult, 10000);
}
void tst_InspectorServer::openRemoteDebuggingSession()
{
+ const QUrl testPageUrl = QUrl::fromLocalFile(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + QLatin1String("/html/basic_page.html"));
+ QSignalSpy loadSpy(webView(), SIGNAL(loadingChanged(QWebEngineLoadingInfo)));
+ webView()->setUrl(testPageUrl);
+ QTRY_VERIFY_WITH_TIMEOUT(loadSpy.size() && !webView()->isLoading(), 10000);
+
QJsonArray pageList = fetchPageList();
QCOMPARE(pageList.size(), 1);
QVERIFY(pageList.at(0).toObject().contains("devtoolsFrontendUrl"));
@@ -167,7 +178,7 @@ void tst_InspectorServer::openRemoteDebuggingSession()
// - The page list didn't return a valid inspector URL
// - Or the front-end couldn't be loaded through the inspector HTTP server
// - Or the web socket connection couldn't be established between the front-end and the page through the inspector server
- QTRY_VERIFY_WITH_TIMEOUT(inspectorWebView->title().startsWith("DevTools -"), 30000);
+ QTRY_VERIFY_WITH_TIMEOUT(inspectorWebView->title().startsWith("DevTools -"), 60000);
}
QTEST_MAIN(tst_InspectorServer)
diff --git a/tests/auto/quick/publicapi/CMakeLists.txt b/tests/auto/quick/publicapi/CMakeLists.txt
new file mode 100644
index 000000000..e345a076a
--- /dev/null
+++ b/tests/auto/quick/publicapi/CMakeLists.txt
@@ -0,0 +1,10 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_test(tst_publicapi
+ SOURCES
+ tst_publicapi.cpp
+ LIBRARIES
+ Qt::CorePrivate
+ Qt::WebEngineQuickPrivate
+)
diff --git a/tests/auto/quick/publicapi/publicapi.pro b/tests/auto/quick/publicapi/publicapi.pro
deleted file mode 100644
index c56fd2503..000000000
--- a/tests/auto/quick/publicapi/publicapi.pro
+++ /dev/null
@@ -1,3 +0,0 @@
-include(../tests.pri)
-QT += webengine
-QT_PRIVATE += core-private webengine-private webenginecore-private
diff --git a/tests/auto/quick/publicapi/tst_publicapi.cpp b/tests/auto/quick/publicapi/tst_publicapi.cpp
index dad962576..cfa75f0bf 100644
--- a/tests/auto/quick/publicapi/tst_publicapi.cpp
+++ b/tests/auto/quick/publicapi/tst_publicapi.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include <QMetaEnum>
#include <QMetaMethod>
@@ -33,25 +8,32 @@
#include <QMetaType>
#include <QQmlListProperty>
#include <QtTest/QtTest>
-#include <QtWebEngine/QQuickWebEngineProfile>
-#include <QtWebEngine/QQuickWebEngineScript>
+#include <QtWebEngineQuick/QQuickWebEngineProfile>
+#include <QtWebEngineCore/QWebEngineCertificateError>
+#include <QtWebEngineCore/QWebEngineDesktopMediaRequest>
+#include <QtWebEngineCore/QWebEngineFileSystemAccessRequest>
#include <QtWebEngineCore/QWebEngineFindTextResult>
+#include <QtWebEngineCore/QWebEngineFullScreenRequest>
+#include <QtWebEngineCore/QWebEngineHistory>
+#include <QtWebEngineCore/QWebEngineNavigationRequest>
+#include <QtWebEngineCore/QWebEngineNewWindowRequest>
#include <QtWebEngineCore/QWebEngineNotification>
#include <QtWebEngineCore/QWebEngineQuotaRequest>
#include <QtWebEngineCore/QWebEngineRegisterProtocolHandlerRequest>
+#include <QtWebEngineCore/QWebEngineContextMenuRequest>
+#include <QtWebEngineCore/QWebEngineDownloadRequest>
+#include <QtWebEngineCore/QWebEngineScript>
+#include <QtWebEngineCore/QWebEngineLoadingInfo>
+#include <QtWebEngineCore/QWebEngineWebAuthUxRequest>
#include <private/qquickwebengineview_p.h>
#include <private/qquickwebengineaction_p.h>
-#include <private/qquickwebenginecertificateerror_p.h>
#include <private/qquickwebengineclientcertificateselection_p.h>
#include <private/qquickwebenginedialogrequests_p.h>
-#include <private/qquickwebenginedownloaditem_p.h>
-#include <private/qquickwebenginehistory_p.h>
-#include <private/qquickwebengineloadrequest_p.h>
-#include <private/qquickwebenginenavigationrequest_p.h>
-#include <private/qquickwebenginenewviewrequest_p.h>
+#include <private/qquickwebenginedownloadrequest_p.h>
+#include <private/qquickwebenginenewwindowrequest_p.h>
#include <private/qquickwebenginesettings_p.h>
#include <private/qquickwebenginesingleton_p.h>
-#include <private/qquickwebenginecontextmenurequest_p.h>
+#include <private/qquickwebenginetouchselectionmenurequest_p.h>
class tst_publicapi : public QObject {
Q_OBJECT
@@ -62,48 +44,56 @@ private Q_SLOTS:
static const QList<const QMetaObject *> typesToCheck = QList<const QMetaObject *>()
<< &QQuickWebEngineView::staticMetaObject
<< &QQuickWebEngineAction::staticMetaObject
- << &QQuickWebEngineCertificateError::staticMetaObject
<< &QQuickWebEngineClientCertificateOption::staticMetaObject
<< &QQuickWebEngineClientCertificateSelection::staticMetaObject
- << &QQuickWebEngineDownloadItem::staticMetaObject
- << &QQuickWebEngineHistory::staticMetaObject
- << &QQuickWebEngineHistoryListModel::staticMetaObject
- << &QQuickWebEngineLoadRequest::staticMetaObject
- << &QQuickWebEngineNavigationRequest::staticMetaObject
- << &QQuickWebEngineNewViewRequest::staticMetaObject
+ << &QQuickWebEngineDownloadRequest::staticMetaObject
+ << &QWebEngineDownloadRequest::staticMetaObject
+ << &QWebEngineHistory::staticMetaObject
+ << &QWebEngineHistoryModel::staticMetaObject
<< &QQuickWebEngineProfile::staticMetaObject
- << &QQuickWebEngineScript::staticMetaObject
<< &QQuickWebEngineSettings::staticMetaObject
- << &QQuickWebEngineFullScreenRequest::staticMetaObject
+ << &QWebEngineFullScreenRequest::staticMetaObject
+ << &QWebEngineScript::staticMetaObject
<< &QQuickWebEngineSingleton::staticMetaObject
<< &QQuickWebEngineAuthenticationDialogRequest::staticMetaObject
<< &QQuickWebEngineJavaScriptDialogRequest::staticMetaObject
<< &QQuickWebEngineColorDialogRequest::staticMetaObject
<< &QQuickWebEngineFileDialogRequest::staticMetaObject
- << &QQuickWebEngineFormValidationMessageRequest::staticMetaObject
+ << &QQuickWebEngineNewWindowRequest::staticMetaObject
<< &QQuickWebEngineTooltipRequest::staticMetaObject
- << &QQuickWebEngineContextMenuRequest::staticMetaObject
+ << &QWebEngineContextMenuRequest::staticMetaObject
+ << &QWebEngineCertificateError::staticMetaObject
+ << &QWebEngineDesktopMediaRequest::staticMetaObject
+ << &QWebEngineFileSystemAccessRequest::staticMetaObject
+ << &QWebEngineFindTextResult::staticMetaObject
+ << &QWebEngineLoadingInfo::staticMetaObject
+ << &QAbstractListModel::staticMetaObject
+ << &QWebEngineNavigationRequest::staticMetaObject
+ << &QWebEngineNewWindowRequest::staticMetaObject
+ << &QWebEngineNotification::staticMetaObject
<< &QWebEngineQuotaRequest::staticMetaObject
<< &QWebEngineRegisterProtocolHandlerRequest::staticMetaObject
- << &QWebEngineNotification::staticMetaObject
- << &QWebEngineFindTextResult::staticMetaObject
+ << &QQuickWebEngineTouchSelectionMenuRequest::staticMetaObject
+ << &QWebEngineWebAuthUxRequest::staticMetaObject
+ << &QWebEngineWebAuthPinRequest::staticMetaObject
;
-static QList<const char *> knownEnumNames = QList<const char *>();
+static QList<QMetaEnum> knownEnumNames = QList<QMetaEnum>()
+ << QWebEngineDownloadRequest::staticMetaObject.enumerator(QWebEngineDownloadRequest::staticMetaObject.indexOfEnumerator("SavePageFormat"))
+ ;
static const QStringList hardcodedTypes = QStringList()
<< "QJSValue"
- << "QQmlListProperty<QQuickWebEngineScript>"
+ << "QQmlListProperty<QWebEngineScript>"
<< "QQmlListProperty<QQuickWebEngineClientCertificateOption>"
<< "const QQuickWebEngineClientCertificateOption*"
<< "QQmlWebChannel*"
- // Ignore the testSupport types without making a fuss.
- << "QQuickWebEngineTestSupport*"
- << "QQuickWebEngineErrorPage*"
<< "const QQuickWebEngineContextMenuData*"
<< "QWebEngineCookieStore*"
<< "Qt::LayoutDirection"
- ;
+ << "QQuickWebEngineScriptCollection*"
+ << "QQmlComponent*"
+ << "QMultiMap<QByteArray,QByteArray>";
static const QStringList expectedAPI = QStringList()
<< "QQuickWebEngineAction.text --> QString"
@@ -119,31 +109,33 @@ static const QStringList expectedAPI = QStringList()
<< "QQuickWebEngineAuthenticationDialogRequest.dialogReject() --> void"
<< "QQuickWebEngineAuthenticationDialogRequest.proxyHost --> QString"
<< "QQuickWebEngineAuthenticationDialogRequest.realm --> QString"
- << "QQuickWebEngineAuthenticationDialogRequest.type --> AuthenticationType"
+ << "QQuickWebEngineAuthenticationDialogRequest.type --> QQuickWebEngineAuthenticationDialogRequest::AuthenticationType"
<< "QQuickWebEngineAuthenticationDialogRequest.url --> QUrl"
- << "QQuickWebEngineCertificateError.CertificateAuthorityInvalid --> Error"
- << "QQuickWebEngineCertificateError.CertificateCommonNameInvalid --> Error"
- << "QQuickWebEngineCertificateError.CertificateContainsErrors --> Error"
- << "QQuickWebEngineCertificateError.CertificateDateInvalid --> Error"
- << "QQuickWebEngineCertificateError.CertificateInvalid --> Error"
- << "QQuickWebEngineCertificateError.CertificateKnownInterceptionBlocked --> Error"
- << "QQuickWebEngineCertificateError.CertificateNameConstraintViolation --> Error"
- << "QQuickWebEngineCertificateError.CertificateNoRevocationMechanism --> Error"
- << "QQuickWebEngineCertificateError.CertificateNonUniqueName --> Error"
- << "QQuickWebEngineCertificateError.CertificateRevoked --> Error"
- << "QQuickWebEngineCertificateError.CertificateTransparencyRequired --> Error"
- << "QQuickWebEngineCertificateError.CertificateUnableToCheckRevocation --> Error"
- << "QQuickWebEngineCertificateError.CertificateValidityTooLong --> Error"
- << "QQuickWebEngineCertificateError.CertificateWeakKey --> Error"
- << "QQuickWebEngineCertificateError.CertificateWeakSignatureAlgorithm --> Error"
- << "QQuickWebEngineCertificateError.SslPinnedKeyNotInCertificateChain --> Error"
- << "QQuickWebEngineCertificateError.defer() --> void"
- << "QQuickWebEngineCertificateError.description --> QString"
- << "QQuickWebEngineCertificateError.error --> Error"
- << "QQuickWebEngineCertificateError.ignoreCertificateError() --> void"
- << "QQuickWebEngineCertificateError.overridable --> bool"
- << "QQuickWebEngineCertificateError.rejectCertificate() --> void"
- << "QQuickWebEngineCertificateError.url --> QUrl"
+ << "QWebEngineCertificateError.CertificateAuthorityInvalid --> Type"
+ << "QWebEngineCertificateError.CertificateCommonNameInvalid --> Type"
+ << "QWebEngineCertificateError.CertificateContainsErrors --> Type"
+ << "QWebEngineCertificateError.CertificateDateInvalid --> Type"
+ << "QWebEngineCertificateError.CertificateInvalid --> Type"
+ << "QWebEngineCertificateError.CertificateKnownInterceptionBlocked --> Type"
+ << "QWebEngineCertificateError.CertificateNameConstraintViolation --> Type"
+ << "QWebEngineCertificateError.CertificateNoRevocationMechanism --> Type"
+ << "QWebEngineCertificateError.CertificateNonUniqueName --> Type"
+ << "QWebEngineCertificateError.CertificateRevoked --> Type"
+ << "QWebEngineCertificateError.CertificateTransparencyRequired --> Type"
+ << "QWebEngineCertificateError.CertificateUnableToCheckRevocation --> Type"
+ << "QWebEngineCertificateError.CertificateValidityTooLong --> Type"
+ << "QWebEngineCertificateError.CertificateWeakKey --> Type"
+ << "QWebEngineCertificateError.CertificateWeakSignatureAlgorithm --> Type"
+ << "QWebEngineCertificateError.CertificateSymantecLegacy --> Type"
+ << "QWebEngineCertificateError.SslObsoleteVersion --> Type"
+ << "QWebEngineCertificateError.SslPinnedKeyNotInCertificateChain --> Type"
+ << "QWebEngineCertificateError.defer() --> void"
+ << "QWebEngineCertificateError.description --> QString"
+ << "QWebEngineCertificateError.type --> QWebEngineCertificateError::Type"
+ << "QWebEngineCertificateError.acceptCertificate() --> void"
+ << "QWebEngineCertificateError.overridable --> bool"
+ << "QWebEngineCertificateError.rejectCertificate() --> void"
+ << "QWebEngineCertificateError.url --> QUrl"
<< "QQuickWebEngineClientCertificateOption.issuer --> QString"
<< "QQuickWebEngineClientCertificateOption.subject --> QString"
<< "QQuickWebEngineClientCertificateOption.effectiveDate --> QDateTime"
@@ -157,118 +149,108 @@ static const QStringList expectedAPI = QStringList()
<< "QQuickWebEngineClientCertificateSelection.selectNone() --> void"
<< "QQuickWebEngineColorDialogRequest.accepted --> bool"
<< "QQuickWebEngineColorDialogRequest.color --> QColor"
- << "QQuickWebEngineContextMenuRequest.CanUndo --> EditFlags"
- << "QQuickWebEngineContextMenuRequest.CanRedo --> EditFlags"
- << "QQuickWebEngineContextMenuRequest.CanCut --> EditFlags"
- << "QQuickWebEngineContextMenuRequest.CanCopy --> EditFlags"
- << "QQuickWebEngineContextMenuRequest.CanPaste --> EditFlags"
- << "QQuickWebEngineContextMenuRequest.CanDelete --> EditFlags"
- << "QQuickWebEngineContextMenuRequest.CanSelectAll --> EditFlags"
- << "QQuickWebEngineContextMenuRequest.CanTranslate --> EditFlags"
- << "QQuickWebEngineContextMenuRequest.CanEditRichly --> EditFlags"
+ << "QWebEngineContextMenuRequest.CanUndo --> EditFlags"
+ << "QWebEngineContextMenuRequest.CanRedo --> EditFlags"
+ << "QWebEngineContextMenuRequest.CanCut --> EditFlags"
+ << "QWebEngineContextMenuRequest.CanCopy --> EditFlags"
+ << "QWebEngineContextMenuRequest.CanPaste --> EditFlags"
+ << "QWebEngineContextMenuRequest.CanDelete --> EditFlags"
+ << "QWebEngineContextMenuRequest.CanSelectAll --> EditFlags"
+ << "QWebEngineContextMenuRequest.CanTranslate --> EditFlags"
+ << "QWebEngineContextMenuRequest.CanEditRichly --> EditFlags"
<< "QQuickWebEngineColorDialogRequest.dialogAccept(QColor) --> void"
<< "QQuickWebEngineColorDialogRequest.dialogReject() --> void"
- << "QQuickWebEngineContextMenuRequest.editFlags --> EditFlags"
- << "QQuickWebEngineContextMenuRequest.MediaInError --> MediaFlags"
- << "QQuickWebEngineContextMenuRequest.MediaPaused --> MediaFlags"
- << "QQuickWebEngineContextMenuRequest.MediaMuted --> MediaFlags"
- << "QQuickWebEngineContextMenuRequest.MediaLoop --> MediaFlags"
- << "QQuickWebEngineContextMenuRequest.MediaCanSave --> MediaFlags"
- << "QQuickWebEngineContextMenuRequest.MediaHasAudio --> MediaFlags"
- << "QQuickWebEngineContextMenuRequest.MediaCanToggleControls --> MediaFlags"
- << "QQuickWebEngineContextMenuRequest.MediaControls --> MediaFlags"
- << "QQuickWebEngineContextMenuRequest.MediaCanPrint --> MediaFlags"
- << "QQuickWebEngineContextMenuRequest.MediaCanRotate --> MediaFlags"
- << "QQuickWebEngineContextMenuRequest.MediaTypeAudio --> MediaType"
- << "QQuickWebEngineContextMenuRequest.MediaTypeCanvas --> MediaType"
- << "QQuickWebEngineContextMenuRequest.MediaTypeFile --> MediaType"
- << "QQuickWebEngineContextMenuRequest.MediaTypeImage --> MediaType"
- << "QQuickWebEngineContextMenuRequest.MediaTypeNone --> MediaType"
- << "QQuickWebEngineContextMenuRequest.MediaTypePlugin --> MediaType"
- << "QQuickWebEngineContextMenuRequest.MediaTypeVideo --> MediaType"
- << "QQuickWebEngineContextMenuRequest.accepted --> bool"
- << "QQuickWebEngineContextMenuRequest.isContentEditable --> bool"
- << "QQuickWebEngineContextMenuRequest.linkText --> QString"
- << "QQuickWebEngineContextMenuRequest.linkUrl --> QUrl"
- << "QQuickWebEngineContextMenuRequest.mediaFlags --> MediaFlags"
- << "QQuickWebEngineContextMenuRequest.mediaType --> MediaType"
- << "QQuickWebEngineContextMenuRequest.mediaUrl --> QUrl"
- << "QQuickWebEngineContextMenuRequest.misspelledWord --> QString"
- << "QQuickWebEngineContextMenuRequest.selectedText --> QString"
- << "QQuickWebEngineContextMenuRequest.spellCheckerSuggestions --> QStringList"
- << "QQuickWebEngineContextMenuRequest.x --> int"
- << "QQuickWebEngineContextMenuRequest.y --> int"
- << "QQuickWebEngineDownloadItem.Attachment --> DownloadType"
- << "QQuickWebEngineDownloadItem.CompleteHtmlSaveFormat --> SavePageFormat"
- << "QQuickWebEngineDownloadItem.DownloadAttribute --> DownloadType"
- << "QQuickWebEngineDownloadItem.DownloadCancelled --> DownloadState"
- << "QQuickWebEngineDownloadItem.DownloadCompleted --> DownloadState"
- << "QQuickWebEngineDownloadItem.DownloadInProgress --> DownloadState"
- << "QQuickWebEngineDownloadItem.DownloadInterrupted --> DownloadState"
- << "QQuickWebEngineDownloadItem.DownloadRequested --> DownloadState"
- << "QQuickWebEngineDownloadItem.FileAccessDenied --> DownloadInterruptReason"
- << "QQuickWebEngineDownloadItem.FileBlocked --> DownloadInterruptReason"
- << "QQuickWebEngineDownloadItem.FileFailed --> DownloadInterruptReason"
- << "QQuickWebEngineDownloadItem.FileHashMismatch --> DownloadInterruptReason"
- << "QQuickWebEngineDownloadItem.FileNameTooLong --> DownloadInterruptReason"
- << "QQuickWebEngineDownloadItem.FileNoSpace --> DownloadInterruptReason"
- << "QQuickWebEngineDownloadItem.FileSecurityCheckFailed --> DownloadInterruptReason"
- << "QQuickWebEngineDownloadItem.FileTooLarge --> DownloadInterruptReason"
- << "QQuickWebEngineDownloadItem.FileTooShort --> DownloadInterruptReason"
- << "QQuickWebEngineDownloadItem.FileTransientError --> DownloadInterruptReason"
- << "QQuickWebEngineDownloadItem.FileVirusInfected --> DownloadInterruptReason"
- << "QQuickWebEngineDownloadItem.MimeHtmlSaveFormat --> SavePageFormat"
- << "QQuickWebEngineDownloadItem.NetworkDisconnected --> DownloadInterruptReason"
- << "QQuickWebEngineDownloadItem.NetworkFailed --> DownloadInterruptReason"
- << "QQuickWebEngineDownloadItem.NetworkInvalidRequest --> DownloadInterruptReason"
- << "QQuickWebEngineDownloadItem.NetworkServerDown --> DownloadInterruptReason"
- << "QQuickWebEngineDownloadItem.NetworkTimeout --> DownloadInterruptReason"
- << "QQuickWebEngineDownloadItem.NoReason --> DownloadInterruptReason"
- << "QQuickWebEngineDownloadItem.SavePage --> DownloadType"
- << "QQuickWebEngineDownloadItem.ServerBadContent --> DownloadInterruptReason"
- << "QQuickWebEngineDownloadItem.ServerCertProblem --> DownloadInterruptReason"
- << "QQuickWebEngineDownloadItem.ServerFailed --> DownloadInterruptReason"
- << "QQuickWebEngineDownloadItem.ServerForbidden --> DownloadInterruptReason"
- << "QQuickWebEngineDownloadItem.ServerUnauthorized --> DownloadInterruptReason"
- << "QQuickWebEngineDownloadItem.ServerUnreachable --> DownloadInterruptReason"
- << "QQuickWebEngineDownloadItem.SingleHtmlSaveFormat --> SavePageFormat"
- << "QQuickWebEngineDownloadItem.UnknownSaveFormat --> SavePageFormat"
- << "QQuickWebEngineDownloadItem.UserCanceled --> DownloadInterruptReason"
- << "QQuickWebEngineDownloadItem.UserRequested --> DownloadType"
- << "QQuickWebEngineDownloadItem.accept() --> void"
- << "QQuickWebEngineDownloadItem.cancel() --> void"
- << "QQuickWebEngineDownloadItem.id --> uint"
- << "QQuickWebEngineDownloadItem.interruptReason --> DownloadInterruptReason"
- << "QQuickWebEngineDownloadItem.interruptReasonChanged() --> void"
- << "QQuickWebEngineDownloadItem.interruptReasonString --> QString"
- << "QQuickWebEngineDownloadItem.isFinished --> bool"
- << "QQuickWebEngineDownloadItem.isFinishedChanged() --> void"
- << "QQuickWebEngineDownloadItem.isPaused --> bool"
- << "QQuickWebEngineDownloadItem.isPausedChanged() --> void"
- << "QQuickWebEngineDownloadItem.isSavePageDownload --> bool"
- << "QQuickWebEngineDownloadItem.mimeType --> QString"
- << "QQuickWebEngineDownloadItem.mimeTypeChanged() --> void"
- << "QQuickWebEngineDownloadItem.path --> QString"
- << "QQuickWebEngineDownloadItem.pathChanged() --> void"
- << "QQuickWebEngineDownloadItem.pause() --> void"
- << "QQuickWebEngineDownloadItem.receivedBytes --> qlonglong"
- << "QQuickWebEngineDownloadItem.receivedBytesChanged() --> void"
- << "QQuickWebEngineDownloadItem.resume() --> void"
- << "QQuickWebEngineDownloadItem.savePageFormat --> SavePageFormat"
- << "QQuickWebEngineDownloadItem.savePageFormatChanged() --> void"
- << "QQuickWebEngineDownloadItem.state --> DownloadState"
- << "QQuickWebEngineDownloadItem.stateChanged() --> void"
- << "QQuickWebEngineDownloadItem.totalBytes --> qlonglong"
- << "QQuickWebEngineDownloadItem.totalBytesChanged() --> void"
- << "QQuickWebEngineDownloadItem.type --> DownloadType"
- << "QQuickWebEngineDownloadItem.typeChanged() --> void"
- << "QQuickWebEngineDownloadItem.view --> QQuickWebEngineView*"
- << "QQuickWebEngineDownloadItem.url --> QUrl"
- << "QQuickWebEngineDownloadItem.suggestedFileName --> QString"
- << "QQuickWebEngineDownloadItem.downloadDirectory --> QString"
- << "QQuickWebEngineDownloadItem.downloadDirectoryChanged() --> void"
- << "QQuickWebEngineDownloadItem.downloadFileName --> QString"
- << "QQuickWebEngineDownloadItem.downloadFileNameChanged() --> void"
+ << "QWebEngineContextMenuRequest.editFlags --> QFlags<QWebEngineContextMenuRequest::EditFlag>"
+ << "QWebEngineContextMenuRequest.MediaInError --> MediaFlags"
+ << "QWebEngineContextMenuRequest.MediaPaused --> MediaFlags"
+ << "QWebEngineContextMenuRequest.MediaMuted --> MediaFlags"
+ << "QWebEngineContextMenuRequest.MediaLoop --> MediaFlags"
+ << "QWebEngineContextMenuRequest.MediaCanSave --> MediaFlags"
+ << "QWebEngineContextMenuRequest.MediaHasAudio --> MediaFlags"
+ << "QWebEngineContextMenuRequest.MediaCanToggleControls --> MediaFlags"
+ << "QWebEngineContextMenuRequest.MediaControls --> MediaFlags"
+ << "QWebEngineContextMenuRequest.MediaCanPrint --> MediaFlags"
+ << "QWebEngineContextMenuRequest.MediaCanRotate --> MediaFlags"
+ << "QWebEngineContextMenuRequest.MediaTypeAudio --> MediaType"
+ << "QWebEngineContextMenuRequest.MediaTypeCanvas --> MediaType"
+ << "QWebEngineContextMenuRequest.MediaTypeFile --> MediaType"
+ << "QWebEngineContextMenuRequest.MediaTypeImage --> MediaType"
+ << "QWebEngineContextMenuRequest.MediaTypeNone --> MediaType"
+ << "QWebEngineContextMenuRequest.MediaTypePlugin --> MediaType"
+ << "QWebEngineContextMenuRequest.MediaTypeVideo --> MediaType"
+ << "QWebEngineContextMenuRequest.accepted --> bool"
+ << "QWebEngineContextMenuRequest.isContentEditable --> bool"
+ << "QWebEngineContextMenuRequest.linkText --> QString"
+ << "QWebEngineContextMenuRequest.linkUrl --> QUrl"
+ << "QWebEngineContextMenuRequest.mediaFlags --> QFlags<QWebEngineContextMenuRequest::MediaFlag>"
+ << "QWebEngineContextMenuRequest.mediaType --> QWebEngineContextMenuRequest::MediaType"
+ << "QWebEngineContextMenuRequest.mediaUrl --> QUrl"
+ << "QWebEngineContextMenuRequest.misspelledWord --> QString"
+ << "QWebEngineContextMenuRequest.selectedText --> QString"
+ << "QWebEngineContextMenuRequest.spellCheckerSuggestions --> QStringList"
+ << "QWebEngineContextMenuRequest.position --> QPoint"
+ << "QWebEngineDownloadRequest.CompleteHtmlSaveFormat --> SavePageFormat"
+ << "QWebEngineDownloadRequest.DownloadCancelled --> DownloadState"
+ << "QWebEngineDownloadRequest.DownloadCompleted --> DownloadState"
+ << "QWebEngineDownloadRequest.DownloadInProgress --> DownloadState"
+ << "QWebEngineDownloadRequest.DownloadInterrupted --> DownloadState"
+ << "QWebEngineDownloadRequest.DownloadRequested --> DownloadState"
+ << "QWebEngineDownloadRequest.FileAccessDenied --> DownloadInterruptReason"
+ << "QWebEngineDownloadRequest.FileBlocked --> DownloadInterruptReason"
+ << "QWebEngineDownloadRequest.FileFailed --> DownloadInterruptReason"
+ << "QWebEngineDownloadRequest.FileHashMismatch --> DownloadInterruptReason"
+ << "QWebEngineDownloadRequest.FileNameTooLong --> DownloadInterruptReason"
+ << "QWebEngineDownloadRequest.FileNoSpace --> DownloadInterruptReason"
+ << "QWebEngineDownloadRequest.FileSecurityCheckFailed --> DownloadInterruptReason"
+ << "QWebEngineDownloadRequest.FileTooLarge --> DownloadInterruptReason"
+ << "QWebEngineDownloadRequest.FileTooShort --> DownloadInterruptReason"
+ << "QWebEngineDownloadRequest.FileTransientError --> DownloadInterruptReason"
+ << "QWebEngineDownloadRequest.FileVirusInfected --> DownloadInterruptReason"
+ << "QWebEngineDownloadRequest.MimeHtmlSaveFormat --> SavePageFormat"
+ << "QWebEngineDownloadRequest.NetworkDisconnected --> DownloadInterruptReason"
+ << "QWebEngineDownloadRequest.NetworkFailed --> DownloadInterruptReason"
+ << "QWebEngineDownloadRequest.NetworkInvalidRequest --> DownloadInterruptReason"
+ << "QWebEngineDownloadRequest.NetworkServerDown --> DownloadInterruptReason"
+ << "QWebEngineDownloadRequest.NetworkTimeout --> DownloadInterruptReason"
+ << "QWebEngineDownloadRequest.NoReason --> DownloadInterruptReason"
+ << "QWebEngineDownloadRequest.ServerBadContent --> DownloadInterruptReason"
+ << "QWebEngineDownloadRequest.ServerCertProblem --> DownloadInterruptReason"
+ << "QWebEngineDownloadRequest.ServerFailed --> DownloadInterruptReason"
+ << "QWebEngineDownloadRequest.ServerForbidden --> DownloadInterruptReason"
+ << "QWebEngineDownloadRequest.ServerUnauthorized --> DownloadInterruptReason"
+ << "QWebEngineDownloadRequest.ServerUnreachable --> DownloadInterruptReason"
+ << "QWebEngineDownloadRequest.SingleHtmlSaveFormat --> SavePageFormat"
+ << "QWebEngineDownloadRequest.UnknownSaveFormat --> SavePageFormat"
+ << "QWebEngineDownloadRequest.UserCanceled --> DownloadInterruptReason"
+ << "QWebEngineDownloadRequest.accept() --> void"
+ << "QWebEngineDownloadRequest.cancel() --> void"
+ << "QWebEngineDownloadRequest.id --> uint"
+ << "QWebEngineDownloadRequest.interruptReason --> QWebEngineDownloadRequest::DownloadInterruptReason"
+ << "QWebEngineDownloadRequest.interruptReasonChanged() --> void"
+ << "QWebEngineDownloadRequest.interruptReasonString --> QString"
+ << "QWebEngineDownloadRequest.isFinished --> bool"
+ << "QWebEngineDownloadRequest.isFinishedChanged() --> void"
+ << "QWebEngineDownloadRequest.isPaused --> bool"
+ << "QWebEngineDownloadRequest.isPausedChanged() --> void"
+ << "QWebEngineDownloadRequest.isSavePageDownload --> bool"
+ << "QWebEngineDownloadRequest.mimeType --> QString"
+ << "QWebEngineDownloadRequest.pause() --> void"
+ << "QWebEngineDownloadRequest.receivedBytes --> qlonglong"
+ << "QWebEngineDownloadRequest.receivedBytesChanged() --> void"
+ << "QWebEngineDownloadRequest.resume() --> void"
+ << "QWebEngineDownloadRequest.savePageFormat --> QWebEngineDownloadRequest::SavePageFormat"
+ << "QWebEngineDownloadRequest.savePageFormatChanged() --> void"
+ << "QWebEngineDownloadRequest.state --> QWebEngineDownloadRequest::DownloadState"
+ << "QWebEngineDownloadRequest.stateChanged(QWebEngineDownloadRequest::DownloadState) --> void"
+ << "QWebEngineDownloadRequest.totalBytes --> qlonglong"
+ << "QWebEngineDownloadRequest.totalBytesChanged() --> void"
+ << "QWebEngineDownloadRequest.url --> QUrl"
+ << "QWebEngineDownloadRequest.suggestedFileName --> QString"
+ << "QWebEngineDownloadRequest.downloadDirectory --> QString"
+ << "QWebEngineDownloadRequest.downloadDirectoryChanged() --> void"
+ << "QWebEngineDownloadRequest.downloadFileName --> QString"
+ << "QWebEngineDownloadRequest.downloadFileNameChanged() --> void"
+ << "QQuickWebEngineDownloadRequest.view --> QQuickWebEngineView*"
<< "QQuickWebEngineFileDialogRequest.FileModeOpen --> FileMode"
<< "QQuickWebEngineFileDialogRequest.FileModeOpenMultiple --> FileMode"
<< "QQuickWebEngineFileDialogRequest.FileModeSave --> FileMode"
@@ -278,32 +260,39 @@ static const QStringList expectedAPI = QStringList()
<< "QQuickWebEngineFileDialogRequest.defaultFileName --> QString"
<< "QQuickWebEngineFileDialogRequest.dialogAccept(QStringList) --> void"
<< "QQuickWebEngineFileDialogRequest.dialogReject() --> void"
- << "QQuickWebEngineFileDialogRequest.mode --> FileMode"
+ << "QQuickWebEngineFileDialogRequest.mode --> QQuickWebEngineFileDialogRequest::FileMode"
<< "QWebEngineFindTextResult.numberOfMatches --> int"
<< "QWebEngineFindTextResult.activeMatch --> int"
- << "QQuickWebEngineFormValidationMessageRequest.Hide --> RequestType"
- << "QQuickWebEngineFormValidationMessageRequest.Move --> RequestType"
- << "QQuickWebEngineFormValidationMessageRequest.Show --> RequestType"
- << "QQuickWebEngineFormValidationMessageRequest.accepted --> bool"
- << "QQuickWebEngineFormValidationMessageRequest.anchor --> QRect"
- << "QQuickWebEngineFormValidationMessageRequest.subText --> QString"
- << "QQuickWebEngineFormValidationMessageRequest.text --> QString"
- << "QQuickWebEngineFormValidationMessageRequest.type --> RequestType"
<< "QQuickWebEngineTooltipRequest.Hide --> RequestType"
<< "QQuickWebEngineTooltipRequest.Show --> RequestType"
<< "QQuickWebEngineTooltipRequest.x --> int"
<< "QQuickWebEngineTooltipRequest.y --> int"
<< "QQuickWebEngineTooltipRequest.text --> QString"
- << "QQuickWebEngineTooltipRequest.type --> RequestType"
+ << "QQuickWebEngineTooltipRequest.type --> QQuickWebEngineTooltipRequest::RequestType"
<< "QQuickWebEngineTooltipRequest.accepted --> bool"
- << "QQuickWebEngineFullScreenRequest.accept() --> void"
- << "QQuickWebEngineFullScreenRequest.origin --> QUrl"
- << "QQuickWebEngineFullScreenRequest.reject() --> void"
- << "QQuickWebEngineFullScreenRequest.toggleOn --> bool"
- << "QQuickWebEngineHistory.backItems --> QQuickWebEngineHistoryListModel*"
- << "QQuickWebEngineHistory.clear() --> void"
- << "QQuickWebEngineHistory.forwardItems --> QQuickWebEngineHistoryListModel*"
- << "QQuickWebEngineHistory.items --> QQuickWebEngineHistoryListModel*"
+ << "QWebEngineDesktopMediaRequest.screensModel --> QAbstractListModel*"
+ << "QWebEngineDesktopMediaRequest.windowsModel --> QAbstractListModel*"
+ << "QWebEngineDesktopMediaRequest.selectScreen(QModelIndex) --> void"
+ << "QWebEngineDesktopMediaRequest.selectWindow(QModelIndex) --> void"
+ << "QWebEngineDesktopMediaRequest.cancel() --> void"
+ << "QWebEngineFullScreenRequest.accept() --> void"
+ << "QWebEngineFullScreenRequest.origin --> QUrl"
+ << "QWebEngineFullScreenRequest.reject() --> void"
+ << "QWebEngineFullScreenRequest.toggleOn --> bool"
+ << "QWebEngineFileSystemAccessRequest.File --> HandleType"
+ << "QWebEngineFileSystemAccessRequest.Directory --> HandleType"
+ << "QWebEngineFileSystemAccessRequest.Read --> AccessFlags"
+ << "QWebEngineFileSystemAccessRequest.Write --> AccessFlags"
+ << "QWebEngineFileSystemAccessRequest.origin --> QUrl"
+ << "QWebEngineFileSystemAccessRequest.filePath --> QUrl"
+ << "QWebEngineFileSystemAccessRequest.handleType --> QWebEngineFileSystemAccessRequest::HandleType"
+ << "QWebEngineFileSystemAccessRequest.accessFlags --> QFlags<QWebEngineFileSystemAccessRequest::AccessFlag>"
+ << "QWebEngineFileSystemAccessRequest.accept() --> void"
+ << "QWebEngineFileSystemAccessRequest.reject() --> void"
+ << "QWebEngineHistory.backItems --> QWebEngineHistoryModel*"
+ << "QWebEngineHistory.clear() --> void"
+ << "QWebEngineHistory.forwardItems --> QWebEngineHistoryModel*"
+ << "QWebEngineHistory.items --> QWebEngineHistoryModel*"
<< "QQuickWebEngineJavaScriptDialogRequest.DialogTypeAlert --> DialogType"
<< "QQuickWebEngineJavaScriptDialogRequest.DialogTypeBeforeUnload --> DialogType"
<< "QQuickWebEngineJavaScriptDialogRequest.DialogTypeConfirm --> DialogType"
@@ -316,21 +305,51 @@ static const QStringList expectedAPI = QStringList()
<< "QQuickWebEngineJavaScriptDialogRequest.message --> QString"
<< "QQuickWebEngineJavaScriptDialogRequest.securityOrigin --> QUrl"
<< "QQuickWebEngineJavaScriptDialogRequest.title --> QString"
- << "QQuickWebEngineJavaScriptDialogRequest.type --> DialogType"
- << "QQuickWebEngineLoadRequest.errorCode --> int"
- << "QQuickWebEngineLoadRequest.errorDomain --> QQuickWebEngineView::ErrorDomain"
- << "QQuickWebEngineLoadRequest.errorString --> QString"
- << "QQuickWebEngineLoadRequest.status --> QQuickWebEngineView::LoadStatus"
- << "QQuickWebEngineLoadRequest.url --> QUrl"
- << "QQuickWebEngineNavigationRequest.action --> QQuickWebEngineView::NavigationRequestAction"
- << "QQuickWebEngineNavigationRequest.actionChanged() --> void"
- << "QQuickWebEngineNavigationRequest.isMainFrame --> bool"
- << "QQuickWebEngineNavigationRequest.navigationType --> QQuickWebEngineView::NavigationType"
- << "QQuickWebEngineNavigationRequest.url --> QUrl"
- << "QQuickWebEngineNewViewRequest.destination --> QQuickWebEngineView::NewViewDestination"
- << "QQuickWebEngineNewViewRequest.openIn(QQuickWebEngineView*) --> void"
- << "QQuickWebEngineNewViewRequest.requestedUrl --> QUrl"
- << "QQuickWebEngineNewViewRequest.userInitiated --> bool"
+ << "QQuickWebEngineJavaScriptDialogRequest.type --> QQuickWebEngineJavaScriptDialogRequest::DialogType"
+ << "QWebEngineLoadingInfo.errorCode --> int"
+ << "QWebEngineLoadingInfo.responseHeaders --> QMultiMap<QByteArray,QByteArray>"
+ << "QWebEngineLoadingInfo.errorDomain --> QWebEngineLoadingInfo::ErrorDomain"
+ << "QWebEngineLoadingInfo.errorString --> QString"
+ << "QWebEngineLoadingInfo.status --> QWebEngineLoadingInfo::LoadStatus"
+ << "QWebEngineLoadingInfo.url --> QUrl"
+ << "QWebEngineLoadingInfo.isErrorPage --> bool"
+ << "QWebEngineLoadingInfo.LoadFailedStatus --> LoadStatus"
+ << "QWebEngineLoadingInfo.LoadStartedStatus --> LoadStatus"
+ << "QWebEngineLoadingInfo.LoadStoppedStatus --> LoadStatus"
+ << "QWebEngineLoadingInfo.LoadSucceededStatus --> LoadStatus"
+ << "QWebEngineLoadingInfo.HttpStatusCodeDomain --> ErrorDomain"
+ << "QWebEngineLoadingInfo.CertificateErrorDomain --> ErrorDomain"
+ << "QWebEngineLoadingInfo.ConnectionErrorDomain --> ErrorDomain"
+ << "QWebEngineLoadingInfo.DnsErrorDomain --> ErrorDomain"
+ << "QWebEngineLoadingInfo.FtpErrorDomain --> ErrorDomain"
+ << "QWebEngineLoadingInfo.HttpErrorDomain --> ErrorDomain"
+ << "QWebEngineLoadingInfo.InternalErrorDomain --> ErrorDomain"
+ << "QWebEngineLoadingInfo.NoErrorDomain --> ErrorDomain"
+ << "QWebEngineNavigationRequest.action --> QWebEngineNavigationRequest::NavigationRequestAction"
+ << "QWebEngineNavigationRequest.actionChanged() --> void"
+ << "QWebEngineNavigationRequest.isMainFrame --> bool"
+ << "QWebEngineNavigationRequest.navigationType --> QWebEngineNavigationRequest::NavigationType"
+ << "QWebEngineNavigationRequest.url --> QUrl"
+ << "QWebEngineNavigationRequest.AcceptRequest --> NavigationRequestAction"
+ << "QWebEngineNavigationRequest.IgnoreRequest --> NavigationRequestAction"
+ << "QWebEngineNavigationRequest.BackForwardNavigation --> NavigationType"
+ << "QWebEngineNavigationRequest.FormSubmittedNavigation --> NavigationType"
+ << "QWebEngineNavigationRequest.LinkClickedNavigation --> NavigationType"
+ << "QWebEngineNavigationRequest.OtherNavigation --> NavigationType"
+ << "QWebEngineNavigationRequest.RedirectNavigation --> NavigationType"
+ << "QWebEngineNavigationRequest.ReloadNavigation --> NavigationType"
+ << "QWebEngineNavigationRequest.TypedNavigation --> NavigationType"
+ << "QWebEngineNavigationRequest.accept() --> void"
+ << "QWebEngineNavigationRequest.reject() --> void"
+ << "QWebEngineNewWindowRequest.destination --> QWebEngineNewWindowRequest::DestinationType"
+ << "QWebEngineNewWindowRequest.requestedUrl --> QUrl"
+ << "QWebEngineNewWindowRequest.requestedGeometry --> QRect"
+ << "QWebEngineNewWindowRequest.userInitiated --> bool"
+ << "QWebEngineNewWindowRequest.InNewBackgroundTab --> DestinationType"
+ << "QWebEngineNewWindowRequest.InNewDialog --> DestinationType"
+ << "QWebEngineNewWindowRequest.InNewTab --> DestinationType"
+ << "QWebEngineNewWindowRequest.InNewWindow --> DestinationType"
+ << "QQuickWebEngineNewWindowRequest.openIn(QQuickWebEngineView*) --> void"
<< "QQuickWebEngineProfile.AllowPersistentCookies --> PersistentCookiesPolicy"
<< "QQuickWebEngineProfile.DiskHttpCache --> HttpCacheType"
<< "QQuickWebEngineProfile.ForcePersistentCookies --> PersistentCookiesPolicy"
@@ -340,8 +359,9 @@ static const QStringList expectedAPI = QStringList()
<< "QQuickWebEngineProfile.cachePath --> QString"
<< "QQuickWebEngineProfile.cachePathChanged() --> void"
<< "QQuickWebEngineProfile.clearHttpCache() --> void"
- << "QQuickWebEngineProfile.downloadFinished(QQuickWebEngineDownloadItem*) --> void"
- << "QQuickWebEngineProfile.downloadRequested(QQuickWebEngineDownloadItem*) --> void"
+ << "QQuickWebEngineProfile.clearHttpCacheCompleted() --> void"
+ << "QQuickWebEngineProfile.downloadFinished(QQuickWebEngineDownloadRequest*) --> void"
+ << "QQuickWebEngineProfile.downloadRequested(QQuickWebEngineDownloadRequest*) --> void"
<< "QQuickWebEngineProfile.downloadPath --> QString"
<< "QQuickWebEngineProfile.downloadPathChanged() --> void"
<< "QQuickWebEngineProfile.presentNotification(QWebEngineNotification*) --> void"
@@ -349,50 +369,25 @@ static const QStringList expectedAPI = QStringList()
<< "QQuickWebEngineProfile.httpAcceptLanguageChanged() --> void"
<< "QQuickWebEngineProfile.httpCacheMaximumSize --> int"
<< "QQuickWebEngineProfile.httpCacheMaximumSizeChanged() --> void"
- << "QQuickWebEngineProfile.httpCacheType --> HttpCacheType"
+ << "QQuickWebEngineProfile.httpCacheType --> QQuickWebEngineProfile::HttpCacheType"
<< "QQuickWebEngineProfile.httpCacheTypeChanged() --> void"
<< "QQuickWebEngineProfile.httpUserAgent --> QString"
<< "QQuickWebEngineProfile.httpUserAgentChanged() --> void"
<< "QQuickWebEngineProfile.offTheRecord --> bool"
<< "QQuickWebEngineProfile.offTheRecordChanged() --> void"
- << "QQuickWebEngineProfile.persistentCookiesPolicy --> PersistentCookiesPolicy"
+ << "QQuickWebEngineProfile.persistentCookiesPolicy --> QQuickWebEngineProfile::PersistentCookiesPolicy"
<< "QQuickWebEngineProfile.persistentCookiesPolicyChanged() --> void"
<< "QQuickWebEngineProfile.persistentStoragePath --> QString"
<< "QQuickWebEngineProfile.persistentStoragePathChanged() --> void"
+ << "QQuickWebEngineProfile.isPushServiceEnabled --> bool"
+ << "QQuickWebEngineProfile.pushServiceEnabledChanged() --> void"
<< "QQuickWebEngineProfile.spellCheckEnabled --> bool"
<< "QQuickWebEngineProfile.spellCheckEnabledChanged() --> void"
<< "QQuickWebEngineProfile.spellCheckLanguages --> QStringList"
<< "QQuickWebEngineProfile.spellCheckLanguagesChanged() --> void"
<< "QQuickWebEngineProfile.storageName --> QString"
<< "QQuickWebEngineProfile.storageNameChanged() --> void"
- << "QQuickWebEngineProfile.useForGlobalCertificateVerification --> bool"
- << "QQuickWebEngineProfile.useForGlobalCertificateVerificationChanged() --> void"
- << "QQuickWebEngineProfile.userScripts --> QQmlListProperty<QQuickWebEngineScript>"
- << "QQuickWebEngineScript.ApplicationWorld --> ScriptWorldId"
- << "QQuickWebEngineScript.Deferred --> InjectionPoint"
- << "QQuickWebEngineScript.DocumentCreation --> InjectionPoint"
- << "QQuickWebEngineScript.DocumentReady --> InjectionPoint"
- << "QQuickWebEngineScript.MainWorld --> ScriptWorldId"
- << "QQuickWebEngineScript.UserWorld --> ScriptWorldId"
- << "QQuickWebEngineScript.injectionPoint --> InjectionPoint"
- << "QQuickWebEngineScript.injectionPointChanged(InjectionPoint) --> void"
- << "QQuickWebEngineScript.name --> QString"
- << "QQuickWebEngineScript.nameChanged(QString) --> void"
- << "QQuickWebEngineScript.runOnSubframes --> bool"
- << "QQuickWebEngineScript.runOnSubframesChanged(bool) --> void"
- << "QQuickWebEngineScript.setInjectionPoint(InjectionPoint) --> void"
- << "QQuickWebEngineScript.setName(QString) --> void"
- << "QQuickWebEngineScript.setRunOnSubframes(bool) --> void"
- << "QQuickWebEngineScript.setSourceCode(QString) --> void"
- << "QQuickWebEngineScript.setSourceUrl(QUrl) --> void"
- << "QQuickWebEngineScript.setWorldId(ScriptWorldId) --> void"
- << "QQuickWebEngineScript.sourceCode --> QString"
- << "QQuickWebEngineScript.sourceCodeChanged(QString) --> void"
- << "QQuickWebEngineScript.sourceUrl --> QUrl"
- << "QQuickWebEngineScript.sourceUrlChanged(QUrl) --> void"
- << "QQuickWebEngineScript.toString() --> QString"
- << "QQuickWebEngineScript.worldId --> ScriptWorldId"
- << "QQuickWebEngineScript.worldIdChanged(ScriptWorldId) --> void"
+ << "QQuickWebEngineProfile.userScripts --> QQuickWebEngineScriptCollection*"
<< "QQuickWebEngineSettings.AllowAllUnknownUrlSchemes --> UnknownUrlSchemePolicy"
<< "QQuickWebEngineSettings.AllowUnknownUrlSchemesFromUserInteraction --> UnknownUrlSchemePolicy"
<< "QQuickWebEngineSettings.DisallowUnknownUrlSchemes --> UnknownUrlSchemePolicy"
@@ -414,6 +409,10 @@ static const QStringList expectedAPI = QStringList()
<< "QQuickWebEngineSettings.dnsPrefetchEnabledChanged() --> void"
<< "QQuickWebEngineSettings.errorPageEnabled --> bool"
<< "QQuickWebEngineSettings.errorPageEnabledChanged() --> void"
+ << "QQuickWebEngineSettings.forceDarkMode --> bool"
+ << "QQuickWebEngineSettings.forceDarkModeChanged() --> void"
+ << "QQuickWebEngineSettings.scrollAnimatorEnabled --> bool"
+ << "QQuickWebEngineSettings.scrollAnimatorEnabledChanged() --> void"
<< "QQuickWebEngineSettings.focusOnNavigationEnabled --> bool"
<< "QQuickWebEngineSettings.focusOnNavigationEnabledChanged() --> void"
<< "QQuickWebEngineSettings.fullScreenSupportEnabled --> bool"
@@ -436,6 +435,8 @@ static const QStringList expectedAPI = QStringList()
<< "QQuickWebEngineSettings.localContentCanAccessRemoteUrlsChanged() --> void"
<< "QQuickWebEngineSettings.localStorageEnabled --> bool"
<< "QQuickWebEngineSettings.localStorageEnabledChanged() --> void"
+ << "QQuickWebEngineSettings.navigateOnDropEnabled --> bool"
+ << "QQuickWebEngineSettings.navigateOnDropEnabledChanged() --> void"
<< "QQuickWebEngineSettings.pdfViewerEnabled --> bool"
<< "QQuickWebEngineSettings.pdfViewerEnabledChanged() --> void"
<< "QQuickWebEngineSettings.playbackRequiresUserGesture --> bool"
@@ -452,18 +453,38 @@ static const QStringList expectedAPI = QStringList()
<< "QQuickWebEngineSettings.spatialNavigationEnabledChanged() --> void"
<< "QQuickWebEngineSettings.touchIconsEnabled --> bool"
<< "QQuickWebEngineSettings.touchIconsEnabledChanged() --> void"
- << "QQuickWebEngineSettings.unknownUrlSchemePolicy --> UnknownUrlSchemePolicy"
+ << "QQuickWebEngineSettings.unknownUrlSchemePolicy --> QQuickWebEngineSettings::UnknownUrlSchemePolicy"
<< "QQuickWebEngineSettings.unknownUrlSchemePolicyChanged() --> void"
<< "QQuickWebEngineSettings.webGLEnabled --> bool"
<< "QQuickWebEngineSettings.webGLEnabledChanged() --> void"
<< "QQuickWebEngineSettings.webRTCPublicInterfacesOnly --> bool"
<< "QQuickWebEngineSettings.webRTCPublicInterfacesOnlyChanged() --> void"
+ << "QQuickWebEngineSettings.readingFromCanvasEnabled --> bool"
+ << "QQuickWebEngineSettings.readingFromCanvasEnabledChanged() --> void"
<< "QQuickWebEngineSingleton.defaultProfile --> QQuickWebEngineProfile*"
<< "QQuickWebEngineSingleton.settings --> QQuickWebEngineSettings*"
+ << "QQuickWebEngineSingleton.script() --> QWebEngineScript"
+ << "QQuickWebEngineTouchSelectionMenuRequest.accepted --> bool"
+ << "QQuickWebEngineTouchSelectionMenuRequest.Cut --> TouchSelectionCommandFlags"
+ << "QQuickWebEngineTouchSelectionMenuRequest.Copy --> TouchSelectionCommandFlags"
+ << "QQuickWebEngineTouchSelectionMenuRequest.Paste --> TouchSelectionCommandFlags"
+ << "QQuickWebEngineTouchSelectionMenuRequest.selectionBounds --> QRect"
+ << "QQuickWebEngineTouchSelectionMenuRequest.touchSelectionCommandFlags --> QFlags<QQuickWebEngineTouchSelectionMenuRequest::TouchSelectionCommandFlag>"
+ << "QWebEngineScript.ApplicationWorld --> ScriptWorldId"
+ << "QWebEngineScript.Deferred --> InjectionPoint"
+ << "QWebEngineScript.DocumentCreation --> InjectionPoint"
+ << "QWebEngineScript.DocumentReady --> InjectionPoint"
+ << "QWebEngineScript.MainWorld --> ScriptWorldId"
+ << "QWebEngineScript.UserWorld --> ScriptWorldId"
+ << "QWebEngineScript.injectionPoint --> QWebEngineScript::InjectionPoint"
+ << "QWebEngineScript.name --> QString"
+ << "QWebEngineScript.runsOnSubFrames --> bool"
+ << "QWebEngineScript.sourceCode --> QString"
+ << "QWebEngineScript.sourceUrl --> QUrl"
+ << "QWebEngineScript.worldId --> uint"
<< "QQuickWebEngineView.action(WebAction) --> QQuickWebEngineAction*"
<< "QQuickWebEngineView.A0 --> PrintedPageSizeId"
<< "QQuickWebEngineView.A1 --> PrintedPageSizeId"
- << "QQuickWebEngineView.A10 --> PrintedPageSizeId"
<< "QQuickWebEngineView.A2 --> PrintedPageSizeId"
<< "QQuickWebEngineView.A3 --> PrintedPageSizeId"
<< "QQuickWebEngineView.A3Extra --> PrintedPageSizeId"
@@ -477,8 +498,8 @@ static const QStringList expectedAPI = QStringList()
<< "QQuickWebEngineView.A7 --> PrintedPageSizeId"
<< "QQuickWebEngineView.A8 --> PrintedPageSizeId"
<< "QQuickWebEngineView.A9 --> PrintedPageSizeId"
+ << "QQuickWebEngineView.A10 --> PrintedPageSizeId"
<< "QQuickWebEngineView.AbnormalTerminationStatus --> RenderProcessTerminationStatus"
- << "QQuickWebEngineView.AcceptRequest --> NavigationRequestAction"
<< "QQuickWebEngineView.AlignCenter --> WebAction"
<< "QQuickWebEngineView.AlignJustified --> WebAction"
<< "QQuickWebEngineView.AlignLeft --> WebAction"
@@ -495,7 +516,6 @@ static const QStringList expectedAPI = QStringList()
<< "QQuickWebEngineView.ArchE --> PrintedPageSizeId"
<< "QQuickWebEngineView.B0 --> PrintedPageSizeId"
<< "QQuickWebEngineView.B1 --> PrintedPageSizeId"
- << "QQuickWebEngineView.B10 --> PrintedPageSizeId"
<< "QQuickWebEngineView.B2 --> PrintedPageSizeId"
<< "QQuickWebEngineView.B3 --> PrintedPageSizeId"
<< "QQuickWebEngineView.B4 --> PrintedPageSizeId"
@@ -505,10 +525,13 @@ static const QStringList expectedAPI = QStringList()
<< "QQuickWebEngineView.B7 --> PrintedPageSizeId"
<< "QQuickWebEngineView.B8 --> PrintedPageSizeId"
<< "QQuickWebEngineView.B9 --> PrintedPageSizeId"
+ << "QQuickWebEngineView.B10 --> PrintedPageSizeId"
<< "QQuickWebEngineView.Back --> WebAction"
- << "QQuickWebEngineView.BackForwardNavigation --> NavigationType"
<< "QQuickWebEngineView.C5E --> PrintedPageSizeId"
<< "QQuickWebEngineView.CertificateErrorDomain --> ErrorDomain"
+ << "QQuickWebEngineView.ChangeTextDirectionLTR --> WebAction"
+ << "QQuickWebEngineView.ChangeTextDirectionRTL --> WebAction"
+ << "QQuickWebEngineView.ClipboardReadWrite --> Feature"
<< "QQuickWebEngineView.Comm10E --> PrintedPageSizeId"
<< "QQuickWebEngineView.ConnectionErrorDomain --> ErrorDomain"
<< "QQuickWebEngineView.Copy --> WebAction"
@@ -574,12 +597,10 @@ static const QStringList expectedAPI = QStringList()
<< "QQuickWebEngineView.FindBackward --> FindFlags"
<< "QQuickWebEngineView.FindCaseSensitively --> FindFlags"
<< "QQuickWebEngineView.Folio --> PrintedPageSizeId"
- << "QQuickWebEngineView.FormSubmittedNavigation --> NavigationType"
<< "QQuickWebEngineView.Forward --> WebAction"
<< "QQuickWebEngineView.FtpErrorDomain --> ErrorDomain"
<< "QQuickWebEngineView.Geolocation --> Feature"
<< "QQuickWebEngineView.HttpErrorDomain --> ErrorDomain"
- << "QQuickWebEngineView.IgnoreRequest --> NavigationRequestAction"
<< "QQuickWebEngineView.Imperial10x11 --> PrintedPageSizeId"
<< "QQuickWebEngineView.Imperial10x13 --> PrintedPageSizeId"
<< "QQuickWebEngineView.Imperial10x14 --> PrintedPageSizeId"
@@ -619,20 +640,14 @@ static const QStringList expectedAPI = QStringList()
<< "QQuickWebEngineView.LifecycleState.Active --> LifecycleState"
<< "QQuickWebEngineView.LifecycleState.Discarded --> LifecycleState"
<< "QQuickWebEngineView.LifecycleState.Frozen --> LifecycleState"
- << "QQuickWebEngineView.LinkClickedNavigation --> NavigationType"
<< "QQuickWebEngineView.LoadFailedStatus --> LoadStatus"
<< "QQuickWebEngineView.LoadStartedStatus --> LoadStatus"
<< "QQuickWebEngineView.LoadStoppedStatus --> LoadStatus"
<< "QQuickWebEngineView.LoadSucceededStatus --> LoadStatus"
+ << "QQuickWebEngineView.LocalFontsAccess --> Feature"
<< "QQuickWebEngineView.MediaAudioCapture --> Feature"
<< "QQuickWebEngineView.MediaAudioVideoCapture --> Feature"
<< "QQuickWebEngineView.MediaVideoCapture --> Feature"
- << "QQuickWebEngineView.NPageSize --> PrintedPageSizeId"
- << "QQuickWebEngineView.NPaperSize --> PrintedPageSizeId"
- << "QQuickWebEngineView.NewViewInBackgroundTab --> NewViewDestination"
- << "QQuickWebEngineView.NewViewInDialog --> NewViewDestination"
- << "QQuickWebEngineView.NewViewInTab --> NewViewDestination"
- << "QQuickWebEngineView.NewViewInWindow --> NewViewDestination"
<< "QQuickWebEngineView.NoErrorDomain --> ErrorDomain"
<< "QQuickWebEngineView.Notifications --> Feature"
<< "QQuickWebEngineView.NoWebAction --> WebAction"
@@ -641,7 +656,6 @@ static const QStringList expectedAPI = QStringList()
<< "QQuickWebEngineView.OpenLinkInNewTab --> WebAction"
<< "QQuickWebEngineView.OpenLinkInNewWindow --> WebAction"
<< "QQuickWebEngineView.OpenLinkInThisWindow --> WebAction"
- << "QQuickWebEngineView.OtherNavigation --> NavigationType"
<< "QQuickWebEngineView.Outdent --> WebAction"
<< "QQuickWebEngineView.Paste --> WebAction"
<< "QQuickWebEngineView.PasteAndMatchStyle --> WebAction"
@@ -651,11 +665,9 @@ static const QStringList expectedAPI = QStringList()
<< "QQuickWebEngineView.Prc32K --> PrintedPageSizeId"
<< "QQuickWebEngineView.Prc32KBig --> PrintedPageSizeId"
<< "QQuickWebEngineView.Quarto --> PrintedPageSizeId"
- << "QQuickWebEngineView.RedirectNavigation --> NavigationType"
<< "QQuickWebEngineView.Redo --> WebAction"
<< "QQuickWebEngineView.Reload --> WebAction"
<< "QQuickWebEngineView.ReloadAndBypassCache --> WebAction"
- << "QQuickWebEngineView.ReloadNavigation --> NavigationType"
<< "QQuickWebEngineView.RequestClose --> WebAction"
<< "QQuickWebEngineView.SavePage --> WebAction"
<< "QQuickWebEngineView.SelectAll --> WebAction"
@@ -673,9 +685,9 @@ static const QStringList expectedAPI = QStringList()
<< "QQuickWebEngineView.ToggleMediaPlayPause --> WebAction"
<< "QQuickWebEngineView.ToggleStrikethrough --> WebAction"
<< "QQuickWebEngineView.ToggleUnderline --> WebAction"
- << "QQuickWebEngineView.TypedNavigation --> NavigationType"
<< "QQuickWebEngineView.Undo --> WebAction"
<< "QQuickWebEngineView.Unselect --> WebAction"
+ << "QQuickWebEngineView.OpenLinkInNewBackgroundTab --> WebAction"
<< "QQuickWebEngineView.ViewSource --> WebAction"
<< "QQuickWebEngineView.WarningMessageLevel --> JavaScriptConsoleMessageLevel"
<< "QQuickWebEngineView.WebActionCount --> WebAction"
@@ -687,48 +699,65 @@ static const QStringList expectedAPI = QStringList()
<< "QQuickWebEngineView.backgroundColor --> QColor"
<< "QQuickWebEngineView.backgroundColorChanged() --> void"
<< "QQuickWebEngineView.canGoBack --> bool"
+ << "QQuickWebEngineView.canGoBackChanged() --> void"
<< "QQuickWebEngineView.canGoForward --> bool"
- << "QQuickWebEngineView.certificateError(QQuickWebEngineCertificateError*) --> void"
+ << "QQuickWebEngineView.canGoForwardChanged() --> void"
+ << "QQuickWebEngineView.certificateError(QWebEngineCertificateError) --> void"
<< "QQuickWebEngineView.colorDialogRequested(QQuickWebEngineColorDialogRequest*) --> void"
<< "QQuickWebEngineView.contentsSize --> QSizeF"
<< "QQuickWebEngineView.contentsSizeChanged(QSizeF) --> void"
- << "QQuickWebEngineView.contextMenuRequested(QQuickWebEngineContextMenuRequest*) --> void"
+ << "QQuickWebEngineView.contextMenuRequested(QWebEngineContextMenuRequest*) --> void"
+ << "QQuickWebEngineView.desktopMediaRequested(QWebEngineDesktopMediaRequest) --> void"
+ << "QQuickWebEngineView.devToolsId --> QString"
<< "QQuickWebEngineView.devToolsView --> QQuickWebEngineView*"
<< "QQuickWebEngineView.devToolsViewChanged() --> void"
- << "QQuickWebEngineView.featurePermissionRequested(QUrl,Feature) --> void"
+ << "QQuickWebEngineView.featurePermissionRequested(QUrl,QQuickWebEngineView::Feature) --> void"
<< "QQuickWebEngineView.fileDialogRequested(QQuickWebEngineFileDialogRequest*) --> void"
+ << "QQuickWebEngineView.fileSystemAccessRequested(QWebEngineFileSystemAccessRequest) --> void"
<< "QQuickWebEngineView.findText(QString) --> void"
<< "QQuickWebEngineView.findText(QString,FindFlags) --> void"
<< "QQuickWebEngineView.findText(QString,FindFlags,QJSValue) --> void"
<< "QQuickWebEngineView.findTextFinished(QWebEngineFindTextResult) --> void"
- << "QQuickWebEngineView.formValidationMessageRequested(QQuickWebEngineFormValidationMessageRequest*) --> void"
<< "QQuickWebEngineView.fullScreenCancelled() --> void"
- << "QQuickWebEngineView.fullScreenRequested(QQuickWebEngineFullScreenRequest) --> void"
+ << "QQuickWebEngineView.fullScreenRequested(QWebEngineFullScreenRequest) --> void"
<< "QQuickWebEngineView.geometryChangeRequested(QRect,QRect) --> void"
<< "QQuickWebEngineView.goBack() --> void"
<< "QQuickWebEngineView.goBackOrForward(int) --> void"
<< "QQuickWebEngineView.goForward() --> void"
- << "QQuickWebEngineView.grantFeaturePermission(QUrl,Feature,bool) --> void"
+ << "QQuickWebEngineView.grantFeaturePermission(QUrl,QQuickWebEngineView::Feature,bool) --> void"
+ << "QQuickWebEngineView.history --> QWebEngineHistory*"
<< "QQuickWebEngineView.icon --> QUrl"
<< "QQuickWebEngineView.iconChanged() --> void"
<< "QQuickWebEngineView.inspectedView --> QQuickWebEngineView*"
<< "QQuickWebEngineView.inspectedViewChanged() --> void"
<< "QQuickWebEngineView.isFullScreen --> bool"
<< "QQuickWebEngineView.isFullScreenChanged() --> void"
- << "QQuickWebEngineView.javaScriptConsoleMessage(JavaScriptConsoleMessageLevel,QString,int,QString) --> void"
+ << "QQuickWebEngineView.javaScriptConsoleMessage(QQuickWebEngineView::JavaScriptConsoleMessageLevel,QString,int,QString) --> void"
<< "QQuickWebEngineView.javaScriptDialogRequested(QQuickWebEngineJavaScriptDialogRequest*) --> void"
- << "QQuickWebEngineView.lifecycleState --> LifecycleState"
- << "QQuickWebEngineView.lifecycleStateChanged(LifecycleState) --> void"
+ << "QQuickWebEngineView.lifecycleState --> QQuickWebEngineView::LifecycleState"
+ << "QQuickWebEngineView.lifecycleStateChanged(QQuickWebEngineView::LifecycleState) --> void"
<< "QQuickWebEngineView.linkHovered(QUrl) --> void"
<< "QQuickWebEngineView.loadHtml(QString) --> void"
<< "QQuickWebEngineView.loadHtml(QString,QUrl) --> void"
<< "QQuickWebEngineView.loadProgress --> int"
<< "QQuickWebEngineView.loadProgressChanged() --> void"
<< "QQuickWebEngineView.loading --> bool"
- << "QQuickWebEngineView.loadingChanged(QQuickWebEngineLoadRequest*) --> void"
- << "QQuickWebEngineView.navigationHistory --> QQuickWebEngineHistory*"
- << "QQuickWebEngineView.navigationRequested(QQuickWebEngineNavigationRequest*) --> void"
- << "QQuickWebEngineView.newViewRequested(QQuickWebEngineNewViewRequest*) --> void"
+ << "QQuickWebEngineView.loadingChanged(QWebEngineLoadingInfo) --> void"
+ << "QQuickWebEngineView.navigationRequested(QWebEngineNavigationRequest*) --> void"
+ << "QQuickWebEngineView.newWindowRequested(QQuickWebEngineNewWindowRequest*) --> void"
+ << "QQuickWebEngineView.AcceptRequest --> NavigationRequestAction"
+ << "QQuickWebEngineView.IgnoreRequest --> NavigationRequestAction"
+ << "QQuickWebEngineView.BackForwardNavigation --> NavigationType"
+ << "QQuickWebEngineView.FormSubmittedNavigation --> NavigationType"
+ << "QQuickWebEngineView.LinkClickedNavigation --> NavigationType"
+ << "QQuickWebEngineView.OtherNavigation --> NavigationType"
+ << "QQuickWebEngineView.RedirectNavigation --> NavigationType"
+ << "QQuickWebEngineView.ReloadNavigation --> NavigationType"
+ << "QQuickWebEngineView.TypedNavigation --> NavigationType"
+ << "QQuickWebEngineView.NewViewInBackgroundTab --> NewViewDestination"
+ << "QQuickWebEngineView.NewViewInDialog --> NewViewDestination"
+ << "QQuickWebEngineView.NewViewInTab --> NewViewDestination"
+ << "QQuickWebEngineView.NewViewInWindow --> NewViewDestination"
<< "QQuickWebEngineView.pdfPrintingFinished(QString,bool) --> void"
<< "QQuickWebEngineView.printRequested() --> void"
<< "QQuickWebEngineView.printToPdf(QJSValue) --> void"
@@ -744,12 +773,12 @@ static const QStringList expectedAPI = QStringList()
<< "QQuickWebEngineView.recentlyAudibleChanged(bool) --> void"
<< "QQuickWebEngineView.renderProcessPid --> qlonglong"
<< "QQuickWebEngineView.renderProcessPidChanged(qlonglong) --> void"
- << "QQuickWebEngineView.recommendedState --> LifecycleState"
- << "QQuickWebEngineView.recommendedStateChanged(LifecycleState) --> void"
+ << "QQuickWebEngineView.recommendedState --> QQuickWebEngineView::LifecycleState"
+ << "QQuickWebEngineView.recommendedStateChanged(QQuickWebEngineView::LifecycleState) --> void"
<< "QQuickWebEngineView.registerProtocolHandlerRequested(QWebEngineRegisterProtocolHandlerRequest) --> void"
<< "QQuickWebEngineView.reload() --> void"
<< "QQuickWebEngineView.reloadAndBypassCache() --> void"
- << "QQuickWebEngineView.renderProcessTerminated(RenderProcessTerminationStatus,int) --> void"
+ << "QQuickWebEngineView.renderProcessTerminated(QQuickWebEngineView::RenderProcessTerminationStatus,int) --> void"
<< "QQuickWebEngineView.replaceMisspelledWord(QString) --> void"
<< "QQuickWebEngineView.runJavaScript(QString) --> void"
<< "QQuickWebEngineView.runJavaScript(QString,QJSValue) --> void"
@@ -761,24 +790,28 @@ static const QStringList expectedAPI = QStringList()
<< "QQuickWebEngineView.setActiveFocusOnPress(bool) --> void"
<< "QQuickWebEngineView.settings --> QQuickWebEngineSettings*"
<< "QQuickWebEngineView.stop() --> void"
-#if QT_CONFIG(webengine_testsupport)
- << "QQuickWebEngineView.testSupport --> QQuickWebEngineTestSupport*"
- << "QQuickWebEngineView.testSupportChanged() --> void"
-#endif
<< "QQuickWebEngineView.title --> QString"
<< "QQuickWebEngineView.titleChanged() --> void"
<< "QQuickWebEngineView.tooltipRequested(QQuickWebEngineTooltipRequest*) --> void"
+ << "QQuickWebEngineView.touchHandleDelegate --> QQmlComponent*"
+ << "QQuickWebEngineView.touchHandleDelegateChanged() --> void"
+ << "QQuickWebEngineView.touchSelectionMenuRequested(QQuickWebEngineTouchSelectionMenuRequest*) --> void"
<< "QQuickWebEngineView.triggerWebAction(WebAction) --> void"
<< "QQuickWebEngineView.url --> QUrl"
<< "QQuickWebEngineView.urlChanged() --> void"
- << "QQuickWebEngineView.userScripts --> QQmlListProperty<QQuickWebEngineScript>"
+ << "QQuickWebEngineView.userScripts --> QQuickWebEngineScriptCollection*"
+#if QT_CONFIG(webengine_webchannel)
<< "QQuickWebEngineView.webChannel --> QQmlWebChannel*"
+#endif
<< "QQuickWebEngineView.webChannelChanged() --> void"
<< "QQuickWebEngineView.webChannelWorld --> uint"
<< "QQuickWebEngineView.webChannelWorldChanged(uint) --> void"
<< "QQuickWebEngineView.windowCloseRequested() --> void"
<< "QQuickWebEngineView.zoomFactor --> double"
<< "QQuickWebEngineView.zoomFactorChanged(double) --> void"
+ << "QQuickWebEngineView.acceptAsNewWindow(QWebEngineNewWindowRequest*) --> void"
+ << "QQuickWebEngineView.save(QString) --> void"
+ << "QQuickWebEngineView.save(QString,QWebEngineDownloadRequest::SavePageFormat) --> void"
<< "QWebEngineQuotaRequest.accept() --> void"
<< "QWebEngineQuotaRequest.origin --> QUrl"
<< "QWebEngineQuotaRequest.reject() --> void"
@@ -797,26 +830,72 @@ static const QStringList expectedAPI = QStringList()
<< "QWebEngineNotification.click() --> void"
<< "QWebEngineNotification.close() --> void"
<< "QWebEngineNotification.closed() --> void"
+ << "QQuickWebEngineView.webAuthUxRequested(QWebEngineWebAuthUxRequest*) --> void"
+ << "QWebEngineWebAuthUxRequest.WebAuthUxState.NotStarted --> WebAuthUxState"
+ << "QWebEngineWebAuthUxRequest.WebAuthUxState.SelectAccount --> WebAuthUxState"
+ << "QWebEngineWebAuthUxRequest.WebAuthUxState.CollectPin --> WebAuthUxState"
+ << "QWebEngineWebAuthUxRequest.WebAuthUxState.FinishTokenCollection --> WebAuthUxState"
+ << "QWebEngineWebAuthUxRequest.WebAuthUxState.RequestFailed --> WebAuthUxState"
+ << "QWebEngineWebAuthUxRequest.WebAuthUxState.Cancelled --> WebAuthUxState"
+ << "QWebEngineWebAuthUxRequest.WebAuthUxState.Completed --> WebAuthUxState"
+ << "QWebEngineWebAuthUxRequest.PinEntryReason.Set --> PinEntryReason"
+ << "QWebEngineWebAuthUxRequest.PinEntryReason.Change --> PinEntryReason"
+ << "QWebEngineWebAuthUxRequest.PinEntryReason.Challenge --> PinEntryReason"
+ << "QWebEngineWebAuthUxRequest.PinEntryError.NoError --> PinEntryError"
+ << "QWebEngineWebAuthUxRequest.PinEntryError.InternalUvLocked --> PinEntryError"
+ << "QWebEngineWebAuthUxRequest.PinEntryError.WrongPin --> PinEntryError"
+ << "QWebEngineWebAuthUxRequest.PinEntryError.TooShort --> PinEntryError"
+ << "QWebEngineWebAuthUxRequest.PinEntryError.InvalidCharacters --> PinEntryError"
+ << "QWebEngineWebAuthUxRequest.PinEntryError.SameAsCurrentPin --> PinEntryError"
+ << "QWebEngineWebAuthUxRequest.RequestFailureReason.Timeout --> RequestFailureReason"
+ << "QWebEngineWebAuthUxRequest.RequestFailureReason.KeyNotRegistered --> RequestFailureReason"
+ << "QWebEngineWebAuthUxRequest.RequestFailureReason.KeyAlreadyRegistered --> RequestFailureReason"
+ << "QWebEngineWebAuthUxRequest.RequestFailureReason.SoftPinBlock --> RequestFailureReason"
+ << "QWebEngineWebAuthUxRequest.RequestFailureReason.HardPinBlock --> RequestFailureReason"
+ << "QWebEngineWebAuthUxRequest.RequestFailureReason.AuthenticatorRemovedDuringPinEntry --> RequestFailureReason"
+ << "QWebEngineWebAuthUxRequest.RequestFailureReason.AuthenticatorMissingResidentKeys --> RequestFailureReason"
+ << "QWebEngineWebAuthUxRequest.RequestFailureReason.AuthenticatorMissingUserVerification --> RequestFailureReason"
+ << "QWebEngineWebAuthUxRequest.RequestFailureReason.AuthenticatorMissingLargeBlob --> RequestFailureReason"
+ << "QWebEngineWebAuthUxRequest.RequestFailureReason.NoCommonAlgorithms --> RequestFailureReason"
+ << "QWebEngineWebAuthUxRequest.RequestFailureReason.StorageFull --> RequestFailureReason"
+ << "QWebEngineWebAuthUxRequest.RequestFailureReason.UserConsentDenied --> RequestFailureReason"
+ << "QWebEngineWebAuthUxRequest.RequestFailureReason.WinUserCancelled --> RequestFailureReason"
+ << "QWebEngineWebAuthUxRequest.userNames --> QStringList"
+ << "QWebEngineWebAuthUxRequest.state --> QWebEngineWebAuthUxRequest::WebAuthUxState"
+ << "QWebEngineWebAuthUxRequest.relyingPartyId --> QString"
+ << "QWebEngineWebAuthUxRequest.pinRequest --> QWebEngineWebAuthPinRequest"
+ << "QWebEngineWebAuthUxRequest.requestFailureReason --> QWebEngineWebAuthUxRequest::RequestFailureReason"
+ << "QWebEngineWebAuthUxRequest.stateChanged(QWebEngineWebAuthUxRequest::WebAuthUxState) --> void"
+ << "QWebEngineWebAuthUxRequest.cancel() --> void"
+ << "QWebEngineWebAuthUxRequest.retry() --> void"
+ << "QWebEngineWebAuthUxRequest.setSelectedAccount(QString) --> void"
+ << "QWebEngineWebAuthUxRequest.setPin(QString) --> void"
+ << "QWebEngineWebAuthPinRequest.reason --> QWebEngineWebAuthUxRequest::PinEntryReason"
+ << "QWebEngineWebAuthPinRequest.error --> QWebEngineWebAuthUxRequest::PinEntryError"
+ << "QWebEngineWebAuthPinRequest.minPinLength --> int"
+ << "QWebEngineWebAuthPinRequest.remainingAttempts --> int"
+ << "QQuickWebEngineSettings.AllowImageAnimation --> ImageAnimationPolicy"
+ << "QQuickWebEngineSettings.AnimateImageOnce --> ImageAnimationPolicy"
+ << "QQuickWebEngineSettings.DisallowImageAnimation --> ImageAnimationPolicy"
+ << "QQuickWebEngineSettings.imageAnimationPolicy --> QQuickWebEngineSettings::ImageAnimationPolicy"
+ << "QQuickWebEngineSettings.imageAnimationPolicyChanged() --> void"
;
-static bool isCheckedEnum(const QByteArray &typeName)
+static bool isCheckedEnum(QMetaType t)
{
- QList<QByteArray> tokens = typeName.split(':');
- if (tokens.size() == 3) {
- QByteArray &enumClass = tokens[0];
- QByteArray &enumName = tokens[2];
- for (const QMetaObject *mo : typesToCheck) {
- if (mo->className() != enumClass)
- continue;
- for (int i = mo->enumeratorOffset(); i < mo->enumeratorCount(); ++i)
- if (mo->enumerator(i).name() == enumName)
+ if (t.flags() & QMetaType::IsEnumeration) {
+ if (const QMetaObject *metaObject = t.metaObject()) {
+ QRegularExpression re("^QFlags<(.*)>$");
+ QRegularExpressionMatch match = re.match(t.name());
+ const QByteArray enumName =
+ match.hasMatch() ? match.captured(1).toUtf8() : QByteArray(t.name());
+ const char *lastColon = std::strrchr(enumName, ':');
+ QMetaEnum type = metaObject->enumerator(metaObject->indexOfEnumerator(
+ lastColon ? lastColon + 1 : enumName.constData()));
+ for (auto knownEnum : knownEnumNames) {
+ if (type.name() == knownEnum.name() && type.scope() == knownEnum.scope())
return true;
- }
- } else if (tokens.size() == 1) {
- QByteArray &enumName = tokens[0];
- for (const char *knownEnumName : qAsConst(knownEnumNames)) {
- if (enumName == knownEnumName)
- return true;
+ }
}
}
return false;
@@ -832,10 +911,12 @@ static bool isCheckedClass(const QByteArray &typeName)
return false;
}
-static void checkKnownType(const QByteArray &typeName)
+static void checkKnownType(const QMetaType &type)
{
- if ((!hardcodedTypes.contains(typeName) && !QMetaType::type(typeName)) || QMetaType::type(typeName) >= QMetaType::User) {
- bool knownEnum = isCheckedEnum(typeName);
+ const QByteArray typeName = type.name();
+ // calling id() registers the object
+ if (!hardcodedTypes.contains(typeName) && type.id() >= QMetaType::User) {
+ bool knownEnum = isCheckedEnum(type);
bool knownClass = isCheckedClass(typeName);
QVERIFY2(knownEnum || knownClass, qPrintable(QString("The API uses an unknown type [%1], you might have to add it to the typesToCheck list.").arg(typeName.constData())));
}
@@ -846,12 +927,13 @@ static void gatherAPI(const QString &prefix, const QMetaEnum &metaEnum, QStringL
const auto format = metaEnum.isScoped() ? "%1%3.%2 --> %3" : "%1%2 --> %3";
for (int i = 0; i < metaEnum.keyCount(); ++i)
*output << QString::fromLatin1(format).arg(prefix).arg(metaEnum.key(i)).arg(metaEnum.name());
+ knownEnumNames << metaEnum;
}
static void gatherAPI(const QString &prefix, const QMetaProperty &property, QStringList *output)
{
*output << QString::fromLatin1("%1%2 --> %3").arg(prefix).arg(property.name()).arg(property.typeName());
- checkKnownType(property.typeName());
+ checkKnownType(property.metaType());
}
static void gatherAPI(const QString &prefix, const QMetaMethod &method, QStringList *output)
@@ -860,20 +942,21 @@ static void gatherAPI(const QString &prefix, const QMetaMethod &method, QStringL
const char *methodTypeName = !!strlen(method.typeName()) ? method.typeName() : "void";
*output << QString::fromLatin1("%1%2 --> %3").arg(prefix).arg(QString::fromLatin1(method.methodSignature())).arg(QString::fromLatin1(methodTypeName));
- checkKnownType(methodTypeName);
- const QList<QByteArray> paramTypes = method.parameterTypes();
- for (const QByteArray &paramType : paramTypes)
- checkKnownType(paramType);
+ checkKnownType(method.returnMetaType());
+
+ const auto parameterCount = method.parameterCount();
+ for (int i = 0; i < parameterCount; ++i) {
+ const QMetaType metaType = method.parameterMetaType(i);
+ checkKnownType(metaType);
+ }
}
}
static void gatherAPI(const QString &prefix, const QMetaObject *meta, QStringList *output)
{
// *Offset points us only at the leaf class members, we don't have inheritance in our API yet anyway.
- for (int i = meta->enumeratorOffset(); i < meta->enumeratorCount(); ++i) {
- knownEnumNames << meta->enumerator(i).name();
+ for (int i = meta->enumeratorOffset(); i < meta->enumeratorCount(); ++i)
gatherAPI(prefix, meta->enumerator(i), output);
- }
for (int i = meta->propertyOffset(); i < meta->propertyCount(); ++i)
gatherAPI(prefix, meta->property(i), output);
for (int i = meta->methodOffset(); i < meta->methodCount(); ++i)
@@ -889,14 +972,14 @@ void tst_publicapi::publicAPI()
// Uncomment to print the actual API.
// QStringList sortedAPI(actualAPI);
// std::sort(sortedAPI.begin(), sortedAPI.end());
- // for (const QString &actual : qAsConst(sortedAPI))
+ // for (const QString &actual : std::as_const(sortedAPI))
// printf(" << \"%s\"\n", qPrintable(actual));
bool apiMatch = true;
// Make sure that nothing slips in the public API unintentionally.
- for (const QString &actual : qAsConst(actualAPI)) {
+ for (const QString &actual : std::as_const(actualAPI)) {
if (!expectedAPI.contains(actual)) {
- QWARN(qPrintable("Expected list is not up-to-date: " + actual));
+ qWarning("Expected list is not up-to-date: %ls", qUtf16Printable(actual));
apiMatch = false;
}
}
@@ -904,7 +987,7 @@ void tst_publicapi::publicAPI()
for (const QString &expected : expectedAPI) {
if (!actualAPI.contains(expected)) {
apiMatch = false;
- QWARN(qPrintable("Not implemented: " + expected));
+ qWarning("Not implemented: %ls", qUtf16Printable(expected));
}
}
diff --git a/tests/auto/quick/qmltests/BLACKLIST b/tests/auto/quick/qmltests/BLACKLIST
index 46bc65923..fc8f9f0d8 100644
--- a/tests/auto/quick/qmltests/BLACKLIST
+++ b/tests/auto/quick/qmltests/BLACKLIST
@@ -1,2 +1,12 @@
-[WebEngineViewSource::test_viewSourceURL]
+[NewWindowRequest::test_loadNewWindowRequest]
+macos
+
+[WebEngineViewContextMenu::test_contextMenuLinkAndSelectedText]
+macos
+
+[CertificateError::test_fatalError]
*
+
+[CertificateError::test_error]
+*
+
diff --git a/tests/auto/quick/qmltests/CMakeLists.txt b/tests/auto/quick/qmltests/CMakeLists.txt
new file mode 100644
index 000000000..daae6d60d
--- /dev/null
+++ b/tests/auto/quick/qmltests/CMakeLists.txt
@@ -0,0 +1,94 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+include(../../httpserver/httpserver.cmake)
+include(../../util/util.cmake)
+
+qt_internal_add_test(tst_qmltests
+ SOURCES
+ tst_qmltests.cpp
+ LIBRARIES
+ Qt::GuiPrivate
+ Qt::QuickTest
+ Qt::TestPrivate
+ Qt::WebEngineQuick
+ Test::HttpServer
+ Test::Util
+)
+
+set(testList
+ tst_action.qml
+ tst_activeFocusOnPress.qml
+ tst_audioMuted.qml
+ tst_contextMenu.qml
+ tst_basicProfiles.qml
+ tst_datalist.qml
+ tst_desktopBehaviorLoadHtml.qml
+ tst_download.qml
+ tst_dragHandlerUnderView.qml
+ tst_favicon.qml
+ tst_faviconDatabase.qml
+ tst_filePicker.qml
+ tst_filesystem.qml
+ tst_findText.qml
+ tst_focusOnNavigation.qml
+ tst_fullScreenRequest.qml
+ tst_getUserMedia.qml
+ tst_inputMethod.qml
+ tst_inputTextDirection.qml
+ tst_javaScriptDialogs.qml
+ tst_keyboardEvents.qml
+ tst_keyboardModifierMapping.qml
+ tst_linkHovered.qml
+ tst_loadFail.qml
+ tst_loadHtml.qml
+ tst_loadProgress.qml
+ tst_loadRecursionCrash.qml
+ tst_loadUrl.qml
+ tst_mouseClick.qml
+ tst_mouseMove.qml
+ tst_navigationHistory.qml
+ tst_navigationRequested.qml
+ tst_newViewRequest.qml
+ tst_notification.qml
+ tst_properties.qml
+ tst_runJavaScript.qml
+ tst_scrollPosition.qml
+ tst_settings.qml
+ tst_titleChanged.qml
+ tst_unhandledKeyEventPropagation.qml
+ tst_userScripts.qml
+ tst_userScriptCollection.qml
+ tst_viewSource.qml
+ tst_save.qml
+)
+
+if(QT_FEATURE_webengine_webchannel)
+ list(APPEND testList tst_webchannel.qml)
+endif()
+
+if(QT_FEATURE_ssl)
+ list(APPEND testList tst_certificateError.qml)
+endif()
+
+if (NOT APPLE)
+ list(APPEND testList tst_geopermission.qml)
+endif()
+
+set(content "")
+foreach(test ${testList})
+ set(contents "${contents}${CMAKE_CURRENT_LIST_DIR}/data/${test}\n")
+endforeach()
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/webengine.qmltests ${contents})
+
+set(tst_qmltests_resource_files
+ "resources/server.pem"
+ "resources/server.key"
+)
+
+qt_internal_add_resource(tst_qmltests "tst_qmltests"
+ PREFIX
+ "/"
+ FILES
+ ${tst_qmltests_resource_files}
+)
diff --git a/tests/auto/quick/qmltests/data/TestWebEngineView.qml b/tests/auto/quick/qmltests/data/TestWebEngineView.qml
index 6db076ae8..415985471 100644
--- a/tests/auto/quick/qmltests/data/TestWebEngineView.qml
+++ b/tests/auto/quick/qmltests/data/TestWebEngineView.qml
@@ -1,53 +1,38 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtTest 1.1
-import QtWebEngine 1.7
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import QtTest
+import QtWebEngine
WebEngineView {
property var loadStatus: null
property bool windowCloseRequestedSignalEmitted: false
settings.focusOnNavigationEnabled: true
+ function loadSucceeded() { return loadStatus == WebEngineView.LoadSucceededStatus }
+ function loadFailed() { return loadStatus == WebEngineView.LoadFailedStatus }
+ function loadStopped() { return loadStatus == WebEngineView.LoadStoppedStatus }
+
+ function waitForLoadResult(timeout) {
+ loadStatus = null
+ var r = _waitFor(function() { return loadStatus != null && loadStatus != WebEngineView.LoadStartedStatus }, timeout)
+ return r
+ }
+
function waitForLoadSucceeded(timeout) {
- var success = _waitFor(function() { return loadStatus == WebEngineView.LoadSucceededStatus }, timeout)
loadStatus = null
+ var success = _waitFor(function() { return loadStatus == WebEngineView.LoadSucceededStatus }, timeout)
return success
}
function waitForLoadFailed(timeout) {
- var failure = _waitFor(function() { return loadStatus == WebEngineView.LoadFailedStatus }, timeout)
loadStatus = null
+ var failure = _waitFor(function() { return loadStatus == WebEngineView.LoadFailedStatus }, timeout)
return failure
}
function waitForLoadStopped(timeout) {
- var stop = _waitFor(function() { return loadStatus == WebEngineView.LoadStoppedStatus }, timeout)
loadStatus = null
+ var stop = _waitFor(function() { return loadStatus == WebEngineView.LoadStoppedStatus }, timeout)
return stop
}
function waitForWindowCloseRequested() {
@@ -55,7 +40,7 @@ WebEngineView {
}
function _waitFor(predicate, timeout) {
if (timeout === undefined)
- timeout = 12000;
+ timeout = 30000;
var i = 0
while (i < timeout && !predicate()) {
testResult.wait(50)
@@ -85,12 +70,14 @@ WebEngineView {
function getElementCenter(element) {
var center;
- runJavaScript("(function() {" +
+ testCase.tryVerify(function() {
+ runJavaScript("(function() {" +
" var elem = document.getElementById('" + element + "');" +
" var rect = elem.getBoundingClientRect();" +
" return { 'x': (rect.left + rect.right) / 2, 'y': (rect.top + rect.bottom) / 2 };" +
"})();", function(result) { center = result } );
- testCase.tryVerify(function() { return center !== undefined; });
+ return center !== undefined;
+ });
return center;
}
@@ -101,11 +88,25 @@ WebEngineView {
return textSelection;
}
+ function getElementValue(element) {
+ var elementValue;
+ runJavaScript("document.getElementById('" + element + "').value", function(result) {
+ elementValue = result;
+ });
+ testCase.tryVerify(function() { return elementValue != undefined; });
+ return elementValue;
+ }
+
+ function compareElementValue(element, expected) {
+ testCase.tryVerify(function() { return expected == getElementValue(element); }, 5000,
+ "Value of element \"" + element + "\" is \"" + expected + "\"");
+ }
+
+
TestResult { id: testResult }
- TestCase { id: testCase }
- onLoadingChanged: {
- loadStatus = loadRequest.status
+ onLoadingChanged: function(load) {
+ loadStatus = load.status
}
onWindowCloseRequested: {
@@ -118,5 +119,38 @@ WebEngineView {
testCase.tryVerify(function() { return text !== undefined })
return text
}
+
+ function getItemPixel(item) {
+ var grabImage = Qt.createQmlObject("
+ import QtQuick\n
+ Image { }", testCase)
+ var itemCanvas = Qt.createQmlObject("
+ import QtQuick\n
+ Canvas { }", testCase)
+
+ // Mark QML images with objectName: "image" to be able to check if the image is loaded.
+ if (item.objectName === "image") {
+ testCase.tryVerify(function() { return item.status === Image.Ready });
+ }
+
+ item.grabToImage(function(result) {
+ grabImage.source = result.url
+ });
+ testCase.tryVerify(function() { return grabImage.status === Image.Ready });
+
+ itemCanvas.width = item.width;
+ itemCanvas.height = item.height;
+ var ctx = itemCanvas.getContext("2d");
+ ctx.drawImage(grabImage, 0, 0, grabImage.width, grabImage.height);
+ var imageData = ctx.getImageData(Math.round(itemCanvas.width/2),
+ Math.round(itemCanvas.height/2),
+ itemCanvas.width,
+ itemCanvas.height);
+
+ grabImage.destroy();
+ itemCanvas.destroy();
+
+ return imageData.data;
+ }
}
diff --git a/tests/auto/quick/qmltests2/data/accepttypes.html b/tests/auto/quick/qmltests/data/accepttypes.html
index aff39f96e..aff39f96e 100644
--- a/tests/auto/quick/qmltests2/data/accepttypes.html
+++ b/tests/auto/quick/qmltests/data/accepttypes.html
diff --git a/tests/auto/quick/qmltests2/data/alert.html b/tests/auto/quick/qmltests/data/alert.html
index 89715a727..89715a727 100644
--- a/tests/auto/quick/qmltests2/data/alert.html
+++ b/tests/auto/quick/qmltests/data/alert.html
diff --git a/tests/auto/quick/qmltests2/data/confirm.html b/tests/auto/quick/qmltests/data/confirm.html
index a4fc5b532..a4fc5b532 100644
--- a/tests/auto/quick/qmltests2/data/confirm.html
+++ b/tests/auto/quick/qmltests/data/confirm.html
diff --git a/tests/auto/quick/qmltests2/data/confirmclose.html b/tests/auto/quick/qmltests/data/confirmclose.html
index c2acbb67f..c2acbb67f 100644
--- a/tests/auto/quick/qmltests2/data/confirmclose.html
+++ b/tests/auto/quick/qmltests/data/confirmclose.html
diff --git a/tests/auto/quick/qmltests2/data/directoryupload.html b/tests/auto/quick/qmltests/data/directoryupload.html
index adc408ebb..adc408ebb 100644
--- a/tests/auto/quick/qmltests2/data/directoryupload.html
+++ b/tests/auto/quick/qmltests/data/directoryupload.html
diff --git a/tests/auto/quick/qmltests2/data/favicon-candidates-gray.html b/tests/auto/quick/qmltests/data/favicon-candidates-gray.html
index ebea35b02..ebea35b02 100644
--- a/tests/auto/quick/qmltests2/data/favicon-candidates-gray.html
+++ b/tests/auto/quick/qmltests/data/favicon-candidates-gray.html
diff --git a/tests/auto/quick/qmltests/data/favicon-misc.html b/tests/auto/quick/qmltests/data/favicon-misc.html
new file mode 100644
index 000000000..03d1086ff
--- /dev/null
+++ b/tests/auto/quick/qmltests/data/favicon-misc.html
@@ -0,0 +1,11 @@
+<html>
+ <head>
+ <title>Favicon Test</title>
+ <link rel="shortcut icon" href="icons/qt32.ico" sizes="32x32" />
+ <link rel="apple-touch-icon" href="icons/qt144.png" sizes="144x144"/>
+ <link rel="shortcut icon" href="icons/unavailable.ico" />
+ </head>
+ <body>
+ <h1>Favicon Test</h1>
+ </body>
+</html>
diff --git a/tests/auto/quick/qmltests2/data/favicon-multi-gray.html b/tests/auto/quick/qmltests/data/favicon-multi-gray.html
index 24b71640f..24b71640f 100644
--- a/tests/auto/quick/qmltests2/data/favicon-multi-gray.html
+++ b/tests/auto/quick/qmltests/data/favicon-multi-gray.html
diff --git a/tests/auto/quick/qmltests2/data/favicon-multi.html b/tests/auto/quick/qmltests/data/favicon-multi.html
index cc5f3fd66..cc5f3fd66 100644
--- a/tests/auto/quick/qmltests2/data/favicon-multi.html
+++ b/tests/auto/quick/qmltests/data/favicon-multi.html
diff --git a/tests/auto/quick/qmltests2/data/favicon-shortcut.html b/tests/auto/quick/qmltests/data/favicon-shortcut.html
index 786cdb816..786cdb816 100644
--- a/tests/auto/quick/qmltests2/data/favicon-shortcut.html
+++ b/tests/auto/quick/qmltests/data/favicon-shortcut.html
diff --git a/tests/auto/quick/qmltests2/data/favicon-single.html b/tests/auto/quick/qmltests/data/favicon-single.html
index eb4675c75..eb4675c75 100644
--- a/tests/auto/quick/qmltests2/data/favicon-single.html
+++ b/tests/auto/quick/qmltests/data/favicon-single.html
diff --git a/tests/auto/quick/qmltests2/data/favicon-touch.html b/tests/auto/quick/qmltests/data/favicon-touch.html
index 271783434..271783434 100644
--- a/tests/auto/quick/qmltests2/data/favicon-touch.html
+++ b/tests/auto/quick/qmltests/data/favicon-touch.html
diff --git a/tests/auto/quick/qmltests2/data/favicon-unavailable.html b/tests/auto/quick/qmltests/data/favicon-unavailable.html
index c45664294..c45664294 100644
--- a/tests/auto/quick/qmltests2/data/favicon-unavailable.html
+++ b/tests/auto/quick/qmltests/data/favicon-unavailable.html
diff --git a/tests/auto/quick/qmltests2/data/favicon2.html b/tests/auto/quick/qmltests/data/favicon2.html
index 81c2690fe..81c2690fe 100644
--- a/tests/auto/quick/qmltests2/data/favicon2.html
+++ b/tests/auto/quick/qmltests/data/favicon2.html
diff --git a/tests/auto/quick/qmltests/data/filesystemapi.html b/tests/auto/quick/qmltests/data/filesystemapi.html
new file mode 100644
index 000000000..ab1a33e4d
--- /dev/null
+++ b/tests/auto/quick/qmltests/data/filesystemapi.html
@@ -0,0 +1,66 @@
+<html>
+<head>
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+<title> Failed to Upload </title>
+</script>
+</head>
+
+<body>
+<button>Request File Picker</button>
+<script>
+ async function handleDirectoryEntry( dirHandle, out ) {
+ for await (const entry of dirHandle.values()) {
+ if (entry.kind === "file"){
+ const file = await entry.getFile();
+ out[ file.name ] = file;
+ }
+ if (entry.kind === "directory") {
+ const newHandle = await dirHandle.getDirectoryHandle( entry.name, { create: false } );
+ const newOut = out[ entry.name ] = {};
+ await handleDirectoryEntry( newHandle, newOut );
+ }
+ }
+ }
+ const button = document.querySelector('button');
+ button.addEventListener('click', async function() {
+ switch(window.dialogType) {
+ case "savePicker":
+ const saveFileHandle = await window.showSaveFilePicker();
+ const writable = await saveFileHandle.createWritable();
+ await writable.write(new Blob(['TEST_CONTENT']));
+ await writable.close();
+ console.log("TEST:DONE")
+ break;
+ case "filePicker":
+ let [openFileHandle] = await window.showOpenFilePicker();
+ const options = {};
+ options.mode = 'readwrite'
+ await openFileHandle.requestPermission(options)
+ const file = await openFileHandle.getFile();
+ const contents = await file.text();
+ console.log("TEST:" + contents)
+ console.log("TEST:DONE")
+ break;
+ case "directoryPicker":
+ console.log("start")
+ const dirHandle = await window.showDirectoryPicker();
+ for await (const entry of dirHandle.values()) {
+ if (entry.kind === "file"){
+ continue
+ }
+ if (entry.kind === "directory") {
+ console.log("TEST:" + entry.name)
+ }
+ }
+ console.log("TEST:DONE")
+ break;
+ default:
+ }
+ });
+ window.onload = function() {
+ window.dialogType = window.location.href.split('=')[1];
+ document.querySelector('button').focus()
+ }
+</script>
+</body>
+</html>
diff --git a/tests/auto/quick/qmltests/data/geolocation.html b/tests/auto/quick/qmltests/data/geolocation.html
index 8b116c8ee..e8c54bc58 100644
--- a/tests/auto/quick/qmltests/data/geolocation.html
+++ b/tests/auto/quick/qmltests/data/geolocation.html
@@ -3,16 +3,21 @@
<title>Geolocation Permission API Test</title>
<script>
+var errorMessage;
+var handled = false;
+
function successHandler(location) {
var message = document.getElementById("message");
message.innerHTML = "Latitude: " + location.coords.latitude +
"<br>Longitude: " + location.coords.longitude;
- console.error("Success");
+ errorMessage = "";
+ handled = true;
}
function errorHandler(error) {
- console.error(error.message);
+ errorMessage = error.message;
+ handled = true;
}
<!-- One shot example -->
diff --git a/tests/auto/quick/qmltests2/data/icons/gray128.png b/tests/auto/quick/qmltests/data/icons/gray128.png
index bf1cfaba0..bf1cfaba0 100644
--- a/tests/auto/quick/qmltests2/data/icons/gray128.png
+++ b/tests/auto/quick/qmltests/data/icons/gray128.png
Binary files differ
diff --git a/tests/auto/quick/qmltests2/data/icons/gray16.png b/tests/auto/quick/qmltests/data/icons/gray16.png
index 2a1a91a76..2a1a91a76 100644
--- a/tests/auto/quick/qmltests2/data/icons/gray16.png
+++ b/tests/auto/quick/qmltests/data/icons/gray16.png
Binary files differ
diff --git a/tests/auto/quick/qmltests2/data/icons/gray255.png b/tests/auto/quick/qmltests/data/icons/gray255.png
index 549169551..549169551 100644
--- a/tests/auto/quick/qmltests2/data/icons/gray255.png
+++ b/tests/auto/quick/qmltests/data/icons/gray255.png
Binary files differ
diff --git a/tests/auto/quick/qmltests2/data/icons/gray32.png b/tests/auto/quick/qmltests/data/icons/gray32.png
index b269a528f..b269a528f 100644
--- a/tests/auto/quick/qmltests2/data/icons/gray32.png
+++ b/tests/auto/quick/qmltests/data/icons/gray32.png
Binary files differ
diff --git a/tests/auto/quick/qmltests2/data/icons/gray64.png b/tests/auto/quick/qmltests/data/icons/gray64.png
index e02559e5b..e02559e5b 100644
--- a/tests/auto/quick/qmltests2/data/icons/gray64.png
+++ b/tests/auto/quick/qmltests/data/icons/gray64.png
Binary files differ
diff --git a/tests/auto/quick/qmltests2/data/icons/grayicons.ico b/tests/auto/quick/qmltests/data/icons/grayicons.ico
index 8d8fee839..8d8fee839 100644
--- a/tests/auto/quick/qmltests2/data/icons/grayicons.ico
+++ b/tests/auto/quick/qmltests/data/icons/grayicons.ico
Binary files differ
diff --git a/tests/auto/quick/qmltests2/data/icons/qt144.png b/tests/auto/quick/qmltests/data/icons/qt144.png
index 050b1e066..050b1e066 100644
--- a/tests/auto/quick/qmltests2/data/icons/qt144.png
+++ b/tests/auto/quick/qmltests/data/icons/qt144.png
Binary files differ
diff --git a/tests/auto/quick/qmltests2/data/icons/qt32.ico b/tests/auto/quick/qmltests/data/icons/qt32.ico
index 2f6fcb5bc..2f6fcb5bc 100644
--- a/tests/auto/quick/qmltests2/data/icons/qt32.ico
+++ b/tests/auto/quick/qmltests/data/icons/qt32.ico
Binary files differ
diff --git a/tests/auto/quick/qmltests2/data/icons/qtmulti.ico b/tests/auto/quick/qmltests/data/icons/qtmulti.ico
index 81e5a22e8..81e5a22e8 100644
--- a/tests/auto/quick/qmltests2/data/icons/qtmulti.ico
+++ b/tests/auto/quick/qmltests/data/icons/qtmulti.ico
Binary files differ
diff --git a/tests/auto/quick/qmltests2/data/icons/small-favicon.png b/tests/auto/quick/qmltests/data/icons/small-favicon.png
index 8cf9a50a4..8cf9a50a4 100644
--- a/tests/auto/quick/qmltests2/data/icons/small-favicon.png
+++ b/tests/auto/quick/qmltests/data/icons/small-favicon.png
Binary files differ
diff --git a/tests/auto/quick/qmltests2/data/multifileupload.html b/tests/auto/quick/qmltests/data/multifileupload.html
index d41ea15c0..d41ea15c0 100644
--- a/tests/auto/quick/qmltests2/data/multifileupload.html
+++ b/tests/auto/quick/qmltests/data/multifileupload.html
diff --git a/tests/auto/quick/qmltests2/data/prompt.html b/tests/auto/quick/qmltests/data/prompt.html
index 3293c0dcf..3293c0dcf 100644
--- a/tests/auto/quick/qmltests2/data/prompt.html
+++ b/tests/auto/quick/qmltests/data/prompt.html
diff --git a/tests/auto/quick/qmltests2/data/singlefileupload.html b/tests/auto/quick/qmltests/data/singlefileupload.html
index ac91c2c0d..ac91c2c0d 100644
--- a/tests/auto/quick/qmltests2/data/singlefileupload.html
+++ b/tests/auto/quick/qmltests/data/singlefileupload.html
diff --git a/tests/auto/quick/qmltests/data/test2.html b/tests/auto/quick/qmltests/data/test2.html
index 629c2a063..06b1c40cb 100644
--- a/tests/auto/quick/qmltests/data/test2.html
+++ b/tests/auto/quick/qmltests/data/test2.html
@@ -1,6 +1,6 @@
<html>
<head><title>Test page with huge link area</title></head>
<body>
-<a title="A title" href="test1.html"><img width=200 height=200></a>
+<a id="link" title="A title" href="test1.html"><div style="width:200px; height:200px; background-color:red"></div></a>
</body>
</html>
diff --git a/tests/auto/quick/qmltests/data/test4.html b/tests/auto/quick/qmltests/data/test4.html
index c9b395ee5..82830668a 100644
--- a/tests/auto/quick/qmltests/data/test4.html
+++ b/tests/auto/quick/qmltests/data/test4.html
@@ -9,7 +9,6 @@
font-size: 50px;
}
</style>
- <meta name="viewport" content="initial-scale=2.0"/>
</head>
<body>
<button onclick="scrollWin()" id="scroll">Click me to scroll!</button><br><br>
@@ -24,6 +23,7 @@
}
</script>
<div id="content">
+ <p><a id='anchor' href='#anchor'>anchor</a>
<p>bla00
<p>bla01
<p>bla02
diff --git a/tests/auto/quick/qmltests/data/titleupdate.js b/tests/auto/quick/qmltests/data/titleupdate.js
new file mode 100644
index 000000000..720e83676
--- /dev/null
+++ b/tests/auto/quick/qmltests/data/titleupdate.js
@@ -0,0 +1,17 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+function updateTitle()
+{
+ var inp = document.getElementById("upfile");
+ var allfiles = new String("");
+ var name = new String("");
+ for (var i = 0; i < inp.files.length; ++i) {
+ name = inp.files.item(i).name;
+ if (allfiles.length == 0)
+ allfiles = name;
+ else
+ allfiles = allfiles + "," + name;
+ }
+ document.title = allfiles;
+}
diff --git a/tests/auto/quick/qmltests/data/tst_action.qml b/tests/auto/quick/qmltests/data/tst_action.qml
index 852d4145a..9e49c2dbf 100644
--- a/tests/auto/quick/qmltests/data/tst_action.qml
+++ b/tests/auto/quick/qmltests/data/tst_action.qml
@@ -1,34 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.2
-import QtTest 1.0
-import QtWebEngine 1.8
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import QtTest
+import QtWebEngine
TestWebEngineView {
id: webEngineView
@@ -41,7 +16,7 @@ TestWebEngineView {
}
TestCase {
- id: actionTests
+ id: testCase
name: "WebEngineAction"
when: windowShown
@@ -90,7 +65,9 @@ TestWebEngineView {
{ webAction: WebEngineView.Indent, text: "&Indent", iconName: "", enabled: true },
{ webAction: WebEngineView.Outdent, text: "&Outdent", iconName: "", enabled: true },
{ webAction: WebEngineView.InsertOrderedList, text: "Insert &Ordered List", iconName: "", enabled: true },
- { webAction: WebEngineView.InsertUnorderedList, text: "Insert &Unordered List", iconName: "", enabled: true }
+ { webAction: WebEngineView.InsertUnorderedList, text: "Insert &Unordered List", iconName: "", enabled: true },
+ { webAction: WebEngineView.ChangeTextDirectionLTR, text: "Change text direction left to right", iconName: "", enabled: true },
+ { webAction: WebEngineView.ChangeTextDirectionRTL, text: "Change text direction right to left", iconName: "", enabled: true }
];
}
@@ -116,8 +93,8 @@ TestWebEngineView {
var stopAction = webEngineView.action(WebEngineView.Stop);
verify(stopAction);
- var triggerSpy = createTemporaryObject(signalSpy, actionTests, {target: selectAction, signalName: "triggered"});
- var stopTriggerSpy = createTemporaryObject(signalSpy, actionTests, {target: stopAction, signalName: "triggered"});
+ var triggerSpy = createTemporaryObject(signalSpy, testCase, {target: selectAction, signalName: "triggered"});
+ var stopTriggerSpy = createTemporaryObject(signalSpy, testCase, {target: stopAction, signalName: "triggered"});
verify(selectAction.enabled);
selectAction.trigger();
@@ -148,7 +125,7 @@ TestWebEngineView {
compare(enabledSpy.count, 0);
selectAllAction.trigger();
compare(triggerSpy.count, 0);
- compare(getTextSelection(), "");
+ compare(webEngineView.getTextSelection(), "");
// Focus content by focusing window from JavaScript. Edit actions should be enabled and functional.
webView.runJavaScript("window.focus();");
@@ -157,6 +134,7 @@ TestWebEngineView {
selectAllAction.trigger();
compare(triggerSpy.count, 1);
tryVerify(function() { return webView.getTextSelection() === "foo bar" });
+ webView.destroy();
}
function test_editActionsWithInitialFocus() {
@@ -180,6 +158,7 @@ TestWebEngineView {
selectAllAction.trigger();
compare(triggerSpy.count, 1);
tryVerify(function() { return webView.getTextSelection() === "foo bar" });
+ webView.destroy();
}
}
}
diff --git a/tests/auto/quick/qmltests/data/tst_activeFocusOnPress.qml b/tests/auto/quick/qmltests/data/tst_activeFocusOnPress.qml
index c360a1da2..77968f6b6 100644
--- a/tests/auto/quick/qmltests/data/tst_activeFocusOnPress.qml
+++ b/tests/auto/quick/qmltests/data/tst_activeFocusOnPress.qml
@@ -1,33 +1,8 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-import QtQuick 2.5
-import QtTest 1.0
+import QtQuick
+import QtTest
Item {
id: root
@@ -55,6 +30,7 @@ Item {
}
TestCase {
+ id: testCase
name: "ActiveFocusOnPress"
when:windowShown
diff --git a/tests/auto/quick/qmltests/data/tst_audioMuted.qml b/tests/auto/quick/qmltests/data/tst_audioMuted.qml
index c626d07a0..85f813f0c 100644
--- a/tests/auto/quick/qmltests/data/tst_audioMuted.qml
+++ b/tests/auto/quick/qmltests/data/tst_audioMuted.qml
@@ -1,34 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.4
+import QtQuick
+import QtTest
+import QtWebEngine
TestWebEngineView {
id: view
@@ -42,7 +17,7 @@ TestWebEngineView {
}
TestCase {
- id: test
+ id: testCase
name: "WebEngineViewAudioMuted"
function test_audioMuted() {
diff --git a/tests/auto/quick/qmltests/data/tst_basicProfiles.qml b/tests/auto/quick/qmltests/data/tst_basicProfiles.qml
new file mode 100644
index 000000000..97a25cdd8
--- /dev/null
+++ b/tests/auto/quick/qmltests/data/tst_basicProfiles.qml
@@ -0,0 +1,90 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import QtTest
+import QtWebEngine
+import Qt.labs.platform
+
+Item {
+ WebEngineProfile { id: otrProfile; /* MEMO implicit offTheRecord: true */ }
+ WebEngineProfile { id: nonOtrProfile; offTheRecord: false }
+
+ function getPath(path, offset = 1) { return path.substr(path.indexOf(':') + offset, path.length) }
+ property string appDataLocation: getPath(getPath(StandardPaths.writableLocation(StandardPaths.AppDataLocation).toString(), 3))
+ property string cacheLocation: getPath(getPath(StandardPaths.writableLocation(StandardPaths.CacheLocation).toString(), 3))
+ property string downloadLocation: getPath(getPath(StandardPaths.writableLocation(StandardPaths.DownloadLocation).toString(), 3))
+
+ TestCase {
+ name: "BasicProfiles"
+
+ function test_defaultProfile() {
+ let p = WebEngine.defaultProfile
+ verify(p.offTheRecord)
+
+ compare(p.storageName, '')
+ compare(p.cachePath, '')
+ compare(getPath(p.persistentStoragePath), appDataLocation + '/QtWebEngine/OffTheRecord')
+ compare(p.httpCacheType, WebEngineProfile.MemoryHttpCache)
+ compare(p.httpCacheMaximumSize, 0)
+ compare(p.persistentCookiesPolicy, WebEngineProfile.NoPersistentCookies)
+
+ compare(getPath(p.downloadPath), downloadLocation)
+ compare(p.httpAcceptLanguage, '')
+ verify(p.httpUserAgent !== '')
+ compare(p.spellCheckEnabled, false)
+ compare(p.spellCheckLanguages, [])
+
+ compare(p.userScripts.collection, [])
+ }
+
+ function test_otrProfile() {
+ let p = otrProfile
+ verify(p.offTheRecord)
+
+ compare(p.storageName, '')
+ compare(p.cachePath, '')
+ compare(getPath(p.persistentStoragePath), appDataLocation + '/QtWebEngine/OffTheRecord')
+ compare(p.httpCacheType, WebEngineProfile.MemoryHttpCache)
+ compare(p.httpCacheMaximumSize, 0)
+ compare(p.persistentCookiesPolicy, WebEngineProfile.NoPersistentCookies)
+
+ compare(getPath(p.downloadPath), downloadLocation)
+ compare(p.httpAcceptLanguage, '')
+ verify(p.httpUserAgent !== '')
+ compare(p.spellCheckEnabled, false)
+ compare(p.spellCheckLanguages, [])
+
+ compare(p.userScripts.collection, [])
+ }
+
+ function test_nonOtrProfile() {
+ let p = nonOtrProfile
+ verify(!p.offTheRecord)
+
+ compare(p.storageName, '')
+ compare(p.cachePath, '')
+ compare(getPath(p.persistentStoragePath), appDataLocation + '/QtWebEngine/UnknownProfile')
+ compare(p.httpCacheType, WebEngineProfile.MemoryHttpCache)
+ compare(p.httpCacheMaximumSize, 0)
+ compare(p.persistentCookiesPolicy, WebEngineProfile.NoPersistentCookies)
+
+ compare(getPath(p.downloadPath), downloadLocation)
+ compare(p.httpAcceptLanguage, '')
+ verify(p.httpUserAgent !== '')
+ compare(p.spellCheckEnabled, false)
+ compare(p.spellCheckLanguages, [])
+
+ compare(p.userScripts.collection, [])
+
+ p.storageName = 'Test'
+ compare(p.storageName, 'Test')
+ compare(getPath(p.cachePath), cacheLocation + '/QtWebEngine/' + p.storageName)
+ compare(getPath(p.persistentStoragePath), appDataLocation + '/QtWebEngine/' + p.storageName)
+
+ compare(p.httpCacheType, WebEngineProfile.DiskHttpCache)
+ compare(p.httpCacheMaximumSize, 0)
+ compare(p.persistentCookiesPolicy, WebEngineProfile.AllowPersistentCookies)
+ }
+ }
+}
diff --git a/tests/auto/quick/qmltests/data/tst_certificateError.qml b/tests/auto/quick/qmltests/data/tst_certificateError.qml
index 0629be175..220ef9ac8 100644
--- a/tests/auto/quick/qmltests/data/tst_certificateError.qml
+++ b/tests/auto/quick/qmltests/data/tst_certificateError.qml
@@ -1,36 +1,11 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.2
-import QtTest 1.0
-import QtWebEngine 1.9
-
-import Test.Shared 1.0 as Shared
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import QtTest
+import QtWebEngine
+
+import Test.Shared as Shared
TestWebEngineView {
id: view; width: 320; height: 320
@@ -38,15 +13,6 @@ TestWebEngineView {
property bool deferError: false
property bool acceptCertificate: false
- onCertificateError: function(error) {
- if (deferError)
- error.defer()
- else if (acceptCertificate)
- error.ignoreCertificateError()
- else
- error.rejectCertificate()
- }
-
SignalSpy {
id: spyError
target: view
@@ -54,6 +20,7 @@ TestWebEngineView {
}
TestCase {
+ id: testCase
name: 'CertificateError'
when: windowShown
@@ -88,7 +55,18 @@ TestWebEngineView {
function test_error(data) {
view.deferError = data.deferError
view.acceptCertificate = data.acceptCertificate
- view.url = Shared.HttpsServer.url()
+ var handleCertificateError = function(error) {
+ if (deferError)
+ error.defer()
+ else if (acceptCertificate)
+ error.acceptCertificate()
+ else
+ error.rejectCertificate()
+ }
+ view.certificateError.connect(handleCertificateError)
+
+ const server_url = Shared.HttpsServer.url()
+ view.url = server_url
if (data.deferError) {
spyError.wait()
@@ -97,7 +75,7 @@ TestWebEngineView {
let error = spyError.signalArguments[0][0]
if (data.acceptCertificate)
- error.ignoreCertificateError()
+ error.acceptCertificate()
else
error.rejectCertificate()
}
@@ -109,6 +87,36 @@ TestWebEngineView {
compare(spyError.count, 1)
compare(data.expectedContent, view.getBodyText())
+
+ view.certificateError.disconnect(handleCertificateError)
+
+ let error = spyError.signalArguments[0][0]
+ compare(error.url, server_url)
+ verify(error.description.length > 0)
+ verify(error.overridable)
+ compare(error.type, WebEngineCertificateError.CertificateAuthorityInvalid)
+ }
+
+ function test_fatalError() {
+ let error = undefined
+ var handleCertificateError = function(e) { error = e; }
+ view.certificateError.connect(handleCertificateError);
+
+ view.url = Qt.resolvedUrl('https://revoked.badssl.com');
+ if (!view.waitForLoadResult()) {
+ verify(!error, "There shouldn't be any certificate error if not loaded due to missing internet access!");
+ skip("Couldn't load page from network, skipping test.");
+ }
+ view.certificateError.disconnect(handleCertificateError);
+
+ // revoked certificate might not be reported as invalid by chromium and the load will silently succeed
+ const failed = view.loadStatus == WebEngineView.LoadFailedStatus, hasError = Boolean(error)
+ compare(hasError, failed)
+ if (failed) {
+ verify(!error.overridable);
+ // Fatal certificate errors are implicitly rejected. But second call should not cause crash.
+ error.rejectCertificate();
+ }
}
}
}
diff --git a/tests/auto/quick/qmltests/data/tst_contextMenu.qml b/tests/auto/quick/qmltests/data/tst_contextMenu.qml
index 99450a159..58e27b8ba 100644
--- a/tests/auto/quick/qmltests/data/tst_contextMenu.qml
+++ b/tests/auto/quick/qmltests/data/tst_contextMenu.qml
@@ -1,35 +1,10 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtQuick.Controls 1.4
-import QtTest 1.0
-import QtWebEngine 1.6
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import QtTest
+import QtWebEngine
+import "../mock-delegates/TestParams"
TestWebEngineView {
id: webEngineView
@@ -40,7 +15,7 @@ TestWebEngineView {
property var mediaType: null
property string selectedText: ""
- onContextMenuRequested: {
+ onContextMenuRequested: function (request) {
linkText = request.linkText;
mediaType = request.mediaType;
selectedText = request.selectedText;
@@ -52,38 +27,20 @@ TestWebEngineView {
signalName: "contextMenuRequested"
}
- function getContextMenus() {
- var data = webEngineView.data;
- var contextMenus = [];
-
- for (var i = 0; i < data.length; i++) {
- if (data[i].type == MenuItemType.Menu) {
- contextMenus.push(data[i]);
- }
- }
- return contextMenus;
- }
-
- function destroyContextMenu() {
- contextMenuTest.keyPress(Qt.Key_Escape);
- return getContextMenus().length == 0;
- }
-
TestCase {
- id: contextMenuTest
+ id: testCase
name: "WebEngineViewContextMenu"
when: windowShown
function init() {
- var contextMenus = getContextMenus();
- compare(contextMenus.length, 0);
+ MenuParams.isMenuOpened = false;
}
function cleanup() {
contextMenuRequestedSpy.clear();
}
- function test_contextMenu_data() {
+ function test_contextMenuRequest_data() {
return [
{ tag: "defaultContextMenu", userHandled: false, accepted: false },
{ tag: "defaultContextMenuWithConnect", userHandled: true, accepted: false },
@@ -91,11 +48,7 @@ TestWebEngineView {
];
}
- function test_contextMenu(row) {
- if (Qt.platform.os == "osx") {
- skip("When the menu pops up on macOS, it does not return and the test fails after time out.");
- }
-
+ function test_contextMenuRequest(row) {
function contextMenuHandler(request) {
request.accepted = row.accepted;
}
@@ -109,22 +62,12 @@ TestWebEngineView {
mouseClick(webEngineView, 20, 20, Qt.RightButton);
contextMenuRequestedSpy.wait();
compare(contextMenuRequestedSpy.count, 1);
+ tryCompare(MenuParams, "isMenuOpened", !row.accepted);
- // There should be maximum one ContextMenu present at a time
- var contextMenus = getContextMenus();
- verify(contextMenus.length <= 1);
- compare(contextMenus[0] != null, !row.accepted);
-
- // FIXME: Sometimes the keyPress(Qt.Key_Escape) event isn't caught so we keep trying
- tryVerify(destroyContextMenu);
webEngineView.contextMenuRequested.disconnect(contextMenuHandler);
}
function test_contextMenuLinkAndSelectedText() {
- if (Qt.platform.os == "osx") {
- skip("When the menu pops up on macOS, it does not return and the test fails after time out.");
- }
-
webEngineView.loadHtml("<html><body>" +
"<span id='text'>Text </span>" +
"<a id='link' href='test1.html'>Link</a>" +
@@ -137,9 +80,6 @@ TestWebEngineView {
contextMenuRequestedSpy.wait();
compare(contextMenuRequestedSpy.count, 1);
- var contextMenus = getContextMenus();
- compare(contextMenus.length, 1);
- verify(contextMenus[0]);
compare(linkText, "Link");
compare(mediaType, ContextMenuRequest.MediaTypeNone);
compare(selectedText, "");
@@ -150,8 +90,6 @@ TestWebEngineView {
verify(webEngineView.action(WebEngineView.CopyLinkToClipboard).enabled);
contextMenuRequestedSpy.clear();
- // FIXME: Sometimes the keyPress(Qt.Key_Escape) event isn't caught so we keep trying
- tryVerify(destroyContextMenu);
// 2. Everything is selected, right click on the link
webEngineView.triggerWebAction(WebEngineView.SelectAll);
@@ -161,16 +99,11 @@ TestWebEngineView {
contextMenuRequestedSpy.wait();
compare(contextMenuRequestedSpy.count, 1);
- contextMenus = getContextMenus();
- compare(contextMenus.length, 1);
- verify(contextMenus[0]);
compare(linkText, "Link");
compare(mediaType, ContextMenuRequest.MediaTypeNone);
compare(selectedText, "Text Link");
contextMenuRequestedSpy.clear();
- // FIXME: Sometimes the keyPress(Qt.Key_Escape) event isn't caught so we keep trying
- tryVerify(destroyContextMenu);
// 3. Everything is selected, right click on the text
var textCenter = getElementCenter("text");
@@ -178,22 +111,12 @@ TestWebEngineView {
contextMenuRequestedSpy.wait();
compare(contextMenuRequestedSpy.count, 1);
- contextMenus = getContextMenus();
- compare(contextMenus.length, 1);
- verify(contextMenus[0]);
compare(linkText, "");
compare(mediaType, ContextMenuRequest.MediaTypeNone);
compare(selectedText, "Text Link");
-
- // FIXME: Sometimes the keyPress(Qt.Key_Escape) event isn't caught so we keep trying
- tryVerify(destroyContextMenu);
}
function test_contextMenuMediaType() {
- if (Qt.platform.os == "osx") {
- skip("When the menu pops up on macOS, it does not return and the test fails after time out.");
- }
-
webEngineView.url = Qt.resolvedUrl("favicon.html");
verify(webEngineView.waitForLoadSucceeded());
// 1. Right click on the image
@@ -202,30 +125,19 @@ TestWebEngineView {
contextMenuRequestedSpy.wait();
compare(contextMenuRequestedSpy.count, 1);
- var contextMenus = getContextMenus();
- compare(contextMenus.length, 1);
- verify(contextMenus[0]);
compare(linkText, "");
compare(mediaType, ContextMenuRequest.MediaTypeImage);
compare(selectedText, "");
contextMenuRequestedSpy.clear();
- // FIXME: Sometimes the keyPress(Qt.Key_Escape) event isn't caught so we keep trying
- tryVerify(destroyContextMenu);
// 2. Right click out of the image
mouseClick(webEngineView, center.x + 30, center.y, Qt.RightButton);
contextMenuRequestedSpy.wait();
compare(contextMenuRequestedSpy.count, 1);
- contextMenus = getContextMenus();
- compare(contextMenus.length, 1);
- verify(contextMenus[0]);
compare(linkText, "");
compare(mediaType, ContextMenuRequest.MediaTypeNone);
compare(selectedText, "");
-
- // FIXME: Sometimes the keyPress(Qt.Key_Escape) event isn't caught so we keep trying
- tryVerify(destroyContextMenu);
}
}
}
diff --git a/tests/auto/quick/qmltests/data/tst_datalist.qml b/tests/auto/quick/qmltests/data/tst_datalist.qml
new file mode 100644
index 000000000..f739639b2
--- /dev/null
+++ b/tests/auto/quick/qmltests/data/tst_datalist.qml
@@ -0,0 +1,180 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import QtQuick.Controls
+import QtTest
+import QtWebEngine
+
+TestWebEngineView {
+ id: webEngineView
+ width: 200
+ height: 400
+
+ property string html: "<html><body>" +
+ "<input id='browserInput' list='browserDatalist'>" +
+ "<datalist id='browserDatalist'>" +
+ " <option value='Internet Explorer'>" +
+ " <option value='Firefox'>" +
+ " <option value='Chrome'>" +
+ " <option value='Opera'>" +
+ " <option value='Safari'>" +
+ "</datalist>" +
+ "</body></html>"
+
+ function listView() {
+ if (webEngineView.parent.visibleChildren.length == 1) {
+ // No popup case.
+ return null;
+ }
+
+ let overlay = null;
+ for (let i = 0; i < webEngineView.parent.visibleChildren.length; ++i) {
+ let child = webEngineView.parent.visibleChildren[i];
+ if (child instanceof Overlay) {
+ overlay = child;
+ break;
+ }
+ }
+
+ if (!overlay)
+ return null;
+
+ let popupItem = null;
+ for (let i = 0; i < overlay.visibleChildren[0].visibleChildren.length; ++i) {
+ let child = overlay.visibleChildren[0].visibleChildren[i];
+ if (child.objectName == "QQuickPopupItem") {
+ popupItem = child;
+ }
+ }
+
+ if (!popupItem)
+ return null;
+
+ for (let i = 0; i < popupItem.visibleChildren.length; ++i) {
+ let child = popupItem.visibleChildren[i];
+ if (child instanceof ListView)
+ return child;
+ }
+
+ return null;
+ }
+
+ TestCase {
+ id: testCase
+ name: "WebEngineDatalist"
+ when: windowShown
+
+ function test_showAndHide() {
+ webEngineView.loadHtml(webEngineView.html);
+ verify(webEngineView.waitForLoadSucceeded());
+
+ var values = "";
+ webEngineView.runJavaScript(
+ "(function() {" +
+ " var browserDatalist = document.getElementById('browserDatalist');" +
+ " var options = browserDatalist.options;" +
+ " var result = [];" +
+ " for (let i = 0; i < options.length; ++i) {" +
+ " result.push(options[i].value);" +
+ " }" +
+ " return result;" +
+ "})();", function(result) { values = result; });
+ tryVerify(function() { return values.length != 0; });
+ compare(values, ["Internet Explorer", "Firefox", "Chrome", "Opera", "Safari"]);
+ compareElementValue("browserInput", "");
+
+ // Make sure there is no open popup yet.
+ verify(!listView());
+ // Click in the input field.
+ var browserInputCenter = getElementCenter("browserInput");
+ mouseClick(webEngineView, browserInputCenter.x, browserInputCenter.y, Qt.LeftButton);
+ // Wait for the popup.
+ tryVerify(function() { return listView() != null; });
+
+ // No suggestion is selected.
+ verify(!listView().currentItem);
+ compare(listView().count, 5);
+
+ // Accepting suggestion does nothing.
+ keyClick(Qt.Key_Enter);
+ tryVerify(function() { return listView() != null; });
+ verify(!listView().currentItem);
+
+ // Escape should close popup.
+ keyClick(Qt.Key_Escape);
+ tryVerify(function() { return listView() == null; });
+
+ // Key Down should open the popup and select the first suggestion.
+ keyClick(Qt.Key_Down);
+ tryVerify(function() { return listView() != null; });
+ compare(listView().currentIndex, 0);
+ verify(listView().currentItem);
+ }
+
+ function test_keyboardNavigationAndAccept() {
+ webEngineView.loadHtml(html);
+ verify(webEngineView.waitForLoadSucceeded());
+ setFocusToElement("browserInput");
+
+ // Make sure there is no open popup yet.
+ verify(!listView());
+
+ // Key Down should open the popup and select the first suggestion.
+ keyClick(Qt.Key_Down);
+ tryVerify(function() { return listView() != null; });
+ compare(listView().currentIndex, 0);
+
+ // Test keyboard navigation in list.
+ keyClick(Qt.Key_Up);
+ compare(listView().currentIndex, 4);
+ keyClick(Qt.Key_Up);
+ compare(listView().currentIndex, 3);
+ keyClick(Qt.Key_PageDown);
+ compare(listView().currentIndex, 4);
+ keyClick(Qt.Key_PageUp);
+ compare(listView().currentIndex, 0);
+ keyClick(Qt.Key_Down);
+ compare(listView().currentIndex, 1);
+ keyClick(Qt.Key_Down);
+ compare(listView().currentIndex, 2);
+
+ // Test accepting suggestion.
+ compare(listView().currentItem.text, "Chrome");
+ keyClick(Qt.Key_Enter);
+ compareElementValue("browserInput", "Chrome");
+ // Accept closes popup.
+ tryVerify(function() { return listView() == null; });
+
+ // Clear input field, should not trigger popup.
+ webEngineView.runJavaScript("document.getElementById('browserInput').value = ''");
+ compareElementValue("browserInput", "");
+ verify(listView() == null);
+ }
+
+ function test_filterSuggestion() {
+ webEngineView.loadHtml(html);
+ verify(webEngineView.waitForLoadSucceeded());
+ setFocusToElement("browserInput");
+
+ // Make sure there is no open popup yet.
+ verify(!listView());
+
+ // Filter suggestions.
+ keyClick(Qt.Key_F);
+ tryVerify(function() { return listView() != null; });
+ compare(listView().count, 2);
+ verify(!listView().currentItem);
+ compare(listView().itemAtIndex(0).text, "Firefox");
+ compare(listView().itemAtIndex(1).text, "Safari");
+ keyClick(Qt.Key_I);
+ tryVerify(function() { return listView().count == 1; });
+ verify(!listView().currentItem);
+ compare(listView().itemAtIndex(0).text, "Firefox");
+ keyClick(Qt.Key_L);
+ // Mismatch should close popup.
+ tryVerify(function() { return listView() == null; });
+ compareElementValue("browserInput", "fil");
+ }
+ }
+}
diff --git a/tests/auto/quick/qmltests/data/tst_desktopBehaviorLoadHtml.qml b/tests/auto/quick/qmltests/data/tst_desktopBehaviorLoadHtml.qml
index 780294348..6cb2841ec 100644
--- a/tests/auto/quick/qmltests/data/tst_desktopBehaviorLoadHtml.qml
+++ b/tests/auto/quick/qmltests/data/tst_desktopBehaviorLoadHtml.qml
@@ -1,34 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.2
+import QtQuick
+import QtTest
+import QtWebEngine
TestWebEngineView {
id: webEngineView
@@ -44,7 +19,7 @@ TestWebEngineView {
signalName: "linkHovered"
}
- onLinkHovered: {
+ onLinkHovered: function(hoveredUrl) {
webEngineView.lastUrl = hoveredUrl
}
diff --git a/tests/auto/quick/qmltests/data/tst_download.qml b/tests/auto/quick/qmltests/data/tst_download.qml
index 1b1750dd8..61a363c39 100644
--- a/tests/auto/quick/qmltests/data/tst_download.qml
+++ b/tests/auto/quick/qmltests/data/tst_download.qml
@@ -1,36 +1,11 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.10
-import Qt.labs.platform 1.0
-import Test.util 1.0
+import QtQuick
+import QtTest
+import QtWebEngine
+import Qt.labs.platform
+import Test.util
TestWebEngineView {
id: webEngineView
@@ -51,7 +26,6 @@ TestWebEngineView {
property string downloadedSetPath: ""
property int downloadDirectoryChanged: 0
property int downloadFileNameChanged: 0
- property int downloadPathChanged: 0
property bool setDirectoryFirst: false
TempDir { id: tempDir }
@@ -80,17 +54,24 @@ TestWebEngineView {
Connections {
id: downloadItemConnections
ignoreUnknownSignals: true
- onStateChanged: downloadState.push(target.state)
- onInterruptReasonChanged: downloadInterruptReason = target.interruptReason
- onDownloadDirectoryChanged: downloadDirectoryChanged++
- onDownloadFileNameChanged: downloadFileNameChanged++
- onPathChanged: downloadPathChanged++
+ function onStateChanged() {
+ downloadState.push(target.state);
+ }
+ function onInterruptReasonChanged() {
+ downloadInterruptReason = target.interruptReason;
+ }
+ function onDownloadDirectoryChanged() {
+ downloadDirectoryChanged++;
+ }
+ function onDownloadFileNameChanged() {
+ downloadFileNameChanged++;
+ }
}
WebEngineProfile {
id: testDownloadProfile
- onDownloadRequested: {
+ onDownloadRequested: function(download) {
testDownloadProfile.downloadPath = tempDir.path()
downloadState.push(download.state)
downloadItemConnections.target = download
@@ -120,7 +101,7 @@ TestWebEngineView {
downloadUrl = download.url
suggestedFileName = download.suggestedFileName
}
- onDownloadFinished: {
+ onDownloadFinished: function(download) {
receivedBytes = download.receivedBytes;
}
}
@@ -139,7 +120,6 @@ TestWebEngineView {
downloadInterruptReason = null
downloadDirectoryChanged = 0
downloadFileNameChanged = 0
- downloadPathChanged = 0
downloadDirectory = ""
downloadFileName = ""
downloadedPath = ""
@@ -155,7 +135,7 @@ TestWebEngineView {
compare(downLoadRequestedSpy.count, 1)
compare(downloadUrl, webEngineView.url)
compare(suggestedFileName, "download.zip")
- compare(downloadState[0], WebEngineDownloadItem.DownloadRequested)
+ compare(downloadState[0], WebEngineDownloadRequest.DownloadRequested)
verify(!downloadInterruptReason)
}
@@ -179,11 +159,11 @@ TestWebEngineView {
compare(downLoadRequestedSpy.count, 1)
compare(downloadUrl, webEngineView.url)
compare(suggestedFileName, "download.zip")
- compare(downloadState[0], WebEngineDownloadItem.DownloadRequested)
- tryCompare(downloadState, "1", WebEngineDownloadItem.DownloadInProgress)
+ compare(downloadState[0], WebEngineDownloadRequest.DownloadRequested)
+ tryCompare(downloadState, "1", WebEngineDownloadRequest.DownloadInProgress)
downloadFinishedSpy.wait()
compare(totalBytes, receivedBytes)
- tryCompare(downloadState, "2", WebEngineDownloadItem.DownloadCompleted)
+ tryCompare(downloadState, "2", WebEngineDownloadRequest.DownloadCompleted)
verify(!downloadInterruptReason)
}
@@ -196,8 +176,8 @@ TestWebEngineView {
compare(downloadUrl, webEngineView.url)
compare(suggestedFileName, "download.zip")
compare(downloadFinishedSpy.count, 1)
- tryCompare(downloadState, "1", WebEngineDownloadItem.DownloadCancelled)
- tryCompare(webEngineView, "downloadInterruptReason", WebEngineDownloadItem.UserCanceled)
+ tryCompare(downloadState, "1", WebEngineDownloadRequest.DownloadCancelled)
+ tryCompare(webEngineView, "downloadInterruptReason", WebEngineDownloadRequest.UserCanceled)
}
function test_downloadLocation() {
@@ -230,15 +210,14 @@ TestWebEngineView {
compare(downLoadRequestedSpy.count, 1);
compare(downloadUrl, webEngineView.url);
compare(suggestedFileName, "download.zip");
- compare(downloadState[0], WebEngineDownloadItem.DownloadRequested);
- tryCompare(downloadState, "1", WebEngineDownloadItem.DownloadInProgress);
+ compare(downloadState[0], WebEngineDownloadRequest.DownloadRequested);
+ tryCompare(downloadState, "1", WebEngineDownloadRequest.DownloadInProgress);
compare(downloadedPath, testDownloadProfile.downloadPath + downloadDirectory + downloadFileName);
compare(downloadDirectoryChanged, 1);
compare(downloadFileNameChanged, 1);
- compare(downloadPathChanged, 2);
downloadFinishedSpy.wait();
compare(totalBytes, receivedBytes);
- tryCompare(downloadState, "2", WebEngineDownloadItem.DownloadCompleted);
+ tryCompare(downloadState, "2", WebEngineDownloadRequest.DownloadCompleted);
verify(!downloadInterruptReason);
}
@@ -253,15 +232,14 @@ TestWebEngineView {
compare(downLoadRequestedSpy.count, 1);
compare(downloadUrl, webEngineView.url);
compare(suggestedFileName, "download.zip");
- compare(downloadState[0], WebEngineDownloadItem.DownloadRequested);
- tryCompare(downloadState, "1", WebEngineDownloadItem.DownloadInProgress);
+ compare(downloadState[0], WebEngineDownloadRequest.DownloadRequested);
+ tryCompare(downloadState, "1", WebEngineDownloadRequest.DownloadInProgress);
compare(downloadedPath, testDownloadProfile.downloadPath + downloadDirectory + "download.zip");
compare(downloadDirectoryChanged, 1);
compare(downloadFileNameChanged, 0);
- compare(downloadPathChanged, 1);
downloadFinishedSpy.wait();
compare(totalBytes, receivedBytes);
- tryCompare(downloadState, "2", WebEngineDownloadItem.DownloadCompleted);
+ tryCompare(downloadState, "2", WebEngineDownloadRequest.DownloadCompleted);
verify(!downloadInterruptReason);
// Download the same file to another directory with suggested file name.
@@ -270,22 +248,20 @@ TestWebEngineView {
compare(downLoadRequestedSpy.count, 0);
downloadDirectoryChanged = 0;
downloadFileNameChanged = 0;
- downloadPathChanged = 0;
downloadDirectory = "/test_downloadToDirectoryWithSuggestedFileName1/";
webEngineView.url = Qt.resolvedUrl("download.zip");
downLoadRequestedSpy.wait();
compare(downLoadRequestedSpy.count, 1);
compare(downloadUrl, webEngineView.url);
compare(suggestedFileName, "download.zip");
- compare(downloadState[0], WebEngineDownloadItem.DownloadRequested);
- tryCompare(downloadState, "1", WebEngineDownloadItem.DownloadInProgress);
+ compare(downloadState[0], WebEngineDownloadRequest.DownloadRequested);
+ tryCompare(downloadState, "1", WebEngineDownloadRequest.DownloadInProgress);
compare(downloadedPath, testDownloadProfile.downloadPath + downloadDirectory + "download.zip");
compare(downloadDirectoryChanged, 1);
compare(downloadFileNameChanged, 0);
- compare(downloadPathChanged, 1);
downloadFinishedSpy.wait();
compare(totalBytes, receivedBytes);
- tryCompare(downloadState, "2", WebEngineDownloadItem.DownloadCompleted);
+ tryCompare(downloadState, "2", WebEngineDownloadRequest.DownloadCompleted);
verify(!downloadInterruptReason);
// Download same file to same directory second time -> file name should be unified.
@@ -294,44 +270,20 @@ TestWebEngineView {
compare(downLoadRequestedSpy.count, 0);
downloadDirectoryChanged = 0;
downloadFileNameChanged = 0;
- downloadPathChanged = 0;
downloadDirectory = "/test_downloadToDirectoryWithSuggestedFileName1/";
webEngineView.url = Qt.resolvedUrl("download.zip");
downLoadRequestedSpy.wait();
compare(downLoadRequestedSpy.count, 1);
compare(downloadUrl, webEngineView.url);
compare(suggestedFileName, "download.zip");
- compare(downloadState[0], WebEngineDownloadItem.DownloadRequested);
- tryCompare(downloadState, "1", WebEngineDownloadItem.DownloadInProgress);
+ compare(downloadState[0], WebEngineDownloadRequest.DownloadRequested);
+ tryCompare(downloadState, "1", WebEngineDownloadRequest.DownloadInProgress);
compare(downloadedPath, testDownloadProfile.downloadPath + downloadDirectory + "download (1).zip");
compare(downloadDirectoryChanged, 1);
compare(downloadFileNameChanged, 1);
- compare(downloadPathChanged, 1);
- downloadFinishedSpy.wait();
- compare(totalBytes, receivedBytes);
- tryCompare(downloadState, "2", WebEngineDownloadItem.DownloadCompleted);
- verify(!downloadInterruptReason);
-}
-
- function test_downloadWithSetPath() {
- compare(downLoadRequestedSpy.count, 0);
- compare(downloadDirectoryChanged, 0);
- compare(downloadFileNameChanged, 0);
- downloadedSetPath = "/test_downloadWithSetPath/test.zip";
- webEngineView.url = Qt.resolvedUrl("download.zip");
- downLoadRequestedSpy.wait();
- compare(downLoadRequestedSpy.count, 1);
- compare(downloadUrl, webEngineView.url);
- compare(suggestedFileName, "download.zip");
- compare(downloadState[0], WebEngineDownloadItem.DownloadRequested);
- tryCompare(downloadState, "1", WebEngineDownloadItem.DownloadInProgress);
- compare(downloadedPath, testDownloadProfile.downloadPath + downloadedSetPath);
- compare(downloadDirectoryChanged, 1);
- compare(downloadFileNameChanged, 1);
- compare(downloadPathChanged, 2);
downloadFinishedSpy.wait();
compare(totalBytes, receivedBytes);
- tryCompare(downloadState, "2", WebEngineDownloadItem.DownloadCompleted);
+ tryCompare(downloadState, "2", WebEngineDownloadRequest.DownloadCompleted);
verify(!downloadInterruptReason);
}
}
diff --git a/tests/auto/quick/qmltests/data/tst_dragHandlerUnderView.qml b/tests/auto/quick/qmltests/data/tst_dragHandlerUnderView.qml
new file mode 100644
index 000000000..c22bd44c2
--- /dev/null
+++ b/tests/auto/quick/qmltests/data/tst_dragHandlerUnderView.qml
@@ -0,0 +1,67 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import QtTest
+import QtWebEngine
+
+Item {
+ id: parentItem
+ width: 400
+ height: 300
+
+ Rectangle {
+ id: draggableDownUnder
+ color: "wheat"
+ width: 350
+ height: 250
+
+ DragHandler { id: dragHandler }
+ }
+
+ TestWebEngineView {
+ id: webEngineView
+ width: 300
+ height: 250
+
+ property var testUrl: Qt.resolvedUrl("test4.html")
+
+ SignalSpy {
+ id: scrollPositionSpy
+ target: webEngineView
+ signalName: "onScrollPositionChanged"
+ }
+
+ SignalSpy {
+ id: dragActiveSpy
+ target: dragHandler
+ signalName: "activeChanged"
+ }
+
+ TestCase {
+ id: testCase
+ name: "KeepMouseGrabDuringScrolling"
+ when: windowShown
+
+ function test_scroll() {
+ webEngineView.url = Qt.resolvedUrl("test4.html");
+ verify(webEngineView.waitForLoadSucceeded());
+
+ mousePress(webEngineView, 295, 20);
+ mouseMove(webEngineView, 295, 200);
+ mouseRelease(webEngineView, 295, 200);
+
+ // WebEngineView scrolled if the scrollbar was visible.
+ // But on macOS, the scrollbar is hidden, so text gets selected.
+ tryVerify(function() {
+ return (scrollPositionSpy.count === 1 && webEngineView.scrollPosition.y > 100)
+ || webEngineView.getTextSelection().length > 0;
+ });
+
+ // DragHandler didn't take over and drag
+ compare(dragActiveSpy.count, 0);
+ compare(draggableDownUnder.y, 0);
+ }
+ }
+ }
+}
diff --git a/tests/auto/quick/qmltests/data/tst_favicon.qml b/tests/auto/quick/qmltests/data/tst_favicon.qml
new file mode 100644
index 000000000..15f116e5d
--- /dev/null
+++ b/tests/auto/quick/qmltests/data/tst_favicon.qml
@@ -0,0 +1,527 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import QtTest
+import QtWebEngine
+import Test.util
+import "../../qmltests/data"
+
+TestWebEngineView {
+ id: webEngineView
+ width: 200
+ height: 400
+
+ TempDir { id: tempDir }
+
+ property QtObject defaultProfile: WebEngineProfile {
+ offTheRecord: true
+ }
+
+ property QtObject nonOTRProfile: WebEngineProfile {
+ persistentStoragePath: tempDir.path() + '/WebEngineFavicon'
+ offTheRecord: false
+ }
+
+ function removeFaviconProviderPrefix(url) {
+ return url.toString().substring(16)
+ }
+
+ SignalSpy {
+ id: iconChangedSpy
+ target: webEngineView
+ signalName: "iconChanged"
+ }
+
+ Image {
+ id: favicon
+ source: webEngineView.icon
+ }
+
+ TestCase {
+ id: testCase
+ name: "WebEngineFavicon"
+ when: windowShown
+
+
+ function init() {
+ // It is worth to restore the initial state with loading a blank page before all test functions.
+ webEngineView.url = 'about:blank';
+ verify(webEngineView.waitForLoadSucceeded());
+ iconChangedSpy.clear();
+ webEngineView.settings.touchIconsEnabled = false;
+ webEngineView.settings.autoLoadIconsForPage = true;
+ }
+
+ function test_faviconLoad_data() {
+ return [
+ { tag: "OTR", profile: defaultProfile },
+ { tag: "non-OTR", profile: nonOTRProfile },
+ ];
+ }
+
+ function test_faviconLoad(row) {
+ webEngineView.profile = row.profile
+ compare(iconChangedSpy.count, 0)
+
+ var url = Qt.resolvedUrl("favicon.html")
+ webEngineView.url = url
+ verify(webEngineView.waitForLoadSucceeded())
+
+ iconChangedSpy.wait()
+ compare(iconChangedSpy.count, 1)
+
+ tryCompare(favicon, "status", Image.Ready)
+ compare(favicon.width, 32)
+ compare(favicon.height, 32)
+ }
+
+ function test_faviconLoadEncodedUrl_data() {
+ return [
+ { tag: "OTR", profile: defaultProfile },
+ { tag: "non-OTR", profile: nonOTRProfile },
+ ];
+ }
+
+ function test_faviconLoadEncodedUrl(row) {
+ webEngineView.profile = row.profile
+ compare(iconChangedSpy.count, 0)
+
+ var url = Qt.resolvedUrl("favicon2.html?favicon=load should work with#whitespace!")
+ webEngineView.url = url
+ verify(webEngineView.waitForLoadSucceeded())
+
+ iconChangedSpy.wait()
+ compare(iconChangedSpy.count, 1)
+
+ tryCompare(favicon, "status", Image.Ready)
+ compare(favicon.width, 32)
+ compare(favicon.height, 32)
+ }
+
+ function test_faviconLoadAfterHistoryNavigation_data() {
+ return [
+ { tag: "OTR", profile: defaultProfile },
+ { tag: "non-OTR", profile: nonOTRProfile },
+ ];
+ }
+
+ function test_faviconLoadAfterHistoryNavigation(row) {
+ webEngineView.profile = row.profile
+ compare(iconChangedSpy.count, 0)
+
+ var iconUrl
+
+ webEngineView.url = Qt.resolvedUrl("favicon.html")
+ verify(webEngineView.waitForLoadSucceeded())
+ tryCompare(iconChangedSpy, "count", 1)
+ iconUrl = removeFaviconProviderPrefix(webEngineView.icon)
+ compare(iconUrl, Qt.resolvedUrl("icons/favicon.png"))
+
+ iconChangedSpy.clear()
+ webEngineView.url = Qt.resolvedUrl("favicon-shortcut.html")
+ verify(webEngineView.waitForLoadSucceeded())
+ tryCompare(iconChangedSpy, "count", 2)
+ iconUrl = removeFaviconProviderPrefix(webEngineView.icon)
+ compare(iconUrl, Qt.resolvedUrl("icons/qt32.ico"))
+
+ iconChangedSpy.clear()
+ webEngineView.goBack();
+ verify(webEngineView.waitForLoadSucceeded())
+ tryCompare(iconChangedSpy, "count", 2)
+ iconUrl = removeFaviconProviderPrefix(webEngineView.icon)
+ compare(iconUrl, Qt.resolvedUrl("icons/favicon.png"))
+
+ iconChangedSpy.clear()
+ webEngineView.goForward();
+ verify(webEngineView.waitForLoadSucceeded())
+ tryCompare(iconChangedSpy, "count", 2)
+ iconUrl = removeFaviconProviderPrefix(webEngineView.icon)
+ compare(iconUrl, Qt.resolvedUrl("icons/qt32.ico"))
+ }
+
+ function test_faviconLoadPushState_data() {
+ return [
+ { tag: "OTR", profile: defaultProfile },
+ { tag: "non-OTR", profile: nonOTRProfile },
+ ];
+ }
+
+ function test_faviconLoadPushState(row) {
+ webEngineView.profile = row.profile;
+ compare(iconChangedSpy.count, 0);
+
+ var iconUrl;
+
+ webEngineView.url = Qt.resolvedUrl("favicon.html");
+ verify(webEngineView.waitForLoadSucceeded());
+ tryCompare(iconChangedSpy, "count", 1);
+ iconUrl = removeFaviconProviderPrefix(webEngineView.icon);
+ compare(iconUrl, Qt.resolvedUrl("icons/favicon.png"));
+
+ iconChangedSpy.clear();
+
+ // pushState() is a same document navigation and should not reset or
+ // update favicon.
+ compare(webEngineView.history.items.rowCount(), 1);
+ runJavaScript("history.pushState('', '')");
+ tryVerify(function() { return webEngineView.history.items.rowCount() === 2; });
+
+ // Favicon change is not expected.
+ compare(iconChangedSpy.count, 0);
+ iconUrl = removeFaviconProviderPrefix(webEngineView.icon);
+ compare(iconUrl, Qt.resolvedUrl("icons/favicon.png"));
+ }
+
+ function test_noFavicon_data() {
+ return [
+ { tag: "OTR", profile: defaultProfile },
+ { tag: "non-OTR", profile: nonOTRProfile },
+ ];
+ }
+
+ function test_noFavicon(row) {
+ webEngineView.profile = row.profile
+ compare(iconChangedSpy.count, 0)
+
+ var url = Qt.resolvedUrl("test1.html")
+ webEngineView.url = url
+ verify(webEngineView.waitForLoadSucceeded())
+
+ compare(iconChangedSpy.count, 0)
+
+ var iconUrl = webEngineView.icon
+ compare(iconUrl, Qt.resolvedUrl(""))
+ }
+
+ function test_aboutBlank_data() {
+ return [
+ { tag: "OTR", profile: defaultProfile },
+ { tag: "non-OTR", profile: nonOTRProfile },
+ ];
+ }
+
+ function test_aboutBlank(row) {
+ webEngineView.profile = row.profile
+ compare(iconChangedSpy.count, 0)
+
+ var url = Qt.resolvedUrl("about:blank")
+ webEngineView.url = url
+ verify(webEngineView.waitForLoadSucceeded())
+
+ compare(iconChangedSpy.count, 0)
+
+ var iconUrl = webEngineView.icon
+ compare(iconUrl, Qt.resolvedUrl(""))
+ }
+
+ function test_unavailableFavicon_data() {
+ return [
+ { tag: "OTR", profile: defaultProfile },
+ { tag: "non-OTR", profile: nonOTRProfile },
+ ];
+ }
+
+ function test_unavailableFavicon(row) {
+ webEngineView.profile = row.profile
+ compare(iconChangedSpy.count, 0)
+
+ var url = Qt.resolvedUrl("favicon-unavailable.html")
+ webEngineView.url = url
+ verify(webEngineView.waitForLoadSucceeded())
+
+ compare(iconChangedSpy.count, 0)
+
+ var iconUrl = webEngineView.icon
+ compare(iconUrl, Qt.resolvedUrl(""))
+ }
+
+ function test_errorPageEnabled_data() {
+ return [
+ { tag: "OTR", profile: defaultProfile },
+ { tag: "non-OTR", profile: nonOTRProfile },
+ ];
+ }
+
+ function test_errorPageEnabled(row) {
+ webEngineView.profile = row.profile
+ webEngineView.settings.errorPageEnabled = true
+
+ compare(iconChangedSpy.count, 0)
+
+ var url = Qt.resolvedUrl("http://url.invalid")
+ webEngineView.url = url
+ verify(webEngineView.waitForLoadFailed(20000))
+
+ compare(iconChangedSpy.count, 0)
+
+ var iconUrl = webEngineView.icon
+ compare(iconUrl, Qt.resolvedUrl(""))
+ }
+
+ function test_errorPageDisabled_data() {
+ return [
+ { tag: "OTR", profile: defaultProfile },
+ { tag: "non-OTR", profile: nonOTRProfile },
+ ];
+ }
+
+ function test_errorPageDisabled(row) {
+ webEngineView.profile = row.profile
+ webEngineView.settings.errorPageEnabled = false
+
+ compare(iconChangedSpy.count, 0)
+
+ var url = Qt.resolvedUrl("http://url.invalid")
+ webEngineView.url = url
+ verify(webEngineView.waitForLoadFailed(20000))
+
+ compare(iconChangedSpy.count, 0)
+
+ var iconUrl = webEngineView.icon
+ compare(iconUrl, Qt.resolvedUrl(""))
+ }
+
+ function test_bestFavicon_data() {
+ return [
+ { tag: "OTR", profile: defaultProfile },
+ { tag: "non-OTR", profile: nonOTRProfile },
+ ];
+ }
+
+ function test_bestFavicon(row) {
+ webEngineView.profile = row.profile
+ compare(iconChangedSpy.count, 0)
+ var url, iconUrl
+
+ url = Qt.resolvedUrl("favicon-misc.html")
+ webEngineView.url = url
+ verify(webEngineView.waitForLoadSucceeded())
+
+ iconChangedSpy.wait()
+ compare(iconChangedSpy.count, 1)
+
+ iconUrl = removeFaviconProviderPrefix(webEngineView.icon)
+ // Touch icon is ignored
+ compare(iconUrl, Qt.resolvedUrl("icons/qt32.ico"))
+ tryCompare(favicon, "status", Image.Ready)
+ compare(favicon.width, 32)
+ compare(favicon.height, 32)
+
+ iconChangedSpy.clear()
+
+ url = Qt.resolvedUrl("favicon-shortcut.html")
+ webEngineView.url = url
+ verify(webEngineView.waitForLoadSucceeded())
+
+ tryCompare(iconChangedSpy, "count", 2)
+ iconUrl = removeFaviconProviderPrefix(webEngineView.icon)
+
+ // If touch icon is disabled, FaviconHandler propagates the icon closest to size 16x16
+ compare(iconUrl, Qt.resolvedUrl("icons/qt32.ico"))
+ tryCompare(favicon, "status", Image.Ready)
+ compare(favicon.width, 32)
+ compare(favicon.height, 32)
+ }
+
+ function test_touchIcon_data() {
+ return [
+ { tag: "OTR", profile: defaultProfile },
+ { tag: "non-OTR", profile: nonOTRProfile },
+ ];
+ }
+
+ function test_touchIcon(row) {
+ webEngineView.profile = row.profile
+ compare(iconChangedSpy.count, 0)
+
+ var url = Qt.resolvedUrl("favicon-touch.html")
+ webEngineView.url = url
+ verify(webEngineView.waitForLoadSucceeded())
+
+ compare(iconChangedSpy.count, 0)
+
+ var iconUrl = webEngineView.icon
+ compare(iconUrl, Qt.resolvedUrl(""))
+ compare(favicon.width, 0)
+ compare(favicon.height, 0)
+
+ webEngineView.settings.touchIconsEnabled = true
+
+ url = Qt.resolvedUrl("favicon-touch.html")
+ webEngineView.url = url
+ verify(webEngineView.waitForLoadSucceeded())
+
+ iconChangedSpy.wait()
+ iconUrl = removeFaviconProviderPrefix(webEngineView.icon)
+ compare(iconUrl, Qt.resolvedUrl("icons/qt144.png"))
+ compare(iconChangedSpy.count, 1)
+ tryCompare(favicon, "status", Image.Ready)
+ compare(favicon.width, 144)
+ compare(favicon.height, 144)
+ }
+
+ function test_multiIcon_data() {
+ return [
+ { tag: "OTR", profile: defaultProfile },
+ { tag: "non-OTR", profile: nonOTRProfile },
+ ];
+ }
+
+ function test_multiIcon(row) {
+ webEngineView.profile = row.profile
+ compare(iconChangedSpy.count, 0)
+
+ var url = Qt.resolvedUrl("favicon-multi.html")
+ webEngineView.url = url
+ verify(webEngineView.waitForLoadSucceeded())
+
+ iconChangedSpy.wait()
+ compare(iconChangedSpy.count, 1)
+ tryCompare(favicon, "status", Image.Ready)
+ compare(favicon.width, 32)
+ compare(favicon.height, 32)
+ }
+
+ function test_dynamicFavicon_data() {
+ return [
+ { tag: "OTR", profile: defaultProfile },
+ { tag: "non-OTR", profile: nonOTRProfile },
+ ];
+ }
+
+ function test_dynamicFavicon(row) {
+ webEngineView.profile = row.profile
+ compare(iconChangedSpy.count, 0)
+
+ var faviconImage = Qt.createQmlObject("
+ import QtQuick\n
+ Image { width: 16; height: 16; sourceSize: Qt.size(width, height); objectName: 'image' }", testCase)
+ faviconImage.source = Qt.binding(function() { return webEngineView.icon; });
+
+ var colors = [
+ {"url": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8DwHwAFBQIAX8jx0gAAAABJRU5ErkJggg==", "r": 255, "g": 0, "b": 0},
+ {"url": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M/wHwAEBgIApD5fRAAAAABJRU5ErkJggg==", "r": 0, "g": 255, "b": 0},
+ {"url": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPj/HwADBwIAMCbHYQAAAABJRU5ErkJggg==", "r": 0, "g": 0, "b": 255},
+ ];
+ var pixel;
+
+ compare(iconChangedSpy.count, 0);
+ webEngineView.loadHtml(
+ "<html>" +
+ "<link rel='icon' type='image/png' href='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII='/>" +
+ "</html>"
+ );
+ verify(webEngineView.waitForLoadSucceeded());
+ tryCompare(iconChangedSpy, "count", 1);
+
+ pixel = getItemPixel(faviconImage);
+ compare(pixel[0], 0);
+ compare(pixel[1], 0);
+ compare(pixel[2], 0);
+
+ for (var i = 0; i < colors.length; ++i) {
+ iconChangedSpy.clear();
+ runJavaScript("document.getElementsByTagName('link')[0].href = 'data:image/png;base64," + colors[i]["url"] + "';");
+ tryCompare(faviconImage, "source", "image://favicon/data:image/png;base64," + colors[i]["url"]);
+ compare(iconChangedSpy.count, 1);
+
+ pixel = getItemPixel(faviconImage);
+ compare(pixel[0], colors[i]["r"]);
+ compare(pixel[1], colors[i]["g"]);
+ compare(pixel[2], colors[i]["b"]);
+ }
+
+ faviconImage.destroy()
+ }
+
+ function test_touchIconWithSameURL_data() {
+ return [
+ { tag: "OTR", profile: defaultProfile },
+ { tag: "non-OTR", profile: nonOTRProfile },
+ ];
+ }
+
+ function test_touchIconWithSameURL(row)
+ {
+ webEngineView.profile = row.profile;
+ compare(iconChangedSpy.count, 0);
+
+ var icon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII=";
+
+ webEngineView.loadHtml(
+ "<html>" +
+ "<link rel='icon' type='image/png' href='" + icon + "'/>" +
+ "<link rel='apple-touch-icon' type='image/png' href='" + icon + "'/>" +
+ "</html>"
+ );
+ verify(webEngineView.waitForLoadSucceeded());
+
+ // The default favicon has to be loaded even if its URL is also set as a touch icon while touch icons are disabled.
+ tryCompare(iconChangedSpy, "count", 1);
+ compare(webEngineView.icon.toString().replace(/^image:\/\/favicon\//, ''), icon);
+
+ iconChangedSpy.clear();
+
+ webEngineView.loadHtml(
+ "<html>" +
+ "<link rel='apple-touch-icon' type='image/png' href='" + icon + "'/>" +
+ "</html>"
+ );
+ verify(webEngineView.waitForLoadSucceeded());
+
+ // This page only has a touch icon. With disabled touch icons we don't expect any icon to be shown even if the same icon
+ // was loaded previously.
+ tryCompare(iconChangedSpy, "count", 1);
+ verify(!webEngineView.icon.toString().replace(/^image:\/\/favicon\//, ''));
+ }
+
+ function test_iconsDisabled_data() {
+ return [
+ { tag: "misc", url: Qt.resolvedUrl("favicon-misc.html") },
+ { tag: "shortcut", url: Qt.resolvedUrl("favicon-shortcut.html") },
+ { tag: "single", url: Qt.resolvedUrl("favicon-single.html") },
+ { tag: "touch", url: Qt.resolvedUrl("favicon-touch.html") },
+ { tag: "unavailable", url: Qt.resolvedUrl("favicon-unavailable.html") },
+ ];
+ }
+
+ function test_iconsDisabled(row) {
+ webEngineView.settings.autoLoadIconsForPage = false
+ webEngineView.profile = defaultProfile
+ compare(iconChangedSpy.count, 0)
+
+ webEngineView.url = row.url
+ verify(webEngineView.waitForLoadSucceeded())
+
+ compare(iconChangedSpy.count, 0)
+
+ var iconUrl = webEngineView.icon
+ compare(iconUrl, Qt.resolvedUrl(""))
+ }
+
+ function test_touchIconsEnabled_data() {
+ return [
+ { tag: "misc", url: Qt.resolvedUrl("favicon-misc.html"), expectedIconUrl: Qt.resolvedUrl("icons/qt144.png") },
+ { tag: "shortcut", url: Qt.resolvedUrl("favicon-shortcut.html"), expectedIconUrl: Qt.resolvedUrl("icons/qt144.png") },
+ { tag: "single", url: Qt.resolvedUrl("favicon-single.html"), expectedIconUrl: Qt.resolvedUrl("icons/qt32.ico") },
+ { tag: "touch", url: Qt.resolvedUrl("favicon-touch.html"), expectedIconUrl: Qt.resolvedUrl("icons/qt144.png") },
+ ];
+ }
+
+ function test_touchIconsEnabled(row) {
+ webEngineView.settings.touchIconsEnabled = true
+ webEngineView.profile = defaultProfile
+ compare(iconChangedSpy.count, 0)
+
+ webEngineView.url = row.url
+ verify(webEngineView.waitForLoadSucceeded())
+
+ iconChangedSpy.wait()
+ compare(iconChangedSpy.count, 1)
+
+ var iconUrl = removeFaviconProviderPrefix(webEngineView.icon)
+ compare(iconUrl, row.expectedIconUrl)
+ }
+ }
+}
diff --git a/tests/auto/quick/qmltests/data/tst_faviconDatabase.qml b/tests/auto/quick/qmltests/data/tst_faviconDatabase.qml
new file mode 100644
index 000000000..284390619
--- /dev/null
+++ b/tests/auto/quick/qmltests/data/tst_faviconDatabase.qml
@@ -0,0 +1,216 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import QtTest
+import QtWebEngine
+import Test.util
+import "../../qmltests/data"
+
+TestWebEngineView {
+ id: webEngineView
+ width: 200
+ height: 400
+
+ TempDir { id: tempDir }
+
+ property QtObject defaultProfile: WebEngineProfile {
+ offTheRecord: true
+ }
+
+ property QtObject nonOTRProfile: WebEngineProfile {
+ persistentStoragePath: tempDir.path() + '/WebEngineFavicon'
+ offTheRecord: false
+ }
+
+ function getFaviconPixel(faviconImage) {
+ var grabImage = Qt.createQmlObject("
+ import QtQuick\n
+ Image { }", testCase)
+ var faviconCanvas = Qt.createQmlObject("
+ import QtQuick\n
+ Canvas { }", testCase)
+
+ testCase.tryVerify(function() { return faviconImage.status == Image.Ready });
+ faviconImage.grabToImage(function(result) {
+ grabImage.source = result.url
+ });
+ testCase.tryVerify(function() { return grabImage.status == Image.Ready });
+
+ faviconCanvas.width = faviconImage.width;
+ faviconCanvas.height = faviconImage.height;
+ var ctx = faviconCanvas.getContext("2d");
+ ctx.drawImage(grabImage, 0, 0, grabImage.width, grabImage.height);
+ var imageData = ctx.getImageData(Math.round(faviconCanvas.width/2),
+ Math.round(faviconCanvas.height/2),
+ faviconCanvas.width,
+ faviconCanvas.height);
+
+ grabImage.destroy();
+ faviconCanvas.destroy();
+
+ return imageData.data;
+ }
+
+ SignalSpy {
+ id: iconChangedSpy
+ target: webEngineView
+ signalName: "iconChanged"
+ }
+
+ TestCase {
+ id: testCase
+ name: "WebEngineFaviconDatabase"
+ when: windowShown
+
+ function init() {
+ // It is worth to restore the initial state with loading a blank page before all test functions.
+ webEngineView.url = 'about:blank';
+ verify(webEngineView.waitForLoadSucceeded());
+ iconChangedSpy.clear();
+ webEngineView.settings.touchIconsEnabled = false;
+ webEngineView.settings.autoLoadIconsForPage = true;
+ }
+
+ function cleanupTestCase() {
+ tempDir.removeRecursive(nonOTRProfile.persistentStoragePath);
+ }
+
+ function test_iconDatabase_data() {
+ return [
+ { tag: "OTR", profile: defaultProfile },
+ { tag: "non-OTR", profile: nonOTRProfile },
+ ];
+ }
+
+ function test_iconDatabase(row)
+ {
+ if (Screen.devicePixelRatio !== 1.0)
+ skip("This test is not supported on High DPI screens.");
+
+ webEngineView.profile = row.profile;
+ compare(iconChangedSpy.count, 0);
+
+ var faviconImage = Qt.createQmlObject("
+ import QtQuick\n
+ Image { width: 16; height: 16; sourceSize: Qt.size(width, height); cache: false; }", testCase);
+
+ var pixel;
+ compare(iconChangedSpy.count, 0);
+
+ webEngineView.url = Qt.resolvedUrl("favicon.html"); // favicon.png -> 165
+ verify(webEngineView.waitForLoadSucceeded());
+
+ iconChangedSpy.wait();
+ compare(iconChangedSpy.count, 1);
+
+ var previousIcon = webEngineView.icon;
+ iconChangedSpy.clear();
+
+ webEngineView.url = Qt.resolvedUrl("favicon-shortcut.html"); // qt32.ico -> 251
+ verify(webEngineView.waitForLoadSucceeded());
+
+ tryCompare(iconChangedSpy, "count", 2);
+
+ // Icon database is not accessible with OTR profile.
+ faviconImage.source = previousIcon;
+ pixel = getFaviconPixel(faviconImage);
+ compare(pixel[0], webEngineView.profile.offTheRecord ? 0 : 165);
+
+ // This should pass with OTR too because icon is requested for the current page.
+ faviconImage.source = "image://favicon/" + Qt.resolvedUrl("favicon-shortcut.html");
+ pixel = getFaviconPixel(faviconImage);
+ compare(pixel[0], 251);
+
+ faviconImage.source = "image://favicon/" + Qt.resolvedUrl("favicon.html");
+ pixel = getFaviconPixel(faviconImage);
+ compare(pixel[0], webEngineView.profile.offTheRecord ? 0 : 165);
+
+ faviconImage.destroy();
+ webEngineView.profile = defaultProfile;
+ }
+
+ function test_iconDatabaseMultiView()
+ {
+ if (Screen.devicePixelRatio !== 1.0)
+ skip("This test is not supported on High DPI screens.");
+
+ var pixel;
+
+ var faviconImage = Qt.createQmlObject("
+ import QtQuick\n
+ Image { width: 16; height: 16; sourceSize: Qt.size(width, height); cache: false; }", testCase);
+
+ var webEngineView1 = Qt.createQmlObject("
+ import QtWebEngine\n
+ import Test.util\n
+ import '../../qmltests/data'\n
+ TestWebEngineView {\n
+ TempDir { id: tempDir }
+ profile: WebEngineProfile {\n
+ persistentStoragePath: tempDir.path() + '/WebEngineFavicon1'\n
+ offTheRecord: false\n
+ }\n
+ }", testCase);
+
+ var webEngineView2 = Qt.createQmlObject("
+ import QtWebEngine\n
+ import Test.util\n
+ import '../../qmltests/data'\n
+ TestWebEngineView {\n
+ TempDir { id: tempDir }
+ profile: WebEngineProfile {\n
+ persistentStoragePath: tempDir.path() + '/WebEngineFavicon2'\n
+ offTheRecord: false\n
+ }\n
+ }", testCase);
+
+ // Moke sure the icons have not been stored in the database yet.
+ var icon1 = "image://favicon/" + Qt.resolvedUrl("icons/favicon.png");
+ faviconImage.source = icon1;
+ pixel = getFaviconPixel(faviconImage);
+ compare(pixel[0], 0);
+
+ var icon2 = "image://favicon/" + Qt.resolvedUrl("icons/qt32.ico");
+ faviconImage.source = icon2;
+ pixel = getFaviconPixel(faviconImage);
+ compare(pixel[0], 0);
+
+ webEngineView1.url = Qt.resolvedUrl("favicon.html"); // favicon.png -> 165
+ verify(webEngineView1.waitForLoadSucceeded());
+ tryCompare(webEngineView1, "icon", icon1);
+ webEngineView1.url = "about:blank";
+ verify(webEngineView1.waitForLoadSucceeded());
+
+ webEngineView2.url = Qt.resolvedUrl("favicon-shortcut.html"); // qt32.ico -> 251
+ verify(webEngineView2.waitForLoadSucceeded());
+ tryCompare(webEngineView2, "icon", icon2);
+ webEngineView2.url = "about:blank";
+ verify(webEngineView2.waitForLoadSucceeded());
+
+ faviconImage.source = "";
+ compare(webEngineView1.icon, "");
+ compare(webEngineView2.icon, "");
+
+ faviconImage.source = icon1;
+ pixel = getFaviconPixel(faviconImage);
+ compare(pixel[0], 165);
+
+ faviconImage.source = icon2;
+ pixel = getFaviconPixel(faviconImage);
+ compare(pixel[0], 251);
+
+ faviconImage.source = "image://favicon/file:///does.not.exist.ico";
+ pixel = getFaviconPixel(faviconImage);
+ compare(pixel[0], 0);
+
+ webEngineView1.destroy();
+ webEngineView2.destroy();
+ faviconImage.destroy();
+
+ tempDir.removeRecursive(webEngineView1.profile.persistentStoragePath)
+ tempDir.removeRecursive(webEngineView2.profile.persistentStoragePath)
+ }
+ }
+}
+
diff --git a/tests/auto/quick/qmltests/data/tst_filePicker.qml b/tests/auto/quick/qmltests/data/tst_filePicker.qml
new file mode 100644
index 000000000..a7b59b2e9
--- /dev/null
+++ b/tests/auto/quick/qmltests/data/tst_filePicker.qml
@@ -0,0 +1,297 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import QtTest
+import QtWebEngine
+import "../../qmltests/data"
+import "../mock-delegates/TestParams"
+
+TestWebEngineView {
+ id: webEngineView
+ width: 400
+ height: 300
+
+ function driveLetter() {
+ if (Qt.platform.os !== "windows")
+ return "";
+ return "C:/";
+ }
+
+ SignalSpy {
+ id: titleSpy
+ target: webEngineView
+ signalName: "titleChanged"
+ }
+ SignalSpy {
+ id: terminationSpy
+ target: webEngineView
+ signalName: "renderProcessTerminated"
+ }
+
+ TestCase {
+ id: testCase
+ name: "WebEngineViewSingleFileUpload"
+ when: windowShown
+
+ function init() {
+ FilePickerParams.filePickerOpened = false
+ FilePickerParams.selectFiles = false
+ FilePickerParams.selectedFilesUrl = []
+ FilePickerParams.nameFilters = []
+ titleSpy.clear()
+ terminationSpy.clear()
+ }
+
+ function cleanup() {
+ // Test that the render process doesn't crash, and make sure if it does it does so now.
+ wait(100)
+ verify(terminationSpy.count == 0, "Render process didn't self terminate")
+
+ // FIXME: Almost every second url loading progress does get stuck at about 90 percent, so the loadFinished signal won't arrive.
+ // This cleanup function is a workaround for this problem.
+ webEngineView.url = Qt.resolvedUrl("about:blank")
+ webEngineView.waitForLoadSucceeded()
+ }
+
+ function test_acceptSingleFileSelection_data() {
+ return [
+ { tag: "test.txt", input: "test.txt", expected: "Failed to Upload" },
+ { tag: driveLetter() + "/test.txt", input: driveLetter() + "/test.txt", expected: "test.txt" },
+ { tag: driveLetter() + "/tést.txt", input: driveLetter() + "/tést.txt", expected: "tést.txt" },
+ { tag: driveLetter() + "/t%65st.txt", input: driveLetter() + "/t%65st.txt", expected: "t%65st.txt" },
+ { tag: "file:///" + driveLetter() + "test.txt", input: "file:///" + driveLetter() + "test.txt", expected: "test.txt" },
+ { tag: "file:///" + driveLetter() + "tést.txt", input: "file:///" + driveLetter() + "tést.txt", expected: "tést.txt" },
+ { tag: "file:///" + driveLetter() + "t%65st.txt", input: "file:///" + driveLetter() + "t%65st.txt", expected: "t%65st.txt" },
+ { tag: "file://" + driveLetter() + "test.txt", input: "file://" + driveLetter() + "test.txt", expected: "Failed to Upload" },
+ { tag: "file:/" + driveLetter() + "test.txt", input: "file:/" + driveLetter() + "test.txt", expected: "test.txt"},
+ { tag: "file:test//test.txt", input: "file:test//test.txt", expected: "Failed to Upload" },
+ { tag: "http://test.txt", input: "http://test.txt", expected: "Failed to Upload" },
+ { tag: "qrc:/test.txt", input: "qrc:/test.txt", expected: "Failed to Upload" },
+ ];
+ }
+
+ function test_acceptSingleFileSelection(row) {
+ var expectedFileName;
+
+ // Default dialog
+ webEngineView.url = Qt.resolvedUrl("singlefileupload.html");
+ verify(webEngineView.waitForLoadSucceeded());
+
+ FilePickerParams.selectFiles = true;
+ FilePickerParams.selectedFilesUrl.push(row.input);
+
+ keyClick(Qt.Key_Enter); // Focus is on the button. Open FileDialog.
+ tryCompare(FilePickerParams, "filePickerOpened", true);
+ tryCompare(webEngineView, "title", row.expected);
+ webEngineView.url = Qt.resolvedUrl("about:blank");
+ verify(webEngineView.waitForLoadSucceeded());
+ tryCompare(webEngineView, "title", "about:blank");
+
+
+ // Custom dialog
+ var finished = false;
+
+ function acceptedFileHandler(request) {
+ request.accepted = true;
+ request.dialogAccept([row.input]);
+ finished = true;
+ }
+
+ webEngineView.fileDialogRequested.connect(acceptedFileHandler);
+ webEngineView.url = Qt.resolvedUrl("singlefileupload.html");
+ verify(webEngineView.waitForLoadSucceeded());
+
+ keyClick(Qt.Key_Enter); // Focus is on the button. Open FileDialog.
+ tryVerify(function() { return finished; });
+ tryCompare(webEngineView, "title", row.expected);
+ webEngineView.url = Qt.resolvedUrl("about:blank");
+ verify(webEngineView.waitForLoadSucceeded());
+ tryCompare(webEngineView, "title", "about:blank");
+ webEngineView.fileDialogRequested.disconnect(acceptedFileHandler);
+ }
+
+ function test_acceptMultipleFilesSelection() {
+ webEngineView.url = Qt.resolvedUrl("multifileupload.html")
+ verify(webEngineView.waitForLoadSucceeded())
+
+ FilePickerParams.selectFiles = true
+ FilePickerParams.selectedFilesUrl.push(Qt.resolvedUrl("test1.html"))
+ FilePickerParams.selectedFilesUrl.push(Qt.resolvedUrl("test2.html"))
+
+ keyPress(Qt.Key_Enter) // Focus is on the button. Open FileDialog.
+ tryCompare(FilePickerParams, "filePickerOpened", true)
+ tryCompare(webEngineView, "title", "test1.html,test2.html")
+ }
+
+ function test_acceptDirectory() {
+ webEngineView.url = Qt.resolvedUrl("directoryupload.html")
+ verify(webEngineView.waitForLoadSucceeded())
+
+ webEngineView.runJavaScript(
+ "let relativePathCount = 0;" +
+ "document.getElementById('upfile').addEventListener('change', function(event) {" +
+ " let files = event.target.files;" +
+ " for (let i = 0; i < files.length; i++) {" +
+ " if (files[i].webkitRelativePath != '')" +
+ " relativePathCount++;" +
+ " }" +
+ "}, false);")
+
+ FilePickerParams.selectFiles = true
+ FilePickerParams.selectedFilesUrl.push(Qt.resolvedUrl("../data"))
+
+ keyClick(Qt.Key_Enter) // Focus is on the button. Open FileDialog.
+ tryCompare(FilePickerParams, "directoryPickerOpened", true)
+ // Check that the title is a file list (eg. "test1.html,test2.html")
+ tryVerify(function() { return webEngineView.title.match("^([^,]+,)+[^,]+$"); })
+
+ var relativePathCount = 0;
+ runJavaScript("relativePathCount", function(result) { relativePathCount = result; });
+ // The number of files in data directory may vary
+ tryVerify(function() { return relativePathCount > 0; });
+ }
+
+ function test_reject() {
+ webEngineView.url = Qt.resolvedUrl("singlefileupload.html")
+ verify(webEngineView.waitForLoadSucceeded())
+
+ titleSpy.clear()
+ keyPress(Qt.Key_Enter) // Focus is on the button. Open FileDialog.
+ wait(100)
+ compare(titleSpy.count, 0)
+ }
+
+ function test_acceptMultipleFilesWithCustomDialog_data() {
+ return [
+ { tag: "path", input: [driveLetter() + "/test1.txt", driveLetter() + "/test2.txt"], expectedValue: "test1.txt,test2.txt" },
+ { tag: "file", input: ["file:///" + driveLetter() + "test1.txt", "file:/" + driveLetter() + "test2.txt"], expectedValue: "test1.txt,test2.txt" },
+ { tag: "mixed", input: ["file:///" + driveLetter() + "test1.txt", driveLetter() + "/test2.txt"], expectedValue: "test1.txt,test2.txt" },
+ ];
+ }
+
+ function test_acceptMultipleFilesWithCustomDialog(row) {
+ // Default dialog
+ webEngineView.url = Qt.resolvedUrl("multifileupload.html");
+ verify(webEngineView.waitForLoadSucceeded());
+
+ FilePickerParams.selectFiles = true;
+ FilePickerParams.selectedFilesUrl = row.input;
+
+ keyClick(Qt.Key_Enter); // Focus is on the button. Open FileDialog.
+ tryCompare(FilePickerParams, "filePickerOpened", true);
+ tryCompare(webEngineView, "title", row.expectedValue);
+
+
+ // Custom dialog
+ var finished = false;
+
+ function acceptedFileHandler(request) {
+ request.accepted = true;
+ request.dialogAccept(row.input);
+ finished = true;
+ }
+
+ webEngineView.fileDialogRequested.connect(acceptedFileHandler);
+ webEngineView.url = Qt.resolvedUrl("multifileupload.html");
+ verify(webEngineView.waitForLoadSucceeded());
+
+ keyClick(Qt.Key_Enter); // Focus is on the button. Open FileDialog.
+ tryVerify(function() { return finished; });
+ tryCompare(webEngineView, "title", row.expectedValue);
+ webEngineView.fileDialogRequested.disconnect(acceptedFileHandler);
+ }
+
+ function test_acceptFileOnWindows_data() {
+ return [
+ { tag: "C:test.txt", input: "C:test.txt", expected: "Failed to Upload"},
+ { tag: "C:test:txt", input: "C:test:txt", expected: "Failed to Upload"},
+ { tag: "C:/test.txt", input: "C:/test.txt", expected: "test.txt"},
+ { tag: "C:\\test.txt", input: "C:\\test.txt", expected: "test.txt"},
+ { tag: "C:\\Documents and Settings\\test\\test.txt", input: "C:\\Documents and Settings\\test\\test.txt", expected: "test.txt"},
+ { tag: "\\\\applib\\products\\a%2Db\\ abc%5F9\\t.est\\test.txt", input: "\\\\applib\\products\\a%2Db\\ abc%5F9\\t.est\\test.txt", expected: "test.txt"},
+ { tag: "file://applib/products/a%2Db/ abc%5F9/4148.920a/media/test.txt", input: "file://applib/products/a%2Db/ abc%5F9/4148.920a/media/test.txt", expected: "test.txt"},
+ { tag: "file://applib/products/a-b/abc_1/t.est/test.txt", input: "file://applib/products/a-b/abc_1/t.est/test.txt", expected: "test.txt"},
+ { tag: "file:\\\\applib\\products\\a-b\\abc_1\\t:est\\test.txt", input: "file:\\\\applib\\products\\a-b\\abc_1\\t:est\\test.txt", expected: "test.txt"},
+ { tag: "file:C:/test.txt", input: "file:C:/test.txt", expected: "test.txt"},
+ { tag: "file:/C:/test.txt", input: "file:/C:/test.txt", expected: "test.txt"},
+ { tag: "file://C:/test.txt", input: "file://C:/test.txt", expected: "Failed to Upload"},
+ { tag: "file:///C:test.txt", input: "file:///C:test.txt", expected: "Failed to Upload"},
+ { tag: "file:///C:/test.txt", input: "file:///C:/test.txt", expected: "test.txt"},
+ { tag: "file:///C:\\test.txt", input: "file:///C:\\test.txt", expected: "test.txt"},
+ { tag: "file:\\//C:/test.txt", input: "file:\\//C:/test.txt", expected: "test.txt"},
+ { tag: "file:\\\\/C:\\test.txt", input: "file:\\\\/C:\\test.txt", expected: "test.txt"},
+ { tag: "\\\\?\\C:/test.txt", input: "\\\\?\\C:/test.txt", expected: "test.txt"},
+ ];
+ }
+
+ function test_acceptFileOnWindows(row) {
+ if (Qt.platform.os !== "windows")
+ skip("Windows-only test");
+
+ // Default dialog
+ webEngineView.url = Qt.resolvedUrl("singlefileupload.html");
+ verify(webEngineView.waitForLoadSucceeded());
+
+ FilePickerParams.selectFiles = true;
+ FilePickerParams.selectedFilesUrl.push(row.input);
+
+ keyClick(Qt.Key_Enter); // Focus is on the button. Open FileDialog.
+ tryCompare(FilePickerParams, "filePickerOpened", true);
+ tryCompare(webEngineView, "title", row.expected);
+ webEngineView.url = Qt.resolvedUrl("about:blank");
+ verify(webEngineView.waitForLoadSucceeded());
+ tryCompare(webEngineView, "title", "about:blank");
+
+
+ // Custom dialog
+ var finished = false;
+
+ function acceptedFileHandler(request) {
+ request.accepted = true;
+ request.dialogAccept([row.input]);
+ finished = true;
+ }
+
+ webEngineView.fileDialogRequested.connect(acceptedFileHandler);
+ webEngineView.url = Qt.resolvedUrl("singlefileupload.html");
+ verify(webEngineView.waitForLoadSucceeded());
+
+ keyClick(Qt.Key_Enter); // Focus is on the button. Open FileDialog.
+ tryVerify(function() { return finished; });
+ tryCompare(webEngineView, "title", row.expected);
+ webEngineView.url = Qt.resolvedUrl("about:blank");
+ verify(webEngineView.waitForLoadSucceeded());
+ tryCompare(webEngineView, "title", "about:blank");
+ webEngineView.fileDialogRequested.disconnect(acceptedFileHandler);
+ }
+
+ function test_acceptFileTypes_data() {
+ return [
+ { tag: "CustomSuffix", input: ".pug", expected: ".pug", exactMatch: false},
+ { tag: "CustomMime", input: "dog/pug", expected: "Accepted types ()", exactMatch: true},
+ { tag: "CustomGlob", input: "dog/*", expected: "Accepted types ()", exactMatch: true},
+ { tag: "Invalid", input: "---", expected: undefined, exactMatch: true},
+ { tag: "Jpeg", input: "image/jpeg", expected: ".jpeg", exactMatch: false}
+ ];
+ }
+
+ function test_acceptFileTypes(row) {
+ var expectedFileName;
+
+ webEngineView.url = Qt.resolvedUrl("accepttypes.html");
+ verify(webEngineView.waitForLoadSucceeded());
+
+ webEngineView.runJavaScript("setAcceptType('" + row.input + "');");
+ tryCompare(webEngineView, "title", row.input);
+
+ keyClick(Qt.Key_Enter); // Focus is on the button. Open FileDialog.
+ tryCompare(FilePickerParams, "filePickerOpened", true);
+
+ if (row.exactMatch)
+ compare(FilePickerParams.nameFilters[0], row.expected);
+ else
+ verify(FilePickerParams.nameFilters[0].includes(row.expected));
+ }
+ }
+}
diff --git a/tests/auto/quick/qmltests/data/tst_filesystem.qml b/tests/auto/quick/qmltests/data/tst_filesystem.qml
new file mode 100644
index 000000000..fa0da4457
--- /dev/null
+++ b/tests/auto/quick/qmltests/data/tst_filesystem.qml
@@ -0,0 +1,124 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import QtTest
+import QtWebEngine
+import Test.util
+import "../../qmltests/data"
+import "../mock-delegates/TestParams"
+
+
+TestWebEngineView {
+ id: webEngineView
+ width: 400
+ height: 300
+ property var logs: []
+ property bool accessRequested: false
+ property url file: tempDir.pathUrl('file.txt')
+
+ onJavaScriptConsoleMessage: function(level, message, lineNumber, source) {
+ var pair = message.split(':');
+ if (pair.length == 2 && pair[0] == "TEST")
+ logs.push(pair[1]);
+ }
+
+ TempDir { id: tempDir }
+
+ TestCase {
+ id: testCase
+ name: "FileSystemAPI"
+ when: windowShown
+
+ function init() {
+ clearLog()
+ FilePickerParams.filePickerOpened = false
+ FilePickerParams.selectFiles = false
+ FilePickerParams.selectedFilesUrl = []
+ FilePickerParams.nameFilters = []
+ accessRequested = false;
+ }
+
+ function cleanup() {
+ clearLog()
+ }
+
+ function clearLog() {
+ logs = []
+ }
+
+ function logContainsDoneMarker() {
+ if (logs.indexOf("DONE") > -1)
+ return true
+ else
+ return false
+ }
+
+ function result() {
+ return logs[0]
+ }
+
+ function fileAccessRequest(request) {
+ testCase.verify(!accessRequested)
+ accessRequested = true
+ testCase.verify(request.filePath == file)
+ testCase.verify(request.accessFlags == WebEngineFileSystemAccessRequest.Write | WebEngineFileSystemAccessRequest.Read)
+ request.accept()
+ }
+
+ function directoryAccessRequest(request) {
+ testCase.verify(!accessRequested)
+ accessRequested = true
+ testCase.verify(request.filePath == tempDir.pathUrl())
+ testCase.verify(request.accessFlags == WebEngineFileSystemAccessRequest.Read)
+ request.accept()
+ }
+
+ function test_saveFile() {
+ webEngineView.fileSystemAccessRequested.connect(fileAccessRequest);
+ webEngineView.url = Qt.resolvedUrl("filesystemapi.html?dialog=savePicker");
+ verify(webEngineView.waitForLoadSucceeded());
+ FilePickerParams.selectFiles = true;
+ FilePickerParams.selectedFilesUrl.push(file);
+ keyClick(Qt.Key_Enter); // Open SaveDialog.
+ tryCompare(FilePickerParams, "filePickerOpened", true);
+ tryVerify(logContainsDoneMarker,2000)
+ // write access for save dialogs is automatically granted
+ verify(!accessRequested)
+ webEngineView.fileSystemAccessRequested.disconnect(fileAccessRequest);
+ }
+
+ function test_openFile() {
+ // first save the file before open
+ test_saveFile()
+ init()
+ webEngineView.fileSystemAccessRequested.connect(fileAccessRequest);
+ webEngineView.url = Qt.resolvedUrl("filesystemapi.html?dialog=filePicker");
+ verify(webEngineView.waitForLoadSucceeded());
+ FilePickerParams.selectFiles = true;
+ FilePickerParams.selectedFilesUrl.push(file);
+ keyClick(Qt.Key_Enter); // Open FileDialog.
+ tryCompare(FilePickerParams, "filePickerOpened", true);
+ tryVerify(logContainsDoneMarker,2000)
+ verify(logs.indexOf("TEST_CONTENT") > -1)
+ verify(accessRequested)
+ webEngineView.fileSystemAccessRequested.disconnect(fileAccessRequest);
+ }
+
+ function test_selectDirectory() {
+ tempDir.createDirectory("TEST_DIR")
+ webEngineView.fileSystemAccessRequested.connect(directoryAccessRequest);
+ webEngineView.url = Qt.resolvedUrl("filesystemapi.html?dialog=directoryPicker");
+ verify(webEngineView.waitForLoadSucceeded())
+ FilePickerParams.selectFiles = true;
+ FilePickerParams.selectedFilesUrl.push(tempDir.pathUrl());
+ keyClick(Qt.Key_Enter); // Open showDirectoryDialog.
+ tryCompare(FilePickerParams, "directoryPickerOpened", true);
+ tryVerify(logContainsDoneMarker,2000)
+ verify(logs.indexOf("TEST_DIR") > -1)
+ verify(accessRequested)
+ webEngineView.fileSystemAccessRequested.disconnect(directoryAccessRequest);
+ }
+
+ }
+}
diff --git a/tests/auto/quick/qmltests/data/tst_findText.qml b/tests/auto/quick/qmltests/data/tst_findText.qml
index c02a1348e..597cff73e 100644
--- a/tests/auto/quick/qmltests/data/tst_findText.qml
+++ b/tests/auto/quick/qmltests/data/tst_findText.qml
@@ -1,34 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.2
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import QtTest
+import QtWebEngine
TestWebEngineView {
id: webEngineView
@@ -56,7 +31,7 @@ TestWebEngineView {
// If this starts to fail then either clear was not called before findText
// or unexpected callback was triggered from some search.
// On c++ side callback id can be checked to verify
- testcase.verify(!findCallbackCalled(), 'Unexpected callback call or uncleared state before findText call!')
+ testCase.verify(!findCallbackCalled(), 'Unexpected callback call or uncleared state before findText call!')
webEngineView.matchCount = matchCount
findFailed = matchCount == 0
@@ -64,7 +39,7 @@ TestWebEngineView {
TestCase {
- id: testcase
+ id: testCase
name: "WebViewFindText"
function getBodyInnerHTML() {
@@ -231,8 +206,7 @@ TestWebEngineView {
var listItemText = '';
for (var i = 0; i < 100000; ++i)
- listItemText += "bla ";
- listItemText = listItemText.trim();
+ listItemText += "bla";
webEngineView.loadHtml(
"<html><body>" +
diff --git a/tests/auto/quick/qmltests/data/tst_focusOnNavigation.qml b/tests/auto/quick/qmltests/data/tst_focusOnNavigation.qml
index 93410a727..f070e4bc5 100644
--- a/tests/auto/quick/qmltests/data/tst_focusOnNavigation.qml
+++ b/tests/auto/quick/qmltests/data/tst_focusOnNavigation.qml
@@ -1,34 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.5
-import QtTest 1.0
-import QtWebEngine 1.4
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import QtTest
+import QtWebEngine
Item {
id: container
@@ -65,6 +40,7 @@ Item {
}
TestCase {
+ id: testCase
name: "WebEngineViewFocusOnNavigation"
when: windowShown
diff --git a/tests/auto/quick/qmltests/data/tst_fullScreenRequest.qml b/tests/auto/quick/qmltests/data/tst_fullScreenRequest.qml
new file mode 100644
index 000000000..c7996a11e
--- /dev/null
+++ b/tests/auto/quick/qmltests/data/tst_fullScreenRequest.qml
@@ -0,0 +1,82 @@
+import QtQuick
+import QtTest
+import QtWebEngine
+
+TestWebEngineView {
+ id: view
+ width: 320
+ height: 320
+
+ property bool acceptRequest: false
+
+ onFullScreenRequested: function(request) {
+ view.acceptRequest ? request.accept() : request.reject()
+ }
+
+ SignalSpy {
+ id: spyRequest
+ target: view
+ signalName: 'fullScreenRequested'
+ }
+
+ TestCase {
+ name: 'FullScreenRequest'
+ when: windowShown
+
+ function init() {
+ spyRequest.clear()
+ }
+
+ function test_request_data() {
+ return [
+ { tag: 'accept', accept: true },
+ { tag: 'reject', accept: false },
+ ]
+ }
+
+ function test_request(data) {
+ view.acceptRequest = data.accept
+ view.settings.fullscreenSupportEnabled = true
+
+ // full screen request is only allowed by user gesture, so emulate key press
+ view.loadHtml(
+ '<html><body onkeypress="onKeyPress()"><a id="a">WRYYYY</a><script>' +
+ 'function onKeyPress() {' +
+ ' document.webkitIsFullScreen'+
+ ' ? document.webkitExitFullscreen()' +
+ ' : document.documentElement.webkitRequestFullScreen()' +
+ '} </script></body></html>')
+ view.waitForLoadSucceeded()
+ verify(!view.isFullScreen)
+
+ let result = null
+ view.runJavaScript('document.webkitFullscreenEnabled', function(r) { result = r })
+ tryVerify(function() { return result === true })
+
+ result = null
+ view.runJavaScript('document.webkitIsFullScreen', function(r) { result = r })
+ tryVerify(function() { return result === false })
+
+ // will trigger full screen request through key press
+ keyClick(Qt.Key_Space)
+ spyRequest.wait()
+ compare(spyRequest.count, 1)
+ verify(spyRequest.signalArguments[0][0].toggleOn)
+ compare(data.accept, view.isFullScreen)
+
+ view.runJavaScript('document.webkitIsFullScreen', function(r) { result = r })
+ tryVerify(function() { return result === data.accept })
+
+ if (data.accept) {
+ // expected to toggle from current state
+ keyClick(Qt.Key_Space)
+ spyRequest.wait()
+ compare(spyRequest.count, 2)
+ verify(!spyRequest.signalArguments[1][0].toggleOn)
+ view.runJavaScript('document.webkitIsFullScreen', function(r) { result = r })
+ tryVerify(function() { return result === false })
+ verify(!view.isFullScreen)
+ }
+ }
+ }
+}
diff --git a/tests/auto/quick/qmltests/data/tst_geopermission.qml b/tests/auto/quick/qmltests/data/tst_geopermission.qml
index c935ac0b4..b99e50acc 100644
--- a/tests/auto/quick/qmltests/data/tst_geopermission.qml
+++ b/tests/auto/quick/qmltests/data/tst_geopermission.qml
@@ -1,34 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-import QtQuick 2.2
-import QtTest 1.0
-import QtWebEngine 1.1
+import QtQuick
+import QtTest
+import QtWebEngine
TestWebEngineView {
id: webEngineView
@@ -37,7 +12,6 @@ TestWebEngineView {
property bool deniedGeolocation: false
property bool geoPermissionRequested: false
- signal consoleErrorMessage(string message)
SignalSpy {
id: featurePermissionSpy
@@ -45,13 +19,7 @@ TestWebEngineView {
signalName: "featurePermissionRequested"
}
- SignalSpy {
- id: consoleErrorMessageSpy
- target: webEngineView
- signalName: "consoleErrorMessage"
- }
-
- onFeaturePermissionRequested: {
+ onFeaturePermissionRequested: function(securityOrigin, feature) {
if (feature === WebEngineView.Geolocation) {
geoPermissionRequested = true
if (deniedGeolocation) {
@@ -63,19 +31,31 @@ TestWebEngineView {
}
}
- onJavaScriptConsoleMessage: {
- if (level === WebEngineView.ErrorMessageLevel)
- consoleErrorMessage(message)
- }
-
TestCase {
name: "WebViewGeopermission"
when: windowShown
+ function isHandled() {
+ var handled;
+ runJavaScript("handled", function(result) {
+ handled = result;
+ });
+ tryVerify(function() { return handled != undefined; }, 5000);
+ return handled;
+ }
+
+ function getErrorMessage() {
+ var errorMessage;
+ runJavaScript("errorMessage", function(result) {
+ errorMessage = result;
+ });
+ tryVerify(function() { return errorMessage != undefined; }, 5000);
+ return errorMessage;
+ }
+
function init() {
deniedGeolocation = false
featurePermissionSpy.clear()
- consoleErrorMessageSpy.clear()
}
function test_geoPermissionRequest() {
@@ -84,17 +64,16 @@ TestWebEngineView {
featurePermissionSpy.wait()
verify(geoPermissionRequested)
compare(featurePermissionSpy.count, 1)
- consoleErrorMessageSpy.wait()
- verify(consoleErrorMessageSpy.signalArguments[0][0] === "Success" ||
- consoleErrorMessageSpy.signalArguments[0][0] === "")
+ tryVerify(isHandled, 5000)
+ verify(getErrorMessage() === "")
}
function test_deniedGeolocationByUser() {
deniedGeolocation = true
webEngineView.url = Qt.resolvedUrl("geolocation.html")
featurePermissionSpy.wait()
- consoleErrorMessageSpy.wait()
- compare(consoleErrorMessageSpy.signalArguments[0][0], "User denied Geolocation")
+ tryVerify(isHandled, 5000)
+ compare(getErrorMessage(), "User denied Geolocation")
}
}
}
diff --git a/tests/auto/quick/qmltests/data/tst_getUserMedia.qml b/tests/auto/quick/qmltests/data/tst_getUserMedia.qml
index d1c894699..3b33b7abe 100644
--- a/tests/auto/quick/qmltests/data/tst_getUserMedia.qml
+++ b/tests/auto/quick/qmltests/data/tst_getUserMedia.qml
@@ -1,34 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.2
-import QtTest 1.0
-import QtWebEngine 1.6
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import QtTest
+import QtWebEngine
TestWebEngineView {
id: webEngineView
@@ -126,8 +101,8 @@ TestWebEngineView {
signalName: "loadFinished"
}
- onLoadingChanged: {
- if (loadRequest.status == WebEngineLoadRequest.LoadSucceededStatus) {
+ onLoadingChanged: function(load) {
+ if (load.status == WebEngineView.LoadSucceededStatus) {
loadFinished()
}
}
@@ -143,7 +118,7 @@ TestWebEngineView {
property variant requestedFeature
property variant requestedSecurityOrigin
- onFeaturePermissionRequested: {
+ onFeaturePermissionRequested: function(securityOrigin, feature) {
requestedFeature = feature
requestedSecurityOrigin = securityOrigin
}
diff --git a/tests/auto/quick/qmltests/data/tst_inputMethod.qml b/tests/auto/quick/qmltests/data/tst_inputMethod.qml
new file mode 100644
index 000000000..cf79e8a4d
--- /dev/null
+++ b/tests/auto/quick/qmltests/data/tst_inputMethod.qml
@@ -0,0 +1,53 @@
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import QtTest
+import QtWebEngine
+import Test.util
+import "../../qmltests/data"
+
+TestWebEngineView {
+ id: webEngineView
+ width: 200
+ height: 400
+
+ TestInputContext { id: testInputContext }
+
+ TestCase {
+ id: testCase
+ name: "WebEngineViewInputMethod"
+ when: windowShown
+
+ function init() {
+ testInputContext.create();
+ }
+
+ function cleanup() {
+ testInputContext.release();
+ }
+
+ function test_softwareInputPanel() {
+ verify(!Qt.inputMethod.visible);
+ webEngineView.loadHtml(
+ "<html><body>" +
+ " <form><input id='textInput' type='text' /></form>" +
+ "</body></html");
+ verify(webEngineView.waitForLoadSucceeded());
+
+ verify(!getActiveElementId());
+ verify(!Qt.inputMethod.visible);
+
+ // Show input panel
+ webEngineView.runJavaScript("document.getElementById('textInput').focus()");
+ webEngineView.verifyElementHasFocus("textInput");
+ tryVerify(function() { return Qt.inputMethod.visible; });
+
+ // Hide input panel
+ webEngineView.runJavaScript("document.getElementById('textInput').blur()");
+ verify(!getActiveElementId());
+ tryVerify(function() { return !Qt.inputMethod.visible; });
+ }
+ }
+}
+
diff --git a/tests/auto/quick/qmltests/data/tst_inputTextDirection.qml b/tests/auto/quick/qmltests/data/tst_inputTextDirection.qml
new file mode 100644
index 000000000..2141db4c8
--- /dev/null
+++ b/tests/auto/quick/qmltests/data/tst_inputTextDirection.qml
@@ -0,0 +1,43 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import QtTest
+import QtWebEngine
+
+TestWebEngineView {
+ id: webEngineView
+ width: 400
+ height: 400
+
+ TestCase {
+ id: testCase
+ name: "WebEngineInputTextDirection"
+ when: windowShown
+
+ function getInputTextDirection(element) {
+ var dir;
+ runJavaScript("document.getElementById('" + element + "').dir", function(result) {
+ dir = result;
+ });
+ tryVerify(function() { return dir != undefined; });
+ return dir;
+ }
+
+ function test_changeInputTextDirection() {
+ webEngineView.loadHtml("<html><body><input type='text' id='textfield' value='some text'></body></html>");
+ verify(webEngineView.waitForLoadSucceeded());
+ setFocusToElement("textfield");
+
+ var rtlAction = webEngineView.action(WebEngineView.ChangeTextDirectionRTL);
+ verify(rtlAction);
+ rtlAction.trigger();
+ compare(getInputTextDirection("textfield"), "rtl");
+
+ var ltrAction = webEngineView.action(WebEngineView.ChangeTextDirectionLTR);
+ verify(ltrAction);
+ ltrAction.trigger();
+ compare(getInputTextDirection("textfield"), "ltr");
+ }
+ }
+}
diff --git a/tests/auto/quick/qmltests/data/tst_javaScriptDialogs.qml b/tests/auto/quick/qmltests/data/tst_javaScriptDialogs.qml
new file mode 100644
index 000000000..6e91b2e77
--- /dev/null
+++ b/tests/auto/quick/qmltests/data/tst_javaScriptDialogs.qml
@@ -0,0 +1,123 @@
+// Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import QtTest
+import QtWebEngine
+import "../../qmltests/data"
+import "../mock-delegates/TestParams"
+
+TestWebEngineView {
+ id: webEngineView
+ anchors.fill: parent
+
+ property bool windowCloseRejectedCalled: false
+
+ // Called by QQuickWebEngineViewPrivate::windowCloseRejected()
+ function windowCloseRejected() {
+ windowCloseRejectedCalled = true;
+ }
+
+ TestCase {
+ id: test
+ name: "WebEngineViewJavaScriptDialogs"
+ when: windowShown
+
+ function init() {
+ JSDialogParams.dialogMessage = "";
+ JSDialogParams.dialogTitle = "";
+ JSDialogParams.dialogCount = 0;
+ JSDialogParams.shouldAcceptDialog = true;
+ }
+
+ function test_alert() {
+ webEngineView.url = Qt.resolvedUrl("alert.html")
+ verify(webEngineView.waitForLoadSucceeded())
+ compare(JSDialogParams.dialogCount, 1)
+ compare(JSDialogParams.dialogMessage, "Hello Qt")
+ verify(JSDialogParams.dialogTitle.indexOf("Javascript Alert -") === 0)
+ }
+
+ function test_confirm() {
+ webEngineView.url = Qt.resolvedUrl("confirm.html")
+ verify(webEngineView.waitForLoadSucceeded())
+ compare(JSDialogParams.dialogMessage, "Confirm test")
+ compare(JSDialogParams.dialogCount, 1)
+ compare(webEngineView.title, "ACCEPTED")
+ JSDialogParams.shouldAcceptDialog = false
+ webEngineView.reload()
+ verify(webEngineView.waitForLoadSucceeded())
+ compare(JSDialogParams.dialogCount, 2)
+ compare(webEngineView.title, "REJECTED")
+
+ }
+ function readMousePressRecieved() {
+ var mousePressReceived;
+ runJavaScript("window.mousePressReceived", function(result) {
+ mousePressReceived = result;
+ });
+
+ _waitFor(function() { return mousePressReceived != undefined; });
+ return mousePressReceived;
+ }
+
+ function simulateUserGesture() {
+ // A user gesture after page load is required since Chromium 60 to allow showing
+ // an onbeforeunload dialog.
+ // See https://www.chromestatus.com/feature/5082396709879808
+ mouseClick(webEngineView, 10, 10, Qt.LeftButton)
+
+ tryVerify(readMousePressRecieved)
+ }
+
+ function test_confirmClose() {
+ webEngineView.url = Qt.resolvedUrl("confirmclose.html");
+ verify(webEngineView.waitForLoadSucceeded());
+ webEngineView.windowCloseRequestedSignalEmitted = false;
+ JSDialogParams.shouldAcceptDialog = true;
+
+ simulateUserGesture()
+ webEngineView.triggerWebAction(WebEngineView.RequestClose);
+ verify(webEngineView.waitForWindowCloseRequested());
+
+ // Navigate away from page with onbeforeunload handler,
+ // otherwise it would trigger an extra dialog request when
+ // navigating in the subsequent test.
+ webEngineView.url = Qt.resolvedUrl("about:blank");
+ verify(webEngineView.waitForLoadSucceeded());
+ compare(JSDialogParams.dialogCount, 2)
+ }
+
+ function test_rejectClose() {
+ webEngineView.url = Qt.resolvedUrl("confirmclose.html");
+ verify(webEngineView.waitForLoadSucceeded());
+ webEngineView.windowCloseRejectedCalled = false;
+ JSDialogParams.shouldAcceptDialog = false;
+
+ simulateUserGesture()
+ webEngineView.triggerWebAction(WebEngineView.RequestClose);
+ tryVerify(function() { return webEngineView.windowCloseRejectedCalled; });
+
+ // Navigate away from page with onbeforeunload handler,
+ // otherwise it would trigger an extra dialog request when
+ // navigating in the subsequent test.
+ JSDialogParams.shouldAcceptDialog = true;
+ webEngineView.url = Qt.resolvedUrl("about:blank");
+ verify(webEngineView.waitForLoadSucceeded());
+ compare(JSDialogParams.dialogCount, 2)
+ }
+
+ function test_prompt() {
+ JSDialogParams.inputForPrompt = "tQ olleH"
+ webEngineView.url = Qt.resolvedUrl("prompt.html")
+ verify(webEngineView.waitForLoadSucceeded())
+ compare(JSDialogParams.dialogCount, 1)
+ compare(webEngineView.title, "tQ olleH")
+ JSDialogParams.shouldAcceptDialog = false
+ webEngineView.reload()
+ verify(webEngineView.waitForLoadSucceeded())
+ compare(JSDialogParams.dialogCount, 2)
+ compare(webEngineView.title, "null")
+ }
+ }
+}
diff --git a/tests/auto/quick/qmltests/data/tst_keyboardEvents.qml b/tests/auto/quick/qmltests/data/tst_keyboardEvents.qml
index 2536f319b..0f69a7e81 100644
--- a/tests/auto/quick/qmltests/data/tst_keyboardEvents.qml
+++ b/tests/auto/quick/qmltests/data/tst_keyboardEvents.qml
@@ -1,34 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.4
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import QtTest
+import QtWebEngine
TestWebEngineView {
id: webEngineView
@@ -36,6 +11,7 @@ TestWebEngineView {
height: 480
TestCase {
+ id: testCase
name: "WebEngineViewKeyboardEvents"
when: windowShown
@@ -53,20 +29,6 @@ TestWebEngineView {
"Element \"" + element + "\" is " + (expected ? "" : "not") + " checked");
}
- function getElementValue(element) {
- var elementValue;
- runJavaScript("document.getElementById('" + element + "').value", function(result) {
- elementValue = result;
- });
- tryVerify(function() { return elementValue != undefined; });
- return elementValue;
- }
-
- function compareElementValue(element, expected) {
- tryVerify(function() { return expected == getElementValue(element); }, 5000,
- "Value of element \"" + element + "\" is \"" + expected + "\"");
- }
-
function test_keyboardEvents() {
webEngineView.url = Qt.resolvedUrl("keyboardEvents.html");
verify(webEngineView.waitForLoadSucceeded());
diff --git a/tests/auto/quick/qmltests/data/tst_keyboardModifierMapping.qml b/tests/auto/quick/qmltests/data/tst_keyboardModifierMapping.qml
index e0a8c0a41..d0bc75619 100644
--- a/tests/auto/quick/qmltests/data/tst_keyboardModifierMapping.qml
+++ b/tests/auto/quick/qmltests/data/tst_keyboardModifierMapping.qml
@@ -1,34 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.2
+import QtQuick
+import QtTest
+import QtWebEngine
TestWebEngineView {
id: webEngineView
diff --git a/tests/auto/quick/qmltests/data/tst_linkHovered.qml b/tests/auto/quick/qmltests/data/tst_linkHovered.qml
new file mode 100644
index 000000000..a11bd2450
--- /dev/null
+++ b/tests/auto/quick/qmltests/data/tst_linkHovered.qml
@@ -0,0 +1,108 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import QtTest
+import QtWebEngine
+import "../../qmltests/data"
+
+TestWebEngineView {
+ id: webEngineView
+ width: 200
+ height: 400
+ focus: true
+
+ property string lastUrl
+
+ SignalSpy {
+ id: linkHoveredSpy
+ target: webEngineView
+ signalName: "linkHovered"
+ }
+
+ onLinkHovered: function(hoveredUrl) {
+ webEngineView.lastUrl = hoveredUrl
+ }
+
+ function isViewRendered() {
+ var pixel = getItemPixel(webEngineView);
+
+ // The center pixel is expected to be red.
+ if (pixel[0] !== 255) return false;
+ if (pixel[1] !== 0) return false;
+ if (pixel[2] !== 0) return false;
+
+ return true;
+ }
+
+ TestCase {
+ id: testCase
+ name: "DesktopWebEngineViewLinkHovered"
+
+ // Delayed windowShown to workaround problems with Qt5 in debug mode.
+ when: false
+ Timer {
+ running: parent.windowShown
+ repeat: false
+ interval: 1
+ onTriggered: parent.when = true
+ }
+
+ function init() {
+ webEngineView.lastUrl = "";
+ linkHoveredSpy.clear();
+ }
+
+ function test_linkHovered() {
+ compare(linkHoveredSpy.count, 0);
+ mouseMove(webEngineView, 100, 300)
+ webEngineView.url = Qt.resolvedUrl("test2.html")
+ verify(webEngineView.waitForLoadSucceeded())
+
+ // We get a linkHovered signal with empty hoveredUrl after page load
+ linkHoveredSpy.wait();
+ compare(linkHoveredSpy.count, 1);
+ compare(webEngineView.lastUrl, "")
+
+ // Wait for the page to be rendered before trying to test based on input events
+ tryVerify(isViewRendered);
+
+ mouseMove(webEngineView, 100, 100)
+ linkHoveredSpy.wait(12000);
+ compare(linkHoveredSpy.count, 2);
+ compare(webEngineView.lastUrl, Qt.resolvedUrl("test1.html"))
+ mouseMove(webEngineView, 100, 300)
+ linkHoveredSpy.wait(12000);
+ compare(linkHoveredSpy.count, 3);
+ compare(webEngineView.lastUrl, "")
+ }
+
+ function test_linkHoveredDoesntEmitRepeated() {
+ compare(linkHoveredSpy.count, 0);
+ webEngineView.url = Qt.resolvedUrl("test2.html")
+ verify(webEngineView.waitForLoadSucceeded())
+
+ // We get a linkHovered signal with empty hoveredUrl after page load
+ linkHoveredSpy.wait();
+ compare(linkHoveredSpy.count, 1);
+ compare(webEngineView.lastUrl, "")
+
+ // Wait for the page to be rendered before trying to test based on input events
+ tryVerify(isViewRendered);
+
+ for (var i = 0; i < 100; i += 10)
+ mouseMove(webEngineView, 100, 100 + i)
+
+ linkHoveredSpy.wait(12000);
+ compare(linkHoveredSpy.count, 2);
+ compare(webEngineView.lastUrl, Qt.resolvedUrl("test1.html"))
+
+ for (var i = 0; i < 100; i += 10)
+ mouseMove(webEngineView, 100, 300 + i)
+
+ linkHoveredSpy.wait(12000);
+ compare(linkHoveredSpy.count, 3);
+ compare(webEngineView.lastUrl, "")
+ }
+ }
+}
diff --git a/tests/auto/quick/qmltests/data/tst_loadFail.qml b/tests/auto/quick/qmltests/data/tst_loadFail.qml
new file mode 100644
index 000000000..8e9224bbf
--- /dev/null
+++ b/tests/auto/quick/qmltests/data/tst_loadFail.qml
@@ -0,0 +1,79 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import QtTest
+import QtWebEngine
+import "../../qmltests/data"
+
+TestWebEngineView {
+ id: webEngineView
+ width: 400
+ height: 300
+
+ property var unavailableUrl: Qt.resolvedUrl("file_that_does_not_exist.html")
+
+ SignalSpy {
+ id: loadSpy
+ target: webEngineView
+ signalName: 'loadingChanged'
+ }
+
+ TestCase {
+ id: test
+ name: "WebEngineViewLoadFail"
+
+ function cleanup() {
+ loadSpy.clear()
+ }
+
+ function test_fail() {
+ WebEngine.settings.errorPageEnabled = false
+ webEngineView.url = unavailableUrl
+ verify(webEngineView.waitForLoadFailed())
+ }
+
+ function test_fail_url() {
+ WebEngine.settings.errorPageEnabled = false
+ var url = Qt.resolvedUrl("test1.html")
+ webEngineView.url = url
+ compare(webEngineView.url, url)
+ verify(webEngineView.waitForLoadSucceeded())
+ compare(webEngineView.url, url)
+
+ webEngineView.url = unavailableUrl
+ compare(webEngineView.url, unavailableUrl)
+ verify(webEngineView.waitForLoadFailed())
+ // When error page is disabled in case of LoadFail the entry of the unavailable page is not stored.
+ // We expect the url of the previously loaded page here.
+ compare(webEngineView.url, url)
+ }
+
+ function test_error_page() {
+ WebEngine.settings.errorPageEnabled = true
+ webEngineView.url = unavailableUrl
+
+ // Loading of the error page must be successful
+ verify(webEngineView.waitForLoadFailed())
+
+ // Start to load unavailableUrl
+ let loadStart = loadSpy.signalArguments[0][0]
+ compare(loadStart.status, WebEngineView.LoadStartedStatus)
+ compare(loadStart.errorDomain, WebEngineView.NoErrorDomain)
+ compare(loadStart.errorDomain, WebEngineLoadingInfo.NoErrorDomain)
+ compare(loadStart.url, unavailableUrl)
+ verify(!loadStart.isErrorPage)
+
+ // Loading of the unavailableUrl must fail
+ let loadFail = loadSpy.signalArguments[1][0]
+ compare(loadFail.status, WebEngineView.LoadFailedStatus)
+ compare(loadFail.errorDomain, WebEngineView.InternalErrorDomain)
+ compare(loadFail.errorDomain, WebEngineLoadingInfo.InternalErrorDomain)
+ compare(loadFail.url, unavailableUrl)
+ verify(loadFail.isErrorPage)
+
+ compare(webEngineView.url, unavailableUrl)
+ compare(webEngineView.title, unavailableUrl)
+ }
+ }
+}
diff --git a/tests/auto/quick/qmltests/data/tst_loadHtml.qml b/tests/auto/quick/qmltests/data/tst_loadHtml.qml
index ed1de41fd..8f94cd4a2 100644
--- a/tests/auto/quick/qmltests/data/tst_loadHtml.qml
+++ b/tests/auto/quick/qmltests/data/tst_loadHtml.qml
@@ -1,34 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.2
+import QtQuick
+import QtTest
+import QtWebEngine
TestWebEngineView {
id: webEngineView
@@ -42,6 +17,7 @@ TestWebEngineView {
}
TestCase {
+ id: testCase
name: "WebEngineViewLoadHtml"
when: windowShown
diff --git a/tests/auto/quick/qmltests/data/tst_loadProgress.qml b/tests/auto/quick/qmltests/data/tst_loadProgress.qml
index 15058cb8f..2c06a0207 100644
--- a/tests/auto/quick/qmltests/data/tst_loadProgress.qml
+++ b/tests/auto/quick/qmltests/data/tst_loadProgress.qml
@@ -1,34 +1,11 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.2
+import QtQuick
+import QtTest
+import QtWebEngine
+
+import Test.Shared as Shared
TestWebEngineView {
id: webEngineView
@@ -55,10 +32,14 @@ TestWebEngineView {
compare(spyProgress.count, 0)
loadProgressArray = []
- webEngineView.url = Qt.resolvedUrl("test1.html")
+ verify(Shared.HttpServer.start())
+ Shared.HttpServer.newRequest.connect(request => {
+ wait(250) // just add delay to trigger some progress for every sub resource
+ })
+ webEngineView.url = Shared.HttpServer.url('/loadprogress/main.html')
// Wait for the first loadProgressChanged signal, which have to be non-negative
spyProgress.wait()
- verify(loadProgressArray[0] >= 0)
+ compare(loadProgressArray[0], 0)
verify(webEngineView.loadProgress >= 0)
// Wait for the last loadProgressChanged signal, which have to be 100%
@@ -67,13 +48,13 @@ TestWebEngineView {
compare(loadProgressArray[loadProgressArray.length - 1], 100)
compare(webEngineView.loadProgress, 100)
- // Test whether the chromium emits progress numbers in ascending order
- var loadProgressMin = 0
- for (var i in loadProgressArray) {
- var loadProgress = loadProgressArray[i]
- if (loadProgressMin > loadProgress)
+ // Test whether the chromium emits progress numbers in strict monotonic ascending order
+ let progress = 0
+ for (let i = 1; i < loadProgressArray.length; ++i) {
+ let nextProgress = loadProgressArray[i]
+ if (nextProgress <= progress)
fail("Invalid sequence of progress-values: " + loadProgressArray)
- loadProgressMin = loadProgress
+ progress = nextProgress
}
}
}
diff --git a/tests/auto/quick/qmltests/data/tst_loadRecursionCrash.qml b/tests/auto/quick/qmltests/data/tst_loadRecursionCrash.qml
index 81a0f0904..c0eb5932b 100644
--- a/tests/auto/quick/qmltests/data/tst_loadRecursionCrash.qml
+++ b/tests/auto/quick/qmltests/data/tst_loadRecursionCrash.qml
@@ -1,34 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-import QtQuick 2.3
-import QtTest 1.0
-import QtWebEngine 1.2
+import QtQuick
+import QtTest
+import QtWebEngine
Item {
width: 300
diff --git a/tests/auto/quick/qmltests/data/tst_loadUrl.qml b/tests/auto/quick/qmltests/data/tst_loadUrl.qml
index 872c46641..25a62c878 100644
--- a/tests/auto/quick/qmltests/data/tst_loadUrl.qml
+++ b/tests/auto/quick/qmltests/data/tst_loadUrl.qml
@@ -1,34 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.2
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import QtTest
+import QtWebEngine
TestWebEngineView {
id: webEngineView
@@ -37,10 +12,10 @@ TestWebEngineView {
property var loadRequestArray: []
- onLoadingChanged: {
+ onLoadingChanged: function(load) {
loadRequestArray.push({
- "status": loadRequest.status,
- "url": loadRequest.url,
+ "status": load.status,
+ "url": load.url,
"activeUrl": webEngineView.url
});
}
@@ -52,6 +27,7 @@ TestWebEngineView {
}
TestCase {
+ id: testCase
name: "WebEngineViewLoadUrl"
when: windowShown
@@ -79,8 +55,8 @@ TestWebEngineView {
var aboutBlank = "about:blank";
webEngineView.url = aboutBlank;
verify(webEngineView.waitForLoadSucceeded());
- compare(loadRequestArray[0].status, WebEngineView.LoadStartedStatus);
- compare(loadRequestArray[1].status, WebEngineView.LoadSucceededStatus);
+ compare(loadRequestArray[0].status, WebEngineLoadingInfo.LoadStartedStatus);
+ compare(loadRequestArray[1].status, WebEngineLoadingInfo.LoadSucceededStatus);
compare(loadRequestArray.length, 2);
compare(webEngineView.url, aboutBlank);
webEngineView.clear();
@@ -133,6 +109,7 @@ TestWebEngineView {
compare(loadRequest.activeUrl, bogusSite);
loadRequest = loadRequestArray[1];
compare(loadRequest.status, WebEngineView.LoadFailedStatus);
+ compare(loadRequest.status, WebEngineLoadingInfo.LoadFailedStatus);
compare(loadRequest.activeUrl, url);
webEngineView.clear();
@@ -148,10 +125,10 @@ TestWebEngineView {
compare(loadRequest.status, WebEngineView.LoadSucceededStatus);
compare(loadRequest.activeUrl, redirectUrl);
loadRequest = loadRequestArray[2];
- compare(loadRequest.status, WebEngineView.LoadStartedStatus);
+ compare(loadRequest.status, WebEngineLoadingInfo.LoadStartedStatus);
compare(loadRequest.activeUrl, redirectUrl);
loadRequest = loadRequestArray[3];
- compare(loadRequest.status, WebEngineView.LoadSucceededStatus);
+ compare(loadRequest.status, WebEngineLoadingInfo.LoadSucceededStatus);
compare(loadRequest.activeUrl, url);
webEngineView.clear();
@@ -173,11 +150,11 @@ TestWebEngineView {
tryCompare(loadRequestArray, "length", 2);
loadRequest = loadRequestArray[0];
- compare(loadRequest.status, WebEngineView.LoadStartedStatus);
+ compare(loadRequest.status, WebEngineLoadingInfo.LoadStartedStatus);
compare(loadRequest.url, url);
compare(loadRequest.activeUrl, lastUrl);
loadRequest = loadRequestArray[1];
- compare(loadRequest.status, WebEngineView.LoadSucceededStatus);
+ compare(loadRequest.status, WebEngineLoadingInfo.LoadSucceededStatus);
compare(loadRequest.url, url);
compare(loadRequest.activeUrl, url);
webEngineView.clear();
@@ -225,15 +202,16 @@ TestWebEngineView {
compare(loadRequest.activeUrl, bogusSite);
loadRequest = loadRequestArray[1];
compare(loadRequest.status, WebEngineView.LoadFailedStatus);
+ compare(loadRequest.status, WebEngineLoadingInfo.LoadFailedStatus);
// Since the load did not succeed the active url is the
// URL of the previous successful load.
compare(loadRequest.activeUrl, aboutBlank);
loadRequest = loadRequestArray[2];
- compare(loadRequest.status, WebEngineView.LoadStartedStatus);
+ compare(loadRequest.status, WebEngineLoadingInfo.LoadStartedStatus);
compare(loadRequest.activeUrl, bogusSite);
compare(loadRequest.url, "data:text/html;charset=UTF-8,load failed")
loadRequest = loadRequestArray[3];
- compare(loadRequest.status, WebEngineView.LoadSucceededStatus);
+ compare(loadRequest.status, WebEngineLoadingInfo.LoadSucceededStatus);
compare(loadRequest.activeUrl, bogusSite);
compare(loadRequest.url, bogusSite)
webEngineView.clear();
@@ -285,6 +263,7 @@ TestWebEngineView {
compare(loadRequest.activeUrl, stoppedUrl);
loadRequest = loadRequestArray[1];
compare(loadRequest.status, WebEngineView.LoadStoppedStatus);
+ compare(loadRequest.status, WebEngineLoadingInfo.LoadStoppedStatus);
compare(loadRequest.url, stoppedUrl);
compare(loadRequest.activeUrl, initialUrl);
webEngineView.clear();
@@ -298,20 +277,19 @@ TestWebEngineView {
compare(loadRequestArray[0].status, WebEngineView.LoadStartedStatus);
compare(loadRequestArray[1].status, WebEngineView.LoadSucceededStatus);
- // In-page navigation.
- webEngineView.url = Qt.resolvedUrl("test4.html#content");
- // In-page navigation doesn't trigger load succeeded, wait for load progress instead.
- tryCompare(webEngineView, "loadProgress", 100);
- compare(loadRequestArray.length, 3);
- compare(loadRequestArray[2].status, WebEngineView.LoadStartedStatus);
+ // In-page navigation shouldn't trigger load
+ let anchorUrl = Qt.resolvedUrl("test4.html#anchor");
+ let c = webEngineView.getElementCenter('anchor')
+ mouseClick(webEngineView, c.x, c.y)
+ tryCompare(webEngineView, 'url', anchorUrl)
// Load after in-page navigation.
webEngineView.url = Qt.resolvedUrl("test4.html");
verify(webEngineView.waitForLoadSucceeded());
compare(webEngineView.loadProgress, 100);
- compare(loadRequestArray.length, 5);
- compare(loadRequestArray[3].status, WebEngineView.LoadStartedStatus);
- compare(loadRequestArray[4].status, WebEngineView.LoadSucceededStatus);
+ compare(loadRequestArray.length, 4);
+ compare(loadRequestArray[2].status, WebEngineView.LoadStartedStatus);
+ compare(loadRequestArray[3].status, WebEngineView.LoadSucceededStatus);
webEngineView.clear();
}
diff --git a/tests/auto/quick/qmltests/data/tst_mouseClick.qml b/tests/auto/quick/qmltests/data/tst_mouseClick.qml
new file mode 100644
index 000000000..c0c6a6967
--- /dev/null
+++ b/tests/auto/quick/qmltests/data/tst_mouseClick.qml
@@ -0,0 +1,108 @@
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import QtTest
+import QtWebEngine
+import Test.util
+import "../../qmltests/data"
+
+TestWebEngineView {
+ id: webEngineView
+ width: 200
+ height: 200
+
+ TestInputEvent {
+ id: testInputEvent
+
+ function __mouseMultiClick(item, x, y, clickCount) {
+ if (!item)
+ qtest_fail("No item given to mouseMultiClick", 1);
+
+ if (x === undefined)
+ x = item.width / 2;
+ if (y === undefined)
+ y = item.height / 2;
+ if (!mouseMultiClick(item, x, y, clickCount))
+ qtest_fail("window not shown", 2);
+ }
+
+ function mouseDoubleClick(item, x, y) {
+ __mouseMultiClick(item, x, y, 2);
+ }
+
+ function mouseTripleClick(item, x, y) {
+ __mouseMultiClick(item, x, y, 3);
+ }
+
+ function mouseQuadraClick(item, x, y) {
+ __mouseMultiClick(item, x, y, 4);
+ }
+ }
+
+
+ TestCase {
+ id: testCase
+ name: "WebEngineViewMouseClick"
+ when: windowShown
+
+ function test_singleClick() {
+ webEngineView.settings.focusOnNavigationEnabled = false;
+ webEngineView.loadHtml("<html><body>" +
+ "<form><input id='input' width='150' type='text' value='The Qt Company' /></form>" +
+ "</body></html>");
+ verify(webEngineView.waitForLoadSucceeded());
+ verify(!getActiveElementId());
+
+ var center = getElementCenter("input");
+ mouseClick(webEngineView, center.x, center.y);
+ verifyElementHasFocus("input");
+ compare(getTextSelection(), "");
+ }
+
+ function test_doubleClick() {
+ webEngineView.settings.focusOnNavigationEnabled = true;
+ webEngineView.loadHtml("<html><body onload='document.getElementById(\"input\").focus()'>" +
+ "<form><input id='input' width='150' type='text' value='The Qt Company' /></form>" +
+ "</body></html>");
+ verify(webEngineView.waitForLoadSucceeded());
+
+ var center = getElementCenter("input");
+ testInputEvent.mouseDoubleClick(webEngineView, center.x, center.y);
+ verifyElementHasFocus("input");
+ tryVerify(function() { return getTextSelection() == "Company" });
+
+ mouseClick(webEngineView, center.x, center.y);
+ tryVerify(function() { return getTextSelection() == "" });
+ }
+
+ function test_tripleClick() {
+ webEngineView.settings.focusOnNavigationEnabled = true;
+ webEngineView.loadHtml("<html><body onload='document.getElementById(\"input\").focus()'>" +
+ "<form><input id='input' width='150' type='text' value='The Qt Company' /></form>" +
+ "</body></html>");
+ verify(webEngineView.waitForLoadSucceeded());
+
+ var center = getElementCenter("input");
+ testInputEvent.mouseTripleClick(webEngineView, center.x, center.y);
+ verifyElementHasFocus("input");
+ tryVerify(function() { return getTextSelection() == "The Qt Company" });
+
+ mouseClick(webEngineView, center.x, center.y);
+ tryVerify(function() { return getTextSelection() == "" });
+ }
+
+ function test_quadraClick() {
+ webEngineView.settings.focusOnNavigationEnabled = true;
+ webEngineView.loadHtml("<html><body onload='document.getElementById(\"input\").focus()'>" +
+ "<form><input id='input' width='150' type='text' value='The Qt Company' /></form>" +
+ "</body></html>");
+ verify(webEngineView.waitForLoadSucceeded());
+
+ var center = getElementCenter("input");
+ testInputEvent.mouseQuadraClick(webEngineView, center.x, center.y);
+ verifyElementHasFocus("input");
+ tryVerify(function() { return getTextSelection() == "" });
+ }
+ }
+}
diff --git a/tests/auto/quick/qmltests/data/tst_mouseMove.qml b/tests/auto/quick/qmltests/data/tst_mouseMove.qml
index adfa3941c..5ded24c57 100644
--- a/tests/auto/quick/qmltests/data/tst_mouseMove.qml
+++ b/tests/auto/quick/qmltests/data/tst_mouseMove.qml
@@ -1,34 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.4
+import QtQuick
+import QtTest
+import QtWebEngine
Rectangle {
id: root
diff --git a/tests/auto/quick/qmltests/data/tst_navigationHistory.qml b/tests/auto/quick/qmltests/data/tst_navigationHistory.qml
index 6ed232589..2ea76c387 100644
--- a/tests/auto/quick/qmltests/data/tst_navigationHistory.qml
+++ b/tests/auto/quick/qmltests/data/tst_navigationHistory.qml
@@ -1,34 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.2
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import QtTest
+import QtWebEngine
TestWebEngineView {
id: webEngineView
@@ -38,7 +13,7 @@ TestWebEngineView {
ListView {
id: backItemsList
anchors.fill: parent
- model: webEngineView.navigationHistory.backItems
+ model: webEngineView.history.backItems
currentIndex: count - 1
delegate:
Text {
@@ -50,7 +25,7 @@ TestWebEngineView {
ListView {
id: forwardItemsList
anchors.fill: parent
- model: webEngineView.navigationHistory.forwardItems
+ model: webEngineView.history.forwardItems
currentIndex: 0
delegate:
Text {
@@ -59,11 +34,23 @@ TestWebEngineView {
}
}
+ Item { // simple button-like interface to not depend on controls
+ id: backButton
+ enabled: webEngineView.canGoBack
+ function clicked() { if (enabled) webEngineView.goBack() }
+ }
+
+ Item { // simple button-like interface to not depend on controls
+ id: forwardButton
+ enabled: webEngineView.canGoForward
+ function clicked() { if (enabled) webEngineView.goForward() }
+ }
+
TestCase {
- name: "WebEngineViewNavigationHistory"
+ name: "NavigationHistory"
function test_navigationHistory() {
- compare(webEngineView.loadProgress, 0)
+ webEngineView.history.clear()
webEngineView.url = Qt.resolvedUrl("test1.html")
verify(webEngineView.waitForLoadSucceeded())
@@ -135,12 +122,58 @@ TestWebEngineView {
compare(backItemsList.currentItem.text, Qt.resolvedUrl("test1.html"))
compare(forwardItemsList.currentItem.text, Qt.resolvedUrl("javascript.html"))
- webEngineView.navigationHistory.clear()
+ webEngineView.history.clear()
compare(webEngineView.url, Qt.resolvedUrl("test2.html"))
compare(webEngineView.canGoBack, false)
compare(webEngineView.canGoForward, false)
compare(backItemsList.count, 0)
compare(forwardItemsList.count, 0)
}
+
+ function test_navigationButtons() {
+ webEngineView.history.clear()
+
+ const url1 = Qt.resolvedUrl("test1.html")
+ webEngineView.url = url1
+ verify(webEngineView.waitForLoadSucceeded())
+ compare(backButton.enabled, false)
+ compare(forwardButton.enabled, false)
+
+ const url2 = Qt.resolvedUrl("test2.html")
+ webEngineView.url = url2
+ verify(webEngineView.waitForLoadSucceeded())
+ compare(backButton.enabled, true)
+ compare(forwardButton.enabled, false)
+
+ const url3 = Qt.resolvedUrl("test3.html")
+ webEngineView.url = url3
+ verify(webEngineView.waitForLoadSucceeded())
+ compare(backButton.enabled, true)
+ compare(forwardButton.enabled, false)
+
+ backButton.clicked()
+ verify(webEngineView.waitForLoadSucceeded())
+ compare(backButton.enabled, true)
+ compare(forwardButton.enabled, true)
+ compare(webEngineView.url, url2)
+
+ backButton.clicked()
+ verify(webEngineView.waitForLoadSucceeded())
+ compare(backButton.enabled, false)
+ compare(forwardButton.enabled, true)
+ compare(webEngineView.url, url1)
+
+ forwardButton.clicked()
+ verify(webEngineView.waitForLoadSucceeded())
+ compare(backButton.enabled, true)
+ compare(forwardButton.enabled, true)
+ compare(webEngineView.url, url2)
+
+ webEngineView.url = url1
+ verify(webEngineView.waitForLoadSucceeded())
+ compare(backButton.enabled, true)
+ compare(forwardButton.enabled, false)
+ compare(webEngineView.url, url1)
+ }
}
}
diff --git a/tests/auto/quick/qmltests/data/tst_navigationRequested.qml b/tests/auto/quick/qmltests/data/tst_navigationRequested.qml
index 96128574e..31c0cf44e 100644
--- a/tests/auto/quick/qmltests/data/tst_navigationRequested.qml
+++ b/tests/auto/quick/qmltests/data/tst_navigationRequested.qml
@@ -1,34 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.2
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import QtTest
+import QtWebEngine
TestWebEngineView {
id: webEngineView
@@ -59,26 +34,27 @@ TestWebEngineView {
signalName: "navigationRequested"
}
- onNavigationRequested: {
+ onNavigationRequested: function(request) {
if (request.isMainFrame) {
attributes.mainUrl = request.url
} else {
attributes.iframeUrl = request.url
if (shouldIgnoreSubFrameRequests) {
- request.action = WebEngineView.IgnoreRequest
+ request.reject()
}
}
- if (request.navigationType === WebEngineView.LinkClickedNavigation) {
+ if (request.navigationType === WebEngineNavigationRequest.LinkClickedNavigation) {
attributes.linkClickedNavigationRequested = true
if (shouldIgnoreLinkClicks) {
- request.action = WebEngineView.IgnoreRequest
+ request.reject()
attributes.linkClickedNavigationIgnored = true
}
}
}
TestCase {
+ id: testCase
name: "WebEngineViewNavigationRequested"
when: windowShown
@@ -93,19 +69,17 @@ TestWebEngineView {
// Test if we get notified about main frame and iframe loads
compare(navigationSpy.count, 0)
webEngineView.url = Qt.resolvedUrl("test-iframe.html")
- navigationSpy.wait()
+ verify(webEngineView.waitForLoadSucceeded())
compare(attributes.mainUrl, Qt.resolvedUrl("test-iframe.html"))
- navigationSpy.wait()
compare(attributes.iframeUrl, Qt.resolvedUrl("test1.html"))
compare(navigationSpy.count, 2)
- verify(webEngineView.waitForLoadSucceeded())
// Test if we get notified about clicked links
mouseClick(webEngineView, 100, 100)
- tryCompare(navigationSpy, "count", 3)
+ verify(webEngineView.waitForLoadSucceeded())
compare(attributes.mainUrl, Qt.resolvedUrl("test1.html"))
verify(attributes.linkClickedNavigationRequested)
- verify(webEngineView.waitForLoadSucceeded())
+ compare(navigationSpy.count, 3)
}
function test_ignoreLinkClickedRequest() {
@@ -116,26 +90,28 @@ TestWebEngineView {
shouldIgnoreLinkClicks = true
mouseClick(webEngineView, 100, 100)
- tryCompare(navigationSpy, "count", 3)
- compare(attributes.mainUrl, Qt.resolvedUrl("test1.html"))
- verify(attributes.linkClickedNavigationRequested)
- verify(attributes.linkClickedNavigationIgnored)
// We ignored the main frame request, so we should
// get notified that the load has been stopped.
verify(webEngineView.waitForLoadStopped())
verify(!webEngineView.loading)
+
+ compare(navigationSpy.count, 3)
+ compare(attributes.mainUrl, Qt.resolvedUrl("test1.html"))
+ verify(attributes.linkClickedNavigationRequested)
+ verify(attributes.linkClickedNavigationIgnored)
}
function test_ignoreSubFrameRequest() {
// Test if we can ignore sub frame requests
shouldIgnoreSubFrameRequests = true
webEngineView.url = Qt.resolvedUrl("test-iframe.html")
- tryCompare(navigationSpy, "count", 2)
- compare(attributes.mainUrl, Qt.resolvedUrl("test-iframe.html"))
- compare(attributes.iframeUrl, Qt.resolvedUrl("test1.html"))
// We ignored the sub frame request, so
// the main frame load should still succeed.
verify(webEngineView.waitForLoadSucceeded())
+
+ compare(navigationSpy.count, 2)
+ compare(attributes.mainUrl, Qt.resolvedUrl("test-iframe.html"))
+ compare(attributes.iframeUrl, Qt.resolvedUrl("test1.html"))
}
}
}
diff --git a/tests/auto/quick/qmltests/data/tst_newViewRequest.qml b/tests/auto/quick/qmltests/data/tst_newViewRequest.qml
index a671c2ec7..68350d107 100644
--- a/tests/auto/quick/qmltests/data/tst_newViewRequest.qml
+++ b/tests/auto/quick/qmltests/data/tst_newViewRequest.qml
@@ -1,34 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.5
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import QtTest
+import QtWebEngine
TestWebEngineView {
id: webEngineView
@@ -37,14 +12,22 @@ TestWebEngineView {
property var newViewRequest: null
property var dialog: null
+ property string viewType: ""
+ property var loadRequestArray: []
+
+ onLoadingChanged: function(load) {
+ loadRequestArray.push({
+ "status": load.status,
+ });
+ }
SignalSpy {
id: newViewRequestedSpy
target: webEngineView
- signalName: "newViewRequested"
+ signalName: "newWindowRequested"
}
- onNewViewRequested: {
+ onNewWindowRequested: function(request) {
newViewRequest = {
"destination": request.destination,
"userInitiated": request.userInitiated,
@@ -52,7 +35,7 @@ TestWebEngineView {
};
dialog = Qt.createQmlObject(
- "import QtQuick.Window 2.0\n" +
+ "import QtQuick.Window\n" +
"Window {\n" +
" width: 100; height: 100\n" +
" visible: true; flags: Qt.Dialog\n" +
@@ -60,12 +43,17 @@ TestWebEngineView {
" TestWebEngineView { id: webView; anchors.fill: parent }\n" +
"}", webEngineView);
- request.openIn(dialog.webEngineView);
+ if (viewType === "dialog")
+ request.openIn(dialog.webEngineView);
+ else if (viewType === "null")
+ request.openIn(0);
+ else if (viewType === "webEngineView")
+ request.openIn(webEngineView);
}
TestCase {
- id: test
- name: "NewViewRequest"
+ id: testCase
+ name: "NewWindowRequest"
when: windowShown
function init() {
@@ -74,6 +62,8 @@ TestWebEngineView {
newViewRequestedSpy.clear();
newViewRequest = null;
+ viewType = "";
+ loadRequestArray = [];
}
function cleanup() {
@@ -81,7 +71,17 @@ TestWebEngineView {
dialog.destroy();
}
- function test_jsWindowOpen() {
+ function test_loadNewWindowRequest_data() {
+ return [
+ { tag: "dialog", viewType: "dialog" },
+ { tag: "invalid", viewType: "null" },
+ { tag: "unhandled", viewType: "" },
+ { tag: "webEngineView", viewType: "webEngineView" },
+ ];
+ }
+
+ function test_loadNewWindowRequest(row) {
+ viewType = row.viewType;
var url = 'data:text/html,%3Chtml%3E%3Cbody%3ETest+Page%3C%2Fbody%3E%3C%2Fhtml%3E';
// Open an empty page in a new tab
@@ -93,15 +93,16 @@ TestWebEngineView {
verify(webEngineView.waitForLoadSucceeded());
tryCompare(newViewRequestedSpy, "count", 1);
- compare(newViewRequest.destination, WebEngineView.NewViewInTab);
+ compare(newViewRequest.destination, WebEngineNewWindowRequest.InNewTab);
verify(!newViewRequest.userInitiated);
- verify(dialog.webEngineView.waitForLoadSucceeded());
- compare(dialog.webEngineView.url, "");
- // https://chromium-review.googlesource.com/c/chromium/src/+/1300395
- compare(newViewRequest.requestedUrl, 'about:blank#blocked');
+ if (viewType === "dialog") {
+ tryVerify(dialog.webEngineView.loadSucceeded)
+ compare(dialog.webEngineView.url, Qt.url("about:blank"));
+ dialog.destroy();
+ }
+ compare(newViewRequest.requestedUrl, 'about:blank');
newViewRequestedSpy.clear();
- dialog.destroy();
// Open a page in a new dialog
webEngineView.loadHtml(
@@ -112,33 +113,55 @@ TestWebEngineView {
verify(webEngineView.waitForLoadSucceeded());
tryCompare(newViewRequestedSpy, "count", 1);
- compare(newViewRequest.destination, WebEngineView.NewViewInDialog);
+ compare(newViewRequest.destination, WebEngineNewWindowRequest.InNewDialog);
compare(newViewRequest.requestedUrl, url);
verify(!newViewRequest.userInitiated);
- verify(dialog.webEngineView.waitForLoadSucceeded());
+ if (viewType === "dialog") {
+ tryVerify(dialog.webEngineView.loadSucceeded)
+ dialog.destroy();
+ }
newViewRequestedSpy.clear();
- dialog.destroy();
- // Open a page in a new dialog by user
- webEngineView.loadHtml(
- "<html><head><script>" +
- " function popup() { window.open('" + url + "', '_blank', 'width=200,height=100'); }" +
- "</script></head>" +
- "<body onload=\"document.getElementById('popupButton').focus();\">" +
- " <button id='popupButton' onclick='popup()'>Pop Up!</button>" +
- "</body></html>");
+ if (viewType !== "webEngineView") {
+ // Open a page in a new dialog by user
+ webEngineView.loadHtml(
+ "<html><head><script>" +
+ " function popup() { window.open('" + url + "', '_blank', 'width=200,height=100'); }" +
+ "</script></head>" +
+ "<body onload=\"document.getElementById('popupButton').focus();\">" +
+ " <button id='popupButton' onclick='popup()'>Pop Up!</button>" +
+ "</body></html>");
+ verify(webEngineView.waitForLoadSucceeded());
+ webEngineView.verifyElementHasFocus("popupButton");
+ keyPress(Qt.Key_Enter);
+ tryCompare(newViewRequestedSpy, "count", 1);
+ compare(newViewRequest.requestedUrl, url);
+
+ compare(newViewRequest.destination, WebEngineNewWindowRequest.InNewDialog);
+ verify(newViewRequest.userInitiated);
+ if (viewType === "dialog") {
+ tryVerify(dialog.webEngineView.loadSucceeded)
+ dialog.destroy();
+ }
+ newViewRequestedSpy.clear();
+ }
+
+ loadRequestArray = [];
+ compare(loadRequestArray.length, 0);
+ webEngineView.url = Qt.resolvedUrl("test2.html");
verify(webEngineView.waitForLoadSucceeded());
- verifyElementHasFocus("popupButton");
- keyPress(Qt.Key_Enter);
+ var center = webEngineView.getElementCenter("link");
+ mouseClick(webEngineView, center.x, center.y, Qt.LeftButton, Qt.ControlModifier);
tryCompare(newViewRequestedSpy, "count", 1);
- compare(newViewRequest.requestedUrl, url);
-
- compare(newViewRequest.destination, WebEngineView.NewViewInDialog);
+ compare(newViewRequest.requestedUrl, Qt.resolvedUrl("test1.html"));
+ compare(newViewRequest.destination, WebEngineNewWindowRequest.InNewBackgroundTab);
verify(newViewRequest.userInitiated);
- verify(dialog.webEngineView.waitForLoadSucceeded());
+ if (viewType === "" || viewType === "null") {
+ compare(loadRequestArray[0].status, WebEngineView.LoadStartedStatus);
+ compare(loadRequestArray[1].status, WebEngineView.LoadSucceededStatus);
+ compare(loadRequestArray.length, 2);
+ }
newViewRequestedSpy.clear();
- dialog.destroy();
}
}
}
-
diff --git a/tests/auto/quick/qmltests/data/tst_notification.qml b/tests/auto/quick/qmltests/data/tst_notification.qml
index 773bf4a8e..5d55e1201 100644
--- a/tests/auto/quick/qmltests/data/tst_notification.qml
+++ b/tests/auto/quick/qmltests/data/tst_notification.qml
@@ -1,34 +1,10 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.2
-import QtTest 1.0
-import QtWebEngine 1.9
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import QtTest
+import QtWebEngine
+import Test.Shared as Shared
TestWebEngineView {
id: view
@@ -47,7 +23,7 @@ TestWebEngineView {
signalName: 'featurePermissionRequested'
}
- onFeaturePermissionRequested: {
+ onFeaturePermissionRequested: function(securityOrigin, feature) {
if (feature === WebEngineView.Notifications) {
view.permissionRequested = true
view.securityOrigin = securityOrigin
@@ -60,7 +36,8 @@ TestWebEngineView {
when: windowShown
function resolverUrl(html) {
- return Qt.resolvedUrl('../../../shared/data/' + html)
+ console.log(Shared.HttpServer.sharedDataDir())
+ return Qt.resolvedUrl(Shared.HttpServer.sharedDataDir() + "/" + html)
}
function init() {
diff --git a/tests/auto/quick/qmltests/data/tst_profile.qml b/tests/auto/quick/qmltests/data/tst_profile.qml
deleted file mode 100644
index ee7fa4e99..000000000
--- a/tests/auto/quick/qmltests/data/tst_profile.qml
+++ /dev/null
@@ -1,66 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.9
-
-TestWebEngineView {
- id: webEngineView
- width: 400
- height: 300
-
-
- WebEngineProfile {
- id: profile1
- }
- WebEngineProfile {
- id: profile2
- }
- property bool profile1UsedForGlobalCertificateVerification: profile1.useForGlobalCertificateVerification
-
- TestCase {
- name: "WebEngineProfile"
-
- function test_useForGlobalCertificateVerification() {
- verify(!profile1.useForGlobalCertificateVerification);
- verify(!profile2.useForGlobalCertificateVerification);
- verify(!webEngineView.profile1UsedForGlobalCertificateVerification);
-
- profile1.useForGlobalCertificateVerification = true;
- verify(profile1.useForGlobalCertificateVerification);
- verify(!profile2.useForGlobalCertificateVerification);
- verify(webEngineView.profile1UsedForGlobalCertificateVerification);
-
- profile2.useForGlobalCertificateVerification = true;
- verify(!webEngineView.profile1UsedForGlobalCertificateVerification);
- verify(!profile1.useForGlobalCertificateVerification);
- verify(profile2.useForGlobalCertificateVerification);
- }
- }
-}
diff --git a/tests/auto/quick/qmltests/data/tst_properties.qml b/tests/auto/quick/qmltests/data/tst_properties.qml
index 89f8af9b8..13d40ed11 100644
--- a/tests/auto/quick/qmltests/data/tst_properties.qml
+++ b/tests/auto/quick/qmltests/data/tst_properties.qml
@@ -1,34 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.2
+import QtQuick
+import QtTest
+import QtWebEngine
TestWebEngineView {
id: webEngineView
diff --git a/tests/auto/quick/qmltests/data/tst_runJavaScript.qml b/tests/auto/quick/qmltests/data/tst_runJavaScript.qml
index beeebc049..f16cd9c41 100644
--- a/tests/auto/quick/qmltests/data/tst_runJavaScript.qml
+++ b/tests/auto/quick/qmltests/data/tst_runJavaScript.qml
@@ -1,34 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.2
+import QtQuick
+import QtTest
+import QtWebEngine
TestWebEngineView {
id: webEngineView
@@ -59,8 +34,7 @@ TestWebEngineView {
compare(result, testTitle2);
callbackCalled = true;
});
- wait(100);
- verify(callbackCalled);
+ tryVerify(function() { return callbackCalled; });
}
}
}
diff --git a/tests/auto/quick/qmltests/data/tst_save.qml b/tests/auto/quick/qmltests/data/tst_save.qml
new file mode 100644
index 000000000..3289dbd8b
--- /dev/null
+++ b/tests/auto/quick/qmltests/data/tst_save.qml
@@ -0,0 +1,185 @@
+import QtQuick
+import QtTest
+import QtWebEngine
+import Test.util
+
+TestWebEngineView {
+ id: webEngineView
+ width: 200
+ height: 200
+ profile: testSaveProfile
+
+ property url downloadUrl: ""
+ property int totalBytes: 0
+ property int receivedBytes: 0
+ property string downloadDir: ""
+ property string downloadFileName: ""
+ property bool isSavePageDownload: false
+ property var downloadState: []
+ property int savePageFormat: WebEngineDownloadRequest.MimeHtmlSaveFormat;
+ property bool autoCancel: false
+
+ TempDir {
+ id: tempDir
+ }
+
+ SignalSpy {
+ id: downLoadRequestedSpy
+ target: testSaveProfile
+ signalName: "downloadRequested"
+ }
+
+ SignalSpy {
+ id: downloadFinishedSpy
+ target: testSaveProfile
+ signalName: "downloadFinished"
+ }
+
+ WebEngineProfile {
+ id: testSaveProfile
+
+ onDownloadRequested: function(download) {
+ downloadState.push(download.state)
+ downloadUrl = download.url
+ savePageFormat = download.savePageFormat
+ downloadDir = download.downloadDirectory;
+ downloadFileName = download.downloadFileName
+ isSavePageDownload = download.isSavePageDownload
+
+ if (autoCancel)
+ download.cancel()
+ }
+ onDownloadFinished: function(download) {
+ receivedBytes = download.receivedBytes
+ totalBytes = download.totalBytes
+ downloadState.push(download.state)
+ }
+ }
+
+ TestCase {
+ name: "WebEngineViewSave"
+
+ function verifyData() {
+ var isDataValid = false
+ webEngineView.runJavaScript("(function() {" +
+ "var title = document.title.toString();" +
+ "var body = document.body.innerText;" +
+ " return title === \"Test page 1\" && body.includes(\"Hello.\")" +
+ "})();", function(result) {
+ isDataValid = result;
+ });
+ tryVerify(function() { return isDataValid });
+ return isDataValid;
+ }
+
+ function init() {
+ downLoadRequestedSpy.clear()
+ downloadFinishedSpy.clear()
+ totalBytes = 0
+ receivedBytes = 0
+ downloadDir = ""
+ downloadFileName = ""
+ isSavePageDownload = false
+ downloadState = []
+ downloadUrl = ""
+ autoCancel = false
+ }
+
+ function test_savePage_data() {
+ return [
+ { tag: "SingleHtmlSaveFormat", savePageFormat: WebEngineDownloadRequest.SingleHtmlSaveFormat },
+ { tag: "CompleteHtmlSaveFormat", savePageFormat: WebEngineDownloadRequest.CompleteHtmlSaveFormat },
+ { tag: "MimeHtmlSaveFormat", savePageFormat: WebEngineDownloadRequest.MimeHtmlSaveFormat },
+ ];
+ }
+
+ function test_savePage(row) {
+ var saveFormat = row.savePageFormat
+
+ var fileDir = tempDir.path()
+ var fileName = "saved_page.html"
+ var filePath = fileDir + "/"+ fileName
+
+ // load data to view
+ webEngineView.url = Qt.resolvedUrl("test1.html")
+ verify(webEngineView.waitForLoadSucceeded())
+ verify(verifyData())
+
+ webEngineView.save(filePath, saveFormat)
+ downLoadRequestedSpy.wait()
+ compare(downLoadRequestedSpy.count, 1)
+ compare(downloadUrl, webEngineView.url)
+ compare(savePageFormat, saveFormat)
+ compare(downloadDir, fileDir)
+ compare(downloadFileName, fileName)
+ compare(isSavePageDownload, true)
+ compare(downloadState[0], WebEngineDownloadRequest.DownloadInProgress)
+ downloadFinishedSpy.wait()
+ compare(downloadFinishedSpy.count, 1)
+ compare(totalBytes, receivedBytes)
+ compare(downloadState[1], WebEngineDownloadRequest.DownloadCompleted)
+
+ // load some other data
+ webEngineView.url = Qt.resolvedUrl("about:blank")
+ verify(webEngineView.waitForLoadSucceeded())
+
+ // load save file to view
+ webEngineView.url = Qt.resolvedUrl(filePath)
+ verify(webEngineView.waitForLoadSucceeded())
+ verify(verifyData())
+ }
+
+ function test_saveImage_data() {
+ return [
+ { tag: "Auto accept", autoCancel: false },
+ { tag: "Cancel", autoCancel: true },
+ ];
+ }
+
+ function test_saveImage(row) {
+ autoCancel = row.autoCancel
+
+ var fileDir = tempDir.path()
+ var fileName = "favicon.png"
+ var filePath = fileDir + "/"+ fileName
+
+ // Load an image
+ webEngineView.url = Qt.resolvedUrl("icons/favicon.png")
+ verify(webEngineView.waitForLoadSucceeded())
+
+ webEngineView.save(filePath)
+ downLoadRequestedSpy.wait()
+ compare(downLoadRequestedSpy.count, 1)
+ compare(downloadUrl, webEngineView.url)
+ compare(downloadDir, fileDir)
+ compare(downloadFileName, fileName)
+ compare(isSavePageDownload, true)
+ compare(downloadState[0], WebEngineDownloadRequest.DownloadInProgress)
+ downloadFinishedSpy.wait()
+ compare(downloadFinishedSpy.count, 1)
+ if (autoCancel) {
+ compare(receivedBytes, 0)
+ compare(downloadState[1], WebEngineDownloadRequest.DownloadCancelled)
+ } else {
+ compare(totalBytes, receivedBytes)
+ compare(downloadState[1], WebEngineDownloadRequest.DownloadCompleted)
+ }
+ }
+
+ function test_saveWebAction() {
+ // Load an image
+ webEngineView.url = Qt.resolvedUrl("icons/favicon.png")
+ verify(webEngineView.waitForLoadSucceeded())
+
+ // Saving without specifying path shouldn't be auto accepted
+ webEngineView.triggerWebAction(WebEngineView.SavePage)
+ downLoadRequestedSpy.wait()
+ compare(downLoadRequestedSpy.count, 1)
+ compare(downloadUrl, webEngineView.url)
+ compare(isSavePageDownload, true)
+ // The initial download request starts from DownloadRequested state,
+ // which means it wasn't automatically accepted.
+ compare(downloadState[0], WebEngineDownloadRequest.DownloadRequested)
+ }
+ }
+}
diff --git a/tests/auto/quick/qmltests/data/tst_scrollPosition.qml b/tests/auto/quick/qmltests/data/tst_scrollPosition.qml
index 24b352dde..cc7d15e4c 100644
--- a/tests/auto/quick/qmltests/data/tst_scrollPosition.qml
+++ b/tests/auto/quick/qmltests/data/tst_scrollPosition.qml
@@ -1,35 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-import QtQuick 2.2
-import QtQuick.Window 2.0
-import QtTest 1.0
-import QtWebEngine 1.3
+import QtQuick
+import QtTest
+import QtWebEngine
TestWebEngineView {
id: webEngineView
@@ -61,7 +35,7 @@ TestWebEngineView {
tryCompare(scrollPositionSpy, "count", 1);
compare(webEngineView.scrollPosition.x, 0);
- compare(webEngineView.scrollPosition.y, 600 * Screen.devicePixelRatio);
+ compare(webEngineView.scrollPosition.y, 600);
}
function test_scrollPositionAfterReload() {
@@ -74,13 +48,13 @@ TestWebEngineView {
// Wait for proper scroll position change otherwise we cannot expect
// the new y position after reload.
tryCompare(webEngineView.scrollPosition, "x", 0);
- tryCompare(webEngineView.scrollPosition, "y", 600 * Screen.devicePixelRatio);
+ tryCompare(webEngineView.scrollPosition, "y", 600);
webEngineView.reload();
verify(webEngineView.waitForLoadSucceeded());
tryCompare(webEngineView.scrollPosition, "x", 0);
- tryCompare(webEngineView.scrollPosition, "y", 600 * Screen.devicePixelRatio);
+ tryCompare(webEngineView.scrollPosition, "y", 600);
}
}
}
diff --git a/tests/auto/quick/qmltests/data/tst_settings.qml b/tests/auto/quick/qmltests/data/tst_settings.qml
index 2ff4f9c3c..f47674aa7 100644
--- a/tests/auto/quick/qmltests/data/tst_settings.qml
+++ b/tests/auto/quick/qmltests/data/tst_settings.qml
@@ -1,34 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.2
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import QtTest
+import QtWebEngine
TestWebEngineView {
id: webEngineView
@@ -36,6 +11,7 @@ TestWebEngineView {
height: 300
TestCase {
+ id: testCase
name: "WebEngineViewSettings"
function test_javascriptEnabled() {
@@ -75,7 +51,7 @@ TestWebEngineView {
}
function test_settingsAffectCurrentViewOnly() {
- var webEngineView2 = Qt.createQmlObject('TestWebEngineView {width: 400; height: 300;}', webEngineView);
+ var webEngineView2 = Qt.createQmlObject('TestWebEngineView {width: 400; height: 300;}', testCase);
webEngineView.settings.javascriptEnabled = true;
webEngineView2.settings.javascriptEnabled = true;
@@ -102,6 +78,68 @@ TestWebEngineView {
webEngineView2.destroy();
}
+
+ function test_disableReadingFromCanvas_data() {
+ return [
+ { tag: 'disabled', disableReadingFromCanvas: false, result: true },
+ { tag: 'enabled', disableReadingFromCanvas: true, result: false },
+ ]
+ }
+
+ function test_disableReadingFromCanvas(data) {
+ webEngineView.settings.readingFromCanvasEnabled = !data.disableReadingFromCanvas;
+ webEngineView.loadHtml("<html><body>" +
+ "<canvas id='myCanvas' width='200' height='40' style='border:1px solid #000000;'></canvas>" +
+ "</body></html>");
+ verify(webEngineView.waitForLoadSucceeded());
+ verify(webEngineView.settings.readingFromCanvasEnabled === !data.disableReadingFromCanvas )
+
+ var jsCode = "(function(){" +
+ " var canvas = document.getElementById(\"myCanvas\");" +
+ " var ctx = canvas.getContext(\"2d\");" +
+ " ctx.fillStyle = \"rgb(255,0,255)\";" +
+ " ctx.fillRect(0, 0, 200, 40);" +
+ " try {" +
+ " src = canvas.toDataURL();" +
+ " }" +
+ " catch(err) {" +
+ " src = \"\";" +
+ " }" +
+ " return src.length ? true : false;" +
+ "})();";
+
+ var isDataRead = false;
+ runJavaScript(jsCode, function(result) {
+ isDataRead = result
+ });
+ tryVerify(function() { return isDataRead === data.result });
+ }
+
+ function test_forceDarkMode() {
+ // based on: https://developer.chrome.com/blog/auto-dark-theme/#detecting-auto-dark-theme
+ webEngineView.loadHtml("<html><body>" +
+ "<div id=\"detection\", style=\"display: none; background-color: canvas; color-scheme: light\"</div>" +
+ "</body></html>");
+ const script = "(() => {"
+ + " const detectionDiv = document.querySelector('#detection');"
+ + " return getComputedStyle(detectionDiv).backgroundColor != 'rgb(255, 255, 255)';"
+ + "})()";
+ verify(webEngineView.waitForLoadSucceeded());
+
+ var isAutoDark = true;
+ runJavaScript(script, result => isAutoDark = result);
+ tryVerify(() => {return !isAutoDark});
+
+ webEngineView.settings.forceDarkMode = true;
+ verify(webEngineView.settings.forceDarkMode == true)
+
+ isAutoDark = false;
+ // the page is not updated immediately
+ tryVerify(function() {
+ runJavaScript(script, result => isAutoDark = result);
+ return isAutoDark;
+ });
+ }
}
}
diff --git a/tests/auto/quick/qmltests/data/tst_titleChanged.qml b/tests/auto/quick/qmltests/data/tst_titleChanged.qml
index 7dda5ce33..66a7c115f 100644
--- a/tests/auto/quick/qmltests/data/tst_titleChanged.qml
+++ b/tests/auto/quick/qmltests/data/tst_titleChanged.qml
@@ -1,34 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.2
+import QtQuick
+import QtTest
+import QtWebEngine
TestWebEngineView {
id: webEngineView
diff --git a/tests/auto/quick/qmltests/data/tst_unhandledKeyEventPropagation.qml b/tests/auto/quick/qmltests/data/tst_unhandledKeyEventPropagation.qml
index 69aa76b77..76363fa71 100644
--- a/tests/auto/quick/qmltests/data/tst_unhandledKeyEventPropagation.qml
+++ b/tests/auto/quick/qmltests/data/tst_unhandledKeyEventPropagation.qml
@@ -1,34 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.2
+import QtQuick
+import QtTest
+import QtWebEngine
Item {
id: parentItem
@@ -37,8 +12,12 @@ Item {
property var pressEvents: []
property var releaseEvents: []
- Keys.onPressed: pressEvents.push(event.key)
- Keys.onReleased: releaseEvents.push(event.key)
+ Keys.onPressed: function(event) {
+ pressEvents.push(event.key)
+ }
+ Keys.onReleased: function(event) {
+ releaseEvents.push(event.key)
+ }
TestWebEngineView {
id: webEngineView
@@ -46,6 +25,7 @@ Item {
focus: true
}
TestCase {
+ id: testCase
name: "WebEngineViewUnhandledKeyEventPropagation"
when: false
diff --git a/tests/auto/quick/qmltests/data/tst_userScriptCollection.qml b/tests/auto/quick/qmltests/data/tst_userScriptCollection.qml
new file mode 100644
index 000000000..94c993771
--- /dev/null
+++ b/tests/auto/quick/qmltests/data/tst_userScriptCollection.qml
@@ -0,0 +1,127 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import QtTest
+import QtWebEngine
+
+Item {
+
+ WebEngineProfile { id: testProfile }
+
+ TestWebEngineView {
+ id: webEngineView
+ width: 400
+ height: 300
+ }
+
+ TestCase {
+ name: "UserScriptCollection"
+
+ function cleanup() {
+ webEngineView.url = ""
+ webEngineView.userScripts.collection = []
+ compare(webEngineView.userScripts.collection.length, 0)
+ }
+
+ function test_collection() {
+ let scriptFoo = { name: "Foo",
+ sourceUrl: Qt.resolvedUrl("foo.js"),
+ injectionPoint: WebEngineScript.DocumentReady
+ }
+ let scriptBar = WebEngine.script()
+
+ scriptBar.name = "Bar"
+ scriptBar.sourceUrl = Qt.resolvedUrl("bar.js")
+ scriptBar.injectionPoint = WebEngineScript.DocumentReady
+
+ compare(webEngineView.userScripts.collection.length, 0)
+ webEngineView.userScripts.collection = [ scriptFoo, scriptBar ]
+ compare(webEngineView.userScripts.collection.length, 2)
+ compare(webEngineView.userScripts.collection[0].name, scriptFoo.name)
+ compare(webEngineView.userScripts.collection[0].sourceUrl, scriptFoo.sourceUrl)
+ compare(webEngineView.userScripts.collection[1].name, scriptBar.name)
+ compare(webEngineView.userScripts.collection[1].sourceUrl, scriptBar.sourceUrl)
+ webEngineView.userScripts.collection = []
+ compare(webEngineView.userScripts.collection.length, 0)
+ }
+
+ function test_insert() {
+ let scriptFoo = WebEngine.script()
+ scriptFoo.name = "Foo"
+ scriptFoo.sourceUrl = Qt.resolvedUrl("foo.js")
+ scriptFoo.injectionPoint = WebEngineScript.DocumentReady
+ let scriptBar = WebEngine.script()
+ scriptBar.name = "Bar"
+ scriptBar.sourceUrl = Qt.resolvedUrl("bar.js")
+ scriptBar.injectionPoint = WebEngineScript.DocumentReady
+
+ compare(webEngineView.userScripts.collection.length, 0)
+ webEngineView.userScripts.insert(scriptFoo)
+ webEngineView.userScripts.insert(scriptBar)
+ compare(webEngineView.userScripts.collection.length, 2)
+ compare(webEngineView.userScripts.collection[0].name, scriptFoo.name)
+ compare(webEngineView.userScripts.collection[1].name, scriptBar.name)
+ webEngineView.userScripts.collection = []
+ compare(webEngineView.userScripts.collection.length, 0)
+
+ var list = [ scriptFoo , scriptBar]
+ webEngineView.userScripts.insert(list)
+ compare(webEngineView.userScripts.collection.length, 2)
+ compare(webEngineView.userScripts.collection[0].name, scriptFoo.name)
+ compare(webEngineView.userScripts.collection[1].name, scriptBar.name)
+ }
+
+ function test_find() {
+ let scriptA = WebEngine.script()
+ scriptA.name = "A"
+ scriptA.sourceUrl = Qt.resolvedUrl("A.js")
+ let scriptB = WebEngine.script()
+ scriptB.name = "A"
+ scriptB.sourceUrl = Qt.resolvedUrl("B.js")
+ let scriptC = WebEngine.script()
+ scriptC.name = "C"
+ scriptC.sourceUrl = Qt.resolvedUrl("C.js")
+
+ compare(webEngineView.userScripts.collection.length, 0)
+ webEngineView.userScripts.collection = [ scriptA, scriptB, scriptC ];
+ compare(webEngineView.userScripts.collection.length, 3)
+ let scriptsA = webEngineView.userScripts.find("A")
+ let scriptsB = webEngineView.userScripts.find("B")
+ let scriptsC = webEngineView.userScripts.find("C")
+ compare(scriptsA.length, 2)
+ compare(scriptsB.length, 0)
+ compare(scriptsC.length, 1)
+ compare(scriptsA[0].name, scriptA.name)
+ compare(scriptsA[0].sourceUrl, scriptA.sourceUrl)
+ compare(scriptsA[1].name, scriptB.name)
+ compare(scriptsA[1].sourceUrl, scriptB.sourceUrl)
+ compare(scriptsC[0].name, scriptC.name)
+ compare(scriptsC[0].sourceUrl, scriptC.sourceUrl)
+ }
+
+ function test_contains() {
+ let scriptFoo = WebEngine.script()
+ scriptFoo.name = "Foo"
+ let scriptBar = WebEngine.script()
+ scriptBar.name = "Bar"
+ compare(webEngineView.userScripts.collection.length, 0)
+ webEngineView.userScripts.collection = [ scriptFoo ]
+ compare(webEngineView.userScripts.collection.length, 1)
+ verify(webEngineView.userScripts.contains(scriptFoo))
+ verify(!webEngineView.userScripts.contains(scriptBar))
+ }
+
+ function test_clear() {
+ let scriptFoo = WebEngine.script()
+ scriptFoo.name = "Foo"
+ let scriptBar = WebEngine.script()
+ scriptBar.name = "Bar"
+ compare(webEngineView.userScripts.collection.length, 0)
+ webEngineView.userScripts.collection = [ scriptFoo ];
+ compare(webEngineView.userScripts.collection.length, 1)
+ webEngineView.userScripts.clear()
+ compare(webEngineView.userScripts.collection.length, 0)
+ }
+ }
+}
diff --git a/tests/auto/quick/qmltests/data/tst_userScripts.qml b/tests/auto/quick/qmltests/data/tst_userScripts.qml
index f4fcc30ab..30704f47b 100644
--- a/tests/auto/quick/qmltests/data/tst_userScripts.qml
+++ b/tests/auto/quick/qmltests/data/tst_userScripts.qml
@@ -1,64 +1,42 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.2
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import QtTest
+import QtWebEngine
Item {
- WebEngineScript {
- id: changeDocumentTitleScript
- sourceUrl: Qt.resolvedUrl("change-document-title.js")
- injectionPoint: WebEngineScript.DocumentReady
+
+ function changeDocumentTitleScript() {
+ return { name: "changeDocumentTitleScript",
+ sourceUrl: Qt.resolvedUrl("change-document-title.js"),
+ injectionPoint: WebEngineScript.DocumentReady }
}
- WebEngineScript {
- id: appendDocumentTitleScript
- sourceUrl: Qt.resolvedUrl("append-document-title.js")
- injectionPoint: WebEngineScript.DocumentReady
+ function appendDocumentTitleScript() {
+ return { sourceUrl: Qt.resolvedUrl("append-document-title.js"),
+ injectionPoint: WebEngineScript.DocumentReady }
}
- WebEngineScript {
- id: bigUserScript
- sourceUrl: Qt.resolvedUrl("big-user-script.js")
- injectionPoint: WebEngineScript.DocumentReady
+ function bigUserScript() {
+ return { sourceUrl: Qt.resolvedUrl("big-user-script.js"),
+ injectionPoint: WebEngineScript.DocumentReady }
}
- WebEngineScript {
- id: scriptWithMetadata
- sourceUrl: Qt.resolvedUrl("script-with-metadata.js")
+ function scriptWithMetadata() {
+ var script = WebEngine.script()
+ script.sourceUrl = Qt.resolvedUrl("script-with-metadata.js")
+ return script
}
- WebEngineScript {
- id: scriptWithBadMatchMetadata
- sourceUrl: Qt.resolvedUrl("script-with-bad-match-metadata.js")
+ function scriptWithBadMatchMetadata() {
+ var script = WebEngine.script()
+ script.sourceUrl = Qt.resolvedUrl("script-with-bad-match-metadata.js")
+ return script
}
+ WebEngineProfile { id: testProfile }
+
TestWebEngineView {
id: webEngineView
width: 400
@@ -76,24 +54,40 @@ Item {
width: 400
height: 300
- onNavigationRequested: {
+ onNavigationRequested: function(request) {
var urlString = request.url.toString();
if (urlString.indexOf("test1.html") !== -1)
- userScripts = [ changeDocumentTitleScript ];
+ userScripts.collection = [ changeDocumentTitleScript() ];
else if (urlString.indexOf("test2.html") !== -1)
- userScripts = [ appendDocumentTitleScript ];
+ userScripts.collection = [ appendDocumentTitleScript() ];
else
- userScripts = [];
+ userScripts.collection = [];
}
}
TestCase {
- name: "WebEngineViewUserScripts"
+ name: "UserScripts"
- function init() {
+ function cleanup() {
webEngineView.url = "";
- webEngineView.userScripts = [];
- webEngineView.profile.userScripts = [];
+ webEngineView.userScripts.collection = [];
+ compare(webEngineView.userScripts.collection.length, 0)
+ webEngineView.profile.userScripts.collection = [];
+ compare(webEngineView.profile.userScripts.collection.length, 0)
+ }
+
+ function test_profileScripts() {
+ // assusme it is the same type as in View
+ let t1 = String(testProfile.userScripts), t2 = String(webEngineView.userScripts)
+ compare(t1.substr(0, t1.indexOf('(')), t2.substr(0, t2.indexOf('(')))
+
+ // ... and just test basic things like access
+ compare(testProfile.userScripts.collection, [])
+ let script = changeDocumentTitleScript()
+ testProfile.userScripts.collection = [ script ]
+
+ compare(testProfile.userScripts.collection.length, 1)
+ compare(testProfile.userScripts.collection[0].name, script.name)
}
function test_oneScript() {
@@ -101,7 +95,10 @@ Item {
webEngineView.waitForLoadSucceeded();
tryCompare(webEngineView, "title", "Test page 1");
- webEngineView.userScripts = [ changeDocumentTitleScript ];
+ let script = changeDocumentTitleScript()
+ webEngineView.userScripts.collection = [ script ]
+ compare(webEngineView.userScripts.collection.length, 1)
+ compare(webEngineView.userScripts.collection[0].name, script.name)
compare(webEngineView.title, "Test page 1");
webEngineView.reload();
@@ -112,7 +109,8 @@ Item {
webEngineView.waitForLoadSucceeded();
tryCompare(webEngineView, "title", "New title");
- webEngineView.userScripts = [];
+ webEngineView.userScripts.collection = [];
+ compare(webEngineView.userScripts.collection.length, 0)
compare(webEngineView.title, "New title");
webEngineView.reload();
@@ -124,23 +122,28 @@ Item {
webEngineView.url = Qt.resolvedUrl("test1.html");
webEngineView.waitForLoadSucceeded();
tryCompare(webEngineView, "title", "Test page 1");
-
- webEngineView.userScripts = [ changeDocumentTitleScript, appendDocumentTitleScript ];
+ var script1 = changeDocumentTitleScript();
+ var script2 = appendDocumentTitleScript();
+ script2.injectionPoint = WebEngineScript.Deferred;
+ webEngineView.userScripts.collection = [ script1, script2 ];
+ compare(webEngineView.userScripts.collection.length, 2)
// Make sure the scripts are loaded in order.
- appendDocumentTitleScript.injectionPoint = WebEngineScript.Deferred
webEngineView.reload();
webEngineView.waitForLoadSucceeded();
tryCompare(webEngineView, "title", "New title with appendix");
- appendDocumentTitleScript.injectionPoint = WebEngineScript.DocumentReady
- changeDocumentTitleScript.injectionPoint = WebEngineScript.Deferred
+ script2.injectionPoint = WebEngineScript.DocumentReady
+ script1.injectionPoint = WebEngineScript.Deferred
+ webEngineView.userScripts.collection = [ script1, script2 ];
+ compare(webEngineView.userScripts.collection.length, 2)
webEngineView.reload();
webEngineView.waitForLoadSucceeded();
tryCompare(webEngineView, "title", "New title");
// Make sure we can remove scripts from the preload list.
- webEngineView.userScripts = [ appendDocumentTitleScript ];
+ webEngineView.userScripts.collection = [ script2 ];
+ compare(webEngineView.userScripts.collection.length, 1)
webEngineView.reload();
webEngineView.waitForLoadSucceeded();
tryCompare(webEngineView, "title", "Test page 1 with appendix");
@@ -163,17 +166,21 @@ Item {
}
function test_bigScript() {
- webEngineView.userScripts = [ bigUserScript ];
+ webEngineView.userScripts.collection = [ bigUserScript() ];
+ compare(webEngineView.userScripts.collection.length, 1)
webEngineView.url = Qt.resolvedUrl("test1.html");
webEngineView.waitForLoadSucceeded();
tryCompare(webEngineView , "title", "Big user script changed title");
}
function test_parseMetadataHeader() {
- compare(scriptWithMetadata.name, "Test script");
- compare(scriptWithMetadata.injectionPoint, WebEngineScript.DocumentReady);
+ var script = scriptWithMetadata()
+ compare(script.name, "Test script");
+ compare(script.injectionPoint, WebEngineScript.DocumentReady);
- webEngineView.userScripts = [ scriptWithMetadata ];
+ webEngineView.userScripts.collection = [ script ];
+ compare(webEngineView.userScripts.collection.length, 1)
+ compare(webEngineView.userScripts.collection[0].name, script.name)
// @include *data/test*.html
webEngineView.url = Qt.resolvedUrl("test1.html");
@@ -197,10 +204,12 @@ Item {
}
function test_dontInjectBadUrlPatternsEverywhere() {
- compare(scriptWithBadMatchMetadata.name, "Test bad match script");
- compare(scriptWithBadMatchMetadata.injectionPoint, WebEngineScript.DocumentReady);
+ var script = scriptWithBadMatchMetadata();
+ compare(script.name, "Test bad match script");
+ compare(script.injectionPoint, WebEngineScript.DocumentReady);
- webEngineView.userScripts = [ scriptWithBadMatchMetadata ];
+ webEngineView.userScripts.collection = [ script ];
+ compare(webEngineView.userScripts.collection.length, 1)
// @match some:junk
webEngineView.url = Qt.resolvedUrl("test2.html");
@@ -209,7 +218,10 @@ Item {
}
function test_profileWideScript() {
- webEngineView.profile.userScripts = [ changeDocumentTitleScript ];
+ let script = changeDocumentTitleScript()
+ webEngineView.profile.userScripts.collection = [ script ];
+ compare(webEngineView.profile.userScripts.collection.length, 1)
+ compare(webEngineView.profile.userScripts.collection[0].name, script.name)
webEngineView.url = Qt.resolvedUrl("test1.html");
webEngineView.waitForLoadSucceeded();
diff --git a/tests/auto/quick/qmltests/data/tst_viewSource.qml b/tests/auto/quick/qmltests/data/tst_viewSource.qml
index 4966a052a..d4449f7de 100644
--- a/tests/auto/quick/qmltests/data/tst_viewSource.qml
+++ b/tests/auto/quick/qmltests/data/tst_viewSource.qml
@@ -1,34 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.4
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import QtTest
+import QtWebEngine
TestWebEngineView {
id: webEngineView
@@ -38,9 +13,15 @@ TestWebEngineView {
property var viewRequest: null
SignalSpy {
+ id: loadSpy
+ target: webEngineView
+ signalName: 'loadingChanged'
+ }
+
+ SignalSpy {
id: newViewRequestedSpy
target: webEngineView
- signalName: "newViewRequested"
+ signalName: "newWindowRequested"
}
SignalSpy {
@@ -49,13 +30,13 @@ TestWebEngineView {
signalName: "titleChanged"
}
- onNewViewRequested: {
+ onNewWindowRequested: function(request) {
viewRequest = {
"destination": request.destination,
"userInitiated": request.userInitiated
};
- request.openIn(webEngineView);
+ webEngineView.acceptAsNewWindow(request);
}
TestCase {
@@ -68,6 +49,7 @@ TestWebEngineView {
tryCompare(webEngineView, "loadStatus", WebEngineView.LoadSucceededStatus);
webEngineView.loadStatus = null;
+ loadSpy.clear();
newViewRequestedSpy.clear();
titleChangedSpy.clear();
viewRequest = null;
@@ -86,7 +68,7 @@ TestWebEngineView {
// The first titleChanged signal is emitted by adoptWebContents()
tryVerify(function() { return titleChangedSpy.count >= 2; });
- compare(viewRequest.destination, WebEngineView.NewViewInTab);
+ compare(viewRequest.destination, WebEngineNewWindowRequest.InNewTab);
verify(viewRequest.userInitiated);
verify(!webEngineView.action(WebEngineView.ViewSource).enabled);
@@ -94,36 +76,6 @@ TestWebEngineView {
compare(webEngineView.url, "view-source:" + Qt.resolvedUrl("test1.html"));
}
- function test_viewSourceURL_data() {
- var testLocalUrl = "view-source:" + Qt.resolvedUrl("test1.html");
- var testLocalUrlWithoutScheme = "view-source:" + Qt.resolvedUrl("test1.html").substring(7);
-
- return [
- { tag: "view-source:", userInputUrl: "view-source:", loadSucceed: true, url: "view-source:", title: "view-source:" },
- { tag: "view-source:about:blank", userInputUrl: "view-source:about:blank", loadSucceed: true, url: "view-source:about:blank", title: "view-source:about:blank" },
- { tag: testLocalUrl, userInputUrl: testLocalUrl, loadSucceed: true, url: testLocalUrl, title: "test1.html" },
- { tag: testLocalUrlWithoutScheme, userInputUrl: testLocalUrlWithoutScheme, loadSucceed: true, url: testLocalUrl, title: "test1.html" },
- { tag: "view-source:http://non.existent", userInputUrl: "view-source:http://non.existent", loadSucceed: false, url: "http://non.existent/", title: "non.existent" },
- { tag: "view-source:non.existent", userInputUrl: "view-source:non.existent", loadSucceed: false, url: "http://non.existent/", title: "non.existent" },
- ];
- }
-
- function test_viewSourceURL(row) {
- WebEngine.settings.errorPageEnabled = true
- webEngineView.url = row.userInputUrl;
-
- if (row.loadSucceed) {
- tryCompare(webEngineView, "loadStatus", WebEngineView.LoadSucceededStatus);
- } else {
- tryCompare(webEngineView, "loadStatus", WebEngineView.LoadFailedStatus, 15000);
- }
- tryVerify(function() { return titleChangedSpy.count == 1; });
-
- compare(webEngineView.url, row.url);
- tryCompare(webEngineView, "title", row.title);
- verify(!webEngineView.action(WebEngineView.ViewSource).enabled);
- }
-
function test_viewSourceCredentials() {
var url = "http://user:passwd@httpbin.org/basic-auth/user/passwd";
@@ -145,12 +97,46 @@ TestWebEngineView {
// The first titleChanged signal is emitted by adoptWebContents()
tryVerify(function() { return titleChangedSpy.count >= 2; });
- compare(viewRequest.destination, WebEngineView.NewViewInTab);
+ compare(viewRequest.destination, WebEngineNewWindowRequest.InNewTab);
verify(viewRequest.userInitiated);
tryCompare(webEngineView, "url", "view-source:" + url.replace("user:passwd@", ""));
tryCompare(webEngineView, "title", "view-source:" + url.replace("http://user:passwd@", ""));
}
+
+ function test_viewSourceURL_data() {
+ var testLocalUrl = "view-source:" + Qt.resolvedUrl("test1.html");
+ var testLocalUrlWithoutScheme = "view-source:" + Qt.resolvedUrl("test1.html").toString().substring(7);
+
+ return [
+ { tag: "view-source:", userInputUrl: "view-source:", loadSucceed: true, url: "view-source:", title: "view-source:" },
+ { tag: "view-source:about:blank", userInputUrl: "view-source:about:blank", loadSucceed: true, url: "view-source:about:blank", title: "view-source:about:blank" },
+ { tag: testLocalUrl, userInputUrl: testLocalUrl, loadSucceed: true, url: testLocalUrl, title: "test1.html" },
+ { tag: testLocalUrlWithoutScheme, userInputUrl: testLocalUrlWithoutScheme, loadSucceed: true, url: testLocalUrl, title: "test1.html" },
+ { tag: "view-source:http://non.existent", userInputUrl: "view-source:http://non.existent", loadSucceed: false, url: "http://non.existent/", title: "non.existent" },
+ { tag: "view-source:non.existent", userInputUrl: "view-source:non.existent", loadSucceed: false, url: "http://non.existent/", title: "non.existent" },
+ ];
+ }
+
+ function test_viewSourceURL(row) {
+ WebEngine.settings.errorPageEnabled = true
+ webEngineView.url = row.userInputUrl;
+
+ tryCompare(loadSpy, 'count', 2, 12000);
+ let load = loadSpy.signalArguments[1][0]
+ let expectedStatus = row.loadSucceed ? WebEngineView.LoadSucceededStatus : WebEngineView.LoadFailedStatus
+ compare(load.status, expectedStatus);
+ compare(load.isErrorPage, !row.loadSucceed);
+ tryVerify(function() { return titleChangedSpy.count == 1; });
+
+ compare(webEngineView.url, row.url);
+ tryCompare(webEngineView, "title", row.title);
+ if (row.loadSucceed) {
+ verify(!webEngineView.action(WebEngineView.ViewSource).enabled);
+ } else {
+ verify(webEngineView.action(WebEngineView.ViewSource).enabled);
+ }
+ }
}
}
diff --git a/tests/auto/quick/qmltests/data/tst_webchannel.qml b/tests/auto/quick/qmltests/data/tst_webchannel.qml
index 3ca3ccce1..780b55934 100644
--- a/tests/auto/quick/qmltests/data/tst_webchannel.qml
+++ b/tests/auto/quick/qmltests/data/tst_webchannel.qml
@@ -1,35 +1,11 @@
-/*********************************************************************
-** Copyright (C) 2014 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Milian Wolff <milian.wolff@kdab.com>
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.2
-
-import QtWebChannel 1.0
+// Copyright (C) 2014 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Milian Wolff <milian.wolff@kdab.com>
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import QtTest
+import QtWebEngine
+
+import QtWebChannel
Item {
id: test
@@ -81,6 +57,12 @@ Item {
}
function test_basic() {
+ webView.userScripts.collection = [ {
+ name: "qtwebchanneljs",
+ sourceUrl: Qt.resolvedUrl("qrc:/qtwebchannel/qwebchannel.js"),
+ injectionPoint: WebEngineScript.DocumentCreation,
+ worldId: WebEngineScript.MainWorld
+ }]
webView.url = testUrl;
verify(webView.waitForLoadSucceeded());
diff --git a/tests/auto/quick/qmltests/data/webchannel-test.html b/tests/auto/quick/qmltests/data/webchannel-test.html
index 92966b24a..d8c3b1305 100644
--- a/tests/auto/quick/qmltests/data/webchannel-test.html
+++ b/tests/auto/quick/qmltests/data/webchannel-test.html
@@ -2,7 +2,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <script type="text/javascript" src="qrc:///qtwebchannel/qwebchannel.js"></script>
<script type="text/javascript">
//BEGIN SETUP
var channel = new QWebChannel(qt.webChannelTransport, function(channel) {
diff --git a/tests/auto/quick/qmltests/mock-delegates/QtWebEngine/ControlsDelegates/AlertDialog.qml b/tests/auto/quick/qmltests/mock-delegates/QtWebEngine/ControlsDelegates/AlertDialog.qml
new file mode 100644
index 000000000..7d7efda0c
--- /dev/null
+++ b/tests/auto/quick/qmltests/mock-delegates/QtWebEngine/ControlsDelegates/AlertDialog.qml
@@ -0,0 +1,5 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+// Both dialogs are basically expected to behave in the same way from an API point of view
+ConfirmDialog { }
diff --git a/tests/auto/quick/qmltests/mock-delegates/QtWebEngine/ControlsDelegates/ConfirmDialog.qml b/tests/auto/quick/qmltests/mock-delegates/QtWebEngine/ControlsDelegates/ConfirmDialog.qml
new file mode 100644
index 000000000..6125d0b98
--- /dev/null
+++ b/tests/auto/quick/qmltests/mock-delegates/QtWebEngine/ControlsDelegates/ConfirmDialog.qml
@@ -0,0 +1,24 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQml
+import QtTest
+import "../../TestParams"
+
+QtObject {
+ property string text
+ property string title
+ signal accepted()
+ signal rejected()
+
+ function open() {
+ JSDialogParams.dialogTitle = title;
+ JSDialogParams.dialogMessage = text;
+ JSDialogParams.dialogCount++;
+ if (JSDialogParams.shouldAcceptDialog)
+ accepted();
+ else
+ rejected();
+ }
+}
+
diff --git a/tests/auto/quick/qmltests/mock-delegates/QtWebEngine/ControlsDelegates/DirectoryPicker.qml b/tests/auto/quick/qmltests/mock-delegates/QtWebEngine/ControlsDelegates/DirectoryPicker.qml
new file mode 100644
index 000000000..71da28843
--- /dev/null
+++ b/tests/auto/quick/qmltests/mock-delegates/QtWebEngine/ControlsDelegates/DirectoryPicker.qml
@@ -0,0 +1,18 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import "../../TestParams"
+
+QtObject {
+ signal folderSelected(var folder)
+ signal rejected()
+
+ function open() {
+ FilePickerParams.directoryPickerOpened = true;
+ if (FilePickerParams.selectFiles)
+ folderSelected(FilePickerParams.selectedFilesUrl);
+ else
+ rejected();
+ }
+}
diff --git a/tests/auto/quick/qmltests/mock-delegates/QtWebEngine/ControlsDelegates/FilePicker.qml b/tests/auto/quick/qmltests/mock-delegates/QtWebEngine/ControlsDelegates/FilePicker.qml
new file mode 100644
index 000000000..247088bcb
--- /dev/null
+++ b/tests/auto/quick/qmltests/mock-delegates/QtWebEngine/ControlsDelegates/FilePicker.qml
@@ -0,0 +1,24 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import "../../TestParams"
+
+QtObject {
+ property bool selectMultiple: false
+ property bool selectExisting: false
+ property bool selectFolder: false
+ property var nameFilters: []
+
+ signal filesSelected(var fileList)
+ signal rejected()
+
+ function open() {
+ FilePickerParams.filePickerOpened = true;
+ FilePickerParams.nameFilters = nameFilters;
+ if (FilePickerParams.selectFiles)
+ filesSelected(FilePickerParams.selectedFilesUrl);
+ else
+ rejected();
+ }
+}
diff --git a/tests/auto/quick/qmltests/mock-delegates/QtWebEngine/ControlsDelegates/Menu.qml b/tests/auto/quick/qmltests/mock-delegates/QtWebEngine/ControlsDelegates/Menu.qml
new file mode 100644
index 000000000..cd7ed4821
--- /dev/null
+++ b/tests/auto/quick/qmltests/mock-delegates/QtWebEngine/ControlsDelegates/Menu.qml
@@ -0,0 +1,18 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+import QtQml
+import "../../TestParams"
+
+QtObject {
+ id: menu
+ property string linkText: ""
+ property var mediaType: null
+ property string selectedText: ""
+
+ signal done()
+
+ function open() {
+ MenuParams.isMenuOpened = true;
+ }
+}
diff --git a/tests/auto/quick/qmltests/mock-delegates/QtWebEngine/ControlsDelegates/MenuItem.qml b/tests/auto/quick/qmltests/mock-delegates/QtWebEngine/ControlsDelegates/MenuItem.qml
new file mode 100644
index 000000000..67dab1bba
--- /dev/null
+++ b/tests/auto/quick/qmltests/mock-delegates/QtWebEngine/ControlsDelegates/MenuItem.qml
@@ -0,0 +1,8 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+import QtQml
+
+QtObject {
+ signal triggered()
+}
diff --git a/tests/auto/quick/qmltests/mock-delegates/QtWebEngine/ControlsDelegates/PromptDialog.qml b/tests/auto/quick/qmltests/mock-delegates/QtWebEngine/ControlsDelegates/PromptDialog.qml
new file mode 100644
index 000000000..81a63d918
--- /dev/null
+++ b/tests/auto/quick/qmltests/mock-delegates/QtWebEngine/ControlsDelegates/PromptDialog.qml
@@ -0,0 +1,27 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQml
+import QtTest
+import "../../TestParams"
+
+QtObject {
+ property string text
+ property string title
+ signal accepted()
+ signal rejected()
+ signal input(string text)
+ signal closing()
+
+ function open() {
+ JSDialogParams.dialogTitle = title;
+ JSDialogParams.dialogMessage = text;
+ JSDialogParams.dialogCount++;
+ if (JSDialogParams.shouldAcceptDialog) {
+ input(JSDialogParams.inputForPrompt)
+ accepted();
+ } else {
+ rejected();
+ }
+ }
+}
diff --git a/tests/auto/quick/qmltests/mock-delegates/TestParams/FilePickerParams.qml b/tests/auto/quick/qmltests/mock-delegates/TestParams/FilePickerParams.qml
new file mode 100644
index 000000000..67d67dc40
--- /dev/null
+++ b/tests/auto/quick/qmltests/mock-delegates/TestParams/FilePickerParams.qml
@@ -0,0 +1,13 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+pragma Singleton
+import QtQuick
+
+QtObject {
+ property var selectedFilesUrl: [];
+ property bool selectFiles: false;
+ property bool filePickerOpened: false;
+ property bool directoryPickerOpened: false;
+ property var nameFilters: [];
+}
diff --git a/tests/auto/quick/qmltests/mock-delegates/TestParams/JSDialogParams.qml b/tests/auto/quick/qmltests/mock-delegates/TestParams/JSDialogParams.qml
new file mode 100644
index 000000000..1033b509e
--- /dev/null
+++ b/tests/auto/quick/qmltests/mock-delegates/TestParams/JSDialogParams.qml
@@ -0,0 +1,12 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+pragma Singleton
+import QtQml
+
+QtObject {
+ property string dialogMessage: "";
+ property string dialogTitle: "";
+ property bool shouldAcceptDialog: true;
+ property string inputForPrompt;
+ property int dialogCount: 0
+}
diff --git a/tests/auto/quick/qmltests/mock-delegates/TestParams/MenuParams.qml b/tests/auto/quick/qmltests/mock-delegates/TestParams/MenuParams.qml
new file mode 100644
index 000000000..d8a01764c
--- /dev/null
+++ b/tests/auto/quick/qmltests/mock-delegates/TestParams/MenuParams.qml
@@ -0,0 +1,9 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+pragma Singleton
+import QtQml
+
+QtObject {
+ property bool isMenuOpened: false;
+}
diff --git a/tests/auto/quick/qmltests/mock-delegates/TestParams/qmldir b/tests/auto/quick/qmltests/mock-delegates/TestParams/qmldir
new file mode 100644
index 000000000..2702ad30f
--- /dev/null
+++ b/tests/auto/quick/qmltests/mock-delegates/TestParams/qmldir
@@ -0,0 +1,5 @@
+# QML module so that the autotests can set testing parameters
+module TestParams
+singleton FilePickerParams 1.0 FilePickerParams.qml
+singleton JSDialogParams 1.0 JSDialogParams.qml
+singleton MenuParams 1.0 MenuParams.qml
diff --git a/tests/auto/quick/qmltests/qmltests.pro b/tests/auto/quick/qmltests/qmltests.pro
deleted file mode 100644
index 6bec6dc0d..000000000
--- a/tests/auto/quick/qmltests/qmltests.pro
+++ /dev/null
@@ -1,69 +0,0 @@
-include(../tests.pri)
-include(../../shared/https.pri)
-
-QT += qmltest
-
-IMPORTPATH += $$PWD/data
-
-OTHER_FILES += \
- $$PWD/data/TestWebEngineView.qml \
- $$PWD/data/append-document-title.js \
- $$PWD/data/big-user-script.js \
- $$PWD/data/change-document-title.js \
- $$PWD/data/download.zip \
- $$PWD/data/directoryupload.html \
- $$PWD/data/favicon.html \
- $$PWD/data/forms.html \
- $$PWD/data/geolocation.html \
- $$PWD/data/javascript.html \
- $$PWD/data/link.html \
- $$PWD/data/localStorage.html \
- $$PWD/data/multifileupload.html \
- $$PWD/data/redirect.html \
- $$PWD/data/script-with-metadata.js \
- $$PWD/data/singlefileupload.html \
- $$PWD/data/test1.html \
- $$PWD/data/test2.html \
- $$PWD/data/test3.html \
- $$PWD/data/test4.html \
- $$PWD/data/test-iframe.html \
- $$PWD/data/keyboardModifierMapping.html \
- $$PWD/data/keyboardEvents.html \
- $$PWD/data/titleupdate.js \
- $$PWD/data/tst_action.qml \
- $$PWD/data/tst_activeFocusOnPress.qml \
- $$PWD/data/tst_audioMuted.qml \
- $$PWD/data/tst_contextMenu.qml \
- $$PWD/data/tst_desktopBehaviorLoadHtml.qml \
- $$PWD/data/tst_download.qml \
- $$PWD/data/tst_filePicker.qml \
- $$PWD/data/tst_findText.qml \
- $$PWD/data/tst_focusOnNavigation.qml \
- $$PWD/data/tst_geopermission.qml \
- $$PWD/data/tst_getUserMedia.qml \
- $$PWD/data/tst_loadHtml.qml \
- $$PWD/data/tst_loadProgress.qml \
- $$PWD/data/tst_loadRecursionCrash.qml \
- $$PWD/data/tst_loadUrl.qml \
- $$PWD/data/tst_mouseMove.qml \
- $$PWD/data/tst_navigationHistory.qml \
- $$PWD/data/tst_navigationRequested.qml \
- $$PWD/data/tst_newViewRequest.qml \
- $$PWD/data/tst_notification.qml \
- $$PWD/data/tst_profile.qml \
- $$PWD/data/tst_properties.qml \
- $$PWD/data/tst_runJavaScript.qml \
- $$PWD/data/tst_scrollPosition.qml \
- $$PWD/data/tst_titleChanged.qml \
- $$PWD/data/tst_unhandledKeyEventPropagation.qml \
- $$PWD/data/tst_userScripts.qml \
- $$PWD/data/tst_viewSource.qml \
- $$PWD/data/tst_webchannel.qml \
- $$PWD/data/tst_settings.qml \
- $$PWD/data/tst_keyboardModifierMapping.qml \
- $$PWD/data/tst_keyboardEvents.qml \
- $$PWD/data/webchannel-test.html \
- $$PWD/data/icons/favicon.png \
-
-load(qt_build_paths)
-DEFINES += QUICK_TEST_SOURCE_DIR=\\\"$$re_escape($$PWD$${QMAKE_DIR_SEP}data)\\\"
diff --git a/tests/auto/quick/qmltests/resources/server.key b/tests/auto/quick/qmltests/resources/server.key
new file mode 100644
index 000000000..9bf87aee3
--- /dev/null
+++ b/tests/auto/quick/qmltests/resources/server.key
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEpQIBAAKCAQEAqAygFPG5ILLb3G51D0OIN4Kpm5t3Oh1nByTnvi1kMz+sCBBd
+CSugt4NnKkB6kiGtMEsrEm1/xg8Bkfbpet3v3+jAidRpjvCISqy3Z9D1cgCFM46h
+iob/AvLZpqITiAgsU4fJ4auuIKhFplIGrIKMv2gK8haoBGBoRUD1RM+irwjEr6TN
+XTQt2Ap+Ouxs53NLPhAOgumpfzzRR8/Umbhen+G5MhH+XTzzreiClz2V6A79ePJj
+y1uQ8NJ79feOOWBDRizRDWwxsnNd24GjkpvcaTwafiK6Vdqeub+XTtiB5RPal2on
+Cj0TQDcnaacecl/zmUWsIFNkNJWDcd3/vEdyOQIDAQABAoIBAQCW93icOCdim6tu
+FIDu7HEjxSsPUpPCToWu4lWaAHcinxGx0NlzkpD4K4DzcSdrvfszBmQ0UtBVokd7
+1IAdU+HZmePWLk+CDM2zoAPHrO3Cs3r2PS0cIHhZMsearcG0E/uWMseHB08PoXuo
+lcnPEhzVGueyYe4guGcTx+5PGeUBLf+fJcEc3rIQnT2LYulM2aqBZSQM3jRUaPYs
+F0awDpCNwajW/Bt2VB14Pr+H5MJ+WSznFCqW7SolBkqDGfKckXPSHgX6xZ0y7VCI
+MM8vwlVI4mPkaHvSQMSI8vS4Qh+SGQCSs/AuuNLjjPoz1YotV3Ih4YbLj6BjFP2g
+CrqzT6VNAoGBANOHmsqE0nRkLzonTDrMdla5b0TjTxwtNM5DjLgJa6UBBqPe+1Lv
+JFoBP9bIfYDRWZOZrxXItfMmM43nK/ST6Xqgx1IpHUCLKVr2pA9RXrP+m4oawfgn
+frW212fHibeOYiLy+DaQXQ0VRFxsc/VbwKVyVlMEcNg3N93x2E67M7vjAoGBAMtg
+7wDa+5gjwuyNr7LKkp5VDTmtKQhoDtg4sw6MSQSMF6fJT9Z4kGTZ23+G85/LsM/k
+iXbceabGJ0CQJvGn6oW4dI2Ut2c2nCNVbQCxJ6Nyn/yW7bRLShMnwXvbGAVxVUax
+5ohJPZGJ8ar2CP76A0bkvm2Nwylq2gp6Y8h7+iwzAoGBAKizwfQ6sk45iKDsrpNG
+dir8gY2DbJigRTksDpLIkJ1skAspz295YpiV3oBCLjYKwVJCg6zwAo0FrqBB+oB5
+ZwByMgWI3NeZJUZy5q2Ay/Lp4MroRELR3PC3/lu6fE90szgEZ4m84TmJ+Jdtt527
+q41H/yj+pbELePb95vIDw2LZAoGBAJBZ+MmupCzUFSI5Xp+UUIS48W4ijaE92mt1
+swF8aMcleBTLOjOL11D9oGHfs0OUG6czGq6WxnGs62dT6ZBUEo1e4rsq9xH3HNOn
+anq3Qt8sGIn7xjPVzHnUGeyDEYWrb0+CLZJGCcEnG7SwdKolYfYLnW281Oysvp35
+SKGf/W0pAoGAa2+sZmhb1mpGAf6Bi4z+uym/6qOJmG6CnrBSM9e/r8nujwFVkCYF
+3iz48qx3GbuliO6za8aM1drX2u8KWp1uP5KzwYvtW5SfpQ1eusFblHEYQQNRcKLT
+j/wZBXnU961eMKkkTe2XsPirO8rVhVmxuFLqT/aEPffcragQFFIGOEQ=
+-----END RSA PRIVATE KEY-----
diff --git a/tests/auto/quick/qmltests/resources/server.pem b/tests/auto/quick/qmltests/resources/server.pem
new file mode 100644
index 000000000..a201ed08e
--- /dev/null
+++ b/tests/auto/quick/qmltests/resources/server.pem
@@ -0,0 +1,41 @@
+-----BEGIN CERTIFICATE-----
+MIIDezCCAmOgAwIBAgIUFZEIIzeR7lEA10rb14w7MfhP87MwDQYJKoZIhvcNAQEL
+BQAwWjELMAkGA1UEBhMCREUxDzANBgNVBAgMBkJlcmxpbjEPMA0GA1UEBwwGQmVy
+bGluMRUwEwYDVQQKDAxUaGVRdENvbXBhbnkxEjAQBgNVBAsMCXdlYmVuZ2luZTAe
+Fw0yMTA1MTAyMTM1MTJaFw0yMjA1MTAyMTM1MTJaMGAxCzAJBgNVBAYTAkRFMQ8w
+DQYDVQQIDAZCZXJsaW4xDzANBgNVBAcMBkJlcmxpbjEVMBMGA1UECgwMVGhlUXRD
+b21wYW55MRgwFgYDVQQDDA93ZWJlbmdpbmUucXQuaW8wggEiMA0GCSqGSIb3DQEB
+AQUAA4IBDwAwggEKAoIBAQCoDKAU8bkgstvcbnUPQ4g3gqmbm3c6HWcHJOe+LWQz
+P6wIEF0JK6C3g2cqQHqSIa0wSysSbX/GDwGR9ul63e/f6MCJ1GmO8IhKrLdn0PVy
+AIUzjqGKhv8C8tmmohOICCxTh8nhq64gqEWmUgasgoy/aAryFqgEYGhFQPVEz6Kv
+CMSvpM1dNC3YCn467Gznc0s+EA6C6al/PNFHz9SZuF6f4bkyEf5dPPOt6IKXPZXo
+Dv148mPLW5Dw0nv19445YENGLNENbDGyc13bgaOSm9xpPBp+IrpV2p65v5dO2IHl
+E9qXaicKPRNANydppx5yX/OZRawgU2Q0lYNx3f+8R3I5AgMBAAGjMzAxMBoGA1Ud
+EQQTMBGCD3dlYmVuZ2luZS5xdC5pbzATBgNVHSUEDDAKBggrBgEFBQcDATANBgkq
+hkiG9w0BAQsFAAOCAQEAjThKpP0sBv1vEmaqBc1wTu//7RHmFcoStTt3scADzb2C
+9gjOVC4NzxBneLkv01444Z1p/Iiu/ZZ+VKu7aJElJgnBWEisYwJ09t3cdZRA0UY7
+XRvTVAqV0OlsB1Jn0afE+aTLGjWo+jSYzua0O+NK74e23p9jkdSmXxH9w0FB/oyM
+FGIOFnnfP0+QR4ZVvAGk2H60tBHQKmCM6b87TiD4GQIfOghCQWH+qJYSuyGu4hkE
+uis+n1KHHhed3GIJOHpm7gt1C9qtjcp1nOpv0ycQjfc9CGvr02BcQjhMeO65hX0A
+TvCgKN9/XMFv5jwwjjPCL12GBhwnN2k9hM/tEYpe2A==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDOzCCAiMCFDwWg4NZxCplj3qyBxAUTi1wmj4jMA0GCSqGSIb3DQEBCwUAMFox
+CzAJBgNVBAYTAkRFMQ8wDQYDVQQIDAZCZXJsaW4xDzANBgNVBAcMBkJlcmxpbjEV
+MBMGA1UECgwMVGhlUXRDb21wYW55MRIwEAYDVQQLDAl3ZWJlbmdpbmUwHhcNMjEw
+NTEwMjEzMTE4WhcNMjIwNTEwMjEzMTE4WjBaMQswCQYDVQQGEwJERTEPMA0GA1UE
+CAwGQmVybGluMQ8wDQYDVQQHDAZCZXJsaW4xFTATBgNVBAoMDFRoZVF0Q29tcGFu
+eTESMBAGA1UECwwJd2ViZW5naW5lMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
+CgKCAQEAuc/8xVrfSzOsI6kYul+o1QIPBh1I86eQm1PhTBDMAAPHuzyPaEMgBkn2
+XAUmvkynGpNioaJDU2ndV2fBHvsoeQCdNNmjFTe1rKYjrN6U2X5KoYSzN93TOYzK
+aR38fEFx+w4qV76nnxSjYtGNe9z74GrfWFMdDQ0NJKzvaO4gaZ+OOg0OzWy4MJQ0
+aINo3UV55Y7Nt92AxFweiuHucKu+rjf3BX7n0Af/Tcs2c84f0R3HA7euReSibVvX
+f33eHLRKwu2bvDjXiUzOdkxBn9GTo6Q09LyY6wDG0ZdWnyCKj3NBQKBVrq+bs3Q0
+ATsWhj/PvYlZhhZh4EOlqYOhCpwv4wIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQCC
+pLSFGJcG0zhHW+2A6ogmpn2tA8gKUZx7f0J1nwgPEoAXQqWQv/299ZtmWfMKHUkk
+ygG4u80C87wWPH42XWXo/KDrP9iYzoqAvtqbRuPG9PAxefQ/JUSnuhikA51g9+Mu
+IDKKKSI+y/JW9u0Qo77fp/5n2DaFn5B+pBYvn/xLfaEa9bRdJMTEMsElGbPBzMZd
+I/7X6B78X6Ow5TuRKSeZA7E1AZ/+e5A4Hj65bLAugoSKz3zaS0dV26LwAo18c2zP
+TqtwHyIVj4QCoI6Z694q9KH4Pkml3fz8VSkk+MvZMWapvUhHu/DneTgqGbp9POYg
+nx6oWME6idhnvN6DljxB
+-----END CERTIFICATE-----
diff --git a/tests/auto/quick/qmltests/tst_qmltests.cpp b/tests/auto/quick/qmltests/tst_qmltests.cpp
index 0d830931d..9e928157e 100644
--- a/tests/auto/quick/qmltests/tst_qmltests.cpp
+++ b/tests/auto/quick/qmltests/tst_qmltests.cpp
@@ -1,39 +1,23 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+#include <httpserver.h>
+
+#if QT_CONFIG(ssl)
#include <httpsserver.h>
+#endif
-#include <QtCore/QScopedPointer>
-#include <QTemporaryDir>
+#include <QtCore/qscopedpointer.h>
+#include <QtCore/qtemporarydir.h>
+#include <QtGui/private/qinputmethod_p.h>
+#include <QtQml/qqmlengine.h>
+#include <QtQuick/qquickitem.h>
+#include <QtQuick/qquickwindow.h>
#include <QtQuickTest/quicktest.h>
-#include <QtWebEngine/QQuickWebEngineProfile>
-#include <QQmlEngine>
-#include "qt_webengine_quicktest.h"
+#include <QtTest/qtest.h>
+#include <QtWebEngineQuick/qquickwebengineprofile.h>
+#include <QtWebEngineQuick/qtwebenginequickglobal.h>
+#include <qt_webengine_quicktest.h>
#if defined(Q_OS_LINUX) && defined(QT_DEBUG)
#include <fcntl.h>
@@ -41,6 +25,19 @@
#include <unistd.h>
#endif
+class Setup : public QObject
+{
+ Q_OBJECT
+public:
+ Setup() { }
+
+public slots:
+ void qmlEngineAvailable(QQmlEngine *engine)
+ {
+ engine->addImportPath(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath() + "/mock-delegates");
+ }
+};
+
#if defined(Q_OS_LINUX) && defined(QT_DEBUG)
static bool debuggerPresent()
{
@@ -108,10 +105,125 @@ public:
return tempDir.isValid() ? tempDir.path() : QString();
}
+ Q_INVOKABLE QUrl pathUrl(const QString &filename = QString())
+ {
+ Q_ASSERT(tempDir.isValid());
+ return filename.isEmpty() ? QUrl::fromLocalFile(tempDir.path())
+ : QUrl::fromLocalFile(tempDir.filePath(filename));
+ }
+
+ Q_INVOKABLE void removeRecursive(const QString dirname)
+ {
+ QDir dir(dirname);
+ QFileInfoList entries(dir.entryInfoList(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot));
+ for (int i = 0; i < entries.size(); ++i) {
+ if (entries[i].isDir())
+ removeRecursive(entries[i].filePath());
+ else
+ dir.remove(entries[i].fileName());
+ }
+ QDir().rmdir(dirname);
+ }
+
+ Q_INVOKABLE void createDirectory(const QString dirname) { QDir(tempDir.path()).mkdir(dirname); }
+
private:
QTemporaryDir tempDir;
};
+class TestInputContext : public QPlatformInputContext {
+ Q_OBJECT
+
+public:
+ TestInputContext() = default;
+ ~TestInputContext() { release(); }
+
+ Q_INVOKABLE void create()
+ {
+ QInputMethodPrivate *inputMethodPrivate = QInputMethodPrivate::get(qApp->inputMethod());
+ inputMethodPrivate->testContext = this;
+ }
+
+ Q_INVOKABLE void release()
+ {
+ QInputMethodPrivate *inputMethodPrivate = QInputMethodPrivate::get(qApp->inputMethod());
+ inputMethodPrivate->testContext = nullptr;
+ }
+
+ void showInputPanel() override { m_visible = true; }
+ void hideInputPanel() override { m_visible = false; }
+ bool isInputPanelVisible() const override { return m_visible; }
+
+private:
+ bool m_visible = false;
+};
+
+QT_BEGIN_NAMESPACE
+namespace QTest {
+ int Q_TESTLIB_EXPORT defaultMouseDelay();
+}
+QT_END_NAMESPACE
+
+class TestInputEvent : public QObject {
+ Q_OBJECT
+
+public:
+ TestInputEvent() = default;
+
+ Q_INVOKABLE bool mouseMultiClick(QObject *item, qreal x, qreal y, int clickCount)
+ {
+ QTEST_ASSERT(item);
+
+ QWindow *view = eventWindow(item);
+ if (!view)
+ return false;
+
+ for (int i = 0; i < clickCount; ++i) {
+ mouseEvent(QMouseEvent::MouseButtonPress, view, item, QPointF(x, y));
+ mouseEvent(QMouseEvent::MouseButtonRelease, view, item, QPointF(x, y));
+ }
+ QTest::lastMouseTimestamp += QTest::mouseDoubleClickInterval;
+
+ return true;
+ }
+
+private:
+ QWindow *eventWindow(QObject *item = nullptr)
+ {
+ QWindow *window = qobject_cast<QWindow *>(item);
+ if (window)
+ return window;
+
+ QQuickItem *quickItem = qobject_cast<QQuickItem *>(item);
+ if (quickItem)
+ return quickItem->window();
+
+ QQuickItem *testParentItem = qobject_cast<QQuickItem *>(parent());
+ if (testParentItem)
+ return testParentItem->window();
+
+ return nullptr;
+ }
+
+ void mouseEvent(QEvent::Type type, QWindow *window, QObject *item, const QPointF &_pos)
+ {
+ QTest::qWait(QTest::defaultMouseDelay());
+ QTest::lastMouseTimestamp += QTest::defaultMouseDelay();
+
+ QPoint pos;
+ QQuickItem *sgitem = qobject_cast<QQuickItem *>(item);
+ if (sgitem)
+ pos = sgitem->mapToScene(_pos).toPoint();
+
+ QMouseEvent me(type, pos, window->mapFromGlobal(pos), Qt::LeftButton, Qt::LeftButton, {});
+ me.setTimestamp(++QTest::lastMouseTimestamp);
+
+ QSpontaneKeyEvent::setSpontaneous(&me);
+ if (!qApp->notify(window, &me))
+ qWarning("Mouse click event not accepted by receiving window");
+ }
+};
+
int main(int argc, char **argv)
{
#if defined(Q_OS_LINUX) && defined(QT_DEBUG)
@@ -123,32 +235,41 @@ int main(int argc, char **argv)
sigaction(SIGSEGV, &sigAction, 0);
#endif
-
- QScopedPointer<Application> app;
-
+ QtWebEngineQuick::initialize();
// Force to use English language for testing due to error message checks
QLocale::setDefault(QLocale("en"));
- static QByteArrayList params = {QByteArrayLiteral("--use-fake-device-for-media-stream")};
- QVector<const char *> w_argv(argc); \
- for (int i = 0; i < argc; ++i) \
- w_argv[i] = argv[i]; \
- for (int i = 0; i < params.size(); ++i) \
- w_argv.append(params[i].data()); \
- int w_argc = w_argv.size(); \
+ static QByteArrayList params = {QByteArrayLiteral("--webEngineArgs"),QByteArrayLiteral("--use-fake-device-for-media-stream")};
+ QList<const char *> w_argv(argc);
+ for (int i = 0; i < argc; ++i) w_argv[i] = argv[i];
+ for (int i = 0; i < params.size(); ++i) w_argv.append(params[i].data());
+ int w_argc = w_argv.size();
+ Application app(w_argc, const_cast<char **>(w_argv.data()));
- if (!QCoreApplication::instance()) {
- app.reset(new Application(w_argc, const_cast<char **>(w_argv.data())));
- }
- QtWebEngine::initialize();
QQuickWebEngineProfile::defaultProfile()->setOffTheRecord(true);
qmlRegisterType<TempDir>("Test.util", 1, 0, "TempDir");
+ qmlRegisterType<TestInputContext>("Test.util", 1, 0, "TestInputContext");
+ qmlRegisterType<TestInputEvent>("Test.util", 1, 0, "TestInputEvent");
QTEST_SET_MAIN_SOURCE_PATH
+ qmlRegisterSingletonType<HttpServer>("Test.Shared", 1, 0, "HttpServer", [&] (QQmlEngine *, QJSEngine *) {
+ auto server = new HttpServer;
+ server->setResourceDirs(
+ { server->sharedDataDir(),
+ QDir(QT_TESTCASE_SOURCEDIR).canonicalPath() + QLatin1String("/data") });
+ return server;
+ });
- qmlRegisterSingletonType<HttpsServer>("Test.Shared", 1, 0, "HttpsServer", [&] (QQmlEngine *, QJSEngine *) { return new HttpsServer; });
-
- int i = quick_test_main(argc, argv, "qmltests", QUICK_TEST_SOURCE_DIR);
+#if QT_CONFIG(ssl)
+ qmlRegisterSingletonType<HttpsServer>(
+ "Test.Shared", 1, 0, "HttpsServer", [&](QQmlEngine *, QJSEngine *) {
+ return new HttpsServer(":/resources/server.pem", ":/resources/server.key", "");
+ });
+#endif
+ Setup setup;
+ int i = quick_test_main_with_setup(
+ argc, argv, "qmltests",
+ qPrintable(QT_TESTCASE_BUILDDIR + QLatin1String("/webengine.qmltests")), &setup);
return i;
}
diff --git a/tests/auto/quick/qmltests2/data/favicon-misc.html b/tests/auto/quick/qmltests2/data/favicon-misc.html
deleted file mode 100644
index 9e788bdf4..000000000
--- a/tests/auto/quick/qmltests2/data/favicon-misc.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<html>
- <head>
- <title>Favicon Test</title>
- <link rel="shortcut icon" href="icons/qt32.ico" />
- <link rel="apple-touch-icon" href="icons/qt144.png" />
- <link rel="shortcut icon" href="icons/unavailable.ico" />
- </head>
- <body>
- <h1>Favicon Test</h1>
- </body>
-</html>
diff --git a/tests/auto/quick/qmltests2/data/favicon.html b/tests/auto/quick/qmltests2/data/favicon.html
deleted file mode 100644
index e1b84a9cc..000000000
--- a/tests/auto/quick/qmltests2/data/favicon.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<html>
-<head>
-<link type="image/png" href="icons/favicon.png" sizes="48x48" rel="icon" />
-</head>
-<body>
-<p>It's expected that you see a favicon displayed for this page when you open it as a local file.</p>
-<p>The favicon looks like this:</p>
-<img id='image' src="icons/favicon.png"/>
-</body>
-</html>
diff --git a/tests/auto/quick/qmltests2/data/icons/favicon.png b/tests/auto/quick/qmltests2/data/icons/favicon.png
deleted file mode 100644
index 35717cca5..000000000
--- a/tests/auto/quick/qmltests2/data/icons/favicon.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/quick/qmltests2/data/test1.html b/tests/auto/quick/qmltests2/data/test1.html
deleted file mode 100644
index 5c09f06ed..000000000
--- a/tests/auto/quick/qmltests2/data/test1.html
+++ /dev/null
@@ -1,6 +0,0 @@
-<html>
-<head><title>Test page 1</title></head>
-<body>
-Hello.
-</body>
-</html>
diff --git a/tests/auto/quick/qmltests2/data/test2.html b/tests/auto/quick/qmltests2/data/test2.html
deleted file mode 100644
index 629c2a063..000000000
--- a/tests/auto/quick/qmltests2/data/test2.html
+++ /dev/null
@@ -1,6 +0,0 @@
-<html>
-<head><title>Test page with huge link area</title></head>
-<body>
-<a title="A title" href="test1.html"><img width=200 height=200></a>
-</body>
-</html>
diff --git a/tests/auto/quick/qmltests2/data/titleupdate.js b/tests/auto/quick/qmltests2/data/titleupdate.js
deleted file mode 100644
index c86139c13..000000000
--- a/tests/auto/quick/qmltests2/data/titleupdate.js
+++ /dev/null
@@ -1,42 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-function updateTitle()
-{
- var inp = document.getElementById("upfile");
- var allfiles = new String("");
- var name = new String("");
- for (var i = 0; i < inp.files.length; ++i) {
- name = inp.files.item(i).name;
- if (allfiles.length == 0)
- allfiles = name;
- else
- allfiles = allfiles + "," + name;
- }
- document.title = allfiles;
-}
diff --git a/tests/auto/quick/qmltests2/data/tst_favicon.qml b/tests/auto/quick/qmltests2/data/tst_favicon.qml
deleted file mode 100644
index 3f522d91a..000000000
--- a/tests/auto/quick/qmltests2/data/tst_favicon.qml
+++ /dev/null
@@ -1,413 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.3
-import QtWebEngine.testsupport 1.0
-import QtQuick.Window 2.0
-import "../../qmltests/data" 1.0
-
-TestWebEngineView {
- id: webEngineView
- width: 200
- height: 400
-
- testSupport: WebEngineTestSupport {
- property var errorPageLoadStatus: null
-
- function waitForErrorPageLoadSucceeded() {
- var success = _waitFor(function() { return testSupport.errorPageLoadStatus == WebEngineView.LoadSucceededStatus })
- testSupport.errorPageLoadStatus = null
- return success
- }
-
- errorPage.onLoadingChanged: {
- errorPageLoadStatus = loadRequest.status
- }
- }
-
- function removeFaviconProviderPrefix(url) {
- return url.toString().substring(16)
- }
-
- function getFaviconPixel(faviconImage) {
- var grabImage = Qt.createQmlObject("
- import QtQuick 2.5\n
- Image { }", test)
- var faviconCanvas = Qt.createQmlObject("
- import QtQuick 2.5\n
- Canvas { }", test)
-
- test.tryVerify(function() { return faviconImage.status == Image.Ready });
- faviconImage.grabToImage(function(result) {
- grabImage.source = result.url
- });
- test.tryVerify(function() { return grabImage.status == Image.Ready });
-
- faviconCanvas.width = faviconImage.width;
- faviconCanvas.height = faviconImage.height;
- var ctx = faviconCanvas.getContext("2d");
- ctx.drawImage(grabImage, 0, 0, grabImage.width, grabImage.height);
- var imageData = ctx.getImageData(Math.round(faviconCanvas.width/2),
- Math.round(faviconCanvas.height/2),
- faviconCanvas.width,
- faviconCanvas.height);
-
- grabImage.destroy();
- faviconCanvas.destroy();
-
- return imageData.data;
- }
-
- SignalSpy {
- id: iconChangedSpy
- target: webEngineView
- signalName: "iconChanged"
- }
-
- Image {
- id: favicon
- source: webEngineView.icon
- }
-
- TestCase {
- id: test
- name: "WebEngineFavicon"
- when: windowShown
-
-
- function init() {
- // It is worth to restore the initial state with loading a blank page before all test functions.
- webEngineView.url = 'about:blank'
- verify(webEngineView.waitForLoadSucceeded())
- iconChangedSpy.clear()
- }
-
- function test_faviconLoad() {
- compare(iconChangedSpy.count, 0)
-
- var url = Qt.resolvedUrl("favicon.html")
- webEngineView.url = url
- verify(webEngineView.waitForLoadSucceeded())
-
- iconChangedSpy.wait()
- compare(iconChangedSpy.count, 1)
-
- compare(favicon.width, 48)
- compare(favicon.height, 48)
- }
-
- function test_faviconLoadEncodedUrl() {
- compare(iconChangedSpy.count, 0)
-
- var url = Qt.resolvedUrl("favicon2.html?favicon=load should work with#whitespace!")
- webEngineView.url = url
- verify(webEngineView.waitForLoadSucceeded())
-
- iconChangedSpy.wait()
- compare(iconChangedSpy.count, 1)
-
- compare(favicon.width, 16)
- compare(favicon.height, 16)
- }
-
- function test_noFavicon() {
- compare(iconChangedSpy.count, 0)
-
- var url = Qt.resolvedUrl("test1.html")
- webEngineView.url = url
- verify(webEngineView.waitForLoadSucceeded())
-
- compare(iconChangedSpy.count, 0)
-
- var iconUrl = webEngineView.icon
- compare(iconUrl, Qt.resolvedUrl(""))
- }
-
- function test_aboutBlank() {
- compare(iconChangedSpy.count, 0)
-
- var url = Qt.resolvedUrl("about:blank")
- webEngineView.url = url
- verify(webEngineView.waitForLoadSucceeded())
-
- compare(iconChangedSpy.count, 0)
-
- var iconUrl = webEngineView.icon
- compare(iconUrl, Qt.resolvedUrl(""))
- }
-
- function test_unavailableFavicon() {
- compare(iconChangedSpy.count, 0)
-
- var url = Qt.resolvedUrl("favicon-unavailable.html")
- webEngineView.url = url
- verify(webEngineView.waitForLoadSucceeded())
-
- compare(iconChangedSpy.count, 0)
-
- var iconUrl = webEngineView.icon
- compare(iconUrl, Qt.resolvedUrl(""))
- }
-
- function test_errorPageEnabled() {
- WebEngine.settings.errorPageEnabled = true
-
- compare(iconChangedSpy.count, 0)
-
- var url = Qt.resolvedUrl("http://url.invalid")
- webEngineView.url = url
- verify(webEngineView.waitForLoadFailed(20000))
- verify(webEngineView.testSupport.waitForErrorPageLoadSucceeded())
-
- compare(iconChangedSpy.count, 0)
-
- var iconUrl = webEngineView.icon
- compare(iconUrl, Qt.resolvedUrl(""))
- }
-
- function test_errorPageDisabled() {
- WebEngine.settings.errorPageEnabled = false
-
- compare(iconChangedSpy.count, 0)
-
- var url = Qt.resolvedUrl("http://url.invalid")
- webEngineView.url = url
- verify(webEngineView.waitForLoadFailed(20000))
-
- compare(iconChangedSpy.count, 0)
-
- var iconUrl = webEngineView.icon
- compare(iconUrl, Qt.resolvedUrl(""))
- }
-
- function test_bestFavicon() {
- compare(iconChangedSpy.count, 0)
- var url, iconUrl
-
- url = Qt.resolvedUrl("favicon-misc.html")
- webEngineView.url = url
- verify(webEngineView.waitForLoadSucceeded())
-
- iconChangedSpy.wait()
- compare(iconChangedSpy.count, 1)
-
- iconUrl = removeFaviconProviderPrefix(webEngineView.icon)
- // Touch icon is ignored
- compare(iconUrl, Qt.resolvedUrl("icons/qt32.ico"))
- compare(favicon.width, 32)
- compare(favicon.height, 32)
-
- iconChangedSpy.clear()
-
- url = Qt.resolvedUrl("favicon-shortcut.html")
- webEngineView.url = url
- verify(webEngineView.waitForLoadSucceeded())
-
- iconChangedSpy.wait()
- verify(iconChangedSpy.count >= 1)
- iconUrl = removeFaviconProviderPrefix(webEngineView.icon)
-
- // If the icon URL is empty we have to wait for
- // the second iconChanged signal that propagates the expected URL
- if (iconUrl == Qt.resolvedUrl("")) {
- tryCompare(iconChangedSpy, "count", 2)
- iconUrl = removeFaviconProviderPrefix(webEngineView.icon)
- }
-
- compare(iconUrl, Qt.resolvedUrl("icons/qt144.png"))
- compare(favicon.width, 144)
- compare(favicon.height, 144)
- }
-
- function test_touchIcon() {
- compare(iconChangedSpy.count, 0)
-
- var url = Qt.resolvedUrl("favicon-touch.html")
- webEngineView.url = url
- verify(webEngineView.waitForLoadSucceeded())
-
- compare(iconChangedSpy.count, 0)
-
- var iconUrl = webEngineView.icon
- compare(iconUrl, Qt.resolvedUrl(""))
- compare(favicon.width, 0)
- compare(favicon.height, 0)
-
- WebEngine.settings.touchIconsEnabled = true
-
- url = Qt.resolvedUrl("favicon-touch.html")
- webEngineView.url = url
- verify(webEngineView.waitForLoadSucceeded())
-
- iconChangedSpy.wait()
- iconUrl = removeFaviconProviderPrefix(webEngineView.icon)
- compare(iconUrl, Qt.resolvedUrl("icons/qt144.png"))
- compare(iconChangedSpy.count, 1)
- compare(favicon.width, 144)
- compare(favicon.height, 144)
- }
-
- function test_multiIcon() {
- compare(iconChangedSpy.count, 0)
-
- var url = Qt.resolvedUrl("favicon-multi.html")
- webEngineView.url = url
- verify(webEngineView.waitForLoadSucceeded())
-
- iconChangedSpy.wait()
- compare(iconChangedSpy.count, 1)
- compare(favicon.width, 64)
- compare(favicon.height, 64)
- }
-
- function test_faviconProvider_data() {
- return [
- { tag: "multi 8x8", url: Qt.resolvedUrl("favicon-multi-gray.html"), size: 8, value: 16 },
- { tag: "multi 16x16", url: Qt.resolvedUrl("favicon-multi-gray.html"), size: 16, value: 16 },
- { tag: "multi 17x17", url: Qt.resolvedUrl("favicon-multi-gray.html"), size: 17, value: 32 },
- { tag: "multi 31x31", url: Qt.resolvedUrl("favicon-multi-gray.html"), size: 31, value: 32 },
- { tag: "multi 32x32", url: Qt.resolvedUrl("favicon-multi-gray.html"), size: 32, value: 32 },
- { tag: "multi 33x33", url: Qt.resolvedUrl("favicon-multi-gray.html"), size: 33, value: 64 },
- { tag: "multi 64x64", url: Qt.resolvedUrl("favicon-multi-gray.html"), size: 64, value: 64 },
- { tag: "multi 128x128", url: Qt.resolvedUrl("favicon-multi-gray.html"), size: 128, value: 128 },
- { tag: "multi 255x255", url: Qt.resolvedUrl("favicon-multi-gray.html"), size: 255, value: 255 },
- { tag: "multi 256x256", url: Qt.resolvedUrl("favicon-multi-gray.html"), size: 256, value: 255 },
- { tag: "candidate 8x8", url: Qt.resolvedUrl("favicon-candidates-gray.html"), size: 8, value: 16 },
- { tag: "candidate 16x16", url: Qt.resolvedUrl("favicon-candidates-gray.html"), size: 16, value: 16 },
- { tag: "candidate 17x17", url: Qt.resolvedUrl("favicon-candidates-gray.html"), size: 17, value: 32 },
- { tag: "candidate 31x31", url: Qt.resolvedUrl("favicon-candidates-gray.html"), size: 31, value: 32 },
- { tag: "candidate 32x32", url: Qt.resolvedUrl("favicon-candidates-gray.html"), size: 32, value: 32 },
- { tag: "candidate 33x33", url: Qt.resolvedUrl("favicon-candidates-gray.html"), size: 33, value: 64 },
- { tag: "candidate 64x64", url: Qt.resolvedUrl("favicon-candidates-gray.html"), size: 64, value: 64 },
- { tag: "candidate 128x128", url: Qt.resolvedUrl("favicon-candidates-gray.html"), size: 128, value: 128 },
- { tag: "candidate 255x255", url: Qt.resolvedUrl("favicon-candidates-gray.html"), size: 255, value: 255 },
- { tag: "candidate 256x256", url: Qt.resolvedUrl("favicon-candidates-gray.html"), size: 256, value: 255 },
- ];
- }
-
- function test_faviconProvider(row) {
- var faviconImage = Qt.createQmlObject("
- import QtQuick 2.5\n
- Image { sourceSize: Qt.size(width, height) }", test)
-
- compare(iconChangedSpy.count, 0)
-
- webEngineView.url = row.url
- verify(webEngineView.waitForLoadSucceeded())
-
- iconChangedSpy.wait()
- compare(iconChangedSpy.count, 1)
-
- faviconImage.width = row.size / Screen.devicePixelRatio
- faviconImage.height = row.size / Screen.devicePixelRatio
- faviconImage.source = webEngineView.icon
-
- var pixel = getFaviconPixel(faviconImage);
- compare(pixel[0], row.value)
-
- faviconImage.destroy()
- }
-
- function test_dynamicFavicon() {
- var faviconImage = Qt.createQmlObject("
- import QtQuick 2.5\n
- Image { width: 16; height: 16; sourceSize: Qt.size(width, height); }", test)
- faviconImage.source = Qt.binding(function() { return webEngineView.icon; });
-
- var colors = [
- {"url": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8DwHwAFBQIAX8jx0gAAAABJRU5ErkJggg==", "r": 255, "g": 0, "b": 0},
- {"url": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M/wHwAEBgIApD5fRAAAAABJRU5ErkJggg==", "r": 0, "g": 255, "b": 0},
- {"url": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPj/HwADBwIAMCbHYQAAAABJRU5ErkJggg==", "r": 0, "g": 0, "b": 255},
- ];
- var pixel;
-
- compare(iconChangedSpy.count, 0);
- webEngineView.loadHtml(
- "<html>" +
- "<link rel='icon' type='image/png' href='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII='/>" +
- "</html>"
- );
- verify(webEngineView.waitForLoadSucceeded());
- tryCompare(iconChangedSpy, "count", 1);
-
- pixel = getFaviconPixel(faviconImage);
- compare(pixel[0], 0);
- compare(pixel[1], 0);
- compare(pixel[2], 0);
-
- for (var i = 0; i < colors.length; ++i) {
- iconChangedSpy.clear();
- runJavaScript("document.getElementsByTagName('link')[0].href = 'data:image/png;base64," + colors[i]["url"] + "';");
- tryCompare(faviconImage, "source", "image://favicon/data:image/png;base64," + colors[i]["url"]);
- compare(iconChangedSpy.count, 1);
-
- pixel = getFaviconPixel(faviconImage);
- compare(pixel[0], colors[i]["r"]);
- compare(pixel[1], colors[i]["g"]);
- compare(pixel[2], colors[i]["b"]);
- }
-
- faviconImage.destroy()
- }
-
- function test_touchIconWithSameURL()
- {
- WebEngine.settings.touchIconsEnabled = false;
-
- var icon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII=";
-
- webEngineView.loadHtml(
- "<html>" +
- "<link rel='icon' type='image/png' href='" + icon + "'/>" +
- "<link rel='apple-touch-icon' type='image/png' href='" + icon + "'/>" +
- "</html>"
- );
- verify(webEngineView.waitForLoadSucceeded());
-
- // The default favicon has to be loaded even if its URL is also set as a touch icon while touch icons are disabled.
- tryCompare(iconChangedSpy, "count", 1);
- compare(webEngineView.icon.toString().replace(/^image:\/\/favicon\//, ''), icon);
-
- iconChangedSpy.clear();
-
- webEngineView.loadHtml(
- "<html>" +
- "<link rel='apple-touch-icon' type='image/png' href='" + icon + "'/>" +
- "</html>"
- );
- verify(webEngineView.waitForLoadSucceeded());
-
- // This page only has a touch icon. With disabled touch icons we don't expect any icon to be shown even if the same icon
- // was loaded previously.
- tryCompare(iconChangedSpy, "count", 1);
- verify(!webEngineView.icon.toString().replace(/^image:\/\/favicon\//, ''));
- }
- }
-}
diff --git a/tests/auto/quick/qmltests2/data/tst_faviconDownload.qml b/tests/auto/quick/qmltests2/data/tst_faviconDownload.qml
deleted file mode 100644
index 9aa32279c..000000000
--- a/tests/auto/quick/qmltests2/data/tst_faviconDownload.qml
+++ /dev/null
@@ -1,121 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.3
-import "../../qmltests/data" 1.0
-
-TestWebEngineView {
- id: webEngineView
- width: 200
- height: 400
-
- function removeFaviconProviderPrefix(url) {
- return url.toString().substring(16)
- }
-
- SignalSpy {
- id: iconChangedSpy
- target: webEngineView
- signalName: "iconChanged"
- }
-
- TestCase {
- id: test
- name: "WebEngineFaviconDownload"
-
- function init() {
- WebEngine.settings.autoLoadIconsForPage = true
- WebEngine.settings.touchIconsEnabled = false
-
- if (webEngineView.icon != '') {
- // If this is not the first test, then load a blank page without favicon, restoring the initial state.
- webEngineView.url = 'about:blank'
- verify(webEngineView.waitForLoadSucceeded())
- iconChangedSpy.wait()
- }
-
- iconChangedSpy.clear()
- }
-
- function cleanupTestCase() {
- WebEngine.settings.autoLoadIconsForPage = true
- WebEngine.settings.touchIconsEnabled = false
- }
-
- function test_downloadIconsDisabled_data() {
- return [
- { tag: "misc", url: Qt.resolvedUrl("favicon-misc.html") },
- { tag: "shortcut", url: Qt.resolvedUrl("favicon-shortcut.html") },
- { tag: "single", url: Qt.resolvedUrl("favicon-single.html") },
- { tag: "touch", url: Qt.resolvedUrl("favicon-touch.html") },
- { tag: "unavailable", url: Qt.resolvedUrl("favicon-unavailable.html") },
- ];
- }
-
- function test_downloadIconsDisabled(row) {
- WebEngine.settings.autoLoadIconsForPage = false
-
- compare(iconChangedSpy.count, 0)
-
- webEngineView.url = row.url
- verify(webEngineView.waitForLoadSucceeded())
-
- compare(iconChangedSpy.count, 0)
-
- var iconUrl = webEngineView.icon
- compare(iconUrl, Qt.resolvedUrl(""))
- }
-
- function test_downloadTouchIconsEnabled_data() {
- return [
- { tag: "misc", url: Qt.resolvedUrl("favicon-misc.html"), expectedIconUrl: Qt.resolvedUrl("icons/qt144.png") },
- { tag: "shortcut", url: Qt.resolvedUrl("favicon-shortcut.html"), expectedIconUrl: Qt.resolvedUrl("icons/qt144.png") },
- { tag: "single", url: Qt.resolvedUrl("favicon-single.html"), expectedIconUrl: Qt.resolvedUrl("icons/qt32.ico") },
- { tag: "touch", url: Qt.resolvedUrl("favicon-touch.html"), expectedIconUrl: Qt.resolvedUrl("icons/qt144.png") },
- ];
- }
-
- function test_downloadTouchIconsEnabled(row) {
- WebEngine.settings.touchIconsEnabled = true
-
- compare(iconChangedSpy.count, 0)
-
- webEngineView.url = row.url
- verify(webEngineView.waitForLoadSucceeded())
-
- iconChangedSpy.wait()
- compare(iconChangedSpy.count, 1)
-
- var iconUrl = removeFaviconProviderPrefix(webEngineView.icon)
- compare(iconUrl, row.expectedIconUrl)
- }
- }
-}
-
diff --git a/tests/auto/quick/qmltests2/data/tst_filePicker.qml b/tests/auto/quick/qmltests2/data/tst_filePicker.qml
deleted file mode 100644
index ab30d9e82..000000000
--- a/tests/auto/quick/qmltests2/data/tst_filePicker.qml
+++ /dev/null
@@ -1,310 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.2
-import "../../qmltests/data" 1.0
-import "../mock-delegates/TestParams" 1.0
-
-TestWebEngineView {
- id: webEngineView
- width: 400
- height: 300
- property var titleChanges: []
-
- function driveLetter() {
- if (Qt.platform.os !== "windows")
- return "";
- return "C:/";
- }
-
- SignalSpy {
- id: titleSpy
- target: webEngineView
- signalName: "titleChanged"
- }
- SignalSpy {
- id: terminationSpy
- target: webEngineView
- signalName: "renderProcessTerminated"
- }
-
- onTitleChanged: { titleChanges.push(webEngineView.title) }
-
- TestCase {
- name: "WebEngineViewSingleFileUpload"
- when: windowShown
-
- function init() {
- FilePickerParams.filePickerOpened = false
- FilePickerParams.selectFiles = false
- FilePickerParams.selectedFilesUrl = []
- FilePickerParams.nameFilters = []
- titleSpy.clear()
- terminationSpy.clear()
- titleChanges = []
- }
-
- function cleanup() {
- // Test that the render process doesn't crash, and make sure if it does it does so now.
- wait(100)
- verify(terminationSpy.count == 0, "Render process didn't self terminate")
-
- // FIXME: Almost every second url loading progress does get stuck at about 90 percent, so the loadFinished signal won't arrive.
- // This cleanup function is a workaround for this problem.
- webEngineView.url = Qt.resolvedUrl("about:blank")
- webEngineView.waitForLoadSucceeded()
- }
-
- function test_acceptSingleFileSelection_data() {
- return [
- { tag: "test.txt", input: "test.txt", expected: "Failed to Upload" },
- { tag: driveLetter() + "/test.txt", input: driveLetter() + "/test.txt", expected: "test.txt" },
- { tag: driveLetter() + "/tést.txt", input: driveLetter() + "/tést.txt", expected: "tést.txt" },
- { tag: driveLetter() + "/t%65st.txt", input: driveLetter() + "/t%65st.txt", expected: "t%65st.txt" },
- { tag: "file:///" + driveLetter() + "test.txt", input: "file:///" + driveLetter() + "test.txt", expected: "test.txt" },
- { tag: "file:///" + driveLetter() + "tést.txt", input: "file:///" + driveLetter() + "tést.txt", expected: "tést.txt" },
- { tag: "file:///" + driveLetter() + "t%65st.txt", input: "file:///" + driveLetter() + "t%65st.txt", expected: "t%65st.txt" },
- { tag: "file://" + driveLetter() + "test.txt", input: "file://" + driveLetter() + "test.txt", expected: "Failed to Upload" },
- { tag: "file:/" + driveLetter() + "test.txt", input: "file:/" + driveLetter() + "test.txt", expected: "test.txt"},
- { tag: "file:test//test.txt", input: "file:test//test.txt", expected: "Failed to Upload" },
- { tag: "http://test.txt", input: "http://test.txt", expected: "Failed to Upload" },
- { tag: "qrc:/test.txt", input: "qrc:/test.txt", expected: "Failed to Upload" },
- ];
- }
-
- function test_acceptSingleFileSelection(row) {
- var expectedFileName;
-
- // Default dialog
- webEngineView.url = Qt.resolvedUrl("singlefileupload.html");
- verify(webEngineView.waitForLoadSucceeded());
-
- FilePickerParams.selectFiles = true;
- FilePickerParams.selectedFilesUrl.push(row.input);
-
- keyClick(Qt.Key_Enter); // Focus is on the button. Open FileDialog.
- tryCompare(FilePickerParams, "filePickerOpened", true);
- webEngineView.url = Qt.resolvedUrl("about:blank");
- verify(webEngineView.waitForLoadSucceeded());
- tryCompare(webEngineView, "title", "about:blank");
- compare(titleChanges[titleChanges.length-2], row.expected);
-
-
- // Custom dialog
- var finished = false;
-
- function acceptedFileHandler(request) {
- request.accepted = true;
- request.dialogAccept(row.input);
- finished = true;
- }
-
- webEngineView.fileDialogRequested.connect(acceptedFileHandler);
- webEngineView.url = Qt.resolvedUrl("singlefileupload.html");
- verify(webEngineView.waitForLoadSucceeded());
-
- keyClick(Qt.Key_Enter); // Focus is on the button. Open FileDialog.
- tryVerify(function() { return finished; });
- webEngineView.url = Qt.resolvedUrl("about:blank");
- verify(webEngineView.waitForLoadSucceeded());
- tryCompare(webEngineView, "title", "about:blank");
- compare(titleChanges[titleChanges.length-2], row.expected);
- webEngineView.fileDialogRequested.disconnect(acceptedFileHandler);
- }
-
- function test_acceptMultipleFilesSelection() {
- webEngineView.url = Qt.resolvedUrl("multifileupload.html")
- verify(webEngineView.waitForLoadSucceeded())
-
- FilePickerParams.selectFiles = true
- FilePickerParams.selectedFilesUrl.push(Qt.resolvedUrl("test1.html"))
- FilePickerParams.selectedFilesUrl.push(Qt.resolvedUrl("test2.html"))
-
- keyPress(Qt.Key_Enter) // Focus is on the button. Open FileDialog.
- tryCompare(FilePickerParams, "filePickerOpened", true)
- tryCompare(webEngineView, "title", "test1.html,test2.html")
- }
-
- function test_acceptDirectory() {
- webEngineView.url = Qt.resolvedUrl("directoryupload.html")
- verify(webEngineView.waitForLoadSucceeded())
-
- FilePickerParams.selectFiles = true
- FilePickerParams.selectedFilesUrl.push(Qt.resolvedUrl("../data"))
-
- keyClick(Qt.Key_Enter) // Focus is on the button. Open FileDialog.
- tryCompare(FilePickerParams, "filePickerOpened", true)
- // Check that the title is a file list (eg. "test1.html,test2.html")
- tryVerify(function() { return webEngineView.title.match("^([^,]+,)+[^,]+$"); })
- }
-
- function test_reject() {
- webEngineView.url = Qt.resolvedUrl("singlefileupload.html")
- verify(webEngineView.waitForLoadSucceeded())
-
- titleSpy.clear()
- keyPress(Qt.Key_Enter) // Focus is on the button. Open FileDialog.
- wait(100)
- compare(titleSpy.count, 0)
- }
-
- function test_acceptMultipleFilesWithCustomDialog_data() {
- return [
- { tag: "path", input: [driveLetter() + "/test1.txt", driveLetter() + "/test2.txt"], expectedValue: "test1.txt,test2.txt" },
- { tag: "file", input: ["file:///" + driveLetter() + "test1.txt", "file:/" + driveLetter() + "test2.txt"], expectedValue: "test1.txt,test2.txt" },
- { tag: "mixed", input: ["file:///" + driveLetter() + "test1.txt", driveLetter() + "/test2.txt"], expectedValue: "test1.txt,test2.txt" },
- ];
- }
-
- function test_acceptMultipleFilesWithCustomDialog(row) {
- // Default dialog
- webEngineView.url = Qt.resolvedUrl("multifileupload.html");
- verify(webEngineView.waitForLoadSucceeded());
-
- FilePickerParams.selectFiles = true;
- FilePickerParams.selectedFilesUrl = row.input;
-
- keyClick(Qt.Key_Enter); // Focus is on the button. Open FileDialog.
- tryCompare(FilePickerParams, "filePickerOpened", true);
- tryCompare(webEngineView, "title", row.expectedValue);
-
-
- // Custom dialog
- var finished = false;
-
- function acceptedFileHandler(request) {
- request.accepted = true;
- request.dialogAccept(row.input);
- finished = true;
- }
-
- webEngineView.fileDialogRequested.connect(acceptedFileHandler);
- webEngineView.url = Qt.resolvedUrl("multifileupload.html");
- verify(webEngineView.waitForLoadSucceeded());
-
- keyClick(Qt.Key_Enter); // Focus is on the button. Open FileDialog.
- tryVerify(function() { return finished; });
- tryCompare(webEngineView, "title", row.expectedValue);
- webEngineView.fileDialogRequested.disconnect(acceptedFileHandler);
- }
-
- function test_acceptFileOnWindows_data() {
- return [
- { tag: "C:test.txt", input: "C:test.txt", expected: "Failed to Upload"},
- { tag: "C:test:txt", input: "C:test:txt", expected: "Failed to Upload"},
- { tag: "C:/test.txt", input: "C:/test.txt", expected: "test.txt"},
- { tag: "C:\\test.txt", input: "C:\\test.txt", expected: "test.txt"},
- { tag: "C:\\Documents and Settings\\test\\test.txt", input: "C:\\Documents and Settings\\test\\test.txt", expected: "test.txt"},
- { tag: "\\\\applib\\products\\a%2Db\\ abc%5F9\\t.est\\test.txt", input: "\\\\applib\\products\\a%2Db\\ abc%5F9\\t.est\\test.txt", expected: "test.txt"},
- { tag: "file://applib/products/a%2Db/ abc%5F9/4148.920a/media/test.txt", input: "file://applib/products/a%2Db/ abc%5F9/4148.920a/media/test.txt", expected: "test.txt"},
- { tag: "file://applib/products/a-b/abc_1/t.est/test.txt", input: "file://applib/products/a-b/abc_1/t.est/test.txt", expected: "test.txt"},
- { tag: "file:\\\\applib\\products\\a-b\\abc_1\\t:est\\test.txt", input: "file:\\\\applib\\products\\a-b\\abc_1\\t:est\\test.txt", expected: "test.txt"},
- { tag: "file:C:/test.txt", input: "file:C:/test.txt", expected: "test.tx"},
- { tag: "file:/C:/test.txt", input: "file:/C:/test.txt", expected: "test.tx"},
- { tag: "file://C:/test.txt", input: "file://C:/test.txt", expected: "Failed to Upload"},
- { tag: "file:///C:test.txt", input: "file:///C:test.txt", expected: "Failed to Upload"},
- { tag: "file:///C:/test.txt", input: "file:///C:/test.txt", expected: "test.txt"},
- { tag: "file:///C:\\test.txt", input: "file:///C:\\test.txt", expected: "test.txt"},
- { tag: "file:\\//C:/test.txt", input: "file:\\//C:/test.txt", expected: "test.txt"},
- { tag: "file:\\\\/C:\\test.txt", input: "file:\\\\/C:\\test.txt", expected: "test.txt"},
- { tag: "\\\\?\\C:/test.txt", input: "\\\\?\\C:/test.txt", expected: "test.tx"},
- ];
- }
-
- function test_acceptFileOnWindows(row) {
- if (Qt.platform.os !== "windows")
- skip("Windows-only test");
-
- // Default dialog
- webEngineView.url = Qt.resolvedUrl("singlefileupload.html");
- verify(webEngineView.waitForLoadSucceeded());
-
- FilePickerParams.selectFiles = true;
- FilePickerParams.selectedFilesUrl.push(row.input);
-
- keyClick(Qt.Key_Enter); // Focus is on the button. Open FileDialog.
- tryCompare(FilePickerParams, "filePickerOpened", true);
- webEngineView.url = Qt.resolvedUrl("about:blank");
- verify(webEngineView.waitForLoadSucceeded());
- tryCompare(webEngineView, "title", "about:blank");
- compare(titleChanges[titleChanges.length-2], row.expected);
-
-
- // Custom dialog
- var finished = false;
-
- function acceptedFileHandler(request) {
- request.accepted = true;
- request.dialogAccept(row.input);
- finished = true;
- }
-
- webEngineView.fileDialogRequested.connect(acceptedFileHandler);
- webEngineView.url = Qt.resolvedUrl("singlefileupload.html");
- verify(webEngineView.waitForLoadSucceeded());
-
- keyClick(Qt.Key_Enter); // Focus is on the button. Open FileDialog.
- tryVerify(function() { return finished; });
- webEngineView.url = Qt.resolvedUrl("about:blank");
- verify(webEngineView.waitForLoadSucceeded());
- tryCompare(webEngineView, "title", "about:blank");
- compare(titleChanges[titleChanges.length-2], row.expected);
- webEngineView.fileDialogRequested.disconnect(acceptedFileHandler);
- }
-
- function test_acceptFileTypes_data() {
- return [
- { tag: "CustomSuffix", input: ".pug", expected: ".pug", exactMatch: false},
- { tag: "CustomMime", input: "dog/pug", expected: "Accepted types ()", exactMatch: true},
- { tag: "CustomGlob", input: "dog/*", expected: "Accepted types ()", exactMatch: true},
- { tag: "Invalid", input: "---", expected: undefined, exactMatch: true},
- { tag: "Jpeg", input: "image/jpeg", expected: ".jpeg", exactMatch: false}
- ];
- }
-
- function test_acceptFileTypes(row) {
- var expectedFileName;
-
- webEngineView.url = Qt.resolvedUrl("accepttypes.html");
- verify(webEngineView.waitForLoadSucceeded());
-
- webEngineView.runJavaScript("setAcceptType('" + row.input + "');");
- tryCompare(webEngineView, "title", row.input);
-
- keyClick(Qt.Key_Enter); // Focus is on the button. Open FileDialog.
- tryCompare(FilePickerParams, "filePickerOpened", true);
-
- if (row.exactMatch)
- compare(FilePickerParams.nameFilters[0], row.expected);
- else
- verify(FilePickerParams.nameFilters[0].includes(row.expected));
- }
- }
-}
diff --git a/tests/auto/quick/qmltests2/data/tst_inputMethod.qml b/tests/auto/quick/qmltests2/data/tst_inputMethod.qml
deleted file mode 100644
index 0bf9f7eb0..000000000
--- a/tests/auto/quick/qmltests2/data/tst_inputMethod.qml
+++ /dev/null
@@ -1,77 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.4
-import QtWebEngine.testsupport 1.0
-import "../../qmltests/data" 1.0
-
-TestWebEngineView {
- id: webEngineView
- width: 200
- height: 400
-
- testSupport: WebEngineTestSupport { }
-
- TestCase {
- name: "WebEngineViewInputMethod"
- when: windowShown
-
- function init() {
- testSupport.testInputContext.create();
- }
-
- function cleanup() {
- testSupport.testInputContext.release();
- }
-
- function test_softwareInputPanel() {
- verify(!Qt.inputMethod.visible);
- webEngineView.loadHtml(
- "<html><body>" +
- " <form><input id='textInput' type='text' /></form>" +
- "</body></html");
- verify(webEngineView.waitForLoadSucceeded());
-
- verify(!getActiveElementId());
- verify(!Qt.inputMethod.visible);
-
- // Show input panel
- webEngineView.runJavaScript("document.getElementById('textInput').focus()");
- webEngineView.verifyElementHasFocus("textInput");
- tryVerify(function() { return Qt.inputMethod.visible; });
-
- // Hide input panel
- webEngineView.runJavaScript("document.getElementById('textInput').blur()");
- verify(!getActiveElementId());
- tryVerify(function() { return !Qt.inputMethod.visible; });
- }
- }
-}
-
diff --git a/tests/auto/quick/qmltests2/data/tst_javaScriptDialogs.qml b/tests/auto/quick/qmltests2/data/tst_javaScriptDialogs.qml
deleted file mode 100644
index 658071005..000000000
--- a/tests/auto/quick/qmltests2/data/tst_javaScriptDialogs.qml
+++ /dev/null
@@ -1,141 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.2
-import QtWebEngine.testsupport 1.0
-import "../../qmltests/data" 1.0
-import "../mock-delegates/TestParams" 1.0
-
-TestWebEngineView {
- id: webEngineView
- anchors.fill: parent
-
- testSupport: WebEngineTestSupport {
- property bool windowCloseRejectedSignalEmitted: false
-
- function waitForWindowCloseRejected() {
- return _waitFor(function () {
- return testSupport.windowCloseRejectedSignalEmitted;
- });
- }
-
- onWindowCloseRejected: {
- windowCloseRejectedSignalEmitted = true;
- }
- }
-
- TestCase {
- id: test
- name: "WebEngineViewJavaScriptDialogs"
- when: windowShown
-
- function init() {
- JSDialogParams.dialogMessage = "";
- JSDialogParams.dialogTitle = "";
- JSDialogParams.dialogCount = 0;
- JSDialogParams.shouldAcceptDialog = true;
- }
-
- function test_alert() {
- webEngineView.url = Qt.resolvedUrl("alert.html")
- verify(webEngineView.waitForLoadSucceeded())
- compare(JSDialogParams.dialogCount, 1)
- compare(JSDialogParams.dialogMessage, "Hello Qt")
- verify(JSDialogParams.dialogTitle.indexOf("Javascript Alert -") === 0)
- }
-
- function test_confirm() {
- webEngineView.url = Qt.resolvedUrl("confirm.html")
- verify(webEngineView.waitForLoadSucceeded())
- compare(JSDialogParams.dialogMessage, "Confirm test")
- compare(JSDialogParams.dialogCount, 1)
- compare(webEngineView.title, "ACCEPTED")
- JSDialogParams.shouldAcceptDialog = false
- webEngineView.reload()
- verify(webEngineView.waitForLoadSucceeded())
- compare(JSDialogParams.dialogCount, 2)
- compare(webEngineView.title, "REJECTED")
-
- }
- function readMousePressRecieved() {
- var mousePressReceived;
- runJavaScript("window.mousePressReceived", function(result) {
- mousePressReceived = result;
- });
-
- _waitFor(function() { return mousePressReceived != undefined; });
- return mousePressReceived;
- }
-
- function simulateUserGesture() {
- // A user gesture after page load is required since Chromium 60 to allow showing
- // an onbeforeunload dialog.
- // See https://www.chromestatus.com/feature/5082396709879808
- mouseClick(webEngineView, 10, 10, Qt.LeftButton)
-
- tryVerify(readMousePressRecieved)
- }
-
- function test_confirmClose() {
- webEngineView.url = Qt.resolvedUrl("confirmclose.html");
- verify(webEngineView.waitForLoadSucceeded());
- webEngineView.windowCloseRequestedSignalEmitted = false;
- JSDialogParams.shouldAcceptDialog = true;
-
- simulateUserGesture()
- webEngineView.triggerWebAction(WebEngineView.RequestClose);
- verify(webEngineView.waitForWindowCloseRequested());
- }
-
- function test_rejectClose() {
- webEngineView.url = Qt.resolvedUrl("confirmclose.html");
- verify(webEngineView.waitForLoadSucceeded());
- webEngineView.testSupport.windowCloseRejectedSignalEmitted = false;
- JSDialogParams.shouldAcceptDialog = false;
-
- simulateUserGesture()
- webEngineView.triggerWebAction(WebEngineView.RequestClose);
- verify(webEngineView.testSupport.waitForWindowCloseRejected());
- }
-
- function test_prompt() {
- JSDialogParams.inputForPrompt = "tQ olleH"
- webEngineView.url = Qt.resolvedUrl("prompt.html")
- verify(webEngineView.waitForLoadSucceeded())
- compare(JSDialogParams.dialogCount, 1)
- compare(webEngineView.title, "tQ olleH")
- JSDialogParams.shouldAcceptDialog = false
- webEngineView.reload()
- verify(webEngineView.waitForLoadSucceeded())
- compare(JSDialogParams.dialogCount, 2)
- compare(webEngineView.title, "null")
- }
- }
-}
diff --git a/tests/auto/quick/qmltests2/data/tst_linkHovered.qml b/tests/auto/quick/qmltests2/data/tst_linkHovered.qml
deleted file mode 100644
index faf943c55..000000000
--- a/tests/auto/quick/qmltests2/data/tst_linkHovered.qml
+++ /dev/null
@@ -1,131 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.2
-import QtWebEngine.testsupport 1.0
-import "../../qmltests/data" 1.0
-
-TestWebEngineView {
- id: webEngineView
- width: 200
- height: 400
- focus: true
-
- property string lastUrl
-
- testSupport: WebEngineTestSupport { }
-
- SignalSpy {
- id: loadVisuallyCommittedSpy
- target: webEngineView.testSupport
- signalName: "loadVisuallyCommitted"
- }
-
- SignalSpy {
- id: linkHoveredSpy
- target: webEngineView
- signalName: "linkHovered"
- }
-
- onLinkHovered: {
- webEngineView.lastUrl = hoveredUrl
- }
-
- TestCase {
- name: "DesktopWebEngineViewLinkHovered"
-
- // Delayed windowShown to workaround problems with Qt5 in debug mode.
- when: false
- Timer {
- running: parent.windowShown
- repeat: false
- interval: 1
- onTriggered: parent.when = true
- }
-
- function init() {
- webEngineView.lastUrl = "";
- loadVisuallyCommittedSpy.clear();
- linkHoveredSpy.clear();
- }
-
- function test_linkHovered() {
- compare(linkHoveredSpy.count, 0);
- mouseMove(webEngineView, 100, 300)
- webEngineView.url = Qt.resolvedUrl("test2.html")
- verify(webEngineView.waitForLoadSucceeded())
-
- // We get a linkHovered signal with empty hoveredUrl after page load
- linkHoveredSpy.wait();
- compare(linkHoveredSpy.count, 1);
- compare(webEngineView.lastUrl, "")
-
- // Wait for the page to be rendered before trying to test based on input events
- loadVisuallyCommittedSpy.wait();
-
- mouseMove(webEngineView, 100, 100)
- linkHoveredSpy.wait(12000);
- compare(linkHoveredSpy.count, 2);
- compare(webEngineView.lastUrl, Qt.resolvedUrl("test1.html"))
- mouseMove(webEngineView, 100, 300)
- linkHoveredSpy.wait(12000);
- compare(linkHoveredSpy.count, 3);
- compare(webEngineView.lastUrl, "")
- }
-
- function test_linkHoveredDoesntEmitRepeated() {
- compare(linkHoveredSpy.count, 0);
- webEngineView.url = Qt.resolvedUrl("test2.html")
- verify(webEngineView.waitForLoadSucceeded())
-
- // We get a linkHovered signal with empty hoveredUrl after page load
- linkHoveredSpy.wait();
- compare(linkHoveredSpy.count, 1);
- compare(webEngineView.lastUrl, "")
-
- // Wait for the page to be rendered before trying to test based on input events
- loadVisuallyCommittedSpy.wait();
-
- for (var i = 0; i < 100; i += 10)
- mouseMove(webEngineView, 100, 100 + i)
-
- linkHoveredSpy.wait(12000);
- compare(linkHoveredSpy.count, 2);
- compare(webEngineView.lastUrl, Qt.resolvedUrl("test1.html"))
-
- for (var i = 0; i < 100; i += 10)
- mouseMove(webEngineView, 100, 300 + i)
-
- linkHoveredSpy.wait(12000);
- compare(linkHoveredSpy.count, 3);
- compare(webEngineView.lastUrl, "")
- }
- }
-}
diff --git a/tests/auto/quick/qmltests2/data/tst_loadFail.qml b/tests/auto/quick/qmltests2/data/tst_loadFail.qml
deleted file mode 100644
index db412f252..000000000
--- a/tests/auto/quick/qmltests2/data/tst_loadFail.qml
+++ /dev/null
@@ -1,146 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.2
-import QtWebEngine.testsupport 1.0
-import "../../qmltests/data" 1.0
-
-TestWebEngineView {
- id: webEngineView
- width: 400
- height: 300
-
- property var unavailableUrl: Qt.resolvedUrl("file_that_does_not_exist.html")
- property var loadRequestArray: []
-
- testSupport: WebEngineTestSupport {
- property var errorPageLoadStatus: null
-
- function waitForErrorPageLoadSucceeded() {
- var success = _waitFor(function() { return testSupport.errorPageLoadStatus == WebEngineView.LoadSucceededStatus })
- testSupport.errorPageLoadStatus = null
- return success
- }
-
- errorPage.onLoadingChanged: {
- errorPageLoadStatus = loadRequest.status
-
- loadRequestArray.push({
- "status": loadRequest.status,
- "url": loadRequest.url.toString(),
- "errorDomain": loadRequest.errorDomain,
- "isErrorPage": true
- })
- }
- }
-
- onLoadingChanged: {
- if (loadRequest.status == WebEngineView.LoadFailedStatus) {
- test.compare(loadRequest.url, unavailableUrl)
- test.compare(loadRequest.errorDomain, WebEngineView.InternalErrorDomain)
- }
-
- loadRequestArray.push({
- "status": loadRequest.status,
- "url": loadRequest.url.toString(),
- "errorDomain": loadRequest.errorDomain,
- "isErrorPage": false
- })
- }
-
- TestCase {
- id: test
- name: "WebEngineViewLoadFail"
-
- function test_fail() {
- WebEngine.settings.errorPageEnabled = false
- webEngineView.url = unavailableUrl
- verify(webEngineView.waitForLoadFailed())
- }
-
- function test_fail_url() {
- WebEngine.settings.errorPageEnabled = false
- var url = Qt.resolvedUrl("test1.html")
- webEngineView.url = url
- compare(webEngineView.url, url)
- verify(webEngineView.waitForLoadSucceeded())
- compare(webEngineView.url, url)
-
- webEngineView.url = unavailableUrl
- compare(webEngineView.url, unavailableUrl)
- verify(webEngineView.waitForLoadFailed())
- // When error page is disabled in case of LoadFail the entry of the unavailable page is not stored.
- // We expect the url of the previously loaded page here.
- compare(webEngineView.url, url)
- }
-
- function test_error_page() {
- WebEngine.settings.errorPageEnabled = true
- webEngineView.url = unavailableUrl
-
- // Loading of the error page must be successful
- verify(webEngineView.testSupport.waitForErrorPageLoadSucceeded())
-
- var loadRequest = null
- compare(loadRequestArray.length, 4)
-
- // Start to load unavailableUrl
- loadRequest = loadRequestArray[0]
- compare(loadRequest.status, WebEngineView.LoadStartedStatus)
- compare(loadRequest.errorDomain, WebEngineView.NoErrorDomain)
- compare(loadRequest.url, unavailableUrl)
- verify(!loadRequest.isErrorPage)
-
- // Loading of the unavailableUrl must fail
- loadRequest = loadRequestArray[1]
- compare(loadRequest.status, WebEngineView.LoadFailedStatus)
- compare(loadRequest.errorDomain, WebEngineView.InternalErrorDomain)
- compare(loadRequest.url, unavailableUrl)
- verify(!loadRequest.isErrorPage)
-
- // Start to load error page
- loadRequest = loadRequestArray[2]
- compare(loadRequest.status, WebEngineView.LoadStartedStatus)
- compare(loadRequest.errorDomain, WebEngineView.NoErrorDomain)
- compare(loadRequest.url, "chrome-error://chromewebdata/")
- verify(loadRequest.isErrorPage)
-
- // Loading of the error page must be successful
- loadRequest = loadRequestArray[3]
- compare(loadRequest.status, WebEngineView.LoadSucceededStatus)
- compare(loadRequest.errorDomain, WebEngineView.NoErrorDomain)
- compare(loadRequest.url, "chrome-error://chromewebdata/")
- verify(loadRequest.isErrorPage)
-
- compare(webEngineView.url, unavailableUrl)
- compare(webEngineView.title, unavailableUrl)
- }
- }
-}
diff --git a/tests/auto/quick/qmltests2/data/tst_mouseClick.qml b/tests/auto/quick/qmltests2/data/tst_mouseClick.qml
deleted file mode 100644
index eaa012f86..000000000
--- a/tests/auto/quick/qmltests2/data/tst_mouseClick.qml
+++ /dev/null
@@ -1,130 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.4
-import QtWebEngine.testsupport 1.0
-import "../../qmltests/data" 1.0
-
-TestWebEngineView {
- id: webEngineView
- width: 200
- height: 200
-
- testSupport: WebEngineTestSupport {
- function mouseMultiClick(item, x, y, clickCount) {
- if (!item)
- qtest_fail("No item given to mouseMultiClick", 1);
-
- if (x === undefined)
- x = item.width / 2;
- if (y === undefined)
- y = item.height / 2;
- if (!testEvent.mouseMultiClick(item, x, y, clickCount))
- qtest_fail("window not shown", 2);
- }
-
- function mouseDoubleClick(item, x, y) {
- mouseMultiClick(item, x, y, 2);
- }
-
- function mouseTripleClick(item, x, y) {
- mouseMultiClick(item, x, y, 3);
- }
-
- function mouseQuadraClick(item, x, y) {
- mouseMultiClick(item, x, y, 4);
- }
- }
-
-
- TestCase {
- name: "WebEngineViewMouseClick"
- when: windowShown
-
- function test_singleClick() {
- webEngineView.settings.focusOnNavigationEnabled = false;
- webEngineView.loadHtml("<html><body>" +
- "<form><input id='input' width='150' type='text' value='The Qt Company' /></form>" +
- "</body></html>");
- verify(webEngineView.waitForLoadSucceeded());
- verify(!getActiveElementId());
-
- var center = getElementCenter("input");
- mouseClick(webEngineView, center.x, center.y);
- verifyElementHasFocus("input");
- compare(getTextSelection(), "");
- }
-
- function test_doubleClick() {
- webEngineView.settings.focusOnNavigationEnabled = true;
- webEngineView.loadHtml("<html><body onload='document.getElementById(\"input\").focus()'>" +
- "<form><input id='input' width='150' type='text' value='The Qt Company' /></form>" +
- "</body></html>");
- verify(webEngineView.waitForLoadSucceeded());
-
- var center = getElementCenter("input");
- webEngineView.testSupport.mouseDoubleClick(webEngineView, center.x, center.y);
- verifyElementHasFocus("input");
- tryVerify(function() { return getTextSelection() == "Company" });
-
- mouseClick(webEngineView, center.x, center.y);
- tryVerify(function() { return getTextSelection() == "" });
- }
-
- function test_tripleClick() {
- webEngineView.settings.focusOnNavigationEnabled = true;
- webEngineView.loadHtml("<html><body onload='document.getElementById(\"input\").focus()'>" +
- "<form><input id='input' width='150' type='text' value='The Qt Company' /></form>" +
- "</body></html>");
- verify(webEngineView.waitForLoadSucceeded());
-
- var center = getElementCenter("input");
- webEngineView.testSupport.mouseTripleClick(webEngineView, center.x, center.y);
- verifyElementHasFocus("input");
- tryVerify(function() { return getTextSelection() == "The Qt Company" });
-
- mouseClick(webEngineView, center.x, center.y);
- tryVerify(function() { return getTextSelection() == "" });
- }
-
- function test_quadraClick() {
- webEngineView.settings.focusOnNavigationEnabled = true;
- webEngineView.loadHtml("<html><body onload='document.getElementById(\"input\").focus()'>" +
- "<form><input id='input' width='150' type='text' value='The Qt Company' /></form>" +
- "</body></html>");
- verify(webEngineView.waitForLoadSucceeded());
-
- var center = getElementCenter("input");
- webEngineView.testSupport.mouseQuadraClick(webEngineView, center.x, center.y);
- verifyElementHasFocus("input");
- tryVerify(function() { return getTextSelection() == "" });
- }
- }
-}
diff --git a/tests/auto/quick/qmltests2/mock-delegates/QtWebEngine/Controls1Delegates/AlertDialog.qml b/tests/auto/quick/qmltests2/mock-delegates/QtWebEngine/Controls1Delegates/AlertDialog.qml
deleted file mode 100644
index 4ba3be4b9..000000000
--- a/tests/auto/quick/qmltests2/mock-delegates/QtWebEngine/Controls1Delegates/AlertDialog.qml
+++ /dev/null
@@ -1,32 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-// Both dialogs are basically expected to behave in the same way from an API point of view
-ConfirmDialog
-{
-}
diff --git a/tests/auto/quick/qmltests2/mock-delegates/QtWebEngine/Controls1Delegates/ConfirmDialog.qml b/tests/auto/quick/qmltests2/mock-delegates/QtWebEngine/Controls1Delegates/ConfirmDialog.qml
deleted file mode 100644
index 9933fc2f7..000000000
--- a/tests/auto/quick/qmltests2/mock-delegates/QtWebEngine/Controls1Delegates/ConfirmDialog.qml
+++ /dev/null
@@ -1,49 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQml 2.0
-import QtTest 1.0
-import "../../TestParams" 1.0
-
-QtObject {
- property string text;
- property string title;
- signal accepted();
- signal rejected();
-
- function open() {
- JSDialogParams.dialogTitle = title;
- JSDialogParams.dialogMessage = text;
- JSDialogParams.dialogCount++;
- if (JSDialogParams.shouldAcceptDialog)
- accepted()
- else
- rejected()
- }
-}
-
diff --git a/tests/auto/quick/qmltests2/mock-delegates/QtWebEngine/Controls1Delegates/FilePicker.qml b/tests/auto/quick/qmltests2/mock-delegates/QtWebEngine/Controls1Delegates/FilePicker.qml
deleted file mode 100644
index 745f533f5..000000000
--- a/tests/auto/quick/qmltests2/mock-delegates/QtWebEngine/Controls1Delegates/FilePicker.qml
+++ /dev/null
@@ -1,49 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.2
-import "../../TestParams" 1.0
-
-QtObject {
- property bool selectMultiple: false;
- property bool selectExisting: false;
- property bool selectFolder: false;
- property var nameFilters: [];
-
- signal filesSelected(var fileList);
- signal rejected();
-
- function open() {
- FilePickerParams.filePickerOpened = true;
- FilePickerParams.nameFilters = nameFilters;
- if (FilePickerParams.selectFiles)
- filesSelected(FilePickerParams.selectedFilesUrl)
- else
- rejected()
- }
-}
diff --git a/tests/auto/quick/qmltests2/mock-delegates/QtWebEngine/Controls1Delegates/Menu.qml b/tests/auto/quick/qmltests2/mock-delegates/QtWebEngine/Controls1Delegates/Menu.qml
deleted file mode 100644
index 36efa7680..000000000
--- a/tests/auto/quick/qmltests2/mock-delegates/QtWebEngine/Controls1Delegates/Menu.qml
+++ /dev/null
@@ -1,57 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.5
-import QtQuick.Controls 1.4 as Controls
-
-Controls.Menu {
- id: menu
- signal done()
-
- // Use private API for now
- onAboutToHide: doneTimer.start()
-
- // WORKAROUND On Mac the Menu may be destroyed before the MenuItem
- // is actually triggered (see qtbase commit 08cc9b9991ae9ab51)
- Timer {
- id: doneTimer
- interval: 100
- onTriggered: menu.done()
- }
-}
diff --git a/tests/auto/quick/qmltests2/mock-delegates/QtWebEngine/Controls1Delegates/MenuItem.qml b/tests/auto/quick/qmltests2/mock-delegates/QtWebEngine/Controls1Delegates/MenuItem.qml
deleted file mode 100644
index e61f4c230..000000000
--- a/tests/auto/quick/qmltests2/mock-delegates/QtWebEngine/Controls1Delegates/MenuItem.qml
+++ /dev/null
@@ -1,44 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.5
-import QtQuick.Controls 1.4 as Controls
-
-Controls.MenuItem { }
-
diff --git a/tests/auto/quick/qmltests2/mock-delegates/QtWebEngine/Controls1Delegates/PromptDialog.qml b/tests/auto/quick/qmltests2/mock-delegates/QtWebEngine/Controls1Delegates/PromptDialog.qml
deleted file mode 100644
index 7c5b16eab..000000000
--- a/tests/auto/quick/qmltests2/mock-delegates/QtWebEngine/Controls1Delegates/PromptDialog.qml
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQml 2.0
-import QtTest 1.0
-import "../../TestParams" 1.0
-
-QtObject {
- property string text;
- property string title;
- signal accepted();
- signal rejected();
- signal input(string text);
- signal closing();
-
- function open() {
- JSDialogParams.dialogTitle = title;
- JSDialogParams.dialogMessage = text;
- JSDialogParams.dialogCount++;
- if (JSDialogParams.shouldAcceptDialog) {
- input(JSDialogParams.inputForPrompt)
- accepted()
- } else {
- rejected()
- }
- }
-}
diff --git a/tests/auto/quick/qmltests2/mock-delegates/QtWebEngine/Controls1Delegates/qmldir b/tests/auto/quick/qmltests2/mock-delegates/QtWebEngine/Controls1Delegates/qmldir
deleted file mode 100644
index cf8ac0512..000000000
--- a/tests/auto/quick/qmltests2/mock-delegates/QtWebEngine/Controls1Delegates/qmldir
+++ /dev/null
@@ -1,5 +0,0 @@
-module QtWebEngine.UIDelegates
-AlertDialog 1.0 AlertDialog.qml
-ConfirmDialog 1.0 ConfirmDialog.qml
-FilePicker 1.0 FilePicker.qml
-PromptDialog 1.0 PromptDialog.qml
diff --git a/tests/auto/quick/qmltests2/mock-delegates/TestParams/FilePickerParams.qml b/tests/auto/quick/qmltests2/mock-delegates/TestParams/FilePickerParams.qml
deleted file mode 100644
index 02b0da1d4..000000000
--- a/tests/auto/quick/qmltests2/mock-delegates/TestParams/FilePickerParams.qml
+++ /dev/null
@@ -1,37 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-pragma Singleton
-import QtQuick 2.0
-
-QtObject {
- property var selectedFilesUrl: [];
- property bool selectFiles: false;
- property bool filePickerOpened: false;
- property var nameFilters: [];
-}
diff --git a/tests/auto/quick/qmltests2/mock-delegates/TestParams/JSDialogParams.qml b/tests/auto/quick/qmltests2/mock-delegates/TestParams/JSDialogParams.qml
deleted file mode 100644
index 70696803c..000000000
--- a/tests/auto/quick/qmltests2/mock-delegates/TestParams/JSDialogParams.qml
+++ /dev/null
@@ -1,37 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-pragma Singleton
-import QtQml 2.0
-
-QtObject {
- property string dialogMessage: "";
- property string dialogTitle: "";
- property bool shouldAcceptDialog: true;
- property string inputForPrompt;
- property int dialogCount: 0
-}
diff --git a/tests/auto/quick/qmltests2/mock-delegates/TestParams/qmldir b/tests/auto/quick/qmltests2/mock-delegates/TestParams/qmldir
deleted file mode 100644
index 5807f1e6e..000000000
--- a/tests/auto/quick/qmltests2/mock-delegates/TestParams/qmldir
+++ /dev/null
@@ -1,4 +0,0 @@
-# QML module so that the autotests can set testing parameters
-module TestParams
-singleton FilePickerParams 1.0 FilePickerParams.qml
-singleton JSDialogParams 1.0 JSDialogParams.qml
diff --git a/tests/auto/quick/qmltests2/qmltests2.pro b/tests/auto/quick/qmltests2/qmltests2.pro
deleted file mode 100644
index 4c7a8dc72..000000000
--- a/tests/auto/quick/qmltests2/qmltests2.pro
+++ /dev/null
@@ -1,78 +0,0 @@
-include(../tests.pri)
-
-QT += qmltest
-
-IMPORTPATH += $$PWD/data
-
-OTHER_FILES += \
- $$PWD/data/accepttypes.html \
- $$PWD/data/alert.html \
- $$PWD/data/confirm.html \
- $$PWD/data/confirmclose.html \
- $$PWD/data/directoryupload.html \
- $$PWD/data/favicon.html \
- $$PWD/data/favicon2.html \
- $$PWD/data/favicon-candidates-gray.html \
- $$PWD/data/favicon-misc.html \
- $$PWD/data/favicon-multi.html \
- $$PWD/data/favicon-multi-gray.html \
- $$PWD/data/favicon-single.html \
- $$PWD/data/favicon-shortcut.html \
- $$PWD/data/favicon-touch.html \
- $$PWD/data/favicon-unavailable.html \
- $$PWD/data/multifileupload.html \
- $$PWD/data/prompt.html \
- $$PWD/data/singlefileupload.html \
- $$PWD/data/test1.html \
- $$PWD/data/test2.html \
- $$PWD/data/titleupdate.js \
- $$PWD/data/tst_favicon.qml \
- $$PWD/data/tst_faviconDownload.qml \
- $$PWD/data/tst_inputMethod.qml \
- $$PWD/data/tst_javaScriptDialogs.qml \
- $$PWD/data/tst_linkHovered.qml \
- $$PWD/data/tst_loadFail.qml \
- $$PWD/data/tst_mouseClick.qml \
- $$PWD/data/icons/favicon.png \
- $$PWD/data/icons/gray128.png \
- $$PWD/data/icons/gray16.png \
- $$PWD/data/icons/gray255.png \
- $$PWD/data/icons/gray32.png \
- $$PWD/data/icons/gray64.png \
- $$PWD/data/icons/grayicons.ico \
- $$PWD/data/icons/qt144.png \
- $$PWD/data/icons/qt32.ico \
- $$PWD/data/icons/qtmulti.ico \
- $$PWD/data/icons/small-favicon.png \
- $$PWD/mock-delegates/QtWebEngine/Controls1Delegates/AlertDialog.qml \
- $$PWD/mock-delegates/QtWebEngine/Controls1Delegates/ConfirmDialog.qml \
- $$PWD/mock-delegates/QtWebEngine/Controls1Delegates/FilePicker.qml \
- $$PWD/mock-delegates/QtWebEngine/Controls1Delegates/Menu.qml \
- $$PWD/mock-delegates/QtWebEngine/Controls1Delegates/MenuItem.qml \
- $$PWD/mock-delegates/QtWebEngine/Controls1Delegates/PromptDialog.qml \
- $$PWD/mock-delegates/QtWebEngine/Controls1Delegates/qmldir \
- $$PWD/mock-delegates/TestParams/FilePickerParams.qml \
- $$PWD/mock-delegates/TestParams/JSDialogParams.qml \
- $$PWD/mock-delegates/TestParams/qmldir \
-
-load(qt_build_paths)
-DEFINES += QUICK_TEST_SOURCE_DIR=\\\"$$re_escape($$PWD$${QMAKE_DIR_SEP}data)\\\"
-
-!qtConfig(webengine-testsupport) {
- PLUGIN_EXTENSION = .so
- PLUGIN_PREFIX = lib
- osx: PLUGIN_PREFIX = .dylib
- win32 {
- PLUGIN_EXTENSION = .dll
- PLUGIN_PREFIX =
- }
-
- TESTSUPPORT_MODULE = $$shell_path($$[QT_INSTALL_QML]/QtWebEngine/testsupport/$${PLUGIN_PREFIX}qtwebenginetestsupportplugin$${PLUGIN_EXTENSION})
- BUILD_DIR = $$shell_path($$clean_path($$OUT_PWD/../../../..))
- SRC_DIR = $$shell_path($$clean_path($$PWD/../../../..))
-
- warning("QML Test Support API is disabled. This means some QML tests that use Test Support API will fail.")
- warning("Use the following command to build Test Support module and rebuild WebEngineView API:")
- warning("cd $$BUILD_DIR && qmake -r $$shell_path($$SRC_DIR/qtwebengine.pro -- --feature-testsupport=yes) && make -C $$shell_path($$BUILD_DIR/src/webengine) clean && make")
- warning("After performing the command above make sure QML module \"QtWebEngine.testsupport\" is deployed at $$TESTSUPPORT_MODULE")
-}
diff --git a/tests/auto/quick/qmltests2/tst_qmltests2.cpp b/tests/auto/quick/qmltests2/tst_qmltests2.cpp
deleted file mode 100644
index 8c81ed7f5..000000000
--- a/tests/auto/quick/qmltests2/tst_qmltests2.cpp
+++ /dev/null
@@ -1,127 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtCore/QScopedPointer>
-#include <QtQuickTest/quicktest.h>
-#include <QtWebEngine/QQuickWebEngineProfile>
-#include "qt_webengine_quicktest.h"
-
-#if defined(Q_OS_LINUX) && defined(QT_DEBUG)
-#include <fcntl.h>
-#include <signal.h>
-#include <unistd.h>
-#endif
-
-#if defined(Q_OS_LINUX) && defined(QT_DEBUG)
-static bool debuggerPresent()
-{
- int fd = open("/proc/self/status", O_RDONLY);
- if (fd == -1)
- return false;
- char buffer[2048];
- ssize_t size = read(fd, buffer, sizeof(buffer) - 1);
- if (size == -1) {
- close(fd);
- return false;
- }
- buffer[size] = 0;
- const char tracerPidToken[] = "\nTracerPid:";
- char *tracerPid = strstr(buffer, tracerPidToken);
- if (!tracerPid) {
- close(fd);
- return false;
- }
- tracerPid += sizeof(tracerPidToken);
- long int pid = strtol(tracerPid, &tracerPid, 10);
- close(fd);
- return pid != 0;
-}
-
-static void stackTrace()
-{
- bool ok = false;
- const int disableStackDump = qEnvironmentVariableIntValue("QTEST_DISABLE_STACK_DUMP", &ok);
- if (ok && disableStackDump == 1)
- return;
-
- if (debuggerPresent())
- return;
-
- fprintf(stderr, "\n========= Received signal, dumping stack ==============\n");
- char cmd[512];
- qsnprintf(cmd, 512, "gdb --pid %d 2>/dev/null <<EOF\n"
- "set prompt\n"
- "set height 0\n"
- "thread apply all where full\n"
- "detach\n"
- "quit\n"
- "EOF\n",
- (int)getpid());
-
- if (system(cmd) == -1)
- fprintf(stderr, "calling gdb failed\n");
- fprintf(stderr, "========= End of stack trace ==============\n");
-}
-
-static void sigSegvHandler(int signum)
-{
- stackTrace();
- qFatal("Received signal %d", signum);
-}
-#endif
-
-int main(int argc, char **argv)
-{
-#if defined(Q_OS_LINUX) && defined(QT_DEBUG)
- struct sigaction sigAction;
-
- sigemptyset(&sigAction.sa_mask);
- sigAction.sa_handler = &sigSegvHandler;
- sigAction.sa_flags = 0;
-
- sigaction(SIGSEGV, &sigAction, 0);
-#endif
-
- // Inject the mock ui delegates module
- qputenv("QML2_IMPORT_PATH", QByteArray(TESTS_SOURCE_DIR "qmltests2/mock-delegates"));
- QScopedPointer<Application> app;
-
- // Force to use English language for testing due to error message checks
- QLocale::setDefault(QLocale("en"));
-
- if (!QCoreApplication::instance()) {
- app.reset(new Application(argc, argv));
- }
- QtWebEngine::initialize();
- QQuickWebEngineProfile::defaultProfile()->setOffTheRecord(true);
-
- QTEST_SET_MAIN_SOURCE_PATH
-
- int i = quick_test_main(argc, argv, "qmltests2", QUICK_TEST_SOURCE_DIR);
- return i;
-}
diff --git a/tests/auto/quick/qquickwebenginedefaultsurfaceformat/CMakeLists.txt b/tests/auto/quick/qquickwebenginedefaultsurfaceformat/CMakeLists.txt
new file mode 100644
index 000000000..9856ed513
--- /dev/null
+++ b/tests/auto/quick/qquickwebenginedefaultsurfaceformat/CMakeLists.txt
@@ -0,0 +1,13 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+include(../../util/util.cmake)
+
+qt_internal_add_test(tst_qquickwebenginedefaultsurfaceformat
+ SOURCES
+ tst_qquickwebenginedefaultsurfaceformat.cpp
+ LIBRARIES
+ Qt::CorePrivate
+ Qt::WebEngineQuickPrivate
+ Test::Util
+)
diff --git a/tests/auto/quick/qquickwebenginedefaultsurfaceformat/html/basic_page.html b/tests/auto/quick/qquickwebenginedefaultsurfaceformat/html/basic_page.html
new file mode 100644
index 000000000..53726e4a6
--- /dev/null
+++ b/tests/auto/quick/qquickwebenginedefaultsurfaceformat/html/basic_page.html
@@ -0,0 +1,6 @@
+<html>
+<head>
+<title> Basic Page </title>
+</head>
+<h1>Basic page</h1>
+</html>
diff --git a/tests/auto/quick/qquickwebenginedefaultsurfaceformat/qquickwebenginedefaultsurfaceformat.pro b/tests/auto/quick/qquickwebenginedefaultsurfaceformat/qquickwebenginedefaultsurfaceformat.pro
deleted file mode 100644
index 699186741..000000000
--- a/tests/auto/quick/qquickwebenginedefaultsurfaceformat/qquickwebenginedefaultsurfaceformat.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-include(../tests.pri)
-
-exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc
-QT_PRIVATE += core-private webengine-private webenginecore-private
-
-HEADERS += ../shared/util.h
diff --git a/tests/auto/quick/qquickwebenginedefaultsurfaceformat/tst_qquickwebenginedefaultsurfaceformat.cpp b/tests/auto/quick/qquickwebenginedefaultsurfaceformat/tst_qquickwebenginedefaultsurfaceformat.cpp
index 734c4ff7a..b4c95d671 100644
--- a/tests/auto/quick/qquickwebenginedefaultsurfaceformat/tst_qquickwebenginedefaultsurfaceformat.cpp
+++ b/tests/auto/quick/qquickwebenginedefaultsurfaceformat/tst_qquickwebenginedefaultsurfaceformat.cpp
@@ -1,33 +1,8 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "testwindow.h"
-#include "util.h"
+#include "quickutil.h"
#include <QGuiApplication>
#include <QtQml/QQmlEngine>
@@ -63,8 +38,8 @@ void tst_QQuickWebEngineDefaultSurfaceFormat::initEngineAndViewComponent() {
m_engine = new QQmlEngine(this);
QQuickWebEngineProfile::defaultProfile()->setOffTheRecord(true);
m_component.reset(new QQmlComponent(m_engine, this));
- m_component->setData(QByteArrayLiteral("import QtQuick 2.0\n"
- "import QtWebEngine 1.2\n"
+ m_component->setData(QByteArrayLiteral("import QtQuick\n"
+ "import QtWebEngine\n"
"WebEngineView {}")
, QUrl());
}
@@ -93,7 +68,7 @@ inline QQuickWebEngineView *tst_QQuickWebEngineDefaultSurfaceFormat::webEngineVi
QUrl tst_QQuickWebEngineDefaultSurfaceFormat::urlFromTestPath(const char *localFilePath)
{
- QString testSourceDirPath = QString::fromLocal8Bit(TESTS_SOURCE_DIR);
+ QString testSourceDirPath = QDir(QT_TESTCASE_SOURCEDIR).canonicalPath();
if (!testSourceDirPath.endsWith(QLatin1Char('/')))
testSourceDirPath.append(QLatin1Char('/'));
@@ -116,7 +91,7 @@ void tst_QQuickWebEngineDefaultSurfaceFormat::customDefaultSurfaceFormat()
QSurfaceFormat::setDefaultFormat( format );
QGuiApplication app(argc, argv);
- QtWebEngine::initialize();
+ QtWebEngineQuick::initialize();
initEngineAndViewComponent();
initWindow();
@@ -126,10 +101,10 @@ void tst_QQuickWebEngineDefaultSurfaceFormat::customDefaultSurfaceFormat()
QObject::connect(
view,
- &QQuickWebEngineView::loadingChanged, [](QQuickWebEngineLoadRequest* request)
+ &QQuickWebEngineView::loadingChanged, [](const QWebEngineLoadingInfo &info)
{
- if (request->status() == QQuickWebEngineView::LoadSucceededStatus
- || request->status() == QQuickWebEngineView::LoadFailedStatus)
+ if (info.status() == QWebEngineLoadingInfo::LoadSucceededStatus
+ || info.status() == QWebEngineLoadingInfo::LoadFailedStatus)
QTimer::singleShot(100, qApp, &QCoreApplication::quit);
}
);
diff --git a/tests/auto/quick/qquickwebengineprofile/qquickwebengineprofile.pro b/tests/auto/quick/qquickwebengineprofile/qquickwebengineprofile.pro
deleted file mode 100644
index e99c7f493..000000000
--- a/tests/auto/quick/qquickwebengineprofile/qquickwebengineprofile.pro
+++ /dev/null
@@ -1 +0,0 @@
-include(../tests.pri)
diff --git a/tests/auto/quick/qquickwebengineprofile/tst_qquickwebengineprofile.cpp b/tests/auto/quick/qquickwebengineprofile/tst_qquickwebengineprofile.cpp
deleted file mode 100644
index db7c2ad6e..000000000
--- a/tests/auto/quick/qquickwebengineprofile/tst_qquickwebengineprofile.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtQml/QQmlEngine>
-#include <QtTest/QtTest>
-#include <QtWebEngine/QQuickWebEngineProfile>
-
-class tst_QQuickWebEngineProfile : public QObject {
- Q_OBJECT
-public:
- tst_QQuickWebEngineProfile();
-
- // TODO: Many tests missings
- void usedForGlobalCertificateVerification();
-
-private Q_SLOTS:
- void init();
- void cleanup();
-};
-
-tst_QQuickWebEngineProfile::tst_QQuickWebEngineProfile()
-{
- QtWebEngine::initialize();
- QQuickWebEngineProfile::defaultProfile()->setOffTheRecord(true);
-}
-
-
-void tst_QQuickWebEngineProfile::init()
-{
-}
-
-void tst_QQuickWebEngineProfile::cleanup()
-{
-}
-
-void tst_QQuickWebEngineProfile::usedForGlobalCertificateVerification()
-{
- QQuickWebEngineProfile *profile1 = new QQuickWebEngineProfile();
- QQuickWebEngineProfile *profile2 = new QQuickWebEngineProfile();
- QVERIFY(!profile1->isUsedForGlobalVerification());
- QVERIFY(!profile2->isUsedForGlobalVerification());
-
-
-}
-
-
-QTEST_MAIN(tst_QQuickWebEngineProfile)
-#include "tst_qquickwebengineprofile.moc"
diff --git a/tests/auto/quick/qquickwebengineview/BLACKLIST b/tests/auto/quick/qquickwebengineview/BLACKLIST
new file mode 100644
index 000000000..d4a35a76a
--- /dev/null
+++ b/tests/auto/quick/qquickwebengineview/BLACKLIST
@@ -0,0 +1,2 @@
+[javascriptClipboard]
+ubuntu-20.04
diff --git a/tests/auto/quick/qquickwebengineview/CMakeLists.txt b/tests/auto/quick/qquickwebengineview/CMakeLists.txt
new file mode 100644
index 000000000..307ea36c9
--- /dev/null
+++ b/tests/auto/quick/qquickwebengineview/CMakeLists.txt
@@ -0,0 +1,16 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+include(../../util/util.cmake)
+
+qt_internal_add_test(tst_qquickwebengineview
+ SOURCES
+ tst_qquickwebengineview.cpp
+ LIBRARIES
+ Qt::WebEngineCorePrivate
+ Qt::WebEngineQuick
+ Qt::GuiPrivate
+ Qt::WebEngineQuickPrivate
+ Qt::TestPrivate
+ Test::Util
+)
diff --git a/tests/auto/quick/qquickwebengineview/html/basic_page.html b/tests/auto/quick/qquickwebengineview/html/basic_page.html
new file mode 100644
index 000000000..53726e4a6
--- /dev/null
+++ b/tests/auto/quick/qquickwebengineview/html/basic_page.html
@@ -0,0 +1,6 @@
+<html>
+<head>
+<title> Basic Page </title>
+</head>
+<h1>Basic page</h1>
+</html>
diff --git a/tests/auto/quick/html/basic_page2.html b/tests/auto/quick/qquickwebengineview/html/basic_page2.html
index f8cff2969..f8cff2969 100644
--- a/tests/auto/quick/html/basic_page2.html
+++ b/tests/auto/quick/qquickwebengineview/html/basic_page2.html
diff --git a/tests/auto/quick/html/direct-image-compositing.html b/tests/auto/quick/qquickwebengineview/html/direct-image-compositing.html
index 53a4ca137..53a4ca137 100644
--- a/tests/auto/quick/html/direct-image-compositing.html
+++ b/tests/auto/quick/qquickwebengineview/html/direct-image-compositing.html
diff --git a/tests/auto/quick/html/inputmethod.html b/tests/auto/quick/qquickwebengineview/html/inputmethod.html
index dc9140f9d..dc9140f9d 100644
--- a/tests/auto/quick/html/inputmethod.html
+++ b/tests/auto/quick/qquickwebengineview/html/inputmethod.html
diff --git a/tests/auto/quick/html/resources/simple_image.png b/tests/auto/quick/qquickwebengineview/html/resources/simple_image.png
index 4685399ca..4685399ca 100644
--- a/tests/auto/quick/html/resources/simple_image.png
+++ b/tests/auto/quick/qquickwebengineview/html/resources/simple_image.png
Binary files differ
diff --git a/tests/auto/quick/html/scroll.html b/tests/auto/quick/qquickwebengineview/html/scroll.html
index ce2193b6c..ce2193b6c 100644
--- a/tests/auto/quick/html/scroll.html
+++ b/tests/auto/quick/qquickwebengineview/html/scroll.html
diff --git a/tests/auto/quick/qquickwebengineview/qquickwebengineview.pro b/tests/auto/quick/qquickwebengineview/qquickwebengineview.pro
deleted file mode 100644
index 38c130aa3..000000000
--- a/tests/auto/quick/qquickwebengineview/qquickwebengineview.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-include(../tests.pri)
-
-exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc
-QT_PRIVATE += core_private gui-private webengine-private webenginecore-private
-
-HEADERS += ../shared/util.h
diff --git a/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp b/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp
index 5ee30f165..dbfa1cb33 100644
--- a/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp
+++ b/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp
@@ -1,32 +1,10 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses
#include "testwindow.h"
+#include "quickutil.h"
#include "util.h"
#include <QScopedPointer>
@@ -37,12 +15,15 @@
#include <QtGui/qpa/qwindowsysteminterface.h>
#include <QtQml/QQmlEngine>
#include <QtTest/QtTest>
-#include <QtWebEngine/QQuickWebEngineProfile>
+#include <QtWebEngineQuick/QQuickWebEngineProfile>
#include <QtGui/private/qinputmethod_p.h>
-#include <QtWebEngine/private/qquickwebengineview_p.h>
-#include <QtWebEngine/private/qquickwebenginesettings_p.h>
+#include <QtWebEngineQuick/private/qquickwebenginescriptcollection_p.h>
+#include <QtWebEngineQuick/private/qquickwebenginesettings_p.h>
+#include <QtWebEngineQuick/private/qquickwebenginedownloadrequest_p.h>
+#include <QtWebEngineQuick/private/qquickwebengineview_p.h>
#include <QtWebEngineCore/private/qtwebenginecore-config_p.h>
#include <qpa/qplatforminputcontext.h>
+#include <QtTest/private/qemulationdetector_p.h>
#include <functional>
@@ -92,8 +73,13 @@ private Q_SLOTS:
void javascriptClipboard_data();
void javascriptClipboard();
void setProfile();
- void focusChild();
+#if QT_CONFIG(accessibility)
void focusChild_data();
+ void focusChild();
+#endif
+ void htmlSelectPopup();
+ void savePage_data();
+ void savePage();
private:
inline QQuickWebEngineView *newWebEngineView();
@@ -103,21 +89,26 @@ private:
QString m_testSourceDirPath;
QScopedPointer<TestWindow> m_window;
QScopedPointer<QQmlComponent> m_component;
+
+ QPointingDevice *touchDevice() {
+ static auto d = QScopedPointer<QPointingDevice>(QTest::createTouchDevice());
+ return d.get();
+ }
};
tst_QQuickWebEngineView::tst_QQuickWebEngineView()
{
- QtWebEngine::initialize();
+ QtWebEngineQuick::initialize();
QQuickWebEngineProfile::defaultProfile()->setOffTheRecord(true);
- m_testSourceDirPath = QString::fromLocal8Bit(TESTS_SOURCE_DIR);
+ m_testSourceDirPath = QDir(QT_TESTCASE_SOURCEDIR).canonicalPath();
if (!m_testSourceDirPath.endsWith(QLatin1Char('/')))
m_testSourceDirPath.append(QLatin1Char('/'));
static QQmlEngine *engine = new QQmlEngine(this);
m_component.reset(new QQmlComponent(engine, this));
- m_component->setData(QByteArrayLiteral("import QtQuick 2.0\n"
- "import QtWebEngine 1.2\n"
+ m_component->setData(QByteArrayLiteral("import QtQuick\n"
+ "import QtWebEngine\n"
"WebEngineView {}")
, QUrl());
}
@@ -197,7 +188,7 @@ void tst_QQuickWebEngineView::loadEmptyPageViewVisible()
void tst_QQuickWebEngineView::loadEmptyPageViewHidden()
{
- QSignalSpy loadSpy(webEngineView(), SIGNAL(loadingChanged(QQuickWebEngineLoadRequest*)));
+ QSignalSpy loadSpy(webEngineView(), SIGNAL(loadingChanged(QWebEngineLoadingInfo)));
webEngineView()->setUrl(urlFromTestPath("html/basic_page.html"));
QVERIFY(waitForLoadSucceeded(webEngineView()));
@@ -207,7 +198,7 @@ void tst_QQuickWebEngineView::loadEmptyPageViewHidden()
void tst_QQuickWebEngineView::loadNonexistentFileUrl()
{
- QSignalSpy loadSpy(webEngineView(), SIGNAL(loadingChanged(QQuickWebEngineLoadRequest*)));
+ QSignalSpy loadSpy(webEngineView(), SIGNAL(loadingChanged(QWebEngineLoadingInfo)));
webEngineView()->setUrl(urlFromTestPath("html/file_that_does_not_exist.html"));
QVERIFY(waitForLoadFailed(webEngineView()));
@@ -368,6 +359,9 @@ QImage tryToGrabWindowUntil(QQuickWindow *window, std::function<bool(const QImag
void tst_QQuickWebEngineView::basicRenderingSanity()
{
+ if (QTestPrivate::isRunningArmOnX86())
+ QSKIP("Grab does not work with QEMU.");
+
showWebEngineView();
webEngineView()->setUrl(QUrl(QString::fromUtf8("data:text/html,<html><body bgcolor=\"%2300ff00\"></body></html>")));
@@ -407,6 +401,9 @@ void tst_QQuickWebEngineView::titleUpdate()
void tst_QQuickWebEngineView::transparentWebEngineViews()
{
+ if (QTestPrivate::isRunningArmOnX86())
+ QSKIP("Grab does not work with QEMU.");
+
showWebEngineView();
// This should not crash.
@@ -434,10 +431,10 @@ void tst_QQuickWebEngineView::transparentWebEngineViews()
for (int i = 0; i < image.width(); i++)
for (int j = 0; j < image.height(); j++)
colors.insert(image.pixel(i, j));
- return colors.count() > 1;
+ return colors.size() > 1;
});
- QVERIFY(colors.count() > 1);
+ QVERIFY(colors.size() > 1);
QVERIFY(colors.contains(qRgb(0, 0, 0))); // black
QVERIFY(colors.contains(qRgb(255, 0, 0))); // red
for (auto color : colors) {
@@ -449,7 +446,6 @@ void tst_QQuickWebEngineView::transparentWebEngineViews()
void tst_QQuickWebEngineView::inputMethod()
{
m_window->show();
- QTRY_VERIFY(qApp->focusObject());
QQuickItem *input;
QQuickWebEngineView *view = webEngineView();
@@ -457,18 +453,21 @@ void tst_QQuickWebEngineView::inputMethod()
view->setUrl(urlFromTestPath("html/inputmethod.html"));
QVERIFY(waitForLoadSucceeded(view));
+ QTRY_VERIFY(qobject_cast<QQuickItem *>(qApp->focusObject()));
input = qobject_cast<QQuickItem *>(qApp->focusObject());
QVERIFY(!input->flags().testFlag(QQuickItem::ItemAcceptsInputMethod));
QVERIFY(!view->flags().testFlag(QQuickItem::ItemAcceptsInputMethod));
runJavaScript("document.getElementById('inputField').focus();");
QTRY_COMPARE(activeElementId(view), QStringLiteral("inputField"));
+ QTRY_VERIFY(qobject_cast<QQuickItem *>(qApp->focusObject()));
input = qobject_cast<QQuickItem *>(qApp->focusObject());
QTRY_VERIFY(input->flags().testFlag(QQuickItem::ItemAcceptsInputMethod));
QVERIFY(view->flags().testFlag(QQuickItem::ItemAcceptsInputMethod));
runJavaScript("document.getElementById('inputField').blur();");
QTRY_VERIFY(activeElementId(view).isEmpty());
+ QTRY_VERIFY(qobject_cast<QQuickItem *>(qApp->focusObject()));
input = qobject_cast<QQuickItem *>(qApp->focusObject());
QTRY_VERIFY(!input->flags().testFlag(QQuickItem::ItemAcceptsInputMethod));
QVERIFY(!view->flags().testFlag(QQuickItem::ItemAcceptsInputMethod));
@@ -509,15 +508,10 @@ public:
inputMethodPrivate->testContext = 0;
}
- virtual void commit() {
- commitCallCount++;
- }
-
- virtual void reset() {
- resetCallCount++;
- }
+ void commit() override { commitCallCount++; }
+ void reset() override { resetCallCount++; }
- virtual void update(Qt::InputMethodQueries queries)
+ void update(Qt::InputMethodQueries queries) override
{
if (!qApp->focusObject())
return;
@@ -584,9 +578,8 @@ void tst_QQuickWebEngineView::interruptImeTextComposition()
QTest::mouseClick(view->window(), Qt::LeftButton, {}, textInputCenter);
} else if (eventType == "Touch") {
QPoint textInputCenter = elementCenter(view, QStringLiteral("input2"));
- QTouchDevice *touchDevice = QTest::createTouchDevice();
- QTest::touchEvent(view->window(), touchDevice).press(0, textInputCenter, view->window());
- QTest::touchEvent(view->window(), touchDevice).release(0, textInputCenter, view->window());
+ QTest::touchEvent(view->window(), touchDevice()).press(0, textInputCenter, view->window());
+ QTest::touchEvent(view->window(), touchDevice()).release(0, textInputCenter, view->window());
}
QTRY_COMPARE(evaluateJavaScriptSync(view, "document.activeElement.id").toString(), QStringLiteral("input2"));
#ifndef Q_OS_WIN
@@ -614,12 +607,12 @@ void tst_QQuickWebEngineView::inputContextQueryInput()
" <input type='text' id='input1' />"
"</body></html>");
QVERIFY(waitForLoadSucceeded(view));
- QCOMPARE(testContext.infos.count(), 0);
+ QCOMPARE(testContext.infos.size(), 0);
// Set focus on an input field.
QPoint textInputCenter = elementCenter(view, "input1");
QTest::mouseClick(view->window(), Qt::LeftButton, {}, textInputCenter);
- QTRY_COMPARE(testContext.infos.count(), 2);
+ QTRY_COMPARE(testContext.infos.size(), 2);
QCOMPARE(evaluateJavaScriptSync(view, "document.activeElement.id").toString(), QStringLiteral("input1"));
foreach (const InputMethodInfo &info, testContext.infos) {
QCOMPARE(info.cursorPosition, 0);
@@ -631,7 +624,7 @@ void tst_QQuickWebEngineView::inputContextQueryInput()
// Change content of an input field from JavaScript.
evaluateJavaScriptSync(view, "document.getElementById('input1').value='QtWebEngine';");
- QTRY_COMPARE(testContext.infos.count(), 1);
+ QTRY_COMPARE(testContext.infos.size(), 1);
QCOMPARE(testContext.infos[0].cursorPosition, 11);
QCOMPARE(testContext.infos[0].anchorPosition, 11);
QCOMPARE(testContext.infos[0].surroundingText, QStringLiteral("QtWebEngine"));
@@ -640,7 +633,7 @@ void tst_QQuickWebEngineView::inputContextQueryInput()
// Change content of an input field by key press.
QTest::keyClick(view->window(), Qt::Key_Exclam);
- QTRY_COMPARE(testContext.infos.count(), 1);
+ QTRY_COMPARE(testContext.infos.size(), 1);
QCOMPARE(testContext.infos[0].cursorPosition, 12);
QCOMPARE(testContext.infos[0].anchorPosition, 12);
QCOMPARE(testContext.infos[0].surroundingText, QStringLiteral("QtWebEngine!"));
@@ -649,7 +642,7 @@ void tst_QQuickWebEngineView::inputContextQueryInput()
// Change cursor position.
QTest::keyClick(view->window(), Qt::Key_Left);
- QTRY_COMPARE(testContext.infos.count(), 1);
+ QTRY_COMPARE(testContext.infos.size(), 1);
QCOMPARE(testContext.infos[0].cursorPosition, 11);
QCOMPARE(testContext.infos[0].anchorPosition, 11);
QCOMPARE(testContext.infos[0].surroundingText, QStringLiteral("QtWebEngine!"));
@@ -664,7 +657,7 @@ void tst_QQuickWebEngineView::inputContextQueryInput()
QInputMethodEvent event("", attributes);
QGuiApplication::sendEvent(qApp->focusObject(), &event);
}
- QTRY_COMPARE(testContext.infos.count(), 2);
+ QTRY_COMPARE(testContext.infos.size(), 2);
// As a first step, Chromium moves the cursor to the start of the selection.
// We don't filter this in QtWebEngine because we don't know yet if this is part of a selection.
@@ -688,7 +681,7 @@ void tst_QQuickWebEngineView::inputContextQueryInput()
QInputMethodEvent event("", attributes);
QGuiApplication::sendEvent(qApp->focusObject(), &event);
}
- QTRY_COMPARE(testContext.infos.count(), 1);
+ QTRY_COMPARE(testContext.infos.size(), 1);
QCOMPARE(testContext.infos[0].cursorPosition, 0);
QCOMPARE(testContext.infos[0].anchorPosition, 0);
QCOMPARE(testContext.infos[0].surroundingText, QStringLiteral("QtWebEngine!"));
@@ -701,9 +694,9 @@ void tst_QQuickWebEngineView::inputContextQueryInput()
QInputMethodEvent event("123", attributes);
QGuiApplication::sendEvent(qApp->focusObject(), &event);
}
- QTRY_COMPARE(testContext.infos.count(), 1);
- QCOMPARE(testContext.infos[0].cursorPosition, 3);
- QCOMPARE(testContext.infos[0].anchorPosition, 3);
+ QTRY_COMPARE(testContext.infos.size(), 1);
+ QCOMPARE(testContext.infos[0].cursorPosition, 0);
+ QCOMPARE(testContext.infos[0].anchorPosition, 0);
QCOMPARE(testContext.infos[0].surroundingText, QStringLiteral("QtWebEngine!"));
QCOMPARE(testContext.infos[0].selectedText, QStringLiteral(""));
QCOMPARE(evaluateJavaScriptSync(view, "document.getElementById('input1').value").toString(), QStringLiteral("123QtWebEngine!"));
@@ -715,7 +708,7 @@ void tst_QQuickWebEngineView::inputContextQueryInput()
QInputMethodEvent event("", attributes);
QGuiApplication::sendEvent(qApp->focusObject(), &event);
}
- QTRY_COMPARE(testContext.infos.count(), 2);
+ QTRY_COMPARE(testContext.infos.size(), 2);
foreach (const InputMethodInfo &info, testContext.infos) {
QCOMPARE(info.cursorPosition, 0);
QCOMPARE(info.anchorPosition, 0);
@@ -732,7 +725,7 @@ void tst_QQuickWebEngineView::inputContextQueryInput()
event.setCommitString(QStringLiteral("123"), 0, 0);
QGuiApplication::sendEvent(qApp->focusObject(), &event);
}
- QTRY_COMPARE(testContext.infos.count(), 1);
+ QTRY_COMPARE(testContext.infos.size(), 1);
QCOMPARE(testContext.infos[0].cursorPosition, 3);
QCOMPARE(testContext.infos[0].anchorPosition, 3);
QCOMPARE(testContext.infos[0].surroundingText, QStringLiteral("123QtWebEngine!"));
@@ -742,7 +735,7 @@ void tst_QQuickWebEngineView::inputContextQueryInput()
// Focus out.
QTest::keyPress(view->window(), Qt::Key_Tab);
- QTRY_COMPARE(testContext.infos.count(), 1);
+ QTRY_COMPARE(testContext.infos.size(), 1);
QTRY_COMPARE(evaluateJavaScriptSync(view, "document.activeElement.id").toString(), QStringLiteral(""));
testContext.infos.clear();
}
@@ -770,9 +763,13 @@ void tst_QQuickWebEngineView::inputMethodHints()
QTRY_COMPARE(input->inputMethodQuery(Qt::ImSurroundingText).toString(), QString("a@b.com"));
QVERIFY(input->flags().testFlag(QQuickItem::ItemAcceptsInputMethod));
QVERIFY(view->flags().testFlag(QQuickItem::ItemAcceptsInputMethod));
- QInputMethodQueryEvent query(Qt::ImHints);
- QGuiApplication::sendEvent(input, &query);
- QTRY_COMPARE(Qt::InputMethodHints(query.value(Qt::ImHints).toUInt() & Qt::ImhExclusiveInputMask), Qt::ImhEmailCharactersOnly);
+ {
+ QInputMethodQueryEvent query(Qt::ImHints);
+ QGuiApplication::sendEvent(input, &query);
+ QTRY_COMPARE(
+ Qt::InputMethodHints(query.value(Qt::ImHints).toUInt() & Qt::ImhExclusiveInputMask),
+ Qt::ImhEmailCharactersOnly);
+ }
// The focus of an editable DIV is given directly to it, so no shadow root element
// is necessary. This tests the WebPage::editorState() method ability to get the
@@ -783,28 +780,56 @@ void tst_QQuickWebEngineView::inputMethodHints()
QTRY_COMPARE(input->inputMethodQuery(Qt::ImSurroundingText).toString(), QString("bla"));
QVERIFY(input->flags().testFlag(QQuickItem::ItemAcceptsInputMethod));
QVERIFY(view->flags().testFlag(QQuickItem::ItemAcceptsInputMethod));
- query = QInputMethodQueryEvent(Qt::ImHints);
- QGuiApplication::sendEvent(input, &query);
- QTRY_COMPARE(Qt::InputMethodHints(query.value(Qt::ImHints).toUInt()), Qt::ImhPreferLowercase | Qt::ImhNoPredictiveText | Qt::ImhMultiLine | Qt::ImhNoEditMenu | Qt::ImhNoTextHandles);
+ {
+ QInputMethodQueryEvent query(Qt::ImHints);
+ QGuiApplication::sendEvent(input, &query);
+ QTRY_COMPARE(Qt::InputMethodHints(query.value(Qt::ImHints).toUInt()),
+ Qt::ImhPreferLowercase | Qt::ImhNoPredictiveText | Qt::ImhMultiLine
+ | Qt::ImhNoEditMenu | Qt::ImhNoTextHandles);
+ }
}
void tst_QQuickWebEngineView::setZoomFactor()
{
QQuickWebEngineView *view = webEngineView();
+ m_window->show();
+ view->setSize(QSizeF(320, 240));
- QVERIFY(qFuzzyCompare(view->zoomFactor(), 1.0));
+ QCOMPARE(view->zoomFactor(), 1.0);
view->setZoomFactor(2.5);
- QVERIFY(qFuzzyCompare(view->zoomFactor(), 2.5));
+ QCOMPARE(view->zoomFactor(), 2.5);
- view->setUrl(urlFromTestPath("html/basic_page.html"));
+ const QUrl url1 = urlFromTestPath("html/basic_page.html"), url2 = urlFromTestPath("html/basic_page2.html");
+
+ view->setUrl(url1);
QVERIFY(waitForLoadSucceeded(view));
- QVERIFY(qFuzzyCompare(view->zoomFactor(), 2.5));
+ QCOMPARE(view->zoomFactor(), 2.5);
view->setZoomFactor(0.1);
- QVERIFY(qFuzzyCompare(view->zoomFactor(), 2.5));
+ QCOMPARE(view->zoomFactor(), 2.5);
view->setZoomFactor(5.5);
- QVERIFY(qFuzzyCompare(view->zoomFactor(), 2.5));
+ QCOMPARE(view->zoomFactor(), 2.5);
+
+ QScopedPointer<QQuickWebEngineView> view2(newWebEngineView());
+ view2->setSize(QSizeF(320, 240));
+ view2->setParentItem(m_window->contentItem());
+
+ // try loading different url and check new values after load
+ for (auto &&p : {
+ qMakePair(view, 2.5), // navigating away to different url should keep zoom
+ qMakePair(view2.get(), 1.0), // same url navigation in diffent page shouldn't be affected
+ }) {
+ auto &&view = p.first; auto zoomFactor = p.second;
+ view->setUrl(url2);
+ QVERIFY(waitForLoadSucceeded(view));
+ QCOMPARE(view->zoomFactor(), zoomFactor);
+ }
+
+ // should have no influence on first page
+ view2->setZoomFactor(3.5);
+ for (auto &&p : { qMakePair(view, 2.5), qMakePair(view2.get(), 3.5), })
+ QCOMPARE(p.first->zoomFactor(), p.second);
}
void tst_QQuickWebEngineView::printToPdf()
@@ -821,7 +846,7 @@ void tst_QQuickWebEngineView::printToPdf()
QSignalSpy savePdfSpy(view, SIGNAL(pdfPrintingFinished(const QString&, bool)));
QString path = tempDir.path() + "/print_success.pdf";
view->printToPdf(path, QQuickWebEngineView::A4, QQuickWebEngineView::Portrait);
- QTRY_VERIFY2(savePdfSpy.count() == 1, "Printing to PDF file failed without signal");
+ QTRY_VERIFY2(savePdfSpy.size() == 1, "Printing to PDF file failed without signal");
QList<QVariant> successArguments = savePdfSpy.takeFirst();
QVERIFY2(successArguments.at(0).toString() == path, "File path for first saved PDF does not match arguments");
QVERIFY2(successArguments.at(1).toBool() == true, "Printing to PDF file failed though it should succeed");
@@ -832,7 +857,7 @@ void tst_QQuickWebEngineView::printToPdf()
path = tempDir.path() + "/print_|fail.pdf";
#endif // #if !defined(Q_OS_WIN)
view->printToPdf(path, QQuickWebEngineView::A4, QQuickWebEngineView::Portrait);
- QTRY_VERIFY2(savePdfSpy.count() == 1, "Printing to PDF file failed without signal");
+ QTRY_VERIFY2(savePdfSpy.size() == 1, "Printing to PDF file failed without signal");
QList<QVariant> failedArguments = savePdfSpy.takeFirst();
QVERIFY2(failedArguments.at(0).toString() == path, "File path for second saved PDF does not match arguments");
QVERIFY2(failedArguments.at(1).toBool() == false, "Printing to PDF file succeeded though it should fail");
@@ -875,6 +900,7 @@ public:
QQuickItem(parent), m_eventCounter(0), m_child(child) {
setFlag(ItemHasContents);
setAcceptedMouseButtons(Qt::AllButtons);
+ setAcceptTouchEvents(true);
setAcceptHoverEvents(true);
}
@@ -975,13 +1001,9 @@ void tst_QQuickWebEngineView::inputEventForwardingDisabledWhenActiveFocusOnPress
QTest::mousePress(view->window(), Qt::LeftButton);
QTest::mouseRelease(view->window(), Qt::LeftButton);
- QTouchDevice *device = new QTouchDevice;
- device->setType(QTouchDevice::TouchScreen);
- QWindowSystemInterface::registerTouchDevice(device);
-
- QTest::touchEvent(view->window(), device).press(0, QPoint(0,0), view->window());
- QTest::touchEvent(view->window(), device).move(0, QPoint(1, 1), view->window());
- QTest::touchEvent(view->window(), device).release(0, QPoint(1, 1), view->window());
+ QTest::touchEvent(view->window(), touchDevice()).press(0, QPoint(0,0), view->window());
+ QTest::touchEvent(view->window(), touchDevice()).move(0, QPoint(1, 1), view->window());
+ QTest::touchEvent(view->window(), touchDevice()).release(0, QPoint(1, 1), view->window());
// We expect to catch 7 events - click = 2, press + release = 2, touches = 3.
QCOMPARE(item.eventCount(), 7);
@@ -993,6 +1015,9 @@ void tst_QQuickWebEngineView::inputEventForwardingDisabledWhenActiveFocusOnPress
void tst_QQuickWebEngineView::changeLocale()
{
+ if (QTestPrivate::isRunningArmOnX86())
+ QSKIP("Does not work with QEMU. (QTBUG-94911)");
+
QStringList errorLines;
QUrl url("http://non.existent/");
@@ -1037,10 +1062,10 @@ void tst_QQuickWebEngineView::userScripts()
QScopedPointer<QQuickWebEngineView> webEngineView2(newWebEngineView());
webEngineView2->setParentItem(m_window->contentItem());
- QQmlListReference list(webEngineView1->profile(), "userScripts");
- QQuickWebEngineScript script;
+ QQuickWebEngineScriptCollection *collection = webEngineView1->profile()->userScripts();
+ QWebEngineScript script;
script.setSourceCode("document.title = 'New title';");
- list.append(&script);
+ collection->insert(script);
webEngineView1->setUrl(urlFromTestPath("html/basic_page.html"));
QVERIFY(waitForLoadSucceeded(webEngineView1.data()));
@@ -1050,7 +1075,7 @@ void tst_QQuickWebEngineView::userScripts()
QVERIFY(waitForLoadSucceeded(webEngineView2.data()));
QTRY_COMPARE(webEngineView2->title(), QStringLiteral("New title"));
- list.clear();
+ collection->clear();
}
void tst_QQuickWebEngineView::javascriptClipboard_data()
@@ -1100,7 +1125,7 @@ void tst_QQuickWebEngineView::javascriptClipboard()
// - return value of queryCommandEnabled and
// - return value of execCommand
// - comparing the clipboard / input field
- QGuiApplication::clipboard()->clear();
+ QGuiApplication::clipboard()->setText(QString());
QCOMPARE(evaluateJavaScriptSync(view, "document.queryCommandEnabled('copy')").toBool(),
copyResult);
QCOMPARE(evaluateJavaScriptSync(view, "document.execCommand('copy')").toBool(), copyResult);
@@ -1127,9 +1152,9 @@ void tst_QQuickWebEngineView::javascriptClipboard()
"if (result.state == 'prompt') accessPrompt = true;"
"})"));
- QTRY_COMPARE(evaluateJavaScriptSync(view, "accessGranted").toBool(), copyResult);
- QTRY_COMPARE(evaluateJavaScriptSync(view, "accessDenied").toBool(), !javascriptCanAccessClipboard);
- QTRY_COMPARE(evaluateJavaScriptSync(view, "accessPrompt").toBool(), false);
+ QTRY_COMPARE(evaluateJavaScriptSync(view, "accessGranted").toBool(), javascriptCanAccessClipboard && javascriptCanPaste);
+ QTRY_COMPARE(evaluateJavaScriptSync(view, "accessDenied").toBool(), false);
+ QTRY_COMPARE(evaluateJavaScriptSync(view, "accessPrompt").toBool(), !javascriptCanAccessClipboard || !javascriptCanPaste);
evaluateJavaScriptSync(view,
QStringLiteral(
@@ -1143,13 +1168,13 @@ void tst_QQuickWebEngineView::javascriptClipboard()
"if (result.state == 'prompt') accessPrompt = true;"
"})"));
- QTRY_COMPARE(evaluateJavaScriptSync(view, "accessGranted").toBool(), pasteResult);
- QTRY_COMPARE(evaluateJavaScriptSync(view, "accessDenied").toBool(), !javascriptCanAccessClipboard || !javascriptCanPaste);
- QTRY_COMPARE(evaluateJavaScriptSync(view, "accessPrompt").toBool(), false);
+ QTRY_COMPARE(evaluateJavaScriptSync(view, "accessGranted").toBool(), javascriptCanAccessClipboard && javascriptCanPaste);
+ QTRY_COMPARE(evaluateJavaScriptSync(view, "accessDenied").toBool(), false);
+ QTRY_COMPARE(evaluateJavaScriptSync(view, "accessPrompt").toBool(), !javascriptCanAccessClipboard || !javascriptCanPaste);
}
void tst_QQuickWebEngineView::setProfile() {
- QSignalSpy loadSpy(webEngineView(), SIGNAL(loadingChanged(QQuickWebEngineLoadRequest*)));
+ QSignalSpy loadSpy(webEngineView(), SIGNAL(loadingChanged(QWebEngineLoadingInfo)));
webEngineView()->setUrl(urlFromTestPath("html/basic_page.html"));
QVERIFY(waitForLoadSucceeded(webEngineView()));
QCOMPARE(loadSpy.size(), 2);
@@ -1157,24 +1182,27 @@ void tst_QQuickWebEngineView::setProfile() {
QVERIFY(waitForLoadSucceeded(webEngineView()));
QCOMPARE(loadSpy.size(), 4);
QQuickWebEngineProfile *profile = new QQuickWebEngineProfile();
+ auto oldProfile = webEngineView()->profile();
+ auto sc = qScopeGuard([&] () { webEngineView()->setProfile(oldProfile); delete profile; });
webEngineView()->setProfile(profile);
QTRY_COMPARE(webEngineView()->url() ,urlFromTestPath("html/basic_page2.html"));
}
+#if QT_CONFIG(accessibility)
void tst_QQuickWebEngineView::focusChild_data()
{
QTest::addColumn<QString>("interfaceName");
- QTest::addColumn<QVector<QAccessible::Role>>("ancestorRoles");
+ QTest::addColumn<QList<QAccessible::Role>>("ancestorRoles");
- QTest::newRow("QQuickWebEngineView") << QString("QQuickWebEngineView") << QVector<QAccessible::Role>({QAccessible::Client});
- QTest::newRow("RenderWidgetHostViewQtDelegate") << QString("RenderWidgetHostViewQtDelegate") << QVector<QAccessible::Role>({QAccessible::Client});
- QTest::newRow("QQuickView") << QString("QQuickView") << QVector<QAccessible::Role>({QAccessible::Window, QAccessible::Client /* view */});
+ QTest::newRow("QQuickWebEngineView") << QString("QQuickWebEngineView") << QList<QAccessible::Role>({QAccessible::Client});
+ QTest::newRow("RenderWidgetHostViewQtDelegate") << QString("RenderWidgetHostViewQtDelegate") << QList<QAccessible::Role>({QAccessible::Client});
+ QTest::newRow("QQuickView") << QString("QQuickView") << QList<QAccessible::Role>({QAccessible::Window, QAccessible::Client /* view */});
}
void tst_QQuickWebEngineView::focusChild()
{
auto traverseToWebDocumentAccessibleInterface = [](QAccessibleInterface *iface) -> QAccessibleInterface * {
- QFETCH(QVector<QAccessible::Role>, ancestorRoles);
+ QFETCH(QList<QAccessible::Role>, ancestorRoles);
for (int i = 0; i < ancestorRoles.size(); ++i) {
if (iface->childCount() == 0 || iface->role() != ancestorRoles[i])
return nullptr;
@@ -1223,9 +1251,122 @@ void tst_QQuickWebEngineView::focusChild()
// <html> -> <body> -> <input>
QCOMPARE(traverseToWebDocumentAccessibleInterface(iface)->child(0)->child(0), iface->focusChild());
}
+#endif // QT_CONFIG(accessibility)
+void tst_QQuickWebEngineView::htmlSelectPopup()
+{
+ m_window->show();
+ QQuickWebEngineView &view = *webEngineView();
+ view.settings()->setFocusOnNavigationEnabled(true);
+ view.setSize(QSizeF(640, 480));
+ view.loadHtml("<html><body>"
+ "<select id='select' onchange='console.log(\"option changed to: \" + this.value)'>"
+ "<option value='O1'>O1</option><option value='O2'>O2</option><option value='O3'>O3</option></select>"
+ "</body></html>");
+ QVERIFY(waitForLoadSucceeded(&view));
+
+ auto makeTouch = [this] (QWindow *w, const QPoint &p) {
+ QTest::touchEvent(w, touchDevice()).press(1, p);
+ QTest::touchEvent(w, touchDevice()).release(1, p);
+ };
+
+ makeTouch(view.window(), elementCenter(&view, "select"));
+ QPointer<QQuickWindow> popup;
+ QTRY_VERIFY((popup = m_window->findChild<QQuickWindow *>()));
+ QCOMPARE(activeElementId(&view), QStringLiteral("select"));
+
+ makeTouch(popup, QPoint(popup->width() / 2, popup->height() / 2));
+ QTRY_VERIFY(!popup);
+ QCOMPARE(evaluateJavaScriptSync(&view, "document.getElementById('select').value").toString(), QStringLiteral("O2"));
+}
+
+void tst_QQuickWebEngineView::savePage_data()
+{
+ QTest::addColumn<QWebEngineDownloadRequest::SavePageFormat>("savePageFormat");
+
+ QTest::newRow("SingleHtmlSaveFormat") << QWebEngineDownloadRequest::SingleHtmlSaveFormat;
+ QTest::newRow("CompleteHtmlSaveFormat") << QWebEngineDownloadRequest::CompleteHtmlSaveFormat;
+ QTest::newRow("MimeHtmlSaveFormat") << QWebEngineDownloadRequest::MimeHtmlSaveFormat;
+}
+
+void tst_QQuickWebEngineView::savePage()
+{
+ QFETCH(QWebEngineDownloadRequest::SavePageFormat, savePageFormat);
+
+ QTemporaryDir tempDir(QDir::tempPath() + "/tst_QQuickWebEngineView-XXXXXX");
+ QVERIFY(tempDir.isValid());
+ const QString filePath = tempDir.path() + "/saved_page.html";
+
+ QQuickWebEngineView *view = webEngineView();
+ int acceptedCount = 0;
+ int finishedCount = 0;
+ ScopedConnection sc1 = connect(
+ view->profile(), &QQuickWebEngineProfile::downloadRequested,
+ [&](QQuickWebEngineDownloadRequest *downloadRequest) {
+ QCOMPARE(downloadRequest->state(),
+ QQuickWebEngineDownloadRequest::DownloadInProgress);
+ QCOMPARE(downloadRequest->isSavePageDownload(), true);
+ QCOMPARE(downloadRequest->savePageFormat(), savePageFormat);
+ QCOMPARE(QDir(downloadRequest->downloadDirectory())
+ .filePath(downloadRequest->downloadFileName()),
+ filePath);
+ QCOMPARE(downloadRequest->url(), view->url());
+
+ connect(downloadRequest, &QQuickWebEngineDownloadRequest::isFinishedChanged,
+ [&, downloadRequest]() {
+ QCOMPARE(downloadRequest->state(),
+ QQuickWebEngineDownloadRequest::DownloadCompleted);
+ QCOMPARE(downloadRequest->isSavePageDownload(), true);
+ QCOMPARE(downloadRequest->isFinished(), true);
+ QCOMPARE(downloadRequest->savePageFormat(), savePageFormat);
+ QCOMPARE(downloadRequest->totalBytes(),
+ downloadRequest->receivedBytes());
+ QVERIFY(downloadRequest->receivedBytes() > 0);
+ QCOMPARE(QDir(downloadRequest->downloadDirectory())
+ .filePath(downloadRequest->downloadFileName()),
+ filePath);
+ QCOMPARE(downloadRequest->url(), view->url());
+ finishedCount++;
+ });
+ acceptedCount++;
+ });
+
+ const QString originalData = QStringLiteral("Basic page");
+ view->setUrl(urlFromTestPath("html/basic_page.html"));
+ QVERIFY(waitForLoadSucceeded(view));
+ QCOMPARE(evaluateJavaScriptSync(view, "document.getElementsByTagName('h1')[0].innerText")
+ .toString(),
+ originalData);
+
+ // Save the loaded page as HTML.
+ view->save(filePath, savePageFormat);
+ QTRY_COMPARE(acceptedCount, 1);
+ QTRY_COMPARE(finishedCount, 1);
+ QFile file(filePath);
+ QVERIFY(file.exists());
+
+ // Load something else.
+ view->setUrl(urlFromTestPath("html/basic_page2.html"));
+ QVERIFY(waitForLoadSucceeded(view));
+ QVERIFY(evaluateJavaScriptSync(view, "document.getElementsByTagName('h1')[0].innerText")
+ .toString()
+ != originalData);
+
+ // Load the saved page and compare the contents.
+ view->setUrl(QUrl::fromLocalFile(filePath));
+ QVERIFY(waitForLoadSucceeded(view));
+ QCOMPARE(evaluateJavaScriptSync(view, "document.getElementsByTagName('h1')[0].innerText")
+ .toString(),
+ originalData);
+}
+
+#if QT_CONFIG(accessibility)
static QByteArrayList params = QByteArrayList()
<< "--force-renderer-accessibility";
+#else
+static QByteArrayList params;
+#endif
W_QTEST_MAIN(tst_QQuickWebEngineView, params)
#include "tst_qquickwebengineview.moc"
+#include "moc_quickutil.cpp"
diff --git a/tests/auto/quick/qquickwebengineviewgraphics/CMakeLists.txt b/tests/auto/quick/qquickwebengineviewgraphics/CMakeLists.txt
new file mode 100644
index 000000000..f22408d15
--- /dev/null
+++ b/tests/auto/quick/qquickwebengineviewgraphics/CMakeLists.txt
@@ -0,0 +1,13 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+include(../../util/util.cmake)
+qt_internal_add_test(tst_qquickwebengineviewgraphics
+ SOURCES
+ tst_qquickwebengineviewgraphics.cpp
+ LIBRARIES
+ Qt::CorePrivate
+ Qt::WebEngineQuickPrivate
+ Qt::Test
+ Test::Util
+)
diff --git a/tests/auto/quick/qquickwebengineviewgraphics/qquickwebengineviewgraphics.pro b/tests/auto/quick/qquickwebengineviewgraphics/qquickwebengineviewgraphics.pro
deleted file mode 100644
index a0ee3fd89..000000000
--- a/tests/auto/quick/qquickwebengineviewgraphics/qquickwebengineviewgraphics.pro
+++ /dev/null
@@ -1,4 +0,0 @@
-include(../tests.pri)
-CONFIG -= testcase # remove, once this passes in the CI
-exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc
-QT_PRIVATE += webengine-private gui-private webenginecore-private
diff --git a/tests/auto/quick/qquickwebengineviewgraphics/tst_qquickwebengineviewgraphics.cpp b/tests/auto/quick/qquickwebengineviewgraphics/tst_qquickwebengineviewgraphics.cpp
index 518ddaa0d..3644ac481 100644
--- a/tests/auto/quick/qquickwebengineviewgraphics/tst_qquickwebengineviewgraphics.cpp
+++ b/tests/auto/quick/qquickwebengineviewgraphics/tst_qquickwebengineviewgraphics.cpp
@@ -1,40 +1,14 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "util.h"
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+#include <quickutil.h>
#include <QtTest/QtTest>
#include <QQmlContext>
#include <QQuickView>
#include <QQuickItem>
#include <QPainter>
-#include <qtwebengineglobal.h>
-#include <private/qquickwebengineview_p.h>
+#include <QtWebEngineQuick/qtwebenginequickglobal.h>
+#include <QtWebEngineQuick/private/qquickwebengineview_p.h>
#include <map>
@@ -98,6 +72,8 @@ static void verifyGreenSquare(QQuickWindow *window)
bool ok = QTest::qWaitFor([&](){
actual = window->grabWindow();
expected = getGreenSquare(actual.format());
+ if (actual.height() > 150)
+ actual = actual.scaledToHeight(150);
return actual == expected;
}, 10000);
if (!ok) {
@@ -110,7 +86,9 @@ static void verifyGreenSquare(QQuickWindow *window)
void tst_QQuickWebEngineViewGraphics::simpleGraphics()
{
setHtml(greenSquare);
+ m_view->show();
verifyGreenSquare(m_view.data());
+ m_view->hide();
}
void tst_QQuickWebEngineViewGraphics::showHideShow()
@@ -126,12 +104,15 @@ void tst_QQuickWebEngineViewGraphics::showHideShow()
m_view->show();
QVERIFY(exposeSpy.wait());
verifyGreenSquare(m_view.data());
+ m_view->hide();
}
void tst_QQuickWebEngineViewGraphics::simpleAcceleratedLayer()
{
+ m_view->show();
setHtml(acLayerGreenSquare);
verifyGreenSquare(m_view.data());
+ m_view->hide();
}
void tst_QQuickWebEngineViewGraphics::reparentToOtherWindow()
@@ -142,21 +123,24 @@ void tst_QQuickWebEngineViewGraphics::reparentToOtherWindow()
window.create();
m_view->rootObject()->setParentItem(window.contentItem());
+ window.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&window));
verifyGreenSquare(&window);
}
void tst_QQuickWebEngineViewGraphics::setHtml(const QString &html)
{
QString htmlData = QUrl::toPercentEncoding(html);
- QString qmlData = QUrl::toPercentEncoding(QStringLiteral("import QtQuick 2.0; import QtWebEngine 1.2; WebEngineView { width: 150; height: 150 }"));
+ QString qmlData = QUrl::toPercentEncoding(QStringLiteral("import QtQuick; import QtWebEngine; WebEngineView { width: 150; height: 150 }"));
m_view->setSource(QUrl(QStringLiteral("data:text/plain,%1").arg(qmlData)));
m_view->create();
QQuickWebEngineView *webEngineView = static_cast<QQuickWebEngineView *>(m_view->rootObject());
- webEngineView->setProperty("url", QUrl(QStringLiteral("data:text/html,%1").arg(htmlData)));
- QTRY_COMPARE_WITH_TIMEOUT(m_view->rootObject()->property("loading"), QVariant(false), 30000);
+ webEngineView->setUrl(QUrl(QStringLiteral("data:text/html,%1").arg(htmlData)));
+ QVERIFY(waitForLoadSucceeded(webEngineView));
}
static QByteArrayList params;
W_QTEST_MAIN(tst_QQuickWebEngineViewGraphics, params)
#include "tst_qquickwebengineviewgraphics.moc"
+#include "moc_quickutil.cpp"
diff --git a/tests/auto/quick/qtbug-70248/CMakeLists.txt b/tests/auto/quick/qtbug-70248/CMakeLists.txt
new file mode 100644
index 000000000..b177c5309
--- /dev/null
+++ b/tests/auto/quick/qtbug-70248/CMakeLists.txt
@@ -0,0 +1,20 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_test(tst_qtbug-70248
+ SOURCES
+ tst_qtbug-70248.cpp
+ LIBRARIES
+ Qt::WebEngineQuickPrivate
+)
+
+set(test_resource_files
+ "test.qml"
+)
+
+qt_internal_add_resource(tst_qtbug-70248 "test"
+ PREFIX
+ "/"
+ FILES
+ ${test_resource_files}
+)
diff --git a/tests/auto/quick/qtbug-70248/qtbug-70248.pro b/tests/auto/quick/qtbug-70248/qtbug-70248.pro
deleted file mode 100644
index e1b18bc16..000000000
--- a/tests/auto/quick/qtbug-70248/qtbug-70248.pro
+++ /dev/null
@@ -1,5 +0,0 @@
-include(../tests.pri)
-QT += webengine webengine-private
-
-RESOURCES += \
- test.qrc
diff --git a/tests/auto/quick/qtbug-70248/test.qml b/tests/auto/quick/qtbug-70248/test.qml
index 35962aff5..5870f593e 100644
--- a/tests/auto/quick/qtbug-70248/test.qml
+++ b/tests/auto/quick/qtbug-70248/test.qml
@@ -1,6 +1,6 @@
-import QtQuick 2.9
-import QtQuick.Window 2.2
-import QtWebEngine 1.3
+import QtQuick
+import QtQuick.Window
+import QtWebEngine
Window {
visible: true
diff --git a/tests/auto/quick/qtbug-70248/test.qrc b/tests/auto/quick/qtbug-70248/test.qrc
deleted file mode 100644
index 83fea5eb0..000000000
--- a/tests/auto/quick/qtbug-70248/test.qrc
+++ /dev/null
@@ -1,5 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>test.qml</file>
- </qresource>
-</RCC>
diff --git a/tests/auto/quick/qtbug-70248/tst_qtbug-70248.cpp b/tests/auto/quick/qtbug-70248/tst_qtbug-70248.cpp
index 3dffa1d84..cf5c187c3 100644
--- a/tests/auto/quick/qtbug-70248/tst_qtbug-70248.cpp
+++ b/tests/auto/quick/qtbug-70248/tst_qtbug-70248.cpp
@@ -1,32 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-#include "qtwebengineglobal.h"
+#include "qtwebenginequickglobal.h"
#include <QQuickWebEngineProfile>
#include <QQmlApplicationEngine>
#include <QQuickWindow>
@@ -43,7 +18,7 @@ private slots:
void tst_qtbug_70248::test()
{
- QtWebEngine::initialize();
+ QtWebEngineQuick::initialize();
QScopedPointer<QQmlApplicationEngine> engine;
QQuickWebEngineProfile::defaultProfile()->setOffTheRecord(true);
engine.reset(new QQmlApplicationEngine());
diff --git a/tests/auto/quick/quick.pro b/tests/auto/quick/quick.pro
deleted file mode 100644
index 865ec718e..000000000
--- a/tests/auto/quick/quick.pro
+++ /dev/null
@@ -1,22 +0,0 @@
-include($$QTWEBENGINE_OUT_ROOT/src/webengine/qtwebengine-config.pri) # workaround for QTBUG-68093
-QT_FOR_CONFIG += webengine-private
-
-TEMPLATE = subdirs
-
-SUBDIRS += \
- dialogs \
- inspectorserver \
- qmltests \
- publicapi \
- qquickwebenginedefaultsurfaceformat \
- qquickwebengineview \
- qtbug-70248
-
-qtConfig(webengine-testsupport) {
- SUBDIRS += \
- qmltests2 \
- qquickwebengineviewgraphics
-}
-
-# QTBUG-66055
-boot2qt: SUBDIRS -= inspectorserver qquickwebengineview qmltests qmltests2
diff --git a/tests/auto/quick/shared/qt_webengine_quicktest.h b/tests/auto/quick/shared/qt_webengine_quicktest.h
deleted file mode 100644
index 3adc9d459..000000000
--- a/tests/auto/quick/shared/qt_webengine_quicktest.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT_WEBENGINE_QUICKTEST_H
-#define QT_WEBENGINE_QUICKTEST_H
-
-#include <QtQuickTest/quicktestglobal.h>
-
-#ifdef QT_WIDGETS_LIB
-#include <QtWidgets/QApplication>
-#else
-#include <QtGui/QGuiApplication>
-#endif
-
-#include "qopenglcontext.h"
-#include <qtwebengineglobal.h>
-
-QT_BEGIN_NAMESPACE
-
-#ifndef QUICK_TEST_SOURCE_DIR
-#define QUICK_TEST_SOURCE_DIR 0
-#endif
-
-#ifdef QT_WIDGETS_LIB
-#define Application QApplication
-#else
-#define Application QGuiApplication
-#endif
-
-QT_END_NAMESPACE
-
-#endif // QT_WEBENGINE_QUICKTEST_H
diff --git a/tests/auto/quick/shared/testwindow.h b/tests/auto/quick/shared/testwindow.h
deleted file mode 100644
index b57443c69..000000000
--- a/tests/auto/quick/shared/testwindow.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef TESTWINDOW_H
-#define TESTWINDOW_H
-
-#if 0
-#pragma qt_no_master_include
-#endif
-
-#include <QResizeEvent>
-#include <QScopedPointer>
-#include <QtQuick/qquickitem.h>
-#include <QtQuick/qquickview.h>
-
-// TestWindow: Utility class to ignore QQuickView details.
-class TestWindow : public QQuickView {
-public:
- inline TestWindow(QQuickItem *webEngineView);
- QScopedPointer<QQuickItem> webEngineView;
-
-protected:
- inline void resizeEvent(QResizeEvent*);
-};
-
-inline TestWindow::TestWindow(QQuickItem *webEngineView)
- : webEngineView(webEngineView)
-{
- Q_ASSERT(webEngineView);
- webEngineView->setParentItem(contentItem());
- resize(300, 400);
-}
-
-inline void TestWindow::resizeEvent(QResizeEvent *event)
-{
- QQuickView::resizeEvent(event);
- webEngineView->setX(0);
- webEngineView->setY(0);
- webEngineView->setWidth(event->size().width());
- webEngineView->setHeight(event->size().height());
-}
-
-#endif /* TESTWINDOW_H */
diff --git a/tests/auto/quick/shared/util.h b/tests/auto/quick/shared/util.h
deleted file mode 100644
index b7b7b1564..000000000
--- a/tests/auto/quick/shared/util.h
+++ /dev/null
@@ -1,190 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef UTIL_H
-#define UTIL_H
-
-#include <QEventLoop>
-#include <QQmlEngine>
-#include <QSignalSpy>
-#include <QTimer>
-#include <QtTest/QtTest>
-#include <QtWebEngine/private/qquickwebengineview_p.h>
-#include <QtWebEngine/private/qquickwebengineloadrequest_p.h>
-#include <QGuiApplication>
-
-#if !defined(TESTS_SOURCE_DIR)
-#define TESTS_SOURCE_DIR ""
-#endif
-
-class LoadSpy : public QEventLoop {
- Q_OBJECT
-
-public:
- LoadSpy(QQuickWebEngineView *webEngineView)
- {
- connect(webEngineView, SIGNAL(loadingChanged(QQuickWebEngineLoadRequest*)), SLOT(onLoadingChanged(QQuickWebEngineLoadRequest*)));
- }
-
- ~LoadSpy() { }
-
-Q_SIGNALS:
- void loadSucceeded();
- void loadFailed();
-
-private Q_SLOTS:
- void onLoadingChanged(QQuickWebEngineLoadRequest *loadRequest)
- {
- if (loadRequest->status() == QQuickWebEngineView::LoadSucceededStatus)
- emit loadSucceeded();
- else if (loadRequest->status() == QQuickWebEngineView::LoadFailedStatus)
- emit loadFailed();
- }
-};
-
-class LoadStartedCatcher : public QObject {
- Q_OBJECT
-
-public:
- LoadStartedCatcher(QQuickWebEngineView *webEngineView)
- : m_webEngineView(webEngineView)
- {
- connect(m_webEngineView, SIGNAL(loadingChanged(QQuickWebEngineLoadRequest*)), this, SLOT(onLoadingChanged(QQuickWebEngineLoadRequest*)));
- }
-
- virtual ~LoadStartedCatcher() { }
-
-public Q_SLOTS:
- void onLoadingChanged(QQuickWebEngineLoadRequest *loadRequest)
- {
- if (loadRequest->status() == QQuickWebEngineView::LoadStartedStatus)
- QMetaObject::invokeMethod(this, "finished", Qt::QueuedConnection);
- }
-
-Q_SIGNALS:
- void finished();
-
-private:
- QQuickWebEngineView *m_webEngineView;
-};
-
-inline bool waitForLoadSucceeded(QQuickWebEngineView *webEngineView, int timeout = 10000)
-{
- LoadSpy loadSpy(webEngineView);
- QSignalSpy spy(&loadSpy, &LoadSpy::loadSucceeded);
- return spy.wait(timeout);
-}
-
-inline bool waitForLoadFailed(QQuickWebEngineView *webEngineView, int timeout = 20000)
-{
- LoadSpy loadSpy(webEngineView);
- QSignalSpy spy(&loadSpy, &LoadSpy::loadFailed);
- return spy.wait(timeout);
-}
-
-inline QVariant evaluateJavaScriptSync(QQuickWebEngineView *view, const QString &script)
-{
- QQmlEngine *engine = qmlEngine(view);
- engine->globalObject().setProperty("called", false);
- engine->globalObject().setProperty("result", QJSValue());
- QJSValue callback = engine->evaluate(
- "(function callback(r) {"
- " called = true;"
- " result = r;"
- "})"
- );
- view->runJavaScript(script, callback);
- QTRY_LOOP_IMPL(engine->globalObject().property("called").toBool(), 5000, 50);
- if (!engine->globalObject().property("called").toBool()) {
- qWarning("JavaScript wasn't evaluated");
- return QVariant();
- }
-
- return engine->globalObject().property("result").toVariant();
-}
-
-inline QPoint elementCenter(QQuickWebEngineView *view, const QString &id)
-{
- const QString jsCode(
- "(function(){"
- " var elem = document.getElementById('" + id + "');"
- " var rect = elem.getBoundingClientRect();"
- " return [(rect.left + rect.right) / 2, (rect.top + rect.bottom) / 2];"
- "})()");
- QVariantList rectList = evaluateJavaScriptSync(view, jsCode).toList();
-
- if (rectList.count() != 2) {
- qWarning("elementCenter failed.");
- return QPoint();
- }
-
- return QPoint(rectList.at(0).toInt(), rectList.at(1).toInt());
-}
-
-inline QString activeElementId(QQuickWebEngineView *webEngineView)
-{
- qRegisterMetaType<QQuickWebEngineView::JavaScriptConsoleMessageLevel>("JavaScriptConsoleMessageLevel");
- QSignalSpy consoleMessageSpy(webEngineView, &QQuickWebEngineView::javaScriptConsoleMessage);
-
- webEngineView->runJavaScript(
- "if (document.activeElement == null)"
- " console.log('');"
- "else"
- " console.log(document.activeElement.id);"
- );
-
- if (!consoleMessageSpy.wait())
- return QString();
-
- QList<QVariant> arguments = consoleMessageSpy.takeFirst();
- if (static_cast<QQuickWebEngineView::JavaScriptConsoleMessageLevel>(arguments.at(0).toInt()) != QQuickWebEngineView::InfoMessageLevel)
- return QString();
-
- return arguments.at(1).toString();
-}
-
-#define W_QTEST_MAIN(TestObject, params) \
-int main(int argc, char *argv[]) \
-{ \
- QtWebEngine::initialize(); \
- \
- QVector<const char *> w_argv(argc); \
- for (int i = 0; i < argc; ++i) \
- w_argv[i] = argv[i]; \
- for (int i = 0; i < params.size(); ++i) \
- w_argv.append(params[i].data()); \
- int w_argc = w_argv.size(); \
- \
- QGuiApplication app(w_argc, const_cast<char **>(w_argv.data())); \
- app.setAttribute(Qt::AA_Use96Dpi, true); \
- TestObject tc; \
- QTEST_SET_MAIN_SOURCE_PATH \
- return QTest::qExec(&tc, argc, argv); \
-}
-#endif /* UTIL_H */
-
diff --git a/tests/auto/quick/tests.pri b/tests/auto/quick/tests.pri
deleted file mode 100644
index 1bf69da43..000000000
--- a/tests/auto/quick/tests.pri
+++ /dev/null
@@ -1,20 +0,0 @@
-include($$QTWEBENGINE_OUT_ROOT/src/webengine/qtwebengine-config.pri) # workaround for QTBUG-68093
-QT_FOR_CONFIG += webengine-private
-
-TEMPLATE = app
-
-CONFIG += testcase
-
-VPATH += $$_PRO_FILE_PWD_
-TARGET = tst_$$TARGET
-
-SOURCES += $${TARGET}.cpp
-INCLUDEPATH += \
- $$PWD \
- ../shared
-
-QT += testlib network quick webengine
-
-# This define is used by some tests to look up resources in the source tree
-DEFINES += TESTS_SOURCE_DIR=\\\"$$PWD/\\\"
-include(../embed_info_plist.pri)
diff --git a/tests/auto/quick/uidelegates/CMakeLists.txt b/tests/auto/quick/uidelegates/CMakeLists.txt
new file mode 100644
index 000000000..bdf041e04
--- /dev/null
+++ b/tests/auto/quick/uidelegates/CMakeLists.txt
@@ -0,0 +1,17 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+include(../../httpserver/httpserver.cmake)
+include(../../util/util.cmake)
+
+qt_internal_add_test(tst_uidelegates
+ SOURCES
+ tst_uidelegates.cpp
+ LIBRARIES
+ Qt::WebEngineCorePrivate
+ Qt::WebEngineQuick
+ Qt::GuiPrivate
+ Qt::WebEngineQuickPrivate
+ Test::HttpServer
+ Test::Util
+)
diff --git a/tests/auto/quick/uidelegates/tst_uidelegates.cpp b/tests/auto/quick/uidelegates/tst_uidelegates.cpp
new file mode 100644
index 000000000..fb8734f83
--- /dev/null
+++ b/tests/auto/quick/uidelegates/tst_uidelegates.cpp
@@ -0,0 +1,228 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#include "testwindow.h"
+#include "quickutil.h"
+
+#include <QScopedPointer>
+#include <QtQml/QQmlEngine>
+#include <QtTest/QtTest>
+#include <QtWebEngineQuick/private/qquickwebengineview_p.h>
+#include <httpserver.h>
+#include <QNetworkProxy>
+#include <QObject>
+
+class tst_UIDelegates : public QObject
+{
+ Q_OBJECT
+public:
+ tst_UIDelegates();
+
+private Q_SLOTS:
+ void init();
+ void initTestCase();
+ void cleanup();
+ void javaScriptDialog();
+ void javaScriptDialog_data();
+ void fileDialog();
+ void contextMenu();
+ void tooltip();
+ void colorDialog();
+ void authenticationDialog_data();
+ void authenticationDialog();
+
+private:
+ inline QQuickWebEngineView *newWebEngineView();
+ inline QQuickWebEngineView *webEngineView() const;
+ void runJavaScript(const QString &script);
+ QScopedPointer<TestWindow> m_window;
+ QScopedPointer<QQmlComponent> m_component;
+};
+
+tst_UIDelegates::tst_UIDelegates()
+{
+ QtWebEngineQuick::initialize();
+ static QQmlEngine *engine = new QQmlEngine(this);
+ m_component.reset(new QQmlComponent(engine, this));
+ m_component->setData(QByteArrayLiteral("import QtQuick\n"
+ "import QtWebEngine\n"
+ "WebEngineView {}"),
+ QUrl());
+}
+
+QQuickWebEngineView *tst_UIDelegates::newWebEngineView()
+{
+ QObject *viewInstance = m_component->create();
+ QQuickWebEngineView *webEngineView = qobject_cast<QQuickWebEngineView *>(viewInstance);
+ return webEngineView;
+}
+
+void tst_UIDelegates::init()
+{
+ m_window.reset(new TestWindow(newWebEngineView()));
+}
+
+void tst_UIDelegates::initTestCase()
+{
+ QNetworkProxy proxy;
+ proxy.setType(QNetworkProxy::HttpProxy);
+ proxy.setHostName("localhost");
+ proxy.setPort(5555);
+ QNetworkProxy::setApplicationProxy(proxy);
+}
+
+void tst_UIDelegates::cleanup()
+{
+ m_window.reset();
+}
+
+inline QQuickWebEngineView *tst_UIDelegates::webEngineView() const
+{
+ return static_cast<QQuickWebEngineView *>(m_window->webEngineView.data());
+}
+
+void tst_UIDelegates::runJavaScript(const QString &script)
+{
+ webEngineView()->runJavaScript(script);
+}
+
+void tst_UIDelegates::javaScriptDialog_data()
+{
+ QTest::addColumn<QString>("javaScriptCode");
+ QTest::addColumn<QString>("expectedObjectName");
+
+ QTest::newRow("AlertDialog") << QString("alert('This is the Alert Dialog!');")
+ << QString("alertDialog");
+ QTest::newRow("ConfirmDialog") << QString("confirm('This is the Confirm Dialog.');")
+ << QString("confirmDialog");
+ QTest::newRow("PromptDialog") << QString("prompt('Is this the Prompt Dialog?', 'Yes');")
+ << QString("promptDialog");
+}
+
+void tst_UIDelegates::javaScriptDialog()
+{
+ QFETCH(QString, javaScriptCode);
+ QFETCH(QString, expectedObjectName);
+
+ m_window->show();
+ QTRY_VERIFY(qApp->focusObject());
+ QQuickWebEngineView *view = webEngineView();
+
+ view->loadHtml("<html><body>"
+ "</body></html>");
+ QVERIFY(waitForLoadSucceeded(view));
+
+ runJavaScript(javaScriptCode);
+ QTRY_VERIFY(view->findChild<QObject *>(expectedObjectName));
+}
+
+void tst_UIDelegates::fileDialog()
+{
+ m_window->show();
+ QTRY_VERIFY(qApp->focusObject());
+ QQuickWebEngineView *view = webEngineView();
+
+ view->loadHtml("<html><body>"
+ "<input type='file' id='filePicker'/>"
+ "</body></html>");
+ QVERIFY(waitForLoadSucceeded(view));
+
+ QPoint filePickerCenter = elementCenter(view, QStringLiteral("filePicker"));
+ QTest::mouseClick(view->window(), Qt::LeftButton, {}, filePickerCenter);
+ QTRY_VERIFY(view->findChild<QObject *>(QStringLiteral("fileDialog")));
+}
+
+void tst_UIDelegates::contextMenu()
+{
+ m_window->show();
+ QTRY_VERIFY(qApp->focusObject());
+ QQuickWebEngineView *view = webEngineView();
+
+ view->loadHtml("<html><body>"
+ "</body></html>");
+ QVERIFY(waitForLoadSucceeded(view));
+
+ QTest::mouseClick(view->window(), Qt::RightButton);
+ QTRY_VERIFY(view->findChild<QObject *>(QStringLiteral("menu")));
+}
+
+void tst_UIDelegates::tooltip()
+{
+ m_window->show();
+ QTRY_VERIFY(qApp->focusObject());
+ QQuickWebEngineView *view = webEngineView();
+
+ view->loadHtml("<html><body>"
+ "<p id='toolTip' title='I'm a tooltip.'>Hover this text to display a tooltip</p>"
+ "</body></html>");
+ QVERIFY(waitForLoadSucceeded(view));
+ QString toolTipStr = QStringLiteral("toolTip");
+
+ QPoint tooltipCenter = elementCenter(view, toolTipStr);
+ QPoint windowCenter = QPoint(view->window()->width() / 2, view->window()->height() / 2);
+ QVERIFY(tooltipCenter.x() == windowCenter.x());
+
+ int distance = windowCenter.y() - tooltipCenter.y();
+ for (int i = 3; i > 0; i--) {
+ QTest::mouseMove(view->window(), QPoint(windowCenter.x(), windowCenter.y() - distance / i));
+ }
+ QTRY_VERIFY(view->findChild<QObject *>(toolTipStr));
+}
+
+void tst_UIDelegates::colorDialog()
+{
+ m_window->show();
+ QTRY_VERIFY(qApp->focusObject());
+ QQuickWebEngineView *view = webEngineView();
+
+ view->loadHtml("<html><body>"
+ "<input type='color' id='colorPicker'>"
+ "</body></html>");
+ QVERIFY(waitForLoadSucceeded(view));
+
+ QPoint filePickerCenter = elementCenter(view, QStringLiteral("colorPicker"));
+ QTest::mouseClick(view->window(), Qt::LeftButton, {}, filePickerCenter);
+ QTRY_VERIFY(view->findChild<QObject *>(QStringLiteral("colorDialog")));
+}
+
+void tst_UIDelegates::authenticationDialog_data()
+{
+ QTest::addColumn<QUrl>("url");
+ QTest::addColumn<QByteArray>("response");
+
+ QTest::newRow("Http Authentication Dialog")
+ << QUrl("http://localhost:5555/")
+ << QByteArrayLiteral("HTTP/1.1 401 Unauthorized\nWWW-Authenticate: "
+ "Basic realm=\"Very Restricted Area\"\r\n\r\n");
+ QTest::newRow("Proxy Authentication Dialog")
+ << QUrl("http://qt.io/")
+ << QByteArrayLiteral("HTTP/1.1 407 Proxy Auth Required\nProxy-Authenticate: "
+ "Basic realm=\"Proxy requires authentication\"\r\n"
+ "content-length: 0\r\n\r\n");
+}
+
+void tst_UIDelegates::authenticationDialog()
+{
+ QFETCH(QUrl, url);
+ QFETCH(QByteArray, response);
+
+ HttpServer server(QHostAddress::LocalHost, 5555);
+ connect(&server, &HttpServer::newRequest,
+ [url, response](HttpReqRep *rr) { rr->sendResponse(response); });
+ QVERIFY(server.start());
+
+ m_window->show();
+ QTRY_VERIFY(qApp->focusObject());
+ QQuickWebEngineView *view = webEngineView();
+ view->loadHtml("<html><body>"
+ "</body></html>");
+ QVERIFY(waitForLoadSucceeded(view));
+
+ view->setUrl(url);
+ QTRY_VERIFY(view->findChild<QObject *>(QStringLiteral("authenticationDialog")));
+ QVERIFY(server.stop());
+}
+
+QTEST_MAIN(tst_UIDelegates)
+#include "tst_uidelegates.moc"
+#include "moc_quickutil.cpp"
diff --git a/tests/auto/shared/http.pri b/tests/auto/shared/http.pri
deleted file mode 100644
index 5236e9d26..000000000
--- a/tests/auto/shared/http.pri
+++ /dev/null
@@ -1,3 +0,0 @@
-HEADERS += $$PWD/httpserver.h $$PWD/httpreqrep.h
-SOURCES += $$PWD/httpserver.cpp $$PWD/httpreqrep.cpp
-INCLUDEPATH += $$PWD
diff --git a/tests/auto/shared/httpreqrep.cpp b/tests/auto/shared/httpreqrep.cpp
deleted file mode 100644
index 15a86631c..000000000
--- a/tests/auto/shared/httpreqrep.cpp
+++ /dev/null
@@ -1,134 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "httpreqrep.h"
-
-HttpReqRep::HttpReqRep(QTcpSocket *socket, QObject *parent)
- : QObject(parent), m_socket(socket)
-{
- m_socket->setParent(this);
- connect(m_socket, &QTcpSocket::readyRead, this, &HttpReqRep::handleReadyRead);
- connect(m_socket, &QTcpSocket::disconnected, this, &HttpReqRep::handleDisconnected);
-}
-
-void HttpReqRep::sendResponse()
-{
- if (m_state != State::REQUEST_RECEIVED)
- return;
- m_socket->write("HTTP/1.1 ");
- m_socket->write(QByteArray::number(m_responseStatusCode));
- m_socket->write(" OK?\r\n");
- for (const auto & kv : m_responseHeaders) {
- m_socket->write(kv.first);
- m_socket->write(": ");
- m_socket->write(kv.second);
- m_socket->write("\r\n");
- }
- m_socket->write("Connection: close\r\n");
- m_socket->write("\r\n");
- m_socket->write(m_responseBody);
- m_state = State::DISCONNECTING;
- m_socket->disconnectFromHost();
- Q_EMIT responseSent();
-}
-
-void HttpReqRep::close()
-{
- if (m_state != State::REQUEST_RECEIVED)
- return;
- m_state = State::DISCONNECTING;
- m_socket->disconnectFromHost();
- Q_EMIT error(QStringLiteral("missing response"));
-}
-
-QByteArray HttpReqRep::requestHeader(const QByteArray &key) const
-{
- auto it = m_requestHeaders.find(key);
- if (it != m_requestHeaders.end())
- return it->second;
- return {};
-}
-
-void HttpReqRep::handleReadyRead()
-{
- while (m_socket->canReadLine()) {
- switch (m_state) {
- case State::RECEIVING_REQUEST: {
- const auto requestLine = m_socket->readLine();
- const auto requestLineParts = requestLine.split(' ');
- if (requestLineParts.size() != 3 || !requestLineParts[2].toUpper().startsWith("HTTP/")) {
- m_state = State::DISCONNECTING;
- m_socket->disconnectFromHost();
- Q_EMIT error(QStringLiteral("invalid request line"));
- return;
- }
- m_requestMethod = requestLineParts[0];
- m_requestPath = requestLineParts[1];
- m_state = State::RECEIVING_HEADERS;
- break;
- }
- case State::RECEIVING_HEADERS: {
- const auto headerLine = m_socket->readLine();
- if (headerLine == QByteArrayLiteral("\r\n")) {
- m_state = State::REQUEST_RECEIVED;
- Q_EMIT requestReceived();
- return;
- }
- int colonIndex = headerLine.indexOf(':');
- if (colonIndex < 0) {
- m_state = State::DISCONNECTING;
- m_socket->disconnectFromHost();
- Q_EMIT error(QStringLiteral("invalid header line"));
- return;
- }
- auto headerKey = headerLine.left(colonIndex).trimmed().toLower();
- auto headerValue = headerLine.mid(colonIndex + 1).trimmed().toLower();
- m_requestHeaders.emplace(headerKey, headerValue);
- break;
- }
- default:
- return;
- }
- }
-}
-
-void HttpReqRep::handleDisconnected()
-{
- switch (m_state) {
- case State::RECEIVING_REQUEST:
- case State::RECEIVING_HEADERS:
- case State::REQUEST_RECEIVED:
- Q_EMIT error(QStringLiteral("unexpected disconnect"));
- break;
- case State::DISCONNECTING:
- break;
- case State::DISCONNECTED:
- Q_UNREACHABLE();
- }
- m_state = State::DISCONNECTED;
- Q_EMIT closed();
-}
diff --git a/tests/auto/shared/httpreqrep.h b/tests/auto/shared/httpreqrep.h
deleted file mode 100644
index 1666b17d0..000000000
--- a/tests/auto/shared/httpreqrep.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef HTTPREQREP_H
-#define HTTPREQREP_H
-
-#include <QTcpSocket>
-
-#include <map>
-#include <utility>
-
-// Represents an HTTP request-response exchange.
-class HttpReqRep : public QObject
-{
- Q_OBJECT
-public:
- explicit HttpReqRep(QTcpSocket *socket, QObject *parent = nullptr);
-
- Q_INVOKABLE void sendResponse();
- void close();
-
- // Request parameters (only valid after requestReceived())
-
- QByteArray requestMethod() const { return m_requestMethod; }
- QByteArray requestPath() const { return m_requestPath; }
- QByteArray requestHeader(const QByteArray &key) const;
-
- // Response parameters (can be set until sendResponse()/close()).
-
- int responseStatus() const { return m_responseStatusCode; }
- void setResponseStatus(int statusCode)
- {
- m_responseStatusCode = statusCode;
- }
- void setResponseHeader(const QByteArray &key, QByteArray value)
- {
- m_responseHeaders[key.toLower()] = std::move(value);
- }
- QByteArray responseBody() const { return m_responseBody; }
- Q_INVOKABLE void setResponseBody(QByteArray content)
- {
- m_responseHeaders["content-length"] = QByteArray::number(content.size());
- m_responseBody = std::move(content);
- }
-
-Q_SIGNALS:
- // Emitted when the request has been correctly parsed.
- void requestReceived();
- // Emitted on first call to sendResponse().
- void responseSent();
- // Emitted when something goes wrong.
- void error(const QString &error);
- // Emitted during or some time after sendResponse() or close().
- void closed();
-
-private Q_SLOTS:
- void handleReadyRead();
- void handleDisconnected();
-
-private:
- enum class State {
- // Waiting for first line of request.
- RECEIVING_REQUEST, // Next: RECEIVING_HEADERS or DISCONNECTING.
- // Waiting for header lines.
- RECEIVING_HEADERS, // Next: REQUEST_RECEIVED or DISCONNECTING.
- // Request parsing succeeded, waiting for sendResponse() or close().
- REQUEST_RECEIVED, // Next: DISCONNECTING.
- // Waiting for network.
- DISCONNECTING, // Next: DISCONNECTED.
- // Connection is dead.
- DISCONNECTED, // Next: -
- };
- QTcpSocket *m_socket = nullptr;
- State m_state = State::RECEIVING_REQUEST;
- QByteArray m_requestMethod;
- QByteArray m_requestPath;
- std::map<QByteArray, QByteArray> m_requestHeaders;
- int m_responseStatusCode = 200;
- std::map<QByteArray, QByteArray> m_responseHeaders;
- QByteArray m_responseBody;
-};
-
-#endif // !HTTPREQREP_H
diff --git a/tests/auto/shared/https.pri b/tests/auto/shared/https.pri
deleted file mode 100644
index ce4c147f7..000000000
--- a/tests/auto/shared/https.pri
+++ /dev/null
@@ -1,4 +0,0 @@
-include($$PWD/http.pri)
-
-HEADERS += $$PWD/httpsserver.h
-RESOURCES += $$PWD/httpsserver.qrc
diff --git a/tests/auto/shared/httpserver.cpp b/tests/auto/shared/httpserver.cpp
deleted file mode 100644
index e282fc8b8..000000000
--- a/tests/auto/shared/httpserver.cpp
+++ /dev/null
@@ -1,100 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "httpserver.h"
-
-#include <QLoggingCategory>
-
-Q_LOGGING_CATEGORY(gHttpServerLog, "HttpServer")
-
-HttpServer::HttpServer(QObject *parent) : HttpServer(new QTcpServer, "http", parent)
-{
-}
-
-HttpServer::HttpServer(QTcpServer *tcpServer, const QString &protocol, QObject *parent)
- : QObject(parent), m_tcpServer(tcpServer)
-{
- m_url.setHost(QStringLiteral("127.0.0.1"));
- m_url.setScheme(protocol);
- connect(tcpServer, &QTcpServer::newConnection, this, &HttpServer::handleNewConnection);
-}
-
-HttpServer::~HttpServer()
-{
- delete m_tcpServer;
-}
-
-bool HttpServer::start()
-{
- m_error = false;
- m_expectingError = false;
-
- if (!m_tcpServer->listen()) {
- qCWarning(gHttpServerLog).noquote() << m_tcpServer->errorString();
- return false;
- }
-
- m_url.setPort(m_tcpServer->serverPort());
- return true;
-}
-
-bool HttpServer::stop()
-{
- m_tcpServer->close();
- return m_error == m_expectingError;
-}
-
-void HttpServer::setExpectError(bool b)
-{
- m_expectingError = b;
-}
-
-QUrl HttpServer::url(const QString &path) const
-{
- auto copy = m_url;
- copy.setPath(path);
- return copy;
-}
-
-void HttpServer::handleNewConnection()
-{
- auto rr = new HttpReqRep(m_tcpServer->nextPendingConnection(), this);
- connect(rr, &HttpReqRep::requestReceived, [this, rr]() {
- Q_EMIT newRequest(rr);
- rr->close();
- });
- connect(rr, &HttpReqRep::responseSent, [rr]() {
- qCInfo(gHttpServerLog).noquote() << rr->requestMethod() << rr->requestPath()
- << rr->responseStatus() << rr->responseBody().size();
- });
- connect(rr, &HttpReqRep::error, [this, rr](const QString &error) {
- qCWarning(gHttpServerLog).noquote() << rr->requestMethod() << rr->requestPath()
- << error;
- m_error = true;
- });
- connect(rr, &HttpReqRep::closed, rr, &QObject::deleteLater);
-}
diff --git a/tests/auto/shared/httpserver.h b/tests/auto/shared/httpserver.h
deleted file mode 100644
index 57f824bb5..000000000
--- a/tests/auto/shared/httpserver.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef HTTPSERVER_H
-#define HTTPSERVER_H
-
-#include "httpreqrep.h"
-
-#include <QTcpServer>
-#include <QUrl>
-
-// Listens on a TCP socket and creates HttpReqReps for each connection.
-//
-// Usage:
-//
-// HttpServer server;
-// connect(&server, &HttpServer::newRequest, [](HttpReqRep *rr) {
-// if (rr->requestPath() == "/myPage.html") {
-// rr->setResponseBody("<html><body>Hello, World!</body></html>");
-// rr->sendResponse();
-// }
-// });
-// QVERIFY(server.start());
-// /* do stuff */
-// QVERIFY(server.stop());
-//
-// HttpServer owns the HttpReqRep objects. The signal handler should not store
-// references to HttpReqRep objects.
-//
-// Only if a handler calls sendResponse() will a response be actually sent. This
-// means that multiple handlers can be connected to the signal, with different
-// handlers responsible for different paths.
-class HttpServer : public QObject
-{
- Q_OBJECT
-public:
- explicit HttpServer(QObject *parent = nullptr);
- explicit HttpServer(QTcpServer *server, const QString &protocol, QObject *parent = nullptr);
-
- ~HttpServer() override;
-
- // Must be called to start listening.
- //
- // Returns true if a TCP port has been successfully bound.
- Q_INVOKABLE Q_REQUIRED_RESULT bool start();
-
- // Stops listening and performs final error checks.
- Q_INVOKABLE Q_REQUIRED_RESULT bool stop();
-
- Q_INVOKABLE void setExpectError(bool b);
-
- // Full URL for given relative path
- Q_INVOKABLE QUrl url(const QString &path = QStringLiteral("/")) const;
-
-Q_SIGNALS:
- // Emitted after a HTTP request has been successfully parsed.
- void newRequest(HttpReqRep *reqRep);
-
-private Q_SLOTS:
- void handleNewConnection();
-
-private:
- QTcpServer *m_tcpServer;
- QUrl m_url;
- bool m_error = false;
- bool m_expectingError = false;
-};
-
-#endif // !HTTPSERVER_H
diff --git a/tests/auto/shared/httpsserver.h b/tests/auto/shared/httpsserver.h
deleted file mode 100644
index 32c8e8345..000000000
--- a/tests/auto/shared/httpsserver.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef HTTPSSERVER_H
-#define HTTPSSERVER_H
-
-#include "httpreqrep.h"
-#include "httpserver.h"
-
-#include <QDebug>
-#include <QFile>
-#include <QSslKey>
-#include <QSslSocket>
-#include <QSslConfiguration>
-#include <QTcpServer>
-
-struct SslTcpServer : QTcpServer
-{
- SslTcpServer() {
- sslconf.setLocalCertificateChain(QSslCertificate::fromPath(":/resources/cert.pem"));
- sslconf.setPrivateKey(readKey(":/resources/key.pem"));
- }
-
- void incomingConnection(qintptr d) override {
- auto socket = new QSslSocket(this);
- socket->setSslConfiguration(sslconf);
-
- if (!socket->setSocketDescriptor(d)) {
- qWarning() << "Failed to setup ssl socket!";
- delete socket;
- return;
- }
-
- connect(socket, QOverload<QSslSocket::SocketError>::of(&QSslSocket::error),
- [] (QSslSocket::SocketError e) { qWarning() << "! Socket Error:" << e; });
- connect(socket, QOverload<const QList<QSslError> &>::of(&QSslSocket::sslErrors),
- [] (const QList<QSslError> &le) { qWarning() << "! SSL Errors:\n" << le; });
-
- addPendingConnection(socket);
- socket->startServerEncryption();
- }
-
- QSslKey readKey(const QString &path) const {
- QFile file(path);
- file.open(QIODevice::ReadOnly);
- return QSslKey(file.readAll(), QSsl::Rsa, QSsl::Pem);
- }
-
- QSslConfiguration sslconf;
-};
-
-struct HttpsServer : HttpServer
-{
- HttpsServer(QObject *parent = nullptr) : HttpServer(new SslTcpServer, "https", parent) { }
-};
-
-#endif
diff --git a/tests/auto/shared/httpsserver.qrc b/tests/auto/shared/httpsserver.qrc
deleted file mode 100644
index ec57a1983..000000000
--- a/tests/auto/shared/httpsserver.qrc
+++ /dev/null
@@ -1,6 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
-<qresource>
- <file>resources/cert.pem</file>
- <file>resources/key.pem</file>
-</qresource>
-</RCC>
diff --git a/tests/auto/shared/resources/cert.pem b/tests/auto/shared/resources/cert.pem
deleted file mode 100644
index 3aaaf289c..000000000
--- a/tests/auto/shared/resources/cert.pem
+++ /dev/null
@@ -1,64 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIEpDCCAoygAwIBAgIUO90aty9AMjvBvzfUhr1WwdBrKkMwDQYJKoZIhvcNAQEL
-BQAwfzELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFjAUBgNVBAcM
-DVNhbiBGcmFuY2lzY28xDzANBgNVBAoMBkJhZFNTTDEyMDAGA1UEAwwpQmFkU1NM
-IEludGVybWVkaWF0ZSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMTkwODI2MTQ0
-NDIxWhcNMTkwODI3MTQ0NDIxWjBjMQswCQYDVQQGEwJVUzETMBEGA1UECAwKQ2Fs
-aWZvcm5pYTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNjbzEPMA0GA1UECgwGQmFkU1NM
-MRYwFAYDVQQDDA0qLmJhZHNzbC50ZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A
-MIIBCgKCAQEAkybT/L4zJCqefpd+eYT6aQ0PtobQfFgP+n+z5wWoUxIAJnjb5ZW4
-7IJxka/2/ggzJOfrUBur54LkTfFQ+yX85eKYCuH0GLz+Rve50LDn0ya6qSgmEhDG
-0bend2tMZY+Nl3B+5Ane1vua8hdJjv3ZO3e5UgpQwysL54eYyhEWWlbFWF11LhEd
-MYp953UGLqoV4Mlw+Li8TmFwdKQx6icgBTuloXLzk9aUU+b6NbXdadNXkmzg09IC
-sb8pnMXiF2P9Xm5rK0IoiRkSHxVnU12nQXh65Ns/2Dj5DcbHmVdvallfr4wnLeFP
-UotysZnvFmE7FLMSr/eQfkTG+Jlb7ZhoGwIDAQABozQwMjAJBgNVHRMEAjAAMCUG
-A1UdEQQeMByCDSouYmFkc3NsLnRlc3SCC2JhZHNzbC50ZXN0MA0GCSqGSIb3DQEB
-CwUAA4ICAQA7Yc+QQzqSK15ibmaYrkqq+cumggsWLCprW8jvzhpWBt9IjToP5nsy
-sKinYPoZR8jvZ1YVotcts7uQT7DkqeWkB+l+88c7gQdgujvBo6v9/g+jrXFKgsJD
-IBmkho8hpd63Slqv2Yp4bYT20O5EvR9CQvwSkwTs+ylBNEs1Q+AbekxmBjuYUxHn
-9xL4/GZ6ufoNv676iCoXo4mnDrCD8e8MRiZoU9Lq4G41HGiLWV0tM/M6BdVJYGzl
-FcBg0ZKnQT9OCWEPRe3zyRS6a+MivPAzxS8z/kYaRN+C7H68Mib3xPDsEETz1MnO
-uzGAPHAAgtYWYJi+CaaNWkgAv4n+UIQa0oyqPn4z5hLcsO+nMBws2Sg0mkQLilBX
-N1ciCdVMi7sHKuLa7GVksq/RQrXnZcQhoYQRrZAaAHKbxyo/M2pNqmDiFJppdH7a
-6Rj2vYf6ig/FXAzDGsDvf/tsGCxgJTFzGly+GsWVe40vyjfWHxWWDU/eGjfGO05k
-Xzjm+kYGJnH2hfiIlX1Jeu/jjIodiSy31F0hvuKlJu8PfaQ7oo5neRzwRO6Wq9rR
-7DMsQN6OtXGnnA+ogC0korA+aXev6wzbwYUhzMf1YTzEjrFNIXeIHsQSzq6lPcIE
-JOly5wjyO/eNF7mpHyDX8brY6Hn+bgyDeKAmsUvhOCEXgaPpKlP4gQ==
------END CERTIFICATE-----
------BEGIN CERTIFICATE-----
-MIIGeTCCBGGgAwIBAgIUbVL7tFc7sgPIYnt+REVc0wiHdBcwDQYJKoZIhvcNAQEL
-BQAwdzELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFjAUBgNVBAcM
-DVNhbiBGcmFuY2lzY28xDzANBgNVBAoMBkJhZFNTTDEqMCgGA1UEAwwhQmFkU1NM
-IFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MB4XDTE5MDgyNjE0NDQyMFoXDTI5
-MDgyMzE0NDQyMFowfzELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWEx
-FjAUBgNVBAcMDVNhbiBGcmFuY2lzY28xDzANBgNVBAoMBkJhZFNTTDEyMDAGA1UE
-AwwpQmFkU1NMIEludGVybWVkaWF0ZSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggIi
-MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCgoU4q43DJEUyoAOeK31uyEgLn
-s5CCd6XFmGp6wln0yupwmYRaDiCoSJ1qpmjYt+gIHpDAFS2ZzR4TbZORFirjY0cQ
-6+IWwpBEQR0hOluWN99CqjdCxfuZwiTvTV3FQv1IJZ13g23Uh2xRbnrzC2muDHzT
-4ZNM3aayvziMGY6n33aksEc6WMZb3p/Qn2OepeC7EzZiy4tXKPf9OaOPbae5aJWZ
-bOzzydFLkV4UqZb5FfySt8toIivPeIlRCiPodWLb2y5DYUXyWBk1dpbIcVa/LusV
-vsBELeJ+BFDRH1NHtwOrhOkZHKMr3SQ1YRlNDEeHUVmQkori397j9JjpPzScQJ6r
-d/W4mGyzgRmguIy9IpKMbxX5/1A6c6l5q0HqMgPv84GWxlhav4xwsOf90iT2vLPZ
-yllVCgCsCfvLEyVFhER18HAo8mTkQqKL7ZO96xXHgugA7dFN/C3BdC9kYP/GbAwd
-J0R6qKrfSiyyk1VbjWfFdFH/G/bT9H0nrjMj5tCT4q/zDCb5HkBp3BOoyUKb9yyt
-a1Cht/Iu3f1SlQzsrDBt9iMMCjXoNNAJcV7ZZ6HCxcWwfAwxgylQgq8UG60shxhn
-CBPhcA8JM+mk2nghTU2pxwY/KpAd0H4/a79b0DE97dCOnNHzyP3tqP8RenG549B0
-gsNO60aG01k6P9jFuQIDAQABo4H0MIHxMB0GA1UdDgQWBBQgvWmDuYqQ6xX7y8xc
-cgky1FO7jzCBtAYDVR0jBIGsMIGpgBTUGo+svIaoSMF/shILSbeiQ1zAQKF7pHkw
-dzELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFjAUBgNVBAcMDVNh
-biBGcmFuY2lzY28xDzANBgNVBAoMBkJhZFNTTDEqMCgGA1UEAwwhQmFkU1NMIFJv
-b3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5ghR1qCPxzkfCSCwMFHm98245f0pk0zAM
-BgNVHRMEBTADAQH/MAsGA1UdDwQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAgEAnGr6
-t1+KNGZV9hmAE3SyMzHRpgwtqIG4kl94A7Pz3CbA8+q7u7DW8l1GdaNx2J2wo+R5
-rJi02V5e7TNa7ZS5S9WGYHZ2y6QOjXuT28VMAPX+3HAgxk3RMxocpLpkPp8hhD/9
-S5KxA6AQDUN6av8E3xeuuWYWmTvAXNHK5ABXDFxxTp902ozNnZaSk2DxAUqcsOD4
-ago0IhRdkFGe1Q7F8gOxtlUL5owNL4uhRP8BbwOja2Gopn2+kA9CNqdwPI4Ipjlr
-yo61oCqzy3RAXOUct8WAvybacADmJODAxDq9O5fAZuYZScjjj1ASowmbyDH/Wb9z
-+WfiKKH4BfgOIukzK3I1M9wiSDefIodCFfEVXbdNudZj8f9Gw4RrZwkUuxDLeRWG
-ReDtzAWq7G0Diw3uX40S4jaj3MeS6oHp2Nrj/VyjSRiYTeN/pnA9N0M5VuCYYvXD
-f50rrigjQfOgb4TmnyJAjXWVkXW7Fa+ooLsbvlfr8wP8f31y1cgWPHTVIv6Kmug7
-Bg88k3x5gLTXmutDjseORonhGMRdAxHgJVf5aKfzdRpwXZTDZJXhsAz9OdlOhNZd
-UrYo680QugA0V3H5D8Egbr2AUUSMDkn133COjeOIDknFxX3qDqeTzqLZCAEBIoKn
-Adpix0jvG1Ys4Ayq6K2wQFdGFjtl6LsiGC7pWWU=
------END CERTIFICATE-----
diff --git a/tests/auto/shared/resources/key.pem b/tests/auto/shared/resources/key.pem
deleted file mode 100644
index 89922679a..000000000
--- a/tests/auto/shared/resources/key.pem
+++ /dev/null
@@ -1,27 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIIEowIBAAKCAQEAkybT/L4zJCqefpd+eYT6aQ0PtobQfFgP+n+z5wWoUxIAJnjb
-5ZW47IJxka/2/ggzJOfrUBur54LkTfFQ+yX85eKYCuH0GLz+Rve50LDn0ya6qSgm
-EhDG0bend2tMZY+Nl3B+5Ane1vua8hdJjv3ZO3e5UgpQwysL54eYyhEWWlbFWF11
-LhEdMYp953UGLqoV4Mlw+Li8TmFwdKQx6icgBTuloXLzk9aUU+b6NbXdadNXkmzg
-09ICsb8pnMXiF2P9Xm5rK0IoiRkSHxVnU12nQXh65Ns/2Dj5DcbHmVdvallfr4wn
-LeFPUotysZnvFmE7FLMSr/eQfkTG+Jlb7ZhoGwIDAQABAoIBADRXy3BL98UVo+tD
-2ClBtBFKJBy5N9ADQyvH4SZ8TLO/423L7+xqpaz7eYppHWKfaBHorTuBnFRtquhO
-vo+Xo63iPFMirMFf+NMlq2MgilYBoMQrE9+5N//BZECGWlaGCcekrH5RRIMUXLlg
-rzm98lfE7pbQNIo39bQV97NpAJqBWPuoIvCrbRCysGoA5j7ptZ/EhSlC00eA7ybD
-CeYHmh8NrsapKOTGb5u1v3paV8X/mH6vKmsVs7n6LC0opBxzM8eAHEAQ6h8rmz9H
-y99FWDYha3lOS4SLkTnuRnNHOMLJajPq3Isu+BgzLWuRGnKZ3rmuUFwPNkCZTvsV
-dTdBE4ECgYEAw6jBEil0e8Pc9sGqnz93e8qrYE9wSPso4q3BNJgTbN48kon6mqh7
-gQVgEP/75Th5YrJUrY9Pd/8H9uoMOxbDXgOXG/xNnhC0L+7aM8nhKlxCLndY1e56
-/YymYYH4+D9ZD2u526mK/nmCg2QGOkCVYYp7NXe/mA0g34drKjefmj8CgYEAwIhq
-rZhlfAvQThSOqQA9zA7NXPDh4KzIjr8htVu5YvVcv5W2uhsni9DXFaloPnhuLdJ7
-MnPF2WqzQ9YqFrGn/9/OTqeE23f60ed04qLGM4BApb45y5Kw6sCPnWu7dMYfny9i
-XeZA2A+ODmqVkrU+ZNVzqzS1krYyUP3exd1voyUCgYEAqPRARH6np3gqhqoVvA4C
-D1OjSTdPrrWzSIriG5h2rbv6ck/Tp1l1zKPnoMZrrjRmHWQA2x61cNk4926DwUKW
-0cgn5HKqU6P49Ks8oRvi48FnJNjKTXHxoqChy/GAHF4Xecl8ZMKy06v5l5v4BLVg
-SSpb2n/dYl9z05IMaBhAKeECgYBKB2n1S6ah1q0GiLL92mDoiDyAYwKG8AjBkk40
-vIsAuNUruTYkQvKmuOsqohO6CXZb2hWSpZ9KZNN+3ucaCL9PDE/4QEM+W9iuQu/X
-gLzy6npxAD6avtGVweq2ncjbMp7QB1ksP69pJDn74xGV8miGPuiVyNOUEMgyChtR
-Oz6EnQKBgEth0w80CBg6b3NKuASoc/vC08njZQvWpe5xrzY2DL8epVKb1qf6+8SE
-eX34cIcSaonEZ2g67MAeIG6jtmPwxWk4EYAsO1u4XiyziABkoNyLKVH4hZg61BsV
-jL7R5UrUvBbhKLFOwkcB4Kwdwu7COB/UKa5XJBTMbuw1UTyxlUeI
------END RSA PRIVATE KEY-----
diff --git a/tests/auto/util/CMakeLists.txt b/tests/auto/util/CMakeLists.txt
new file mode 100644
index 000000000..0af0e5032
--- /dev/null
+++ b/tests/auto/util/CMakeLists.txt
@@ -0,0 +1,10 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.18)
+project(minimal LANGUAGES CXX)
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Network)
+
+include(util.cmake)
diff --git a/tests/auto/util/qt_webengine_quicktest.h b/tests/auto/util/qt_webengine_quicktest.h
new file mode 100644
index 000000000..bd98693de
--- /dev/null
+++ b/tests/auto/util/qt_webengine_quicktest.h
@@ -0,0 +1,25 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#ifndef QT_WEBENGINE_QUICKTEST_H
+#define QT_WEBENGINE_QUICKTEST_H
+
+#include <QtQuickTest/quicktestglobal.h>
+
+#ifdef QT_WIDGETS_LIB
+#include <QtWidgets/QApplication>
+#else
+#include <QtGui/QGuiApplication>
+#endif
+
+QT_BEGIN_NAMESPACE
+
+#ifdef QT_WIDGETS_LIB
+#define Application QApplication
+#else
+#define Application QGuiApplication
+#endif
+
+QT_END_NAMESPACE
+
+#endif // QT_WEBENGINE_QUICKTEST_H
diff --git a/tests/auto/util/quickutil.h b/tests/auto/util/quickutil.h
new file mode 100644
index 000000000..687cb94dc
--- /dev/null
+++ b/tests/auto/util/quickutil.h
@@ -0,0 +1,166 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#ifndef UTIL_H
+#define UTIL_H
+
+#include <QEventLoop>
+#include <QQmlEngine>
+#include <QSignalSpy>
+#include <QTimer>
+#include <QtTest/QtTest>
+#include <QtWebEngineCore/QWebEngineLoadingInfo>
+#include <QtWebEngineQuick/private/qquickwebengineview_p.h>
+#include <QGuiApplication>
+
+#if !defined(TESTS_SOURCE_DIR)
+#define TESTS_SOURCE_DIR ""
+#endif
+
+class LoadSpy : public QEventLoop {
+ Q_OBJECT
+
+public:
+ LoadSpy(QQuickWebEngineView *webEngineView)
+ {
+ connect(webEngineView, &QQuickWebEngineView::loadingChanged, this, &LoadSpy::onLoadingChanged);
+ }
+
+ ~LoadSpy() { }
+
+Q_SIGNALS:
+ void loadSucceeded();
+ void loadFailed();
+
+private Q_SLOTS:
+ void onLoadingChanged(const QWebEngineLoadingInfo &info)
+ {
+ if (info.status() == QWebEngineLoadingInfo::LoadSucceededStatus)
+ emit loadSucceeded();
+ else if (info.status() == QWebEngineLoadingInfo::LoadFailedStatus)
+ emit loadFailed();
+ }
+};
+
+class LoadStartedCatcher : public QObject {
+ Q_OBJECT
+
+public:
+ LoadStartedCatcher(QQuickWebEngineView *webEngineView)
+ : m_webEngineView(webEngineView)
+ {
+ connect(m_webEngineView, &QQuickWebEngineView::loadingChanged, this, &LoadStartedCatcher::onLoadingChanged);
+ }
+
+ virtual ~LoadStartedCatcher() { }
+
+public Q_SLOTS:
+ void onLoadingChanged(const QWebEngineLoadingInfo &info)
+ {
+ if (info.status() == QWebEngineLoadingInfo::LoadStartedStatus)
+ QMetaObject::invokeMethod(this, "finished", Qt::QueuedConnection);
+ }
+
+Q_SIGNALS:
+ void finished();
+
+private:
+ QQuickWebEngineView *m_webEngineView;
+};
+
+inline bool waitForLoadSucceeded(QQuickWebEngineView *webEngineView, int timeout = 10000)
+{
+ LoadSpy loadSpy(webEngineView);
+ QSignalSpy spy(&loadSpy, &LoadSpy::loadSucceeded);
+ return spy.wait(timeout);
+}
+
+inline bool waitForLoadFailed(QQuickWebEngineView *webEngineView, int timeout = 20000)
+{
+ LoadSpy loadSpy(webEngineView);
+ QSignalSpy spy(&loadSpy, &LoadSpy::loadFailed);
+ return spy.wait(timeout);
+}
+
+inline QVariant evaluateJavaScriptSync(QQuickWebEngineView *view, const QString &script)
+{
+ QQmlEngine *engine = qmlEngine(view);
+ engine->globalObject().setProperty("called", false);
+ engine->globalObject().setProperty("result", QJSValue());
+ QJSValue callback = engine->evaluate(
+ "(function callback(r) {"
+ " called = true;"
+ " result = r;"
+ "})"
+ );
+ view->runJavaScript(script, callback);
+ QTRY_LOOP_IMPL(engine->globalObject().property("called").toBool(), 5000, 50);
+ if (!engine->globalObject().property("called").toBool()) {
+ qWarning("JavaScript wasn't evaluated");
+ return QVariant();
+ }
+
+ return engine->globalObject().property("result").toVariant();
+}
+
+inline QPoint elementCenter(QQuickWebEngineView *view, const QString &id)
+{
+ const QString jsCode(
+ "(function(){"
+ " var elem = document.getElementById('" + id + "');"
+ " var rect = elem.getBoundingClientRect();"
+ " return [(rect.left + rect.right) / 2, (rect.top + rect.bottom) / 2];"
+ "})()");
+ QVariantList rectList = evaluateJavaScriptSync(view, jsCode).toList();
+
+ if (rectList.size() != 2) {
+ qWarning("elementCenter failed.");
+ return QPoint();
+ }
+
+ return QPoint(rectList.at(0).toInt(), rectList.at(1).toInt());
+}
+
+inline QString activeElementId(QQuickWebEngineView *webEngineView)
+{
+ qRegisterMetaType<QQuickWebEngineView::JavaScriptConsoleMessageLevel>("JavaScriptConsoleMessageLevel");
+ QSignalSpy consoleMessageSpy(webEngineView, &QQuickWebEngineView::javaScriptConsoleMessage);
+
+ webEngineView->runJavaScript(
+ "if (document.activeElement == null)"
+ " console.log('');"
+ "else"
+ " console.log(document.activeElement.id);"
+ );
+
+ if (!consoleMessageSpy.wait())
+ return QString();
+
+ QList<QVariant> arguments = consoleMessageSpy.takeFirst();
+ if (static_cast<QQuickWebEngineView::JavaScriptConsoleMessageLevel>(arguments.at(0).toInt()) != QQuickWebEngineView::InfoMessageLevel)
+ return QString();
+
+ return arguments.at(1).toString();
+}
+
+#define W_QTEST_MAIN(TestObject, params) \
+int main(int argc, char *argv[]) \
+{ \
+ QtWebEngineQuick::initialize(); \
+ QList<const char *> w_argv(argc); \
+ QLatin1String arg("--webEngineArgs"); \
+ for (int i = 0; i < argc; ++i) \
+ w_argv[i] = argv[i]; \
+ w_argv.append(arg.data()); \
+ for (int i = 0; i < params.size(); ++i) \
+ w_argv.append(params[i].data()); \
+ int w_argc = w_argv.size(); \
+ \
+ QGuiApplication app(w_argc, const_cast<char **>(w_argv.data())); \
+ app.setAttribute(Qt::AA_Use96Dpi, true); \
+ TestObject tc; \
+ QTEST_SET_MAIN_SOURCE_PATH \
+ return QTest::qExec(&tc, argc, argv); \
+}
+#endif /* UTIL_H */
+
diff --git a/tests/auto/util/testwindow.h b/tests/auto/util/testwindow.h
new file mode 100644
index 000000000..f9ffd381a
--- /dev/null
+++ b/tests/auto/util/testwindow.h
@@ -0,0 +1,43 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#ifndef TESTWINDOW_H
+#define TESTWINDOW_H
+
+#if 0
+#pragma qt_no_master_include
+#endif
+
+#include <QResizeEvent>
+#include <QScopedPointer>
+#include <QtQuick/qquickitem.h>
+#include <QtQuick/qquickview.h>
+
+// TestWindow: Utility class to ignore QQuickView details.
+class TestWindow : public QQuickView {
+public:
+ inline TestWindow(QQuickItem *webEngineView);
+ QScopedPointer<QQuickItem> webEngineView;
+
+protected:
+ inline void resizeEvent(QResizeEvent *) override;
+};
+
+inline TestWindow::TestWindow(QQuickItem *webEngineView)
+ : webEngineView(webEngineView)
+{
+ Q_ASSERT(webEngineView);
+ webEngineView->setParentItem(contentItem());
+ resize(300, 400);
+}
+
+inline void TestWindow::resizeEvent(QResizeEvent *event)
+{
+ QQuickView::resizeEvent(event);
+ webEngineView->setX(0);
+ webEngineView->setY(0);
+ webEngineView->setWidth(event->size().width());
+ webEngineView->setHeight(event->size().height());
+}
+
+#endif /* TESTWINDOW_H */
diff --git a/tests/auto/util/util.cmake b/tests/auto/util/util.cmake
new file mode 100644
index 000000000..e5142d0b2
--- /dev/null
+++ b/tests/auto/util/util.cmake
@@ -0,0 +1,8 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+if (NOT TARGET Test::Util)
+ add_library(qtestutil INTERFACE)
+ target_include_directories(qtestutil INTERFACE ${CMAKE_CURRENT_LIST_DIR})
+ add_library(Test::Util ALIAS qtestutil)
+endif()
diff --git a/tests/auto/util/util.h b/tests/auto/util/util.h
new file mode 100644
index 000000000..5533eed80
--- /dev/null
+++ b/tests/auto/util/util.h
@@ -0,0 +1,178 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+// Functions and macros that really need to be in QTestLib
+
+#if 0
+#pragma qt_no_master_include
+#endif
+
+#include <QEventLoop>
+#include <QPoint>
+#include <QRect>
+#include <QSignalSpy>
+#include <QTimer>
+#include <qwebenginefindtextresult.h>
+#include <qwebenginepage.h>
+
+// Disconnect signal on destruction.
+class ScopedConnection
+{
+public:
+ ScopedConnection(QMetaObject::Connection connection) : m_connection(std::move(connection)) { }
+ ~ScopedConnection() { QObject::disconnect(m_connection); }
+
+private:
+ QMetaObject::Connection m_connection;
+};
+
+/**
+ * Just like QSignalSpy but facilitates sync and async
+ * signal emission. For example if you want to verify that
+ * page->foo() emitted a signal, it could be that the
+ * implementation decides to emit the signal asynchronously
+ * - in which case we want to spin a local event loop until
+ * emission - or that the call to foo() emits it right away.
+ */
+class SignalBarrier : private QSignalSpy
+{
+public:
+ SignalBarrier(const QObject* obj, const char* aSignal)
+ : QSignalSpy(obj, aSignal)
+ { }
+
+ bool ensureSignalEmitted()
+ {
+ bool result = size() > 0;
+ if (!result)
+ result = wait();
+ clear();
+ return result;
+ }
+};
+
+template<typename T, typename R>
+struct CallbackWrapper {
+ QPointer<R> p;
+ void operator()(const T& result) {
+ if (p)
+ (*p)(result);
+ }
+};
+
+template<typename T>
+class CallbackSpy: public QObject {
+public:
+ CallbackSpy() : called(false) {
+ timeoutTimer.setSingleShot(true);
+ QObject::connect(&timeoutTimer, SIGNAL(timeout()), &eventLoop, SLOT(quit()));
+ }
+
+ T waitForResult(int timeout = 20000) {
+ const int step = 1000;
+ int elapsed = 0;
+ while (elapsed < timeout && !called) {
+ timeoutTimer.start(step);
+ eventLoop.exec();
+ elapsed += step;
+ }
+ return result;
+ }
+
+ bool wasCalled() const {
+ return called;
+ }
+
+ void operator()(const T &result) {
+ this->result = result;
+ called = true;
+ eventLoop.quit();
+ }
+
+ CallbackWrapper<T, CallbackSpy<T> > ref()
+ {
+ CallbackWrapper<T, CallbackSpy<T> > wrapper = {this};
+ return wrapper;
+ }
+
+private:
+ Q_DISABLE_COPY(CallbackSpy)
+ bool called;
+ QTimer timeoutTimer;
+ QEventLoop eventLoop;
+ T result;
+};
+
+static inline QString toPlainTextSync(QWebEnginePage *page)
+{
+ CallbackSpy<QString> spy;
+ page->toPlainText(spy.ref());
+ return spy.waitForResult();
+}
+
+static inline QString toHtmlSync(QWebEnginePage *page)
+{
+ CallbackSpy<QString> spy;
+ page->toHtml(spy.ref());
+ return spy.waitForResult();
+}
+
+static inline bool findTextSync(QWebEnginePage *page, const QString &subString)
+{
+ CallbackSpy<QWebEngineFindTextResult> spy;
+ page->findText(subString, {}, spy.ref());
+ return spy.waitForResult().numberOfMatches() > 0;
+}
+
+static inline QVariant evaluateJavaScriptSync(QWebEnginePage *page, const QString &script)
+{
+ CallbackSpy<QVariant> spy;
+ page->runJavaScript(script, spy.ref());
+ return spy.waitForResult();
+}
+
+static inline QVariant evaluateJavaScriptSyncInWorld(QWebEnginePage *page, const QString &script, int worldId)
+{
+ CallbackSpy<QVariant> spy;
+ page->runJavaScript(script, worldId, spy.ref());
+ return spy.waitForResult();
+}
+
+static inline QUrl baseUrlSync(QWebEnginePage *page)
+{
+ CallbackSpy<QVariant> spy;
+ page->runJavaScript("document.baseURI", spy.ref());
+ return spy.waitForResult().toUrl();
+}
+
+static inline bool loadSync(QWebEnginePage *page, const QUrl &url, bool ok = true)
+{
+ QSignalSpy spy(page, &QWebEnginePage::loadFinished);
+ page->load(url);
+ return (!spy.empty() || spy.wait(20000)) && (spy.front().value(0).toBool() == ok);
+}
+
+static inline QRect elementGeometry(QWebEnginePage *page, const QString &id)
+{
+ const QString jsCode(
+ "(function() {"
+ " var elem = document.getElementById('" + id + "');"
+ " var rect = elem.getBoundingClientRect();"
+ " return [rect.left, rect.top, rect.width, rect.height];"
+ "})()");
+ QVariantList coords = evaluateJavaScriptSync(page, jsCode).toList();
+
+ if (coords.size() != 4) {
+ qWarning("elementGeometry failed.");
+ return QRect();
+ }
+
+ return QRect(coords[0].toInt(), coords[1].toInt(), coords[2].toInt(), coords[3].toInt());
+}
+
+static inline QPoint elementCenter(QWebEnginePage *page, const QString &id)
+{
+ return elementGeometry(page, id).center();
+}
+
+#define W_QSKIP(a, b) QSKIP(a)
diff --git a/tests/auto/util/widgetutil.h b/tests/auto/util/widgetutil.h
new file mode 100644
index 000000000..67d09ee4f
--- /dev/null
+++ b/tests/auto/util/widgetutil.h
@@ -0,0 +1,28 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+// Functions and macros that really need to be in QTestLib
+
+#include "util.h"
+
+#include <QApplication>
+
+#define W_QTEST_MAIN(TestObject, params) \
+int main(int argc, char *argv[]) \
+{ \
+ QList<const char *> w_argv(argc); \
+ QLatin1String arg("--webEngineArgs"); \
+ for (int i = 0; i < argc; ++i) \
+ w_argv[i] = argv[i]; \
+ w_argv.append(arg.data()); \
+ for (int i = 0; i < params.size(); ++i) \
+ w_argv.append(params[i].data()); \
+ int w_argc = w_argv.size(); \
+ \
+ QApplication app(w_argc, const_cast<char **>(w_argv.data())); \
+ app.setAttribute(Qt::AA_Use96Dpi, true); \
+ QTEST_DISABLE_KEYPAD_NAVIGATION \
+ TestObject tc; \
+ QTEST_SET_MAIN_SOURCE_PATH \
+ return QTest::qExec(&tc, argc, argv); \
+}
diff --git a/tests/auto/widgets/CMakeLists.txt b/tests/auto/widgets/CMakeLists.txt
new file mode 100644
index 000000000..9246be68a
--- /dev/null
+++ b/tests/auto/widgets/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+add_subdirectory(defaultsurfaceformat)
+add_subdirectory(qwebenginepage)
+add_subdirectory(qwebengineprofile)
+add_subdirectory(qwebengineview)
+add_subdirectory(favicon)
+add_subdirectory(loadsignals)
+add_subdirectory(proxy)
+add_subdirectory(proxypac)
+add_subdirectory(schemes)
+add_subdirectory(shutdown)
+add_subdirectory(qwebenginedownloadrequest)
+add_subdirectory(qwebenginehistory)
+add_subdirectory(qwebenginescript)
+if(LINUX)
+ add_subdirectory(offscreen)
+ add_subdirectory(qtbug_110287)
+endif()
+if(NOT MACOS)
+ add_subdirectory(touchinput)
+endif()
+if(QT_FEATURE_accessibility)
+ add_subdirectory(accessibility)
+endif()
+if(QT_FEATURE_webengine_printing_and_pdf)
+ add_subdirectory(printing)
+endif()
+if(QT_FEATURE_webengine_spellchecker AND NOT CMAKE_CROSSCOMPILING AND NOT QT_FEATURE_webengine_native_spellchecker)
+ add_subdirectory(spellchecking)
+endif()
diff --git a/tests/auto/widgets/accessibility/BLACKLIST b/tests/auto/widgets/accessibility/BLACKLIST
new file mode 100644
index 000000000..6fdb0dd58
--- /dev/null
+++ b/tests/auto/widgets/accessibility/BLACKLIST
@@ -0,0 +1,5 @@
+[roles:ax::mojom::Role::kSvgRoot]
+b2qt
+
+[focusChild]
+*
diff --git a/tests/auto/widgets/accessibility/CMakeLists.txt b/tests/auto/widgets/accessibility/CMakeLists.txt
new file mode 100644
index 000000000..f6a08c9d3
--- /dev/null
+++ b/tests/auto/widgets/accessibility/CMakeLists.txt
@@ -0,0 +1,13 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+include(../../util/util.cmake)
+
+qt_internal_add_test(tst_webengine_accessibility
+ SOURCES
+ tst_accessibility.cpp
+ LIBRARIES
+ Qt::WebEngineWidgets
+ Qt::WebEngineCorePrivate
+ Test::Util
+)
diff --git a/tests/auto/widgets/accessibility/accessibility.pro b/tests/auto/widgets/accessibility/accessibility.pro
deleted file mode 100644
index e99c7f493..000000000
--- a/tests/auto/widgets/accessibility/accessibility.pro
+++ /dev/null
@@ -1 +0,0 @@
-include(../tests.pri)
diff --git a/tests/auto/widgets/accessibility/tst_accessibility.cpp b/tests/auto/widgets/accessibility/tst_accessibility.cpp
index 748837c7f..1579b61e2 100644
--- a/tests/auto/widgets/accessibility/tst_accessibility.cpp
+++ b/tests/auto/widgets/accessibility/tst_accessibility.cpp
@@ -17,8 +17,9 @@
Boston, MA 02110-1301, USA.
*/
+#include <QtWebEngineCore/private/qtwebenginecore-config_p.h>
#include <qtest.h>
-#include "../util.h"
+#include <widgetutil.h>
#include <QHBoxLayout>
#include <QMainWindow>
@@ -48,6 +49,9 @@ private Q_SLOTS:
void value();
void roles_data();
void roles();
+ void objectName();
+ void crossTreeParent();
+ void tableCellInterface();
};
// This will be called before the first test function is executed.
@@ -77,11 +81,10 @@ void tst_Accessibility::noPage()
QWebEngineView webView;
webView.show();
- QTest::qWait(1000);
- QAccessibleInterface *view = QAccessible::queryAccessibleInterface(&webView);
- QVERIFY(view);
+ QAccessibleInterface *view = nullptr;
+ QTRY_VERIFY((view = QAccessible::queryAccessibleInterface(&webView)));
QCOMPARE(view->role(), QAccessible::Client);
- QCOMPARE(view->childCount(), 1);
+ QTRY_COMPARE(view->childCount(), 1);
QAccessibleInterface *document = view->child(0);
QCOMPARE(document->role(), QAccessible::WebDocument);
QCOMPARE(document->parent(), view);
@@ -104,7 +107,7 @@ void tst_Accessibility::hierarchy()
QCOMPARE(view->role(), QAccessible::Client);
QCOMPARE(view->childCount(), 1);
// Wait for accessibility to be fully initialized
- QTRY_VERIFY(view->child(0)->childCount() == 1);
+ QTRY_COMPARE(view->child(0)->childCount(), 1);
QAccessibleInterface *document = view->child(0);
QCOMPARE(document->role(), QAccessible::WebDocument);
QCOMPARE(document->parent(), view);
@@ -151,17 +154,17 @@ void tst_Accessibility::hierarchy()
void tst_Accessibility::focusChild_data()
{
QTest::addColumn<QString>("interfaceName");
- QTest::addColumn<QVector<QAccessible::Role>>("ancestorRoles");
+ QTest::addColumn<QList<QAccessible::Role>>("ancestorRoles");
- QTest::newRow("QWebEngineView") << QString("QWebEngineView") << QVector<QAccessible::Role>({QAccessible::Client});
- QTest::newRow("RenderWidgetHostViewQtDelegate") << QString("RenderWidgetHostViewQtDelegate") << QVector<QAccessible::Role>({QAccessible::Client});
- QTest::newRow("QMainWindow") << QString("QMainWindow") << QVector<QAccessible::Role>({QAccessible::Window, QAccessible::Client /* central widget */, QAccessible::Client /* view */});
+ QTest::newRow("QWebEngineView") << QString("QWebEngineView") << QList<QAccessible::Role>({QAccessible::Client});
+ QTest::newRow("RenderWidgetHostViewQtDelegate") << QString("RenderWidgetHostViewQtDelegate") << QList<QAccessible::Role>({QAccessible::Client});
+ QTest::newRow("QMainWindow") << QString("QMainWindow") << QList<QAccessible::Role>({QAccessible::Window, QAccessible::Client /* central widget */, QAccessible::Client /* view */});
}
void tst_Accessibility::focusChild()
{
auto traverseToWebDocumentAccessibleInterface = [](QAccessibleInterface *iface) -> QAccessibleInterface * {
- QFETCH(QVector<QAccessible::Role>, ancestorRoles);
+ QFETCH(QList<QAccessible::Role>, ancestorRoles);
for (int i = 0; i < ancestorRoles.size(); ++i) {
if (iface->childCount() == 0 || iface->role() != ancestorRoles[i])
return nullptr;
@@ -239,7 +242,7 @@ void tst_Accessibility::text()
QAccessibleInterface *view = QAccessible::queryAccessibleInterface(&webView);
// Wait for accessibility to be fully initialized
- QTRY_VERIFY(view->child(0)->childCount() == 5);
+ QTRY_COMPARE(view->child(0)->childCount(), 5);
QAccessibleInterface *document = view->child(0);
QVERIFY(document);
@@ -339,7 +342,7 @@ void tst_Accessibility::roles_data()
QTest::newRow("ax::mojom::Role::kAbbr") << QString("<abbr>a</abbr>") << 1 << QAccessible::StaticText;
QTest::newRow("ax::mojom::Role::kAlert") << QString("<div role='alert'>alert</div>") << 0 << QAccessible::AlertMessage;
QTest::newRow("ax::mojom::Role::kAlertDialog") << QString("<div role='alertdialog'>alert</div>") << 0 << QAccessible::AlertMessage;
- QTest::newRow("ax::mojom::Role::kAnchor") << QString("<a id='a'>Chapter a</a>") << 1 << QAccessible::Link;
+ QTest::newRow("ax::mojom::Role::kAnchor") << QString("<a id='a'>Chapter a</a>") << 1 << QAccessible::Section;
QTest::newRow("ax::mojom::Role::kApplication") << QString("<div role='application'>landmark</div>") << 0 << QAccessible::Document;
QTest::newRow("ax::mojom::Role::kArticle") << QString("<article>a</article>") << 0 << QAccessible::Section;
QTest::newRow("ax::mojom::Role::kAudio") << QString("<audio controls><source src='test.mp3' type='audio/mpeg'></audio>") << 1 << QAccessible::Sound;
@@ -361,7 +364,6 @@ void tst_Accessibility::roles_data()
QTest::newRow("ax::mojom::Role::kTextFieldWithComboBox") << QString("<input role='combobox'>") << 1 << QAccessible::ComboBox;
QTest::newRow("ax::mojom::Role::kComplementary") << QString("<aside>a</aside>") << 0 << QAccessible::ComplementaryContent;
QTest::newRow("ax::mojom::Role::kComment") << QString("<div role='comment'></div>") << 0 << QAccessible::Section;
- QTest::newRow("ax::mojom::Role::kCommenSection") << QString("<div role='commentsection'></div>") << 0 << QAccessible::Section;
QTest::newRow("ax::mojom::Role::kContentDeletion") << QString("<div role='deletion'></div>") << 0 << QAccessible::Grouping;
QTest::newRow("ax::mojom::Role::kContentInsertion") << QString("<div role='insertion'></div>") << 0 << QAccessible::Grouping;
QTest::newRow("ax::mojom::Role::kContentInfo") << QString("<div role='contentinfo'></div>") << 0 << QAccessible::Section;
@@ -402,8 +404,10 @@ void tst_Accessibility::roles_data()
QTest::newRow("ax::mojom::Role::kDocEpilogue") << QString("<div role='doc-epilogue'></div>") << 0 << QAccessible::Section;
QTest::newRow("ax::mojom::Role::kDocErrata") << QString("<div role='doc-errata'></div>") << 0 << QAccessible::Section;
QTest::newRow("ax::mojom::Role::kDocExample") << QString("<div role='doc-example'></div>") << 0 << QAccessible::Section;
+ QTest::newRow("ax::mojom::Role::kDocFooter") << QString("<section role='doc-pagefooter'>a</section>") << 0 << QAccessible::Footer;
QTest::newRow("ax::mojom::Role::kDocForeword") << QString("<div role='doc-foreword'></div>") << 0 << QAccessible::Section;
QTest::newRow("ax::mojom::Role::kDocGlossary") << QString("<div role='doc-glossary'></div>") << 0 << QAccessible::Section;
+ QTest::newRow("ax::mojom::Role::kDocHeader") << QString("<section role='doc-pageheader'>a</section>") << 0 << QAccessible::Heading;
QTest::newRow("ax::mojom::Role::kDocIndex") << QString("<div role='doc-index'></div>") << 0 << QAccessible::Section;
QTest::newRow("ax::mojom::Role::kDocIntroduction") << QString("<div role='doc-introduction'></div>") << 0 << QAccessible::Section;
QTest::newRow("ax::mojom::Role::kDocNotice") << QString("<div role='doc-notice'></div>") << 0 << QAccessible::Section;
@@ -422,9 +426,9 @@ void tst_Accessibility::roles_data()
QTest::newRow("ax::mojom::Role::kFeed") << QString("<div role='feed'>a</div>") << 0 << QAccessible::Section;
QTest::newRow("ax::mojom::Role::kFigcaption") << QString("<figcaption>a</figcaption>") << 0 << QAccessible::Heading;
QTest::newRow("ax::mojom::Role::kFigure") << QString("<figure>a</figure>") << 0 << QAccessible::Section;
- QTest::newRow("ax::mojom::Role::kFooter") << QString("<footer>a</footer>") << 0 << QAccessible::Footer;
+ QTest::newRow("ax::mojom::Role::kFooter") << QString("<footer>a</footer>") << 0 << QAccessible::Section;
QTest::newRow("ax::mojom::Role::kFooterAsNonLandmark") << QString("<article><footer>a</footer><article>") << 1 << QAccessible::Section;
- QTest::newRow("ax::mojom::Role::kForm") << QString("<form></form>") << 0 << QAccessible::Form;
+ QTest::newRow("ax::mojom::Role::kForm") << QString("<form aria-label=Name></form>") << 0 << QAccessible::Form;
QTest::newRow("ax::mojom::Role::kGraphicsDocument") << QString("<div role='graphics-document'></div>") << 0 << QAccessible::Document;
QTest::newRow("ax::mojom::Role::kGraphicsObject") << QString("<div role='graphics-object'></div>") << 0 << QAccessible::Pane;
QTest::newRow("ax::mojom::Role::kGraphicsSymbol") << QString("<div role='graphics-symbol'></div>") << 0 << QAccessible::Graphic;
@@ -462,10 +466,10 @@ void tst_Accessibility::roles_data()
QTest::newRow("ax::mojom::Role::kMath") << QString("<math>a</math>") << 1 << QAccessible::Equation;
QTest::newRow("ax::mojom::Role::kMenu") << QString("<div role='menu'>a</div>") << 0 << QAccessible::PopupMenu;
QTest::newRow("ax::mojom::Role::kMenuBar") << QString("<div role='menubar'>a</div>") << 0 << QAccessible::MenuBar;
- QTest::newRow("ax::mojom::Role::kMenuItem") << QString("<menu role='menu'><input type='button' /></menu>") << 1 << QAccessible::MenuItem;
+ QTest::newRow("ax::mojom::Role::kMenuItem") << QString("<menu role='group'><div role='menuitem'>a</div></menu>") << 1 << QAccessible::MenuItem;
QTest::newRow("ax::mojom::Role::kMenuItemCheckBox") << QString("<menu role='menu'><input type='checkbox'></input></menu>") << 1 << QAccessible::CheckBox;
QTest::newRow("ax::mojom::Role::kMenuItemRadio") << QString("<menu role='menu'><input type='radio'></input></menu>") << 1 << QAccessible::RadioButton;
- QTest::newRow("ax::mojom::Role::kMenuButton") << QString("<menu role='group'><div role='menuitem'>a</div></menu>") << 1 << QAccessible::MenuItem;
+ QTest::newRow("ax::mojom::Role::kMenuButton") << QString("<menu role='menu'><input type='button' /></menu>") << 1 << QAccessible::Button;
QTest::newRow("ax::mojom::Role::kMenuListOption") << QString("<select role='menu'><option>a</option></select>") << 3 << QAccessible::MenuItem;
QTest::newRow("ax::mojom::Role::kMenuListPopup") << QString("<select role='menu'><option>a</option></select>") << 2 << QAccessible::PopupMenu;
QTest::newRow("ax::mojom::Role::kMeter") << QString("<meter>a</meter>") << 1 << QAccessible::Chart;
@@ -473,19 +477,18 @@ void tst_Accessibility::roles_data()
QTest::newRow("ax::mojom::Role::kNote") << QString("<div role='note'>a</div>") << 0 << QAccessible::Note;
//QTest::newRow("ax::mojom::Role::kPane"); // No mapping to ARIA role
QTest::newRow("ax::mojom::Role::kParagraph") << QString("<p>a</p>") << 0 << QAccessible::Paragraph;
- QTest::newRow("ax::mojom::Role::kPopUpButton") << QString("<select><option>a</option></select>") << 1 << QAccessible::ComboBox;
+ QTest::newRow("ax::mojom::Role::kPopUpButton") << QString("<select><option>a</option></select>") << 1 << QAccessible::PopupMenu;
QTest::newRow("ax::mojom::Role::kPre") << QString("<pre>a</pre>") << 0 << QAccessible::Section;
//QTest::newRow("ax::mojom::Role::kPresentational") << QString("<div role='presentation'>a</div>") << 0 << QAccessible::NoRole; // FIXME: Aria role 'presentation' should work
QTest::newRow("ax::mojom::Role::kProgressIndicator") << QString("<div role='progressbar' aria-valuenow='77' aria-valuemin='22' aria-valuemax='99'></div>") << 0 << QAccessible::ProgressBar;
QTest::newRow("ax::mojom::Role::kRadioButton") << QString("<input type='radio'></input>") << 1 << QAccessible::RadioButton;
QTest::newRow("ax::mojom::Role::kRadioGroup") << QString("<fieldset role='radiogroup'></fieldset>") << 0 << QAccessible::Grouping;
QTest::newRow("ax::mojom::Role::kRegion") << QString("<div role='region'>a</div>") << 0 << QAccessible::Section;
- QTest::newRow("ax::mojom::Role::kRevision") << QString("<div role='revision'></div>") << 0 << QAccessible::Section;
QTest::newRow("ax::mojom::Role::kRow") << QString("<table role=table><tr><td>a</td></tr></table>") << 1 << QAccessible::Row;
QTest::newRow("ax::mojom::Role::kRowGroup") << QString("<table role=table><tbody role=rowgroup><tr><td>a</td></tr></tbody></table>") << 1 << QAccessible::Section;
QTest::newRow("ax::mojom::Role::kRowHeader") << QString("<table role=table><tr><th>a</td><td>b</td></tr></table>") << 2 << QAccessible::RowHeader;
- QTest::newRow("ax::mojom::Role::kRuby") << QString("<ruby>a</ruby>") << 1 << QAccessible::StaticText;
- QTest::newRow("ax::mojom::Role::kRubyAnnotation") << QString("<ruby><rt>a</rt></ruby>") << 2 << QAccessible::StaticText;
+ QTest::newRow("ax::mojom::Role::kRuby") << QString("<ruby>a</ruby>") << 1 << QAccessible::Grouping;
+ //QTest::newRow("ax::mojom::Role::kRubyAnnotation") // No mapping to ARIA role (presents as property on enclosing ruby element)
QTest::newRow("ax::mojom::Role::kScrollBar") << QString("<div role='scrollbar'>a</a>") << 0 << QAccessible::ScrollBar;
//QTest::newRow("ax::mojom::Role::kScrollView"); // No mapping to ARIA role
QTest::newRow("ax::mojom::Role::kSearch") << QString("<div role='search'>landmark</div>") << 0 << QAccessible::Section;
@@ -499,7 +502,7 @@ void tst_Accessibility::roles_data()
QTest::newRow("ax::mojom::Role::kStatus") << QString("<output>a</output>") << 1 << QAccessible::Indicator;
QTest::newRow("ax::mojom::Role::kStrong") << QString("<strong>a</strong>") << 1 << QAccessible::StaticText;
QTest::newRow("ax::mojom::Role::kSuggestion") << QString("<div role='suggestion'></div>") << 0 << QAccessible::Section;
- QTest::newRow("ax::mojom::Role::kSvgRoot") << QString("<svg width='10' height='10'></svg>") << 1 << QAccessible::Graphic;
+ QTest::newRow("ax::mojom::Role::kSvgRoot") << QString("<svg width='10' height='10'><text font-size='10'>SVG</text></svg>") << 1 << QAccessible::WebDocument;
QTest::newRow("ax::mojom::Role::kSwitch") << QString("<button aria-checked='false'>a</button>") << 1 << QAccessible::Button;
QTest::newRow("ax::mojom::Role::kTable") << QString("<table role=table><td>a</td></table>") << 0 << QAccessible::Table;
//QTest::newRow("ax::mojom::Role::kTableHeaderContainer"); // No mapping to ARIA role
@@ -528,10 +531,10 @@ void tst_Accessibility::roles()
QFETCH(QAccessible::Role, role);
QWebEngineView webView;
+ QSignalSpy spyFinished(&webView, &QWebEngineView::loadFinished);
webView.setHtml("<html><body>" + html + "</body></html>");
webView.show();
- QSignalSpy spyFinished(&webView, &QWebEngineView::loadFinished);
- QVERIFY(spyFinished.wait());
+ QTRY_COMPARE_WITH_TIMEOUT(spyFinished.size(), 1, 20000);
QAccessibleInterface *view = QAccessible::queryAccessibleInterface(&webView);
@@ -541,7 +544,7 @@ void tst_Accessibility::roles()
return;
}
- QTRY_COMPARE(view->child(0)->childCount(), 1);
+ QTRY_COMPARE_WITH_TIMEOUT(view->child(0)->childCount(), 1, 20000);
QAccessibleInterface *document = view->child(0);
QAccessibleInterface *element = document->child(0);
@@ -553,9 +556,116 @@ void tst_Accessibility::roles()
QCOMPARE(element->role(), role);
}
+void tst_Accessibility::objectName()
+{
+ QWebEngineView webView;
+ QSignalSpy spyFinished(&webView, &QWebEngineView::loadFinished);
+ webView.setHtml("<html><body><p id='my_id'></p></body></html>");
+ webView.show();
+ QVERIFY(spyFinished.wait());
+ QAccessibleInterface *view = QAccessible::queryAccessibleInterface(&webView);
+ QAccessibleInterface *document = view->child(0);
+ QTRY_COMPARE(document->childCount(), 1);
+ QAccessibleInterface *p = document->child(0);
+ QVERIFY(p);
+ QVERIFY(p->object());
+ QCOMPARE(p->role(), QAccessible::Paragraph);
+ QCOMPARE(p->object()->objectName(), QStringLiteral("my_id"));
+}
+
+void tst_Accessibility::crossTreeParent()
+{
+ QWebEngineView webView;
+ QSignalSpy spyFinished(&webView, &QWebEngineView::loadFinished);
+ webView.setHtml("<html><body><iframe src='data:text/html,<html><body><p id=my_id></p></body></html>'>Fallback text</iframe></body></html>");
+ webView.show();
+ QVERIFY(spyFinished.wait());
+ QAccessibleInterface *view = QAccessible::queryAccessibleInterface(&webView);
+ QAccessibleInterface *document = view->child(0);
+ QCOMPARE(document->role(), QAccessible::WebDocument);
+ QTRY_COMPARE(document->childCount(), 1);
+ QAccessibleInterface *p = document->child(0);
+ QVERIFY(p);
+ QCOMPARE(p->parent(), document);
+ p = p->child(0);
+ QVERIFY(p);
+ QCOMPARE(p->role(), QAccessible::WebDocument);
+ QCOMPARE(p->parent()->parent(), document);
+ QTRY_COMPARE(p->childCount(), 1);
+ p = p->child(0);
+ QVERIFY(p);
+ QAccessibleInterface *subdocument = p;
+ QCOMPARE(p->role(), QAccessible::WebDocument);
+ QCOMPARE(p->parent()->parent()->parent(), document);
+ p = p->child(0);
+ QVERIFY(p);
+ QVERIFY(p->object());
+ QCOMPARE(p->role(), QAccessible::Paragraph);
+ QCOMPARE(p->parent(), subdocument);
+ QCOMPARE(p->parent()->parent()->parent()->parent(), document);
+ QCOMPARE(p->parent()->parent()->parent()->parent()->parent(), view);
+ QCOMPARE(p->object()->objectName(), QStringLiteral("my_id"));
+}
+
+void tst_Accessibility::tableCellInterface()
+{
+ QWebEngineView webView;
+ webView.resize(400, 400);
+ webView.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&webView));
+
+ QSignalSpy spyFinished(&webView, &QWebEngineView::loadFinished);
+ webView.setHtml(QLatin1String(
+ "<html><body>"
+ " <ul>"
+ " <li><a href='#link1' id='link1'>Link in ListItem</a></li>"
+ " </ul>"
+ ""
+ " <div role='rowgroup'>"
+ " <div role='row'>"
+ " <span role='cell'><a href='#link2' id='link2'>Link in Cell</a></span>"
+ " </div>"
+ " </div>"
+ "</body></html>"));
+ QTRY_COMPARE(spyFinished.size(), 1);
+
+ QAccessibleInterface *view = QAccessible::queryAccessibleInterface(&webView);
+ QAccessibleInterface *document = view->child(0);
+ QTRY_COMPARE(document->childCount(), 2);
+
+ // ListItem without Table parent.
+ {
+ QAccessibleInterface *list = document->child(0);
+ QAccessibleInterface *listItem = list->child(0);
+ QVERIFY(!listItem->tableCellInterface());
+
+ // Should not crash.
+ QPoint linkCenter = elementCenter(webView.page(), QLatin1String("link1"));
+ QTest::mouseClick(webView.focusProxy(), Qt::LeftButton, {}, linkCenter);
+ QTRY_COMPARE(webView.url().fragment(), QLatin1String("link1"));
+ }
+
+ // Cell without Table parent.
+ {
+ QAccessibleInterface *rowgroup = document->child(1);
+ QAccessibleInterface *row = rowgroup->child(0);
+ QAccessibleInterface *cell = row->child(0);
+ QVERIFY(!cell->tableCellInterface());
+
+ // Should not crash.
+ QPoint linkCenter = elementCenter(webView.page(), QLatin1String("link2"));
+ QTest::mouseClick(webView.focusProxy(), Qt::LeftButton, {}, linkCenter);
+ QTRY_COMPARE(webView.url().fragment(), QLatin1String("link2"));
+ }
+}
+
static QByteArrayList params = QByteArrayList()
<< "--force-renderer-accessibility"
- << "--enable-features=AccessibilityExposeARIAAnnotations";
+ << "--enable-features=AccessibilityExposeARIAAnnotations"
+#if QT_CONFIG(webengine_embedded_build)
+ << "--disable-features=TimedHTMLParserBudget"
+#endif
+ ;
W_QTEST_MAIN(tst_Accessibility, params)
#include "tst_accessibility.moc"
diff --git a/tests/auto/widgets/certificateerror/certificateerror.pro b/tests/auto/widgets/certificateerror/certificateerror.pro
deleted file mode 100644
index 73ba7515b..000000000
--- a/tests/auto/widgets/certificateerror/certificateerror.pro
+++ /dev/null
@@ -1,3 +0,0 @@
-include(../tests.pri)
-include(../../shared/https.pri)
-QT *= core-private
diff --git a/tests/auto/widgets/certificateerror/tst_certificateerror.cpp b/tests/auto/widgets/certificateerror/tst_certificateerror.cpp
deleted file mode 100644
index f11d9236c..000000000
--- a/tests/auto/widgets/certificateerror/tst_certificateerror.cpp
+++ /dev/null
@@ -1,124 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include <httpsserver.h>
-#include <util.h>
-
-#include <QWebEngineCertificateError>
-#include <QWebEnginePage>
-#include <QWebEngineSettings>
-
-#include <QtTest/QtTest>
-
-class tst_CertificateError : public QObject
-{
- Q_OBJECT
-public:
- tst_CertificateError() { }
-
-private Q_SLOTS:
- void handleError_data();
- void handleError();
-};
-
-struct PageWithCertificateErrorHandler : QWebEnginePage
-{
- PageWithCertificateErrorHandler(bool defer, bool accept, QObject *p = nullptr)
- : QWebEnginePage(p), deferError(defer), acceptCertificate(accept)
- , loadSpy(this, &QWebEnginePage::loadFinished) {
- }
-
- bool deferError, acceptCertificate;
-
- QSignalSpy loadSpy;
- QScopedPointer<QWebEngineCertificateError> error;
-
- bool certificateError(const QWebEngineCertificateError &e) override {
- error.reset(new QWebEngineCertificateError(e));
- if (deferError)
- error->defer();
- return acceptCertificate;
- }
-};
-
-void tst_CertificateError::handleError_data()
-{
- QTest::addColumn<bool>("deferError");
- QTest::addColumn<bool>("acceptCertificate");
- QTest::addColumn<QString>("expectedContent");
- QTest::addRow("Reject") << false << false << QString();
- QTest::addRow("DeferReject") << true << false << QString();
- QTest::addRow("DeferAccept") << true << true << "TEST";
-}
-
-void tst_CertificateError::handleError()
-{
- HttpsServer server;
- server.setExpectError(true);
- QVERIFY(server.start());
-
- connect(&server, &HttpsServer::newRequest, [&] (HttpReqRep *rr) {
- rr->setResponseBody(QByteArrayLiteral("<html><body>TEST</body></html>"));
- rr->sendResponse();
- });
-
- QFETCH(bool, deferError);
- QFETCH(bool, acceptCertificate);
- QFETCH(QString, expectedContent);
-
- PageWithCertificateErrorHandler page(deferError, acceptCertificate);
- page.settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, false);
-
- page.setUrl(server.url());
- QTRY_VERIFY(page.error);
- QVERIFY(page.error->isOverridable());
- auto chain = page.error->certificateChain();
- QCOMPARE(chain.size(), 2);
- QCOMPARE(chain[0].serialNumber(), "3b:dd:1a:b7:2f:40:32:3b:c1:bf:37:d4:86:bd:56:c1:d0:6b:2a:43");
- QCOMPARE(chain[1].serialNumber(), "6d:52:fb:b4:57:3b:b2:03:c8:62:7b:7e:44:45:5c:d3:08:87:74:17");
-
- if (deferError) {
- QVERIFY(page.error->deferred());
- QVERIFY(!page.error->answered());
- QCOMPARE(page.loadSpy.count(), 0);
- QCOMPARE(toPlainTextSync(&page), QString());
-
- if (acceptCertificate)
- page.error->ignoreCertificateError();
- else
- page.error->rejectCertificate();
-
- QVERIFY(page.error->answered());
- page.error.reset();
- }
- QTRY_COMPARE_WITH_TIMEOUT(page.loadSpy.count(), 1, 30000);
- QCOMPARE(page.loadSpy.takeFirst().value(0).toBool(), acceptCertificate);
- QCOMPARE(toPlainTextSync(&page), expectedContent);
-}
-
-QTEST_MAIN(tst_CertificateError)
-#include <tst_certificateerror.moc>
diff --git a/tests/auto/widgets/defaultsurfaceformat/CMakeLists.txt b/tests/auto/widgets/defaultsurfaceformat/CMakeLists.txt
new file mode 100644
index 000000000..d95c1355b
--- /dev/null
+++ b/tests/auto/widgets/defaultsurfaceformat/CMakeLists.txt
@@ -0,0 +1,23 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+include(../../util/util.cmake)
+
+qt_internal_add_test(tst_defaultsurfaceformat
+ SOURCES
+ tst_defaultsurfaceformat.cpp
+ LIBRARIES
+ Qt::WebEngineWidgets
+ Test::Util
+)
+
+set(tst_defaultsurfaceformat_resource_files
+ "resources/index.html"
+)
+
+qt_internal_add_resource(tst_defaultsurfaceformat "tst_defaultsurfaceformat"
+ PREFIX
+ "/"
+ FILES
+ ${tst_defaultsurfaceformat_resource_files}
+)
diff --git a/tests/auto/widgets/defaultsurfaceformat/defaultsurfaceformat.pro b/tests/auto/widgets/defaultsurfaceformat/defaultsurfaceformat.pro
deleted file mode 100644
index e99c7f493..000000000
--- a/tests/auto/widgets/defaultsurfaceformat/defaultsurfaceformat.pro
+++ /dev/null
@@ -1 +0,0 @@
-include(../tests.pri)
diff --git a/tests/auto/widgets/defaultsurfaceformat/tst_defaultsurfaceformat.cpp b/tests/auto/widgets/defaultsurfaceformat/tst_defaultsurfaceformat.cpp
index 697ed3d08..c53f6f5b3 100644
--- a/tests/auto/widgets/defaultsurfaceformat/tst_defaultsurfaceformat.cpp
+++ b/tests/auto/widgets/defaultsurfaceformat/tst_defaultsurfaceformat.cpp
@@ -1,33 +1,8 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include <qtest.h>
-#include "../util.h"
+#include <util.h>
#include <QSurfaceFormat>
#include <QTimer>
diff --git a/tests/auto/widgets/defaultsurfaceformat/tst_defaultsurfaceformat.qrc b/tests/auto/widgets/defaultsurfaceformat/tst_defaultsurfaceformat.qrc
deleted file mode 100644
index 3d5f1b3b2..000000000
--- a/tests/auto/widgets/defaultsurfaceformat/tst_defaultsurfaceformat.qrc
+++ /dev/null
@@ -1,5 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
-<qresource>
- <file>resources/index.html</file>
-</qresource>
-</RCC>
diff --git a/tests/auto/widgets/devtools/devtools.pro b/tests/auto/widgets/devtools/devtools.pro
deleted file mode 100644
index e99c7f493..000000000
--- a/tests/auto/widgets/devtools/devtools.pro
+++ /dev/null
@@ -1 +0,0 @@
-include(../tests.pri)
diff --git a/tests/auto/widgets/devtools/tst_devtools.cpp b/tests/auto/widgets/devtools/tst_devtools.cpp
deleted file mode 100644
index 3026b3931..000000000
--- a/tests/auto/widgets/devtools/tst_devtools.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtTest/QtTest>
-
-#include <qwebenginepage.h>
-
-class tst_DevTools : public QObject {
- Q_OBJECT
-
-private Q_SLOTS:
- void attachAndDestroyPageFirst();
- void attachAndDestroyInspectorFirst();
-};
-
-void tst_DevTools::attachAndDestroyPageFirst()
-{
- // External inspector + manual destruction of page first
- QWebEnginePage* page = new QWebEnginePage();
- QWebEnginePage* inspector = new QWebEnginePage();
-
- QSignalSpy spy(page, &QWebEnginePage::loadFinished);
- page->load(QUrl("data:text/plain,foobarbaz"));
- QTRY_COMPARE_WITH_TIMEOUT(spy.count(), 1, 12000);
-
- inspector->setInspectedPage(page);
- page->triggerAction(QWebEnginePage::InspectElement);
-
- // This is deliberately racy:
- QTest::qWait(10);
-
- delete page;
- delete inspector;
-}
-
-void tst_DevTools::attachAndDestroyInspectorFirst()
-{
- // External inspector + manual destruction of inspector first
- QWebEnginePage* page = new QWebEnginePage();
- QWebEnginePage* inspector = new QWebEnginePage();
- inspector->setInspectedPage(page);
-
- QSignalSpy spy(page, &QWebEnginePage::loadFinished);
- page->setHtml(QStringLiteral("<body><h1>FOO BAR!</h1></body>"));
- QTRY_COMPARE_WITH_TIMEOUT(spy.count(), 1, 12000);
-
- page->triggerAction(QWebEnginePage::InspectElement);
-
- delete inspector;
-
- page->triggerAction(QWebEnginePage::InspectElement);
-
- // This is deliberately racy:
- QTest::qWait(10);
-
- delete page;
-}
-
-
-QTEST_MAIN(tst_DevTools)
-
-#include "tst_devtools.moc"
diff --git a/tests/auto/widgets/favicon/CMakeLists.txt b/tests/auto/widgets/favicon/CMakeLists.txt
new file mode 100644
index 000000000..0deae6a37
--- /dev/null
+++ b/tests/auto/widgets/favicon/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+include(../../util/util.cmake)
+
+qt_internal_add_test(tst_favicon
+ SOURCES
+ tst_favicon.cpp
+ LIBRARIES
+ Qt::WebEngineWidgets
+ Test::Util
+)
+
+set(tst_favicon_resource_files
+ "resources/favicon-misc.html"
+ "resources/favicon-multi.html"
+ "resources/favicon-shortcut.html"
+ "resources/favicon-single.html"
+ "resources/favicon-touch.html"
+ "resources/favicon-unavailable.html"
+ "resources/icons/qt144.png"
+ "resources/icons/qt32.ico"
+ "resources/icons/qtmulti.ico"
+ "resources/test1.html"
+)
+
+qt_internal_add_resource(tst_favicon "tst_favicon"
+ PREFIX
+ "/"
+ FILES
+ ${tst_favicon_resource_files}
+)
diff --git a/tests/auto/widgets/favicon/resources/favicon-misc.html b/tests/auto/widgets/favicon/resources/favicon-misc.html
new file mode 100644
index 000000000..ea587886f
--- /dev/null
+++ b/tests/auto/widgets/favicon/resources/favicon-misc.html
@@ -0,0 +1,11 @@
+<html>
+ <head>
+ <title>Favicon Test</title>
+ <link rel="shortcut icon" href="icons/qt32.ico" sizes="32x32" />
+ <link rel="apple-touch-icon" href="icons/qt144.png" sizes="144x144" />
+ <link rel="shortcut icon" href="icons/unavailable.ico" />
+ </head>
+ <body>
+ <h1>Favicon Test</h1>
+ </body>
+</html>
diff --git a/tests/auto/widgets/favicon/resources/favicon-multi.html b/tests/auto/widgets/favicon/resources/favicon-multi.html
new file mode 100644
index 000000000..56eeca8c4
--- /dev/null
+++ b/tests/auto/widgets/favicon/resources/favicon-multi.html
@@ -0,0 +1,9 @@
+<html>
+ <head>
+ <title>Multi-sized Favicon Test</title>
+ <link rel="shortcut icon" sizes="16x16 32x32 64x64" href="icons/qtmulti.ico" />
+ </head>
+ <body>
+ <h1>Multi-sized Favicon Test</h1>
+ </body>
+</html>
diff --git a/tests/auto/widgets/faviconmanager/resources/favicon-shortcut.html b/tests/auto/widgets/favicon/resources/favicon-shortcut.html
index 786cdb816..786cdb816 100644
--- a/tests/auto/widgets/faviconmanager/resources/favicon-shortcut.html
+++ b/tests/auto/widgets/favicon/resources/favicon-shortcut.html
diff --git a/tests/auto/widgets/faviconmanager/resources/favicon-single.html b/tests/auto/widgets/favicon/resources/favicon-single.html
index eb4675c75..eb4675c75 100644
--- a/tests/auto/widgets/faviconmanager/resources/favicon-single.html
+++ b/tests/auto/widgets/favicon/resources/favicon-single.html
diff --git a/tests/auto/widgets/faviconmanager/resources/favicon-touch.html b/tests/auto/widgets/favicon/resources/favicon-touch.html
index 271783434..271783434 100644
--- a/tests/auto/widgets/faviconmanager/resources/favicon-touch.html
+++ b/tests/auto/widgets/favicon/resources/favicon-touch.html
diff --git a/tests/auto/widgets/faviconmanager/resources/favicon-unavailable.html b/tests/auto/widgets/favicon/resources/favicon-unavailable.html
index c45664294..c45664294 100644
--- a/tests/auto/widgets/faviconmanager/resources/favicon-unavailable.html
+++ b/tests/auto/widgets/favicon/resources/favicon-unavailable.html
diff --git a/tests/auto/widgets/faviconmanager/resources/icons/qt144.png b/tests/auto/widgets/favicon/resources/icons/qt144.png
index 050b1e066..050b1e066 100644
--- a/tests/auto/widgets/faviconmanager/resources/icons/qt144.png
+++ b/tests/auto/widgets/favicon/resources/icons/qt144.png
Binary files differ
diff --git a/tests/auto/widgets/faviconmanager/resources/icons/qt32.ico b/tests/auto/widgets/favicon/resources/icons/qt32.ico
index 2f6fcb5bc..2f6fcb5bc 100644
--- a/tests/auto/widgets/faviconmanager/resources/icons/qt32.ico
+++ b/tests/auto/widgets/favicon/resources/icons/qt32.ico
Binary files differ
diff --git a/tests/auto/widgets/faviconmanager/resources/icons/qtmulti.ico b/tests/auto/widgets/favicon/resources/icons/qtmulti.ico
index 81e5a22e8..81e5a22e8 100644
--- a/tests/auto/widgets/faviconmanager/resources/icons/qtmulti.ico
+++ b/tests/auto/widgets/favicon/resources/icons/qtmulti.ico
Binary files differ
diff --git a/tests/auto/widgets/faviconmanager/resources/test1.html b/tests/auto/widgets/favicon/resources/test1.html
index b323f966e..b323f966e 100644
--- a/tests/auto/widgets/faviconmanager/resources/test1.html
+++ b/tests/auto/widgets/favicon/resources/test1.html
diff --git a/tests/auto/widgets/favicon/tst_favicon.cpp b/tests/auto/widgets/favicon/tst_favicon.cpp
new file mode 100644
index 000000000..c70aa1182
--- /dev/null
+++ b/tests/auto/widgets/favicon/tst_favicon.cpp
@@ -0,0 +1,869 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#include <QtTest/QtTest>
+#include <util.h>
+
+#include <QWebEngineHistory>
+#include <QWebEnginePage>
+#include <QWebEngineProfile>
+#include <QWebEngineSettings>
+#include <QWebEngineView>
+
+class tst_Favicon : public QObject
+{
+ Q_OBJECT
+
+public Q_SLOTS:
+ void init();
+ void initTestCase();
+ void cleanupTestCase();
+ void cleanup();
+
+private Q_SLOTS:
+ void faviconLoad();
+ void faviconLoadFromResources();
+ void faviconLoadEncodedUrl();
+ void faviconLoadAfterHistoryNavigation();
+ void faviconLoadPushState();
+ void noFavicon();
+ void aboutBlank();
+ void unavailableFavicon();
+ void errorPageEnabled();
+ void errorPageDisabled();
+ void touchIcon();
+ void multiIcon();
+ void downloadIconsDisabled_data();
+ void downloadIconsDisabled();
+ void downloadTouchIconsEnabled_data();
+ void downloadTouchIconsEnabled();
+ void dynamicFavicon();
+ void touchIconWithSameURL();
+
+ void iconDatabaseOTR();
+ void requestIconForIconURL_data();
+ void requestIconForIconURL();
+ void requestIconForPageURL_data();
+ void requestIconForPageURL();
+ void desiredSize();
+
+private:
+ QWebEngineView *m_view;
+ QWebEnginePage *m_page;
+ QWebEngineProfile *m_profile;
+};
+
+void tst_Favicon::init()
+{
+ m_profile = new QWebEngineProfile(this);
+ m_view = new QWebEngineView();
+ m_page = new QWebEnginePage(m_profile, m_view);
+ m_view->setPage(m_page);
+}
+
+void tst_Favicon::initTestCase() { }
+
+void tst_Favicon::cleanupTestCase() { }
+
+void tst_Favicon::cleanup()
+{
+ delete m_view;
+ delete m_profile;
+}
+
+void tst_Favicon::faviconLoad()
+{
+ if (!QDir(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()).exists())
+ W_QSKIP(QString("This test requires access to resources found in '%1'")
+ .arg(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath())
+ .toLatin1()
+ .constData(),
+ SkipAll);
+
+ QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
+ QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
+ QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
+
+ QUrl url = QUrl::fromLocalFile(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + QLatin1String("/resources/favicon-single.html"));
+ m_page->load(url);
+
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size(), 1, 30000);
+ QTRY_COMPARE(iconUrlChangedSpy.size(), 1);
+ QTRY_COMPARE(iconChangedSpy.size(), 1);
+
+ QUrl iconUrl = iconUrlChangedSpy.at(0).at(0).toString();
+ QCOMPARE(iconUrl, m_page->iconUrl());
+ QCOMPARE(iconUrl,
+ QUrl::fromLocalFile(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + QLatin1String("/resources/icons/qt32.ico")));
+
+ const QIcon &icon = m_page->icon();
+ QVERIFY(!icon.isNull());
+
+ QCOMPARE(icon.availableSizes().size(), 2);
+ QVERIFY(icon.availableSizes().contains(QSize(16, 16)));
+ QVERIFY(icon.availableSizes().contains(QSize(32, 32)));
+}
+
+void tst_Favicon::faviconLoadFromResources()
+{
+ QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
+ QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
+ QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
+
+ QUrl url("qrc:/resources/favicon-single.html");
+ m_page->load(url);
+
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size(), 1, 30000);
+ QTRY_COMPARE(iconUrlChangedSpy.size(), 1);
+ QTRY_COMPARE(iconChangedSpy.size(), 1);
+
+ QUrl iconUrl = iconUrlChangedSpy.at(0).at(0).toString();
+ QCOMPARE(iconUrl, m_page->iconUrl());
+ QCOMPARE(iconUrl, QUrl("qrc:/resources/icons/qt32.ico"));
+
+ const QIcon &icon = m_page->icon();
+ QVERIFY(!icon.isNull());
+
+ QCOMPARE(icon.availableSizes().size(), 2);
+ QVERIFY(icon.availableSizes().contains(QSize(16, 16)));
+ QVERIFY(icon.availableSizes().contains(QSize(32, 32)));
+}
+
+void tst_Favicon::faviconLoadEncodedUrl()
+{
+ if (!QDir(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()).exists())
+ W_QSKIP(QString("This test requires access to resources found in '%1'")
+ .arg(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath())
+ .toLatin1()
+ .constData(),
+ SkipAll);
+
+ QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
+ QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
+ QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
+
+ QString urlString = QUrl::fromLocalFile(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + QLatin1String("/resources/favicon-single.html"))
+ .toString();
+ QUrl url(urlString + QLatin1String("?favicon=load should work with#whitespace!"));
+ m_page->load(url);
+
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size(), 1, 30000);
+ QTRY_COMPARE(iconUrlChangedSpy.size(), 1);
+ QTRY_COMPARE(iconChangedSpy.size(), 1);
+
+ QUrl iconUrl = iconUrlChangedSpy.at(0).at(0).toString();
+ QCOMPARE(m_page->iconUrl(), iconUrl);
+ QCOMPARE(iconUrl,
+ QUrl::fromLocalFile(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + QLatin1String("/resources/icons/qt32.ico")));
+
+ const QIcon &icon = m_page->icon();
+ QVERIFY(!icon.isNull());
+
+ QCOMPARE(icon.availableSizes().size(), 2);
+ QVERIFY(icon.availableSizes().contains(QSize(16, 16)));
+ QVERIFY(icon.availableSizes().contains(QSize(32, 32)));
+}
+
+void tst_Favicon::faviconLoadAfterHistoryNavigation()
+{
+ QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
+ QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
+ QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
+
+ m_page->load(QUrl("qrc:/resources/favicon-single.html"));
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size(), 1, 30000);
+ QTRY_COMPARE(iconUrlChangedSpy.size(), 1);
+ QTRY_COMPARE(iconChangedSpy.size(), 1);
+ QCOMPARE(m_page->iconUrl(), QUrl("qrc:/resources/icons/qt32.ico"));
+
+ m_page->load(QUrl("qrc:/resources/favicon-multi.html"));
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size(), 2, 30000);
+ QTRY_COMPARE(iconUrlChangedSpy.size(), 3);
+ QTRY_COMPARE(iconChangedSpy.size(), 3);
+ QCOMPARE(m_page->iconUrl(), QUrl("qrc:/resources/icons/qtmulti.ico"));
+
+ m_page->triggerAction(QWebEnginePage::Back);
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size(), 3, 30000);
+ QTRY_COMPARE(iconUrlChangedSpy.size(), 5);
+ QTRY_COMPARE(iconChangedSpy.size(), 5);
+ QCOMPARE(m_page->iconUrl(), QUrl("qrc:/resources/icons/qt32.ico"));
+
+ m_page->triggerAction(QWebEnginePage::Forward);
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size(), 4, 30000);
+ QTRY_COMPARE(iconUrlChangedSpy.size(), 7);
+ QTRY_COMPARE(iconChangedSpy.size(), 7);
+ QCOMPARE(m_page->iconUrl(), QUrl("qrc:/resources/icons/qtmulti.ico"));
+}
+
+void tst_Favicon::faviconLoadPushState()
+{
+ QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
+ QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
+ QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
+
+ QUrl url("qrc:/resources/favicon-single.html");
+ m_page->load(url);
+
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size(), 1, 30000);
+ QTRY_COMPARE(iconUrlChangedSpy.size(), 1);
+ QTRY_COMPARE(iconChangedSpy.size(), 1);
+
+ QUrl iconUrl = iconUrlChangedSpy.at(0).at(0).toString();
+ QCOMPARE(iconUrl, m_page->iconUrl());
+ QCOMPARE(iconUrl, QUrl("qrc:/resources/icons/qt32.ico"));
+
+ const QIcon &icon = m_page->icon();
+ QVERIFY(!icon.isNull());
+
+ iconUrlChangedSpy.clear();
+ iconChangedSpy.clear();
+
+ // pushState() is a same document navigation and should not reset or
+ // update favicon.
+ QCOMPARE(m_page->history()->count(), 1);
+ evaluateJavaScriptSync(m_page, "history.pushState('', '')");
+ QTRY_COMPARE(m_page->history()->count(), 2);
+
+ // Favicon change is not expected.
+ QCOMPARE(iconUrlChangedSpy.size(), 0);
+ QCOMPARE(iconChangedSpy.size(), 0);
+ QCOMPARE(m_page->iconUrl(), QUrl("qrc:/resources/icons/qt32.ico"));
+}
+
+void tst_Favicon::noFavicon()
+{
+ if (!QDir(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()).exists())
+ W_QSKIP(QString("This test requires access to resources found in '%1'")
+ .arg(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath())
+ .toLatin1()
+ .constData(),
+ SkipAll);
+
+ QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
+ QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
+ QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
+
+ QUrl url = QUrl::fromLocalFile(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + QLatin1String("/resources/test1.html"));
+ m_page->load(url);
+
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size(), 1, 30000);
+ QCOMPARE(iconUrlChangedSpy.size(), 0);
+ QCOMPARE(iconChangedSpy.size(), 0);
+
+ QVERIFY(m_page->iconUrl().isEmpty());
+ QVERIFY(m_page->icon().isNull());
+}
+
+void tst_Favicon::aboutBlank()
+{
+ QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
+ QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
+ QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
+
+ QUrl url("about:blank");
+ m_page->load(url);
+
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size(), 1, 30000);
+ QCOMPARE(iconUrlChangedSpy.size(), 0);
+ QCOMPARE(iconChangedSpy.size(), 0);
+
+ QVERIFY(m_page->iconUrl().isEmpty());
+ QVERIFY(m_page->icon().isNull());
+}
+
+void tst_Favicon::unavailableFavicon()
+{
+ if (!QDir(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()).exists())
+ W_QSKIP(QString("This test requires access to resources found in '%1'")
+ .arg(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath())
+ .toLatin1()
+ .constData(),
+ SkipAll);
+
+ QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
+ QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
+ QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
+
+ QUrl url = QUrl::fromLocalFile(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + QLatin1String("/resources/favicon-unavailable.html"));
+ m_page->load(url);
+
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size(), 1, 30000);
+ QCOMPARE(iconUrlChangedSpy.size(), 0);
+ QCOMPARE(iconChangedSpy.size(), 0);
+
+ QVERIFY(m_page->iconUrl().isEmpty());
+ QVERIFY(m_page->icon().isNull());
+}
+
+void tst_Favicon::errorPageEnabled()
+{
+ m_page->settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, true);
+
+ QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
+ QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
+ QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
+
+ QUrl url("http://url.invalid");
+ m_page->load(url);
+
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size(), 1, 30000);
+ QCOMPARE(iconUrlChangedSpy.size(), 0);
+ QCOMPARE(iconChangedSpy.size(), 0);
+
+ QVERIFY(m_page->iconUrl().isEmpty());
+ QVERIFY(m_page->icon().isNull());
+}
+
+void tst_Favicon::errorPageDisabled()
+{
+ m_page->settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, false);
+
+ QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
+ QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
+ QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
+
+ QUrl url("http://url.invalid");
+ m_page->load(url);
+
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size(), 1, 30000);
+ QCOMPARE(iconUrlChangedSpy.size(), 0);
+ QCOMPARE(iconChangedSpy.size(), 0);
+
+ QVERIFY(m_page->iconUrl().isEmpty());
+ QVERIFY(m_page->icon().isNull());
+}
+
+void tst_Favicon::touchIcon()
+{
+ if (!QDir(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()).exists())
+ W_QSKIP(QString("This test requires access to resources found in '%1'")
+ .arg(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath())
+ .toLatin1()
+ .constData(),
+ SkipAll);
+
+ QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
+ QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
+ QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
+
+ QUrl url = QUrl::fromLocalFile(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + QLatin1String("/resources/favicon-touch.html"));
+ m_page->load(url);
+
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size(), 1, 30000);
+ QCOMPARE(iconUrlChangedSpy.size(), 0);
+ QCOMPARE(iconChangedSpy.size(), 0);
+
+ QVERIFY(m_page->iconUrl().isEmpty());
+ QVERIFY(m_page->icon().isNull());
+}
+
+void tst_Favicon::multiIcon()
+{
+ if (!QDir(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()).exists())
+ W_QSKIP(QString("This test requires access to resources found in '%1'")
+ .arg(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath())
+ .toLatin1()
+ .constData(),
+ SkipAll);
+
+ QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
+ QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
+ QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
+
+ QUrl url = QUrl::fromLocalFile(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + QLatin1String("/resources/favicon-multi.html"));
+ QUrl iconUrl;
+ QIcon icon;
+
+ // If touch icons are disabled, the favicon is provided in two sizes (16x16 and 32x32) according
+ // to the supported scale factors (100P, 200P).
+ m_page->settings()->setAttribute(QWebEngineSettings::TouchIconsEnabled, false);
+ m_page->load(url);
+
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size(), 1, 30000);
+ QTRY_COMPARE(iconUrlChangedSpy.size(), 1);
+ QTRY_COMPARE(iconChangedSpy.size(), 1);
+
+ iconUrl = iconUrlChangedSpy.at(0).at(0).toString();
+ QCOMPARE(m_page->iconUrl(), iconUrl);
+ QCOMPARE(iconUrl,
+ QUrl::fromLocalFile(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + QLatin1String("/resources/icons/qtmulti.ico")));
+
+ icon = m_page->icon();
+ QVERIFY(!icon.isNull());
+ QCOMPARE(icon.availableSizes().size(), 2);
+ QVERIFY(icon.availableSizes().contains(QSize(16, 16)));
+ QVERIFY(icon.availableSizes().contains(QSize(32, 32)));
+
+ // Reset
+ loadFinishedSpy.clear();
+ m_page->load(QUrl("about:blank"));
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size(), 1, 30000);
+ iconUrlChangedSpy.clear();
+ iconChangedSpy.clear();
+ loadFinishedSpy.clear();
+ icon = QIcon();
+
+ // If touch icons are enabled, the largest icon is provided.
+ m_page->settings()->setAttribute(QWebEngineSettings::TouchIconsEnabled, true);
+ m_page->load(url);
+
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size(), 1, 30000);
+ QTRY_COMPARE(iconUrlChangedSpy.size(), 1);
+ QTRY_COMPARE(iconChangedSpy.size(), 1);
+
+ iconUrl = iconUrlChangedSpy.at(0).at(0).toString();
+ QCOMPARE(m_page->iconUrl(), iconUrl);
+ QCOMPARE(iconUrl,
+ QUrl::fromLocalFile(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()
+ + QLatin1String("/resources/icons/qtmulti.ico")));
+
+ icon = m_page->icon();
+ QVERIFY(!icon.isNull());
+ QCOMPARE(icon.availableSizes().size(), 1);
+ QVERIFY(icon.availableSizes().contains(QSize(64, 64)));
+}
+
+void tst_Favicon::downloadIconsDisabled_data()
+{
+ QTest::addColumn<QUrl>("url");
+ QTest::newRow("misc") << QUrl("qrc:/resources/favicon-misc.html");
+ QTest::newRow("shortcut") << QUrl("qrc:/resources/favicon-shortcut.html");
+ QTest::newRow("single") << QUrl("qrc:/resources/favicon-single.html");
+ QTest::newRow("touch") << QUrl("qrc:/resources/favicon-touch.html");
+ QTest::newRow("unavailable") << QUrl("qrc:/resources/favicon-unavailable.html");
+}
+
+void tst_Favicon::downloadIconsDisabled()
+{
+ QFETCH(QUrl, url);
+
+ m_page->settings()->setAttribute(QWebEngineSettings::AutoLoadIconsForPage, false);
+
+ QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
+ QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
+ QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
+
+ m_page->load(url);
+
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size(), 1, 30000);
+ QCOMPARE(iconUrlChangedSpy.size(), 0);
+ QCOMPARE(iconChangedSpy.size(), 0);
+
+ QVERIFY(m_page->iconUrl().isEmpty());
+ QVERIFY(m_page->icon().isNull());
+}
+
+void tst_Favicon::downloadTouchIconsEnabled_data()
+{
+ QTest::addColumn<QUrl>("url");
+ QTest::addColumn<QUrl>("expectedIconUrl");
+ QTest::addColumn<QSize>("expectedIconSize");
+ QTest::newRow("misc") << QUrl("qrc:/resources/favicon-misc.html")
+ << QUrl("qrc:/resources/icons/qt144.png") << QSize(144, 144);
+ QTest::newRow("shortcut") << QUrl("qrc:/resources/favicon-shortcut.html")
+ << QUrl("qrc:/resources/icons/qt144.png") << QSize(144, 144);
+ QTest::newRow("single") << QUrl("qrc:/resources/favicon-single.html")
+ << QUrl("qrc:/resources/icons/qt32.ico") << QSize(32, 32);
+ QTest::newRow("touch") << QUrl("qrc:/resources/favicon-touch.html")
+ << QUrl("qrc:/resources/icons/qt144.png") << QSize(144, 144);
+}
+
+void tst_Favicon::downloadTouchIconsEnabled()
+{
+ QFETCH(QUrl, url);
+ QFETCH(QUrl, expectedIconUrl);
+ QFETCH(QSize, expectedIconSize);
+
+ m_page->settings()->setAttribute(QWebEngineSettings::TouchIconsEnabled, true);
+
+ QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
+ QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
+ QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
+
+ m_page->load(url);
+
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size(), 1, 30000);
+ QTRY_COMPARE(iconUrlChangedSpy.size(), 1);
+ QTRY_COMPARE(iconChangedSpy.size(), 1);
+
+ const QUrl &iconUrl = iconUrlChangedSpy.at(0).at(0).toString();
+ QCOMPARE(m_page->iconUrl(), iconUrl);
+ QCOMPARE(iconUrl, expectedIconUrl);
+
+ const QIcon &icon = m_page->icon();
+ QVERIFY(!icon.isNull());
+
+ QCOMPARE(icon.availableSizes().size(), 1);
+ QCOMPARE(icon.availableSizes().first(), expectedIconSize);
+}
+
+void tst_Favicon::dynamicFavicon()
+{
+ QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
+ QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
+ QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
+
+ QMap<Qt::GlobalColor, QString> colors;
+ colors.insert(Qt::red,
+ QString("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8DwHwAFBQIAX8jx0gAAAABJRU5ErkJggg=="));
+ colors.insert(Qt::green,
+ QString("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M/wHwAEBgIApD5fRAAAAABJRU5ErkJggg=="));
+ colors.insert(Qt::blue,
+ QString("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPj/HwADBwIAMCbHYQAAAABJRU5ErkJggg=="));
+
+ m_page->setHtml("<html>"
+ "<link rel='icon' type='image/png' "
+ "href='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII='/>"
+ "</html>");
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size(), 1, 30000);
+ QTRY_COMPARE(iconUrlChangedSpy.size(), 1);
+ QTRY_COMPARE(iconChangedSpy.size(), 1);
+
+ QCOMPARE(m_page->icon().pixmap(1, 1).toImage().pixelColor(0, 0), QColor(Qt::black));
+
+ for (Qt::GlobalColor color : colors.keys()) {
+ iconChangedSpy.clear();
+ evaluateJavaScriptSync(
+ m_page,
+ "document.getElementsByTagName('link')[0].href = 'data:image/png;base64," + colors[color] + "';");
+ QTRY_COMPARE(iconChangedSpy.size(), 1);
+ QTRY_COMPARE(m_page->iconUrl().toString(),
+ QString("data:image/png;base64," + colors[color]));
+ QCOMPARE(m_page->icon().pixmap(1, 1).toImage().pixelColor(0, 0), QColor(color));
+ }
+}
+
+void tst_Favicon::touchIconWithSameURL()
+{
+ m_page->settings()->setAttribute(QWebEngineSettings::TouchIconsEnabled, false);
+
+ const QString icon("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII=");
+ QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
+ QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
+ QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
+
+ m_page->setHtml("<html>"
+ "<link rel='icon' type='image/png' href='" + icon + "'/>"
+ "<link rel='apple-touch-icon' type='image/png' href='" + icon + "'/>"
+ "</html>");
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size(), 1, 30000);
+
+ // The default favicon has to be loaded even if its URL is also set as a touch icon while touch
+ // icons are disabled.
+ QTRY_COMPARE(iconUrlChangedSpy.size(), 1);
+ QCOMPARE(m_page->iconUrl().toString(), icon);
+ QTRY_COMPARE(iconChangedSpy.size(), 1);
+
+ loadFinishedSpy.clear();
+ iconUrlChangedSpy.clear();
+ iconChangedSpy.clear();
+
+ m_page->setHtml("<html>"
+ "<link rel='apple-touch-icon' type='image/png' href='" + icon + "'/>"
+ "</html>");
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
+
+ // This page only has a touch icon. With disabled touch icons we don't expect any icon to be
+ // shown even if the same icon was loaded previously.
+ QTRY_COMPARE(iconUrlChangedSpy.size(), 1);
+ QVERIFY(m_page->iconUrl().toString().isEmpty());
+ QTRY_COMPARE(iconChangedSpy.size(), 1);
+}
+
+void tst_Favicon::iconDatabaseOTR()
+{
+ QWebEngineProfile profile;
+ QWebEngineView view;
+ QWebEnginePage *page = new QWebEnginePage(&profile, &view);
+ view.setPage(page);
+
+ QSignalSpy loadFinishedSpy(page, SIGNAL(loadFinished(bool)));
+ QSignalSpy iconUrlChangedSpy(page, SIGNAL(iconUrlChanged(QUrl)));
+ QSignalSpy iconChangedSpy(page, SIGNAL(iconChanged(QIcon)));
+
+ page->load(QUrl("qrc:/resources/favicon-misc.html"));
+
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
+ QTRY_COMPARE(iconUrlChangedSpy.size(), 1);
+ QTRY_COMPARE(iconChangedSpy.size(), 1);
+
+ {
+ bool iconRequestDone = false;
+ profile.requestIconForIconURL(page->iconUrl(), 0,
+ [page, &iconRequestDone](const QIcon &icon, const QUrl &iconUrl) {
+ QVERIFY(icon.isNull());
+ QCOMPARE(iconUrl, page->iconUrl());
+ iconRequestDone = true;
+ });
+ QTRY_VERIFY(iconRequestDone);
+ }
+
+ {
+ bool iconRequestDone = false;
+ profile.requestIconForPageURL(page->url(), 0,
+ [page, &iconRequestDone](const QIcon &icon, const QUrl &iconUrl, const QUrl &pageUrl) {
+ QVERIFY(icon.isNull());
+ QVERIFY(iconUrl.isEmpty());
+ QCOMPARE(pageUrl, page->url());
+ iconRequestDone = true;
+ });
+ QTRY_VERIFY(iconRequestDone);
+ }
+}
+
+void tst_Favicon::requestIconForIconURL_data()
+{
+ QTest::addColumn<bool>("touchIconsEnabled");
+ QTest::newRow("touch icons enabled") << true;
+ QTest::newRow("touch icons disabled") << false;
+}
+
+void tst_Favicon::requestIconForIconURL()
+{
+ QFETCH(bool, touchIconsEnabled);
+
+ QTemporaryDir tmpDir;
+ QWebEngineProfile profile("iconDatabase-iconurl");
+ profile.setPersistentStoragePath(tmpDir.path());
+ profile.settings()->setAttribute(QWebEngineSettings::LocalStorageEnabled, true);
+ profile.settings()->setAttribute(QWebEngineSettings::TouchIconsEnabled, touchIconsEnabled);
+
+ QWebEngineView view;
+ QWebEnginePage *page = new QWebEnginePage(&profile, &view);
+ view.setPage(page);
+
+ QSignalSpy loadFinishedSpy(page, SIGNAL(loadFinished(bool)));
+ QSignalSpy iconUrlChangedSpy(page, SIGNAL(iconUrlChanged(QUrl)));
+ QSignalSpy iconChangedSpy(page, SIGNAL(iconChanged(QIcon)));
+
+ page->load(QUrl("qrc:/resources/favicon-misc.html"));
+
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
+ QTRY_COMPARE(iconUrlChangedSpy.size(), 1);
+ QTRY_COMPARE(iconChangedSpy.size(), 1);
+
+ page->load(QUrl("about:blank"));
+
+ QTRY_COMPARE(loadFinishedSpy.size(), 2);
+ QTRY_COMPARE(iconUrlChangedSpy.size(), 2);
+ QTRY_COMPARE(iconChangedSpy.size(), 2);
+ QVERIFY(page->icon().isNull());
+ QVERIFY(page->iconUrl().isEmpty());
+
+ {
+ bool iconRequestDone = false;
+ profile.requestIconForIconURL(QUrl("qrc:/resources/icons/qt144.png"), 0,
+ [touchIconsEnabled, &iconRequestDone](const QIcon &icon, const QUrl &iconUrl) {
+ if (touchIconsEnabled) {
+ QVERIFY(!icon.isNull());
+ QCOMPARE(icon.pixmap(QSize(32, 32), 1.0).toImage().pixel(16, 16), 0xfff2f9ec);
+ } else {
+ QVERIFY(icon.isNull());
+ }
+
+ QCOMPARE(iconUrl, QUrl("qrc:/resources/icons/qt144.png"));
+ iconRequestDone = true;
+ });
+ QTRY_VERIFY(iconRequestDone);
+ }
+
+ {
+ bool iconRequestDone = false;
+ profile.requestIconForIconURL(QUrl("qrc:/resources/icons/qt32.ico"), 0,
+ [&iconRequestDone](const QIcon &icon, const QUrl &iconUrl) {
+ QVERIFY(!icon.isNull());
+ QCOMPARE(icon.pixmap(QSize(32, 32), 1.0).toImage().pixel(16, 16), 0xffeef7e6);
+ QCOMPARE(iconUrl, QUrl("qrc:/resources/icons/qt32.ico"));
+ iconRequestDone = true;
+ });
+ QTRY_VERIFY(iconRequestDone);
+ }
+}
+
+void tst_Favicon::requestIconForPageURL_data()
+{
+ QTest::addColumn<bool>("touchIconsEnabled");
+ QTest::newRow("touch icons enabled") << true;
+ QTest::newRow("touch icons disabled") << false;
+}
+
+void tst_Favicon::requestIconForPageURL()
+{
+ QFETCH(bool, touchIconsEnabled);
+
+ QTemporaryDir tmpDir;
+ QWebEngineProfile profile("iconDatabase-pageurl");
+ profile.setPersistentStoragePath(tmpDir.path());
+ profile.settings()->setAttribute(QWebEngineSettings::LocalStorageEnabled, true);
+ profile.settings()->setAttribute(QWebEngineSettings::TouchIconsEnabled, touchIconsEnabled);
+
+
+ QWebEngineView view;
+ QWebEnginePage *page = new QWebEnginePage(&profile, &view);
+ view.setPage(page);
+
+ QSignalSpy loadFinishedSpy(page, SIGNAL(loadFinished(bool)));
+ QSignalSpy iconUrlChangedSpy(page, SIGNAL(iconUrlChanged(QUrl)));
+ QSignalSpy iconChangedSpy(page, SIGNAL(iconChanged(QIcon)));
+
+ page->load(QUrl("qrc:/resources/favicon-misc.html"));
+
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
+ QTRY_COMPARE(iconUrlChangedSpy.size(), 1);
+ QTRY_COMPARE(iconChangedSpy.size(), 1);
+
+ page->load(QUrl("about:blank"));
+
+ QTRY_COMPARE(loadFinishedSpy.size(), 2);
+ QTRY_COMPARE(iconUrlChangedSpy.size(), 2);
+ QTRY_COMPARE(iconChangedSpy.size(), 2);
+ QVERIFY(page->icon().isNull());
+ QVERIFY(page->iconUrl().isEmpty());
+
+ {
+ bool iconRequestDone = false;
+ profile.requestIconForPageURL(QUrl("qrc:/resources/favicon-misc.html"), 0,
+ [touchIconsEnabled, &iconRequestDone](const QIcon &icon, const QUrl &iconUrl, const QUrl &pageUrl) {
+ QVERIFY(!icon.isNull());
+ if (touchIconsEnabled) {
+ QCOMPARE(icon.pixmap(QSize(32, 32), 1.0).toImage().pixel(16, 16), 0xfff2f9ec);
+ QCOMPARE(iconUrl, QUrl("qrc:/resources/icons/qt144.png"));
+ } else {
+ QCOMPARE(icon.pixmap(QSize(32, 32), 1.0).toImage().pixel(16, 16), 0xffeef7e6);
+ QCOMPARE(iconUrl, QUrl("qrc:/resources/icons/qt32.ico"));
+ }
+
+ QCOMPARE(pageUrl, QUrl("qrc:/resources/favicon-misc.html"));
+ iconRequestDone = true;
+ });
+ QTRY_VERIFY(iconRequestDone);
+ }
+}
+
+void tst_Favicon::desiredSize()
+{
+ QTemporaryDir tmpDir;
+ QWebEngineProfile profile("iconDatabase-desiredsize");
+ profile.setPersistentStoragePath(tmpDir.path());
+ profile.settings()->setAttribute(QWebEngineSettings::LocalStorageEnabled, true);
+
+ QWebEngineView view;
+ QWebEnginePage *page = new QWebEnginePage(&profile, &view);
+ view.setPage(page);
+
+ // Disable touch icons: icon with size 16x16 will be loaded.
+ {
+ profile.settings()->setAttribute(QWebEngineSettings::TouchIconsEnabled, false);
+
+ QSignalSpy loadFinishedSpy(page, SIGNAL(loadFinished(bool)));
+ QSignalSpy iconUrlChangedSpy(page, SIGNAL(iconUrlChanged(QUrl)));
+ QSignalSpy iconChangedSpy(page, SIGNAL(iconChanged(QIcon)));
+
+ page->load(QUrl("qrc:/resources/favicon-multi.html"));
+
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
+ QTRY_COMPARE(iconUrlChangedSpy.size(), 1);
+ QTRY_COMPARE(iconChangedSpy.size(), 1);
+
+ page->load(QUrl("about:blank"));
+
+ QTRY_COMPARE(loadFinishedSpy.size(), 2);
+ QTRY_COMPARE(iconUrlChangedSpy.size(), 2);
+ QTRY_COMPARE(iconChangedSpy.size(), 2);
+ QVERIFY(page->icon().isNull());
+ QVERIFY(page->iconUrl().isEmpty());
+ }
+
+ int desiredSizeInPixel = 16;
+ QRgb expectedPixel = 0xfffdfefc;
+
+ // Request icon with size 16x16 (desiredSizeInPixel).
+ {
+ bool iconRequestDone = false;
+ profile.requestIconForPageURL(QUrl("qrc:/resources/favicon-multi.html"), desiredSizeInPixel,
+ [desiredSizeInPixel, expectedPixel, &iconRequestDone](const QIcon &icon, const QUrl &iconUrl, const QUrl &pageUrl) {
+ QVERIFY(!icon.isNull());
+ QRgb pixel = icon.pixmap(QSize(desiredSizeInPixel, desiredSizeInPixel), 1.0)
+ .toImage()
+ .pixel(8, 8);
+ QCOMPARE(pixel, expectedPixel);
+ QCOMPARE(iconUrl, QUrl("qrc:/resources/icons/qtmulti.ico"));
+ QCOMPARE(pageUrl, QUrl("qrc:/resources/favicon-multi.html"));
+ iconRequestDone = true;
+ });
+ QTRY_VERIFY(iconRequestDone);
+ }
+
+ // Enable touch icons: icon with the largest size (64x64) will be loaded.
+ {
+ profile.settings()->setAttribute(QWebEngineSettings::TouchIconsEnabled, true);
+
+ QSignalSpy loadFinishedSpy(page, SIGNAL(loadFinished(bool)));
+ QSignalSpy iconUrlChangedSpy(page, SIGNAL(iconUrlChanged(QUrl)));
+ QSignalSpy iconChangedSpy(page, SIGNAL(iconChanged(QIcon)));
+
+ page->load(QUrl("qrc:/resources/favicon-multi.html"));
+
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
+ QTRY_COMPARE(iconUrlChangedSpy.size(), 1);
+ QTRY_COMPARE(iconChangedSpy.size(), 1);
+
+ page->load(QUrl("about:blank"));
+
+ QTRY_COMPARE(loadFinishedSpy.size(), 2);
+ QTRY_COMPARE(iconUrlChangedSpy.size(), 2);
+ QTRY_COMPARE(iconChangedSpy.size(), 2);
+ QVERIFY(page->icon().isNull());
+ QVERIFY(page->iconUrl().isEmpty());
+ }
+
+ // Request icon with size 16x16.
+ // The icon is stored with two sizes in the database. This request should result same pixel
+ // as the first one.
+ {
+ bool iconRequestDone = false;
+ profile.requestIconForPageURL(QUrl("qrc:/resources/favicon-multi.html"), desiredSizeInPixel,
+ [desiredSizeInPixel, expectedPixel, &iconRequestDone](const QIcon &icon, const QUrl &iconUrl, const QUrl &pageUrl) {
+ QVERIFY(!icon.isNull());
+ QRgb pixel = icon.pixmap(QSize(desiredSizeInPixel, desiredSizeInPixel), 1.0)
+ .toImage()
+ .pixel(8, 8);
+ QCOMPARE(pixel, expectedPixel);
+ QCOMPARE(iconUrl, QUrl("qrc:/resources/icons/qtmulti.ico"));
+ QCOMPARE(pageUrl, QUrl("qrc:/resources/favicon-multi.html"));
+ iconRequestDone = true;
+ });
+ QTRY_VERIFY(iconRequestDone);
+ }
+
+ // Request icon with size 64x64.
+ // This requests the another size from the database. The pixel should differ.
+ {
+ bool iconRequestDone = false;
+ profile.requestIconForPageURL(QUrl("qrc:/resources/favicon-multi.html"), 64,
+ [desiredSizeInPixel, expectedPixel, &iconRequestDone](const QIcon &icon, const QUrl &iconUrl, const QUrl &pageUrl) {
+ QVERIFY(!icon.isNull());
+ QRgb pixel = icon.pixmap(QSize(desiredSizeInPixel, desiredSizeInPixel), 1.0)
+ .toImage()
+ .pixel(8, 8);
+ QVERIFY(pixel != expectedPixel);
+ QCOMPARE(iconUrl, QUrl("qrc:/resources/icons/qtmulti.ico"));
+ QCOMPARE(pageUrl, QUrl("qrc:/resources/favicon-multi.html"));
+ iconRequestDone = true;
+ });
+ QTRY_VERIFY(iconRequestDone);
+ }
+}
+
+QTEST_MAIN(tst_Favicon)
+
+#include "tst_favicon.moc"
diff --git a/tests/auto/widgets/faviconmanager/faviconmanager.pro b/tests/auto/widgets/faviconmanager/faviconmanager.pro
deleted file mode 100644
index e99c7f493..000000000
--- a/tests/auto/widgets/faviconmanager/faviconmanager.pro
+++ /dev/null
@@ -1 +0,0 @@
-include(../tests.pri)
diff --git a/tests/auto/widgets/faviconmanager/resources/favicon-misc.html b/tests/auto/widgets/faviconmanager/resources/favicon-misc.html
deleted file mode 100644
index 9e788bdf4..000000000
--- a/tests/auto/widgets/faviconmanager/resources/favicon-misc.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<html>
- <head>
- <title>Favicon Test</title>
- <link rel="shortcut icon" href="icons/qt32.ico" />
- <link rel="apple-touch-icon" href="icons/qt144.png" />
- <link rel="shortcut icon" href="icons/unavailable.ico" />
- </head>
- <body>
- <h1>Favicon Test</h1>
- </body>
-</html>
diff --git a/tests/auto/widgets/faviconmanager/resources/favicon-multi.html b/tests/auto/widgets/faviconmanager/resources/favicon-multi.html
deleted file mode 100644
index cc5f3fd66..000000000
--- a/tests/auto/widgets/faviconmanager/resources/favicon-multi.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<html>
- <head>
- <title>Multi-sized Favicon Test</title>
- <link rel="shortcut icon" sizes="16x16 32x23 64x64" href="icons/qtmulti.ico" />
- </head>
- <body>
- <h1>Multi-sized Favicon Test</h1>
- </body>
-</html>
diff --git a/tests/auto/widgets/faviconmanager/tst_faviconmanager.cpp b/tests/auto/widgets/faviconmanager/tst_faviconmanager.cpp
deleted file mode 100644
index 46038cdc6..000000000
--- a/tests/auto/widgets/faviconmanager/tst_faviconmanager.cpp
+++ /dev/null
@@ -1,551 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtTest/QtTest>
-#include "../util.h"
-
-#include <qwebenginepage.h>
-#include <qwebengineprofile.h>
-#include <qwebenginesettings.h>
-#include <qwebengineview.h>
-
-
-class tst_FaviconManager : public QObject {
- Q_OBJECT
-
-public Q_SLOTS:
- void init();
- void initTestCase();
- void cleanupTestCase();
- void cleanup();
-
-private Q_SLOTS:
- void faviconLoad();
- void faviconLoadFromResources();
- void faviconLoadEncodedUrl();
- void noFavicon();
- void aboutBlank();
- void unavailableFavicon();
- void errorPageEnabled();
- void errorPageDisabled();
- void bestFavicon();
- void touchIcon();
- void multiIcon();
- void candidateIcon();
- void downloadIconsDisabled_data();
- void downloadIconsDisabled();
- void downloadTouchIconsEnabled_data();
- void downloadTouchIconsEnabled();
- void dynamicFavicon();
- void touchIconWithSameURL();
-
-private:
- QWebEngineView *m_view;
- QWebEnginePage *m_page;
- QWebEngineProfile *m_profile;
-};
-
-
-void tst_FaviconManager::init()
-{
- m_profile = new QWebEngineProfile(this);
- m_view = new QWebEngineView();
- m_page = new QWebEnginePage(m_profile, m_view);
- m_view->setPage(m_page);
-}
-
-
-void tst_FaviconManager::initTestCase()
-{
-}
-
-void tst_FaviconManager::cleanupTestCase()
-{
-}
-
-
-void tst_FaviconManager::cleanup()
-{
- delete m_view;
- delete m_profile;
-}
-
-void tst_FaviconManager::faviconLoad()
-{
- if (!QDir(TESTS_SOURCE_DIR).exists())
- W_QSKIP(QString("This test requires access to resources found in '%1'").arg(TESTS_SOURCE_DIR).toLatin1().constData(), SkipAll);
-
- QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
- QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
- QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
-
- QUrl url = QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("faviconmanager/resources/favicon-single.html"));
- m_page->load(url);
-
- QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.count(), 1, 30000);
- QTRY_COMPARE(iconUrlChangedSpy.count(), 1);
- QTRY_COMPARE(iconChangedSpy.count(), 1);
-
- QUrl iconUrl = iconUrlChangedSpy.at(0).at(0).toString();
- QCOMPARE(iconUrl, m_page->iconUrl());
- QCOMPARE(iconUrl, QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("faviconmanager/resources/icons/qt32.ico")));
-
- const QIcon &icon = m_page->icon();
- QVERIFY(!icon.isNull());
-
- QCOMPARE(icon.availableSizes().count(), 1);
- QSize iconSize = icon.availableSizes().first();
- QCOMPARE(iconSize, QSize(32, 32));
-}
-
-void tst_FaviconManager::faviconLoadFromResources()
-{
- QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
- QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
- QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
-
- QUrl url("qrc:/resources/favicon-single.html");
- m_page->load(url);
-
- QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.count(), 1, 30000);
- QTRY_COMPARE(iconUrlChangedSpy.count(), 1);
- QTRY_COMPARE(iconChangedSpy.count(), 1);
-
- QUrl iconUrl = iconUrlChangedSpy.at(0).at(0).toString();
- QCOMPARE(iconUrl, m_page->iconUrl());
- QCOMPARE(iconUrl, QUrl("qrc:/resources/icons/qt32.ico"));
-
- const QIcon &icon = m_page->icon();
- QVERIFY(!icon.isNull());
-
- QCOMPARE(icon.availableSizes().count(), 1);
- QSize iconSize = icon.availableSizes().first();
- QCOMPARE(iconSize, QSize(32, 32));
-}
-
-void tst_FaviconManager::faviconLoadEncodedUrl()
-{
- if (!QDir(TESTS_SOURCE_DIR).exists())
- W_QSKIP(QString("This test requires access to resources found in '%1'").arg(TESTS_SOURCE_DIR).toLatin1().constData(), SkipAll);
-
- QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
- QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
- QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
-
- QString urlString = QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("faviconmanager/resources/favicon-single.html")).toString();
- QUrl url(urlString + QLatin1String("?favicon=load should work with#whitespace!"));
- m_page->load(url);
-
- QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.count(), 1, 30000);
- QTRY_COMPARE(iconUrlChangedSpy.count(), 1);
- QTRY_COMPARE(iconChangedSpy.count(), 1);
-
- QUrl iconUrl = iconUrlChangedSpy.at(0).at(0).toString();
- QCOMPARE(m_page->iconUrl(), iconUrl);
- QCOMPARE(iconUrl, QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("faviconmanager/resources/icons/qt32.ico")));
-
- const QIcon &icon = m_page->icon();
- QVERIFY(!icon.isNull());
-
- QCOMPARE(icon.availableSizes().count(), 1);
- QSize iconSize = icon.availableSizes().first();
- QCOMPARE(iconSize, QSize(32, 32));
-}
-
-void tst_FaviconManager::noFavicon()
-{
- if (!QDir(TESTS_SOURCE_DIR).exists())
- W_QSKIP(QString("This test requires access to resources found in '%1'").arg(TESTS_SOURCE_DIR).toLatin1().constData(), SkipAll);
-
- QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
- QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
- QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
-
- QUrl url = QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("faviconmanager/resources/test1.html"));
- m_page->load(url);
-
- QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.count(), 1, 30000);
- QCOMPARE(iconUrlChangedSpy.count(), 0);
- QCOMPARE(iconChangedSpy.count(), 0);
-
- QVERIFY(m_page->iconUrl().isEmpty());
- QVERIFY(m_page->icon().isNull());
-}
-
-void tst_FaviconManager::aboutBlank()
-{
- QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
- QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
- QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
-
- QUrl url("about:blank");
- m_page->load(url);
-
- QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.count(), 1, 30000);
- QCOMPARE(iconUrlChangedSpy.count(), 0);
- QCOMPARE(iconChangedSpy.count(), 0);
-
- QVERIFY(m_page->iconUrl().isEmpty());
- QVERIFY(m_page->icon().isNull());
-}
-
-void tst_FaviconManager::unavailableFavicon()
-{
- if (!QDir(TESTS_SOURCE_DIR).exists())
- W_QSKIP(QString("This test requires access to resources found in '%1'").arg(TESTS_SOURCE_DIR).toLatin1().constData(), SkipAll);
-
- QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
- QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
- QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
-
- QUrl url = QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("faviconmanager/resources/favicon-unavailable.html"));
- m_page->load(url);
-
- QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.count(), 1, 30000);
- QCOMPARE(iconUrlChangedSpy.count(), 0);
- QCOMPARE(iconChangedSpy.count(), 0);
-
- QVERIFY(m_page->iconUrl().isEmpty());
- QVERIFY(m_page->icon().isNull());
-}
-
-void tst_FaviconManager::errorPageEnabled()
-{
- m_page->settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, true);
-
- QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
- QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
- QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
-
- QUrl url("http://url.invalid");
- m_page->load(url);
-
- QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.count(), 1, 30000);
- QCOMPARE(iconUrlChangedSpy.count(), 0);
- QCOMPARE(iconChangedSpy.count(), 0);
-
- QVERIFY(m_page->iconUrl().isEmpty());
- QVERIFY(m_page->icon().isNull());
-}
-
-void tst_FaviconManager::errorPageDisabled()
-{
- m_page->settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, false);
-
- QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
- QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
- QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
-
- QUrl url("http://url.invalid");
- m_page->load(url);
-
- QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.count(), 1, 30000);
- QCOMPARE(iconUrlChangedSpy.count(), 0);
- QCOMPARE(iconChangedSpy.count(), 0);
-
- QVERIFY(m_page->iconUrl().isEmpty());
- QVERIFY(m_page->icon().isNull());
-}
-
-void tst_FaviconManager::bestFavicon()
-{
- if (!QDir(TESTS_SOURCE_DIR).exists())
- W_QSKIP(QString("This test requires access to resources found in '%1'").arg(TESTS_SOURCE_DIR).toLatin1().constData(), SkipAll);
-
- QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
- QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
- QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
-
- QUrl url, iconUrl;
- QIcon icon;
- QSize iconSize;
-
- url = QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("faviconmanager/resources/favicon-misc.html"));
- m_page->load(url);
-
- QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.count(), 1, 30000);
- QTRY_COMPARE(iconUrlChangedSpy.count(), 1);
- QTRY_COMPARE(iconChangedSpy.count(), 1);
-
- iconUrl = iconUrlChangedSpy.at(0).at(0).toString();
- QCOMPARE(iconUrl, m_page->iconUrl());
- // Touch icon is ignored
- QCOMPARE(iconUrl, QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("faviconmanager/resources/icons/qt32.ico")));
-
- icon = m_page->icon();
- QVERIFY(!icon.isNull());
-
- QCOMPARE(icon.availableSizes().count(), 1);
- iconSize = icon.availableSizes().first();
- QCOMPARE(iconSize, QSize(32, 32));
-
- loadFinishedSpy.clear();
- iconUrlChangedSpy.clear();
- iconChangedSpy.clear();
-
- url = QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("faviconmanager/resources/favicon-shortcut.html"));
- m_page->load(url);
-
- QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.count(), 1, 30000);
- QTRY_VERIFY(iconUrlChangedSpy.count() >= 1);
- QTRY_VERIFY(iconChangedSpy.count() >= 1);
-
- iconUrl = iconUrlChangedSpy.last().at(0).toString();
-
- // If the icon URL is empty we have to wait for
- // the second iconChanged signal that propagates the expected URL
- if (iconUrl.isEmpty()) {
- QTRY_COMPARE(iconUrlChangedSpy.count(), 2);
- QTRY_COMPARE(iconChangedSpy.count(), 2);
- iconUrl = iconUrlChangedSpy.last().at(0).toString();
- }
-
- QCOMPARE(iconUrl, m_page->iconUrl());
- QCOMPARE(iconUrl, QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("faviconmanager/resources/icons/qt144.png")));
-
- icon = m_page->icon();
- QVERIFY(!icon.isNull());
-
- QVERIFY(icon.availableSizes().count() >= 1);
- QVERIFY(icon.availableSizes().contains(QSize(144, 144)));
-}
-
-void tst_FaviconManager::touchIcon()
-{
- if (!QDir(TESTS_SOURCE_DIR).exists())
- W_QSKIP(QString("This test requires access to resources found in '%1'").arg(TESTS_SOURCE_DIR).toLatin1().constData(), SkipAll);
-
- QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
- QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
- QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
-
- QUrl url = QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("faviconmanager/resources/favicon-touch.html"));
- m_page->load(url);
-
- QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.count(), 1, 30000);
- QCOMPARE(iconUrlChangedSpy.count(), 0);
- QCOMPARE(iconChangedSpy.count(), 0);
-
- QVERIFY(m_page->iconUrl().isEmpty());
- QVERIFY(m_page->icon().isNull());
-}
-
-void tst_FaviconManager::multiIcon()
-{
- if (!QDir(TESTS_SOURCE_DIR).exists())
- W_QSKIP(QString("This test requires access to resources found in '%1'").arg(TESTS_SOURCE_DIR).toLatin1().constData(), SkipAll);
-
- QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
- QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
- QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
-
- QUrl url = QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("faviconmanager/resources/favicon-multi.html"));
- m_page->load(url);
-
- QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.count(), 1, 30000);
- QTRY_COMPARE(iconUrlChangedSpy.count(), 1);
- QTRY_COMPARE(iconChangedSpy.count(), 1);
-
- QUrl iconUrl = iconUrlChangedSpy.at(0).at(0).toString();
- QCOMPARE(m_page->iconUrl(), iconUrl);
- QCOMPARE(iconUrl, QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("faviconmanager/resources/icons/qtmulti.ico")));
-
- const QIcon &icon = m_page->icon();
- QVERIFY(!icon.isNull());
- QCOMPARE(icon.availableSizes().count(), 3);
- QVERIFY(icon.availableSizes().contains(QSize(16, 16)));
- QVERIFY(icon.availableSizes().contains(QSize(32, 32)));
- QVERIFY(icon.availableSizes().contains(QSize(64, 64)));
-}
-
-void tst_FaviconManager::candidateIcon()
-{
- if (!QDir(TESTS_SOURCE_DIR).exists())
- W_QSKIP(QString("This test requires access to resources found in '%1'").arg(TESTS_SOURCE_DIR).toLatin1().constData(), SkipAll);
-
- QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
- QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
- QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
-
- QUrl url = QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("faviconmanager/resources/favicon-shortcut.html"));
- m_page->load(url);
-
- QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.count(), 1, 30000);
- QTRY_COMPARE(iconUrlChangedSpy.count(), 1);
- QTRY_COMPARE(iconChangedSpy.count(), 1);
-
- QUrl iconUrl = iconUrlChangedSpy.at(0).at(0).toString();
- QCOMPARE(m_page->iconUrl(), iconUrl);
- QCOMPARE(iconUrl, QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("faviconmanager/resources/icons/qt144.png")));
-
- const QIcon &icon = m_page->icon();
- QVERIFY(!icon.isNull());
- QCOMPARE(icon.availableSizes().count(), 2);
- QVERIFY(icon.availableSizes().contains(QSize(32, 32)));
- QVERIFY(icon.availableSizes().contains(QSize(144, 144)));
-}
-
-void tst_FaviconManager::downloadIconsDisabled_data()
-{
- QTest::addColumn<QUrl>("url");
- QTest::newRow("misc") << QUrl("qrc:/resources/favicon-misc.html");
- QTest::newRow("shortcut") << QUrl("qrc:/resources/favicon-shortcut.html");
- QTest::newRow("single") << QUrl("qrc:/resources/favicon-single.html");
- QTest::newRow("touch") << QUrl("qrc:/resources/favicon-touch.html");
- QTest::newRow("unavailable") << QUrl("qrc:/resources/favicon-unavailable.html");
-}
-
-void tst_FaviconManager::downloadIconsDisabled()
-{
- QFETCH(QUrl, url);
-
- m_page->settings()->setAttribute(QWebEngineSettings::AutoLoadIconsForPage, false);
-
- QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
- QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
- QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
-
- m_page->load(url);
-
- QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.count(), 1, 30000);
- QCOMPARE(iconUrlChangedSpy.count(), 0);
- QCOMPARE(iconChangedSpy.count(), 0);
-
- QVERIFY(m_page->iconUrl().isEmpty());
- QVERIFY(m_page->icon().isNull());
-}
-
-void tst_FaviconManager::downloadTouchIconsEnabled_data()
-{
- QTest::addColumn<QUrl>("url");
- QTest::addColumn<QUrl>("expectedIconUrl");
- QTest::addColumn<QSize>("expectedIconSize");
- QTest::newRow("misc") << QUrl("qrc:/resources/favicon-misc.html") << QUrl("qrc:/resources/icons/qt144.png") << QSize(144, 144);
- QTest::newRow("shortcut") << QUrl("qrc:/resources/favicon-shortcut.html") << QUrl("qrc:/resources/icons/qt144.png") << QSize(144, 144);
- QTest::newRow("single") << QUrl("qrc:/resources/favicon-single.html") << QUrl("qrc:/resources/icons/qt32.ico") << QSize(32, 32);
- QTest::newRow("touch") << QUrl("qrc:/resources/favicon-touch.html") << QUrl("qrc:/resources/icons/qt144.png") << QSize(144, 144);
-}
-
-void tst_FaviconManager::downloadTouchIconsEnabled()
-{
- QFETCH(QUrl, url);
- QFETCH(QUrl, expectedIconUrl);
- QFETCH(QSize, expectedIconSize);
-
- m_page->settings()->setAttribute(QWebEngineSettings::TouchIconsEnabled, true);
-
- QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
- QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
- QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
-
- m_page->load(url);
-
- QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.count(), 1, 30000);
- QTRY_COMPARE(iconUrlChangedSpy.count(), 1);
- QTRY_COMPARE(iconChangedSpy.count(), 1);
-
- const QUrl &iconUrl = iconUrlChangedSpy.at(0).at(0).toString();
- QCOMPARE(m_page->iconUrl(), iconUrl);
- QCOMPARE(iconUrl, expectedIconUrl);
-
- const QIcon &icon = m_page->icon();
- QVERIFY(!icon.isNull());
-
- QVERIFY(icon.availableSizes().count() >= 1);
- QVERIFY(icon.availableSizes().contains(expectedIconSize));
-}
-
-void tst_FaviconManager::dynamicFavicon()
-{
- QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
- QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
- QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
-
- QMap<Qt::GlobalColor, QString> colors;
- colors.insert(Qt::red, QString("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8DwHwAFBQIAX8jx0gAAAABJRU5ErkJggg=="));
- colors.insert(Qt::green, QString("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M/wHwAEBgIApD5fRAAAAABJRU5ErkJggg=="));
- colors.insert(Qt::blue, QString("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPj/HwADBwIAMCbHYQAAAABJRU5ErkJggg=="));
-
- m_page->setHtml("<html>"
- "<link rel='icon' type='image/png' href='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII='/>"
- "</html>");
- QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.count(), 1, 30000);
- QTRY_COMPARE(iconUrlChangedSpy.count(), 1);
- QTRY_COMPARE(iconChangedSpy.count(), 1);
-
- QCOMPARE(m_page->icon().pixmap(1, 1).toImage().pixelColor(0, 0), QColor(Qt::black));
-
- for (Qt::GlobalColor color : colors.keys()) {
- iconChangedSpy.clear();
- evaluateJavaScriptSync(m_page, "document.getElementsByTagName('link')[0].href = 'data:image/png;base64," + colors[color] + "';");
- QTRY_COMPARE(iconChangedSpy.count(), 1);
- QTRY_COMPARE(m_page->iconUrl().toString(), QString("data:image/png;base64," + colors[color]));
- QCOMPARE(m_page->icon().pixmap(1, 1).toImage().pixelColor(0, 0), QColor(color));
- }
-}
-
-void tst_FaviconManager::touchIconWithSameURL()
-{
- m_page->settings()->setAttribute(QWebEngineSettings::TouchIconsEnabled, false);
-
- const QString icon("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII=");
- QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
- QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
- QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
-
- m_page->setHtml("<html>"
- "<link rel='icon' type='image/png' href='" + icon + "'/>"
- "<link rel='apple-touch-icon' type='image/png' href='" + icon + "'/>"
- "</html>");
- QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.count(), 1, 30000);
-
- // The default favicon has to be loaded even if its URL is also set as a touch icon while touch icons are disabled.
- QTRY_COMPARE(iconUrlChangedSpy.count(), 1);
- QCOMPARE(m_page->iconUrl().toString(), icon);
- QTRY_COMPARE(iconChangedSpy.count(), 1);
-
- loadFinishedSpy.clear();
- iconUrlChangedSpy.clear();
- iconChangedSpy.clear();
-
- m_page->setHtml("<html>"
- "<link rel='apple-touch-icon' type='image/png' href='" + icon + "'/>"
- "</html>");
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
-
- // This page only has a touch icon. With disabled touch icons we don't expect any icon to be shown even if the same icon
- // was loaded previously.
- QTRY_COMPARE(iconUrlChangedSpy.count(), 1);
- QVERIFY(m_page->iconUrl().toString().isEmpty());
- QTRY_COMPARE(iconChangedSpy.count(), 1);
-
-}
-
-QTEST_MAIN(tst_FaviconManager)
-
-#include "tst_faviconmanager.moc"
diff --git a/tests/auto/widgets/faviconmanager/tst_faviconmanager.qrc b/tests/auto/widgets/faviconmanager/tst_faviconmanager.qrc
deleted file mode 100644
index a352f8a83..000000000
--- a/tests/auto/widgets/faviconmanager/tst_faviconmanager.qrc
+++ /dev/null
@@ -1,14 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
-<qresource>
- <file>resources/favicon-misc.html</file>
- <file>resources/favicon-multi.html</file>
- <file>resources/favicon-shortcut.html</file>
- <file>resources/favicon-single.html</file>
- <file>resources/favicon-touch.html</file>
- <file>resources/favicon-unavailable.html</file>
- <file>resources/icons/qt144.png</file>
- <file>resources/icons/qt32.ico</file>
- <file>resources/icons/qtmulti.ico</file>
- <file>resources/test1.html</file>
-</qresource>
-</RCC>
diff --git a/tests/auto/widgets/loadsignals/BLACKLIST b/tests/auto/widgets/loadsignals/BLACKLIST
deleted file mode 100644
index 570666a83..000000000
--- a/tests/auto/widgets/loadsignals/BLACKLIST
+++ /dev/null
@@ -1,14 +0,0 @@
-[secondLoadForError_WhenErrorPageEnabled:ErrorPageEnabled]
-*
-
-# QTBUG-65223
-[loadStartedAndFinishedCount:WithAnchorClickedFromJS]
-*
-
-# QTBUG-66869 (https://codereview.qt-project.org/#/c/222112/ is only a workaround)
-[loadAfterInPageNavigation_qtbug66869]
-*
-
-# QTBUG-66661
-[fileDownloadDoesNotTriggerLoadSignals_qtbug66661]
-*
diff --git a/tests/auto/widgets/loadsignals/CMakeLists.txt b/tests/auto/widgets/loadsignals/CMakeLists.txt
new file mode 100644
index 000000000..bbd0387d9
--- /dev/null
+++ b/tests/auto/widgets/loadsignals/CMakeLists.txt
@@ -0,0 +1,63 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+include(../../httpserver/httpserver.cmake)
+include(../../util/util.cmake)
+
+qt_internal_add_test(tst_loadsignals
+ SOURCES
+ tst_loadsignals.cpp
+ LIBRARIES
+ Qt::WebEngineWidgets
+ Test::HttpServer
+ Test::Util
+)
+
+get_target_property(sharedData Test::HttpServer SHARED_DATA)
+
+set_source_files_properties("${sharedData}/loadprogress/downloadable.tar.gz"
+ PROPERTIES QT_RESOURCE_ALIAS "downloadable.tar.gz"
+)
+set_source_files_properties("${sharedData}/loadprogress/page1.html"
+ PROPERTIES QT_RESOURCE_ALIAS "page1.html"
+)
+set_source_files_properties("${sharedData}/loadprogress/page2.html"
+ PROPERTIES QT_RESOURCE_ALIAS "page2.html"
+)
+set_source_files_properties("${sharedData}/loadprogress/page3.html"
+ PROPERTIES QT_RESOURCE_ALIAS "page3.html"
+)
+set_source_files_properties("${sharedData}/loadprogress/page4.html"
+ PROPERTIES QT_RESOURCE_ALIAS "page4.html"
+)
+set_source_files_properties("${sharedData}/loadprogress/page5.html"
+ PROPERTIES QT_RESOURCE_ALIAS "page5.html"
+)
+set_source_files_properties("${sharedData}/loadprogress/page6.html"
+ PROPERTIES QT_RESOURCE_ALIAS "page6.html"
+)
+set_source_files_properties("${sharedData}/loadprogress/page7.html"
+ PROPERTIES QT_RESOURCE_ALIAS "page7.html"
+)
+set_source_files_properties("${sharedData}/loadprogress/page8.html"
+ PROPERTIES QT_RESOURCE_ALIAS "page8.html"
+)
+
+set(tst_loadsignals_resource_files
+ "${sharedData}/loadprogress/downloadable.tar.gz"
+ "${sharedData}/loadprogress/page1.html"
+ "${sharedData}/loadprogress/page2.html"
+ "${sharedData}/loadprogress/page3.html"
+ "${sharedData}/loadprogress/page4.html"
+ "${sharedData}/loadprogress/page5.html"
+ "${sharedData}/loadprogress/page6.html"
+ "${sharedData}/loadprogress/page7.html"
+ "${sharedData}/loadprogress/page8.html"
+)
+
+qt_internal_add_resource(tst_loadsignals "tst_loadsignals"
+ PREFIX
+ "/resources"
+ FILES
+ ${tst_loadsignals_resource_files}
+)
diff --git a/tests/auto/widgets/loadsignals/loadsignals.pro b/tests/auto/widgets/loadsignals/loadsignals.pro
deleted file mode 100644
index e99c7f493..000000000
--- a/tests/auto/widgets/loadsignals/loadsignals.pro
+++ /dev/null
@@ -1 +0,0 @@
-include(../tests.pri)
diff --git a/tests/auto/widgets/loadsignals/resources/page1.html b/tests/auto/widgets/loadsignals/resources/page1.html
deleted file mode 100644
index 5cd479ab6..000000000
--- a/tests/auto/widgets/loadsignals/resources/page1.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<html>
- <head>
- <title>page1</title>
- </head>
- <body>
- <h1>page1</h1>
- </body>
-</html>
diff --git a/tests/auto/widgets/loadsignals/resources/page2.html b/tests/auto/widgets/loadsignals/resources/page2.html
deleted file mode 100644
index e3031f56a..000000000
--- a/tests/auto/widgets/loadsignals/resources/page2.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<html>
- <head>
- <title>page2</title>
- </head>
- <style>
- .fardown {
- position: absolute;
- top: 2500px;
- }
- </style>
- <body>
- <div class="fardown" id="anchor">page2 anchor</div>
- </body>
-</html>
diff --git a/tests/auto/widgets/loadsignals/tst_loadsignals.cpp b/tests/auto/widgets/loadsignals/tst_loadsignals.cpp
index 20e5fbf0d..6140b3766 100644
--- a/tests/auto/widgets/loadsignals/tst_loadsignals.cpp
+++ b/tests/auto/widgets/loadsignals/tst_loadsignals.cpp
@@ -1,97 +1,128 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include <QtTest/QtTest>
-#include "../util.h"
+#include "httpserver.h"
+#include <util.h>
#include "qdebug.h"
+#include "qwebengineloadinginfo.h"
#include "qwebenginepage.h"
#include "qwebengineprofile.h"
#include "qwebenginesettings.h"
#include "qwebengineview.h"
+enum {
+ LoadStarted = QWebEngineLoadingInfo::LoadStartedStatus,
+ LoadStopped = QWebEngineLoadingInfo::LoadStoppedStatus,
+ LoadSucceeded = QWebEngineLoadingInfo::LoadSucceededStatus,
+ LoadFailed = QWebEngineLoadingInfo::LoadFailedStatus,
+};
+static const QList<int> SignalsOrderOnce({ LoadStarted, LoadSucceeded});
+static const QList<int> SignalsOrderTwice({ LoadStarted, LoadSucceeded, LoadStarted, LoadSucceeded });
+static const QList<int> SignalsOrderOnceFailure({ LoadStarted, LoadFailed });
+static const QList<int> SignalsOrderTwiceWithFailure({ LoadStarted, LoadSucceeded, LoadStarted, LoadFailed });
+
+class TestPage : public QWebEnginePage
+{
+public:
+ QSet<QUrl> blacklist;
+ int navigationRequestCount = 0;
+ QList<int> signalsOrder;
+ QList<int> loadProgress;
+ QList<QWebEngineLoadingInfo> loadingInfos;
+
+ explicit TestPage(QObject *parent = nullptr) : TestPage(nullptr, parent) { }
+ TestPage(QWebEngineProfile *profile, QObject *parent = nullptr) : QWebEnginePage(profile, parent) {
+ connect(this, &QWebEnginePage::loadStarted, [this] () { signalsOrder.append(LoadStarted); });
+ connect(this, &QWebEnginePage::loadProgress, [this] (int p) { loadProgress.append(p); });
+ connect(this, &QWebEnginePage::loadFinished, [this] (bool r) { signalsOrder.append(r ? LoadSucceeded : LoadFailed); });
+ connect(this, &QWebEnginePage::loadingChanged, [this] (const QWebEngineLoadingInfo &i) { loadingInfos.append(i); });
+ }
+ ~TestPage() { Q_ASSERT(signalsOrder.size() == loadingInfos.size()); }
+
+ void reset()
+ {
+ blacklist.clear();
+ navigationRequestCount = 0;
+ signalsOrder.clear();
+ loadProgress.clear();
+ loadingInfos.clear();
+ }
+
+protected:
+ bool acceptNavigationRequest(const QUrl &url, NavigationType, bool) override
+ {
+ ++navigationRequestCount;
+ return !blacklist.contains(url);
+ }
+};
+
class tst_LoadSignals : public QObject
{
Q_OBJECT
-public:
- tst_LoadSignals();
- virtual ~tst_LoadSignals();
-
public Q_SLOTS:
void initTestCase();
void init();
- void cleanup();
private Q_SLOTS:
void monotonicity();
void loadStartedAndFinishedCount_data();
void loadStartedAndFinishedCount();
- void secondLoadForError_WhenErrorPageEnabled_data();
- void secondLoadForError_WhenErrorPageEnabled();
+ void loadStartedAndFinishedCountClick_data();
+ void loadStartedAndFinishedCountClick();
+ void rejectNavigationRequest_data();
+ void rejectNavigationRequest();
void loadAfterInPageNavigation_qtbug66869();
- void fileDownloadDoesNotTriggerLoadSignals_qtbug66661();
+ void fileDownload();
+ void numberOfStartedAndFinishedSignalsIsSame_data();
+ void numberOfStartedAndFinishedSignalsIsSame();
+ void loadFinishedAfterNotFoundError_data();
+ void loadFinishedAfterNotFoundError();
+ void errorPageTriggered_data();
+ void errorPageTriggered();
private:
- QWebEngineView* view;
- QScopedPointer<QSignalSpy> loadStartedSpy;
- QScopedPointer<QSignalSpy> loadProgressSpy;
- QScopedPointer<QSignalSpy> loadFinishedSpy;
+ void clickLink(QPoint linkPos);
+
+ QWebEngineProfile profile;
+ TestPage page{&profile};
+ QWebEngineView view;
+ QSignalSpy loadStartedSpy{&page, &QWebEnginePage::loadStarted};
+ QSignalSpy loadFinishedSpy{&page, &QWebEnginePage::loadFinished};
+ void resetSpies() {
+ loadStartedSpy.clear();
+ loadFinishedSpy.clear();
+ }
};
-tst_LoadSignals::tst_LoadSignals()
-{
-}
-
-tst_LoadSignals::~tst_LoadSignals()
-{
-}
-
void tst_LoadSignals::initTestCase()
{
+ view.setPage(&page);
+ view.resize(640, 480);
+ view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
}
void tst_LoadSignals::init()
{
- view = new QWebEngineView();
- view->resize(1024,768);
- view->show();
- loadStartedSpy.reset(new QSignalSpy(view->page(), &QWebEnginePage::loadStarted));
- loadProgressSpy.reset(new QSignalSpy(view->page(), &QWebEnginePage::loadProgress));
- loadFinishedSpy.reset(new QSignalSpy(view->page(), &QWebEnginePage::loadFinished));
+ // Reset content
+ if (!view.url().isEmpty()) {
+ loadFinishedSpy.clear();
+ view.load(QUrl("about:blank"));
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
+ }
+ resetSpies();
+ page.reset();
}
-void tst_LoadSignals::cleanup()
+void tst_LoadSignals::clickLink(QPoint linkPos)
{
- loadFinishedSpy.reset();
- loadProgressSpy.reset();
- loadStartedSpy.reset();
- delete view;
+ // Simulate left-clicking on link.
+ QTRY_VERIFY(view.focusProxy());
+ QWidget *renderWidget = view.focusProxy();
+ QTest::mouseClick(renderWidget, Qt::LeftButton, {}, linkPos);
}
/**
@@ -100,94 +131,168 @@ void tst_LoadSignals::cleanup()
void tst_LoadSignals::loadStartedAndFinishedCount_data()
{
QTest::addColumn<QUrl>("url");
- QTest::addColumn<int>("expectedLoadCount");
- QTest::newRow("Normal") << QUrl("qrc:///resources/page1.html") << 1;
- QTest::newRow("WithAnchor") << QUrl("qrc:///resources/page2.html#anchor") << 1;
-
- // In this case, we get an unexpected additional loadStarted, but no corresponding
- // loadFinished, so expectedLoadCount=2 would also not work. See also QTBUG-65223
- QTest::newRow("WithAnchorClickedFromJS") << QUrl("qrc:///resources/page3.html") << 1;
+ QTest::addColumn<QList<int>>("expectedSignals");
+ QTest::newRow("Simple") << QUrl("qrc:///resources/page1.html") << SignalsOrderOnce;
+ QTest::newRow("SimpleWithAnchor") << QUrl("qrc:///resources/page2.html#anchor") << SignalsOrderOnce;
+ QTest::newRow("SamePageImmediate") << QUrl("qrc:///resources/page5.html") << SignalsOrderOnce;
+ QTest::newRow("SamePageDeferred") << QUrl("qrc:///resources/page3.html") << SignalsOrderOnce;
+ QTest::newRow("OtherPageImmediate") << QUrl("qrc:///resources/page6.html") << SignalsOrderOnce;
+ QTest::newRow("OtherPageDeferred") << QUrl("qrc:///resources/page7.html") << SignalsOrderTwice;
+ QTest::newRow("SamePageImmediateJS") << QUrl("qrc:///resources/page8.html") << SignalsOrderOnce;
}
void tst_LoadSignals::loadStartedAndFinishedCount()
{
QFETCH(QUrl, url);
- QFETCH(int, expectedLoadCount);
+ QFETCH(QList<int>, expectedSignals);
- view->load(url);
- QTRY_COMPARE(loadFinishedSpy->size(), expectedLoadCount);
- bool loadSucceeded = (*loadFinishedSpy)[0][0].toBool();
- QVERIFY(loadSucceeded);
+ view.load(url);
- // Wait for 10 seconds (abort waiting if another loadStarted or loadFinished occurs)
- QTRY_LOOP_IMPL((loadStartedSpy->size() != expectedLoadCount)
- || (loadFinishedSpy->size() != expectedLoadCount), 10000, 100);
+ int expectedLoadCount = expectedSignals.size() / 2;
+ QTRY_COMPARE(loadStartedSpy.size(), expectedLoadCount);
+ QTRY_COMPARE(loadFinishedSpy.size(), expectedLoadCount);
- // No further loadStarted should have occurred within this time
- QCOMPARE(loadStartedSpy->size(), expectedLoadCount);
- QCOMPARE(loadFinishedSpy->size(), expectedLoadCount);
+ // verify no more signals is emitted by waiting for another loadStarted or loadFinished
+ QTRY_LOOP_IMPL(loadStartedSpy.size() != expectedLoadCount || loadFinishedSpy.size() != expectedLoadCount, 1000, 100);
+
+ // No further signals should have occurred within this time and expected number of signals is preserved
+ QCOMPARE(loadStartedSpy.size(), expectedLoadCount);
+ QCOMPARE(loadFinishedSpy.size(), expectedLoadCount);
+ QCOMPARE(page.signalsOrder, expectedSignals);
+ QCOMPARE(page.signalsOrder.size(), page.loadingInfos.size());
+ for (int i = 0; i < page.signalsOrder.size(); ++i)
+ QCOMPARE(page.signalsOrder[i], page.loadingInfos[i].status());
}
/**
- * Test monotonicity of loadProgress signals
- */
-void tst_LoadSignals::monotonicity()
+ * Load a URL, then simulate a click to load a different URL.
+ */
+void tst_LoadSignals::loadStartedAndFinishedCountClick_data()
{
- view->load(QUrl("qrc:///resources/page1.html"));
- QTRY_COMPARE(loadFinishedSpy->size(), 1);
- bool loadSucceeded = (*loadFinishedSpy)[0][0].toBool();
- QVERIFY(loadSucceeded);
-
- // first loadProgress should have 0% progress
- QCOMPARE(loadProgressSpy->first()[0].toInt(), 0);
+ QTest::addColumn<QUrl>("url");
+ QTest::addColumn<int>("numberOfSignals");
+ QTest::newRow("SamePage") << QUrl("qrc:///resources/page2.html") << 0; // in-page navigation to anchor shouldn't emit anything
+ QTest::newRow("OtherPage") << QUrl("qrc:///resources/page1.html") << 1;
+}
- // every loadProgress should have at least as much progress as the one before
- int progress = 0;
- for (auto item : *loadProgressSpy) {
- QVERIFY(item[0].toInt() >= progress);
- progress = item[0].toInt();
+void tst_LoadSignals::loadStartedAndFinishedCountClick()
+{
+ QFETCH(QUrl, url);
+ QFETCH(int, numberOfSignals);
+
+ view.load(url);
+ QTRY_COMPARE(loadStartedSpy.size(), 1);
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
+ QVERIFY(loadFinishedSpy[0][0].toBool());
+ resetSpies();
+
+ clickLink(QPoint(10, 10));
+ if (numberOfSignals > 0) {
+ QTRY_COMPARE(loadStartedSpy.size(), numberOfSignals);
+ QTRY_COMPARE(loadFinishedSpy.size(), numberOfSignals);
+ QVERIFY(loadFinishedSpy[0][0].toBool());
}
- // last loadProgress should have 100% progress
- QCOMPARE(loadProgressSpy->last()[0].toInt(), 100);
+ // verify no more signals is emitted by waiting for another loadStarted or loadFinished
+ QTRY_LOOP_IMPL(loadStartedSpy.size() != numberOfSignals || loadFinishedSpy.size() != numberOfSignals, 1000, 100);
+
+ // No further loadStarted should have occurred within this time
+ QCOMPARE(loadStartedSpy.size(), numberOfSignals);
+ QCOMPARE(loadFinishedSpy.size(), numberOfSignals);
+ QCOMPARE(page.signalsOrder, numberOfSignals > 0 ? SignalsOrderTwice : SignalsOrderOnce);
+}
+
+void tst_LoadSignals::rejectNavigationRequest_data()
+{
+ QTest::addColumn<QUrl>("initialUrl");
+ QTest::addColumn<QUrl>("rejectedUrl");
+ QTest::addColumn<int>("expectedNavigations");
+ QTest::addColumn<QList<int>>("expectedSignals");
+ QTest::addColumn<int>("errorCode");
+ QTest::addColumn<QWebEngineLoadingInfo::ErrorDomain>("errorDomain");
+ QTest::newRow("Simple")
+ << QUrl("qrc:///resources/page1.html")
+ << QUrl("qrc:///resources/page1.html")
+ << 1 << SignalsOrderOnceFailure << -3 << QWebEngineLoadingInfo::InternalErrorDomain;
+ QTest::newRow("SamePageImmediate")
+ << QUrl("qrc:///resources/page5.html")
+ << QUrl("qrc:///resources/page5.html#anchor")
+ << 1 << SignalsOrderOnce << 200 << QWebEngineLoadingInfo::HttpStatusCodeDomain;
+ QTest::newRow("SamePageDeferred")
+ << QUrl("qrc:///resources/page3.html")
+ << QUrl("qrc:///resources/page3.html#anchor")
+ << 1 << SignalsOrderOnce << 200 << QWebEngineLoadingInfo::HttpStatusCodeDomain;
+ QTest::newRow("OtherPageImmediate")
+ << QUrl("qrc:///resources/page6.html")
+ << QUrl("qrc:///resources/page2.html#anchor")
+ << 2 << SignalsOrderOnceFailure << -3 << QWebEngineLoadingInfo::InternalErrorDomain;
+ QTest::newRow("OtherPageDeferred")
+ << QUrl("qrc:///resources/page7.html")
+ << QUrl("qrc:///resources/page2.html#anchor")
+ << 2 << SignalsOrderTwiceWithFailure << -3 << QWebEngineLoadingInfo::InternalErrorDomain;
}
/**
- * Test that we get a second loadStarted and loadFinished signal
- * for error-pages (unless error-pages are disabled)
- */
-void tst_LoadSignals::secondLoadForError_WhenErrorPageEnabled_data()
+ * Returning false from acceptNavigationRequest means that the load
+ * fails, not that the load never starts.
+ *
+ * See QTBUG-75185.
+ */
+void tst_LoadSignals::rejectNavigationRequest()
{
- QTest::addColumn<bool>("enabled");
- // in this case, we get no second loadStarted and loadFinished, although we had
- // agreed on making the navigation to an error page an individual load
- QTest::newRow("ErrorPageEnabled") << true;
- QTest::newRow("ErrorPageDisabled") << false;
+ QFETCH(QUrl, initialUrl);
+ QFETCH(QUrl, rejectedUrl);
+ QFETCH(int, expectedNavigations);
+ QFETCH(QList<int>, expectedSignals);
+ QFETCH(int, errorCode);
+ QFETCH(QWebEngineLoadingInfo::ErrorDomain, errorDomain);
+
+ page.blacklist.insert(rejectedUrl);
+ page.load(initialUrl);
+ QTRY_COMPARE(page.navigationRequestCount, expectedNavigations);
+ int expectedLoadCount = expectedSignals.size() / 2;
+ QTRY_COMPARE(loadFinishedSpy.size(), expectedLoadCount);
+ QCOMPARE(page.signalsOrder, expectedSignals);
+
+ // verify no more signals is emitted by waiting for another loadStarted or loadFinished
+ QTRY_LOOP_IMPL(loadStartedSpy.size() != expectedLoadCount || loadFinishedSpy.size() != expectedLoadCount, 1000, 100);
+
+ // No further loadStarted should have occurred within this time
+ QCOMPARE(loadStartedSpy.size(), expectedLoadCount);
+ QCOMPARE(loadFinishedSpy.size(), expectedLoadCount);
+ QCOMPARE(page.loadingInfos.last().errorCode(), errorCode);
+ QCOMPARE(page.loadingInfos.last().errorDomain(), errorDomain);
}
-void tst_LoadSignals::secondLoadForError_WhenErrorPageEnabled()
+/**
+ * Test monotonicity of loadProgress signals
+ */
+void tst_LoadSignals::monotonicity()
{
- QFETCH(bool, enabled);
- view->settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, enabled);
- int expectedLoadCount = (enabled ? 2 : 1);
-
- // RFC 2606 guarantees that this will never become a valid domain
- view->load(QUrl("http://nonexistent.invalid"));
- QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy->size(), expectedLoadCount, 10000);
- bool loadSucceeded = (*loadFinishedSpy)[0][0].toBool();
- QVERIFY(!loadSucceeded);
- if (enabled) {
- bool errorPageLoadSucceeded = (*loadFinishedSpy)[1][0].toBool();
- QVERIFY(errorPageLoadSucceeded);
- }
+ HttpServer server;
+ server.setResourceDirs({ server.sharedDataDir() });
+ connect(&server, &HttpServer::newRequest, [] (HttpReqRep *) {
+ QTest::qWait(250); // just add delay to trigger some progress for every sub resource
+ });
+ QVERIFY(server.start());
+
+ view.load(server.url("/loadprogress/main.html"));
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size(), 1, 10000);
+ QVERIFY(loadFinishedSpy[0][0].toBool());
+
+ QVERIFY(page.loadProgress.size() >= 3);
+ // first loadProgress should have 0% progress
+ QCOMPARE(page.loadProgress.first(), 0);
- // Wait for 10 seconds (abort waiting if another loadStarted or loadFinished occurs)
- QTRY_LOOP_IMPL((loadStartedSpy->size() != expectedLoadCount)
- || (loadFinishedSpy->size() != expectedLoadCount), 10000, 100);
+ // every loadProgress should have more progress than the one before
+ int progress = -1;
+ for (int p : page.loadProgress) {
+ QVERIFY(progress < p);
+ progress = p;
+ }
- // No further loadStarted should have occurred within this time
- QCOMPARE(loadStartedSpy->size(), expectedLoadCount);
- QCOMPARE(loadFinishedSpy->size(), expectedLoadCount);
+ // last loadProgress should have 100% progress
+ QCOMPARE(page.loadProgress.last(), 100);
}
/**
@@ -196,70 +301,236 @@ void tst_LoadSignals::secondLoadForError_WhenErrorPageEnabled()
*/
void tst_LoadSignals::loadAfterInPageNavigation_qtbug66869()
{
- view->load(QUrl("qrc:///resources/page3.html"));
- QTRY_COMPARE(loadFinishedSpy->size(), 1);
- bool loadSucceeded = (*loadFinishedSpy)[0][0].toBool();
- QVERIFY(loadSucceeded);
+ view.load(QUrl("qrc:///resources/page3.html"));
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
+ QVERIFY(loadFinishedSpy[0][0].toBool());
// page3 does an in-page navigation after 500ms
- QTest::qWait(2000);
- loadFinishedSpy->clear();
- loadProgressSpy->clear();
- loadStartedSpy->clear();
+ QTRY_COMPARE(view.url(), QUrl("qrc:///resources/page3.html#anchor"));
// second load
- view->load(QUrl("qrc:///resources/page1.html"));
- QTRY_COMPARE(loadFinishedSpy->size(), 1);
- loadSucceeded = (*loadFinishedSpy)[0][0].toBool();
- QVERIFY(loadSucceeded);
+ view.load(QUrl("qrc:///resources/page1.html"));
+ QTRY_COMPARE(loadFinishedSpy.size(), 2);
+ QVERIFY(loadFinishedSpy[0][0].toBool());
// loadStarted and loadFinished should have been signalled
- QCOMPARE(loadStartedSpy->size(), 1);
-
- // reminder that we still need to solve the core issue
- QFAIL("https://codereview.qt-project.org/#/c/222112/ only hides the symptom, the core issue still needs to be solved");
+ QCOMPARE(loadStartedSpy.size(), 2);
}
-/**
- * Test that file-downloads don't trigger loadStarted or loadFinished signals.
- * See QTBUG-66661
- */
-void tst_LoadSignals::fileDownloadDoesNotTriggerLoadSignals_qtbug66661()
+void tst_LoadSignals::fileDownload()
{
- view->load(QUrl("qrc:///resources/page4.html"));
- QTRY_COMPARE(loadFinishedSpy->size(), 1);
- bool loadSucceeded = (*loadFinishedSpy)[0][0].toBool();
- QVERIFY(loadSucceeded);
+ view.load(QUrl("qrc:///resources/page4.html"));
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
+ QVERIFY(loadFinishedSpy[0][0].toBool());
// allow the download
QTemporaryDir tempDir;
- QWebEngineDownloadItem::DownloadState downloadState = QWebEngineDownloadItem::DownloadRequested;
- connect(view->page()->profile(), &QWebEngineProfile::downloadRequested,
- [&downloadState, &tempDir](QWebEngineDownloadItem* item){
- connect(item, &QWebEngineDownloadItem::stateChanged, [&downloadState](QWebEngineDownloadItem::DownloadState newState){
- downloadState = newState;
- });
- item->setDownloadDirectory(tempDir.filePath(QFileInfo(item->path()).path()));
- item->setDownloadFileName(QFileInfo(item->path()).fileName());
- item->accept();
- });
+ QVERIFY(tempDir.isValid());
+ QWebEngineDownloadRequest::DownloadState downloadState = QWebEngineDownloadRequest::DownloadRequested;
+ ScopedConnection sc1 =
+ connect(&profile, &QWebEngineProfile::downloadRequested,
+ [&downloadState, &tempDir](QWebEngineDownloadRequest *item) {
+ connect(item, &QWebEngineDownloadRequest::stateChanged,
+ [&downloadState](QWebEngineDownloadRequest::DownloadState newState) {
+ downloadState = newState;
+ });
+ item->setDownloadDirectory(tempDir.path());
+ item->accept();
+ });
// trigger the download link that becomes focused on page4
- QTest::qWait(1000);
- QTest::sendKeyEvent(QTest::Press, view->focusProxy(), Qt::Key_Return, QString("\r"), Qt::NoModifier);
- QTest::sendKeyEvent(QTest::Release, view->focusProxy(), Qt::Key_Return, QString("\r"), Qt::NoModifier);
-
- // Wait for 10 seconds (abort waiting if another loadStarted or loadFinished occurs)
- QTRY_LOOP_IMPL((loadStartedSpy->size() != 1)
- || (loadFinishedSpy->size() != 1), 10000, 100);
+ QTest::sendKeyEvent(QTest::Press, view.focusProxy(), Qt::Key_Return, QString("\r"), Qt::NoModifier);
+ QTest::sendKeyEvent(QTest::Release, view.focusProxy(), Qt::Key_Return, QString("\r"), Qt::NoModifier);
// Download must have occurred
- QTRY_COMPARE(downloadState, QWebEngineDownloadItem::DownloadCompleted);
+ QTRY_COMPARE(downloadState, QWebEngineDownloadRequest::DownloadCompleted);
+ QTRY_COMPARE(loadFinishedSpy.size() + loadStartedSpy.size(), 4);
- // No further loadStarted should have occurred within this time
- QCOMPARE(loadStartedSpy->size(), 1);
- QCOMPARE(loadFinishedSpy->size(), 1);
+ // verify no more signals is emitted by waiting for another loadStarted or loadFinished
+ QTRY_LOOP_IMPL(loadStartedSpy.size() != 2 || loadFinishedSpy.size() != 2, 1000, 100);
+
+ QCOMPARE(page.signalsOrder, SignalsOrderTwiceWithFailure);
+ QCOMPARE(page.loadingInfos[3].errorCode(), -3);
+ QCOMPARE(page.loadingInfos[3].errorDomain(), QWebEngineLoadingInfo::InternalErrorDomain);
+}
+
+void tst_LoadSignals::numberOfStartedAndFinishedSignalsIsSame_data()
+{
+ QTest::addColumn<bool>("imageFromServer");
+ QTest::addColumn<QString>("imageResourceUrl");
+ // triggers these calls in delegate internally:
+ // just two ordered triples DidStartNavigation/DidFinishNavigation/DidFinishLoad
+ QTest::newRow("no_image_resource") << false << "";
+ // out of order: DidStartNavigation/DidFinishNavigation/DidStartNavigation/DidFailLoad/DidFinishNavigation/DidFinishLoad
+ QTest::newRow("with_invalid_image") << false << "https://non.existent.locahost/image.png";
+ // out of order: DidStartNavigation/DidFinishNavigation/DidStartNavigation/DidFinishLoad/DidFinishNavigation/DidFinishLoad
+ QTest::newRow("with_server_image") << true << "";
+}
+
+void tst_LoadSignals::numberOfStartedAndFinishedSignalsIsSame()
+{
+ QFETCH(bool, imageFromServer);
+ QFETCH(QString, imageResourceUrl);
+
+ HttpServer server;
+ server.setResourceDirs({ server.sharedDataDir() });
+ QVERIFY(server.start());
+
+ QUrl serverImage = server.url("/hedgehog.png");
+ QString imageUrl(!imageFromServer && imageResourceUrl.isEmpty()
+ ? "" : (imageFromServer ? serverImage.toEncoded() : imageResourceUrl));
+
+ auto html = "<html><head><link rel='icon' href='data:,'></head><body>"
+ "%1" "<form method='GET' name='hiddenform' action='qrc:///resources/page1.html' />"
+ "<script language='javascript'>document.forms[0].submit();</script>"
+ "</body></html>";
+ view.page()->setHtml(QString(html).arg(imageUrl.isEmpty() ? "" : "<img src='" + imageUrl + "'>"));
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
+
+ resetSpies();
+ QTRY_LOOP_IMPL(loadStartedSpy.size() || loadFinishedSpy.size(), 1000, 100);
+ QCOMPARE(page.signalsOrder, SignalsOrderOnce);
+ QCOMPARE(page.loadingInfos[1].errorCode(), 200);
+ QCOMPARE(page.loadingInfos[1].errorDomain(), QWebEngineLoadingInfo::HttpStatusCodeDomain);
+}
+
+void tst_LoadSignals::loadFinishedAfterNotFoundError_data()
+{
+ QTest::addColumn<bool>("rfcInvalid");
+ QTest::addColumn<bool>("withServer");
+ QTest::addColumn<int>("errorCode");
+ QTest::addColumn<int>("errorDomain");
+ QTest::addRow("rfc_invalid") << true << false << -105 << int(QWebEngineLoadingInfo::ConnectionErrorDomain);
+ QTest::addRow("non_existent") << false << false << -105 << int(QWebEngineLoadingInfo::ConnectionErrorDomain);
+ QTest::addRow("server_404") << false << true << 404 << int(QWebEngineLoadingInfo::HttpStatusCodeDomain);
}
+void tst_LoadSignals::loadFinishedAfterNotFoundError()
+{
+ QFETCH(bool, rfcInvalid);
+ QFETCH(bool, withServer);
+ QFETCH(int, errorCode);
+ QFETCH(int, errorDomain);
+
+ QScopedPointer<HttpServer> server;
+ if (withServer) {
+ server.reset(new HttpServer);
+ QVERIFY(server->start());
+ }
+ view.settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, false);
+ auto url = server
+ ? server->url("/not-found-page.html")
+ : QUrl(rfcInvalid ? "http://some.invalid" : "http://non.existent/url");
+ view.load(url);
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size(), 1, 20000);
+ QVERIFY(!loadFinishedSpy.at(0).at(0).toBool());
+ QCOMPARE(toPlainTextSync(view.page()), QString());
+ QCOMPARE(loadFinishedSpy.size(), 1);
+ QCOMPARE(loadStartedSpy.size(), 1);
+ QVERIFY(std::is_sorted(page.loadProgress.begin(), page.loadProgress.end()));
+ page.loadProgress.clear();
+
+ { auto &&loadStart = page.loadingInfos[0], &&loadFinish = page.loadingInfos[1];
+ QCOMPARE(loadStart.status(), QWebEngineLoadingInfo::LoadStartedStatus);
+ QCOMPARE(loadStart.isErrorPage(), false);
+ QCOMPARE(loadStart.errorCode(), 0);
+ QCOMPARE(loadStart.errorDomain(), QWebEngineLoadingInfo::NoErrorDomain);
+ QCOMPARE(loadStart.errorString(), QString());
+ QCOMPARE(loadFinish.status(), QWebEngineLoadingInfo::LoadFailedStatus);
+ QCOMPARE(loadFinish.isErrorPage(), false);
+ QCOMPARE(loadFinish.errorCode(), errorCode);
+ QCOMPARE(loadFinish.errorDomain(), errorDomain);
+ QVERIFY(!loadFinish.errorString().isEmpty());
+ }
+
+ view.settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, true);
+ url = server
+ ? server->url("/another-missing-one.html")
+ : QUrl(rfcInvalid ? "http://some.other.invalid" : "http://another.non.existent/url");
+ view.load(url);
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size(), 2, 20000);
+ QVERIFY(!loadFinishedSpy.at(1).at(0).toBool());
+ QCOMPARE(loadStartedSpy.size(), 2);
+
+ QEXPECT_FAIL("", "No more loads (like separate load for error pages) are expected", Continue);
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size(), 3, 1000);
+ QCOMPARE(loadStartedSpy.size(), 2);
+ QVERIFY(std::is_sorted(page.loadProgress.begin(), page.loadProgress.end()));
+
+ { auto &&loadStart = page.loadingInfos[2], &&loadFinish = page.loadingInfos[3];
+ QCOMPARE(loadStart.status(), QWebEngineLoadingInfo::LoadStartedStatus);
+ QCOMPARE(loadStart.isErrorPage(), false);
+ QCOMPARE(loadStart.errorCode(), 0);
+ QCOMPARE(loadStart.errorDomain(), QWebEngineLoadingInfo::NoErrorDomain);
+ QCOMPARE(loadStart.errorString(), QString());
+ QCOMPARE(loadFinish.status(), QWebEngineLoadingInfo::LoadFailedStatus);
+ QCOMPARE(loadFinish.isErrorPage(), true);
+ QCOMPARE(loadFinish.errorCode(), errorCode);
+ QCOMPARE(loadFinish.errorDomain(), errorDomain);
+ QVERIFY(!loadFinish.errorString().isEmpty());
+ }
+}
+
+void tst_LoadSignals::errorPageTriggered_data()
+{
+ QTest::addColumn<QString>("urlPath");
+ QTest::addColumn<bool>("loadSucceed");
+ QTest::addColumn<bool>("triggersErrorPage");
+ QTest::addColumn<int>("errorCode");
+ QTest::addColumn<QWebEngineLoadingInfo::ErrorDomain>("errorDomain");
+ QTest::newRow("/content/200") << QStringLiteral("/content/200") << true << false << 200 << QWebEngineLoadingInfo::HttpStatusCodeDomain;
+ QTest::newRow("/empty/200") << QStringLiteral("/content/200") << true << false << 200 << QWebEngineLoadingInfo::HttpStatusCodeDomain;
+ QTest::newRow("/content/404") << QStringLiteral("/content/404") << false << false << 404 << QWebEngineLoadingInfo::HttpStatusCodeDomain;
+ QTest::newRow("/empty/404") << QStringLiteral("/empty/404") << false << true << 404 << QWebEngineLoadingInfo::HttpStatusCodeDomain;
+}
+
+void tst_LoadSignals::errorPageTriggered()
+{
+ HttpServer server;
+ connect(&server, &HttpServer::newRequest, [] (HttpReqRep *rr) {
+ QList<QByteArray> parts = rr->requestPath().split('/');
+ if (parts.size() != 3) {
+ // For example, /favicon.ico
+ rr->sendResponse(404);
+ return;
+ }
+ bool isDocumentEmpty = (parts[1] == "empty");
+ int httpStatusCode = parts[2].toInt();
+
+ rr->setResponseHeader(QByteArrayLiteral("content-type"), QByteArrayLiteral("text/html"));
+ if (!isDocumentEmpty) {
+ rr->setResponseBody(QByteArrayLiteral("<html></html>"));
+ }
+ rr->sendResponse(httpStatusCode);
+ });
+ QVERIFY(server.start());
+
+ QFETCH(QString, urlPath);
+ QFETCH(bool, loadSucceed);
+ QFETCH(bool, triggersErrorPage);
+ QFETCH(int, errorCode);
+ QFETCH(QWebEngineLoadingInfo::ErrorDomain, errorDomain);
+
+ view.settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, true);
+ view.load(server.url(urlPath));
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
+ QCOMPARE(loadFinishedSpy[0][0].toBool(), loadSucceed);
+ if (triggersErrorPage)
+ QVERIFY(toPlainTextSync(view.page()).contains("HTTP ERROR 404"));
+ else
+ QVERIFY(toPlainTextSync(view.page()).isEmpty());
+ QCOMPARE(page.loadingInfos[1].errorCode(), errorCode);
+ QCOMPARE(page.loadingInfos[1].errorDomain(), errorDomain);
+ loadFinishedSpy.clear();
+
+ view.settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, false);
+ view.load(server.url(urlPath));
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
+ QCOMPARE(loadFinishedSpy[0][0].toBool(), loadSucceed);
+ QVERIFY(toPlainTextSync(view.page()).isEmpty());
+ QCOMPARE(page.loadingInfos[3].errorCode(), errorCode);
+ QCOMPARE(page.loadingInfos[3].errorDomain(), errorDomain);
+ loadFinishedSpy.clear();
+}
QTEST_MAIN(tst_LoadSignals)
#include "tst_loadsignals.moc"
diff --git a/tests/auto/widgets/loadsignals/tst_loadsignals.qrc b/tests/auto/widgets/loadsignals/tst_loadsignals.qrc
deleted file mode 100644
index 316deecb8..000000000
--- a/tests/auto/widgets/loadsignals/tst_loadsignals.qrc
+++ /dev/null
@@ -1,9 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>resources/page1.html</file>
- <file>resources/page2.html</file>
- <file>resources/page3.html</file>
- <file>resources/page4.html</file>
- <file>resources/downloadable.tar.gz</file>
- </qresource>
-</RCC>
diff --git a/tests/auto/widgets/offscreen/CMakeLists.txt b/tests/auto/widgets/offscreen/CMakeLists.txt
new file mode 100644
index 000000000..756e53c43
--- /dev/null
+++ b/tests/auto/widgets/offscreen/CMakeLists.txt
@@ -0,0 +1,25 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_test(tst_offscreen
+ SOURCES
+ tst_offscreen.cpp
+ LIBRARIES
+ Qt::WebEngineWidgets
+)
+
+set(tst_offscreen_resource_files
+ "test.html"
+)
+
+set_tests_properties(tst_offscreen PROPERTIES
+ ENVIRONMENT QT_QPA_PLATFORM=offscreen
+)
+
+qt_internal_add_resource(tst_offscreen "tst_offscreen"
+ PREFIX
+ "/"
+ FILES
+ ${tst_offscreen_resource_files}
+)
+
diff --git a/tests/auto/widgets/offscreen/offscreen.pro b/tests/auto/widgets/offscreen/offscreen.pro
deleted file mode 100644
index b8e5632f9..000000000
--- a/tests/auto/widgets/offscreen/offscreen.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-include(../tests.pri)
-QT += webengine
-qpa.name = QT_QPA_PLATFORM
-qpa.value = offscreen
-QT_TOOL_ENV += qpa
-
diff --git a/tests/auto/widgets/offscreen/tst_offscreen.cpp b/tests/auto/widgets/offscreen/tst_offscreen.cpp
index 7573b0537..553dc653b 100644
--- a/tests/auto/widgets/offscreen/tst_offscreen.cpp
+++ b/tests/auto/widgets/offscreen/tst_offscreen.cpp
@@ -1,32 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-#include "qtwebengineglobal.h"
#include <QTest>
#include <QSignalSpy>
#include <QWebEngineProfile>
@@ -52,7 +26,7 @@ void tst_OffScreen::offscreen()
page.load(QUrl("qrc:/test.html"));
view.show();
QTRY_COMPARE(view.isVisible(), true);
- QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.count() > 0, true, 20000);
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size() > 0, true, 20000);
QCOMPARE(loadFinishedSpy.takeFirst().at(0).toBool(), true);
}
diff --git a/tests/auto/widgets/offscreen/tst_offscreen.qrc b/tests/auto/widgets/offscreen/tst_offscreen.qrc
deleted file mode 100644
index 8a998fe85..000000000
--- a/tests/auto/widgets/offscreen/tst_offscreen.qrc
+++ /dev/null
@@ -1,6 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
-<qresource>
- <file>test.html</file>
-</qresource>
-</RCC>
-
diff --git a/tests/auto/widgets/origins/origins.pro b/tests/auto/widgets/origins/origins.pro
deleted file mode 100644
index 7498354de..000000000
--- a/tests/auto/widgets/origins/origins.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-include(../tests.pri)
-CONFIG += c++14
-qtConfig(webengine-webchannel):qtHaveModule(websockets) {
- QT += websockets
- DEFINES += WEBSOCKETS
-}
-
diff --git a/tests/auto/widgets/origins/resources/mixedSchemes.html b/tests/auto/widgets/origins/resources/mixedSchemes.html
deleted file mode 100644
index c73e9ecdc..000000000
--- a/tests/auto/widgets/origins/resources/mixedSchemes.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>Mixed</title>
- <script>
- var result;
- var canary;
-
- function setIFrameUrl(url) {
- result = undefined;
- canary = undefined;
- document.getElementById("iframe").setAttribute("src", url);
- // Early fire is OK unless the test is expecting cannotLoad.
- // If timeout is too short then a false positive is possible.
- setTimeout(() => { result = result || "cannotLoad"; }, 500);
- }
-
- addEventListener("load", function() {
- document.getElementById("iframe").addEventListener("load", function() {
- if (canary && window[0].canary)
- result = "canLoadAndAccess";
- else
- result = "canLoadButNotAccess";
- });
- });
- </script>
- </head>
- <body>
- <iframe id="iframe"></iframe>
- </body>
-</html>
diff --git a/tests/auto/widgets/origins/resources/mixedSchemes_frame.html b/tests/auto/widgets/origins/resources/mixedSchemes_frame.html
deleted file mode 100644
index 00c20ba37..000000000
--- a/tests/auto/widgets/origins/resources/mixedSchemes_frame.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>Mixed - Frame</title>
- <script>
- var canary = true;
- parent.canary = true;
- </script>
- </head>
- <body></body>
-</html>
diff --git a/tests/auto/widgets/origins/resources/redirect.css b/tests/auto/widgets/origins/resources/redirect.css
deleted file mode 100644
index 41d7560cc..000000000
--- a/tests/auto/widgets/origins/resources/redirect.css
+++ /dev/null
@@ -1,8 +0,0 @@
-@font-face {
- font-family: 'MyWebFont';
- src: url('redirect1:/resources/Akronim-Regular.woff2') format('woff2');
-}
-
-body {
- font-family: 'MyWebFont', Fallback, sans-serif;
-}
diff --git a/tests/auto/widgets/origins/resources/redirect.html b/tests/auto/widgets/origins/resources/redirect.html
deleted file mode 100644
index 04948e14b..000000000
--- a/tests/auto/widgets/origins/resources/redirect.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>redirect</title>
- <link rel="stylesheet" href="redirect1:/resources/redirect.css">
- </head>
- <body>
- Text
- </body>
-</html>
diff --git a/tests/auto/widgets/origins/tst_origins.cpp b/tests/auto/widgets/origins/tst_origins.cpp
deleted file mode 100644
index e3927f763..000000000
--- a/tests/auto/widgets/origins/tst_origins.cpp
+++ /dev/null
@@ -1,874 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "../util.h"
-
-#include <QtCore/qfile.h>
-#include <QtTest/QtTest>
-#include <QtWebEngineCore/qwebengineurlrequestjob.h>
-#include <QtWebEngineCore/qwebengineurlscheme.h>
-#include <QtWebEngineCore/qwebengineurlschemehandler.h>
-#include <QtWebEngineWidgets/qwebenginepage.h>
-#include <QtWebEngineWidgets/qwebengineprofile.h>
-#include <QtWebEngineWidgets/qwebenginesettings.h>
-#if defined(WEBSOCKETS)
-#include <QtWebSockets/qwebsocket.h>
-#include <QtWebSockets/qwebsocketserver.h>
-#include <QtWebChannel/qwebchannel.h>
-#endif
-#include <QtWidgets/qaction.h>
-
-#define QSL QStringLiteral
-#define QBAL QByteArrayLiteral
-#define THIS_DIR TESTS_SOURCE_DIR "origins/"
-
-void registerSchemes()
-{
- {
- QWebEngineUrlScheme scheme(QBAL("PathSyntax"));
- QWebEngineUrlScheme::registerScheme(scheme);
- }
-
- {
- QWebEngineUrlScheme scheme(QBAL("PathSyntax-Secure"));
- scheme.setFlags(QWebEngineUrlScheme::SecureScheme);
- QWebEngineUrlScheme::registerScheme(scheme);
- }
-
- {
- QWebEngineUrlScheme scheme(QBAL("PathSyntax-Secure-ServiceWorkersAllowed"));
- scheme.setFlags(QWebEngineUrlScheme::SecureScheme | QWebEngineUrlScheme::ServiceWorkersAllowed);
- QWebEngineUrlScheme::registerScheme(scheme);
- }
-
- {
- QWebEngineUrlScheme scheme(QBAL("PathSyntax-Local"));
- scheme.setFlags(QWebEngineUrlScheme::LocalScheme);
- QWebEngineUrlScheme::registerScheme(scheme);
- }
-
- {
- QWebEngineUrlScheme scheme(QBAL("PathSyntax-LocalAccessAllowed"));
- scheme.setFlags(QWebEngineUrlScheme::LocalAccessAllowed);
- QWebEngineUrlScheme::registerScheme(scheme);
- }
-
- {
- QWebEngineUrlScheme scheme(QBAL("PathSyntax-NoAccessAllowed"));
- scheme.setFlags(QWebEngineUrlScheme::NoAccessAllowed);
- QWebEngineUrlScheme::registerScheme(scheme);
- }
-
- {
- QWebEngineUrlScheme scheme(QBAL("PathSyntax-ServiceWorkersAllowed"));
- scheme.setFlags(QWebEngineUrlScheme::ServiceWorkersAllowed);
- QWebEngineUrlScheme::registerScheme(scheme);
- }
-
- {
- QWebEngineUrlScheme scheme(QBAL("PathSyntax-ViewSourceAllowed"));
- scheme.setFlags(QWebEngineUrlScheme::ViewSourceAllowed);
- QWebEngineUrlScheme::registerScheme(scheme);
- }
-
- {
- QWebEngineUrlScheme scheme(QBAL("HostSyntax"));
- scheme.setSyntax(QWebEngineUrlScheme::Syntax::Host);
- QWebEngineUrlScheme::registerScheme(scheme);
- }
-
- {
- QWebEngineUrlScheme scheme(QBAL("HostSyntax-ContentSecurityPolicyIgnored"));
- scheme.setSyntax(QWebEngineUrlScheme::Syntax::Host);
- scheme.setFlags(QWebEngineUrlScheme::ContentSecurityPolicyIgnored);
- QWebEngineUrlScheme::registerScheme(scheme);
- }
-
- {
- QWebEngineUrlScheme scheme(QBAL("HostAndPortSyntax"));
- scheme.setSyntax(QWebEngineUrlScheme::Syntax::HostAndPort);
- scheme.setDefaultPort(42);
- QWebEngineUrlScheme::registerScheme(scheme);
- }
-
- {
- QWebEngineUrlScheme scheme(QBAL("HostPortAndUserInformationSyntax"));
- scheme.setSyntax(QWebEngineUrlScheme::Syntax::HostPortAndUserInformation);
- scheme.setDefaultPort(42);
- QWebEngineUrlScheme::registerScheme(scheme);
- }
-
- {
- QWebEngineUrlScheme scheme(QBAL("redirect1"));
- scheme.setFlags(QWebEngineUrlScheme::CorsEnabled);
- QWebEngineUrlScheme::registerScheme(scheme);
- }
-
- {
- QWebEngineUrlScheme scheme(QBAL("redirect2"));
- scheme.setFlags(QWebEngineUrlScheme::CorsEnabled);
- QWebEngineUrlScheme::registerScheme(scheme);
- }
-
- {
- QWebEngineUrlScheme scheme(QBAL("cors"));
- scheme.setFlags(QWebEngineUrlScheme::CorsEnabled);
- QWebEngineUrlScheme::registerScheme(scheme);
- }
-
-}
-Q_CONSTRUCTOR_FUNCTION(registerSchemes)
-
-class TstUrlSchemeHandler final : public QWebEngineUrlSchemeHandler {
- Q_OBJECT
-
-public:
- TstUrlSchemeHandler(QWebEngineProfile *profile)
- {
- profile->installUrlSchemeHandler(QBAL("tst"), this);
-
- profile->installUrlSchemeHandler(QBAL("PathSyntax"), this);
- profile->installUrlSchemeHandler(QBAL("PathSyntax-Secure"), this);
- profile->installUrlSchemeHandler(QBAL("PathSyntax-Secure-ServiceWorkersAllowed"), this);
- profile->installUrlSchemeHandler(QBAL("PathSyntax-Local"), this);
- profile->installUrlSchemeHandler(QBAL("PathSyntax-LocalAccessAllowed"), this);
- profile->installUrlSchemeHandler(QBAL("PathSyntax-NoAccessAllowed"), this);
- profile->installUrlSchemeHandler(QBAL("PathSyntax-ServiceWorkersAllowed"), this);
- profile->installUrlSchemeHandler(QBAL("PathSyntax-ViewSourceAllowed"), this);
- profile->installUrlSchemeHandler(QBAL("HostSyntax"), this);
- profile->installUrlSchemeHandler(QBAL("HostSyntax-ContentSecurityPolicyIgnored"), this);
- profile->installUrlSchemeHandler(QBAL("HostAndPortSyntax"), this);
- profile->installUrlSchemeHandler(QBAL("HostPortAndUserInformationSyntax"), this);
- profile->installUrlSchemeHandler(QBAL("redirect1"), this);
- profile->installUrlSchemeHandler(QBAL("redirect2"), this);
- profile->installUrlSchemeHandler(QBAL("cors"), this);
- }
-
- QVector<QUrl> &requests() { return m_requests; }
-
-private:
- void requestStarted(QWebEngineUrlRequestJob *job) override
- {
- QUrl url = job->requestUrl();
- m_requests << url;
-
- if (url.scheme() == QBAL("redirect1")) {
- url.setScheme(QBAL("redirect2"));
- job->redirect(url);
- return;
- }
-
- QString pathPrefix = QSL(THIS_DIR);
- QString pathSuffix = url.path();
- QFile *file = new QFile(pathPrefix + pathSuffix, job);
- if (!file->open(QIODevice::ReadOnly)) {
- job->fail(QWebEngineUrlRequestJob::RequestFailed);
- return;
- }
- QByteArray mimeType = QBAL("text/html");
- if (pathSuffix.endsWith(QSL(".js")))
- mimeType = QBAL("application/javascript");
- else if (pathSuffix.endsWith(QSL(".css")))
- mimeType = QBAL("text/css");
- job->reply(mimeType, file);
- }
-
- QVector<QUrl> m_requests;
-};
-
-class tst_Origins final : public QObject {
- Q_OBJECT
-
-private Q_SLOTS:
- void initTestCase();
- void cleanupTestCase();
- void init();
- void cleanup();
-
- void jsUrlCanon();
- void jsUrlRelative();
- void jsUrlOrigin();
- void subdirWithAccess();
- void subdirWithoutAccess();
- void mixedSchemes();
- void mixedSchemesWithCsp();
- void mixedXHR();
-#if defined(WEBSOCKETS)
- void webSocket();
-#endif
- void dedicatedWorker();
- void sharedWorker();
- void serviceWorker();
- void viewSource();
- void createObjectURL();
- void redirect();
-
-private:
- bool verifyLoad(const QUrl &url)
- {
- QSignalSpy spy(m_page, &QWebEnginePage::loadFinished);
- m_page->load(url);
- [&spy]() { QTRY_VERIFY_WITH_TIMEOUT(!spy.isEmpty(), 90000); }();
- return !spy.isEmpty() && spy.front().value(0).toBool();
- }
-
- QVariant eval(const QString &code)
- {
- return evaluateJavaScriptSync(m_page, code);
- }
-
- QWebEngineProfile m_profile;
- QWebEnginePage *m_page = nullptr;
- TstUrlSchemeHandler *m_handler = nullptr;
-};
-
-void tst_Origins::initTestCase()
-{
- QTest::ignoreMessage(
- QtWarningMsg,
- QRegularExpression("Please register the custom scheme 'tst'.*"));
-
- m_handler = new TstUrlSchemeHandler(&m_profile);
-}
-
-void tst_Origins::cleanupTestCase()
-{
- QVERIFY(!m_page);
- delete m_handler;
-}
-
-void tst_Origins::init()
-{
- m_page = new QWebEnginePage(&m_profile, nullptr);
-}
-
-void tst_Origins::cleanup()
-{
- delete m_page;
- m_page = nullptr;
- m_handler->requests().clear();
-}
-
-// Test URL parsing and canonicalization in Blink. The implementation of this
-// part is mostly shared between Blink and Chromium proper.
-void tst_Origins::jsUrlCanon()
-{
- QVERIFY(verifyLoad(QSL("about:blank")));
-
- // Standard schemes are biased towards the authority part.
- QCOMPARE(eval(QSL("new URL(\"http:foo/bar\").href")), QVariant(QSL("http://foo/bar")));
- QCOMPARE(eval(QSL("new URL(\"http:/foo/bar\").href")), QVariant(QSL("http://foo/bar")));
- QCOMPARE(eval(QSL("new URL(\"http://foo/bar\").href")), QVariant(QSL("http://foo/bar")));
- QCOMPARE(eval(QSL("new URL(\"http:///foo/bar\").href")), QVariant(QSL("http://foo/bar")));
-
- // The file scheme is however a (particularly) special case.
-#ifdef Q_OS_WIN
- QCOMPARE(eval(QSL("new URL(\"file:foo/bar\").href")), QVariant(QSL("file://foo/bar")));
- QCOMPARE(eval(QSL("new URL(\"file:/foo/bar\").href")), QVariant(QSL("file://foo/bar")));
- QCOMPARE(eval(QSL("new URL(\"file://foo/bar\").href")), QVariant(QSL("file://foo/bar")));
- QCOMPARE(eval(QSL("new URL(\"file:///foo/bar\").href")), QVariant(QSL("file:///foo/bar")));
-#else
- QCOMPARE(eval(QSL("new URL(\"file:foo/bar\").href")), QVariant(QSL("file:///foo/bar")));
- QCOMPARE(eval(QSL("new URL(\"file:/foo/bar\").href")), QVariant(QSL("file:///foo/bar")));
- QCOMPARE(eval(QSL("new URL(\"file://foo/bar\").href")), QVariant(QSL("file://foo/bar")));
- QCOMPARE(eval(QSL("new URL(\"file:///foo/bar\").href")), QVariant(QSL("file:///foo/bar")));
-#endif
-
- // The qrc scheme is a PathSyntax scheme, having only a path and nothing else.
- QCOMPARE(eval(QSL("new URL(\"qrc:foo/bar\").href")), QVariant(QSL("qrc:foo/bar")));
- QCOMPARE(eval(QSL("new URL(\"qrc:/foo/bar\").href")), QVariant(QSL("qrc:/foo/bar")));
- QCOMPARE(eval(QSL("new URL(\"qrc://foo/bar\").href")), QVariant(QSL("qrc://foo/bar")));
- QCOMPARE(eval(QSL("new URL(\"qrc:///foo/bar\").href")), QVariant(QSL("qrc:///foo/bar")));
-
- // Same for unregistered schemes.
- QCOMPARE(eval(QSL("new URL(\"tst:foo/bar\").href")), QVariant(QSL("tst:foo/bar")));
- QCOMPARE(eval(QSL("new URL(\"tst:/foo/bar\").href")), QVariant(QSL("tst:/foo/bar")));
- QCOMPARE(eval(QSL("new URL(\"tst://foo/bar\").href")), QVariant(QSL("tst://foo/bar")));
- QCOMPARE(eval(QSL("new URL(\"tst:///foo/bar\").href")), QVariant(QSL("tst:///foo/bar")));
-
- // A HostSyntax scheme is like http without the port & user information.
- QCOMPARE(eval(QSL("new URL(\"HostSyntax:foo/bar\").href")), QVariant(QSL("hostsyntax://foo/bar")));
- QCOMPARE(eval(QSL("new URL(\"HostSyntax:foo:42/bar\").href")), QVariant(QSL("hostsyntax://foo/bar")));
- QCOMPARE(eval(QSL("new URL(\"HostSyntax:a:b@foo/bar\").href")), QVariant(QSL("hostsyntax://foo/bar")));
-
- // A HostAndPortSyntax scheme is like http without the user information.
- QCOMPARE(eval(QSL("new URL(\"HostAndPortSyntax:foo/bar\").href")),
- QVariant(QSL("hostandportsyntax://foo/bar")));
- QCOMPARE(eval(QSL("new URL(\"HostAndPortSyntax:foo:41/bar\").href")),
- QVariant(QSL("hostandportsyntax://foo:41/bar")));
- QCOMPARE(eval(QSL("new URL(\"HostAndPortSyntax:foo:42/bar\").href")),
- QVariant(QSL("hostandportsyntax://foo/bar")));
- QCOMPARE(eval(QSL("new URL(\"HostAndPortSyntax:a:b@foo/bar\").href")),
- QVariant(QSL("hostandportsyntax://foo/bar")));
-
- // A HostPortAndUserInformationSyntax scheme is exactly like http.
- QCOMPARE(eval(QSL("new URL(\"HostPortAndUserInformationSyntax:foo/bar\").href")),
- QVariant(QSL("hostportanduserinformationsyntax://foo/bar")));
- QCOMPARE(eval(QSL("new URL(\"HostPortAndUserInformationSyntax:foo:41/bar\").href")),
- QVariant(QSL("hostportanduserinformationsyntax://foo:41/bar")));
- QCOMPARE(eval(QSL("new URL(\"HostPortAndUserInformationSyntax:foo:42/bar\").href")),
- QVariant(QSL("hostportanduserinformationsyntax://foo/bar")));
- QCOMPARE(eval(QSL("new URL(\"HostPortAndUserInformationSyntax:a:b@foo/bar\").href")),
- QVariant(QSL("hostportanduserinformationsyntax://a:b@foo/bar")));
-}
-
-// Test relative URL resolution.
-void tst_Origins::jsUrlRelative()
-{
- QVERIFY(verifyLoad(QSL("about:blank")));
-
- // Schemes with hosts, like http, work as expected.
- QCOMPARE(eval(QSL("new URL('bar', 'http://foo').href")), QVariant(QSL("http://foo/bar")));
- QCOMPARE(eval(QSL("new URL('baz', 'http://foo/bar').href")), QVariant(QSL("http://foo/baz")));
- QCOMPARE(eval(QSL("new URL('baz', 'http://foo/bar/').href")), QVariant(QSL("http://foo/bar/baz")));
- QCOMPARE(eval(QSL("new URL('/baz', 'http://foo/bar/').href")), QVariant(QSL("http://foo/baz")));
- QCOMPARE(eval(QSL("new URL('./baz', 'http://foo/bar/').href")), QVariant(QSL("http://foo/bar/baz")));
- QCOMPARE(eval(QSL("new URL('../baz', 'http://foo/bar/').href")), QVariant(QSL("http://foo/baz")));
- QCOMPARE(eval(QSL("new URL('../../baz', 'http://foo/bar/').href")), QVariant(QSL("http://foo/baz")));
- QCOMPARE(eval(QSL("new URL('//baz', 'http://foo/bar/').href")), QVariant(QSL("http://baz/")));
-
- // In the case of schemes without hosts, relative URLs only work if the URL
- // starts with a single slash -- and canonicalization does not guarantee
- // this. The following cases all fail with TypeErrors.
- QCOMPARE(eval(QSL("new URL('bar', 'tst:foo').href")), QVariant());
- QCOMPARE(eval(QSL("new URL('baz', 'tst:foo/bar').href")), QVariant());
- QCOMPARE(eval(QSL("new URL('bar', 'tst://foo').href")), QVariant());
- QCOMPARE(eval(QSL("new URL('bar', 'tst:///foo').href")), QVariant());
-
- // However, registered custom schemes have been patched to allow relative
- // URLs even without an initial slash.
- QCOMPARE(eval(QSL("new URL('bar', 'qrc:foo').href")), QVariant(QSL("qrc:bar")));
- QCOMPARE(eval(QSL("new URL('baz', 'qrc:foo/bar').href")), QVariant(QSL("qrc:foo/baz")));
- QCOMPARE(eval(QSL("new URL('bar', 'qrc://foo').href")), QVariant());
- QCOMPARE(eval(QSL("new URL('bar', 'qrc:///foo').href")), QVariant());
-
- // With a slash it works the same as http except 'foo' is part of the path and not the host.
- QCOMPARE(eval(QSL("new URL('bar', 'qrc:/foo').href")), QVariant(QSL("qrc:/bar")));
- QCOMPARE(eval(QSL("new URL('bar', 'qrc:/foo/').href")), QVariant(QSL("qrc:/foo/bar")));
- QCOMPARE(eval(QSL("new URL('baz', 'qrc:/foo/bar').href")), QVariant(QSL("qrc:/foo/baz")));
- QCOMPARE(eval(QSL("new URL('baz', 'qrc:/foo/bar/').href")), QVariant(QSL("qrc:/foo/bar/baz")));
- QCOMPARE(eval(QSL("new URL('/baz', 'qrc:/foo/bar/').href")), QVariant(QSL("qrc:/baz")));
- QCOMPARE(eval(QSL("new URL('./baz', 'qrc:/foo/bar/').href")), QVariant(QSL("qrc:/foo/bar/baz")));
- QCOMPARE(eval(QSL("new URL('../baz', 'qrc:/foo/bar/').href")), QVariant(QSL("qrc:/foo/baz")));
- QCOMPARE(eval(QSL("new URL('../../baz', 'qrc:/foo/bar/').href")), QVariant(QSL("qrc:/baz")));
- QCOMPARE(eval(QSL("new URL('../../../baz', 'qrc:/foo/bar/').href")), QVariant(QSL("qrc:/baz")));
-
- // If the relative URL begins with >= 2 slashes, then the scheme is treated
- // not as a Syntax::Path scheme but as a Syntax::HostPortAndUserInformation
- // scheme.
- QCOMPARE(eval(QSL("new URL('//baz', 'qrc:/foo/bar/').href")), QVariant(QSL("qrc://baz/")));
- QCOMPARE(eval(QSL("new URL('///baz', 'qrc:/foo/bar/').href")), QVariant(QSL("qrc://baz/")));
-}
-
-// Test origin serialization in Blink, implemented by blink::KURL and
-// blink::SecurityOrigin as opposed to GURL and url::Origin.
-void tst_Origins::jsUrlOrigin()
-{
- QVERIFY(verifyLoad(QSL("about:blank")));
-
- // For network protocols the origin string must include the domain and port.
- QCOMPARE(eval(QSL("new URL(\"http://foo.com/page.html\").origin")), QVariant(QSL("http://foo.com")));
- QCOMPARE(eval(QSL("new URL(\"https://foo.com/page.html\").origin")), QVariant(QSL("https://foo.com")));
-
- // Even though file URL can also have domains, these are not included in the
- // origin string by Chromium. The standard does not specify a value here,
- // but suggests 'null' (https://url.spec.whatwg.org/#origin).
- QCOMPARE(eval(QSL("new URL(\"file:/etc/passwd\").origin")), QVariant(QSL("file://")));
- QCOMPARE(eval(QSL("new URL(\"file://foo.com/etc/passwd\").origin")), QVariant(QSL("file://")));
-
- // Unregistered schemes behave like file.
- QCOMPARE(eval(QSL("new URL(\"tst:/banana\").origin")), QVariant(QSL("tst://")));
- QCOMPARE(eval(QSL("new URL(\"tst://foo.com/banana\").origin")), QVariant(QSL("tst://")));
-
- // The non-PathSyntax schemes should have hosts and potentially ports.
- QCOMPARE(eval(QSL("new URL(\"HostSyntax:foo:41/bar\").origin")),
- QVariant(QSL("hostsyntax://foo")));
- QCOMPARE(eval(QSL("new URL(\"HostAndPortSyntax:foo:41/bar\").origin")),
- QVariant(QSL("hostandportsyntax://foo:41")));
- QCOMPARE(eval(QSL("new URL(\"HostAndPortSyntax:foo:42/bar\").origin")),
- QVariant(QSL("hostandportsyntax://foo")));
- QCOMPARE(eval(QSL("new URL(\"HostPortAndUserInformationSyntax:foo:41/bar\").origin")),
- QVariant(QSL("hostportanduserinformationsyntax://foo:41")));
- QCOMPARE(eval(QSL("new URL(\"HostPortAndUserInformationSyntax:foo:42/bar\").origin")),
- QVariant(QSL("hostportanduserinformationsyntax://foo")));
-
- // A PathSyntax scheme should have a 'universal' origin.
- QCOMPARE(eval(QSL("new URL(\"PathSyntax:foo\").origin")), QVariant(QSL("pathsyntax:")));
- QCOMPARE(eval(QSL("new URL(\"qrc:/crysis.css\").origin")), QVariant(QSL("qrc:")));
- QCOMPARE(eval(QSL("new URL(\"qrc://foo.com/crysis.css\").origin")), QVariant(QSL("qrc:")));
-
- // The NoAccessAllowed flag forces opaque origins.
- QCOMPARE(eval(QSL("new URL(\"PathSyntax-NoAccessAllowed:foo\").origin")),
- QVariant(QSL("null")));
-}
-
-class ScopedAttribute {
-public:
- ScopedAttribute(QWebEngineSettings *settings, QWebEngineSettings::WebAttribute attribute, bool newValue)
- : m_settings(settings)
- , m_attribute(attribute)
- , m_oldValue(m_settings->testAttribute(m_attribute))
- {
- m_settings->setAttribute(m_attribute, newValue);
- }
- ~ScopedAttribute()
- {
- m_settings->setAttribute(m_attribute, m_oldValue);
- }
-private:
- QWebEngineSettings *m_settings;
- QWebEngineSettings::WebAttribute m_attribute;
- bool m_oldValue;
-};
-
-// Test same-origin policy of file, qrc and custom schemes.
-//
-// Note the test case involves the main page trying to load an iframe from a
-// file that resides in a parent directory. This is just a small detail to
-// demonstrate the difference with Firefox where such access is not allowed.
-void tst_Origins::subdirWithAccess()
-{
- ScopedAttribute sa(m_page->settings(), QWebEngineSettings::LocalContentCanAccessFileUrls, true);
-
- QVERIFY(verifyLoad(QSL("file:" THIS_DIR "resources/subdir/index.html")));
- QCOMPARE(eval(QSL("msg[0]")), QVariant(QSL("hello")));
- QCOMPARE(eval(QSL("msg[1]")), QVariant(QSL("world")));
-
- QVERIFY(verifyLoad(QSL("qrc:/resources/subdir/index.html")));
- QCOMPARE(eval(QSL("msg[0]")), QVariant(QSL("hello")));
- QCOMPARE(eval(QSL("msg[1]")), QVariant(QSL("world")));
-
- QVERIFY(verifyLoad(QSL("tst:/resources/subdir/index.html")));
- QCOMPARE(eval(QSL("msg[0]")), QVariant(QSL("hello")));
- QCOMPARE(eval(QSL("msg[1]")), QVariant(QSL("world")));
-}
-
-// In this variation the LocalContentCanAccessFileUrls attribute is disabled. As
-// a result all file URLs will be considered to have unique/opaque origins, that
-// is, they are not the 'same origin as' any other origin.
-//
-// Note that this applies only to file URLs and not qrc or custom schemes.
-//
-// See also (in Blink):
-// - the allow_file_access_from_file_urls option and
-// - the blink::SecurityOrigin::BlockLocalAccessFromLocalOrigin() method.
-void tst_Origins::subdirWithoutAccess()
-{
- ScopedAttribute sa(m_page->settings(), QWebEngineSettings::LocalContentCanAccessFileUrls, false);
-
- QTest::ignoreMessage(QtSystemMsg, QRegularExpression(QSL("Uncaught SecurityError")));
- QTest::ignoreMessage(QtSystemMsg, QRegularExpression(QSL("Uncaught SecurityError")));
- QVERIFY(verifyLoad(QSL("file:" THIS_DIR "resources/subdir/index.html")));
- QCOMPARE(eval(QSL("msg[0]")), QVariant());
- QCOMPARE(eval(QSL("msg[1]")), QVariant());
-
- QVERIFY(verifyLoad(QSL("qrc:/resources/subdir/index.html")));
- QCOMPARE(eval(QSL("msg[0]")), QVariant(QSL("hello")));
- QCOMPARE(eval(QSL("msg[1]")), QVariant(QSL("world")));
-
- QVERIFY(verifyLoad(QSL("tst:/resources/subdir/index.html")));
- QCOMPARE(eval(QSL("msg[0]")), QVariant(QSL("hello")));
- QCOMPARE(eval(QSL("msg[1]")), QVariant(QSL("world")));
-}
-
-// Load the main page over one scheme with an iframe over another scheme.
-//
-// For file and qrc schemes, the iframe should load but it should not be
-// possible for scripts in different frames to interact.
-//
-// Additionally for unregistered custom schemes and custom schemes without
-// LocalAccessAllowed it should not be possible to load an iframe over the
-// file: scheme.
-void tst_Origins::mixedSchemes()
-{
- QVERIFY(verifyLoad(QSL("file:" THIS_DIR "resources/mixedSchemes.html")));
- eval(QSL("setIFrameUrl('file:" THIS_DIR "resources/mixedSchemes_frame.html')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("canLoadAndAccess")));
- QTest::ignoreMessage(QtSystemMsg, QRegularExpression(QSL("Uncaught SecurityError")));
- eval(QSL("setIFrameUrl('qrc:/resources/mixedSchemes_frame.html')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("canLoadButNotAccess")));
- QTest::ignoreMessage(QtSystemMsg, QRegularExpression(QSL("Uncaught SecurityError")));
- eval(QSL("setIFrameUrl('tst:/resources/mixedSchemes_frame.html')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("canLoadButNotAccess")));
-
- QVERIFY(verifyLoad(QSL("qrc:/resources/mixedSchemes.html")));
- QTest::ignoreMessage(QtSystemMsg, QRegularExpression(QSL("Uncaught SecurityError")));
- eval(QSL("setIFrameUrl('file:" THIS_DIR "resources/mixedSchemes_frame.html')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("canLoadButNotAccess")));
- eval(QSL("setIFrameUrl('qrc:/resources/mixedSchemes_frame.html')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("canLoadAndAccess")));
- QTest::ignoreMessage(QtSystemMsg, QRegularExpression(QSL("Uncaught SecurityError")));
- eval(QSL("setIFrameUrl('tst:/resources/mixedSchemes_frame.html')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("canLoadButNotAccess")));
-
- QVERIFY(verifyLoad(QSL("tst:/resources/mixedSchemes.html")));
- QTest::ignoreMessage(QtSystemMsg, QRegularExpression(QSL("Not allowed to load local resource")));
- eval(QSL("setIFrameUrl('file:" THIS_DIR "resources/mixedSchemes_frame.html')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("cannotLoad")));
- QTest::ignoreMessage(QtSystemMsg, QRegularExpression(QSL("Uncaught SecurityError")));
- eval(QSL("setIFrameUrl('qrc:/resources/mixedSchemes_frame.html')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("canLoadButNotAccess")));
- eval(QSL("setIFrameUrl('tst:/resources/mixedSchemes_frame.html')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("canLoadAndAccess")));
-
- QVERIFY(verifyLoad(QSL("PathSyntax:/resources/mixedSchemes.html")));
- eval(QSL("setIFrameUrl('PathSyntax:/resources/mixedSchemes_frame.html')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("canLoadAndAccess")));
- QTest::ignoreMessage(QtSystemMsg, QRegularExpression(QSL("Not allowed to load local resource")));
- eval(QSL("setIFrameUrl('PathSyntax-Local:/resources/mixedSchemes_frame.html')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("cannotLoad")));
- eval(QSL("setIFrameUrl('PathSyntax-LocalAccessAllowed:/resources/mixedSchemes_frame.html')"));
- QTest::ignoreMessage(QtSystemMsg, QRegularExpression(QSL("Uncaught SecurityError")));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("canLoadButNotAccess")));
- QTest::ignoreMessage(QtSystemMsg, QRegularExpression(QSL("Uncaught SecurityError")));
- eval(QSL("setIFrameUrl('PathSyntax-NoAccessAllowed:/resources/mixedSchemes_frame.html')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("canLoadButNotAccess")));
-
- QVERIFY(verifyLoad(QSL("PathSyntax-LocalAccessAllowed:/resources/mixedSchemes.html")));
- QTest::ignoreMessage(QtSystemMsg, QRegularExpression(QSL("Uncaught SecurityError")));
- eval(QSL("setIFrameUrl('PathSyntax:/resources/mixedSchemes_frame.html')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("canLoadButNotAccess")));
- QTest::ignoreMessage(QtSystemMsg, QRegularExpression(QSL("Uncaught SecurityError")));
- eval(QSL("setIFrameUrl('PathSyntax-Local:/resources/mixedSchemes_frame.html')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("canLoadButNotAccess")));
- eval(QSL("setIFrameUrl('PathSyntax-LocalAccessAllowed:/resources/mixedSchemes_frame.html')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("canLoadAndAccess")));
- QTest::ignoreMessage(QtSystemMsg, QRegularExpression(QSL("Uncaught SecurityError")));
- eval(QSL("setIFrameUrl('PathSyntax-NoAccessAllowed:/resources/mixedSchemes_frame.html')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("canLoadButNotAccess")));
-
- QVERIFY(verifyLoad(QSL("PathSyntax-NoAccessAllowed:/resources/mixedSchemes.html")));
- QTest::ignoreMessage(QtSystemMsg, QRegularExpression(QSL("Uncaught SecurityError")));
- eval(QSL("setIFrameUrl('PathSyntax:/resources/mixedSchemes_frame.html')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("canLoadButNotAccess")));
- QTest::ignoreMessage(QtSystemMsg, QRegularExpression(QSL("Not allowed to load local resource")));
- eval(QSL("setIFrameUrl('PathSyntax-Local:/resources/mixedSchemes_frame.html')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("cannotLoad")));
- QTest::ignoreMessage(QtSystemMsg, QRegularExpression(QSL("Uncaught SecurityError")));
- eval(QSL("setIFrameUrl('PathSyntax-LocalAccessAllowed:/resources/mixedSchemes_frame.html')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("canLoadButNotAccess")));
- QTest::ignoreMessage(QtSystemMsg, QRegularExpression(QSL("Uncaught SecurityError")));
- eval(QSL("setIFrameUrl('PathSyntax-NoAccessAllowed:/resources/mixedSchemes_frame.html')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("canLoadButNotAccess")));
-
- QVERIFY(verifyLoad(QSL("HostSyntax://a/resources/mixedSchemes.html")));
- eval(QSL("setIFrameUrl('HostSyntax://a/resources/mixedSchemes_frame.html')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("canLoadAndAccess")));
- QTest::ignoreMessage(QtSystemMsg, QRegularExpression(QSL("Uncaught SecurityError")));
- eval(QSL("setIFrameUrl('HostSyntax://b/resources/mixedSchemes_frame.html')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("canLoadButNotAccess")));
-}
-
-// Like mixedSchemes but adds a Content-Security-Policy: frame-src 'none' header.
-void tst_Origins::mixedSchemesWithCsp()
-{
- QVERIFY(verifyLoad(QSL("HostSyntax://a/resources/mixedSchemesWithCsp.html")));
- QTest::ignoreMessage(QtSystemMsg, QRegularExpression(QSL("violates the following Content Security Policy")));
- eval(QSL("setIFrameUrl('HostSyntax://a/resources/mixedSchemes_frame.html')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("canLoadButNotAccess")));
- QTest::ignoreMessage(QtSystemMsg, QRegularExpression(QSL("violates the following Content Security Policy")));
- eval(QSL("setIFrameUrl('HostSyntax://b/resources/mixedSchemes_frame.html')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("canLoadButNotAccess")));
-
- QVERIFY(verifyLoad(QSL("HostSyntax-ContentSecurityPolicyIgnored://a/resources/mixedSchemesWithCsp.html")));
- eval(QSL("setIFrameUrl('HostSyntax-ContentSecurityPolicyIgnored://a/resources/mixedSchemes_frame.html')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("canLoadAndAccess")));
- QTest::ignoreMessage(QtSystemMsg, QRegularExpression(QSL("Uncaught SecurityError")));
- eval(QSL("setIFrameUrl('HostSyntax-ContentSecurityPolicyIgnored://b/resources/mixedSchemes_frame.html')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("canLoadButNotAccess")));
-}
-
-// Load the main page over one scheme, then make an XMLHttpRequest to a
-// different scheme.
-//
-// Cross-origin XMLHttpRequests can only be made to CORS-enabled schemes. These
-// include the builtin schemes http, https, data, and chrome, as well as custom
-// schemes with the CorsEnabled flag.
-void tst_Origins::mixedXHR()
-{
- QVERIFY(verifyLoad(QSL("file:" THIS_DIR "resources/mixedXHR.html")));
- eval(QSL("sendXHR('file:" THIS_DIR "resources/mixedXHR.txt')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("ok")));
- eval(QSL("sendXHR('qrc:/resources/mixedXHR.txt')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("error")));
- eval(QSL("sendXHR('tst:/resources/mixedXHR.txt')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("error")));
- eval(QSL("sendXHR('data:,ok')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("ok")));
- eval(QSL("sendXHR('cors:/resources/mixedXHR.txt')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("ok")));
-
- QVERIFY(verifyLoad(QSL("qrc:/resources/mixedXHR.html")));
- eval(QSL("sendXHR('file:" THIS_DIR "resources/mixedXHR.txt')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("ok")));
- eval(QSL("sendXHR('qrc:/resources/mixedXHR.txt')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("ok")));
- eval(QSL("sendXHR('tst:/resources/mixedXHR.txt')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("error")));
- eval(QSL("sendXHR('data:,ok')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("ok")));
- eval(QSL("sendXHR('cors:/resources/mixedXHR.txt')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("ok")));
-
- QVERIFY(verifyLoad(QSL("tst:/resources/mixedXHR.html")));
- eval(QSL("sendXHR('file:" THIS_DIR "resources/mixedXHR.txt')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("error")));
- eval(QSL("sendXHR('qrc:/resources/mixedXHR.txt')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("error")));
- eval(QSL("sendXHR('tst:/resources/mixedXHR.txt')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("ok")));
- eval(QSL("sendXHR('data:,ok')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("ok")));
- eval(QSL("sendXHR('cors:/resources/mixedXHR.txt')"));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("ok")));
-}
-
-#if defined(WEBSOCKETS)
-class EchoServer : public QObject {
- Q_OBJECT
- Q_PROPERTY(QUrl url READ url NOTIFY urlChanged)
-public:
- EchoServer() : webSocketServer(QSL("EchoServer"), QWebSocketServer::NonSecureMode)
- {
- connect(&webSocketServer, &QWebSocketServer::newConnection, this, &EchoServer::onNewConnection);
- }
-
- bool listen()
- {
- if (webSocketServer.listen(QHostAddress::Any)) {
- Q_EMIT urlChanged();
- return true;
- }
- return false;
- }
-
- QUrl url() const
- {
- return webSocketServer.serverUrl();
- }
-
-Q_SIGNALS:
- void urlChanged();
-
-private:
- void onNewConnection()
- {
- QWebSocket *socket = webSocketServer.nextPendingConnection();
- connect(socket, &QWebSocket::textMessageReceived, this, &EchoServer::onTextMessageReceived);
- connect(socket, &QWebSocket::disconnected, socket, &QObject::deleteLater);
- }
-
- void onTextMessageReceived(const QString &message)
- {
- QWebSocket *socket = qobject_cast<QWebSocket *>(sender());
- socket->sendTextMessage(message);
- }
-
- QWebSocketServer webSocketServer;
-};
-
-// Try opening a WebSocket from pages loaded over various URL schemes.
-void tst_Origins::webSocket()
-{
- EchoServer echoServer;
- QWebChannel channel;
- channel.registerObject(QSL("echoServer"), &echoServer);
- m_page->setWebChannel(&channel);
- QVERIFY(echoServer.listen());
-
- QVERIFY(verifyLoad(QSL("file:" THIS_DIR "resources/websocket.html")));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("ok")));
-
- QVERIFY(verifyLoad(QSL("qrc:/resources/websocket.html")));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("ok")));
-
- // Unregistered schemes can also open WebSockets (since Chromium 71)
- QVERIFY(verifyLoad(QSL("tst:/resources/websocket.html")));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("ok")));
-
- // Even an insecure registered scheme can open WebSockets.
- QVERIFY(verifyLoad(QSL("PathSyntax:/resources/websocket.html")));
- QTRY_COMPARE(eval(QSL("result")), QVariant(QSL("ok")));
-}
-#endif
-// Create a (Dedicated)Worker. Since dedicated workers can only be accessed from
-// one page, there is not much need for security restrictions.
-void tst_Origins::dedicatedWorker()
-{
- QVERIFY(verifyLoad(QSL("file:" THIS_DIR "resources/dedicatedWorker.html")));
- QTRY_VERIFY(eval(QSL("done")).toBool());
- QCOMPARE(eval(QSL("result")), QVariant(42));
-
- QVERIFY(verifyLoad(QSL("qrc:/resources/dedicatedWorker.html")));
- QTRY_VERIFY(eval(QSL("done")).toBool());
- QCOMPARE(eval(QSL("result")), QVariant(42));
-
- // Unregistered schemes can also create Workers (since Chromium 71)
- QVERIFY(verifyLoad(QSL("tst:/resources/dedicatedWorker.html")));
- QTRY_VERIFY(eval(QSL("done")).toBool());
- QCOMPARE(eval(QSL("result")), QVariant(42));
-
- // Even an insecure registered scheme can create Workers.
- QVERIFY(verifyLoad(QSL("PathSyntax:/resources/dedicatedWorker.html")));
- QTRY_VERIFY(eval(QSL("done")).toBool());
- QCOMPARE(eval(QSL("result")), QVariant(42));
-
- // But not if the NoAccessAllowed flag is set.
- QVERIFY(verifyLoad(QSL("PathSyntax-NoAccessAllowed:/resources/dedicatedWorker.html")));
- QTRY_VERIFY(eval(QSL("done")).toBool());
- QVERIFY(eval(QSL("error")).toString()
- .contains(QSL("cannot be accessed from origin 'null'")));
-}
-
-// Create a SharedWorker. Shared workers can be accessed from multiple pages,
-// and therefore the same-origin policy applies.
-void tst_Origins::sharedWorker()
-{
- {
- ScopedAttribute sa(m_page->settings(), QWebEngineSettings::LocalContentCanAccessFileUrls, false);
- QVERIFY(verifyLoad(QSL("file:" THIS_DIR "resources/sharedWorker.html")));
- QTRY_VERIFY_WITH_TIMEOUT(eval(QSL("done")).toBool(), 10000);
- QVERIFY(eval(QSL("error")).toString()
- .contains(QSL("cannot be accessed from origin 'null'")));
- }
-
- {
- ScopedAttribute sa(m_page->settings(), QWebEngineSettings::LocalContentCanAccessFileUrls, true);
- QVERIFY(verifyLoad(QSL("file:" THIS_DIR "resources/sharedWorker.html")));
- QTRY_VERIFY_WITH_TIMEOUT(eval(QSL("done")).toBool(), 10000);
- QCOMPARE(eval(QSL("result")), QVariant(42));
- }
-
- QVERIFY(verifyLoad(QSL("qrc:/resources/sharedWorker.html")));
- QTRY_VERIFY_WITH_TIMEOUT(eval(QSL("done")).toBool(), 10000);
- QCOMPARE(eval(QSL("result")), QVariant(42));
-
- // Unregistered schemes should not create SharedWorkers.
-
- QVERIFY(verifyLoad(QSL("PathSyntax:/resources/sharedWorker.html")));
- QTRY_VERIFY_WITH_TIMEOUT(eval(QSL("done")).toBool(), 10000);
- QCOMPARE(eval(QSL("result")), QVariant(42));
-
- QVERIFY(verifyLoad(QSL("PathSyntax-NoAccessAllowed:/resources/sharedWorker.html")));
- QTRY_VERIFY_WITH_TIMEOUT(eval(QSL("done")).toBool(), 10000);
- QVERIFY(eval(QSL("error")).toString()
- .contains(QSL("denied to origin 'null'")));
-}
-
-// Service workers have to be explicitly enabled for a scheme.
-void tst_Origins::serviceWorker()
-{
- QVERIFY(verifyLoad(QSL("file:" THIS_DIR "resources/serviceWorker.html")));
- QTRY_VERIFY(eval(QSL("done")).toBool());
- QVERIFY(eval(QSL("error")).toString()
- .contains(QSL("The URL protocol of the current origin ('file://') is not supported.")));
-
- QVERIFY(verifyLoad(QSL("qrc:/resources/serviceWorker.html")));
- QTRY_VERIFY(eval(QSL("done")).toBool());
- QVERIFY(eval(QSL("error")).toString()
- .contains(QSL("The URL protocol of the current origin ('qrc:') is not supported.")));
-
- QVERIFY(verifyLoad(QSL("tst:/resources/serviceWorker.html")));
- QTRY_VERIFY(eval(QSL("done")).toBool());
- QVERIFY(eval(QSL("error")).toString()
- .contains(QSL("Cannot read property 'register' of undefined")));
-
- QVERIFY(verifyLoad(QSL("PathSyntax:/resources/serviceWorker.html")));
- QTRY_VERIFY(eval(QSL("done")).toBool());
- QVERIFY(eval(QSL("error")).toString()
- .contains(QSL("Cannot read property 'register' of undefined")));
-
- QVERIFY(verifyLoad(QSL("PathSyntax-Secure:/resources/serviceWorker.html")));
- QTRY_VERIFY(eval(QSL("done")).toBool());
- QVERIFY(eval(QSL("error")).toString()
- .contains(QSL("The URL protocol of the current origin ('pathsyntax-secure:') is not supported.")));
-
- QVERIFY(verifyLoad(QSL("PathSyntax-ServiceWorkersAllowed:/resources/serviceWorker.html")));
- QTRY_VERIFY(eval(QSL("done")).toBool());
- QVERIFY(eval(QSL("error")).toString()
- .contains(QSL("Cannot read property 'register' of undefined")));
-
- QVERIFY(verifyLoad(QSL("PathSyntax-Secure-ServiceWorkersAllowed:/resources/serviceWorker.html")));
- QTRY_VERIFY(eval(QSL("done")).toBool());
- QCOMPARE(eval(QSL("error")), QVariant());
-
- QVERIFY(verifyLoad(QSL("PathSyntax-NoAccessAllowed:/resources/serviceWorker.html")));
- QTRY_VERIFY(eval(QSL("done")).toBool());
- QVERIFY(eval(QSL("error")).toString()
- .contains(QSL("Cannot read property 'register' of undefined")));
-}
-
-// Support for view-source must be enabled explicitly.
-void tst_Origins::viewSource()
-{
- QVERIFY(verifyLoad(QSL("view-source:file:" THIS_DIR "resources/viewSource.html")));
-#ifdef Q_OS_WIN
- QCOMPARE(m_page->requestedUrl().toString(), QSL("file:///" THIS_DIR "resources/viewSource.html"));
-#else
- QCOMPARE(m_page->requestedUrl().toString(), QSL("file://" THIS_DIR "resources/viewSource.html"));
-#endif
-
- QVERIFY(verifyLoad(QSL("view-source:qrc:/resources/viewSource.html")));
- QCOMPARE(m_page->requestedUrl().toString(), QSL("qrc:/resources/viewSource.html"));
-
- QVERIFY(verifyLoad(QSL("view-source:tst:/resources/viewSource.html")));
- QCOMPARE(m_page->requestedUrl().toString(), QSL("about:blank"));
-
- QVERIFY(verifyLoad(QSL("view-source:PathSyntax:/resources/viewSource.html")));
- QCOMPARE(m_page->requestedUrl().toString(), QSL("about:blank"));
-
- QVERIFY(verifyLoad(QSL("view-source:PathSyntax-ViewSourceAllowed:/resources/viewSource.html")));
- QCOMPARE(m_page->requestedUrl().toString(), QSL("pathsyntax-viewsourceallowed:/resources/viewSource.html"));
-}
-
-void tst_Origins::createObjectURL()
-{
- // Legal for registered custom schemes.
- QVERIFY(verifyLoad(QSL("qrc:/resources/createObjectURL.html")));
- QVERIFY(eval(QSL("result")).toString().startsWith(QSL("blob:qrc:")));
-
- // Also legal for unregistered schemes (since Chromium 71)
- QVERIFY(verifyLoad(QSL("tst:/resources/createObjectURL.html")));
- QVERIFY(eval(QSL("result")).toString().startsWith(QSL("blob:tst:")));
-}
-
-void tst_Origins::redirect()
-{
- QVERIFY(verifyLoad(QSL("redirect1:/resources/redirect.html")));
- QTRY_COMPARE(m_handler->requests().size(), 7);
- QCOMPARE(m_handler->requests()[0], QUrl(QStringLiteral("redirect1:/resources/redirect.html")));
- QCOMPARE(m_handler->requests()[1], QUrl(QStringLiteral("redirect2:/resources/redirect.html")));
- QCOMPARE(m_handler->requests()[2], QUrl(QStringLiteral("redirect1:/resources/redirect.css")));
- QCOMPARE(m_handler->requests()[3], QUrl(QStringLiteral("redirect2:/resources/redirect.css")));
- QCOMPARE(m_handler->requests()[4], QUrl(QStringLiteral("redirect1:/resources/Akronim-Regular.woff2")));
- QCOMPARE(m_handler->requests()[5], QUrl(QStringLiteral("redirect1:/resources/Akronim-Regular.woff2")));
- QCOMPARE(m_handler->requests()[6], QUrl(QStringLiteral("redirect2:/resources/Akronim-Regular.woff2")));
-}
-
-QTEST_MAIN(tst_Origins)
-#include "tst_origins.moc"
diff --git a/tests/auto/widgets/origins/tst_origins.qrc b/tests/auto/widgets/origins/tst_origins.qrc
deleted file mode 100644
index fcf54aaea..000000000
--- a/tests/auto/widgets/origins/tst_origins.qrc
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE RCC>
-<RCC version="1.0">
-<qresource>
- <file>resources/createObjectURL.html</file>
- <file>resources/dedicatedWorker.html</file>
- <file>resources/dedicatedWorker.js</file>
- <file>resources/mixedSchemes.html</file>
- <file>resources/mixedSchemesWithCsp.html</file>
- <file>resources/mixedSchemes_frame.html</file>
- <file>resources/mixedXHR.html</file>
- <file>resources/mixedXHR.txt</file>
- <file>resources/serviceWorker.html</file>
- <file>resources/serviceWorker.js</file>
- <file>resources/sharedWorker.html</file>
- <file>resources/sharedWorker.js</file>
- <file>resources/subdir/frame2.html</file>
- <file>resources/subdir/index.html</file>
- <file>resources/subdir_frame1.html</file>
- <file>resources/viewSource.html</file>
- <file>resources/websocket.html</file>
-</qresource>
-</RCC>
diff --git a/tests/auto/widgets/printing/CMakeLists.txt b/tests/auto/widgets/printing/CMakeLists.txt
new file mode 100644
index 000000000..baa3cf747
--- /dev/null
+++ b/tests/auto/widgets/printing/CMakeLists.txt
@@ -0,0 +1,34 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+include(../../util/util.cmake)
+
+find_package(PkgConfig)
+if(PkgConfig_FOUND)
+ pkg_check_modules(POPPLER_CPP poppler-cpp IMPORTED_TARGET)
+endif()
+
+qt_internal_add_test(tst_printing
+ SOURCES
+ tst_printing.cpp
+ LIBRARIES
+ Qt::CorePrivate
+ Qt::WebEngineWidgets
+ Qt::WebEngineCorePrivate
+ Test::Util
+)
+
+qt_internal_extend_target(tst_printing
+ CONDITION POPPLER_CPP_FOUND AND QT_FEATURE_webengine_system_poppler
+ LIBRARIES
+ PkgConfig::POPPLER_CPP
+)
+
+set(tst_printing_resource_files
+ "resources/basic_printing_page.html"
+)
+
+qt_internal_add_resource(tst_printing "tst_printing"
+ PREFIX "/"
+ FILES ${tst_printing_resource_files}
+)
diff --git a/tests/auto/widgets/printing/printing.pro b/tests/auto/widgets/printing/printing.pro
deleted file mode 100644
index 92f5d611c..000000000
--- a/tests/auto/widgets/printing/printing.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-include($$QTWEBENGINE_OUT_ROOT/src/core/qtwebenginecore-config.pri) # workaround for QTBUG-68093
-QT_FOR_CONFIG += webenginecore-private
-
-include(../tests.pri)
-QT *= core-private webenginecore-private
-
-qtConfig(webengine-poppler-cpp) {
- CONFIG += link_pkgconfig
- PKGCONFIG += poppler-cpp
-}
diff --git a/tests/auto/widgets/printing/tst_printing.cpp b/tests/auto/widgets/printing/tst_printing.cpp
index 380fb65ff..605fb57b5 100644
--- a/tests/auto/widgets/printing/tst_printing.cpp
+++ b/tests/auto/widgets/printing/tst_printing.cpp
@@ -1,39 +1,16 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include <QtWebEngineCore/private/qtwebenginecoreglobal_p.h>
-#include <QWebEnginePage>
+#include <QtWebEngineCore/qtwebenginecore-config.h>
+#include <QWebEngineSettings>
+#include <QWebEngineView>
#include <QTemporaryDir>
#include <QTest>
#include <QSignalSpy>
#include <util.h>
-#if QT_CONFIG(webengine_poppler_cpp)
+#if QT_CONFIG(webengine_system_poppler)
#include <poppler-document.h>
#include <poppler-page.h>
#endif
@@ -44,25 +21,27 @@ class tst_Printing : public QObject
private slots:
void printToPdfBasic();
void printRequest();
-#if QT_CONFIG(webengine_poppler_cpp) && defined(Q_OS_LINUX) && defined(__GLIBCXX__)
+#if QT_CONFIG(webengine_system_poppler)
void printToPdfPoppler();
+ void printFromPdfViewer();
#endif
+ void interruptPrinting();
};
void tst_Printing::printToPdfBasic()
{
QTemporaryDir tempDir(QDir::tempPath() + "/tst_qwebengineview-XXXXXX");
QVERIFY(tempDir.isValid());
- QWebEnginePage page;
- QSignalSpy spy(&page, &QWebEnginePage::loadFinished);
- page.load(QUrl("qrc:///resources/basic_printing_page.html"));
- QTRY_VERIFY(spy.count() == 1);
+ QWebEngineView view;
+ QSignalSpy spy(&view, &QWebEngineView::loadFinished);
+ view.load(QUrl("qrc:///resources/basic_printing_page.html"));
+ QTRY_VERIFY(spy.size() == 1);
- QSignalSpy savePdfSpy(&page, &QWebEnginePage::pdfPrintingFinished);
+ QSignalSpy savePdfSpy(view.page(), &QWebEnginePage::pdfPrintingFinished);
QPageLayout layout(QPageSize(QPageSize::A4), QPageLayout::Portrait, QMarginsF(0.0, 0.0, 0.0, 0.0));
QString path = tempDir.path() + "/print_1_success.pdf";
- page.printToPdf(path, layout);
- QTRY_VERIFY2(savePdfSpy.count() == 1, "Printing to PDF file failed without signal");
+ view.page()->printToPdf(path, layout);
+ QTRY_VERIFY2(savePdfSpy.size() == 1, "Printing to PDF file failed without signal");
QList<QVariant> successArguments = savePdfSpy.takeFirst();
QVERIFY2(successArguments.at(0).toString() == path, "File path for first saved PDF does not match arguments");
@@ -73,56 +52,58 @@ void tst_Printing::printToPdfBasic()
#else
path = tempDir.path() + "/print_|2_failed.pdf";
#endif
- page.printToPdf(path, QPageLayout());
- QTRY_VERIFY2(savePdfSpy.count() == 1, "Printing to PDF file failed without signal");
+ view.page()->printToPdf(path, QPageLayout());
+ QTRY_VERIFY2(savePdfSpy.size() == 1, "Printing to PDF file failed without signal");
QList<QVariant> failedArguments = savePdfSpy.takeFirst();
QVERIFY2(failedArguments.at(0).toString() == path, "File path for second saved PDF does not match arguments");
QVERIFY2(failedArguments.at(1).toBool() == false, "Printing to PDF file succeeded though it should fail");
CallbackSpy<QByteArray> successfulSpy;
- page.printToPdf(successfulSpy.ref(), layout);
- QVERIFY(successfulSpy.waitForResult().length() > 0);
+ view.page()->printToPdf(successfulSpy.ref(), layout);
+ QVERIFY(successfulSpy.waitForResult().size() > 0);
CallbackSpy<QByteArray> failedInvalidLayoutSpy;
- page.printToPdf(failedInvalidLayoutSpy.ref(), QPageLayout());
- QCOMPARE(failedInvalidLayoutSpy.waitForResult().length(), 0);
+ view.page()->printToPdf(failedInvalidLayoutSpy.ref(), QPageLayout());
+ QCOMPARE(failedInvalidLayoutSpy.waitForResult().size(), 0);
}
void tst_Printing::printRequest()
{
- QWebEnginePage webPage;
+ QWebEngineView view;
QPageLayout layout(QPageSize(QPageSize::A4), QPageLayout::Portrait, QMarginsF(0.0, 0.0, 0.0, 0.0));
- QSignalSpy loadFinishedSpy(&webPage, &QWebEnginePage::loadFinished);
- QSignalSpy printRequestedSpy(&webPage, &QWebEnginePage::printRequested);
- QSignalSpy savePdfSpy(&webPage, &QWebEnginePage::pdfPrintingFinished);
+ QSignalSpy loadFinishedSpy(&view, &QWebEngineView::loadFinished);
+ QSignalSpy printRequestedSpy(&view, &QWebEngineView::printRequested);
+ QSignalSpy printRequestedSpy2(view.page(), &QWebEnginePage::printRequested);
+ QSignalSpy savePdfSpy(&view, &QWebEngineView::pdfPrintingFinished);
CallbackSpy<QByteArray> resultSpy;
- webPage.load(QUrl("qrc:///resources/basic_printing_page.html"));
- QTRY_VERIFY(loadFinishedSpy.count() == 1);
- webPage.runJavaScript("window.print()");
- QTRY_VERIFY(printRequestedSpy.count() == 1);
+ view.load(QUrl("qrc:///resources/basic_printing_page.html"));
+ QTRY_VERIFY(loadFinishedSpy.size() == 1);
+ view.page()->runJavaScript("window.print()");
+ QTRY_VERIFY(printRequestedSpy.size() == 1);
+ QVERIFY(printRequestedSpy2.size() == 1);
//check if printing still works
- webPage.printToPdf(resultSpy.ref(), layout);
+ view.printToPdf(resultSpy.ref(), layout);
const QByteArray data = resultSpy.waitForResult();
- QVERIFY(data.length() > 0);
+ QVERIFY(data.size() > 0);
}
-#if QT_CONFIG(webengine_poppler_cpp) && defined(Q_OS_LINUX) && defined(__GLIBCXX__)
+#if QT_CONFIG(webengine_system_poppler)
void tst_Printing::printToPdfPoppler()
{
// check if generated pdf is correct by searching for a know string on the page
using namespace poppler;
- QWebEnginePage webPage;
+ QWebEngineView view;
QPageLayout layout(QPageSize(QPageSize::A4), QPageLayout::Portrait, QMarginsF(0.0, 0.0, 0.0, 0.0));
- QSignalSpy spy(&webPage, &QWebEnginePage::loadFinished);
- QSignalSpy savePdfSpy(&webPage, &QWebEnginePage::pdfPrintingFinished);
+ QSignalSpy spy(&view, &QWebEngineView::loadFinished);
+ QSignalSpy savePdfSpy(&view, &QWebEngineView::pdfPrintingFinished);
CallbackSpy<QByteArray> resultSpy;
- webPage.load(QUrl("qrc:///resources/basic_printing_page.html"));
+ view.load(QUrl("qrc:///resources/basic_printing_page.html"));
QTRY_VERIFY(spy.count() == 1);
- webPage.printToPdf(resultSpy.ref(), layout);
+ view.printToPdf(resultSpy.ref(), layout);
const QByteArray data = resultSpy.waitForResult();
QVERIFY(data.length() > 0);
@@ -137,8 +118,65 @@ void tst_Printing::printToPdfPoppler()
QVERIFY2(pdfPage->search(ustring::from_latin1("Hello Paper World"), rect, page::search_from_top,
case_sensitive ), "Could not find text");
}
+
+void tst_Printing::printFromPdfViewer()
+{
+ using namespace poppler;
+
+ QWebEngineView view;
+ view.page()->settings()->setAttribute(QWebEngineSettings::PluginsEnabled, true);
+ view.page()->settings()->setAttribute(QWebEngineSettings::PdfViewerEnabled, true);
+
+ // Load a basic HTML
+ QSignalSpy spy(&view, &QWebEngineView::loadFinished);
+ view.load(QUrl("qrc:///resources/basic_printing_page.html"));
+ QTRY_COMPARE(spy.size(), 1);
+
+ // Create a PDF
+ QTemporaryDir tempDir(QDir::tempPath() + "/tst_printing-XXXXXX");
+ QVERIFY(tempDir.isValid());
+ QString path = tempDir.path() + "/basic_page.pdf";
+ QSignalSpy savePdfSpy(view.page(), &QWebEnginePage::pdfPrintingFinished);
+ view.page()->printToPdf(path);
+ QTRY_COMPARE(savePdfSpy.size(), 1);
+
+ // Open the new file with the PDF viewer plugin
+ view.load(QUrl("file://" + path));
+ QTRY_COMPARE(spy.size(), 2);
+
+ // Print from the plugin
+ // loadFinished signal is not reliable when loading a PDF file, because it has multiple phases.
+ // Workaround: Try to print it a couple of times until the result matches the expected.
+ CallbackSpy<QByteArray> resultSpy;
+ bool ok = QTest::qWaitFor([&]() -> bool {
+ view.printToPdf(resultSpy.ref());
+ QByteArray data = resultSpy.waitForResult();
+
+ // Check if the result contains text from the original basic HTML
+ // This catches all the typical issues: empty result or printing the WebUI without PDF content.
+ QScopedPointer<document> pdf(document::load_from_raw_data(data.constData(), data.length()));
+ QScopedPointer<page> pdfPage(pdf->create_page(0));
+ rectf rect;
+ return pdfPage->search(ustring::from_latin1("Hello Paper World"), rect, page::search_from_top,
+ case_sensitive);
+ }, 10000);
+ QVERIFY(ok);
+}
#endif
+void tst_Printing::interruptPrinting()
+{
+ QWebEngineView view;
+ QSignalSpy spy(&view, &QWebEngineView::loadFinished);
+ view.load(QUrl("qrc:///resources/basic_printing_page.html"));
+ QTRY_VERIFY(spy.size() == 1);
+
+ QTemporaryDir tempDir(QDir::tempPath() + "/tst_qwebengineview-XXXXXX");
+ QVERIFY(tempDir.isValid());
+ view.page()->printToPdf(tempDir.path() + "/file.pdf");
+ // Navigation stop interrupts print job, preferably do this without crash/assert
+ view.page()->triggerAction(QWebEnginePage::Stop);
+}
QTEST_MAIN(tst_Printing)
#include "tst_printing.moc"
diff --git a/tests/auto/widgets/printing/tst_printing.qrc b/tests/auto/widgets/printing/tst_printing.qrc
deleted file mode 100644
index b1795ef8a..000000000
--- a/tests/auto/widgets/printing/tst_printing.qrc
+++ /dev/null
@@ -1,5 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
-<qresource>
- <file>resources/basic_printing_page.html</file>
-</qresource>
-</RCC>
diff --git a/tests/auto/widgets/proxy/CMakeLists.txt b/tests/auto/widgets/proxy/CMakeLists.txt
new file mode 100644
index 000000000..95dc903ed
--- /dev/null
+++ b/tests/auto/widgets/proxy/CMakeLists.txt
@@ -0,0 +1,12 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+include(../../httpserver/httpserver.cmake)
+
+qt_internal_add_test(tst_webengine_proxy
+ SOURCES
+ tst_proxy.cpp
+ LIBRARIES
+ Qt::WebEngineWidgets
+ Test::HttpServer
+)
diff --git a/tests/auto/widgets/proxy/proxy.pro b/tests/auto/widgets/proxy/proxy.pro
deleted file mode 100644
index 802dfad05..000000000
--- a/tests/auto/widgets/proxy/proxy.pro
+++ /dev/null
@@ -1,9 +0,0 @@
-include(../tests.pri)
-QT += core-private webengine webengine-private
-
-HEADERS += \
- proxy_server.h
-
-SOURCES += \
- proxy_server.cpp
-
diff --git a/tests/auto/widgets/proxy/proxy_server.cpp b/tests/auto/widgets/proxy/proxy_server.cpp
deleted file mode 100644
index 3bf915609..000000000
--- a/tests/auto/widgets/proxy/proxy_server.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "proxy_server.h"
-#include <QDataStream>
-#include <QTcpSocket>
-#include <QDebug>
-
-ProxyServer::ProxyServer(QObject *parent) : QObject(parent)
-{
- connect(&m_server, &QTcpServer::newConnection, this, &ProxyServer::handleNewConnection);
-}
-
-void ProxyServer::setCredentials(const QByteArray &user, const QByteArray password)
-{
- m_auth.append(user);
- m_auth.append(QChar(':'));
- m_auth.append(password);
- m_auth = m_auth.toBase64();
- m_authenticate = true;
-}
-
-void ProxyServer::setCookie(const QByteArray &cookie)
-{
- m_cookie.append(QByteArrayLiteral("Cookie: "));
- m_cookie.append(cookie);
-}
-
-
-bool ProxyServer::isListening()
-{
- return m_server.isListening();
-}
-
-void ProxyServer::run()
-{
- if (!m_server.listen(QHostAddress::LocalHost, 5555))
- qFatal("Could not start the test server");
-}
-
-void ProxyServer::handleNewConnection()
-{
- // do one connection at the time
- Q_ASSERT(m_data.isEmpty());
- QTcpSocket *socket = m_server.nextPendingConnection();
- Q_ASSERT(socket);
- connect(socket, &QAbstractSocket::disconnected, socket, &QObject::deleteLater);
- connect(socket, &QAbstractSocket::readyRead, this, &ProxyServer::handleReadReady);
-}
-
-void ProxyServer::handleReadReady()
-{
- QTcpSocket *socket = qobject_cast<QTcpSocket*>(sender());
- Q_ASSERT(socket);
-
- m_data.append(socket->readAll());
-
- if (!m_data.endsWith("\r\n\r\n"))
- return;
-
- if (m_authenticate && !m_data.contains(QByteArrayLiteral("Proxy-Authorization: Basic"))) {
- socket->write("HTTP/1.1 407 Proxy Authentication Required\nProxy-Authenticate: "
- "Basic realm=\"Proxy requires authentication\"\r\n"
- "content-length: 0\r\n"
- "\r\n");
- return;
- }
-
- if (m_authenticate && m_data.contains(m_auth)) {
- emit authenticationSuccess();
- }
-
- if (m_data.contains(m_cookie)) {
- emit cookieMatch();
- }
- m_data.clear();
-}
diff --git a/tests/auto/widgets/proxy/proxy_server.h b/tests/auto/widgets/proxy/proxy_server.h
deleted file mode 100644
index 7bc7b100b..000000000
--- a/tests/auto/widgets/proxy/proxy_server.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef PROXY_SERVER_H
-#define PROXY_SERVER_H
-
-#include <QObject>
-#include <QTcpServer>
-
-class ProxyServer : public QObject
-{
- Q_OBJECT
-
-public:
- explicit ProxyServer(QObject *parent = nullptr);
- void setCredentials(const QByteArray &user, const QByteArray password);
- void setCookie(const QByteArray &cookie);
- bool isListening();
-
-public slots:
- void run();
-
-private slots:
- void handleNewConnection();
- void handleReadReady();
-
-signals:
- void authenticationSuccess();
- void cookieMatch();
-
-private:
- QByteArray m_data;
- QTcpServer m_server;
- QByteArray m_auth;
- QByteArray m_cookie;
- bool m_authenticate = false;
-};
-
-#endif // PROXY_SERVER_H
diff --git a/tests/auto/widgets/proxy/tst_proxy.cpp b/tests/auto/widgets/proxy/tst_proxy.cpp
index c3e3c88a4..3dc72618c 100644
--- a/tests/auto/widgets/proxy/tst_proxy.cpp
+++ b/tests/auto/widgets/proxy/tst_proxy.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "proxy_server.h"
#include <QTest>
@@ -33,7 +8,7 @@
#include <QWebEnginePage>
#include <QWebEngineView>
#include <QWebEngineUrlRequestInterceptor>
-
+#include <QWebEngineLoadingInfo>
struct Interceptor : public QWebEngineUrlRequestInterceptor
{
@@ -53,6 +28,7 @@ public:
private slots:
void proxyAuthentication();
void forwardCookie();
+ void invalidHostName();
};
@@ -74,7 +50,7 @@ void tst_Proxy::proxyAuthentication()
QWebEnginePage page;
QSignalSpy successSpy(&server, &ProxyServer::authenticationSuccess);
page.load(QUrl("http://www.qt.io"));
- QTRY_VERIFY2(successSpy.count() > 0, "Could not get authentication token");
+ QTRY_VERIFY2(successSpy.size() > 0, "Could not get authentication token");
}
void tst_Proxy::forwardCookie()
@@ -94,7 +70,20 @@ void tst_Proxy::forwardCookie()
page.setUrlRequestInterceptor(&interceptor);
QSignalSpy cookieSpy(&server, &ProxyServer::cookieMatch);
page.load(QUrl("http://www.qt.io"));
- QTRY_VERIFY2(cookieSpy.count() > 0, "Could not get cookie");
+ QTRY_VERIFY2(cookieSpy.size() > 0, "Could not get cookie");
+}
+
+// Crash test ( https://bugreports.qt.io/browse/QTBUG-113992 )
+void tst_Proxy::invalidHostName()
+{
+ QNetworkProxy proxy;
+ proxy.setType(QNetworkProxy::HttpProxy);
+ proxy.setHostName("999.0.0.0");
+ QNetworkProxy::setApplicationProxy(proxy);
+ QWebEnginePage page;
+ QSignalSpy loadSpy(&page, SIGNAL(loadFinished(bool)));
+ page.load(QUrl("http://www.qt.io"));
+ QTRY_COMPARE_WITH_TIMEOUT(loadSpy.size(), 1, 20000);
}
#include "tst_proxy.moc"
diff --git a/tests/auto/widgets/proxypac/CMakeLists.txt b/tests/auto/widgets/proxypac/CMakeLists.txt
new file mode 100644
index 000000000..f27160cb6
--- /dev/null
+++ b/tests/auto/widgets/proxypac/CMakeLists.txt
@@ -0,0 +1,64 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+include(../../httpserver/httpserver.cmake)
+
+qt_internal_add_test(tst_proxypac_file
+ SOURCES
+ tst_proxypac.cpp
+ LIBRARIES
+ Qt::WebEngineCore
+ Test::HttpServer
+)
+
+if(WIN32)
+ get_filename_component(SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}" REALPATH)
+ set(fileEnvArg "--proxy-pac-url=\"file:///${SOURCE_DIR}/proxy.pac\"")
+elseif(LINUX AND CMAKE_CROSSCOMPILING)
+ set(fileEnvArg "--single-process --no-sandbox --proxy-pac-url=\"file://${CMAKE_CURRENT_LIST_DIR}/proxy.pac\"")
+else()
+ set(fileEnvArg "--proxy-pac-url=\"file://${CMAKE_CURRENT_LIST_DIR}/proxy.pac\"")
+endif()
+
+set_tests_properties(tst_proxypac_file PROPERTIES
+ ENVIRONMENT QTWEBENGINE_CHROMIUM_FLAGS=${fileEnvArg}
+)
+
+if(NOT (LINUX AND CMAKE_CROSSCOMPILING))
+ set(fileEnvArg "--single-process ${fileEnvArg}")
+
+ qt_internal_add_test(tst_proxypac_single_process
+ SOURCES
+ tst_proxypac.cpp
+ LIBRARIES
+ Qt::WebEngineCore
+ Test::HttpServer
+ )
+
+ set_tests_properties(tst_proxypac_single_process PROPERTIES
+ ENVIRONMENT QTWEBENGINE_CHROMIUM_FLAGS=${fileEnvArg}
+ )
+endif()
+
+qt_internal_add_test(tst_proxypac_qrc
+ SOURCES
+ tst_proxypac.cpp
+ LIBRARIES
+ Qt::WebEngineCore
+ Test::HttpServer
+)
+
+if(LINUX AND CMAKE_CROSSCOMPILING)
+ set(qrcEnvArg "--single-process --no-sandbox --proxy-pac-url=\"qrc:///proxy.pac\"")
+else()
+ set(qrcEnvArg "--proxy-pac-url=\"qrc:///proxy.pac\"")
+endif()
+
+set_tests_properties(tst_proxypac_qrc PROPERTIES
+ ENVIRONMENT QTWEBENGINE_CHROMIUM_FLAGS=${qrcEnvArg}
+)
+
+qt_internal_add_resource(tst_proxypac_qrc "proxypac"
+ PREFIX "/"
+ FILES "proxy.pac"
+)
diff --git a/tests/auto/widgets/proxypac/proxy.pac b/tests/auto/widgets/proxypac/proxy.pac
index 1d29847b9..966c37ba5 100644
--- a/tests/auto/widgets/proxypac/proxy.pac
+++ b/tests/auto/widgets/proxypac/proxy.pac
@@ -2,6 +2,6 @@ function FindProxyForURL(url, host)
{
if (shExpMatch(host, "*.proxy1.com")) return "PROXY localhost:5551";
if (shExpMatch(host, "*.proxy2.com")) return "PROXY localhost:5552";
- return "PROXY proxy.url:8080";
+ return "DIRECT";
}
diff --git a/tests/auto/widgets/proxypac/proxypac.pri b/tests/auto/widgets/proxypac/proxypac.pri
deleted file mode 100644
index b3b2856c8..000000000
--- a/tests/auto/widgets/proxypac/proxypac.pri
+++ /dev/null
@@ -1,5 +0,0 @@
-TEMPLATE = app
-CONFIG += testcase
-QT += testlib network webenginewidgets webengine
-HEADERS += $$PWD/proxyserver.h
-SOURCES += $$PWD/proxyserver.cpp $$PWD/tst_proxypac.cpp
diff --git a/tests/auto/widgets/proxypac/proxypac.pro b/tests/auto/widgets/proxypac/proxypac.pro
deleted file mode 100644
index f2a43d41f..000000000
--- a/tests/auto/widgets/proxypac/proxypac.pro
+++ /dev/null
@@ -1,4 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS = proxypac_file proxypac_qrc
-CONFIG += ordered
-
diff --git a/tests/auto/widgets/proxypac/proxypac.qrc b/tests/auto/widgets/proxypac/proxypac.qrc
deleted file mode 100644
index 9047585a0..000000000
--- a/tests/auto/widgets/proxypac/proxypac.qrc
+++ /dev/null
@@ -1,7 +0,0 @@
-<!DOCTYPE RCC>
-<RCC version="1.0">
-<qresource profix="/">
- <file>proxy.pac</file>
-</qresource>
-</RCC>
-
diff --git a/tests/auto/widgets/proxypac/proxypac_file/proxypac_file.pro b/tests/auto/widgets/proxypac/proxypac_file/proxypac_file.pro
deleted file mode 100644
index 037123054..000000000
--- a/tests/auto/widgets/proxypac/proxypac_file/proxypac_file.pro
+++ /dev/null
@@ -1,9 +0,0 @@
-include(../proxypac.pri)
-
-proxy_pac.name = QTWEBENGINE_CHROMIUM_FLAGS
-win32:proxy_pac.value = --proxy-pac-url="file:///$$PWD/../proxy.pac"
-else:proxy_pac.value = --proxy-pac-url="file://$$PWD/../proxy.pac"
-boot2qt:proxy_pac.value = "--single-process --no-sandbox --proxy-pac-url=file://$$PWD/../proxy.pac"
-
-QT_TOOL_ENV += proxy_pac
-
diff --git a/tests/auto/widgets/proxypac/proxypac_qrc/proxypac_qrc.pro b/tests/auto/widgets/proxypac/proxypac_qrc/proxypac_qrc.pro
deleted file mode 100644
index a5ab64605..000000000
--- a/tests/auto/widgets/proxypac/proxypac_qrc/proxypac_qrc.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-include(../proxypac.pri)
-
-proxy_pac.name = QTWEBENGINE_CHROMIUM_FLAGS
-proxy_pac.value = --proxy-pac-url="qrc:///proxy.pac"
-boot2qt:proxy_pac.value = "--single-process --no-sandbox --proxy-pac-url=qrc:///proxy.pac"
-QT_TOOL_ENV += proxy_pac
-RESOURCES+= $$PWD/../proxypac.qrc
diff --git a/tests/auto/widgets/proxypac/proxyserver.cpp b/tests/auto/widgets/proxypac/proxyserver.cpp
index 4d38c87c9..f7a859747 100644
--- a/tests/auto/widgets/proxypac/proxyserver.cpp
+++ b/tests/auto/widgets/proxypac/proxyserver.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "proxyserver.h"
#include <QDataStream>
diff --git a/tests/auto/widgets/proxypac/proxyserver.h b/tests/auto/widgets/proxypac/proxyserver.h
index ea68286a2..c95856da9 100644
--- a/tests/auto/widgets/proxypac/proxyserver.h
+++ b/tests/auto/widgets/proxypac/proxyserver.h
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#ifndef PROXY_SERVER_H
#define PROXY_SERVER_H
diff --git a/tests/auto/widgets/proxypac/tst_proxypac.cpp b/tests/auto/widgets/proxypac/tst_proxypac.cpp
index 934e23fde..43ccbf028 100644
--- a/tests/auto/widgets/proxypac/tst_proxypac.cpp
+++ b/tests/auto/widgets/proxypac/tst_proxypac.cpp
@@ -1,40 +1,13 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-#include "qtwebengineglobal.h"
-#include "proxyserver.h"
+#include "proxy_server.h"
#include <QTest>
#include <QSignalSpy>
#include <QWebEngineProfile>
#include <QWebEnginePage>
#include <QNetworkProxy>
-
class tst_ProxyPac : public QObject {
Q_OBJECT
public:
@@ -46,30 +19,39 @@ private slots:
void tst_ProxyPac::proxypac()
{
- const QString fromEnv = QString::fromLocal8Bit(qgetenv("QTWEBENGINE_CHROMIUM_FLAGS"));
+ const QString fromEnv = qEnvironmentVariable("QTWEBENGINE_CHROMIUM_FLAGS");
if (!fromEnv.contains("--proxy-pac-url"))
- qFatal("--proxy-pac-url argument is not passed.");
+ qFatal("--proxy-pac-url argument is not passed. Use ctest or set QTWEBENGINE_CHROMIUM_FLAGS");
ProxyServer proxyServer1;
+ QSignalSpy proxySpy1(&proxyServer1, &ProxyServer::requestReceived);
proxyServer1.setPort(5551);
proxyServer1.run();
- QSignalSpy proxySpy1(&proxyServer1, &ProxyServer::requestReceived);
ProxyServer proxyServer2;
+ QSignalSpy proxySpy2(&proxyServer2, &ProxyServer::requestReceived);
proxyServer2.setPort(5552);
proxyServer2.run();
- QSignalSpy proxySpy2(&proxyServer2, &ProxyServer::requestReceived);
QTRY_VERIFY2(proxyServer1.isListening(), "Could not setup proxy server 1");
QTRY_VERIFY2(proxyServer2.isListening(), "Could not setup proxy server 2");
QWebEngineProfile profile;
QWebEnginePage page(&profile);
+
+ const bool v8_proxy_resolver_enabled = !fromEnv.contains("--single-process");
page.load(QUrl("http://test.proxy1.com"));
- QTRY_COMPARE(proxySpy1.count() >= 1, true);
- QVERIFY(proxySpy2.count() == 0);
+ QTRY_COMPARE(proxySpy1.size() >= 1, v8_proxy_resolver_enabled);
+ QVERIFY(proxySpy2.size() == 0);
page.load(QUrl("http://test.proxy2.com"));
- QTRY_COMPARE(proxySpy2.count() >= 1 , true);
+ QTRY_COMPARE(proxySpy2.size() >= 1, v8_proxy_resolver_enabled);
+
+ // check for crash
+ QSignalSpy spyFinished(&page, &QWebEnginePage::loadFinished);
+ page.load(QUrl("https://contribute.qt-project.org"));
+
+ QTRY_VERIFY_WITH_TIMEOUT(!spyFinished.isEmpty(), 200000);
+
}
#include "tst_proxypac.moc"
diff --git a/tests/auto/widgets/qtbug_110287/CMakeLists.txt b/tests/auto/widgets/qtbug_110287/CMakeLists.txt
new file mode 100644
index 000000000..ac7926dc0
--- /dev/null
+++ b/tests/auto/widgets/qtbug_110287/CMakeLists.txt
@@ -0,0 +1,11 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_test(tst_qtbug_110287
+ SOURCES
+ tst_qtbug_110287.cpp
+ LIBRARIES
+ Qt::Network
+ Qt::WebEngineWidgets
+)
+target_link_options(tst_qtbug_110287 PRIVATE "-Wl,--as-needed")
diff --git a/tests/auto/widgets/qtbug_110287/tst_qtbug_110287.cpp b/tests/auto/widgets/qtbug_110287/tst_qtbug_110287.cpp
new file mode 100644
index 000000000..9453ae9b8
--- /dev/null
+++ b/tests/auto/widgets/qtbug_110287/tst_qtbug_110287.cpp
@@ -0,0 +1,41 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#include <QNetworkAccessManager>
+#include <QNetworkRequest>
+#include <QSignalSpy>
+#include <QTest>
+#include <QWebEngineView>
+
+class tst_qtbug_110287 : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qtbug_110287() { }
+
+private slots:
+ void getAddrInfo();
+};
+
+void tst_qtbug_110287::getAddrInfo()
+{
+ QNetworkAccessManager nam;
+ QSignalSpy namSpy(&nam, &QNetworkAccessManager::finished);
+
+ QString address("http://www.example.com");
+ QScopedPointer<QNetworkReply> reply(nam.get(QNetworkRequest(address)));
+
+ if (!namSpy.wait(25000) || reply->error() != QNetworkReply::NoError)
+ QSKIP("Couldn't load page from network, skipping test.");
+
+ QWebEngineView view;
+ QSignalSpy loadFinishedSpy(&view, SIGNAL(loadFinished(bool)));
+
+ // load() will trigger system DNS resolution that uses getaddrinfo()
+ view.load(QUrl(address));
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size() > 0, true, 30000);
+ QTRY_COMPARE(loadFinishedSpy[0][0].toBool(), true);
+}
+
+#include "tst_qtbug_110287.moc"
+QTEST_MAIN(tst_qtbug_110287)
diff --git a/tests/auto/widgets/qwebenginedownloaditem/qwebenginedownloaditem.pro b/tests/auto/widgets/qwebenginedownloaditem/qwebenginedownloaditem.pro
deleted file mode 100644
index 18a66c466..000000000
--- a/tests/auto/widgets/qwebenginedownloaditem/qwebenginedownloaditem.pro
+++ /dev/null
@@ -1,3 +0,0 @@
-include(../tests.pri)
-include(../../shared/http.pri)
-QT *= core-private
diff --git a/tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp b/tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp
deleted file mode 100644
index 39948c211..000000000
--- a/tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp
+++ /dev/null
@@ -1,1422 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QCoreApplication>
-#include <QSignalSpy>
-#include <QStandardPaths>
-#include <QTemporaryDir>
-#include <QTest>
-#include <QRegularExpression>
-#include <QWebEngineDownloadItem>
-#include <QWebEnginePage>
-#include <QWebEngineProfile>
-#include <QWebEngineSettings>
-#include <QWebEngineView>
-#include <httpserver.h>
-
-class tst_QWebEngineDownloadItem : public QObject
-{
- Q_OBJECT
-
-public:
- enum UserAction {
- SaveLink,
- ClickLink,
- };
-
- enum FileAction {
- FileIsDownloaded,
- FileIsDisplayed,
- };
-
-private Q_SLOTS:
- void initTestCase();
- void init();
- void cleanup();
- void cleanupTestCase();
-
- void downloadLink_data();
- void downloadLink();
- void downloadTwoLinks_data();
- void downloadTwoLinks();
- void downloadPage_data();
- void downloadPage();
- void downloadViaSetUrl();
- void downloadFileNot1();
- void downloadFileNot2();
- void downloadDeleted();
- void downloadDeletedByProfile();
- void downloadUniqueFilename_data();
- void downloadUniqueFilename();
- void downloadUniqueFilenameWithTimestamp();
- void downloadToDefaultLocation();
- void downloadToNonExistentDir();
- void downloadToReadOnlyDir();
-#if QT_DEPRECATED_SINCE(5, 14)
- void downloadPathValidation();
-#endif
- void downloadToDirectoryWithFileName_data();
- void downloadToDirectoryWithFileName();
-
-private:
- void saveLink(QPoint linkPos);
- void clickLink(QPoint linkPos);
- void simulateUserAction(QPoint linkPos, UserAction action);
-
- QWebEngineDownloadItem::DownloadType expectedDownloadType(
- UserAction userAction,
- const QByteArray &contentDisposition = QByteArray());
-
- HttpServer *m_server;
- QWebEngineProfile *m_profile;
- QWebEnginePage *m_page;
- QWebEngineView *m_view;
- QSet<QWebEngineDownloadItem *> m_requestedDownloads;
- QSet<QWebEngineDownloadItem *> m_finishedDownloads;
-};
-
-class ScopedConnection {
-public:
- ScopedConnection(QMetaObject::Connection connection) : m_connection(std::move(connection)) {}
- ~ScopedConnection() { QObject::disconnect(m_connection); }
-private:
- QMetaObject::Connection m_connection;
-};
-
-Q_DECLARE_METATYPE(tst_QWebEngineDownloadItem::UserAction)
-Q_DECLARE_METATYPE(tst_QWebEngineDownloadItem::FileAction)
-
-void tst_QWebEngineDownloadItem::initTestCase()
-{
- m_server = new HttpServer();
- m_profile = new QWebEngineProfile;
- m_profile->setHttpCacheType(QWebEngineProfile::NoCache);
- m_profile->settings()->setAttribute(QWebEngineSettings::AutoLoadIconsForPage, false);
- connect(m_profile, &QWebEngineProfile::downloadRequested, [this](QWebEngineDownloadItem *item) {
- m_requestedDownloads.insert(item);
- connect(item, &QWebEngineDownloadItem::destroyed, [this, item](){
- m_requestedDownloads.remove(item);
- m_finishedDownloads.remove(item);
- });
- connect(item, &QWebEngineDownloadItem::finished, [this, item](){
- m_finishedDownloads.insert(item);
- });
- });
- m_page = new QWebEnginePage(m_profile);
- m_view = new QWebEngineView;
- m_view->setPage(m_page);
- m_view->resize(640, 480);
- m_view->show();
-}
-
-void tst_QWebEngineDownloadItem::init()
-{
- QVERIFY(m_server->start());
-}
-
-void tst_QWebEngineDownloadItem::cleanup()
-{
- for (QWebEngineDownloadItem *item : m_finishedDownloads) {
- item->deleteLater();
- }
- QTRY_COMPARE(m_requestedDownloads.count(), 0);
- QCOMPARE(m_finishedDownloads.count(), 0);
- QVERIFY(m_server->stop());
- // Set download path to default.
- m_profile->setDownloadPath("");
-}
-
-void tst_QWebEngineDownloadItem::cleanupTestCase()
-{
- delete m_view;
- delete m_page;
- delete m_profile;
- delete m_server;
-}
-
-void tst_QWebEngineDownloadItem::saveLink(QPoint linkPos)
-{
- // Simulate right-clicking on link and choosing "save link as" from menu.
- QSignalSpy menuSpy(m_view, &QWebEngineView::customContextMenuRequested);
- m_view->setContextMenuPolicy(Qt::CustomContextMenu);
- auto event1 = new QContextMenuEvent(QContextMenuEvent::Mouse, linkPos);
- auto event2 = new QMouseEvent(QEvent::MouseButtonPress, linkPos, Qt::RightButton, {}, {});
- auto event3 = new QMouseEvent(QEvent::MouseButtonRelease, linkPos, Qt::RightButton, {}, {});
- QTRY_VERIFY(m_view->focusWidget());
- QWidget *renderWidget = m_view->focusWidget();
- QCoreApplication::postEvent(renderWidget, event1);
- QCoreApplication::postEvent(renderWidget, event2);
- QCoreApplication::postEvent(renderWidget, event3);
- QTRY_COMPARE(menuSpy.count(), 1);
- m_page->triggerAction(QWebEnginePage::DownloadLinkToDisk);
-}
-
-void tst_QWebEngineDownloadItem::clickLink(QPoint linkPos)
-{
- // Simulate left-clicking on link.
- QTRY_VERIFY(m_view->focusWidget());
- QWidget *renderWidget = m_view->focusWidget();
- QTest::mouseClick(renderWidget, Qt::LeftButton, {}, linkPos);
-}
-
-void tst_QWebEngineDownloadItem::simulateUserAction(QPoint linkPos, UserAction action)
-{
- switch (action) {
- case SaveLink: return saveLink(linkPos);
- case ClickLink: return clickLink(linkPos);
- }
-}
-
-QWebEngineDownloadItem::DownloadType tst_QWebEngineDownloadItem::expectedDownloadType(
- UserAction userAction, const QByteArray &contentDisposition)
-{
- if (userAction == SaveLink)
- return QWebEngineDownloadItem::UserRequested;
- if (contentDisposition == QByteArrayLiteral("attachment"))
- return QWebEngineDownloadItem::Attachment;
- return QWebEngineDownloadItem::DownloadAttribute;
-}
-
-void tst_QWebEngineDownloadItem::downloadLink_data()
-{
- QTest::addColumn<UserAction>("userAction");
- QTest::addColumn<bool>("anchorHasDownloadAttribute");
- QTest::addColumn<QByteArray>("fileName");
- QTest::addColumn<QByteArray>("fileContents");
- QTest::addColumn<QByteArray>("fileMimeTypeDeclared");
- QTest::addColumn<QByteArray>("fileMimeTypeDetected");
- QTest::addColumn<QByteArray>("fileDisposition");
- QTest::addColumn<bool>("fileHasReferer");
- QTest::addColumn<FileAction>("fileAction");
- QTest::addColumn<QWebEngineDownloadItem::DownloadType>("downloadType");
-
- // SaveLink should always trigger a download, even for empty files.
- QTest::newRow("save link to empty file")
- /* userAction */ << SaveLink
- /* anchorHasDownloadAttribute */ << false
- /* fileName */ << QByteArrayLiteral("foo.txt")
- /* fileContents */ << QByteArrayLiteral("")
- /* fileMimeTypeDeclared */ << QByteArrayLiteral("")
- /* fileMimeTypeDetected */ << QByteArrayLiteral("")
- /* fileDisposition */ << QByteArrayLiteral("")
- /* fileHasReferer */ << true
- /* fileAction */ << FileIsDownloaded;
-
- // SaveLink should always trigger a download, also for text files.
- QTest::newRow("save link to text file")
- /* userAction */ << SaveLink
- /* anchorHasDownloadAttribute */ << false
- /* fileName */ << QByteArrayLiteral("foo.txt")
- /* fileContents */ << QByteArrayLiteral("bar")
- /* fileMimeTypeDeclared */ << QByteArrayLiteral("text/plain")
- /* fileMimeTypeDetected */ << QByteArrayLiteral("text/plain")
- /* fileDisposition */ << QByteArrayLiteral("")
- /* fileHasReferer */ << true
- /* fileAction */ << FileIsDownloaded;
-
- // ... adding the "download" attribute should have no effect.
- QTest::newRow("save link to text file (attribute)")
- /* userAction */ << SaveLink
- /* anchorHasDownloadAttribute */ << true
- /* fileName */ << QByteArrayLiteral("foo.txt")
- /* fileContents */ << QByteArrayLiteral("bar")
- /* fileMimeTypeDeclared */ << QByteArrayLiteral("text/plain")
- /* fileMimeTypeDetected */ << QByteArrayLiteral("text/plain")
- /* fileDisposition */ << QByteArrayLiteral("")
- /* fileHasReferer */ << true
- /* fileAction */ << FileIsDownloaded;
-
- // ... adding the "attachment" content disposition should also have no effect.
- QTest::newRow("save link to text file (attachment)")
- /* userAction */ << SaveLink
- /* anchorHasDownloadAttribute */ << false
- /* fileName */ << QByteArrayLiteral("foo.txt")
- /* fileContents */ << QByteArrayLiteral("bar")
- /* fileMimeTypeDeclared */ << QByteArrayLiteral("text/plain")
- /* fileMimeTypeDetected */ << QByteArrayLiteral("text/plain")
- /* fileDisposition */ << QByteArrayLiteral("attachment")
- /* fileHasReferer */ << true
- /* fileAction */ << FileIsDownloaded;
-
- // ... even adding both should have no effect.
- QTest::newRow("save link to text file (attribute+attachment)")
- /* userAction */ << SaveLink
- /* anchorHasDownloadAttribute */ << true
- /* fileName */ << QByteArrayLiteral("foo.txt")
- /* fileContents */ << QByteArrayLiteral("bar")
- /* fileMimeTypeDeclared */ << QByteArrayLiteral("text/plain")
- /* fileMimeTypeDetected */ << QByteArrayLiteral("text/plain")
- /* fileDisposition */ << QByteArrayLiteral("attachment")
- /* fileHasReferer */ << true
- /* fileAction */ << FileIsDownloaded;
-
- // Navigating to an empty file should show an empty page.
- QTest::newRow("navigate to empty file")
- /* userAction */ << ClickLink
- /* anchorHasDownloadAttribute */ << false
- /* fileName */ << QByteArrayLiteral("foo.txt")
- /* fileContents */ << QByteArrayLiteral("")
- /* fileMimeTypeDeclared */ << QByteArrayLiteral("")
- /* fileMimeTypeDetected */ << QByteArrayLiteral("")
- /* fileDisposition */ << QByteArrayLiteral("")
- /* fileHasReferer */ << true
- /* fileAction */ << FileIsDisplayed;
-
- // Navigating to a text file should show the text file.
- QTest::newRow("navigate to text file")
- /* userAction */ << ClickLink
- /* anchorHasDownloadAttribute */ << false
- /* fileName */ << QByteArrayLiteral("foo.txt")
- /* fileContents */ << QByteArrayLiteral("bar")
- /* fileMimeTypeDeclared */ << QByteArrayLiteral("text/plain")
- /* fileMimeTypeDetected */ << QByteArrayLiteral("text/plain")
- /* fileDisposition */ << QByteArrayLiteral("")
- /* fileHasReferer */ << true
- /* fileAction */ << FileIsDisplayed;
-
- // ... unless the link has the "download" attribute: then the file should be downloaded.
- QTest::newRow("navigate to text file (attribute)")
- /* userAction */ << ClickLink
- /* anchorHasDownloadAttribute */ << true
- /* fileName */ << QByteArrayLiteral("foo.txt")
- /* fileContents */ << QByteArrayLiteral("bar")
- /* fileMimeTypeDeclared */ << QByteArrayLiteral("text/plain")
- /* fileMimeTypeDetected */ << QByteArrayLiteral("text/plain")
- /* fileDisposition */ << QByteArrayLiteral("")
- /* fileHasReferer */ << false // crbug.com/455987
- /* fileAction */ << FileIsDownloaded;
-
- // ... same with the content disposition header save for the download type.
- QTest::newRow("navigate to text file (attachment)")
- /* userAction */ << ClickLink
- /* anchorHasDownloadAttribute */ << false
- /* fileName */ << QByteArrayLiteral("foo.txt")
- /* fileContents */ << QByteArrayLiteral("bar")
- /* fileMimeTypeDeclared */ << QByteArrayLiteral("text/plain")
- /* fileMimeTypeDetected */ << QByteArrayLiteral("text/plain")
- /* fileDisposition */ << QByteArrayLiteral("attachment")
- /* fileHasReferer */ << true
- /* fileAction */ << FileIsDownloaded;
-
- // ... and both.
- QTest::newRow("navigate to text file (attribute+attachment)")
- /* userAction */ << ClickLink
- /* anchorHasDownloadAttribute */ << true
- /* fileName */ << QByteArrayLiteral("foo.txt")
- /* fileContents */ << QByteArrayLiteral("bar")
- /* fileMimeTypeDeclared */ << QByteArrayLiteral("text/plain")
- /* fileMimeTypeDetected */ << QByteArrayLiteral("text/plain")
- /* fileDisposition */ << QByteArrayLiteral("attachment")
- /* fileHasReferer */ << false // crbug.com/455987
- /* fileAction */ << FileIsDownloaded;
-
- // The file's extension has no effect.
- QTest::newRow("navigate to supposed zip file")
- /* userAction */ << ClickLink
- /* anchorHasDownloadAttribute */ << false
- /* fileName */ << QByteArrayLiteral("foo.zip")
- /* fileContents */ << QByteArrayLiteral("bar")
- /* fileMimeTypeDeclared */ << QByteArrayLiteral("")
- /* fileMimeTypeDetected */ << QByteArrayLiteral("")
- /* fileDisposition */ << QByteArrayLiteral("")
- /* fileHasReferer */ << true
- /* fileAction */ << FileIsDisplayed;
-
- // ... the file's mime type however does.
- QTest::newRow("navigate to supposed zip file (application/zip)")
- /* userAction */ << ClickLink
- /* anchorHasDownloadAttribute */ << false
- /* fileName */ << QByteArrayLiteral("foo.zip")
- /* fileContents */ << QByteArrayLiteral("bar")
- /* fileMimeTypeDeclared */ << QByteArrayLiteral("application/zip")
- /* fileMimeTypeDetected */ << QByteArrayLiteral("application/zip")
- /* fileDisposition */ << QByteArrayLiteral("")
- /* fileHasReferer */ << true
- /* fileAction */ << FileIsDownloaded;
-
- // ... but we're not very picky about the exact type.
- QTest::newRow("navigate to supposed zip file (application/octet-stream)")
- /* userAction */ << ClickLink
- /* anchorHasDownloadAttribute */ << false
- /* fileName */ << QByteArrayLiteral("foo.zip")
- /* fileContents */ << QByteArrayLiteral("bar")
- /* fileMimeTypeDeclared */ << QByteArrayLiteral("application/octet-stream")
- /* fileMimeTypeDetected */ << QByteArrayLiteral("application/octet-stream")
- /* fileDisposition */ << QByteArrayLiteral("")
- /* fileHasReferer */ << true
- /* fileAction */ << FileIsDownloaded;
-
- // empty zip file (consisting only of "end of central directory record")
- QByteArray zipFile = QByteArrayLiteral("PK\x05\x06") + QByteArray(18, 0);
-
- // The mime type is guessed automatically if not provided by the server.
- QTest::newRow("navigate to actual zip file")
- /* userAction */ << ClickLink
- /* anchorHasDownloadAttribute */ << false
- /* fileName */ << QByteArrayLiteral("foo.zip")
- /* fileContents */ << zipFile
- /* fileMimeTypeDeclared */ << QByteArrayLiteral("")
- /* fileMimeTypeDetected */ << QByteArrayLiteral("application/octet-stream")
- /* fileDisposition */ << QByteArrayLiteral("")
- /* fileHasReferer */ << true
- /* fileAction */ << FileIsDownloaded;
-
- // The mime type is not guessed automatically if provided by the server.
- QTest::newRow("navigate to actual zip file (application/zip)")
- /* userAction */ << ClickLink
- /* anchorHasDownloadAttribute */ << false
- /* fileName */ << QByteArrayLiteral("foo.zip")
- /* fileContents */ << zipFile
- /* fileMimeTypeDeclared */ << QByteArrayLiteral("application/zip")
- /* fileMimeTypeDetected */ << QByteArrayLiteral("application/zip")
- /* fileDisposition */ << QByteArrayLiteral("")
- /* fileHasReferer */ << true
- /* fileAction */ << FileIsDownloaded;
-}
-
-void tst_QWebEngineDownloadItem::downloadLink()
-{
- QFETCH(UserAction, userAction);
- QFETCH(bool, anchorHasDownloadAttribute);
- QFETCH(QByteArray, fileName);
- QFETCH(QByteArray, fileContents);
- QFETCH(QByteArray, fileMimeTypeDeclared);
- QFETCH(QByteArray, fileMimeTypeDetected);
- QFETCH(QByteArray, fileDisposition);
- QFETCH(bool, fileHasReferer);
- QFETCH(FileAction, fileAction);
-
- // Set up HTTP server
- int indexRequestCount = 0;
- int fileRequestCount = 0;
- QByteArray fileRequestReferer;
- ScopedConnection sc1 = connect(m_server, &HttpServer::newRequest, [&](HttpReqRep *rr) {
- if (rr->requestMethod() == "GET" && rr->requestPath() == "/") {
- indexRequestCount++;
-
- rr->setResponseHeader(QByteArrayLiteral("content-type"), QByteArrayLiteral("text/html"));
- QByteArray html;
- html += QByteArrayLiteral("<html><body><a href=\"");
- html += fileName;
- html += QByteArrayLiteral("\" ");
- if (anchorHasDownloadAttribute)
- html += QByteArrayLiteral("download");
- html += QByteArrayLiteral(">Link</a></body></html>");
- rr->setResponseBody(html);
- rr->sendResponse();
- } else if (rr->requestMethod() == "GET" && rr->requestPath() == "/" + fileName) {
- fileRequestCount++;
- fileRequestReferer = rr->requestHeader(QByteArrayLiteral("referer"));
-
- if (!fileDisposition.isEmpty())
- rr->setResponseHeader(QByteArrayLiteral("content-disposition"), fileDisposition);
- if (!fileMimeTypeDeclared.isEmpty())
- rr->setResponseHeader(QByteArrayLiteral("content-type"), fileMimeTypeDeclared);
- rr->setResponseBody(fileContents);
- rr->sendResponse();
- } else {
- rr->setResponseStatus(404);
- rr->sendResponse();
- }
- });
-
- // Set up profile and download handler
- QTemporaryDir tmpDir;
- QVERIFY(tmpDir.isValid());
- QByteArray slashFileName = QByteArrayLiteral("/") + fileName;
- QString suggestedPath =
- QStandardPaths::writableLocation(QStandardPaths::DownloadLocation) + slashFileName;
- QString downloadDirectory = tmpDir.path();
- QString downloadFileName = fileName;
- QString downloadPath = tmpDir.path() + slashFileName;
- QUrl downloadUrl = m_server->url(slashFileName);
- int acceptedCount = 0;
- int finishedCount = 0;
- ScopedConnection sc2 = connect(m_profile, &QWebEngineProfile::downloadRequested, [&](QWebEngineDownloadItem *item) {
- QCOMPARE(item->state(), QWebEngineDownloadItem::DownloadRequested);
- QCOMPARE(item->isFinished(), false);
- QCOMPARE(item->totalBytes(), -1);
- QCOMPARE(item->receivedBytes(), 0);
- QCOMPARE(item->interruptReason(), QWebEngineDownloadItem::NoReason);
- QCOMPARE(item->type(), expectedDownloadType(userAction, fileDisposition));
- QCOMPARE(item->isSavePageDownload(), false);
- QCOMPARE(item->mimeType(), QString(fileMimeTypeDetected));
- QCOMPARE(QDir(item->downloadDirectory()).filePath(item->downloadFileName()), suggestedPath);
- QCOMPARE(item->savePageFormat(), QWebEngineDownloadItem::UnknownSaveFormat);
- QCOMPARE(item->url(), downloadUrl);
- QCOMPARE(item->page(), m_page);
-
- connect(item, &QWebEngineDownloadItem::finished, [&, item]() {
- QCOMPARE(item->state(), QWebEngineDownloadItem::DownloadCompleted);
- QCOMPARE(item->isFinished(), true);
- QCOMPARE(item->totalBytes(), fileContents.size());
- QCOMPARE(item->receivedBytes(), fileContents.size());
- QCOMPARE(item->interruptReason(), QWebEngineDownloadItem::NoReason);
- QCOMPARE(item->type(), expectedDownloadType(userAction, fileDisposition));
- QCOMPARE(item->isSavePageDownload(), false);
- QCOMPARE(item->mimeType(), QString(fileMimeTypeDetected));
- QCOMPARE(QDir(item->downloadDirectory()).filePath(item->downloadFileName()), downloadPath);
- QCOMPARE(item->savePageFormat(), QWebEngineDownloadItem::UnknownSaveFormat);
- QCOMPARE(item->url(), downloadUrl);
- QCOMPARE(item->page(), m_page);
-
- finishedCount++;
- });
- item->setDownloadDirectory(downloadDirectory);
- item->setDownloadFileName(downloadFileName);
- item->accept();
-
- acceptedCount++;
- });
-
- // Load an HTML page with a link
- //
- // The only variation being whether the <a> element has a "download"
- // attribute or not.
- QSignalSpy loadSpy(m_page, &QWebEnginePage::loadFinished);
- m_view->load(m_server->url());
- QTRY_COMPARE(loadSpy.count(), 1);
- QCOMPARE(loadSpy.takeFirst().value(0).toBool(), true);
- QCOMPARE(indexRequestCount, 1);
-
- simulateUserAction(QPoint(10, 10), userAction);
-
- // If file is expected to be displayed and not downloaded then end test
- if (fileAction == FileIsDisplayed) {
- QTRY_COMPARE(loadSpy.count(), 1);
- QCOMPARE(loadSpy.takeFirst().value(0).toBool(), true);
- QCOMPARE(acceptedCount, 0);
- return;
- }
-
- // Otherwise file is downloaded
- QTRY_COMPARE(acceptedCount, 1);
- QTRY_COMPARE(finishedCount, 1);
- QCOMPARE(fileRequestCount, 1);
- if (fileHasReferer)
- QCOMPARE(fileRequestReferer, m_server->url().toEncoded());
- else
- QCOMPARE(fileRequestReferer, QByteArray());
- QFile file(downloadPath);
- QVERIFY(file.open(QIODevice::ReadOnly));
- QCOMPARE(file.readAll(), fileContents);
-}
-
-void tst_QWebEngineDownloadItem::downloadTwoLinks_data()
-{
- QTest::addColumn<UserAction>("action1");
- QTest::addColumn<UserAction>("action2");
- QTest::newRow("Save+Save") << SaveLink << SaveLink;
- QTest::newRow("Save+Click") << SaveLink << ClickLink;
- QTest::newRow("Click+Save") << ClickLink << SaveLink;
- QTest::newRow("Click+Click") << ClickLink << ClickLink;
-}
-
-void tst_QWebEngineDownloadItem::downloadTwoLinks()
-{
- QFETCH(UserAction, action1);
- QFETCH(UserAction, action2);
-
- // Set up HTTP server
- int file1RequestCount = 0;
- int file2RequestCount = 0;
- ScopedConnection sc1 = connect(m_server, &HttpServer::newRequest, [&](HttpReqRep *rr) {
- if (rr->requestMethod() == "GET" && rr->requestPath() == "/") {
- rr->setResponseHeader(QByteArrayLiteral("content-type"), QByteArrayLiteral("text/html"));
- rr->setResponseBody(QByteArrayLiteral("<html><body><a href=\"file1\" download>Link1</a><br/><a href=\"file2\">Link2</a></body></html>"));
- rr->sendResponse();
- } else if (rr->requestMethod() == "GET" && rr->requestPath() == "/file1") {
- file1RequestCount++;
- rr->setResponseHeader(QByteArrayLiteral("content-type"), QByteArrayLiteral("text/plain"));
- rr->setResponseBody(QByteArrayLiteral("file1"));
- rr->sendResponse();
- } else if (rr->requestMethod() == "GET" && rr->requestPath() == "/file2") {
- file2RequestCount++;
- rr->setResponseHeader(QByteArrayLiteral("content-type"), QByteArrayLiteral("text/plain"));
- rr->setResponseHeader(QByteArrayLiteral("content-disposition"), QByteArrayLiteral("attachment"));
- rr->setResponseBody(QByteArrayLiteral("file2"));
- rr->sendResponse();
- } else {
- rr->setResponseStatus(404);
- rr->sendResponse();
- }
- });
-
- // Set up profile and download handler
- QTemporaryDir tmpDir;
- QVERIFY(tmpDir.isValid());
- QString standardDir = QStandardPaths::writableLocation(QStandardPaths::DownloadLocation);
- int acceptedCount = 0;
- int finishedCount = 0;
- ScopedConnection sc2 = connect(m_profile, &QWebEngineProfile::downloadRequested, [&](QWebEngineDownloadItem *item) {
- QCOMPARE(item->state(), QWebEngineDownloadItem::DownloadRequested);
- QCOMPARE(item->isFinished(), false);
- QCOMPARE(item->totalBytes(), -1);
- QCOMPARE(item->receivedBytes(), 0);
- QCOMPARE(item->interruptReason(), QWebEngineDownloadItem::NoReason);
- QCOMPARE(item->savePageFormat(), QWebEngineDownloadItem::UnknownSaveFormat);
- QCOMPARE(item->mimeType(), QStringLiteral("text/plain"));
- QString filePart = QChar('/') + item->url().fileName();
- QString fileName = item->url().fileName();
- QCOMPARE(QDir(item->downloadDirectory()).filePath(item->downloadFileName()), standardDir + filePart);
-
- // type() is broken due to race condition in DownloadManagerDelegateQt
- if (action1 == ClickLink && action2 == ClickLink) {
- if (filePart == QStringLiteral("/file1"))
- QCOMPARE(item->type(), expectedDownloadType(action1));
- else if (filePart == QStringLiteral("/file2"))
- QCOMPARE(item->type(), expectedDownloadType(action2, QByteArrayLiteral("attachment")));
- else
- QFAIL(qPrintable("Unexpected file name: " + filePart));
- }
-
- connect(item, &QWebEngineDownloadItem::finished, [&]() {
- finishedCount++;
- });
- item->setDownloadDirectory(tmpDir.path());
- item->setDownloadFileName(fileName);
- item->accept();
-
- acceptedCount++;
- });
-
- QSignalSpy loadSpy(m_page, &QWebEnginePage::loadFinished);
- m_view->load(m_server->url());
- QTRY_COMPARE(loadSpy.count(), 1);
- QCOMPARE(loadSpy.takeFirst().value(0).toBool(), true);
-
- // Trigger downloads
- simulateUserAction(QPoint(10, 10), action1);
- simulateUserAction(QPoint(10, 30), action2);
-
- // Wait for downloads
- QTRY_COMPARE(file1RequestCount, 1);
- QTRY_COMPARE(file2RequestCount, 1);
- QTRY_COMPARE(acceptedCount, 2);
- QTRY_COMPARE(finishedCount, 2);
-}
-
-void tst_QWebEngineDownloadItem::downloadPage_data()
-{
- QTest::addColumn<bool>("saveWithPageAction");
- QTest::addColumn<QWebEngineDownloadItem::SavePageFormat>("savePageFormat");
- QTest::newRow("SingleHtmlSaveFormat") << false << QWebEngineDownloadItem::SingleHtmlSaveFormat;
- QTest::newRow("CompleteHtmlSaveFormat") << false << QWebEngineDownloadItem::CompleteHtmlSaveFormat;
- QTest::newRow("MimeHtmlSaveFormat") << false << QWebEngineDownloadItem::MimeHtmlSaveFormat;
- QTest::newRow("SavePageAction") << true << QWebEngineDownloadItem::MimeHtmlSaveFormat;
-}
-
-void tst_QWebEngineDownloadItem::downloadPage()
-{
- QFETCH(bool, saveWithPageAction);
- QFETCH(QWebEngineDownloadItem::SavePageFormat, savePageFormat);
-
- // Set up HTTP server
- int indexRequestCount = 0;
- ScopedConnection sc1 = connect(m_server, &HttpServer::newRequest, [&](HttpReqRep *rr) {
- if (rr->requestMethod() == "GET" && rr->requestPath() == "/") {
- indexRequestCount++;
- rr->setResponseHeader(QByteArrayLiteral("content-type"), QByteArrayLiteral("text/html"));
- rr->setResponseBody(QByteArrayLiteral("<html><body>Hello</body></html>"));
- rr->sendResponse();
- } else {
- rr->setResponseStatus(404);
- rr->sendResponse();
- }
- });
-
- // Set up profile and download handler
- QTemporaryDir tmpDir;
- QVERIFY(tmpDir.isValid());
- QString downloadFileName("test.html"), downloadPath = tmpDir.filePath(downloadFileName);
- QUrl downloadUrl = m_server->url("/");
- int acceptedCount = 0;
- int finishedCount = 0;
- ScopedConnection sc2 = connect(m_profile, &QWebEngineProfile::downloadRequested, [&](QWebEngineDownloadItem *item) {
- QCOMPARE(item->state(), saveWithPageAction ? QWebEngineDownloadItem::DownloadRequested : QWebEngineDownloadItem::DownloadInProgress);
- QCOMPARE(item->isFinished(), false);
- QCOMPARE(item->totalBytes(), -1);
- QCOMPARE(item->receivedBytes(), 0);
- QCOMPARE(item->interruptReason(), QWebEngineDownloadItem::NoReason);
- QCOMPARE(item->type(), QWebEngineDownloadItem::SavePage);
- QCOMPARE(item->isSavePageDownload(), true);
- // FIXME(juvaldma): why is mimeType always the same?
- QCOMPARE(item->mimeType(), QStringLiteral("application/x-mimearchive"));
- QCOMPARE(item->savePageFormat(), savePageFormat);
- QCOMPARE(item->url(), downloadUrl);
- QCOMPARE(item->page(), m_page);
-
- if (saveWithPageAction) {
- QVERIFY(!item->downloadDirectory().isEmpty());
- QVERIFY(!item->downloadFileName().isEmpty());
- item->setDownloadDirectory(tmpDir.path());
- item->setDownloadFileName(downloadFileName);
- item->accept();
- } // save with explicit path accepts download automatically
-
- QCOMPARE(QDir(item->downloadDirectory()).filePath(item->downloadFileName()), downloadPath);
-
- connect(item, &QWebEngineDownloadItem::finished, [&, item]() {
- QCOMPARE(item->state(), QWebEngineDownloadItem::DownloadCompleted);
- QCOMPARE(item->isFinished(), true);
- QCOMPARE(item->totalBytes(), item->receivedBytes());
- QVERIFY(item->receivedBytes() > 0);
- QCOMPARE(item->interruptReason(), QWebEngineDownloadItem::NoReason);
- QCOMPARE(item->type(), QWebEngineDownloadItem::SavePage);
- QCOMPARE(item->isSavePageDownload(), true);
- QCOMPARE(item->mimeType(), QStringLiteral("application/x-mimearchive"));
- QCOMPARE(QDir(item->downloadDirectory()).filePath(item->downloadFileName()), downloadPath);
- QCOMPARE(item->savePageFormat(), savePageFormat);
- QCOMPARE(item->url(), downloadUrl);
- QCOMPARE(item->page(), m_page);
-
- finishedCount++;
- });
-
- acceptedCount++;
- });
-
- // Load some HTML
- QSignalSpy loadSpy(m_page, &QWebEnginePage::loadFinished);
- m_page->load(m_server->url());
- QTRY_COMPARE(loadSpy.count(), 1);
- QCOMPARE(loadSpy.takeFirst().value(0).toBool(), true);
- QCOMPARE(indexRequestCount, 1);
-
- // Save some HTML
- if (saveWithPageAction)
- m_page->triggerAction(QWebEnginePage::SavePage);
- else
- m_page->save(downloadPath, savePageFormat);
-
- QTRY_COMPARE(acceptedCount, 1);
- QTRY_COMPARE(finishedCount, 1);
- QFile file(downloadPath);
- QVERIFY(file.exists());
-}
-
-void tst_QWebEngineDownloadItem::downloadViaSetUrl()
-{
- // Reproduce the scenario described in QTBUG-63388 by triggering downloads
- // of the same file multiple times via QWebEnginePage::setUrl
-
- // Set up HTTP server
- ScopedConnection sc1 = connect(m_server, &HttpServer::newRequest, [&](HttpReqRep *rr) {
- if (rr->requestMethod() == "GET" && rr->requestPath() == "/") {
- rr->setResponseHeader(QByteArrayLiteral("content-type"), QByteArrayLiteral("text/html"));
- rr->setResponseBody(QByteArrayLiteral("<html><body>Hello</body></html>"));
- rr->sendResponse();
- } else if (rr->requestMethod() == "GET" && rr->requestPath() == "/file") {
- rr->setResponseHeader(QByteArrayLiteral("content-disposition"), QByteArrayLiteral("attachment"));
- rr->setResponseBody(QByteArrayLiteral("redacted"));
- rr->sendResponse();
- } else {
- rr->setResponseStatus(404);
- rr->sendResponse();
- }
- });
-
- // Set up profile and download handler
- QVector<QUrl> downloadUrls;
- ScopedConnection sc2 = connect(m_profile, &QWebEngineProfile::downloadRequested, [&](QWebEngineDownloadItem *item) {
- downloadUrls.append(item->url());
- });
-
- // Set up the test scenario by trying to load some unrelated HTML.
- QSignalSpy loadSpy(m_page, &QWebEnginePage::loadFinished);
- QSignalSpy urlSpy(m_page, &QWebEnginePage::urlChanged);
- const QUrl indexUrl = m_server->url();
- m_page->setUrl(indexUrl);
- QTRY_COMPARE(loadSpy.count(), 1);
- QTRY_COMPARE(urlSpy.count(), 1);
- QCOMPARE(loadSpy.takeFirst().value(0).toBool(), true);
- QCOMPARE(urlSpy.takeFirst().value(0).toUrl(), indexUrl);
-
- // Download files via setUrl. With QTBUG-63388 after the first iteration the
- // downloads would be triggered for indexUrl and not fileUrl.
- const QUrl fileUrl = m_server->url(QByteArrayLiteral("/file"));
- for (int i = 0; i != 3; ++i) {
- m_page->setUrl(fileUrl);
- QCOMPARE(m_page->url(), fileUrl);
- QTRY_COMPARE(loadSpy.count(), 1);
- QTRY_COMPARE(urlSpy.count(), 2);
- QTRY_COMPARE(downloadUrls.count(), 1);
- QCOMPARE(loadSpy.takeFirst().value(0).toBool(), false);
- QCOMPARE(urlSpy.takeFirst().value(0).toUrl(), fileUrl);
- QCOMPARE(urlSpy.takeFirst().value(0).toUrl(), indexUrl);
- QCOMPARE(downloadUrls.takeFirst(), fileUrl);
- QCOMPARE(m_page->url(), indexUrl);
- }
-}
-
-void tst_QWebEngineDownloadItem::downloadFileNot1()
-{
- // Trigger file download via download() but don't accept().
-
- ScopedConnection sc1 = connect(m_server, &HttpServer::newRequest, [&](HttpReqRep *rr) {
- rr->setResponseStatus(404);
- rr->sendResponse();
- });
-
- QPointer<QWebEngineDownloadItem> downloadItem;
- int downloadCount = 0;
- ScopedConnection sc2 = connect(m_profile, &QWebEngineProfile::downloadRequested, [&](QWebEngineDownloadItem *item) {
- QVERIFY(item);
- QCOMPARE(item->state(), QWebEngineDownloadItem::DownloadRequested);
- downloadItem = item;
- downloadCount++;
- });
-
- m_page->download(m_server->url(QByteArrayLiteral("/file")));
- QTRY_COMPARE(downloadCount, 1);
- QVERIFY(!downloadItem);
-}
-
-void tst_QWebEngineDownloadItem::downloadFileNot2()
-{
- // Trigger file download via download() but call cancel() instead of accept().
-
- ScopedConnection sc1 = connect(m_server, &HttpServer::newRequest, [&](HttpReqRep *rr) {
- rr->setResponseStatus(404);
- rr->sendResponse();
- });
-
- QPointer<QWebEngineDownloadItem> downloadItem;
- int downloadCount = 0;
- ScopedConnection sc2 = connect(m_profile, &QWebEngineProfile::downloadRequested, [&](QWebEngineDownloadItem *item) {
- QVERIFY(item);
- QCOMPARE(item->state(), QWebEngineDownloadItem::DownloadRequested);
- item->cancel();
- downloadItem = item;
- downloadCount++;
- });
-
- m_page->download(m_server->url(QByteArrayLiteral("/file")));
- QTRY_COMPARE(downloadCount, 1);
- QVERIFY(downloadItem);
- QCOMPARE(downloadItem->state(), QWebEngineDownloadItem::DownloadCancelled);
-}
-
-void tst_QWebEngineDownloadItem::downloadDeleted()
-{
- QPointer<QWebEngineDownloadItem> downloadItem;
- m_server->setExpectError(true);
- int downloadCount = 0;
- int finishedCount = 0;
- ScopedConnection sc2 = connect(m_profile, &QWebEngineProfile::downloadRequested, [&](QWebEngineDownloadItem *item) {
- QVERIFY(item);
- QCOMPARE(item->state(), QWebEngineDownloadItem::DownloadRequested);
- downloadItem = item;
- connect(downloadItem, &QWebEngineDownloadItem::finished, [&]() {
- finishedCount++;
- });
- item->accept();
- downloadCount++;
- });
-
- m_page->download(m_server->url(QByteArrayLiteral("/file")));
- QTRY_COMPARE(downloadCount, 1);
- QVERIFY(downloadItem);
- QCOMPARE(finishedCount, 0);
- downloadItem->deleteLater();
- QTRY_COMPARE(finishedCount, 1);
-}
-
-void tst_QWebEngineDownloadItem::downloadDeletedByProfile()
-{
- m_server->setExpectError(true);
-
- QPointer<QWebEngineProfile> profile(new QWebEngineProfile);
- profile->setHttpCacheType(QWebEngineProfile::NoCache);
- profile->settings()->setAttribute(QWebEngineSettings::AutoLoadIconsForPage, false);
-
- bool downloadFinished = false;
- QPointer<QWebEngineDownloadItem> downloadItem;
- connect(profile, &QWebEngineProfile::downloadRequested, [&] (QWebEngineDownloadItem *item) {
- connect(item, &QWebEngineDownloadItem::finished, [&] () {
- downloadFinished = true;
- });
- downloadItem = item;
- item->accept();
- });
-
- QPointer<QWebEnginePage> page(new QWebEnginePage(profile));
- page->download(m_server->url(QByteArrayLiteral("/file")));
-
- QTRY_COMPARE(downloadItem.isNull(), false);
- QVERIFY(downloadItem);
-
- page->deleteLater();
- profile->deleteLater();
-
- QTRY_COMPARE(downloadFinished, true);
- QTRY_COMPARE(downloadItem.isNull(), true);
-}
-
-void tst_QWebEngineDownloadItem::downloadUniqueFilename_data()
-{
- QTest::addColumn<QString>("baseName");
- QTest::addColumn<QString>("extension");
-
- QTest::newRow("txt") << QString("test(1.test)") << QString("txt");
- QTest::newRow("tar.gz") << QString("test(1.test)") << QString("tar.gz");
-}
-
-void tst_QWebEngineDownloadItem::downloadUniqueFilename()
-{
- QFETCH(QString, baseName);
- QFETCH(QString, extension);
- QString fileName = QString("%1.%2").arg(baseName).arg(extension);
- QString downloadedFilePath;
- QString suggestedFileName;
- bool downloadFinished = false;
-
- QTemporaryDir tmpDir;
- QVERIFY(tmpDir.isValid());
- m_profile->setDownloadPath(tmpDir.path());
-
- // Set up HTTP server
- ScopedConnection sc1 = connect(m_server, &HttpServer::newRequest, [&](HttpReqRep *rr) {
- if (rr->requestMethod() == "GET" && rr->requestPath() == ("/" + fileName)) {
- rr->setResponseHeader(QByteArrayLiteral("content-type"), QByteArrayLiteral("application/octet-stream"));
- rr->setResponseHeader(QByteArrayLiteral("content-disposition"), QByteArrayLiteral("attachment"));
- rr->setResponseBody(QByteArrayLiteral("a"));
- rr->sendResponse();
- } else {
- rr->setResponseStatus(404);
- rr->sendResponse();
- }
- });
-
- // Set up profile and download handler
- ScopedConnection sc2 = connect(m_profile, &QWebEngineProfile::downloadRequested, [&](QWebEngineDownloadItem *item) {
- suggestedFileName = item->suggestedFileName();
- item->accept();
- connect(item, &QWebEngineDownloadItem::finished, [&, item]() {
- QCOMPARE(item->state(), QWebEngineDownloadItem::DownloadCompleted);
- QCOMPARE(item->isFinished(), true);
- QCOMPARE(item->totalBytes(), item->receivedBytes());
- QVERIFY(item->receivedBytes() > 0);
- QCOMPARE(item->interruptReason(), QWebEngineDownloadItem::NoReason);
- QCOMPARE(item->type(), QWebEngineDownloadItem::Attachment);
- QCOMPARE(item->isSavePageDownload(), false);
- downloadedFilePath = QDir(item->downloadDirectory()).filePath(item->downloadFileName());
- downloadFinished = true;
- });
- });
-
- m_page->setUrl(m_server->url("/" + fileName));
- QTRY_VERIFY(downloadFinished);
- QVERIFY(QFile(downloadedFilePath).exists());
- QCOMPARE(downloadedFilePath, m_profile->downloadPath() + "/" + baseName + "." + extension);
-
- for (int i = 1; i <= 2; ++i) {
- downloadFinished = false;
- m_page->setUrl(m_server->url("/" + fileName));
- QTRY_VERIFY(downloadFinished);
- QVERIFY(QFile(downloadedFilePath).exists());
- QCOMPARE(downloadedFilePath, m_profile->downloadPath() + "/" + baseName + " (" + QString::number(i) + ")." + extension);
- QCOMPARE(suggestedFileName, fileName);
- }
-}
-
-void tst_QWebEngineDownloadItem::downloadUniqueFilenameWithTimestamp()
-{
- // Set up HTTP server
- QString baseName("test(1.test)");
- QString extension("txt");
- QString fileName = QString("%1.%2").arg(baseName).arg(extension);
- QString downloadedFilePath;
- QString suggestedFileName;
- bool downloadFinished = false;
-
- QTemporaryDir tmpDir;
- QVERIFY(tmpDir.isValid());
- m_profile->setDownloadPath(tmpDir.path());
-
- ScopedConnection sc1 = connect(m_server, &HttpServer::newRequest, [&](HttpReqRep *rr) {
- if (rr->requestMethod() == "GET" && rr->requestPath() == ("/" + fileName)) {
- rr->setResponseHeader(QByteArrayLiteral("content-type"), QByteArrayLiteral("application/octet-stream"));
- rr->setResponseHeader(QByteArrayLiteral("content-disposition"), QByteArrayLiteral("attachment"));
- rr->setResponseBody(QByteArrayLiteral("a"));
- rr->sendResponse();
- } else {
- rr->setResponseStatus(404);
- rr->sendResponse();
- }
- });
-
- // Set up profile and download handler
- ScopedConnection sc2 = connect(m_profile, &QWebEngineProfile::downloadRequested, [&](QWebEngineDownloadItem *item) {
- suggestedFileName = item->suggestedFileName();
- item->accept();
- connect(item, &QWebEngineDownloadItem::finished, [&, item]() {
- QCOMPARE(item->state(), QWebEngineDownloadItem::DownloadCompleted);
- QCOMPARE(item->isFinished(), true);
- QCOMPARE(item->totalBytes(), item->receivedBytes());
- QVERIFY(item->receivedBytes() > 0);
- QCOMPARE(item->interruptReason(), QWebEngineDownloadItem::NoReason);
- QCOMPARE(item->page(), m_page);
- downloadFinished = true;
- downloadedFilePath = QDir(item->downloadDirectory()).filePath(item->downloadFileName());
- });
- });
-
- // Create the first empty file without uniquifier.
- {
- QFile file(m_profile->downloadPath() + "/" + fileName);
- file.open(QIODevice::ReadWrite);
- }
-
- // Create 99 empty files with uniquifier.
- for (int i = 1; i < 100; i++) {
- QFile file(m_profile->downloadPath() + "/" + baseName + " (" + QString::number(i) + ")." + extension);
- file.open(QIODevice::ReadWrite);
- }
-
- // Create 100th (kMaxUniqueFiles) empty file with uniquifier.
- m_page->setUrl(m_server->url("/" + fileName));
- QTRY_VERIFY(downloadFinished);
- QVERIFY(QFile(downloadedFilePath).exists());
- QCOMPARE(downloadedFilePath, m_profile->downloadPath() + "/" + baseName + " (100)." + extension);
- QCOMPARE(suggestedFileName, fileName);
-
- // Check if the downloaded files are suffixed with timestamp after the 100th download.
- for (int i = 101; i < 103; i++) {
- downloadFinished = false;
- m_page->setUrl(m_server->url("/" + fileName));
- QTRY_VERIFY(downloadFinished);
- QVERIFY(QFile(downloadedFilePath).exists());
- QRegularExpression fileNameCheck("^.*" + QRegularExpression::escape(baseName) + " - (.*)[.]" + QRegularExpression::escape(extension) + "$");
- QRegularExpressionMatch match = fileNameCheck.match(downloadedFilePath);
- QVERIFY(match.hasMatch());
- // ISO 8601 Date and time in UTC
- QRegularExpression timestamp("^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|["
- "12][0-9])T(2[0-3]|[01][0-9])([0-5][0-9])([0-5][0-9])([.][0-9]"
- "+)?(Z|[+-](?:2[0-3]|[01][0-9])[0-5][0-9])?$");
- QVERIFY(timestamp.match(match.captured(1)).hasMatch());
- QCOMPARE(suggestedFileName, fileName);
- }
-}
-
-void tst_QWebEngineDownloadItem::downloadToDefaultLocation()
-{
- QTemporaryDir tmpDir;
- QVERIFY(tmpDir.isValid());
-
- QCOMPARE(m_profile->downloadPath(), QStandardPaths::writableLocation(QStandardPaths::DownloadLocation));
-
- m_profile->setDownloadPath("");
- QCOMPARE(m_profile->downloadPath(), QStandardPaths::writableLocation(QStandardPaths::DownloadLocation));
-
- m_profile->setDownloadPath(tmpDir.path());
- QCOMPARE(m_profile->downloadPath(), tmpDir.path());
-
- m_profile->setDownloadPath(QStandardPaths::writableLocation(QStandardPaths::DownloadLocation));
- QCOMPARE(m_profile->downloadPath(), QStandardPaths::writableLocation(QStandardPaths::DownloadLocation));
-}
-
-void tst_QWebEngineDownloadItem::downloadToNonExistentDir()
-{
- QString baseName("test(1.test)");
- QString extension("txt");
- QString fileName = QString("%1.%2").arg(baseName).arg(extension);
- QString downloadedFilePath;
- QString suggestedFileName;
- bool downloadFinished = false;
-
- QTemporaryDir tmpDir;
- QVERIFY(tmpDir.isValid());
- m_profile->setDownloadPath(tmpDir.path());
-
- // Set up HTTP server
- ScopedConnection sc1 = connect(m_server, &HttpServer::newRequest, [&](HttpReqRep *rr) {
- if (rr->requestMethod() == "GET" && rr->requestPath() == ("/" + fileName)) {
- rr->setResponseHeader(QByteArrayLiteral("content-type"), QByteArrayLiteral("application/octet-stream"));
- rr->setResponseHeader(QByteArrayLiteral("content-disposition"), QByteArrayLiteral("attachment"));
- rr->setResponseBody(QByteArrayLiteral("a"));
- rr->sendResponse();
- } else {
- rr->setResponseStatus(404);
- rr->sendResponse();
- }
- });
-
- // Set up profile and download handler
- ScopedConnection sc2 = connect(m_profile, &QWebEngineProfile::downloadRequested, [&](QWebEngineDownloadItem *item) {
- suggestedFileName = item->suggestedFileName();
- item->accept();
- connect(item, &QWebEngineDownloadItem::finished, [&, item]() {
- QCOMPARE(item->state(), QWebEngineDownloadItem::DownloadCompleted);
- QCOMPARE(item->isFinished(), true);
- QCOMPARE(item->totalBytes(), item->receivedBytes());
- QVERIFY(item->receivedBytes() > 0);
- QCOMPARE(item->interruptReason(), QWebEngineDownloadItem::NoReason);
- QCOMPARE(item->page(), m_page);
- downloadFinished = true;
- downloadedFilePath = QDir(item->downloadDirectory()).filePath(item->downloadFileName());
- });
- });
-
- // Set a non-existent directory for the default download location.
- QString nonExistentDownloadPath(m_profile->downloadPath() + "/non_existent_dir");
- m_profile->setDownloadPath(nonExistentDownloadPath);
- QCOMPARE(m_profile->downloadPath(), nonExistentDownloadPath);
- m_page->setUrl(m_server->url("/" + fileName));
- QTRY_VERIFY(downloadFinished);
- QVERIFY(QFile(downloadedFilePath).exists());
- QCOMPARE(downloadedFilePath, nonExistentDownloadPath + "/" + fileName);
- QCOMPARE(suggestedFileName, fileName);
-}
-
-void tst_QWebEngineDownloadItem::downloadToReadOnlyDir()
-{
-#ifdef Q_OS_WIN
- QSKIP("Cannot change file permissions on Windows.");
-#endif
- QString baseName("test(1.test)");
- QString extension("txt");
- QString fileName = QString("%1.%2").arg(baseName).arg(extension);
- QString downloadedFilePath;
- QString suggestedFileName;
- bool downloadAccepted = false;
- bool downloadFinished = false;
-
- QTemporaryDir tmpDir;
- QVERIFY(tmpDir.isValid());
- m_profile->setDownloadPath(tmpDir.path());
-
- // Set up HTTP server
- ScopedConnection sc1 = connect(m_server, &HttpServer::newRequest, [&](HttpReqRep *rr) {
- if (rr->requestMethod() == "GET" && rr->requestPath() == ("/" + fileName)) {
- rr->setResponseHeader(QByteArrayLiteral("content-type"), QByteArrayLiteral("application/octet-stream"));
- rr->setResponseHeader(QByteArrayLiteral("content-disposition"), QByteArrayLiteral("attachment"));
- rr->setResponseBody(QByteArrayLiteral("a"));
- rr->sendResponse();
- } else {
- rr->setResponseStatus(404);
- rr->sendResponse();
- }
- });
-
- QPointer<QWebEngineDownloadItem> downloadItem;
- ScopedConnection sc2 = connect(m_profile, &QWebEngineProfile::downloadRequested, [&](QWebEngineDownloadItem *item) {
- suggestedFileName = item->suggestedFileName();
- downloadItem = item;
- item->accept();
- connect(item, &QWebEngineDownloadItem::finished, [&]() {
- downloadFinished = true;
- });
- downloadAccepted = true;
- });
-
- // Change permission for directory.
- QFile(m_profile->downloadPath()).setPermissions(QFileDevice::ReadOwner);
- QVERIFY(QFile(m_profile->downloadPath()).exists());
-
- m_page->setUrl(m_server->url("/" + fileName));
- QTRY_VERIFY(downloadAccepted);
-
- QVERIFY(downloadItem);
- QTRY_COMPARE(downloadItem->state(), QWebEngineDownloadItem::DownloadInterrupted);
- QCOMPARE(downloadItem->isFinished(), false);
- QCOMPARE(downloadItem->interruptReason(), QWebEngineDownloadItem::FileAccessDenied);
- QVERIFY(!QFile(downloadedFilePath).exists());
- QCOMPARE(suggestedFileName, fileName);
-
- // Clear m_requestedDownloads explicitly because download is accepted but never finished.
- m_requestedDownloads.clear();
- QVERIFY(!downloadFinished);
- QFile(m_profile->downloadPath()).setPermissions(QFileDevice::WriteOwner);
-}
-
-#if QT_DEPRECATED_SINCE(5, 14)
-void tst_QWebEngineDownloadItem::downloadPathValidation()
-{
- const QString fileName = "test.txt";
- QString downloadPath;
- QString originalDownloadPath;
-
- QTemporaryDir tmpDir;
- QVERIFY(tmpDir.isValid());
- m_profile->setDownloadPath(tmpDir.path());
-
- // Set up HTTP server
- ScopedConnection sc1 = connect(m_server, &HttpServer::newRequest, [&](HttpReqRep *rr) {
- if (rr->requestMethod() == "GET" && rr->requestPath() == ("/" + fileName)) {
- rr->setResponseHeader(QByteArrayLiteral("content-type"), QByteArrayLiteral("application/octet-stream"));
- rr->setResponseHeader(QByteArrayLiteral("content-disposition"), QByteArrayLiteral("attachment"));
- rr->setResponseBody(QByteArrayLiteral("a"));
- rr->sendResponse();
- } else {
- rr->setResponseStatus(404);
- rr->sendResponse();
- }
- });
-
- // Set up profile and download handler
- QPointer<QWebEngineDownloadItem> downloadItem;
- ScopedConnection sc2 = connect(m_profile, &QWebEngineProfile::downloadRequested, [&](QWebEngineDownloadItem *item) {
- downloadItem = item;
- originalDownloadPath = item->path();
-
- item->setPath(downloadPath);
- item->accept();
-
- connect(item, &QWebEngineDownloadItem::stateChanged, [&, item](QWebEngineDownloadItem::DownloadState downloadState) {
- if (downloadState == QWebEngineDownloadItem::DownloadInterrupted) {
- item->cancel();
- }
- });
-
- connect(item, &QWebEngineDownloadItem::finished, [&, item]() {
- QCOMPARE(item->isFinished(), true);
- QCOMPARE(item->totalBytes(), item->receivedBytes());
- QVERIFY(item->receivedBytes() > 0);
- QCOMPARE(item->page(), m_page);
- });
- });
-
- QString oldPath = QDir::currentPath();
- QDir::setCurrent(tmpDir.path());
-
- // Set only the file name.
- downloadItem.clear();
- originalDownloadPath = "";
- downloadPath = fileName;
- m_page->setUrl(m_server->url("/" + fileName));
- QTRY_VERIFY(downloadItem);
- QTRY_COMPARE(downloadItem->state(), QWebEngineDownloadItem::DownloadCompleted);
- QCOMPARE(downloadItem->interruptReason(), QWebEngineDownloadItem::NoReason);
- QCOMPARE(downloadItem->path(), fileName);
-
- // Set only the directory path.
- downloadItem.clear();
- originalDownloadPath = "";
- downloadPath = tmpDir.path();
- m_page->setUrl(m_server->url("/" + fileName));
- QTRY_VERIFY(downloadItem);
- QTRY_COMPARE(downloadItem->state(), QWebEngineDownloadItem::DownloadCompleted);
- QCOMPARE(downloadItem->interruptReason(), QWebEngineDownloadItem::NoReason);
- QCOMPARE(downloadItem->path(), originalDownloadPath);
-
- // Set only the directory path with separator.
- downloadItem.clear();
- originalDownloadPath = "";
- downloadPath = tmpDir.path() + QDir::separator();
- m_page->setUrl(m_server->url("/" + fileName));
- QTRY_VERIFY(downloadItem);
- QTRY_COMPARE(downloadItem->state(), QWebEngineDownloadItem::DownloadCompleted);
- QCOMPARE(downloadItem->interruptReason(), QWebEngineDownloadItem::NoReason);
- QCOMPARE(downloadItem->path(), originalDownloadPath);
-
- // Set only the directory with the current directory path without ending separator.
- downloadItem.clear();
- originalDownloadPath = "";
- downloadPath = ".";
- m_page->setUrl(m_server->url("/" + fileName));
- QTRY_VERIFY(downloadItem);
- QTRY_COMPARE(downloadItem->state(), QWebEngineDownloadItem::DownloadCompleted);
- QCOMPARE(downloadItem->interruptReason(), QWebEngineDownloadItem::NoReason);
- QCOMPARE(downloadItem->path(), originalDownloadPath);
-
- // Set only the directory with the current directory path with ending separator.
- downloadItem.clear();
- originalDownloadPath = "";
- downloadPath = "./";
- m_page->setUrl(m_server->url("/" + fileName));
- QTRY_VERIFY(downloadItem);
- QTRY_COMPARE(downloadItem->state(), QWebEngineDownloadItem::DownloadCompleted);
- QCOMPARE(downloadItem->interruptReason(), QWebEngineDownloadItem::NoReason);
- QCOMPARE(downloadItem->path(), originalDownloadPath);
-
- downloadItem.clear();
- originalDownloadPath = "";
- downloadPath = "...";
- m_page->setUrl(m_server->url("/" + fileName));
- QTRY_VERIFY(downloadItem);
-#if !defined(Q_OS_WIN)
- QTRY_COMPARE(downloadItem->state(), QWebEngineDownloadItem::DownloadCancelled);
- QCOMPARE(downloadItem->interruptReason(), QWebEngineDownloadItem::FileFailed);
- QCOMPARE(downloadItem->path(), downloadPath);
-#else
- // Windows interprets the "..." path as a valid path. It will be the current path.
- QTRY_COMPARE(downloadItem->state(), QWebEngineDownloadItem::DownloadCompleted);
- QCOMPARE(downloadItem->interruptReason(), QWebEngineDownloadItem::NoReason);
- QCOMPARE(downloadItem->path(), originalDownloadPath);
-#endif // !defined(Q_OS_WIN)
- QDir::setCurrent(oldPath);
-}
-#endif
-
-void tst_QWebEngineDownloadItem::downloadToDirectoryWithFileName_data()
-{
- QTest::addColumn<bool>("setDirectoryFirst");
-
- QTest::newRow("setDirectoryFirst") << true;
- QTest::newRow("setFileNameFirst") << false;
-}
-
-void tst_QWebEngineDownloadItem::downloadToDirectoryWithFileName()
-{
- QFETCH(bool, setDirectoryFirst);
- QString downloadDirectory;
- QString downloadFileName;
- QString downloadedFilePath;
- QString downloadedSuggestedFileName;
- QString fileName = "test.txt";
- QString uniqueFileName = "test (1).txt";
-
- bool downloadFinished = false;
-
- QTemporaryDir tmpDir;
- QVERIFY(tmpDir.isValid());
- m_profile->setDownloadPath(tmpDir.path());
-
- // Set up HTTP server
- ScopedConnection sc1 = connect(m_server, &HttpServer::newRequest, [&](HttpReqRep *rr) {
- if (rr->requestMethod() == "GET" && rr->requestPath() == ("/" + fileName)) {
- rr->setResponseHeader(QByteArrayLiteral("content-type"), QByteArrayLiteral("application/octet-stream"));
- rr->setResponseHeader(QByteArrayLiteral("content-disposition"), QByteArrayLiteral("attachment"));
- rr->setResponseBody(QByteArrayLiteral("a"));
- rr->sendResponse();
- } else {
- rr->setResponseStatus(404);
- rr->sendResponse();
- }
- });
-
- // Set up profile and download handler
- ScopedConnection sc2 = connect(m_profile, &QWebEngineProfile::downloadRequested, [&](QWebEngineDownloadItem *item) {
-
- if (!downloadDirectory.isEmpty() && setDirectoryFirst) {
- item->setDownloadDirectory(downloadDirectory);
- QCOMPARE(item->downloadDirectory(), downloadDirectory);
- }
-
- if (!downloadFileName.isEmpty()) {
- item->setDownloadFileName(downloadFileName);
- QCOMPARE(item->downloadFileName(), downloadFileName);
- }
-
- if (!downloadDirectory.isEmpty() && !setDirectoryFirst) {
- item->setDownloadDirectory(downloadDirectory);
- QCOMPARE(item->downloadDirectory(), downloadDirectory);
- }
-
- QCOMPARE(item->path(), QDir(item->downloadDirectory()).filePath(item->downloadFileName()));
- item->accept();
-
- connect(item, &QWebEngineDownloadItem::finished, [&, item]() {
- QCOMPARE(item->state(), QWebEngineDownloadItem::DownloadCompleted);
- QCOMPARE(item->isFinished(), true);
- QCOMPARE(item->totalBytes(), item->receivedBytes());
- QVERIFY(item->receivedBytes() > 0);
- QCOMPARE(item->interruptReason(), QWebEngineDownloadItem::NoReason);
- QCOMPARE(item->page(), m_page);
- downloadFinished = true;
- downloadedFilePath = QDir(item->downloadDirectory()).filePath(item->downloadFileName());
- downloadedSuggestedFileName = item->suggestedFileName();
- });
- });
-
- // Download file to the default download directory.
- downloadDirectory = "";
- downloadFileName = "";
- m_page->setUrl(m_server->url("/" + fileName));
- QTRY_VERIFY(downloadFinished);
- QVERIFY(QFile(downloadedFilePath).exists());
- QCOMPARE(downloadedFilePath, QDir(m_profile->downloadPath()).filePath(fileName));
- QCOMPARE(downloadedSuggestedFileName, fileName);
-
- // Download the same file to another directory
- downloadFinished = false;
- downloadDirectory = m_profile->downloadPath() + QDir::separator() + "test1" + QDir::separator();
- downloadFileName = "";
- m_page->setUrl(m_server->url("/" + fileName));
- QTRY_VERIFY(downloadFinished);
- QVERIFY(QFile(downloadedFilePath).exists());
- QCOMPARE(downloadedFilePath, QDir(downloadDirectory).filePath(fileName));
- QCOMPARE(downloadedSuggestedFileName, fileName);
-
- // Download the same file to the same directory and the file name must be unique.
- downloadFinished = false;
- downloadDirectory = m_profile->downloadPath() + QDir::separator() + "test1" + QDir::separator();
- downloadFileName = "";
- m_page->setUrl(m_server->url("/" + fileName));
- QTRY_VERIFY(downloadFinished);
- QVERIFY(QFile(downloadedFilePath).exists());
- QCOMPARE(downloadedFilePath, QDir(downloadDirectory).filePath(uniqueFileName));
- QCOMPARE(downloadedSuggestedFileName, fileName);
-
- // Download another file to the same directory and set file name by
- // QWebEngineDownloadItem::setDownloadDirectory() and setDownloadFileName() to avoid uniquification.
- downloadFinished = false;
- downloadDirectory = m_profile->downloadPath() + QDir::separator() + "test1" + QDir::separator();
- downloadFileName = "test1.txt";
- m_page->setUrl(m_server->url("/" + fileName));
- QTRY_VERIFY(downloadFinished);
- QVERIFY(QFile(downloadedFilePath).exists());
- QCOMPARE(downloadedFilePath, QDir(downloadDirectory).filePath(downloadFileName));
- QCOMPARE(downloadedSuggestedFileName, fileName);
-
- // Download the same file to another directory without uniquifying the file name
- downloadFinished = false;
- downloadDirectory = m_profile->downloadPath() + QDir::separator() + "test2" + QDir::separator();
- downloadFileName = "test1.txt";
- m_page->setUrl(m_server->url("/" + fileName));
- QTRY_VERIFY(downloadFinished);
- QVERIFY(QFile(downloadedFilePath).exists());
- QCOMPARE(downloadedFilePath, QDir(downloadDirectory).filePath(downloadFileName));
- QCOMPARE(downloadedSuggestedFileName, fileName);
-
- // Download the same file to same directory and set file name by
- // QWebEngineDownloadItem::setDownloadDirectory() and setDownloadFileName() to avoid uniquification.
- downloadFinished = false;
- downloadDirectory = m_profile->downloadPath() + QDir::separator() + "test2" + QDir::separator();
- downloadFileName = "test1.txt";
- m_page->setUrl(m_server->url("/" + fileName));
- QTRY_VERIFY(downloadFinished);
- QVERIFY(QFile(downloadedFilePath).exists());
- QCOMPARE(downloadedFilePath, QDir(downloadDirectory).filePath(downloadFileName));
- QCOMPARE(downloadedSuggestedFileName, fileName);
-
- // Download the same file in the same directory.
- // Use the suggested file name (test.txt) and the file name will not be unique because this file name don't yet exists.
- downloadFinished = false;
- downloadDirectory = m_profile->downloadPath() + QDir::separator() + "test2" + QDir::separator();
- downloadFileName = "";
- m_page->setUrl(m_server->url("/" + fileName));
- QTRY_VERIFY(downloadFinished);
- QVERIFY(QFile(downloadedFilePath).exists());
- QCOMPARE(downloadedFilePath, QDir(downloadDirectory).filePath(fileName));
- QCOMPARE(downloadedSuggestedFileName, fileName);
-}
-
-QTEST_MAIN(tst_QWebEngineDownloadItem)
-#include "tst_qwebenginedownloaditem.moc"
diff --git a/tests/auto/widgets/qwebenginedownloadrequest/CMakeLists.txt b/tests/auto/widgets/qwebenginedownloadrequest/CMakeLists.txt
new file mode 100644
index 000000000..5b76909b1
--- /dev/null
+++ b/tests/auto/widgets/qwebenginedownloadrequest/CMakeLists.txt
@@ -0,0 +1,14 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+include(../../httpserver/httpserver.cmake)
+include(../../util/util.cmake)
+
+qt_internal_add_test(tst_qwebenginedownloadrequest
+ SOURCES
+ tst_qwebenginedownloadrequest.cpp
+ LIBRARIES
+ Qt::WebEngineWidgets
+ Test::HttpServer
+ Test::Util
+)
diff --git a/tests/auto/widgets/qwebenginedownloadrequest/tst_qwebenginedownloadrequest.cpp b/tests/auto/widgets/qwebenginedownloadrequest/tst_qwebenginedownloadrequest.cpp
new file mode 100644
index 000000000..c81a27b3a
--- /dev/null
+++ b/tests/auto/widgets/qwebenginedownloadrequest/tst_qwebenginedownloadrequest.cpp
@@ -0,0 +1,1286 @@
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#include <util.h>
+
+#include <QCoreApplication>
+#include <QSignalSpy>
+#include <QStandardPaths>
+#include <QTemporaryDir>
+#include <QTest>
+#include <QRegularExpression>
+#include <QWebEngineDownloadRequest>
+#include <QWebEnginePage>
+#include <QWebEngineProfile>
+#include <QWebEngineSettings>
+#include <QWebEngineView>
+#include <httpserver.h>
+
+class tst_QWebEngineDownloadRequest : public QObject
+{
+ Q_OBJECT
+
+public:
+ enum UserAction {
+ SaveLink,
+ ClickLink,
+ };
+
+ enum FileAction {
+ FileIsDownloaded,
+ FileIsDisplayed,
+ };
+
+private Q_SLOTS:
+ void initTestCase();
+ void init();
+ void cleanup();
+ void cleanupTestCase();
+
+ void downloadLink_data();
+ void downloadLink();
+ void downloadTwoLinks_data();
+ void downloadTwoLinks();
+ void downloadPage_data();
+ void downloadPage();
+ void downloadViaSetUrl();
+ void downloadFileNot1();
+ void downloadFileNot2();
+ void downloadDeleted();
+ void downloadDeletedByProfile();
+ void downloadUniqueFilename_data();
+ void downloadUniqueFilename();
+ void downloadUniqueFilenameWithTimestamp();
+ void downloadToDefaultLocation();
+ void downloadToNonExistentDir();
+ void downloadToReadOnlyDir();
+ void downloadToDirectoryWithFileName_data();
+ void downloadToDirectoryWithFileName();
+ void downloadDataUrls_data();
+ void downloadDataUrls();
+
+private:
+ void saveLink(QPoint linkPos);
+ void clickLink(QPoint linkPos);
+ void simulateUserAction(QPoint linkPos, UserAction action);
+
+ HttpServer *m_server;
+ QWebEngineProfile *m_profile;
+ QWebEnginePage *m_page;
+ QWebEngineView *m_view;
+ QSet<QWebEngineDownloadRequest *> m_requestedDownloads;
+ QSet<QWebEngineDownloadRequest *> m_finishedDownloads;
+};
+
+Q_DECLARE_METATYPE(tst_QWebEngineDownloadRequest::UserAction)
+Q_DECLARE_METATYPE(tst_QWebEngineDownloadRequest::FileAction)
+
+void tst_QWebEngineDownloadRequest::initTestCase()
+{
+ m_server = new HttpServer();
+ m_profile = new QWebEngineProfile;
+ m_profile->setHttpCacheType(QWebEngineProfile::NoCache);
+ m_profile->settings()->setAttribute(QWebEngineSettings::AutoLoadIconsForPage, false);
+ connect(m_profile, &QWebEngineProfile::downloadRequested, [this](QWebEngineDownloadRequest *item) {
+ m_requestedDownloads.insert(item);
+ connect(item, &QWebEngineDownloadRequest::destroyed, [this, item](){
+ m_requestedDownloads.remove(item);
+ m_finishedDownloads.remove(item);
+ });
+ connect(item, &QWebEngineDownloadRequest::isFinishedChanged, [this, item](){
+ m_finishedDownloads.insert(item);
+ });
+ });
+ m_page = new QWebEnginePage(m_profile);
+ m_view = new QWebEngineView;
+ m_view->setPage(m_page);
+ m_view->resize(640, 480);
+ m_view->show();
+}
+
+void tst_QWebEngineDownloadRequest::init()
+{
+ QVERIFY(m_server->start());
+}
+
+void tst_QWebEngineDownloadRequest::cleanup()
+{
+ for (QWebEngineDownloadRequest *item : m_finishedDownloads) {
+ item->deleteLater();
+ }
+ QTRY_COMPARE(m_requestedDownloads.size(), 0);
+ QCOMPARE(m_finishedDownloads.size(), 0);
+ QVERIFY(m_server->stop());
+ // Set download path to default.
+ m_profile->setDownloadPath("");
+}
+
+void tst_QWebEngineDownloadRequest::cleanupTestCase()
+{
+ delete m_view;
+ delete m_page;
+ delete m_profile;
+ delete m_server;
+}
+
+void tst_QWebEngineDownloadRequest::saveLink(QPoint linkPos)
+{
+ // Simulate right-clicking on link and choosing "save link as" from menu.
+ QSignalSpy menuSpy(m_view, &QWebEngineView::customContextMenuRequested);
+ m_view->setContextMenuPolicy(Qt::CustomContextMenu);
+ auto event1 =
+ new QContextMenuEvent(QContextMenuEvent::Mouse, linkPos, m_view->mapToGlobal(linkPos));
+ auto event2 = new QMouseEvent(QEvent::MouseButtonPress, linkPos, m_view->mapToGlobal(linkPos),
+ Qt::RightButton, {}, {});
+ auto event3 = new QMouseEvent(QEvent::MouseButtonRelease, linkPos, m_view->mapToGlobal(linkPos),
+ Qt::RightButton, {}, {});
+ QTRY_VERIFY(m_view->focusWidget());
+ QWidget *renderWidget = m_view->focusWidget();
+ QCoreApplication::postEvent(renderWidget, event1);
+ QCoreApplication::postEvent(renderWidget, event2);
+ QCoreApplication::postEvent(renderWidget, event3);
+ QTRY_COMPARE(menuSpy.size(), 1);
+ m_page->triggerAction(QWebEnginePage::DownloadLinkToDisk);
+}
+
+void tst_QWebEngineDownloadRequest::clickLink(QPoint linkPos)
+{
+ // Simulate left-clicking on link.
+ QTRY_VERIFY(m_view->focusWidget());
+ QWidget *renderWidget = m_view->focusWidget();
+ QTest::mouseClick(renderWidget, Qt::LeftButton, {}, linkPos);
+}
+
+void tst_QWebEngineDownloadRequest::simulateUserAction(QPoint linkPos, UserAction action)
+{
+ switch (action) {
+ case SaveLink: return saveLink(linkPos);
+ case ClickLink: return clickLink(linkPos);
+ }
+}
+
+void tst_QWebEngineDownloadRequest::downloadLink_data()
+{
+ QTest::addColumn<UserAction>("userAction");
+ QTest::addColumn<bool>("anchorHasDownloadAttribute");
+ QTest::addColumn<QByteArray>("fileName");
+ QTest::addColumn<QByteArray>("fileContents");
+ QTest::addColumn<QByteArray>("fileMimeTypeDeclared");
+ QTest::addColumn<QByteArray>("fileMimeTypeDetected");
+ QTest::addColumn<QByteArray>("fileDisposition");
+ QTest::addColumn<bool>("fileHasReferer");
+ QTest::addColumn<FileAction>("fileAction");
+
+ // SaveLink should always trigger a download, even for empty files.
+ QTest::newRow("save link to empty file")
+ /* userAction */ << SaveLink
+ /* anchorHasDownloadAttribute */ << false
+ /* fileName */ << QByteArrayLiteral("foo.txt")
+ /* fileContents */ << QByteArrayLiteral("")
+ /* fileMimeTypeDeclared */ << QByteArrayLiteral("text/plain")
+ /* fileMimeTypeDetected */ << QByteArrayLiteral("text/plain")
+ /* fileDisposition */ << QByteArrayLiteral("")
+ /* fileHasReferer */ << true
+ /* fileAction */ << FileIsDownloaded;
+
+ // SaveLink should always trigger a download, also for text files.
+ QTest::newRow("save link to text file")
+ /* userAction */ << SaveLink
+ /* anchorHasDownloadAttribute */ << false
+ /* fileName */ << QByteArrayLiteral("foo.txt")
+ /* fileContents */ << QByteArrayLiteral("bar")
+ /* fileMimeTypeDeclared */ << QByteArrayLiteral("text/plain")
+ /* fileMimeTypeDetected */ << QByteArrayLiteral("text/plain")
+ /* fileDisposition */ << QByteArrayLiteral("")
+ /* fileHasReferer */ << true
+ /* fileAction */ << FileIsDownloaded;
+
+ // ... adding the "download" attribute should have no effect.
+ QTest::newRow("save link to text file (attribute)")
+ /* userAction */ << SaveLink
+ /* anchorHasDownloadAttribute */ << true
+ /* fileName */ << QByteArrayLiteral("foo.txt")
+ /* fileContents */ << QByteArrayLiteral("bar")
+ /* fileMimeTypeDeclared */ << QByteArrayLiteral("text/plain")
+ /* fileMimeTypeDetected */ << QByteArrayLiteral("text/plain")
+ /* fileDisposition */ << QByteArrayLiteral("")
+ /* fileHasReferer */ << true
+ /* fileAction */ << FileIsDownloaded;
+
+ // ... adding the "attachment" content disposition should also have no effect.
+ QTest::newRow("save link to text file (attachment)")
+ /* userAction */ << SaveLink
+ /* anchorHasDownloadAttribute */ << false
+ /* fileName */ << QByteArrayLiteral("foo.txt")
+ /* fileContents */ << QByteArrayLiteral("bar")
+ /* fileMimeTypeDeclared */ << QByteArrayLiteral("text/plain")
+ /* fileMimeTypeDetected */ << QByteArrayLiteral("text/plain")
+ /* fileDisposition */ << QByteArrayLiteral("attachment")
+ /* fileHasReferer */ << true
+ /* fileAction */ << FileIsDownloaded;
+
+ // ... even adding both should have no effect.
+ QTest::newRow("save link to text file (attribute+attachment)")
+ /* userAction */ << SaveLink
+ /* anchorHasDownloadAttribute */ << true
+ /* fileName */ << QByteArrayLiteral("foo.txt")
+ /* fileContents */ << QByteArrayLiteral("bar")
+ /* fileMimeTypeDeclared */ << QByteArrayLiteral("text/plain")
+ /* fileMimeTypeDetected */ << QByteArrayLiteral("text/plain")
+ /* fileDisposition */ << QByteArrayLiteral("attachment")
+ /* fileHasReferer */ << true
+ /* fileAction */ << FileIsDownloaded;
+
+ // Navigating to an empty file should show an empty page.
+ QTest::newRow("navigate to empty file")
+ /* userAction */ << ClickLink
+ /* anchorHasDownloadAttribute */ << false
+ /* fileName */ << QByteArrayLiteral("foo.txt")
+ /* fileContents */ << QByteArrayLiteral("")
+ /* fileMimeTypeDeclared */ << QByteArrayLiteral("")
+ /* fileMimeTypeDetected */ << QByteArrayLiteral("")
+ /* fileDisposition */ << QByteArrayLiteral("")
+ /* fileHasReferer */ << true
+ /* fileAction */ << FileIsDisplayed;
+
+ // Navigating to a text file should show the text file.
+ QTest::newRow("navigate to text file")
+ /* userAction */ << ClickLink
+ /* anchorHasDownloadAttribute */ << false
+ /* fileName */ << QByteArrayLiteral("foo.txt")
+ /* fileContents */ << QByteArrayLiteral("bar")
+ /* fileMimeTypeDeclared */ << QByteArrayLiteral("text/plain")
+ /* fileMimeTypeDetected */ << QByteArrayLiteral("text/plain")
+ /* fileDisposition */ << QByteArrayLiteral("")
+ /* fileHasReferer */ << true
+ /* fileAction */ << FileIsDisplayed;
+
+ // ... unless the link has the "download" attribute: then the file should be downloaded.
+ QTest::newRow("navigate to text file (attribute)")
+ /* userAction */ << ClickLink
+ /* anchorHasDownloadAttribute */ << true
+ /* fileName */ << QByteArrayLiteral("foo.txt")
+ /* fileContents */ << QByteArrayLiteral("bar")
+ /* fileMimeTypeDeclared */ << QByteArrayLiteral("text/plain")
+ /* fileMimeTypeDetected */ << QByteArrayLiteral("text/plain")
+ /* fileDisposition */ << QByteArrayLiteral("")
+ /* fileHasReferer */ << true
+ /* fileAction */ << FileIsDownloaded;
+
+ // ... same with the content disposition header save for the download type.
+ QTest::newRow("navigate to text file (attachment)")
+ /* userAction */ << ClickLink
+ /* anchorHasDownloadAttribute */ << false
+ /* fileName */ << QByteArrayLiteral("foo.txt")
+ /* fileContents */ << QByteArrayLiteral("bar")
+ /* fileMimeTypeDeclared */ << QByteArrayLiteral("text/plain")
+ /* fileMimeTypeDetected */ << QByteArrayLiteral("text/plain")
+ /* fileDisposition */ << QByteArrayLiteral("attachment")
+ /* fileHasReferer */ << true
+ /* fileAction */ << FileIsDownloaded;
+
+ // ... and both.
+ QTest::newRow("navigate to text file (attribute+attachment)")
+ /* userAction */ << ClickLink
+ /* anchorHasDownloadAttribute */ << true
+ /* fileName */ << QByteArrayLiteral("foo.txt")
+ /* fileContents */ << QByteArrayLiteral("bar")
+ /* fileMimeTypeDeclared */ << QByteArrayLiteral("text/plain")
+ /* fileMimeTypeDetected */ << QByteArrayLiteral("text/plain")
+ /* fileDisposition */ << QByteArrayLiteral("attachment")
+ /* fileHasReferer */ << true
+ /* fileAction */ << FileIsDownloaded;
+
+ // The file's extension has no effect.
+ QTest::newRow("navigate to supposed zip file")
+ /* userAction */ << ClickLink
+ /* anchorHasDownloadAttribute */ << false
+ /* fileName */ << QByteArrayLiteral("foo.zip")
+ /* fileContents */ << QByteArrayLiteral("bar")
+ /* fileMimeTypeDeclared */ << QByteArrayLiteral("")
+ /* fileMimeTypeDetected */ << QByteArrayLiteral("")
+ /* fileDisposition */ << QByteArrayLiteral("")
+ /* fileHasReferer */ << true
+ /* fileAction */ << FileIsDisplayed;
+
+ // ... the file's mime type however does.
+ QTest::newRow("navigate to supposed zip file (application/zip)")
+ /* userAction */ << ClickLink
+ /* anchorHasDownloadAttribute */ << false
+ /* fileName */ << QByteArrayLiteral("foo.zip")
+ /* fileContents */ << QByteArrayLiteral("bar")
+ /* fileMimeTypeDeclared */ << QByteArrayLiteral("application/zip")
+ /* fileMimeTypeDetected */ << QByteArrayLiteral("application/zip")
+ /* fileDisposition */ << QByteArrayLiteral("")
+ /* fileHasReferer */ << true
+ /* fileAction */ << FileIsDownloaded;
+
+ // ... but we're not very picky about the exact type.
+ QTest::newRow("navigate to supposed zip file (application/octet-stream)")
+ /* userAction */ << ClickLink
+ /* anchorHasDownloadAttribute */ << false
+ /* fileName */ << QByteArrayLiteral("foo.zip")
+ /* fileContents */ << QByteArrayLiteral("bar")
+ /* fileMimeTypeDeclared */ << QByteArrayLiteral("application/octet-stream")
+ /* fileMimeTypeDetected */ << QByteArrayLiteral("application/octet-stream")
+ /* fileDisposition */ << QByteArrayLiteral("")
+ /* fileHasReferer */ << true
+ /* fileAction */ << FileIsDownloaded;
+
+ // empty zip file (consisting only of "end of central directory record")
+ QByteArray zipFile = QByteArrayLiteral("PK\x05\x06") + QByteArray(18, 0);
+
+ // The mime type is guessed automatically if not provided by the server.
+ QTest::newRow("navigate to actual zip file")
+ /* userAction */ << ClickLink
+ /* anchorHasDownloadAttribute */ << false
+ /* fileName */ << QByteArrayLiteral("foo.zip")
+ /* fileContents */ << zipFile
+ /* fileMimeTypeDeclared */ << QByteArrayLiteral("")
+ /* fileMimeTypeDetected */ << QByteArrayLiteral("application/octet-stream")
+ /* fileDisposition */ << QByteArrayLiteral("")
+ /* fileHasReferer */ << true
+ /* fileAction */ << FileIsDownloaded;
+
+ // The mime type is not guessed automatically if provided by the server.
+ QTest::newRow("navigate to actual zip file (application/zip)")
+ /* userAction */ << ClickLink
+ /* anchorHasDownloadAttribute */ << false
+ /* fileName */ << QByteArrayLiteral("foo.zip")
+ /* fileContents */ << zipFile
+ /* fileMimeTypeDeclared */ << QByteArrayLiteral("application/zip")
+ /* fileMimeTypeDetected */ << QByteArrayLiteral("application/zip")
+ /* fileDisposition */ << QByteArrayLiteral("")
+ /* fileHasReferer */ << true
+ /* fileAction */ << FileIsDownloaded;
+}
+
+void tst_QWebEngineDownloadRequest::downloadLink()
+{
+ QFETCH(UserAction, userAction);
+ QFETCH(bool, anchorHasDownloadAttribute);
+ QFETCH(QByteArray, fileName);
+ QFETCH(QByteArray, fileContents);
+ QFETCH(QByteArray, fileMimeTypeDeclared);
+ QFETCH(QByteArray, fileMimeTypeDetected);
+ QFETCH(QByteArray, fileDisposition);
+ QFETCH(bool, fileHasReferer);
+ QFETCH(FileAction, fileAction);
+
+ // Set up HTTP server
+ int indexRequestCount = 0;
+ int fileRequestCount = 0;
+ QByteArray fileRequestReferer;
+ ScopedConnection sc1 = connect(m_server, &HttpServer::newRequest, [&](HttpReqRep *rr) {
+ if (rr->requestMethod() == "GET" && rr->requestPath() == "/") {
+ indexRequestCount++;
+
+ rr->setResponseHeader(QByteArrayLiteral("content-type"), QByteArrayLiteral("text/html"));
+ QByteArray html;
+ html += QByteArrayLiteral("<html><body><a href=\"");
+ html += fileName;
+ html += QByteArrayLiteral("\" ");
+ if (anchorHasDownloadAttribute)
+ html += QByteArrayLiteral("download");
+ html += QByteArrayLiteral(">Link</a></body></html>");
+ rr->setResponseBody(html);
+ rr->sendResponse();
+ } else if (rr->requestMethod() == "GET" && rr->requestPath() == "/" + fileName) {
+ fileRequestCount++;
+ fileRequestReferer = rr->requestHeader(QByteArrayLiteral("referer"));
+
+ if (!fileDisposition.isEmpty())
+ rr->setResponseHeader(QByteArrayLiteral("content-disposition"), fileDisposition);
+ if (!fileMimeTypeDeclared.isEmpty())
+ rr->setResponseHeader(QByteArrayLiteral("content-type"), fileMimeTypeDeclared);
+ rr->setResponseBody(fileContents);
+ rr->sendResponse();
+ } else {
+ rr->sendResponse(404);
+ }
+ });
+
+ // Set up profile and download handler
+ QTemporaryDir tmpDir;
+ QVERIFY(tmpDir.isValid());
+ QByteArray slashFileName = QByteArrayLiteral("/") + fileName;
+ QString suggestedPath =
+ QStandardPaths::writableLocation(QStandardPaths::DownloadLocation) + slashFileName;
+ QString downloadDirectory = tmpDir.path();
+ QString downloadFileName = fileName;
+ QString downloadPath = tmpDir.path() + slashFileName;
+ QUrl downloadUrl = m_server->url(slashFileName);
+ int acceptedCount = 0;
+ int finishedCount = 0;
+ ScopedConnection sc2 = connect(m_profile, &QWebEngineProfile::downloadRequested, [&](QWebEngineDownloadRequest *item) {
+ QCOMPARE(item->state(), QWebEngineDownloadRequest::DownloadRequested);
+ QCOMPARE(item->isFinished(), false);
+ QCOMPARE(item->totalBytes(), fileContents.size());
+ QCOMPARE(item->receivedBytes(), 0);
+ QCOMPARE(item->interruptReason(), QWebEngineDownloadRequest::NoReason);
+ QCOMPARE(item->isSavePageDownload(), false);
+ QCOMPARE(item->mimeType(), QString(fileMimeTypeDetected));
+ QCOMPARE(QDir(item->downloadDirectory()).filePath(item->downloadFileName()), suggestedPath);
+ QCOMPARE(item->savePageFormat(), QWebEngineDownloadRequest::UnknownSaveFormat);
+ QCOMPARE(item->url(), downloadUrl);
+ QCOMPARE(item->page(), m_page);
+
+ connect(item, &QWebEngineDownloadRequest::isFinishedChanged, [&, item]() {
+ QCOMPARE(item->state(), QWebEngineDownloadRequest::DownloadCompleted);
+ QCOMPARE(item->isFinished(), true);
+ QCOMPARE(item->totalBytes(), fileContents.size());
+ QCOMPARE(item->receivedBytes(), fileContents.size());
+ QCOMPARE(item->interruptReason(), QWebEngineDownloadRequest::NoReason);
+ QCOMPARE(item->isSavePageDownload(), false);
+ QCOMPARE(item->mimeType(), QString(fileMimeTypeDetected));
+ QCOMPARE(QDir(item->downloadDirectory()).filePath(item->downloadFileName()), downloadPath);
+ QCOMPARE(item->savePageFormat(), QWebEngineDownloadRequest::UnknownSaveFormat);
+ QCOMPARE(item->url(), downloadUrl);
+ QCOMPARE(item->page(), m_page);
+
+ finishedCount++;
+ });
+ item->setDownloadDirectory(downloadDirectory);
+ item->setDownloadFileName(downloadFileName);
+ item->accept();
+
+ acceptedCount++;
+ });
+
+ // Load an HTML page with a link
+ //
+ // The only variation being whether the <a> element has a "download"
+ // attribute or not.
+ QSignalSpy loadSpy(m_page, &QWebEnginePage::loadFinished);
+ m_view->load(m_server->url());
+ QTRY_COMPARE(loadSpy.size(), 1);
+ QCOMPARE(loadSpy.takeFirst().value(0).toBool(), true);
+ QCOMPARE(indexRequestCount, 1);
+
+ simulateUserAction(QPoint(10, 10), userAction);
+
+ // If file is expected to be displayed and not downloaded then end test
+ if (fileAction == FileIsDisplayed) {
+ QTRY_COMPARE(loadSpy.size(), 1);
+ QCOMPARE(loadSpy.takeFirst().value(0).toBool(), true);
+ QCOMPARE(acceptedCount, 0);
+ return;
+ }
+
+ // Otherwise file is downloaded
+ QTRY_COMPARE(acceptedCount, 1);
+ QTRY_COMPARE(finishedCount, 1);
+ QCOMPARE(fileRequestCount, 1);
+ if (fileHasReferer)
+ QCOMPARE(fileRequestReferer, m_server->url().toEncoded());
+ else
+ QCOMPARE(fileRequestReferer, QByteArray());
+ QFile file(downloadPath);
+ QVERIFY(file.open(QIODevice::ReadOnly));
+ QCOMPARE(file.readAll(), fileContents);
+}
+
+void tst_QWebEngineDownloadRequest::downloadTwoLinks_data()
+{
+ QTest::addColumn<UserAction>("action1");
+ QTest::addColumn<UserAction>("action2");
+ QTest::newRow("Save+Save") << SaveLink << SaveLink;
+ QTest::newRow("Save+Click") << SaveLink << ClickLink;
+ QTest::newRow("Click+Save") << ClickLink << SaveLink;
+ QTest::newRow("Click+Click") << ClickLink << ClickLink;
+}
+
+void tst_QWebEngineDownloadRequest::downloadTwoLinks()
+{
+ QFETCH(UserAction, action1);
+ QFETCH(UserAction, action2);
+
+ // Set up HTTP server
+ int file1RequestCount = 0;
+ int file2RequestCount = 0;
+ ScopedConnection sc1 = connect(m_server, &HttpServer::newRequest, [&](HttpReqRep *rr) {
+ if (rr->requestMethod() == "GET" && rr->requestPath() == "/") {
+ rr->setResponseHeader(QByteArrayLiteral("content-type"), QByteArrayLiteral("text/html"));
+ rr->setResponseBody(QByteArrayLiteral("<html><body><a href=\"file1\" download>Link1</a><br/><a href=\"file2\">Link2</a></body></html>"));
+ rr->sendResponse();
+ } else if (rr->requestMethod() == "GET" && rr->requestPath() == "/file1") {
+ file1RequestCount++;
+ rr->setResponseHeader(QByteArrayLiteral("content-type"), QByteArrayLiteral("text/plain"));
+ rr->setResponseBody(QByteArrayLiteral("file1"));
+ rr->sendResponse();
+ } else if (rr->requestMethod() == "GET" && rr->requestPath() == "/file2") {
+ file2RequestCount++;
+ rr->setResponseHeader(QByteArrayLiteral("content-type"), QByteArrayLiteral("text/plain"));
+ rr->setResponseHeader(QByteArrayLiteral("content-disposition"), QByteArrayLiteral("attachment"));
+ rr->setResponseBody(QByteArrayLiteral("file2"));
+ rr->sendResponse();
+ }
+ });
+
+ // Set up profile and download handler
+ QTemporaryDir tmpDir;
+ QVERIFY(tmpDir.isValid());
+ QString standardDir = QStandardPaths::writableLocation(QStandardPaths::DownloadLocation);
+ int acceptedCount = 0;
+ int finishedCount = 0;
+ ScopedConnection sc2 = connect(m_profile, &QWebEngineProfile::downloadRequested, [&](QWebEngineDownloadRequest *item) {
+ QCOMPARE(item->state(), QWebEngineDownloadRequest::DownloadRequested);
+ QCOMPARE(item->isFinished(), false);
+ QCOMPARE(item->totalBytes(), 5); // strlen("fileN")
+ QCOMPARE(item->receivedBytes(), 0);
+ QCOMPARE(item->interruptReason(), QWebEngineDownloadRequest::NoReason);
+ QCOMPARE(item->savePageFormat(), QWebEngineDownloadRequest::UnknownSaveFormat);
+ QCOMPARE(item->mimeType(), QStringLiteral("text/plain"));
+ QString filePart = QChar('/') + item->url().fileName();
+ QString fileName = item->url().fileName();
+ QCOMPARE(QDir(item->downloadDirectory()).filePath(item->downloadFileName()), standardDir + filePart);
+
+ // type() is broken due to race condition in DownloadManagerDelegateQt
+ if (action1 == ClickLink && action2 == ClickLink && filePart != QStringLiteral("/file1") && filePart != QStringLiteral("/file2"))
+ QFAIL(qPrintable("Unexpected file name: " + filePart));
+
+ connect(item, &QWebEngineDownloadRequest::isFinishedChanged, [&]() {
+ finishedCount++;
+ });
+ item->setDownloadDirectory(tmpDir.path());
+ item->setDownloadFileName(fileName);
+ item->accept();
+
+ acceptedCount++;
+ });
+
+ QSignalSpy loadSpy(m_page, &QWebEnginePage::loadFinished);
+ m_view->load(m_server->url());
+ QTRY_COMPARE(loadSpy.size(), 1);
+ QCOMPARE(loadSpy.takeFirst().value(0).toBool(), true);
+
+ // Trigger downloads
+ simulateUserAction(QPoint(10, 10), action1);
+ simulateUserAction(QPoint(10, 30), action2);
+
+ // Wait for downloads
+ QTRY_COMPARE(file1RequestCount, 1);
+ QTRY_COMPARE(file2RequestCount, 1);
+ QTRY_COMPARE(acceptedCount, 2);
+ QTRY_COMPARE(finishedCount, 2);
+}
+
+void tst_QWebEngineDownloadRequest::downloadPage_data()
+{
+ QTest::addColumn<bool>("saveWithPageAction");
+ QTest::addColumn<QWebEngineDownloadRequest::SavePageFormat>("savePageFormat");
+ QTest::newRow("SingleHtmlSaveFormat") << false << QWebEngineDownloadRequest::SingleHtmlSaveFormat;
+ QTest::newRow("CompleteHtmlSaveFormat") << false << QWebEngineDownloadRequest::CompleteHtmlSaveFormat;
+ QTest::newRow("MimeHtmlSaveFormat") << false << QWebEngineDownloadRequest::MimeHtmlSaveFormat;
+ QTest::newRow("SavePageAction") << true << QWebEngineDownloadRequest::MimeHtmlSaveFormat;
+}
+
+void tst_QWebEngineDownloadRequest::downloadPage()
+{
+ QFETCH(bool, saveWithPageAction);
+ QFETCH(QWebEngineDownloadRequest::SavePageFormat, savePageFormat);
+
+ // Set up HTTP server
+ int indexRequestCount = 0;
+ ScopedConnection sc1 = connect(m_server, &HttpServer::newRequest, [&](HttpReqRep *rr) {
+ if (rr->requestMethod() == "GET" && rr->requestPath() == "/") {
+ indexRequestCount++;
+ rr->setResponseHeader(QByteArrayLiteral("content-type"), QByteArrayLiteral("text/html"));
+ rr->setResponseBody(QByteArrayLiteral("<html><body>Hello</body></html>"));
+ rr->sendResponse();
+ }
+ });
+
+ // Set up profile and download handler
+ QTemporaryDir tmpDir;
+ QVERIFY(tmpDir.isValid());
+ QString downloadFileName("test.html"), downloadPath = tmpDir.filePath(downloadFileName);
+ QUrl downloadUrl = m_server->url("/");
+ int acceptedCount = 0;
+ int finishedCount = 0;
+ ScopedConnection sc2 = connect(m_profile, &QWebEngineProfile::downloadRequested, [&](QWebEngineDownloadRequest *item) {
+ QCOMPARE(item->state(), saveWithPageAction ? QWebEngineDownloadRequest::DownloadRequested : QWebEngineDownloadRequest::DownloadInProgress);
+ QCOMPARE(item->isFinished(), false);
+ QCOMPARE(item->totalBytes(), -1);
+ QCOMPARE(item->receivedBytes(), 0);
+ QCOMPARE(item->interruptReason(), QWebEngineDownloadRequest::NoReason);
+ QCOMPARE(item->isSavePageDownload(), true);
+ // FIXME(juvaldma): why is mimeType always the same?
+ QCOMPARE(item->mimeType(), QStringLiteral("application/x-mimearchive"));
+ QCOMPARE(item->savePageFormat(), savePageFormat);
+ QCOMPARE(item->url(), downloadUrl);
+ QCOMPARE(item->page(), m_page);
+
+ if (saveWithPageAction) {
+ QVERIFY(!item->downloadDirectory().isEmpty());
+ QVERIFY(!item->downloadFileName().isEmpty());
+ item->setDownloadDirectory(tmpDir.path());
+ item->setDownloadFileName(downloadFileName);
+ item->accept();
+ } // save with explicit path accepts download automatically
+
+ QCOMPARE(QDir(item->downloadDirectory()).filePath(item->downloadFileName()), downloadPath);
+
+ connect(item, &QWebEngineDownloadRequest::isFinishedChanged, [&, item]() {
+ QCOMPARE(item->state(), QWebEngineDownloadRequest::DownloadCompleted);
+ QCOMPARE(item->isFinished(), true);
+ QCOMPARE(item->totalBytes(), item->receivedBytes());
+ QVERIFY(item->receivedBytes() > 0);
+ QCOMPARE(item->interruptReason(), QWebEngineDownloadRequest::NoReason);
+ QCOMPARE(item->isSavePageDownload(), true);
+ QCOMPARE(item->mimeType(), QStringLiteral("application/x-mimearchive"));
+ QCOMPARE(QDir(item->downloadDirectory()).filePath(item->downloadFileName()), downloadPath);
+ QCOMPARE(item->savePageFormat(), savePageFormat);
+ QCOMPARE(item->url(), downloadUrl);
+ QCOMPARE(item->page(), m_page);
+
+ finishedCount++;
+ });
+
+ acceptedCount++;
+ });
+
+ // Load some HTML
+ QSignalSpy loadSpy(m_page, &QWebEnginePage::loadFinished);
+ m_page->load(m_server->url());
+ QTRY_COMPARE(loadSpy.size(), 1);
+ QCOMPARE(loadSpy.takeFirst().value(0).toBool(), true);
+ QCOMPARE(indexRequestCount, 1);
+
+ // Save some HTML
+ if (saveWithPageAction)
+ m_page->triggerAction(QWebEnginePage::SavePage);
+ else
+ m_page->save(downloadPath, savePageFormat);
+
+ QTRY_COMPARE(acceptedCount, 1);
+ QTRY_COMPARE(finishedCount, 1);
+ QFile file(downloadPath);
+ QVERIFY(file.exists());
+}
+
+void tst_QWebEngineDownloadRequest::downloadViaSetUrl()
+{
+ // Reproduce the scenario described in QTBUG-63388 by triggering downloads
+ // of the same file multiple times via QWebEnginePage::setUrl
+
+ // Set up HTTP server
+ ScopedConnection sc1 = connect(m_server, &HttpServer::newRequest, [&](HttpReqRep *rr) {
+ if (rr->requestMethod() == "GET" && rr->requestPath() == "/") {
+ rr->setResponseHeader(QByteArrayLiteral("content-type"), QByteArrayLiteral("text/html"));
+ rr->setResponseBody(QByteArrayLiteral("<html><body>Hello</body></html>"));
+ rr->sendResponse();
+ } else if (rr->requestMethod() == "GET" && rr->requestPath() == "/file") {
+ rr->setResponseHeader(QByteArrayLiteral("content-disposition"), QByteArrayLiteral("attachment"));
+ rr->setResponseBody(QByteArrayLiteral("redacted"));
+ rr->sendResponse();
+ }
+ });
+
+ // Set up profile and download handler
+ QList<QUrl> downloadUrls;
+ ScopedConnection sc2 = connect(m_profile, &QWebEngineProfile::downloadRequested, [&](QWebEngineDownloadRequest *item) {
+ downloadUrls.append(item->url());
+ });
+
+ // Set up the test scenario by trying to load some unrelated HTML.
+ QSignalSpy loadSpy(m_page, &QWebEnginePage::loadFinished);
+ QSignalSpy urlSpy(m_page, &QWebEnginePage::urlChanged);
+ const QUrl indexUrl = m_server->url();
+ m_page->setUrl(indexUrl);
+ QTRY_COMPARE(loadSpy.size(), 1);
+ QTRY_COMPARE(urlSpy.size(), 1);
+ QCOMPARE(loadSpy.takeFirst().value(0).toBool(), true);
+ QCOMPARE(urlSpy.takeFirst().value(0).toUrl(), indexUrl);
+
+ // Download files via setUrl. With QTBUG-63388 after the first iteration the
+ // downloads would be triggered for indexUrl and not fileUrl.
+ const QUrl fileUrl = m_server->url(QByteArrayLiteral("/file"));
+ for (int i = 0; i != 3; ++i) {
+ m_page->setUrl(fileUrl);
+ QCOMPARE(m_page->url(), fileUrl);
+ QTRY_COMPARE(loadSpy.size(), 1);
+ QTRY_COMPARE(urlSpy.size(), 2);
+ QTRY_COMPARE(downloadUrls.size(), 1);
+ QCOMPARE(loadSpy.takeFirst().value(0).toBool(), false);
+ QCOMPARE(urlSpy.takeFirst().value(0).toUrl(), fileUrl);
+ QCOMPARE(urlSpy.takeFirst().value(0).toUrl(), indexUrl);
+ QCOMPARE(downloadUrls.takeFirst(), fileUrl);
+ QCOMPARE(m_page->url(), indexUrl);
+ }
+}
+
+void tst_QWebEngineDownloadRequest::downloadFileNot1()
+{
+ // Trigger file download via download() but don't accept().
+
+ ScopedConnection sc1 = connect(m_server, &HttpServer::newRequest, [&](HttpReqRep *rr) {
+ rr->sendResponse(404);
+ });
+
+ QPointer<QWebEngineDownloadRequest> downloadItem;
+ int downloadCount = 0;
+ ScopedConnection sc2 = connect(m_profile, &QWebEngineProfile::downloadRequested, [&](QWebEngineDownloadRequest *item) {
+ QVERIFY(item);
+ QCOMPARE(item->state(), QWebEngineDownloadRequest::DownloadRequested);
+ downloadItem = item;
+ downloadCount++;
+ });
+
+ m_page->download(m_server->url(QByteArrayLiteral("/file")));
+ QTRY_COMPARE(downloadCount, 1);
+ QVERIFY(!downloadItem);
+}
+
+void tst_QWebEngineDownloadRequest::downloadFileNot2()
+{
+ // Trigger file download via download() but call cancel() instead of accept().
+
+ ScopedConnection sc1 = connect(m_server, &HttpServer::newRequest, [&](HttpReqRep *rr) {
+ rr->sendResponse(404);
+ });
+
+ QPointer<QWebEngineDownloadRequest> downloadItem;
+ int downloadCount = 0;
+ ScopedConnection sc2 = connect(m_profile, &QWebEngineProfile::downloadRequested, [&](QWebEngineDownloadRequest *item) {
+ QVERIFY(item);
+ QCOMPARE(item->state(), QWebEngineDownloadRequest::DownloadRequested);
+ item->cancel();
+ downloadItem = item;
+ downloadCount++;
+ });
+
+ m_page->download(m_server->url(QByteArrayLiteral("/file")));
+ QTRY_COMPARE(downloadCount, 1);
+ QVERIFY(downloadItem);
+ QCOMPARE(downloadItem->state(), QWebEngineDownloadRequest::DownloadCancelled);
+}
+
+void tst_QWebEngineDownloadRequest::downloadDeleted()
+{
+ QPointer<QWebEngineDownloadRequest> downloadItem;
+ int downloadCount = 0, finishedCount = 0;
+
+ ScopedConnection sc2 = connect(m_profile, &QWebEngineProfile::downloadRequested, [&](QWebEngineDownloadRequest *item) {
+ QVERIFY(item);
+ QCOMPARE(item->state(), QWebEngineDownloadRequest::DownloadRequested);
+ downloadItem = item;
+ connect(downloadItem, &QWebEngineDownloadRequest::isFinishedChanged, [&]() { ++finishedCount; });
+ ++downloadCount;
+ // accept and schedule deletion, and check if it still finishes
+ item->accept();
+ item->deleteLater();
+ QVERIFY(downloadItem);
+ });
+
+ m_page->download(m_server->url(QByteArrayLiteral("/file")));
+ QTRY_COMPARE(downloadCount, 1);
+ QTRY_COMPARE(finishedCount, 1);
+ QTRY_VERIFY(!downloadItem);
+ QCOMPARE(downloadCount, 1);
+ QCOMPARE(finishedCount, 1);
+}
+
+void tst_QWebEngineDownloadRequest::downloadDeletedByProfile()
+{
+ QPointer<QWebEngineProfile> profile(new QWebEngineProfile);
+ profile->setHttpCacheType(QWebEngineProfile::NoCache);
+ profile->settings()->setAttribute(QWebEngineSettings::AutoLoadIconsForPage, false);
+
+ bool downloadFinished = false;
+ QPointer<QWebEngineDownloadRequest> downloadItem;
+ connect(profile, &QWebEngineProfile::downloadRequested, [&] (QWebEngineDownloadRequest *item) {
+ connect(item, &QWebEngineDownloadRequest::isFinishedChanged, [&] () {
+ downloadFinished = true;
+ });
+ downloadItem = item;
+ item->accept();
+ });
+
+ QPointer<QWebEnginePage> page(new QWebEnginePage(profile));
+ page->download(m_server->url(QByteArrayLiteral("/file")));
+
+ QTRY_COMPARE(downloadItem.isNull(), false);
+ QVERIFY(downloadItem);
+
+ page->deleteLater();
+ profile->deleteLater();
+
+ QTRY_COMPARE(downloadFinished, true);
+ QTRY_COMPARE(downloadItem.isNull(), true);
+}
+
+void tst_QWebEngineDownloadRequest::downloadUniqueFilename_data()
+{
+ QTest::addColumn<QString>("baseName");
+ QTest::addColumn<QString>("extension");
+
+ QTest::newRow("txt") << QString("test(1.test)") << QString("txt");
+ QTest::newRow("tar.gz") << QString("test(1.test)") << QString("tar.gz");
+}
+
+void tst_QWebEngineDownloadRequest::downloadUniqueFilename()
+{
+ QFETCH(QString, baseName);
+ QFETCH(QString, extension);
+ QString fileName = QString("%1.%2").arg(baseName).arg(extension);
+ QString downloadedFilePath;
+ QString suggestedFileName;
+ bool downloadFinished = false;
+
+ QTemporaryDir tmpDir;
+ QVERIFY(tmpDir.isValid());
+ m_profile->setDownloadPath(tmpDir.path());
+
+ // Set up HTTP server
+ ScopedConnection sc1 = connect(m_server, &HttpServer::newRequest, [&](HttpReqRep *rr) {
+ auto requestPath = QString::fromUtf8(rr->requestPath());
+ if (rr->requestMethod() == "GET" && requestPath == ("/" + fileName)) {
+ rr->setResponseHeader(QByteArrayLiteral("content-type"), QByteArrayLiteral("application/octet-stream"));
+ rr->setResponseHeader(QByteArrayLiteral("content-disposition"), QByteArrayLiteral("attachment"));
+ rr->setResponseBody(QByteArrayLiteral("a"));
+ rr->sendResponse();
+ } else {
+ rr->sendResponse(404);
+ }
+ });
+
+ // Set up profile and download handler
+ ScopedConnection sc2 = connect(m_profile, &QWebEngineProfile::downloadRequested, [&](QWebEngineDownloadRequest *item) {
+ suggestedFileName = item->suggestedFileName();
+ item->accept();
+ connect(item, &QWebEngineDownloadRequest::isFinishedChanged, [&, item]() {
+ QCOMPARE(item->state(), QWebEngineDownloadRequest::DownloadCompleted);
+ QCOMPARE(item->isFinished(), true);
+ QCOMPARE(item->totalBytes(), item->receivedBytes());
+ QVERIFY(item->receivedBytes() > 0);
+ QCOMPARE(item->interruptReason(), QWebEngineDownloadRequest::NoReason);
+ QCOMPARE(item->isSavePageDownload(), false);
+ downloadedFilePath = QDir(item->downloadDirectory()).filePath(item->downloadFileName());
+ downloadFinished = true;
+ });
+ });
+
+ m_page->setUrl(m_server->url("/" + fileName));
+ QTRY_VERIFY(downloadFinished);
+ QVERIFY(QFile(downloadedFilePath).exists());
+ QCOMPARE(downloadedFilePath, m_profile->downloadPath() + "/" + baseName + "." + extension);
+
+ for (int i = 1; i <= 2; ++i) {
+ downloadFinished = false;
+ m_page->setUrl(m_server->url("/" + fileName));
+ QTRY_VERIFY(downloadFinished);
+ QVERIFY(QFile(downloadedFilePath).exists());
+ QCOMPARE(downloadedFilePath, m_profile->downloadPath() + "/" + baseName + " (" + QString::number(i) + ")." + extension);
+ QCOMPARE(suggestedFileName, fileName);
+ }
+}
+
+void tst_QWebEngineDownloadRequest::downloadUniqueFilenameWithTimestamp()
+{
+ // Set up HTTP server
+ QString baseName("test(1.test)");
+ QString extension("txt");
+ QString fileName = QString("%1.%2").arg(baseName).arg(extension);
+ QString downloadedFilePath;
+ QString suggestedFileName;
+ bool downloadFinished = false;
+
+ QTemporaryDir tmpDir;
+ QVERIFY(tmpDir.isValid());
+ m_profile->setDownloadPath(tmpDir.path());
+
+ ScopedConnection sc1 = connect(m_server, &HttpServer::newRequest, [&](HttpReqRep *rr) {
+ auto requestPath = QString::fromUtf8(rr->requestPath());
+ if (rr->requestMethod() == "GET" && requestPath == ("/" + fileName)) {
+ rr->setResponseHeader(QByteArrayLiteral("content-type"), QByteArrayLiteral("application/octet-stream"));
+ rr->setResponseHeader(QByteArrayLiteral("content-disposition"), QByteArrayLiteral("attachment"));
+ rr->setResponseBody(QByteArrayLiteral("a"));
+ rr->sendResponse();
+ } else {
+ rr->sendResponse(404);
+ }
+ });
+
+ // Set up profile and download handler
+ ScopedConnection sc2 = connect(m_profile, &QWebEngineProfile::downloadRequested, [&](QWebEngineDownloadRequest *item) {
+ suggestedFileName = item->suggestedFileName();
+ item->accept();
+ connect(item, &QWebEngineDownloadRequest::isFinishedChanged, [&, item]() {
+ QCOMPARE(item->state(), QWebEngineDownloadRequest::DownloadCompleted);
+ QCOMPARE(item->isFinished(), true);
+ QCOMPARE(item->totalBytes(), item->receivedBytes());
+ QVERIFY(item->receivedBytes() > 0);
+ QCOMPARE(item->interruptReason(), QWebEngineDownloadRequest::NoReason);
+ QCOMPARE(item->page(), m_page);
+ downloadFinished = true;
+ downloadedFilePath = QDir(item->downloadDirectory()).filePath(item->downloadFileName());
+ });
+ });
+
+ // Create the first empty file without uniquifier.
+ {
+ QFile file(m_profile->downloadPath() + "/" + fileName);
+ file.open(QIODevice::ReadWrite);
+ }
+
+ // Create 99 empty files with uniquifier.
+ for (int i = 1; i < 100; i++) {
+ QFile file(m_profile->downloadPath() + "/" + baseName + " (" + QString::number(i) + ")." + extension);
+ file.open(QIODevice::ReadWrite);
+ }
+
+ // Create 100th (kMaxUniqueFiles) empty file with uniquifier.
+ m_page->setUrl(m_server->url("/" + fileName));
+ QTRY_VERIFY(downloadFinished);
+ QVERIFY(QFile(downloadedFilePath).exists());
+ QCOMPARE(downloadedFilePath, m_profile->downloadPath() + "/" + baseName + " (100)." + extension);
+ QCOMPARE(suggestedFileName, fileName);
+
+ // Check if the downloaded files are suffixed with timestamp after the 100th download.
+ for (int i = 101; i < 103; i++) {
+ downloadFinished = false;
+ m_page->setUrl(m_server->url("/" + fileName));
+ QTRY_VERIFY(downloadFinished);
+ QVERIFY(QFile(downloadedFilePath).exists());
+ QRegularExpression fileNameCheck("^.*" + QRegularExpression::escape(baseName) + " - (.*)[.]" + QRegularExpression::escape(extension) + "$");
+ QRegularExpressionMatch match = fileNameCheck.match(downloadedFilePath);
+ QVERIFY(match.hasMatch());
+ // ISO 8601 Date and time in UTC
+ QRegularExpression timestamp("^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|["
+ "12][0-9])T(2[0-3]|[01][0-9])([0-5][0-9])([0-5][0-9])([.][0-9]"
+ "+)?(Z|[+-](?:2[0-3]|[01][0-9])[0-5][0-9])?$");
+ QVERIFY(timestamp.match(match.captured(1)).hasMatch());
+ QCOMPARE(suggestedFileName, fileName);
+ }
+}
+
+void tst_QWebEngineDownloadRequest::downloadToDefaultLocation()
+{
+ QTemporaryDir tmpDir;
+ QVERIFY(tmpDir.isValid());
+
+ QCOMPARE(m_profile->downloadPath(), QStandardPaths::writableLocation(QStandardPaths::DownloadLocation));
+
+ m_profile->setDownloadPath("");
+ QCOMPARE(m_profile->downloadPath(), QStandardPaths::writableLocation(QStandardPaths::DownloadLocation));
+
+ m_profile->setDownloadPath(tmpDir.path());
+ QCOMPARE(m_profile->downloadPath(), tmpDir.path());
+
+ m_profile->setDownloadPath(QStandardPaths::writableLocation(QStandardPaths::DownloadLocation));
+ QCOMPARE(m_profile->downloadPath(), QStandardPaths::writableLocation(QStandardPaths::DownloadLocation));
+}
+
+void tst_QWebEngineDownloadRequest::downloadToNonExistentDir()
+{
+ QString baseName("test(1.test)");
+ QString extension("txt");
+ QString fileName = QString("%1.%2").arg(baseName).arg(extension);
+ QString downloadedFilePath;
+ QString suggestedFileName;
+ bool downloadFinished = false;
+
+ QTemporaryDir tmpDir;
+ QVERIFY(tmpDir.isValid());
+ m_profile->setDownloadPath(tmpDir.path());
+
+ // Set up HTTP server
+ ScopedConnection sc1 = connect(m_server, &HttpServer::newRequest, [&](HttpReqRep *rr) {
+ auto requestPath = QString::fromUtf8(rr->requestPath());
+ if (rr->requestMethod() == "GET" && requestPath == ("/" + fileName)) {
+ rr->setResponseHeader(QByteArrayLiteral("content-type"), QByteArrayLiteral("application/octet-stream"));
+ rr->setResponseHeader(QByteArrayLiteral("content-disposition"), QByteArrayLiteral("attachment"));
+ rr->setResponseBody(QByteArrayLiteral("a"));
+ rr->sendResponse();
+ } else {
+ rr->sendResponse(404);
+ }
+ });
+
+ // Set up profile and download handler
+ ScopedConnection sc2 = connect(m_profile, &QWebEngineProfile::downloadRequested, [&](QWebEngineDownloadRequest *item) {
+ suggestedFileName = item->suggestedFileName();
+ item->accept();
+ connect(item, &QWebEngineDownloadRequest::isFinishedChanged, [&, item]() {
+ QCOMPARE(item->state(), QWebEngineDownloadRequest::DownloadCompleted);
+ QCOMPARE(item->isFinished(), true);
+ QCOMPARE(item->totalBytes(), item->receivedBytes());
+ QVERIFY(item->receivedBytes() > 0);
+ QCOMPARE(item->interruptReason(), QWebEngineDownloadRequest::NoReason);
+ QCOMPARE(item->page(), m_page);
+ downloadFinished = true;
+ downloadedFilePath = QDir(item->downloadDirectory()).filePath(item->downloadFileName());
+ });
+ });
+
+ // Set a non-existent directory for the default download location.
+ QString nonExistentDownloadPath(m_profile->downloadPath() + "/non_existent_dir");
+ m_profile->setDownloadPath(nonExistentDownloadPath);
+ QCOMPARE(m_profile->downloadPath(), nonExistentDownloadPath);
+ m_page->setUrl(m_server->url("/" + fileName));
+ QTRY_VERIFY(downloadFinished);
+ QVERIFY(QFile(downloadedFilePath).exists());
+ QCOMPARE(downloadedFilePath, nonExistentDownloadPath + "/" + fileName);
+ QCOMPARE(suggestedFileName, fileName);
+}
+
+void tst_QWebEngineDownloadRequest::downloadToReadOnlyDir()
+{
+#ifdef Q_OS_WIN
+ QSKIP("Cannot change file permissions on Windows.");
+#endif
+ QString baseName("test(1.test)");
+ QString extension("txt");
+ QString fileName = QString("%1.%2").arg(baseName).arg(extension);
+ QString downloadedFilePath;
+ QString suggestedFileName;
+ bool downloadAccepted = false;
+ bool downloadFinished = false;
+
+ QTemporaryDir tmpDir;
+ QVERIFY(tmpDir.isValid());
+ m_profile->setDownloadPath(tmpDir.path());
+
+ // Set up HTTP server
+ ScopedConnection sc1 = connect(m_server, &HttpServer::newRequest, [&](HttpReqRep *rr) {
+ auto requestPath = QString::fromUtf8(rr->requestPath());
+ if (rr->requestMethod() == "GET" && requestPath == ("/" + fileName)) {
+ rr->setResponseHeader(QByteArrayLiteral("content-type"), QByteArrayLiteral("application/octet-stream"));
+ rr->setResponseHeader(QByteArrayLiteral("content-disposition"), QByteArrayLiteral("attachment"));
+ rr->setResponseBody(QByteArrayLiteral("a"));
+ rr->sendResponse();
+ } else {
+ rr->sendResponse(404);
+ }
+ });
+
+ QPointer<QWebEngineDownloadRequest> downloadItem;
+ ScopedConnection sc2 = connect(m_profile, &QWebEngineProfile::downloadRequested, [&](QWebEngineDownloadRequest *item) {
+ suggestedFileName = item->suggestedFileName();
+ downloadItem = item;
+ item->accept();
+ connect(item, &QWebEngineDownloadRequest::isFinishedChanged, [&]() {
+ downloadFinished = true;
+ });
+ downloadAccepted = true;
+ });
+
+ // Change permission for directory.
+ QFile(m_profile->downloadPath()).setPermissions(QFileDevice::ReadOwner);
+ QVERIFY(QFile(m_profile->downloadPath()).exists());
+
+ m_page->setUrl(m_server->url("/" + fileName));
+ QTRY_VERIFY(downloadAccepted);
+
+ QVERIFY(downloadItem);
+ QTRY_COMPARE(downloadItem->state(), QWebEngineDownloadRequest::DownloadInterrupted);
+ QCOMPARE(downloadItem->isFinished(), false);
+ QCOMPARE(downloadItem->interruptReason(), QWebEngineDownloadRequest::FileAccessDenied);
+ QVERIFY(!QFile(downloadedFilePath).exists());
+ QCOMPARE(suggestedFileName, fileName);
+
+ // Clear m_requestedDownloads explicitly because download is accepted but never finished.
+ m_requestedDownloads.clear();
+ QVERIFY(!downloadFinished);
+ QFile(m_profile->downloadPath()).setPermissions(QFileDevice::WriteOwner);
+}
+
+void tst_QWebEngineDownloadRequest::downloadToDirectoryWithFileName_data()
+{
+ QTest::addColumn<bool>("setDirectoryFirst");
+
+ QTest::newRow("setDirectoryFirst") << true;
+ QTest::newRow("setFileNameFirst") << false;
+}
+
+void tst_QWebEngineDownloadRequest::downloadToDirectoryWithFileName()
+{
+ QFETCH(bool, setDirectoryFirst);
+ QString downloadDirectory;
+ QString downloadFileName;
+ QString downloadedFilePath;
+ QString downloadedSuggestedFileName;
+ QString fileName = "test.txt";
+ QString uniqueFileName = "test (1).txt";
+
+ bool downloadFinished = false;
+
+ QTemporaryDir tmpDir;
+ QVERIFY(tmpDir.isValid());
+ m_profile->setDownloadPath(tmpDir.path());
+
+ // Set up HTTP server
+ ScopedConnection sc1 = connect(m_server, &HttpServer::newRequest, [&](HttpReqRep *rr) {
+ auto requestPath = QString::fromUtf8(rr->requestPath());
+ if (rr->requestMethod() == "GET" && requestPath == ("/" + fileName)) {
+ rr->setResponseHeader(QByteArrayLiteral("content-type"), QByteArrayLiteral("application/octet-stream"));
+ rr->setResponseHeader(QByteArrayLiteral("content-disposition"), QByteArrayLiteral("attachment"));
+ rr->setResponseBody(QByteArrayLiteral("a"));
+ rr->sendResponse();
+ } else {
+ rr->sendResponse(404);
+ }
+ });
+
+ // Set up profile and download handler
+ ScopedConnection sc2 = connect(m_profile, &QWebEngineProfile::downloadRequested, [&](QWebEngineDownloadRequest *item) {
+ QSignalSpy fileNameSpy(item, &QWebEngineDownloadRequest::downloadFileNameChanged);
+ QSignalSpy directorySpy(item, &QWebEngineDownloadRequest::downloadDirectoryChanged);
+ bool isUniquifiedFileName = false;
+ if (!downloadDirectory.isEmpty() && setDirectoryFirst) {
+ const QString &originalFileName = item->downloadFileName();
+ item->setDownloadDirectory(downloadDirectory);
+ QCOMPARE(item->downloadDirectory(), downloadDirectory);
+ QCOMPARE(directorySpy.size(), 1);
+ isUniquifiedFileName = (originalFileName != item->downloadFileName());
+ QCOMPARE(fileNameSpy.size(), isUniquifiedFileName ? 1 : 0);
+ }
+
+ if (!downloadFileName.isEmpty()) {
+ item->setDownloadFileName(downloadFileName);
+ QCOMPARE(item->downloadFileName(), downloadFileName);
+ QCOMPARE(fileNameSpy.size(), isUniquifiedFileName ? 2 : 1);
+ }
+
+ if (!downloadDirectory.isEmpty() && !setDirectoryFirst) {
+ item->setDownloadDirectory(downloadDirectory);
+ QCOMPARE(item->downloadDirectory(), downloadDirectory);
+ QCOMPARE(directorySpy.size(), 1);
+ }
+
+ item->accept();
+
+ connect(item, &QWebEngineDownloadRequest::isFinishedChanged, [&, item]() {
+ QCOMPARE(item->state(), QWebEngineDownloadRequest::DownloadCompleted);
+ QCOMPARE(item->isFinished(), true);
+ QCOMPARE(item->totalBytes(), item->receivedBytes());
+ QVERIFY(item->receivedBytes() > 0);
+ QCOMPARE(item->interruptReason(), QWebEngineDownloadRequest::NoReason);
+ QCOMPARE(item->page(), m_page);
+ downloadFinished = true;
+ downloadedFilePath = QDir(item->downloadDirectory()).filePath(item->downloadFileName());
+ downloadedSuggestedFileName = item->suggestedFileName();
+ });
+ });
+
+ // Download file to the default download directory.
+ downloadDirectory = "";
+ downloadFileName = "";
+ m_page->setUrl(m_server->url("/" + fileName));
+ QTRY_VERIFY(downloadFinished);
+ QVERIFY(QFile(downloadedFilePath).exists());
+ QCOMPARE(downloadedFilePath, QDir(m_profile->downloadPath()).filePath(fileName));
+ QCOMPARE(downloadedSuggestedFileName, fileName);
+
+ // Download the same file to another directory
+ downloadFinished = false;
+ downloadDirectory = m_profile->downloadPath() + QDir::separator() + "test1" + QDir::separator();
+ downloadFileName = "";
+ m_page->setUrl(m_server->url("/" + fileName));
+ QTRY_VERIFY(downloadFinished);
+ QVERIFY(QFile(downloadedFilePath).exists());
+ QCOMPARE(downloadedFilePath, QDir(downloadDirectory).filePath(fileName));
+ QCOMPARE(downloadedSuggestedFileName, fileName);
+
+ // Download the same file to the same directory and the file name must be unique.
+ downloadFinished = false;
+ downloadDirectory = m_profile->downloadPath() + QDir::separator() + "test1" + QDir::separator();
+ downloadFileName = "";
+ m_page->setUrl(m_server->url("/" + fileName));
+ QTRY_VERIFY(downloadFinished);
+ QVERIFY(QFile(downloadedFilePath).exists());
+ QCOMPARE(downloadedFilePath, QDir(downloadDirectory).filePath(uniqueFileName));
+ QCOMPARE(downloadedSuggestedFileName, fileName);
+
+ // Download another file to the same directory and set file name by
+ // QWebEngineDownloadRequest::setDownloadDirectory() and setDownloadFileName() to avoid uniquification.
+ downloadFinished = false;
+ downloadDirectory = m_profile->downloadPath() + QDir::separator() + "test1" + QDir::separator();
+ downloadFileName = "test1.txt";
+ m_page->setUrl(m_server->url("/" + fileName));
+ QTRY_VERIFY(downloadFinished);
+ QVERIFY(QFile(downloadedFilePath).exists());
+ QCOMPARE(downloadedFilePath, QDir(downloadDirectory).filePath(downloadFileName));
+ QCOMPARE(downloadedSuggestedFileName, fileName);
+
+ // Download the same file to another directory without uniquifying the file name
+ downloadFinished = false;
+ downloadDirectory = m_profile->downloadPath() + QDir::separator() + "test2" + QDir::separator();
+ downloadFileName = "test1.txt";
+ m_page->setUrl(m_server->url("/" + fileName));
+ QTRY_VERIFY(downloadFinished);
+ QVERIFY(QFile(downloadedFilePath).exists());
+ QCOMPARE(downloadedFilePath, QDir(downloadDirectory).filePath(downloadFileName));
+ QCOMPARE(downloadedSuggestedFileName, fileName);
+
+ // Download the same file to same directory and set file name by
+ // QWebEngineDownloadRequest::setDownloadDirectory() and setDownloadFileName() to avoid uniquification.
+ downloadFinished = false;
+ downloadDirectory = m_profile->downloadPath() + QDir::separator() + "test2" + QDir::separator();
+ downloadFileName = "test1.txt";
+ m_page->setUrl(m_server->url("/" + fileName));
+ QTRY_VERIFY(downloadFinished);
+ QVERIFY(QFile(downloadedFilePath).exists());
+ QCOMPARE(downloadedFilePath, QDir(downloadDirectory).filePath(downloadFileName));
+ QCOMPARE(downloadedSuggestedFileName, fileName);
+
+ // Download the same file in the same directory.
+ // Use the suggested file name (test.txt) and the file name will not be unique because this file name don't yet exists.
+ downloadFinished = false;
+ downloadDirectory = m_profile->downloadPath() + QDir::separator() + "test2" + QDir::separator();
+ downloadFileName = "";
+ m_page->setUrl(m_server->url("/" + fileName));
+ QTRY_VERIFY(downloadFinished);
+ QVERIFY(QFile(downloadedFilePath).exists());
+ QCOMPARE(downloadedFilePath, QDir(downloadDirectory).filePath(fileName));
+ QCOMPARE(downloadedSuggestedFileName, fileName);
+}
+
+void tst_QWebEngineDownloadRequest::downloadDataUrls_data()
+{
+ QTest::addColumn<QByteArray>("htmlData");
+ QTest::addColumn<QString>("expectedFileName");
+ QTest::newRow("data url without slash") << QByteArrayLiteral("<html><head><meta charset=\"utf-8\"></head><body><a href=\"data:application/gzip;base64,dGVzdA==\">data URL without slash</a><br/></body></html>") << QStringLiteral("qwe_download.gz") ;
+ QTest::newRow("data url with slash") << QByteArrayLiteral("<html><head><meta charset=\"utf-8\"></head><body><a href=\"data:application/gzip;base64,dGVzcnI/dGVzdA==\">data URL with filename</a><br/></body></html>") << QStringLiteral("qwe_download.gz") ;
+ QTest::newRow("data url with download tag") << QByteArrayLiteral("<html><head><meta charset=\"utf-8\"></head><body><a href=\"data:application/gzip;base64,dGVzdA/IHRlc3Q=\" download=\"filename.gz\">data URL with filename</a><br/></body></html>") << QStringLiteral("filename.gz") ;
+
+}
+
+void tst_QWebEngineDownloadRequest::downloadDataUrls()
+{
+ QFETCH(QByteArray, htmlData);
+ QFETCH(QString, expectedFileName);
+ // Set up HTTP server
+ ScopedConnection sc1 = connect(m_server, &HttpServer::newRequest, [&](HttpReqRep *rr) {
+ if (rr->requestMethod() == "GET" && rr->requestPath() == "/") {
+ rr->setResponseHeader(QByteArrayLiteral("content-type"), QByteArrayLiteral("text/html"));
+ rr->setResponseBody(htmlData);
+ rr->sendResponse();
+ }
+ });
+
+ // Set up profile and download handler
+ QTemporaryDir tmpDir;
+ QVERIFY(tmpDir.isValid());
+ m_profile->setDownloadPath(tmpDir.path());
+
+ int downloadRequestCount = 0;
+ ScopedConnection sc2 = connect(m_profile, &QWebEngineProfile::downloadRequested, [&](QWebEngineDownloadRequest *item) {
+ QCOMPARE(item->state(), QWebEngineDownloadRequest::DownloadRequested);
+ QCOMPARE(item->downloadFileName(), expectedFileName);
+ downloadRequestCount++;
+ });
+
+ QSignalSpy loadSpy(m_page, &QWebEnginePage::loadFinished);
+ m_view->load(m_server->url());
+ QTRY_COMPARE(loadSpy.size(), 1);
+ QCOMPARE(loadSpy.takeFirst().value(0).toBool(), true);
+
+ // Trigger download
+ simulateUserAction(QPoint(10, 10), UserAction::ClickLink);
+ QTRY_COMPARE(downloadRequestCount, 1);
+}
+
+QTEST_MAIN(tst_QWebEngineDownloadRequest)
+#include "tst_qwebenginedownloadrequest.moc"
diff --git a/tests/auto/widgets/qwebenginehistory/CMakeLists.txt b/tests/auto/widgets/qwebenginehistory/CMakeLists.txt
new file mode 100644
index 000000000..e277a7326
--- /dev/null
+++ b/tests/auto/widgets/qwebenginehistory/CMakeLists.txt
@@ -0,0 +1,29 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+include(../../util/util.cmake)
+
+qt_internal_add_test(tst_qwebenginehistory
+ SOURCES
+ tst_qwebenginehistory.cpp
+ LIBRARIES
+ Qt::WebEngineWidgets
+ Test::Util
+)
+
+set(tst_qwebenginehistory_resource_files
+ "resources/page1.html"
+ "resources/page2.html"
+ "resources/page3.html"
+ "resources/page4.html"
+ "resources/page5.html"
+ "resources/page6.html"
+)
+
+qt_internal_add_resource(tst_qwebenginehistory "tst_qwebenginehistory"
+ PREFIX
+ "/"
+ FILES
+ ${tst_qwebenginehistory_resource_files}
+)
+
diff --git a/tests/auto/widgets/qwebenginehistory/qwebenginehistory.pro b/tests/auto/widgets/qwebenginehistory/qwebenginehistory.pro
deleted file mode 100644
index e99c7f493..000000000
--- a/tests/auto/widgets/qwebenginehistory/qwebenginehistory.pro
+++ /dev/null
@@ -1 +0,0 @@
-include(../tests.pri)
diff --git a/tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.cpp b/tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.cpp
index bdb486793..ad66e972c 100644
--- a/tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.cpp
+++ b/tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.cpp
@@ -20,7 +20,7 @@
#include <QtTest/QtTest>
#include <QAction>
-#include "../util.h"
+#include <util.h>
#include "qwebenginepage.h"
#include "qwebengineview.h"
#include "qwebenginehistory.h"
@@ -39,7 +39,7 @@ protected :
{
loadFinishedSpy->clear();
page->load(QUrl("qrc:/resources/page" + QString::number(nr) + ".html"));
- QTRY_COMPARE(loadFinishedSpy->count(), 1);
+ QTRY_COMPARE(loadFinishedSpy->size(), 1);
loadFinishedSpy->clear();
}
@@ -150,8 +150,8 @@ void tst_QWebEngineHistory::back()
for (int i = histsize;i > 1;i--) {
QTRY_COMPARE(toPlainTextSync(page), QString("page") + QString::number(i));
hist->back();
- QTRY_COMPARE(loadFinishedSpy->count(), histsize-i+1);
- QTRY_COMPARE(titleChangedSpy.count(), histsize-i+1);
+ QTRY_COMPARE(loadFinishedSpy->size(), histsize-i+1);
+ QTRY_COMPARE(titleChangedSpy.size(), histsize-i+1);
}
//try one more time (too many). crash test
hist->back();
@@ -168,15 +168,15 @@ void tst_QWebEngineHistory::forward()
while (hist->canGoBack()) {
hist->back();
histBackCount++;
- QTRY_COMPARE(loadFinishedSpy->count(), histBackCount);
+ QTRY_COMPARE(loadFinishedSpy->size(), histBackCount);
}
QSignalSpy titleChangedSpy(page, SIGNAL(titleChanged(const QString&)));
for (int i = 1;i < histsize;i++) {
QTRY_COMPARE(toPlainTextSync(page), QString("page") + QString::number(i));
hist->forward();
- QTRY_COMPARE(loadFinishedSpy->count(), i+histBackCount);
- QTRY_COMPARE(titleChangedSpy.count(), i);
+ QTRY_COMPARE(loadFinishedSpy->size(), i+histBackCount);
+ QTRY_COMPARE(titleChangedSpy.size(), i);
}
//try one more time (too many). crash test
hist->forward();
@@ -205,15 +205,15 @@ void tst_QWebEngineHistory::goToItem()
QWebEngineHistoryItem current = hist->currentItem();
hist->back();
- QTRY_COMPARE(loadFinishedSpy->count(), 1);
+ QTRY_COMPARE(loadFinishedSpy->size(), 1);
hist->back();
- QTRY_COMPARE(loadFinishedSpy->count(), 2);
+ QTRY_COMPARE(loadFinishedSpy->size(), 2);
QVERIFY(hist->currentItem().title() != current.title());
hist->goToItem(current);
- QTRY_COMPARE(loadFinishedSpy->count(), 2);
+ QTRY_COMPARE(loadFinishedSpy->size(), 2);
QTRY_COMPARE(hist->currentItem().title(), current.title());
}
@@ -225,7 +225,7 @@ void tst_QWebEngineHistory::items()
{
QList<QWebEngineHistoryItem> items = hist->items();
//check count
- QTRY_COMPARE(histsize, items.count());
+ QTRY_COMPARE(histsize, items.size());
//check order
for (int i = 1;i <= histsize;i++) {
@@ -236,10 +236,10 @@ void tst_QWebEngineHistory::items()
void tst_QWebEngineHistory::backForwardItems()
{
hist->back();
- QTRY_COMPARE(loadFinishedSpy->count(), 1);
+ QTRY_COMPARE(loadFinishedSpy->size(), 1);
hist->back();
- QTRY_COMPARE(loadFinishedSpy->count(), 2);
+ QTRY_COMPARE(loadFinishedSpy->size(), 2);
QTRY_COMPARE(hist->items().size(), 5);
QTRY_COMPARE(hist->backItems(100).size(), 2);
@@ -297,9 +297,9 @@ void tst_QWebEngineHistory::serialize_2()
hist->back();
QTRY_VERIFY(evaluateJavaScriptSync(page, "location.hash").toString().isEmpty());
hist->back();
- QTRY_COMPARE(loadFinishedSpy->count(), 1);
+ QTRY_COMPARE(loadFinishedSpy->size(), 1);
hist->back();
- QTRY_COMPARE(loadFinishedSpy->count(), 2);
+ QTRY_COMPARE(loadFinishedSpy->size(), 2);
//check if current index was changed (make sure that it is not last item)
QVERIFY(hist->currentItemIndex() != initialCurrentIndex);
//save current index
@@ -310,17 +310,18 @@ void tst_QWebEngineHistory::serialize_2()
load >> *hist;
QVERIFY(load.status() == QDataStream::Ok);
// Restoring the history will trigger a load.
- QTRY_COMPARE(loadFinishedSpy->count(), 3);
+ QTRY_COMPARE(loadFinishedSpy->size(), 3);
//check current index
QTRY_COMPARE(hist->currentItemIndex(), oldCurrentIndex);
hist->forward();
- QTRY_COMPARE(loadFinishedSpy->count(), 4);
+ QTRY_COMPARE(loadFinishedSpy->size(), 4);
hist->forward();
- QTRY_COMPARE(loadFinishedSpy->count(), 5);
+ QTRY_COMPARE(loadFinishedSpy->size(), 5);
hist->forward();
- QTRY_COMPARE(loadFinishedSpy->count(), 6);
+ // In-page navigation, the last url was the page5.html
+ QTRY_COMPARE(loadFinishedSpy->size(), 5);
QTRY_COMPARE(hist->currentItemIndex(), initialCurrentIndex);
}
@@ -428,7 +429,7 @@ void tst_QWebEngineHistory::saveAndRestore_crash_4()
QSignalSpy loadFinishedSpy2(page2.data(), SIGNAL(loadFinished(bool)));
QDataStream load(&buffer, QIODevice::ReadOnly);
load >> *page2->history();
- QTRY_COMPARE(loadFinishedSpy2.count(), 1);
+ QTRY_COMPARE(loadFinishedSpy2.size(), 1);
}
void tst_QWebEngineHistory::saveAndRestore_InternalPage()
@@ -467,7 +468,7 @@ void tst_QWebEngineHistory::popPushState()
QWebEnginePage page;
QSignalSpy spyLoadFinished(&page, SIGNAL(loadFinished(bool)));
page.setHtml("<html><body>long live Qt!</body></html>");
- QTRY_COMPARE(spyLoadFinished.count(), 1);
+ QTRY_COMPARE(spyLoadFinished.size(), 1);
evaluateJavaScriptSync(&page, script);
}
@@ -486,9 +487,9 @@ void tst_QWebEngineHistory::clear()
QWebEnginePage page2(this);
QWebEngineHistory* hist2 = page2.history();
- QVERIFY(hist2->count() == 0);
+ QCOMPARE(hist2->count(), 0);
hist2->clear();
- QVERIFY(hist2->count() == 0); // Do not change anything.
+ QCOMPARE(hist2->count(), 0); // Do not change anything.
}
void tst_QWebEngineHistory::historyItemFromDeletedPage()
diff --git a/tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.qrc b/tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.qrc
deleted file mode 100644
index cdfe575a0..000000000
--- a/tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.qrc
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
-<qresource>
- <file>resources/page1.html</file>
- <file>resources/page2.html</file>
- <file>resources/page3.html</file>
- <file>resources/page4.html</file>
- <file>resources/page5.html</file>
- <file>resources/page6.html</file>
-</qresource>
-</RCC>
diff --git a/tests/auto/widgets/qwebenginepage/BLACKLIST b/tests/auto/widgets/qwebenginepage/BLACKLIST
index 02b297d5a..52def48d1 100644
--- a/tests/auto/widgets/qwebenginepage/BLACKLIST
+++ b/tests/auto/widgets/qwebenginepage/BLACKLIST
@@ -5,8 +5,11 @@ osx
windows
macos # Can't move cursor (QTBUG-76312)
-[devTools]
-msvc-2019
+[comboBoxPopupPositionAfterMove]
+macos
-[setLifecycleStateWithDevTools]
-msvc-2019
+[comboBoxPopupPositionAfterChildMove]
+macos
+
+[backgroundColor]
+macos
diff --git a/tests/auto/widgets/qwebenginepage/CMakeLists.txt b/tests/auto/widgets/qwebenginepage/CMakeLists.txt
new file mode 100644
index 000000000..f63d6211c
--- /dev/null
+++ b/tests/auto/widgets/qwebenginepage/CMakeLists.txt
@@ -0,0 +1,68 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+include(../../httpserver/httpserver.cmake)
+include(../../util/util.cmake)
+
+qt_internal_add_test(tst_qwebenginepage
+ SOURCES
+ tst_qwebenginepage.cpp
+ LIBRARIES
+ Qt::CorePrivate
+ Qt::NetworkPrivate
+ Qt::WebEngineCorePrivate
+ Qt::WebEngineWidgets
+ Test::HttpServer
+ Test::Util
+)
+
+get_target_property(sharedData Test::HttpServer SHARED_DATA)
+
+set(tst_qwebenginepage_resource_files
+ "resources/redirect.html"
+ "resources/bar.txt"
+ "resources/content.html"
+ "resources/dynamicFrame.html"
+ "resources/foo.txt"
+ "resources/fontaccess.html"
+ "resources/frame_a.html"
+ "resources/frame_c.html"
+ "resources/framedindex.html"
+ "resources/fullscreen.html"
+ "resources/iframe.html"
+ "resources/iframe2.html"
+ "resources/iframe3.html"
+ "resources/image.png"
+ "resources/index.html"
+ "resources/lifecycle.html"
+ "resources/pasteimage.html"
+ "resources/path with spaces.txt"
+ "resources/reload.html"
+ "resources/script.html"
+ "resources/style.css"
+ "resources/test1.html"
+ "resources/test2.html"
+ "resources/testiframe.html"
+ "resources/testiframe2.html"
+ "resources/user.css"
+)
+
+qt_internal_add_resource(tst_qwebenginepage "tst_qwebenginepage"
+ PREFIX
+ "/"
+ FILES
+ ${tst_qwebenginepage_resource_files}
+)
+set_source_files_properties("${sharedData}/notification.html"
+ PROPERTIES QT_RESOURCE_ALIAS "notification.html"
+)
+set(tst_qwebenginepage1_resource_files
+ "${sharedData}/notification.html"
+)
+
+qt_internal_add_resource(tst_qwebenginepage "tst_qwebenginepage1"
+ PREFIX
+ "/shared"
+ FILES
+ ${tst_qwebenginepage1_resource_files}
+)
diff --git a/tests/auto/widgets/qwebenginepage/qwebenginepage.pro b/tests/auto/widgets/qwebenginepage/qwebenginepage.pro
deleted file mode 100644
index 18a66c466..000000000
--- a/tests/auto/widgets/qwebenginepage/qwebenginepage.pro
+++ /dev/null
@@ -1,3 +0,0 @@
-include(../tests.pri)
-include(../../shared/http.pri)
-QT *= core-private
diff --git a/tests/auto/widgets/qwebenginepage/resources/fontaccess.html b/tests/auto/widgets/qwebenginepage/resources/fontaccess.html
new file mode 100644
index 000000000..1a0fe8af9
--- /dev/null
+++ b/tests/auto/widgets/qwebenginepage/resources/fontaccess.html
@@ -0,0 +1,14 @@
+<html>
+<body onkeypress='onKeyPress()'>
+<a>This is test content</a>
+<script>
+var done = false;
+var fonts;
+var activated = false;
+function onKeyPress() {
+ activated = true;
+ window.queryLocalFonts().then(f => { fonts = f; done = true; });
+}
+</script>
+</body>
+</html>
diff --git a/tests/auto/widgets/resources/image2.png b/tests/auto/widgets/qwebenginepage/resources/image2.png
index 8d703640c..8d703640c 100644
--- a/tests/auto/widgets/resources/image2.png
+++ b/tests/auto/widgets/qwebenginepage/resources/image2.png
Binary files differ
diff --git a/tests/auto/widgets/qwebenginepage/resources/redirect.html b/tests/auto/widgets/qwebenginepage/resources/redirect.html
new file mode 100644
index 000000000..db06d73a7
--- /dev/null
+++ b/tests/auto/widgets/qwebenginepage/resources/redirect.html
@@ -0,0 +1,8 @@
+<html>
+<body>
+<script>
+function doRedirect() { location.replace('qrc:///resources/content.html') }
+document.addEventListener("DOMContentLoaded", doRedirect)
+</script>
+</body>
+</html>
diff --git a/tests/auto/widgets/qwebenginepage/resources/reload.html b/tests/auto/widgets/qwebenginepage/resources/reload.html
index d9c33dfcd..062d06807 100644
--- a/tests/auto/widgets/qwebenginepage/resources/reload.html
+++ b/tests/auto/widgets/qwebenginepage/resources/reload.html
@@ -1,6 +1,6 @@
<html>
<head>
-<meta http-equiv="refresh" content="2">
+<meta http-equiv="refresh" content="2;url=qrc:///resources/content.html">
</head>
<body>
This is test content
diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
index 621c2dbd7..39a28759c 100644
--- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
+++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2016 The Qt Company Ltd.
+ Copyright (C) 2023 The Qt Company Ltd.
Copyright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in>
Copyright (C) 2010 Holger Hans Peter Freyther
@@ -19,8 +19,10 @@
Boston, MA 02110-1301, USA.
*/
-#include "../util.h"
+#include <widgetutil.h>
+#include <QtNetwork/private/qtnetworkglobal_p.h>
#include <QtWebEngineCore/qtwebenginecore-config.h>
+#include <QtWebEngineCore/private/qtwebenginecoreglobal_p.h>
#include <QByteArray>
#include <QClipboard>
#include <QDir>
@@ -31,11 +33,13 @@
#include <QMenu>
#include <QMimeDatabase>
#include <QNetworkProxy>
-#include <QOpenGLWidget>
#include <QPaintEngine>
#include <QPushButton>
#include <QScreen>
-#include <QStateMachine>
+#include <QWheelEvent>
+#if defined(QT_STATEMACHINE_LIB)
+# include <QStateMachine>
+#endif
#include <QtGui/QClipboard>
#include <QtTest/QtTest>
#include <QTextCharFormat>
@@ -46,10 +50,15 @@
#include <qnetworkcookiejar.h>
#include <qnetworkreply.h>
#include <qnetworkrequest.h>
-#include <qwebenginedownloaditem.h>
+#include <qwebengineclienthints.h>
+#include <qwebenginedownloadrequest.h>
+#include <qwebenginedesktopmediarequest.h>
+#include <qwebenginefilesystemaccessrequest.h>
#include <qwebenginefindtextresult.h>
#include <qwebenginefullscreenrequest.h>
#include <qwebenginehistory.h>
+#include <qwebenginenavigationrequest.h>
+#include <qwebenginenewwindowrequest.h>
#include <qwebenginenotification.h>
#include <qwebenginepage.h>
#include <qwebengineprofile.h>
@@ -58,14 +67,21 @@
#include <qwebenginescript.h>
#include <qwebenginescriptcollection.h>
#include <qwebenginesettings.h>
+#include <qwebengineurlrequestinterceptor.h>
+#include <qwebengineurlrequestjob.h>
+#include <qwebengineurlscheme.h>
+#include <qwebengineurlschemehandler.h>
#include <qwebengineview.h>
#include <qimagewriter.h>
+#include <QColorSpace>
+#include <QQuickRenderControl>
+#include <QQuickWindow>
static void removeRecursive(const QString& dirname)
{
QDir dir(dirname);
QFileInfoList entries(dir.entryInfoList(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot));
- for (int i = 0; i < entries.count(); ++i)
+ for (int i = 0; i < entries.size(); ++i)
if (entries[i].isDir())
removeRecursive(entries[i].filePath());
else
@@ -73,6 +89,13 @@ static void removeRecursive(const QString& dirname)
QDir().rmdir(dirname);
}
+struct TestBasePage : QWebEnginePage
+{
+ explicit TestBasePage(QWebEngineProfile *profile, QObject *parent = nullptr) : QWebEnginePage(profile, parent) { }
+ explicit TestBasePage(QObject *parent = nullptr) : QWebEnginePage(parent) { }
+ QSignalSpy loadSpy { this, &QWebEnginePage::loadFinished };
+};
+
class tst_QWebEnginePage : public QObject
{
Q_OBJECT
@@ -89,12 +112,17 @@ public Q_SLOTS:
private Q_SLOTS:
void initTestCase();
void cleanupTestCase();
+ void comboBoxPopupPositionAfterMove_data();
void comboBoxPopupPositionAfterMove();
+ void comboBoxPopupPositionAfterChildMove_data();
void comboBoxPopupPositionAfterChildMove();
void acceptNavigationRequest();
void acceptNavigationRequestNavigationType();
+ void acceptNavigationRequestRelativeToNothing();
+#ifndef Q_OS_MACOS
void geolocationRequestJS_data();
void geolocationRequestJS();
+#endif
void loadFinished();
void actionStates();
void pasteImage();
@@ -129,11 +157,13 @@ private Q_SLOTS:
void findTextCalledOnMatch();
void findTextActiveMatchOrdinal();
void deleteQWebEngineViewTwice();
+#if defined(QT_STATEMACHINE_LIB)
void loadSignalsOrder_data();
void loadSignalsOrder();
+#endif
void openWindowDefaultSize();
-#ifdef Q_OS_MAC
+#ifdef Q_OS_MACOS
void macCopyUnicodeToClipboard();
#endif
@@ -141,7 +171,8 @@ private Q_SLOTS:
void runJavaScriptDisabled();
void runJavaScriptFromSlot();
void fullScreenRequested();
- void quotaRequested();
+ void requestQuota_data();
+ void requestQuota();
// Tests from tst_QWebEngineFrame
@@ -173,7 +204,6 @@ private Q_SLOTS:
void setUrlUsingStateObject();
void setUrlThenLoads_data();
void setUrlThenLoads();
- void loadFinishedAfterNotFoundError();
void loadInSignalHandlers_data();
void loadInSignalHandlers();
void loadFromQrc();
@@ -204,7 +234,13 @@ private Q_SLOTS:
void notificationPermission_data();
void notificationPermission();
void sendNotification();
+ void clipboardReadWritePermissionInitialState_data();
+ void clipboardReadWritePermissionInitialState();
+ void clipboardReadWritePermission_data();
+ void clipboardReadWritePermission();
void contentsSize();
+ void localFontAccessPermission_data();
+ void localFontAccessPermission();
void setLifecycleState();
void setVisible();
@@ -225,6 +261,8 @@ private Q_SLOTS:
void editActionsWithoutSelection();
void customUserAgentInNewTab();
+ void openNewTabInDifferentProfile_data();
+ void openNewTabInDifferentProfile();
void renderProcessCrashed();
void renderProcessPid();
void backgroundColor();
@@ -233,20 +271,54 @@ private Q_SLOTS:
void isSafeRedirect_data();
void isSafeRedirect();
+ void testChooseFilesParameters_data();
+ void testChooseFilesParameters();
+ void fileSystemAccessDialog();
+
+ void localToRemoteNavigation();
+ void clientHints_data();
+ void clientHints();
+ void childFrameInput();
+ void openLinkInNewPageWithWebWindowType_data();
+ void openLinkInNewPageWithWebWindowType();
+ void keepInterceptorAfterNewWindowRequested();
+ void chooseDesktopMedia();
+
private:
- static QPoint elementCenter(QWebEnginePage *page, const QString &id);
static bool isFalseJavaScriptResult(QWebEnginePage *page, const QString &javaScript);
static bool isTrueJavaScriptResult(QWebEnginePage *page, const QString &javaScript);
static bool isEmptyListJavaScriptResult(QWebEnginePage *page, const QString &javaScript);
QWebEngineView* m_view;
QWebEnginePage* m_page;
+ QScopedPointer<QPointingDevice> s_touchDevice =
+ QScopedPointer<QPointingDevice>(QTest::createTouchDevice());
+
QString tmpDirPath() const
{
static QString tmpd = QDir::tempPath() + "/tst_qwebenginepage-"
+ QDateTime::currentDateTime().toString(QLatin1String("yyyyMMddhhmmss"));
return tmpd;
}
+
+ void makeClick(const QPointer<QWindow> window, bool withTouch = false,
+ const QPoint &p = QPoint())
+ {
+ QVERIFY2(window, "window is gone");
+ if (!withTouch) {
+ QTest::mouseClick(window, Qt::LeftButton, Qt::KeyboardModifiers(), p);
+ } else {
+ QTest::touchEvent(window, s_touchDevice.get()).press(1, p);
+ QTest::touchEvent(window, s_touchDevice.get()).release(1, p);
+ }
+ };
+
+ void makeScroll(QWidget *target, QPointF pos, QPoint globalPos, QPoint angleDelta)
+ {
+ QWheelEvent ev(pos, globalPos, QPoint(0, 0), angleDelta, Qt::NoButton, Qt::NoModifier,
+ Qt::NoScrollPhase, false);
+ QGuiApplication::sendEvent(target, &ev);
+ }
};
tst_QWebEnginePage::tst_QWebEnginePage()
@@ -288,6 +360,18 @@ void tst_QWebEnginePage::initTestCase()
#endif
searchPath += QStringLiteral("/../../../plugins");
QCoreApplication::addLibraryPath(searchPath);
+
+ QWebEngineUrlScheme echo("echo");
+ echo.setSyntax(QWebEngineUrlScheme::Syntax::Path);
+ QWebEngineUrlScheme::registerScheme(echo);
+
+ QWebEngineUrlScheme local("local");
+ local.setFlags(QWebEngineUrlScheme::LocalScheme);
+ QWebEngineUrlScheme::registerScheme(local);
+
+ QWebEngineUrlScheme remote("remote");
+ remote.setFlags(QWebEngineUrlScheme::CorsEnabled);
+ QWebEngineUrlScheme::registerScheme(remote);
}
void tst_QWebEnginePage::cleanupTestCase()
@@ -295,6 +379,23 @@ void tst_QWebEnginePage::cleanupTestCase()
cleanupFiles(); // Be nice
}
+class EchoingUrlSchemeHandler : public QWebEngineUrlSchemeHandler
+{
+public:
+ EchoingUrlSchemeHandler(QObject *parent = nullptr)
+ : QWebEngineUrlSchemeHandler(parent)
+ {
+ }
+ ~EchoingUrlSchemeHandler() = default;
+
+ void requestStarted(QWebEngineUrlRequestJob *job) override
+ {
+ QBuffer *buffer = new QBuffer(job);
+ buffer->setData(job->requestUrl().toString(QUrl::RemoveScheme).toUtf8());
+ job->reply("text/plain;charset=utf-8", buffer);
+ }
+};
+
class NavigationRequestOverride : public QWebEnginePage
{
public:
@@ -302,7 +403,7 @@ public:
bool m_acceptNavigationRequest;
protected:
- virtual bool acceptNavigationRequest(const QUrl &url, NavigationType type, bool isMainFrame)
+ bool acceptNavigationRequest(const QUrl &url, NavigationType type, bool isMainFrame) override
{
Q_UNUSED(url);
Q_UNUSED(isMainFrame);
@@ -315,24 +416,26 @@ protected:
void tst_QWebEnginePage::acceptNavigationRequest()
{
QWebEngineProfile profile;
+ profile.installUrlSchemeHandler("echo", new EchoingUrlSchemeHandler(&profile));
NavigationRequestOverride page(&profile, false);
QSignalSpy loadSpy(&page, SIGNAL(loadFinished(bool)));
- page.setHtml(QString("<html><body><form name='tstform' action='data:text/html,foo'method='get'>"
- "<input type='text'><input type='submit'></form></body></html>"), QUrl());
- QTRY_COMPARE_WITH_TIMEOUT(loadSpy.count(), 1, 20000);
+ page.setHtml(QString("<html><body><form name='tstform' action='foo' method='get'>"
+ "<input type='text'><input type='submit'></form></body></html>"),
+ QUrl("echo:/"));
+ QTRY_COMPARE_WITH_TIMEOUT(loadSpy.size(), 1, 20000);
evaluateJavaScriptSync(&page, "tstform.submit();");
- QTRY_COMPARE(loadSpy.count(), 2);
+ QTRY_COMPARE(loadSpy.size(), 2);
// Content hasn't changed so the form submit will still work
page.m_acceptNavigationRequest = true;
evaluateJavaScriptSync(&page, "tstform.submit();");
- QTRY_COMPARE(loadSpy.count(), 3);
+ QTRY_COMPARE(loadSpy.size(), 3);
// Now the content has changed
- QCOMPARE(toPlainTextSync(&page), QString("foo?"));
+ QCOMPARE(toPlainTextSync(&page), QString("/foo?"));
}
class JSTestPage : public QWebEnginePage
@@ -365,6 +468,7 @@ private:
bool m_allowGeolocation;
};
+#ifndef Q_OS_MACOS
void tst_QWebEnginePage::geolocationRequestJS_data()
{
QTest::addColumn<bool>("allowed");
@@ -379,7 +483,7 @@ void tst_QWebEnginePage::geolocationRequestJS()
QFETCH(int, errorCode);
QWebEngineView view;
JSTestPage *newPage = new JSTestPage(&view);
- newPage->setView(&view);
+ view.setPage(newPage);
newPage->setGeolocationPermission(allowed);
connect(newPage, SIGNAL(featurePermissionRequested(const QUrl&, QWebEnginePage::Feature)),
@@ -387,7 +491,7 @@ void tst_QWebEnginePage::geolocationRequestJS()
QSignalSpy spyLoadFinished(newPage, SIGNAL(loadFinished(bool)));
newPage->setHtml(QString("<html><body>test</body></html>"), QUrl("qrc://secure/origin"));
- QTRY_COMPARE_WITH_TIMEOUT(spyLoadFinished.count(), 1, 20000);
+ QTRY_COMPARE_WITH_TIMEOUT(spyLoadFinished.size(), 1, 20000);
// Geolocation is only enabled for visible WebContents.
view.show();
@@ -404,6 +508,7 @@ void tst_QWebEnginePage::geolocationRequestJS()
QEXPECT_FAIL("", "No location service available.", Continue);
QCOMPARE(result, errorCode);
}
+#endif
void tst_QWebEnginePage::loadFinished()
{
@@ -414,19 +519,19 @@ void tst_QWebEnginePage::loadFinished()
page.load(QUrl("data:text/html,<frameset cols=\"25%,75%\"><frame src=\"data:text/html,"
"<head><meta http-equiv='refresh' content='1'></head>foo \">"
"<frame src=\"data:text/html,bar\"></frameset>"));
- QTRY_COMPARE_WITH_TIMEOUT(spyLoadFinished.count(), 1, 20000);
+ QTRY_COMPARE_WITH_TIMEOUT(spyLoadFinished.size(), 1, 20000);
QEXPECT_FAIL("", "Behavior change: Load signals are emitted only for the main frame in QtWebEngine.", Continue);
- QTRY_VERIFY_WITH_TIMEOUT(spyLoadStarted.count() > 1, 100);
+ QTRY_VERIFY_WITH_TIMEOUT(spyLoadStarted.size() > 1, 100);
QEXPECT_FAIL("", "Behavior change: Load signals are emitted only for the main frame in QtWebEngine.", Continue);
- QTRY_VERIFY_WITH_TIMEOUT(spyLoadFinished.count() > 1, 100);
+ QTRY_VERIFY_WITH_TIMEOUT(spyLoadFinished.size() > 1, 100);
spyLoadFinished.clear();
page.load(QUrl("data:text/html,<frameset cols=\"25%,75%\"><frame src=\"data:text/html,"
"foo \"><frame src=\"data:text/html,bar\"></frameset>"));
- QTRY_COMPARE(spyLoadFinished.count(), 1);
- QCOMPARE(spyLoadFinished.count(), 1);
+ QTRY_COMPARE(spyLoadFinished.size(), 1);
+ QCOMPARE(spyLoadFinished.size(), 1);
}
void tst_QWebEnginePage::actionStates()
@@ -483,6 +588,7 @@ void tst_QWebEnginePage::pasteImage()
QByteArray data = evaluateJavaScriptSync(page, "window.myImageDataURL").toByteArray();
data.remove(0, data.indexOf(";base64,") + 8);
QImage image = QImage::fromData(QByteArray::fromBase64(data), "PNG");
+ image.setColorSpace(origImage.colorSpace());
if (image.format() == QImage::Format_RGB32)
image.reinterpretAsFormat(QImage::Format_ARGB32);
QCOMPARE(image, origImage);
@@ -493,7 +599,7 @@ class ConsolePage : public QWebEnginePage
public:
ConsolePage(QObject* parent = 0) : QWebEnginePage(parent) {}
- virtual void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString& message, int lineNumber, const QString& sourceID)
+ void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString& message, int lineNumber, const QString& sourceID) override
{
levels.append(level);
messages.append(message);
@@ -512,42 +618,28 @@ void tst_QWebEnginePage::consoleOutput()
ConsolePage page;
// We don't care about the result but want this to be synchronous
evaluateJavaScriptSync(&page, "this is not valid JavaScript");
- QCOMPARE(page.messages.count(), 1);
+ QCOMPARE(page.messages.size(), 1);
QCOMPARE(page.lineNumbers.at(0), 1);
}
class TestPage : public QWebEnginePage {
Q_OBJECT
public:
- TestPage(QObject* parent = 0) : QWebEnginePage(parent)
+ TestPage(QObject *parent = nullptr, QWebEngineProfile *profile = nullptr) : QWebEnginePage(profile, parent)
{
- connect(this, SIGNAL(geometryChangeRequested(QRect)), this, SLOT(slotGeometryChangeRequested(QRect)));
+ connect(this, &QWebEnginePage::geometryChangeRequested, this, &TestPage::slotGeometryChangeRequested);
+ connect(this, &QWebEnginePage::navigationRequested, this, &TestPage::slotNavigationRequested);
+ connect(this, &QWebEnginePage::newWindowRequested, this, &TestPage::slotNewWindowRequested);
}
struct Navigation {
- NavigationType type;
+ QWebEngineNavigationRequest::NavigationType type;
QUrl url;
bool isMainFrame;
};
QList<Navigation> navigations;
- virtual bool acceptNavigationRequest(const QUrl &url, NavigationType type, bool isMainFrame)
- {
- Navigation n;
- n.url = url;
- n.type = type;
- n.isMainFrame = isMainFrame;
- navigations.append(n);
- return true;
- }
-
QList<TestPage*> createdWindows;
- virtual QWebEnginePage* createWindow(WebWindowType) {
- TestPage* page = new TestPage(this);
- createdWindows.append(page);
- emit windowCreated();
- return page;
- }
QRect requestedGeometry;
@@ -555,7 +647,25 @@ signals:
void windowCreated();
private Q_SLOTS:
- void slotGeometryChangeRequested(const QRect& geom) {
+ void slotNavigationRequested(QWebEngineNavigationRequest &request)
+ {
+ Navigation n;
+ n.url = request.url();
+ n.type = request.navigationType();
+ n.isMainFrame = request.isMainFrame();
+ navigations.append(n);
+ request.accept();
+ }
+ void slotNewWindowRequested(QWebEngineNewWindowRequest &request)
+ {
+ TestPage *page = new TestPage(this, profile());
+ createdWindows.append(page);
+ emit windowCreated();
+ request.openIn(page);
+ }
+
+ void slotGeometryChangeRequested(const QRect &geom)
+ {
requestedGeometry = geom;
}
};
@@ -567,65 +677,127 @@ void tst_QWebEnginePage::acceptNavigationRequestNavigationType()
QSignalSpy loadSpy(&page, SIGNAL(loadFinished(bool)));
page.load(QUrl("qrc:///resources/script.html"));
- QTRY_COMPARE_WITH_TIMEOUT(loadSpy.count(), 1, 20000);
- QTRY_COMPARE(page.navigations.count(), 1);
+ QTRY_COMPARE_WITH_TIMEOUT(loadSpy.size(), 1, 20000);
+ QTRY_COMPARE(page.navigations.size(), 1);
page.load(QUrl("qrc:///resources/content.html"));
- QTRY_COMPARE_WITH_TIMEOUT(loadSpy.count(), 2, 20000);
- QTRY_COMPARE(page.navigations.count(), 2);
+ QTRY_COMPARE_WITH_TIMEOUT(loadSpy.size(), 2, 20000);
+ QTRY_COMPARE(page.navigations.size(), 2);
page.triggerAction(QWebEnginePage::Stop);
QVERIFY(page.history()->canGoBack());
page.triggerAction(QWebEnginePage::Back);
- QTRY_COMPARE(loadSpy.count(), 3);
- QTRY_COMPARE(page.navigations.count(), 3);
+ QTRY_COMPARE(loadSpy.size(), 3);
+ QTRY_COMPARE(page.navigations.size(), 3);
page.triggerAction(QWebEnginePage::Reload);
- QTRY_COMPARE(loadSpy.count(), 4);
- QTRY_COMPARE(page.navigations.count(), 4);
+ QTRY_COMPARE(loadSpy.size(), 4);
+ QTRY_COMPARE(page.navigations.size(), 4);
+
+ QList<QWebEngineNavigationRequest::NavigationType> expectedList;
+ expectedList << QWebEngineNavigationRequest::TypedNavigation
+ << QWebEngineNavigationRequest::TypedNavigation
+ << QWebEngineNavigationRequest::BackForwardNavigation
+ << QWebEngineNavigationRequest::ReloadNavigation;
+ // client side redirect
page.load(QUrl("qrc:///resources/reload.html"));
- QTRY_COMPARE_WITH_TIMEOUT(loadSpy.count(), 6, 20000);
- QTRY_COMPARE(page.navigations.count(), 6);
-
- QList<QWebEnginePage::NavigationType> expectedList;
- expectedList << QWebEnginePage::NavigationTypeTyped
- << QWebEnginePage::NavigationTypeTyped
- << QWebEnginePage::NavigationTypeBackForward
- << QWebEnginePage::NavigationTypeReload
- << QWebEnginePage::NavigationTypeTyped
- << QWebEnginePage::NavigationTypeRedirect;
- QVERIFY(expectedList.count() == page.navigations.count());
- for (int i = 0; i < expectedList.count(); ++i) {
+ QTRY_COMPARE_WITH_TIMEOUT(loadSpy.size(), 6, 20000);
+ QTRY_COMPARE(page.navigations.size(), 6);
+ expectedList += { QWebEngineNavigationRequest::TypedNavigation, QWebEngineNavigationRequest::RedirectNavigation };
+
+
+ page.load(QUrl("qrc:///resources/redirect.html"));
+ QTRY_COMPARE_WITH_TIMEOUT(loadSpy.size(), 7, 20000);
+ QTRY_COMPARE(page.navigations.size(), 8);
+ expectedList += { QWebEngineNavigationRequest::TypedNavigation, QWebEngineNavigationRequest::RedirectNavigation };
+
+ // server side redirect
+ HttpServer server;
+ server.setResourceDirs({ ":/resources" });
+ connect(&server, &HttpServer::newRequest, &server, [&] (HttpReqRep *r) {
+ if (r->requestMethod() == "GET") {
+ if (r->requestPath() == "/redirect1.html") {
+ r->setResponseHeader("Location", server.url("/redirect2.html").toEncoded());
+ r->setResponseBody("<html><body>Redirect1</body></html>");
+ r->sendResponse(307); // Internal server redirect
+ } else if (r->requestPath() == "/redirect2.html") {
+ r->setResponseHeader("Location", server.url("/content.html").toEncoded());
+ r->setResponseBody("<html><body>Redirect2</body></html>");
+ r->sendResponse(301); // Moved permanently
+ }
+ }
+ });
+ QVERIFY(server.start());
+ page.load(QUrl(server.url("/redirect1.html")));
+ QTRY_COMPARE_WITH_TIMEOUT(loadSpy.size(), 8, 20000);
+ expectedList += {
+ QWebEngineNavigationRequest::TypedNavigation,
+ QWebEngineNavigationRequest::RedirectNavigation,
+ QWebEngineNavigationRequest::RedirectNavigation
+ };
+
+ for (int i = 0; i < expectedList.size(); ++i) {
+ QTRY_VERIFY(i < page.navigations.size());
QCOMPARE(page.navigations[i].type, expectedList[i]);
}
+ QVERIFY(expectedList.size() == page.navigations.size());
}
-void tst_QWebEnginePage::popupFormSubmission()
+// Relative url without base url.
+//
+// See also: QTBUG-48435
+void tst_QWebEnginePage::acceptNavigationRequestRelativeToNothing()
{
TestPage page;
+ QSignalSpy loadSpy(&page, SIGNAL(loadFinished(bool)));
+
+ page.setHtml(QString("<html><body><a id='link' href='S0'>limited time offer</a></body></html>"),
+ /* baseUrl: */ QUrl());
+ QTRY_COMPARE_WITH_TIMEOUT(loadSpy.size(), 1, 20000);
+ page.runJavaScript(QStringLiteral("document.getElementById(\"link\").click()"));
+ QTRY_COMPARE_WITH_TIMEOUT(loadSpy.size(), 2, 20000);
+ page.setHtml(QString("<html><body><a id='link' href='S0'>limited time offer</a></body></html>"),
+ /* baseUrl: */ QString("qrc:/"));
+ QTRY_COMPARE_WITH_TIMEOUT(loadSpy.size(), 3, 20000);
+ page.runJavaScript(QStringLiteral("document.getElementById(\"link\").click()"));
+ QTRY_COMPARE_WITH_TIMEOUT(loadSpy.size(), 4, 20000);
+
+ // The two setHtml and the second click are counted, while the
+ // first click is ignored due to the empty base url.
+ QCOMPARE(page.navigations.size(), 3);
+ QCOMPARE(page.navigations[0].type, QWebEngineNavigationRequest::TypedNavigation);
+ QCOMPARE(page.navigations[1].type, QWebEngineNavigationRequest::TypedNavigation);
+ QCOMPARE(page.navigations[2].type, QWebEngineNavigationRequest::LinkClickedNavigation);
+ QCOMPARE(page.navigations[2].url, QUrl(QString("qrc:/S0")));
+}
+
+void tst_QWebEnginePage::popupFormSubmission()
+{
+ QWebEngineProfile profile;
+ profile.installUrlSchemeHandler("echo", new EchoingUrlSchemeHandler(&profile));
+ TestPage page(nullptr, &profile);
QSignalSpy loadFinishedSpy(&page, SIGNAL(loadFinished(bool)));
QSignalSpy windowCreatedSpy(&page, SIGNAL(windowCreated()));
page.settings()->setAttribute(QWebEngineSettings::JavascriptCanOpenWindows, true);
page.setHtml("<form name='form1' method=get action='' target='myNewWin'>"
" <input type='hidden' name='foo' value='bar'>"
- "</form>");
- QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.count(), 1, 20000);
+ "</form>", QUrl("echo:"));
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size(), 1, 20000);
page.runJavaScript("window.open('', 'myNewWin', 'width=500,height=300,toolbar=0');");
evaluateJavaScriptSync(&page, "document.form1.submit();");
- QTRY_COMPARE(windowCreatedSpy.count(), 1);
+ QTRY_COMPARE(windowCreatedSpy.size(), 1);
// The number of popup created should be one.
QVERIFY(page.createdWindows.size() == 1);
QTRY_VERIFY(!page.createdWindows[0]->url().isEmpty());
- QString url = page.createdWindows[0]->url().toString();
// Check if the form submission was OK.
- QVERIFY(url.contains("?foo=bar"));
+ QTRY_VERIFY(page.createdWindows[0]->url().toString().contains("?foo=bar"));
}
class TestNetworkManager : public QNetworkAccessManager
@@ -637,7 +809,8 @@ public:
QList<QNetworkRequest> requests;
protected:
- virtual QNetworkReply* createRequest(Operation op, const QNetworkRequest &request, QIODevice* outgoingData) {
+ QNetworkReply* createRequest(Operation op, const QNetworkRequest &request, QIODevice* outgoingData) override
+ {
requests.append(request);
requestedUrls.append(request.url());
return QNetworkAccessManager::createRequest(op, request, outgoingData);
@@ -665,16 +838,16 @@ void tst_QWebEnginePage::multipleProfilesAndLocalStorage()
page1.setHtml(QString("<html><body> </body></html>"), QUrl("http://wwww.example.com"));
page2.setHtml(QString("<html><body> </body></html>"), QUrl("http://wwww.example.com"));
- QTRY_COMPARE_WITH_TIMEOUT(loadSpy1.count(), 1, 20000);
- QTRY_COMPARE_WITH_TIMEOUT(loadSpy2.count(), 1, 20000);
+ QTRY_COMPARE_WITH_TIMEOUT(loadSpy1.size(), 1, 20000);
+ QTRY_COMPARE_WITH_TIMEOUT(loadSpy2.size(), 1, 20000);
evaluateJavaScriptSync(&page1, "localStorage.setItem('test', 'value1');");
evaluateJavaScriptSync(&page2, "localStorage.setItem('test', 'value2');");
page1.setHtml(QString("<html><body> </body></html>"), QUrl("http://wwww.example.com"));
page2.setHtml(QString("<html><body> </body></html>"), QUrl("http://wwww.example.com"));
- QTRY_COMPARE(loadSpy1.count(), 2);
- QTRY_COMPARE(loadSpy2.count(), 2);
+ QTRY_COMPARE(loadSpy1.size(), 2);
+ QTRY_COMPARE(loadSpy2.size(), 2);
QVariant s1 = evaluateJavaScriptSync(&page1, "localStorage.getItem('test')");
QCOMPARE(s1.toString(), QString("value1"));
@@ -723,7 +896,7 @@ void tst_QWebEnginePage::textSelection()
QSignalSpy loadSpy(&page, SIGNAL(loadFinished(bool)));
page.setHtml(content);
- QTRY_COMPARE_WITH_TIMEOUT(loadSpy.count(), 1, 20000);
+ QTRY_COMPARE_WITH_TIMEOUT(loadSpy.size(), 1, 20000);
// these actions must exist
QVERIFY(page.action(QWebEnginePage::SelectAll) != 0);
@@ -750,7 +923,7 @@ void tst_QWebEnginePage::textSelection()
// navigate away and check that selection is cleared
page.load(QUrl("about:blank"));
- QTRY_COMPARE(loadSpy.count(), 2);
+ QTRY_COMPARE(loadSpy.size(), 2);
QVERIFY(!page.hasSelection());
QVERIFY(page.selectedText().isEmpty());
@@ -771,7 +944,7 @@ void tst_QWebEnginePage::backActionUpdate()
QVERIFY(!action->isEnabled());
page->load(QUrl("qrc:///resources/framedindex.html"));
- QTRY_COMPARE_WITH_TIMEOUT(loadSpy.count(), 1, 20000);
+ QTRY_COMPARE_WITH_TIMEOUT(loadSpy.size(), 1, 20000);
QVERIFY(!action->isEnabled());
auto firstAnchorCenterInFrame = [](QWebEnginePage *page, const QString &frameName) {
@@ -783,7 +956,7 @@ void tst_QWebEnginePage::backActionUpdate()
"return [(rect.left + rect.right) / 2, (rect.top + rect.bottom) / 2];"
"})()").toList();
- if (rectList.count() != 2) {
+ if (rectList.size() != 2) {
qWarning("firstAnchorCenterInFrame failed.");
return QPoint();
}
@@ -810,8 +983,8 @@ void tst_QWebEnginePage::localStorageVisibility()
QSignalSpy loadSpy2(&webPage2, &QWebEnginePage::loadFinished);
webPage1.setHtml(QString("<html><body>test</body></html>"), QUrl("http://www.example.com/"));
webPage2.setHtml(QString("<html><body>test</body></html>"), QUrl("http://www.example.com/"));
- QTRY_COMPARE_WITH_TIMEOUT(loadSpy1.count(), 1, 20000);
- QTRY_COMPARE_WITH_TIMEOUT(loadSpy2.count(), 1, 20000);
+ QTRY_COMPARE_WITH_TIMEOUT(loadSpy1.size(), 1, 20000);
+ QTRY_COMPARE_WITH_TIMEOUT(loadSpy2.size(), 1, 20000);
// The attribute determines the visibility of the window.localStorage object.
QVERIFY(evaluateJavaScriptSync(&webPage1, QString("(window.localStorage != undefined)")).toBool());
@@ -824,13 +997,14 @@ void tst_QWebEnginePage::localStorageVisibility()
// ...first check second page (for storage to appear) as applying settings is batched and done asynchronously
QTRY_VERIFY(evaluateJavaScriptSync(&webPage2, QString("(window.localStorage != undefined)")).toBool());
// Switching the feature off does not actively remove the object from webPage1.
- QVERIFY(evaluateJavaScriptSync(&webPage1, QString("(window.localStorage != undefined)")).toBool());
+// FIXME: 94-based: now it does
+// QVERIFY(evaluateJavaScriptSync(&webPage1, QString("(window.localStorage != undefined)")).toBool());
// The object disappears only after reloading.
webPage1.triggerAction(QWebEnginePage::Reload);
webPage2.triggerAction(QWebEnginePage::Reload);
- QTRY_COMPARE(loadSpy1.count(), 2);
- QTRY_COMPARE(loadSpy2.count(), 2);
+ QTRY_COMPARE(loadSpy1.size(), 2);
+ QTRY_COMPARE(loadSpy2.size(), 2);
QVERIFY(!evaluateJavaScriptSync(&webPage1, QString("(window.localStorage != undefined)")).toBool());
QVERIFY(evaluateJavaScriptSync(&webPage2, QString("(window.localStorage != undefined)")).toBool());
}
@@ -904,7 +1078,7 @@ public:
JSPromptPage()
{}
- bool javaScriptPrompt(const QUrl &securityOrigin, const QString& msg, const QString& defaultValue, QString* result)
+ bool javaScriptPrompt(const QUrl &securityOrigin, const QString& msg, const QString& defaultValue, QString* result) override
{
if (msg == QLatin1String("test1")) {
*result = QString();
@@ -931,7 +1105,7 @@ void tst_QWebEnginePage::testJSPrompt()
bool res;
QSignalSpy loadSpy(&page, SIGNAL(loadFinished(bool)));
page.setHtml(QStringLiteral("<html><body></body></html>"));
- QTRY_COMPARE_WITH_TIMEOUT(loadSpy.count(), 1, 20000);
+ QTRY_COMPARE_WITH_TIMEOUT(loadSpy.size(), 1, 20000);
// OK + QString()
res = evaluateJavaScriptSync(&page,
@@ -965,7 +1139,7 @@ void tst_QWebEnginePage::findText()
// Showing is required, otherwise all find operations fail.
m_view->show();
- QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE(loadSpy.size(), 1);
// Select whole page contents.
QTRY_VERIFY(m_view->page()->action(QWebEnginePage::SelectAll)->isEnabled());
@@ -975,22 +1149,22 @@ void tst_QWebEnginePage::findText()
// Invoking a stopFinding operation will not change or clear the currently selected text,
// if nothing was found beforehand.
{
- CallbackSpy<bool> callbackSpy;
+ CallbackSpy<QWebEngineFindTextResult> callbackSpy;
QSignalSpy signalSpy(m_view->page(), &QWebEnginePage::findTextFinished);
m_view->findText("", {}, callbackSpy.ref());
QVERIFY(callbackSpy.wasCalled());
- QCOMPARE(signalSpy.count(), 1);
+ QCOMPARE(signalSpy.size(), 1);
QTRY_COMPARE(m_view->selectedText(), QString("foo bar"));
}
// Invoking a startFinding operation with text that won't be found, will clear the current
// selection.
{
- CallbackSpy<bool> callbackSpy;
+ CallbackSpy<QWebEngineFindTextResult> callbackSpy;
QSignalSpy signalSpy(m_view->page(), &QWebEnginePage::findTextFinished);
m_view->findText("Will not be found", {}, callbackSpy.ref());
- QCOMPARE(callbackSpy.waitForResult(), false);
- QTRY_COMPARE(signalSpy.count(), 1);
+ QCOMPARE(callbackSpy.waitForResult().numberOfMatches(), 0);
+ QTRY_COMPARE(signalSpy.size(), 1);
auto result = signalSpy.takeFirst().value(0).value<QWebEngineFindTextResult>();
QCOMPARE(result.numberOfMatches(), 0);
QTRY_VERIFY(m_view->selectedText().isEmpty());
@@ -1003,22 +1177,22 @@ void tst_QWebEnginePage::findText()
// Invoking a startFinding operation with text that will be found, will clear the current
// selection as well.
{
- CallbackSpy<bool> callbackSpy;
+ CallbackSpy<QWebEngineFindTextResult> callbackSpy;
QSignalSpy signalSpy(m_view->page(), &QWebEnginePage::findTextFinished);
m_view->findText("foo", {}, callbackSpy.ref());
- QVERIFY(callbackSpy.waitForResult());
- QTRY_COMPARE(signalSpy.count(), 1);
+ QVERIFY(callbackSpy.waitForResult().numberOfMatches() > 0);
+ QTRY_COMPARE(signalSpy.size(), 1);
QTRY_VERIFY(m_view->selectedText().isEmpty());
}
// Invoking a stopFinding operation after text was found, will set the selected text to the
// found text.
{
- CallbackSpy<bool> callbackSpy;
+ CallbackSpy<QWebEngineFindTextResult> callbackSpy;
QSignalSpy signalSpy(m_view->page(), &QWebEnginePage::findTextFinished);
m_view->findText("", {}, callbackSpy.ref());
QTRY_VERIFY(callbackSpy.wasCalled());
- QTRY_COMPARE(signalSpy.count(), 1);
+ QTRY_COMPARE(signalSpy.size(), 1);
QTRY_COMPARE(m_view->selectedText(), QString("foo"));
}
@@ -1028,7 +1202,7 @@ void tst_QWebEnginePage::findText()
QSignalSpy signalSpy(m_view->page(), &QWebEnginePage::findTextFinished);
m_view->findText("foo", {});
m_view->findText("foo", {});
- QTRY_COMPARE(signalSpy.count(), 2);
+ QTRY_COMPARE(signalSpy.size(), 2);
QTRY_VERIFY(m_view->selectedText().isEmpty());
QCOMPARE(signalSpy.at(0).value(0).value<QWebEngineFindTextResult>().numberOfMatches(), 0);
@@ -1039,11 +1213,11 @@ void tst_QWebEnginePage::findText()
void tst_QWebEnginePage::findTextResult()
{
QSignalSpy findTextSpy(m_view->page(), &QWebEnginePage::findTextFinished);
- auto signalResult = [&findTextSpy]() -> QVector<int> {
- if (findTextSpy.count() != 1)
- return QVector<int>({-1, -1});
+ auto signalResult = [&findTextSpy]() -> QList<int> {
+ if (findTextSpy.size() != 1)
+ return QList<int>({-1, -1});
auto r = findTextSpy.takeFirst().value(0).value<QWebEngineFindTextResult>();
- return QVector<int>({ r.numberOfMatches(), r.activeMatch() });
+ return QList<int>({ r.numberOfMatches(), r.activeMatch() });
};
// findText will abort in blink if the view has an empty size.
@@ -1052,36 +1226,36 @@ void tst_QWebEnginePage::findTextResult()
QSignalSpy loadSpy(m_view, SIGNAL(loadFinished(bool)));
m_view->setHtml(QString("<html><head></head><body><div>foo bar</div></body></html>"));
- QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE(loadSpy.size(), 1);
QCOMPARE(findTextSync(m_page, ""), false);
- QCOMPARE(signalResult(), QVector<int>({0, 0}));
+ QCOMPARE(signalResult(), QList<int>({0, 0}));
const QStringList words = { "foo", "bar" };
for (const QString &subString : words) {
QCOMPARE(findTextSync(m_page, subString), true);
- QCOMPARE(signalResult(), QVector<int>({1, 1}));
+ QCOMPARE(signalResult(), QList<int>({1, 1}));
QCOMPARE(findTextSync(m_page, ""), false);
- QCOMPARE(signalResult(), QVector<int>({0, 0}));
+ QCOMPARE(signalResult(), QList<int>({0, 0}));
}
QCOMPARE(findTextSync(m_page, "blahhh"), false);
- QCOMPARE(signalResult(), QVector<int>({0, 0}));
+ QCOMPARE(signalResult(), QList<int>({0, 0}));
QCOMPARE(findTextSync(m_page, ""), false);
- QCOMPARE(signalResult(), QVector<int>({0, 0}));
+ QCOMPARE(signalResult(), QList<int>({0, 0}));
}
void tst_QWebEnginePage::findTextSuccessiveShouldCallAllCallbacks()
{
- CallbackSpy<bool> spy1;
- CallbackSpy<bool> spy2;
- CallbackSpy<bool> spy3;
- CallbackSpy<bool> spy4;
- CallbackSpy<bool> spy5;
+ CallbackSpy<QWebEngineFindTextResult> spy1;
+ CallbackSpy<QWebEngineFindTextResult> spy2;
+ CallbackSpy<QWebEngineFindTextResult> spy3;
+ CallbackSpy<QWebEngineFindTextResult> spy4;
+ CallbackSpy<QWebEngineFindTextResult> spy5;
QSignalSpy loadSpy(m_view, SIGNAL(loadFinished(bool)));
m_view->setHtml(QString("<html><head></head><body><div>abcdefg abcdefg abcdefg abcdefg abcdefg</div></body></html>"));
- QTRY_COMPARE_WITH_TIMEOUT(loadSpy.count(), 1, 20000);
+ QTRY_COMPARE_WITH_TIMEOUT(loadSpy.size(), 1, 20000);
m_page->findText("abcde", {}, spy1.ref());
m_page->findText("abcd", {}, spy2.ref());
m_page->findText("abc", {}, spy3.ref());
@@ -1103,15 +1277,15 @@ void tst_QWebEnginePage::findTextCalledOnMatch()
m_view->resize(800, 600);
m_view->show();
m_view->setHtml(QString("<html><head></head><body><div>foo bar</div></body></html>"));
- QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE(loadSpy.size(), 1);
// CALLBACK
bool callbackCalled = false;
- m_view->page()->findText("foo", {}, [this, &callbackCalled](bool found) {
- QVERIFY(found);
+ m_view->page()->findText("foo", {}, [this, &callbackCalled](QWebEngineFindTextResult result) {
+ QVERIFY(result.numberOfMatches());
- m_view->page()->findText("bar", {}, [&callbackCalled](bool found) {
- QVERIFY(found);
+ m_view->page()->findText("bar", {}, [&callbackCalled](QWebEngineFindTextResult result) {
+ QVERIFY(result.numberOfMatches());
callbackCalled = true;
});
});
@@ -1140,12 +1314,12 @@ void tst_QWebEnginePage::findTextActiveMatchOrdinal()
m_view->resize(800, 600);
m_view->show();
m_view->setHtml(QString("<html><head></head><body><div>foo bar foo bar foo</div></body></html>"));
- QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE(loadSpy.size(), 1);
// Iterate over all "foo" matches.
for (int i = 1; i <= 3; ++i) {
m_view->page()->findText("foo", {});
- QTRY_COMPARE(findTextSpy.count(), 1);
+ QTRY_COMPARE(findTextSpy.size(), 1);
result = findTextSpy.takeFirst().value(0).value<QWebEngineFindTextResult>();
QCOMPARE(result.numberOfMatches(), 3);
QCOMPARE(result.activeMatch(), i);
@@ -1153,28 +1327,28 @@ void tst_QWebEnginePage::findTextActiveMatchOrdinal()
// The last match is followed by the fist one.
m_view->page()->findText("foo", {});
- QTRY_COMPARE(findTextSpy.count(), 1);
+ QTRY_COMPARE(findTextSpy.size(), 1);
result = findTextSpy.takeFirst().value(0).value<QWebEngineFindTextResult>();
QCOMPARE(result.numberOfMatches(), 3);
QCOMPARE(result.activeMatch(), 1);
// The first match is preceded by the last one.
m_view->page()->findText("foo", QWebEnginePage::FindBackward);
- QTRY_COMPARE(findTextSpy.count(), 1);
+ QTRY_COMPARE(findTextSpy.size(), 1);
result = findTextSpy.takeFirst().value(0).value<QWebEngineFindTextResult>();
QCOMPARE(result.numberOfMatches(), 3);
QCOMPARE(result.activeMatch(), 3);
// Finding another word resets the activeMatch.
m_view->page()->findText("bar", {});
- QTRY_COMPARE(findTextSpy.count(), 1);
+ QTRY_COMPARE(findTextSpy.size(), 1);
result = findTextSpy.takeFirst().value(0).value<QWebEngineFindTextResult>();
QCOMPARE(result.numberOfMatches(), 2);
QCOMPARE(result.activeMatch(), 1);
// If no match activeMatch is 0.
m_view->page()->findText("bla", {});
- QTRY_COMPARE(findTextSpy.count(), 1);
+ QTRY_COMPARE(findTextSpy.size(), 1);
result = findTextSpy.takeFirst().value(0).value<QWebEngineFindTextResult>();
QCOMPARE(result.numberOfMatches(), 0);
QCOMPARE(result.activeMatch(), 0);
@@ -1184,45 +1358,60 @@ static QWindow *findNewTopLevelWindow(const QWindowList &oldTopLevelWindows)
{
const auto tlws = QGuiApplication::topLevelWindows();
for (auto w : tlws) {
- if (!oldTopLevelWindows.contains(w)) {
+ // note 'offscreen' window is a top-level window
+ if (!oldTopLevelWindows.contains(w)
+ && !QQuickRenderControl::renderWindowFor(qobject_cast<QQuickWindow *>(w))) {
return w;
}
}
return nullptr;
}
+void tst_QWebEnginePage::comboBoxPopupPositionAfterMove_data()
+{
+ QTest::addColumn<bool>("withTouch");
+ QTest::addRow("mouse") << false;
+ QTest::addRow("touch") << true;
+}
+
void tst_QWebEnginePage::comboBoxPopupPositionAfterMove()
{
+#if defined(Q_OS_MACOS) && (defined(__arm64__) || defined(__aarch64__))
+ QSKIP("This test crashes for Apple M1");
+#endif
QWebEngineView view;
+ QTRY_VERIFY(QGuiApplication::primaryScreen());
view.move(QGuiApplication::primaryScreen()->availableGeometry().topLeft());
view.resize(640, 480);
view.show();
-
- QSignalSpy loadSpy(&view, SIGNAL(loadFinished(bool)));
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QSignalSpy spyLoadFinished(&view, SIGNAL(loadFinished(bool)));
view.setHtml(QLatin1String("<html><head></head><body><select id='foo'>"
"<option>fran</option><option>troz</option>"
"</select></body></html>"));
- QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE(spyLoadFinished.size(), 1);
const auto oldTlws = QGuiApplication::topLevelWindows();
- QWindow *window = view.windowHandle();
- QTest::mouseClick(window, Qt::LeftButton, Qt::KeyboardModifiers(),
- elementCenter(view.page(), "foo"));
-
+ QFETCH(bool, withTouch);
+ QPointer<QWindow> window = view.windowHandle();
+ auto pos = elementCenter(view.page(), "foo");
+ makeClick(window, withTouch, pos);
QWindow *popup = nullptr;
- QTRY_VERIFY(popup = findNewTopLevelWindow(oldTlws));
+ QTRY_VERIFY((popup = findNewTopLevelWindow(oldTlws)));
+ QVERIFY(QTest::qWaitForWindowExposed(popup));
+ QTRY_VERIFY(popup->width() > 0 && popup->height() > 0);
QTRY_VERIFY(QGuiApplication::topLevelWindows().contains(popup));
QTRY_VERIFY(!popup->position().isNull());
QPoint popupPos = popup->position();
-
+ QPointer<QWindow> pw(popup);
// Close the popup by clicking somewhere into the page.
- QTest::mouseClick(window, Qt::LeftButton, Qt::KeyboardModifiers(), QPoint(1, 1));
+ makeClick(window, withTouch, QPoint(1, 1));
QTRY_VERIFY(!QGuiApplication::topLevelWindows().contains(popup));
-
+ QTRY_VERIFY(!pw);
auto jsViewPosition = [&view]() {
QLatin1String script("(function() { return [window.screenX, window.screenY]; })()");
QVariantList posList = evaluateJavaScriptSync(view.page(), script).toList();
- if (posList.count() != 2) {
+ if (posList.size() != 2) {
qWarning("jsViewPosition failed.");
return QPoint();
}
@@ -1234,18 +1423,28 @@ void tst_QWebEnginePage::comboBoxPopupPositionAfterMove()
const QPoint offset(12, 13);
view.move(view.pos() + offset);
QTRY_COMPARE(jsViewPosition(), view.pos());
- QTest::mouseClick(window, Qt::LeftButton, Qt::KeyboardModifiers(),
- elementCenter(view.page(), "foo"));
- QTRY_VERIFY(popup = findNewTopLevelWindow(oldTlws));
+ makeClick(window, withTouch, elementCenter(view.page(), "foo"));
+ QTRY_VERIFY((popup = findNewTopLevelWindow(oldTlws)));
+ QTRY_VERIFY(popup->width() > 0 && popup->height() > 0);
QTRY_VERIFY(QGuiApplication::topLevelWindows().contains(popup));
QTRY_VERIFY(!popup->position().isNull());
QCOMPARE(popupPos + offset, popup->position());
- QTest::mouseClick(window, Qt::LeftButton, Qt::KeyboardModifiers(), QPoint(1, 1));
+ makeClick(window, withTouch, QPoint(1, 1));
QTRY_VERIFY(!QGuiApplication::topLevelWindows().contains(popup));
}
+void tst_QWebEnginePage::comboBoxPopupPositionAfterChildMove_data()
+{
+ QTest::addColumn<bool>("withTouch");
+ QTest::addRow("mouse") << false;
+ QTest::addRow("touch") << true;
+}
+
void tst_QWebEnginePage::comboBoxPopupPositionAfterChildMove()
{
+#if defined(Q_OS_MACOS) && (defined(__arm64__) || defined(__aarch64__))
+ QSKIP("This test crashes for Apple M1");
+#endif
QWidget mainWidget;
mainWidget.setLayout(new QHBoxLayout);
@@ -1256,29 +1455,33 @@ void tst_QWebEnginePage::comboBoxPopupPositionAfterChildMove()
mainWidget.layout()->addWidget(&view);
QScreen *screen = QGuiApplication::primaryScreen();
+ Q_ASSERT(screen);
mainWidget.move(screen->availableGeometry().topLeft());
mainWidget.resize(640, 480);
mainWidget.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&mainWidget));
QSignalSpy loadSpy(&view, SIGNAL(loadFinished(bool)));
view.setHtml(QLatin1String("<html><head></head><body><select autofocus id='foo'>"
"<option value=\"narf\">narf</option><option>zort</option>"
"</select></body></html>"));
- QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE(loadSpy.size(), 1);
const auto oldTlws = QGuiApplication::topLevelWindows();
- QWindow *window = view.window()->windowHandle();
- QTest::mouseClick(window, Qt::LeftButton, Qt::KeyboardModifiers(),
- view.mapTo(view.window(), elementCenter(view.page(), "foo")));
+
+ QFETCH(bool, withTouch);
+ QPointer<QWindow> window = view.window()->windowHandle();
+ makeClick(window, withTouch, view.mapTo(view.window(), elementCenter(view.page(), "foo")));
QWindow *popup = nullptr;
- QTRY_VERIFY(popup = findNewTopLevelWindow(oldTlws));
+ QTRY_VERIFY((popup = findNewTopLevelWindow(oldTlws)));
+ QVERIFY(QTest::qWaitForWindowExposed(popup));
+ QTRY_VERIFY(popup->width() > 0 && popup->height() > 0);
QTRY_VERIFY(QGuiApplication::topLevelWindows().contains(popup));
QTRY_VERIFY(!popup->position().isNull());
QPoint popupPos = popup->position();
// Close the popup by clicking somewhere into the page.
- QTest::mouseClick(window, Qt::LeftButton, Qt::KeyboardModifiers(),
- view.mapTo(view.window(), QPoint(1, 1)));
+ makeClick(window, withTouch, view.mapTo(view.window(), QPoint(1, 1)));
QTRY_VERIFY(!QGuiApplication::topLevelWindows().contains(popup));
int originalViewWidth = view.size().width();
@@ -1288,19 +1491,25 @@ void tst_QWebEnginePage::comboBoxPopupPositionAfterChildMove()
return viewWidth;
};
+ QCOMPARE(jsViewWidth(), originalViewWidth);
+
// Resize the "spacer" widget, and implicitly change the global position of the QWebEngineView.
const int offset = 50;
spacer.setMinimumWidth(spacer.size().width() + offset);
+
QTRY_COMPARE(jsViewWidth(), originalViewWidth - offset);
- QTest::mouseClick(window, Qt::LeftButton, Qt::KeyboardModifiers(),
- view.mapTo(view.window(), elementCenter(view.page(), "foo")));
- QTRY_VERIFY(popup = findNewTopLevelWindow(oldTlws));
+ makeClick(window, withTouch, view.mapTo(view.window(), elementCenter(view.page(), "foo")));
+ QTRY_VERIFY((popup = findNewTopLevelWindow(oldTlws)));
+ QVERIFY(QTest::qWaitForWindowExposed(popup));
+ QTRY_VERIFY(popup->width() > 0 && popup->height() > 0);
QTRY_VERIFY(!popup->position().isNull());
- QCOMPARE(popupPos + QPoint(50, 0), popup->position());
+ QCOMPARE(popupPos + QPoint(offset, 0), popup->position());
+ makeClick(window, withTouch, QPoint(1, 1));
+ QTRY_VERIFY(!QGuiApplication::topLevelWindows().contains(popup));
}
-#ifdef Q_OS_MAC
+#ifdef Q_OS_MACOS
void tst_QWebEnginePage::macCopyUnicodeToClipboard()
{
QString unicodeText = QString::fromUtf8("αβγδεζηθικλμπ");
@@ -1328,6 +1537,8 @@ void tst_QWebEnginePage::deleteQWebEngineViewTwice()
}
}
+// TODO: Reimplement test without QStateMachine or add qtscxml module dependency
+#if defined(QT_STATEMACHINE_LIB)
class SpyForLoadSignalsOrder : public QStateMachine {
Q_OBJECT
public:
@@ -1385,6 +1596,7 @@ void tst_QWebEnginePage::loadSignalsOrder()
page.load(url);
QTRY_VERIFY_WITH_TIMEOUT(loadSpy.isFinished(), 20000);
}
+#endif // defined(QT_STATEMACHINE_LIB)
void tst_QWebEnginePage::renderWidgetHostViewNotShowTopLevel()
{
@@ -1651,9 +1863,9 @@ void tst_QWebEnginePage::savePage()
QWebEnginePage *page = view.page();
connect(page->profile(), &QWebEngineProfile::downloadRequested,
- [] (QWebEngineDownloadItem *item)
+ [] (QWebEngineDownloadRequest *item)
{
- connect(item, &QWebEngineDownloadItem::finished,
+ connect(item, &QWebEngineDownloadRequest::isFinishedChanged,
&QTestEventLoop::instance(), &QTestEventLoop::exitLoop, Qt::QueuedConnection);
});
@@ -1667,7 +1879,7 @@ void tst_QWebEnginePage::savePage()
// Save the loaded page as HTML.
QTemporaryDir tempDir(QDir::tempPath() + "/tst_qwebengineview-XXXXXX");
const QString filePath = tempDir.path() + "/thingumbob.html";
- page->save(filePath, QWebEngineDownloadItem::CompleteHtmlSaveFormat);
+ page->save(filePath, QWebEngineDownloadRequest::CompleteHtmlSaveFormat);
QTestEventLoop::instance().enterLoop(10);
// Load something else.
@@ -1684,18 +1896,21 @@ void tst_QWebEnginePage::savePage()
void tst_QWebEnginePage::openWindowDefaultSize()
{
TestPage page;
+ QSignalSpy spyFinished(&page, &QWebEnginePage::loadFinished);
QSignalSpy windowCreatedSpy(&page, SIGNAL(windowCreated()));
QWebEngineView view;
- page.setView(&view);
+ view.setPage(&page);
+ page.settings()->setAttribute(QWebEngineSettings::JavascriptCanOpenWindows, true);
+ view.setUrl(QUrl("about:blank"));
view.show();
+ QTRY_COMPARE(spyFinished.size(), 1);
- page.settings()->setAttribute(QWebEngineSettings::JavascriptCanOpenWindows, true);
// Open a default window.
page.runJavaScript("window.open()");
- QTRY_COMPARE(windowCreatedSpy.count(), 1);
+ QTRY_COMPARE(windowCreatedSpy.size(), 1);
// Open a too small window.
evaluateJavaScriptSync(&page, "window.open('','about:blank','width=10,height=10')");
- QTRY_COMPARE(windowCreatedSpy.count(), 2);
+ QTRY_COMPARE(windowCreatedSpy.size(), 2);
// The number of popups created should be two.
QCOMPARE(page.createdWindows.size(), 2);
@@ -1766,7 +1981,7 @@ void tst_QWebEnginePage::runJavaScriptDisabled()
// Settings changes take effect asynchronously. The load and wait ensure
// that the settings are applied by the time we start to execute JavaScript.
page.load(QStringLiteral("about:blank"));
- QTRY_COMPARE_WITH_TIMEOUT(spy.count(), 1, 20000);
+ QTRY_COMPARE_WITH_TIMEOUT(spy.size(), 1, 20000);
QCOMPARE(evaluateJavaScriptSyncInWorld(&page, QStringLiteral("1+1"), QWebEngineScript::MainWorld),
QVariant());
QCOMPARE(evaluateJavaScriptSyncInWorld(&page, QStringLiteral("1+1"), QWebEngineScript::ApplicationWorld),
@@ -1783,7 +1998,7 @@ void tst_QWebEnginePage::runJavaScriptFromSlot()
page.setHtml("<html><body>"
" <input type='text' id='input1' value='QtWebEngine' size='50' />"
"</body></html>");
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
bool done = false;
connect(&page, &QWebEnginePage::selectionChanged, [&]() {
@@ -1800,13 +2015,14 @@ void tst_QWebEnginePage::fullScreenRequested()
{
QWebEngineView view;
QWebEnginePage* page = view.page();
+ view.resize(640, 480);
view.show();
page->settings()->setAttribute(QWebEngineSettings::FullScreenSupportEnabled, true);
QSignalSpy loadSpy(&view, SIGNAL(loadFinished(bool)));
page->load(QUrl("qrc:///resources/fullscreen.html"));
- QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE(loadSpy.size(), 1);
QTRY_VERIFY(isTrueJavaScriptResult(page, "document.webkitFullscreenEnabled"));
QVERIFY(isFalseJavaScriptResult(page, "document.webkitIsFullScreen"));
@@ -1820,6 +2036,13 @@ void tst_QWebEnginePage::fullScreenRequested()
QTest::keyPress(view.focusProxy(), Qt::Key_Space);
QTRY_VERIFY(isTrueJavaScriptResult(page, "document.webkitIsFullScreen"));
+
+ QTest::mouseMove(view.windowHandle(), QPoint(10,10));
+ QTest::mouseClick(view.windowHandle(), Qt::RightButton);
+ QTRY_COMPARE(view.findChildren<QMenu *>().size(), 1);
+ auto menu = view.findChildren<QMenu *>().first();
+ QVERIFY(menu->actions().contains(page->action(QWebEnginePage::ExitFullScreen)));
+
page->runJavaScript("document.webkitExitFullscreen()");
QTRY_VERIFY(isFalseJavaScriptResult(page, "document.webkitIsFullScreen"));
@@ -1830,8 +2053,18 @@ void tst_QWebEnginePage::fullScreenRequested()
QTRY_VERIFY(isFalseJavaScriptResult(page, "document.webkitIsFullScreen"));
}
-void tst_QWebEnginePage::quotaRequested()
+void tst_QWebEnginePage::requestQuota_data()
{
+ QTest::addColumn<QString>("storage");
+ QTest::addRow("webkitPersistentStorage") << "navigator.webkitPersistentStorage";
+ QTest::addRow("webkitTemporaryStorage") << "navigator.webkitTemporaryStorage";
+
+}
+
+void tst_QWebEnginePage::requestQuota()
+{
+ QFETCH(QString, storage);
+
ConsolePage page;
QWebEngineView view;
view.setPage(&page);
@@ -1839,35 +2072,23 @@ void tst_QWebEnginePage::quotaRequested()
page.load(QUrl("qrc:///resources/content.html"));
QVERIFY(loadFinishedSpy.wait());
- connect(&page, &QWebEnginePage::quotaRequested,
- [] (QWebEngineQuotaRequest request)
- {
- if (request.requestedSize() <= 5000)
- request.accept();
- else
- request.reject();
- });
-
- evaluateJavaScriptSync(&page,
- "navigator.webkitPersistentStorage.requestQuota(1024, function(grantedSize) {" \
- "console.log(grantedSize);" \
- "});");
- QTRY_COMPARE(page.messages.count(), 1);
+ evaluateJavaScriptSync(&page, QString(
+ "var storage = %1;"
+ "storage.requestQuota(1024, function(grantedSize) {"
+ " console.log(grantedSize);"
+ "});").arg(storage));
+ QTRY_COMPARE(page.messages.size(), 1);
QTRY_COMPARE(page.messages[0], QString("1024"));
- evaluateJavaScriptSync(&page,
- "navigator.webkitPersistentStorage.requestQuota(6000, function(grantedSize) {" \
- "console.log(grantedSize);" \
- "});");
- QTRY_COMPARE(page.messages.count(), 2);
- QTRY_COMPARE(page.messages[1], QString("1024"));
-
- evaluateJavaScriptSync(&page,
- "navigator.webkitPersistentStorage.queryUsageAndQuota(function(usedBytes, grantedBytes) {" \
- "console.log(usedBytes + ', ' + grantedBytes);" \
- "});");
- QTRY_COMPARE(page.messages.count(), 3);
- QTRY_COMPARE(page.messages[2], QString("0, 1024"));
+ evaluateJavaScriptSync(&page, QString(
+ "var storage = %1;"
+ "storage.queryUsageAndQuota(function(usedBytes, grantedBytes) {"
+ " console.log(usedBytes);"
+ " console.log(grantedBytes);"
+ "});").arg(storage));
+ QTRY_COMPARE(page.messages.size(), 3);
+ QTRY_COMPARE(page.messages[1], QString("0"));
+ QTRY_VERIFY(page.messages[2].toLongLong() >= 1024);
}
void tst_QWebEnginePage::symmetricUrl()
@@ -1882,13 +2103,14 @@ void tst_QWebEnginePage::symmetricUrl()
QUrl dataUrl("data:text/html,<h1>Test");
view.setUrl(dataUrl);
+ view.show();
QCOMPARE(view.url(), dataUrl);
QCOMPARE(view.history()->count(), 0);
// loading is _not_ immediate, so the text isn't set just yet.
QVERIFY(toPlainTextSync(view.page()).isEmpty());
- QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.count(), 1, 20000);
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size(), 1, 20000);
QCOMPARE(view.history()->count(), 1);
QCOMPARE(toPlainTextSync(view.page()), QString("Test"));
@@ -1902,8 +2124,8 @@ void tst_QWebEnginePage::symmetricUrl()
QCOMPARE(view.url(), dataUrl3);
// setUrl(dataUrl3) might override the pending load for dataUrl2. Or not.
- QTRY_VERIFY(loadFinishedSpy.count() >= 2);
- QTRY_VERIFY(loadFinishedSpy.count() <= 3);
+ QTRY_VERIFY(loadFinishedSpy.size() >= 2);
+ QTRY_VERIFY(loadFinishedSpy.size() <= 3);
// setUrl(dataUrl3) might stop Chromium from adding a navigation entry for dataUrl2,
// depending on whether the load of dataUrl2 could be completed in time.
@@ -1981,7 +2203,7 @@ public:
setAttribute(QNetworkRequest::RedirectionTargetAttribute, QUrl("qrc:/test2.html"));
QTimer::singleShot(0, this, SLOT(continueRedirect()));
}
-#ifndef QT_NO_OPENSSL
+#if QT_CONFIG(openssl)
else if (request.url() == QUrl("qrc:/fake-ssl-error.html")) {
setError(QNetworkReply::SslHandshakeFailedError, tr("Fake error!"));
QTimer::singleShot(0, this, SLOT(continueError()));
@@ -2002,11 +2224,11 @@ public:
{
close();
}
- virtual void abort() {}
- virtual void close() {}
+ void abort() override {}
+ void close() override {}
protected:
- qint64 readData(char*, qint64)
+ qint64 readData(char*, qint64) override
{
return 0;
}
@@ -2020,7 +2242,7 @@ private Q_SLOTS:
void continueError()
{
- emit error(this->error());
+ emit errorOccurred(this->error());
emit finished();
}
};
@@ -2034,11 +2256,11 @@ public:
FakeNetworkManager(QObject* parent) : QNetworkAccessManager(parent) { }
protected:
- virtual QNetworkReply* createRequest(Operation op, const QNetworkRequest& request, QIODevice* outgoingData)
+ QNetworkReply* createRequest(Operation op, const QNetworkRequest& request, QIODevice* outgoingData) override
{
QString url = request.url().toString();
if (op == QNetworkAccessManager::GetOperation) {
-#ifndef QT_NO_OPENSSL
+#if QT_CONFIG(openssl)
if (url == "qrc:/fake-ssl-error.html") {
FakeReply* reply = new FakeReply(request, this);
QList<QSslError> errors;
@@ -2062,7 +2284,7 @@ void tst_QWebEnginePage::requestedUrlAfterSetAndLoadFailures()
const QUrl first("http://abcdef.abcdef/");
page.setUrl(first);
- QTRY_COMPARE_WITH_TIMEOUT(spy.count(), 1, 20000);
+ QTRY_COMPARE_WITH_TIMEOUT(spy.size(), 1, 20000);
QCOMPARE(page.url(), first);
QCOMPARE(page.requestedUrl(), first);
QVERIFY(!spy.at(0).first().toBool());
@@ -2071,7 +2293,7 @@ void tst_QWebEnginePage::requestedUrlAfterSetAndLoadFailures()
QVERIFY(first != second);
page.load(second);
- QTRY_COMPARE_WITH_TIMEOUT(spy.count(), 2, 20000);
+ QTRY_COMPARE_WITH_TIMEOUT(spy.size(), 2, 20000);
QCOMPARE(page.url(), first);
QCOMPARE(page.requestedUrl(), second);
QVERIFY(!spy.at(1).first().toBool());
@@ -2117,7 +2339,7 @@ void tst_QWebEnginePage::setHtmlWithImageResource()
QSignalSpy spy(&page, SIGNAL(loadFinished(bool)));
page.setHtml(html, QUrl("file:///path/to/file"));
- QTRY_COMPARE_WITH_TIMEOUT(spy.count(), 1, 12000);
+ QTRY_COMPARE_WITH_TIMEOUT(spy.size(), 1, 12000);
QCOMPARE(evaluateJavaScriptSync(&page, "document.images.length").toInt(), 1);
QCOMPARE(evaluateJavaScriptSync(&page, "document.images[0].width").toInt(), 128);
@@ -2126,7 +2348,7 @@ void tst_QWebEnginePage::setHtmlWithImageResource()
// Now we test the opposite: without a baseUrl as a local file, we can still request qrc resources.
page.setHtml(html);
- QTRY_COMPARE(spy.count(), 2);
+ QTRY_COMPARE(spy.size(), 2);
QCOMPARE(evaluateJavaScriptSync(&page, "document.images.length").toInt(), 1);
QCOMPARE(evaluateJavaScriptSync(&page, "document.images[0].width").toInt(), 128);
QCOMPARE(evaluateJavaScriptSync(&page, "document.images[0].height").toInt(), 128);
@@ -2167,10 +2389,15 @@ void tst_QWebEnginePage::setHtmlWithBaseURL()
// This tests if baseUrl is indeed affecting the relative paths from resources.
// As we are using a local file as baseUrl, its security origin should be able to load local resources.
- if (!QDir(TESTS_SOURCE_DIR).exists())
- W_QSKIP(QString("This test requires access to resources found in '%1'").arg(TESTS_SOURCE_DIR).toLatin1().constData(), SkipAll);
+ if (!QDir(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()).exists())
+ W_QSKIP(QString("This test requires access to resources found in '%1'")
+ .arg(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath())
+ .toLatin1()
+ .constData(),
+ SkipAll);
- QDir::setCurrent(TESTS_SOURCE_DIR);
+ QDir::setCurrent(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath());
+ qDebug()<<QDir::current();
QString html("<html><body><p>hello world</p><img src='resources/image2.png'/></body></html>");
@@ -2179,10 +2406,12 @@ void tst_QWebEnginePage::setHtmlWithBaseURL()
// in few seconds, the image should be completey loaded
QSignalSpy spy(&page, SIGNAL(loadFinished(bool)));
- page.setHtml(html, QUrl::fromLocalFile(TESTS_SOURCE_DIR));
+ page.setHtml(html,
+ QUrl::fromLocalFile(
+ QString("%1/foo.html").arg(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath())));
QSignalSpy spyFinished(&page, &QWebEnginePage::loadFinished);
QVERIFY(spyFinished.wait());
- QCOMPARE(spy.count(), 1);
+ QCOMPARE(spy.size(), 1);
QCOMPARE(evaluateJavaScriptSync(&page, "document.images.length").toInt(), 1);
QCOMPARE(evaluateJavaScriptSync(&page, "document.images[0].width").toInt(), 128);
@@ -2199,7 +2428,7 @@ public:
int alerts;
protected:
- virtual void javaScriptAlert(const QUrl &securityOrigin, const QString &msg)
+ void javaScriptAlert(const QUrl &securityOrigin, const QString &msg) override
{
alerts++;
QCOMPARE(securityOrigin, QUrl(QStringLiteral("http://test.origin.com/")));
@@ -2228,9 +2457,6 @@ void tst_QWebEnginePage::setHtmlWithModuleImport()
"}\n");
rr->setResponseHeader("Content-Type", "text/javascript");
rr->sendResponse();
- } else {
- rr->setResponseStatus(404);
- rr->sendResponse();
}
});
QVERIFY(server.start());
@@ -2248,7 +2474,7 @@ void tst_QWebEnginePage::setHtmlWithModuleImport()
QWebEnginePage page;
QSignalSpy spy(&page, &QWebEnginePage::loadFinished);
page.setHtml(html, server.url());
- QVERIFY(spy.count() || spy.wait());
+ QVERIFY(spy.size() || spy.wait());
QCOMPARE(evaluateJavaScriptSync(&page, "fib7"), QVariant(13));
}
@@ -2284,7 +2510,7 @@ void tst_QWebEnginePage::baseUrl()
QSignalSpy loadSpy(m_page, SIGNAL(loadFinished(bool)));
m_page->setHtml(html, loadUrl);
- QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE(loadSpy.size(), 1);
QCOMPARE(m_page->url(), url);
QEXPECT_FAIL("null", "Slight change: We now translate QUrl() to about:blank for the virtual url, but not for the baseUrl", Continue);
QCOMPARE(baseUrlSync(m_page), baseUrl);
@@ -2293,7 +2519,8 @@ void tst_QWebEnginePage::baseUrl()
void tst_QWebEnginePage::scrollPosition()
{
// enlarged image in a small viewport, to provoke the scrollbars to appear
- QString html("<html><body><img src='qrc:/image.png' height=500 width=500/></body></html>");
+ QString html(
+ "<html><body><img src='qrc:/resources/image.png' height=500 width=500/></body></html>");
QWebEngineView view;
view.setFixedSize(200,200);
@@ -2303,12 +2530,12 @@ void tst_QWebEnginePage::scrollPosition()
QSignalSpy loadSpy(view.page(), SIGNAL(loadFinished(bool)));
view.setHtml(html);
- QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE(loadSpy.size(), 1);
// try to set the scroll offset programmatically
view.page()->runJavaScript("window.scrollTo(23, 29);");
- QTRY_COMPARE(view.page()->scrollPosition().x(), 23 * view.windowHandle()->devicePixelRatio());
- QCOMPARE(view.page()->scrollPosition().y(), 29 * view.windowHandle()->devicePixelRatio());
+ QTRY_COMPARE(view.page()->scrollPosition().x(), 23);
+ QCOMPARE(view.page()->scrollPosition().y(), 29);
int x = evaluateJavaScriptSync(view.page(), "window.scrollX").toInt();
int y = evaluateJavaScriptSync(view.page(), "window.scrollY").toInt();
@@ -2329,7 +2556,7 @@ void tst_QWebEnginePage::scrollbarsOff()
QSignalSpy loadSpy(&view, SIGNAL(loadFinished(bool)));
view.setHtml(html);
- QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE(loadSpy.size(), 1);
QVERIFY(evaluateJavaScriptSync(view.page(), "innerWidth == document.documentElement.offsetWidth").toBool());
}
@@ -2340,7 +2567,8 @@ signals:
void repaintRequested();
protected:
- bool event(QEvent *event) {
+ bool event(QEvent *event) override
+ {
if (event->type() == QEvent::UpdateRequest)
emit repaintRequested();
@@ -2363,7 +2591,7 @@ void tst_QWebEnginePage::evaluateWillCauseRepaint()
QSignalSpy loadSpy(&view, SIGNAL(loadFinished(bool)));
view.setHtml(html);
- QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE(loadSpy.size(), 1);
evaluateJavaScriptSync(view.page(), "document.getElementById('junk').style.display = 'none';");
QSignalSpy repaintSpy(&view, &WebView::repaintRequested);
@@ -2379,9 +2607,13 @@ void tst_QWebEnginePage::setContent_data()
QString str = QString::fromUtf8("ὕαλον ϕαγεῖν δύναμαι· τοῦτο οὔ με βλάπτει");
QTest::newRow("UTF-8 plain text") << "text/plain; charset=utf-8" << str.toUtf8() << str;
- QTextCodec *utf16 = QTextCodec::codecForName("UTF-16");
- if (utf16)
- QTest::newRow("UTF-16 plain text") << "text/plain; charset=utf-16" << utf16->fromUnicode(str) << str;
+ QBuffer out16;
+ out16.open(QIODevice::WriteOnly);
+ QTextStream stream16(&out16);
+ stream16.setEncoding(QStringConverter::Utf16);
+ stream16 << str;
+ stream16.flush();
+ QTest::newRow("UTF-16 plain text") << "text/plain; charset=utf-16" << out16.buffer() << str;
str = QString::fromUtf8("Une chaîne de caractères à sa façon.");
QTest::newRow("latin-1 plain text") << "text/plain; charset=iso-8859-1" << str.toLatin1() << str;
@@ -2408,7 +2640,7 @@ public:
{
}
- virtual QNetworkReply* createRequest(Operation, const QNetworkRequest& request, QIODevice*)
+ QNetworkReply* createRequest(Operation, const QNetworkRequest& request, QIODevice*) override
{
QVariant cacheLoad = request.attribute(QNetworkRequest::CacheLoadControlAttribute);
if (cacheLoad.isValid())
@@ -2453,7 +2685,7 @@ void tst_QWebEnginePage::setUrlToEmpty()
expectedLoadFinishedCount++;
QVERIFY(spy.wait());
- QCOMPARE(spy.count(), expectedLoadFinishedCount);
+ QCOMPARE(spy.size(), expectedLoadFinishedCount);
QCOMPARE(page.url(), url);
QCOMPARE(page.requestedUrl(), url);
QCOMPARE(baseUrlSync(&page), url);
@@ -2462,7 +2694,7 @@ void tst_QWebEnginePage::setUrlToEmpty()
page.setUrl(QUrl());
expectedLoadFinishedCount++;
- QTRY_COMPARE(spy.count(), expectedLoadFinishedCount);
+ QTRY_COMPARE(spy.size(), expectedLoadFinishedCount);
QCOMPARE(page.url(), aboutBlank);
QCOMPARE(page.requestedUrl(), QUrl());
QCOMPARE(baseUrlSync(&page), aboutBlank);
@@ -2471,7 +2703,7 @@ void tst_QWebEnginePage::setUrlToEmpty()
page.setUrl(url);
expectedLoadFinishedCount++;
- QTRY_COMPARE(spy.count(), expectedLoadFinishedCount);
+ QTRY_COMPARE(spy.size(), expectedLoadFinishedCount);
QCOMPARE(page.url(), url);
QCOMPARE(page.requestedUrl(), url);
QCOMPARE(baseUrlSync(&page), url);
@@ -2480,7 +2712,7 @@ void tst_QWebEnginePage::setUrlToEmpty()
page.load(QUrl());
expectedLoadFinishedCount++;
- QTRY_COMPARE(spy.count(), expectedLoadFinishedCount);
+ QTRY_COMPARE(spy.size(), expectedLoadFinishedCount);
QCOMPARE(page.url(), aboutBlank);
QCOMPARE(page.requestedUrl(), QUrl());
QCOMPARE(baseUrlSync(&page), aboutBlank);
@@ -2535,9 +2767,9 @@ void tst_QWebEnginePage::setUrlToBadDomain()
page.setUrl(url1);
- QTRY_COMPARE(urlSpy.count(), 1);
- QTRY_COMPARE_WITH_TIMEOUT(titleSpy.count(), 1, 20000);
- QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE(urlSpy.size(), 1);
+ QTRY_COMPARE_WITH_TIMEOUT(titleSpy.size(), 1, 20000);
+ QTRY_COMPARE(loadSpy.size(), 1);
QCOMPARE(urlSpy.takeFirst().value(0).toUrl(), url1);
QCOMPARE(titleSpy.takeFirst().value(0).toString(), url1.host());
@@ -2548,9 +2780,9 @@ void tst_QWebEnginePage::setUrlToBadDomain()
page.setUrl(url2);
- QTRY_COMPARE(urlSpy.count(), 1);
- QTRY_COMPARE_WITH_TIMEOUT(titleSpy.count(), 1, 20000);
- QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE(urlSpy.size(), 1);
+ QTRY_COMPARE_WITH_TIMEOUT(titleSpy.size(), 1, 20000);
+ QTRY_COMPARE(loadSpy.size(), 1);
QCOMPARE(urlSpy.takeFirst().value(0).toUrl(), url2);
QCOMPARE(titleSpy.takeFirst().value(0).toString(), url2.host());
@@ -2574,9 +2806,9 @@ void tst_QWebEnginePage::setUrlToBadPort()
page.setUrl(url1);
- QTRY_COMPARE(urlSpy.count(), 1);
- QTRY_COMPARE(titleSpy.count(), 2);
- QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE(urlSpy.size(), 1);
+ QTRY_COMPARE(titleSpy.size(), 2);
+ QTRY_COMPARE(loadSpy.size(), 1);
QCOMPARE(urlSpy.takeFirst().value(0).toUrl(), url1);
QCOMPARE(titleSpy.takeFirst().value(0).toString(), url1.authority());
@@ -2588,9 +2820,9 @@ void tst_QWebEnginePage::setUrlToBadPort()
page.setUrl(url2);
- QTRY_COMPARE(urlSpy.count(), 1);
- QTRY_COMPARE(titleSpy.count(), 2);
- QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE(urlSpy.size(), 1);
+ QTRY_COMPARE(titleSpy.size(), 2);
+ QTRY_COMPARE(loadSpy.size(), 1);
QCOMPARE(urlSpy.takeFirst().value(0).toUrl(), url2);
QCOMPARE(titleSpy.takeFirst().value(0).toString(), url2.authority());
@@ -2621,7 +2853,7 @@ void tst_QWebEnginePage::setUrlHistory()
m_page->setUrl(QUrl());
expectedLoadFinishedCount++;
- QTRY_COMPARE(spy.count(), expectedLoadFinishedCount);
+ QTRY_COMPARE(spy.size(), expectedLoadFinishedCount);
QCOMPARE(m_page->url(), aboutBlank);
QCOMPARE(m_page->requestedUrl(), QUrl());
// Chromium stores navigation entry for every successful loads. The load of the empty page is committed and stored as about:blank.
@@ -2630,7 +2862,7 @@ void tst_QWebEnginePage::setUrlHistory()
url = QUrl("http://url.invalid/");
m_page->setUrl(url);
expectedLoadFinishedCount++;
- QTRY_COMPARE_WITH_TIMEOUT(spy.count(), expectedLoadFinishedCount, 20000);
+ QTRY_COMPARE_WITH_TIMEOUT(spy.size(), expectedLoadFinishedCount, 20000);
// When error page is disabled in case of LoadFail the entry of the unavailable page is not stored.
// We expect the url of the previously loaded page here.
QCOMPARE(m_page->url(), aboutBlank);
@@ -2641,14 +2873,14 @@ void tst_QWebEnginePage::setUrlHistory()
url = QUrl("qrc:/resources/test1.html");
m_page->setUrl(url);
expectedLoadFinishedCount++;
- QTRY_COMPARE(spy.count(), expectedLoadFinishedCount);
+ QTRY_COMPARE(spy.size(), expectedLoadFinishedCount);
QCOMPARE(m_page->url(), url);
QCOMPARE(m_page->requestedUrl(), url);
QCOMPARE(collectHistoryUrls(m_page->history()), QStringList() << aboutBlank.toString() << QStringLiteral("qrc:/resources/test1.html"));
m_page->setUrl(QUrl());
expectedLoadFinishedCount++;
- QTRY_COMPARE(spy.count(), expectedLoadFinishedCount);
+ QTRY_COMPARE(spy.size(), expectedLoadFinishedCount);
QCOMPARE(m_page->url(), aboutBlank);
QCOMPARE(m_page->requestedUrl(), QUrl());
// Chromium stores navigation entry for every successful loads. The load of the empty page is committed and stored as about:blank.
@@ -2660,7 +2892,7 @@ void tst_QWebEnginePage::setUrlHistory()
url = QUrl("qrc:/resources/test1.html");
m_page->setUrl(url);
expectedLoadFinishedCount++;
- QTRY_COMPARE(spy.count(), expectedLoadFinishedCount);
+ QTRY_COMPARE(spy.size(), expectedLoadFinishedCount);
QCOMPARE(m_page->url(), url);
QCOMPARE(m_page->requestedUrl(), url);
// The history count DOES change since the about:blank is in the list.
@@ -2673,7 +2905,7 @@ void tst_QWebEnginePage::setUrlHistory()
url = QUrl("qrc:/resources/test2.html");
m_page->setUrl(url);
expectedLoadFinishedCount++;
- QTRY_COMPARE(spy.count(), expectedLoadFinishedCount);
+ QTRY_COMPARE(spy.size(), expectedLoadFinishedCount);
QCOMPARE(m_page->url(), url);
QCOMPARE(m_page->requestedUrl(), url);
QCOMPARE(collectHistoryUrls(m_page->history()), QStringList()
@@ -2688,6 +2920,7 @@ void tst_QWebEnginePage::setUrlUsingStateObject()
{
QUrl url;
QSignalSpy urlChangedSpy(m_page, SIGNAL(urlChanged(QUrl)));
+ QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
int expectedUrlChangeCount = 0;
QCOMPARE(m_page->history()->count(), 0);
@@ -2695,20 +2928,22 @@ void tst_QWebEnginePage::setUrlUsingStateObject()
url = QUrl("qrc:/resources/test1.html");
m_page->setUrl(url);
expectedUrlChangeCount++;
- QTRY_COMPARE(urlChangedSpy.count(), expectedUrlChangeCount);
+ QTRY_COMPARE(urlChangedSpy.size(), expectedUrlChangeCount);
+ QCOMPARE(m_page->url(), url);
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
QCOMPARE(m_page->url(), url);
- QTRY_COMPARE(m_page->history()->count(), 1);
+ QCOMPARE(m_page->history()->count(), 1);
evaluateJavaScriptSync(m_page, "window.history.pushState(null, 'push', 'navigate/to/here')");
expectedUrlChangeCount++;
- QTRY_COMPARE(urlChangedSpy.count(), expectedUrlChangeCount);
+ QTRY_COMPARE(urlChangedSpy.size(), expectedUrlChangeCount);
QCOMPARE(m_page->url(), QUrl("qrc:/resources/navigate/to/here"));
QCOMPARE(m_page->history()->count(), 2);
QVERIFY(m_page->history()->canGoBack());
evaluateJavaScriptSync(m_page, "window.history.replaceState(null, 'replace', 'another/location')");
expectedUrlChangeCount++;
- QTRY_COMPARE(urlChangedSpy.count(), expectedUrlChangeCount);
+ QTRY_COMPARE(urlChangedSpy.size(), expectedUrlChangeCount);
QCOMPARE(m_page->url(), QUrl("qrc:/resources/navigate/to/another/location"));
QCOMPARE(m_page->history()->count(), 2);
QVERIFY(!m_page->history()->canGoForward());
@@ -2716,7 +2951,7 @@ void tst_QWebEnginePage::setUrlUsingStateObject()
evaluateJavaScriptSync(m_page, "window.history.back()");
expectedUrlChangeCount++;
- QTRY_COMPARE(urlChangedSpy.count(), expectedUrlChangeCount);
+ QTRY_COMPARE(urlChangedSpy.size(), expectedUrlChangeCount);
QCOMPARE(m_page->url(), QUrl("qrc:/resources/test1.html"));
QVERIFY(m_page->history()->canGoForward());
QVERIFY(!m_page->history()->canGoBack());
@@ -2745,9 +2980,9 @@ void tst_QWebEnginePage::setUrlThenLoads()
QSignalSpy finishedSpy(m_page, SIGNAL(loadFinished(bool)));
m_page->setUrl(url);
- QTRY_COMPARE(startedSpy.count(), 1);
- QTRY_COMPARE(urlChangedSpy.count(), 1);
- QTRY_COMPARE(finishedSpy.count(), 1);
+ QTRY_COMPARE(startedSpy.size(), 1);
+ QTRY_COMPARE(urlChangedSpy.size(), 1);
+ QTRY_COMPARE(finishedSpy.size(), 1);
QVERIFY(finishedSpy.at(0).first().toBool());
QCOMPARE(m_page->url(), url);
QCOMPARE(m_page->requestedUrl(), url);
@@ -2761,11 +2996,11 @@ void tst_QWebEnginePage::setUrlThenLoads()
QTRY_COMPARE(m_page->requestedUrl(), urlToLoad1);
// baseUrlSync spins an event loop and this sometimes return the next result.
// QCOMPARE(baseUrlSync(m_page), baseUrl);
- QTRY_COMPARE(startedSpy.count(), 2);
+ QTRY_COMPARE(startedSpy.size(), 2);
// After first URL changed.
- QTRY_COMPARE(urlChangedSpy.count(), 2);
- QTRY_COMPARE(finishedSpy.count(), 2);
+ QTRY_COMPARE(urlChangedSpy.size(), 2);
+ QTRY_COMPARE(finishedSpy.size(), 2);
QVERIFY(finishedSpy.at(1).first().toBool());
QCOMPARE(m_page->url(), urlToLoad1);
QCOMPARE(m_page->requestedUrl(), urlToLoad1);
@@ -2775,31 +3010,17 @@ void tst_QWebEnginePage::setUrlThenLoads()
QCOMPARE(m_page->url(), urlToLoad1);
QCOMPARE(m_page->requestedUrl(), urlToLoad2);
QCOMPARE(baseUrlSync(m_page), extractBaseUrl(urlToLoad1));
- QTRY_COMPARE(startedSpy.count(), 3);
+ QTRY_COMPARE(startedSpy.size(), 3);
// After second URL changed.
- QTRY_COMPARE(urlChangedSpy.count(), 3);
- QTRY_COMPARE(finishedSpy.count(), 3);
+ QTRY_COMPARE(urlChangedSpy.size(), 3);
+ QTRY_COMPARE(finishedSpy.size(), 3);
QVERIFY(finishedSpy.at(2).first().toBool());
QCOMPARE(m_page->url(), urlToLoad2);
QCOMPARE(m_page->requestedUrl(), urlToLoad2);
QCOMPARE(baseUrlSync(m_page), extractBaseUrl(urlToLoad2));
}
-void tst_QWebEnginePage::loadFinishedAfterNotFoundError()
-{
- QWebEnginePage page;
- QSignalSpy spy(&page, SIGNAL(loadFinished(bool)));
-
- page.settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, false);
- page.setUrl(QUrl("http://non.existent/url"));
- QTRY_COMPARE_WITH_TIMEOUT(spy.count(), 1, 20000);
-
- page.settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, true);
- page.setUrl(QUrl("http://another.non.existent/url"));
- QTRY_COMPARE_WITH_TIMEOUT(spy.count(), 2, 20000);
-}
-
class URLSetter : public QObject {
Q_OBJECT
@@ -2881,11 +3102,7 @@ void tst_QWebEnginePage::loadInSignalHandlers()
URLSetter setter(m_page, signal, type, urlForSetter);
QSignalSpy spy(&setter, &URLSetter::finished);
m_page->load(url);
- // every loadStarted() call should have also loadFinished()
- if (signal == URLSetter::LoadStarted)
- QTRY_COMPARE(spy.count(), 2);
- else
- QTRY_COMPARE(spy.count(), 1);
+ QTRY_VERIFY_WITH_TIMEOUT(spy.size() >= 1, 20000);
QCOMPARE(m_page->url(), urlForSetter);
}
@@ -2896,31 +3113,31 @@ void tst_QWebEnginePage::loadFromQrc()
// Standard case.
page.load(QStringLiteral("qrc:///resources/foo.txt"));
- QTRY_COMPARE(spy.count(), 1);
+ QTRY_COMPARE(spy.size(), 1);
QCOMPARE(spy.takeFirst().value(0).toBool(), true);
QCOMPARE(toPlainTextSync(&page), QStringLiteral("foo\n"));
// Query and fragment parts are ignored.
page.load(QStringLiteral("qrc:///resources/bar.txt?foo=1#bar"));
- QTRY_COMPARE(spy.count(), 1);
+ QTRY_COMPARE(spy.size(), 1);
QCOMPARE(spy.takeFirst().value(0).toBool(), true);
QCOMPARE(toPlainTextSync(&page), QStringLiteral("bar\n"));
// Literal spaces are OK.
page.load(QStringLiteral("qrc:///resources/path with spaces.txt"));
- QTRY_COMPARE(spy.count(), 1);
+ QTRY_COMPARE(spy.size(), 1);
QCOMPARE(spy.takeFirst().value(0).toBool(), true);
QCOMPARE(toPlainTextSync(&page), QStringLiteral("contents with spaces\n"));
// Escaped spaces are OK too.
page.load(QStringLiteral("qrc:///resources/path%20with%20spaces.txt"));
- QTRY_COMPARE(spy.count(), 1);
+ QTRY_COMPARE(spy.size(), 1);
QCOMPARE(spy.takeFirst().value(0).toBool(), true);
QCOMPARE(toPlainTextSync(&page), QStringLiteral("contents with spaces\n"));
// Resource not found, loading fails.
page.load(QStringLiteral("qrc:///nope"));
- QTRY_COMPARE(spy.count(), 1);
+ QTRY_COMPARE_WITH_TIMEOUT(spy.size(), 1, 10000);
QCOMPARE(spy.takeFirst().value(0).toBool(), false);
}
@@ -2937,7 +3154,7 @@ void tst_QWebEnginePage::restoreHistory()
QSignalSpy spy(&page, SIGNAL(loadFinished(bool)));
page.load(QUrl(QStringLiteral("qrc:/resources/test1.html")));
- QTRY_COMPARE(spy.count(), 1);
+ QTRY_COMPARE(spy.size(), 1);
QCOMPARE(page.webChannel(), &channel);
QVERIFY(page.scripts().contains(script));
@@ -2947,7 +3164,7 @@ void tst_QWebEnginePage::restoreHistory()
out << *page.history();
QDataStream in(&data, QIODevice::ReadOnly);
in >> *page.history();
- QTRY_COMPARE(spy.count(), 2);
+ QTRY_COMPARE(spy.size(), 2);
QCOMPARE(page.webChannel(), &channel);
QVERIFY(page.scripts().contains(script));
@@ -2970,42 +3187,59 @@ void tst_QWebEnginePage::toPlainTextLoadFinishedRace()
QSignalSpy spy(page.data(), SIGNAL(loadFinished(bool)));
page->load(QUrl("data:text/plain,foobarbaz"));
- QTRY_VERIFY(spy.count() == 1);
+ QTRY_VERIFY(spy.size() == 1);
QCOMPARE(toPlainTextSync(page.data()), QString("foobarbaz"));
page->load(QUrl("http://fail.invalid/"));
- QTRY_COMPARE_WITH_TIMEOUT(spy.count(), 2, 20000);
+ QTRY_COMPARE_WITH_TIMEOUT(spy.size(), 2, 20000);
QString s = toPlainTextSync(page.data());
QVERIFY(s.contains("foobarbaz") == !enableErrorPage);
page->load(QUrl("data:text/plain,lalala"));
- QTRY_COMPARE(spy.count(), 3);
+ QTRY_COMPARE(spy.size(), 3);
QTRY_COMPARE(toPlainTextSync(page.data()), QString("lalala"));
page.reset();
- QCOMPARE(spy.count(), 3);
+ QCOMPARE(spy.size(), 3);
}
void tst_QWebEnginePage::setZoomFactor()
{
- QWebEnginePage page;
+ TestBasePage page, page2;
- QVERIFY(qFuzzyCompare(page.zoomFactor(), 1.0));
+ QCOMPARE(page.zoomFactor(), 1.0);
page.setZoomFactor(2.5);
- QVERIFY(qFuzzyCompare(page.zoomFactor(), 2.5));
-
- const QUrl urlToLoad("qrc:/resources/test1.html");
-
- QSignalSpy finishedSpy(&page, SIGNAL(loadFinished(bool)));
- page.load(urlToLoad);
- QTRY_COMPARE(finishedSpy.count(), 1);
- QVERIFY(finishedSpy.at(0).first().toBool());
- QVERIFY(qFuzzyCompare(page.zoomFactor(), 2.5));
-
- page.setZoomFactor(5.5);
- QVERIFY(qFuzzyCompare(page.zoomFactor(), 2.5));
+ QCOMPARE(page.zoomFactor(), 2.5);
+
+ const QUrl url1("qrc:/resources/test1.html"), url2(QUrl("qrc:/resources/test2.html"));
+
+ page.load(url1);
+ QTRY_COMPARE(page.loadSpy.size(), 1);
+ QVERIFY(page.loadSpy.at(0).first().toBool());
+ QCOMPARE(page.zoomFactor(), 2.5);
+
+ page.setZoomFactor(5.5); // max accepted zoom: kMaximumPageZoomFactor = 5.0
+ QCOMPARE(page.zoomFactor(), 2.5);
+
+ page.setZoomFactor(0.1); // min accepted zoom: kMinimumPageZoomFactor = 0.25
+ QCOMPARE(page.zoomFactor(), 2.5);
+
+ // try loading different url and check new values after load
+ page.loadSpy.clear();
+ for (auto &&p : {
+ qMakePair(&page, 2.5), // navigating away to different url should keep zoom
+ qMakePair(&page2, 1.0), // same url navigation in diffent page shouldn't be affected
+ }) {
+ auto &&page = *p.first; auto zoomFactor = p.second;
+ page.load(url2);
+ QTRY_COMPARE(page.loadSpy.size(), 1);
+ QVERIFY(page.loadSpy.last().first().toBool());
+ QCOMPARE(page.zoomFactor(), zoomFactor);
+ }
- page.setZoomFactor(0.1);
- QVERIFY(qFuzzyCompare(page.zoomFactor(), 2.5));
+ // should have no influence on first page
+ page2.setZoomFactor(3.5);
+ for (auto &&p : { qMakePair(&page, 2.5), qMakePair(&page2, 3.5), })
+ QCOMPARE(p.first->zoomFactor(), p.second);
}
void tst_QWebEnginePage::mouseButtonTranslation()
@@ -3025,17 +3259,20 @@ void tst_QWebEnginePage::mouseButtonTranslation()
view.resize(640, 480);
view.show();
QVERIFY(QTest::qWaitForWindowExposed(&view));
- QTRY_VERIFY(spy.count() == 1);
+ QTRY_VERIFY(spy.size() == 1);
QVERIFY(view.focusProxy() != nullptr);
- QMouseEvent evpres(QEvent::MouseButtonPress, view.rect().center(), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
+ const QPoint mousePos = view.rect().center();
+ QMouseEvent evpres(QEvent::MouseButtonPress, mousePos, view.mapToGlobal(mousePos),
+ Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
QGuiApplication::sendEvent(view.focusProxy(), &evpres);
QTRY_COMPARE(evaluateJavaScriptSync(view.page(), "lastEvent.button").toInt(), 0);
QCOMPARE(evaluateJavaScriptSync(view.page(), "lastEvent.buttons").toInt(), 1);
- QMouseEvent evpres2(QEvent::MouseButtonPress, view.rect().center(), Qt::RightButton, Qt::LeftButton | Qt::RightButton, Qt::NoModifier);
+ QMouseEvent evpres2(QEvent::MouseButtonPress, mousePos, view.mapToGlobal(mousePos),
+ Qt::RightButton, Qt::LeftButton | Qt::RightButton, Qt::NoModifier);
QGuiApplication::sendEvent(view.focusProxy(), &evpres2);
QTRY_COMPARE(evaluateJavaScriptSync(view.page(), "lastEvent.button").toInt(), 2);
@@ -3064,34 +3301,17 @@ void tst_QWebEnginePage::mouseMovementProperties()
loadFinishedSpy.wait();
QTest::mouseMove(&view, QPoint(20, 20));
- QTRY_COMPARE(page.messages.count(), 1);
+ QTRY_COMPARE(page.messages.size(), 1);
QTest::mouseMove(&view, QPoint(30, 30));
- QTRY_COMPARE(page.messages.count(), 2);
+ QTRY_COMPARE(page.messages.size(), 2);
QTRY_COMPARE(page.messages[1], QString("10, 10"));
QTest::mouseMove(&view, QPoint(20, 20));
- QTRY_COMPARE(page.messages.count(), 3);
+ QTRY_COMPARE(page.messages.size(), 3);
QTRY_COMPARE(page.messages[2], QString("-10, -10"));
}
-QPoint tst_QWebEnginePage::elementCenter(QWebEnginePage *page, const QString &id)
-{
- QVariantList rectList = evaluateJavaScriptSync(page,
- "(function(){"
- "var elem = document.getElementById('" + id + "');"
- "var rect = elem.getBoundingClientRect();"
- "return [(rect.left + rect.right) / 2, (rect.top + rect.bottom) / 2];"
- "})()").toList();
-
- if (rectList.count() != 2) {
- qWarning("elementCenter failed.");
- return QPoint();
- }
-
- return QPoint(rectList.at(0).toInt(), rectList.at(1).toInt());
-}
-
void tst_QWebEnginePage::viewSource()
{
TestPage page;
@@ -3100,12 +3320,12 @@ void tst_QWebEnginePage::viewSource()
const QUrl url("qrc:/resources/test1.html");
page.load(url);
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
QCOMPARE(page.title(), QStringLiteral("Test page 1"));
QVERIFY(page.action(QWebEnginePage::ViewSource)->isEnabled());
page.triggerAction(QWebEnginePage::ViewSource);
- QTRY_COMPARE(windowCreatedSpy.count(), 1);
+ QTRY_COMPARE(windowCreatedSpy.size(), 1);
QCOMPARE(page.createdWindows.size(), 1);
QTRY_COMPARE(page.createdWindows[0]->url().toString(), QStringLiteral("view-source:%1").arg(url.toString()));
@@ -3126,7 +3346,8 @@ void tst_QWebEnginePage::viewSourceURL_data()
QTest::newRow("view-source:") << QUrl("view-source:") << true << QUrl("view-source:") << QUrl("about:blank") << QString("view-source:");
QTest::newRow("view-source:about:blank") << QUrl("view-source:about:blank") << true << QUrl("view-source:about:blank") << QUrl("about:blank") << QString("view-source:about:blank");
- QString localFilePath = QString("%1qwebenginepage/resources/test1.html").arg(TESTS_SOURCE_DIR);
+ QString localFilePath =
+ QString("%1/resources/test1.html").arg(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath());
QUrl testLocalUrl = QUrl(QString("view-source:%1").arg(QUrl::fromLocalFile(localFilePath).toString()));
QUrl testLocalUrlWithoutScheme = QUrl(QString("view-source:%1").arg(localFilePath));
QTest::newRow(testLocalUrl.toString().toStdString().c_str()) << testLocalUrl << true << testLocalUrl << QUrl::fromLocalFile(localFilePath) << QString("test1.html");
@@ -3142,8 +3363,12 @@ void tst_QWebEnginePage::viewSourceURL_data()
void tst_QWebEnginePage::viewSourceURL()
{
- if (!QDir(TESTS_SOURCE_DIR).exists())
- W_QSKIP(QString("This test requires access to resources found in '%1'").arg(TESTS_SOURCE_DIR).toLatin1().constData(), SkipAll);
+ if (!QDir(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()).exists())
+ W_QSKIP(QString("This test requires access to resources found in '%1'")
+ .arg(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath())
+ .toLatin1()
+ .constData(),
+ SkipAll);
QFETCH(QUrl, userInputUrl);
QFETCH(bool, loadSucceed);
@@ -3155,7 +3380,7 @@ void tst_QWebEnginePage::viewSourceURL()
QSignalSpy loadFinishedSpy(&page, SIGNAL(loadFinished(bool)));
page.load(userInputUrl);
- QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.count(), 1, 12000);
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size(), 1, 12000);
QList<QVariant> arguments = loadFinishedSpy.takeFirst();
QCOMPARE(arguments.at(0).toBool(), loadSucceed);
@@ -3190,7 +3415,7 @@ void tst_QWebEnginePage::viewSourceCredentials()
QVERIFY(page.action(QWebEnginePage::ViewSource)->isEnabled());
page.triggerAction(QWebEnginePage::ViewSource);
- QTRY_COMPARE(windowCreatedSpy.count(), 1);
+ QTRY_COMPARE(windowCreatedSpy.size(), 1);
QCOMPARE(page.createdWindows.size(), 1);
QTRY_COMPARE(page.createdWindows[0]->url().toString(), QString("view-source:" + url.toDisplayString(QUrl::RemoveUserInfo)));
@@ -3212,7 +3437,7 @@ void tst_QWebEnginePage::proxyConfigWithUnexpectedHostPortPair()
QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
m_page->load(QStringLiteral("http://127.0.0.1:245/"));
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
}
void tst_QWebEnginePage::registerProtocolHandler_data()
@@ -3235,19 +3460,17 @@ void tst_QWebEnginePage::registerProtocolHandler()
} else if (rr->requestMethod() == "GET" && rr->requestPath() == "/mail?uri=mailto%3Afoo%40bar.com") {
mailRequestCount++;
rr->sendResponse();
- } else {
- rr->setResponseStatus(404);
- rr->sendResponse();
}
});
QVERIFY(server.start());
- QWebEnginePage page;
+ QWebEngineProfile profile(QStringLiteral("registerProtocolHandler%1").arg(QTest::currentDataTag()));
+ QWebEnginePage page(&profile, nullptr);
QSignalSpy loadSpy(&page, &QWebEnginePage::loadFinished);
QSignalSpy permissionSpy(&page, &QWebEnginePage::registerProtocolHandlerRequested);
page.setUrl(server.url("/"));
- QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE(loadSpy.size(), 1);
QCOMPARE(loadSpy.takeFirst().value(0).toBool(), true);
QString callFormat = QStringLiteral("window.navigator.registerProtocolHandler(\"%1\", \"%2\", \"%3\")");
@@ -3257,7 +3480,7 @@ void tst_QWebEnginePage::registerProtocolHandler()
QString call = callFormat.arg(scheme).arg(url).arg(title);
page.runJavaScript(call);
- QTRY_COMPARE(permissionSpy.count(), 1);
+ QTRY_COMPARE(permissionSpy.size(), 1);
auto request = permissionSpy.takeFirst().value(0).value<QWebEngineRegisterProtocolHandlerRequest>();
QCOMPARE(request.origin(), QUrl(url));
QCOMPARE(request.scheme(), scheme);
@@ -3268,7 +3491,7 @@ void tst_QWebEnginePage::registerProtocolHandler()
page.runJavaScript(QStringLiteral("document.getElementById(\"link\").click()"));
- QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE(loadSpy.size(), 1);
QCOMPARE(loadSpy.takeFirst().value(0).toBool(), permission);
QCOMPARE(mailRequestCount, permission ? 1 : 0);
QVERIFY(server.stop());
@@ -3279,22 +3502,12 @@ void tst_QWebEnginePage::dataURLFragment()
m_view->resize(800, 600);
m_view->show();
QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
-
- m_page->setHtml("<html><body>"
- "<a id='link' href='#anchor'>anchor</a>"
- "</body></html>");
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
-
QSignalSpy urlChangedSpy(m_page, SIGNAL(urlChanged(QUrl)));
- QTest::mouseClick(m_view->focusProxy(), Qt::LeftButton, {}, elementCenter(m_page, "link"));
- QVERIFY(urlChangedSpy.wait());
- QCOMPARE(m_page->url().fragment(), QStringLiteral("anchor"));
-
m_page->setHtml("<html><body>"
"<a id='link' href='#anchor'>anchor</a>"
"</body></html>", QUrl("http://test.qt.io/mytest.html"));
- QTRY_COMPARE(loadFinishedSpy.count(), 2);
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
QTest::mouseClick(m_view->focusProxy(), Qt::LeftButton, {}, elementCenter(m_page, "link"));
QVERIFY(urlChangedSpy.wait());
@@ -3318,7 +3531,7 @@ void tst_QWebEnginePage::devTools()
QCOMPARE(devToolsPage.devToolsPage(), nullptr);
QCOMPARE(devToolsPage.inspectedPage(), &inspectedPage1);
- QTRY_COMPARE_WITH_TIMEOUT(spy.count(), 1, 30000);
+ QTRY_COMPARE_WITH_TIMEOUT(spy.size(), 1, 90000);
QVERIFY(spy.takeFirst().value(0).toBool());
devToolsPage.setInspectedPage(&inspectedPage2);
@@ -3330,7 +3543,7 @@ void tst_QWebEnginePage::devTools()
QCOMPARE(devToolsPage.devToolsPage(), nullptr);
QCOMPARE(devToolsPage.inspectedPage(), &inspectedPage2);
- QTRY_COMPARE_WITH_TIMEOUT(spy.count(), 1, 30000);
+ QTRY_COMPARE_WITH_TIMEOUT(spy.size(), 1, 90000);
QVERIFY(spy.takeFirst().value(0).toBool());
devToolsPage.setInspectedPage(nullptr);
@@ -3341,19 +3554,20 @@ void tst_QWebEnginePage::devTools()
QCOMPARE(inspectedPage2.inspectedPage(), nullptr);
QCOMPARE(devToolsPage.devToolsPage(), nullptr);
QCOMPARE(devToolsPage.inspectedPage(), nullptr);
+
+ QVERIFY(!inspectedPage1.devToolsId().isEmpty());
}
void tst_QWebEnginePage::openLinkInDifferentProfile()
{
- class Page : public QWebEnginePage {
- public:
- QWebEnginePage *targetPage = nullptr;
- Page(QWebEngineProfile *profile) : QWebEnginePage(profile) {}
- private:
- QWebEnginePage *createWindow(WebWindowType) override { return targetPage; }
- };
+ QWebEnginePage *targetPage = nullptr;
QWebEngineProfile profile1, profile2;
- Page page1(&profile1), page2(&profile2);
+ profile1.installUrlSchemeHandler("echo", new EchoingUrlSchemeHandler(&profile1));
+ profile2.installUrlSchemeHandler("echo", new EchoingUrlSchemeHandler(&profile2));
+ QWebEnginePage page1(&profile1), page2(&profile2);
+ connect(&page1, &QWebEnginePage::newWindowRequested, [&](QWebEngineNewWindowRequest &request) {
+ request.openIn(targetPage);
+ });
QWebEngineView view;
view.resize(500, 500);
view.setPage(&page1);
@@ -3361,13 +3575,13 @@ void tst_QWebEnginePage::openLinkInDifferentProfile()
QVERIFY(QTest::qWaitForWindowExposed(&view));
QSignalSpy spy1(&page1, &QWebEnginePage::loadFinished), spy2(&page2, &QWebEnginePage::loadFinished);
page1.setHtml("<html><body>"
- "<a id='link' href='data:,hello'>link</a>"
- "</body></html>");
- QTRY_COMPARE(spy1.count(), 1);
+ "<a id='link' href='hello'>link</a>"
+ "</body></html>", QUrl("echo:/"));
+ QTRY_COMPARE(spy1.size(), 1);
QVERIFY(spy1.takeFirst().value(0).toBool());
- page1.targetPage = &page2;
+ targetPage = &page2;
QTest::mouseClick(view.focusProxy(), Qt::MiddleButton, {}, elementCenter(&page1, "link"));
- QTRY_COMPARE(spy2.count(), 1);
+ QTRY_COMPARE(spy2.size(), 1);
QVERIFY(spy2.takeFirst().value(0).toBool());
}
@@ -3427,7 +3641,7 @@ void tst_QWebEnginePage::openLinkInNewPage_data()
// the disposition and performing the navigation request normally.
QTest::newRow("BlockPopup") << Decision::ReturnNull << Cause::TargetBlank << Effect::Blocked;
- QTest::newRow("IgnoreIntent") << Decision::ReturnNull << Cause::MiddleClick << Effect::LoadInSelf;
+ QTest::newRow("IgnoreIntent") << Decision::ReturnNull << Cause::MiddleClick << Effect::Blocked;
QTest::newRow("OverridePopup") << Decision::ReturnSelf << Cause::TargetBlank << Effect::LoadInSelf;
QTest::newRow("OverrideIntent") << Decision::ReturnSelf << Cause::MiddleClick << Effect::LoadInSelf;
QTest::newRow("AcceptPopup") << Decision::ReturnOther << Cause::TargetBlank << Effect::LoadInOther;
@@ -3465,6 +3679,7 @@ void tst_QWebEnginePage::openLinkInNewPage()
QFETCH(Effect, effect);
QWebEngineProfile profile;
+ profile.installUrlSchemeHandler("echo", new EchoingUrlSchemeHandler(&profile));
Page page1(&profile);
Page page2(&profile);
View view1(&page1);
@@ -3474,9 +3689,9 @@ void tst_QWebEnginePage::openLinkInNewPage()
QVERIFY(QTest::qWaitForWindowExposed(&view1));
page1.setHtml("<html><body>"
- "<a id='link' href='data:,hello' target='_blank'>link</a>"
- "</body></html>");
- QTRY_COMPARE(page1.spy.count(), 1);
+ "<a id='link' href='hello' target='_blank'>link</a>"
+ "</body></html>", QUrl("echo:/"));
+ QTRY_COMPARE(page1.spy.size(), 1);
QVERIFY(page1.spy.takeFirst().value(0).toBool());
switch (decision) {
@@ -3491,7 +3706,7 @@ void tst_QWebEnginePage::openLinkInNewPage()
break;
}
- Qt::MouseButton button;
+ Qt::MouseButton button = Qt::NoButton;
switch (cause) {
case Cause::TargetBlank:
button = Qt::LeftButton;
@@ -3504,12 +3719,15 @@ void tst_QWebEnginePage::openLinkInNewPage()
switch (effect) {
case Effect::Blocked:
- // Nothing to test
+ // Test nothing new loaded
+ QTest::qWait(500);
+ QCOMPARE(page1.spy.size(), 0);
+ QCOMPARE(page2.spy.size(), 0);
break;
case Effect::LoadInSelf:
- QTRY_COMPARE(page1.spy.count(), 1);
+ QTRY_COMPARE(page1.spy.size(), 1);
QVERIFY(page1.spy.takeFirst().value(0).toBool());
- QCOMPARE(page2.spy.count(), 0);
+ QCOMPARE(page2.spy.size(), 0);
if (decision == Decision::ReturnSelf && cause == Cause::TargetBlank)
// History was discarded due to AddNewContents
QCOMPARE(page1.history()->count(), 1);
@@ -3518,9 +3736,9 @@ void tst_QWebEnginePage::openLinkInNewPage()
QCOMPARE(page2.history()->count(), 0);
break;
case Effect::LoadInOther:
- QTRY_COMPARE(page2.spy.count(), 1);
+ QTRY_COMPARE(page2.spy.size(), 1);
QVERIFY(page2.spy.takeFirst().value(0).toBool());
- QCOMPARE(page1.spy.count(), 0);
+ QCOMPARE(page1.spy.size(), 0);
QCOMPARE(page1.history()->count(), 1);
QCOMPARE(page2.history()->count(), 1);
break;
@@ -3542,7 +3760,7 @@ void tst_QWebEnginePage::dynamicFrame()
page.settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, false);
QSignalSpy spy(&page, &QWebEnginePage::loadFinished);
page.load(QStringLiteral("qrc:/resources/dynamicFrame.html"));
- QTRY_COMPARE(spy.count(), 1);
+ QTRY_COMPARE(spy.size(), 1);
QCOMPARE(toPlainTextSync(&page).trimmed(), QStringLiteral("foo"));
}
@@ -3618,7 +3836,7 @@ void tst_QWebEnginePage::notificationPermission()
QSignalSpy spy(&page, &QWebEnginePage::loadFinished);
page.setHtml(QString("<html><body>Test</body></html>"), baseUrl);
- QTRY_COMPARE(spy.count(), 1);
+ QTRY_COMPARE(spy.size(), 1);
QCOMPARE(evaluateJavaScriptSync(&page, QStringLiteral("Notification.permission")), setOnInit ? permission : QLatin1String("default"));
@@ -3676,6 +3894,149 @@ void tst_QWebEnginePage::sendNotification()
QTRY_VERIFY2(page.messages.contains("onclose"), page.messages.join("\n").toLatin1().constData());
}
+static QString clipboardPermissionQuery(QString variableName, QString permissionName)
+{
+ return QString("var %1; navigator.permissions.query({ name:'%2' }).then((p) => { %1 = p.state; "
+ "});")
+ .arg(variableName)
+ .arg(permissionName);
+}
+
+
+void tst_QWebEnginePage::clipboardReadWritePermissionInitialState_data()
+{
+ QTest::addColumn<bool>("canAccessClipboard");
+ QTest::addColumn<bool>("canPaste");
+ QTest::addColumn<QString>("permission");
+ QTest::newRow("access and paste should grant") << true << true << "granted";
+ QTest::newRow("no access should prompt") << false << true << "prompt";
+ QTest::newRow("no paste should prompt") << true << false << "prompt";
+ QTest::newRow("no access or paste should prompt") << false << false << "prompt";
+}
+
+void tst_QWebEnginePage::clipboardReadWritePermissionInitialState()
+{
+ QFETCH(bool, canAccessClipboard);
+ QFETCH(bool, canPaste);
+ QFETCH(QString, permission);
+
+ QWebEngineProfile otr;
+ QWebEngineView view(&otr);
+ QWebEnginePage &page = *view.page();
+ view.settings()->setAttribute(QWebEngineSettings::FocusOnNavigationEnabled, true);
+ page.settings()->setAttribute(QWebEngineSettings::JavascriptCanAccessClipboard,
+ canAccessClipboard);
+ page.settings()->setAttribute(QWebEngineSettings::JavascriptCanPaste, canPaste);
+
+ QSignalSpy spy(&page, &QWebEnginePage::loadFinished);
+ QUrl baseUrl("https://www.example.com/somepage.html");
+ page.setHtml(QString("<html><body>Test</body></html>"), baseUrl);
+ QTRY_COMPARE(spy.size(), 1);
+
+ evaluateJavaScriptSync(&page, clipboardPermissionQuery("readPermission", "clipboard-read"));
+ QCOMPARE(evaluateJavaScriptSync(&page, QStringLiteral("readPermission")), permission);
+ evaluateJavaScriptSync(&page, clipboardPermissionQuery("writePermission", "clipboard-write"));
+ QCOMPARE(evaluateJavaScriptSync(&page, QStringLiteral("writePermission")), permission);
+}
+
+void tst_QWebEnginePage::clipboardReadWritePermission_data()
+{
+ QTest::addColumn<bool>("canAccessClipboard");
+ QTest::addColumn<QWebEnginePage::PermissionPolicy>("initialPolicy");
+ QTest::addColumn<QString>("initialPermission");
+ QTest::addColumn<QWebEnginePage::PermissionPolicy>("requestPolicy");
+ QTest::addColumn<QString>("finalPermission");
+
+ QTest::newRow("noAccessGrantGrant")
+ << false << QWebEnginePage::PermissionGrantedByUser << "granted"
+ << QWebEnginePage::PermissionGrantedByUser << "granted";
+ QTest::newRow("noAccessGrantDeny")
+ << false << QWebEnginePage::PermissionGrantedByUser << "granted"
+ << QWebEnginePage::PermissionDeniedByUser << "denied";
+ QTest::newRow("noAccessDenyGrant")
+ << false << QWebEnginePage::PermissionDeniedByUser << "denied"
+ << QWebEnginePage::PermissionGrantedByUser << "granted";
+ QTest::newRow("noAccessDenyDeny") << false << QWebEnginePage::PermissionDeniedByUser << "denied"
+ << QWebEnginePage::PermissionDeniedByUser << "denied";
+ QTest::newRow("noAccessAskGrant") << false << QWebEnginePage::PermissionUnknown << "prompt"
+ << QWebEnginePage::PermissionGrantedByUser << "granted";
+
+ // All policies are ignored and overridden by setting JsCanAccessClipboard and JsCanPaste to
+ // true
+ QTest::newRow("accessGrantGrant")
+ << true << QWebEnginePage::PermissionGrantedByUser << "granted"
+ << QWebEnginePage::PermissionGrantedByUser << "granted";
+ QTest::newRow("accessDenyDeny") << true << QWebEnginePage::PermissionDeniedByUser << "granted"
+ << QWebEnginePage::PermissionDeniedByUser << "granted";
+ QTest::newRow("accessAskAsk") << true << QWebEnginePage::PermissionUnknown << "granted"
+ << QWebEnginePage::PermissionUnknown << "granted";
+}
+
+void tst_QWebEnginePage::clipboardReadWritePermission()
+{
+ QFETCH(bool, canAccessClipboard);
+ QFETCH(QWebEnginePage::PermissionPolicy, initialPolicy);
+ QFETCH(QString, initialPermission);
+ QFETCH(QWebEnginePage::PermissionPolicy, requestPolicy);
+ QFETCH(QString, finalPermission);
+
+ QWebEngineProfile otr;
+ QWebEngineView view(&otr);
+ QWebEnginePage &page = *view.page();
+ view.settings()->setAttribute(QWebEngineSettings::FocusOnNavigationEnabled, true);
+ page.settings()->setAttribute(QWebEngineSettings::JavascriptCanAccessClipboard,
+ canAccessClipboard);
+ page.settings()->setAttribute(QWebEngineSettings::JavascriptCanPaste, true);
+
+ QUrl baseUrl("https://www.example.com/somepage.html");
+
+ int permissionRequestCount = 0;
+ bool errorState = false;
+
+ // if JavascriptCanAccessClipboard is true, this never fires
+ connect(&page, &QWebEnginePage::featurePermissionRequested, &page,
+ [&](const QUrl &o, QWebEnginePage::Feature f) {
+ if (f != QWebEnginePage::ClipboardReadWrite)
+ return;
+ if (o != baseUrl.url(QUrl::RemoveFilename)) {
+ qWarning() << "Unexpected case. Can't proceed." << o;
+ errorState = true;
+ return;
+ }
+ permissionRequestCount++;
+ page.setFeaturePermission(o, f, requestPolicy);
+ });
+
+ page.setFeaturePermission(baseUrl, QWebEnginePage::ClipboardReadWrite, initialPolicy);
+
+ QSignalSpy spy(&page, &QWebEnginePage::loadFinished);
+ page.setHtml(QString("<html><body>Test</body></html>"), baseUrl);
+ QTRY_COMPARE(spy.size(), 1);
+
+ evaluateJavaScriptSync(&page, clipboardPermissionQuery("readPermission", "clipboard-read"));
+ QCOMPARE(evaluateJavaScriptSync(&page, QStringLiteral("readPermission")), initialPermission);
+ evaluateJavaScriptSync(&page, clipboardPermissionQuery("writePermission", "clipboard-write"));
+ QCOMPARE(evaluateJavaScriptSync(&page, QStringLiteral("writePermission")), initialPermission);
+
+ auto triggerRequest = [&page](QString variableName, QString apiCall)
+ {
+ auto js = QString("var %1; navigator.clipboard.%2.then((v) => { %1 = 'granted' }, (v) => { %1 = "
+ "'denied' });")
+ .arg(variableName)
+ .arg(apiCall);
+ evaluateJavaScriptSync(&page, js);
+ };
+
+ // permission is not 'remembered' from api standpoint, hence is not suppressed on explicit call
+ // from JS
+ triggerRequest("readState", "readText()");
+ QTRY_COMPARE(evaluateJavaScriptSync(&page, "readState"), finalPermission);
+ triggerRequest("writeState", "writeText('foo')");
+ QTRY_COMPARE(evaluateJavaScriptSync(&page, "writeState"), finalPermission);
+ QCOMPARE(permissionRequestCount, canAccessClipboard ? 0 : 2);
+ QVERIFY(!errorState);
+}
+
void tst_QWebEnginePage::contentsSize()
{
m_view->resize(800, 600);
@@ -3686,8 +4047,8 @@ void tst_QWebEnginePage::contentsSize()
m_view->setHtml(QString("<html><body style=\"width: 1600px; height: 1200px;\"><p>hi</p></body></html>"));
- QTRY_COMPARE(loadSpy.count(), 1);
- QTRY_COMPARE(contentsSizeChangedSpy.count(), 1);
+ QTRY_COMPARE(loadSpy.size(), 1);
+ QTRY_COMPARE(contentsSizeChangedSpy.size(), 1);
// Verify the page's contents size is not limited by the view's size.
QCOMPARE(m_page->contentsSize().width(), 1608);
@@ -3704,6 +4065,60 @@ void tst_QWebEnginePage::contentsSize()
QCOMPARE(m_page->contentsSize().height(), 1216);
}
+void tst_QWebEnginePage::localFontAccessPermission_data()
+{
+ QTest::addColumn<QWebEnginePage::PermissionPolicy>("policy");
+ QTest::addColumn<bool>("ignore");
+ QTest::addColumn<bool>("shouldBeEmpty");
+
+ QTest::newRow("ignore") << QWebEnginePage::PermissionDeniedByUser << true << true;
+ QTest::newRow("setDeny") << QWebEnginePage::PermissionDeniedByUser << false << true;
+ QTest::newRow("setGrant") << QWebEnginePage::PermissionGrantedByUser << false << false;
+}
+
+void tst_QWebEnginePage::localFontAccessPermission() {
+ QFETCH(QWebEnginePage::PermissionPolicy, policy);
+ QFETCH(bool, ignore);
+ QFETCH(bool, shouldBeEmpty);
+
+ QWebEngineView view;
+ QWebEnginePage page(&view);
+ view.setPage(&page);
+
+ connect(&page, &QWebEnginePage::featurePermissionRequested, &page, [&] (const QUrl &o, QWebEnginePage::Feature f) {
+ if (f != QWebEnginePage::LocalFontsAccess)
+ return;
+
+ if (!ignore)
+ page.setFeaturePermission(o, f, policy);
+ });
+
+ QSignalSpy spy(&page, &QWebEnginePage::loadFinished);
+ page.load(QUrl("qrc:///resources/fontaccess.html"));
+ QTRY_COMPARE(spy.size(), 1);
+
+ // Font access is only enabled for visible WebContents.
+ view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
+
+ if (evaluateJavaScriptSync(&page, QStringLiteral("!window.queryLocalFonts")).toBool())
+ W_QSKIP("Local fonts access is not supported.", SkipSingle);
+
+ // Access to the API requires recent user interaction
+ QTest::keyPress(view.focusProxy(), Qt::Key_Space);
+ QTRY_COMPARE(evaluateJavaScriptSync(&page, QStringLiteral("activated")).toBool(), true);
+
+ if (ignore) {
+ QTRY_COMPARE_NE_WITH_TIMEOUT(evaluateJavaScriptSync(&page, QStringLiteral("done")).toBool(), true, 1000);
+ } else {
+ QTRY_VERIFY_WITH_TIMEOUT(evaluateJavaScriptSync(&page, QStringLiteral("done")).toBool() == true, 1000);
+ QVERIFY((evaluateJavaScriptSync(&page, QStringLiteral("fonts.length")).toInt() == 0) == shouldBeEmpty);
+ }
+
+ // Reset permission, since otherwise it will be stored between runs
+ page.setFeaturePermission(QUrl("qrc:///resources/fontaccess.html"), QWebEnginePage::LocalFontsAccess, QWebEnginePage::PermissionUnknown);
+}
+
void tst_QWebEnginePage::setLifecycleState()
{
qRegisterMetaType<QWebEnginePage::LifecycleState>("LifecycleState");
@@ -3715,64 +4130,64 @@ void tst_QWebEnginePage::setLifecycleState()
QSignalSpy visibleSpy(&page, &QWebEnginePage::visibleChanged);
page.load(QStringLiteral("qrc:/resources/lifecycle.html"));
- QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE(loadSpy.size(), 1);
QCOMPARE(loadSpy.takeFirst().value(0), QVariant(true));
- QCOMPARE(lifecycleSpy.count(), 0);
+ QCOMPARE(lifecycleSpy.size(), 0);
QCOMPARE(page.lifecycleState(), QWebEnginePage::LifecycleState::Active);
- QCOMPARE(visibleSpy.count(), 0);
+ QCOMPARE(visibleSpy.size(), 0);
QCOMPARE(page.isVisible(), false);
QCOMPARE(evaluateJavaScriptSync(&page, "document.wasDiscarded"), QVariant(false));
QCOMPARE(evaluateJavaScriptSync(&page, "frozenness"), QVariant(0));
// Active -> Frozen
page.setLifecycleState(QWebEnginePage::LifecycleState::Frozen);
- QCOMPARE(lifecycleSpy.count(), 1);
+ QCOMPARE(lifecycleSpy.size(), 1);
QCOMPARE(lifecycleSpy.takeFirst().value(0), QVariant::fromValue(QWebEnginePage::LifecycleState::Frozen));
QCOMPARE(page.lifecycleState(), QWebEnginePage::LifecycleState::Frozen);
- QCOMPARE(visibleSpy.count(), 0);
+ QCOMPARE(visibleSpy.size(), 0);
QCOMPARE(page.isVisible(), false);
QCOMPARE(evaluateJavaScriptSync(&page, "document.wasDiscarded"), QVariant(false));
QCOMPARE(evaluateJavaScriptSync(&page, "frozenness"), QVariant(1));
// Frozen -> Active
page.setLifecycleState(QWebEnginePage::LifecycleState::Active);
- QCOMPARE(lifecycleSpy.count(), 1);
+ QCOMPARE(lifecycleSpy.size(), 1);
QCOMPARE(lifecycleSpy.takeFirst().value(0), QVariant::fromValue(QWebEnginePage::LifecycleState::Active));
QCOMPARE(page.lifecycleState(), QWebEnginePage::LifecycleState::Active);
- QCOMPARE(visibleSpy.count(), 0);
+ QCOMPARE(visibleSpy.size(), 0);
QCOMPARE(page.isVisible(), false);
QCOMPARE(evaluateJavaScriptSync(&page, "document.wasDiscarded"), QVariant(false));
QCOMPARE(evaluateJavaScriptSync(&page, "frozenness"), QVariant(0));
// Active -> Discarded
page.setLifecycleState(QWebEnginePage::LifecycleState::Discarded);
- QCOMPARE(lifecycleSpy.count(), 1);
+ QCOMPARE(lifecycleSpy.size(), 1);
QCOMPARE(lifecycleSpy.takeFirst().value(0), QVariant::fromValue(QWebEnginePage::LifecycleState::Discarded));
QCOMPARE(page.lifecycleState(), QWebEnginePage::LifecycleState::Discarded);
- QCOMPARE(visibleSpy.count(), 0);
+ QCOMPARE(visibleSpy.size(), 0);
QCOMPARE(page.isVisible(), false);
QTest::ignoreMessage(QtWarningMsg, "runJavaScript: disabled in Discarded state");
QCOMPARE(evaluateJavaScriptSync(&page, "document.wasDiscarded"), QVariant());
QTest::ignoreMessage(QtWarningMsg, "runJavaScript: disabled in Discarded state");
QCOMPARE(evaluateJavaScriptSync(&page, "frozenness"), QVariant());
- QCOMPARE(loadSpy.count(), 0);
+ QCOMPARE(loadSpy.size(), 0);
// Discarded -> Frozen (illegal!)
QTest::ignoreMessage(QtWarningMsg,
"setLifecycleState: failed to transition from Discarded to Frozen state: "
"illegal transition");
page.setLifecycleState(QWebEnginePage::LifecycleState::Frozen);
- QCOMPARE(lifecycleSpy.count(), 0);
+ QCOMPARE(lifecycleSpy.size(), 0);
QCOMPARE(page.lifecycleState(), QWebEnginePage::LifecycleState::Discarded);
// Discarded -> Active
page.setLifecycleState(QWebEnginePage::LifecycleState::Active);
- QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE(loadSpy.size(), 1);
QCOMPARE(loadSpy.takeFirst().value(0), QVariant(true));
- QCOMPARE(lifecycleSpy.count(), 1);
+ QCOMPARE(lifecycleSpy.size(), 1);
QCOMPARE(lifecycleSpy.takeFirst().value(0), QVariant::fromValue(QWebEnginePage::LifecycleState::Active));
QCOMPARE(page.lifecycleState(), QWebEnginePage::LifecycleState::Active);
- QCOMPARE(visibleSpy.count(), 0);
+ QCOMPARE(visibleSpy.size(), 0);
QCOMPARE(page.isVisible(), false);
QCOMPARE(evaluateJavaScriptSync(&page, "document.wasDiscarded"), QVariant(true));
QCOMPARE(evaluateJavaScriptSync(&page, "frozenness"), QVariant(0));
@@ -3781,21 +4196,21 @@ void tst_QWebEnginePage::setLifecycleState()
page.setLifecycleState(QWebEnginePage::LifecycleState::Frozen);
page.setLifecycleState(QWebEnginePage::LifecycleState::Discarded);
page.setLifecycleState(QWebEnginePage::LifecycleState::Active);
- QCOMPARE(lifecycleSpy.count(), 3);
+ QCOMPARE(lifecycleSpy.size(), 3);
QCOMPARE(lifecycleSpy.takeFirst().value(0), QVariant::fromValue(QWebEnginePage::LifecycleState::Frozen));
QCOMPARE(lifecycleSpy.takeFirst().value(0), QVariant::fromValue(QWebEnginePage::LifecycleState::Discarded));
QCOMPARE(lifecycleSpy.takeFirst().value(0), QVariant::fromValue(QWebEnginePage::LifecycleState::Active));
QCOMPARE(page.lifecycleState(), QWebEnginePage::LifecycleState::Active);
- QCOMPARE(visibleSpy.count(), 0);
+ QCOMPARE(visibleSpy.size(), 0);
QCOMPARE(page.isVisible(), false);
- QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE(loadSpy.size(), 1);
QCOMPARE(loadSpy.takeFirst().value(0), QVariant(true));
QCOMPARE(evaluateJavaScriptSync(&page, "document.wasDiscarded"), QVariant(true));
QCOMPARE(evaluateJavaScriptSync(&page, "frozenness"), QVariant(0));
// Reload clears document.wasDiscarded
page.triggerAction(QWebEnginePage::Reload);
- QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE(loadSpy.size(), 1);
QCOMPARE(loadSpy.takeFirst().value(0), QVariant(true));
QCOMPARE(evaluateJavaScriptSync(&page, "document.wasDiscarded"), QVariant(false));
}
@@ -3811,18 +4226,18 @@ void tst_QWebEnginePage::setVisible()
QSignalSpy visibleSpy(&page, &QWebEnginePage::visibleChanged);
page.load(QStringLiteral("about:blank"));
- QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE(loadSpy.size(), 1);
QCOMPARE(loadSpy.takeFirst().value(0), QVariant(true));
- QCOMPARE(lifecycleSpy.count(), 0);
+ QCOMPARE(lifecycleSpy.size(), 0);
QCOMPARE(page.lifecycleState(), QWebEnginePage::LifecycleState::Active);
- QCOMPARE(visibleSpy.count(), 0);
+ QCOMPARE(visibleSpy.size(), 0);
QCOMPARE(page.isVisible(), false);
// hidden -> visible
page.setVisible(true);
- QCOMPARE(lifecycleSpy.count(), 0);
+ QCOMPARE(lifecycleSpy.size(), 0);
QCOMPARE(page.lifecycleState(), QWebEnginePage::LifecycleState::Active);
- QCOMPARE(visibleSpy.count(), 1);
+ QCOMPARE(visibleSpy.size(), 1);
QCOMPARE(visibleSpy.takeFirst().value(0), QVariant(true));
QCOMPARE(page.isVisible(), true);
@@ -3831,28 +4246,28 @@ void tst_QWebEnginePage::setVisible()
QtWarningMsg,
"setLifecycleState: failed to transition from Active to Frozen state: page is visible");
page.setLifecycleState(QWebEnginePage::LifecycleState::Frozen);
- QCOMPARE(lifecycleSpy.count(), 0);
+ QCOMPARE(lifecycleSpy.size(), 0);
// visible -> hidden
page.setVisible(false);
- QCOMPARE(lifecycleSpy.count(), 0);
+ QCOMPARE(lifecycleSpy.size(), 0);
QCOMPARE(page.lifecycleState(), QWebEnginePage::LifecycleState::Active);
- QCOMPARE(visibleSpy.count(), 1);
+ QCOMPARE(visibleSpy.size(), 1);
QCOMPARE(visibleSpy.takeFirst().value(0), QVariant(false));
QCOMPARE(page.isVisible(), false);
// Active -> Frozen
page.setLifecycleState(QWebEnginePage::LifecycleState::Frozen);
- QCOMPARE(lifecycleSpy.count(), 1);
+ QCOMPARE(lifecycleSpy.size(), 1);
QCOMPARE(lifecycleSpy.takeFirst().value(0), QVariant::fromValue(QWebEnginePage::LifecycleState::Frozen));
QCOMPARE(page.lifecycleState(), QWebEnginePage::LifecycleState::Frozen);
// hidden -> visible (triggers Frozen -> Active)
page.setVisible(true);
- QCOMPARE(lifecycleSpy.count(), 1);
+ QCOMPARE(lifecycleSpy.size(), 1);
QCOMPARE(lifecycleSpy.takeFirst().value(0), QVariant::fromValue(QWebEnginePage::LifecycleState::Active));
QCOMPARE(page.lifecycleState(), QWebEnginePage::LifecycleState::Active);
- QCOMPARE(visibleSpy.count(), 1);
+ QCOMPARE(visibleSpy.size(), 1);
QCOMPARE(visibleSpy.takeFirst().value(0), QVariant(true));
QCOMPARE(page.isVisible(), true);
@@ -3861,31 +4276,31 @@ void tst_QWebEnginePage::setVisible()
"setLifecycleState: failed to transition from Active to Discarded state: "
"page is visible");
page.setLifecycleState(QWebEnginePage::LifecycleState::Discarded);
- QCOMPARE(lifecycleSpy.count(), 0);
+ QCOMPARE(lifecycleSpy.size(), 0);
// visible -> hidden
page.setVisible(false);
- QCOMPARE(lifecycleSpy.count(), 0);
+ QCOMPARE(lifecycleSpy.size(), 0);
QCOMPARE(page.lifecycleState(), QWebEnginePage::LifecycleState::Active);
- QCOMPARE(visibleSpy.count(), 1);
+ QCOMPARE(visibleSpy.size(), 1);
QCOMPARE(visibleSpy.takeFirst().value(0), QVariant(false));
QCOMPARE(page.isVisible(), false);
// Active -> Discarded
page.setLifecycleState(QWebEnginePage::LifecycleState::Discarded);
- QCOMPARE(lifecycleSpy.count(), 1);
+ QCOMPARE(lifecycleSpy.size(), 1);
QCOMPARE(lifecycleSpy.takeFirst().value(0), QVariant::fromValue(QWebEnginePage::LifecycleState::Discarded));
QCOMPARE(page.lifecycleState(), QWebEnginePage::LifecycleState::Discarded);
// hidden -> visible (triggers Discarded -> Active)
page.setVisible(true);
- QCOMPARE(lifecycleSpy.count(), 1);
+ QCOMPARE(lifecycleSpy.size(), 1);
QCOMPARE(lifecycleSpy.takeFirst().value(0), QVariant::fromValue(QWebEnginePage::LifecycleState::Active));
QCOMPARE(page.lifecycleState(), QWebEnginePage::LifecycleState::Active);
- QCOMPARE(visibleSpy.count(), 1);
+ QCOMPARE(visibleSpy.size(), 1);
QCOMPARE(visibleSpy.takeFirst().value(0), QVariant(true));
QCOMPARE(page.isVisible(), true);
- QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE(loadSpy.size(), 1);
QCOMPARE(loadSpy.takeFirst().value(0), QVariant(true));
}
@@ -3896,7 +4311,7 @@ void tst_QWebEnginePage::discardPreservesProperties()
QSignalSpy loadSpy(&page, &QWebEnginePage::loadFinished);
page.load(QStringLiteral("about:blank"));
- QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE(loadSpy.size(), 1);
QCOMPARE(loadSpy.takeFirst().value(0), QVariant(true));
// Change as many properties as possible to non-default values
@@ -3933,7 +4348,7 @@ void tst_QWebEnginePage::discardPreservesProperties()
// Discard + undiscard
page.setLifecycleState(QWebEnginePage::LifecycleState::Discarded);
page.setLifecycleState(QWebEnginePage::LifecycleState::Active);
- QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE(loadSpy.size(), 1);
QCOMPARE(loadSpy.takeFirst().value(0), QVariant(true));
// Property changes should be preserved
@@ -3972,7 +4387,7 @@ void tst_QWebEnginePage::automaticUndiscard()
QSignalSpy loadSpy(&page, &QWebEnginePage::loadFinished);
page.load(QStringLiteral("about:blank"));
- QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE(loadSpy.size(), 1);
QCOMPARE(loadSpy.takeFirst().value(0), QVariant(true));
// setUrl
@@ -3997,16 +4412,16 @@ void tst_QWebEnginePage::setLifecycleStateWithDevTools()
// Ensure pages are initialized
inspectedPage.load(QStringLiteral("about:blank"));
devToolsPage.load(QStringLiteral("about:blank"));
- QTRY_COMPARE_WITH_TIMEOUT(inspectedSpy.count(), 1, 30000);
+ QTRY_COMPARE_WITH_TIMEOUT(inspectedSpy.size(), 1, 90000);
QCOMPARE(inspectedSpy.takeFirst().value(0), QVariant(true));
- QTRY_COMPARE_WITH_TIMEOUT(devToolsSpy.count(), 1, 30000);
+ QTRY_COMPARE_WITH_TIMEOUT(devToolsSpy.size(), 1, 90000);
QCOMPARE(devToolsSpy.takeFirst().value(0), QVariant(true));
// Open DevTools with Frozen inspectedPage
inspectedPage.setLifecycleState(QWebEnginePage::LifecycleState::Frozen);
inspectedPage.setDevToolsPage(&devToolsPage);
QCOMPARE(inspectedPage.lifecycleState(), QWebEnginePage::LifecycleState::Active);
- QTRY_COMPARE(devToolsSpy.count(), 1);
+ QTRY_COMPARE_WITH_TIMEOUT(devToolsSpy.size(), 1, 90000);
QCOMPARE(devToolsSpy.takeFirst().value(0), QVariant(true));
inspectedPage.setDevToolsPage(nullptr);
@@ -4014,9 +4429,9 @@ void tst_QWebEnginePage::setLifecycleStateWithDevTools()
inspectedPage.setLifecycleState(QWebEnginePage::LifecycleState::Discarded);
inspectedPage.setDevToolsPage(&devToolsPage);
QCOMPARE(inspectedPage.lifecycleState(), QWebEnginePage::LifecycleState::Active);
- QTRY_COMPARE(devToolsSpy.count(), 1);
+ QTRY_COMPARE_WITH_TIMEOUT(devToolsSpy.size(), 1, 90000);
QCOMPARE(devToolsSpy.takeFirst().value(0), QVariant(true));
- QTRY_COMPARE(inspectedSpy.count(), 1);
+ QTRY_COMPARE(inspectedSpy.size(), 1);
QCOMPARE(inspectedSpy.takeFirst().value(0), QVariant(true));
inspectedPage.setDevToolsPage(nullptr);
@@ -4024,7 +4439,7 @@ void tst_QWebEnginePage::setLifecycleStateWithDevTools()
devToolsPage.setLifecycleState(QWebEnginePage::LifecycleState::Frozen);
devToolsPage.setInspectedPage(&inspectedPage);
QCOMPARE(devToolsPage.lifecycleState(), QWebEnginePage::LifecycleState::Active);
- QTRY_COMPARE(devToolsSpy.count(), 1);
+ QTRY_COMPARE_WITH_TIMEOUT(devToolsSpy.size(), 1, 90000);
QCOMPARE(devToolsSpy.takeFirst().value(0), QVariant(true));
devToolsPage.setInspectedPage(nullptr);
@@ -4032,8 +4447,7 @@ void tst_QWebEnginePage::setLifecycleStateWithDevTools()
devToolsPage.setLifecycleState(QWebEnginePage::LifecycleState::Discarded);
devToolsPage.setInspectedPage(&inspectedPage);
QCOMPARE(devToolsPage.lifecycleState(), QWebEnginePage::LifecycleState::Active);
- QTRY_COMPARE(devToolsSpy.count(), 2);
- QCOMPARE(devToolsSpy.takeFirst().value(0), QVariant(false));
+ QTRY_COMPARE_WITH_TIMEOUT(devToolsSpy.size(), 1, 90000);
QCOMPARE(devToolsSpy.takeFirst().value(0), QVariant(true));
// keep DevTools open
@@ -4071,35 +4485,35 @@ void tst_QWebEnginePage::discardPreservesCommittedLoad()
QString url = QStringLiteral("qrc:/resources/lifecycle.html");
page.setUrl(url);
- QTRY_COMPARE(loadStartedSpy.count(), 1);
+ QTRY_COMPARE(loadStartedSpy.size(), 1);
loadStartedSpy.clear();
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
QCOMPARE(loadFinishedSpy.takeFirst().value(0), QVariant(true));
- QCOMPARE(urlChangedSpy.count(), 1);
+ QCOMPARE(urlChangedSpy.size(), 1);
QCOMPARE(urlChangedSpy.takeFirst().value(0), QVariant(QUrl(url)));
QCOMPARE(page.url(), url);
- QCOMPARE(titleChangedSpy.count(), 2);
+ QCOMPARE(titleChangedSpy.size(), 2);
QCOMPARE(titleChangedSpy.takeFirst().value(0), QVariant(url));
QString title = QStringLiteral("Lifecycle");
QCOMPARE(titleChangedSpy.takeFirst().value(0), QVariant(title));
QCOMPARE(page.title(), title);
page.setLifecycleState(QWebEnginePage::LifecycleState::Discarded);
- QCOMPARE(loadStartedSpy.count(), 0);
- QCOMPARE(loadFinishedSpy.count(), 0);
- QCOMPARE(urlChangedSpy.count(), 0);
+ QCOMPARE(loadStartedSpy.size(), 0);
+ QCOMPARE(loadFinishedSpy.size(), 0);
+ QCOMPARE(urlChangedSpy.size(), 0);
QCOMPARE(page.url(), QUrl(url));
- QCOMPARE(titleChangedSpy.count(), 0);
+ QCOMPARE(titleChangedSpy.size(), 0);
QCOMPARE(page.title(), title);
page.setLifecycleState(QWebEnginePage::LifecycleState::Active);
- QTRY_COMPARE(loadStartedSpy.count(), 1);
+ QTRY_COMPARE(loadStartedSpy.size(), 1);
loadStartedSpy.clear();
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
QCOMPARE(loadFinishedSpy.takeFirst().value(0), QVariant(true));
- QCOMPARE(urlChangedSpy.count(), 0);
+ QCOMPARE(urlChangedSpy.size(), 0);
QCOMPARE(page.url(), url);
- QCOMPARE(titleChangedSpy.count(), 0);
+ QCOMPARE(titleChangedSpy.size(), 0);
QCOMPARE(page.title(), title);
}
@@ -4116,21 +4530,21 @@ void tst_QWebEnginePage::discardAbortsPendingLoad()
[&]() { page.setLifecycleState(QWebEnginePage::LifecycleState::Discarded); });
QUrl url = QStringLiteral("qrc:/resources/lifecycle.html");
page.setUrl(url);
- QTRY_COMPARE(loadStartedSpy.count(), 1);
+ QTRY_COMPARE(loadStartedSpy.size(), 1);
loadStartedSpy.clear();
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
QCOMPARE(loadFinishedSpy.takeFirst().value(0), QVariant(false));
- QCOMPARE(urlChangedSpy.count(), 2);
+ QCOMPARE(urlChangedSpy.size(), 2);
QCOMPARE(urlChangedSpy.takeFirst().value(0), QVariant(url));
QCOMPARE(urlChangedSpy.takeFirst().value(0), QVariant(QUrl()));
- QCOMPARE(titleChangedSpy.count(), 0);
+ QCOMPARE(titleChangedSpy.size(), 0);
QCOMPARE(page.url(), QUrl());
QCOMPARE(page.title(), QString());
page.setLifecycleState(QWebEnginePage::LifecycleState::Active);
- QCOMPARE(loadStartedSpy.count(), 0);
- QCOMPARE(loadFinishedSpy.count(), 0);
- QCOMPARE(urlChangedSpy.count(), 0);
+ QCOMPARE(loadStartedSpy.size(), 0);
+ QCOMPARE(loadFinishedSpy.size(), 0);
+ QCOMPARE(urlChangedSpy.size(), 0);
QCOMPARE(page.url(), QUrl());
QCOMPARE(page.title(), QString());
}
@@ -4146,14 +4560,14 @@ void tst_QWebEnginePage::discardAbortsPendingLoadAndPreservesCommittedLoad()
QString url1 = QStringLiteral("qrc:/resources/lifecycle.html");
page.setUrl(url1);
- QTRY_COMPARE(loadStartedSpy.count(), 1);
+ QTRY_COMPARE(loadStartedSpy.size(), 1);
loadStartedSpy.clear();
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
QCOMPARE(loadFinishedSpy.takeFirst().value(0), QVariant(true));
- QCOMPARE(urlChangedSpy.count(), 1);
+ QCOMPARE(urlChangedSpy.size(), 1);
QCOMPARE(urlChangedSpy.takeFirst().value(0), QVariant(QUrl(url1)));
QCOMPARE(page.url(), url1);
- QCOMPARE(titleChangedSpy.count(), 2);
+ QCOMPARE(titleChangedSpy.size(), 2);
QCOMPARE(titleChangedSpy.takeFirst().value(0), QVariant(url1));
QString title = QStringLiteral("Lifecycle");
QCOMPARE(titleChangedSpy.takeFirst().value(0), QVariant(title));
@@ -4163,21 +4577,21 @@ void tst_QWebEnginePage::discardAbortsPendingLoadAndPreservesCommittedLoad()
[&]() { page.setLifecycleState(QWebEnginePage::LifecycleState::Discarded); });
QString url2 = QStringLiteral("about:blank");
page.setUrl(url2);
- QTRY_COMPARE(loadStartedSpy.count(), 1);
+ QTRY_COMPARE(loadStartedSpy.size(), 1);
loadStartedSpy.clear();
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
QCOMPARE(loadFinishedSpy.takeFirst().value(0), QVariant(false));
- QCOMPARE(urlChangedSpy.count(), 2);
+ QCOMPARE(urlChangedSpy.size(), 2);
QCOMPARE(urlChangedSpy.takeFirst().value(0), QVariant(QUrl(url2)));
QCOMPARE(urlChangedSpy.takeFirst().value(0), QVariant(QUrl(url1)));
- QCOMPARE(titleChangedSpy.count(), 0);
+ QCOMPARE(titleChangedSpy.size(), 0);
QCOMPARE(page.url(), url1);
QCOMPARE(page.title(), title);
page.setLifecycleState(QWebEnginePage::LifecycleState::Active);
- QCOMPARE(loadStartedSpy.count(), 0);
- QCOMPARE(loadFinishedSpy.count(), 0);
- QCOMPARE(urlChangedSpy.count(), 0);
+ QCOMPARE(loadStartedSpy.size(), 0);
+ QCOMPARE(loadFinishedSpy.size(), 0);
+ QCOMPARE(urlChangedSpy.size(), 0);
QCOMPARE(page.url(), url1);
QCOMPARE(page.title(), title);
}
@@ -4273,32 +4687,32 @@ void tst_QWebEnginePage::recommendedStateAuto()
connect(&page, &QWebEnginePage::recommendedStateChanged, &page, &QWebEnginePage::setLifecycleState);
page.load(QStringLiteral("qrc:/resources/lifecycle.html"));
- QTRY_COMPARE(lifecycleSpy.count(), 2);
+ QTRY_COMPARE(lifecycleSpy.size(), 2);
QCOMPARE(lifecycleSpy.takeFirst().value(0), QVariant::fromValue(QWebEnginePage::LifecycleState::Frozen));
QCOMPARE(lifecycleSpy.takeFirst().value(0), QVariant::fromValue(QWebEnginePage::LifecycleState::Discarded));
page.setVisible(true);
- QTRY_COMPARE(lifecycleSpy.count(), 1);
+ QTRY_COMPARE(lifecycleSpy.size(), 1);
QCOMPARE(lifecycleSpy.takeFirst().value(0), QVariant::fromValue(QWebEnginePage::LifecycleState::Active));
page.setVisible(false);
- QTRY_COMPARE(lifecycleSpy.count(), 2);
+ QTRY_COMPARE(lifecycleSpy.size(), 2);
QCOMPARE(lifecycleSpy.takeFirst().value(0), QVariant::fromValue(QWebEnginePage::LifecycleState::Frozen));
QCOMPARE(lifecycleSpy.takeFirst().value(0), QVariant::fromValue(QWebEnginePage::LifecycleState::Discarded));
page.triggerAction(QWebEnginePage::Reload);
- QTRY_COMPARE(lifecycleSpy.count(), 3);
+ QTRY_COMPARE(lifecycleSpy.size(), 3);
QCOMPARE(lifecycleSpy.takeFirst().value(0), QVariant::fromValue(QWebEnginePage::LifecycleState::Active));
QCOMPARE(lifecycleSpy.takeFirst().value(0), QVariant::fromValue(QWebEnginePage::LifecycleState::Frozen));
QCOMPARE(lifecycleSpy.takeFirst().value(0), QVariant::fromValue(QWebEnginePage::LifecycleState::Discarded));
QWebEnginePage devTools;
page.setDevToolsPage(&devTools);
- QTRY_COMPARE(lifecycleSpy.count(), 1);
+ QTRY_COMPARE(lifecycleSpy.size(), 1);
QCOMPARE(lifecycleSpy.takeFirst().value(0), QVariant::fromValue(QWebEnginePage::LifecycleState::Active));
page.setDevToolsPage(nullptr);
- QTRY_COMPARE(lifecycleSpy.count(), 2);
+ QTRY_COMPARE(lifecycleSpy.size(), 2);
QCOMPARE(lifecycleSpy.takeFirst().value(0), QVariant::fromValue(QWebEnginePage::LifecycleState::Frozen));
QCOMPARE(lifecycleSpy.takeFirst().value(0), QVariant::fromValue(QWebEnginePage::LifecycleState::Discarded));
}
@@ -4313,33 +4727,33 @@ void tst_QWebEnginePage::setLifecycleStateAndReload()
QSignalSpy lifecycleSpy(&page, &QWebEnginePage::lifecycleStateChanged);
page.load(QStringLiteral("qrc:/resources/lifecycle.html"));
- QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE(loadSpy.size(), 1);
QCOMPARE(loadSpy.takeFirst().value(0), QVariant(true));
- QCOMPARE(lifecycleSpy.count(), 0);
+ QCOMPARE(lifecycleSpy.size(), 0);
QCOMPARE(page.lifecycleState(), QWebEnginePage::LifecycleState::Active);
page.setLifecycleState(QWebEnginePage::LifecycleState::Frozen);
QCOMPARE(page.lifecycleState(), QWebEnginePage::LifecycleState::Frozen);
- QCOMPARE(lifecycleSpy.count(), 1);
+ QCOMPARE(lifecycleSpy.size(), 1);
QCOMPARE(lifecycleSpy.takeFirst().value(0), QVariant::fromValue(QWebEnginePage::LifecycleState::Frozen));
page.triggerAction(QWebEnginePage::Reload);
QCOMPARE(page.lifecycleState(), QWebEnginePage::LifecycleState::Active);
- QCOMPARE(lifecycleSpy.count(), 1);
+ QCOMPARE(lifecycleSpy.size(), 1);
QCOMPARE(lifecycleSpy.takeFirst().value(0), QVariant::fromValue(QWebEnginePage::LifecycleState::Active));
- QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE(loadSpy.size(), 1);
QCOMPARE(loadSpy.takeFirst().value(0), QVariant(true));
page.setLifecycleState(QWebEnginePage::LifecycleState::Discarded);
QCOMPARE(page.lifecycleState(), QWebEnginePage::LifecycleState::Discarded);
- QCOMPARE(lifecycleSpy.count(), 1);
+ QCOMPARE(lifecycleSpy.size(), 1);
QCOMPARE(lifecycleSpy.takeFirst().value(0), QVariant::fromValue(QWebEnginePage::LifecycleState::Discarded));
page.triggerAction(QWebEnginePage::Reload);
QCOMPARE(page.lifecycleState(), QWebEnginePage::LifecycleState::Active);
- QCOMPARE(lifecycleSpy.count(), 1);
+ QCOMPARE(lifecycleSpy.size(), 1);
QCOMPARE(lifecycleSpy.takeFirst().value(0), QVariant::fromValue(QWebEnginePage::LifecycleState::Active));
- QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE(loadSpy.size(), 1);
QCOMPARE(loadSpy.takeFirst().value(0), QVariant(true));
}
@@ -4358,20 +4772,20 @@ void tst_QWebEnginePage::editActionsWithExplicitFocus()
QVERIFY(!page->action(QWebEnginePage::SelectAll)->isEnabled());
page->setHtml(QString("<html><body><div>foo bar</div></body></html>"));
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
// Still no focus because focus on navigation is disabled. Edit actions don't do anything (should not crash).
QVERIFY(!page->action(QWebEnginePage::SelectAll)->isEnabled());
view.page()->triggerAction(QWebEnginePage::SelectAll);
- QCOMPARE(selectionChangedSpy.count(), 0);
+ QCOMPARE(selectionChangedSpy.size(), 0);
QCOMPARE(page->hasSelection(), false);
// Focus content by focusing window from JavaScript. Edit actions should be enabled and functional.
evaluateJavaScriptSync(page, "window.focus();");
- QTRY_COMPARE(actionChangedSpy.count(), 1);
+ QTRY_COMPARE(actionChangedSpy.size(), 1);
QVERIFY(page->action(QWebEnginePage::SelectAll)->isEnabled());
view.page()->triggerAction(QWebEnginePage::SelectAll);
- QTRY_COMPARE(selectionChangedSpy.count(), 1);
+ QTRY_COMPARE(selectionChangedSpy.size(), 1);
QCOMPARE(page->hasSelection(), true);
QCOMPARE(page->selectedText(), QStringLiteral("foo bar"));
}
@@ -4391,13 +4805,13 @@ void tst_QWebEnginePage::editActionsWithInitialFocus()
QVERIFY(!page->action(QWebEnginePage::SelectAll)->isEnabled());
page->setHtml(QString("<html><body><div>foo bar</div></body></html>"));
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
// Content gets initial focus.
- QTRY_COMPARE(actionChangedSpy.count(), 1);
+ QTRY_COMPARE(actionChangedSpy.size(), 1);
QVERIFY(page->action(QWebEnginePage::SelectAll)->isEnabled());
view.page()->triggerAction(QWebEnginePage::SelectAll);
- QTRY_COMPARE(selectionChangedSpy.count(), 1);
+ QTRY_COMPARE(selectionChangedSpy.size(), 1);
QCOMPARE(page->hasSelection(), true);
QCOMPARE(page->selectedText(), QStringLiteral("foo bar"));
}
@@ -4417,15 +4831,15 @@ void tst_QWebEnginePage::editActionsWithFocusOnIframe()
QVERIFY(!page->action(QWebEnginePage::SelectAll)->isEnabled());
page->load(QUrl("qrc:///resources/iframe2.html"));
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
QVERIFY(!page->action(QWebEnginePage::SelectAll)->isEnabled());
// Focusing an iframe.
evaluateJavaScriptSync(page, "document.getElementsByTagName('iframe')[0].contentWindow.focus()");
- QTRY_COMPARE(actionChangedSpy.count(), 1);
+ QTRY_COMPARE(actionChangedSpy.size(), 1);
QVERIFY(page->action(QWebEnginePage::SelectAll)->isEnabled());
view.page()->triggerAction(QWebEnginePage::SelectAll);
- QTRY_COMPARE(selectionChangedSpy.count(), 1);
+ QTRY_COMPARE(selectionChangedSpy.size(), 1);
QCOMPARE(page->hasSelection(), true);
QCOMPARE(page->selectedText(), QStringLiteral("inner"));
}
@@ -4441,8 +4855,8 @@ void tst_QWebEnginePage::editActionsWithoutSelection()
QSignalSpy actionChangedSpy(page->action(QWebEnginePage::SelectAll), &QAction::changed);
page->setHtml(QString("<html><body><div>foo bar</div></body></html>"));
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
- QTRY_COMPARE(actionChangedSpy.count(), 1);
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
+ QTRY_COMPARE(actionChangedSpy.size(), 1);
QVERIFY(!page->action(QWebEnginePage::Cut)->isEnabled());
QVERIFY(!page->action(QWebEnginePage::Copy)->isEnabled());
@@ -4454,7 +4868,7 @@ void tst_QWebEnginePage::editActionsWithoutSelection()
QVERIFY(!page->action(QWebEnginePage::Unselect)->isEnabled());
page->triggerAction(QWebEnginePage::SelectAll);
- QTRY_COMPARE(selectionChangedSpy.count(), 1);
+ QTRY_COMPARE(selectionChangedSpy.size(), 1);
QCOMPARE(page->hasSelection(), true);
QCOMPARE(page->selectedText(), QStringLiteral("foo bar"));
@@ -4468,6 +4882,28 @@ void tst_QWebEnginePage::editActionsWithoutSelection()
QVERIFY(page->action(QWebEnginePage::Unselect)->isEnabled());
}
+struct PageWithNewWindowHandler : QWebEnginePage
+{
+ QScopedPointer<PageWithNewWindowHandler> newPage;
+ bool handleInSignal;
+ QWebEngineProfile *targetProfile = nullptr;
+ QSignalSpy loadSpy { this, &QWebEnginePage::loadFinished };
+ PageWithNewWindowHandler(QWebEngineProfile *p, bool inSignal = false, QWebEngineProfile *tp = nullptr)
+ : QWebEnginePage(p), handleInSignal(inSignal), targetProfile(tp) {
+ if (handleInSignal)
+ connect(this, &QWebEnginePage::newWindowRequested, this, [this] (QWebEngineNewWindowRequest &r) {
+ newPage.reset(new PageWithNewWindowHandler(targetProfile ? targetProfile : profile(), handleInSignal));
+ newPage->acceptAsNewWindow(r);
+ });
+ }
+ QWebEnginePage *createWindow(WebWindowType) override {
+ if (handleInSignal)
+ return nullptr;
+ newPage.reset(new PageWithNewWindowHandler(targetProfile ? targetProfile : profile(), handleInSignal));
+ return newPage.get();
+ }
+};
+
void tst_QWebEnginePage::customUserAgentInNewTab()
{
HttpServer server;
@@ -4480,55 +4916,84 @@ void tst_QWebEnginePage::customUserAgentInNewTab()
});
QVERIFY(server.start());
- class Page : public QWebEnginePage {
- public:
- QWebEngineProfile *targetProfile = nullptr;
- QScopedPointer<QWebEnginePage> newPage;
- Page(QWebEngineProfile *profile) : QWebEnginePage(profile) {}
- private:
- QWebEnginePage *createWindow(WebWindowType) override
- {
- newPage.reset(new QWebEnginePage(targetProfile ? targetProfile : profile(), nullptr));
- return newPage.data();
- }
- };
- QWebEngineProfile profile1, profile2;
- profile1.setHttpUserAgent(QStringLiteral("custom 1"));
- profile2.setHttpUserAgent(QStringLiteral("custom 2"));
- Page page(&profile1);
- QWebEngineView view;
- view.resize(500, 500);
- view.setPage(&page);
- view.show();
+ QString expectedUserAgent("custom 1");
+ QWebEngineProfile profile;
+ profile.setHttpUserAgent(expectedUserAgent);
+
+ PageWithNewWindowHandler page(&profile);
+ QWebEngineView view; view.resize(500, 500); view.setPage(&page); view.show();
QVERIFY(QTest::qWaitForWindowExposed(&view));
- QSignalSpy spy(&page, &QWebEnginePage::loadFinished);
// First check we can get the user-agent passed through normally
page.setHtml(QString("<html><body><a id='link' target='_blank' href='") +
server.url("/test1").toEncoded() +
QString("'>link</a></body></html>"));
- QTRY_COMPARE(spy.count(), 1);
- QVERIFY(spy.takeFirst().value(0).toBool());
- QCOMPARE(evaluateJavaScriptSync(&page, QStringLiteral("navigator.userAgent")).toString(), profile1.httpUserAgent());
+ QTRY_COMPARE(page.loadSpy.size(), 1);
+ QVERIFY(page.loadSpy.takeFirst().value(0).toBool());
+ QCOMPARE(evaluateJavaScriptSync(&page, QStringLiteral("navigator.userAgent")).toString(), expectedUserAgent);
QTest::mouseClick(view.focusProxy(), Qt::LeftButton, {}, elementCenter(&page, "link"));
QTRY_VERIFY(page.newPage);
+ QTRY_COMPARE(page.newPage->loadSpy.size(), 1);
QTRY_VERIFY(!lastUserAgent.isEmpty());
- QCOMPARE(lastUserAgent, profile1.httpUserAgent().toUtf8());
+ QCOMPARE(lastUserAgent, expectedUserAgent);
+ QCOMPARE(evaluateJavaScriptSync(page.newPage.get(), QStringLiteral("navigator.userAgent")).toString(), expectedUserAgent);
// Now check we can get the new user-agent of the profile
page.newPage.reset();
- page.targetProfile = &profile2;
- spy.clear();
+ expectedUserAgent = "custom 2";
+ profile.setHttpUserAgent(expectedUserAgent);
+ page.loadSpy.clear();
lastUserAgent = { };
page.setHtml(QString("<html><body><a id='link' target='_blank' href='") +
server.url("/test2").toEncoded() +
QString("'>link</a></body></html>"));
- QTRY_COMPARE(spy.count(), 1);
- QVERIFY(spy.takeFirst().value(0).toBool());
+ QTRY_COMPARE(page.loadSpy.size(), 1);
+ QVERIFY(page.loadSpy.takeFirst().value(0).toBool());
QTest::mouseClick(view.focusProxy(), Qt::LeftButton, {}, elementCenter(&page, "link"));
QTRY_VERIFY(page.newPage);
+ QTRY_COMPARE(page.newPage->loadSpy.size(), 1);
QTRY_VERIFY(!lastUserAgent.isEmpty());
- QCOMPARE(lastUserAgent, profile2.httpUserAgent().toUtf8());
+ QCOMPARE(lastUserAgent, expectedUserAgent);
+ QCOMPARE(evaluateJavaScriptSync(&page, QStringLiteral("navigator.userAgent")).toString(), expectedUserAgent);
+ QCOMPARE(evaluateJavaScriptSync(page.newPage.get(), QStringLiteral("navigator.userAgent")).toString(), expectedUserAgent);
+}
+
+void tst_QWebEnginePage::openNewTabInDifferentProfile_data()
+{
+ QTest::addColumn<bool>("handleInSignal");
+ QTest::addRow("handleInSignal") << true;
+ QTest::addRow("handleInOverride") << false;
+}
+
+void tst_QWebEnginePage::openNewTabInDifferentProfile()
+{
+ QFETCH(bool, handleInSignal);
+
+ HttpServer server;
+ QStringList receivedRequests;
+ connect(&server, &HttpServer::newRequest, [&] (HttpReqRep *r) {
+ receivedRequests.append(r->requestPath());
+ r->setResponseBody("DUMMY");
+ r->sendResponse();
+ });
+ QVERIFY(server.start());
+
+ QWebEngineProfile profile1, profile2;
+ PageWithNewWindowHandler page(&profile1, handleInSignal, &profile2);
+ QWebEngineView view; view.setPage(&page); view.resize(320, 240); view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
+
+ page.setHtml(QString("<html><body><a id='link' target='_blank' href='%1'>link</a></body></html>").arg(server.url("/first.html").toEncoded()));
+ QTRY_COMPARE(page.loadSpy.size(), 1);
+ QVERIFY(page.loadSpy.takeFirst().value(0).toBool());
+
+ QTest::mouseClick(view.focusProxy(), Qt::LeftButton, {}, elementCenter(&page, "link"));
+ QTRY_VERIFY(page.newPage);
+ QVERIFY(page.profile() == &profile1);
+ QVERIFY(page.newPage->profile() == &profile2);
+ // not load should occur or requests to server issued since web_contents is not expected to be adopted from other profile
+ QTRY_LOOP_IMPL(page.newPage->loadSpy.size() != 0, 1000, 100);
+ QVERIFY2(receivedRequests.isEmpty(), qPrintable(receivedRequests.join(", ")));
}
void tst_QWebEnginePage::renderProcessCrashed()
@@ -4569,6 +5034,141 @@ void tst_QWebEnginePage::renderProcessPid()
QCOMPARE(m_page->renderProcessPid(), 0);
}
+class FileSelectionTestPage : public QWebEnginePage {
+public:
+ FileSelectionTestPage() : m_tempDir(QDir::tempPath() + "/tst_qwebenginepage-XXXXXX") { }
+
+ QStringList chooseFiles(FileSelectionMode mode, const QStringList &oldFiles, const QStringList &acceptedMimeTypes) override
+ {
+ Q_UNUSED(oldFiles);
+ chosenFileSelectionMode = mode;
+ chosenAcceptedMimeTypes = acceptedMimeTypes;
+ return QStringList() << (m_tempDir.path() + "/file.txt");
+ }
+
+ QTemporaryDir m_tempDir;
+ int chosenFileSelectionMode = -1;
+ QStringList chosenAcceptedMimeTypes;
+};
+
+void tst_QWebEnginePage::testChooseFilesParameters_data()
+{
+ QTest::addColumn<QString>("uploadAttribute");
+ QTest::addColumn<QString>("mimeTypeAttribute");
+ QTest::addColumn<QWebEnginePage::FileSelectionMode>("expectedFileSelectionMode");
+ QTest::addColumn<QStringList>("expectedMimeType");
+ QStringList mimeTypes;
+
+ QTest::addRow("Single file upload") << QString() << QString()
+ << QWebEnginePage::FileSelectOpen << QStringList();
+ QTest::addRow("Multiple file upload") << QString("multiple") << QString()
+ << QWebEnginePage::FileSelectOpenMultiple << QStringList();
+ QTest::addRow("Folder upload") << QString("multiple webkitdirectory") << QString()
+ << QWebEnginePage::FileSelectUploadFolder << QStringList();
+ QTest::addRow("Save file") << QString("") << QString()
+ << QWebEnginePage::FileSelectSave << QStringList();
+ mimeTypes = QStringList() << "audio/*";
+ QTest::addRow("MIME type: audio") << QString() << QString("accept='%1'").arg(mimeTypes.join(','))
+ << QWebEnginePage::FileSelectOpen << mimeTypes;
+ mimeTypes = QStringList() << "video/*";
+ QTest::addRow("MIME type: video") << QString() << QString("accept='%1'").arg(mimeTypes.join(','))
+ << QWebEnginePage::FileSelectOpen << mimeTypes;
+ mimeTypes = QStringList() << "image/*";
+ QTest::addRow("MIME type: image") << QString() << QString("accept='%1'").arg(mimeTypes.join(','))
+ << QWebEnginePage::FileSelectOpen << mimeTypes;
+ mimeTypes = QStringList() << ".txt" << ".html";
+ QTest::addRow("MIME type: custom") << QString() << QString("accept='%1'").arg(mimeTypes.join(','))
+ << QWebEnginePage::FileSelectOpen << mimeTypes;
+ mimeTypes = QStringList() << "audio/*" << "video/*" << "image/*" << ".txt" << ".html";
+ QTest::addRow("Multiple MIME types") << QString() << QString("accept='%1'").arg(mimeTypes.join(','))
+ << QWebEnginePage::FileSelectOpen << mimeTypes;
+}
+
+void tst_QWebEnginePage::testChooseFilesParameters()
+{
+ QFETCH(QString, uploadAttribute);
+ QFETCH(QString, mimeTypeAttribute);
+ QFETCH(QWebEnginePage::FileSelectionMode, expectedFileSelectionMode);
+ QFETCH(QStringList, expectedMimeType);
+
+ FileSelectionTestPage page;
+ QSignalSpy spyFinished(&page, &QWebEnginePage::loadFinished);
+
+ QWebEngineView view;
+ view.resize(500, 500);
+ view.setPage(&page);
+ view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
+
+ if (expectedFileSelectionMode != QWebEnginePage::FileSelectSave) {
+ page.setHtml(QString("<html><body>"
+ "<input id='filePicker' type='file' name='filePicker' %1 %2 />"
+ "</body></html>").arg(uploadAttribute, mimeTypeAttribute));
+ } else {
+ page.setHtml(QString("<html><body>"
+ "<button id='filePicker' value='trigger' "
+ "onclick='window.showSaveFilePicker()'"
+ "</body></html>"), QString("qrc:/"));
+ }
+ QVERIFY(spyFinished.wait());
+ QTRY_COMPARE(spyFinished.size(), 1);
+
+ evaluateJavaScriptSync(view.page(), "document.getElementById('filePicker').focus()");
+ QTRY_COMPARE(evaluateJavaScriptSync(view.page(), "document.activeElement.id").toString(), QStringLiteral("filePicker"));
+ QTest::keyClick(view.focusProxy(), Qt::Key_Enter);
+
+ QTRY_COMPARE(page.chosenFileSelectionMode, expectedFileSelectionMode);
+ QTRY_COMPARE(page.chosenAcceptedMimeTypes, expectedMimeType);
+}
+
+void tst_QWebEnginePage::fileSystemAccessDialog()
+{
+ FileSelectionTestPage page;
+ QSignalSpy spyFinished(&page, &QWebEnginePage::loadFinished);
+
+ QWebEngineView view;
+ view.resize(500, 500);
+ view.setPage(&page);
+ view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
+
+ connect(&page, &QWebEnginePage::fileSystemAccessRequested,
+ [](QWebEngineFileSystemAccessRequest request) {
+ QCOMPARE(request.accessFlags(),
+ QWebEngineFileSystemAccessRequest::Read
+ | QWebEngineFileSystemAccessRequest::Write);
+ request.accept();
+ });
+
+ page.setHtml(QString("<html><head><script>"
+ "async function getTemporaryDir() {"
+ " const newHandle = await window.showSaveFilePicker();"
+ " const writable = await newHandle.createWritable();"
+ " await writable.write(new Blob(['New value']));"
+ " await writable.close();"
+ ""
+ " const fileData = await newHandle.getFile();"
+ " document.title = await fileData.text();"
+ "}"
+ "</script></head><body>"
+ "<button id='triggerDialog' value='trigger' "
+ "onclick='getTemporaryDir()'"
+ "</body></html>"),
+ QString("qrc:/"));
+ QVERIFY(spyFinished.wait());
+ QTRY_COMPARE(spyFinished.size(), 1);
+
+ evaluateJavaScriptSync(view.page(), "document.getElementById('triggerDialog').focus()");
+ QTRY_COMPARE(evaluateJavaScriptSync(view.page(), "document.activeElement.id").toString(),
+ QStringLiteral("triggerDialog"));
+ QTest::keyClick(view.focusProxy(), Qt::Key_Enter);
+
+ QTRY_COMPARE(page.title(), "New value");
+
+ QTRY_COMPARE(page.chosenFileSelectionMode, QWebEnginePage::FileSelectSave);
+ QTRY_COMPARE(page.chosenAcceptedMimeTypes, QStringList());
+}
+
void tst_QWebEnginePage::backgroundColor()
{
QWebEngineProfile profile;
@@ -4622,24 +5222,27 @@ void tst_QWebEnginePage::audioMuted()
page.setAudioMuted(true);
loadSync(&page, QUrl("about:blank"));
QCOMPARE(page.isAudioMuted(), true);
- QCOMPARE(spy.count(), 1);
+ QCOMPARE(spy.size(), 1);
QCOMPARE(spy[0][0], QVariant(true));
page.setAudioMuted(false);
QCOMPARE(page.isAudioMuted(), false);
- QCOMPARE(spy.count(), 2);
+ QCOMPARE(spy.size(), 2);
QCOMPARE(spy[1][0], QVariant(false));
}
void tst_QWebEnginePage::closeContents()
{
TestPage page;
+ QSignalSpy spyFinished(&page, &QWebEnginePage::loadFinished);
QSignalSpy windowCreatedSpy(&page, &TestPage::windowCreated);
+ page.setUrl(QUrl("about:blank"));
+ QTRY_COMPARE(spyFinished.size(), 1);
page.runJavaScript("var dialog = window.open('', '', 'width=100, height=100');");
- QTRY_COMPARE(windowCreatedSpy.count(), 1);
+ QTRY_COMPARE(windowCreatedSpy.size(), 1);
QWebEngineView *dialogView = new QWebEngineView;
QWebEnginePage *dialogPage = page.createdWindows[0];
- dialogPage->setView(dialogView);
+ dialogView->setPage(dialogPage);
QCOMPARE(dialogPage->lifecycleState(), QWebEnginePage::LifecycleState::Active);
// This should not crash.
@@ -4662,8 +5265,8 @@ void tst_QWebEnginePage::isSafeRedirect_data()
fileScheme += "/";
#endif
- QString tempDir(fileScheme + QDir::tempPath());
- QTest::newRow(qPrintable(tempDir)) << QUrl(tempDir) << QUrl(tempDir + "/");
+ QString tempDir(fileScheme + QDir::tempPath() + "/");
+ QTest::newRow(qPrintable(tempDir)) << QUrl(tempDir) << QUrl(tempDir);
QTest::newRow(qPrintable(tempDir + QString("/foo/bar"))) << QUrl(tempDir + "/foo/bar") << QUrl(tempDir + "/foo/bar");
QTest::newRow("filesystem:http://foo.com/bar") << QUrl("filesystem:http://foo.com/bar") << QUrl("filesystem:http://foo.com/bar/");
}
@@ -4676,11 +5279,452 @@ void tst_QWebEnginePage::isSafeRedirect()
TestPage page;
QSignalSpy spy(&page, SIGNAL(loadFinished(bool)));
page.setUrl(requestedUrl);
- QTRY_COMPARE_WITH_TIMEOUT(spy.count(), 1, 20000);
+ QTRY_COMPARE_WITH_TIMEOUT(spy.size(), 1, 20000);
QCOMPARE(page.url(), expectedUrl);
spy.clear();
}
+class LocalRemoteUrlSchemeHandler : public QWebEngineUrlSchemeHandler
+{
+public:
+ LocalRemoteUrlSchemeHandler(QObject *parent = nullptr)
+ : QWebEngineUrlSchemeHandler(parent)
+ {
+ }
+ ~LocalRemoteUrlSchemeHandler() = default;
+
+ void requestStarted(QWebEngineUrlRequestJob *job) override
+ {
+ QBuffer *buffer = new QBuffer(job);
+ buffer->setData("<html><body><a href='remote://test.html' id='link'>Click link</a></body></html>");
+ job->reply("text/html", buffer);
+ loaded = true;
+ }
+ bool loaded = false;
+};
+
+void tst_QWebEnginePage::localToRemoteNavigation()
+{
+ LocalRemoteUrlSchemeHandler local;
+ LocalRemoteUrlSchemeHandler remote;
+ QWebEngineProfile profile;
+ profile.installUrlSchemeHandler("local", &local);
+ profile.installUrlSchemeHandler("remote", &remote);
+
+ QWebEnginePage page(&profile);
+ QSignalSpy loadSpy(&page, SIGNAL(loadFinished(bool)));
+ QWebEngineView view;
+ view.resize(640, 480);
+ view.show();
+ view.setPage(&page);
+ page.setUrl(QUrl("local://test.html"));
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QTRY_COMPARE_WITH_TIMEOUT(loadSpy.size(), 1, 20000);
+ QVERIFY(local.loaded);
+
+ // Should navigate:
+ QTest::mouseClick(view.focusProxy(), Qt::LeftButton, {}, elementCenter(&page, "link"));
+ QTRY_COMPARE_WITH_TIMEOUT(loadSpy.size(), 2, 20000);
+ QVERIFY(remote.loaded);
+ local.loaded = false;
+ remote.loaded = false;
+
+ page.setUrl(QUrl("local://test.html"));
+ QTRY_COMPARE_WITH_TIMEOUT(loadSpy.size(), 3, 20000);
+ QVERIFY(local.loaded && !remote.loaded);
+
+ // Should not navigate:
+ page.runJavaScript(QStringLiteral("document.getElementById(\"link\").click()"));
+ QTest::qWait(500);
+ QVERIFY(!remote.loaded);
+}
+
+void tst_QWebEnginePage::clientHints_data()
+{
+ QTest::addColumn<bool>("clientHintsEnabled");
+ QTest::addColumn<QString>("arch");
+ QTest::addColumn<QString>("platform");
+ QTest::addColumn<QString>("model");
+ QTest::addColumn<bool>("isMobile");
+ QTest::addColumn<QString>("fullVersion");
+ QTest::addColumn<QString>("platformVersion");
+ QTest::addColumn<QString>("bitness");
+ QTest::addColumn<bool>("isWOW64");
+ QTest::addColumn<QHash<QString, QString>>("fullVersionList");
+
+ QTest::newRow("Modify values") << true << "Abc" << "AmigaOS" << "Ultra" << true << "1.99" << "3" << "x64" << true << QHash<QString, QString>({{"APITest", "1.0.0"}, {"App", "5.0"}});
+ QTest::newRow("Empty values") << true << "" << "" << "" << false << "" << "" << "" << false << QHash<QString, QString>();
+ QTest::newRow("Disable headers") << false << "" << "" << "" << false << "" << "" << "" << false << QHash<QString, QString>();
+}
+
+void tst_QWebEnginePage::clientHints()
+{
+ QFETCH(bool, clientHintsEnabled);
+ QFETCH(QString, arch);
+ QFETCH(QString, platform);
+ QFETCH(QString, model);
+ QFETCH(bool, isMobile);
+ QFETCH(QString, fullVersion);
+ QFETCH(QString, platformVersion);
+ QFETCH(QString, bitness);
+ QFETCH(bool, isWOW64);
+ typedef QHash<QString, QString> brandVersionPairs;
+ QFETCH(brandVersionPairs, fullVersionList);
+
+ QWebEnginePage page;
+ QSignalSpy loadSpy(&page, SIGNAL(loadFinished(bool)));
+
+ QWebEngineClientHints *clientHints = page.profile()->clientHints();
+ clientHints->setAllClientHintsEnabled(clientHintsEnabled);
+
+ HttpServer server;
+ int requestCount = 0;
+ connect(&server, &HttpServer::newRequest, [&] (HttpReqRep *r) {
+ // Platform and Mobile hints are always sent and can't be disabled with this API
+ QVERIFY(r->hasRequestHeader("Sec-CH-UA-Platform"));
+ QVERIFY(r->hasRequestHeader("Sec-CH-UA-Mobile"));
+ if (!clientHintsEnabled) {
+ QVERIFY(!r->hasRequestHeader("Sec-CH-UA-Arch"));
+ QVERIFY(!r->hasRequestHeader("Sec-CH-UA-Model"));
+ QVERIFY(!r->hasRequestHeader("Sec-CH-UA-Full-Version"));
+ QVERIFY(!r->hasRequestHeader("Sec-CH-UA-Platform-Version"));
+ QVERIFY(!r->hasRequestHeader("Sec-CH-UA-Bitness"));
+ QVERIFY(!r->hasRequestHeader("Sec-CH-UA-Wow64"));
+ QVERIFY(!r->hasRequestHeader("Sec-CH-UA-Full-Version-List"));
+ }
+
+ // The first request header won't contain any hints, only after a response with "Accept-CH"
+ if (requestCount > 1 && clientHintsEnabled) {
+ // All hint values are lower case in the headers
+ QCOMPARE(QString(r->requestHeader("Sec-CH-UA-Arch")).remove("\""), arch.toLower());
+ QCOMPARE(QString(r->requestHeader("Sec-CH-UA-Platform")).remove("\""), platform.toLower());
+ QCOMPARE(QString(r->requestHeader("Sec-CH-UA-Model")).remove("\""), model.toLower());
+ QCOMPARE(QString(r->requestHeader("Sec-CH-UA-Mobile")).remove("\""), isMobile ? "?1" : "?0");
+ QCOMPARE(QString(r->requestHeader("Sec-CH-UA-Full-Version")).remove("\""), fullVersion.toLower());
+ QCOMPARE(QString(r->requestHeader("Sec-CH-UA-Platform-Version")).remove("\""), platformVersion.toLower());
+ QCOMPARE(QString(r->requestHeader("Sec-CH-UA-Bitness")).remove("\""), bitness.toLower());
+ QCOMPARE(QString(r->requestHeader("Sec-CH-UA-Wow64")).remove("\""), isWOW64 ? "?1" : "?0");
+ for (auto i = fullVersionList.cbegin(), end = fullVersionList.cend(); i != end; ++i)
+ QVERIFY(QString(r->requestHeader("Sec-CH-UA-Full-Version-List")).contains(i.key().toLower()));
+ }
+
+ r->setResponseHeader("Accept-CH", "Sec-CH-UA-Arch, Sec-CH-UA-Bitness, Sec-CH-UA-Full-Version, Sec-CH-UA-Full-Version-List, Sec-CH-UA-Mobile, Sec-CH-UA-Model, Sec-CH-UA-Platform-Version, Sec-CH-UA-Platform, Sec-CH-UA-Wow64, Sec-CH-UA");
+ r->sendResponse();
+ requestCount++;
+ });
+ QVERIFY(server.start());
+
+ clientHints->setArch(arch);
+ clientHints->setPlatform(platform);
+ clientHints->setModel(model);
+ clientHints->setIsMobile(isMobile);
+ clientHints->setFullVersion(fullVersion);
+ clientHints->setPlatformVersion(platformVersion);
+ clientHints->setBitness(bitness);
+ clientHints->setIsWow64(isWOW64);
+ clientHints->setFullVersionList(fullVersionList);
+
+ page.setUrl(server.url());
+ QTRY_COMPARE(loadSpy.size(), 1);
+ QVERIFY(loadSpy.takeFirst().value(0).toBool());
+
+ QCOMPARE(clientHints->arch(), arch);
+ QCOMPARE(clientHints->platform(), platform);
+ QCOMPARE(clientHints->model(), model);
+ QCOMPARE(clientHints->isMobile(), isMobile);
+ QCOMPARE(clientHints->fullVersion(), fullVersion);
+ QCOMPARE(clientHints->platformVersion(), platformVersion);
+ QCOMPARE(clientHints->bitness(), bitness);
+ QCOMPARE(clientHints->isWow64(), isWOW64);
+ for (auto i = fullVersionList.cbegin(), end = fullVersionList.cend(); i != end; ++i)
+ QCOMPARE(clientHints->fullVersionList()[i.key()], i.value());
+
+ // A new user agent string should not override/disable client hints
+ page.profile()->setHttpUserAgent(QStringLiteral("Custom user agent"));
+ page.triggerAction(QWebEnginePage::Reload);
+ QTRY_COMPARE(loadSpy.size(), 1);
+
+ // Reset all to default values
+ clientHints->resetAll();
+ QCOMPARE_NE(clientHints->arch(), arch);
+#ifdef Q_OS_LINUX
+ QCOMPARE(clientHints->platform().toLower(), "linux");
+#elif defined (Q_OS_MACOS)
+ QCOMPARE(clientHints->platform().toLower(), "macos");
+#elif defined (Q_OS_WIN)
+ QCOMPARE(clientHints->platform().toLower(), "windows");
+#endif
+ QCOMPARE_NE(clientHints->fullVersion(), fullVersion);
+ QCOMPARE_NE(clientHints->platformVersion(), platformVersion);
+ QCOMPARE_NE(clientHints->bitness(), bitness);
+ for (auto i = fullVersionList.cbegin(), end = fullVersionList.cend(); i != end; ++i)
+ QVERIFY(!clientHints->fullVersionList().contains(i.key()));
+ QVERIFY(clientHints->fullVersionList().contains("Chromium"));
+}
+
+void tst_QWebEnginePage::childFrameInput()
+{
+ HttpServer server;
+ server.setHostDomain("localhost");
+
+ // The cross-origin policy blocks scripting this frame with QWebEnginePage::runJavaScript.
+ // Use console messages to validate events.
+ QString innerHtml(
+ "<html><head><style>body{height:1200px;width:1200px;}</style></head><body>test<script>"
+ " let lastX, lastY = 0;"
+ " document.onscroll = (e) => {"
+ " if (window.scrollY > lastY) console.log(\"Down\");"
+ " if (window.scrollY < lastY) console.log(\"Up\");"
+ " if (window.scrollX > lastX) console.log(\"Right\");"
+ " if (window.scrollX < lastX) console.log(\"Left\");"
+ " lastX = window.scrollX;"
+ " lastY = window.scrollY;"
+ " };"
+ " window.onload = () => {console.log('loaded');};"
+ "</script></body></html>");
+
+ QVERIFY(server.start());
+ connect(&server, &HttpServer::newRequest, [&](HttpReqRep *rr) {
+ if (rr->requestPath() == "/main.html") {
+ // the Origin-Agent-Cluster header enables dedicated processes for origins
+ rr->setResponseHeader("Origin-Agent-Cluster", "?1");
+ // the same-site-cross-origin page forces to create the frame in a different process
+ server.setHostDomain("sub.localhost");
+ rr->setResponseBody(("<html><body>"
+ "<iframe id=\"iframe\" width=90% height=90% src=\""
+ + server.url().toString().toUtf8()
+ + "inner.html\"></iframe>"
+ "</body></html>"));
+ }
+ if (rr->requestPath() == "/inner.html")
+ rr->setResponseBody(innerHtml.toUtf8());
+ rr->sendResponse();
+ });
+
+ QWebEngineView view;
+ ConsolePage page;
+ view.setPage(&page);
+ view.resize(640, 480);
+ QSignalSpy loadSpy(&page, &QWebEnginePage::loadFinished);
+ page.load(server.url("/main.html"));
+ QTRY_COMPARE_WITH_TIMEOUT(loadSpy.size(), 1, 20000);
+
+ view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QTRY_VERIFY(evaluateJavaScriptSync(&page, "window.originAgentCluster").toBool());
+
+ // make sure the frame is loaded
+ QTRY_COMPARE(page.messages.size(), 1);
+ QTRY_COMPARE(page.messages[0], QString("loaded"));
+
+ // focus
+ evaluateJavaScriptSync(&page, "document.getElementById('iframe').contentWindow.focus()");
+ QTRY_COMPARE(evaluateJavaScriptSync(&page, "document.activeElement.id").toString(),
+ QStringLiteral("iframe"));
+
+ QPoint globalPos = view.windowHandle()->position();
+ QPoint p = elementCenter(&page, QString("iframe"));
+
+ // Even if the document is loaded, it is not necessarily drawn.
+ // Hit-testing (in Viz) for pointer events will be flacky in this scenario.
+ // Send keyClick events first so the target frame will be cached for wheel events.
+ QTest::keyClick(view.focusProxy(), Qt::Key_Down);
+ QTRY_COMPARE(page.messages.size(), 2);
+ QTRY_COMPARE(page.messages[1], QString("Down"));
+
+ QTest::keyClick(view.focusProxy(), Qt::Key_Up);
+ QTRY_COMPARE(page.messages.size(), 3);
+ QTRY_COMPARE(page.messages[2], QString("Up"));
+
+ QTest::keyClick(view.focusProxy(), Qt::Key_Right);
+ QTRY_COMPARE(page.messages.size(), 4);
+ QTRY_COMPARE(page.messages[3], QString("Right"));
+
+ QTest::keyClick(view.focusProxy(), Qt::Key_Left);
+ QTRY_COMPARE(page.messages.size(), 5);
+ QTRY_COMPARE(page.messages[4], QString("Left"));
+
+ makeScroll(view.focusProxy(), p, globalPos, QPoint(0, -120));
+ QTRY_COMPARE(page.messages.size(), 6);
+ QTRY_COMPARE(page.messages[5], QString("Down"));
+
+ makeScroll(view.focusProxy(), p, globalPos, QPoint(0, 120));
+ QTRY_COMPARE(page.messages.size(), 7);
+ QTRY_COMPARE(page.messages[6], QString("Up"));
+
+ makeScroll(view.focusProxy(), p, globalPos, QPoint(-120, 0));
+ QTRY_COMPARE(page.messages.size(), 8);
+ QTRY_COMPARE(page.messages[7], QString("Right"));
+
+ makeScroll(view.focusProxy(), p, globalPos, QPoint(120, 0));
+ QTRY_COMPARE(page.messages.size(), 9);
+ QTRY_COMPARE(page.messages[8], QString("Left"));
+}
+
+void tst_QWebEnginePage::openLinkInNewPageWithWebWindowType_data()
+{
+ QTest::addColumn<QWebEnginePage::WebWindowType>("webWindowType");
+ QTest::addColumn<QString>("elementId");
+ QTest::addColumn<Qt::MouseButton>("button");
+ QTest::addColumn<Qt::KeyboardModifier>("keyboardModififer");
+ QTest::newRow("webBrowserWindow")
+ << QWebEnginePage::WebBrowserWindow << "link" << Qt::LeftButton << Qt::ShiftModifier;
+ QTest::newRow("webBrowserTab")
+ << QWebEnginePage::WebBrowserTab << "link" << Qt::LeftButton << Qt::NoModifier;
+ QTest::newRow("webDialog") << QWebEnginePage::WebDialog << "openWindow" << Qt::LeftButton
+ << Qt::NoModifier;
+ QTest::newRow("webBrowserBackgroundTab") << QWebEnginePage::WebBrowserBackgroundTab << "link"
+ << Qt::MiddleButton << Qt::NoModifier;
+}
+
+class WebWindowTypeTestPage : public QWebEnginePage
+{
+ Q_OBJECT
+
+public:
+ WebWindowType windowType;
+
+signals:
+ void windowCreated();
+
+private:
+ QWebEnginePage *createWindow(WebWindowType type) override
+ {
+ windowType = type;
+ emit windowCreated();
+ return nullptr;
+ }
+};
+
+void tst_QWebEnginePage::openLinkInNewPageWithWebWindowType()
+{
+ QFETCH(QWebEnginePage::WebWindowType, webWindowType);
+ QFETCH(QString, elementId);
+ QFETCH(Qt::MouseButton, button);
+ QFETCH(Qt::KeyboardModifier, keyboardModififer);
+
+ WebWindowTypeTestPage page;
+ QSignalSpy loadFinishedSpy(&page, SIGNAL(loadFinished(bool)));
+ QSignalSpy windowCreatedSpy(&page, &WebWindowTypeTestPage::windowCreated);
+ QWebEngineView view(&page);
+ view.resize(640, 480);
+ view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
+
+ page.settings()->setAttribute(QWebEngineSettings::JavascriptEnabled, true);
+ page.settings()->setAttribute(QWebEngineSettings::JavascriptCanOpenWindows, true);
+ QString html = "<html><body>"
+ "<a id='link' href='hello' target='_blank'>link</a>"
+ "<br><br>"
+ "<button id='openWindow' onclick='myFunction()'>Try it</button>"
+ "<script>"
+ "function myFunction() {"
+ " const myWindow = window.open('', '', 'width=300,height=300');"
+ "}"
+ "</script>"
+ "</body></html>";
+
+ page.setHtml(html);
+ QVERIFY(loadFinishedSpy.wait());
+
+ QTest::mouseClick(view.focusProxy(), button, keyboardModififer,
+ elementCenter(&page, elementId));
+ QVERIFY(windowCreatedSpy.wait());
+ QCOMPARE(page.windowType, webWindowType);
+}
+
+class DoNothingInterceptor : public QWebEngineUrlRequestInterceptor
+{
+public:
+ DoNothingInterceptor() { }
+
+ void interceptRequest(QWebEngineUrlRequestInfo &) override
+ {
+ ran = true;
+ }
+ bool ran = false;
+};
+
+void tst_QWebEnginePage::keepInterceptorAfterNewWindowRequested()
+{
+ DoNothingInterceptor interceptor;
+ QWebEnginePage page;
+ page.setUrlRequestInterceptor(&interceptor);
+ connect(&page, &QWebEnginePage::newWindowRequested, [&](QWebEngineNewWindowRequest &request) {
+ request.openIn(&page);
+ });
+ QSignalSpy loadFinishedSpy(&page, SIGNAL(loadFinished(bool)));
+
+ QWebEngineView view;
+ view.resize(500, 500);
+ view.setPage(&page);
+ view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
+
+ page.setHtml("<html><body>"
+ "<a id='link' href='hello' target='_blank'>link</a>"
+ "</body></html>");
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
+ QVERIFY(loadFinishedSpy.takeFirst().value(0).toBool());
+ QVERIFY(interceptor.ran);
+ interceptor.ran = false;
+
+ QTest::mouseClick(view.focusProxy(), Qt::LeftButton, {}, elementCenter(&page, "link"));
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
+ QVERIFY(loadFinishedSpy.takeFirst().value(0).toBool());
+ QVERIFY(!interceptor.ran);
+
+ page.setHtml("<html><body></body></html>");
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
+ QVERIFY(loadFinishedSpy.takeFirst().value(0).toBool());
+ QVERIFY(interceptor.ran);
+}
+
+void tst_QWebEnginePage::chooseDesktopMedia()
+{
+#if QT_CONFIG(webengine_extensions) && QT_CONFIG(webengine_webrtc)
+ HttpServer server;
+ server.setHostDomain("localhost");
+ connect(&server, &HttpServer::newRequest, &server, [&] (HttpReqRep *r) {
+ if (r->requestMethod() == "GET")
+ r->setResponseBody("<html></html>");
+ });
+ QVERIFY(server.start());
+
+ QWebEnginePage page;
+ QSignalSpy loadFinishedSpy(&page, SIGNAL(loadFinished(bool)));
+ page.settings()->setAttribute(QWebEngineSettings::ScreenCaptureEnabled, true);
+
+ bool desktopMediaRequested = false;
+ bool permissionRequested = false;
+
+ connect(&page, &QWebEnginePage::desktopMediaRequested,
+ [&](const QWebEngineDesktopMediaRequest &) {
+ desktopMediaRequested = true;
+ });
+
+ connect(&page, &QWebEnginePage::featurePermissionRequested,
+ [&](const QUrl &securityOrigin, QWebEnginePage::Feature feature) {
+ permissionRequested = true;
+ // Handle permission to 'complete' the media request
+ page.setFeaturePermission(securityOrigin, feature,
+ QWebEnginePage::PermissionGrantedByUser);
+ });
+
+ page.load(QUrl(server.url()));
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size(), 1, 20000);
+
+ const QString extensionId("nkeimhogjdpnpccoofpliimaahmaaome");
+ page.runJavaScript(QString("(() => {"
+ " let port = chrome.runtime.connect(\"%1\", {name: \"chooseDesktopMedia\"});"
+ " port.postMessage({method: \"chooseDesktopMedia\"});"
+ "})()").arg(extensionId));
+
+ QTRY_VERIFY(desktopMediaRequested);
+ QTRY_VERIFY(permissionRequested);
+#endif // QT_CONFIG(webengine_extensions) && QT_CONFIG(webengine_webrtc)
+}
+
static QByteArrayList params = {QByteArrayLiteral("--use-fake-device-for-media-stream")};
W_QTEST_MAIN(tst_QWebEnginePage, params)
diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.qrc b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.qrc
deleted file mode 100644
index 013a307de..000000000
--- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.qrc
+++ /dev/null
@@ -1,31 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
-<qresource>
- <file>resources/content.html</file>
- <file>resources/dynamicFrame.html</file>
- <file>resources/index.html</file>
- <file>resources/frame_a.html</file>
- <file>resources/frame_c.html</file>
- <file>resources/iframe.html</file>
- <file>resources/iframe2.html</file>
- <file>resources/iframe3.html</file>
- <file>resources/framedindex.html</file>
- <file>resources/fullscreen.html</file>
- <file>resources/script.html</file>
- <file>resources/user.css</file>
- <file>resources/image.png</file>
- <file>resources/pasteimage.html</file>
- <file>resources/reload.html</file>
- <file>resources/style.css</file>
- <file>resources/test1.html</file>
- <file>resources/test2.html</file>
- <file>resources/testiframe.html</file>
- <file>resources/testiframe2.html</file>
- <file>resources/foo.txt</file>
- <file>resources/bar.txt</file>
- <file>resources/path with spaces.txt</file>
- <file>resources/lifecycle.html</file>
-</qresource>
-<qresource prefix='/shared'>
- <file alias='notification.html'>../../shared/data/notification.html</file>
-</qresource>
-</RCC>
diff --git a/tests/auto/widgets/qwebengineprofile/CMakeLists.txt b/tests/auto/widgets/qwebengineprofile/CMakeLists.txt
new file mode 100644
index 000000000..d7393eaef
--- /dev/null
+++ b/tests/auto/widgets/qwebengineprofile/CMakeLists.txt
@@ -0,0 +1,14 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+include(../../httpserver/httpserver.cmake)
+include(../../util/util.cmake)
+
+qt_internal_add_test(tst_qwebengineprofile
+ SOURCES
+ tst_qwebengineprofile.cpp
+ LIBRARIES
+ Qt::WebEngineWidgets
+ Test::HttpServer
+ Test::Util
+)
diff --git a/tests/auto/widgets/qwebengineprofile/qwebengineprofile.pro b/tests/auto/widgets/qwebengineprofile/qwebengineprofile.pro
deleted file mode 100644
index ca16cee39..000000000
--- a/tests/auto/widgets/qwebengineprofile/qwebengineprofile.pro
+++ /dev/null
@@ -1,4 +0,0 @@
-include(../tests.pri)
-include(../../shared/http.pri)
-exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc
-QT *= core-private gui-private
diff --git a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp
index 00d4bae5a..095d4c8f2 100644
--- a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp
+++ b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp
@@ -1,32 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "../util.h"
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#include <util.h>
#include <QtCore/qbuffer.h>
#include <QtCore/qmimedatabase.h>
#include <QtTest/QtTest>
@@ -35,11 +10,11 @@
#include <QtWebEngineCore/qwebenginecookiestore.h>
#include <QtWebEngineCore/qwebengineurlscheme.h>
#include <QtWebEngineCore/qwebengineurlschemehandler.h>
-#include <QtWebEngineWidgets/qwebengineprofile.h>
-#include <QtWebEngineWidgets/qwebenginepage.h>
-#include <QtWebEngineWidgets/qwebenginesettings.h>
+#include <QtWebEngineCore/qwebenginesettings.h>
+#include <QtWebEngineCore/qwebengineprofile.h>
+#include <QtWebEngineCore/qwebenginepage.h>
+#include <QtWebEngineCore/qwebenginedownloadrequest.h>
#include <QtWebEngineWidgets/qwebengineview.h>
-#include <QtWebEngineWidgets/qwebenginedownloaditem.h>
#if QT_CONFIG(webengine_webchannel)
#include <QWebChannel>
@@ -57,16 +32,16 @@ class tst_QWebEngineProfile : public QObject
private Q_SLOTS:
void initTestCase();
- void init();
- void cleanup();
- void privateProfile();
- void testProfile();
+ void defaultProfile_data();
+ void defaultProfile();
+ void userDefinedProfile();
void clearDataFromCache();
void disableCache();
void urlSchemeHandlers();
void urlSchemeHandlerFailRequest();
void urlSchemeHandlerFailOnRead();
void urlSchemeHandlerStreaming();
+ void urlSchemeHandlerStreaming2();
void urlSchemeHandlerRequestHeaders();
void urlSchemeHandlerInstallation();
void urlSchemeHandlerXhrStatus();
@@ -78,7 +53,6 @@ private Q_SLOTS:
void changePersistentPath();
void changeHttpUserAgent();
void changeHttpAcceptLanguage();
- void changeUseForGlobalCertificateVerification();
void changePersistentCookiesPolicy();
void initiator();
void badDeleteOrder();
@@ -105,61 +79,48 @@ void tst_QWebEngineProfile::initTestCase()
QWebEngineUrlScheme::registerScheme(myscheme);
}
-void tst_QWebEngineProfile::init()
-{
- //make sure defualt global profile is 'default' across all the tests
- QWebEngineProfile *profile = QWebEngineProfile::defaultProfile();
- QVERIFY(profile);
- QVERIFY(!profile->isOffTheRecord());
- QCOMPARE(profile->storageName(), QStringLiteral("Default"));
- QCOMPARE(profile->httpCacheType(), QWebEngineProfile::DiskHttpCache);
- QCOMPARE(profile->persistentCookiesPolicy(), QWebEngineProfile::AllowPersistentCookies);
- QCOMPARE(profile->cachePath(), QStandardPaths::writableLocation(QStandardPaths::CacheLocation)
- + QStringLiteral("/QtWebEngine/Default"));
- QCOMPARE(profile->persistentStoragePath(), QStandardPaths::writableLocation(QStandardPaths::DataLocation)
- + QStringLiteral("/QtWebEngine/Default"));
-}
+static QString StandardCacheLocation() { static auto p = QStandardPaths::writableLocation(QStandardPaths::CacheLocation); return p; }
+static QString StandardAppDataLocation() { static auto p = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation); return p; }
-void tst_QWebEngineProfile::cleanup()
+void tst_QWebEngineProfile::defaultProfile_data()
{
- QWebEngineProfile *profile = QWebEngineProfile::defaultProfile();
- profile->setCachePath(QString());
- profile->setPersistentStoragePath(QString());
- profile->setHttpCacheType(QWebEngineProfile::DiskHttpCache);
- profile->removeAllUrlSchemeHandlers();
+ QTest::addColumn<bool>("userCreated");
+ QTest::addRow("global") << false;
+ QTest::addRow("user") << true;
}
-void tst_QWebEngineProfile::privateProfile()
+void tst_QWebEngineProfile::defaultProfile()
{
- QWebEngineProfile otrProfile;
- QVERIFY(otrProfile.isOffTheRecord());
- QCOMPARE(otrProfile.httpCacheType(), QWebEngineProfile::MemoryHttpCache);
- QCOMPARE(otrProfile.persistentCookiesPolicy(), QWebEngineProfile::NoPersistentCookies);
- QCOMPARE(otrProfile.cachePath(), QString());
- QCOMPARE(otrProfile.persistentStoragePath(), QString());
+ QFETCH(bool, userCreated);
+ QScopedPointer<QWebEngineProfile> p(userCreated ? new QWebEngineProfile : nullptr);
+ QWebEngineProfile *profile = userCreated ? p.get() : QWebEngineProfile::defaultProfile();
+ QVERIFY(profile);
+ QVERIFY(profile->isOffTheRecord());
+ QCOMPARE(profile->storageName(), QString());
+ QCOMPARE(profile->httpCacheType(), QWebEngineProfile::MemoryHttpCache);
+ QCOMPARE(profile->persistentCookiesPolicy(), QWebEngineProfile::NoPersistentCookies);
+ QCOMPARE(profile->cachePath(), QString());
+ QCOMPARE(profile->persistentStoragePath(), StandardAppDataLocation() + QStringLiteral("/QtWebEngine/OffTheRecord"));
// TBD: setters do not really work
- otrProfile.setCachePath(QStringLiteral("/home/foo/bar"));
- QCOMPARE(otrProfile.cachePath(), QString());
- otrProfile.setPersistentStoragePath(QStringLiteral("/home/foo/bar"));
- QCOMPARE(otrProfile.persistentStoragePath(), QString());
- otrProfile.setHttpCacheType(QWebEngineProfile::DiskHttpCache);
- QCOMPARE(otrProfile.httpCacheType(), QWebEngineProfile::MemoryHttpCache);
- otrProfile.setPersistentCookiesPolicy(QWebEngineProfile::ForcePersistentCookies);
- QCOMPARE(otrProfile.persistentCookiesPolicy(), QWebEngineProfile::NoPersistentCookies);
+ profile->setCachePath(QStringLiteral("/home/foo/bar"));
+ QCOMPARE(profile->cachePath(), QString());
+ profile->setPersistentStoragePath(QStringLiteral("/home/foo/bar"));
+ QCOMPARE(profile->persistentStoragePath(), QStringLiteral("/home/foo/bar"));
+ profile->setHttpCacheType(QWebEngineProfile::DiskHttpCache);
+ QCOMPARE(profile->httpCacheType(), QWebEngineProfile::MemoryHttpCache);
+ profile->setPersistentCookiesPolicy(QWebEngineProfile::ForcePersistentCookies);
+ QCOMPARE(profile->persistentCookiesPolicy(), QWebEngineProfile::NoPersistentCookies);
}
-
-void tst_QWebEngineProfile::testProfile()
+void tst_QWebEngineProfile::userDefinedProfile()
{
QWebEngineProfile profile(QStringLiteral("Test"));
QVERIFY(!profile.isOffTheRecord());
QCOMPARE(profile.storageName(), QStringLiteral("Test"));
QCOMPARE(profile.httpCacheType(), QWebEngineProfile::DiskHttpCache);
QCOMPARE(profile.persistentCookiesPolicy(), QWebEngineProfile::AllowPersistentCookies);
- QCOMPARE(profile.cachePath(), QStandardPaths::writableLocation(QStandardPaths::CacheLocation)
- + QStringLiteral("/QtWebEngine/Test"));
- QCOMPARE(profile.persistentStoragePath(), QStandardPaths::writableLocation(QStandardPaths::DataLocation)
- + QStringLiteral("/QtWebEngine/Test"));
+ QCOMPARE(profile.cachePath(), StandardCacheLocation() + QStringLiteral("/QtWebEngine/Test"));
+ QCOMPARE(profile.persistentStoragePath(), StandardAppDataLocation() + QStringLiteral("/QtWebEngine/Test"));
}
class AutoDir : public QDir
@@ -197,14 +158,12 @@ public:
private:
void onNewRequest(HttpReqRep *rr)
{
- const QDir resourceDir(TESTS_SOURCE_DIR "qwebengineprofile/resources");
+ const QDir resourceDir(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath() + "/resources");
QString path = rr->requestPath();
path.remove(0, 1);
- if (rr->requestMethod() != "GET" || !resourceDir.exists(path))
- {
- rr->setResponseStatus(404);
- rr->sendResponse();
+ if (rr->requestMethod() != "GET" || !resourceDir.exists(path)) {
+ rr->sendResponse(404);
return;
}
@@ -230,7 +189,8 @@ void tst_QWebEngineProfile::clearDataFromCache()
AutoDir cacheDir("./tst_QWebEngineProfile_clearDataFromCache");
- QWebEngineProfile profile(QStringLiteral("Test"));
+ QWebEngineProfile profile(QStringLiteral("clearDataFromCache"));
+ QSignalSpy cacheSpy(&profile, &QWebEngineProfile::clearHttpCacheCompleted);
profile.setCachePath(cacheDir.path());
profile.setHttpCacheType(QWebEngineProfile::DiskHttpCache);
@@ -242,8 +202,7 @@ void tst_QWebEngineProfile::clearDataFromCache()
QVERIFY(cacheDir.exists("Cache"));
qint64 sizeBeforeClear = totalSize(cacheDir);
profile.clearHttpCache();
- // Wait for cache to be cleared.
- QTest::qWait(1000);
+ QTRY_COMPARE(cacheSpy.size(), 1);
QVERIFY(sizeBeforeClear > totalSize(cacheDir));
(void)server.stop();
@@ -256,18 +215,18 @@ void tst_QWebEngineProfile::disableCache()
AutoDir cacheDir("./tst_QWebEngineProfile_disableCache");
- QWebEnginePage page;
- QWebEngineProfile *profile = page.profile();
- profile->setCachePath(cacheDir.path());
+ QWebEngineProfile profile("disableCache");
+ QWebEnginePage page(&profile);
+ profile.setCachePath(cacheDir.path());
QVERIFY(!cacheDir.exists("Cache"));
- profile->setHttpCacheType(QWebEngineProfile::NoCache);
+ profile.setHttpCacheType(QWebEngineProfile::NoCache);
// Wait for cache to be cleared.
QTest::qWait(1000);
QVERIFY(loadSync(&page, server.url("/hedgehog.html")));
QVERIFY(!cacheDir.exists("Cache"));
- profile->setHttpCacheType(QWebEngineProfile::DiskHttpCache);
+ profile.setHttpCacheType(QWebEngineProfile::DiskHttpCache);
QVERIFY(loadSync(&page, server.url("/hedgehog.html")));
QVERIFY(cacheDir.exists("Cache"));
@@ -277,7 +236,7 @@ void tst_QWebEngineProfile::disableCache()
class RedirectingUrlSchemeHandler : public QWebEngineUrlSchemeHandler
{
public:
- void requestStarted(QWebEngineUrlRequestJob *job)
+ void requestStarted(QWebEngineUrlRequestJob *job) override
{
job->redirect(QUrl(QStringLiteral("data:text/plain;charset=utf-8,")
+ job->requestUrl().fileName()));
@@ -295,7 +254,7 @@ public:
{
}
- void requestStarted(QWebEngineUrlRequestJob *job)
+ void requestStarted(QWebEngineUrlRequestJob *job) override
{
QBuffer *buffer = new QBuffer(job);
buffer->setData(job->requestUrl().toString().toUtf8());
@@ -306,10 +265,12 @@ public:
QList<QPointer<QBuffer>> m_buffers;
};
-class StreamingIODevice : public QIODevice {
+// an evil version constantly claiming to be at end, similar to QNetworkReply
+class StreamingIODeviceBasic : public QIODevice
+{
Q_OBJECT
public:
- StreamingIODevice(QObject *parent) : QIODevice(parent), m_bytesRead(0), m_bytesAvailable(0)
+ StreamingIODeviceBasic(QObject *parent) : QIODevice(parent), m_bytesRead(0), m_bytesAvailable(0)
{
setOpenMode(QIODevice::ReadOnly);
m_timer.start(100, this);
@@ -320,12 +281,11 @@ public:
const std::lock_guard<QRecursiveMutex> lock(m_mutex);
return m_bytesAvailable;
}
- bool atEnd() const override
+protected:
+ bool internalAtEnd() const
{
- const std::lock_guard<QRecursiveMutex> lock(m_mutex);
return (m_data.size() >= 1000 && m_bytesRead >= 1000);
}
-protected:
void timerEvent(QTimerEvent *) override
{
const std::lock_guard<QRecursiveMutex> lock(m_mutex);
@@ -346,7 +306,7 @@ protected:
memcpy(data, m_data.constData() + m_bytesRead, len);
m_bytesAvailable -= len;
m_bytesRead += len;
- } else if (atEnd())
+ } else if (internalAtEnd())
return -1;
return len;
@@ -356,19 +316,26 @@ protected:
return 0;
}
-private:
-#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
- mutable QMutex m_mutex{QMutex::Recursive};
- using QRecursiveMutex = QMutex;
-#else
mutable QRecursiveMutex m_mutex;
-#endif
+private:
QByteArray m_data;
QBasicTimer m_timer;
int m_bytesRead;
int m_bytesAvailable;
};
+// A nicer version implementing atEnd
+class StreamingIODevice : public StreamingIODeviceBasic
+{
+public:
+ StreamingIODevice(QObject *parent) : StreamingIODeviceBasic(parent) {}
+ bool atEnd() const override
+ {
+ const std::lock_guard<QRecursiveMutex> lock(m_mutex);
+ return internalAtEnd();
+ }
+};
+
class StreamingUrlSchemeHandler : public QWebEngineUrlSchemeHandler
{
public:
@@ -377,12 +344,26 @@ public:
{
}
- void requestStarted(QWebEngineUrlRequestJob *job)
+ void requestStarted(QWebEngineUrlRequestJob *job) override
{
job->reply("text/plain;charset=utf-8", new StreamingIODevice(job));
}
};
+class StreamingUrlSchemeHandler2 : public QWebEngineUrlSchemeHandler
+{
+public:
+ StreamingUrlSchemeHandler2(QObject *parent = nullptr)
+ : QWebEngineUrlSchemeHandler(parent)
+ {
+ }
+
+ void requestStarted(QWebEngineUrlRequestJob *job) override
+ {
+ job->reply("text/plain;charset=utf-8", new StreamingIODeviceBasic(job));
+ }
+};
+
void tst_QWebEngineProfile::urlSchemeHandlers()
{
RedirectingUrlSchemeHandler lettertoHandler;
@@ -392,42 +373,42 @@ void tst_QWebEngineProfile::urlSchemeHandlers()
view.setPage(new QWebEnginePage(&profile, &view));
view.settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, false);
QString emailAddress = QStringLiteral("egon@olsen-banden.dk");
- QVERIFY(loadSync(&view, QUrl(QStringLiteral("letterto:") + emailAddress)));
+ QVERIFY(loadSync(view.page(), QUrl(QStringLiteral("letterto:") + emailAddress)));
QCOMPARE(toPlainTextSync(view.page()), emailAddress);
// Install a gopher handler after the view has been fully initialized.
ReplyingUrlSchemeHandler gopherHandler;
profile.installUrlSchemeHandler("gopher", &gopherHandler);
QUrl url = QUrl(QStringLiteral("gopher://olsen-banden.dk/benny"));
- QVERIFY(loadSync(&view, url));
+ QVERIFY(loadSync(view.page(), url));
QCOMPARE(toPlainTextSync(view.page()), url.toString());
// Remove the letterto scheme, and check whether it is not handled anymore.
profile.removeUrlScheme("letterto");
emailAddress = QStringLiteral("kjeld@olsen-banden.dk");
- QVERIFY(loadSync(&view, QUrl(QStringLiteral("letterto:") + emailAddress), false));
+ QVERIFY(loadSync(view.page(), QUrl(QStringLiteral("letterto:") + emailAddress), false));
QVERIFY(toPlainTextSync(view.page()) != emailAddress);
// Check if gopher is still working after removing letterto.
url = QUrl(QStringLiteral("gopher://olsen-banden.dk/yvonne"));
- QVERIFY(loadSync(&view, url));
+ QVERIFY(loadSync(view.page(), url));
QCOMPARE(toPlainTextSync(view.page()), url.toString());
// Does removeAll work?
profile.removeAllUrlSchemeHandlers();
url = QUrl(QStringLiteral("gopher://olsen-banden.dk/harry"));
- QVERIFY(loadSync(&view, url, false));
+ QVERIFY(loadSync(view.page(), url, false));
QVERIFY(toPlainTextSync(view.page()) != url.toString());
// Install a handler that is owned by the view. Make sure this doesn't crash on shutdown.
profile.installUrlSchemeHandler("aviancarrier", new ReplyingUrlSchemeHandler(&view));
url = QUrl(QStringLiteral("aviancarrier:inspector.mortensen@politistyrke.dk"));
- QVERIFY(loadSync(&view, url));
+ QVERIFY(loadSync(view.page(), url));
QCOMPARE(toPlainTextSync(view.page()), url.toString());
// Check that all buffers got deleted
- QCOMPARE(gopherHandler.m_buffers.count(), 2);
- for (int i = 0; i < gopherHandler.m_buffers.count(); ++i)
+ QCOMPARE(gopherHandler.m_buffers.size(), 2);
+ for (int i = 0; i < gopherHandler.m_buffers.size(); ++i)
QVERIFY(gopherHandler.m_buffers.at(i).isNull());
}
@@ -487,7 +468,8 @@ void tst_QWebEngineProfile::urlSchemeHandlerFailRequest()
view.setPage(new QWebEnginePage(&profile, &view));
view.settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, false);
view.load(QUrl(QStringLiteral("foo://bar")));
- QVERIFY(loadFinishedSpy.wait());
+ view.show();
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size(), 1, 30000);
QCOMPARE(toPlainTextSync(view.page()), QString());
}
@@ -501,7 +483,8 @@ void tst_QWebEngineProfile::urlSchemeHandlerFailOnRead()
view.setPage(new QWebEnginePage(&profile, &view));
view.settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, false);
view.load(QUrl(QStringLiteral("foo://bar")));
- QVERIFY(loadFinishedSpy.wait());
+ view.show();
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size(), 1, 30000);
QCOMPARE(toPlainTextSync(view.page()), QString());
}
@@ -515,7 +498,25 @@ void tst_QWebEngineProfile::urlSchemeHandlerStreaming()
view.setPage(new QWebEnginePage(&profile, &view));
view.settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, false);
view.load(QUrl(QStringLiteral("stream://whatever")));
- QVERIFY(loadFinishedSpy.wait());
+ view.show();
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size(), 1, 30000);
+ QByteArray result;
+ result.append(1000, 'c');
+ QCOMPARE(toPlainTextSync(view.page()), QString::fromLatin1(result));
+}
+
+void tst_QWebEngineProfile::urlSchemeHandlerStreaming2()
+{
+ StreamingUrlSchemeHandler2 handler;
+ QWebEngineProfile profile;
+ profile.installUrlSchemeHandler("stream", &handler);
+ QWebEngineView view;
+ QSignalSpy loadFinishedSpy(&view, SIGNAL(loadFinished(bool)));
+ view.setPage(new QWebEnginePage(&profile, &view));
+ view.settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, false);
+ view.load(QUrl(QStringLiteral("stream://whatever")));
+ view.show();
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size(), 1, 30000);
QByteArray result;
result.append(1000, 'c');
QCOMPARE(toPlainTextSync(view.page()), QString::fromLatin1(result));
@@ -576,7 +577,7 @@ void tst_QWebEngineProfile::urlSchemeHandlerRequestHeaders()
QWebEnginePage page(&profile);
QSignalSpy loadFinishedSpy(&page, SIGNAL(loadFinished(bool)));
page.load(QUrl(QStringLiteral("myscheme://whatever")));
- QVERIFY(loadFinishedSpy.wait());
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size(), 1, 30000);
}
void tst_QWebEngineProfile::urlSchemeHandlerInstallation()
@@ -648,7 +649,7 @@ private:
class XhrStatusUrlSchemeHandler : public QWebEngineUrlSchemeHandler
{
public:
- void requestStarted(QWebEngineUrlRequestJob *job)
+ void requestStarted(QWebEngineUrlRequestJob *job) override
{
QString path = job->requestUrl().path();
if (path == "/") {
@@ -708,7 +709,7 @@ void tst_QWebEngineProfile::urlSchemeHandlerXhrStatus()
profile.installUrlSchemeHandler("aviancarrier", &handler);
page.setWebChannel(&channel);
page.load(QUrl("aviancarrier:/"));
- QTRY_VERIFY(host.isReady());
+ QTRY_VERIFY_WITH_TIMEOUT(host.isReady(), 30000);
host.load(QUrl("aviancarrier:/ok"));
host.load(QUrl("aviancarrier:/redirect"));
host.load(QUrl("aviancarrier:/fail"));
@@ -726,7 +727,7 @@ void tst_QWebEngineProfile::urlSchemeHandlerXhrStatus()
class ScriptsUrlSchemeHandler : public QWebEngineUrlSchemeHandler
{
public:
- void requestStarted(QWebEngineUrlRequestJob *job)
+ void requestStarted(QWebEngineUrlRequestJob *job) override
{
auto *script = new QBuffer(job);
script->setData(QByteArrayLiteral("window.test = 'SUCCESS';"));
@@ -742,12 +743,12 @@ void tst_QWebEngineProfile::urlSchemeHandlerScriptModule()
QWebEnginePage page(&profile);
QSignalSpy loadFinishedSpy(&page, SIGNAL(loadFinished(bool)));
page.setHtml(QStringLiteral("<html><head><script src=\"aviancarrier:///\"></script></head><body>Test1</body></html>"));
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
QCOMPARE(evaluateJavaScriptSync(&page, QStringLiteral("test")).toString(), QStringLiteral("SUCCESS"));
loadFinishedSpy.clear();
page.setHtml(QStringLiteral("<html><head><script type=\"module\" src=\"aviancarrier:///\"></script></head><body>Test2</body></html>"));
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
QCOMPARE(evaluateJavaScriptSync(&page, QStringLiteral("test")).toString(), QStringLiteral("SUCCESS"));
}
@@ -757,7 +758,7 @@ public:
LongReplyUrlSchemeHandler(QObject *parent = nullptr) : QWebEngineUrlSchemeHandler(parent) {}
~LongReplyUrlSchemeHandler() {}
- void requestStarted(QWebEngineUrlRequestJob *job)
+ void requestStarted(QWebEngineUrlRequestJob *job) override
{
QBuffer *buffer = new QBuffer(job);
buffer->setData(QByteArray(128 * 1024, ' ') +
@@ -782,7 +783,7 @@ void tst_QWebEngineProfile::customUserAgent()
QWebEnginePage page;
QSignalSpy loadFinishedSpy(&page, SIGNAL(loadFinished(bool)));
page.setHtml(QStringLiteral("<html><body>Hello world!</body></html>"));
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
// First test the user-agent is default
QCOMPARE(evaluateJavaScriptSync(&page, QStringLiteral("navigator.userAgent")).toString(), defaultUserAgent);
@@ -795,7 +796,7 @@ void tst_QWebEngineProfile::customUserAgent()
QWebEnginePage page2(&testProfile);
QSignalSpy loadFinishedSpy2(&page2, SIGNAL(loadFinished(bool)));
page2.setHtml(QStringLiteral("<html><body>Hello again!</body></html>"));
- QTRY_COMPARE(loadFinishedSpy2.count(), 1);
+ QTRY_COMPARE(loadFinishedSpy2.size(), 1);
QCOMPARE(evaluateJavaScriptSync(&page2, QStringLiteral("navigator.userAgent")).toString(), testUserAgent);
QCOMPARE(evaluateJavaScriptSync(&page, QStringLiteral("navigator.userAgent")).toString(), defaultUserAgent);
@@ -809,7 +810,7 @@ void tst_QWebEngineProfile::httpAcceptLanguage()
QWebEnginePage page;
QSignalSpy loadFinishedSpy(&page, SIGNAL(loadFinished(bool)));
page.setHtml(QStringLiteral("<html><body>Hello world!</body></html>"));
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
QStringList defaultLanguages = evaluateJavaScriptSync(&page, QStringLiteral("navigator.languages")).toStringList();
@@ -821,7 +822,7 @@ void tst_QWebEngineProfile::httpAcceptLanguage()
QWebEnginePage page2(&testProfile);
QSignalSpy loadFinishedSpy2(&page2, SIGNAL(loadFinished(bool)));
page2.setHtml(QStringLiteral("<html><body>Hello again!</body></html>"));
- QTRY_COMPARE(loadFinishedSpy2.count(), 1);
+ QTRY_COMPARE(loadFinishedSpy2.size(), 1);
QCOMPARE(evaluateJavaScriptSync(&page2, QStringLiteral("navigator.languages")).toStringList(), QStringList(testLang));
// Test the old one wasn't affected
QCOMPARE(evaluateJavaScriptSync(&page, QStringLiteral("navigator.languages")).toStringList(), defaultLanguages);
@@ -833,12 +834,12 @@ void tst_QWebEngineProfile::httpAcceptLanguage()
void tst_QWebEngineProfile::downloadItem()
{
- qRegisterMetaType<QWebEngineDownloadItem *>();
+ qRegisterMetaType<QWebEngineDownloadRequest *>();
QWebEngineProfile testProfile;
QWebEnginePage page(&testProfile);
- QSignalSpy downloadSpy(&testProfile, SIGNAL(downloadRequested(QWebEngineDownloadItem *)));
+ QSignalSpy downloadSpy(&testProfile, SIGNAL(downloadRequested(QWebEngineDownloadRequest *)));
page.load(QUrl::fromLocalFile(QCoreApplication::applicationFilePath()));
- QTRY_COMPARE(downloadSpy.count(), 1);
+ QTRY_COMPARE(downloadSpy.size(), 1);
}
void tst_QWebEngineProfile::changePersistentPath()
@@ -846,12 +847,12 @@ void tst_QWebEngineProfile::changePersistentPath()
TestServer server;
QVERIFY(server.start());
- AutoDir dataDir1(QStandardPaths::writableLocation(QStandardPaths::DataLocation)
- + QStringLiteral("/QtWebEngine/Test"));
- AutoDir dataDir2(QStandardPaths::writableLocation(QStandardPaths::DataLocation)
- + QStringLiteral("/QtWebEngine/Test2"));
+ AutoDir dataDir1(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation)
+ + QStringLiteral("/QtWebEngine/changePersistentPath1"));
+ AutoDir dataDir2(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation)
+ + QStringLiteral("/QtWebEngine/changePersistentPath2"));
- QWebEngineProfile testProfile(QStringLiteral("Test"));
+ QWebEngineProfile testProfile(QStringLiteral("changePersistentPath1"));
QCOMPARE(testProfile.persistentStoragePath(), dataDir1.path());
// Make sure the profile has been used:
@@ -872,13 +873,13 @@ void tst_QWebEngineProfile::changeHttpUserAgent()
TestServer server;
QVERIFY(server.start());
- QVector<QByteArray> userAgents;
+ QList<QByteArray> userAgents;
connect(&server, &HttpServer::newRequest, [&](HttpReqRep *rr) {
if (rr->requestPath() == "/hedgehog.html")
userAgents.push_back(rr->requestHeader(QByteArrayLiteral("user-agent")));
});
- QWebEngineProfile profile(QStringLiteral("Test"));
+ QWebEngineProfile profile(QStringLiteral("changeHttpUserAgent"));
std::unique_ptr<QWebEnginePage> page;
page.reset(new QWebEnginePage(&profile));
QVERIFY(loadSync(page.get(), server.url("/hedgehog.html")));
@@ -899,13 +900,13 @@ void tst_QWebEngineProfile::changeHttpAcceptLanguage()
TestServer server;
QVERIFY(server.start());
- QVector<QByteArray> languages;
+ QList<QByteArray> languages;
connect(&server, &HttpServer::newRequest, [&](HttpReqRep *rr) {
if (rr->requestPath() == "/hedgehog.html")
languages.push_back(rr->requestHeader(QByteArrayLiteral("accept-language")));
});
- QWebEngineProfile profile(QStringLiteral("Test"));
+ QWebEngineProfile profile(QStringLiteral("changeHttpAcceptLanguage"));
std::unique_ptr<QWebEnginePage> page;
page.reset(new QWebEnginePage(&profile));
QVERIFY(loadSync(page.get(), server.url("/hedgehog.html")));
@@ -921,25 +922,6 @@ void tst_QWebEngineProfile::changeHttpAcceptLanguage()
QVERIFY(server.stop());
}
-void tst_QWebEngineProfile::changeUseForGlobalCertificateVerification()
-{
- TestServer server;
- QVERIFY(server.start());
-
- // Check that we don't crash
-
- QWebEngineProfile profile(QStringLiteral("Test"));
- std::unique_ptr<QWebEnginePage> page;
- page.reset(new QWebEnginePage(&profile));
- QVERIFY(loadSync(page.get(), server.url("/hedgehog.html")));
- page.reset();
- profile.setUseForGlobalCertificateVerification(true);
- page.reset(new QWebEnginePage(&profile));
- QVERIFY(loadSync(page.get(), server.url("/hedgehog.html")));
- // Don't check for error: there can be disconnects during GET hedgehog.png.
- (void)server.stop();
-}
-
void tst_QWebEngineProfile::changePersistentCookiesPolicy()
{
TestServer server;
@@ -947,7 +929,7 @@ void tst_QWebEngineProfile::changePersistentCookiesPolicy()
AutoDir dataDir("./tst_QWebEngineProfile_dataDir");
- QWebEngineProfile profile(QStringLiteral("Test"));
+ QWebEngineProfile profile(QStringLiteral("changePersistentCookiesPolicy"));
QWebEnginePage page(&profile);
profile.setPersistentStoragePath(dataDir.path());
@@ -983,29 +965,29 @@ void tst_QWebEngineProfile::initiator()
QWebEnginePage page(&profile, nullptr);
QSignalSpy loadFinishedSpy(&page, SIGNAL(loadFinished(bool)));
page.load(QUrl("about:blank"));
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
loadFinishedSpy.clear();
// about:blank has a unique origin, so initiator should be QUrl("null")
evaluateJavaScriptSync(&page, "window.location = 'foo:bar'");
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
loadFinishedSpy.clear();
QCOMPARE(handler.initiator, QUrl("null"));
page.setHtml("", QUrl("http://test:123/foo%20bar"));
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
loadFinishedSpy.clear();
// baseUrl determines the origin, so QUrl("http://test:123")
evaluateJavaScriptSync(&page, "window.location = 'foo:bar'");
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
loadFinishedSpy.clear();
QCOMPARE(handler.initiator, QUrl("http://test:123"));
// Directly calling load/setUrl should have initiator QUrl(), meaning
// browser-initiated, trusted.
page.load(QUrl("foo:bar"));
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size(), 1, 10000);
QCOMPARE(handler.initiator, QUrl());
}
@@ -1021,7 +1003,7 @@ void tst_QWebEngineProfile::badDeleteOrder()
QSignalSpy spyLoadFinished(page, SIGNAL(loadFinished(bool)));
page->setHtml(QStringLiteral("<html><body><h1>Badly handled page!</h1></body></html>"));
- QTRY_COMPARE(spyLoadFinished.count(), 1);
+ QTRY_COMPARE(spyLoadFinished.size(), 1);
delete profile;
delete view;
@@ -1037,7 +1019,7 @@ void tst_QWebEngineProfile::qtbug_71895()
view.page()->profile()->setHttpCacheType(QWebEngineProfile::NoCache);
view.page()->profile()->cookieStore()->deleteAllCookies();
view.page()->profile()->setPersistentCookiesPolicy(QWebEngineProfile::NoPersistentCookies);
- bool gotSignal = loadSpy.count() || loadSpy.wait(20000);
+ bool gotSignal = loadSpy.size() || loadSpy.wait(20000);
if (!gotSignal)
QSKIP("Couldn't load page from network, skipping test.");
}
diff --git a/tests/auto/widgets/qwebenginescript/CMakeLists.txt b/tests/auto/widgets/qwebenginescript/CMakeLists.txt
new file mode 100644
index 000000000..d0d499b84
--- /dev/null
+++ b/tests/auto/widgets/qwebenginescript/CMakeLists.txt
@@ -0,0 +1,29 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+include(../../util/util.cmake)
+
+qt_internal_add_test(tst_qwebenginescript
+ SOURCES
+ tst_qwebenginescript.cpp
+ LIBRARIES
+ Qt::WebEngineWidgets
+ Test::Util
+)
+
+set(tst_qwebenginescript_resource_files
+ "resources/test_iframe_inner.html"
+ "resources/test_iframe_main.html"
+ "resources/test_iframe_outer.html"
+ "resources/test_window_open.html"
+ "resources/title_a.html"
+ "resources/title_b.html"
+ "resources/webChannelWithBadString.html"
+)
+
+qt_internal_add_resource(tst_qwebenginescript "tst_qwebenginescript"
+ PREFIX
+ "/"
+ FILES
+ ${tst_qwebenginescript_resource_files}
+)
diff --git a/tests/auto/widgets/qwebenginescript/qwebenginescript.pro b/tests/auto/widgets/qwebenginescript/qwebenginescript.pro
deleted file mode 100644
index e99c7f493..000000000
--- a/tests/auto/widgets/qwebenginescript/qwebenginescript.pro
+++ /dev/null
@@ -1 +0,0 @@
-include(../tests.pri)
diff --git a/tests/auto/widgets/qwebenginescript/resources/test_window_open.html b/tests/auto/widgets/qwebenginescript/resources/test_window_open.html
index 3f72d176d..3ceafc49d 100644
--- a/tests/auto/widgets/qwebenginescript/resources/test_window_open.html
+++ b/tests/auto/widgets/qwebenginescript/resources/test_window_open.html
@@ -3,7 +3,7 @@
<head>
<title>window.open</title>
<script>
- window.open("qrc:/resource/test_iframe_main.html", "iframe_main");
+ window.open("qrc:/resources/test_iframe_main.html", "iframe_main");
</script>
</head>
<body></body>
diff --git a/tests/auto/widgets/qwebenginescript/tst_qwebenginescript.cpp b/tests/auto/widgets/qwebenginescript/tst_qwebenginescript.cpp
index 32384aec2..9ba13589f 100644
--- a/tests/auto/widgets/qwebenginescript/tst_qwebenginescript.cpp
+++ b/tests/auto/widgets/qwebenginescript/tst_qwebenginescript.cpp
@@ -25,7 +25,7 @@
#include <qwebenginescriptcollection.h>
#include <qwebenginesettings.h>
#include <qwebengineview.h>
-#include "../util.h"
+#include <util.h>
#if QT_CONFIG(webengine_webchannel)
#include <QWebChannel>
#endif
@@ -40,6 +40,8 @@ static bool verifyOrder(QStringList orderList)
"Deferred"
};
+ if (orderList.size() != 5)
+ return false;
if (orderList.at(4) == "load (timeout)") {
if (orderList.at(3) != "Deferred")
return false;
@@ -68,10 +70,13 @@ private Q_SLOTS:
void webChannelWithExistingQtObject();
void navigation();
void webChannelWithBadString();
+ void webChannelWithJavaScriptDisabled();
#endif
void noTransportWithoutWebChannel();
void scriptsInNestedIframes();
void matchQrcUrl();
+ void injectionOrder();
+ void reloadWithSubframes();
};
void tst_QWebEngineScript::domEditing()
@@ -180,7 +185,7 @@ void tst_QWebEngineScript::loadEvents()
// Single frame / setHtml
page.setHtml(QStringLiteral("<!DOCTYPE html><html><head><title>mr</title></head><body></body></html>"));
- QTRY_COMPARE_WITH_TIMEOUT(page.spy.count(), 1, 20000);
+ QTRY_COMPARE_WITH_TIMEOUT(page.spy.size(), 1, 20000);
QVERIFY(page.spy.takeFirst().value(0).toBool());
QVERIFY(verifyOrder(page.eval("window.log", QWebEngineScript::MainWorld).toStringList()));
QVERIFY(verifyOrder(page.eval("window.log", QWebEngineScript::ApplicationWorld).toStringList()));
@@ -188,14 +193,14 @@ void tst_QWebEngineScript::loadEvents()
// After discard
page.setLifecycleState(QWebEnginePage::LifecycleState::Discarded);
page.setLifecycleState(QWebEnginePage::LifecycleState::Active);
- QTRY_COMPARE_WITH_TIMEOUT(page.spy.count(), 1, 20000);
+ QTRY_COMPARE_WITH_TIMEOUT(page.spy.size(), 1, 20000);
QVERIFY(page.spy.takeFirst().value(0).toBool());
QVERIFY(verifyOrder(page.eval("window.log", QWebEngineScript::MainWorld).toStringList()));
QVERIFY(verifyOrder(page.eval("window.log", QWebEngineScript::ApplicationWorld).toStringList()));
// Multiple frames
page.load(QUrl("qrc:/resources/test_iframe_main.html"));
- QTRY_COMPARE_WITH_TIMEOUT(page.spy.count(), 1, 20000);
+ QTRY_COMPARE_WITH_TIMEOUT(page.spy.size(), 1, 20000);
QVERIFY(page.spy.takeFirst().value(0).toBool());
QVERIFY(verifyOrder(page.eval("window.log", QWebEngineScript::MainWorld).toStringList()));
QVERIFY(verifyOrder(page.eval("window.log", QWebEngineScript::ApplicationWorld).toStringList()));
@@ -206,7 +211,7 @@ void tst_QWebEngineScript::loadEvents()
// Cross-process navigation
page.load(QUrl("chrome://gpu"));
- QTRY_COMPARE_WITH_TIMEOUT(page.spy.count(), 1, 20000);
+ QTRY_COMPARE_WITH_TIMEOUT(page.spy.size(), 1, 20000);
QVERIFY(page.spy.takeFirst().value(0).toBool());
QVERIFY(verifyOrder(page.eval("window.log", QWebEngineScript::MainWorld).toStringList()));
QVERIFY(verifyOrder(page.eval("window.log", QWebEngineScript::ApplicationWorld).toStringList()));
@@ -214,9 +219,9 @@ void tst_QWebEngineScript::loadEvents()
// Using window.open from JS
QVERIFY(profile.pages.size() == 1);
page.load(QUrl("qrc:/resources/test_window_open.html"));
- QTRY_COMPARE(profile.pages.size(), 2);
- QTRY_COMPARE(profile.pages.front().spy.count(), 1);
- QTRY_COMPARE(profile.pages.back().spy.count(), 1);
+ QTRY_COMPARE(profile.pages.size(), 2u);
+ QTRY_COMPARE(profile.pages.front().spy.size(), 1);
+ QTRY_COMPARE(profile.pages.back().spy.size(), 1);
QVERIFY(verifyOrder(profile.pages.front().eval("window.log", QWebEngineScript::MainWorld).toStringList()));
QVERIFY(verifyOrder(profile.pages.front().eval("window.log", QWebEngineScript::ApplicationWorld).toStringList()));
QVERIFY(verifyOrder(profile.pages.back().eval("window.log", QWebEngineScript::MainWorld).toStringList()));
@@ -267,7 +272,7 @@ void tst_QWebEngineScript::scriptDisabled()
page.scripts().insert(script);
page.load(QUrl("about:blank"));
QSignalSpy spy(&page, &QWebEnginePage::loadFinished);
- QTRY_COMPARE(spy.count(), 1);
+ QTRY_COMPARE(spy.size(), 1);
QCOMPARE(spy.takeFirst().value(0).toBool(), true);
// MainWorld scripts are disabled by the setting...
QCOMPARE(evaluateJavaScriptSyncInWorld(&page, "foo", QWebEngineScript::MainWorld), QVariant());
@@ -276,7 +281,7 @@ void tst_QWebEngineScript::scriptDisabled()
page.scripts().clear();
page.scripts().insert(script);
page.load(QUrl("about:blank"));
- QTRY_COMPARE(spy.count(), 1);
+ QTRY_COMPARE(spy.size(), 1);
QCOMPARE(spy.takeFirst().value(0).toBool(), true);
// ...but ApplicationWorld scripts should still work
QCOMPARE(evaluateJavaScriptSyncInWorld(&page, "foo", QWebEngineScript::MainWorld), QVariant());
@@ -294,7 +299,7 @@ void tst_QWebEngineScript::viewSource()
page.scripts().insert(script);
page.load(QUrl("view-source:about:blank"));
QSignalSpy spy(&page, &QWebEnginePage::loadFinished);
- QTRY_COMPARE(spy.count(), 1);
+ QTRY_COMPARE(spy.size(), 1);
QCOMPARE(spy.takeFirst().value(0).toBool(), true);
QCOMPARE(evaluateJavaScriptSync(&page, "foo"), QVariant(42));
}
@@ -320,8 +325,8 @@ void tst_QWebEngineScript::scriptModifications()
QVERIFY(spyFinished.wait());
QCOMPARE(evaluateJavaScriptSync(&page, "document.body.innerText"), QVariant::fromValue(QStringLiteral("SUCCESS")));
QVERIFY(page.scripts().count() == 1);
- QWebEngineScript s = page.scripts().findScript(QStringLiteral("String1"));
- QVERIFY(page.scripts().remove(s));
+ QList<QWebEngineScript> s = page.scripts().find(QStringLiteral("String1"));
+ QVERIFY(page.scripts().remove(s.first()));
QVERIFY(page.scripts().count() == 0);
}
@@ -413,7 +418,7 @@ void tst_QWebEngineScript::webChannel()
QCOMPARE(testObject.text(), QStringLiteral("test"));
if (worldId != QWebEngineScript::MainWorld)
- QCOMPARE(evaluateJavaScriptSync(&page, "qt.webChannelTransport"), QVariant(QVariant::Invalid));
+ QCOMPARE(evaluateJavaScriptSync(&page, "qt.webChannelTransport"), QVariant());
}
#endif
void tst_QWebEngineScript::noTransportWithoutWebChannel()
@@ -421,11 +426,11 @@ void tst_QWebEngineScript::noTransportWithoutWebChannel()
QWebEnginePage page;
page.setHtml(QStringLiteral("<html><body></body></html>"));
- QCOMPARE(evaluateJavaScriptSync(&page, "qt.webChannelTransport"), QVariant(QVariant::Invalid));
+ QCOMPARE(evaluateJavaScriptSync(&page, "qt.webChannelTransport"), QVariant());
page.triggerAction(QWebEnginePage::Reload);
QSignalSpy spyFinished(&page, &QWebEnginePage::loadFinished);
QVERIFY(spyFinished.wait());
- QCOMPARE(evaluateJavaScriptSync(&page, "qt.webChannelTransport"), QVariant(QVariant::Invalid));
+ QCOMPARE(evaluateJavaScriptSync(&page, "qt.webChannelTransport"), QVariant());
}
void tst_QWebEngineScript::scriptsInNestedIframes()
@@ -453,7 +458,7 @@ void tst_QWebEngineScript::scriptsInNestedIframes()
QSignalSpy spyFinished(&page, &QWebEnginePage::loadFinished);
page.load(QUrl("qrc:/resources/test_iframe_main.html"));
view.show();
- QVERIFY(spyFinished.wait());
+ QTRY_VERIFY_WITH_TIMEOUT(spyFinished.size() > 0, 20000);
// Check that main frame has modified content.
QCOMPARE(
@@ -486,9 +491,9 @@ void tst_QWebEngineScript::webChannelResettingAndUnsetting()
// There should be no webChannelTransport yet.
QCOMPARE(evaluateJavaScriptSyncInWorld(&page, "qt.webChannelTransport", QWebEngineScript::MainWorld),
- QVariant(QVariant::Invalid));
+ QVariant());
QCOMPARE(evaluateJavaScriptSyncInWorld(&page, "qt.webChannelTransport", QWebEngineScript::ApplicationWorld),
- QVariant(QVariant::Invalid));
+ QVariant());
QWebChannel channel;
page.setWebChannel(&channel, QWebEngineScript::MainWorld);
@@ -497,13 +502,13 @@ void tst_QWebEngineScript::webChannelResettingAndUnsetting()
QCOMPARE(evaluateJavaScriptSyncInWorld(&page, "qt.webChannelTransport", QWebEngineScript::MainWorld),
QVariant(QVariantMap()));
QCOMPARE(evaluateJavaScriptSyncInWorld(&page, "qt.webChannelTransport", QWebEngineScript::ApplicationWorld),
- QVariant(QVariant::Invalid));
+ QVariant());
page.setWebChannel(&channel, QWebEngineScript::ApplicationWorld);
// Now it should have moved to ApplicationWorld.
QCOMPARE(evaluateJavaScriptSyncInWorld(&page, "qt.webChannelTransport", QWebEngineScript::MainWorld),
- QVariant(QVariant::Invalid));
+ QVariant());
QCOMPARE(evaluateJavaScriptSyncInWorld(&page, "qt.webChannelTransport", QWebEngineScript::ApplicationWorld),
QVariant(QVariantMap()));
@@ -511,9 +516,9 @@ void tst_QWebEngineScript::webChannelResettingAndUnsetting()
// And now it should be gone again.
QCOMPARE(evaluateJavaScriptSyncInWorld(&page, "qt.webChannelTransport", QWebEngineScript::MainWorld),
- QVariant(QVariant::Invalid));
+ QVariant());
QCOMPARE(evaluateJavaScriptSyncInWorld(&page, "qt.webChannelTransport", QWebEngineScript::ApplicationWorld),
- QVariant(QVariant::Invalid));
+ QVariant());
}
void tst_QWebEngineScript::webChannelWithExistingQtObject()
@@ -521,7 +526,7 @@ void tst_QWebEngineScript::webChannelWithExistingQtObject()
QWebEnginePage page;
evaluateJavaScriptSync(&page, "qt = 42");
- QCOMPARE(evaluateJavaScriptSync(&page, "qt.webChannelTransport"), QVariant(QVariant::Invalid));
+ QCOMPARE(evaluateJavaScriptSync(&page, "qt.webChannelTransport"), QVariant());
QWebChannel channel;
page.setWebChannel(&channel);
@@ -553,22 +558,22 @@ void tst_QWebEngineScript::navigation()
QString url1 = QStringLiteral("about:blank");
page.setUrl(url1);
- QTRY_COMPARE(spyTextChanged.count(), 1);
+ QTRY_COMPARE(spyTextChanged.size(), 1);
QCOMPARE(testObject.text(), url1);
QString url2 = QStringLiteral("chrome://gpu/");
page.setUrl(url2);
- QTRY_COMPARE(spyTextChanged.count(), 2);
+ QTRY_COMPARE(spyTextChanged.size(), 2);
QCOMPARE(testObject.text(), url2);
QString url3 = QStringLiteral("qrc:/resources/test_iframe_main.html");
page.setUrl(url3);
- QTRY_COMPARE(spyTextChanged.count(), 3);
+ QTRY_COMPARE(spyTextChanged.size(), 3);
QCOMPARE(testObject.text(), url3);
page.setLifecycleState(QWebEnginePage::LifecycleState::Discarded);
page.setUrl(url1);
- QTRY_COMPARE(spyTextChanged.count(), 4);
+ QTRY_COMPARE(spyTextChanged.size(), 4);
QCOMPARE(testObject.text(), url1);
}
@@ -589,6 +594,36 @@ void tst_QWebEngineScript::webChannelWithBadString()
QChar data(0xd800);
QCOMPARE(host.text(), data);
}
+
+void tst_QWebEngineScript::webChannelWithJavaScriptDisabled()
+{
+ QWebEnginePage page;
+ QSignalSpy spyFinished(&page, &QWebEnginePage::loadFinished);
+ // JavaScript disabled in main world
+ page.settings()->setAttribute(QWebEngineSettings::JavascriptEnabled, false);
+
+ TestObject testObject;
+ QScopedPointer<QWebChannel> channel(new QWebChannel(this));
+ channel->registerObject(QStringLiteral("object"), &testObject);
+ page.setWebChannel(channel.data(), QWebEngineScript::ApplicationWorld);
+
+ QWebEngineScript script = webChannelScript();
+ script.setWorldId(QWebEngineScript::ApplicationWorld);
+ page.scripts().insert(script);
+
+ page.setHtml(QStringLiteral("<html><body></body></html>"));
+ QVERIFY(spyFinished.wait());
+
+ QSignalSpy spyTextChanged(&testObject, &TestObject::textChanged);
+ page.runJavaScript(QLatin1String(
+ "new QWebChannel(qt.webChannelTransport,"
+ " function(channel) {"
+ " channel.objects.object.text = 'test';"
+ " }"
+ ");"), QWebEngineScript::ApplicationWorld);
+ QVERIFY(spyTextChanged.wait());
+ QCOMPARE(testObject.text(), QStringLiteral("test"));
+}
#endif
void tst_QWebEngineScript::matchQrcUrl()
@@ -612,6 +647,86 @@ document.title = 'New title';
QCOMPARE(page.title(), "New title");
}
+// Add many scripts and check order of execution.
+void tst_QWebEngineScript::injectionOrder()
+{
+ QWebEngineProfile profile;
+ class Page : public QWebEnginePage
+ {
+ public:
+ Page(QWebEngineProfile *profile) : QWebEnginePage(profile) {}
+ QVector<QString> log;
+
+ protected:
+ void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel, const QString &message, int,
+ const QString &) override
+ {
+ log.append(message);
+ }
+ } page(&profile);
+ QWebEngineScript::InjectionPoint points[] = {
+ QWebEngineScript::DocumentCreation,
+ QWebEngineScript::DocumentReady,
+ QWebEngineScript::Deferred,
+ };
+ int nPoints = 3;
+ int nCollections = 2;
+ int nScripts = 5;
+
+ QVector<QString> expected;
+ for (int iPoint = 0; iPoint != nPoints; ++iPoint) {
+ for (int iCollection = 0; iCollection != nCollections; ++iCollection) {
+ for (int iScript = 0; iScript != nScripts; ++iScript) {
+ QWebEngineScript script;
+ script.setName(QString("%1%2%3").arg(iPoint).arg(iCollection).arg(iScript));
+ expected.append(script.name());
+ script.setInjectionPoint(points[iPoint]);
+ script.setWorldId(QWebEngineScript::MainWorld);
+ script.setSourceCode(QStringLiteral("console.error('%1');").arg(script.name()));
+ if (iCollection == 0)
+ profile.scripts()->insert(script);
+ else
+ page.scripts().insert(script);
+ }
+ }
+ }
+
+ page.load(QUrl("qrc:/resources/test_iframe_inner.html"));
+ QTRY_COMPARE(page.log, expected);
+}
+
+void tst_QWebEngineScript::reloadWithSubframes()
+{
+ class Page : public QWebEnginePage
+ {
+ public:
+ Page() : QWebEnginePage() {}
+ QVector<QString> log;
+
+ protected:
+ void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel, const QString &message, int,
+ const QString &) override
+ {
+ log.append(message);
+ }
+ } page;
+
+ QWebEngineScript s;
+ s.setInjectionPoint(QWebEngineScript::DocumentCreation);
+ s.setSourceCode(QStringLiteral("console.log('Hello');"));
+ page.scripts().insert(s);
+
+ page.setHtml(QStringLiteral("<body>"
+ " <h1>Test scripts working on reload </h1>"
+ " <iframe src='about://blank'>"
+ " </iframe>"
+ "</body>"));
+ QTRY_COMPARE(page.log.size(), 1);
+
+ page.triggerAction(QWebEnginePage::Reload);
+ QTRY_COMPARE(page.log.size(), 2);
+}
+
QTEST_MAIN(tst_QWebEngineScript)
#include "tst_qwebenginescript.moc"
diff --git a/tests/auto/widgets/qwebenginescript/tst_qwebenginescript.qrc b/tests/auto/widgets/qwebenginescript/tst_qwebenginescript.qrc
deleted file mode 100644
index 3290cb588..000000000
--- a/tests/auto/widgets/qwebenginescript/tst_qwebenginescript.qrc
+++ /dev/null
@@ -1,11 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
-<qresource>
- <file>resources/test_iframe_main.html</file>
- <file>resources/test_iframe_outer.html</file>
- <file>resources/test_iframe_inner.html</file>
- <file>resources/test_window_open.html</file>
- <file>resources/title_a.html</file>
- <file>resources/title_b.html</file>
- <file>resources/webChannelWithBadString.html</file>
-</qresource>
-</RCC>
diff --git a/tests/auto/widgets/qwebenginesettings/qwebenginesettings.pro b/tests/auto/widgets/qwebenginesettings/qwebenginesettings.pro
deleted file mode 100644
index 70786e70f..000000000
--- a/tests/auto/widgets/qwebenginesettings/qwebenginesettings.pro
+++ /dev/null
@@ -1,2 +0,0 @@
-include(../tests.pri)
-QT *= core-private gui-private
diff --git a/tests/auto/widgets/qwebenginesettings/tst_qwebenginesettings.cpp b/tests/auto/widgets/qwebenginesettings/tst_qwebenginesettings.cpp
deleted file mode 100644
index a09901e69..000000000
--- a/tests/auto/widgets/qwebenginesettings/tst_qwebenginesettings.cpp
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- Copyright (C) 2015 The Qt Company Ltd.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "../util.h"
-
-#include <QtTest/QtTest>
-
-#include <qwebenginepage.h>
-#include <qwebengineprofile.h>
-#include <qwebenginesettings.h>
-
-#include <QtGui/qclipboard.h>
-#include <QtGui/qguiapplication.h>
-
-class tst_QWebEngineSettings: public QObject {
- Q_OBJECT
-
-private Q_SLOTS:
- void resetAttributes();
- void defaultFontFamily_data();
- void defaultFontFamily();
- void javascriptClipboard_data();
- void javascriptClipboard();
- void setInAcceptNavigationRequest();
-};
-
-void tst_QWebEngineSettings::resetAttributes()
-{
- QWebEngineProfile profile;
- QWebEngineSettings *settings = profile.settings();
-
- // Attribute
- bool defaultValue = settings->testAttribute(QWebEngineSettings::FullScreenSupportEnabled);
- settings->setAttribute(QWebEngineSettings::FullScreenSupportEnabled, !defaultValue);
- QCOMPARE(!defaultValue, settings->testAttribute(QWebEngineSettings::FullScreenSupportEnabled));
- settings->resetAttribute(QWebEngineSettings::FullScreenSupportEnabled);
- QCOMPARE(defaultValue, settings->testAttribute(QWebEngineSettings::FullScreenSupportEnabled));
-
- // Font family
- QString defaultFamily = settings->fontFamily(QWebEngineSettings::StandardFont);
- QString newFontFamily("PugDog");
- settings->setFontFamily(QWebEngineSettings::StandardFont, newFontFamily);
- QCOMPARE(newFontFamily, settings->fontFamily(QWebEngineSettings::StandardFont));
- settings->resetFontFamily(QWebEngineSettings::StandardFont);
- QCOMPARE(defaultFamily, settings->fontFamily(QWebEngineSettings::StandardFont));
-
- // Font size
- int defaultSize = settings->fontSize(QWebEngineSettings::MinimumFontSize);
- int newSize = defaultSize + 10;
- settings->setFontSize(QWebEngineSettings::MinimumFontSize, newSize);
- QCOMPARE(newSize, settings->fontSize(QWebEngineSettings::MinimumFontSize));
- settings->resetFontSize(QWebEngineSettings::MinimumFontSize);
- QCOMPARE(defaultSize, settings->fontSize(QWebEngineSettings::MinimumFontSize));
-}
-
-void tst_QWebEngineSettings::defaultFontFamily_data()
-{
- QTest::addColumn<int>("fontFamily");
-
- QTest::newRow("StandardFont") << static_cast<int>(QWebEngineSettings::StandardFont);
- QTest::newRow("FixedFont") << static_cast<int>(QWebEngineSettings::FixedFont);
- QTest::newRow("SerifFont") << static_cast<int>(QWebEngineSettings::SerifFont);
- QTest::newRow("SansSerifFont") << static_cast<int>(QWebEngineSettings::SansSerifFont);
- QTest::newRow("CursiveFont") << static_cast<int>(QWebEngineSettings::CursiveFont);
- QTest::newRow("FantasyFont") << static_cast<int>(QWebEngineSettings::FantasyFont);
-}
-
-void tst_QWebEngineSettings::defaultFontFamily()
-{
- QWebEngineProfile profile;
- QWebEngineSettings *settings = profile.settings();
-
- QFETCH(int, fontFamily);
- QVERIFY(!settings->fontFamily(static_cast<QWebEngineSettings::FontFamily>(fontFamily)).isEmpty());
-}
-
-void tst_QWebEngineSettings::javascriptClipboard_data()
-{
- QTest::addColumn<bool>("javascriptCanAccessClipboard");
- QTest::addColumn<bool>("javascriptCanPaste");
- QTest::addColumn<bool>("copyResult");
- QTest::addColumn<bool>("pasteResult");
-
- QTest::newRow("default") << false << false << false << false;
- QTest::newRow("canCopy") << true << false << true << false;
- // paste command requires both permissions
- QTest::newRow("canPaste") << false << true << false << false;
- QTest::newRow("canCopyAndPaste") << true << true << true << true;
-}
-
-void tst_QWebEngineSettings::javascriptClipboard()
-{
- QFETCH(bool, javascriptCanAccessClipboard);
- QFETCH(bool, javascriptCanPaste);
- QFETCH(bool, copyResult);
- QFETCH(bool, pasteResult);
-
- QWebEnginePage page;
-
- // check defaults
- QCOMPARE(page.settings()->testAttribute(QWebEngineSettings::JavascriptCanAccessClipboard),
- false);
- QCOMPARE(page.settings()->testAttribute(QWebEngineSettings::JavascriptCanPaste), false);
-
- // check accessors
- page.settings()->setAttribute(QWebEngineSettings::JavascriptCanAccessClipboard,
- javascriptCanAccessClipboard);
- page.settings()->setAttribute(QWebEngineSettings::JavascriptCanPaste,
- javascriptCanPaste);
- QCOMPARE(page.settings()->testAttribute(QWebEngineSettings::JavascriptCanAccessClipboard),
- javascriptCanAccessClipboard);
- QCOMPARE(page.settings()->testAttribute(QWebEngineSettings::JavascriptCanPaste),
- javascriptCanPaste);
-
- QSignalSpy loadFinishedSpy(&page, SIGNAL(loadFinished(bool)));
- page.setHtml("<html><body>"
- "<input type='text' value='OriginalText' id='myInput'/>"
- "</body></html>");
- QVERIFY(loadFinishedSpy.wait());
-
- // make sure that 'OriginalText' is selected
- evaluateJavaScriptSync(&page, "document.getElementById('myInput').select()");
- QCOMPARE(evaluateJavaScriptSync(&page, "window.getSelection().toString()").toString(),
- QStringLiteral("OriginalText"));
-
- // Check that the actual settings work by the
- // - return value of queryCommandEnabled and
- // - return value of execCommand
- // - comparing the clipboard / input field
- QGuiApplication::clipboard()->clear();
- QCOMPARE(evaluateJavaScriptSync(&page, "document.queryCommandEnabled('copy')").toBool(),
- copyResult);
- QCOMPARE(evaluateJavaScriptSync(&page, "document.execCommand('copy')").toBool(), copyResult);
- QTRY_COMPARE(QApplication::clipboard()->text(),
- (copyResult ? QString("OriginalText") : QString()));
-
-
- QGuiApplication::clipboard()->setText("AnotherText");
- QCOMPARE(evaluateJavaScriptSync(&page, "document.queryCommandEnabled('paste')").toBool(),
- pasteResult);
- QCOMPARE(evaluateJavaScriptSync(&page, "document.execCommand('paste')").toBool(), pasteResult);
- QCOMPARE(evaluateJavaScriptSync(&page, "document.getElementById('myInput').value").toString(),
- (pasteResult ? QString("AnotherText") : QString("OriginalText")));
-}
-
-class NavigationRequestOverride : public QWebEnginePage
-{
-protected:
- virtual bool acceptNavigationRequest(const QUrl &url, NavigationType type, bool isMainFrame)
- {
- Q_UNUSED(type);
-
- if (isMainFrame && url.scheme().startsWith("data"))
- settings()->setAttribute(QWebEngineSettings::JavascriptEnabled, true);
- // TODO: note this setting is flaky, consider settings().commit()
- return true;
- }
-};
-
-void tst_QWebEngineSettings::setInAcceptNavigationRequest()
-{
- NavigationRequestOverride page;
- QSignalSpy loadFinishedSpy(&page, SIGNAL(loadFinished(bool)));
- QWebEngineSettings::defaultSettings()->setAttribute(QWebEngineSettings::JavascriptEnabled, false);
- QVERIFY(!page.settings()->testAttribute(QWebEngineSettings::JavascriptEnabled));
-
- page.load(QUrl("about:blank"));
- QVERIFY(loadFinishedSpy.wait());
- QVERIFY(!page.settings()->testAttribute(QWebEngineSettings::JavascriptEnabled));
-
- page.setHtml("<html><body>"
- "<script>document.write('PASS')</script>"
- "<noscript>FAIL</noscript>"
- "</body></html>");
- QVERIFY(loadFinishedSpy.wait());
- QVERIFY(page.settings()->testAttribute(QWebEngineSettings::JavascriptEnabled));
- QCOMPARE(toPlainTextSync(&page), QStringLiteral("PASS"));
-}
-
-QTEST_MAIN(tst_QWebEngineSettings)
-
-#include "tst_qwebenginesettings.moc"
diff --git a/tests/auto/widgets/qwebengineview/BLACKLIST b/tests/auto/widgets/qwebengineview/BLACKLIST
index 266f08886..26f2da4bb 100644
--- a/tests/auto/widgets/qwebengineview/BLACKLIST
+++ b/tests/auto/widgets/qwebengineview/BLACKLIST
@@ -1,8 +1,12 @@
-[microFocusCoordinates]
-osx
-
-[textSelectionOutOfInputField]
+[mixLangLocale:eu_ES]
*
-[visibilityState3]
+[navigateOnDrop:file]
+windows
+
+[navigateOnDrop:file_no_navigate]
windows
+
+[horizontalScrollbarTest]
+macos
+rhel # flaky
diff --git a/tests/auto/widgets/qwebengineview/CMakeLists.txt b/tests/auto/widgets/qwebengineview/CMakeLists.txt
new file mode 100644
index 000000000..9583184d0
--- /dev/null
+++ b/tests/auto/widgets/qwebengineview/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+include(../../util/util.cmake)
+
+qt_internal_add_test(tst_qwebengineview
+ SOURCES
+ tst_qwebengineview.cpp
+ LIBRARIES
+ Qt::WebEngineWidgets
+ Qt::WebEngineCorePrivate
+ Qt::GuiPrivate
+ Qt::QuickWidgets
+ Qt::TestPrivate
+ Test::Util
+)
+
+set(tst_qwebengineview_resource_files
+ "resources/dummy.html"
+ "resources/frame_a.html"
+ "resources/image2.png"
+ "resources/index.html"
+ "resources/input_types.html"
+ "resources/keyboardEvents.html"
+ "resources/scrolltest_page.html"
+)
+
+qt_internal_add_resource(tst_qwebengineview "tst_qwebengineview"
+ PREFIX
+ "/"
+ FILES
+ ${tst_qwebengineview_resource_files}
+)
diff --git a/tests/auto/widgets/qwebengineview/qwebengineview.pro b/tests/auto/widgets/qwebengineview/qwebengineview.pro
deleted file mode 100644
index d91c0074b..000000000
--- a/tests/auto/widgets/qwebengineview/qwebengineview.pro
+++ /dev/null
@@ -1,2 +0,0 @@
-include(../tests.pri)
-QT *= gui-private
diff --git a/tests/auto/widgets/qwebengineview/resources/dummy.html b/tests/auto/widgets/qwebengineview/resources/dummy.html
new file mode 100644
index 000000000..f5ba1963a
--- /dev/null
+++ b/tests/auto/widgets/qwebengineview/resources/dummy.html
@@ -0,0 +1,6 @@
+<html><head>
+<title>Dummy simple page without real content</title>
+<link rel='icon' href='qrc:///resources/image2.png'/>
+</head><body>
+<a>This is test content</a>
+</body></html>
diff --git a/tests/auto/widgets/resources/test.swf b/tests/auto/widgets/qwebengineview/resources/test.swf
index 895298271..895298271 100644
--- a/tests/auto/widgets/resources/test.swf
+++ b/tests/auto/widgets/qwebengineview/resources/test.swf
Binary files differ
diff --git a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
index 5e16361c5..f4ed06e14 100644
--- a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
+++ b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
@@ -19,35 +19,42 @@
Boston, MA 02110-1301, USA.
*/
-#include <qtest.h>
-#include "../util.h"
+#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses
+#include <QtWebEngineCore/private/qtwebenginecore-config_p.h>
+#include <qtest.h>
+#include <util.h>
#include <private/qinputmethod_p.h>
#include <qpainter.h>
#include <qpagelayout.h>
-#include <qpa/qplatforminputcontext.h>
#include <qwebengineview.h>
#include <qwebenginepage.h>
#include <qwebenginesettings.h>
-#include <qnetworkrequest.h>
+#include <qaction.h>
#include <qdiriterator.h>
+#include <qnetworkrequest.h>
#include <qstackedlayout.h>
#include <qtemporarydir.h>
#include <QClipboard>
#include <QCompleter>
+#include <QDropEvent>
#include <QLabel>
#include <QLineEdit>
+#include <QListView>
#include <QHBoxLayout>
#include <QMenu>
+#include <QMimeData>
#include <QQuickItem>
#include <QQuickWidget>
#include <QtWebEngineCore/qwebenginehttprequest.h>
+#include <QScopeGuard>
+#include <QStringListModel>
#include <QTcpServer>
#include <QTcpSocket>
#include <QStyle>
-#include <QtWidgets/qaction.h>
#include <QWebEngineProfile>
#include <QtCore/qregularexpression.h>
+#include <QtTest/private/qemulationdetector_p.h>
#define VERIFY_INPUTMETHOD_HINTS(actual, expect) \
QVERIFY(actual == (expect | Qt::ImhNoPredictiveText | Qt::ImhNoTextHandles | Qt::ImhNoEditMenu));
@@ -60,44 +67,6 @@ do { \
QCOMPARE((__expr), __expected); \
} while (0)
-static QTouchDevice* s_touchDevice = nullptr;
-
-static QPoint elementCenter(QWebEnginePage *page, const QString &id)
-{
- const QString jsCode(
- "(function(){"
- " var elem = document.getElementById('" + id + "');"
- " var rect = elem.getBoundingClientRect();"
- " return [(rect.left + rect.right) / 2, (rect.top + rect.bottom) / 2];"
- "})()");
- QVariantList rectList = evaluateJavaScriptSync(page, jsCode).toList();
-
- if (rectList.count() != 2) {
- qWarning("elementCenter failed.");
- return QPoint();
- }
-
- return QPoint(rectList.at(0).toInt(), rectList.at(1).toInt());
-}
-
-static QRect elementGeometry(QWebEnginePage *page, const QString &id)
-{
- const QString jsCode(
- "(function() {"
- " var elem = document.getElementById('" + id + "');"
- " var rect = elem.getBoundingClientRect();"
- " return [rect.left, rect.top, rect.right, rect.bottom];"
- "})()");
- QVariantList coords = evaluateJavaScriptSync(page, jsCode).toList();
-
- if (coords.count() != 4) {
- qWarning("elementGeometry faield.");
- return QRect();
- }
-
- return QRect(coords[0].toInt(), coords[1].toInt(), coords[2].toInt(), coords[3].toInt());
-}
-
QT_BEGIN_NAMESPACE
namespace QTest {
int Q_TESTLIB_EXPORT defaultMouseDelay();
@@ -106,7 +75,8 @@ namespace QTest {
{
QTest::qWait(QTest::defaultMouseDelay());
lastMouseTimestamp += QTest::defaultMouseDelay();
- QMouseEvent me(type, pos, Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
+ QMouseEvent me(type, pos, widget->mapToGlobal(pos), Qt::LeftButton, Qt::LeftButton,
+ Qt::NoModifier);
me.setTimestamp(++lastMouseTimestamp);
QSpontaneKeyEvent::setSpontaneous(&me);
qApp->sendEvent(widget, &me);
@@ -142,6 +112,7 @@ private Q_SLOTS:
void changePage();
void reusePage_data();
void reusePage();
+ void setLoadedPage();
void microFocusCoordinates();
void focusInputTypes();
void unhandledKeyEventPropagation();
@@ -162,14 +133,13 @@ private Q_SLOTS:
void doNotBreakLayout();
void changeLocale();
+ void mixLangLocale_data();
+ void mixLangLocale();
void inputMethodsTextFormat_data();
void inputMethodsTextFormat();
void keyboardEvents();
void keyboardFocusAfterPopup();
void mouseClick();
- void touchTap();
- void touchTapAndHold();
- void touchTapAndHoldCancelled();
void postData();
void inputFieldOverridesShortcuts();
@@ -188,7 +158,7 @@ private Q_SLOTS:
void mouseLeave();
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void globalMouseSelection();
#endif
void noContextMenu();
@@ -202,6 +172,7 @@ private Q_SLOTS:
void jsKeyboardEvent_data();
void jsKeyboardEvent();
void deletePage();
+ void autoDeleteOnExternalPageDelete();
void closeOpenerTab();
void switchPage();
void setPageDeletesImplicitPage();
@@ -210,13 +181,20 @@ private Q_SLOTS:
void setPagePreservesExplicitPage();
void setViewPreservesExplicitPage();
void closeDiscardsPage();
+ void loadAfterRendererCrashed();
+ void inspectElement();
+ void navigateOnDrop_data();
+ void navigateOnDrop();
+ void emptyUriListOnDrop();
+ void datalist();
+ void longKeyEventText();
+ void pageWithPaintListeners();
};
// This will be called before the first test function is executed.
// It is only called once.
void tst_QWebEngineView::initTestCase()
{
- s_touchDevice = QTest::createTouchDevice();
}
// This will be called after the last test function is executed.
@@ -233,6 +211,96 @@ void tst_QWebEngineView::init()
// This will be called after every test function.
void tst_QWebEngineView::cleanup()
{
+ QTRY_COMPARE(QApplication::topLevelWidgets().size(), 0);
+}
+
+class PageWithPaintListeners : public QWebEnginePage
+{
+ Q_OBJECT
+public:
+ PageWithPaintListeners(QObject *parent = nullptr) : QWebEnginePage(parent)
+ {
+ addFirstContentfulPaintListener();
+ addLargestContentfulPaintListener();
+ }
+
+ void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString &message,
+ int lineNumber, const QString &sourceID) override
+ {
+ Q_UNUSED(level)
+ Q_UNUSED(lineNumber)
+ Q_UNUSED(sourceID)
+ if (message.contains("firstContentfulPaint"))
+ emit firstContentfulPaint();
+ if (message.contains("largestContentfulPaint"))
+ emit largestContentfulPaint();
+ }
+
+ // https://developer.mozilla.org/en-US/docs/Web/API/PerformanceObserver
+ void addFirstContentfulPaintListener()
+ {
+ QObject::connect(this, &QWebEnginePage::loadFinished, [this]() {
+ runJavaScript(QStringLiteral(
+ "new PerformanceObserver((entryList) => {"
+ " if (entryList.getEntriesByType('first-contentful-paint'))"
+ " console.log('firstContentfulPaint');"
+ "}).observe({type: 'paint', buffered: true});"));
+ });
+ }
+
+ void addLargestContentfulPaintListener()
+ {
+ QObject::connect(this, &QWebEnginePage::loadFinished, [this]() {
+ runJavaScript(QStringLiteral(
+ "new PerformanceObserver((entryList) => {"
+ " console.log('largestContentfulPaint');"
+ "}).observe({type: 'largest-contentful-paint', buffered: true});"));
+ });
+ }
+
+signals:
+ void firstContentfulPaint(); // https://web.dev/articles/fcp
+ void largestContentfulPaint(); // https://web.dev/articles/lcp
+};
+
+void tst_QWebEngineView::pageWithPaintListeners()
+{
+ PageWithPaintListeners page;
+
+ QSignalSpy firstContentfulPaintSpy(&page, &PageWithPaintListeners::firstContentfulPaint);
+ QSignalSpy largestContentfulPaintSpy(&page, &PageWithPaintListeners::largestContentfulPaint);
+
+ const QString empty =
+ QStringLiteral("<html><body style='width:100x;height:100px;'></body></html>");
+ const QString scrollBars =
+ QStringLiteral("<html><body style='width:1000px;height:1000px;'></body></html>");
+ const QString backgroundColor =
+ QStringLiteral("<html><body style='background-color:green'></body></html>");
+ const QString text = QStringLiteral("<html><body>text</body></html>");
+
+ QWebEngineView view;
+ view.setPage(&page);
+ view.resize(600, 600);
+ view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
+
+ page.setHtml(empty);
+ QTest::qWait(500); // empty page should not trigger
+ QVERIFY(firstContentfulPaintSpy.size() == 0);
+ QVERIFY(largestContentfulPaintSpy.size() == 0);
+
+ page.setHtml(backgroundColor);
+ QTRY_VERIFY(firstContentfulPaintSpy.size() == 1);
+
+ page.setHtml(text);
+ QTRY_VERIFY(firstContentfulPaintSpy.size() == 2);
+ QTRY_VERIFY(largestContentfulPaintSpy.size() == 1);
+
+#if !QT_CONFIG(webengine_embedded_build)
+ // Embedded builds have different scrollbars that are only painted on hover
+ page.setHtml(scrollBars);
+ QTRY_VERIFY(firstContentfulPaintSpy.size() == 3);
+#endif
}
void tst_QWebEngineView::renderHints()
@@ -331,64 +399,71 @@ void tst_QWebEngineView::changePage()
QSignalSpy pageFromLoadSpy(pageFrom.get(), &QWebEnginePage::loadFinished);
QSignalSpy pageFromIconLoadSpy(pageFrom.get(), &QWebEnginePage::iconChanged);
pageFrom->load(urlFrom);
- QTRY_COMPARE(pageFromLoadSpy.count(), 1);
+ QTRY_COMPARE(pageFromLoadSpy.size(), 1);
QCOMPARE(pageFromLoadSpy.last().value(0).toBool(), true);
if (!fromIsNullPage) {
- QTRY_COMPARE(pageFromIconLoadSpy.count(), 1);
+ QTRY_COMPARE(pageFromIconLoadSpy.size(), 1);
QVERIFY(!pageFromIconLoadSpy.last().value(0).isNull());
}
view->setPage(pageFrom.get());
+ QCOMPARE(view->page(), pageFrom.get());
+ QCOMPARE(QWebEngineView::forPage(pageFrom.get()), view.get());
- QTRY_COMPARE(spyUrl.count(), 1);
+ QTRY_COMPARE(spyUrl.size(), 1);
QCOMPARE(spyUrl.last().value(0).toUrl(), pageFrom->url());
- QTRY_COMPARE(spyTitle.count(), 1);
+ QTRY_COMPARE(spyTitle.size(), 1);
QCOMPARE(spyTitle.last().value(0).toString(), pageFrom->title());
- QTRY_COMPARE(spyIconUrl.count(), fromIsNullPage ? 0 : 1);
- QTRY_COMPARE(spyIcon.count(), fromIsNullPage ? 0 : 1);
+ QTRY_COMPARE(spyIconUrl.size(), fromIsNullPage ? 0 : 1);
+ QTRY_COMPARE(spyIcon.size(), fromIsNullPage ? 0 : 1);
if (!fromIsNullPage) {
QVERIFY(!pageFrom->iconUrl().isEmpty());
QCOMPARE(spyIconUrl.last().value(0).toUrl(), pageFrom->iconUrl());
- QCOMPARE(spyIcon.last().value(0), QVariant::fromValue(pageFrom->icon()));
+ QCOMPARE(spyIcon.last().value(0).value<QIcon>().availableSizes(),
+ pageFrom->icon().availableSizes());
}
QScopedPointer<QWebEnginePage> pageTo(new QWebEnginePage);
QSignalSpy pageToLoadSpy(pageTo.get(), &QWebEnginePage::loadFinished);
QSignalSpy pageToIconLoadSpy(pageTo.get(), &QWebEnginePage::iconChanged);
pageTo->load(urlTo);
- QTRY_COMPARE(pageToLoadSpy.count(), 1);
+ QTRY_COMPARE(pageToLoadSpy.size(), 1);
QCOMPARE(pageToLoadSpy.last().value(0).toBool(), true);
if (!toIsNullPage) {
- QTRY_COMPARE(pageToIconLoadSpy.count(), 1);
+ QTRY_COMPARE(pageToIconLoadSpy.size(), 1);
QVERIFY(!pageToIconLoadSpy.last().value(0).isNull());
}
view->setPage(pageTo.get());
+ QCOMPARE(view->page(), pageTo.get());
+ QCOMPARE(QWebEngineView::forPage(pageTo.get()), view.get());
+ QCOMPARE(QWebEngineView::forPage(pageFrom.get()), nullptr);
- QTRY_COMPARE(spyUrl.count(), 2);
+ QTRY_COMPARE(spyUrl.size(), 2);
QCOMPARE(spyUrl.last().value(0).toUrl(), pageTo->url());
- QTRY_COMPARE(spyTitle.count(), 2);
+ QTRY_COMPARE(spyTitle.size(), 2);
QCOMPARE(spyTitle.last().value(0).toString(), pageTo->title());
bool iconIsSame = fromIsNullPage == toIsNullPage;
int iconChangeNotifyCount = fromIsNullPage ? (iconIsSame ? 0 : 1) : (iconIsSame ? 1 : 2);
- QTRY_COMPARE(spyIconUrl.count(), iconChangeNotifyCount);
- QTRY_COMPARE(spyIcon.count(), iconChangeNotifyCount);
+ QTRY_COMPARE(spyIconUrl.size(), iconChangeNotifyCount);
+ QTRY_COMPARE(spyIcon.size(), iconChangeNotifyCount);
QCOMPARE(pageFrom->iconUrl() == pageTo->iconUrl(), iconIsSame);
if (!iconIsSame) {
QCOMPARE(spyIconUrl.last().value(0).toUrl(), pageTo->iconUrl());
- QCOMPARE(spyIcon.last().value(0), QVariant::fromValue(pageTo->icon()));
+ QCOMPARE(spyIcon.last().value(0).value<QIcon>().availableSizes(),
+ pageTo->icon().availableSizes());
}
// verify no emits on destroy with the same number of signals in spy
view.reset();
qApp->processEvents();
- QTRY_COMPARE(spyUrl.count(), 2);
- QTRY_COMPARE(spyTitle.count(), 2);
- QTRY_COMPARE(spyIconUrl.count(), iconChangeNotifyCount);
- QTRY_COMPARE(spyIcon.count(), iconChangeNotifyCount);
+ QTRY_COMPARE(spyUrl.size(), 2);
+ QTRY_COMPARE(spyTitle.size(), 2);
+ QTRY_COMPARE(spyIconUrl.size(), iconChangeNotifyCount);
+ QTRY_COMPARE(spyIcon.size(), iconChangeNotifyCount);
}
void tst_QWebEngineView::reusePage_data()
@@ -401,27 +476,31 @@ void tst_QWebEngineView::reusePage_data()
void tst_QWebEngineView::reusePage()
{
- if (!QDir(TESTS_SOURCE_DIR).exists())
- W_QSKIP(QString("This test requires access to resources found in '%1'").arg(TESTS_SOURCE_DIR).toLatin1().constData(), SkipAll);
+ if (!QDir(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()).exists())
+ W_QSKIP(QString("This test requires access to resources found in '%1'")
+ .arg(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath())
+ .toLatin1()
+ .constData(),
+ SkipAll);
- QDir::setCurrent(TESTS_SOURCE_DIR);
+ QDir::setCurrent(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath());
QFETCH(QString, html);
QWebEngineView* view1 = new QWebEngineView;
QPointer<QWebEnginePage> page = new QWebEnginePage;
view1->setPage(page.data());
page.data()->settings()->setAttribute(QWebEngineSettings::PluginsEnabled, true);
- page->setHtml(html, QUrl::fromLocalFile(TESTS_SOURCE_DIR));
+ page->setHtml(html, QUrl::fromLocalFile(QDir(QT_TESTCASE_SOURCEDIR).canonicalPath()));
if (html.contains("</embed>")) {
// some reasonable time for the PluginStream to feed test.swf to flash and start painting
QSignalSpy spyFinished(view1, &QWebEngineView::loadFinished);
- QVERIFY(spyFinished.wait(2000));
+ QVERIFY(spyFinished.wait(20000));
}
view1->show();
QVERIFY(QTest::qWaitForWindowExposed(view1));
delete view1;
- QVERIFY(page != 0); // deleting view must not have deleted the page, since it's not a child of view
+ QVERIFY(page != nullptr); // deleting view must not have deleted the page, since it's not a child of view
QWebEngineView *view2 = new QWebEngineView;
view2->setPage(page.data());
@@ -434,6 +513,23 @@ void tst_QWebEngineView::reusePage()
QDir::setCurrent(QApplication::applicationDirPath());
}
+void tst_QWebEngineView::setLoadedPage()
+{
+ // MEMO load page first to make sure that just simple attach to view would draw its content
+ QWebEnginePage page;
+ QSignalSpy loadSpy(&page, &QWebEnginePage::loadFinished);
+ page.setHtml(QString("<html><body bgcolor=\"%1\"></body></html>").arg(QColor(Qt::yellow).name()));
+ QTRY_VERIFY(loadSpy.size() == 1 && loadSpy.first().first().toBool());
+
+ QWebEngineView view;
+ view.resize(480, 320);
+ view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
+
+ view.setPage(&page);
+ QTRY_COMPARE(view.grab().toImage().pixelColor(QPoint(view.width() / 2, view.height() / 2)), Qt::yellow);
+}
+
// Class used in crashTests
class WebViewCrashTest : public QObject {
Q_OBJECT
@@ -508,7 +604,7 @@ void tst_QWebEngineView::microFocusCoordinates()
QVariant initialMicroFocus = webView.focusProxy()->inputMethodQuery(Qt::ImCursorRectangle);
evaluateJavaScriptSync(webView.page(), "window.scrollBy(0, 50)");
- QTRY_VERIFY(scrollSpy.count() > 0);
+ QTRY_VERIFY(scrollSpy.size() > 0);
QTRY_VERIFY(webView.focusProxy()->inputMethodQuery(Qt::ImCursorRectangle).isValid());
QVariant currentMicroFocus = webView.focusProxy()->inputMethodQuery(Qt::ImCursorRectangle);
@@ -518,8 +614,8 @@ void tst_QWebEngineView::microFocusCoordinates()
void tst_QWebEngineView::focusInputTypes()
{
- const QPlatformInputContext *context = QGuiApplicationPrivate::platformIntegration()->inputContext();
- bool imeHasHiddenTextCapability = context && context->hasCapability(QPlatformInputContext::HiddenTextCapability);
+ const QPlatformInputContext *platformInputContext = QGuiApplicationPrivate::platformIntegration()->inputContext();
+ bool imeHasHiddenTextCapability = platformInputContext && platformInputContext->hasCapability(QPlatformInputContext::HiddenTextCapability);
QWebEngineView webView;
webView.resize(640, 480);
@@ -550,7 +646,8 @@ void tst_QWebEngineView::focusInputTypes()
QTRY_COMPARE(evaluateJavaScriptSync(webView.page(), "document.activeElement.id").toString(), QStringLiteral("passwordInput"));
VERIFY_INPUTMETHOD_HINTS(webView.focusProxy()->inputMethodHints(), (Qt::ImhSensitiveData | Qt::ImhNoPredictiveText | Qt::ImhNoAutoUppercase | Qt::ImhHiddenText));
QVERIFY(!webView.focusProxy()->testAttribute(Qt::WA_InputMethodEnabled));
- QTRY_COMPARE(inputMethodQuery(Qt::ImEnabled).toBool(), imeHasHiddenTextCapability);
+ QTRY_VERIFY(inputMethodQuery(Qt::ImEnabled).toBool());
+ QTRY_COMPARE(platformInputContext->inputMethodAccepted(), imeHasHiddenTextCapability);
// 'tel' field
QPoint telInputCenter = elementCenter(webView.page(), "telInput");
@@ -589,7 +686,8 @@ void tst_QWebEngineView::focusInputTypes()
QTRY_COMPARE(evaluateJavaScriptSync(webView.page(), "document.activeElement.id").toString(), QStringLiteral("passwordInput"));
VERIFY_INPUTMETHOD_HINTS(webView.focusProxy()->inputMethodHints(), (Qt::ImhSensitiveData | Qt::ImhNoPredictiveText | Qt::ImhNoAutoUppercase | Qt::ImhHiddenText));
QVERIFY(!webView.focusProxy()->testAttribute(Qt::WA_InputMethodEnabled));
- QTRY_COMPARE(inputMethodQuery(Qt::ImEnabled).toBool(), imeHasHiddenTextCapability);
+ QTRY_VERIFY(inputMethodQuery(Qt::ImEnabled).toBool());
+ QTRY_COMPARE(platformInputContext->inputMethodAccepted(), imeHasHiddenTextCapability);
// 'text' type
QTest::mouseClick(webView.focusProxy(), Qt::LeftButton, {}, textInputCenter);
@@ -603,7 +701,8 @@ void tst_QWebEngineView::focusInputTypes()
QTRY_COMPARE(evaluateJavaScriptSync(webView.page(), "document.activeElement.id").toString(), QStringLiteral("passwordInput"));
VERIFY_INPUTMETHOD_HINTS(webView.focusProxy()->inputMethodHints(), (Qt::ImhSensitiveData | Qt::ImhNoPredictiveText | Qt::ImhNoAutoUppercase | Qt::ImhHiddenText));
QVERIFY(!webView.focusProxy()->testAttribute(Qt::WA_InputMethodEnabled));
- QTRY_COMPARE(inputMethodQuery(Qt::ImEnabled).toBool(), imeHasHiddenTextCapability);
+ QTRY_VERIFY(inputMethodQuery(Qt::ImEnabled).toBool());
+ QTRY_COMPARE(platformInputContext->inputMethodAccepted(), imeHasHiddenTextCapability);
// 'text area' field
QPoint textAreaCenter = elementCenter(webView.page(), "textArea");
@@ -616,10 +715,11 @@ void tst_QWebEngineView::focusInputTypes()
class KeyEventRecordingWidget : public QWidget {
public:
- QList<QKeyEvent> pressEvents;
- QList<QKeyEvent> releaseEvents;
- void keyPressEvent(QKeyEvent *e) override { pressEvents << *e; }
- void keyReleaseEvent(QKeyEvent *e) override { releaseEvents << *e; }
+ ~KeyEventRecordingWidget() { qDeleteAll(pressEvents); qDeleteAll(releaseEvents); }
+ QList<QKeyEvent *> pressEvents;
+ QList<QKeyEvent *> releaseEvents;
+ void keyPressEvent(QKeyEvent *e) override { pressEvents << e->clone(); }
+ void keyReleaseEvent(QKeyEvent *e) override { releaseEvents << e->clone(); }
};
void tst_QWebEngineView::unhandledKeyEventPropagation()
@@ -632,7 +732,7 @@ void tst_QWebEngineView::unhandledKeyEventPropagation()
QSignalSpy loadFinishedSpy(&webView, SIGNAL(loadFinished(bool)));
webView.load(QUrl("qrc:///resources/keyboardEvents.html"));
- QVERIFY(loadFinishedSpy.wait());
+ QTRY_VERIFY_WITH_TIMEOUT(loadFinishedSpy.size() > 0, 20000);
evaluateJavaScriptSync(webView.page(), "document.getElementById('first_div').focus()");
QTRY_COMPARE(evaluateJavaScriptSync(webView.page(), "document.activeElement.id").toString(), QStringLiteral("first_div"));
@@ -665,32 +765,42 @@ void tst_QWebEngineView::unhandledKeyEventPropagation()
// The page will consume the Tab key to change focus between elements while the arrow
// keys won't be used.
QCOMPARE(parentWidget.pressEvents.size(), 3);
- QCOMPARE(parentWidget.pressEvents[0].key(), (int)Qt::Key_Right);
- QCOMPARE(parentWidget.pressEvents[1].key(), (int)Qt::Key_Left);
- QCOMPARE(parentWidget.pressEvents[2].key(), (int)Qt::Key_Y);
+ QCOMPARE(parentWidget.pressEvents[0]->key(), (int)Qt::Key_Right);
+ QCOMPARE(parentWidget.pressEvents[1]->key(), (int)Qt::Key_Left);
+ QCOMPARE(parentWidget.pressEvents[2]->key(), (int)Qt::Key_Y);
// Key releases will all come back unconsumed.
- QCOMPARE(parentWidget.releaseEvents[0].key(), (int)Qt::Key_Right);
- QCOMPARE(parentWidget.releaseEvents[1].key(), (int)Qt::Key_Tab);
- QCOMPARE(parentWidget.releaseEvents[2].key(), (int)Qt::Key_Left);
- QCOMPARE(parentWidget.releaseEvents[3].key(), (int)Qt::Key_Y);
+ QCOMPARE(parentWidget.releaseEvents[0]->key(), (int)Qt::Key_Right);
+ QCOMPARE(parentWidget.releaseEvents[1]->key(), (int)Qt::Key_Tab);
+ QCOMPARE(parentWidget.releaseEvents[2]->key(), (int)Qt::Key_Left);
+ QCOMPARE(parentWidget.releaseEvents[3]->key(), (int)Qt::Key_Y);
}
void tst_QWebEngineView::horizontalScrollbarTest()
{
+#if QT_CONFIG(webengine_embedded_build)
+ // Embedded builds enable the OverlayScrollbar and Viewport features (see 'useEmbeddedSwitches' in web_engine_context.cpp).
+ // These features make the scrollbar simpler assuming we are on a device with small (usually touch) display.
+ // These scrollbars behave differently on mouse events.
+ QSKIP("Embedded builds have different scrollbar, skipping test.");
+#endif
QString html("<html><body>"
"<div style='width: 1000px; height: 1000px; background-color: green' />"
"</body></html>");
QWebEngineView view;
+ PageWithPaintListeners page;
+ view.setPage(&page);
view.setFixedSize(600, 600);
view.show();
QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QSignalSpy firstPaintSpy(&page, &PageWithPaintListeners::firstContentfulPaint);
QSignalSpy loadSpy(view.page(), SIGNAL(loadFinished(bool)));
view.setHtml(html);
- QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE(loadSpy.size(), 1);
+ QTRY_COMPARE(firstPaintSpy.size(), 1);
QVERIFY(view.page()->scrollPosition() == QPoint(0, 0));
QSignalSpy scrollSpy(view.page(), SIGNAL(scrollPositionChanged(QPointF)));
@@ -927,7 +1037,7 @@ public:
case QEvent::ContextMenu:
case QEvent::KeyPress:
case QEvent::KeyRelease:
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
case QEvent::Wheel:
#endif
++m_eventCounter;
@@ -961,7 +1071,7 @@ public:
private:
int m_eventCounter;
- QVector<QString> m_eventHistory;
+ QList<QString> m_eventHistory;
};
void tst_QWebEngineView::doNotSendMouseKeyboardEventsWhenDisabled()
@@ -982,7 +1092,7 @@ void tst_QWebEngineView::doNotSendMouseKeyboardEventsWhenDisabled()
QSignalSpy loadSpy(&webView, SIGNAL(loadFinished(bool)));
webView.setHtml("<html><head><title>Title</title></head><body>Hello"
"<input id=\"input\" type=\"text\"></body></html>");
- QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE(loadSpy.size(), 1);
// When the webView is enabled, the events are swallowed by it, and the parent widget
// does not receive any events, otherwise all events are processed by the parent widget.
@@ -1029,7 +1139,7 @@ void tst_QWebEngineView::stopSettingFocusWhenDisabled()
QSignalSpy loadSpy(&webView, SIGNAL(loadFinished(bool)));
webView.setHtml("<html><head><title>Title</title></head><body>Hello"
"<input id=\"input\" type=\"text\"></body></html>");
- QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE(loadSpy.size(), 1);
QTRY_COMPARE_WITH_TIMEOUT(webView.hasFocus(), focusResult, 1000);
evaluateJavaScriptSync(webView.page(), "document.getElementById(\"input\").focus()");
@@ -1142,21 +1252,23 @@ void tst_QWebEngineView::focusInternalRenderWidgetHostViewQuickItem()
QWebEngineView *webView = new QWebEngineView;
QWebEngineSettings *settings = webView->page()->settings();
settings->setAttribute(QWebEngineSettings::FocusOnNavigationEnabled, false);
- webView->resize(300, 300);
+ webView->resize(300, 100);
- QHBoxLayout *layout = new QHBoxLayout;
+ QVBoxLayout *layout = new QVBoxLayout;
layout->addWidget(label);
layout->addWidget(webView);
+ containerWidget->resize(300, 200);
containerWidget->setLayout(layout);
containerWidget->show();
QVERIFY(QTest::qWaitForWindowExposed(containerWidget.data()));
// Load the content, and check that focus is not set.
QSignalSpy loadSpy(webView, SIGNAL(loadFinished(bool)));
- webView->setHtml("<html><head><title>Title</title></head><body>Hello"
- "<input id=\"input\" type=\"text\"></body></html>");
- QTRY_COMPARE(loadSpy.count(), 1);
+ webView->setHtml("<html><body>"
+ " <input id='input1' type='text'/>"
+ "</body></html>");
+ QTRY_COMPARE(loadSpy.size(), 1);
QTRY_COMPARE(webView->hasFocus(), false);
// Manually trigger focus.
@@ -1165,15 +1277,43 @@ void tst_QWebEngineView::focusInternalRenderWidgetHostViewQuickItem()
// Check that focus is set in QWebEngineView and all internal classes.
QTRY_COMPARE(webView->hasFocus(), true);
- QQuickWidget *renderWidgetHostViewQtDelegateWidget =
- qobject_cast<QQuickWidget *>(webView->focusProxy());
- QVERIFY(renderWidgetHostViewQtDelegateWidget);
- QTRY_COMPARE(renderWidgetHostViewQtDelegateWidget->hasFocus(), true);
+ QQuickWidget *webEngineQuickWidget = qobject_cast<QQuickWidget *>(webView->focusProxy());
+ QVERIFY(webEngineQuickWidget);
+ QTRY_COMPARE(webEngineQuickWidget->hasFocus(), true);
+
+ QQuickItem *root = webEngineQuickWidget->rootObject();
+ // The root item should not has focus, otherwise it would handle input events
+ // instead of the RenderWidgetHostViewQtDelegateItem.
+ QVERIFY(!root->hasFocus());
+
+ QCOMPARE(root->childItems().size(), 1);
+ QQuickItem *renderWidgetHostViewQtDelegateItem = root->childItems().at(0);
+ QVERIFY(renderWidgetHostViewQtDelegateItem);
+ QTRY_COMPARE(renderWidgetHostViewQtDelegateItem->hasFocus(), true);
+ // Test if QWebEngineView handles key events.
+ QTRY_COMPARE(renderWidgetHostViewQtDelegateItem->hasActiveFocus(), true);
+
+ // Key events should not be forwarded to the unfocused input field.
+ QTRY_COMPARE(evaluateJavaScriptSync(webView->page(),
+ "document.getElementById('input1').value").toString(),
+ QStringLiteral(""));
+ QTest::keyClick(webView->focusProxy(), Qt::Key_X);
+ QTest::qWait(100);
+ QTRY_COMPARE(evaluateJavaScriptSync(webView->page(),
+ "document.getElementById('input1').value").toString(),
+ QStringLiteral(""));
+
+ // Focus the input field. Focus rectangle is expected to appear around the input field.
+ evaluateJavaScriptSync(webView->page(), "document.getElementById('input1').focus()");
+ QTRY_COMPARE(evaluateJavaScriptSync(webView->page(),
+ "document.activeElement.id").toString(),
+ QStringLiteral("input1"));
- QQuickItem *renderWidgetHostViewQuickItem =
- renderWidgetHostViewQtDelegateWidget->rootObject();
- QVERIFY(renderWidgetHostViewQuickItem);
- QTRY_COMPARE(renderWidgetHostViewQuickItem->hasFocus(), true);
+ // Test the focused input field with a key event.
+ QTest::keyClick(webView->focusProxy(), Qt::Key_X);
+ QTRY_COMPARE(evaluateJavaScriptSync(webView->page(),
+ "document.getElementById('input1').value").toString(),
+ QStringLiteral("x"));
}
void tst_QWebEngineView::doNotBreakLayout()
@@ -1203,6 +1343,9 @@ void tst_QWebEngineView::doNotBreakLayout()
void tst_QWebEngineView::changeLocale()
{
+ if (QTestPrivate::isRunningArmOnX86())
+ QSKIP("Does not work with QEMU. (QTBUG-94911)");
+
QStringList errorLines;
QUrl url("http://non.existent/");
@@ -1210,7 +1353,7 @@ void tst_QWebEngineView::changeLocale()
QWebEngineView viewDE;
QSignalSpy loadFinishedSpyDE(&viewDE, SIGNAL(loadFinished(bool)));
viewDE.load(url);
- QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpyDE.count(), 1, 20000);
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpyDE.size(), 1, 20000);
QTRY_VERIFY(!toPlainTextSync(viewDE.page()).isEmpty());
errorLines = toPlainTextSync(viewDE.page()).split(QRegularExpression("[\r\n]"), Qt::SkipEmptyParts);
@@ -1220,7 +1363,7 @@ void tst_QWebEngineView::changeLocale()
QWebEngineView viewEN;
QSignalSpy loadFinishedSpyEN(&viewEN, SIGNAL(loadFinished(bool)));
viewEN.load(url);
- QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpyEN.count(), 1, 20000);
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpyEN.size(), 1, 20000);
QTRY_VERIFY(!toPlainTextSync(viewEN.page()).isEmpty());
errorLines = toPlainTextSync(viewEN.page()).split(QRegularExpression("[\r\n]"), Qt::SkipEmptyParts);
@@ -1233,13 +1376,56 @@ void tst_QWebEngineView::changeLocale()
// Check whether an existing QWebEngineView keeps the language settings after changing the default locale
viewDE.load(url);
- QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpyDE.count(), 1, 20000);
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpyDE.size(), 1, 20000);
QTRY_VERIFY(!toPlainTextSync(viewDE.page()).isEmpty());
errorLines = toPlainTextSync(viewDE.page()).split(QRegularExpression("[\r\n]"), Qt::SkipEmptyParts);
QCOMPARE(errorLines.first().toUtf8(), QByteArrayLiteral("Die Website ist nicht erreichbar"));
}
+void tst_QWebEngineView::mixLangLocale_data()
+{
+ QTest::addColumn<QString>("locale");
+ QTest::addColumn<QByteArray>("formattedNumber");
+ QTest::newRow("en_DK") << "en-DK" << QByteArray("1.234.567.890");
+ QTest::newRow("de") << "de" << QByteArray("1.234.567.890");
+ QTest::newRow("de_CH") << "de-CH" << QByteArray("1’234’567’890");
+ QTest::newRow("eu_ES") << "eu-ES" << QByteArray("1.234.567.890");
+ QTest::newRow("hu_HU") << "hu-HU" << QByteArray("1\xC2\xA0""234\xC2\xA0""567\xC2\xA0""890"); // no-break spaces
+}
+
+void tst_QWebEngineView::mixLangLocale()
+{
+ QFETCH(QString, locale);
+ QFETCH(QByteArray, formattedNumber);
+
+ QLocale::setDefault(QLocale(locale));
+
+ QWebEngineView view;
+ QSignalSpy loadSpy(&view, &QWebEngineView::loadFinished);
+
+ bool terminated = false;
+ auto sc = connect(view.page(), &QWebEnginePage::renderProcessTerminated, [&] () { terminated = true; });
+
+ view.load(QUrl("qrc:///resources/dummy.html"));
+ QTRY_VERIFY(terminated || loadSpy.size() == 1);
+
+ QVERIFY2(!terminated,
+ qPrintable(QString("Locale [%1] terminated: %2, loaded: %3").arg(locale).arg(terminated).arg(loadSpy.size())));
+ QVERIFY(loadSpy.first().first().toBool());
+
+ QString content = toPlainTextSync(view.page());
+ QVERIFY2(!content.isEmpty() && content.contains("test content"), qPrintable(content));
+
+ QCOMPARE(evaluateJavaScriptSync(view.page(), "navigator.language").toString(), QLocale().bcp47Name());
+
+ if (locale == "eu-ES")
+ QEXPECT_FAIL("", "Basque number formatting is somehow dependent on environment", Continue);
+ QCOMPARE(evaluateJavaScriptSync(view.page(), "Number(1234567890).toLocaleString()").toByteArray(), formattedNumber);
+
+ QLocale::setDefault(QLocale("en"));
+}
+
void tst_QWebEngineView::inputMethodsTextFormat_data()
{
QTest::addColumn<QString>("string");
@@ -1272,17 +1458,19 @@ void tst_QWebEngineView::inputMethodsTextFormat_data()
void tst_QWebEngineView::inputMethodsTextFormat()
{
- QWebEngineView view;
- view.settings()->setAttribute(QWebEngineSettings::FocusOnNavigationEnabled, true);
- QSignalSpy loadFinishedSpy(&view, SIGNAL(loadFinished(bool)));
+ QWebEnginePage page;
+ QWebEngineView view(&page);
+ page.settings()->setAttribute(QWebEngineSettings::FocusOnNavigationEnabled, true);
+ QSignalSpy loadFinishedSpy(&page, SIGNAL(loadFinished(bool)));
- view.setHtml("<html><body>"
+ page.setHtml("<html><body>"
" <input type='text' id='input1' style='font-family: serif' value='' maxlength='20'/>"
"</body></html>");
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
- evaluateJavaScriptSync(view.page(), "document.getElementById('input1').focus()");
view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
+ evaluateJavaScriptSync(&page, "document.getElementById('input1').focus()");
QFETCH(QString, string);
QFETCH(int, start);
@@ -1306,8 +1494,8 @@ void tst_QWebEngineView::inputMethodsTextFormat()
attrs.append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, start, length, format));
QInputMethodEvent im(string, attrs);
- QVERIFY(QApplication::sendEvent(view.focusProxy(), &im));
- QTRY_COMPARE(evaluateJavaScriptSync(view.page(), "document.getElementById('input1').value").toString(), string);
+ QApplication::sendEvent(view.focusProxy(), &im);
+ QTRY_COMPARE_WITH_TIMEOUT(evaluateJavaScriptSync(&page, "document.getElementById('input1').value").toString(), string, 20000);
}
void tst_QWebEngineView::keyboardEvents()
@@ -1316,7 +1504,7 @@ void tst_QWebEngineView::keyboardEvents()
view.show();
QSignalSpy loadFinishedSpy(&view, SIGNAL(loadFinished(bool)));
view.load(QUrl("qrc:///resources/keyboardEvents.html"));
- QVERIFY(loadFinishedSpy.wait());
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size(), 1, 30000);
QStringList elements;
elements << "first_div" << "second_div";
@@ -1435,17 +1623,21 @@ void tst_QWebEngineView::keyboardFocusAfterPopup()
QTRY_COMPARE(QApplication::focusWidget(), window.lineEdit);
// Trigger QCompleter's popup and select the first suggestion.
- QTest::keyClick(QApplication::focusWindow(), Qt::Key_T);
+ QTest::keyPress(QApplication::focusWindow(), Qt::Key_T);
+ QTest::keyRelease(QApplication::focusWindow(), Qt::Key_T);
QTRY_VERIFY(QApplication::activePopupWidget());
- QTest::keyClick(QApplication::focusWindow(), Qt::Key_Down);
- QTest::keyClick(QApplication::focusWindow(), Qt::Key_Enter);
+ QTest::keyPress(QApplication::focusWindow(), Qt::Key_Down);
+ QTest::keyRelease(QApplication::focusWindow(), Qt::Key_Down);
+ QTest::keyPress(QApplication::focusWindow(), Qt::Key_Enter);
+ QTest::keyRelease(QApplication::focusWindow(), Qt::Key_Enter);
// Due to FocusOnNavigationEnabled, focus should now move to the webView.
QTRY_COMPARE(QApplication::focusWidget(), window.webView->focusProxy());
// Keyboard events sent to the window should go to the <input> element.
- QVERIFY(loadFinishedSpy.count() || loadFinishedSpy.wait());
- QTest::keyClick(QApplication::focusWindow(), Qt::Key_X);
+ QVERIFY(loadFinishedSpy.size() || loadFinishedSpy.wait());
+ QTest::keyPress(QApplication::focusWindow(), Qt::Key_X);
+ QTest::keyRelease(QApplication::focusWindow(), Qt::Key_X);
QTRY_COMPARE(evaluateJavaScriptSync(window.webView->page(), "document.getElementById('input1').value").toString(),
QStringLiteral("x"));
}
@@ -1474,7 +1666,7 @@ void tst_QWebEngineView::mouseClick()
textInputCenter = elementCenter(view.page(), "input");
QTest::mouseClick(view.focusProxy(), Qt::LeftButton, {}, textInputCenter);
QTRY_COMPARE(evaluateJavaScriptSync(view.page(), "document.activeElement.id").toString(), QStringLiteral("input"));
- QCOMPARE(selectionChangedSpy.count(), 0);
+ QCOMPARE(selectionChangedSpy.size(), 0);
QVERIFY(view.focusProxy()->inputMethodQuery(Qt::ImCurrentSelection).toString().isEmpty());
// Double click
@@ -1489,13 +1681,13 @@ void tst_QWebEngineView::mouseClick()
textInputCenter = elementCenter(view.page(), "input");
QTest::mouseMultiClick(view.focusProxy(), textInputCenter, 2);
QVERIFY(selectionChangedSpy.wait());
- QCOMPARE(selectionChangedSpy.count(), 1);
+ QCOMPARE(selectionChangedSpy.size(), 1);
QCOMPARE(evaluateJavaScriptSync(view.page(), "document.activeElement.id").toString(), QStringLiteral("input"));
QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImCurrentSelection).toString(), QStringLiteral("Company"));
QTest::mouseClick(view.focusProxy(), Qt::LeftButton, {}, textInputCenter);
QVERIFY(selectionChangedSpy.wait());
- QCOMPARE(selectionChangedSpy.count(), 2);
+ QCOMPARE(selectionChangedSpy.size(), 2);
QVERIFY(view.focusProxy()->inputMethodQuery(Qt::ImCurrentSelection).toString().isEmpty());
// Triple click
@@ -1510,182 +1702,16 @@ void tst_QWebEngineView::mouseClick()
textInputCenter = elementCenter(view.page(), "input");
QTest::mouseMultiClick(view.focusProxy(), textInputCenter, 3);
QVERIFY(selectionChangedSpy.wait());
- QTRY_COMPARE(selectionChangedSpy.count(), 2);
+ QTRY_COMPARE(selectionChangedSpy.size(), 2);
QCOMPARE(evaluateJavaScriptSync(view.page(), "document.activeElement.id").toString(), QStringLiteral("input"));
QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImCurrentSelection).toString(), QStringLiteral("The Qt Company"));
QTest::mouseClick(view.focusProxy(), Qt::LeftButton, {}, textInputCenter);
QVERIFY(selectionChangedSpy.wait());
- QCOMPARE(selectionChangedSpy.count(), 3);
+ QCOMPARE(selectionChangedSpy.size(), 3);
QVERIFY(view.focusProxy()->inputMethodQuery(Qt::ImCurrentSelection).toString().isEmpty());
}
-void tst_QWebEngineView::touchTap()
-{
-#if defined(Q_OS_MACOS)
- QSKIP("Synthetic touch events are not supported on macOS");
-#endif
-
- QWebEngineView view;
- view.show();
- view.resize(200, 200);
- QVERIFY(QTest::qWaitForWindowExposed(&view));
-
- QSignalSpy loadFinishedSpy(&view, &QWebEngineView::loadFinished);
-
- view.settings()->setAttribute(QWebEngineSettings::FocusOnNavigationEnabled, false);
- view.setHtml("<html><body>"
- "<p id='text' style='width: 150px;'>The Qt Company</p>"
- "<div id='notext' style='width: 150px; height: 100px; background-color: #f00;'></div>"
- "<form><input id='input' width='150px' type='text' value='The Qt Company2' /></form>"
- "</body></html>");
- QVERIFY(loadFinishedSpy.wait());
- QVERIFY(evaluateJavaScriptSync(view.page(), "document.activeElement.id").toString().isEmpty());
-
- auto singleTap = [](QWidget* target, const QPoint& tapCoords) -> void {
- QTest::touchEvent(target, s_touchDevice).press(1, tapCoords, target);
- QTest::touchEvent(target, s_touchDevice).stationary(1);
- QTest::touchEvent(target, s_touchDevice).release(1, tapCoords, target);
- };
-
- // Single tap on text doesn't trigger a selection
- singleTap(view.focusProxy(), elementCenter(view.page(), "text"));
- QTRY_VERIFY(evaluateJavaScriptSync(view.page(), "document.activeElement.id").toString().isEmpty());
- QTRY_VERIFY(!view.hasSelection());
-
- // Single tap inside the input field focuses it without selecting the text
- singleTap(view.focusProxy(), elementCenter(view.page(), "input"));
- QTRY_COMPARE(evaluateJavaScriptSync(view.page(), "document.activeElement.id").toString(), QStringLiteral("input"));
- QTRY_VERIFY(!view.hasSelection());
-
- // Single tap on the div clears the input field focus
- singleTap(view.focusProxy(), elementCenter(view.page(), "notext"));
- QTRY_VERIFY(evaluateJavaScriptSync(view.page(), "document.activeElement.id").toString().isEmpty());
-
- // Double tap on text still doesn't trigger a selection
- singleTap(view.focusProxy(), elementCenter(view.page(), "text"));
- singleTap(view.focusProxy(), elementCenter(view.page(), "text"));
- QTRY_VERIFY(evaluateJavaScriptSync(view.page(), "document.activeElement.id").toString().isEmpty());
- QTRY_VERIFY(!view.hasSelection());
-
- // Double tap inside the input field focuses it and selects the word under it
- singleTap(view.focusProxy(), elementCenter(view.page(), "input"));
- singleTap(view.focusProxy(), elementCenter(view.page(), "input"));
- QTRY_COMPARE(evaluateJavaScriptSync(view.page(), "document.activeElement.id").toString(), QStringLiteral("input"));
- QTRY_COMPARE(view.selectedText(), QStringLiteral("Company2"));
-
- // Double tap outside the input field behaves like a single tap: clears its focus and selection
- singleTap(view.focusProxy(), elementCenter(view.page(), "notext"));
- singleTap(view.focusProxy(), elementCenter(view.page(), "notext"));
- QTRY_VERIFY(evaluateJavaScriptSync(view.page(), "document.activeElement.id").toString().isEmpty());
- QTRY_VERIFY(!view.hasSelection());
-}
-
-void tst_QWebEngineView::touchTapAndHold()
-{
-#if defined(Q_OS_MACOS)
- QSKIP("Synthetic touch events are not supported on macOS");
-#endif
-
- QWebEngineView view;
- view.show();
- view.resize(200, 200);
- QVERIFY(QTest::qWaitForWindowExposed(&view));
-
- QSignalSpy loadFinishedSpy(&view, &QWebEngineView::loadFinished);
-
- view.settings()->setAttribute(QWebEngineSettings::FocusOnNavigationEnabled, false);
- view.setHtml("<html><body>"
- "<p id='text' style='width: 150px;'>The Qt Company</p>"
- "<div id='notext' style='width: 150px; height: 100px; background-color: #f00;'></div>"
- "<form><input id='input' width='150px' type='text' value='The Qt Company2' /></form>"
- "</body></html>");
- QVERIFY(loadFinishedSpy.wait());
- QVERIFY(evaluateJavaScriptSync(view.page(), "document.activeElement.id").toString().isEmpty());
-
- auto tapAndHold = [](QWidget* target, const QPoint& tapCoords) -> void {
- QTest::touchEvent(target, s_touchDevice).press(1, tapCoords, target);
- QTest::touchEvent(target, s_touchDevice).stationary(1);
- QTest::qWait(1000);
- QTest::touchEvent(target, s_touchDevice).release(1, tapCoords, target);
- };
-
- // Tap-and-hold on text selects the word under it
- tapAndHold(view.focusProxy(), elementCenter(view.page(), "text"));
- QTRY_VERIFY(evaluateJavaScriptSync(view.page(), "document.activeElement.id").toString().isEmpty());
- QTRY_COMPARE(view.selectedText(), QStringLiteral("Company"));
-
- // Tap-and-hold inside the input field focuses it and selects the word under it
- tapAndHold(view.focusProxy(), elementCenter(view.page(), "input"));
- QTRY_COMPARE(evaluateJavaScriptSync(view.page(), "document.activeElement.id").toString(), QStringLiteral("input"));
- QTRY_COMPARE(view.selectedText(), QStringLiteral("Company2"));
-
- // Only test the page context menu on Windows, as Linux doesn't handle context menus consistently
- // and other non-desktop platforms like Android may not even support context menus at all
-#if defined(Q_OS_WIN)
- // Tap-and-hold clears the text selection and shows the page's context menu
- QVERIFY(QApplication::activePopupWidget() == nullptr);
- tapAndHold(view.focusProxy(), elementCenter(view.page(), "notext"));
- QTRY_VERIFY(evaluateJavaScriptSync(view.page(), "document.activeElement.id").toString().isEmpty());
- QTRY_VERIFY(!view.hasSelection());
- QTRY_VERIFY(QApplication::activePopupWidget() != nullptr);
-
- QApplication::activePopupWidget()->close();
- QVERIFY(QApplication::activePopupWidget() == nullptr);
-#endif
-}
-
-void tst_QWebEngineView::touchTapAndHoldCancelled()
-{
-#if defined(Q_OS_MACOS)
- QSKIP("Synthetic touch events are not supported on macOS");
-#endif
-
- QWebEngineView view;
- view.show();
- view.resize(200, 200);
- QVERIFY(QTest::qWaitForWindowExposed(&view));
-
- QSignalSpy loadFinishedSpy(&view, &QWebEngineView::loadFinished);
-
- view.settings()->setAttribute(QWebEngineSettings::FocusOnNavigationEnabled, false);
- view.setHtml("<html><body>"
- "<p id='text' style='width: 150px;'>The Qt Company</p>"
- "<div id='notext' style='width: 150px; height: 100px; background-color: #f00;'></div>"
- "<form><input id='input' width='150px' type='text' value='The Qt Company2' /></form>"
- "</body></html>");
- QVERIFY(loadFinishedSpy.wait());
- QVERIFY(evaluateJavaScriptSync(view.page(), "document.activeElement.id").toString().isEmpty());
-
- auto cancelledTapAndHold = [](QWidget* target, const QPoint& tapCoords) -> void {
- QTest::touchEvent(target, s_touchDevice).press(1, tapCoords, target);
- QTest::touchEvent(target, s_touchDevice).stationary(1);
- QTest::qWait(1000);
- QWindowSystemInterface::handleTouchCancelEvent(target->windowHandle(), s_touchDevice);
- };
-
- // A cancelled tap-and-hold should cancel text selection, but currently doesn't
- cancelledTapAndHold(view.focusProxy(), elementCenter(view.page(), "text"));
- QEXPECT_FAIL("", "Incorrect Chromium selection behavior when cancelling tap-and-hold on text", Continue);
- QTRY_VERIFY_WITH_TIMEOUT(!view.hasSelection(), 100);
-
- // A cancelled tap-and-hold should cancel input field focusing and selection, but currently doesn't
- cancelledTapAndHold(view.focusProxy(), elementCenter(view.page(), "input"));
- QEXPECT_FAIL("", "Incorrect Chromium selection behavior when cancelling tap-and-hold on input field", Continue);
- QTRY_VERIFY_WITH_TIMEOUT(evaluateJavaScriptSync(view.page(), "document.activeElement.id").toString().isEmpty(), 100);
- QEXPECT_FAIL("", "Incorrect Chromium focus behavior when cancelling tap-and-hold on input field", Continue);
- QTRY_VERIFY_WITH_TIMEOUT(!view.hasSelection(), 100);
-
- // Only test the page context menu on Windows, as Linux doesn't handle context menus consistently
- // and other non-desktop platforms like Android may not even support context menus at all
-#if defined(Q_OS_WIN)
- // A cancelled tap-and-hold cancels the context menu
- QVERIFY(QApplication::activePopupWidget() == nullptr);
- cancelledTapAndHold(view.focusProxy(), elementCenter(view.page(), "notext"));
- QVERIFY(QApplication::activePopupWidget() == nullptr);
-#endif
-}
-
void tst_QWebEngineView::postData()
{
QMap<QString, QString> postData;
@@ -1710,12 +1736,12 @@ void tst_QWebEngineView::postData()
// examine request
QStringList request = lines[0].split(" ", Qt::SkipEmptyParts);
- bool requestOk = request.length() > 2
+ bool requestOk = request.size() > 2
&& request[2].toUpper().startsWith("HTTP/")
&& request[0].toUpper() == "POST"
&& request[1] == "/";
if (!requestOk) // POST and HTTP/... can be switched(?)
- requestOk = request.length() > 2
+ requestOk = request.size() > 2
&& request[0].toUpper().startsWith("HTTP/")
&& request[2].toUpper() == "POST"
&& request[1] == "/";
@@ -1723,16 +1749,16 @@ void tst_QWebEngineView::postData()
// examine headers
int line = 1;
bool headersOk = true;
- for (; headersOk && line < lines.length(); line++) {
+ for (; headersOk && line < lines.size(); line++) {
QStringList headerParts = lines[line].split(":");
- if (headerParts.length() < 2)
+ if (headerParts.size() < 2)
break;
QString headerKey = headerParts[0].trimmed().toLower();
QString headerValue = headerParts[1].trimmed().toLower();
if (headerKey == "host")
headersOk = headersOk && (headerValue == "127.0.0.1")
- && (headerParts.length() == 3)
+ && (headerParts.size() == 3)
&& (headerParts[2].trimmed()
== QString::number(server.serverPort()));
if (headerKey == "content-type")
@@ -1741,12 +1767,12 @@ void tst_QWebEngineView::postData()
// examine body
bool bodyOk = true;
- if (lines.length() == line+2) {
+ if (lines.size() == line+2) {
QStringList postedFields = lines[line+1].split("&");
QMap<QString, QString> postedData;
- for (int i = 0; bodyOk && i < postedFields.length(); i++) {
+ for (int i = 0; bodyOk && i < postedFields.size(); i++) {
QStringList postedField = postedFields[i].split("=");
- if (postedField.length() == 2)
+ if (postedField.size() == 2)
postedData[QUrl::fromPercentEncoding(postedField[0].toLocal8Bit())]
= QUrl::fromPercentEncoding(postedField[1].toLocal8Bit());
else
@@ -1819,11 +1845,10 @@ void tst_QWebEngineView::postData()
void tst_QWebEngineView::inputFieldOverridesShortcuts()
{
+ QWebEngineView view;
bool actionTriggered = false;
- QAction *action = new QAction;
+ QAction *action = new QAction(&view);
connect(action, &QAction::triggered, [&actionTriggered] () { actionTriggered = true; });
-
- QWebEngineView view;
view.addAction(action);
QSignalSpy loadFinishedSpy(&view, SIGNAL(loadFinished(bool)));
@@ -1848,7 +1873,7 @@ void tst_QWebEngineView::inputFieldOverridesShortcuts()
};
// The input form is not focused. The action is triggered on pressing Shift+Delete.
- action->setShortcut(Qt::SHIFT + Qt::Key_Delete);
+ action->setShortcut(Qt::SHIFT | Qt::Key_Delete);
QTest::keyClick(view.windowHandle(), Qt::Key_Delete, Qt::ShiftModifier);
QTRY_VERIFY(actionTriggered);
QCOMPARE(inputFieldValue(), QString("x"));
@@ -1884,7 +1909,7 @@ void tst_QWebEngineView::inputFieldOverridesShortcuts()
// A Ctrl-1 action is no default Qt key binding and should be triggerable.
evaluateJavaScriptSync(view.page(), "document.getElementById('input1').focus();");
QTRY_COMPARE(evaluateJavaScriptSync(view.page(), "document.activeElement.id").toString(), QStringLiteral("input1"));
- action->setShortcut(Qt::CTRL + Qt::Key_1);
+ action->setShortcut(Qt::CTRL | Qt::Key_1);
QTest::keyClick(view.windowHandle(), Qt::Key_1, Qt::ControlModifier);
QTRY_VERIFY(actionTriggered);
QCOMPARE(inputFieldValue(), QString("yxx"));
@@ -1941,20 +1966,11 @@ public:
inputMethodPrivate->testContext = 0;
}
- virtual void showInputPanel()
- {
- m_visible = true;
- }
- virtual void hideInputPanel()
- {
- m_visible = false;
- }
- virtual bool isInputPanelVisible() const
- {
- return m_visible;
- }
+ void showInputPanel() override { m_visible = true; }
+ void hideInputPanel() override { m_visible = false; }
+ bool isInputPanelVisible() const override { return m_visible; }
- virtual void update(Qt::InputMethodQueries queries)
+ void update(Qt::InputMethodQueries queries) override
{
if (!qApp->focusObject())
return;
@@ -2050,13 +2066,14 @@ void tst_QWebEngineView::inputContextQueryInput()
view.setHtml("<html><body>"
" <input type='text' id='input1' value='' size='50'/>"
"</body></html>");
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
- QCOMPARE(testContext.infos.count(), 0);
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QCOMPARE(testContext.infos.size(), 0);
// Set focus on an input field.
QPoint textInputCenter = elementCenter(view.page(), "input1");
QTest::mouseClick(view.focusProxy(), Qt::LeftButton, {}, textInputCenter);
- QTRY_COMPARE(testContext.infos.count(), 2);
+ QTRY_COMPARE(testContext.infos.size(), 2);
QCOMPARE(evaluateJavaScriptSync(view.page(), "document.activeElement.id").toString(), QStringLiteral("input1"));
foreach (const InputMethodInfo &info, testContext.infos) {
QCOMPARE(info.cursorPosition, 0);
@@ -2068,7 +2085,7 @@ void tst_QWebEngineView::inputContextQueryInput()
// Change content of an input field from JavaScript.
evaluateJavaScriptSync(view.page(), "document.getElementById('input1').value='QtWebEngine';");
- QTRY_COMPARE(testContext.infos.count(), 1);
+ QTRY_COMPARE(testContext.infos.size(), 1);
QCOMPARE(testContext.infos[0].cursorPosition, 11);
QCOMPARE(testContext.infos[0].anchorPosition, 11);
QCOMPARE(testContext.infos[0].surroundingText, QStringLiteral("QtWebEngine"));
@@ -2077,7 +2094,7 @@ void tst_QWebEngineView::inputContextQueryInput()
// Change content of an input field by key press.
QTest::keyClick(view.focusProxy(), Qt::Key_Exclam);
- QTRY_COMPARE(testContext.infos.count(), 1);
+ QTRY_COMPARE(testContext.infos.size(), 1);
QCOMPARE(testContext.infos[0].cursorPosition, 12);
QCOMPARE(testContext.infos[0].anchorPosition, 12);
QCOMPARE(testContext.infos[0].surroundingText, QStringLiteral("QtWebEngine!"));
@@ -2086,7 +2103,7 @@ void tst_QWebEngineView::inputContextQueryInput()
// Change cursor position.
QTest::keyClick(view.focusProxy(), Qt::Key_Left);
- QTRY_COMPARE(testContext.infos.count(), 1);
+ QTRY_COMPARE(testContext.infos.size(), 1);
QCOMPARE(testContext.infos[0].cursorPosition, 11);
QCOMPARE(testContext.infos[0].anchorPosition, 11);
QCOMPARE(testContext.infos[0].surroundingText, QStringLiteral("QtWebEngine!"));
@@ -2101,8 +2118,8 @@ void tst_QWebEngineView::inputContextQueryInput()
QInputMethodEvent event("", attributes);
QApplication::sendEvent(view.focusProxy(), &event);
}
- QTRY_COMPARE(testContext.infos.count(), 2);
- QTRY_COMPARE(selectionChangedSpy.count(), 1);
+ QTRY_COMPARE(testContext.infos.size(), 2);
+ QTRY_COMPARE(selectionChangedSpy.size(), 1);
// As a first step, Chromium moves the cursor to the start of the selection.
// We don't filter this in QtWebEngine because we don't know yet if this is part of a selection.
@@ -2127,8 +2144,8 @@ void tst_QWebEngineView::inputContextQueryInput()
QInputMethodEvent event("", attributes);
QApplication::sendEvent(view.focusProxy(), &event);
}
- QTRY_COMPARE(testContext.infos.count(), 1);
- QTRY_COMPARE(selectionChangedSpy.count(), 1);
+ QTRY_COMPARE(testContext.infos.size(), 1);
+ QTRY_COMPARE(selectionChangedSpy.size(), 1);
QCOMPARE(testContext.infos[0].cursorPosition, 0);
QCOMPARE(testContext.infos[0].anchorPosition, 0);
QCOMPARE(testContext.infos[0].surroundingText, QStringLiteral("QtWebEngine!"));
@@ -2142,9 +2159,9 @@ void tst_QWebEngineView::inputContextQueryInput()
QInputMethodEvent event("123", attributes);
QApplication::sendEvent(view.focusProxy(), &event);
}
- QTRY_COMPARE(testContext.infos.count(), 1);
- QCOMPARE(testContext.infos[0].cursorPosition, 3);
- QCOMPARE(testContext.infos[0].anchorPosition, 3);
+ QTRY_COMPARE(testContext.infos.size(), 1);
+ QCOMPARE(testContext.infos[0].cursorPosition, 0);
+ QCOMPARE(testContext.infos[0].anchorPosition, 0);
QCOMPARE(testContext.infos[0].surroundingText, QStringLiteral("QtWebEngine!"));
QCOMPARE(testContext.infos[0].selectedText, QStringLiteral(""));
QCOMPARE(evaluateJavaScriptSync(view.page(), "document.getElementById('input1').value").toString(), QStringLiteral("123QtWebEngine!"));
@@ -2156,7 +2173,7 @@ void tst_QWebEngineView::inputContextQueryInput()
QInputMethodEvent event("", attributes);
QApplication::sendEvent(view.focusProxy(), &event);
}
- QTRY_COMPARE(testContext.infos.count(), 2);
+ QTRY_COMPARE(testContext.infos.size(), 2);
foreach (const InputMethodInfo &info, testContext.infos) {
QCOMPARE(info.cursorPosition, 0);
QCOMPARE(info.anchorPosition, 0);
@@ -2173,7 +2190,7 @@ void tst_QWebEngineView::inputContextQueryInput()
event.setCommitString(QStringLiteral("123"), 0, 0);
QApplication::sendEvent(view.focusProxy(), &event);
}
- QTRY_COMPARE(testContext.infos.count(), 1);
+ QTRY_COMPARE(testContext.infos.size(), 1);
QCOMPARE(testContext.infos[0].cursorPosition, 3);
QCOMPARE(testContext.infos[0].anchorPosition, 3);
QCOMPARE(testContext.infos[0].surroundingText, QStringLiteral("123QtWebEngine!"));
@@ -2183,7 +2200,7 @@ void tst_QWebEngineView::inputContextQueryInput()
// Focus out.
QTest::keyPress(view.focusProxy(), Qt::Key_Tab);
- QTRY_COMPARE(testContext.infos.count(), 1);
+ QTRY_COMPARE(testContext.infos.size(), 1);
QTRY_COMPARE(evaluateJavaScriptSync(view.page(), "document.activeElement.id").toString(), QStringLiteral(""));
testContext.infos.clear();
}
@@ -2202,6 +2219,7 @@ void tst_QWebEngineView::inputMethods()
" <input type='text' id='input1' style='font-family: serif' value='' maxlength='20' size='50'/>"
"</body></html>");
QTRY_COMPARE(loadFinishedSpy.size(), 1);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QPoint textInputCenter = elementCenter(view.page(), "input1");
QTest::mouseClick(view.focusProxy(), Qt::LeftButton, {}, textInputCenter);
@@ -2226,7 +2244,7 @@ void tst_QWebEngineView::inputMethods()
QInputMethodEvent eventText(text, inputAttributes);
QApplication::sendEvent(view.focusProxy(), &eventText);
QTRY_COMPARE(evaluateJavaScriptSync(view.page(), "document.getElementById('input1').value").toString(), text);
- QCOMPARE(selectionChangedSpy.count(), 0);
+ QCOMPARE(selectionChangedSpy.size(), 0);
}
{
@@ -2235,7 +2253,7 @@ void tst_QWebEngineView::inputMethods()
eventText.setCommitString(text, 0, 0);
QApplication::sendEvent(view.focusProxy(), &eventText);
QTRY_COMPARE(evaluateJavaScriptSync(view.page(), "document.getElementById('input1').value").toString(), text);
- QCOMPARE(selectionChangedSpy.count(), 0);
+ QCOMPARE(selectionChangedSpy.size(), 0);
}
// ImMaximumTextLength
@@ -2299,6 +2317,7 @@ void tst_QWebEngineView::textSelectionInInputField()
" <input type='text' id='input1' value='QtWebEngine' size='50'/>"
"</body></html>");
QVERIFY(loadFinishedSpy.wait());
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
// Tests for Selection when the Editor is NOT in Composition mode
@@ -2310,24 +2329,24 @@ void tst_QWebEngineView::textSelectionInInputField()
QTRY_COMPARE(view.focusProxy()->inputMethodQuery(Qt::ImCursorPosition).toInt(), 11);
QTRY_COMPARE(view.focusProxy()->inputMethodQuery(Qt::ImAnchorPosition).toInt(), 11);
// There was no selection to be changed by the click
- QCOMPARE(selectionChangedSpy.count(), 0);
+ QCOMPARE(selectionChangedSpy.size(), 0);
QList<QInputMethodEvent::Attribute> attributes;
QInputMethodEvent event(QString(), attributes);
event.setCommitString("XXX", 0, 0);
QApplication::sendEvent(view.focusProxy(), &event);
QTRY_COMPARE(view.focusProxy()->inputMethodQuery(Qt::ImSurroundingText).toString(), QString("QtWebEngineXXX"));
- QCOMPARE(selectionChangedSpy.count(), 0);
+ QCOMPARE(selectionChangedSpy.size(), 0);
event.setCommitString(QString(), -2, 2); // Erase two characters.
QApplication::sendEvent(view.focusProxy(), &event);
QTRY_COMPARE(view.focusProxy()->inputMethodQuery(Qt::ImSurroundingText).toString(), QString("QtWebEngineX"));
- QCOMPARE(selectionChangedSpy.count(), 0);
+ QCOMPARE(selectionChangedSpy.size(), 0);
event.setCommitString(QString(), -1, 1); // Erase one character.
QApplication::sendEvent(view.focusProxy(), &event);
QTRY_COMPARE(view.focusProxy()->inputMethodQuery(Qt::ImSurroundingText).toString(), QString("QtWebEngine"));
- QCOMPARE(selectionChangedSpy.count(), 0);
+ QCOMPARE(selectionChangedSpy.size(), 0);
// Move to the start of the line
QTest::keyClick(view.focusProxy(), Qt::Key_Home);
@@ -2339,7 +2358,7 @@ void tst_QWebEngineView::textSelectionInInputField()
// Select to the end of the line
QTest::keyClick(view.focusProxy(), Qt::Key_End, Qt::ShiftModifier);
QVERIFY(selectionChangedSpy.wait());
- QCOMPARE(selectionChangedSpy.count(), 1);
+ QCOMPARE(selectionChangedSpy.size(), 1);
QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImAnchorPosition).toInt(), 2);
QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImCursorPosition).toInt(), 11);
@@ -2349,7 +2368,7 @@ void tst_QWebEngineView::textSelectionInInputField()
// Deselect the selection (this moves the current cursor to the end of the text)
QTest::mouseClick(view.focusProxy(), Qt::LeftButton, {}, textInputCenter);
QVERIFY(selectionChangedSpy.wait());
- QCOMPARE(selectionChangedSpy.count(), 2);
+ QCOMPARE(selectionChangedSpy.size(), 2);
QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImAnchorPosition).toInt(), 11);
QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImCursorPosition).toInt(), 11);
@@ -2362,7 +2381,7 @@ void tst_QWebEngineView::textSelectionInInputField()
// Select to the start of the line
QTest::keyClick(view.focusProxy(), Qt::Key_Home, Qt::ShiftModifier);
QVERIFY(selectionChangedSpy.wait());
- QCOMPARE(selectionChangedSpy.count(), 3);
+ QCOMPARE(selectionChangedSpy.size(), 3);
QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImAnchorPosition).toInt(), 9);
QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImCursorPosition).toInt(), 0);
@@ -2372,6 +2391,7 @@ void tst_QWebEngineView::textSelectionInInputField()
void tst_QWebEngineView::textSelectionOutOfInputField()
{
QWebEngineView view;
+ view.settings()->setAttribute(QWebEngineSettings::FocusOnNavigationEnabled, true);
view.resize(640, 480);
view.show();
@@ -2381,35 +2401,33 @@ void tst_QWebEngineView::textSelectionOutOfInputField()
" This is a text"
"</body></html>");
QVERIFY(loadFinishedSpy.wait());
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
- QCOMPARE(selectionChangedSpy.count(), 0);
+ QCOMPARE(selectionChangedSpy.size(), 0);
QVERIFY(!view.hasSelection());
QVERIFY(view.page()->selectedText().isEmpty());
// Simple click should not update text selection, however it updates selection bounds in Chromium
QTest::mouseClick(view.focusProxy(), Qt::LeftButton, {}, view.geometry().center());
- QCOMPARE(selectionChangedSpy.count(), 0);
+ QCOMPARE(selectionChangedSpy.size(), 0);
QVERIFY(!view.hasSelection());
QVERIFY(view.page()->selectedText().isEmpty());
// Select text by ctrl+a
QTest::keyClick(view.windowHandle(), Qt::Key_A, Qt::ControlModifier);
- QVERIFY(selectionChangedSpy.wait());
- QCOMPARE(selectionChangedSpy.count(), 1);
+ QTRY_COMPARE(selectionChangedSpy.size(), 1);
QVERIFY(view.hasSelection());
QCOMPARE(view.page()->selectedText(), QString("This is a text"));
// Deselect text by mouse click
QTest::mouseClick(view.focusProxy(), Qt::LeftButton, {}, view.geometry().center());
- QVERIFY(selectionChangedSpy.wait());
- QCOMPARE(selectionChangedSpy.count(), 2);
+ QTRY_COMPARE(selectionChangedSpy.size(), 2);
QVERIFY(!view.hasSelection());
QVERIFY(view.page()->selectedText().isEmpty());
// Select text by ctrl+a
QTest::keyClick(view.windowHandle(), Qt::Key_A, Qt::ControlModifier);
- QVERIFY(selectionChangedSpy.wait());
- QCOMPARE(selectionChangedSpy.count(), 3);
+ QTRY_COMPARE(selectionChangedSpy.size(), 3);
QVERIFY(view.hasSelection());
QCOMPARE(view.page()->selectedText(), QString("This is a text"));
@@ -2417,8 +2435,7 @@ void tst_QWebEngineView::textSelectionOutOfInputField()
view.hide();
view.page()->setLifecycleState(QWebEnginePage::LifecycleState::Discarded);
view.show();
- QVERIFY(loadFinishedSpy.wait());
- QCOMPARE(selectionChangedSpy.count(), 4);
+ QTRY_COMPARE(selectionChangedSpy.size(), 4);
QVERIFY(!view.hasSelection());
QVERIFY(view.page()->selectedText().isEmpty());
@@ -2429,8 +2446,9 @@ void tst_QWebEngineView::textSelectionOutOfInputField()
" <input type='text' id='input1' value='QtWebEngine' size='50'/>"
"</body></html>");
QVERIFY(loadFinishedSpy.wait());
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
- QCOMPARE(selectionChangedSpy.count(), 0);
+ QCOMPARE(selectionChangedSpy.size(), 0);
QVERIFY(!view.hasSelection());
QVERIFY(view.page()->selectedText().isEmpty());
@@ -2440,31 +2458,27 @@ void tst_QWebEngineView::textSelectionOutOfInputField()
// Select the whole page by ctrl+a
QTest::keyClick(view.windowHandle(), Qt::Key_A, Qt::ControlModifier);
- QVERIFY(selectionChangedSpy.wait());
- QCOMPARE(selectionChangedSpy.count(), 1);
+ QTRY_COMPARE(selectionChangedSpy.size(), 1);
QVERIFY(view.hasSelection());
QVERIFY(view.page()->selectedText().startsWith(QString("This is a text")));
// Remove selection by clicking into an input field
QPoint textInputCenter = elementCenter(view.page(), "input1");
QTest::mouseClick(view.focusProxy(), Qt::LeftButton, {}, textInputCenter);
- QVERIFY(selectionChangedSpy.wait());
+ QTRY_COMPARE(selectionChangedSpy.size(), 2);
QCOMPARE(evaluateJavaScriptSync(view.page(), "document.activeElement.id").toString(), QStringLiteral("input1"));
- QCOMPARE(selectionChangedSpy.count(), 2);
QVERIFY(!view.hasSelection());
QVERIFY(view.page()->selectedText().isEmpty());
// Select the content of the input field by ctrl+a
QTest::keyClick(view.windowHandle(), Qt::Key_A, Qt::ControlModifier);
- QVERIFY(selectionChangedSpy.wait());
- QCOMPARE(selectionChangedSpy.count(), 3);
+ QTRY_COMPARE(selectionChangedSpy.size(), 3);
QVERIFY(view.hasSelection());
QCOMPARE(view.page()->selectedText(), QString("QtWebEngine"));
// Deselect input field's text by mouse click
QTest::mouseClick(view.focusProxy(), Qt::LeftButton, {}, view.geometry().center());
- QVERIFY(selectionChangedSpy.wait());
- QCOMPARE(selectionChangedSpy.count(), 4);
+ QTRY_COMPARE(selectionChangedSpy.size(), 4);
QVERIFY(!view.hasSelection());
QVERIFY(view.page()->selectedText().isEmpty());
}
@@ -2508,9 +2522,10 @@ void tst_QWebEngineView::emptyInputMethodEvent()
" <input type='text' id='input1' value='QtWebEngine'/>"
"</body></html>");
QVERIFY(loadFinishedSpy.wait());
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
evaluateJavaScriptSync(view.page(), "var inputEle = document.getElementById('input1'); inputEle.focus(); inputEle.select();");
- QTRY_COMPARE(selectionChangedSpy.count(), 1);
+ QTRY_COMPARE(selectionChangedSpy.size(), 1);
// 1. Empty input method event does not clear text
QInputMethodEvent emptyEvent;
@@ -2556,9 +2571,10 @@ void tst_QWebEngineView::imeComposition()
" <input type='text' id='input1' value='QtWebEngine inputMethod'/>"
"</body></html>");
QVERIFY(loadFinishedSpy.wait());
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
evaluateJavaScriptSync(view.page(), "var inputEle = document.getElementById('input1'); inputEle.focus(); inputEle.select();");
- QTRY_COMPARE(selectionChangedSpy.count(), 1);
+ QTRY_COMPARE(selectionChangedSpy.size(), 1);
// Clear the selection, also cancel the ongoing composition if there is one.
{
@@ -2568,7 +2584,7 @@ void tst_QWebEngineView::imeComposition()
QInputMethodEvent event("", attributes);
QApplication::sendEvent(view.focusProxy(), &event);
selectionChangedSpy.wait();
- QCOMPARE(selectionChangedSpy.count(), 2);
+ QCOMPARE(selectionChangedSpy.size(), 2);
}
QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImSurroundingText).toString(), QString("QtWebEngine inputMethod"));
QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImAnchorPosition).toInt(), 0);
@@ -2589,7 +2605,7 @@ void tst_QWebEngineView::imeComposition()
QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImCursorPosition).toInt(), 0);
QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImAnchorPosition).toInt(), 0);
QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImCurrentSelection).toString(), QString(""));
- QCOMPARE(selectionChangedSpy.count(), 0);
+ QCOMPARE(selectionChangedSpy.size(), 0);
// Send temporary text, which makes the editor has composition 'n'.
{
@@ -2601,7 +2617,7 @@ void tst_QWebEngineView::imeComposition()
QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImCursorPosition).toInt(), 0);
QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImAnchorPosition).toInt(), 0);
QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImCurrentSelection).toString(), QString(""));
- QCOMPARE(selectionChangedSpy.count(), 0);
+ QCOMPARE(selectionChangedSpy.size(), 0);
// Send commit text, which makes the editor conforms composition.
{
@@ -2614,7 +2630,7 @@ void tst_QWebEngineView::imeComposition()
QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImCursorPosition).toInt(), 1);
QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImAnchorPosition).toInt(), 1);
QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImCurrentSelection).toString(), QString(""));
- QCOMPARE(selectionChangedSpy.count(), 0);
+ QCOMPARE(selectionChangedSpy.size(), 0);
// 2. insert a character to the middle of the line.
@@ -2628,7 +2644,7 @@ void tst_QWebEngineView::imeComposition()
QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImCursorPosition).toInt(), 1);
QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImAnchorPosition).toInt(), 1);
QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImCurrentSelection).toString(), QString(""));
- QCOMPARE(selectionChangedSpy.count(), 0);
+ QCOMPARE(selectionChangedSpy.size(), 0);
// Send commit text, which makes the editor conforms composition.
{
@@ -2641,7 +2657,7 @@ void tst_QWebEngineView::imeComposition()
QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImCursorPosition).toInt(), 2);
QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImAnchorPosition).toInt(), 2);
QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImCurrentSelection).toString(), QString(""));
- QCOMPARE(selectionChangedSpy.count(), 0);
+ QCOMPARE(selectionChangedSpy.size(), 0);
// 3. Insert a character to the end of the line.
@@ -2659,7 +2675,7 @@ void tst_QWebEngineView::imeComposition()
QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImCursorPosition).toInt(), 25);
QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImAnchorPosition).toInt(), 25);
QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImCurrentSelection).toString(), QString(""));
- QCOMPARE(selectionChangedSpy.count(), 0);
+ QCOMPARE(selectionChangedSpy.size(), 0);
// Send commit text, which makes the editor conforms composition.
{
@@ -2672,7 +2688,7 @@ void tst_QWebEngineView::imeComposition()
QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImCursorPosition).toInt(), 26);
QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImAnchorPosition).toInt(), 26);
QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImCurrentSelection).toString(), QString(""));
- QCOMPARE(selectionChangedSpy.count(), 0);
+ QCOMPARE(selectionChangedSpy.size(), 0);
// 4. Replace the selection.
@@ -2682,7 +2698,7 @@ void tst_QWebEngineView::imeComposition()
QTest::keyClick(view.focusProxy(), Qt::Key_Left, Qt::ShiftModifier | Qt::AltModifier);
#endif
QVERIFY(selectionChangedSpy.wait());
- QCOMPARE(selectionChangedSpy.count(), 1);
+ QCOMPARE(selectionChangedSpy.size(), 1);
QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImSurroundingText).toString(), QString("oeQtWebEngine inputMethodt"));
QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImCursorPosition).toInt(), 14);
@@ -2696,7 +2712,7 @@ void tst_QWebEngineView::imeComposition()
QApplication::sendEvent(view.focusProxy(), &event);
// The new composition should clear the previous selection
QVERIFY(selectionChangedSpy.wait());
- QCOMPARE(selectionChangedSpy.count(), 2);
+ QCOMPARE(selectionChangedSpy.size(), 2);
}
QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImSurroundingText).toString(), QString("oeQtWebEngine "));
// The cursor should be positioned at the end of the composition text
@@ -2716,7 +2732,7 @@ void tst_QWebEngineView::imeComposition()
QTRY_COMPARE(view.focusProxy()->inputMethodQuery(Qt::ImCursorPosition).toInt(), 15);
QTRY_COMPARE(view.focusProxy()->inputMethodQuery(Qt::ImAnchorPosition).toInt(), 15);
QTRY_COMPARE(view.focusProxy()->inputMethodQuery(Qt::ImCurrentSelection).toString(), QString(""));
- QCOMPARE(selectionChangedSpy.count(), 2);
+ QCOMPARE(selectionChangedSpy.size(), 2);
selectionChangedSpy.clear();
@@ -2741,8 +2757,8 @@ void tst_QWebEngineView::imeComposition()
QApplication::sendEvent(view.focusProxy(), &event);
}
QTRY_COMPARE(view.focusProxy()->inputMethodQuery(Qt::ImSurroundingText).toString(), QString(""));
- QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImCursorPosition).toInt(), 11);
- QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImAnchorPosition).toInt(), 11);
+ QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImCursorPosition).toInt(), 0);
+ QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImAnchorPosition).toInt(), 0);
QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImCurrentSelection).toString(), QString(""));
QCOMPARE(evaluateJavaScriptSync(view.page(), "document.getElementById('input1').value").toString(), QString("QtWebEngine"));
@@ -2758,7 +2774,7 @@ void tst_QWebEngineView::imeComposition()
QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImAnchorPosition).toInt(), 11);
QCOMPARE(view.focusProxy()->inputMethodQuery(Qt::ImCurrentSelection).toString(), QString(""));
QCOMPARE(evaluateJavaScriptSync(view.page(), "document.getElementById('input1').value").toString(), QString("QtWebEngine"));
- QCOMPARE(selectionChangedSpy.count(), 0);
+ QCOMPARE(selectionChangedSpy.size(), 0);
}
void tst_QWebEngineView::newlineInTextarea()
@@ -2773,6 +2789,7 @@ void tst_QWebEngineView::newlineInTextarea()
" <textarea rows='5' cols='1' id='input1'></textarea>"
"</body></html>");
QVERIFY(loadFinishedSpy.wait());
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
evaluateJavaScriptSync(view.page(), "var inputEle = document.getElementById('input1'); inputEle.focus(); inputEle.select();");
QTRY_VERIFY(evaluateJavaScriptSync(view.page(), "document.getElementById('input1').value").toString().isEmpty());
@@ -2897,6 +2914,7 @@ void tst_QWebEngineView::imeJSInputEvents()
" <pre id='log'></pre>"
"</body></html>");
QVERIFY(loadFinishedSpy.wait());
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
evaluateJavaScriptSync(view.page(), "document.getElementById('input').focus()");
QTRY_COMPARE(evaluateJavaScriptSync(view.page(), "document.activeElement.id").toString(), QStringLiteral("input"));
@@ -2911,7 +2929,7 @@ void tst_QWebEngineView::imeJSInputEvents()
}
// Simply committing text should not trigger any JS composition event.
- QTRY_COMPARE(logLines().count(), 3);
+ QTRY_COMPARE(logLines().size(), 3);
QCOMPARE(logLines()[0], QStringLiteral("[object InputEvent] beforeinput commit"));
QCOMPARE(logLines()[1], QStringLiteral("[object TextEvent] textInput commit"));
QCOMPARE(logLines()[2], QStringLiteral("[object InputEvent] input commit"));
@@ -2927,7 +2945,7 @@ void tst_QWebEngineView::imeJSInputEvents()
qApp->processEvents();
}
- QTRY_COMPARE(logLines().count(), 4);
+ QTRY_COMPARE(logLines().size(), 4);
QCOMPARE(logLines()[0], QStringLiteral("[object CompositionEvent] compositionstart "));
QCOMPARE(logLines()[1], QStringLiteral("[object InputEvent] beforeinput preedit"));
QCOMPARE(logLines()[2], QStringLiteral("[object CompositionEvent] compositionupdate preedit"));
@@ -2941,7 +2959,7 @@ void tst_QWebEngineView::imeJSInputEvents()
qApp->processEvents();
}
- QTRY_COMPARE(logLines().count(), 9);
+ QTRY_COMPARE(logLines().size(), 9);
QCOMPARE(logLines()[4], QStringLiteral("[object InputEvent] beforeinput commit"));
QCOMPARE(logLines()[5], QStringLiteral("[object CompositionEvent] compositionupdate commit"));
QCOMPARE(logLines()[6], QStringLiteral("[object TextEvent] textInput commit"));
@@ -2959,7 +2977,7 @@ void tst_QWebEngineView::imeJSInputEvents()
qApp->processEvents();
}
- QTRY_COMPARE(logLines().count(), 4);
+ QTRY_COMPARE(logLines().size(), 4);
QCOMPARE(logLines()[0], QStringLiteral("[object CompositionEvent] compositionstart "));
QCOMPARE(logLines()[1], QStringLiteral("[object InputEvent] beforeinput preedit"));
QCOMPARE(logLines()[2], QStringLiteral("[object CompositionEvent] compositionupdate preedit"));
@@ -2972,7 +2990,7 @@ void tst_QWebEngineView::imeJSInputEvents()
qApp->processEvents();
}
- QTRY_COMPARE(logLines().count(), 9);
+ QTRY_COMPARE(logLines().size(), 9);
QCOMPARE(logLines()[4], QStringLiteral("[object InputEvent] beforeinput "));
QCOMPARE(logLines()[5], QStringLiteral("[object CompositionEvent] compositionupdate "));
QCOMPARE(logLines()[6], QStringLiteral("[object TextEvent] textInput "));
@@ -3019,6 +3037,7 @@ void tst_QWebEngineView::imeCompositionQueryEvent()
" <input type='text' id='input1' />"
"</body></html>");
QVERIFY(loadFinishedSpy.wait());
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
evaluateJavaScriptSync(view.page(), "document.getElementById('input1').focus()");
QTRY_COMPARE(evaluateJavaScriptSync(view.page(), "document.activeElement.id").toString(), QStringLiteral("input1"));
@@ -3038,6 +3057,7 @@ void tst_QWebEngineView::imeCompositionQueryEvent()
}
QInputMethodQueryEvent srrndTextQuery(Qt::ImSurroundingText);
+ QInputMethodQueryEvent absolutePosQuery(Qt::ImAbsolutePosition);
QInputMethodQueryEvent cursorPosQuery(Qt::ImCursorPosition);
QInputMethodQueryEvent anchorPosQuery(Qt::ImAnchorPosition);
@@ -3049,16 +3069,18 @@ void tst_QWebEngineView::imeCompositionQueryEvent()
qApp->processEvents();
}
QTRY_COMPARE(evaluateJavaScriptSync(view.page(), "document.getElementById('input1').value").toString(), QString("composition"));
- QTRY_COMPARE(view.focusProxy()->inputMethodQuery(Qt::ImCursorPosition).toInt(), 11);
+ QTRY_COMPARE(view.focusProxy()->inputMethodQuery(Qt::ImCursorPosition).toInt(), 0);
QApplication::sendEvent(input, &srrndTextQuery);
+ QApplication::sendEvent(input, &absolutePosQuery);
QApplication::sendEvent(input, &cursorPosQuery);
QApplication::sendEvent(input, &anchorPosQuery);
qApp->processEvents();
QTRY_COMPARE(srrndTextQuery.value(Qt::ImSurroundingText).toString(), QString(""));
- QTRY_COMPARE(cursorPosQuery.value(Qt::ImCursorPosition).toInt(), 11);
- QTRY_COMPARE(anchorPosQuery.value(Qt::ImAnchorPosition).toInt(), 11);
+ QTRY_COMPARE(absolutePosQuery.value(Qt::ImAbsolutePosition).toInt(), 0);
+ QTRY_COMPARE(cursorPosQuery.value(Qt::ImCursorPosition).toInt(), 0);
+ QTRY_COMPARE(anchorPosQuery.value(Qt::ImAnchorPosition).toInt(), 0);
// Send commit
{
@@ -3072,16 +3094,67 @@ void tst_QWebEngineView::imeCompositionQueryEvent()
QTRY_COMPARE(view.focusProxy()->inputMethodQuery(Qt::ImSurroundingText).toString(), QString("composition"));
QApplication::sendEvent(input, &srrndTextQuery);
+ QApplication::sendEvent(input, &absolutePosQuery);
QApplication::sendEvent(input, &cursorPosQuery);
QApplication::sendEvent(input, &anchorPosQuery);
qApp->processEvents();
QTRY_COMPARE(srrndTextQuery.value(Qt::ImSurroundingText).toString(), QString("composition"));
+ QTRY_COMPARE(absolutePosQuery.value(Qt::ImAbsolutePosition).toInt(), 11);
QTRY_COMPARE(cursorPosQuery.value(Qt::ImCursorPosition).toInt(), 11);
QTRY_COMPARE(anchorPosQuery.value(Qt::ImAnchorPosition).toInt(), 11);
+
+ // Test another composition to ensure that the cursor position is set correctly.
+ // In this case cursor will be at position 11 during input composition.
+ {
+ QList<QInputMethodEvent::Attribute> attributes;
+ QInputMethodEvent event("123", attributes);
+ QApplication::sendEvent(input, &event);
+ qApp->processEvents();
+ }
+ QTRY_COMPARE(evaluateJavaScriptSync(view.page(), "document.getElementById('input1').value")
+ .toString(),
+ QString("composition123"));
+ QTRY_COMPARE(view.focusProxy()->inputMethodQuery(Qt::ImCursorPosition).toInt(), 11);
+
+ QApplication::sendEvent(input, &srrndTextQuery);
+ QApplication::sendEvent(input, &absolutePosQuery);
+ QApplication::sendEvent(input, &cursorPosQuery);
+ QApplication::sendEvent(input, &anchorPosQuery);
+ qApp->processEvents();
+
+ QTRY_COMPARE(srrndTextQuery.value(Qt::ImSurroundingText).toString(), QString("composition"));
+ QTRY_COMPARE(absolutePosQuery.value(Qt::ImAbsolutePosition).toInt(), 11);
+ QTRY_COMPARE(cursorPosQuery.value(Qt::ImCursorPosition).toInt(), 11);
+ QTRY_COMPARE(anchorPosQuery.value(Qt::ImAnchorPosition).toInt(), 11);
+
+ // Send commit
+ {
+ QList<QInputMethodEvent::Attribute> attributes;
+ QInputMethodEvent event("", attributes);
+ event.setCommitString("123");
+ QApplication::sendEvent(input, &event);
+ qApp->processEvents();
+ }
+
+ QTRY_COMPARE(evaluateJavaScriptSync(view.page(), "document.getElementById('input1').value")
+ .toString(),
+ QString("composition123"));
+ QTRY_COMPARE(view.focusProxy()->inputMethodQuery(Qt::ImCursorPosition).toInt(), 14);
+
+ QApplication::sendEvent(input, &srrndTextQuery);
+ QApplication::sendEvent(input, &absolutePosQuery);
+ QApplication::sendEvent(input, &cursorPosQuery);
+ QApplication::sendEvent(input, &anchorPosQuery);
+ qApp->processEvents();
+
+ QTRY_COMPARE(srrndTextQuery.value(Qt::ImSurroundingText).toString(), QString("composition123"));
+ QTRY_COMPARE(absolutePosQuery.value(Qt::ImAbsolutePosition).toInt(), 14);
+ QTRY_COMPARE(cursorPosQuery.value(Qt::ImCursorPosition).toInt(), 14);
+ QTRY_COMPARE(anchorPosQuery.value(Qt::ImAnchorPosition).toInt(), 14);
}
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void tst_QWebEngineView::globalMouseSelection()
{
if (!QApplication::clipboard()->supportsSelection()) {
@@ -3103,20 +3176,20 @@ void tst_QWebEngineView::globalMouseSelection()
// Select text via JavaScript
evaluateJavaScriptSync(view.page(), "var inputEle = document.getElementById('input1'); inputEle.focus(); inputEle.select();");
- QTRY_COMPARE(selectionChangedSpy.count(), 1);
+ QTRY_COMPARE(selectionChangedSpy.size(), 1);
QVERIFY(QApplication::clipboard()->text(QClipboard::Selection).isEmpty());
// Deselect the selection (this moves the current cursor to the end of the text)
QPoint textInputCenter = elementCenter(view.page(), "input1");
QTest::mouseClick(view.focusProxy(), Qt::LeftButton, {}, textInputCenter);
QVERIFY(selectionChangedSpy.wait());
- QCOMPARE(selectionChangedSpy.count(), 2);
+ QCOMPARE(selectionChangedSpy.size(), 2);
QVERIFY(QApplication::clipboard()->text(QClipboard::Selection).isEmpty());
// Select to the start of the line
QTest::keyClick(view.focusProxy(), Qt::Key_Home, Qt::ShiftModifier);
QVERIFY(selectionChangedSpy.wait());
- QCOMPARE(selectionChangedSpy.count(), 3);
+ QCOMPARE(selectionChangedSpy.size(), 3);
QCOMPARE(QApplication::clipboard()->text(QClipboard::Selection), QStringLiteral("QtWebEngine"));
}
#endif
@@ -3142,7 +3215,7 @@ void tst_QWebEngineView::noContextMenu()
QTest::mouseMove(wrapper.windowHandle(), QPoint(10,10));
QTest::mouseClick(wrapper.windowHandle(), Qt::RightButton);
- QTRY_COMPARE(wrapper.findChildren<QMenu *>().count(), 1);
+ QTRY_COMPARE(wrapper.findChildren<QMenu *>().size(), 1);
QVERIFY(view.findChildren<QMenu *>().isEmpty());
}
@@ -3182,7 +3255,7 @@ void tst_QWebEngineView::contextMenu()
view.load(QUrl("about:blank"));
view.resize(640, 480);
view.show();
- QTRY_COMPARE(loadSpy.count(), 1);
+ QTRY_COMPARE(loadSpy.size(), 1);
QVERIFY(view.findChildren<QMenu *>().isEmpty());
QTest::mouseMove(view.windowHandle(), QPoint(10,10));
@@ -3190,9 +3263,9 @@ void tst_QWebEngineView::contextMenu()
// verify for zero children will always succeed, so should be tested with at least minor timeout
if (childrenCount <= 0) {
- QVERIFY(!QTest::qWaitFor([&view] () { return view.findChildren<QMenu *>().count() > 0; }, 500));
+ QVERIFY(!QTest::qWaitFor([&view] () { return view.findChildren<QMenu *>().size() > 0; }, 500));
} else {
- QTRY_COMPARE(view.findChildren<QMenu *>().count(), childrenCount);
+ QTRY_COMPARE(view.findChildren<QMenu *>().size(), childrenCount);
if (isCustomMenu) {
QCOMPARE(view.findChildren<QMenu *>().first(), customMenu);
}
@@ -3258,51 +3331,59 @@ void tst_QWebEngineView::webUIURLs_data()
QTest::addColumn<bool>("supported");
QTest::newRow("about") << QUrl("chrome://about") << false;
QTest::newRow("accessibility") << QUrl("chrome://accessibility") << true;
- QTest::newRow("appcache-internals") << QUrl("chrome://appcache-internals") << true;
+ QTest::newRow("app-service-internals") << QUrl("chrome://app-service-internals") << false;
+ QTest::newRow("app-settings") << QUrl("chrome://app-settings") << false;
QTest::newRow("apps") << QUrl("chrome://apps") << false;
+ QTest::newRow("attribution-internals") << QUrl("chrome://attribution-internals") << true;
+ QTest::newRow("autofill-internals") << QUrl("chrome://autofill-internals") << false;
QTest::newRow("blob-internals") << QUrl("chrome://blob-internals") << true;
QTest::newRow("bluetooth-internals") << QUrl("chrome://bluetooth-internals") << false;
QTest::newRow("bookmarks") << QUrl("chrome://bookmarks") << false;
- QTest::newRow("cache") << QUrl("chrome://cache") << false;
- QTest::newRow("chrome") << QUrl("chrome://chrome") << false;
QTest::newRow("chrome-urls") << QUrl("chrome://chrome-urls") << false;
QTest::newRow("components") << QUrl("chrome://components") << false;
+ QTest::newRow("connectors-internals") << QUrl("chrome://connectors-internals") << false;
QTest::newRow("crashes") << QUrl("chrome://crashes") << false;
QTest::newRow("credits") << QUrl("chrome://credits") << false;
- QTest::newRow("device-log") << QUrl("chrome://device-log") << false;
- QTest::newRow("devices") << QUrl("chrome://devices") << false;
+ QTest::newRow("device-log") << QUrl("chrome://device-log") << true;
QTest::newRow("dino") << QUrl("chrome://dino") << false; // It works but this is an error page
- QTest::newRow("dns") << QUrl("chrome://dns") << false;
+ QTest::newRow("discards") << QUrl("chrome://discards") << false;
+ QTest::newRow("download-internals") << QUrl("chrome://download-internals") << false;
QTest::newRow("downloads") << QUrl("chrome://downloads") << false;
QTest::newRow("extensions") << QUrl("chrome://extensions") << false;
+ QTest::newRow("extensions-internals") << QUrl("chrome://extensions-internals") << false;
QTest::newRow("flags") << QUrl("chrome://flags") << false;
- QTest::newRow("flash") << QUrl("chrome://flash") << false;
QTest::newRow("gcm-internals") << QUrl("chrome://gcm-internals") << false;
QTest::newRow("gpu") << QUrl("chrome://gpu") << true;
QTest::newRow("help") << QUrl("chrome://help") << false;
QTest::newRow("histograms") << QUrl("chrome://histograms") << true;
+ QTest::newRow("history") << QUrl("chrome://history") << false;
+ QTest::newRow("history-clusters-internals") << QUrl("chrome://history-clusters-internals") << false;
QTest::newRow("indexeddb-internals") << QUrl("chrome://indexeddb-internals") << true;
QTest::newRow("inspect") << QUrl("chrome://inspect") << false;
+ QTest::newRow("interstitials") << QUrl("chrome://interstitials") << false;
QTest::newRow("invalidations") << QUrl("chrome://invalidations") << false;
QTest::newRow("linux-proxy-config") << QUrl("chrome://linux-proxy-config") << false;
QTest::newRow("local-state") << QUrl("chrome://local-state") << false;
+ QTest::newRow("management") << QUrl("chrome://management") << false;
+ QTest::newRow("media-engagement") << QUrl("chrome://media-engagement") << false;
QTest::newRow("media-internals") << QUrl("chrome://media-internals") << true;
+ QTest::newRow("nacl") << QUrl("chrome://nacl") << false;
QTest::newRow("net-export") << QUrl("chrome://net-export") << false;
- QTest::newRow("net-internals") << QUrl("chrome://net-internals") << false;
+ QTest::newRow("net-internals") << QUrl("chrome://net-internals") << true;
QTest::newRow("network-error") << QUrl("chrome://network-error") << false;
QTest::newRow("network-errors") << QUrl("chrome://network-errors") << true;
- QTest::newRow("newtab") << QUrl("chrome://newtab") << false;
QTest::newRow("ntp-tiles-internals") << QUrl("chrome://ntp-tiles-internals") << false;
QTest::newRow("omnibox") << QUrl("chrome://omnibox") << false;
+ QTest::newRow("optimization-guide-internals") << QUrl("chrome://optimization-guide-internals") << false;
QTest::newRow("password-manager-internals") << QUrl("chrome://password-manager-internals") << false;
QTest::newRow("policy") << QUrl("chrome://policy") << false;
QTest::newRow("predictors") << QUrl("chrome://predictors") << false;
+ QTest::newRow("prefs-internals") << QUrl("chrome://prefs-internals") << false;
QTest::newRow("print") << QUrl("chrome://print") << false;
QTest::newRow("process-internals") << QUrl("chrome://process-internals") << true;
- QTest::newRow("profiler") << QUrl("chrome://profiler") << false;
QTest::newRow("quota-internals") << QUrl("chrome://quota-internals") << true;
QTest::newRow("safe-browsing") << QUrl("chrome://safe-browsing") << false;
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_LINUX) || defined(Q_OS_WIN)
QTest::newRow("sandbox") << QUrl("chrome://sandbox") << true;
#else
QTest::newRow("sandbox") << QUrl("chrome://sandbox") << false;
@@ -3311,19 +3392,23 @@ void tst_QWebEngineView::webUIURLs_data()
QTest::newRow("settings") << QUrl("chrome://settings") << false;
QTest::newRow("signin-internals") << QUrl("chrome://signin-internals") << false;
QTest::newRow("site-engagement") << QUrl("chrome://site-engagement") << false;
- QTest::newRow("suggestions") << QUrl("chrome://suggestions") << false;
- QTest::newRow("supervised-user-internals") << QUrl("chrome://supervised-user-internals") << false;
QTest::newRow("sync-internals") << QUrl("chrome://sync-internals") << false;
QTest::newRow("system") << QUrl("chrome://system") << false;
QTest::newRow("terms") << QUrl("chrome://terms") << false;
- QTest::newRow("thumbnails") << QUrl("chrome://thumbnails") << false;
- QTest::newRow("tracing") << QUrl("chrome://tracing") << false;
+ QTest::newRow("tracing") << QUrl("chrome://tracing") << true;
QTest::newRow("translate-internals") << QUrl("chrome://translate-internals") << false;
+ QTest::newRow("ukm") << QUrl("chrome://ukm") << true;
QTest::newRow("usb-internals") << QUrl("chrome://usb-internals") << false;
- QTest::newRow("user-actions") << QUrl("chrome://user-actions") << false;
+ QTest::newRow("user-actions") << QUrl("chrome://user-actions") << true;
QTest::newRow("version") << QUrl("chrome://version") << false;
+ QTest::newRow("web-app-internals") << QUrl("chrome://web-app-internals") << false;
+#if QT_CONFIG(webengine_webrtc)
QTest::newRow("webrtc-internals") << QUrl("chrome://webrtc-internals") << true;
- QTest::newRow("webrtc-logs") << QUrl("chrome://webrtc-logs") << false;
+#if QT_CONFIG(webengine_extensions)
+ QTest::newRow("webrtc-logs") << QUrl("chrome://webrtc-logs") << true;
+#endif // QT_CONFIG(webengine_extensions)
+#endif // QT_CONFIG(webengine_webrtc)
+ QTest::newRow("whats-new") << QUrl("chrome://whats-new") << false;
}
void tst_QWebEngineView::webUIURLs()
@@ -3335,7 +3420,7 @@ void tst_QWebEngineView::webUIURLs()
view.settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, false);
QSignalSpy loadFinishedSpy(&view, SIGNAL(loadFinished(bool)));
view.load(url);
- QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.count(), 1, 30000);
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size(), 1, 90000);
QCOMPARE(loadFinishedSpy.takeFirst().at(0).toBool(), supported);
}
@@ -3344,7 +3429,7 @@ void tst_QWebEngineView::visibilityState()
QWebEngineView view;
QSignalSpy spy(&view, &QWebEngineView::loadFinished);
view.load(QStringLiteral("about:blank"));
- QVERIFY(spy.count() || spy.wait());
+ QVERIFY(spy.size() || spy.wait());
QVERIFY(spy.takeFirst().takeFirst().toBool());
QCOMPARE(evaluateJavaScriptSync(view.page(), "document.visibilityState").toString(), QStringLiteral("hidden"));
view.show();
@@ -3359,7 +3444,7 @@ void tst_QWebEngineView::visibilityState2()
view.show();
view.load(QStringLiteral("about:blank"));
view.hide();
- QVERIFY(spy.count() || spy.wait());
+ QVERIFY(spy.size() || spy.wait());
QVERIFY(spy.takeFirst().takeFirst().toBool());
QCOMPARE(evaluateJavaScriptSync(view.page(), "document.visibilityState").toString(), QStringLiteral("hidden"));
}
@@ -3372,8 +3457,8 @@ void tst_QWebEngineView::visibilityState3()
QSignalSpy spy2(&page2, &QWebEnginePage::loadFinished);
page1.load(QStringLiteral("about:blank"));
page2.load(QStringLiteral("about:blank"));
- QVERIFY(spy1.count() || spy1.wait());
- QVERIFY(spy2.count() || spy2.wait());
+ QVERIFY(spy1.size() || spy1.wait());
+ QVERIFY(spy2.size() || spy2.wait());
QWebEngineView view;
view.setPage(&page1);
view.show();
@@ -3437,7 +3522,27 @@ void tst_QWebEngineView::deletePage()
QVERIFY(view.page());
QSignalSpy spy(view.page(), &QWebEnginePage::loadFinished);
view.page()->load(QStringLiteral("about:blank"));
- QTRY_VERIFY(spy.count());
+ QTRY_VERIFY(spy.size());
+}
+
+void tst_QWebEngineView::autoDeleteOnExternalPageDelete()
+{
+ QPointer<QWebEngineView> view = new QWebEngineView;
+ QPointer<QWebEnginePage> page = new QWebEnginePage;
+ auto sg = qScopeGuard([&] () { delete view; delete page; });
+
+ QSignalSpy spy(page, &QWebEnginePage::loadFinished);
+ view->setPage(page);
+ view->show();
+ view->resize(320, 240);
+ page->load(QUrl("about:blank"));
+ QTRY_VERIFY(spy.size());
+ QVERIFY(page->parent() != view);
+
+ auto sc = QObject::connect(page, &QWebEnginePage::destroyed, view, &QWebEngineView::deleteLater);
+ QTimer::singleShot(0, page, &QObject::deleteLater);
+ QTRY_VERIFY(!page);
+ QTRY_VERIFY(!view);
}
class TestView : public QWebEngineView {
@@ -3464,7 +3569,7 @@ void tst_QWebEngineView::closeOpenerTab()
testView->settings()->setAttribute(QWebEngineSettings::JavascriptCanOpenWindows, true);
QSignalSpy loadFinishedSpy(testView, SIGNAL(loadFinished(bool)));
testView->setUrl(QStringLiteral("about:blank"));
- QTRY_VERIFY(loadFinishedSpy.count());
+ QTRY_VERIFY(loadFinishedSpy.size());
testView->page()->runJavaScript(QStringLiteral("window.open('about:blank','_blank')"));
QTRY_COMPARE(testView->createdWindows.size(), 1);
auto *newView = testView->createdWindows.at(0);
@@ -3483,9 +3588,13 @@ void tst_QWebEngineView::switchPage()
QWebEnginePage page2(&profile);
QSignalSpy loadFinishedSpy1(&page1, SIGNAL(loadFinished(bool)));
QSignalSpy loadFinishedSpy2(&page2, SIGNAL(loadFinished(bool)));
+ // TODO fixme: page without the view has no real widget behind, so
+ // reading graphical content will fail, add view for now.
+ QWebEngineView webView1(&page1, nullptr);
+ QWebEngineView webView2(&page2, nullptr);
page1.setHtml("<html><body bgcolor=\"#000000\"></body></html>");
page2.setHtml("<html><body bgcolor=\"#ffffff\"></body></html>");
- QTRY_VERIFY(loadFinishedSpy1.count() && loadFinishedSpy2.count());
+ QTRY_VERIFY(loadFinishedSpy1.size() && loadFinishedSpy2.size());
QWebEngineView webView;
webView.resize(300,300);
webView.show();
@@ -3526,7 +3635,7 @@ void tst_QWebEngineView::setViewDeletesImplicitPage()
QWebEngineView view;
QPointer<QWebEnginePage> implicitPage = view.page();
QWebEnginePage explicitPage;
- explicitPage.setView(&view);
+ view.setPage(&explicitPage);
QCOMPARE(view.page(), &explicitPage);
QVERIFY(!implicitPage); // should be deleted
}
@@ -3547,8 +3656,8 @@ void tst_QWebEngineView::setViewPreservesExplicitPage()
QWebEngineView view;
QPointer<QWebEnginePage> explicitPage1 = new QWebEnginePage(&view);
QPointer<QWebEnginePage> explicitPage2 = new QWebEnginePage(&view);
- explicitPage1->setView(&view);
- explicitPage2->setView(&view);
+ view.setPage(explicitPage1.data());
+ view.setPage(explicitPage2.data());
QCOMPARE(view.page(), explicitPage2.data());
QVERIFY(explicitPage1); // should not be deleted
}
@@ -3556,17 +3665,342 @@ void tst_QWebEngineView::setViewPreservesExplicitPage()
void tst_QWebEngineView::closeDiscardsPage()
{
QWebEngineProfile profile;
- QWebEnginePage page(&profile);
- QWebEngineView view;
- view.setPage(&page);
+ QWebEngineView view(&profile, nullptr);
view.resize(300, 300);
view.show();
QVERIFY(QTest::qWaitForWindowExposed(&view));
- QCOMPARE(page.isVisible(), true);
- QCOMPARE(page.lifecycleState(), QWebEnginePage::LifecycleState::Active);
+ QCOMPARE(view.page()->isVisible(), true);
+ QCOMPARE(view.page()->lifecycleState(), QWebEnginePage::LifecycleState::Active);
view.close();
- QCOMPARE(page.isVisible(), false);
- QCOMPARE(page.lifecycleState(), QWebEnginePage::LifecycleState::Discarded);
+ QCOMPARE(view.page()->isVisible(), false);
+ QCOMPARE(view.page()->lifecycleState(), QWebEnginePage::LifecycleState::Discarded);
+}
+
+
+void tst_QWebEngineView::loadAfterRendererCrashed()
+{
+ QWebEngineView view;
+ view.resize(640, 480);
+ view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
+
+ bool terminated = false;
+ connect(view.page(), &QWebEnginePage::renderProcessTerminated, [&] () { terminated = true; });
+ view.load(QUrl("chrome://crash"));
+ QTRY_VERIFY_WITH_TIMEOUT(terminated, 30000);
+
+ QSignalSpy loadSpy(&view, &QWebEngineView::loadFinished);
+ view.load(QUrl("qrc:///resources/dummy.html"));
+ QTRY_COMPARE(loadSpy.size(), 1);
+ QVERIFY(loadSpy.first().first().toBool());
+}
+
+void tst_QWebEngineView::inspectElement()
+{
+ QWebEngineView view;
+ view.resize(640, 480);
+ view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
+
+ auto page = view.page();
+ // shouldn't do anything until page is set
+ page->triggerAction(QWebEnginePage::InspectElement);
+ QTest::qWait(100);
+
+ QSignalSpy spy(&view, &QWebEngineView::loadFinished);
+ view.load(QUrl("data:text/plain,foobarbaz"));
+ QTRY_COMPARE_WITH_TIMEOUT(spy.size(), 1, 12000);
+
+ // shouldn't do anything since inspector is not attached
+ page->triggerAction(QWebEnginePage::InspectElement);
+ QTest::qWait(100);
+
+ QWebEngineView inspectorView;
+ inspectorView.resize(640, 480);
+ inspectorView.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&inspectorView));
+ inspectorView.page()->setInspectedPage(page);
+
+ page->triggerAction(QWebEnginePage::InspectElement);
+ // TODO verify somehow
+ QTest::qWait(100);
+}
+
+void tst_QWebEngineView::navigateOnDrop_data()
+{
+ QTest::addColumn<QUrl>("url");
+ QTest::addColumn<bool>("navigateOnDrop");
+ QTest::newRow("file") << QUrl::fromLocalFile(QDir(QT_TESTCASE_SOURCEDIR).absoluteFilePath("resources/dummy.html")) << true;
+ QTest::newRow("qrc") << QUrl("qrc:///resources/dummy.html") << true;
+ QTest::newRow("file_no_navigate") << QUrl::fromLocalFile(QDir(QT_TESTCASE_SOURCEDIR).absoluteFilePath("resources/dummy.html")) << false;
+ QTest::newRow("qrc_no_navigate") << QUrl("qrc:///resources/dummy.html") << false;
+}
+
+void tst_QWebEngineView::navigateOnDrop()
+{
+ QFETCH(QUrl, url);
+ QFETCH(bool, navigateOnDrop);
+ struct WebEngineView : QWebEngineView {
+ QWebEngineView* createWindow(QWebEnginePage::WebWindowType /* type */) override { return this; }
+ } view;
+ view.page()->settings()->setAttribute(QWebEngineSettings::NavigateOnDropEnabled, navigateOnDrop);
+ view.resize(640, 480);
+ view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
+
+ QSignalSpy loadSpy(&view, &QWebEngineView::loadFinished);
+ QMimeData mimeData;
+ mimeData.setUrls({ url });
+
+ auto sendEvents = [&] () {
+ QDragEnterEvent dee(view.rect().center(), Qt::CopyAction, &mimeData, Qt::LeftButton, Qt::NoModifier);
+ QApplication::sendEvent(&view, &dee);
+ QDropEvent de(view.rect().center(), Qt::CopyAction, &mimeData, Qt::LeftButton, Qt::NoModifier);
+ QApplication::sendEvent(&view, &de);
+ };
+
+ sendEvents();
+ if (navigateOnDrop) {
+ QTRY_COMPARE(loadSpy.size(), 1);
+ QVERIFY(loadSpy.last().first().toBool());
+ QCOMPARE(view.url(), url);
+ } else {
+ QTest::qWait(500);
+ QCOMPARE(loadSpy.size(), 0);
+ QVERIFY(view.url() != url);
+ }
+
+ // Check dynamically changing the setting
+ loadSpy.clear();
+ view.page()->settings()->setAttribute(QWebEngineSettings::NavigateOnDropEnabled, !navigateOnDrop);
+ view.setUrl(QUrl("about:blank"));
+ QTRY_COMPARE(loadSpy.size(), 1);
+
+ sendEvents();
+ if (!navigateOnDrop) {
+ QTRY_COMPARE(loadSpy.size(), 2);
+ QVERIFY(loadSpy.last().first().toBool());
+ QCOMPARE(view.url(), url);
+ } else {
+ QTest::qWait(500);
+ QCOMPARE(loadSpy.size(), 1);
+ QVERIFY(view.url() != url);
+ }
+}
+
+void tst_QWebEngineView::emptyUriListOnDrop()
+{
+ QWebEngineView view;
+ view.resize(640, 480);
+ view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
+
+ QMimeData mimeData;
+ mimeData.setUrls({}); // creates an empty uri-list MIME type entry
+ QVERIFY(mimeData.hasUrls());
+
+ QDragEnterEvent dee(view.rect().center(), Qt::CopyAction, &mimeData, Qt::LeftButton,
+ Qt::NoModifier);
+ QApplication::sendEvent(&view, &dee);
+ QDropEvent de(view.rect().center(), Qt::CopyAction, &mimeData, Qt::LeftButton, Qt::NoModifier);
+ QApplication::sendEvent(&view, &de);
+
+ QSignalSpy loadSpy(&view, &QWebEngineView::loadFinished);
+ view.setUrl(QUrl("about:blank"));
+ QTRY_COMPARE(loadSpy.size(), 1);
+}
+
+void tst_QWebEngineView::datalist()
+{
+ QString html("<html><body>"
+ "<input id='browserInput' list='browserDatalist'>"
+ "<datalist id='browserDatalist'>"
+ " <option value='Internet Explorer'>"
+ " <option value='Firefox'>"
+ " <option value='Chrome'>"
+ " <option value='Opera'>"
+ " <option value='Safari'>"
+ "</datalist>"
+ "</body></html>");
+
+ QWebEngineView view;
+ view.resize(200, 400);
+ view.show();
+
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
+
+ QSignalSpy loadSpy(&view, &QWebEngineView::loadFinished);
+ view.setHtml(html);
+ QTRY_COMPARE(loadSpy.size(), 1);
+
+ QString listValuesJS("(function() {"
+ " var browserDatalist = document.getElementById('browserDatalist');"
+ " var options = browserDatalist.options;"
+ " var result = [];"
+ " for (let i = 0; i < options.length; ++i) {"
+ " result.push(options[i].value);"
+ " }"
+ " return result;"
+ "})();");
+ QStringList values = evaluateJavaScriptSync(view.page(), listValuesJS).toStringList();
+ QCOMPARE(values, QStringList({ "Internet Explorer", "Firefox", "Chrome", "Opera", "Safari" }));
+ QCOMPARE(evaluateJavaScriptSync(view.page(), "document.getElementById('browserInput').value;")
+ .toString(),
+ QStringLiteral(""));
+
+ auto listView = [&view]() -> QListView * {
+ if (QApplication::topLevelWidgets().size() == 1) {
+ // No popup case.
+ return nullptr;
+ }
+
+ QWidget *autofillPopupWidget = nullptr;
+ for (QWidget *w : QApplication::topLevelWidgets()) {
+ if (w != &view) {
+ autofillPopupWidget = w;
+ break;
+ }
+ }
+
+ if (!autofillPopupWidget)
+ return nullptr;
+
+ for (QObject *o : autofillPopupWidget->children()) {
+ if (QListView *listView = qobject_cast<QListView *>(o))
+ return listView;
+ }
+
+ return nullptr;
+ };
+
+ // Make sure there is no open popup yet.
+ QVERIFY(!listView());
+ // Click in the input field.
+ QPoint browserInputCenter = elementCenter(view.page(), "browserInput");
+ QTest::mouseClick(view.focusProxy(), Qt::LeftButton, {}, browserInputCenter);
+ // Wait for the popup.
+ QTRY_VERIFY(listView());
+
+ // No suggestion is selected.
+ QCOMPARE(listView()->currentIndex(), QModelIndex());
+ QCOMPARE(listView()->model()->rowCount(), 5);
+
+ // Accepting suggestion does nothing.
+ QTest::keyClick(view.windowHandle(), Qt::Key_Enter);
+ QVERIFY(listView());
+ QCOMPARE(listView()->currentIndex(), QModelIndex());
+
+ // Escape should close popup.
+ QTest::keyClick(view.windowHandle(), Qt::Key_Escape);
+ QTRY_VERIFY(!listView());
+
+ // Key Down should open the popup and select the first suggestion.
+ QTest::keyClick(view.windowHandle(), Qt::Key_Down);
+ QTRY_VERIFY(listView());
+ QCOMPARE(listView()->currentIndex().row(), 0);
+
+ // Test keyboard navigation in list.
+ QTest::keyClick(view.windowHandle(), Qt::Key_Up);
+ QCOMPARE(listView()->currentIndex().row(), 4);
+ QTest::keyClick(view.windowHandle(), Qt::Key_Up);
+ QCOMPARE(listView()->currentIndex().row(), 3);
+ QTest::keyClick(view.windowHandle(), Qt::Key_PageDown);
+ QCOMPARE(listView()->currentIndex().row(), 4);
+ QTest::keyClick(view.windowHandle(), Qt::Key_PageUp);
+ QCOMPARE(listView()->currentIndex().row(), 0);
+ QTest::keyClick(view.windowHandle(), Qt::Key_Down);
+ QCOMPARE(listView()->currentIndex().row(), 1);
+ QTest::keyClick(view.windowHandle(), Qt::Key_Down);
+ QCOMPARE(listView()->currentIndex().row(), 2);
+
+ // Test accepting suggestion.
+ QCOMPARE(static_cast<QStringListModel *>(listView()->model())
+ ->data(listView()->currentIndex())
+ .toString(),
+ QStringLiteral("Chrome"));
+ QTest::keyClick(view.windowHandle(), Qt::Key_Enter);
+ QTRY_COMPARE(
+ evaluateJavaScriptSync(view.page(), "document.getElementById('browserInput').value")
+ .toString(),
+ QStringLiteral("Chrome"));
+ // Accept closes popup.
+ QTRY_VERIFY(!listView());
+
+ // Clear input field, should not trigger popup.
+ evaluateJavaScriptSync(view.page(), "document.getElementById('browserInput').value = ''");
+ QVERIFY(!listView());
+
+ // Filter suggestions.
+ QTest::keyClick(view.windowHandle(), Qt::Key_F);
+ QTRY_VERIFY(listView());
+ QCOMPARE(listView()->model()->rowCount(), 2);
+ QCOMPARE(listView()->currentIndex(), QModelIndex());
+ QCOMPARE(static_cast<QStringListModel *>(listView()->model())
+ ->data(listView()->model()->index(0, 0))
+ .toString(),
+ QStringLiteral("Firefox"));
+ QCOMPARE(static_cast<QStringListModel *>(listView()->model())
+ ->data(listView()->model()->index(1, 0))
+ .toString(),
+ QStringLiteral("Safari"));
+ QTest::keyClick(view.windowHandle(), Qt::Key_I);
+ QTRY_COMPARE(listView()->model()->rowCount(), 1);
+ QCOMPARE(listView()->currentIndex(), QModelIndex());
+ QCOMPARE(static_cast<QStringListModel *>(listView()->model())
+ ->data(listView()->model()->index(0, 0))
+ .toString(),
+ QStringLiteral("Firefox"));
+ QTest::keyClick(view.windowHandle(), Qt::Key_L);
+ // Mismatch should close popup.
+ QTRY_VERIFY(!listView());
+ QTRY_COMPARE(
+ evaluateJavaScriptSync(view.page(), "document.getElementById('browserInput').value")
+ .toString(),
+ QStringLiteral("fil"));
+}
+
+class ConsolePage : public QWebEnginePage
+{
+ Q_OBJECT
+public:
+ ConsolePage(QObject *parent = nullptr) : QWebEnginePage(parent) { }
+ void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString &message,
+ int lineNumber, const QString &sourceID) override
+ {
+ Q_UNUSED(level)
+ Q_UNUSED(lineNumber)
+ Q_UNUSED(sourceID)
+ if (message.contains("TEST_KEY:Shift"))
+ emit done();
+ }
+signals:
+ void done();
+};
+
+//qtbug_113704
+void tst_QWebEngineView::longKeyEventText()
+{
+ const QString html(QStringLiteral("<html><body><p>TEST</p>"
+ "<script>"
+ "document.addEventListener('keydown', (event)=> {"
+ "console.log('TEST_KEY:' + event.key);"
+ "});"
+ "</script>"
+ "</body></html>"));
+
+ QWebEngineView view;
+ ConsolePage page;
+ view.setPage(&page);
+ QSignalSpy loadFinishedSpy(view.page(), &QWebEnginePage::loadFinished);
+ view.resize(200, 400);
+ view.show();
+ view.setHtml(html);
+ QTRY_VERIFY(loadFinishedSpy.size());
+ QSignalSpy consoleMessageSpy(&page, &ConsolePage::done);
+ Qt::Key key(Qt::Key_Shift);
+ QKeyEvent event(QKeyEvent::KeyPress, key, Qt::NoModifier, QKeySequence(key).toString());
+ QApplication::sendEvent(view.focusProxy(), &event);
+ QTRY_VERIFY(consoleMessageSpy.size());
}
QTEST_MAIN(tst_QWebEngineView)
diff --git a/tests/auto/widgets/qwebengineview/tst_qwebengineview.qrc b/tests/auto/widgets/qwebengineview/tst_qwebengineview.qrc
deleted file mode 100644
index a09be0399..000000000
--- a/tests/auto/widgets/qwebengineview/tst_qwebengineview.qrc
+++ /dev/null
@@ -1,10 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>resources/index.html</file>
- <file>resources/frame_a.html</file>
- <file>resources/input_types.html</file>
- <file>resources/scrolltest_page.html</file>
- <file>resources/keyboardEvents.html</file>
- <file>resources/image2.png</file>
- </qresource>
-</RCC>
diff --git a/tests/auto/widgets/schemes/CMakeLists.txt b/tests/auto/widgets/schemes/CMakeLists.txt
new file mode 100644
index 000000000..5299b3148
--- /dev/null
+++ b/tests/auto/widgets/schemes/CMakeLists.txt
@@ -0,0 +1,13 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+include(../../util/util.cmake)
+
+qt_internal_add_test(tst_schemes
+ SOURCES
+ tst_schemes.cpp
+ LIBRARIES
+ Qt::WebEngineWidgets
+ Test::Util
+)
+
diff --git a/tests/auto/widgets/schemes/schemes.pro b/tests/auto/widgets/schemes/schemes.pro
deleted file mode 100644
index e56bbe8f7..000000000
--- a/tests/auto/widgets/schemes/schemes.pro
+++ /dev/null
@@ -1,3 +0,0 @@
-include(../tests.pri)
-exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc
-QT *= core-private gui-private
diff --git a/tests/auto/widgets/schemes/tst_schemes.cpp b/tests/auto/widgets/schemes/tst_schemes.cpp
index a4a0e34ff..188c112e4 100644
--- a/tests/auto/widgets/schemes/tst_schemes.cpp
+++ b/tests/auto/widgets/schemes/tst_schemes.cpp
@@ -1,47 +1,50 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include <QtTest/QtTest>
-#include <qwebengineview.h>
#include <qwebenginepage.h>
#include <qwebengineprofile.h>
#include <qwebenginesettings.h>
+#include <qwebengineurlrequestjob.h>
+#include <qwebengineurlscheme.h>
+#include <qwebengineurlschemehandler.h>
+#include <qwebengineview.h>
+#include <widgetutil.h>
class tst_Schemes : public QObject
{
Q_OBJECT
private Q_SLOTS:
+ void initTestCase();
void unknownUrlSchemePolicy_data();
void unknownUrlSchemePolicy();
+ void customSchemeFragmentNavigation_data();
+ void customSchemeFragmentNavigation();
};
+void tst_Schemes::initTestCase()
+{
+ QWebEngineUrlScheme pathScheme("path");
+ pathScheme.setSyntax(QWebEngineUrlScheme::Syntax::Path);
+ QWebEngineUrlScheme::registerScheme(pathScheme);
+
+ QWebEngineUrlScheme hostScheme("host");
+ hostScheme.setSyntax(QWebEngineUrlScheme::Syntax::Host);
+ QWebEngineUrlScheme::registerScheme(hostScheme);
+
+ QWebEngineUrlScheme hostAndPortScheme("hostandport");
+ hostAndPortScheme.setSyntax(QWebEngineUrlScheme::Syntax::HostAndPort);
+ hostAndPortScheme.setDefaultPort(3000);
+ QWebEngineUrlScheme::registerScheme(hostAndPortScheme);
+
+ QWebEngineUrlScheme hostPortUserInfoScheme("hostportuserinfo");
+ hostPortUserInfoScheme.setSyntax(QWebEngineUrlScheme::Syntax::HostPortAndUserInformation);
+ hostPortUserInfoScheme.setDefaultPort(3000);
+ QWebEngineUrlScheme::registerScheme(hostPortUserInfoScheme);
+}
+
class AcceptNavigationRequestHandler : public QWebEnginePage
{
public:
@@ -118,5 +121,161 @@ void tst_Schemes::unknownUrlSchemePolicy()
QCOMPARE(page.acceptNavigationRequestCalls, shouldAccept ? 1 : 0);
}
+class CustomScheme : public QWebEngineUrlSchemeHandler
+{
+public:
+ CustomScheme(const QString &linkUrl) : m_linkUrl(linkUrl) { }
+
+ void requestStarted(QWebEngineUrlRequestJob *requestJob) override
+ {
+ QString html = QString("<html><body>"
+ "<p style='height: 2000px;'>"
+ "<a href='%1' id='link'>Click link</a>"
+ "</p><p id='anchor'>Anchor</p>"
+ "</body></html>")
+ .arg(m_linkUrl);
+ QBuffer *buffer = new QBuffer(requestJob);
+ buffer->setData(html.toUtf8());
+ requestJob->reply("text/html", buffer);
+ }
+
+ QString m_linkUrl;
+};
+
+void tst_Schemes::customSchemeFragmentNavigation_data()
+{
+ QTest::addColumn<QUrl>("baseUrl");
+ QTest::addColumn<QString>("linkUrl");
+ QTest::addColumn<QUrl>("expectedUrl");
+
+ // Path syntax
+ // - Preserves each part of the URL after navigation
+ QTest::newRow("Path syntax, path only, relative url")
+ << QUrl("path://path") << "#anchor" << QUrl("path://path#anchor");
+ QTest::newRow("Path syntax, path only, absolute url")
+ << QUrl("path://path") << "path://path#anchor" << QUrl("path://path#anchor");
+ QTest::newRow("Path syntax, host/path, relative url")
+ << QUrl("path://host/path") << "#anchor" << QUrl("path://host/path#anchor");
+ QTest::newRow("Path syntax, host/path, absolute url")
+ << QUrl("path://host/path") << "path://host/path#anchor"
+ << QUrl("path://host/path#anchor");
+ QTest::newRow("Path syntax, host:port, relative url")
+ << QUrl("path://host:3000") << "#anchor" << QUrl("path://host:3000#anchor");
+ QTest::newRow("Path syntax, host:port, absolute url")
+ << QUrl("path://host:3000") << "path://host:3000#anchor"
+ << QUrl("path://host:3000#anchor");
+ QTest::newRow("Path syntax, userinfo@host:port, relative url")
+ << QUrl("path://user:password@host:3000") << "#anchor"
+ << QUrl("path://user:password@host:3000#anchor");
+ QTest::newRow("Path syntax, userinfo@host:port, absolute url")
+ << QUrl("path://user:password@host:3000") << "path://user:password@host:3000#anchor"
+ << QUrl("path://user:password@host:3000#anchor");
+
+ // Host syntax
+ // - We lose the port and the user info from the authority after navigation
+ QTest::newRow("Host syntax, host only, relative url")
+ << QUrl("host://host") << "#anchor" << QUrl("host://host/#anchor");
+ QTest::newRow("Host syntax, host only, absolute url")
+ << QUrl("host://host") << "host://host#anchor" << QUrl("host://host/#anchor");
+ QTest::newRow("Host syntax, host/path, relative url")
+ << QUrl("host://host/path") << "#anchor" << QUrl("host://host/path#anchor");
+ QTest::newRow("Host syntax, host/path, absolute url")
+ << QUrl("host://host/path") << "host://host/path#anchor"
+ << QUrl("host://host/path#anchor");
+ QTest::newRow("Host syntax, host:port, relative url")
+ << QUrl("host://host:3000") << "#anchor" << QUrl("host://host/#anchor");
+ QTest::newRow("Host syntax, host:port, absolute url")
+ << QUrl("host://host:3000") << "host://host:3000#anchor" << QUrl("host://host/#anchor");
+ QTest::newRow("Host syntax, userinfo@host:port, relative url")
+ << QUrl("host://user:password@host:3000") << "#anchor" << QUrl("host://host/#anchor");
+ QTest::newRow("Host syntax, userinfo@host:port, absolute url")
+ << QUrl("host://user:password@host:3000") << "host://user:password@host:3000#anchor"
+ << QUrl("host://host/#anchor");
+
+ // HostAndPort syntax
+ // - We lose the port and the user info from the authority after navigation
+ QTest::newRow("HostAndPort syntax, host only, relative url")
+ << QUrl("hostandport://host") << "#anchor" << QUrl("hostandport://host/#anchor");
+ QTest::newRow("HostAndPort syntax, host only, absolute url")
+ << QUrl("hostandport://host") << "hostandport://host#anchor"
+ << QUrl("hostandport://host/#anchor");
+ QTest::newRow("HostAndPort syntax, host/path, relative url")
+ << QUrl("hostandport://host/path") << "#anchor"
+ << QUrl("hostandport://host/path#anchor");
+ QTest::newRow("HostAndPort syntax, host/path, absolute url")
+ << QUrl("hostandport://host/path") << "hostandport://host/path#anchor"
+ << QUrl("hostandport://host/path#anchor");
+ QTest::newRow("HostAndPort syntax, host:port, relative url")
+ << QUrl("hostandport://host:3000") << "#anchor" << QUrl("hostandport://host/#anchor");
+ QTest::newRow("HostAndPort syntax, host:port, absolute url")
+ << QUrl("hostandport://host:3000") << "hostandport://host:3000#anchor"
+ << QUrl("hostandport://host/#anchor");
+ QTest::newRow("HostAndPort syntax, userinfo@host:port, relative url")
+ << QUrl("hostandport://user:password@host:3000") << "#anchor"
+ << QUrl("hostandport://host/#anchor");
+ QTest::newRow("HostAndPort syntax, userinfo@host:port, absolute url")
+ << QUrl("hostandport://user:password@host:3000")
+ << "hostandport://user:password@host:3000#anchor" << QUrl("hostandport://host/#anchor");
+
+ // HostPortAndUserInformation syntax
+ // - We lose the port and it preserves the user info in the authority after navigation
+ QTest::newRow("HostPortAndUserInformation syntax, host only, relative url")
+ << QUrl("hostportuserinfo://host") << "#anchor"
+ << QUrl("hostportuserinfo://host/#anchor");
+ QTest::newRow("HostPortAndUserInformation syntax, host only, absolute url")
+ << QUrl("hostportuserinfo://host") << "hostportuserinfo://host#anchor"
+ << QUrl("hostportuserinfo://host/#anchor");
+ QTest::newRow("HostPortAndUserInformation syntax, host/path, relative url")
+ << QUrl("hostportuserinfo://host/path") << "#anchor"
+ << QUrl("hostportuserinfo://host/path#anchor");
+ QTest::newRow("HostPortAndUserInformation syntax, host/path, absolute url")
+ << QUrl("hostportuserinfo://host/path") << "hostportuserinfo://host/path#anchor"
+ << QUrl("hostportuserinfo://host/path#anchor");
+ QTest::newRow("HostPortAndUserInformation syntax, host:port, relative url")
+ << QUrl("hostportuserinfo://host:3000") << "#anchor"
+ << QUrl("hostportuserinfo://host/#anchor");
+ QTest::newRow("HostPortAndUserInformation syntax, host:port, absolute url")
+ << QUrl("hostportuserinfo://host:3000") << "hostportuserinfo://host:3000#anchor"
+ << QUrl("hostportuserinfo://host/#anchor");
+ QTest::newRow("HostPortAndUserInformation syntax, userinfo@host:port, relative url")
+ << QUrl("hostportuserinfo://user:password@host:3000") << "#anchor"
+ << QUrl("hostportuserinfo://user:password@host/#anchor");
+ QTest::newRow("HostPortAndUserInformation syntax, userinfo@host:port, absolute url")
+ << QUrl("hostportuserinfo://user:password@host:3000")
+ << "hostportuserinfo://user:password@host:3000#anchor"
+ << QUrl("hostportuserinfo://user:password@host/#anchor");
+}
+
+void tst_Schemes::customSchemeFragmentNavigation()
+{
+ QFETCH(QUrl, baseUrl);
+ QFETCH(QUrl, expectedUrl);
+ QFETCH(QString, linkUrl);
+
+ QWebEngineProfile profile;
+ QWebEnginePage page(&profile);
+ QWebEngineView view;
+ view.setPage(&page);
+ view.resize(800, 600);
+ view.show();
+ QSignalSpy loadFinishedSpy(&page, SIGNAL(loadFinished(bool)));
+ QSignalSpy urlChangedSpy(&page, SIGNAL(urlChanged(QUrl)));
+
+ CustomScheme *schemeHandler = new CustomScheme(linkUrl);
+ page.profile()->installUrlSchemeHandler(baseUrl.scheme().toUtf8(), schemeHandler);
+
+ view.load(baseUrl);
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
+ QTRY_VERIFY(evaluateJavaScriptSync(view.page(), "window.scrollY").toInt() == 0);
+
+ QTest::mouseClick(view.focusProxy(), Qt::LeftButton, {}, elementCenter(&page, "link"));
+ QVERIFY(urlChangedSpy.wait());
+ QCOMPARE(page.url(), expectedUrl);
+ QTRY_VERIFY(evaluateJavaScriptSync(view.page(), "window.scrollY").toInt() > 0);
+
+ // Same document navigation doesn't emit loadFinished
+ QTRY_COMPARE(loadFinishedSpy.size(), 1);
+}
+
QTEST_MAIN(tst_Schemes)
#include "tst_schemes.moc"
diff --git a/tests/auto/widgets/shutdown/CMakeLists.txt b/tests/auto/widgets/shutdown/CMakeLists.txt
new file mode 100644
index 000000000..e2ce9eeb9
--- /dev/null
+++ b/tests/auto/widgets/shutdown/CMakeLists.txt
@@ -0,0 +1,9 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_test(tst_shutdown
+ SOURCES
+ tst_shutdown.cpp
+ LIBRARIES
+ Qt::WebEngineWidgets
+)
diff --git a/tests/auto/widgets/shutdown/shutdown.pro b/tests/auto/widgets/shutdown/shutdown.pro
deleted file mode 100644
index e99c7f493..000000000
--- a/tests/auto/widgets/shutdown/shutdown.pro
+++ /dev/null
@@ -1 +0,0 @@
-include(../tests.pri)
diff --git a/tests/auto/widgets/shutdown/tst_shutdown.cpp b/tests/auto/widgets/shutdown/tst_shutdown.cpp
index 5c1e426d2..c2b31bb80 100644
--- a/tests/auto/widgets/shutdown/tst_shutdown.cpp
+++ b/tests/auto/widgets/shutdown/tst_shutdown.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include <QtTest/QtTest>
diff --git a/tests/auto/widgets/spellchecking/CMakeLists.txt b/tests/auto/widgets/spellchecking/CMakeLists.txt
new file mode 100644
index 000000000..d0c7656c1
--- /dev/null
+++ b/tests/auto/widgets/spellchecking/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+include(../../util/util.cmake)
+include(../../../../src/core/api/Qt6WebEngineCoreMacros.cmake)
+
+qt_internal_add_test(tst_spellchecking
+ SOURCES
+ tst_spellchecking.cpp
+ LIBRARIES
+ Qt::WebEngineWidgets
+ Test::Util
+)
+
+qt_internal_add_resource(tst_spellchecking "tst_spellchecking"
+ PREFIX
+ "/"
+ FILES
+ "resources/index.html"
+)
+
+file(GLOB_RECURSE dicts
+ ABSOLUTE ${CMAKE_CURRENT_LIST_DIR}/dict
+ *.dic
+)
+
+foreach(dictFile ${dicts})
+ qt_add_webengine_dictionary(
+ TARGET tst_spellchecking
+ SOURCE "${dictFile}"
+ OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ )
+endforeach()
diff --git a/tests/auto/widgets/spellchecking/spellchecking.pro b/tests/auto/widgets/spellchecking/spellchecking.pro
deleted file mode 100644
index a36c82e20..000000000
--- a/tests/auto/widgets/spellchecking/spellchecking.pro
+++ /dev/null
@@ -1,24 +0,0 @@
-include(../tests.pri)
-
-DISTFILES += \
- dict/en-US.dic \
- dict/en-US.aff \
- dict/de-DE.dic \
- dict/de-DE.aff \
-
-qtPrepareTool(CONVERT_TOOL, qwebengine_convert_dict)
-
-debug_and_release {
- CONFIG(debug, debug|release): DICTIONARIES_DIR = debug/qtwebengine_dictionaries
- else: DICTIONARIES_DIR = release/qtwebengine_dictionaries
-} else {
- DICTIONARIES_DIR = qtwebengine_dictionaries
-}
-
-dict.files = $$PWD/dict/en-US.dic $$PWD/dict/de-DE.dic
-dictoolbuild.input = dict.files
-dictoolbuild.output = $${DICTIONARIES_DIR}/${QMAKE_FILE_BASE}.bdic
-dictoolbuild.commands = $${CONVERT_TOOL} ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
-dictoolbuild.name = Build ${QMAKE_FILE_IN_BASE}
-dictoolbuild.CONFIG = no_link target_predeps
-QMAKE_EXTRA_COMPILERS += dictoolbuild
diff --git a/tests/auto/widgets/spellchecking/tst_spellchecking.cpp b/tests/auto/widgets/spellchecking/tst_spellchecking.cpp
index 801e2a76c..c643a56ba 100644
--- a/tests/auto/widgets/spellchecking/tst_spellchecking.cpp
+++ b/tests/auto/widgets/spellchecking/tst_spellchecking.cpp
@@ -1,38 +1,13 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "util.h"
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#include <util.h>
#include <QtTest/QtTest>
-#include <QtWebEngineWidgets/qwebenginecontextmenudata.h>
-#include <QtWebEngineWidgets/qwebengineprofile.h>
-#include <QtWebEngineWidgets/qwebenginepage.h>
+#include <QtWebEngineCore/qwebenginecontextmenurequest.h>
+#include <QtWebEngineCore/qwebenginepage.h>
+#include <QtWebEngineCore/qwebengineprofile.h>
+#include <QtWebEngineCore/qwebenginesettings.h>
#include <QtWebEngineWidgets/qwebengineview.h>
-#include <qwebenginesettings.h>
class WebView : public QWebEngineView
{
@@ -47,22 +22,19 @@ public:
QTest::mouseRelease(widget, Qt::RightButton, {}, position);
}
- const QWebEngineContextMenuData& data()
- {
- return m_data;
- }
+ QWebEngineContextMenuRequest *data() { return m_data; }
signals:
void menuReady();
protected:
- void contextMenuEvent(QContextMenuEvent *)
+ void contextMenuEvent(QContextMenuEvent *) override
{
- m_data = page()->contextMenuData();
+ m_data = lastContextMenuRequest();
emit menuReady();
}
private:
- QWebEngineContextMenuData m_data;
+ QWebEngineContextMenuRequest *m_data;
};
class tst_Spellchecking : public QObject
@@ -173,19 +145,20 @@ void tst_Spellchecking::spellcheck()
QVariantList list = evaluateJavaScriptSync(m_view->page(), "findWordPosition('I lowe Qt ....','lowe');").toList();
QRect rect(list[0].value<int>(),list[1].value<int>(),list[2].value<int>(),list[3].value<int>());
+ QTRY_VERIFY(m_view->focusWidget());
//type text, spellchecker needs time
QTest::mouseMove(m_view->focusWidget(), QPoint(20,20));
QTest::mousePress(m_view->focusWidget(), Qt::LeftButton, {}, QPoint(20,20));
QTest::mouseRelease(m_view->focusWidget(), Qt::LeftButton, {}, QPoint(20,20));
QString text("I lowe Qt ....");
- for (int i = 0; i < text.length(); i++) {
+ for (int i = 0; i < text.size(); i++) {
QTest::keyClicks(m_view->focusWidget(), text.at(i));
QTest::qWait(60);
}
// make sure text is there
QString result = evaluateJavaScriptSync(m_view->page(), "text();").toString();
- QVERIFY(result == text);
+ QCOMPARE(result, text);
bool gotMisspelledWord = false; // clumsy QTRY_VERIFY still execs expr after first success
QString detail;
@@ -204,17 +177,17 @@ void tst_Spellchecking::spellcheck()
return false;
}
- if (!m_view->data().isValid()) {
+ if (!m_view->data()) {
detail = "invalid data";
return false;
}
- if (!m_view->data().isContentEditable()) {
+ if (!m_view->data()->isContentEditable()) {
detail = "content is not editable";
return false;
}
- if (m_view->data().misspelledWord().isEmpty()) {
+ if (m_view->data()->misspelledWord().isEmpty()) {
detail = "no misspelled word";
return false;
};
@@ -224,10 +197,10 @@ void tst_Spellchecking::spellcheck()
} (), qPrintable(QString("Context menu: %1").arg(detail)));
// check misspelled word
- QCOMPARE(m_view->data().misspelledWord(), QStringLiteral("lowe"));
+ QCOMPARE(m_view->data()->misspelledWord(), QStringLiteral("lowe"));
// check suggestions
- QCOMPARE(m_view->data().spellCheckerSuggestions(), suggestions);
+ QCOMPARE(m_view->data()->spellCheckerSuggestions(), suggestions);
// check replace word
m_view->page()->replaceMisspelledWord("love");
diff --git a/tests/auto/widgets/spellchecking/tst_spellchecking.qrc b/tests/auto/widgets/spellchecking/tst_spellchecking.qrc
deleted file mode 100644
index 505b932c7..000000000
--- a/tests/auto/widgets/spellchecking/tst_spellchecking.qrc
+++ /dev/null
@@ -1,5 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>resources/index.html</file>
- </qresource>
-</RCC>
diff --git a/tests/auto/widgets/tests.pri b/tests/auto/widgets/tests.pri
deleted file mode 100644
index 97954aedc..000000000
--- a/tests/auto/widgets/tests.pri
+++ /dev/null
@@ -1,22 +0,0 @@
-include($$QTWEBENGINE_OUT_ROOT/src/core/qtwebenginecore-config.pri) # workaround for QTBUG-68093
-QT_FOR_CONFIG += webenginecore-private
-
-TEMPLATE = app
-
-CONFIG += testcase
-CONFIG += c++14
-
-VPATH += $$_PRO_FILE_PWD_
-TARGET = tst_$$TARGET
-
-SOURCES += $${TARGET}.cpp
-INCLUDEPATH += $$PWD
-
-exists($$_PRO_FILE_PWD_/$${TARGET}.qrc): RESOURCES += $${TARGET}.qrc
-
-QT += testlib network webenginewidgets widgets quick quickwidgets
-
-# This define is used by some tests to look up resources in the source tree
-DEFINES += TESTS_SOURCE_DIR=\\\"$$PWD/\\\"
-
-include(../embed_info_plist.pri)
diff --git a/tests/auto/widgets/touchinput/CMakeLists.txt b/tests/auto/widgets/touchinput/CMakeLists.txt
new file mode 100644
index 000000000..bd76666d6
--- /dev/null
+++ b/tests/auto/widgets/touchinput/CMakeLists.txt
@@ -0,0 +1,13 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+include(../../util/util.cmake)
+
+qt_internal_add_test(tst_touchinput
+ SOURCES
+ tst_touchinput.cpp
+ LIBRARIES
+ Qt::WebEngineWidgets
+ Qt::GuiPrivate
+ Test::Util
+)
diff --git a/tests/auto/widgets/touchinput/tst_touchinput.cpp b/tests/auto/widgets/touchinput/tst_touchinput.cpp
new file mode 100644
index 000000000..42178558c
--- /dev/null
+++ b/tests/auto/widgets/touchinput/tst_touchinput.cpp
@@ -0,0 +1,372 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#include <util.h>
+
+#include <QtGui/qpa/qwindowsysteminterface.h>
+#include <QSignalSpy>
+#include <QTest>
+#include <QPointingDevice>
+#include <QWebEngineSettings>
+#include <QWebEngineView>
+
+static QPointingDevice* s_touchDevice = nullptr;
+
+struct Page : QWebEnginePage
+{
+ QStringList alerts;
+ void javaScriptAlert(const QUrl &/*origin*/, const QString &msg) override { alerts.append(msg); }
+};
+
+class TouchInputTest : public QObject
+{
+ Q_OBJECT
+
+private Q_SLOTS:
+ void initTestCase();
+ void init();
+ void cleanup();
+
+private Q_SLOTS:
+ void touchTap();
+ void touchTapAndHold();
+ void touchTapAndHoldCancelled();
+ void scrolling();
+ void pinchZoom_data();
+ void pinchZoom();
+ void complexSequence();
+ void buttonClickHandler();
+ void htmlSelectPopup();
+
+private:
+ Page page;
+ QWebEngineView view;
+ QSignalSpy loadSpy { &view, &QWebEngineView::loadFinished };
+ QPoint notextCenter, textCenter, inputCenter;
+
+ QString activeElement() { return evaluateJavaScriptSync(view.page(), "document.activeElement.id").toString(); }
+
+ void makeTouch(QWindow *w, const QPoint &p) {
+ QTest::touchEvent(w, s_touchDevice).press(1, p);
+ QTest::touchEvent(w, s_touchDevice).release(1, p);
+ }
+ void makeTouch(const QPoint &p) { makeTouch(view.windowHandle(), p); }
+
+ void gestureScroll(bool down) {
+ auto target = view.focusProxy();
+ QPoint p(target->width() / 2, target->height() / 4 * (down ? 3 : 1));
+
+ QTest::touchEvent(target, s_touchDevice).press(1, p, target);
+
+ QSignalSpy spy(view.page(), &QWebEnginePage::scrollPositionChanged);
+ for (int i = 0; i < 3; ++i) {
+ down ? p -= QPoint(5, 15) : p += QPoint(5, 15);
+ QTest::qWait(100); // too fast and events are recognized as fling gesture
+ QTest::touchEvent(target, s_touchDevice).move(1, p, target);
+ spy.wait();
+ }
+
+ QTest::touchEvent(target, s_touchDevice).release(1, p, target);
+ }
+
+ void gesturePinch(bool zoomIn, bool tapOneByOne = false) {
+ auto target = view.focusProxy();
+ QPoint p(target->width() / 2, target->height() / 2);
+ auto t1 = p - QPoint(zoomIn ? 50 : 150, 10), t2 = p + QPoint(zoomIn ? 50 : 150, 10);
+
+ if (tapOneByOne) {
+ QTest::touchEvent(target, s_touchDevice).press(0, t1, target);
+ QTest::touchEvent(target, s_touchDevice).stationary(0).press(1, t2, target);
+ } else {
+ QTest::touchEvent(target, s_touchDevice).press(0, t1, target).press(1, t2, target);
+ }
+
+ for (int i = 0; i < 3; ++i) {
+ if (zoomIn) {
+ t1 -= QPoint(25, 5);
+ t2 += QPoint(25, 5);
+ } else {
+ t1 += QPoint(35, 5);
+ t2 -= QPoint(35, 5);
+ }
+ QTest::qWait(100); // too fast and events are recognized as fling gesture
+ QTest::touchEvent(target, s_touchDevice).move(1, t1, target).move(0, t2, target);
+ }
+
+ if (tapOneByOne) {
+ QTest::touchEvent(target, s_touchDevice).stationary(0).release(1, t2, target);
+ QTest::touchEvent(target, s_touchDevice).release(0, t1, target);
+ } else {
+ QTest::touchEvent(target, s_touchDevice).release(0, t1, target).release(1, t2, target);
+ }
+ }
+
+ int getScrollPosition(int *position = nullptr) {
+ int p = evaluateJavaScriptSync(view.page(), "window.scrollY").toInt();
+ return position ? (*position = p) : p;
+ }
+
+ int pageScrollPosition() {
+ // this one is updated later in page in asynchronous way
+ return qRound(view.page()->scrollPosition().y());
+ }
+
+ double getScaleFactor(double *scale = nullptr) {
+ double s = evaluateJavaScriptSync(view.page(), "window.visualViewport.scale").toDouble();
+ return scale ? (*scale = s) : s;
+ }
+};
+
+void TouchInputTest::initTestCase()
+{
+ s_touchDevice = QTest::createTouchDevice();
+
+ view.setPage(&page);
+ view.settings()->setAttribute(QWebEngineSettings::FocusOnNavigationEnabled, false);
+
+ view.show(); view.resize(480, 320);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
+
+ view.setHtml("<html><head><style>.rect { min-width: 240px; min-height: 120px; }</style></head><body>"
+ "<p id='text' style='width: 150px;'>The Qt Company</p>"
+ "<div id='notext' style='width: 150px; height: 100px; background-color: #f00;'></div>"
+ "<form><input id='input' style='width: 150px;' type='text' value='The Qt Company2' /></form>"
+ "<button id='btn' type='button' onclick='alert(\"button clicked!\")'>Click Me!</button>"
+ "<select id='select' onchange='alert(\"option changed to: \" + this.value)'>"
+ "<option value='O1'>O1</option><option value='O2'>O2</option><option value='O3'>O3</option></select>"
+ "<table style='width: 100%; padding: 15px; text-align: center;'>"
+ "<tr><td>BEFORE</td><td><div class='rect' style='background-color: #00f;'></div></td><td>AFTER</td></tr>"
+ "<tr><td>BEFORE</td><td><div class='rect' style='background-color: #0f0;'></div></td><td>AFTER</td></tr>"
+ "<tr><td>BEFORE</td><td><div class='rect' style='background-color: #f00;'></div></td><td>AFTER</td></tr></table>"
+ "</body></html>");
+ QVERIFY(loadSpy.wait() && loadSpy.first().first().toBool());
+
+ notextCenter = elementCenter(view.page(), "notext");
+ textCenter = elementCenter(view.page(), "text");
+ inputCenter = elementCenter(view.page(), "input");
+}
+
+void TouchInputTest::init()
+{
+ QCOMPARE(activeElement(), QString());
+}
+
+void TouchInputTest::cleanup()
+{
+ evaluateJavaScriptSync(view.page(), "if (document.activeElement) document.activeElement.blur()");
+ evaluateJavaScriptSync(view.page(), "window.scrollTo(0, 0)");
+ QTRY_COMPARE(getScrollPosition(), 0);
+ QTRY_COMPARE(pageScrollPosition(), 0);
+ page.alerts.clear();
+}
+
+void TouchInputTest::touchTap()
+{
+ auto singleTap = [target = view.focusProxy()] (const QPoint& tapCoords) -> void {
+ QTest::touchEvent(target, s_touchDevice).press(1, tapCoords, target);
+ QTest::touchEvent(target, s_touchDevice).stationary(1);
+ QTest::touchEvent(target, s_touchDevice).release(1, tapCoords, target);
+ };
+
+ // Single tap on text doesn't trigger a selection
+ singleTap(textCenter);
+ QTRY_COMPARE(activeElement(), QString());
+ QTRY_VERIFY(!view.hasSelection());
+
+ // Single tap inside the input field focuses it without selecting the text
+ singleTap(inputCenter);
+ QTRY_COMPARE(activeElement(), QStringLiteral("input"));
+ QTRY_VERIFY(!view.hasSelection());
+
+ // Single tap on the div clears the input field focus
+ singleTap(notextCenter);
+ QTRY_COMPARE(activeElement(), QString());
+
+ // Double tap on text still doesn't trigger a selection
+ singleTap(textCenter);
+ singleTap(textCenter);
+ QTRY_COMPARE(activeElement(), QString());
+ QTRY_VERIFY(!view.hasSelection());
+
+ // Double tap inside the input field focuses it and selects the word under it
+ singleTap(inputCenter);
+ singleTap(inputCenter);
+ QTRY_COMPARE(activeElement(), QStringLiteral("input"));
+ QTRY_COMPARE(view.selectedText(), QStringLiteral("Company2"));
+
+ // Double tap outside the input field behaves like a single tap: clears its focus and selection
+ singleTap(notextCenter);
+ singleTap(notextCenter);
+ QTRY_COMPARE(activeElement(), QString());
+ QTRY_VERIFY(!view.hasSelection());
+}
+
+void TouchInputTest::touchTapAndHold()
+{
+ auto tapAndHold = [target = view.focusProxy()] (const QPoint& tapCoords) -> void {
+ QTest::touchEvent(target, s_touchDevice).press(1, tapCoords, target);
+ QTest::touchEvent(target, s_touchDevice).stationary(1);
+ QTest::qWait(1000);
+ QTest::touchEvent(target, s_touchDevice).release(1, tapCoords, target);
+ };
+
+ // Tap-and-hold on text selects the word under it
+ tapAndHold(textCenter);
+ QTRY_COMPARE(activeElement(), QString());
+ QTRY_COMPARE(view.selectedText(), QStringLiteral("Company"));
+
+ // Tap-and-hold inside the input field focuses it and selects the word under it
+ tapAndHold(inputCenter);
+ QTRY_COMPARE(activeElement(), QStringLiteral("input"));
+ QTRY_COMPARE(view.selectedText(), QStringLiteral("Company2"));
+
+ // Only test the page context menu on Windows, as Linux doesn't handle context menus consistently
+ // and other non-desktop platforms like Android may not even support context menus at all
+#if defined(Q_OS_WIN)
+ // Tap-and-hold clears the text selection and shows the page's context menu
+ QVERIFY(QApplication::activePopupWidget() == nullptr);
+ tapAndHold(notextCenter);
+ QTRY_COMPARE(activeElement(), QString());
+ QTRY_VERIFY(!view.hasSelection());
+ QTRY_VERIFY(QApplication::activePopupWidget() != nullptr);
+
+ QApplication::activePopupWidget()->close();
+ QVERIFY(QApplication::activePopupWidget() == nullptr);
+#endif
+}
+
+void TouchInputTest::touchTapAndHoldCancelled()
+{
+ auto cancelledTapAndHold = [target = view.focusProxy()] (const QPoint& tapCoords) -> void {
+ QTest::touchEvent(target, s_touchDevice).press(1, tapCoords, target);
+ QTest::touchEvent(target, s_touchDevice).stationary(1);
+ QTest::qWait(1000);
+ QWindowSystemInterface::handleTouchCancelEvent(target->windowHandle(), s_touchDevice);
+ };
+
+ // A cancelled tap-and-hold should cancel text selection, but currently doesn't
+ cancelledTapAndHold(textCenter);
+ QEXPECT_FAIL("", "Incorrect Chromium selection behavior when cancelling tap-and-hold on text", Continue);
+ QTRY_VERIFY_WITH_TIMEOUT(!view.hasSelection(), 100);
+
+ // A cancelled tap-and-hold should cancel input field focusing and selection, but currently doesn't
+ cancelledTapAndHold(inputCenter);
+ QEXPECT_FAIL("", "Incorrect Chromium selection behavior when cancelling tap-and-hold on input field", Continue);
+ QTRY_VERIFY_WITH_TIMEOUT(evaluateJavaScriptSync(view.page(), "document.activeElement.id").toString().isEmpty(), 100);
+ QEXPECT_FAIL("", "Incorrect Chromium focus behavior when cancelling tap-and-hold on input field", Continue);
+ QTRY_VERIFY_WITH_TIMEOUT(!view.hasSelection(), 100);
+
+ // Only test the page context menu on Windows, as Linux doesn't handle context menus consistently
+ // and other non-desktop platforms like Android may not even support context menus at all
+#if defined(Q_OS_WIN)
+ // A cancelled tap-and-hold cancels the context menu
+ QVERIFY(QApplication::activePopupWidget() == nullptr);
+ cancelledTapAndHold(notextCenter);
+ QVERIFY(QApplication::activePopupWidget() == nullptr);
+#endif
+}
+
+void TouchInputTest::scrolling()
+{
+ int p = getScrollPosition();
+ QCOMPARE(p, 0);
+
+ // scroll a bit down...
+ for (int i = 0; i < 3; ++i) {
+ gestureScroll(/* down = */true);
+ int positionBefore = p;
+ QTRY_VERIFY2(getScrollPosition(&p) > positionBefore, qPrintable(QString("i: %1, position: %2 -> %3").arg(i).arg(positionBefore).arg(p)));
+ }
+
+ // ... and then scroll page again but in opposite direction
+ for (int i = 0; i < 3; ++i) {
+ gestureScroll(/* down = */false);
+ int positionBefore = p;
+ QTRY_VERIFY2(getScrollPosition(&p) < positionBefore, qPrintable(QString("i: %1, position: %2 -> %3").arg(i).arg(positionBefore).arg(p)));
+ }
+
+ QTRY_COMPARE(getScrollPosition(), 0);
+}
+
+void TouchInputTest::pinchZoom_data()
+{
+ QTest::addColumn<bool>("tapOneByOne");
+ QTest::addRow("sequential") << true;
+ QTest::addRow("simultaneous") << false;
+}
+
+void TouchInputTest::pinchZoom()
+{
+ QFETCH(bool, tapOneByOne);
+ double scale = getScaleFactor();
+ QCOMPARE(scale, 1.0);
+
+ for (int i = 0; i < 3; ++i) {
+ gesturePinch(/* zoomIn = */true, tapOneByOne);
+ QTRY_VERIFY2(getScaleFactor(&scale) > 1.0, qPrintable(QString("i: %1, scale: %2").arg(i).arg(scale)));
+ gesturePinch(/* zoomIn = */false, tapOneByOne);
+ QTRY_COMPARE(getScaleFactor(&scale), 1.0);
+ }
+}
+
+void TouchInputTest::complexSequence()
+{
+ auto t = view.focusProxy();
+ QPoint pc(view.width() / 2, view.height() / 2), p1 = pc - QPoint(50, 25), p2 = pc + QPoint(50, 25);
+
+ for (int i = 0; i < 4; ++i) {
+ QTest::touchEvent(t, s_touchDevice).press(42, p1, t); QTest::qWait(50);
+ QTest::touchEvent(t, s_touchDevice).stationary(42).press(24, p2, t); QTest::qWait(50);
+ QTest::touchEvent(t, s_touchDevice).release(42, p1, t).release(24, p2, t);
+
+ // for additional variablity add zooming in on even steps and zooming out on odd steps
+ // MEMO scroll position will always be 0 while viewport scale factor > 1.0, so do zoom in after scroll
+ bool zoomIn = i % 2 == 0;
+
+ if (!zoomIn) {
+ gesturePinch(false);
+ QTRY_COMPARE(getScaleFactor(), 1.0);
+ }
+
+ int p = getScrollPosition(), positionBefore = p;
+ gestureScroll(true);
+ QTRY_VERIFY2_WITH_TIMEOUT(getScrollPosition(&p) > positionBefore, qPrintable(QString("i: %1, position: %2 -> %3").arg(i).arg(positionBefore).arg(p)), 1000);
+
+ if (zoomIn) {
+ double s = getScaleFactor(), scaleBefore = s;
+ gesturePinch(true);
+ QTRY_VERIFY2(getScaleFactor(&s) > scaleBefore, qPrintable(QString("i: %1, scale: %2").arg(i).arg(s)));
+ }
+ }
+}
+
+void TouchInputTest::buttonClickHandler()
+{
+ auto buttonCenter = elementGeometry(view.page(), "btn").center();
+ makeTouch(buttonCenter);
+ QTRY_VERIFY(!page.alerts.isEmpty());
+ QCOMPARE(page.alerts.first(), "button clicked!");
+ QCOMPARE(page.alerts.size(), 1);
+ QEXPECT_FAIL("", "Shouldn't trigger twice due to synthesized mouse events for touch", Continue);
+ QTRY_VERIFY_WITH_TIMEOUT(page.alerts.size() == 2, 500);
+}
+
+void TouchInputTest::htmlSelectPopup()
+{
+ auto selectRect = elementGeometry(view.page(), "select");
+ makeTouch(selectRect.center());
+ QTRY_VERIFY(QApplication::activePopupWidget());
+ QCOMPARE(activeElement(), QStringLiteral("select"));
+
+ auto popup = QApplication::activePopupWidget();
+ makeTouch(popup->windowHandle(), QPoint(popup->width() / 2, popup->height() / 2));
+ QTRY_VERIFY(!QApplication::activePopupWidget());
+
+ QTRY_VERIFY(!page.alerts.isEmpty());
+ QCOMPARE(page.alerts.first(), "option changed to: O2");
+ QEXPECT_FAIL("", "Shouldn't trigger twice due to synthesized mouse events for touch", Continue);
+ QTRY_VERIFY_WITH_TIMEOUT(page.alerts.size() == 2, 500);
+}
+
+QTEST_MAIN(TouchInputTest)
+#include "tst_touchinput.moc"
diff --git a/tests/auto/widgets/util.h b/tests/auto/widgets/util.h
deleted file mode 100644
index cb58f4243..000000000
--- a/tests/auto/widgets/util.h
+++ /dev/null
@@ -1,194 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-// Functions and macros that really need to be in QTestLib
-
-#if 0
-#pragma qt_no_master_include
-#endif
-
-#include <QEventLoop>
-#include <QSignalSpy>
-#include <QTimer>
-#include <qwebenginepage.h>
-#include <qwebengineview.h>
-
-#if !defined(TESTS_SOURCE_DIR)
-#define TESTS_SOURCE_DIR ""
-#endif
-
-/**
- * Just like QSignalSpy but facilitates sync and async
- * signal emission. For example if you want to verify that
- * page->foo() emitted a signal, it could be that the
- * implementation decides to emit the signal asynchronously
- * - in which case we want to spin a local event loop until
- * emission - or that the call to foo() emits it right away.
- */
-class SignalBarrier : private QSignalSpy
-{
-public:
- SignalBarrier(const QObject* obj, const char* aSignal)
- : QSignalSpy(obj, aSignal)
- { }
-
- bool ensureSignalEmitted()
- {
- bool result = count() > 0;
- if (!result)
- result = wait();
- clear();
- return result;
- }
-};
-
-template<typename T, typename R>
-struct CallbackWrapper {
- QPointer<R> p;
- void operator()(const T& result) {
- if (p)
- (*p)(result);
- }
-};
-
-template<typename T>
-class CallbackSpy: public QObject {
-public:
- CallbackSpy() : called(false) {
- timeoutTimer.setSingleShot(true);
- QObject::connect(&timeoutTimer, SIGNAL(timeout()), &eventLoop, SLOT(quit()));
- }
-
- T waitForResult(int timeout = 20000) {
- const int step = 1000;
- int elapsed = 0;
- while (elapsed < timeout && !called) {
- timeoutTimer.start(step);
- eventLoop.exec();
- elapsed += step;
- }
- return result;
- }
-
- bool wasCalled() const {
- return called;
- }
-
- void operator()(const T &result) {
- this->result = result;
- called = true;
- eventLoop.quit();
- }
-
- CallbackWrapper<T, CallbackSpy<T> > ref()
- {
- CallbackWrapper<T, CallbackSpy<T> > wrapper = {this};
- return wrapper;
- }
-
-private:
- Q_DISABLE_COPY(CallbackSpy)
- bool called;
- QTimer timeoutTimer;
- QEventLoop eventLoop;
- T result;
-};
-
-static inline QString toPlainTextSync(QWebEnginePage *page)
-{
- CallbackSpy<QString> spy;
- page->toPlainText(spy.ref());
- return spy.waitForResult();
-}
-
-static inline QString toHtmlSync(QWebEnginePage *page)
-{
- CallbackSpy<QString> spy;
- page->toHtml(spy.ref());
- return spy.waitForResult();
-}
-
-static inline bool findTextSync(QWebEnginePage *page, const QString &subString)
-{
- CallbackSpy<bool> spy;
- page->findText(subString, {}, spy.ref());
- return spy.waitForResult();
-}
-
-static inline QVariant evaluateJavaScriptSync(QWebEnginePage *page, const QString &script)
-{
- CallbackSpy<QVariant> spy;
- page->runJavaScript(script, spy.ref());
- return spy.waitForResult();
-}
-
-static inline QVariant evaluateJavaScriptSyncInWorld(QWebEnginePage *page, const QString &script, int worldId)
-{
- CallbackSpy<QVariant> spy;
- page->runJavaScript(script, worldId, spy.ref());
- return spy.waitForResult();
-}
-
-static inline QUrl baseUrlSync(QWebEnginePage *page)
-{
- CallbackSpy<QVariant> spy;
- page->runJavaScript("document.baseURI", spy.ref());
- return spy.waitForResult().toUrl();
-}
-
-static inline bool loadSync(QWebEnginePage *page, const QUrl &url, bool ok = true)
-{
- QSignalSpy spy(page, &QWebEnginePage::loadFinished);
- page->load(url);
- return (!spy.empty() || spy.wait(20000)) && (spy.front().value(0).toBool() == ok);
-}
-
-static inline bool loadSync(QWebEngineView *view, const QUrl &url, bool ok = true)
-{
- return loadSync(view->page(), url, ok);
-}
-
-#define W_QSKIP(a, b) QSKIP(a)
-
-#define W_QTEST_MAIN(TestObject, params) \
-int main(int argc, char *argv[]) \
-{ \
- QVector<const char *> w_argv(argc); \
- for (int i = 0; i < argc; ++i) \
- w_argv[i] = argv[i]; \
- for (int i = 0; i < params.size(); ++i) \
- w_argv.append(params[i].data()); \
- int w_argc = w_argv.size(); \
- \
- QApplication app(w_argc, const_cast<char **>(w_argv.data())); \
- app.setAttribute(Qt::AA_Use96Dpi, true); \
- QTEST_DISABLE_KEYPAD_NAVIGATION \
- TestObject tc; \
- QTEST_SET_MAIN_SOURCE_PATH \
- return QTest::qExec(&tc, argc, argv); \
-}
diff --git a/tests/auto/widgets/widgets.pro b/tests/auto/widgets/widgets.pro
deleted file mode 100644
index 6d65eecb5..000000000
--- a/tests/auto/widgets/widgets.pro
+++ /dev/null
@@ -1,51 +0,0 @@
-include($$QTWEBENGINE_OUT_ROOT/src/core/qtwebenginecore-config.pri) # workaround for QTBUG-68093
-QT_FOR_CONFIG += webenginecore webenginecore-private
-
-TEMPLATE = subdirs
-
-SUBDIRS += \
- defaultsurfaceformat \
- devtools \
- faviconmanager \
- loadsignals \
- offscreen \
- origins \
- proxy \
- proxypac \
- schemes \
- shutdown \
- qwebenginedownloaditem \
- qwebenginepage \
- qwebenginehistory \
- qwebengineprofile \
- qwebenginescript \
- qwebenginesettings \
- qwebengineview
-
-qtConfig(accessibility) {
- SUBDIRS += accessibility
-}
-
-qtConfig(webengine-printing-and-pdf) {
- SUBDIRS += printing
-}
-
-qtConfig(ssl) {
- SUBDIRS += certificateerror
-}
-
-qtConfig(webengine-spellchecker):!cross_compile {
- !qtConfig(webengine-native-spellchecker) {
- SUBDIRS += spellchecking
- } else {
- message("Spellcheck test will not be built because it depends on usage of Hunspell dictionaries.")
- }
-}
-
-# QTBUG-60268
-boot2qt: SUBDIRS -= accessibility defaultsurfaceformat devtools \
- qwebenginepage \
- qwebengineprofile \
- qwebengineview
-
-win32: SUBDIRS -= offscreen
diff --git a/tests/manual/CMakeLists.txt b/tests/manual/CMakeLists.txt
new file mode 100644
index 000000000..d9f3e11ea
--- /dev/null
+++ b/tests/manual/CMakeLists.txt
@@ -0,0 +1,7 @@
+add_subdirectory(examples)
+if(TARGET Qt::WebEngineQuick)
+ add_subdirectory(quick)
+endif()
+if(TARGET Qt::WebEngineWidgets)
+ add_subdirectory(widgets)
+endif()
diff --git a/tests/manual/examples/CMakeLists.txt b/tests/manual/examples/CMakeLists.txt
new file mode 100644
index 000000000..c56302f20
--- /dev/null
+++ b/tests/manual/examples/CMakeLists.txt
@@ -0,0 +1,6 @@
+if(TARGET Qt::WebEngineWidgets)
+ add_subdirectory(widgets)
+endif()
+if(TARGET Qt::WebEngineQuick)
+ add_subdirectory(quick)
+endif()
diff --git a/tests/manual/examples/quick/CMakeLists.txt b/tests/manual/examples/quick/CMakeLists.txt
new file mode 100644
index 000000000..c461f2dbb
--- /dev/null
+++ b/tests/manual/examples/quick/CMakeLists.txt
@@ -0,0 +1,4 @@
+add_subdirectory(minimal)
+add_subdirectory(customdialogs)
+add_subdirectory(customtouchhandle)
+add_subdirectory(webengineaction)
diff --git a/tests/manual/examples/quick/customdialogs/CMakeLists.txt b/tests/manual/examples/quick/customdialogs/CMakeLists.txt
new file mode 100644
index 000000000..bfbff79eb
--- /dev/null
+++ b/tests/manual/examples/quick/customdialogs/CMakeLists.txt
@@ -0,0 +1,56 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+if (NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.16)
+ project(customdialogs LANGUAGES CXX)
+ find_package(Qt6BuildInternals COMPONENTS STANDALONE_TEST)
+endif()
+
+qt_internal_add_manual_test(customdialogs
+ SOURCES main.cpp server.cpp server.h
+)
+
+set_target_properties(customdialogs PROPERTIES
+ WIN32_EXECUTABLE TRUE
+ MACOSX_BUNDLE TRUE
+)
+
+target_link_libraries(customdialogs PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::WebEngineQuick
+)
+
+set(customdialogs_resource_files
+ "MessageRectangle.qml"
+ "SwitchButton.qml"
+ "WebView.qml"
+ "forms/Authentication.qml"
+ "forms/AuthenticationForm.ui.qml"
+ "forms/ColorCell.qml"
+ "forms/ColorPicker.qml"
+ "forms/ColorPickerForm.ui.qml"
+ "forms/CustomButton.qml"
+ "forms/FilePicker.qml"
+ "forms/FilePickerForm.ui.qml"
+ "forms/FileRow.qml"
+ "forms/JavaScript.qml"
+ "forms/JavaScriptForm.ui.qml"
+ "forms/Menu.qml"
+ "forms/MenuForm.ui.qml"
+ "forms/TouchSelectionMenu.qml"
+ "forms/TouchSelectionMenuForm.ui.qml"
+ "icon.svg"
+ "index.html"
+ "main.qml"
+ "style.css"
+)
+
+qt_add_resources(customdialogs "customdialogs"
+ PREFIX
+ "/"
+ FILES
+ ${customdialogs_resource_files}
+)
+
diff --git a/tests/manual/examples/quick/customdialogs/MessageRectangle.qml b/tests/manual/examples/quick/customdialogs/MessageRectangle.qml
new file mode 100644
index 000000000..09a202cf3
--- /dev/null
+++ b/tests/manual/examples/quick/customdialogs/MessageRectangle.qml
@@ -0,0 +1,18 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+
+Rectangle {
+ property alias text: messageText.text
+ width: parent.width
+ height: 30
+ visible: false
+ color: "#80c342"
+ Text {
+ id: messageText
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ font.pointSize: 12
+ }
+}
diff --git a/tests/manual/examples/quick/customdialogs/SwitchButton.qml b/tests/manual/examples/quick/customdialogs/SwitchButton.qml
new file mode 100644
index 000000000..69fc1427e
--- /dev/null
+++ b/tests/manual/examples/quick/customdialogs/SwitchButton.qml
@@ -0,0 +1,23 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+
+Item {
+ width: parent.width
+ height: 40
+ property alias checked: switcher.checked
+ RowLayout {
+ anchors.centerIn: parent
+ Text {
+ text: qsTr("Use default dialogs")
+ font.pointSize: 12
+ }
+ Switch {
+ id: switcher
+ checked: true
+ }
+ }
+}
diff --git a/tests/manual/examples/quick/customdialogs/WebView.qml b/tests/manual/examples/quick/customdialogs/WebView.qml
new file mode 100644
index 000000000..5c99ee7e7
--- /dev/null
+++ b/tests/manual/examples/quick/customdialogs/WebView.qml
@@ -0,0 +1,117 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtWebEngine
+
+WebEngineView {
+ id: view
+ url: "qrc:/index.html"
+ property bool useDefaultDialogs: true
+ signal openForm(var form)
+
+ Rectangle {
+ id: tooltip
+ width: 200
+ height: 30
+ z: 50
+ visible: false
+ color: "gray"
+ border.color: "black"
+ border.width: 2
+ radius: 3
+
+ property string text: ""
+
+ Text {
+ x: 0
+ y: 0
+ color: "#ffffff"
+ text: parent.text
+ font.pointSize: 12
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ font.bold: false
+ }
+
+ }
+
+ onContextMenuRequested: function(request) {
+ // we only show menu for links with #openMenu
+ if (!request.linkUrl.toString().endsWith("#openMenu")) {
+ request.accepted = true;
+ return;
+ }
+ // return early to show default menu
+ if (useDefaultDialogs)
+ return;
+
+ request.accepted = true;
+ openForm({item: Qt.resolvedUrl("forms/Menu.qml"),
+ properties: {"request": request}});
+ }
+
+ onTooltipRequested: function(request) {
+ if (useDefaultDialogs)
+ return;
+
+ if (request.type == TooltipRequest.Show) {
+ tooltip.visible = true;
+ tooltip.x = request.x;
+ tooltip.y = request.y;
+ tooltip.text = request.text;
+ } else {
+ tooltip.visible = false;
+ }
+
+ request.accepted = true;
+ }
+
+ onAuthenticationDialogRequested: function(request) {
+ if (useDefaultDialogs) {
+ // do not show proxy error page
+ view.url = "qrc:/index.html"
+ return;
+ }
+ request.accepted = true;
+ openForm({item: Qt.resolvedUrl("forms/Authentication.qml"),
+ properties: {"request": request}});
+ }
+
+ onJavaScriptDialogRequested: function(request) {
+ if (useDefaultDialogs)
+ return;
+
+ request.accepted = true;
+ openForm({item: Qt.resolvedUrl("forms/JavaScript.qml"),
+ properties: {"request": request}});
+ }
+
+ onColorDialogRequested: function(request) {
+ if (useDefaultDialogs)
+ return;
+
+ request.accepted = true;
+ openForm({item: Qt.resolvedUrl("forms/ColorPicker.qml"),
+ properties: {"request": request}});
+ }
+
+ onFileDialogRequested: function(request) {
+ if (useDefaultDialogs)
+ return;
+
+ request.accepted = true;
+ openForm({item: Qt.resolvedUrl("forms/FilePicker.qml"),
+ properties: {"request": request}});
+
+ }
+
+ onTouchSelectionMenuRequested: function(request) {
+ if (useDefaultDialogs)
+ return;
+
+ request.accepted = true;
+ openForm({item: Qt.resolvedUrl("forms/TouchSelectionMenu.qml"),
+ properties: {"request": request}});
+ }
+}
diff --git a/tests/manual/examples/quick/customdialogs/customdialogs.pro b/tests/manual/examples/quick/customdialogs/customdialogs.pro
new file mode 100644
index 000000000..1b9a6778e
--- /dev/null
+++ b/tests/manual/examples/quick/customdialogs/customdialogs.pro
@@ -0,0 +1,18 @@
+QT += webenginequick
+
+HEADERS += \
+ server.h
+
+SOURCES += \
+ main.cpp \
+ server.cpp
+
+RESOURCES += \
+ customdialogs.qrc
+
+target.path = $$[QT_INSTALL_EXAMPLES]/webenginequick/customdialogs
+INSTALLS += target
+
+qtHaveModule(widgets) {
+ QT += widgets # QApplication is required to get native styling with QtQuickControls
+}
diff --git a/tests/manual/examples/quick/customdialogs/customdialogs.qrc b/tests/manual/examples/quick/customdialogs/customdialogs.qrc
new file mode 100644
index 000000000..bb2677198
--- /dev/null
+++ b/tests/manual/examples/quick/customdialogs/customdialogs.qrc
@@ -0,0 +1,24 @@
+<RCC>
+ <qresource prefix="/">
+ <file>forms/AuthenticationForm.ui.qml</file>
+ <file>forms/Authentication.qml</file>
+ <file>forms/ColorCell.qml</file>
+ <file>forms/ColorPickerForm.ui.qml</file>
+ <file>forms/ColorPicker.qml</file>
+ <file>forms/CustomButton.qml</file>
+ <file>forms/FilePickerForm.ui.qml</file>
+ <file>forms/FilePicker.qml</file>
+ <file>forms/FileRow.qml</file>
+ <file>forms/JavaScriptForm.ui.qml</file>
+ <file>forms/JavaScript.qml</file>
+ <file>forms/MenuForm.ui.qml</file>
+ <file>forms/Menu.qml</file>
+ <file>icon.svg</file>
+ <file>index.html</file>
+ <file>main.qml</file>
+ <file>MessageRectangle.qml</file>
+ <file>style.css</file>
+ <file>SwitchButton.qml</file>
+ <file>WebView.qml</file>
+ </qresource>
+</RCC>
diff --git a/tests/manual/examples/quick/customdialogs/forms/Authentication.qml b/tests/manual/examples/quick/customdialogs/forms/Authentication.qml
new file mode 100644
index 000000000..151a7c4aa
--- /dev/null
+++ b/tests/manual/examples/quick/customdialogs/forms/Authentication.qml
@@ -0,0 +1,31 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtWebEngine
+
+AuthenticationForm {
+ property QtObject request
+ signal closeForm()
+
+ cancelButton.onClicked: {
+ request.dialogReject();
+ closeForm();
+ }
+
+ loginButton.onClicked: {
+ request.dialogReject();
+ closeForm();
+ }
+
+ Component.onCompleted: {
+ switch (request.type) {
+ case AuthenticationDialogRequest.AuthenticationTypeHTTP:
+ console.log("HTTP Authentication Required. Host says: " + request.realm);
+ break;
+ case AuthenticationDialogRequest.AuthenticationTypeProxy:
+ console.log("Proxy Authentication Required for: " + request.proxyHost);
+ break;
+ }
+ }
+}
diff --git a/tests/manual/examples/quick/customdialogs/forms/AuthenticationForm.ui.qml b/tests/manual/examples/quick/customdialogs/forms/AuthenticationForm.ui.qml
new file mode 100644
index 000000000..f14986b20
--- /dev/null
+++ b/tests/manual/examples/quick/customdialogs/forms/AuthenticationForm.ui.qml
@@ -0,0 +1,137 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtQuick.Layouts
+import QtQuick.Controls
+
+Item {
+ id: item1
+ property alias cancelButton: cancelButton
+ property alias loginButton: loginButton
+ property alias userName: userName
+ property alias password: password
+
+ ColumnLayout {
+ id: columnLayout
+ anchors.topMargin: 20
+ anchors.top: parent.top
+ anchors.bottomMargin: 20
+ anchors.bottom: parent.bottom
+ anchors.rightMargin: 20
+ anchors.right: parent.right
+ anchors.leftMargin: 20
+ anchors.left: parent.left
+
+ Image {
+ id: image
+ Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
+ source: "qrc:/icon.svg"
+ }
+
+ Rectangle {
+ id: rectangle
+ width: parent.width
+ height: 30
+ Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
+ gradient: Gradient {
+ GradientStop {
+ position: 0
+ color: "#25a6e2"
+ }
+ GradientStop {
+ color: "#188bd0"
+ }
+ }
+
+ Text {
+ id: textArea
+ x: 54
+ y: 5
+ color: "#ffffff"
+ text: qsTr("Restricted Area")
+ font.pointSize: 12
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ }
+
+ Item {
+ width: 40
+ height: 40
+ }
+
+ Text {
+ id: userNameText
+ text: qsTr("Username:")
+ font.pointSize: 12
+ }
+
+ TextField {
+ id: userName
+ width: 300
+ height: 22
+ Layout.fillWidth: true
+ font.pointSize: 12
+ color: "black"
+
+ background: Rectangle {
+ color: "white"
+ border.color: "black"
+ border.width: 1
+ }
+ }
+
+ Text {
+ id: passwordText
+ text: qsTr("Password:")
+ font.pointSize: 12
+ }
+
+ TextField {
+ id: password
+ width: 300
+ height: 26
+ Layout.fillWidth: true
+ font.pointSize: 12
+ color: "black"
+ echoMode: TextInput.Password
+
+ background: Rectangle {
+ color: "white"
+ border.color: "black"
+ border.width: 1
+ }
+ }
+
+ Item {
+ Layout.fillHeight: true
+ }
+
+ RowLayout {
+ id: rowLayout
+ width: 100
+ height: 100
+
+ Item {
+ Layout.fillWidth: true
+ }
+
+ CustomButton {
+ id: cancelButton
+ width: 90
+ height: 30
+ btnText: qsTr("Cancel")
+ btnBlue: false
+ }
+
+ CustomButton {
+ id: loginButton
+ width: 90
+ height: 30
+ btnText: qsTr("Login")
+ btnBlue: false
+ }
+ }
+ }
+}
diff --git a/tests/manual/examples/quick/customdialogs/forms/ColorCell.qml b/tests/manual/examples/quick/customdialogs/forms/ColorCell.qml
new file mode 100644
index 000000000..57151780c
--- /dev/null
+++ b/tests/manual/examples/quick/customdialogs/forms/ColorCell.qml
@@ -0,0 +1,16 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+
+Rectangle {
+ id: rectangle
+ width: 50
+ height: 50
+ signal clicked()
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: rectangle.clicked()
+ }
+}
diff --git a/tests/manual/examples/quick/customdialogs/forms/ColorPicker.qml b/tests/manual/examples/quick/customdialogs/forms/ColorPicker.qml
new file mode 100644
index 000000000..63269ddff
--- /dev/null
+++ b/tests/manual/examples/quick/customdialogs/forms/ColorPicker.qml
@@ -0,0 +1,31 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+
+ColorPickerForm {
+ property QtObject request
+ signal closeForm()
+
+ okButton.onClicked: {
+ request.dialogAccept(colorPicker.color);
+ closeForm();
+ }
+
+ cancelButton.onClicked: {
+ request.dialogReject();
+ closeForm();
+ }
+
+ function createCallback(color) {
+ return function() { colorPicker.color = color };
+ }
+
+ Component.onCompleted:{
+ for (var i = 0; i < grid.children.length; i++) {
+ var cell = grid.children[i];
+ cell.clicked.connect(createCallback(cell.color));
+ }
+ colorPicker.color = request.color;
+ }
+}
diff --git a/tests/manual/examples/quick/customdialogs/forms/ColorPickerForm.ui.qml b/tests/manual/examples/quick/customdialogs/forms/ColorPickerForm.ui.qml
new file mode 100644
index 000000000..060aeef7d
--- /dev/null
+++ b/tests/manual/examples/quick/customdialogs/forms/ColorPickerForm.ui.qml
@@ -0,0 +1,186 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtQuick.Layouts
+
+Item {
+ property alias cancelButton: cancelButton
+ property alias okButton: okButton
+ property string message: "Message"
+ property string title: "Title"
+ property alias blue1: blue1
+ property alias grid: grid
+ property alias colorPicker: colorPicker
+
+ ColumnLayout {
+ id: columnLayout
+ anchors.topMargin: 20
+ anchors.top: parent.top
+ anchors.bottomMargin: 20
+ anchors.bottom: parent.bottom
+ anchors.rightMargin: 20
+ anchors.right: parent.right
+ anchors.leftMargin: 20
+ anchors.left: parent.left
+
+ Image {
+ Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
+ source: "qrc:/icon.svg"
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 30
+ Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
+ gradient: Gradient {
+ GradientStop {
+ position: 0
+ color: "#25a6e2"
+ }
+
+ GradientStop {
+ color: "#188bd0"
+ }
+ }
+
+ Text {
+ id: title
+ x: 54
+ y: 5
+ color: "#ffffff"
+ text: qsTr("Select Color")
+ font.pointSize: 12
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ }
+
+ Item {
+ width: 40
+ height: 40
+ }
+
+ GridLayout {
+ id: grid
+ columns: 5
+ Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
+
+ ColorCell {
+ id: blue1
+ color: "#26d5f8"
+ }
+ ColorCell {
+ id: green1
+ color: "#25f93d"
+ }
+ ColorCell {
+ id: red1
+ color: "#f71111"
+ }
+ ColorCell {
+ id: yellow1
+ color: "#faf23c"
+ }
+ ColorCell {
+ id: orange1
+ color: "#ec8505"
+ }
+ ColorCell {
+ id: blue2
+ color: "#037eaa"
+ }
+ ColorCell {
+ id: green2
+ color: "#389a13"
+ }
+ ColorCell {
+ id: red2
+ color: "#b2001b"
+ }
+ ColorCell {
+ id: yellow2
+ color: "#caca03"
+ }
+ ColorCell {
+ id: orange2
+ color: "#bb4900"
+ }
+ ColorCell {
+ id: blue3
+ color: "#01506c"
+ }
+ ColorCell {
+ id: green3
+ color: "#37592b"
+ }
+ ColorCell {
+ id: red3
+ color: "#700113"
+ }
+ ColorCell {
+ id: yellow3
+ color: "#848404"
+ }
+
+ ColorCell {
+ id: orange3
+ color: "#563100"
+ }
+ }
+
+ Item {
+ width: 10
+ height: 10
+ }
+
+ Rectangle {
+ width: 90
+ height: 90
+ color: "#000000"
+ radius: 4
+ Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
+
+ Rectangle {
+ id: colorPicker
+ height: 80
+ color: "#ffffff"
+ anchors.rightMargin: 5
+ anchors.leftMargin: 5
+ anchors.bottomMargin: 5
+ anchors.topMargin: 5
+ anchors.fill: parent
+ }
+ }
+
+ Item {
+ Layout.fillHeight: true
+ }
+
+ RowLayout {
+ id: rowLayout
+ width: 100
+ height: 100
+
+ Item {
+ Layout.fillWidth: true
+ }
+
+ CustomButton {
+ id: cancelButton
+ width: 90
+ height: 30
+ btnText: qsTr("Cancel")
+ btnBlue: false
+ }
+
+ CustomButton {
+ id: okButton
+ width: 90
+ height: 30
+ btnText: qsTr("OK")
+ btnBlue: false
+ }
+ }
+ }
+}
diff --git a/tests/manual/examples/quick/customdialogs/forms/CustomButton.qml b/tests/manual/examples/quick/customdialogs/forms/CustomButton.qml
new file mode 100644
index 000000000..00a06d558
--- /dev/null
+++ b/tests/manual/examples/quick/customdialogs/forms/CustomButton.qml
@@ -0,0 +1,61 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+
+Rectangle {
+ id: root
+ width: 200
+ height: 30
+ radius: 5
+ property string btnText: "Name"
+ property bool btnEnable: true
+ property bool btnBlue: true
+ opacity: btnEnable ? 1.0 : 0.5
+ signal clicked()
+ gradient: btnBlue ? blueButton : greenButton
+ Text {
+ id: textArea
+ x: 54
+ y: 5
+ color: "#ffffff"
+ text: parent.btnText
+ font.pointSize: 12
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ font.bold: false
+ }
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: {
+ if (btnEnable)
+ root.clicked();
+ }
+ }
+
+ Gradient {
+ id: blueButton
+ GradientStop {
+ position: 0
+ color: "#25a6e2"
+ }
+ GradientStop {
+ position: mouseArea.pressed && root.btnEnable ? 0.7 :1
+ color: "#188bd0"
+ }
+ }
+
+ Gradient {
+ id: greenButton
+ GradientStop {
+ position: 0
+ color: "#80c342"
+ }
+ GradientStop {
+ position: mouseArea.pressed && root.btnEnable ? 0.7 :1
+ color: "#5fac18"
+ }
+ }
+}
diff --git a/tests/manual/examples/quick/customdialogs/forms/FilePicker.qml b/tests/manual/examples/quick/customdialogs/forms/FilePicker.qml
new file mode 100644
index 000000000..45ffefb3a
--- /dev/null
+++ b/tests/manual/examples/quick/customdialogs/forms/FilePicker.qml
@@ -0,0 +1,44 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+
+FilePickerForm {
+ property QtObject request
+ property string selectedFile
+ signal closeForm()
+
+ cancelButton.onClicked: {
+ request.dialogReject();
+ closeForm();
+ }
+
+ okButton.onClicked: {
+ request.dialogAccept('/' + selectedFile);
+ closeForm();
+ }
+
+ function createCallback(fileIndex) {
+ return function() {
+ for (var i = 0; i < files.children.length; i++) {
+ var file = files.children[i];
+ if (i === fileIndex) {
+ selectedFile = file.text;
+ file.selected = true;
+ } else {
+ file.selected = false;
+ }
+ }
+ }
+ }
+
+ Component.onCompleted: {
+ selectedFile = request.defaultFileName;
+ for (var i = 0; i < files.children.length; i++) {
+ var file = files.children[i];
+ file.clicked.connect(createCallback(i));
+ if (file.text === selectedFile)
+ file.selected = true;
+ }
+ }
+}
diff --git a/tests/manual/examples/quick/customdialogs/forms/FilePickerForm.ui.qml b/tests/manual/examples/quick/customdialogs/forms/FilePickerForm.ui.qml
new file mode 100644
index 000000000..1e99b1a91
--- /dev/null
+++ b/tests/manual/examples/quick/customdialogs/forms/FilePickerForm.ui.qml
@@ -0,0 +1,128 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtQuick.Layouts
+
+Item {
+ property alias cancelButton: cancelButton
+ property alias okButton: okButton
+ property string message: "Message"
+ property string title: "Title"
+ property alias files: files
+
+ ColumnLayout {
+ id: columnLayout
+ anchors.topMargin: 20
+ anchors.top: parent.top
+ anchors.bottomMargin: 20
+ anchors.bottom: parent.bottom
+ anchors.rightMargin: 20
+ anchors.right: parent.right
+ anchors.leftMargin: 20
+ anchors.left: parent.left
+
+ Image {
+ id: image
+ Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
+ source: "qrc:/icon.svg"
+ }
+
+ Rectangle {
+ id: rectangle
+ width: parent.width
+ height: 30
+ Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
+ gradient: Gradient {
+ GradientStop {
+ position: 0
+ color: "#25a6e2"
+ }
+
+ GradientStop {
+ color: "#188bd0"
+ }
+ }
+
+ Text {
+ id: title
+ x: 54
+ y: 5
+ color: "#ffffff"
+ text: qsTr("Select File")
+ font.pointSize: 12
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ }
+
+ Item {
+ width: 40
+ height: 40
+ }
+
+ ColumnLayout {
+ id: files
+
+ FileRow {
+ id: filename1
+ text: "example.qdoc"
+ }
+
+ FileRow {
+ id: filename2
+ text: "factory.cpp"
+ }
+
+ FileRow {
+ id: filename3
+ text: "index.html"
+ }
+
+ FileRow {
+ id: filename4
+ text: "main.qml"
+ }
+
+ FileRow {
+ id: filename5
+ text: "qt-logo.png"
+ }
+
+ FileRow {
+ id: filename6
+ text: "window.h"
+ }
+ }
+
+ Item {
+ Layout.fillHeight: true
+ }
+
+ RowLayout {
+ id: rowLayout
+ width: 20
+ height: 100
+
+ Item {
+ Layout.fillWidth: true
+ }
+
+ CustomButton {
+ id: cancelButton
+ width: 90
+ height: 30
+ btnText: qsTr("Cancel")
+ btnBlue: false
+ }
+
+ CustomButton {
+ id: okButton
+ width: 90
+ height: 30
+ btnText: qsTr("OK")
+ btnBlue: false
+ }
+ }
+ }
+}
diff --git a/tests/manual/examples/quick/customdialogs/forms/FileRow.qml b/tests/manual/examples/quick/customdialogs/forms/FileRow.qml
new file mode 100644
index 000000000..1a0cfc0a0
--- /dev/null
+++ b/tests/manual/examples/quick/customdialogs/forms/FileRow.qml
@@ -0,0 +1,44 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtQuick.Layouts
+
+Item {
+ id: root
+ height: 30
+ property string text: "Filename"
+ property bool selected: false
+ signal clicked()
+
+ RowLayout {
+ id: fileRow
+ width: 100
+
+ Item {
+ id: item5
+ width: 10
+ height: 10
+ }
+
+ Rectangle {
+ id: rectangle2
+ width: 10
+ height: 10
+ color: selected ? "#80c342" : "#25a6e2"
+ }
+
+ Text {
+ id: filename
+ text: root.text
+ font.pointSize: 12
+ }
+ }
+
+ MouseArea {
+ id: mouseArea
+ width: 200
+ height: 30
+ onClicked: root.clicked()
+ }
+}
diff --git a/tests/manual/examples/quick/customdialogs/forms/JavaScript.qml b/tests/manual/examples/quick/customdialogs/forms/JavaScript.qml
new file mode 100644
index 000000000..132c95697
--- /dev/null
+++ b/tests/manual/examples/quick/customdialogs/forms/JavaScript.qml
@@ -0,0 +1,44 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtWebEngine
+
+JavaScriptForm {
+ property QtObject request
+ signal closeForm()
+
+ cancelButton.onClicked: {
+ request.dialogReject();
+ closeForm();
+ }
+
+ okButton.onClicked: {
+ request.dialogAccept(prompt.text);
+ closeForm();
+ }
+
+ Component.onCompleted: {
+ switch (request.type) {
+ case JavaScriptDialogRequest.DialogTypeAlert:
+ cancelButton.visible = false;
+ title = qsTr("Alert");
+ message = request.message;
+ prompt.text = "";
+ prompt.visible = false;
+ break;
+ case JavaScriptDialogRequest.DialogTypeConfirm:
+ title = qsTr("Confirm");
+ message = request.message;
+ prompt.text = "";
+ prompt.visible = false;
+ break;
+ case JavaScriptDialogRequest.DialogTypePrompt:
+ title = qsTr("Prompt");
+ message = request.message;
+ prompt.text = request.defaultText;
+ prompt.visible = true;
+ break;
+ }
+ }
+}
diff --git a/tests/manual/examples/quick/customdialogs/forms/JavaScriptForm.ui.qml b/tests/manual/examples/quick/customdialogs/forms/JavaScriptForm.ui.qml
new file mode 100644
index 000000000..b535e7ef9
--- /dev/null
+++ b/tests/manual/examples/quick/customdialogs/forms/JavaScriptForm.ui.qml
@@ -0,0 +1,117 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtQuick.Layouts
+import QtQuick.Controls
+
+Item {
+ id: root
+ property alias cancelButton: cancelButton
+ property alias okButton: okButton
+ property string message: "Message"
+ property string title: "Title"
+ property alias prompt: prompt
+
+ ColumnLayout {
+ id: columnLayout
+ anchors.topMargin: 20
+ anchors.top: parent.top
+ anchors.bottomMargin: 20
+ anchors.bottom: parent.bottom
+ anchors.rightMargin: 20
+ anchors.right: parent.right
+ anchors.leftMargin: 20
+ anchors.left: parent.left
+
+ Image {
+ id: image
+ Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
+ source: "qrc:/icon.svg"
+ }
+
+ Rectangle {
+ id: rectangle
+ width: parent.width
+ height: 30
+ Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
+ gradient: Gradient {
+ GradientStop {
+ position: 0
+ color: "#25a6e2"
+ }
+
+ GradientStop {
+ color: "#188bd0"
+ }
+ }
+
+ Text {
+ id: title
+ x: 54
+ y: 5
+ color: "#ffffff"
+ text: qsTr("Title")
+ font.pointSize: 12
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ }
+
+ Item {
+ width: 40
+ height: 40
+ }
+
+ Text {
+ id: message
+ text: root.message
+ font.pointSize: 12
+ }
+
+ TextField {
+ id: prompt
+ width: 300
+ height: 22
+ Layout.fillWidth: true
+ font.pointSize: 12
+ color: "black"
+
+ background: Rectangle {
+ color: "white"
+ border.color: "black"
+ border.width: 1
+ }
+ }
+
+ Item {
+ Layout.fillHeight: true
+ }
+
+ RowLayout {
+ id: rowLayout
+ width: 100
+ height: 100
+
+ Item {
+ Layout.fillWidth: true
+ }
+
+ CustomButton {
+ id: cancelButton
+ width: 90
+ height: 30
+ btnText: qsTr("Cancel")
+ btnBlue: false
+ }
+
+ CustomButton {
+ id: okButton
+ width: 90
+ height: 30
+ btnText: qsTr("OK")
+ btnBlue: false
+ }
+ }
+ }
+}
diff --git a/tests/manual/examples/quick/customdialogs/forms/Menu.qml b/tests/manual/examples/quick/customdialogs/forms/Menu.qml
new file mode 100644
index 000000000..b90802a0c
--- /dev/null
+++ b/tests/manual/examples/quick/customdialogs/forms/Menu.qml
@@ -0,0 +1,22 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+
+MenuForm {
+ property QtObject request
+ signal closeForm()
+
+ followLink.onClicked: closeForm()
+ back.onClicked: closeForm()
+ forward.onClicked: closeForm()
+ reload.onClicked: closeForm()
+ copyLinkUrl.onClicked: closeForm()
+ saveLink.onClicked: closeForm()
+ close.onClicked: closeForm()
+
+ Component.onCompleted: {
+ back.btnEnable = false;
+ forward.btnEnable = false;
+ }
+}
diff --git a/tests/manual/examples/quick/customdialogs/forms/MenuForm.ui.qml b/tests/manual/examples/quick/customdialogs/forms/MenuForm.ui.qml
new file mode 100644
index 000000000..b4c06bb7d
--- /dev/null
+++ b/tests/manual/examples/quick/customdialogs/forms/MenuForm.ui.qml
@@ -0,0 +1,65 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtQuick.Layouts
+
+Item {
+ property alias followLink: followLink
+ property alias back: back
+ property alias forward: forward
+ property alias reload: reload
+ property alias copyLinkUrl: copyLinkUrl
+ property alias saveLink: saveLink
+ property alias close: close
+
+ ColumnLayout {
+ id: columnLayout
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ Image {
+ id: image
+ width: 100
+ height: 100
+ Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
+ source: "qrc:/icon.svg"
+ }
+
+ CustomButton {
+ id: followLink
+ btnText: qsTr("Follow")
+ }
+
+ CustomButton {
+ id: back
+ btnText: qsTr("Back")
+ }
+
+ CustomButton {
+ id: forward
+ btnText: qsTr("Forward")
+ }
+
+ CustomButton {
+ id: reload
+ btnText: qsTr("Reload")
+ }
+
+ CustomButton {
+ id: copyLinkUrl
+ btnText: qsTr("Copy Link URL")
+ }
+
+ CustomButton {
+ id: saveLink
+ btnText: qsTr("Save Link")
+ }
+
+ CustomButton {
+ id: close
+ btnBlue: false
+ btnText: qsTr("Close")
+ }
+ }
+}
diff --git a/tests/manual/examples/quick/customdialogs/forms/TouchSelectionMenu.qml b/tests/manual/examples/quick/customdialogs/forms/TouchSelectionMenu.qml
new file mode 100644
index 000000000..1b0c19789
--- /dev/null
+++ b/tests/manual/examples/quick/customdialogs/forms/TouchSelectionMenu.qml
@@ -0,0 +1,14 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+
+TouchSelectionMenuForm {
+ property QtObject request
+ signal closeForm()
+
+ cut.onClicked: closeForm()
+ copy.onClicked: closeForm()
+ paste.onClicked: closeForm()
+ contextMenu.onClicked: closeForm()
+}
diff --git a/tests/manual/examples/quick/customdialogs/forms/TouchSelectionMenuForm.ui.qml b/tests/manual/examples/quick/customdialogs/forms/TouchSelectionMenuForm.ui.qml
new file mode 100644
index 000000000..bed39566f
--- /dev/null
+++ b/tests/manual/examples/quick/customdialogs/forms/TouchSelectionMenuForm.ui.qml
@@ -0,0 +1,39 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtQuick.Layouts
+
+Item {
+ property alias cut: cut
+ property alias copy: copy
+ property alias paste: paste
+ property alias contextMenu: contextMenu
+
+ ColumnLayout {
+ id: columnLayout
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ CustomButton {
+ id: cut
+ btnText: qsTr("Cut")
+ }
+
+ CustomButton {
+ id: copy
+ btnText: qsTr("Copy")
+ }
+
+ CustomButton {
+ id: paste
+ btnText: qsTr("Paste")
+ }
+
+ CustomButton {
+ id: contextMenu
+ btnText: qsTr("...")
+ }
+
+ }
+}
diff --git a/tests/manual/examples/quick/customdialogs/forms/forms.qmlproject b/tests/manual/examples/quick/customdialogs/forms/forms.qmlproject
new file mode 100644
index 000000000..b06afaaf1
--- /dev/null
+++ b/tests/manual/examples/quick/customdialogs/forms/forms.qmlproject
@@ -0,0 +1,45 @@
+import QmlProject
+
+Project {
+ mainFile: "MenuForm.ui.qml"
+
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+
+ JavaScriptFiles {
+ directory: "."
+ }
+
+ ImageFiles {
+ directory: "."
+ }
+
+ Files {
+ filter: "*.conf"
+ files: ["qtquickcontrols2.conf"]
+ }
+
+ Files {
+ filter: "qmldir"
+ directory: "."
+ }
+
+ Files {
+ filter: "*.ttf;*.otf"
+ }
+
+ Environment {
+ QT_QUICK_CONTROLS_CONF: "qtquickcontrols2.conf"
+ QT_AUTO_SCREEN_SCALE_FACTOR: "1"
+ }
+
+ qt6Project: true
+
+ /* List of plugin directories passed to QML runtime */
+ importPaths: [ ".", "imports" ]
+
+ /* Required for deployment */
+ targetDirectory: "/opt/forms"
+}
diff --git a/examples/webengine/customdialogs/icon.svg b/tests/manual/examples/quick/customdialogs/icon.svg
index 48271180b..48271180b 100644
--- a/examples/webengine/customdialogs/icon.svg
+++ b/tests/manual/examples/quick/customdialogs/icon.svg
diff --git a/tests/manual/examples/quick/customdialogs/index.html b/tests/manual/examples/quick/customdialogs/index.html
new file mode 100644
index 000000000..d5de2827c
--- /dev/null
+++ b/tests/manual/examples/quick/customdialogs/index.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title>Custom UI</title>
+ <link rel="stylesheet" type="text/css" href="style.css">
+ </head>
+ <body>
+ <table align="center">
+ <tr>
+ <td><div class="div"><a href="#openMenu" class="link">Right click on text to see link context menu</a></div></td>
+ </tr>
+ <tr>
+ <td><div class="div"><p title="I am a tooltip.">Hover this text to display a tooltip</a></div></td>
+ </tr>
+ <tr>
+ <td><div class="div"><p>Touch devices only: long press on this text to see the touch selection menu</p></div></td>
+ </tr>
+ <tr>
+ <td><button class="button" onclick="window.location = 'http://localhost.:5555/OPEN_AUTH'">
+ Open Authentication Dialog</button></td>
+ </tr>
+ <tr>
+ <td><button class="button" onclick="window.location = 'http://www.qt.io'">
+ Open Proxy Dialog</button></td>
+ </tr>
+ <tr>
+ <td><button class="button" onclick="alert('This is the Alert Dialog !')">
+ Open Alert Dialog</button></td>
+ </tr>
+ <tr>
+ <td><button class="button" onclick="confirm('This is the Confirm Dialog.')">
+ Open Confirm Dialog</button></td>
+ </tr>
+ <tr>
+ <td><button class="button" onclick="prompt('Is this the Prompt Dialog ?', 'Yes')">
+ Open Prompt Dialog</button></td>
+ </tr>
+ <tr>
+ <td><button class="button" onclick="document.getElementById('colorpicker').click()">
+ Open Color Dialog</button></td>
+ </tr>
+ <tr>
+ <td><button class="button" onclick="document.getElementById('filepicker').click()">
+ Open File Dialog</button></td>
+ </tr>
+ </table>
+ <input type="color" id="colorpicker" value="#ff0000" style="visibility:hidden"/>
+ <input type="file" id="filepicker" accept=".cpp, .html, .h, .png, .qdoc, .qml" style="visibility:hidden"/>
+ </body>
+</html>
diff --git a/tests/manual/examples/quick/customdialogs/main.cpp b/tests/manual/examples/quick/customdialogs/main.cpp
new file mode 100644
index 000000000..c114ea935
--- /dev/null
+++ b/tests/manual/examples/quick/customdialogs/main.cpp
@@ -0,0 +1,32 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include "server.h"
+#include <QtWebEngineQuick/qtwebenginequickglobal.h>
+#include <QNetworkProxy>
+#include <QQmlApplicationEngine>
+#include <QTimer>
+#include <QtGui/QGuiApplication>
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication::setOrganizationName("QtExamples");
+ QtWebEngineQuick::initialize();
+
+ QGuiApplication app(argc, argv);
+
+ QQmlApplicationEngine engine;
+ Server *server = new Server(&engine);
+
+ engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
+ QTimer::singleShot(0, server, &Server::run);
+
+ QNetworkProxy proxy;
+ proxy.setType(QNetworkProxy::HttpProxy);
+ proxy.setHostName("localhost");
+ proxy.setPort(5555);
+ QNetworkProxy::setApplicationProxy(proxy);
+
+ return app.exec();
+}
+
diff --git a/tests/manual/examples/quick/customdialogs/main.qml b/tests/manual/examples/quick/customdialogs/main.qml
new file mode 100644
index 000000000..d0cb6f324
--- /dev/null
+++ b/tests/manual/examples/quick/customdialogs/main.qml
@@ -0,0 +1,56 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+import QtQuick.Window
+
+Window {
+ id: mainWindow
+ width: 800
+ height: 610
+ visible: true
+
+ StackView {
+ id: stackView
+ anchors.fill: parent
+ focus: true
+ initialItem: Item {
+ id: main
+ width: mainWindow.width
+ height: mainWindow.height
+ ColumnLayout {
+ anchors.fill: parent
+ SwitchButton {
+ id: switcher
+ Layout.fillWidth: true
+ }
+ WebView {
+ id: webView
+ useDefaultDialogs: switcher.checked
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ }
+ }
+ }
+
+ function closeForm()
+ {
+ pop(main);
+ // reset url in case of proxy error
+ webView.url = "qrc:/index.html"
+ }
+
+ function openForm(form)
+ {
+ push(form.item, form.properties);
+ currentItem.closeForm.connect(closeForm);
+ }
+
+ }
+
+ Component.onCompleted: {
+ webView.openForm.connect(stackView.openForm);
+ }
+}
diff --git a/tests/manual/examples/quick/customdialogs/server.cpp b/tests/manual/examples/quick/customdialogs/server.cpp
new file mode 100644
index 000000000..efb870618
--- /dev/null
+++ b/tests/manual/examples/quick/customdialogs/server.cpp
@@ -0,0 +1,47 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include "server.h"
+#include <QDataStream>
+#include <QTcpSocket>
+
+Server::Server(QObject *parent) : QObject(parent)
+{
+ connect(&m_server, &QTcpServer::newConnection, this, &Server::handleNewConnection);
+}
+
+void Server::run()
+{
+ if (!m_server.listen(QHostAddress::LocalHost, 5555))
+ qWarning() << "Could not start the server -> http/proxy authentication dialog"
+ " will not work. Error:" << m_server.errorString();
+}
+
+void Server::handleNewConnection()
+{
+ QTcpSocket *socket = m_server.nextPendingConnection();
+ connect(socket, &QAbstractSocket::disconnected, socket, &QObject::deleteLater);
+ connect(socket, &QAbstractSocket::readyRead, this, &Server::handleReadReady);
+}
+
+void Server::handleReadReady()
+{
+ QTcpSocket *socket = qobject_cast<QTcpSocket*>(sender());
+ Q_ASSERT(socket);
+ m_data.append(socket->readAll());
+
+ // simply wait for whole request
+ if (!m_data.endsWith("\r\n\r\n"))
+ return;
+ if (m_data.contains(QByteArrayLiteral("OPEN_AUTH"))) {
+ socket->write("HTTP/1.1 401 Unauthorized\nWWW-Authenticate: "
+ "Basic realm=\"Very Restricted Area\"\r\n\r\n");
+ m_data.clear();
+ return;
+ }
+
+ socket->write("HTTP/1.1 407 Proxy Auth Required\nProxy-Authenticate: "
+ "Basic realm=\"Proxy requires authentication\"\r\n"
+ "content-length: 0\r\n\r\n");
+ m_data.clear();
+}
diff --git a/tests/manual/examples/quick/customdialogs/server.h b/tests/manual/examples/quick/customdialogs/server.h
new file mode 100644
index 000000000..563465013
--- /dev/null
+++ b/tests/manual/examples/quick/customdialogs/server.h
@@ -0,0 +1,29 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#ifndef SERVER_H
+#define SERVER_H
+
+#include <QObject>
+#include <QTcpServer>
+
+class Server : public QObject
+{
+ Q_OBJECT
+
+public:
+ explicit Server(QObject *parent = nullptr);
+
+public slots:
+ void run();
+
+private slots:
+ void handleNewConnection();
+ void handleReadReady();
+
+private:
+ QTcpServer m_server;
+ QByteArray m_data;
+};
+
+#endif // SERVER_H
diff --git a/examples/webengine/customdialogs/style.css b/tests/manual/examples/quick/customdialogs/style.css
index e4c25e7eb..e4c25e7eb 100644
--- a/examples/webengine/customdialogs/style.css
+++ b/tests/manual/examples/quick/customdialogs/style.css
diff --git a/tests/manual/examples/quick/customtouchhandle/CMakeLists.txt b/tests/manual/examples/quick/customtouchhandle/CMakeLists.txt
new file mode 100644
index 000000000..5574c28b8
--- /dev/null
+++ b/tests/manual/examples/quick/customtouchhandle/CMakeLists.txt
@@ -0,0 +1,36 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+if (NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.16)
+ project(customtouchhandle LANGUAGES CXX)
+ find_package(Qt6BuildInternals COMPONENTS STANDALONE_TEST)
+endif()
+
+qt_internal_add_manual_test(customtouchhandle
+ SOURCES main.cpp
+)
+
+set_target_properties(customtouchhandle PROPERTIES
+ WIN32_EXECUTABLE TRUE
+ MACOSX_BUNDLE TRUE
+)
+
+target_link_libraries(customtouchhandle PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::WebEngineQuick
+)
+
+# Resources:
+set(qml_resource_files
+ "main.qml"
+)
+
+qt6_add_resources(customtouchhandle "qml"
+ PREFIX
+ "/"
+ FILES
+ ${qml_resource_files}
+)
+
diff --git a/tests/manual/examples/quick/customtouchhandle/customtouchhandle.pro b/tests/manual/examples/quick/customtouchhandle/customtouchhandle.pro
new file mode 100644
index 000000000..a74ef3146
--- /dev/null
+++ b/tests/manual/examples/quick/customtouchhandle/customtouchhandle.pro
@@ -0,0 +1,10 @@
+TEMPLATE = app
+
+QT += webenginequick
+
+SOURCES += main.cpp
+
+RESOURCES += qml.qrc
+
+target.path = $$[QT_INSTALL_EXAMPLES]/webenginequick/customtouchhandle
+INSTALLS += target
diff --git a/tests/manual/examples/quick/customtouchhandle/main.cpp b/tests/manual/examples/quick/customtouchhandle/main.cpp
new file mode 100644
index 000000000..f1b70b024
--- /dev/null
+++ b/tests/manual/examples/quick/customtouchhandle/main.cpp
@@ -0,0 +1,19 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include <QGuiApplication>
+#include <QQmlApplicationEngine>
+#include <QtWebEngineQuick/qtwebenginequickglobal.h>
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication::setOrganizationName("QtExamples");
+ QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
+ QtWebEngineQuick::initialize();
+ QGuiApplication app(argc, argv);
+
+ QQmlApplicationEngine engine;
+ engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
+
+ return app.exec();
+}
diff --git a/tests/manual/examples/quick/customtouchhandle/main.qml b/tests/manual/examples/quick/customtouchhandle/main.qml
new file mode 100644
index 000000000..c40b4c73b
--- /dev/null
+++ b/tests/manual/examples/quick/customtouchhandle/main.qml
@@ -0,0 +1,96 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtQuick.Window
+import QtWebEngine
+import QtQuick.Layouts
+import QtQuick.Controls
+
+ApplicationWindow {
+ width: 1024
+ height: 750
+ visible: true
+ header: ToolBar {
+ RowLayout {
+ anchors.fill: parent
+
+ ToolButton {
+ property int itemAction: WebEngineView.Back
+ text: webEngineView.action(itemAction).text
+ enabled: webEngineView.action(itemAction).enabled
+ onClicked: webEngineView.action(itemAction).trigger()
+ icon.name: webEngineView.action(itemAction).iconName
+ display: AbstractButton.TextUnderIcon
+ }
+
+ ToolButton {
+ property int itemAction: WebEngineView.Forward
+ text: webEngineView.action(itemAction).text
+ enabled: webEngineView.action(itemAction).enabled
+ onClicked: webEngineView.action(itemAction).trigger()
+ icon.name: webEngineView.action(itemAction).iconName
+ display: AbstractButton.TextUnderIcon
+ }
+
+ ToolButton {
+ property int itemAction: webEngineView.loading ? WebEngineView.Stop : WebEngineView.Reload
+ text: webEngineView.action(itemAction).text
+ enabled: webEngineView.action(itemAction).enabled
+ onClicked: webEngineView.action(itemAction).trigger()
+ icon.name: webEngineView.action(itemAction).iconName
+ display: AbstractButton.TextUnderIcon
+ }
+
+ TextField {
+ Layout.fillWidth: true
+ text: webEngineView.url
+ selectByMouse: true
+ onEditingFinished: webEngineView.url = text
+ }
+
+ Label { text: 'Handle: ' }
+ ComboBox {
+ model: [ 'Default', 'Circle', 'Square' ]
+
+ onCurrentValueChanged: {
+ if (currentValue == 'Circle')
+ webEngineView.touchHandleDelegate = circleTouchHandle
+ else if (currentValue == 'Square')
+ webEngineView.touchHandleDelegate = rectTouchHandle
+ else
+ webEngineView.touchHandleDelegate = null
+ }
+
+ Component.onCompleted: currentIndex = indexOfValue('Square')
+ }
+ }
+ }
+
+ Component {
+ id: circleTouchHandle
+ Rectangle {
+ color: "blue"
+ border.color: "black"
+ border.width: 2
+ radius: 50
+ }
+ }
+
+ Component {
+ id: rectTouchHandle
+ Rectangle {
+ border.color: "black"
+ border.width: 2
+ radius: 2
+ onVisibleChanged: if (visible) { color = 'yellow'; cAnim.restart(); }
+ ColorAnimation on color { id: cAnim; to: 'red'; duration: 1000 }
+ }
+ }
+
+ WebEngineView {
+ anchors.fill: parent
+ id: webEngineView
+ url: "https://www.qt.io"
+ }
+}
diff --git a/examples/webengine/webengineaction/qml.qrc b/tests/manual/examples/quick/customtouchhandle/qml.qrc
index 5f6483ac3..5f6483ac3 100644
--- a/examples/webengine/webengineaction/qml.qrc
+++ b/tests/manual/examples/quick/customtouchhandle/qml.qrc
diff --git a/tests/manual/examples/quick/minimal/CMakeLists.txt b/tests/manual/examples/quick/minimal/CMakeLists.txt
new file mode 100644
index 000000000..42e2078f7
--- /dev/null
+++ b/tests/manual/examples/quick/minimal/CMakeLists.txt
@@ -0,0 +1,36 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+if (NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.16)
+ project(minimal LANGUAGES CXX)
+ find_package(Qt6BuildInternals COMPONENTS STANDALONE_TEST)
+endif()
+
+qt_internal_add_manual_test(webengine-minimal-qml
+ SOURCES
+ main.cpp
+)
+
+set_target_properties(webengine-minimal-qml PROPERTIES
+ WIN32_EXECUTABLE TRUE
+ MACOSX_BUNDLE TRUE
+)
+
+target_link_libraries(webengine-minimal-qml PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::WebEngineQuick
+)
+
+# Resources:
+set(qml_resource_files
+ "main.qml"
+)
+
+qt_add_resources(webengine-minimal-qml "qml"
+ PREFIX
+ "/"
+ FILES
+ ${qml_resource_files}
+)
diff --git a/tests/manual/examples/quick/minimal/main.cpp b/tests/manual/examples/quick/minimal/main.cpp
new file mode 100644
index 000000000..16466ae06
--- /dev/null
+++ b/tests/manual/examples/quick/minimal/main.cpp
@@ -0,0 +1,19 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include <QGuiApplication>
+#include <QQmlApplicationEngine>
+#include <QtWebEngineQuick/qtwebenginequickglobal.h>
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication::setOrganizationName("QtExamples");
+ QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
+ QtWebEngineQuick::initialize();
+ QGuiApplication app(argc, argv);
+
+ QQmlApplicationEngine engine;
+ engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
+
+ return app.exec();
+}
diff --git a/tests/manual/examples/quick/minimal/main.qml b/tests/manual/examples/quick/minimal/main.qml
new file mode 100644
index 000000000..6890b501b
--- /dev/null
+++ b/tests/manual/examples/quick/minimal/main.qml
@@ -0,0 +1,16 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtQuick.Window
+import QtWebEngine
+
+Window {
+ width: 1024
+ height: 750
+ visible: true
+ WebEngineView {
+ anchors.fill: parent
+ url: "chrome://qt"
+ }
+}
diff --git a/tests/manual/examples/quick/minimal/minimal.pro b/tests/manual/examples/quick/minimal/minimal.pro
new file mode 100644
index 000000000..acca6477c
--- /dev/null
+++ b/tests/manual/examples/quick/minimal/minimal.pro
@@ -0,0 +1,10 @@
+TEMPLATE = app
+
+QT += webenginequick
+
+SOURCES += main.cpp
+
+RESOURCES += qml.qrc
+
+target.path = $$[QT_INSTALL_EXAMPLES]/webenginequick/minimal
+INSTALLS += target
diff --git a/examples/webengine/minimal/qml.qrc b/tests/manual/examples/quick/minimal/qml.qrc
index 0ff3892d9..0ff3892d9 100644
--- a/examples/webengine/minimal/qml.qrc
+++ b/tests/manual/examples/quick/minimal/qml.qrc
diff --git a/tests/manual/examples/quick/webengineaction/CMakeLists.txt b/tests/manual/examples/quick/webengineaction/CMakeLists.txt
new file mode 100644
index 000000000..e16772faf
--- /dev/null
+++ b/tests/manual/examples/quick/webengineaction/CMakeLists.txt
@@ -0,0 +1,37 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+if (NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.16)
+ project(webengineaction LANGUAGES CXX)
+ find_package(Qt6BuildInternals COMPONENTS STANDALONE_TEST)
+endif()
+
+qt_internal_add_manual_test(webengineaction
+ SOURCES
+ main.cpp
+ utils.h
+)
+
+set_target_properties(webengineaction PROPERTIES
+ WIN32_EXECUTABLE TRUE
+ MACOSX_BUNDLE TRUE
+)
+
+target_link_libraries(webengineaction PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::WebEngineQuick
+)
+
+# Resources:
+set(qml_resource_files
+ "main.qml"
+)
+
+qt_add_resources(webengineaction "qml"
+ PREFIX
+ "/"
+ FILES
+ ${qml_resource_files}
+)
diff --git a/tests/manual/examples/quick/webengineaction/main.cpp b/tests/manual/examples/quick/webengineaction/main.cpp
new file mode 100644
index 000000000..a7bfaaf36
--- /dev/null
+++ b/tests/manual/examples/quick/webengineaction/main.cpp
@@ -0,0 +1,25 @@
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include "utils.h"
+
+#include <QGuiApplication>
+#include <QQmlApplicationEngine>
+#include <QQmlContext>
+#include <QtWebEngineQuick/qtwebenginequickglobal.h>
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication::setOrganizationName("QtExamples");
+ QtWebEngineQuick::initialize();
+
+ QGuiApplication app(argc, argv);
+
+ QQmlApplicationEngine engine;
+ Utils utils;
+
+ engine.rootContext()->setContextProperty("utils", &utils);
+ engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
+
+ return app.exec();
+}
diff --git a/tests/manual/examples/quick/webengineaction/main.qml b/tests/manual/examples/quick/webengineaction/main.qml
new file mode 100644
index 000000000..a1483b126
--- /dev/null
+++ b/tests/manual/examples/quick/webengineaction/main.qml
@@ -0,0 +1,119 @@
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtQuick.Window
+import QtWebEngine
+import QtQuick.Controls
+import QtQuick.Layouts
+
+ApplicationWindow {
+ id: window
+ visible: true
+ width: 800
+ height: 600
+ title: qsTr("WebEngineAction Example")
+
+ header: ToolBar {
+ RowLayout {
+ anchors.fill: parent
+
+ ToolButton {
+ property int itemAction: WebEngineView.Back
+ text: webEngineView.action(itemAction).text
+ enabled: webEngineView.action(itemAction).enabled
+ onClicked: webEngineView.action(itemAction).trigger()
+ icon.name: webEngineView.action(itemAction).iconName
+ display: AbstractButton.TextUnderIcon
+ }
+
+ ToolButton {
+ property int itemAction: WebEngineView.Forward
+ text: webEngineView.action(itemAction).text
+ enabled: webEngineView.action(itemAction).enabled
+ onClicked: webEngineView.action(itemAction).trigger()
+ icon.name: webEngineView.action(itemAction).iconName
+ display: AbstractButton.TextUnderIcon
+ }
+
+ ToolButton {
+ property int itemAction: webEngineView.loading ? WebEngineView.Stop : WebEngineView.Reload
+ text: webEngineView.action(itemAction).text
+ enabled: webEngineView.action(itemAction).enabled
+ onClicked: webEngineView.action(itemAction).trigger()
+ icon.name: webEngineView.action(itemAction).iconName
+ display: AbstractButton.TextUnderIcon
+ }
+
+ TextField {
+ Layout.fillWidth: true
+
+ text: webEngineView.url
+ selectByMouse: true
+ onEditingFinished: webEngineView.url = utils.fromUserInput(text)
+ }
+
+ ToolButton {
+ id: settingsButton
+ text: "Settings"
+ icon.name: "settings-configure"
+ display: AbstractButton.TextUnderIcon
+ onClicked: settingsMenu.open()
+ checked: settingsMenu.visible
+
+ Menu {
+ id: settingsMenu
+ y: settingsButton.height
+
+ MenuItem {
+ id: customContextMenuOption
+ checkable: true
+ checked: true
+
+ text: "Custom context menu"
+ }
+ }
+ }
+ }
+ }
+
+ WebEngineView {
+ id: webEngineView
+ url: "https://qt.io"
+ anchors.fill: parent
+
+ Component.onCompleted: {
+ profile.downloadRequested.connect(function(download){
+ download.accept();
+ })
+ }
+
+ property Menu contextMenu: Menu {
+ Repeater {
+ model: [
+ WebEngineView.Back,
+ WebEngineView.Forward,
+ WebEngineView.Reload,
+ WebEngineView.SavePage,
+ WebEngineView.Copy,
+ WebEngineView.Paste,
+ WebEngineView.Cut
+ ]
+ MenuItem {
+ text: webEngineView.action(modelData).text
+ enabled: webEngineView.action(modelData).enabled
+ onClicked: webEngineView.action(modelData).trigger()
+ icon.name: webEngineView.action(modelData).iconName
+ display: MenuItem.TextBesideIcon
+ }
+ }
+ }
+
+ onContextMenuRequested: function(request) {
+ if (customContextMenuOption.checked) {
+ request.accepted = true;
+ contextMenu.popup();
+ }
+ }
+ }
+}
diff --git a/tests/manual/examples/quick/webengineaction/qml.qrc b/tests/manual/examples/quick/webengineaction/qml.qrc
new file mode 100644
index 000000000..5f6483ac3
--- /dev/null
+++ b/tests/manual/examples/quick/webengineaction/qml.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/">
+ <file>main.qml</file>
+ </qresource>
+</RCC>
diff --git a/tests/manual/examples/quick/webengineaction/utils.h b/tests/manual/examples/quick/webengineaction/utils.h
new file mode 100644
index 000000000..d9a803907
--- /dev/null
+++ b/tests/manual/examples/quick/webengineaction/utils.h
@@ -0,0 +1,25 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#ifndef UTILS_H
+#define UTILS_H
+
+#include <QtCore/QFileInfo>
+#include <QtCore/QUrl>
+
+class Utils : public QObject
+{
+ Q_OBJECT
+public:
+ Q_INVOKABLE static QUrl fromUserInput(const QString &userInput);
+};
+
+inline QUrl Utils::fromUserInput(const QString &userInput)
+{
+ QFileInfo fileInfo(userInput);
+ if (fileInfo.exists())
+ return QUrl::fromLocalFile(fileInfo.absoluteFilePath());
+ return QUrl::fromUserInput(userInput);
+}
+
+#endif // UTILS_H
diff --git a/tests/manual/examples/quick/webengineaction/webengineaction.pro b/tests/manual/examples/quick/webengineaction/webengineaction.pro
new file mode 100644
index 000000000..9286604a1
--- /dev/null
+++ b/tests/manual/examples/quick/webengineaction/webengineaction.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+
+QT += webenginequick
+
+HEADERS += utils.h
+SOURCES += main.cpp
+
+RESOURCES += qml.qrc
diff --git a/tests/manual/examples/widgets/CMakeLists.txt b/tests/manual/examples/widgets/CMakeLists.txt
new file mode 100644
index 000000000..d853ba634
--- /dev/null
+++ b/tests/manual/examples/widgets/CMakeLists.txt
@@ -0,0 +1 @@
+add_subdirectory(minimal)
diff --git a/tests/manual/examples/widgets/minimal/CMakeLists.txt b/tests/manual/examples/widgets/minimal/CMakeLists.txt
new file mode 100644
index 000000000..3b39683ba
--- /dev/null
+++ b/tests/manual/examples/widgets/minimal/CMakeLists.txt
@@ -0,0 +1,24 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+if (NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.16)
+ project(minimal LANGUAGES CXX)
+ find_package(Qt6BuildInternals COMPONENTS STANDALONE_TEST)
+ endif()
+
+qt_internal_add_manual_test(minimal-widgets
+ SOURCES
+ main.cpp
+)
+
+set_target_properties(minimal-widgets PROPERTIES
+ WIN32_EXECUTABLE TRUE
+ MACOSX_BUNDLE TRUE
+)
+
+target_link_libraries(minimal-widgets PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::WebEngineWidgets
+)
diff --git a/tests/manual/examples/widgets/minimal/main.cpp b/tests/manual/examples/widgets/minimal/main.cpp
new file mode 100644
index 000000000..425973116
--- /dev/null
+++ b/tests/manual/examples/widgets/minimal/main.cpp
@@ -0,0 +1,28 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include <QApplication>
+#include <QWebEngineView>
+
+QUrl commandLineUrlArgument()
+{
+ const QStringList args = QCoreApplication::arguments();
+ for (const QString &arg : args.mid(1)) {
+ if (!arg.startsWith(QLatin1Char('-')))
+ return QUrl::fromUserInput(arg);
+ }
+ return QUrl(QStringLiteral("chrome://qt"));
+}
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication::setOrganizationName("QtExamples");
+ QApplication app(argc, argv);
+
+ QWebEngineView view;
+ view.setUrl(commandLineUrlArgument());
+ view.resize(1024, 750);
+ view.show();
+
+ return app.exec();
+}
diff --git a/examples/webenginewidgets/minimal/minimal.pro b/tests/manual/examples/widgets/minimal/minimal.pro
index 849f4b9b6..849f4b9b6 100644
--- a/examples/webenginewidgets/minimal/minimal.pro
+++ b/tests/manual/examples/widgets/minimal/minimal.pro
diff --git a/tests/manual/manual.pro b/tests/manual/manual.pro
deleted file mode 100644
index edf95846c..000000000
--- a/tests/manual/manual.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-TEMPLATE = subdirs
-
-SUBDIRS += \
- widgets \
- quick
-
-!qtHaveModule(webenginewidgets): SUBDIRS -= widgets
diff --git a/tests/manual/quick/CMakeLists.txt b/tests/manual/quick/CMakeLists.txt
new file mode 100644
index 000000000..d6c4b88a9
--- /dev/null
+++ b/tests/manual/quick/CMakeLists.txt
@@ -0,0 +1,2 @@
+add_subdirectory(touchbrowser)
+add_subdirectory(geopermission)
diff --git a/tests/manual/quick/faviconbrowser/AddressBar.qml b/tests/manual/quick/faviconbrowser/AddressBar.qml
deleted file mode 100644
index c79b74f30..000000000
--- a/tests/manual/quick/faviconbrowser/AddressBar.qml
+++ /dev/null
@@ -1,102 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.5
-import QtQuick.Controls 1.4
-import QtQuick.Controls.Styles 1.4
-
-Rectangle {
- id: root
-
- property int progress: 0
- property url iconUrl: ""
- property url pageUrl: ""
-
- signal accepted(url addressUrl)
-
- clip: true
-
- onActiveFocusChanged: {
- if (activeFocus)
- addressField.forceActiveFocus();
- }
-
- Rectangle {
- width: addressField.width / 100 * root.progress
- height: root.height
-
- visible: root.progress < 100
-
- color: "#b6dca6"
- radius: root.radius
- }
-
- TextField {
- id: addressField
- anchors.fill: parent
-
- Image {
- anchors.verticalCenter: addressField.verticalCenter
- x: 5; z: parent.z + 1
- width: 16; height: 16
- sourceSize: Qt.size(width, height)
- source: root.iconUrl
- visible: root.progress == 100
- }
-
- Text {
- text: root.progress < 0 ? "" : root.progress + "%"
- x: 5; z: parent.z + 1
- font.bold: true
- anchors.verticalCenter: parent.verticalCenter
-
- visible: root.progress < 100
- }
-
- style: TextFieldStyle {
- padding.left: 30
-
- background: Rectangle {
- color: "transparent"
- border.color: "black"
- border.width: 1
- radius: root.radius
- }
- }
-
- onActiveFocusChanged: {
- if (activeFocus)
- selectAll();
- else
- deselect();
- }
-
- text: root.pageUrl
- onAccepted: root.accepted(utils.fromUserInput(text))
- }
-}
diff --git a/tests/manual/quick/faviconbrowser/FaviconPanel.qml b/tests/manual/quick/faviconbrowser/FaviconPanel.qml
deleted file mode 100644
index 857019d9a..000000000
--- a/tests/manual/quick/faviconbrowser/FaviconPanel.qml
+++ /dev/null
@@ -1,234 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.5
-import QtQuick.Controls 1.4
-import QtQuick.Controls.Styles 1.4
-import QtQuick.Layouts 1.1
-
-Item {
- id: root
-
- property url iconUrl: ""
- property int iconSize: 128
- property int iconMinimumSize: 8
- property int iconMaximumSize: 256
-
- RowLayout {
- anchors.fill: parent
- spacing: 2
-
- Rectangle {
- Layout.fillWidth: true
- Layout.fillHeight: true
-
- RowLayout {
- anchors.fill: parent
- spacing: 2
-
- Rectangle {
- Layout.fillHeight: true
- Layout.preferredWidth: (parent.width - 2 * parent.spacing) / 3
-
- border.color: "black"
- border.width: 1
- clip: true
-
- Text {
- z: parent.z + 1
- anchors.top: parent.top
- anchors.topMargin: 5
- anchors.left: parent.left
- anchors.leftMargin: 5
- font.bold: true
-
- text: "faviconImage"
- }
-
- Image {
- id: faviconImage
- anchors.centerIn: parent
-
- width: root.iconSize
- height: width
- sourceSize: Qt.size(width, height)
-
- source: root.iconUrl
-
- onStatusChanged: {
- if (status == Image.Ready) {
- grabToImage(function(result) {
- grabImage.source = result.url;
- });
- }
-
- if (status == Image.Null)
- grabImage.source = "";
- }
- }
- }
-
- Rectangle {
- Layout.fillHeight: true
- Layout.preferredWidth: (parent.width - 2 * parent.spacing) / 3
-
- border.color: "black"
- border.width: 1
- clip: true
-
- Text {
- z: parent.z + 1
- anchors.top: parent.top
- anchors.topMargin: 5
- anchors.left: parent.left
- anchors.leftMargin: 5
- font.bold: true
-
- text: "grabImage"
- }
-
- Image {
- id: grabImage
- anchors.centerIn: parent
-
- width: root.iconSize
- height: width
-
- onStatusChanged: {
- if (status == Image.Ready || status == Image.Null)
- faviconCanvas.requestPaint();
- }
- }
- }
-
- Rectangle {
- Layout.fillHeight: true
- Layout.preferredWidth: (parent.width - 2 * parent.spacing) / 3
-
- border.color: "black"
- border.width: 1
- clip: true
-
- Text {
- z: parent.z + 1
- anchors.top: parent.top
- anchors.topMargin: 5
- anchors.left: parent.left
- anchors.leftMargin: 5
- font.bold: true
-
- text: "faviconCanvas"
- }
-
- Canvas {
- id: faviconCanvas
- anchors.centerIn: parent
-
- width: root.iconSize
- height: width
-
- onPaint: {
- var ctx = getContext("2d");
- ctx.reset();
- ctx.clearRect(0, 0, width, height);
-
- if (grabImage.source == "")
- return;
-
- ctx.drawImage(grabImage, 0, 0, width, height);
-
- var imageData = ctx.getImageData(width/2, height/2, width/2, height/2);
- var pixel = imageData.data;
-
- verbose.append("pixel(" + width/2 + ", " + height/2 + "): " + pixel[0] + ", " + pixel[1] + ", " + pixel[2]);
- }
- }
- }
- }
- }
-
- Rectangle {
- Layout.fillHeight: true
- Layout.preferredWidth: 100
-
- Slider {
- id: faviconSizeSlider
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.top: parent.top
- anchors.bottom: faviconSizeSpin.top
-
- orientation: Qt.Vertical
- minimumValue: root.iconMinimumSize
- maximumValue: root.iconMaximumSize
- stepSize: 1
- tickmarksEnabled: true
- value: root.iconSize
-
- onValueChanged: {
- if (pressed && value != root.iconSize)
- root.iconSize = value;
- }
- }
-
- SpinBox {
- id: faviconSizeSpin
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.bottom: parent.bottom
-
- minimumValue: root.iconMinimumSize
- maximumValue: root.iconMaximumSize
- value: root.iconSize
-
- onEditingFinished: {
- if (value != root.iconSize)
- root.iconSize = value;
- }
- }
- }
-
- TextArea {
- id: verbose
-
- Layout.fillHeight: true
- Layout.preferredWidth: 310
-
- readOnly: true
- tabChangesFocus: true
-
- font.family: "Monospace"
- font.pointSize: 12
-
- textFormat: TextEdit.RichText
- frameVisible: false
-
- style: TextAreaStyle {
- backgroundColor: "lightgray"
- }
- }
- }
-}
diff --git a/tests/manual/quick/faviconbrowser/faviconbrowser.pro b/tests/manual/quick/faviconbrowser/faviconbrowser.pro
deleted file mode 100644
index d4368ab3e..000000000
--- a/tests/manual/quick/faviconbrowser/faviconbrowser.pro
+++ /dev/null
@@ -1,23 +0,0 @@
-QT += qml quick webengine
-qtHaveModule(widgets) {
- QT += widgets # QApplication is required to get native styling with QtQuickControls
-}
-
-TARGET = faviconbrowser
-TEMPLATE = app
-
-
-SOURCES = \
- main.cpp
-
-HEADERS = \
- utils.h
-
-OTHER_FILES += \
- main.qml \
- AddressBar.qml \
- FaviconPanel.qml
-
-RESOURCES += \
- faviconbrowser.qrc
-
diff --git a/tests/manual/quick/faviconbrowser/faviconbrowser.qrc b/tests/manual/quick/faviconbrowser/faviconbrowser.qrc
deleted file mode 100644
index b641fa2fa..000000000
--- a/tests/manual/quick/faviconbrowser/faviconbrowser.qrc
+++ /dev/null
@@ -1,17 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
- <qresource prefix="/">
- <file>main.qml</file>
- <file>AddressBar.qml</file>
- <file>FaviconPanel.qml</file>
- </qresource>
- <qresource prefix="test">
- <file alias="favicon-multi-gray.html">../../../auto/quick/qmltests2/data/favicon-multi-gray.html</file>
- <file alias="favicon-candidates-gray.html">../../../auto/quick/qmltests2/data/favicon-candidates-gray.html</file>
- <file alias="icons/grayicons.ico">../../../auto/quick/qmltests2/data/icons/grayicons.ico</file>
- <file alias="icons/gray16.png">../../../auto/quick/qmltests2/data/icons/gray16.png</file>
- <file alias="icons/gray32.png">../../../auto/quick/qmltests2/data/icons/gray32.png</file>
- <file alias="icons/gray64.png">../../../auto/quick/qmltests2/data/icons/gray64.png</file>
- <file alias="icons/gray128.png">../../../auto/quick/qmltests2/data/icons/gray128.png</file>
- <file alias="icons/gray255.png">../../../auto/quick/qmltests2/data/icons/gray255.png</file>
- </qresource>
-</RCC>
diff --git a/tests/manual/quick/faviconbrowser/main.cpp b/tests/manual/quick/faviconbrowser/main.cpp
deleted file mode 100644
index 976d68568..000000000
--- a/tests/manual/quick/faviconbrowser/main.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "utils.h"
-
-#ifndef QT_NO_WIDGETS
-#include <QtWidgets/QApplication>
-typedef QApplication Application;
-#else
-#include <QtGui/QGuiApplication>
-typedef QGuiApplication Application;
-#endif
-#include <QtQml/QQmlApplicationEngine>
-#include <QtQml/QQmlContext>
-#include <QtWebEngine/qtwebengineglobal.h>
-
-int main(int argc, char **argv)
-{
- Application app(argc, argv);
-
- QtWebEngine::initialize();
-
- QQmlApplicationEngine appEngine;
- Utils utils;
- appEngine.rootContext()->setContextProperty("utils", &utils);
- appEngine.load(QUrl("qrc:/main.qml"));
-
- return app.exec();
-}
diff --git a/tests/manual/quick/faviconbrowser/main.qml b/tests/manual/quick/faviconbrowser/main.qml
deleted file mode 100644
index c8e2bdbd5..000000000
--- a/tests/manual/quick/faviconbrowser/main.qml
+++ /dev/null
@@ -1,170 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.5
-import QtQuick.Controls 1.4
-import QtQuick.Layouts 1.1
-import QtWebEngine 1.3
-import Qt.labs.settings 1.0
-
-ApplicationWindow {
- width: 1300
- height: 900
- visible: true
-
- Item {
- id: bookmarkUrls
-
- property url multiTest: Qt.resolvedUrl("qrc:/test/favicon-multi-gray.html")
- property url candidatesTest: Qt.resolvedUrl("qrc:/test/favicon-candidates-gray.html")
- property url aboutBlank: Qt.resolvedUrl("about:blank")
- property url qtHome: Qt.resolvedUrl("http://www.qt.io/")
- }
-
- Settings {
- id: appSettings
-
- property alias autoLoadIconsForPage: autoLoadIconsForPage.checked
- property alias touchIconsEnabled: touchIconsEnabled.checked
- }
-
- SplitView {
- anchors.fill: parent
- orientation: Qt.Vertical
-
- FaviconPanel {
- id: faviconPanel
-
- Layout.fillWidth: true
- Layout.minimumHeight: 200
-
- Layout.margins: 2
-
- iconUrl: webEngineView && webEngineView.icon
- }
-
- ColumnLayout {
- Layout.fillWidth: true
- Layout.fillHeight: true
- Layout.topMargin: 2
-
- AddressBar {
- id: addressBar
-
- Layout.fillWidth: true
- Layout.leftMargin: 5
- Layout.rightMargin: 5
- height: 25
-
- color: "white"
- radius: 4
-
- progress: webEngineView && webEngineView.loadProgress
- iconUrl: webEngineView && webEngineView.icon
- pageUrl: webEngineView && webEngineView.url
-
- onAccepted: webEngineView.url = addressUrl
- }
-
- Rectangle {
- id: toolBar
-
- Layout.fillWidth: true
- Layout.leftMargin: 5
- Layout.rightMargin: 5
- Layout.preferredHeight: 25
-
- RowLayout {
- anchors.verticalCenter: parent.verticalCenter
-
- Button {
- text: "Multi-sized Favicon Test"
- onClicked: webEngineView.url = bookmarkUrls.multiTest
- enabled: webEngineView.url != bookmarkUrls.multiTest
- }
-
- Button {
- text: "Candidate Favicons Test"
- onClicked: webEngineView.url = bookmarkUrls.candidatesTest
- enabled: webEngineView.url != bookmarkUrls.candidatesTest
- }
-
- Button {
- text: "About Blank"
- onClicked: webEngineView.url = bookmarkUrls.aboutBlank
- enabled: webEngineView.url != bookmarkUrls.aboutBlank
- }
-
- Button {
- text: "Qt Home Page"
- onClicked: webEngineView.url = bookmarkUrls.qtHome
- enabled: webEngineView.url != bookmarkUrls.qtHome
- }
- }
-
- ToolButton {
- anchors.verticalCenter: parent.verticalCenter
- anchors.right: parent.right
-
- menu: Menu {
- MenuItem {
- id: autoLoadIconsForPage
- text: "Icons On"
- checkable: true
- checked: WebEngine.settings.autoLoadIconsForPage
-
- onCheckedChanged: webEngineView.reload()
- }
-
- MenuItem {
- id: touchIconsEnabled
- text: "Touch Icons On"
- checkable: true
- checked: WebEngine.settings.touchIconsEnabled
- enabled: autoLoadIconsForPage.checked
-
- onCheckedChanged: webEngineView.reload()
- }
- }
- }
- }
-
- WebEngineView {
- id: webEngineView
-
- Layout.fillWidth: true
- Layout.fillHeight: true
-
- settings.autoLoadIconsForPage: appSettings.autoLoadIconsForPage
- settings.touchIconsEnabled: appSettings.touchIconsEnabled
-
- Component.onCompleted: webEngineView.url = bookmarkUrls.multiTest
- }
- }
- }
-}
diff --git a/tests/manual/quick/faviconbrowser/utils.h b/tests/manual/quick/faviconbrowser/utils.h
deleted file mode 100644
index 9deef0b61..000000000
--- a/tests/manual/quick/faviconbrowser/utils.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef UTILS_H
-#define UTILS_H
-
-#include <QtCore/QFileInfo>
-#include <QtCore/QUrl>
-
-class Utils : public QObject {
- Q_OBJECT
-public:
- Q_INVOKABLE static QUrl fromUserInput(const QString& userInput);
-};
-
-inline QUrl Utils::fromUserInput(const QString& userInput)
-{
- QFileInfo fileInfo(userInput);
- if (fileInfo.exists())
- return QUrl::fromLocalFile(fileInfo.absoluteFilePath());
- return QUrl::fromUserInput(userInput);
-}
-
-#endif // UTILS_H
diff --git a/tests/manual/quick/geopermission/CMakeLists.txt b/tests/manual/quick/geopermission/CMakeLists.txt
new file mode 100644
index 000000000..088f248e1
--- /dev/null
+++ b/tests/manual/quick/geopermission/CMakeLists.txt
@@ -0,0 +1,63 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+if (NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.16)
+ project(tst_geopermission LANGUAGES CXX)
+ find_package(Qt6BuildInternals COMPONENTS STANDALONE_TEST)
+endif()
+
+qt_internal_add_manual_test(tst_geopermission
+ SOURCES
+ main.cpp
+ LIBRARIES
+ Qt::Core
+ Qt::Gui
+ Qt::Qml
+ Qt::Quick
+ Qt::WebEngineQuick
+)
+
+if(WIN32)
+ set_property(
+ TARGET tst_geopermission
+ APPEND PROPERTY
+ SOURCES tst_geopermission.exe.manifest)
+endif()
+
+set_target_properties(tst_geopermission PROPERTIES
+ WIN32_EXECUTABLE TRUE
+ MACOSX_BUNDLE TRUE
+ MACOSX_BUNDLE_GUI_IDENTIFIER "io.qt.dev.webenginequick.tst_geopermission"
+)
+
+# Resources:
+set(resources_resource_files
+ "tst_geopermission.qml"
+ "geolocation.html"
+)
+
+qt_add_resources(tst_geopermission "resources"
+ PREFIX
+ "/"
+ FILES
+ ${resources_resource_files}
+)
+
+foreach(permission_plugin IN LISTS QT_ALL_PLUGINS_FOUND_BY_FIND_PACKAGE_permissions)
+ set(permission_plugin "${QT_CMAKE_EXPORT_NAMESPACE}::${permission_plugin}")
+ qt6_import_plugins(tst_geopermission INCLUDE ${permission_plugin})
+endforeach()
+
+if (APPLE)
+ set_target_properties(tst_geopermission PROPERTIES
+ MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist"
+ )
+
+ if (NOT CMAKE_GENERATOR STREQUAL "Xcode")
+ # Need to sign application for location permissions to work
+ add_custom_command(TARGET tst_geopermission
+ POST_BUILD COMMAND codesign -s - tst_geopermission.app)
+ endif()
+endif()
+
diff --git a/tests/manual/quick/geopermission/Info.plist b/tests/manual/quick/geopermission/Info.plist
new file mode 100644
index 000000000..9853e1900
--- /dev/null
+++ b/tests/manual/quick/geopermission/Info.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleName</key>
+ <string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
+ <key>CFBundleExecutable</key>
+ <string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
+ <key>CFBundleVersion</key>
+ <string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
+ <key>CFBundleShortVersionString</key>
+ <string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
+ <key>LSMinimumSystemVersion</key>
+ <string>${CMAKE_OSX_DEPLOYMENT_TARGET}</string>
+ <key>NSHumanReadableCopyright</key>
+ <string>${MACOSX_BUNDLE_COPYRIGHT}</string>
+ <key>CFBundleIconFile</key>
+ <string>${MACOSX_BUNDLE_ICON_FILE}</string>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>NSSupportsAutomaticGraphicsSwitching</key>
+ <true/>
+ <key>NSLocationUsageDescription</key>
+ <string>Geolocation test would like to give web sites access to your location for demo purposes.</string>
+</dict>
+</plist>
diff --git a/tests/manual/quick/geopermission/geolocation.html b/tests/manual/quick/geopermission/geolocation.html
new file mode 100644
index 000000000..e8c54bc58
--- /dev/null
+++ b/tests/manual/quick/geopermission/geolocation.html
@@ -0,0 +1,32 @@
+<html>
+<head>
+<title>Geolocation Permission API Test</title>
+<script>
+
+var errorMessage;
+var handled = false;
+
+function successHandler(location) {
+ var message = document.getElementById("message");
+ message.innerHTML = "Latitude: " + location.coords.latitude +
+ "<br>Longitude: " + location.coords.longitude;
+
+ errorMessage = "";
+ handled = true;
+}
+
+function errorHandler(error) {
+ errorMessage = error.message;
+ handled = true;
+}
+
+<!-- One shot example -->
+navigator.geolocation.getCurrentPosition(successHandler, errorHandler);
+
+</script>
+</head>
+<body>
+<div id="message">Location unknown</div>
+</body>
+</html>
+
diff --git a/tests/manual/quick/geopermission/main.cpp b/tests/manual/quick/geopermission/main.cpp
new file mode 100644
index 000000000..e0ff6f3e7
--- /dev/null
+++ b/tests/manual/quick/geopermission/main.cpp
@@ -0,0 +1,39 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include <QtWebEngineQuick/qtwebenginequickglobal.h>
+
+#include <QtQml/QQmlApplicationEngine>
+#include <QtQml/QQmlContext>
+#include <QQuickView>
+
+#include <QtGui/QGuiApplication>
+
+#include <QtCore/QCommandLineParser>
+#include <QtCore/QCommandLineOption>
+#include <QtCore/QLoggingCategory>
+
+int main(int argc, char **argv)
+{
+ QCoreApplication::setApplicationName("Geopermission test");
+ QCoreApplication::setOrganizationName("QtProject");
+
+ QtWebEngineQuick::initialize();
+
+ QGuiApplication app(argc, argv);
+
+ QQuickView view;
+
+ view.setTitle("Touch Browser");
+ view.setFlags(Qt::Window | Qt::WindowTitleHint);
+ view.setResizeMode(QQuickView::SizeRootObjectToView);
+ view.setSource(QUrl("qrc:/tst_geopermission.qml"));
+
+ QObject::connect(view.engine(), SIGNAL(quit()), &app, SLOT(quit()));
+
+ view.show();
+ if (view.size().isEmpty())
+ view.setGeometry(0, 0, 800, 600);
+
+ return app.exec();
+}
diff --git a/tests/manual/quick/geopermission/tst_geopermission.qml b/tests/manual/quick/geopermission/tst_geopermission.qml
new file mode 100644
index 000000000..36317c176
--- /dev/null
+++ b/tests/manual/quick/geopermission/tst_geopermission.qml
@@ -0,0 +1,28 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import QtTest
+import QtWebEngine
+
+WebEngineView {
+ id: webEngineView
+ width: 200
+ height: 200
+ url: Qt.resolvedUrl("qrc:/geolocation.html")
+ property bool deniedGeolocation: false
+ property bool geoPermissionRequested: false
+
+ onFeaturePermissionRequested: function(securityOrigin, feature) {
+ if (feature === WebEngineView.Geolocation) {
+ geoPermissionRequested = true
+ if (deniedGeolocation) {
+ webEngineView.grantFeaturePermission(securityOrigin, feature, false)
+ }
+ else {
+ webEngineView.grantFeaturePermission(securityOrigin, feature, true)
+ }
+ }
+ }
+
+}
diff --git a/tests/manual/quick/pdf/bookmarks-list.qml b/tests/manual/quick/pdf/bookmarks-list.qml
new file mode 100644
index 000000000..2be0d6848
--- /dev/null
+++ b/tests/manual/quick/pdf/bookmarks-list.qml
@@ -0,0 +1,136 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Pdf
+import QtQuick.Shapes
+
+ApplicationWindow {
+ id: root
+ width: 800
+ height: 940
+ title: doc.source
+ visible: true
+
+ property PdfDocument doc: PdfDocument { source: "test.pdf" }
+
+ Component.onCompleted: {
+ if (Application.arguments.length > 2)
+ doc.source = Application.arguments[Application.arguments.length - 1]
+ }
+ FileDialog {
+ id: fileDialog
+ title: "Open a PDF file"
+ nameFilters: [ "PDF files (*.pdf)" ]
+ onAccepted: doc.source = selectedFile
+ }
+
+ SplitView {
+ anchors.fill: parent
+
+ Pane {
+ SplitView.minimumWidth: 6
+ SplitView.preferredWidth: 200
+ clip: true
+ ListView {
+ ScrollIndicator.vertical: ScrollIndicator { }
+ anchors.fill: parent
+ delegate: ItemDelegate {
+ width: parent.width
+ text: model.title
+ background: Item { }
+ onClicked: image.currentFrame = page
+ }
+ model: PdfBookmarkModel {
+ document: root.doc
+ }
+ }
+ }
+
+ Flickable {
+ contentWidth: paper.width
+ contentHeight: paper.height
+ z: -1
+ Rectangle {
+ id: paper
+ width: image.width
+ height: image.height
+ PdfPageImage {
+ id: image
+ document: doc
+
+ property real zoomFactor: Math.sqrt(2)
+
+ Shortcut {
+ sequence: StandardKey.MoveToNextPage
+ enabled: image.currentFrame < image.frameCount - 1
+ onActivated: image.currentFrame++
+ }
+ Shortcut {
+ sequence: StandardKey.MoveToPreviousPage
+ enabled: image.currentFrame > 0
+ onActivated: image.currentFrame--
+ }
+ Shortcut {
+ sequence: StandardKey.ZoomIn
+ enabled: image.sourceSize.width < 5000
+ onActivated: {
+ image.sourceSize.width = image.implicitWidth * image.zoomFactor
+ image.sourceSize.height = image.implicitHeight * image.zoomFactor
+ }
+ }
+ Shortcut {
+ sequence: StandardKey.ZoomOut
+ enabled: image.width > 50
+ onActivated: {
+ image.sourceSize.width = image.implicitWidth / image.zoomFactor
+ image.sourceSize.height = image.implicitHeight / image.zoomFactor
+ }
+ }
+ Shortcut {
+ sequence: "Ctrl+0"
+ onActivated: image.sourceSize = undefined
+ }
+ Shortcut {
+ sequence: StandardKey.Open
+ onActivated: fileDialog.open()
+ }
+ Shortcut {
+ sequence: StandardKey.Quit
+ onActivated: Qt.quit()
+ }
+ }
+
+ Repeater {
+ model: PdfLinkModel {
+ id: linkModel
+ document: doc
+ page: image.currentFrame
+ }
+ delegate: Rectangle {
+ color: "transparent"
+ border.color: "lightgrey"
+ x: rect.x
+ y: rect.y
+ width: rect.width
+ height: rect.height
+ HoverHandler { cursorShape: Qt.PointingHandCursor }
+ TapHandler {
+ onTapped: {
+ if (page >= 0)
+ image.currentFrame = page
+ else
+ Qt.openUrlExternally(url)
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ Text {
+ anchors { bottom: parent.bottom; right: parent.right; margins: 6 }
+ text: "page " + doc.pageLabel(image.currentFrame) + " of " + doc.pageCount
+ }
+}
diff --git a/tests/manual/quick/pdf/bookmarks.qml b/tests/manual/quick/pdf/bookmarks.qml
new file mode 100644
index 000000000..e12629b31
--- /dev/null
+++ b/tests/manual/quick/pdf/bookmarks.qml
@@ -0,0 +1,147 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Pdf
+import QtQuick.Shapes
+
+ApplicationWindow {
+ id: root
+ width: 800
+ height: 940
+ color: "darkgrey"
+ title: doc.source
+ visible: true
+
+ property PdfDocument doc: PdfDocument { source: "test.pdf" }
+
+ Component.onCompleted: {
+ if (Application.arguments.length > 2)
+ doc.source = Application.arguments[Application.arguments.length - 1]
+ }
+ FileDialog {
+ id: fileDialog
+ title: "Open a PDF file"
+ nameFilters: [ "PDF files (*.pdf)" ]
+ onAccepted: doc.source = selectedFile
+ }
+
+ SplitView {
+ anchors.fill: parent
+
+ Pane {
+ SplitView.minimumWidth: 6
+ SplitView.preferredWidth: 200
+ TreeView {
+ id: bookmarksTree
+ anchors.fill: parent
+ columnWidthProvider: function() { return width }
+ onWidthChanged: forceLayout() // workaround to avoid column width getting stuck
+ clip: true
+ delegate: TreeViewDelegate {
+ width: parent.width
+ onClicked: image.currentFrame = page
+ }
+ model: PdfBookmarkModel {
+ document: root.doc
+ }
+ ScrollIndicator.vertical: ScrollIndicator {
+ // get the ScrollIndicator out into the margin area of the Pane...
+ // no need to overlap the tree when so much space is wasted anyway
+ parent: bookmarksTree.parent
+ anchors {
+ top: bookmarksTree.top
+ left: bookmarksTree.right
+ bottom: bookmarksTree.bottom
+ }
+ }
+ }
+ }
+
+ ScrollView {
+ contentWidth: paper.width
+ contentHeight: paper.height
+
+ Rectangle {
+ id: paper
+ width: image.width
+ height: image.height
+ PdfPageImage {
+ id: image
+ document: doc
+
+ property real zoomFactor: Math.sqrt(2)
+
+ Shortcut {
+ sequence: StandardKey.MoveToNextPage
+ enabled: image.currentFrame < image.frameCount - 1
+ onActivated: image.currentFrame++
+ }
+ Shortcut {
+ sequence: StandardKey.MoveToPreviousPage
+ enabled: image.currentFrame > 0
+ onActivated: image.currentFrame--
+ }
+ Shortcut {
+ sequence: StandardKey.ZoomIn
+ enabled: image.sourceSize.width < 5000
+ onActivated: {
+ image.sourceSize.width = image.implicitWidth * image.zoomFactor
+ image.sourceSize.height = image.implicitHeight * image.zoomFactor
+ }
+ }
+ Shortcut {
+ sequence: StandardKey.ZoomOut
+ enabled: image.width > 50
+ onActivated: {
+ image.sourceSize.width = image.implicitWidth / image.zoomFactor
+ image.sourceSize.height = image.implicitHeight / image.zoomFactor
+ }
+ }
+ Shortcut {
+ sequence: "Ctrl+0"
+ onActivated: image.sourceSize = undefined
+ }
+ Shortcut {
+ sequence: StandardKey.Open
+ onActivated: fileDialog.open()
+ }
+ Shortcut {
+ sequence: StandardKey.Quit
+ onActivated: Qt.quit()
+ }
+ }
+
+ Repeater {
+ model: PdfLinkModel {
+ id: linkModel
+ document: doc
+ page: image.currentFrame
+ }
+ delegate: Rectangle {
+ color: "transparent"
+ border.color: "lightgrey"
+ x: rect.x
+ y: rect.y
+ width: rect.width
+ height: rect.height
+ HoverHandler { cursorShape: Qt.PointingHandCursor }
+ TapHandler {
+ onTapped: {
+ if (page >= 0)
+ image.currentFrame = page
+ else
+ Qt.openUrlExternally(url)
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ Label {
+ anchors { bottom: parent.bottom; right: parent.right; margins: 6 }
+ text: "page " + doc.pageLabel(image.currentFrame) + " of " + doc.pageCount
+ }
+}
diff --git a/tests/manual/quick/pdf/gridview.qml b/tests/manual/quick/pdf/gridview.qml
new file mode 100644
index 000000000..773e72388
--- /dev/null
+++ b/tests/manual/quick/pdf/gridview.qml
@@ -0,0 +1,62 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+import QtQuick
+import QtQuick.Pdf
+
+Window {
+ width: 320
+ height: 440
+ color: "lightgrey"
+ title: doc.source
+ visible: true
+
+ property real cellSize: 150
+
+ PdfDocument {
+ id: doc
+ source: "test.pdf"
+ }
+
+ GridView {
+ id: view
+ anchors.fill: parent
+ anchors.margins: 10
+ model: doc.pageModel
+ cellWidth: cellSize
+ cellHeight: cellSize
+ delegate: Item {
+ required property int index
+ required property string label
+ required property size pointSize
+ width: view.cellWidth
+ height: view.cellHeight
+ Rectangle {
+ id: paper
+ width: image.width
+ height: image.height
+ x: (parent.width - width) / 2
+ y: (parent.height - height - pageNumber.height) / 2
+ PdfPageImage {
+ id: image
+ document: doc
+ currentFrame: index
+ asynchronous: true
+ fillMode: Image.PreserveAspectFit
+ property bool landscape: pointSize.width > pointSize.height
+ width: landscape ? Math.min(view.cellWidth, pointSize.width)
+ : height * pointSize.width / pointSize.height
+ height: landscape ? width * pointSize.height / pointSize.width
+ : Math.min(view.cellHeight - pageNumber.height, pointSize.height)
+ sourceSize.width: width
+ sourceSize.height: height
+ }
+ }
+ Text {
+ id: pageNumber
+ anchors.bottom: parent.bottom
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: "Page " + label
+ }
+ }
+ }
+}
diff --git a/tests/manual/quick/pdf/listview.qml b/tests/manual/quick/pdf/listview.qml
index 361ae7d89..d01be9e86 100644
--- a/tests/manual/quick/pdf/listview.qml
+++ b/tests/manual/quick/pdf/listview.qml
@@ -1,55 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-import QtQuick 2.14
-import QtQuick.Window 2.14
-import QtQuick.Pdf 5.15
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+import QtQuick
+import QtQuick.Pdf
Window {
width: 600
@@ -82,7 +34,7 @@ Window {
}
}
Text {
- text: "Page " + (image.currentFrame + 1)
+ text: "Page " + doc.pageLabel(image.currentFrame)
}
}
}
diff --git a/tests/manual/quick/pdf/multipleDocuments.qml b/tests/manual/quick/pdf/multipleDocuments.qml
new file mode 100644
index 000000000..055808ab6
--- /dev/null
+++ b/tests/manual/quick/pdf/multipleDocuments.qml
@@ -0,0 +1,182 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
+import QtQuick.Pdf
+import Qt.labs.animation
+
+ApplicationWindow {
+ id: root
+ width: 1280
+ height: 1024
+ color: "transparent"
+ flags: Qt.FramelessWindowHint
+ visibility: Window.FullScreen
+ property string source // for main.cpp
+ property real scaleStep: Math.sqrt(2)
+
+ Component {
+ id: pdfWindow
+
+ PdfPageView {
+ property alias source: document.source
+
+ Rectangle {
+ visible: parent.activeFocus
+ color: "transparent"
+ border.color: "cyan"
+ border.width: 3
+ anchors.fill: parent
+ anchors.margins: -border.width
+ anchors.topMargin: -toolbar.height - border.width
+ }
+
+ ToolBar {
+ id: toolbar
+ width: parent.width
+ y: -height
+ RowLayout {
+ anchors.fill: parent
+ anchors.rightMargin: 6
+ ToolButton {
+ action: Action {
+ shortcut: StandardKey.ZoomIn
+ enabled: pageView.sourceSize.width < 10000
+ icon.source: "../../../../examples/pdf/singlepage/resources/zoom-in.svg"
+ onTriggered: pageView.renderScale *= root.scaleStep
+ }
+ }
+ ToolButton {
+ action: Action {
+ shortcut: StandardKey.ZoomOut
+ enabled: pageView.sourceSize.width > 50
+ icon.source: "../../../../examples/pdf/singlepage/resources/zoom-out.svg"
+ onTriggered: pageView.renderScale /= root.scaleStep
+ }
+ }
+ ToolButton {
+ action: Action {
+ shortcut: "Ctrl+0"
+ icon.source: "../../../../examples/pdf/singlepage/resources/zoom-original.svg"
+ onTriggered: pageView.resetScale()
+ }
+ }
+ ToolButton {
+ action: Action {
+ icon.source: "../../../../examples/pdf/singlepage/resources/go-previous-view-page.svg"
+ enabled: pageView.backEnabled
+ onTriggered: pageView.back()
+ }
+ ToolTip.visible: enabled && hovered
+ ToolTip.delay: 2000
+ ToolTip.text: "go back"
+ }
+ SpinBox {
+ id: currentPageSB
+ from: 1
+ to: document.pageCount
+ editable: true
+ value: pageView.currentPage + 1
+ onValueModified: pageView.goToPage(value - 1)
+ Layout.maximumWidth: 60
+ }
+ ToolButton {
+ action: Action {
+ icon.source: "../../../../examples/pdf/singlepage/resources/go-next-view-page.svg"
+ enabled: pageView.forwardEnabled
+ onTriggered: pageView.forward()
+ }
+ ToolTip.visible: enabled && hovered
+ ToolTip.delay: 2000
+ ToolTip.text: "go forward"
+ }
+ Text {
+ text: document.title
+ elide: Text.ElideRight
+ Layout.fillWidth: true
+ }
+ DragHandler {
+ target: pageView
+ }
+ TapHandler {
+ onTapped: pageView.z++
+ }
+ ToolButton {
+ action: Action {
+ shortcut: StandardKey.Close
+ text: "☒"
+ onTriggered: pageView.destroy()
+ }
+ }
+ }
+ }
+
+ id: pageView
+ document: PdfDocument {
+ id: document
+ source: Qt.resolvedUrl(root.source)
+ onStatusChanged: (status) => { if (status === PdfDocument.Error) errorDialog.open() }
+ }
+
+ DragHandler {
+ acceptedButtons: Qt.MiddleButton
+ }
+ DragHandler {
+ acceptedDevices: PointerDevice.TouchScreen
+ }
+ HoverHandler {
+ onHoveredChanged: if (hovered) pageView.forceActiveFocus()
+ }
+
+ Dialog {
+ id: errorDialog
+ title: "Error loading " + document.source
+ standardButtons: Dialog.Ok
+ modal: true
+ closePolicy: Popup.CloseOnEscape
+ anchors.centerIn: parent
+ width: 300
+
+ Label {
+ id: errorField
+ text: document.error
+ }
+ }
+ }
+ }
+
+ Shortcut {
+ sequence: StandardKey.MoveToPreviousPage
+ onActivated: root.activeFocusItem.goToPage(root.activeFocusItem.currentPage - 1)
+ }
+ Shortcut {
+ sequence: StandardKey.MoveToNextPage
+ onActivated: root.activeFocusItem.goToPage(root.activeFocusItem.currentPage + 1)
+ }
+ Shortcut {
+ sequence: StandardKey.Open
+ onActivated: fileDialog.open()
+ }
+ Shortcut {
+ sequence: StandardKey.Quit
+ onActivated: Qt.quit()
+ }
+
+ function open(src) {
+ var win = pdfWindow.createObject(root, { source: src, y: 50 })
+ }
+
+ Component.onCompleted: {
+ if (Application.arguments.length > 2)
+ root.open(Application.arguments[Application.arguments.length - 1])
+ }
+
+ FileDialog {
+ id: fileDialog
+ title: "Open a PDF file"
+ nameFilters: [ "PDF files (*.pdf)" ]
+ onAccepted: root.open(selectedFile)
+ }
+}
diff --git a/tests/manual/quick/pdf/pdfPageView.qml b/tests/manual/quick/pdf/pdfPageView.qml
new file mode 100644
index 000000000..22c0d5ac2
--- /dev/null
+++ b/tests/manual/quick/pdf/pdfPageView.qml
@@ -0,0 +1,316 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
+import QtQuick.Pdf
+import Qt.labs.animation
+
+ApplicationWindow {
+ id: root
+ width: 800
+ height: 1024
+ color: "lightgrey"
+ title: document.title
+ visible: true
+ property string source // for main.cpp
+ property real scaleStep: Math.sqrt(2)
+
+ header: ToolBar {
+ RowLayout {
+ anchors.fill: parent
+ anchors.rightMargin: 6
+ ToolButton {
+ action: Action {
+ shortcut: StandardKey.Open
+ icon.source: "../../../../examples/pdf/singlepage/resources/document-open.svg"
+ onTriggered: fileDialog.open()
+ }
+ }
+ ToolButton {
+ action: Action {
+ shortcut: StandardKey.ZoomIn
+ enabled: pageView.sourceSize.width < 10000
+ icon.source: "../../../../examples/pdf/singlepage/resources/zoom-in.svg"
+ onTriggered: pageView.renderScale *= root.scaleStep
+ }
+ }
+ ToolButton {
+ action: Action {
+ shortcut: StandardKey.ZoomOut
+ enabled: pageView.sourceSize.width > 50
+ icon.source: "../../../../examples/pdf/singlepage/resources/zoom-out.svg"
+ onTriggered: pageView.renderScale /= root.scaleStep
+ }
+ }
+ ToolButton {
+ action: Action {
+ icon.source: "../../../../examples/pdf/singlepage/resources/zoom-fit-width.svg"
+ onTriggered: pageView.scaleToWidth(root.contentItem.width, root.contentItem.height)
+ }
+ }
+ ToolButton {
+ action: Action {
+ icon.source: "../../../../examples/pdf/singlepage/resources/zoom-fit-best.svg"
+ onTriggered: pageView.scaleToPage(root.contentItem.width, root.contentItem.height)
+ }
+ }
+ ToolButton {
+ action: Action {
+ shortcut: "Ctrl+0"
+ icon.source: "../../../../examples/pdf/singlepage/resources/zoom-original.svg"
+ onTriggered: pageView.resetScale()
+ }
+ }
+ ToolButton {
+ action: Action {
+ shortcut: "Ctrl+L"
+ icon.source: "../../../../examples/pdf/singlepage/resources/rotate-left.svg"
+ onTriggered: pageView.rotation -= 90
+ }
+ }
+ ToolButton {
+ action: Action {
+ shortcut: "Ctrl+R"
+ icon.source: "../../../../examples/pdf/singlepage/resources/rotate-right.svg"
+ onTriggered: pageView.rotation += 90
+ }
+ }
+ ToolButton {
+ action: Action {
+ icon.source: "../../../../examples/pdf/singlepage/resources/go-previous-view-page.svg"
+ enabled: pageView.backEnabled
+ onTriggered: pageView.back()
+ }
+ ToolTip.visible: enabled && hovered
+ ToolTip.delay: 2000
+ ToolTip.text: "go back"
+ }
+ SpinBox {
+ id: currentPageSB
+ from: 0
+ to: document.pageCount
+ editable: true
+ value: pageView.currentPage
+ onValueModified: pageView.goToPage(value)
+
+ textFromValue: function(value) { return document.pageLabel(value) }
+ valueFromText: function(text) {
+ for (var i = 0; i < document.pageCount; ++i) {
+ if (document.pageLabel(i).toLowerCase().indexOf(text.toLowerCase()) === 0)
+ return i
+ }
+ return spinBox.value
+ }
+
+ Shortcut {
+ sequence: StandardKey.MoveToPreviousPage
+ onActivated: pageView.goToPage(currentPageSB.value - 1)
+ }
+ Shortcut {
+ sequence: StandardKey.MoveToNextPage
+ onActivated: pageView.goToPage(currentPageSB.value + 1)
+ }
+ }
+ ToolButton {
+ action: Action {
+ icon.source: "../../../../examples/pdf//resources/go-next-view-page.svg"
+ enabled: pageView.forwardEnabled
+ onTriggered: pageView.forward()
+ }
+ ToolTip.visible: enabled && hovered
+ ToolTip.delay: 2000
+ ToolTip.text: "go forward"
+ }
+ ToolButton {
+ action: Action {
+ shortcut: StandardKey.Copy
+ icon.source: "../../../../examples/pdf/singlepage/resources/edit-copy.svg"
+ enabled: pageView.selectedText !== ""
+ onTriggered: pageView.copySelectionToClipboard()
+ }
+ }
+ Shortcut {
+ sequence: StandardKey.Quit
+ onActivated: Qt.quit()
+ }
+ }
+ }
+
+ FileDialog {
+ id: fileDialog
+ title: "Open a PDF file"
+ nameFilters: [ "PDF files (*.pdf)" ]
+ onAccepted: document.source = selectedFile
+ }
+
+ Component.onCompleted: {
+ if (Application.arguments.length > 2)
+ document.source = Application.arguments[Application.arguments.length - 1]
+ }
+
+ Dialog {
+ id: errorDialog
+ title: "Error loading " + document.source
+ standardButtons: Dialog.Ok
+ modal: true
+ closePolicy: Popup.CloseOnEscape
+ anchors.centerIn: parent
+ width: 300
+
+ Label {
+ id: errorField
+ text: document.error
+ }
+ }
+
+ PdfPageView {
+ id: pageView
+ x: searchDrawer.position * searchDrawer.width // TODO binding gets broken during centering
+ document: PdfDocument {
+ id: document
+ source: Qt.resolvedUrl(root.source)
+ onStatusChanged: (status) => { if (status === PdfDocument.Error) errorDialog.open() }
+ }
+ searchString: searchField.text
+ onRenderScaleChanged: pageView.returnToBounds()
+
+ DragHandler {
+ acceptedButtons: Qt.MiddleButton
+ onActiveChanged: if (!active) pageView.returnToBounds()
+ }
+ DragHandler {
+ acceptedDevices: PointerDevice.TouchScreen
+ onActiveChanged: if (!active) pageView.returnToBounds()
+ }
+
+ BoundaryRule on x {
+ id: brx
+ minimumOvershoot: 100
+ maximumOvershoot: 100
+ minimum: Math.min(0, root.width - pageView.width)
+ maximum: 0
+ }
+
+ BoundaryRule on y {
+ id: bry
+ minimumOvershoot: 100
+ maximumOvershoot: 100
+ minimum: Math.min(0, root.height - pageView.height)
+ maximum: 0
+ }
+
+ function returnToBounds() {
+ bry.returnToBounds()
+ brx.returnToBounds()
+ }
+ }
+
+ WheelHandler {
+ target: pageView
+ property: "x"
+ orientation: Qt.Horizontal
+ acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad
+ acceptedModifiers: Qt.NoModifier
+ onActiveChanged: if (!active) brx.returnToBounds()
+ }
+ WheelHandler {
+ target: pageView
+ property: "y"
+ orientation: Qt.Vertical
+ acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad
+ acceptedModifiers: Qt.NoModifier
+ onActiveChanged: if (!active) bry.returnToBounds()
+ }
+
+ Drawer {
+ id: searchDrawer
+ edge: Qt.LeftEdge
+ modal: false
+ width: searchLayout.implicitWidth
+ y: root.header.height
+ height: root.contentItem.height
+ dim: false
+ Shortcut {
+ sequence: StandardKey.Find
+ onActivated: {
+ searchDrawer.open()
+ searchField.forceActiveFocus()
+ }
+ }
+ ColumnLayout {
+ id: searchLayout
+ anchors.fill: parent
+ anchors.margins: 2
+ RowLayout {
+ ToolButton {
+ action: Action {
+ icon.source: "../../../../examples/pdf/singlepage/resources/go-up-search.svg"
+ shortcut: StandardKey.FindPrevious
+ onTriggered: pageView.searchBack()
+ }
+ ToolTip.visible: enabled && hovered
+ ToolTip.delay: 2000
+ ToolTip.text: "find previous"
+ }
+ TextField {
+ id: searchField
+ placeholderText: "search"
+ Layout.minimumWidth: 200
+ Layout.fillWidth: true
+ Image {
+ visible: searchField.text !== ""
+ source: "../../../../examples/pdf/singlepage/resources/edit-clear.svg"
+ anchors {
+ right: parent.right
+ top: parent.top
+ bottom: parent.bottom
+ margins: 3
+ rightMargin: 5
+ }
+ TapHandler {
+ onTapped: searchField.clear()
+ }
+ }
+ }
+ ToolButton {
+ action: Action {
+ icon.source: "../../../../examples/pdf/singlepage/resources/go-down-search.svg"
+ shortcut: StandardKey.FindNext
+ onTriggered: pageView.searchForward()
+ }
+ ToolTip.visible: enabled && hovered
+ ToolTip.delay: 2000
+ ToolTip.text: "find next"
+ }
+ }
+ ListView {
+ id: searchResultsList
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ clip: true
+ model: pageView.searchModel
+ ScrollBar.vertical: ScrollBar { }
+ delegate: ItemDelegate {
+ width: parent ? parent.width : 0
+ text: "page " + document.pageLabel(page) + ": " + contextBefore + pageView.searchString + contextAfter
+ highlighted: ListView.isCurrentItem
+ onClicked: {
+ searchResultsList.currentIndex = index
+ pageView.goToLocation(page, location, 0)
+ pageView.searchModel.currentResult = indexOnPage
+ }
+ }
+ }
+ }
+ }
+
+ footer: Label {
+ property size implicitPointSize: document.pagePointSize(pageView.currentPage)
+ text: "page " + (pageView.currentPage + 1) + " of " + document.pageCount +
+ " scale " + pageView.renderScale.toFixed(2) +
+ " original " + implicitPointSize.width.toFixed(1) + "x" + implicitPointSize.height.toFixed(1) + "pts"
+ visible: document.status === PdfDocument.Ready
+ }
+}
diff --git a/tests/manual/quick/pdf/pessimizedListView.qml b/tests/manual/quick/pdf/pessimizedListView.qml
index 4ae0edabe..1b514668e 100644
--- a/tests/manual/quick/pdf/pessimizedListView.qml
+++ b/tests/manual/quick/pdf/pessimizedListView.qml
@@ -1,57 +1,10 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-import QtQuick 2.14
-import QtQuick.Controls 2.14
-import QtQuick.Layouts 1.14
-import QtQuick.Pdf 5.15
-import Qt.labs.platform 1.1 as P
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
+import QtQuick.Pdf
ApplicationWindow {
width: 900
@@ -127,11 +80,11 @@ ApplicationWindow {
source: "test.pdf"
}
- P.FileDialog {
+ FileDialog {
id: fileDialog
title: "Open a PDF file"
nameFilters: [ "PDF files (*.pdf)" ]
- onAccepted: doc.source = file
+ onAccepted: doc.source = selectedFile
}
ListView {
@@ -150,15 +103,15 @@ ApplicationWindow {
anchors.centerIn: parent
running: image.status === Image.Loading
}
- Image {
+ PdfPageImage {
id: image
+ document: doc
scale: imageScale
anchors.centerIn: parent
sourceSize.width: doc.pagePointSize(index).width * oversamplingSB.value
height: 100
fillMode: Image.PreserveAspectFit
objectName: "PDF page " + index
- source: doc.source
currentFrame: index
asynchronous: asyncCB.checked
cache: cacheCB.checked
diff --git a/tests/manual/quick/pdf/simplest.qml b/tests/manual/quick/pdf/simplest.qml
index 0571493af..3f39bb213 100644
--- a/tests/manual/quick/pdf/simplest.qml
+++ b/tests/manual/quick/pdf/simplest.qml
@@ -1,53 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-import QtQuick 2.14
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+import QtQuick
Image {
id: image
diff --git a/tests/manual/quick/pdf/test.pdf b/tests/manual/quick/pdf/test.pdf
index a9dc1bc29..0832dfbed 100644
--- a/tests/manual/quick/pdf/test.pdf
+++ b/tests/manual/quick/pdf/test.pdf
Binary files differ
diff --git a/tests/manual/quick/pdf/underscoredLinks.qml b/tests/manual/quick/pdf/underscoredLinks.qml
new file mode 100644
index 000000000..514008ca2
--- /dev/null
+++ b/tests/manual/quick/pdf/underscoredLinks.qml
@@ -0,0 +1,146 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Pdf
+import QtQuick.Shapes
+
+ApplicationWindow {
+ id: root
+ width: 800
+ height: 940
+ color: "darkgrey"
+ title: doc.source
+ visible: true
+
+ property PdfDocument doc: PdfDocument { source: "test.pdf" }
+
+ Component.onCompleted: {
+ if (Application.arguments.length > 2)
+ doc.source = Application.arguments[Application.arguments.length - 1]
+ }
+ FileDialog {
+ id: fileDialog
+ title: "Open a PDF file"
+ nameFilters: [ "PDF files (*.pdf)" ]
+ onAccepted: doc.source = selectedFile
+ }
+ ScrollView {
+ anchors.fill: parent
+ contentWidth: paper.width
+ contentHeight: paper.height
+
+ Rectangle {
+ id: paper
+ width: image.width
+ height: image.height
+ PdfPageImage {
+ id: image
+ document: doc
+
+ property real zoomFactor: Math.sqrt(2)
+
+ Shortcut {
+ sequence: StandardKey.MoveToNextPage
+ enabled: image.currentFrame < image.frameCount - 1
+ onActivated: image.currentFrame++
+ }
+ Shortcut {
+ sequence: StandardKey.MoveToPreviousPage
+ enabled: image.currentFrame > 0
+ onActivated: image.currentFrame--
+ }
+ Shortcut {
+ sequence: StandardKey.ZoomIn
+ enabled: image.sourceSize.width < 5000
+ onActivated: {
+ image.sourceSize.width = image.implicitWidth * image.zoomFactor
+ image.sourceSize.height = image.implicitHeight * image.zoomFactor
+ }
+ }
+ Shortcut {
+ sequence: StandardKey.ZoomOut
+ enabled: image.width > 50
+ onActivated: {
+ image.sourceSize.width = image.implicitWidth / image.zoomFactor
+ image.sourceSize.height = image.implicitHeight / image.zoomFactor
+ }
+ }
+ Shortcut {
+ sequence: "Ctrl+0"
+ onActivated: image.sourceSize = undefined
+ }
+ Shortcut {
+ sequence: StandardKey.Open
+ onActivated: fileDialog.open()
+ }
+ Shortcut {
+ sequence: StandardKey.Quit
+ onActivated: Qt.quit()
+ }
+ }
+
+ Menu {
+ id: linkContextMenu
+ property var currentLink
+ MenuItem {
+ text: "Go"
+ onTriggered: {
+ if (linkContextMenu.currentLink.page >= 0)
+ image.currentFrame = linkContextMenu.currentLink.page
+ else
+ Qt.openUrlExternally(linkContextMenu.currentLink.url)
+ }
+ }
+ MenuItem {
+ text: "Copy"
+ onTriggered: linkContextMenu.currentLink.copyToClipboard()
+ }
+ }
+
+ Repeater {
+ model: PdfLinkModel {
+ id: linkModel
+ document: doc
+ page: image.currentFrame
+ }
+ delegate: PdfLinkDelegate {
+ x: rectangle.x
+ y: rectangle.y
+ width: rectangle.width
+ height: rectangle.height
+ onTapped:
+ (link) => {
+ if (link.page >= 0)
+ image.currentFrame = link.page
+ else
+ Qt.openUrlExternally(url)
+ }
+ onContextMenuRequested:
+ (link) => {
+ linkContextMenu.currentLink = link
+ linkContextMenu.x = x
+ linkContextMenu.y = y
+ linkContextMenu.open()
+ }
+ Shape {
+ anchors.fill: parent
+ ShapePath {
+ strokeWidth: 1
+ strokeColor: palette.link
+ strokeStyle: ShapePath.DashLine
+ dashPattern: [ 1, 4 ]
+ startX: 0; startY: height
+ PathLine { x: width; y: height }
+ }
+ }
+ }
+ }
+ }
+ }
+ Label {
+ anchors { bottom: parent.bottom; right: parent.right; margins: 6 }
+ text: "page " + (image.currentFrame + 1) + " of " + doc.pageCount
+ }
+}
diff --git a/tests/manual/quick/pdf/withdoc.qml b/tests/manual/quick/pdf/withdoc.qml
index 2d82a6abf..d4bf12e29 100644
--- a/tests/manual/quick/pdf/withdoc.qml
+++ b/tests/manual/quick/pdf/withdoc.qml
@@ -1,58 +1,10 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-import QtQuick 2.14
-import QtQuick.Controls 2.14
-import Qt.labs.platform 1.1 as Platform
-import QtQuick.Pdf 5.15
-import QtQuick.Shapes 1.14
-import QtQuick.Window 2.14
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Pdf
+import QtQuick.Shapes
Window {
width: 800
@@ -64,21 +16,42 @@ Window {
PdfDocument {
id: doc
source: "test.pdf"
+ onPasswordRequired: function() { passwordDialog.open() }
}
- Platform.FileDialog {
+ FileDialog {
id: fileDialog
title: "Open a PDF file"
nameFilters: [ "PDF files (*.pdf)" ]
- onAccepted: doc.source = file
+ onAccepted: doc.source = selectedFile
+ }
+
+ Dialog {
+ id: passwordDialog
+ title: "Password"
+ standardButtons: Dialog.Ok | Dialog.Cancel
+ modal: true
+ closePolicy: Popup.CloseOnEscape
+ anchors.centerIn: parent
+ width: 300
+
+ contentItem: TextField {
+ id: passwordField
+ placeholderText: qsTr("Please provide the password")
+ echoMode: TextInput.Password
+ width: parent.width
+ onAccepted: passwordDialog.accept()
+ }
+ onOpened: function() { passwordField.forceActiveFocus() }
+ onAccepted: doc.password = passwordField.text
}
PdfSelection {
id: selection
document: doc
page: image.currentFrame
- fromPoint: dragHandler.centroid.pressPosition
- toPoint: dragHandler.centroid.position
+ from: dragHandler.centroid.pressPosition
+ to: dragHandler.centroid.position
hold: !dragHandler.active
}
@@ -109,9 +82,9 @@ Window {
id: paper
width: image.width
height: image.height
- Image {
+ PdfPageImage {
id: image
- source: doc.status === PdfDocument.Ready ? doc.source : ""
+ document: doc
property real zoomFactor: Math.sqrt(2)
@@ -185,7 +158,7 @@ Window {
y: rect.y
width: rect.width
height: rect.height
-// HoverHandler { cursorShape: Qt.PointingHandCursor } // 5.15 onward (QTBUG-68073)
+ HoverHandler { cursorShape: Qt.PointingHandCursor }
TapHandler {
onTapped: {
if (page >= 0)
@@ -201,6 +174,6 @@ Window {
}
Text {
anchors.bottom: parent.bottom
- text: "page " + (image.currentFrame + 1) + " of " + doc.pageCount
+ text: "page " + (image.currentFrame + 1) + " of " + doc.pageCount + " label: " + doc.pageLabel(image.currentFrame)
}
}
diff --git a/tests/manual/quick/quick.pro b/tests/manual/quick/quick.pro
deleted file mode 100644
index 5251c4b42..000000000
--- a/tests/manual/quick/quick.pro
+++ /dev/null
@@ -1,4 +0,0 @@
-TEMPLATE = subdirs
-
-SUBDIRS += \
- faviconbrowser
diff --git a/tests/manual/quick/touchbrowser/AddressBar.qml b/tests/manual/quick/touchbrowser/AddressBar.qml
new file mode 100644
index 000000000..42188c94e
--- /dev/null
+++ b/tests/manual/quick/touchbrowser/AddressBar.qml
@@ -0,0 +1,73 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+import QtQuick
+import QtQuick.Controls
+
+Rectangle {
+ id: root
+
+ property int progress: 0
+ property url iconUrl: ""
+ property url pageUrl: ""
+
+ signal accepted(url addressUrl)
+
+ clip: true
+
+ onActiveFocusChanged: {
+ if (activeFocus)
+ addressField.forceActiveFocus();
+ }
+
+ Rectangle {
+ width: addressField.width / 100 * root.progress
+ height: root.height
+
+ visible: root.progress < 100
+
+ color: "#b6dca6"
+ radius: root.radius
+ }
+
+ TextField {
+ id: addressField
+ anchors.fill: parent
+ leftPadding: 30
+
+ background: Rectangle {
+ color: "transparent"
+ border.color: "black"
+ border.width: 1
+ radius: root.radius
+ }
+
+ Image {
+ anchors.verticalCenter: addressField.verticalCenter
+ x: 5; z: parent.z + 1
+ width: 16; height: 16
+ sourceSize: Qt.size(width, height)
+ source: root.iconUrl
+ visible: root.progress == 100
+ }
+
+ Text {
+ text: root.progress < 0 ? "" : root.progress + "%"
+ x: 5; z: parent.z + 1
+ font.bold: true
+ anchors.verticalCenter: parent.verticalCenter
+
+ visible: root.progress < 100
+ }
+
+ onActiveFocusChanged: {
+ if (activeFocus)
+ selectAll();
+ else
+ deselect();
+ }
+
+ text: root.pageUrl
+ onAccepted: root.accepted(utils.fromUserInput(text))
+ }
+}
diff --git a/tests/manual/quick/touchbrowser/CMakeLists.txt b/tests/manual/quick/touchbrowser/CMakeLists.txt
new file mode 100644
index 000000000..0d3275e58
--- /dev/null
+++ b/tests/manual/quick/touchbrowser/CMakeLists.txt
@@ -0,0 +1,31 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+if (NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.19)
+ project(touchbrowser LANGUAGES CXX)
+ find_package(Qt6BuildInternals COMPONENTS STANDALONE_TEST)
+endif()
+
+set(CMAKE_AUTORCC ON)
+set(TOUCHMOCKING_DIR "../../touchmocking")
+
+include_directories(${TOUCHMOCKING_DIR})
+add_definitions(-DQUICK_TOUCHBROWSER)
+
+qt_internal_add_manual_test(touchbrowser-quick
+ GUI
+ SOURCES
+ main.cpp
+ resources.qrc
+ ${TOUCHMOCKING_DIR}/touchmockingapplication.cpp
+ ${TOUCHMOCKING_DIR}/touchmockingapplication.h
+ ${TOUCHMOCKING_DIR}/utils.h
+ LIBRARIES
+ Qt::Core
+ Qt::Quick
+ Qt::WebEngineQuick
+ ENABLE_AUTOGEN_TOOLS
+ moc
+)
+
diff --git a/tests/manual/quick/touchbrowser/MockTouchPoint.qml b/tests/manual/quick/touchbrowser/MockTouchPoint.qml
new file mode 100644
index 000000000..895e12e70
--- /dev/null
+++ b/tests/manual/quick/touchbrowser/MockTouchPoint.qml
@@ -0,0 +1,26 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+import QtQuick
+
+Item {
+ id: mockTouchPoint
+
+ property bool pressed: false
+ property int pointId: 0
+
+ Image {
+ source: "qrc:/touchpoint.png"
+ x: -(width / 2)
+ y: -(height / 2)
+ opacity: mockTouchPoint.pressed ? 0.6 : 0.0
+
+ Behavior on opacity {
+ NumberAnimation { duration: 200 }
+ }
+
+ Text {
+ text: mockTouchPoint.pointId
+ anchors.centerIn: parent
+ }
+ }
+}
diff --git a/tests/manual/quick/touchbrowser/main.cpp b/tests/manual/quick/touchbrowser/main.cpp
new file mode 100644
index 000000000..1f4d7d869
--- /dev/null
+++ b/tests/manual/quick/touchbrowser/main.cpp
@@ -0,0 +1,52 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "touchmockingapplication.h"
+#include "utils.h"
+
+#include <QGuiApplication>
+#include <QQmlApplicationEngine>
+#include <QQmlContext>
+#include <QQuickView>
+#include <QtWebEngineQuick>
+
+static QUrl startupUrl()
+{
+ QUrl ret;
+ QStringList args(qApp->arguments());
+ args.takeFirst();
+ for (const QString &arg : std::as_const(args)) {
+ if (arg.startsWith(QLatin1Char('-')))
+ continue;
+ ret = Utils::fromUserInput(arg);
+ if (ret.isValid())
+ return ret;
+ }
+ return QUrl(QStringLiteral("https://www.qt.io/"));
+}
+
+int main(int argc, char **argv)
+{
+ QtWebEngineQuick::initialize();
+
+ TouchMockingApplication app(argc, argv);
+ app.setAttribute(Qt::AA_SynthesizeTouchForUnhandledMouseEvents, true);
+
+ QQuickView view;
+ Utils utils;
+ view.rootContext()->setContextProperty("utils", &utils);
+
+ view.setTitle("Touch Browser");
+ view.setFlags(Qt::Window | Qt::WindowTitleHint);
+ view.setResizeMode(QQuickView::SizeRootObjectToView);
+ view.setSource(QUrl("qrc:/main.qml"));
+
+ QObject::connect(view.engine(), SIGNAL(quit()), &app, SLOT(quit()));
+
+ view.show();
+ if (view.size().isEmpty())
+ view.setGeometry(0, 0, 800, 600);
+ QMetaObject::invokeMethod(reinterpret_cast<QObject *>(view.rootObject()), "load", Q_ARG(QVariant, startupUrl()));
+
+ return app.exec();
+}
diff --git a/tests/manual/quick/touchbrowser/main.qml b/tests/manual/quick/touchbrowser/main.qml
new file mode 100644
index 000000000..83ede7d75
--- /dev/null
+++ b/tests/manual/quick/touchbrowser/main.qml
@@ -0,0 +1,40 @@
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import QtQuick.Layouts
+import QtWebEngine
+
+Item {
+ function load(url) {
+ webEngineView.url = url;
+ }
+
+ ColumnLayout {
+ anchors.fill: parent
+
+ AddressBar {
+ id: addressBar
+
+ Layout.fillWidth: true
+ Layout.margins: 5
+ height: 25
+
+ color: "white"
+ radius: 4
+
+ progress: webEngineView && webEngineView.loadProgress
+ iconUrl: webEngineView && webEngineView.icon
+ pageUrl: webEngineView && webEngineView.url
+
+ onAccepted: webEngineView.url = addressUrl
+ }
+
+ WebEngineView {
+ id: webEngineView
+
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ }
+ }
+}
diff --git a/tests/manual/quick/touchbrowser/resources.qrc b/tests/manual/quick/touchbrowser/resources.qrc
new file mode 100644
index 000000000..87d655a27
--- /dev/null
+++ b/tests/manual/quick/touchbrowser/resources.qrc
@@ -0,0 +1,7 @@
+<RCC>
+ <qresource prefix="/">
+ <file>main.qml</file>
+ <file>AddressBar.qml</file>
+ <file alias="touchpoint.png">../../touchmocking/touchpoint.png</file>
+ </qresource>
+</RCC>
diff --git a/tests/manual/quick/touchbrowser/touchbrowser.pro b/tests/manual/quick/touchbrowser/touchbrowser.pro
new file mode 100644
index 000000000..710584df8
--- /dev/null
+++ b/tests/manual/quick/touchbrowser/touchbrowser.pro
@@ -0,0 +1,15 @@
+TEMPLATE = app
+
+DEFINES += QUICK_TOUCHBROWSER
+QT += core gui quick webenginequick
+
+INCLUDEPATH += ../../touchmocking
+
+SOURCES += \
+ main.cpp \
+ ../../touchmocking/touchmockingapplication.cpp
+HEADERS += \
+ ../../touchmocking/touchmockingapplication.h \
+ ../../touchmocking/utils.h
+
+RESOURCES += resources.qrc
diff --git a/tests/manual/touchmocking/touchmockingapplication.cpp b/tests/manual/touchmocking/touchmockingapplication.cpp
new file mode 100644
index 000000000..feedae5cd
--- /dev/null
+++ b/tests/manual/touchmocking/touchmockingapplication.cpp
@@ -0,0 +1,78 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "touchmockingapplication.h"
+
+#include <QCursor>
+#include <QEvent>
+#include <QPixmap>
+
+#if defined(QUICK_TOUCHBROWSER)
+# include <QQuickView>
+#endif
+
+#if defined(WIDGET_TOUCHBROWSER)
+# include <QMainWindow>
+#endif
+
+static inline bool isMouseEvent(QEvent *event)
+{
+ switch (event->type()) {
+ case QEvent::MouseMove:
+ case QEvent::MouseButtonPress:
+ case QEvent::MouseButtonRelease:
+ return true;
+ default:
+ return false;
+ }
+}
+
+TouchMockingApplication::TouchMockingApplication(int &argc, char **argv)
+ : Application(argc, argv), m_touchPoint(new QCursor(QPixmap(":touchpoint.png")))
+{
+}
+
+TouchMockingApplication::~TouchMockingApplication()
+{
+ delete m_touchPoint;
+}
+
+bool TouchMockingApplication::notify(QObject *target, QEvent *event)
+{
+ switch (event->type()) {
+ case QEvent::TouchBegin:
+ setOverrideCursor(*m_touchPoint);
+ break;
+ case QEvent::TouchEnd:
+ restoreCursor();
+ break;
+ default:
+ break;
+ }
+
+// All mouse events that are not accepted by the application will be translated to touch events
+// instead (see Qt::AA_SynthesizeTouchForUnhandledMouseEvents).
+#if defined(QUICK_TOUCHBROWSER)
+ if (isMouseEvent(event) && qobject_cast<QQuickView *>(target)) {
+ event->ignore();
+ return false;
+ }
+#elif defined(WIDGET_TOUCHBROWSER)
+ // Popups ignore touch evenets so we send MouseEvents directly.
+ if (isMouseEvent(event)) {
+ if (activePopupWidget()) {
+ restoreCursor();
+ } else {
+ event->ignore();
+ return false;
+ }
+ }
+#endif
+ return Application::notify(target, event);
+}
+
+void TouchMockingApplication::restoreCursor()
+{
+ while (overrideCursor())
+ restoreOverrideCursor();
+}
diff --git a/tests/manual/touchmocking/touchmockingapplication.h b/tests/manual/touchmocking/touchmockingapplication.h
new file mode 100644
index 000000000..4f6e744fc
--- /dev/null
+++ b/tests/manual/touchmocking/touchmockingapplication.h
@@ -0,0 +1,35 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef TOUCHMOCKINGAPPLICATION_H
+#define TOUCHMOCKINGAPPLICATION_H
+
+#if defined(QUICK_TOUCHBROWSER)
+# include <QGuiApplication>
+using Application = QGuiApplication;
+#elif defined(WIDGET_TOUCHBROWSER)
+# include <QApplication>
+using Application = QApplication;
+#endif
+
+QT_BEGIN_NAMESPACE
+class QCursor;
+QT_END_NAMESPACE
+
+class TouchMockingApplication : public Application
+{
+ Q_OBJECT
+
+public:
+ TouchMockingApplication(int &argc, char **argv);
+ ~TouchMockingApplication();
+
+ virtual bool notify(QObject *, QEvent *) override;
+
+private:
+ void restoreCursor();
+
+ QCursor *m_touchPoint;
+};
+
+#endif // TOUCHMOCKINGAPPLICATION_H
diff --git a/tests/manual/touchmocking/touchpoint.png b/tests/manual/touchmocking/touchpoint.png
new file mode 100644
index 000000000..7649ee991
--- /dev/null
+++ b/tests/manual/touchmocking/touchpoint.png
Binary files differ
diff --git a/tests/manual/touchmocking/utils.h b/tests/manual/touchmocking/utils.h
new file mode 100644
index 000000000..12d493d3f
--- /dev/null
+++ b/tests/manual/touchmocking/utils.h
@@ -0,0 +1,25 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef UTILS_H
+#define UTILS_H
+
+#include <QFileInfo>
+#include <QUrl>
+
+class Utils : public QObject
+{
+ Q_OBJECT
+public:
+ Q_INVOKABLE static QUrl fromUserInput(const QString &userInput);
+};
+
+inline QUrl Utils::fromUserInput(const QString &userInput)
+{
+ QFileInfo fileInfo(userInput);
+ if (fileInfo.exists())
+ return QUrl::fromLocalFile(fileInfo.absoluteFilePath());
+ return QUrl::fromUserInput(userInput);
+}
+
+#endif // UTILS_H
diff --git a/tests/manual/widgets/CMakeLists.txt b/tests/manual/widgets/CMakeLists.txt
new file mode 100644
index 000000000..7c19f9e43
--- /dev/null
+++ b/tests/manual/widgets/CMakeLists.txt
@@ -0,0 +1,9 @@
+add_subdirectory(inputmethods)
+add_subdirectory(geolocation)
+add_subdirectory(touchbrowser)
+if(QT_FEATURE_opengl)
+ add_subdirectory(webgl)
+endif()
+if(TARGET Qt6::HttpServer)
+ add_subdirectory(webrtc)
+endif()
diff --git a/tests/manual/widgets/geolocation/CMakeLists.txt b/tests/manual/widgets/geolocation/CMakeLists.txt
new file mode 100644
index 000000000..2ca8c2f52
--- /dev/null
+++ b/tests/manual/widgets/geolocation/CMakeLists.txt
@@ -0,0 +1,55 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+if (NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.16)
+ project(geolocation LANGUAGES CXX)
+ find_package(Qt6BuildInternals COMPONENTS STANDALONE_TEST)
+endif()
+
+qt_internal_add_manual_test(geolocation
+ GUI
+ SOURCES
+ main.cpp
+ LIBRARIES
+ Qt::Core
+ Qt::Gui
+ Qt::Test
+ Qt::WebEngineWidgets
+ ENABLE_AUTOGEN_TOOLS
+ moc
+)
+
+set_target_properties(geolocation PROPERTIES
+ WIN32_EXECUTABLE TRUE
+ MACOSX_BUNDLE TRUE
+ MACOSX_BUNDLE_GUI_IDENTIFIER "io.qt.dev.webenginewidgets.geolocation"
+)
+
+set(geolocation_resource_files
+ "geolocation.html"
+)
+
+qt_add_resources(geolocation "geolocation"
+ PREFIX
+ "/"
+ FILES
+ ${geolocation_resource_files}
+)
+
+ foreach(permission_plugin IN LISTS QT_ALL_PLUGINS_FOUND_BY_FIND_PACKAGE_permissions)
+ set(permission_plugin "${QT_CMAKE_EXPORT_NAMESPACE}::${permission_plugin}")
+ qt6_import_plugins(geolocation INCLUDE ${permission_plugin})
+ endforeach()
+
+if (APPLE)
+ set_target_properties(geolocation PROPERTIES
+ MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist"
+ )
+
+ if (NOT CMAKE_GENERATOR STREQUAL "Xcode")
+ # Need to sign application for location permissions to work
+ add_custom_command(TARGET geolocation
+ POST_BUILD COMMAND codesign -s - geolocation.app)
+ endif()
+endif()
diff --git a/tests/manual/widgets/geolocation/Info.plist b/tests/manual/widgets/geolocation/Info.plist
new file mode 100644
index 000000000..9853e1900
--- /dev/null
+++ b/tests/manual/widgets/geolocation/Info.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleName</key>
+ <string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
+ <key>CFBundleExecutable</key>
+ <string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
+ <key>CFBundleVersion</key>
+ <string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
+ <key>CFBundleShortVersionString</key>
+ <string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
+ <key>LSMinimumSystemVersion</key>
+ <string>${CMAKE_OSX_DEPLOYMENT_TARGET}</string>
+ <key>NSHumanReadableCopyright</key>
+ <string>${MACOSX_BUNDLE_COPYRIGHT}</string>
+ <key>CFBundleIconFile</key>
+ <string>${MACOSX_BUNDLE_ICON_FILE}</string>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>NSSupportsAutomaticGraphicsSwitching</key>
+ <true/>
+ <key>NSLocationUsageDescription</key>
+ <string>Geolocation test would like to give web sites access to your location for demo purposes.</string>
+</dict>
+</plist>
diff --git a/tests/manual/widgets/geolocation/geolocation.html b/tests/manual/widgets/geolocation/geolocation.html
new file mode 100644
index 000000000..e8c54bc58
--- /dev/null
+++ b/tests/manual/widgets/geolocation/geolocation.html
@@ -0,0 +1,32 @@
+<html>
+<head>
+<title>Geolocation Permission API Test</title>
+<script>
+
+var errorMessage;
+var handled = false;
+
+function successHandler(location) {
+ var message = document.getElementById("message");
+ message.innerHTML = "Latitude: " + location.coords.latitude +
+ "<br>Longitude: " + location.coords.longitude;
+
+ errorMessage = "";
+ handled = true;
+}
+
+function errorHandler(error) {
+ errorMessage = error.message;
+ handled = true;
+}
+
+<!-- One shot example -->
+navigator.geolocation.getCurrentPosition(successHandler, errorHandler);
+
+</script>
+</head>
+<body>
+<div id="message">Location unknown</div>
+</body>
+</html>
+
diff --git a/tests/manual/widgets/geolocation/main.cpp b/tests/manual/widgets/geolocation/main.cpp
new file mode 100644
index 000000000..f33cf5798
--- /dev/null
+++ b/tests/manual/widgets/geolocation/main.cpp
@@ -0,0 +1,51 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#include <QApplication>
+#include <QFormLayout>
+#include <QGroupBox>
+#include <QHBoxLayout>
+#include <QLabel>
+#include <QMainWindow>
+#include <QMessageBox>
+#include <QVBoxLayout>
+#include <QWebEnginePage>
+#include <QWebEngineView>
+
+class GeoPermissionWebView : public QWebEngineView {
+ Q_OBJECT
+
+public slots:
+ void handleFeaturePermissionRequested(const QUrl &securityOrigin,
+ QWebEnginePage::Feature feature)
+ {
+ qWarning("Feature Permission");
+ QString title = tr("Permission Request");
+ QString question = QLatin1String("Allow access to geolocation?");
+ if (!question.isEmpty() && QMessageBox::question(window(), title, question) == QMessageBox::Yes)
+ page()->setFeaturePermission(securityOrigin, feature,
+ QWebEnginePage::PermissionGrantedByUser);
+ else
+ page()->setFeaturePermission(securityOrigin, feature,
+ QWebEnginePage::PermissionDeniedByUser);
+ }
+
+};
+
+int main(int argc, char *argv[])
+{
+ QApplication a(argc, argv);
+ QMainWindow w;
+ GeoPermissionWebView webview;
+ QWebEnginePage page;
+ QObject::connect(&page, &QWebEnginePage::featurePermissionRequested, &webview,
+ &GeoPermissionWebView::handleFeaturePermissionRequested);
+ webview.setPage(&page);
+ page.load(QUrl("qrc:/geolocation.html"));
+ w.setCentralWidget(&webview);
+ w.show();
+
+ return a.exec();
+}
+
+#include "main.moc"
diff --git a/tests/manual/widgets/inputmethods/CMakeLists.txt b/tests/manual/widgets/inputmethods/CMakeLists.txt
new file mode 100644
index 000000000..acd5bca50
--- /dev/null
+++ b/tests/manual/widgets/inputmethods/CMakeLists.txt
@@ -0,0 +1,37 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+if (NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.16)
+ project(inputmethods LANGUAGES CXX)
+ find_package(Qt6BuildInternals COMPONENTS STANDALONE_TEST)
+endif()
+
+qt_internal_add_manual_test(inputmethods
+ GUI
+ SOURCES
+ colorpicker.cpp
+ controlview.cpp
+ main.cpp
+ referenceview.cpp
+ testview.cpp
+ webview.cpp
+ LIBRARIES
+ Qt::Core
+ Qt::Gui
+ Qt::Test
+ Qt::WebEngineWidgets
+ ENABLE_AUTOGEN_TOOLS
+ moc
+)
+
+set(inputmethods_resource_files
+ "testdata.csv"
+)
+
+qt_add_resources(inputmethods "inputmethods"
+ PREFIX
+ "/"
+ FILES
+ ${inputmethods_resource_files}
+)
diff --git a/tests/manual/widgets/inputmethods/colorpicker.cpp b/tests/manual/widgets/inputmethods/colorpicker.cpp
index f279eb418..cc0840bcd 100644
--- a/tests/manual/widgets/inputmethods/colorpicker.cpp
+++ b/tests/manual/widgets/inputmethods/colorpicker.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "colorpicker.h"
@@ -41,7 +16,6 @@ ColorPicker::ColorPicker(QWidget *parent)
m_chooseButton->setText(tr("Choose"));
QHBoxLayout *layout = new QHBoxLayout;
- layout->setMargin(0);
layout->addWidget(m_colorInput);
layout->addWidget(m_chooseButton);
setLayout(layout);
diff --git a/tests/manual/widgets/inputmethods/colorpicker.h b/tests/manual/widgets/inputmethods/colorpicker.h
index f5448ad2d..0b6b3257a 100644
--- a/tests/manual/widgets/inputmethods/colorpicker.h
+++ b/tests/manual/widgets/inputmethods/colorpicker.h
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#ifndef COLORPICKER_H
#define COLORPICKER_H
@@ -32,8 +7,10 @@
#include <QColor>
#include <QWidget>
+QT_BEGIN_NAMESPACE
class QLineEdit;
class QPushButton;
+QT_END_NAMESPACE
class ColorPicker : public QWidget
{
diff --git a/tests/manual/widgets/inputmethods/controlview.cpp b/tests/manual/widgets/inputmethods/controlview.cpp
index 4538ced4b..86bf8cca9 100644
--- a/tests/manual/widgets/inputmethods/controlview.cpp
+++ b/tests/manual/widgets/inputmethods/controlview.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "controlview.h"
@@ -69,7 +44,7 @@ ControlView::ControlView(QWidget *parent)
layout->addRow(m_sendEventButton);
setLayout(layout);
- connect(m_sendEventButton, &QPushButton::clicked, this, &ControlView::createAndSendInputMethodEvent);
+ connect(m_sendEventButton, &QPushButton::clicked, this, &ControlView::requestInputMethodEvent);
}
void ControlView::receiveInputMethodData(int start,
@@ -87,7 +62,12 @@ void ControlView::receiveInputMethodData(int start,
m_inputLine->setText(input);
}
-void ControlView::createAndSendInputMethodEvent()
+const QString ControlView::getText() const
+{
+ return m_inputLine->text();
+}
+
+const QList<QInputMethodEvent::Attribute> ControlView::getAtrributes() const
{
int start = m_startSpin->value();
int length = m_lengthSpin->value();
@@ -102,7 +82,6 @@ void ControlView::createAndSendInputMethodEvent()
QList<QInputMethodEvent::Attribute> attrs;
attrs.append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, start, length, format));
- QInputMethodEvent im(m_inputLine->text(), attrs);
- emit sendInputMethodEvent(im);
+ return attrs;
}
diff --git a/tests/manual/widgets/inputmethods/controlview.h b/tests/manual/widgets/inputmethods/controlview.h
index 0ef10f6a8..caa08593f 100644
--- a/tests/manual/widgets/inputmethods/controlview.h
+++ b/tests/manual/widgets/inputmethods/controlview.h
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#ifndef CONTROLVIEW_H
#define CONTROLVIEW_H
@@ -33,12 +8,15 @@
#include <QTextCharFormat>
#include <QWidget>
-class ColorPicker;
+QT_BEGIN_NAMESPACE
class QComboBox;
class QLabel;
class QLineEdit;
class QPushButton;
class QSpinBox;
+QT_END_NAMESPACE
+
+class ColorPicker;
class ControlView : public QWidget
{
@@ -46,12 +24,13 @@ class ControlView : public QWidget
public:
explicit ControlView(QWidget *parent = 0);
+ const QString getText() const;
+ const QList<QInputMethodEvent::Attribute> getAtrributes() const;
+
public slots:
void receiveInputMethodData(int, int, QTextCharFormat::UnderlineStyle, const QColor &, const QColor &, const QString &);
- void createAndSendInputMethodEvent();
-
signals:
- void sendInputMethodEvent(QInputMethodEvent);
+ void requestInputMethodEvent();
private:
QComboBox *m_underlineStyleCombo;
diff --git a/tests/manual/widgets/inputmethods/main.cpp b/tests/manual/widgets/inputmethods/main.cpp
index a96deb83a..2378e95ae 100644
--- a/tests/manual/widgets/inputmethods/main.cpp
+++ b/tests/manual/widgets/inputmethods/main.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include <QApplication>
#include <QFormLayout>
@@ -49,7 +24,12 @@ class MainWindow : public QMainWindow
public:
explicit MainWindow(QWidget *parent = 0);
+private slots:
+ void sendInputMethodEvents();
+
private:
+ void closeEvent(QCloseEvent *event) override;
+
ControlView *m_controlView;
ReferenceView *m_referenceView;
WebView *m_webView;
@@ -109,29 +89,44 @@ MainWindow::MainWindow(QWidget *parent)
centralLayout->addLayout(leftLayout);
centralLayout->addWidget(m_testView);
- connect(m_testView, &TestView::sendInputMethodData, m_controlView, &ControlView::receiveInputMethodData);
- connect(m_testView, &TestView::requestInputMethodEvent, m_controlView, &ControlView::createAndSendInputMethodEvent);
-
- connect(m_controlView, &ControlView::sendInputMethodEvent, [=](QInputMethodEvent im) {
- bool processed;
- QString resultText;
-
- processed = QApplication::sendEvent(m_referenceView->referenceInput(), &im);
- resultText = processed ? QStringLiteral("<font color='green'>TRUE</font>")
- : QStringLiteral("<font color='red'>FALSE</font>");
- m_referenceProcessed->setText(resultText);
-
- processed = QApplication::sendEvent(m_webView->focusProxy(), &im);
- resultText = processed ? QStringLiteral("<font color='green'>TRUE</font>")
- : QStringLiteral("<font color='red'>FALSE</font>");
- m_webProcessed->setText(resultText);
- });
+ connect(m_testView, &TestView::sendInputMethodData, m_controlView,
+ &ControlView::receiveInputMethodData);
+ connect(m_testView, &TestView::requestInputMethodEvent, this,
+ &MainWindow::sendInputMethodEvents);
+ connect(m_controlView, &ControlView::requestInputMethodEvent, this,
+ &MainWindow::sendInputMethodEvents);
centralWidget->setLayout(centralLayout);
setCentralWidget(centralWidget);
setWindowTitle(tr("Input Methods Format Manual Test"));
}
+void MainWindow::sendInputMethodEvents()
+{
+ bool processed;
+ QString resultText;
+
+ QString text = m_controlView->getText();
+ QList<QInputMethodEvent::Attribute> attrs = m_controlView->getAtrributes();
+ QInputMethodEvent im(text, attrs);
+
+ processed = QApplication::sendEvent(m_referenceView->referenceInput(), &im);
+ resultText = processed ? QStringLiteral("<font color='green'>TRUE</font>")
+ : QStringLiteral("<font color='red'>FALSE</font>");
+ m_referenceProcessed->setText(resultText);
+
+ processed = QApplication::sendEvent(m_webView->focusProxy(), &im);
+ resultText = processed ? QStringLiteral("<font color='green'>TRUE</font>")
+ : QStringLiteral("<font color='red'>FALSE</font>");
+ m_webProcessed->setText(resultText);
+}
+
+void MainWindow::closeEvent(QCloseEvent *event)
+{
+ m_testView->cancelTest();
+ QMainWindow::closeEvent(event);
+}
+
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
diff --git a/tests/manual/widgets/inputmethods/referenceview.cpp b/tests/manual/widgets/inputmethods/referenceview.cpp
index 906a3001e..27e784fbc 100644
--- a/tests/manual/widgets/inputmethods/referenceview.cpp
+++ b/tests/manual/widgets/inputmethods/referenceview.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "referenceview.h"
diff --git a/tests/manual/widgets/inputmethods/referenceview.h b/tests/manual/widgets/inputmethods/referenceview.h
index 4025d4886..d943a93d0 100644
--- a/tests/manual/widgets/inputmethods/referenceview.h
+++ b/tests/manual/widgets/inputmethods/referenceview.h
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#ifndef REFERENCEVIEW_H
#define REFERENCEVIEW_H
diff --git a/tests/manual/widgets/inputmethods/testview.cpp b/tests/manual/widgets/inputmethods/testview.cpp
index 14e355caf..d57b22cc5 100644
--- a/tests/manual/widgets/inputmethods/testview.cpp
+++ b/tests/manual/widgets/inputmethods/testview.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "testview.h"
@@ -94,11 +69,19 @@ void TestView::loadTestData(const QString &testDataPath)
testDataFile.close();
}
+void TestView::cancelTest()
+{
+ if (!m_testRunning)
+ return;
+
+ m_testRunning = false;
+ m_testButton->setText(tr("Start Test"));
+}
+
void TestView::startOrCancelTest()
{
if (m_testRunning) {
- m_testRunning = false;
- m_testButton->setText(tr("Start Test"));
+ cancelTest();
return;
}
@@ -120,10 +103,7 @@ void TestView::startOrCancelTest()
QTest::qWait(1000);
}
- if (m_testRunning) {
- m_testRunning = false;
- m_testButton->setText(tr("Start Test"));
- }
+ cancelTest();
}
void TestView::collectAndSendData()
diff --git a/tests/manual/widgets/inputmethods/testview.h b/tests/manual/widgets/inputmethods/testview.h
index 4934a5f87..b99e60d75 100644
--- a/tests/manual/widgets/inputmethods/testview.h
+++ b/tests/manual/widgets/inputmethods/testview.h
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#ifndef TESTVIEW_H
#define TESTVIEW_H
@@ -32,8 +7,10 @@
#include <QTextCharFormat>
#include <QWidget>
+QT_BEGIN_NAMESPACE
class QPushButton;
class QTableView;
+QT_END_NAMESPACE
class TestView : public QWidget
{
@@ -41,6 +18,8 @@ class TestView : public QWidget
public:
explicit TestView(QWidget *parent = 0);
+ void cancelTest();
+
public slots:
void loadTestData(const QString &);
void startOrCancelTest();
diff --git a/tests/manual/widgets/inputmethods/webview.cpp b/tests/manual/widgets/inputmethods/webview.cpp
index 62e210ecf..915d73a7f 100644
--- a/tests/manual/widgets/inputmethods/webview.cpp
+++ b/tests/manual/widgets/inputmethods/webview.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "webview.h"
#include <QWebEngineSettings>
diff --git a/tests/manual/widgets/inputmethods/webview.h b/tests/manual/widgets/inputmethods/webview.h
index be57fbf29..a46dcb2f6 100644
--- a/tests/manual/widgets/inputmethods/webview.h
+++ b/tests/manual/widgets/inputmethods/webview.h
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#ifndef WEBVIEW_H
#define WEBVIEW_H
diff --git a/tests/manual/widgets/touchbrowser/CMakeLists.txt b/tests/manual/widgets/touchbrowser/CMakeLists.txt
new file mode 100644
index 000000000..de60ad2b4
--- /dev/null
+++ b/tests/manual/widgets/touchbrowser/CMakeLists.txt
@@ -0,0 +1,30 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+if (NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.19)
+ project(touchbrowser LANGUAGES CXX)
+ find_package(Qt6BuildInternals COMPONENTS STANDALONE_TEST)
+endif()
+
+set(CMAKE_AUTORCC ON)
+set(TOUCHMOCKING_DIR "../../touchmocking")
+
+include_directories(${TOUCHMOCKING_DIR})
+add_definitions(-DWIDGET_TOUCHBROWSER)
+
+qt_internal_add_manual_test(touchbrowser-widget
+ GUI
+ SOURCES
+ main.cpp
+ resources.qrc
+ ${TOUCHMOCKING_DIR}/touchmockingapplication.cpp
+ ${TOUCHMOCKING_DIR}/touchmockingapplication.h
+ ${TOUCHMOCKING_DIR}/utils.h
+ LIBRARIES
+ Qt::Core
+ Qt::Gui
+ Qt::WebEngineWidgets
+ ENABLE_AUTOGEN_TOOLS
+ moc
+)
diff --git a/tests/manual/widgets/touchbrowser/main.cpp b/tests/manual/widgets/touchbrowser/main.cpp
new file mode 100644
index 000000000..18baf79e8
--- /dev/null
+++ b/tests/manual/widgets/touchbrowser/main.cpp
@@ -0,0 +1,62 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "touchmockingapplication.h"
+#include "utils.h"
+
+#include <QApplication>
+#include <QLineEdit>
+#include <QMainWindow>
+#include <QToolBar>
+#include <QWebEngineView>
+
+
+static QUrl startupUrl()
+{
+ QUrl ret;
+ QStringList args(qApp->arguments());
+ args.takeFirst();
+ for (const QString &arg : std::as_const(args)) {
+ if (arg.startsWith(QLatin1Char('-')))
+ continue;
+ ret = Utils::fromUserInput(arg);
+ if (ret.isValid())
+ return ret;
+ }
+ return QUrl(QStringLiteral("https://www.qt.io/"));
+}
+
+int main(int argc, char **argv)
+{
+ TouchMockingApplication app(argc, argv);
+ app.setAttribute(Qt::AA_SynthesizeTouchForUnhandledMouseEvents, true);
+
+ QMainWindow window;
+ QWebEngineView view(&window);
+ QToolBar addressBar("AddressBar", &window);
+ QLineEdit lineEdit(&addressBar);
+
+ view.setAttribute(Qt::WA_AcceptTouchEvents, true);
+ view.setUrl(startupUrl());
+ window.resize(1024, 750);
+ window.setCentralWidget(&view);
+
+ addressBar.setAttribute(Qt::WA_AcceptTouchEvents, true);
+ addressBar.setMovable(false);
+ addressBar.toggleViewAction()->setEnabled(false);
+
+ lineEdit.setAttribute(Qt::WA_AcceptTouchEvents, true);
+ lineEdit.setClearButtonEnabled(true);
+
+ addressBar.addWidget(&lineEdit);
+ QObject::connect(&lineEdit, &QLineEdit::returnPressed, [&]() {
+ QUrl url = Utils::fromUserInput(lineEdit.text());
+ lineEdit.setText(url.toDisplayString());
+ view.setUrl(url);
+ });
+
+ window.addToolBar(&addressBar);
+ window.show();
+
+ return app.exec();
+}
diff --git a/tests/manual/widgets/touchbrowser/resources.qrc b/tests/manual/widgets/touchbrowser/resources.qrc
new file mode 100644
index 000000000..b621823ea
--- /dev/null
+++ b/tests/manual/widgets/touchbrowser/resources.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/">
+ <file alias="touchpoint.png">../../touchmocking/touchpoint.png</file>
+ </qresource>
+</RCC>
diff --git a/tests/manual/widgets/touchbrowser/touchbrowser.pro b/tests/manual/widgets/touchbrowser/touchbrowser.pro
new file mode 100644
index 000000000..1587f390a
--- /dev/null
+++ b/tests/manual/widgets/touchbrowser/touchbrowser.pro
@@ -0,0 +1,15 @@
+TEMPLATE = app
+
+DEFINES += WIDGET_TOUCHBROWSER
+QT += core gui webenginewidgets
+
+INCLUDEPATH += ../../touchmocking
+
+SOURCES += \
+ main.cpp \
+ ../../touchmocking/touchmockingapplication.cpp
+HEADERS += \
+ ../../touchmocking/touchmockingapplication.h \
+ ../../touchmocking/utils.h
+
+RESOURCES += resources.qrc
diff --git a/tests/manual/widgets/webgl/CMakeLists.txt b/tests/manual/widgets/webgl/CMakeLists.txt
new file mode 100644
index 000000000..034a06a79
--- /dev/null
+++ b/tests/manual/widgets/webgl/CMakeLists.txt
@@ -0,0 +1,20 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+if (NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.16)
+ project(webgl LANGUAGES CXX)
+ find_package(Qt6BuildInternals COMPONENTS STANDALONE_TEST)
+endif()
+
+qt_internal_add_manual_test(webgl
+ GUI
+ SOURCES
+ main.cpp
+ LIBRARIES
+ Qt::Core
+ Qt::Gui
+ Qt::WebEngineWidgets
+ ENABLE_AUTOGEN_TOOLS
+ moc
+)
diff --git a/tests/manual/widgets/webgl/main.cpp b/tests/manual/widgets/webgl/main.cpp
index c18a15bac..7037c34db 100644
--- a/tests/manual/widgets/webgl/main.cpp
+++ b/tests/manual/widgets/webgl/main.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include <QtCore/QDebug>
#include <QtCore/QLoggingCategory>
diff --git a/tests/manual/widgets/webrtc/CMakeLists.txt b/tests/manual/widgets/webrtc/CMakeLists.txt
new file mode 100644
index 000000000..3f98f1fd6
--- /dev/null
+++ b/tests/manual/widgets/webrtc/CMakeLists.txt
@@ -0,0 +1,24 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+if (NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.19)
+ project(webrtc LANGUAGES CXX)
+ find_package(Qt6BuildInternals COMPONENTS STANDALONE_TEST)
+endif()
+
+set(CMAKE_AUTOUIC ON)
+set(CMAKE_AUTORCC ON)
+
+qt_internal_add_manual_test(webrtc
+ GUI
+ SOURCES
+ main.cpp
+ mediaPicker.ui
+ qrc.qrc
+ LIBRARIES
+ Qt::Core
+ Qt::HttpServer
+ Qt::Gui
+ Qt::WebEngineWidgets
+)
diff --git a/tests/manual/widgets/webrtc/index.html b/tests/manual/widgets/webrtc/index.html
new file mode 100644
index 000000000..433d643c3
--- /dev/null
+++ b/tests/manual/widgets/webrtc/index.html
@@ -0,0 +1,86 @@
+<!doctype html>
+<html>
+ <head>
+ <style>
+ body {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-wrap: wrap;
+ flex-flow: column;
+ }
+ buttons {
+ justify-content: space-around;
+ }
+ </style>
+ </head>
+ <body>
+ <div id="buttons" >
+ <input value ="getDisplayMedia" onclick="getDisplayMedia(true, true);" type="button">
+ <input value = "chooseDesktopMedia" onclick="chooseDesktopMedia();" type="button">
+ <input value ="Stop" onclick="stop();" type="button">
+ </div>
+ <div id="content"></div>
+ </body>
+ <script>
+ const EXTENSION_ID = "nkeimhogjdpnpccoofpliimaahmaaome"; // hangout services extension
+ const content = document.getElementById("content");
+ const video = document.createElement("video");
+ video.setAttribute("width", 640);
+ video.setAttribute("height", 640);
+ video.setAttribute("style", "background-color: black;");
+ content.appendChild(video);
+
+ async function getDisplayMedia(v = true, a = true) {
+ stop();
+ navigator.mediaDevices.getDisplayMedia({ video: v, audio: a })
+ .then(stream => {
+ start(stream);
+ }, error => {
+ console.error(error);
+ });
+ }
+
+ function chooseDesktopMedia() {
+ stop();
+ // Connect to the 'chooseDesktopMedia' listener within the hangout services extension.
+ let port = chrome.runtime.connect(EXTENSION_ID, {name: "chooseDesktopMedia"})
+
+ // The 'chooseDesktopMedia' api returns a streamId that
+ // identifies a media source in the constraints of 'getUserMedia'
+ // (see chromeMediaSourceId)
+ port.onMessage.addListener(result => {
+ navigator.mediaDevices.getUserMedia({
+ video: {
+ mandatory: {
+ chromeMediaSource: "desktop",
+ chromeMediaSourceId: result.value.streamId
+ },
+ }
+ }).then(stream => {
+ start(stream);
+ }, error => {
+ console.error(error);
+ })
+ })
+
+ // Trigger the listener on the other side,
+ // we should see the picker dialog after this call.
+ port.postMessage({method: "chooseDesktopMedia"})
+ }
+
+ function stop() {
+ if (video.srcObject)
+ for (const track of video.srcObject.getTracks())
+ track.stop()
+ video.srcObject = null;
+ video.setAttribute("style", "background-color: black;");
+ }
+
+ function start(stream) {
+ video.srcObject = stream;
+ video.play();
+ }
+
+ </script>
+</html>
diff --git a/tests/manual/widgets/webrtc/main.cpp b/tests/manual/widgets/webrtc/main.cpp
new file mode 100644
index 000000000..328e4ae36
--- /dev/null
+++ b/tests/manual/widgets/webrtc/main.cpp
@@ -0,0 +1,112 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include <QApplication>
+#include <QByteArray>
+#include <QDialog>
+#include <QFile>
+#include <QHttpServer>
+#include <QListView>
+#include <QMessageBox>
+#include <QWebEnginePage>
+#include <QWebEngineProfile>
+#include <QWebEngineSettings>
+#include <QWebEngineView>
+
+#include "ui_mediaPicker.h"
+#include <QWebEngineDesktopMediaRequest>
+
+// Test the screen/window selection and capturing APIs using QWebEngineDesktopMediaRequest,
+// getDisplayMedia (js) and chooseDesktopMedia (hangouts)
+
+// Note: Wayland compositors require Pipewire support in QWE
+
+class Page : public QWebEnginePage
+{
+ Q_OBJECT
+
+public:
+ Page(QWebEngineProfile *profile, QObject *parent = nullptr);
+private slots:
+ void handlePermissionRequest(const QUrl &origin, Feature feature);
+ void handleDesktopMediaRequest(const QWebEngineDesktopMediaRequest &request);
+};
+
+Page::Page(QWebEngineProfile *profile, QObject *parent) : QWebEnginePage(profile, parent)
+{
+ settings()->setAttribute(QWebEngineSettings::ScreenCaptureEnabled, true);
+ connect(this, &QWebEnginePage::featurePermissionRequested, this,
+ &Page::handlePermissionRequest);
+ connect(this, &QWebEnginePage::desktopMediaRequested, this, &Page::handleDesktopMediaRequest);
+}
+
+void Page::handlePermissionRequest(const QUrl &origin, Feature feature)
+{
+ if (QMessageBox::question(QApplication::activeWindow(), tr("Permission request"),
+ tr("allow access?"))
+ == QMessageBox::Yes)
+ setFeaturePermission(origin, feature, PermissionGrantedByUser);
+ else
+ setFeaturePermission(origin, feature, PermissionDeniedByUser);
+}
+
+void Page::handleDesktopMediaRequest(const QWebEngineDesktopMediaRequest &request)
+{
+ Ui::MediaPickerDialog mediaPickerDialog;
+ QDialog dialog;
+ dialog.setModal(true);
+ mediaPickerDialog.setupUi(&dialog);
+
+ auto *screensView = mediaPickerDialog.screensView;
+ auto *windowsView = mediaPickerDialog.windowsView;
+ auto *screensModel = request.screensModel();
+ auto *windowsModel = request.windowsModel();
+
+ screensView->setModel(screensModel);
+ windowsView->setModel(windowsModel);
+
+ if (dialog.exec() == QDialog::Accepted) {
+ if (mediaPickerDialog.tabWidget->currentIndex() == 0)
+ request.selectWindow(windowsView->selectionModel()->selectedIndexes().first());
+ else
+ request.selectScreen(screensView->selectionModel()->selectedIndexes().first());
+ } else {
+ request.cancel();
+ }
+}
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QHttpServer server;
+
+ QFile file(":index.html");
+
+ if (!file.open(QIODeviceBase::ReadOnly)) {
+ qWarning("failed to open file!");
+ return 0;
+ }
+
+ QByteArray data = file.readAll();
+ if (data.isEmpty()) {
+ qWarning("failed to read file!");
+ return 0;
+ }
+
+ server.route("/index.html", [data]() {
+ return data;
+ });
+
+ server.listen(QHostAddress::Any, 3000);
+
+ QWebEngineView view;
+ Page *page = new Page(QWebEngineProfile::defaultProfile(), &view);
+ view.setPage(page);
+ view.resize(1024, 750);
+ view.setUrl(QUrl("http://localhost:3000/index.html"));
+ view.show();
+ return app.exec();
+}
+
+#include "main.moc"
diff --git a/tests/manual/widgets/webrtc/mediaPicker.ui b/tests/manual/widgets/webrtc/mediaPicker.ui
new file mode 100644
index 000000000..8bfab3f9b
--- /dev/null
+++ b/tests/manual/widgets/webrtc/mediaPicker.ui
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MediaPickerDialog</class>
+ <widget class="QDialog" name="MediaPickerDialog">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>500</width>
+ <height>400</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Choose what to share</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QTabWidget" name="tabWidget">
+ <property name="styleSheet">
+ <string notr="true"/>
+ </property>
+ <property name="currentIndex">
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="windows">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="contextMenuPolicy">
+ <enum>Qt::NoContextMenu</enum>
+ </property>
+ <property name="styleSheet">
+ <string notr="true"/>
+ </property>
+ <attribute name="title">
+ <string>Windows</string>
+ </attribute>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QListView" name="windowsView"/>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="screens">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="contextMenuPolicy">
+ <enum>Qt::NoContextMenu</enum>
+ </property>
+ <attribute name="title">
+ <string>Screens</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_3">
+ <item>
+ <widget class="QListView" name="screensView"/>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>MediaPickerDialog</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>248</x>
+ <y>254</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>157</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>MediaPickerDialog</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>316</x>
+ <y>260</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/tests/manual/widgets/webrtc/qrc.qrc b/tests/manual/widgets/webrtc/qrc.qrc
new file mode 100644
index 000000000..c3322b454
--- /dev/null
+++ b/tests/manual/widgets/webrtc/qrc.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/">
+ <file>index.html</file>
+ </qresource>
+</RCC>
diff --git a/tests/manual/widgets/widgets.pro b/tests/manual/widgets/widgets.pro
deleted file mode 100644
index 34e88f0e3..000000000
--- a/tests/manual/widgets/widgets.pro
+++ /dev/null
@@ -1,5 +0,0 @@
-TEMPLATE= subdirs
-
-SUBDIRS += \
- inputmethods \
- webgl
diff --git a/tests/quicktestbrowser/ApplicationRoot.qml b/tests/quicktestbrowser/ApplicationRoot.qml
deleted file mode 100644
index a2e83e1e6..000000000
--- a/tests/quicktestbrowser/ApplicationRoot.qml
+++ /dev/null
@@ -1,68 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.1
-import QtWebEngine 1.1
-
-QtObject {
- id: root
-
- property bool thirdPartyCookiesEnabled: true
-
- property QtObject testProfile: WebEngineProfile {
- storageName: "Test"
- }
-
- property QtObject otrProfile: WebEngineProfile {
- offTheRecord: true
- }
-
- property Component browserWindowComponent: BrowserWindow {
- applicationRoot: root
- onClosing: destroy()
- }
- property Component browserDialogComponent: BrowserDialog {
- onClosing: destroy()
- }
- function createWindow(profile) {
- var newWindow = browserWindowComponent.createObject(root)
- newWindow.currentWebView.profile = profile
- profile.downloadRequested.connect(newWindow.onDownloadRequested)
- profile.presentNotification.connect(newWindow.onPresentNotification)
- return newWindow
- }
- function createDialog(profile) {
- var newDialog = browserDialogComponent.createObject(root)
- newDialog.currentWebView.profile = profile
- return newDialog
- }
- function load(url) {
- var browserWindow = createWindow(testProfile)
- browserWindow.currentWebView.url = url
- }
-}
diff --git a/tests/quicktestbrowser/BrowserDialog.qml b/tests/quicktestbrowser/BrowserDialog.qml
deleted file mode 100644
index 9f286125e..000000000
--- a/tests/quicktestbrowser/BrowserDialog.qml
+++ /dev/null
@@ -1,44 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.1
-import QtQuick.Window 2.2
-import QtWebEngine 1.1
-
-Window {
- property alias currentWebView: webView
- flags: Qt.Dialog
- width: 800
- height: 600
- visible: true
- onClosing: destroy()
- WebEngineView {
- id: webView
- anchors.fill: parent
- }
-}
diff --git a/tests/quicktestbrowser/BrowserWindow.qml b/tests/quicktestbrowser/BrowserWindow.qml
deleted file mode 100644
index 6c3c160ac..000000000
--- a/tests/quicktestbrowser/BrowserWindow.qml
+++ /dev/null
@@ -1,532 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.1
-import QtWebEngine 1.2
-
-import QtQuick.Controls 1.0
-import QtQuick.Controls.Styles 1.0
-import QtQuick.Layouts 1.0
-import QtQuick.Window 2.1
-import QtQuick.Controls.Private 1.0
-import Qt.labs.settings 1.0
-import QtQuick.Dialogs 1.2
-
-ApplicationWindow {
- id: browserWindow
- property QtObject applicationRoot
- property Item currentWebView: tabs.currentIndex < tabs.count ? tabs.getTab(tabs.currentIndex).item.webView : null
- property int previousVisibility: Window.Windowed
-
- property bool isFullScreen: visibility == Window.FullScreen
- onIsFullScreenChanged: {
- // This is for the case where the system forces us to leave fullscreen.
- if (currentWebView && !isFullScreen) {
- currentWebView.state = ""
- if (currentWebView.isFullScreen) {
- currentWebView.fullScreenCancelled()
- fullScreenNotification.hide()
- }
- }
- }
-
- height: 600
- width: 800
- visible: true
- title: currentWebView && currentWebView.title
-
- Settings {
- id : appSettings
- property alias autoLoadImages: loadImages.checked;
- property alias javaScriptEnabled: javaScriptEnabled.checked;
- property alias errorPageEnabled: errorPageEnabled.checked;
- property alias pluginsEnabled: pluginsEnabled.checked;
- property alias thirdPartyCookiesEnabled: thirdPartyCookiesEnabled.checked;
- }
-
- // Make sure the Qt.WindowFullscreenButtonHint is set on OS X.
- Component.onCompleted: flags = flags | Qt.WindowFullscreenButtonHint
-
- // Create a styleItem to determine the platform.
- // When using style "mac", ToolButtons are not supposed to accept focus.
- StyleItem { id: styleItem }
- property bool platformIsMac: styleItem.style == "mac"
-
- Action {
- shortcut: "Ctrl+D"
- onTriggered: {
- downloadView.visible = !downloadView.visible
- }
- }
-
- Action {
- id: focus
- shortcut: "Ctrl+L"
- onTriggered: {
- addressBar.forceActiveFocus();
- addressBar.selectAll();
- }
- }
- Action {
- shortcut: "Ctrl+R"
- onTriggered: {
- if (currentWebView)
- currentWebView.reload()
- }
- }
- Action {
- shortcut: "Ctrl+T"
- onTriggered: {
- tabs.createEmptyTab(currentWebView.profile)
- tabs.currentIndex = tabs.count - 1
- addressBar.forceActiveFocus();
- addressBar.selectAll();
- }
- }
- Action {
- shortcut: "Ctrl+W"
- onTriggered: {
- if (tabs.count == 1)
- browserWindow.close()
- else
- tabs.removeTab(tabs.currentIndex)
- }
- }
-
- Action {
- shortcut: "Escape"
- onTriggered: {
- if (browserWindow.isFullScreen)
- browserWindow.visibility = browserWindow.previousVisibility
- }
- }
- Action {
- shortcut: "Ctrl+0"
- onTriggered: zoomController.reset()
- }
- Action {
- shortcut: "Ctrl+-"
- onTriggered: zoomController.zoomOut()
- }
- Action {
- shortcut: "Ctrl+="
- onTriggered: zoomController.zoomIn()
- }
-
- Menu {
- id: backHistoryMenu
-
- Instantiator {
- model: currentWebView && currentWebView.navigationHistory.backItems
- MenuItem {
- text: model.title
- onTriggered: currentWebView.goBackOrForward(model.offset)
- }
-
- onObjectAdded: backHistoryMenu.insertItem(index, object)
- onObjectRemoved: backHistoryMenu.removeItem(object)
- }
- }
-
- Menu {
- id: forwardHistoryMenu
-
- Instantiator {
- model: currentWebView && currentWebView.navigationHistory.forwardItems
- MenuItem {
- text: model.title
- onTriggered: currentWebView.goBackOrForward(model.offset)
- }
-
- onObjectAdded: forwardHistoryMenu.insertItem(index, object)
- onObjectRemoved: forwardHistoryMenu.removeItem(object)
- }
- }
-
- toolBar: ToolBar {
- id: navigationBar
- RowLayout {
- anchors.fill: parent;
- ButtonWithMenu {
- id: backButton
- iconSource: "icons/go-previous.png"
- enabled: currentWebView && currentWebView.canGoBack
- activeFocusOnTab: !browserWindow.platformIsMac
- onClicked: currentWebView.goBack()
- longPressMenu: backHistoryMenu
- }
- ButtonWithMenu {
- id: forwardButton
- iconSource: "icons/go-next.png"
- enabled: currentWebView && currentWebView.canGoForward
- activeFocusOnTab: !browserWindow.platformIsMac
- onClicked: currentWebView.goForward()
- longPressMenu: forwardHistoryMenu
- }
- ToolButton {
- id: reloadButton
- iconSource: currentWebView && currentWebView.loading ? "icons/process-stop.png" : "icons/view-refresh.png"
- onClicked: currentWebView && currentWebView.loading ? currentWebView.stop() : currentWebView.reload()
- activeFocusOnTab: !browserWindow.platformIsMac
- }
- TextField {
- id: addressBar
- Image {
- anchors.verticalCenter: addressBar.verticalCenter;
- x: 5
- z: 2
- id: faviconImage
- width: 16; height: 16
- source: currentWebView && currentWebView.icon
- }
- style: TextFieldStyle {
- padding {
- left: 26;
- }
- }
- focus: true
- Layout.fillWidth: true
- text: currentWebView && currentWebView.url
- onAccepted: currentWebView.url = utils.fromUserInput(text)
- }
- ToolButton {
- id: settingsMenuButton
- menu: Menu {
- MenuItem {
- id: loadImages
- text: "Autoload images"
- checkable: true
- checked: true
- }
- MenuItem {
- id: javaScriptEnabled
- text: "JavaScript On"
- checkable: true
- checked: true
- }
- MenuItem {
- id: errorPageEnabled
- text: "ErrorPage On"
- checkable: true
- checked: true
- }
- MenuItem {
- id: pluginsEnabled
- text: "Plugins On"
- checkable: true
- checked: true
- }
- MenuItem {
- id: thirdPartyCookiesEnabled
- text: "Third party cookies enabled"
- checkable: true
- checked: true
- onToggled: applicationRoot.thirdPartyCookiesEnabled = checked
- }
- MenuItem {
- id: offTheRecordEnabled
- text: "Off The Record"
- checkable: true
- checked: currentWebView.profile.offTheRecord
- onToggled: currentWebView.profile = checked ? otrProfile : testProfile;
- }
- MenuItem {
- id: httpDiskCacheEnabled
- text: "HTTP Disk Cache"
- checkable: !currentWebView.profile.offTheRecord
- checked: (currentWebView.profile.httpCacheType == WebEngineProfile.DiskHttpCache)
- onToggled: currentWebView.profile.httpCacheType = checked ? WebEngineProfile.DiskHttpCache : WebEngineProfile.MemoryHttpCache;
- }
- }
- }
- }
- ProgressBar {
- id: progressBar
- height: 3
- anchors {
- left: parent.left
- top: parent.bottom
- right: parent.right
- leftMargin: -parent.leftMargin
- rightMargin: -parent.rightMargin
- }
- style: ProgressBarStyle {
- background: Item {}
- }
- z: -2;
- minimumValue: 0
- maximumValue: 100
- value: (currentWebView && currentWebView.loadProgress < 100) ? currentWebView.loadProgress : 0
- }
- }
-
- TabView {
- id: tabs
- function createEmptyTab(profile) {
- var tab = addTab("", tabComponent)
- // We must do this first to make sure that tab.active gets set so that tab.item gets instantiated immediately.
- tab.active = true
- tab.title = Qt.binding(function() { return tab.item.title })
- tab.item.webView.profile = profile
- return tab
- }
-
- anchors.fill: parent
- Component.onCompleted: createEmptyTab(testProfile)
-
- Component {
- id: tabComponent
- Item {
- property alias webView: webEngineView
- property alias title: webEngineView.title
- Action {
- shortcut: "Ctrl+F"
- onTriggered: {
- findBar.visible = !findBar.visible
- if (findBar.visible) {
- findTextField.forceActiveFocus()
- }
- }
- }
- FeaturePermissionBar {
- id: permBar
- view: webEngineView
- anchors {
- left: parent.left
- right: parent.right
- top: parent.top
- }
- z: 3
- }
-
- WebEngineView {
- id: webEngineView
-
- anchors {
- fill: parent
- top: permBar.bottom
- }
-
- focus: true
-
- states: [
- State {
- name: "FullScreen"
- PropertyChanges {
- target: tabs
- frameVisible: false
- tabsVisible: false
- }
- PropertyChanges {
- target: navigationBar
- visible: false
- }
- }
- ]
- settings.autoLoadImages: appSettings.autoLoadImages
- settings.javascriptEnabled: appSettings.javaScriptEnabled
- settings.errorPageEnabled: appSettings.errorPageEnabled
- settings.pluginsEnabled: appSettings.pluginsEnabled
-
- onCertificateError: {
- if (!acceptedCertificates.shouldAutoAccept(error)){
- error.defer()
- sslDialog.enqueue(error)
- } else{
- error.ignoreCertificateError()
- }
- }
-
- onNewViewRequested: {
- if (!request.userInitiated)
- print("Warning: Blocked a popup window.")
- else if (request.destination == WebEngineView.NewViewInTab) {
- var tab = tabs.createEmptyTab(currentWebView.profile)
- tabs.currentIndex = tabs.count - 1
- request.openIn(tab.item.webView)
- } else if (request.destination == WebEngineView.NewViewInBackgroundTab) {
- var tab = tabs.createEmptyTab(currentWebView.profile)
- request.openIn(tab.item.webView)
- } else if (request.destination == WebEngineView.NewViewInDialog) {
- var dialog = applicationRoot.createDialog(currentWebView.profile)
- request.openIn(dialog.currentWebView)
- } else {
- var window = applicationRoot.createWindow(currentWebView.profile)
- request.openIn(window.currentWebView)
- }
- }
-
- onFullScreenRequested: {
- if (request.toggleOn) {
- webEngineView.state = "FullScreen"
- browserWindow.previousVisibility = browserWindow.visibility
- browserWindow.showFullScreen()
- fullScreenNotification.show()
- } else {
- webEngineView.state = ""
- browserWindow.visibility = browserWindow.previousVisibility
- fullScreenNotification.hide()
- }
- request.accept()
- }
-
- onFeaturePermissionRequested: {
- permBar.securityOrigin = securityOrigin;
- permBar.requestedFeature = feature;
- permBar.visible = true;
- }
- }
-
- Rectangle {
- id: findBar
- anchors.top: webEngineView.top
- anchors.right: webEngineView.right
- width: 240
- height: 35
- border.color: "lightgray"
- border.width: 1
- radius: 5
- visible: false
- color: browserWindow.color
-
- RowLayout {
- anchors.centerIn: findBar
- TextField {
- id: findTextField
- onAccepted: {
- webEngineView.findText(text)
- }
- }
- ToolButton {
- id: findBackwardButton
- iconSource: "icons/go-previous.png"
- onClicked: webEngineView.findText(findTextField.text, WebEngineView.FindBackward)
- }
- ToolButton {
- id: findForwardButton
- iconSource: "icons/go-next.png"
- onClicked: webEngineView.findText(findTextField.text)
- }
- ToolButton {
- id: findCancelButton
- iconSource: "icons/process-stop.png"
- onClicked: findBar.visible = false
- }
- }
- }
- }
- }
- }
-
- QtObject{
- id:acceptedCertificates
-
- property var acceptedUrls : []
-
- function shouldAutoAccept(certificateError){
- var domain = utils.domainFromString(certificateError.url)
- return acceptedUrls.indexOf(domain) >= 0
- }
- }
-
- MessageDialog {
- id: sslDialog
-
- property var certErrors: []
- icon: StandardIcon.Warning
- standardButtons: StandardButton.No | StandardButton.Yes
- title: "Server's certificate not trusted"
- text: "Do you wish to continue?"
- detailedText: "If you wish so, you may continue with an unverified certificate. " +
- "Accepting an unverified certificate means " +
- "you may not be connected with the host you tried to connect to.\n" +
- "Do you wish to override the security check and continue?"
- onYes: {
- var cert = certErrors.shift()
- var domain = utils.domainFromString(cert.url)
- acceptedCertificates.acceptedUrls.push(domain)
- cert.ignoreCertificateError()
- presentError()
- }
- onNo: reject()
- onRejected: reject()
-
- function reject(){
- certErrors.shift().rejectCertificate()
- presentError()
- }
- function enqueue(error){
- certErrors.push(error)
- presentError()
- }
- function presentError(){
- visible = certErrors.length > 0
- }
- }
-
- FullScreenNotification {
- id: fullScreenNotification
- }
-
- DownloadView {
- id: downloadView
- visible: false
- anchors.fill: parent
- }
-
- function onDownloadRequested(download) {
- downloadView.visible = true
- downloadView.append(download)
- download.accept()
- }
-
- MessageDialog {
- id: notificationDialog
- width: 200
- standardButtons: StandardButton.Ok
- }
-
- function onPresentNotification(notification) {
- notificationDialog.title = notification.title
- notificationDialog.text = notification.origin.toString() + '\n' + notification.message
- notificationDialog.open()
- }
-
- ZoomController {
- id: zoomController
- y: parent.mapFromItem(currentWebView, 0 , 0).y - 4
- anchors.right: parent.right
- width: (parent.width > 800) ? parent.width * 0.25 : 220
- anchors.rightMargin: (parent.width > 400) ? 100 : 0
- }
- Binding {
- target: currentWebView
- property: "zoomFactor"
- value: zoomController.zoomFactor
- }
-}
diff --git a/tests/quicktestbrowser/ButtonWithMenu.qml b/tests/quicktestbrowser/ButtonWithMenu.qml
deleted file mode 100644
index b8d4f743c..000000000
--- a/tests/quicktestbrowser/ButtonWithMenu.qml
+++ /dev/null
@@ -1,58 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-
-// The QtQuick controls guys are slackers, so we need to make our own stuff
-
-ToolButton {
- id: root
- property Menu longPressMenu
- function showMenu() {
- longPressMenu.__popup(Qt.rect(0, root.height, 0, 0), 0)
- }
-
- Binding {
- target: longPressMenu
- property: "__visualItem"
- value: root
- }
-
- MouseArea {
- anchors.fill: parent
- acceptedButtons: Qt.LeftButton | Qt.RightButton
- onClicked: {
- if (mouse.button == Qt.RightButton)
- showMenu()
- else
- root.clicked()
- }
- onPressAndHold: showMenu()
- }
-}
diff --git a/tests/quicktestbrowser/DownloadView.qml b/tests/quicktestbrowser/DownloadView.qml
deleted file mode 100644
index eb945eccc..000000000
--- a/tests/quicktestbrowser/DownloadView.qml
+++ /dev/null
@@ -1,153 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.1
-import QtQuick.Controls 1.0
-import QtQuick.Controls.Styles 1.0
-import QtWebEngine 1.0
-import QtQuick.Layouts 1.0
-
-Rectangle {
- id: downloadView
- color: "lightgray"
-
- ListModel {
- id: downloadModel
- property var downloads: []
- }
-
- function append(download) {
- downloadModel.append(download)
- downloadModel.downloads.push(download)
- }
-
- Component {
- id: downloadItemDelegate
-
- Rectangle {
- width: listView.width
- height: childrenRect.height
- anchors.margins: 10
- radius: 3
- color: "transparent"
- border.color: "black"
- Rectangle {
- id: progressBar
-
- property real progress: downloadModel.downloads[index]
- ? downloadModel.downloads[index].receivedBytes / downloadModel.downloads[index].totalBytes : 0
-
- radius: 3
- color: width == listView.width ? "green" : "#2b74c7"
- width: listView.width * progress
- height: cancelButton.height
-
- Behavior on width {
- SmoothedAnimation { duration: 100 }
- }
- }
- Rectangle {
- anchors {
- left: parent.left
- right: parent.right
- leftMargin: 20
- }
- Label {
- id: label
- text: path
- anchors {
- verticalCenter: cancelButton.verticalCenter
- left: parent.left
- right: cancelButton.left
- }
- }
- Button {
- id: cancelButton
- anchors.right: parent.right
- iconSource: "icons/process-stop.png"
- onClicked: {
- var download = downloadModel.downloads[index]
-
- download.cancel()
-
- downloadModel.downloads = downloadModel.downloads.filter(function (el) {
- return el.id !== download.id;
- });
- downloadModel.remove(index)
- }
- }
- }
- }
-
- }
- ListView {
- id: listView
- anchors {
- topMargin: 10
- top: parent.top
- bottom: parent.bottom
- horizontalCenter: parent.horizontalCenter
- }
- width: parent.width - 20
- spacing: 5
-
- model: downloadModel
- delegate: downloadItemDelegate
-
- Text {
- visible: !listView.count
- horizontalAlignment: Text.AlignHCenter
- height: 30
- anchors {
- top: parent.top
- left: parent.left
- right: parent.right
- }
- font.pixelSize: 20
- text: "No active downloads."
- }
-
- Rectangle {
- color: "gray"
- anchors {
- bottom: parent.bottom
- left: parent.left
- right: parent.right
- }
- height: 30
- Button {
- id: okButton
- text: "OK"
- anchors.centerIn: parent
- onClicked: {
- downloadView.visible = false
- }
- }
- }
- }
-}
diff --git a/tests/quicktestbrowser/FeaturePermissionBar.qml b/tests/quicktestbrowser/FeaturePermissionBar.qml
deleted file mode 100644
index 500d13206..000000000
--- a/tests/quicktestbrowser/FeaturePermissionBar.qml
+++ /dev/null
@@ -1,92 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.1
-import QtQuick.Controls 1.0
-import QtWebEngine 1.1
-import QtQuick.Layouts 1.0
-
-Rectangle {
- property var requestedFeature;
- property url securityOrigin;
- property WebEngineView view;
-
- id: permissionBar
- visible: false
- height: acceptButton.height + 4
-
-
- function textForFeature(feature) {
- switch (feature) {
- case WebEngineView.Geolocation: return 'Allow %1 to access your location information?'
- case WebEngineView.MediaAudioCapture: return 'Allow %1 to access your microphone?'
- case WebEngineView.MediaVideoCapture: return 'Allow %1 to access your webcam?'
- case WebEngineView.MediaAudioVideoCapture: return 'Allow %1 to access your microphone and webcam?'
- case WebEngineView.DesktopVideoCapture: return 'Allow %1 to capture video of your desktop?'
- case WebEngineView.DesktopAudioVideoCapture: return 'Allow %1 to capture audio and video of your desktop?'
- case WebEngineView.Notifications: return 'Allow %1 to show notification on your desktop?'
- default: break
- }
- return 'Grant permission for %1 to unknown or unsupported feature [' + feature + ']?'
- }
-
- onRequestedFeatureChanged: {
- message.text = textForFeature(requestedFeature).arg(securityOrigin);
- }
-
- RowLayout {
- anchors {
- fill: permissionBar
- leftMargin: 5
- rightMargin: 5
- }
- Label {
- id: message
- Layout.fillWidth: true
- }
-
- Button {
- id: acceptButton
- text: "Accept"
- Layout.alignment: Qt.AlignRight
- onClicked: {
- view.grantFeaturePermission(securityOrigin, requestedFeature, true);
- permissionBar.visible = false;
- }
- }
-
- Button {
- text: "Deny"
- Layout.alignment: Qt.AlignRight
- onClicked: {
- view.grantFeaturePermission(securityOrigin, requestedFeature, false);
- permissionBar.visible = false
- }
- }
- }
-}
diff --git a/tests/quicktestbrowser/FullScreenNotification.qml b/tests/quicktestbrowser/FullScreenNotification.qml
deleted file mode 100644
index 90f27cca6..000000000
--- a/tests/quicktestbrowser/FullScreenNotification.qml
+++ /dev/null
@@ -1,87 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.5
-
-Rectangle {
- id: fullScreenNotification
- width: 500
- height: 40
- color: "white"
- radius: 7
-
- visible: false
- opacity: 0
-
- function show() {
- visible = true
- opacity = 1
- reset.start()
- }
-
- function hide() {
- reset.stop()
- opacity = 0
- }
-
- Behavior on opacity {
- NumberAnimation {
- duration: 750
- onStopped: {
- if (opacity == 0)
- visible = false
- }
- }
- }
-
- Timer {
- id: reset
- interval: 5000
- onTriggered: hide()
- }
-
- anchors.horizontalCenter: parent.horizontalCenter
- y: 125
-
- Text {
- id: message
- width: parent.width
-
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
-
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
-
- wrapMode: Text.WordWrap
- elide: Text.ElideNone
- clip: true
-
- text: qsTr("You are now in fullscreen mode. Press ESC to quit!")
- }
-}
diff --git a/tests/quicktestbrowser/ZoomController.qml b/tests/quicktestbrowser/ZoomController.qml
deleted file mode 100644
index 122ae8815..000000000
--- a/tests/quicktestbrowser/ZoomController.qml
+++ /dev/null
@@ -1,90 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.1
-
-Rectangle {
- property alias zoomFactor: slider.value ;
- function zoomIn() {
- visible = true
- visibilityTimer.restart()
- zoomFactor = zoomFactor + 0.25;
- }
- function zoomOut() {
- visible = true
- visibilityTimer.restart()
- zoomFactor = zoomFactor - 0.25;
- }
- function reset() { zoomFactor = 1.0 }
-
- width: 220
- height: 30
- color: palette.window
- visible: false
- radius: 4
-
- SystemPalette {
- id: palette
- }
- Timer {
- id: visibilityTimer
- interval: 3000
- repeat: false
- onTriggered: zoomController.visible = false
- }
-
- RowLayout {
- anchors.margins: 4
- anchors.fill: parent
- ToolButton {
- id: plusButton
- text: '+'
- onClicked: zoomIn()
- }
- ToolButton {
- text: '\u2014'
- id: minusButton
- onClicked: zoomOut()
- }
- Slider {
- id: slider
- maximumValue: 5.0
- minimumValue: 0.25
- Layout.fillWidth: true;
- stepSize: 0.05
- value: 1
- onValueChanged: visibilityTimer.restart()
- }
- Button {
- text: "Reset"
- onClicked: reset()
- }
- }
-}
diff --git a/tests/quicktestbrowser/main.cpp b/tests/quicktestbrowser/main.cpp
deleted file mode 100644
index b886564f3..000000000
--- a/tests/quicktestbrowser/main.cpp
+++ /dev/null
@@ -1,96 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "utils.h"
-
-#ifndef QT_NO_WIDGETS
-#include <QtWidgets/QApplication>
-typedef QApplication Application;
-#else
-#include <QtGui/QGuiApplication>
-typedef QGuiApplication Application;
-#endif
-#include <QtQml/QQmlApplicationEngine>
-#include <QtQml/QQmlContext>
-#include <QtQml/QQmlComponent>
-#include <QtWebEngine/qtwebengineglobal.h>
-#include <QtWebEngine/QQuickWebEngineProfile>
-#include <QtWebEngineCore/qwebenginecookiestore.h>
-
-static QUrl startupUrl()
-{
- QUrl ret;
- QStringList args(qApp->arguments());
- args.takeFirst();
- for (const QString &arg : qAsConst(args)) {
- if (arg.startsWith(QLatin1Char('-')))
- continue;
- ret = Utils::fromUserInput(arg);
- if (ret.isValid())
- return ret;
- }
- return QUrl(QStringLiteral("http://qt.io/"));
-}
-
-int main(int argc, char **argv)
-{
- Application app(argc, argv);
-
- // Enable dev tools by default for the test browser
- if (qgetenv("QTWEBENGINE_REMOTE_DEBUGGING").isNull())
- qputenv("QTWEBENGINE_REMOTE_DEBUGGING", "1337");
- QtWebEngine::initialize();
-
- QQmlApplicationEngine appEngine;
- Utils utils;
- appEngine.rootContext()->setContextProperty("utils", &utils);
- appEngine.load(QUrl("qrc:/ApplicationRoot.qml"));
-
- QObject *rootObject = appEngine.rootObjects().first();
-
- QQuickWebEngineProfile *profile = new QQuickWebEngineProfile(rootObject);
-
- const QMetaObject *rootMeta = rootObject->metaObject();
- int index = rootMeta->indexOfProperty("thirdPartyCookiesEnabled");
- Q_ASSERT(index != -1);
- QMetaProperty thirdPartyCookiesProperty = rootMeta->property(index);
- profile->cookieStore()->setCookieFilter(
- [rootObject,&thirdPartyCookiesProperty](const QWebEngineCookieStore::FilterRequest &request)
- {
- return !request.thirdParty || thirdPartyCookiesProperty.read(rootObject).toBool();
- });
-
- index = rootMeta->indexOfProperty("testProfile");
- Q_ASSERT(index != -1);
- QMetaProperty profileProperty = rootMeta->property(index);
- profileProperty.write(rootObject, QVariant::fromValue(profile));
-
- QMetaObject::invokeMethod(rootObject, "load", Q_ARG(QVariant, startupUrl()));
-
- return app.exec();
-}
diff --git a/tests/quicktestbrowser/quicktestbrowser.pro b/tests/quicktestbrowser/quicktestbrowser.pro
deleted file mode 100644
index 8c6b8a111..000000000
--- a/tests/quicktestbrowser/quicktestbrowser.pro
+++ /dev/null
@@ -1,26 +0,0 @@
-requires(qtConfig(accessibility))
-
-TEMPLATE = app
-TARGET = quicktestbrowser
-
-macx: CONFIG -= app_bundle
-
-HEADERS = utils.h
-SOURCES = main.cpp
-
-OTHER_FILES += ApplicationRoot.qml \
- BrowserDialog.qml \
- BrowserWindow.qml \
- ButtonWithMenu.qml \
- ContextMenuExtras.qml \
- DownloadView.qml \
- FeaturePermissionBar.qml \
- FullScreenNotification.qml
-
-RESOURCES += resources.qrc
-
-QT += qml quick webengine
-
-qtHaveModule(widgets) {
- QT += widgets # QApplication is required to get native styling with QtQuickControls
-}
diff --git a/tests/quicktestbrowser/resources.qrc b/tests/quicktestbrowser/resources.qrc
deleted file mode 100644
index 63ff051de..000000000
--- a/tests/quicktestbrowser/resources.qrc
+++ /dev/null
@@ -1,19 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
- <qresource prefix="/">
- <file>ApplicationRoot.qml</file>
- <file>BrowserDialog.qml</file>
- <file>BrowserWindow.qml</file>
- <file>FeaturePermissionBar.qml</file>
- <file>FullScreenNotification.qml</file>
- <file>ButtonWithMenu.qml</file>
- <file>DownloadView.qml</file>
- <file>ZoomController.qml</file>
- </qresource>
- <qresource prefix="icons">
- <!-- To the risk of this breaking more often, do not duplicate the resources since this application won't be deployed -->
- <file alias="go-next.png">../../examples/webengine/quicknanobrowser/icons/3rdparty/go-next.png</file>
- <file alias="go-previous.png">../../examples/webengine/quicknanobrowser/icons/3rdparty/go-previous.png</file>
- <file alias="process-stop.png">../../examples/webengine/quicknanobrowser/icons/3rdparty/process-stop.png</file>
- <file alias="view-refresh.png">../../examples/webengine/quicknanobrowser/icons/3rdparty/view-refresh.png</file>
- </qresource>
-</RCC>
diff --git a/tests/quicktestbrowser/utils.h b/tests/quicktestbrowser/utils.h
deleted file mode 100644
index d4f3dba0e..000000000
--- a/tests/quicktestbrowser/utils.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef UTILS_H
-#define UTILS_H
-
-#include <QtCore/QFileInfo>
-#include <QtCore/QUrl>
-
-class Utils : public QObject {
- Q_OBJECT
-public:
- Q_INVOKABLE static QUrl fromUserInput(const QString& userInput);
- Q_INVOKABLE static QString domainFromString(const QString& urlString);
-};
-
-inline QUrl Utils::fromUserInput(const QString& userInput)
-{
- QFileInfo fileInfo(userInput);
- if (fileInfo.exists())
- return QUrl::fromLocalFile(fileInfo.absoluteFilePath());
- return QUrl::fromUserInput(userInput);
-}
-
-inline QString Utils::domainFromString(const QString& urlString)
-{
- return QUrl::fromUserInput(urlString).host();
-}
-
-#endif // UTILS_H
diff --git a/tests/tests.pro b/tests/tests.pro
deleted file mode 100644
index acb223640..000000000
--- a/tests/tests.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-TEMPLATE = subdirs
-
-SUBDIRS += auto
-
-qtHaveModule(webengine) {
- SUBDIRS += quicktestbrowser
-}
diff --git a/tools/about_credits_entry.tmpl b/tools/about_credits_entry.tmpl
deleted file mode 100644
index 2bb9cff4e..000000000
--- a/tools/about_credits_entry.tmpl
+++ /dev/null
@@ -1,12 +0,0 @@
-/*!
-\page qtwebengine-3rdparty-{{name-sanitized}}.html attribution
-\ingroup qtwebengine-licensing
-\brief {{license-type}}
-\title {{name}}
-
-\l{{{url}}}{Project Homepage}
-
-\badcode
-{{license}}
-\endcode
-*/
diff --git a/tools/buildscripts/qtwebengine_utils.py b/tools/buildscripts/qtwebengine_utils.py
index 85f9a5d27..32bccbf4d 100755
--- a/tools/buildscripts/qtwebengine_utils.py
+++ b/tools/buildscripts/qtwebengine_utils.py
@@ -1,32 +1,6 @@
-#!/usr/bin/env python
-
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the QtWebEngine module of the Qt Toolkit.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
+#!/usr/bin/env python3
+# Copyright (C) 2016 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
import os
import subprocess
diff --git a/tools/buildscripts/repack_locales.py b/tools/buildscripts/repack_locales.py
index 8f1ae190b..99b91867c 100755
--- a/tools/buildscripts/repack_locales.py
+++ b/tools/buildscripts/repack_locales.py
@@ -1,32 +1,7 @@
-#!/usr/bin/env python
-#############################################################################
-##
-## Copyright (c) 2012 The Chromium Authors. All rights reserved.
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the QtWebEngine module of the Qt Toolkit.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
+#!/usr/bin/env python3
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
+# Copyright (C) 2016 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
# This is esentially a trimmed down version of chrome's repack_locales script
"""Helper script to repack paks for a list of locales.
@@ -89,6 +64,12 @@ def calc_inputs(locale):
inputs.append(os.path.join(SHARE_INT_DIR, 'components', 'strings',
'components_%s_strings_%s.pak' % (BRANDING, locale)))
+ inputs.append(os.path.join(SHARE_INT_DIR, 'services', 'strings',
+ 'services_strings_%s.pak' % locale))
+
+ inputs.append(os.path.join(SHARE_INT_DIR, 'third_party', 'blink', 'public', 'strings,
+ 'blink_strings_%s.pak' % locale))
+
if OS != 'ios':
#e.g. '<(SHARED_INTERMEDIATE_DIR)/content/app/strings/content_strings_en-US.pak'
inputs.append(os.path.join(SHARE_INT_DIR, 'content', 'app', 'strings',
@@ -107,7 +88,7 @@ def calc_inputs(locale):
inputs.append(os.path.join(SHARE_INT_DIR, 'chrome',
'generated_resources_%s.pak' % locale))
- #e.g. '<(SHARED_INTERMEDIATE_DIR)/chrome/generated_resources_da.pak'
+ #e.g. '<(SHARED_INTERMEDIATE_DIR)/chrome/chromium_strings_da.pak'
inputs.append(os.path.join(SHARE_INT_DIR, 'chrome',
'chromium_strings_%s.pak' % locale))
diff --git a/tools/scripts/check_patches.py b/tools/scripts/check_patches.py
index 7437f1587..e14d54f63 100755
--- a/tools/scripts/check_patches.py
+++ b/tools/scripts/check_patches.py
@@ -1,32 +1,6 @@
#!/usr/bin/env python
-
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the QtWebEngine module of the Qt Toolkit.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
+# Copyright (C) 2016 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
import glob
import os
diff --git a/tools/scripts/cipd_package.py b/tools/scripts/cipd_package.py
new file mode 100644
index 000000000..8ab448c86
--- /dev/null
+++ b/tools/scripts/cipd_package.py
@@ -0,0 +1,103 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import glob
+import os
+import re
+import subprocess
+import sys
+import version_resolver as resolver
+
+androidx_package_name = 'chromium/third_party/androidx'
+
+def subprocessCall(args):
+ print(args)
+ return subprocess.call(args)
+
+def subprocessCheckOutput(args):
+ print(args)
+ return subprocess.check_output(args).decode()
+
+class PackageDEPSParser(resolver.DEPSParser):
+ def __init__(self):
+ super().__init__()
+
+ def createEntitiesFromScope(self, scope):
+ entities = []
+ for dep in scope:
+ if (type(scope[dep]) == dict and 'packages' in scope[dep] \
+ and 'dep_type' in scope[dep] and scope[dep]['dep_type'] == 'cipd'):
+ subdir = self.subdir(dep)
+ if subdir is None:
+ continue
+ entity = CIPDEntity(subdir, sp=self.topmost_supermodule_path_prefix)
+ path = entity.pathRelativeToTopMostSupermodule()
+ for pkg in scope[dep]['packages']:
+ p = Package(pkg['package'], pkg['version'], path)
+ entity.packages.append(p)
+ entities.append(entity)
+ return entities
+
+ def parse(self, deps_content, module_whitelist = []):
+ exec(deps_content, self.global_scope, self.local_scope)
+ entities = []
+ entities.extend(self.createEntitiesFromScope(self.local_scope['deps']))
+ return entities
+
+class Package:
+ def __init__(self, name, version, path):
+ self.name = name
+ self.version = version
+ self.path = path
+ self.fileName = name.replace('/','.') + '.pkg'
+
+ def fetchAndDeploy(self):
+ if os.path.isdir(self.path):
+ currentDir = os.getcwd()
+ os.chdir(self.path)
+ subprocessCall(['cipd', 'pkg-fetch', self.name ,'-out' , self.fileName, '-version', self.version ])
+ subprocessCall(['cipd', 'pkg-deploy', self.fileName , '-root', '.' ])
+ os.chdir(currentDir)
+ else:
+ print('-- missing directory' + self.path + ' skipping')
+
+ def listFiles(self):
+ if os.path.isdir(self.path):
+ currentDir = os.getcwd()
+ os.chdir(self.path)
+ files = []
+ if os.path.isfile(self.fileName):
+ files = subprocessCheckOutput(['cipd', 'pkg-inspect', self.fileName]).splitlines()
+ files = map( lambda x: x.replace( ' F ', self.path + '/'), files)
+ else:
+ print('-- missing package file ' + self.path + ' skipping')
+ os.chdir(currentDir)
+ return files
+ else:
+ print('-- missing directory' + self.path + ' skipping')
+ return []
+
+class CIPDEntity:
+ def __init__(self, path='', packages=[], os=[], sp=''):
+ self.path = path
+ self.packages = []
+ self.topmost_supermodule_path_prefix = sp
+
+ def pathRelativeToTopMostSupermodule(self):
+ return os.path.normpath(os.path.join(self.topmost_supermodule_path_prefix, self.path))
+
+ def findPackage(self, package):
+ pkg = [p for p in self.packages if p.name == package]
+ if len(pkg) > 1:
+ raise Exception(package + " is ambiguous package name for" + self.path)
+ return pkg[0] if pkg else None
+
+ def readEntities(self):
+ cipd_packages = []
+ cipd_packages = resolver.read(PackageDEPSParser)
+ print('DEPS file provides the following packages:')
+ for cipd_package in cipd_packages:
+ print(cipd_package.pathRelativeToTopMostSupermodule() + ':')
+ for package in cipd_package.packages:
+ print(' * {:<80}'.format(package.name) + package.version)
+ return cipd_packages
diff --git a/tools/scripts/get_version.py b/tools/scripts/get_version.py
index d3928f6e5..897b9866e 100755
--- a/tools/scripts/get_version.py
+++ b/tools/scripts/get_version.py
@@ -1,32 +1,6 @@
#!/usr/bin/env python
-
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the QtWebEngine module of the Qt Toolkit.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
+# Copyright (C) 2016 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
import sys
import json
diff --git a/tools/scripts/git_submodule.py b/tools/scripts/git_submodule.py
index edaed1ed2..3d301d16b 100644
--- a/tools/scripts/git_submodule.py
+++ b/tools/scripts/git_submodule.py
@@ -1,34 +1,10 @@
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the QtWebEngine module of the Qt Toolkit.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
+# Copyright (C) 2016 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
import glob
import os
import re
+import string
import subprocess
import sys
import version_resolver as resolver
@@ -36,21 +12,21 @@ import version_resolver as resolver
extra_os = ['mac', 'win']
def subprocessCall(args):
- print args
+ print(args)
return subprocess.call(args)
def subprocessCheckOutput(args):
- print args
- return subprocess.check_output(args)
+ print(args)
+ return subprocess.check_output(args).decode()
-class DEPSParser:
+# Special string formatter that support flat key names with '.' in them
+class DepsFormatter(string.Formatter):
+ def get_field(self, field_name, args, kwargs):
+ return (self.get_value(field_name, args, kwargs), field_name)
+
+class SubmoduleDEPSParser(resolver.DEPSParser):
def __init__(self):
- self.global_scope = {
- 'Var': lambda var_name: '{%s}' % var_name,
- 'deps_os': {},
- }
- self.local_scope = {}
- self.topmost_supermodule_path_prefix = ''
+ super().__init__()
def get_vars(self):
"""Returns a dictionary of effective variable values
@@ -61,10 +37,7 @@ class DEPSParser:
#result.update(self.custom_vars or {})
return result
- def get_recursedeps(self):
- return self.local_scope["recursedeps"]
-
- def createSubmodulesFromScope(self, scope, os):
+ def createSubmodulesFromScope(self, scope, os, module_whitelist = []):
submodules = []
for dep in scope:
url = ''
@@ -73,29 +46,23 @@ class DEPSParser:
elif (type(scope[dep]) == dict and 'url' in scope[dep]):
url = scope[dep]['url']
- if ('condition' in scope[dep]) and (not 'checkout_linux' in scope[dep]['condition']):
- url = ''
-
+ if ('condition' in scope[dep]) and \
+ (not 'checkout_linux' in scope[dep]['condition']) and \
+ (not dep in module_whitelist):
+ continue
if url:
- url = url.format(**self.get_vars())
+ url = DepsFormatter().vformat(url, [], self.get_vars())
repo_rev = url.split('@')
repo = repo_rev[0]
rev = repo_rev[1]
- subdir = dep
- if subdir.startswith('src/'):
- subdir = subdir[4:]
- # Don't skip submodules that have a supermodule path prefix set (at the moment these
- # are 2nd level deep submodules).
- elif not self.topmost_supermodule_path_prefix:
- # Ignore the information about chromium itself since we get that from git,
- # also ignore anything outside src/ (e.g. depot_tools)
+ subdir = self.subdir(dep)
+ if subdir is None:
continue
-
submodule = Submodule(subdir, repo, sp=self.topmost_supermodule_path_prefix)
submodule.os = os
if not submodule.matchesOS():
- print '-- skipping ' + submodule.pathRelativeToTopMostSupermodule() + ' for this operating system. --'
+ print('-- skipping ' + submodule.pathRelativeToTopMostSupermodule() + ' for this operating system. --')
continue
if len(rev) == 40: # Length of a git shasum
@@ -107,11 +74,11 @@ class DEPSParser:
submodules.append(submodule)
return submodules
- def parse(self, deps_content):
+ def parse(self, deps_content, module_whitelist = []):
exec(deps_content, self.global_scope, self.local_scope)
submodules = []
- submodules.extend(self.createSubmodulesFromScope(self.local_scope['deps'], 'all'))
+ submodules.extend(self.createSubmodulesFromScope(self.local_scope['deps'], 'all', module_whitelist))
if 'deps_os' in self.local_scope:
for os_dep in self.local_scope['deps_os']:
submodules.extend(self.createSubmodulesFromScope(self.local_scope['deps_os'][os_dep], os_dep))
@@ -200,7 +167,7 @@ class Submodule:
def findGitDir(self):
try:
return subprocessCheckOutput(['git', 'rev-parse', '--git-dir']).strip()
- except subprocess.CalledProcessError, e:
+ except subprocess.CalledProcessError as e:
sys.exit("git dir could not be determined! - Initialization failed! " + e.output)
def reset(self):
@@ -209,28 +176,28 @@ class Submodule:
gitdir = self.findGitDir()
if os.path.isdir(os.path.join(gitdir, 'rebase-merge')):
if os.path.isfile(os.path.join(gitdir, 'MERGE_HEAD')):
- print 'merge in progress... aborting merge.'
+ print('merge in progress... aborting merge.')
subprocessCall(['git', 'merge', '--abort'])
else:
- print 'rebase in progress... aborting merge.'
+ print('rebase in progress... aborting merge.')
subprocessCall(['git', 'rebase', '--abort'])
if os.path.isdir(os.path.join(gitdir, 'rebase-apply')):
- print 'am in progress... aborting am.'
+ print('am in progress... aborting am.')
subprocessCall(['git', 'am', '--abort'])
subprocessCall(['git', 'reset', '--hard'])
os.chdir(currentDir)
def initialize(self):
if self.matchesOS():
- print '\n\n-- initializing ' + self.pathRelativeToTopMostSupermodule() + ' --'
+ print('\n\n-- initializing ' + self.pathRelativeToTopMostSupermodule() + ' --')
oldCwd = os.getcwd()
# The submodule operations should be done relative to the current submodule's
# supermodule.
if self.topmost_supermodule_path_prefix:
if not os.path.isdir(self.path):
- print '-- skipping ' + self.path + ' as dir has been stripped. --'
- return
+ print('-- creating ' + self.path + ' as dir is missing. --')
+ os.makedirs(self.path)
os.chdir(self.topmost_supermodule_path_prefix)
if os.path.isdir(self.path):
@@ -253,7 +220,7 @@ class Submodule:
os.chdir(oldCwd)
else:
- print '-- skipping ' + self.path + ' for this operating system. --'
+ print('-- skipping ' + self.path + ' for this operating system. --')
def listFiles(self):
if self.matchesOS() and os.path.isdir(self.pathRelativeToTopMostSupermodule()):
@@ -263,7 +230,7 @@ class Submodule:
os.chdir(currentDir)
return files
else:
- print '-- skipping ' + self.path + ' for this operating system. --'
+ print('-- skipping ' + self.path + ' for this operating system. --')
return []
def parseGitModulesFileContents(self, gitmodules_lines):
@@ -318,10 +285,10 @@ class Submodule:
def readSubmodules(self, use_deps=False):
submodules = []
if use_deps:
- submodules = resolver.readSubmodules()
- print 'DEPS file provides the following submodules:'
+ submodules = resolver.read(SubmoduleDEPSParser)
+ print('DEPS file provides the following submodules:')
for submodule in submodules:
- print '{:<80}'.format(submodule.pathRelativeToTopMostSupermodule()) + '{:<120}'.format(submodule.url) + submodule.ref
+ print('{:<80}'.format(submodule.pathRelativeToTopMostSupermodule()) + '{:<120}'.format(submodule.url) + submodule.ref)
else: # Try .gitmodules instead
gitmodules_file_name = '.gitmodules'
submodules = self.readSubmodulesFromGitModules(self, gitmodules_file_name, self.path)
diff --git a/tools/scripts/gn_find_mocables.py b/tools/scripts/gn_find_mocables.py
index 4dc2576e3..68f648889 100644
--- a/tools/scripts/gn_find_mocables.py
+++ b/tools/scripts/gn_find_mocables.py
@@ -1,30 +1,5 @@
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the QtWebEngine module of the Qt Toolkit.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
+# Copyright (C) 2016 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
import re
import sys
@@ -32,7 +7,7 @@ import os
mocables = set()
includedMocs = set()
-files = sys.argv[2:]
+files = sys.argv[1:]
for f in filter(os.path.isfile, files):
inBlockComment = False
diff --git a/tools/scripts/gn_run_binary.py b/tools/scripts/gn_run_binary.py
index 5debf02ab..0e30e23ed 100644
--- a/tools/scripts/gn_run_binary.py
+++ b/tools/scripts/gn_run_binary.py
@@ -1,30 +1,5 @@
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the QtWebEngine module of the Qt Toolkit.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
+# Copyright (C) 2016 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
import sys
diff --git a/tools/scripts/init-repository.py b/tools/scripts/init-repository.py
index 221f74a65..e6ec0c440 100755
--- a/tools/scripts/init-repository.py
+++ b/tools/scripts/init-repository.py
@@ -1,32 +1,6 @@
-#!/usr/bin/env python
-
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the QtWebEngine module of the Qt Toolkit.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
+#!/usr/bin/env python3
+# Copyright (C) 2016 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
import glob
import os
@@ -38,6 +12,7 @@ import argparse
qtwebengine_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))
import git_submodule as GitSubmodule
+import cipd_package as CIPDPackage
import version_resolver as resolver
chromium_src = os.environ.get('CHROMIUM_SRC_DIR')
@@ -47,13 +22,14 @@ use_external_chromium = False
parser = argparse.ArgumentParser(description='Initialize QtWebEngine repository.')
parser.add_argument('--baseline-upstream', action='store_true', help='initialize using upstream Chromium submodule w/o applying patches (for maintenance purposes only)')
+parser.add_argument('--use_cipd', action='store_true', help='fetch and deploy packages with cipd')
group = parser.add_mutually_exclusive_group()
group.add_argument('-u', '--upstream', action='store_true', help='initialize using upstream Chromium submodule')
group.add_argument('-s', '--snapshot', action='store_true', help='initialize using flat Chromium snapshot submodule (default)')
args = parser.parse_args()
-
if args.baseline_upstream:
args.upstream = True
+ args.use_cipd = True
if chromium_src:
chromium_src = os.path.abspath(chromium_src)
@@ -66,7 +42,7 @@ if not chromium_src or not os.path.isdir(chromium_src):
ninja_src = os.path.join(qtwebengine_root, 'src/3rdparty/ninja')
gn_src = os.path.join(qtwebengine_root, 'src/3rdparty/gn')
args.snapshot = True
- print 'CHROMIUM_SRC_DIR not set, using Chromium in' + chromium_src
+ print('CHROMIUM_SRC_DIR not set, using Chromium in' + chromium_src)
if not args.baseline_upstream:
# Write our chromium sources directory into git config.
@@ -79,7 +55,7 @@ def updateLastChange():
return
currentDir = os.getcwd()
os.chdir(chromium_src)
- print 'updating LASTCHANGE files'
+ print('updating LASTCHANGE files')
subprocess.call(['python', 'build/util/lastchange.py', '-o', 'build/util/LASTCHANGE'])
subprocess.call(['python', 'build/util/lastchange.py', '-m', 'SKIA_COMMIT_HASH', '-s', 'third_party/skia', '--header', 'skia/ext/skia_commit_hash.h'])
subprocess.call(['python', 'build/util/lastchange.py', '-m', 'GPU_LISTS_VERSION', '--revision-id-only', '--header', 'gpu/config/gpu_lists_version.h'])
@@ -93,7 +69,7 @@ def initUpstreamSubmodules():
chromium_ref = 'refs/tags/' + resolver.currentVersion()
os.chdir(qtwebengine_root)
- current_submodules = subprocess.check_output(['git', 'submodule'])
+ current_submodules = subprocess.check_output(['git', 'submodule']).decode()
if not 'src/3rdparty_upstream/gn' in current_submodules:
subprocess.call(['git', 'submodule', 'add', gn_url, 'src/3rdparty_upstream/gn'])
if not 'src/3rdparty_upstream/ninja' in current_submodules:
@@ -123,6 +99,7 @@ def initUpstreamSubmodules():
chromiumSubmodule.os = 'all'
chromiumSubmodule.initialize()
chromiumSubmodule.initSubmodules()
+ subprocess.call(['src/3rdparty_upstream/chromium/third_party/node/update_npm_deps'])
# Unstage repositories so we do not accidentally commit them.
subprocess.call(['git', 'reset', '-q', 'HEAD', 'src/3rdparty_upstream/gn'])
@@ -135,12 +112,31 @@ def initSnapshot():
snapshot.os = 'all'
snapshot.initialize()
+def initPackages():
+ # 'androidx' it is the only so far cipd package we need
+ third_party_upstream_chromium = os.path.join(qtwebengine_root, 'src/3rdparty_upstream/chromium')
+ currentDir = os.getcwd()
+ os.chdir(third_party_upstream_chromium)
+ cipd = CIPDPackage.CIPDEntity(third_party_upstream_chromium)
+ cipd_entites = cipd.readEntities()
+ for e in cipd_entites:
+ pkg = e.findPackage(CIPDPackage.androidx_package_name)
+ if pkg:
+ print('-- fetching and deploying ' + CIPDPackage.androidx_package_name)
+ pkg.fetchAndDeploy()
+ os.chdir(currentDir)
+
os.chdir(qtwebengine_root)
if args.upstream:
initUpstreamSubmodules()
updateLastChange()
if not args.baseline_upstream and not use_external_chromium:
- subprocess.call(['python', os.path.join(qtwebengine_root, 'tools', 'scripts', 'patch_upstream.py')])
+ subprocess.call(['python3', os.path.join(qtwebengine_root, 'tools', 'scripts', 'patch_upstream.py')])
if args.snapshot:
initSnapshot()
+if args.use_cipd:
+ cipdNotFound = subprocess.call(['which', 'cipd'])
+ if cipdNotFound:
+ raise Exception("You need cipd from depo tools.Try setting ./src/3rdparty_upstream/chromium/third_party/depot_tools/cipd in your PATH.")
+ initPackages()
diff --git a/tools/scripts/make_archive.sh b/tools/scripts/make_archive.sh
index a98061e65..fe61dfa2b 100755
--- a/tools/scripts/make_archive.sh
+++ b/tools/scripts/make_archive.sh
@@ -1,32 +1,6 @@
#!/bin/bash
-
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the QtWebEngine module of the Qt Toolkit.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
+# Copyright (C) 2016 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
if [ $# -ne 3 ]; then
echo "Usage: $0 git-ref release-name version"
diff --git a/tools/scripts/patch_upstream.py b/tools/scripts/patch_upstream.py
index b1fd78076..53f3fdb91 100755
--- a/tools/scripts/patch_upstream.py
+++ b/tools/scripts/patch_upstream.py
@@ -1,32 +1,6 @@
#!/usr/bin/env python
-
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the QtWebEngine module of the Qt Toolkit.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
+# Copyright (C) 2016 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
import glob
import os
diff --git a/tools/scripts/take_snapshot.py b/tools/scripts/take_snapshot.py
index 8ec0a898e..e312dd64c 100755
--- a/tools/scripts/take_snapshot.py
+++ b/tools/scripts/take_snapshot.py
@@ -1,43 +1,18 @@
-#!/usr/bin/env python
-
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the QtWebEngine module of the Qt Toolkit.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
+#!/usr/bin/env python3
+# Copyright (C) 2016 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
import glob
import os
import subprocess
import sys
-import imp
+import importlib
import errno
import shutil
from distutils.version import StrictVersion
import git_submodule as GitSubmodule
+import cipd_package as CIPDPackage
qtwebengine_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))
os.chdir(qtwebengine_root)
@@ -58,85 +33,107 @@ def isInChromiumBlacklist(file_path):
if file_path.endswith('.gn') or file_path.endswith('.gni') or file_path.endswith('.typemap') or \
file_path.endswith('.mojom'):
return False
+ # Add android dependencies info so gn build tree can be parsed
+ if file_path.endswith('.info') or file_path.endswith('.pydeps'):
+ return False
+ if file_path.endswith('.mailmap') or file_path.endswith('.tat.gz.sha1'):
+ return True
if (file_path.startswith('android_webview')
or file_path.startswith('apps/')
or file_path.startswith('ash/')
- or file_path.startswith('base/android')
or file_path.startswith('buildtools/clang_format/script')
or file_path.startswith('buildtools/third_party/libc++')
or file_path.startswith('buildtools/third_party/libc++abi')
or file_path.startswith('buildtools/third_party/libunwind')
- or (file_path.startswith('chrome/') and
- not file_path.startswith('chrome/VERSION') and
- not file_path.startswith('chrome/app/resources/') and
- not file_path.startswith('chrome/app/theme/') and
- not file_path.startswith('chrome/browser/chrome_notification_types.h') and
- not file_path.startswith('chrome/browser/accessibility/') and
- not file_path.startswith('chrome/browser/custom_handlers/') and
- not file_path.startswith('chrome/browser/devtools/') and
- not file_path.startswith('chrome/browser/extensions/api/') and
- not file_path.startswith('chrome/browser/media/webrtc/') and
- not file_path.startswith('chrome/browser/net/') and
- not file_path.startswith('chrome/browser/prefs/') and
- not file_path.startswith('chrome/browser/printing/') and
- not file_path.startswith('chrome/browser/renderer_host/') and
- not file_path.startswith('chrome/browser/spellchecker') and
- not file_path.startswith('chrome/browser/ui/webui/') and
- not (file_path.startswith('chrome/browser/resources/') and
- not '/chromeos/' in file_path and
- not '/settings/' in file_path and
- not '/mediarouter/' in file_path) and
- not (file_path.startswith('chrome/common/') and not file_path.startswith('chrome/common/extensions/docs')) and
- not file_path.startswith('chrome/renderer/') and
- not file_path.startswith('chrome/tools/convert_dict/') and
- not file_path.endswith('.grd') and
- not file_path.endswith('.grdp') and
- not file_path.endswith('chrome_version.rc.version'))
+ or (file_path.startswith('chrome/')
+ and not file_path.startswith('chrome/VERSION')
+ and not file_path.startswith('chrome/app/resources/')
+ and not file_path.startswith('chrome/app/theme/')
+ and not file_path.startswith('chrome/browser/chrome_notification_types.h')
+ and not file_path.startswith('chrome/browser/accessibility/')
+ and not file_path.startswith('chrome/browser/custom_handlers/')
+ and not file_path.startswith('chrome/browser/devtools/')
+ and not file_path.startswith('chrome/browser/extensions/api/')
+ and not file_path.startswith('chrome/browser/gcm/')
+ and not file_path.startswith('chrome/browser/media/webrtc/')
+ and not file_path.startswith('chrome/browser/net/')
+ and not file_path.startswith('chrome/browser/prefs/')
+ and not file_path.startswith('chrome/browser/printing/')
+ and not file_path.startswith('chrome/browser/profiles/incognito_helpers')
+ and not file_path.startswith('chrome/browser/profiles/profile_keyed_service_factory')
+ and not file_path.startswith('chrome/browser/profiles/profile_selections')
+ and not file_path.startswith('chrome/browser/push_messaging/')
+ and not file_path.startswith('chrome/browser/renderer_host/')
+ and not file_path.startswith('chrome/browser/share/core/')
+ and not file_path.startswith('chrome/browser/share/proto/')
+ and not file_path.startswith('chrome/browser/signin/')
+ and not file_path.startswith('chrome/browser/spellchecker')
+ and not file_path.startswith('chrome/browser/tab_contents/')
+ and not file_path.startswith('chrome/browser/ui/webui/')
+ and not (file_path.startswith('chrome/browser/resources/')
+ and not '/chromeos/' in file_path
+ and not '/settings/' in file_path
+ and not '/mediarouter/' in file_path)
+ and not (file_path.startswith('chrome/common/')
+ and not file_path.startswith('chrome/common/extensions/docs'))
+ and not file_path.startswith('chrome/renderer/')
+ and not file_path.startswith('chrome/test/chromedriver/')
+ and not file_path.startswith('chrome/tools/convert_dict/')
+ and not file_path.endswith('.grd')
+ and not file_path.endswith('.grdp')
+ and not file_path.endswith('chrome_version.rc.version')
+ and not file_path.endswith('service_sandbox_type.h'))
or file_path.startswith('chrome_elf')
or file_path.startswith('chromecast')
or file_path.startswith('chromeos')
or file_path.startswith('cloud_print')
- or (file_path.startswith('components/') and (
- file_path.startswith('components/chrome_apps/')
+ or (file_path.startswith('components/')
+ and (file_path.startswith('components/chrome_apps/')
or file_path.startswith('components/cronet/')
or file_path.startswith('components/drive/')
or file_path.startswith('components/invalidation/')
- or file_path.startswith('components/gcm_driver/')
or file_path.startswith('components/nacl/')
or file_path.startswith('components/omnibox/')
- or file_path.startswith('components/policy/')
+ or file_path.startswith('components/policy/resources/')
or file_path.startswith('components/proximity_auth/')
- or (file_path.startswith('components/resources/terms/') and not file_path.endswith('terms_chromium.html'))
+ or (file_path.startswith('components/resources/terms/')
+ and not file_path.endswith('terms_chromium.html'))
or file_path.startswith('components/rlz/')
- or file_path.startswith('components/sync/') and not file_path.endswith('ordinal.h')
+ or (file_path.startswith('components/sync/')
+ and not file_path.endswith('ordinal.h'))
or file_path.startswith('components/test/')
or file_path.startswith('components/test_runner/')
or file_path.startswith('components/translate/')
))
or file_path.startswith('content/public/android/java')
- or (file_path.startswith('content/shell') and
- not file_path.startswith('content/shell/common') and
- not file_path.endswith('.grd'))
+ or file_path.startswith('content/shell/android/')
+ or file_path.startswith('content/shell/browser/')
or file_path.startswith('courgette')
+ or file_path.startswith('docs/website/')
or file_path.startswith('google_update')
or file_path.startswith('ios')
or file_path.startswith('media/base/android/java')
or file_path.startswith('native_client_sdk')
or file_path.startswith('net/android/java')
- or (file_path.startswith('net/data/') and '_unittest/' in file_path)
+ or (file_path.startswith('net/data/')
+ and '_unittest/' in file_path)
or file_path.startswith('net/data/fuzzer_data/')
- or file_path.startswith('net/third_party/quic/core/qpack/fuzzer')
- or file_path.startswith('remoting')
+ or (file_path.startswith('remoting')
+ and not file_path.endswith('VERSION')
+ and not file_path.endswith('branding_Chromium')
+ and not file_path.endswith('remove_spaces.py'))
or file_path.startswith('rlz')
or file_path.startswith('testing/android')
or file_path.startswith('testing/buildbot')
- or (file_path.startswith('third_party/') and (
- file_path.startswith('third_party/WebKit/LayoutTests')
+ or (file_path.startswith('third_party/')
+ and (file_path.startswith('third_party/WebKit/LayoutTests')
or file_path.startswith('third_party/accessibility')
or file_path.startswith('third_party/afl')
or file_path.startswith('third_party/android_')
+ or file_path.startswith('third_party/androidx')
or file_path.startswith('third_party/angle/third_party/deqp')
or file_path.startswith('third_party/angle/third_party/glmark2')
+ or file_path.startswith('third_party/angle/third_party/VK-GL-CTS')
or file_path.startswith('third_party/angle/third_party/vulkan-validation-layers')
or file_path.startswith('third_party/apache-')
or file_path.startswith('third_party/arcode-android-sdk')
@@ -146,26 +143,76 @@ def isInChromiumBlacklist(file_path):
or file_path.startswith('third_party/blink/web_tests/')
or file_path.startswith('third_party/breakpad/src/processor/testdata/')
or file_path.startswith('third_party/boringssl/crypto_test_data.cc')
- or file_path.startswith('third_party/boringssl/src/fuzz')
- or (file_path.startswith('third_party/cacheinvalidation') and
- not file_path.endswith('isolate'))
+ or (file_path.startswith('third_party/cacheinvalidation')
+ and not file_path.endswith('isolate'))
or (file_path.startswith('third_party/catapult/')
- and not file_path.startswith('third_party/catapult/catapult_build')
- and not file_path.startswith('third_party/catapult/common')
- and not file_path.startswith('third_party/catapult/third_party/polymer/components/polymer')
- and not file_path.startswith('third_party/catapult/tracing'))
+ and not file_path.startswith('third_party/catapult/catapult_build')
+ and not file_path.startswith('third_party/catapult/common')
+ and not file_path.startswith('third_party/catapult/third_party/beautifulsoup4')
+ and not file_path.startswith('third_party/catapult/third_party/html5lib-python')
+ and not file_path.startswith('third_party/catapult/third_party/polymer')
+ and not file_path.startswith('third_party/catapult/third_party/six')
+ and not file_path.startswith('third_party/catapult/tracing'))
or file_path.startswith('third_party/catapult/tracing/test_data/')
or file_path.startswith('third_party/chromevox')
or file_path.startswith('third_party/chromite')
or file_path.startswith('third_party/colorama')
or file_path.startswith('third_party/depot_tools')
- or file_path.startswith('third_party/devtools-frontend/src/node-modules/')
+ or file_path.startswith('third_party/devtools-frontend/src/third_party/image_diff')
+ or (file_path.startswith('third_party/node/node_modules/')
+ and not file_path.startswith('third_party/node/node_modules/@babel/')
+ and not file_path.startswith('third_party/node/node_modules/@types/d3')
+ and not file_path.startswith('third_party/node/node_modules/@types/trusted-types/')
+ and not file_path.startswith('third_party/node/node_modules/ansi-styles/')
+ and not file_path.startswith('third_party/node/node_modules/balanced-match/')
+ and not file_path.startswith('third_party/node/node_modules/brace-expansion/')
+ and not file_path.startswith('third_party/node/node_modules/cancel-token/')
+ and not file_path.startswith('third_party/node/node_modules/chalk/')
+ and not file_path.startswith('third_party/node/node_modules/color-convert/')
+ and not file_path.startswith('third_party/node/node_modules/color-name/')
+ and not file_path.startswith('third_party/node/node_modules/commander/')
+ and not file_path.startswith('third_party/node/node_modules/concat-map/')
+ and not file_path.startswith('third_party/node/node_modules/cssbeautify/')
+ and not file_path.startswith('third_party/node/node_modules/debug/')
+ and not file_path.startswith('third_party/node/node_modules/escape-string-regexp/')
+ and not file_path.startswith('third_party/node/node_modules/esutils/')
+ and not file_path.startswith('third_party/node/node_modules/function-bind/')
+ and not file_path.startswith('third_party/node/node_modules/globals/')
+ and not file_path.startswith('third_party/node/node_modules/has-ansi/')
+ and not file_path.startswith('third_party/node/node_modules/has-flag/')
+ and not file_path.startswith('third_party/node/node_modules/has/')
+ and not file_path.startswith('third_party/node/node_modules/indent/')
+ and not file_path.startswith('third_party/node/node_modules/is-core-module/')
+ and not file_path.startswith('third_party/node/node_modules/is-windows/')
+ and not file_path.startswith('third_party/node/node_modules/@jridgewell/')
+ and not file_path.startswith('third_party/node/node_modules/js-tokens/')
+ and not file_path.startswith('third_party/node/node_modules/jsesc/')
+ and not file_path.startswith('third_party/node/node_modules/jsonschema/')
+ and not file_path.startswith('third_party/node/node_modules/lodash.camelcase/')
+ and not file_path.startswith('third_party/node/node_modules/lodash.sortby/')
+ and not file_path.startswith('third_party/node/node_modules/minimatch/')
+ and not file_path.startswith('third_party/node/node_modules/ms/')
+ and not file_path.startswith('third_party/node/node_modules/path-is-inside/')
+ and not file_path.startswith('third_party/node/node_modules/polymer-analyzer/')
+ and not file_path.startswith('third_party/node/node_modules/polymer-css-build/')
+ and not file_path.startswith('third_party/node/node_modules/resolve/')
+ and not file_path.startswith('third_party/node/node_modules/rollup/')
+ and not file_path.startswith('third_party/node/node_modules/shady-css-parser/')
+ and not file_path.startswith('third_party/node/node_modules/source-map/')
+ and not file_path.startswith('third_party/node/node_modules/stable/')
+ and not file_path.startswith('third_party/node/node_modules/supports-color/')
+ and not file_path.startswith('third_party/node/node_modules/terser/')
+ and not file_path.startswith('third_party/node/node_modules/to-fast-properties/')
+ and not file_path.startswith('third_party/node/node_modules/tr46/')
+ and not file_path.startswith('third_party/node/node_modules/typescript/')
+ and not file_path.startswith('third_party/node/node_modules/vscode-uri/')
+ and not file_path.startswith('third_party/node/node_modules/webidl-conversions/')
+ and not file_path.startswith('third_party/node/node_modules/whatwg-url/'))
or file_path.startswith('third_party/fuschsia-sdk/')
or file_path.startswith('third_party/glslang/src/Test/')
or file_path.startswith('third_party/google_')
or file_path.startswith('third_party/grpc/')
or file_path.startswith('third_party/hunspell_dictionaries')
- or file_path.startswith('third_party/icu/android')
or file_path.startswith('third_party/icu/cast')
or file_path.startswith('third_party/icu/chromeos')
or file_path.startswith('third_party/instrumented_libraries')
@@ -177,8 +224,7 @@ def isInChromiumBlacklist(file_path):
or file_path.startswith('third_party/libFuzzer')
or file_path.startswith('third_party/liblouis')
or file_path.startswith('third_party/libphonenumber')
- or file_path.startswith('third_party/libwebp/fuzzing')
- or file_path.startswith('third_party/libwebm/source/webm_parser/fuzzing')
+ or file_path.startswith('third_party/libunwindstack')
or file_path.startswith('third_party/logilab')
or file_path.startswith('third_party/markdown')
or file_path.startswith('third_party/openh264/src/res')
@@ -191,56 +237,66 @@ def isInChromiumBlacklist(file_path):
or file_path.startswith('third_party/sfntly/src/java')
or file_path.startswith('third_party/skia/docs/')
or file_path.startswith('third_party/skia/infra')
+ or file_path.startswith('third_party/skia/site/docs/dev/tools/calendar.mskp')
or file_path.startswith('third_party/sqlite/sqlite-src-')
- or file_path.startswith('third_party/speech-dispatcher')
or file_path.startswith('third_party/spirv-cross/spirv-cross/reference/')
or file_path.startswith('third_party/swiftshader/third_party/')
+ or file_path.startswith('third_party/tflite/')
+ or file_path.startswith('third_party/unrar')
or file_path.startswith('third_party/wayland')
or file_path.startswith('third_party/webgl')
or file_path.startswith('third_party/webrtc/resources/')
or file_path.startswith('third_party/webrtc/third_party/boringssl/crypto_test_data.cc')
- or file_path.startswith('third_party/webrtc/third_party/boringssl/src/fuzz')
))
- or (file_path.startswith('tools/') and (
- file_path.startswith('tools/android')
- or file_path.startswith('tools/luci_go')
- or file_path.startswith('tools/memory_inspector')
- or file_path.startswith('tools/perf')
- or file_path.startswith('tools/swarming_client')
+ or (file_path.startswith('tools/')
+ and (file_path.startswith('tools/android')
+ or file_path.startswith('tools/luci_go')
+ or file_path.startswith('tools/memory_inspector')
+ or file_path.startswith('tools/perf')
+ or file_path.startswith('tools/swarming_client')
))
- or (file_path.startswith('ui/') and (
- file_path.startswith('ui/android/java')
- or file_path.startswith('ui/app_list')
- or file_path.startswith('ui/base/ime/chromeos')
- or file_path.startswith('ui/chromeos')
- or file_path.startswith('ui/display/chromeos')
- or file_path.startswith('ui/events/ozone/chromeos')
- or file_path.startswith('ui/file_manager')
- or file_path.startswith('ui/gfx/chromeos')
+ or (file_path.startswith('ui/')
+ and (file_path.startswith('ui/android/java')
+ or file_path.startswith('ui/app_list')
+ or file_path.startswith('ui/base/ime/chromeos')
+ or file_path.startswith('ui/chromeos')
+ or file_path.startswith('ui/display/chromeos')
+ or file_path.startswith('ui/events/ozone/chromeos')
+ or file_path.startswith('ui/file_manager')
+ or file_path.startswith('ui/gfx/chromeos')
))
- or ('/fuzz' in file_path and (
- '/fuzz/' in file_path
- or '/fuzzer/' in file_path
- or '/fuzzers/' in file_path
- or '/fuzzing/' in file_path
+ or '/android/java/' in file_path
+ or ('/fuzz' in file_path
+ and ('/fuzz/' in file_path
+ or '/fuzzer/' in file_path
+ or '/fuzzers/' in file_path
+ or '/fuzzing/' in file_path
))
- or ('/test' in file_path and (
- '/testdata/' in file_path
- or '/tests/' in file_path
- or ('/test/' in file_path and
- not '/webrtc/' in file_path and
- not file_path.startswith('net/test/') and
- not file_path.endswith('mock_chrome_application_mac.h') and
- not file_path.endswith('test_mock_time_task_runner.h') and
- not file_path.endswith('perftimer.h') and
- not file_path.endswith('test-torque.tq') and
- not file_path.endswith('fonts.conf') and
- not 'ozone' in file_path and
- not 'clang_coverage' in file_path and
- not 'crypto/test/trampoline' in file_path and
- not 'fontconfig_util_linux' in file_path and
- not 'core/mojo/test/' in file_path and
- not file_path.startswith('extensions/browser/'))
+ or ('/test' in file_path
+ and ('/testdata/' in file_path
+ or '/tests/' in file_path
+ or ('/test/' in file_path
+ and not '/webrtc/' in file_path
+ and not file_path.startswith('net/test/')
+ and not file_path.startswith('chrome/test/chromedriver/')
+ and not file_path.endswith('test_hook.h')
+ and not file_path.endswith('perftimer.h')
+ and not file_path.endswith('test-torque.tq')
+ and not 'ozone' in file_path
+ and not 'clang_coverage' in file_path
+ and not 'crypto/test/trampoline' in file_path
+ and not 'core/mojo/test/' in file_path
+ and not file_path.startswith('extensions/browser/')
+ and
+ (not file_path.startswith('base/test/')
+ or file_path.startswith('base/test/android/')
+ or file_path.startswith('base/test/data/')
+ or file_path.startswith('base/test/ios/')
+ or file_path.startswith('base/test/launcher/')
+ or file_path.startswith('base/test/library_loader/')
+ or file_path.startswith('base/test/metrics/')
+ )
+ )
))):
return True
return False
@@ -249,7 +305,7 @@ def printProgress(current, total):
sys.stdout.write("\r{} of {}".format(current, total))
sys.stdout.flush()
-def copyFile(src, dst):
+def copyFile(src, dst, use_link = True, force_remove = False):
src = os.path.abspath(src)
dst = os.path.abspath(dst)
dst_dir = os.path.dirname(dst)
@@ -257,16 +313,19 @@ def copyFile(src, dst):
if not os.path.isdir(dst_dir):
os.makedirs(dst_dir)
- if os.path.exists(dst):
+ if force_remove or os.path.exists(dst):
os.remove(dst)
try:
- os.link(src, dst)
+ if use_link:
+ os.link(src, dst)
+ else:
+ shutil.copy(src,dst)
# Qt uses LF-only but Chromium isn't.
subprocess.call(['dos2unix', '--keep-bom', '--quiet', dst])
except OSError as exception:
if exception.errno == errno.ENOENT:
- print 'file does not exist:' + src
+ print('file does not exist: ' + src)
else:
raise
@@ -276,10 +335,10 @@ third_party = os.path.join(qtwebengine_root, 'src/3rdparty')
def clearDirectory(directory):
currentDir = os.getcwd()
os.chdir(directory)
- print 'clearing the directory:' + directory
+ print('clearing the directory:' + directory)
for direntry in os.listdir(directory):
if not direntry == '.git' and os.path.isdir(direntry):
- print 'clearing:' + direntry
+ print('clearing:' + direntry)
shutil.rmtree(direntry)
os.chdir(currentDir)
@@ -293,17 +352,27 @@ def listFilesInCurrentRepository(use_deps=False):
files.append(os.path.join(submodule.pathRelativeToTopMostSupermodule(), submodule_file))
return files
+def listPackageFilesInCurrentRepositoryForPackage(packageName):
+ cipd = CIPDPackage.CIPDEntity(os.getcwd())
+ cipd_entities = cipd.readEntities()
+ files = []
+ for e in cipd_entities:
+ pkg = e.findPackage(CIPDPackage.androidx_package_name)
+ if pkg:
+ files.extend(pkg.listFiles())
+ return files
+
def exportGn():
third_party_upstream_gn = os.path.join(third_party_upstream, 'gn')
third_party_gn = os.path.join(third_party, 'gn')
os.makedirs(third_party_gn);
- print 'exporting contents of:' + third_party_upstream_gn
+ print('exporting contents of:' + third_party_upstream_gn)
os.chdir(third_party_upstream_gn)
files = listFilesInCurrentRepository()
- print 'copying files to ' + third_party_gn
- for i in xrange(len(files)):
+ print('copying files to ' + third_party_gn)
+ for i in range(len(files)):
printProgress(i+1, len(files))
- f = files[i]
+ f = files[i].decode()
if not isInGitBlacklist(f):
copyFile(f, os.path.join(third_party_gn, f))
print("")
@@ -312,13 +381,13 @@ def exportNinja():
third_party_upstream_ninja = os.path.join(third_party_upstream, 'ninja')
third_party_ninja = os.path.join(third_party, 'ninja')
os.makedirs(third_party_ninja);
- print 'exporting contents of:' + third_party_upstream_ninja
+ print('exporting contents of:' + third_party_upstream_ninja)
os.chdir(third_party_upstream_ninja)
files = listFilesInCurrentRepository()
- print 'copying files to ' + third_party_ninja
- for i in xrange(len(files)):
+ print('copying files to ' + third_party_ninja)
+ for i in range(len(files)):
printProgress(i+1, len(files))
- f = files[i]
+ f = files[i].decode()
if not isInGitBlacklist(f):
copyFile(f, os.path.join(third_party_ninja, f))
print("")
@@ -327,36 +396,60 @@ def exportChromium():
third_party_upstream_chromium = os.path.join(third_party_upstream, 'chromium')
third_party_chromium = os.path.join(third_party, 'chromium')
os.makedirs(third_party_chromium);
- print 'exporting contents of:' + third_party_upstream_chromium
+ print('exporting contents of:' + third_party_upstream_chromium)
os.chdir(third_party_upstream_chromium)
files = listFilesInCurrentRepository(True)
# Add LASTCHANGE files which are not tracked by git.
- files.append('build/util/LASTCHANGE')
- files.append('build/util/LASTCHANGE.committime')
- files.append('skia/ext/skia_commit_hash.h')
- files.append('gpu/config/gpu_lists_version.h')
- print 'copying files to ' + third_party_chromium
- for i in xrange(len(files)):
+ files.append(b'build/util/LASTCHANGE')
+ files.append(b'build/util/LASTCHANGE.committime')
+ files.append(b'skia/ext/skia_commit_hash.h')
+ files.append(b'gpu/config/gpu_lists_version.h')
+
+ files.extend(listPackageFilesInCurrentRepositoryForPackage(CIPDPackage.androidx_package_name))
+
+ for root, directories, local_files in os.walk(third_party_upstream_chromium + '/third_party/node/node_modules'):
+ for name in local_files:
+ f = os.path.relpath(os.path.join(root, name))
+ files.append(f)
+
+ symlinks = []
+ print('copying files to ' + third_party_chromium)
+ for i in range(len(files)):
printProgress(i+1, len(files))
- f = files[i]
+ if isinstance(files[i], bytes):
+ f = files[i].decode()
+ else:
+ f = files[i]
if not isInChromiumBlacklist(f) and not isInGitBlacklist(f):
- copyFile(f, os.path.join(third_party_chromium, f))
+ d = os.path.join(third_party_chromium, f)
+ copyFile(f,d)
+ # make sure we did not make a hardlink of symlink which is broken afterwards
+ if os.path.islink(f):
+ symlinks.append((f,d))
+ # this is mostly used for files coming from cipd packages
+ for s in symlinks:
+ if not os.path.exists(s[1]):
+ print('fixing ivalid link ' + s[1])
+ copyFile(s[0],s[1], use_link = False, force_remove = True)
+
+ # We need to gzip transport_security_state_static.json since it is otherwise too big for our git configuration:
+ subprocess.call(['gzip', '-n', third_party_chromium + '/net/http/transport_security_state_static.json'])
print("")
commandNotFound = subprocess.call(['which', 'dos2unix'])
if not commandNotFound:
- dos2unixVersion , err = subprocess.Popen(['dos2unix', '-V', '| true'], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
+ dos2unixVersion, err = subprocess.Popen(['dos2unix', '-V', '| true'], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
if not dos2unixVersion:
raise Exception("You need dos2unix version 6.0.6 minimum.")
- dos2unixVersion = StrictVersion(dos2unixVersion.splitlines()[0].split()[1])
+ dos2unixVersion = StrictVersion(dos2unixVersion.splitlines()[0].split()[1].decode())
if commandNotFound or dos2unixVersion < StrictVersion('6.0.6'):
raise Exception("You need dos2unix version 6.0.6 minimum.")
os.chdir(third_party)
ignore_case_setting = subprocess.Popen(['git', 'config', '--get', 'core.ignorecase'], stdout=subprocess.PIPE).communicate()[0]
-if 'true' in ignore_case_setting:
+if b'true' in ignore_case_setting:
raise Exception("Your 3rdparty repository is configured to ignore case. "
"A snapshot created with these settings would cause problems on case sensitive file systems.")
@@ -366,5 +459,5 @@ exportGn()
exportNinja()
exportChromium()
-print 'done.'
+print('done.')
diff --git a/tools/scripts/update_change_ids.py b/tools/scripts/update_change_ids.py
index 481d8424d..64149d2b6 100755
--- a/tools/scripts/update_change_ids.py
+++ b/tools/scripts/update_change_ids.py
@@ -1,32 +1,6 @@
#!/usr/bin/env python
-
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the QtWebEngine module of the Qt Toolkit.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
+# Copyright (C) 2016 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
import glob
import subprocess
diff --git a/tools/scripts/version_resolver.py b/tools/scripts/version_resolver.py
index b3181db10..a29ee34e8 100644
--- a/tools/scripts/version_resolver.py
+++ b/tools/scripts/version_resolver.py
@@ -1,32 +1,6 @@
#!/usr/bin/env python
-
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the QtWebEngine module of the Qt Toolkit.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
+# Copyright (C) 2016 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
import glob
import os
@@ -35,11 +9,42 @@ import shutil
import subprocess
import sys
import json
-import urllib2
+import urllib3
import git_submodule as GitSubmodule
-
-chromium_version = '80.0.3987.163'
-chromium_branch = '3987'
+from abc import ABC, abstractmethod
+
+class DEPSParser(ABC):
+ def __init__(self):
+ self.global_scope = {
+ 'Var': lambda var_name: '{%s}' % var_name,
+ 'Str': str,
+ 'deps_os': {},
+ }
+ self.local_scope = {}
+ self.topmost_supermodule_path_prefix = ''
+
+ def subdir(self, dep):
+ if dep.startswith('src/'):
+ return dep[4:]
+ # Don't skip submodules that have a supermodule path prefix set (at the moment these
+ # are 2nd level deep submodules).
+ elif not self.topmost_supermodule_path_prefix:
+ # Ignore the information about chromium itself since we get that from git,
+ # also ignore anything outside src/ (e.g. depot_tools)
+ return None
+ else:
+ return dep
+
+ @abstractmethod
+ def parse(self):
+ pass
+
+ def get_recursedeps(self):
+ return self.local_scope["recursedeps"]
+
+
+chromium_version = '118.0.5993.220'
+chromium_branch = '5993'
ninja_version = 'v1.8.2'
json_url = 'http://omahaproxy.appspot.com/all.json'
@@ -49,12 +54,18 @@ snapshot_src_dir = os.path.abspath(os.path.join(qtwebengine_root, 'src/3rdparty'
upstream_src_dir = os.path.abspath(snapshot_src_dir + '_upstream')
submodule_blacklist = [
- 'third_party/WebKit/LayoutTests/w3c/csswg-test'
- , 'third_party/WebKit/LayoutTests/w3c/web-platform-tests'
- , 'chrome/tools/test/reference_build/chrome_mac'
- , 'chrome/tools/test/reference_build/chrome_linux'
- , 'chrome/tools/test/reference_build/chrome_win'
- ]
+ 'buildtools/clang_format/script',
+ 'buildtools/third_party/libc++/trunk',
+ 'buildtools/third_party/libc++abi/trunk',
+ 'buildtools/third_party/libunwind/trunk',
+ 'chrome/browser/resources/chromeos/quickoffice',
+ 'remoting/host/installer/linux/internal',
+ 'third_party/widevine/cdm/chromeos',
+ 'third_party/widevine/cdm/linux',
+ 'third_party/widevine/test/license_server',
+ 'ui/file_manager/internal'
+]
+submodule_whitelist = [ 'src/third_party/android_ndk' , 'src/third_party/libunwindstack' ]
sys.path.append(os.path.join(qtwebengine_root, 'tools', 'scripts'))
@@ -77,11 +88,11 @@ def readReleaseChannels():
channels[os].append({ 'channel': ver['channel'], 'version': ver['version'], 'branch': ver['true_branch'] })
return channels
-def readSubmodules():
+def read(parserCls):
git_deps = subprocess.check_output(['git', 'show', chromium_version +':DEPS'])
- parser = GitSubmodule.DEPSParser()
- git_submodules = parser.parse(git_deps)
+ parser = parserCls()
+ git_submodules = parser.parse(git_deps, submodule_whitelist)
submodule_dict = {}
@@ -89,8 +100,6 @@ def readSubmodules():
submodule_dict[sub.path] = sub
extradeps_dirs = parser.get_recursedeps()
- # Add buildtools submodules
- extradeps_dirs.append('buildtools')
for extradeps_dir in extradeps_dirs:
if extradeps_dir.startswith('src/'):
@@ -100,7 +109,7 @@ def readSubmodules():
with open(extra_deps_file_path, 'r') as extra_deps_file:
extra_deps = extra_deps_file.read()
if extra_deps:
- extradeps_parser = GitSubmodule.DEPSParser()
+ extradeps_parser = parserCls()
extradeps_parser.topmost_supermodule_path_prefix = extradeps_dir
extradeps_submodules = extradeps_parser.parse(extra_deps)
for sub in extradeps_submodules:
@@ -165,7 +174,7 @@ def resetUpstream():
chromium = GitSubmodule.Submodule()
chromium.path = "."
- submodules = chromium.readSubmodules()
+ submodules = chromium.readSubmodules(True)
submodules.append(chromium)
print('-- resetting upstream submodules in ' + os.path.relpath(target_dir) + ' to baseline --')
diff --git a/tools/scripts/windeploy-examples.py b/tools/scripts/windeploy-examples.py
index 3b2b42318..ef0e195aa 100755
--- a/tools/scripts/windeploy-examples.py
+++ b/tools/scripts/windeploy-examples.py
@@ -1,32 +1,6 @@
#!/usr/bin/env python
-
-#############################################################################
-##
-## Copyright (C) 2015 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the QtWebEngine module of the Qt Toolkit.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
+# Copyright (C) 2015 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
import argparse
import os